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

450 lines
1.6 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[50,3,5,6,7,8,14,16],{"+NIl":function(Bt,ve,T){(function(Z){Z(T("VrN/"))})(function(Z){"use strict";Z.defineMode("stex",function(V,j){"use strict";function G(l,o){l.cmdState.push(o)}function M(l){return l.cmdState.length>0?l.cmdState[l.cmdState.length-1]:null}function I(l){var o=l.cmdState.pop();o&&o.closeBracket()}function W(l){for(var o=l.cmdState,s=o.length-1;s>=0;s--){var t=o[s];if(t.name=="DEFAULT")continue;return t}return{styleIdentifier:function(){return null}}}function C(l,o,s){return function(){this.name=l,this.bracketNo=0,this.style=o,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=C("importmodule","tag",["string","builtin"]),r.documentclass=C("documentclass","tag",["","atom"]),r.usepackage=C("usepackage","tag",["atom"]),r.begin=C("begin","tag",["atom"]),r.end=C("end","tag",["atom"]),r.label=C("label","tag",["atom"]),r.ref=C("ref","tag",["atom"]),r.eqref=C("eqref","tag",["atom"]),r.cite=C("cite","tag",["atom"]),r.bibitem=C("bibitem","tag",["atom"]),r.Bibitem=C("Bibitem","tag",["atom"]),r.RBibitem=C("RBibitem","tag",["atom"]),r.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function A(l,o){l.f=o}function v(l,o){var s;if(l.match(/^\\[a-zA-Z@]+/)){var t=l.current().slice(1);return s=r.hasOwnProperty(t)?r[t]:r.DEFAULT,s=new s,G(o,s),A(o,p),s.style}if(l.match(/^\\[$&%#{}_]/))return"tag";if(l.match(/^\\[,;!\/\\]/))return"tag";if(l.match("\\["))return A(o,function(a,i){return f(a,i,"\\]")}),"keyword";if(l.match("\\("))return A(o,function(a,i){return f(a,i,"\\)")}),"keyword";if(l.match("$$"))return A(o,function(a,i){return f(a,i,"$$")}),"keyword";if(l.match("$"))return A(o,function(a,i){return f(a,i,"$")}),"keyword";var u=l.next();if(u=="%")return l.skipToEnd(),"comment";if(u=="}"||u=="]"){if(s=M(o),s)s.closeBracket(u),A(o,p);else return"error";return"bracket"}else return u=="{"||u=="["?(s=r.DEFAULT,s=new s,G(o,s),"bracket"):/\d/.test(u)?(l.eatWhile(/[\w.%]/),"atom"):(l.eatWhile(/[\w\-_]/),s=W(o),s.name=="begin"&&(s.argument=l.current()),s.styleIdentifier())}function f(l,o,s){if(l.eatSpace())return null;if(s&&l.match(s))return A(o,v),"keyword";if(l.match(/^\\[a-zA-Z@]+/))return"tag";if(l.match(/^[a-zA-Z]+/))return"variable-2";if(l.match(/^\\[$&%#{}_]/))return"tag";if(l.match(/^\\[,;!\/]/))return"tag";if(l.match(/^[\^_&]/))return"tag";if(l.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(l.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var t=l.next();return t=="{"||t=="}"||t=="["||t=="]"||t=="("||t==")"?"bracket":t=="%"?(l.skipToEnd(),"comment"):"error"}function p(l,o){var s=l.peek(),t;return s=="{"||s=="["?(t=M(o),t.openBracket(s),l.eat(s),A(o,v),"bracket"):/[ \t\r]/.test(s)?(l.eat(s),null):(A(o,v),I(o),v(l,o))}return{startState:function(){var l=j.inMathMode?function(o,s){return f(o,s)}:v;return{cmdState:[],f:l}},copyState:function(l){return{cmdState:l.cmdState.slice(),f:l.f}},token:function(l,o){return o.f(l,o)},blankLine:function(l){l.f=v,l.cmdState.length=0},lineComment:"%"}}),Z.defineMIME("text/x-stex","stex"),Z.defineMIME("text/x-latex","stex")})},"+ua5":function(Bt,ve,T){},"/cxE":function(Bt,ve,T){"use strict";T.d(ve,"f",function(){return j}),T.d(ve,"g",function(){return G}),T.d(ve,"h",function(){return M}),T.d(ve,"e",function(){return W}),T.d(ve,"b",function(){return C}),T.d(ve,"c",function(){return r}),T.d(ve,"d",function(){return A}),T.d(ve,"a",function(){return v});class Z{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 V=new Z;function j(f){W(f)||V.onUnexpectedError(f);return}function G(f){W(f)||V.onUnexpectedExternalError(f);return}function M(f){if(f instanceof Error){let{name:p,message:l}=f;const o=f.stacktrace||f.stack;return{$isError:!0,name:p,message:l,stack:o}}return f}const I="Canceled";function W(f){return f instanceof Error&&f.name===I&&f.message===I}function C(){const f=new Error(I);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 v extends Error{constructor(f){super("NotSupported");f&&(this.message=f)}}},"/iVV":function(Bt,ve,T){Bt.exports={flex_box_center:"flex_box_center___2FARP",flex_space_between:"flex_space_between___oDbHE",flex_box_vertical_center:"flex_box_vertical_center___30YaW",flex_box_center_end:"flex_box_center_end___2jDbg",flex_box_column:"flex_box_column___34FVf",top:"top___3fhcI",desc:"desc___1KGAw",liked:"liked___peMDs",likedActive:"likedActive___3FVHj",reply:"reply___-RXGA",replyList:"replyList___3zoOQ",comment:"comment___lxBqi",headpic:"headpic___2JDco"}},"19Vz":function(Bt,ve,T){(function(Z){Z(T("VrN/"))})(function(Z){Z.defineOption("placeholder","",function(C,r,A){var v=A&&A!=Z.Init;if(r&&!v)C.on("blur",M),C.on("change",I),C.on("swapDoc",I),Z.on(C.getInputField(),"compositionupdate",C.state.placeholderCompose=function(){G(C)}),I(C);else if(!r&&v){C.off("blur",M),C.off("change",I),C.off("swapDoc",I),Z.off(C.getInputField(),"compositionupdate",C.state.placeholderCompose),V(C);var f=C.getWrapperElement();f.className=f.className.replace(" CodeMirror-empty","")}r&&!C.hasFocus()&&M(C)});function V(C){C.state.placeholder&&(C.state.placeholder.parentNode.removeChild(C.state.placeholder),C.state.placeholder=null)}function j(C){V(C);var r=C.state.placeholder=document.createElement("pre");r.style.cssText="height: 0; overflow: visible",r.style.direction=C.getOption("direction"),r.className="CodeMirror-placeholder CodeMirror-line-like";var A=C.getOption("placeholder");typeof A=="string"&&(A=document.createTextNode(A)),r.appendChild(A),C.display.lineSpace.insertBefore(r,C.display.lineSpace.firstChild)}function G(C){setTimeout(function(){var r=!1,A=C.getInputField();A.nodeName=="TEXTAREA"?r=!A.value:C.lineCount()==1&&(r=!/[^\u200b]/.test(A.querySelector(".CodeMirror-line").textContent)),r?j(C):V(C)},20)}function M(C){W(C)&&j(C)}function I(C){var r=C.getWrapperElement(),A=W(C);r.className=r.className.replace(" CodeMirror-empty","")+(A?" CodeMirror-empty":""),A?j(C):V(C)}function W(C){return C.lineCount()===1&&C.getLine(0)===""}})},"1eCo":function(Bt,ve,T){(function(Z){Z(T("VrN/"))})(function(Z){"use strict";var V={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},j={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};Z.defineMode("xml",function(G,M){var I=G.indentUnit,W={},C=M.htmlMode?V:j;for(var r in C)W[r]=C[r];for(var r in M)W[r]=M[r];var A,v;function f(m,y){function x(F){return y.tokenize=F,F(m,y)}var O=m.next();if(O=="<")return m.eat("!")?m.eat("[")?m.match("CDATA[")?x(o("atom","]]>")):null:m.match("--")?x(o("comment","-->")):m.match("DOCTYPE",!0,!0)?(m.eatWhile(/[\w\._\-]/),x(s(1))):null:m.eat("?")?(m.eatWhile(/[\w\._\-]/),y.tokenize=o("meta","?>"),"meta"):(A=m.eat("/")?"closeTag":"openTag",y.tokenize=p,"tag bracket");if(O=="&"){var H;return m.eat("#")?m.eat("x")?H=m.eatWhile(/[a-fA-F\d]/)&&m.eat(";"):H=m.eatWhile(/[\d]/)&&m.eat(";"):H=m.eatWhile(/[\w\.\-:]/)&&m.eat(";"),H?"atom":"error"}else return m.eatWhile(/[^&<]/),null}f.isInText=!0;function p(m,y){var x=m.next();if(x==">"||x=="/"&&m.eat(">"))return y.tokenize=f,A=x==">"?"endTag":"selfcloseTag","tag bracket";if(x=="=")return A="equals",null;if(x=="<"){y.tokenize=f,y.state=i,y.tagName=y.tagStart=null;var O=y.tokenize(m,y);return O?O+" tag error":"tag error"}else return/[\'\"]/.test(x)?(y.tokenize=l(x),y.stringStartCol=m.column(),y.tokenize(m,y)):(m.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function l(m){var y=function(x,O){for(;!x.eol();)if(x.next()==m){O.tokenize=p;break}return"string"};return y.isInAttribute=!0,y}function o(m,y){return function(x,O){for(;!x.eol();){if(x.match(y)){O.tokenize=f;break}x.next()}return m}}function s(m){return function(y,x){for(var O;(O=y.next())!=null;){if(O=="<")return x.tokenize=s(m+1),x.tokenize(y,x);if(O==">")if(m==1){x.tokenize=f;break}else return x.tokenize=s(m-1),x.tokenize(y,x)}return"meta"}}function t(m,y,x){this.prev=m.context,this.tagName=y,this.indent=m.indented,this.startOfLine=x,(W.doNotIndent.hasOwnProperty(y)||m.context&&m.context.noIndent)&&(this.noIndent=!0)}function u(m){m.context&&(m.context=m.context.prev)}function a(m,y){for(var x;;){if(!m.context)return;if(x=m.context.tagName,!W.contextGrabbers.hasOwnProperty(x)||!W.contextGrabbers[x].hasOwnProperty(y))return;u(m)}}function i(m,y,x){return m=="openTag"?(x.tagStart=y.column(),D):m=="closeTag"?w:i}function D(m,y,x){return m=="word"?(x.tagName=y.current(),v="tag",P):W.allowMissingTagName&&m=="endTag"?(v="tag bracket",P(m,y,x)):(v="error",D)}function w(m,y,x){if(m=="word"){var O=y.current();return x.context&&x.context.tagName!=O&&W.implicitlyClosed.hasOwnProperty(x.context.tagName)&&u(x),x.context&&x.context.tagName==O||W.matchClosing===!1?(v="tag",S):(v="tag error",L)}else return W.allowMissingTagName&&m=="endTag"?(v="tag bracket",S(m,y,x)):(v="error",L)}function S(m,y,x){return m!="endTag"?(v="error",S):(u(x),i)}function L(m,y,x){return v="error",S(m,y,x)}function P(m,y,x){if(m=="word")return v="attribute",_;if(m=="endTag"||m=="selfcloseTag"){var O=x.tagName,H=x.tagStart;return x.tagName=x.tagStart=null,m=="selfcloseTag"||W.autoSelfClosers.hasOwnProperty(O)?a(x,O):(a(x,O),x.context=new t(x,O,H==x.indented)),i}return v="error",P}function _(m,y,x){return m=="equals"?b:(W.allowMissing||(v="error"),P(m,y,x))}function b(m,y,x){return m=="string"?g:m=="word"&&W.allowUnquoted?(v="string",P):(v="error",P(m,y,x))}function g(m,y,x){return m=="string"?g:P(m,y,x)}return{startState:function(m){var y={tokenize:f,state:i,indented:m||0,tagName:null,tagStart:null,context:null};return m!=null&&(y.baseIndent=m),y},token:function(m,y){if(!y.tagName&&m.sol()&&(y.indented=m.indentation()),m.eatSpace())return null;A=null;var x=y.tokenize(m,y);return(x||A)&&x!="comment"&&(v=null,y.state=y.state(A||x,m,y),v&&(x=v=="error"?x+" error":v)),x},indent:function(m,y,x){var O=m.context;if(m.tokenize.isInAttribute)return m.tagStart==m.indented?m.stringStartCol+1:m.indented+I;if(O&&O.noIndent)return Z.Pass;if(m.tokenize!=p&&m.tokenize!=f)return x?x.match(/^(\s*)/)[0].length:0;if(m.tagName)return W.multilineTagIndentPastTag!==!1?m.tagStart+m.tagName.length+2:m.tagStart+I*(W.multilineTagIndentFactor||1);if(W.alignCDATA&&/<!\[CDATA\[/.test(y))return 0;var H=y&&/^<(\/)?([\w_:\.-]*)/.exec(y);if(H&&H[1])for(;O;)if(O.tagName==H[2]){O=O.prev;break}else if(W.implicitlyClosed.hasOwnProperty(O.tagName))O=O.prev;else break;else if(H)for(;O;){var F=W.contextGrabbers[O.tagName];if(F&&F.hasOwnProperty(H[2]))O=O.prev;else break}for(;O&&O.prev&&!O.startOfLine;)O=O.prev;return O?O.indent+I:m.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:W.htmlMode?"html":"xml",helperType:W.htmlMode?"html":"xml",skipAttribute:function(m){m.state==b&&(m.state=P)},xmlCurrentTag:function(m){return m.tagName?{name:m.tagName,close:m.type=="closeTag"}:null},xmlCurrentContext:function(m){for(var y=[],x=m.context;x;x=x.prev)x.tagName&&y.push(x.tagName);return y.reverse()}}}),Z.defineMIME("text/xml","xml"),Z.defineMIME("application/xml","xml"),Z.mimeModes.hasOwnProperty("text/html")||Z.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(Bt,ve,T){"use strict";T.d(ve,"d",function(){return ft}),T.d(ve,"b",function(){return Ue}),T.d(ve,"c",function(){return Ot}),T.d(ve,"a",function(){return An});var Z=T("VTBJ"),V=T("1OyB"),j=T("vuIU"),G=T("JX7q"),M=T("Ji7U"),I=T("LK+K"),W=T("q1tI"),C=T("I8Z2"),r=T("BGR+"),A=T("wx14"),v=T("rePB"),f=T("4IlW"),p=T("2GS6"),l=T("Gytx"),o=T.n(l),s=T("TSYQ"),t=T.n(s),u=T("U8pU"),a=T("ODXe"),i=/iPhone/i,D=/iPod/i,w=/iPad/i,S=/\bAndroid(?:.+)Mobile\b/i,L=/Android/i,P=/\bAndroid(?:.+)SD4930UR\b/i,_=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,b=/Windows Phone/i,g=/\bWindows(?:.+)ARM\b/i,m=/BlackBerry/i,y=/BB10/i,x=/Opera Mini/i,O=/\b(CriOS|Chrome)(?:.+)Mobile/i,H=/Mobile(?:.+)Firefox\b/i;function F(Gt,xt){return Gt.test(xt)}function R(Gt){var xt=Gt||(typeof navigator!="undefined"?navigator.userAgent:""),Rt=xt.split("[FBAN");if(typeof Rt[1]!="undefined"){var gt=Rt,be=Object(a.a)(gt,1);xt=be[0]}if(Rt=xt.split("Twitter"),typeof Rt[1]!="undefined"){var Ie=Rt,Dt=Object(a.a)(Ie,1);xt=Dt[0]}var ht={apple:{phone:F(i,xt)&&!F(b,xt),ipod:F(D,xt),tablet:!F(i,xt)&&F(w,xt)&&!F(b,xt),device:(F(i,xt)||F(D,xt)||F(w,xt))&&!F(b,xt)},amazon:{phone:F(P,xt),tablet:!F(P,xt)&&F(_,xt),device:F(P,xt)||F(_,xt)},android:{phone:!F(b,xt)&&F(P,xt)||!F(b,xt)&&F(S,xt),tablet:!F(b,xt)&&!F(P,xt)&&!F(S,xt)&&(F(_,xt)||F(L,xt)),device:!F(b,xt)&&(F(P,xt)||F(_,xt)||F(S,xt)||F(L,xt))||F(/\bokhttp\b/i,xt)},windows:{phone:F(b,xt),tablet:F(g,xt),device:F(b,xt)||F(g,xt)},other:{blackberry:F(m,xt),blackberry10:F(y,xt),opera:F(x,xt),firefox:F(H,xt),chrome:F(O,xt),device:F(m,xt)||F(y,xt)||F(x,xt)||F(H,xt)||F(O,xt)},any:null,phone:null,tablet:null};return ht.any=ht.apple.device||ht.android.device||ht.windows.device||ht.other.device,ht.phone=ht.apple.phone||ht.android.phone||ht.windows.phone,ht.tablet=ht.apple.tablet||ht.android.tablet||ht.windows.tablet,ht}var U=Object(Z.a)(Object(Z.a)({},R()),{},{isMobile:R}),k=U;function d(){}function z(Gt,xt,Rt){var gt=xt||"";return Gt.key||"".concat(gt,"item_").concat(Rt)}function Y(Gt){return"".concat(Gt,"-menu-")}function re(Gt,xt){var Rt=-1;W.Children.forEach(Gt,function(gt){Rt+=1,gt&&gt.type&&gt.type.isMenuItemGroup?W.Children.forEach(gt.props.children,function(be){Rt+=1,xt(be,Rt)}):xt(gt,Rt)})}function le(Gt,xt,Rt){if(!Gt||Rt.find)return;W.Children.forEach(Gt,function(gt){if(gt){var be=gt.type;if(!be||!(be.isSubMenu||be.isMenuItem||be.isMenuItemGroup))return;xt.indexOf(gt.key)!==-1?Rt.find=!0:gt.props.children&&le(gt.props.children,xt,Rt)}})}var Ne=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],Ce=function(xt){var Rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,gt=xt&&typeof xt.getBoundingClientRect=="function"&&xt.getBoundingClientRect().width;if(gt){if(Rt){var be=getComputedStyle(xt),Ie=be.marginLeft,Dt=be.marginRight;gt+=+Ie.replace("px","")+ +Dt.replace("px","")}gt=+gt.toFixed(6)}return gt||0},Te=function(xt,Rt,gt){xt&&Object(u.a)(xt.style)==="object"&&(xt.style[Rt]=gt)},Fe=function(){return k.any},Ve=T("KQm4"),xe=T("Ff2n"),ye=T("i8i4"),oe=T("bdgK"),Se=T("uciX"),_e=T("8XRh"),He={adjustX:1,adjustY:1},rt={topLeft:{points:["bl","tl"],overflow:He,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:He,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:He,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:He,offset:[4,0]}},ae={topLeft:{points:["bl","tl"],overflow:He,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:He,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:He,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:He,offset:[4,0]}},$=rt,Q=0,te={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},he=function(xt,Rt,gt){var be=Y(Rt),Ie=xt.getState();xt.setState({defaultActiveFirst:Object(Z.a)(Object(Z.a)({},Ie.defaultActiveFirst),{},Object(v.a)({},be,gt))})},ge=function(Gt){Object(M.a)(Rt,Gt);var xt=Object(I.a)(Rt);function Rt(gt){var be;Object(V.a)(this,Rt),be=xt.call(this,gt),be.onDestroy=function(Ke){be.props.onDestroy(Ke)},be.onKeyDown=function(Ke){var st=Ke.keyCode,bt=be.menuInstance,Ft=be.props,$t=Ft.isOpen,gn=Ft.store;if(st===f.a.ENTER)return be.onTitleClick(Ke),he(gn,be.props.eventKey,!0),!0;if(st===f.a.RIGHT)return $t?bt.onKeyDown(Ke):(be.triggerOpenChange(!0),he(gn,be.props.eventKey,!0)),!0;if(st===f.a.LEFT){var er;if($t)er=bt.onKeyDown(Ke);else return;return er||(be.triggerOpenChange(!1),er=!0),er}return $t&&(st===f.a.UP||st===f.a.DOWN)?bt.onKeyDown(Ke):void 0},be.onOpenChange=function(Ke){be.props.onOpenChange(Ke)},be.onPopupVisibleChange=function(Ke){be.triggerOpenChange(Ke,Ke?"mouseenter":"mouseleave")},be.onMouseEnter=function(Ke){var st=be.props,bt=st.eventKey,Ft=st.onMouseEnter,$t=st.store;he($t,be.props.eventKey,!1),Ft({key:bt,domEvent:Ke})},be.onMouseLeave=function(Ke){var st=be.props,bt=st.parentMenu,Ft=st.eventKey,$t=st.onMouseLeave;bt.subMenuInstance=Object(G.a)(be),$t({key:Ft,domEvent:Ke})},be.onTitleMouseEnter=function(Ke){var st=be.props,bt=st.eventKey,Ft=st.onItemHover,$t=st.onTitleMouseEnter;Ft({key:bt,hover:!0}),$t({key:bt,domEvent:Ke})},be.onTitleMouseLeave=function(Ke){var st=be.props,bt=st.parentMenu,Ft=st.eventKey,$t=st.onItemHover,gn=st.onTitleMouseLeave;bt.subMenuInstance=Object(G.a)(be),$t({key:Ft,hover:!1}),gn({key:Ft,domEvent:Ke})},be.onTitleClick=function(Ke){var st=Object(G.a)(be),bt=st.props;if(bt.onTitleClick({key:bt.eventKey,domEvent:Ke}),bt.triggerSubMenuAction==="hover")return;be.triggerOpenChange(!bt.isOpen,"click"),he(bt.store,be.props.eventKey,!1)},be.onSubMenuClick=function(Ke){typeof be.props.onClick=="function"&&be.props.onClick(be.addKeyPath(Ke))},be.onSelect=function(Ke){be.props.onSelect(Ke)},be.onDeselect=function(Ke){be.props.onDeselect(Ke)},be.getPrefixCls=function(){return"".concat(be.props.rootPrefixCls,"-submenu")},be.getActiveClassName=function(){return"".concat(be.getPrefixCls(),"-active")},be.getDisabledClassName=function(){return"".concat(be.getPrefixCls(),"-disabled")},be.getSelectedClassName=function(){return"".concat(be.getPrefixCls(),"-selected")},be.getOpenClassName=function(){return"".concat(be.props.rootPrefixCls,"-submenu-open")},be.saveMenuInstance=function(Ke){be.menuInstance=Ke},be.addKeyPath=function(Ke){return Object(Z.a)(Object(Z.a)({},Ke),{},{keyPath:(Ke.keyPath||[]).concat(be.props.eventKey)})},be.triggerOpenChange=function(Ke,st){var bt=be.props.eventKey,Ft=function(){be.onOpenChange({key:bt,item:Object(G.a)(be),trigger:st,open:Ke})};st==="mouseenter"?be.mouseenterTimeout=setTimeout(function(){Ft()},0):Ft()},be.isChildrenSelected=function(){var Ke={find:!1};return le(be.props.children,be.props.selectedKeys,Ke),Ke.find},be.isOpen=function(){return be.props.openKeys.indexOf(be.props.eventKey)!==-1},be.adjustWidth=function(){if(!be.subMenuTitle||!be.menuInstance)return;var Ke=ye.findDOMNode(be.menuInstance);if(Ke.offsetWidth>=be.subMenuTitle.offsetWidth)return;Ke.style.minWidth="".concat(be.subMenuTitle.offsetWidth,"px")},be.saveSubMenuTitle=function(Ke){be.subMenuTitle=Ke},be.getBaseProps=function(){var Ke=Object(G.a)(be),st=Ke.props;return{mode:st.mode==="horizontal"?"vertical":st.mode,visible:be.props.isOpen,level:st.level+1,inlineIndent:st.inlineIndent,focusable:!1,onClick:be.onSubMenuClick,onSelect:be.onSelect,onDeselect:be.onDeselect,onDestroy:be.onDestroy,selectedKeys:st.selectedKeys,eventKey:"".concat(st.eventKey,"-menu-"),openKeys:st.openKeys,motion:st.motion,onOpenChange:be.onOpenChange,subMenuOpenDelay:st.subMenuOpenDelay,parentMenu:Object(G.a)(be),subMenuCloseDelay:st.subMenuCloseDelay,forceSubMenuRender:st.forceSubMenuRender,triggerSubMenuAction:st.triggerSubMenuAction,builtinPlacements:st.builtinPlacements,defaultActiveFirst:st.store.getState().defaultActiveFirst[Y(st.eventKey)],multiple:st.multiple,prefixCls:st.rootPrefixCls,id:be.internalMenuId,manualRef:be.saveMenuInstance,itemIcon:st.itemIcon,expandIcon:st.expandIcon,direction:st.direction}},be.getMotion=function(Ke,st){var bt=Object(G.a)(be),Ft=bt.haveRendered,$t=be.props,gn=$t.motion,er=$t.rootPrefixCls,Hn=Object(Z.a)(Object(Z.a)({},gn),{},{leavedClassName:"".concat(er,"-hidden"),removeOnLeave:!1,motionAppear:Ft||!st||Ke!=="inline"});return Hn};var Ie=gt.store,Dt=gt.eventKey,ht=Ie.getState(),nn=ht.defaultActiveFirst;be.isRootMenu=!1;var qt=!1;return nn&&(qt=nn[Dt]),he(Ie,Dt,qt),be}return Object(j.a)(Rt,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var be=this,Ie=this.props,Dt=Ie.mode,ht=Ie.parentMenu,nn=Ie.manualRef;if(nn&&nn(this),Dt!=="horizontal"||!ht.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return be.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var be=this.props,Ie=be.onDestroy,Dt=be.eventKey;Ie&&Ie(Dt),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(be){var Ie=this,Dt=this.getBaseProps(),ht=this.getMotion(Dt.mode,Dt.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||Dt.visible||Dt.forceSubMenuRender,!this.haveOpened)return W.createElement("div",null);var nn=Dt.direction;return W.createElement(_e.default,Object.assign({visible:Dt.visible},ht),function(qt){var Ke=qt.className,st=qt.style,bt=t()("".concat(Dt.prefixCls,"-sub"),Ke,Object(v.a)({},"".concat(Dt.prefixCls,"-rtl"),nn==="rtl"));return W.createElement(We,Object.assign({},Dt,{id:Ie.internalMenuId,className:bt,style:st}),be)})}},{key:"render",value:function(){var be,Ie=Object(Z.a)({},this.props),Dt=Ie.isOpen,ht=this.getPrefixCls(),nn=Ie.mode==="inline",qt=t()(ht,"".concat(ht,"-").concat(Ie.mode),(be={},Object(v.a)(be,Ie.className,!!Ie.className),Object(v.a)(be,this.getOpenClassName(),Dt),Object(v.a)(be,this.getActiveClassName(),Ie.active||Dt&&!nn),Object(v.a)(be,this.getDisabledClassName(),Ie.disabled),Object(v.a)(be,this.getSelectedClassName(),this.isChildrenSelected()),be));this.internalMenuId||(Ie.eventKey?this.internalMenuId="".concat(Ie.eventKey,"$Menu"):(Q+=1,this.internalMenuId="$__$".concat(Q,"$Menu")));var Ke={},st={},bt={};Ie.disabled||(Ke={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},st={onClick:this.onTitleClick},bt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Ft={},$t=Ie.direction;nn&&($t==="rtl"?Ft.paddingRight=Ie.inlineIndent*Ie.level:Ft.paddingLeft=Ie.inlineIndent*Ie.level);var gn={};this.props.isOpen&&(gn={"aria-owns":this.internalMenuId});var er=null;Ie.mode!=="horizontal"&&(er=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(er=W.createElement(this.props.expandIcon,Object(Z.a)({},this.props))));var Hn=W.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:Ft,className:"".concat(ht,"-title"),role:"button"},bt,st,{"aria-expanded":Dt},gn,{"aria-haspopup":"true",title:typeof Ie.title=="string"?Ie.title:void 0}),Ie.title,er||W.createElement("i",{className:"".concat(ht,"-arrow")})),yn=this.renderChildren(Ie.children),Sr=Ie.parentMenu.isRootMenu?Ie.parentMenu.props.getPopupContainer:function(sa){return sa.parentNode},_r=te[Ie.mode],ar=Ie.popupOffset?{offset:Ie.popupOffset}:{},cr=Ie.mode==="inline"?"":Ie.popupClassName;cr+=$t==="rtl"?" ".concat(ht,"-rtl"):"";var Pr=Ie.disabled,Qr=Ie.triggerSubMenuAction,ca=Ie.subMenuOpenDelay,hn=Ie.forceSubMenuRender,ir=Ie.subMenuCloseDelay,va=Ie.builtinPlacements;Ne.forEach(function(sa){return delete Ie[sa]}),delete Ie.onClick;var Pa=$t==="rtl"?Object.assign({},ae,va):Object.assign({},rt,va);return delete Ie.direction,W.createElement("li",Object.assign({},Ie,Ke,{className:qt,role:"menuitem"}),nn&&Hn,nn&&yn,!nn&&W.createElement(Se.a,{prefixCls:ht,popupClassName:t()("".concat(ht,"-popup"),cr),getPopupContainer:Sr,builtinPlacements:Pa,popupPlacement:_r,popupVisible:Dt,popupAlign:ar,popup:yn,action:Pr?[]:[Qr],mouseEnterDelay:ca,mouseLeaveDelay:ir,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:hn},Hn))}}]),Rt}(W.Component);ge.defaultProps={onMouseEnter:d,onMouseLeave:d,onTitleMouseEnter:d,onTitleMouseLeave:d,onTitleClick:d,manualRef:d,mode:"vertical",title:""};var we=Object(C.b)(function(Gt,xt){var Rt=Gt.openKeys,gt=Gt.activeKey,be=Gt.selectedKeys,Ie=xt.eventKey,Dt=xt.subMenuKey;return{isOpen:Rt.indexOf(Ie)>-1,active:gt[Dt]===Ie,selectedKeys:be}})(ge);we.isSubMenu=!0;var ft=we,Pt="menuitem-overflowed",jt=.5,qe=function(Gt){Object(M.a)(Rt,Gt);var xt=Object(I.a)(Rt);function Rt(){var gt;return Object(V.a)(this,Rt),gt=xt.apply(this,arguments),gt.resizeObserver=null,gt.mutationObserver=null,gt.originalTotalWidth=0,gt.overflowedItems=[],gt.menuItemSizes=[],gt.cancelFrameId=null,gt.state={lastVisibleIndex:void 0},gt.getMenuItemNodes=function(){var be=gt.props.prefixCls,Ie=ye.findDOMNode(Object(G.a)(gt));return Ie?[].slice.call(Ie.children).filter(function(Dt){return Dt.className.split(" ").indexOf("".concat(be,"-overflowed-submenu"))<0}):[]},gt.getOverflowedSubMenuItem=function(be,Ie,Dt){var ht=gt.props,nn=ht.overflowedIndicator,qt=ht.level,Ke=ht.mode,st=ht.prefixCls,bt=ht.theme;if(qt!==1||Ke!=="horizontal")return null;var Ft=gt.props.children[0],$t=Ft.props,gn=$t.children,er=$t.title,Hn=$t.style,yn=Object(xe.a)($t,["children","title","style"]),Sr=Object(Z.a)({},Hn),_r="".concat(be,"-overflowed-indicator"),ar="".concat(be,"-overflowed-indicator");Ie.length===0&&Dt!==!0?Sr=Object(Z.a)(Object(Z.a)({},Sr),{},{display:"none"}):Dt&&(Sr=Object(Z.a)(Object(Z.a)({},Sr),{},{visibility:"hidden",position:"absolute"}),_r="".concat(_r,"-placeholder"),ar="".concat(ar,"-placeholder"));var cr=bt?"".concat(st,"-").concat(bt):"",Pr={};return Ne.forEach(function(Qr){yn[Qr]!==void 0&&(Pr[Qr]=yn[Qr])}),W.createElement(ft,Object.assign({title:nn,className:"".concat(st,"-overflowed-submenu"),popupClassName:cr},Pr,{key:_r,eventKey:ar,disabled:!1,style:Sr}),Ie)},gt.setChildrenWidthAndResize=function(){if(gt.props.mode!=="horizontal")return;var be=ye.findDOMNode(Object(G.a)(gt));if(!be)return;var Ie=be.children;if(!Ie||Ie.length===0)return;var Dt=be.children[Ie.length-1];Te(Dt,"display","inline-block");var ht=gt.getMenuItemNodes(),nn=ht.filter(function(qt){return qt.className.split(" ").indexOf(Pt)>=0});nn.forEach(function(qt){Te(qt,"display","inline-block")}),gt.menuItemSizes=ht.map(function(qt){return Ce(qt,!0)}),nn.forEach(function(qt){Te(qt,"display","none")}),gt.overflowedIndicatorWidth=Ce(be.children[be.children.length-1],!0),gt.originalTotalWidth=gt.menuItemSizes.reduce(function(qt,Ke){return qt+Ke},0),gt.handleResize(),Te(Dt,"display","none")},gt.handleResize=function(){if(gt.props.mode!=="horizontal")return;var be=ye.findDOMNode(Object(G.a)(gt));if(!be)return;var Ie=Ce(be);gt.overflowedItems=[];var Dt=0,ht;gt.originalTotalWidth>Ie+jt&&(ht=-1,gt.menuItemSizes.forEach(function(nn){Dt+=nn,Dt+gt.overflowedIndicatorWidth<=Ie&&(ht+=1)})),gt.setState({lastVisibleIndex:ht})},gt}return Object(j.a)(Rt,[{key:"componentDidMount",value:function(){var be=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var Ie=ye.findDOMNode(this);if(!Ie)return;this.resizeObserver=new oe.default(function(Dt){Dt.forEach(function(){var ht=be.cancelFrameId;cancelAnimationFrame(ht),be.cancelFrameId=requestAnimationFrame(be.setChildrenWidthAndResize)})}),[].slice.call(Ie.children).concat(Ie).forEach(function(Dt){be.resizeObserver.observe(Dt)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){be.resizeObserver.disconnect(),[].slice.call(Ie.children).concat(Ie).forEach(function(Dt){be.resizeObserver.observe(Dt)}),be.setChildrenWidthAndResize()}),this.mutationObserver.observe(Ie,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(be){var Ie=this,Dt=this.state.lastVisibleIndex;return(be||[]).reduce(function(ht,nn,qt){var Ke=nn;if(Ie.props.mode==="horizontal"){var st=Ie.getOverflowedSubMenuItem(nn.props.eventKey,[]);Dt!==void 0&&Ie.props.className.indexOf("".concat(Ie.props.prefixCls,"-root"))!==-1&&(qt>Dt&&(Ke=W.cloneElement(nn,{style:{display:"none"},eventKey:"".concat(nn.props.eventKey,"-hidden"),className:"".concat(Pt)})),qt===Dt+1&&(Ie.overflowedItems=be.slice(Dt+1).map(function(Ft){return W.cloneElement(Ft,{key:Ft.props.eventKey,mode:"vertical-left"})}),st=Ie.getOverflowedSubMenuItem(nn.props.eventKey,Ie.overflowedItems)));var bt=[].concat(Object(Ve.a)(ht),[st,Ke]);return qt===be.length-1&&bt.push(Ie.getOverflowedSubMenuItem(nn.props.eventKey,[],!0)),bt}return[].concat(Object(Ve.a)(ht),[Ke])},[])}},{key:"render",value:function(){var be=this.props,Ie=be.visible,Dt=be.prefixCls,ht=be.overflowedIndicator,nn=be.mode,qt=be.level,Ke=be.tag,st=be.children,bt=be.theme,Ft=Object(xe.a)(be,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),$t=Ke;return W.createElement($t,Object.assign({},Ft),this.renderChildren(st))}}]),Rt}(W.Component);qe.defaultProps={tag:"div",className:""};var Mt=qe;function sn(Gt){return Gt.length?Gt.every(function(xt){return!!xt.props.disabled}):!0}function at(Gt,xt,Rt){var gt=Gt.getState();Gt.setState({activeKey:Object(Z.a)(Object(Z.a)({},gt.activeKey),{},Object(v.a)({},xt,Rt))})}function Qe(Gt){return Gt.eventKey||"0-menu-"}function Et(Gt,xt){var Rt=xt,gt=Gt.children,be=Gt.eventKey;if(Rt){var Ie;if(re(gt,function(Dt,ht){Dt&&Dt.props&&!Dt.props.disabled&&Rt===z(Dt,be,ht)&&(Ie=!0)}),Ie)return Rt}return Rt=null,Gt.defaultActiveFirst&&re(gt,function(Dt,ht){!Rt&&Dt&&!Dt.props.disabled&&(Rt=z(Dt,be,ht))}),Rt}function It(Gt){if(Gt){var xt=this.instanceArray.indexOf(Gt);xt!==-1?this.instanceArray[xt]=Gt:this.instanceArray.push(Gt)}}var dt=function(Gt){Object(M.a)(Rt,Gt);var xt=Object(I.a)(Rt);function Rt(gt){var be;return Object(V.a)(this,Rt),be=xt.call(this,gt),be.onKeyDown=function(Ie,Dt){var ht=Ie.keyCode,nn;if(be.getFlatInstanceArray().forEach(function(Ke){Ke&&Ke.props.active&&Ke.onKeyDown&&(nn=Ke.onKeyDown(Ie))}),nn)return 1;var qt=null;return(ht===f.a.UP||ht===f.a.DOWN)&&(qt=be.step(ht===f.a.UP?-1:1)),qt?(Ie.preventDefault(),at(be.props.store,Qe(be.props),qt.props.eventKey),typeof Dt=="function"&&Dt(qt),1):void 0},be.onItemHover=function(Ie){var Dt=Ie.key,ht=Ie.hover;at(be.props.store,Qe(be.props),ht?Dt:null)},be.onDeselect=function(Ie){be.props.onDeselect(Ie)},be.onSelect=function(Ie){be.props.onSelect(Ie)},be.onClick=function(Ie){be.props.onClick(Ie)},be.onOpenChange=function(Ie){be.props.onOpenChange(Ie)},be.onDestroy=function(Ie){be.props.onDestroy(Ie)},be.getFlatInstanceArray=function(){return be.instanceArray},be.step=function(Ie){var Dt=be.getFlatInstanceArray(),ht=be.props.store.getState().activeKey[Qe(be.props)],nn=Dt.length;if(!nn)return null;Ie<0&&(Dt=Dt.concat().reverse());var qt=-1;if(Dt.every(function(Ft,$t){return Ft&&Ft.props.eventKey===ht?(qt=$t,!1):!0}),!be.props.defaultActiveFirst&&qt!==-1&&sn(Dt.slice(qt,nn-1)))return;var Ke=(qt+1)%nn,st=Ke;do{var bt=Dt[st];if(!bt||bt.props.disabled)st=(st+1)%nn;else return bt}while(st!==Ke);return null},be.renderCommonMenuItem=function(Ie,Dt,ht){var nn=be.props.store.getState(),qt=Object(G.a)(be),Ke=qt.props,st=z(Ie,Ke.eventKey,Dt),bt=Ie.props;if(!bt||typeof Ie.type=="string")return Ie;var Ft=st===nn.activeKey,$t=Object(Z.a)(Object(Z.a)({mode:bt.mode||Ke.mode,level:Ke.level,inlineIndent:Ke.inlineIndent,renderMenuItem:be.renderMenuItem,rootPrefixCls:Ke.prefixCls,index:Dt,parentMenu:Ke.parentMenu,manualRef:bt.disabled?void 0:Object(p.a)(Ie.ref,It.bind(Object(G.a)(be))),eventKey:st,active:!bt.disabled&&Ft,multiple:Ke.multiple,onClick:function(er){(bt.onClick||d)(er),be.onClick(er)},onItemHover:be.onItemHover,motion:Ke.motion,subMenuOpenDelay:Ke.subMenuOpenDelay,subMenuCloseDelay:Ke.subMenuCloseDelay,forceSubMenuRender:Ke.forceSubMenuRender,onOpenChange:be.onOpenChange,onDeselect:be.onDeselect,onSelect:be.onSelect,builtinPlacements:Ke.builtinPlacements,itemIcon:bt.itemIcon||be.props.itemIcon,expandIcon:bt.expandIcon||be.props.expandIcon},ht),{},{direction:Ke.direction});return(Ke.mode==="inline"||Fe())&&($t.triggerSubMenuAction="click"),W.cloneElement(Ie,$t)},be.renderMenuItem=function(Ie,Dt,ht){if(!Ie)return null;var nn=be.props.store.getState(),qt={openKeys:nn.openKeys,selectedKeys:nn.selectedKeys,triggerSubMenuAction:be.props.triggerSubMenuAction,subMenuKey:ht};return be.renderCommonMenuItem(Ie,Dt,qt)},gt.store.setState({activeKey:Object(Z.a)(Object(Z.a)({},gt.store.getState().activeKey),{},Object(v.a)({},gt.eventKey,Et(gt,gt.activeKey)))}),be.instanceArray=[],be}return Object(j.a)(Rt,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(be){return this.props.visible||be.visible||this.props.className!==be.className||!o()(this.props.style,be.style)}},{key:"componentDidUpdate",value:function(be){var Ie=this.props,Dt="activeKey"in Ie?Ie.activeKey:Ie.store.getState().activeKey[Qe(Ie)],ht=Et(Ie,Dt);if(ht!==Dt)at(Ie.store,Qe(Ie),ht);else if("activeKey"in be){var nn=Et(be,be.activeKey);ht!==nn&&at(Ie.store,Qe(Ie),ht)}}},{key:"render",value:function(){var be=this,Ie=Object(A.a)({},this.props);this.instanceArray=[];var Dt=t()(Ie.prefixCls,Ie.className,"".concat(Ie.prefixCls,"-").concat(Ie.mode)),ht={className:Dt,role:Ie.role||"menu"};Ie.id&&(ht.id=Ie.id),Ie.focusable&&(ht.tabIndex=0,ht.onKeyDown=this.onKeyDown);var nn=Ie.prefixCls,qt=Ie.eventKey,Ke=Ie.visible,st=Ie.level,bt=Ie.mode,Ft=Ie.overflowedIndicator,$t=Ie.theme;return Ne.forEach(function(gn){return delete Ie[gn]}),delete Ie.onClick,W.createElement(Mt,Object.assign({},Ie,{prefixCls:nn,mode:bt,tag:"ul",level:st,theme:$t,visible:Ke,overflowedIndicator:Ft},ht),W.Children.map(Ie.children,function(gn,er){return be.renderMenuItem(gn,er,qt||"0-menu-")}))}}]),Rt}(W.Component);dt.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:d};var mt=Object(C.b)()(dt),We=mt,De=T("Kwbf");function Le(Gt,xt,Rt){var gt=Gt.prefixCls,be=Gt.motion,Ie=Gt.defaultMotions,Dt=Ie===void 0?{}:Ie,ht=Gt.openAnimation,nn=Gt.openTransitionName,qt=xt.switchingModeFromInline;if(be)return be;if(Object(u.a)(ht)==="object"&&ht)Object(De.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof ht=="string")return{motionName:"".concat(gt,"-open-").concat(ht)};if(nn)return{motionName:nn};var Ke=Dt[Rt];return Ke||(qt?null:Dt.other)}var de=function(Gt){Object(M.a)(Rt,Gt);var xt=Object(I.a)(Rt);function Rt(gt){var be;Object(V.a)(this,Rt),be=xt.call(this,gt),be.inlineOpenKeys=[],be.onSelect=function(ht){var nn=Object(G.a)(be),qt=nn.props;if(qt.selectable){var Ke=be.store.getState(),st=Ke.selectedKeys,bt=ht.key;qt.multiple?st=st.concat([bt]):st=[bt],"selectedKeys"in qt||be.store.setState({selectedKeys:st}),qt.onSelect(Object(Z.a)(Object(Z.a)({},ht),{},{selectedKeys:st}))}},be.onClick=function(ht){var nn=be.getRealMenuMode(),qt=Object(G.a)(be),Ke=qt.store,st=qt.props.onOpenChange;nn!=="inline"&&!("openKeys"in be.props)&&(Ke.setState({openKeys:[]}),st([])),be.props.onClick(ht)},be.onKeyDown=function(ht,nn){be.innerMenu.getWrappedInstance().onKeyDown(ht,nn)},be.onOpenChange=function(ht){var nn=Object(G.a)(be),qt=nn.props,Ke=be.store.getState().openKeys.concat(),st=!1,bt=function($t){var gn=!1;if($t.open)gn=Ke.indexOf($t.key)===-1,gn&&Ke.push($t.key);else{var er=Ke.indexOf($t.key);gn=er!==-1,gn&&Ke.splice(er,1)}st=st||gn};Array.isArray(ht)?ht.forEach(bt):bt(ht),st&&("openKeys"in be.props||be.store.setState({openKeys:Ke}),qt.onOpenChange(Ke))},be.onDeselect=function(ht){var nn=Object(G.a)(be),qt=nn.props;if(qt.selectable){var Ke=be.store.getState().selectedKeys.concat(),st=ht.key,bt=Ke.indexOf(st);bt!==-1&&Ke.splice(bt,1),"selectedKeys"in qt||be.store.setState({selectedKeys:Ke}),qt.onDeselect(Object(Z.a)(Object(Z.a)({},ht),{},{selectedKeys:Ke}))}},be.onMouseEnter=function(ht){be.restoreModeVerticalFromInline();var nn=be.props.onMouseEnter;nn&&nn(ht)},be.onTransitionEnd=function(ht){var nn=ht.propertyName==="width"&&ht.target===ht.currentTarget,qt=ht.target.className,Ke=Object.prototype.toString.call(qt)==="[object SVGAnimatedString]"?qt.animVal:qt,st=ht.propertyName==="font-size"&&Ke.indexOf("anticon")>=0;(nn||st)&&be.restoreModeVerticalFromInline()},be.setInnerMenu=function(ht){be.innerMenu=ht},be.isRootMenu=!0;var Ie=gt.defaultSelectedKeys,Dt=gt.defaultOpenKeys;return"selectedKeys"in gt&&(Ie=gt.selectedKeys||[]),"openKeys"in gt&&(Dt=gt.openKeys||[]),be.store=Object(C.c)({selectedKeys:Ie,openKeys:Dt,activeKey:{"0-menu-":Et(gt,gt.activeKey)}}),be.state={switchingModeFromInline:!1},be}return Object(j.a)(Rt,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(be){this.updateOpentKeysWhenSwitchMode(be),this.updateMiniStore();var Ie=this.props,Dt=Ie.siderCollapsed,ht=Ie.inlineCollapsed,nn=Ie.onOpenChange;(!be.inlineCollapsed&&ht||!be.siderCollapsed&&Dt)&&nn([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(be){var Ie=this.props,Dt=this.store,ht=this.inlineOpenKeys,nn=Dt.getState(),qt={};be.mode==="inline"&&Ie.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in Ie||((Ie.inlineCollapsed&&!be.inlineCollapsed||Ie.siderCollapsed&&!be.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=nn.openKeys.concat(),qt.openKeys=[]),(!Ie.inlineCollapsed&&be.inlineCollapsed||!Ie.siderCollapsed&&be.siderCollapsed)&&(qt.openKeys=ht,this.inlineOpenKeys=[])),Object.keys(qt).length&&Dt.setState(qt)}},{key:"updateMenuDisplay",value:function(){var be=this.props.collapsedWidth,Ie=this.store,Dt=this.prevOpenKeys,ht=this.getInlineCollapsed()&&(be===0||be==="0"||be==="0px");ht?(this.prevOpenKeys=Ie.getState().openKeys.concat(),this.store.setState({openKeys:[]})):Dt&&(this.store.setState({openKeys:Dt}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var be=this.props.mode,Ie=this.state.switchingModeFromInline,Dt=this.getInlineCollapsed();return Ie&&Dt?"inline":Dt?"vertical":be}},{key:"getInlineCollapsed",value:function(){var be=this.props,Ie=be.inlineCollapsed,Dt=be.siderCollapsed;return Dt!==void 0?Dt:Ie}},{key:"restoreModeVerticalFromInline",value:function(){var be=this.state.switchingModeFromInline;be&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var be=Object(Z.a)({},Object(r.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),Ie=this.getRealMenuMode();return be.className+=" ".concat(be.prefixCls,"-root"),be.direction==="rtl"&&(be.className+=" ".concat(be.prefixCls,"-rtl")),be=Object(Z.a)(Object(Z.a)({},be),{},{mode:Ie,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Le(this.props,this.state,Ie)}),delete be.openAnimation,delete be.openTransitionName,W.createElement(C.a,{store:this.store},W.createElement(We,Object.assign({},be,{ref:this.setInnerMenu}),this.props.children))}}]),Rt}(W.Component);de.defaultProps={selectable:!0,onClick:d,onSelect:d,onOpenChange:d,onDeselect:d,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:W.createElement("span",null,"\xB7\xB7\xB7")};var fe=de,Ee=function(Gt){Object(M.a)(Rt,Gt);var xt=Object(I.a)(Rt);function Rt(){var gt;return Object(V.a)(this,Rt),gt=xt.apply(this,arguments),gt.onKeyDown=function(be){var Ie=be.keyCode;return Ie===f.a.ENTER?(gt.onClick(be),!0):void 0},gt.onMouseLeave=function(be){var Ie=gt.props,Dt=Ie.eventKey,ht=Ie.onItemHover,nn=Ie.onMouseLeave;ht({key:Dt,hover:!1}),nn({key:Dt,domEvent:be})},gt.onMouseEnter=function(be){var Ie=gt.props,Dt=Ie.eventKey,ht=Ie.onItemHover,nn=Ie.onMouseEnter;ht({key:Dt,hover:!0}),nn({key:Dt,domEvent:be})},gt.onClick=function(be){var Ie=gt.props,Dt=Ie.eventKey,ht=Ie.multiple,nn=Ie.onClick,qt=Ie.onSelect,Ke=Ie.onDeselect,st=Ie.isSelected,bt={key:Dt,keyPath:[Dt],item:Object(G.a)(gt),domEvent:be};nn(bt),ht?st?Ke(bt):qt(bt):st||qt(bt)},gt.saveNode=function(be){gt.node=be},gt}return Object(j.a)(Rt,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var be=this.props;be.onDestroy&&be.onDestroy(be.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var be,Ie=Object(Z.a)({},this.props),Dt=t()(this.getPrefixCls(),Ie.className,(be={},Object(v.a)(be,this.getActiveClassName(),!Ie.disabled&&Ie.active),Object(v.a)(be,this.getSelectedClassName(),Ie.isSelected),Object(v.a)(be,this.getDisabledClassName(),Ie.disabled),be)),ht=Object(Z.a)(Object(Z.a)({},Ie.attribute),{},{title:typeof Ie.title=="string"?Ie.title:void 0,className:Dt,role:Ie.role||"menuitem","aria-disabled":Ie.disabled});Ie.role==="option"?ht=Object(Z.a)(Object(Z.a)({},ht),{},{role:"option","aria-selected":Ie.isSelected}):(Ie.role===null||Ie.role==="none")&&(ht.role="none");var nn={onClick:Ie.disabled?null:this.onClick,onMouseLeave:Ie.disabled?null:this.onMouseLeave,onMouseEnter:Ie.disabled?null:this.onMouseEnter},qt=Object(Z.a)({},Ie.style);Ie.mode==="inline"&&(Ie.direction==="rtl"?qt.paddingRight=Ie.inlineIndent*Ie.level:qt.paddingLeft=Ie.inlineIndent*Ie.level),Ne.forEach(function(st){return delete Ie[st]}),delete Ie.direction;var Ke=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Ke=W.createElement(this.props.itemIcon,this.props)),W.createElement("li",Object.assign({},Object(r.default)(Ie,["onClick","onMouseEnter","onMouseLeave","onSelect"]),ht,nn,{style:qt,ref:this.saveNode}),Ie.children,Ke)}}]),Rt}(W.Component);Ee.isMenuItem=!0,Ee.defaultProps={onSelect:d,onMouseEnter:d,onMouseLeave:d,manualRef:d};var Pe=Object(C.b)(function(Gt,xt){var Rt=Gt.activeKey,gt=Gt.selectedKeys,be=xt.eventKey,Ie=xt.subMenuKey;return{active:Rt[Ie]===be,isSelected:gt.indexOf(be)!==-1}})(Ee),Ue=Pe,lt=function(Gt){Object(M.a)(Rt,Gt);var xt=Object(I.a)(Rt);function Rt(){var gt;return Object(V.a)(this,Rt),gt=xt.apply(this,arguments),gt.renderInnerMenuItem=function(be){var Ie=gt.props,Dt=Ie.renderMenuItem,ht=Ie.index;return Dt(be,ht,gt.props.subMenuKey)},gt}return Object(j.a)(Rt,[{key:"render",value:function(){var be=Object(A.a)({},this.props),Ie=be.className,Dt=Ie===void 0?"":Ie,ht=be.rootPrefixCls,nn="".concat(ht,"-item-group-title"),qt="".concat(ht,"-item-group-list"),Ke=be.title,st=be.children;return Ne.forEach(function(bt){return delete be[bt]}),delete be.onClick,delete be.direction,W.createElement("li",Object.assign({},be,{className:"".concat(Dt," ").concat(ht,"-item-group")}),W.createElement("div",{className:nn,title:typeof Ke=="string"?Ke:void 0},Ke),W.createElement("ul",{className:qt},W.Children.map(st,this.renderInnerMenuItem)))}}]),Rt}(W.Component);lt.isMenuItemGroup=!0,lt.defaultProps={disabled:!0};var Ot=lt,cn=function(xt){var Rt=xt.className,gt=xt.rootPrefixCls,be=xt.style;return W.createElement("li",{className:"".concat(Rt," ").concat(gt,"-item-divider"),style:be})};cn.defaultProps={disabled:!0,className:"",style:{}};var An=cn,Ct=ve.e=fe},"24hK":function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return V});class Z{constructor(j){this.element=j,this.next=Z.Undefined,this.prev=Z.Undefined}}Z.Undefined=new Z(void 0);class V{constructor(){this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Z.Undefined}clear(){let j=this._first;for(;j!==Z.Undefined;){const G=j.next;j.prev=Z.Undefined,j.next=Z.Undefined,j=G}this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}unshift(j){return this._insert(j,!1)}push(j){return this._insert(j,!0)}_insert(j,G){const M=new Z(j);if(this._first===Z.Undefined)this._first=M,this._last=M;else if(G){const W=this._last;this._last=M,M.prev=W,W.next=M}else{const W=this._first;this._first=M,M.next=W,W.prev=M}this._size+=1;let I=!1;return()=>{I||(I=!0,this._remove(M))}}shift(){if(this._first===Z.Undefined)return;{const j=this._first.element;return this._remove(this._first),j}}pop(){if(this._last===Z.Undefined)return;{const j=this._last.element;return this._remove(this._last),j}}_remove(j){if(j.prev!==Z.Undefined&&j.next!==Z.Undefined){const G=j.prev;G.next=j.next,j.next.prev=G}else j.prev===Z.Undefined&&j.next===Z.Undefined?(this._first=Z.Undefined,this._last=Z.Undefined):j.next===Z.Undefined?(this._last=this._last.prev,this._last.next=Z.Undefined):j.prev===Z.Undefined&&(this._first=this._first.next,this._first.prev=Z.Undefined);this._size-=1}*[Symbol.iterator](){let j=this._first;for(;j!==Z.Undefined;)yield j.element,j=j.next}}},"28ck":function(Bt,ve,T){Bt.exports={flex_box_center:"flex_box_center___2EzbZ",flex_space_between:"flex_space_between___2jjzS",flex_box_vertical_center:"flex_box_vertical_center___35dLT",flex_box_center_end:"flex_box_center_end___2fyJ3",flex_box_column:"flex_box_column___3lKUC",title:"title___3cIut",export:"export___3pzhF",bg:"bg___2HApn",tabs:"tabs___pZ5ue",workListTabWrap:"workListTabWrap___3EyRO",workListTabButton:"workListTabButton___1vYHr"}},"3/fG":function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return V});function Z(j,G){let M;return G.length===0?M=j:M=j.replace(/\{(\d+)\}/g,function(I,W){const C=W[0];return typeof G[C]!="undefined"?G[C]:I}),M}function V(j,G,...M){return Z(G,M)}},"3IPh":function(Bt,ve,T){Bt.exports={wrap:"wrap___cA_8q",MdEditor:"MdEditor___8fwED",workListButtonWrap:"workListButtonWrap___19mp3",anticon:"anticon___3Lzu8",workListClass:"workListClass___1J6Go",left:"left___21zr0",visible:"visible___38N4N",status:"status___1j6mP",tips:"tips___2L_mR",redoBtn:"redoBtn___1n4cZ"}},"49sm":function(Bt,ve){var T={}.toString;Bt.exports=Array.isArray||function(Z){return T.call(Z)=="[object Array]"}},"4HvA":function(Bt,ve,T){"use strict";var Z=T("2qtc"),V=T("kLXV"),j=T("sRBo"),G=T("kaz8"),M=T("7Kak"),I=T("9yH6"),W=T("14J3"),C=T("BMrR"),r=T("jCWc"),A=T("kPKH"),v=T("iQDF"),f=T("+eQT"),p=T("miYZ"),l=T("tsqr"),o=T("jrin"),s=T("oBTY"),t=T("9og8"),u=T("k1fw"),a=T("y8nQ"),i=T("Vl3Y"),D=T("tJVT"),w=T("PpiC"),S=T("WmNS"),L=T.n(S),P=T("q1tI"),_=T.n(P),b=T("wd/R"),g=T.n(b),m=T("ErOA"),y=T("xKgJ"),x=T("1vsH"),O=T("Ty5D"),H=T("9kvl"),F=T("4wi7"),R=T("oUNq"),U=T("eozf"),k=function(z){var Y=z.classroomList,re=z.dispatch,le=z.courseEndTime,Ne=Object(w.a)(z,["classroomList","dispatch","courseEndTime"]),Ce=Object(O.i)(),Te=i.a.useForm(),Fe=Object(D.a)(Te,1),Ve=Fe[0],xe=Object(P.useState)(1),ye=Object(D.a)(xe,2),oe=ye[0],Se=ye[1],_e=Object(P.useState)([]),He=Object(D.a)(_e,2),rt=He[0],ae=He[1],$=Object(P.useState)(0),Q=Object(D.a)($,2),te=Q[0],he=Q[1],ge=Object(P.useState)(2e3),we=Object(D.a)(ge,2),ft=we[0],Pt=we[1],jt=Object(P.useState)(!0),qe=Object(D.a)(jt,2),Mt=qe[0],sn=qe[1],at=Object(P.useState)(!1),Qe=Object(D.a)(at,2),Et=Qe[0],It=Qe[1],dt=Object(P.useState)(!1),mt=Object(D.a)(dt,2),We=mt[0],De=mt[1],Le=Object(P.useState)([]),de=Object(D.a)(Le,2),fe=de[0],Ee=de[1],Pe=Object(P.useState)(!0),Ue=Object(D.a)(Pe,2),lt=Ue[0],Ot=Ue[1];Object(P.useEffect)(function(){if(Y.actionTabs.key==="\u7ACB\u5373\u53D1\u5E03"&&(cn(),Y.actionTabs.type===2)){var be=Y.actionTabs.selectArrsAll[0];Ot(be.unified_setting)}},[Y.actionTabs]),Object(P.useEffect)(function(){if(Et){if(We)return;re({type:"classroomList/setActionTabs",payload:{}}),Object(y.c)()?re({type:"classroomList/getClassroomTeacherCommonList",payload:Object(u.a)(Object(u.a)({},Y.actionTabs.params),{},{type:1})}):re({type:"classroomList/getClassroomCommonList",payload:Object(u.a)({},Y.actionTabs.params)})}},[Et]);var cn=function(){var be=Object(t.a)(L.a.mark(function Ie(Dt){var ht,nn;return L.a.wrap(function(Ke){for(;;)switch(Ke.prev=Ke.next){case 0:return sn(!0),Ke.next=3,Object(R.D)(Object(u.a)(Object(u.a)({},Ce),{},{page:Dt||oe,limit:2e4,homework_id:Y.actionTabs.type===1?"":Y.actionTabs.selectArrs[0]}));case 3:ht=Ke.sent,ht==null||ht.course_groups.map(function(st,bt){st.key=st.id,st.title=st.name,st.disabled=st.is_published}),ht&&(ae(Object(s.a)(ht==null?void 0:ht.course_groups)),he(ht==null?void 0:ht.course_groups_count),sn(!1),Dt||Ve.setFieldsValue((nn={},Object(o.a)(nn,"publish_time",g()(g()(new Date).add(0,"days").format("YYYY-MM-DD HH:mm"))),Object(o.a)(nn,"end_time",g()(g()(new Date(Object(x.b)("/"))).add(7,"days").format("YYYY-MM-DD HH:mm"))),nn)));case 6:case"end":return Ke.stop()}},Ie)}));return function(Dt){return be.apply(this,arguments)}}(),An=function(Ie){Se(Ie),cn(Ie)},Ct=function(){Object(y.c)()?Y.actionTabs.detail?(re({type:"shixunHomeworks/setActionTabs",payload:{}}),re({type:"shixunHomeworks/getWorkList",payload:Object(u.a)({},Ce)}),re({type:"shixunHomeworks/getWorkSetting",payload:Object(u.a)({},Ce)})):re({type:"classroomList/getClassroomTeacherCommonList",payload:Object(u.a)(Object(u.a)({},Y.actionTabs.params),{},{type:1})}):re({type:"classroomList/getClassroomCommonList",payload:Object(u.a)({},Y.actionTabs.params)})},Gt=function(){var be=Object(t.a)(L.a.mark(function Ie(){var Dt,ht,nn,qt;return L.a.wrap(function(st){for(;;)switch(st.prev=st.next){case 0:if(ht=Object(u.a)({},Ve.getFieldsValue()),!(ht.end_time<=ht.publish_time)){st.next=4;break}return l.b.info("\u622A\u6B62\u65F6\u95F4\u4E0D\u80FD\u5927\u4E8E\u6216\u7B49\u4E8E\u53D1\u5E03\u65F6\u95F4"),st.abrupt("return");case 4:if(!((fe==null?void 0:fe.length)<=0&&!lt&&rt.length>0)){st.next=7;break}return l.b.info("\u53D1\u5E03\u73ED\u7EA7\u4E0D\u80FD\u4E3A\u7A7A"),st.abrupt("return");case 7:return nn={homework_ids:Object(s.a)(Y.actionTabs.selectArrs),group_ids:fe.length>0?fe.map(function(bt){return bt.id}):(Dt=Y.detailCommonHomeworksList)===null||Dt===void 0?void 0:Dt.course_groups,end_time:g()(ht.end_time).format("YYYY-MM-DD HH:mm"),publish_time:g()(ht.publish_time).format("YYYY-MM-DD HH:mm"),unified_setting:!fe.length},st.next=10,Object(m.a)("/api/courses/".concat(Ce.coursesId,"/homework_commons/publish_with_homework_list_position.json"),{method:"post",body:Object(u.a)({},nn)});case 10:qt=st.sent,qt.status===0&&(Object(x.cb)(["\u6559\u5B66\u8BFE\u5802","\u56FE\u6587\u4F5C\u4E1A","\u7ACB\u5373\u53D1\u5E03"]),l.b.success("\u53D1\u5E03\u6210\u529F"),re({type:"classroomList/setActionTabs",payload:{key:"\u6E05\u9664\u9009\u62E9\u6570\u636E"}}),Ne.onCallback&&Ne.onCallback(),Ct(),localStorage.getItem("Noviceguide")==="0"||re({type:"shixunHomeworks/setActionTabs",payload:{key:"\u5E95\u90E8\u5F39\u7A97",type:13,text:_.a.createElement("div",null,"\u6700\u540E\uFF0C\u54B1\u4EEC\u7ED9\u6559\u5B66\u8BFE\u5802\u6DFB\u52A0\u4E00\u540D\u5B66\u751F~\u70B9\u51FB\u201C\u6DFB\u52A0\u5B66\u751F\u201D\uFF0C\u5728\u5F39\u7A97\u9875\u9762\u4E2D\u8F93\u5165\u5E76\u641C\u7D22\u5B66\u751F\u59D3\u540D\uFF0C\u70B9\u51FB\u201C\u786E\u5B9A\u201D\u5C31\u53EF\u4EE5\u4E3A\u60A8\u7684\u8BFE\u5802\u6DFB\u52A0\u7B2C\u4E00\u4F4D\u5B66\u751F\u5566~")}}));case 12:case"end":return st.stop()}},Ie)}));return function(){return be.apply(this,arguments)}}(),xt=function(){Se(1),ae([]),Ee([])},Rt=Y.detailCommonHomeworksList,gt=te>oe*ft;return _.a.createElement(V.a,{width:600,centered:!0,title:"\u53D1\u5E03\u4F5C\u4E1A",visible:Y.actionTabs.key==="\u7ACB\u5373\u53D1\u5E03",okText:"\u53D1\u5E03\u4F5C\u4E1A",cancelText:"\u6682\u4E0D\u53D1\u5E03",onOk:Gt,onCancel:function(){xt(),Ct(),re({type:"classroomList/setActionTabs",payload:{}})}},_.a.createElement("p",{className:"tc"},"\u5B66\u751F\u5C06\u7ACB\u5373\u6536\u5230\u4F5C\u4E1A",_.a.createElement("br",null),'\u672C\u64CD\u4F5C\u53EA\u5BF9"\u672A\u53D1\u5E03"\u7684\u4F5C\u4E1A\u6709\u6548'),rt&&_.a.createElement(i.a,{form:Ve},_.a.createElement("div",{style:{paddingLeft:0}},_.a.createElement(C.a,{className:"mt30",align:"middle"},_.a.createElement(A.a,null,_.a.createElement(i.a.Item,{name:"publish_time",label:"\u53D1\u5E03\u65F6\u95F4"},_.a.createElement(f.a,{style:{width:155,marginRight:"25px"},getPopupContainer:function(Ie){return Ie.parentNode},disabledDate:function(Ie){return Object(U.b)(Ie,le)},disabledTime:function(Ie){return Object(U.c)(Ie)},placeholder:"\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:g()(Object(x.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",allowClear:!1}))),_.a.createElement(A.a,{className:"ml20"},_.a.createElement(i.a.Item,{name:"end_time",label:"\u622A\u6B62\u65F6\u95F4"},_.a.createElement(f.a,{style:{width:170},getPopupContainer:function(Ie){return Ie.parentNode},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:g()(Object(x.d)(),"HH:mm")},disabledDate:function(Ie){return Object(U.b)(Ie,le,Ve.getFieldValue("publish_time"))},disabledTime:function(Ie){return Object(U.c)(Ie,Ve.getFieldValue("publish_time"))},format:"YYYY-MM-DD HH:mm",allowClear:!1})))),Y.actionTabs.type===2&&_.a.createElement(C.a,{style:{marginBottom:"10px"}},_.a.createElement("span",{className:"mr5"},"\u53D1\u5E03\u8BBE\u7F6E:"),_.a.createElement(I.a.Group,{value:lt,onChange:function(Ie){Ot(Ie.target.value),Ee([])}},_.a.createElement(I.a,{value:!0},"\u7EDF\u4E00\u53D1\u5E03"),_.a.createElement(I.a,{className:"ml20",disabled:rt.length<=0,value:!1},"\u5206\u73ED\u53D1\u5E03"))),rt.length<=0&&Y.actionTabs.type===2&&_.a.createElement("span",{style:{marginLeft:"65px",color:"rgba(0, 0, 0, 0.25)"}},'\u8BFE\u5802\u65E0\u5206\u73ED\uFF0C\u4EC5\u652F\u6301\u9009\u62E9\u201C\u7EDF\u4E00\u53D1\u5E03"')),(Y.actionTabs.type===1||!lt)&&rt.length>0&&_.a.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"10px"}},_.a.createElement("span",{style:{flex:1}},_.a.createElement(G.a,{checked:fe.length===rt.length,onChange:function(Ie){fe.length===rt.length?Ee([]):Ee(rt.filter(function(Dt){return!Dt.is_published}))}},"\u5168\u9009")," "),_.a.createElement("span",{style:{width:16}}),_.a.createElement("span",{style:{flex:1}},"\u5DF2\u9009\u62E9",fe.length||0,"\u4E2A\u5206\u73ED")),(Y.actionTabs.type===1||!lt)&&rt.length>0&&_.a.createElement(F.a,{data:rt,selectedRowKeys:fe,setSelectedRowKeys:Ee})))};ve.a=Object(H.a)(function(d){var z=d.classroomList;return{classroomList:z}})(k)},"4KPa":function(Bt,ve,T){"use strict";var Z=T("giR+"),V=T("fyUT"),j=T("14J3"),G=T("BMrR"),M=T("iQDF"),I=T("+eQT"),W=T("jCWc"),C=T("kPKH"),r=T("q1tI"),A=T.n(r),v=T("9kvl"),f=T("wd/R"),p=T.n(f),l=T("eozf"),o=function(t){var u=t.data,a=t.disabled,i=t.setData,D=t.shixunHomeworks,w=D.workSetting,S=D.workList;return A.a.createElement("div",null,A.a.createElement(G.a,{align:"middle",className:"mt25 pl70"},A.a.createElement(C.a,null,"\u7ED3\u675F\u65F6\u95F4:"),A.a.createElement(C.a,{className:"ml5"},A.a.createElement(I.a,{allowClear:!1,style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u7ED3\u675F\u65F6\u95F4",showTime:{format:"HH:mm"},format:"YYYY-MM-DD HH:mm",disabled:a,disabledDate:function(P){return Object(l.b)(P,w==null?void 0:w.course_end_date)},disabledTime:function(P){return Object(l.c)(P)},value:u.appeal_time?p()(u.appeal_time):"",onChange:function(P,_){u.appeal_time=_,i(Object.assign({},u))}})),A.a.createElement(C.a,null,A.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u533F\u8BC4TA\u4EBA\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)"))),A.a.createElement(G.a,{align:"middle",className:"mt25 pl70"},A.a.createElement(C.a,null,"\u8FDD\u89C4\u533F\u8BC4\u6263\u5206:"),A.a.createElement(C.a,{className:"ml5"},A.a.createElement(V.a,{disabled:a,value:u.appeal_penalty,min:0,onChange:function(P){u.appeal_penalty=P,i(Object.assign({},u))}})),A.a.createElement(C.a,{flex:"1",className:"ml5"},A.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u8FDD\u89C4\u533F\u8BC4TA\u4EBA\u4F5C\u54C1\u65F6\uFF0C\u5176\u6210\u7EE9\u5C06\u88AB\u6263\u51CF\u7684\u5206\u503C)"))))};ve.a=Object(v.a)(function(s){var t=s.shixunHomeworks;return{shixunHomeworks:t}})(o)},"4wi7":function(Bt,ve,T){"use strict";var Z=T("14J3"),V=T("BMrR"),j=T("sRBo"),G=T("kaz8"),M=T("5NDa"),I=T("5rEg"),W=T("9og8"),C=T("tJVT"),r=T("WmNS"),A=T.n(r),v=T("q1tI"),f=T.n(v),p=T("oOBs"),l=T.n(p),o=T("xOL1"),s=T.n(o),t=T("BdwD"),u=function(i){var D=i.data,w=i.value,S=w===void 0?[]:w,L=i.handleChangePage,P=i.setSelectedRowKeys,_=i.selectedRowKeys,b=i.onChange,g=b===void 0?function(){}:b,m=Object(v.useState)([]),y=Object(C.a)(m,2),x=y[0],O=y[1],H=Object(v.useState)([]),F=Object(C.a)(H,2),R=F[0],U=F[1],k=Object(v.useState)([]),d=Object(C.a)(k,2),z=d[0],Y=d[1],re=Object(v.useState)(1),le=Object(C.a)(re,2),Ne=le[0],Ce=le[1],Te=Object(v.useState)(),Fe=Object(C.a)(Te,2),Ve=Fe[0],xe=Fe[1];return Object(v.useEffect)(function(){O(D),U([]),Y([])},[D]),Object(v.useEffect)(function(){P&&(U(_),Y(_))},[_]),f.a.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},f.a.createElement("div",{className:l.a.leftdiv},f.a.createElement(I.a.Search,{size:"large",onChange:function(){var ye=Object(W.a)(A.a.mark(function oe(Se){return A.a.wrap(function(He){for(;;)switch(He.prev=He.next){case 0:O(D.filter(function(rt){var ae;return rt==null||((ae=rt.name)===null||ae===void 0)?void 0:ae.includes(Se.target.value)}));case 1:case"end":return He.stop()}},oe)}));return function(oe){return ye.apply(this,arguments)}}(),placeholder:"\u53EF\u8F93\u5165\u73ED\u7EA7\u540D\u79F0\u67E5\u8BE2"}),x.length===0&&f.a.createElement(t.a,{styles:{margin:"70px auto"},customText:"\u6682\u65E0\u5206\u73ED"}),f.a.createElement("div",{style:{height:"85%",overflow:"auto",overflowX:"hidden"}},f.a.createElement(G.a.Group,{value:R.map(function(ye){return"".concat(ye.id)}),onChange:function(oe){P(x.filter(function(Se){return oe.includes("".concat(Se.id))}))},style:{marginTop:"10px"}},x.map(function(ye,oe){return f.a.createElement(V.a,{key:ye.id,style:{marginTop:"10px",lineHeight:"24px",display:"flex",width:200}},f.a.createElement(G.a,{style:{display:"flex",height:"24px",alignItems:"center"},disabled:ye.is_published,value:"".concat(ye.id)},f.a.createElement("div",{className:l.a.listClass},f.a.createElement("span",{className:l.a.spantitle,style:{width:ye.is_published?"108px":"170px"}},ye.name),ye.is_published&&f.a.createElement("span",{style:{width:"52px",height:"24px",background:"#B8B8B8",borderRadius:"13px",color:"white",lineHeight:"24px",textAlign:"center",display:"inline-block"}},"\u5DF2\u53D1\u5E03"))))})))),f.a.createElement("div",{className:l.a.rightdiv},f.a.createElement(I.a.Search,{onChange:function(oe){Y(R.filter(function(Se){return Se.name.includes(oe.target.value)}))},size:"large",placeholder:"\u53EF\u8F93\u5165\u73ED\u7EA7\u540D\u79F0\u67E5\u8BE2"}),z.length===0&&f.a.createElement(t.a,{styles:{margin:"70px auto"},customText:"\u6682\u672A\u9009\u62E9\u5206\u73ED"}),z.length>0&&f.a.createElement("div",{style:{marginTop:"10px",height:"85%",overflow:"hidden",position:"relative"}},f.a.createElement("div",{style:{overflowX:"hidden",overflowY:"scroll",position:"absolute",left:0,top:0,right:-17,bottom:0}},z.map(function(ye,oe){return f.a.createElement(V.a,{justify:"space-between",style:{marginTop:"10px"},key:ye.id},f.a.createElement("div",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",marginRight:"5px",marginLeft:"5px",width:"75%"}},ye.name),f.a.createElement("img",{src:s.a,style:{cursor:"pointer",height:"16px",marginRight:17},onClick:function(){P(R.filter(function(_e){return"".concat(_e.id)!="".concat(ye.id)}))}}))})))))};ve.a=u},"500L":function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return w});var Z=T("+L6B"),V=T("2/Rp"),j=T("2qtc"),G=T("kLXV"),M=T("9og8"),I=T("k1fw"),W=T("miYZ"),C=T("tsqr"),r=T("oBTY"),A=T("tJVT"),v=T("DZo9"),f=T("8z0m"),p=T("WmNS"),l=T.n(p),o=T("q1tI"),s=T.n(o),t=T("m3rI"),u=T("wzkS"),a=T("y5JW"),i=T("LtfV"),D=f.a.Dragger;function w(S){var L=[];return S&&S.length>0&&(L=S.map(function(P){return{uid:P.id,id:P.id,name:P.title+a.c+P.filesize,url:P.url,filesize:P.filesize,status:"done",response:{id:P.id}}})),L}ve.b=function(S){var L=S.value,P=S.onChange,_=S.action,b=S.className,g=S.maxSize,m=g===void 0?150:g,y=S.title,x=y===void 0?"\u4E0A\u4F20\u9644\u4EF6":y,O=S.showRemoveModal,H=O===void 0?!1:O,F=S.accept,R=F===void 0?"":F,U=S.additionalText,k=S.isDragger,d=S.number,z=d===void 0?1e3:d,Y=S.aloneClear,re=Y===void 0?!1:Y,le=Object(o.useState)(!1),Ne=Object(A.a)(le,2),Ce=Ne[0],Te=Ne[1],Fe=Object(o.useState)(L||[]),Ve=Object(A.a)(Fe,2),xe=Ve[0],ye=Ve[1];Object(o.useEffect)(function(){L&&(ye(Object(r.a)(L)),z===(L==null?void 0:L.length)&&Te(!0))},[L]);var oe=function(){setTimeout(function(){xe.pop(),ye(Object(r.a)(xe))},500)},Se={multiple:!0,disabled:Ce,accept:R,withCredentials:!0,fileList:xe,beforeUpload:function(rt,ae){var $=rt.size/1024/1024;return xe.concat(ae).length>z?(xe.pop(),ye(Object(r.a)(xe)),C.b.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20".concat(z,"\u4E2A\u6587\u4EF6")),re?Promise.reject():(oe(),!1)):!0},action:_||"".concat(t.a.API_SERVER,"/api/attachments.json"),onChange:function(rt){var ae,$,Q=Object(r.a)(rt.fileList);if(rt.file.status==="done"&&((ae=rt.file)===null||ae===void 0||(($=ae.response)===null||$===void 0)?void 0:$.status)===-1){var te,he;C.b.error((te=rt.file)===null||te===void 0||((he=te.response)===null||he===void 0)?void 0:he.message);return}Q.length>=z?Te(!0):Te(!1),ye(Object(r.a)(Q)),Q=Q.map(function(ge){var we;if(ge!=null&&(we=ge.response)!==null&&we!==void 0&&we.id){var ft;ge.url="/api/attachments/".concat(ge==null||((ft=ge.response)===null||ft===void 0)?void 0:ft.id)}return ge.name.indexOf(a.c)===-1&&(ge.name="".concat(ge.name).concat(a.c).concat(Object(a.a)(ge.size))),Object(I.a)({},ge)}),console.log("info:",rt),P(Q)},onRemove:function(){var He=Object(M.a)(l.a.mark(function ae($){var Q;return l.a.wrap(function(he){for(;;)switch(he.prev=he.next){case 0:if(Q=function(){var ge=Object(M.a)(l.a.mark(function we(){var ft,Pt;return l.a.wrap(function(qe){for(;;)switch(qe.prev=qe.next){case 0:if(ft=$.response?$.response.id:$.id,!ft){qe.next=8;break}return qe.next=4,Object(u.d)($.response?$.response.id:$.uid);case 4:return Pt=qe.sent,qe.abrupt("return",Pt);case 8:return qe.abrupt("return",!0);case 9:case"end":return qe.stop()}},we)}));return function(){return ge.apply(this,arguments)}}(),!H){he.next=5;break}return he.abrupt("return",new Promise(function(ge,we){G.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:s.a.createElement("div",{className:"tc font16"},"\u662F\u5426\u786E\u8BA4\u5220\u9664?"),onOk:function(){var ft=Object(M.a)(l.a.mark(function jt(){var qe;return l.a.wrap(function(sn){for(;;)switch(sn.prev=sn.next){case 0:return sn.next=2,Q();case 2:qe=sn.sent,C.b.success("\u5220\u9664\u6210\u529F"),ge(!0);case 5:case"end":return sn.stop()}},jt)}));function Pt(){return ft.apply(this,arguments)}return Pt}(),onCancel:function(){return ge(!1)}})}));case 5:return he.next=7,Q();case 7:return he.abrupt("return",he.sent);case 8:case"end":return he.stop()}},ae)}));function rt(ae){return He.apply(this,arguments)}return rt}()};function _e(He){He.preventDefault(),He.stopPropagation()}return s.a.createElement("div",{className:"multi-upload ".concat(b||"")},k&&s.a.createElement(D,Se,s.a.createElement("p",{className:"ant-upload-drag-icon"},s.a.createElement(i.a,null)),s.a.createElement("p",{className:"ant-upload-text"},"\u70B9\u51FB\u4E0A\u4F20\u56FE\u6807\uFF0C\u9009\u62E9\u8981\u4E0A\u4F20\u7684\u6587\u4EF6\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64",s.a.createElement("br",null),"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u9650\u5236\u4E3A",m,"MB)"," "),U),!k&&s.a.createElement(f.a,Se,s.a.createElement(V.a,{style:{width:"108px",height:"32px",background:"#F6F7F9 linear-gradient(180deg, #FFFFFF 0%, #F6F7F9 100%)",boxShadow:"0px 2px 4px 0px #E0DFE1, inset 0px 1px 3px 0px rgba(255,255,255,0.5)",borderRadius:"2px",border:"1px solid #BACFFE",color:"#3061D0"},icon:s.a.createElement("i",{className:"iconfont icon-shangchuan3",style:{marginRight:"6px"}}),disabled:Ce},x),s.a.createElement("span",{onClick:_e,style:{marginLeft:10,color:"#FA6400"}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",m,"MB)"," ")))}},"55Ip":function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return a});var Z=T("Ty5D"),V=T("dI71"),j=T("q1tI"),G=T.n(j),M=T("YS25"),I=T("17x9"),W=T.n(I),C=T("wx14"),r=T("zLVn"),A=T("9R94"),v=function(b){Object(V.a)(g,b);function g(){for(var y,x=arguments.length,O=new Array(x),H=0;H<x;H++)O[H]=arguments[H];return y=b.call.apply(b,[this].concat(O))||this,y.history=Object(M.a)(y.props),y}var m=g.prototype;return m.render=function(){return G.a.createElement(Z.c,{history:this.history,children:this.props.children})},g}(G.a.Component),f=function(b){Object(V.a)(g,b);function g(){for(var y,x=arguments.length,O=new Array(x),H=0;H<x;H++)O[H]=arguments[H];return y=b.call.apply(b,[this].concat(O))||this,y.history=Object(M.b)(y.props),y}var m=g.prototype;return m.render=function(){return G.a.createElement(Z.c,{history:this.history,children:this.props.children})},g}(G.a.Component),p=function(g,m){return typeof g=="function"?g(m):g},l=function(g,m){return typeof g=="string"?Object(M.c)(g,null,null,m):g},o=function(g){return g},s=G.a.forwardRef;typeof s=="undefined"&&(s=o);function t(b){return!!(b.metaKey||b.altKey||b.ctrlKey||b.shiftKey)}var u=s(function(b,g){var m=b.innerRef,y=b.navigate,x=b.onClick,O=Object(r.a)(b,["innerRef","navigate","onClick"]),H=O.target,F=Object(C.a)({},O,{onClick:function(U){try{x&&x(U)}catch(k){throw U.preventDefault(),k}!U.defaultPrevented&&U.button===0&&(!H||H==="_self")&&!t(U)&&(U.preventDefault(),y())}});return o!==s?F.ref=g||m:F.ref=m,G.a.createElement("a",F)}),a=s(function(b,g){var m=b.component,y=m===void 0?u:m,x=b.replace,O=b.to,H=b.innerRef,F=Object(r.a)(b,["component","replace","to","innerRef"]);return G.a.createElement(Z.e.Consumer,null,function(R){R||Object(A.a)(!1);var U=R.history,k=l(p(O,R.location),R.location),d=k?U.createHref(k):"",z=Object(C.a)({},F,{href:d,navigate:function(){var re=p(O,R.location),le=x?U.replace:U.push;le(re)}});return o!==s?z.ref=g||H:z.innerRef=H,G.a.createElement(y,z)})});if(!1)var i,D;var w=function(g){return g},S=G.a.forwardRef;typeof S=="undefined"&&(S=w);function L(){for(var b=arguments.length,g=new Array(b),m=0;m<b;m++)g[m]=arguments[m];return g.filter(function(y){return y}).join(" ")}var P=S(function(b,g){var m=b["aria-current"],y=m===void 0?"page":m,x=b.activeClassName,O=x===void 0?"active":x,H=b.activeStyle,F=b.className,R=b.exact,U=b.isActive,k=b.location,d=b.sensitive,z=b.strict,Y=b.style,re=b.to,le=b.innerRef,Ne=Object(r.a)(b,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return G.a.createElement(Z.e.Consumer,null,function(Ce){Ce||Object(A.a)(!1);var Te=k||Ce.location,Fe=l(p(re,Te),Te),Ve=Fe.pathname,xe=Ve&&Ve.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ye=xe?Object(Z.f)(Te.pathname,{path:xe,exact:R,sensitive:d,strict:z}):null,oe=!!(U?U(ye,Te):ye),Se=oe?L(F,O):F,_e=oe?Object(C.a)({},Y,{},H):Y,He=Object(C.a)({"aria-current":oe&&y||null,className:Se,style:_e,to:Fe},Ne);return w!==S?He.ref=g||le:He.innerRef=le,G.a.createElement(a,He)})});if(!1)var _},"5VLF":function(Bt,ve,T){"use strict";var Z,V;function j(G,M,I){var W=function(C,r){return G.js_beautify(C,r)};return W.js=G.js_beautify,W.css=M.css_beautify,W.html=I.html_beautify,W.js_beautify=G.js_beautify,W.css_beautify=M.css_beautify,W.html_beautify=I.html_beautify,W}!(Z=[T("6UM0"),T("TXwP"),T("psGv")],V=function(G,M,I){return j(G,M,I)}.apply(ve,Z),V!==void 0&&(Bt.exports=V))},"5Y4S":function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return j});var Z=T("MNsG");const V=Z.b.performance&&typeof Z.b.performance.now=="function";class j{constructor(G){this._highResolution=V&&G,this._startTime=this._now(),this._stopTime=-1}static create(G=!0){return new j(G)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?Z.b.performance.now():Date.now()}}},"6+eU":function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return S});var Z=T("wx14"),V=T("rePB"),j=T("VTBJ"),G=T("1OyB"),M=T("vuIU"),I=T("Ji7U"),W=T("LK+K"),C=T("q1tI"),r=T.n(C),A=T("TSYQ"),v=T.n(A),f=function(P){var _,b="".concat(P.rootPrefixCls,"-item"),g=v()(b,"".concat(b,"-").concat(P.page),(_={},Object(V.a)(_,"".concat(b,"-active"),P.active),Object(V.a)(_,P.className,!!P.className),Object(V.a)(_,"".concat(b,"-disabled"),!P.page),_)),m=function(){P.onClick(P.page)},y=function(O){P.onKeyPress(O,P.onClick,P.page)};return r.a.createElement("li",{title:P.showTitle?P.page:null,className:g,onClick:m,onKeyPress:y,tabIndex:"0"},P.itemRender(P.page,"page",r.a.createElement("a",{rel:"nofollow"},P.page)))},p=f,l={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},o=function(L){Object(I.a)(_,L);var P=Object(W.a)(_);function _(){var b;Object(G.a)(this,_);for(var g=arguments.length,m=new Array(g),y=0;y<g;y++)m[y]=arguments[y];return b=P.call.apply(P,[this].concat(m)),b.state={goInputText:""},b.buildOptionText=function(x){return"".concat(x," ").concat(b.props.locale.items_per_page)},b.changeSize=function(x){b.props.changeSize(Number(x))},b.handleChange=function(x){b.setState({goInputText:x.target.value})},b.handleBlur=function(x){var O=b.props,H=O.goButton,F=O.quickGo,R=O.rootPrefixCls,U=b.state.goInputText;if(H||U==="")return;if(x.relatedTarget&&(x.relatedTarget.className.indexOf("".concat(R,"-prev"))>=0||x.relatedTarget.className.indexOf("".concat(R,"-next"))>=0))return;b.setState({goInputText:""}),F(b.getValidValue())},b.go=function(x){var O=b.state.goInputText;if(O==="")return;(x.keyCode===l.ENTER||x.type==="click")&&(b.setState({goInputText:""}),b.props.quickGo(b.getValidValue()))},b}return Object(M.a)(_,[{key:"getValidValue",value:function(){var g=this.state,m=g.goInputText,y=g.current;return!m||isNaN(m)?y:Number(m)}},{key:"getPageSizeOptions",value:function(){var g=this.props,m=g.pageSize,y=g.pageSizeOptions;return y.some(function(x){return x.toString()===m.toString()})?y:y.concat([m.toString()]).sort(function(x,O){var H=isNaN(Number(x))?0:Number(x),F=isNaN(Number(O))?0:Number(O);return H-F})}},{key:"render",value:function(){var g=this,m=this.props,y=m.pageSize,x=m.locale,O=m.rootPrefixCls,H=m.changeSize,F=m.quickGo,R=m.goButton,U=m.selectComponentClass,k=m.buildOptionText,d=m.selectPrefixCls,z=m.disabled,Y=this.state.goInputText,re="".concat(O,"-options"),le=U,Ne=null,Ce=null,Te=null;if(!H&&!F)return null;var Fe=this.getPageSizeOptions();if(H&&le){var Ve=Fe.map(function(xe,ye){return r.a.createElement(le.Option,{key:ye,value:xe.toString()},(k||g.buildOptionText)(xe))});Ne=r.a.createElement(le,{disabled:z,prefixCls:d,showSearch:!1,className:"".concat(re,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(y||Fe[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ye){return ye.parentNode}},Ve)}return F&&(R&&(Te=typeof R=="boolean"?r.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:z,className:"".concat(re,"-quick-jumper-button")},x.jump_to_confirm):r.a.createElement("span",{onClick:this.go,onKeyUp:this.go},R)),Ce=r.a.createElement("div",{className:"".concat(re,"-quick-jumper")},x.jump_to,r.a.createElement("input",{disabled:z,type:"text",value:Y,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),x.page,Te)),r.a.createElement("li",{className:"".concat(re)},Ne,Ce)}}]),_}(r.a.Component);o.defaultProps={pageSizeOptions:["10","20","50","100"]};var s=o,t=T("N2Kk");function u(){}function a(L){return typeof L=="number"&&isFinite(L)&&Math.floor(L)===L}function i(L,P,_){return _}function D(L,P,_){var b=typeof L=="undefined"?P.pageSize:L;return Math.floor((_.total-1)/b)+1}var w=function(L){Object(I.a)(_,L);var P=Object(W.a)(_);function _(b){var g;Object(G.a)(this,_),g=P.call(this,b),g.getJumpPrevPage=function(){return Math.max(1,g.state.current-(g.props.showLessItems?3:5))},g.getJumpNextPage=function(){return Math.min(D(void 0,g.state,g.props),g.state.current+(g.props.showLessItems?3:5))},g.getItemIcon=function(H,F){var R=g.props.prefixCls,U=H||r.a.createElement("button",{type:"button","aria-label":F,className:"".concat(R,"-item-link")});return typeof H=="function"&&(U=r.a.createElement(H,Object(j.a)({},g.props))),U},g.savePaginationNode=function(H){g.paginationNode=H},g.isValid=function(H){return a(H)&&H!==g.state.current},g.shouldDisplayQuickJumper=function(){var H=g.props,F=H.showQuickJumper,R=H.pageSize,U=H.total;return U<=R?!1:F},g.handleKeyDown=function(H){(H.keyCode===l.ARROW_UP||H.keyCode===l.ARROW_DOWN)&&H.preventDefault()},g.handleKeyUp=function(H){var F=g.getValidValue(H),R=g.state.currentInputValue;F!==R&&g.setState({currentInputValue:F}),H.keyCode===l.ENTER?g.handleChange(F):H.keyCode===l.ARROW_UP?g.handleChange(F-1):H.keyCode===l.ARROW_DOWN&&g.handleChange(F+1)},g.changePageSize=function(H){var F=g.state.current,R=D(H,g.state,g.props);F=F>R?R:F,R===0&&(F=g.state.current),typeof H=="number"&&("pageSize"in g.props||g.setState({pageSize:H}),"current"in g.props||g.setState({current:F,currentInputValue:F})),g.props.onShowSizeChange(F,H),"onChange"in g.props&&g.props.onChange&&g.props.onChange(F,H)},g.handleChange=function(H){var F=g.props.disabled,R=H;if(g.isValid(R)&&!F){var U=D(void 0,g.state,g.props);R>U?R=U:R<1&&(R=1),"current"in g.props||g.setState({current:R,currentInputValue:R});var k=g.state.pageSize;return g.props.onChange(R,k),R}return g.state.current},g.prev=function(){g.hasPrev()&&g.handleChange(g.state.current-1)},g.next=function(){g.hasNext()&&g.handleChange(g.state.current+1)},g.jumpPrev=function(){g.handleChange(g.getJumpPrevPage())},g.jumpNext=function(){g.handleChange(g.getJumpNextPage())},g.hasPrev=function(){return g.state.current>1},g.hasNext=function(){return g.state.current<D(void 0,g.state,g.props)},g.runIfEnter=function(H,F){if(H.key==="Enter"||H.charCode===13){for(var R=arguments.length,U=new Array(R>2?R-2:0),k=2;k<R;k++)U[k-2]=arguments[k];F.apply(void 0,U)}},g.runIfEnterPrev=function(H){g.runIfEnter(H,g.prev)},g.runIfEnterNext=function(H){g.runIfEnter(H,g.next)},g.runIfEnterJumpPrev=function(H){g.runIfEnter(H,g.jumpPrev)},g.runIfEnterJumpNext=function(H){g.runIfEnter(H,g.jumpNext)},g.handleGoTO=function(H){(H.keyCode===l.ENTER||H.type==="click")&&g.handleChange(g.state.currentInputValue)};var m=b.onChange!==u,y="current"in b;y&&!m&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var x=b.defaultCurrent;"current"in b&&(x=b.current);var O=b.defaultPageSize;return"pageSize"in b&&(O=b.pageSize),x=Math.min(x,D(O,void 0,b)),g.state={current:x,currentInputValue:x,pageSize:O},g}return Object(M.a)(_,[{key:"componentDidUpdate",value:function(g,m){var y=this.props.prefixCls;if(m.current!==this.state.current&&this.paginationNode){var x=this.paginationNode.querySelector(".".concat(y,"-item-").concat(m.current));x&&document.activeElement===x&&x.blur()}}},{key:"getValidValue",value:function(g){var m=g.target.value,y=D(void 0,this.state,this.props),x=this.state.currentInputValue,O;return m===""?O=m:isNaN(Number(m))?O=x:m>=y?O=y:O=Number(m),O}},{key:"getShowSizeChanger",value:function(){var g=this.props,m=g.showSizeChanger,y=g.total,x=g.totalBoundaryShowSizeChanger;return typeof m!="undefined"?m:y>x}},{key:"renderPrev",value:function(g){var m=this.props,y=m.prevIcon,x=m.itemRender,O=x(g,"prev",this.getItemIcon(y,"prev page")),H=!this.hasPrev();return Object(C.isValidElement)(O)?Object(C.cloneElement)(O,{disabled:H}):O}},{key:"renderNext",value:function(g){var m=this.props,y=m.nextIcon,x=m.itemRender,O=x(g,"next",this.getItemIcon(y,"next page")),H=!this.hasNext();return Object(C.isValidElement)(O)?Object(C.cloneElement)(O,{disabled:H}):O}},{key:"render",value:function(){var g=this,m=this.props,y=m.prefixCls,x=m.className,O=m.style,H=m.disabled,F=m.hideOnSinglePage,R=m.total,U=m.locale,k=m.showQuickJumper,d=m.showLessItems,z=m.showTitle,Y=m.showTotal,re=m.simple,le=m.itemRender,Ne=m.showPrevNextJumpers,Ce=m.jumpPrevIcon,Te=m.jumpNextIcon,Fe=m.selectComponentClass,Ve=m.selectPrefixCls,xe=m.pageSizeOptions,ye=this.state,oe=ye.current,Se=ye.pageSize,_e=ye.currentInputValue;if(F===!0&&R<=Se)return null;var He=D(void 0,this.state,this.props),rt=[],ae=null,$=null,Q=null,te=null,he=null,ge=k&&k.goButton,we=d?1:2,ft=oe-1>0?oe-1:0,Pt=oe+1<He?oe+1:He,jt=Object.keys(this.props).reduce(function(de,fe){return(fe.substr(0,5)==="data-"||fe.substr(0,5)==="aria-"||fe==="role")&&(de[fe]=g.props[fe]),de},{});if(re)return ge&&(typeof ge=="boolean"?he=r.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},U.jump_to_confirm):he=r.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},ge),he=r.a.createElement("li",{title:z?"".concat(U.jump_to).concat(oe,"/").concat(He):null,className:"".concat(y,"-simple-pager")},he)),r.a.createElement("ul",Object(Z.a)({className:v()(y,"".concat(y,"-simple"),Object(V.a)({},"".concat(y,"-disabled"),H),x),style:O,ref:this.savePaginationNode},jt),r.a.createElement("li",{title:z?U.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:v()("".concat(y,"-prev"),Object(V.a)({},"".concat(y,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(ft)),r.a.createElement("li",{title:z?"".concat(oe,"/").concat(He):null,className:"".concat(y,"-simple-pager")},r.a.createElement("input",{type:"text",value:_e,disabled:H,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),r.a.createElement("span",{className:"".concat(y,"-slash")},"/"),He),r.a.createElement("li",{title:z?U.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:v()("".concat(y,"-next"),Object(V.a)({},"".concat(y,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Pt)),he);if(He<=3+we*2){var qe={locale:U,rootPrefixCls:y,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:z,itemRender:le};He||rt.push(r.a.createElement(p,Object(Z.a)({},qe,{key:"noPager",page:He,className:"".concat(y,"-disabled")})));for(var Mt=1;Mt<=He;Mt+=1){var sn=oe===Mt;rt.push(r.a.createElement(p,Object(Z.a)({},qe,{key:Mt,page:Mt,active:sn})))}}else{var at=d?U.prev_3:U.prev_5,Qe=d?U.next_3:U.next_5;Ne&&(ae=r.a.createElement("li",{title:z?at:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:v()("".concat(y,"-jump-prev"),Object(V.a)({},"".concat(y,"-jump-prev-custom-icon"),!!Ce))},le(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(Ce,"prev page"))),$=r.a.createElement("li",{title:z?Qe:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:v()("".concat(y,"-jump-next"),Object(V.a)({},"".concat(y,"-jump-next-custom-icon"),!!Te))},le(this.getJumpNextPage(),"jump-next",this.getItemIcon(Te,"next page")))),te=r.a.createElement(p,{locale:U,last:!0,rootPrefixCls:y,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:He,page:He,active:!1,showTitle:z,itemRender:le}),Q=r.a.createElement(p,{locale:U,rootPrefixCls:y,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:z,itemRender:le});var Et=Math.max(1,oe-we),It=Math.min(oe+we,He);oe-1<=we&&(It=1+we*2),He-oe<=we&&(Et=He-we*2);for(var dt=Et;dt<=It;dt+=1){var mt=oe===dt;rt.push(r.a.createElement(p,{locale:U,rootPrefixCls:y,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:dt,page:dt,active:mt,showTitle:z,itemRender:le}))}oe-1>=we*2&&oe!==1+2&&(rt[0]=Object(C.cloneElement)(rt[0],{className:"".concat(y,"-item-after-jump-prev")}),rt.unshift(ae)),He-oe>=we*2&&oe!==He-2&&(rt[rt.length-1]=Object(C.cloneElement)(rt[rt.length-1],{className:"".concat(y,"-item-before-jump-next")}),rt.push($)),Et!==1&&rt.unshift(Q),It!==He&&rt.push(te)}var We=null;Y&&(We=r.a.createElement("li",{className:"".concat(y,"-total-text")},Y(R,[R===0?0:(oe-1)*Se+1,oe*Se>R?R:oe*Se])));var De=!this.hasPrev()||!He,Le=!this.hasNext()||!He;return r.a.createElement("ul",Object(Z.a)({className:v()(y,x,Object(V.a)({},"".concat(y,"-disabled"),H)),style:O,unselectable:"unselectable",ref:this.savePaginationNode},jt),We,r.a.createElement("li",{title:z?U.prev_page:null,onClick:this.prev,tabIndex:De?null:0,onKeyPress:this.runIfEnterPrev,className:v()("".concat(y,"-prev"),Object(V.a)({},"".concat(y,"-disabled"),De)),"aria-disabled":De},this.renderPrev(ft)),rt,r.a.createElement("li",{title:z?U.next_page:null,onClick:this.next,tabIndex:Le?null:0,onKeyPress:this.runIfEnterNext,className:v()("".concat(y,"-next"),Object(V.a)({},"".concat(y,"-disabled"),Le)),"aria-disabled":Le},this.renderNext(Pt)),r.a.createElement(s,{disabled:H,locale:U,rootPrefixCls:y,selectComponentClass:Fe,selectPrefixCls:Ve,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:oe,pageSize:Se,pageSizeOptions:xe,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:ge}))}}],[{key:"getDerivedStateFromProps",value:function(g,m){var y={};if("current"in g&&(y.current=g.current,g.current!==m.current&&(y.currentInputValue=y.current)),"pageSize"in g&&g.pageSize!==m.pageSize){var x=m.current,O=D(g.pageSize,m,g);x=x>O?O:x,"current"in g||(y.current=x,y.currentInputValue=x),y.pageSize=g.pageSize}return y}}]),_}(r.a.Component);w.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:u,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:u,locale:t.a,style:{},itemRender:i,totalBoundaryShowSizeChanger:50};var S=w},"6Bc3":function(Bt,ve,T){Bt.exports=T.p+"static/document-review.8bdb0663.png"},"6RRn":function(Bt,ve,T){"use strict";var Z=T("wCXF"),V=T("n6Qo");T.d(ve,"b",function(){return V.a});var j=T("IBYe"),G=T("6eGT"),M=T("hW8S");T.d(ve,"a",function(){return M.a}),ve.c=Z.b},"6UM0":function(Bt,ve,T){var Z,V;(function(){var j;(function(){"use strict";var M=[function(r,A,v){var f=v(1).Beautifier,p=v(5).Options;function l(o,s){var t=new f(o,s);return t.beautify()}r.exports=l,r.exports.defaultOptions=function(){return new p}},function(r,A,v){var f=v(2).Output,p=v(3).Token,l=v(4),o=v(5).Options,s=v(7).Tokenizer,t=v(7).line_starters,u=v(7).positionable_operators,a=v(7).TOKEN;function i(d,z){return z.indexOf(d)!==-1}function D(d){return d.replace(/^\s+/g,"")}function w(d){for(var z={},Y=0;Y<d.length;Y++)z[d[Y].replace(/-/g,"_")]=d[Y];return z}function S(d,z){return d&&d.type===a.RESERVED&&d.text===z}function L(d,z){return d&&d.type===a.RESERVED&&i(d.text,z)}var P=["case","return","do","if","throw","else","await","break","continue","async"],_=["before-newline","after-newline","preserve-newline"],b=w(_),g=[b.before_newline,b.preserve_newline],m={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function y(d,z){if(z.multiline_frame||z.mode===m.ForInitializer||z.mode===m.Conditional)return;d.remove_indent(z.start_line_index)}function x(d){d=d.replace(l.allLineBreaks,`
`);for(var z=[],Y=d.indexOf(`
`);Y!==-1;)z.push(d.substring(0,Y)),d=d.substring(Y+1),Y=d.indexOf(`
`);return d.length&&z.push(d),z}function O(d){return d===m.ArrayLiteral}function H(d){return i(d,[m.Expression,m.ForInitializer,m.Conditional])}function F(d,z){for(var Y=0;Y<d.length;Y++){var re=d[Y].trim();if(re.charAt(0)!==z)return!1}return!0}function R(d,z){for(var Y=0,re=d.length,le;Y<re;Y++)if(le=d[Y],le&&le.indexOf(z)!==0)return!1;return!0}function U(d,z){z=z||{},this._source_text=d||"",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 o(z)}U.prototype.create_flags=function(d,z){var Y=0;d&&(Y=d.indentation_level,!this._output.just_added_newline()&&d.line_indent_level>Y&&(Y=d.line_indent_level));var re={mode:z,parent:d,last_token:d?d.last_token:new p(a.START_BLOCK,""),last_word:d?d.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:Y,alignment:0,line_indent_level:d?d.line_indent_level:Y,start_line_index:this._output.get_line_number(),ternary_depth:0};return re},U.prototype._reset=function(d){var z=d.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new f(this._options,z),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(m.BlockStatement);var Y=new s(d,this._options);return this._tokens=Y.tokenize(),d},U.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var d,z=this._reset(this._source_text),Y=this._options.eol;this._options.eol==="auto"&&(Y=`
`,z&&l.lineBreak.test(z||"")&&(Y=z.match(l.lineBreak)[0]));for(var re=this._tokens.next();re;)this.handle_token(re),this._last_last_text=this._flags.last_token.text,this._flags.last_token=re,re=this._tokens.next();return d=this._output.get_code(Y),d},U.prototype.handle_token=function(d,z){d.type===a.START_EXPR?this.handle_start_expr(d):d.type===a.END_EXPR?this.handle_end_expr(d):d.type===a.START_BLOCK?this.handle_start_block(d):d.type===a.END_BLOCK?this.handle_end_block(d):d.type===a.WORD?this.handle_word(d):d.type===a.RESERVED?this.handle_word(d):d.type===a.SEMICOLON?this.handle_semicolon(d):d.type===a.STRING?this.handle_string(d):d.type===a.EQUALS?this.handle_equals(d):d.type===a.OPERATOR?this.handle_operator(d):d.type===a.COMMA?this.handle_comma(d):d.type===a.BLOCK_COMMENT?this.handle_block_comment(d,z):d.type===a.COMMENT?this.handle_comment(d,z):d.type===a.DOT?this.handle_dot(d):d.type===a.EOF?this.handle_eof(d):d.type===a.UNKNOWN?this.handle_unknown(d,z):this.handle_unknown(d,z)},U.prototype.handle_whitespace_and_comments=function(d,z){var Y=d.newlines,re=this._options.keep_array_indentation&&O(this._flags.mode);if(d.comments_before)for(var le=d.comments_before.next();le;)this.handle_whitespace_and_comments(le,z),this.handle_token(le,z),le=d.comments_before.next();if(re)for(var Ne=0;Ne<Y;Ne+=1)this.print_newline(Ne>0,z);else if(this._options.max_preserve_newlines&&Y>this._options.max_preserve_newlines&&(Y=this._options.max_preserve_newlines),this._options.preserve_newlines&&Y>1){this.print_newline(!1,z);for(var Ce=1;Ce<Y;Ce+=1)this.print_newline(!0,z)}};var k=["async","break","continue","return","throw","yield"];U.prototype.allow_wrap_or_preserved_newline=function(d,z){if(z=z===void 0?!1:z,this._output.just_added_newline())return;var Y=this._options.preserve_newlines&&d.newlines||z,re=i(this._flags.last_token.text,u)||i(d.text,u);if(re){var le=i(this._flags.last_token.text,u)&&i(this._options.operator_position,g)||i(d.text,u);Y=Y&&le}if(Y)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(L(this._flags.last_token,k))return;this._output.set_wrap_point()}},U.prototype.print_newline=function(d,z){if(!z&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==a.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var Y=this._tokens.peek();this._flags.mode===m.Statement&&!(this._flags.if_block&&S(Y,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(d)&&(this._flags.multiline_frame=!0)},U.prototype.print_token_line_indentation=function(d){this._output.just_added_newline()&&(this._options.keep_array_indentation&&d.newlines&&(d.text==="["||O(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(d.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))},U.prototype.print_token=function(d){if(this._output.raw){this._output.add_raw_token(d);return}if(this._options.comma_first&&d.previous&&d.previous.type===a.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var z=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(z),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(d),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(d),this._output.non_breaking_space=!0,this._output.add_token(d.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},U.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},U.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))},U.prototype.set_mode=function(d){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,d),this._flags=this.create_flags(this._previous_flags,d),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},U.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===m.Statement&&y(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},U.prototype.start_of_object_property=function(){return this._flags.parent.mode===m.ObjectLiteral&&this._flags.mode===m.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||L(this._flags.last_token,["get","set"]))},U.prototype.start_of_statement=function(d){var z=!1;return z=z||L(this._flags.last_token,["var","let","const"])&&d.type===a.WORD,z=z||S(this._flags.last_token,"do"),z=z||!(this._flags.parent.mode===m.ObjectLiteral&&this._flags.mode===m.Statement)&&L(this._flags.last_token,k)&&!d.newlines,z=z||S(this._flags.last_token,"else")&&!(S(d,"if")&&!d.comments_before),z=z||this._flags.last_token.type===a.END_EXPR&&(this._previous_flags.mode===m.ForInitializer||this._previous_flags.mode===m.Conditional),z=z||this._flags.last_token.type===a.WORD&&this._flags.mode===m.BlockStatement&&!this._flags.in_case&&!(d.text==="--"||d.text==="++")&&this._last_last_text!=="function"&&d.type!==a.WORD&&d.type!==a.RESERVED,z=z||this._flags.mode===m.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||L(this._flags.last_token,["get","set"])),z?(this.set_mode(m.Statement),this.indent(),this.handle_whitespace_and_comments(d,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(d,L(d,["do","for","if","while"])),!0):!1},U.prototype.handle_start_expr=function(d){this.start_of_statement(d)||this.handle_whitespace_and_comments(d);var z=m.Expression;if(d.text==="["){if(this._flags.last_token.type===a.WORD||this._flags.last_token.text===")"){L(this._flags.last_token,t)&&(this._output.space_before_token=!0),this.print_token(d),this.set_mode(z),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}z=m.ArrayLiteral,O(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())),i(this._flags.last_token.type,[a.START_EXPR,a.END_EXPR,a.WORD,a.OPERATOR,a.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===a.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,z=m.ForInitializer):i(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,z=m.Conditional):i(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&d.whitespace_before===""?this._output.space_before_token=!1:(i(this._flags.last_token.text,t)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===a.EQUALS||this._flags.last_token.type===a.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(d);else if(this._flags.last_token.type===a.WORD){this._output.space_before_token=!1;var Y=this._tokens.peek(-3);if(this._options.space_after_named_function&&Y){var re=this._tokens.peek(-4);L(Y,["async","function"])||Y.text==="*"&&L(re,["async","function"])?this._output.space_before_token=!0:this._flags.mode===m.ObjectLiteral?(Y.text==="{"||Y.text===","||Y.text==="*"&&(re.text==="{"||re.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(d);(this._flags.last_token.type===a.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(i(this._last_last_text,["function","yield"])||this._flags.mode===m.ObjectLiteral&&i(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===a.START_BLOCK?this.print_newline():(this._flags.last_token.type===a.END_EXPR||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===a.COMMA)&&this.allow_wrap_or_preserved_newline(d,d.newlines),this.print_token(d),this.set_mode(z),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},U.prototype.handle_end_expr=function(d){for(;this._flags.mode===m.Statement;)this.restore_mode();this.handle_whitespace_and_comments(d),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(d,d.text==="]"&&O(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===a.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(d),this.restore_mode(),y(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===m.Conditional&&(this._previous_flags.mode=m.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},U.prototype.handle_start_block=function(d){this.handle_whitespace_and_comments(d);var z=this._tokens.peek(),Y=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===a.END_EXPR?(this.set_mode(m.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(m.BlockStatement):Y&&(i(Y.text,[":",","])&&i(z.type,[a.STRING,a.WORD,a.RESERVED])||i(z.text,["get","set","..."])&&i(Y.type,[a.WORD,a.RESERVED]))?i(this._last_last_text,["class","interface"])&&!i(Y.text,[":",","])?this.set_mode(m.BlockStatement):this.set_mode(m.ObjectLiteral):this._flags.last_token.type===a.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(m.BlockStatement):i(this._flags.last_token.type,[a.EQUALS,a.START_EXPR,a.COMMA,a.OPERATOR])||L(this._flags.last_token,["return","throw","import","default"])?this.set_mode(m.ObjectLiteral):this.set_mode(m.BlockStatement),this._flags.last_token&&(L(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var re=!z.comments_before&&z.text==="}",le=re&&this._flags.last_word==="function"&&this._flags.last_token.type===a.END_EXPR;if(this._options.brace_preserve_inline){var Ne=0,Ce=null;this._flags.inline_frame=!0;do if(Ne+=1,Ce=this._tokens.peek(Ne-1),Ce.newlines){this._flags.inline_frame=!1;break}while(Ce.type!==a.EOF&&!(Ce.type===a.END_BLOCK&&Ce.opened===d))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&d.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==a.OPERATOR&&(le||this._flags.last_token.type===a.EQUALS||L(this._flags.last_token,P)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(O(this._previous_flags.mode)&&(this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.COMMA)&&((this._flags.last_token.type===a.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(d),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==a.OPERATOR&&this._flags.last_token.type!==a.START_EXPR&&(this._flags.last_token.type===a.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(d),this.indent(),!re&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},U.prototype.handle_end_block=function(d){for(this.handle_whitespace_and_comments(d);this._flags.mode===m.Statement;)this.restore_mode();var z=this._flags.last_token.type===a.START_BLOCK;this._flags.inline_frame&&!z?this._output.space_before_token=!0:this._options.brace_style==="expand"?z||this.print_newline():z||(O(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(d)},U.prototype.handle_word=function(d){if(d.type===a.RESERVED){if(i(d.text,["set","get"])&&this._flags.mode!==m.ObjectLiteral)d.type=a.WORD;else if(d.text==="import"&&i(this._tokens.peek().text,["(","."]))d.type=a.WORD;else if(i(d.text,["as","from"])&&!this._flags.import_block)d.type=a.WORD;else if(this._flags.mode===m.ObjectLiteral){var z=this._tokens.peek();z.text===":"&&(d.type=a.WORD)}}if(this.start_of_statement(d)?L(this._flags.last_token,["var","let","const"])&&d.type===a.WORD&&(this._flags.declaration_statement=!0):d.newlines&&!H(this._flags.mode)&&(this._flags.last_token.type!==a.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==a.EQUALS&&(this._options.preserve_newlines||!L(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(d),this.print_newline()):this.handle_whitespace_and_comments(d),this._flags.do_block&&!this._flags.do_while)if(S(d,"while")){this._output.space_before_token=!0,this.print_token(d),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(d,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===m.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&L(d,["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(d),this._flags.in_case=!0;return}if((this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.EQUALS||this._flags.last_token.type===a.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(d)),S(d,"function")){(i(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(i(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===a.OPERATOR))&&(!this._output.just_added_blankline()&&!d.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD?L(this._flags.last_token,["get","set","new","export"])||L(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===a.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(H(this._flags.mode)||O(this._flags.mode))||this.print_newline(),this.print_token(d),this._flags.last_word=d.text;return}var Y="NONE";if(this._flags.last_token.type===a.END_BLOCK?this._previous_flags.inline_frame?Y="SPACE":L(d,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&d.newlines?Y="NEWLINE":(Y="SPACE",this._output.space_before_token=!0):Y="NEWLINE":this._flags.last_token.type===a.SEMICOLON&&this._flags.mode===m.BlockStatement?Y="NEWLINE":this._flags.last_token.type===a.SEMICOLON&&H(this._flags.mode)?Y="SPACE":this._flags.last_token.type===a.STRING?Y="NEWLINE":this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD||this._flags.last_token.text==="*"&&(i(this._last_last_text,["function","yield"])||this._flags.mode===m.ObjectLiteral&&i(this._last_last_text,["{",","]))?Y="SPACE":this._flags.last_token.type===a.START_BLOCK?this._flags.inline_frame?Y="SPACE":Y="NEWLINE":this._flags.last_token.type===a.END_EXPR&&(this._output.space_before_token=!0,Y="NEWLINE"),L(d,t)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?Y="SPACE":Y="NEWLINE"),L(d,["else","catch","finally"]))if((!(this._flags.last_token.type===a.END_BLOCK&&this._previous_flags.mode===m.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&d.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var re=this._output.current_line;re.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else Y==="NEWLINE"?L(this._flags.last_token,P)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&L(d,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==a.END_EXPR?(this._flags.last_token.type!==a.START_EXPR||!L(d,["var","let","const"]))&&this._flags.last_token.text!==":"&&(S(d,"if")&&S(d.previous,"else")?this._output.space_before_token=!0:this.print_newline()):L(d,t)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&O(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():Y==="SPACE"&&(this._output.space_before_token=!0);d.previous&&(d.previous.type===a.WORD||d.previous.type===a.RESERVED)&&(this._output.space_before_token=!0),this.print_token(d),this._flags.last_word=d.text,d.type===a.RESERVED&&(d.text==="do"?this._flags.do_block=!0:d.text==="if"?this._flags.if_block=!0:d.text==="import"?this._flags.import_block=!0:this._flags.import_block&&S(d,"from")&&(this._flags.import_block=!1))},U.prototype.handle_semicolon=function(d){this.start_of_statement(d)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(d);for(var z=this._tokens.peek();this._flags.mode===m.Statement&&!(this._flags.if_block&&S(z,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(d)},U.prototype.handle_string=function(d){d.text.startsWith("`")&&d.newlines===0&&d.whitespace_before===""&&(d.previous.text===")"||this._flags.last_token.type===a.WORD)||(this.start_of_statement(d)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(d),this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.EQUALS||this._flags.last_token.type===a.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(d):d.text.startsWith("`")&&this._flags.last_token.type===a.END_EXPR&&(d.previous.text==="]"||d.previous.text===")")&&d.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(d)},U.prototype.handle_equals=function(d){this.start_of_statement(d)||this.handle_whitespace_and_comments(d),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(d),this._output.space_before_token=!0},U.prototype.handle_comma=function(d){this.handle_whitespace_and_comments(d,!0),this.print_token(d),this._output.space_before_token=!0,this._flags.declaration_statement?(H(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(d)):this._flags.mode===m.ObjectLiteral||this._flags.mode===m.Statement&&this._flags.parent.mode===m.ObjectLiteral?(this._flags.mode===m.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(d)},U.prototype.handle_operator=function(d){var z=d.text==="*"&&(L(this._flags.last_token,["function","yield"])||i(this._flags.last_token.type,[a.START_BLOCK,a.COMMA,a.END_BLOCK,a.SEMICOLON])),Y=i(d.text,["-","+"])&&(i(this._flags.last_token.type,[a.START_BLOCK,a.START_EXPR,a.EQUALS,a.OPERATOR])||i(this._flags.last_token.text,t)||this._flags.last_token.text===",");if(!this.start_of_statement(d)){var re=!z;this.handle_whitespace_and_comments(d,re)}if(d.text==="*"&&this._flags.last_token.type===a.DOT){this.print_token(d);return}if(d.text==="::"){this.print_token(d);return}if(this._flags.last_token.type===a.OPERATOR&&i(this._options.operator_position,g)&&this.allow_wrap_or_preserved_newline(d),d.text===":"&&this._flags.in_case){this.print_token(d),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==a.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 le=!0,Ne=!0,Ce=!1;if(d.text===":"?this._flags.ternary_depth===0?le=!1:(this._flags.ternary_depth-=1,Ce=!0):d.text==="?"&&(this._flags.ternary_depth+=1),!Y&&!z&&this._options.preserve_newlines&&i(d.text,u)){var Te=d.text===":",Fe=Te&&Ce,Ve=Te&&!Ce;switch(this._options.operator_position){case b.before_newline:this._output.space_before_token=!Ve,this.print_token(d),(!Te||Fe)&&this.allow_wrap_or_preserved_newline(d),this._output.space_before_token=!0;return;case b.after_newline:this._output.space_before_token=!0,!Te||Fe?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(d):this._output.space_before_token=!1,this.print_token(d),this._output.space_before_token=!0;return;case b.preserve_newline:Ve||this.allow_wrap_or_preserved_newline(d),le=!(this._output.just_added_newline()||Ve),this._output.space_before_token=le,this.print_token(d),this._output.space_before_token=!0;return}}if(z){this.allow_wrap_or_preserved_newline(d),le=!1;var xe=this._tokens.peek();Ne=xe&&i(xe.type,[a.WORD,a.RESERVED])}else if(d.text==="...")this.allow_wrap_or_preserved_newline(d),le=this._flags.last_token.type===a.START_BLOCK,Ne=!1;else if(i(d.text,["--","++","!","~"])||Y){if((this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR)&&this.allow_wrap_or_preserved_newline(d),le=!1,Ne=!1,d.newlines&&(d.text==="--"||d.text==="++"||d.text==="~")){var ye=L(this._flags.last_token,P)&&d.newlines;ye&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ye,!0)}this._flags.last_token.text===";"&&H(this._flags.mode)&&(le=!0),this._flags.last_token.type===a.RESERVED?le=!0:this._flags.last_token.type===a.END_EXPR?le=!(this._flags.last_token.text==="]"&&(d.text==="--"||d.text==="++")):this._flags.last_token.type===a.OPERATOR&&(le=i(d.text,["--","-","++","+"])&&i(this._flags.last_token.text,["--","-","++","+"]),i(d.text,["+","-"])&&i(this._flags.last_token.text,["--","++"])&&(Ne=!0)),(this._flags.mode===m.BlockStatement&&!this._flags.inline_frame||this._flags.mode===m.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||le,this.print_token(d),this._output.space_before_token=Ne},U.prototype.handle_block_comment=function(d,z){if(this._output.raw){this._output.add_raw_token(d),d.directives&&d.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(d.directives){this.print_newline(!1,z),this.print_token(d),d.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!l.newline.test(d.text)&&!d.newlines){this._output.space_before_token=!0,this.print_token(d),this._output.space_before_token=!0;return}else this.print_block_commment(d,z)},U.prototype.print_block_commment=function(d,z){var Y=x(d.text),re,le=!1,Ne=!1,Ce=d.whitespace_before,Te=Ce.length;if(this.print_newline(!1,z),this.print_token_line_indentation(d),this._output.add_token(Y[0]),this.print_newline(!1,z),Y.length>1){for(Y=Y.slice(1),le=F(Y,"*"),Ne=R(Y,Ce),le&&(this._flags.alignment=1),re=0;re<Y.length;re++)le?(this.print_token_line_indentation(d),this._output.add_token(D(Y[re]))):Ne&&Y[re]?(this.print_token_line_indentation(d),this._output.add_token(Y[re].substring(Te))):(this._output.current_line.set_indent(-1),this._output.add_token(Y[re])),this.print_newline(!1,z);this._flags.alignment=0}},U.prototype.handle_comment=function(d,z){d.newlines?this.print_newline(!1,z):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(d),this.print_newline(!1,z)},U.prototype.handle_dot=function(d){this.start_of_statement(d)||this.handle_whitespace_and_comments(d,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),L(this._flags.last_token,P)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(d,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(d)},U.prototype.handle_unknown=function(d,z){this.print_token(d),d.text[d.text.length-1]===`
`&&this.print_newline(!1,z)},U.prototype.handle_eof=function(d){for(;this._flags.mode===m.Statement;)this.restore_mode();this.handle_whitespace_and_comments(d)},r.exports.Beautifier=U},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 l=this.__items.length-1;l>=0;l--)if(this.__items[l].match(p))return!0;return!1},A.prototype.set_indent=function(p,l){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=l||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 l=p.lastIndexOf(`
`);l!==-1?this.__character_count=p.length-l: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 v(p,l){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)),l=l||"",p.indent_level>0&&(l=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=l,this.__base_string_length=l.length}v.prototype.get_indent_size=function(p,l){var o=this.__base_string_length;return l=l||0,p<0&&(o=0),o+=p*this.__indent_size,o+=l,o},v.prototype.get_indent_string=function(p,l){var o=this.__base_string;return l=l||0,p<0&&(p=0,o=""),l+=p*this.__indent_size,this.__ensure_cache(l),o+=this.__cache[l],o},v.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},v.prototype.__add_column=function(){var p=this.__cache.length,l=0,o="";this.__indent_size&&p>=this.__indent_size&&(l=Math.floor(p/this.__indent_size),p-=l*this.__indent_size,o=new Array(l+1).join(this.__indent_string)),p&&(o+=new Array(p+1).join(" ")),this.__cache.push(o)};function f(p,l){this.__indent_cache=new v(p,l),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,l){return this.__indent_cache.get_indent_string(p,l)},f.prototype.get_indent_size=function(p,l){return this.__indent_cache.get_indent_size(p,l)},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 l=this.current_line.pop();l&&(l[l.length-1]===`
`&&(l=l.replace(/\n+$/g,"")),this.current_line.push(l)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
`);return p!==`
`&&(o=o.replace(/[\n]/g,p)),o},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(p,l){return p=p||0,l=l||0,this.next_line.set_indent(p,l),this.__lines.length>1?(this.current_line.set_indent(p,l),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(p){for(var l=0;l<p.newlines;l++)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 l=this.__lines.length;p<l;)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,l){for(var o=this.__lines.length-2;o>=0;){var s=this.__lines[o];if(s.is_empty())break;if(s.item(0).indexOf(p)!==0&&s.item(-1)!==l){this.__lines.splice(o+1,0,new A(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},r.exports.Output=f},function(r){function A(v,f,p,l){this.type=v,this.text=f,this.comments_before=null,this.newlines=p||0,this.whitespace_before=l||"",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 v="\\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",l="\\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",o="(?:\\\\u[0-9a-fA-F]{4}|["+v+p+"])",s="(?:\\\\u[0-9a-fA-F]{4}|["+f+p+l+"])*";A.identifier=new RegExp(o+s,"g"),A.identifierStart=new RegExp(o),A.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+f+p+l+"])+");var t=/[\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,v){var f=v(6).Options,p=["before-newline","after-newline","preserve-newline"];function l(o){f.call(this,o,"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 t=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var u=0;u<t.length;u++)t[u]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=t[u];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)}l.prototype=new f,r.exports.Options=l},function(r){function A(p,l){this.raw_options=v(p,l),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,l){var o=this.raw_options[p],s=l||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(s=o.concat()):typeof o=="string"&&(s=o.split(/[^a-zA-Z0-9_\/\-]+/)),s},A.prototype._get_boolean=function(p,l){var o=this.raw_options[p],s=o===void 0?!!l:!!o;return s},A.prototype._get_characters=function(p,l){var o=this.raw_options[p],s=l||"";return typeof o=="string"&&(s=o.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),s},A.prototype._get_number=function(p,l){var o=this.raw_options[p];l=parseInt(l,10),isNaN(l)&&(l=0);var s=parseInt(o,10);return isNaN(s)&&(s=l),s},A.prototype._get_selection=function(p,l,o){var s=this._get_selection_list(p,l,o);if(s.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
`+l+`
You passed in: '`+this.raw_options[p]+"'");return s[0]},A.prototype._get_selection_list=function(p,l,o){if(!l||l.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[l[0]],!this._is_valid_selection(o,l))throw new Error("Invalid Default Value!");var s=this._get_array(p,o);if(!this._is_valid_selection(s,l))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
`+l+`
You passed in: '`+this.raw_options[p]+"'");return s},A.prototype._is_valid_selection=function(p,l){return p.length&&l.length&&!p.some(function(o){return l.indexOf(o)===-1})};function v(p,l){var o={};p=f(p);var s;for(s in p)s!==l&&(o[s]=p[s]);if(l&&p[l])for(s in p[l])o[s]=p[l][s];return o}function f(p){var l={},o;for(o in p){var s=o.replace(/-/g,"_");l[s]=p[o]}return l}r.exports.Options=A,r.exports.normalizeOpts=f,r.exports.mergeOpts=v},function(r,A,v){var f=v(8).InputScanner,p=v(9).Tokenizer,l=v(9).TOKEN,o=v(13).Directives,s=v(4),t=v(12).Pattern,u=v(14).TemplatablePattern;function a(F,R){return R.indexOf(F)!==-1}var i={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:l.START,RAW:l.RAW,EOF:l.EOF},D=new o(/\/\*/,/\*\//),w=/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]/,L=/[^\d\.]/,P=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),_=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";_=_.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),_="\\?\\.(?!\\d) "+_,_=_.replace(/ /g,"|");var b=new RegExp(_),g="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),m=g.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),y=new RegExp("^(?:"+m.join("|")+")$"),x,O=function(F,R){p.call(this,F,R),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var U=new t(this._input),k=new u(this._input).read_options(this._options);this.__patterns={template:k,identifier:k.starting_with(s.identifier).matching(s.identifierMatch),number:U.matching(w),punct:U.matching(b),comment:U.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:U.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:U.matching(/<!--/),html_comment_end:U.matching(/-->/),include:U.starting_with(/#include/).until_after(s.lineBreak),shebang:U.starting_with(/#!/).until_after(s.lineBreak),xml:U.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(/[`}\\]/)}};O.prototype=new p,O.prototype._is_comment=function(F){return F.type===i.COMMENT||F.type===i.BLOCK_COMMENT||F.type===i.UNKNOWN},O.prototype._is_opening=function(F){return F.type===i.START_BLOCK||F.type===i.START_EXPR},O.prototype._is_closing=function(F,R){return(F.type===i.END_BLOCK||F.type===i.END_EXPR)&&R&&(F.text==="]"&&R.text==="["||F.text===")"&&R.text==="("||F.text==="}"&&R.text==="{")},O.prototype._reset=function(){x=!1},O.prototype._get_next_token=function(F,R){var U=null;this._readWhitespace();var k=this._input.peek();return k===null?this._create_token(i.EOF,""):(U=U||this._read_non_javascript(k),U=U||this._read_string(k),U=U||this._read_word(F),U=U||this._read_singles(k),U=U||this._read_comment(k),U=U||this._read_regexp(k,F),U=U||this._read_xml(k,F),U=U||this._read_punctuation(),U=U||this._create_token(i.UNKNOWN,this._input.next()),U)},O.prototype._read_word=function(F){var R;if(R=this.__patterns.identifier.read(),R!=="")return R=R.replace(s.allLineBreaks,`
`),!(F.type===i.DOT||F.type===i.RESERVED&&(F.text==="set"||F.text==="get"))&&y.test(R)?(R==="in"||R==="of")&&(F.type===i.WORD||F.type===i.STRING)?this._create_token(i.OPERATOR,R):this._create_token(i.RESERVED,R):this._create_token(i.WORD,R);if(R=this.__patterns.number.read(),R!=="")return this._create_token(i.WORD,R)},O.prototype._read_singles=function(F){var R=null;return F==="("||F==="["?R=this._create_token(i.START_EXPR,F):F===")"||F==="]"?R=this._create_token(i.END_EXPR,F):F==="{"?R=this._create_token(i.START_BLOCK,F):F==="}"?R=this._create_token(i.END_BLOCK,F):F===";"?R=this._create_token(i.SEMICOLON,F):F==="."&&L.test(this._input.peek(1))?R=this._create_token(i.DOT,F):F===","&&(R=this._create_token(i.COMMA,F)),R&&this._input.next(),R},O.prototype._read_punctuation=function(){var F=this.__patterns.punct.read();if(F!=="")return F==="="?this._create_token(i.EQUALS,F):F==="?."?this._create_token(i.DOT,F):this._create_token(i.OPERATOR,F)},O.prototype._read_non_javascript=function(F){var R="";if(F==="#"){if(this._is_first_token()&&(R=this.__patterns.shebang.read(),R))return this._create_token(i.UNKNOWN,R.trim()+`
`);if(R=this.__patterns.include.read(),R)return this._create_token(i.UNKNOWN,R.trim()+`
`);F=this._input.next();var U="#";if(this._input.hasNext()&&this._input.testChar(S)){do F=this._input.next(),U+=F;while(this._input.hasNext()&&F!=="#"&&F!=="=");return F==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(U+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(U+="{}",this._input.next(),this._input.next())),this._create_token(i.WORD,U)}this._input.back()}else if(F==="<"&&this._is_first_token()){if(R=this.__patterns.html_comment_start.read(),R){for(;this._input.hasNext()&&!this._input.testChar(s.newline);)R+=this._input.next();return x=!0,this._create_token(i.COMMENT,R)}}else if(x&&F==="-"&&(R=this.__patterns.html_comment_end.read(),R))return x=!1,this._create_token(i.COMMENT,R);return null},O.prototype._read_comment=function(F){var R=null;if(F==="/"){var U="";if(this._input.peek(1)==="*"){U=this.__patterns.block_comment.read();var k=D.get_directives(U);k&&k.ignore==="start"&&(U+=D.readIgnored(this._input)),U=U.replace(s.allLineBreaks,`
`),R=this._create_token(i.BLOCK_COMMENT,U),R.directives=k}else this._input.peek(1)==="/"&&(U=this.__patterns.comment.read(),R=this._create_token(i.COMMENT,U))}return R},O.prototype._read_string=function(F){if(F==="`"||F==="'"||F==='"'){var R=this._input.next();return this.has_char_escapes=!1,F==="`"?R+=this._read_string_recursive("`",!0,"${"):R+=this._read_string_recursive(F),this.has_char_escapes&&this._options.unescape_strings&&(R=H(R)),this._input.peek()===F&&(R+=this._input.next()),R=R.replace(s.allLineBreaks,`
`),this._create_token(i.STRING,R)}return null},O.prototype._allow_regexp_or_xml=function(F){return F.type===i.RESERVED&&a(F.text,["return","case","throw","else","do","typeof","yield"])||F.type===i.END_EXPR&&F.text===")"&&F.opened.previous.type===i.RESERVED&&a(F.opened.previous.text,["if","while","for"])||a(F.type,[i.COMMENT,i.START_EXPR,i.START_BLOCK,i.START,i.END_BLOCK,i.OPERATOR,i.EQUALS,i.EOF,i.SEMICOLON,i.COMMA])},O.prototype._read_regexp=function(F,R){if(F==="/"&&this._allow_regexp_or_xml(R)){for(var U=this._input.next(),k=!1,d=!1;this._input.hasNext()&&(k||d||this._input.peek()!==F)&&!this._input.testChar(s.newline);)U+=this._input.peek(),k?k=!1:(k=this._input.peek()==="\\",this._input.peek()==="["?d=!0:this._input.peek()==="]"&&(d=!1)),this._input.next();return this._input.peek()===F&&(U+=this._input.next(),U+=this._input.read(s.identifier)),this._create_token(i.STRING,U)}return null},O.prototype._read_xml=function(F,R){if(this._options.e4x&&F==="<"&&this._allow_regexp_or_xml(R)){var U="",k=this.__patterns.xml.read_match();if(k){for(var d=k[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),z=d.indexOf("{")===0,Y=0;k;){var re=!!k[1],le=k[2],Ne=!!k[k.length-1]||le.slice(0,8)==="![CDATA[";if(!Ne&&(le===d||z&&le.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(re?--Y:++Y),U+=k[0],Y<=0)break;k=this.__patterns.xml.read_match()}return k||(U+=this._input.match(/[\s\S]*/g)[0]),U=U.replace(s.allLineBreaks,`
`),this._create_token(i.STRING,U)}}return null};function H(F){for(var R="",U=0,k=new f(F),d=null;k.hasNext();)if(d=k.match(/([\s]|[^\\]|\\\\)+/g),d&&(R+=d[0]),k.peek()==="\\"){if(k.next(),k.peek()==="x")d=k.match(/x([0-9A-Fa-f]{2})/g);else if(k.peek()==="u")d=k.match(/u([0-9A-Fa-f]{4})/g);else{R+="\\",k.hasNext()&&(R+=k.next());continue}if(!d)return F;if(U=parseInt(d[1],16),U>126&&U<=255&&d[0].indexOf("x")===0)return F;if(U>=0&&U<32){R+="\\"+d[0];continue}else U===34||U===39||U===92?R+="\\"+String.fromCharCode(U):R+=String.fromCharCode(U)}return R}O.prototype._read_string_recursive=function(F,R,U){var k,d;F==="'"?d=this.__patterns.single_quote:F==='"'?d=this.__patterns.double_quote:F==="`"?d=this.__patterns.template_text:F==="}"&&(d=this.__patterns.template_expression);for(var z=d.read(),Y="";this._input.hasNext();){if(Y=this._input.next(),Y===F||!R&&s.newline.test(Y)){this._input.back();break}else Y==="\\"&&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(),Y+=this._input.next()):U&&(U==="${"&&Y==="$"&&this._input.peek()==="{"&&(Y+=this._input.next()),U===Y&&(F==="`"?Y+=this._read_string_recursive("}",R,"`"):Y+=this._read_string_recursive("`",R,"${"),this._input.hasNext()&&(Y+=this._input.next())));Y+=d.read(),z+=Y}return z},r.exports.Tokenizer=O,r.exports.TOKEN=i,r.exports.positionable_operators=P.slice(),r.exports.line_starters=g.slice()},function(r){var A=RegExp.prototype.hasOwnProperty("sticky");function v(f){this.__input=f||"",this.__input_length=this.__input.length,this.__position=0}v.prototype.restart=function(){this.__position=0},v.prototype.back=function(){this.__position>0&&(this.__position-=1)},v.prototype.hasNext=function(){return this.__position<this.__input_length},v.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__input.charAt(this.__position),this.__position+=1),f},v.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},v.prototype.__match=function(f,p){f.lastIndex=p;var l=f.exec(this.__input);return l&&!(A&&f.sticky)&&(l.index!==p&&(l=null)),l},v.prototype.test=function(f,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(f,p):!1},v.prototype.testChar=function(f,p){var l=this.peek(p);return f.lastIndex=0,l!==null&&f.test(l)},v.prototype.match=function(f){var p=this.__match(f,this.__position);return p?this.__position+=p[0].length:p=null,p},v.prototype.read=function(f,p,l){var o="",s;return f&&(s=this.match(f),s&&(o+=s[0])),p&&(s||!f)&&(o+=this.readUntil(p,l)),o},v.prototype.readUntil=function(f,p){var l="",o=this.__position;f.lastIndex=this.__position;var s=f.exec(this.__input);return s?(o=s.index,p&&(o+=s[0].length)):o=this.__input_length,l=this.__input.substring(this.__position,o),this.__position=o,l},v.prototype.readUntilAfter=function(f){return this.readUntil(f,!0)},v.prototype.get_regexp=function(f,p){var l=null,o="g";return p&&A&&(o="y"),typeof f=="string"&&f!==""?l=new RegExp(f,o):f&&(l=new RegExp(f.source,o)),l},v.prototype.get_literal_regexp=function(f){return RegExp(f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},v.prototype.peekUntilAfter=function(f){var p=this.__position,l=this.readUntilAfter(f);return this.__position=p,l},v.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=v},function(r,A,v){var f=v(8).InputScanner,p=v(3).Token,l=v(10).TokenStream,o=v(11).WhitespacePattern,s={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},t=function(u,a){this._input=new f(u),this._options=a||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};t.prototype.tokenize=function(){this._input.restart(),this.__tokens=new l,this._reset();for(var u,a=new p(s.START,""),i=null,D=[],w=new l;a.type!==s.EOF;){for(u=this._get_next_token(a,i);this._is_comment(u);)w.add(u),u=this._get_next_token(a,i);w.isEmpty()||(u.comments_before=w,w=new l),u.parent=i,this._is_opening(u)?(D.push(i),i=u):i&&this._is_closing(u,i)&&(u.opened=i,i.closed=u,i=D.pop(),u.parent=i),u.previous=a,a.next=u,this.__tokens.add(u),a=u}return this.__tokens},t.prototype._is_first_token=function(){return this.__tokens.isEmpty()},t.prototype._reset=function(){},t.prototype._get_next_token=function(u,a){this._readWhitespace();var i=this._input.read(/.+/g);return i?this._create_token(s.RAW,i):this._create_token(s.EOF,"")},t.prototype._is_comment=function(u){return!1},t.prototype._is_opening=function(u){return!1},t.prototype._is_closing=function(u,a){return!1},t.prototype._create_token=function(u,a){var i=new p(u,a,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return i},t.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},r.exports.Tokenizer=t,r.exports.TOKEN=s},function(r){function A(v){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=v}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 v=null;return this.hasNext()&&(v=this.__tokens[this.__position],this.__position+=1),v},A.prototype.peek=function(v){var f=null;return v=v||0,v+=this.__position,v>=0&&v<this.__tokens_length&&(f=this.__tokens[v]),f},A.prototype.add=function(v){this.__parent_token&&(v.parent=this.__parent_token),this.__tokens.push(v),this.__tokens_length+=1},r.exports.TokenStream=A},function(r,A,v){var f=v(12).Pattern;function p(l,o){f.call(this,l,o),o?this._line_regexp=this._input.get_regexp(o._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}p.prototype=new f,p.prototype.__set_whitespace_patterns=function(l,o){l+="\\t ",o+="\\n\\r",this._match_pattern=this._input.get_regexp("["+l+o+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+o+"]")},p.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var l=this._input.read(this._match_pattern);if(l===" ")this.whitespace_before_token=" ";else if(l){var o=this.__split(this._newline_regexp,l);this.newline_count=o.length-1,this.whitespace_before_token=o[this.newline_count]}return l},p.prototype.matching=function(l,o){var s=this._create();return s.__set_whitespace_patterns(l,o),s._update(),s},p.prototype._create=function(){return new p(this._input,this)},p.prototype.__split=function(l,o){l.lastIndex=0;for(var s=0,t=[],u=l.exec(o);u;)t.push(o.substring(s,u.index)),s=u.index+u[0].length,u=l.exec(o);return s<o.length?t.push(o.substring(s,o.length)):t.push(""),t},r.exports.WhitespacePattern=p},function(r){function A(v,f){this._input=v,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 v=this._input.read(this._starting_pattern);return(!this._starting_pattern||v)&&(v+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),v},A.prototype.read_match=function(){return this._input.match(this._match_pattern)},A.prototype.until_after=function(v){var f=this._create();return f._until_after=!0,f._until_pattern=this._input.get_regexp(v),f._update(),f},A.prototype.until=function(v){var f=this._create();return f._until_after=!1,f._until_pattern=this._input.get_regexp(v),f._update(),f},A.prototype.starting_with=function(v){var f=this._create();return f._starting_pattern=this._input.get_regexp(v,!0),f._update(),f},A.prototype.matching=function(v){var f=this._create();return f._match_pattern=this._input.get_regexp(v,!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(v,f){v=typeof v=="string"?v:v.source,f=typeof f=="string"?f:f.source,this.__directives_block_pattern=new RegExp(v+/ beautify( \w+[:]\w+)+ /.source+f,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(v+/\sbeautify\signore:end\s/.source+f,"g")}A.prototype.get_directives=function(v){if(!v.match(this.__directives_block_pattern))return null;var f={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(v);p;)f[p[1]]=p[2],p=this.__directive_pattern.exec(v);return f},A.prototype.readIgnored=function(v){return v.readUntilAfter(this.__directives_end_ignore_pattern)},r.exports.Directives=A},function(r,A,v){var f=v(12).Pattern,p={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function l(o,s){f.call(this,o,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 t=new f(o);this.__patterns={handlebars_comment:t.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:t.starting_with(/{{{/).until_after(/}}}/),handlebars:t.starting_with(/{{/).until_after(/}}/),php:t.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:t.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:t.starting_with(/{%/).until_after(/%}/),django_value:t.starting_with(/{{/).until_after(/}}/),django_comment:t.starting_with(/{#/).until_after(/#}/),smarty:t.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:t.starting_with(/{\*/).until_after(/\*}/),smarty_literal:t.starting_with(/{literal}/).until_after(/{\/literal}/)}}l.prototype=new f,l.prototype._create=function(){return new l(this._input,this)},l.prototype._update=function(){this.__set_templated_pattern()},l.prototype.disable=function(o){var s=this._create();return s._disabled[o]=!0,s._update(),s},l.prototype.read_options=function(o){var s=this._create();for(var t in p)s._disabled[t]=o.templating.indexOf(t)===-1;return s._update(),s},l.prototype.exclude=function(o){var s=this._create();return s._excluded[o]=!0,s._update(),s},l.prototype.read=function(){var o="";this._match_pattern?o=this._input.read(this._starting_pattern):o=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),o+=s,s=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},l.prototype.__set_templated_pattern=function(){var o=[];this._disabled.php||o.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||o.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||o.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(o.push(this.__patterns.django._starting_pattern.source),o.push(this.__patterns.django_value._starting_pattern.source),o.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||o.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&o.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+o.join("|")+")")},l.prototype._read_template=function(){var o="",s=this._input.peek();if(s==="<"){var t=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&t==="?"&&(o=o||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&t==="%"&&(o=o||this.__patterns.erb.read())}else s==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(o=o||this.__patterns.handlebars_comment.read(),o=o||this.__patterns.handlebars_unescaped.read(),o=o||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(o=o||this.__patterns.django_value.read()),this._excluded.django||(o=o||this.__patterns.django_comment.read(),o=o||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(o=o||this.__patterns.smarty_comment.read(),o=o||this.__patterns.smarty_literal.read(),o=o||this.__patterns.smarty.read()));return o},r.exports.TemplatablePattern=l}],I={};function W(r){var A=I[r];if(A!==void 0)return A.exports;var v=I[r]={exports:{}};return M[r](v,v.exports,W),v.exports}var C=W(0);j=C})();var G=j;!(Z=[],V=function(){return{js_beautify:G}}.apply(ve,Z),V!==void 0&&(Bt.exports=V))})()},"6eGT":function(Bt,ve,T){"use strict";function Z(V){return null}ve.a=Z},"6fgh":function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return M}),T.d(ve,"b",function(){return I});var Z=T("wd/R"),V=T.n(Z),j=T("LvDl"),G=T.n(j),M=function(C){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"YYYY-MM-DD",A=Object(j.cloneDeepWith)(C,function(v){if(v instanceof V.a)return v.format(r)});return A},I=function W(C,r,A){var v=function(s){return Reflect.toString.call(s)==="[object Object]"};if(!v(C)&&!Array.isArray(C))return C;for(var f=0,p=Object.keys(C);f<p.length;f++){var l=p[f];Array.isArray(C[l])?C[l]=C[l].map(function(o){return W(o,r,A)}):v(C[l])?C[l]=W(C[l],r,A):r.includes(l)&&typeof C[l]=="string"&&(C[l]=A?V()(C[l],A):V()(C[l]))}return C}},"746U":function(Bt,ve,T){"use strict";T.d(ve,"f",function(){return Z}),T.d(ve,"l",function(){return V}),T.d(ve,"k",function(){return j}),T.d(ve,"j",function(){return G}),T.d(ve,"g",function(){return M}),T.d(ve,"m",function(){return I}),T.d(ve,"h",function(){return W}),T.d(ve,"n",function(){return C}),T.d(ve,"c",function(){return r}),T.d(ve,"a",function(){return A}),T.d(ve,"i",function(){return v}),T.d(ve,"o",function(){return f}),T.d(ve,"e",function(){return o}),T.d(ve,"d",function(){return s}),T.d(ve,"p",function(){return t}),T.d(ve,"b",function(){return u});function Z(a){return Array.isArray(a)}function V(a){return typeof a=="string"}function j(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)&&!(a instanceof RegExp)&&!(a instanceof Date)}function G(a){return typeof a=="number"&&!isNaN(a)}function M(a){return a===!0||a===!1}function I(a){return typeof a=="undefined"}function W(a){return!C(a)}function C(a){return I(a)||a===null}function r(a,i){if(!a)throw new Error(i?`Unexpected type, expected '${i}'`:"Unexpected type")}function A(a){if(C(a))throw new Error("Assertion Failed: argument is undefined or null");return a}function v(a){return typeof a=="function"}function f(a,i){const D=Math.min(a.length,i.length);for(let w=0;w<D;w++)p(a[w],i[w])}function p(a,i){if(V(i)){if(typeof a!==i)throw new Error(`argument does not match constraint: typeof ${i}`)}else if(v(i)){try{if(a instanceof i)return}catch(D){}if(!C(a)&&a.constructor===i)return;if(i.length===1&&i.call(void 0,a)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function l(a){let i=[],D=Object.getPrototypeOf(a);for(;Object.prototype!==D;)i=i.concat(Object.getOwnPropertyNames(D)),D=Object.getPrototypeOf(D);return i}function o(a){const i=[];for(const D of l(a))typeof a[D]=="function"&&i.push(D);return i}function s(a,i){const D=S=>function(){const L=Array.prototype.slice.call(arguments,0);return i(S,L)};let w={};for(const S of a)w[S]=D(S);return w}function t(a){return a===null?void 0:a}function u(a,i="Unreachable"){throw new Error(i)}},"7Cbv":function(Bt,ve,T){"use strict";var Z=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),V=new Uint8Array(16);function j(){if(!Z)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Z(V)}var G=/^(?:[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 M(p){return typeof p=="string"&&G.test(p)}for(var I=M,W=[],C=0;C<256;++C)W.push((C+256).toString(16).substr(1));function r(p){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=(W[p[l+0]]+W[p[l+1]]+W[p[l+2]]+W[p[l+3]]+"-"+W[p[l+4]]+W[p[l+5]]+"-"+W[p[l+6]]+W[p[l+7]]+"-"+W[p[l+8]]+W[p[l+9]]+"-"+W[p[l+10]]+W[p[l+11]]+W[p[l+12]]+W[p[l+13]]+W[p[l+14]]+W[p[l+15]]).toLowerCase();if(!I(o))throw TypeError("Stringified UUID is invalid");return o}var A=r;function v(p,l,o){p=p||{};var s=p.random||(p.rng||j)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,l){o=o||0;for(var t=0;t<16;++t)l[o+t]=s[t];return l}return A(s)}var f=ve.a=v},"7ahc":function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return D});var Z=T("k1fw"),V=T("0Owb"),j=T("+L6B"),G=T("2/Rp"),M=T("y8nQ"),I=T("Vl3Y"),W=T("tJVT"),C=T("OaEy"),r=T("2fM7"),A=T("q1tI"),v=T.n(A),f=T("VrN/"),p=T.n(f),l=T("p77/"),o=T.n(l),s=T("c5Ni"),t=T.n(s),u=r.a.Option,a={labelCol:{span:4},wrapperCol:{span:20}},i={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"]};ve.b=function(w){var S=w.callback,L=w.onCancel,P=Object(A.useState)("python"),_=Object(W.a)(P,2),b=_[0],g=_[1];function m(x){g(i[x][1])}function y(x){S(x)}return v.a.createElement(I.a,Object(V.a)({},a,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:y}),v.a.createElement(I.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},v.a.createElement(r.a,{onChange:m},Object.keys(i).map(function(x){return v.a.createElement(u,{key:x,value:x},i[x][0])}))),v.a.createElement(I.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},v.a.createElement(D,{mode:b})),v.a.createElement("div",{className:"flex-container flex-end"},v.a.createElement(G.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(G.a,{type:"ghost",onClick:L},"\u53D6\u6D88")))};function D(w){var S=w.value,L=w.onChange,P=w.mode,_=w.options,b=_===void 0?{}:_,g=Object(A.useRef)(),m=Object(A.useState)(),y=Object(W.a)(m,2),x=y[0],O=y[1];return Object(A.useEffect)(function(){if(x){function H(F){var R=F.getValue();L&&L(R)}return x.on("change",H),function(){x.off("change",H)}}},[x,L]),Object(A.useEffect)(function(){x&&x.setOption("mode",P)},[x,P]),Object(A.useEffect)(function(){x&&((S!==x.getValue()||S==="")&&setTimeout(function(){x.setValue(S||" ")},300))},[x,S]),Object(A.useEffect)(function(){if(g.current&&!x){var H=p.a.fromTextArea(g.current,Object(Z.a)({mode:P,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},b));O(H)}},[g.current,x]),v.a.createElement("div",{className:"my-codemirror-container"},v.a.createElement("textarea",{ref:g}))}},"7ixt":function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return j});var Z={adjustX:1,adjustY:1},V=[0,0],j={left:{points:["cr","cl"],overflow:Z,offset:[-4,0],targetOffset:V},right:{points:["cl","cr"],overflow:Z,offset:[4,0],targetOffset:V},top:{points:["bc","tc"],overflow:Z,offset:[0,-4],targetOffset:V},bottom:{points:["tc","bc"],overflow:Z,offset:[0,4],targetOffset:V},topLeft:{points:["bl","tl"],overflow:Z,offset:[0,-4],targetOffset:V},leftTop:{points:["tr","tl"],overflow:Z,offset:[-4,0],targetOffset:V},topRight:{points:["br","tr"],overflow:Z,offset:[0,-4],targetOffset:V},rightTop:{points:["tl","tr"],overflow:Z,offset:[4,0],targetOffset:V},bottomRight:{points:["tr","br"],overflow:Z,offset:[0,4],targetOffset:V},rightBottom:{points:["bl","br"],overflow:Z,offset:[4,0],targetOffset:V},bottomLeft:{points:["tl","bl"],overflow:Z,offset:[0,4],targetOffset:V},leftBottom:{points:["br","bl"],overflow:Z,offset:[-4,0],targetOffset:V}},G=j},"815F":function(Bt,ve,T){"use strict";T.d(ve,"e",function(){return W}),T.d(ve,"c",function(){return r}),T.d(ve,"d",function(){return A}),T.d(ve,"a",function(){return f}),T.d(ve,"f",function(){return p}),T.d(ve,"b",function(){return l});var Z=T("KQm4"),V=T("VTBJ"),j=T("Ff2n"),G=T("Zm9Q"),M=T("Kwbf"),I=T("OZM5");function W(o,s){return o!=null?o:s}function C(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],s=new Map;function t(u){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(u||[]).forEach(function(i){var D=i.key,w=i.children;Object(M.a)(D!=null,"Tree node must have a certain key: [".concat(a).concat(D,"]"));var S=String(D);Object(M.a)(!s.has(S)||D===null||D===void 0,"Same 'key' exist in the Tree: ".concat(S)),s.set(S,!0),t(w,"".concat(a).concat(S," > "))})}t(o)}function r(o){function s(t){var u=Object(G.a)(t);return u.map(function(a){if(!Object(I.i)(a))return Object(M.a)(!a,"Tree/TreeNode can only accept TreeNode as children."),null;var i=a.key,D=a.props,w=D.children,S=Object(j.a)(D,["children"]),L=Object(V.a)({key:i},S),P=s(w);return P.length&&(L.children=P),L}).filter(function(a){return a})}return s(o)}function A(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=new Set(s===!0?[]:s),u=[];function a(i){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return i.map(function(w,S){var L=Object(I.h)(D?D.pos:"0",S),P=W(w.key,L),_=Object(V.a)(Object(V.a)({},w),{},{parent:D,pos:L,children:null,data:w,isStart:[].concat(Object(Z.a)(D?D.isStart:[]),[S===0]),isEnd:[].concat(Object(Z.a)(D?D.isEnd:[]),[S===i.length-1])});return u.push(_),s===!0||t.has(P)?_.children=a(w.children||[],_):_.children=[],_})}return a(o),u}function v(o,s,t){var u;t?typeof t=="string"?u=function(D){return D[t]}:typeof t=="function"&&(u=function(D){return t(D)}):u=function(D,w){return W(D.key,w)};function a(i,D,w){var S=i?i.children:o,L=i?Object(I.h)(w.pos,D):"0";if(i){var P=u(i,L),_={node:i,index:D,pos:L,key:P,parentPos:w.node?w.pos:null,level:w.level+1};s(_)}S&&S.forEach(function(b,g){a(b,g,{node:i,pos:L,level:w?w.level+1:-1})})}a(null)}function f(o){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=s.initWrapper,u=s.processEntity,a=s.onProcessFinished,i=arguments.length>2?arguments[2]:void 0,D={},w={},S={posEntities:D,keyEntities:w};return t&&(S=t(S)||S),v(o,function(L){var P=L.node,_=L.index,b=L.pos,g=L.key,m=L.parentPos,y=L.level,x={node:P,index:_,key:g,pos:b,level:y},O=W(g,b);D[b]=x,w[O]=x,x.parent=D[m],x.parent&&(x.parent.children=x.parent.children||[],x.parent.children.push(x)),u&&u(x,S)},i),a&&a(S),S}function p(o,s){var t=s.expandedKeys,u=s.selectedKeys,a=s.loadedKeys,i=s.loadingKeys,D=s.checkedKeys,w=s.halfCheckedKeys,S=s.dragOverNodeKey,L=s.dropPosition,P=s.keyEntities,_=P[o],b={eventKey:o,expanded:t.indexOf(o)!==-1,selected:u.indexOf(o)!==-1,loaded:a.indexOf(o)!==-1,loading:i.indexOf(o)!==-1,checked:D.indexOf(o)!==-1,halfChecked:w.indexOf(o)!==-1,pos:String(_?_.pos:""),dragOver:S===o&&L===0,dragOverGapTop:S===o&&L===-1,dragOverGapBottom:S===o&&L===1};return b}function l(o){var s=o.data,t=o.expanded,u=o.selected,a=o.checked,i=o.loaded,D=o.loading,w=o.halfChecked,S=o.dragOver,L=o.dragOverGapTop,P=o.dragOverGapBottom,_=o.pos,b=o.active,g=Object(V.a)(Object(V.a)({},s),{},{expanded:t,selected:u,checked:a,loaded:i,loading:D,halfChecked:w,dragOver:S,dragOverGapTop:L,dragOverGapBottom:P,pos:_,active:b});return"props"in g||Object.defineProperty(g,"props",{get:function(){return Object(M.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),o}}),g}},"8EBN":function(Bt,ve,T){(function(Z){Z(T("VrN/"))})(function(Z){"use strict";Z.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var V=0;V<Z.modeInfo.length;V++){var j=Z.modeInfo[V];j.mimes&&(j.mime=j.mimes[0])}Z.findModeByMIME=function(G){G=G.toLowerCase();for(var M=0;M<Z.modeInfo.length;M++){var I=Z.modeInfo[M];if(I.mime==G)return I;if(I.mimes){for(var W=0;W<I.mimes.length;W++)if(I.mimes[W]==G)return I}}if(/\+xml$/.test(G))return Z.findModeByMIME("application/xml");if(/\+json$/.test(G))return Z.findModeByMIME("application/json")},Z.findModeByExtension=function(G){G=G.toLowerCase();for(var M=0;M<Z.modeInfo.length;M++){var I=Z.modeInfo[M];if(I.ext){for(var W=0;W<I.ext.length;W++)if(I.ext[W]==G)return I}}},Z.findModeByFileName=function(G){for(var M=0;M<Z.modeInfo.length;M++){var I=Z.modeInfo[M];if(I.file&&I.file.test(G))return I}var W=G.lastIndexOf("."),C=W>-1&&G.substring(W+1,G.length);if(C)return Z.findModeByExtension(C)},Z.findModeByName=function(G){G=G.toLowerCase();for(var M=0;M<Z.modeInfo.length;M++){var I=Z.modeInfo[M];if(I.name.toLowerCase()==G)return I;if(I.alias){for(var W=0;W<I.alias.length;W++)if(I.alias[W].toLowerCase()==G)return I}}}})},"8GSA":function(Bt,ve,T){"use strict";var Z=T("+L6B"),V=T("2/Rp"),j=T("0Owb"),G=T("miYZ"),M=T("tsqr"),I=T("2qtc"),W=T("kLXV"),C=T("9og8"),r=T("tJVT"),A=T("WmNS"),v=T.n(A),f=T("q1tI"),p=T.n(f),l=T("xOOu"),o=T.n(l),s=T("m3rI"),t=function(a,i){var D=a.files,w=D===void 0?[]:D,S=a.name,L=a.buttonProps,P=L===void 0?{}:L,_=a.hide,b=a.onOk,g=b===void 0?function(){}:b,m=Object(f.useState)(!1),y=Object(r.a)(m,2),x=y[0],O=y[1],H=Object(f.useRef)(new o.a);Object(f.useImperativeHandle)(i,function(){return{exportReport:F}});var F=function(){var z=Object(C.a)(v.a.mark(function Y(re){var le,Ne,Ce,Te,Fe,Ve,xe;return v.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:xe=function(){return xe=Object(C.a)(v.a.mark(function _e(){var He;return v.a.wrap(function(ae){for(;;)switch(ae.prev=ae.next){case 0:U({},"".concat(s.a.API_SERVER,"/api/attachments/").concat(le==null||((He=le[Ce])===null||He===void 0)?void 0:He.id),function(){var $=Object(C.a)(v.a.mark(function Q(te,he){var ge,we,ft,Pt,jt;return v.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:if(!(((ge=te.target.response)===null||ge===void 0?void 0:ge.type)==="application/json")){Mt.next=8;break}return Mt.next=3,R(te.target.response);case 3:if(ft=Mt.sent,!ft.message){Mt.next=8;break}return M.b.warn((ft==null?void 0:ft.message)||"\u4E0B\u8F7D\u51FA\u9519, \u8BF7\u8054\u7CFB\u7BA1\u7406\u5458"),O(!1),Mt.abrupt("return");case 8:Pt=new Blob([te.target.response],{type:"application/vnd.ms-excel;charset=utf-8"}),Te=Te+Pt.size,jt=le==null||((we=le[Ce])===null||we===void 0)?void 0:we.filename,setTimeout(Object(C.a)(v.a.mark(function sn(){return v.a.wrap(function(Qe){for(;;)switch(Qe.prev=Qe.next){case 0:H.current.file(jt,Pt),Ne.update({content:p.a.createElement("div",null,"\u5F53\u524D\u8FDB\u5EA6: ",p.a.createElement("span",{className:"c-blue"},Ce+1),"/",le==null?void 0:le.length,Fe>0?p.a.createElement("span",null,"(\u5DF2\u62C6\u5206",Fe,"\u4E2Azip\u5305)"):"")}),Ce===(le==null?void 0:le.length)-1?d(Ne,Fe>0?Fe+1:0):Te>900*1024*1024?(Fe++,Te=0,k(Fe,function(){Ce++,Ve()})):(Ce++,Ve());case 3:case"end":return Qe.stop()}},sn)})),2600);case 12:case"end":return Mt.stop()}},Q)}));return function(Q,te){return $.apply(this,arguments)}}());case 1:case"end":return ae.stop()}},_e)})),xe.apply(this,arguments)},Ve=function(){return xe.apply(this,arguments)},le=re||w,O(!0),Ce=0,Te=0,Fe=0,Ne=W.a.info({width:460,title:p.a.createElement("div",null,"\u6B63\u5728\u5BFC\u51FA\u9644\u4EF6,",p.a.createElement("span",{className:"c-red"},"\u8BF7\u52FF\u5173\u95ED\u6216\u64CD\u4F5C\u5F53\u524D\u6D4F\u89C8\u5668\u7A97\u53E3")),content:p.a.createElement("div",null,"\u5F53\u524D\u8FDB\u5EA6: ",p.a.createElement("span",{className:"c-blue"},Ce+1),"/",le==null?void 0:le.length),maskClosable:!1,okText:"\u6211\u77E5\u9053\u4E86",onOk:function(){}}),Ve();case 9:case"end":return oe.stop()}},Y)}));return function(re){return z.apply(this,arguments)}}();function R(z){return new Promise(function(Y){var re=new FileReader;re.readAsText(z,"utf-8"),re.addEventListener("loadend",function(){var le=JSON.parse(re.result);Y(le)})})}var U=function(Y,re,le,Ne){var Ce=re,Te=new window.XMLHttpRequest;return Te.withCredentials=!0,Te.addEventListener("load",function(Fe){le(Fe,Te)},!1),Te.addEventListener("error",function(Fe){Ne&&Ne(Fe)},!1),Te.responseType="blob",Te.open("GET",Ce),Te.send(null),Te},k=function(Y,re){H.current.generateAsync({type:"blob"}).then(function(le){var Ne=document.createElement("a");Ne.href=window.URL.createObjectURL(le),Ne.download=S+"-".concat(Y)+".zip",document.body.appendChild(Ne);var Ce=document.createEvent("MouseEvents");Ce.initEvent("click",!1,!1),Ne.dispatchEvent(Ce),document.body.removeChild(Ne),H.current=new o.a,re()})},d=function(Y,re){H.current.generateAsync({type:"blob"}).then(function(le){var Ne=document.createElement("a");Ne.href=window.URL.createObjectURL(le),re>0?Ne.download=S+"-".concat(re)+".zip":Ne.download=S+".zip",document.body.appendChild(Ne);var Ce=document.createEvent("MouseEvents");Ce.initEvent("click",!1,!1),Ne.dispatchEvent(Ce),document.body.removeChild(Ne),Y.destroy(),O(!1),g(),H.current=new o.a})};return _?p.a.createElement(p.a.Fragment,null):p.a.createElement(V.a,Object(j.a)({},P,{onClick:function(){return F()},loading:x}),"\u4E0B\u8F7D")};ve.a=Object(f.forwardRef)(t)},"8HAY":function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return M}),T.d(ve,"b",function(){return I}),T.d(ve,"d",function(){return W}),T.d(ve,"e",function(){return C}),T.d(ve,"c",function(){return r});var Z=T("MI8n"),V=T("pmY6"),j=T("3/fG"),G=function(A,v,f,p){function l(o){return o instanceof f?o:new f(function(s){s(o)})}return new(f||(f=Promise))(function(o,s){function t(i){try{a(p.next(i))}catch(D){s(D)}}function u(i){try{a(p.throw(i))}catch(D){s(D)}}function a(i){i.done?o(i.value):l(i.value).then(t,u)}a((p=p.apply(A,v||[])).next())})};class M extends V.a{constructor(A,v="",f="",p=!0,l){super();this._onDidChange=this._register(new Z.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=A,this._label=v,this._cssClass=f,this._enabled=p,this._actionCallback=l}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,v){return G(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(A))})}}class I extends V.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new Z.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new Z.b),this.onDidRun=this._onDidRun.event}run(A,v){return G(this,void 0,void 0,function*(){if(!A.enabled)return;this._onBeforeRun.fire({action:A});let f;try{yield this.runAction(A,v)}catch(p){f=p}this._onDidRun.fire({action:A,error:f})})}runAction(A,v){return G(this,void 0,void 0,function*(){yield A.run(v)})}}class W extends M{constructor(A){super(W.ID,A,A?"separator text":"separator");this.checked=!1,this.enabled=!1}}W.ID="vs.actions.separator";class C{constructor(A,v,f,p){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=A,this.label=v,this.class=p,this._actions=f}get actions(){return this._actions}dispose(){}run(){return G(this,void 0,void 0,function*(){})}}class r extends M{constructor(){super(r.ID,j.a("submenu.empty","(empty)"),void 0,!1)}}r.ID="vs.actions.empty"},"8hTe":function(Bt,ve,T){Bt.exports={button:"button___1wy9m"}},"9Bee":function(Bt,ve,T){"use strict";var Z=T("DYRE"),V=T("zeV3"),j=T("+L6B"),G=T("2/Rp"),M=T("k1fw"),I=T("9og8"),W=T("tJVT"),C=T("WmNS"),r=T.n(C),A=T("q1tI"),v=T.n(A),f=T("vg9a"),p=T("DlQD"),l=T.n(p),o=T("rUJ1");function s(ee,N){var B=ee.match(/^(\s+)(?:```)/);if(B===null)return N;var X=B[1];return N.split(`
`).map(function(ue){var q=ue.match(/^\s+/);if(q===null)return ue;var Ze=Object(W.a)(q,1),Jt=Ze[0];return Jt.length>=X.length?ue.slice(X.length):ue}).join(`
`)}var t=[],u=["<ul>"],a=new l.a.Renderer,i=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function D(){t.length=0,u=["<ul>"]}var w={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function S(ee,N,B,X){if(N>=ee.length||ee[N].level<=B)return N;var ue=ee[N];X.push("<li><a href='#"+ue.anchor+"'>"+ue.text+"</a>"),N++;var q=[];return N=S(ee,N,ue.level,q),q.length>0&&(X.push("<ul>"),q.forEach(function(Ze){X.push(Ze)}),X.push("</ul>")),X.push("</li>"),N=S(ee,N,B,X),N}function L(){return S(t,0,0,u),u.push("</ul>"),u.join("")}var P={heading:function(N){var B=i.exec(N);if(B)return{type:"heading",raw:B[0],depth:B[1].length,text:B[2]}},fences:function(N){var B=this.rules.block.fences.exec(N);if(B){var X=B[0],ue=s(X,B[3]||""),q=B[2]?B[2].trim():B[2];if(["latex","katex","math"].indexOf(q)>=0){var Ze=g(),Jt=ue;ue=Ze,m[Ze]={type:"block",expression:Jt}}return{type:"code",raw:X,lang:q,text:ue}}}},_=/(?:\${2})([^\n`]+?)(?:\${2})/gi,b=0,g=function(){return"__special_katext_id_".concat(b++,"__")},m={};function y(){return m}function x(){b=0,m={}}function O(ee){return ee=ee.replace(_,function(N,B){var X=g();return m[X]={type:"inline",expression:B},X}),ee}var H=a.listitem;a.listitem=function(ee){return H(O(ee))};var F=a.paragraph;a.paragraph=function(ee){return F(O(ee))};var R=a.tablecell;a.tablecell=function(ee,N){return R(O(ee),N)},a.code=function(ee,N,B){var X=(N||"").match(/\S*/)[0];return X?["latex","katex","math"].indexOf(X)>=0?"<p class='editormd-tex'>".concat(ee,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(N,'">').concat(B?ee:Object(o.escape)(ee,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(B?ee:Object(o.escape)(ee,!0))+"</code></pre>"},a.heading=function(ee,N,B){var X=this.options.headerPrefix+B.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return t.push({anchor:X,level:N,text:ee}),"<h"+N+' id="'+X+'">'+ee+"</h"+N+">"},l.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),l.a.use({tokenizer:P,renderer:a});var U=l.a,k=T("SJMd"),d=T("ulZh"),z=T.n(d),Y=T("m3rI"),re=T("Oy/b"),le=T("p5ED"),Ne=T("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Ce=function(ee,N){return(Ce=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(B,X){B.__proto__=X}||function(B,X){for(var ue in X)Object.prototype.hasOwnProperty.call(X,ue)&&(B[ue]=X[ue])})(ee,N)};function Te(ee,N){function B(){this.constructor=ee}Ce(ee,N),ee.prototype=N===null?Object.create(N):(B.prototype=N.prototype,new B)}function Fe(ee,N,B,X){return new(B||(B=Promise))(function(ue,q){function Ze(Xn){try{On(X.next(Xn))}catch(un){q(un)}}function Jt(Xn){try{On(X.throw(Xn))}catch(un){q(un)}}function On(Xn){var un;Xn.done?ue(Xn.value):(un=Xn.value,un instanceof B?un:new B(function(nr){nr(un)})).then(Ze,Jt)}On((X=X.apply(ee,N||[])).next())})}function Ve(ee,N){var B,X,ue,q,Ze={label:0,sent:function(){if(1&ue[0])throw ue[1];return ue[1]},trys:[],ops:[]};return q={next:Jt(0),throw:Jt(1),return:Jt(2)},typeof Symbol=="function"&&(q[Symbol.iterator]=function(){return this}),q;function Jt(On){return function(Xn){return function(un){if(B)throw new TypeError("Generator is already executing.");for(;Ze;)try{if(B=1,X&&(ue=2&un[0]?X.return:un[0]?X.throw||((ue=X.return)&&ue.call(X),0):X.next)&&!(ue=ue.call(X,un[1])).done)return ue;switch(X=0,ue&&(un=[2&un[0],ue.value]),un[0]){case 0:case 1:ue=un;break;case 4:return Ze.label++,{value:un[1],done:!1};case 5:Ze.label++,X=un[1],un=[0];continue;case 7:un=Ze.ops.pop(),Ze.trys.pop();continue;default:if(!(ue=Ze.trys,(ue=ue.length>0&&ue[ue.length-1])||un[0]!==6&&un[0]!==2)){Ze=0;continue}if(un[0]===3&&(!ue||un[1]>ue[0]&&un[1]<ue[3])){Ze.label=un[1];break}if(un[0]===6&&Ze.label<ue[1]){Ze.label=ue[1],ue=un;break}if(ue&&Ze.label<ue[2]){Ze.label=ue[2],Ze.ops.push(un);break}ue[2]&&Ze.ops.pop(),Ze.trys.pop();continue}un=N.call(ee,Ze)}catch(nr){un=[6,nr],X=0}finally{B=ue=0}if(5&un[0])throw un[1];return{value:un[0]?un[1]:void 0,done:!0}}([On,Xn])}}}function xe(){for(var ee=0,N=0,B=arguments.length;N<B;N++)ee+=arguments[N].length;var X=Array(ee),ue=0;for(N=0;N<B;N++)for(var q=arguments[N],Ze=0,Jt=q.length;Ze<Jt;Ze++,ue++)X[ue]=q[Ze];return X}var ye=function(){function ee(){}return ee.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ee.setAttributes=function(N,B){for(var X=0,ue=B;X<ue.length;X++){var q=ue[X],Ze=q[0],Jt=q[1];N.setAttribute(Ze,Jt)}},ee.createRect=function(N,B,X){var ue=document.createElementNS("http://www.w3.org/2000/svg","rect");return ue.setAttribute("width",N.toString()),ue.setAttribute("height",B.toString()),X&&ee.setAttributes(ue,X),ue},ee.createLine=function(N,B,X,ue,q){var Ze=document.createElementNS("http://www.w3.org/2000/svg","line");return Ze.setAttribute("x1",N.toString()),Ze.setAttribute("y1",B.toString()),Ze.setAttribute("x2",X.toString()),Ze.setAttribute("y2",ue.toString()),q&&ee.setAttributes(Ze,q),Ze},ee.createPolygon=function(N,B){var X=document.createElementNS("http://www.w3.org/2000/svg","polygon");return X.setAttribute("points",N),B&&ee.setAttributes(X,B),X},ee.createCircle=function(N,B){var X=document.createElementNS("http://www.w3.org/2000/svg","circle");return X.setAttribute("cx",(N/2).toString()),X.setAttribute("cy",(N/2).toString()),X.setAttribute("r",N.toString()),B&&ee.setAttributes(X,B),X},ee.createEllipse=function(N,B,X){var ue=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ue.setAttribute("cx",(N/2).toString()),ue.setAttribute("cy",(B/2).toString()),ue.setAttribute("rx",(N/2).toString()),ue.setAttribute("ry",(B/2).toString()),X&&ee.setAttributes(ue,X),ue},ee.createGroup=function(N){var B=document.createElementNS("http://www.w3.org/2000/svg","g");return N&&ee.setAttributes(B,N),B},ee.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ee.createMarker=function(N,B,X,ue,q,Ze,Jt){var On=document.createElementNS("http://www.w3.org/2000/svg","marker");return ee.setAttributes(On,[["id",N],["orient",B],["markerWidth",X.toString()],["markerHeight",ue.toString()],["refX",q.toString()],["refY",Ze.toString()]]),On.appendChild(Jt),On},ee.createText=function(N){var B=document.createElementNS("http://www.w3.org/2000/svg","text");return B.setAttribute("x","0"),B.setAttribute("y","0"),N&&ee.setAttributes(B,N),B},ee.createTSpan=function(N,B){var X=document.createElementNS("http://www.w3.org/2000/svg","tspan");return X.textContent=N,B&&ee.setAttributes(X,B),X},ee.createImage=function(N){var B=document.createElementNS("http://www.w3.org/2000/svg","image");return N&&ee.setAttributes(B,N),B},ee.createPoint=function(N,B){var X=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return X.x=N,X.y=B,X},ee.createPath=function(N,B){var X=document.createElementNS("http://www.w3.org/2000/svg","path");return X.setAttribute("d",N),B&&ee.setAttributes(X,B),X},ee}(),oe=function(){function ee(){}return ee.addKey=function(N){ee.key=N},Object.defineProperty(ee,"isLicensed",{get:function(){return!!ee.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ee.key)},enumerable:!1,configurable:!0}),ee}(),Se=function(){function ee(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return ee.prototype.rasterize=function(N,B,X){var ue=this;return new Promise(function(q){var Ze=X!==void 0?X:document.createElement("canvas");N===null&&(ue.markersOnly=!0,ue.naturalSize=!1);var Jt=document.createElementNS("http://www.w3.org/2000/svg","svg");Jt.setAttribute("xmlns","http://www.w3.org/2000/svg"),Jt.setAttribute("width",B.width.baseVal.valueAsString),Jt.setAttribute("height",B.height.baseVal.valueAsString),Jt.setAttribute("viewBox","0 0 "+B.viewBox.baseVal.width.toString()+" "+B.viewBox.baseVal.height.toString()),Jt.innerHTML=B.innerHTML,ue.naturalSize===!0?(Jt.width.baseVal.value=N.naturalWidth,Jt.height.baseVal.value=N.naturalHeight):ue.width!==void 0&&ue.height!==void 0&&(Jt.width.baseVal.value=ue.width,Jt.height.baseVal.value=ue.height),Ze.width=Jt.width.baseVal.value,Ze.height=Jt.height.baseVal.value;var On=Jt.outerHTML,Xn=Ze.getContext("2d");ue.markersOnly!==!0&&Xn.drawImage(N,0,0,Ze.width,Ze.height);var un=window.URL,nr=new Image(Ze.width,Ze.height);nr.setAttribute("crossOrigin","anonymous");var mr=new Blob([On],{type:"image/svg+xml"}),Kr=un.createObjectURL(mr);nr.onload=function(){Xn.drawImage(nr,0,0),un.revokeObjectURL(Kr);var ma=Ze.toDataURL(ue.imageType,ue.imageQuality);q(ma)},nr.src=Kr})},ee}(),_e=function(){},He=function(){function ee(N){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+N+"_"}return Object.defineProperty(ee.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ee.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(ee.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),ee.prototype.addClass=function(N){return this.styleSheet===void 0&&this.addStyleSheet(),N.name=""+this.classNamePrefix+N.localName,this.classes.push(N),this.styleSheet.sheet.insertRule("."+N.name+" {"+N.style+"}",this.styleSheet.sheet.cssRules.length),N},ee.prototype.addRule=function(N){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(N),this.styleSheet.sheet.insertRule(N.selector+" {"+N.style+"}",this.styleSheet.sheet.cssRules.length)},ee.prototype.addStyleSheet=function(){var N;this.styleSheet=document.createElement("style"),((N=this.styleSheetRoot)!==null&&N!==void 0?N:document.head).appendChild(this.styleSheet),this.addRule(new rt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new rt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new rt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new ae("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new ae("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},ee.prototype.removeStyleSheet=function(){var N;this.styleSheet&&(((N=this.styleSheetRoot)!==null&&N!==void 0?N:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ee}(),rt=function(ee,N){this.selector=ee,this.style=N},ae=function(ee,N){this.localName=ee,this.style=N},$=function(){function ee(N,B,X,ue,q){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=N,this.displayMode=B,this.markerItems=X,this.uiStyleSettings=ue,this.styles=q,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return ee.prototype.show=function(N){var B=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=N,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var X=document.createElement("div");X.className=this.toolbarBlockStyleClass.name,X.style.whiteSpace="nowrap",this.uiContainer.appendChild(X),this.addActionButton(X,'<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(X,'<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(X,'<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(X,'<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(X,'<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(X,'<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(X,'<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(X,'<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(q){var Ze=document.createElement("div");Ze.className=""+B.toolbarButtonStyleClass.name,Ze.setAttribute("data-type-name",q.typeName),Ze.innerHTML=q.icon,Ze.addEventListener("click",function(){B.markerToolbarButtonClicked(Ze,q)}),B.buttons.push(Ze),B.markerButtons.push(Ze)}),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 ue=document.createElement("div");ue.className=this.toolbarBlockStyleClass.name,ue.style.whiteSpace="nowrap",ue.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ue),this.addActionButton(ue,'<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(ue,'<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()},ee.prototype.addButtonClickListener=function(N){this.buttonClickListeners.push(N)},ee.prototype.removeButtonClickListener=function(N){this.buttonClickListeners.indexOf(N)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(N),1)},ee.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},ee.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var N=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var B=0;B<this.markerButtons.length;B++)B<N||B===N&&this.markerButtons.length-1===N?this.markerButtonBlock.appendChild(this.markerButtons[B]):(B===N&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[B]))}},ee.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")},ee.prototype.resetButtonStyles=function(){var N=this;this.buttons.forEach(function(B){B.className=B.className.replace(N.uiStyleSettings.toolbarButtonStyleColorsClassName?N.uiStyleSettings.toolbarButtonStyleColorsClassName:N.toolbarButtonStyleColorsClass.name,"").trim(),B.className=B.className.replace(N.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?N.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:N.toolbarActiveButtonStyleColorsClass.name,"").trim(),B.className+=" "+(N.uiStyleSettings.toolbarButtonStyleColorsClassName?N.uiStyleSettings.toolbarButtonStyleColorsClassName:N.toolbarButtonStyleColorsClass.name)})},ee.prototype.addActionButton=function(N,B,X){var ue=this,q=document.createElement("div");switch(q.className=""+this.toolbarButtonStyleClass.name,q.innerHTML=B,q.setAttribute("data-action",X),q.addEventListener("click",function(){ue.actionToolbarButtonClicked(q,X)}),X){case"select":q.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":q.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":q.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":q.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":q.style.fill=this.uiStyleSettings.closeButtonColor}N.appendChild(q),this.buttons.push(q)},ee.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ae("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 ae("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ae("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new ae("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 ae("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var N=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ae("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*N)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*N)+`px;
padding: `+N+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ae("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ae("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new rt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new rt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},ee.prototype.markerToolbarButtonClicked=function(N,B){this.setActiveButton(N),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(X){return X("marker",B)}),this.markerButtonOverflowBlock.style.display="none"},ee.prototype.actionToolbarButtonClicked=function(N,B){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(X){return X("action",B)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},ee.prototype.setActiveButton=function(N){this.resetButtonStyles(),N.className=N.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),N.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},ee.prototype.setActiveMarkerButton=function(N){var B=this.markerButtons.find(function(X){return X.getAttribute("data-type-name")===N});B&&this.setActiveButton(B)},ee.prototype.setCurrentMarker=function(N){var B=this;this.currentMarker=N,this.buttons.filter(function(X){return/delete|notes/.test(X.getAttribute("data-action"))}).forEach(function(X){B.currentMarker===void 0?(X.style.fillOpacity="0.4",X.style.pointerEvents="none"):(X.style.fillOpacity="1",X.style.pointerEvents="all")})},ee}(),Q=function(){function ee(N,B,X,ue){this.panels=[],this.panelButtons=[],this.markerjsContainer=N,this.displayMode=B,this.uiStyleSettings=X,this.styles=ue,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return ee.prototype.addStyles=function(){var N;this.toolboxStyleClass=this.styles.addClass(new ae("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 ae("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var B=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ae("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ae("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ae("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 ae("toolbox-panel-row_colors",`
background-color: `+((N=this.uiStyleSettings.toolboxBackgroundColor)!==null&&N!==void 0?N:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new ae("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*B)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*B)+`px;
padding: `+B+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new ae("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ae("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new rt("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new rt("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},ee.prototype.show=function(N){var B;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=N,this.uiContainer.className=this.toolboxStyleClass.name+" "+((B=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&B!==void 0?B:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},ee.prototype.setPanelButtons=function(N){var B,X,ue=this;this.panels=N,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((B=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&B!==void 0?B:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((X=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&X!==void 0?X:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(q){var Ze;q.uiStyleSettings=ue.uiStyleSettings;var Jt=document.createElement("div");Jt.className=ue.toolboxButtonStyleClass.name+" "+((Ze=ue.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ze!==void 0?Ze:ue.toolboxButtonStyleColorsClass.name),Jt.innerHTML=q.icon,Jt.title=q.title,Jt.addEventListener("click",function(){ue.panelButtonClick(q)}),ue.panelButtons.push(Jt),ue.buttonRow.appendChild(Jt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},ee.prototype.panelButtonClick=function(N){var B=this,X=-1;if(N!==this.activePanel){X=this.panels.indexOf(N),this.panelRow.innerHTML="";var ue=N.getUi();ue.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ue),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=N}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){B.displayMode==="inline"?B.panelRow.style.display="none":B.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(q,Ze){var Jt,On;q.className=B.toolboxButtonStyleClass.name+" "+(Ze===X?""+((Jt=B.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Jt!==void 0?Jt:B.toolboxActiveButtonStyleColorsClass.name):""+((On=B.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&On!==void 0?On:B.toolboxButtonStyleColorsClass.name))})},ee}(),te=function(ee,N){this.title=ee,this.icon=N},he=function(ee){function N(B,X,ue,q){var Ze=ee.call(this,B,q||'<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 Ze.colors=[],Ze.addTransparent=!1,Ze.colorBoxes=[],Ze.colors=X,Ze.currentColor=ue,Ze.setCurrentColor=Ze.setCurrentColor.bind(Ze),Ze.getColorBox=Ze.getColorBox.bind(Ze),Ze}return Te(N,ee),N.prototype.getUi=function(){var B=this,X=document.createElement("div");return X.style.overflow="hidden",X.style.whiteSpace="nowrap",this.colors.forEach(function(ue){var q=B.getColorBox(ue);X.appendChild(q),B.colorBoxes.push(q)}),X},N.prototype.getColorBox=function(B){var X=this,ue=this.uiStyleSettings.toolbarHeight/4,q=this.uiStyleSettings.toolbarHeight-ue,Ze=document.createElement("div");Ze.style.display="inline-block",Ze.style.boxSizing="content-box",Ze.style.width=q-2+"px",Ze.style.height=q-2+"px",Ze.style.padding="1px",Ze.style.marginRight="2px",Ze.style.marginBottom="2px",Ze.style.borderWidth="2px",Ze.style.borderStyle="solid",Ze.style.borderRadius=(q+2)/2+"px",Ze.style.borderColor=B===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Ze.addEventListener("click",function(){X.setCurrentColor(B,Ze)});var Jt=document.createElement("div");return Jt.style.display="inline-block",Jt.style.width=q-2+"px",Jt.style.height=q-2+"px",Jt.style.backgroundColor=B,Jt.style.borderRadius=q/2+"px",B==="transparent"&&(Jt.style.fill=this.uiStyleSettings.toolboxAccentColor,Jt.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>`),Ze.appendChild(Jt),Ze},N.prototype.setCurrentColor=function(B,X){var ue=this;this.currentColor=B,this.colorBoxes.forEach(function(q){q.style.borderColor=q===X?ue.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(B)},N}(te),ge=function(){function ee(N,B,X){this._state="new",this._isSelected=!1,this._container=N,this._overlayContainer=B,this.globalSettings=X,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(ee.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),ee.prototype.ownsTarget=function(N){return!1},Object.defineProperty(ee.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),ee.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},ee.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},ee.prototype.pointerDown=function(N,B){},ee.prototype.dblClick=function(N,B){},ee.prototype.manipulate=function(N){},ee.prototype.pointerUp=function(N){this.stateChanged()},ee.prototype.dispose=function(){},ee.prototype.addMarkerVisualToContainer=function(N){this.container.childNodes.length>0?this.container.insertBefore(N,this.container.childNodes[0]):this.container.appendChild(N)},ee.prototype.getState=function(){return{typeName:ee.typeName,state:this.state,notes:this.notes}},ee.prototype.restoreState=function(N){this._state=N.state,this.notes=N.notes},ee.prototype.scale=function(N,B){},ee.prototype.colorChanged=function(N){this.onColorChanged&&this.onColorChanged(N),this.stateChanged()},ee.prototype.fillColorChanged=function(N){this.onFillColorChanged&&this.onFillColorChanged(N),this.stateChanged()},ee.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var N=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),N.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(N)&&this.onStateChanged(this)}},ee.typeName="MarkerBase",ee}(),we=function(){function ee(){this.findGripByVisual=this.findGripByVisual.bind(this)}return ee.prototype.findGripByVisual=function(N){return this.topLeft.ownsTarget(N)?this.topLeft:this.topCenter.ownsTarget(N)?this.topCenter:this.topRight.ownsTarget(N)?this.topRight:this.centerLeft.ownsTarget(N)?this.centerLeft:this.centerRight.ownsTarget(N)?this.centerRight:this.bottomLeft.ownsTarget(N)?this.bottomLeft:this.bottomCenter.ownsTarget(N)?this.bottomCenter:this.bottomRight.ownsTarget(N)?this.bottomRight:void 0},ee}(),ft=function(){function ee(){this.GRIP_SIZE=10,this.visual=ye.createGroup(),this.visual.appendChild(ye.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ye.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ee.prototype.ownsTarget=function(N){return N===this.visual||N===this.visual.childNodes[0]||N===this.visual.childNodes[1]},ee}(),Pt=function(){function ee(){}return ee.toITransformMatrix=function(N){return{a:N.a,b:N.b,c:N.c,d:N.d,e:N.e,f:N.f}},ee.toSVGMatrix=function(N,B){return N.a=B.a,N.b=B.b,N.c=B.c,N.d=B.d,N.e=B.e,N.f=B.f,N},ee}(),jt=function(ee){function N(B,X,ue){var q=ee.call(this,B,X,ue)||this;return q.left=0,q.top=0,q.width=0,q.height=0,q.defaultSize={x:50,y:20},q.offsetX=0,q.offsetY=0,q.rotationAngle=0,q.CB_DISTANCE=10,q._suppressMarkerCreateEvent=!1,q.container.transform.baseVal.appendItem(ye.createTransform()),q.setupControlBox(),q}return Te(N,ee),Object.defineProperty(N.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(N.prototype,"visual",{get:function(){return this._visual},set:function(B){this._visual=B;var X=ye.createTransform();this._visual.transform.baseVal.appendItem(X)},enumerable:!1,configurable:!0}),N.prototype.ownsTarget=function(B){return!!ee.prototype.ownsTarget.call(this,B)||!!(this.controlGrips.findGripByVisual(B)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(B))},N.prototype.pointerDown=function(B,X){ee.prototype.pointerDown.call(this,B,X),this.state==="new"&&(this.left=B.x,this.top=B.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ue=this.unrotatePoint(B);if(this.manipulationStartX=ue.x,this.manipulationStartY=ue.y,this.offsetX=ue.x-this.left,this.offsetY=ue.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(X),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(X)){this.activeGrip=this.rotatorGrip;var q=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=q.x-this.width/2,this.top=q.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Ze=this.container.transform.baseVal.getItem(0);Ze.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Ze,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},N.prototype.pointerUp=function(B){var X=this.state;ee.prototype.pointerUp.call(this,B),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(B),this._state="select",X==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},N.prototype.moveVisual=function(B){this.visual.style.transform="translate("+B.x+"px, "+B.y+"px)"},N.prototype.manipulate=function(B){var X=this.unrotatePoint(B);this.state==="creating"?this.resize(B):this.state==="move"?(this.left=this.manipulationStartLeft+(X.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(X.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(X):this.state==="rotate"&&this.rotate(B)},N.prototype.resize=function(B){var X=this.manipulationStartLeft,ue=this.manipulationStartWidth,q=this.manipulationStartTop,Ze=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:X=this.manipulationStartLeft+B.x-this.manipulationStartX,ue=this.manipulationStartWidth+this.manipulationStartLeft-X;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ue=this.manipulationStartWidth+B.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:q=this.manipulationStartTop+B.y-this.manipulationStartY,Ze=this.manipulationStartHeight+this.manipulationStartTop-q;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Ze=this.manipulationStartHeight+B.y-this.manipulationStartY}ue>=0?(this.left=X,this.width=ue):(this.left=X+ue,this.width=-ue),Ze>=0?(this.top=q,this.height=Ze):(this.top=q+Ze,this.height=-Ze),this.setSize()},N.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},N.prototype.rotate=function(B){if(Math.abs(B.x-this.centerX)>.1){var X=Math.sign(B.x-this.centerX);this.rotationAngle=180*Math.atan((B.y-this.centerY)/(B.x-this.centerX))/Math.PI+90*X,this.applyRotation()}},N.prototype.applyRotation=function(){var B=this.container.transform.baseVal.getItem(0);B.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(B,0)},N.prototype.rotatePoint=function(B){if(this.rotationAngle===0)return B;var X=this.container.getCTM(),ue=ye.createPoint(B.x,B.y);return{x:(ue=ue.matrixTransform(X)).x,y:ue.y}},N.prototype.unrotatePoint=function(B){if(this.rotationAngle===0)return B;var X=this.container.getCTM();X=X.inverse();var ue=ye.createPoint(B.x,B.y);return{x:(ue=ue.matrixTransform(X)).x,y:ue.y}},N.prototype.select=function(){ee.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},N.prototype.deselect=function(){ee.prototype.deselect.call(this),this.controlBox.style.display="none"},N.prototype.setupControlBox=function(){this.controlBox=ye.createGroup();var B=ye.createTransform();B.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(B),this.container.appendChild(this.controlBox),this.controlRect=ye.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=ye.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 we,this.addControlGrips(),this.controlBox.style.display="none"},N.prototype.adjustControlBox=function(){var B=this.controlBox.transform.baseVal.getItem(0);B.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(B,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()},N.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()},N.prototype.createGrip=function(){var B=new ft;return B.visual.transform.baseVal.appendItem(ye.createTransform()),this.controlBox.appendChild(B.visual),B},N.prototype.positionGrips=function(){var B=this.controlGrips.topLeft.GRIP_SIZE,X=-B/2,ue=X,q=(this.width+this.CB_DISTANCE)/2-B/2,Ze=(this.height+this.CB_DISTANCE)/2-B/2,Jt=this.height+this.CB_DISTANCE-B/2,On=this.width+this.CB_DISTANCE-B/2;this.positionGrip(this.controlGrips.topLeft.visual,X,ue),this.positionGrip(this.controlGrips.topCenter.visual,q,ue),this.positionGrip(this.controlGrips.topRight.visual,On,ue),this.positionGrip(this.controlGrips.centerLeft.visual,X,Ze),this.positionGrip(this.controlGrips.centerRight.visual,On,Ze),this.positionGrip(this.controlGrips.bottomLeft.visual,X,Jt),this.positionGrip(this.controlGrips.bottomCenter.visual,q,Jt),this.positionGrip(this.controlGrips.bottomRight.visual,On,Jt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,q,ue-3*this.CB_DISTANCE)},N.prototype.positionGrip=function(B,X,ue){var q=B.transform.baseVal.getItem(0);q.setTranslate(X,ue),B.transform.baseVal.replaceItem(q,0)},N.prototype.hideControlBox=function(){this.controlBox.style.display="none"},N.prototype.showControlBox=function(){this.controlBox.style.display=""},N.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Pt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Pt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},ee.prototype.getState.call(this))},N.prototype.restoreState=function(B){ee.prototype.restoreState.call(this,B);var X=B;this.left=X.left,this.top=X.top,this.width=X.width,this.height=X.height,this.rotationAngle=X.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Pt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,X.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Pt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,X.containerTransformMatrix))},N.prototype.scale=function(B,X){ee.prototype.scale.call(this,B,X);var ue=this.rotatePoint({x:this.left,y:this.top}),q=this.unrotatePoint({x:ue.x*B,y:ue.y*X});this.left=q.x,this.top=q.y,this.width=this.width*B,this.height=this.height*X,this.adjustControlBox()},N}(ge),qe=function(ee){function N(B,X,ue){var q=ee.call(this,B,X,ue)||this;return q.fillColor="transparent",q.strokeColor="transparent",q.strokeWidth=0,q.strokeDasharray="",q.opacity=1,q.setStrokeColor=q.setStrokeColor.bind(q),q.setFillColor=q.setFillColor.bind(q),q.setStrokeWidth=q.setStrokeWidth.bind(q),q.setStrokeDasharray=q.setStrokeDasharray.bind(q),q.createVisual=q.createVisual.bind(q),q}return Te(N,ee),N.prototype.ownsTarget=function(B){return!(!ee.prototype.ownsTarget.call(this,B)&&B!==this.visual)},N.prototype.createVisual=function(){this.visual=ye.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)},N.prototype.pointerDown=function(B,X){ee.prototype.pointerDown.call(this,B,X),this.state==="new"&&(this.createVisual(),this.moveVisual(B),this._state="creating")},N.prototype.manipulate=function(B){ee.prototype.manipulate.call(this,B)},N.prototype.resize=function(B){ee.prototype.resize.call(this,B),this.setSize()},N.prototype.setSize=function(){ee.prototype.setSize.call(this),ye.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},N.prototype.pointerUp=function(B){ee.prototype.pointerUp.call(this,B),this.setSize()},N.prototype.setStrokeColor=function(B){this.strokeColor=B,this.visual&&ye.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(B),this.stateChanged()},N.prototype.setFillColor=function(B){this.fillColor=B,this.visual&&ye.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},N.prototype.setStrokeWidth=function(B){this.strokeWidth=B,this.visual&&ye.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},N.prototype.setStrokeDasharray=function(B){this.strokeDasharray=B,this.visual&&ye.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},N.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ee.prototype.getState.call(this))},N.prototype.restoreState=function(B){var X=B;this.fillColor=X.fillColor,this.strokeColor=X.strokeColor,this.strokeWidth=X.strokeWidth,this.strokeDasharray=X.strokeDasharray,this.opacity=X.opacity,this.createVisual(),ee.prototype.restoreState.call(this,B),this.setSize()},N.prototype.scale=function(B,X){ee.prototype.scale.call(this,B,X),this.setSize()},N.title="Rectangle marker",N}(jt),Mt=function(ee){function N(B,X,ue,q){var Ze=ee.call(this,B,q||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Ze.widths=[],Ze.widthBoxes=[],Ze.widths=X,Ze.currentWidth=ue,Ze.setCurrentWidth=Ze.setCurrentWidth.bind(Ze),Ze}return Te(N,ee),N.prototype.getUi=function(){var B=this,X=document.createElement("div");return X.style.display="flex",X.style.overflow="hidden",X.style.flexGrow="2",this.widths.forEach(function(ue){var q=document.createElement("div");q.style.display="flex",q.style.flexGrow="2",q.style.alignItems="center",q.style.justifyContent="space-between",q.style.padding="5px",q.style.borderWidth="2px",q.style.borderStyle="solid",q.style.borderColor=ue===B.currentWidth?B.uiStyleSettings.toolboxAccentColor:"transparent",q.addEventListener("click",function(){B.setCurrentWidth(ue,q)}),X.appendChild(q);var Ze=document.createElement("div");Ze.innerText=ue.toString(),Ze.style.marginRight="5px",q.appendChild(Ze);var Jt=document.createElement("div");Jt.style.minHeight="20px",Jt.style.flexGrow="2",Jt.style.display="flex",Jt.style.alignItems="center";var On=document.createElement("hr");On.style.minWidth="20px",On.style.border="0px",On.style.borderTop=ue+"px solid "+B.uiStyleSettings.toolboxColor,On.style.flexGrow="2",Jt.appendChild(On),q.appendChild(Jt),B.widthBoxes.push(q)}),X},N.prototype.setCurrentWidth=function(B,X){var ue=this;this.currentWidth=B,this.widthBoxes.forEach(function(q){q.style.borderColor=q===X?ue.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},N}(te),sn=function(ee){function N(B,X,ue,q){var Ze=ee.call(this,B,q||'<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 Ze.styles=[],Ze.styleBoxes=[],Ze.styles=X,Ze.currentStyle=ue,Ze.setCurrentStyle=Ze.setCurrentStyle.bind(Ze),Ze}return Te(N,ee),N.prototype.getUi=function(){var B=this,X=document.createElement("div");return X.style.display="flex",X.style.overflow="hidden",X.style.flexGrow="2",this.styles.forEach(function(ue){var q=document.createElement("div");q.style.display="flex",q.style.alignItems="center",q.style.justifyContent="space-between",q.style.padding="5px",q.style.borderWidth="2px",q.style.borderStyle="solid",q.style.overflow="hidden",q.style.maxWidth=100/B.styles.length-5+"%",q.style.borderColor=ue===B.currentStyle?B.uiStyleSettings.toolboxAccentColor:"transparent",q.addEventListener("click",function(){B.setCurrentStyle(ue,q)}),X.appendChild(q);var Ze=document.createElement("div");Ze.style.minHeight="20px",Ze.style.flexGrow="2",Ze.style.overflow="hidden";var Jt=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+B.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(ue!==""?'stroke-dasharray="'+ue+'"':"")+` />
</svg>`;Ze.innerHTML=Jt,q.appendChild(Ze),B.styleBoxes.push(q)}),X},N.prototype.setCurrentStyle=function(B,X){var ue=this;this.currentStyle=B,this.styleBoxes.forEach(function(q){q.style.borderColor=q===X?ue.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},N}(te),at=function(ee){function N(B,X,ue){var q=ee.call(this,B,X,ue)||this;return q.strokeColor=ue.defaultColor,q.strokeWidth=ue.defaultStrokeWidth,q.strokeDasharray=ue.defaultStrokeDasharray,q.strokePanel=new he("Line color",ue.defaultColorSet,ue.defaultColor),q.strokePanel.onColorChanged=q.setStrokeColor,q.strokeWidthPanel=new Mt("Line width",ue.defaultStrokeWidths,ue.defaultStrokeWidth),q.strokeWidthPanel.onWidthChanged=q.setStrokeWidth,q.strokeStylePanel=new sn("Line style",ue.defaultStrokeDasharrays,ue.defaultStrokeDasharray),q.strokeStylePanel.onStyleChanged=q.setStrokeDasharray,q}return Te(N,ee),Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=ee.prototype.getState.call(this);return B.typeName=N.typeName,B},N.typeName="FrameMarker",N.title="Frame marker",N.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',N}(qe),Qe=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},Et=function(ee){function N(B,X,ue){var q=ee.call(this,B,X,ue)||this;return q.x1=0,q.y1=0,q.x2=0,q.y2=0,q.defaultLength=50,q.manipulationStartX=0,q.manipulationStartY=0,q.manipulationStartX1=0,q.manipulationStartY1=0,q.manipulationStartX2=0,q.manipulationStartY2=0,q.setupControlBox(),q}return Te(N,ee),N.prototype.ownsTarget=function(B){return!!ee.prototype.ownsTarget.call(this,B)||!(!this.grip1.ownsTarget(B)&&!this.grip2.ownsTarget(B))},N.prototype.pointerDown=function(B,X){ee.prototype.pointerDown.call(this,B,X),this.manipulationStartX=B.x,this.manipulationStartY=B.y,this.state==="new"&&(this.x1=B.x,this.y1=B.y,this.x2=B.x,this.y2=B.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(X)?this.activeGrip=this.grip1:this.grip2.ownsTarget(X)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},N.prototype.pointerUp=function(B){var X=this.state;ee.prototype.pointerUp.call(this,B),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(B),this._state="select",X==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},N.prototype.adjustVisual=function(){},N.prototype.manipulate=function(B){this.state==="creating"?this.resize(B):this.state==="move"?(this.x1=this.manipulationStartX1+B.x-this.manipulationStartX,this.y1=this.manipulationStartY1+B.y-this.manipulationStartY,this.x2=this.manipulationStartX2+B.x-this.manipulationStartX,this.y2=this.manipulationStartY2+B.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(B)},N.prototype.resize=function(B){switch(this.activeGrip){case this.grip1:this.x1=B.x,this.y1=B.y;break;case this.grip2:case void 0:this.x2=B.x,this.y2=B.y}this.adjustVisual(),this.adjustControlBox()},N.prototype.select=function(){ee.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},N.prototype.deselect=function(){ee.prototype.deselect.call(this),this.controlBox.style.display="none"},N.prototype.setupControlBox=function(){this.controlBox=ye.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},N.prototype.adjustControlBox=function(){this.positionGrips()},N.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},N.prototype.createGrip=function(){var B=new ft;return B.visual.transform.baseVal.appendItem(ye.createTransform()),this.controlBox.appendChild(B.visual),B},N.prototype.positionGrips=function(){var B=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-B/2,this.y1-B/2),this.positionGrip(this.grip2.visual,this.x2-B/2,this.y2-B/2)},N.prototype.positionGrip=function(B,X,ue){var q=B.transform.baseVal.getItem(0);q.setTranslate(X,ue),B.transform.baseVal.replaceItem(q,0)},N.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},ee.prototype.getState.call(this))},N.prototype.restoreState=function(B){ee.prototype.restoreState.call(this,B);var X=B;this.x1=X.x1,this.y1=X.y1,this.x2=X.x2,this.y2=X.y2},N.prototype.scale=function(B,X){ee.prototype.scale.call(this,B,X),this.x1=this.x1*B,this.y1=this.y1*X,this.x2=this.x2*B,this.y2=this.y2*X,this.adjustVisual(),this.adjustControlBox()},N}(ge),It=function(ee){function N(B,X,ue){var q=ee.call(this,B,X,ue)||this;return q.strokeColor="transparent",q.strokeWidth=0,q.strokeDasharray="",q.setStrokeColor=q.setStrokeColor.bind(q),q.setStrokeWidth=q.setStrokeWidth.bind(q),q.setStrokeDasharray=q.setStrokeDasharray.bind(q),q.strokeColor=ue.defaultColor,q.strokeWidth=ue.defaultStrokeWidth,q.strokeDasharray=ue.defaultStrokeDasharray,q.strokePanel=new he("Line color",ue.defaultColorSet,ue.defaultColor),q.strokePanel.onColorChanged=q.setStrokeColor,q.strokeWidthPanel=new Mt("Line width",ue.defaultStrokeWidths,ue.defaultStrokeWidth),q.strokeWidthPanel.onWidthChanged=q.setStrokeWidth,q.strokeStylePanel=new sn("Line style",ue.defaultStrokeDasharrays,ue.defaultStrokeDasharray),q.strokeStylePanel.onStyleChanged=q.setStrokeDasharray,q}return Te(N,ee),N.prototype.ownsTarget=function(B){return!(!ee.prototype.ownsTarget.call(this,B)&&B!==this.visual&&B!==this.selectorLine&&B!==this.visibleLine)},N.prototype.createVisual=function(){this.visual=ye.createGroup(),this.selectorLine=ye.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ye.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)},N.prototype.pointerDown=function(B,X){ee.prototype.pointerDown.call(this,B,X),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},N.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()),ye.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ye.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ye.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},N.prototype.setStrokeColor=function(B){this.strokeColor=B,this.adjustVisual(),this.colorChanged(B)},N.prototype.setStrokeWidth=function(B){this.strokeWidth=B,this.adjustVisual()},N.prototype.setStrokeDasharray=function(B){this.strokeDasharray=B,this.adjustVisual(),this.stateChanged()},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},ee.prototype.getState.call(this));return B.typeName=N.typeName,B},N.prototype.restoreState=function(B){ee.prototype.restoreState.call(this,B);var X=B;this.strokeColor=X.strokeColor,this.strokeWidth=X.strokeWidth,this.strokeDasharray=X.strokeDasharray,this.createVisual(),this.adjustVisual()},N.typeName="LineMarker",N.title="Line marker",N.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',N}(Et),dt=function(ee){function N(B,X,ue,q){var Ze=ee.call(this,B,q||'<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 Ze.fonts=[],Ze.fontBoxes=[],Ze.fonts=X,Ze.currentFont=ue,Ze.setCurrentFont=Ze.setCurrentFont.bind(Ze),Ze}return Te(N,ee),N.prototype.getUi=function(){var B=this,X=document.createElement("div");return X.style.overflow="hidden",X.style.flexGrow="2",this.fonts.forEach(function(ue){var q=document.createElement("div");q.style.display="inline-block",q.style.alignItems="center",q.style.justifyContent="space-between",q.style.padding="5px",q.style.borderWidth="2px",q.style.borderStyle="solid",q.style.overflow="hidden",q.style.maxWidth=100/B.fonts.length-5+"%",q.style.borderColor=ue===B.currentFont?B.uiStyleSettings.toolboxAccentColor:"transparent",q.addEventListener("click",function(){B.setCurrentFont(ue,q)}),X.appendChild(q);var Ze=document.createElement("div");Ze.style.display="flex",Ze.style.minHeight="20px",Ze.style.flexGrow="2",Ze.style.fontFamily=ue,Ze.style.overflow="hidden";var Jt=document.createElement("div");Jt.style.whiteSpace="nowrap",Jt.style.overflow="hidden",Jt.style.textOverflow="ellipsis",Jt.innerHTML="The quick brown fox jumps over the lazy dog",Ze.appendChild(Jt),q.appendChild(Ze),B.fontBoxes.push(q)}),X},N.prototype.setCurrentFont=function(B,X){var ue=this;this.currentFont=B,this.fontBoxes.forEach(function(q){q.style.borderColor=q===X?ue.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},N}(te),mt=function(ee){function N(B,X,ue){var q=ee.call(this,B,X,ue)||this;return q.color="transparent",q.padding=5,q.DEFAULT_TEXT="your text here",q.text=q.DEFAULT_TEXT,q.isMoved=!1,q.color=ue.defaultColor,q.fontFamily=ue.defaultFontFamily,q.defaultSize={x:100,y:30},q.setColor=q.setColor.bind(q),q.setFont=q.setFont.bind(q),q.renderText=q.renderText.bind(q),q.sizeText=q.sizeText.bind(q),q.textEditDivClicked=q.textEditDivClicked.bind(q),q.showTextEditor=q.showTextEditor.bind(q),q.setSize=q.setSize.bind(q),q.positionTextEditor=q.positionTextEditor.bind(q),q.colorPanel=new he("Color",ue.defaultColorSet,ue.defaultColor),q.colorPanel.onColorChanged=q.setColor,q.fontFamilyPanel=new dt("Font",ue.defaultFontFamilies,ue.defaultFontFamily),q.fontFamilyPanel.onFontChanged=q.setFont,q}return Te(N,ee),N.prototype.ownsTarget=function(B){if(ee.prototype.ownsTarget.call(this,B)||B===this.visual||B===this.textElement||B===this.bgRectangle)return!0;var X=!1;return this.textElement.childNodes.forEach(function(ue){ue===B&&(X=!0)}),X},N.prototype.createVisual=function(){this.visual=ye.createGroup(),this.bgRectangle=ye.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ye.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ye.createTransform()),this.textElement.transform.baseVal.appendItem(ye.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},N.prototype.pointerDown=function(B,X){ee.prototype.pointerDown.call(this,B,X),this.isMoved=!1,this.pointerDownPoint=B,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(B),this._state="creating")},N.prototype.renderText=function(){var B=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(X){B.textElement.appendChild(ye.createTSpan(X.trim()===""?" ":X.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},N.prototype.getTextScale=function(){var B=this.textElement.getBBox(),X=1;if(B.width>0&&B.height>0){var ue=(1*this.width-this.width*this.padding*2/100)/B.width,q=(1*this.height-this.height*this.padding*2/100)/B.height;X=Math.min(ue,q)}return X},N.prototype.getTextPosition=function(B){var X=this.textElement.getBBox(),ue=0,q=0;return X.width>0&&X.height>0&&(ue=(this.width-X.width*B)/2,q=this.height/2-X.height*B/2),{x:ue,y:q}},N.prototype.sizeText=function(){var B=this.textElement.getBBox(),X=this.getTextScale(),ue=this.getTextPosition(X);ue.y-=B.y*X,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ue.x+"px, "+ue.y+"px) scale("+X+", "+X+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ue.x,ue.y),this.textElement.transform.baseVal.getItem(1).setScale(X,X))},N.prototype.manipulate=function(B){ee.prototype.manipulate.call(this,B),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(B.x-this.pointerDownPoint.x)>5||Math.abs(B.y-this.pointerDownPoint.y)>5)},N.prototype.resize=function(B){ee.prototype.resize.call(this,B),this.isMoved=!0,this.setSize(),this.sizeText()},N.prototype.setSize=function(){ee.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ye.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ye.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},N.prototype.pointerUp=function(B){var X=this.state;X==="creating"&&(this._suppressMarkerCreateEvent=!0),ee.prototype.pointerUp.call(this,B),this.setSize(),(X==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},N.prototype.showTextEditor=function(){var B=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(X){X.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var X=Number.parseFloat(B.textEditor.style.fontSize);B.textEditor.clientWidth>=Number.parseInt(B.textEditor.style.maxWidth)&&X>.9;)X-=.1,B.textEditor.style.fontSize=Math.max(X,.9)+"em"}),this.textEditor.addEventListener("keyup",function(X){X.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(X){if(X.clipboardData){var ue=X.clipboardData.getData("text"),q=window.getSelection();if(!q.rangeCount)return!1;q.deleteFromDocument(),q.getRangeAt(0).insertNode(document.createTextNode(ue)),X.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){B.textEditDivClicked(B.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},N.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var B=this.getTextScale(),X=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ue=this.textElement.getBBox(),q={x:ue.width*B,y:ue.height*B};X.x-=q.x/2,X.y-=q.y/2,this.textEditor.style.top=X.y+"px",this.textEditor.style.left=X.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-X.x+"px",this.textEditor.style.fontSize=Math.max(16*B,12)+"px",this.textElement.style.display="none"}},N.prototype.textEditDivClicked=function(B){this.text=B.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},N.prototype.select=function(){ee.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},N.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),ee.prototype.deselect.call(this)},N.prototype.dblClick=function(B,X){ee.prototype.dblClick.call(this,B,X),this.showTextEditor()},N.prototype.setColor=function(B){this.textElement&&ye.setAttributes(this.textElement,[["fill",B]]),this.color=B,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(B)},N.prototype.setFont=function(B){this.textElement&&ye.setAttributes(this.textElement,[["font-family",B]]),this.fontFamily=B,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},N.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},N.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},ee.prototype.getState.call(this));return B.typeName=N.typeName,B},N.prototype.restoreState=function(B){var X=B;this.color=X.color,this.fontFamily=X.fontFamily,this.padding=X.padding,this.text=X.text,this.createVisual(),ee.prototype.restoreState.call(this,B),this.setSize()},N.prototype.scale=function(B,X){ee.prototype.scale.call(this,B,X),this.setSize(),this.sizeText(),this.positionTextEditor()},N.typeName="TextMarker",N.title="Text marker",N.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>',N}(jt),We=function(ee){function N(B,X,ue){var q=ee.call(this,B,X,ue)||this;return q.color="transparent",q.lineWidth=3,q.drawing=!1,q.pixelRatio=1,q.color=ue.defaultColor,q.lineWidth=ue.defaultStrokeWidth,q.pixelRatio=ue.freehandPixelRatio,q.setColor=q.setColor.bind(q),q.addCanvas=q.addCanvas.bind(q),q.finishCreation=q.finishCreation.bind(q),q.setLineWidth=q.setLineWidth.bind(q),q.colorPanel=new he("Color",ue.defaultColorSet,ue.defaultColor),q.colorPanel.onColorChanged=q.setColor,q.lineWidthPanel=new Mt("Line width",ue.defaultStrokeWidths,ue.defaultStrokeWidth),q.lineWidthPanel.onWidthChanged=q.setLineWidth,q}return Te(N,ee),N.prototype.ownsTarget=function(B){return!(!ee.prototype.ownsTarget.call(this,B)&&B!==this.visual&&B!==this.drawingImage)},N.prototype.createVisual=function(){this.visual=ye.createGroup(),this.drawingImage=ye.createImage(),this.visual.appendChild(this.drawingImage);var B=ye.createTransform();this.visual.transform.baseVal.appendItem(B),this.addMarkerVisualToContainer(this.visual)},N.prototype.pointerDown=function(B,X){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(B.x,B.y),this.drawing=!0):ee.prototype.pointerDown.call(this,B,X)},N.prototype.manipulate=function(B){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(B.x,B.y),this.canvasContext.stroke()):ee.prototype.manipulate.call(this,B)},N.prototype.resize=function(B){ee.prototype.resize.call(this,B),ye.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ye.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},N.prototype.pointerUp=function(B){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):ee.prototype.pointerUp.call(this,B)},N.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)},N.prototype.select=function(){this.state==="creating"&&this.finishCreation(),ee.prototype.select.call(this)},N.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),ee.prototype.deselect.call(this)},N.prototype.finishCreation=function(){for(var B=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),X=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ue=X[0],q=X[1],Ze=X[2],Jt=X[3],On=!1,Xn=0;Xn<this.canvasElement.height;Xn++)for(var un=0;un<this.canvasElement.width;un++)B.data[Xn*this.canvasElement.width*4+4*un+3]>0&&(On=!0,Xn<q&&(q=Xn),un<ue&&(ue=un),Xn>Jt&&(Jt=Xn),un>Ze&&(Ze=un));if(On){this.left=ue/this.pixelRatio,this.top=q/this.pixelRatio,this.width=(Ze-ue)/this.pixelRatio,this.height=(Jt-q)/this.pixelRatio;var nr=document.createElement("canvas");nr.width=Ze-ue,nr.height=Jt-q,nr.getContext("2d").putImageData(this.canvasContext.getImageData(ue,q,Ze-ue,Jt-q),0,0),this.drawingImgUrl=nr.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},N.prototype.setDrawingImage=function(){ye.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ye.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},N.prototype.setColor=function(B){this.color=B,this.colorChanged(B)},N.prototype.setLineWidth=function(B){this.lineWidth=B},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=Object.assign({drawingImgUrl:this.drawingImgUrl},ee.prototype.getState.call(this));return B.typeName=N.typeName,B},N.prototype.restoreState=function(B){this.createVisual(),ee.prototype.restoreState.call(this,B),this.drawingImgUrl=B.drawingImgUrl,this.setDrawingImage()},N.prototype.scale=function(B,X){ee.prototype.scale.call(this,B,X),this.setDrawingImage()},N.typeName="FreehandMarker",N.title="Freehand marker",N.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>',N}(jt),De=function(ee){function N(B,X,ue){var q=ee.call(this,B,ue||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return q.typeBoxes=[],q.currentType=X,q.setCurrentType=q.setCurrentType.bind(q),q}return Te(N,ee),N.prototype.getUi=function(){var B=this,X=document.createElement("div");X.style.display="flex",X.style.overflow="hidden",X.style.flexGrow="2";for(var ue=function(Jt){var On="both";switch(Jt){case 0:On="both";break;case 1:On="start";break;case 2:On="end";break;case 3:On="none"}var Xn=document.createElement("div");if(Xn.style.display="flex",Xn.style.flexGrow="2",Xn.style.alignItems="center",Xn.style.justifyContent="space-between",Xn.style.padding="5px",Xn.style.borderWidth="2px",Xn.style.borderStyle="solid",Xn.style.borderColor=On===q.currentType?q.uiStyleSettings.toolboxAccentColor:"transparent",Xn.addEventListener("click",function(){B.setCurrentType(On,Xn)}),X.appendChild(Xn),On==="both"||On==="start"){var un=document.createElement("div");un.style.display="flex",un.style.alignItems="center",un.style.minHeight="20px",un.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="`+(q.uiStyleSettings!==void 0?q.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,un.style.marginLeft="5px",Xn.appendChild(un)}var nr=document.createElement("div");nr.style.display="flex",nr.style.alignItems="center",nr.style.minHeight="20px",nr.style.flexGrow="2";var mr=document.createElement("hr");if(mr.style.minWidth="20px",mr.style.border="0px",mr.style.borderTop="3px solid "+(q.uiStyleSettings!==void 0?q.uiStyleSettings.toolboxColor:"#eeeeee"),mr.style.flexGrow="2",nr.appendChild(mr),Xn.appendChild(nr),On==="both"||On==="end"){var Kr=document.createElement("div");Kr.style.display="flex",Kr.style.alignItems="center",Kr.style.minHeight="20px",Kr.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="`+(q.uiStyleSettings!==void 0?q.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Kr.style.marginRight="5px",Xn.appendChild(Kr)}q.typeBoxes.push(Xn)},q=this,Ze=0;Ze<4;Ze++)ue(Ze);return X},N.prototype.setCurrentType=function(B,X){var ue=this;this.currentType=B,this.typeBoxes.forEach(function(q){q.style.borderColor=q===X?ue.uiStyleSettings!==void 0?ue.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},N}(te),Le=function(ee){function N(B,X,ue){var q=ee.call(this,B,X,ue)||this;return q.arrowType="end",q.arrowBaseHeight=10,q.arrowBaseWidth=10,q.getArrowPoints=q.getArrowPoints.bind(q),q.setArrowType=q.setArrowType.bind(q),q.arrowTypePanel=new De("Arrow type","end"),q.arrowTypePanel.onArrowTypeChanged=q.setArrowType,q}return Te(N,ee),N.prototype.ownsTarget=function(B){return!(!ee.prototype.ownsTarget.call(this,B)&&B!==this.arrow1&&B!==this.arrow2)},N.prototype.getArrowPoints=function(B,X){var ue=this.arrowBaseWidth+2*this.strokeWidth,q=this.arrowBaseHeight+2*this.strokeWidth;return B-ue/2+","+(X+q/2)+" "+B+","+(X-q/2)+" "+(B+ue/2)+","+(X+q/2)},N.prototype.createTips=function(){this.arrow1=ye.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ye.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ye.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ye.createTransform()),this.visual.appendChild(this.arrow2)},N.prototype.pointerDown=function(B,X){ee.prototype.pointerDown.call(this,B,X),this.state==="creating"&&this.createTips()},N.prototype.adjustVisual=function(){if(ee.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",ye.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ye.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var B=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),X=this.arrow1.transform.baseVal.getItem(0);X.setRotate(B,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(X,0);var ue=this.arrow2.transform.baseVal.getItem(0);ue.setRotate(B+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ue,0)}},N.prototype.setArrowType=function(B){this.arrowType=B,this.adjustVisual(),this.stateChanged()},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=Object.assign({arrowType:this.arrowType},ee.prototype.getState.call(this));return B.typeName=N.typeName,B},N.prototype.restoreState=function(B){ee.prototype.restoreState.call(this,B);var X=B;this.arrowType=X.arrowType,this.createTips(),this.adjustVisual()},N.typeName="ArrowMarker",N.title="Arrow marker",N.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',N}(It),de=function(ee){function N(B,X,ue){var q=ee.call(this,B,X,ue)||this;return q.fillColor=ue.defaultFillColor,q.strokeWidth=0,q.fillPanel=new he("Color",ue.defaultColorSet,ue.defaultFillColor),q.fillPanel.onColorChanged=q.setFillColor,q}return Te(N,ee),Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=ee.prototype.getState.call(this);return B.typeName=N.typeName,B},N.typeName="CoverMarker",N.title="Cover marker",N.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',N}(qe),fe=function(ee){function N(B,X,ue,q){var Ze=ee.call(this,B,q||'<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 Ze.opacities=[],Ze.opacityBoxes=[],Ze.opacities=X,Ze.currentOpacity=ue,Ze.setCurrentOpacity=Ze.setCurrentOpacity.bind(Ze),Ze}return Te(N,ee),N.prototype.getUi=function(){var B=this,X=document.createElement("div");return X.style.display="flex",X.style.overflow="hidden",X.style.flexGrow="2",X.style.justifyContent="space-between",this.opacities.forEach(function(ue){var q=document.createElement("div");q.style.display="flex",q.style.alignItems="center",q.style.justifyContent="center",q.style.padding="5px",q.style.borderWidth="2px",q.style.borderStyle="solid",q.style.borderColor=ue===B.currentOpacity?B.uiStyleSettings.toolboxAccentColor:"transparent",q.addEventListener("click",function(){B.setCurrentOpacity(ue,q)}),X.appendChild(q);var Ze=document.createElement("div");Ze.innerText=100*ue+"%",q.appendChild(Ze),B.opacityBoxes.push(q)}),X},N.prototype.setCurrentOpacity=function(B,X){var ue=this;this.currentOpacity=B,this.opacityBoxes.forEach(function(q){q.style.borderColor=q===X?ue.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},N}(te),Ee=function(ee){function N(B,X,ue){var q=ee.call(this,B,X,ue)||this;return q.setOpacity=q.setOpacity.bind(q),q.fillColor=ue.defaultHighlightColor,q.strokeWidth=0,q.opacity=ue.defaultHighlightOpacity,q.fillPanel=new he("Color",ue.defaultColorSet,q.fillColor),q.fillPanel.onColorChanged=q.setFillColor,q.opacityPanel=new fe("Opacity",ue.defaultOpacitySteps,q.opacity),q.opacityPanel.onOpacityChanged=q.setOpacity,q}return Te(N,ee),N.prototype.setOpacity=function(B){this.opacity=B,this.visual&&ye.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=ee.prototype.getState.call(this);return B.typeName=N.typeName,B},N.typeName="HighlightMarker",N.title="Highlight marker",N.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>',N}(de),Pe='<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>',Ue=function(ee){function N(B,X,ue){var q=ee.call(this,B,X,ue)||this;return q.bgColor="transparent",q.tipPosition={x:0,y:0},q.tipBase1Position={x:0,y:0},q.tipBase2Position={x:0,y:0},q.tipMoving=!1,q.color=ue.defaultStrokeColor,q.bgColor=ue.defaultFillColor,q.fontFamily=ue.defaultFontFamily,q.defaultSize={x:100,y:30},q.setBgColor=q.setBgColor.bind(q),q.getTipPoints=q.getTipPoints.bind(q),q.positionTip=q.positionTip.bind(q),q.setTipPoints=q.setTipPoints.bind(q),q.colorPanel=new he("Text color",ue.defaultColorSet,q.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>'),q.colorPanel.onColorChanged=q.setColor,q.bgColorPanel=new he("Fill color",ue.defaultColorSet,q.bgColor,Pe),q.bgColorPanel.onColorChanged=q.setBgColor,q.fontFamilyPanel=new dt("Font",ue.defaultFontFamilies,ue.defaultFontFamily),q.fontFamilyPanel.onFontChanged=q.setFont,q.tipGrip=new ft,q.tipGrip.visual.transform.baseVal.appendItem(ye.createTransform()),q.controlBox.appendChild(q.tipGrip.visual),q}return Te(N,ee),N.prototype.ownsTarget=function(B){return ee.prototype.ownsTarget.call(this,B)||this.tipGrip.ownsTarget(B)||this.tip===B},N.prototype.createTip=function(){ye.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ye.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},N.prototype.pointerDown=function(B,X){this.state==="new"&&ee.prototype.pointerDown.call(this,B,X),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(X)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):ee.prototype.pointerDown.call(this,B,X)},N.prototype.pointerUp=function(B){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,ee.prototype.pointerUp.call(this,B);else{var X=this.state==="creating";ee.prototype.pointerUp.call(this,B),this.setTipPoints(X),this.positionTip()}},N.prototype.manipulate=function(B){if(this.tipMoving){var X=this.unrotatePoint(B);this.tipPosition={x:X.x-this.manipulationStartLeft,y:X.y-this.manipulationStartTop},this.positionTip()}else ee.prototype.manipulate.call(this,B)},N.prototype.setBgColor=function(B){this.bgRectangle&&this.tip&&(ye.setAttributes(this.bgRectangle,[["fill",B]]),ye.setAttributes(this.tip,[["fill",B]])),this.bgColor=B,this.fillColorChanged(B)},N.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},N.prototype.setTipPoints=function(B){B===void 0&&(B=!1);var X=Math.min(this.height/2,15),ue=this.height/5;B&&(this.tipPosition={x:X+ue/2,y:this.height+20});var q=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?q<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(ue=this.width/5,X=Math.min(this.width/2,15),this.tipBase1Position={x:X,y:0},this.tipBase2Position={x:X+ue,y:0}):(this.tipBase1Position={x:0,y:X},this.tipBase2Position={x:0,y:X+ue}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?q<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(ue=this.width/5,X=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-X-ue,y:0},this.tipBase2Position={x:this.width-X,y:0}):(this.tipBase1Position={x:this.width,y:X},this.tipBase2Position={x:this.width,y:X+ue}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?q<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(ue=this.width/5,X=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-X-ue,y:this.height},this.tipBase2Position={x:this.width-X,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-X-ue},this.tipBase2Position={x:this.width,y:this.height-X}):q<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(ue=this.width/5,X=Math.min(this.width/2,15),this.tipBase1Position={x:X,y:this.height},this.tipBase2Position={x:X+ue,y:this.height}):(this.tipBase1Position={x:0,y:this.height-X},this.tipBase2Position={x:0,y:this.height-X-ue})},N.prototype.resize=function(B){ee.prototype.resize.call(this,B),this.positionTip()},N.prototype.positionTip=function(){ye.setAttributes(this.tip,[["points",this.getTipPoints()]]);var B=this.tipGrip.visual.transform.baseVal.getItem(0);B.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(B,0)},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),N.prototype.select=function(){this.positionTip(),ee.prototype.select.call(this)},N.prototype.getState=function(){var B=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},ee.prototype.getState.call(this));return B.typeName=N.typeName,B},N.prototype.restoreState=function(B){var X=B;this.bgColor=X.bgColor,this.tipPosition=X.tipPosition,ee.prototype.restoreState.call(this,B),this.createTip(),this.setTipPoints()},N.prototype.scale=function(B,X){ee.prototype.scale.call(this,B,X),this.tipPosition={x:this.tipPosition.x*B,y:this.tipPosition.y*X},this.positionTip()},N.typeName="CalloutMarker",N.title="Callout marker",N.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>',N}(mt),lt=function(ee){function N(B,X,ue){var q=ee.call(this,B,X,ue)||this;return q.fillColor="transparent",q.strokeColor="transparent",q.strokeWidth=0,q.strokeDasharray="",q.opacity=1,q.strokeColor=ue.defaultColor,q.strokeWidth=ue.defaultStrokeWidth,q.strokeDasharray=ue.defaultStrokeDasharray,q.fillColor=ue.defaultFillColor,q.setStrokeColor=q.setStrokeColor.bind(q),q.setFillColor=q.setFillColor.bind(q),q.setStrokeWidth=q.setStrokeWidth.bind(q),q.setStrokeDasharray=q.setStrokeDasharray.bind(q),q.setOpacity=q.setOpacity.bind(q),q.createVisual=q.createVisual.bind(q),q.strokePanel=new he("Line color",xe(ue.defaultColorSet,["transparent"]),ue.defaultColor),q.strokePanel.onColorChanged=q.setStrokeColor,q.fillPanel=new he("Fill color",xe(ue.defaultColorSet,["transparent"]),q.fillColor,Pe),q.fillPanel.onColorChanged=q.setFillColor,q.strokeWidthPanel=new Mt("Line width",ue.defaultStrokeWidths,ue.defaultStrokeWidth),q.strokeWidthPanel.onWidthChanged=q.setStrokeWidth,q.strokeStylePanel=new sn("Line style",ue.defaultStrokeDasharrays,ue.defaultStrokeDasharray),q.strokeStylePanel.onStyleChanged=q.setStrokeDasharray,q.opacityPanel=new fe("Opacity",ue.defaultOpacitySteps,q.opacity),q.opacityPanel.onOpacityChanged=q.setOpacity,q}return Te(N,ee),N.prototype.ownsTarget=function(B){return!(!ee.prototype.ownsTarget.call(this,B)&&B!==this.visual)},N.prototype.createVisual=function(){this.visual=ye.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)},N.prototype.pointerDown=function(B,X){ee.prototype.pointerDown.call(this,B,X),this.state==="new"&&(this.createVisual(),this.moveVisual(B),this._state="creating")},N.prototype.manipulate=function(B){ee.prototype.manipulate.call(this,B)},N.prototype.resize=function(B){ee.prototype.resize.call(this,B),this.setSize()},N.prototype.setSize=function(){ee.prototype.setSize.call(this),ye.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},N.prototype.pointerUp=function(B){ee.prototype.pointerUp.call(this,B),this.setSize()},N.prototype.setStrokeColor=function(B){this.strokeColor=B,this.visual&&ye.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(B),this.stateChanged()},N.prototype.setFillColor=function(B){this.fillColor=B,this.visual&&ye.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(B),this.stateChanged()},N.prototype.setStrokeWidth=function(B){this.strokeWidth=B,this.visual&&ye.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},N.prototype.setStrokeDasharray=function(B){this.strokeDasharray=B,this.visual&&ye.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},N.prototype.setOpacity=function(B){this.opacity=B,this.visual&&ye.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ee.prototype.getState.call(this));return B.typeName=N.typeName,B},N.prototype.restoreState=function(B){var X=B;this.fillColor=X.fillColor,this.strokeColor=X.strokeColor,this.strokeWidth=X.strokeWidth,this.strokeDasharray=X.strokeDasharray,this.opacity=X.opacity,this.createVisual(),ee.prototype.restoreState.call(this,B),this.setSize()},N.prototype.scale=function(B,X){ee.prototype.scale.call(this,B,X),this.setSize()},N.typeName="EllipseMarker",N.title="Ellipse marker",N.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>',N}(jt),Ot=function(ee){function N(B,X,ue){return ee.call(this,B,X,ue)||this}return Te(N,ee),Object.defineProperty(N.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),N.prototype.ownsTarget=function(B){return!(!ee.prototype.ownsTarget.call(this,B)&&B!==this.tip1&&B!==this.tip2)},N.prototype.createTips=function(){this.tip1=ye.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(ye.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ye.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(ye.createTransform()),this.visual.appendChild(this.tip2)},N.prototype.pointerDown=function(B,X){ee.prototype.pointerDown.call(this,B,X),this.state==="creating"&&this.createTips()},N.prototype.adjustVisual=function(){if(ee.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ye.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()]]),ye.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 B=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),X=this.tip1.transform.baseVal.getItem(0);X.setRotate(B,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(X,0);var ue=this.tip2.transform.baseVal.getItem(0);ue.setRotate(B+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ue,0)}},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=ee.prototype.getState.call(this);return B.typeName=N.typeName,B},N.prototype.restoreState=function(B){ee.prototype.restoreState.call(this,B),this.createTips(),this.adjustVisual()},N.typeName="MeasurementMarker",N.title="Measurement marker",N.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>',N}(It),cn=function(ee){function N(B,X,ue){var q=ee.call(this,B,X,ue)||this;return q.strokePanel.colors=ue.defaultColorSet,q.fillColor="transparent",q}return Te(N,ee),Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=ee.prototype.getState.call(this);return B.typeName=N.typeName,B},N.typeName="EllipseFrameMarker",N.title="Ellipse frame marker",N.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>',N}(lt),An=function(){function ee(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(ee.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),ee.prototype.addUndoStep=function(N){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(N)||(this.undoStack.push(N),JSON.stringify(this.lastRedoStep)!==JSON.stringify(N)&&this.redoStack.splice(0,this.redoStack.length))},ee.prototype.replaceLastUndoStep=function(N){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=N)},ee.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},ee.prototype.undo=function(){if(this.undoStack.length>1){var N=this.undoStack.pop();return N!==void 0&&this.redoStack.push(N),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},ee.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},ee}(),Ct=function(ee){function N(B,X,ue){var q=ee.call(this,B,X,ue)||this;return q.strokeColor="transparent",q.strokeWidth=0,q.strokeDasharray="",q.curveX=0,q.curveY=0,q.manipulationStartCurveX=0,q.manipulationStartCurveY=0,q.setStrokeColor=q.setStrokeColor.bind(q),q.setStrokeWidth=q.setStrokeWidth.bind(q),q.setStrokeDasharray=q.setStrokeDasharray.bind(q),q.positionGrips=q.positionGrips.bind(q),q.addControlGrips=q.addControlGrips.bind(q),q.adjustVisual=q.adjustVisual.bind(q),q.setupControlBox=q.setupControlBox.bind(q),q.resize=q.resize.bind(q),q.strokeColor=ue.defaultColor,q.strokeWidth=ue.defaultStrokeWidth,q.strokeDasharray=ue.defaultStrokeDasharray,q.strokePanel=new he("Line color",ue.defaultColorSet,ue.defaultColor),q.strokePanel.onColorChanged=q.setStrokeColor,q.strokeWidthPanel=new Mt("Line width",ue.defaultStrokeWidths,ue.defaultStrokeWidth),q.strokeWidthPanel.onWidthChanged=q.setStrokeWidth,q.strokeStylePanel=new sn("Line style",ue.defaultStrokeDasharrays,ue.defaultStrokeDasharray),q.strokeStylePanel.onStyleChanged=q.setStrokeDasharray,q}return Te(N,ee),N.prototype.ownsTarget=function(B){return!(!ee.prototype.ownsTarget.call(this,B)&&B!==this.visual&&B!==this.selectorCurve&&B!==this.visibleCurve&&!this.curveGrip.ownsTarget(B))},N.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},N.prototype.createVisual=function(){this.visual=ye.createGroup(),this.selectorCurve=ye.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ye.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)},N.prototype.pointerDown=function(B,X){ee.prototype.pointerDown.call(this,B,X),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=B.x,this.curveY=B.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(X)&&(this.activeGrip=this.curveGrip,this._state="resize")},N.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ye.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ye.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ye.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},N.prototype.setupControlBox=function(){ee.prototype.setupControlBox.call(this),this.curveControlLine1=ye.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ye.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)},N.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,ee.prototype.addControlGrips.call(this)},N.prototype.positionGrips=function(){ee.prototype.positionGrips.call(this);var B=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-B/2,this.curveY-B/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()))},N.prototype.manipulate=function(B){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+B.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+B.y-this.manipulationStartY),ee.prototype.manipulate.call(this,B)},N.prototype.resize=function(B){this.activeGrip===this.curveGrip&&(this.curveX=B.x,this.curveY=B.y),ee.prototype.resize.call(this,B),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},N.prototype.setStrokeColor=function(B){this.strokeColor=B,this.adjustVisual(),this.colorChanged(B)},N.prototype.setStrokeWidth=function(B){this.strokeWidth=B,this.adjustVisual()},N.prototype.setStrokeDasharray=function(B){this.strokeDasharray=B,this.adjustVisual()},N.prototype.scale=function(B,X){this.curveX=this.curveX*B,this.curveY=this.curveY*X,ee.prototype.scale.call(this,B,X)},Object.defineProperty(N.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),N.prototype.getState=function(){var B=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},ee.prototype.getState.call(this));return B.typeName=N.typeName,B},N.prototype.restoreState=function(B){ee.prototype.restoreState.call(this,B);var X=B;this.strokeColor=X.strokeColor,this.strokeWidth=X.strokeWidth,this.strokeDasharray=X.strokeDasharray,this.curveX=X.curveX,this.curveY=X.curveY,this.createVisual(),this.adjustVisual()},N.typeName="CurveMarker",N.title="Curve marker",N.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>',N}(Et),Gt=function(){function ee(N,B){B===void 0&&(B=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=N,this.cancelable=B}return Object.defineProperty(ee.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),ee.prototype.preventDefault=function(){this._defaultPrevented=!0},ee}(),xt=function(ee){function N(B,X,ue){var q=ee.call(this,B,!1)||this;return q.dataUrl=X,q.state=ue,q}return Te(N,ee),N}(Gt),Rt=function(ee){function N(B,X,ue){ue===void 0&&(ue=!1);var q=ee.call(this,B,ue)||this;return q.marker=X,q}return Te(N,ee),N}(Gt),gt=function(){function ee(){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 ee.prototype.addEventListener=function(N,B){this[N].push(B)},ee.prototype.removeEventListener=function(N,B){var X=this[N].indexOf(B);X>-1&&this[N].splice(X,1)},ee}(),be=function(){function ee(N){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Qe,this._isOpen=!1,this.undoRedoManager=new An,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 gt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=ee.instanceCounter++,this.styles=new He(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=N,this.targetRoot=document.body,this.width=N.clientWidth,this.height=N.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(ee.prototype,"ALL_MARKER_TYPES",{get:function(){return[at,We,Le,mt,cn,lt,Ee,Ue,Ot,de,It,Ct]},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[at,We,Le,mt,lt,Ee,Ue]},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"BASIC_MARKER_TYPES",{get:function(){return[at,We,Le,mt,Ee]},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(N){var B=this;this._availableMarkerTypes.splice(0),N.forEach(function(X){if(typeof X=="string"){var ue=B.ALL_MARKER_TYPES.find(function(q){return q.typeName===X});ue!==void 0&&B._availableMarkerTypes.push(ue)}else B._availableMarkerTypes.push(X)})},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(N){this._zoomLevel=N,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(ee.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),ee.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),oe.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},ee.prototype.show=function(){var N=this;this.styles.styleSheetRoot===void 0&&_e.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=_e.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(B){return B(new Gt(N))})},ee.prototype.render=function(){return Fe(this,void 0,void 0,function(){var N;return Ve(this,function(B){switch(B.label){case 0:return this.setCurrentMarker(),(N=new Se).naturalSize=this.renderAtNaturalSize,N.imageType=this.renderImageType,N.imageQuality=this.renderImageQuality,N.markersOnly=this.renderMarkersOnly,N.width=this.renderWidth,N.height=this.renderHeight,[4,N.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return B.sent(),[4,N.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,B.sent()]}})})},ee.prototype.close=function(N){var B=this;if(N===void 0&&(N=!1),this.isOpen){var X=!1;N||this.eventListeners.beforeclose.forEach(function(ue){var q=new Gt(B,!0);ue(q),q.defaultPrevented&&(X=!0)}),X||(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(ue){return ue(new Gt(B))}),this.detachEvents(),this._isOpen=!1)}},ee.prototype.addMarkersToToolbar=function(){for(var N,B=[],X=0;X<arguments.length;X++)B[X]=arguments[X];(N=this._availableMarkerTypes).push.apply(N,B)},ee.prototype.addRenderEventListener=function(N){this.addEventListener("render",function(B){N(B.dataUrl,B.state)})},ee.prototype.removeRenderEventListener=function(N){},ee.prototype.addCloseEventListener=function(N){this.addEventListener("close",function(){N()})},ee.prototype.removeCloseEventListener=function(N){},ee.prototype.setupResizeObserver=function(){var N=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){N.resize(N.target.clientWidth,N.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return N.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},ee.prototype.onPopupTargetResize=function(){var N=1*this.target.clientWidth/this.target.clientHeight,B=this.editorCanvas.clientWidth/N>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*N:this.editorCanvas.clientWidth,X=B<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/N;this.resize(B,X)},ee.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ee.prototype.resize=function(N,B){this._isResizing=!0;var X=N/this.imageWidth,ue=B/this.imageHeight;this.imageWidth=Math.round(N),this.imageHeight=Math.round(B),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(X,ue),this._isResizing=!1},ee.prototype.scaleMarkers=function(N,B){var X,ue=this;this._currentMarker&&this._currentMarker instanceof mt?this._currentMarker.scale(N,B):(X=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(q){q!==ue._currentMarker&&q.scale(N,B)}),X!==void 0&&this.setCurrentMarker(X)},ee.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"},ee.prototype.setTopLeft=function(){var N=this.editingTarget.getBoundingClientRect(),B=this.editorCanvas.getBoundingClientRect();this.left=N.left-B.left,this.top=N.top-B.top},ee.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)},ee.prototype.addDefs=function(){for(var N,B=[],X=0;X<arguments.length;X++)B[X]=arguments[X];this.defs=ye.createDefs(),this.addDefsToImage(),(N=this.defs).append.apply(N,B)},ee.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},ee.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)},ee.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},ee.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},ee.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)},ee.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},ee.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)},ee.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 N=document.createElement("a");N.href="https://markerjs.com/",N.target="_blank",N.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>',N.title="Powered by marker.js",N.style.display="grid",N.style.alignItems="center",N.style.justifyItems="center",N.style.padding="3px",N.style.width="20px",N.style.height="20px",this.logoUI.appendChild(N),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},ee.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")},ee.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"},ee.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ee.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 N=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=N+"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 $(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 Q(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},ee.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ee.prototype.removeMarker=function(N){this.markerImage.removeChild(N.container),this.markers.indexOf(N)>-1&&this.markers.splice(this.markers.indexOf(N),1),N.dispose()},ee.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())},ee.prototype.toolbarButtonClicked=function(N,B){if(N==="marker"&&B!==void 0)this.createNewMarker(B);else if(N==="action")switch(B){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()}},ee.prototype.deleteSelectedMarker=function(){var N=this;if(this._currentMarker!==void 0){var B=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ue){var q=new Rt(N,N._currentMarker,!0);ue(q),q.defaultPrevented&&(B=!0)}),!B){var X=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(ue){return ue(new Rt(N,X))})}}},ee.prototype.clear=function(){var N=this,B=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Ze){var Jt=new Rt(N,void 0,!0);Ze(Jt),Jt.defaultPrevented&&(B=!0)}),!B)){this.setCurrentMarker();for(var X=function(Ze){var Jt=ue.markers[Ze];ue.setCurrentMarker(ue.markers[Ze]),ue._currentMarker.dispose(),ue.markerImage.removeChild(ue._currentMarker.container),ue.markers.splice(ue.markers.indexOf(ue._currentMarker),1),ue.eventListeners.markerdelete.forEach(function(On){return On(new Rt(N,Jt))})},ue=this,q=this.markers.length-1;q>=0;q--)X(q);this.addUndoStep()}},Object.defineProperty(ee.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),ee.prototype.showNotesEditor=function(){var N;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=(N=this._currentMarker.notes)!==null&&N!==void 0?N:"",this.overlayContainer.appendChild(this.notesArea))},ee.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)},ee.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},ee.prototype.addUndoStep=function(){var N=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var B=this.getState(),X=this.undoRedoManager.getLastUndoStep();if(!X||X.width===B.width&&X.height===B.height){var ue=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(B),ue<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(q){return q(new Gt(N))})}else this.undoRedoManager.replaceLastUndoStep(B),this.eventListeners.statechange.forEach(function(q){return q(new Gt(N))})}},ee.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},ee.prototype.undoStep=function(){var N=this,B=this.undoRedoManager.undo();B!==void 0&&(this.restoreState(B),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(X){return X(new Gt(N))}))},ee.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},ee.prototype.redoStep=function(){var N=this,B=this.undoRedoManager.redo();B!==void 0&&(this.restoreState(B),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(X){return X(new Gt(N))}))},ee.prototype.stepZoom=function(){var N=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=N<this.zoomSteps.length-1?this.zoomSteps[N+1]:this.zoomSteps[0]},ee.prototype.panTo=function(N){this.contentDiv.scrollBy({left:this.prevPanPoint.x-N.x,top:this.prevPanPoint.y-N.y}),this.prevPanPoint=N},ee.prototype.startRenderAndClose=function(){return Fe(this,void 0,void 0,function(){var N,B,X=this;return Ve(this,function(ue){switch(ue.label){case 0:return[4,this.render()];case 1:return N=ue.sent(),B=this.getState(),this.eventListeners.render.forEach(function(q){return q(new xt(X,N,B))}),this.close(!0),[2]}})})},ee.prototype.getState=function(N){N===!0&&this.setCurrentMarker();var B={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(X){return B.markers.push(X.getState())}),B},ee.prototype.restoreState=function(N){var B=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);N.markers.forEach(function(X){var ue=B._availableMarkerTypes.find(function(Ze){return Ze.typeName===X.typeName});if(ue!==void 0){var q=B.addNewMarker(ue);q.restoreState(X),B.markers.push(q)}}),N.width&&N.height&&(N.width!==this.imageWidth||N.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/N.width,this.imageHeight/N.height),this.eventListeners.restorestate.forEach(function(X){return X(new Gt(B))})},ee.prototype.addNewMarker=function(N){var B=ye.createGroup();return this.markerImage.appendChild(B),new N(B,this.overlayContainer,this.settings)},ee.prototype.createNewMarker=function(N){var B,X=this;(B=typeof N=="string"?this._availableMarkerTypes.find(function(ue){return ue.typeName===N}):N)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(B),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(B.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(ue){return ue(new Rt(X,X._currentMarker))}))},ee.prototype.markerCreated=function(N){var B=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(N),this.setCurrentMarker(N),N instanceof We&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(We):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(X){return X(new Rt(B,B._currentMarker))})},ee.prototype.colorChanged=function(N){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=N,this.settings.defaultStrokeColor=N)},ee.prototype.fillColorChanged=function(N){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=N)},ee.prototype.markerStateChanged=function(N){var B=this;this.eventListeners.markerchange.forEach(function(X){return X(new Rt(B,N))})},ee.prototype.setCurrentMarker=function(N){var B=this;this._currentMarker!==N&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(X){return X(new Rt(B,B._currentMarker))})),this._currentMarker=N,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(X){return X(new Rt(B,B._currentMarker))}))},ee.prototype.onPointerDown=function(N){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||N.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var B=this.markers.find(function(X){return X.ownsTarget(N.target)});B!==void 0?(this.setCurrentMarker(B),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(N.clientX,N.clientY),N.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:N.clientX,y:N.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(N.clientX,N.clientY))},ee.prototype.onDblClick=function(N){if(this._isFocused||this.focus(),this.mode==="select"){var B=this.markers.find(function(X){return X.ownsTarget(N.target)});B!==void 0&&B!==this._currentMarker&&this.setCurrentMarker(B),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(N.clientX,N.clientY),N.target):this.setCurrentMarker()}},ee.prototype.onPointerMove=function(N){this.touchPoints!==1&&N.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||N.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(N.clientX,N.clientY)):this.zoomLevel>1&&this.panTo({x:N.clientX,y:N.clientY}))},ee.prototype.onPointerUp=function(N){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(N.clientX,N.clientY)),this.isDragging=!1,this.addUndoStep()},ee.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},ee.prototype.onKeyUp=function(N){this._currentMarker===void 0||this.notesArea!==void 0||N.key!=="Delete"&&N.key!=="Backspace"||this.deleteSelectedMarker()},ee.prototype.clientToLocalCoordinates=function(N,B){var X=this.markerImage.getBoundingClientRect();return{x:(N-X.left)/this.zoomLevel,y:(B-X.top)/this.zoomLevel}},ee.prototype.onWindowResize=function(){this.positionUI()},ee.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var N=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=N+"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()},ee.prototype.addLicenseKey=function(N){oe.addKey(N)},ee.prototype.addEventListener=function(N,B){this.eventListeners.addEventListener(N,B)},ee.prototype.removeEventListener=function(N,B){this.eventListeners.removeEventListener(N,B)},ee.prototype.renderState=function(N){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(N),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(ee.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),ee.prototype.focus=function(){var N=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(B){return B(new Gt(N))}))},ee.prototype.blur=function(){var N=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(B){return B(new Gt(N))}))},ee.instanceCounter=0,ee}();/* **********************************
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 Ie=function(ee,N){return(Ie=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(B,X){B.__proto__=X}||function(B,X){for(var ue in X)Object.prototype.hasOwnProperty.call(X,ue)&&(B[ue]=X[ue])})(ee,N)};function Dt(ee,N){if(typeof N!="function"&&N!==null)throw new TypeError("Class extends value "+String(N)+" is not a constructor or null");function B(){this.constructor=ee}Ie(ee,N),ee.prototype=N===null?Object.create(N):(B.prototype=N.prototype,new B)}function ht(ee,N,B,X){return new(B||(B=Promise))(function(ue,q){function Ze(Xn){try{On(X.next(Xn))}catch(un){q(un)}}function Jt(Xn){try{On(X.throw(Xn))}catch(un){q(un)}}function On(Xn){var un;Xn.done?ue(Xn.value):(un=Xn.value,un instanceof B?un:new B(function(nr){nr(un)})).then(Ze,Jt)}On((X=X.apply(ee,N||[])).next())})}function nn(ee,N){var B,X,ue,q,Ze={label:0,sent:function(){if(1&ue[0])throw ue[1];return ue[1]},trys:[],ops:[]};return q={next:Jt(0),throw:Jt(1),return:Jt(2)},typeof Symbol=="function"&&(q[Symbol.iterator]=function(){return this}),q;function Jt(On){return function(Xn){return function(un){if(B)throw new TypeError("Generator is already executing.");for(;Ze;)try{if(B=1,X&&(ue=2&un[0]?X.return:un[0]?X.throw||((ue=X.return)&&ue.call(X),0):X.next)&&!(ue=ue.call(X,un[1])).done)return ue;switch(X=0,ue&&(un=[2&un[0],ue.value]),un[0]){case 0:case 1:ue=un;break;case 4:return Ze.label++,{value:un[1],done:!1};case 5:Ze.label++,X=un[1],un=[0];continue;case 7:un=Ze.ops.pop(),Ze.trys.pop();continue;default:if(!(ue=Ze.trys,(ue=ue.length>0&&ue[ue.length-1])||un[0]!==6&&un[0]!==2)){Ze=0;continue}if(un[0]===3&&(!ue||un[1]>ue[0]&&un[1]<ue[3])){Ze.label=un[1];break}if(un[0]===6&&Ze.label<ue[1]){Ze.label=ue[1],ue=un;break}if(ue&&Ze.label<ue[2]){Ze.label=ue[2],Ze.ops.push(un);break}ue[2]&&Ze.ops.pop(),Ze.trys.pop();continue}un=N.call(ee,Ze)}catch(nr){un=[6,nr],X=0}finally{B=ue=0}if(5&un[0])throw un[1];return{value:un[0]?un[1]:void 0,done:!0}}([On,Xn])}}}var qt=function(){function ee(){}return ee.addKey=function(N){ee.key=N},Object.defineProperty(ee,"isLicensed",{get:function(){return!!ee.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ee.key)},enumerable:!1,configurable:!0}),ee}(),Ke=function(){function ee(){}return ee.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ee.setAttributes=function(N,B){for(var X=0,ue=B;X<ue.length;X++){var q=ue[X],Ze=q[0],Jt=q[1];N.setAttribute(Ze,Jt)}},ee.createRect=function(N,B,X){var ue=document.createElementNS("http://www.w3.org/2000/svg","rect");return ue.setAttribute("width",N.toString()),ue.setAttribute("height",B.toString()),X&&ee.setAttributes(ue,X),ue},ee.createLine=function(N,B,X,ue,q){var Ze=document.createElementNS("http://www.w3.org/2000/svg","line");return Ze.setAttribute("x1",N.toString()),Ze.setAttribute("y1",B.toString()),Ze.setAttribute("x2",X.toString()),Ze.setAttribute("y2",ue.toString()),q&&ee.setAttributes(Ze,q),Ze},ee.createPolygon=function(N,B){var X=document.createElementNS("http://www.w3.org/2000/svg","polygon");return X.setAttribute("points",N),B&&ee.setAttributes(X,B),X},ee.createCircle=function(N,B){var X=document.createElementNS("http://www.w3.org/2000/svg","circle");return X.setAttribute("cx",(N/2).toString()),X.setAttribute("cy",(N/2).toString()),X.setAttribute("r",N.toString()),B&&ee.setAttributes(X,B),X},ee.createEllipse=function(N,B,X){var ue=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ue.setAttribute("cx",(N/2).toString()),ue.setAttribute("cy",(B/2).toString()),ue.setAttribute("rx",(N/2).toString()),ue.setAttribute("ry",(B/2).toString()),X&&ee.setAttributes(ue,X),ue},ee.createGroup=function(N){var B=document.createElementNS("http://www.w3.org/2000/svg","g");return N&&ee.setAttributes(B,N),B},ee.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ee.createMarker=function(N,B,X,ue,q,Ze,Jt){var On=document.createElementNS("http://www.w3.org/2000/svg","marker");return ee.setAttributes(On,[["id",N],["orient",B],["markerWidth",X.toString()],["markerHeight",ue.toString()],["refX",q.toString()],["refY",Ze.toString()]]),On.appendChild(Jt),On},ee.createText=function(N){var B=document.createElementNS("http://www.w3.org/2000/svg","text");return B.setAttribute("x","0"),B.setAttribute("y","0"),N&&ee.setAttributes(B,N),B},ee.createTSpan=function(N,B){var X=document.createElementNS("http://www.w3.org/2000/svg","tspan");return X.textContent=N,B&&ee.setAttributes(X,B),X},ee.createImage=function(N){var B=document.createElementNS("http://www.w3.org/2000/svg","image");return N&&ee.setAttributes(B,N),B},ee.createPoint=function(N,B){var X=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return X.x=N,X.y=B,X},ee.createPath=function(N,B){var X=document.createElementNS("http://www.w3.org/2000/svg","path");return X.setAttribute("d",N),B&&ee.setAttributes(X,B),X},ee.createElement=function(N,B){var X=document.createElementNS("http://www.w3.org/2000/svg",N);return B&&ee.setAttributes(X,B),X},ee.getHollowRectanglePath=function(N,B,X,ue,q,Ze,Jt,On){return"M"+N+","+B+"V"+(B+ue)+"H"+(N+X)+"V"+B+"H"+q+"V"+Ze+"H"+(q+Jt)+"V"+(Ze+On)+"H"+q+"V"+B+"Z"},ee}(),st=function(){function ee(N){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+N+"_"}return Object.defineProperty(ee.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ee.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(ee.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),ee.prototype.addClass=function(N){return this.styleSheet===void 0&&this.addStyleSheet(),N.name=""+this.classNamePrefix+N.localName,this.classes.push(N),this.styleSheet.sheet.insertRule("."+N.name+" {"+N.style+"}",this.styleSheet.sheet.cssRules.length),N},ee.prototype.addRule=function(N){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(N),this.styleSheet.sheet.insertRule(N.selector+" {"+N.style+"}",this.styleSheet.sheet.cssRules.length)},ee.prototype.addStyleSheet=function(){var N;this.styleSheet=document.createElement("style"),((N=this.styleSheetRoot)!==null&&N!==void 0?N:document.head).appendChild(this.styleSheet),this.addRule(new bt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new bt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new bt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Ft("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Ft("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},ee.prototype.removeStyleSheet=function(){var N;this.styleSheet&&(((N=this.styleSheetRoot)!==null&&N!==void 0?N:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ee}(),bt=function(ee,N){this.selector=ee,this.style=N},Ft=function(ee,N){this.localName=ee,this.style=N},$t=function(){function ee(){this.blocks=[],this.display=""}return ee.prototype.addButtonBlock=function(N){N.className=this.blockClassName,N.buttonClassName=this.buttonClassName,N.buttonColorsClassName=this.buttonColorsClassName,N.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(N)},ee.prototype.addElementBlock=function(N){N.className===void 0&&(N.className=this.blockClassName),this.blocks.push(N)},ee.prototype.getUI=function(){var N=document.createElement("div");return N.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,N.style.display=this.display,this.blocks.forEach(function(B){return N.appendChild(B.getUI())}),N},ee}(),gn=function(){function ee(){}return ee.prototype.getUI=function(){var N=document.createElement("div");if(N.className=this.className,this.minWidth!==void 0&&(N.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":N.style.justifyContent="flex-start";break;case"center":N.style.justifyContent="center";break;case"end":N.style.justifyContent="flex-end"}return N.style.whiteSpace="nowrap",N},ee}(),er=function(ee){function N(){var B=ee!==null&&ee.apply(this,arguments)||this;return B.buttons=[],B}return Dt(N,ee),N.prototype.addButton=function(B){B.className=this.buttonClassName,B.colorsClassName=this.buttonColorsClassName,B.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(B)},N.prototype.getUI=function(){var B=ee.prototype.getUI.call(this);return this.buttons.forEach(function(X){return B.appendChild(X.getUI())}),B},N}(gn),Hn=function(){function ee(N,B){this._isActive=!1,this._isHidden=!1,this._icon=N,this.title=B,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(ee.prototype,"icon",{get:function(){return this._icon},set:function(N){this._icon=N,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"isActive",{get:function(){return this._isActive},set:function(N){this._isActive=N,this.adjustClassName()},enumerable:!1,configurable:!0}),ee.prototype.getUI=function(){var N=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 N.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},ee.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,"")))},ee.prototype.hide=function(){this._isHidden=!0},ee}(),yn=function(ee){function N(){var B=ee!==null&&ee.apply(this,arguments)||this;return B.elements=[],B}return Dt(N,ee),N.prototype.addElement=function(B){this.elements.push(B)},N.prototype.getUI=function(){var B=ee.prototype.getUI.call(this);return this.elements.forEach(function(X){return B.appendChild(X)}),B},N}(gn),Sr=function(){function ee(N,B){this.horizontal=N,this.vertical=B}return Object.defineProperty(ee.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),ee.prototype.getVerticalLength=function(N){return N/this.ratio},ee.prototype.getHorizontalLength=function(N){return N*this.ratio},ee}(),_r=function(){function ee(){}return ee.getIcon=function(N,B){if(N>0&&B>0){var X=new Sr(N,B),ue=X.ratio>=1?20:X.getHorizontalLength(20),q=X.ratio<1?20:X.getVerticalLength(20),Ze=document.createElementNS("http://www.w3.org/2000/svg","svg");Ze.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ze.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Ze);var Jt=Ke.createDefs();Ze.appendChild(Jt);var On=Ke.createElement("clipPath",[["id","text-bg-clip"]]);Jt.appendChild(On);var Xn=Ke.createPath(Ke.getHollowRectanglePath((24-ue)/2,(24-q)/2,ue,q,(24-ue)/2+2,(24-q)/2+2,ue-4,q-4));Ze.appendChild(Xn);var un=Ke.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);un.appendChild(Ke.createTSpan(N+":"+B)),Ze.appendChild(un);var nr=un.getBBox();Ke.setAttributes(un,[["x",((24-nr.width)/2).toString()],["y",((24-nr.height)/2-nr.y).toString()]]);var mr=Ke.createPath(Ke.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(nr.width))/2,(24-Math.ceil(nr.height))/2,Math.ceil(nr.width),Math.ceil(nr.height)));return On.appendChild(mr),Ke.setAttributes(Xn,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Ze),Ze.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>'},ee}(),ar=function(ee){function N(B,X,ue){var q=ee.call(this,B,X)||this;return q.isDropdownOpen=!1,q.onClick=q.dropdownButtonClicked,q.dropdownButtons=ue,q}return Dt(N,ee),N.prototype.setupDropdown=function(){var B=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(X){X.className=B.className,X.colorsClassName=B.colorsClassName,B.dropdownBlock.appendChild(X.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},N.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},N.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},N.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},N.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},N.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},N}(Hn),cr=function(){function ee(N,B){this.GRIP_SIZE=10,this.color=N,this.fillColor=B,this.visual=Ke.createGroup(),this.visual.appendChild(Ke.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Ke.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ee.prototype.ownsTarget=function(N){return N===this.visual||N===this.visual.childNodes[0]||N===this.visual.childNodes[1]},ee.prototype.setCenter=function(N,B){this.visual.childNodes.forEach(function(X){return Ke.setAttributes(X,[["cx",N.toString()],["cy",B.toString()]])})},ee}(),Pr=function(){function ee(N,B,X,ue){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=N,this.canvasHeight=B,this.margin=X,this.container=ue,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(ee.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(N){this._aspectRatio=N,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(N){this._isGridVisible=N,this.gridContainer&&Ke.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(N){this._zoomFactor=N,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),ee.prototype.open=function(){var N=this;this.cropShadeElement=Ke.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Ke.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var B=0;B<this.numberOfGridLines;B++)this.horizontalGridLines.push(Ke.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Ke.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(X){return N.gridContainer.appendChild(X)}),this.verticalGridLines.forEach(function(X){return N.gridContainer.appendChild(X)}),this.cropRectElement=Ke.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new cr(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new cr(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new cr(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new cr(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},ee.prototype.setCropRectangle=function(N){this.cropRect=N;var B=Object.assign({},this.cropRect);this.zoomFactor!==1&&(B.width=this.cropRect.width*this.zoomFactor,B.height=this.cropRect.height*this.zoomFactor,B.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-B.width/2,B.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-B.height/2),Ke.setAttributes(this.cropRectElement,[["x",B.x.toString()],["y",B.y.toString()],["width",B.width.toString()],["height",B.height.toString()]]);var X=B.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(q,Ze){var Jt=B.y+X*(Ze+1);Ke.setAttributes(q,[["x1",""+B.x],["y1",""+Jt],["x2",""+(B.x+B.width)],["y2",""+Jt]])});var ue=B.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(q,Ze){var Jt=B.x+ue*(Ze+1);Ke.setAttributes(q,[["x1",""+Jt],["y1",""+B.y],["x2",""+Jt],["y2",""+(B.y+B.height)]])}),Ke.setAttributes(this.cropShadeElement,[["d",Ke.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,B.x,B.y,B.width,B.height)]]),this.topLeftGrip.setCenter(B.x,B.y),this.topRightGrip.setCenter(B.x+B.width,B.y),this.bottomLeftGrip.setCenter(B.x,B.y+B.height),this.bottomRightGrip.setCenter(B.x+B.width,B.y+B.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},ee.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)},ee.prototype.clientToLocalCoordinates=function(N,B){var X=this.container.getBoundingClientRect();return{x:N-X.left+this.margin,y:B-X.top+this.margin}},ee.prototype.onPointerDown=function(N){this.container.setPointerCapture(N.pointerId),this.previousPoint=this.clientToLocalCoordinates(N.clientX,N.clientY),this.cropRectElement===N.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(N.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(N.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(N.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(N.target)&&(this.activeGrip=this.bottomRightGrip)},ee.prototype.onPointerMove=function(N){if(this.isMoving)this.move(this.clientToLocalCoordinates(N.clientX,N.clientY));else if(this.activeGrip){var B=this.clientToLocalCoordinates(N.clientX,N.clientY);this.resize(B)}N.preventDefault()},ee.prototype.onPointerUp=function(N){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(N.pointerId)},ee.prototype.move=function(N){var B=N.x-this.previousPoint.x,X=N.y-this.previousPoint.y;this.zoomFactor!==1&&(B=-B/this.zoomFactor,X=-X/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+B),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+X),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=N},ee.prototype.resize=function(N){var B=Object.assign({},this.cropRect),X=N.x-this.previousPoint.x,ue=N.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:B.x+X<this.margin&&(X=this.margin-B.x),B.x+=X,B.width=this.cropRect.x+this.cropRect.width-B.x;break;case this.bottomRightGrip:case this.topRightGrip:B.width+X>this.canvasWidth*this.zoomFactor&&(X=this.canvasWidth*this.zoomFactor-B.width),B.width+=X}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(B.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(X),B.height=this.aspectRatio.getVerticalLength(B.width)):(B.y+=ue,B.height=this.cropRect.y+this.cropRect.height-B.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?B.height=this.aspectRatio.getVerticalLength(B.width):B.height+=ue}B.width<10&&(B.x=this.cropRect.x,B.width=10),B.height<10&&(B.y=this.cropRect.y,B.height=10),this.previousPoint=N,B.x>=this.margin&&B.y>=this.margin&&B.x-this.margin+B.width<=this.canvasWidth&&B.y-this.margin+B.height<=this.canvasHeight&&(this.cropRect=B,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},ee.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var N=this.cropRect.x+this.cropRect.width/2,B=this.cropRect.y+this.cropRect.height/2,X=this.aspectRatio.getHorizontalLength(this.cropRect.height),ue=this.aspectRatio.getVerticalLength(this.cropRect.width);X/this.canvasWidth<ue/this.canvasHeight?this.cropRect.width=X:this.cropRect.height=ue,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=N-this.cropRect.width/2,this.cropRect.y=B-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)}},ee.prototype.getRescaledRect=function(N,B,X,ue,q,Ze){var Jt=X/N,On=ue/B;return{x:(q.x-Ze)*Jt+Ze,y:(q.y-Ze)*On+Ze,width:q.width*Jt,height:q.height*On}},ee.prototype.scaleCanvas=function(N,B){var X=this.getRescaledRect(this.canvasWidth,this.canvasHeight,N,B,this.cropRect,this.margin);this.canvasWidth=N,this.canvasHeight=B,this.onCropChange&&this.onCropChange(X),this.setCropRectangle(X)},ee}(),Qr=function(){function ee(N){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=N,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(ee.prototype,"angle",{get:function(){return this._angle},set:function(N){this._angle=N,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),ee.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},ee.prototype.onPointerDown=function(N){this.controlContainer.setPointerCapture(N.pointerId),this.isDragging=!0,this.previousPoint={x:N.clientX,y:N.clientY}},ee.prototype.onPointerMove=function(N){this.isDragging&&(this.onAngleChange&&this.onAngleChange((N.clientX-this.previousPoint.x)/5),this.previousPoint.x=N.clientX)},ee.prototype.onPointerUp=function(N){this.isDragging&&this.onAngleChange&&this.onAngleChange((N.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(N.pointerId)},ee.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var N=this.angleLabelText.getBBox();Ke.setAttributes(this.angleLabelElement,[["x",((this.width-N.width)/2).toString()],["y",(this.height/2).toString()]])}},ee.prototype.positionScaleShape=function(){if(this.scaleShape){var N=this.scaleShape.transform.baseVal.getItem(0);N.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(N,0)}},ee.prototype.getVisual=function(){var N=document.createElementNS("http://www.w3.org/2000/svg","svg");N.setAttribute("xmlns","http://www.w3.org/2000/svg"),N.setAttribute("width",this.width+"px"),N.setAttribute("height",this.height+"px"),N.setAttribute("viewBox","0 0 "+this.width+" "+this.height),N.style.flexShrink="0",document.body.appendChild(N);for(var B="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,X=1;X<=this.width/5+10;X++){var ue=X%5==0?this.height/3:this.height/6;B+="h4v"+-ue+"h1v"+ue}B+="v1H0Z",this.scaleShape=Ke.createPath(B);var q=Ke.createTransform();this.scaleShape.transform.baseVal.appendItem(q),N.appendChild(this.scaleShape),this.angleLabelElement=Ke.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Ke.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Ze=Ke.createTSpan("");return Ze.innerHTML="&deg;",this.angleLabelElement.appendChild(Ze),N.appendChild(this.angleLabelElement),document.body.removeChild(N),N},ee}(),ca=function(){function ee(){this.naturalSize=!1,this.imageType="image/png"}return ee.prototype.rasterize=function(N,B,X,ue,q,Ze,Jt){var On=this;return new Promise(function(Xn){var un=document.createElement("canvas");un.width=N.width.baseVal.value-2*ue,un.height=N.height.baseVal.value-2*ue;var nr=1,mr=1;On.naturalSize===!0?(nr=B.naturalWidth/(N.width.baseVal.value-2*ue)/Ze,mr=B.naturalHeight/(N.height.baseVal.value-2*ue)/Jt,un.width=B.naturalWidth/Ze,un.height=B.naturalHeight/Jt):On.width!==void 0&&On.height!==void 0&&(nr=On.width/X.width,mr=On.height/X.height,un.width*=nr,un.height*=mr);var Kr=un.getContext("2d");Kr.translate(un.width/2,un.height/2),Kr.rotate(q*Math.PI/180),Kr.scale(Ze,Jt),Kr.translate(-un.width/2,-un.height/2),Kr.drawImage(B,0,0,un.width,un.height);var ma=document.createElement("canvas");ma.width=X.width*nr,ma.height=X.height*mr,ma.getContext("2d").putImageData(Kr.getImageData((X.x-ue)*nr,(X.y-ue)*mr,X.width*nr,X.height*mr),0,0),Xn(ma.toDataURL(On.imageType,On.imageQuality))})},ee}(),hn=function(){function ee(N){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=ee.instanceCounter++,this.styles=new st(this.instanceNo),this.target=N,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(ee.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(N){this._zoomToCropEnabled=N,N?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(N){this._isGridVisible=N,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"gridLines",{get:function(){return this._gridLines},set:function(N){this._gridLines=N,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(N){this._rotationAngle=N,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"aspectRatio",{get:function(){var N;return(N=this._aspectRatio)!==null&&N!==void 0?N:this.aspectRatios[0]},set:function(N){this._aspectRatio=N},enumerable:!1,configurable:!0}),ee.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},ee.prototype.show=function(){this.showUI(),this.open()},ee.prototype.close=function(N){N===void 0&&(N=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),N||this.closeEventListeners.forEach(function(B){return B()}),this._isOpen=!1)},ee.prototype.addRenderEventListener=function(N){this.renderEventListeners.push(N)},ee.prototype.removeRenderEventListener=function(N){this.renderEventListeners.indexOf(N)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(N),1)},ee.prototype.addCloseEventListener=function(N){this.closeEventListeners.push(N)},ee.prototype.removeCloseEventListener=function(N){this.closeEventListeners.indexOf(N)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(N),1)},ee.prototype.setupResizeObserver=function(){var N=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){N.resize(N.target.clientWidth,N.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))},ee.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var N=1*this.target.clientWidth/this.target.clientHeight,B=this.contentDiv.clientWidth/N>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*N:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,X=B+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/N;this.resize(B,X)}},ee.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ee.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",Ke.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},ee.prototype.resize=function(N,B){this.imageWidth=Math.round(N),this.imageHeight=Math.round(B),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()},ee.prototype.setEditingTarget=function(){var N=document.createElement("canvas");N.width=this.target.naturalWidth,N.height=this.target.naturalHeight,N.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var B=N.toDataURL();Ke.setAttributes(this.editingTarget,[["href",B]]),this.setEditingTargetSize()},ee.prototype.setTopLeft=function(){var N=this.target.getBoundingClientRect(),B=this.editorCanvas.getBoundingClientRect();this.left=N.left-B.left-this.CANVAS_MARGIN,this.top=N.top-B.top-this.CANVAS_MARGIN},ee.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=Ke.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Ke.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Ke.createGroup(),this.editingTargetRotationScaleContainer=Ke.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var N=Ke.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(N);var B=Ke.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(B),this.editingTargetContainer=Ke.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)},ee.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},ee.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Ke.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Pr(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()},ee.prototype.zoomToCrop=function(){if(this.cropRect){var N=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,B=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=N+"px "+B+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-N+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-B+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},ee.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)},ee.prototype.cropRectChanged=function(N){this.cropRect=N,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},ee.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},ee.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"},ee.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ee.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 N=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,B=this.target.offsetTop>N+this.CANVAS_MARGIN?this.target.offsetTop-(N+this.CANVAS_MARGIN):0;this.coverDiv.style.top=B+"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},ee.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},ee.prototype.addTopToolbar=function(){var N=this;this.topToolbar=new $t,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 B=new er;B.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(B);var X=[];this.aspectRatios.forEach(function(mr){var Kr=new Hn(_r.getIcon(mr.horizontal,mr.vertical),mr.horizontal===0&&mr.vertical===0?"FREE":mr.horizontal+":"+mr.vertical);Kr.onClick=function(){return N.ratioButtonClicked(mr)},X.push(Kr)}),this.aspectRatioButton=new ar(_r.getIcon(0,0),"Aspect ratio",X),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,B.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ue=new Hn('<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");ue.isActive=this.isGridVisible,ue.onClick=function(){N.isGridVisible=!N.isGridVisible,ue.isActive=N.isGridVisible},B.addButton(ue);var q=new Hn('<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(q.isActive=this.zoomToCropEnabled,q.onClick=function(){N.zoomToCropEnabled=!N.zoomToCropEnabled,q.isActive=N.zoomToCropEnabled},B.addButton(q),!qt.isLicensed){var Ze=new yn;this.topToolbar.addElementBlock(Ze);var Jt=document.createElement("div");Jt.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var On=document.createElement("a");On.style.color="currentColor",On.href="https://markerjs.com/products/cropro",On.target="_blank",On.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>',Jt.appendChild(On),Ze.addElement(Jt)}var Xn=new er;Xn.minWidth=3*this.toolbarHeight+"px",Xn.contentAlign="end",this.topToolbar.addButtonBlock(Xn);var un=new Hn('<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");un.onClick=this.startRenderAndClose,Xn.addButton(un),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(un.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var nr=new Hn('<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");nr.onClick=this.close,Xn.addButton(nr),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(nr.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},ee.prototype.addBottomToolbar=function(){var N=this;this.bottomToolbar=new $t,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 B=new er;B.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(B);var X=new Hn('<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");X.onClick=this.rotateLeftButtonClicked,B.addButton(X);var ue=new Hn('<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");ue.onClick=this.rotateRightButtonClicked,B.addButton(ue);var q=new yn;q.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(q),this.straightener=new Qr("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(Xn){N.rotateBy(Xn),N.straightener.angle=N.rotationAngle},q.addElement(this.straightener.getUI());var Ze=new er;Ze.minWidth=2*this.toolbarHeight+"px",Ze.contentAlign="end",this.bottomToolbar.addButtonBlock(Ze);var Jt=new Hn('<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");Jt.onClick=this.flipHorizontallyButtonClicked,Ze.addButton(Jt);var On=new Hn('<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");On.onClick=this.flipVerticallyButtonClicked,Ze.addButton(On)},ee.prototype.ratioButtonClicked=function(N){this.aspectRatio=N,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},ee.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=_r.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},ee.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Sr(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},ee.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ee.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},ee.prototype.restoreState=function(N){if(N){var B=this.cropLayer.getRescaledRect(N.width,N.height,this.imageWidth,this.imageHeight,N.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(B),this.cropRectChanged(B),this.flippedHorizontally=N.flippedHorizontally,this.flippedVertically=N.flippedVertically,this.applyFlip(),this.rotationAngle=N.rotationAngle,this.applyRotation()}},ee.prototype.clientToLocalCoordinates=function(N,B){var X=this.cropImage.getBoundingClientRect();return{x:N-X.left,y:B-X.top}},ee.prototype.onWindowResize=function(){this.positionUI()},ee.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var N=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=N+"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()},ee.prototype.rotateLeftButtonClicked=function(){var N=this.rotationAngle-90;this.rotationAngle%90!=0&&(N+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(N)},ee.prototype.rotateRightButtonClicked=function(){var N=this.rotationAngle+90;this.rotationAngle%90!=0&&(N-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(N)},ee.prototype.rotateTo=function(N){N=(N=N>180?N-360:N)<=-180?N+360:N,this.rotationAngle=N,this.applyRotation()},ee.prototype.rotateBy=function(N){this.rotateTo((this.rotationAngle+N)%360)},ee.prototype.applyRotation=function(){var N=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var B=this.editingTargetRotationContainer.transform.baseVal.getItem(0);B.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(B,0);var X=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/X.width,this.imageHeight/X.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=N},ee.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},ee.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},ee.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},ee.prototype.startRenderAndClose=function(){return ht(this,void 0,void 0,function(){var N,B;return nn(this,function(X){switch(X.label){case 0:return[4,this.render()];case 1:return N=X.sent(),B=this.getState(),this.renderEventListeners.forEach(function(ue){return ue(N,B)}),this.close(!0),[2]}})})},ee.prototype.render=function(){return ht(this,void 0,void 0,function(){var N;return nn(this,function(B){switch(B.label){case 0:return(N=new ca).naturalSize=this.renderAtNaturalSize,N.imageType=this.renderImageType,N.imageQuality=this.renderImageQuality,N.width=this.renderWidth,N.height=this.renderHeight,this.unzoomFromCrop(),Ke.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,N.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 B.sent(),[4,N.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,B.sent()]}})})},ee.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ft("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 Ft("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ft("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var N=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ft("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*N)+`px;
height: `+(this.toolbarHeight-2*N)+`px;
padding: `+N+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ft("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ft("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new bt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new bt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Ft("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 Ft("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Ft("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 Ft("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*N)+`px;
padding: `+N+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Ft("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},ee.instanceCounter=0,ee}(),ir=T("8hTe"),va=T.n(ir),Pa=/<pre[^>]*>/g;function sa(ee){var N=document.createElement("div");return N.innerHTML=ee,N.childNodes.length===0?"":N.childNodes[0].nodeValue}var la=ve.a=function(ee){var N=ee.value,B=N===void 0?"":N,X=ee.edit,ue=X===void 0?!1:X,q=ee.className,Ze=ee.showTextOnly,Jt=ee.showLines,On=ee.replaces,Xn=ee.zoomImg,un=ee.hasMask,nr=ee.style,mr=nr===void 0?{}:nr,Kr=ee.stylesPrev,ma=Kr===void 0?{}:Kr,da=String(B),Zr=Object(A.useRef)(),za=Object(A.useRef)(),oi=Object(A.useState)(""),ua=Object(W.a)(oi,2),Na=ua[0],ti=ua[1],Ga=Object(A.useState)("office"),ba=Object(W.a)(Ga,2),zn=ba[0],bn=ba[1],kn=function(){var et=new hn(za.current);et.displayMode="popup",et.addRenderEventListener(function(){var it=Object(I.a)(r.a.mark(function Ae(ze){var yt;return r.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Zr.current.style.display="none",Tt.next=3,Object(Ne.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ze}});case 3:yt=Tt.sent,yt!=null&&yt.id&&On(za.current.getAttribute("src").replace(Y.a.API_SERVER,""),"/api/attachments/".concat(yt==null?void 0:yt.id,"?type=").concat(yt.content_type));case 5:case"end":return Tt.stop()}},Ae)}));return function(Ae){return it.apply(this,arguments)}}()),et.show()},Wn=function(){var et=new be(za.current);et.settings.displayMode="popup",et.addEventListener("render",function(){var it=Object(I.a)(r.a.mark(function Ae(ze){var yt;return r.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:if(Zr.current.style.display="none",!za.current){Tt.next=6;break}return Tt.next=4,Object(Ne.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ze.dataUrl}});case 4:yt=Tt.sent,yt!=null&&yt.id&&On(za.current.getAttribute("src").replace(Y.a.API_SERVER,""),"/api/attachments/".concat(yt==null?void 0:yt.id,"?type=").concat(yt.content_type));case 6:case"end":return Tt.stop()}},Ae)}));return function(Ae){return it.apply(this,arguments)}}()),et.show(),window.markerArea=et},dr=Object(A.useMemo)(function(){Zr.current&&(Zr.current.style.zIndex=-1);try{var Ye=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,et=/\"\/api\/attachments\/|\"\/attachments\/download\//g,it=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;da=da.replace(Ye,"("+Y.a.API_SERVER+"/api/attachments/").replace(et,'"'+Y.a.API_SERVER+"/api/attachments/").replace(it,'"'+Y.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(en){}var Ae=U(da),ze=y();if(da.match(/\[TOC\]/)&&(Ae=Ae.replace("<p>[TOC]</p>",L()),D()),Ae=Ae.replace(/(__special_katext_id_\d+__)/g,function(en,Tt){var vt=ze[Tt],ct=vt.type,St=vt.expression;return Object(re.renderToString)(sa(St)||"",{displayMode:ct==="block",throwOnError:!1,output:"html"})}),Ae=Ae.replace(/▁/g,"\u2581\u2581\u2581"),x(),Ze){var yt=document.createElement("div");return yt.innerHTML=Ae,yt.innerText}return setTimeout(function(){return $e()},500),Ae},[da]),ne=Object(A.useRef)();w.WebkitLineClamp=Jt,Jt&&(mr=Object(M.a)(Object(M.a)({},mr),w));function Re(Ye){var et=Ye.target;if(et.tagName.toUpperCase()==="IMG"){if(Xn){var it=et.getAttribute("src");ti(it),bn("image")}}else if(et.tagName.toUpperCase()==="A"){var Ae=et.getAttribute("href");if(Ae.indexOf("office")>-1)Ye.preventDefault(),ti(Ae),bn("office");else if(Ae.indexOf("application/pdf")>-1)Ye.preventDefault(),ti(Ae),bn("pdf");else if(Ae.indexOf("text/html")>-1)Ye.preventDefault(),ti(Ae),bn("html");else if(Ae.startsWith("#")){Ye.preventDefault();var ze=document.getElementById(Ae.replace("#",""));ze&&ze.scrollIntoView(!0)}}}var $e=function(){var et,it=(et=ne.current)===null||et===void 0?void 0:et.querySelectorAll("video");it==null||it.forEach(function(Ae){if(Ae.oncontextmenu=function(){return!1},Ae.src.indexOf(".m3u8")>-1&&!Ae.canPlayType("application/vnd.apple.mpegurl")){if(z.a.isSupported()){var ze=new z.a;ze.loadSource(Ae.src),ze.attachMedia(Ae)}}})};Object(A.useEffect)(function(){if(ne.current&&dr&&(dr.match(Pa)&&window.PR.prettyPrint()),ne.current)return ne.current.addEventListener("click",Re),function(){ne.current.removeEventListener("click",Re),x(),D()}},[dr,ne.current,Re]);var Be=function(et){if(!ue)return;et.target.nodeName==="IMG"?(Zr.current.style.zIndex=1,Zr.current.style.display="flex",Zr.current.style.width=et.target.clientWidth+"px",Zr.current.style.height=et.target.clientHeight+"px",Zr.current.style.top=et.target.offsetTop+"px",Zr.current.style.left=et.target.offsetLeft+"px",za.current.src=et.target.getAttribute("src")):Zr.current.style.display="none"};return v.a.createElement("div",{style:{position:"relative"}},v.a.createElement("div",{ref:ne,style:Object(M.a)({},mr),className:"".concat(q||""," markdown-body ").concat(va.a.mdBody),onMouseOver:Be,dangerouslySetInnerHTML:{__html:dr}}),v.a.createElement("div",{ref:Zr,className:va.a.button},v.a.createElement(V.a,null,v.a.createElement(G.a,{onClick:function(){return kn()}},"\u88C1\u526A"),v.a.createElement(G.a,{onClick:function(){return Wn()}},"\u7F16\u8F91"))),v.a.createElement("img",{ref:za,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),v.a.createElement(le.a,{close:!0,data:Na,type:Na!=null&&Na.length?zn:"",style:Object(M.a)({},ma),onClose:function(){return ti("")}}))}},"9VGf":function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return j});var Z=T("q1tI"),V=T.n(Z);function j(G,M){var I=Object(Z.useRef)();Object(Z.useEffect)(function(){I.current=G}),Object(Z.useEffect)(function(){function W(){I.current()}if(M!==null){var C=setInterval(W,M);return function(){return clearInterval(C)}}},[M])}},AHFd:function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return C});var Z=T("giR+"),V=T("fyUT"),j=T("OaEy"),G=T("2fM7"),M=T("tJVT"),I=T("q1tI"),W=T.n(I),C;(function(A){A[A.Number=1]="Number",A[A.Percent=2]="Percent"})(C||(C={}));var r=function(v){var f=v.value,p=v.onChange,l=v.disabled,o=v.hidePercentOption,s=o===void 0?!1:o,t=Object(I.useMemo)(function(){return s?C.Number:C.Percent},[s]),u=Object(I.useState)(t),a=Object(M.a)(u,2),i=a[0],D=a[1],w=Object(I.useCallback)(function(L){return i===C.Number?"".concat(L,"\u5206"):"".concat(L,"%")},[i]),S=Object(I.useCallback)(function(L){if(i===C.Number){var P=L.replace("\u5206","");return isNaN(parseInt(P,10))?0:P}else{var _=L.replace("%","");return _}},[i]);return Object(I.useEffect)(function(){D(f.type)},[f]),W.a.createElement("div",{style:{display:"inline-block"}},W.a.createElement(G.a,{onChange:function(P){D(P),p({type:P,inputValue:P===C.Number?5:20})},value:i||t,style:{width:100},options:s?[{label:"\u5206\u503C",value:C.Number}]:[{label:"\u767E\u5206\u6BD4",value:C.Percent},{label:"\u5206\u503C",value:C.Number}],disabled:l}),W.a.createElement(V.a,{disabled:l,value:f.inputValue,formatter:w,parser:S,max:i===C.Percent?100:Number.MAX_SAFE_INTEGER,min:0,precision:0,onChange:function(P){p({type:i,inputValue:P})}}))};ve.b=r},BU3w:function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return I});var Z=T("MNnm"),V="rc-util-key";function j(W){if(W.attachTo)return W.attachTo;var C=document.querySelector("head");return C||document.body}function G(W){var C,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(Z.a)())return null;var A=document.createElement("style");if((C=r.csp)===null||C===void 0?void 0:C.nonce){var v;A.nonce=(v=r.csp)===null||v===void 0?void 0:v.nonce}A.innerHTML=W;var f=j(r),p=f.firstChild;return r.prepend&&f.prepend?f.prepend(A):r.prepend&&p?f.insertBefore(A,p):f.appendChild(A),A}var M=new Map;function I(W,C){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},A=j(r);if(!M.has(A)){var v=G("",r),f=v.parentNode;M.set(A,f),f.removeChild(v)}var p=Array.from(M.get(A).children).find(function(u){return u.tagName==="STYLE"&&u[V]===C});if(p){var l,o;if(((l=r.csp)===null||l===void 0?void 0:l.nonce)&&p.nonce!==((o=r.csp)===null||o===void 0?void 0:o.nonce)){var s;p.nonce=(s=r.csp)===null||s===void 0?void 0:s.nonce}return p.innerHTML!==W&&(p.innerHTML=W),p}var t=G(W,r);return t[V]=C,t}},Bd2K:function(Bt,ve,T){(function(Z){Z(T("VrN/"),T("osHv"))})(function(Z){Z.defineOption("autoCloseTags",!1,function(r,A,v){if(v!=Z.Init&&v&&r.removeKeyMap("autoCloseTags"),!A)return;var f={name:"autoCloseTags"};(typeof A!="object"||A.whenClosing!==!1)&&(f["'/'"]=function(p){return I(p)}),(typeof A!="object"||A.whenOpening!==!1)&&(f["'>'"]=function(p){return G(p)}),r.addKeyMap(f)});var V=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],j=["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 G(r){if(r.getOption("disableInput"))return Z.Pass;for(var A=r.listSelections(),v=[],f=r.getOption("autoCloseTags"),p=0;p<A.length;p++){if(!A[p].empty())return Z.Pass;var l=A[p].head,o=r.getTokenAt(l),s=Z.innerMode(r.getMode(),o.state),t=s.state,u=s.mode.xmlCurrentTag&&s.mode.xmlCurrentTag(t),a=u&&u.name;if(!a)return Z.Pass;var i=s.mode.configuration=="html",D=typeof f=="object"&&f.dontCloseTags||i&&V,w=typeof f=="object"&&f.indentTags||i&&j;o.end>l.ch&&(a=a.slice(0,a.length-o.end+l.ch));var S=a.toLowerCase();if(!a||o.type=="string"&&(o.end!=l.ch||!/[\"\']/.test(o.string.charAt(o.string.length-1))||o.string.length==1)||o.type=="tag"&&u.close||o.string.indexOf("/")==l.ch-o.start-1||D&&W(D,S)>-1||C(r,s.mode.xmlCurrentContext&&s.mode.xmlCurrentContext(t)||[],a,l,!0))return Z.Pass;var L=typeof f=="object"&&f.emptyTags;if(L&&W(L,a)>-1){v[p]={text:"/>",newPos:Z.Pos(l.line,l.ch+2)};continue}var P=w&&W(w,S)>-1;v[p]={indent:P,text:">"+(P?`
`:"")+"</"+a+">",newPos:P?Z.Pos(l.line+1,0):Z.Pos(l.line,l.ch+1)}}for(var _=typeof f=="object"&&f.dontIndentOnAutoClose,p=A.length-1;p>=0;p--){var b=v[p];r.replaceRange(b.text,A[p].head,A[p].anchor,"+insert");var g=r.listSelections().slice(0);g[p]={head:b.newPos,anchor:b.newPos},r.setSelections(g),!_&&b.indent&&(r.indentLine(b.newPos.line,null,!0),r.indentLine(b.newPos.line+1,null,!0))}}function M(r,A){for(var v=r.listSelections(),f=[],p=A?"/":"</",l=r.getOption("autoCloseTags"),o=typeof l=="object"&&l.dontIndentOnSlash,s=0;s<v.length;s++){if(!v[s].empty())return Z.Pass;var t=v[s].head,u=r.getTokenAt(t),a=Z.innerMode(r.getMode(),u.state),i=a.state;if(A&&(u.type=="string"||u.string.charAt(0)!="<"||u.start!=t.ch-1))return Z.Pass;var D,w=a.mode.name!="xml"&&r.getMode().name=="htmlmixed";if(w&&a.mode.name=="javascript")D=p+"script";else if(w&&a.mode.name=="css")D=p+"style";else{var S=a.mode.xmlCurrentContext&&a.mode.xmlCurrentContext(i);if(!S||S.length&&C(r,S,S[S.length-1],t))return Z.Pass;D=p+S[S.length-1]}r.getLine(t.line).charAt(u.end)!=">"&&(D+=">"),f[s]=D}if(r.replaceSelections(f),v=r.listSelections(),!o)for(var s=0;s<v.length;s++)(s==v.length-1||v[s].head.line<v[s+1].head.line)&&r.indentLine(v[s].head.line)}function I(r){return r.getOption("disableInput")?Z.Pass:M(r,!0)}Z.commands.closeTag=function(r){return M(r)};function W(r,A){if(r.indexOf)return r.indexOf(A);for(var v=0,f=r.length;v<f;++v)if(r[v]==A)return v;return-1}function C(r,A,v,f,p){if(!Z.scanForClosingTag)return!1;var l=Math.min(r.lastLine()+1,f.line+500),o=Z.scanForClosingTag(r,f,null,l);if(!o||o.tag!=v)return!1;for(var s=p?1:0,t=A.length-1;t>=0&&A[t]==v;t--)++s;f=o.to;for(var t=1;t<s;t++){var u=Z.scanForClosingTag(r,f,null,l);if(!u||u.tag!=v)return!1;f=u.to}return!0}})},BdwD:function(Bt,ve,T){"use strict";var Z=T("+L6B"),V=T("2/Rp"),j=T("0Owb"),G=T("k1fw"),M=T("q1tI"),I=T.n(M),W=T("FOrL"),C=T.n(W),r=function(v){var f=v.buttonProps,p=f===void 0?{}:f,l=v.styles,o=l===void 0?{}:l,s=v.customText,t=v.ButtonText,u=v.ButtonClick,a=v.Buttonclass,i=v.ButtonTwo;return I.a.createElement("section",{className:"tc animated fadeIn",style:Object(G.a)(Object(G.a)({},{color:"#999",margin:"200px auto"}),o)},I.a.createElement("img",{src:C.a}),I.a.createElement("p",{className:"mt20 font14"},s||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),t&&I.a.createElement(V.a,Object(j.a)({className:a,onClick:u},p),t),i&&i)};ve.a=r},BjJ7:function(Bt,ve,T){"use strict";T.d(ve,"d",function(){return V}),T.d(ve,"c",function(){return j}),T.d(ve,"e",function(){return G}),T.d(ve,"b",function(){return M}),T.d(ve,"a",function(){return W});var Z=T("m3rI");function V(C){var r=!0;if(C.length>0){for(var A=0;A<C.length;A++)if(C[A].compile_success==0||!C[A].compile_success){r=!1;break}}else r=!1;return r}function j(C){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",A=[],v=0;v<C.length;v++){var f=C[v],p=r?"".concat(r,"/").concat(f.name):"".concat(f.name);A.push({title:f.name,isLeaf:!(f.type==="tree"),key:p})}return A}function G(C,r,A){for(var v=0;v<C.length;v++){var f=C[v];if(f.key===r){f.children=A;break}f.children&&G(f.children,r,A)}return C}function M(C,r,A){var v;return function(){var f=this,p=arguments,l=function(){v=null,A||C.apply(f,p)},o=A&&!v;clearTimeout(v),v=setTimeout(l,r),o&&C.apply(f,p)}}var I=!0,W=Z.a.API_SERVER},"C+DQ":function(Bt,ve,T){},"C/vA":function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return Z});function Z(V){const j=this;let G=!1,M;return function(){return G||(G=!0,M=V.apply(j,arguments)),M}}},"Cg/j":function(Bt,ve,T){"use strict";T.d(ve,"b",function(){return Z}),T.d(ve,"a",function(){return V}),T.d(ve,"c",function(){return G}),T.d(ve,"d",function(){return M});var Z;(function(I){I.serviceIds=new Map,I.DI_TARGET="$di$target",I.DI_DEPENDENCIES="$di$dependencies";function W(C){return C[I.DI_DEPENDENCIES]||[]}I.getServiceDependencies=W})(Z||(Z={}));const V=G("instantiationService");function j(I,W,C,r){W[Z.DI_TARGET]===W?W[Z.DI_DEPENDENCIES].push({id:I,index:C,optional:r}):(W[Z.DI_DEPENDENCIES]=[{id:I,index:C,optional:r}],W[Z.DI_TARGET]=W)}function G(I){if(Z.serviceIds.has(I))return Z.serviceIds.get(I);const W=function(C,r,A){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");j(W,C,A,!1)};return W.toString=()=>I,Z.serviceIds.set(I,W),W}function M(I){return function(W,C,r){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");j(I,W,r,!0)}}},DlQD:function(Bt,ve,T){(function(Z,V){Bt.exports=V()})(this,function(){"use strict";function Z(We,De){for(var Le=0;Le<De.length;Le++){var de=De[Le];de.enumerable=de.enumerable||!1,de.configurable=!0,"value"in de&&(de.writable=!0),Object.defineProperty(We,de.key,de)}}function V(We,De,Le){return De&&Z(We.prototype,De),Le&&Z(We,Le),We}function j(We,De){if(!We)return;if(typeof We=="string")return G(We,De);var Le=Object.prototype.toString.call(We).slice(8,-1);if(Le==="Object"&&We.constructor&&(Le=We.constructor.name),Le==="Map"||Le==="Set")return Array.from(We);if(Le==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Le))return G(We,De)}function G(We,De){(De==null||De>We.length)&&(De=We.length);for(var Le=0,de=new Array(De);Le<De;Le++)de[Le]=We[Le];return de}function M(We,De){var Le;if(typeof Symbol=="undefined"||We[Symbol.iterator]==null){if(Array.isArray(We)||(Le=j(We))||De&&We&&typeof We.length=="number"){Le&&(We=Le);var de=0;return function(){return de>=We.length?{done:!0}:{done:!1,value:We[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 Le=We[Symbol.iterator](),Le.next.bind(Le)}function I(We,De){return De={exports:{}},We(De,De.exports),De.exports}var W=I(function(We){function De(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function Le(de){We.exports.defaults=de}We.exports={defaults:De(),getDefaults:De,changeDefaults:Le}}),C=W.defaults,r=W.getDefaults,A=W.changeDefaults,v=/[&<>"']/,f=/[&<>"']/g,p=/[<>"']|&(?!#?\w+;)/,l=/[<>"']|&(?!#?\w+;)/g,o={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},s=function(De){return o[De]};function t(We,De){if(De){if(v.test(We))return We.replace(f,s)}else if(p.test(We))return We.replace(l,s);return We}var u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function a(We){return We.replace(u,function(De,Le){return Le=Le.toLowerCase(),Le==="colon"?":":Le.charAt(0)==="#"?Le.charAt(1)==="x"?String.fromCharCode(parseInt(Le.substring(2),16)):String.fromCharCode(+Le.substring(1)):""})}var i=/(^|[^\[])\^/g;function D(We,De){We=We.source||We,De=De||"";var Le={replace:function(fe,Ee){return Ee=Ee.source||Ee,Ee=Ee.replace(i,"$1"),We=We.replace(fe,Ee),Le},getRegex:function(){return new RegExp(We,De)}};return Le}var w=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function L(We,De,Le){if(We){var de;try{de=decodeURIComponent(a(Le)).replace(w,"").toLowerCase()}catch(fe){return null}if(de.indexOf("javascript:")===0||de.indexOf("vbscript:")===0||de.indexOf("data:")===0)return null}De&&!S.test(Le)&&(Le=m(De,Le));try{Le=encodeURI(Le).replace(/%25/g,"%")}catch(fe){return null}return Le}var P={},_=/^[^:]+:\/*[^/]*$/,b=/^([^:]+:)[\s\S]*$/,g=/^([^:]+:\/*[^/]*)[\s\S]*$/;function m(We,De){P[" "+We]||(_.test(We)?P[" "+We]=We+"/":P[" "+We]=H(We,"/",!0)),We=P[" "+We];var Le=We.indexOf(":")===-1;return De.substring(0,2)==="//"?Le?De:We.replace(b,"$1")+De:De.charAt(0)==="/"?Le?De:We.replace(g,"$1")+De:We+De}var y={exec:function(){}};function x(We){for(var De=1,Le,de;De<arguments.length;De++){Le=arguments[De];for(de in Le)Object.prototype.hasOwnProperty.call(Le,de)&&(We[de]=Le[de])}return We}function O(We,De){var Le=We.replace(/\|/g,function(Ee,Pe,Ue){for(var lt=!1,Ot=Pe;--Ot>=0&&Ue[Ot]==="\\";)lt=!lt;return lt?"|":" |"}),de=Le.split(/ \|/),fe=0;if(de.length>De)de.splice(De);else for(;de.length<De;)de.push("");for(;fe<de.length;fe++)de[fe]=de[fe].trim().replace(/\\\|/g,"|");return de}function H(We,De,Le){var de=We.length;if(de===0)return"";for(var fe=0;fe<de;){var Ee=We.charAt(de-fe-1);if(Ee===De&&!Le)fe++;else if(Ee!==De&&Le)fe++;else break}return We.substr(0,de-fe)}function F(We,De){if(We.indexOf(De[1])===-1)return-1;for(var Le=We.length,de=0,fe=0;fe<Le;fe++)if(We[fe]==="\\")fe++;else if(We[fe]===De[0])de++;else if(We[fe]===De[1]&&(de--,de<0))return fe;return-1}function R(We){We&&We.sanitize&&!We.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var U={escape:t,unescape:a,edit:D,cleanUrl:L,resolveUrl:m,noopTest:y,merge:x,splitCells:O,rtrim:H,findClosingBracket:F,checkSanitizeDeprecation:R},k=W.defaults,d=U.rtrim,z=U.splitCells,Y=U.escape,re=U.findClosingBracket;function le(We,De,Le){var de=De.href,fe=De.title?Y(De.title):null,Ee=We[1].replace(/\\([\[\]])/g,"$1");return We[0].charAt(0)!=="!"?{type:"link",raw:Le,href:de,title:fe,text:Ee}:{type:"image",raw:Le,href:de,title:fe,text:Y(Ee)}}function Ne(We,De){var Le=We.match(/^(\s+)(?:```)/);if(Le===null)return De;var de=Le[1];return De.split(`
`).map(function(fe){var Ee=fe.match(/^\s+/);if(Ee===null)return fe;var Pe=Ee[0];return Pe.length>=de.length?fe.slice(de.length):fe}).join(`
`)}var Ce=function(){function We(Le){this.options=Le||k}var De=We.prototype;return De.space=function(de){var fe=this.rules.block.newline.exec(de);if(fe)return fe[0].length>1?{type:"space",raw:fe[0]}:{raw:`
`}},De.code=function(de,fe){var Ee=this.rules.block.code.exec(de);if(Ee){var Pe=fe[fe.length-1];if(Pe&&Pe.type==="paragraph")return{raw:Ee[0],text:Ee[0].trimRight()};var Ue=Ee[0].replace(/^ {4}/gm,"");return{type:"code",raw:Ee[0],codeBlockStyle:"indented",text:this.options.pedantic?Ue:d(Ue,`
`)}}},De.fences=function(de){var fe=this.rules.block.fences.exec(de);if(fe){var Ee=fe[0],Pe=Ne(Ee,fe[3]||"");return{type:"code",raw:Ee,lang:fe[2]?fe[2].trim():fe[2],text:Pe}}},De.heading=function(de){var fe=this.rules.block.heading.exec(de);if(fe)return{type:"heading",raw:fe[0],depth:fe[1].length,text:fe[2]}},De.nptable=function(de){var fe=this.rules.block.nptable.exec(de);if(fe){var Ee={type:"table",header:z(fe[1].replace(/^ *| *\| *$/g,"")),align:fe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:fe[3]?fe[3].replace(/\n$/,"").split(`
`):[],raw:fe[0]};if(Ee.header.length===Ee.align.length){var Pe=Ee.align.length,Ue;for(Ue=0;Ue<Pe;Ue++)/^ *-+: *$/.test(Ee.align[Ue])?Ee.align[Ue]="right":/^ *:-+: *$/.test(Ee.align[Ue])?Ee.align[Ue]="center":/^ *:-+ *$/.test(Ee.align[Ue])?Ee.align[Ue]="left":Ee.align[Ue]=null;for(Pe=Ee.cells.length,Ue=0;Ue<Pe;Ue++)Ee.cells[Ue]=z(Ee.cells[Ue],Ee.header.length);return Ee}}},De.hr=function(de){var fe=this.rules.block.hr.exec(de);if(fe)return{type:"hr",raw:fe[0]}},De.blockquote=function(de){var fe=this.rules.block.blockquote.exec(de);if(fe){var Ee=fe[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:fe[0],text:Ee}}},De.list=function(de){var fe=this.rules.block.list.exec(de);if(fe){for(var Ee=fe[0],Pe=fe[2],Ue=Pe.length>1,lt=Pe[Pe.length-1]===")",Ot={type:"list",raw:Ee,ordered:Ue,start:Ue?+Pe.slice(0,-1):"",loose:!1,items:[]},cn=fe[0].match(this.rules.block.item),An=!1,Ct,Gt,xt,Rt,gt,be,Ie,Dt=cn.length,ht=0;ht<Dt;ht++)Ct=cn[ht],Ee=Ct,Gt=Ct.length,Ct=Ct.replace(/^ *([*+-]|\d+[.)]) */,""),~Ct.indexOf(`
`)&&(Gt-=Ct.length,Ct=this.options.pedantic?Ct.replace(/^ {1,4}/gm,""):Ct.replace(new RegExp("^ {1,"+Gt+"}","gm"),"")),ht!==Dt-1&&(xt=this.rules.block.bullet.exec(cn[ht+1])[0],(Ue?xt.length===1||!lt&&xt[xt.length-1]===")":xt.length>1||this.options.smartLists&&xt!==Pe)&&(Rt=cn.slice(ht+1).join(`
`),Ot.raw=Ot.raw.substring(0,Ot.raw.length-Rt.length),ht=Dt-1)),gt=An||/\n\n(?!\s*$)/.test(Ct),ht!==Dt-1&&(An=Ct.charAt(Ct.length-1)===`
`,gt||(gt=An)),gt&&(Ot.loose=!0),be=/^\[[ xX]\] /.test(Ct),Ie=void 0,be&&(Ie=Ct[1]!==" ",Ct=Ct.replace(/^\[[ xX]\] +/,"")),Ot.items.push({type:"list_item",raw:Ee,task:be,checked:Ie,loose:gt,text:Ct});return Ot}},De.html=function(de){var fe=this.rules.block.html.exec(de);if(fe)return{type:this.options.sanitize?"paragraph":"html",raw:fe[0],pre:!this.options.sanitizer&&(fe[1]==="pre"||fe[1]==="script"||fe[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(fe[0]):Y(fe[0]):fe[0]}},De.def=function(de){var fe=this.rules.block.def.exec(de);if(fe){fe[3]&&(fe[3]=fe[3].substring(1,fe[3].length-1));var Ee=fe[1].toLowerCase().replace(/\s+/g," ");return{tag:Ee,raw:fe[0],href:fe[2],title:fe[3]}}},De.table=function(de){var fe=this.rules.block.table.exec(de);if(fe){var Ee={type:"table",header:z(fe[1].replace(/^ *| *\| *$/g,"")),align:fe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:fe[3]?fe[3].replace(/\n$/,"").split(`
`):[]};if(Ee.header.length===Ee.align.length){Ee.raw=fe[0];var Pe=Ee.align.length,Ue;for(Ue=0;Ue<Pe;Ue++)/^ *-+: *$/.test(Ee.align[Ue])?Ee.align[Ue]="right":/^ *:-+: *$/.test(Ee.align[Ue])?Ee.align[Ue]="center":/^ *:-+ *$/.test(Ee.align[Ue])?Ee.align[Ue]="left":Ee.align[Ue]=null;for(Pe=Ee.cells.length,Ue=0;Ue<Pe;Ue++)Ee.cells[Ue]=z(Ee.cells[Ue].replace(/^ *\| *| *\| *$/g,""),Ee.header.length);return Ee}}},De.lheading=function(de){var fe=this.rules.block.lheading.exec(de);if(fe)return{type:"heading",raw:fe[0],depth:fe[2].charAt(0)==="="?1:2,text:fe[1]}},De.paragraph=function(de){var fe=this.rules.block.paragraph.exec(de);if(fe)return{type:"paragraph",raw:fe[0],text:fe[1].charAt(fe[1].length-1)===`
`?fe[1].slice(0,-1):fe[1]}},De.text=function(de,fe){var Ee=this.rules.block.text.exec(de);if(Ee){var Pe=fe[fe.length-1];return Pe&&Pe.type==="text"?{raw:Ee[0],text:Ee[0]}:{type:"text",raw:Ee[0],text:Ee[0]}}},De.escape=function(de){var fe=this.rules.inline.escape.exec(de);if(fe)return{type:"escape",raw:fe[0],text:Y(fe[1])}},De.tag=function(de,fe,Ee){var Pe=this.rules.inline.tag.exec(de);if(Pe)return!fe&&/^<a /i.test(Pe[0])?fe=!0:fe&&/^<\/a>/i.test(Pe[0])&&(fe=!1),!Ee&&/^<(pre|code|kbd|script)(\s|>)/i.test(Pe[0])?Ee=!0:Ee&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Pe[0])&&(Ee=!1),{type:this.options.sanitize?"text":"html",raw:Pe[0],inLink:fe,inRawBlock:Ee,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Pe[0]):Y(Pe[0]):Pe[0]}},De.link=function(de){var fe=this.rules.inline.link.exec(de);if(fe){var Ee=re(fe[2],"()");if(Ee>-1){var Pe=fe[0].indexOf("!")===0?5:4,Ue=Pe+fe[1].length+Ee;fe[2]=fe[2].substring(0,Ee),fe[0]=fe[0].substring(0,Ue).trim(),fe[3]=""}var lt=fe[2],Ot="";if(this.options.pedantic){var cn=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(lt);cn?(lt=cn[1],Ot=cn[3]):Ot=""}else Ot=fe[3]?fe[3].slice(1,-1):"";lt=lt.trim().replace(/^<([\s\S]*)>$/,"$1");var An=le(fe,{href:lt&&lt.replace(this.rules.inline._escapes,"$1"),title:Ot&&Ot.replace(this.rules.inline._escapes,"$1")},fe[0]);return An}},De.reflink=function(de,fe){var Ee;if((Ee=this.rules.inline.reflink.exec(de))||(Ee=this.rules.inline.nolink.exec(de))){var Pe=(Ee[2]||Ee[1]).replace(/\s+/g," ");if(Pe=fe[Pe.toLowerCase()],!Pe||!Pe.href){var Ue=Ee[0].charAt(0);return{type:"text",raw:Ue,text:Ue}}var lt=le(Ee,Pe,Ee[0]);return lt}},De.strong=function(de,fe,Ee){Ee===void 0&&(Ee="");var Pe=this.rules.inline.strong.start.exec(de);if(Pe&&(!Pe[1]||Pe[1]&&(Ee===""||this.rules.inline.punctuation.exec(Ee)))){fe=fe.slice(-1*de.length);var Ue=Pe[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Ue.lastIndex=0;for(var lt;(Pe=Ue.exec(fe))!=null;)if(lt=this.rules.inline.strong.middle.exec(fe.slice(0,Pe.index+3)),lt)return{type:"strong",raw:de.slice(0,lt[0].length),text:de.slice(2,lt[0].length-2)}}},De.em=function(de,fe,Ee){Ee===void 0&&(Ee="");var Pe=this.rules.inline.em.start.exec(de);if(Pe&&(!Pe[1]||Pe[1]&&(Ee===""||this.rules.inline.punctuation.exec(Ee)))){fe=fe.slice(-1*de.length);var Ue=Pe[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Ue.lastIndex=0;for(var lt;(Pe=Ue.exec(fe))!=null;)if(lt=this.rules.inline.em.middle.exec(fe.slice(0,Pe.index+2)),lt)return{type:"em",raw:de.slice(0,lt[0].length),text:de.slice(1,lt[0].length-1)}}},De.codespan=function(de){var fe=this.rules.inline.code.exec(de);if(fe){var Ee=fe[2].replace(/\n/g," "),Pe=/[^ ]/.test(Ee),Ue=Ee.startsWith(" ")&&Ee.endsWith(" ");return Pe&&Ue&&(Ee=Ee.substring(1,Ee.length-1)),Ee=Y(Ee,!0),{type:"codespan",raw:fe[0],text:Ee}}},De.br=function(de){var fe=this.rules.inline.br.exec(de);if(fe)return{type:"br",raw:fe[0]}},De.del=function(de){var fe=this.rules.inline.del.exec(de);if(fe)return{type:"del",raw:fe[0],text:fe[1]}},De.autolink=function(de,fe){var Ee=this.rules.inline.autolink.exec(de);if(Ee){var Pe,Ue;return Ee[2]==="@"?(Pe=Y(this.options.mangle?fe(Ee[1]):Ee[1]),Ue="mailto:"+Pe):(Pe=Y(Ee[1]),Ue=Pe),{type:"link",raw:Ee[0],text:Pe,href:Ue,tokens:[{type:"text",raw:Pe,text:Pe}]}}},De.url=function(de,fe){var Ee;if(Ee=this.rules.inline.url.exec(de)){var Pe,Ue;if(Ee[2]==="@")Pe=Y(this.options.mangle?fe(Ee[0]):Ee[0]),Ue="mailto:"+Pe;else{var lt;do lt=Ee[0],Ee[0]=this.rules.inline._backpedal.exec(Ee[0])[0];while(lt!==Ee[0]);Pe=Y(Ee[0]),Ee[1]==="www."?Ue="http://"+Pe:Ue=Pe}return{type:"link",raw:Ee[0],text:Pe,href:Ue,tokens:[{type:"text",raw:Pe,text:Pe}]}}},De.inlineText=function(de,fe,Ee){var Pe=this.rules.inline.text.exec(de);if(Pe){var Ue;return fe?Ue=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Pe[0]):Y(Pe[0]):Pe[0]:Ue=Y(this.options.smartypants?Ee(Pe[0]):Pe[0]),{type:"text",raw:Pe[0],text:Ue}}},We}(),Te=U.noopTest,Fe=U.edit,Ve=U.merge,xe={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:Te,table:Te,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};xe._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,xe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,xe.def=Fe(xe.def).replace("label",xe._label).replace("title",xe._title).getRegex(),xe.bullet=/(?:[*+-]|\d{1,9}[.)])/,xe.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,xe.item=Fe(xe.item,"gm").replace(/bull/g,xe.bullet).getRegex(),xe.list=Fe(xe.list).replace(/bull/g,xe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+xe.def.source+")").getRegex(),xe._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",xe._comment=/<!--(?!-?>)[\s\S]*?-->/,xe.html=Fe(xe.html,"i").replace("comment",xe._comment).replace("tag",xe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),xe.paragraph=Fe(xe._paragraph).replace("hr",xe.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",xe._tag).getRegex(),xe.blockquote=Fe(xe.blockquote).replace("paragraph",xe.paragraph).getRegex(),xe.normal=Ve({},xe),xe.gfm=Ve({},xe.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*|$)"}),xe.gfm.nptable=Fe(xe.gfm.nptable).replace("hr",xe.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",xe._tag).getRegex(),xe.gfm.table=Fe(xe.gfm.table).replace("hr",xe.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",xe._tag).getRegex(),xe.pedantic=Ve({},xe.normal,{html:Fe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",xe._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:Te,paragraph:Fe(xe.normal._paragraph).replace("hr",xe.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",xe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ye={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Te,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:Te,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ye._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ye.punctuation=Fe(ye.punctuation).replace(/punctuation/g,ye._punctuation).getRegex(),ye._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ye._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ye.em.start=Fe(ye.em.start).replace(/punctuation/g,ye._punctuation).getRegex(),ye.em.middle=Fe(ye.em.middle).replace(/punctuation/g,ye._punctuation).replace(/overlapSkip/g,ye._overlapSkip).getRegex(),ye.em.endAst=Fe(ye.em.endAst,"g").replace(/punctuation/g,ye._punctuation).getRegex(),ye.em.endUnd=Fe(ye.em.endUnd,"g").replace(/punctuation/g,ye._punctuation).getRegex(),ye.strong.start=Fe(ye.strong.start).replace(/punctuation/g,ye._punctuation).getRegex(),ye.strong.middle=Fe(ye.strong.middle).replace(/punctuation/g,ye._punctuation).replace(/blockSkip/g,ye._blockSkip).getRegex(),ye.strong.endAst=Fe(ye.strong.endAst,"g").replace(/punctuation/g,ye._punctuation).getRegex(),ye.strong.endUnd=Fe(ye.strong.endUnd,"g").replace(/punctuation/g,ye._punctuation).getRegex(),ye.blockSkip=Fe(ye._blockSkip,"g").getRegex(),ye.overlapSkip=Fe(ye._overlapSkip,"g").getRegex(),ye._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ye._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ye._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])?)+(?![-_])/,ye.autolink=Fe(ye.autolink).replace("scheme",ye._scheme).replace("email",ye._email).getRegex(),ye._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ye.tag=Fe(ye.tag).replace("comment",xe._comment).replace("attribute",ye._attribute).getRegex(),ye._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ye._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ye._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ye.link=Fe(ye.link).replace("label",ye._label).replace("href",ye._href).replace("title",ye._title).getRegex(),ye.reflink=Fe(ye.reflink).replace("label",ye._label).getRegex(),ye.reflinkSearch=Fe(ye.reflinkSearch,"g").replace("reflink",ye.reflink).replace("nolink",ye.nolink).getRegex(),ye.normal=Ve({},ye),ye.pedantic=Ve({},ye.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:Fe(/^!?\[(label)\]\((.*?)\)/).replace("label",ye._label).getRegex(),reflink:Fe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ye._label).getRegex()}),ye.gfm=Ve({},ye.normal,{escape:Fe(ye.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),ye.gfm.url=Fe(ye.gfm.url,"i").replace("email",ye.gfm._extended_email).getRegex(),ye.breaks=Ve({},ye.gfm,{br:Fe(ye.br).replace("{2,}","*").getRegex(),text:Fe(ye.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var oe={block:xe,inline:ye},Se=W.defaults,_e=oe.block,He=oe.inline;function rt(We){return We.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function ae(We){var De="",Le,de,fe=We.length;for(Le=0;Le<fe;Le++)de=We.charCodeAt(Le),Math.random()>.5&&(de="x"+de.toString(16)),De+="&#"+de+";";return De}var $=function(){function We(Le){this.tokens=[],this.tokens.links=Object.create(null),this.options=Le||Se,this.options.tokenizer=this.options.tokenizer||new Ce,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var de={block:_e.normal,inline:He.normal};this.options.pedantic?(de.block=_e.pedantic,de.inline=He.pedantic):this.options.gfm&&(de.block=_e.gfm,this.options.breaks?de.inline=He.breaks:de.inline=He.gfm),this.tokenizer.rules=de}We.lex=function(de,fe){var Ee=new We(fe);return Ee.lex(de)};var De=We.prototype;return De.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},De.blockTokens=function(de,fe,Ee){fe===void 0&&(fe=[]),Ee===void 0&&(Ee=!0),de=de.replace(/^ +$/gm,"");for(var Pe,Ue,lt,Ot;de;){if(Pe=this.tokenizer.space(de)){de=de.substring(Pe.raw.length),Pe.type&&fe.push(Pe);continue}if(Pe=this.tokenizer.code(de,fe)){de=de.substring(Pe.raw.length),Pe.type?fe.push(Pe):(Ot=fe[fe.length-1],Ot.raw+=`
`+Pe.raw,Ot.text+=`
`+Pe.text);continue}if(Pe=this.tokenizer.fences(de)){de=de.substring(Pe.raw.length),fe.push(Pe);continue}if(Pe=this.tokenizer.heading(de)){de=de.substring(Pe.raw.length),fe.push(Pe);continue}if(Pe=this.tokenizer.nptable(de)){de=de.substring(Pe.raw.length),fe.push(Pe);continue}if(Pe=this.tokenizer.hr(de)){de=de.substring(Pe.raw.length),fe.push(Pe);continue}if(Pe=this.tokenizer.blockquote(de)){de=de.substring(Pe.raw.length),Pe.tokens=this.blockTokens(Pe.text,[],Ee),fe.push(Pe);continue}if(Pe=this.tokenizer.list(de)){for(de=de.substring(Pe.raw.length),lt=Pe.items.length,Ue=0;Ue<lt;Ue++)Pe.items[Ue].tokens=this.blockTokens(Pe.items[Ue].text,[],!1);fe.push(Pe);continue}if(Pe=this.tokenizer.html(de)){de=de.substring(Pe.raw.length),fe.push(Pe);continue}if(Ee&&(Pe=this.tokenizer.def(de))){de=de.substring(Pe.raw.length),this.tokens.links[Pe.tag]||(this.tokens.links[Pe.tag]={href:Pe.href,title:Pe.title});continue}if(Pe=this.tokenizer.table(de)){de=de.substring(Pe.raw.length),fe.push(Pe);continue}if(Pe=this.tokenizer.lheading(de)){de=de.substring(Pe.raw.length),fe.push(Pe);continue}if(Ee&&(Pe=this.tokenizer.paragraph(de))){de=de.substring(Pe.raw.length),fe.push(Pe);continue}if(Pe=this.tokenizer.text(de,fe)){de=de.substring(Pe.raw.length),Pe.type?fe.push(Pe):(Ot=fe[fe.length-1],Ot.raw+=`
`+Pe.raw,Ot.text+=`
`+Pe.text);continue}if(de){var cn="Infinite loop on byte: "+de.charCodeAt(0);if(this.options.silent){console.error(cn);break}else throw new Error(cn)}}return fe},De.inline=function(de){var fe,Ee,Pe,Ue,lt,Ot,cn=de.length;for(fe=0;fe<cn;fe++){Ot=de[fe];switch(Ot.type){case"paragraph":case"text":case"heading":{Ot.tokens=[],this.inlineTokens(Ot.text,Ot.tokens);break}case"table":{for(Ot.tokens={header:[],cells:[]},Ue=Ot.header.length,Ee=0;Ee<Ue;Ee++)Ot.tokens.header[Ee]=[],this.inlineTokens(Ot.header[Ee],Ot.tokens.header[Ee]);for(Ue=Ot.cells.length,Ee=0;Ee<Ue;Ee++)for(lt=Ot.cells[Ee],Ot.tokens.cells[Ee]=[],Pe=0;Pe<lt.length;Pe++)Ot.tokens.cells[Ee][Pe]=[],this.inlineTokens(lt[Pe],Ot.tokens.cells[Ee][Pe]);break}case"blockquote":{this.inline(Ot.tokens);break}case"list":{for(Ue=Ot.items.length,Ee=0;Ee<Ue;Ee++)this.inline(Ot.items[Ee].tokens);break}}}return de},De.inlineTokens=function(de,fe,Ee,Pe,Ue){fe===void 0&&(fe=[]),Ee===void 0&&(Ee=!1),Pe===void 0&&(Pe=!1),Ue===void 0&&(Ue="");var lt,Ot=de,cn;if(this.tokens.links){var An=Object.keys(this.tokens.links);if(An.length>0)for(;(cn=this.tokenizer.rules.inline.reflinkSearch.exec(Ot))!=null;)An.includes(cn[0].slice(cn[0].lastIndexOf("[")+1,-1))&&(Ot=Ot.slice(0,cn.index)+"["+"a".repeat(cn[0].length-2)+"]"+Ot.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(cn=this.tokenizer.rules.inline.blockSkip.exec(Ot))!=null;)Ot=Ot.slice(0,cn.index)+"["+"a".repeat(cn[0].length-2)+"]"+Ot.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;de;){if(lt=this.tokenizer.escape(de)){de=de.substring(lt.raw.length),fe.push(lt);continue}if(lt=this.tokenizer.tag(de,Ee,Pe)){de=de.substring(lt.raw.length),Ee=lt.inLink,Pe=lt.inRawBlock,fe.push(lt);continue}if(lt=this.tokenizer.link(de)){de=de.substring(lt.raw.length),lt.type==="link"&&(lt.tokens=this.inlineTokens(lt.text,[],!0,Pe)),fe.push(lt);continue}if(lt=this.tokenizer.reflink(de,this.tokens.links)){de=de.substring(lt.raw.length),lt.type==="link"&&(lt.tokens=this.inlineTokens(lt.text,[],!0,Pe)),fe.push(lt);continue}if(lt=this.tokenizer.strong(de,Ot,Ue)){de=de.substring(lt.raw.length),lt.tokens=this.inlineTokens(lt.text,[],Ee,Pe),fe.push(lt);continue}if(lt=this.tokenizer.em(de,Ot,Ue)){de=de.substring(lt.raw.length),lt.tokens=this.inlineTokens(lt.text,[],Ee,Pe),fe.push(lt);continue}if(lt=this.tokenizer.codespan(de)){de=de.substring(lt.raw.length),fe.push(lt);continue}if(lt=this.tokenizer.br(de)){de=de.substring(lt.raw.length),fe.push(lt);continue}if(lt=this.tokenizer.del(de)){de=de.substring(lt.raw.length),lt.tokens=this.inlineTokens(lt.text,[],Ee,Pe),fe.push(lt);continue}if(lt=this.tokenizer.autolink(de,ae)){de=de.substring(lt.raw.length),fe.push(lt);continue}if(!Ee&&(lt=this.tokenizer.url(de,ae))){de=de.substring(lt.raw.length),fe.push(lt);continue}if(lt=this.tokenizer.inlineText(de,Pe,rt)){de=de.substring(lt.raw.length),Ue=lt.raw.slice(-1),fe.push(lt);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 fe},V(We,null,[{key:"rules",get:function(){return{block:_e,inline:He}}}]),We}(),Q=W.defaults,te=U.cleanUrl,he=U.escape,ge=function(){function We(Le){this.options=Le||Q}var De=We.prototype;return De.code=function(de,fe,Ee){var Pe=(fe||"").match(/\S*/)[0];if(this.options.highlight){var Ue=this.options.highlight(de,Pe);Ue!=null&&Ue!==de&&(Ee=!0,de=Ue)}return Pe?'<pre><code class="'+this.options.langPrefix+he(Pe,!0)+'">'+(Ee?de:he(de,!0))+`</code></pre>
`:"<pre><code>"+(Ee?de:he(de,!0))+`</code></pre>
`},De.blockquote=function(de){return`<blockquote>
`+de+`</blockquote>
`},De.html=function(de){return de},De.heading=function(de,fe,Ee,Pe){return this.options.headerIds?"<h"+fe+' id="'+this.options.headerPrefix+Pe.slug(Ee)+'">'+de+"</h"+fe+`>
`:"<h"+fe+">"+de+"</h"+fe+`>
`},De.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},De.list=function(de,fe,Ee){var Pe=fe?"ol":"ul",Ue=fe&&Ee!==1?' start="'+Ee+'"':"";return"<"+Pe+Ue+`>
`+de+"</"+Pe+`>
`},De.listitem=function(de){return"<li>"+de+`</li>
`},De.checkbox=function(de){return"<input "+(de?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},De.paragraph=function(de){return"<p>"+de+`</p>
`},De.table=function(de,fe){return fe&&(fe="<tbody>"+fe+"</tbody>"),`<table>
<thead>
`+de+`</thead>
`+fe+`</table>
`},De.tablerow=function(de){return`<tr>
`+de+`</tr>
`},De.tablecell=function(de,fe){var Ee=fe.header?"th":"td",Pe=fe.align?"<"+Ee+' align="'+fe.align+'">':"<"+Ee+">";return Pe+de+"</"+Ee+`>
`},De.strong=function(de){return"<strong>"+de+"</strong>"},De.em=function(de){return"<em>"+de+"</em>"},De.codespan=function(de){return"<code>"+de+"</code>"},De.br=function(){return this.options.xhtml?"<br/>":"<br>"},De.del=function(de){return"<del>"+de+"</del>"},De.link=function(de,fe,Ee){if(de=te(this.options.sanitize,this.options.baseUrl,de),de===null)return Ee;var Pe='<a href="'+he(de)+'"';return fe&&(Pe+=' title="'+fe+'"'),Pe+=">"+Ee+"</a>",Pe},De.image=function(de,fe,Ee){if(de=te(this.options.sanitize,this.options.baseUrl,de),de===null)return Ee;var Pe='<img src="'+de+'" alt="'+Ee+'"';return fe&&(Pe+=' title="'+fe+'"'),Pe+=this.options.xhtml?"/>":">",Pe},De.text=function(de){return de},We}(),we=function(){function We(){}var De=We.prototype;return De.strong=function(de){return de},De.em=function(de){return de},De.codespan=function(de){return de},De.del=function(de){return de},De.html=function(de){return de},De.text=function(de){return de},De.link=function(de,fe,Ee){return""+Ee},De.image=function(de,fe,Ee){return""+Ee},De.br=function(){return""},We}(),ft=function(){function We(){this.seen={}}var De=We.prototype;return De.slug=function(de){var fe=de.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(fe)){var Ee=fe;do this.seen[Ee]++,fe=Ee+"-"+this.seen[Ee];while(this.seen.hasOwnProperty(fe))}return this.seen[fe]=0,fe},We}(),Pt=W.defaults,jt=U.unescape,qe=function(){function We(Le){this.options=Le||Pt,this.options.renderer=this.options.renderer||new ge,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new we,this.slugger=new ft}We.parse=function(de,fe){var Ee=new We(fe);return Ee.parse(de)};var De=We.prototype;return De.parse=function(de,fe){fe===void 0&&(fe=!0);var Ee="",Pe,Ue,lt,Ot,cn,An,Ct,Gt,xt,Rt,gt,be,Ie,Dt,ht,nn,qt,Ke,st=de.length;for(Pe=0;Pe<st;Pe++){Rt=de[Pe];switch(Rt.type){case"space":continue;case"hr":{Ee+=this.renderer.hr();continue}case"heading":{Ee+=this.renderer.heading(this.parseInline(Rt.tokens),Rt.depth,jt(this.parseInline(Rt.tokens,this.textRenderer)),this.slugger);continue}case"code":{Ee+=this.renderer.code(Rt.text,Rt.lang,Rt.escaped);continue}case"table":{for(Gt="",Ct="",Ot=Rt.header.length,Ue=0;Ue<Ot;Ue++)Ct+=this.renderer.tablecell(this.parseInline(Rt.tokens.header[Ue]),{header:!0,align:Rt.align[Ue]});for(Gt+=this.renderer.tablerow(Ct),xt="",Ot=Rt.cells.length,Ue=0;Ue<Ot;Ue++){for(An=Rt.tokens.cells[Ue],Ct="",cn=An.length,lt=0;lt<cn;lt++)Ct+=this.renderer.tablecell(this.parseInline(An[lt]),{header:!1,align:Rt.align[lt]});xt+=this.renderer.tablerow(Ct)}Ee+=this.renderer.table(Gt,xt);continue}case"blockquote":{xt=this.parse(Rt.tokens),Ee+=this.renderer.blockquote(xt);continue}case"list":{for(gt=Rt.ordered,be=Rt.start,Ie=Rt.loose,Ot=Rt.items.length,xt="",Ue=0;Ue<Ot;Ue++)ht=Rt.items[Ue],nn=ht.checked,qt=ht.task,Dt="",ht.task&&(Ke=this.renderer.checkbox(nn),Ie?ht.tokens.length>0&&ht.tokens[0].type==="text"?(ht.tokens[0].text=Ke+" "+ht.tokens[0].text,ht.tokens[0].tokens&&ht.tokens[0].tokens.length>0&&ht.tokens[0].tokens[0].type==="text"&&(ht.tokens[0].tokens[0].text=Ke+" "+ht.tokens[0].tokens[0].text)):ht.tokens.unshift({type:"text",text:Ke}):Dt+=Ke),Dt+=this.parse(ht.tokens,Ie),xt+=this.renderer.listitem(Dt,qt,nn);Ee+=this.renderer.list(xt,gt,be);continue}case"html":{Ee+=this.renderer.html(Rt.text);continue}case"paragraph":{Ee+=this.renderer.paragraph(this.parseInline(Rt.tokens));continue}case"text":{for(xt=Rt.tokens?this.parseInline(Rt.tokens):Rt.text;Pe+1<st&&de[Pe+1].type==="text";)Rt=de[++Pe],xt+=`
`+(Rt.tokens?this.parseInline(Rt.tokens):Rt.text);Ee+=fe?this.renderer.paragraph(xt):xt;continue}default:{var bt='Token with "'+Rt.type+'" type was not found.';if(this.options.silent){console.error(bt);return}else throw new Error(bt)}}}return Ee},De.parseInline=function(de,fe){fe=fe||this.renderer;var Ee="",Pe,Ue,lt=de.length;for(Pe=0;Pe<lt;Pe++){Ue=de[Pe];switch(Ue.type){case"escape":{Ee+=fe.text(Ue.text);break}case"html":{Ee+=fe.html(Ue.text);break}case"link":{Ee+=fe.link(Ue.href,Ue.title,this.parseInline(Ue.tokens,fe));break}case"image":{Ee+=fe.image(Ue.href,Ue.title,Ue.text);break}case"strong":{Ee+=fe.strong(this.parseInline(Ue.tokens,fe));break}case"em":{Ee+=fe.em(this.parseInline(Ue.tokens,fe));break}case"codespan":{Ee+=fe.codespan(Ue.text);break}case"br":{Ee+=fe.br();break}case"del":{Ee+=fe.del(this.parseInline(Ue.tokens,fe));break}case"text":{Ee+=fe.text(Ue.text);break}default:{var Ot='Token with "'+Ue.type+'" type was not found.';if(this.options.silent){console.error(Ot);return}else throw new Error(Ot)}}}return Ee},We}(),Mt=U.merge,sn=U.checkSanitizeDeprecation,at=U.escape,Qe=W.getDefaults,Et=W.changeDefaults,It=W.defaults;function dt(We,De,Le){if(typeof We=="undefined"||We===null)throw new Error("marked(): input parameter is undefined or null");if(typeof We!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(We)+", string expected");if(typeof De=="function"&&(Le=De,De=null),De=Mt({},dt.defaults,De||{}),sn(De),Le){var de=De.highlight,fe;try{fe=$.lex(We,De)}catch(lt){return Le(lt)}var Ee=function(Ot){var cn;if(!Ot)try{cn=qe.parse(fe,De)}catch(An){Ot=An}return De.highlight=de,Ot?Le(Ot):Le(null,cn)};if(!de||de.length<3)return Ee();if(delete De.highlight,!fe.length)return Ee();var Pe=0;dt.walkTokens(fe,function(lt){lt.type==="code"&&(Pe++,setTimeout(function(){de(lt.text,lt.lang,function(Ot,cn){if(Ot)return Ee(Ot);cn!=null&&cn!==lt.text&&(lt.text=cn,lt.escaped=!0),Pe--,Pe===0&&Ee()})},0))}),Pe===0&&Ee();return}try{var Ue=$.lex(We,De);return De.walkTokens&&dt.walkTokens(Ue,De.walkTokens),qe.parse(Ue,De)}catch(lt){if(lt.message+=`
Please report this to https://github.com/markedjs/marked.`,De.silent)return"<p>An error occurred:</p><pre>"+at(lt.message+"",!0)+"</pre>";throw lt}}dt.options=dt.setOptions=function(We){return Mt(dt.defaults,We),Et(dt.defaults),dt},dt.getDefaults=Qe,dt.defaults=It,dt.use=function(We){var De=Mt({},We);if(We.renderer&&function(){var de=dt.defaults.renderer||new ge,fe=function(Ue){var lt=de[Ue];de[Ue]=function(){for(var Ot=arguments.length,cn=new Array(Ot),An=0;An<Ot;An++)cn[An]=arguments[An];var Ct=We.renderer[Ue].apply(de,cn);return Ct===!1&&(Ct=lt.apply(de,cn)),Ct}};for(var Ee in We.renderer)fe(Ee);De.renderer=de}(),We.tokenizer&&function(){var de=dt.defaults.tokenizer||new Ce,fe=function(Ue){var lt=de[Ue];de[Ue]=function(){for(var Ot=arguments.length,cn=new Array(Ot),An=0;An<Ot;An++)cn[An]=arguments[An];var Ct=We.tokenizer[Ue].apply(de,cn);return Ct===!1&&(Ct=lt.apply(de,cn)),Ct}};for(var Ee in We.tokenizer)fe(Ee);De.tokenizer=de}(),We.walkTokens){var Le=dt.defaults.walkTokens;De.walkTokens=function(de){We.walkTokens(de),Le&&Le(de)}}dt.setOptions(De)},dt.walkTokens=function(We,De){for(var Le=M(We),de;!(de=Le()).done;){var fe=de.value;De(fe);switch(fe.type){case"table":{for(var Ee=M(fe.tokens.header),Pe;!(Pe=Ee()).done;){var Ue=Pe.value;dt.walkTokens(Ue,De)}for(var lt=M(fe.tokens.cells),Ot;!(Ot=lt()).done;)for(var cn=Ot.value,An=M(cn),Ct;!(Ct=An()).done;){var Gt=Ct.value;dt.walkTokens(Gt,De)}break}case"list":{dt.walkTokens(fe.items,De);break}default:fe.tokens&&dt.walkTokens(fe.tokens,De)}}},dt.Parser=qe,dt.parser=qe.parse,dt.Renderer=ge,dt.TextRenderer=we,dt.Lexer=$,dt.lexer=$.lex,dt.Tokenizer=Ce,dt.Slugger=ft,dt.parse=dt;var mt=dt;return mt})},ELLl:function(Bt,ve,T){(function(Z){Z(T("VrN/"))})(function(Z){var V={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},j=Z.Pos;Z.defineOption("autoCloseBrackets",!1,function(o,s,t){t&&t!=Z.Init&&(o.removeKeyMap(M),o.state.closeBrackets=null),s&&(I(G(s,"pairs")),o.state.closeBrackets=s,o.addKeyMap(M))});function G(o,s){return s=="pairs"&&typeof o=="string"?o:typeof o=="object"&&o[s]!=null?o[s]:V[s]}var M={Backspace:r,Enter:A};function I(o){for(var s=0;s<o.length;s++){var t=o.charAt(s),u="'"+t+"'";M[u]||(M[u]=W(t))}}I(V.pairs+"`");function W(o){return function(s){return f(s,o)}}function C(o){var s=o.state.closeBrackets;if(!s||s.override)return s;var t=o.getModeAt(o.getCursor());return t.closeBrackets||s}function r(o){var s=C(o);if(!s||o.getOption("disableInput"))return Z.Pass;for(var t=G(s,"pairs"),u=o.listSelections(),a=0;a<u.length;a++){if(!u[a].empty())return Z.Pass;var i=p(o,u[a].head);if(!i||t.indexOf(i)%2!=0)return Z.Pass}for(var a=u.length-1;a>=0;a--){var D=u[a].head;o.replaceRange("",j(D.line,D.ch-1),j(D.line,D.ch+1),"+delete")}}function A(o){var s=C(o),t=s&&G(s,"explode");if(!t||o.getOption("disableInput"))return Z.Pass;for(var u=o.listSelections(),a=0;a<u.length;a++){if(!u[a].empty())return Z.Pass;var i=p(o,u[a].head);if(!i||t.indexOf(i)%2!=0)return Z.Pass}o.operation(function(){var D=o.lineSeparator()||`
`;o.replaceSelection(D+D,null),o.execCommand("goCharLeft"),u=o.listSelections();for(var w=0;w<u.length;w++){var S=u[w].head.line;o.indentLine(S,null,!0),o.indentLine(S+1,null,!0)}})}function v(o){var s=Z.cmpPos(o.anchor,o.head)>0;return{anchor:new j(o.anchor.line,o.anchor.ch+(s?-1:1)),head:new j(o.head.line,o.head.ch+(s?1:-1))}}function f(o,s){var t=C(o);if(!t||o.getOption("disableInput"))return Z.Pass;var u=G(t,"pairs"),a=u.indexOf(s);if(a==-1)return Z.Pass;for(var i=G(t,"closeBefore"),D=G(t,"triples"),w=u.charAt(a+1)==s,S=o.listSelections(),L=a%2==0,P,_=0;_<S.length;_++){var b=S[_],g=b.head,m,y=o.getRange(g,j(g.line,g.ch+1));if(L&&!b.empty())m="surround";else if((w||!L)&&y==s)w&&l(o,g)?m="both":D.indexOf(s)>=0&&o.getRange(g,j(g.line,g.ch+3))==s+s+s?m="skipThree":m="skip";else if(w&&g.ch>1&&D.indexOf(s)>=0&&o.getRange(j(g.line,g.ch-2),g)==s+s){if(g.ch>2&&/\bstring/.test(o.getTokenTypeAt(j(g.line,g.ch-2))))return Z.Pass;m="addFour"}else if(w){var x=g.ch==0?" ":o.getRange(j(g.line,g.ch-1),g);if(!Z.isWordChar(y)&&x!=s&&!Z.isWordChar(x))m="both";else return Z.Pass}else if(L&&(y.length===0||/\s/.test(y)||i.indexOf(y)>-1))m="both";else return Z.Pass;if(!P)P=m;else if(P!=m)return Z.Pass}var O=a%2?u.charAt(a-1):s,H=a%2?s:u.charAt(a+1);o.operation(function(){if(P=="skip")o.execCommand("goCharRight");else if(P=="skipThree")for(var F=0;F<3;F++)o.execCommand("goCharRight");else if(P=="surround"){for(var R=o.getSelections(),F=0;F<R.length;F++)R[F]=O+R[F]+H;o.replaceSelections(R,"around"),R=o.listSelections().slice();for(var F=0;F<R.length;F++)R[F]=v(R[F]);o.setSelections(R)}else P=="both"?(o.replaceSelection(O+H,null),o.triggerElectric(O+H),o.execCommand("goCharLeft")):P=="addFour"&&(o.replaceSelection(O+O+O+O,"before"),o.execCommand("goCharRight"))})}function p(o,s){var t=o.getRange(j(s.line,s.ch-1),j(s.line,s.ch+1));return t.length==2?t:null}function l(o,s){var t=o.getTokenAt(j(s.line,s.ch+1));return/\bstring/.test(t.type)&&t.start==s.ch&&(s.ch==0||!/\bstring/.test(o.getTokenTypeAt(s)))}})},FOrL:function(Bt,ve,T){Bt.exports=T.p+"static/nodata.a6b3f948.png"},FWmy:function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return Z});function Z(V,j){if(!V)throw new Error(j?`Assertion failed (${j})`:"Assertion Failed")}},GfqC:function(Bt,ve,T){"use strict";var Z=T("q1tI"),V=T.n(Z),j=T("TSYQ"),G=T.n(j);function M(U,k){var d="cannot "+U.method+" "+U.action+" "+k.status+"'",z=new Error(d);return z.status=k.status,z.method=U.method,z.url=U.action,z}function I(U){var k=U.responseText||U.response;if(!k)return k;try{return JSON.parse(k)}catch(d){return k}}function W(U){var k=new XMLHttpRequest;U.onProgress&&k.upload&&(k.upload.onprogress=function(re){re.total>0&&(re.percent=re.loaded/re.total*100),U.onProgress(re)});var d=new FormData;U.data&&Object.keys(U.data).forEach(function(Y){var re=U.data[Y];if(Array.isArray(re)){re.forEach(function(le){d.append(Y+"[]",le)});return}d.append(Y,U.data[Y])}),U.file instanceof Blob?d.append(U.filename,U.file,U.file.name):d.append(U.filename,U.file),k.onerror=function(re){U.onError(re)},k.onload=function(){return k.status<200||k.status>=300?U.onError(M(U,k),I(k)):U.onSuccess(I(k),k)},k.open(U.method,U.action,!0),U.withCredentials&&"withCredentials"in k&&(k.withCredentials=!0);var z=U.headers||{};return z["X-Requested-With"]!==null&&k.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(z).forEach(function(Y){z[Y]!==null&&k.setRequestHeader(Y,z[Y])}),k.send(d),{abort:function(){k.abort()}}}var C=+new Date,r=0;function A(){return"rc-upload-"+C+"-"+ ++r}function v(U,k){return U.indexOf(k,U.length-k.length)!==-1}var f=function(U,k){if(U&&k){var d=Array.isArray(k)?k:k.split(","),z=U.name||"",Y=U.type||"",re=Y.replace(/\/.*$/,"");return d.some(function(le){var Ne=le.trim();return Ne.charAt(0)==="."?v(z.toLowerCase(),Ne.toLowerCase()):/\/\*$/.test(Ne)?re===Ne.replace(/\/.*$/,""):Y===Ne})}return!0};function p(U,k){var d=U.createReader(),z=[];function Y(){d.readEntries(function(re){var le=Array.prototype.slice.apply(re);z=z.concat(le);var Ne=!le.length;Ne?k(z):Y()})}Y()}var l=function(k,d,z){var Y=function re(le,Ne){Ne=Ne||"",le.isFile?le.file(function(Ce){z(Ce)&&(le.fullPath&&!Ce.webkitRelativePath&&(Object.defineProperties(Ce,{webkitRelativePath:{writable:!0}}),Ce.webkitRelativePath=le.fullPath.replace(/^\//,""),Object.defineProperties(Ce,{webkitRelativePath:{writable:!1}})),d([Ce]))}):le.isDirectory&&p(le,function(Ce){Ce.forEach(function(Te){re(Te,""+Ne+le.name+"/")})})};k.forEach(function(re){Y(re.webkitGetAsEntry())})},o=l,s=Object.assign||function(U){for(var k=1;k<arguments.length;k++){var d=arguments[k];for(var z in d)Object.prototype.hasOwnProperty.call(d,z)&&(U[z]=d[z])}return U},t=function(){function U(k,d){var z=[],Y=!0,re=!1,le=void 0;try{for(var Ne=k[Symbol.iterator](),Ce;!(Y=(Ce=Ne.next()).done)&&!(z.push(Ce.value),d&&z.length===d);Y=!0);}catch(Te){re=!0,le=Te}finally{try{!Y&&Ne.return&&Ne.return()}finally{if(re)throw le}}return z}return function(k,d){if(Array.isArray(k))return k;if(Symbol.iterator in Object(k))return U(k,d);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),u=function(){function U(k,d){for(var z=0;z<d.length;z++){var Y=d[z];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(k,Y.key,Y)}}return function(k,d,z){return d&&U(k.prototype,d),z&&U(k,z),k}}();function a(U,k,d){return k in U?Object.defineProperty(U,k,{value:d,enumerable:!0,configurable:!0,writable:!0}):U[k]=d,U}function i(U,k){var d={};for(var z in U){if(k.indexOf(z)>=0)continue;if(!Object.prototype.hasOwnProperty.call(U,z))continue;d[z]=U[z]}return d}function D(U,k){if(!(U instanceof k))throw new TypeError("Cannot call a class as a function")}function w(U,k){if(!U)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:U}function S(U,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);U.prototype=Object.create(k&&k.prototype,{constructor:{value:U,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(U,k):U.__proto__=k)}var L=function(k){return Object.keys(k).reduce(function(d,z){return(z.substr(0,5)==="data-"||z.substr(0,5)==="aria-"||z==="role")&&(d[z]=k[z]),d},{})},P=function(U){S(k,U);function k(){var d,z,Y,re;D(this,k);for(var le=arguments.length,Ne=Array(le),Ce=0;Ce<le;Ce++)Ne[Ce]=arguments[Ce];return re=(z=(Y=w(this,(d=k.__proto__||Object.getPrototypeOf(k)).call.apply(d,[this].concat(Ne))),Y),Y.state={uid:A()},Y.reqs={},Y.onChange=function(Te){var Fe=Te.target.files;Y.uploadFiles(Fe),Y.reset()},Y.onClick=function(Te){var Fe=Y.fileInput;if(!Fe)return;var Ve=Y.props,xe=Ve.children,ye=Ve.onClick;xe&&xe.type==="button"&&(Fe.parentNode.focus(),Fe.parentNode.querySelector("button").blur()),Fe.click(),ye&&ye(Te)},Y.onKeyDown=function(Te){Te.key==="Enter"&&Y.onClick()},Y.onFileDrop=function(Te){var Fe=Y.props.multiple;if(Te.preventDefault(),Te.type==="dragover")return;if(Y.props.directory)o(Array.prototype.slice.call(Te.dataTransfer.items),Y.uploadFiles,function(xe){return f(xe,Y.props.accept)});else{var Ve=Array.prototype.slice.call(Te.dataTransfer.files).filter(function(xe){return f(xe,Y.props.accept)});Fe===!1&&(Ve=Ve.slice(0,1)),Y.uploadFiles(Ve)}},Y.uploadFiles=function(Te){var Fe=Array.prototype.slice.call(Te);Fe.map(function(Ve){return Ve.uid=A(),Ve}).forEach(function(Ve){Y.upload(Ve,Fe)})},Y.saveFileInput=function(Te){Y.fileInput=Te},z),w(Y,re)}return u(k,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(z,Y){var re=this,le=this.props;if(!le.beforeUpload)return setTimeout(function(){return re.post(z)},0);var Ne=le.beforeUpload(z,Y);Ne&&Ne.then?Ne.then(function(Ce){var Te=Object.prototype.toString.call(Ce);return Te==="[object File]"||Te==="[object Blob]"?re.post(Ce):re.post(z)}).catch(function(Ce){console.log(Ce)}):Ne!==!1&&setTimeout(function(){return re.post(z)},0);return}},{key:"post",value:function(z){var Y=this;if(!this._isMounted)return;var re=this.props,le=re.onStart,Ne=re.onProgress,Ce=re.transformFile,Te=Ce===void 0?function(Fe){return Fe}:Ce;new Promise(function(Fe){var Ve=re.action;return typeof Ve=="function"&&(Ve=Ve(z)),Fe(Ve)}).then(function(Fe){var Ve=z.uid,xe=re.customRequest||W,ye=Promise.resolve(Te(z)).then(function(oe){var Se=re.data;return typeof Se=="function"&&(Se=Se(oe)),Promise.all([oe,Se])}).catch(function(oe){console.error(oe)});ye.then(function(oe){var Se=t(oe,2),_e=Se[0],He=Se[1],rt={action:Fe,filename:re.name,data:He,file:_e,headers:re.headers,withCredentials:re.withCredentials,method:re.method||"post",onProgress:Ne?function(ae){Ne(ae,z)}:null,onSuccess:function($,Q){delete Y.reqs[Ve],re.onSuccess($,z,Q)},onError:function($,Q){delete Y.reqs[Ve],re.onError($,Q,z)}};le(z),Y.reqs[Ve]=xe(rt)})})}},{key:"reset",value:function(){this.setState({uid:A()})}},{key:"abort",value:function(z){var Y=this.reqs;if(z){var re=z;z&&z.uid&&(re=z.uid),Y[re]&&Y[re].abort&&Y[re].abort(),delete Y[re]}else Object.keys(Y).forEach(function(le){Y[le]&&Y[le].abort&&Y[le].abort(),delete Y[le]})}},{key:"render",value:function(){var z,Y=this.props,re=Y.component,le=Y.prefixCls,Ne=Y.className,Ce=Y.disabled,Te=Y.id,Fe=Y.style,Ve=Y.multiple,xe=Y.accept,ye=Y.children,oe=Y.directory,Se=Y.openFileDialogOnClick,_e=Y.onMouseEnter,He=Y.onMouseLeave,rt=i(Y,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),ae=G()((z={},a(z,le,!0),a(z,le+"-disabled",Ce),a(z,Ne,Ne),z)),$=Ce?{}:{onClick:Se?this.onClick:function(){},onKeyDown:Se?this.onKeyDown:function(){},onMouseEnter:_e,onMouseLeave:He,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return V.a.createElement(re,s({},$,{className:ae,role:"button",style:Fe}),V.a.createElement("input",s({},L(rt),{id:Te,type:"file",ref:this.saveFileInput,onClick:function(te){return te.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:xe,directory:oe?"directory":null,webkitdirectory:oe?"webkitdirectory":null,multiple:Ve,onChange:this.onChange})),ye)}}]),k}(Z.Component),_=P,b=Object.assign||function(U){for(var k=1;k<arguments.length;k++){var d=arguments[k];for(var z in d)Object.prototype.hasOwnProperty.call(d,z)&&(U[z]=d[z])}return U},g=function(){function U(k,d){for(var z=0;z<d.length;z++){var Y=d[z];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(k,Y.key,Y)}}return function(k,d,z){return d&&U(k.prototype,d),z&&U(k,z),k}}();function m(U,k){if(!(U instanceof k))throw new TypeError("Cannot call a class as a function")}function y(U,k){if(!U)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:U}function x(U,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);U.prototype=Object.create(k&&k.prototype,{constructor:{value:U,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(U,k):U.__proto__=k)}function O(){}var H=function(U){x(k,U);function k(){var d,z,Y,re;m(this,k);for(var le=arguments.length,Ne=Array(le),Ce=0;Ce<le;Ce++)Ne[Ce]=arguments[Ce];return re=(z=(Y=y(this,(d=k.__proto__||Object.getPrototypeOf(k)).call.apply(d,[this].concat(Ne))),Y),Y.saveUploader=function(Te){Y.uploader=Te},z),y(Y,re)}return g(k,[{key:"abort",value:function(z){this.uploader.abort(z)}},{key:"render",value:function(){return V.a.createElement(_,b({},this.props,{ref:this.saveUploader}))}}]),k}(Z.Component);H.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:O,onError:O,onSuccess:O,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var F=H,R=ve.a=F},Gytx:function(Bt,ve){Bt.exports=function(Z,V,j,G){var M=j?j.call(G,Z,V):void 0;if(M!==void 0)return!!M;if(Z===V)return!0;if(typeof Z!="object"||!Z||typeof V!="object"||!V)return!1;var I=Object.keys(Z),W=Object.keys(V);if(I.length!==W.length)return!1;for(var C=Object.prototype.hasOwnProperty.bind(V),r=0;r<I.length;r++){var A=I[r];if(!C(A))return!1;var v=Z[A],f=V[A];if(M=j?j.call(G,v,f,A):void 0,M===!1||M===void 0&&v!==f)return!1}return!0}},H7XF:function(Bt,ve,T){"use strict";ve.byteLength=C,ve.toByteArray=A,ve.fromByteArray=p;for(var Z=[],V=[],j=typeof Uint8Array!="undefined"?Uint8Array:Array,G="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",M=0,I=G.length;M<I;++M)Z[M]=G[M],V[G.charCodeAt(M)]=M;V["-".charCodeAt(0)]=62,V["_".charCodeAt(0)]=63;function W(l){var o=l.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var s=l.indexOf("=");s===-1&&(s=o);var t=s===o?0:4-s%4;return[s,t]}function C(l){var o=W(l),s=o[0],t=o[1];return(s+t)*3/4-t}function r(l,o,s){return(o+s)*3/4-s}function A(l){var o,s=W(l),t=s[0],u=s[1],a=new j(r(l,t,u)),i=0,D=u>0?t-4:t,w;for(w=0;w<D;w+=4)o=V[l.charCodeAt(w)]<<18|V[l.charCodeAt(w+1)]<<12|V[l.charCodeAt(w+2)]<<6|V[l.charCodeAt(w+3)],a[i++]=o>>16&255,a[i++]=o>>8&255,a[i++]=o&255;return u===2&&(o=V[l.charCodeAt(w)]<<2|V[l.charCodeAt(w+1)]>>4,a[i++]=o&255),u===1&&(o=V[l.charCodeAt(w)]<<10|V[l.charCodeAt(w+1)]<<4|V[l.charCodeAt(w+2)]>>2,a[i++]=o>>8&255,a[i++]=o&255),a}function v(l){return Z[l>>18&63]+Z[l>>12&63]+Z[l>>6&63]+Z[l&63]}function f(l,o,s){for(var t,u=[],a=o;a<s;a+=3)t=(l[a]<<16&16711680)+(l[a+1]<<8&65280)+(l[a+2]&255),u.push(v(t));return u.join("")}function p(l){for(var o,s=l.length,t=s%3,u=[],a=16383,i=0,D=s-t;i<D;i+=a)u.push(f(l,i,i+a>D?D:i+a));return t===1?(o=l[s-1],u.push(Z[o>>2]+Z[o<<4&63]+"==")):t===2&&(o=(l[s-2]<<8)+l[s-1],u.push(Z[o>>10]+Z[o>>4&63]+Z[o<<2&63]+"=")),u.join("")}},HDXh:function(Bt,ve,T){"use strict";(function(Z){/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <http://feross.org>
* @license MIT
*/var V=T("H7XF"),j=T("kVK+"),G=T("49sm");ve.Buffer=C,ve.SlowBuffer=u,ve.INSPECT_MAX_BYTES=50,C.TYPED_ARRAY_SUPPORT=Z.TYPED_ARRAY_SUPPORT!==void 0?Z.TYPED_ARRAY_SUPPORT:M(),ve.kMaxLength=I();function M(){try{var ae=new Uint8Array(1);return ae.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},ae.foo()===42&&typeof ae.subarray=="function"&&ae.subarray(1,1).byteLength===0}catch($){return!1}}function I(){return C.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function W(ae,$){if(I()<$)throw new RangeError("Invalid typed array length");return C.TYPED_ARRAY_SUPPORT?(ae=new Uint8Array($),ae.__proto__=C.prototype):(ae===null&&(ae=new C($)),ae.length=$),ae}function C(ae,$,Q){if(!C.TYPED_ARRAY_SUPPORT&&!(this instanceof C))return new C(ae,$,Q);if(typeof ae=="number"){if(typeof $=="string")throw new Error("If encoding is specified then the first argument must be a string");return f(this,ae)}return r(this,ae,$,Q)}C.poolSize=8192,C._augment=function(ae){return ae.__proto__=C.prototype,ae};function r(ae,$,Q,te){if(typeof $=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&$ instanceof ArrayBuffer?o(ae,$,Q,te):typeof $=="string"?p(ae,$,Q):s(ae,$)}C.from=function(ae,$,Q){return r(null,ae,$,Q)},C.TYPED_ARRAY_SUPPORT&&(C.prototype.__proto__=Uint8Array.prototype,C.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&C[Symbol.species]===C&&Object.defineProperty(C,Symbol.species,{value:null,configurable:!0}));function A(ae){if(typeof ae!="number")throw new TypeError('"size" argument must be a number');if(ae<0)throw new RangeError('"size" argument must not be negative')}function v(ae,$,Q,te){return A($),$<=0?W(ae,$):Q!==void 0?typeof te=="string"?W(ae,$).fill(Q,te):W(ae,$).fill(Q):W(ae,$)}C.alloc=function(ae,$,Q){return v(null,ae,$,Q)};function f(ae,$){if(A($),ae=W(ae,$<0?0:t($)|0),!C.TYPED_ARRAY_SUPPORT)for(var Q=0;Q<$;++Q)ae[Q]=0;return ae}C.allocUnsafe=function(ae){return f(null,ae)},C.allocUnsafeSlow=function(ae){return f(null,ae)};function p(ae,$,Q){if((typeof Q!="string"||Q==="")&&(Q="utf8"),!C.isEncoding(Q))throw new TypeError('"encoding" must be a valid string encoding');var te=a($,Q)|0;ae=W(ae,te);var he=ae.write($,Q);return he!==te&&(ae=ae.slice(0,he)),ae}function l(ae,$){var Q=$.length<0?0:t($.length)|0;ae=W(ae,Q);for(var te=0;te<Q;te+=1)ae[te]=$[te]&255;return ae}function o(ae,$,Q,te){if($.byteLength,Q<0||$.byteLength<Q)throw new RangeError("'offset' is out of bounds");if($.byteLength<Q+(te||0))throw new RangeError("'length' is out of bounds");return Q===void 0&&te===void 0?$=new Uint8Array($):te===void 0?$=new Uint8Array($,Q):$=new Uint8Array($,Q,te),C.TYPED_ARRAY_SUPPORT?(ae=$,ae.__proto__=C.prototype):ae=l(ae,$),ae}function s(ae,$){if(C.isBuffer($)){var Q=t($.length)|0;return ae=W(ae,Q),ae.length===0||$.copy(ae,0,0,Q),ae}if($){if(typeof ArrayBuffer!="undefined"&&$.buffer instanceof ArrayBuffer||"length"in $)return typeof $.length!="number"||rt($.length)?W(ae,0):l(ae,$);if($.type==="Buffer"&&G($.data))return l(ae,$.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function t(ae){if(ae>=I())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+I().toString(16)+" bytes");return ae|0}function u(ae){return+ae!=ae&&(ae=0),C.alloc(+ae)}C.isBuffer=function($){return!!($!=null&&$._isBuffer)},C.compare=function($,Q){if(!C.isBuffer($)||!C.isBuffer(Q))throw new TypeError("Arguments must be Buffers");if($===Q)return 0;for(var te=$.length,he=Q.length,ge=0,we=Math.min(te,he);ge<we;++ge)if($[ge]!==Q[ge]){te=$[ge],he=Q[ge];break}return te<he?-1:he<te?1:0},C.isEncoding=function($){switch(String($).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},C.concat=function($,Q){if(!G($))throw new TypeError('"list" argument must be an Array of Buffers');if($.length===0)return C.alloc(0);var te;if(Q===void 0)for(Q=0,te=0;te<$.length;++te)Q+=$[te].length;var he=C.allocUnsafe(Q),ge=0;for(te=0;te<$.length;++te){var we=$[te];if(!C.isBuffer(we))throw new TypeError('"list" argument must be an Array of Buffers');we.copy(he,ge),ge+=we.length}return he};function a(ae,$){if(C.isBuffer(ae))return ae.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(ae)||ae instanceof ArrayBuffer))return ae.byteLength;typeof ae!="string"&&(ae=""+ae);var Q=ae.length;if(Q===0)return 0;for(var te=!1;;)switch($){case"ascii":case"latin1":case"binary":return Q;case"utf8":case"utf-8":case void 0:return ye(ae).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Q*2;case"hex":return Q>>>1;case"base64":return _e(ae).length;default:if(te)return ye(ae).length;$=(""+$).toLowerCase(),te=!0}}C.byteLength=a;function i(ae,$,Q){var te=!1;if(($===void 0||$<0)&&($=0),$>this.length)return"";if((Q===void 0||Q>this.length)&&(Q=this.length),Q<=0)return"";if(Q>>>=0,$>>>=0,Q<=$)return"";for(ae||(ae="utf8");;)switch(ae){case"hex":return U(this,$,Q);case"utf8":case"utf-8":return x(this,$,Q);case"ascii":return F(this,$,Q);case"latin1":case"binary":return R(this,$,Q);case"base64":return y(this,$,Q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,$,Q);default:if(te)throw new TypeError("Unknown encoding: "+ae);ae=(ae+"").toLowerCase(),te=!0}}C.prototype._isBuffer=!0;function D(ae,$,Q){var te=ae[$];ae[$]=ae[Q],ae[Q]=te}C.prototype.swap16=function(){var $=this.length;if($%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var Q=0;Q<$;Q+=2)D(this,Q,Q+1);return this},C.prototype.swap32=function(){var $=this.length;if($%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var Q=0;Q<$;Q+=4)D(this,Q,Q+3),D(this,Q+1,Q+2);return this},C.prototype.swap64=function(){var $=this.length;if($%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var Q=0;Q<$;Q+=8)D(this,Q,Q+7),D(this,Q+1,Q+6),D(this,Q+2,Q+5),D(this,Q+3,Q+4);return this},C.prototype.toString=function(){var $=this.length|0;return $===0?"":arguments.length===0?x(this,0,$):i.apply(this,arguments)},C.prototype.equals=function($){if(!C.isBuffer($))throw new TypeError("Argument must be a Buffer");return this===$?!0:C.compare(this,$)===0},C.prototype.inspect=function(){var $="",Q=ve.INSPECT_MAX_BYTES;return this.length>0&&($=this.toString("hex",0,Q).match(/.{2}/g).join(" "),this.length>Q&&($+=" ... ")),"<Buffer "+$+">"},C.prototype.compare=function($,Q,te,he,ge){if(!C.isBuffer($))throw new TypeError("Argument must be a Buffer");if(Q===void 0&&(Q=0),te===void 0&&(te=$?$.length:0),he===void 0&&(he=0),ge===void 0&&(ge=this.length),Q<0||te>$.length||he<0||ge>this.length)throw new RangeError("out of range index");if(he>=ge&&Q>=te)return 0;if(he>=ge)return-1;if(Q>=te)return 1;if(Q>>>=0,te>>>=0,he>>>=0,ge>>>=0,this===$)return 0;for(var we=ge-he,ft=te-Q,Pt=Math.min(we,ft),jt=this.slice(he,ge),qe=$.slice(Q,te),Mt=0;Mt<Pt;++Mt)if(jt[Mt]!==qe[Mt]){we=jt[Mt],ft=qe[Mt];break}return we<ft?-1:ft<we?1:0};function w(ae,$,Q,te,he){if(ae.length===0)return-1;if(typeof Q=="string"?(te=Q,Q=0):Q>2147483647?Q=2147483647:Q<-2147483648&&(Q=-2147483648),Q=+Q,isNaN(Q)&&(Q=he?0:ae.length-1),Q<0&&(Q=ae.length+Q),Q>=ae.length){if(he)return-1;Q=ae.length-1}else if(Q<0)if(he)Q=0;else return-1;if(typeof $=="string"&&($=C.from($,te)),C.isBuffer($))return $.length===0?-1:S(ae,$,Q,te,he);if(typeof $=="number")return $=$&255,C.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?he?Uint8Array.prototype.indexOf.call(ae,$,Q):Uint8Array.prototype.lastIndexOf.call(ae,$,Q):S(ae,[$],Q,te,he);throw new TypeError("val must be string, number or Buffer")}function S(ae,$,Q,te,he){var ge=1,we=ae.length,ft=$.length;if(te!==void 0&&(te=String(te).toLowerCase(),te==="ucs2"||te==="ucs-2"||te==="utf16le"||te==="utf-16le")){if(ae.length<2||$.length<2)return-1;ge=2,we/=2,ft/=2,Q/=2}function Pt(at,Qe){return ge===1?at[Qe]:at.readUInt16BE(Qe*ge)}var jt;if(he){var qe=-1;for(jt=Q;jt<we;jt++)if(Pt(ae,jt)===Pt($,qe===-1?0:jt-qe)){if(qe===-1&&(qe=jt),jt-qe+1===ft)return qe*ge}else qe!==-1&&(jt-=jt-qe),qe=-1}else for(Q+ft>we&&(Q=we-ft),jt=Q;jt>=0;jt--){for(var Mt=!0,sn=0;sn<ft;sn++)if(Pt(ae,jt+sn)!==Pt($,sn)){Mt=!1;break}if(Mt)return jt}return-1}C.prototype.includes=function($,Q,te){return this.indexOf($,Q,te)!==-1},C.prototype.indexOf=function($,Q,te){return w(this,$,Q,te,!0)},C.prototype.lastIndexOf=function($,Q,te){return w(this,$,Q,te,!1)};function L(ae,$,Q,te){Q=Number(Q)||0;var he=ae.length-Q;te?(te=Number(te),te>he&&(te=he)):te=he;var ge=$.length;if(ge%2!==0)throw new TypeError("Invalid hex string");te>ge/2&&(te=ge/2);for(var we=0;we<te;++we){var ft=parseInt($.substr(we*2,2),16);if(isNaN(ft))return we;ae[Q+we]=ft}return we}function P(ae,$,Q,te){return He(ye($,ae.length-Q),ae,Q,te)}function _(ae,$,Q,te){return He(oe($),ae,Q,te)}function b(ae,$,Q,te){return _(ae,$,Q,te)}function g(ae,$,Q,te){return He(_e($),ae,Q,te)}function m(ae,$,Q,te){return He(Se($,ae.length-Q),ae,Q,te)}C.prototype.write=function($,Q,te,he){if(Q===void 0)he="utf8",te=this.length,Q=0;else if(te===void 0&&typeof Q=="string")he=Q,te=this.length,Q=0;else if(isFinite(Q))Q=Q|0,isFinite(te)?(te=te|0,he===void 0&&(he="utf8")):(he=te,te=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var ge=this.length-Q;if((te===void 0||te>ge)&&(te=ge),$.length>0&&(te<0||Q<0)||Q>this.length)throw new RangeError("Attempt to write outside buffer bounds");he||(he="utf8");for(var we=!1;;)switch(he){case"hex":return L(this,$,Q,te);case"utf8":case"utf-8":return P(this,$,Q,te);case"ascii":return _(this,$,Q,te);case"latin1":case"binary":return b(this,$,Q,te);case"base64":return g(this,$,Q,te);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m(this,$,Q,te);default:if(we)throw new TypeError("Unknown encoding: "+he);he=(""+he).toLowerCase(),we=!0}},C.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function y(ae,$,Q){return $===0&&Q===ae.length?V.fromByteArray(ae):V.fromByteArray(ae.slice($,Q))}function x(ae,$,Q){Q=Math.min(ae.length,Q);for(var te=[],he=$;he<Q;){var ge=ae[he],we=null,ft=ge>239?4:ge>223?3:ge>191?2:1;if(he+ft<=Q){var Pt,jt,qe,Mt;switch(ft){case 1:ge<128&&(we=ge);break;case 2:Pt=ae[he+1],(Pt&192)===128&&(Mt=(ge&31)<<6|Pt&63,Mt>127&&(we=Mt));break;case 3:Pt=ae[he+1],jt=ae[he+2],(Pt&192)===128&&(jt&192)===128&&(Mt=(ge&15)<<12|(Pt&63)<<6|jt&63,Mt>2047&&(Mt<55296||Mt>57343)&&(we=Mt));break;case 4:Pt=ae[he+1],jt=ae[he+2],qe=ae[he+3],(Pt&192)===128&&(jt&192)===128&&(qe&192)===128&&(Mt=(ge&15)<<18|(Pt&63)<<12|(jt&63)<<6|qe&63,Mt>65535&&Mt<1114112&&(we=Mt))}}we===null?(we=65533,ft=1):we>65535&&(we-=65536,te.push(we>>>10&1023|55296),we=56320|we&1023),te.push(we),he+=ft}return H(te)}var O=4096;function H(ae){var $=ae.length;if($<=O)return String.fromCharCode.apply(String,ae);for(var Q="",te=0;te<$;)Q+=String.fromCharCode.apply(String,ae.slice(te,te+=O));return Q}function F(ae,$,Q){var te="";Q=Math.min(ae.length,Q);for(var he=$;he<Q;++he)te+=String.fromCharCode(ae[he]&127);return te}function R(ae,$,Q){var te="";Q=Math.min(ae.length,Q);for(var he=$;he<Q;++he)te+=String.fromCharCode(ae[he]);return te}function U(ae,$,Q){var te=ae.length;(!$||$<0)&&($=0),(!Q||Q<0||Q>te)&&(Q=te);for(var he="",ge=$;ge<Q;++ge)he+=xe(ae[ge]);return he}function k(ae,$,Q){for(var te=ae.slice($,Q),he="",ge=0;ge<te.length;ge+=2)he+=String.fromCharCode(te[ge]+te[ge+1]*256);return he}C.prototype.slice=function($,Q){var te=this.length;$=~~$,Q=Q===void 0?te:~~Q,$<0?($+=te,$<0&&($=0)):$>te&&($=te),Q<0?(Q+=te,Q<0&&(Q=0)):Q>te&&(Q=te),Q<$&&(Q=$);var he;if(C.TYPED_ARRAY_SUPPORT)he=this.subarray($,Q),he.__proto__=C.prototype;else{var ge=Q-$;he=new C(ge,void 0);for(var we=0;we<ge;++we)he[we]=this[we+$]}return he};function d(ae,$,Q){if(ae%1!==0||ae<0)throw new RangeError("offset is not uint");if(ae+$>Q)throw new RangeError("Trying to access beyond buffer length")}C.prototype.readUIntLE=function($,Q,te){$=$|0,Q=Q|0,te||d($,Q,this.length);for(var he=this[$],ge=1,we=0;++we<Q&&(ge*=256);)he+=this[$+we]*ge;return he},C.prototype.readUIntBE=function($,Q,te){$=$|0,Q=Q|0,te||d($,Q,this.length);for(var he=this[$+--Q],ge=1;Q>0&&(ge*=256);)he+=this[$+--Q]*ge;return he},C.prototype.readUInt8=function($,Q){return Q||d($,1,this.length),this[$]},C.prototype.readUInt16LE=function($,Q){return Q||d($,2,this.length),this[$]|this[$+1]<<8},C.prototype.readUInt16BE=function($,Q){return Q||d($,2,this.length),this[$]<<8|this[$+1]},C.prototype.readUInt32LE=function($,Q){return Q||d($,4,this.length),(this[$]|this[$+1]<<8|this[$+2]<<16)+this[$+3]*16777216},C.prototype.readUInt32BE=function($,Q){return Q||d($,4,this.length),this[$]*16777216+(this[$+1]<<16|this[$+2]<<8|this[$+3])},C.prototype.readIntLE=function($,Q,te){$=$|0,Q=Q|0,te||d($,Q,this.length);for(var he=this[$],ge=1,we=0;++we<Q&&(ge*=256);)he+=this[$+we]*ge;return ge*=128,he>=ge&&(he-=Math.pow(2,8*Q)),he},C.prototype.readIntBE=function($,Q,te){$=$|0,Q=Q|0,te||d($,Q,this.length);for(var he=Q,ge=1,we=this[$+--he];he>0&&(ge*=256);)we+=this[$+--he]*ge;return ge*=128,we>=ge&&(we-=Math.pow(2,8*Q)),we},C.prototype.readInt8=function($,Q){return Q||d($,1,this.length),this[$]&128?(255-this[$]+1)*-1:this[$]},C.prototype.readInt16LE=function($,Q){Q||d($,2,this.length);var te=this[$]|this[$+1]<<8;return te&32768?te|4294901760:te},C.prototype.readInt16BE=function($,Q){Q||d($,2,this.length);var te=this[$+1]|this[$]<<8;return te&32768?te|4294901760:te},C.prototype.readInt32LE=function($,Q){return Q||d($,4,this.length),this[$]|this[$+1]<<8|this[$+2]<<16|this[$+3]<<24},C.prototype.readInt32BE=function($,Q){return Q||d($,4,this.length),this[$]<<24|this[$+1]<<16|this[$+2]<<8|this[$+3]},C.prototype.readFloatLE=function($,Q){return Q||d($,4,this.length),j.read(this,$,!0,23,4)},C.prototype.readFloatBE=function($,Q){return Q||d($,4,this.length),j.read(this,$,!1,23,4)},C.prototype.readDoubleLE=function($,Q){return Q||d($,8,this.length),j.read(this,$,!0,52,8)},C.prototype.readDoubleBE=function($,Q){return Q||d($,8,this.length),j.read(this,$,!1,52,8)};function z(ae,$,Q,te,he,ge){if(!C.isBuffer(ae))throw new TypeError('"buffer" argument must be a Buffer instance');if($>he||$<ge)throw new RangeError('"value" argument is out of bounds');if(Q+te>ae.length)throw new RangeError("Index out of range")}C.prototype.writeUIntLE=function($,Q,te,he){if($=+$,Q=Q|0,te=te|0,!he){var ge=Math.pow(2,8*te)-1;z(this,$,Q,te,ge,0)}var we=1,ft=0;for(this[Q]=$&255;++ft<te&&(we*=256);)this[Q+ft]=$/we&255;return Q+te},C.prototype.writeUIntBE=function($,Q,te,he){if($=+$,Q=Q|0,te=te|0,!he){var ge=Math.pow(2,8*te)-1;z(this,$,Q,te,ge,0)}var we=te-1,ft=1;for(this[Q+we]=$&255;--we>=0&&(ft*=256);)this[Q+we]=$/ft&255;return Q+te},C.prototype.writeUInt8=function($,Q,te){return $=+$,Q=Q|0,te||z(this,$,Q,1,255,0),C.TYPED_ARRAY_SUPPORT||($=Math.floor($)),this[Q]=$&255,Q+1};function Y(ae,$,Q,te){$<0&&($=65535+$+1);for(var he=0,ge=Math.min(ae.length-Q,2);he<ge;++he)ae[Q+he]=($&255<<8*(te?he:1-he))>>>(te?he:1-he)*8}C.prototype.writeUInt16LE=function($,Q,te){return $=+$,Q=Q|0,te||z(this,$,Q,2,65535,0),C.TYPED_ARRAY_SUPPORT?(this[Q]=$&255,this[Q+1]=$>>>8):Y(this,$,Q,!0),Q+2},C.prototype.writeUInt16BE=function($,Q,te){return $=+$,Q=Q|0,te||z(this,$,Q,2,65535,0),C.TYPED_ARRAY_SUPPORT?(this[Q]=$>>>8,this[Q+1]=$&255):Y(this,$,Q,!1),Q+2};function re(ae,$,Q,te){$<0&&($=4294967295+$+1);for(var he=0,ge=Math.min(ae.length-Q,4);he<ge;++he)ae[Q+he]=$>>>(te?he:3-he)*8&255}C.prototype.writeUInt32LE=function($,Q,te){return $=+$,Q=Q|0,te||z(this,$,Q,4,4294967295,0),C.TYPED_ARRAY_SUPPORT?(this[Q+3]=$>>>24,this[Q+2]=$>>>16,this[Q+1]=$>>>8,this[Q]=$&255):re(this,$,Q,!0),Q+4},C.prototype.writeUInt32BE=function($,Q,te){return $=+$,Q=Q|0,te||z(this,$,Q,4,4294967295,0),C.TYPED_ARRAY_SUPPORT?(this[Q]=$>>>24,this[Q+1]=$>>>16,this[Q+2]=$>>>8,this[Q+3]=$&255):re(this,$,Q,!1),Q+4},C.prototype.writeIntLE=function($,Q,te,he){if($=+$,Q=Q|0,!he){var ge=Math.pow(2,8*te-1);z(this,$,Q,te,ge-1,-ge)}var we=0,ft=1,Pt=0;for(this[Q]=$&255;++we<te&&(ft*=256);)$<0&&Pt===0&&this[Q+we-1]!==0&&(Pt=1),this[Q+we]=($/ft>>0)-Pt&255;return Q+te},C.prototype.writeIntBE=function($,Q,te,he){if($=+$,Q=Q|0,!he){var ge=Math.pow(2,8*te-1);z(this,$,Q,te,ge-1,-ge)}var we=te-1,ft=1,Pt=0;for(this[Q+we]=$&255;--we>=0&&(ft*=256);)$<0&&Pt===0&&this[Q+we+1]!==0&&(Pt=1),this[Q+we]=($/ft>>0)-Pt&255;return Q+te},C.prototype.writeInt8=function($,Q,te){return $=+$,Q=Q|0,te||z(this,$,Q,1,127,-128),C.TYPED_ARRAY_SUPPORT||($=Math.floor($)),$<0&&($=255+$+1),this[Q]=$&255,Q+1},C.prototype.writeInt16LE=function($,Q,te){return $=+$,Q=Q|0,te||z(this,$,Q,2,32767,-32768),C.TYPED_ARRAY_SUPPORT?(this[Q]=$&255,this[Q+1]=$>>>8):Y(this,$,Q,!0),Q+2},C.prototype.writeInt16BE=function($,Q,te){return $=+$,Q=Q|0,te||z(this,$,Q,2,32767,-32768),C.TYPED_ARRAY_SUPPORT?(this[Q]=$>>>8,this[Q+1]=$&255):Y(this,$,Q,!1),Q+2},C.prototype.writeInt32LE=function($,Q,te){return $=+$,Q=Q|0,te||z(this,$,Q,4,2147483647,-2147483648),C.TYPED_ARRAY_SUPPORT?(this[Q]=$&255,this[Q+1]=$>>>8,this[Q+2]=$>>>16,this[Q+3]=$>>>24):re(this,$,Q,!0),Q+4},C.prototype.writeInt32BE=function($,Q,te){return $=+$,Q=Q|0,te||z(this,$,Q,4,2147483647,-2147483648),$<0&&($=4294967295+$+1),C.TYPED_ARRAY_SUPPORT?(this[Q]=$>>>24,this[Q+1]=$>>>16,this[Q+2]=$>>>8,this[Q+3]=$&255):re(this,$,Q,!1),Q+4};function le(ae,$,Q,te,he,ge){if(Q+te>ae.length)throw new RangeError("Index out of range");if(Q<0)throw new RangeError("Index out of range")}function Ne(ae,$,Q,te,he){return he||le(ae,$,Q,4,34028234663852886e22,-34028234663852886e22),j.write(ae,$,Q,te,23,4),Q+4}C.prototype.writeFloatLE=function($,Q,te){return Ne(this,$,Q,!0,te)},C.prototype.writeFloatBE=function($,Q,te){return Ne(this,$,Q,!1,te)};function Ce(ae,$,Q,te,he){return he||le(ae,$,Q,8,17976931348623157e292,-17976931348623157e292),j.write(ae,$,Q,te,52,8),Q+8}C.prototype.writeDoubleLE=function($,Q,te){return Ce(this,$,Q,!0,te)},C.prototype.writeDoubleBE=function($,Q,te){return Ce(this,$,Q,!1,te)},C.prototype.copy=function($,Q,te,he){if(te||(te=0),!he&&he!==0&&(he=this.length),Q>=$.length&&(Q=$.length),Q||(Q=0),he>0&&he<te&&(he=te),he===te)return 0;if($.length===0||this.length===0)return 0;if(Q<0)throw new RangeError("targetStart out of bounds");if(te<0||te>=this.length)throw new RangeError("sourceStart out of bounds");if(he<0)throw new RangeError("sourceEnd out of bounds");he>this.length&&(he=this.length),$.length-Q<he-te&&(he=$.length-Q+te);var ge=he-te,we;if(this===$&&te<Q&&Q<he)for(we=ge-1;we>=0;--we)$[we+Q]=this[we+te];else if(ge<1e3||!C.TYPED_ARRAY_SUPPORT)for(we=0;we<ge;++we)$[we+Q]=this[we+te];else Uint8Array.prototype.set.call($,this.subarray(te,te+ge),Q);return ge},C.prototype.fill=function($,Q,te,he){if(typeof $=="string"){if(typeof Q=="string"?(he=Q,Q=0,te=this.length):typeof te=="string"&&(he=te,te=this.length),$.length===1){var ge=$.charCodeAt(0);ge<256&&($=ge)}if(he!==void 0&&typeof he!="string")throw new TypeError("encoding must be a string");if(typeof he=="string"&&!C.isEncoding(he))throw new TypeError("Unknown encoding: "+he)}else typeof $=="number"&&($=$&255);if(Q<0||this.length<Q||this.length<te)throw new RangeError("Out of range index");if(te<=Q)return this;Q=Q>>>0,te=te===void 0?this.length:te>>>0,$||($=0);var we;if(typeof $=="number")for(we=Q;we<te;++we)this[we]=$;else{var ft=C.isBuffer($)?$:ye(new C($,he).toString()),Pt=ft.length;for(we=0;we<te-Q;++we)this[we+Q]=ft[we%Pt]}return this};var Te=/[^+\/0-9A-Za-z-_]/g;function Fe(ae){if(ae=Ve(ae).replace(Te,""),ae.length<2)return"";for(;ae.length%4!==0;)ae=ae+"=";return ae}function Ve(ae){return ae.trim?ae.trim():ae.replace(/^\s+|\s+$/g,"")}function xe(ae){return ae<16?"0"+ae.toString(16):ae.toString(16)}function ye(ae,$){$=$||Infinity;for(var Q,te=ae.length,he=null,ge=[],we=0;we<te;++we){if(Q=ae.charCodeAt(we),Q>55295&&Q<57344){if(!he){if(Q>56319){($-=3)>-1&&ge.push(239,191,189);continue}else if(we+1===te){($-=3)>-1&&ge.push(239,191,189);continue}he=Q;continue}if(Q<56320){($-=3)>-1&&ge.push(239,191,189),he=Q;continue}Q=(he-55296<<10|Q-56320)+65536}else he&&(($-=3)>-1&&ge.push(239,191,189));if(he=null,Q<128){if(($-=1)<0)break;ge.push(Q)}else if(Q<2048){if(($-=2)<0)break;ge.push(Q>>6|192,Q&63|128)}else if(Q<65536){if(($-=3)<0)break;ge.push(Q>>12|224,Q>>6&63|128,Q&63|128)}else if(Q<1114112){if(($-=4)<0)break;ge.push(Q>>18|240,Q>>12&63|128,Q>>6&63|128,Q&63|128)}else throw new Error("Invalid code point")}return ge}function oe(ae){for(var $=[],Q=0;Q<ae.length;++Q)$.push(ae.charCodeAt(Q)&255);return $}function Se(ae,$){for(var Q,te,he,ge=[],we=0;we<ae.length&&!(($-=2)<0);++we)Q=ae.charCodeAt(we),te=Q>>8,he=Q%256,ge.push(he),ge.push(te);return ge}function _e(ae){return V.toByteArray(Fe(ae))}function He(ae,$,Q,te){for(var he=0;he<te&&!(he+Q>=$.length||he>=ae.length);++he)$[he+Q]=ae[he];return he}function rt(ae){return ae!==ae}}).call(this,T("IyRk"))},HmJG:function(Bt,ve,T){},I8Z2:function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return G}),T.d(ve,"b",function(){return p}),T.d(ve,"c",function(){return o});var Z=T("q1tI"),V=function(){var s=function(t,u){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,i){a.__proto__=i}||function(a,i){for(var D in i)i.hasOwnProperty(D)&&(a[D]=i[D])},s(t,u)};return function(t,u){s(t,u);function a(){this.constructor=t}t.prototype=u===null?Object.create(u):(a.prototype=u.prototype,new a)}}(),j=Z.createContext(null),G=function(s){V(t,s);function t(){return s!==null&&s.apply(this,arguments)||this}return t.prototype.render=function(){return Z.createElement(j.Provider,{value:this.props.store},this.props.children)},t}(Z.Component),M=T("Gytx"),I=T.n(M),W=T("2mql"),C=T.n(W),r=function(){var s=function(t,u){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,i){a.__proto__=i}||function(a,i){for(var D in i)i.hasOwnProperty(D)&&(a[D]=i[D])},s(t,u)};return function(t,u){s(t,u);function a(){this.constructor=t}t.prototype=u===null?Object.create(u):(a.prototype=u.prototype,new a)}}(),A=function(){return A=Object.assign||function(s){for(var t,u=1,a=arguments.length;u<a;u++){t=arguments[u];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(s[i]=t[i])}return s},A.apply(this,arguments)};function v(s){return s.displayName||s.name||"Component"}var f=function(){return{}};function p(s,t){t===void 0&&(t={});var u=!!s,a=s||f;return function(D){var w=function(L){r(P,L);function P(_,b){var g=L.call(this,_,b)||this;return g.unsubscribe=null,g.handleChange=function(){if(!g.unsubscribe)return;var m=a(g.store.getState(),g.props);g.setState({subscribed:m})},g.store=g.context,g.state={subscribed:a(g.store.getState(),_),store:g.store,props:_},g}return P.getDerivedStateFromProps=function(_,b){return s&&s.length===2&&_!==b.props?{subscribed:a(b.store.getState(),_),props:_}:{props:_}},P.prototype.componentDidMount=function(){this.trySubscribe()},P.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},P.prototype.shouldComponentUpdate=function(_,b){return!I()(this.props,_)||!I()(this.state.subscribed,b.subscribed)},P.prototype.trySubscribe=function(){u&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},P.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},P.prototype.render=function(){var _=A(A(A({},this.props),this.state.subscribed),{store:this.store});return Z.createElement(D,A({},_,{ref:this.props.miniStoreForwardedRef}))},P.displayName="Connect("+v(D)+")",P.contextType=j,P}(Z.Component);if(t.forwardRef){var S=Z.forwardRef(function(L,P){return Z.createElement(w,A({},L,{miniStoreForwardedRef:P}))});return C()(S,D)}return C()(w,D)}}var l=function(){return l=Object.assign||function(s){for(var t,u=1,a=arguments.length;u<a;u++){t=arguments[u];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(s[i]=t[i])}return s},l.apply(this,arguments)};function o(s){var t=s,u=[];function a(w){t=l(l({},t),w);for(var S=0;S<u.length;S++)u[S]()}function i(){return t}function D(w){return u.push(w),function(){var L=u.indexOf(w);u.splice(L,1)}}return{setState:a,getState:i,subscribe:D}}},IBYe:function(Bt,ve,T){"use strict";function Z(V){return null}ve.a=Z},J44v:function(Bt,ve,T){"use strict";T.r(ve);var Z=T("Znn+"),V=T("ZTPi"),j=T("sPJy"),G=T("bE4q"),M=T("2qtc"),I=T("kLXV"),W=T("miYZ"),C=T("tsqr"),r=T("9og8"),A=T("+L6B"),v=T("2/Rp"),f=T("k1fw"),p=T("tJVT"),l=T("WmNS"),o=T.n(l),s=T("q1tI"),t=T.n(s),u=T("Ty5D"),a=T("9kvl"),i=T("55Ip"),D=T("jhfD"),w=T("1vsH"),S=T("giR+"),L=T("fyUT"),P=T("7Kak"),_=T("9yH6"),b=T("DjyN"),g=T("NUBc"),m=T("g9YV"),y=T("wCAj"),x=T("qVdP"),O=T("jsC+"),H=T("5NDa"),F=T("5rEg"),R=T("sRBo"),U=T("kaz8"),k=T("jCWc"),d=T("kPKH"),z=T("lUTK"),Y=T("BvKs"),re=T("14J3"),le=T("BMrR"),Ne=T("5Dmo"),Ce=T("3S7+"),Te=T("jrin"),Fe=T("oBTY"),Ve=T("y8nQ"),xe=T("Vl3Y"),ye=T("wd/R"),oe=T.n(ye),Se=T("BdwD"),_e=T("ErOA"),He=function(bn){var kn=bn.shixunHomeworks,Wn=bn.dispatch,dr=Object(u.i)();return t.a.createElement(I.a,{centered:!0,title:"\u63D0\u793A",visible:kn.actionTabs.key==="\u6253\u56DE\u91CD\u505A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(r.a)(o.a.mark(function ne(){var Re;return o.a.wrap(function(Be){for(;;)switch(Be.prev=Be.next){case 0:return Be.next=2,Object(_e.a)("/api/myshixuns/".concat(kn.actionTabs.selectArrs.myshixun_identifier,"/reset_my_game.json"),{method:"post",body:{course_id:dr.coursesId}});case 2:Re=Be.sent,Re.status===0&&(C.b.success("\u5220\u9664\u6210\u529F"),Wn({type:"shixunHomeworks/setActionTabs",payload:{}}),Wn({type:"shixunHomeworks/getWorkList",payload:Object(f.a)({},kn.actionTabs.params)}));case 4:case"end":return Be.stop()}},ne)})),onCancel:function(){Wn({type:"shixunHomeworks/setActionTabs",payload:{}})}},t.a.createElement("p",null,"\u8BE5\u4F5C\u4E1A\u5C06\u88AB\u6253\u56DE\u91CD\u505A\uFF0C\u5B66\u751F\u5B9E\u8BAD\u8BB0\u5F55\u5C06\u88AB\u6E05\u7A7A!"),t.a.createElement("p",null,"\u786E\u5B9A\u6253\u56DE?"))},rt=Object(a.a)(function(zn){var bn=zn.shixunHomeworks;return{shixunHomeworks:bn}})(He),ae=function(bn){var kn=bn.shixunHomeworks,Wn=bn.dispatch,dr=Object(u.i)(),ne=Object(s.useState)(!0),Re=Object(p.a)(ne,2),$e=Re[0],Be=Re[1],Ye=xe.a.useForm(),et=Object(p.a)(Ye,1),it=et[0];return t.a.createElement(t.a.Fragment,null,t.a.createElement(I.a,{centered:!0,title:"\u8C03\u5206",visible:kn.actionTabs.key==="\u8C03\u5206",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(r.a)(o.a.mark(function Ae(){var ze,yt;return o.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.next=2,it.validateFields();case 2:return ze=it.getFieldsValue(),Tt.next=5,Object(_e.a)("/api/student_works/".concat(kn.actionTabs.id,"/adjust_score.json"),{method:"post",body:Object(f.a)({},ze)});case 5:yt=Tt.sent,yt.status===0&&(C.b.success("\u8BC4\u9605\u6210\u529F"),it.resetFields(),Wn({type:"shixunHomeworks/setActionTabs",payload:{}}),Wn({type:"shixunHomeworks/getWorkList",payload:Object(f.a)({},kn.actionTabs.params)}));case 7:case"end":return Tt.stop()}},Ae)})),onCancel:function(){Wn({type:"shixunHomeworks/setActionTabs",payload:{}})}},t.a.createElement("p",{className:"tc"},"\u8BE5\u5B66\u751F\u7684\u6700\u7EC8\u6210\u7EE9\u5C06\u4E0D\u4F1A\u6309\u7167\u8BC4\u5206\u89C4\u5219\u8FDB\u884C\u8BA1\u7B97"),t.a.createElement(xe.a,{form:it,layout:"horizontal"},t.a.createElement("div",{style:{display:"flex",alignItems:"baseline"}},t.a.createElement(xe.a.Item,{label:"\u6210\u7EE9",name:"score",rules:[{required:!0,message:"\u8BF7\u8F93\u5165!"}]},t.a.createElement(L.a,{min:0,placeholder:"\u8BF7\u586B\u5199\u5206\u6570"})),t.a.createElement("span",{className:"ml10"},"\u5206")),t.a.createElement("div",null,t.a.createElement(xe.a.Item,{name:"comment"},t.a.createElement(F.a.TextArea,{placeholder:"\u8BF7\u586B\u5199\u60A8\u5BF9\u4F5C\u54C1\u8C03\u5206\u7684\u539F\u56E0",rows:8}))))))},$=Object(a.a)(function(zn){var bn=zn.shixunHomeworks;return{shixunHomeworks:bn}})(ae),Q=function(bn){var kn=bn.shixunHomeworks,Wn=bn.dispatch,dr=bn.getData;return t.a.createElement(I.a,{centered:!0,title:"\u63D0\u793A",visible:kn.actionTabs.key==="redoShixunModal",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(r.a)(o.a.mark(function ne(){var Re;return o.a.wrap(function(Be){for(;;)switch(Be.prev=Be.next){case 0:return Be.next=2,Object(_e.a)("/api/homework_commons/".concat(kn.actionTabs.homework_common_id,"/batch_redo_modal.json"),{method:"post",body:{student_work_id:kn.actionTabs.student_work_id}});case 2:Re=Be.sent,Re.status===0&&(C.b.success("\u5220\u9664\u6210\u529F"),Wn({type:"shixunHomeworks/setActionTabs",payload:{}}),dr());case 4:case"end":return Be.stop()}},ne)})),onCancel:function(){Wn({type:"shixunHomeworks/setActionTabs",payload:{}})}},t.a.createElement("p",null,"\u8BE5\u4F5C\u4E1A\u5C06\u88AB\u6253\u56DE\u91CD\u505A\uFF0C\u5B66\u751F\u5B9E\u8BAD\u8BB0\u5F55\u5C06\u88AB\u6E05\u7A7A!"),t.a.createElement("p",null,"\u786E\u5B9A\u6253\u56DE?"))},te=Object(a.a)(function(zn){var bn=zn.shixunHomeworks;return{shixunHomeworks:bn}})(Q),he=T("NLgs"),ge=T("xKgJ"),we=T("3IPh"),ft=T.n(we),Pt=T("Ot1p"),jt=T("8Skl"),qe=T("y3Kf"),Mt=T("Llu2"),sn=T("0NbB"),at=T("mgmH"),Qe=Object(s.createRef)(),Et=function(bn){var kn,Wn,dr,ne,Re,$e,Be,Ye,et,it,Ae,ze,yt,en,Tt,vt,ct,St,Ut,At,on,xn,vn,Qt=bn.shixunHomeworks,Dn=bn.loading,Rn=bn.zip,zt=bn.btnLoading,Kt=bn.setBtnLoading,Cn=bn.dispatch,Zt=Object(s.useState)(Object(f.a)(Object(f.a)({},Object(u.i)()),{page:1,limit:20})),Nn=Object(p.a)(Zt,2),Vt=Nn[0],Un=Nn[1],Lt=Object(u.h)(),kt=Qt.workList,sr=Object(s.useState)(""),Sn=Object(p.a)(sr,2),Mn=Sn[0],wn=Sn[1],an=Object(s.useState)(""),Yt=Object(p.a)(an,2),Gn=Yt[0],mn=Yt[1],Wt=Object(s.useState)(""),Ht=Object(p.a)(Wt,2),dn=Ht[0],Xt=Ht[1],ln=Object(s.useState)([]),Zn=Object(p.a)(ln,2),qn=Zn[0],En=Zn[1],Tr=Object(s.useState)([]),$n=Object(p.a)(Tr,2),Yn=$n[0],$r=$n[1],Gr=Object(s.useState)(!0),aa=Object(p.a)(Gr,2),Ta=aa[0],Ra=aa[1],ha=Object(s.useState)(1),_a=Object(p.a)(ha,2),ta=_a[0],Me=_a[1],tt=Object(s.useState)(),ot=Object(p.a)(tt,2),je=ot[0],ce=ot[1],Oe=Object(s.useState)(),me=Object(p.a)(Oe,2),ke=me[0],Ge=me[1],ut=Object(s.useState)(),Je=Object(p.a)(ut,2),pt=Je[0],Nt=Je[1],tn=Object(s.useState)(),fn=Object(p.a)(tn,2),Tn=fn[0],Kn=fn[1],fr=Object(s.useState)(!1),lr=Object(p.a)(fr,2),yr=lr[0],br=lr[1],vr=Object(s.useState)(1),Er=Object(p.a)(vr,2),Rr=Er[0],hr=Er[1],Nr=Object(s.useState)(!1),or=Object(p.a)(Nr,2),pn=or[0],Ln=or[1],xr=Object(s.useState)(!1),Dr=Object(p.a)(xr,2),Qn=Dr[0],Ar=Dr[1],qr=Object(s.useState)([]),Lr=Object(p.a)(qr,2),Ur=Lr[0],Wr=Lr[1],Br=Object(s.useState)(!1),Ir=Object(p.a)(Br,2),pr=Ir[0],na=Ir[1],ni=Object(s.useState)(),La=Object(p.a)(ni,2),ya=La[0],ea=La[1],Vr=Object(s.useState)(!1),Yr=Object(p.a)(Vr,2),ia=Yr[0],Ha=Yr[1],mi=Object(s.useState)({status:!1,visible:!0}),si=Object(p.a)(mi,2),Hr=si[0],Va=si[1],ri=Object(s.useState)({}),Jr=Object(p.a)(ri,2),jr=Jr[0],Ea=Jr[1],Si=xe.a.useForm(),Fi=Object(p.a)(Si,1),Ma=Fi[0];Object(s.useEffect)(function(){Qe&&Qe.current&&(Qe.current.clientHeight>47?Va({status:!0,visible:!0}):Va({status:!1,visible:!0}))},[kt.course_group_info&&kt.course_group_info.length]),Object(s.useEffect)(function(){kt!=null&&kt.course_id&&(Object(ge.c)()||$r([Object(f.a)(Object(f.a)({},kt),{isMe:!0})]),En(Object(Fe.a)(kt.student_works)))},[kt]);var Ya=function(){var Vn=Object(r.a)(o.a.mark(function Pn(){var tr;return o.a.wrap(function(Cr){for(;;)switch(Cr.prev=Cr.next){case 0:return Cr.next=2,Cn({type:"shixunHomeworks/getWorkList",payload:Object(f.a)({},Vt)});case 2:tr=Cr.sent,Object(ge.c)()?En(Object(Fe.a)(tr.student_works)):En(Object(Fe.a)(tr));case 4:case"end":return Cr.stop()}},Pn)}));return function(){return Vn.apply(this,arguments)}}();function Qa(){Me(1),ce(""),Ge(""),Nt(""),Kn(""),Wr([])}var Ei=function(){Vt.page=1;var Pn=Object.assign({},Ma.getFieldsValue());Ra(!1),Object.keys(Pn).map(function(tr){switch(tr){case"task_status":Pn[tr].includes("all")||kt[tr].length===Pn[tr].length||!Pn[tr].length?(delete Vt.work_status,Ma.setFieldsValue(Object(Te.a)({},"task_status","all"))):(Vt.work_status=Pn[tr],Ma.setFieldsValue(Object(Te.a)({},"task_status",Vt.work_status)));break;case"course_group_info":Pn[tr].includes("all")||kt[tr].length===Pn[tr].length||!Pn[tr].length?(delete Vt.course_group,Ma.setFieldsValue(Object(Te.a)({},"course_group_info","all"))):(Vt.course_group=Pn[tr],Ma.setFieldsValue(Object(Te.a)({},"course_group_info",Vt.course_group)));break;case"teacher_comment":Pn[tr].includes("all")||kt[tr].length===Pn[tr].length||!Pn[tr].length?(delete Vt.teacher_comment,Ma.setFieldsValue(Object(Te.a)({},"teacher_comment","all"))):(Vt.teacher_comment=Pn[tr][0],Ma.setFieldsValue(Object(Te.a)({},"teacher_comment",Pn[tr])));break}}),Ya()},Ri=function(Pn,tr){Vt.page=Pn,Vt.limit=20,Ya()},Bi=[{title:"\u5E8F\u53F7",dataIndex:"name",width:"5%",align:"center",render:function(Pn,tr,ra){return tr!=null&&tr.isMe&&qn!==null&&qn!==void 0&&qn.length?"\u6211":Vt.limit*(Vt.page-1)+ra+1}},{title:"\u59D3\u540D",width:"8%",ellipsis:!0,align:"center",dataIndex:"user_name"},!(kt!=null&&kt.anonymous_comment)&&{title:"\u5B66\u53F7",width:"8%",ellipsis:!0,align:"center",dataIndex:"student_id",sortOrder:jr.student_id,sortDirections:["descend","ascend"],sorter:!0,render:function(Pn){return Pn}},!(Object(ge.s)()&&(kt!=null&&(kn=kt.homework_status)!==null&&kn!==void 0&&kn.includes("\u533F\u8BC4\u4E2D")||kt!=null&&(Wn=kt.homework_status)!==null&&Wn!==void 0&&Wn.includes("\u7533\u8BC9\u4E2D")))&&kt.course_group_count!==0&&{title:"\u5206\u73ED",width:"8%",ellipsis:!0,align:"center",dataIndex:"group_name"},{title:"\u4F5C\u54C1\u72B6\u6001",dataIndex:"work_status",width:"8%",align:"center",render:function(Pn){return Pn===-1?"\u91CD\u505A\u4E2D":t.a.createElement(w.a,{status:Pn})}},{title:"\u6253\u56DE\u6B21\u6570",dataIndex:"redo_count",width:"8%",align:"center",render:function(Pn){return Pn||"- -"}},{title:"\u66F4\u65B0\u65F6\u95F4",width:"10%",align:"center",dataIndex:"update_time",sortOrder:jr.update_time,sortDirections:["descend","ascend"],sorter:!0,render:function(Pn){return Pn?oe()(Pn).format("YYYY-MM-DD HH:mm"):"--"}},(Object(ge.c)()||(kt==null||((dr=kt.homework_status)===null||dr===void 0)?void 0:dr.includes("\u5DF2\u622A\u6B62")))&&{title:"\u6559\u5E08\u8BC4\u5206",width:"8%",align:"center",dataIndex:"teacher_score"},(Object(ge.c)()||(kt==null||((ne=kt.homework_status)===null||ne===void 0)?void 0:ne.includes("\u5DF2\u622A\u6B62")))&&{title:"\u52A9\u6559\u8BC4\u5206",width:"8%",align:"center",dataIndex:"teaching_asistant_score"},(kt==null?void 0:kt.anonymous_comment)&&{title:"\u533F\u8BC4\u8BC4\u5206",width:"8%",align:"center",dataIndex:"student_score",render:function(Pn){return t.a.createElement(Ce.a,{title:"\u4F60\u7684\u8BC4\u9605\u5206\u6570\uFF1A".concat(Pn,"\u5206")},t.a.createElement("span",null,Pn))}},(kt==null?void 0:kt.anonymous_comment)&&Object(ge.i)()&&{title:"\u533F\u8BC4\u5B8C\u6210\u5EA6",width:"10%",align:"center",dataIndex:"anonymous_comment_rate",render:function(Pn){return t.a.createElement("span",null,Pn,"%")}},(kt==null?void 0:kt.anonymous_comment)&&{title:"\u5DF2\u8BC4\u6570",width:"8%",align:"center",dataIndex:"user_comment_count",render:function(Pn){return t.a.createElement(Ce.a,{title:"\u5728\u533F\u8BC4\u671F\u95F4\u8BC4\u9605\u7684\u4F5C\u54C1\u6570\u91CF"},t.a.createElement("span",null,Pn))}},(kt==null?void 0:kt.anonymous_comment)&&{title:"\u533F\u8BC4\u7533\u8BC9",width:"8%",align:"center",dataIndex:"appeal_all_count",render:function(Pn,tr){return t.a.createElement("div",null,!!Pn&&t.a.createElement(Ce.a,{placement:"bottom",title:"\u5171\u6709".concat(Pn,"\u6761\u533F\u8BC4\u7533\u8BC9\uFF0C").concat(tr.appeal_deal_count,"\u6761\u5F85\u5904\u7406")},t.a.createElement("span",{style:{minWidth:"30px",display:"inline-block",textAlign:"center"}},"".concat(tr.appeal_deal_count,"/").concat(Pn))),!Pn&&t.a.createElement("span",null,"-/-"))}},(Object(ge.c)()||Object(ge.s)()&&!(kt!=null&&kt.anonymous_comment)&&!kt.anonymous_appeal||Object(ge.s)()&&((Re=kt.homework_status)===null||Re===void 0?void 0:Re.includes("\u5DF2\u622A\u6B62")))&&{title:"\u5F53\u524D\u6210\u7EE9",width:"9%",align:"center",dataIndex:"work_score",sortOrder:jr.work_score,sortDirections:["descend","ascend"],sorter:!0,render:function(Pn){return Pn}},{title:"\u64CD\u4F5C",width:"8%",align:"center",dataInex:"action",render:function(Pn,tr){var ra;return tr.work_status===0&&!Object(ge.c)()?t.a.createElement("div",null,"--"):t.a.createElement("div",null,!Object(ge.c)()&&t.a.createElement("div",null,t.a.createElement(i.a,{target:"_blank",to:"/classrooms/".concat(Vt.coursesId,"/common_homework/").concat(Vt.categoryId,"/review/").concat(tr.work_id||tr.id)},"\u67E5\u770B")),Object(ge.c)()&&t.a.createElement("div",null,t.a.createElement(i.a,{className:"c-blue",target:"_blank",to:Vt.course_group?"/classrooms/".concat(Vt.coursesId,"/common_homework/").concat(Vt.categoryId,"/review/").concat(tr.id,"?ids=").concat((ra=Vt.course_group)===null||ra===void 0?void 0:ra.toString()):"/classrooms/".concat(Vt.coursesId,"/common_homework/").concat(Vt.categoryId,"/review/").concat(tr.id)},tr.has_comment?"\u5DF2\u8BC4\u9605":"\u8BC4\u9605"),t.a.createElement("br",null),t.a.createElement(Ce.a,{placement:"bottom",title:t.a.createElement("p",null,"\u8C03\u6574\u5B66\u751F\u5F53\u524D\u6210\u7EE9",t.a.createElement("br",null),"\u5176\u5B83\u5386\u53F2\u8BC4\u5206\u5C06\u5168\u90E8\u5931\u6548")},t.a.createElement("a",{className:"c-green",onClick:function(Oa){Oa.preventDefault(),Cn({type:"shixunHomeworks/setActionTabs",payload:{key:"\u8C03\u5206",selectArrs:tr,id:tr.id,params:Vt}})}},"\u8C03\u5206"))),Object(ge.c)()&&t.a.createElement("div",null,tr.shixun_url&&t.a.createElement(le.a,{justify:"center"},t.a.createElement(i.a,{target:"_blank",onClick:function(Oa){if(Oa.preventDefault(),Object(ge.v)()){Object(w.S)("".concat(tr.shixun_url,"?homework_common_id=").concat(Vt.categoryId));return}Object(he.d)()&&Object(w.S)("".concat(tr.shixun_url,"?homework_common_id=").concat(Vt.categoryId))},to:"".concat(tr.shixun_url)},"\u67E5\u770B\u5B9E\u8BAD")),tr.work_status!==-1&&tr.work_status!==0&&t.a.createElement(le.a,{justify:"center"},t.a.createElement("span",{className:ft.a.redoBtn,onClick:function(){Cn({type:"shixunHomeworks/setActionTabs",payload:{key:"redoShixunModal",homework_common_id:kt.homework_id,student_work_id:tr.id}})}},"\u6253\u56DE\u91CD\u505A"))))}}].filter(function(Vn){return!!Vn}),io=function(){var Vn=Object(r.a)(o.a.mark(function Pn(){var tr,ra;return o.a.wrap(function(Oa){for(;;)switch(Oa.prev=Oa.next){case 0:return Kt(!0),Oa.next=3,Object(_e.a)("/api/homework_commons/".concat(Vt==null?void 0:Vt.categoryId,"/export_student_works.json"),{method:"get",params:JSON.parse(sessionStorage.all_student_works_params)});case 3:tr=Oa.sent,tr.status===0?(ra=Rn.current)===null||ra===void 0||ra.exportReport(tr.files):Kt(!1);case 5:case"end":return Oa.stop()}},Pn)}));return function(){return Vn.apply(this,arguments)}}(),Ii=function(){return t.a.createElement(Y.a,null,t.a.createElement(Y.a.Item,{key:"1"},t.a.createElement("span",{onClick:function(){return Object(at.h)(JSON.parse(sessionStorage.all_student_works_params),"normal_work_list")}},"\u5BFC\u51FA\u6210\u7EE9")),t.a.createElement(Y.a.Item,{key:"2"},t.a.createElement(v.a,{loading:zt,style:{paddingLeft:0,background:"transparent"},type:"text",onClick:function(){return io()}},"\u5BFC\u51FA\u4F5C\u54C1\u9644\u4EF6")),t.a.createElement(Y.a.Item,{key:"3"},t.a.createElement(i.a,{to:"/classrooms/".concat(Vt.coursesId,"/exportlist/normal_work_list")},"\u5386\u53F2\u5BFC\u51FA")))};return t.a.createElement("section",{className:"".concat(ft.a.wrap," minH500")},t.a.createElement("aside",null,t.a.createElement("aside",{className:"minH500 bg-white pl30 ".concat(Object(ge.c)()?"pt30":""," pr30")},!(kt!=null&&kt.all_member_count)&&!Dn["shixunHomeworks/getWorkList"]&&((kt==null||(($e=kt.homework_status)===null||$e===void 0)?void 0:$e.includes("\u672A\u53D1\u5E03"))||(kt==null||((Be=kt.homework_status)===null||Be===void 0)?void 0:Be.includes("\u672A\u5F00\u59CB")))&&t.a.createElement("aside",{className:"bg-white inline-block w100"},t.a.createElement(Se.a,null)),!Object(ge.c)()&&t.a.createElement("aside",{className:"pt10 pb10"},t.a.createElement("span",{className:"c-orange"},kt.commit_count),"\u5DF2\u4EA4",t.a.createElement("span",{className:"ml10"},kt.uncommit_count),"\u672A\u4EA4",(kt==null||((Ye=kt.left_time)===null||Ye===void 0)?void 0:Ye.time)&&t.a.createElement("span",{className:"ml10"},t.a.createElement("span",null,kt==null||((et=kt.left_time)===null||et===void 0)?void 0:et.status),t.a.createElement("span",{className:"c-orange"},kt==null||((it=kt.left_time)===null||it===void 0)?void 0:it.time))),!(kt!=null&&(Ae=kt.homework_status)!==null&&Ae!==void 0&&Ae.includes("\u672A\u53D1\u5E03"))&&!(kt!=null&&(ze=kt.homework_status)!==null&&ze!==void 0&&ze.includes("\u672A\u5F00\u59CB"))&&t.a.createElement("aside",null,Object(ge.c)()&&!!(kt!=null&&kt.all_member_count)&&t.a.createElement("aside",{className:"mb30"},t.a.createElement(xe.a,{form:Ma,onChange:Ei,initialValues:(yt={},Object(Te.a)(yt,"task_status","all"),Object(Te.a)(yt,"course_group_info","all"),Object(Te.a)(yt,"teacher_comment","all"),yt)},!!((en=kt.teacher_comment)!==null&&en!==void 0&&en.length)&&Object(ge.c)()&&t.a.createElement(xe.a.Item,{name:"teacher_comment"},t.a.createElement(U.a.Group,{style:{width:"100%"}},t.a.createElement(le.a,null,t.a.createElement(d.a,{flex:"80px",style:{fontSize:14}},"\u4F60\u7684\u8BC4\u9605:"),t.a.createElement(d.a,{flex:"80px"},t.a.createElement(U.a,{value:"all"},"\u5168\u90E8")),t.a.createElement(d.a,{flex:"1"},(Tt=kt.teacher_comment)===null||Tt===void 0?void 0:Tt.map(function(Vn){return t.a.createElement(U.a,{value:Vn.id,key:Vn.id},Vn.name,"(",Vn.count,")")}))))),!!((vt=kt.task_status)!==null&&vt!==void 0&&vt.length)&&Object(ge.c)()&&t.a.createElement(xe.a.Item,{name:"task_status"},t.a.createElement(U.a.Group,{value:[],style:{width:"100%"}},t.a.createElement(le.a,null,t.a.createElement(d.a,{flex:"80px",style:{fontSize:14}},"\u4F5C\u54C1\u72B6\u6001:"),t.a.createElement(d.a,{flex:"80px"},t.a.createElement(U.a,{value:"all"},"\u5168\u90E8")),t.a.createElement(d.a,{flex:"1"},(ct=kt.task_status)===null||ct===void 0?void 0:ct.map(function(Vn){return t.a.createElement(U.a,{name:"task_status",value:Vn.id,key:Vn.id},Vn.name,"(",Vn.count,")")}))))),!!((St=kt.course_group_info)!==null&&St!==void 0&&St.length)&&t.a.createElement(xe.a.Item,{name:"course_group_info"},t.a.createElement(U.a.Group,{style:{width:"100%"}},t.a.createElement(le.a,null,t.a.createElement(d.a,{flex:"80px",style:{fontSize:14}},"\u5206\u73ED\u60C5\u51B5:"),t.a.createElement(d.a,{flex:"80px"},t.a.createElement(U.a,{value:"all",checked:!Vt.course_group_info},"\u5168\u90E8")),t.a.createElement(d.a,{flex:"1",className:"".concat(ft.a.workListClass," ").concat(Hr.visible?ft.a.visible:""," ").concat(Hr.status?"":ft.a.status)},t.a.createElement("div",{ref:Qe,className:ft.a.left},kt.course_group_info.map(function(Vn,Pn){return t.a.createElement(U.a,{value:Vn.course_group_id,key:Vn.course_group_id},Vn.group_group_name,"(",Vn.count,")")})),Hr.status&&t.a.createElement("div",{className:ft.a.tips,onClick:function(){return Va(Object(f.a)(Object(f.a)({},Hr),{},{visible:!Hr.visible}))}},t.a.createElement("span",null,Hr.visible?"\u5C55\u5F00":"\u6536\u8D77",Hr.visible?t.a.createElement(jt.a,{style:{marginBottom:"3px",marginLeft:"2px"}}):t.a.createElement(qe.a,{style:{marginBottom:"3px",marginLeft:"2px"}})))))))),t.a.createElement(le.a,{align:"middle"},t.a.createElement(d.a,{flex:"1"},t.a.createElement(le.a,{align:"middle"},t.a.createElement(d.a,null,t.a.createElement(F.a.Search,{allowClear:!0,placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D\u6216\u8005\u5B66\u53F7\u641C\u7D22",onSearch:function(Pn){Vt.page=1,Vt.search=Pn,Ya()},style:{width:240}})),t.a.createElement(d.a,null,t.a.createElement("span",{className:"ml5 c-red"},kt.work_count),"\u4E2A\u68C0\u7D22\u7ED3\u679C\uFF08",kt.work_count,"\u4E2A\u5B66\u751F\uFF09"))),t.a.createElement(d.a,{style:{textAlign:"end"},className:ft.a.workListButtonWrap},Object(ge.c)()&&t.a.createElement(v.a,{style:{marginRight:10},onClick:function(){Cn({type:"shixunHomeworks/setActionTabs",payload:{key:"\u4EE3\u7801\u67E5\u91CD",params:Vt}})}},"\u6587\u6863\u67E5\u91CD"),((kt==null||((Ut=kt.homework_status)===null||Ut===void 0)?void 0:Ut.includes("\u63D0\u4EA4\u4E2D"))||(kt==null||((At=kt.homework_status)===null||At===void 0)?void 0:At.includes("\u8865\u4EA4\u4E2D"))||(kt==null||((on=kt.homework_status)===null||on===void 0)?void 0:on.includes("\u8FDB\u884C\u4E2D")))&&t.a.createElement(v.a,{type:"default",style:{marginRight:"20px"},onClick:function(){Ar(!0)},icon:t.a.createElement("i",{className:"iconfont icon-dahuizhongzuo3x"})},"\u4E00\u952E\u6253\u56DE"),t.a.createElement(v.a,{type:"default",style:{marginRight:"20px"},onClick:function(){br(!0)},icon:t.a.createElement("i",{className:"iconfont icon-yijiandianping"})},"\u4E00\u952E\u70B9\u8BC4"),t.a.createElement(O.a,{overlay:Ii},t.a.createElement(v.a,null,t.a.createElement(Mt.a,null),"\u5BFC\u51FA",t.a.createElement(sn.a,null)))))),Object(ge.s)()&&t.a.createElement(y.a,{hideOnSinglePage:!0,pagination:!1,dataSource:Yn,columns:Bi,showHeader:!qn||(qn==null?void 0:qn.length)===0}),t.a.createElement(y.a,{loading:Dn["shixunHomeworks/getWorkList"],hideOnSinglePage:!0,pagination:!1,dataSource:qn,columns:Bi,rowKey:"id",onChange:function(Pn,tr,ra){if(jr={},ra.order===void 0){jr[ra.field]="descend";switch(ra.field){case"student_id":wn("descend"),Vt.b_order="desc";break}}else Vt.b_order=ra.order.replace("end",""),jr[ra.field]=ra.order;Ea(Object(f.a)({},jr)),Vt.order=ra.field,Ya()}}))),t.a.createElement("aside",{className:"tc mb50 mt30"},t.a.createElement(g.a,{showSizeChanger:!1,onChange:Ri,hideOnSinglePage:!0,defaultCurrent:Vt.page||1,current:Vt.page||1,defaultPageSize:20,total:Qt.workList.work_count}))),t.a.createElement($,null),t.a.createElement(rt,null),t.a.createElement(te,{getData:Ya}),t.a.createElement(I.a,{title:"\u4E00\u952E\u8BC4\u9605",visible:yr,centered:!0,onOk:function(){if(ta===1){if(!(je===0)){if(!je){C.b.info("\u5206\u6570\u4E0D\u80FD\u4E3A\u7A7A");return}}br(!1),Ln(!0)}else{if(!(pt===0||ke===0)){if(!pt){C.b.info("\u6700\u4F4E\u5206\u4E0D\u80FD\u4E3A\u7A7A");return}if(!ke){C.b.info("\u6700\u9AD8\u5206\u4E0D\u80FD\u4E3A\u7A7A");return}}if(pt>ke){C.b.info("\u6700\u9AD8\u5206\u4E0D\u80FD\u5927\u4E8E\u6700\u4F4E\u5206");return}br(!1),Ln(!0)}},onCancel:function(){br(!1),Qa()}},t.a.createElement("div",{style:{padding:"32px"}},t.a.createElement("div",null,t.a.createElement("div",null,t.a.createElement("span",{style:{width:"80px"}},"\u8BC4\u9605\u65B9\u5F0F\uFF1A"),t.a.createElement(_.a.Group,{value:ta,onChange:function(Pn){Me(Pn.target.value)}},t.a.createElement(_.a,{value:1},"\u7EDF\u4E00\u5F97\u5206"),t.a.createElement(_.a,{value:2},"\u533A\u95F4\u968F\u673A\u5F97\u5206"))),ta===1&&t.a.createElement("div",{style:{display:"flex",marginTop:"20px"}},t.a.createElement("span",{style:{width:"70px",textAlign:"end"}},t.a.createElement("span",{style:{color:"red"}},"*"),"\u5F97\u5206\uFF1A"),t.a.createElement(L.a,{min:0,max:100,value:je,onChange:function(Pn){return ce(Pn)}})),ta===2&&t.a.createElement("div",{style:{display:"flex",marginTop:"20px"}},t.a.createElement("span",{style:{width:"70px",textAlign:"end"}},t.a.createElement("span",{style:{color:"red"}},"*"),"\u6700\u4F4E\u5206\uFF1A"),t.a.createElement(L.a,{min:0,max:100,value:pt,onChange:function(Pn){return Nt(Pn)},style:{width:"100px"}}),t.a.createElement("span",{style:{width:"80px",textAlign:"end"}},t.a.createElement("span",{style:{color:"red"}},"*"),"\u6700\u9AD8\u5206\uFF1A"),t.a.createElement(L.a,{min:0,max:100,value:ke,onChange:function(Pn){return Ge(Pn)},style:{width:"100px"}})),t.a.createElement("div",{style:{display:"flex",marginTop:"20px"}},t.a.createElement("span",{style:{width:"80px",textAlign:"end"}},"\u8BC4\u8BED\uFF1A"),t.a.createElement(F.a.TextArea,{value:Tn,onChange:function(Pn){return Kn(Pn.target.value)},placeholder:"\u8BF7\u586B\u5199\u8BC4\u8BED"}))))),t.a.createElement(I.a,{title:"\u63D0\u793A",visible:pn,centered:!0,okText:"\u786E\u5B9A\u70B9\u8BC4",cancelText:"\u653E\u5F03\u70B9\u8BC4",onOk:Object(r.a)(o.a.mark(function Vn(){var Pn,tr;return o.a.wrap(function(Cr){for(;;)switch(Cr.prev=Cr.next){case 0:return Pn={},ta===1?Pn.score=je||"0":(Pn.min_score=pt||"0",Pn.max_score=ke||"0"),Pn.comment=Tn,Rr===1?Pn.student_work_ids=qn.map(function(Oa){return Oa.id}):Pn.student_work_ids=qn.filter(function(Oa){return!Oa.has_comment}).map(function(Oa){return Oa.id}),Cr.next=6,Object(_e.a)("/api/homework_commons/".concat(Vt.categoryId,"/batch_add_score.json"),{method:"post",body:Pn});case 6:tr=Cr.sent,tr.status===0&&(C.b.info("\u4FEE\u6539\u6210\u529F"),Ln(!1),Qa(),Ya());case 8:case"end":return Cr.stop()}},Vn)})),onCancel:function(){Qa(),Ln(!1)}},t.a.createElement("div",{style:{padding:"32px",textAlign:"center"}},t.a.createElement("span",null,"\u90E8\u5206\u5B66\u751F\u5DF2\u6709\u70B9\u8BC4\u5185\u5BB9\uFF0C\u662F\u5426\u8986\u76D6\u5DF2\u6709\u70B9\u8BC4\u5185\u5BB9\uFF1F"),t.a.createElement("br",null),t.a.createElement(_.a.Group,{value:Rr,onChange:function(Pn){return hr(Pn.target.value)}},t.a.createElement(_.a,{value:1},"\u8986\u76D6\u5DF2\u6709\u8BC4\u8BBA"),t.a.createElement(_.a,{value:2},"\u8DF3\u8FC7\u5DF2\u6709\u70B9\u8BC4")))),t.a.createElement(I.a,{title:"\u4E00\u952E\u6253\u56DE\u91CD\u505A",visible:Qn,centered:!0,destroyOnClose:!0,forceRender:!0,width:700,onOk:Object(r.a)(o.a.mark(function Vn(){var Pn,tr;return o.a.wrap(function(Cr){for(;;)switch(Cr.prev=Cr.next){case 0:if(!(ta===2)){Cr.next=13;break}if(!(Ur.length<=0)){Cr.next=4;break}return C.b.info("\u8BF7\u9009\u62E9\u4F5C\u4E1A\u72B6\u6001"),Cr.abrupt("return");case 4:if(Tn){Cr.next=7;break}return C.b.info("\u8BC4\u8BED\u4E0D\u80FD\u4E3A\u7A7A"),Cr.abrupt("return");case 7:return Cr.next=9,Object(_e.a)("/api/homework_commons/".concat(Vt.categoryId,"/confirm_redo_modal.json"),{method:"post",body:{id:Vt.categoryId,comment:Tn,status:Ur}});case 9:Pn=Cr.sent,Pn.status===0&&(ea(Pn),Ar(!1),na(!0)),Cr.next=32;break;case 13:if(!(pt===0||ke===0)){Cr.next=16;break}Cr.next=22;break;case 16:if(pt){Cr.next=19;break}return C.b.info("\u6700\u4F4E\u5206\u4E0D\u80FD\u4E3A\u7A7A"),Cr.abrupt("return");case 19:if(ke){Cr.next=22;break}return C.b.info("\u6700\u9AD8\u5206\u4E0D\u80FD\u4E3A\u7A7A"),Cr.abrupt("return");case 22:if(!(pt>ke)){Cr.next=25;break}return C.b.info("\u6700\u9AD8\u5206\u4E0D\u80FD\u5927\u4E8E\u6700\u4F4E\u5206"),Cr.abrupt("return");case 25:if(Tn){Cr.next=28;break}return C.b.info("\u8BC4\u8BED\u4E0D\u80FD\u4E3A\u7A7A"),Cr.abrupt("return");case 28:return Cr.next=30,Object(_e.a)("/api/homework_commons/".concat(Vt.categoryId,"/confirm_redo_modal.json"),{method:"post",body:{id:Vt.categoryId,comment:Tn,min_score:pt,max_score:ke}});case 30:tr=Cr.sent,tr.status===0&&(ea(tr),Ar(!1),na(!0));case 32:case"end":return Cr.stop()}},Vn)})),onCancel:function(){Ar(!1),Qa()}},t.a.createElement("div",{style:{padding:"32px"}},t.a.createElement("div",null,t.a.createElement("div",null,t.a.createElement("span",{style:{width:"80px"}},"\u6253\u56DE\u65B9\u5F0F\uFF1A"),t.a.createElement(_.a.Group,{value:ta,onChange:function(Pn){Me(Pn.target.value)}},t.a.createElement(_.a,{value:1},"\u6309\u6210\u7EE9\u6253\u56DE"),t.a.createElement(_.a,{value:2},"\u6309\u4F5C\u4E1A\u72B6\u6001\u6253\u56DE"))),ta===1&&t.a.createElement("div",{style:{display:"flex",marginTop:"20px"}},t.a.createElement("span",{style:{width:"70px",textAlign:"end"}},t.a.createElement("span",{style:{color:"red"}},"*"),"\u6700\u4F4E\u5206\uFF1A"),t.a.createElement(L.a,{min:0,max:100,value:pt,onChange:function(Pn){return Nt(Pn)},style:{width:"100px"}}),t.a.createElement("span",{style:{width:"80px",textAlign:"end"}},t.a.createElement("span",{style:{color:"red"}},"*"),"\u6700\u9AD8\u5206\uFF1A"),t.a.createElement(L.a,{min:0,max:100,value:ke,onChange:function(Pn){return Ge(Pn)},style:{width:"100px"}})),ta===2&&t.a.createElement("div",{style:{display:"flex",marginTop:"20px"}},t.a.createElement("span",{style:{width:"80px"}},"\u4F5C\u4E1A\u72B6\u6001\uFF1A"),t.a.createElement(U.a.Group,{onChange:function(Pn){Wr(Object(Fe.a)(Pn))},style:{width:"100%"}},(xn=kt.task_status)===null||xn===void 0?void 0:xn.map(function(Vn,Pn){return t.a.createElement(U.a,{name:"task_status",value:Vn.id},Vn.name,"(",Vn.count,")")}))),t.a.createElement("div",{style:{display:"flex",marginTop:"20px"}},t.a.createElement("span",{style:{width:"70px",textAlign:"end"}},t.a.createElement("span",{style:{color:"red"}},"*")," \u8BC4\u8BED\uFF1A"),t.a.createElement(Pt.a,{className:ft.a.MdEditor,onChange:function(Pn){return Kn(Pn)},placeholder:"\u8BF7\u586B\u5199\u8BC4\u8BED"}))))),t.a.createElement(I.a,{visible:pr,title:"\u6253\u56DE\u786E\u8BA4",onOk:Object(r.a)(o.a.mark(function Vn(){var Pn,tr;return o.a.wrap(function(Cr){for(;;)switch(Cr.prev=Cr.next){case 0:if(!(ta===2)){Cr.next=7;break}return Cr.next=3,Object(_e.a)("/api/homework_commons/".concat(Vt.categoryId,"/batch_redo_modal.json"),{method:"post",body:{id:Vt.categoryId,comment:Tn,status:Ur}});case 3:Pn=Cr.sent,Pn.status===0&&(C.b.info("\u6253\u56DE\u6210\u529F"),Qa(),Ya(),na(!1)),Cr.next=11;break;case 7:return Cr.next=9,Object(_e.a)("/api/homework_commons/".concat(Vt.categoryId,"/batch_redo_modal.json"),{method:"post",body:{id:Vt.categoryId,comment:Tn,min_score:pt,max_score:ke}});case 9:tr=Cr.sent,tr.status===0&&(C.b.info("\u6253\u56DE\u6210\u529F"),Qa(),Ya(),na(!1));case 11:case"end":return Cr.stop()}},Vn)})),onCancel:function(){Qa(),na(!1)}},t.a.createElement("div",{style:{padding:"32px"}},ta===1&&t.a.createElement("span",null,"\u786E\u8BA4\u5C06\u6210\u7EE9\u5728",pt,"-",ke,"\u7684\u5B66\u751F\u8FDB\u884C\u6253\u56DE\u91CD\u505A\u5417\uFF1F"),ta===2&&t.a.createElement("span",null,"\u786E\u8BA4\u5C06\u4F5C\u4E1A\u72B6\u6001\u4E3A",((vn=kt.task_status)===null||vn===void 0?void 0:vn.filter(function(Vn){return Ur==null?void 0:Ur.includes(Vn.id)}).map(function(Vn){return Vn.name}).toString())+",","\u7684\u5B66\u751F\u8FDB\u884C\u4F5C\u4E1A\u6253\u56DE\u91CD\u505A\u5417\uFF1F"),t.a.createElement("br",null),t.a.createElement("span",null,"\u8BE5\u6761\u4EF6\u4E0B\u5171\u6709",ya==null?void 0:ya.count,"\u540D\u5B66\u751F"))))},It=Object(a.a)(function(zn){var bn=zn.shixunHomeworks,kn=zn.loading,Wn=zn.user;return{shixunHomeworks:bn,loading:kn.effects,user:Wn}})(Et),dt=T("m3rI"),mt=T("9Bee"),We=function(bn){var kn=bn.shixunHomeworks,Wn=bn.dispatch,dr=Object(u.i)();return t.a.createElement(I.a,{centered:!0,title:"\u63D0\u793A",visible:kn.actionTabs.key==="\u5220\u9664",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(r.a)(o.a.mark(function ne(){var Re;return o.a.wrap(function(Be){for(;;)switch(Be.prev=Be.next){case 0:return Be.next=2,Wn({type:"shixunHomeworks/deleteReply",payload:{object_id:kn.actionTabs.selectArr.id,object_type:"journals_for_message"}});case 2:Re=Be.sent,Re.status===0&&(C.b.success("\u5220\u9664\u6210\u529F"),Wn({type:"shixunHomeworks/setActionTabs",payload:{}}),Wn({type:"shixunHomeworks/getReplyList",payload:Object(f.a)({},kn.actionTabs.params)}));case 4:case"end":return Be.stop()}},ne)})),onCancel:function(){Wn({type:"shixunHomeworks/setActionTabs",payload:{}})}},t.a.createElement("p",null,"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417\uFF1F"))},De=Object(a.a)(function(zn){var bn=zn.shixunHomeworks;return{shixunHomeworks:bn}})(We),Le=T("HBuW"),de=T("/MfK"),fe=T("BtR2"),Ee=T("/iVV"),Pe=T.n(Ee);oe.a.locale("ZH-cn");var Ue=function(bn){var kn,Wn,dr,ne,Re=bn.shixunHomeworks,$e=bn.classroomList,Be=bn.user,Ye=bn.globalSetting,et=bn.loading,it=bn.dispatch,Ae=Object(s.useState)(Object(f.a)({},Object(u.i)())),ze=Object(p.a)(Ae,2),yt=ze[0],en=ze[1],Tt=Object(s.useState)(!1),vt=Object(p.a)(Tt,2),ct=vt[0],St=vt[1],Ut=Object(s.useState)(-1),At=Object(p.a)(Ut,2),on=At[0],xn=At[1],vn=Object(s.useState)(""),Qt=Object(p.a)(vn,2),Dn=Qt[0],Rn=Qt[1],zt=Object(s.useState)(""),Kt=Object(p.a)(zt,2),Cn=Kt[0],Zt=Kt[1],Nn=Re.workList,Vt=$e.detailLeftMenus,Un=Re.replyList,Lt=Re.workDetail;yt.page_size=10,Object(s.useEffect)(function(){it({type:"shixunHomeworks/getReplyList",payload:Object(f.a)({},yt)}),it({type:"shixunHomeworks/getWorkDetail",payload:Object(f.a)({},yt)}),Vt.course_modules||it({type:"classroomList/getClassroomLeftMenus",payload:Object(f.a)({},yt)})},[yt.categoryId]);var kt=function Mn(wn){var an;wn=(an=wn)!==null&&an!==void 0&&an.includes(".json")?wn:"".concat(wn,".json"),I.a.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:t.a.createElement("div",{className:"tc font16"},"\u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!"),onOk:function(){var Yt=Object(r.a)(o.a.mark(function mn(){var Wt,Ht;return o.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:return Xt.next=2,Object(Le.Bb)({url:wn});case 2:if(Wt=Xt.sent,Wt){Xt.next=5;break}return Xt.abrupt("return");case 5:return C.b.success("\u91CD\u7F6E\u6210\u529F\uFF0C\u6B63\u5728\u8FDB\u5165\u5B9E\u8BAD\uFF01"),Xt.next=8,Object(Le.E)({id:Wt.shixun_identifier});case 8:if(Ht=Xt.sent,!(Ht!=null&&Ht.game_identifier)){Xt.next=12;break}return a.d===null||a.d===void 0||a.d.push("/tasks/".concat(Ht.game_identifier)),Xt.abrupt("return");case 12:(Ht==null?void 0:Ht.status)===2?Mn(Ht==null?void 0:Ht.message):(Ht==null?void 0:Ht.status)===3&&sr(Ht==null?void 0:Ht.message);case 13:case"end":return Xt.stop()}},mn)}));function Gn(){return Yt.apply(this,arguments)}return Gn}()})},sr=function(wn){I.a.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:t.a.createElement("div",{className:"tc font16"},"\u76EE\u524D\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5C1A\u5728\u5185\u6D4B\u4E2D\uFF0C\u5C06\u4E8E",wn,"\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01")})},Sn=function(){var wn,an;if(Lt!=null&&(wn=Lt.shixun_info)!==null&&wn!==void 0&&wn.is_jupyter||Lt!=null&&(an=Lt.shixun_info)!==null&&an!==void 0&&an.is_jupyter_lab){it({type:"shixunsDetail/execJupyter",payload:{id:Lt==null?void 0:Lt.shixun_info.identifier}}).then(function(Yt){Yt!=null&&Yt.identifier&&(a.d===null||a.d===void 0||a.d.push("/tasks/".concat(Yt.identifier,"/jupyter")))});return}it({type:"shixunsDetail/execShixun",payload:{id:Lt==null?void 0:Lt.shixun_info.identifier}}).then(function(Yt){if(Yt!=null&&Yt.game_identifier){a.d===null||a.d===void 0||a.d.push("/tasks/".concat(Yt.game_identifier));return}(Yt==null?void 0:Yt.status)===2?kt(Yt==null?void 0:Yt.message):(Yt==null?void 0:Yt.status)===3&&sr(Yt==null?void 0:Yt.message)})};return t.a.createElement("section",{className:Pe.a.bg},t.a.createElement("section",{className:""},t.a.createElement("aside",{className:[Pe.a.desc,"c-black","font14","bg-white"].join(" ")},Re.actionTabs.key!=="\u7F16\u8F91\u4F5C\u4E1A"&&t.a.createElement("div",null,t.a.createElement(mt.a,{value:(Lt==null?void 0:Lt.description)||"\u6682\u65E0\uFF5E"}),(Lt==null||((kn=Lt.shixun_info)===null||kn===void 0)?void 0:kn.shixun_status)!==-1&&(Lt==null?void 0:Lt.is_shixun)&&t.a.createElement(v.a,{onClick:function(){Sn()},className:Pe.a.testBtn,type:"primary"},t.a.createElement("i",{className:"iconfont icon-jixutiaozhan mr10 font14"}),Lt==null||((Wn=Lt.shixun_info)===null||Wn===void 0||((dr=Wn.task_operation)===null||dr===void 0))?void 0:dr[0])),Lt==null||((ne=Lt.attachments)===null||ne===void 0)?void 0:ne.map(function(Mn,wn){return t.a.createElement("div",null,t.a.createElement("a",{href:"".concat(dt.a.API_SERVER).concat(Mn.url)},t.a.createElement("span",{className:"iconfont icon-fujian c-green font14"}),t.a.createElement("span",{className:"ml10 c-black"},Mn.title),t.a.createElement("span",{className:"c-light-black ml20 font12"},Mn.filesize)))}),Re.actionTabs.key==="\u7F16\u8F91\u4F5C\u4E1A"&&t.a.createElement("aside",{className:["bg-white"].join(" ")},t.a.createElement(Pt.a,{onChange:function(wn){Rn(wn)},defaultValue:Lt==null?void 0:Lt.explanation,height:200,isFocus:!0,watch:!0}),t.a.createElement(le.a,null,t.a.createElement(d.a,{span:24,className:"tr"},t.a.createElement(v.a,{type:"default",size:"large",onClick:Object(r.a)(o.a.mark(function Mn(){return o.a.wrap(function(an){for(;;)switch(an.prev=an.next){case 0:it({type:"shixunHomeworks/setActionTabs",payload:{key:""}});case 1:case"end":return an.stop()}},Mn)}))},"\u53D6\u6D88"),t.a.createElement(v.a,{type:"primary",size:"large",className:"ml20",onClick:Object(r.a)(o.a.mark(function Mn(){var wn;return o.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:if(!(Dn==="")){Yt.next=4;break}C.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),Yt.next=8;break;case 4:return Yt.next=6,it({type:"shixunHomeworks/updateWork",payload:{explanation:Dn,categoryId:yt.categoryId}});case 6:wn=Yt.sent,wn.status===0&&(C.b.success("\u64CD\u4F5C\u6210\u529F"),it({type:"shixunHomeworks/setActionTabs",payload:{key:""}}),it({type:"shixunHomeworks/getWorkDetail",payload:Object(f.a)({},yt)}));case 8:case"end":return Yt.stop()}},Mn)}))},"\u4FDD\u5B58"))))),t.a.createElement("aside",{className:[Pe.a.reply,"bg-white","mt20"].join(" ")},ct&&t.a.createElement(Pt.a,{onChange:function(wn){Rn(wn)},height:200,isFocus:!0,watch:!0}),t.a.createElement(le.a,{onClick:function(){St(!0)}},t.a.createElement(d.a,{flex:"1"},!ct&&t.a.createElement(F.a,{size:"large",className:"current",placeholder:"\u8BF4\u70B9\u4EC0\u4E48",disabled:!0})),t.a.createElement(d.a,null,t.a.createElement(v.a,{type:"primary",size:"large",onClick:Object(r.a)(o.a.mark(function Mn(){var wn;return o.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:if(!(Dn==="")){Yt.next=4;break}C.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),Yt.next=8;break;case 4:return Yt.next=6,it({type:"shixunHomeworks/createReply",payload:{journals_for_message:{jour_id:yt.categoryId,jour_type:"HomeworkCommon",reply_id:1,notes:Dn}}});case 6:wn=Yt.sent,wn.status===0&&(C.b.success("\u53D1\u5E03\u6210\u529F"),it({type:"shixunHomeworks/getReplyList",payload:Object(f.a)({},yt)}),St(!1),Rn(""));case 8:case"end":return Yt.stop()}},Mn)}))},"\u53D1\u8868")))),(Un==null?void 0:Un.comments)&&Un.comments!=""&&t.a.createElement("aside",{className:[Pe.a.replyList,"bg-white"].join(" ")},Un==null?void 0:Un.comments.map(function(Mn,wn){var an,Yt,Gn,mn;return t.a.createElement(le.a,{gutter:[12,12],key:wn},t.a.createElement(d.a,{flex:"40px"},t.a.createElement("img",{className:Pe.a.headpic,width:"40",src:"".concat(dt.a.IMG_SERVER,"/images/").concat(Mn==null||((an=Mn.author)===null||an===void 0)?void 0:an.image_url)})),t.a.createElement(d.a,{flex:"1"},t.a.createElement(le.a,{align:"middle"},t.a.createElement(d.a,{span:20},t.a.createElement("span",{className:"c-light-black"},Mn==null||((Yt=Mn.author)===null||Yt===void 0)?void 0:Yt.name),t.a.createElement("span",{className:"c-light-black ml10"},Mn==null?void 0:Mn.time," \u53D1\u5E03")),t.a.createElement(d.a,{className:"tr",span:4},(Object(ge.c)()||(Be==null||((Gn=Be.userInfo)===null||Gn===void 0)?void 0:Gn.login)===(Mn==null||((mn=Mn.author)===null||mn===void 0)?void 0:mn.login))&&t.a.createElement(Ce.a,{title:"\u5220\u9664"},t.a.createElement(de.a,{className:"current",onClick:function(){it({type:"shixunHomeworks/setActionTabs",payload:{key:"\u5220\u9664",params:yt,selectArr:Mn}})}}))),t.a.createElement(d.a,{span:24},t.a.createElement(mt.a,{value:Mn.content})),Mn.children&&t.a.createElement("aside",{className:Pe.a.comment},Mn.children.map(function(Wt,Ht){var dn,Xt;return t.a.createElement(le.a,{key:Ht},t.a.createElement(d.a,{span:24},t.a.createElement(le.a,null,t.a.createElement(d.a,{flex:"1"},Wt.author.name,t.a.createElement("span",{className:"c-light-black ml10"},Wt==null?void 0:Wt.time)),t.a.createElement(d.a,null,(Object(ge.c)()||(Be==null||((dn=Be.userInfo)===null||dn===void 0)?void 0:dn.login)===(Wt==null||((Xt=Wt.author)===null||Xt===void 0)?void 0:Xt.login))&&t.a.createElement(Ce.a,{title:"\u5220\u9664"},t.a.createElement(de.a,{className:"current",onClick:function(){it({type:"shixunHomeworks/setActionTabs",payload:{key:"\u5220\u9664",params:yt,selectArr:Wt}})}}))))),t.a.createElement(d.a,null,t.a.createElement(mt.a,{value:Wt.content})))})),t.a.createElement(d.a,{span:24,className:"mt5 c-light-black"},on===wn&&t.a.createElement("aside",null,t.a.createElement(Pt.a,{onChange:function(Ht){Zt(Ht)},height:150,isFocus:!0}),t.a.createElement(le.a,null,t.a.createElement(d.a,{span:24,className:"tr"},t.a.createElement(v.a,{type:"primary",size:"large",onClick:Object(r.a)(o.a.mark(function Wt(){return o.a.wrap(function(dn){for(;;)switch(dn.prev=dn.next){case 0:if(!(Cn==="")){dn.next=4;break}C.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),dn.next=9;break;case 4:return dn.next=6,it({type:"shixunHomeworks/createReply",payload:{journals_for_message:{jour_id:yt.categoryId,jour_type:"HomeworkCommon",m_parent_id:Mn.id,reply_id:1,notes:Cn}}});case 6:it({type:"shixunHomeworks/getReplyList",payload:Object(f.a)({},yt)}),C.b.success("\u53D1\u5E03\u6210\u529F"),xn(-1);case 9:case"end":return dn.stop()}},Wt)}))},"\u53D1\u8868")))),on!==wn&&t.a.createElement("div",{className:"tr"},t.a.createElement("span",{className:"iconfont icon-huifu1 mr5 ml30",onClick:function(){return xn(wn)}}),!!Mn.user_praise&&t.a.createElement("span",{className:"c-orange"},t.a.createElement(fe.a,{className:"mr5 ml30",onClick:Object(r.a)(o.a.mark(function Wt(){return o.a.wrap(function(dn){for(;;)switch(dn.prev=dn.next){case 0:return dn.next=2,it({type:"shixunHomeworks/replyUnLike",payload:{object_id:Mn.id,object_type:"journals_for_message"}});case 2:it({type:"shixunHomeworks/getReplyList",payload:Object(f.a)({},yt)});case 3:case"end":return dn.stop()}},Wt)}))}),!!Mn.praise_count&&Mn.praise_count),!Mn.user_praise&&t.a.createElement("span",null,t.a.createElement(fe.a,{className:"mr5 ml30",onClick:Object(r.a)(o.a.mark(function Wt(){return o.a.wrap(function(dn){for(;;)switch(dn.prev=dn.next){case 0:return dn.next=2,it({type:"shixunHomeworks/replyLike",payload:{object_id:Mn.id,object_type:"journals_for_message"}});case 2:it({type:"shixunHomeworks/getReplyList",payload:Object(f.a)({},yt)});case 3:case"end":return dn.stop()}},Wt)}))}),!!Mn.praise_count&&Mn.praise_count))))))}))),t.a.createElement("aside",{className:"tc mt30 pb30"},t.a.createElement(g.a,{defaultCurrent:1,total:Un==null?void 0:Un.total_count,hideOnSinglePage:!0,current:yt.page||1,onChange:function(wn){yt.page=wn,it({type:"shixunHomeworks/getReplyList",payload:Object(f.a)({},yt)})}})),t.a.createElement(De,null))},lt=Object(a.a)(function(zn){var bn=zn.shixunHomeworks,kn=zn.classroomList,Wn=zn.user,dr=zn.loading,ne=zn.globalSetting;return{shixunHomeworks:bn,globalSetting:ne,user:Wn,classroomList:kn,loading:dr.effects}})(Ue);oe.a.locale("ZH-cn");var Ot=function(bn){var kn,Wn,dr=bn.shixunHomeworks,ne=bn.classroomList,Re=bn.globalSetting,$e=bn.loading,Be=bn.dispatch,Ye=Object(u.i)(),et=ne.detailLeftMenus,it=dr.replyList,Ae=dr.referenceAnswer;return Ye.page_size=10,Object(s.useEffect)(function(){Be({type:"shixunHomeworks/getReplyList",payload:Object(f.a)({},Ye)}),Be({type:"shixunHomeworks/getReferenceAnswer",payload:{coursesId:Ye.categoryId}}),et.course_modules||Be({type:"classroomList/getClassroomLeftMenus",payload:Object(f.a)({},Ye)})},[Ye.categoryId]),t.a.createElement("section",{className:"pb30 bg-white pl30 pr30 pt30"},t.a.createElement("aside",{className:["c-black","font14"].join(" ")},t.a.createElement("div",null,(Ae==null?void 0:Ae.reference_answer)&&t.a.createElement(mt.a,{value:Ae==null?void 0:Ae.reference_answer}),!(Ae!=null&&Ae.reference_answer)&&!((kn=Ae.attachments)!==null&&kn!==void 0&&kn.length)&&t.a.createElement(Se.a,null)),Ae==null||((Wn=Ae.attachments)===null||Wn===void 0)?void 0:Wn.map(function(ze,yt){return t.a.createElement("div",null,t.a.createElement("a",{href:"".concat(dt.a.API_SERVER).concat(ze.url)},t.a.createElement("span",{className:"iconfont icon-fujian c-green font14"}),t.a.createElement("span",{className:"ml10 c-black"},ze.title),t.a.createElement("span",{className:"c-light-black ml20 font12"},ze.filesize)))})))},cn=Object(a.a)(function(zn){var bn=zn.shixunHomeworks,kn=zn.classroomList,Wn=zn.loading,dr=zn.globalSetting;return{shixunHomeworks:bn,globalSetting:dr,classroomList:kn,loading:Wn.effects}})(Ot),An=T("4HvA"),Ct=T("aUhZ"),Gt=T("NNe0"),xt=T.n(Gt),Rt=function(bn){var kn,Wn,dr=bn.shixunHomeworks,ne=bn.loading,Re=bn.dispatch,$e=Object(s.useState)(!0),Be=Object(p.a)($e,2),Ye=Be[0],et=Be[1],it=Object(s.useState)(!1),Ae=Object(p.a)(it,2),ze=Ae[0],yt=Ae[1],en=Object(s.useState)([]),Tt=Object(p.a)(en,2),vt=Tt[0],ct=Tt[1],St=Object(s.useState)([]),Ut=Object(p.a)(St,2),At=Ut[0],on=Ut[1],xn=Object(s.useState)([]),vn=Object(p.a)(xn,2),Qt=vn[0],Dn=vn[1],Rn=Object(s.useState)([]),zt=Object(p.a)(Rn,2),Kt=zt[0],Cn=zt[1],Zt=Object(u.i)();function Nn(){return Vt.apply(this,arguments)}function Vt(){return Vt=Object(r.a)(o.a.mark(function sr(){var Sn;return o.a.wrap(function(wn){for(;;)switch(wn.prev=wn.next){case 0:return wn.next=2,Object(_e.a)("/api/homework_commons/".concat(Zt.categoryId,"/homework_common_collaborators.json"),{method:"get"});case 2:Sn=wn.sent,on(Sn);case 4:case"end":return wn.stop()}},sr)})),Vt.apply(this,arguments)}function Un(){return Lt.apply(this,arguments)}function Lt(){return Lt=Object(r.a)(o.a.mark(function sr(){var Sn;return o.a.wrap(function(wn){for(;;)switch(wn.prev=wn.next){case 0:return wn.next=2,Object(_e.a)("/api/courses/".concat(Zt==null?void 0:Zt.coursesId,"/teachers"),{method:"get",params:{homework_id:Zt.categoryId}});case 2:Sn=wn.sent,Sn==null||Sn.teacher_list.map(function(an){an.key=an.user_id}),Dn(Sn==null?void 0:Sn.teacher_list),Cn(Sn==null?void 0:Sn.teacher_list);case 6:case"end":return wn.stop()}},sr)})),Lt.apply(this,arguments)}Object(s.useEffect)(function(){Nn(),Un()},[Zt]);var kt=function(){};return t.a.createElement("section",{className:[xt.a.form," bg-white pl30 pr30 pt10"].join(" ")},t.a.createElement(le.a,null,t.a.createElement(d.a,{flex:"1"},t.a.createElement("span",{style:{fontSize:"16px"}},"\u534F\u4F5C\u8BBE\u7F6E"),(At==null?void 0:At.can_edit)&&t.a.createElement("span",{style:{cursor:"pointer",color:"#0152d9",marginLeft:"10px"},onClick:function(){yt(!0)}},"+\u6DFB\u52A0\u534F\u4F5C\u8005"))),t.a.createElement(le.a,{style:{marginTop:"20px",marginBottom:"20px"}},(At==null||((kn=At.data)===null||kn===void 0)?void 0:kn.length)<=0&&t.a.createElement(Se.a,{customText:"\u8BE5\u4F5C\u4E1A\u6682\u65E0\u534F\u4F5C\u8005"}),At==null||((Wn=At.data)===null||Wn===void 0)?void 0:Wn.map(function(sr){return t.a.createElement("span",{style:{display:"inline-flex",height:"40px",borderRadius:"4px",border:"1px solid #44D7B6",padding:"7px 20px",color:"#44D7B6",marginRight:"40px"}},t.a.createElement("span",{style:{flex:"1"}},sr==null?void 0:sr.real_name),(At==null?void 0:At.can_edit)&&t.a.createElement("span",{style:{cursor:"pointer",marginLeft:"10px"},onClick:Object(r.a)(o.a.mark(function Sn(){var Mn;return o.a.wrap(function(an){for(;;)switch(an.prev=an.next){case 0:return an.next=2,Object(_e.a)("/api/homework_commons/".concat(Zt.categoryId,"/homework_common_collaborators/delete.json"),{method:"delete",body:{user_id:sr.id}});case 2:Mn=an.sent,Mn.status===0&&(C.b.info("\u5220\u9664\u6210\u529F"),Nn(),Un());case 4:case"end":return an.stop()}},Sn)}))},"X"))})),t.a.createElement(le.a,null,!Ye&&t.a.createElement(d.a,{className:"mb50"},t.a.createElement(v.a,{type:"primary",size:"large",onClick:function(){return kt()}},"\u63D0\u4EA4"),t.a.createElement(v.a,{type:"primary",size:"large",ghost:!0,className:"ml20",onClick:function(){et(!0)}},"\u53D6\u6D88"))),t.a.createElement(I.a,{title:"\u6DFB\u52A0\u534F\u4F5C\u8005",visible:ze,onCancel:function(){return yt(!1)},onOk:Object(r.a)(o.a.mark(function sr(){var Sn;return o.a.wrap(function(wn){for(;;)switch(wn.prev=wn.next){case 0:if(!(vt.length===0)){wn.next=3;break}return C.b.info("\u8BF7\u9009\u62E9\u534F\u4F5C\u8001\u5E08"),wn.abrupt("return");case 3:return wn.next=5,Object(_e.a)("/api/homework_commons/".concat(Zt.categoryId,"/homework_common_collaborators.json"),{method:"post",body:{user_ids:vt}});case 5:Sn=wn.sent,Sn.status===0&&(C.b.info("\u6DFB\u52A0\u6210\u529F"),ct([]),Nn(),Un(),yt(!1));case 7:case"end":return wn.stop()}},sr)}))},t.a.createElement("div",null,t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("label",{style:{width:"50px"}},"\u59D3\u540D\uFF1A")," ",t.a.createElement(F.a.Search,{onChange:function(Sn){Dn(Kt.filter(function(Mn){return Mn.name.indexOf(Sn.target.value)>-1}))}})),t.a.createElement(y.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(Sn,Mn){ct(Sn)},selectedRowKeys:vt,getCheckboxProps:function(Sn){return{disabled:Sn.is_collaborator}}},pagination:!1,dataSource:Qt,columns:[{title:"\u59D3\u540D",dataIndex:"name",key:"name"},{title:"\u89D2\u8272",dataIndex:"role",key:"role"}]}))))},gt=Object(a.a)(function(zn){var bn=zn.shixunHomeworks,kn=zn.loading;return{shixunHomeworks:bn,loading:kn.effects}})(Rt),be=T("/zsF"),Ie=T("PArb"),Dt=T("OaEy"),ht=T("2fM7"),nn=T("iQDF"),qt=T("+eQT"),Ke=T("w5pM"),st=T("Lyp1"),bt=T("LvDl"),Ft=T("AHFd"),$t=T("eozf"),gn=qt.a.RangePicker,er=ht.a.Option,Hn=function(bn){var kn,Wn,dr,ne,Re,$e,Be=bn.shixunHomeworks,Ye=bn.loading,et=bn.dispatch,it=Object(u.i)(),Ae=Be.workSetting,ze=Be.workList,yt=Object(s.useState)(!0),en=Object(p.a)(yt,2),Tt=en[0],vt=en[1],ct=Object(s.useState)([]),St=Object(p.a)(ct,2),Ut=St[0],At=St[1],on=Object(s.useState)([]),xn=Object(p.a)(on,2),vn=xn[0],Qt=xn[1],Dn=Object(s.useState)({unified_setting:!1,publish_time:"",end_time:"",ta_mode:1,final_mode:!1,st_proportion:"",ta_proportion:"",te_proportion:"",student_comment:!1,anonymous_appeal:!1,appeal_penalty:0,appeal_time:"",anonymous_comment:!1,evaluation_num:0,evaluation_start:"",evaluation_end:"",absence_penalty:0,work_public:!1,unified_late:!0,allow_late:!1,late_time:"",late_penalty:0,penalty_type:Ft.a.Number,challenge_settings:[],work_efficiency:!1,shixun_evaluation:"",answer_open_evaluation:!1,answer_public:!1,comment_public:!0,score_open:!1,total_score:"",eff_score:""}),Rn=Object(p.a)(Dn,2),zt=Rn[0],Kt=Rn[1];Object(s.useEffect)(function(){Cn()},[]),Object(s.useEffect)(function(){if(!(Ae!=null&&Ae.course_id))return;Object.keys(zt).map(function(an){zt[an]=Ae[an]}),(!zt.allow_late||!zt.unified_late)&&(zt.late_penalty=5),zt.unified_setting||(zt.unified_late=!1,zt.unified_anonymous_comment=!1,zt.unified_anonymous_appeal=!1),Ut=JSON.parse(JSON.stringify(Ae.group_settings.map(function(an){return Object(f.a)(Object(f.a)({},an),{},{group_name:[an.group_name]})}).filter(function(an){return an.publish_time!==null}))),vn=JSON.parse(JSON.stringify(Ae.allow_late_settings.map(function(an){return Object(f.a)(Object(f.a)({},an),{},{group_name:[an.group_name]})}).filter(function(an){return an.late_time!==null}))),Kt(Object(f.a)({},zt)),At(Object(Fe.a)(Ut)),Qt(Object(Fe.a)(vn))},[Ae]);var Cn=function(){et({type:"shixunHomeworks/getWorkSetting",payload:Object(f.a)({},it)})},Zt=function(){var an=Object(r.a)(o.a.mark(function Yt(){var Gn,mn,Wt,Ht;return o.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:if(mn=JSON.parse(JSON.stringify(zt)),mn.categoryId=it.categoryId,zt.unified_setting||((Gn=Ut)===null||Gn===void 0||Gn.map(function(ln){var Zn,qn;if(!ln.publish_time||!ln.end_time)throw C.b.error("\u53D1\u5E03\u3001\u622A\u6B62\u65F6\u95F4\u4E0D\u80FD\u4E3A\u7A7A"),new String("\u53D1\u5E03\u3001\u622A\u6B62\u65F6\u95F4\u4E0D\u80FD\u4E3A\u7A7A");if(!ln.group_name)throw C.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");ln.group_name=typeof(ln==null?void 0:ln.group_name)=="string"?[ln==null?void 0:ln.group_name]:ln==null?void 0:ln.group_name,ln.group_id=ln==null||((Zn=ln.group_name)===null||Zn===void 0||((qn=Zn.map(function(En){var Tr,$n,Yn=(Tr=Ae.group_settings)===null||Tr===void 0||(($n=Tr.filter(function($r){return($r==null?void 0:$r.group_name)===En}))===null||$n===void 0)?void 0:$n[0];return Yn==null?void 0:Yn.group_id}))===null||qn===void 0))?void 0:qn.toString().split(",")})),mn.group_settings=Ut,!zt.allow_late){Xt.next=16;break}if(!zt.unified_late){Xt.next=14;break}if(!(zt.late_penalty===null||zt.late_penalty===void 0||zt.late_penalty<0||zt.late_penalty>100)){Xt.next=9;break}throw C.b.error("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100"),new String("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100");case 9:if(zt.late_time){Xt.next=12;break}throw C.b.error("\u8865\u4EA4\u622A\u6B62\u65F6\u95F4\u4E0D\u80FD\u4E3A\u7A7A"),new String("\u8865\u4EA4\u622A\u6B62\u65F6\u95F4\u4E0D\u80FD\u4E3A\u7A7A");case 12:Xt.next=16;break;case 14:vn=(Wt=vn)===null||Wt===void 0?void 0:Wt.map(function(ln){var Zn,qn;if(ln.penalty_type=Ft.a.Number,ln.late_penalty===null||ln.late_penalty===void 0||ln.late_penalty<0||ln.late_penalty>100)throw C.b.error("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100"),new String("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100");if(!ln.late_time)throw C.b.error("\u8865\u4EA4\u622A\u6B62\u65F6\u95F4\u4E0D\u80FD\u4E3A\u7A7A"),new String("\u8865\u4EA4\u622A\u6B62\u65F6\u95F4\u4E0D\u80FD\u4E3A\u7A7A");if(!ln.group_name)throw C.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return ln.group_name=typeof(ln==null?void 0:ln.group_name)=="string"?[ln==null?void 0:ln.group_name]:ln==null?void 0:ln.group_name,ln.group_id=ln==null||((Zn=ln.group_name)===null||Zn===void 0||((qn=Zn.map(function(En){var Tr,$n,Yn=(Tr=Ae.group_settings)===null||Tr===void 0||(($n=Tr.filter(function($r){return($r==null?void 0:$r.group_name)===En}))===null||$n===void 0)?void 0:$n[0];return Yn==null?void 0:Yn.group_id}))===null||qn===void 0))?void 0:qn.toString().split(","),ln}),mn.allow_late_settings=vn;case 16:return Object.keys(mn).map(function(ln){ln.indexOf("proportion")>-1&&(mn[ln]=mn[ln]/100)}),Xt.next=19,Object(_e.a)("/api/homework_commons/".concat(it.categoryId,"/publish_setting.json"),{method:"post",body:Object(f.a)(Object(f.a)({},mn),{},{penalty_type:Ft.a.Number})});case 19:Ht=Xt.sent,Ht.status===0&&(C.b.success("\u66F4\u65B0\u6210\u529F"),vt(!0),Cn(),et({type:"shixunHomeworks/getWorkList",payload:Object(f.a)({},it)}));case 21:case"end":return Xt.stop()}},Yt)}));return function(){return an.apply(this,arguments)}}(),Nn=t.a.createElement("div",{className:"mask-tips"},"\u8BA1\u7B97\u8BF4\u660E\uFF1A",t.a.createElement("br",null),"\u6559\u5E08\u8BC4\u5206 * \u5176\u767E\u5206\u6BD4 + \u52A9\u6559\u8BC4\u5206 * \u5176\u767E\u5206\u6BD4 + \u5B66\u751F\u533F\u8BC4\u5E73\u5747\u5206 * \u5176\u767E\u5206\u6BD4 - (",t.a.createElement("br",null),"\u8FDF\u4EA4\u6263\u5206 + \u7F3A\u8BC4\u6263\u5206 * \u7F3A\u8BC4\u6570 + \u8FDD\u89C4\u533F\u8BC4\u6263\u5206 * \u8FDD\u89C4\u533F\u8BC4\u6570 )",t.a.createElement("br",null),t.a.createElement("br",null),"\u6CE8\u610F",t.a.createElement("br",null),"\u975E\u96F6\u767E\u5206\u6BD4\u7684\u8BC4\u5206\u9009\u9879\uFF0C\u82E5\u8BC4\u5206\u8BB0\u5F55\u4E3A\u7A7A\uFF0C\u5219\u5176\u767E\u5206\u6BD4\u5C06\u81EA\u52A8\u5E73\u644A\u5230\u5176\u5B83\u975E\u96F6",t.a.createElement("br",null),"\u8BC4\u5206\u9009\u9879\u4E0A\u3002",t.a.createElement("br",null),"\u4F8B\uFF1A\u6559\u5E08\u8BC4\u520640% + \u52A9\u6559\u8BC4\u520635% + \u5B66\u751F\u533F\u8BC425%\uFF0C\u5B66\u751FA\u6CA1\u6709\u6559\u5E08\u8BC4\u5206\u8BB0",t.a.createElement("br",null),"\u5F55\uFF0C\u5219\u5176\u6700\u7EC8\u6210\u7EE9\u6309\u7167\u52A9\u6559\u8BC4\u520655% + \u5B66\u751F\u533F\u8BC445%\u8FDB\u884C\u8BA1\u7B97"),Vt=t.a.createElement("div",{className:"mask-tips"},"\u8BA1\u7B97\u8BF4\u660E\uFF1A",t.a.createElement("br",null),"\u4F18\u5148\u987A\u5E8F\u6392\u524D\u7684\u975E\u96F6\u8BC4\u5206 * 100% -",t.a.createElement("br",null),"( \u8FDF\u4EA4\u6263\u5206 + \u7F3A\u8BC4\u6263\u5206 * \u7F3A\u8BC4\u6570 + \u8FDD\u89C4\u533F\u8BC4\u6263\u5206 * \u8FDD\u89C4\u533F\u8BC4\u6570 )",t.a.createElement("br",null),"\u4F8B\uFF1A\u6709\u6559\u5E08\u8BC4\u5206\u5219\u6559\u5E08\u8BC4\u5206100%\uFF0C\u5426\u5219\u6559\u8F85\u8BC4\u5206100%\uFF0C\u4F9D\u6B21\u7C7B\u63A8"),Un=function(Yt,Gn){var mn,Wt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"group_id";return Gn?Gn.find(function(Ht){return Ht[Wt]===Yt}):Ae==null||((mn=Ae.group_settings)===null||mn===void 0)?void 0:mn.find(function(Ht){return Ht.group_id[0]===Yt})},Lt=(Ae==null?void 0:Ae.allow_late)||(Ae==null?void 0:Ae.anonymous_comment),kt=function(Yt){var Gn=Un(Yt,Ae==null?void 0:Ae.allow_late_settings,"id"),mn=Un(Yt,Ae==null?void 0:Ae.anonymous_comment_settings);return(Ae==null?void 0:Ae.allow_late)&&Gn&&(Gn==null?void 0:Gn.late_time)!==null||(Ae==null?void 0:Ae.anonymous_comment)&&mn&&(mn==null?void 0:mn.evaluation_start)!==null},sr=Object(s.useMemo)(function(){var an;if(Ae!=null&&Ae.unified_setting){var Yt;return!(ze!=null&&(Yt=ze.homework_status)!==null&&Yt!==void 0&&Yt.includes("\u5DF2\u622A\u6B62"))||(Ae==null?void 0:Ae.allow_late)||(Ae==null?void 0:Ae.anonymous_comment)}var Gn=Ae==null||((an=Ae.group_settings)===null||an===void 0)?void 0:an.some(function(mn){return oe()(mn.end_time)<=oe()()});return!Gn||(Ae==null?void 0:Ae.allow_late)||(Ae==null?void 0:Ae.all_group_late)},[Ae,ze]),Sn=Ae==null?void 0:Ae.anonymous_comment,Mn=function(Yt){if(!Yt)return!1;var Gn=Un(Yt,Ae==null?void 0:Ae.anonymous_comment_settings);return(Ae==null?void 0:Ae.anonymous_comment)&&Gn&&(Gn==null?void 0:Gn.evaluation_start)!==null},wn=function(Yt){var Gn=Un(Yt,Ae==null?void 0:Ae.anonymous_comment_settings);return Gn&&(Gn==null?void 0:Gn.evaluation_start)!==null};return t.a.createElement("section",{className:[xt.a.form].join(" ")},t.a.createElement("aside",{className:"pl30 pr30 pb30 bg-white"},t.a.createElement(le.a,null,t.a.createElement(d.a,{span:24},t.a.createElement(le.a,{align:"middle"},t.a.createElement(d.a,{flex:"1"},t.a.createElement("h1",{className:"mt15"},"\u53D1\u5E03\u8BBE\u7F6E")),t.a.createElement(d.a,null,Object(ge.c)()&&Tt&&t.a.createElement(v.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return vt(!1)}},"\u7F16\u8F91\u8BBE\u7F6E")))),t.a.createElement("div",null,t.a.createElement("label",null,"\u53D1\u5E03\u65B9\u5F0F\uFF1A")," ",t.a.createElement(_.a.Group,{disabled:Tt||!(ze!=null&&(kn=ze.homework_status)!==null&&kn!==void 0&&kn.includes("\u672A\u53D1\u5E03")),value:zt.unified_setting,onChange:function(Yt){var Gn;if(!(ze!=null&&(Gn=ze.homework_status)!==null&&Gn!==void 0&&Gn.includes("\u672A\u53D1\u5E03"))){C.b.error("\u5DF2\u53D1\u5E03\uFF0C\u4E0D\u80FD\u518D\u4FEE\u6539\u7EDF\u4E00\u8BBE\u7F6E");return}if(zt.unified_setting=!zt.unified_setting,zt.unified_setting||(zt.unified_late=!1),Kt(Object.assign({},zt)),zt.unified_setting===!1&&Ut==""){At(Ut.concat({}));return}zt.unified_setting&&(At([]),Qt([{late_penalty:5}]))}},t.a.createElement(_.a,{value:!0},"\u7EDF\u4E00\u53D1\u5E03"),t.a.createElement(_.a,{disabled:(Ae==null||((Wn=Ae.group_settings)===null||Wn===void 0)?void 0:Wn.length)===0,value:!1},"\u5206\u73ED\u53D1\u5E03")),(Ae==null||((dr=Ae.group_settings)===null||dr===void 0)?void 0:dr.length)===0&&t.a.createElement("p",{style:{marginLeft:"65px",color:"rgba(0, 0, 0, 0.25)"}},"\uFF08\u672C\u8BFE\u5802\u65E0\u5206\u73ED\uFF0C\u4EC5\u652F\u6301\u9009\u62E9\u201C\u7EDF\u4E00\u53D1\u5E03\u201C\uFF09"))),zt.unified_setting&&t.a.createElement("div",null,t.a.createElement(le.a,{align:"middle",className:"mt25 pl30"},t.a.createElement(d.a,null,"\u53D1\u5E03\u65F6\u95F4:"),t.a.createElement(d.a,{className:"ml5"},t.a.createElement(qt.a,{style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:oe()(Object(w.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabledDate:function(Yt){return Object($t.b)(Yt,Ae==null?void 0:Ae.course_end_date)},disabledTime:function(Yt){return Object($t.c)(Yt)},disabled:Tt||!(ze!=null&&(ne=ze.homework_status)!==null&&ne!==void 0&&ne.includes("\u672A\u53D1\u5E03")||ze!=null&&(Re=ze.homework_status)!==null&&Re!==void 0&&Re.includes("\u672A\u5F00\u59CB")),value:zt.publish_time?oe()(zt.publish_time):"",allowClear:!1,onChange:function(Yt,Gn){zt.publish_time=Gn,(zt.end_time==""||!zt.end_time)&&zt.unified_setting&&(zt.end_time=oe()(Yt).add(1,"month").format("YYYY-MM-DD HH:mm:ss"),zt.end_time=zt.end_time),Kt(Object.assign({},zt))}})),t.a.createElement(d.a,null,t.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u7684\u65F6\u95F4)"))),t.a.createElement(le.a,{align:"middle",className:"mt25 pl30"},t.a.createElement(d.a,null,"\u622A\u6B62\u65F6\u95F4:"),t.a.createElement(d.a,{className:"ml5"},t.a.createElement(qt.a,{style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:oe()(Object(w.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:Tt||Lt,allowClear:!1,disabledDate:function(Yt){return Object($t.b)(Yt,Ae==null?void 0:Ae.course_end_date,zt.publish_time)},disabledTime:function(Yt){return Object($t.c)(Yt,zt.publish_time)},value:zt.end_time?oe()(zt.end_time):"",onChange:function(Yt,Gn){zt.end_time=Gn,Kt(Object.assign({},zt))}})),t.a.createElement(d.a,null,t.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)")))),!zt.unified_setting&&t.a.createElement(le.a,{style:{marginTop:30,paddingTop:40,marginLeft:40,borderTop:"1px solid #eee"}},t.a.createElement(d.a,{span:24},t.a.createElement(le.a,null,t.a.createElement(d.a,{span:10}),t.a.createElement(d.a,{span:10},t.a.createElement(le.a,{className:"c-grey-c"},t.a.createElement(d.a,{flex:"1"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u65F6\u95F4)"),t.a.createElement(d.a,{flex:"1"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u65F6\u95F4\u622A\u70B9)"))),t.a.createElement(d.a,{span:4}))),Ut&&Ut.map(function(an,Yt){var Gn,mn,Wt,Ht,dn;return t.a.createElement(d.a,{span:24,key:Yt},t.a.createElement(le.a,{gutter:[8,16]},t.a.createElement(d.a,{span:9},t.a.createElement(le.a,{gutter:[8,16]},t.a.createElement(d.a,null,"\u53D1\u5E03\u89C4\u5219 ",Yt+1),t.a.createElement(d.a,{flex:1,style:{maxWidth:400}},t.a.createElement(ht.a,{disabled:Tt||!(ze!=null&&(Gn=ze.homework_status)!==null&&Gn!==void 0&&Gn.includes("\u672A\u53D1\u5E03"))&&an.id,className:"ml20",mode:"multiple",style:{width:"310px"},value:an.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(ln){Ut[Yt].group_name=ln,Ut[Yt].group_id=an.group_id;var Zn=Object(bt.flattenDeep)(Ut.map(function(En){return En.group_name})),qn=vn.map(function(En){var Tr=(En==null?void 0:En.group_name)||[];return Object(f.a)(Object(f.a)({},En),{},{group_name:Object(bt.remove)(Tr,function($n){return Zn.includes($n)})})});Qt(qn),At(Ut.slice())}},Ae.group_settings&&Ae.group_settings.map(function(Xt){if(!Ut.map(function(ln){return ln.group_name}).toString().split(",").includes(String(Xt.group_name)))return t.a.createElement(er,{value:Xt.group_name,key:Xt.id},Xt.group_name)}))))),t.a.createElement(d.a,{span:1}),t.a.createElement(d.a,{span:10},t.a.createElement(gn,{allowClear:!1,ranges:{\u6B64\u523B:[an.publish_time?oe()(an.publish_time):oe()(),oe()()]},disabled:Tt||(oe()()<=oe()((mn=Un((Wt=an.group_id)===null||Wt===void 0?void 0:Wt[0]))===null||mn===void 0?void 0:mn.publish_time)?!1:[!0,kt((Ht=an.group_id)===null||Ht===void 0?void 0:Ht[0])]),style:{width:440},placeholder:["\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4","\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4"],disabledDate:function(ln){return Object($t.b)(ln,Ae==null?void 0:Ae.course_end_date)},disabledTime:function(ln){return Object($t.c)(ln)},showTime:{format:"HH:mm",defaultValue:[oe()(Object(w.d)(),"HH:mm"),oe()(Object(w.d)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:an.publish_time&&[oe()(an.publish_time),oe()(an.end_time)],onChange:function(ln,Zn){Ut[Yt].publish_time=Zn[0],Ut[Yt].end_time=Zn[1],At(Object(Fe.a)(Ut))}})),!Tt&&t.a.createElement(d.a,{span:4},Yt>0&&!an.id&&t.a.createElement(de.a,{onClick:function(){Ut=Ut.filter(function(ln,Zn){return Yt!==Zn}),At(Ut.slice()),setTimeout(function(){return At(Ut.slice())},10)}}),Ut.length<(Ae==null||((dn=Ae.group_settings)===null||dn===void 0)?void 0:dn.length)&&t.a.createElement(Ke.a,{className:"c-green ml20",onClick:function(){At(Ut.concat({}))}}))))})),t.a.createElement(Ie.a,null),t.a.createElement(le.a,null,t.a.createElement(d.a,null,t.a.createElement("strong",null,"\u8865\u4EA4\u8BBE\u7F6E"),t.a.createElement(Ce.a,{trigger:"click",placement:"right",title:"\u4F5C\u4E1A\u622A\u6B62\u540E\u624D\u53EF\u5F00\u542F\u8865\u4EA4\uFF0C\u5F00\u542F\u8865\u4EA4\u540E\u4E0D\u53EF\u53D8\u66F4\u4F5C\u4E1A\u622A\u6B62\u65F6\u95F4\u3002"},t.a.createElement(st.a,{style:{marginLeft:4,cursor:"pointer"}}))),t.a.createElement(d.a,{span:24,className:"mt15 pl30"},t.a.createElement(U.a,{checked:zt.allow_late,disabled:Tt||sr,onChange:function(){zt.allow_late=!zt.allow_late,vn==""&&Qt([{late_penalty:5}]),Kt(Object.assign({},zt))}},t.a.createElement("strong",null,"\u5F00\u542F\u8865\u4EA4")),t.a.createElement(Ce.a,{overlayStyle:{width:380,maxWidth:380},title:t.a.createElement("div",{style:{display:"flex",flexFlow:"column"}},t.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219\u8BF4\u660E"),t.a.createElement("span",null,"\u5F00\u542F\u8865\u4EA4\uFF0C\u5B66\u751F\u53EA\u5728\u8865\u4EA4\u65F6\u95F4\u5185\u624D\u901A\u5173\u5219\u6263\u9664\u5206\u503C\uFF0C\u672A\u901A\u5173\u4E0D\u6263\u5206\uFF1B"),t.a.createElement("span",null,"\u5B66\u751F\u5728\u6B63\u5E38\u4F5C\u4E1A\u89C4\u5B9A\u65F6\u95F4\u5185\u901A\u5173\uFF0C\u5728\u8865\u4EA4\u9636\u6BB5\u518D\u6B21\u901A\u5173\u4E0D\u6263\u5206\u3002"))},t.a.createElement(st.a,null)))),(zt==null?void 0:zt.allow_late)&&t.a.createElement("div",{style:{marginLeft:22}},t.a.createElement("div",{className:"ml30 mt20"},t.a.createElement("span",null,"\u8865\u4EA4\u65B9\u5F0F\uFF1A"),t.a.createElement(_.a.Group,{disabled:Tt||(Ae==null?void 0:Ae.anonymous_comment)||(Ae==null?void 0:Ae.allow_late),value:zt.unified_late,onChange:function(Yt){zt.unified_late=Yt.target.value,vn==""&&!Yt.target.value&&Qt([{late_penalty:5}]),Kt(Object(f.a)({},zt))}},(zt==null?void 0:zt.unified_setting)&&t.a.createElement(_.a,{value:!0}," \u7EDF\u4E00\u8865\u4EA4 "),(Ae==null||(($e=Ae.group_settings)===null||$e===void 0)?void 0:$e.length)&&t.a.createElement(_.a,{value:!1}," \u5206\u73ED\u8865\u4EA4 "))),zt!=null&&zt.unified_late?t.a.createElement(t.a.Fragment,null,t.a.createElement(le.a,{align:"middle",className:"mt25 pl30"},t.a.createElement(d.a,null,"\u8865\u4EA4\u6263\u5206:"),t.a.createElement(d.a,{className:"ml5"},t.a.createElement(L.a,{disabled:Tt||Sn,value:zt.late_penalty,onChange:function(Yt){zt.late_penalty=Yt,Kt(Object.assign({},zt))}})),t.a.createElement(d.a,{flex:"1",className:"ml5"},"\u5206",t.a.createElement("span",{className:"c-grey-c ml10"},"(\u5EF6\u65F6\u63D0\u4EA4\u4F5C\u54C1\u65F6\uFF0C\u5B66\u751F\u6210\u7EE9\u5C06\u88AB\u6263\u51CF\u7684\u5206\u503C)"))),t.a.createElement(le.a,{align:"middle",className:"mt25 pl30"},t.a.createElement(d.a,null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4:"),t.a.createElement(d.a,{className:"ml5"},t.a.createElement(qt.a,{allowClear:!1,style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:oe()(Object(w.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:Tt||Sn,value:zt.late_time?oe()(zt.late_time):"",disabledDate:function(Yt){return Object($t.b)(Yt,Ae==null?void 0:Ae.course_end_date)},disabledTime:function(Yt){return Object($t.c)(Yt)},onChange:function(Yt,Gn){zt.late_time=Gn,Kt(Object.assign({},zt))}})),t.a.createElement(d.a,null,t.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u201C\u5EF6\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)")))):vn.map(function(an,Yt){var Gn;return t.a.createElement(d.a,{span:24,key:Yt},t.a.createElement(le.a,{className:"mt25"},t.a.createElement(d.a,{style:{marginLeft:30}},t.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219",Yt+1,"\uFF1A"),t.a.createElement(ht.a,{disabled:Tt||!(ze!=null&&(Gn=ze.homework_status)!==null&&Gn!==void 0&&Gn.includes("\u672A\u53D1\u5E03"))&&an.id,mode:"multiple",style:{width:306},value:typeof an.group_name=="string"?[an.group_name]:an.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(Wt){vn[Yt].group_name=Wt,vn[Yt].group_id=an.group_id,Qt(vn.slice())}},Ae.group_settings&&Ae.group_settings.map(function(mn){if(zt!=null&&zt.unified_setting&&(!vn.map(function(Wt){return Wt.group_name}).toString().split(",").includes(String(mn.group_name))&&!wn(mn.id)))return t.a.createElement(er,{value:mn.group_name,key:mn.id},mn.group_name);if(Ut.map(function(Wt){return Wt.group_name}).toString().split(",").includes(String(mn.group_name))&&(!vn.map(function(Wt){return Wt.group_name}).toString().split(",").includes(String(mn.group_name))&&oe()(mn.end_time)<=oe()()&&!wn(mn.id)))return t.a.createElement(er,{value:mn.group_name,key:mn.id},mn.group_name)}))),t.a.createElement(d.a,{className:"ml20"},t.a.createElement("span",null,"\u8865\u4EA4\u6263\u5206\uFF1A"),t.a.createElement(L.a,{min:0,max:100,disabled:Tt||Mn(an.id),defaultValue:an.late_penalty,onChange:function(Wt){vn[Yt].late_penalty=Wt,vn[Yt].penalty_type=Ft.a.Number}})),t.a.createElement(d.a,{className:"ml20"},t.a.createElement("span",null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4\uFF1A"),t.a.createElement(qt.a,{disabled:Tt||Mn(an.id),style:{width:200},showTime:{format:"HH:mm",defaultValue:oe()(Object(w.d)(),"HH:mm")},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",disabledDate:function(Wt){return Object($t.b)(Wt,Ae==null?void 0:Ae.course_end_date)},disabledTime:function(Wt){return Object($t.c)(Wt)},format:"YYYY-MM-DD HH:mm",value:an!=null&&an.late_time?oe()(an.late_time):void 0,onChange:function(Wt,Ht){vn[Yt].late_time=Ht,Qt(Object(Fe.a)(vn))}})),!Tt&&t.a.createElement(d.a,{className:"ml20"},Yt>0&&!an.id&&t.a.createElement(de.a,{onClick:function(){vn=vn.filter(function(Wt,Ht){return Yt!==Ht}),Qt(vn.slice()),setTimeout(function(){return Qt(vn.slice())},10)}}),t.a.createElement(Ke.a,{className:"c-green ml20",onClick:function(){Qt(vn.concat({penalty_type:Ft.a.Number,late_penalty:5}))}}))))})),t.a.createElement(Ie.a,null)),t.a.createElement(le.a,null,!Tt&&t.a.createElement(d.a,{className:"mb50 mt20 btn-w120"},t.a.createElement(v.a,{type:"primary",size:"large",onClick:function(){return Zt()}},"\u63D0\u4EA4"),t.a.createElement(v.a,{type:"primary",size:"large",ghost:!0,className:"ml20",onClick:function(){vt(!0),Cn()}},"\u53D6\u6D88"))))},yn=Object(a.a)(function(zn){var bn=zn.shixunHomeworks,kn=zn.loading;return{shixunHomeworks:bn,loading:kn.effects}})(Hn),Sr=T("Q9mQ"),_r=T("diRs"),ar=T("rAM+"),cr=T("TreJ"),Pr=T("yHk2"),Qr=T("4KPa"),ca=T("cguq"),hn=T("6fgh"),ir=function(bn){var kn,Wn,dr,ne,Re,$e,Be,Ye=bn.shixunHomeworks,et=bn.loading,it=bn.dispatch,Ae=Object(u.i)(),ze=Ye.workSetting,yt=Ye.workList,en=Object(s.useState)(!0),Tt=Object(p.a)(en,2),vt=Tt[0],ct=Tt[1],St=Object(s.useState)([]),Ut=Object(p.a)(St,2),At=Ut[0],on=Ut[1],xn=Object(s.useState)({unified_setting:!1,publish_time:"",end_time:"",ta_mode:1,final_mode:!1,st_proportion:"",ta_proportion:"",te_proportion:"",student_comment:!1,anonymous_appeal:!1,appeal_penalty:0,appeal_time:"",anonymous_comment:!1,evaluation_num:0,evaluation_start:"",evaluation_end:"",absence_penalty:0,work_public:!1,unified_late:!0,allow_late:!1,late_time:"",late_penalty:0,challenge_settings:[],work_efficiency:!1,shixun_evaluation:"",answer_open_evaluation:!1,answer_public:!1,score_open:!1,total_score:"",eff_score:"",unified_anonymous_comment:!0,unified_anonymous_appeal:!0}),vn=Object(p.a)(xn,2),Qt=vn[0],Dn=vn[1];Object(s.useEffect)(function(){Rn()},[]),Object(s.useEffect)(function(){if(!(ze!=null&&ze.course_id))return;Object.keys(Qt).map(function(Ht){Qt[Ht]=ze[Ht]}),(!Qt.allow_late||!Qt.unified_late)&&(Qt.late_penalty=5),At=JSON.parse(JSON.stringify(ze.group_settings.map(function(Ht){return Object(f.a)(Object(f.a)({},Ht),{},{group_name:[Ht.group_name]})}).filter(function(Ht){return Ht.publish_time!==null}))),Dn(Object(f.a)({},Qt)),on(Object(Fe.a)(At))},[ze]);var Rn=function(){var Ht=Object(r.a)(o.a.mark(function dn(){return o.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:return ln.next=2,it({type:"shixunHomeworks/getWorkSetting",payload:Object(f.a)({},Ae)});case 2:Lt.resetFields(),Sn.resetFields();case 4:case"end":return ln.stop()}},dn)}));return function(){return Ht.apply(this,arguments)}}(),zt=function(){var Ht=Object(r.a)(o.a.mark(function dn(){var Xt,ln,Zn,qn,En;return o.a.wrap(function($n){for(;;)switch($n.prev=$n.next){case 0:if(ln=JSON.parse(JSON.stringify(Qt)),ln.categoryId=Ae.categoryId,Qt.unified_setting||((Xt=At)===null||Xt===void 0||Xt.map(function(Yn){var $r,Gr;if(!Yn.publish_time||!Yn.end_time)throw C.b.error("\u8BF7\u628A\u53D1\u5E03\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u53D1\u5E03\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!Yn.group_name)throw C.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");Yn.group_name=typeof(Yn==null?void 0:Yn.group_name)=="string"?[Yn==null?void 0:Yn.group_name]:Yn==null?void 0:Yn.group_name,Yn.group_id=Yn==null||(($r=Yn.group_name)===null||$r===void 0||((Gr=$r.map(function(aa){var Ta,Ra,ha=(Ta=ze.group_settings)===null||Ta===void 0||((Ra=Ta.filter(function(_a){return(_a==null?void 0:_a.group_name)===aa}))===null||Ra===void 0)?void 0:Ra[0];return ha==null?void 0:ha.group_id}))===null||Gr===void 0))?void 0:Gr.toString().split(",")})),ln.group_settings=At,!Qt.evaluation_start){$n.next=11;break}if(!(Qt.end_time&&oe()(Qt.evaluation_start)<=oe()(Qt.end_time))){$n.next=8;break}throw C.b.error("\u533F\u8BC4\u5F00\u542F\u65F6\u95F4\u8981\u665A\u4E8E\u4F5C\u4E1A\u622A\u6B62\u65F6\u95F4\u3001\u8865\u4EA4\u622A\u6B62\u65F6\u95F4"),new String("\u533F\u8BC4\u5F00\u542F\u65F6\u95F4\u8981\u665A\u4E8E\u4F5C\u4E1A\u622A\u6B62\u65F6\u95F4\u3001\u8865\u4EA4\u622A\u6B62\u65F6\u95F4");case 8:if(!(Qt.late_time&&oe()(Qt.evaluation_start)<=oe()(Qt.late_time))){$n.next=11;break}throw C.b.error("\u533F\u8BC4\u5F00\u542F\u65F6\u95F4\u8981\u665A\u4E8E\u4F5C\u4E1A\u622A\u6B62\u65F6\u95F4\u3001\u8865\u4EA4\u622A\u6B62\u65F6\u95F4"),new String("\u533F\u8BC4\u5F00\u542F\u65F6\u95F4\u8981\u665A\u4E8E\u4F5C\u4E1A\u622A\u6B62\u65F6\u95F4\u3001\u8865\u4EA4\u622A\u6B62\u65F6\u95F4");case 11:if(Object.keys(ln).map(function(Yn){Yn.indexOf("proportion")>-1&&(ln[Yn]=ln[Yn]/100)}),!(ln.anonymous_comment&&!ln.unified_anonymous_comment)){$n.next=18;break}return $n.next=15,wn();case 15:Zn=$n.sent,ln.anonymous_comment_settings=Zn.anonymous_comment_settings,["evaluation_end","evaluation_num","evaluation_start","student_comment","absence_penalty"].forEach(function(Yn){Reflect.deleteProperty(ln,Yn)});case 18:return ln.anonymous_appeal&&!ln.unified_anonymous_appeal&&(qn=an(),ln.anonymous_appeal_settings=qn.anonymous_appeal_settings,["appeal_time","appeal_penalty"].forEach(function(Yn){Reflect.deleteProperty(ln,Yn)})),$n.next=21,Object(_e.a)("/api/homework_commons/".concat(Ae.categoryId,"/evaluation_setting.json"),{method:"post",body:Object(f.a)({},ln)});case 21:En=$n.sent,En.status===0&&(C.b.success("\u66F4\u65B0\u6210\u529F"),ct(!0),Rn(),it({type:"shixunHomeworks/getWorkList",payload:Object(f.a)({},Ae)}));case 23:case"end":return $n.stop()}},dn)}));return function(){return Ht.apply(this,arguments)}}(),Kt=t.a.createElement("div",{className:"mask-tips"},"\u8BA1\u7B97\u8BF4\u660E\uFF1A",t.a.createElement("br",null),"\u6559\u5E08\u8BC4\u5206 * \u5176\u767E\u5206\u6BD4 + \u52A9\u6559\u8BC4\u5206 * \u5176\u767E\u5206\u6BD4 + \u5B66\u751F\u533F\u8BC4\u5E73\u5747\u5206 * \u5176\u767E\u5206\u6BD4 - (",t.a.createElement("br",null),"\u8FDF\u4EA4\u6263\u5206 + \u7F3A\u8BC4\u6263\u5206 * \u7F3A\u8BC4\u6570 + \u8FDD\u89C4\u533F\u8BC4\u6263\u5206 * \u8FDD\u89C4\u533F\u8BC4\u6570 )",t.a.createElement("br",null),t.a.createElement("br",null),"\u6CE8\u610F",t.a.createElement("br",null),"\u975E\u96F6\u767E\u5206\u6BD4\u7684\u8BC4\u5206\u9009\u9879\uFF0C\u82E5\u8BC4\u5206\u8BB0\u5F55\u4E3A\u7A7A\uFF0C\u5219\u5176\u767E\u5206\u6BD4\u5C06\u81EA\u52A8\u5E73\u644A\u5230\u5176\u5B83\u975E\u96F6",t.a.createElement("br",null),"\u8BC4\u5206\u9009\u9879\u4E0A\u3002",t.a.createElement("br",null),"\u4F8B\uFF1A\u6559\u5E08\u8BC4\u520640% + \u52A9\u6559\u8BC4\u520635% + \u5B66\u751F\u533F\u8BC425%\uFF0C\u5B66\u751FA\u6CA1\u6709\u6559\u5E08\u8BC4\u5206\u8BB0",t.a.createElement("br",null),"\u5F55\uFF0C\u5219\u5176\u6700\u7EC8\u6210\u7EE9\u6309\u7167\u52A9\u6559\u8BC4\u520655% + \u5B66\u751F\u533F\u8BC445%\u8FDB\u884C\u8BA1\u7B97"),Cn=t.a.createElement("div",{className:"mask-tips"},"\u8BA1\u7B97\u8BF4\u660E\uFF1A",t.a.createElement("br",null),"\u4F18\u5148\u987A\u5E8F\u6392\u524D\u7684\u975E\u96F6\u8BC4\u5206 * 100% -",t.a.createElement("br",null),"( \u8FDF\u4EA4\u6263\u5206 + \u7F3A\u8BC4\u6263\u5206 * \u7F3A\u8BC4\u6570 + \u8FDD\u89C4\u533F\u8BC4\u6263\u5206 * \u8FDD\u89C4\u533F\u8BC4\u6570 )",t.a.createElement("br",null),"\u4F8B\uFF1A\u6709\u6559\u5E08\u8BC4\u5206\u5219\u6559\u5E08\u8BC4\u5206100%\uFF0C\u5426\u5219\u6559\u8F85\u8BC4\u5206100%\uFF0C\u4F9D\u6B21\u7C7B\u63A8"),Zt=ze==null||((kn=ze.anonymous_comment_settings)===null||kn===void 0)?void 0:kn.map(function(Ht){return{label:Ht.group_name,value:Ht.group_name,id:Ht.group_id}}),Nn=ze==null||((Wn=ze.anonymous_appeal_settings)===null||Wn===void 0)?void 0:Wn.map(function(Ht){return{label:Ht.group_name,value:Ht.group_name,id:Ht.group_id}}),Vt=xe.a.useForm(),Un=Object(p.a)(Vt,1),Lt=Un[0],kt=xe.a.useForm(),sr=Object(p.a)(kt,1),Sn=sr[0],Mn=function(dn,Xt){return dn.map(function(ln){var Zn;return(Zn=Xt.find(function(qn){return qn.value===ln}))===null||Zn===void 0?void 0:Zn.id})},wn=function(){var Ht=Object(r.a)(o.a.mark(function dn(){var Xt,ln,Zn,qn,En;return o.a.wrap(function($n){for(;;)switch($n.prev=$n.next){case 0:Xt=Object(hn.a)(Lt.getFieldsValue(),"YYYY-MM-DD HH:mm"),ln=Object(bt.cloneDeep)(Xt),Zn=Object(ar.a)(ln.anonymous_comment_settings||[]),$n.prev=3,Zn.s();case 5:if((qn=Zn.n()).done){$n.next=19;break}if(En=qn.value,En!=null&&En.evaluation_start){$n.next=10;break}return C.b.warning("\u533F\u8BC4\u5F00\u59CB\u65F6\u95F4\u4E0D\u80FD\u4E3A\u7A7A"),$n.abrupt("return",Promise.reject());case 10:if(En.group_name){$n.next=13;break}return C.b.warning("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),$n.abrupt("return",Promise.reject());case 13:En.evaluation_end=En==null?void 0:En.evaluation_start[1],En.evaluation_start=En==null?void 0:En.evaluation_start[0],En.group_id=Mn(En.group_name,Zt),Reflect.deleteProperty(En,"deleteflag");case 17:$n.next=5;break;case 19:$n.next=24;break;case 21:$n.prev=21,$n.t0=$n.catch(3),Zn.e($n.t0);case 24:return $n.prev=24,Zn.f(),$n.finish(24);case 27:return $n.abrupt("return",ln);case 28:case"end":return $n.stop()}},dn,null,[[3,21,24,27]])}));return function(){return Ht.apply(this,arguments)}}(),an=function(){var dn=Object(hn.a)(Sn.getFieldsValue(),"YYYY-MM-DD HH:mm"),Xt=Object(bt.cloneDeep)(dn),ln=Object(ar.a)(Xt.anonymous_appeal_settings||[]),Zn;try{for(ln.s();!(Zn=ln.n()).done;){var qn=Zn.value;qn.group_id=Mn(qn.group_name,Nn),Reflect.deleteProperty(qn,"deleteflag")}}catch(En){ln.e(En)}finally{ln.f()}return Xt},Yt=function(dn,Xt){if(Xt==="comment"){var ln=dn==null?void 0:dn.filter(function(Yn){return Yn.evaluation_end!==null});if(ln.length===0)return[{deleteflag:!0}];var Zn=Object(hn.b)(ln,["evaluation_start","evaluation_end"]),qn=Zn.map(function(Yn){return Object(f.a)(Object(f.a)({},Yn),{},{evaluation_start:[Yn.evaluation_start,Yn.evaluation_end],group_name:[Yn.group_name],deleteflag:!1})});return qn}else if(Xt==="appeal"){var En=dn==null?void 0:dn.filter(function(Yn){return Yn.appeal_time!==null});if(En.length===0)return[{deleteflag:!0}];var Tr=Object(hn.b)(En,["appeal_time"]),$n=Tr.map(function(Yn){return Object(f.a)(Object(f.a)({},Yn),{},{group_name:[Yn.group_name],deleteflag:!1})});return $n}},Gn=(ze==null||((dr=ze.homework_status)===null||dr===void 0)?void 0:dr.includes("\u5DF2\u622A\u6B62"))||(Zt==null?void 0:Zt.length)>0,mn=(ze==null||((ne=ze.anonymous_appeal_settings)===null||ne===void 0)?void 0:ne.length)>0,Wt=(ze==null?void 0:ze.anonymous_comment)&&(ze==null?void 0:ze.unified_anonymous_comment)&&(yt==null||((Re=yt.homework_status)===null||Re===void 0)?void 0:Re.includes("\u5DF2\u622A\u6B62"))||mn;return t.a.createElement("section",{className:[xt.a.form].join(" ")},t.a.createElement("aside",{className:"pl30 pr30 pb30 bg-white"},t.a.createElement(le.a,null,t.a.createElement(d.a,{span:24},t.a.createElement(le.a,{align:"middle"},t.a.createElement(d.a,{flex:"1"},t.a.createElement(le.a,{align:"middle",className:"mt15"},t.a.createElement("h1",{style:{marginBottom:0}},"\u533F\u8BC4\u8BBE\u7F6E"),t.a.createElement(Ce.a,{placement:"right",title:"\u4F5C\u4E1A\u622A\u6B62\u3001\u8865\u4EA4\u7ED3\u675F\u540E\u624D\u53EF\u5F00\u542F\u533F\u8BC4\uFF0C\u5F00\u542F\u7533\u8BC9\u540E\u4E0D\u53EF\u53D8\u66F4\u533F\u8BC4\u7ED3\u675F\u65F6\u95F4\u3002",trigger:"click"},t.a.createElement(st.a,{style:{marginLeft:4,cursor:"pointer"}})))),t.a.createElement(d.a,null,(ze==null?void 0:ze.can_edit)&&vt&&t.a.createElement(v.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return ct(!1)}},"\u7F16\u8F91\u8BBE\u7F6E")))),t.a.createElement(d.a,{span:24,className:"mt15 pl30"},t.a.createElement(U.a,{checked:Qt.anonymous_comment,disabled:vt||!Gn||(ze==null?void 0:ze.anonymous_comment),onChange:function(){Qt.anonymous_comment=!Qt.anonymous_comment,Qt.allow_late&&!Qt.evaluation_start?Qt.late_time&&Qt.late_time!=""&&(Qt.evaluation_start=oe()(Qt.late_time).add(14,"day").format("YYYY-MM-DD HH:mm:ss"),Qt.evaluation_end=oe()(Qt.late_time).add(28,"day").format("YYYY-MM-DD HH:mm:ss")):Qt.unified_setting&&!Qt.evaluation_start&&(Qt.end_time&&Qt.end_time!=""&&(Qt.evaluation_start=oe()(Qt.end_time).add(14,"day").format("YYYY-MM-DD HH:mm:ss"),Qt.evaluation_end=oe()(Qt.end_time).add(28,"day").format("YYYY-MM-DD HH:mm:ss"))),Qt.anonymous_comment&&(Qt.evaluation_num=parseInt(Qt.evaluation_num)?Qt.evaluation_num:3,Qt.absence_penalty=parseInt(Qt.absence_penalty)?Qt.absence_penalty:3),Dn(Object.assign({},Qt))}},t.a.createElement("strong",null,"\u542F\u7528\u533F\u8BC4")),t.a.createElement("span",{className:"c-grey-c font12"},"(\u63D0\u4EA4\u4F5C\u54C1\u7684\u6570\u91CF\u22652\u4E2A\uFF0C\u53EF\u4EE5\u5F00\u542F\u533F\u8BC4\uFF1B\u4E3A\u786E\u4FDD\u516C\u5E73\uFF0C\u533F\u8BC4\u89C4\u5219\u786E\u5B9A\u540E\u4E0D\u53EF\u518D\u4FEE\u6539\uFF0C\u8BF7\u8C28\u614E\u64CD\u4F5C!)"))),Qt.anonymous_comment&&t.a.createElement(t.a.Fragment,null,t.a.createElement(le.a,{align:"middle",className:"mt25 mb25 pl30"},t.a.createElement(d.a,null,"\u533F\u8BC4\u65B9\u5F0F:"),t.a.createElement(d.a,{className:"ml5"},t.a.createElement(_.a.Group,{value:Qt.unified_anonymous_comment,disabled:vt||Qt.anonymous_appeal||(ze==null?void 0:ze.anonymous_comment),onChange:function(dn){Dn(function(Xt){return Object(f.a)(Object(f.a)({},Xt),{},{unified_anonymous_comment:dn.target.value})}),Lt.resetFields()}},(ze==null?void 0:ze.unified_setting)&&(ze==null?void 0:ze.unified_late)&&t.a.createElement(_.a,{value:!0},"\u7EDF\u4E00\u533F\u8BC4"),(ze==null||(($e=ze.group_settings)===null||$e===void 0)?void 0:$e.length)>0&&t.a.createElement(_.a,{value:!1},"\u5206\u73ED\u533F\u8BC4")))),Qt.unified_anonymous_comment?t.a.createElement(cr.a,{data:Qt,setData:Dn,disabled:vt}):t.a.createElement(xe.a,{form:Lt,autoComplete:"off",initialValues:ze!=null&&ze.unified_anonymous_comment?{anonymous_comment_settings:[{deleteflag:!0}]}:{anonymous_comment_settings:Yt(ze==null?void 0:ze.anonymous_comment_settings,"comment")}},t.a.createElement(Pr.a,{disabled:vt,selectOptions:Zt,form:Lt,data:Qt}))),t.a.createElement(Ie.a,null),t.a.createElement(le.a,null,t.a.createElement(d.a,{span:24,className:"mt15 pl30"},t.a.createElement(U.a,{checked:Qt.anonymous_appeal,disabled:vt||!Wt||(ze==null?void 0:ze.anonymous_appeal),onChange:function(){Qt.anonymous_appeal=!Qt.anonymous_appeal,Qt.anonymous_appeal&&(Qt.appeal_penalty=Qt.appeal_penalty?Qt.appeal_penalty:2),Dn(Object.assign({},Qt))}},t.a.createElement("strong",null,"\u542F\u7528\u533F\u8BC4\u7533\u8BC9")),t.a.createElement(_r.a,{overlayClassName:"edu-popover",placement:"bottomLeft",content:t.a.createElement("span",{className:"font12"},"\u5141\u8BB8\u5B66\u751F\u5BF9\u81EA\u5DF1\u4F5C\u54C1\u7684\u533F\u8BC4\u8BC4\u5206\u8FDB\u884C\u7533\u8BC9\uFF0C\u7531\u6559\u5E08\u548C\u52A9\u6559\u5904\u7406\u7533\u8BC9",t.a.createElement("br",null),t.a.createElement("br",null),"1\u3001\u63A5\u53D7\u5B66\u751F\u7684\u5408\u7406\u7533\u8BC9\uFF1A",t.a.createElement("br",null),t.a.createElement("span",{className:"p"},"\u88AB\u7533\u8BC9\u7684\u8BC4\u5206\u8BB0\u5F55\u65E0\u6548\uFF0C\u4E0D\u53C2\u4E0E\u6700\u7EC8\u6210\u7EE9\u7684\u8BA1\u7B97"),t.a.createElement("span",{className:"p"},"\u88AB\u7533\u8BC9\u7684\u8BC4\u9605\u4EBA\u7684\u4F5C\u54C1\u6210\u7EE9\uFF0C\u5C06\u88AB\u6263\u51CF\u8FDD\u89C4\u533F\u8BC4\u5206"),t.a.createElement("br",null),"2\u3001\u62D2\u7EDD\u5B66\u751F\u7684\u4E0D\u5408\u7406\u7533\u8BC9\uFF1A",t.a.createElement("br",null),t.a.createElement("span",{className:"p"},"\u88AB\u7533\u8BC9\u7684\u8BC4\u5206\u8BB0\u5F55\u6709\u6548\uFF0C\u4E0D\u5141\u8BB8\u5B66\u751F\u5BF9\u8BE5\u8BC4\u5206\u8BB0\u5F55\u8FDB\u884C\u4E8C\u6B21\u7533\u8BC9"),t.a.createElement("span",{className:"p"},"\u88AB\u7533\u8BC9\u7684\u8BC4\u9605\u4EBA\u7684\u4F5C\u54C1\u6210\u7EE9\uFF0C\u4E0D\u4F1A\u6263\u9664\u8FDD\u89C4\u533F\u8BC4\u5206")),trigger:"click"},t.a.createElement("span",{className:"mt10 ml10 current font14"},t.a.createElement(st.a,null))))),Qt.anonymous_appeal&&t.a.createElement(t.a.Fragment,null,t.a.createElement(le.a,{align:"middle",className:"mt25 mb25 pl30"},t.a.createElement(d.a,null,"\u7533\u8BC9\u65B9\u5F0F:"),t.a.createElement(d.a,{className:"ml5"},t.a.createElement(_.a.Group,{value:Qt.unified_anonymous_appeal,disabled:vt||(ze==null?void 0:ze.anonymous_appeal),onChange:function(dn){Dn(function(Xt){return Object(f.a)(Object(f.a)({},Xt),{},{unified_anonymous_appeal:dn.target.value})}),Sn.resetFields()}},(ze==null?void 0:ze.unified_anonymous_comment)&&t.a.createElement(_.a,{value:!0},"\u7EDF\u4E00\u7533\u8BC9"),(ze==null||((Be=ze.group_settings)===null||Be===void 0)?void 0:Be.length)>0&&t.a.createElement(_.a,{value:!1},"\u5206\u73ED\u7533\u8BC9")))),Qt.unified_anonymous_appeal?t.a.createElement(Qr.a,{data:Qt,setData:Dn,disabled:vt}):t.a.createElement(xe.a,{form:Sn,initialValues:ze!=null&&ze.unified_anonymous_appeal?{anonymous_appeal_settings:[{deleteflag:!0}]}:{anonymous_appeal_settings:Yt(ze==null?void 0:ze.anonymous_appeal_settings,"appeal")}},t.a.createElement(ca.a,{disabled:vt,selectOptions:Nn,form:Sn})))),t.a.createElement(le.a,null,!vt&&t.a.createElement(d.a,{className:"mb50 mt20 btn-w120"},t.a.createElement(v.a,{type:"primary",size:"large",onClick:function(){return zt()}},"\u63D0\u4EA4"),t.a.createElement(v.a,{type:"primary",size:"large",ghost:!0,className:"ml20",onClick:function(){ct(!0),Rn()}},"\u53D6\u6D88"))))},va=Object(a.a)(function(zn){var bn=zn.shixunHomeworks,kn=zn.loading;return{shixunHomeworks:bn,loading:kn.effects}})(ir),Pa=qt.a.RangePicker,sa=ht.a.Option,la=function(bn){var kn,Wn,dr,ne,Re,$e=bn.shixunHomeworks,Be=bn.loading,Ye=bn.dispatch,et=Object(u.i)(),it=Object(u.h)(),Ae=$e.workSetting,ze=$e.workList,yt=Object(s.useState)(!0),en=Object(p.a)(yt,2),Tt=en[0],vt=en[1],ct=Object(s.useState)({}),St=Object(p.a)(ct,2),Ut=St[0],At=St[1],on=xe.a.useForm(),xn=Object(p.a)(on,1),vn=xn[0],Qt=Object(s.useState)([]),Dn=Object(p.a)(Qt,2),Rn=Dn[0],zt=Dn[1],Kt=Object(s.useState)([]),Cn=Object(p.a)(Kt,2),Zt=Cn[0],Nn=Cn[1],Vt=Object(s.useState)({unified_setting:!1,publish_time:"",end_time:"",ta_mode:1,final_mode:!1,st_proportion:"",ta_proportion:"",te_proportion:"",student_comment:!1,anonymous_appeal:!1,appeal_penalty:0,appeal_time:"",anonymous_comment:!1,evaluation_num:0,evaluation_start:"",evaluation_end:"",absence_penalty:0,work_public:!1,unified_late:!0,allow_late:!1,late_time:"",late_penalty:0,challenge_settings:[],work_efficiency:!1,shixun_evaluation:"",answer_open_evaluation:!1,answer_public:!1,score_open:!1,total_score:"",eff_score:""}),Un=Object(p.a)(Vt,2),Lt=Un[0],kt=Un[1],sr=(ze==null||((kn=ze.homework_status)===null||kn===void 0)?void 0:kn.includes("\u533F\u8BC4\u4E2D"))||(ze==null||((Wn=ze.homework_status)===null||Wn===void 0)?void 0:Wn.includes("\u7533\u8BC9\u4E2D")),Sn=(ze==null||((dr=ze.homework_status)===null||dr===void 0)?void 0:dr.includes("\u533F\u8BC4\u4E2D"))||(ze==null||((ne=ze.homework_status)===null||ne===void 0)?void 0:ne.includes("\u7533\u8BC9\u4E2D"))||(ze==null||((Re=ze.homework_status)===null||Re===void 0)?void 0:Re.includes("\u5DF2\u622A\u6B62"));Object(s.useEffect)(function(){Mn()},[]),Object(s.useEffect)(function(){if(!(Ae!=null&&Ae.course_id))return;Object.keys(Lt).map(function(mn){mn.indexOf("proportion")>-1&&(Ae[mn]=Ae[mn]*100),Lt[mn]=Ae[mn]}),(!Lt.allow_late||!Lt.unified_late)&&(Lt.late_penalty=5),Rn=JSON.parse(JSON.stringify(Ae.group_settings.map(function(mn){return Object(f.a)(Object(f.a)({},mn),{},{group_name:[mn.group_name]})}).filter(function(mn){return mn.publish_time!==null}))),Zt=JSON.parse(JSON.stringify(Ae.allow_late_settings.map(function(mn){return Object(f.a)(Object(f.a)({},mn),{},{group_name:[mn.group_name]})}).filter(function(mn){return mn.late_time!==null}))),kt(Object(f.a)({},Lt)),zt(Object(Fe.a)(Rn)),Nn(Object(Fe.a)(Zt))},[Ae]);var Mn=function(){Ye({type:"shixunHomeworks/getWorkSetting",payload:Object(f.a)({},et)})},wn=function(){var mn=Object(r.a)(o.a.mark(function Wt(){var Ht,dn,Xt,ln;return o.a.wrap(function(qn){for(;;)switch(qn.prev=qn.next){case 0:if(dn=JSON.parse(JSON.stringify(Lt)),dn.categoryId=et.categoryId,Lt.unified_setting||((Ht=Rn)===null||Ht===void 0||Ht.map(function(En){var Tr,$n;if(!En.publish_time||!En.end_time)throw C.b.error("\u8BF7\u628A\u53D1\u5E03\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u53D1\u5E03\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!En.group_name)throw C.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");En.group_name=typeof(En==null?void 0:En.group_name)=="string"?[En==null?void 0:En.group_name]:En==null?void 0:En.group_name,console.log("item:0",En,Ae.group_settings,Rn),En.group_id=En==null||((Tr=En.group_name)===null||Tr===void 0||(($n=Tr.map(function(Yn){var $r,Gr,aa=($r=Ae.group_settings)===null||$r===void 0||((Gr=$r.filter(function(Ta){return(Ta==null?void 0:Ta.group_name)===Yn}))===null||Gr===void 0)?void 0:Gr[0];return console.log("d:",aa,Yn),aa==null?void 0:aa.group_id}))===null||$n===void 0))?void 0:$n.toString().split(",")})),dn.group_settings=Rn,!Lt.allow_late){qn.next=16;break}if(!Lt.unified_late){qn.next=14;break}if(!(Lt.late_penalty===null||Lt.late_penalty===void 0||Lt.late_penalty<0||Lt.late_penalty>100)){qn.next=9;break}throw C.b.error("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100"),new String("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100");case 9:if(Lt.late_time){qn.next=12;break}throw C.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574");case 12:qn.next=16;break;case 14:Zt=(Xt=Zt)===null||Xt===void 0?void 0:Xt.map(function(En){var Tr,$n;if(En.late_penalty===null||En.late_penalty===void 0||En.late_penalty<0||En.late_penalty>100)throw C.b.error("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100"),new String("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100");if(!En.late_time)throw C.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!En.group_name)throw C.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return En.group_name=typeof(En==null?void 0:En.group_name)=="string"?[En==null?void 0:En.group_name]:En==null?void 0:En.group_name,En.group_id=En==null||((Tr=En.group_name)===null||Tr===void 0||(($n=Tr.map(function(Yn){var $r,Gr,aa=($r=Ae.group_settings)===null||$r===void 0||((Gr=$r.filter(function(Ta){return(Ta==null?void 0:Ta.group_name)===Yn}))===null||Gr===void 0)?void 0:Gr[0];return aa==null?void 0:aa.group_id}))===null||$n===void 0))?void 0:$n.toString().split(","),En}),dn.allow_late_settings=Zt;case 16:return Object.keys(dn).map(function(En){En.indexOf("proportion")>-1&&(dn[En]=dn[En]/100)}),qn.next=19,Object(_e.a)("/api/homework_commons/".concat(et.categoryId,"/score_setting_with_normal.json"),{method:"post",body:Object(f.a)({},dn)});case 19:ln=qn.sent,ln.status===0&&(C.b.success("\u66F4\u65B0\u6210\u529F"),vt(!0),Mn(),Ye({type:"shixunHomeworks/getWorkList",payload:Object(f.a)({},et)}));case 21:case"end":return qn.stop()}},Wt)}));return function(){return mn.apply(this,arguments)}}(),an=t.a.createElement("div",{className:"mask-tips"},"\u8BA1\u7B97\u8BF4\u660E\uFF1A",t.a.createElement("br",null),"\u6559\u5E08\u8BC4\u5206 * \u5176\u767E\u5206\u6BD4 + \u52A9\u6559\u8BC4\u5206 * \u5176\u767E\u5206\u6BD4 + \u5B66\u751F\u533F\u8BC4\u5E73\u5747\u5206 * \u5176\u767E\u5206\u6BD4 - (",t.a.createElement("br",null),"\u8FDF\u4EA4\u6263\u5206 + \u7F3A\u8BC4\u6263\u5206 * \u7F3A\u8BC4\u6570 + \u8FDD\u89C4\u533F\u8BC4\u6263\u5206 * \u8FDD\u89C4\u533F\u8BC4\u6570 )",t.a.createElement("br",null),t.a.createElement("br",null),"\u6CE8\u610F",t.a.createElement("br",null),"\u975E\u96F6\u767E\u5206\u6BD4\u7684\u8BC4\u5206\u9009\u9879\uFF0C\u82E5\u8BC4\u5206\u8BB0\u5F55\u4E3A\u7A7A\uFF0C\u5219\u5176\u767E\u5206\u6BD4\u5C06\u81EA\u52A8\u5E73\u644A\u5230\u5176\u5B83\u975E\u96F6",t.a.createElement("br",null),"\u8BC4\u5206\u9009\u9879\u4E0A\u3002",t.a.createElement("br",null),"\u4F8B\uFF1A\u6559\u5E08\u8BC4\u520640% + \u52A9\u6559\u8BC4\u520635% + \u5B66\u751F\u533F\u8BC425%\uFF0C\u5B66\u751FA\u6CA1\u6709\u6559\u5E08\u8BC4\u5206\u8BB0",t.a.createElement("br",null),"\u5F55\uFF0C\u5219\u5176\u6700\u7EC8\u6210\u7EE9\u6309\u7167\u52A9\u6559\u8BC4\u520655% + \u5B66\u751F\u533F\u8BC445%\u8FDB\u884C\u8BA1\u7B97"),Yt=t.a.createElement("div",{className:"mask-tips"},"\u8BA1\u7B97\u8BF4\u660E\uFF1A",t.a.createElement("br",null),"\u4F18\u5148\u987A\u5E8F\u6392\u524D\u7684\u975E\u96F6\u8BC4\u5206 * 100% -",t.a.createElement("br",null),"( \u8FDF\u4EA4\u6263\u5206 + \u7F3A\u8BC4\u6263\u5206 * \u7F3A\u8BC4\u6570 + \u8FDD\u89C4\u533F\u8BC4\u6263\u5206 * \u8FDD\u89C4\u533F\u8BC4\u6570 )",t.a.createElement("br",null),"\u4F8B\uFF1A\u6709\u6559\u5E08\u8BC4\u5206\u5219\u6559\u5E08\u8BC4\u5206100%\uFF0C\u5426\u5219\u6559\u8F85\u8BC4\u5206100%\uFF0C\u4F9D\u6B21\u7C7B\u63A8"),Gn=function(Wt){return Wt&&Wt<oe()().startOf("minute")};return t.a.createElement("section",{className:[xt.a.form].join(" ")},t.a.createElement("aside",{className:"pl30 pr30 pb30 bg-white"},t.a.createElement(le.a,null,t.a.createElement(d.a,{span:24},t.a.createElement(le.a,{align:"middle"},t.a.createElement(d.a,{flex:"1"},t.a.createElement("h1",{className:"mt15"},"\u8BC4\u5206\u8BBE\u7F6E")),t.a.createElement(d.a,null,(Ae==null?void 0:Ae.can_edit)&&Tt&&t.a.createElement(v.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return vt(!1)}},"\u7F16\u8F91\u8BBE\u7F6E"))))),t.a.createElement(le.a,{className:"mt25",style:{paddingLeft:40}},t.a.createElement(d.a,null,t.a.createElement("strong",null,"\u52A9\u6559\u8BC4\u5206")),t.a.createElement(d.a,{span:24,className:"pl30 mt10"})),t.a.createElement(le.a,{style:{paddingLeft:65}},t.a.createElement(_.a.Group,{disabled:Tt,value:Lt.ta_mode,onChange:function(Wt){Lt.ta_mode=Wt.target.value,kt(Object(f.a)({},Lt))}},t.a.createElement(_.a,{value:1,style:{marginTop:15}},t.a.createElement("strong",null,"\u666E\u901A\u6A21\u5F0F"),t.a.createElement("span",{className:"c-grey-c"},"\uFF08\u9009\u4E2D\uFF0C\u5219\u53D6\u5404\u52A9\u6559\u6700\u7EC8\u8BC4\u5206\u7684\u5E73\u5747\u5206\uFF09")),t.a.createElement("br",null),t.a.createElement(_.a,{value:0,style:{marginTop:15}},t.a.createElement("strong",null,"\u590D\u5BA1\u6A21\u5F0F"),t.a.createElement("span",{className:"c-grey-c"},"\uFF08\u9009\u4E2D\uFF0C\u5219\u53EA\u53D6\u6700\u65B0\u7684\u52A9\u6559\u8BC4\u5206\uFF09")))),t.a.createElement(le.a,{className:"mt25",style:{paddingLeft:40}},t.a.createElement(d.a,null,t.a.createElement("strong",null,"\u6700\u7EC8\u6210\u7EE9\u7EC4\u6210\uFF1A")),t.a.createElement(d.a,{span:24,className:"pl30 mt10"})),t.a.createElement(le.a,{style:{paddingLeft:65}},t.a.createElement(_.a.Group,{disabled:Tt,value:Lt.final_mode,onChange:function(Wt){Lt.final_mode=Wt.target.value,kt(Object(f.a)({},Lt))}},t.a.createElement(_.a,{value:!1,style:{marginTop:15}},t.a.createElement("strong",null,"\u591A\u9879\u8BC4\u5206\u914D\u6BD4"),t.a.createElement("span",{className:"c-grey-c"},"\uFF08\u9009\u4E2D\uFF0C\u5219\u6309\u7167\u6BD4\u4F8B\u8BA1\u7B97\u6700\u7EC8\u6210\u7EE9\uFF09",t.a.createElement(_r.a,{placement:"bottomLeft",content:an,trigger:"click"},t.a.createElement(st.a,{className:"ml20 current"})))),t.a.createElement(le.a,{align:"middle",className:"mt25 pl30 font14"},t.a.createElement(d.a,null,"\u6559\u5E08\u8BC4\u5206:"),t.a.createElement(d.a,{className:"ml5"},t.a.createElement(L.a,{disabled:Tt,value:Lt.te_proportion,onChange:function(Wt){Lt.te_proportion=Wt,kt(Object.assign({},Lt))}}),t.a.createElement("span",{className:"ml10"},"%"))),t.a.createElement(le.a,{align:"middle",className:"mt25 pl30 font14"},t.a.createElement(d.a,null,"\u52A9\u6559\u8BC4\u5206:"),t.a.createElement(d.a,{className:"ml5"},t.a.createElement(L.a,{disabled:Tt,value:Lt.ta_proportion,onChange:function(Wt){Lt.ta_proportion=Wt,kt(Object.assign({},Lt))}}),t.a.createElement("span",{className:"ml10"},"%"))),t.a.createElement(le.a,{align:"middle",className:"mt25 pl30 font14"},t.a.createElement(d.a,null,"\u5B66\u751F\u533F\u8BC4:"),t.a.createElement(d.a,{className:"ml5"},t.a.createElement(L.a,{disabled:Tt,value:Lt.st_proportion,onChange:function(Wt){Lt.st_proportion=Wt,kt(Object.assign({},Lt))}}),t.a.createElement("span",{className:"ml10"},"%"))),t.a.createElement("br",null),t.a.createElement(_.a,{value:!0,style:{marginTop:15}},t.a.createElement("strong",null,"\u5355\u9879\u8BC4\u5206\u4F18\u5148"),t.a.createElement("span",{className:"c-grey-c"},"\uFF08\u9009\u4E2D\uFF0C\u5219\u6309\u7167\u4F18\u5148\u987A\u5E8F\u8BA1\u7B97\u6700\u7EC8\u6210\u7EE9\uFF09",t.a.createElement(_r.a,{placement:"bottomLeft",content:Yt,trigger:"click"},t.a.createElement(st.a,{className:"ml20 current"}))))),t.a.createElement("br",null)),t.a.createElement("div",{style:{paddingLeft:77}},"\uFF08\u6559\u5E08\u8BC4\u5206 \u2192 \u6559\u8F85\u8BC4\u5206 \u2192 \u5B66\u751F\u533F\u8BC4\u8BC4\u5206\uFF09")),t.a.createElement(le.a,null,!Tt&&t.a.createElement(d.a,{className:"mb50 mt20 btn-w120"},t.a.createElement(v.a,{type:"primary",size:"large",onClick:function(){return wn()}},"\u63D0\u4EA4"),t.a.createElement(v.a,{type:"primary",size:"large",ghost:!0,className:"ml20",onClick:function(){vt(!0),Mn()}},"\u53D6\u6D88"))))},ee=Object(a.a)(function(zn){var bn=zn.shixunHomeworks,kn=zn.loading;return{shixunHomeworks:bn,loading:kn.effects}})(la),N=qt.a.RangePicker,B=ht.a.Option,X=function(bn){var kn,Wn,dr,ne,Re,$e=bn.shixunHomeworks,Be=bn.loading,Ye=bn.dispatch,et=Object(u.i)(),it=Object(u.h)(),Ae=$e.workSetting,ze=$e.workList,yt=Object(s.useState)(!0),en=Object(p.a)(yt,2),Tt=en[0],vt=en[1],ct=Object(s.useState)({}),St=Object(p.a)(ct,2),Ut=St[0],At=St[1],on=xe.a.useForm(),xn=Object(p.a)(on,1),vn=xn[0],Qt=Object(s.useState)([]),Dn=Object(p.a)(Qt,2),Rn=Dn[0],zt=Dn[1],Kt=Object(s.useState)([]),Cn=Object(p.a)(Kt,2),Zt=Cn[0],Nn=Cn[1],Vt=Object(s.useState)({unified_setting:!1,publish_time:"",end_time:"",ta_mode:1,final_mode:!1,st_proportion:"",ta_proportion:"",te_proportion:"",student_comment:!1,anonymous_appeal:!1,appeal_penalty:0,appeal_time:"",anonymous_comment:!1,evaluation_num:0,evaluation_start:"",evaluation_end:"",absence_penalty:0,work_public:!1,unified_late:!0,allow_late:!1,late_time:"",late_penalty:0,challenge_settings:[],work_efficiency:!1,shixun_evaluation:"",answer_open_evaluation:!1,answer_public:!1,score_open:!1,total_score:"",eff_score:""}),Un=Object(p.a)(Vt,2),Lt=Un[0],kt=Un[1],sr=(ze==null||((kn=ze.homework_status)===null||kn===void 0)?void 0:kn.includes("\u533F\u8BC4\u4E2D"))||(ze==null||((Wn=ze.homework_status)===null||Wn===void 0)?void 0:Wn.includes("\u7533\u8BC9\u4E2D")),Sn=(ze==null||((dr=ze.homework_status)===null||dr===void 0)?void 0:dr.includes("\u533F\u8BC4\u4E2D"))||(ze==null||((ne=ze.homework_status)===null||ne===void 0)?void 0:ne.includes("\u7533\u8BC9\u4E2D"))||(ze==null||((Re=ze.homework_status)===null||Re===void 0)?void 0:Re.includes("\u5DF2\u622A\u6B62"));Object(s.useEffect)(function(){Mn()},[]),Object(s.useEffect)(function(){if(!(Ae!=null&&Ae.course_id))return;Object.keys(Lt).map(function(mn){Lt[mn]=Ae[mn]}),(!Lt.allow_late||!Lt.unified_late)&&(Lt.late_penalty=5),Rn=JSON.parse(JSON.stringify(Ae.group_settings.map(function(mn){return Object(f.a)(Object(f.a)({},mn),{},{group_name:[mn.group_name]})}).filter(function(mn){return mn.publish_time!==null}))),Zt=JSON.parse(JSON.stringify(Ae.allow_late_settings.map(function(mn){return Object(f.a)(Object(f.a)({},mn),{},{group_name:[mn.group_name]})}).filter(function(mn){return mn.late_time!==null}))),kt(Object(f.a)({},Lt)),zt(Object(Fe.a)(Rn)),Nn(Object(Fe.a)(Zt))},[Ae]);var Mn=function(){Ye({type:"shixunHomeworks/getWorkSetting",payload:Object(f.a)({},et)})},wn=function(){var Wt,Ht=JSON.parse(JSON.stringify(Lt));if(Ht.categoryId=et.categoryId,Lt.unified_setting||((Wt=Rn)===null||Wt===void 0||Wt.map(function(Xt){var ln,Zn;if(!Xt.publish_time||!Xt.end_time)throw C.b.error("\u8BF7\u628A\u53D1\u5E03\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u53D1\u5E03\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!Xt.group_name)throw C.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");Xt.group_name=typeof(Xt==null?void 0:Xt.group_name)=="string"?[Xt==null?void 0:Xt.group_name]:Xt==null?void 0:Xt.group_name,console.log("item:0",Xt,Ae.group_settings,Rn),Xt.group_id=Xt==null||((ln=Xt.group_name)===null||ln===void 0||((Zn=ln.map(function(qn){var En,Tr,$n=(En=Ae.group_settings)===null||En===void 0||((Tr=En.filter(function(Yn){return(Yn==null?void 0:Yn.group_name)===qn}))===null||Tr===void 0)?void 0:Tr[0];return console.log("d:",$n,qn),$n==null?void 0:$n.group_id}))===null||Zn===void 0))?void 0:Zn.toString().split(",")})),Ht.group_settings=Rn,Lt.allow_late)if(Lt.unified_late){if(Lt.late_penalty===null||Lt.late_penalty===void 0||Lt.late_penalty<0||Lt.late_penalty>100)throw C.b.error("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100"),new String("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100");if(!Lt.late_time)throw C.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574")}else{var dn;Zt=(dn=Zt)===null||dn===void 0?void 0:dn.map(function(Xt){var ln,Zn;if(Xt.late_penalty===null||Xt.late_penalty===void 0||Xt.late_penalty<0||Xt.late_penalty>100)throw C.b.error("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100"),new String("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100");if(!Xt.late_time)throw C.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!Xt.group_name)throw C.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return Xt.group_name=typeof(Xt==null?void 0:Xt.group_name)=="string"?[Xt==null?void 0:Xt.group_name]:Xt==null?void 0:Xt.group_name,Xt.group_id=Xt==null||((ln=Xt.group_name)===null||ln===void 0||((Zn=ln.map(function(qn){var En,Tr,$n=(En=Ae.group_settings)===null||En===void 0||((Tr=En.filter(function(Yn){return(Yn==null?void 0:Yn.group_name)===qn}))===null||Tr===void 0)?void 0:Tr[0];return $n==null?void 0:$n.group_id}))===null||Zn===void 0))?void 0:Zn.toString().split(","),Xt}),Ht.allow_late_settings=Zt}Object.keys(Ht).map(function(Xt){Xt.indexOf("proportion")>-1&&(Ht[Xt]=Ht[Xt]/100)}),Ye({type:"shixunHomeworks/updateSetting",payload:Ht}).then(function(Xt){Xt.status===0&&(C.b.success("\u66F4\u65B0\u6210\u529F"),vt(!0),Mn(),Ye({type:"shixunHomeworks/getWorkList",payload:Object(f.a)({},et)}))})},an=t.a.createElement("div",{className:"mask-tips"},"\u8BA1\u7B97\u8BF4\u660E\uFF1A",t.a.createElement("br",null),"\u6559\u5E08\u8BC4\u5206 * \u5176\u767E\u5206\u6BD4 + \u52A9\u6559\u8BC4\u5206 * \u5176\u767E\u5206\u6BD4 + \u5B66\u751F\u533F\u8BC4\u5E73\u5747\u5206 * \u5176\u767E\u5206\u6BD4 - (",t.a.createElement("br",null),"\u8FDF\u4EA4\u6263\u5206 + \u7F3A\u8BC4\u6263\u5206 * \u7F3A\u8BC4\u6570 + \u8FDD\u89C4\u533F\u8BC4\u6263\u5206 * \u8FDD\u89C4\u533F\u8BC4\u6570 )",t.a.createElement("br",null),t.a.createElement("br",null),"\u6CE8\u610F",t.a.createElement("br",null),"\u975E\u96F6\u767E\u5206\u6BD4\u7684\u8BC4\u5206\u9009\u9879\uFF0C\u82E5\u8BC4\u5206\u8BB0\u5F55\u4E3A\u7A7A\uFF0C\u5219\u5176\u767E\u5206\u6BD4\u5C06\u81EA\u52A8\u5E73\u644A\u5230\u5176\u5B83\u975E\u96F6",t.a.createElement("br",null),"\u8BC4\u5206\u9009\u9879\u4E0A\u3002",t.a.createElement("br",null),"\u4F8B\uFF1A\u6559\u5E08\u8BC4\u520640% + \u52A9\u6559\u8BC4\u520635% + \u5B66\u751F\u533F\u8BC425%\uFF0C\u5B66\u751FA\u6CA1\u6709\u6559\u5E08\u8BC4\u5206\u8BB0",t.a.createElement("br",null),"\u5F55\uFF0C\u5219\u5176\u6700\u7EC8\u6210\u7EE9\u6309\u7167\u52A9\u6559\u8BC4\u520655% + \u5B66\u751F\u533F\u8BC445%\u8FDB\u884C\u8BA1\u7B97"),Yt=t.a.createElement("div",{className:"mask-tips"},"\u8BA1\u7B97\u8BF4\u660E\uFF1A",t.a.createElement("br",null),"\u4F18\u5148\u987A\u5E8F\u6392\u524D\u7684\u975E\u96F6\u8BC4\u5206 * 100% -",t.a.createElement("br",null),"( \u8FDF\u4EA4\u6263\u5206 + \u7F3A\u8BC4\u6263\u5206 * \u7F3A\u8BC4\u6570 + \u8FDD\u89C4\u533F\u8BC4\u6263\u5206 * \u8FDD\u89C4\u533F\u8BC4\u6570 )",t.a.createElement("br",null),"\u4F8B\uFF1A\u6709\u6559\u5E08\u8BC4\u5206\u5219\u6559\u5E08\u8BC4\u5206100%\uFF0C\u5426\u5219\u6559\u8F85\u8BC4\u5206100%\uFF0C\u4F9D\u6B21\u7C7B\u63A8"),Gn=function(Wt){return Wt&&Wt<oe()().startOf("minute")};return t.a.createElement("section",{className:[xt.a.form].join(" ")},t.a.createElement("aside",{className:"pl30 pr30 pb30 bg-white"},t.a.createElement(le.a,null,t.a.createElement(d.a,{span:24},t.a.createElement(le.a,{align:"middle"},t.a.createElement(d.a,{flex:"1"},t.a.createElement("h1",{className:"mt15"},"\u516C\u5F00\u8BBE\u7F6E")),t.a.createElement(d.a,null,(Ae==null?void 0:Ae.can_edit)&&Tt&&t.a.createElement(v.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return vt(!1)}},"\u7F16\u8F91\u8BBE\u7F6E")))),t.a.createElement(d.a,{span:24,className:"mt15 pl30"},t.a.createElement(U.a,{checked:Lt.work_public,disabled:Tt,onChange:function(Wt){Lt.work_public=Wt.target.checked,kt(Object.assign({},Lt))}},t.a.createElement("strong",null,"\u516C\u5F00\u4F5C\u54C1")),t.a.createElement("span",{className:"c-grey-c font12"},"(\u9009\u4E2D\uFF0C\u5219\u5728\u4F5C\u4E1A\u622A\u6B62/\u8865\u4EA4\u7ED3\u675F\u65F6\u95F4\u4E4B\u540E\uFF0C\u5DF2\u63D0\u4EA4\u4F5C\u54C1\u7684\u5B66\u751F\u53EF\u4EE5\u67E5\u770B\u5176\u5B83\u5B66\u751F\u7684\u4F5C\u54C1\uFF0C\u5426\u5219\u53EA\u80FD\u67E5\u770B\u81EA\u5DF1\u7684\u4F5C\u54C1)")),t.a.createElement(d.a,{span:24,className:"mt15 pl30"},t.a.createElement(U.a,{checked:Lt.score_open,disabled:Tt,onChange:function(Wt){Lt.score_open=Wt.target.checked,kt(Object.assign({},Lt))}},t.a.createElement("strong",null,"\u516C\u5F00\u6210\u7EE9")),t.a.createElement("span",{className:"c-grey-c font12"},"(\u9009\u4E2D\uFF0C\u5219\u5728\u4F5C\u4E1A\u622A\u6B62/\u8865\u4EA4\u7ED3\u675F\u65F6\u95F4\u4E4B\u540E\uFF0C\u5DF2\u63D0\u4EA4\u4F5C\u54C1\u7684\u5B66\u751F\u53EF\u4EE5\u67E5\u770B\u5176\u5B83\u5B66\u751F\u7684\u6210\u7EE9\uFF0C\u5426\u5219\u53EA\u80FD\u67E5\u770B\u81EA\u5DF1\u7684\u6210\u7EE9)")),t.a.createElement(d.a,{span:24,className:"mt15 pl30 pb40"},t.a.createElement(U.a,{checked:Lt.answer_public,disabled:Tt,onChange:function(Wt){Lt.answer_public=Wt.target.checked,kt(Object.assign({},Lt))}},t.a.createElement("strong",null,"\u516C\u5F00\u7B54\u6848")),t.a.createElement("span",{className:"c-grey-c font12"},"(\u9009\u4E2D\uFF0C\u5219\u5728\u4F5C\u4E1A\u622A\u6B62/\u8865\u4EA4\u7ED3\u675F\u65F6\u95F4\u4E4B\u540E\uFF0C\u5DF2\u63D0\u4EA4\u4F5C\u54C1\u7684\u5B66\u751F\u53EF\u4EE5\u67E5\u770B\u4F5C\u4E1A\u53C2\u8003\u7B54\u6848\uFF0C\u5426\u5219\u4E0D\u80FD\u67E5\u770B\u4F5C\u4E1A\u53C2\u8003\u7B54\u6848)")))),t.a.createElement(le.a,null,!Tt&&t.a.createElement(d.a,{className:"mb50 mt20 btn-w120"},t.a.createElement(v.a,{type:"primary",size:"large",onClick:function(){return wn()}},"\u63D0\u4EA4"),t.a.createElement(v.a,{type:"primary",size:"large",ghost:!0,className:"ml20",onClick:function(){vt(!0),Mn()}},"\u53D6\u6D88"))))},ue=Object(a.a)(function(zn){var bn=zn.shixunHomeworks,kn=zn.loading;return{shixunHomeworks:bn,loading:kn.effects}})(X),q=function(bn){var kn=bn.shixunHomeworks,Wn=bn.loading,dr=bn.dispatch;return t.a.createElement("section",{className:"".concat([xt.a.form].join(" ")," ").concat(xt.a.configWorkContainer)},t.a.createElement(V.a,null,t.a.createElement(V.a.TabPane,{tab:"\u53D1\u5E03\u8BBE\u7F6E",key:1},t.a.createElement(yn,null)),t.a.createElement(V.a.TabPane,{tab:"\u533F\u8BC4\u8BBE\u7F6E",key:2},t.a.createElement(va,null)),t.a.createElement(V.a.TabPane,{tab:"\u8BC4\u5206\u8BBE\u7F6E",key:3},t.a.createElement(ee,null)),t.a.createElement(V.a.TabPane,{tab:"\u516C\u5F00\u8BBE\u7F6E",key:4},t.a.createElement(ue,null)),t.a.createElement(V.a.TabPane,{tab:"\u534F\u4F5C\u8BBE\u7F6E",key:5},t.a.createElement(gt,null))))},Ze=Object(a.a)(function(zn){var bn=zn.shixunHomeworks,kn=zn.loading;return{shixunHomeworks:bn,loading:kn.effects}})(q),Jt=T("28ck"),On=T.n(Jt),Xn=T("XYT7"),un=T("uiYX"),nr=T("8GSA"),mr=T("T2oS"),Kr=T("W9HT"),ma=T("fOrg"),da=T("+KLJ"),Zr=T("6Bc3"),za=T.n(Zr),oi=function(bn){var kn,Wn=bn.shixunHomeworks,dr=bn.loading,ne=bn.dispatch,Re=Object(u.i)(),$e=Object(s.useState)(Object(f.a)(Object(f.a)({},{page:1,limit:20,group_ids:[]}),Re)),Be=Object(p.a)($e,2),Ye=Be[0],et=Be[1],it=Wn.codeReview,Ae=xe.a.useForm(),ze=Object(p.a)(Ae,1),yt=ze[0];Ye.order="code_rate",Ye.sort="desc",Ye.category=Ye.categoryId,Object(s.useEffect)(function(){en()},[Ye]),Object(s.useEffect)(function(){Wn.actionTabs.key==="\u6267\u884C\u4EE3\u7801\u67E5\u91CD"&&en()},[Wn.actionTabs.key]);var en=function(){var ct=Object(r.a)(o.a.mark(function St(){var Ut;return o.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:return on.next=2,ne({type:"shixunHomeworks/getFileRepeatResult",payload:Object(f.a)(Object(f.a)({},Ye),{},{id:Ye==null?void 0:Ye.category,course_id:Ye==null?void 0:Ye.coursesId})});case 2:Ut=on.sent,Ut.status===-2&&setTimeout(function(){return en()},1500);case 4:case"end":return on.stop()}},St)}));return function(){return ct.apply(this,arguments)}}(),Tt=function(St,Ut){Ye.page=St,Ye.limit=20,ne({type:"shixunHomeworks/getFileRepeatResult",payload:Object(f.a)(Object(f.a)({},Ye),{},{id:Ye==null?void 0:Ye.category,course_id:Ye==null?void 0:Ye.coursesId})})},vt=[{title:"\u5E8F\u53F7",dataIndex:"number",render:function(St,Ut,At){return Ye.limit*(Ye.page-1)+At+1}},{title:"\u59D3\u540D",dataIndex:"user"},{title:"\u5B66\u53F7",dataIndex:"student_id"},{title:"\u76F8\u4F3C\u5EA6",dataIndex:"similar_rate",render:function(St){return t.a.createElement("span",{className:"c-orange"},St)}},{title:"\u64CD\u4F5C",dataInex:"action",render:function(St,Ut){return t.a.createElement("div",null,t.a.createElement(i.a,{target:"_blank",to:"/classrooms/".concat(Ye.coursesId,"/common_homework/").concat(Ye.categoryId,"/review_detail/").concat(Ut.user_id)},"\u67E5\u770B"),t.a.createElement("br",null))}}];return t.a.createElement("section",{className:"minH500 bg-white pl30 pr30 pt10"},t.a.createElement(le.a,null,t.a.createElement(d.a,{flex:"1"},t.a.createElement("p",{className:"mt10"},"\u67E5\u91CD\u65F6\u95F4\uFF1A",it.time,t.a.createElement(v.a,{ghost:!0,danger:!0,style:{color:"#29BD8B",borderColor:"#29BD8B",marginLeft:10},onClick:function(){ne({type:"shixunHomeworks/setActionTabs",payload:{key:"\u4EE3\u7801\u67E5\u91CD",params:Ye}})}},"\u6587\u6863\u67E5\u91CD"))),t.a.createElement(d.a,null,t.a.createElement(F.a.Search,{allowClear:!0,placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D\u6216\u8005\u5B66\u53F7\u641C\u7D22",onSearch:function(St){Ye.search=St,ne({type:"shixunHomeworks/getFileRepeatResult",payload:Object(f.a)(Object(f.a)({},Ye),{},{id:Ye==null?void 0:Ye.category,course_id:Ye==null?void 0:Ye.coursesId})})},style:{width:200}}),t.a.createElement("span",{className:"ml5 c-red"}))),(it==null?void 0:it.status)===-2&&t.a.createElement("div",{style:{textAlign:"center",margin:"100px 0px",paddingBottom:"100px"}},t.a.createElement("img",{src:za.a}),t.a.createElement("br",null),t.a.createElement(v.a,{type:"primary",style:{width:"120px",height:"40px"},onClick:function(){ne({type:"shixunHomeworks/getFileRepeatResult",payload:Object(f.a)(Object(f.a)({},Ye),{},{id:Ye==null?void 0:Ye.category,course_id:Ye==null?void 0:Ye.coursesId})})}},"\u5237\u65B0\u9875\u9762")),((kn=it.course_groups)===null||kn===void 0?void 0:kn.length)>0&&t.a.createElement(t.a.Fragment,null,t.a.createElement(le.a,null,t.a.createElement(d.a,{flex:"80px",className:"font14"},"\u5206\u73ED\u60C5\u51B5:"),t.a.createElement(d.a,{flex:"80px"},t.a.createElement(U.a,{checked:Ye.group_ids=="",value:"all",onChange:function(St){delete Ye.group_ids,Ye.group_ids=[],Ye.page=1,et(Object(f.a)({},Ye))}},"\u5168\u90E8")),t.a.createElement(d.a,{flex:"1"},it.course_groups&&it.course_groups.map(function(ct,St){return t.a.createElement(U.a,{value:ct.id,checked:Ye.group_ids.includes(ct.id),onChange:function(At){At.target.checked?Ye.group_ids.push(ct.id):Ye.group_ids.splice(Ye.group_ids.indexOf(ct.id),1),Ye.page=1,et(Object(f.a)({},Ye))}},ct.name,"(",ct.members_count,")")}))),t.a.createElement(le.a,{className:"font14 c-red mt5"},t.a.createElement(d.a,null,"\u672C\u9875\u4EC5\u663E\u793A\u5168\u90E8\u5DF2\u67E5\u91CD\u5206\u73ED"))),(it==null?void 0:it.data)==="\u52A0\u8F7D\u4E2D"&&t.a.createElement(Kr.a,null,t.a.createElement(da.a,{message:it==null?void 0:it.data,type:"info"})),(it==null?void 0:it.data)==="\u6682\u65E0\u67E5\u91CD\u8BB0\u5F55"||(it==null?void 0:it.data)==="\u52A0\u8F7D\u4E2D"?"":t.a.createElement("div",null,t.a.createElement("p",{className:"mt10"},t.a.createElement("span",{className:"c-red"},it.similar_count),"\u4E2A\u7591\u4F3C\u6284\u88AD\u5B66\u5458\uFF08",it.total_count,"\u5B66\u5458\uFF09"),t.a.createElement(y.a,{className:"mt30",pagination:!1,dataSource:it.data,columns:vt,onChange:function(St,Ut,At){At.order==="ascend"&&(Ye.b_order="asc"),At.order==="descend"&&(Ye.b_order="desc"),At.order||delete Ye.b_order,ne({type:"shixunHomeworks/getFileRepeatResult",payload:Object(f.a)(Object(f.a)({},Ye),{},{id:Ye==null?void 0:Ye.category,course_id:Ye==null?void 0:Ye.coursesId})})}}),t.a.createElement("aside",{className:"tc mb50 mt30"},t.a.createElement(g.a,{showSizeChanger:!1,onChange:Tt,defaultCurrent:Ye.page||1,current:Ye.page||1,defaultPageSize:20,hideOnSinglePage:!0,total:it.copy_reviews_count}))))},ua=Object(a.a)(function(zn){var bn=zn.shixunHomeworks,kn=zn.loading;return{shixunHomeworks:bn,loading:kn.effects}})(oi),Na=function(bn){var kn,Wn=bn.shixunHomeworks,dr=bn.dispatch,ne=Object(u.i)(),Re=Object(s.useState)([]),$e=Object(p.a)(Re,2),Be=$e[0],Ye=$e[1],et=Object(s.useState)(!1),it=Object(p.a)(et,2),Ae=it[0],ze=it[1],yt=Object(s.useState)(!1),en=Object(p.a)(yt,2),Tt=en[0],vt=en[1],ct=Object(s.useState)(!1),St=Object(p.a)(ct,2),Ut=St[0],At=St[1];Object(s.useEffect)(function(){Wn.actionTabs.key==="\u4EE3\u7801\u67E5\u91CD"?(vn.resetFields(),Ye([]),vt(!0),Dn()):vt(!1)},[Wn.actionTabs.key]);var on=xe.a.useForm(),xn=Object(p.a)(on,1),vn=xn[0],Qt=[],Dn=function(){var Kt=Object(r.a)(o.a.mark(function Cn(){var Zt;return o.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:return ze(!0),Vt.next=3,Object(Xn.B)(Object(f.a)(Object(f.a)({},ne),{},{course_id:ne==null?void 0:ne.coursesId,id:ne==null?void 0:ne.categoryId}));case 3:Zt=Vt.sent,Ye([].concat(Object(Fe.a)(Be),Object(Fe.a)(Zt==null?void 0:Zt.data))),ze(!1);case 6:case"end":return Vt.stop()}},Cn)}));return function(){return Kt.apply(this,arguments)}}(),Rn=function(){dr({type:"shixunHomeworks/setActionTabs",payload:{}}),At(!1),ze(!1),Ye([]),vn.resetFields()},zt=[{title:"",dataIndex:"course_group_id",width:280,render:function(Cn,Zt){return t.a.createElement(U.a,{disabled:!(Zt.work_count>=1),value:String(Zt.course_group_id)},Zt.course_group_name)}},{title:"\u6709\u6548\u4F5C\u54C1\u6570",dataIndex:"work_count"},{title:"\u4E0A\u6B21\u67E5\u91CD\u65F6\u95F4",dataIndex:"last_time",width:130}];return t.a.createElement(I.a,{centered:!0,title:"\u6587\u6863\u67E5\u91CD",keyboard:!1,maskClosable:!1,visible:Tt,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",width:820,bodyStyle:{minHeight:200},onOk:Object(r.a)(o.a.mark(function Kt(){var Cn,Zt;return o.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:return Cn=vn.getFieldsValue(),Vt.next=3,Object(_e.a)("/api/homework_commons/".concat(ne.categoryId,"/homework_file_repeat.json"),{method:"get",params:{course_group_id:Object(Fe.a)(Cn.group_ids)}});case 3:if(Zt=Vt.sent,!(Zt.status===0)){Vt.next=11;break}return Rn(),C.b.success("\u64CD\u4F5C\u6210\u529F"),Vt.next=9,dr({type:"shixunHomeworks/getWorkList",payload:Wn.actionTabs.params});case 9:a.d.push("/classrooms/".concat(ne.coursesId,"/common_homework/").concat(ne.categoryId,"/detail?tabs=4")),dr({type:"shixunHomeworks/setActionTabs",payload:{key:"\u6267\u884C\u4EE3\u7801\u67E5\u91CD"}});case 11:case"end":return Vt.stop()}},Kt)})),onCancel:Rn},Wn.codeReviewCourse&&t.a.createElement(xe.a,{form:vn,initialValues:(kn={},Object(Te.a)(kn,"group_ids",Qt),Object(Te.a)(kn,"end_time",oe()(oe()().add(7,"days").format("YYYY-MM-DD HH:mm"))),kn)},t.a.createElement("div",{className:"flexd-table-header mt20"},t.a.createElement(y.a,{pagination:!1,dataSource:[],columns:zt})),t.a.createElement(xe.a.Item,{name:"group_ids"},t.a.createElement(U.a.Group,{className:"w100"},t.a.createElement("div",{style:{width:"100%",maxHeight:360,overflow:"auto"}},t.a.createElement(y.a,{showHeader:!1,columns:zt,dataSource:Be,pagination:!1,loading:Ae}))))),t.a.createElement(le.a,null,t.a.createElement(d.a,{className:"ml10"},t.a.createElement(U.a,{checked:Ut,onChange:function(Cn){At(Cn.target.checked);var Zt=[];Cn.target.checked&&(Zt=Be.filter(function(Nn){return Nn.work_count>=1}).map(function(Nn){return Nn.course_group_id+""})),vn.setFieldsValue(Object(Te.a)({},"group_ids",Zt))}},"\u5168\u9009"))))},ti=Object(a.a)(function(zn){var bn=zn.shixunHomeworks;return{shixunHomeworks:bn}})(Na),Ga=function(bn){var kn,Wn,dr=bn.user,ne=bn.shixunHomeworks,Re=bn.dispatch,$e=Object(u.i)(),Be=Object(u.h)(),Ye=Object(s.useState)(Be.query.tabs||"0"),et=Object(p.a)(Ye,2),it=et[0],Ae=et[1],ze=Object(s.useRef)(null),yt=Object(s.useState)(!1),en=Object(p.a)(yt,2),Tt=en[0],vt=en[1],ct=ne.workList;Be.query.category_id&&($e.category=Be.query.category_id),Object(s.useEffect)(function(){St()},[$e.coursesId]);var St=function(){Re({type:"shixunHomeworks/getWorkList",payload:Object(f.a)({},$e)})},Ut=[{name:Object(ge.c)()?"\u4F5C\u4E1A\u5217\u8868":"\u4F5C\u54C1\u5217\u8868",id:"0",component:t.a.createElement(It,{zip:ze,btnLoading:Tt,setBtnLoading:vt})},{name:"\u4F5C\u4E1A\u63CF\u8FF0",id:"1",component:t.a.createElement("div",{className:"minH500"},t.a.createElement(lt,null))},{name:"\u6587\u6863\u67E5\u91CD",id:"4",component:t.a.createElement(ua,null),hidden:!Object(ge.c)()},{name:"\u53C2\u8003\u7B54\u6848",id:"2",component:t.a.createElement(cn,null),hidden:!(ct!=null&&ct.view_answer)},{name:Object(ge.c)()?"\u8BBE\u7F6E":"\u5F97\u5206\u89C4\u5219",id:"3",component:t.a.createElement(Ze,null)}].filter(function(on){return!on.hidden}),At=function(){var xn,vn,Qt,Dn,Rn,zt,Kt,Cn,Zt,Nn,Vt,Un;return t.a.createElement("div",{className:On.a.workListTabButton},Object(ge.c)()&&t.a.createElement(t.a.Fragment,null,(((xn=ct.homework_status)===null||xn===void 0?void 0:xn.includes("\u672A\u53D1\u5E03"))||((vn=ct.homework_status)===null||vn===void 0?void 0:vn.includes("\u672A\u5F00\u59CB")))&&t.a.createElement(v.a,{type:"primary",icon:t.a.createElement("i",{className:"iconfont icon-yishezhifabushijian1"}),onClick:function(kt){kt.preventDefault(),Re({type:"classroomList/setActionTabs",payload:{key:"\u7ACB\u5373\u53D1\u5E03",selectArrs:[$e.categoryId],selectArrsAll:[ct],params:$e,detail:!0,type:2}})}},"\u7ACB\u5373\u53D1\u5E03"),!((Qt=ct.homework_status)!==null&&Qt!==void 0&&Qt.includes("\u672A\u53D1\u5E03"))&&!((Dn=ct.homework_status)!==null&&Dn!==void 0&&Dn.includes("\u672A\u5F00\u59CB"))&&!((Rn=ct.homework_status)!==null&&Rn!==void 0&&Rn.includes("\u5DF2\u622A\u6B62"))&&t.a.createElement(v.a,{type:"primary",icon:t.a.createElement("i",{className:"iconfont icon-jiezhishiyan"}),onClick:function(kt){kt.preventDefault(),Re({type:"classroomList/setActionTabs",payload:{key:"\u7ACB\u5373\u622A\u6B62",selectArrs:[$e.categoryId],selectArrsAll:[],params:$e,type:2}})}},"\u7ACB\u5373\u622A\u6B62"),t.a.createElement(v.a,{type:"primary",icon:t.a.createElement("i",{className:"iconfont icon-bianji2"}),onClick:function(){return a.d.push("/classrooms/".concat($e.coursesId,"/common_homework/").concat($e.categoryId,"/edit"))}},"\u7F16\u8F91\u4F5C\u4E1A")),(ct==null||((zt=ct.work_statuses)===null||zt===void 0)?void 0:zt.includes("\u53D6\u6D88\u5173\u8054"))&&t.a.createElement(v.a,{type:"primary",onClick:Object(r.a)(o.a.mark(function Lt(){var kt;return o.a.wrap(function(Sn){for(;;)switch(Sn.prev=Sn.next){case 0:return Sn.next=2,Object(Xn.h)({homeworkId:$e.categoryId});case 2:kt=Sn.sent,(kt==null?void 0:kt.status)===0&&(C.b.success("\u53D6\u6D88\u5173\u8054\u6210\u529F"),Re({type:"shixunHomeworks/getWorkList",payload:Object(f.a)({},$e)}));case 4:case"end":return Sn.stop()}},Lt)}))},"\u53D6\u6D88\u5173\u8054"),(ct==null||((Kt=ct.work_statuses)===null||Kt===void 0)?void 0:Kt.includes("\u5173\u8054\u9879\u76EE"))&&t.a.createElement(v.a,{type:"primary",onClick:function(){var kt,sr;return Object(w.S)("".concat((kt=dr.navigationInfo)===null||kt===void 0||((sr=kt.top)===null||sr===void 0)?void 0:sr.old_url,"/projects/deposit/new"))}},"\u521B\u5EFA\u9879\u76EE"),(ct==null||((Cn=ct.work_statuses)===null||Cn===void 0)?void 0:Cn.includes("\u5173\u8054\u9879\u76EE"))&&t.a.createElement(v.a,{type:"primary",onClick:function(kt){kt.preventDefault(),I.a.confirm({title:"\u5173\u8054\u9879\u76EE",centered:!0,width:600,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:t.a.createElement("div",{className:"tc font14"},"\u60A8\u5F53\u524D\u5C1A\u672A\u7BA1\u7406\u4EFB\u4F55\u9879\u76EE\uFF0C\u8BF7\u5148",t.a.createElement("a",{onClick:function(){var Sn,Mn;Object(w.S)("".concat((Sn=dr.navigationInfo)===null||Sn===void 0||((Mn=Sn.top)===null||Mn===void 0)?void 0:Mn.old_url,"/projects/deposit/new"))}},"\u521B\u5EFA\u9879\u76EE"),"\u518D\u5173\u8054")})}},"\u5173\u8054\u9879\u76EE"),(ct==null||((Zt=ct.work_statuses)===null||Zt===void 0)?void 0:Zt.includes("\u63D0\u4EA4\u4F5C\u54C1"))&&t.a.createElement(v.a,{type:"primary",icon:t.a.createElement("i",{className:"iconfont icon-bianji10"}),style:{width:"119px",height:"36px"},onClick:function(){return Object(w.S)("/classrooms/".concat(ct.course_id,"/common_homework/").concat(ct.homework_id,"/post"))}},"\u63D0\u4EA4\u4F5C\u54C1"),(ct==null||((Nn=ct.work_statuses)===null||Nn===void 0)?void 0:Nn.includes("\u4FEE\u6539\u4F5C\u54C1"))&&t.a.createElement(v.a,{type:"primary",style:{height:"36px"},onClick:function(){return Object(w.S)("/classrooms/".concat(ct.course_id,"/common_homework/").concat(ct.homework_id,"/").concat(ct.id,"/edit"))}},"\u4FEE\u6539\u4F5C\u54C1"),(ct==null||((Vt=ct.work_statuses)===null||Vt===void 0)?void 0:Vt.includes("\u8865\u4EA4\u4F5C\u54C1"))&&t.a.createElement(v.a,{type:"primary",onClick:function(){return Object(w.S)("/classrooms/".concat(ct.course_id,"/common_homework/").concat(ct.homework_id,"/post"))}},"\u8865\u4EA4\u4F5C\u54C1"),(ct==null||((Un=ct.work_statuses)===null||Un===void 0)?void 0:Un.includes("\u8865\u4EA4\u9644\u4EF6"))&&t.a.createElement(v.a,{type:"primary",onClick:function(){Re({type:"classroomList/setActionTabs",payload:{key:"\u8865\u4EA4\u9644\u4EF6",params:$e,selectArrs:Object(f.a)({},ct)}})}},"\u8865\u4EA4\u9644\u4EF6"))};return t.a.createElement("section",{className:On.a.bg},t.a.createElement("div",{className:"edu-container mb30"},ct.homework_name&&t.a.createElement("section",{className:"animated fadeIn"},t.a.createElement("aside",{className:"mt10"},ct.category&&t.a.createElement(G.a,{separator:">"},t.a.createElement(G.a.Item,null,t.a.createElement(i.a,{to:"/classrooms/".concat(ct.course_id,"/common_homework")},ct.course_name)),t.a.createElement(G.a.Item,null,t.a.createElement(i.a,{to:"/classrooms/".concat(ct.course_id,"/common_homework/").concat(((kn=ct.category)===null||kn===void 0?void 0:kn.main)===1?"":ct.category.category_id)},ct.category.category_name)),t.a.createElement(G.a.Item,null,"\u4F5C\u4E1A\u8BE6\u60C5"))),t.a.createElement("aside",{className:[On.a.title,"mt20"].join(" ")},t.a.createElement(i.a,{to:"/classrooms/".concat(ct.course_id,"/common_homework/").concat(((Wn=ct.category)===null||Wn===void 0?void 0:Wn.main)===1?"":ct.category.category_id)},t.a.createElement(D.a,{className:"font16 c-black"})),t.a.createElement("strong",{className:"font20 ml5"},ct.homework_name),t.a.createElement(w.m,{status:ct.homework_status}))),t.a.createElement("aside",{className:"mt30 relative ".concat(On.a.workListTabWrap)},t.a.createElement(V.a,{type:"card",activeKey:it,tabBarExtraContent:At(),onTabClick:function(xn,vn){if(parseInt(xn)===2){if(!(ct!=null&&ct.view_answer)){C.b.info("\u672C\u6B21\u4F5C\u4E1A\u8001\u5E08\u672A\u516C\u5F00\u7B54\u6848");return}(ct==null?void 0:ct.time_status)>2||Object(ge.d)()?Ae(xn):C.b.info("\u622A\u6B62\u4E4B\u540E\u7684\u8BD5\u5377\u624D\u80FD\u67E5\u770B\u7B54\u6848")}else Ae(xn)},className:On.a.tabs},Ut.map(function(on,xn){return t.a.createElement(V.a.TabPane,{tab:on.name,key:on.id},on.component)})))),t.a.createElement(un.a,null),t.a.createElement(An.a,{type:"edit",onCallback:function(){return St()},courseEndTime:ct==null?void 0:ct.course_end_date}),t.a.createElement(Ct.a,{type:"edit",onCallback:function(){return St()},courseEndTime:ct==null?void 0:ct.course_end_date}),t.a.createElement(ti,null),t.a.createElement(nr.a,{ref:ze,hide:!0,name:"".concat(ct==null?void 0:ct.homework_name,"-\u4F5C\u54C1\u9644\u4EF6"),onOk:function(){return vt(!1)}}))},ba=ve.default=Object(a.a)(function(zn){var bn=zn.user,kn=zn.shixunHomeworks,Wn=zn.loading,dr=zn.globalSetting;return{user:bn,shixunHomeworks:kn,globalSetting:dr,loading:Wn.effects}})(Ga)},JYp7:function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return Z});var Z;(function(V){function j(i){return i&&typeof i=="object"&&typeof i[Symbol.iterator]=="function"}V.is=j;const G=Object.freeze([]);function M(){return G}V.empty=M;function*I(i){yield i}V.single=I;function W(i){return i||G}V.from=W;function C(i){return!i||i[Symbol.iterator]().next().done===!0}V.isEmpty=C;function r(i){return i[Symbol.iterator]().next().value}V.first=r;function A(i,D){for(const w of i)if(D(w))return!0;return!1}V.some=A;function v(i,D){for(const w of i)if(D(w))return w;return}V.find=v;function*f(i,D){for(const w of i)D(w)&&(yield w)}V.filter=f;function*p(i,D){let w=0;for(const S of i)yield D(S,w++)}V.map=p;function*l(...i){for(const D of i)for(const w of D)yield w}V.concat=l;function*o(i){for(const D of i)for(const w of D)yield w}V.concatNested=o;function s(i,D,w){let S=w;for(const L of i)S=D(S,L);return S}V.reduce=s;function*t(i,D,w=i.length){for(D<0&&(D+=i.length),w<0?w+=i.length:w>i.length&&(w=i.length);D<w;D++)yield i[D]}V.slice=t;function u(i,D=Number.POSITIVE_INFINITY){const w=[];if(D===0)return[w,i];const S=i[Symbol.iterator]();for(let L=0;L<D;L++){const P=S.next();if(P.done)return[w,V.empty()];w.push(P.value)}return[w,{[Symbol.iterator](){return S}}]}V.consume=u;function a(i,D,w=(S,L)=>S===L){const S=i[Symbol.iterator](),L=D[Symbol.iterator]();for(;;){const P=S.next(),_=L.next();if(P.done!==_.done)return!1;if(P.done)return!0;if(!w(P.value,_.value))return!1}}V.equals=a})(Z||(Z={}))},LdHM:function(Bt,ve,T){"use strict";T.d(ve,"b",function(){return i}),T.d(ve,"a",function(){return w});var Z=T("1OyB"),V=T("vuIU"),j=T("Ji7U"),G=T("LK+K"),M=T("q1tI"),I=T("rePB"),W=T("Ff2n"),C=T("ODXe"),r=T("4IlW"),A=T("bX4T"),v=T("YrtM"),f=T("TSYQ"),p=T.n(f),l=T("+nKL"),o=T("8OUc"),s=function(z,Y){var re=z.prefixCls,le=z.id,Ne=z.flattenOptions,Ce=z.childrenAsData,Te=z.values,Fe=z.searchValue,Ve=z.multiple,xe=z.defaultActiveFirstOption,ye=z.height,oe=z.itemHeight,Se=z.notFoundContent,_e=z.open,He=z.menuItemSelectedIcon,rt=z.virtual,ae=z.onSelect,$=z.onToggleOpen,Q=z.onActiveValue,te=z.onScroll,he=z.onMouseEnter,ge="".concat(re,"-item"),we=Object(v.a)(function(){return Ne},[_e,Ne],function(mt,We){return We[0]&&mt[1]!==We[1]}),ft=M.useRef(null),Pt=function(We){We.preventDefault()},jt=function(We){ft.current&&ft.current.scrollTo({index:We})},qe=function(We){for(var De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Le=we.length,de=0;de<Le;de+=1){var fe=(We+de*De+Le)%Le,Ee=we[fe],Pe=Ee.group,Ue=Ee.data;if(!Pe&&!Ue.disabled)return fe}return-1},Mt=M.useState(function(){return qe(0)}),sn=Object(C.a)(Mt,2),at=sn[0],Qe=sn[1],Et=function(We){Qe(We);var De=we[We];if(!De){Q(null,-1);return}Q(De.data.value,We)};M.useEffect(function(){Et(xe!==!1?qe(0):-1)},[we.length,Fe]),M.useEffect(function(){var mt=setTimeout(function(){if(!Ve&&_e&&Te.size===1){var We=Array.from(Te)[0],De=we.findIndex(function(Le){var de=Le.data;return de.value===We});Et(De),jt(De)}});return function(){return clearTimeout(mt)}},[_e]);var It=function(We){We!==void 0&&ae(We,{selected:!Te.has(We)}),Ve||$(!1)};if(M.useImperativeHandle(Y,function(){return{onKeyDown:function(We){var De=We.which;switch(De){case r.a.UP:case r.a.DOWN:{var Le=0;if(De===r.a.UP?Le=-1:De===r.a.DOWN&&(Le=1),Le!==0){var de=qe(at+Le,Le);jt(de),Et(de)}break}case r.a.ENTER:{var fe=we[at];fe&&!fe.data.disabled?It(fe.data.value):It(void 0),_e&&We.preventDefault();break}case r.a.ESC:$(!1)}},onKeyUp:function(){},scrollTo:function(We){jt(We)}}}),we.length===0)return M.createElement("div",{role:"listbox",id:"".concat(le,"_list"),className:"".concat(ge,"-empty"),onMouseDown:Pt},Se);function dt(mt){var We=we[mt];if(!We)return null;var De=We.data||{},Le=De.value,de=De.label,fe=De.children,Ee=Object(A.a)(De,!0),Pe=Ce?fe:de;return We?M.createElement("div",Object.assign({"aria-label":typeof Pe=="string"?Pe:null},Ee,{key:mt,role:"option",id:"".concat(le,"_list_").concat(mt),"aria-selected":Te.has(Le)}),Le):null}return M.createElement(M.Fragment,null,M.createElement("div",{role:"listbox",id:"".concat(le,"_list"),style:{height:0,width:0,overflow:"hidden"}},dt(at-1),dt(at),dt(at+1)),M.createElement(l.a,{itemKey:"key",ref:ft,data:we,height:ye,itemHeight:oe,fullHeight:!1,onMouseDown:Pt,onScroll:te,virtual:rt,onMouseEnter:he},function(mt,We){var De,Le=mt.group,de=mt.groupOption,fe=mt.data,Ee=fe.label,Pe=fe.key;if(Le)return M.createElement("div",{className:p()(ge,"".concat(ge,"-group"))},Ee!==void 0?Ee:Pe);var Ue=fe.disabled,lt=fe.value,Ot=fe.title,cn=fe.children,An=fe.style,Ct=fe.className,Gt=Object(W.a)(fe,["disabled","value","title","children","style","className"]),xt=Te.has(lt),Rt="".concat(ge,"-option"),gt=p()(ge,Rt,Ct,(De={},Object(I.a)(De,"".concat(Rt,"-grouped"),de),Object(I.a)(De,"".concat(Rt,"-active"),at===We&&!Ue),Object(I.a)(De,"".concat(Rt,"-disabled"),Ue),Object(I.a)(De,"".concat(Rt,"-selected"),xt),De)),be=Ce?cn:Ee,Ie=!He||typeof He=="function"||xt;return M.createElement("div",Object.assign({},Gt,{"aria-selected":xt,className:gt,title:Ot,onMouseMove:function(){if(at===We||Ue)return;Et(We)},onClick:function(){Ue||It(lt)},style:An}),M.createElement("div",{className:"".concat(Rt,"-content")},be||lt),M.isValidElement(He)||xt,Ie&&M.createElement(o.a,{className:"".concat(ge,"-option-state"),customizeIcon:He,customizeIconProps:{isSelected:xt}},xt?"\u2713":null))}))},t=M.forwardRef(s);t.displayName="OptionList";var u=t,a=function(){return null};a.isSelectOption=!0;var i=a,D=function(){return null};D.isSelectOptGroup=!0;var w=D,S=T("VTBJ"),L=T("Zm9Q");function P(d){var z=d.key,Y=d.props,re=Y.children,le=Y.value,Ne=Object(W.a)(Y,["children","value"]);return Object(S.a)({key:z,value:le!==void 0?le:z,children:re},Ne)}function _(d){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(L.a)(d).map(function(Y,re){if(!M.isValidElement(Y)||!Y.type)return null;var le=Y.type.isSelectOptGroup,Ne=Y.key,Ce=Y.props,Te=Ce.children,Fe=Object(W.a)(Ce,["children"]);return z||!le?P(Y):Object(S.a)(Object(S.a)({key:"__RC_SELECT_GRP__".concat(Ne===null?re:Ne,"__"),label:Ne},Fe),{},{options:_(Te)})}).filter(function(Y){return Y})}var b=T("2Qr1"),g=T("qNPg"),m=T("U8pU"),y=T("Kwbf"),x=T("WKfj");function O(d){var z=d.mode,Y=d.options,re=d.children,le=d.backfill,Ne=d.allowClear,Ce=d.placeholder,Te=d.getInputElement,Fe=d.showSearch,Ve=d.onSearch,xe=d.defaultOpen,ye=d.autoFocus,oe=d.labelInValue,Se=d.value,_e=d.inputValue,He=d.optionLabelProp,rt=z==="multiple"||z==="tags",ae=Fe!==void 0?Fe:rt||z==="combobox",$=Y||_(re);if(Object(y.a)(z!=="tags"||$.every(function(ge){return!ge.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),z==="tags"||z==="combobox"){var Q=$.some(function(ge){return ge.options?ge.options.some(function(we){return typeof("value"in we?we.value:we.key)=="number"}):typeof("value"in ge?ge.value:ge.key)=="number"});Object(y.a)(!Q,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(y.a)(z!=="combobox"||!He,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(y.a)(z==="combobox"||!le,"`backfill` only works with `combobox` mode."),Object(y.a)(z==="combobox"||!Te,"`getInputElement` only work with `combobox` mode."),Object(y.b)(z!=="combobox"||!Te||!Ne||!Ce,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ve&&!ae&&z!=="combobox"&&z!=="tags"&&Object(y.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(y.b)(!xe||ye,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Se!=null){var te=Object(x.d)(Se);Object(y.a)(!oe||te.every(function(ge){return Object(m.a)(ge)==="object"&&("key"in ge||"value"in ge)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(y.a)(!rt||Array.isArray(Se),"`value` should be array when `mode` is `multiple` or `tags`")}if(re){var he=null;Object(L.a)(re).some(function(ge){if(!M.isValidElement(ge)||!ge.type)return!1;var we=ge.type;if(we.isSelectOption)return!1;if(we.isSelectOptGroup){var ft=Object(L.a)(ge.props.children).every(function(Pt){return!M.isValidElement(Pt)||!ge.type||Pt.type.isSelectOption?!0:(he=Pt.type,!1)});return!ft}return he=we,!0}),he&&Object(y.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(he.displayName||he.name||he,"`.")),Object(y.a)(_e===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var H=O,F=Object(g.a)({prefixCls:"rc-select",components:{optionList:u},convertChildrenToData:_,flattenOptions:b.d,getLabeledValue:b.e,filterOptions:b.b,isValueDisabled:b.g,findValueOption:b.c,warningProps:H,fillOptionsWithMissingValue:b.a}),R=function(d){Object(j.a)(Y,d);var z=Object(G.a)(Y);function Y(){var re;return Object(Z.a)(this,Y),re=z.apply(this,arguments),re.selectRef=M.createRef(),re.focus=function(){re.selectRef.current.focus()},re.blur=function(){re.selectRef.current.blur()},re}return Object(V.a)(Y,[{key:"render",value:function(){return M.createElement(F,Object.assign({ref:this.selectRef},this.props))}}]),Y}(M.Component);R.Option=i,R.OptGroup=w;var U=R,k=ve.c=U},M8RZ:function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return r});var Z=T("fWQN"),V=T("mtLc"),j=T("yKVA"),G=T("879j"),M=T("q1tI"),I=T.n(M),W=T("i8i4"),C=T.n(W),r=function(A){Object(j.a)(f,A);var v=Object(G.a)(f);function f(p){var l;Object(Z.a)(this,f),l=v.call(this,p);var o=window.document;return l.node=o.createElement("div"),o.body.appendChild(l.node),l}return Object(V.a)(f,[{key:"render",value:function(){var l=this.props.children;return Object(W.createPortal)(l,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),f}(I.a.Component)},MI8n:function(Bt,ve,T){"use strict";T.d(ve,"c",function(){return M}),T.d(ve,"b",function(){return r}),T.d(ve,"e",function(){return A}),T.d(ve,"a",function(){return v}),T.d(ve,"d",function(){return f}),T.d(ve,"f",function(){return p});var Z=T("/cxE"),V=T("pmY6"),j=T("24hK"),G=T("5Y4S"),M;(function(l){l.None=()=>V.a.None;function o(O){return(H,F=null,R)=>{let U=!1,k;return k=O(d=>U?void 0:(k?k.dispose():U=!0,H.call(F,d)),null,R),U&&k.dispose(),k}}l.once=o;function s(O,H){return w((F,R=null,U)=>O(k=>F.call(R,H(k)),null,U))}l.map=s;function t(O,H){return w((F,R=null,U)=>O(k=>{H(k),F.call(R,k)},null,U))}l.forEach=t;function u(O,H){return w((F,R=null,U)=>O(k=>H(k)&&F.call(R,k),null,U))}l.filter=u;function a(O){return O}l.signal=a;function i(...O){return(H,F=null,R)=>Object(V.e)(...O.map(U=>U(k=>H.call(F,k),null,R)))}l.any=i;function D(O,H,F){let R=F;return s(O,U=>(R=H(R,U),R))}l.reduce=D;function w(O){let H;const F=new r({onFirstListenerAdd(){H=O(F.fire,F)},onLastListenerRemove(){H.dispose()}});return F.event}function S(O,H,F=100,R=!1,U){let k,d,z,Y=0;const re=new r({leakWarningThreshold:U,onFirstListenerAdd(){k=O(le=>{Y++,d=H(d,le),R&&!z&&(re.fire(d),d=void 0),clearTimeout(z),z=setTimeout(()=>{const Ne=d;d=void 0,z=void 0,(!R||Y>1)&&re.fire(Ne),Y=0},F)})},onLastListenerRemove(){k.dispose()}});return re.event}l.debounce=S;function L(O,H=(F,R)=>F===R){let F=!0,R;return u(O,U=>{const k=F||!H(U,R);return F=!1,R=U,k})}l.latch=L;function P(O,H){return[l.filter(O,H),l.filter(O,F=>!H(F))]}l.split=P;function _(O,H=!1,F=[]){let R=F.slice(),U=O(z=>{R?R.push(z):d.fire(z)});const k=()=>{R&&R.forEach(z=>d.fire(z)),R=null},d=new r({onFirstListenerAdd(){U||(U=O(z=>d.fire(z)))},onFirstListenerDidAdd(){R&&(H?setTimeout(k):k())},onLastListenerRemove(){U&&U.dispose(),U=null}});return d.event}l.buffer=_;class b{constructor(O){this.event=O}map(O){return new b(s(this.event,O))}forEach(O){return new b(t(this.event,O))}filter(O){return new b(u(this.event,O))}reduce(O,H){return new b(D(this.event,O,H))}latch(){return new b(L(this.event))}debounce(O,H=100,F=!1,R){return new b(S(this.event,O,H,F,R))}on(O,H,F){return this.event(O,H,F)}once(O,H,F){return o(this.event)(O,H,F)}}function g(O){return new b(O)}l.chain=g;function m(O,H,F=R=>R){const R=(...z)=>d.fire(F(...z)),U=()=>O.on(H,R),k=()=>O.removeListener(H,R),d=new r({onFirstListenerAdd:U,onLastListenerRemove:k});return d.event}l.fromNodeEventEmitter=m;function y(O,H,F=R=>R){const R=(...z)=>d.fire(F(...z)),U=()=>O.addEventListener(H,R),k=()=>O.removeEventListener(H,R),d=new r({onFirstListenerAdd:U,onLastListenerRemove:k});return d.event}l.fromDOMEventEmitter=y;function x(O){return new Promise(H=>o(O)(H))}l.toPromise=x})(M||(M={}));class I{constructor(l){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${l}_${I._idPool++}`}start(l){this._stopWatch=new G.a(!0),this._listenerCount=l}stop(){if(this._stopWatch){const l=this._stopWatch.elapsed();this._elapsedOverall+=l,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${l.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}I._idPool=0;let W=-1;class C{constructor(l,o=Math.random().toString(18).slice(2,5)){this.customThreshold=l,this.name=o,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(l){let o=W;if(typeof this.customThreshold=="number"&&(o=this.customThreshold),o<=0||l<o)return;this._stacks||(this._stacks=new Map);const s=new Error().stack.split(`
`).slice(3).join(`
`),t=this._stacks.get(s)||0;if(this._stacks.set(s,t+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=o*.5;let u,a=0;for(const[i,D]of this._stacks)(!u||a<D)&&(u=i,a=D);console.warn(`[${this.name}] potential listener LEAK detected, having ${l} listeners already. MOST frequent listener (${a}):`),console.warn(u)}return()=>{const u=this._stacks.get(s)||0;this._stacks.set(s,u-1)}}}class r{constructor(l){var o;this._disposed=!1,this._options=l,this._leakageMon=W>0?new C(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((o=this._options)===null||o===void 0?void 0:o._profName)?new I(this._options._profName):void 0}get event(){return this._event||(this._event=(l,o,s)=>{var t;this._listeners||(this._listeners=new j.a);const u=this._listeners.isEmpty();u&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const a=this._listeners.push(o?[l,o]:l);u&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,l,o);const i=(t=this._leakageMon)===null||t===void 0?void 0:t.check(this._listeners.size),D=Object(V.i)(()=>{if(i&&i(),!this._disposed&&(a(),this._options&&this._options.onLastListenerRemove)){const w=this._listeners&&!this._listeners.isEmpty();w||this._options.onLastListenerRemove(this)}});return s instanceof V.b?s.add(D):Array.isArray(s)&&s.push(D),D}),this._event}fire(l){var o,s;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new j.a);for(let t of this._listeners)this._deliveryQueue.push([t,l]);for((o=this._perfMon)===null||o===void 0||o.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[t,u]=this._deliveryQueue.shift();try{typeof t=="function"?t.call(void 0,u):t[0].call(t[1],u)}catch(a){Object(Z.f)(a)}}(s=this._perfMon)===null||s===void 0||s.stop()}}dispose(){var l,o,s,t,u;this._disposed||(this._disposed=!0,(l=this._listeners)===null||l===void 0||l.clear(),(o=this._deliveryQueue)===null||o===void 0||o.clear(),(t=(s=this._options)===null||s===void 0?void 0:s.onLastListenerRemove)===null||t===void 0||t.call(s),(u=this._leakageMon)===null||u===void 0||u.dispose())}}class A extends r{constructor(l){super(l);this._isPaused=0,this._eventQueue=new j.a,this._mergeFn=l==null?void 0:l.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const l=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(l))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(l){this._listeners&&(this._isPaused!==0?this._eventQueue.push(l):super.fire(l))}}class v extends A{constructor(l){var o;super(l);this._delay=(o=l.delay)!==null&&o!==void 0?o:100}fire(l){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(l)}}class f{constructor(){this.buffers=[]}wrapEvent(l){return(o,s,t)=>l(u=>{const a=this.buffers[this.buffers.length-1];a?a.push(()=>o.call(s,u)):o.call(s,u)},void 0,t)}bufferEvents(l){const o=[];this.buffers.push(o);const s=l();return this.buffers.pop(),o.forEach(t=>t()),s}}class p{constructor(){this.listening=!1,this.inputEvent=M.None,this.inputEventListener=V.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(l){this.inputEvent=l,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=l(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(Bt,ve,T){"use strict";(function(Z,V){T.d(ve,"b",function(){return s}),T.d(ve,"i",function(){return i}),T.d(ve,"f",function(){return D}),T.d(ve,"d",function(){return w}),T.d(ve,"g",function(){return S}),T.d(ve,"h",function(){return L}),T.d(ve,"c",function(){return P}),T.d(ve,"k",function(){return _}),T.d(ve,"j",function(){return b}),T.d(ve,"a",function(){return g}),T.d(ve,"e",function(){return x});var j;const G="en";let M=!1,I=!1,W=!1,C=!1,r=!1,A=!1,v=!1,f,p=G,l,o;const s=typeof self=="object"?self:typeof Z=="object"?Z:{};let t;typeof s.vscode!="undefined"&&typeof s.vscode.process!="undefined"?t=s.vscode.process:typeof V!="undefined"&&(t=V);const u=typeof((j=t==null?void 0:t.versions)===null||j===void 0?void 0:j.electron)=="string"&&t.type==="renderer";if(typeof navigator=="object"&&!u)o=navigator.userAgent,M=o.indexOf("Windows")>=0,I=o.indexOf("Macintosh")>=0,v=(o.indexOf("Macintosh")>=0||o.indexOf("iPad")>=0||o.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,W=o.indexOf("Linux")>=0,A=!0,f=navigator.language,p=f;else if(typeof t=="object"){M=t.platform==="win32",I=t.platform==="darwin",W=t.platform==="linux",C=W&&!!t.env.SNAP&&!!t.env.SNAP_REVISION,f=G,p=G;const O=t.env.VSCODE_NLS_CONFIG;if(O)try{const H=JSON.parse(O),F=H.availableLanguages["*"];f=H.locale,p=F||G,l=H._translationsConfigFile}catch(H){}r=!0}else console.error("Unable to resolve platform.");let a=0;I?a=1:M?a=3:W&&(a=2);const i=M,D=I,w=W,S=r,L=A,P=v,_=o,b=function(){if(s.setImmediate)return s.setImmediate.bind(s);if(typeof s.postMessage=="function"&&!s.importScripts){let F=[];s.addEventListener("message",U=>{if(U.data&&U.data.vscodeSetImmediateId)for(let k=0,d=F.length;k<d;k++){const z=F[k];if(z.id===U.data.vscodeSetImmediateId){F.splice(k,1),z.callback();return}}});let R=0;return U=>{const k=++R;F.push({id:k,callback:U}),s.postMessage({vscodeSetImmediateId:k},"*")}}if(typeof(t==null?void 0:t.nextTick)=="function")return t.nextTick.bind(t);const H=Promise.resolve();return F=>H.then(F)}(),g=I||v?2:M?1:3;let m=!0,y=!1;function x(){if(!y){y=!0;const O=new Uint8Array(2);O[0]=1,O[1]=2;const H=new Uint16Array(O.buffer);m=H[0]===(2<<8)+1}return m}}).call(this,T("IyRk"),T("Q2Ig"))},N0LK:function(Bt,ve,T){"use strict";T.d(ve,"C",function(){return Z}),T.d(ve,"v",function(){return j}),T.d(ve,"s",function(){return G}),T.d(ve,"t",function(){return M}),T.d(ve,"U",function(){return I}),T.d(ve,"J",function(){return W}),T.d(ve,"O",function(){return C}),T.d(ve,"p",function(){return r}),T.d(ve,"T",function(){return A}),T.d(ve,"q",function(){return v}),T.d(ve,"N",function(){return f}),T.d(ve,"M",function(){return p}),T.d(ve,"Q",function(){return l}),T.d(ve,"u",function(){return o}),T.d(ve,"x",function(){return s}),T.d(ve,"I",function(){return t}),T.d(ve,"f",function(){return u}),T.d(ve,"h",function(){return a}),T.d(ve,"g",function(){return i}),T.d(ve,"i",function(){return D}),T.d(ve,"G",function(){return w}),T.d(ve,"H",function(){return S}),T.d(ve,"r",function(){return L}),T.d(ve,"R",function(){return P}),T.d(ve,"d",function(){return _}),T.d(ve,"e",function(){return b}),T.d(ve,"E",function(){return g}),T.d(ve,"F",function(){return m}),T.d(ve,"j",function(){return y}),T.d(ve,"z",function(){return x}),T.d(ve,"K",function(){return H}),T.d(ve,"L",function(){return F}),T.d(ve,"m",function(){return U}),T.d(ve,"k",function(){return d}),T.d(ve,"A",function(){return Y}),T.d(ve,"a",function(){return re}),T.d(ve,"n",function(){return le}),T.d(ve,"l",function(){return Ne}),T.d(ve,"D",function(){return Ce}),T.d(ve,"B",function(){return Te}),T.d(ve,"b",function(){return Fe}),T.d(ve,"S",function(){return Ve}),T.d(ve,"o",function(){return xe}),T.d(ve,"P",function(){return ye}),T.d(ve,"w",function(){return oe}),T.d(ve,"c",function(){return Se}),T.d(ve,"y",function(){return rt});function Z(te){return!te||typeof te!="string"?!0:te.trim().length===0}const V=/{(\d+)}/g;function j(te,...he){return he.length===0?te:te.replace(V,function(ge,we){const ft=parseInt(we,10);return isNaN(ft)||ft<0||ft>=he.length?ge:he[ft]})}function G(te){return te.replace(/[<>&]/g,function(he){switch(he){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return he}})}function M(te){return te.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function I(te,he=" "){const ge=W(te,he);return C(ge,he)}function W(te,he){if(!te||!he)return te;const ge=he.length;if(ge===0||te.length===0)return te;let we=0;for(;te.indexOf(he,we)===we;)we=we+ge;return te.substring(we)}function C(te,he){if(!te||!he)return te;const ge=he.length,we=te.length;if(ge===0||we===0)return te;let ft=we,Pt=-1;for(;!(Pt=te.lastIndexOf(he,ft-1),Pt===-1||Pt+ge!==ft);){if(Pt===0)return"";ft=Pt}return te.substring(0,ft)}function r(te){return te.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function A(te){return te.replace(/\*/g,"")}function v(te,he,ge={}){if(!te)throw new Error("Cannot create regex from empty string");he||(te=M(te)),ge.wholeWord&&(/\B/.test(te.charAt(0))||(te="\\b"+te),/\B/.test(te.charAt(te.length-1))||(te=te+"\\b"));let we="";return ge.global&&(we+="g"),ge.matchCase||(we+="i"),ge.multiline&&(we+="m"),ge.unicode&&(we+="u"),new RegExp(te,we)}function f(te){if(te.source==="^"||te.source==="^$"||te.source==="$"||te.source==="^\\s*$")return!1;const he=te.exec("");return!!(he&&te.lastIndex===0)}function p(te){return(te.global?"g":"")+(te.ignoreCase?"i":"")+(te.multiline?"m":"")+(te.unicode?"u":"")}function l(te){return te.split(/\r\n|\r|\n/)}function o(te){for(let he=0,ge=te.length;he<ge;he++){const we=te.charCodeAt(he);if(we!==32&&we!==9)return he}return-1}function s(te,he=0,ge=te.length){for(let we=he;we<ge;we++){const ft=te.charCodeAt(we);if(ft!==32&&ft!==9)return te.substring(he,we)}return te.substring(he,ge)}function t(te,he=te.length-1){for(let ge=he;ge>=0;ge--){const we=te.charCodeAt(ge);if(we!==32&&we!==9)return ge}return-1}function u(te,he){return te<he?-1:te>he?1:0}function a(te,he,ge=0,we=te.length,ft=0,Pt=he.length){for(;ge<we&&ft<Pt;ge++,ft++){let Mt=te.charCodeAt(ge),sn=he.charCodeAt(ft);if(Mt<sn)return-1;if(Mt>sn)return 1}const jt=we-ge,qe=Pt-ft;return jt<qe?-1:jt>qe?1:0}function i(te,he){return D(te,he,0,te.length,0,he.length)}function D(te,he,ge=0,we=te.length,ft=0,Pt=he.length){for(;ge<we&&ft<Pt;ge++,ft++){let Mt=te.charCodeAt(ge),sn=he.charCodeAt(ft);if(Mt===sn)continue;if(Mt>=128||sn>=128)return a(te.toLowerCase(),he.toLowerCase(),ge,we,ft,Pt);w(Mt)&&(Mt-=32),w(sn)&&(sn-=32);const at=Mt-sn;if(at===0)continue;return at}const jt=we-ge,qe=Pt-ft;return jt<qe?-1:jt>qe?1:0}function w(te){return te>=97&&te<=122}function S(te){return te>=65&&te<=90}function L(te,he){return te.length===he.length&&D(te,he)===0}function P(te,he){const ge=he.length;return he.length>te.length?!1:D(te,he,0,ge)===0}function _(te,he){let ge,we=Math.min(te.length,he.length);for(ge=0;ge<we;ge++)if(te.charCodeAt(ge)!==he.charCodeAt(ge))return ge;return we}function b(te,he){let ge,we=Math.min(te.length,he.length);const ft=te.length-1,Pt=he.length-1;for(ge=0;ge<we;ge++)if(te.charCodeAt(ft-ge)!==he.charCodeAt(Pt-ge))return ge;return we}function g(te){return 55296<=te&&te<=56319}function m(te){return 56320<=te&&te<=57343}function y(te,he){return(te-55296<<10)+(he-56320)+65536}function x(te,he,ge){const we=te.charCodeAt(ge);if(g(we)&&ge+1<he){const ft=te.charCodeAt(ge+1);if(m(ft))return y(we,ft)}return we}function O(te,he){const ge=te.charCodeAt(he-1);if(m(ge)&&he>1){const we=te.charCodeAt(he-2);if(g(we))return y(we,ge)}return ge}function H(te,he){const ge=_e.getInstance(),we=he,ft=te.length,Pt=x(te,ft,he);he+=Pt>=65536?2:1;let jt=ge.getGraphemeBreakType(Pt);for(;he<ft;){const qe=x(te,ft,he),Mt=ge.getGraphemeBreakType(qe);if(Se(jt,Mt))break;he+=qe>=65536?2:1,jt=Mt}return he-we}function F(te,he){const ge=_e.getInstance(),we=he,ft=O(te,he);he-=ft>=65536?2:1;let Pt=ge.getGraphemeBreakType(ft);for(;he>0;){const jt=O(te,he),qe=ge.getGraphemeBreakType(jt);if(Se(qe,Pt))break;he-=jt>=65536?2:1,Pt=qe}return we-he}const R=/(?:[\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 U(te){return R.test(te)}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 d(te){return k.test(te)}const z=/^[\t\n\r\x20-\x7E]*$/;function Y(te){return z.test(te)}const re=/[\u2028\u2029]/;function le(te){return re.test(te)}function Ne(te){for(let he=0,ge=te.length;he<ge;he++)if(Ce(te.charCodeAt(he)))return!0;return!1}function Ce(te){return te=+te,te>=11904&&te<=55215||te>=63744&&te<=64255||te>=65281&&te<=65374}function Te(te){return te>=127462&&te<=127487||te===8986||te===8987||te===9200||te===9203||te>=9728&&te<=10175||te===11088||te===11093||te>=127744&&te<=128591||te>=128640&&te<=128764||te>=128992&&te<=129003||te>=129280&&te<=129535||te>=129648&&te<=129750}const Fe=String.fromCharCode(65279);function Ve(te){return!!(te&&te.length>0&&te.charCodeAt(0)===65279)}function xe(te,he=!1){return te?(he&&(te=te.replace(/\\./g,"")),te.toLowerCase()!==te):!1}function ye(te){const he=90-65+1;return te=te%(2*he),te<he?String.fromCharCode(97+te):String.fromCharCode(65+te-he)}function oe(te){const he=_e.getInstance();return he.getGraphemeBreakType(te)}function Se(te,he){return te===0?he!==5&&he!==7:te===2&&he===3?!1:te===4||te===2||te===3||(he===4||he===2||he===3)?!0:te===8&&(he===8||he===9||he===11||he===12)||((te===11||te===9)&&(he===9||he===10)||((te===12||te===10)&&he===10||(he===5||he===13||(he===7||(te===1||te===13&&he===14)))))?!1:!(te===6&&he===6)}class _e{constructor(){this._data=He()}static getInstance(){return _e._INSTANCE||(_e._INSTANCE=new _e),_e._INSTANCE}getGraphemeBreakType(te){if(te<32)return te===10?3:te===13?2:4;if(te<127)return 0;const he=this._data,ge=he.length/3;let we=1;for(;we<=ge;)if(te<he[3*we])we=2*we;else if(te>he[3*we+1])we=2*we+1;else return he[3*we+2];return 0}}_e._INSTANCE=null;function He(){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 rt(te,he){if(te===0)return 0;const ge=ae(te,he);if(ge!==void 0)return ge;const we=O(he,te);return te-=$(we),te}function ae(te,he){let ge=O(he,te);for(te-=$(ge);Q(ge)||ge===65039||ge===8419;){if(te===0)return;ge=O(he,te),te-=$(ge)}if(!Te(ge))return;if(te>=0){const we=O(he,te);we===8205&&(te-=$(we))}return te}function $(te){return te>=65536?2:1}function Q(te){return 127995<=te&&te<=127999}},NLgs:function(Bt,ve,T){"use strict";T.d(ve,"e",function(){return t}),T.d(ve,"f",function(){return u}),T.d(ve,"d",function(){return i}),T.d(ve,"c",function(){return D}),T.d(ve,"a",function(){return w}),T.d(ve,"b",function(){return S});var Z=T("miYZ"),V=T("tsqr"),j=T("9og8"),G=T("2qtc"),M=T("kLXV"),I=T("WmNS"),W=T.n(I),C=T("q1tI"),r=T.n(C),A=T("9kvl"),v=T("xKgJ"),f=T("1vsH"),p=T("RCxd"),l=T("yTi+"),o=T.n(l),s=T("m3rI"),t=function(P){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(u(P)&&a(_))},u=function(P){return Object(v.p)()?!0:(P({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},a=function(){var P,_=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,b=Object(A.c)()._store.getState(),g=b.user;return(P=g.userInfo)!==null&&P!==void 0&&P.profile_completed?!0:(M.a.confirm({title:"\u63D0\u793A",width:530,centered:!0,content:_?"\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)},i=function(){var P,_=Object(A.c)()._store.getState(),b=_.user;return(P=b.userInfo)!==null&&P!==void 0&&P.professional_certification?!0:(M.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)},D=function(){var P;if(Object(v.a)())return!0;var _=Object(A.c)()._store.getState(),b=_.user,g=_.globalSetting;return M.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||((P=g.setting)===null||P===void 0)?void 0:P.authority_qrcode_url),width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1},w=function(P,_){var b;if(P)return!0;var g=Object(A.c)()._store.getState(),m=g.user,y=g.globalSetting;return M.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:r.a.createElement("div",null,r.a.createElement("p",null,_||"\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+(y==null||((b=y.setting)===null||b===void 0)?void 0:b.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(P){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",b=Object(A.c)()._store.getState(),g=b.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?(M.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",_,"\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:o.a,alt:"\u4E8C\u7EF4\u7801",width:160})),okText:"\u6211\u77E5\u9053\u4E86"}),!0):(g==null?void 0:g.shixun_status)===2?(M.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",_,"\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(){M.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 y=Object(j.a)(W.a.mark(function O(){var H;return W.a.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return R.next=2,P({type:"shixunsDetail/cancelRelease",payload:{id:g==null?void 0:g.identifier}});case 2:H=R.sent,H.status!==401&&(V.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F\u3002\u5B9E\u8BAD\u56DE\u5230\u672A\u53D1\u5E03\u7684\u72B6\u6001\u3002"),P({type:"shixunsDetail/getShixunsDetail",payload:{id:g==null?void 0:g.identifier}}),P({type:"practiceSetting/getCommonData",payload:{id:g==null?void 0:g.identifier}}));case 4:case"end":return R.stop()}},O)}));function x(){return y.apply(this,arguments)}return x}()})}}),!0):!1}},NNe0:function(Bt,ve,T){Bt.exports={flex_box_center:"flex_box_center___1rG9K",flex_space_between:"flex_space_between___s26wD",flex_box_vertical_center:"flex_box_vertical_center___1Ur8s",flex_box_center_end:"flex_box_center_end___2GQdX",flex_box_column:"flex_box_column___EoDtg",form:"form___1ZYPY",efficiency:"efficiency___2srAz",configWorkContainer:"configWorkContainer___3nRpn"}},NvD2:function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return I});var Z=T("Kwbf");function V(W,C){var r=new Set;return W.forEach(function(A){C.has(A)||r.add(A)}),r}function j(W){var C=W||{},r=C.disabled,A=C.disableCheckbox,v=C.checkable;return!!(r||A)||v===!1}function G(W,C,r,A){for(var v=new Set(W),f=new Set,p=0;p<=r;p+=1){var l=C.get(p)||new Set;l.forEach(function(u){var a=u.key,i=u.node,D=u.children,w=D===void 0?[]:D;v.has(a)&&!A(i)&&w.filter(function(S){return!A(S.node)}).forEach(function(S){v.add(S.key)})})}for(var o=new Set,s=r;s>=0;s-=1){var t=C.get(s)||new Set;t.forEach(function(u){var a=u.parent,i=u.node;if(A(i)||!u.parent||o.has(u.parent.key))return;if(A(u.parent.node)){o.add(a.key);return}var D=!0,w=!1;(a.children||[]).filter(function(S){return!A(S.node)}).forEach(function(S){var L=S.key,P=v.has(L);D&&!P&&(D=!1),!w&&(P||f.has(L))&&(w=!0)}),D&&v.add(a.key),w&&f.add(a.key),o.add(a.key)})}return{checkedKeys:Array.from(v),halfCheckedKeys:Array.from(V(f,v))}}function M(W,C,r,A,v){for(var f=new Set(W),p=new Set(C),l=0;l<=A;l+=1){var o=r.get(l)||new Set;o.forEach(function(a){var i=a.key,D=a.node,w=a.children,S=w===void 0?[]:w;!f.has(i)&&!p.has(i)&&!v(D)&&S.filter(function(L){return!v(L.node)}).forEach(function(L){f.delete(L.key)})})}p=new Set;for(var s=new Set,t=A;t>=0;t-=1){var u=r.get(t)||new Set;u.forEach(function(a){var i=a.parent,D=a.node;if(v(D)||!a.parent||s.has(a.parent.key))return;if(v(a.parent.node)){s.add(i.key);return}var w=!0,S=!1;(i.children||[]).filter(function(L){return!v(L.node)}).forEach(function(L){var P=L.key,_=f.has(P);w&&!_&&(w=!1),!S&&(_||p.has(P))&&(S=!0)}),w||f.delete(i.key),S&&p.add(i.key),s.add(i.key)})}return{checkedKeys:Array.from(f),halfCheckedKeys:Array.from(V(p,f))}}function I(W,C,r,A){var v=[],f;A?f=A:f=j;var p=new Set(W.filter(function(t){var u=!!r[t];return u||v.push(t),u})),l=new Map,o=0;Object.keys(r).forEach(function(t){var u=r[t],a=u.level,i=l.get(a);i||(i=new Set,l.set(a,i)),i.add(u),o=Math.max(o,a)}),Object(Z.a)(!v.length,"Tree missing follow keys: ".concat(v.slice(0,100).map(function(t){return"'".concat(t,"'")}).join(", ")));var s;return C===!0?s=G(p,l,o,f):s=M(p,C.halfCheckedKeys,l,o,f),s}},OLES:function(Bt,ve,T){"use strict";var Z=T("U8pU"),V=T("VTBJ"),j=T("Ff2n"),G=T("q1tI"),M=T("uciX"),I=T("7ixt"),W=function(p){var l=p.overlay,o=p.prefixCls,s=p.id,t=p.overlayInnerStyle;return G.createElement("div",{className:"".concat(o,"-inner"),id:s,role:"tooltip",style:t},typeof l=="function"?l():l)},C=W,r=function(p,l){var o=p.overlayClassName,s=p.trigger,t=s===void 0?["hover"]:s,u=p.mouseEnterDelay,a=u===void 0?0:u,i=p.mouseLeaveDelay,D=i===void 0?.1:i,w=p.overlayStyle,S=p.prefixCls,L=S===void 0?"rc-tooltip":S,P=p.children,_=p.onVisibleChange,b=p.afterVisibleChange,g=p.transitionName,m=p.animation,y=p.placement,x=y===void 0?"right":y,O=p.align,H=O===void 0?{}:O,F=p.destroyTooltipOnHide,R=F===void 0?!1:F,U=p.defaultVisible,k=p.getTooltipContainer,d=p.overlayInnerStyle,z=Object(j.a)(p,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),Y=Object(G.useRef)(null);Object(G.useImperativeHandle)(l,function(){return Y.current});var re=Object(V.a)({},z);"visible"in p&&(re.popupVisible=p.visible);var le=function(){var Ve=p.arrowContent,xe=Ve===void 0?null:Ve,ye=p.overlay,oe=p.id;return[G.createElement("div",{className:"".concat(L,"-arrow"),key:"arrow"},xe),G.createElement(C,{key:"content",prefixCls:L,id:oe,overlay:ye,overlayInnerStyle:d})]},Ne=!1,Ce=!1;if(typeof R=="boolean")Ne=R;else if(R&&Object(Z.a)(R)==="object"){var Te=R.keepParent;Ne=Te===!0,Ce=Te===!1}return G.createElement(M.a,Object.assign({popupClassName:o,prefixCls:L,popup:le,action:t,builtinPlacements:I.a,popupPlacement:x,ref:Y,popupAlign:H,getPopupContainer:k,onPopupVisibleChange:_,afterPopupVisibleChange:b,popupTransitionName:g,popupAnimation:m,defaultPopupVisible:U,destroyPopupOnHide:Ne,autoDestroy:Ce,mouseLeaveDelay:D,popupStyle:w,mouseEnterDelay:a},re),P)},A=Object(G.forwardRef)(r),v=ve.a=A},OZM5:function(Bt,ve,T){"use strict";T.d(ve,"b",function(){return A}),T.d(ve,"a",function(){return v}),T.d(ve,"k",function(){return f}),T.d(ve,"h",function(){return p}),T.d(ve,"i",function(){return l}),T.d(ve,"g",function(){return o}),T.d(ve,"c",function(){return s}),T.d(ve,"d",function(){return t}),T.d(ve,"j",function(){return i}),T.d(ve,"e",function(){return D}),T.d(ve,"f",function(){return w});var Z=T("KQm4"),V=T("U8pU"),j=T("Ff2n"),G=T("q1tI"),M=T.n(G),I=T("Kwbf"),W=T("WaYH"),C=.25,r=2;function A(S,L){var P=S.slice(),_=P.indexOf(L);return _>=0&&P.splice(_,1),P}function v(S,L){var P=S.slice();return P.indexOf(L)===-1&&P.push(L),P}function f(S){return S.split("-")}function p(S,L){return"".concat(S,"-").concat(L)}function l(S){return S&&S.type&&S.type.isTreeNode}function o(S,L){var P=[S],_=L[S];function b(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];g.forEach(function(m){var y=m.key,x=m.children;P.push(y),b(x)})}return b(_.children),P}function s(S,L){var P=S.clientY,_=L.selectHandle.getBoundingClientRect(),b=_.top,g=_.bottom,m=_.height,y=Math.max(m*C,r);return P<=b+y?-1:P>=g-y?1:0}function t(S,L){if(!S)return;var P=L.multiple;return P?S.slice():S.length?[S[0]]:S}var u=function(L){return L};function a(S,L){if(!S)return[];var P=L||{},_=P.processProps,b=_===void 0?u:_,g=Array.isArray(S)?S:[S];return g.map(function(m){var y=m.children,x=Object(j.a)(m,["children"]),O=a(y,L);return M.a.createElement(W.a,Object.assign({},b(x)),O)})}function i(S){if(!S)return null;var L;if(Array.isArray(S))L={checkedKeys:S,halfCheckedKeys:void 0};else if(Object(V.a)(S)==="object")L={checkedKeys:S.checked||void 0,halfCheckedKeys:S.halfChecked||void 0};else return Object(I.a)(!1,"`checkedKeys` is not an array or an object"),null;return L}function D(S,L){var P=new Set;function _(b){if(P.has(b))return;var g=L[b];if(!g)return;P.add(b);var m=g.parent,y=g.node;if(y.disabled)return;m&&_(m.key)}return(S||[]).forEach(function(b){_(b)}),Object(Z.a)(P)}function w(S){var L={};return Object.keys(S).forEach(function(P){(P.startsWith("data-")||P.startsWith("aria-"))&&(L[P]=S[P])}),L}},Ot1p:function(Bt,ve,T){"use strict";var Z=T("2qtc"),V=T("kLXV"),j=T("rAM+"),G=T("miYZ"),M=T("tsqr"),I=T("9og8"),W=T("tJVT"),C=T("jrin"),r=T("WmNS"),A=T.n(r),v=T("q1tI"),f=T.n(v),p=T("VrN/"),l=T.n(p),o=T("bdgK"),s=T("p77/"),t=T("Bd2K"),u=T("ELLl"),a=T("19Vz"),i=T("lZu9"),D=T("+NIl"),w=T("kSUc"),S=T("9Bee"),L=function(Ue){var lt=Ue.value,Ot=lt===void 0?"":lt,cn=Ue.className,An=Ue.showTextOnly,Ct=Ue.showLines,Gt=Ue.style,xt=Gt===void 0?{}:Gt,Rt=Object(v.useMemo)(function(){return""},[Ot]);return f.a.createElement(f.a.Fragment,null,f.a.createElement("div",{dangerouslySetInnerHTML:{__html:Rt}}))},P=T("0Owb"),_=T("dejd"),b=T("C+DQ"),g=T("1vsH"),m=T("m3rI"),y=[{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 x(Ue){var lt=Ue.onActionCallback,Ot=Ue.title,cn=Ue.icon,An=Ue.actionName,Ct=Ue.className,Gt=Ct===void 0?"":Ct,xt=Ue.children;function Rt(){lt(An)}return f.a.createElement("a",{title:Ot,className:Gt,onClick:Rt},f.a.createElement("i",{className:"md-iconfont ".concat(cn)}),xt)}var O=function(Ue){var lt=Ue.watch,Ot=Ue.showNullButton,cn=Ue.onActionCallback,An=Ue.fullScreen,Ct=Ue.insertTemp,Gt=Ue.hidetoolBar,xt=Ue.uuid,Rt=Ue.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(xt,"&api=").concat(encodeURIComponent(m.a.PROXY_SERVER)));var gt=[].concat(y,[{title:"".concat(lt?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(lt?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return f.a.createElement("ul",{className:"markdown-toolbar-container"},!Gt&&gt.map(function(be,Ie){return f.a.createElement("li",{key:Ie},be.actionName?f.a.createElement(x,Object(P.a)({},be,{onActionCallback:cn})):f.a.createElement("span",{className:"v-line"}))}),Ot?f.a.createElement("li",null,f.a.createElement(x,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:cn},f.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Ct&&f.a.createElement("li",null,f.a.createElement(x,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Ct),onActionCallback:cn},f.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),f.a.createElement("li",{className:"btn-full-screen"},f.a.createElement(x,{icon:"".concat(An?"icon-shrink":"icon-enlarge"),title:An?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:cn})))},H=T("M8RZ"),F=T("+L6B"),R=T("2/Rp"),U=T("y8nQ"),k=T("Vl3Y"),d=T("5NDa"),z=T("5rEg"),Y={labelCol:{span:4},wrapperCol:{span:20}},re=function(Ue){var lt=Ue.callback,Ot=Ue.onCancel;function cn(An){lt(An)}return f.a.createElement(k.a,Object(P.a)({},Y,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:cn}),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(z.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(z.a,null)),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(R.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(R.a,{type:"ghost",onClick:Ot},"\u53D6\u6D88")))},le=T("7ahc"),Ne=T("HmJG"),Ce=T("BjJ7"),Te=k.a.useForm,Fe={width:280,marginRight:10},Ve={labelCol:{span:5},wrapperCol:{span:19}},xe=function(Ue){var lt=Ue.callback,Ot=Ue.onCancel,cn=Te(),An=Object(W.a)(cn,1),Ct=An[0];function Gt(gt){lt(gt)}function xt(gt,be){if(gt.status===-1){M.b.error(gt.message);return}Ct.setFieldsValue({src:"/api/attachments/".concat(gt.id),type:be.type})}function Rt(gt){var be=gt.target.files[0];oe(be,xt)}return f.a.createElement(k.a,Object(P.a)({form:Ct},Ve,{className:"upload-image-panel",onFinish:Gt}),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(z.a,{style:Fe})),f.a.createElement(ye,{onFileChange:Rt}))),f.a.createElement(k.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},f.a.createElement(z.a,{style:{width:264}})),f.a.createElement(k.a.Item,{style:{textAlign:"right"}},f.a.createElement(R.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(R.a,{type:"ghost",onClick:Ot},"\u53D6\u6D88")))};function ye(Ue){var lt=Ue.onFileChange;return f.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",f.a.createElement("input",{type:"file",onChange:lt}))}function oe(Ue,lt){if(!Ue)throw new String("\u6CA1\u6709\u6587\u4EF6");var Ot=new FormData;Ot.append("editormd-image-file",Ue),Ot.append("file_param_name","editormd-image-file"),Ot.append("byxhr","true");var cn=new window.XMLHttpRequest;cn.withCredentials=!0,cn.addEventListener("load",function(An){lt(JSON.parse(An.target.responseText),Ue)},!1),cn.addEventListener("error",function(An){console.error(An)},!1),cn.open("POST","".concat(Ce.a,"/api/attachments.json")),cn.send(Ot)}var Se=T("giR+"),_e=T("fyUT"),He=T("7Kak"),rt=T("9yH6"),ae=rt.a.Group,$={margin:"0 8px"},Q=function(Ue){var lt=Ue.callback,Ot=Ue.onCancel;function cn(An){lt(An)}return f.a.createElement(k.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:cn},f.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},f.a.createElement("span",{style:$},"\u5355\u5143\u683C\u6570\uFF1A"),f.a.createElement("span",{style:$},"\u884C\u6570"),f.a.createElement(k.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},f.a.createElement(_e.a,null)),f.a.createElement("span",{style:$},"\u5217\u6570"),f.a.createElement(k.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},f.a.createElement(_e.a,null))),f.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},f.a.createElement("span",{style:$},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),f.a.createElement(k.a.Item,{name:"align"},f.a.createElement(ae,null,f.a.createElement(rt.a,{value:"default"},f.a.createElement("i",{className:"fa fa-align-justify"})),f.a.createElement(rt.a,{value:"left"},f.a.createElement("i",{className:"fa fa-align-left"})),f.a.createElement(rt.a,{value:"center"},f.a.createElement("i",{className:"fa fa-align-center"})),f.a.createElement(rt.a,{value:"right"},f.a.createElement("i",{className:"fa fa-align-right"}))))),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(R.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(R.a,{type:"ghost",onClick:Ot},"\u53D6\u6D88")))},te=T("ErOA"),he=T("7Cbv"),ge="link",we="upload-image",ft="code-block",Pt="add-table",jt="------------",qe={default:jt,left:":".concat(jt),center:":".concat(jt,":"),right:"".concat(jt,":")},Mt=T("9VGf"),sn,at;function Qe(){}var Et=0,It=1e4,dt="\u2581",mt=`
**\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 We(Ue){return/^\d+$/.test(Ue)?"".concat(Ue,"px"):Ue}var De=navigator.platform.toUpperCase().indexOf("MAC")>=0,Le=De?"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"],fe=(sn={},Object(C.a)(sn,Le+"-B","bold"),Object(C.a)(sn,Le+"-I","italic"),sn),Ee=(at={},Object(C.a)(at,ge,"\u6DFB\u52A0\u94FE\u63A5"),Object(C.a)(at,ft,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(C.a)(at,we,"\u6DFB\u52A0\u6587\u4EF6"),Object(C.a)(at,Pt,"\u6DFB\u52A0\u8868\u683C"),at),Pe=ve.a=function(Ue){var lt=Ue.defaultValue,Ot=lt===void 0?"":lt,cn=Ue.onChange,An=Ue.width,Ct=An===void 0?"100%":An,Gt=Ue.height,xt=Gt===void 0?400:Gt,Rt=Ue.miniToolbar,gt=Rt===void 0?!1:Rt,be=Ue.isFocus,Ie=be===void 0?!1:be,Dt=Ue.watch,ht=Ue.insertTemp,nn=Ue.mode,qt=nn===void 0?"markdown":nn,Ke=Ue.id,st=Ke===void 0?"markdown-editor-id":Ke,bt=Ue.showResizeBar,Ft=bt===void 0?!1:bt,$t=Ue.noStorage,gn=$t===void 0?!1:$t,er=Ue.showNullButton,Hn=er===void 0?!1:er,yn=Ue.hidetoolBar,Sr=yn===void 0?!1:yn,_r=Ue.fullScreen,ar=_r===void 0?!1:_r,cr=Ue.onBlur,Pr=Ue.onCMBeforeChange,Qr=Ue.onFullScreen,ca=Ue.className,hn=ca===void 0?"":ca,ir=Ue.disablePaste,va=ir===void 0?!1:ir,Pa=Ue.placeholder,sa=Pa===void 0?"":Pa,la=Ue.values,ee=la===void 0?"":la,N=Object(v.useState)(null),B=Object(W.a)(N,2),X=B[0],ue=B[1],q=Object(v.useState)(Ot),Ze=Object(W.a)(q,2),Jt=Ze[0],On=Ze[1],Xn=Object(v.useState)(Dt),un=Object(W.a)(Xn,2),nr=un[0],mr=un[1],Kr=Object(v.useState)(ar),ma=Object(W.a)(Kr,2),da=ma[0],Zr=ma[1],za=Object(v.useState)(""),oi=Object(W.a)(za,2),ua=oi[0],Na=oi[1],ti=Object(v.useState)(0),Ga=Object(W.a)(ti,2),ba=Ga[0],zn=Ga[1],bn=Object(v.useState)(xt),kn=Object(W.a)(bn,2),Wn=kn[0],dr=kn[1],ne=Object(v.useState)(!1),Re=Object(W.a)(ne,2),$e=Re[0],Be=Re[1],Ye=Object(v.useRef)(Object(he.a)()),et=Object(v.useRef)(!1),it=Object(v.useRef)(),Ae=Object(v.useRef)(),ze=Object(v.useRef)(),yt=Object(v.useRef)(),en=Object(v.useRef)(),Tt=function(){var Kt=Object(I.a)(A.a.mark(function Cn(){var Zt,Nn;return A.a.wrap(function(Un){for(;;)switch(Un.prev=Un.next){case 0:return Un.next=2,Object(te.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Ye.current}});case 2:Nn=Un.sent,Nn!=null&&(Zt=Nn.attachments)!==null&&Zt!==void 0&&Zt.length&&(console.log("cm:",X,Ae),Nn.attachments.map(function(Lt){Lt.content_type.indexOf("image")>-1?X.replaceSelection("![,](/api/attachments/".concat(Lt.id,"?type=").concat(Lt.content_type,")")):Lt.content_type.indexOf("video")>-1?X.replaceSelection('<video width="100%" controls src="'.concat(m.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Lt.content_type.indexOf("pdf")>-1?X.replaceSelection('<a href="'.concat(m.a.API_SERVER,"/api/attachments/").concat(Lt.id,"?type=").concat(Lt.content_type,'&disposition=inline" target="_blank">').concat(Lt.name,"</a>")):X.replaceSelection("[".concat(Lt.name,"](").concat(m.a.API_SERVER,"/api/attachments/").concat(Lt.id,"?type=").concat(Lt.content_type,")"))}));case 4:case"end":return Un.stop()}},Cn)}));return function(){return Kt.apply(this,arguments)}}();Object(v.useEffect)(function(){On(ee),X==null||X.setValue(ee)},[ee]),Object(v.useEffect)(function(){Qr==null||Qr(da)},[da]),Object(v.useEffect)(function(){if(Ae.current){var Kt=l.a.fromTextArea(Ae.current,{mode:qt,lineNumbers:!gt,lineWrapping:!0,value:Ot,autoCloseTags:!0,autoCloseBrackets:!0});Ie&&Kt.focus();function Cn(Zt,Nn){if(va){Nn.preventDefault();return}var Vt=Nn.clipboardData;if(Vt){var Un=Vt.types.toString(),Lt=Vt.items;if(Un==="Files"||Vt.types.indexOf("Files")>-1){if(Nn.preventDefault(),qt=="stex")return;try{var kt,sr=Lt[1];((kt=Lt[0])===null||kt===void 0?void 0:kt.kind)==="file"&&(sr=Lt[0]);var Sn=sr.getAsFile(),Mn=Sn.name.split(".").pop();oe(Sn,function(wn){if(wn.id){var an,Yt,Gn;(Sn==null||((an=Sn.type)===null||an===void 0)?void 0:an.indexOf("image"))>-1?Kt.replaceSelection("![,](/api/attachments/".concat(wn.id,"?type=").concat(wn.content_type,")")):(Sn==null||((Yt=Sn.type)===null||Yt===void 0)?void 0:Yt.indexOf("video"))>-1?Kt.replaceSelection('<video width="100%" controls src="'.concat(m.a.API_SERVER,"/api/attachments/").concat(wn.id,'"></video>')):(Sn==null||((Gn=Sn.type)===null||Gn===void 0)?void 0:Gn.indexOf("pdf"))>-1?Kt.replaceSelection('<a href="'.concat(m.a.API_SERVER,"/api/attachments/").concat(wn.id,"?type=").concat(Sn.type,'&disposition=inline" target="_blank">').concat(Sn.name,"</a>")):de.includes(Mn)?Kt.replaceSelection('<a href="'.concat(m.a.API_SERVER,"/api/attachments/").concat(wn.id,'?type=office&disposition=inline" target="_blank">').concat(Sn.name,"</a>")):Kt.replaceSelection("[".concat(Sn.name,"](").concat(m.a.API_SERVER,"/api/attachments/").concat(wn.id,"?type=").concat(wn.content_type,")"))}else(wn==null?void 0:wn.status)===401&&(document.location.href="/user/login")})}catch(wn){M.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Kt.on("paste",Cn),Kt.on("dragleave",function(Zt,Nn){ze.current.classList.remove("mouse-hover-md")}),Kt.on("dragover",function(Zt,Nn){ze.current.classList.add("mouse-hover-md")}),Kt.on("drop",function(Zt,Nn){ze.current.classList.add("mouse-hover-md");var Vt;if(Vt=Nn.dataTransfer.files,Vt.length>0){Nn.preventDefault(),Nn.stopPropagation();for(var Un=function(sr){var Sn=Vt[sr],Mn=Sn.name.split(".").pop();oe(Sn,function(wn){if(wn.id){var an,Yt,Gn;(Sn==null||((an=Sn.type)===null||an===void 0)?void 0:an.indexOf("image"))>-1?Kt.replaceSelection("![,](/api/attachments/".concat(wn.id,"?type=").concat(wn.content_type,")")):(Sn==null||((Yt=Sn.type)===null||Yt===void 0)?void 0:Yt.indexOf("video"))>-1?Kt.replaceSelection('<video width="100%" controls src="'.concat(m.a.API_SERVER,"/api/attachments/").concat(wn.id,'"></video>')):(Sn==null||((Gn=Sn.type)===null||Gn===void 0)?void 0:Gn.indexOf("pdf"))>-1?Kt.replaceSelection('<a href="'.concat(m.a.API_SERVER,"/api/attachments/").concat(wn.id,"?type=").concat(Sn.type,'&disposition=inline" target="_blank">').concat(Sn.name,"</a>")):de.includes(Mn)?Kt.replaceSelection('<a href="'.concat(m.a.API_SERVER,"/api/attachments/").concat(wn.id,'?type=office&disposition=inline" target="_blank">').concat(Sn.name,"</a>")):Kt.replaceSelection("[".concat(Sn.name,"](").concat(m.a.API_SERVER,"/api/attachments/").concat(wn.id,"?type=").concat(wn.content_type,")"))}else(wn==null?void 0:wn.status)===401&&(document.location.href="/user/login")})},Lt=0;Lt<Vt.length;Lt++)Un(Lt)}}),ue(Kt),function(){Kt.off("paste",Cn)}}},[]);var vt=Object(v.useCallback)(function(){if(ze.current)try{}catch(Kt){console.log(Kt,"---- to set md editor body height")}},[Wn,ze,da]);Object(v.useEffect)(function(){function Kt(){var Zt=new o.default(function(Nn){var Vt=Object(j.a)(Nn),Un;try{for(Vt.s();!(Un=Vt.n()).done;){var Lt=Un.value;(Lt.target.offsetHeight>0||Lt.target.offsetWidth>0)&&(vt(),X.setSize("100%","100%"),X.refresh())}}catch(kt){Vt.e(kt)}finally{Vt.f()}});return Zt.observe(Ae.current.parentElement),Zt}if(X){var Cn=Kt();return function(){Cn.unobserve(Ae.current.parentElement)}}},[X,vt]),Object(v.useEffect)(function(){if(X){for(var Kt=[],Cn=function(){var Lt=Nn[Zt];Vt=Object(W.a)(Lt,2);var kt=Vt[0],sr=Vt[1],Sn=Object(C.a)({},kt,function(){ct(sr)});Kt.push(Sn),X.addKeyMap(Sn)},Zt=0,Nn=Object.entries(fe);Zt<Nn.length;Zt++){var Vt;Cn()}return it.current=setInterval(function(){et.current&&Tt()},4e3),function(){clearInterval(it.current);var Un=Object(j.a)(Kt),Lt;try{for(Un.s();!(Lt=Un.n()).done;){var kt=Lt.value;X.removeKeyMap(kt)}}catch(sr){Un.e(sr)}finally{Un.f()}}}},[X]),Object(v.useEffect)(function(){ar!==da&&Zr(ar)},[ar]),Object(Mt.a)(function(){if(!gn&&ba>0){var Kt=new Date().getTime(),Cn=window.sessionStorage.getItem(st);Kt>=ba+It&&(!Cn||Cn!==Jt)&&(window.sessionStorage.setItem(st,Jt),Be(!0))}},It),Object(v.useEffect)(function(){mr(Dt)},[X,Dt]),Object(v.useEffect)(function(){X&&(Ie&&X.focus())},[X,Ie]),Object(v.useEffect)(function(){if(nr&&X){var Kt=X.getScrollerElement();function Cn(Zt){var Nn=Zt.target;if(en.current){var Vt=Nn.scrollTop/Nn.scrollHeight;en.current.scrollTop=en.current.scrollHeight*Vt}}return Kt.addEventListener("scroll",Cn),function(){Kt.removeEventListener("scroll",Cn)}}},[X,nr]),Object(v.useEffect)(function(){if(X&&Pr){function Kt(Cn,Zt){Pr(Cn,Zt)}return X.on("beforeChange",Kt),function(){X.off("beforeChange",Kt)}}},[X,Pr]),Object(v.useEffect)(function(){if(X&&cr){function Kt(){cr(X.getValue())}return X.on("blur",Kt),function(){X.off("blur",Kt)}}},[X,cr]),Object(v.useEffect)(function(){if(X){function Kt(Cn){var Zt=Cn.getValue();On(Zt),zn(new Date().getTime()),Cn.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),cn&&cn(Zt)}return X.on("change",Kt),function(){X.off("change",Kt)}}},[X,cn]),Object(v.useEffect)(function(){X&&(Ot==null?(X.setValue(""),On("")):Ot!==X.getValue()&&(X.setValue(Ot),On(Ot),X.setCursor(X.lineCount(),0)))},[X,Ot]);var ct=Object(v.useCallback)(function(Kt){var Cn=X.getCursor(),Zt=X.getSelection(),Nn=Zt.split(`
`);switch(Kt){case"bold":return X.replaceSelection("**"+Zt+"**"),Zt===""&&X.setCursor(Cn.line,Cn.ch+2),X.focus();case"italic":return X.replaceSelection("*"+Zt+"*"),Zt===""&&X.setCursor(Cn.line,Cn.ch+1),X.focus();case"code":return X.replaceSelection("`"+Zt+"`"),Zt===""&&X.setCursor(Cn.line,Cn.ch+1),X.focus();case"inline-latex":return X.replaceSelection("`$$"+Zt+"$$`"),Zt===""&&X.setCursor(Cn.line,Cn.ch+3),X.focus();case"latex":return X.replaceSelection("```latex\n"+Zt+"\n```"),X.setCursor(Cn.line+1,Zt.length+1),X.focus();case"line-break":return X.replaceSelection(`<br/>
`),X.focus();case"list-ul":return Zt===""?X.replaceSelection("- "+Zt):X.replaceSelection(Nn.map(function(Vt){return Vt===""?"":"- ".concat(Vt)}).join(`
`)),X.focus();case"list-ol":return Zt===""?X.replaceSelection("1. "+Zt):X.replaceSelection(Nn.map(function(Vt,Un){return Vt===""?"":"".concat(Un+1,". ").concat(Vt)}).join(`
`)),X.focus();case"add-null-ch":return Zt===""&&X.setCursor(Cn.line,Cn.ch+1),X.replaceSelection(dt),X.focus();case"inster-template-1":return Zt===""&&X.setCursor(Cn.line,Cn.ch),X.replaceSelection(mt),X.focus();case"eraser":return X.setValue(""),X.focus();case"trigger-watch":return mr(!nr),X.focus();case"trigger-full-screen":return Zr(!da),X.focus();case ge:Na(ge);return;case ft:Na(ft);return;case we:Na(we);return;case Pt:Na(Pt);return;default:throw new Error}},[X,nr,da]),St=Object(v.useCallback)(function(Kt){Na("");switch(ua){case ge:var Cn=Kt.title,Zt=Kt.link;return X.replaceSelection("[".concat(Cn,"](").concat(Zt,")")),X.focus();case ft:var Nn=Kt.language,Vt=Kt.content;return X.replaceSelection(["```"+Nn,Vt,"```"].join(`
`)),X.focus();case we:var Un=Kt.src,Lt=Kt.alt;return Lt?X.replaceSelection("![ ".concat(Lt," ]( ").concat(Un,' "').concat(Lt,'" )')):X.replaceSelection("![,](".concat(Un,")")),X.focus();case Pt:for(var kt=Kt.row,sr=Kt.col,Sn=Kt.align,Mn=`
`,wn=0;wn<kt;wn++){for(var an=[],Yt=[],Gn=0;Gn<sr;Gn++)wn===1&&Yt.push(qe[Sn]),an.push(" ");wn===1&&(Mn+="| ".concat(Yt.join(" | "),` |
`)),Mn+="| ".concat(an.join(sr===1?"":" | "),` |
`)}return X.replaceSelection(Mn+`
`),X.focus();default:throw new Error}},[X,ua]),Ut=Object(v.useMemo)(function(){switch(ua){case ge:return f.a.createElement(re,{callback:St,onCancel:At});case ft:return f.a.createElement(le.b,{callback:St,onCancel:At});case we:return f.a.createElement(xe,{callback:St,onCancel:At});case Pt:return f.a.createElement(Q,{callback:St,onCancel:At});default:return null}},[ua]);function At(){Na("")}Object(v.useEffect)(function(){if(yt.current){var Kt=yt.current,Cn=!1,Zt=0;function Nn(Lt){Cn=!0,Zt=Lt.pageY}function Vt(){Cn=!1}function Un(Lt){if(Cn){var kt=Lt.pageY-Zt;kt<0&&(kt=0),kt>300&&(kt=300);var sr=xt+kt+"px";dr(sr)}}return Kt.addEventListener("mousedown",Nn),document.addEventListener("mousemove",Un),document.addEventListener("mouseup",Vt),function(){Kt.removeEventListener("mousedown",Nn),document.removeEventListener("mousemove",Un),document.removeEventListener("mouseup",Vt)}}},[X,yt]),Object(v.useEffect)(function(){dr(xt)},[xt]);var on=We(Ct),xn=We(Wn),vn={width:on,height:xn},Qt=Object(v.useMemo)(function(){if(ba){var Kt=new Date(ba),Cn=Kt.getHours(),Zt=Kt.getMinutes(),Nn=Kt.getSeconds();return Cn=Cn<10?"0"+Cn:Cn,Zt=Zt<10?"0"+Zt:Zt,Nn=Nn<10?"0"+Nn:Nn,"".concat(Cn,":").concat(Zt,":").concat(Nn)}return 0},[ba]);function Dn(){window.sessionStorage.removeItem(st),Be(!1),zn(0)}function Rn(){Be(!1),zn(0),X.setValue(window.sessionStorage.getItem(st))}function zt(Kt,Cn){var Zt=X.getValue();Zt=Zt.replace(Kt,Cn),On(Zt),X==null||X.setValue(Zt)}return f.a.createElement(v.Fragment,null,f.a.createElement("div",{className:"markdown-editor-wrapper",ref:ze},f.a.createElement("div",{className:"markdown-editor-container ".concat(hn," ").concat(nr?"on-preview":""," ").concat(gt?"mini":""," ").concat(da?"full-screen":""),style:vn},f.a.createElement(O,{insertTemp:ht,watch:nr,fullScreen:da,showNullButton:Hn,onActionCallback:ct,hidetoolBar:Sr,uuid:Ye.current,setOpenPhones:function(){et.current=!0}}),f.a.createElement("div",{className:"markdown-editor-body"},f.a.createElement("div",{className:"codemirror-container"},f.a.createElement("textarea",{ref:Ae,placeholder:sa})),nr?f.a.createElement("div",{ref:en,className:"preview-container"},qt==="stex"&&f.a.createElement(L,{value:Jt}),qt!=="stex"&&f.a.createElement(S.a,{edit:!0,value:Jt,replaces:zt})):null))),Ft?f.a.createElement("a",{ref:yt,className:"editor-resize"}):null,f.a.createElement(H.a,null,Ee[ua]?f.a.createElement(V.a,{centered:!0,title:Ee[ua],visible:!0,onCancel:At,footer:null,className:"markdown-popup-form"},Ut):null))}},"SA+Z":function(Bt,ve,T){var Z=T("wTVA"),V=T("EbDI"),j=T("ZhPi"),G=T("wkBT");function M(I){return Z(I)||V(I)||j(I)||G()}Bt.exports=M,Bt.exports.__esModule=!0,Bt.exports.default=Bt.exports},SJMd:function(Bt,ve){/**
* @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 T,Z,V,j=!1,G,M;window.PR_SHOULD_USE_CONTINUATION=!0;var I,W;(function(){var C=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"],v=[A,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],f=[v,"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=[v,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],l=[v,"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"],o="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=[v,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],t="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",u=[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"],a=[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"],i=[r,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],D=[f,l,p,s,t,u,a,i],w=/^(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",L="kwd",P="com",_="typ",b="lit",g="pun",m="pln",y="tag",x="dec",O="src",H="atn",F="atv",R="nocode",U="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(ae){for(var $=0,Q=!1,te=!1,he=0,ge=ae.length;he<ge;++he){var we=ae[he];if(we.ignoreCase)te=!0;else if(/[a-z]/i.test(we.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Q=!0,te=!1;break}}var ft={b:8,t:9,n:10,v:11,f:12,r:13};function Pt(at){var Qe=at.charCodeAt(0);if(Qe!==92)return Qe;var Et=at.charAt(1);return Qe=ft[Et],Qe||("0"<=Et&&Et<="7"?parseInt(at.substring(1),8):Et==="u"||Et==="x"?parseInt(at.substring(2),16):at.charCodeAt(1))}function jt(at){if(at<32)return(at<16?"\\x0":"\\x")+at.toString(16);var Qe=String.fromCharCode(at);return Qe==="\\"||Qe==="-"||Qe==="]"||Qe==="^"?"\\"+Qe:Qe}function qe(at){var Qe=at.substring(1,at.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),Et=[],It=Qe[0]==="^",dt=["["];It&&dt.push("^");for(var mt=It?1:0,We=Qe.length;mt<We;++mt){var De=Qe[mt];if(/\\[bdsw]/i.test(De))dt.push(De);else{var Le=Pt(De),de;mt+2<We&&Qe[mt+1]==="-"?(de=Pt(Qe[mt+2]),mt+=2):de=Le,Et.push([Le,de]),de<65||Le>122||(de<65||Le>90||Et.push([Math.max(65,Le)|32,Math.min(de,90)|32]),de<97||Le>122||Et.push([Math.max(97,Le)&~32,Math.min(de,122)&~32]))}}Et.sort(function(Ue,lt){return Ue[0]-lt[0]||lt[1]-Ue[1]});for(var fe=[],Ee=[],mt=0;mt<Et.length;++mt){var Pe=Et[mt];Pe[0]<=Ee[1]+1?Ee[1]=Math.max(Ee[1],Pe[1]):fe.push(Ee=Pe)}for(var mt=0;mt<fe.length;++mt){var Pe=fe[mt];dt.push(jt(Pe[0])),Pe[1]>Pe[0]&&(Pe[1]+1>Pe[0]&&dt.push("-"),dt.push(jt(Pe[1])))}return dt.push("]"),dt.join("")}function Mt(at){for(var Qe=at.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),Et=Qe.length,It=[],dt=0,mt=0;dt<Et;++dt){var We=Qe[dt];if(We==="(")++mt;else if(We.charAt(0)==="\\"){var De=+We.substring(1);De&&(De<=mt?It[De]=-1:Qe[dt]=jt(De))}}for(var dt=1;dt<It.length;++dt)It[dt]===-1&&(It[dt]=++$);for(var dt=0,mt=0;dt<Et;++dt){var We=Qe[dt];if(We==="(")++mt,It[mt]||(Qe[dt]="(?:");else if(We.charAt(0)==="\\"){var De=+We.substring(1);De&&De<=mt&&(Qe[dt]="\\"+It[De])}}for(var dt=0;dt<Et;++dt)Qe[dt]==="^"&&Qe[dt+1]!=="^"&&(Qe[dt]="");if(at.ignoreCase&&Q)for(var dt=0;dt<Et;++dt){var We=Qe[dt],Le=We.charAt(0);We.length>=2&&Le==="["?Qe[dt]=qe(We):Le!=="\\"&&(Qe[dt]=We.replace(/[a-zA-Z]/g,function(Ee){var Pe=Ee.charCodeAt(0);return"["+String.fromCharCode(Pe&~32,Pe|32)+"]"}))}return Qe.join("")}for(var sn=[],he=0,ge=ae.length;he<ge;++he){var we=ae[he];if(we.global||we.multiline)throw new Error(""+we);sn.push("(?:"+Mt(we)+")")}return new RegExp(sn.join("|"),te?"gi":"g")}function d(ae,$){var Q=/(?:^|\s)nocode(?:\s|$)/,te=[],he=0,ge=[],we=0;function ft(Pt){var jt=Pt.nodeType;if(jt==1){if(Q.test(Pt.className))return;for(var qe=Pt.firstChild;qe;qe=qe.nextSibling)ft(qe);var Mt=Pt.nodeName.toLowerCase();(Mt==="br"||Mt==="li")&&(te[we]=`
`,ge[we<<1]=he++,ge[we++<<1|1]=Pt)}else if(jt==3||jt==4){var sn=Pt.nodeValue;sn.length&&($?sn=sn.replace(/\r\n?/g,`
`):sn=sn.replace(/[ \t\r\n]+/g," "),te[we]=sn,ge[we<<1]=he,he+=sn.length,ge[we++<<1|1]=Pt)}}return ft(ae),{sourceCode:te.join("").replace(/\n$/,""),spans:ge}}function z(ae,$,Q,te,he){if(!Q)return;var ge={sourceNode:ae,pre:1,langExtension:null,numberLines:null,sourceCode:Q,spans:null,basePos:$,decorations:null};te(ge),he.push.apply(he,ge.decorations)}var Y=/\S/;function re(ae){for(var $=void 0,Q=ae.firstChild;Q;Q=Q.nextSibling){var te=Q.nodeType;$=te===1?$?ae:Q:te===3&&Y.test(Q.nodeValue)?ae:$}return $===ae?void 0:$}function le(ae,$){var Q={},te;(function(){for(var we=ae.concat($),ft=[],Pt={},jt=0,qe=we.length;jt<qe;++jt){var Mt=we[jt],sn=Mt[3];if(sn)for(var at=sn.length;--at>=0;)Q[sn.charAt(at)]=Mt;var Qe=Mt[1],Et=""+Qe;Pt.hasOwnProperty(Et)||(ft.push(Qe),Pt[Et]=null)}ft.push(/[\0-\uffff]/),te=k(ft)})();var he=$.length,ge=function(we){for(var ft=we.sourceCode,Pt=we.basePos,jt=we.sourceNode,qe=[Pt,m],Mt=0,sn=ft.match(te)||[],at={},Qe=0,Et=sn.length;Qe<Et;++Qe){var It=sn[Qe],dt=at[It],mt=void 0,We;if(typeof dt=="string")We=!1;else{var De=Q[It.charAt(0)];if(De)mt=It.match(De[1]),dt=De[0];else{for(var Le=0;Le<he;++Le)if(De=$[Le],mt=It.match(De[1]),mt){dt=De[0];break}mt||(dt=m)}We=dt.length>=5&&dt.substring(0,5)==="lang-",We&&!(mt&&typeof mt[1]=="string")&&(We=!1,dt=O),We||(at[It]=dt)}var de=Mt;if(Mt+=It.length,!We)qe.push(Pt+de,dt);else{var fe=mt[1],Ee=It.indexOf(fe),Pe=Ee+fe.length;mt[2]&&(Pe=It.length-mt[2].length,Ee=Pe-fe.length);var Ue=dt.substring(5);z(jt,Pt+de,It.substring(0,Ee),ge,qe),z(jt,Pt+de+Ee,fe,ye(Ue,fe),qe),z(jt,Pt+de+Pe,It.substring(Pe),ge,qe)}}we.decorations=qe};return ge}function Ne(ae){var $=[],Q=[];ae.tripleQuotedStrings?$.push([S,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ae.multiLineStrings?$.push([S,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):$.push([S,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ae.verbatimStrings&&Q.push([S,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var te=ae.hashComments;te&&(ae.cStyleComments?(te>1?$.push([P,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):$.push([P,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Q.push([S,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):$.push([P,/^#[^\r\n]*/,null,"#"])),ae.cStyleComments&&(Q.push([P,/^\/\/[^\r\n]*/,null]),Q.push([P,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var he=ae.regexLiterals;if(he){var ge=he>1?"":`
\r`,we=ge?".":"[\\S\\s]",ft="/(?=[^/*"+ge+"])(?:[^/\\x5B\\x5C"+ge+"]|\\x5C"+we+"|\\x5B(?:[^\\x5C\\x5D"+ge+"]|\\x5C"+we+")*(?:\\x5D|$))+/";Q.push(["lang-regex",RegExp("^"+U+"("+ft+")")])}var Pt=ae.types;Pt&&Q.push([_,Pt]);var jt=(""+ae.keywords).replace(/^ | $/g,"");jt.length&&Q.push([L,new RegExp("^(?:"+jt.replace(/[\s,]+/g,"|")+")\\b"),null]),$.push([m,/^\s+/,null,` \r
\xA0`]);var qe="^.[^\\s\\w.$@'\"`/\\\\]*";return ae.regexLiterals&&(qe+="(?!s*/)"),Q.push([b,/^@[a-z_$][a-z_$@0-9]*/i,null],[_,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[m,/^[a-z_$][a-z_$@0-9]*/i,null],[b,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[m,/^\\[\s\S]?/,null],[g,new RegExp(qe),null]),le($,Q)}var Ce=Ne({keywords:D,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Te(ae,$,Q){for(var te=/(?:^|\s)nocode(?:\s|$)/,he=/\r\n?|\n/,ge=ae.ownerDocument,we=ge.createElement("li");ae.firstChild;)we.appendChild(ae.firstChild);var ft=[we];function Pt(Qe){var Et=Qe.nodeType;if(Et==1&&!te.test(Qe.className))if(Qe.nodeName==="br")jt(Qe),Qe.parentNode&&Qe.parentNode.removeChild(Qe);else for(var It=Qe.firstChild;It;It=It.nextSibling)Pt(It);else if((Et==3||Et==4)&&Q){var dt=Qe.nodeValue,mt=dt.match(he);if(mt){var We=dt.substring(0,mt.index);Qe.nodeValue=We;var De=dt.substring(mt.index+mt[0].length);if(De){var Le=Qe.parentNode;Le.insertBefore(ge.createTextNode(De),Qe.nextSibling)}jt(Qe),We||Qe.parentNode.removeChild(Qe)}}}function jt(Qe){for(;!Qe.nextSibling;)if(Qe=Qe.parentNode,!Qe)return;function Et(mt,We){var De=We?mt.cloneNode(!1):mt,Le=mt.parentNode;if(Le){var de=Et(Le,1),fe=mt.nextSibling;de.appendChild(De);for(var Ee=fe;Ee;Ee=fe)fe=Ee.nextSibling,de.appendChild(Ee)}return De}for(var It=Et(Qe.nextSibling,0),dt;(dt=It.parentNode)&&dt.nodeType===1;)It=dt;ft.push(It)}for(var qe=0;qe<ft.length;++qe)Pt(ft[qe]);$===($|0)&&ft[0].setAttribute("value",$);var Mt=ge.createElement("ol");Mt.className="linenums";for(var sn=Math.max(0,$-1|0)||0,qe=0,at=ft.length;qe<at;++qe)we=ft[qe],we.className="L"+(qe+sn)%10,we.firstChild||we.appendChild(ge.createTextNode("\xA0")),Mt.appendChild(we);ae.appendChild(Mt)}function Fe(ae){var $=/\bMSIE\s(\d+)/.exec(navigator.userAgent);$=$&&+$[1]<=8;var Q=/\n/g,te=ae.sourceCode,he=te.length,ge=0,we=ae.spans,ft=we.length,Pt=0,jt=ae.decorations,qe=jt.length,Mt=0;jt[qe]=he;var sn,at;for(at=sn=0;at<qe;)jt[at]!==jt[at+2]?(jt[sn++]=jt[at++],jt[sn++]=jt[at++]):at+=2;for(qe=sn,at=sn=0;at<qe;){for(var Qe=jt[at],Et=jt[at+1],It=at+2;It+2<=qe&&jt[It+1]===Et;)It+=2;jt[sn++]=Qe,jt[sn++]=Et,at=It}qe=jt.length=sn;var dt=ae.sourceNode,mt="";dt&&(mt=dt.style.display,dt.style.display="none");try{for(var We=null;Pt<ft;){var De=we[Pt],Le=we[Pt+2]||he,de=jt[Mt+2]||he,It=Math.min(Le,de),fe=we[Pt+1],Ee;if(fe.nodeType!==1&&(Ee=te.substring(ge,It))){$&&(Ee=Ee.replace(Q,"\r")),fe.nodeValue=Ee;var Pe=fe.ownerDocument,Ue=Pe.createElement("span");Ue.className=jt[Mt+1];var lt=fe.parentNode;lt.replaceChild(Ue,fe),Ue.appendChild(fe),ge<Le&&(we[Pt+1]=fe=Pe.createTextNode(te.substring(It,Le)),lt.insertBefore(fe,Ue.nextSibling))}ge=It,ge>=Le&&(Pt+=2),ge>=de&&(Mt+=2)}}finally{dt&&(dt.style.display=mt)}}var Ve={};function xe(ae,$){for(var Q=$.length;--Q>=0;){var te=$[Q];Ve.hasOwnProperty(te)?C.console&&console.warn("cannot override language handler %s",te):Ve[te]=ae}}function ye(ae,$){return ae&&Ve.hasOwnProperty(ae)||(ae=/^\s*</.test($)?"default-markup":"default-code"),Ve[ae]}xe(Ce,["default-code"]),xe(le([],[[m,/^[^<?]+/],[x,/^<!\w[^>]*(?:>|$)/],[P,/^<\!--[\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"]),xe(le([[m,/^[\s]+/,null,` \r
`],[F,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[y,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[H,/^(?!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"]),xe(le([],[[F,/^[\s\S]+/]]),["uq.val"]),xe(Ne({keywords:f,hashComments:!0,cStyleComments:!0,types:w}),["c","cc","cpp","cxx","cyc","m"]),xe(Ne({keywords:"null,true,false"}),["json"]),xe(Ne({keywords:l,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:w}),["cs"]),xe(Ne({keywords:p,cStyleComments:!0}),["java"]),xe(Ne({keywords:i,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),xe(Ne({keywords:u,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),xe(Ne({keywords:t,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),xe(Ne({keywords:a,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),xe(Ne({keywords:s,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),xe(Ne({keywords:o,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),xe(le([],[[S,/^[\s\S]+/]]),["regex"]);function oe(ae){var $=ae.langExtension;try{var Q=d(ae.sourceNode,ae.pre),te=Q.sourceCode;ae.sourceCode=te,ae.spans=Q.spans,ae.basePos=0,ye($,te)(ae),Fe(ae)}catch(he){C.console&&console.log(he&&he.stack||he)}}function Se(ae,$,Q){var te=Q||!1,he=$||null,ge=document.createElement("div");ge.innerHTML="<pre>"+ae+"</pre>",ge=ge.firstChild,te&&Te(ge,te,!0);var we={langExtension:he,numberLines:te,sourceNode:ge,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return oe(we),ge.innerHTML}function _e(ae,$){var Q=$||document.body,te=Q.ownerDocument||document;function he(De){return Q.getElementsByTagName(De)}for(var ge=[he("pre"),he("code"),he("xmp")],we=[],ft=0;ft<ge.length;++ft)for(var Pt=0,jt=ge[ft].length;Pt<jt;++Pt)we.push(ge[ft][Pt]);ge=null;var qe=Date;qe.now||(qe={now:function(){return+new Date}});var Mt=0,sn=/\blang(?:uage)?-([\w.]+)(?!\S)/,at=/\bprettyprint\b/,Qe=/\bprettyprinted\b/,Et=/pre|xmp/i,It=/^code$/i,dt=/^(?:pre|code|xmp)$/i,mt={};function We(){for(var De=C.PR_SHOULD_USE_CONTINUATION?qe.now()+250:Infinity;Mt<we.length&&qe.now()<De;Mt++){for(var Le=we[Mt],de=mt,fe=Le;fe=fe.previousSibling;){var Ee=fe.nodeType,Pe=(Ee===7||Ee===8)&&fe.nodeValue;if(Pe?!/^\??prettify\b/.test(Pe):Ee!==3||/\S/.test(fe.nodeValue))break;if(Pe){de={},Pe.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Dt,ht,nn){de[ht]=nn});break}}var Ue=Le.className;if((de!==mt||at.test(Ue))&&!Qe.test(Ue)){for(var lt=!1,Ot=Le.parentNode;Ot;Ot=Ot.parentNode){var cn=Ot.tagName;if(dt.test(cn)&&Ot.className&&at.test(Ot.className)){lt=!0;break}}if(!lt){Le.className+=" prettyprinted";var An=de.lang;if(!An){An=Ue.match(sn);var Ct;!An&&(Ct=re(Le))&&It.test(Ct.tagName)&&(An=Ct.className.match(sn)),An&&(An=An[1])}var Gt;if(Et.test(Le.tagName))Gt=1;else{var xt=Le.currentStyle,Rt=te.defaultView,gt=xt?xt.whiteSpace:Rt&&Rt.getComputedStyle?Rt.getComputedStyle(Le,null).getPropertyValue("white-space"):0;Gt=gt&&gt.substring(0,3)==="pre"}var be=de.linenums;(be=be==="true"||+be)||(be=Ue.match(/\blinenums\b(?::(\d+))?/),be=be?be[1]&&be[1].length?+be[1]:!0:!1),be&&Te(Le,be,Gt);var Ie={langExtension:An,sourceNode:Le,numberLines:be,pre:Gt,sourceCode:null,basePos:null,spans:null,decorations:null};oe(Ie)}}}Mt<we.length?C.setTimeout(We,250):typeof ae=="function"&&ae()}We()}var He=C.PR={createSimpleLexer:le,registerLangHandler:xe,sourceDecorator:Ne,PR_ATTRIB_NAME:H,PR_ATTRIB_VALUE:F,PR_COMMENT:P,PR_DECLARATION:x,PR_KEYWORD:L,PR_LITERAL:b,PR_NOCODE:R,PR_PLAIN:m,PR_PUNCTUATION:g,PR_SOURCE:O,PR_STRING:S,PR_TAG:y,PR_TYPE:_,prettyPrintOne:j?C.prettyPrintOne=Se:I=Se,prettyPrint:W=j?C.prettyPrint=_e:W=_e},rt=C.define;typeof rt=="function"&&rt.amd&&rt("google-code-prettify",[],function(){return He})})()},T8No:function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return W}),T.d(ve,"e",function(){return C}),T.d(ve,"c",function(){return g}),T.d(ve,"b",function(){return m}),T.d(ve,"d",function(){return y}),T.d(ve,"f",function(){return H});var Z=T("MNsG"),V=T("N0LK"),j=T("Cg/j");let G=Z.k||"";const M=new Map;M.set("false",!1),M.set("true",!0),M.set("isMac",Z.f),M.set("isLinux",Z.d),M.set("isWindows",Z.i),M.set("isWeb",Z.h),M.set("isMacNative",Z.f&&!Z.h),M.set("isEdge",G.indexOf("Edg/")>=0),M.set("isFirefox",G.indexOf("Firefox")>=0),M.set("isChrome",G.indexOf("Chrome")>=0),M.set("isSafari",G.indexOf("Safari")>=0);const I=Object.prototype.hasOwnProperty;class W{static has(R){return f.create(R)}static equals(R,U){return p.create(R,U)}static regex(R,U){return S.create(R,U)}static not(R){return t.create(R)}static and(...R){return _.create(R,null)}static or(...R){return b.create(R,null,!0)}static deserialize(R,U=!1){return R?this._deserializeOrExpression(R,U):void 0}static _deserializeOrExpression(R,U){let k=R.split("||");return b.create(k.map(d=>this._deserializeAndExpression(d,U)),null,!0)}static _deserializeAndExpression(R,U){let k=R.split("&&");return _.create(k.map(d=>this._deserializeOne(d,U)),null)}static _deserializeOne(R,U){if(R=R.trim(),R.indexOf("!=")>=0){let k=R.split("!=");return s.create(k[0].trim(),this._deserializeValue(k[1],U))}if(R.indexOf("==")>=0){let k=R.split("==");return p.create(k[0].trim(),this._deserializeValue(k[1],U))}if(R.indexOf("=~")>=0){let k=R.split("=~");return S.create(k[0].trim(),this._deserializeRegexValue(k[1],U))}if(R.indexOf(" in ")>=0){let k=R.split(" in ");return l.create(k[0].trim(),k[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(R)){const k=R.split(">=");return i.create(k[0].trim(),k[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(R)){const k=R.split(">");return a.create(k[0].trim(),k[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(R)){const k=R.split("<=");return w.create(k[0].trim(),k[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(R)){const k=R.split("<");return D.create(k[0].trim(),k[1].trim())}return/^\!\s*/.test(R)?t.create(R.substr(1).trim()):f.create(R)}static _deserializeValue(R,U){if(R=R.trim(),R==="true")return!0;if(R==="false")return!1;let k=/^'([^']*)'$/.exec(R);return k?k[1].trim():R}static _deserializeRegexValue(R,U){if(Object(V.C)(R)){if(U)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let k=R.indexOf("/"),d=R.lastIndexOf("/");if(k===d||k<0){if(U)throw new Error(`bad regexp-value '${R}', missing /-enclosure`);return console.warn(`bad regexp-value '${R}', missing /-enclosure`),null}let z=R.slice(k+1,d),Y=R[d+1]==="i"?"i":"";try{return new RegExp(z,Y)}catch(re){if(U)throw new Error(`bad regexp-value '${R}', parse error: ${re}`);return console.warn(`bad regexp-value '${R}', parse error: ${re}`),null}}}function C(R,U){const k=R?R.substituteConstants():void 0,d=U?U.substituteConstants():void 0;return!k&&!d?!0:!k||!d?!1:k.equals(d)}function r(R,U){return R.cmp(U)}class A{constructor(){this.type=0}cmp(R){return this.type-R.type}equals(R){return R.type===this.type}substituteConstants(){return this}evaluate(R){return!1}serialize(){return"false"}keys(){return[]}negate(){return v.INSTANCE}}A.INSTANCE=new A;class v{constructor(){this.type=1}cmp(R){return this.type-R.type}equals(R){return R.type===this.type}substituteConstants(){return this}evaluate(R){return!0}serialize(){return"true"}keys(){return[]}negate(){return A.INSTANCE}}v.INSTANCE=new v;class f{constructor(R,U){this.key=R,this.negated=U,this.type=2}static create(R,U=null){const k=M.get(R);return typeof k=="boolean"?k?v.INSTANCE:A.INSTANCE:new f(R,U)}cmp(R){return R.type!==this.type?this.type-R.type:x(this.key,R.key)}equals(R){return R.type===this.type?this.key===R.key:!1}substituteConstants(){const R=M.get(this.key);return typeof R=="boolean"?R?v.INSTANCE:A.INSTANCE:this}evaluate(R){return!!R.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=t.create(this.key,this)),this.negated}}class p{constructor(R,U,k){this.key=R,this.value=U,this.negated=k,this.type=4}static create(R,U,k=null){if(typeof U=="boolean")return U?f.create(R,k):t.create(R,k);const d=M.get(R);if(typeof d=="boolean"){const z=d?"true":"false";return U===z?v.INSTANCE:A.INSTANCE}return new p(R,U,k)}cmp(R){return R.type!==this.type?this.type-R.type:O(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){const R=M.get(this.key);if(typeof R=="boolean"){const U=R?"true":"false";return this.value===U?v.INSTANCE:A.INSTANCE}return this}evaluate(R){return R.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 l{constructor(R,U){this.key=R,this.valueKey=U,this.type=10,this.negated=null}static create(R,U){return new l(R,U)}cmp(R){return R.type!==this.type?this.type-R.type:O(this.key,this.valueKey,R.key,R.valueKey)}equals(R){return R.type===this.type?this.key===R.key&&this.valueKey===R.valueKey:!1}substituteConstants(){return this}evaluate(R){const U=R.getValue(this.valueKey),k=R.getValue(this.key);return Array.isArray(U)?U.indexOf(k)>=0:typeof k=="string"&&typeof U=="object"&&U!==null?I.call(U,k):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=o.create(this)),this.negated}}class o{constructor(R){this._actual=R,this.type=11}static create(R){return new o(R)}cmp(R){return R.type!==this.type?this.type-R.type:this._actual.cmp(R._actual)}equals(R){return R.type===this.type?this._actual.equals(R._actual):!1}substituteConstants(){return this}evaluate(R){return!this._actual.evaluate(R)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class s{constructor(R,U,k){this.key=R,this.value=U,this.negated=k,this.type=5}static create(R,U,k=null){if(typeof U=="boolean")return U?t.create(R,k):f.create(R,k);const d=M.get(R);if(typeof d=="boolean"){const z=d?"true":"false";return U===z?A.INSTANCE:v.INSTANCE}return new s(R,U,k)}cmp(R){return R.type!==this.type?this.type-R.type:O(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){const R=M.get(this.key);if(typeof R=="boolean"){const U=R?"true":"false";return this.value===U?A.INSTANCE:v.INSTANCE}return this}evaluate(R){return R.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 t{constructor(R,U){this.key=R,this.negated=U,this.type=3}static create(R,U=null){const k=M.get(R);return typeof k=="boolean"?k?A.INSTANCE:v.INSTANCE:new t(R,U)}cmp(R){return R.type!==this.type?this.type-R.type:x(this.key,R.key)}equals(R){return R.type===this.type?this.key===R.key:!1}substituteConstants(){const R=M.get(this.key);return typeof R=="boolean"?R?A.INSTANCE:v.INSTANCE:this}evaluate(R){return!R.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 u(R,U){if(typeof R=="string"){const k=parseFloat(R);isNaN(k)||(R=k)}return typeof R=="string"||typeof R=="number"?U(R):A.INSTANCE}class a{constructor(R,U,k){this.key=R,this.value=U,this.negated=k,this.type=12}static create(R,U,k=null){return u(U,d=>new a(R,d,k))}cmp(R){return R.type!==this.type?this.type-R.type:O(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=w.create(this.key,this.value,this)),this.negated}}class i{constructor(R,U,k){this.key=R,this.value=U,this.negated=k,this.type=13}static create(R,U,k=null){return u(U,d=>new i(R,d,k))}cmp(R){return R.type!==this.type?this.type-R.type:O(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=D.create(this.key,this.value,this)),this.negated}}class D{constructor(R,U,k){this.key=R,this.value=U,this.negated=k,this.type=14}static create(R,U,k=null){return u(U,d=>new D(R,d,k))}cmp(R){return R.type!==this.type?this.type-R.type:O(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=i.create(this.key,this.value,this)),this.negated}}class w{constructor(R,U,k){this.key=R,this.value=U,this.negated=k,this.type=15}static create(R,U,k=null){return u(U,d=>new w(R,d,k))}cmp(R){return R.type!==this.type?this.type-R.type:O(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=a.create(this.key,this.value,this)),this.negated}}class S{constructor(R,U){this.key=R,this.regexp=U,this.type=7,this.negated=null}static create(R,U){return new S(R,U)}cmp(R){if(R.type!==this.type)return this.type-R.type;if(this.key<R.key)return-1;if(this.key>R.key)return 1;const U=this.regexp?this.regexp.source:"",k=R.regexp?R.regexp.source:"";return U<k?-1:U>k?1:0}equals(R){if(R.type===this.type){const U=this.regexp?this.regexp.source:"",k=R.regexp?R.regexp.source:"";return this.key===R.key&&U===k}return!1}substituteConstants(){return this}evaluate(R){let U=R.getValue(this.key);return this.regexp?this.regexp.test(U):!1}serialize(){const R=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${R}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=L.create(this)),this.negated}}class L{constructor(R){this._actual=R,this.type=8}static create(R){return new L(R)}cmp(R){return R.type!==this.type?this.type-R.type:this._actual.cmp(R._actual)}equals(R){return R.type===this.type?this._actual.equals(R._actual):!1}substituteConstants(){return this}evaluate(R){return!this._actual.evaluate(R)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function P(R){let U=null;for(let k=0,d=R.length;k<d;k++){const z=R[k].substituteConstants();if(R[k]!==z&&U===null){U=[];for(let Y=0;Y<k;Y++)U[Y]=R[Y]}U!==null&&(U[k]=z)}return U===null?R:U}class _{constructor(R,U){this.expr=R,this.negated=U,this.type=6}static create(R,U){return _._normalizeArr(R,U)}cmp(R){if(R.type!==this.type)return this.type-R.type;if(this.expr.length<R.expr.length)return-1;if(this.expr.length>R.expr.length)return 1;for(let U=0,k=this.expr.length;U<k;U++){const d=r(this.expr[U],R.expr[U]);if(d!==0)return d}return 0}equals(R){if(R.type===this.type){if(this.expr.length!==R.expr.length)return!1;for(let U=0,k=this.expr.length;U<k;U++)if(!this.expr[U].equals(R.expr[U]))return!1;return!0}return!1}substituteConstants(){const R=P(this.expr);return R===this.expr?this:_.create(R,this.negated)}evaluate(R){for(let U=0,k=this.expr.length;U<k;U++)if(!this.expr[U].evaluate(R))return!1;return!0}static _normalizeArr(R,U){const k=[];let d=!1;for(const z of R){if(!z)continue;if(z.type===1){d=!0;continue}if(z.type===0)return A.INSTANCE;if(z.type===6){k.push(...z.expr);continue}k.push(z)}if(k.length===0&&d)return v.INSTANCE;if(k.length===0)return;if(k.length===1)return k[0];k.sort(r);for(let z=1;z<k.length;z++)k[z-1].equals(k[z])&&(k.splice(z,1),z--);if(k.length===1)return k[0];for(;k.length>1;){const z=k[k.length-1];if(z.type!==9)break;k.pop();const Y=k.pop(),re=k.length===0,le=b.create(z.expr.map(Ne=>_.create([Ne,Y],null)),null,re);le&&(k.push(le),k.sort(r))}return k.length===1?k[0]:new _(k,U)}serialize(){return this.expr.map(R=>R.serialize()).join(" && ")}keys(){const R=[];for(let U of this.expr)R.push(...U.keys());return R}negate(){if(!this.negated){const R=[];for(let U of this.expr)R.push(U.negate());this.negated=b.create(R,this,!0)}return this.negated}}class b{constructor(R,U){this.expr=R,this.negated=U,this.type=9}static create(R,U,k){return b._normalizeArr(R,U,k)}cmp(R){if(R.type!==this.type)return this.type-R.type;if(this.expr.length<R.expr.length)return-1;if(this.expr.length>R.expr.length)return 1;for(let U=0,k=this.expr.length;U<k;U++){const d=r(this.expr[U],R.expr[U]);if(d!==0)return d}return 0}equals(R){if(R.type===this.type){if(this.expr.length!==R.expr.length)return!1;for(let U=0,k=this.expr.length;U<k;U++)if(!this.expr[U].equals(R.expr[U]))return!1;return!0}return!1}substituteConstants(){const R=P(this.expr);return R===this.expr?this:b.create(R,this.negated,!1)}evaluate(R){for(let U=0,k=this.expr.length;U<k;U++)if(this.expr[U].evaluate(R))return!0;return!1}static _normalizeArr(R,U,k){let d=[],z=!1;if(R){for(let Y=0,re=R.length;Y<re;Y++){const le=R[Y];if(!le)continue;if(le.type===0){z=!0;continue}if(le.type===1)return v.INSTANCE;if(le.type===9){d=d.concat(le.expr);continue}d.push(le)}if(d.length===0&&z)return A.INSTANCE;d.sort(r)}if(d.length===0)return;if(d.length===1)return d[0];for(let Y=1;Y<d.length;Y++)d[Y-1].equals(d[Y])&&(d.splice(Y,1),Y--);if(d.length===1)return d[0];if(k){for(let Y=0;Y<d.length;Y++)for(let re=Y+1;re<d.length;re++)H(d[Y],d[re])&&(d.splice(re,1),re--);if(d.length===1)return d[0]}return new b(d,U)}serialize(){return this.expr.map(R=>R.serialize()).join(" || ")}keys(){const R=[];for(let U of this.expr)R.push(...U.keys());return R}negate(){if(!this.negated){let R=[];for(let U of this.expr)R.push(U.negate());for(;R.length>1;){const U=R.shift(),k=R.shift(),d=[];for(const Y of F(U))for(const re of F(k))d.push(_.create([Y,re],null));const z=R.length===0;R.unshift(b.create(d,null,z))}this.negated=R[0]}return this.negated}}class g extends f{constructor(R,U,k){super(R,null);this._defaultValue=U,typeof k=="object"?g._info.push(Object.assign(Object.assign({},k),{key:R})):k!==!0&&g._info.push({key:R,description:k,type:U!=null?typeof U:void 0})}static all(){return g._info.values()}bindTo(R){return R.createKey(this.key,this._defaultValue)}getValue(R){return R.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(R){return p.create(this.key,R)}}g._info=[];const m=Object(j.c)("contextKeyService"),y="setContext";function x(R,U){return R<U?-1:R>U?1:0}function O(R,U,k,d){return R<k?-1:R>k?1:U<d?-1:U>d?1:0}function H(R,U){if(U.type===6&&R.type!==9&&R.type!==6){for(const z of U.expr)if(R.equals(z))return!0}const k=R.negate(),d=F(k).concat(F(U));d.sort(r);for(let z=0;z<d.length;z++){const Y=d[z],re=Y.negate();for(let le=z+1;le<d.length;le++){const Ne=d[le];if(re.equals(Ne))return!0}}return!1}function F(R){return R.type===9?R.expr:[R]}},TXwP:function(Bt,ve,T){var Z,V;(function(){var j;(function(){"use strict";var M=[,,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 l=this.__items.length-1;l>=0;l--)if(this.__items[l].match(p))return!0;return!1},A.prototype.set_indent=function(p,l){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=l||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 l=p.lastIndexOf(`
`);l!==-1?this.__character_count=p.length-l: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 v(p,l){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)),l=l||"",p.indent_level>0&&(l=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=l,this.__base_string_length=l.length}v.prototype.get_indent_size=function(p,l){var o=this.__base_string_length;return l=l||0,p<0&&(o=0),o+=p*this.__indent_size,o+=l,o},v.prototype.get_indent_string=function(p,l){var o=this.__base_string;return l=l||0,p<0&&(p=0,o=""),l+=p*this.__indent_size,this.__ensure_cache(l),o+=this.__cache[l],o},v.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},v.prototype.__add_column=function(){var p=this.__cache.length,l=0,o="";this.__indent_size&&p>=this.__indent_size&&(l=Math.floor(p/this.__indent_size),p-=l*this.__indent_size,o=new Array(l+1).join(this.__indent_string)),p&&(o+=new Array(p+1).join(" ")),this.__cache.push(o)};function f(p,l){this.__indent_cache=new v(p,l),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,l){return this.__indent_cache.get_indent_string(p,l)},f.prototype.get_indent_size=function(p,l){return this.__indent_cache.get_indent_size(p,l)},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 l=this.current_line.pop();l&&(l[l.length-1]===`
`&&(l=l.replace(/\n+$/g,"")),this.current_line.push(l)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
`);return p!==`
`&&(o=o.replace(/[\n]/g,p)),o},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(p,l){return p=p||0,l=l||0,this.next_line.set_indent(p,l),this.__lines.length>1?(this.current_line.set_indent(p,l),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(p){for(var l=0;l<p.newlines;l++)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 l=this.__lines.length;p<l;)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,l){for(var o=this.__lines.length-2;o>=0;){var s=this.__lines[o];if(s.is_empty())break;if(s.item(0).indexOf(p)!==0&&s.item(-1)!==l){this.__lines.splice(o+1,0,new A(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},r.exports.Output=f},,,,function(r){function A(p,l){this.raw_options=v(p,l),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,l){var o=this.raw_options[p],s=l||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(s=o.concat()):typeof o=="string"&&(s=o.split(/[^a-zA-Z0-9_\/\-]+/)),s},A.prototype._get_boolean=function(p,l){var o=this.raw_options[p],s=o===void 0?!!l:!!o;return s},A.prototype._get_characters=function(p,l){var o=this.raw_options[p],s=l||"";return typeof o=="string"&&(s=o.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),s},A.prototype._get_number=function(p,l){var o=this.raw_options[p];l=parseInt(l,10),isNaN(l)&&(l=0);var s=parseInt(o,10);return isNaN(s)&&(s=l),s},A.prototype._get_selection=function(p,l,o){var s=this._get_selection_list(p,l,o);if(s.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
`+l+`
You passed in: '`+this.raw_options[p]+"'");return s[0]},A.prototype._get_selection_list=function(p,l,o){if(!l||l.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[l[0]],!this._is_valid_selection(o,l))throw new Error("Invalid Default Value!");var s=this._get_array(p,o);if(!this._is_valid_selection(s,l))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
`+l+`
You passed in: '`+this.raw_options[p]+"'");return s},A.prototype._is_valid_selection=function(p,l){return p.length&&l.length&&!p.some(function(o){return l.indexOf(o)===-1})};function v(p,l){var o={};p=f(p);var s;for(s in p)s!==l&&(o[s]=p[s]);if(l&&p[l])for(s in p[l])o[s]=p[l][s];return o}function f(p){var l={},o;for(o in p){var s=o.replace(/-/g,"_");l[s]=p[o]}return l}r.exports.Options=A,r.exports.normalizeOpts=f,r.exports.mergeOpts=v},,function(r){var A=RegExp.prototype.hasOwnProperty("sticky");function v(f){this.__input=f||"",this.__input_length=this.__input.length,this.__position=0}v.prototype.restart=function(){this.__position=0},v.prototype.back=function(){this.__position>0&&(this.__position-=1)},v.prototype.hasNext=function(){return this.__position<this.__input_length},v.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__input.charAt(this.__position),this.__position+=1),f},v.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},v.prototype.__match=function(f,p){f.lastIndex=p;var l=f.exec(this.__input);return l&&!(A&&f.sticky)&&(l.index!==p&&(l=null)),l},v.prototype.test=function(f,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(f,p):!1},v.prototype.testChar=function(f,p){var l=this.peek(p);return f.lastIndex=0,l!==null&&f.test(l)},v.prototype.match=function(f){var p=this.__match(f,this.__position);return p?this.__position+=p[0].length:p=null,p},v.prototype.read=function(f,p,l){var o="",s;return f&&(s=this.match(f),s&&(o+=s[0])),p&&(s||!f)&&(o+=this.readUntil(p,l)),o},v.prototype.readUntil=function(f,p){var l="",o=this.__position;f.lastIndex=this.__position;var s=f.exec(this.__input);return s?(o=s.index,p&&(o+=s[0].length)):o=this.__input_length,l=this.__input.substring(this.__position,o),this.__position=o,l},v.prototype.readUntilAfter=function(f){return this.readUntil(f,!0)},v.prototype.get_regexp=function(f,p){var l=null,o="g";return p&&A&&(o="y"),typeof f=="string"&&f!==""?l=new RegExp(f,o):f&&(l=new RegExp(f.source,o)),l},v.prototype.get_literal_regexp=function(f){return RegExp(f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},v.prototype.peekUntilAfter=function(f){var p=this.__position,l=this.readUntilAfter(f);return this.__position=p,l},v.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=v},,,,,function(r){function A(v,f){v=typeof v=="string"?v:v.source,f=typeof f=="string"?f:f.source,this.__directives_block_pattern=new RegExp(v+/ beautify( \w+[:]\w+)+ /.source+f,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(v+/\sbeautify\signore:end\s/.source+f,"g")}A.prototype.get_directives=function(v){if(!v.match(this.__directives_block_pattern))return null;var f={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(v);p;)f[p[1]]=p[2],p=this.__directive_pattern.exec(v);return f},A.prototype.readIgnored=function(v){return v.readUntilAfter(this.__directives_end_ignore_pattern)},r.exports.Directives=A},,function(r,A,v){var f=v(16).Beautifier,p=v(17).Options;function l(o,s){var t=new f(o,s);return t.beautify()}r.exports=l,r.exports.defaultOptions=function(){return new p}},function(r,A,v){var f=v(17).Options,p=v(2).Output,l=v(8).InputScanner,o=v(13).Directives,s=new o(/\/\*/,/\*\//),t=/\r\n|[\r\n]/,u=/\r\n|[\r\n]/g,a=/\s/,i=/(?:\s|\n)+/g,D=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,w=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function S(L,P){this._source_text=L||"",this._options=new f(P),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(L){var P="";for(this._ch=this._input.next();this._ch;){if(P+=this._ch,this._ch==="\\")P+=this._input.next();else if(L.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return P},S.prototype.eatWhitespace=function(L){for(var P=a.test(this._input.peek()),_=0;a.test(this._input.peek());)this._ch=this._input.next(),L&&this._ch===`
`&&((_===0||_<this._options.max_preserve_newlines)&&(_++,this._output.add_new_line(!0)));return P},S.prototype.foundNestedPseudoClass=function(){for(var L=0,P=1,_=this._input.peek(P);_;){if(_==="{")return!0;if(_==="(")L+=1;else if(_===")"){if(L===0)return!1;L-=1}else if(_===";"||_==="}")return!1;P++,_=this._input.peek(P)}return!1},S.prototype.print_string=function(L){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(L)},S.prototype.preserveSingleSpace=function(L){L&&(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 L=this._source_text,P=this._options.eol;P==="auto"&&(P=`
`,L&&t.test(L||"")&&(P=L.match(t)[0])),L=L.replace(u,`
`);var _=L.match(/^[\t ]*/)[0];this._output=new p(this._options,_),this._input=new l(L),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var b=0,g=!1,m=!1,y=!1,x=!1,O=!1,H=!1,F=this._ch,R=!1,U,k,d;U=this._input.read(i),k=U!=="",d=F,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),F=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var z=this._input.read(D),Y=s.get_directives(z);Y&&Y.ignore==="start"&&(z+=s.readIgnored(this._input)),this.print_string(z),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(w)),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 re=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);re.match(/[ :]$/)&&(re=this.eatString(": ").replace(/\s$/,""),this.print_string(re),this._output.space_before_token=!0),re=re.replace(/\s$/,""),re==="extend"?x=!0:re==="import"&&(O=!0),re in this.NESTED_AT_RULE?(this._nestedLevel+=1,re in this.CONDITIONAL_GROUP_RULE&&(y=!0)):!g&&b===0&&re.indexOf(":")!==-1&&(m=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(k),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")m&&(m=!1,this.outdent()),y?(y=!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)):(d==="("?this._output.space_before_token=!1:d!==","&&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(),d==="{"&&this._output.trim(!0),O=!1,x=!1,m&&(this.outdent(),m=!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 le=0;le<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;le++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[le])){R=!0;break}(g||y)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!x&&b===0?(this.print_string(":"),m||(m=!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 Ne=d==='"'||d==="'";this.preserveSingleSpace(Ne||k),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")R=!1,b===0?(m&&(this.outdent(),m=!1),x=!1,O=!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(),b++,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(")")),b&&(b--,this.outdent()));else{var Ce=!1;this._input.lookBack("with")&&(Ce=!0),this.preserveSingleSpace(k||Ce),this.print_string(this._ch),m&&d==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),H=!0):(this.eatWhitespace(),b++,this.indent())}else if(this._ch===")")b&&(b--,this.outdent()),H&&this._input.peek()===";"&&this._options.selector_separator_newline&&(H=!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&&(!m||H)&&b===0&&!O&&!x?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!m&&b===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&&a.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("="),a.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 Te=d==='"'||d==="'";this.preserveSingleSpace(Te||k),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&R&&this._output.add_new_line()}var Fe=this._output.get_code(P);return Fe},r.exports.Beautifier=S},function(r,A,v){var f=v(6).Options;function p(l){f.call(this,l,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var o=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||o;var s=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var t=0;t<s.length;t++)s[t]!=="expand"?this.brace_style="collapse":this.brace_style=s[t]}p.prototype=new f,r.exports.Options=p}],I={};function W(r){var A=I[r];if(A!==void 0)return A.exports;var v=I[r]={exports:{}};return M[r](v,v.exports,W),v.exports}var C=W(15);j=C})();var G=j;!(Z=[],V=function(){return{css_beautify:G}}.apply(ve,Z),V!==void 0&&(Bt.exports=V))})()},TreJ:function(Bt,ve,T){"use strict";var Z=T("sRBo"),V=T("kaz8"),j=T("giR+"),G=T("fyUT"),M=T("14J3"),I=T("BMrR"),W=T("iQDF"),C=T("+eQT"),r=T("jCWc"),A=T("kPKH"),v=T("q1tI"),f=T.n(v),p=T("wd/R"),l=T.n(p),o=T("9kvl"),s=T("eozf"),t=function(a){var i=a.data,D=a.setData,w=a.disabled,S=a.shixunHomeworks,L=S.workSetting,P=l()(L==null?void 0:L.evaluation_start)<=l()(),_=i.anonymous_appeal;return f.a.createElement("div",null,f.a.createElement(I.a,{align:"middle",className:"pl30"},f.a.createElement(A.a,null,"\u5F00\u59CB\u65F6\u95F4:"),f.a.createElement(A.a,{className:"ml5"},f.a.createElement(C.a,{allowClear:!1,style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u5F00\u59CB\u65F6\u95F4",showTime:{format:"HH:mm"},format:"YYYY-MM-DD HH:mm",disabledDate:function(g){return Object(s.b)(g,L==null?void 0:L.course_end_date)},disabledTime:function(g){return Object(s.c)(g)},disabled:w||P||_,value:i.evaluation_start?l()(i.evaluation_start):"",onChange:function(g,m){i.evaluation_start=m,D(Object.assign({},i))}})),f.a.createElement(A.a,null,f.a.createElement("span",{className:"c-grey-c ml10"},"(\u533F\u8BC4\u5F00\u59CB\u65F6\u95F4\u4E4B\u524D\u63D0\u4EA4\u4F5C\u54C1\u7684\u5B66\u751F\uFF0C\u53C2\u4E0E\u533F\u8BC4)"))),f.a.createElement(I.a,{align:"middle",className:"mt25 pl30"},f.a.createElement(A.a,null,"\u7ED3\u675F\u65F6\u95F4:"),f.a.createElement(A.a,{className:"ml5"},f.a.createElement(C.a,{allowClear:!1,style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u7ED3\u675F\u65F6\u95F4",showTime:{format:"HH:mm"},format:"YYYY-MM-DD HH:mm",disabledDate:function(g){return Object(s.b)(g,L==null?void 0:L.course_end_date,i.evaluation_start)},disabledTime:function(g){return Object(s.c)(g,l()(i.evaluation_start))},disabled:w||_,value:i.evaluation_end?l()(i.evaluation_end):"",onChange:function(g,m){i.evaluation_end=m,D(Object.assign({},i))}})),f.a.createElement(A.a,null,f.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u533F\u8BC4TA\u4EBA\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)"))),f.a.createElement(I.a,{align:"middle",className:"mt25 pl30"},f.a.createElement(A.a,null,"\u533F\u8BC4\u6570\u91CF:"),f.a.createElement(A.a,{className:"ml5"},f.a.createElement(G.a,{disabled:w||P||_,value:i.evaluation_num,onChange:function(g){i.evaluation_num=g,D(Object.assign({},i))}})),f.a.createElement(A.a,{flex:"1",className:"ml5"},f.a.createElement("span",{className:"c-grey-c ml10"},"(\u672C\u5904\u586B\u5199\u6BCF\u4E2A\u5B66\u751F\u5C06\u88AB\u5206\u914D\u7684\u533F\u8BC4\u4F5C\u54C1\u6570\u91CF\u3002\u5982\u5168\u73ED\u5B9E\u9645\u63D0\u4EA4\u4F5C\u4E1A\u6570\u91CF\u5C0F\u4E8E\u672C\u6570\u503C\uFF0C\u5219\u4EE5\u5B9E\u9645\u63D0\u4EA4\u4F5C\u4E1A\u6570\u91CF\u4E3A\u51C6\u3002)"))),f.a.createElement(I.a,{align:"middle",className:"mt25 pl30"},f.a.createElement(A.a,null,"\u7F3A\u8BC4\u6263\u5206:"),f.a.createElement(A.a,{className:"ml5"},f.a.createElement(G.a,{min:0,disabled:w,value:i.absence_penalty,onChange:function(g){i.absence_penalty=g,D(Object.assign({},i))}})),f.a.createElement(A.a,{flex:"1",className:"ml5"},"\u5206",f.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u7F3A\u8BC4\u65F6\uFF0C\u5176\u6210\u7EE9\u5C06\u88AB\u6263\u51CF\u7684\u5206\u503C)"))),i.anonymous_comment&&f.a.createElement(f.a.Fragment,null,f.a.createElement(I.a,null,f.a.createElement(A.a,{span:24,className:"mt15 pl30"},f.a.createElement(V.a,{checked:i.student_comment,disabled:w,onChange:function(){i.student_comment=!i.student_comment,D(Object.assign({},i))}},f.a.createElement("strong",null,"\u533F\u8BC4\u8BA1\u5165\u5DF2\u8BC4\u9605")),f.a.createElement("span",{className:"c-grey-c font12"},"(\u5B66\u751F\u76F8\u4E92\u533F\u8BC4\u7684\u6570\u636E\uFF0C\u5728\u4F5C\u54C1\u5217\u8868\u4E2D\u8BA1\u5165\u5DF2\u8BC4\u9605)")))))};ve.a=Object(o.a)(function(u){var a=u.shixunHomeworks;return{shixunHomeworks:a}})(t)},Vhoy:function(Bt,ve,T){"use strict";T.d(ve,"d",function(){return G}),T.d(ve,"e",function(){return M}),T.d(ve,"c",function(){return I}),T.d(ve,"b",function(){return W}),T.d(ve,"a",function(){return C});var Z=T("MI8n");class V{constructor(){this._icons=new Map,this._onDidRegister=new Z.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 j=new V,G=j;function M(r,A){return new W(r,A)}function I(r){return r?r.replace(/\$\((.*?)\)/g,(A,v)=>` ${v} `).trim():""}class W{constructor(r,A,v){this.id=r,this.definition=A,this.description=v,j.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var C;(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 v(l){if(l instanceof W)return["codicon","codicon-"+l.id];const o=A.exec(l.id);if(!o)return v(W.error);let[,s,t]=o;const u=["codicon","codicon-"+s];return t&&u.push("codicon-modifier-"+t.substr(1)),u}r.asClassNameArray=v;function f(l){return v(l).join(" ")}r.asClassName=f;function p(l){return"."+v(l).join(".")}r.asCSSSelector=p})(C||(C={})),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"})}(W||(W={}))},"VrN/":function(Bt,ve,T){(function(Z,V){Bt.exports=V()})(this,function(){"use strict";var Z=navigator.userAgent,V=navigator.platform,j=/gecko\/\d/i.test(Z),G=/MSIE \d/.test(Z),M=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Z),I=/Edge\/(\d+)/.exec(Z),W=G||M||I,C=W&&(G?document.documentMode||6:+(I||M)[1]),r=!I&&/WebKit\//.test(Z),A=r&&/Qt\/\d+\.\d+/.test(Z),v=!I&&/Chrome\//.test(Z),f=/Opera\//.test(Z),p=/Apple Computer/.test(navigator.vendor),l=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Z),o=/PhantomJS/.test(Z),s=!I&&/AppleWebKit/.test(Z)&&/Mobile\/\w+/.test(Z),t=/Android/.test(Z),u=s||t||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Z),a=s||/Mac/.test(V),i=/\bCrOS\b/.test(Z),D=/win/i.test(V),w=f&&Z.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(f=!1,r=!0);var S=a&&(A||f&&(w==null||w<12.11)),L=j||W&&C>=9;function P(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var _=function(e,n){var h=e.className,c=P(n).exec(h);if(c){var E=h.slice(c.index+c[0].length);e.className=h.slice(0,c.index)+(E?c[1]+E:"")}};function b(e){for(var n=e.childNodes.length;n>0;--n)e.removeChild(e.firstChild);return e}function g(e,n){return b(e).appendChild(n)}function m(e,n,h,c){var E=document.createElement(e);if(h&&(E.className=h),c&&(E.style.cssText=c),typeof n=="string")E.appendChild(document.createTextNode(n));else if(n)for(var K=0;K<n.length;++K)E.appendChild(n[K]);return E}function y(e,n,h,c){var E=m(e,n,h,c);return E.setAttribute("role","presentation"),E}var x;document.createRange?x=function(e,n,h,c){var E=document.createRange();return E.setEnd(c||e,h),E.setStart(e,n),E}:x=function(e,n,h){var c=document.body.createTextRange();try{c.moveToElementText(e.parentNode)}catch(E){return c}return c.collapse(!0),c.moveEnd("character",h),c.moveStart("character",n),c};function O(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 H(){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 F(e,n){var h=e.className;P(n).test(h)||(e.className+=(h?" ":"")+n)}function R(e,n){for(var h=e.split(" "),c=0;c<h.length;c++)h[c]&&!P(h[c]).test(n)&&(n+=" "+h[c]);return n}var U=function(e){e.select()};s?U=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:W&&(U=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 d(e,n,h){n||(n={});for(var c in e)e.hasOwnProperty(c)&&(h!==!1||!n.hasOwnProperty(c))&&(n[c]=e[c]);return n}function z(e,n,h,c,E){n==null&&(n=e.search(/[^\s\u00a0]/),n==-1&&(n=e.length));for(var K=c||0,J=E||0;;){var ie=e.indexOf(" ",K);if(ie<0||ie>=n)return J+(n-K);J+=ie-K,J+=h-J%h,K=ie+1}}var Y=function(){this.id=null,this.f=null,this.time=0,this.handler=k(this.onTimeout,this)};Y.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Y.prototype.set=function(e,n){this.f=n;var h=+new Date+e;(!this.id||h<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=h)};function re(e,n){for(var h=0;h<e.length;++h)if(e[h]==n)return h;return-1}var le=50,Ne={toString:function(){return"CodeMirror.Pass"}},Ce={scroll:!1},Te={origin:"*mouse"},Fe={origin:"+move"};function Ve(e,n,h){for(var c=0,E=0;;){var K=e.indexOf(" ",c);K==-1&&(K=e.length);var J=K-c;if(K==e.length||E+J>=n)return c+Math.min(J,n-E);if(E+=K-c,E+=h-E%h,c=K+1,E>=n)return c}}var xe=[""];function ye(e){for(;xe.length<=e;)xe.push(oe(xe)+" ");return xe[e]}function oe(e){return e[e.length-1]}function Se(e,n){for(var h=[],c=0;c<e.length;c++)h[c]=n(e[c],c);return h}function _e(e,n,h){for(var c=0,E=h(n);c<e.length&&h(e[c])<=E;)c++;e.splice(c,0,n)}function He(){}function rt(e,n){var h;return Object.create?h=Object.create(e):(He.prototype=e,h=new He),n&&d(n,h),h}var ae=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function $(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ae.test(e))}function Q(e,n){return n?n.source.indexOf("\\w")>-1&&$(e)?!0:n.test(e):$(e)}function te(e){for(var n in e)if(e.hasOwnProperty(n)&&e[n])return!1;return!0}var he=/[\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 ge(e){return e.charCodeAt(0)>=768&&he.test(e)}function we(e,n,h){for(;(h<0?n>0:n<e.length)&&ge(e.charAt(n));)n+=h;return n}function ft(e,n,h){for(var c=n>h?-1:1;;){if(n==h)return n;var E=(n+h)/2,K=c<0?Math.ceil(E):Math.floor(E);if(K==n)return e(K)?n:h;e(K)?h=K:n=K+c}}function Pt(e,n,h,c){if(!e)return c(n,h,"ltr",0);for(var E=!1,K=0;K<e.length;++K){var J=e[K];(J.from<h&&J.to>n||n==h&&J.to==n)&&(c(Math.max(J.from,n),Math.min(J.to,h),J.level==1?"rtl":"ltr",K),E=!0)}E||c(n,h,"ltr")}var jt=null;function qe(e,n,h){var c;jt=null;for(var E=0;E<e.length;++E){var K=e[E];if(K.from<n&&K.to>n)return E;K.to==n&&(K.from!=K.to&&h=="before"?c=E:jt=E),K.from==n&&(K.from!=K.to&&h!="before"?c=E:jt=E)}return c!=null?c:jt}var Mt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function h(pe){return pe<=247?e.charAt(pe):1424<=pe&&pe<=1524?"R":1536<=pe&&pe<=1785?n.charAt(pe-1536):1774<=pe&&pe<=2220?"r":8192<=pe&&pe<=8203?"w":pe==8204?"b":"L"}var c=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,E=/[stwN]/,K=/[LRr]/,J=/[Lb1n]/,ie=/[1n]/;function se(pe,Xe,nt){this.level=pe,this.from=Xe,this.to=nt}return function(pe,Xe){var nt=Xe=="ltr"?"L":"R";if(pe.length==0||Xe=="ltr"&&!c.test(pe))return!1;for(var wt=pe.length,_t=[],rn=0;rn<wt;++rn)_t.push(h(pe.charCodeAt(rn)));for(var _n=0,In=nt;_n<wt;++_n){var jn=_t[_n];jn=="m"?_t[_n]=In:In=jn}for(var Jn=0,Fn=nt;Jn<wt;++Jn){var rr=_t[Jn];rr=="1"&&Fn=="r"?_t[Jn]="n":K.test(rr)&&(Fn=rr,rr=="r"&&(_t[Jn]="R"))}for(var wr=1,gr=_t[0];wr<wt-1;++wr){var Fr=_t[wr];Fr=="+"&&gr=="1"&&_t[wr+1]=="1"?_t[wr]="1":Fr==","&&gr==_t[wr+1]&&(gr=="1"||gr=="n")&&(_t[wr]=gr),gr=Fr}for(var pa=0;pa<wt;++pa){var $a=_t[pa];if($a==",")_t[pa]="N";else if($a=="%"){var Sa=void 0;for(Sa=pa+1;Sa<wt&&_t[Sa]=="%";++Sa);for(var vi=pa&&_t[pa-1]=="!"||Sa<wt&&_t[Sa]=="1"?"1":"N",hi=pa;hi<Sa;++hi)_t[hi]=vi;pa=Sa-1}}for(var Fa=0,fi=nt;Fa<wt;++Fa){var ei=_t[Fa];fi=="L"&&ei=="1"?_t[Fa]="L":K.test(ei)&&(fi=ei)}for(var Ka=0;Ka<wt;++Ka)if(E.test(_t[Ka])){var Ba=void 0;for(Ba=Ka+1;Ba<wt&&E.test(_t[Ba]);++Ba);for(var Da=(Ka?_t[Ka-1]:nt)=="L",pi=(Ba<wt?_t[Ba]:nt)=="L",So=Da==pi?Da?"L":"R":nt,ao=Ka;ao<Ba;++ao)_t[ao]=So;Ka=Ba-1}for(var ii=[],ji,Ja=0;Ja<wt;)if(J.test(_t[Ja])){var ms=Ja;for(++Ja;Ja<wt&&J.test(_t[Ja]);++Ja);ii.push(new se(0,ms,Ja))}else{var Ji=Ja,ho=ii.length,fo=Xe=="rtl"?1:0;for(++Ja;Ja<wt&&_t[Ja]!="L";++Ja);for(var ui=Ji;ui<Ja;)if(ie.test(_t[ui])){Ji<ui&&(ii.splice(ho,0,new se(1,Ji,ui)),ho+=fo);var Ro=ui;for(++ui;ui<Ja&&ie.test(_t[ui]);++ui);ii.splice(ho,0,new se(2,Ro,ui)),ho+=fo,Ji=ui}else++ui;Ji<Ja&&ii.splice(ho,0,new se(1,Ji,Ja))}return Xe=="ltr"&&(ii[0].level==1&&(ji=pe.match(/^\s+/))&&(ii[0].from=ji[0].length,ii.unshift(new se(0,0,ji[0].length))),oe(ii).level==1&&(ji=pe.match(/\s+$/))&&(oe(ii).to-=ji[0].length,ii.push(new se(0,wt-ji[0].length,wt)))),Xe=="rtl"?ii.reverse():ii}}();function sn(e,n){var h=e.order;return h==null&&(h=e.order=Mt(e.text,n)),h}var at=[],Qe=function(e,n,h){if(e.addEventListener)e.addEventListener(n,h,!1);else if(e.attachEvent)e.attachEvent("on"+n,h);else{var c=e._handlers||(e._handlers={});c[n]=(c[n]||at).concat(h)}};function Et(e,n){return e._handlers&&e._handlers[n]||at}function It(e,n,h){if(e.removeEventListener)e.removeEventListener(n,h,!1);else if(e.detachEvent)e.detachEvent("on"+n,h);else{var c=e._handlers,E=c&&c[n];if(E){var K=re(E,h);K>-1&&(c[n]=E.slice(0,K).concat(E.slice(K+1)))}}}function dt(e,n){var h=Et(e,n);if(!h.length)return;for(var c=Array.prototype.slice.call(arguments,2),E=0;E<h.length;++E)h[E].apply(null,c)}function mt(e,n,h){return typeof n=="string"&&(n={type:n,preventDefault:function(){this.defaultPrevented=!0}}),dt(e,h||n.type,e,n),Ee(n)||n.codemirrorIgnore}function We(e){var n=e._handlers&&e._handlers.cursorActivity;if(!n)return;for(var h=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),c=0;c<n.length;++c)re(h,n[c])==-1&&h.push(n[c])}function De(e,n){return Et(e,n).length>0}function Le(e){e.prototype.on=function(n,h){Qe(this,n,h)},e.prototype.off=function(n,h){It(this,n,h)}}function de(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function fe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ee(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Pe(e){de(e),fe(e)}function Ue(e){return e.target||e.srcElement}function lt(e){var n=e.which;return n==null&&(e.button&1?n=1:e.button&2?n=3:e.button&4&&(n=2)),a&&e.ctrlKey&&n==1&&(n=3),n}var Ot=function(){if(W&&C<9)return!1;var e=m("div");return"draggable"in e||"dragDrop"in e}(),cn;function An(e){if(cn==null){var n=m("span","\u200B");g(e,m("span",[n,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(cn=n.offsetWidth<=1&&n.offsetHeight>2&&!(W&&C<8))}var h=cn?m("span","\u200B"):m("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return h.setAttribute("cm-text",""),h}var Ct;function Gt(e){if(Ct!=null)return Ct;var n=g(e,document.createTextNode("A\u062EA")),h=x(n,0,1).getBoundingClientRect(),c=x(n,1,2).getBoundingClientRect();return b(e),!h||h.left==h.right?!1:Ct=c.right-h.right<3}var xt=`
b`.split(/\n/).length!=3?function(e){for(var n=0,h=[],c=e.length;n<=c;){var E=e.indexOf(`
`,n);E==-1&&(E=e.length);var K=e.slice(n,e.charAt(E-1)=="\r"?E-1:E),J=K.indexOf("\r");J!=-1?(h.push(K.slice(0,J)),n+=J+1):(h.push(K),n=E+1)}return h}:function(e){return e.split(/\r\n?|\n/)},Rt=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(h){}return!n||n.parentElement()!=e?!1:n.compareEndPoints("StartToEnd",n)!=0},gt=function(){var e=m("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),be=null;function Ie(e){if(be!=null)return be;var n=g(e,m("span","x")),h=n.getBoundingClientRect(),c=x(n,0,1).getBoundingClientRect();return be=Math.abs(h.left-c.left)>1}var Dt={},ht={};function nn(e,n){arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),Dt[e]=n}function qt(e,n){ht[e]=n}function Ke(e){if(typeof e=="string"&&ht.hasOwnProperty(e))e=ht[e];else if(e&&typeof e.name=="string"&&ht.hasOwnProperty(e.name)){var n=ht[e.name];typeof n=="string"&&(n={name:n}),e=rt(n,e),e.name=n.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ke("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ke("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function st(e,n){n=Ke(n);var h=Dt[n.name];if(!h)return st(e,"text/plain");var c=h(e,n);if(bt.hasOwnProperty(n.name)){var E=bt[n.name];for(var K in E){if(!E.hasOwnProperty(K))continue;c.hasOwnProperty(K)&&(c["_"+K]=c[K]),c[K]=E[K]}}if(c.name=n.name,n.helperType&&(c.helperType=n.helperType),n.modeProps)for(var J in n.modeProps)c[J]=n.modeProps[J];return c}var bt={};function Ft(e,n){var h=bt.hasOwnProperty(e)?bt[e]:bt[e]={};d(n,h)}function $t(e,n){if(n===!0)return n;if(e.copyState)return e.copyState(n);var h={};for(var c in n){var E=n[c];E instanceof Array&&(E=E.concat([])),h[c]=E}return h}function gn(e,n){for(var h;e.innerMode&&!(h=e.innerMode(n),!h||h.mode==e);)n=h.state,e=h.mode;return h||{mode:e,state:n}}function er(e,n,h){return e.startState?e.startState(n,h):!0}var Hn=function(e,n,h){this.pos=this.start=0,this.string=e,this.tabSize=n||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=h};Hn.prototype.eol=function(){return this.pos>=this.string.length},Hn.prototype.sol=function(){return this.pos==this.lineStart},Hn.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Hn.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Hn.prototype.eat=function(e){var n=this.string.charAt(this.pos),h;if(typeof e=="string"?h=n==e:h=n&&(e.test?e.test(n):e(n)),h)return++this.pos,n},Hn.prototype.eatWhile=function(e){for(var n=this.pos;this.eat(e););return this.pos>n},Hn.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Hn.prototype.skipToEnd=function(){this.pos=this.string.length},Hn.prototype.skipTo=function(e){var n=this.string.indexOf(e,this.pos);if(n>-1)return this.pos=n,!0},Hn.prototype.backUp=function(e){this.pos-=e},Hn.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=z(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},Hn.prototype.indentation=function(){return z(this.string,null,this.tabSize)-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},Hn.prototype.match=function(e,n,h){if(typeof e=="string"){var c=function(J){return h?J.toLowerCase():J},E=this.string.substr(this.pos,e.length);if(c(E)==c(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)}},Hn.prototype.current=function(){return this.string.slice(this.start,this.pos)},Hn.prototype.hideFirstChars=function(e,n){this.lineStart+=e;try{return n()}finally{this.lineStart-=e}},Hn.prototype.lookAhead=function(e){var n=this.lineOracle;return n&&n.lookAhead(e)},Hn.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function yn(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 h=e;!h.lines;)for(var c=0;;++c){var E=h.children[c],K=E.chunkSize();if(n<K){h=E;break}n-=K}return h.lines[n]}function Sr(e,n,h){var c=[],E=n.line;return e.iter(n.line,h.line+1,function(K){var J=K.text;E==h.line&&(J=J.slice(0,h.ch)),E==n.line&&(J=J.slice(n.ch)),c.push(J),++E}),c}function _r(e,n,h){var c=[];return e.iter(n,h,function(E){c.push(E.text)}),c}function ar(e,n){var h=n-e.height;if(h)for(var c=e;c;c=c.parent)c.height+=h}function cr(e){if(e.parent==null)return null;for(var n=e.parent,h=re(n.lines,e),c=n.parent;c;n=c,c=c.parent)for(var E=0;!(c.children[E]==n);++E)h+=c.children[E].chunkSize();return h+n.first}function Pr(e,n){var h=e.first;e:do{for(var c=0;c<e.children.length;++c){var E=e.children[c],K=E.height;if(n<K){e=E;continue e}n-=K,h+=E.chunkSize()}return h}while(!e.lines);for(var J=0;J<e.lines.length;++J){var ie=e.lines[J],se=ie.height;if(n<se)break;n-=se}return h+J}function Qr(e,n){return n>=e.first&&n<e.first+e.size}function ca(e,n){return String(e.lineNumberFormatter(n+e.firstLineNumber))}function hn(e,n,h){if(h===void 0&&(h=null),!(this instanceof hn))return new hn(e,n,h);this.line=e,this.ch=n,this.sticky=h}function ir(e,n){return e.line-n.line||e.ch-n.ch}function va(e,n){return e.sticky==n.sticky&&ir(e,n)==0}function Pa(e){return hn(e.line,e.ch)}function sa(e,n){return ir(e,n)<0?n:e}function la(e,n){return ir(e,n)<0?e:n}function ee(e,n){return Math.max(e.first,Math.min(n,e.first+e.size-1))}function N(e,n){if(n.line<e.first)return hn(e.first,0);var h=e.first+e.size-1;return n.line>h?hn(h,yn(e,h).text.length):B(n,yn(e,n.line).text.length)}function B(e,n){var h=e.ch;return h==null||h>n?hn(e.line,n):h<0?hn(e.line,0):e}function X(e,n){for(var h=[],c=0;c<n.length;c++)h[c]=N(e,n[c]);return h}var ue=function(e,n){this.state=e,this.lookAhead=n},q=function(e,n,h,c){this.state=n,this.doc=e,this.line=h,this.maxLookAhead=c||0,this.baseTokens=null,this.baseTokenPos=1};q.prototype.lookAhead=function(e){var n=this.doc.getLine(this.line+e);return n!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),n},q.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}},q.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},q.fromSaved=function(e,n,h){return n instanceof ue?new q(e,$t(e.mode,n.state),h,n.lookAhead):new q(e,$t(e.mode,n),h)},q.prototype.save=function(e){var n=e!==!1?$t(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ue(n,this.maxLookAhead):n};function Ze(e,n,h,c){var E=[e.state.modeGen],K={};da(e,n.text,e.doc.mode,h,function(pe,Xe){return E.push(pe,Xe)},K,c);for(var J=h.state,ie=function(pe){h.baseTokens=E;var Xe=e.state.overlays[pe],nt=1,wt=0;h.state=!0,da(e,n.text,Xe.mode,h,function(_t,rn){for(var _n=nt;wt<_t;){var In=E[nt];In>_t&&E.splice(nt,1,_t,E[nt+1],In),nt+=2,wt=Math.min(_t,In)}if(!rn)return;if(Xe.opaque)E.splice(_n,nt-_n,_t,"overlay "+rn),nt=_n+2;else for(;_n<nt;_n+=2){var jn=E[_n+1];E[_n+1]=(jn?jn+" ":"")+"overlay "+rn}},K),h.state=J,h.baseTokens=null,h.baseTokenPos=1},se=0;se<e.state.overlays.length;++se)ie(se);return{styles:E,classes:K.bgClass||K.textClass?K:null}}function Jt(e,n,h){if(!n.styles||n.styles[0]!=e.state.modeGen){var c=On(e,cr(n)),E=n.text.length>e.options.maxHighlightLength&&$t(e.doc.mode,c.state),K=Ze(e,n,c);E&&(c.state=E),n.stateAfter=c.save(!E),n.styles=K.styles,K.classes?n.styleClasses=K.classes:n.styleClasses&&(n.styleClasses=null),h===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return n.styles}function On(e,n,h){var c=e.doc,E=e.display;if(!c.mode.startState)return new q(c,!0,n);var K=Zr(e,n,h),J=K>c.first&&yn(c,K-1).stateAfter,ie=J?q.fromSaved(c,J,K):new q(c,er(c.mode),K);return c.iter(K,n,function(se){Xn(e,se.text,ie);var pe=ie.line;se.stateAfter=pe==n-1||pe%5==0||pe>=E.viewFrom&&pe<E.viewTo?ie.save():null,ie.nextLine()}),h&&(c.modeFrontier=ie.line),ie}function Xn(e,n,h,c){var E=e.doc.mode,K=new Hn(n,e.options.tabSize,h);for(K.start=K.pos=c||0,n==""&&un(E,h.state);!K.eol();)nr(E,K,h.state),K.start=K.pos}function un(e,n){if(e.blankLine)return e.blankLine(n);if(!e.innerMode)return;var h=gn(e,n);if(h.mode.blankLine)return h.mode.blankLine(h.state)}function nr(e,n,h,c){for(var E=0;E<10;E++){c&&(c[0]=gn(e,h).mode);var K=e.token(n,h);if(n.pos>n.start)return K}throw new Error("Mode "+e.name+" failed to advance stream.")}var mr=function(e,n,h){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=n||null,this.state=h};function Kr(e,n,h,c){var E=e.doc,K=E.mode,J;n=N(E,n);var ie=yn(E,n.line),se=On(e,n.line,h),pe=new Hn(ie.text,e.options.tabSize,se),Xe;for(c&&(Xe=[]);(c||pe.pos<n.ch)&&!pe.eol();)pe.start=pe.pos,J=nr(K,pe,se.state),c&&Xe.push(new mr(pe,J,$t(E.mode,se.state)));return c?Xe:new mr(pe,J,se.state)}function ma(e,n){if(e)for(;;){var h=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!h)break;e=e.slice(0,h.index)+e.slice(h.index+h[0].length);var c=h[1]?"bgClass":"textClass";n[c]==null?n[c]=h[2]:new RegExp("(?:^|\\s)"+h[2]+"(?:$|\\s)").test(n[c])||(n[c]+=" "+h[2])}return e}function da(e,n,h,c,E,K,J){var ie=h.flattenSpans;ie==null&&(ie=e.options.flattenSpans);var se=0,pe=null,Xe=new Hn(n,e.options.tabSize,c),nt,wt=e.options.addModeClass&&[null];for(n==""&&ma(un(h,c.state),K);!Xe.eol();){if(Xe.pos>e.options.maxHighlightLength?(ie=!1,J&&Xn(e,n,c,Xe.pos),Xe.pos=n.length,nt=null):nt=ma(nr(h,Xe,c.state,wt),K),wt){var _t=wt[0].name;_t&&(nt="m-"+(nt?_t+" "+nt:_t))}if(!ie||pe!=nt){for(;se<Xe.start;)se=Math.min(Xe.start,se+5e3),E(se,pe);pe=nt}Xe.start=Xe.pos}for(;se<Xe.pos;){var rn=Math.min(Xe.pos,se+5e3);E(rn,pe),se=rn}}function Zr(e,n,h){for(var c,E,K=e.doc,J=h?-1:n-(e.doc.mode.innerMode?1e3:100),ie=n;ie>J;--ie){if(ie<=K.first)return K.first;var se=yn(K,ie-1),pe=se.stateAfter;if(pe&&(!h||ie+(pe instanceof ue?pe.lookAhead:0)<=K.modeFrontier))return ie;var Xe=z(se.text,null,e.options.tabSize);(E==null||c>Xe)&&(E=ie-1,c=Xe)}return E}function za(e,n){if(e.modeFrontier=Math.min(e.modeFrontier,n),e.highlightFrontier<n-10)return;for(var h=e.first,c=n-1;c>h;c--){var E=yn(e,c).stateAfter;if(E&&(!(E instanceof ue)||c+E.lookAhead<n)){h=c+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,h)}var oi=!1,ua=!1;function Na(){oi=!0}function ti(){ua=!0}function Ga(e,n,h){this.marker=e,this.from=n,this.to=h}function ba(e,n){if(e)for(var h=0;h<e.length;++h){var c=e[h];if(c.marker==n)return c}}function zn(e,n){for(var h,c=0;c<e.length;++c)e[c]!=n&&(h||(h=[])).push(e[c]);return h}function bn(e,n){e.markedSpans=e.markedSpans?e.markedSpans.concat([n]):[n],n.marker.attachLine(e)}function kn(e,n,h){var c;if(e)for(var E=0;E<e.length;++E){var K=e[E],J=K.marker,ie=K.from==null||(J.inclusiveLeft?K.from<=n:K.from<n);if(ie||K.from==n&&J.type=="bookmark"&&(!h||!K.marker.insertLeft)){var se=K.to==null||(J.inclusiveRight?K.to>=n:K.to>n);(c||(c=[])).push(new Ga(J,K.from,se?null:K.to))}}return c}function Wn(e,n,h){var c;if(e)for(var E=0;E<e.length;++E){var K=e[E],J=K.marker,ie=K.to==null||(J.inclusiveRight?K.to>=n:K.to>n);if(ie||K.from==n&&J.type=="bookmark"&&(!h||K.marker.insertLeft)){var se=K.from==null||(J.inclusiveLeft?K.from<=n:K.from<n);(c||(c=[])).push(new Ga(J,se?null:K.from-n,K.to==null?null:K.to-n))}}return c}function dr(e,n){if(n.full)return null;var h=Qr(e,n.from.line)&&yn(e,n.from.line).markedSpans,c=Qr(e,n.to.line)&&yn(e,n.to.line).markedSpans;if(!h&&!c)return null;var E=n.from.ch,K=n.to.ch,J=ir(n.from,n.to)==0,ie=kn(h,E,J),se=Wn(c,K,J),pe=n.text.length==1,Xe=oe(n.text).length+(pe?E:0);if(ie)for(var nt=0;nt<ie.length;++nt){var wt=ie[nt];if(wt.to==null){var _t=ba(se,wt.marker);_t?pe&&(wt.to=_t.to==null?null:_t.to+Xe):wt.to=E}}if(se)for(var rn=0;rn<se.length;++rn){var _n=se[rn];if(_n.to!=null&&(_n.to+=Xe),_n.from==null){var In=ba(ie,_n.marker);In||(_n.from=Xe,pe&&(ie||(ie=[])).push(_n))}else _n.from+=Xe,pe&&(ie||(ie=[])).push(_n)}ie&&(ie=ne(ie)),se&&se!=ie&&(se=ne(se));var jn=[ie];if(!pe){var Jn=n.text.length-2,Fn;if(Jn>0&&ie)for(var rr=0;rr<ie.length;++rr)ie[rr].to==null&&(Fn||(Fn=[])).push(new Ga(ie[rr].marker,null,null));for(var wr=0;wr<Jn;++wr)jn.push(Fn);jn.push(se)}return jn}function ne(e){for(var n=0;n<e.length;++n){var h=e[n];h.from!=null&&h.from==h.to&&h.marker.clearWhenEmpty!==!1&&e.splice(n--,1)}return e.length?e:null}function Re(e,n,h){var c=null;if(e.iter(n.line,h.line+1,function(_t){if(_t.markedSpans)for(var rn=0;rn<_t.markedSpans.length;++rn){var _n=_t.markedSpans[rn].marker;_n.readOnly&&(!c||re(c,_n)==-1)&&(c||(c=[])).push(_n)}}),!c)return null;for(var E=[{from:n,to:h}],K=0;K<c.length;++K)for(var J=c[K],ie=J.find(0),se=0;se<E.length;++se){var pe=E[se];if(ir(pe.to,ie.from)<0||ir(pe.from,ie.to)>0)continue;var Xe=[se,1],nt=ir(pe.from,ie.from),wt=ir(pe.to,ie.to);(nt<0||!J.inclusiveLeft&&!nt)&&Xe.push({from:pe.from,to:ie.from}),(wt>0||!J.inclusiveRight&&!wt)&&Xe.push({from:ie.to,to:pe.to}),E.splice.apply(E,Xe),se+=Xe.length-3}return E}function $e(e){var n=e.markedSpans;if(!n)return;for(var h=0;h<n.length;++h)n[h].marker.detachLine(e);e.markedSpans=null}function Be(e,n){if(!n)return;for(var h=0;h<n.length;++h)n[h].marker.attachLine(e);e.markedSpans=n}function Ye(e){return e.inclusiveLeft?-1:0}function et(e){return e.inclusiveRight?1:0}function it(e,n){var h=e.lines.length-n.lines.length;if(h!=0)return h;var c=e.find(),E=n.find(),K=ir(c.from,E.from)||Ye(e)-Ye(n);if(K)return-K;var J=ir(c.to,E.to)||et(e)-et(n);return J||n.id-e.id}function Ae(e,n){var h=ua&&e.markedSpans,c;if(h)for(var E=void 0,K=0;K<h.length;++K)E=h[K],E.marker.collapsed&&(n?E.from:E.to)==null&&(!c||it(c,E.marker)<0)&&(c=E.marker);return c}function ze(e){return Ae(e,!0)}function yt(e){return Ae(e,!1)}function en(e,n){var h=ua&&e.markedSpans,c;if(h)for(var E=0;E<h.length;++E){var K=h[E];K.marker.collapsed&&(K.from==null||K.from<n)&&(K.to==null||K.to>n)&&(!c||it(c,K.marker)<0)&&(c=K.marker)}return c}function Tt(e,n,h,c,E){var K=yn(e,n),J=ua&&K.markedSpans;if(J)for(var ie=0;ie<J.length;++ie){var se=J[ie];if(!se.marker.collapsed)continue;var pe=se.marker.find(0),Xe=ir(pe.from,h)||Ye(se.marker)-Ye(E),nt=ir(pe.to,c)||et(se.marker)-et(E);if(Xe>=0&&nt<=0||Xe<=0&&nt>=0)continue;if(Xe<=0&&(se.marker.inclusiveRight&&E.inclusiveLeft?ir(pe.to,h)>=0:ir(pe.to,h)>0)||Xe>=0&&(se.marker.inclusiveRight&&E.inclusiveLeft?ir(pe.from,c)<=0:ir(pe.from,c)<0))return!0}}function vt(e){for(var n;n=ze(e);)e=n.find(-1,!0).line;return e}function ct(e){for(var n;n=yt(e);)e=n.find(1,!0).line;return e}function St(e){for(var n,h;n=yt(e);)e=n.find(1,!0).line,(h||(h=[])).push(e);return h}function Ut(e,n){var h=yn(e,n),c=vt(h);return h==c?n:cr(c)}function At(e,n){if(n>e.lastLine())return n;var h=yn(e,n),c;if(!on(e,h))return n;for(;c=yt(h);)h=c.find(1,!0).line;return cr(h)+1}function on(e,n){var h=ua&&n.markedSpans;if(h)for(var c=void 0,E=0;E<h.length;++E){if(c=h[E],!c.marker.collapsed)continue;if(c.from==null)return!0;if(c.marker.widgetNode)continue;if(c.from==0&&c.marker.inclusiveLeft&&xn(e,n,c))return!0}}function xn(e,n,h){if(h.to==null){var c=h.marker.find(1,!0);return xn(e,c.line,ba(c.line.markedSpans,h.marker))}if(h.marker.inclusiveRight&&h.to==n.text.length)return!0;for(var E=void 0,K=0;K<n.markedSpans.length;++K)if(E=n.markedSpans[K],E.marker.collapsed&&!E.marker.widgetNode&&E.from==h.to&&(E.to==null||E.to!=h.from)&&(E.marker.inclusiveLeft||h.marker.inclusiveRight)&&xn(e,n,E))return!0}function vn(e){e=vt(e);for(var n=0,h=e.parent,c=0;c<h.lines.length;++c){var E=h.lines[c];if(E==e)break;n+=E.height}for(var K=h.parent;K;h=K,K=h.parent)for(var J=0;J<K.children.length;++J){var ie=K.children[J];if(ie==h)break;n+=ie.height}return n}function Qt(e){if(e.height==0)return 0;for(var n=e.text.length,h,c=e;h=ze(c);){var E=h.find(0,!0);c=E.from.line,n+=E.from.ch-E.to.ch}for(c=e;h=yt(c);){var K=h.find(0,!0);n-=c.text.length-K.from.ch,c=K.to.line,n+=c.text.length-K.to.ch}return n}function Dn(e){var n=e.display,h=e.doc;n.maxLine=yn(h,h.first),n.maxLineLength=Qt(n.maxLine),n.maxLineChanged=!0,h.iter(function(c){var E=Qt(c);E>n.maxLineLength&&(n.maxLineLength=E,n.maxLine=c)})}var Rn=function(e,n,h){this.text=e,Be(this,n),this.height=h?h(this):1};Rn.prototype.lineNo=function(){return cr(this)},Le(Rn);function zt(e,n,h,c){e.text=n,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),$e(e),Be(e,h);var E=c?c(e):1;E!=e.height&&ar(e,E)}function Kt(e){e.parent=null,$e(e)}var Cn={},Zt={};function Nn(e,n){if(!e||/^\s*$/.test(e))return null;var h=n.addModeClass?Zt:Cn;return h[e]||(h[e]=e.replace(/\S+/g,"cm-$&"))}function Vt(e,n){var h=y("span",null,null,r?"padding-right: .1px":null),c={pre:y("pre",[h],"CodeMirror-line"),content:h,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};n.measure={};for(var E=0;E<=(n.rest?n.rest.length:0);E++){var K=E?n.rest[E-1]:n.line,J=void 0;c.pos=0,c.addToken=Lt,Gt(e.display.measure)&&(J=sn(K,e.doc.direction))&&(c.addToken=sr(c.addToken,J)),c.map=[];var ie=n!=e.display.externalMeasured&&cr(K);Mn(K,c,Jt(e,K,ie)),K.styleClasses&&(K.styleClasses.bgClass&&(c.bgClass=R(K.styleClasses.bgClass,c.bgClass||"")),K.styleClasses.textClass&&(c.textClass=R(K.styleClasses.textClass,c.textClass||""))),c.map.length==0&&c.map.push(0,0,c.content.appendChild(An(e.display.measure))),E==0?(n.measure.map=c.map,n.measure.cache={}):((n.measure.maps||(n.measure.maps=[])).push(c.map),(n.measure.caches||(n.measure.caches=[])).push({}))}if(r){var se=c.content.lastChild;(/\bcm-tab\b/.test(se.className)||se.querySelector&&se.querySelector(".cm-tab"))&&(c.content.className="cm-tab-wrap-hack")}return dt(e,"renderLine",e,n.line,c.pre),c.pre.className&&(c.textClass=R(c.pre.className,c.textClass||"")),c}function Un(e){var n=m("span","\u2022","cm-invalidchar");return n.title="\\u"+e.charCodeAt(0).toString(16),n.setAttribute("aria-label",n.title),n}function Lt(e,n,h,c,E,K,J){if(!n)return;var ie=e.splitSpaces?kt(n,e.trailingSpace):n,se=e.cm.state.specialChars,pe=!1,Xe;if(!se.test(n))e.col+=n.length,Xe=document.createTextNode(ie),e.map.push(e.pos,e.pos+n.length,Xe),W&&C<9&&(pe=!0),e.pos+=n.length;else{Xe=document.createDocumentFragment();for(var nt=0;;){se.lastIndex=nt;var wt=se.exec(n),_t=wt?wt.index-nt:n.length-nt;if(_t){var rn=document.createTextNode(ie.slice(nt,nt+_t));W&&C<9?Xe.appendChild(m("span",[rn])):Xe.appendChild(rn),e.map.push(e.pos,e.pos+_t,rn),e.col+=_t,e.pos+=_t}if(!wt)break;nt+=_t+1;var _n=void 0;if(wt[0]==" "){var In=e.cm.options.tabSize,jn=In-e.col%In;_n=Xe.appendChild(m("span",ye(jn),"cm-tab")),_n.setAttribute("role","presentation"),_n.setAttribute("cm-text"," "),e.col+=jn}else wt[0]=="\r"||wt[0]==`
`?(_n=Xe.appendChild(m("span",wt[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),_n.setAttribute("cm-text",wt[0]),e.col+=1):(_n=e.cm.options.specialCharPlaceholder(wt[0]),_n.setAttribute("cm-text",wt[0]),W&&C<9?Xe.appendChild(m("span",[_n])):Xe.appendChild(_n),e.col+=1);e.map.push(e.pos,e.pos+1,_n),e.pos++}}if(e.trailingSpace=ie.charCodeAt(n.length-1)==32,h||c||E||pe||K||J){var Jn=h||"";c&&(Jn+=c),E&&(Jn+=E);var Fn=m("span",[Xe],Jn,K);if(J)for(var rr in J)J.hasOwnProperty(rr)&&rr!="style"&&rr!="class"&&Fn.setAttribute(rr,J[rr]);return e.content.appendChild(Fn)}e.content.appendChild(Xe)}function kt(e,n){if(e.length>1&&!/ /.test(e))return e;for(var h=n,c="",E=0;E<e.length;E++){var K=e.charAt(E);K==" "&&h&&(E==e.length-1||e.charCodeAt(E+1)==32)&&(K="\xA0"),c+=K,h=K==" "}return c}function sr(e,n){return function(h,c,E,K,J,ie,se){E=E?E+" cm-force-border":"cm-force-border";for(var pe=h.pos,Xe=pe+c.length;;){for(var nt=void 0,wt=0;wt<n.length&&!(nt=n[wt],nt.to>pe&&nt.from<=pe);wt++);if(nt.to>=Xe)return e(h,c,E,K,J,ie,se);e(h,c.slice(0,nt.to-pe),E,K,null,ie,se),K=null,c=c.slice(nt.to-pe),pe=nt.to}}}function Sn(e,n,h,c){var E=!c&&h.widgetNode;E&&e.map.push(e.pos,e.pos+n,E),!c&&e.cm.display.input.needsContentAttribute&&(E||(E=e.content.appendChild(document.createElement("span"))),E.setAttribute("cm-marker",h.id)),E&&(e.cm.display.input.setUneditable(E),e.content.appendChild(E)),e.pos+=n,e.trailingSpace=!1}function Mn(e,n,h){var c=e.markedSpans,E=e.text,K=0;if(!c){for(var J=1;J<h.length;J+=2)n.addToken(n,E.slice(K,K=h[J]),Nn(h[J+1],n.cm.options));return}for(var ie=E.length,se=0,pe=1,Xe="",nt,wt,_t=0,rn,_n,In,jn,Jn;;){if(_t==se){rn=_n=In=wt="",Jn=null,jn=null,_t=Infinity;for(var Fn=[],rr=void 0,wr=0;wr<c.length;++wr){var gr=c[wr],Fr=gr.marker;if(Fr.type=="bookmark"&&gr.from==se&&Fr.widgetNode)Fn.push(Fr);else if(gr.from<=se&&(gr.to==null||gr.to>se||Fr.collapsed&&gr.to==se&&gr.from==se)){if(gr.to!=null&&gr.to!=se&&_t>gr.to&&(_t=gr.to,_n=""),Fr.className&&(rn+=" "+Fr.className),Fr.css&&(wt=(wt?wt+";":"")+Fr.css),Fr.startStyle&&gr.from==se&&(In+=" "+Fr.startStyle),Fr.endStyle&&gr.to==_t&&(rr||(rr=[])).push(Fr.endStyle,gr.to),Fr.title&&((Jn||(Jn={})).title=Fr.title),Fr.attributes)for(var pa in Fr.attributes)(Jn||(Jn={}))[pa]=Fr.attributes[pa];Fr.collapsed&&(!jn||it(jn.marker,Fr)<0)&&(jn=gr)}else gr.from>se&&_t>gr.from&&(_t=gr.from)}if(rr)for(var $a=0;$a<rr.length;$a+=2)rr[$a+1]==_t&&(_n+=" "+rr[$a]);if(!jn||jn.from==se)for(var Sa=0;Sa<Fn.length;++Sa)Sn(n,0,Fn[Sa]);if(jn&&(jn.from||0)==se){if(Sn(n,(jn.to==null?ie+1:jn.to)-se,jn.marker,jn.from==null),jn.to==null)return;jn.to==se&&(jn=!1)}}if(se>=ie)break;for(var vi=Math.min(ie,_t);;){if(Xe){var hi=se+Xe.length;if(!jn){var Fa=hi>vi?Xe.slice(0,vi-se):Xe;n.addToken(n,Fa,nt?nt+rn:rn,In,se+Fa.length==_t?_n:"",wt,Jn)}if(hi>=vi){Xe=Xe.slice(vi-se),se=vi;break}se=hi,In=""}Xe=E.slice(K,K=h[pe++]),nt=Nn(h[pe++],n.cm.options)}}}function wn(e,n,h){this.line=n,this.rest=St(n),this.size=this.rest?cr(oe(this.rest))-h+1:1,this.node=this.text=null,this.hidden=on(e,n)}function an(e,n,h){for(var c=[],E,K=n;K<h;K=E){var J=new wn(e.doc,yn(e.doc,K),K);E=K+J.size,c.push(J)}return c}var Yt=null;function Gn(e){Yt?Yt.ops.push(e):e.ownsGroup=Yt={ops:[e],delayedCallbacks:[]}}function mn(e){var n=e.delayedCallbacks,h=0;do{for(;h<n.length;h++)n[h].call(null);for(var c=0;c<e.ops.length;c++){var E=e.ops[c];if(E.cursorActivityHandlers)for(;E.cursorActivityCalled<E.cursorActivityHandlers.length;)E.cursorActivityHandlers[E.cursorActivityCalled++].call(null,E.cm)}}while(h<n.length)}function Wt(e,n){var h=e.ownsGroup;if(!h)return;try{mn(h)}finally{Yt=null,n(h)}}var Ht=null;function dn(e,n){var h=Et(e,n);if(!h.length)return;var c=Array.prototype.slice.call(arguments,2),E;Yt?E=Yt.delayedCallbacks:Ht?E=Ht:(E=Ht=[],setTimeout(Xt,0));for(var K=function(ie){E.push(function(){return h[ie].apply(null,c)})},J=0;J<h.length;++J)K(J)}function Xt(){var e=Ht;Ht=null;for(var n=0;n<e.length;++n)e[n]()}function ln(e,n,h,c){for(var E=0;E<n.changes.length;E++){var K=n.changes[E];K=="text"?Tr(e,n):K=="gutter"?Yn(e,n,h,c):K=="class"?$n(e,n):K=="widget"&&$r(e,n,c)}n.changes=null}function Zn(e){return e.node==e.text&&(e.node=m("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),W&&C<8&&(e.node.style.zIndex=2)),e.node}function qn(e,n){var h=n.bgClass?n.bgClass+" "+(n.line.bgClass||""):n.line.bgClass;if(h&&(h+=" CodeMirror-linebackground"),n.background)h?n.background.className=h:(n.background.parentNode.removeChild(n.background),n.background=null);else if(h){var c=Zn(n);n.background=c.insertBefore(m("div",null,h),c.firstChild),e.display.input.setUneditable(n.background)}}function En(e,n){var h=e.display.externalMeasured;return h&&h.line==n.line?(e.display.externalMeasured=null,n.measure=h.measure,h.built):Vt(e,n)}function Tr(e,n){var h=n.text.className,c=En(e,n);n.text==n.node&&(n.node=c.pre),n.text.parentNode.replaceChild(c.pre,n.text),n.text=c.pre,c.bgClass!=n.bgClass||c.textClass!=n.textClass?(n.bgClass=c.bgClass,n.textClass=c.textClass,$n(e,n)):h&&(n.text.className=h)}function $n(e,n){qn(e,n),n.line.wrapClass?Zn(n).className=n.line.wrapClass:n.node!=n.text&&(n.node.className="");var h=n.textClass?n.textClass+" "+(n.line.textClass||""):n.line.textClass;n.text.className=h||""}function Yn(e,n,h,c){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 E=Zn(n);n.gutterBackground=m("div",null,"CodeMirror-gutter-background "+n.line.gutterClass,"left: "+(e.options.fixedGutter?c.fixedPos:-c.gutterTotalWidth)+"px; width: "+c.gutterTotalWidth+"px"),e.display.input.setUneditable(n.gutterBackground),E.insertBefore(n.gutterBackground,n.text)}var K=n.line.gutterMarkers;if(e.options.lineNumbers||K){var J=Zn(n),ie=n.gutter=m("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?c.fixedPos:-c.gutterTotalWidth)+"px");if(e.display.input.setUneditable(ie),J.insertBefore(ie,n.text),n.line.gutterClass&&(ie.className+=" "+n.line.gutterClass),e.options.lineNumbers&&(!K||!K["CodeMirror-linenumbers"])&&(n.lineNumber=ie.appendChild(m("div",ca(e.options,h),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+c.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),K)for(var se=0;se<e.display.gutterSpecs.length;++se){var pe=e.display.gutterSpecs[se].className,Xe=K.hasOwnProperty(pe)&&K[pe];Xe&&ie.appendChild(m("div",[Xe],"CodeMirror-gutter-elt","left: "+c.gutterLeft[pe]+"px; width: "+c.gutterWidth[pe]+"px"))}}}function $r(e,n,h){n.alignable&&(n.alignable=null);for(var c=P("CodeMirror-linewidget"),E=n.node.firstChild,K=void 0;E;E=K)K=E.nextSibling,c.test(E.className)&&n.node.removeChild(E);aa(e,n,h)}function Gr(e,n,h,c){var E=En(e,n);return n.text=n.node=E.pre,E.bgClass&&(n.bgClass=E.bgClass),E.textClass&&(n.textClass=E.textClass),$n(e,n),Yn(e,n,h,c),aa(e,n,c),n.node}function aa(e,n,h){if(Ta(e,n.line,n,h,!0),n.rest)for(var c=0;c<n.rest.length;c++)Ta(e,n.rest[c],n,h,!1)}function Ta(e,n,h,c,E){if(!n.widgets)return;for(var K=Zn(h),J=0,ie=n.widgets;J<ie.length;++J){var se=ie[J],pe=m("div",[se.node],"CodeMirror-linewidget"+(se.className?" "+se.className:""));se.handleMouseEvents||pe.setAttribute("cm-ignore-events","true"),Ra(se,pe,h,c),e.display.input.setUneditable(pe),E&&se.above?K.insertBefore(pe,h.gutter||h.text):K.appendChild(pe),dn(se,"redraw")}}function Ra(e,n,h,c){if(e.noHScroll){(h.alignable||(h.alignable=[])).push(n);var E=c.wrapperWidth;n.style.left=c.fixedPos+"px",e.coverGutter||(E-=c.gutterTotalWidth,n.style.paddingLeft=c.gutterTotalWidth+"px"),n.style.width=E+"px"}e.coverGutter&&(n.style.zIndex=5,n.style.position="relative",e.noHScroll||(n.style.marginLeft=-c.gutterTotalWidth+"px"))}function ha(e){if(e.height!=null)return e.height;var n=e.doc.cm;if(!n)return 0;if(!O(document.body,e.node)){var h="position: relative;";e.coverGutter&&(h+="margin-left: -"+n.display.gutters.offsetWidth+"px;"),e.noHScroll&&(h+="width: "+n.display.wrapper.clientWidth+"px;"),g(n.display.measure,m("div",[e.node],null,h))}return e.height=e.node.parentNode.offsetHeight}function _a(e,n){for(var h=Ue(n);h!=e.wrapper;h=h.parentNode)if(!h||h.nodeType==1&&h.getAttribute("cm-ignore-events")=="true"||h.parentNode==e.sizer&&h!=e.mover)return!0}function ta(e){return e.lineSpace.offsetTop}function Me(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function tt(e){if(e.cachedPaddingH)return e.cachedPaddingH;var n=g(e.measure,m("pre","x","CodeMirror-line-like")),h=window.getComputedStyle?window.getComputedStyle(n):n.currentStyle,c={left:parseInt(h.paddingLeft),right:parseInt(h.paddingRight)};return!isNaN(c.left)&&!isNaN(c.right)&&(e.cachedPaddingH=c),c}function ot(e){return le-e.display.nativeBarWidth}function je(e){return e.display.scroller.clientWidth-ot(e)-e.display.barWidth}function ce(e){return e.display.scroller.clientHeight-ot(e)-e.display.barHeight}function Oe(e,n,h){var c=e.options.lineWrapping,E=c&&je(e);if(!n.measure.heights||c&&n.measure.width!=E){var K=n.measure.heights=[];if(c){n.measure.width=E;for(var J=n.text.firstChild.getClientRects(),ie=0;ie<J.length-1;ie++){var se=J[ie],pe=J[ie+1];Math.abs(se.bottom-pe.bottom)>2&&K.push((se.bottom+pe.top)/2-h.top)}}K.push(h.bottom-h.top)}}function me(e,n,h){if(e.line==n)return{map:e.measure.map,cache:e.measure.cache};for(var c=0;c<e.rest.length;c++)if(e.rest[c]==n)return{map:e.measure.maps[c],cache:e.measure.caches[c]};for(var E=0;E<e.rest.length;E++)if(cr(e.rest[E])>h)return{map:e.measure.maps[E],cache:e.measure.caches[E],before:!0}}function ke(e,n){n=vt(n);var h=cr(n),c=e.display.externalMeasured=new wn(e.doc,n,h);c.lineN=h;var E=c.built=Vt(e,c);return c.text=E.pre,g(e.display.lineMeasure,E.pre),c}function Ge(e,n,h,c){return pt(e,Je(e,n),h,c)}function ut(e,n){if(n>=e.display.viewFrom&&n<e.display.viewTo)return e.display.view[ea(e,n)];var h=e.display.externalMeasured;if(h&&n>=h.lineN&&n<h.lineN+h.size)return h}function Je(e,n){var h=cr(n),c=ut(e,h);c&&!c.text?c=null:c&&c.changes&&(ln(e,c,h,pr(e)),e.curOp.forceUpdate=!0),c||(c=ke(e,n));var E=me(c,n,h);return{line:n,view:c,rect:null,map:E.map,cache:E.cache,before:E.before,hasHeights:!1}}function pt(e,n,h,c,E){n.before&&(h=-1);var K=h+(c||""),J;return n.cache.hasOwnProperty(K)?J=n.cache[K]:(n.rect||(n.rect=n.view.text.getBoundingClientRect()),n.hasHeights||(Oe(e,n.view,n.rect),n.hasHeights=!0),J=Tn(e,n,h,c),J.bogus||(n.cache[K]=J)),{left:J.left,right:J.right,top:E?J.rtop:J.top,bottom:E?J.rbottom:J.bottom}}var Nt={left:0,right:0,top:0,bottom:0};function tn(e,n,h){for(var c,E,K,J,ie,se,pe=0;pe<e.length;pe+=3)if(ie=e[pe],se=e[pe+1],n<ie?(E=0,K=1,J="left"):n<se?(E=n-ie,K=E+1):(pe==e.length-3||n==se&&e[pe+3]>n)&&(K=se-ie,E=K-1,n>=se&&(J="right")),E!=null){if(c=e[pe+2],ie==se&&h==(c.insertLeft?"left":"right")&&(J=h),h=="left"&&E==0)for(;pe&&e[pe-2]==e[pe-3]&&e[pe-1].insertLeft;)c=e[(pe-=3)+2],J="left";if(h=="right"&&E==se-ie)for(;pe<e.length-3&&e[pe+3]==e[pe+4]&&!e[pe+5].insertLeft;)c=e[(pe+=3)+2],J="right";break}return{node:c,start:E,end:K,collapse:J,coverStart:ie,coverEnd:se}}function fn(e,n){var h=Nt;if(n=="left")for(var c=0;c<e.length&&!((h=e[c]).left!=h.right);c++);else for(var E=e.length-1;E>=0&&!((h=e[E]).left!=h.right);E--);return h}function Tn(e,n,h,c){var E=tn(n.map,h,c),K=E.node,J=E.start,ie=E.end,se=E.collapse,pe;if(K.nodeType==3){for(var Xe=0;Xe<4;Xe++){for(;J&&ge(n.line.text.charAt(E.coverStart+J));)--J;for(;E.coverStart+ie<E.coverEnd&&ge(n.line.text.charAt(E.coverStart+ie));)++ie;if(W&&C<9&&J==0&&ie==E.coverEnd-E.coverStart?pe=K.parentNode.getBoundingClientRect():pe=fn(x(K,J,ie).getClientRects(),c),pe.left||pe.right||J==0)break;ie=J,J=J-1,se="right"}W&&C<11&&(pe=Kn(e.display.measure,pe))}else{J>0&&(se=c="right");var nt;e.options.lineWrapping&&(nt=K.getClientRects()).length>1?pe=nt[c=="right"?nt.length-1:0]:pe=K.getBoundingClientRect()}if(W&&C<9&&!J&&(!pe||!pe.left&&!pe.right)){var wt=K.parentNode.getClientRects()[0];wt?pe={left:wt.left,right:wt.left+Ir(e.display),top:wt.top,bottom:wt.bottom}:pe=Nt}for(var _t=pe.top-n.rect.top,rn=pe.bottom-n.rect.top,_n=(_t+rn)/2,In=n.view.measure.heights,jn=0;jn<In.length-1&&!(_n<In[jn]);jn++);var Jn=jn?In[jn-1]:0,Fn=In[jn],rr={left:(se=="right"?pe.right:pe.left)-n.rect.left,right:(se=="left"?pe.left:pe.right)-n.rect.left,top:Jn,bottom:Fn};return!pe.left&&!pe.right&&(rr.bogus=!0),e.options.singleCursorHeightPerLine||(rr.rtop=_t,rr.rbottom=rn),rr}function Kn(e,n){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ie(e))return n;var h=screen.logicalXDPI/screen.deviceXDPI,c=screen.logicalYDPI/screen.deviceYDPI;return{left:n.left*h,right:n.right*h,top:n.top*c,bottom:n.bottom*c}}function fr(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 lr(e){e.display.externalMeasure=null,b(e.display.lineMeasure);for(var n=0;n<e.display.view.length;n++)fr(e.display.view[n])}function yr(e){lr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function br(){return v&&t?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function vr(){return v&&t?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Er(e){var n=0;if(e.widgets)for(var h=0;h<e.widgets.length;++h)e.widgets[h].above&&(n+=ha(e.widgets[h]));return n}function Rr(e,n,h,c,E){if(!E){var K=Er(n);h.top+=K,h.bottom+=K}if(c=="line")return h;c||(c="local");var J=vn(n);if(c=="local"?J+=ta(e.display):J-=e.display.viewOffset,c=="page"||c=="window"){var ie=e.display.lineSpace.getBoundingClientRect();J+=ie.top+(c=="window"?0:vr());var se=ie.left+(c=="window"?0:br());h.left+=se,h.right+=se}return h.top+=J,h.bottom+=J,h}function hr(e,n,h){if(h=="div")return n;var c=n.left,E=n.top;if(h=="page")c-=br(),E-=vr();else if(h=="local"||!h){var K=e.display.sizer.getBoundingClientRect();c+=K.left,E+=K.top}var J=e.display.lineSpace.getBoundingClientRect();return{left:c-J.left,top:E-J.top}}function Nr(e,n,h,c,E){return c||(c=yn(e.doc,n.line)),Rr(e,c,Ge(e,c,n.ch,E),h)}function or(e,n,h,c,E,K){c=c||yn(e.doc,n.line),E||(E=Je(e,c));function J(rn,_n){var In=pt(e,E,rn,_n?"right":"left",K);return _n?In.left=In.right:In.right=In.left,Rr(e,c,In,h)}var ie=sn(c,e.doc.direction),se=n.ch,pe=n.sticky;if(se>=c.text.length?(se=c.text.length,pe="before"):se<=0&&(se=0,pe="after"),!ie)return J(pe=="before"?se-1:se,pe=="before");function Xe(rn,_n,In){var jn=ie[_n],Jn=jn.level==1;return J(In?rn-1:rn,Jn!=In)}var nt=qe(ie,se,pe),wt=jt,_t=Xe(se,nt,pe=="before");return wt!=null&&(_t.other=Xe(se,wt,pe!="before")),_t}function pn(e,n){var h=0;n=N(e.doc,n),e.options.lineWrapping||(h=Ir(e.display)*n.ch);var c=yn(e.doc,n.line),E=vn(c)+ta(e.display);return{left:h,right:h,top:E,bottom:E+c.height}}function Ln(e,n,h,c,E){var K=hn(e,n,h);return K.xRel=E,c&&(K.outside=c),K}function xr(e,n,h){var c=e.doc;if(h+=e.display.viewOffset,h<0)return Ln(c.first,0,null,-1,-1);var E=Pr(c,h),K=c.first+c.size-1;if(E>K)return Ln(c.first+c.size-1,yn(c,K).text.length,null,1,1);n<0&&(n=0);for(var J=yn(c,E);;){var ie=qr(e,J,E,n,h),se=en(J,ie.ch+(ie.xRel>0||ie.outside>0?1:0));if(!se)return ie;var pe=se.find(1);if(pe.line==E)return pe;J=yn(c,E=pe.line)}}function Dr(e,n,h,c){c-=Er(n);var E=n.text.length,K=ft(function(J){return pt(e,h,J-1).bottom<=c},E,0);return E=ft(function(J){return pt(e,h,J).top>c},K,E),{begin:K,end:E}}function Qn(e,n,h,c){h||(h=Je(e,n));var E=Rr(e,n,pt(e,h,c),"line").top;return Dr(e,n,h,E)}function Ar(e,n,h,c){return e.bottom<=h?!1:e.top>h?!0:(c?e.left:e.right)>n}function qr(e,n,h,c,E){E-=vn(n);var K=Je(e,n),J=Er(n),ie=0,se=n.text.length,pe=!0,Xe=sn(n,e.doc.direction);if(Xe){var nt=(e.options.lineWrapping?Ur:Lr)(e,n,h,K,Xe,c,E);pe=nt.level!=1,ie=pe?nt.from:nt.to-1,se=pe?nt.to:nt.from-1}var wt=null,_t=null,rn=ft(function(wr){var gr=pt(e,K,wr);return gr.top+=J,gr.bottom+=J,Ar(gr,c,E,!1)?(gr.top<=E&&gr.left<=c&&(wt=wr,_t=gr),!0):!1},ie,se),_n,In,jn=!1;if(_t){var Jn=c-_t.left<_t.right-c,Fn=Jn==pe;rn=wt+(Fn?0:1),In=Fn?"after":"before",_n=Jn?_t.left:_t.right}else{!pe&&(rn==se||rn==ie)&&rn++,In=rn==0?"after":rn==n.text.length?"before":pt(e,K,rn-(pe?1:0)).bottom+J<=E==pe?"after":"before";var rr=or(e,hn(h,rn,In),"line",n,K);_n=rr.left,jn=E<rr.top?-1:E>=rr.bottom?1:0}return rn=we(n.text,rn,1),Ln(h,rn,In,jn,c-_n)}function Lr(e,n,h,c,E,K,J){var ie=ft(function(nt){var wt=E[nt],_t=wt.level!=1;return Ar(or(e,hn(h,_t?wt.to:wt.from,_t?"before":"after"),"line",n,c),K,J,!0)},0,E.length-1),se=E[ie];if(ie>0){var pe=se.level!=1,Xe=or(e,hn(h,pe?se.from:se.to,pe?"after":"before"),"line",n,c);Ar(Xe,K,J,!0)&&Xe.top>J&&(se=E[ie-1])}return se}function Ur(e,n,h,c,E,K,J){var ie=Dr(e,n,c,J),se=ie.begin,pe=ie.end;/\s/.test(n.text.charAt(pe-1))&&pe--;for(var Xe=null,nt=null,wt=0;wt<E.length;wt++){var _t=E[wt];if(_t.from>=pe||_t.to<=se)continue;var rn=_t.level!=1,_n=pt(e,c,rn?Math.min(pe,_t.to)-1:Math.max(se,_t.from)).right,In=_n<K?K-_n+1e9:_n-K;(!Xe||nt>In)&&(Xe=_t,nt=In)}return Xe||(Xe=E[E.length-1]),Xe.from<se&&(Xe={from:se,to:Xe.to,level:Xe.level}),Xe.to>pe&&(Xe={from:Xe.from,to:pe,level:Xe.level}),Xe}var Wr;function Br(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Wr==null){Wr=m("pre",null,"CodeMirror-line-like");for(var n=0;n<49;++n)Wr.appendChild(document.createTextNode("x")),Wr.appendChild(m("br"));Wr.appendChild(document.createTextNode("x"))}g(e.measure,Wr);var h=Wr.offsetHeight/50;return h>3&&(e.cachedTextHeight=h),b(e.measure),h||1}function Ir(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var n=m("span","xxxxxxxxxx"),h=m("pre",[n],"CodeMirror-line-like");g(e.measure,h);var c=n.getBoundingClientRect(),E=(c.right-c.left)/10;return E>2&&(e.cachedCharWidth=E),E||10}function pr(e){for(var n=e.display,h={},c={},E=n.gutters.clientLeft,K=n.gutters.firstChild,J=0;K;K=K.nextSibling,++J){var ie=e.display.gutterSpecs[J].className;h[ie]=K.offsetLeft+K.clientLeft+E,c[ie]=K.clientWidth}return{fixedPos:na(n),gutterTotalWidth:n.gutters.offsetWidth,gutterLeft:h,gutterWidth:c,wrapperWidth:n.wrapper.clientWidth}}function na(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ni(e){var n=Br(e.display),h=e.options.lineWrapping,c=h&&Math.max(5,e.display.scroller.clientWidth/Ir(e.display)-3);return function(E){if(on(e.doc,E))return 0;var K=0;if(E.widgets)for(var J=0;J<E.widgets.length;J++)E.widgets[J].height&&(K+=E.widgets[J].height);return h?K+(Math.ceil(E.text.length/c)||1)*n:K+n}}function La(e){var n=e.doc,h=ni(e);n.iter(function(c){var E=h(c);E!=c.height&&ar(c,E)})}function ya(e,n,h,c){var E=e.display;if(!h&&Ue(n).getAttribute("cm-not-content")=="true")return null;var K,J,ie=E.lineSpace.getBoundingClientRect();try{K=n.clientX-ie.left,J=n.clientY-ie.top}catch(nt){return null}var se=xr(e,K,J),pe;if(c&&se.xRel>0&&(pe=yn(e.doc,se.line).text).length==se.ch){var Xe=z(pe,pe.length,e.options.tabSize)-pe.length;se=hn(se.line,Math.max(0,Math.round((K-tt(e.display).left)/Ir(e.display))-Xe))}return se}function ea(e,n){if(n>=e.display.viewTo)return null;if(n-=e.display.viewFrom,n<0)return null;for(var h=e.display.view,c=0;c<h.length;c++)if(n-=h[c].size,n<0)return c}function Vr(e,n,h,c){n==null&&(n=e.doc.first),h==null&&(h=e.doc.first+e.doc.size),c||(c=0);var E=e.display;if(c&&h<E.viewTo&&(E.updateLineNumbers==null||E.updateLineNumbers>n)&&(E.updateLineNumbers=n),e.curOp.viewChanged=!0,n>=E.viewTo)ua&&Ut(e.doc,n)<E.viewTo&&ia(e);else if(h<=E.viewFrom)ua&&At(e.doc,h+c)>E.viewFrom?ia(e):(E.viewFrom+=c,E.viewTo+=c);else if(n<=E.viewFrom&&h>=E.viewTo)ia(e);else if(n<=E.viewFrom){var K=Ha(e,h,h+c,1);K?(E.view=E.view.slice(K.index),E.viewFrom=K.lineN,E.viewTo+=c):ia(e)}else if(h>=E.viewTo){var J=Ha(e,n,n,-1);J?(E.view=E.view.slice(0,J.index),E.viewTo=J.lineN):ia(e)}else{var ie=Ha(e,n,n,-1),se=Ha(e,h,h+c,1);ie&&se?(E.view=E.view.slice(0,ie.index).concat(an(e,ie.lineN,se.lineN)).concat(E.view.slice(se.index)),E.viewTo+=c):ia(e)}var pe=E.externalMeasured;pe&&(h<pe.lineN?pe.lineN+=c:n<pe.lineN+pe.size&&(E.externalMeasured=null))}function Yr(e,n,h){e.curOp.viewChanged=!0;var c=e.display,E=e.display.externalMeasured;if(E&&n>=E.lineN&&n<E.lineN+E.size&&(c.externalMeasured=null),n<c.viewFrom||n>=c.viewTo)return;var K=c.view[ea(e,n)];if(K.node==null)return;var J=K.changes||(K.changes=[]);re(J,h)==-1&&J.push(h)}function ia(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ha(e,n,h,c){var E=ea(e,n),K,J=e.display.view;if(!ua||h==e.doc.first+e.doc.size)return{index:E,lineN:h};for(var ie=e.display.viewFrom,se=0;se<E;se++)ie+=J[se].size;if(ie!=n){if(c>0){if(E==J.length-1)return null;K=ie+J[E].size-n,E++}else K=ie-n;n+=K,h+=K}for(;Ut(e.doc,h)!=h;){if(E==(c<0?0:J.length-1))return null;h+=c*J[E-(c<0?1:0)].size,E+=c}return{index:E,lineN:h}}function mi(e,n,h){var c=e.display,E=c.view;E.length==0||n>=c.viewTo||h<=c.viewFrom?(c.view=an(e,n,h),c.viewFrom=n):(c.viewFrom>n?c.view=an(e,n,c.viewFrom).concat(c.view):c.viewFrom<n&&(c.view=c.view.slice(ea(e,n))),c.viewFrom=n,c.viewTo<h?c.view=c.view.concat(an(e,c.viewTo,h)):c.viewTo>h&&(c.view=c.view.slice(0,ea(e,h)))),c.viewTo=h}function si(e){for(var n=e.display.view,h=0,c=0;c<n.length;c++){var E=n[c];!E.hidden&&(!E.node||E.changes)&&++h}return h}function Hr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Va(e,n){n===void 0&&(n=!0);for(var h=e.doc,c={},E=c.cursors=document.createDocumentFragment(),K=c.selection=document.createDocumentFragment(),J=0;J<h.sel.ranges.length;J++){if(!n&&J==h.sel.primIndex)continue;var ie=h.sel.ranges[J];if(ie.from().line>=e.display.viewTo||ie.to().line<e.display.viewFrom)continue;var se=ie.empty();(se||e.options.showCursorWhenSelecting)&&ri(e,ie.head,E),se||jr(e,ie,K)}return c}function ri(e,n,h){var c=or(e,n,"div",null,null,!e.options.singleCursorHeightPerLine),E=h.appendChild(m("div","\xA0","CodeMirror-cursor"));if(E.style.left=c.left+"px",E.style.top=c.top+"px",E.style.height=Math.max(0,c.bottom-c.top)*e.options.cursorHeight+"px",c.other){var K=h.appendChild(m("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));K.style.display="",K.style.left=c.other.left+"px",K.style.top=c.other.top+"px",K.style.height=(c.other.bottom-c.other.top)*.85+"px"}}function Jr(e,n){return e.top-n.top||e.left-n.left}function jr(e,n,h){var c=e.display,E=e.doc,K=document.createDocumentFragment(),J=tt(e.display),ie=J.left,se=Math.max(c.sizerWidth,je(e)-c.sizer.offsetLeft)-J.right,pe=E.direction=="ltr";function Xe(Fn,rr,wr,gr){rr<0&&(rr=0),rr=Math.round(rr),gr=Math.round(gr),K.appendChild(m("div",null,"CodeMirror-selected","position: absolute; left: "+Fn+`px;
top: `+rr+"px; width: "+(wr==null?se-Fn:wr)+`px;
height: `+(gr-rr)+"px"))}function nt(Fn,rr,wr){var gr=yn(E,Fn),Fr=gr.text.length,pa,$a;function Sa(Fa,fi){return Nr(e,hn(Fn,Fa),"div",gr,fi)}function vi(Fa,fi,ei){var Ka=Qn(e,gr,null,Fa),Ba=fi=="ltr"==(ei=="after")?"left":"right",Da=ei=="after"?Ka.begin:Ka.end-(/\s/.test(gr.text.charAt(Ka.end-1))?2:1);return Sa(Da,Ba)[Ba]}var hi=sn(gr,E.direction);return Pt(hi,rr||0,wr==null?Fr:wr,function(Fa,fi,ei,Ka){var Ba=ei=="ltr",Da=Sa(Fa,Ba?"left":"right"),pi=Sa(fi-1,Ba?"right":"left"),So=rr==null&&Fa==0,ao=wr==null&&fi==Fr,ii=Ka==0,ji=!hi||Ka==hi.length-1;if(pi.top-Da.top<=3){var Ja=(pe?So:ao)&&ii,ms=(pe?ao:So)&&ji,Ji=Ja?ie:(Ba?Da:pi).left,ho=ms?se:(Ba?pi:Da).right;Xe(Ji,Da.top,ho-Ji,Da.bottom)}else{var fo,ui,Ro,gs;Ba?(fo=pe&&So&&ii?ie:Da.left,ui=pe?se:vi(Fa,ei,"before"),Ro=pe?ie:vi(fi,ei,"after"),gs=pe&&ao&&ji?se:pi.right):(fo=pe?vi(Fa,ei,"before"):ie,ui=!pe&&So&&ii?se:Da.right,Ro=!pe&&ao&&ji?ie:pi.left,gs=pe?vi(fi,ei,"after"):se),Xe(fo,Da.top,ui-fo,Da.bottom),Da.bottom<pi.top&&Xe(ie,Da.bottom,null,pi.top),Xe(Ro,pi.top,gs-Ro,pi.bottom)}(!pa||Jr(Da,pa)<0)&&(pa=Da),Jr(pi,pa)<0&&(pa=pi),(!$a||Jr(Da,$a)<0)&&($a=Da),Jr(pi,$a)<0&&($a=pi)}),{start:pa,end:$a}}var wt=n.from(),_t=n.to();if(wt.line==_t.line)nt(wt.line,wt.ch,_t.ch);else{var rn=yn(E,wt.line),_n=yn(E,_t.line),In=vt(rn)==vt(_n),jn=nt(wt.line,wt.ch,In?rn.text.length+1:null).end,Jn=nt(_t.line,In?0:null,_t.ch).start;In&&(jn.top<Jn.top-2?(Xe(jn.right,jn.top,null,jn.bottom),Xe(ie,Jn.top,Jn.left,Jn.bottom)):Xe(jn.right,jn.top,Jn.left-jn.right,jn.bottom)),jn.bottom<Jn.top&&Xe(ie,jn.bottom,null,Jn.top)}h.appendChild(K)}function Ea(e){if(!e.state.focused)return;var n=e.display;clearInterval(n.blinker);var h=!0;n.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?n.blinker=setInterval(function(){e.hasFocus()||Ya(e),n.cursorDiv.style.visibility=(h=!h)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(n.cursorDiv.style.visibility="hidden")}function Si(e){e.state.focused||(e.display.input.focus(),Ma(e))}function Fi(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ya(e))},100)}function Ma(e,n){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(dt(e,"focus",e,n),e.state.focused=!0,F(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()),Ea(e)}function Ya(e,n){if(e.state.delayingBlurEvent)return;e.state.focused&&(dt(e,"blur",e,n),e.state.focused=!1,_(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Qa(e){for(var n=e.display,h=n.lineDiv.offsetTop,c=0;c<n.view.length;c++){var E=n.view[c],K=e.options.lineWrapping,J=void 0,ie=0;if(E.hidden)continue;if(W&&C<8){var se=E.node.offsetTop+E.node.offsetHeight;J=se-h,h=se}else{var pe=E.node.getBoundingClientRect();J=pe.bottom-pe.top,!K&&E.text.firstChild&&(ie=E.text.firstChild.getBoundingClientRect().right-pe.left-1)}var Xe=E.line.height-J;if((Xe>.005||Xe<-.005)&&(ar(E.line,J),Ei(E.line),E.rest))for(var nt=0;nt<E.rest.length;nt++)Ei(E.rest[nt]);if(ie>e.display.sizerWidth){var wt=Math.ceil(ie/Ir(e.display));wt>e.display.maxLineLength&&(e.display.maxLineLength=wt,e.display.maxLine=E.line,e.display.maxLineChanged=!0)}}}function Ei(e){if(e.widgets)for(var n=0;n<e.widgets.length;++n){var h=e.widgets[n],c=h.node.parentNode;c&&(h.height=c.offsetHeight)}}function Ri(e,n,h){var c=h&&h.top!=null?Math.max(0,h.top):e.scroller.scrollTop;c=Math.floor(c-ta(e));var E=h&&h.bottom!=null?h.bottom:c+e.wrapper.clientHeight,K=Pr(n,c),J=Pr(n,E);if(h&&h.ensure){var ie=h.ensure.from.line,se=h.ensure.to.line;ie<K?(K=ie,J=Pr(n,vn(yn(n,ie))+e.wrapper.clientHeight)):Math.min(se,n.lastLine())>=J&&(K=Pr(n,vn(yn(n,se))-e.wrapper.clientHeight),J=se)}return{from:K,to:Math.max(J,K+1)}}function Bi(e,n){if(mt(e,"scrollCursorIntoView"))return;var h=e.display,c=h.sizer.getBoundingClientRect(),E=null;if(n.top+c.top<0?E=!0:n.bottom+c.top>(window.innerHeight||document.documentElement.clientHeight)&&(E=!1),E!=null&&!o){var K=m("div","\u200B",null,`position: absolute;
top: `+(n.top-h.viewOffset-ta(e.display))+`px;
height: `+(n.bottom-n.top+ot(e)+h.barHeight)+`px;
left: `+n.left+"px; width: "+Math.max(2,n.right-n.left)+"px;");e.display.lineSpace.appendChild(K),K.scrollIntoView(E),e.display.lineSpace.removeChild(K)}}function io(e,n,h,c){c==null&&(c=0);var E;!e.options.lineWrapping&&n==h&&(n=n.ch?hn(n.line,n.sticky=="before"?n.ch-1:n.ch,"after"):n,h=n.sticky=="before"?hn(n.line,n.ch+1,"before"):n);for(var K=0;K<5;K++){var J=!1,ie=or(e,n),se=!h||h==n?ie:or(e,h);E={left:Math.min(ie.left,se.left),top:Math.min(ie.top,se.top)-c,right:Math.max(ie.left,se.left),bottom:Math.max(ie.bottom,se.bottom)+c};var pe=Vn(e,E),Xe=e.doc.scrollTop,nt=e.doc.scrollLeft;if(pe.scrollTop!=null&&(Ni(e,pe.scrollTop),Math.abs(e.doc.scrollTop-Xe)>1&&(J=!0)),pe.scrollLeft!=null&&(Wa(e,pe.scrollLeft),Math.abs(e.doc.scrollLeft-nt)>1&&(J=!0)),!J)break}return E}function Ii(e,n){var h=Vn(e,n);h.scrollTop!=null&&Ni(e,h.scrollTop),h.scrollLeft!=null&&Wa(e,h.scrollLeft)}function Vn(e,n){var h=e.display,c=Br(e.display);n.top<0&&(n.top=0);var E=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:h.scroller.scrollTop,K=ce(e),J={};n.bottom-n.top>K&&(n.bottom=n.top+K);var ie=e.doc.height+Me(h),se=n.top<c,pe=n.bottom>ie-c;if(n.top<E)J.scrollTop=se?0:n.top;else if(n.bottom>E+K){var Xe=Math.min(n.top,(pe?ie:n.bottom)-K);Xe!=E&&(J.scrollTop=Xe)}var nt=e.options.fixedGutter?0:h.gutters.offsetWidth,wt=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:h.scroller.scrollLeft-nt,_t=je(e)-h.gutters.offsetWidth,rn=n.right-n.left>_t;return rn&&(n.right=n.left+_t),n.left<10?J.scrollLeft=0:n.left<wt?J.scrollLeft=Math.max(0,n.left+nt-(rn?0:10)):n.right>_t+wt-3&&(J.scrollLeft=n.right+(rn?0:10)-_t),J}function Pn(e,n){if(n==null)return;Oa(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+n}function tr(e){Oa(e);var n=e.getCursor();e.curOp.scrollToPos={from:n,to:n,margin:e.options.cursorScrollMargin}}function ra(e,n,h){(n!=null||h!=null)&&Oa(e),n!=null&&(e.curOp.scrollLeft=n),h!=null&&(e.curOp.scrollTop=h)}function Cr(e,n){Oa(e),e.curOp.scrollToPos=n}function Oa(e){var n=e.curOp.scrollToPos;if(n){e.curOp.scrollToPos=null;var h=pn(e,n.from),c=pn(e,n.to);ki(e,h,c,n.margin)}}function ki(e,n,h,c){var E=Vn(e,{left:Math.min(n.left,h.left),top:Math.min(n.top,h.top)-c,right:Math.max(n.right,h.right),bottom:Math.max(n.bottom,h.bottom)+c});ra(e,E.scrollLeft,E.scrollTop)}function Ni(e,n){if(Math.abs(e.doc.scrollTop-n)<2)return;j||Ki(e,{top:n}),Ai(e,n,!0),j&&Ki(e),Wi(e,100)}function Ai(e,n,h){if(n=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,n)),e.display.scroller.scrollTop==n&&!h)return;e.doc.scrollTop=n,e.display.scrollbars.setScrollTop(n),e.display.scroller.scrollTop!=n&&(e.display.scroller.scrollTop=n)}function Wa(e,n,h,c){if(n=Math.max(0,Math.min(n,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(h?n==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-n)<2)&&!c)return;e.doc.scrollLeft=n,kr(e),e.display.scroller.scrollLeft!=n&&(e.display.scroller.scrollLeft=n),e.display.scrollbars.setScrollLeft(n)}function xi(e){var n=e.display,h=n.gutters.offsetWidth,c=Math.round(e.doc.height+Me(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?h:0,docHeight:c,scrollHeight:c+ot(e)+n.barHeight,nativeBarWidth:n.nativeBarWidth,gutterWidth:h}}var Ci=function(e,n,h){this.cm=h;var c=this.vert=m("div",[m("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),E=this.horiz=m("div",[m("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");c.tabIndex=E.tabIndex=-1,e(c),e(E),Qe(c,"scroll",function(){c.clientHeight&&n(c.scrollTop,"vertical")}),Qe(E,"scroll",function(){E.clientWidth&&n(E.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,W&&C<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Ci.prototype.update=function(e){var n=e.scrollWidth>e.clientWidth+1,h=e.scrollHeight>e.clientHeight+1,c=e.nativeBarWidth;if(h){this.vert.style.display="block",this.vert.style.bottom=n?c+"px":"0";var E=e.viewHeight-(n?c:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+E)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(n){this.horiz.style.display="block",this.horiz.style.right=h?c+"px":"0",this.horiz.style.left=e.barLeft+"px";var K=e.viewWidth-e.barLeft-(h?c: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&&(c==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:h?c:0,bottom:n?c:0}},Ci.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Ci.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Ci.prototype.zeroWidthHack=function(){var e=a&&!l?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Y,this.disableVert=new Y},Ci.prototype.enableZeroWidthBar=function(e,n,h){e.style.pointerEvents="auto";function c(){var E=e.getBoundingClientRect(),K=h=="vert"?document.elementFromPoint(E.right-1,(E.top+E.bottom)/2):document.elementFromPoint((E.right+E.left)/2,E.bottom-1);K!=e?e.style.pointerEvents="none":n.set(1e3,c)}n.set(1e3,c)},Ci.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Di=function(){};Di.prototype.update=function(){return{bottom:0,right:0}},Di.prototype.setScrollLeft=function(){},Di.prototype.setScrollTop=function(){},Di.prototype.clear=function(){};function wi(e,n){n||(n=xi(e));var h=e.display.barWidth,c=e.display.barHeight;Qi(e,n);for(var E=0;E<4&&h!=e.display.barWidth||c!=e.display.barHeight;E++)h!=e.display.barWidth&&e.options.lineWrapping&&Qa(e),Qi(e,xi(e)),h=e.display.barWidth,c=e.display.barHeight}function Qi(e,n){var h=e.display,c=h.scrollbars.update(n);h.sizer.style.paddingRight=(h.barWidth=c.right)+"px",h.sizer.style.paddingBottom=(h.barHeight=c.bottom)+"px",h.heightForcer.style.borderBottom=c.bottom+"px solid transparent",c.right&&c.bottom?(h.scrollbarFiller.style.display="block",h.scrollbarFiller.style.height=c.bottom+"px",h.scrollbarFiller.style.width=c.right+"px"):h.scrollbarFiller.style.display="",c.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(h.gutterFiller.style.display="block",h.gutterFiller.style.height=c.bottom+"px",h.gutterFiller.style.width=n.gutterWidth+"px"):h.gutterFiller.style.display=""}var Zi={native:Ci,null:Di};function qi(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&_(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Zi[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,h){h=="horizontal"?Wa(e,n):Ni(e,n)},e),e.display.scrollbars.addClass&&F(e.display.wrapper,e.display.scrollbars.addClass)}var Hi=0;function _i(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:++Hi},Gn(e.curOp)}function Pi(e){var n=e.curOp;n&&Wt(n,function(h){for(var c=0;c<h.ops.length;c++)h.ops[c].cm.curOp=null;oo(h)})}function oo(e){for(var n=e.ops,h=0;h<n.length;h++)Ao(n[h]);for(var c=0;c<n.length;c++)Do(n[c]);for(var E=0;E<n.length;E++)po(n[E]);for(var K=0;K<n.length;K++)so(n[K]);for(var J=0;J<n.length;J++)mo(n[J])}function Ao(e){var n=e.cm,h=n.display;lo(n),e.updateMaxLine&&Dn(n),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<h.viewFrom||e.scrollToPos.to.line>=h.viewTo)||h.maxLineChanged&&n.options.lineWrapping,e.update=e.mustUpdate&&new ci(n,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Do(e){e.updatedDisplay=e.mustUpdate&&Li(e.cm,e.update)}function po(e){var n=e.cm,h=n.display;e.updatedDisplay&&Qa(n),e.barMeasure=xi(n),h.maxLineChanged&&!n.options.lineWrapping&&(e.adjustWidthTo=Ge(n,h.maxLine,h.maxLine.text.length).left+3,n.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(h.scroller.clientWidth,h.sizer.offsetLeft+e.adjustWidthTo+ot(n)+n.display.barWidth),e.maxScrollLeft=Math.max(0,h.sizer.offsetLeft+e.adjustWidthTo-je(n))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=h.input.prepareSelection())}function so(e){var n=e.cm;e.adjustWidthTo!=null&&(n.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<n.doc.scrollLeft&&Wa(n,Math.min(n.display.scroller.scrollLeft,e.maxScrollLeft),!0),n.display.maxLineChanged=!1);var h=e.focus&&e.focus==H();e.preparedSelection&&n.display.input.showSelection(e.preparedSelection,h),(e.updatedDisplay||e.startHeight!=n.doc.height)&&wi(n,e.barMeasure),e.updatedDisplay&&Xr(n,e.barMeasure),e.selectionChanged&&Ea(n),n.state.focused&&e.updateInput&&n.display.input.reset(e.typing),h&&Si(e.cm)}function mo(e){var n=e.cm,h=n.display,c=n.doc;if(e.updatedDisplay&&eo(n,e.update),h.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(h.wheelStartX=h.wheelStartY=null),e.scrollTop!=null&&Ai(n,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Wa(n,e.scrollLeft,!0,!0),e.scrollToPos){var E=io(n,N(c,e.scrollToPos.from),N(c,e.scrollToPos.to),e.scrollToPos.margin);Bi(n,E)}var K=e.maybeHiddenMarkers,J=e.maybeUnhiddenMarkers;if(K)for(var ie=0;ie<K.length;++ie)K[ie].lines.length||dt(K[ie],"hide");if(J)for(var se=0;se<J.length;++se)J[se].lines.length&&dt(J[se],"unhide");h.wrapper.offsetHeight&&(c.scrollTop=n.display.scroller.scrollTop),e.changeObjs&&dt(n,"changes",n,e.changeObjs),e.update&&e.update.finish()}function Za(e,n){if(e.curOp)return n();_i(e);try{return n()}finally{Pi(e)}}function xa(e,n){return function(){if(e.curOp)return n.apply(e,arguments);_i(e);try{return n.apply(e,arguments)}finally{Pi(e)}}}function Ua(e){return function(){if(this.curOp)return e.apply(this,arguments);_i(this);try{return e.apply(this,arguments)}finally{Pi(this)}}}function Ca(e){return function(){var n=this.cm;if(!n||n.curOp)return e.apply(this,arguments);_i(n);try{return e.apply(this,arguments)}finally{Pi(n)}}}function Wi(e,n){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(n,k(go,e))}function go(e){var n=e.doc;if(n.highlightFrontier>=e.display.viewTo)return;var h=+new Date+e.options.workTime,c=On(e,n.highlightFrontier),E=[];n.iter(c.line,Math.min(n.first+n.size,e.display.viewTo+500),function(K){if(c.line>=e.display.viewFrom){var J=K.styles,ie=K.text.length>e.options.maxHighlightLength?$t(n.mode,c.state):null,se=Ze(e,K,c,!0);ie&&(c.state=ie),K.styles=se.styles;var pe=K.styleClasses,Xe=se.classes;Xe?K.styleClasses=Xe:pe&&(K.styleClasses=null);for(var nt=!J||J.length!=K.styles.length||pe!=Xe&&(!pe||!Xe||pe.bgClass!=Xe.bgClass||pe.textClass!=Xe.textClass),wt=0;!nt&&wt<J.length;++wt)nt=J[wt]!=K.styles[wt];nt&&E.push(c.line),K.stateAfter=c.save(),c.nextLine()}else K.text.length<=e.options.maxHighlightLength&&Xn(e,K.text,c),K.stateAfter=c.line%5==0?c.save():null,c.nextLine();if(+new Date>h)return Wi(e,e.options.workDelay),!0}),n.highlightFrontier=c.line,n.modeFrontier=Math.max(n.modeFrontier,c.line),E.length&&Za(e,function(){for(var K=0;K<E.length;K++)Yr(e,E[K],"text")})}var ci=function(e,n,h){var c=e.display;this.viewport=n,this.visible=Ri(c,e.doc,n),this.editorIsHidden=!c.wrapper.offsetWidth,this.wrapperHeight=c.wrapper.clientHeight,this.wrapperWidth=c.wrapper.clientWidth,this.oldDisplayWidth=je(e),this.force=h,this.dims=pr(e),this.events=[]};ci.prototype.signal=function(e,n){De(e,n)&&this.events.push(arguments)},ci.prototype.finish=function(){for(var e=0;e<this.events.length;e++)dt.apply(null,this.events[e])};function lo(e){var n=e.display;!n.scrollbarsClipped&&n.scroller.offsetWidth&&(n.nativeBarWidth=n.scroller.offsetWidth-n.scroller.clientWidth,n.heightForcer.style.height=ot(e)+"px",n.sizer.style.marginBottom=-n.nativeBarWidth+"px",n.sizer.style.borderRightWidth=ot(e)+"px",n.scrollbarsClipped=!0)}function uo(e){if(e.hasFocus())return null;var n=H();if(!n||!O(e.display.lineDiv,n))return null;var h={activeElt:n};if(window.getSelection){var c=window.getSelection();c.anchorNode&&c.extend&&O(e.display.lineDiv,c.anchorNode)&&(h.anchorNode=c.anchorNode,h.anchorOffset=c.anchorOffset,h.focusNode=c.focusNode,h.focusOffset=c.focusOffset)}return h}function co(e){if(!e||!e.activeElt||e.activeElt==H())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&O(document.body,e.anchorNode)&&O(document.body,e.focusNode)){var n=window.getSelection(),h=document.createRange();h.setEnd(e.anchorNode,e.anchorOffset),h.collapse(!1),n.removeAllRanges(),n.addRange(h),n.extend(e.focusNode,e.focusOffset)}}function Li(e,n){var h=e.display,c=e.doc;if(n.editorIsHidden)return ia(e),!1;if(!n.force&&n.visible.from>=h.viewFrom&&n.visible.to<=h.viewTo&&(h.updateLineNumbers==null||h.updateLineNumbers>=h.viewTo)&&h.renderedView==h.view&&si(e)==0)return!1;ga(e)&&(ia(e),n.dims=pr(e));var E=c.first+c.size,K=Math.max(n.visible.from-e.options.viewportMargin,c.first),J=Math.min(E,n.visible.to+e.options.viewportMargin);h.viewFrom<K&&K-h.viewFrom<20&&(K=Math.max(c.first,h.viewFrom)),h.viewTo>J&&h.viewTo-J<20&&(J=Math.min(E,h.viewTo)),ua&&(K=Ut(e.doc,K),J=At(e.doc,J));var ie=K!=h.viewFrom||J!=h.viewTo||h.lastWrapHeight!=n.wrapperHeight||h.lastWrapWidth!=n.wrapperWidth;mi(e,K,J),h.viewOffset=vn(yn(e.doc,h.viewFrom)),e.display.mover.style.top=h.viewOffset+"px";var se=si(e);if(!ie&&se==0&&!n.force&&h.renderedView==h.view&&(h.updateLineNumbers==null||h.updateLineNumbers>=h.viewTo))return!1;var pe=uo(e);return se>4&&(h.lineDiv.style.display="none"),vo(e,h.updateLineNumbers,n.dims),se>4&&(h.lineDiv.style.display=""),h.renderedView=h.view,co(pe),b(h.cursorDiv),b(h.selectionDiv),h.gutters.style.height=h.sizer.style.minHeight=0,ie&&(h.lastWrapHeight=n.wrapperHeight,h.lastWrapWidth=n.wrapperWidth,Wi(e,400)),h.updateLineNumbers=null,!0}function eo(e,n){for(var h=n.viewport,c=!0;;c=!1){if(!c||!e.options.lineWrapping||n.oldDisplayWidth==je(e)){if(h&&h.top!=null&&(h={top:Math.min(e.doc.height+Me(e.display)-ce(e),h.top)}),n.visible=Ri(e.display,e.doc,h),n.visible.from>=e.display.viewFrom&&n.visible.to<=e.display.viewTo)break}else c&&(n.visible=Ri(e.display,e.doc,h));if(!Li(e,n))break;Qa(e);var E=xi(e);Hr(e),wi(e,E),Xr(e,E),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 Ki(e,n){var h=new ci(e,n);if(Li(e,h)){Qa(e),eo(e,h);var c=xi(e);Hr(e),wi(e,c),Xr(e,c),h.finish()}}function vo(e,n,h){var c=e.display,E=e.options.lineNumbers,K=c.lineDiv,J=K.firstChild;function ie(rn){var _n=rn.nextSibling;return r&&a&&e.display.currentWheelTarget==rn?rn.style.display="none":rn.parentNode.removeChild(rn),_n}for(var se=c.view,pe=c.viewFrom,Xe=0;Xe<se.length;Xe++){var nt=se[Xe];if(!nt.hidden)if(!nt.node||nt.node.parentNode!=K){var wt=Gr(e,nt,pe,h);K.insertBefore(wt,J)}else{for(;J!=nt.node;)J=ie(J);var _t=E&&n!=null&&n<=pe&&nt.lineNumber;nt.changes&&(re(nt.changes,"gutter")>-1&&(_t=!1),ln(e,nt,pe,h)),_t&&(b(nt.lineNumber),nt.lineNumber.appendChild(document.createTextNode(ca(e.options,pe)))),J=nt.node.nextSibling}pe+=nt.size}for(;J;)J=ie(J)}function to(e){var n=e.gutters.offsetWidth;e.sizer.style.marginLeft=n+"px"}function Xr(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+ot(e)+"px"}function kr(e){var n=e.display,h=n.view;if(!n.alignWidgets&&(!n.gutters.firstChild||!e.options.fixedGutter))return;for(var c=na(n)-n.scroller.scrollLeft+e.doc.scrollLeft,E=n.gutters.offsetWidth,K=c+"px",J=0;J<h.length;J++)if(!h[J].hidden){e.options.fixedGutter&&(h[J].gutter&&(h[J].gutter.style.left=K),h[J].gutterBackground&&(h[J].gutterBackground.style.left=K));var ie=h[J].alignable;if(ie)for(var se=0;se<ie.length;se++)ie[se].style.left=K}e.options.fixedGutter&&(n.gutters.style.left=c+E+"px")}function ga(e){if(!e.options.lineNumbers)return!1;var n=e.doc,h=ca(e.options,n.first+n.size-1),c=e.display;if(h.length!=c.lineNumChars){var E=c.measure.appendChild(m("div",[m("div",h)],"CodeMirror-linenumber CodeMirror-gutter-elt")),K=E.firstChild.offsetWidth,J=E.offsetWidth-K;return c.lineGutter.style.width="",c.lineNumInnerWidth=Math.max(K,c.lineGutter.offsetWidth-J)+1,c.lineNumWidth=c.lineNumInnerWidth+J,c.lineNumChars=c.lineNumInnerWidth?h.length:-1,c.lineGutter.style.width=c.lineNumWidth+"px",to(e.display),!0}return!1}function Xa(e,n){for(var h=[],c=!1,E=0;E<e.length;E++){var K=e[E],J=null;if(typeof K!="string"&&(J=K.style,K=K.className),K=="CodeMirror-linenumbers")if(n)c=!0;else continue;h.push({className:K,style:J})}return n&&!c&&h.push({className:"CodeMirror-linenumbers",style:null}),h}function Ui(e){var n=e.gutters,h=e.gutterSpecs;b(n),e.lineGutter=null;for(var c=0;c<h.length;++c){var E=h[c],K=E.className,J=E.style,ie=n.appendChild(m("div",null,"CodeMirror-gutter "+K));J&&(ie.style.cssText=J),K=="CodeMirror-linenumbers"&&(e.lineGutter=ie,ie.style.width=(e.lineNumWidth||1)+"px")}n.style.display=h.length?"":"none",to(e)}function yi(e){Ui(e.display),Vr(e),kr(e)}function zi(e,n,h,c){var E=this;this.input=h,E.scrollbarFiller=m("div",null,"CodeMirror-scrollbar-filler"),E.scrollbarFiller.setAttribute("cm-not-content","true"),E.gutterFiller=m("div",null,"CodeMirror-gutter-filler"),E.gutterFiller.setAttribute("cm-not-content","true"),E.lineDiv=y("div",null,"CodeMirror-code"),E.selectionDiv=m("div",null,null,"position: relative; z-index: 1"),E.cursorDiv=m("div",null,"CodeMirror-cursors"),E.measure=m("div",null,"CodeMirror-measure"),E.lineMeasure=m("div",null,"CodeMirror-measure"),E.lineSpace=y("div",[E.measure,E.lineMeasure,E.selectionDiv,E.cursorDiv,E.lineDiv],null,"position: relative; outline: none");var K=y("div",[E.lineSpace],"CodeMirror-lines");E.mover=m("div",[K],null,"position: relative"),E.sizer=m("div",[E.mover],"CodeMirror-sizer"),E.sizerWidth=null,E.heightForcer=m("div",null,null,"position: absolute; height: "+le+"px; width: 1px;"),E.gutters=m("div",null,"CodeMirror-gutters"),E.lineGutter=null,E.scroller=m("div",[E.sizer,E.heightForcer,E.gutters],"CodeMirror-scroll"),E.scroller.setAttribute("tabIndex","-1"),E.wrapper=m("div",[E.scrollbarFiller,E.gutterFiller,E.scroller],"CodeMirror"),W&&C<8&&(E.gutters.style.zIndex=-1,E.scroller.style.paddingRight=0),!r&&!(j&&u)&&(E.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(E.wrapper):e(E.wrapper)),E.viewFrom=E.viewTo=n.first,E.reportedViewFrom=E.reportedViewTo=n.first,E.view=[],E.renderedView=null,E.externalMeasured=null,E.viewOffset=0,E.lastWrapHeight=E.lastWrapWidth=0,E.updateLineNumbers=null,E.nativeBarWidth=E.barHeight=E.barWidth=0,E.scrollbarsClipped=!1,E.lineNumWidth=E.lineNumInnerWidth=E.lineNumChars=null,E.alignWidgets=!1,E.cachedCharWidth=E.cachedTextHeight=E.cachedPaddingH=null,E.maxLine=null,E.maxLineLength=0,E.maxLineChanged=!1,E.wheelDX=E.wheelDY=E.wheelStartX=E.wheelStartY=null,E.shift=!1,E.selForContextMenu=null,E.activeTouch=null,E.gutterSpecs=Xa(c.gutters,c.lineNumbers),Ui(E),h.init(E)}var bi=0,Aa=null;W?Aa=-.53:j?Aa=15:v?Aa=-.7:p&&(Aa=-1/3);function Gi(e){var n=e.wheelDeltaX,h=e.wheelDeltaY;return n==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(n=e.detail),h==null&&e.detail&&e.axis==e.VERTICAL_AXIS?h=e.detail:h==null&&(h=e.wheelDelta),{x:n,y:h}}function Vi(e){var n=Gi(e);return n.x*=Aa,n.y*=Aa,n}function Yi(e,n){var h=Gi(n),c=h.x,E=h.y,K=e.display,J=K.scroller,ie=J.scrollWidth>J.clientWidth,se=J.scrollHeight>J.clientHeight;if(!(c&&ie||E&&se))return;if(E&&a&&r){e:for(var pe=n.target,Xe=K.view;pe!=J;pe=pe.parentNode)for(var nt=0;nt<Xe.length;nt++)if(Xe[nt].node==pe){e.display.currentWheelTarget=pe;break e}}if(c&&!j&&!f&&Aa!=null){E&&se&&Ni(e,Math.max(0,J.scrollTop+E*Aa)),Wa(e,Math.max(0,J.scrollLeft+c*Aa)),(!E||E&&se)&&de(n),K.wheelStartX=null;return}if(E&&Aa!=null){var wt=E*Aa,_t=e.doc.scrollTop,rn=_t+K.wrapper.clientHeight;wt<0?_t=Math.max(0,_t+wt-50):rn=Math.min(e.doc.height,rn+wt+50),Ki(e,{top:_t,bottom:rn})}bi<20&&(K.wheelStartX==null?(K.wheelStartX=J.scrollLeft,K.wheelStartY=J.scrollTop,K.wheelDX=c,K.wheelDY=E,setTimeout(function(){if(K.wheelStartX==null)return;var _n=J.scrollLeft-K.wheelStartX,In=J.scrollTop-K.wheelStartY,jn=In&&K.wheelDY&&In/K.wheelDY||_n&&K.wheelDX&&_n/K.wheelDX;if(K.wheelStartX=K.wheelStartY=null,!jn)return;Aa=(Aa*bi+jn)/(bi+1),++bi},200)):(K.wheelDX+=c,K.wheelDY+=E))}var qa=function(e,n){this.ranges=e,this.primIndex=n};qa.prototype.primary=function(){return this.ranges[this.primIndex]},qa.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 h=this.ranges[n],c=e.ranges[n];if(!va(h.anchor,c.anchor)||!va(h.head,c.head))return!1}return!0},qa.prototype.deepCopy=function(){for(var e=[],n=0;n<this.ranges.length;n++)e[n]=new zr(Pa(this.ranges[n].anchor),Pa(this.ranges[n].head));return new qa(e,this.primIndex)},qa.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},qa.prototype.contains=function(e,n){n||(n=e);for(var h=0;h<this.ranges.length;h++){var c=this.ranges[h];if(ir(n,c.from())>=0&&ir(e,c.to())<=0)return h}return-1};var zr=function(e,n){this.anchor=e,this.head=n};zr.prototype.from=function(){return la(this.anchor,this.head)},zr.prototype.to=function(){return sa(this.anchor,this.head)},zr.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Or(e,n,h){var c=e&&e.options.selectionsMayTouch,E=n[h];n.sort(function(wt,_t){return ir(wt.from(),_t.from())}),h=re(n,E);for(var K=1;K<n.length;K++){var J=n[K],ie=n[K-1],se=ir(ie.to(),J.from());if(c&&!J.empty()?se>0:se>=0){var pe=la(ie.from(),J.from()),Xe=sa(ie.to(),J.to()),nt=ie.empty()?J.from()==J.head:ie.from()==ie.head;K<=h&&--h,n.splice(--K,2,new zr(nt?Xe:pe,nt?pe:Xe))}}return new qa(n,h)}function Bn(e,n){return new qa([new zr(e,n||e)],0)}function ur(e){return e.text?hn(e.from.line+e.text.length-1,oe(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Mr(e,n){if(ir(e,n.from)<0)return e;if(ir(e,n.to)<=0)return ur(n);var h=e.line+n.text.length-(n.to.line-n.from.line)-1,c=e.ch;return e.line==n.to.line&&(c+=ur(n).ch-n.to.ch),hn(h,c)}function fa(e,n){for(var h=[],c=0;c<e.sel.ranges.length;c++){var E=e.sel.ranges[c];h.push(new zr(Mr(E.anchor,n),Mr(E.head,n)))}return Or(e.cm,h,e.sel.primIndex)}function Ti(e,n,h){return e.line==n.line?hn(h.line,e.ch-n.ch+h.ch):hn(h.line+(e.line-n.line),e.ch)}function gi(e,n,h){for(var c=[],E=hn(e.first,0),K=E,J=0;J<n.length;J++){var ie=n[J],se=Ti(ie.from,E,K),pe=Ti(ur(ie),E,K);if(E=ie.to,K=pe,h=="around"){var Xe=e.sel.ranges[J],nt=ir(Xe.head,Xe.anchor)<0;c[J]=new zr(nt?pe:se,nt?se:pe)}else c[J]=new zr(se,se)}return new qa(c,e.sel.primIndex)}function ja(e){e.doc.mode=st(e.options,e.doc.modeOption),li(e)}function li(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,Wi(e,100),e.state.modeGen++,e.curOp&&Vr(e)}function Oi(e,n){return n.from.ch==0&&n.to.ch==0&&oe(n.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Xi(e,n,h,c){function E(Jn){return h?h[Jn]:null}function K(Jn,Fn,rr){zt(Jn,Fn,rr,c),dn(Jn,"change",Jn,n)}function J(Jn,Fn){for(var rr=[],wr=Jn;wr<Fn;++wr)rr.push(new Rn(pe[wr],E(wr),c));return rr}var ie=n.from,se=n.to,pe=n.text,Xe=yn(e,ie.line),nt=yn(e,se.line),wt=oe(pe),_t=E(pe.length-1),rn=se.line-ie.line;if(n.full)e.insert(0,J(0,pe.length)),e.remove(pe.length,e.size-pe.length);else if(Oi(e,n)){var _n=J(0,pe.length-1);K(nt,nt.text,_t),rn&&e.remove(ie.line,rn),_n.length&&e.insert(ie.line,_n)}else if(Xe==nt)if(pe.length==1)K(Xe,Xe.text.slice(0,ie.ch)+wt+Xe.text.slice(se.ch),_t);else{var In=J(1,pe.length-1);In.push(new Rn(wt+Xe.text.slice(se.ch),_t,c)),K(Xe,Xe.text.slice(0,ie.ch)+pe[0],E(0)),e.insert(ie.line+1,In)}else if(pe.length==1)K(Xe,Xe.text.slice(0,ie.ch)+pe[0]+nt.text.slice(se.ch),E(0)),e.remove(ie.line+1,rn);else{K(Xe,Xe.text.slice(0,ie.ch)+pe[0],E(0)),K(nt,wt+nt.text.slice(se.ch),_t);var jn=J(1,pe.length-1);rn>1&&e.remove(ie.line+1,rn-1),e.insert(ie.line+1,jn)}dn(e,"change",e,n)}function Ia(e,n,h){function c(E,K,J){if(E.linked)for(var ie=0;ie<E.linked.length;++ie){var se=E.linked[ie];if(se.doc==K)continue;var pe=J&&se.sharedHist;if(h&&!pe)continue;n(se.doc,pe),c(se.doc,E,pe)}}c(e,null,!0)}function vs(e,n){if(n.cm)throw new Error("This document is already in use.");e.doc=n,n.cm=e,La(e),ja(e),_s(e),e.options.lineWrapping||Dn(e),e.options.mode=n.modeOption,Vr(e)}function _s(e){(e.doc.direction=="rtl"?F:_)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Za(e,function(){_s(e),Vr(e)})}function zo(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 rs(e,n){var h={from:Pa(n.from),to:ur(n),text:Sr(e,n.from,n.to)};return Es(e,h,n.from.line,n.to.line+1),Ia(e,function(c){return Es(c,h,n.from.line,n.to.line+1)},!0),h}function ys(e){for(;e.length;){var n=oe(e);if(n.ranges)e.pop();else break}}function pl(e,n){if(n)return ys(e.done),oe(e.done);if(e.done.length&&!oe(e.done).ranges)return oe(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),oe(e.done)}function bs(e,n,h,c){var E=e.history;E.undone.length=0;var K=+new Date,J,ie;if((E.lastOp==c||E.lastOrigin==n.origin&&n.origin&&(n.origin.charAt(0)=="+"&&E.lastModTime>K-(e.cm?e.cm.options.historyEventDelay:500)||n.origin.charAt(0)=="*"))&&(J=pl(E,E.lastOp==c)))ie=oe(J.changes),ir(n.from,n.to)==0&&ir(n.from,ie.to)==0?ie.to=ur(n):J.changes.push(rs(e,n));else{var se=oe(E.done);for((!se||!se.ranges)&&Go(e.sel,E.done),J={changes:[rs(e,n)],generation:E.generation},E.done.push(J);E.done.length>E.undoDepth;)E.done.shift(),E.done[0].ranges||E.done.shift()}E.done.push(h),E.generation=++E.maxGeneration,E.lastModTime=E.lastSelTime=K,E.lastOp=E.lastSelOp=c,E.lastOrigin=E.lastSelOrigin=n.origin,ie||dt(e,"historyAdded")}function ml(e,n,h,c){var E=n.charAt(0);return E=="*"||E=="+"&&h.ranges.length==c.ranges.length&&h.somethingSelected()==c.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,n,h,c){var E=e.history,K=c&&c.origin;h==E.lastSelOp||K&&E.lastSelOrigin==K&&(E.lastModTime==E.lastSelTime&&E.lastOrigin==K||ml(e,K,oe(E.done),n))?E.done[E.done.length-1]=n:Go(n,E.done),E.lastSelTime=+new Date,E.lastSelOrigin=K,E.lastSelOp=h,c&&c.clearRedo!==!1&&ys(E.undone)}function Go(e,n){var h=oe(n);h&&h.ranges&&h.equals(e)||n.push(e)}function Es(e,n,h,c){var E=n["spans_"+e.id],K=0;e.iter(Math.max(e.first,h),Math.min(e.first+e.size,c),function(J){J.markedSpans&&((E||(E=n["spans_"+e.id]={}))[K]=J.markedSpans),++K})}function vl(e){if(!e)return null;for(var n,h=0;h<e.length;++h)e[h].marker.explicitlyCleared?n||(n=e.slice(0,h)):n&&n.push(e[h]);return n?n.length?n:null:e}function _l(e,n){var h=n["spans_"+e.id];if(!h)return null;for(var c=[],E=0;E<n.text.length;++E)c.push(vl(h[E]));return c}function xs(e,n){var h=_l(e,n),c=dr(e,n);if(!h)return c;if(!c)return h;for(var E=0;E<h.length;++E){var K=h[E],J=c[E];if(K&&J){e:for(var ie=0;ie<J.length;++ie){for(var se=J[ie],pe=0;pe<K.length;++pe)if(K[pe].marker==se.marker)continue e;K.push(se)}}else J&&(h[E]=J)}return h}function _o(e,n,h){for(var c=[],E=0;E<e.length;++E){var K=e[E];if(K.ranges){c.push(h?qa.prototype.deepCopy.call(K):K);continue}var J=K.changes,ie=[];c.push({changes:ie});for(var se=0;se<J.length;++se){var pe=J[se],Xe=void 0;if(ie.push({from:pe.from,to:pe.to,text:pe.text}),n)for(var nt in pe)(Xe=nt.match(/^spans_(\d+)$/))&&(re(n,Number(Xe[1]))>-1&&(oe(ie)[nt]=pe[nt],delete pe[nt]))}}return c}function as(e,n,h,c){if(c){var E=e.anchor;if(h){var K=ir(n,E)<0;K!=ir(h,E)<0?(E=n,n=h):K!=ir(n,h)<0&&(n=h)}return new zr(E,n)}else return new zr(h||n,n)}function Vo(e,n,h,c,E){E==null&&(E=e.cm&&(e.cm.display.shift||e.extend)),ai(e,new qa([as(e.sel.primary(),n,h,E)],0),c)}function Cs(e,n,h){for(var c=[],E=e.cm&&(e.cm.display.shift||e.extend),K=0;K<e.sel.ranges.length;K++)c[K]=as(e.sel.ranges[K],n[K],null,E);var J=Or(e.cm,c,e.sel.primIndex);ai(e,J,h)}function is(e,n,h,c){var E=e.sel.ranges.slice(0);E[n]=h,ai(e,Or(e.cm,E,e.sel.primIndex),c)}function ws(e,n,h,c){ai(e,Bn(n,h),c)}function yl(e,n,h){var c={ranges:n.ranges,update:function(E){this.ranges=[];for(var K=0;K<E.length;K++)this.ranges[K]=new zr(N(e,E[K].anchor),N(e,E[K].head))},origin:h&&h.origin};return dt(e,"beforeSelectionChange",e,c),e.cm&&dt(e.cm,"beforeSelectionChange",e.cm,c),c.ranges!=n.ranges?Or(e.cm,c.ranges,c.ranges.length-1):n}function Ts(e,n,h){var c=e.history.done,E=oe(c);E&&E.ranges?(c[c.length-1]=n,Yo(e,n,h)):ai(e,n,h)}function ai(e,n,h){Yo(e,n,h),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,h)}function Yo(e,n,h){(De(e,"beforeSelectionChange")||e.cm&&De(e.cm,"beforeSelectionChange"))&&(n=yl(e,n,h));var c=h&&h.bias||(ir(n.primary().head,e.sel.primary().head)<0?-1:1);Os(e,Rs(e,n,c,!0)),!(h&&h.scroll===!1)&&e.cm&&tr(e.cm)}function Os(e,n){if(n.equals(e.sel))return;e.sel=n,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,We(e.cm)),dn(e,"cursorActivity",e)}function Ss(e){Os(e,Rs(e,e.sel,null,!1))}function Rs(e,n,h,c){for(var E,K=0;K<n.ranges.length;K++){var J=n.ranges[K],ie=n.ranges.length==e.sel.ranges.length&&e.sel.ranges[K],se=Xo(e,J.anchor,ie&&ie.anchor,h,c),pe=Xo(e,J.head,ie&&ie.head,h,c);(E||se!=J.anchor||pe!=J.head)&&(E||(E=n.ranges.slice(0,K)),E[K]=new zr(se,pe))}return E?Or(e.cm,E,n.primIndex):n}function yo(e,n,h,c,E){var K=yn(e,n.line);if(K.markedSpans)for(var J=0;J<K.markedSpans.length;++J){var ie=K.markedSpans[J],se=ie.marker,pe="selectLeft"in se?!se.selectLeft:se.inclusiveLeft,Xe="selectRight"in se?!se.selectRight:se.inclusiveRight;if((ie.from==null||(pe?ie.from<=n.ch:ie.from<n.ch))&&(ie.to==null||(Xe?ie.to>=n.ch:ie.to>n.ch))){if(E&&(dt(se,"beforeCursorEnter"),se.explicitlyCleared))if(K.markedSpans){--J;continue}else break;if(!se.atomic)continue;if(h){var nt=se.find(c<0?1:-1),wt=void 0;if((c<0?Xe:pe)&&(nt=As(e,nt,-c,nt&&nt.line==n.line?K:null)),nt&&nt.line==n.line&&(wt=ir(nt,h))&&(c<0?wt<0:wt>0))return yo(e,nt,n,c,E)}var _t=se.find(c<0?-1:1);return(c<0?pe:Xe)&&(_t=As(e,_t,c,_t.line==n.line?K:null)),_t?yo(e,_t,n,c,E):null}}return n}function Xo(e,n,h,c,E){var K=c||1,J=yo(e,n,h,K,E)||!E&&yo(e,n,h,K,!0)||yo(e,n,h,-K,E)||!E&&yo(e,n,h,-K,!0);return J||(e.cantEdit=!0,hn(e.first,0))}function As(e,n,h,c){return h<0&&n.ch==0?n.line>e.first?N(e,hn(n.line-1)):null:h>0&&n.ch==(c||yn(e,n.line)).text.length?n.line<e.first+e.size-1?hn(n.line+1,0):null:new hn(n.line,n.ch+h)}function Ds(e){e.setSelection(hn(e.firstLine(),0),hn(e.lastLine()),Ce)}function Ps(e,n,h){var c={canceled:!1,from:n.from,to:n.to,text:n.text,origin:n.origin,cancel:function(){return c.canceled=!0}};return h&&(c.update=function(E,K,J,ie){E&&(c.from=N(e,E)),K&&(c.to=N(e,K)),J&&(c.text=J),ie!==void 0&&(c.origin=ie)}),dt(e,"beforeChange",e,c),e.cm&&dt(e.cm,"beforeChange",e.cm,c),c.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:c.from,to:c.to,text:c.text,origin:c.origin}}function bo(e,n,h){if(e.cm){if(!e.cm.curOp)return xa(e.cm,bo)(e,n,h);if(e.cm.state.suppressEdits)return}if((De(e,"beforeChange")||e.cm&&De(e.cm,"beforeChange"))&&(n=Ps(e,n,!0),!n))return;var c=oi&&!h&&Re(e,n.from,n.to);if(c)for(var E=c.length-1;E>=0;--E)Ls(e,{from:c[E].from,to:c[E].to,text:E?[""]:n.text,origin:n.origin});else Ls(e,n)}function Ls(e,n){if(n.text.length==1&&n.text[0]==""&&ir(n.from,n.to)==0)return;var h=fa(e,n);bs(e,n,h,e.cm?e.cm.curOp.id:NaN),Po(e,n,h,dr(e,n));var c=[];Ia(e,function(E,K){!K&&re(c,E.history)==-1&&(Ns(E.history,n),c.push(E.history)),Po(E,n,null,dr(E,n))})}function $o(e,n,h){var c=e.cm&&e.cm.state.suppressEdits;if(c&&!h)return;for(var E=e.history,K,J=e.sel,ie=n=="undo"?E.done:E.undone,se=n=="undo"?E.undone:E.done,pe=0;pe<ie.length&&!(K=ie[pe],h?K.ranges&&!K.equals(e.sel):!K.ranges);pe++);if(pe==ie.length)return;for(E.lastOrigin=E.lastSelOrigin=null;;)if(K=ie.pop(),K.ranges){if(Go(K,se),h&&!K.equals(e.sel)){ai(e,K,{clearRedo:!1});return}J=K}else if(c){ie.push(K);return}else break;var Xe=[];Go(J,se),se.push({changes:Xe,generation:E.generation}),E.generation=K.generation||++E.maxGeneration;for(var nt=De(e,"beforeChange")||e.cm&&De(e.cm,"beforeChange"),wt=function(_n){var In=K.changes[_n];if(In.origin=n,nt&&!Ps(e,In,!1))return ie.length=0,{};Xe.push(rs(e,In));var jn=_n?fa(e,In):oe(ie);Po(e,In,jn,xs(e,In)),!_n&&e.cm&&e.cm.scrollIntoView({from:In.from,to:ur(In)});var Jn=[];Ia(e,function(Fn,rr){!rr&&re(Jn,Fn.history)==-1&&(Ns(Fn.history,In),Jn.push(Fn.history)),Po(Fn,In,null,xs(Fn,In))})},_t=K.changes.length-1;_t>=0;--_t){var rn=wt(_t);if(rn)return rn.v}}function Ms(e,n){if(n==0)return;if(e.first+=n,e.sel=new qa(Se(e.sel.ranges,function(E){return new zr(hn(E.anchor.line+n,E.anchor.ch),hn(E.head.line+n,E.head.ch))}),e.sel.primIndex),e.cm){Vr(e.cm,e.first,e.first-n,n);for(var h=e.cm.display,c=h.viewFrom;c<h.viewTo;c++)Yr(e.cm,c,"gutter")}}function Po(e,n,h,c){if(e.cm&&!e.cm.curOp)return xa(e.cm,Po)(e,n,h,c);if(n.to.line<e.first){Ms(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 E=n.text.length-1-(e.first-n.from.line);Ms(e,E),n={from:hn(e.first,0),to:hn(n.to.line+E,n.to.ch),text:[oe(n.text)],origin:n.origin}}var K=e.lastLine();n.to.line>K&&(n={from:n.from,to:hn(K,yn(e,K).text.length),text:[n.text[0]],origin:n.origin}),n.removed=Sr(e,n.from,n.to),h||(h=fa(e,n)),e.cm?bl(e.cm,n,c):Xi(e,n,c),Yo(e,h,Ce),e.cantEdit&&Xo(e,hn(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,n,h){var c=e.doc,E=e.display,K=n.from,J=n.to,ie=!1,se=K.line;e.options.lineWrapping||(se=cr(vt(yn(c,K.line))),c.iter(se,J.line+1,function(_t){if(_t==E.maxLine)return ie=!0,!0})),c.sel.contains(n.from,n.to)>-1&&We(e),Xi(c,n,h,ni(e)),e.options.lineWrapping||(c.iter(se,K.line+n.text.length,function(_t){var rn=Qt(_t);rn>E.maxLineLength&&(E.maxLine=_t,E.maxLineLength=rn,E.maxLineChanged=!0,ie=!1)}),ie&&(e.curOp.updateMaxLine=!0)),za(c,K.line),Wi(e,400);var pe=n.text.length-(J.line-K.line)-1;n.full?Vr(e):K.line==J.line&&n.text.length==1&&!Oi(e.doc,n)?Yr(e,K.line,"text"):Vr(e,K.line,J.line+1,pe);var Xe=De(e,"changes"),nt=De(e,"change");if(nt||Xe){var wt={from:K,to:J,text:n.text,removed:n.removed,origin:n.origin};nt&&dn(e,"change",e,wt),Xe&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(wt)}e.display.selForContextMenu=null}function Eo(e,n,h,c,E){var K;c||(c=h),ir(c,h)<0&&(K=[c,h],h=K[0],c=K[1]),typeof n=="string"&&(n=e.splitLines(n)),bo(e,{from:h,to:c,text:n,origin:E})}function Is(e,n,h,c){h<e.line?e.line+=c:n<e.line&&(e.line=n,e.ch=0)}function ks(e,n,h,c){for(var E=0;E<e.length;++E){var K=e[E],J=!0;if(K.ranges){K.copied||(K=e[E]=K.deepCopy(),K.copied=!0);for(var ie=0;ie<K.ranges.length;ie++)Is(K.ranges[ie].anchor,n,h,c),Is(K.ranges[ie].head,n,h,c);continue}for(var se=0;se<K.changes.length;++se){var pe=K.changes[se];if(h<pe.from.line)pe.from=hn(pe.from.line+c,pe.from.ch),pe.to=hn(pe.to.line+c,pe.to.ch);else if(n<=pe.to.line){J=!1;break}}J||(e.splice(0,E+1),E=0)}}function Ns(e,n){var h=n.from.line,c=n.to.line,E=n.text.length-(c-h)-1;ks(e.done,h,c,E),ks(e.undone,h,c,E)}function Lo(e,n,h,c){var E=n,K=n;return typeof n=="number"?K=yn(e,ee(e,n)):E=cr(n),E==null?null:(c(K,E)&&e.cm&&Yr(e.cm,E,h),K)}function Mo(e){this.lines=e,this.parent=null;for(var n=0,h=0;h<e.length;++h)e[h].parent=this,n+=e[h].height;this.height=n}Mo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,n){for(var h=e,c=e+n;h<c;++h){var E=this.lines[h];this.height-=E.height,Kt(E),dn(E,"delete")}this.lines.splice(e,n)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,n,h){this.height+=h,this.lines=this.lines.slice(0,e).concat(n).concat(this.lines.slice(e));for(var c=0;c<n.length;++c)n[c].parent=this},iterN:function(e,n,h){for(var c=e+n;e<c;++e)if(h(this.lines[e]))return!0}};function Io(e){this.children=e;for(var n=0,h=0,c=0;c<e.length;++c){var E=e[c];n+=E.chunkSize(),h+=E.height,E.parent=this}this.size=n,this.height=h,this.parent=null}Io.prototype={chunkSize:function(){return this.size},removeInner:function(e,n){this.size-=n;for(var h=0;h<this.children.length;++h){var c=this.children[h],E=c.chunkSize();if(e<E){var K=Math.min(n,E-e),J=c.height;if(c.removeInner(e,K),this.height-=J-c.height,E==K&&(this.children.splice(h--,1),c.parent=null),(n-=K)==0)break;e=0}else e-=E}if(this.size-n<25&&(this.children.length>1||!(this.children[0]instanceof Mo))){var ie=[];this.collapse(ie),this.children=[new Mo(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,h){this.size+=n.length,this.height+=h;for(var c=0;c<this.children.length;++c){var E=this.children[c],K=E.chunkSize();if(e<=K){if(E.insertInner(e,n,h),E.lines&&E.lines.length>50){for(var J=E.lines.length%25+25,ie=J;ie<E.lines.length;){var se=new Mo(E.lines.slice(ie,ie+=25));E.height-=se.height,this.children.splice(++c,0,se),se.parent=this}E.lines=E.lines.slice(0,J),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),h=new Io(n);if(e.parent){e.size-=h.size,e.height-=h.height;var E=re(e.parent.children,e);e.parent.children.splice(E+1,0,h)}else{var c=new Io(e.children);c.parent=e,e.children=[c,h],e=c}h.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,n,h){for(var c=0;c<this.children.length;++c){var E=this.children[c],K=E.chunkSize();if(e<K){var J=Math.min(n,K-e);if(E.iterN(e,J,h))return!0;if((n-=J)==0)break;e=0}else e-=K}}};var ko=function(e,n,h){if(h)for(var c in h)h.hasOwnProperty(c)&&(this[c]=h[c]);this.doc=e,this.node=n};ko.prototype.clear=function(){var e=this.doc.cm,n=this.line.widgets,h=this.line,c=cr(h);if(c==null||!n)return;for(var E=0;E<n.length;++E)n[E]==this&&n.splice(E--,1);n.length||(h.widgets=null);var K=ha(this);ar(h,Math.max(0,h.height-K)),e&&(Za(e,function(){Us(e,h,-K),Yr(e,c,"widget")}),dn(e,"lineWidgetCleared",e,this,c))},ko.prototype.changed=function(){var e=this,n=this.height,h=this.doc.cm,c=this.line;this.height=null;var E=ha(this)-n;if(!E)return;on(this.doc,c)||ar(c,c.height+E),h&&Za(h,function(){h.curOp.forceUpdate=!0,Us(h,c,E),dn(h,"lineWidgetChanged",h,e,cr(c))})},Le(ko);function Us(e,n,h){vn(n)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Pn(e,h)}function El(e,n,h,c){var E=new ko(e,h,c),K=e.cm;return K&&E.noHScroll&&(K.display.alignWidgets=!0),Lo(e,n,"widget",function(J){var ie=J.widgets||(J.widgets=[]);if(E.insertAt==null?ie.push(E):ie.splice(Math.min(ie.length-1,Math.max(0,E.insertAt)),0,E),E.line=J,K&&!on(e,J)){var se=vn(J)<e.scrollTop;ar(J,J.height+ha(E)),se&&Pn(K,E.height),K.curOp.forceUpdate=!0}return!0}),K&&dn(K,"lineWidgetAdded",K,E,typeof n=="number"?n:cr(n)),E}var js=0,no=function(e,n){this.lines=[],this.type=n,this.doc=e,this.id=++js};no.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,n=e&&!e.curOp;if(n&&_i(e),De(this,"clear")){var h=this.find();h&&dn(this,"clear",h.from,h.to)}for(var c=null,E=null,K=0;K<this.lines.length;++K){var J=this.lines[K],ie=ba(J.markedSpans,this);e&&!this.collapsed?Yr(e,cr(J),"text"):e&&(ie.to!=null&&(E=cr(J)),ie.from!=null&&(c=cr(J))),J.markedSpans=zn(J.markedSpans,ie),ie.from==null&&this.collapsed&&!on(this.doc,J)&&e&&ar(J,Br(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var se=0;se<this.lines.length;++se){var pe=vt(this.lines[se]),Xe=Qt(pe);Xe>e.display.maxLineLength&&(e.display.maxLine=pe,e.display.maxLineLength=Xe,e.display.maxLineChanged=!0)}c!=null&&e&&this.collapsed&&Vr(e,c,E+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ss(e.doc)),e&&dn(e,"markerCleared",e,this,c,E),n&&Pi(e),this.parent&&this.parent.clear()},no.prototype.find=function(e,n){e==null&&this.type=="bookmark"&&(e=1);for(var h,c,E=0;E<this.lines.length;++E){var K=this.lines[E],J=ba(K.markedSpans,this);if(J.from!=null&&(h=hn(n?K:cr(K),J.from),e==-1))return h;if(J.to!=null&&(c=hn(n?K:cr(K),J.to),e==1))return c}return h&&{from:h,to:c}},no.prototype.changed=function(){var e=this,n=this.find(-1,!0),h=this,c=this.doc.cm;if(!n||!c)return;Za(c,function(){var E=n.line,K=cr(n.line),J=ut(c,K);if(J&&(fr(J),c.curOp.selectionChanged=c.curOp.forceUpdate=!0),c.curOp.updateMaxLine=!0,!on(h.doc,E)&&h.height!=null){var ie=h.height;h.height=null;var se=ha(h)-ie;se&&ar(E,E.height+se)}dn(c,"markerChanged",c,e)})},no.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(!n.maybeHiddenMarkers||re(n.maybeHiddenMarkers,this)==-1)&&(n.maybeUnhiddenMarkers||(n.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},no.prototype.detachLine=function(e){if(this.lines.splice(re(this.lines,e),1),!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(n.maybeHiddenMarkers||(n.maybeHiddenMarkers=[])).push(this)}},Le(no);function xo(e,n,h,c,E){if(c&&c.shared)return xl(e,n,h,c,E);if(e.cm&&!e.cm.curOp)return xa(e.cm,xo)(e,n,h,c,E);var K=new no(e,E),J=ir(n,h);if(c&&d(c,K,!1),J>0||J==0&&K.clearWhenEmpty!==!1)return K;if(K.replacedWith&&(K.collapsed=!0,K.widgetNode=y("span",[K.replacedWith],"CodeMirror-widget"),c.handleMouseEvents||K.widgetNode.setAttribute("cm-ignore-events","true"),c.insertLeft&&(K.widgetNode.insertLeft=!0)),K.collapsed){if(Tt(e,n.line,n,h,K)||n.line!=h.line&&Tt(e,h.line,n,h,K))throw new Error("Inserting collapsed marker partially overlapping an existing one");ti()}K.addToHistory&&bs(e,{from:n,to:h,origin:"markText"},e.sel,NaN);var ie=n.line,se=e.cm,pe;if(e.iter(ie,h.line+1,function(nt){se&&K.collapsed&&!se.options.lineWrapping&&vt(nt)==se.display.maxLine&&(pe=!0),K.collapsed&&ie!=n.line&&ar(nt,0),bn(nt,new Ga(K,ie==n.line?n.ch:null,ie==h.line?h.ch:null)),++ie}),K.collapsed&&e.iter(n.line,h.line+1,function(nt){on(e,nt)&&ar(nt,0)}),K.clearOnEnter&&Qe(K,"beforeCursorEnter",function(){return K.clear()}),K.readOnly&&(Na(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),K.collapsed&&(K.id=++js,K.atomic=!0),se){if(pe&&(se.curOp.updateMaxLine=!0),K.collapsed)Vr(se,n.line,h.line+1);else if(K.className||K.startStyle||K.endStyle||K.css||K.attributes||K.title)for(var Xe=n.line;Xe<=h.line;Xe++)Yr(se,Xe,"text");K.atomic&&Ss(se.doc),dn(se,"markerAdded",se,K)}return K}var No=function(e,n){this.markers=e,this.primary=n;for(var h=0;h<e.length;++h)e[h].parent=this};No.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();dn(this,"clear")},No.prototype.find=function(e,n){return this.primary.find(e,n)},Le(No);function xl(e,n,h,c,E){c=d(c),c.shared=!1;var K=[xo(e,n,h,c,E)],J=K[0],ie=c.widgetNode;return Ia(e,function(se){ie&&(c.widgetNode=ie.cloneNode(!0)),K.push(xo(se,N(se,n),N(se,h),c,E));for(var pe=0;pe<se.linked.length;++pe)if(se.linked[pe].isParent)return;J=oe(K)}),new No(K,J)}function Fs(e){return e.findMarks(hn(e.first,0),e.clipPos(hn(e.lastLine())),function(n){return n.parent})}function Cl(e,n){for(var h=0;h<n.length;h++){var c=n[h],E=c.find(),K=e.clipPos(E.from),J=e.clipPos(E.to);if(ir(K,J)){var ie=xo(e,K,J,c.primary,c.primary.type);c.markers.push(ie),ie.parent=c}}}function wl(e){for(var n=function(c){var E=e[c],K=[E.primary.doc];Ia(E.primary.doc,function(se){return K.push(se)});for(var J=0;J<E.markers.length;J++){var ie=E.markers[J];re(K,ie.doc)==-1&&(ie.parent=null,E.markers.splice(J--,1))}},h=0;h<e.length;h++)n(h)}var Tl=0,di=function(e,n,h,c,E){if(!(this instanceof di))return new di(e,n,h,c,E);h==null&&(h=0),Io.call(this,[new Mo([new Rn("",null)])]),this.first=h,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=h;var K=hn(h,0);this.sel=Bn(K),this.history=new zo(null),this.id=++Tl,this.modeOption=n,this.lineSep=c,this.direction=E=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Xi(this,{from:K,to:K,text:e}),ai(this,Bn(K),Ce)};di.prototype=rt(Io.prototype,{constructor:di,iter:function(e,n,h){h?this.iterN(e-this.first,n-e,h):this.iterN(this.first,this.first+this.size,e)},insert:function(e,n){for(var h=0,c=0;c<n.length;++c)h+=n[c].height;this.insertInner(e-this.first,n,h)},remove:function(e,n){this.removeInner(e-this.first,n)},getValue:function(e){var n=_r(this,this.first,this.first+this.size);return e===!1?n:n.join(e||this.lineSeparator())},setValue:Ca(function(e){var n=hn(this.first,0),h=this.first+this.size-1;bo(this,{from:n,to:hn(h,yn(this,h).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&ra(this.cm,0,0),ai(this,Bn(n),Ce)}),replaceRange:function(e,n,h,c){n=N(this,n),h=h?N(this,h):n,Eo(this,e,n,h,c)},getRange:function(e,n,h){var c=Sr(this,N(this,e),N(this,n));return h===!1?c:c.join(h||this.lineSeparator())},getLine:function(e){var n=this.getLineHandle(e);return n&&n.text},getLineHandle:function(e){if(Qr(this,e))return yn(this,e)},getLineNumber:function(e){return cr(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=yn(this,e)),vt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return N(this,e)},getCursor:function(e){var n=this.sel.primary(),h;return e==null||e=="head"?h=n.head:e=="anchor"?h=n.anchor:e=="end"||e=="to"||e===!1?h=n.to():h=n.from(),h},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Ca(function(e,n,h){ws(this,N(this,typeof e=="number"?hn(e,n||0):e),null,h)}),setSelection:Ca(function(e,n,h){ws(this,N(this,e),N(this,n||e),h)}),extendSelection:Ca(function(e,n,h){Vo(this,N(this,e),n&&N(this,n),h)}),extendSelections:Ca(function(e,n){Cs(this,X(this,e),n)}),extendSelectionsBy:Ca(function(e,n){var h=Se(this.sel.ranges,e);Cs(this,X(this,h),n)}),setSelections:Ca(function(e,n,h){if(!e.length)return;for(var c=[],E=0;E<e.length;E++)c[E]=new zr(N(this,e[E].anchor),N(this,e[E].head));n==null&&(n=Math.min(e.length-1,this.sel.primIndex)),ai(this,Or(this.cm,c,n),h)}),addSelection:Ca(function(e,n,h){var c=this.sel.ranges.slice(0);c.push(new zr(N(this,e),N(this,n||e))),ai(this,Or(this.cm,c,c.length-1),h)}),getSelection:function(e){for(var n=this.sel.ranges,h,c=0;c<n.length;c++){var E=Sr(this,n[c].from(),n[c].to());h=h?h.concat(E):E}return e===!1?h:h.join(e||this.lineSeparator())},getSelections:function(e){for(var n=[],h=this.sel.ranges,c=0;c<h.length;c++){var E=Sr(this,h[c].from(),h[c].to());e!==!1&&(E=E.join(e||this.lineSeparator())),n[c]=E}return n},replaceSelection:function(e,n,h){for(var c=[],E=0;E<this.sel.ranges.length;E++)c[E]=e;this.replaceSelections(c,n,h||"+input")},replaceSelections:Ca(function(e,n,h){for(var c=[],E=this.sel,K=0;K<E.ranges.length;K++){var J=E.ranges[K];c[K]={from:J.from(),to:J.to(),text:this.splitLines(e[K]),origin:h}}for(var ie=n&&n!="end"&&gi(this,c,n),se=c.length-1;se>=0;se--)bo(this,c[se]);ie?Ts(this,ie):this.cm&&tr(this.cm)}),undo:Ca(function(){$o(this,"undo")}),redo:Ca(function(){$o(this,"redo")}),undoSelection:Ca(function(){$o(this,"undo",!0)}),redoSelection:Ca(function(){$o(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,n=0,h=0,c=0;c<e.done.length;c++)e.done[c].ranges||++n;for(var E=0;E<e.undone.length;E++)e.undone[E].ranges||++h;return{undo:n,redo:h}},clearHistory:function(){var e=this;this.history=new zo(this.history.maxGeneration),Ia(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:_o(this.history.done),undone:_o(this.history.undone)}},setHistory:function(e){var n=this.history=new zo(this.history.maxGeneration);n.done=_o(e.done.slice(0),null,!0),n.undone=_o(e.undone.slice(0),null,!0)},setGutterMarker:Ca(function(e,n,h){return Lo(this,e,"gutter",function(c){var E=c.gutterMarkers||(c.gutterMarkers={});return E[n]=h,!h&&te(E)&&(c.gutterMarkers=null),!0})}),clearGutter:Ca(function(e){var n=this;this.iter(function(h){h.gutterMarkers&&h.gutterMarkers[e]&&Lo(n,h,"gutter",function(){return h.gutterMarkers[e]=null,te(h.gutterMarkers)&&(h.gutterMarkers=null),!0})})}),lineInfo:function(e){var n;if(typeof e=="number"){if(!Qr(this,e))return null;if(n=e,e=yn(this,e),!e)return null}else if(n=cr(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:Ca(function(e,n,h){return Lo(this,e,n=="gutter"?"gutter":"class",function(c){var E=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass";if(!c[E])c[E]=h;else{if(P(h).test(c[E]))return!1;c[E]+=" "+h}return!0})}),removeLineClass:Ca(function(e,n,h){return Lo(this,e,n=="gutter"?"gutter":"class",function(c){var E=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass",K=c[E];if(K)if(h==null)c[E]=null;else{var J=K.match(P(h));if(!J)return!1;var ie=J.index+J[0].length;c[E]=K.slice(0,J.index)+(!J.index||ie==K.length?"":" ")+K.slice(ie)||null}else return!1;return!0})}),addLineWidget:Ca(function(e,n,h){return El(this,e,n,h)}),removeLineWidget:function(e){e.clear()},markText:function(e,n,h){return xo(this,N(this,e),N(this,n),h,h&&h.type||"range")},setBookmark:function(e,n){var h={replacedWith:n&&(n.nodeType==null?n.widget:n),insertLeft:n&&n.insertLeft,clearWhenEmpty:!1,shared:n&&n.shared,handleMouseEvents:n&&n.handleMouseEvents};return e=N(this,e),xo(this,e,e,h,"bookmark")},findMarksAt:function(e){e=N(this,e);var n=[],h=yn(this,e.line).markedSpans;if(h)for(var c=0;c<h.length;++c){var E=h[c];(E.from==null||E.from<=e.ch)&&(E.to==null||E.to>=e.ch)&&n.push(E.marker.parent||E.marker)}return n},findMarks:function(e,n,h){e=N(this,e),n=N(this,n);var c=[],E=e.line;return this.iter(e.line,n.line+1,function(K){var J=K.markedSpans;if(J)for(var ie=0;ie<J.length;ie++){var se=J[ie];!(se.to!=null&&E==e.line&&e.ch>=se.to||se.from==null&&E!=e.line||se.from!=null&&E==n.line&&se.from>=n.ch)&&(!h||h(se.marker))&&c.push(se.marker.parent||se.marker)}++E}),c},getAllMarks:function(){var e=[];return this.iter(function(n){var h=n.markedSpans;if(h)for(var c=0;c<h.length;++c)h[c].from!=null&&e.push(h[c].marker)}),e},posFromIndex:function(e){var n,h=this.first,c=this.lineSeparator().length;return this.iter(function(E){var K=E.text.length+c;if(K>e)return n=e,!0;e-=K,++h}),N(this,hn(h,n))},indexFromPos:function(e){e=N(this,e);var n=e.ch;if(e.line<this.first||e.ch<0)return 0;var h=this.lineSeparator().length;return this.iter(this.first,e.line,function(c){n+=c.text.length+h}),n},copy:function(e){var n=new di(_r(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,h=this.first+this.size;e.from!=null&&e.from>n&&(n=e.from),e.to!=null&&e.to<h&&(h=e.to);var c=new di(_r(this,n,h),e.mode||this.modeOption,n,this.lineSep,this.direction);return e.sharedHist&&(c.history=this.history),(this.linked||(this.linked=[])).push({doc:c,sharedHist:e.sharedHist}),c.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Cl(c,Fs(this)),c},unlinkDoc:function(e){if(e instanceof wa&&(e=e.doc),this.linked)for(var n=0;n<this.linked.length;++n){var h=this.linked[n];if(h.doc!=e)continue;this.linked.splice(n,1),e.unlinkDoc(this),wl(Fs(this));break}if(e.history==this.history){var c=[e.id];Ia(e,function(E){return c.push(E.id)},!0),e.history=new zo(null),e.history.done=_o(this.history.done,c),e.history.undone=_o(this.history.undone,c)}},iterLinkedDocs:function(e){Ia(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):xt(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:Ca(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(n){return n.order=null}),this.cm&&fl(this.cm)})}),di.prototype.eachLine=di.prototype.iter;var Bs=0;function Ol(e){var n=this;if(Hs(n),mt(n,e)||_a(n.display,e))return;de(e),W&&(Bs=+new Date);var h=ya(n,e,!0),c=e.dataTransfer.files;if(!h||n.isReadOnly())return;if(c&&c.length&&window.FileReader&&window.File)for(var E=c.length,K=Array(E),J=0,ie=function(){++J==E&&xa(n,function(){h=N(n.doc,h);var _t={from:h,to:h,text:n.doc.splitLines(K.filter(function(rn){return rn!=null}).join(n.doc.lineSeparator())),origin:"paste"};bo(n.doc,_t),Ts(n.doc,Bn(N(n.doc,h),N(n.doc,ur(_t))))})()},se=function(_t,rn){if(n.options.allowDropFileTypes&&re(n.options.allowDropFileTypes,_t.type)==-1){ie();return}var _n=new FileReader;_n.onerror=function(){return ie()},_n.onload=function(){var In=_n.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(In)){ie();return}K[rn]=In,ie()},_n.readAsText(_t)},pe=0;pe<c.length;pe++)se(c[pe],pe);else{if(n.state.draggingText&&n.doc.sel.contains(h)>-1){n.state.draggingText(e),setTimeout(function(){return n.display.input.focus()},20);return}try{var Xe=e.dataTransfer.getData("Text");if(Xe){var nt;if(n.state.draggingText&&!n.state.draggingText.copy&&(nt=n.listSelections()),Yo(n.doc,Bn(h,h)),nt)for(var wt=0;wt<nt.length;++wt)Eo(n.doc,"",nt[wt].anchor,nt[wt].head,"drag");n.replaceSelection(Xe,"around","paste"),n.display.input.focus()}}catch(_t){}}}function Sl(e,n){if(W&&(!e.state.draggingText||+new Date-Bs<100)){Pe(n);return}if(mt(e,n)||_a(e.display,n))return;if(n.dataTransfer.setData("Text",e.getSelection()),n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setDragImage&&!p){var h=m("img",null,null,"position: fixed; left: 0; top: 0;");h.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",f&&(h.width=h.height=1,e.display.wrapper.appendChild(h),h._top=h.offsetTop),n.dataTransfer.setDragImage(h,0,0),f&&h.parentNode.removeChild(h)}}function Rl(e,n){var h=ya(e,n);if(!h)return;var c=document.createDocumentFragment();ri(e,h,c),e.display.dragCursor||(e.display.dragCursor=m("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),g(e.display.dragCursor,c)}function Hs(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ws(e){if(!document.getElementsByClassName)return;for(var n=document.getElementsByClassName("CodeMirror"),h=[],c=0;c<n.length;c++){var E=n[c].CodeMirror;E&&h.push(E)}h.length&&h[0].operation(function(){for(var K=0;K<h.length;K++)e(h[K])})}var Ks=!1;function Al(){if(Ks)return;Dl(),Ks=!0}function Dl(){var e;Qe(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ws(Pl)},100))}),Qe(window,"blur",function(){return Ws(Ya)})}function Pl(e){var n=e.display;n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.scrollbarsClipped=!1,e.setSize()}for(var ro={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"},Uo=0;Uo<10;Uo++)ro[Uo+48]=ro[Uo+96]=String(Uo);for(var Jo=65;Jo<=90;Jo++)ro[Jo]=String.fromCharCode(Jo);for(var jo=1;jo<=12;jo++)ro[jo+111]=ro[jo+63235]="F"+jo;var $i={};$i.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"},$i.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"},$i.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"},$i.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"]},$i.default=a?$i.macDefault:$i.pcDefault;function Ll(e){var n=e.split(/-(?!$)/);e=n[n.length-1];for(var h,c,E,K,J=0;J<n.length-1;J++){var ie=n[J];if(/^(cmd|meta|m)$/i.test(ie))K=!0;else if(/^a(lt)?$/i.test(ie))h=!0;else if(/^(c|ctrl|control)$/i.test(ie))c=!0;else if(/^s(hift)?$/i.test(ie))E=!0;else throw new Error("Unrecognized modifier name: "+ie)}return h&&(e="Alt-"+e),c&&(e="Ctrl-"+e),K&&(e="Cmd-"+e),E&&(e="Shift-"+e),e}function Ml(e){var n={};for(var h in e)if(e.hasOwnProperty(h)){var c=e[h];if(/^(name|fallthrough|(de|at)tach)$/.test(h))continue;if(c=="..."){delete e[h];continue}for(var E=Se(h.split(" "),Ll),K=0;K<E.length;K++){var J=void 0,ie=void 0;K==E.length-1?(ie=E.join(" "),J=c):(ie=E.slice(0,K+1).join(" "),J="...");var se=n[ie];if(!se)n[ie]=J;else if(se!=J)throw new Error("Inconsistent bindings for "+ie)}delete e[h]}for(var pe in n)e[pe]=n[pe];return e}function Co(e,n,h,c){n=Qo(n);var E=n.call?n.call(e,c):n[e];if(E===!1)return"nothing";if(E==="...")return"multi";if(E!=null&&h(E))return"handled";if(n.fallthrough){if(Object.prototype.toString.call(n.fallthrough)!="[object Array]")return Co(e,n.fallthrough,h,c);for(var K=0;K<n.fallthrough.length;K++){var J=Co(e,n.fallthrough[K],h,c);if(J)return J}}}function zs(e){var n=typeof e=="string"?e:ro[e.keyCode];return n=="Ctrl"||n=="Alt"||n=="Shift"||n=="Mod"}function Gs(e,n,h){var c=e;return n.altKey&&c!="Alt"&&(e="Alt-"+e),(S?n.metaKey:n.ctrlKey)&&c!="Ctrl"&&(e="Ctrl-"+e),(S?n.ctrlKey:n.metaKey)&&c!="Mod"&&(e="Cmd-"+e),!h&&n.shiftKey&&c!="Shift"&&(e="Shift-"+e),e}function Vs(e,n){if(f&&e.keyCode==34&&e.char)return!1;var h=ro[e.keyCode];return h==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(h=e.code),Gs(h,e,n))}function Qo(e){return typeof e=="string"?$i[e]:e}function wo(e,n){for(var h=e.doc.sel.ranges,c=[],E=0;E<h.length;E++){for(var K=n(h[E]);c.length&&ir(K.from,oe(c).to)<=0;){var J=c.pop();if(ir(J.from,K.from)<0){K.from=J.from;break}}c.push(K)}Za(e,function(){for(var ie=c.length-1;ie>=0;ie--)Eo(e.doc,"",c[ie].from,c[ie].to,"+delete");tr(e)})}function os(e,n,h){var c=we(e.text,n+h,h);return c<0||c>e.text.length?null:c}function ss(e,n,h){var c=os(e,n.ch,h);return c==null?null:new hn(n.line,c,h<0?"after":"before")}function ls(e,n,h,c,E){if(e){n.doc.direction=="rtl"&&(E=-E);var K=sn(h,n.doc.direction);if(K){var J=E<0?oe(K):K[0],ie=E<0==(J.level==1),se=ie?"after":"before",pe;if(J.level>0||n.doc.direction=="rtl"){var Xe=Je(n,h);pe=E<0?h.text.length-1:0;var nt=pt(n,Xe,pe).top;pe=ft(function(wt){return pt(n,Xe,wt).top==nt},E<0==(J.level==1)?J.from:J.to-1,pe),se=="before"&&(pe=os(h,pe,1))}else pe=E<0?J.to:J.from;return new hn(c,pe,se)}}return new hn(c,E<0?h.text.length:0,E<0?"before":"after")}function Il(e,n,h,c){var E=sn(n,e.doc.direction);if(!E)return ss(n,h,c);h.ch>=n.text.length?(h.ch=n.text.length,h.sticky="before"):h.ch<=0&&(h.ch=0,h.sticky="after");var K=qe(E,h.ch,h.sticky),J=E[K];if(e.doc.direction=="ltr"&&J.level%2==0&&(c>0?J.to>h.ch:J.from<h.ch))return ss(n,h,c);var ie=function(jn,Jn){return os(n,jn instanceof hn?jn.ch:jn,Jn)},se,pe=function(jn){return e.options.lineWrapping?(se=se||Je(e,n),Qn(e,n,se,jn)):{begin:0,end:n.text.length}},Xe=pe(h.sticky=="before"?ie(h,-1):h.ch);if(e.doc.direction=="rtl"||J.level==1){var nt=J.level==1==c<0,wt=ie(h,nt?1:-1);if(wt!=null&&(nt?wt<=J.to&&wt<=Xe.end:wt>=J.from&&wt>=Xe.begin)){var _t=nt?"before":"after";return new hn(h.line,wt,_t)}}var rn=function(jn,Jn,Fn){for(var rr=function(pa,$a){return $a?new hn(h.line,ie(pa,1),"before"):new hn(h.line,pa,"after")};jn>=0&&jn<E.length;jn+=Jn){var wr=E[jn],gr=Jn>0==(wr.level!=1),Fr=gr?Fn.begin:ie(Fn.end,-1);if(wr.from<=Fr&&Fr<wr.to)return rr(Fr,gr);if(Fr=gr?wr.from:ie(wr.to,-1),Fn.begin<=Fr&&Fr<Fn.end)return rr(Fr,gr)}},_n=rn(K+c,c,Xe);if(_n)return _n;var In=c>0?Xe.end:ie(Xe.begin,-1);return In!=null&&!(c>0&&In==n.text.length)&&(_n=rn(c>0?0:E.length-1,c,pe(In)),_n)?_n:null}var Fo={selectAll:Ds,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ce)},killLine:function(e){return wo(e,function(n){if(n.empty()){var h=yn(e.doc,n.head.line).text.length;return n.head.ch==h&&n.head.line<e.lastLine()?{from:n.head,to:hn(n.head.line+1,0)}:{from:n.head,to:hn(n.head.line,h)}}else return{from:n.from(),to:n.to()}})},deleteLine:function(e){return wo(e,function(n){return{from:hn(n.from().line,0),to:N(e.doc,hn(n.to().line+1,0))}})},delLineLeft:function(e){return wo(e,function(n){return{from:hn(n.from().line,0),to:n.from()}})},delWrappedLineLeft:function(e){return wo(e,function(n){var h=e.charCoords(n.head,"div").top+5,c=e.coordsChar({left:0,top:h},"div");return{from:c,to:n.from()}})},delWrappedLineRight:function(e){return wo(e,function(n){var h=e.charCoords(n.head,"div").top+5,c=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:h},"div");return{from:n.from(),to:c}})},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(hn(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(hn(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(n){return Ys(e,n.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(n){return Xs(e,n.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(n){return kl(e,n.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(n){var h=e.cursorCoords(n.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:h},"div")},Fe)},goLineLeft:function(e){return e.extendSelectionsBy(function(n){var h=e.cursorCoords(n.head,"div").top+5;return e.coordsChar({left:0,top:h},"div")},Fe)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(n){var h=e.cursorCoords(n.head,"div").top+5,c=e.coordsChar({left:0,top:h},"div");return c.ch<e.getLine(c.line).search(/\S/)?Xs(e,n.head):c},Fe)},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=[],h=e.listSelections(),c=e.options.tabSize,E=0;E<h.length;E++){var K=h[E].from(),J=z(e.getLine(K.line),K.ch,c);n.push(ye(c-J%c))}e.replaceSelections(n)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Za(e,function(){for(var n=e.listSelections(),h=[],c=0;c<n.length;c++){if(!n[c].empty())continue;var E=n[c].head,K=yn(e.doc,E.line).text;if(K){if(E.ch==K.length&&(E=new hn(E.line,E.ch-1)),E.ch>0)E=new hn(E.line,E.ch+1),e.replaceRange(K.charAt(E.ch-1)+K.charAt(E.ch-2),hn(E.line,E.ch-2),E,"+transpose");else if(E.line>e.doc.first){var J=yn(e.doc,E.line-1).text;J&&(E=new hn(E.line,1),e.replaceRange(K.charAt(0)+e.doc.lineSeparator()+J.charAt(J.length-1),hn(E.line-1,J.length-1),E,"+transpose"))}}h.push(new zr(E,E))}e.setSelections(h)})},newlineAndIndent:function(e){return Za(e,function(){for(var n=e.listSelections(),h=n.length-1;h>=0;h--)e.replaceRange(e.doc.lineSeparator(),n[h].anchor,n[h].head,"+input");n=e.listSelections();for(var c=0;c<n.length;c++)e.indentLine(n[c].from().line,null,!0);tr(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ys(e,n){var h=yn(e.doc,n),c=vt(h);return c!=h&&(n=cr(c)),ls(!0,e,c,n,1)}function kl(e,n){var h=yn(e.doc,n),c=ct(h);return c!=h&&(n=cr(c)),ls(!0,e,h,n,-1)}function Xs(e,n){var h=Ys(e,n.line),c=yn(e.doc,h.line),E=sn(c,e.doc.direction);if(!E||E[0].level==0){var K=Math.max(h.ch,c.text.search(/\S/)),J=n.line==h.line&&n.ch<=K&&n.ch;return hn(h.line,J?0:K,h.sticky)}return h}function Zo(e,n,h){if(typeof n=="string"&&(n=Fo[n],!n))return!1;e.display.input.ensurePolled();var c=e.display.shift,E=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),h&&(e.display.shift=!1),E=n(e)!=Ne}finally{e.display.shift=c,e.state.suppressEdits=!1}return E}function Nl(e,n,h){for(var c=0;c<e.state.keyMaps.length;c++){var E=Co(n,e.state.keyMaps[c],h,e);if(E)return E}return e.options.extraKeys&&Co(n,e.options.extraKeys,h,e)||Co(n,e.options.keyMap,h,e)}var Ul=new Y;function Bo(e,n,h,c){var E=e.state.keySeq;if(E){if(zs(n))return"handled";if(/\'$/.test(n)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==E&&(e.state.keySeq=null,e.display.input.reset())}),$s(e,E+" "+n,h,c))return!0}return $s(e,n,h,c)}function $s(e,n,h,c){var E=Nl(e,n,c);return E=="multi"&&(e.state.keySeq=n),E=="handled"&&dn(e,"keyHandled",e,n,h),(E=="handled"||E=="multi")&&(de(h),Ea(e)),!!E}function Js(e,n){var h=Vs(n,!0);return h?n.shiftKey&&!e.state.keySeq?Bo(e,"Shift-"+h,n,function(c){return Zo(e,c,!0)})||Bo(e,h,n,function(c){if(typeof c=="string"?/^go[A-Z]/.test(c):c.motion)return Zo(e,c)}):Bo(e,h,n,function(c){return Zo(e,c)}):!1}function jl(e,n,h){return Bo(e,"'"+h+"'",n,function(c){return Zo(e,c,!0)})}var us=null;function Qs(e){var n=this;if(e.target&&e.target!=n.display.input.getField())return;if(n.curOp.focus=H(),mt(n,e))return;W&&C<11&&e.keyCode==27&&(e.returnValue=!1);var h=e.keyCode;n.display.shift=h==16||e.shiftKey;var c=Js(n,e);f&&(us=c?h:null,!c&&h==88&&!gt&&(a?e.metaKey:e.ctrlKey)&&n.replaceSelection("",null,"cut")),j&&!a&&!c&&h==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),h==18&&!/\bCodeMirror-crosshair\b/.test(n.display.lineDiv.className)&&Fl(n)}function Fl(e){var n=e.display.lineDiv;F(n,"CodeMirror-crosshair");function h(c){(c.keyCode==18||!c.altKey)&&(_(n,"CodeMirror-crosshair"),It(document,"keyup",h),It(document,"mouseover",h))}Qe(document,"keyup",h),Qe(document,"mouseover",h)}function Zs(e){e.keyCode==16&&(this.doc.sel.shift=!1),mt(this,e)}function qs(e){var n=this;if(e.target&&e.target!=n.display.input.getField())return;if(_a(n.display,e)||mt(n,e)||e.ctrlKey&&!e.altKey||a&&e.metaKey)return;var h=e.keyCode,c=e.charCode;if(f&&h==us){us=null,de(e);return}if(f&&(!e.which||e.which<10)&&Js(n,e))return;var E=String.fromCharCode(c==null?h:c);if(E=="\b")return;if(jl(n,e,E))return;n.display.input.onKeyPress(e)}var Bl=400,cs=function(e,n,h){this.time=e,this.pos=n,this.button=h};cs.prototype.compare=function(e,n,h){return this.time+Bl>e&&ir(n,this.pos)==0&&h==this.button};var Ho,Wo;function Hl(e,n){var h=+new Date;return Wo&&Wo.compare(h,e,n)?(Ho=Wo=null,"triple"):Ho&&Ho.compare(h,e,n)?(Wo=new cs(h,e,n),Ho=null,"double"):(Ho=new cs(h,e,n),Wo=null,"single")}function el(e){var n=this,h=n.display;if(mt(n,e)||h.activeTouch&&h.input.supportsTouch())return;if(h.input.ensurePolled(),h.shift=e.shiftKey,_a(h,e)){r||(h.scroller.draggable=!1,setTimeout(function(){return h.scroller.draggable=!0},100));return}if(ds(n,e))return;var c=ya(n,e),E=lt(e),K=c?Hl(c,E):"single";if(window.focus(),E==1&&n.state.selectingText&&n.state.selectingText(e),c&&Wl(n,E,c,K,e))return;E==1?c?zl(n,c,K,e):Ue(e)==h.scroller&&de(e):E==2?(c&&Vo(n.doc,c),setTimeout(function(){return h.input.focus()},20)):E==3&&(L?n.display.input.onContextMenu(e):Fi(n))}function Wl(e,n,h,c,E){var K="Click";return c=="double"?K="Double"+K:c=="triple"&&(K="Triple"+K),K=(n==1?"Left":n==2?"Middle":"Right")+K,Bo(e,Gs(K,E),E,function(J){if(typeof J=="string"&&(J=Fo[J]),!J)return!1;var ie=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),ie=J(e,h)!=Ne}finally{e.state.suppressEdits=!1}return ie})}function Kl(e,n,h){var c=e.getOption("configureMouse"),E=c?c(e,n,h):{};if(E.unit==null){var K=i?h.shiftKey&&h.metaKey:h.altKey;E.unit=K?"rectangle":n=="single"?"char":n=="double"?"word":"line"}return(E.extend==null||e.doc.extend)&&(E.extend=e.doc.extend||h.shiftKey),E.addNew==null&&(E.addNew=a?h.metaKey:h.ctrlKey),E.moveOnDrag==null&&(E.moveOnDrag=!(a?h.altKey:h.ctrlKey)),E}function zl(e,n,h,c){W?setTimeout(k(Si,e),0):e.curOp.focus=H();var E=Kl(e,h,c),K=e.doc.sel,J;e.options.dragDrop&&Ot&&!e.isReadOnly()&&h=="single"&&(J=K.contains(n))>-1&&(ir((J=K.ranges[J]).from(),n)<0||n.xRel>0)&&(ir(J.to(),n)>0||n.xRel<0)?Gl(e,c,n,E):Vl(e,c,n,E)}function Gl(e,n,h,c){var E=e.display,K=!1,J=xa(e,function(pe){r&&(E.scroller.draggable=!1),e.state.draggingText=!1,It(E.wrapper.ownerDocument,"mouseup",J),It(E.wrapper.ownerDocument,"mousemove",ie),It(E.scroller,"dragstart",se),It(E.scroller,"drop",J),K||(de(pe),c.addNew||Vo(e.doc,h,null,null,c.extend),r&&!p||W&&C==9?setTimeout(function(){E.wrapper.ownerDocument.body.focus({preventScroll:!0}),E.input.focus()},20):E.input.focus())}),ie=function(pe){K=K||Math.abs(n.clientX-pe.clientX)+Math.abs(n.clientY-pe.clientY)>=10},se=function(){return K=!0};r&&(E.scroller.draggable=!0),e.state.draggingText=J,J.copy=!c.moveOnDrag,E.scroller.dragDrop&&E.scroller.dragDrop(),Qe(E.wrapper.ownerDocument,"mouseup",J),Qe(E.wrapper.ownerDocument,"mousemove",ie),Qe(E.scroller,"dragstart",se),Qe(E.scroller,"drop",J),Fi(e),setTimeout(function(){return E.input.focus()},20)}function tl(e,n,h){if(h=="char")return new zr(n,n);if(h=="word")return e.findWordAt(n);if(h=="line")return new zr(hn(n.line,0),N(e.doc,hn(n.line+1,0)));var c=h(e,n);return new zr(c.from,c.to)}function Vl(e,n,h,c){var E=e.display,K=e.doc;de(n);var J,ie,se=K.sel,pe=se.ranges;if(c.addNew&&!c.extend?(ie=K.sel.contains(h),ie>-1?J=pe[ie]:J=new zr(h,h)):(J=K.sel.primary(),ie=K.sel.primIndex),c.unit=="rectangle")c.addNew||(J=new zr(h,h)),h=ya(e,n,!0,!0),ie=-1;else{var Xe=tl(e,h,c.unit);c.extend?J=as(J,Xe.anchor,Xe.head,c.extend):J=Xe}c.addNew?ie==-1?(ie=pe.length,ai(K,Or(e,pe.concat([J]),ie),{scroll:!1,origin:"*mouse"})):pe.length>1&&pe[ie].empty()&&c.unit=="char"&&!c.extend?(ai(K,Or(e,pe.slice(0,ie).concat(pe.slice(ie+1)),0),{scroll:!1,origin:"*mouse"}),se=K.sel):is(K,ie,J,Te):(ie=0,ai(K,new qa([J],0),Te),se=K.sel);var nt=h;function wt(Fn){if(ir(nt,Fn)==0)return;if(nt=Fn,c.unit=="rectangle"){for(var rr=[],wr=e.options.tabSize,gr=z(yn(K,h.line).text,h.ch,wr),Fr=z(yn(K,Fn.line).text,Fn.ch,wr),pa=Math.min(gr,Fr),$a=Math.max(gr,Fr),Sa=Math.min(h.line,Fn.line),vi=Math.min(e.lastLine(),Math.max(h.line,Fn.line));Sa<=vi;Sa++){var hi=yn(K,Sa).text,Fa=Ve(hi,pa,wr);pa==$a?rr.push(new zr(hn(Sa,Fa),hn(Sa,Fa))):hi.length>Fa&&rr.push(new zr(hn(Sa,Fa),hn(Sa,Ve(hi,$a,wr))))}rr.length||rr.push(new zr(h,h)),ai(K,Or(e,se.ranges.slice(0,ie).concat(rr),ie),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Fn)}else{var fi=J,ei=tl(e,Fn,c.unit),Ka=fi.anchor,Ba;ir(ei.anchor,Ka)>0?(Ba=ei.head,Ka=la(fi.from(),ei.anchor)):(Ba=ei.anchor,Ka=sa(fi.to(),ei.head));var Da=se.ranges.slice(0);Da[ie]=Yl(e,new zr(N(K,Ka),Ba)),ai(K,Or(e,Da,ie),Te)}}var _t=E.wrapper.getBoundingClientRect(),rn=0;function _n(Fn){var rr=++rn,wr=ya(e,Fn,!0,c.unit=="rectangle");if(!wr)return;if(ir(wr,nt)!=0){e.curOp.focus=H(),wt(wr);var gr=Ri(E,K);(wr.line>=gr.to||wr.line<gr.from)&&setTimeout(xa(e,function(){rn==rr&&_n(Fn)}),150)}else{var Fr=Fn.clientY<_t.top?-20:Fn.clientY>_t.bottom?20:0;Fr&&setTimeout(xa(e,function(){if(rn!=rr)return;E.scroller.scrollTop+=Fr,_n(Fn)}),50)}}function In(Fn){e.state.selectingText=!1,rn=Infinity,Fn&&(de(Fn),E.input.focus()),It(E.wrapper.ownerDocument,"mousemove",jn),It(E.wrapper.ownerDocument,"mouseup",Jn),K.history.lastSelOrigin=null}var jn=xa(e,function(Fn){Fn.buttons===0||!lt(Fn)?In(Fn):_n(Fn)}),Jn=xa(e,In);e.state.selectingText=Jn,Qe(E.wrapper.ownerDocument,"mousemove",jn),Qe(E.wrapper.ownerDocument,"mouseup",Jn)}function Yl(e,n){var h=n.anchor,c=n.head,E=yn(e.doc,h.line);if(ir(h,c)==0&&h.sticky==c.sticky)return n;var K=sn(E);if(!K)return n;var J=qe(K,h.ch,h.sticky),ie=K[J];if(ie.from!=h.ch&&ie.to!=h.ch)return n;var se=J+(ie.from==h.ch==(ie.level!=1)?0:1);if(se==0||se==K.length)return n;var pe;if(c.line!=h.line)pe=(c.line-h.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Xe=qe(K,c.ch,c.sticky),nt=Xe-J||(c.ch-h.ch)*(ie.level==1?-1:1);Xe==se-1||Xe==se?pe=nt<0:pe=nt>0}var wt=K[se+(pe?-1:0)],_t=pe==(wt.level==1),rn=_t?wt.from:wt.to,_n=_t?"after":"before";return h.ch==rn&&h.sticky==_n?n:new zr(new hn(h.line,rn,_n),c)}function nl(e,n,h,c){var E,K;if(n.touches)E=n.touches[0].clientX,K=n.touches[0].clientY;else try{E=n.clientX,K=n.clientY}catch(wt){return!1}if(E>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;c&&de(n);var J=e.display,ie=J.lineDiv.getBoundingClientRect();if(K>ie.bottom||!De(e,h))return Ee(n);K-=ie.top-J.viewOffset;for(var se=0;se<e.display.gutterSpecs.length;++se){var pe=J.gutters.childNodes[se];if(pe&&pe.getBoundingClientRect().right>=E){var Xe=Pr(e.doc,K),nt=e.display.gutterSpecs[se];return dt(e,h,e,Xe,nt.className,n),Ee(n)}}}function ds(e,n){return nl(e,n,"gutterClick",!0)}function rl(e,n){if(_a(e.display,n)||Xl(e,n))return;if(mt(e,n,"contextmenu"))return;L||e.display.input.onContextMenu(n)}function Xl(e,n){return De(e,"gutterContextMenu")?nl(e,n,"gutterContextMenu",!1):!1}function al(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),yr(e)}var To={toString:function(){return"CodeMirror.Init"}},il={},qo={};function $l(e){var n=e.optionHandlers;function h(c,E,K,J){e.defaults[c]=E,K&&(n[c]=J?function(ie,se,pe){pe!=To&&K(ie,se,pe)}:K)}e.defineOption=h,e.Init=To,h("value","",function(c,E){return c.setValue(E)},!0),h("mode",null,function(c,E){c.doc.modeOption=E,ja(c)},!0),h("indentUnit",2,ja,!0),h("indentWithTabs",!1),h("smartIndent",!0),h("tabSize",4,function(c){li(c),yr(c),Vr(c)},!0),h("lineSeparator",null,function(c,E){if(c.doc.lineSep=E,!E)return;var K=[],J=c.doc.first;c.doc.iter(function(se){for(var pe=0;;){var Xe=se.text.indexOf(E,pe);if(Xe==-1)break;pe=Xe+E.length,K.push(hn(J,Xe))}J++});for(var ie=K.length-1;ie>=0;ie--)Eo(c.doc,E,K[ie],hn(K[ie].line,K[ie].ch+E.length))}),h("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(c,E,K){c.state.specialChars=new RegExp(E.source+(E.test(" ")?"":"| "),"g"),K!=To&&c.refresh()}),h("specialCharPlaceholder",Un,function(c){return c.refresh()},!0),h("electricChars",!0),h("inputStyle",u?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),h("spellcheck",!1,function(c,E){return c.getInputField().spellcheck=E},!0),h("autocorrect",!1,function(c,E){return c.getInputField().autocorrect=E},!0),h("autocapitalize",!1,function(c,E){return c.getInputField().autocapitalize=E},!0),h("rtlMoveVisually",!D),h("wholeLineUpdateBefore",!0),h("theme","default",function(c){al(c),yi(c)},!0),h("keyMap","default",function(c,E,K){var J=Qo(E),ie=K!=To&&Qo(K);ie&&ie.detach&&ie.detach(c,J),J.attach&&J.attach(c,ie||null)}),h("extraKeys",null),h("configureMouse",null),h("lineWrapping",!1,Ql,!0),h("gutters",[],function(c,E){c.display.gutterSpecs=Xa(E,c.options.lineNumbers),yi(c)},!0),h("fixedGutter",!0,function(c,E){c.display.gutters.style.left=E?na(c.display)+"px":"0",c.refresh()},!0),h("coverGutterNextToScrollbar",!1,function(c){return wi(c)},!0),h("scrollbarStyle","native",function(c){qi(c),wi(c),c.display.scrollbars.setScrollTop(c.doc.scrollTop),c.display.scrollbars.setScrollLeft(c.doc.scrollLeft)},!0),h("lineNumbers",!1,function(c,E){c.display.gutterSpecs=Xa(c.options.gutters,E),yi(c)},!0),h("firstLineNumber",1,yi,!0),h("lineNumberFormatter",function(c){return c},yi,!0),h("showCursorWhenSelecting",!1,Hr,!0),h("resetSelectionOnContextMenu",!0),h("lineWiseCopyCut",!0),h("pasteLinesPerSelection",!0),h("selectionsMayTouch",!1),h("readOnly",!1,function(c,E){E=="nocursor"&&(Ya(c),c.display.input.blur()),c.display.input.readOnlyChanged(E)}),h("screenReaderLabel",null,function(c,E){E=E===""?null:E,c.display.input.screenReaderLabelChanged(E)}),h("disableInput",!1,function(c,E){E||c.display.input.reset()},!0),h("dragDrop",!0,Jl),h("allowDropFileTypes",null),h("cursorBlinkRate",530),h("cursorScrollMargin",0),h("cursorHeight",1,Hr,!0),h("singleCursorHeightPerLine",!0,Hr,!0),h("workTime",100),h("workDelay",100),h("flattenSpans",!0,li,!0),h("addModeClass",!1,li,!0),h("pollInterval",100),h("undoDepth",200,function(c,E){return c.doc.history.undoDepth=E}),h("historyEventDelay",1250),h("viewportMargin",10,function(c){return c.refresh()},!0),h("maxHighlightLength",1e4,li,!0),h("moveInputWithCursor",!0,function(c,E){E||c.display.input.resetPosition()}),h("tabindex",null,function(c,E){return c.display.input.getField().tabIndex=E||""}),h("autofocus",null),h("direction","ltr",function(c,E){return c.doc.setDirection(E)},!0),h("phrases",null)}function Jl(e,n,h){var c=h&&h!=To;if(!n!=!c){var E=e.display.dragFunctions,K=n?Qe:It;K(e.display.scroller,"dragstart",E.start),K(e.display.scroller,"dragenter",E.enter),K(e.display.scroller,"dragover",E.over),K(e.display.scroller,"dragleave",E.leave),K(e.display.scroller,"drop",E.drop)}}function Ql(e){e.options.lineWrapping?(F(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(_(e.display.wrapper,"CodeMirror-wrap"),Dn(e)),La(e),Vr(e),yr(e),setTimeout(function(){return wi(e)},100)}function wa(e,n){var h=this;if(!(this instanceof wa))return new wa(e,n);this.options=n=n?d(n):{},d(il,n,!1);var c=n.value;typeof c=="string"?c=new di(c,n.mode,null,n.lineSeparator,n.direction):n.mode&&(c.modeOption=n.mode),this.doc=c;var E=new wa.inputStyles[n.inputStyle](this),K=this.display=new zi(e,c,E,n);K.wrapper.CodeMirror=this,al(this),n.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),qi(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 Y,keySeq:null,specialChars:null},n.autofocus&&!u&&K.input.focus(),W&&C<11&&setTimeout(function(){return h.display.input.reset(!0)},20),Zl(this),Al(),_i(this),this.curOp.forceUpdate=!0,vs(this,c),n.autofocus&&!u||this.hasFocus()?setTimeout(function(){h.hasFocus()&&!h.state.focused&&Ma(h)},20):Ya(this);for(var J in qo)qo.hasOwnProperty(J)&&qo[J](this,n[J],To);ga(this),n.finishInit&&n.finishInit(this);for(var ie=0;ie<hs.length;++ie)hs[ie](this);Pi(this),r&&n.lineWrapping&&getComputedStyle(K.lineDiv).textRendering=="optimizelegibility"&&(K.lineDiv.style.textRendering="auto")}wa.defaults=il,wa.optionHandlers=qo;function Zl(e){var n=e.display;Qe(n.scroller,"mousedown",xa(e,el)),W&&C<11?Qe(n.scroller,"dblclick",xa(e,function(se){if(mt(e,se))return;var pe=ya(e,se);if(!pe||ds(e,se)||_a(e.display,se))return;de(se);var Xe=e.findWordAt(pe);Vo(e.doc,Xe.anchor,Xe.head)})):Qe(n.scroller,"dblclick",function(se){return mt(e,se)||de(se)}),Qe(n.scroller,"contextmenu",function(se){return rl(e,se)}),Qe(n.input.getField(),"contextmenu",function(se){n.scroller.contains(se.target)||rl(e,se)});var h,c={end:0};function E(){n.activeTouch&&(h=setTimeout(function(){return n.activeTouch=null},1e3),c=n.activeTouch,c.end=+new Date)}function K(se){if(se.touches.length!=1)return!1;var pe=se.touches[0];return pe.radiusX<=1&&pe.radiusY<=1}function J(se,pe){if(pe.left==null)return!0;var Xe=pe.left-se.left,nt=pe.top-se.top;return Xe*Xe+nt*nt>20*20}Qe(n.scroller,"touchstart",function(se){if(!mt(e,se)&&!K(se)&&!ds(e,se)){n.input.ensurePolled(),clearTimeout(h);var pe=+new Date;n.activeTouch={start:pe,moved:!1,prev:pe-c.end<=300?c:null},se.touches.length==1&&(n.activeTouch.left=se.touches[0].pageX,n.activeTouch.top=se.touches[0].pageY)}}),Qe(n.scroller,"touchmove",function(){n.activeTouch&&(n.activeTouch.moved=!0)}),Qe(n.scroller,"touchend",function(se){var pe=n.activeTouch;if(pe&&!_a(n,se)&&pe.left!=null&&!pe.moved&&new Date-pe.start<300){var Xe=e.coordsChar(n.activeTouch,"page"),nt;!pe.prev||J(pe,pe.prev)?nt=new zr(Xe,Xe):!pe.prev.prev||J(pe,pe.prev.prev)?nt=e.findWordAt(Xe):nt=new zr(hn(Xe.line,0),N(e.doc,hn(Xe.line+1,0))),e.setSelection(nt.anchor,nt.head),e.focus(),de(se)}E()}),Qe(n.scroller,"touchcancel",E),Qe(n.scroller,"scroll",function(){n.scroller.clientHeight&&(Ni(e,n.scroller.scrollTop),Wa(e,n.scroller.scrollLeft,!0),dt(e,"scroll",e))}),Qe(n.scroller,"mousewheel",function(se){return Yi(e,se)}),Qe(n.scroller,"DOMMouseScroll",function(se){return Yi(e,se)}),Qe(n.wrapper,"scroll",function(){return n.wrapper.scrollTop=n.wrapper.scrollLeft=0}),n.dragFunctions={enter:function(se){mt(e,se)||Pe(se)},over:function(se){mt(e,se)||(Rl(e,se),Pe(se))},start:function(se){return Sl(e,se)},drop:xa(e,Ol),leave:function(se){mt(e,se)||Hs(e)}};var ie=n.input.getField();Qe(ie,"keyup",function(se){return Zs.call(e,se)}),Qe(ie,"keydown",xa(e,Qs)),Qe(ie,"keypress",xa(e,qs)),Qe(ie,"focus",function(se){return Ma(e,se)}),Qe(ie,"blur",function(se){return Ya(e,se)})}var hs=[];wa.defineInitHook=function(e){return hs.push(e)};function Ko(e,n,h,c){var E=e.doc,K;h==null&&(h="add"),h=="smart"&&(E.mode.indent?K=On(e,n).state:h="prev");var J=e.options.tabSize,ie=yn(E,n),se=z(ie.text,null,J);ie.stateAfter&&(ie.stateAfter=null);var pe=ie.text.match(/^\s*/)[0],Xe;if(!c&&!/\S/.test(ie.text))Xe=0,h="not";else if(h=="smart"&&(Xe=E.mode.indent(K,ie.text.slice(pe.length),ie.text),Xe==Ne||Xe>150)){if(!c)return;h="prev"}h=="prev"?n>E.first?Xe=z(yn(E,n-1).text,null,J):Xe=0:h=="add"?Xe=se+e.options.indentUnit:h=="subtract"?Xe=se-e.options.indentUnit:typeof h=="number"&&(Xe=se+h),Xe=Math.max(0,Xe);var nt="",wt=0;if(e.options.indentWithTabs)for(var _t=Math.floor(Xe/J);_t;--_t)wt+=J,nt+=" ";if(wt<Xe&&(nt+=ye(Xe-wt)),nt!=pe)return Eo(E,nt,hn(n,0),hn(n,pe.length),"+input"),ie.stateAfter=null,!0;for(var rn=0;rn<E.sel.ranges.length;rn++){var _n=E.sel.ranges[rn];if(_n.head.line==n&&_n.head.ch<pe.length){var In=hn(n,pe.length);is(E,rn,new zr(In,In));break}}}var Mi=null;function es(e){Mi=e}function fs(e,n,h,c,E){var K=e.doc;e.display.shift=!1,c||(c=K.sel);var J=+new Date-200,ie=E=="paste"||e.state.pasteIncoming>J,se=xt(n),pe=null;if(ie&&c.ranges.length>1)if(Mi&&Mi.text.join(`
`)==n){if(c.ranges.length%Mi.text.length==0){pe=[];for(var Xe=0;Xe<Mi.text.length;Xe++)pe.push(K.splitLines(Mi.text[Xe]))}}else se.length==c.ranges.length&&e.options.pasteLinesPerSelection&&(pe=Se(se,function(jn){return[jn]}));for(var nt=e.curOp.updateInput,wt=c.ranges.length-1;wt>=0;wt--){var _t=c.ranges[wt],rn=_t.from(),_n=_t.to();_t.empty()&&(h&&h>0?rn=hn(rn.line,rn.ch-h):e.state.overwrite&&!ie?_n=hn(_n.line,Math.min(yn(K,_n.line).text.length,_n.ch+oe(se).length)):ie&&Mi&&Mi.lineWise&&Mi.text.join(`
`)==se.join(`
`)&&(rn=_n=hn(rn.line,0)));var In={from:rn,to:_n,text:pe?pe[wt%pe.length]:se,origin:E||(ie?"paste":e.state.cutIncoming>J?"cut":"+input")};bo(e.doc,In),dn(e,"inputRead",e,In)}n&&!ie&&sl(e,n),tr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=nt),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ol(e,n){var h=e.clipboardData&&e.clipboardData.getData("Text");if(h)return e.preventDefault(),!n.isReadOnly()&&!n.options.disableInput&&Za(n,function(){return fs(n,h,0,null,"paste")}),!0}function sl(e,n){if(!e.options.electricChars||!e.options.smartIndent)return;for(var h=e.doc.sel,c=h.ranges.length-1;c>=0;c--){var E=h.ranges[c];if(E.head.ch>100||c&&h.ranges[c-1].head.line==E.head.line)continue;var K=e.getModeAt(E.head),J=!1;if(K.electricChars){for(var ie=0;ie<K.electricChars.length;ie++)if(n.indexOf(K.electricChars.charAt(ie))>-1){J=Ko(e,E.head.line,"smart");break}}else K.electricInput&&(K.electricInput.test(yn(e.doc,E.head.line).text.slice(0,E.head.ch))&&(J=Ko(e,E.head.line,"smart")));J&&dn(e,"electricInput",e,E.head.line)}}function ll(e){for(var n=[],h=[],c=0;c<e.doc.sel.ranges.length;c++){var E=e.doc.sel.ranges[c].head.line,K={anchor:hn(E,0),head:hn(E+1,0)};h.push(K),n.push(e.getRange(K.anchor,K.head))}return{text:n,ranges:h}}function ul(e,n,h,c){e.setAttribute("autocorrect",h?"":"off"),e.setAttribute("autocapitalize",c?"":"off"),e.setAttribute("spellcheck",!!n)}function cl(){var e=m("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),n=m("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"),ul(e),n}function ql(e){var n=e.optionHandlers,h=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(c,E){var K=this.options,J=K[c];if(K[c]==E&&c!="mode")return;K[c]=E,n.hasOwnProperty(c)&&xa(this,n[c])(this,E,J),dt(this,"optionChange",this,c)},getOption:function(c){return this.options[c]},getDoc:function(){return this.doc},addKeyMap:function(c,E){this.state.keyMaps[E?"push":"unshift"](Qo(c))},removeKeyMap:function(c){for(var E=this.state.keyMaps,K=0;K<E.length;++K)if(E[K]==c||E[K].name==c)return E.splice(K,1),!0},addOverlay:Ua(function(c,E){var K=c.token?c:e.getMode(this.options,c);if(K.startState)throw new Error("Overlays may not be stateful.");_e(this.state.overlays,{mode:K,modeSpec:c,opaque:E&&E.opaque,priority:E&&E.priority||0},function(J){return J.priority}),this.state.modeGen++,Vr(this)}),removeOverlay:Ua(function(c){for(var E=this.state.overlays,K=0;K<E.length;++K){var J=E[K].modeSpec;if(J==c||typeof c=="string"&&J.name==c){E.splice(K,1),this.state.modeGen++,Vr(this);return}}}),indentLine:Ua(function(c,E,K){typeof E!="string"&&typeof E!="number"&&(E==null?E=this.options.smartIndent?"smart":"prev":E=E?"add":"subtract"),Qr(this.doc,c)&&Ko(this,c,E,K)}),indentSelection:Ua(function(c){for(var E=this.doc.sel.ranges,K=-1,J=0;J<E.length;J++){var ie=E[J];if(ie.empty())ie.head.line>K&&(Ko(this,ie.head.line,c,!0),K=ie.head.line,J==this.doc.sel.primIndex&&tr(this));else{var se=ie.from(),pe=ie.to(),Xe=Math.max(K,se.line);K=Math.min(this.lastLine(),pe.line-(pe.ch?0:1))+1;for(var nt=Xe;nt<K;++nt)Ko(this,nt,c);var wt=this.doc.sel.ranges;se.ch==0&&E.length==wt.length&&wt[J].from().ch>0&&is(this.doc,J,new zr(se,wt[J].to()),Ce)}}}),getTokenAt:function(c,E){return Kr(this,c,E)},getLineTokens:function(c,E){return Kr(this,hn(c),E,!0)},getTokenTypeAt:function(c){c=N(this.doc,c);var E=Jt(this,yn(this.doc,c.line)),K=0,J=(E.length-1)/2,ie=c.ch,se;if(ie==0)se=E[2];else for(;;){var pe=K+J>>1;if((pe?E[pe*2-1]:0)>=ie)J=pe;else if(E[pe*2+1]<ie)K=pe+1;else{se=E[pe*2+2];break}}var Xe=se?se.indexOf("overlay "):-1;return Xe<0?se:Xe==0?null:se.slice(0,Xe-1)},getModeAt:function(c){var E=this.doc.mode;return E.innerMode?e.innerMode(E,this.getTokenAt(c).state).mode:E},getHelper:function(c,E){return this.getHelpers(c,E)[0]},getHelpers:function(c,E){var K=[];if(!h.hasOwnProperty(E))return K;var J=h[E],ie=this.getModeAt(c);if(typeof ie[E]=="string")J[ie[E]]&&K.push(J[ie[E]]);else if(ie[E])for(var se=0;se<ie[E].length;se++){var pe=J[ie[E][se]];pe&&K.push(pe)}else ie.helperType&&J[ie.helperType]?K.push(J[ie.helperType]):J[ie.name]&&K.push(J[ie.name]);for(var Xe=0;Xe<J._global.length;Xe++){var nt=J._global[Xe];nt.pred(ie,this)&&re(K,nt.val)==-1&&K.push(nt.val)}return K},getStateAfter:function(c,E){var K=this.doc;return c=ee(K,c==null?K.first+K.size-1:c),On(this,c+1,E).state},cursorCoords:function(c,E){var K,J=this.doc.sel.primary();return c==null?K=J.head:typeof c=="object"?K=N(this.doc,c):K=c?J.from():J.to(),or(this,K,E||"page")},charCoords:function(c,E){return Nr(this,N(this.doc,c),E||"page")},coordsChar:function(c,E){return c=hr(this,c,E||"page"),xr(this,c.left,c.top)},lineAtHeight:function(c,E){return c=hr(this,{top:c,left:0},E||"page").top,Pr(this.doc,c+this.display.viewOffset)},heightAtLine:function(c,E,K){var J=!1,ie;if(typeof c=="number"){var se=this.doc.first+this.doc.size-1;c<this.doc.first?c=this.doc.first:c>se&&(c=se,J=!0),ie=yn(this.doc,c)}else ie=c;return Rr(this,ie,{top:0,left:0},E||"page",K||J).top+(J?this.doc.height-vn(ie):0)},defaultTextHeight:function(){return Br(this.display)},defaultCharWidth:function(){return Ir(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(c,E,K,J,ie){var se=this.display;c=or(this,N(this.doc,c));var pe=c.bottom,Xe=c.left;if(E.style.position="absolute",E.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(E),se.sizer.appendChild(E),J=="over")pe=c.top;else if(J=="above"||J=="near"){var nt=Math.max(se.wrapper.clientHeight,this.doc.height),wt=Math.max(se.sizer.clientWidth,se.lineSpace.clientWidth);(J=="above"||c.bottom+E.offsetHeight>nt)&&c.top>E.offsetHeight?pe=c.top-E.offsetHeight:c.bottom+E.offsetHeight<=nt&&(pe=c.bottom),Xe+E.offsetWidth>wt&&(Xe=wt-E.offsetWidth)}E.style.top=pe+"px",E.style.left=E.style.right="",ie=="right"?(Xe=se.sizer.clientWidth-E.offsetWidth,E.style.right="0px"):(ie=="left"?Xe=0:ie=="middle"&&(Xe=(se.sizer.clientWidth-E.offsetWidth)/2),E.style.left=Xe+"px"),K&&Ii(this,{left:Xe,top:pe,right:Xe+E.offsetWidth,bottom:pe+E.offsetHeight})},triggerOnKeyDown:Ua(Qs),triggerOnKeyPress:Ua(qs),triggerOnKeyUp:Zs,triggerOnMouseDown:Ua(el),execCommand:function(c){if(Fo.hasOwnProperty(c))return Fo[c].call(null,this)},triggerElectric:Ua(function(c){sl(this,c)}),findPosH:function(c,E,K,J){var ie=1;E<0&&(ie=-1,E=-E);for(var se=N(this.doc,c),pe=0;pe<E&&!(se=ps(this.doc,se,ie,K,J),se.hitSide);++pe);return se},moveH:Ua(function(c,E){var K=this;this.extendSelectionsBy(function(J){return K.display.shift||K.doc.extend||J.empty()?ps(K.doc,J.head,c,E,K.options.rtlMoveVisually):c<0?J.from():J.to()},Fe)}),deleteH:Ua(function(c,E){var K=this.doc.sel,J=this.doc;K.somethingSelected()?J.replaceSelection("",null,"+delete"):wo(this,function(ie){var se=ps(J,ie.head,c,E,!1);return c<0?{from:se,to:ie.head}:{from:ie.head,to:se}})}),findPosV:function(c,E,K,J){var ie=1,se=J;E<0&&(ie=-1,E=-E);for(var pe=N(this.doc,c),Xe=0;Xe<E;++Xe){var nt=or(this,pe,"div");if(se==null?se=nt.left:nt.left=se,pe=dl(this,nt,ie,K),pe.hitSide)break}return pe},moveV:Ua(function(c,E){var K=this,J=this.doc,ie=[],se=!this.display.shift&&!J.extend&&J.sel.somethingSelected();if(J.extendSelectionsBy(function(Xe){if(se)return c<0?Xe.from():Xe.to();var nt=or(K,Xe.head,"div");Xe.goalColumn!=null&&(nt.left=Xe.goalColumn),ie.push(nt.left);var wt=dl(K,nt,c,E);return E=="page"&&Xe==J.sel.primary()&&Pn(K,Nr(K,wt,"div").top-nt.top),wt},Fe),ie.length)for(var pe=0;pe<J.sel.ranges.length;pe++)J.sel.ranges[pe].goalColumn=ie[pe]}),findWordAt:function(c){var E=this.doc,K=yn(E,c.line).text,J=c.ch,ie=c.ch;if(K){var se=this.getHelper(c,"wordChars");(c.sticky=="before"||ie==K.length)&&J?--J:++ie;for(var pe=K.charAt(J),Xe=Q(pe,se)?function(nt){return Q(nt,se)}:/\s/.test(pe)?function(nt){return/\s/.test(nt)}:function(nt){return!/\s/.test(nt)&&!Q(nt)};J>0&&Xe(K.charAt(J-1));)--J;for(;ie<K.length&&Xe(K.charAt(ie));)++ie}return new zr(hn(c.line,J),hn(c.line,ie))},toggleOverwrite:function(c){if(c!=null&&c==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?F(this.display.cursorDiv,"CodeMirror-overwrite"):_(this.display.cursorDiv,"CodeMirror-overwrite"),dt(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==H()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Ua(function(c,E){ra(this,c,E)}),getScrollInfo:function(){var c=this.display.scroller;return{left:c.scrollLeft,top:c.scrollTop,height:c.scrollHeight-ot(this)-this.display.barHeight,width:c.scrollWidth-ot(this)-this.display.barWidth,clientHeight:ce(this),clientWidth:je(this)}},scrollIntoView:Ua(function(c,E){c==null?(c={from:this.doc.sel.primary().head,to:null},E==null&&(E=this.options.cursorScrollMargin)):typeof c=="number"?c={from:hn(c,0),to:null}:c.from==null&&(c={from:c,to:null}),c.to||(c.to=c.from),c.margin=E||0,c.from.line!=null?Cr(this,c):ki(this,c.from,c.to,c.margin)}),setSize:Ua(function(c,E){var K=this,J=function(se){return typeof se=="number"||/^\d+$/.test(String(se))?se+"px":se};c!=null&&(this.display.wrapper.style.width=J(c)),E!=null&&(this.display.wrapper.style.height=J(E)),this.options.lineWrapping&&lr(this);var ie=this.display.viewFrom;this.doc.iter(ie,this.display.viewTo,function(se){if(se.widgets){for(var pe=0;pe<se.widgets.length;pe++)if(se.widgets[pe].noHScroll){Yr(K,ie,"widget");break}}++ie}),this.curOp.forceUpdate=!0,dt(this,"refresh",this)}),operation:function(c){return Za(this,c)},startOperation:function(){return _i(this)},endOperation:function(){return Pi(this)},refresh:Ua(function(){var c=this.display.cachedTextHeight;Vr(this),this.curOp.forceUpdate=!0,yr(this),ra(this,this.doc.scrollLeft,this.doc.scrollTop),to(this.display),(c==null||Math.abs(c-Br(this.display))>.5||this.options.lineWrapping)&&La(this),dt(this,"refresh",this)}),swapDoc:Ua(function(c){var E=this.doc;return E.cm=null,this.state.selectingText&&this.state.selectingText(),vs(this,c),yr(this),this.display.input.reset(),ra(this,c.scrollLeft,c.scrollTop),this.curOp.forceScroll=!0,dn(this,"swapDoc",this,E),E}),phrase:function(c){var E=this.options.phrases;return E&&Object.prototype.hasOwnProperty.call(E,c)?E[c]:c},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}},Le(e),e.registerHelper=function(c,E,K){h.hasOwnProperty(c)||(h[c]=e[c]={_global:[]}),h[c][E]=K},e.registerGlobalHelper=function(c,E,K,J){e.registerHelper(c,E,J),h[c]._global.push({pred:K,val:J})}}function ps(e,n,h,c,E){var K=n,J=h,ie=yn(e,n.line),se=E&&e.direction=="rtl"?-h:h;function pe(){var Jn=n.line+se;return Jn<e.first||Jn>=e.first+e.size?!1:(n=new hn(Jn,n.ch,n.sticky),ie=yn(e,Jn))}function Xe(Jn){var Fn;if(c=="codepoint"){var rr=ie.text.charCodeAt(n.ch+(c>0?0:-1));isNaN(rr)?Fn=null:Fn=new hn(n.line,Math.max(0,Math.min(ie.text.length,n.ch+h*(rr>=55296&&rr<56320?2:1))),-h)}else E?Fn=Il(e.cm,ie,n,h):Fn=ss(ie,n,h);if(Fn==null)if(!Jn&&pe())n=ls(E,e.cm,ie,n.line,se);else return!1;else n=Fn;return!0}if(c=="char"||c=="codepoint")Xe();else if(c=="column")Xe(!0);else if(c=="word"||c=="group")for(var nt=null,wt=c=="group",_t=e.cm&&e.cm.getHelper(n,"wordChars"),rn=!0;!(h<0&&!Xe(!rn));rn=!1){var _n=ie.text.charAt(n.ch)||`
`,In=Q(_n,_t)?"w":wt&&_n==`
`?"n":!wt||/\s/.test(_n)?null:"p";if(wt&&!rn&&!In&&(In="s"),nt&&nt!=In){h<0&&(h=1,Xe(),n.sticky="after");break}if(In&&(nt=In),h>0&&!Xe(!rn))break}var jn=Xo(e,n,K,J,!0);return va(K,jn)&&(jn.hitSide=!0),jn}function dl(e,n,h,c){var E=e.doc,K=n.left,J;if(c=="page"){var ie=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),se=Math.max(ie-.5*Br(e.display),3);J=(h>0?n.bottom:n.top)+h*se}else c=="line"&&(J=h>0?n.bottom+3:n.top-3);for(var pe;!(pe=xr(e,K,J),!pe.outside);){if(h<0?J<=0:J>=E.height){pe.hitSide=!0;break}J+=h*5}return pe}var oa=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Y,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};oa.prototype.init=function(e){var n=this,h=this,c=h.cm,E=h.div=e.lineDiv;ul(E,c.options.spellcheck,c.options.autocorrect,c.options.autocapitalize);function K(ie){for(var se=ie.target;se;se=se.parentNode){if(se==E)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(se.className))break}return!1}Qe(E,"paste",function(ie){if(!K(ie)||mt(c,ie)||ol(ie,c))return;C<=11&&setTimeout(xa(c,function(){return n.updateFromDOM()}),20)}),Qe(E,"compositionstart",function(ie){n.composing={data:ie.data,done:!1}}),Qe(E,"compositionupdate",function(ie){n.composing||(n.composing={data:ie.data,done:!1})}),Qe(E,"compositionend",function(ie){n.composing&&(ie.data!=n.composing.data&&n.readFromDOMSoon(),n.composing.done=!0)}),Qe(E,"touchstart",function(){return h.forceCompositionEnd()}),Qe(E,"input",function(){n.composing||n.readFromDOMSoon()});function J(ie){if(!K(ie)||mt(c,ie))return;if(c.somethingSelected())es({lineWise:!1,text:c.getSelections()}),ie.type=="cut"&&c.replaceSelection("",null,"cut");else if(c.options.lineWiseCopyCut){var se=ll(c);es({lineWise:!0,text:se.text}),ie.type=="cut"&&c.operation(function(){c.setSelections(se.ranges,0,Ce),c.replaceSelection("",null,"cut")})}else return;if(ie.clipboardData){ie.clipboardData.clearData();var pe=Mi.text.join(`
`);if(ie.clipboardData.setData("Text",pe),ie.clipboardData.getData("Text")==pe){ie.preventDefault();return}}var Xe=cl(),nt=Xe.firstChild;c.display.lineSpace.insertBefore(Xe,c.display.lineSpace.firstChild),nt.value=Mi.text.join(`
`);var wt=document.activeElement;U(nt),setTimeout(function(){c.display.lineSpace.removeChild(Xe),wt.focus(),wt==E&&h.showPrimarySelection()},50)}Qe(E,"copy",J),Qe(E,"cut",J)},oa.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},oa.prototype.prepareSelection=function(){var e=Va(this.cm,!1);return e.focus=document.activeElement==this.div,e},oa.prototype.showSelection=function(e,n){if(!e||!this.cm.display.view.length)return;(e.focus||n)&&this.showPrimarySelection(),this.showMultipleSelections(e)},oa.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},oa.prototype.showPrimarySelection=function(){var e=this.getSelection(),n=this.cm,h=n.doc.sel.primary(),c=h.from(),E=h.to();if(n.display.viewTo==n.display.viewFrom||c.line>=n.display.viewTo||E.line<n.display.viewFrom){e.removeAllRanges();return}var K=ts(n,e.anchorNode,e.anchorOffset),J=ts(n,e.focusNode,e.focusOffset);if(K&&!K.bad&&J&&!J.bad&&ir(la(K,J),c)==0&&ir(sa(K,J),E)==0)return;var ie=n.display.view,se=c.line>=n.display.viewFrom&&hl(n,c)||{node:ie[0].measure.map[2],offset:0},pe=E.line<n.display.viewTo&&hl(n,E);if(!pe){var Xe=ie[ie.length-1].measure,nt=Xe.maps?Xe.maps[Xe.maps.length-1]:Xe.map;pe={node:nt[nt.length-1],offset:nt[nt.length-2]-nt[nt.length-3]}}if(!se||!pe){e.removeAllRanges();return}var wt=e.rangeCount&&e.getRangeAt(0),_t;try{_t=x(se.node,se.offset,pe.offset,pe.node)}catch(rn){}_t&&(!j&&n.state.focused?(e.collapse(se.node,se.offset),_t.collapsed||(e.removeAllRanges(),e.addRange(_t))):(e.removeAllRanges(),e.addRange(_t)),wt&&e.anchorNode==null?e.addRange(wt):j&&this.startGracePeriod()),this.rememberSelection()},oa.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)},oa.prototype.showMultipleSelections=function(e){g(this.cm.display.cursorDiv,e.cursors),g(this.cm.display.selectionDiv,e.selection)},oa.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},oa.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var n=e.getRangeAt(0).commonAncestorContainer;return O(this.div,n)},oa.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},oa.prototype.blur=function(){this.div.blur()},oa.prototype.getField=function(){return this.div},oa.prototype.supportsTouch=function(){return!0},oa.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Za(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)},oa.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},oa.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),n=this.cm;if(t&&v&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var h=ts(n,e.anchorNode,e.anchorOffset),c=ts(n,e.focusNode,e.focusOffset);h&&c&&Za(n,function(){ai(n.doc,Bn(h,c),Ce),(h.bad||c.bad)&&(n.curOp.selectionChanged=!0)})},oa.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,n=e.display,h=e.doc.sel.primary(),c=h.from(),E=h.to();if(c.ch==0&&c.line>e.firstLine()&&(c=hn(c.line-1,yn(e.doc,c.line-1).length)),E.ch==yn(e.doc,E.line).text.length&&E.line<e.lastLine()&&(E=hn(E.line+1,0)),c.line<n.viewFrom||E.line>n.viewTo-1)return!1;var K,J,ie;c.line==n.viewFrom||(K=ea(e,c.line))==0?(J=cr(n.view[0].line),ie=n.view[0].node):(J=cr(n.view[K].line),ie=n.view[K-1].node.nextSibling);var se=ea(e,E.line),pe,Xe;if(se==n.view.length-1?(pe=n.viewTo-1,Xe=n.lineDiv.lastChild):(pe=cr(n.view[se+1].line)-1,Xe=n.view[se+1].node.previousSibling),!ie)return!1;for(var nt=e.doc.splitLines(tu(e,ie,Xe,J,pe)),wt=Sr(e.doc,hn(J,0),hn(pe,yn(e.doc,pe).text.length));nt.length>1&&wt.length>1;)if(oe(nt)==oe(wt))nt.pop(),wt.pop(),pe--;else if(nt[0]==wt[0])nt.shift(),wt.shift(),J++;else break;for(var _t=0,rn=0,_n=nt[0],In=wt[0],jn=Math.min(_n.length,In.length);_t<jn&&_n.charCodeAt(_t)==In.charCodeAt(_t);)++_t;for(var Jn=oe(nt),Fn=oe(wt),rr=Math.min(Jn.length-(nt.length==1?_t:0),Fn.length-(wt.length==1?_t:0));rn<rr&&Jn.charCodeAt(Jn.length-rn-1)==Fn.charCodeAt(Fn.length-rn-1);)++rn;if(nt.length==1&&wt.length==1&&J==c.line)for(;_t&&_t>c.ch&&Jn.charCodeAt(Jn.length-rn-1)==Fn.charCodeAt(Fn.length-rn-1);)_t--,rn++;nt[nt.length-1]=Jn.slice(0,Jn.length-rn).replace(/^\u200b+/,""),nt[0]=nt[0].slice(_t).replace(/\u200b+$/,"");var wr=hn(J,_t),gr=hn(pe,wt.length?oe(wt).length-rn:0);if(nt.length>1||nt[0]||ir(wr,gr))return Eo(e.doc,nt,wr,gr,"+input"),!0},oa.prototype.ensurePolled=function(){this.forceCompositionEnd()},oa.prototype.reset=function(){this.forceCompositionEnd()},oa.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},oa.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)},oa.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Za(this.cm,function(){return Vr(e.cm)})},oa.prototype.setUneditable=function(e){e.contentEditable="false"},oa.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||xa(this.cm,fs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},oa.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},oa.prototype.onContextMenu=function(){},oa.prototype.resetPosition=function(){},oa.prototype.needsContentAttribute=!0;function hl(e,n){var h=ut(e,n.line);if(!h||h.hidden)return null;var c=yn(e.doc,n.line),E=me(h,c,n.line),K=sn(c,e.doc.direction),J="left";if(K){var ie=qe(K,n.ch);J=ie%2?"right":"left"}var se=tn(E.map,n.ch,J);return se.offset=se.collapse=="right"?se.end:se.start,se}function eu(e){for(var n=e;n;n=n.parentNode)if(/CodeMirror-gutter-wrapper/.test(n.className))return!0;return!1}function Oo(e,n){return n&&(e.bad=!0),e}function tu(e,n,h,c,E){var K="",J=!1,ie=e.doc.lineSeparator(),se=!1;function pe(_t){return function(rn){return rn.id==_t}}function Xe(){J&&(K+=ie,se&&(K+=ie),J=se=!1)}function nt(_t){_t&&(Xe(),K+=_t)}function wt(_t){if(_t.nodeType==1){var rn=_t.getAttribute("cm-text");if(rn){nt(rn);return}var _n=_t.getAttribute("cm-marker"),In;if(_n){var jn=e.findMarks(hn(c,0),hn(E+1,0),pe(+_n));jn.length&&(In=jn[0].find(0))&&nt(Sr(e.doc,In.from,In.to).join(ie));return}if(_t.getAttribute("contenteditable")=="false")return;var Jn=/^(pre|div|p|li|table|br)$/i.test(_t.nodeName);if(!/^br$/i.test(_t.nodeName)&&_t.textContent.length==0)return;Jn&&Xe();for(var Fn=0;Fn<_t.childNodes.length;Fn++)wt(_t.childNodes[Fn]);/^(pre|p)$/i.test(_t.nodeName)&&(se=!0),Jn&&(J=!0)}else _t.nodeType==3&&nt(_t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(wt(n),n==h);)n=n.nextSibling,se=!1;return K}function ts(e,n,h){var c;if(n==e.display.lineDiv){if(c=e.display.lineDiv.childNodes[h],!c)return Oo(e.clipPos(hn(e.display.viewTo-1)),!0);n=null,h=0}else for(c=n;;c=c.parentNode){if(!c||c==e.display.lineDiv)return null;if(c.parentNode&&c.parentNode==e.display.lineDiv)break}for(var E=0;E<e.display.view.length;E++){var K=e.display.view[E];if(K.node==c)return nu(K,n,h)}}function nu(e,n,h){var c=e.text.firstChild,E=!1;if(!n||!O(c,n))return Oo(hn(cr(e.line),0),!0);if(n==c&&(E=!0,n=c.childNodes[h],h=0,!n)){var K=e.rest?oe(e.rest):e.line;return Oo(hn(cr(K),K.text.length),E)}var J=n.nodeType==3?n:null,ie=n;for(!J&&n.childNodes.length==1&&n.firstChild.nodeType==3&&(J=n.firstChild,h&&(h=J.nodeValue.length));ie.parentNode!=c;)ie=ie.parentNode;var se=e.measure,pe=se.maps;function Xe(In,jn,Jn){for(var Fn=-1;Fn<(pe?pe.length:0);Fn++)for(var rr=Fn<0?se.map:pe[Fn],wr=0;wr<rr.length;wr+=3){var gr=rr[wr+2];if(gr==In||gr==jn){var Fr=cr(Fn<0?e.line:e.rest[Fn]),pa=rr[wr]+Jn;return(Jn<0||gr!=In)&&(pa=rr[wr+(Jn?1:0)]),hn(Fr,pa)}}}var nt=Xe(J,ie,h);if(nt)return Oo(nt,E);for(var wt=ie.nextSibling,_t=J?J.nodeValue.length-h:0;wt;wt=wt.nextSibling){if(nt=Xe(wt,wt.firstChild,0),nt)return Oo(hn(nt.line,nt.ch-_t),E);_t+=wt.textContent.length}for(var rn=ie.previousSibling,_n=h;rn;rn=rn.previousSibling){if(nt=Xe(rn,rn.firstChild,-1),nt)return Oo(hn(nt.line,nt.ch+_n),E);_n+=rn.textContent.length}}var ka=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Y,this.hasSelection=!1,this.composing=null};ka.prototype.init=function(e){var n=this,h=this,c=this.cm;this.createField(e);var E=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),s&&(E.style.width="0px"),Qe(E,"input",function(){W&&C>=9&&n.hasSelection&&(n.hasSelection=null),h.poll()}),Qe(E,"paste",function(J){if(mt(c,J)||ol(J,c))return;c.state.pasteIncoming=+new Date,h.fastPoll()});function K(J){if(mt(c,J))return;if(c.somethingSelected())es({lineWise:!1,text:c.getSelections()});else if(c.options.lineWiseCopyCut){var ie=ll(c);es({lineWise:!0,text:ie.text}),J.type=="cut"?c.setSelections(ie.ranges,null,Ce):(h.prevInput="",E.value=ie.text.join(`
`),U(E))}else return;J.type=="cut"&&(c.state.cutIncoming=+new Date)}Qe(E,"cut",K),Qe(E,"copy",K),Qe(e.scroller,"paste",function(J){if(_a(e,J)||mt(c,J))return;if(!E.dispatchEvent){c.state.pasteIncoming=+new Date,h.focus();return}var ie=new Event("paste");ie.clipboardData=J.clipboardData,E.dispatchEvent(ie)}),Qe(e.lineSpace,"selectstart",function(J){_a(e,J)||de(J)}),Qe(E,"compositionstart",function(){var J=c.getCursor("from");h.composing&&h.composing.range.clear(),h.composing={start:J,range:c.markText(J,c.getCursor("to"),{className:"CodeMirror-composing"})}}),Qe(E,"compositionend",function(){h.composing&&(h.poll(),h.composing.range.clear(),h.composing=null)})},ka.prototype.createField=function(e){this.wrapper=cl(),this.textarea=this.wrapper.firstChild},ka.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ka.prototype.prepareSelection=function(){var e=this.cm,n=e.display,h=e.doc,c=Va(e);if(e.options.moveInputWithCursor){var E=or(e,h.sel.primary().head,"div"),K=n.wrapper.getBoundingClientRect(),J=n.lineDiv.getBoundingClientRect();c.teTop=Math.max(0,Math.min(n.wrapper.clientHeight-10,E.top+J.top-K.top)),c.teLeft=Math.max(0,Math.min(n.wrapper.clientWidth-10,E.left+J.left-K.left))}return c},ka.prototype.showSelection=function(e){var n=this.cm,h=n.display;g(h.cursorDiv,e.cursors),g(h.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ka.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var n=this.cm;if(n.somethingSelected()){this.prevInput="";var h=n.getSelection();this.textarea.value=h,n.state.focused&&U(this.textarea),W&&C>=9&&(this.hasSelection=h)}else e||(this.prevInput=this.textarea.value="",W&&C>=9&&(this.hasSelection=null))},ka.prototype.getField=function(){return this.textarea},ka.prototype.supportsTouch=function(){return!1},ka.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!u||H()!=this.textarea))try{this.textarea.focus()}catch(e){}},ka.prototype.blur=function(){this.textarea.blur()},ka.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ka.prototype.receivedFocus=function(){this.slowPoll()},ka.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()})},ka.prototype.fastPoll=function(){var e=!1,n=this;n.pollingFast=!0;function h(){var c=n.poll();!c&&!e?(e=!0,n.polling.set(60,h)):(n.pollingFast=!1,n.slowPoll())}n.polling.set(20,h)},ka.prototype.poll=function(){var e=this,n=this.cm,h=this.textarea,c=this.prevInput;if(this.contextMenuPending||!n.state.focused||Rt(h)&&!c&&!this.composing||n.isReadOnly()||n.options.disableInput||n.state.keySeq)return!1;var E=h.value;if(E==c&&!n.somethingSelected())return!1;if(W&&C>=9&&this.hasSelection===E||a&&/[\uf700-\uf7ff]/.test(E))return n.display.input.reset(),!1;if(n.doc.sel==n.display.selForContextMenu){var K=E.charCodeAt(0);if(K==8203&&!c&&(c="\u200B"),K==8666)return this.reset(),this.cm.execCommand("undo")}for(var J=0,ie=Math.min(c.length,E.length);J<ie&&c.charCodeAt(J)==E.charCodeAt(J);)++J;return Za(n,function(){fs(n,E.slice(J),c.length-J,null,e.composing?"*compose":null),E.length>1e3||E.indexOf(`
`)>-1?h.value=e.prevInput="":e.prevInput=E,e.composing&&(e.composing.range.clear(),e.composing.range=n.markText(e.composing.start,n.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ka.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ka.prototype.onKeyPress=function(){W&&C>=9&&(this.hasSelection=null),this.fastPoll()},ka.prototype.onContextMenu=function(e){var n=this,h=n.cm,c=h.display,E=n.textarea;n.contextMenuPending&&n.contextMenuPending();var K=ya(h,e),J=c.scroller.scrollTop;if(!K||f)return;var ie=h.options.resetSelectionOnContextMenu;ie&&h.doc.sel.contains(K)==-1&&xa(h,ai)(h.doc,Bn(K),Ce);var se=E.style.cssText,pe=n.wrapper.style.cssText,Xe=n.wrapper.offsetParent.getBoundingClientRect();n.wrapper.style.cssText="position: static",E.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-Xe.top-5)+"px; left: "+(e.clientX-Xe.left-5)+`px;
z-index: 1000; background: `+(W?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var nt;r&&(nt=window.scrollY),c.input.focus(),r&&window.scrollTo(null,nt),c.input.reset(),h.somethingSelected()||(E.value=n.prevInput=" "),n.contextMenuPending=_t,c.selForContextMenu=h.doc.sel,clearTimeout(c.detectingSelectAll);function wt(){if(E.selectionStart!=null){var _n=h.somethingSelected(),In="\u200B"+(_n?E.value:"");E.value="\u21DA",E.value=In,n.prevInput=_n?"":"\u200B",E.selectionStart=1,E.selectionEnd=In.length,c.selForContextMenu=h.doc.sel}}function _t(){if(n.contextMenuPending!=_t)return;if(n.contextMenuPending=!1,n.wrapper.style.cssText=pe,E.style.cssText=se,W&&C<9&&c.scrollbars.setScrollTop(c.scroller.scrollTop=J),E.selectionStart!=null){(!W||W&&C<9)&&wt();var _n=0,In=function(){c.selForContextMenu==h.doc.sel&&E.selectionStart==0&&E.selectionEnd>0&&n.prevInput=="\u200B"?xa(h,Ds)(h):_n++<10?c.detectingSelectAll=setTimeout(In,500):(c.selForContextMenu=null,c.input.reset())};c.detectingSelectAll=setTimeout(In,200)}}if(W&&C>=9&&wt(),L){Pe(e);var rn=function(){It(window,"mouseup",rn),setTimeout(_t,20)};Qe(window,"mouseup",rn)}else setTimeout(_t,50)},ka.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},ka.prototype.setUneditable=function(){},ka.prototype.needsContentAttribute=!1;function ru(e,n){if(n=n?d(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 h=H();n.autofocus=h==e||e.getAttribute("autofocus")!=null&&h==document.body}function c(){e.value=ie.getValue()}var E;if(e.form&&(Qe(e.form,"submit",c),!n.leaveSubmitMethodAlone)){var K=e.form;E=K.submit;try{var J=K.submit=function(){c(),K.submit=E,K.submit(),K.submit=J}}catch(se){}}n.finishInit=function(se){se.save=c,se.getTextArea=function(){return e},se.toTextArea=function(){se.toTextArea=isNaN,c(),e.parentNode.removeChild(se.getWrapperElement()),e.style.display="",e.form&&(It(e.form,"submit",c),!n.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=E))}},e.style.display="none";var ie=wa(function(se){return e.parentNode.insertBefore(se,e.nextSibling)},n);return ie}function au(e){e.off=It,e.on=Qe,e.wheelEventPixels=Vi,e.Doc=di,e.splitLines=xt,e.countColumn=z,e.findColumn=Ve,e.isWordChar=$,e.Pass=Ne,e.signal=dt,e.Line=Rn,e.changeEnd=ur,e.scrollbarModel=Zi,e.Pos=hn,e.cmpPos=ir,e.modes=Dt,e.mimeModes=ht,e.resolveMode=Ke,e.getMode=st,e.modeExtensions=bt,e.extendMode=Ft,e.copyState=$t,e.startState=er,e.innerMode=gn,e.commands=Fo,e.keyMap=$i,e.keyName=Vs,e.isModifierKey=zs,e.lookupKey=Co,e.normalizeKeyMap=Ml,e.StringStream=Hn,e.SharedTextMarker=No,e.TextMarker=no,e.LineWidget=ko,e.e_preventDefault=de,e.e_stopPropagation=fe,e.e_stop=Pe,e.addClass=F,e.contains=O,e.rmClass=_,e.keyNames=ro}$l(wa),ql(wa);var iu="iter insert remove copy getEditor constructor".split(" ");for(var ns in di.prototype)di.prototype.hasOwnProperty(ns)&&re(iu,ns)<0&&(wa.prototype[ns]=function(e){return function(){return e.apply(this.doc,arguments)}}(di.prototype[ns]));return Le(di),wa.inputStyles={textarea:ka,contenteditable:oa},wa.defineMode=function(e){!wa.defaults.mode&&e!="null"&&(wa.defaults.mode=e),nn.apply(this,arguments)},wa.defineMIME=qt,wa.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),wa.defineMIME("text/plain","null"),wa.defineExtension=function(e,n){wa.prototype[e]=n},wa.defineDocExtension=function(e,n){di.prototype[e]=n},wa.fromTextArea=ru,au(wa),wa.version="5.58.2",wa})},WaYH:function(Bt,ve,T){"use strict";var Z=T("rePB"),V=T("Ff2n"),j=T("VTBJ"),G=T("1OyB"),M=T("vuIU"),I=T("JX7q"),W=T("Ji7U"),C=T("LK+K"),r=T("q1tI"),A=T("TSYQ"),v=T.n(A),f=T("sboe"),p=T("OZM5"),l=function(L){var P=L.prefixCls,_=L.level,b=L.isStart,g=L.isEnd;if(!_)return null;for(var m="".concat(P,"-indent-unit"),y=[],x=0;x<_;x+=1){var O;y.push(r.createElement("span",{key:x,className:v()(m,(O={},Object(Z.a)(O,"".concat(m,"-start"),b[x+1]),Object(Z.a)(O,"".concat(m,"-end"),g[x+1]),Object(Z.a)(O,"".concat(m,"-end-first-level"),!x&&g[0]),O))}))}return r.createElement("span",{"aria-hidden":"true",className:"".concat(P,"-indent")},y)},o=l,s=T("815F"),t="open",u="close",a="---",i=function(S){Object(W.a)(P,S);var L=Object(C.a)(P);function P(){var _;return Object(G.a)(this,P),_=L.apply(this,arguments),_.state={dragNodeHighlight:!1},_.onSelectorClick=function(b){var g=_.props.context.onNodeClick;g(b,Object(s.b)(_.props)),_.isSelectable()?_.onSelect(b):_.onCheck(b)},_.onSelectorDoubleClick=function(b){var g=_.props.context.onNodeDoubleClick;g(b,Object(s.b)(_.props))},_.onSelect=function(b){if(_.isDisabled())return;var g=_.props.context.onNodeSelect;b.preventDefault(),g(b,Object(s.b)(_.props))},_.onCheck=function(b){if(_.isDisabled())return;var g=_.props,m=g.disableCheckbox,y=g.checked,x=_.props.context.onNodeCheck;if(!_.isCheckable()||m)return;b.preventDefault();var O=!y;x(b,Object(s.b)(_.props),O)},_.onMouseEnter=function(b){var g=_.props.context.onNodeMouseEnter;g(b,Object(s.b)(_.props))},_.onMouseLeave=function(b){var g=_.props.context.onNodeMouseLeave;g(b,Object(s.b)(_.props))},_.onContextMenu=function(b){var g=_.props.context.onNodeContextMenu;g(b,Object(s.b)(_.props))},_.onDragStart=function(b){var g=_.props.context.onNodeDragStart;b.stopPropagation(),_.setState({dragNodeHighlight:!0}),g(b,Object(I.a)(_));try{b.dataTransfer.setData("text/plain","")}catch(m){}},_.onDragEnter=function(b){var g=_.props.context.onNodeDragEnter;b.preventDefault(),b.stopPropagation(),g(b,Object(I.a)(_))},_.onDragOver=function(b){var g=_.props.context.onNodeDragOver;b.preventDefault(),b.stopPropagation(),g(b,Object(I.a)(_))},_.onDragLeave=function(b){var g=_.props.context.onNodeDragLeave;b.stopPropagation(),g(b,Object(I.a)(_))},_.onDragEnd=function(b){var g=_.props.context.onNodeDragEnd;b.stopPropagation(),_.setState({dragNodeHighlight:!1}),g(b,Object(I.a)(_))},_.onDrop=function(b){var g=_.props.context.onNodeDrop;b.preventDefault(),b.stopPropagation(),_.setState({dragNodeHighlight:!1}),g(b,Object(I.a)(_))},_.onExpand=function(b){var g=_.props.context.onNodeExpand;g(b,Object(s.b)(_.props))},_.setSelectHandle=function(b){_.selectHandle=b},_.getNodeState=function(){var b=_.props.expanded;return _.isLeaf()?null:b?t:u},_.hasChildren=function(){var b=_.props.eventKey,g=_.props.context.keyEntities,m=g[b]||{},y=m.children;return!!(y||[]).length},_.isLeaf=function(){var b=_.props,g=b.isLeaf,m=b.loaded,y=_.props.context.loadData,x=_.hasChildren();return g===!1?!1:g||!y&&!x||y&&m&&!x},_.isDisabled=function(){var b=_.props.disabled,g=_.props.context.disabled;return!!(g||b)},_.isCheckable=function(){var b=_.props.checkable,g=_.props.context.checkable;return!g||b===!1?!1:g},_.syncLoadData=function(b){var g=b.expanded,m=b.loading,y=b.loaded,x=_.props.context,O=x.loadData,H=x.onNodeLoad;if(m)return;O&&g&&!_.isLeaf()&&(!_.hasChildren()&&!y&&H(Object(s.b)(_.props)))},_.renderSwitcher=function(){var b=_.props,g=b.expanded,m=b.switcherIcon,y=_.props.context,x=y.prefixCls,O=y.switcherIcon,H=m||O;if(_.isLeaf())return r.createElement("span",{className:v()("".concat(x,"-switcher"),"".concat(x,"-switcher-noop"))},typeof H=="function"?H(Object(j.a)(Object(j.a)({},_.props),{},{isLeaf:!0})):H);var F=v()("".concat(x,"-switcher"),"".concat(x,"-switcher_").concat(g?t:u));return r.createElement("span",{onClick:_.onExpand,className:F},typeof H=="function"?H(Object(j.a)(Object(j.a)({},_.props),{},{isLeaf:!1})):H)},_.renderCheckbox=function(){var b=_.props,g=b.checked,m=b.halfChecked,y=b.disableCheckbox,x=_.props.context.prefixCls,O=_.isDisabled(),H=_.isCheckable();if(!H)return null;var F=typeof H!="boolean"?H:null;return r.createElement("span",{className:v()("".concat(x,"-checkbox"),g&&"".concat(x,"-checkbox-checked"),!g&&m&&"".concat(x,"-checkbox-indeterminate"),(O||y)&&"".concat(x,"-checkbox-disabled")),onClick:_.onCheck},F)},_.renderIcon=function(){var b=_.props.loading,g=_.props.context.prefixCls;return r.createElement("span",{className:v()("".concat(g,"-iconEle"),"".concat(g,"-icon__").concat(_.getNodeState()||"docu"),b&&"".concat(g,"-icon_loading"))})},_.renderSelector=function(){var b=_.state.dragNodeHighlight,g=_.props,m=g.title,y=g.selected,x=g.icon,O=g.loading,H=g.data,F=_.props.context,R=F.prefixCls,U=F.showIcon,k=F.icon,d=F.draggable,z=F.loadData,Y=F.titleRender,re=_.isDisabled(),le="".concat(R,"-node-content-wrapper"),Ne;if(U){var Ce=x||k;Ne=Ce?r.createElement("span",{className:v()("".concat(R,"-iconEle"),"".concat(R,"-icon__customize"))},typeof Ce=="function"?Ce(_.props):Ce):_.renderIcon()}else z&&O&&(Ne=_.renderIcon());var Te;typeof m=="function"?Te=m(H):Y?Te=Y(H):Te=m;var Fe=r.createElement("span",{className:"".concat(R,"-title")},Te);return r.createElement("span",{ref:_.setSelectHandle,title:typeof m=="string"?m:"",className:v()("".concat(le),"".concat(le,"-").concat(_.getNodeState()||"normal"),!re&&(y||b)&&"".concat(R,"-node-selected"),!re&&d&&"draggable"),draggable:!re&&d||void 0,"aria-grabbed":!re&&d||void 0,onMouseEnter:_.onMouseEnter,onMouseLeave:_.onMouseLeave,onContextMenu:_.onContextMenu,onClick:_.onSelectorClick,onDoubleClick:_.onSelectorDoubleClick,onDragStart:d?_.onDragStart:void 0},Ne,Fe)},_}return Object(M.a)(P,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var b=this.props.selectable,g=this.props.context.selectable;return typeof b=="boolean"?b:g}},{key:"render",value:function(){var b,g=this.props,m=g.eventKey,y=g.className,x=g.style,O=g.dragOver,H=g.dragOverGapTop,F=g.dragOverGapBottom,R=g.isLeaf,U=g.isStart,k=g.isEnd,d=g.expanded,z=g.selected,Y=g.checked,re=g.halfChecked,le=g.loading,Ne=g.domRef,Ce=g.active,Te=g.onMouseMove,Fe=Object(V.a)(g,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Ve=this.props.context,xe=Ve.prefixCls,ye=Ve.filterTreeNode,oe=Ve.draggable,Se=Ve.keyEntities,_e=this.isDisabled(),He=Object(p.f)(Fe),rt=Se[m]||{},ae=rt.level,$=k[k.length-1];return r.createElement("div",Object.assign({ref:Ne,className:v()(y,"".concat(xe,"-treenode"),(b={},Object(Z.a)(b,"".concat(xe,"-treenode-disabled"),_e),Object(Z.a)(b,"".concat(xe,"-treenode-switcher-").concat(d?"open":"close"),!R),Object(Z.a)(b,"".concat(xe,"-treenode-checkbox-checked"),Y),Object(Z.a)(b,"".concat(xe,"-treenode-checkbox-indeterminate"),re),Object(Z.a)(b,"".concat(xe,"-treenode-selected"),z),Object(Z.a)(b,"".concat(xe,"-treenode-loading"),le),Object(Z.a)(b,"".concat(xe,"-treenode-active"),Ce),Object(Z.a)(b,"".concat(xe,"-treenode-leaf-last"),$),Object(Z.a)(b,"drag-over",!_e&&O),Object(Z.a)(b,"drag-over-gap-top",!_e&&H),Object(Z.a)(b,"drag-over-gap-bottom",!_e&&F),Object(Z.a)(b,"filter-node",ye&&ye(Object(s.b)(this.props))),b)),style:x,onDragEnter:oe?this.onDragEnter:void 0,onDragOver:oe?this.onDragOver:void 0,onDragLeave:oe?this.onDragLeave:void 0,onDrop:oe?this.onDrop:void 0,onDragEnd:oe?this.onDragEnd:void 0,onMouseMove:Te},He),r.createElement(o,{prefixCls:xe,level:ae,isStart:U,isEnd:k}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),P}(r.Component),D=function(L){return r.createElement(f.a.Consumer,null,function(P){return r.createElement(i,Object.assign({},L,{context:P}))})};D.displayName="TreeNode",D.defaultProps={title:a},D.isTreeNode=1;var w=ve.a=D},Y1PL:function(Bt,ve,T){"use strict";T.r(ve),T.d(ve,"ResizableTextArea",function(){return re});var Z=T("wx14"),V=T("1OyB"),j=T("vuIU"),G=T("Ji7U"),M=T("LK+K"),I=T("q1tI"),W=T("VTBJ"),C=T("rePB"),r=T("Zm9Q"),A=T("Kwbf"),v=T("c+Xe"),f=T("m+aA"),p=T("bdgK"),l=new Map;function o(Ce){Ce.forEach(function(Te){var Fe,Ve=Te.target;(Fe=l.get(Ve))===null||Fe===void 0||Fe.forEach(function(xe){return xe(Ve)})})}var s=new p.default(o),t=null,u=null;function a(Ce,Te){l.has(Ce)||(l.set(Ce,new Set),s.observe(Ce)),l.get(Ce).add(Te)}function i(Ce,Te){l.has(Ce)&&(l.get(Ce).delete(Te),l.get(Ce).size||(s.unobserve(Ce),l.delete(Ce)))}var D=function(Ce){Object(G.a)(Fe,Ce);var Te=Object(M.a)(Fe);function Fe(){return Object(V.a)(this,Fe),Te.apply(this,arguments)}return Object(j.a)(Fe,[{key:"render",value:function(){return this.props.children}}]),Fe}(I.Component),w=I.createContext(null);function S(Ce){var Te=Ce.children,Fe=Ce.onBatchResize,Ve=I.useRef(0),xe=I.useRef([]),ye=I.useContext(w),oe=I.useCallback(function(Se,_e,He){Ve.current+=1;var rt=Ve.current;xe.current.push({size:Se,element:_e,data:He}),Promise.resolve().then(function(){rt===Ve.current&&(Fe==null||Fe(xe.current),xe.current=[])}),ye==null||ye(Se,_e,He)},[Fe,ye]);return I.createElement(w.Provider,{value:oe},Te)}function L(Ce){var Te=Ce.children,Fe=Ce.disabled,Ve=I.useRef(null),xe=I.useRef(null),ye=I.useContext(w),oe=I.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Se=I.isValidElement(Te)&&Object(v.c)(Te),_e=Se?Te.ref:null,He=I.useMemo(function(){return Object(v.a)(_e,Ve)},[_e,Ve]),rt=I.useRef(Ce);rt.current=Ce;var ae=I.useCallback(function($){var Q=rt.current,te=Q.onResize,he=Q.data,ge=$.getBoundingClientRect(),we=ge.width,ft=ge.height,Pt=$.offsetWidth,jt=$.offsetHeight,qe=Math.floor(we),Mt=Math.floor(ft);if(oe.current.width!==qe||oe.current.height!==Mt||oe.current.offsetWidth!==Pt||oe.current.offsetHeight!==jt){var sn={width:qe,height:Mt,offsetWidth:Pt,offsetHeight:jt};oe.current=sn;var at=Pt===Math.round(we)?we:Pt,Qe=jt===Math.round(ft)?ft:jt,Et=Object(W.a)(Object(W.a)({},sn),{},{offsetWidth:at,offsetHeight:Qe});ye==null||ye(Et,$,he),te&&Promise.resolve().then(function(){te(Et,$)})}},[]);return I.useEffect(function(){var $=Object(f.a)(Ve.current)||Object(f.a)(xe.current);return $&&!Fe&&a($,ae),function(){return i($,ae)}},[Ve.current,Fe]),I.createElement(D,{ref:xe},Se?I.cloneElement(Te,{ref:He}):Te)}var P="rc-observer-key";function _(Ce){var Te=Ce.children,Fe=Object(r.a)(Te);return Fe.map(function(Ve,xe){var ye=(Ve==null?void 0:Ve.key)||"".concat(P,"-").concat(xe);return I.createElement(L,Object(Z.a)({},Ce,{key:ye}),Ve)})}_.Collection=S;var b=_,g=T("bT9E"),m=T("TSYQ"),y=T.n(m),x=`
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important
`,O=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],H={},F;function R(Ce){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Fe=Ce.getAttribute("id")||Ce.getAttribute("data-reactid")||Ce.getAttribute("name");if(Te&&H[Fe])return H[Fe];var Ve=window.getComputedStyle(Ce),xe=Ve.getPropertyValue("box-sizing")||Ve.getPropertyValue("-moz-box-sizing")||Ve.getPropertyValue("-webkit-box-sizing"),ye=parseFloat(Ve.getPropertyValue("padding-bottom"))+parseFloat(Ve.getPropertyValue("padding-top")),oe=parseFloat(Ve.getPropertyValue("border-bottom-width"))+parseFloat(Ve.getPropertyValue("border-top-width")),Se=O.map(function(He){return"".concat(He,":").concat(Ve.getPropertyValue(He))}).join(";"),_e={sizingStyle:Se,paddingSize:ye,borderSize:oe,boxSizing:xe};return Te&&Fe&&(H[Fe]=_e),_e}function U(Ce){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Fe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Ve=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;F||(F=document.createElement("textarea"),F.setAttribute("tab-index","-1"),F.setAttribute("aria-hidden","true"),document.body.appendChild(F)),Ce.getAttribute("wrap")?F.setAttribute("wrap",Ce.getAttribute("wrap")):F.removeAttribute("wrap");var xe=R(Ce,Te),ye=xe.paddingSize,oe=xe.borderSize,Se=xe.boxSizing,_e=xe.sizingStyle;F.setAttribute("style","".concat(_e,";").concat(x)),F.value=Ce.value||Ce.placeholder||"";var He=Number.MIN_SAFE_INTEGER,rt=Number.MAX_SAFE_INTEGER,ae=F.scrollHeight,$;if(Se==="border-box"?ae+=oe:Se==="content-box"&&(ae-=ye),Fe!==null||Ve!==null){F.value=" ";var Q=F.scrollHeight-ye;Fe!==null&&(He=Q*Fe,Se==="border-box"&&(He=He+ye+oe),ae=Math.max(He,ae)),Ve!==null&&(rt=Q*Ve,Se==="border-box"&&(rt=rt+ye+oe),$=ae>rt?"":"hidden",ae=Math.min(rt,ae))}return{height:ae,minHeight:He,maxHeight:rt,overflowY:$,resize:"none"}}var k=T("Gytx"),d=T.n(k),z;(function(Ce){Ce[Ce.NONE=0]="NONE",Ce[Ce.RESIZING=1]="RESIZING",Ce[Ce.RESIZED=2]="RESIZED"})(z||(z={}));var Y=function(Ce){Object(G.a)(Fe,Ce);var Te=Object(M.a)(Fe);function Fe(Ve){var xe;return Object(V.a)(this,Fe),xe=Te.call(this,Ve),xe.nextFrameActionId=void 0,xe.resizeFrameId=void 0,xe.textArea=void 0,xe.saveTextArea=function(ye){xe.textArea=ye},xe.handleResize=function(ye){var oe=xe.state.resizeStatus,Se=xe.props,_e=Se.autoSize,He=Se.onResize;if(oe!==z.NONE)return;typeof He=="function"&&He(ye),_e&&xe.resizeOnNextFrame()},xe.resizeOnNextFrame=function(){cancelAnimationFrame(xe.nextFrameActionId),xe.nextFrameActionId=requestAnimationFrame(xe.resizeTextarea)},xe.resizeTextarea=function(){var ye=xe.props.autoSize;if(!ye||!xe.textArea)return;var oe=ye.minRows,Se=ye.maxRows,_e=U(xe.textArea,!1,oe,Se);xe.setState({textareaStyles:_e,resizeStatus:z.RESIZING},function(){cancelAnimationFrame(xe.resizeFrameId),xe.resizeFrameId=requestAnimationFrame(function(){xe.setState({resizeStatus:z.RESIZED},function(){xe.resizeFrameId=requestAnimationFrame(function(){xe.setState({resizeStatus:z.NONE}),xe.fixFirefoxAutoScroll()})})})})},xe.renderTextArea=function(){var ye=xe.props,oe=ye.prefixCls,Se=oe===void 0?"rc-textarea":oe,_e=ye.autoSize,He=ye.onResize,rt=ye.className,ae=ye.disabled,$=xe.state,Q=$.textareaStyles,te=$.resizeStatus,he=Object(g.a)(xe.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),ge=y()(Se,rt,Object(C.a)({},"".concat(Se,"-disabled"),ae));"value"in he&&(he.value=he.value||"");var we=Object(W.a)(Object(W.a)(Object(W.a)({},xe.props.style),Q),te===z.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return I.createElement(b,{onResize:xe.handleResize,disabled:!(_e||He)},I.createElement("textarea",Object(Z.a)({},he,{className:ge,style:we,ref:xe.saveTextArea})))},xe.state={textareaStyles:{},resizeStatus:z.NONE},xe}return Object(j.a)(Fe,[{key:"componentDidUpdate",value:function(xe){(xe.value!==this.props.value||!d()(xe.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 xe=this.textArea.selectionStart,ye=this.textArea.selectionEnd;this.textArea.setSelectionRange(xe,ye)}}catch(oe){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Fe}(I.Component),re=Y,le=function(Ce){Object(G.a)(Fe,Ce);var Te=Object(M.a)(Fe);function Fe(Ve){var xe;Object(V.a)(this,Fe),xe=Te.call(this,Ve),xe.resizableTextArea=void 0,xe.focus=function(){xe.resizableTextArea.textArea.focus()},xe.saveTextArea=function(oe){xe.resizableTextArea=oe},xe.handleChange=function(oe){var Se=xe.props.onChange;xe.setValue(oe.target.value,function(){xe.resizableTextArea.resizeTextarea()}),Se&&Se(oe)},xe.handleKeyDown=function(oe){var Se=xe.props,_e=Se.onPressEnter,He=Se.onKeyDown;oe.keyCode===13&&_e&&_e(oe),He&&He(oe)};var ye=typeof Ve.value=="undefined"||Ve.value===null?Ve.defaultValue:Ve.value;return xe.state={value:ye},xe}return Object(j.a)(Fe,[{key:"setValue",value:function(xe,ye){"value"in this.props||this.setState({value:xe},ye)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return I.createElement(re,Object(Z.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(xe){return"value"in xe?{value:xe.value}:null}}]),Fe}(I.Component),Ne=ve.default=le},ZW9T:function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return k});var Z=T("k1fw"),V=T("oBTY"),j=T("miYZ"),G=T("tsqr"),M=T("rAM+"),I=T("tJVT"),W=T("PpiC"),C=T("q1tI"),r=T.n(C),A=T("bdgK"),v=T("9og8"),f=T("WmNS"),p=T.n(f),l={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"]},o={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(`
`)}]},t={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(`
`)}]},u=T("5VLF"),a=T.n(u),i={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"]}},D=function(z,Y){return Y.map(function(re){return{label:re,kind:z.languages.CompletionItemKind.Keyword,insertText:re}})},w=function(z){return Object.keys(i.tables).map(function(Y){return{label:Y,kind:z.languages.CompletionItemKind.Variable,insertText:Y}})},S=function(z,Y){var re=i.tables[z];return re?re.map(function(le){return{label:le,kind:Y.languages.CompletionItemKind.Field,insertText:le}}):[]};function L(d,z,Y,re,le){var Ne=z.getWordUntilPosition(Y),Ce={startLineNumber:Y.lineNumber,endLineNumber:Y.lineNumber,startColumn:Ne.startColumn,endColumn:Ne.endColumn},Te=re.map(function(Fe){return{label:Fe,kind:d.languages.CompletionItemKind.Keyword,insertText:Fe,insertTextRules:d.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ce}});return le.map(function(Fe){Te.push(Object(Z.a)(Object(Z.a)({},Fe),{},{range:Ce}))}),Te}var P=function(d){i.languages.map(function(le){return d.languages.registerDocumentFormattingEditProvider(le,{provideDocumentFormattingEdits:function(Ce,Te,Fe){return Object(v.a)(p.a.mark(function Ve(){var xe;return p.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return xe=a()(Ce.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}),oe.abrupt("return",[{range:Ce.getFullModelRange(),text:xe}]);case 2:case"end":return oe.stop()}},Ve)}))()}}),le});var z=s.quickKey.map(function(le){return{label:le.label,kind:d.languages.CompletionItemKind.Method,insertText:le.content,insertTextRules:d.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),Y=t.quickKey.map(function(le){return{label:le.label,kind:d.languages.CompletionItemKind.Method,insertText:le.content,insertTextRules:d.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),re=o.quickKey.map(function(le){return{label:le.label,kind:d.languages.CompletionItemKind.Method,insertText:le.content,insertTextRules:d.languages.CompletionItemInsertTextRule.InsertAsSnippet}});d.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Ne,Ce){var Te=Ne.getWordUntilPosition(Ce),Fe={startLineNumber:Ce.lineNumber,endLineNumber:Ce.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn},Ve=Ne.getLineContent(Ce.lineNumber).substring(Te.startColumn-2,Te.endColumn);return{suggestions:[].concat(Object(V.a)(s.keywords.map(function(xe){return{label:xe,kind:d.languages.CompletionItemKind.Function,documentation:xe,insertText:xe,insertTextRules:d.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Fe}})),Object(V.a)(s.quickKey.map(function(xe){return{label:xe.label,kind:d.languages.CompletionItemKind.Function,documentation:xe.content,insertText:Ve.startsWith("#")?xe.content.replace(/#/,""):xe.content,insertTextRules:d.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Fe}})))}}}),d.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Ne,Ce){var Te=Ne.getWordUntilPosition(Ce),Fe={startLineNumber:Ce.lineNumber,endLineNumber:Ce.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn};return{suggestions:Object(V.a)(l.keywords.map(function(Ve){return{label:Ve,kind:d.languages.CompletionItemKind.Function,documentation:Ve,insertText:Ve,insertTextRules:d.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Fe}}))}}}),d.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Ne,Ce){var Te=Ne.getWordUntilPosition(Ce),Fe={startLineNumber:Ce.lineNumber,endLineNumber:Ce.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn},Ve=Ne.getLineContent(Ce.lineNumber).substring(Te.startColumn-2,Te.endColumn);return{suggestions:[].concat(Object(V.a)(o.keywords.map(function(xe){return{label:xe,kind:d.languages.CompletionItemKind.Function,documentation:xe,insertText:xe,insertTextRules:d.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Fe}})),Object(V.a)(o.quickKey.map(function(xe){return{label:xe.label,kind:d.languages.CompletionItemKind.Function,documentation:xe.content,insertText:Ve.startsWith("#")?xe.content.replace(/#/,""):xe.content,insertTextRules:d.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Fe}})))}}}),d.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Ne,Ce){var Te=Ne.getWordUntilPosition(Ce),Fe={startLineNumber:Ce.lineNumber,endLineNumber:Ce.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn},Ve=Ne.getLineContent(Ce.lineNumber).substring(Te.startColumn-2,Te.endColumn);return{suggestions:[].concat(Object(V.a)(t.keywords.map(function(xe){return{label:xe,kind:d.languages.CompletionItemKind.Function,documentation:xe,insertText:xe,insertTextRules:d.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Fe}})),Object(V.a)(t.quickKey.map(function(xe){return{label:xe.label,kind:d.languages.CompletionItemKind.Function,documentation:xe.content,insertText:Ve.startsWith("#")?xe.content.replace(/#/,""):xe.content,insertTextRules:d.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Fe}})))}}})},_="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",b=T("fjLI"),g=T("LvDl"),m=T("+ua5");function y(d){return/^\d+$/.test(d)?"".concat(d,"px"):d}function x(){}var O=!1,H={"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 F(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],z=d;if(Array.isArray(d)){for(var Y=0;Y<d.length;Y++){var re=H[d[Y]];if(re)return re}return z[0]}return H[z]||z}var R=null,U=ve.b=function(d){var z=d.width,Y=z===void 0?"100%":z,re=d.height,le=re===void 0?"100%":re,Ne=d.value,Ce=d.language,Te=Ce===void 0?"javascript":Ce,Fe=d.style,Ve=Fe===void 0?{}:Fe,xe=d.options,ye=xe===void 0?{}:xe,oe=d.overrideServices,Se=oe===void 0?{}:oe,_e=d.theme,He=_e===void 0?"vs-dark":_e,rt=d.onEditBlur,ae=d.onSave,$=d.autoHeight,Q=$===void 0?!1:$,te=d.forbidCopy,he=te===void 0?!1:te,ge=d.onChange,we=ge===void 0?x:ge,ft=d.editorDidMount,Pt=ft===void 0?x:ft,jt=d.onFocus,qe=jt===void 0?x:jt,Mt=d.filename,sn=Mt===void 0?"educoder.txt":Mt,at=d.errorLine,Qe=d.errorContent,Et=Qe===void 0?"":Qe,It=Object(W.a)(d,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),dt=Object(C.useRef)(),mt=Object(C.useRef)({}),We=Object(C.useRef)(),De=Object(C.useRef)(),Le=Object(C.useRef)(!1),de=Object(C.useRef)(),fe=Object(C.useState)(!1),Ee=Object(I.a)(fe,2),Pe=Ee[0],Ue=Ee[1];function lt(){var bt;return dt.current&&(bt=new A.default(function(Ft){var $t=Object(M.a)(Ft),gn;try{for($t.s();!(gn=$t.n()).done;){var er=gn.value;(er.target.offsetHeight>0||er.target.offsetWidth>0)&&mt.current.instance.layout()}}catch(Hn){$t.e(Hn)}finally{$t.f()}}),bt.observe(dt.current)),bt}function Ot(){G.b.warn(decodeURIComponent(_))}var cn=function(){var Ft=mt.current.instance;if(Ne!=null&&Ft&&Pe){var $t=Ft.getModel();$t&&Ne!==$t.getValue()&&(O=!0,$t.setValue(Ne),Ft.layout(),O=!1)}};Object(C.useEffect)(function(){De.current&&clearTimeout(De.current),De.current=setTimeout(function(){cn()},500)},[Ne,Pe,mt.current]),Object(C.useEffect)(function(){if(at&&mt.current&&mt.current.instance){var bt=mt.current.instance;bt.changeViewZones(function($t){var gn=document.createElement("div");gn.style.padding="10px 20px",gn.style.width="calc(100% - 20px)",gn.className="my-error-line-wrp",gn.innerHTML=Et,$t.addZone({afterLineNumber:at||11,heightInLines:3,domNode:gn})});var Ft={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}};bt.addOverlayWidget(Ft),bt.revealPositionInCenter({lineNumber:20,column:1})}},[at,mt.current,Pe]);function An(){var bt=mt.current.instance;if(bt){var Ft=bt.getSelection(),$t=mt.current.pastePos||{},gn=new R.Range($t.startLineNumber||Ft.endLineNumber,$t.startColumn||Ft.endColumn,$t.endLineNumber||Ft.endLineNumber,$t.endColumn||Ft.endColumn);setTimeout(function(){bt.executeEdits("",[{range:gn,text:""}])},300)}}function Ct(bt){(window.navigator.platform.match("Mac")?bt.metaKey:bt.ctrlKey)&&bt.keyCode==83&&(bt.preventDefault(),ae())}var Gt=function(){if(Q&&mt.current.instance){var Ft=mt.current.instance.getContentHeight();Ke(Ft<le?le:Ft)}else Ke(le)};function xt(bt){var Ft=document.createEvent("MouseEvents");Ft.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),bt.dispatchEvent(Ft)}function Rt(bt,Ft){var $t=window.URL||window.webkitURL||window,gn=new Blob([Ft]),er=document.createElementNS("http://www.w3.org/1999/xhtml","a");er.href=$t.createObjectURL(gn),er.download=bt,xt(er)}Object(C.useEffect)(function(){Gt()},[Gt]),Object(C.useEffect)(function(){dt.current&&!Pe&&Promise.all([T.e(16),T.e(28)]).then(T.t.bind(null,"M/lh",7)).then(function(bt){try{R=bt,mt.current.instance=R.editor.create(dt.current,{value:Ne,language:F(Te),theme:He,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},Se);var Ft=mt.current.instance,$t=b.d._menuItems,gn=Object(V.a)($t).find(function(_r){return _r[0]._debugName=="EditorContext"}),er=gn[1],Hn=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],yn=function(ar,cr){var Pr=ar._first;do{var Qr,ca,hn=cr.includes((Qr=Pr.element)===null||Qr===void 0||((ca=Qr.command)===null||ca===void 0)?void 0:ca.id);hn&&ar._remove(Pr)}while(Pr=Pr.next)};if(Pt(Ft,R),setTimeout(function(){Gt(),mt.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Rt(sn||"educoder.txt",Ft.getValue())}}),Ft.getDomNode().addEventListener("input",function(){We.current.autoFormat&&Ft.getAction("editor.action.formatDocument").run()})},500),mt.current.subscription=Ft.onDidChangeModelContent(function(_r){Le.current?clearTimeout(de.current):(Gt(),we(Ft.getValue(),_r)),de.current=setTimeout(function(){Le.current=!1},500)}),window.Monaco||P(R,F(Te)),he&&(yn(er,Hn),dt.current.classList.add("noCopyPaste"),Ft.onKeyDown(function(_r){var ar=_r.keyCode,cr=_r.ctrlKey,Pr=_r.metaKey;(ar===33||ar===52)&&(Pr||cr)&&(Ot(),_r.preventDefault())})),window.Monaco=R,rt&&Ft.onDidBlurEditorWidget(function(){rt(Ft.getValue())}),qe&&Ft.onDidFocusEditorText(function(){qe(Ft.getValue())}),he){Ft.addCommand(R.KeyMod.CtrlCmd|R.KeyCode.KEY_V,function(){return Ot(),null}),Ft.onDidPaste(function(_r){mt.current.pastePos=_r});try{window.addEventListener("paste",An)}catch(_r){}}var Sr=lt();return Ue(!0),function(){var _r=mt.current.instance;_r.dispose();var ar=_r.getModel();ar&&ar.dispose(),mt.current.subscription&&mt.current.subscription.dispose(),he&&window.removeEventListener("paste",An),Sr.unobserve(dt.current)}}catch(_r){}})},[]),Object(C.useEffect)(function(){var bt=mt.current.instance;if(bt&&Pe)return document.addEventListener("keydown",Ct,!1),function(){document.removeEventListener("keydown",Ct)}},[ae,Pe]),Object(C.useEffect)(function(){var bt=mt.current.instance;if(bt&&Pe){var Ft=F(Te);R.editor.setModelLanguage(bt.getModel(),Ft),console.log("language:",Te,bt.getModel(),Ft)}},[Te,Pe]),Object(C.useEffect)(function(){var bt=mt.current.instance;bt&&Pe&&R.editor.setTheme(He)},[He,Pe]),Object(C.useEffect)(function(){var bt=mt.current.instance;We.current=ye,bt&&Pe&&(bt.updateOptions(Object(Z.a)({},ye)),setTimeout(function(){bt.getModel().updateOptions(Object(Z.a)({},ye))},200))},[JSON.stringify(ye),Pe]),Object(C.useEffect)(function(){var bt=mt.current.instance;bt&&Pe&&bt.layout()},[Y,le,Pe]);var gt=Object(C.useState)(y(Y)),be=Object(I.a)(gt,2),Ie=be[0],Dt=be[1],ht=Object(C.useState)(y(le)),nn=Object(I.a)(ht,2),qt=nn[0],Ke=nn[1],st=Object(Z.a)(Object(Z.a)({},Ve),{},{width:Ie,height:qt});return r.a.createElement("div",{className:"my-monaco-editor",ref:dt,style:st})};function k(d){var z=d.width,Y=z===void 0?"100%":z,re=d.height,le=re===void 0?"100%":re,Ne=d.original,Ce=d.modified,Te=d.language,Fe=d.options,Ve=Fe===void 0?{}:Fe,xe=Object(C.useRef)(),ye=Object(C.useState)(null),oe=Object(I.a)(ye,2),Se=oe[0],_e=oe[1];function He(Q){var te;return xe.current&&(te=new A.default(function(he){var ge=Object(M.a)(he),we;try{for(ge.s();!(we=ge.n()).done;){var ft=we.value;(ft.target.offsetHeight>0||ft.target.offsetWidth>0)&&Q.layout()}}catch(Pt){ge.e(Pt)}finally{ge.f()}}),te.observe(xe.current)),te}Object(C.useEffect)(function(){xe.current&&Promise.all([T.e(16),T.e(28)]).then(T.t.bind(null,"M/lh",7)).then(function(Q){R=Q;var te=R.editor.createDiffEditor(xe.current,Object(Z.a)(Object(Z.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},Ve),{},{wordWrap:!0}));_e(te);var he=He(te);return function(){te.dispose();var ge=te.getModel();ge&&ge.dispose(),he.unobserve(xe.current)}})},[]),Object(C.useEffect)(function(){Se&&Se.setModel({original:R.editor.createModel(Ne,Te),modified:R.editor.createModel(Ce,Te)})},[Ne,Ce,Te,Se]);var rt=y(Y),ae=y(le),$={width:rt,height:ae};return r.a.createElement("div",{className:"my-diff-editor",ref:xe,style:$})}},ZpRC:function(Bt,ve,T){"use strict";function Z(v){return typeof v=="object"&&v!=null&&v.nodeType===1}function V(v,f){return(!f||v!=="hidden")&&v!=="visible"&&v!=="clip"}function j(v,f){if(v.clientHeight<v.scrollHeight||v.clientWidth<v.scrollWidth){var p=getComputedStyle(v,null);return V(p.overflowY,f)||V(p.overflowX,f)||function(l){var o=function(s){if(!s.ownerDocument||!s.ownerDocument.defaultView)return null;try{return s.ownerDocument.defaultView.frameElement}catch(t){return null}}(l);return!!o&&(o.clientHeight<l.scrollHeight||o.clientWidth<l.scrollWidth)}(v)}return!1}function G(v,f,p,l,o,s,t,u){return s<v&&t>f||s>v&&t<f?0:s<=v&&u<=p||t>=f&&u>=p?s-v-l:t>f&&u<p||s<v&&u>p?t-f+o:0}var M=function(v,f){var p=window,l=f.scrollMode,o=f.block,s=f.inline,t=f.boundary,u=f.skipOverflowHiddenElements,a=typeof t=="function"?t:function(Q){return Q!==t};if(!Z(v))throw new TypeError("Invalid target");for(var i=document.scrollingElement||document.documentElement,D=[],w=v;Z(w)&&a(w);){if((w=w.parentElement)===i){D.push(w);break}w!=null&&w===document.body&&j(w)&&!j(document.documentElement)||w!=null&&j(w,u)&&D.push(w)}for(var S=p.visualViewport?p.visualViewport.width:innerWidth,L=p.visualViewport?p.visualViewport.height:innerHeight,P=window.scrollX||pageXOffset,_=window.scrollY||pageYOffset,b=v.getBoundingClientRect(),g=b.height,m=b.width,y=b.top,x=b.right,O=b.bottom,H=b.left,F=o==="start"||o==="nearest"?y:o==="end"?O:y+g/2,R=s==="center"?H+m/2:s==="end"?x:H,U=[],k=0;k<D.length;k++){var d=D[k],z=d.getBoundingClientRect(),Y=z.height,re=z.width,le=z.top,Ne=z.right,Ce=z.bottom,Te=z.left;if(l==="if-needed"&&y>=0&&H>=0&&O<=L&&x<=S&&y>=le&&O<=Ce&&H>=Te&&x<=Ne)return U;var Fe=getComputedStyle(d),Ve=parseInt(Fe.borderLeftWidth,10),xe=parseInt(Fe.borderTopWidth,10),ye=parseInt(Fe.borderRightWidth,10),oe=parseInt(Fe.borderBottomWidth,10),Se=0,_e=0,He="offsetWidth"in d?d.offsetWidth-d.clientWidth-Ve-ye:0,rt="offsetHeight"in d?d.offsetHeight-d.clientHeight-xe-oe:0;if(i===d)Se=o==="start"?F:o==="end"?F-L:o==="nearest"?G(_,_+L,L,xe,oe,_+F,_+F+g,g):F-L/2,_e=s==="start"?R:s==="center"?R-S/2:s==="end"?R-S:G(P,P+S,S,Ve,ye,P+R,P+R+m,m),Se=Math.max(0,Se+_),_e=Math.max(0,_e+P);else{Se=o==="start"?F-le-xe:o==="end"?F-Ce+oe+rt:o==="nearest"?G(le,Ce,Y,xe,oe+rt,F,F+g,g):F-(le+Y/2)+rt/2,_e=s==="start"?R-Te-Ve:s==="center"?R-(Te+re/2)+He/2:s==="end"?R-Ne+ye+He:G(Te,Ne,re,Ve,ye+He,R,R+m,m);var ae=d.scrollLeft,$=d.scrollTop;F+=$-(Se=Math.max(0,Math.min($+Se,d.scrollHeight-Y+rt))),R+=ae-(_e=Math.max(0,Math.min(ae+_e,d.scrollWidth-re+He)))}U.push({el:d,top:Se,left:_e})}return U};function I(v){return v===Object(v)&&Object.keys(v).length!==0}function W(v,f){f===void 0&&(f="auto");var p="scrollBehavior"in document.body.style;v.forEach(function(l){var o=l.el,s=l.top,t=l.left;o.scroll&&p?o.scroll({top:s,left:t,behavior:f}):(o.scrollTop=s,o.scrollLeft=t)})}function C(v){return v===!1?{block:"end",inline:"nearest"}:I(v)?v:{block:"start",inline:"nearest"}}function r(v,f){var p=!v.ownerDocument.documentElement.contains(v);if(I(f)&&typeof f.behavior=="function")return f.behavior(p?[]:M(v,f));if(p)return;var l=C(f);return W(M(v,l),l.behavior)}var A=ve.a=r},Zss7:function(Bt,ve,T){var Z;(function(V){var j=/^\s+/,G=/\s+$/,M=0,I=V.round,W=V.min,C=V.max,r=V.random;function A(oe,Se){if(oe=oe||"",Se=Se||{},oe instanceof A)return oe;if(!(this instanceof A))return new A(oe,Se);var _e=v(oe);this._originalInput=oe,this._r=_e.r,this._g=_e.g,this._b=_e.b,this._a=_e.a,this._roundA=I(100*this._a)/100,this._format=Se.format||_e.format,this._gradientType=Se.gradientType,this._r<1&&(this._r=I(this._r)),this._g<1&&(this._g=I(this._g)),this._b<1&&(this._b=I(this._b)),this._ok=_e.ok,this._tc_id=M++}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 oe=this.toRgb();return(oe.r*299+oe.g*587+oe.b*114)/1e3},getLuminance:function(){var oe=this.toRgb(),Se,_e,He,rt,ae,$;return Se=oe.r/255,_e=oe.g/255,He=oe.b/255,Se<=.03928?rt=Se/12.92:rt=V.pow((Se+.055)/1.055,2.4),_e<=.03928?ae=_e/12.92:ae=V.pow((_e+.055)/1.055,2.4),He<=.03928?$=He/12.92:$=V.pow((He+.055)/1.055,2.4),.2126*rt+.7152*ae+.0722*$},setAlpha:function(oe){return this._a=U(oe),this._roundA=I(100*this._a)/100,this},toHsv:function(){var oe=o(this._r,this._g,this._b);return{h:oe.h*360,s:oe.s,v:oe.v,a:this._a}},toHsvString:function(){var oe=o(this._r,this._g,this._b),Se=I(oe.h*360),_e=I(oe.s*100),He=I(oe.v*100);return this._a==1?"hsv("+Se+", "+_e+"%, "+He+"%)":"hsva("+Se+", "+_e+"%, "+He+"%, "+this._roundA+")"},toHsl:function(){var oe=p(this._r,this._g,this._b);return{h:oe.h*360,s:oe.s,l:oe.l,a:this._a}},toHslString:function(){var oe=p(this._r,this._g,this._b),Se=I(oe.h*360),_e=I(oe.s*100),He=I(oe.l*100);return this._a==1?"hsl("+Se+", "+_e+"%, "+He+"%)":"hsla("+Se+", "+_e+"%, "+He+"%, "+this._roundA+")"},toHex:function(oe){return t(this._r,this._g,this._b,oe)},toHexString:function(oe){return"#"+this.toHex(oe)},toHex8:function(oe){return u(this._r,this._g,this._b,this._a,oe)},toHex8String:function(oe){return"#"+this.toHex8(oe)},toRgb:function(){return{r:I(this._r),g:I(this._g),b:I(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+I(this._r)+", "+I(this._g)+", "+I(this._b)+")":"rgba("+I(this._r)+", "+I(this._g)+", "+I(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:I(k(this._r,255)*100)+"%",g:I(k(this._g,255)*100)+"%",b:I(k(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+I(k(this._r,255)*100)+"%, "+I(k(this._g,255)*100)+"%, "+I(k(this._b,255)*100)+"%)":"rgba("+I(k(this._r,255)*100)+"%, "+I(k(this._g,255)*100)+"%, "+I(k(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:F[t(this._r,this._g,this._b,!0)]||!1},toFilter:function(oe){var Se="#"+a(this._r,this._g,this._b,this._a),_e=Se,He=this._gradientType?"GradientType = 1, ":"";if(oe){var rt=A(oe);_e="#"+a(rt._r,rt._g,rt._b,rt._a)}return"progid:DXImageTransform.Microsoft.gradient("+He+"startColorstr="+Se+",endColorstr="+_e+")"},toString:function(oe){var Se=!!oe;oe=oe||this._format;var _e=!1,He=this._a<1&&this._a>=0,rt=!Se&&He&&(oe==="hex"||oe==="hex6"||oe==="hex3"||oe==="hex4"||oe==="hex8"||oe==="name");return rt?oe==="name"&&this._a===0?this.toName():this.toRgbString():(oe==="rgb"&&(_e=this.toRgbString()),oe==="prgb"&&(_e=this.toPercentageRgbString()),(oe==="hex"||oe==="hex6")&&(_e=this.toHexString()),oe==="hex3"&&(_e=this.toHexString(!0)),oe==="hex4"&&(_e=this.toHex8String(!0)),oe==="hex8"&&(_e=this.toHex8String()),oe==="name"&&(_e=this.toName()),oe==="hsl"&&(_e=this.toHslString()),oe==="hsv"&&(_e=this.toHsvString()),_e||this.toHexString())},clone:function(){return A(this.toString())},_applyModification:function(oe,Se){var _e=oe.apply(null,[this].concat([].slice.call(Se)));return this._r=_e._r,this._g=_e._g,this._b=_e._b,this.setAlpha(_e._a),this},lighten:function(){return this._applyModification(S,arguments)},brighten:function(){return this._applyModification(L,arguments)},darken:function(){return this._applyModification(P,arguments)},desaturate:function(){return this._applyModification(i,arguments)},saturate:function(){return this._applyModification(D,arguments)},greyscale:function(){return this._applyModification(w,arguments)},spin:function(){return this._applyModification(_,arguments)},_applyCombination:function(oe,Se){return oe.apply(null,[this].concat([].slice.call(Se)))},analogous:function(){return this._applyCombination(x,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(O,arguments)},splitcomplement:function(){return this._applyCombination(y,arguments)},triad:function(){return this._applyCombination(g,arguments)},tetrad:function(){return this._applyCombination(m,arguments)}},A.fromRatio=function(oe,Se){if(typeof oe=="object"){var _e={};for(var He in oe)oe.hasOwnProperty(He)&&(He==="a"?_e[He]=oe[He]:_e[He]=Ne(oe[He]));oe=_e}return A(oe,Se)};function v(oe){var Se={r:0,g:0,b:0},_e=1,He=null,rt=null,ae=null,$=!1,Q=!1;return typeof oe=="string"&&(oe=xe(oe)),typeof oe=="object"&&(Ve(oe.r)&&Ve(oe.g)&&Ve(oe.b)?(Se=f(oe.r,oe.g,oe.b),$=!0,Q=String(oe.r).substr(-1)==="%"?"prgb":"rgb"):Ve(oe.h)&&Ve(oe.s)&&Ve(oe.v)?(He=Ne(oe.s),rt=Ne(oe.v),Se=s(oe.h,He,rt),$=!0,Q="hsv"):Ve(oe.h)&&Ve(oe.s)&&Ve(oe.l)&&(He=Ne(oe.s),ae=Ne(oe.l),Se=l(oe.h,He,ae),$=!0,Q="hsl"),oe.hasOwnProperty("a")&&(_e=oe.a)),_e=U(_e),{ok:$,format:oe.format||Q,r:W(255,C(Se.r,0)),g:W(255,C(Se.g,0)),b:W(255,C(Se.b,0)),a:_e}}function f(oe,Se,_e){return{r:k(oe,255)*255,g:k(Se,255)*255,b:k(_e,255)*255}}function p(oe,Se,_e){oe=k(oe,255),Se=k(Se,255),_e=k(_e,255);var He=C(oe,Se,_e),rt=W(oe,Se,_e),ae,$,Q=(He+rt)/2;if(He==rt)ae=$=0;else{var te=He-rt;$=Q>.5?te/(2-He-rt):te/(He+rt);switch(He){case oe:ae=(Se-_e)/te+(Se<_e?6:0);break;case Se:ae=(_e-oe)/te+2;break;case _e:ae=(oe-Se)/te+4;break}ae/=6}return{h:ae,s:$,l:Q}}function l(oe,Se,_e){var He,rt,ae;oe=k(oe,360),Se=k(Se,100),_e=k(_e,100);function $(he,ge,we){return we<0&&(we+=1),we>1&&(we-=1),we<1/6?he+(ge-he)*6*we:we<1/2?ge:we<2/3?he+(ge-he)*(2/3-we)*6:he}if(Se===0)He=rt=ae=_e;else{var Q=_e<.5?_e*(1+Se):_e+Se-_e*Se,te=2*_e-Q;He=$(te,Q,oe+1/3),rt=$(te,Q,oe),ae=$(te,Q,oe-1/3)}return{r:He*255,g:rt*255,b:ae*255}}function o(oe,Se,_e){oe=k(oe,255),Se=k(Se,255),_e=k(_e,255);var He=C(oe,Se,_e),rt=W(oe,Se,_e),ae,$,Q=He,te=He-rt;if($=He===0?0:te/He,He==rt)ae=0;else{switch(He){case oe:ae=(Se-_e)/te+(Se<_e?6:0);break;case Se:ae=(_e-oe)/te+2;break;case _e:ae=(oe-Se)/te+4;break}ae/=6}return{h:ae,s:$,v:Q}}function s(oe,Se,_e){oe=k(oe,360)*6,Se=k(Se,100),_e=k(_e,100);var He=V.floor(oe),rt=oe-He,ae=_e*(1-Se),$=_e*(1-rt*Se),Q=_e*(1-(1-rt)*Se),te=He%6,he=[_e,$,ae,ae,Q,_e][te],ge=[Q,_e,_e,$,ae,ae][te],we=[ae,ae,Q,_e,_e,$][te];return{r:he*255,g:ge*255,b:we*255}}function t(oe,Se,_e,He){var rt=[le(I(oe).toString(16)),le(I(Se).toString(16)),le(I(_e).toString(16))];return He&&rt[0].charAt(0)==rt[0].charAt(1)&&rt[1].charAt(0)==rt[1].charAt(1)&&rt[2].charAt(0)==rt[2].charAt(1)?rt[0].charAt(0)+rt[1].charAt(0)+rt[2].charAt(0):rt.join("")}function u(oe,Se,_e,He,rt){var ae=[le(I(oe).toString(16)),le(I(Se).toString(16)),le(I(_e).toString(16)),le(Ce(He))];return rt&&ae[0].charAt(0)==ae[0].charAt(1)&&ae[1].charAt(0)==ae[1].charAt(1)&&ae[2].charAt(0)==ae[2].charAt(1)&&ae[3].charAt(0)==ae[3].charAt(1)?ae[0].charAt(0)+ae[1].charAt(0)+ae[2].charAt(0)+ae[3].charAt(0):ae.join("")}function a(oe,Se,_e,He){var rt=[le(Ce(He)),le(I(oe).toString(16)),le(I(Se).toString(16)),le(I(_e).toString(16))];return rt.join("")}A.equals=function(oe,Se){return!oe||!Se?!1:A(oe).toRgbString()==A(Se).toRgbString()},A.random=function(){return A.fromRatio({r:r(),g:r(),b:r()})};function i(oe,Se){Se=Se===0?0:Se||10;var _e=A(oe).toHsl();return _e.s-=Se/100,_e.s=d(_e.s),A(_e)}function D(oe,Se){Se=Se===0?0:Se||10;var _e=A(oe).toHsl();return _e.s+=Se/100,_e.s=d(_e.s),A(_e)}function w(oe){return A(oe).desaturate(100)}function S(oe,Se){Se=Se===0?0:Se||10;var _e=A(oe).toHsl();return _e.l+=Se/100,_e.l=d(_e.l),A(_e)}function L(oe,Se){Se=Se===0?0:Se||10;var _e=A(oe).toRgb();return _e.r=C(0,W(255,_e.r-I(255*-(Se/100)))),_e.g=C(0,W(255,_e.g-I(255*-(Se/100)))),_e.b=C(0,W(255,_e.b-I(255*-(Se/100)))),A(_e)}function P(oe,Se){Se=Se===0?0:Se||10;var _e=A(oe).toHsl();return _e.l-=Se/100,_e.l=d(_e.l),A(_e)}function _(oe,Se){var _e=A(oe).toHsl(),He=(_e.h+Se)%360;return _e.h=He<0?360+He:He,A(_e)}function b(oe){var Se=A(oe).toHsl();return Se.h=(Se.h+180)%360,A(Se)}function g(oe){var Se=A(oe).toHsl(),_e=Se.h;return[A(oe),A({h:(_e+120)%360,s:Se.s,l:Se.l}),A({h:(_e+240)%360,s:Se.s,l:Se.l})]}function m(oe){var Se=A(oe).toHsl(),_e=Se.h;return[A(oe),A({h:(_e+90)%360,s:Se.s,l:Se.l}),A({h:(_e+180)%360,s:Se.s,l:Se.l}),A({h:(_e+270)%360,s:Se.s,l:Se.l})]}function y(oe){var Se=A(oe).toHsl(),_e=Se.h;return[A(oe),A({h:(_e+72)%360,s:Se.s,l:Se.l}),A({h:(_e+216)%360,s:Se.s,l:Se.l})]}function x(oe,Se,_e){Se=Se||6,_e=_e||30;var He=A(oe).toHsl(),rt=360/_e,ae=[A(oe)];for(He.h=(He.h-(rt*Se>>1)+720)%360;--Se;)He.h=(He.h+rt)%360,ae.push(A(He));return ae}function O(oe,Se){Se=Se||6;for(var _e=A(oe).toHsv(),He=_e.h,rt=_e.s,ae=_e.v,$=[],Q=1/Se;Se--;)$.push(A({h:He,s:rt,v:ae})),ae=(ae+Q)%1;return $}A.mix=function(oe,Se,_e){_e=_e===0?0:_e||50;var He=A(oe).toRgb(),rt=A(Se).toRgb(),ae=_e/100,$={r:(rt.r-He.r)*ae+He.r,g:(rt.g-He.g)*ae+He.g,b:(rt.b-He.b)*ae+He.b,a:(rt.a-He.a)*ae+He.a};return A($)},A.readability=function(oe,Se){var _e=A(oe),He=A(Se);return(V.max(_e.getLuminance(),He.getLuminance())+.05)/(V.min(_e.getLuminance(),He.getLuminance())+.05)},A.isReadable=function(oe,Se,_e){var He=A.readability(oe,Se),rt,ae;ae=!1,rt=ye(_e);switch(rt.level+rt.size){case"AAsmall":case"AAAlarge":ae=He>=4.5;break;case"AAlarge":ae=He>=3;break;case"AAAsmall":ae=He>=7;break}return ae},A.mostReadable=function(oe,Se,_e){var He=null,rt=0,ae,$,Q,te;_e=_e||{},$=_e.includeFallbackColors,Q=_e.level,te=_e.size;for(var he=0;he<Se.length;he++)ae=A.readability(oe,Se[he]),ae>rt&&(rt=ae,He=A(Se[he]));return A.isReadable(oe,He,{level:Q,size:te})||!$?He:(_e.includeFallbackColors=!1,A.mostReadable(oe,["#fff","#000"],_e))};var H=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"},F=A.hexNames=R(H);function R(oe){var Se={};for(var _e in oe)oe.hasOwnProperty(_e)&&(Se[oe[_e]]=_e);return Se}function U(oe){return oe=parseFloat(oe),(isNaN(oe)||oe<0||oe>1)&&(oe=1),oe}function k(oe,Se){Y(oe)&&(oe="100%");var _e=re(oe);return oe=W(Se,C(0,parseFloat(oe))),_e&&(oe=parseInt(oe*Se,10)/100),V.abs(oe-Se)<1e-6?1:oe%Se/parseFloat(Se)}function d(oe){return W(1,C(0,oe))}function z(oe){return parseInt(oe,16)}function Y(oe){return typeof oe=="string"&&oe.indexOf(".")!=-1&&parseFloat(oe)===1}function re(oe){return typeof oe=="string"&&oe.indexOf("%")!=-1}function le(oe){return oe.length==1?"0"+oe:""+oe}function Ne(oe){return oe<=1&&(oe=oe*100+"%"),oe}function Ce(oe){return V.round(parseFloat(oe)*255).toString(16)}function Te(oe){return z(oe)/255}var Fe=function(){var oe="[-\\+]?\\d+%?",Se="[-\\+]?\\d*\\.\\d+%?",_e="(?:"+Se+")|(?:"+oe+")",He="[\\s|\\(]+("+_e+")[,|\\s]+("+_e+")[,|\\s]+("+_e+")\\s*\\)?",rt="[\\s|\\(]+("+_e+")[,|\\s]+("+_e+")[,|\\s]+("+_e+")[,|\\s]+("+_e+")\\s*\\)?";return{CSS_UNIT:new RegExp(_e),rgb:new RegExp("rgb"+He),rgba:new RegExp("rgba"+rt),hsl:new RegExp("hsl"+He),hsla:new RegExp("hsla"+rt),hsv:new RegExp("hsv"+He),hsva:new RegExp("hsva"+rt),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 Ve(oe){return!!Fe.CSS_UNIT.exec(oe)}function xe(oe){oe=oe.replace(j,"").replace(G,"").toLowerCase();var Se=!1;if(H[oe])oe=H[oe],Se=!0;else if(oe=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var _e;return(_e=Fe.rgb.exec(oe))?{r:_e[1],g:_e[2],b:_e[3]}:(_e=Fe.rgba.exec(oe))?{r:_e[1],g:_e[2],b:_e[3],a:_e[4]}:(_e=Fe.hsl.exec(oe))?{h:_e[1],s:_e[2],l:_e[3]}:(_e=Fe.hsla.exec(oe))?{h:_e[1],s:_e[2],l:_e[3],a:_e[4]}:(_e=Fe.hsv.exec(oe))?{h:_e[1],s:_e[2],v:_e[3]}:(_e=Fe.hsva.exec(oe))?{h:_e[1],s:_e[2],v:_e[3],a:_e[4]}:(_e=Fe.hex8.exec(oe))?{r:z(_e[1]),g:z(_e[2]),b:z(_e[3]),a:Te(_e[4]),format:Se?"name":"hex8"}:(_e=Fe.hex6.exec(oe))?{r:z(_e[1]),g:z(_e[2]),b:z(_e[3]),format:Se?"name":"hex"}:(_e=Fe.hex4.exec(oe))?{r:z(_e[1]+""+_e[1]),g:z(_e[2]+""+_e[2]),b:z(_e[3]+""+_e[3]),a:Te(_e[4]+""+_e[4]),format:Se?"name":"hex8"}:(_e=Fe.hex3.exec(oe))?{r:z(_e[1]+""+_e[1]),g:z(_e[2]+""+_e[2]),b:z(_e[3]+""+_e[3]),format:Se?"name":"hex"}:!1}function ye(oe){var Se,_e;return oe=oe||{level:"AA",size:"small"},Se=(oe.level||"AA").toUpperCase(),_e=(oe.size||"small").toLowerCase(),Se!=="AA"&&Se!=="AAA"&&(Se="AA"),_e!=="small"&&_e!=="large"&&(_e="small"),{level:Se,size:_e}}Bt.exports?Bt.exports=A:!(Z=function(){return A}.call(ve,T,ve,Bt),Z!==void 0&&(Bt.exports=Z))})(Math)},aUhZ:function(Bt,ve,T){"use strict";var Z=T("2qtc"),V=T("kLXV"),j=T("g9YV"),G=T("wCAj"),M=T("5NDa"),I=T("5rEg"),W=T("14J3"),C=T("BMrR"),r=T("iQDF"),A=T("+eQT"),v=T("miYZ"),f=T("tsqr"),p=T("jrin"),l=T("oBTY"),o=T("k1fw"),s=T("9og8"),t=T("y8nQ"),u=T("Vl3Y"),a=T("tJVT"),i=T("PpiC"),D=T("WmNS"),w=T.n(D),S=T("q1tI"),L=T.n(S),P=T("wd/R"),_=T.n(P),b=T("ErOA"),g=T("1vsH"),m=T("Ty5D"),y=T("9kvl"),x=T("oUNq"),O=T("xKgJ"),H=T("eozf"),F=function(U){var k=U.classroomList,d=U.dispatch,z=U.courseEndTime,Y=Object(i.a)(U,["classroomList","dispatch","courseEndTime"]),re=Object(m.i)(),le=u.a.useForm(),Ne=Object(a.a)(le,1),Ce=Ne[0],Te=Object(S.useState)(1),Fe=Object(a.a)(Te,2),Ve=Fe[0],xe=Fe[1],ye=Object(S.useState)([]),oe=Object(a.a)(ye,2),Se=oe[0],_e=oe[1],He=Object(S.useState)(0),rt=Object(a.a)(He,2),ae=rt[0],$=rt[1],Q=Object(S.useState)(2e4),te=Object(a.a)(Q,2),he=te[0],ge=te[1],we=Object(S.useState)(!0),ft=Object(a.a)(we,2),Pt=ft[0],jt=ft[1],qe=Object(S.useState)(),Mt=Object(a.a)(qe,2),sn=Mt[0],at=Mt[1],Qe=Object(S.useState)([]),Et=Object(a.a)(Qe,2),It=Et[0],dt=Et[1];re.id=re.coursesId,Object(S.useEffect)(function(){k.actionTabs.key==="\u7ACB\u5373\u622A\u6B62"?mt():(dt([]),_e([]))},[k.actionTabs.key]);var mt=function(){var Le=Object(s.a)(w.a.mark(function de(fe){var Ee,Pe,Ue;return w.a.wrap(function(Ot){for(;;)switch(Ot.prev=Ot.next){case 0:return jt(!0),Ot.next=3,Object(x.D)(Object(o.a)(Object(o.a)({},re),{},{page:fe||Ve,limit:he,homework_id:k.actionTabs.type===1?"":k.actionTabs.selectArrs[0],end_homework_action:!0,all:!0}));case 3:Ee=Ot.sent,Ee==null||Ee.course_groups.map(function(cn){cn.key=cn.id}),Ee&&(_e([].concat(Object(l.a)(Se),Object(l.a)(Ee==null?void 0:Ee.course_groups))),$(Ee==null?void 0:Ee.group_count),at(Ee==null?void 0:Ee.course_groups),jt(!1),fe||Ce.setFieldsValue((Ue={},Object(p.a)(Ue,"group_ids",Ee==null||((Pe=Ee.course_groups)===null||Pe===void 0)?void 0:Pe.map(function(cn){return String(cn.id)})),Object(p.a)(Ue,"end_time",_()(_()(new Date).add(0,"days").format("YYYY-MM-DD HH:mm"))),Ue)));case 6:case"end":return Ot.stop()}},de)}));return function(fe){return Le.apply(this,arguments)}}(),We=function(){var Le=Object(s.a)(w.a.mark(function de(){var fe,Ee;return w.a.wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:if(fe=Object(o.a)({},Ce.getFieldsValue()),console.log("----",fe.group_ids),!(sn!=null&&sn.length&&!(It!=null&&It.length))){Ue.next=5;break}return f.b.warning("\u8BF7\u9009\u62E9\u9700\u8981\u64CD\u4F5C\u7684\u73ED\u7EA7"),Ue.abrupt("return");case 5:return Ue.next=7,Object(b.a)("/api/courses/".concat(re.id,"/homework_commons/end_with_homework_list_position.json"),{method:"post",body:{homework_ids:Object(l.a)(k.actionTabs.selectArrs),group_ids:(It==null?void 0:It.length)>0?It:[],unified_setting:!(Se!=null&&Se.length),end_time:_()(fe.end_time).format("YYYY-MM-DD HH:mm")}});case 7:Ee=Ue.sent,Ee.status===0&&(De(),Object(g.cb)(["\u6559\u5B66\u8BFE\u5802","\u56FE\u6587\u4F5C\u4E1A","\u7ACB\u5373\u622A\u6B62"]),f.b.success("\u64CD\u4F5C\u6210\u529F"),d({type:"classroomList/setActionTabs",payload:{key:"\u6E05\u9664\u9009\u62E9\u6570\u636E"}}),Y.onCallback&&Y.onCallback(),Object(O.c)()?(d({type:"classroomList/setActionTabs",payload:{}}),d({type:"classroomList/getClassroomTeacherCommonList",payload:Object(o.a)(Object(o.a)({},k.actionTabs.params),{},{type:1})})):d({type:"classroomList/getClassroomCommonList",payload:Object(o.a)({},k.actionTabs.params)}));case 9:case"end":return Ue.stop()}},de)}));return function(){return Le.apply(this,arguments)}}(),De=function(){xe(1),_e([])};return L.a.createElement(V.a,{centered:!0,title:"\u622A\u6B62\u4F5C\u4E1A",visible:k.actionTabs.key==="\u7ACB\u5373\u622A\u6B62",okText:"\u622A\u6B62\u4F5C\u4E1A",cancelText:"\u6682\u4E0D\u622A\u6B62",onOk:We,onCancel:function(){De(),d({type:"classroomList/setActionTabs",payload:{}})}},L.a.createElement("p",{className:"tc"},"\u5B66\u751F\u5C06\u4E0D\u80FD\u518D\u63D0\u4EA4\u4F5C\u4E1A",L.a.createElement("br",null),'\u672C\u64CD\u4F5C\u53EA\u5BF9"\u63D0\u4EA4\u4E2D" \u201C\u8865\u4EA4\u4E2D\u201D\u7684\u4F5C\u4E1A\u6709\u6548'),Se&&L.a.createElement(u.a,{form:Ce},L.a.createElement(C.a,null,L.a.createElement("span",{className:"mr5"},"\u622A\u6B62\u65F6\u95F4:"),L.a.createElement(u.a.Item,{name:"end_time"},L.a.createElement(A.a,{style:{width:170},getPopupContainer:function(de){return de.parentNode},disabledDate:function(de){return Object(H.b)(de,z)},disabledTime:function(de){return Object(H.c)(de)},placeholder:"\u8BF7\u9009\u62E9\u7ED3\u675F\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:_()(Object(g.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",allowClear:!1}))),(sn==null?void 0:sn.length)>0&&L.a.createElement(C.a,null,L.a.createElement("span",{className:"mr5"},"\u9009\u62E9\u73ED\u7EA7:"),L.a.createElement(I.a.Search,{style:{width:"300px"},onChange:function(de){_e(sn.filter(function(fe){return fe.name.indexOf(de.target.value)>-1}))}})),(Se==null?void 0:Se.length)>0&&k.actionTabs.type===1&&L.a.createElement(G.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(de,fe){dt(de)}},rowKey:"id",pagination:!1,dataSource:Se,columns:[{title:"\u73ED\u7EA7",dataIndex:"name",key:"name"}]}),(Se==null?void 0:Se.length)>0&&k.actionTabs.type===2&&L.a.createElement(G.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(de,fe){dt(de)}},rowKey:"id",pagination:!1,dataSource:Se,columns:[{title:"\u73ED\u7EA7",dataIndex:"name",key:"name"},{title:"\u53D1\u5E03\u65F6\u95F4",dataIndex:"publish_time",key:"publish_time"},{title:"\u622A\u6B62\u65F6\u95F4",dataIndex:"end_time",key:"end_time"}]})))};ve.a=Object(y.a)(function(R){var U=R.classroomList;return{classroomList:U}})(F)},bT9E:function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return V});var Z=T("VTBJ");function V(j,G){var M=Object(Z.a)({},j);return Array.isArray(G)&&G.forEach(function(I){delete M[I]}),M}},biw7:function(Bt,ve,T){"use strict";var Z=T("q1tI"),V=T.n(Z),j=Z.createContext(null);ve.a=j},c5Ni:function(Bt,ve,T){},cguq:function(Bt,ve,T){"use strict";var Z=T("14J3"),V=T("BMrR"),j=T("5NDa"),G=T("5rEg"),M=T("iQDF"),I=T("+eQT"),W=T("giR+"),C=T("fyUT"),r=T("y8nQ"),A=T("Vl3Y"),v=T("0Owb"),f=T("OaEy"),p=T("2fM7"),l=T("oBTY"),o=T("jCWc"),s=T("kPKH"),t=T("PpiC"),u=T("tJVT"),a=T("q1tI"),i=T.n(a),D=T("/MfK"),w=T("w5pM"),S=T("9kvl"),L=T("eozf"),P=function(b){var g=b.disabled,m=b.shixunHomeworks,y=b.selectOptions,x=b.form,O=m.workSetting,H=Object(a.useState)([]),F=Object(u.a)(H,2),R=F[0],U=F[1],k=Object(a.useMemo)(function(){return y==null?void 0:y.filter(function(d){return!R.includes(d.value)})},[R,y]);return Object(a.useEffect)(function(){var d,z=(O==null||((d=O.anonymous_appeal_settings)===null||d===void 0)?void 0:d.filter(function(Y){return Y.appeal_time}))||[];U(z.map(function(Y){return Y.group_name}))},[O]),i.a.createElement(A.a.List,{name:"anonymous_appeal_settings"},function(d,z){var Y=z.add,re=z.remove;return i.a.createElement(i.a.Fragment,null,d.map(function(le){var Ne,Ce=le.key,Te=le.name,Fe=Object(t.a)(le,["key","name"]),Ve=x.getFieldValue(["anonymous_appeal_settings",Te]),xe=Ve.deleteflag;return i.a.createElement("div",{key:Ce},i.a.createElement(V.a,{align:"middle",style:{marginLeft:30,marginBottom:30}},i.a.createElement(s.a,null,"\u7533\u8BC9\u89C4\u5219",Ce+1,"\uFF1A"),i.a.createElement(s.a,{span:8},i.a.createElement(A.a.Item,Object(v.a)({},Fe,{name:[le.name,"group_name"]}),i.a.createElement(p.a,{mode:"multiple",disabled:g||!xe,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",options:k||[],onSelect:function(oe){U(function(Se){return[].concat(Object(l.a)(Se),[oe])})},onDeselect:function(oe){U(function(Se){return Se.filter(function(_e){return _e!==oe})})}}))),i.a.createElement(s.a,{className:"ml20"},i.a.createElement(A.a.Item,Object(v.a)({},Fe,{label:"\u8FDD\u89C4\u533F\u8BC4\u6263\u5206",name:[le.name,"appeal_penalty"]}),i.a.createElement(C.a,{min:0,disabled:g}))),i.a.createElement(s.a,{className:"ml20"},i.a.createElement(A.a.Item,Object(v.a)({},Fe,{label:"\u7ED3\u675F\u65F6\u95F4",name:[le.name,"appeal_time"]}),i.a.createElement(I.a,{allowClear:!1,style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u7ED3\u675F\u65F6\u95F4",disabled:g,disabledDate:function(oe){return Object(L.b)(oe,O==null?void 0:O.course_end_date)},disabledTime:function(oe){return Object(L.c)(oe)},showTime:{format:"HH:mm"},format:"YYYY-MM-DD HH:mm"}))),i.a.createElement(A.a.Item,Object(v.a)({},Fe,{name:[Te,"deleteflag"]}),i.a.createElement(G.a,{type:"hidden"})),Ce!==0&&!g&&xe&&i.a.createElement(D.a,{className:"ml20",onClick:function(){var oe=x.getFieldValue(["anonymous_appeal_settings",Te,"group_name"])||[];U(function(Se){return Se.filter(function(_e){return!oe.includes(_e)})}),re(Te)}}),!g&&d.length<(O==null||((Ne=O.anonymous_appeal_settings)===null||Ne===void 0)?void 0:Ne.length)&&i.a.createElement(w.a,{className:"c-green ml20",onClick:function(){Y({deleteflag:!0})}})))}))})};ve.a=Object(S.a)(function(_){var b=_.shixunHomeworks;return{shixunHomeworks:b}})(P)},dejd:function(Bt,ve,T){},dmUQ:function(Bt,ve,T){"use strict";var Z=T("Ff2n"),V=T("rePB"),j=T("1OyB"),G=T("vuIU"),M=T("Ji7U"),I=T("md7G"),W=T("foSv"),C=T("q1tI"),r=T.n(C),A=T("TSYQ"),v=T.n(A),f=T("4IlW");function p(g,m){var y=Object.keys(g);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(g);m&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(g,O).enumerable})),y.push.apply(y,x)}return y}function l(g){for(var m=1;m<arguments.length;m++){var y=arguments[m]!=null?arguments[m]:{};m%2?p(Object(y),!0).forEach(function(x){Object(V.a)(g,x,y[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(y)):p(Object(y)).forEach(function(x){Object.defineProperty(g,x,Object.getOwnPropertyDescriptor(y,x))})}return g}function o(g){var m=s();return function(){var x=Object(W.a)(g),O;if(m){var H=Object(W.a)(this).constructor;O=Reflect.construct(x,arguments,H)}else O=x.apply(this,arguments);return Object(I.a)(this,O)}}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 t(){}function u(g){g.preventDefault()}var a=function(m){return m.replace(/[^\w.-]+/g,"")},i=200,D=600,w=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,S=function(m){return m!=null},L=function(m,y){return y===m||typeof y=="number"&&typeof m=="number"&&isNaN(y)&&isNaN(m)},P=function(g){Object(M.a)(y,g);var m=o(y);function y(x){var O;Object(j.a)(this,y),O=m.call(this,x),O.onKeyDown=function(R){var U=O.props,k=U.onKeyDown,d=U.onPressEnter;if(R.keyCode===f.a.UP){var z=O.getRatio(R);O.up(R,z,null),O.stop()}else if(R.keyCode===f.a.DOWN){var Y=O.getRatio(R);O.down(R,Y,null),O.stop()}else R.keyCode===f.a.ENTER&&d&&d(R);if(O.recordCursorPosition(),O.lastKeyCode=R.keyCode,k){for(var re=arguments.length,le=new Array(re>1?re-1:0),Ne=1;Ne<re;Ne++)le[Ne-1]=arguments[Ne];k.apply(void 0,[R].concat(le))}},O.onKeyUp=function(R){var U=O.props.onKeyUp;if(O.stop(),O.recordCursorPosition(),U){for(var k=arguments.length,d=new Array(k>1?k-1:0),z=1;z<k;z++)d[z-1]=arguments[z];U.apply(void 0,[R].concat(d))}},O.onChange=function(R){var U=O.props.onChange;O.state.focused&&(O.inputting=!0),O.rawInput=O.props.parser(O.getValueFromEvent(R)),O.setState({inputValue:O.rawInput}),U(O.toNumber(O.rawInput))},O.onMouseUp=function(){var R=O.props.onMouseUp;O.recordCursorPosition(),R&&R.apply(void 0,arguments)},O.onFocus=function(){var R;O.setState({focused:!0}),(R=O.props).onFocus.apply(R,arguments)},O.onBlur=function(){var R=O.props.onBlur;O.inputting=!1,O.setState({focused:!1});var U=O.getCurrentValidValue(O.state.inputValue),k=O.setValue(U,t);if(R){var d=O.input.value,z=O.getInputDisplayValue({focus:!1,value:k});O.input.value=z&&Number(z),R.apply(void 0,arguments),O.input.value=d}},O.getRatio=function(R){var U=1;return R.metaKey||R.ctrlKey?U=.1:R.shiftKey&&(U=10),U},O.getFullNum=function(R){return isNaN(R)?R:/e/i.test(String(R))?Number(R).toFixed(18).replace(/\.?0+$/,""):R},O.getPrecision=function(R){if(S(O.props.precision))return O.props.precision;var U=String(R);if(U.indexOf("e-")>=0)return parseInt(U.slice(U.indexOf("e-")+2),10);var k=0;return U.indexOf(".")>=0&&(k=U.length-U.indexOf(".")-1),k},O.getInputDisplayValue=function(R){var U=R||O.state,k=U.focused,d=U.inputValue,z=U.value,Y;k?Y=d:Y=O.toPrecisionAsStep(z),Y==null&&(Y="");var re=O.formatWrapper(Y);return S(O.props.decimalSeparator)&&(re=re.toString().replace(".",O.props.decimalSeparator)),re},O.recordCursorPosition=function(){try{O.cursorStart=O.input.selectionStart,O.cursorEnd=O.input.selectionEnd,O.currentValue=O.input.value,O.cursorBefore=O.input.value.substring(0,O.cursorStart),O.cursorAfter=O.input.value.substring(O.cursorEnd)}catch(R){}},O.restoreByAfter=function(R){if(R===void 0)return!1;var U=O.input.value,k=U.lastIndexOf(R);if(k===-1)return!1;var d=O.cursorBefore.length;return O.lastKeyCode===f.a.DELETE&&O.cursorBefore.charAt(d-1)===R[0]?(O.fixCaret(d,d),!0):k+R.length===U.length?(O.fixCaret(k,k),!0):!1},O.partRestoreByAfter=function(R){return R===void 0?!1:Array.prototype.some.call(R,function(U,k){var d=R.substring(k);return O.restoreByAfter(d)})},O.isNotCompleteNumber=function(R){return isNaN(R)||R===""||R===null||R&&R.toString().indexOf(".")===R.toString().length-1},O.stop=function(){O.autoStepTimer&&clearTimeout(O.autoStepTimer)},O.down=function(R,U,k){O.pressingUpOrDown=!0,O.step("down",R,U,k)},O.up=function(R,U,k){O.pressingUpOrDown=!0,O.step("up",R,U,k)},O.saveInput=function(R){O.input=R};var H=x.value;H===void 0&&(H=x.defaultValue),O.state={focused:x.autoFocus};var F=O.getValidValue(O.toNumber(H));return O.state=l(l({},O.state),{},{inputValue:O.toPrecisionAsStep(F),value:F}),O}return Object(G.a)(y,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(O){var H=this.props,F=H.value,R=H.onChange,U=H.max,k=H.min,d=this.state.focused;if(O){if(!L(O.value,F)||!L(O.max,U)||!L(O.min,k)){var z=d?F:this.getValidValue(F),Y;this.pressingUpOrDown?Y=z:this.inputting?Y=this.rawInput:Y=this.toPrecisionAsStep(z),this.setState({value:z,inputValue:Y})}var re="value"in this.props?F:this.state.value;"max"in this.props&&O.max!==U&&typeof re=="number"&&re>U&&R&&R(U),"min"in this.props&&O.min!==k&&typeof re=="number"&&re<k&&R&&R(k)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var le=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===f.a.BACKSPACE?le=this.cursorStart-1:this.lastKeyCode===f.a.DELETE&&(le=this.cursorStart):le=this.input.value.length,this.fixCaret(le,le)}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(Ne){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(O){var H=O;return H===""?H="":this.isNotCompleteNumber(parseFloat(H))?H=this.state.value:H=this.getValidValue(H),this.toNumber(H)}},{key:"getValueFromEvent",value:function(O){var H=O.target.value.trim().replace(/。/g,".");return S(this.props.decimalSeparator)&&(H=H.replace(this.props.decimalSeparator,".")),H}},{key:"getValidValue",value:function(O){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,R=parseFloat(O);return isNaN(R)?O:(R<H&&(R=H),R>F&&(R=F),R)}},{key:"setValue",value:function(O,H){var F=this.props.precision,R=this.isNotCompleteNumber(parseFloat(O))?null:parseFloat(O),U=this.state.value,k=U===void 0?null:U,d=this.state.inputValue,z=d===void 0?null:d,Y=typeof R=="number"?R.toFixed(F):"".concat(R),re=R!==k||Y!=="".concat(z);return"value"in this.props?(z=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:z},H)):this.setState({value:R,inputValue:this.toPrecisionAsStep(O)},H),re&&this.props.onChange(R),R}},{key:"getMaxPrecision",value:function(O){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.props,R=F.precision,U=F.step;if(S(R))return R;var k=this.getPrecision(H),d=this.getPrecision(U),z=this.getPrecision(O);return O?Math.max(z,k+d):k+d}},{key:"getPrecisionFactor",value:function(O){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.getMaxPrecision(O,H);return Math.pow(10,F)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(O){return this.props.formatter?this.props.formatter(O):O}},{key:"toPrecisionAsStep",value:function(O){if(this.isNotCompleteNumber(O)||O==="")return O;var H=Math.abs(this.getMaxPrecision(O));return isNaN(H)?O.toString():Number(O).toFixed(H)}},{key:"toNumber",value:function(O){var H=this.props.precision,F=this.state.focused,R=O&&O.length>16&&F;return this.isNotCompleteNumber(O)||R?O:S(H)?Math.round(O*Math.pow(10,H))/Math.pow(10,H):Number(O)}},{key:"upStep",value:function(O,H){var F=this.props.step,R=this.getPrecisionFactor(O,H),U=Math.abs(this.getMaxPrecision(O,H)),k=((R*O+R*F*H)/R).toFixed(U);return this.toNumber(k)}},{key:"downStep",value:function(O,H){var F=this.props.step,R=this.getPrecisionFactor(O,H),U=Math.abs(this.getMaxPrecision(O,H)),k=((R*O-R*F*H)/R).toFixed(U);return this.toNumber(k)}},{key:"step",value:function(O,H){var F=this,R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,U=arguments.length>3?arguments[3]:void 0;this.stop(),H&&(H.persist(),H.preventDefault());var k=this.props;if(k.disabled)return;var d=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(d))return;var z=this["".concat(O,"Step")](d,R),Y=z>k.max||z<k.min;if(z>k.max?z=k.max:z<k.min&&(z=k.min),this.setValue(z,null),this.setState({focused:!0},function(){F.pressingUpOrDown=!1}),Y)return;this.autoStepTimer=setTimeout(function(){F[O](H,R,!0)},U?i:D)}},{key:"fixCaret",value:function(O,H){if(O===void 0||H===void 0||!this.input||!this.input.value)return;try{var F=this.input.selectionStart,R=this.input.selectionEnd;(O!==F||H!==R)&&this.input.setSelectionRange(O,H)}catch(U){}}},{key:"render",value:function(){var O,H=this.props,F=H.prefixCls,R=H.disabled,U=H.readOnly,k=H.useTouch,d=H.autoComplete,z=H.upHandler,Y=H.downHandler,re=H.className,le=H.max,Ne=H.min,Ce=H.style,Te=H.title,Fe=H.onMouseEnter,Ve=H.onMouseLeave,xe=H.onMouseOver,ye=H.onMouseOut,oe=H.required,Se=H.onClick,_e=H.tabIndex,He=H.type,rt=H.placeholder,ae=H.id,$=H.inputMode,Q=H.pattern,te=H.step,he=H.maxLength,ge=H.autoFocus,we=H.name,ft=H.onPaste,Pt=H.onInput,jt=Object(Z.a)(H,["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"]),qe=this.state,Mt=qe.value,sn=qe.focused,at=v()(F,(O={},Object(V.a)(O,re,!!re),Object(V.a)(O,"".concat(F,"-disabled"),R),Object(V.a)(O,"".concat(F,"-focused"),sn),O)),Qe={};Object.keys(jt).forEach(function(Pe){(Pe.substr(0,5)==="data-"||Pe.substr(0,5)==="aria-"||Pe==="role")&&(Qe[Pe]=jt[Pe])});var Et=!U&&!R,It=this.getInputDisplayValue(null),dt=(Mt||Mt===0)&&(isNaN(Mt)||Number(Mt)>=le),mt=(Mt||Mt===0)&&(isNaN(Mt)||Number(Mt)<=Ne),We=dt||R||U,De=mt||R||U,Le=v()("".concat(F,"-handler"),"".concat(F,"-handler-up"),Object(V.a)({},"".concat(F,"-handler-up-disabled"),We)),de=v()("".concat(F,"-handler"),"".concat(F,"-handler-down"),Object(V.a)({},"".concat(F,"-handler-down-disabled"),De)),fe=k?{onTouchStart:We?t:this.up,onTouchEnd:this.stop}:{onMouseDown:We?t:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},Ee=k?{onTouchStart:De?t:this.down,onTouchEnd:this.stop}:{onMouseDown:De?t:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return r.a.createElement("div",{className:at,style:Ce,title:Te,onMouseEnter:Fe,onMouseLeave:Ve,onMouseOver:xe,onMouseOut:ye,onFocus:function(){return null},onBlur:function(){return null}},r.a.createElement("div",{className:"".concat(F,"-handler-wrap")},r.a.createElement("span",Object.assign({unselectable:"on"},fe,{role:"button","aria-label":"Increase Value","aria-disabled":We,className:Le}),z||r.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-up-inner"),onClick:u})),r.a.createElement("span",Object.assign({unselectable:"on"},Ee,{role:"button","aria-label":"Decrease Value","aria-disabled":De,className:de}),Y||r.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-down-inner"),onClick:u}))),r.a.createElement("div",{className:"".concat(F,"-input-wrap")},r.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Ne,"aria-valuemax":le,"aria-valuenow":Mt,required:oe,type:He,placeholder:rt,onPaste:ft,onClick:Se,onMouseUp:this.onMouseUp,className:"".concat(F,"-input"),tabIndex:_e,autoComplete:d,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Et?this.onKeyDown:t,onKeyUp:Et?this.onKeyUp:t,autoFocus:ge,maxLength:he,readOnly:U,disabled:R,max:le,min:Ne,step:te,name:we,title:Te,id:ae,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(It),pattern:Q,inputMode:$,onInput:Pt},Qe))))}}]),y}(r.a.Component);P.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:w,min:-w,step:1,style:{},onChange:t,onKeyDown:t,onPressEnter:t,onFocus:t,onBlur:t,parser:a,required:!1,autoComplete:"off"};var _=P,b=ve.a=_},eozf:function(Bt,ve,T){"use strict";T.d(ve,"b",function(){return Ve}),T.d(ve,"c",function(){return xe});var Z=T("sRBo"),V=T("kaz8"),j=T("5Dmo"),G=T("3S7+"),M=T("/zsF"),I=T("PArb"),W=T("7Kak"),C=T("9yH6"),r=T("14J3"),A=T("BMrR"),v=T("+L6B"),f=T("2/Rp"),p=T("jCWc"),l=T("kPKH"),o=T("2qtc"),s=T("kLXV"),t=T("9og8"),u=T("miYZ"),a=T("tsqr"),i=T("oBTY"),D=T("k1fw"),w=T("tJVT"),S=T("OaEy"),L=T("2fM7"),P=T("iQDF"),_=T("+eQT"),b=T("WmNS"),g=T.n(b),m=T("q1tI"),y=T.n(m),x=T("/MfK"),O=T("w5pM"),H=T("Lyp1"),F=T("wd/R"),R=T.n(F),U=T("xKgJ"),k=T("ErOA"),d=T("LvDl"),z=T.n(d),Y=T("1vsH"),re=T("zetH"),le=T.n(re),Ne=T("Ty5D"),Ce=T("9kvl"),Te=T("AHFd");function Fe(_e,He){for(var rt=[],ae=_e;ae<He;ae++)rt.push(ae);return rt}var Ve=function(He,rt,ae){var $=He<R()().startOf("day"),Q=He>R()(rt).endOf("day"),te=He<R()(ae).startOf("day");return rt?ae?R()()<=R()(ae)?te||Q:$||Q:He&&$||Q:ae&&R()()<=R()(ae)?te:$},xe=function(He,rt){var ae=parseInt(R()(He).format("HH")),$=parseInt(R()().format("HH")),Q=parseInt(R()().format("mm"));if(!He)return{disabledHours:function(){return Fe(0,$)},disabledMinutes:function(){return Fe(0,Q)}};if(rt){var te=parseInt(R()(rt).format("HH")),he=parseInt(R()(rt).format("mm"));return R()(He).isSame(R()(rt),"day")?{disabledHours:function(){return Fe(0,te)},disabledMinutes:function(){return ae<=te?Fe(0,he):[]}}:void 0}return R()(He).isSame(R()(),"day")?{disabledHours:function(){return Fe(0,$)},disabledMinutes:function(){return R()(He).isSame(R()(),"hour")&&ae<=$?Fe(0,Q):[]}}:void 0},ye=_.a.RangePicker,oe=L.a.Option,Se=function(He){var rt,ae,$,Q,te,he,ge,we=He.shixunHomeworks,ft=He.loading,Pt=He.dispatch,jt=Object(Ne.i)(),qe=we.workSetting,Mt=we.workList,sn=we.changeData,at=Object(m.useState)(!0),Qe=Object(w.a)(at,2),Et=Qe[0],It=Qe[1],dt=Object(m.useState)(!1),mt=Object(w.a)(dt,2),We=mt[0],De=mt[1],Le=Object(m.useState)([]),de=Object(w.a)(Le,2),fe=de[0],Ee=de[1],Pe=Object(m.useState)([]),Ue=Object(w.a)(Pe,2),lt=Ue[0],Ot=Ue[1],cn=Object(m.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_penalty:0,penalty_type:Te.a.Percent,challenge_settings:[],work_efficiency:!1,shixun_evaluation:"",answer_open_evaluation:!1,answer_public:!1,score_open:!1,comment_public:!0,total_score:"",eff_score:0}),An=Object(w.a)(cn,2),Ct=An[0],Gt=An[1];Object(m.useEffect)(function(){return xt(),function(){Ee([].concat())}},[]);var xt=function(){Pt({type:"shixunHomeworks/getWorkSetting",payload:Object(D.a)({},jt)})};Object(m.useEffect)(function(){var Ke;if(!(qe!=null&&qe.course_id))return;Object.keys(Ct).map(function(st){Ct[st]=qe[st]}),(!Ct.allow_late||!Ct.unified_late)&&(Ct.late_penalty=20,Ct.penalty_type=Te.a.Percent),Ct.unified_setting||(Ct.unified_late=!1,Ct.unified_anonymous_comment=!1,Ct.unified_anonymous_appeal=!1),fe=JSON.parse(JSON.stringify(qe.group_settings.map(function(st){return Object(D.a)(Object(D.a)({},st),{},{group_name:[st.group_name]})}).filter(function(st){return st.publish_time!==null}))),lt=JSON.parse(JSON.stringify(qe.allow_late_settings.map(function(st){return Object(D.a)(Object(D.a)({},st),{},{group_name:[st.group_name]})}).filter(function(st){return st.late_time!==null}))),Gt(Object(D.a)({},Ct)),Ee(Object(i.a)(fe)),((Ke=lt)===null||Ke===void 0?void 0:Ke.length)<=0?Ot([{penalty_type:Te.a.Percent,late_penalty:20}]):Ot(Object(i.a)(lt))},[qe]);var Rt=function(){var st,bt,Ft=JSON.parse(JSON.stringify(Ct));if(Ft.challenge_settings.filter(function(gn){return!gn.hide}),Ft.categoryId=jt.categoryId,(st=Ft.challenge_settings)!==null&&st!==void 0&&st.every(function(gn){return!gn.checked})){a.b.warn("\u5173\u5361\u4E0D\u80FD\u5168\u90E8\u8BBE\u7F6E\u4E3A\u53EF\u4E0D\u505A");return}if(Ct.unified_setting||(fe=(bt=fe)===null||bt===void 0?void 0:bt.map(function(gn){var er;if(!gn.publish_time||!gn.end_time)throw a.b.error("\u8BF7\u628A\u53D1\u5E03\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u53D1\u5E03\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!gn.group_name)throw a.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return gn.group_name=typeof(gn==null?void 0:gn.group_name)=="string"?[gn==null?void 0:gn.group_name]:gn==null?void 0:gn.group_name,gn.group_id=(er=qe.group_settings)===null||er===void 0?void 0:er.filter(function(Hn){var yn;return gn==null||((yn=gn.group_name)===null||yn===void 0)?void 0:yn.includes(Hn.group_name)}).map(function(Hn){return Hn.group_id||Hn.id}).toString().split(","),gn})),Ft.group_settings=fe,Ct.allow_late)if(Ct.unified_late){if(Ct.late_penalty===null||Ct.late_penalty===void 0||Ct.late_penalty<0||Ct.late_penalty>100)throw a.b.error("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100"),new String("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100");if(!Ct.late_time)throw a.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574")}else{var $t;lt=($t=lt)===null||$t===void 0?void 0:$t.map(function(gn){var er,Hn;if(gn.late_penalty===null||gn.late_penalty===void 0||gn.late_penalty<0||gn.late_penalty>100)throw a.b.error("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100"),new String("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100");if(!gn.late_time)throw a.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!gn.group_name)throw a.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return gn.group_name=typeof(gn==null?void 0:gn.group_name)=="string"?[gn==null?void 0:gn.group_name]:gn==null?void 0:gn.group_name,gn.group_id=gn==null||((er=gn.group_name)===null||er===void 0||((Hn=er.map(function(yn){var Sr,_r,ar=(Sr=qe.group_settings)===null||Sr===void 0||((_r=Sr.filter(function(cr){return(cr==null?void 0:cr.group_name)===yn}))===null||_r===void 0)?void 0:_r[0];return ar==null?void 0:ar.group_id}))===null||Hn===void 0))?void 0:Hn.toString().split(","),gn}),Ft.allow_late_settings=lt}gt(Ft)},gt=function(st){var bt,Ft;if(st.total_score===null){a.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}if(st!=null&&st.work_efficiency&&st.eff_score===null){a.b.warn("\u6548\u7387\u5206\u4E0D\u80FD\u4E3A\u7A7A");return}var $t=st.challenge_settings.reduce(function(Hn,yn){return Hn+Number(yn.challenge_score)},0);if(($t==null?void 0:$t.toFixed(10))!==((bt=st.total_score-st.eff_score)===null||bt===void 0?void 0:bt.toFixed(10))){a.b.warn("\u6548\u7387\u5206\u52A0\u5173\u5361\u4EFB\u52A1\u603B\u5206\u5FC5\u987B\u7B49\u4E8E\u603B\u5206\u503C\uFF1A".concat(st.total_score,"\u5206"));return}var gn={shixun_evaluation:st.shixun_evaluation,challenge_settings:st.challenge_settings},er=function(){var Hn=Object(t.a)(g.a.mark(function yn(){var Sr;return g.a.wrap(function(ar){for(;;)switch(ar.prev=ar.next){case 0:return De(!0),ar.next=3,Object(k.a)("/api/homework_commons/".concat(jt.categoryId,"/publish_setting.json"),{method:"post",body:Object(D.a)({},st)});case 3:Sr=ar.sent,Sr.status===0&&(a.b.success("\u66F4\u65B0\u6210\u529F"),It(!0),xt(),Pt({type:"shixunHomeworks/getWorkList",payload:Object(D.a)({},jt)})),De(!1);case 6:case"end":return ar.stop()}},yn)}));return function(){return Hn.apply(this,arguments)}}();!Object(d.isEqual)(sn,gn)&&!(Mt!=null&&(Ft=Mt.homework_status)!==null&&Ft!==void 0&&Ft.includes("\u672A\u53D1\u5E03"))?s.a.confirm({title:"\u66F4\u65B0\u6210\u7EE9",content:"\u60A8\u6539\u52A8\u4E86\u672C\u6B21\u4F5C\u4E1A\u7684\u5173\u5361\u5F97\u5206\u8BBE\u7F6E\uFF0C\u8FD9\u53EF\u80FD\u5BFC\u81F4\u5DF2\u5B8C\u6210\u4F5C\u4E1A\u7684\u5B66\u751F\u7684\u6210\u7EE9\u4EA7\u751F\u9519\u8BEF\u3002\u70B9\u51FB\u201C\u786E\u5B9A\u201D\u6309\u94AE\u5C06\u4FDD\u5B58\u6700\u65B0\u8BBE\u7F6E\u5E76\u6309\u6700\u65B0\u8BBE\u7F6E\u66F4\u65B0\u5168\u73ED\u6210\u7EE9\u3002",okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:er}):er()},be=function(st,bt){var Ft,$t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"group_id";return bt?bt.find(function(gn){return gn[$t]===st}):qe==null||((Ft=qe.group_settings)===null||Ft===void 0)?void 0:Ft.find(function(gn){return gn.group_id[0]===st})},Ie=(qe==null?void 0:qe.allow_late)||(qe==null?void 0:qe.anonymous_comment),Dt=function(st){var bt=be(st,qe==null?void 0:qe.allow_late_settings,"id"),Ft=be(st,qe==null?void 0:qe.anonymous_comment_settings);return(qe==null?void 0:qe.allow_late)&&bt&&(bt==null?void 0:bt.late_time)!==null||(qe==null?void 0:qe.anonymous_comment)&&Ft&&(Ft==null?void 0:Ft.evaluation_start)!==null},ht=Object(m.useMemo)(function(){var Ke;if(qe!=null&&qe.unified_setting){var st;return!(Mt!=null&&(st=Mt.homework_status)!==null&&st!==void 0&&st.includes("\u5DF2\u622A\u6B62"))||(qe==null?void 0:qe.allow_late)||(qe==null?void 0:qe.anonymous_comment)}var bt=qe==null||((Ke=qe.group_settings)===null||Ke===void 0)?void 0:Ke.some(function(Ft){return R()(Ft.end_time)<=R()()});return!bt||(qe==null?void 0:qe.allow_late)||(qe==null?void 0:qe.all_group_late)},[qe,Mt]),nn=qe==null?void 0:qe.anonymous_comment,qt=function(st){if(!st)return!1;var bt=be(st,qe==null?void 0:qe.anonymous_comment_settings);return(qe==null?void 0:qe.anonymous_comment)&&bt&&(bt==null?void 0:bt.evaluation_start)!==null};return y.a.createElement("section",{className:[le.a.form," bg-white pl30 pr30 pt10"].join(" ")},y.a.createElement(A.a,null,y.a.createElement(l.a,{span:24},y.a.createElement(A.a,{align:"middle"},y.a.createElement(l.a,{flex:"1"}),y.a.createElement(l.a,null,Object(U.c)()&&Et&&y.a.createElement(f.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return It(!1)}},"\u7F16\u8F91\u8BBE\u7F6E")))),y.a.createElement("div",null,y.a.createElement("label",null,"\u53D1\u5E03\u65B9\u5F0F\uFF1A")," ",y.a.createElement(C.a.Group,{disabled:Et||!(Mt!=null&&(rt=Mt.homework_status)!==null&&rt!==void 0&&rt.includes("\u672A\u53D1\u5E03")),value:Ct.unified_setting,onChange:function(st){var bt;if(!(Mt!=null&&(bt=Mt.homework_status)!==null&&bt!==void 0&&bt.includes("\u672A\u53D1\u5E03"))){a.b.error("\u5DF2\u53D1\u5E03\uFF0C\u4E0D\u80FD\u518D\u4FEE\u6539\u7EDF\u4E00\u8BBE\u7F6E");return}if(Ct.unified_setting=!Ct.unified_setting,Ct.unified_setting||(Ct.unified_late=!1),Gt(Object.assign({},Ct)),Ct.unified_setting===!1&&fe==""){Ee(fe.concat({}));return}Ct.unified_setting&&(Ee([]),Ot([{late_penalty:5}]))}},y.a.createElement(C.a,{value:!0},"\u7EDF\u4E00\u53D1\u5E03"),y.a.createElement(C.a,{disabled:(qe==null||((ae=qe.group_settings)===null||ae===void 0)?void 0:ae.length)===0,value:!1},"\u5206\u73ED\u53D1\u5E03")),(qe==null||(($=qe.group_settings)===null||$===void 0)?void 0:$.length)===0&&y.a.createElement("p",{style:{marginLeft:"65px",color:"rgba(0, 0, 0, 0.25)"}},"\uFF08\u672C\u8BFE\u5802\u65E0\u5206\u73ED\uFF0C\u4EC5\u652F\u6301\u9009\u62E9\u201C\u7EDF\u4E00\u53D1\u5E03\u201C\uFF09"))),Ct.unified_setting&&y.a.createElement("div",null,y.a.createElement(A.a,{align:"middle",className:"mt25 pl30"},y.a.createElement(l.a,null,"\u53D1\u5E03\u65F6\u95F4:"),y.a.createElement(l.a,{className:"ml5"},y.a.createElement(_.a,{disabled:Et||!(Mt!=null&&(Q=Mt.homework_status)!==null&&Q!==void 0&&Q.includes("\u672A\u53D1\u5E03")||Mt!=null&&(te=Mt.homework_status)!==null&&te!==void 0&&te.includes("\u672A\u5F00\u59CB")),style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4",showTime:{format:"HH:mm"},allowClear:!1,format:"YYYY-MM-DD HH:mm",disabledDate:function(st){return Ve(st,qe==null?void 0:qe.course_end_date)},disabledTime:function(st){return xe(st)},value:Ct.publish_time?R()(Ct.publish_time):"",onChange:function(st,bt){Ct.publish_time=bt,(Ct.end_time==""||!Ct.end_time)&&Ct.unified_setting&&(Ct.end_time=R()(st).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),Gt(Object.assign({},Ct))}})),y.a.createElement(l.a,null,y.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u7684\u65F6\u95F4)"))),y.a.createElement(A.a,{align:"middle",className:"mt25 pl30"},y.a.createElement(l.a,null,"\u622A\u6B62\u65F6\u95F4:"),y.a.createElement(l.a,{className:"ml5"},y.a.createElement(_.a,{style:{width:170},allowClear:!1,placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:R()(Object(Y.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:Et||Ie,disabledDate:function(st){return Ve(st,qe==null?void 0:qe.course_end_date,Ct.publish_time)},disabledTime:function(st){return xe(st,Ct.publish_time)},value:Ct.end_time?R()(Ct.end_time):"",onChange:function(st,bt){Ct.end_time=bt,Gt(Object.assign({},Ct))}})),y.a.createElement(l.a,null,y.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)")))),!Ct.unified_setting&&((he=fe)===null||he===void 0?void 0:he.length)>0&&y.a.createElement(A.a,{style:{marginTop:30,paddingTop:40,marginLeft:40,borderTop:"1px solid #eee"}},y.a.createElement(l.a,{span:24},y.a.createElement(A.a,null,y.a.createElement(l.a,{span:10}),y.a.createElement(l.a,{span:10},y.a.createElement(A.a,{className:"c-grey-c ml30"},y.a.createElement(l.a,{flex:"1"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u65F6\u95F4)"),y.a.createElement(l.a,{flex:"1"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u65F6\u95F4\u622A\u70B9)"))),y.a.createElement(l.a,{span:4}))),fe&&fe.map(function(Ke,st){var bt,Ft,$t,gn,er;return y.a.createElement(l.a,{span:24,key:st},y.a.createElement(A.a,{gutter:[8,16]},y.a.createElement(l.a,{span:10},y.a.createElement(A.a,{gutter:[8,16]},y.a.createElement(l.a,null,"\u53D1\u5E03\u89C4\u5219 ",st+1),y.a.createElement(l.a,{flex:"1",style:{maxWidth:300}},y.a.createElement(L.a,{disabled:Et||!(Mt!=null&&(bt=Mt.homework_status)!==null&&bt!==void 0&&bt.includes("\u672A\u53D1\u5E03"))&&Ke.id,className:"ml20",mode:"multiple",style:{width:"100%"},value:Ke.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(yn){fe[st].group_name=yn,fe[st].group_id=Ke.group_id;var Sr=Object(d.flattenDeep)(fe.map(function(ar){return ar.group_name})),_r=lt.map(function(ar){var cr=(ar==null?void 0:ar.group_name)||[];return Object(D.a)(Object(D.a)({},ar),{},{group_name:Object(d.remove)(cr,function(Pr){return Sr.includes(Pr)})})});Ot(_r),Ee(fe.slice())}},qe.group_settings&&qe.group_settings.map(function(Hn){var yn=fe.map(function(Sr){return Sr.group_name}).flat();if(!yn.includes(Hn.group_name))return y.a.createElement(oe,{value:Hn.group_name,key:Hn.id},Hn.group_name)}))))),y.a.createElement(l.a,{span:10},y.a.createElement("div",{className:"ml30"},y.a.createElement(ye,{ranges:{\u6B64\u523B:[Ke.publish_time?R()(Ke.publish_time):R()(),R()()]},allowClear:!1,disabled:Et||(R()()<=R()((Ft=be(($t=Ke.group_id)===null||$t===void 0?void 0:$t[0]))===null||Ft===void 0?void 0:Ft.publish_time)?!1:[!0,Dt((gn=Ke.group_id)===null||gn===void 0?void 0:gn[0])]),style:{width:400},placeholder:["\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4","\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4"],disabledDate:function(yn){return Ve(yn,qe==null?void 0:qe.course_end_date)},disabledTime:function(yn){return xe(yn)},showTime:{showNow:!0,format:"HH:mm",defaultValue:[R()(Object(Y.d)(),"HH:mm"),R()(Object(Y.d)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:Ke.publish_time&&[R()(Ke.publish_time),Ke.end_time?R()(Ke.end_time):void 0],onChange:function(yn,Sr){fe[st].publish_time=Sr[0],fe[st].end_time=Sr[1],Ee(Object(i.a)(fe))}}))),!Et&&y.a.createElement(l.a,{span:4},st>0&&!Ke.id&&y.a.createElement(x.a,{onClick:function(){fe=fe.filter(function(yn,Sr){return st!==Sr}),Ee(fe.slice()),setTimeout(function(){return Ee(fe.slice())},10)}}),fe.length<(qe==null||((er=qe.group_settings)===null||er===void 0)?void 0:er.length)&&y.a.createElement(O.a,{className:"c-green ml20",onClick:function(){Ee(fe.concat({}))}}))))})),y.a.createElement(I.a,null),y.a.createElement(A.a,null,y.a.createElement(l.a,null,y.a.createElement("strong",null,"\u8865\u4EA4\u8BBE\u7F6E"),y.a.createElement(G.a,{placement:"right",title:"\u4F5C\u4E1A\u622A\u6B62\u540E\u624D\u53EF\u5F00\u542F\u8865\u4EA4\uFF0C\u5F00\u542F\u8865\u4EA4\u540E\u4E0D\u53EF\u53D8\u66F4\u4F5C\u4E1A\u622A\u6B62\u65F6\u95F4\u3002"},y.a.createElement(H.a,{style:{marginLeft:4,cursor:"pointer"}}))),y.a.createElement(l.a,{span:24,className:"mt15 pl30"},y.a.createElement(V.a,{checked:Ct.allow_late,disabled:Et||ht,onChange:function(){Ct.allow_late=!Ct.allow_late,lt==""&&Ot([{late_penalty:5}]),Gt(Object.assign({},Ct))}},y.a.createElement("strong",null,"\u5F00\u542F\u8865\u4EA4")),y.a.createElement(G.a,{overlayStyle:{width:380,maxWidth:380},title:y.a.createElement("div",{style:{display:"flex",flexFlow:"column"}},y.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219\u8BF4\u660E"),y.a.createElement("span",null,"\u5F00\u542F\u8865\u4EA4\uFF0C\u5B66\u751F\u53EA\u5728\u8865\u4EA4\u65F6\u95F4\u5185\u624D\u901A\u5173\u5219\u6263\u9664\u5206\u503C\uFF0C\u672A\u901A\u5173\u4E0D\u6263\u5206\uFF1B"),y.a.createElement("span",null,"\u5B66\u751F\u5728\u6B63\u5E38\u4F5C\u4E1A\u89C4\u5B9A\u65F6\u95F4\u5185\u901A\u5173\uFF0C\u5728\u8865\u4EA4\u9636\u6BB5\u518D\u6B21\u901A\u5173\u4E0D\u6263\u5206\u3002"))},y.a.createElement(H.a,null)))),(Ct==null?void 0:Ct.allow_late)&&y.a.createElement("div",{style:{marginLeft:22}},y.a.createElement("div",{className:"ml30 mt20"},y.a.createElement("span",null,"\u8865\u4EA4\u65B9\u5F0F\uFF1A"),y.a.createElement(C.a.Group,{disabled:Et||(qe==null?void 0:qe.anonymous_comment)||(qe==null?void 0:qe.allow_late),value:Ct.unified_late,onChange:function(st){Ct.unified_late=st.target.value,lt==""&&!st.target.value&&Ot([{penalty_type:Te.a.Percent,late_penalty:20}]),Gt(Object(D.a)({},Ct))}},(Ct==null?void 0:Ct.unified_setting)&&y.a.createElement(C.a,{value:!0}," \u7EDF\u4E00\u8865\u4EA4 "),(qe==null||((ge=qe.group_settings)===null||ge===void 0)?void 0:ge.length)>0&&y.a.createElement(C.a,{value:!1}," \u5206\u73ED\u8865\u4EA4 "))),Ct!=null&&Ct.unified_late?y.a.createElement(y.a.Fragment,null,y.a.createElement(A.a,{align:"middle",className:"mt25 pl30"},y.a.createElement(l.a,null,"\u8865\u4EA4\u6263\u5206:"),y.a.createElement(l.a,{className:"ml5"},y.a.createElement(Te.b,{disabled:Et||nn,value:{type:Ct.penalty_type,inputValue:Ct.late_penalty},onChange:function(st){Gt(Object(D.a)(Object(D.a)({},Ct),{},{late_penalty:st.inputValue,penalty_type:st.type}))}})),y.a.createElement(l.a,{flex:"1",className:"ml5"},y.a.createElement("span",{className:"c-grey-c ml10"},Ct.penalty_type===Te.a.Number?"(\u8865\u4EA4\u65F6\u6309\u7167\u5B66\u751F\u603B\u6210\u7EE9\u6263\u5206)":"(\u5B66\u751F\u6210\u7EE9\u5C06\u6263\u9664\u8865\u4EA4\u5173\u5361\u5206\u503C\u7684\u767E\u5206\u6BD4)"))),y.a.createElement(A.a,{align:"middle",className:"mt25 pl30"},y.a.createElement(l.a,null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4:"),y.a.createElement(l.a,{className:"ml5"},y.a.createElement(_.a,{allowClear:!1,style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:R()(Object(Y.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:Et||nn,value:Ct.late_time?R()(Ct.late_time):"",disabledDate:function(st){return Ve(st,qe==null?void 0:qe.course_end_date)},onChange:function(st,bt){Ct.late_time=bt,Gt(Object.assign({},Ct))}})),y.a.createElement(l.a,null,y.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u201C\u5EF6\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)")))):lt.map(function(Ke,st){var bt;return y.a.createElement(l.a,{span:24,key:st},y.a.createElement(A.a,{className:"mt25"},y.a.createElement(l.a,{style:{marginLeft:30}},y.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219",st+1,"\uFF1A"),y.a.createElement(L.a,{disabled:Et||!(Mt!=null&&(bt=Mt.homework_status)!==null&&bt!==void 0&&bt.includes("\u672A\u53D1\u5E03"))&&Ke.id||(qe==null?void 0:qe.anonymous_comment),mode:"multiple",style:{width:306},value:typeof Ke.group_name=="string"?[Ke.group_name]:Ke.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function($t){lt[st].group_name=$t,lt[st].group_id=Ke.group_id,Ot(lt.slice())}},qe.group_settings&&qe.group_settings.map(function(Ft){var $t=lt.map(function(er){return er.group_name}).flat(),gn=fe.map(function(er){return er.group_name}).flat();if(Ct!=null&&Ct.unified_setting){if(!$t.includes(Ft.group_name))return y.a.createElement(oe,{value:Ft.group_name,key:Ft.id},Ft.group_name)}else if(gn.includes(Ft.group_name)&&(!$t.includes(Ft.group_name)&&R()(Ft.end_time)<=R()()))return y.a.createElement(oe,{value:Ft.group_name,key:Ft.id},Ft.group_name)}))),y.a.createElement(l.a,{className:"ml20"},y.a.createElement("span",null,"\u8865\u4EA4\u6263\u5206\uFF1A"),y.a.createElement(Te.b,{disabled:Et||qt(Ke.id),value:{type:Ke.penalty_type,inputValue:Ke.late_penalty},onChange:function($t){lt[st].late_penalty=$t.inputValue,lt[st].penalty_type=$t.type,Ot(Object(i.a)(lt))}})),y.a.createElement(l.a,{className:"ml20"},y.a.createElement("span",null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4\uFF1A"),y.a.createElement(_.a,{disabled:Et||qt(Ke.id),style:{width:200},showTime:{format:"HH:mm",defaultValue:R()(Object(Y.d)(),"HH:mm")},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",disabledDate:function($t){return Ve($t,qe==null?void 0:qe.course_end_date)},format:"YYYY-MM-DD HH:mm",value:Ke!=null&&Ke.late_time?R()(Ke.late_time):void 0,onChange:function($t,gn){lt[st].late_time=gn,Ot(Object(i.a)(lt))}})),!Et&&y.a.createElement(l.a,{className:"ml20"},st>0&&!Ke.id&&y.a.createElement(x.a,{onClick:function(){lt=lt.filter(function($t,gn){return st!==gn}),Ot(lt.slice()),setTimeout(function(){return Ot(lt.slice())},10)}}),y.a.createElement(O.a,{className:"c-green ml20",onClick:function(){Ot(lt.concat({penalty_type:Te.a.Percent,late_minus_score:20}))}}))))})),y.a.createElement(I.a,null),!Et&&y.a.createElement(l.a,{className:"mb50"},y.a.createElement(f.a,{type:"primary",size:"large",style:{marginTop:"40px"},loading:We,onClick:function(){return Rt()}},"\u63D0\u4EA4"),y.a.createElement(f.a,{type:"primary",size:"large",ghost:!0,className:"ml20",onClick:function(){It(!0),xt()}},"\u53D6\u6D88")))};ve.a=Object(Ce.a)(function(_e){var He=_e.shixunHomeworks,rt=_e.loading;return{shixunHomeworks:He,loading:rt.effects}})(Se)},fjLI:function(Bt,ve,T){"use strict";T.d(ve,"f",function(){return p}),T.d(ve,"b",function(){return l}),T.d(ve,"a",function(){return o}),T.d(ve,"d",function(){return s}),T.d(ve,"e",function(){return t}),T.d(ve,"c",function(){return u});var Z=T("8HAY"),V=T("Vhoy"),j=T("MI8n"),G=T("JYp7"),M=T("pmY6"),I=T("24hK"),W=T("nnTU"),C=T("T8No"),r=T("Cg/j"),A=T("t9D7"),v=function(a,i,D,w){var S=arguments.length,L=S<3?i:w===null?w=Object.getOwnPropertyDescriptor(i,D):w,P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(a,i,D,w);else for(var _=a.length-1;_>=0;_--)(P=a[_])&&(L=(S<3?P(L):S>3?P(i,D,L):P(i,D))||L);return S>3&&L&&Object.defineProperty(i,D,L),L},f=function(a,i){return function(D,w){i(D,w,a)}};function p(a){return a.command!==void 0}class l{constructor(a){this.id=l._idPool++,this._debugName=a}}l._idPool=0,l.CommandPalette=new l("CommandPalette"),l.EditorContext=new l("EditorContext"),l.SimpleEditorContext=new l("SimpleEditorContext"),l.EditorContextCopy=new l("EditorContextCopy"),l.EditorContextPeek=new l("EditorContextPeek"),l.MenubarEditMenu=new l("MenubarEditMenu"),l.MenubarCopy=new l("MenubarCopy"),l.MenubarGoMenu=new l("MenubarGoMenu"),l.MenubarSelectionMenu=new l("MenubarSelectionMenu"),l.InlineCompletionsActions=new l("InlineCompletionsActions");const o=Object(r.c)("menuService"),s=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new j.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:a=>a===l.CommandPalette}}addCommand(a){return this.addCommands(G.a.single(a))}addCommands(a){for(const i of a)this._commands.set(i.id,i);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(M.i)(()=>{let i=!1;for(const D of a)i=this._commands.delete(D.id)||i;i&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(a){return this._commands.get(a)}getCommands(){const a=new Map;return this._commands.forEach((i,D)=>a.set(D,i)),a}appendMenuItem(a,i){return this.appendMenuItems(G.a.single({id:a,item:i}))}appendMenuItems(a){const i=new Set,D=new I.a;for(const{id:w,item:S}of a){let L=this._menuItems.get(w);L||(L=new I.a,this._menuItems.set(w,L)),D.push(L.push(S)),i.add(w)}return this._onDidChangeMenu.fire(i),Object(M.i)(()=>{if(D.size>0){for(let w of D)w();this._onDidChangeMenu.fire(i),D.clear()}})}getMenuItems(a){let i;return this._menuItems.has(a)?i=[...this._menuItems.get(a)]:i=[],a===l.CommandPalette&&this._appendImplicitItems(i),i}_appendImplicitItems(a){const i=new Set;for(const D of a)p(D)&&(i.add(D.command.id),D.alt&&i.add(D.alt.id));this._commands.forEach((D,w)=>{i.has(w)||a.push({command:D})})}};class t extends Z.e{constructor(a,i,D,w){super(`submenuitem.${a.submenu.id}`,typeof a.title=="string"?a.title:a.title.value,[],"submenu");this.item=a,this._menuService=i,this._contextKeyService=D,this._options=w}get actions(){const a=[],i=this._menuService.createMenu(this.item.submenu,this._contextKeyService),D=i.getActions(this._options);i.dispose();for(const[,w]of D)w.length>0&&(a.push(...w),a.push(new Z.d));return a.length&&a.pop(),a}}let u=class a{constructor(i,D,w,S,L){var P,_;if(this._commandService=L,this.id=i.id,this.label=(w==null?void 0:w.renderShortTitle)&&i.shortTitle?typeof i.shortTitle=="string"?i.shortTitle:i.shortTitle.value:typeof i.title=="string"?i.title:i.title.value,this.tooltip=(_=typeof i.tooltip=="string"?i.tooltip:(P=i.tooltip)===null||P===void 0?void 0:P.value)!==null&&_!==void 0?_:"",this.enabled=!i.precondition||S.contextMatchesRules(i.precondition),this.checked=void 0,i.toggled){const b=i.toggled.condition?i.toggled:{condition:i.toggled};this.checked=S.contextMatchesRules(b.condition),this.checked&&b.tooltip&&(this.tooltip=typeof b.tooltip=="string"?b.tooltip:b.tooltip.value),b.title&&(this.label=typeof b.title=="string"?b.title:b.title.value)}this.item=i,this.alt=D?new a(D,void 0,w,S,L):void 0,this._options=w,A.d.isThemeIcon(i.icon)&&(this.class=V.a.asClassName(i.icon))}dispose(){}run(...i){var D,w;let S=[];return((D=this._options)===null||D===void 0?void 0:D.arg)&&(S=[...S,this._options.arg]),((w=this._options)===null||w===void 0?void 0:w.shouldForwardArgs)&&(S=[...S,...i]),this._commandService.executeCommand(this.id,...S)}};u=v([f(3,C.b),f(4,W.b)],u)},fyJ8:function(Bt,ve,T){"use strict";var Z=T("rePB"),V=T("VTBJ"),j=T("Ff2n"),G=T("U8pU"),M=T("q1tI"),I=T.n(M),W=T("TSYQ"),C=T.n(W),r=T("c+Xe"),A=T("sR1s");function v(s){return s&&Object(G.a)(s)==="object"&&!Array.isArray(s)&&!M.isValidElement(s)}function f(s){return typeof s=="string"?!0:Object(r.c)(s)}function p(s,t){var u,a=s.prefixCls,i=s.className,D=s.record,w=s.index,S=s.dataIndex,L=s.render,P=s.children,_=s.component,b=_===void 0?"td":_,g=s.colSpan,m=s.rowSpan,y=s.fixLeft,x=s.fixRight,O=s.firstFixLeft,H=s.lastFixLeft,F=s.firstFixRight,R=s.lastFixRight,U=s.appendNode,k=s.additionalProps,d=k===void 0?{}:k,z=s.ellipsis,Y=s.align,re=s.rowType,le=s.isSticky,Ne="".concat(a,"-cell"),Ce,Te;if(P)Te=P;else{var Fe=Object(A.b)(D,S);if(Te=Fe,L){var Ve=L(Fe,D,w);v(Ve)?(Te=Ve.children,Ce=Ve.props):Te=Ve}}Object(G.a)(Te)==="object"&&!Array.isArray(Te)&&!M.isValidElement(Te)&&(Te=null),z&&(H||F)&&(Te=M.createElement("span",{className:"".concat(Ne,"-content")},Te));var xe=Ce||{},ye=xe.colSpan,oe=xe.rowSpan,Se=xe.style,_e=xe.className,He=Object(j.a)(xe,["colSpan","rowSpan","style","className"]),rt=ye!==void 0?ye:g,ae=oe!==void 0?oe:m;if(rt===0||ae===0)return null;var $={},Q=typeof y=="number",te=typeof x=="number";Q&&($.position="sticky",$.left=y),te&&($.position="sticky",$.right=x);var he={};Y&&(he.textAlign=Y);var ge,we=z===!0?{showTitle:!0}:z;we&&(we.showTitle||re==="header")&&(typeof Te=="string"||typeof Te=="number"?ge=Te.toString():M.isValidElement(Te)&&typeof Te.props.children=="string"&&(ge=Te.props.children));var ft=Object(V.a)(Object(V.a)(Object(V.a)({title:ge},He),d),{},{colSpan:rt&&rt!==1?rt:null,rowSpan:ae&&ae!==1?ae:null,className:C()(Ne,i,(u={},Object(Z.a)(u,"".concat(Ne,"-fix-left"),Q),Object(Z.a)(u,"".concat(Ne,"-fix-left-first"),O),Object(Z.a)(u,"".concat(Ne,"-fix-left-last"),H),Object(Z.a)(u,"".concat(Ne,"-fix-right"),te),Object(Z.a)(u,"".concat(Ne,"-fix-right-first"),F),Object(Z.a)(u,"".concat(Ne,"-fix-right-last"),R),Object(Z.a)(u,"".concat(Ne,"-ellipsis"),z),Object(Z.a)(u,"".concat(Ne,"-with-append"),U),Object(Z.a)(u,"".concat(Ne,"-fix-sticky"),(Q||te)&&le),u),d.className,_e),style:Object(V.a)(Object(V.a)(Object(V.a)(Object(V.a)({},d.style),he),$),Se),ref:f(b)?t:null});return M.createElement(b,Object.assign({},ft),U,Te)}var l=M.forwardRef(p);l.displayName="Cell";var o=M.memo(l,function(s,t){return t.shouldCellUpdate?!t.shouldCellUpdate(t.record,s.record):!1});ve.a=o},h78n:function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return O});var Z=T("q1tI"),V=T.n(Z),j=T("TSYQ"),G=T.n(j),M={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},I=function(R){var U=R.map(function(){return Object(Z.useRef)()}),k=Object(Z.useRef)();return Object(Z.useEffect)(function(){var d=Date.now(),z=!1;Object.keys(U).forEach(function(Y){var re=U[Y].current;if(!re)return;z=!0;var le=re.style;le.transitionDuration=".3s, .3s, .3s, .06s",k.current&&d-k.current<100&&(le.transitionDuration="0s, 0s")}),z&&(k.current=Date.now())}),[U]};function W(){return W=Object.assign||function(F){for(var R=1;R<arguments.length;R++){var U=arguments[R];for(var k in U)Object.prototype.hasOwnProperty.call(U,k)&&(F[k]=U[k])}return F},W.apply(this,arguments)}function C(F,R){return p(F)||f(F,R)||A(F,R)||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(F,R){if(!F)return;if(typeof F=="string")return v(F,R);var U=Object.prototype.toString.call(F).slice(8,-1);if(U==="Object"&&F.constructor&&(U=F.constructor.name),U==="Map"||U==="Set")return Array.from(F);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return v(F,R)}function v(F,R){(R==null||R>F.length)&&(R=F.length);for(var U=0,k=new Array(R);U<R;U++)k[U]=F[U];return k}function f(F,R){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(F)))return;var U=[],k=!0,d=!1,z=void 0;try{for(var Y=F[Symbol.iterator](),re;!(k=(re=Y.next()).done)&&!(U.push(re.value),R&&U.length===R);k=!0);}catch(le){d=!0,z=le}finally{try{!k&&Y.return!=null&&Y.return()}finally{if(d)throw z}}return U}function p(F){if(Array.isArray(F))return F}function l(F,R){if(F==null)return{};var U=o(F,R),k,d;if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols(F);for(d=0;d<z.length;d++){if(k=z[d],R.indexOf(k)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(F,k))continue;U[k]=F[k]}}return U}function o(F,R){if(F==null)return{};var U={},k=Object.keys(F),d,z;for(z=0;z<k.length;z++){if(d=k[z],R.indexOf(d)>=0)continue;U[d]=F[d]}return U}var s=function(R){var U=R.className,k=R.percent,d=R.prefixCls,z=R.strokeColor,Y=R.strokeLinecap,re=R.strokeWidth,le=R.style,Ne=R.trailColor,Ce=R.trailWidth,Te=R.transition,Fe=l(R,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete Fe.gapPosition;var Ve=Array.isArray(k)?k:[k],xe=Array.isArray(z)?z:[z],ye=I(Ve),oe=C(ye,1),Se=oe[0],_e=re/2,He=100-re/2,rt="M ".concat(Y==="round"?_e:0,",").concat(_e,`
L `).concat(Y==="round"?He:100,",").concat(_e),ae="0 0 100 ".concat(re),$=0;return V.a.createElement("svg",W({className:G()("".concat(d,"-line"),U),viewBox:ae,preserveAspectRatio:"none",style:le},Fe),V.a.createElement("path",{className:"".concat(d,"-line-trail"),d:rt,strokeLinecap:Y,stroke:Ne,strokeWidth:Ce||re,fillOpacity:"0"}),Ve.map(function(Q,te){var he={strokeDasharray:"".concat(Q,"px, 100px"),strokeDashoffset:"-".concat($,"px"),transition:Te||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},ge=xe[te]||xe[xe.length-1];return $+=Q,V.a.createElement("path",{key:te,className:"".concat(d,"-line-path"),d:rt,strokeLinecap:Y,stroke:ge,strokeWidth:re,fillOpacity:"0",ref:Se[te],style:he})}))};s.defaultProps=M;var t=s;function u(){return u=Object.assign||function(F){for(var R=1;R<arguments.length;R++){var U=arguments[R];for(var k in U)Object.prototype.hasOwnProperty.call(U,k)&&(F[k]=U[k])}return F},u.apply(this,arguments)}function a(F,R){return L(F)||S(F,R)||D(F,R)||i()}function i(){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 D(F,R){if(!F)return;if(typeof F=="string")return w(F,R);var U=Object.prototype.toString.call(F).slice(8,-1);if(U==="Object"&&F.constructor&&(U=F.constructor.name),U==="Map"||U==="Set")return Array.from(F);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return w(F,R)}function w(F,R){(R==null||R>F.length)&&(R=F.length);for(var U=0,k=new Array(R);U<R;U++)k[U]=F[U];return k}function S(F,R){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(F)))return;var U=[],k=!0,d=!1,z=void 0;try{for(var Y=F[Symbol.iterator](),re;!(k=(re=Y.next()).done)&&!(U.push(re.value),R&&U.length===R);k=!0);}catch(le){d=!0,z=le}finally{try{!k&&Y.return!=null&&Y.return()}finally{if(d)throw z}}return U}function L(F){if(Array.isArray(F))return F}function P(F,R){if(F==null)return{};var U=_(F,R),k,d;if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols(F);for(d=0;d<z.length;d++){if(k=z[d],R.indexOf(k)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(F,k))continue;U[k]=F[k]}}return U}function _(F,R){if(F==null)return{};var U={},k=Object.keys(F),d,z;for(z=0;z<k.length;z++){if(d=k[z],R.indexOf(d)>=0)continue;U[d]=F[d]}return U}var b=0;function g(F){return+F.replace("%","")}function m(F){return Array.isArray(F)?F:[F]}function y(F,R,U,k){var d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,z=arguments.length>5?arguments[5]:void 0,Y=50-k/2,re=0,le=-Y,Ne=0,Ce=-2*Y;switch(z){case"left":re=-Y,le=0,Ne=2*Y,Ce=0;break;case"right":re=Y,le=0,Ne=-2*Y,Ce=0;break;case"bottom":le=Y,Ce=2*Y;break;default:}var Te="M 50,50 m ".concat(re,",").concat(le,`
a `).concat(Y,",").concat(Y," 0 1 1 ").concat(Ne,",").concat(-Ce,`
a `).concat(Y,",").concat(Y," 0 1 1 ").concat(-Ne,",").concat(Ce),Fe=Math.PI*2*Y,Ve={stroke:U,strokeDasharray:"".concat(R/100*(Fe-d),"px ").concat(Fe,"px"),strokeDashoffset:"-".concat(d/2+F/100*(Fe-d),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Te,pathStyle:Ve}}var x=function(R){var U=R.prefixCls,k=R.strokeWidth,d=R.trailWidth,z=R.gapDegree,Y=R.gapPosition,re=R.trailColor,le=R.strokeLinecap,Ne=R.style,Ce=R.className,Te=R.strokeColor,Fe=R.percent,Ve=P(R,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),xe=Object(Z.useMemo)(function(){return b+=1,b},[]),ye=y(0,100,re,k,z,Y),oe=ye.pathString,Se=ye.pathStyle,_e=m(Fe),He=m(Te),rt=He.find(function(he){return Object.prototype.toString.call(he)==="[object Object]"}),ae=I(_e),$=a(ae,1),Q=$[0],te=function(){var ge=0;return _e.map(function(we,ft){var Pt=He[ft]||He[He.length-1],jt=Object.prototype.toString.call(Pt)==="[object Object]"?"url(#".concat(U,"-gradient-").concat(xe,")"):"",qe=y(ge,we,Pt,k,z,Y);return ge+=we,V.a.createElement("path",{key:ft,className:"".concat(U,"-circle-path"),d:qe.pathString,stroke:jt,strokeLinecap:le,strokeWidth:k,opacity:we===0?0:1,fillOpacity:"0",style:qe.pathStyle,ref:Q[ft]})})};return V.a.createElement("svg",u({className:G()("".concat(U,"-circle"),Ce),viewBox:"0 0 100 100",style:Ne},Ve),rt&&V.a.createElement("defs",null,V.a.createElement("linearGradient",{id:"".concat(U,"-gradient-").concat(xe),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(rt).sort(function(he,ge){return g(he)-g(ge)}).map(function(he,ge){return V.a.createElement("stop",{key:ge,offset:he,stopColor:rt[he]})}))),V.a.createElement("path",{className:"".concat(U,"-circle-trail"),d:oe,stroke:re,strokeLinecap:le,strokeWidth:d||k,fillOpacity:"0",style:Se}),te().reverse())};x.defaultProps=M;var O=x,H={Line:t,Circle:O}},hW8S:function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return G}),T.d(ve,"c",function(){return M}),T.d(ve,"b",function(){return I});var Z=T("VTBJ"),V=T("Ff2n"),j=T("Kwbf"),G="RC_TABLE_INTERNAL_COL_DEFINE";function M(W){var C=W.expandable,r=Object(V.a)(W,["expandable"]);return"expandable"in W?Object(Z.a)(Object(Z.a)({},r),C):r}function I(W){return Object.keys(W).reduce(function(C,r){return(r.substr(0,5)==="data-"||r.substr(0,5)==="aria-")&&(C[r]=W[r]),C},{})}},ic2d:function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return G});var Z=T("FWmy"),V=T("746U");class j{constructor(){this.data=new Map}add(M,I){Z.a(V.l(M)),Z.a(V.k(I)),Z.a(!this.data.has(M),"There is already an extension with this id"),this.data.set(M,I)}as(M){return this.data.get(M)||null}}const G=new j},k3GJ:function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return Gr});var Z=T("rePB"),V=T("ODXe"),j=T("Ff2n"),G=T("VTBJ"),M=T("q1tI"),I=T("TSYQ"),W=T.n(I),C=T("Zm9Q"),r=T("6cGi"),A=T("KQm4"),v=T("xEkU"),f=T.n(v),p=T("t23M");function l(Me){var tt=Object(M.useRef)(),ot=Object(M.useRef)(!1);function je(){for(var ce=arguments.length,Oe=new Array(ce),me=0;me<ce;me++)Oe[me]=arguments[me];ot.current||(f.a.cancel(tt.current),tt.current=f()(function(){Me.apply(void 0,Oe)}))}return Object(M.useEffect)(function(){return function(){ot.current=!0,f.a.cancel(tt.current)}},[]),je}function o(Me){var tt=Object(M.useRef)([]),ot=Object(M.useState)({}),je=Object(V.a)(ot,2),ce=je[1],Oe=Object(M.useRef)(typeof Me=="function"?Me():Me),me=l(function(){var Ge=Oe.current;tt.current.forEach(function(ut){Ge=ut(Ge)}),tt.current=[],Oe.current=Ge,ce({})});function ke(Ge){tt.current.push(Ge),me()}return[Oe.current,ke]}var s=T("4IlW");function t(Me,tt){var ot,je=Me.prefixCls,ce=Me.id,Oe=Me.active,me=Me.rtl,ke=Me.tab,Ge=ke.key,ut=ke.tab,Je=ke.disabled,pt=ke.closeIcon,Nt=Me.tabBarGutter,tn=Me.tabPosition,fn=Me.closable,Tn=Me.renderWrapper,Kn=Me.removeAriaLabel,fr=Me.editable,lr=Me.onClick,yr=Me.onRemove,br=Me.onFocus,vr="".concat(je,"-tab");M.useEffect(function(){return yr},[]);var Er={};tn==="top"||tn==="bottom"?Er[me?"marginLeft":"marginRight"]=Nt:Er.marginBottom=Nt;var Rr=fr&&fn!==!1&&!Je;function hr(pn){if(Je)return;lr(pn)}function Nr(pn){pn.preventDefault(),pn.stopPropagation(),fr.onEdit("remove",{key:Ge,event:pn})}var or=M.createElement("div",{key:Ge,ref:tt,className:W()(vr,(ot={},Object(Z.a)(ot,"".concat(vr,"-with-remove"),Rr),Object(Z.a)(ot,"".concat(vr,"-active"),Oe),Object(Z.a)(ot,"".concat(vr,"-disabled"),Je),ot)),style:Er,onClick:hr},M.createElement("div",{role:"tab","aria-selected":Oe,id:ce&&"".concat(ce,"-tab-").concat(Ge),className:"".concat(vr,"-btn"),"aria-controls":ce&&"".concat(ce,"-panel-").concat(Ge),"aria-disabled":Je,tabIndex:Je?null:0,onClick:function(Ln){Ln.stopPropagation(),hr(Ln)},onKeyDown:function(Ln){[s.a.SPACE,s.a.ENTER].includes(Ln.which)&&(Ln.preventDefault(),hr(Ln))},onFocus:br},ut),Rr&&M.createElement("button",{type:"button","aria-label":Kn||"remove",tabIndex:0,className:"".concat(vr,"-remove"),onClick:function(Ln){Ln.stopPropagation(),Nr(Ln)}},pt||fr.removeIcon||"\xD7"));return Tn&&(or=Tn(or)),or}var u=M.forwardRef(t),a={width:0,height:0,left:0,top:0};function i(Me,tt,ot){return Object(M.useMemo)(function(){for(var je,ce=new Map,Oe=tt.get((je=Me[0])===null||je===void 0?void 0:je.key)||a,me=Oe.left+Oe.width,ke=0;ke<Me.length;ke+=1){var Ge=Me[ke].key,ut=tt.get(Ge);if(!ut){var Je;ut=tt.get((Je=Me[ke-1])===null||Je===void 0?void 0:Je.key)||a}var pt=ce.get(Ge)||Object(G.a)({},ut);pt.right=me-pt.left-pt.width,ce.set(Ge,pt)}return ce},[Me.map(function(je){return je.key}).join("_"),tt,ot])}var D={width:0,height:0,left:0,top:0,right:0};function w(Me,tt,ot,je,ce){var Oe=ce.tabs,me=ce.tabPosition,ke=ce.rtl,Ge,ut,Je;["top","bottom"].includes(me)?(Ge="width",ut=ke?"right":"left",Je=Math.abs(tt.left)):(Ge="height",ut="top",Je=-tt.top);var pt=tt[Ge],Nt=ot[Ge],tn=je[Ge],fn=pt;return Nt+tn>pt&&(fn=pt-tn),Object(M.useMemo)(function(){if(!Oe.length)return[0,0];for(var Tn=Oe.length,Kn=Tn,fr=0;fr<Tn;fr+=1){var lr=Me.get(Oe[fr].key)||D;if(lr[ut]+lr[Ge]>Je+fn){Kn=fr-1;break}}for(var yr=0,br=Tn-1;br>=0;br-=1){var vr=Me.get(Oe[br].key)||D;if(vr[ut]<Je){yr=br+1;break}}return[yr,Kn]},[Me,Je,fn,me,Oe.map(function(Tn){return Tn.key}).join("_"),ke])}var S=T("wx14"),L=T("1OyB"),P=T("vuIU"),_=T("JX7q"),b=T("Ji7U"),g=T("LK+K"),m=T("I8Z2"),y=T("bT9E"),x=T("2GS6"),O=T("Gytx"),H=T.n(O),F=T("U8pU"),R=/iPhone/i,U=/iPod/i,k=/iPad/i,d=/\bAndroid(?:.+)Mobile\b/i,z=/Android/i,Y=/\bAndroid(?:.+)SD4930UR\b/i,re=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,le=/Windows Phone/i,Ne=/\bWindows(?:.+)ARM\b/i,Ce=/BlackBerry/i,Te=/BB10/i,Fe=/Opera Mini/i,Ve=/\b(CriOS|Chrome)(?:.+)Mobile/i,xe=/Mobile(?:.+)Firefox\b/i;function ye(Me,tt){return Me.test(tt)}function oe(Me){var tt=Me||(typeof navigator!="undefined"?navigator.userAgent:""),ot=(tt||"").split("[FBAN");if(typeof ot[1]!="undefined"){var je=ot,ce=Object(V.a)(je,1);tt=ce[0]}if(ot=tt.split("Twitter"),typeof ot[1]!="undefined"){var Oe=ot,me=Object(V.a)(Oe,1);tt=me[0]}var ke={apple:{phone:ye(R,tt)&&!ye(le,tt),ipod:ye(U,tt),tablet:!ye(R,tt)&&ye(k,tt)&&!ye(le,tt),device:(ye(R,tt)||ye(U,tt)||ye(k,tt))&&!ye(le,tt)},amazon:{phone:ye(Y,tt),tablet:!ye(Y,tt)&&ye(re,tt),device:ye(Y,tt)||ye(re,tt)},android:{phone:!ye(le,tt)&&ye(Y,tt)||!ye(le,tt)&&ye(d,tt),tablet:!ye(le,tt)&&!ye(Y,tt)&&!ye(d,tt)&&(ye(re,tt)||ye(z,tt)),device:!ye(le,tt)&&(ye(Y,tt)||ye(re,tt)||ye(d,tt)||ye(z,tt))||ye(/\bokhttp\b/i,tt)},windows:{phone:ye(le,tt),tablet:ye(Ne,tt),device:ye(le,tt)||ye(Ne,tt)},other:{blackberry:ye(Ce,tt),blackberry10:ye(Te,tt),opera:ye(Fe,tt),firefox:ye(xe,tt),chrome:ye(Ve,tt),device:ye(Ce,tt)||ye(Te,tt)||ye(Fe,tt)||ye(xe,tt)||ye(Ve,tt)},any:null,phone:null,tablet:null};return ke.any=ke.apple.device||ke.android.device||ke.windows.device||ke.other.device,ke.phone=ke.apple.phone||ke.android.phone||ke.windows.phone,ke.tablet=ke.apple.tablet||ke.android.tablet||ke.windows.tablet,ke}var Se=Object(G.a)(Object(G.a)({},oe()),{},{isMobile:oe}),_e=Se;function He(){}function rt(Me,tt,ot){var je=tt||"";return Me.key||"".concat(je,"item_").concat(ot)}function ae(Me){return"".concat(Me,"-menu-")}function $(Me,tt){var ot=-1;M.Children.forEach(Me,function(je){ot+=1,je&&je.type&&je.type.isMenuItemGroup?M.Children.forEach(je.props.children,function(ce){ot+=1,tt(ce,ot)}):tt(je,ot)})}function Q(Me,tt,ot){if(!Me||ot.find)return;M.Children.forEach(Me,function(je){if(je){var ce=je.type;if(!ce||!(ce.isSubMenu||ce.isMenuItem||ce.isMenuItemGroup))return;tt.indexOf(je.key)!==-1?ot.find=!0:je.props.children&&Q(je.props.children,tt,ot)}})}var te=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],he=function(tt){var ot=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,je=tt&&typeof tt.getBoundingClientRect=="function"&&tt.getBoundingClientRect().width;if(je){if(ot){var ce=getComputedStyle(tt),Oe=ce.marginLeft,me=ce.marginRight;je+=+Oe.replace("px","")+ +me.replace("px","")}je=+je.toFixed(6)}return je||0},ge=function(tt,ot,je){tt&&Object(F.a)(tt.style)==="object"&&(tt.style[ot]=je)},we=function(){return _e.any},ft=T("bdgK"),Pt=T("i8i4"),jt=T.n(Pt),qe=T("wgJM"),Mt=T("l4aY"),sn=T("m+aA"),at=T("c+Xe"),Qe=T("zT1h"),Et=T("QC+M");function It(Me,tt,ot){return ot?Me[0]===tt[0]:Me[0]===tt[0]&&Me[1]===tt[1]}function dt(Me,tt,ot){var je=Me[tt]||{};return Object(G.a)(Object(G.a)({},je),ot)}function mt(Me,tt,ot,je){for(var ce=ot.points,Oe=Object.keys(Me),me=0;me<Oe.length;me+=1){var ke=Oe[me];if(It(Me[ke].points,ce,je))return"".concat(tt,"-placement-").concat(ke)}return""}var We=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Me=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Me)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Me==null?void 0:Me.substr(0,4)))},De=T("MNnm");function Le(Me,tt){var ot={};return ot[Me.toLowerCase()]=tt.toLowerCase(),ot["Webkit".concat(Me)]="webkit".concat(tt),ot["Moz".concat(Me)]="moz".concat(tt),ot["ms".concat(Me)]="MS".concat(tt),ot["O".concat(Me)]="o".concat(tt.toLowerCase()),ot}function de(Me,tt){var ot={animationend:Le("Animation","AnimationEnd"),transitionend:Le("Transition","TransitionEnd")};return Me&&("AnimationEvent"in tt||delete ot.animationend.animation,"TransitionEvent"in tt||delete ot.transitionend.transition),ot}var fe=de(Object(De.a)(),typeof window!="undefined"?window:{}),Ee={};if(Object(De.a)()){var Pe=document.createElement("div");Ee=Pe.style}var Ue={};function lt(Me){if(Ue[Me])return Ue[Me];var tt=fe[Me];if(tt)for(var ot=Object.keys(tt),je=ot.length,ce=0;ce<je;ce+=1){var Oe=ot[ce];if(Object.prototype.hasOwnProperty.call(tt,Oe)&&Oe in Ee)return Ue[Me]=tt[Oe],Ue[Me]}return""}var Ot=lt("animationend"),cn=lt("transitionend"),An=!!(Ot&&cn),Ct=Ot||"animationend",Gt=cn||"transitionend";function xt(Me,tt){if(!Me)return null;if(Object(F.a)(Me)==="object"){var ot=tt.replace(/-\w/g,function(je){return je[1].toUpperCase()});return Me[ot]}return"".concat(Me,"-").concat(tt)}var Rt="none",gt="appear",be="enter",Ie="leave",Dt="none",ht="prepare",nn="start",qt="active",Ke="end";function st(Me){var tt=Object(M.useRef)(!1),ot=Object(M.useState)(Me),je=Object(V.a)(ot,2),ce=je[0],Oe=je[1];function me(ke){tt.current||Oe(ke)}return Object(M.useEffect)(function(){return function(){tt.current=!0}},[]),[ce,me]}var bt=Object(De.a)()?M.useLayoutEffect:M.useEffect,Ft=bt,$t=function(){var Me=M.useRef(null);function tt(){qe.a.cancel(Me.current)}function ot(je){var ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;tt();var Oe=Object(qe.a)(function(){ce<=1?je({isCanceled:function(){return Oe!==Me.current}}):ot(je,ce-1)});Me.current=Oe}return M.useEffect(function(){return function(){tt()}},[]),[ot,tt]},gn=[ht,nn,qt,Ke],er=!1,Hn=!0;function yn(Me){return Me===qt||Me===Ke}var Sr=function(Me,tt){var ot=M.useState(Dt),je=Object(V.a)(ot,2),ce=je[0],Oe=je[1],me=$t(),ke=Object(V.a)(me,2),Ge=ke[0],ut=ke[1];function Je(){Oe(ht)}return Ft(function(){if(ce!==Dt&&ce!==Ke){var pt=gn.indexOf(ce),Nt=gn[pt+1],tn=tt(ce);tn===er?Oe(Nt):Ge(function(fn){function Tn(){if(fn.isCanceled())return;Oe(Nt)}tn===!0?Tn():Promise.resolve(tn).then(Tn)})}},[Me,ce]),M.useEffect(function(){return function(){ut()}},[]),[Je,ce]},_r=function(Me){var tt=Object(M.useRef)(),ot=Object(M.useRef)(Me);ot.current=Me;var je=M.useCallback(function(me){ot.current(me)},[]);function ce(me){me&&(me.removeEventListener(Gt,je),me.removeEventListener(Ct,je))}function Oe(me){tt.current&&tt.current!==me&&ce(tt.current),me&&me!==tt.current&&(me.addEventListener(Gt,je),me.addEventListener(Ct,je),tt.current=me)}return M.useEffect(function(){return function(){ce(tt.current)}},[]),[Oe,ce]};function ar(Me,tt,ot,je){var ce=je.motionEnter,Oe=ce===void 0?!0:ce,me=je.motionAppear,ke=me===void 0?!0:me,Ge=je.motionLeave,ut=Ge===void 0?!0:Ge,Je=je.motionDeadline,pt=je.motionLeaveImmediately,Nt=je.onAppearPrepare,tn=je.onEnterPrepare,fn=je.onLeavePrepare,Tn=je.onAppearStart,Kn=je.onEnterStart,fr=je.onLeaveStart,lr=je.onAppearActive,yr=je.onEnterActive,br=je.onLeaveActive,vr=je.onAppearEnd,Er=je.onEnterEnd,Rr=je.onLeaveEnd,hr=je.onVisibleChanged,Nr=st(),or=Object(V.a)(Nr,2),pn=or[0],Ln=or[1],xr=st(Rt),Dr=Object(V.a)(xr,2),Qn=Dr[0],Ar=Dr[1],qr=st(null),Lr=Object(V.a)(qr,2),Ur=Lr[0],Wr=Lr[1],Br=Object(M.useRef)(!1),Ir=Object(M.useRef)(null),pr=Object(M.useRef)(!1),na=Object(M.useRef)(null);function ni(){var Jr=ot();return Jr||na.current}var La=Object(M.useRef)(!1);function ya(Jr){var jr=ni();if(Jr&&!Jr.deadline&&Jr.target!==jr)return;var Ea;Qn===gt&&La.current?Ea=vr==null?void 0:vr(jr,Jr):Qn===be&&La.current?Ea=Er==null?void 0:Er(jr,Jr):Qn===Ie&&La.current&&(Ea=Rr==null?void 0:Rr(jr,Jr)),Ea!==!1&&!pr.current&&(Ar(Rt),Wr(null))}var ea=_r(ya),Vr=Object(V.a)(ea,1),Yr=Vr[0],ia=M.useMemo(function(){var Jr,jr,Ea;switch(Qn){case"appear":return Jr={},Object(Z.a)(Jr,ht,Nt),Object(Z.a)(Jr,nn,Tn),Object(Z.a)(Jr,qt,lr),Jr;case"enter":return jr={},Object(Z.a)(jr,ht,tn),Object(Z.a)(jr,nn,Kn),Object(Z.a)(jr,qt,yr),jr;case"leave":return Ea={},Object(Z.a)(Ea,ht,fn),Object(Z.a)(Ea,nn,fr),Object(Z.a)(Ea,qt,br),Ea;default:return{}}},[Qn]),Ha=Sr(Qn,function(Jr){if(Jr===ht){var jr=ia[ht];return jr?jr(ni()):er}if(Hr in ia){var Ea;Wr(((Ea=ia[Hr])===null||Ea===void 0?void 0:Ea.call(ia,ni(),null))||null)}return Hr===qt&&(Yr(ni()),Je>0&&(clearTimeout(Ir.current),Ir.current=setTimeout(function(){ya({deadline:!0})},Je))),Hn}),mi=Object(V.a)(Ha,2),si=mi[0],Hr=mi[1],Va=yn(Hr);La.current=Va,Ft(function(){Ln(tt);var Jr=Br.current;if(Br.current=!0,!Me)return;var jr;!Jr&&tt&&ke&&(jr=gt),Jr&&tt&&Oe&&(jr=be),(Jr&&!tt&&ut||!Jr&&pt&&!tt&&ut)&&(jr=Ie),jr&&(Ar(jr),si())},[tt]),Object(M.useEffect)(function(){(Qn===gt&&!ke||Qn===be&&!Oe||Qn===Ie&&!ut)&&Ar(Rt)},[ke,Oe,ut]),Object(M.useEffect)(function(){return function(){clearTimeout(Ir.current),pr.current=!0}},[]),Object(M.useEffect)(function(){pn!==void 0&&Qn===Rt&&(hr==null||hr(pn))},[pn,Qn]);var ri=Ur;return ia[ht]&&Hr===nn&&(ri=Object(G.a)({transition:"none"},ri)),[Qn,Hr,ri,pn!=null?pn:tt]}var cr=function(Me){Object(b.a)(ot,Me);var tt=Object(g.a)(ot);function ot(){return Object(L.a)(this,ot),tt.apply(this,arguments)}return Object(P.a)(ot,[{key:"render",value:function(){return this.props.children}}]),ot}(M.Component),Pr=cr;function Qr(Me){var tt=Me;Object(F.a)(Me)==="object"&&(tt=Me.transitionSupport);function ot(ce){return!!(ce.motionName&&tt)}var je=M.forwardRef(function(ce,Oe){var me=ce.visible,ke=me===void 0?!0:me,Ge=ce.removeOnLeave,ut=Ge===void 0?!0:Ge,Je=ce.forceRender,pt=ce.children,Nt=ce.motionName,tn=ce.leavedClassName,fn=ce.eventProps,Tn=ot(ce),Kn=Object(M.useRef)(),fr=Object(M.useRef)();function lr(){try{return Object(sn.a)(Kn.current||fr.current)}catch(Ar){return null}}var yr=ar(Tn,ke,lr,ce),br=Object(V.a)(yr,4),vr=br[0],Er=br[1],Rr=br[2],hr=br[3],Nr=M.useRef(hr);hr&&(Nr.current=!0);var or=Object(M.useRef)(Oe);or.current=Oe;var pn=M.useCallback(function(Ar){Kn.current=Ar,Object(at.b)(or.current,Ar)},[]),Ln,xr=Object(G.a)(Object(G.a)({},fn),{},{visible:ke});if(!pt)Ln=null;else if(vr===Rt||!ot(ce))hr?Ln=pt(Object(G.a)({},xr),pn):!ut&&Nr.current?Ln=pt(Object(G.a)(Object(G.a)({},xr),{},{className:tn}),pn):Je?Ln=pt(Object(G.a)(Object(G.a)({},xr),{},{style:{display:"none"}}),pn):Ln=null;else{var Dr,Qn;Er===ht?Qn="prepare":yn(Er)?Qn="active":Er===nn&&(Qn="start"),Ln=pt(Object(G.a)(Object(G.a)({},xr),{},{className:W()(xt(Nt,vr),(Dr={},Object(Z.a)(Dr,xt(Nt,"".concat(vr,"-").concat(Qn)),Qn),Object(Z.a)(Dr,Nt,typeof Nt=="string"),Dr)),style:Rr}),pn)}return M.createElement(Pr,{ref:fr},Ln)});return je.displayName="CSSMotion",je}var ca=Qr(An),hn="add",ir="keep",va="remove",Pa="removed";function sa(Me){var tt;return Me&&Object(F.a)(Me)==="object"&&"key"in Me?tt=Me:tt={key:Me},Object(G.a)(Object(G.a)({},tt),{},{key:String(tt.key)})}function la(){var Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Me.map(sa)}function ee(){var Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],ot=[],je=0,ce=tt.length,Oe=la(Me),me=la(tt);Oe.forEach(function(ut){for(var Je=!1,pt=je;pt<ce;pt+=1){var Nt=me[pt];if(Nt.key===ut.key){je<pt&&(ot=ot.concat(me.slice(je,pt).map(function(tn){return Object(G.a)(Object(G.a)({},tn),{},{status:hn})})),je=pt),ot.push(Object(G.a)(Object(G.a)({},Nt),{},{status:ir})),je+=1,Je=!0;break}}Je||ot.push(Object(G.a)(Object(G.a)({},ut),{},{status:va}))}),je<ce&&(ot=ot.concat(me.slice(je).map(function(ut){return Object(G.a)(Object(G.a)({},ut),{},{status:hn})})));var ke={};ot.forEach(function(ut){var Je=ut.key;ke[Je]=(ke[Je]||0)+1});var Ge=Object.keys(ke).filter(function(ut){return ke[ut]>1});return Ge.forEach(function(ut){ot=ot.filter(function(Je){var pt=Je.key,Nt=Je.status;return pt!==ut||Nt!==va}),ot.forEach(function(Je){Je.key===ut&&(Je.status=ir)})}),ot}var N=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function B(Me){var tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ca,ot=function(je){Object(b.a)(Oe,je);var ce=Object(g.a)(Oe);function Oe(){var me;return Object(L.a)(this,Oe),me=ce.apply(this,arguments),me.state={keyEntities:[]},me.removeKey=function(ke){me.setState(function(Ge){var ut=Ge.keyEntities;return{keyEntities:ut.map(function(Je){return Je.key!==ke?Je:Object(G.a)(Object(G.a)({},Je),{},{status:Pa})})}})},me}return Object(P.a)(Oe,[{key:"render",value:function(){var ke=this,Ge=this.state.keyEntities,ut=this.props,Je=ut.component,pt=ut.children,Nt=ut.onVisibleChanged,tn=Object(j.a)(ut,["component","children","onVisibleChanged"]),fn=Je||M.Fragment,Tn={};return N.forEach(function(Kn){Tn[Kn]=tn[Kn],delete tn[Kn]}),delete tn.keys,M.createElement(fn,tn,Ge.map(function(Kn){var fr=Kn.status,lr=Object(j.a)(Kn,["status"]),yr=fr===hn||fr===ir;return M.createElement(tt,Object(S.a)({},Tn,{key:lr.key,visible:yr,eventProps:lr,onVisibleChanged:function(vr){Nt==null||Nt(vr,{key:lr.key}),vr||ke.removeKey(lr.key)}}),pt)}))}}],[{key:"getDerivedStateFromProps",value:function(ke,Ge){var ut=ke.keys,Je=Ge.keyEntities,pt=la(ut),Nt=ee(Je,pt);return{keyEntities:Nt.filter(function(tn){var fn=Je.find(function(Tn){var Kn=Tn.key;return tn.key===Kn});return!(fn&&fn.status===Pa&&tn.status===va)})}}}]),Oe}(M.Component);return ot.defaultProps={component:"div"},ot}var X=B(An),ue=ca;function q(Me){var tt=Me.prefixCls,ot=Me.motion,je=Me.animation,ce=Me.transitionName;return ot||(je?{motionName:"".concat(tt,"-").concat(je)}:ce?{motionName:ce}:null)}function Ze(Me){var tt=Me.prefixCls,ot=Me.visible,je=Me.zIndex,ce=Me.mask,Oe=Me.maskMotion,me=Me.maskAnimation,ke=Me.maskTransitionName;if(!ce)return null;var Ge={};return(Oe||ke||me)&&(Ge=Object(G.a)({motionAppear:!0},q({motion:Oe,prefixCls:tt,transitionName:ke,animation:me}))),M.createElement(ue,Object(S.a)({},Ge,{visible:ot,removeOnLeave:!0}),function(ut){var Je=ut.className;return M.createElement("div",{style:{zIndex:je},className:W()("".concat(tt,"-mask"),Je)})})}var Jt=T("9mu1"),On=T("o0o1"),Xn=T.n(On),un=T("HaE+"),nr=["measure","align",null,"motion"],mr=function(Me,tt){var ot=Object(M.useState)(null),je=Object(V.a)(ot,2),ce=je[0],Oe=je[1],me=Object(M.useRef)(),ke=Object(M.useRef)(!1);function Ge(pt){ke.current||Oe(pt)}function ut(){qe.a.cancel(me.current)}function Je(pt){ut(),me.current=Object(qe.a)(function(){Ge(function(Nt){switch(ce){case"align":return"motion";case"motion":return"stable";default:}return Nt}),pt==null||pt()})}return Object(M.useEffect)(function(){Ge("measure")},[Me]),Object(M.useEffect)(function(){switch(ce){case"measure":tt();break;default:}ce&&(me.current=Object(qe.a)(Object(un.a)(Xn.a.mark(function pt(){var Nt,tn;return Xn.a.wrap(function(Tn){for(;;)switch(Tn.prev=Tn.next){case 0:Nt=nr.indexOf(ce),tn=nr[Nt+1],tn&&Nt!==-1&&Ge(tn);case 3:case"end":return Tn.stop()}},pt)}))))},[ce]),Object(M.useEffect)(function(){return function(){ke.current=!0,ut()}},[]),[ce,Je]},Kr=function(Me){var tt=M.useState({width:0,height:0}),ot=Object(V.a)(tt,2),je=ot[0],ce=ot[1];function Oe(ke){ce({width:ke.offsetWidth,height:ke.offsetHeight})}var me=M.useMemo(function(){var ke={};if(Me){var Ge=je.width,ut=je.height;Me.indexOf("height")!==-1&&ut?ke.height=ut:Me.indexOf("minHeight")!==-1&&ut&&(ke.minHeight=ut),Me.indexOf("width")!==-1&&Ge?ke.width=Ge:Me.indexOf("minWidth")!==-1&&Ge&&(ke.minWidth=Ge)}return ke},[Me,je]);return[me,Oe]},ma=M.forwardRef(function(Me,tt){var ot=Me.visible,je=Me.prefixCls,ce=Me.className,Oe=Me.style,me=Me.children,ke=Me.zIndex,Ge=Me.stretch,ut=Me.destroyPopupOnHide,Je=Me.forceRender,pt=Me.align,Nt=Me.point,tn=Me.getRootDomNode,fn=Me.getClassNameFromAlign,Tn=Me.onAlign,Kn=Me.onMouseEnter,fr=Me.onMouseLeave,lr=Me.onMouseDown,yr=Me.onTouchStart,br=Object(M.useRef)(),vr=Object(M.useRef)(),Er=Object(M.useState)(),Rr=Object(V.a)(Er,2),hr=Rr[0],Nr=Rr[1],or=Kr(Ge),pn=Object(V.a)(or,2),Ln=pn[0],xr=pn[1];function Dr(){Ge&&xr(tn())}var Qn=mr(ot,Dr),Ar=Object(V.a)(Qn,2),qr=Ar[0],Lr=Ar[1],Ur=Object(M.useRef)();function Wr(){return Nt||tn}function Br(){var ea;(ea=br.current)===null||ea===void 0||ea.forceAlign()}function Ir(ea,Vr){var Yr=fn(Vr);hr!==Yr&&Nr(Yr),qr==="align"&&(hr!==Yr?Promise.resolve().then(function(){Br()}):Lr(function(){var ia;(ia=Ur.current)===null||ia===void 0||ia.call(Ur)}),Tn==null||Tn(ea,Vr))}var pr=Object(G.a)({},q(Me));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(ea){var Vr=pr[ea];pr[ea]=function(Yr,ia){return Lr(),Vr==null?void 0:Vr(Yr,ia)}});function na(){return new Promise(function(ea){Ur.current=ea})}M.useEffect(function(){!pr.motionName&&qr==="motion"&&Lr()},[pr.motionName,qr]),M.useImperativeHandle(tt,function(){return{forceAlign:Br,getElement:function(){return vr.current}}});var ni=Object(G.a)(Object(G.a)({},Ln),{},{zIndex:ke,opacity:qr==="motion"||qr==="stable"||!ot?void 0:0,pointerEvents:qr==="stable"?void 0:"none"},Oe),La=!0;(pt==null?void 0:pt.points)&&(qr==="align"||qr==="stable")&&(La=!1);var ya=me;return M.Children.count(me)>1&&(ya=M.createElement("div",{className:"".concat(je,"-content")},me)),M.createElement(ue,Object(S.a)({visible:ot,ref:vr,leavedClassName:"".concat(je,"-hidden")},pr,{onAppearPrepare:na,onEnterPrepare:na,removeOnLeave:ut,forceRender:Je}),function(ea,Vr){var Yr=ea.className,ia=ea.style,Ha=W()(je,ce,hr,Yr);return M.createElement(Jt.a,{target:Wr(),key:"popup",ref:br,monitorWindowResize:!0,disabled:La,align:pt,onAlign:Ir},M.createElement("div",{ref:Vr,className:Ha,onMouseEnter:Kn,onMouseLeave:fr,onMouseDownCapture:lr,onTouchStartCapture:yr,style:Object(G.a)(Object(G.a)({},ia),ni)},ya))})});ma.displayName="PopupInner";var da=ma,Zr=M.forwardRef(function(Me,tt){var ot=Me.prefixCls,je=Me.visible,ce=Me.zIndex,Oe=Me.children,me=Me.mobile;me=me===void 0?{}:me;var ke=me.popupClassName,Ge=me.popupStyle,ut=me.popupMotion,Je=ut===void 0?{}:ut,pt=me.popupRender,Nt=M.useRef();M.useImperativeHandle(tt,function(){return{forceAlign:function(){},getElement:function(){return Nt.current}}});var tn=Object(G.a)({zIndex:ce},Ge),fn=Oe;return M.Children.count(Oe)>1&&(fn=M.createElement("div",{className:"".concat(ot,"-content")},Oe)),pt&&(fn=pt(fn)),M.createElement(ue,Object(S.a)({visible:je,ref:Nt,removeOnLeave:!0},Je),function(Tn,Kn){var fr=Tn.className,lr=Tn.style,yr=W()(ot,ke,fr);return M.createElement("div",{ref:Kn,className:yr,style:Object(G.a)(Object(G.a)({},lr),tn)},fn)})});Zr.displayName="MobilePopupInner";var za=Zr,oi=["visible","mobile"],ua=M.forwardRef(function(Me,tt){var ot=Me.visible,je=Me.mobile,ce=Object(j.a)(Me,oi),Oe=Object(M.useState)(ot),me=Object(V.a)(Oe,2),ke=me[0],Ge=me[1],ut=Object(M.useState)(!1),Je=Object(V.a)(ut,2),pt=Je[0],Nt=Je[1],tn=Object(G.a)(Object(G.a)({},ce),{},{visible:ke});Object(M.useEffect)(function(){Ge(ot),ot&&je&&Nt(We())},[ot,je]);var fn=pt?M.createElement(za,Object(S.a)({},tn,{mobile:je,ref:tt})):M.createElement(da,Object(S.a)({},tn,{ref:tt}));return M.createElement("div",null,M.createElement(Ze,tn),fn)});ua.displayName="Popup";var Na=ua,ti=M.createContext(null),Ga=ti;function ba(){}function zn(){return""}function bn(Me){return Me?Me.ownerDocument:window.document}var kn=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function Wn(Me){var tt=function(ot){Object(b.a)(ce,ot);var je=Object(g.a)(ce);function ce(Oe){var me;Object(L.a)(this,ce),me=je.call(this,Oe),me.popupRef=M.createRef(),me.triggerRef=M.createRef(),me.attachId=void 0,me.clickOutsideHandler=void 0,me.touchOutsideHandler=void 0,me.contextMenuOutsideHandler1=void 0,me.contextMenuOutsideHandler2=void 0,me.mouseDownTimeout=void 0,me.focusTime=void 0,me.preClickTime=void 0,me.preTouchTime=void 0,me.delayTimer=void 0,me.hasPopupMouseDown=void 0,me.onMouseEnter=function(Ge){var ut=me.props.mouseEnterDelay;me.fireEvents("onMouseEnter",Ge),me.delaySetPopupVisible(!0,ut,ut?null:Ge)},me.onMouseMove=function(Ge){me.fireEvents("onMouseMove",Ge),me.setPoint(Ge)},me.onMouseLeave=function(Ge){me.fireEvents("onMouseLeave",Ge),me.delaySetPopupVisible(!1,me.props.mouseLeaveDelay)},me.onPopupMouseEnter=function(){me.clearDelayTimer()},me.onPopupMouseLeave=function(Ge){var ut;if(Ge.relatedTarget&&!Ge.relatedTarget.setTimeout&&Object(Mt.a)((ut=me.popupRef.current)===null||ut===void 0?void 0:ut.getElement(),Ge.relatedTarget))return;me.delaySetPopupVisible(!1,me.props.mouseLeaveDelay)},me.onFocus=function(Ge){me.fireEvents("onFocus",Ge),me.clearDelayTimer(),me.isFocusToShow()&&(me.focusTime=Date.now(),me.delaySetPopupVisible(!0,me.props.focusDelay))},me.onMouseDown=function(Ge){me.fireEvents("onMouseDown",Ge),me.preClickTime=Date.now()},me.onTouchStart=function(Ge){me.fireEvents("onTouchStart",Ge),me.preTouchTime=Date.now()},me.onBlur=function(Ge){me.fireEvents("onBlur",Ge),me.clearDelayTimer(),me.isBlurToHide()&&me.delaySetPopupVisible(!1,me.props.blurDelay)},me.onContextMenu=function(Ge){Ge.preventDefault(),me.fireEvents("onContextMenu",Ge),me.setPopupVisible(!0,Ge)},me.onContextMenuClose=function(){me.isContextMenuToShow()&&me.close()},me.onClick=function(Ge){if(me.fireEvents("onClick",Ge),me.focusTime){var ut;if(me.preClickTime&&me.preTouchTime?ut=Math.min(me.preClickTime,me.preTouchTime):me.preClickTime?ut=me.preClickTime:me.preTouchTime&&(ut=me.preTouchTime),Math.abs(ut-me.focusTime)<20)return;me.focusTime=0}me.preClickTime=0,me.preTouchTime=0,me.isClickToShow()&&(me.isClickToHide()||me.isBlurToHide())&&Ge&&Ge.preventDefault&&Ge.preventDefault();var Je=!me.state.popupVisible;(me.isClickToHide()&&!Je||Je&&me.isClickToShow())&&me.setPopupVisible(!me.state.popupVisible,Ge)},me.onPopupMouseDown=function(){if(me.hasPopupMouseDown=!0,clearTimeout(me.mouseDownTimeout),me.mouseDownTimeout=window.setTimeout(function(){me.hasPopupMouseDown=!1},0),me.context){var Ge;(Ge=me.context).onPopupMouseDown.apply(Ge,arguments)}},me.onDocumentClick=function(Ge){if(me.props.mask&&!me.props.maskClosable)return;var ut=Ge.target,Je=me.getRootDomNode(),pt=me.getPopupDomNode();(!Object(Mt.a)(Je,ut)||me.isContextMenuOnly())&&!Object(Mt.a)(pt,ut)&&!me.hasPopupMouseDown&&me.close()},me.getRootDomNode=function(){var Ge=me.props.getTriggerDOMNode;if(Ge)return Ge(me.triggerRef.current);try{var ut=Object(sn.a)(me.triggerRef.current);if(ut)return ut}catch(Je){}return jt.a.findDOMNode(Object(_.a)(me))},me.getPopupClassNameFromAlign=function(Ge){var ut=[],Je=me.props,pt=Je.popupPlacement,Nt=Je.builtinPlacements,tn=Je.prefixCls,fn=Je.alignPoint,Tn=Je.getPopupClassNameFromAlign;return pt&&Nt&&ut.push(mt(Nt,tn,Ge,fn)),Tn&&ut.push(Tn(Ge)),ut.join(" ")},me.getComponent=function(){var Ge=me.props,ut=Ge.prefixCls,Je=Ge.destroyPopupOnHide,pt=Ge.popupClassName,Nt=Ge.onPopupAlign,tn=Ge.popupMotion,fn=Ge.popupAnimation,Tn=Ge.popupTransitionName,Kn=Ge.popupStyle,fr=Ge.mask,lr=Ge.maskAnimation,yr=Ge.maskTransitionName,br=Ge.maskMotion,vr=Ge.zIndex,Er=Ge.popup,Rr=Ge.stretch,hr=Ge.alignPoint,Nr=Ge.mobile,or=Ge.forceRender,pn=me.state,Ln=pn.popupVisible,xr=pn.point,Dr=me.getPopupAlign(),Qn={};return me.isMouseEnterToShow()&&(Qn.onMouseEnter=me.onPopupMouseEnter),me.isMouseLeaveToHide()&&(Qn.onMouseLeave=me.onPopupMouseLeave),Qn.onMouseDown=me.onPopupMouseDown,Qn.onTouchStart=me.onPopupMouseDown,M.createElement(Na,Object(S.a)({prefixCls:ut,destroyPopupOnHide:Je,visible:Ln,point:hr&&xr,className:pt,align:Dr,onAlign:Nt,animation:fn,getClassNameFromAlign:me.getPopupClassNameFromAlign},Qn,{stretch:Rr,getRootDomNode:me.getRootDomNode,style:Kn,mask:fr,zIndex:vr,transitionName:Tn,maskAnimation:lr,maskTransitionName:yr,maskMotion:br,ref:me.popupRef,motion:tn,mobile:Nr,forceRender:or}),typeof Er=="function"?Er():Er)},me.attachParent=function(Ge){qe.a.cancel(me.attachId);var ut=me.props,Je=ut.getPopupContainer,pt=ut.getDocument,Nt=me.getRootDomNode(),tn;Je?(Nt||Je.length===0)&&(tn=Je(Nt)):tn=pt(me.getRootDomNode()).body,tn?tn.appendChild(Ge):me.attachId=Object(qe.a)(function(){me.attachParent(Ge)})},me.getContainer=function(){var Ge=me.props.getDocument,ut=Ge(me.getRootDomNode()).createElement("div");return ut.style.position="absolute",ut.style.top="0",ut.style.left="0",ut.style.width="100%",me.attachParent(ut),ut},me.setPoint=function(Ge){var ut=me.props.alignPoint;if(!ut||!Ge)return;me.setState({point:{pageX:Ge.pageX,pageY:Ge.pageY}})},me.handlePortalUpdate=function(){me.state.prevPopupVisible!==me.state.popupVisible&&me.props.afterPopupVisibleChange(me.state.popupVisible)},me.triggerContextValue={onPopupMouseDown:me.onPopupMouseDown};var ke;return"popupVisible"in Oe?ke=!!Oe.popupVisible:ke=!!Oe.defaultPopupVisible,me.state={prevPopupVisible:ke,popupVisible:ke},kn.forEach(function(Ge){me["fire".concat(Ge)]=function(ut){me.fireEvents(Ge,ut)}}),me}return Object(P.a)(ce,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var me=this.props,ke=this.state;if(ke.popupVisible){var Ge;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(Ge=me.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Qe.a)(Ge,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(Ge=Ge||me.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Qe.a)(Ge,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(Ge=Ge||me.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Qe.a)(Ge,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Qe.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),qe.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var me;return((me=this.popupRef.current)===null||me===void 0?void 0:me.getElement())||null}},{key:"getPopupAlign",value:function(){var me=this.props,ke=me.popupPlacement,Ge=me.popupAlign,ut=me.builtinPlacements;return ke&&ut?dt(ut,ke,Ge):Ge}},{key:"setPopupVisible",value:function(me,ke){var Ge=this.props.alignPoint,ut=this.state.popupVisible;this.clearDelayTimer(),ut!==me&&("popupVisible"in this.props||this.setState({popupVisible:me,prevPopupVisible:ut}),this.props.onPopupVisibleChange(me)),Ge&&ke&&me&&this.setPoint(ke)}},{key:"delaySetPopupVisible",value:function(me,ke,Ge){var ut=this,Je=ke*1e3;if(this.clearDelayTimer(),Je){var pt=Ge?{pageX:Ge.pageX,pageY:Ge.pageY}:null;this.delayTimer=window.setTimeout(function(){ut.setPopupVisible(me,pt),ut.clearDelayTimer()},Je)}else this.setPopupVisible(me,Ge)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(me){var ke=this.props.children.props,Ge=this.props;return ke[me]&&Ge[me]?this["fire".concat(me)]:ke[me]||Ge[me]}},{key:"isClickToShow",value:function(){var me=this.props,ke=me.action,Ge=me.showAction;return ke.indexOf("click")!==-1||Ge.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var me=this.props.action;return me==="contextMenu"||me.length===1&&me[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var me=this.props,ke=me.action,Ge=me.showAction;return ke.indexOf("contextMenu")!==-1||Ge.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var me=this.props,ke=me.action,Ge=me.hideAction;return ke.indexOf("click")!==-1||Ge.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var me=this.props,ke=me.action,Ge=me.showAction;return ke.indexOf("hover")!==-1||Ge.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var me=this.props,ke=me.action,Ge=me.hideAction;return ke.indexOf("hover")!==-1||Ge.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var me=this.props,ke=me.action,Ge=me.showAction;return ke.indexOf("focus")!==-1||Ge.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var me=this.props,ke=me.action,Ge=me.hideAction;return ke.indexOf("focus")!==-1||Ge.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var me;(me=this.popupRef.current)===null||me===void 0||me.forceAlign()}}},{key:"fireEvents",value:function(me,ke){var Ge=this.props.children.props[me];Ge&&Ge(ke);var ut=this.props[me];ut&&ut(ke)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var me=this.state.popupVisible,ke=this.props,Ge=ke.children,ut=ke.forceRender,Je=ke.alignPoint,pt=ke.className,Nt=ke.autoDestroy,tn=M.Children.only(Ge),fn={key:"trigger"};this.isContextMenuToShow()?fn.onContextMenu=this.onContextMenu:fn.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(fn.onClick=this.onClick,fn.onMouseDown=this.onMouseDown,fn.onTouchStart=this.onTouchStart):(fn.onClick=this.createTwoChains("onClick"),fn.onMouseDown=this.createTwoChains("onMouseDown"),fn.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(fn.onMouseEnter=this.onMouseEnter,Je&&(fn.onMouseMove=this.onMouseMove)):fn.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?fn.onMouseLeave=this.onMouseLeave:fn.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(fn.onFocus=this.onFocus,fn.onBlur=this.onBlur):(fn.onFocus=this.createTwoChains("onFocus"),fn.onBlur=this.createTwoChains("onBlur"));var Tn=W()(tn&&tn.props&&tn.props.className,pt);Tn&&(fn.className=Tn);var Kn=Object(G.a)({},fn);Object(at.c)(tn)&&(Kn.ref=Object(at.a)(this.triggerRef,tn.ref));var fr=M.cloneElement(tn,Kn),lr;return(me||this.popupRef.current||ut)&&(lr=M.createElement(Me,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!me&&Nt&&(lr=null),M.createElement(Ga.Provider,{value:this.triggerContextValue},fr,lr)}}],[{key:"getDerivedStateFromProps",value:function(me,ke){var Ge=me.popupVisible,ut={};return Ge!==void 0&&ke.popupVisible!==Ge&&(ut.popupVisible=Ge,ut.prevPopupVisible=ke.popupVisible),ut}}]),ce}(M.Component);return tt.contextType=Ga,tt.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:zn,getDocument:bn,onPopupVisibleChange:ba,afterPopupVisibleChange:ba,onPopupAlign:ba,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},tt}var dr=Wn(Et.a),ne={adjustX:1,adjustY:1},Re={topLeft:{points:["bl","tl"],overflow:ne,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:ne,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:ne,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:ne,offset:[4,0]}},$e={topLeft:{points:["bl","tl"],overflow:ne,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:ne,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:ne,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:ne,offset:[4,0]}},Be=Re,Ye=0,et={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},it=function(tt,ot,je){var ce=ae(ot),Oe=tt.getState();tt.setState({defaultActiveFirst:Object(G.a)(Object(G.a)({},Oe.defaultActiveFirst),{},Object(Z.a)({},ce,je))})},Ae=function(Me){Object(b.a)(ot,Me);var tt=Object(g.a)(ot);function ot(je){var ce;Object(L.a)(this,ot),ce=tt.call(this,je),ce.onDestroy=function(Je){ce.props.onDestroy(Je)},ce.onKeyDown=function(Je){var pt=Je.keyCode,Nt=ce.menuInstance,tn=ce.props.store,fn=ce.getVisible();if(pt===s.a.ENTER)return ce.onTitleClick(Je),it(tn,ce.props.eventKey,!0),!0;if(pt===s.a.RIGHT)return fn?Nt.onKeyDown(Je):(ce.triggerOpenChange(!0),it(tn,ce.props.eventKey,!0)),!0;if(pt===s.a.LEFT){var Tn;if(fn)Tn=Nt.onKeyDown(Je);else return;return Tn||(ce.triggerOpenChange(!1),Tn=!0),Tn}return fn&&(pt===s.a.UP||pt===s.a.DOWN)?Nt.onKeyDown(Je):void 0},ce.onOpenChange=function(Je){ce.props.onOpenChange(Je)},ce.onPopupVisibleChange=function(Je){ce.triggerOpenChange(Je,Je?"mouseenter":"mouseleave")},ce.onMouseEnter=function(Je){var pt=ce.props,Nt=pt.eventKey,tn=pt.onMouseEnter,fn=pt.store;it(fn,ce.props.eventKey,!1),tn({key:Nt,domEvent:Je})},ce.onMouseLeave=function(Je){var pt=ce.props,Nt=pt.parentMenu,tn=pt.eventKey,fn=pt.onMouseLeave;Nt.subMenuInstance=Object(_.a)(ce),fn({key:tn,domEvent:Je})},ce.onTitleMouseEnter=function(Je){var pt=ce.props,Nt=pt.eventKey,tn=pt.onItemHover,fn=pt.onTitleMouseEnter;tn({key:Nt,hover:!0}),fn({key:Nt,domEvent:Je})},ce.onTitleMouseLeave=function(Je){var pt=ce.props,Nt=pt.parentMenu,tn=pt.eventKey,fn=pt.onItemHover,Tn=pt.onTitleMouseLeave;Nt.subMenuInstance=Object(_.a)(ce),fn({key:tn,hover:!1}),Tn({key:tn,domEvent:Je})},ce.onTitleClick=function(Je){var pt=Object(_.a)(ce),Nt=pt.props;if(Nt.onTitleClick({key:Nt.eventKey,domEvent:Je}),Nt.triggerSubMenuAction==="hover")return;ce.triggerOpenChange(!ce.getVisible(),"click"),it(Nt.store,ce.props.eventKey,!1)},ce.onSubMenuClick=function(Je){typeof ce.props.onClick=="function"&&ce.props.onClick(ce.addKeyPath(Je))},ce.onSelect=function(Je){ce.props.onSelect(Je)},ce.onDeselect=function(Je){ce.props.onDeselect(Je)},ce.getPrefixCls=function(){return"".concat(ce.props.rootPrefixCls,"-submenu")},ce.getActiveClassName=function(){return"".concat(ce.getPrefixCls(),"-active")},ce.getDisabledClassName=function(){return"".concat(ce.getPrefixCls(),"-disabled")},ce.getSelectedClassName=function(){return"".concat(ce.getPrefixCls(),"-selected")},ce.getOpenClassName=function(){return"".concat(ce.props.rootPrefixCls,"-submenu-open")},ce.getVisible=function(){return ce.state.isOpen},ce.getMode=function(){return ce.state.mode},ce.saveMenuInstance=function(Je){ce.menuInstance=Je},ce.addKeyPath=function(Je){return Object(G.a)(Object(G.a)({},Je),{},{keyPath:(Je.keyPath||[]).concat(ce.props.eventKey)})},ce.triggerOpenChange=function(Je,pt){var Nt=ce.props.eventKey,tn=function(){ce.onOpenChange({key:Nt,item:Object(_.a)(ce),trigger:pt,open:Je})};pt==="mouseenter"?ce.mouseenterTimeout=setTimeout(function(){tn()},0):tn()},ce.isChildrenSelected=function(){var Je={find:!1};return Q(ce.props.children,ce.props.selectedKeys,Je),Je.find},ce.isInlineMode=function(){return ce.getMode()==="inline"},ce.adjustWidth=function(){if(!ce.subMenuTitle||!ce.menuInstance)return;var Je=Pt.findDOMNode(ce.menuInstance);if(Je.offsetWidth>=ce.subMenuTitle.offsetWidth)return;Je.style.minWidth="".concat(ce.subMenuTitle.offsetWidth,"px")},ce.saveSubMenuTitle=function(Je){ce.subMenuTitle=Je},ce.getBaseProps=function(){var Je=Object(_.a)(ce),pt=Je.props,Nt=ce.getMode();return{mode:Nt==="horizontal"?"vertical":Nt,visible:ce.getVisible(),level:pt.level+1,inlineIndent:pt.inlineIndent,focusable:!1,onClick:ce.onSubMenuClick,onSelect:ce.onSelect,onDeselect:ce.onDeselect,onDestroy:ce.onDestroy,selectedKeys:pt.selectedKeys,eventKey:"".concat(pt.eventKey,"-menu-"),openKeys:pt.openKeys,motion:pt.motion,onOpenChange:ce.onOpenChange,subMenuOpenDelay:pt.subMenuOpenDelay,parentMenu:Object(_.a)(ce),subMenuCloseDelay:pt.subMenuCloseDelay,forceSubMenuRender:pt.forceSubMenuRender,triggerSubMenuAction:pt.triggerSubMenuAction,builtinPlacements:pt.builtinPlacements,defaultActiveFirst:pt.store.getState().defaultActiveFirst[ae(pt.eventKey)],multiple:pt.multiple,prefixCls:pt.rootPrefixCls,id:ce.internalMenuId,manualRef:ce.saveMenuInstance,itemIcon:pt.itemIcon,expandIcon:pt.expandIcon,direction:pt.direction}},ce.getMotion=function(Je,pt){var Nt=Object(_.a)(ce),tn=Nt.haveRendered,fn=ce.props,Tn=fn.motion,Kn=fn.rootPrefixCls,fr=Object(G.a)(Object(G.a)({},Tn),{},{leavedClassName:"".concat(Kn,"-hidden"),removeOnLeave:!1,motionAppear:tn||!pt||Je!=="inline"});return fr};var Oe=je.store,me=je.eventKey,ke=Oe.getState(),Ge=ke.defaultActiveFirst;ce.isRootMenu=!1;var ut=!1;return Ge&&(ut=Ge[me]),it(Oe,me,ut),ce.state={mode:je.mode,isOpen:je.isOpen},ce}return Object(P.a)(ot,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ce=this,Oe=this.props,me=Oe.mode,ke=Oe.parentMenu,Ge=Oe.manualRef,ut=Oe.isOpen,Je=function(){ce.setState({mode:me,isOpen:ut})},pt=ut!==this.state.isOpen,Nt=me!==this.state.mode;if((Nt||pt)&&(qe.a.cancel(this.updateStateRaf),Nt?this.updateStateRaf=Object(qe.a)(Je):Je()),Ge&&Ge(this),me!=="horizontal"||!(ke==null?void 0:ke.isRootMenu)||!ut)return;this.minWidthTimeout=setTimeout(function(){return ce.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var ce=this.props,Oe=ce.onDestroy,me=ce.eventKey;Oe&&Oe(me),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),qe.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(ce,Oe){var me=this.getBaseProps();return M.createElement(Dn,Object(S.a)({},me,{id:this.internalMenuId,className:ce,style:Oe}),this.props.children)}},{key:"renderChildren",value:function(){var ce=this,Oe=this.getBaseProps(),me=Oe.mode,ke=Oe.visible,Ge=Oe.forceSubMenuRender,ut=Oe.direction,Je=this.getMotion(me,ke);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||ke||Ge,!this.haveOpened)return M.createElement("div",null);var pt=W()("".concat(Oe.prefixCls,"-sub"),Object(Z.a)({},"".concat(Oe.prefixCls,"-rtl"),ut==="rtl"));return this.isInlineMode()?M.createElement(ue,Object(S.a)({visible:Oe.visible,forceRender:Ge},Je),function(Nt){var tn=Nt.className,fn=Nt.style,Tn=W()(pt,tn);return ce.renderPopupMenu(Tn,fn)}):this.renderPopupMenu(pt)}},{key:"render",value:function(){var ce,Oe,me,ke=Object(G.a)({},this.props),Ge=this.getVisible(),ut=this.getPrefixCls(),Je=this.isInlineMode(),pt=this.getMode(),Nt=W()(ut,"".concat(ut,"-").concat(pt),(ce={},Object(Z.a)(ce,ke.className,!!ke.className),Object(Z.a)(ce,this.getOpenClassName(),Ge),Object(Z.a)(ce,this.getActiveClassName(),ke.active||Ge&&!Je),Object(Z.a)(ce,this.getDisabledClassName(),ke.disabled),Object(Z.a)(ce,this.getSelectedClassName(),this.isChildrenSelected()),ce));this.internalMenuId||(ke.eventKey?this.internalMenuId="".concat(ke.eventKey,"$Menu"):(Ye+=1,this.internalMenuId="$__$".concat(Ye,"$Menu")));var tn={},fn={},Tn={};ke.disabled||(tn={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},fn={onClick:this.onTitleClick},Tn={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Kn={},fr=ke.direction,lr=fr==="rtl";Je&&(lr?Kn.paddingRight=ke.inlineIndent*ke.level:Kn.paddingLeft=ke.inlineIndent*ke.level);var yr={};this.getVisible()&&(yr={"aria-owns":this.internalMenuId});var br=null;pt!=="horizontal"&&(br=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(br=M.createElement(this.props.expandIcon,Object(G.a)({},this.props))));var vr=M.createElement("div",Object(S.a)({ref:this.saveSubMenuTitle,style:Kn,className:"".concat(ut,"-title"),role:"button"},Tn,fn,{"aria-expanded":Ge},yr,{"aria-haspopup":"true",title:typeof ke.title=="string"?ke.title:void 0}),ke.title,br||M.createElement("i",{className:"".concat(ut,"-arrow")})),Er=this.renderChildren(),Rr=((Oe=ke.parentMenu)===null||Oe===void 0?void 0:Oe.isRootMenu)?ke.parentMenu.props.getPopupContainer:function(Wr){return Wr.parentNode},hr=et[pt],Nr=ke.popupOffset?{offset:ke.popupOffset}:{},or=W()((me={},Object(Z.a)(me,ke.popupClassName,ke.popupClassName&&!Je),Object(Z.a)(me,"".concat(ut,"-rtl"),lr),me)),pn=ke.disabled,Ln=ke.triggerSubMenuAction,xr=ke.subMenuOpenDelay,Dr=ke.forceSubMenuRender,Qn=ke.subMenuCloseDelay,Ar=ke.builtinPlacements;te.forEach(function(Wr){return delete ke[Wr]}),delete ke.onClick;var qr=lr?Object(G.a)(Object(G.a)({},$e),Ar):Object(G.a)(Object(G.a)({},Re),Ar);delete ke.direction;var Lr=this.getBaseProps(),Ur=Je?null:this.getMotion(Lr.mode,Lr.visible);return M.createElement("li",Object(S.a)({},ke,tn,{className:Nt,role:"menuitem"}),M.createElement(dr,{prefixCls:ut,popupClassName:W()("".concat(ut,"-popup"),or),getPopupContainer:Rr,builtinPlacements:qr,popupPlacement:hr,popupVisible:Je?!1:Ge,popupAlign:Nr,popup:Je?null:Er,action:pn||Je?[]:[Ln],mouseEnterDelay:xr,mouseLeaveDelay:Qn,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:Dr,popupMotion:Ur},vr),Je?Er:null)}}]),ot}(M.Component);Ae.defaultProps={onMouseEnter:He,onMouseLeave:He,onTitleMouseEnter:He,onTitleMouseLeave:He,onTitleClick:He,manualRef:He,mode:"vertical",title:""};var ze=Object(m.b)(function(Me,tt){var ot=Me.openKeys,je=Me.activeKey,ce=Me.selectedKeys,Oe=tt.eventKey,me=tt.subMenuKey;return{isOpen:ot.indexOf(Oe)>-1,active:je[me]===Oe,selectedKeys:ce}})(Ae);ze.isSubMenu=!0;var yt=ze,en="menuitem-overflowed",Tt=.5,vt=function(Me){Object(b.a)(ot,Me);var tt=Object(g.a)(ot);function ot(){var je;return Object(L.a)(this,ot),je=tt.apply(this,arguments),je.resizeObserver=null,je.mutationObserver=null,je.originalTotalWidth=0,je.overflowedItems=[],je.menuItemSizes=[],je.cancelFrameId=null,je.state={lastVisibleIndex:void 0},je.childRef=M.createRef(),je.getMenuItemNodes=function(){var ce=je.props.prefixCls,Oe=je.childRef.current;return Oe?[].slice.call(Oe.children).filter(function(me){return me.className.split(" ").indexOf("".concat(ce,"-overflowed-submenu"))<0}):[]},je.getOverflowedSubMenuItem=function(ce,Oe,me){var ke=je.props,Ge=ke.overflowedIndicator,ut=ke.level,Je=ke.mode,pt=ke.prefixCls,Nt=ke.theme;if(ut!==1||Je!=="horizontal")return null;var tn=je.props.children[0],fn=tn.props,Tn=fn.children,Kn=fn.title,fr=fn.style,lr=Object(j.a)(fn,["children","title","style"]),yr=Object(G.a)({},fr),br="".concat(ce,"-overflowed-indicator"),vr="".concat(ce,"-overflowed-indicator");Oe.length===0&&me!==!0?yr=Object(G.a)(Object(G.a)({},yr),{},{display:"none"}):me&&(yr=Object(G.a)(Object(G.a)({},yr),{},{visibility:"hidden",position:"absolute"}),br="".concat(br,"-placeholder"),vr="".concat(vr,"-placeholder"));var Er=Nt?"".concat(pt,"-").concat(Nt):"",Rr={};return te.forEach(function(hr){lr[hr]!==void 0&&(Rr[hr]=lr[hr])}),M.createElement(yt,Object(S.a)({title:Ge,className:"".concat(pt,"-overflowed-submenu"),popupClassName:Er},Rr,{key:br,eventKey:vr,disabled:!1,style:yr}),Oe)},je.setChildrenWidthAndResize=function(){if(je.props.mode!=="horizontal")return;var ce=je.childRef.current;if(!ce)return;var Oe=ce.children;if(!Oe||Oe.length===0)return;var me=ce.children[Oe.length-1];ge(me,"display","inline-block");var ke=je.getMenuItemNodes(),Ge=ke.filter(function(ut){return ut.className.split(" ").indexOf(en)>=0});Ge.forEach(function(ut){ge(ut,"display","inline-block")}),je.menuItemSizes=ke.map(function(ut){return he(ut,!0)}),Ge.forEach(function(ut){ge(ut,"display","none")}),je.overflowedIndicatorWidth=he(ce.children[ce.children.length-1],!0),je.originalTotalWidth=je.menuItemSizes.reduce(function(ut,Je){return ut+Je},0),je.handleResize(),ge(me,"display","none")},je.handleResize=function(){if(je.props.mode!=="horizontal")return;var ce=je.childRef.current;if(!ce)return;var Oe=he(ce);je.overflowedItems=[];var me=0,ke;je.originalTotalWidth>Oe+Tt&&(ke=-1,je.menuItemSizes.forEach(function(Ge){me+=Ge,me+je.overflowedIndicatorWidth<=Oe&&(ke+=1)})),je.setState({lastVisibleIndex:ke})},je}return Object(P.a)(ot,[{key:"componentDidMount",value:function(){var ce=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var Oe=this.childRef.current;if(!Oe)return;this.resizeObserver=new ft.default(function(me){me.forEach(function(){var ke=ce.cancelFrameId;cancelAnimationFrame(ke),ce.cancelFrameId=requestAnimationFrame(ce.setChildrenWidthAndResize)})}),[].slice.call(Oe.children).concat(Oe).forEach(function(me){ce.resizeObserver.observe(me)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){ce.resizeObserver.disconnect(),[].slice.call(Oe.children).concat(Oe).forEach(function(me){ce.resizeObserver.observe(me)}),ce.setChildrenWidthAndResize()}),this.mutationObserver.observe(Oe,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(ce){var Oe=this,me=this.state.lastVisibleIndex;return(ce||[]).reduce(function(ke,Ge,ut){var Je=Ge;if(Oe.props.mode==="horizontal"){var pt=Oe.getOverflowedSubMenuItem(Ge.props.eventKey,[]);me!==void 0&&Oe.props.className.indexOf("".concat(Oe.props.prefixCls,"-root"))!==-1&&(ut>me&&(Je=M.cloneElement(Ge,{style:{display:"none"},eventKey:"".concat(Ge.props.eventKey,"-hidden"),className:"".concat(en)})),ut===me+1&&(Oe.overflowedItems=ce.slice(me+1).map(function(tn){return M.cloneElement(tn,{key:tn.props.eventKey,mode:"vertical-left"})}),pt=Oe.getOverflowedSubMenuItem(Ge.props.eventKey,Oe.overflowedItems)));var Nt=[].concat(Object(A.a)(ke),[pt,Je]);return ut===ce.length-1&&Nt.push(Oe.getOverflowedSubMenuItem(Ge.props.eventKey,[],!0)),Nt}return[].concat(Object(A.a)(ke),[Je])},[])}},{key:"render",value:function(){var ce=this.props,Oe=ce.visible,me=ce.prefixCls,ke=ce.overflowedIndicator,Ge=ce.mode,ut=ce.level,Je=ce.tag,pt=ce.children,Nt=ce.theme,tn=Object(j.a)(ce,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),fn=Je;return M.createElement(fn,Object(S.a)({ref:this.childRef},tn),this.renderChildren(pt))}}]),ot}(M.Component);vt.defaultProps={tag:"div",className:""};var ct=vt;function St(Me){return Me.length?Me.every(function(tt){return!!tt.props.disabled}):!0}function Ut(Me,tt,ot){var je=Me.getState();Me.setState({activeKey:Object(G.a)(Object(G.a)({},je.activeKey),{},Object(Z.a)({},tt,ot))})}function At(Me){return Me.eventKey||"0-menu-"}function on(Me,tt){var ot=tt,je=Me.children,ce=Me.eventKey;if(ot){var Oe;if($(je,function(me,ke){me&&me.props&&!me.props.disabled&&ot===rt(me,ce,ke)&&(Oe=!0)}),Oe)return ot}return ot=null,Me.defaultActiveFirst&&$(je,function(me,ke){!ot&&me&&!me.props.disabled&&(ot=rt(me,ce,ke))}),ot}function xn(Me){if(!Me)return;var tt=this.instanceArray.indexOf(Me);tt!==-1?this.instanceArray[tt]=Me:this.instanceArray.push(Me)}var vn=function(Me){Object(b.a)(ot,Me);var tt=Object(g.a)(ot);function ot(je){var ce;return Object(L.a)(this,ot),ce=tt.call(this,je),ce.onKeyDown=function(Oe,me){var ke=Oe.keyCode,Ge;if(ce.getFlatInstanceArray().forEach(function(Je){Je&&Je.props.active&&Je.onKeyDown&&(Ge=Je.onKeyDown(Oe))}),Ge)return 1;var ut=null;return(ke===s.a.UP||ke===s.a.DOWN)&&(ut=ce.step(ke===s.a.UP?-1:1)),ut?(Oe.preventDefault(),Ut(ce.props.store,At(ce.props),ut.props.eventKey),typeof me=="function"&&me(ut),1):void 0},ce.onItemHover=function(Oe){var me=Oe.key,ke=Oe.hover;Ut(ce.props.store,At(ce.props),ke?me:null)},ce.onDeselect=function(Oe){ce.props.onDeselect(Oe)},ce.onSelect=function(Oe){ce.props.onSelect(Oe)},ce.onClick=function(Oe){ce.props.onClick(Oe)},ce.onOpenChange=function(Oe){ce.props.onOpenChange(Oe)},ce.onDestroy=function(Oe){ce.props.onDestroy(Oe)},ce.getFlatInstanceArray=function(){return ce.instanceArray},ce.step=function(Oe){var me=ce.getFlatInstanceArray(),ke=ce.props.store.getState().activeKey[At(ce.props)],Ge=me.length;if(!Ge)return null;Oe<0&&(me=me.concat().reverse());var ut=-1;if(me.every(function(tn,fn){return tn&&tn.props.eventKey===ke?(ut=fn,!1):!0}),!ce.props.defaultActiveFirst&&ut!==-1&&St(me.slice(ut,Ge-1)))return;var Je=(ut+1)%Ge,pt=Je;do{var Nt=me[pt];if(!Nt||Nt.props.disabled)pt=(pt+1)%Ge;else return Nt}while(pt!==Je);return null},ce.renderCommonMenuItem=function(Oe,me,ke){var Ge=ce.props.store.getState(),ut=Object(_.a)(ce),Je=ut.props,pt=rt(Oe,Je.eventKey,me),Nt=Oe.props;if(!Nt||typeof Oe.type=="string")return Oe;var tn=pt===Ge.activeKey,fn=Object(G.a)(Object(G.a)({mode:Nt.mode||Je.mode,level:Je.level,inlineIndent:Je.inlineIndent,renderMenuItem:ce.renderMenuItem,rootPrefixCls:Je.prefixCls,index:me,parentMenu:Je.parentMenu,manualRef:Nt.disabled?void 0:Object(x.a)(Oe.ref,xn.bind(Object(_.a)(ce))),eventKey:pt,active:!Nt.disabled&&tn,multiple:Je.multiple,onClick:function(Kn){(Nt.onClick||He)(Kn),ce.onClick(Kn)},onItemHover:ce.onItemHover,motion:Je.motion,subMenuOpenDelay:Je.subMenuOpenDelay,subMenuCloseDelay:Je.subMenuCloseDelay,forceSubMenuRender:Je.forceSubMenuRender,onOpenChange:ce.onOpenChange,onDeselect:ce.onDeselect,onSelect:ce.onSelect,builtinPlacements:Je.builtinPlacements,itemIcon:Nt.itemIcon||ce.props.itemIcon,expandIcon:Nt.expandIcon||ce.props.expandIcon},ke),{},{direction:Je.direction});return(Je.mode==="inline"||we())&&(fn.triggerSubMenuAction="click"),M.cloneElement(Oe,Object(G.a)(Object(G.a)({},fn),{},{key:pt||me}))},ce.renderMenuItem=function(Oe,me,ke){if(!Oe)return null;var Ge=ce.props.store.getState(),ut={openKeys:Ge.openKeys,selectedKeys:Ge.selectedKeys,triggerSubMenuAction:ce.props.triggerSubMenuAction,subMenuKey:ke};return ce.renderCommonMenuItem(Oe,me,ut)},je.store.setState({activeKey:Object(G.a)(Object(G.a)({},je.store.getState().activeKey),{},Object(Z.a)({},je.eventKey,on(je,je.activeKey)))}),ce.instanceArray=[],ce}return Object(P.a)(ot,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(ce){return this.props.visible||ce.visible||this.props.className!==ce.className||!H()(this.props.style,ce.style)}},{key:"componentDidUpdate",value:function(ce){var Oe=this.props,me="activeKey"in Oe?Oe.activeKey:Oe.store.getState().activeKey[At(Oe)],ke=on(Oe,me);if(ke!==me)Ut(Oe.store,At(Oe),ke);else if("activeKey"in ce){var Ge=on(ce,ce.activeKey);ke!==Ge&&Ut(Oe.store,At(Oe),ke)}}},{key:"render",value:function(){var ce=this,Oe=Object(S.a)({},this.props);this.instanceArray=[];var me=W()(Oe.prefixCls,Oe.className,"".concat(Oe.prefixCls,"-").concat(Oe.mode)),ke={className:me,role:Oe.role||"menu"};Oe.id&&(ke.id=Oe.id),Oe.focusable&&(ke.tabIndex=0,ke.onKeyDown=this.onKeyDown);var Ge=Oe.prefixCls,ut=Oe.eventKey,Je=Oe.visible,pt=Oe.level,Nt=Oe.mode,tn=Oe.overflowedIndicator,fn=Oe.theme;return te.forEach(function(Tn){return delete Oe[Tn]}),delete Oe.onClick,M.createElement(ct,Object(S.a)({},Oe,{prefixCls:Ge,mode:Nt,tag:"ul",level:pt,theme:fn,visible:Je,overflowedIndicator:tn},ke),Object(C.a)(Oe.children).map(function(Tn,Kn){return ce.renderMenuItem(Tn,Kn,ut||"0-menu-")}))}}]),ot}(M.Component);vn.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:He};var Qt=Object(m.b)()(vn),Dn=Qt,Rn=T("Kwbf");function zt(Me,tt,ot){var je=Me.prefixCls,ce=Me.motion,Oe=Me.defaultMotions,me=Oe===void 0?{}:Oe,ke=Me.openAnimation,Ge=Me.openTransitionName,ut=tt.switchingModeFromInline;if(ce)return ce;if(Object(F.a)(ke)==="object"&&ke)Object(Rn.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof ke=="string")return{motionName:"".concat(je,"-open-").concat(ke)};if(Ge)return{motionName:Ge};var Je=me[ot];return Je||(ut?null:me.other)}var Kt=function(Me){Object(b.a)(ot,Me);var tt=Object(g.a)(ot);function ot(je){var ce;Object(L.a)(this,ot),ce=tt.call(this,je),ce.onSelect=function(ke){var Ge=Object(_.a)(ce),ut=Ge.props;if(ut.selectable){var Je=ce.store.getState(),pt=Je.selectedKeys,Nt=ke.key;ut.multiple?pt=pt.concat([Nt]):pt=[Nt],"selectedKeys"in ut||ce.store.setState({selectedKeys:pt}),ut.onSelect(Object(G.a)(Object(G.a)({},ke),{},{selectedKeys:pt}))}},ce.onClick=function(ke){var Ge=ce.getRealMenuMode(),ut=Object(_.a)(ce),Je=ut.store,pt=ut.props.onOpenChange;Ge!=="inline"&&!("openKeys"in ce.props)&&(Je.setState({openKeys:[]}),pt([])),ce.props.onClick(ke)},ce.onKeyDown=function(ke,Ge){ce.innerMenu.getWrappedInstance().onKeyDown(ke,Ge)},ce.onOpenChange=function(ke){var Ge=Object(_.a)(ce),ut=Ge.props,Je=ce.store.getState().openKeys.concat(),pt=!1,Nt=function(fn){var Tn=!1;if(fn.open)Tn=Je.indexOf(fn.key)===-1,Tn&&Je.push(fn.key);else{var Kn=Je.indexOf(fn.key);Tn=Kn!==-1,Tn&&Je.splice(Kn,1)}pt=pt||Tn};Array.isArray(ke)?ke.forEach(Nt):Nt(ke),pt&&("openKeys"in ce.props||ce.store.setState({openKeys:Je}),ut.onOpenChange(Je))},ce.onDeselect=function(ke){var Ge=Object(_.a)(ce),ut=Ge.props;if(ut.selectable){var Je=ce.store.getState().selectedKeys.concat(),pt=ke.key,Nt=Je.indexOf(pt);Nt!==-1&&Je.splice(Nt,1),"selectedKeys"in ut||ce.store.setState({selectedKeys:Je}),ut.onDeselect(Object(G.a)(Object(G.a)({},ke),{},{selectedKeys:Je}))}},ce.onMouseEnter=function(ke){ce.restoreModeVerticalFromInline();var Ge=ce.props.onMouseEnter;Ge&&Ge(ke)},ce.onTransitionEnd=function(ke){var Ge=ke.propertyName==="width"&&ke.target===ke.currentTarget,ut=ke.target.className,Je=Object.prototype.toString.call(ut)==="[object SVGAnimatedString]"?ut.animVal:ut,pt=ke.propertyName==="font-size"&&Je.indexOf("anticon")>=0;(Ge||pt)&&ce.restoreModeVerticalFromInline()},ce.setInnerMenu=function(ke){ce.innerMenu=ke},ce.isRootMenu=!0;var Oe=je.defaultSelectedKeys,me=je.defaultOpenKeys;return"selectedKeys"in je&&(Oe=je.selectedKeys||[]),"openKeys"in je&&(me=je.openKeys||[]),ce.store=Object(m.c)({selectedKeys:Oe,openKeys:me,activeKey:{"0-menu-":on(je,je.activeKey)}}),ce.state={switchingModeFromInline:!1,prevProps:je,inlineOpenKeys:[],store:ce.store},ce}return Object(P.a)(ot,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(ce){var Oe=this.props,me=Oe.siderCollapsed,ke=Oe.inlineCollapsed,Ge=Oe.onOpenChange;(!ce.inlineCollapsed&&ke||!ce.siderCollapsed&&me)&&Ge([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var ce=this.props.collapsedWidth,Oe=this.store,me=this.prevOpenKeys,ke=this.getInlineCollapsed()&&(ce===0||ce==="0"||ce==="0px");ke?(this.prevOpenKeys=Oe.getState().openKeys.concat(),this.store.setState({openKeys:[]})):me&&(this.store.setState({openKeys:me}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var ce=this.props.mode,Oe=this.state.switchingModeFromInline,me=this.getInlineCollapsed();return Oe&&me?"inline":me?"vertical":ce}},{key:"getInlineCollapsed",value:function(){var ce=this.props,Oe=ce.inlineCollapsed,me=ce.siderCollapsed;return me!==void 0?me:Oe}},{key:"restoreModeVerticalFromInline",value:function(){var ce=this.state.switchingModeFromInline;ce&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var ce=Object(G.a)({},Object(y.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),Oe=this.getRealMenuMode();return ce.className+=" ".concat(ce.prefixCls,"-root"),ce.direction==="rtl"&&(ce.className+=" ".concat(ce.prefixCls,"-rtl")),ce=Object(G.a)(Object(G.a)({},ce),{},{mode:Oe,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:zt(this.props,this.state,Oe)}),delete ce.openAnimation,delete ce.openTransitionName,M.createElement(m.a,{store:this.store},M.createElement(Dn,Object(S.a)({},ce,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(ce,Oe){var me=Oe.prevProps,ke=Oe.store,Ge=ke.getState(),ut={},Je={prevProps:ce};return me.mode==="inline"&&ce.mode!=="inline"&&(Je.switchingModeFromInline=!0),"openKeys"in ce?ut.openKeys=ce.openKeys||[]:((ce.inlineCollapsed&&!me.inlineCollapsed||ce.siderCollapsed&&!me.siderCollapsed)&&(Je.switchingModeFromInline=!0,Je.inlineOpenKeys=Ge.openKeys,ut.openKeys=[]),(!ce.inlineCollapsed&&me.inlineCollapsed||!ce.siderCollapsed&&me.siderCollapsed)&&(ut.openKeys=Oe.inlineOpenKeys,Je.inlineOpenKeys=[])),Object.keys(ut).length&&ke.setState(ut),Je}}]),ot}(M.Component);Kt.defaultProps={selectable:!0,onClick:He,onSelect:He,onOpenChange:He,onDeselect:He,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:M.createElement("span",null,"\xB7\xB7\xB7")};var Cn=Kt,Zt=function(Me){Object(b.a)(ot,Me);var tt=Object(g.a)(ot);function ot(){var je;return Object(L.a)(this,ot),je=tt.apply(this,arguments),je.onKeyDown=function(ce){var Oe=ce.keyCode;return Oe===s.a.ENTER?(je.onClick(ce),!0):void 0},je.onMouseLeave=function(ce){var Oe=je.props,me=Oe.eventKey,ke=Oe.onItemHover,Ge=Oe.onMouseLeave;ke({key:me,hover:!1}),Ge({key:me,domEvent:ce})},je.onMouseEnter=function(ce){var Oe=je.props,me=Oe.eventKey,ke=Oe.onItemHover,Ge=Oe.onMouseEnter;ke({key:me,hover:!0}),Ge({key:me,domEvent:ce})},je.onClick=function(ce){var Oe=je.props,me=Oe.eventKey,ke=Oe.multiple,Ge=Oe.onClick,ut=Oe.onSelect,Je=Oe.onDeselect,pt=Oe.isSelected,Nt={key:me,keyPath:[me],item:Object(_.a)(je),domEvent:ce};Ge(Nt),ke?pt?Je(Nt):ut(Nt):pt||ut(Nt)},je.saveNode=function(ce){je.node=ce},je}return Object(P.a)(ot,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var ce=this.props;ce.onDestroy&&ce.onDestroy(ce.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var ce,Oe=Object(G.a)({},this.props),me=W()(this.getPrefixCls(),Oe.className,(ce={},Object(Z.a)(ce,this.getActiveClassName(),!Oe.disabled&&Oe.active),Object(Z.a)(ce,this.getSelectedClassName(),Oe.isSelected),Object(Z.a)(ce,this.getDisabledClassName(),Oe.disabled),ce)),ke=Object(G.a)(Object(G.a)({},Oe.attribute),{},{title:typeof Oe.title=="string"?Oe.title:void 0,className:me,role:Oe.role||"menuitem","aria-disabled":Oe.disabled});Oe.role==="option"?ke=Object(G.a)(Object(G.a)({},ke),{},{role:"option","aria-selected":Oe.isSelected}):(Oe.role===null||Oe.role==="none")&&(ke.role="none");var Ge={onClick:Oe.disabled?null:this.onClick,onMouseLeave:Oe.disabled?null:this.onMouseLeave,onMouseEnter:Oe.disabled?null:this.onMouseEnter},ut=Object(G.a)({},Oe.style);Oe.mode==="inline"&&(Oe.direction==="rtl"?ut.paddingRight=Oe.inlineIndent*Oe.level:ut.paddingLeft=Oe.inlineIndent*Oe.level),te.forEach(function(pt){return delete Oe[pt]}),delete Oe.direction;var Je=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Je=M.createElement(this.props.itemIcon,this.props)),M.createElement("li",Object(S.a)({},Object(y.a)(Oe,["onClick","onMouseEnter","onMouseLeave","onSelect"]),ke,Ge,{style:ut,ref:this.saveNode}),Oe.children,Je)}}]),ot}(M.Component);Zt.isMenuItem=!0,Zt.defaultProps={onSelect:He,onMouseEnter:He,onMouseLeave:He,manualRef:He};var Nn=Object(m.b)(function(Me,tt){var ot=Me.activeKey,je=Me.selectedKeys,ce=tt.eventKey,Oe=tt.subMenuKey;return{active:ot[Oe]===ce,isSelected:Array.isArray(je)?je.indexOf(ce)!==-1:je===ce}})(Zt),Vt=Nn,Un=function(Me){Object(b.a)(ot,Me);var tt=Object(g.a)(ot);function ot(){var je;return Object(L.a)(this,ot),je=tt.apply(this,arguments),je.renderInnerMenuItem=function(ce){var Oe=je.props,me=Oe.renderMenuItem,ke=Oe.index;return me(ce,ke,je.props.subMenuKey)},je}return Object(P.a)(ot,[{key:"render",value:function(){var ce=Object(S.a)({},this.props),Oe=ce.className,me=Oe===void 0?"":Oe,ke=ce.rootPrefixCls,Ge="".concat(ke,"-item-group-title"),ut="".concat(ke,"-item-group-list"),Je=ce.title,pt=ce.children;return te.forEach(function(Nt){return delete ce[Nt]}),delete ce.direction,M.createElement("li",Object(S.a)({},ce,{onClick:function(tn){return tn.stopPropagation()},className:"".concat(me," ").concat(ke,"-item-group")}),M.createElement("div",{className:Ge,title:typeof Je=="string"?Je:void 0},Je),M.createElement("ul",{className:ut},M.Children.map(pt,this.renderInnerMenuItem)))}}]),ot}(M.Component);Un.isMenuItemGroup=!0,Un.defaultProps={disabled:!0};var Lt=Un,kt=function(tt){var ot=tt.className,je=tt.rootPrefixCls,ce=tt.style;return M.createElement("li",{className:"".concat(ot," ").concat(je,"-item-divider"),style:ce})};kt.defaultProps={disabled:!0,className:"",style:{}};var sr=kt,Sn=Cn,Mn=T("eDIo");function wn(Me,tt){var ot=Me.prefixCls,je=Me.editable,ce=Me.locale,Oe=Me.style;return!je||je.showAdd===!1?null:M.createElement("button",{ref:tt,type:"button",className:"".concat(ot,"-nav-add"),style:Oe,"aria-label":(ce==null?void 0:ce.addAriaLabel)||"Add tab",onClick:function(ke){je.onEdit("add",{event:ke})}},je.addIcon||"+")}var an=M.forwardRef(wn);function Yt(Me,tt){var ot=Me.prefixCls,je=Me.id,ce=Me.tabs,Oe=Me.locale,me=Me.mobile,ke=Me.moreIcon,Ge=ke===void 0?"More":ke,ut=Me.moreTransitionName,Je=Me.style,pt=Me.className,Nt=Me.editable,tn=Me.tabBarGutter,fn=Me.rtl,Tn=Me.onTabClick,Kn=Object(M.useState)(!1),fr=Object(V.a)(Kn,2),lr=fr[0],yr=fr[1],br=Object(M.useState)(null),vr=Object(V.a)(br,2),Er=vr[0],Rr=vr[1],hr="".concat(je,"-more-popup"),Nr="".concat(ot,"-dropdown"),or=Er!==null?"".concat(hr,"-").concat(Er):null,pn=Oe==null?void 0:Oe.dropdownAriaLabel,Ln=M.createElement(Sn,{onClick:function(Ur){var Wr=Ur.key,Br=Ur.domEvent;Tn(Wr,Br),yr(!1)},id:hr,tabIndex:-1,role:"listbox","aria-activedescendant":or,selectedKeys:[Er],"aria-label":pn!==void 0?pn:"expanded dropdown"},ce.map(function(Lr){return M.createElement(Vt,{key:Lr.key,id:"".concat(hr,"-").concat(Lr.key),role:"option","aria-controls":je&&"".concat(je,"-panel-").concat(Lr.key),disabled:Lr.disabled},Lr.tab)}));function xr(Lr){for(var Ur=ce.filter(function(na){return!na.disabled}),Wr=Ur.findIndex(function(na){return na.key===Er})||0,Br=Ur.length,Ir=0;Ir<Br;Ir+=1){Wr=(Wr+Lr+Br)%Br;var pr=Ur[Wr];if(!pr.disabled){Rr(pr.key);return}}}function Dr(Lr){var Ur=Lr.which;if(!lr){[s.a.DOWN,s.a.SPACE,s.a.ENTER].includes(Ur)&&(yr(!0),Lr.preventDefault());return}switch(Ur){case s.a.UP:xr(-1),Lr.preventDefault();break;case s.a.DOWN:xr(1),Lr.preventDefault();break;case s.a.ESC:yr(!1);break;case s.a.SPACE:case s.a.ENTER:Er!==null&&Tn(Er,Lr);break}}Object(M.useEffect)(function(){var Lr=document.getElementById(or);Lr&&Lr.scrollIntoView&&Lr.scrollIntoView(!1)},[Er]),Object(M.useEffect)(function(){lr||Rr(null)},[lr]);var Qn=Object(Z.a)({},fn?"marginLeft":"marginRight",tn);ce.length||(Qn.visibility="hidden",Qn.order=1);var Ar=W()(Object(Z.a)({},"".concat(Nr,"-rtl"),fn)),qr=me?null:M.createElement(Mn.a,{prefixCls:Nr,overlay:Ln,trigger:["hover"],visible:lr,transitionName:ut,onVisibleChange:yr,overlayClassName:Ar,mouseEnterDelay:.1,mouseLeaveDelay:.1},M.createElement("button",{type:"button",className:"".concat(ot,"-nav-more"),style:Qn,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":hr,id:"".concat(je,"-more"),"aria-expanded":lr,onKeyDown:Dr},Ge));return M.createElement("div",{className:W()("".concat(ot,"-nav-operations"),pt),style:Je,ref:tt},qr,M.createElement(an,{prefixCls:ot,locale:Oe,editable:Nt}))}var Gn=M.forwardRef(Yt),mn=Object(M.createContext)(null),Wt=.1,Ht=.01,dn=20,Xt=Math.pow(.995,dn);function ln(){var Me=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Me)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Me.substr(0,4)))}function Zn(Me,tt){var ot=Object(M.useState)(),je=Object(V.a)(ot,2),ce=je[0],Oe=je[1],me=Object(M.useState)(0),ke=Object(V.a)(me,2),Ge=ke[0],ut=ke[1],Je=Object(M.useState)(0),pt=Object(V.a)(Je,2),Nt=pt[0],tn=pt[1],fn=Object(M.useState)(),Tn=Object(V.a)(fn,2),Kn=Tn[0],fr=Tn[1],lr=Object(M.useRef)();function yr(pn){var Ln=pn.touches[0],xr=Ln.screenX,Dr=Ln.screenY;Oe({x:xr,y:Dr}),window.clearInterval(lr.current)}function br(pn){if(!ce)return;pn.preventDefault();var Ln=pn.touches[0],xr=Ln.screenX,Dr=Ln.screenY;Oe({x:xr,y:Dr});var Qn=xr-ce.x,Ar=Dr-ce.y;tt(Qn,Ar);var qr=Date.now();ut(qr),tn(qr-Ge),fr({x:Qn,y:Ar})}function vr(){if(!ce)return;if(Oe(null),fr(null),Kn){var pn=Kn.x/Nt,Ln=Kn.y/Nt,xr=Math.abs(pn),Dr=Math.abs(Ln);if(Math.max(xr,Dr)<Wt)return;var Qn=pn,Ar=Ln;lr.current=window.setInterval(function(){if(Math.abs(Qn)<Ht&&Math.abs(Ar)<Ht){window.clearInterval(lr.current);return}Qn*=Xt,Ar*=Xt,tt(Qn*dn,Ar*dn)},dn)}}var Er=Object(M.useRef)(0),Rr=Object(M.useRef)(!1),hr=Object(M.useRef)();function Nr(pn){var Ln=pn.deltaX,xr=pn.deltaY,Dr=0,Qn=Math.abs(Ln),Ar=Math.abs(xr);Qn===Ar?Dr=hr.current==="x"?Ln:xr:Qn>Ar?(Dr=Ln,hr.current="x"):(Dr=xr,hr.current="y");var qr=Date.now();qr-Er.current>100&&(Rr.current=!1),(tt(-Dr,-Dr)||Rr.current)&&(pn.preventDefault(),Rr.current=!0),Er.current=qr}var or=Object(M.useRef)(null);or.current={onTouchStart:yr,onTouchMove:br,onTouchEnd:vr,onWheel:Nr},M.useEffect(function(){function pn(Qn){or.current.onTouchStart(Qn)}function Ln(Qn){or.current.onTouchMove(Qn)}function xr(Qn){or.current.onTouchEnd(Qn)}function Dr(Qn){or.current.onWheel(Qn)}return document.addEventListener("touchmove",Ln,{passive:!1}),document.addEventListener("touchend",xr,{passive:!1}),Me.current.addEventListener("touchstart",pn,{passive:!1}),Me.current.addEventListener("wheel",Dr),function(){document.removeEventListener("touchmove",Ln),document.removeEventListener("touchend",xr)}},[])}function qn(){var Me=Object(M.useRef)(new Map);function tt(je){return Me.current.has(je)||Me.current.set(je,M.createRef()),Me.current.get(je)}function ot(je){Me.current.delete(je)}return[tt,ot]}function En(Me,tt){var ot=M.useRef(Me),je=M.useState({}),ce=Object(V.a)(je,2),Oe=ce[1];function me(ke){var Ge=typeof ke=="function"?ke(ot.current):ke;Ge!==ot.current&&tt(Ge,ot.current),ot.current=Ge,Oe({})}return[ot.current,me]}var Tr=function(tt){var ot=tt.position,je=tt.prefixCls,ce=tt.extra;if(!ce)return null;var Oe,me=ce;return ot==="right"&&(Oe=me.right||!me.left&&me||null),ot==="left"&&(Oe=me.left||null),Oe?M.createElement("div",{className:"".concat(je,"-extra-content")},Oe):null};function $n(Me,tt){var ot,je=M.useContext(mn),ce=je.prefixCls,Oe=je.tabs,me=Me.className,ke=Me.style,Ge=Me.id,ut=Me.animated,Je=Me.activeKey,pt=Me.rtl,Nt=Me.extra,tn=Me.editable,fn=Me.locale,Tn=Me.tabPosition,Kn=Me.tabBarGutter,fr=Me.children,lr=Me.onTabClick,yr=Me.onTabScroll,br=Object(M.useRef)(),vr=Object(M.useRef)(),Er=Object(M.useRef)(),Rr=Object(M.useRef)(),hr=qn(),Nr=Object(V.a)(hr,2),or=Nr[0],pn=Nr[1],Ln=Tn==="top"||Tn==="bottom",xr=En(0,function(Xr,kr){Ln&&yr&&yr({direction:Xr>kr?"left":"right"})}),Dr=Object(V.a)(xr,2),Qn=Dr[0],Ar=Dr[1],qr=En(0,function(Xr,kr){!Ln&&yr&&yr({direction:Xr>kr?"top":"bottom"})}),Lr=Object(V.a)(qr,2),Ur=Lr[0],Wr=Lr[1],Br=Object(M.useState)(0),Ir=Object(V.a)(Br,2),pr=Ir[0],na=Ir[1],ni=Object(M.useState)(0),La=Object(V.a)(ni,2),ya=La[0],ea=La[1],Vr=Object(M.useState)(0),Yr=Object(V.a)(Vr,2),ia=Yr[0],Ha=Yr[1],mi=Object(M.useState)(0),si=Object(V.a)(mi,2),Hr=si[0],Va=si[1],ri=Object(M.useState)(null),Jr=Object(V.a)(ri,2),jr=Jr[0],Ea=Jr[1],Si=Object(M.useState)(null),Fi=Object(V.a)(Si,2),Ma=Fi[0],Ya=Fi[1],Qa=Object(M.useState)(0),Ei=Object(V.a)(Qa,2),Ri=Ei[0],Bi=Ei[1],io=Object(M.useState)(0),Ii=Object(V.a)(io,2),Vn=Ii[0],Pn=Ii[1],tr=o(new Map),ra=Object(V.a)(tr,2),Cr=ra[0],Oa=ra[1],ki=i(Oe,Cr,pr),Ni="".concat(ce,"-nav-operations-hidden"),Ai=0,Wa=0;Ln?pt?(Ai=0,Wa=Math.max(0,pr-jr)):(Ai=Math.min(0,jr-pr),Wa=0):(Ai=Math.min(0,Ma-ya),Wa=0);function xi(Xr){return Xr<Ai?[Ai,!1]:Xr>Wa?[Wa,!1]:[Xr,!0]}var Ci=Object(M.useRef)(),Di=Object(M.useState)(),wi=Object(V.a)(Di,2),Qi=wi[0],Zi=wi[1];function qi(){Zi(Date.now())}function Hi(){window.clearTimeout(Ci.current)}Zn(br,function(Xr,kr){var ga=!1;function Xa(Ui,yi){Ui(function(zi){var bi=xi(zi+yi),Aa=Object(V.a)(bi,2),Gi=Aa[0],Vi=Aa[1];return ga=Vi,Gi})}if(Ln){if(jr>=pr)return ga;Xa(Ar,Xr)}else{if(Ma>=ya)return ga;Xa(Wr,kr)}return Hi(),qi(),ga}),Object(M.useEffect)(function(){return Hi(),Qi&&(Ci.current=window.setTimeout(function(){Zi(0)},100)),Hi},[Qi]);function _i(){var Xr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Je,kr=ki.get(Xr);if(!kr)return;if(Ln){var ga=Qn;pt?kr.right<Qn?ga=kr.right:kr.right+kr.width>Qn+jr&&(ga=kr.right+kr.width-jr):kr.left<-Qn?ga=-kr.left:kr.left+kr.width>-Qn+jr&&(ga=-(kr.left+kr.width-jr)),Wr(0),Ar(xi(ga)[0])}else{var Xa=Ur;kr.top<-Ur?Xa=-kr.top:kr.top+kr.height>-Ur+Ma&&(Xa=-(kr.top+kr.height-Ma)),Ar(0),Wr(xi(Xa)[0])}}var Pi=w(ki,{width:jr,height:Ma,left:Qn,top:Ur},{width:ia,height:Hr},{width:Ri,height:Vn},Object(G.a)(Object(G.a)({},Me),{},{tabs:Oe})),oo=Object(V.a)(Pi,2),Ao=oo[0],Do=oo[1],po=Oe.map(function(Xr){var kr=Xr.key;return M.createElement(u,{id:Ge,prefixCls:ce,key:kr,rtl:pt,tab:Xr,closable:Xr.closable,editable:tn,active:kr===Je,tabPosition:Tn,tabBarGutter:Kn,renderWrapper:fr,removeAriaLabel:fn==null?void 0:fn.removeAriaLabel,ref:or(kr),onClick:function(Xa){lr(kr,Xa)},onRemove:function(){pn(kr)},onFocus:function(){_i(kr),qi(),pt||(br.current.scrollLeft=0),br.current.scrollTop=0}})}),so=l(function(){var Xr,kr,ga,Xa,Ui,yi,zi,bi,Aa,Gi=((Xr=br.current)===null||Xr===void 0?void 0:Xr.offsetWidth)||0,Vi=((kr=br.current)===null||kr===void 0?void 0:kr.offsetHeight)||0,Yi=((ga=Rr.current)===null||ga===void 0?void 0:ga.offsetWidth)||0,qa=((Xa=Rr.current)===null||Xa===void 0?void 0:Xa.offsetHeight)||0,zr=((Ui=Er.current)===null||Ui===void 0?void 0:Ui.offsetWidth)||0,Or=((yi=Er.current)===null||yi===void 0?void 0:yi.offsetHeight)||0;Ea(Gi),Ya(Vi),Bi(Yi),Pn(qa);var Bn=(((zi=vr.current)===null||zi===void 0?void 0:zi.offsetWidth)||0)-Yi,ur=(((bi=vr.current)===null||bi===void 0?void 0:bi.offsetHeight)||0)-qa;na(Bn),ea(ur);var Mr=(Aa=Er.current)===null||Aa===void 0?void 0:Aa.className.includes(Ni);Ha(Bn-(Mr?0:zr)),Va(ur-(Mr?0:Or)),Oa(function(){var fa=new Map;return Oe.forEach(function(Ti){var gi=Ti.key,ja=or(gi).current;ja&&fa.set(gi,{width:ja.offsetWidth,height:ja.offsetHeight,left:ja.offsetLeft,top:ja.offsetTop})}),fa})}),mo=Oe.slice(0,Ao),Za=Oe.slice(Do+1),xa=[].concat(Object(A.a)(mo),Object(A.a)(Za)),Ua=Object(M.useState)(),Ca=Object(V.a)(Ua,2),Wi=Ca[0],go=Ca[1],ci=ki.get(Je),lo=Object(M.useRef)();function uo(){f.a.cancel(lo.current)}Object(M.useEffect)(function(){var Xr={};return ci&&(Ln?(pt?Xr.right=ci.right:Xr.left=ci.left,Xr.width=ci.width):(Xr.top=ci.top,Xr.height=ci.height)),uo(),lo.current=f()(function(){go(Xr)}),uo},[ci,Ln,pt]),Object(M.useEffect)(function(){_i()},[Je,ci,ki,Ln]),Object(M.useEffect)(function(){so()},[pt,Kn,Je,Oe.map(function(Xr){return Xr.key}).join("_")]);var co=!!xa.length,Li="".concat(ce,"-nav-wrap"),eo,Ki,vo,to;return Ln?pt?(Ki=Qn>0,eo=Qn+jr<pr):(eo=Qn<0,Ki=-Qn+jr<pr):(vo=Ur<0,to=-Ur+Ma<ya),M.createElement("div",{ref:tt,role:"tablist",className:W()("".concat(ce,"-nav"),me),style:ke,onKeyDown:function(){qi()}},M.createElement(Tr,{position:"left",extra:Nt,prefixCls:ce}),M.createElement(p.a,{onResize:so},M.createElement("div",{className:W()(Li,(ot={},Object(Z.a)(ot,"".concat(Li,"-ping-left"),eo),Object(Z.a)(ot,"".concat(Li,"-ping-right"),Ki),Object(Z.a)(ot,"".concat(Li,"-ping-top"),vo),Object(Z.a)(ot,"".concat(Li,"-ping-bottom"),to),ot)),ref:br},M.createElement(p.a,{onResize:so},M.createElement("div",{ref:vr,className:"".concat(ce,"-nav-list"),style:{transform:"translate(".concat(Qn,"px, ").concat(Ur,"px)"),transition:Qi?"none":void 0}},po,M.createElement(an,{ref:Rr,prefixCls:ce,locale:fn,editable:tn,style:{visibility:co?"hidden":null}}),M.createElement("div",{className:W()("".concat(ce,"-ink-bar"),Object(Z.a)({},"".concat(ce,"-ink-bar-animated"),ut.inkBar)),style:Wi}))))),M.createElement(Gn,Object.assign({},Me,{ref:Er,prefixCls:ce,tabs:xa,className:!co&&Ni})),M.createElement(Tr,{position:"right",extra:Nt,prefixCls:ce}))}var Yn=M.forwardRef($n);function $r(Me){var tt=Me.id,ot=Me.activeKey,je=Me.animated,ce=Me.tabPosition,Oe=Me.rtl,me=Me.destroyInactiveTabPane,ke=M.useContext(mn),Ge=ke.prefixCls,ut=ke.tabs,Je=je.tabPane,pt=ut.findIndex(function(Nt){return Nt.key===ot});return M.createElement("div",{className:W()("".concat(Ge,"-content-holder"))},M.createElement("div",{className:W()("".concat(Ge,"-content"),"".concat(Ge,"-content-").concat(ce),Object(Z.a)({},"".concat(Ge,"-content-animated"),Je)),style:pt&&Je?Object(Z.a)({},Oe?"marginRight":"marginLeft","-".concat(pt,"00%")):null},ut.map(function(Nt){return M.cloneElement(Nt.node,{key:Nt.key,prefixCls:Ge,tabKey:Nt.key,id:tt,animated:Je,active:Nt.key===ot,destroyInactiveTabPane:me})})))}function Gr(Me){var tt=Me.prefixCls,ot=Me.forceRender,je=Me.className,ce=Me.style,Oe=Me.id,me=Me.active,ke=Me.animated,Ge=Me.destroyInactiveTabPane,ut=Me.tabKey,Je=Me.children,pt=M.useState(ot),Nt=Object(V.a)(pt,2),tn=Nt[0],fn=Nt[1];M.useEffect(function(){me?fn(!0):Ge&&fn(!1)},[me,Ge]);var Tn={};return me||(ke?(Tn.visibility="hidden",Tn.height=0,Tn.overflowY="hidden"):Tn.display="none"),M.createElement("div",{id:Oe&&"".concat(Oe,"-panel-").concat(ut),role:"tabpanel",tabIndex:me?0:-1,"aria-labelledby":Oe&&"".concat(Oe,"-tab-").concat(ut),"aria-hidden":!me,style:Object(G.a)(Object(G.a)({},Tn),ce),className:W()("".concat(tt,"-tabpane"),me&&"".concat(tt,"-tabpane-active"),je)},(me||tn||ot)&&Je)}var aa=0;function Ta(Me){return Object(C.a)(Me).map(function(tt){if(M.isValidElement(tt)){var ot=tt.key!==void 0?String(tt.key):void 0;return Object(G.a)(Object(G.a)({key:ot},tt.props),{},{node:tt})}return null}).filter(function(tt){return tt})}function Ra(Me,tt){var ot,je=Me.id,ce=Me.prefixCls,Oe=ce===void 0?"rc-tabs":ce,me=Me.className,ke=Me.children,Ge=Me.direction,ut=Me.activeKey,Je=Me.defaultActiveKey,pt=Me.editable,Nt=Me.animated,tn=Me.tabPosition,fn=tn===void 0?"top":tn,Tn=Me.tabBarGutter,Kn=Me.tabBarStyle,fr=Me.tabBarExtraContent,lr=Me.locale,yr=Me.moreIcon,br=Me.moreTransitionName,vr=Me.destroyInactiveTabPane,Er=Me.renderTabBar,Rr=Me.onChange,hr=Me.onTabClick,Nr=Me.onTabScroll,or=Object(j.a)(Me,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),pn=Ta(ke),Ln=Ge==="rtl",xr;Nt===!1?xr={inkBar:!1,tabPane:!1}:xr=Object(G.a)({inkBar:!0,tabPane:!1},Nt!==!0?Nt:null);var Dr=Object(M.useState)(!1),Qn=Object(V.a)(Dr,2),Ar=Qn[0],qr=Qn[1];Object(M.useEffect)(function(){qr(ln())},[]);var Lr=Object(r.a)(function(){var Hr;return(Hr=pn[0])===null||Hr===void 0?void 0:Hr.key},{value:ut,defaultValue:Je}),Ur=Object(V.a)(Lr,2),Wr=Ur[0],Br=Ur[1],Ir=Object(M.useState)(function(){return pn.findIndex(function(Hr){return Hr.key===Wr})}),pr=Object(V.a)(Ir,2),na=pr[0],ni=pr[1];Object(M.useEffect)(function(){var Hr=pn.findIndex(function(ri){return ri.key===Wr});if(Hr===-1){var Va;Hr=Math.max(0,Math.min(na,pn.length-1)),Br((Va=pn[Hr])===null||Va===void 0?void 0:Va.key)}ni(Hr)},[pn.map(function(Hr){return Hr.key}).join("_"),Wr,na]);var La=Object(r.a)(null,{value:je}),ya=Object(V.a)(La,2),ea=ya[0],Vr=ya[1],Yr=fn;Ar&&!["left","right"].includes(fn)&&(Yr="top"),Object(M.useEffect)(function(){je||(Vr("rc-tabs-".concat(aa)),aa+=1)},[]);function ia(Hr,Va){hr==null||hr(Hr,Va),Br(Hr),Rr==null||Rr(Hr)}var Ha={id:ea,activeKey:Wr,animated:xr,tabPosition:Yr,rtl:Ln,mobile:Ar},mi,si=Object(G.a)(Object(G.a)({},Ha),{},{editable:pt,locale:lr,moreIcon:yr,moreTransitionName:br,tabBarGutter:Tn,onTabClick:ia,onTabScroll:Nr,extra:fr,style:Kn,panes:ke});return Er?mi=Er(si,Yn):mi=M.createElement(Yn,Object.assign({},si)),M.createElement(mn.Provider,{value:{tabs:pn,prefixCls:Oe}},M.createElement("div",Object.assign({ref:tt,id:je,className:W()(Oe,"".concat(Oe,"-").concat(Yr),(ot={},Object(Z.a)(ot,"".concat(Oe,"-mobile"),Ar),Object(Z.a)(ot,"".concat(Oe,"-editable"),pt),Object(Z.a)(ot,"".concat(Oe,"-rtl"),Ln),ot),me)},or),mi,M.createElement($r,Object.assign({destroyInactiveTabPane:vr},Ha,{animated:xr}))))}var ha=M.forwardRef(Ra);ha.TabPane=Gr;var _a=ha,ta=ve.b=_a},kSUc:function(Bt,ve,T){},"kVK+":function(Bt,ve){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ve.read=function(T,Z,V,j,G){var M,I,W=G*8-j-1,C=(1<<W)-1,r=C>>1,A=-7,v=V?G-1:0,f=V?-1:1,p=T[Z+v];for(v+=f,M=p&(1<<-A)-1,p>>=-A,A+=W;A>0;M=M*256+T[Z+v],v+=f,A-=8);for(I=M&(1<<-A)-1,M>>=-A,A+=j;A>0;I=I*256+T[Z+v],v+=f,A-=8);if(M===0)M=1-r;else{if(M===C)return I?NaN:(p?-1:1)*Infinity;I=I+Math.pow(2,j),M=M-r}return(p?-1:1)*I*Math.pow(2,M-j)},ve.write=function(T,Z,V,j,G,M){var I,W,C,r=M*8-G-1,A=(1<<r)-1,v=A>>1,f=G===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=j?0:M-1,l=j?1:-1,o=Z<0||Z===0&&1/Z<0?1:0;for(Z=Math.abs(Z),isNaN(Z)||Z===Infinity?(W=isNaN(Z)?1:0,I=A):(I=Math.floor(Math.log(Z)/Math.LN2),Z*(C=Math.pow(2,-I))<1&&(I--,C*=2),I+v>=1?Z+=f/C:Z+=f*Math.pow(2,1-v),Z*C>=2&&(I++,C/=2),I+v>=A?(W=0,I=A):I+v>=1?(W=(Z*C-1)*Math.pow(2,G),I=I+v):(W=Z*Math.pow(2,v-1)*Math.pow(2,G),I=0));G>=8;T[V+p]=W&255,p+=l,W/=256,G-=8);for(I=I<<G|W,r+=G;r>0;T[V+p]=I&255,p+=l,I/=256,r-=8);T[V+p-l]|=o*128}},lZu9:function(Bt,ve,T){(function(Z){Z(T("VrN/"),T("1eCo"),T("8EBN"))})(function(Z){"use strict";Z.defineMode("markdown",function(V,j){var G=Z.getMode(V,"text/html"),M=G.name=="null";function I(k){if(Z.findModeByName){var d=Z.findModeByName(k);d&&(k=d.mime||d.mimes[0])}var z=Z.getMode(V,k);return z.name=="null"?null:z}j.highlightFormatting===void 0&&(j.highlightFormatting=!1),j.maxBlockquoteDepth===void 0&&(j.maxBlockquoteDepth=0),j.taskLists===void 0&&(j.taskLists=!1),j.strikethrough===void 0&&(j.strikethrough=!1),j.emoji===void 0&&(j.emoji=!1),j.fencedCodeBlockHighlighting===void 0&&(j.fencedCodeBlockHighlighting=!0),j.fencedCodeBlockDefaultMode===void 0&&(j.fencedCodeBlockDefaultMode="text/plain"),j.xml===void 0&&(j.xml=!0),j.tokenTypeOverrides===void 0&&(j.tokenTypeOverrides={});var W={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 C in W)W.hasOwnProperty(C)&&j.tokenTypeOverrides[C]&&(W[C]=j.tokenTypeOverrides[C]);var r=/^([*\-_])(?:\s*\1){2,}\s*$/,A=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,v=/^\[(x| )\](?=\s)/i,f=j.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,p=/^ {0,3}(?:\={1,}|-{2,})\s*$/,l=/^[^#!\[\]*_\\<>` "'(~:]+/,o=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,s=/^\s*\[[^\]]+?\]:.*$/,t=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,u=" ";function a(k,d,z){return d.f=d.inline=z,z(k,d)}function i(k,d,z){return d.f=d.block=z,z(k,d)}function D(k){return!k||!/\S/.test(k.string)}function w(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==L){var d=M;if(!d){var z=Z.innerMode(G,k.htmlState);d=z.mode.name=="xml"&&z.state.tagStart===null&&!z.state.context&&z.state.tokenize.isInText}d&&(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,d){var z=k.column()===d.indentation,Y=D(d.prevLine.stream),re=d.indentedCode,le=d.prevLine.hr,Ne=d.list!==!1,Ce=(d.listStack[d.listStack.length-1]||0)+3;d.indentedCode=!1;var Te=d.indentation;if(d.indentationDiff===null&&(d.indentationDiff=d.indentation,Ne)){for(d.list=null;Te<d.listStack[d.listStack.length-1];)d.listStack.pop(),d.listStack.length?d.indentation=d.listStack[d.listStack.length-1]:d.list=!1;d.list!==!1&&(d.indentationDiff=Te-d.listStack[d.listStack.length-1])}var Fe=!Y&&!le&&!d.prevLine.header&&(!Ne||!re)&&!d.prevLine.fencedCodeEnd,Ve=(d.list===!1||le||Y)&&d.indentation<=Ce&&k.match(r),xe=null;if(d.indentationDiff>=4&&(re||d.prevLine.fencedCodeEnd||d.prevLine.header||Y))return k.skipToEnd(),d.indentedCode=!0,W.code;if(k.eatSpace())return null;if(z&&d.indentation<=Ce&&(xe=k.match(f))&&xe[1].length<=6)return d.quote=0,d.header=xe[1].length,d.thisLine.header=!0,j.highlightFormatting&&(d.formatting="header"),d.f=d.inline,_(d);if(d.indentation<=Ce&&k.eat(">"))return d.quote=z?1:d.quote+1,j.highlightFormatting&&(d.formatting="quote"),k.eatSpace(),_(d);if(!Ve&&!d.setext&&z&&d.indentation<=Ce&&(xe=k.match(A))){var ye=xe[1]?"ol":"ul";return d.indentation=Te+k.current().length,d.list=!0,d.quote=0,d.listStack.push(d.indentation),d.em=!1,d.strong=!1,d.code=!1,d.strikethrough=!1,j.taskLists&&k.match(v,!1)&&(d.taskList=!0),d.f=d.inline,j.highlightFormatting&&(d.formatting=["list","list-"+ye]),_(d)}else{if(z&&d.indentation<=Ce&&(xe=k.match(o,!0)))return d.quote=0,d.fencedEndRE=new RegExp(xe[1]+"+ *$"),d.localMode=j.fencedCodeBlockHighlighting&&I(xe[2]||j.fencedCodeBlockDefaultMode),d.localMode&&(d.localState=Z.startState(d.localMode)),d.f=d.block=P,j.highlightFormatting&&(d.formatting="code-block"),d.code=-1,_(d);if(d.setext||(!Fe||!Ne)&&!d.quote&&d.list===!1&&!d.code&&!Ve&&!s.test(k.string)&&(xe=k.lookAhead(1))&&(xe=xe.match(p)))return d.setext?(d.header=d.setext,d.setext=0,k.skipToEnd(),j.highlightFormatting&&(d.formatting="header")):(d.header=xe[0].charAt(0)=="="?1:2,d.setext=d.header),d.thisLine.header=!0,d.f=d.inline,_(d);if(Ve)return k.skipToEnd(),d.hr=!0,d.thisLine.hr=!0,W.hr;if(k.peek()==="[")return a(k,d,H)}return a(k,d,d.inline)}function L(k,d){var z=G.token(k,d.htmlState);if(!M){var Y=Z.innerMode(G,d.htmlState);(Y.mode.name=="xml"&&Y.state.tagStart===null&&!Y.state.context&&Y.state.tokenize.isInText||d.md_inside&&k.current().indexOf(">")>-1)&&(d.f=g,d.block=S,d.htmlState=null)}return z}function P(k,d){var z=d.listStack[d.listStack.length-1]||0,Y=d.indentation<z,re=z+3;if(d.fencedEndRE&&d.indentation<=re&&(Y||k.match(d.fencedEndRE))){j.highlightFormatting&&(d.formatting="code-block");var le;return Y||(le=_(d)),d.localMode=d.localState=null,d.block=S,d.f=g,d.fencedEndRE=null,d.code=0,d.thisLine.fencedCodeEnd=!0,Y?i(k,d,d.block):le}else return d.localMode?d.localMode.token(k,d.localState):(k.skipToEnd(),W.code)}function _(k){var d=[];if(k.formatting){d.push(W.formatting),typeof k.formatting=="string"&&(k.formatting=[k.formatting]);for(var z=0;z<k.formatting.length;z++)d.push(W.formatting+"-"+k.formatting[z]),k.formatting[z]==="header"&&d.push(W.formatting+"-"+k.formatting[z]+"-"+k.header),k.formatting[z]==="quote"&&(!j.maxBlockquoteDepth||j.maxBlockquoteDepth>=k.quote?d.push(W.formatting+"-"+k.formatting[z]+"-"+k.quote):d.push("error"))}if(k.taskOpen)return d.push("meta"),d.length?d.join(" "):null;if(k.taskClosed)return d.push("property"),d.length?d.join(" "):null;if(k.linkHref?d.push(W.linkHref,"url"):(k.strong&&d.push(W.strong),k.em&&d.push(W.em),k.strikethrough&&d.push(W.strikethrough),k.emoji&&d.push(W.emoji),k.linkText&&d.push(W.linkText),k.code&&d.push(W.code),k.image&&d.push(W.image),k.imageAltText&&d.push(W.imageAltText,"link"),k.imageMarker&&d.push(W.imageMarker)),k.header&&d.push(W.header,W.header+"-"+k.header),k.quote&&(d.push(W.quote),!j.maxBlockquoteDepth||j.maxBlockquoteDepth>=k.quote?d.push(W.quote+"-"+k.quote):d.push(W.quote+"-"+j.maxBlockquoteDepth)),k.list!==!1){var Y=(k.listStack.length-1)%3;Y?Y===1?d.push(W.list2):d.push(W.list3):d.push(W.list1)}return k.trailingSpaceNewLine?d.push("trailing-space-new-line"):k.trailingSpace&&d.push("trailing-space-"+(k.trailingSpace%2?"a":"b")),d.length?d.join(" "):null}function b(k,d){return k.match(l,!0)?_(d):void 0}function g(k,d){var z=d.text(k,d);if(typeof z!="undefined")return z;if(d.list)return d.list=null,_(d);if(d.taskList){var Y=k.match(v,!0)[1]===" ";return Y?d.taskOpen=!0:d.taskClosed=!0,j.highlightFormatting&&(d.formatting="task"),d.taskList=!1,_(d)}if(d.taskOpen=!1,d.taskClosed=!1,d.header&&k.match(/^#+$/,!0))return j.highlightFormatting&&(d.formatting="header"),_(d);var re=k.next();if(d.linkTitle){d.linkTitle=!1;var le=re;re==="("&&(le=")"),le=(le+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ne="^\\s*(?:[^"+le+"\\\\]+|\\\\\\\\|\\\\.)"+le;if(k.match(new RegExp(Ne),!0))return W.linkHref}if(re==="`"){var Ce=d.formatting;j.highlightFormatting&&(d.formatting="code"),k.eatWhile("`");var Te=k.current().length;if(d.code==0&&(!d.quote||Te==1))return d.code=Te,_(d);if(Te==d.code){var Fe=_(d);return d.code=0,Fe}else return d.formatting=Ce,_(d)}else if(d.code)return _(d);if(re==="\\"&&(k.next(),j.highlightFormatting)){var Ve=_(d),xe=W.formatting+"-escape";return Ve?Ve+" "+xe:xe}if(re==="!"&&k.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return d.imageMarker=!0,d.image=!0,j.highlightFormatting&&(d.formatting="image"),_(d);if(re==="["&&d.imageMarker&&k.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return d.imageMarker=!1,d.imageAltText=!0,j.highlightFormatting&&(d.formatting="image"),_(d);if(re==="]"&&d.imageAltText){j.highlightFormatting&&(d.formatting="image");var Ve=_(d);return d.imageAltText=!1,d.image=!1,d.inline=d.f=y,Ve}if(re==="["&&!d.image)return d.linkText&&k.match(/^.*?\]/)||(d.linkText=!0,j.highlightFormatting&&(d.formatting="link")),_(d);if(re==="]"&&d.linkText){j.highlightFormatting&&(d.formatting="link");var Ve=_(d);return d.linkText=!1,d.inline=d.f=k.match(/\(.*?\)| ?\[.*?\]/,!1)?y:g,Ve}if(re==="<"&&k.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=m,j.highlightFormatting&&(d.formatting="link");var Ve=_(d);return Ve?Ve+=" ":Ve="",Ve+W.linkInline}if(re==="<"&&k.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=m,j.highlightFormatting&&(d.formatting="link");var Ve=_(d);return Ve?Ve+=" ":Ve="",Ve+W.linkEmail}if(j.xml&&re==="<"&&k.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ye=k.string.indexOf(">",k.pos);if(ye!=-1){var oe=k.string.substring(k.start,ye);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(oe)&&(d.md_inside=!0)}return k.backUp(1),d.htmlState=Z.startState(G),i(k,d,L)}if(j.xml&&re==="<"&&k.match(/^\/\w*?>/))return d.md_inside=!1,"tag";if(re==="*"||re==="_"){for(var Se=1,_e=k.pos==1?" ":k.string.charAt(k.pos-2);Se<3&&k.eat(re);)Se++;var He=k.peek()||" ",rt=!/\s/.test(He)&&(!t.test(He)||/\s/.test(_e)||t.test(_e)),ae=!/\s/.test(_e)&&(!t.test(_e)||/\s/.test(He)||t.test(He)),$=null,Q=null;if(Se%2&&(!d.em&&rt&&(re==="*"||!ae||t.test(_e))?$=!0:d.em==re&&ae&&(re==="*"||!rt||t.test(He))&&($=!1)),Se>1&&(!d.strong&&rt&&(re==="*"||!ae||t.test(_e))?Q=!0:d.strong==re&&ae&&(re==="*"||!rt||t.test(He))&&(Q=!1)),Q!=null||$!=null){j.highlightFormatting&&(d.formatting=$==null?"strong":Q==null?"em":"strong em"),$===!0&&(d.em=re),Q===!0&&(d.strong=re);var Fe=_(d);return $===!1&&(d.em=!1),Q===!1&&(d.strong=!1),Fe}}else if(re===" "&&(k.eat("*")||k.eat("_"))){if(k.peek()===" ")return _(d);k.backUp(1)}if(j.strikethrough){if(re==="~"&&k.eatWhile(re)){if(d.strikethrough){j.highlightFormatting&&(d.formatting="strikethrough");var Fe=_(d);return d.strikethrough=!1,Fe}else if(k.match(/^[^\s]/,!1))return d.strikethrough=!0,j.highlightFormatting&&(d.formatting="strikethrough"),_(d)}else if(re===" "&&k.match(/^~~/,!0)){if(k.peek()===" ")return _(d);k.backUp(2)}}if(j.emoji&&re===":"&&k.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){d.emoji=!0,j.highlightFormatting&&(d.formatting="emoji");var te=_(d);return d.emoji=!1,te}return re===" "&&(k.match(/^ +$/,!1)?d.trailingSpace++:d.trailingSpace&&(d.trailingSpaceNewLine=!0)),_(d)}function m(k,d){var z=k.next();if(z===">"){d.f=d.inline=g,j.highlightFormatting&&(d.formatting="link");var Y=_(d);return Y?Y+=" ":Y="",Y+W.linkInline}return k.match(/^[^>]+/,!0),W.linkInline}function y(k,d){if(k.eatSpace())return null;var z=k.next();return z==="("||z==="["?(d.f=d.inline=O(z==="("?")":"]"),j.highlightFormatting&&(d.formatting="link-string"),d.linkHref=!0,_(d)):"error"}var x={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function O(k){return function(d,z){var Y=d.next();if(Y===k){z.f=z.inline=g,j.highlightFormatting&&(z.formatting="link-string");var re=_(z);return z.linkHref=!1,re}return d.match(x[k]),z.linkHref=!0,_(z)}}function H(k,d){return k.match(/^([^\]\\]|\\.)*\]:/,!1)?(d.f=F,k.next(),j.highlightFormatting&&(d.formatting="link"),d.linkText=!0,_(d)):a(k,d,g)}function F(k,d){if(k.match(/^\]:/,!0)){d.f=d.inline=R,j.highlightFormatting&&(d.formatting="link");var z=_(d);return d.linkText=!1,z}return k.match(/^([^\]\\]|\\.)+/,!0),W.linkText}function R(k,d){return k.eatSpace()?null:(k.match(/^[^\s]+/,!0),k.peek()===void 0?d.linkTitle=!0:k.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),d.f=d.inline=g,W.linkHref+" url")}var U={startState:function(){return{f:S,prevLine:{stream:null},thisLine:{stream:null},block:S,htmlState:null,indentation:0,inline:g,text:b,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&&Z.copyState(G,k.htmlState),indentation:k.indentation,localMode:k.localMode,localState:k.localMode?Z.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,d){if(d.formatting=!1,k!=d.thisLine.stream){if(d.header=0,d.hr=!1,k.match(/^\s*$/,!0))return w(d),null;if(d.prevLine=d.thisLine,d.thisLine={stream:k},d.taskList=!1,d.trailingSpace=0,d.trailingSpaceNewLine=!1,!d.localState&&(d.f=d.block,d.f!=L)){var z=k.match(/^\s*/,!0)[0].replace(/\t/g,u).length;if(d.indentation=z,d.indentationDiff=null,z>0)return null}}return d.f(k,d)},innerMode:function(k){return k.block==L?{state:k.htmlState,mode:G}:k.localState?{state:k.localState,mode:k.localMode}:{state:k,mode:U}},indent:function(k,d,z){return k.block==L&&G.indent?G.indent(k.htmlState,d,z):k.localState&&k.localMode.indent?k.localMode.indent(k.localState,d,z):Z.Pass},blankLine:w,getType:_,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return U},"xml"),Z.defineMIME("text/markdown","markdown"),Z.defineMIME("text/x-markdown","markdown")})},mgmH:function(Bt,ve,T){"use strict";T.d(ve,"d",function(){return p}),T.d(ve,"b",function(){return l}),T.d(ve,"e",function(){return o}),T.d(ve,"c",function(){return s}),T.d(ve,"n",function(){return t}),T.d(ve,"g",function(){return u}),T.d(ve,"h",function(){return a}),T.d(ve,"j",function(){return D}),T.d(ve,"a",function(){return w}),T.d(ve,"l",function(){return S}),T.d(ve,"f",function(){return L}),T.d(ve,"k",function(){return P}),T.d(ve,"m",function(){return _}),T.d(ve,"i",function(){return b}),T.d(ve,"o",function(){return g}),T.d(ve,"t",function(){return m}),T.d(ve,"s",function(){return y}),T.d(ve,"p",function(){return x}),T.d(ve,"q",function(){return O}),T.d(ve,"r",function(){return H}),T.d(ve,"v",function(){return F}),T.d(ve,"u",function(){return R});var Z=T("miYZ"),V=T("tsqr"),j=T("k1fw"),G=T("9og8"),M=T("WmNS"),I=T.n(M),W=T("oUNq"),C=T("9kvl"),r=T("1vsH"),A=T("m3rI"),v=function(){Object(C.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u751F\u6210\u6587\u4EF6\uFF0C\u8BF7\u7A0D\u540E..."}})},f=function(){Object(C.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}})},p=function(){var U=Object(G.a)(I.a.mark(function k(d){var z;return I.a.wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return v(),re.next=3,Object(W.t)(Object(j.a)({},d));case 3:if(z=re.sent,!(z.status===0)){re.next=7;break}return re.next=7,Object(r.w)("",Object(r.Y)({url:A.a.API_SERVER+"/api/courses/".concat(d.coursesId,"/export_couser_info.json"),query:d}));case 7:f();case 8:case"end":return re.stop()}},k)}));return function(d){return U.apply(this,arguments)}}(),l=function(){var U=Object(G.a)(I.a.mark(function k(d){var z;return I.a.wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return re.next=2,Object(W.r)(Object(j.a)({},d));case 2:if(z=re.sent,!(z.status===0)){re.next=8;break}V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),C.d.push("/classrooms/".concat(d.coursesId,"/exportlist/course_member_act_score")),re.next=13;break;case 8:if(!(z.status===-2)){re.next=12;break}return re.abrupt("return",z);case 12:z.status===-3&&(Object(C.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),C.d.push("/classrooms/".concat(d.coursesId,"/exportlist/course_member_act_score")));case 13:case"end":return re.stop()}},k)}));return function(d){return U.apply(this,arguments)}}(),o=function(){var U=Object(G.a)(I.a.mark(function k(d){var z;return I.a.wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return re.next=2,Object(W.u)(Object(j.a)({},d));case 2:if(z=re.sent,!(z.status===0)){re.next=8;break}V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),C.d.push("/classrooms/".concat(d.coursesId,"/exportlist/course_total_score")),re.next=13;break;case 8:if(!(z.status===-2)){re.next=12;break}return re.abrupt("return",z);case 12:z.status===-3&&(Object(C.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),C.d.push("/classrooms/".concat(d.coursesId,"/exportlist/course_total_score")));case 13:case"end":return re.stop()}},k)}));return function(d){return U.apply(this,arguments)}}(),s=function(){var U=Object(G.a)(I.a.mark(function k(d){var z;return I.a.wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return re.next=2,Object(W.s)(Object(j.a)({},d));case 2:if(z=re.sent,!(z.status===0)){re.next=8;break}V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),C.d.push("/classrooms/".concat(d.coursesId,"/exportlist/course_total_exercise_and_other")),re.next=13;break;case 8:if(!(z.status===-2)){re.next=12;break}return re.abrupt("return",z);case 12:z.status===-3&&(Object(C.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),C.d.push("/classrooms/".concat(d.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return re.stop()}},k)}));return function(d){return U.apply(this,arguments)}}(),t=function(){var U=Object(G.a)(I.a.mark(function k(d){var z;return I.a.wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return re.next=2,Object(W.z)(Object(j.a)({},d));case 2:if(z=re.sent,!(z.status===0)){re.next=8;break}V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),C.d.push("/classrooms/".concat(d.coursesId,"/exportlist/course_total_exercise_and_other")),re.next=13;break;case 8:if(!(z.status===-2)){re.next=12;break}return re.abrupt("return",z);case 12:z.status===-3&&(Object(C.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),C.d.push("/classrooms/".concat(d.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return re.stop()}},k)}));return function(d){return U.apply(this,arguments)}}(),u=function(){var U=Object(G.a)(I.a.mark(function k(d){var z;return I.a.wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return re.next=2,Object(W.v)(Object(j.a)({},d));case 2:if(z=re.sent,!(z.status===0)){re.next=8;break}V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),C.d.push("/classrooms/".concat(d.coursesId,"/exportlist/course_total_homework")),re.next=13;break;case 8:if(!(z.status===-2)){re.next=12;break}return re.abrupt("return",z);case 12:z.status===-3&&(Object(C.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),C.d.push("/classrooms/".concat(d.coursesId,"/exportlist/course_total_homework")));case 13:case"end":return re.stop()}},k)}));return function(d){return U.apply(this,arguments)}}(),a=function(){var U=Object(G.a)(I.a.mark(function k(d,z){var Y;return I.a.wrap(function(le){for(;;)switch(le.prev=le.next){case 0:return le.next=2,Object(W.x)(Object(j.a)({},d));case 2:Y=le.sent,Y.status===0?(V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),C.d.push("/classrooms/".concat(d.coursesId,"/exportlist/").concat(z))):Y.status===-3&&(Object(C.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),C.d.push("/classrooms/".concat(d.coursesId,"/exportlist/").concat(z)));case 4:case"end":return le.stop()}},k)}));return function(d,z){return U.apply(this,arguments)}}(),i=function(){var U=Object(G.a)(I.a.mark(function k(d){var z;return I.a.wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return v(),re.next=3,Object(W.w)(Object(j.a)({},d));case 3:if(z=re.sent,!(z.status===0)){re.next=7;break}return re.next=7,Object(r.w)("",Object(r.Y)({url:A.a.API_SERVER+"/api/homework_commons/".concat(d.categoryId,"/works_list.zip"),query:d}));case 7:f();case 8:case"end":return re.stop()}},k)}));return function(d){return U.apply(this,arguments)}}(),D=function(){var U=Object(G.a)(I.a.mark(function k(d){var z;return I.a.wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return v(),re.next=3,Object(W.A)(Object(j.a)({},d));case 3:if(z=re.sent,!(z.status===0)){re.next=7;break}return re.next=7,Object(r.w)("",Object(r.Y)({url:A.a.API_SERVER+"/api/polls/".concat(d.categoryId,"/commit_result.xlsx"),query:d}));case 7:f();case 8:case"end":return re.stop()}},k)}));return function(d){return U.apply(this,arguments)}}(),w=function(){var U=Object(G.a)(I.a.mark(function k(d){return I.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(r.v)("",Object(r.Y)({url:A.a.API_SERVER+"/api/courses/".concat(d.coursesId,"/attendances/export_xlsx_data.xlsx"),query:d}));case 2:case"end":return Y.stop()}},k)}));return function(d){return U.apply(this,arguments)}}(),S=function(){var U=Object(G.a)(I.a.mark(function k(d){return I.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(r.v)("",Object(r.Y)({url:A.a.API_SERVER+"/api/courses/".concat(d.coursesId,"/video_study_statics.xlsx"),query:d}));case 2:case"end":return Y.stop()}},k)}));return function(d){return U.apply(this,arguments)}}(),L=function(){var U=Object(G.a)(I.a.mark(function k(d){return I.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(r.v)("",Object(r.Y)({url:A.a.API_SERVER+"/api/courses/".concat(d.coursesId,"/export_course_students_info.xlsx"),query:d}));case 2:case"end":return Y.stop()}},k)}));return function(d){return U.apply(this,arguments)}}(),P=function(){var U=Object(G.a)(I.a.mark(function k(d){return I.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(r.v)("",Object(r.Y)({url:A.a.API_SERVER+"/api/item_banks/export.xlsx",query:d}));case 2:case"end":return Y.stop()}},k)}));return function(d){return U.apply(this,arguments)}}(),_=function(){var U=Object(G.a)(I.a.mark(function k(d){return I.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(r.v)("",Object(r.Y)({url:A.a.API_SERVER+"/api/competitions/region_reports.xlsx",query:d}));case 2:case"end":return Y.stop()}},k)}));return function(d){return U.apply(this,arguments)}}(),b=function(){var U=Object(G.a)(I.a.mark(function k(d){var z;return I.a.wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return re.next=2,Object(W.y)(Object(j.a)({},d));case 2:z=re.sent,z.status===0?(V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),C.d.push("/classrooms/".concat(d.coursesId,"/exportlist/exercise_score"))):z.status===-3&&(Object(C.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),C.d.push("/classrooms/".concat(d.coursesId,"/exportlist/exercise_score")));case 4:case"end":return re.stop()}},k)}));return function(d){return U.apply(this,arguments)}}(),g=function(){var U=Object(G.a)(I.a.mark(function k(d){return I.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return console.log("----------","\u8C03\u7528\u4E0B\u8F7D"),Y.next=3,Object(r.v)("",Object(r.Y)({url:A.a.API_SERVER+"/api/export_records/".concat(d.id,".xlsx"),query:d}));case 3:case"end":return Y.stop()}},k)}));return function(d){return U.apply(this,arguments)}}(),m=function(){var U=Object(G.a)(I.a.mark(function k(d){return I.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(r.v)("",Object(r.Y)({url:A.a.API_SERVER+"/api/ec_major_schools/0/ec_years.xlsx",query:d}));case 2:case"end":return Y.stop()}},k)}));return function(d){return U.apply(this,arguments)}}(),y=function(){var U=Object(G.a)(I.a.mark(function k(d){return I.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(r.v)("",Object(r.Y)({url:A.a.API_SERVER+"/api/ec_years/".concat(d==null?void 0:d.ec_year_id,"/ec_training_objectives.xlsx"),query:d}));case 2:case"end":return Y.stop()}},k)}));return function(d){return U.apply(this,arguments)}}(),x=function(){var U=Object(G.a)(I.a.mark(function k(d){return I.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(r.v)(d==null?void 0:d.name,Object(r.Y)({url:A.a.API_SERVER+"/api/attachments/get_ecs_attachment.docx",query:d}));case 2:case"end":return Y.stop()}},k)}));return function(d){return U.apply(this,arguments)}}(),O=function(){var U=Object(G.a)(I.a.mark(function k(d){return I.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(r.v)("",Object(r.Y)({url:A.a.API_SERVER+"/api/ec_years/".concat(d==null?void 0:d.ec_year_id,"/ec_courses.xlsx"),query:d}));case 2:case"end":return Y.stop()}},k)}));return function(d){return U.apply(this,arguments)}}(),H=function(){var U=Object(G.a)(I.a.mark(function k(d){return I.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(r.v)("",Object(r.Y)({url:A.a.API_SERVER+"/api/ec_years/".concat(d==null?void 0:d.ec_year_id,"/ec_graduation_requirements.xlsx"),query:d}));case 2:case"end":return Y.stop()}},k)}));return function(d){return U.apply(this,arguments)}}(),F=function(){var U=Object(G.a)(I.a.mark(function k(d){return I.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(r.v)("",Object(r.Y)({url:A.a.API_SERVER+"/api/courses/rank_list.xlsx",query:d}));case 2:case"end":return Y.stop()}},k)}));return function(d){return U.apply(this,arguments)}}(),R=function(){var U=Object(G.a)(I.a.mark(function k(d){return I.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Object(r.v)("",Object(r.Y)({url:A.a.API_SERVER+"/api/courses/question_rank_list.xlsx",query:d}));case 2:case"end":return Y.stop()}},k)}));return function(d){return U.apply(this,arguments)}}()},n6Qo:function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return C});var Z=T("q1tI"),V=T("biw7"),j=T("fyJ8");function G(r){var A=r.className,v=r.index,f=r.children,p=r.colSpan,l=r.rowSpan,o=Z.useContext(V.a),s=o.prefixCls,t=o.fixedInfoList,u=t[v];return Z.createElement(j.a,Object.assign({className:A,index:v,component:"td",prefixCls:s,record:null,dataIndex:null,render:function(){return{children:f,props:{colSpan:p,rowSpan:l}}}},u))}function M(r){return Z.createElement("tr",Object.assign({},r))}function I(r){var A=r.children,v=Z.useContext(V.a),f=v.prefixCls;return Z.createElement("tfoot",{className:"".concat(f,"-summary")},A)}var W=ve.b=I,C={Cell:G,Row:M}},nEHx:function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return Z});var Z;(function(V){V.DARK="dark",V.LIGHT="light",V.HIGH_CONTRAST="hc"})(Z||(Z={}))},nnTU:function(Bt,ve,T){"use strict";T.d(ve,"b",function(){return W}),T.d(ve,"a",function(){return C});var Z=T("MI8n"),V=T("JYp7"),j=T("pmY6"),G=T("24hK"),M=T("746U"),I=T("Cg/j");const W=Object(I.c)("commandService"),C=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Z.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 o=[];for(let t of r.description.args)o.push(t.constraint);const s=r.handler;r.handler=function(t,...u){return Object(M.o)(u,o),s(t,...u)}}const{id:v}=r;let f=this._commands.get(v);f||(f=new G.a,this._commands.set(v,f));let p=f.unshift(r),l=Object(j.i)(()=>{p();const o=this._commands.get(v);(o==null?void 0:o.isEmpty())&&this._commands.delete(v)});return this._onDidRegisterCommand.fire(v),l}registerCommandAlias(r,A){return C.registerCommand(r,(v,...f)=>v.get(W).executeCommand(A,...f))}getCommand(r){const A=this._commands.get(r);return!A||A.isEmpty()?void 0:V.a.first(A)}getCommands(){const r=new Map;for(const A of this._commands.keys()){const v=this.getCommand(A);v&&r.set(A,v)}return r}};C.registerCommand("noop",()=>{})},oOBs:function(Bt,ve,T){Bt.exports={leftdiv:"leftdiv___1FhsT",listClass:"listClass___1Y2ac",spantitle:"spantitle___1pL39",rightdiv:"rightdiv___3ZICD"}},ogmK:function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return Wn});var Z=T("1OyB"),V=T("vuIU"),j=T("Ji7U"),G=T("LK+K"),M=T("rePB"),I=T("VTBJ"),W=T("ODXe"),C=T("q1tI"),r=T("TSYQ"),A=T.n(r),v=T("Kwbf"),f=T("6cGi"),p=T("U8pU"),l=T("4IlW"),o=C.createContext({}),s=o,t={visibility:"hidden"};function u(ne){var Re=ne.prefixCls,$e=ne.prevIcon,Be=$e===void 0?"\u2039":$e,Ye=ne.nextIcon,et=Ye===void 0?"\u203A":Ye,it=ne.superPrevIcon,Ae=it===void 0?"\xAB":it,ze=ne.superNextIcon,yt=ze===void 0?"\xBB":ze,en=ne.onSuperPrev,Tt=ne.onSuperNext,vt=ne.onPrev,ct=ne.onNext,St=ne.children,Ut=C.useContext(s),At=Ut.hideNextBtn,on=Ut.hidePrevBtn;return C.createElement("div",{className:Re},en&&C.createElement("button",{type:"button",onClick:en,tabIndex:-1,className:"".concat(Re,"-super-prev-btn"),style:on?t:{}},Ae),vt&&C.createElement("button",{type:"button",onClick:vt,tabIndex:-1,className:"".concat(Re,"-prev-btn"),style:on?t:{}},Be),C.createElement("div",{className:"".concat(Re,"-view")},St),ct&&C.createElement("button",{type:"button",onClick:ct,tabIndex:-1,className:"".concat(Re,"-next-btn"),style:At?t:{}},et),Tt&&C.createElement("button",{type:"button",onClick:Tt,tabIndex:-1,className:"".concat(Re,"-super-next-btn"),style:At?t:{}},yt))}var a=u;function i(ne){var Re=C.useContext(s),$e=Re.hideHeader;if($e)return null;var Be=ne.prefixCls,Ye=ne.generateConfig,et=ne.locale,it=ne.value,Ae=ne.format,ze="".concat(Be,"-header");return C.createElement(a,{prefixCls:ze},it?Ye.locale.format(et.locale,it,Ae):"\xA0")}var D=i,w=T("YrtM"),S=T("KQm4"),L=new Map;function P(ne,Re,$e){if(L.get(ne)&&cancelAnimationFrame(L.get(ne)),$e<=0){L.set(ne,requestAnimationFrame(function(){ne.scrollTop=Re}));return}var Be=Re-ne.scrollTop,Ye=Be/$e*10;L.set(ne,requestAnimationFrame(function(){ne.scrollTop+=Ye,ne.scrollTop!==Re&&P(ne,Re,$e-10)}))}function _(ne,Re){var $e=Re.onLeftRight,Be=Re.onCtrlLeftRight,Ye=Re.onUpDown,et=Re.onPageUpDown,it=Re.onEnter,Ae=ne.which,ze=ne.ctrlKey,yt=ne.metaKey;switch(Ae){case l.a.LEFT:if(ze||yt){if(Be)return Be(-1),!0}else if($e)return $e(-1),!0;break;case l.a.RIGHT:if(ze||yt){if(Be)return Be(1),!0}else if($e)return $e(1),!0;break;case l.a.UP:if(Ye)return Ye(-1),!0;break;case l.a.DOWN:if(Ye)return Ye(1),!0;break;case l.a.PAGE_UP:if(et)return et(-1),!0;break;case l.a.PAGE_DOWN:if(et)return et(1),!0;break;case l.a.ENTER:if(it)return it(),!0;break}return!1}function b(ne,Re,$e,Be){var Ye=ne;if(!Ye)switch(Re){case"time":Ye=Be?"hh:mm:ss a":"HH:mm:ss";break;case"week":Ye="gggg-wo";break;case"month":Ye="YYYY-MM";break;case"quarter":Ye="YYYY-[Q]Q";break;case"year":Ye="YYYY";break;default:Ye=$e?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD"}return Ye}function g(ne,Re){var $e=ne==="time"?8:10;return Math.max($e,Re.length)+2}var m=null,y=new Set;function x(ne){return!m&&typeof window!="undefined"&&window.addEventListener&&(m=function($e){Object(S.a)(y).forEach(function(Be){Be($e)})},window.addEventListener("mousedown",m)),y.add(ne),function(){y.delete(ne),y.size===0&&(window.removeEventListener("mousedown",m),m=null)}}var O=function(Re){return Re==="month"||Re==="date"?"year":Re},H=function(Re){return Re==="date"?"month":Re},F=function(Re){return Re==="month"||Re==="date"?"quarter":Re},R=function(Re){return Re==="date"?"week":Re},U={year:O,month:H,quarter:F,week:R,time:null,date:null};function k(ne,Re){return ne.some(function($e){return $e&&$e.contains(Re)})}function d(ne){var Re=ne.prefixCls,$e=ne.units,Be=ne.onSelect,Ye=ne.value,et=ne.active,it=ne.hideDisabledOptions,Ae="".concat(Re,"-cell"),ze=C.useContext(s),yt=ze.open,en=C.useRef(null),Tt=C.useRef(new Map);return C.useLayoutEffect(function(){var vt=Tt.current.get(Ye);vt&&yt!==!1&&P(en.current,vt.offsetTop,120)},[Ye]),C.useLayoutEffect(function(){if(yt){var vt=Tt.current.get(Ye);vt&&P(en.current,vt.offsetTop,0)}},[yt]),C.createElement("ul",{className:A()("".concat(Re,"-column"),Object(M.a)({},"".concat(Re,"-column-active"),et)),ref:en,style:{position:"relative"}},$e.map(function(vt){var ct;return it&&vt.disabled?null:C.createElement("li",{key:vt.value,ref:function(Ut){Tt.current.set(vt.value,Ut)},className:A()(Ae,(ct={},Object(M.a)(ct,"".concat(Ae,"-disabled"),vt.disabled),Object(M.a)(ct,"".concat(Ae,"-selected"),Ye===vt.value),ct)),onClick:function(){if(vt.disabled)return;Be(vt.value)}},C.createElement("div",{className:"".concat(Ae,"-inner")},vt.label))}))}var z=d;function Y(ne,Re){for(var $e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"0",Be=String(ne);Be.length<Re;)Be="".concat($e).concat(ne);return Be}var re=function(){for(var Re=arguments.length,$e=new Array(Re),Be=0;Be<Re;Be++)$e[Be]=arguments[Be];return $e};function le(ne){return ne==null?[]:Array.isArray(ne)?ne:[ne]}function Ne(ne){var Re={};return Object.keys(ne).forEach(function($e){($e.substr(0,5)==="data-"||$e.substr(0,5)==="aria-"||$e==="role"||$e==="name")&&$e.substr(0,7)!=="data-__"&&(Re[$e]=ne[$e])}),Re}function Ce(ne,Re){return ne?ne[Re]:null}function Te(ne,Re,$e){var Be=[Ce(ne,0),Ce(ne,1)];return Be[$e]=typeof Re=="function"?Re(Be[$e]):Re,!Be[0]&&!Be[1]?null:Be}function Fe(ne,Re,$e,Be,Ye){var et=ne.setHour(Re,$e);return et=ne.setMinute(et,Be),et=ne.setSecond(et,Ye),et}function Ve(ne,Re,$e,Be,Ye,et){var it=Math.floor(ne/Be)*Be;if(it<ne)return[it,60-Ye,60-et];var Ae=Math.floor(Re/Ye)*Ye;if(Ae<Re)return[it,Ae,60-et];var ze=Math.floor($e/et)*et;return[it,Ae,ze]}function xe(ne,Re){if(ne.length!==Re.length)return!0;for(var $e=0;$e<ne.length;$e+=1)if(ne[$e].disabled!==Re[$e].disabled)return!0;return!1}function ye(ne,Re,$e,Be){for(var Ye=[],et=ne;et<=Re;et+=$e)Ye.push({label:Y(et,2),value:et,disabled:(Be||[]).includes(et)});return Ye}function oe(ne){var Re=ne.generateConfig,$e=ne.prefixCls,Be=ne.operationRef,Ye=ne.activeColumnIndex,et=ne.value,it=ne.showHour,Ae=ne.showMinute,ze=ne.showSecond,yt=ne.use12Hours,en=ne.hourStep,Tt=en===void 0?1:en,vt=ne.minuteStep,ct=vt===void 0?1:vt,St=ne.secondStep,Ut=St===void 0?1:St,At=ne.disabledHours,on=ne.disabledMinutes,xn=ne.disabledSeconds,vn=ne.hideDisabledOptions,Qt=ne.onSelect,Dn=[],Rn="".concat($e,"-content"),zt="".concat($e,"-time-panel"),Kt,Cn=et?Re.getHour(et):-1,Zt=et?Re.getMinute(et):-1,Nn=et?Re.getSecond(et):-1,Vt=function(Ht,dn,Xt,ln){var Zn=et||Re.getNow(),qn=Math.max(0,dn),En=Math.max(0,Xt),Tr=Math.max(0,ln);return Zn=Fe(Re,Zn,!yt||!Ht?qn:qn+12,En,Tr),Zn},Un=ye(0,23,Tt,At&&At()),Lt=Object(w.a)(function(){return Un},Un,xe);yt&&(Kt=Cn>=12,Cn%=12);var kt=C.useMemo(function(){if(!yt)return[!1,!1];var Wt=[!0,!0];return Lt.forEach(function(Ht){var dn=Ht.disabled,Xt=Ht.value;if(dn)return;Xt>=12?Wt[1]=!1:Wt[0]=!1}),Wt},[yt,Lt]),sr=Object(W.a)(kt,2),Sn=sr[0],Mn=sr[1],wn=C.useMemo(function(){return yt?Lt.filter(Kt?function(Wt){return Wt.value>=12}:function(Wt){return Wt.value<12}).map(function(Wt){var Ht=Wt.value%12,dn=Ht===0?"12":Y(Ht,2);return Object(I.a)(Object(I.a)({},Wt),{},{label:dn,value:Ht})}):Lt},[yt,Lt]),an=ye(0,59,ct,on&&on(Cn)),Yt=ye(0,59,Ut,xn&&xn(Cn,Zt));Be.current={onUpDown:function(Ht){var dn=Dn[Ye];if(dn)for(var Xt=dn.units.findIndex(function(En){return En.value===dn.value}),ln=dn.units.length,Zn=1;Zn<ln;Zn+=1){var qn=dn.units[(Xt+Ht*Zn+ln)%ln];if(qn.disabled!==!0){dn.onSelect(qn.value);break}}}};function Gn(Wt,Ht,dn,Xt,ln){Wt!==!1&&Dn.push({node:C.cloneElement(Ht,{prefixCls:zt,value:dn,active:Ye===Dn.length,onSelect:ln,units:Xt,hideDisabledOptions:vn}),onSelect:ln,value:dn,units:Xt})}Gn(it,C.createElement(z,{key:"hour"}),Cn,wn,function(Wt){Qt(Vt(Kt,Wt,Zt,Nn),"mouse")}),Gn(Ae,C.createElement(z,{key:"minute"}),Zt,an,function(Wt){Qt(Vt(Kt,Cn,Wt,Nn),"mouse")}),Gn(ze,C.createElement(z,{key:"second"}),Nn,Yt,function(Wt){Qt(Vt(Kt,Cn,Zt,Wt),"mouse")});var mn=-1;return typeof Kt=="boolean"&&(mn=Kt?1:0),Gn(yt===!0,C.createElement(z,{key:"12hours"}),mn,[{label:"AM",value:0,disabled:Sn},{label:"PM",value:1,disabled:Mn}],function(Wt){Qt(Vt(!!Wt,Cn,Zt,Nn),"mouse")}),C.createElement("div",{className:Rn},Dn.map(function(Wt){var Ht=Wt.node;return Ht}))}var Se=oe,_e=function(Re){return Re.filter(function($e){return $e!==!1}).length};function He(ne){var Re=ne.generateConfig,$e=ne.format,Be=$e===void 0?"HH:mm:ss":$e,Ye=ne.prefixCls,et=ne.active,it=ne.operationRef,Ae=ne.showHour,ze=ne.showMinute,yt=ne.showSecond,en=ne.use12Hours,Tt=en===void 0?!1:en,vt=ne.onSelect,ct=ne.value,St="".concat(Ye,"-time-panel"),Ut=C.useRef(),At=C.useState(-1),on=Object(W.a)(At,2),xn=on[0],vn=on[1],Qt=_e([Ae,ze,yt,Tt]);return it.current={onKeyDown:function(Rn){return _(Rn,{onLeftRight:function(Kt){vn((xn+Kt+Qt)%Qt)},onUpDown:function(Kt){xn===-1?vn(0):Ut.current&&Ut.current.onUpDown(Kt)},onEnter:function(){vt(ct||Re.getNow(),"key"),vn(-1)}})},onBlur:function(){vn(-1)}},C.createElement("div",{className:A()(St,Object(M.a)({},"".concat(St,"-active"),et))},C.createElement(D,Object.assign({},ne,{format:Be,prefixCls:Ye})),C.createElement(Se,Object.assign({},ne,{prefixCls:Ye,activeColumnIndex:xn,operationRef:Ut})))}var rt=He,ae=7;function $(ne,Re){return!ne&&!Re?!0:!ne||!Re?!1:void 0}function Q(ne,Re,$e){var Be=$(Re,$e);if(typeof Be=="boolean")return Be;var Ye=Math.floor(ne.getYear(Re)/10),et=Math.floor(ne.getYear($e)/10);return Ye===et}function te(ne,Re,$e){var Be=$(Re,$e);return typeof Be=="boolean"?Be:ne.getYear(Re)===ne.getYear($e)}function he(ne,Re){var $e=Math.floor(ne.getMonth(Re)/3);return $e+1}function ge(ne,Re,$e){var Be=$(Re,$e);return typeof Be=="boolean"?Be:te(ne,Re,$e)&&he(ne,Re)===he(ne,$e)}function we(ne,Re,$e){var Be=$(Re,$e);return typeof Be=="boolean"?Be:te(ne,Re,$e)&&ne.getMonth(Re)===ne.getMonth($e)}function ft(ne,Re,$e){var Be=$(Re,$e);return typeof Be=="boolean"?Be:ne.getYear(Re)===ne.getYear($e)&&ne.getMonth(Re)===ne.getMonth($e)&&ne.getDate(Re)===ne.getDate($e)}function Pt(ne,Re,$e){var Be=$(Re,$e);return typeof Be=="boolean"?Be:ne.getHour(Re)===ne.getHour($e)&&ne.getMinute(Re)===ne.getMinute($e)&&ne.getSecond(Re)===ne.getSecond($e)}function jt(ne,Re,$e,Be){var Ye=$($e,Be);return typeof Ye=="boolean"?Ye:ne.locale.getWeek(Re,$e)===ne.locale.getWeek(Re,Be)}function qe(ne,Re,$e){return ft(ne,Re,$e)&&Pt(ne,Re,$e)}function Mt(ne,Re,$e,Be){return!Re||!$e||!Be?!1:!ft(ne,Re,Be)&&!ft(ne,$e,Be)&&ne.isAfter(Be,Re)&&ne.isAfter($e,Be)}function sn(ne,Re,$e){var Be=Re.locale.getWeekFirstDay(ne),Ye=Re.setDate($e,1),et=Re.getWeekDay(Ye),it=Re.addDate(Ye,Be-et);return Re.getMonth(it)===Re.getMonth($e)&&Re.getDate(it)>1&&(it=Re.addDate(it,-7)),it}function at(ne,Re,$e){var Be=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;switch(Re){case"year":return $e.addYear(ne,Be*10);case"quarter":case"month":return $e.addYear(ne,Be);default:return $e.addMonth(ne,Be)}}var Qe=C.createContext({}),Et=Qe;function It(ne){var Re=ne.cellPrefixCls,$e=ne.generateConfig,Be=ne.rangedValue,Ye=ne.hoverRangedValue,et=ne.isInView,it=ne.isSameCell,Ae=ne.offsetCell,ze=ne.today,yt=ne.value;function en(Tt){var vt,ct=Ae(Tt,-1),St=Ae(Tt,1),Ut=Ce(Be,0),At=Ce(Be,1),on=Ce(Ye,0),xn=Ce(Ye,1),vn=Mt($e,on,xn,Tt);function Qt(Zt){return it(Ut,Zt)}function Dn(Zt){return it(At,Zt)}var Rn=it(on,Tt),zt=it(xn,Tt),Kt=(vn||zt)&&(!et(ct)||Dn(ct)),Cn=(vn||Rn)&&(!et(St)||Qt(St));return vt={},Object(M.a)(vt,"".concat(Re,"-in-view"),et(Tt)),Object(M.a)(vt,"".concat(Re,"-in-range"),Mt($e,Ut,At,Tt)),Object(M.a)(vt,"".concat(Re,"-range-start"),Qt(Tt)),Object(M.a)(vt,"".concat(Re,"-range-end"),Dn(Tt)),Object(M.a)(vt,"".concat(Re,"-range-start-single"),Qt(Tt)&&!At),Object(M.a)(vt,"".concat(Re,"-range-end-single"),Dn(Tt)&&!Ut),Object(M.a)(vt,"".concat(Re,"-range-start-near-hover"),Qt(Tt)&&(it(ct,on)||Mt($e,on,xn,ct))),Object(M.a)(vt,"".concat(Re,"-range-end-near-hover"),Dn(Tt)&&(it(St,xn)||Mt($e,on,xn,St))),Object(M.a)(vt,"".concat(Re,"-range-hover"),vn),Object(M.a)(vt,"".concat(Re,"-range-hover-start"),Rn),Object(M.a)(vt,"".concat(Re,"-range-hover-end"),zt),Object(M.a)(vt,"".concat(Re,"-range-hover-edge-start"),Kt),Object(M.a)(vt,"".concat(Re,"-range-hover-edge-end"),Cn),Object(M.a)(vt,"".concat(Re,"-range-hover-edge-start-near-range"),Kt&&it(ct,At)),Object(M.a)(vt,"".concat(Re,"-range-hover-edge-end-near-range"),Cn&&it(St,Ut)),Object(M.a)(vt,"".concat(Re,"-today"),it(ze,Tt)),Object(M.a)(vt,"".concat(Re,"-selected"),it(yt,Tt)),vt}return en}function dt(ne){for(var Re=ne.prefixCls,$e=ne.disabledDate,Be=ne.onSelect,Ye=ne.rowNum,et=ne.colNum,it=ne.prefixColumn,Ae=ne.rowClassName,ze=ne.baseDate,yt=ne.getCellClassName,en=ne.getCellText,Tt=ne.getCellNode,vt=ne.getCellDate,ct=ne.titleCell,St=ne.headerCells,Ut=C.useContext(s),At=Ut.onDateMouseEnter,on=Ut.onDateMouseLeave,xn="".concat(Re,"-cell"),vn=[],Qt=0;Qt<Ye;Qt+=1){for(var Dn=[],Rn=void 0,zt=function(Zt){var Nn=Qt*et+Zt,Vt=vt(ze,Nn),Un=$e&&$e(Vt);Zt===0&&(Rn=Vt,it&&Dn.push(it(Rn))),Dn.push(C.createElement("td",{key:Zt,title:ct&&ct(Vt),className:A()(xn,Object(I.a)(Object(M.a)({},"".concat(xn,"-disabled"),Un),yt(Vt))),onClick:function(){Un||Be(Vt)},onMouseEnter:function(){!Un&&At&&At(Vt)},onMouseLeave:function(){!Un&&on&&on(Vt)}},Tt?Tt(Vt):C.createElement("div",{className:"".concat(xn,"-inner")},en(Vt))))},Kt=0;Kt<et;Kt+=1)zt(Kt);vn.push(C.createElement("tr",{key:Qt,className:Ae&&Ae(Rn)},Dn))}return C.createElement("div",{className:"".concat(Re,"-body")},C.createElement("table",{className:"".concat(Re,"-content")},St&&C.createElement("thead",null,C.createElement("tr",null,St)),C.createElement("tbody",null,vn)))}function mt(ne){var Re=ne.prefixCls,$e=ne.generateConfig,Be=ne.prefixColumn,Ye=ne.locale,et=ne.rowCount,it=ne.viewDate,Ae=ne.value,ze=ne.dateRender,yt=C.useContext(Et),en=yt.rangedValue,Tt=yt.hoverRangedValue,vt=sn(Ye.locale,$e,it),ct="".concat(Re,"-cell"),St=$e.locale.getWeekFirstDay(Ye.locale),Ut=$e.getNow(),At=[],on=Ye.shortWeekDays||($e.locale.getShortWeekDays?$e.locale.getShortWeekDays(Ye.locale):[]);Be&&At.push(C.createElement("th",{key:"empty","aria-label":"empty cell"}));for(var xn=0;xn<ae;xn+=1)At.push(C.createElement("th",{key:xn},on[(xn+St)%ae]));var vn=It({cellPrefixCls:ct,today:Ut,value:Ae,generateConfig:$e,rangedValue:Be?null:en,hoverRangedValue:Be?null:Tt,isSameCell:function(Rn,zt){return ft($e,Rn,zt)},isInView:function(Rn){return we($e,Rn,it)},offsetCell:function(Rn,zt){return $e.addDate(Rn,zt)}}),Qt=ze?function(Dn){return ze(Dn,Ut)}:void 0;return C.createElement(dt,Object.assign({},ne,{rowNum:et,colNum:ae,baseDate:vt,getCellNode:Qt,getCellText:$e.getDate,getCellClassName:vn,getCellDate:$e.addDate,titleCell:function(Rn){return $e.locale.format(Ye.locale,Rn,"YYYY-MM-DD")},headerCells:At}))}var We=mt;function De(ne){var Re=ne.prefixCls,$e=ne.generateConfig,Be=ne.locale,Ye=ne.viewDate,et=ne.onNextMonth,it=ne.onPrevMonth,Ae=ne.onNextYear,ze=ne.onPrevYear,yt=ne.onYearClick,en=ne.onMonthClick,Tt=C.useContext(s),vt=Tt.hideHeader;if(vt)return null;var ct="".concat(Re,"-header"),St=Be.shortMonths||($e.locale.getShortMonths?$e.locale.getShortMonths(Be.locale):[]),Ut=$e.getMonth(Ye),At=C.createElement("button",{type:"button",key:"year",onClick:yt,tabIndex:-1,className:"".concat(Re,"-year-btn")},$e.locale.format(Be.locale,Ye,Be.yearFormat)),on=C.createElement("button",{type:"button",key:"month",onClick:en,tabIndex:-1,className:"".concat(Re,"-month-btn")},Be.monthFormat?$e.locale.format(Be.locale,Ye,Be.monthFormat):St[Ut]),xn=Be.monthBeforeYear?[on,At]:[At,on];return C.createElement(a,Object.assign({},ne,{prefixCls:ct,onSuperPrev:ze,onPrev:it,onNext:et,onSuperNext:Ae}),xn)}var Le=De,de=6;function fe(ne){var Re=ne.prefixCls,$e=ne.panelName,Be=$e===void 0?"date":$e,Ye=ne.keyboardConfig,et=ne.active,it=ne.operationRef,Ae=ne.generateConfig,ze=ne.value,yt=ne.viewDate,en=ne.onViewDateChange,Tt=ne.onPanelChange,vt=ne.onSelect,ct="".concat(Re,"-").concat(Be,"-panel");it.current={onKeyDown:function(on){return _(on,Object(I.a)({onLeftRight:function(vn){vt(Ae.addDate(ze||yt,vn),"key")},onCtrlLeftRight:function(vn){vt(Ae.addYear(ze||yt,vn),"key")},onUpDown:function(vn){vt(Ae.addDate(ze||yt,vn*ae),"key")},onPageUpDown:function(vn){vt(Ae.addMonth(ze||yt,vn),"key")}},Ye))}};var St=function(on){var xn=Ae.addYear(yt,on);en(xn),Tt(null,xn)},Ut=function(on){var xn=Ae.addMonth(yt,on);en(xn),Tt(null,xn)};return C.createElement("div",{className:A()(ct,Object(M.a)({},"".concat(ct,"-active"),et))},C.createElement(Le,Object.assign({},ne,{prefixCls:Re,value:ze,viewDate:yt,onPrevYear:function(){St(-1)},onNextYear:function(){St(1)},onPrevMonth:function(){Ut(-1)},onNextMonth:function(){Ut(1)},onMonthClick:function(){Tt("month",yt)},onYearClick:function(){Tt("year",yt)}})),C.createElement(We,Object.assign({},ne,{onSelect:function(on){return vt(on,"mouse")},prefixCls:Re,value:ze,viewDate:yt,rowCount:de})))}var Ee=fe;function Pe(ne,Re,$e){if(!$e)return Re;var Be=Re;return Be=ne.setHour(Be,ne.getHour($e)),Be=ne.setMinute(Be,ne.getMinute($e)),Be=ne.setSecond(Be,ne.getSecond($e)),Be}var Ue=re("date","time");function lt(ne){var Re=ne.prefixCls,$e=ne.operationRef,Be=ne.generateConfig,Ye=ne.value,et=ne.defaultValue,it=ne.disabledTime,Ae=ne.showTime,ze=ne.onSelect,yt="".concat(Re,"-datetime-panel"),en=C.useState(null),Tt=Object(W.a)(en,2),vt=Tt[0],ct=Tt[1],St=C.useRef({}),Ut=C.useRef({}),At=Object(p.a)(Ae)==="object"?Object(I.a)({},Ae):{};function on(Dn){var Rn=Ue.indexOf(vt)+Dn,zt=Ue[Rn]||null;return zt}var xn=function(Rn){Ut.current.onBlur&&Ut.current.onBlur(Rn),ct(null)};$e.current={onKeyDown:function(Rn){if(Rn.which===l.a.TAB){var zt=on(Rn.shiftKey?-1:1);return ct(zt),zt&&Rn.preventDefault(),!0}if(vt){var Kt=vt==="date"?St:Ut;return Kt.current&&Kt.current.onKeyDown&&Kt.current.onKeyDown(Rn),!0}return[l.a.LEFT,l.a.RIGHT,l.a.UP,l.a.DOWN].includes(Rn.which)?(ct("date"),!0):!1},onBlur:xn,onClose:xn};var vn=function(Rn,zt){var Kt=Rn;zt==="date"&&!Ye&&At.defaultValue?(Kt=Be.setHour(Kt,Be.getHour(At.defaultValue)),Kt=Be.setMinute(Kt,Be.getMinute(At.defaultValue)),Kt=Be.setSecond(Kt,Be.getSecond(At.defaultValue))):zt==="time"&&!Ye&&et&&(Kt=Be.setYear(Kt,Be.getYear(et)),Kt=Be.setMonth(Kt,Be.getMonth(et)),Kt=Be.setDate(Kt,Be.getDate(et))),ze&&ze(Kt,"mouse")},Qt=it?it(Ye||null):{};return C.createElement("div",{className:A()(yt,Object(M.a)({},"".concat(yt,"-active"),vt))},C.createElement(Ee,Object.assign({},ne,{operationRef:St,active:vt==="date",onSelect:function(Rn){vn(Pe(Be,Rn,Ae&&Object(p.a)(Ae)==="object"?Ae.defaultValue:null),"date")}})),C.createElement(rt,Object.assign({},ne,{format:void 0},At,Qt,{defaultValue:void 0,operationRef:Ut,active:vt==="time",onSelect:function(Rn){vn(Rn,"time")}})))}var Ot=lt;function cn(ne){var Re=ne.prefixCls,$e=ne.generateConfig,Be=ne.locale,Ye=ne.value,et="".concat(Re,"-cell"),it=function(en){return C.createElement("td",{key:"week",className:A()(et,"".concat(et,"-week"))},$e.locale.getWeek(Be.locale,en))},Ae="".concat(Re,"-week-panel-row"),ze=function(en){return A()(Ae,Object(M.a)({},"".concat(Ae,"-selected"),jt($e,Be.locale,Ye,en)))};return C.createElement(Ee,Object.assign({},ne,{panelName:"week",prefixColumn:it,rowClassName:ze,keyboardConfig:{onLeftRight:null}}))}var An=cn;function Ct(ne){var Re=ne.prefixCls,$e=ne.generateConfig,Be=ne.locale,Ye=ne.viewDate,et=ne.onNextYear,it=ne.onPrevYear,Ae=ne.onYearClick,ze=C.useContext(s),yt=ze.hideHeader;if(yt)return null;var en="".concat(Re,"-header");return C.createElement(a,Object.assign({},ne,{prefixCls:en,onSuperPrev:it,onSuperNext:et}),C.createElement("button",{type:"button",onClick:Ae,className:"".concat(Re,"-year-btn")},$e.locale.format(Be.locale,Ye,Be.yearFormat)))}var Gt=Ct,xt=3,Rt=4;function gt(ne){var Re=ne.prefixCls,$e=ne.locale,Be=ne.value,Ye=ne.viewDate,et=ne.generateConfig,it=ne.monthCellRender,Ae=C.useContext(Et),ze=Ae.rangedValue,yt=Ae.hoverRangedValue,en="".concat(Re,"-cell"),Tt=It({cellPrefixCls:en,value:Be,generateConfig:et,rangedValue:ze,hoverRangedValue:yt,isSameCell:function(At,on){return we(et,At,on)},isInView:function(){return!0},offsetCell:function(At,on){return et.addMonth(At,on)}}),vt=$e.shortMonths||(et.locale.getShortMonths?et.locale.getShortMonths($e.locale):[]),ct=et.setMonth(Ye,0),St=it?function(Ut){return it(Ut,$e)}:void 0;return C.createElement(dt,Object.assign({},ne,{rowNum:Rt,colNum:xt,baseDate:ct,getCellNode:St,getCellText:function(At){return $e.monthFormat?et.locale.format($e.locale,At,$e.monthFormat):vt[et.getMonth(At)]},getCellClassName:Tt,getCellDate:et.addMonth,titleCell:function(At){return et.locale.format($e.locale,At,"YYYY-MM")}}))}var be=gt;function Ie(ne){var Re=ne.prefixCls,$e=ne.operationRef,Be=ne.onViewDateChange,Ye=ne.generateConfig,et=ne.value,it=ne.viewDate,Ae=ne.onPanelChange,ze=ne.onSelect,yt="".concat(Re,"-month-panel");$e.current={onKeyDown:function(vt){return _(vt,{onLeftRight:function(St){ze(Ye.addMonth(et||it,St),"key")},onCtrlLeftRight:function(St){ze(Ye.addYear(et||it,St),"key")},onUpDown:function(St){ze(Ye.addMonth(et||it,St*xt),"key")},onEnter:function(){Ae("date",et||it)}})}};var en=function(vt){var ct=Ye.addYear(it,vt);Be(ct),Ae(null,ct)};return C.createElement("div",{className:yt},C.createElement(Gt,Object.assign({},ne,{prefixCls:Re,onPrevYear:function(){en(-1)},onNextYear:function(){en(1)},onYearClick:function(){Ae("year",it)}})),C.createElement(be,Object.assign({},ne,{prefixCls:Re,onSelect:function(vt){ze(vt,"mouse"),Ae("date",vt)}})))}var Dt=Ie;function ht(ne){var Re=ne.prefixCls,$e=ne.generateConfig,Be=ne.locale,Ye=ne.viewDate,et=ne.onNextYear,it=ne.onPrevYear,Ae=ne.onYearClick,ze=C.useContext(s),yt=ze.hideHeader;if(yt)return null;var en="".concat(Re,"-header");return C.createElement(a,Object.assign({},ne,{prefixCls:en,onSuperPrev:it,onSuperNext:et}),C.createElement("button",{type:"button",onClick:Ae,className:"".concat(Re,"-year-btn")},$e.locale.format(Be.locale,Ye,Be.yearFormat)))}var nn=ht,qt=4,Ke=1;function st(ne){var Re=ne.prefixCls,$e=ne.locale,Be=ne.value,Ye=ne.viewDate,et=ne.generateConfig,it=C.useContext(Et),Ae=it.rangedValue,ze=it.hoverRangedValue,yt="".concat(Re,"-cell"),en=It({cellPrefixCls:yt,value:Be,generateConfig:et,rangedValue:Ae,hoverRangedValue:ze,isSameCell:function(ct,St){return ge(et,ct,St)},isInView:function(){return!0},offsetCell:function(ct,St){return et.addMonth(ct,St*3)}}),Tt=et.setDate(et.setMonth(Ye,0),1);return C.createElement(dt,Object.assign({},ne,{rowNum:Ke,colNum:qt,baseDate:Tt,getCellText:function(ct){return et.locale.format($e.locale,ct,$e.quarterFormat||"[Q]Q")},getCellClassName:en,getCellDate:function(ct,St){return et.addMonth(ct,St*3)},titleCell:function(ct){return et.locale.format($e.locale,ct,"YYYY-[Q]Q")}}))}var bt=st;function Ft(ne){var Re=ne.prefixCls,$e=ne.operationRef,Be=ne.onViewDateChange,Ye=ne.generateConfig,et=ne.value,it=ne.viewDate,Ae=ne.onPanelChange,ze=ne.onSelect,yt="".concat(Re,"-quarter-panel");$e.current={onKeyDown:function(vt){return _(vt,{onLeftRight:function(St){ze(Ye.addMonth(et||it,St*3),"key")},onCtrlLeftRight:function(St){ze(Ye.addYear(et||it,St),"key")},onUpDown:function(St){ze(Ye.addYear(et||it,St),"key")}})}};var en=function(vt){var ct=Ye.addYear(it,vt);Be(ct),Ae(null,ct)};return C.createElement("div",{className:yt},C.createElement(nn,Object.assign({},ne,{prefixCls:Re,onPrevYear:function(){en(-1)},onNextYear:function(){en(1)},onYearClick:function(){Ae("year",it)}})),C.createElement(bt,Object.assign({},ne,{prefixCls:Re,onSelect:function(vt){ze(vt,"mouse")}})))}var $t=Ft;function gn(ne){var Re=ne.prefixCls,$e=ne.generateConfig,Be=ne.viewDate,Ye=ne.onPrevDecade,et=ne.onNextDecade,it=ne.onDecadeClick,Ae=C.useContext(s),ze=Ae.hideHeader;if(ze)return null;var yt="".concat(Re,"-header"),en=$e.getYear(Be),Tt=Math.floor(en/ar)*ar,vt=Tt+ar-1;return C.createElement(a,Object.assign({},ne,{prefixCls:yt,onSuperPrev:Ye,onSuperNext:et}),C.createElement("button",{type:"button",onClick:it,className:"".concat(Re,"-decade-btn")},Tt,"-",vt))}var er=gn,Hn=3,yn=4;function Sr(ne){var Re=ne.prefixCls,$e=ne.value,Be=ne.viewDate,Ye=ne.locale,et=ne.generateConfig,it=C.useContext(Et),Ae=it.rangedValue,ze=it.hoverRangedValue,yt="".concat(Re,"-cell"),en=et.getYear(Be),Tt=Math.floor(en/ar)*ar,vt=Tt+ar-1,ct=et.setYear(Be,Tt-Math.ceil((Hn*yn-ar)/2)),St=function(on){var xn=et.getYear(on);return Tt<=xn&&xn<=vt},Ut=It({cellPrefixCls:yt,value:$e,generateConfig:et,rangedValue:Ae,hoverRangedValue:ze,isSameCell:function(on,xn){return te(et,on,xn)},isInView:St,offsetCell:function(on,xn){return et.addYear(on,xn)}});return C.createElement(dt,Object.assign({},ne,{rowNum:yn,colNum:Hn,baseDate:ct,getCellText:et.getYear,getCellClassName:Ut,getCellDate:et.addYear,titleCell:function(on){return et.locale.format(Ye.locale,on,"YYYY")}}))}var _r=Sr,ar=10;function cr(ne){var Re=ne.prefixCls,$e=ne.operationRef,Be=ne.onViewDateChange,Ye=ne.generateConfig,et=ne.value,it=ne.viewDate,Ae=ne.sourceMode,ze=ne.onSelect,yt=ne.onPanelChange,en="".concat(Re,"-year-panel");$e.current={onKeyDown:function(ct){return _(ct,{onLeftRight:function(Ut){ze(Ye.addYear(et||it,Ut),"key")},onCtrlLeftRight:function(Ut){ze(Ye.addYear(et||it,Ut*ar),"key")},onUpDown:function(Ut){ze(Ye.addYear(et||it,Ut*Hn),"key")},onEnter:function(){yt(Ae==="date"?"date":"month",et||it)}})}};var Tt=function(ct){var St=Ye.addYear(it,ct*10);Be(St),yt(null,St)};return C.createElement("div",{className:en},C.createElement(er,Object.assign({},ne,{prefixCls:Re,onPrevDecade:function(){Tt(-1)},onNextDecade:function(){Tt(1)},onDecadeClick:function(){yt("decade",it)}})),C.createElement(_r,Object.assign({},ne,{prefixCls:Re,onSelect:function(ct){yt(Ae==="date"?"date":"month",ct),ze(ct,"mouse")}})))}var Pr=cr;function Qr(ne){var Re=ne.prefixCls,$e=ne.generateConfig,Be=ne.viewDate,Ye=ne.onPrevDecades,et=ne.onNextDecades,it=C.useContext(s),Ae=it.hideHeader;if(Ae)return null;var ze="".concat(Re,"-header"),yt=$e.getYear(Be),en=Math.floor(yt/la)*la,Tt=en+la-1;return C.createElement(a,Object.assign({},ne,{prefixCls:ze,onSuperPrev:Ye,onSuperNext:et}),en,"-",Tt)}var ca=Qr,hn=3,ir=4;function va(ne){var Re=sa-1,$e=ne.prefixCls,Be=ne.viewDate,Ye=ne.generateConfig,et=ne.disabledDate,it="".concat($e,"-cell"),Ae=Ye.getYear(Be),ze=Math.floor(Ae/sa)*sa,yt=Math.floor(Ae/la)*la,en=yt+la-1,Tt=Ye.setYear(Be,yt-Math.ceil((hn*ir*sa-la)/2)),vt=function(St){var Ut,At=et&&et(St),on=Ye.getYear(St),xn=on+Re;return Ut={},Object(M.a)(Ut,"".concat(it,"-disabled"),At),Object(M.a)(Ut,"".concat(it,"-in-view"),yt<=on&&xn<=en),Object(M.a)(Ut,"".concat(it,"-selected"),on===ze),Ut};return C.createElement(dt,Object.assign({},ne,{rowNum:ir,colNum:hn,baseDate:Tt,getCellText:function(St){var Ut=Ye.getYear(St);return"".concat(Ut,"-").concat(Ut+Re)},getCellClassName:vt,getCellDate:function(St,Ut){return Ye.addYear(St,Ut*sa)}}))}var Pa=va,sa=10,la=sa*10;function ee(ne){var Re=ne.prefixCls,$e=ne.onViewDateChange,Be=ne.generateConfig,Ye=ne.viewDate,et=ne.operationRef,it=ne.onSelect,Ae=ne.onPanelChange,ze="".concat(Re,"-decade-panel");et.current={onKeyDown:function(vt){return _(vt,{onLeftRight:function(St){it(Be.addYear(Ye,St*sa),"key")},onCtrlLeftRight:function(St){it(Be.addYear(Ye,St*la),"key")},onUpDown:function(St){it(Be.addYear(Ye,St*sa*hn),"key")},onEnter:function(){Ae("year",Ye)}})}};var yt=function(vt){var ct=Be.addYear(Ye,vt*la);$e(ct),Ae(null,ct)},en=function(vt){it(vt,"mouse"),Ae("year",vt)};return C.createElement("div",{className:ze},C.createElement(ca,Object.assign({},ne,{prefixCls:Re,onPrevDecades:function(){yt(-1)},onNextDecades:function(){yt(1)}})),C.createElement(Pa,Object.assign({},ne,{prefixCls:Re,onSelect:en})))}var N=ee;function B(ne,Re,$e){return $e?C.createElement("div",{className:"".concat(ne,"-footer-extra")},$e(Re)):null}function X(ne){var Re=ne.prefixCls,$e=ne.rangeList,Be=$e===void 0?[]:$e,Ye=ne.components,et=Ye===void 0?{}:Ye,it=ne.needConfirmButton,Ae=ne.onNow,ze=ne.onOk,yt=ne.okDisabled,en=ne.showNow,Tt=ne.locale,vt,ct;if(Be.length){var St=et.rangeItem||"span";vt=C.createElement(C.Fragment,null,Be.map(function(At){var on=At.label,xn=At.onClick,vn=At.onMouseEnter,Qt=At.onMouseLeave;return C.createElement("li",{key:on,className:"".concat(Re,"-preset")},C.createElement(St,{onClick:xn,onMouseEnter:vn,onMouseLeave:Qt},on))}))}if(it){var Ut=et.button||"button";Ae&&!vt&&en!==!1&&(vt=C.createElement("li",{className:"".concat(Re,"-now")},C.createElement("a",{className:"".concat(Re,"-now-btn"),onClick:Ae},Tt.now))),ct=it&&C.createElement("li",{className:"".concat(Re,"-ok")},C.createElement(Ut,{disabled:yt,onClick:ze},Tt.ok))}return!vt&&!ct?null:C.createElement("ul",{className:"".concat(Re,"-ranges")},vt,ct)}function ue(ne){var Re,$e=ne.prefixCls,Be=$e===void 0?"rc-picker":$e,Ye=ne.className,et=ne.style,it=ne.locale,Ae=ne.generateConfig,ze=ne.value,yt=ne.defaultValue,en=ne.pickerValue,Tt=ne.defaultPickerValue,vt=ne.disabledDate,ct=ne.mode,St=ne.picker,Ut=St===void 0?"date":St,At=ne.tabIndex,on=At===void 0?0:At,xn=ne.showNow,vn=ne.showTime,Qt=ne.showToday,Dn=ne.renderExtraFooter,Rn=ne.hideHeader,zt=ne.onSelect,Kt=ne.onChange,Cn=ne.onPanelChange,Zt=ne.onMouseDown,Nn=ne.onPickerValueChange,Vt=ne.onOk,Un=ne.components,Lt=ne.direction,kt=ne.hourStep,sr=kt===void 0?1:kt,Sn=ne.minuteStep,Mn=Sn===void 0?1:Sn,wn=ne.secondStep,an=wn===void 0?1:wn,Yt=Ut==="date"&&!!vn||Ut==="time",Gn=24%sr===0,mn=60%Mn===0,Wt=60%an===0,Ht=C.useContext(s),dn=Ht.operationRef,Xt=Ht.panelRef,ln=Ht.onSelect,Zn=Ht.hideRanges,qn=Ht.defaultOpenValue,En=C.useContext(Et),Tr=En.inRange,$n=En.panelPosition,Yn=En.rangedValue,$r=En.hoverRangedValue,Gr=C.useRef({}),aa=C.useRef(!0),Ta=Object(f.a)(null,{value:ze,defaultValue:yt,postState:function(pn){return!pn&&qn&&Ut==="time"?qn:pn}}),Ra=Object(W.a)(Ta,2),ha=Ra[0],_a=Ra[1],ta=Object(f.a)(null,{value:en,defaultValue:Tt||ha,postState:function(pn){return pn||Ae.getNow()}}),Me=Object(W.a)(ta,2),tt=Me[0],ot=Me[1],je=function(pn){ot(pn),Nn&&Nn(pn)},ce=function(pn){var Ln=U[Ut];return Ln?Ln(pn):pn},Oe=Object(f.a)(function(){return Ut==="time"?"time":ce("date")},{value:ct}),me=Object(W.a)(Oe,2),ke=me[0],Ge=me[1];C.useEffect(function(){Ge(Ut)},[Ut]);var ut=C.useState(function(){return ke}),Je=Object(W.a)(ut,2),pt=Je[0],Nt=Je[1],tn=function(pn,Ln){var xr=ce(pn||ke);Nt(ke),Ge(xr),Cn&&(ke!==xr||qe(Ae,tt,tt))&&Cn(Ln,xr)},fn=function(pn,Ln){var xr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;(ke===Ut||xr)&&(_a(pn),zt&&zt(pn),ln&&ln(pn,Ln),Kt&&!qe(Ae,pn,ha)&&Kt(pn))},Tn=function(pn){return Gr.current&&Gr.current.onKeyDown?([l.a.LEFT,l.a.RIGHT,l.a.UP,l.a.DOWN,l.a.PAGE_UP,l.a.PAGE_DOWN,l.a.ENTER].includes(pn.which)&&pn.preventDefault(),Gr.current.onKeyDown(pn)):(Object(v.a)(!1,"Panel not correct handle keyDown event. Please help to fire issue about this."),!1)},Kn=function(pn){Gr.current&&Gr.current.onBlur&&Gr.current.onBlur(pn)};dn&&$n!=="right"&&(dn.current={onKeyDown:Tn,onClose:function(){Gr.current&&Gr.current.onClose&&Gr.current.onClose()}}),C.useEffect(function(){ze&&!aa.current&&ot(ze)},[ze]),C.useEffect(function(){aa.current=!1},[]);var fr,lr=Object(I.a)(Object(I.a)({},ne),{},{operationRef:Gr,prefixCls:Be,viewDate:tt,value:ha,onViewDateChange:je,sourceMode:pt,onPanelChange:tn,disabledDate:ke!=="decade"?vt:void 0});delete lr.onChange,delete lr.onSelect;switch(ke){case"decade":fr=C.createElement(N,Object.assign({},lr,{onSelect:function(pn,Ln){je(pn),fn(pn,Ln)}}));break;case"year":fr=C.createElement(Pr,Object.assign({},lr,{onSelect:function(pn,Ln){je(pn),fn(pn,Ln)}}));break;case"month":fr=C.createElement(Dt,Object.assign({},lr,{onSelect:function(pn,Ln){je(pn),fn(pn,Ln)}}));break;case"quarter":fr=C.createElement($t,Object.assign({},lr,{onSelect:function(pn,Ln){je(pn),fn(pn,Ln)}}));break;case"week":fr=C.createElement(An,Object.assign({},lr,{onSelect:function(pn,Ln){je(pn),fn(pn,Ln)}}));break;case"time":delete lr.showTime,fr=C.createElement(rt,Object.assign({},lr,Object(p.a)(vn)==="object"?vn:null,{onSelect:function(pn,Ln){je(pn),fn(pn,Ln)}}));break;default:vn?fr=C.createElement(Ot,Object.assign({},lr,{onSelect:function(pn,Ln){je(pn),fn(pn,Ln)}})):fr=C.createElement(Ee,Object.assign({},lr,{onSelect:function(pn,Ln){je(pn),fn(pn,Ln)}}))}var yr,br,vr=function(){var pn=Ae.getNow(),Ln=Ve(Ae.getHour(pn),Ae.getMinute(pn),Ae.getSecond(pn),Gn?sr:1,mn?Mn:1,Wt?an:1),xr=Fe(Ae,pn,Ln[0],Ln[1],Ln[2]);fn(xr,"submit")};Zn||(yr=B(Be,ke,Dn),br=X({prefixCls:Be,components:Un,needConfirmButton:Yt,okDisabled:!ha||vt&&vt(ha),locale:it,showNow:xn,onNow:Yt&&vr,onOk:function(){ha&&(fn(ha,"submit",!0),Vt&&Vt(ha))}}));var Er;if(Qt&&ke==="date"&&Ut==="date"&&!vn){var Rr=Ae.getNow(),hr="".concat(Be,"-today-btn"),Nr=vt&&vt(Rr);Er=C.createElement("a",{className:A()(hr,Nr&&"".concat(hr,"-disabled")),"aria-disabled":Nr,onClick:function(){Nr||fn(Rr,"mouse",!0)}},it.today)}return C.createElement(s.Provider,{value:Object(I.a)(Object(I.a)({},Ht),{},{hideHeader:"hideHeader"in ne?Rn:Ht.hideHeader,hidePrevBtn:Tr&&$n==="right",hideNextBtn:Tr&&$n==="left"})},C.createElement("div",{tabIndex:on,className:A()("".concat(Be,"-panel"),Ye,(Re={},Object(M.a)(Re,"".concat(Be,"-panel-has-range"),Yn&&Yn[0]&&Yn[1]),Object(M.a)(Re,"".concat(Be,"-panel-has-range-hover"),$r&&$r[0]&&$r[1]),Object(M.a)(Re,"".concat(Be,"-panel-rtl"),Lt==="rtl"),Re)),style:et,onKeyDown:Tn,onBlur:Kn,onMouseDown:Zt,ref:Xt},fr,yr||br||Er?C.createElement("div",{className:"".concat(Be,"-footer")},yr,br,Er):null))}var q=ue,Ze=T("uciX"),Jt={bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:0,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:0,adjustY:1}}};function On(ne){var Re,$e=ne.prefixCls,Be=ne.popupElement,Ye=ne.popupStyle,et=ne.visible,it=ne.dropdownClassName,Ae=ne.dropdownAlign,ze=ne.transitionName,yt=ne.getPopupContainer,en=ne.children,Tt=ne.range,vt=ne.popupPlacement,ct=ne.direction,St="".concat($e,"-dropdown"),Ut=function(){return vt!==void 0?vt:ct==="rtl"?"bottomRight":"bottomLeft"};return C.createElement(Ze.a,{showAction:[],hideAction:[],popupPlacement:Ut(),builtinPlacements:Jt,prefixCls:St,popupTransitionName:ze,popup:Be,popupAlign:Ae,popupVisible:et,popupClassName:A()(it,(Re={},Object(M.a)(Re,"".concat(St,"-range"),Tt),Object(M.a)(Re,"".concat(St,"-rtl"),ct==="rtl"),Re)),popupStyle:Ye,getPopupContainer:yt},en)}var Xn=On;function un(ne){var Re=ne.open,$e=ne.value,Be=ne.isClickOutside,Ye=ne.triggerOpen,et=ne.forwardKeyDown,it=ne.blurToCancel,Ae=ne.onSubmit,ze=ne.onCancel,yt=ne.onFocus,en=ne.onBlur,Tt=Object(C.useState)(!1),vt=Object(W.a)(Tt,2),ct=vt[0],St=vt[1],Ut=Object(C.useState)(!1),At=Object(W.a)(Ut,2),on=At[0],xn=At[1],vn=Object(C.useRef)(!1),Qt=Object(C.useRef)(!1),Dn={onMouseDown:function(){St(!0),Ye(!0)},onKeyDown:function(zt){switch(zt.which){case l.a.ENTER:{Re?Ae()!==!1&&St(!0):Ye(!0),zt.preventDefault();return}case l.a.TAB:{ct&&Re&&!zt.shiftKey?(St(!1),zt.preventDefault()):!ct&&Re&&(!et(zt)&&zt.shiftKey&&(St(!0),zt.preventDefault()));return}case l.a.ESC:{St(!0),ze();return}}!Re&&![l.a.SHIFT].includes(zt.which)?Ye(!0):ct||et(zt)},onFocus:function(zt){St(!0),xn(!0),yt&&yt(zt)},onBlur:function(zt){if(vn.current||!Be(document.activeElement)){vn.current=!1;return}it?setTimeout(function(){Be(document.activeElement)&&ze()},0):Re&&(Ye(!1),Qt.current&&Ae()),xn(!1),en&&en(zt)}};return Object(C.useEffect)(function(){Qt.current=!1},[Re]),Object(C.useEffect)(function(){Qt.current=!0},[$e]),Object(C.useEffect)(function(){return x(function(Rn){var zt=Rn.target;Re&&(Be(zt)?on||Ye(!1):(vn.current=!0,requestAnimationFrame(function(){vn.current=!1})))})}),[Dn,{focused:on,typing:ct}]}function nr(ne){var Re=ne.valueTexts,$e=ne.onTextChange,Be=C.useState(""),Ye=Object(W.a)(Be,2),et=Ye[0],it=Ye[1],Ae=C.useRef([]);Ae.current=Re;function ze(en){it(en),$e(en)}function yt(){it(Ae.current[0])}return C.useEffect(function(){Re.every(function(en){return en!==et})&&yt()},[Re.join("||")]),[et,ze,yt]}var mr=T("Gytx"),Kr=T.n(mr);function ma(ne,Re){var $e=Re.formatList,Be=Re.generateConfig,Ye=Re.locale;return Object(w.a)(function(){if(!ne)return[[""],""];for(var et="",it=[],Ae=0;Ae<$e.length;Ae+=1){var ze=$e[Ae],yt=Be.locale.format(Ye.locale,ne,ze);it.push(yt),Ae===0&&(et=yt)}return[it,et]},[ne,$e],function(et,it){return et[0]!==it[0]||!Kr()(et[1],it[1])})}function da(ne,Re){var $e=Re.formatList,Be=Re.generateConfig,Ye=Re.locale,et=Object(C.useState)(null),it=Object(W.a)(et,2),Ae=it[0],ze=it[1],yt=Object(C.useRef)(null);function en(At){var on=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(cancelAnimationFrame(yt.current),on){ze(At);return}yt.current=requestAnimationFrame(function(){ze(At)})}var Tt=ma(Ae,{formatList:$e,generateConfig:Be,locale:Ye}),vt=Object(W.a)(Tt,2),ct=vt[1];function St(At){en(At)}function Ut(){var At=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;en(null,At)}return Object(C.useEffect)(function(){Ut(!0)},[ne]),Object(C.useEffect)(function(){return function(){return cancelAnimationFrame(yt.current)}},[]),[ct,St,Ut]}function Zr(ne){var Re,$e=ne.prefixCls,Be=$e===void 0?"rc-picker":$e,Ye=ne.id,et=ne.tabIndex,it=ne.style,Ae=ne.className,ze=ne.dropdownClassName,yt=ne.dropdownAlign,en=ne.popupStyle,Tt=ne.transitionName,vt=ne.generateConfig,ct=ne.locale,St=ne.inputReadOnly,Ut=ne.allowClear,At=ne.autoFocus,on=ne.showTime,xn=ne.picker,vn=xn===void 0?"date":xn,Qt=ne.format,Dn=ne.use12Hours,Rn=ne.value,zt=ne.defaultValue,Kt=ne.open,Cn=ne.defaultOpen,Zt=ne.defaultOpenValue,Nn=ne.suffixIcon,Vt=ne.clearIcon,Un=ne.disabled,Lt=ne.disabledDate,kt=ne.placeholder,sr=ne.getPopupContainer,Sn=ne.pickerRef,Mn=ne.panelRender,wn=ne.onChange,an=ne.onOpenChange,Yt=ne.onFocus,Gn=ne.onBlur,mn=ne.onMouseDown,Wt=ne.onMouseUp,Ht=ne.onMouseEnter,dn=ne.onMouseLeave,Xt=ne.onContextMenu,ln=ne.onClick,Zn=ne.direction,qn=ne.autoComplete,En=qn===void 0?"off":qn,Tr=C.useRef(null),$n=vn==="date"&&!!on||vn==="time",Yn=le(b(Qt,vn,on,Dn)),$r=C.useRef(null),Gr=C.useRef(null),aa=Object(f.a)(null,{value:Rn,defaultValue:zt}),Ta=Object(W.a)(aa,2),Ra=Ta[0],ha=Ta[1],_a=C.useState(Ra),ta=Object(W.a)(_a,2),Me=ta[0],tt=ta[1],ot=C.useRef(null),je=Object(f.a)(!1,{value:Kt,defaultValue:Cn,postState:function(pr){return Un?!1:pr},onChange:function(pr){an&&an(pr),!pr&&ot.current&&ot.current.onClose&&ot.current.onClose()}}),ce=Object(W.a)(je,2),Oe=ce[0],me=ce[1],ke=ma(Me,{formatList:Yn,generateConfig:vt,locale:ct}),Ge=Object(W.a)(ke,2),ut=Ge[0],Je=Ge[1],pt=nr({valueTexts:ut,onTextChange:function(pr){var na=vt.locale.parse(ct.locale,pr,Yn);na&&(!Lt||!Lt(na))&&tt(na)}}),Nt=Object(W.a)(pt,3),tn=Nt[0],fn=Nt[1],Tn=Nt[2],Kn=function(pr){tt(pr),ha(pr),wn&&!qe(vt,Ra,pr)&&wn(pr,pr?vt.locale.format(ct.locale,pr,Yn[0]):"")},fr=function(pr){if(Un&&pr)return;me(pr)},lr=function(pr){return Oe&&ot.current&&ot.current.onKeyDown?ot.current.onKeyDown(pr):(Object(v.a)(!1,"Picker not correct forward KeyDown operation. Please help to fire issue about this."),!1)},yr=function(){Wt&&Wt.apply(void 0,arguments),Tr.current&&(Tr.current.focus(),fr(!0))},br=un({blurToCancel:$n,open:Oe,value:tn,triggerOpen:fr,forwardKeyDown:lr,isClickOutside:function(pr){return!k([$r.current,Gr.current],pr)},onSubmit:function(){return Lt&&Lt(Me)?!1:(Kn(Me),fr(!1),Tn(),!0)},onCancel:function(){fr(!1),tt(Ra),Tn()},onFocus:Yt,onBlur:Gn}),vr=Object(W.a)(br,2),Er=vr[0],Rr=vr[1],hr=Rr.focused,Nr=Rr.typing;C.useEffect(function(){Oe||(tt(Ra),!ut.length||ut[0]===""?fn(""):Je!==tn&&Tn())},[Oe,ut]),C.useEffect(function(){Oe||Tn()},[vn]),C.useEffect(function(){tt(Ra)},[Ra]),Sn&&(Sn.current={focus:function(){Tr.current&&Tr.current.focus()},blur:function(){Tr.current&&Tr.current.blur()}});var or=Object(I.a)(Object(I.a)({},ne),{},{className:void 0,style:void 0,pickerValue:void 0,onPickerValueChange:void 0}),pn=C.createElement(q,Object.assign({},or,{generateConfig:vt,className:A()(Object(M.a)({},"".concat(Be,"-panel-focused"),!Nr)),value:Me,locale:ct,tabIndex:-1,onChange:tt,direction:Zn}));Mn&&(pn=Mn(pn));var Ln=C.createElement("div",{className:"".concat(Be,"-panel-container"),onMouseDown:function(pr){pr.preventDefault()}},pn),xr;Nn&&(xr=C.createElement("span",{className:"".concat(Be,"-suffix")},Nn));var Dr;Ut&&Ra&&!Un&&(Dr=C.createElement("span",{onMouseDown:function(pr){pr.preventDefault(),pr.stopPropagation()},onMouseUp:function(pr){pr.preventDefault(),pr.stopPropagation(),Kn(null),fr(!1)},className:"".concat(Be,"-clear")},Vt||C.createElement("span",{className:"".concat(Be,"-clear-btn")})));var Qn=function(pr,na){(na==="submit"||na!=="key"&&!$n)&&(Kn(pr),fr(!1))},Ar=Zn==="rtl"?"bottomRight":"bottomLeft",qr=da(tn,{formatList:Yn,generateConfig:vt,locale:ct}),Lr=Object(W.a)(qr,3),Ur=Lr[0],Wr=Lr[1],Br=Lr[2];return C.createElement(s.Provider,{value:{operationRef:ot,hideHeader:vn==="time",panelRef:$r,onSelect:Qn,open:Oe,defaultOpenValue:Zt,onDateMouseEnter:Wr,onDateMouseLeave:Br}},C.createElement(Xn,{visible:Oe,popupElement:Ln,popupStyle:en,prefixCls:Be,dropdownClassName:ze,dropdownAlign:yt,getPopupContainer:sr,transitionName:Tt,popupPlacement:Ar,direction:Zn},C.createElement("div",{className:A()(Be,Ae,(Re={},Object(M.a)(Re,"".concat(Be,"-disabled"),Un),Object(M.a)(Re,"".concat(Be,"-focused"),hr),Object(M.a)(Re,"".concat(Be,"-rtl"),Zn==="rtl"),Re)),style:it,onMouseDown:mn,onMouseUp:yr,onMouseEnter:Ht,onMouseLeave:dn,onContextMenu:Xt,onClick:ln},C.createElement("div",{className:A()("".concat(Be,"-input"),Object(M.a)({},"".concat(Be,"-input-placeholder"),!!Ur)),ref:Gr},C.createElement("input",Object.assign({id:Ye,tabIndex:et,disabled:Un,readOnly:St||!Nr,value:Ur||tn,onChange:function(pr){fn(pr.target.value)},autoFocus:At,placeholder:kt,ref:Tr,title:tn},Er,{size:g(vn,Yn[0])},Ne(ne),{autoComplete:En})),xr,Dr))))}var za=function(ne){Object(j.a)($e,ne);var Re=Object(G.a)($e);function $e(){var Be;return Object(Z.a)(this,$e),Be=Re.apply(this,arguments),Be.pickerRef=C.createRef(),Be.focus=function(){Be.pickerRef.current&&Be.pickerRef.current.focus()},Be.blur=function(){Be.pickerRef.current&&Be.pickerRef.current.blur()},Be}return Object(V.a)($e,[{key:"render",value:function(){return C.createElement(Zr,Object.assign({},this.props,{pickerRef:this.pickerRef}))}}]),$e}(C.Component),oi=za;function ua(ne,Re,$e){var Be=ne.picker,Ye=ne.locale,et=ne.selectedValue,it=ne.disabledDate,Ae=ne.disabled,ze=ne.generateConfig,yt=Ce(et,0),en=Ce(et,1);function Tt(At){var on=ze.getYear(At),xn=ze.locale.getWeek(Ye.locale,At);return on*100+xn}function vt(At){var on=ze.getYear(At),xn=ze.getMonth(At);return on*100+xn}function ct(At){var on=ze.getYear(At),xn=he(ze,At);return on*10+xn}var St=C.useCallback(function(At){if(it&&it(At))return!0;if(Ae[1]&&en)return!ft(ze,At,en)&&ze.isAfter(At,en);if(Re&&en)switch(Be){case"quarter":return ct(At)>ct(en);case"month":return vt(At)>vt(en);case"week":return Tt(At)>Tt(en);default:return!ft(ze,At,en)&&ze.isAfter(At,en)}return!1},[it,Ae[1],en,Re]),Ut=C.useCallback(function(At){if(it&&it(At))return!0;if(Ae[0]&&yt)return!ft(ze,At,en)&&ze.isAfter(yt,At);if($e&&yt)switch(Be){case"quarter":return ct(At)<ct(yt);case"month":return vt(At)<vt(yt);case"week":return Tt(At)<Tt(yt);default:return!ft(ze,At,yt)&&ze.isAfter(yt,At)}return!1},[it,Ae[0],yt,$e]);return[St,Ut]}function Na(ne,Re,$e,Be){var Ye=at(ne,$e,Be,1);function et(it){return it(ne,Re)?"same":it(Ye,Re)?"closing":"far"}switch($e){case"year":return et(function(it,Ae){return Q(Be,it,Ae)});case"quarter":case"month":return et(function(it,Ae){return te(Be,it,Ae)});default:return et(function(it,Ae){return we(Be,it,Ae)})}}function ti(ne,Re,$e,Be){var Ye=Ce(ne,0),et=Ce(ne,1);if(Re===0)return Ye;if(Ye&&et){var it=Na(Ye,et,$e,Be);switch(it){case"same":return Ye;case"closing":return Ye;default:return at(et,$e,Be,-1)}}return Ye}function Ga(ne){var Re=ne.values,$e=ne.picker,Be=ne.defaultDates,Ye=ne.generateConfig,et=C.useState(function(){return[Ce(Be,0),Ce(Be,1)]}),it=Object(W.a)(et,2),Ae=it[0],ze=it[1],yt=C.useState(null),en=Object(W.a)(yt,2),Tt=en[0],vt=en[1],ct=Ce(Re,0),St=Ce(Re,1);function Ut(on){return Ae[on]?Ae[on]:Ce(Tt,on)||ti(Re,on,$e,Ye)||ct||St||Ye.getNow()}function At(on,xn){if(on){var vn=Te(Tt,on,xn);ze(Te(Ae,null,xn)||[null,null]);var Qt=(xn+1)%2;Ce(Re,Qt)||(vn=Te(vn,on,Qt)),vt(vn)}else(ct||St)&&vt(null)}return[Ut,At]}function ba(ne,Re){return ne&&ne[0]&&ne[1]&&Re.isAfter(ne[0],ne[1])?[ne[1],ne[0]]:ne}function zn(ne,Re,$e,Be){return ne||Be&&Be[Re]?!0:!!$e[(Re+1)%2]}function bn(ne){var Re,$e,Be,Ye=ne.prefixCls,et=Ye===void 0?"rc-picker":Ye,it=ne.id,Ae=ne.style,ze=ne.className,yt=ne.popupStyle,en=ne.dropdownClassName,Tt=ne.transitionName,vt=ne.dropdownAlign,ct=ne.getPopupContainer,St=ne.generateConfig,Ut=ne.locale,At=ne.placeholder,on=ne.autoFocus,xn=ne.disabled,vn=ne.format,Qt=ne.picker,Dn=Qt===void 0?"date":Qt,Rn=ne.showTime,zt=ne.use12Hours,Kt=ne.separator,Cn=Kt===void 0?"~":Kt,Zt=ne.value,Nn=ne.defaultValue,Vt=ne.defaultPickerValue,Un=ne.open,Lt=ne.defaultOpen,kt=ne.disabledDate,sr=ne.disabledTime,Sn=ne.dateRender,Mn=ne.panelRender,wn=ne.ranges,an=ne.allowEmpty,Yt=ne.allowClear,Gn=ne.suffixIcon,mn=ne.clearIcon,Wt=ne.pickerRef,Ht=ne.inputReadOnly,dn=ne.mode,Xt=ne.renderExtraFooter,ln=ne.onChange,Zn=ne.onOpenChange,qn=ne.onPanelChange,En=ne.onCalendarChange,Tr=ne.onFocus,$n=ne.onBlur,Yn=ne.onOk,$r=ne.components,Gr=ne.order,aa=ne.direction,Ta=ne.activePickerIndex,Ra=ne.autoComplete,ha=Ra===void 0?"off":Ra,_a=Dn==="date"&&!!Rn||Dn==="time",ta=Object(C.useRef)({}),Me=Object(C.useRef)(null),tt=Object(C.useRef)(null),ot=Object(C.useRef)(null),je=Object(C.useRef)(null),ce=Object(C.useRef)(null),Oe=Object(C.useRef)(null),me=Object(C.useRef)(null),ke=le(b(vn,Dn,Rn,zt)),Ge=Object(f.a)(0,{value:Ta}),ut=Object(W.a)(Ge,2),Je=ut[0],pt=ut[1],Nt=Object(C.useRef)(null),tn=C.useMemo(function(){return Array.isArray(xn)?xn:[xn||!1,xn||!1]},[xn]),fn=Object(f.a)(null,{value:Zt,defaultValue:Nn,postState:function(Bn){return Dn==="time"&&!Gr?Bn:ba(Bn,St)}}),Tn=Object(W.a)(fn,2),Kn=Tn[0],fr=Tn[1],lr=Ga({values:Kn,picker:Dn,defaultDates:Vt,generateConfig:St}),yr=Object(W.a)(lr,2),br=yr[0],vr=yr[1],Er=Object(f.a)(Kn,{postState:function(Bn){var ur=Bn;if(tn[0]&&tn[1])return ur;for(var Mr=0;Mr<2;Mr+=1)tn[Mr]&&!Ce(ur,Mr)&&!Ce(an,Mr)&&(ur=Te(ur,St.getNow(),Mr));return ur}}),Rr=Object(W.a)(Er,2),hr=Rr[0],Nr=Rr[1],or=Object(f.a)([Dn,Dn],{value:dn}),pn=Object(W.a)(or,2),Ln=pn[0],xr=pn[1];Object(C.useEffect)(function(){xr([Dn,Dn])},[Dn]);var Dr=function(Bn,ur){xr(Bn),qn&&qn(ur,Bn)},Qn=ua({picker:Dn,selectedValue:hr,locale:Ut,disabled:tn,disabledDate:kt,generateConfig:St},ta.current[1],ta.current[0]),Ar=Object(W.a)(Qn,2),qr=Ar[0],Lr=Ar[1],Ur=Object(f.a)(!1,{value:Un,defaultValue:Lt,postState:function(Bn){return tn[Je]?!1:Bn},onChange:function(Bn){Zn&&Zn(Bn),!Bn&&Nt.current&&Nt.current.onClose&&Nt.current.onClose()}}),Wr=Object(W.a)(Ur,2),Br=Wr[0],Ir=Wr[1],pr=Br&&Je===0,na=Br&&Je===1,ni=Object(C.useState)(0),La=Object(W.a)(ni,2),ya=La[0],ea=La[1];Object(C.useEffect)(function(){!Br&&Me.current&&ea(Me.current.offsetWidth)},[Br]);var Vr=C.useRef();function Yr(Or,Bn){if(Or)clearTimeout(Vr.current),ta.current[Bn]=!0,pt(Bn),Ir(Or),Br||vr(null,Bn);else if(Je===Bn){Ir(Or);var ur=ta.current;Vr.current=setTimeout(function(){ur===ta.current&&(ta.current={})})}}function ia(Or){Yr(!0,Or),setTimeout(function(){var Bn=[Oe,me][Or];Bn.current&&Bn.current.focus()},0)}function Ha(Or,Bn){var ur=Or,Mr=Ce(ur,0),fa=Ce(ur,1);Mr&&fa&&St.isAfter(Mr,fa)&&(Dn==="week"&&!jt(St,Ut.locale,Mr,fa)||Dn==="quarter"&&!ge(St,Mr,fa)||Dn!=="week"&&Dn!=="quarter"&&Dn!=="time"&&!ft(St,Mr,fa)?(Bn===0?(ur=[Mr,null],fa=null):(Mr=null,ur=[null,fa]),ta.current=Object(M.a)({},Bn,!0)):(Dn!=="time"||Gr!==!1)&&(ur=ba(ur,St))),Nr(ur);var Ti=ur&&ur[0]?St.locale.format(Ut.locale,ur[0],ke[0]):"",gi=ur&&ur[1]?St.locale.format(Ut.locale,ur[1],ke[0]):"";if(En){var ja={range:Bn===0?"start":"end"};En(ur,[Ti,gi],ja)}var li=zn(Mr,0,tn,an),Oi=zn(fa,1,tn,an),Xi=ur===null||li&&Oi;Xi&&(fr(ur),ln&&(!qe(St,Ce(Kn,0),Mr)||!qe(St,Ce(Kn,1),fa))&&ln(ur,[Ti,gi]));var Ia=null;Bn===0&&!tn[1]?Ia=1:Bn===1&&!tn[0]&&(Ia=0),Ia!==null&&Ia!==Je&&(!ta.current[Ia]||!Ce(ur,Ia))&&Ce(ur,Bn)?ia(Ia):Yr(!1,Bn)}var mi=function(Bn){return Br&&Nt.current&&Nt.current.onKeyDown?Nt.current.onKeyDown(Bn):(Object(v.a)(!1,"Picker not correct forward KeyDown operation. Please help to fire issue about this."),!1)},si={formatList:ke,generateConfig:St,locale:Ut},Hr=ma(Ce(hr,0),si),Va=Object(W.a)(Hr,2),ri=Va[0],Jr=Va[1],jr=ma(Ce(hr,1),si),Ea=Object(W.a)(jr,2),Si=Ea[0],Fi=Ea[1],Ma=function(Bn,ur){var Mr=St.locale.parse(Ut.locale,Bn,ke),fa=ur===0?qr:Lr;Mr&&!fa(Mr)&&(Nr(Te(hr,Mr,ur)),vr(Mr,ur))},Ya=nr({valueTexts:ri,onTextChange:function(Bn){return Ma(Bn,0)}}),Qa=Object(W.a)(Ya,3),Ei=Qa[0],Ri=Qa[1],Bi=Qa[2],io=nr({valueTexts:Si,onTextChange:function(Bn){return Ma(Bn,1)}}),Ii=Object(W.a)(io,3),Vn=Ii[0],Pn=Ii[1],tr=Ii[2],ra=Object(C.useState)(null),Cr=Object(W.a)(ra,2),Oa=Cr[0],ki=Cr[1],Ni=Object(C.useState)(null),Ai=Object(W.a)(Ni,2),Wa=Ai[0],xi=Ai[1],Ci=da(Ei,{formatList:ke,generateConfig:St,locale:Ut}),Di=Object(W.a)(Ci,3),wi=Di[0],Qi=Di[1],Zi=Di[2],qi=da(Vn,{formatList:ke,generateConfig:St,locale:Ut}),Hi=Object(W.a)(qi,3),_i=Hi[0],Pi=Hi[1],oo=Hi[2],Ao=function(Bn){xi(Te(hr,Bn,Je)),Je===0?Qi(Bn):Pi(Bn)},Do=function(){xi(Te(hr,null,Je)),Je===0?Zi():oo()},po=function(Bn,ur){return{blurToCancel:_a,forwardKeyDown:mi,onBlur:$n,isClickOutside:function(fa){return!k([tt.current,ot.current,je.current],fa)},onFocus:function(fa){pt(Bn),Tr&&Tr(fa)},triggerOpen:function(fa){Yr(fa,Bn)},onSubmit:function(){Ha(hr,Bn),ur()},onCancel:function(){Yr(!1,Bn),Nr(Kn),ur()}}},so=un(Object(I.a)(Object(I.a)({},po(0,Bi)),{},{open:pr,value:Ei})),mo=Object(W.a)(so,2),Za=mo[0],xa=mo[1],Ua=xa.focused,Ca=xa.typing,Wi=un(Object(I.a)(Object(I.a)({},po(1,tr)),{},{open:na,value:Vn})),go=Object(W.a)(Wi,2),ci=go[0],lo=go[1],uo=lo.focused,co=lo.typing,Li=function(Bn){!Br&&!Oe.current.contains(Bn.target)&&!me.current.contains(Bn.target)&&(tn[0]?tn[1]||ia(1):ia(0))},eo=function(Bn){Br&&(Ua||uo)&&!Oe.current.contains(Bn.target)&&!me.current.contains(Bn.target)&&Bn.preventDefault()},Ki=Kn&&Kn[0]?St.locale.format(Ut.locale,Kn[0],"YYYYMMDDHHmmss"):"",vo=Kn&&Kn[1]?St.locale.format(Ut.locale,Kn[1],"YYYYMMDDHHmmss"):"";Object(C.useEffect)(function(){Br||(Nr(Kn),!ri.length||ri[0]===""?Ri(""):Jr!==Ei&&Bi(),!Si.length||Si[0]===""?Pn(""):Fi!==Vn&&tr())},[Br,ri,Si]),Object(C.useEffect)(function(){Nr(Kn)},[Ki,vo]),Wt&&(Wt.current={focus:function(){Oe.current&&Oe.current.focus()},blur:function(){Oe.current&&Oe.current.blur(),me.current&&me.current.blur()}});var to=Object.keys(wn||{}),Xr=to.map(function(Or){var Bn=wn[Or],ur=typeof Bn=="function"?Bn():Bn;return{label:Or,onClick:function(){Ha(ur,null),Yr(!1,Je)},onMouseEnter:function(){ki(ur)},onMouseLeave:function(){ki(null)}}});function kr(){var Or=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Bn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ur=null;Br&&Wa&&Wa[0]&&Wa[1]&&St.isAfter(Wa[1],Wa[0])&&(ur=Wa);var Mr=Rn;if(Rn&&Object(p.a)(Rn)==="object"&&Rn.defaultValue){var fa=Rn.defaultValue;Mr=Object(I.a)(Object(I.a)({},Rn),{},{defaultValue:Ce(fa,Je)||void 0})}var Ti=null;return Sn&&(Ti=function(ja,li){return Sn(ja,li,{range:Je?"end":"start"})}),C.createElement(Et.Provider,{value:{inRange:!0,panelPosition:Or,rangedValue:Oa||hr,hoverRangedValue:ur}},C.createElement(q,Object.assign({},ne,Bn,{dateRender:Ti,showTime:Mr,mode:Ln[Je],generateConfig:St,style:void 0,direction:aa,disabledDate:Je===0?qr:Lr,disabledTime:function(ja){return sr?sr(ja,Je===0?"start":"end"):!1},className:A()(Object(M.a)({},"".concat(et,"-panel-focused"),Je===0?!Ca:!co)),value:Ce(hr,Je),locale:Ut,tabIndex:-1,onPanelChange:function(ja,li){Dr(Te(Ln,li,Je),Te(hr,ja,Je));var Oi=ja;Or==="right"&&Ln[Je]===li&&(Oi=at(Oi,li,St,-1)),vr(Oi,Je)},onOk:null,onSelect:void 0,onChange:void 0,defaultValue:void 0,defaultPickerValue:void 0})))}var ga=0,Xa=0;Je&&ot.current&&ce.current&&tt.current&&(ga=ot.current.offsetWidth+ce.current.offsetWidth,tt.current.offsetWidth&&ga>tt.current.offsetWidth&&(Xa=ga));var Ui=aa==="rtl"?{right:ga}:{left:ga};function yi(){var Or,Bn=B(et,Ln[Je],Xt),ur=X({prefixCls:et,components:$r,needConfirmButton:_a,okDisabled:!Ce(hr,Je)||kt&&kt(hr[Je]),locale:Ut,rangeList:Xr,onOk:function(){Ce(hr,Je)&&(Ha(hr,Je),Yn&&Yn(hr))}});if(Dn!=="time"&&!Rn){var Mr=br(Je),fa=at(Mr,Dn,St),Ti=Ln[Je],gi=Ti===Dn,ja=kr(gi?"left":!1,{pickerValue:Mr,onPickerValueChange:function(Ia){vr(Ia,Je)}}),li=kr("right",{pickerValue:fa,onPickerValueChange:function(Ia){vr(at(Ia,Dn,St,-1),Je)}});aa==="rtl"?Or=C.createElement(C.Fragment,null,li,gi&&ja):Or=C.createElement(C.Fragment,null,ja,gi&&li)}else Or=kr();var Oi=C.createElement(C.Fragment,null,C.createElement("div",{className:"".concat(et,"-panels")},Or),(Bn||ur)&&C.createElement("div",{className:"".concat(et,"-footer")},Bn,ur));return Mn&&(Oi=Mn(Oi)),C.createElement("div",{className:"".concat(et,"-panel-container"),style:{marginLeft:Xa},ref:tt,onMouseDown:function(Ia){Ia.preventDefault()}},Oi)}var zi=C.createElement("div",{className:A()("".concat(et,"-range-wrapper"),"".concat(et,"-").concat(Dn,"-range-wrapper")),style:{minWidth:ya}},C.createElement("div",{className:"".concat(et,"-range-arrow"),style:Ui}),yi()),bi;Gn&&(bi=C.createElement("span",{className:"".concat(et,"-suffix")},Gn));var Aa;Yt&&(Ce(Kn,0)&&!tn[0]||Ce(Kn,1)&&!tn[1])&&(Aa=C.createElement("span",{onMouseDown:function(Bn){Bn.preventDefault(),Bn.stopPropagation()},onMouseUp:function(Bn){Bn.preventDefault(),Bn.stopPropagation();var ur=Kn;tn[0]||(ur=Te(ur,null,0)),tn[1]||(ur=Te(ur,null,1)),Ha(ur,null),Yr(!1,Je)},className:"".concat(et,"-clear")},mn||C.createElement("span",{className:"".concat(et,"-clear-btn")})));var Gi={size:g(Dn,ke[0])},Vi=0,Yi=0;ot.current&&je.current&&ce.current&&(Je===0?Yi=ot.current.offsetWidth:(Vi=ga,Yi=je.current.offsetWidth));var qa=aa==="rtl"?{right:Vi}:{left:Vi},zr=function(Bn,ur){var Mr=Te(hr,Bn,Je);ur==="submit"||ur!=="key"&&!_a?(Ha(Mr,Je),Je===0?Zi():oo()):Nr(Mr)};return C.createElement(s.Provider,{value:{operationRef:Nt,hideHeader:Dn==="time",onDateMouseEnter:Ao,onDateMouseLeave:Do,hideRanges:!0,onSelect:zr,open:Br}},C.createElement(Xn,{visible:Br,popupElement:zi,popupStyle:yt,prefixCls:et,dropdownClassName:en,dropdownAlign:vt,getPopupContainer:ct,transitionName:Tt,range:!0,direction:aa},C.createElement("div",Object.assign({ref:Me,className:A()(et,"".concat(et,"-range"),ze,(Re={},Object(M.a)(Re,"".concat(et,"-disabled"),tn[0]&&tn[1]),Object(M.a)(Re,"".concat(et,"-focused"),Je===0?Ua:uo),Object(M.a)(Re,"".concat(et,"-rtl"),aa==="rtl"),Re)),style:Ae,onClick:Li,onMouseDown:eo},Ne(ne)),C.createElement("div",{className:A()("".concat(et,"-input"),($e={},Object(M.a)($e,"".concat(et,"-input-active"),Je===0),Object(M.a)($e,"".concat(et,"-input-placeholder"),!!wi),$e)),ref:ot},C.createElement("input",Object.assign({id:it,disabled:tn[0],readOnly:Ht||!Ca,value:wi||Ei,onChange:function(Bn){Ri(Bn.target.value)},autoFocus:on,placeholder:Ce(At,0)||"",ref:Oe},Za,Gi,{autoComplete:ha}))),C.createElement("div",{className:"".concat(et,"-range-separator"),ref:ce},Cn),C.createElement("div",{className:A()("".concat(et,"-input"),(Be={},Object(M.a)(Be,"".concat(et,"-input-active"),Je===1),Object(M.a)(Be,"".concat(et,"-input-placeholder"),!!_i),Be)),ref:je},C.createElement("input",Object.assign({disabled:tn[1],readOnly:Ht||!co,value:_i||Vn,onChange:function(Bn){Pn(Bn.target.value)},placeholder:Ce(At,1)||"",ref:me},ci,Gi,{autoComplete:ha}))),C.createElement("div",{className:"".concat(et,"-active-bar"),style:Object(I.a)(Object(I.a)({},qa),{},{width:Yi,position:"absolute"})}),bi,Aa)))}var kn=function(ne){Object(j.a)($e,ne);var Re=Object(G.a)($e);function $e(){var Be;return Object(Z.a)(this,$e),Be=Re.apply(this,arguments),Be.pickerRef=C.createRef(),Be.focus=function(){Be.pickerRef.current&&Be.pickerRef.current.focus()},Be.blur=function(){Be.pickerRef.current&&Be.pickerRef.current.blur()},Be}return Object(V.a)($e,[{key:"render",value:function(){return C.createElement(bn,Object.assign({},this.props,{pickerRef:this.pickerRef}))}}]),$e}(C.Component),Wn=kn,dr=ve.b=oi},osHv:function(Bt,ve,T){(function(Z){Z(T("VrN/"))})(function(Z){"use strict";var V=Z.Pos;function j(t,u){return t.line-u.line||t.ch-u.ch}var G="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",M=G+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",I=new RegExp("<(/?)(["+G+"]["+M+"]*)","g");function W(t,u,a,i){this.line=u,this.ch=a,this.cm=t,this.text=t.getLine(u),this.min=i?Math.max(i.from,t.firstLine()):t.firstLine(),this.max=i?Math.min(i.to-1,t.lastLine()):t.lastLine()}function C(t,u){var a=t.cm.getTokenTypeAt(V(t.line,u));return a&&/\btag\b/.test(a)}function r(t){return t.line>=t.max?void 0:(t.ch=0,t.text=t.cm.getLine(++t.line),!0)}function A(t){return t.line<=t.min?void 0:(t.text=t.cm.getLine(--t.line),t.ch=t.text.length,!0)}function v(t){for(;;){var u=t.text.indexOf(">",t.ch);if(u==-1){if(r(t))continue;return}if(!C(t,u+1)){t.ch=u+1;continue}var a=t.text.lastIndexOf("/",u),i=a>-1&&!/\S/.test(t.text.slice(a+1,u));return t.ch=u+1,i?"selfClose":"regular"}}function f(t){for(;;){var u=t.ch?t.text.lastIndexOf("<",t.ch-1):-1;if(u==-1){if(A(t))continue;return}if(!C(t,u+1)){t.ch=u;continue}I.lastIndex=u,t.ch=u;var a=I.exec(t.text);if(a&&a.index==u)return a}}function p(t){for(;;){I.lastIndex=t.ch;var u=I.exec(t.text);if(!u){if(r(t))continue;return}if(!C(t,u.index+1)){t.ch=u.index+1;continue}return t.ch=u.index+u[0].length,u}}function l(t){for(;;){var u=t.ch?t.text.lastIndexOf(">",t.ch-1):-1;if(u==-1){if(A(t))continue;return}if(!C(t,u+1)){t.ch=u;continue}var a=t.text.lastIndexOf("/",u),i=a>-1&&!/\S/.test(t.text.slice(a+1,u));return t.ch=u+1,i?"selfClose":"regular"}}function o(t,u){for(var a=[];;){var i=p(t),D,w=t.line,S=t.ch-(i?i[0].length:0);if(!i||!(D=v(t)))return;if(D=="selfClose")continue;if(i[1]){for(var L=a.length-1;L>=0;--L)if(a[L]==i[2]){a.length=L;break}if(L<0&&(!u||u==i[2]))return{tag:i[2],from:V(w,S),to:V(t.line,t.ch)}}else a.push(i[2])}}function s(t,u){for(var a=[];;){var i=l(t);if(!i)return;if(i=="selfClose"){f(t);continue}var D=t.line,w=t.ch,S=f(t);if(!S)return;if(S[1])a.push(S[2]);else{for(var L=a.length-1;L>=0;--L)if(a[L]==S[2]){a.length=L;break}if(L<0&&(!u||u==S[2]))return{tag:S[2],from:V(t.line,t.ch),to:V(D,w)}}}}Z.registerHelper("fold","xml",function(t,u){for(var a=new W(t,u.line,0);;){var i=p(a);if(!i||a.line!=u.line)return;var D=v(a);if(!D)return;if(!i[1]&&D!="selfClose"){var w=V(a.line,a.ch),S=o(a,i[2]);return S&&j(S.from,w)>0?{from:w,to:S.from}:null}}}),Z.findMatchingTag=function(t,u,a){var i=new W(t,u.line,u.ch,a);if(i.text.indexOf(">")==-1&&i.text.indexOf("<")==-1)return;var D=v(i),w=D&&V(i.line,i.ch),S=D&&f(i);if(!D||!S||j(i,u)>0)return;var L={from:V(i.line,i.ch),to:w,tag:S[2]};return D=="selfClose"?{open:L,close:null,at:"open"}:S[1]?{open:s(i,S[2]),close:L,at:"close"}:(i=new W(t,w.line,w.ch,a),{open:L,close:o(i,S[2]),at:"open"})},Z.findEnclosingTag=function(t,u,a,i){for(var D=new W(t,u.line,u.ch,a);;){var w=s(D,i);if(!w)break;var S=new W(t,u.line,u.ch,a),L=o(S,w.tag);if(L)return{open:w,close:L}}},Z.scanForClosingTag=function(t,u,a,i){var D=new W(t,u.line,u.ch,i?{from:0,to:i}:null);return o(D,a)}})},p5ED:function(Bt,ve,T){"use strict";var Z=T("+L6B"),V=T("2/Rp"),j=T("5Dmo"),G=T("3S7+"),M=T("k1fw"),I=T("9og8"),W=T("tJVT"),C=T("WmNS"),r=T.n(C),A=T("q1tI"),v=T.n(A),f=T("vHTk"),p=T.n(f),l=T("yEEn"),o=T("ZW9T"),s=T("1vsH"),t=T("V0Rq"),u=T("m3rI");ve.a=function(a){var i,D,w,S,L,P,_,b=a.editOffice,g=b===void 0?"view":b,m=a.data,y=a.theme,x=a.type,O=a.filename,H=a.monacoEditor,F=a.className,R=a.style,U=a.close,k=a.onClose,d=a.hasMask,z=a.disabledDownload,Y=Object(A.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),re=Object(W.a)(Y,2),le=re[0],Ne=re[1],Ce=Object(A.useState)(""),Te=Object(W.a)(Ce,2),Fe=Te[0],Ve=Te[1],xe=Object(A.useState)(),ye=Object(W.a)(xe,2),oe=ye[0],Se=ye[1],_e=window.ENV==="build"?"/react/build":"",He=u.a.PROXY_SERVER||location.origin,rt,ae=1024*1024,$=10*ae,Q=Object(A.useRef)();(i=m)!==null&&i!==void 0&&i.startsWith("/api")&&x!=="txt"&&(m=u.a.API_SERVER+m),x==="office"&&(rt=Object(s.T)(m).filesize,rt>$&&(x="other")),O&&H&&(H.filename=O),Object(A.useEffect)(function(){var we,ft,Pt=(we=document.cookie)===null||we===void 0||((ft=we.replace(/\s/g,""))===null||ft===void 0)?void 0:ft.split(";");Pt==null||Pt.map(function(jt){var qe=jt.split("=");qe[0]==="_educoder_session"&&Ve(qe[1])})},[]),Object(A.useEffect)(function(){x==="office"&&te()},[x,m]);var te=function(){var we=Object(I.a)(r.a.mark(function ft(){var Pt,jt,qe;return r.a.wrap(function(sn){for(;;)switch(sn.prev=sn.next){case 0:return console.log("data:",m),Pt=m,m.startsWith("http")||(Pt=location.origin+Pt),jt=new URL(Pt).pathname.split("/").pop(),sn.next=6,Object(t.V)({attachment_id:jt});case 6:qe=sn.sent,Se(qe);case 8:case"end":return sn.stop()}},ft)}));return function(){return we.apply(this,arguments)}}(),he=function(){if(m.startsWith("http")||m.startsWith("blob:")){ge();return}Object(s.z)(O||"educoder",m,O)},ge=function(){Object(s.x)(O||"educoder",decodeURIComponent(m))};return v.a.createElement("div",{style:Object(M.a)({},R||{}),className:"".concat(d&&p.a.bgBlack," ").concat(x?p.a.wrp:"hide")},U&&v.a.createElement("div",{className:p.a.close,ref:Q},!z&&v.a.createElement(G.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Q.current}},v.a.createElement("span",{onClick:ge},v.a.createElement("i",{className:"icon-quxiaozhiding"}))),v.a.createElement(G.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Q.current}},v.a.createElement("span",{className:"",onClick:k},v.a.createElement("i",{className:"icon-guanbi1"})))),v.a.createElement("div",{className:"".concat(p.a[F]," ").concat(F," ").concat(p.a.monaco," ").concat(x==="txt"?"show":"hide")},x==="txt"&&v.a.createElement(o.b,H)),x==="audio"&&v.a.createElement("audio",{src:"".concat(((D=m)===null||D===void 0?void 0:D.indexOf("http://"))>-1||((w=m)===null||w===void 0?void 0:w.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(m),autoPlay:!0}),x==="video"&&v.a.createElement(v.a.Fragment,null,((S=m)===null||S===void 0?void 0:S.indexOf("http"))>-1?v.a.createElement("video",{controls:!0,src:"".concat(m),autoPlay:!0}):v.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(m),autoPlay:!0})),x==="office"&&oe&&v.a.createElement("iframe",{src:"".concat(_e,"/office.html?key=").concat(oe.key,"&url=").concat(He+oe.url,"&callbackUrl=").concat(He+oe.callbackUrl,"&fileType=").concat(oe.fileType,"&title=").concat(oe.title,"&model=").concat(g,"&officeServer=").concat(u.a.OFFICE_SERVER,"&disabledDownload=").concat(!!z)}),x==="html"&&v.a.createElement("iframe",{src:m+"&disposition=inline"}),x==="pdf"&&v.a.createElement("iframe",{src:"".concat(_e,"/js/pdfview/index.html?url=").concat(m,"&disabledDownload=").concat(!!z)}),x==="image"&&v.a.createElement("img",{src:"".concat(((L=m)===null||L===void 0?void 0:L.indexOf("http://"))>-1||((P=m)===null||P===void 0?void 0:P.indexOf("https://"))>-1||(_=m)!==null&&_!==void 0&&_.startsWith("/api")?"":"data:image/png;base64,").concat(m)}),x==="other"&&v.a.createElement("div",null,v.a.createElement(V.a,{type:"primary",size:"large",onClick:he},v.a.createElement(l.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),x==="download"&&v.a.createElement(V.a,{type:"primary",size:"large",onClick:he},v.a.createElement(l.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Bt,ve,T){},pmY6:function(Bt,ve,T){"use strict";T.d(ve,"h",function(){return A}),T.d(ve,"g",function(){return f}),T.d(ve,"f",function(){return p}),T.d(ve,"e",function(){return l}),T.d(ve,"i",function(){return o}),T.d(ve,"b",function(){return s}),T.d(ve,"a",function(){return t}),T.d(ve,"d",function(){return u}),T.d(ve,"c",function(){return a});var Z=T("C/vA"),V=T("JYp7");const j=!1;let G=null;function M(i){G=i}if(j){const i="__is_disposable_tracked__";M(new class{trackDisposable(D){const w=new Error("Potentially leaked disposable").stack;setTimeout(()=>{D[i]||console.log(w)},3e3)}setParent(D,w){if(D&&D!==t.None)try{D[i]=!0}catch(S){}}markAsDisposed(D){if(D&&D!==t.None)try{D[i]=!0}catch(w){}}markAsSingleton(D){}})}function I(i){return G==null||G.trackDisposable(i),i}function W(i){G==null||G.markAsDisposed(i)}function C(i,D){G==null||G.setParent(i,D)}function r(i,D){if(!G)return;for(const w of i)G.setParent(w,D)}function A(i){return G==null||G.markAsSingleton(i),i}class v extends Error{constructor(i){super(`Encountered errors while disposing of store. Errors: [${i.join(", ")}]`);this.errors=i}}function f(i){return typeof i.dispose=="function"&&i.dispose.length===0}function p(i){if(V.a.is(i)){let D=[];for(const w of i)if(w)try{w.dispose()}catch(S){D.push(S)}if(D.length===1)throw D[0];if(D.length>1)throw new v(D);return Array.isArray(i)?[]:i}else if(i)return i.dispose(),i}function l(...i){const D=o(()=>p(i));return r(i,D),D}function o(i){const D=I({dispose:Object(Z.a)(()=>{W(D),i()})});return D}class s{constructor(){this._toDispose=new Set,this._isDisposed=!1,I(this)}dispose(){if(this._isDisposed)return;W(this),this._isDisposed=!0,this.clear()}clear(){try{p(this._toDispose.values())}finally{this._toDispose.clear()}}add(i){if(!i)return i;if(i===this)throw new Error("Cannot register a disposable on itself!");return C(i,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(i),i}}s.DISABLE_DISPOSED_WARNING=!1;class t{constructor(){this._store=new s,I(this),C(this._store,this)}dispose(){W(this),this._store.dispose()}_register(i){if(i===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(i)}}t.None=Object.freeze({dispose(){}});class u{constructor(){this._isDisposed=!1,I(this)}get value(){return this._isDisposed?void 0:this._value}set value(i){var D;if(this._isDisposed||i===this._value)return;(D=this._value)===null||D===void 0||D.dispose(),i&&C(i,this),this._value=i}clear(){this.value=void 0}dispose(){var i;this._isDisposed=!0,W(this),(i=this._value)===null||i===void 0||i.dispose(),this._value=void 0}clearAndLeak(){const i=this._value;return this._value=void 0,i&&C(i,null),i}}class a{constructor(i){this.object=i}dispose(){}}},psGv:function(Bt,ve,T){var Z,V;(function(){var j;(function(){"use strict";var W=[,,function(v){function f(o){this.__parent=o,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 o=new f(this.__parent);return o.set_indent(this.__indent_count,this.__alignment_count),o},f.prototype.item=function(o){return o<0?this.__items[this.__items.length+o]:this.__items[o]},f.prototype.has_match=function(o){for(var s=this.__items.length-1;s>=0;s--)if(this.__items[s].match(o))return!0;return!1},f.prototype.set_indent=function(o,s){this.is_empty()&&(this.__indent_count=o||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 o=this.__parent.current_line;return o.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),o.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),o.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,o.__items[0]===" "&&(o.__items.splice(0,1),o.__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(o){this.__items.push(o);var s=o.lastIndexOf(`
`);s!==-1?this.__character_count=o.length-s:this.__character_count+=o.length},f.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},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 o="";return this.is_empty()?this.__parent.indent_empty_lines&&(o=this.__parent.get_indent_string(this.__indent_count)):(o=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),o+=this.__items.join("")),o};function p(o,s){this.__cache=[""],this.__indent_size=o.indent_size,this.__indent_string=o.indent_char,o.indent_with_tabs||(this.__indent_string=new Array(o.indent_size+1).join(o.indent_char)),s=s||"",o.indent_level>0&&(s=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=s,this.__base_string_length=s.length}p.prototype.get_indent_size=function(o,s){var t=this.__base_string_length;return s=s||0,o<0&&(t=0),t+=o*this.__indent_size,t+=s,t},p.prototype.get_indent_string=function(o,s){var t=this.__base_string;return s=s||0,o<0&&(o=0,t=""),s+=o*this.__indent_size,this.__ensure_cache(s),t+=this.__cache[s],t},p.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var o=this.__cache.length,s=0,t="";this.__indent_size&&o>=this.__indent_size&&(s=Math.floor(o/this.__indent_size),o-=s*this.__indent_size,t=new Array(s+1).join(this.__indent_string)),o&&(t+=new Array(o+1).join(" ")),this.__cache.push(t)};function l(o,s){this.__indent_cache=new p(o,s),this.raw=!1,this._end_with_newline=o.end_with_newline,this.indent_size=o.indent_size,this.wrap_line_length=o.wrap_line_length,this.indent_empty_lines=o.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()}l.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},l.prototype.get_line_number=function(){return this.__lines.length},l.prototype.get_indent_string=function(o,s){return this.__indent_cache.get_indent_string(o,s)},l.prototype.get_indent_size=function(o,s){return this.__indent_cache.get_indent_size(o,s)},l.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},l.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},l.prototype.get_code=function(o){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 t=this.__lines.join(`
`);return o!==`
`&&(t=t.replace(/[\n]/g,o)),t},l.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},l.prototype.set_indent=function(o,s){return o=o||0,s=s||0,this.next_line.set_indent(o,s),this.__lines.length>1?(this.current_line.set_indent(o,s),!0):(this.current_line.set_indent(),!1)},l.prototype.add_raw_token=function(o){for(var s=0;s<o.newlines;s++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(o.whitespace_before),this.current_line.push(o.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},l.prototype.add_token=function(o){this.__add_space_before_token(),this.current_line.push(o),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},l.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(" "))},l.prototype.remove_indent=function(o){for(var s=this.__lines.length;o<s;)this.__lines[o]._remove_indent(),o++;this.current_line._remove_wrap_indent()},l.prototype.trim=function(o){for(o=o===void 0?!1:o,this.current_line.trim();o&&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},l.prototype.just_added_newline=function(){return this.current_line.is_empty()},l.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},l.prototype.ensure_empty_line_above=function(o,s){for(var t=this.__lines.length-2;t>=0;){var u=this.__lines[t];if(u.is_empty())break;if(u.item(0).indexOf(o)!==0&&u.item(-1)!==s){this.__lines.splice(t+1,0,new f(this)),this.previous_line=this.__lines[this.__lines.length-2];break}t--}},v.exports.Output=l},function(v){function f(p,l,o,s){this.type=p,this.text=l,this.comments_before=null,this.newlines=o||0,this.whitespace_before=s||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}v.exports.Token=f},,,function(v){function f(o,s){this.raw_options=p(o,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(o,s){var t=this.raw_options[o],u=s||[];return typeof t=="object"?t!==null&&typeof t.concat=="function"&&(u=t.concat()):typeof t=="string"&&(u=t.split(/[^a-zA-Z0-9_\/\-]+/)),u},f.prototype._get_boolean=function(o,s){var t=this.raw_options[o],u=t===void 0?!!s:!!t;return u},f.prototype._get_characters=function(o,s){var t=this.raw_options[o],u=s||"";return typeof t=="string"&&(u=t.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),u},f.prototype._get_number=function(o,s){var t=this.raw_options[o];s=parseInt(s,10),isNaN(s)&&(s=0);var u=parseInt(t,10);return isNaN(u)&&(u=s),u},f.prototype._get_selection=function(o,s,t){var u=this._get_selection_list(o,s,t);if(u.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values:
`+s+`
You passed in: '`+this.raw_options[o]+"'");return u[0]},f.prototype._get_selection_list=function(o,s,t){if(!s||s.length===0)throw new Error("Selection list cannot be empty.");if(t=t||[s[0]],!this._is_valid_selection(t,s))throw new Error("Invalid Default Value!");var u=this._get_array(o,t);if(!this._is_valid_selection(u,s))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values:
`+s+`
You passed in: '`+this.raw_options[o]+"'");return u},f.prototype._is_valid_selection=function(o,s){return o.length&&s.length&&!o.some(function(t){return s.indexOf(t)===-1})};function p(o,s){var t={};o=l(o);var u;for(u in o)u!==s&&(t[u]=o[u]);if(s&&o[s])for(u in o[s])t[u]=o[s][u];return t}function l(o){var s={},t;for(t in o){var u=t.replace(/-/g,"_");s[u]=o[t]}return s}v.exports.Options=f,v.exports.normalizeOpts=l,v.exports.mergeOpts=p},,function(v){var f=RegExp.prototype.hasOwnProperty("sticky");function p(l){this.__input=l||"",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 l=null;return this.hasNext()&&(l=this.__input.charAt(this.__position),this.__position+=1),l},p.prototype.peek=function(l){var o=null;return l=l||0,l+=this.__position,l>=0&&l<this.__input_length&&(o=this.__input.charAt(l)),o},p.prototype.__match=function(l,o){l.lastIndex=o;var s=l.exec(this.__input);return s&&!(f&&l.sticky)&&(s.index!==o&&(s=null)),s},p.prototype.test=function(l,o){return o=o||0,o+=this.__position,o>=0&&o<this.__input_length?!!this.__match(l,o):!1},p.prototype.testChar=function(l,o){var s=this.peek(o);return l.lastIndex=0,s!==null&&l.test(s)},p.prototype.match=function(l){var o=this.__match(l,this.__position);return o?this.__position+=o[0].length:o=null,o},p.prototype.read=function(l,o,s){var t="",u;return l&&(u=this.match(l),u&&(t+=u[0])),o&&(u||!l)&&(t+=this.readUntil(o,s)),t},p.prototype.readUntil=function(l,o){var s="",t=this.__position;l.lastIndex=this.__position;var u=l.exec(this.__input);return u?(t=u.index,o&&(t+=u[0].length)):t=this.__input_length,s=this.__input.substring(this.__position,t),this.__position=t,s},p.prototype.readUntilAfter=function(l){return this.readUntil(l,!0)},p.prototype.get_regexp=function(l,o){var s=null,t="g";return o&&f&&(t="y"),typeof l=="string"&&l!==""?s=new RegExp(l,t):l&&(s=new RegExp(l.source,t)),s},p.prototype.get_literal_regexp=function(l){return RegExp(l.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},p.prototype.peekUntilAfter=function(l){var o=this.__position,s=this.readUntilAfter(l);return this.__position=o,s},p.prototype.lookBack=function(l){var o=this.__position-1;return o>=l.length&&this.__input.substring(o-l.length,o).toLowerCase()===l},v.exports.InputScanner=p},function(v,f,p){var l=p(8).InputScanner,o=p(3).Token,s=p(10).TokenStream,t=p(11).WhitespacePattern,u={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},a=function(i,D){this._input=new l(i),this._options=D||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new t(this._input)};a.prototype.tokenize=function(){this._input.restart(),this.__tokens=new s,this._reset();for(var i,D=new o(u.START,""),w=null,S=[],L=new s;D.type!==u.EOF;){for(i=this._get_next_token(D,w);this._is_comment(i);)L.add(i),i=this._get_next_token(D,w);L.isEmpty()||(i.comments_before=L,L=new s),i.parent=w,this._is_opening(i)?(S.push(w),w=i):w&&this._is_closing(i,w)&&(i.opened=w,w.closed=i,w=S.pop(),i.parent=w),i.previous=D,D.next=i,this.__tokens.add(i),D=i}return this.__tokens},a.prototype._is_first_token=function(){return this.__tokens.isEmpty()},a.prototype._reset=function(){},a.prototype._get_next_token=function(i,D){this._readWhitespace();var w=this._input.read(/.+/g);return w?this._create_token(u.RAW,w):this._create_token(u.EOF,"")},a.prototype._is_comment=function(i){return!1},a.prototype._is_opening=function(i){return!1},a.prototype._is_closing=function(i,D){return!1},a.prototype._create_token=function(i,D){var w=new o(i,D,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return w},a.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},v.exports.Tokenizer=a,v.exports.TOKEN=u},function(v){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 l=null;return p=p||0,p+=this.__position,p>=0&&p<this.__tokens_length&&(l=this.__tokens[p]),l},f.prototype.add=function(p){this.__parent_token&&(p.parent=this.__parent_token),this.__tokens.push(p),this.__tokens_length+=1},v.exports.TokenStream=f},function(v,f,p){var l=p(12).Pattern;function o(s,t){l.call(this,s,t),t?this._line_regexp=this._input.get_regexp(t._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}o.prototype=new l,o.prototype.__set_whitespace_patterns=function(s,t){s+="\\t ",t+="\\n\\r",this._match_pattern=this._input.get_regexp("["+s+t+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+t+"]")},o.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 t=this.__split(this._newline_regexp,s);this.newline_count=t.length-1,this.whitespace_before_token=t[this.newline_count]}return s},o.prototype.matching=function(s,t){var u=this._create();return u.__set_whitespace_patterns(s,t),u._update(),u},o.prototype._create=function(){return new o(this._input,this)},o.prototype.__split=function(s,t){s.lastIndex=0;for(var u=0,a=[],i=s.exec(t);i;)a.push(t.substring(u,i.index)),u=i.index+i[0].length,i=s.exec(t);return u<t.length?a.push(t.substring(u,t.length)):a.push(""),a},v.exports.WhitespacePattern=o},function(v){function f(p,l){this._input=p,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,l&&(this._starting_pattern=this._input.get_regexp(l._starting_pattern,!0),this._match_pattern=this._input.get_regexp(l._match_pattern,!0),this._until_pattern=this._input.get_regexp(l._until_pattern),this._until_after=l._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 l=this._create();return l._until_after=!0,l._until_pattern=this._input.get_regexp(p),l._update(),l},f.prototype.until=function(p){var l=this._create();return l._until_after=!1,l._until_pattern=this._input.get_regexp(p),l._update(),l},f.prototype.starting_with=function(p){var l=this._create();return l._starting_pattern=this._input.get_regexp(p,!0),l._update(),l},f.prototype.matching=function(p){var l=this._create();return l._match_pattern=this._input.get_regexp(p,!0),l._update(),l},f.prototype._create=function(){return new f(this._input,this)},f.prototype._update=function(){},v.exports.Pattern=f},function(v){function f(p,l){p=typeof p=="string"?p:p.source,l=typeof l=="string"?l:l.source,this.__directives_block_pattern=new RegExp(p+/ beautify( \w+[:]\w+)+ /.source+l,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(p+/\sbeautify\signore:end\s/.source+l,"g")}f.prototype.get_directives=function(p){if(!p.match(this.__directives_block_pattern))return null;var l={};this.__directive_pattern.lastIndex=0;for(var o=this.__directive_pattern.exec(p);o;)l[o[1]]=o[2],o=this.__directive_pattern.exec(p);return l},f.prototype.readIgnored=function(p){return p.readUntilAfter(this.__directives_end_ignore_pattern)},v.exports.Directives=f},function(v,f,p){var l=p(12).Pattern,o={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function s(t,u){l.call(this,t,u),this.__template_pattern=null,this._disabled=Object.assign({},o),this._excluded=Object.assign({},o),u&&(this.__template_pattern=this._input.get_regexp(u.__template_pattern),this._excluded=Object.assign(this._excluded,u._excluded),this._disabled=Object.assign(this._disabled,u._disabled));var a=new l(t);this.__patterns={handlebars_comment:a.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:a.starting_with(/{{{/).until_after(/}}}/),handlebars:a.starting_with(/{{/).until_after(/}}/),php:a.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:a.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:a.starting_with(/{%/).until_after(/%}/),django_value:a.starting_with(/{{/).until_after(/}}/),django_comment:a.starting_with(/{#/).until_after(/#}/),smarty:a.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:a.starting_with(/{\*/).until_after(/\*}/),smarty_literal:a.starting_with(/{literal}/).until_after(/{\/literal}/)}}s.prototype=new l,s.prototype._create=function(){return new s(this._input,this)},s.prototype._update=function(){this.__set_templated_pattern()},s.prototype.disable=function(t){var u=this._create();return u._disabled[t]=!0,u._update(),u},s.prototype.read_options=function(t){var u=this._create();for(var a in o)u._disabled[a]=t.templating.indexOf(a)===-1;return u._update(),u},s.prototype.exclude=function(t){var u=this._create();return u._excluded[t]=!0,u._update(),u},s.prototype.read=function(){var t="";this._match_pattern?t=this._input.read(this._starting_pattern):t=this._input.read(this._starting_pattern,this.__template_pattern);for(var u=this._read_template();u;)this._match_pattern?u+=this._input.read(this._match_pattern):u+=this._input.readUntil(this.__template_pattern),t+=u,u=this._read_template();return this._until_after&&(t+=this._input.readUntilAfter(this._until_pattern)),t},s.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||t.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")},s.prototype._read_template=function(){var t="",u=this._input.peek();if(u==="<"){var a=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&a==="?"&&(t=t||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&a==="%"&&(t=t||this.__patterns.erb.read())}else u==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(t=t||this.__patterns.handlebars_comment.read(),t=t||this.__patterns.handlebars_unescaped.read(),t=t||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(t=t||this.__patterns.django_value.read()),this._excluded.django||(t=t||this.__patterns.django_comment.read(),t=t||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(t=t||this.__patterns.smarty_comment.read(),t=t||this.__patterns.smarty_literal.read(),t=t||this.__patterns.smarty.read()));return t},v.exports.TemplatablePattern=s},,,,function(v,f,p){var l=p(19).Beautifier,o=p(20).Options;function s(t,u,a,i){var D=new l(t,u,a,i);return D.beautify()}v.exports=s,v.exports.defaultOptions=function(){return new o}},function(v,f,p){var l=p(20).Options,o=p(2).Output,s=p(21).Tokenizer,t=p(21).TOKEN,u=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,i=function(y,x){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=y.max_preserve_newlines,this.preserve_newlines=y.preserve_newlines,this._output=new o(y,x)};i.prototype.current_line_has_match=function(y){return this._output.current_line.has_match(y)},i.prototype.set_space_before_token=function(y,x){this._output.space_before_token=y,this._output.non_breaking_space=x},i.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},i.prototype.add_raw_token=function(y){this._output.add_raw_token(y)},i.prototype.print_preserved_newlines=function(y){var x=0;y.type!==t.TEXT&&y.previous.type!==t.TEXT&&(x=y.newlines?1:0),this.preserve_newlines&&(x=y.newlines<this.max_preserve_newlines+1?y.newlines:this.max_preserve_newlines+1);for(var O=0;O<x;O++)this.print_newline(O>0);return x!==0},i.prototype.traverse_whitespace=function(y){return y.whitespace_before||y.newlines?(this.print_preserved_newlines(y)||(this._output.space_before_token=!0),!0):!1},i.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},i.prototype.print_newline=function(y){this._output.add_new_line(y)},i.prototype.print_token=function(y){y.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(y.text))},i.prototype.indent=function(){this.indent_level++},i.prototype.get_full_indent=function(y){return y=this.indent_level+(y||0),y<1?"":this._output.get_indent_string(y)};var D=function(y){for(var x=null,O=y.next;O.type!==t.EOF&&y.closed!==O;){if(O.type===t.ATTRIBUTE&&O.text==="type"){O.next&&O.next.type===t.EQUALS&&O.next.next&&O.next.next.type===t.VALUE&&(x=O.next.next.text);break}O=O.next}return x},w=function(y,x){var O=null,H=null;return x.closed?(y==="script"?O="text/javascript":y==="style"&&(O="text/css"),O=D(x)||O,O.search("text/css")>-1?H="css":O.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?H="javascript":O.search(/(text|application|dojo)\/(x-)?(html)/)>-1?H="html":O.search(/test\/null/)>-1&&(H="null"),H):null};function S(y,x){return x.indexOf(y)!==-1}function L(y,x,O){this.parent=y||null,this.tag=x?x.tag_name:"",this.indent_level=O||0,this.parser_token=x||null}function P(y){this._printer=y,this._current_frame=null}P.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},P.prototype.record_tag=function(y){var x=new L(this._current_frame,y,this._printer.indent_level);this._current_frame=x},P.prototype._try_pop_frame=function(y){var x=null;return y&&(x=y.parser_token,this._printer.indent_level=y.indent_level,this._current_frame=y.parent),x},P.prototype._get_frame=function(y,x){for(var O=this._current_frame;O&&!(y.indexOf(O.tag)!==-1);){if(x&&x.indexOf(O.tag)!==-1){O=null;break}O=O.parent}return O},P.prototype.try_pop=function(y,x){var O=this._get_frame([y],x);return this._try_pop_frame(O)},P.prototype.indent_to_tag=function(y){var x=this._get_frame(y);x&&(this._printer.indent_level=x.indent_level)};function _(y,x,O,H){this._source_text=y||"",x=x||{},this._js_beautify=O,this._css_beautify=H,this._tag_stack=null;var F=new l(x,"html");this._options=F,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"}_.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var y=this._source_text,x=this._options.eol;this._options.eol==="auto"&&(x=`
`,y&&u.test(y)&&(x=y.match(u)[0])),y=y.replace(a,`
`);var O=y.match(/^[\t ]*/)[0],H={text:"",type:""},F=new b,R=new i(this._options,O),U=new s(y,this._options).tokenize();this._tag_stack=new P(R);for(var k=null,d=U.next();d.type!==t.EOF;)d.type===t.TAG_OPEN||d.type===t.COMMENT?(k=this._handle_tag_open(R,d,F,H),F=k):d.type===t.ATTRIBUTE||d.type===t.EQUALS||d.type===t.VALUE||d.type===t.TEXT&&!F.tag_complete?k=this._handle_inside_tag(R,d,F,U):d.type===t.TAG_CLOSE?k=this._handle_tag_close(R,d,F):d.type===t.TEXT?k=this._handle_text(R,d,F):R.add_raw_token(d),H=k,d=U.next();var z=R._output.get_code(x);return z},_.prototype._handle_tag_close=function(y,x,O){var H={text:x.text,type:x.type};return y.alignment_size=0,O.tag_complete=!0,y.set_space_before_token(x.newlines||x.whitespace_before!=="",!0),O.is_unformatted?y.add_raw_token(x):(O.tag_start_char==="<"&&(y.set_space_before_token(x.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&O.has_wrapped_attrs&&y.print_newline(!1)),y.print_token(x)),O.indent_content&&!(O.is_unformatted||O.is_content_unformatted)&&(y.indent(),O.indent_content=!1),!O.is_inline_element&&!(O.is_unformatted||O.is_content_unformatted)&&y.set_wrap_point(),H},_.prototype._handle_inside_tag=function(y,x,O,H){var F=O.has_wrapped_attrs,R={text:x.text,type:x.type};if(y.set_space_before_token(x.newlines||x.whitespace_before!=="",!0),O.is_unformatted)y.add_raw_token(x);else if(O.tag_start_char==="{"&&x.type===t.TEXT)y.print_preserved_newlines(x)?(x.newlines=0,y.add_raw_token(x)):y.print_token(x);else{if(x.type===t.ATTRIBUTE?(y.set_space_before_token(!0),O.attr_count+=1):(x.type===t.EQUALS||x.type===t.VALUE&&x.previous.type===t.EQUALS)&&y.set_space_before_token(!1),x.type===t.ATTRIBUTE&&O.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(y.traverse_whitespace(x),F=F||x.newlines!==0),this._is_wrap_attributes_force)){var U=O.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&O.attr_count===1){var k=!0,d=0,z;do{if(z=H.peek(d),z.type===t.ATTRIBUTE){k=!1;break}d+=1}while(d<4&&z.type!==t.EOF&&z.type!==t.TAG_CLOSE);U=!k}U&&(y.print_newline(!1),F=!0)}y.print_token(x),F=F||y.previous_token_wrapped(),O.has_wrapped_attrs=F}return R},_.prototype._handle_text=function(y,x,O){var H={text:x.text,type:"TK_CONTENT"};return O.custom_beautifier_name?this._print_custom_beatifier_text(y,x,O):O.is_unformatted||O.is_content_unformatted?y.add_raw_token(x):(y.traverse_whitespace(x),y.print_token(x)),H},_.prototype._print_custom_beatifier_text=function(y,x,O){var H=this;if(x.text!==""){var F=x.text,R,U=1,k="",d="";O.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?R=this._js_beautify:O.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?R=this._css_beautify:O.custom_beautifier_name==="html"&&(R=function(Ce,Te){var Fe=new _(Ce,Te,H._js_beautify,H._css_beautify);return Fe.beautify()}),this._options.indent_scripts==="keep"?U=0:this._options.indent_scripts==="separate"&&(U=-y.indent_level);var z=y.get_full_indent(U);if(F=F.replace(/\n[ \t]*$/,""),O.custom_beautifier_name!=="html"&&F[0]==="<"&&F.match(/^(<!--|<!\[CDATA\[)/)){var Y=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(F);if(!Y){y.add_raw_token(x);return}k=z+Y[1]+`
`,F=Y[4],Y[5]&&(d=z+Y[5]),F=F.replace(/\n[ \t]*$/,""),(Y[2]||Y[3].indexOf(`
`)!==-1)&&(Y=Y[3].match(/[ \t]+$/),Y&&(x.whitespace_before=Y[0]))}if(F)if(R){var re=function(){this.eol=`
`};re.prototype=this._options.raw_options;var le=new re;F=R(z+F,le)}else{var Ne=x.whitespace_before;Ne&&(F=F.replace(new RegExp(`
(`+Ne+")?","g"),`
`)),F=z+F.replace(/\n/g,`
`+z)}k&&(F?F=k+F+`
`+d:F=k+d),y.print_newline(!1),F&&(x.text=F,x.whitespace_before="",x.newlines=0,y.add_raw_token(x),y.print_newline(!0))}},_.prototype._handle_tag_open=function(y,x,O,H){var F=this._get_tag_open_token(x);return(O.is_unformatted||O.is_content_unformatted)&&!O.is_empty_element&&x.type===t.TAG_OPEN&&x.text.indexOf("</")===0?(y.add_raw_token(x),F.start_tag_token=this._tag_stack.try_pop(F.tag_name)):(y.traverse_whitespace(x),this._set_tag_position(y,x,F,O,H),F.is_inline_element||y.set_wrap_point(),y.print_token(x)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(F.alignment_size=x.text.length+1),!F.tag_complete&&!F.is_unformatted&&(y.alignment_size=F.alignment_size),F};var b=function(y,x){if(this.parent=y||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="",!x)this.tag_complete=!0;else{var O;this.tag_start_char=x.text[0],this.text=x.text,this.tag_start_char==="<"?(O=x.text.match(/^<([^\s>]*)/),this.tag_check=O?O[1]:""):(O=x.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=O?O[1]:"",(x.text.startsWith("{{#>")||x.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&x.next!==null?this.tag_check=x.next.text.split(" ")[0]:this.tag_check=x.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),x.type===t.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||x.closed&&x.closed.text==="/>";var H=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(H=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(H)))}};_.prototype._get_tag_open_token=function(y){var x=new b(this._tag_stack.get_parser_token(),y);return x.alignment_size=this._options.wrap_attributes_indent_size,x.is_end_tag=x.is_end_tag||S(x.tag_check,this._options.void_elements),x.is_empty_element=x.tag_complete||x.is_start_tag&&x.is_end_tag,x.is_unformatted=!x.tag_complete&&S(x.tag_check,this._options.unformatted),x.is_content_unformatted=!x.is_empty_element&&S(x.tag_check,this._options.content_unformatted),x.is_inline_element=S(x.tag_name,this._options.inline)||x.tag_name.includes("-")||x.tag_start_char==="{",x},_.prototype._set_tag_position=function(y,x,O,H,F){if(O.is_empty_element||(O.is_end_tag?O.start_tag_token=this._tag_stack.try_pop(O.tag_name):(this._do_optional_end_element(O)&&(O.is_inline_element||y.print_newline(!1)),this._tag_stack.record_tag(O),(O.tag_name==="script"||O.tag_name==="style")&&!(O.is_unformatted||O.is_content_unformatted)&&(O.custom_beautifier_name=w(O.tag_check,x)))),S(O.tag_check,this._options.extra_liners)&&(y.print_newline(!1),y._output.just_added_blankline()||y.print_newline(!0)),O.is_empty_element){if(O.tag_start_char==="{"&&O.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),O.indent_content=!0;var R=y.current_line_has_match(/{{#if/);R||y.print_newline(!1)}O.tag_name==="!--"&&F.type===t.TAG_CLOSE&&H.is_end_tag&&O.text.indexOf(`
`)===-1||(O.is_inline_element||O.is_unformatted||y.print_newline(!1),this._calcluate_parent_multiline(y,O))}else if(O.is_end_tag){var U=!1;U=O.start_tag_token&&O.start_tag_token.multiline_content,U=U||!O.is_inline_element&&!(H.is_inline_element||H.is_unformatted)&&!(F.type===t.TAG_CLOSE&&O.start_tag_token===H)&&F.type!=="TK_CONTENT",(O.is_content_unformatted||O.is_unformatted)&&(U=!1),U&&y.print_newline(!1)}else O.indent_content=!O.custom_beautifier_name,O.tag_start_char==="<"&&(O.tag_name==="html"?O.indent_content=this._options.indent_inner_html:O.tag_name==="head"?O.indent_content=this._options.indent_head_inner_html:O.tag_name==="body"&&(O.indent_content=this._options.indent_body_inner_html)),!(O.is_inline_element||O.is_unformatted)&&(F.type!=="TK_CONTENT"||O.is_content_unformatted)&&y.print_newline(!1),this._calcluate_parent_multiline(y,O)},_.prototype._calcluate_parent_multiline=function(y,x){x.parent&&y._output.just_added_newline()&&!((x.is_inline_element||x.is_unformatted)&&x.parent.is_inline_element)&&(x.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"],m=["a","audio","del","ins","map","noscript","video"];_.prototype._do_optional_end_element=function(y){var x=null;if(y.is_empty_element||!y.is_start_tag||!y.parent)return;if(y.tag_name==="body")x=x||this._tag_stack.try_pop("head");else if(y.tag_name==="li")x=x||this._tag_stack.try_pop("li",["ol","ul"]);else if(y.tag_name==="dd"||y.tag_name==="dt")x=x||this._tag_stack.try_pop("dt",["dl"]),x=x||this._tag_stack.try_pop("dd",["dl"]);else if(y.parent.tag_name==="p"&&g.indexOf(y.tag_name)!==-1){var O=y.parent.parent;(!O||m.indexOf(O.tag_name)===-1)&&(x=x||this._tag_stack.try_pop("p"))}else y.tag_name==="rp"||y.tag_name==="rt"?(x=x||this._tag_stack.try_pop("rt",["ruby","rtc"]),x=x||this._tag_stack.try_pop("rp",["ruby","rtc"])):y.tag_name==="optgroup"?x=x||this._tag_stack.try_pop("optgroup",["select"]):y.tag_name==="option"?x=x||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):y.tag_name==="colgroup"?x=x||this._tag_stack.try_pop("caption",["table"]):y.tag_name==="thead"?(x=x||this._tag_stack.try_pop("caption",["table"]),x=x||this._tag_stack.try_pop("colgroup",["table"])):y.tag_name==="tbody"||y.tag_name==="tfoot"?(x=x||this._tag_stack.try_pop("caption",["table"]),x=x||this._tag_stack.try_pop("colgroup",["table"]),x=x||this._tag_stack.try_pop("thead",["table"]),x=x||this._tag_stack.try_pop("tbody",["table"])):y.tag_name==="tr"?(x=x||this._tag_stack.try_pop("caption",["table"]),x=x||this._tag_stack.try_pop("colgroup",["table"]),x=x||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(y.tag_name==="th"||y.tag_name==="td")&&(x=x||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),x=x||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return y.parent=this._tag_stack.get_parser_token(),x},v.exports.Beautifier=_},function(v,f,p){var l=p(6).Options;function o(s){l.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"])}o.prototype=new l,v.exports.Options=o},function(v,f,p){var l=p(9).Tokenizer,o=p(9).TOKEN,s=p(13).Directives,t=p(14).TemplatablePattern,u=p(12).Pattern,a={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:o.START,RAW:o.RAW,EOF:o.EOF},i=new s(/<\!--/,/-->/),D=function(w,S){l.call(this,w,S),this._current_tag_name="";var L=new t(this._input).read_options(this._options),P=new u(this._input);if(this.__patterns={word:L.until(/[\n\r\t <]/),single_quote:L.until_after(/'/),double_quote:L.until_after(/"/),attribute:L.until(/[\n\r\t =>]|\/>/),element_name:L.until(/[\n\r\t >\/]/),handlebars_comment:P.starting_with(/{{!--/).until_after(/--}}/),handlebars:P.starting_with(/{{/).until_after(/}}/),handlebars_open:P.until(/[\n\r\t }]/),handlebars_raw_close:P.until(/}}/),comment:P.starting_with(/<!--/).until_after(/-->/),cdata:P.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:P.starting_with(/<!\[/).until_after(/]>/),processing:P.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 _=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=P.matching(_).until_after(_)}};D.prototype=new l,D.prototype._is_comment=function(w){return!1},D.prototype._is_opening=function(w){return w.type===a.TAG_OPEN},D.prototype._is_closing=function(w,S){return w.type===a.TAG_CLOSE&&S&&((w.text===">"||w.text==="/>")&&S.text[0]==="<"||w.text==="}}"&&S.text[0]==="{"&&S.text[1]==="{")},D.prototype._reset=function(){this._current_tag_name=""},D.prototype._get_next_token=function(w,S){var L=null;this._readWhitespace();var P=this._input.peek();return P===null?this._create_token(a.EOF,""):(L=L||this._read_open_handlebars(P,S),L=L||this._read_attribute(P,w,S),L=L||this._read_close(P,S),L=L||this._read_raw_content(P,w,S),L=L||this._read_content_word(P),L=L||this._read_comment_or_cdata(P),L=L||this._read_processing(P),L=L||this._read_open(P,S),L=L||this._create_token(a.UNKNOWN,this._input.next()),L)},D.prototype._read_comment_or_cdata=function(w){var S=null,L=null,P=null;if(w==="<"){var _=this._input.peek(1);_==="!"&&(L=this.__patterns.comment.read(),L?(P=i.get_directives(L),P&&P.ignore==="start"&&(L+=i.readIgnored(this._input))):L=this.__patterns.cdata.read()),L&&(S=this._create_token(a.COMMENT,L),S.directives=P)}return S},D.prototype._read_processing=function(w){var S=null,L=null,P=null;if(w==="<"){var _=this._input.peek(1);(_==="!"||_==="?")&&(L=this.__patterns.conditional_comment.read(),L=L||this.__patterns.processing.read()),L&&(S=this._create_token(a.COMMENT,L),S.directives=P)}return S},D.prototype._read_open=function(w,S){var L=null,P=null;return S||w==="<"&&(L=this._input.next(),this._input.peek()==="/"&&(L+=this._input.next()),L+=this.__patterns.element_name.read(),P=this._create_token(a.TAG_OPEN,L)),P},D.prototype._read_open_handlebars=function(w,S){var L=null,P=null;return S||this._options.indent_handlebars&&w==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(L=this.__patterns.handlebars_comment.read(),L=L||this.__patterns.handlebars.read(),P=this._create_token(a.COMMENT,L)):(L=this.__patterns.handlebars_open.read(),P=this._create_token(a.TAG_OPEN,L))),P},D.prototype._read_close=function(w,S){var L=null,P=null;return S&&(S.text[0]==="<"&&(w===">"||w==="/"&&this._input.peek(1)===">")?(L=this._input.next(),w==="/"&&(L+=this._input.next()),P=this._create_token(a.TAG_CLOSE,L)):S.text[0]==="{"&&w==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),P=this._create_token(a.TAG_CLOSE,"}}"))),P},D.prototype._read_attribute=function(w,S,L){var P=null,_="";if(L&&L.text[0]==="<")if(w==="=")P=this._create_token(a.EQUALS,this._input.next());else if(w==='"'||w==="'"){var b=this._input.next();w==='"'?b+=this.__patterns.double_quote.read():b+=this.__patterns.single_quote.read(),P=this._create_token(a.VALUE,b)}else _=this.__patterns.attribute.read(),_&&(S.type===a.EQUALS?P=this._create_token(a.VALUE,_):P=this._create_token(a.ATTRIBUTE,_));return P},D.prototype._is_content_unformatted=function(w){return this._options.void_elements.indexOf(w)===-1&&(this._options.content_unformatted.indexOf(w)!==-1||this._options.unformatted.indexOf(w)!==-1)},D.prototype._read_raw_content=function(w,S,L){var P="";if(L&&L.text[0]==="{")P=this.__patterns.handlebars_raw_close.read();else if(S.type===a.TAG_CLOSE&&S.opened.text[0]==="<"&&S.text[0]!=="/"){var _=S.opened.text.substr(1).toLowerCase();if(_==="script"||_==="style"){var b=this._read_comment_or_cdata(w);if(b)return b.type=a.TEXT,b;P=this._input.readUntil(new RegExp("</"+_+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(_)&&(P=this._input.readUntil(new RegExp("</"+_+"[\\n\\r\\t ]*?>","ig")))}return P?this._create_token(a.TEXT,P):null},D.prototype._read_content_word=function(w){var S="";if(this._options.unformatted_content_delimiter&&(w===this._options.unformatted_content_delimiter[0]&&(S=this.__patterns.unformatted_content_delimiter.read())),S||(S=this.__patterns.word.read()),S)return this._create_token(a.TEXT,S)},v.exports.Tokenizer=D,v.exports.TOKEN=a}],C={};function r(v){var f=C[v];if(f!==void 0)return f.exports;var p=C[v]={exports:{}};return W[v](p,p.exports,r),p.exports}var A=r(18);j=A})();var G=j;if(!0)!(Z=[T,T("6UM0"),T("TXwP")],V=function(W){var C=T("6UM0"),r=T("TXwP");return{html_beautify:function(A,v){return G(A,v,C.js_beautify,r.css_beautify)}}}.apply(ve,Z),V!==void 0&&(Bt.exports=V));else var M,I})()},"rAM+":function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return V});var Z=T("Qw5x");function V(j,G){var M;if(typeof Symbol=="undefined"||j[Symbol.iterator]==null){if(Array.isArray(j)||(M=Object(Z.a)(j))||G&&j&&typeof j.length=="number"){M&&(j=M);var I=0,W=function(){};return{s:W,n:function(){return I>=j.length?{done:!0}:{done:!1,value:j[I++]}},e:function(f){throw f},f:W}}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 C=!0,r=!1,A;return{s:function(){M=j[Symbol.iterator]()},n:function(){var f=M.next();return C=f.done,f},e:function(f){r=!0,A=f},f:function(){try{!C&&M.return!=null&&M.return()}finally{if(r)throw A}}}}},rUJ1:function(Bt,ve){const T=/[&<>"']/,Z=/[&<>"']/g,V=/[<>"']|&(?!#?\w+;)/,j=/[<>"']|&(?!#?\w+;)/g,G={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},M=P=>G[P];function I(P,_){if(_){if(T.test(P))return P.replace(Z,M)}else if(V.test(P))return P.replace(j,M);return P}const W=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function C(P){return P.replace(W,(_,b)=>(b=b.toLowerCase(),b==="colon"?":":b.charAt(0)==="#"?b.charAt(1)==="x"?String.fromCharCode(parseInt(b.substring(2),16)):String.fromCharCode(+b.substring(1)):""))}const r=/(^|[^\[])\^/g;function A(P,_){P=P.source||P,_=_||"";const b={replace:(g,m)=>(m=m.source||m,m=m.replace(r,"$1"),P=P.replace(g,m),b),getRegex:()=>new RegExp(P,_)};return b}const v=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function p(P,_,b){if(P){let g;try{g=decodeURIComponent(C(b)).replace(v,"").toLowerCase()}catch(m){return null}if(g.indexOf("javascript:")===0||g.indexOf("vbscript:")===0||g.indexOf("data:")===0)return null}_&&!f.test(b)&&(b=u(_,b));try{b=encodeURI(b).replace(/%25/g,"%")}catch(g){return null}return b}const l={},o=/^[^:]+:\/*[^/]*$/,s=/^([^:]+:)[\s\S]*$/,t=/^([^:]+:\/*[^/]*)[\s\S]*$/;function u(P,_){l[" "+P]||(o.test(P)?l[" "+P]=P+"/":l[" "+P]=w(P,"/",!0)),P=l[" "+P];const b=P.indexOf(":")===-1;return _.substring(0,2)==="//"?b?_:P.replace(s,"$1")+_:_.charAt(0)==="/"?b?_:P.replace(t,"$1")+_:P+_}const a={exec:function(){}};function i(P){let _=1,b,g;for(;_<arguments.length;_++){b=arguments[_];for(g in b)Object.prototype.hasOwnProperty.call(b,g)&&(P[g]=b[g])}return P}function D(P,_){const b=P.replace(/\|/g,(y,x,O)=>{let H=!1,F=x;for(;--F>=0&&O[F]==="\\";)H=!H;return H?"|":" |"}),g=b.split(/ \|/);let m=0;if(g.length>_)g.splice(_);else for(;g.length<_;)g.push("");for(;m<g.length;m++)g[m]=g[m].trim().replace(/\\\|/g,"|");return g}function w(P,_,b){const g=P.length;if(g===0)return"";let m=0;for(;m<g;){const y=P.charAt(g-m-1);if(y===_&&!b)m++;else if(y!==_&&b)m++;else break}return P.substr(0,g-m)}function S(P,_){if(P.indexOf(_[1])===-1)return-1;const b=P.length;let g=0,m=0;for(;m<b;m++)if(P[m]==="\\")m++;else if(P[m]===_[0])g++;else if(P[m]===_[1]&&(g--,g<0))return m;return-1}function L(P){P&&P.sanitize&&!P.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")}Bt.exports={escape:I,unescape:C,edit:A,cleanUrl:p,resolveUrl:u,noopTest:a,merge:i,splitCells:D,rtrim:w,findClosingBracket:S,checkSanitizeDeprecation:L}},sR1s:function(Bt,ve,T){"use strict";T.d(ve,"b",function(){return G}),T.d(ve,"a",function(){return M}),T.d(ve,"c",function(){return I}),T.d(ve,"d",function(){return W});var Z=T("U8pU"),V="RC_TABLE_KEY";function j(C){return C==null?[]:Array.isArray(C)?C:[C]}function G(C,r){if(!r&&typeof r!="number")return C;for(var A=j(r),v=C,f=0;f<A.length;f+=1){if(!v)return null;var p=A[f];v=v[p]}return v}function M(C){var r=[],A={};return C.forEach(function(v){for(var f=v||{},p=f.key,l=f.dataIndex,o=p||j(l).join("-")||V;A[o];)o="".concat(o,"_next");A[o]=!0,r.push(o)}),r}function I(){var C={};function r(p,l){l&&Object.keys(l).forEach(function(o){var s=l[o];s&&Object(Z.a)(s)==="object"?(p[o]=p[o]||{},r(p[o],s)):p[o]=s})}for(var A=arguments.length,v=new Array(A),f=0;f<A;f++)v[f]=arguments[f];return v.forEach(function(p){r(C,p)}),C}function W(C){return C!=null}},sboe:function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return j});var Z=T("q1tI"),V=T.n(Z),j=Z.createContext(null)},t23M:function(Bt,ve,T){"use strict";var Z=T("VTBJ"),V=T("1OyB"),j=T("vuIU"),G=T("Ji7U"),M=T("LK+K"),I=T("q1tI"),W=T.n(I),C=T("m+aA"),r=T("Zm9Q"),A=T("Kwbf"),v=T("c+Xe"),f=T("bdgK"),p="rc-observer-key",l=function(o){Object(G.a)(t,o);var s=Object(M.a)(t);function t(){var u;return Object(V.a)(this,t),u=s.apply(this,arguments),u.resizeObserver=null,u.childNode=null,u.currentElement=null,u.state={width:0,height:0,offsetHeight:0,offsetWidth:0},u.onResize=function(a){var i=u.props.onResize,D=a[0].target,w=D.getBoundingClientRect(),S=w.width,L=w.height,P=D.offsetWidth,_=D.offsetHeight,b=Math.floor(S),g=Math.floor(L);if(u.state.width!==b||u.state.height!==g||u.state.offsetWidth!==P||u.state.offsetHeight!==_){var m={width:b,height:g,offsetWidth:P,offsetHeight:_};u.setState(m),i&&Promise.resolve().then(function(){i(Object(Z.a)(Object(Z.a)({},m),{},{offsetWidth:P,offsetHeight:_}))})}},u.setChildNode=function(a){u.childNode=a},u}return Object(j.a)(t,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var a=this.props.disabled;if(a){this.destroyObserver();return}var i=Object(C.a)(this.childNode||this),D=i!==this.currentElement;D&&(this.destroyObserver(),this.currentElement=i),!this.resizeObserver&&i&&(this.resizeObserver=new f.default(this.onResize),this.resizeObserver.observe(i))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var a=this.props.children,i=Object(r.a)(a);if(i.length>1)Object(A.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(i.length===0)return Object(A.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var D=i[0];if(I.isValidElement(D)&&Object(v.c)(D)){var w=D.ref;i[0]=I.cloneElement(D,{ref:Object(v.a)(w,this.setChildNode)})}return i.length===1?i[0]:i.map(function(S,L){return!I.isValidElement(S)||"key"in S&&S.key!==null?S:I.cloneElement(S,{key:"".concat(p,"-").concat(L)})})}}]),t}(I.Component);l.displayName="ResizeObserver",ve.a=l},t9D7:function(Bt,ve,T){"use strict";T.d(ve,"b",function(){return W}),T.d(ve,"g",function(){return r}),T.d(ve,"d",function(){return A}),T.d(ve,"e",function(){return v}),T.d(ve,"a",function(){return f}),T.d(ve,"f",function(){return o}),T.d(ve,"c",function(){return s});var Z=T("Vhoy"),V=T("MI8n"),j=T("pmY6"),G=T("Cg/j"),M=T("ic2d"),I=T("nEHx");const W=Object(G.c)("themeService");var C;(function(t){function u(a){return a&&typeof a=="object"&&typeof a.id=="string"}t.isThemeColor=u})(C||(C={}));function r(t){return{id:t}}var A;(function(t){function u(L){return L&&typeof L=="object"&&typeof L.id=="string"&&(typeof L.color=="undefined"||C.isThemeColor(L.color))}t.isThemeIcon=u;const a=new RegExp(`^\\$\\((${Z.a.iconNameExpression}(?:${Z.a.iconModifierExpression})?)\\)$`);function i(L){const P=a.exec(L);if(!P)return;let[,_]=P;return{id:_}}t.fromString=i;function D(L,P){let _=L.id;const b=_.lastIndexOf("~");return b!==-1&&(_=_.substring(0,b)),P&&(_=`${_}~${P}`),{id:_}}t.modify=D;function w(L,P){var _,b;return L.id===P.id&&((_=L.color)===null||_===void 0?void 0:_.id)===((b=P.color)===null||b===void 0?void 0:b.id)}t.isEqual=w;function S(L,P){return{id:L.id,color:P?r(P):void 0}}t.asThemeIcon=S,t.asClassNameArray=Z.a.asClassNameArray,t.asClassName=Z.a.asClassName,t.asCSSSelector=Z.a.asCSSSelector})(A||(A={}));function v(t){switch(t){case I.a.DARK:return"vs-dark";case I.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 V.b}onColorThemeChange(t){return this.themingParticipants.push(t),this.onThemingParticipantAddedEmitter.fire(t),Object(j.i)(()=>{const u=this.themingParticipants.indexOf(t);this.themingParticipants.splice(u,1)})}getThemingParticipants(){return this.themingParticipants}}let l=new p;M.a.add(f.ThemingContribution,l);function o(t){return l.onColorThemeChange(t)}class s extends j.a{constructor(t){super();this.themeService=t,this.theme=t.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(u=>this.onThemeChange(u)))}onThemeChange(t){this.theme=t,this.updateStyles()}updateStyles(){}}},uiYX:function(Bt,ve,T){"use strict";var Z=T("2qtc"),V=T("kLXV"),j=T("5NDa"),G=T("5rEg"),M=T("k1fw"),I=T("9og8"),W=T("y8nQ"),C=T("Vl3Y"),r=T("tJVT"),A=T("WmNS"),v=T.n(A),f=T("q1tI"),p=T.n(f),l=T("XYT7"),o=T("Ty5D"),s=T("9kvl"),t=T("500L"),u=function(i){var D=i.classroomList,w=i.loading,S=i.dispatch,L=Object(o.i)(),P=C.a.useForm(),_=Object(r.a)(P,1),b=_[0];return p.a.createElement(V.a,{centered:!0,title:"\u8865\u4EA4\u9644\u4EF6",visible:D.actionTabs.key==="\u8865\u4EA4\u9644\u4EF6",bodyStyle:{minHeight:200},onOk:Object(I.a)(v.a.mark(function g(){var m,y,x,O;return v.a.wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return F.next=2,b.validateFields();case 2:return y=Object(M.a)({},b.getFieldValue()),x=D.actionTabs.selectArrs,y.attachment_ids=(m=y.attachment_ids)===null||m===void 0?void 0:m.map(function(R){return R.response.id}),F.next=7,Object(l.V)(Object(M.a)(Object(M.a)({},y),{},{homeworkId:x.work_id}));case 7:O=F.sent,O.status===0&&(b.resetFields(),S({type:"classroomList/setActionTabs",payload:{}}));case 9:case"end":return F.stop()}},g)})),onCancel:function(){b.resetFields(),S({type:"classroomList/setActionTabs",payload:{}})}},p.a.createElement(C.a,{form:b,initialValues:{}},p.a.createElement(C.a.Item,{name:"attachment_ids",rules:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u9644\u4EF6"}]},p.a.createElement(t.b,null)),p.a.createElement(C.a.Item,{name:"description"},p.a.createElement(G.a.TextArea,{placeholder:"\u8BF7\u5728\u6B64\u8F93\u5165\u8865\u4EA4\u9644\u4EF6\u7684\u539F\u56E0\uFF0C\u6700\u5927\u9650\u5236100\u4E2A\u5B57\u7B26",rows:7}))))};ve.a=Object(s.a)(function(a){var i=a.classroomList,D=a.loading;return{classroomList:i,loading:D}})(u)},ulZh:function(Bt,ve,T){typeof window!="undefined"&&function(V,j){Bt.exports=j()}(this,function(){return function(Z){var V={};function j(G){if(V[G])return V[G].exports;var M=V[G]={i:G,l:!1,exports:{}};return Z[G].call(M.exports,M,M.exports,j),M.l=!0,M.exports}return j.m=Z,j.c=V,j.d=function(G,M,I){j.o(G,M)||Object.defineProperty(G,M,{enumerable:!0,get:I})},j.r=function(G){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(G,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(G,"__esModule",{value:!0})},j.t=function(G,M){if(M&1&&(G=j(G)),M&8)return G;if(M&4&&typeof G=="object"&&G&&G.__esModule)return G;var I=Object.create(null);if(j.r(I),Object.defineProperty(I,"default",{enumerable:!0,value:G}),M&2&&typeof G!="string")for(var W in G)j.d(I,W,function(C){return G[C]}.bind(null,W));return I},j.n=function(G){var M=G&&G.__esModule?function(){return G.default}:function(){return G};return j.d(M,"a",M),M},j.o=function(G,M){return Object.prototype.hasOwnProperty.call(G,M)},j.p="/dist/",j(j.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(Z,V,j){"use strict";var G=Object.prototype.hasOwnProperty,M="~";function I(){}Object.create&&(I.prototype=Object.create(null),new I().__proto__||(M=!1));function W(v,f,p){this.fn=v,this.context=f,this.once=p||!1}function C(v,f,p,l,o){if(typeof p!="function")throw new TypeError("The listener must be a function");var s=new W(p,l||v,o),t=M?M+f:f;return v._events[t]?v._events[t].fn?v._events[t]=[v._events[t],s]:v._events[t].push(s):(v._events[t]=s,v._eventsCount++),v}function r(v,f){--v._eventsCount===0?v._events=new I:delete v._events[f]}function A(){this._events=new I,this._eventsCount=0}A.prototype.eventNames=function(){var f=[],p,l;if(this._eventsCount===0)return f;for(l in p=this._events)G.call(p,l)&&f.push(M?l.slice(1):l);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(p)):f},A.prototype.listeners=function(f){var p=M?M+f:f,l=this._events[p];if(!l)return[];if(l.fn)return[l.fn];for(var o=0,s=l.length,t=new Array(s);o<s;o++)t[o]=l[o].fn;return t},A.prototype.listenerCount=function(f){var p=M?M+f:f,l=this._events[p];return l?l.fn?1:l.length:0},A.prototype.emit=function(f,p,l,o,s,t){var u=M?M+f:f;if(!this._events[u])return!1;var a=this._events[u],i=arguments.length,D,w;if(a.fn){a.once&&this.removeListener(f,a.fn,void 0,!0);switch(i){case 1:return a.fn.call(a.context),!0;case 2:return a.fn.call(a.context,p),!0;case 3:return a.fn.call(a.context,p,l),!0;case 4:return a.fn.call(a.context,p,l,o),!0;case 5:return a.fn.call(a.context,p,l,o,s),!0;case 6:return a.fn.call(a.context,p,l,o,s,t),!0}for(w=1,D=new Array(i-1);w<i;w++)D[w-1]=arguments[w];a.fn.apply(a.context,D)}else{var S=a.length,L;for(w=0;w<S;w++){a[w].once&&this.removeListener(f,a[w].fn,void 0,!0);switch(i){case 1:a[w].fn.call(a[w].context);break;case 2:a[w].fn.call(a[w].context,p);break;case 3:a[w].fn.call(a[w].context,p,l);break;case 4:a[w].fn.call(a[w].context,p,l,o);break;default:if(!D)for(L=1,D=new Array(i-1);L<i;L++)D[L-1]=arguments[L];a[w].fn.apply(a[w].context,D)}}}return!0},A.prototype.on=function(f,p,l){return C(this,f,p,l,!1)},A.prototype.once=function(f,p,l){return C(this,f,p,l,!0)},A.prototype.removeListener=function(f,p,l,o){var s=M?M+f:f;if(!this._events[s])return this;if(!p)return r(this,s),this;var t=this._events[s];if(t.fn)t.fn===p&&(!o||t.once)&&(!l||t.context===l)&&r(this,s);else{for(var u=0,a=[],i=t.length;u<i;u++)(t[u].fn!==p||o&&!t[u].once||l&&t[u].context!==l)&&a.push(t[u]);a.length?this._events[s]=a.length===1?a[0]:a:r(this,s)}return this},A.prototype.removeAllListeners=function(f){var p;return f?(p=M?M+f:f,this._events[p]&&r(this,p)):(this._events=new I,this._eventsCount=0),this},A.prototype.off=A.prototype.removeListener,A.prototype.addListener=A.prototype.on,A.prefixed=M,A.EventEmitter=A,Z.exports=A},"./node_modules/url-toolkit/src/url-toolkit.js":function(Z,V,j){(function(G){var M=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,I=/^([^\/?#]*)([^]*)$/,W=/(?:\/|^)\.(?=\/)/g,C=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,r={buildAbsoluteURL:function(A,v,f){if(f=f||{},A=A.trim(),v=v.trim(),!v){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 l=r.parseURL(v);if(!l)throw new Error("Error trying to parse relative URL.");if(l.scheme)return f.alwaysNormalize?(l.path=r.normalizePath(l.path),r.buildURLFromParts(l)):v;var o=r.parseURL(A);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&o.path[0]!=="/"){var s=I.exec(o.path);o.netLoc=s[1],o.path=s[2]}o.netLoc&&!o.path&&(o.path="/");var t={scheme:o.scheme,netLoc:l.netLoc,path:null,params:l.params,query:l.query,fragment:l.fragment};if(!l.netLoc&&(t.netLoc=o.netLoc,l.path[0]!=="/"))if(!l.path)t.path=o.path,l.params||(t.params=o.params,l.query||(t.query=o.query));else{var u=o.path,a=u.substring(0,u.lastIndexOf("/")+1)+l.path;t.path=r.normalizePath(a)}return t.path===null&&(t.path=f.alwaysNormalize?r.normalizePath(l.path):l.path),r.buildURLFromParts(t)},parseURL:function(A){var v=M.exec(A);return v?{scheme:v[1]||"",netLoc:v[2]||"",path:v[3]||"",params:v[4]||"",query:v[5]||"",fragment:v[6]||""}:null},normalizePath:function(A){for(A=A.split("").reverse().join("").replace(W,"");A.length!==(A=A.replace(C,"")).length;);return A.split("").reverse().join("")},buildURLFromParts:function(A){return A.scheme+A.netLoc+A.path+A.params+A.query+A.fragment}};Z.exports=r})(this)},"./node_modules/webworkify-webpack/index.js":function(Z,V,j){function G(f){var p={};function l(s){if(p[s])return p[s].exports;var t=p[s]={i:s,l:!1,exports:{}};return f[s].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=f,l.c=p,l.i=function(s){return s},l.d=function(s,t,u){l.o(s,t)||Object.defineProperty(s,t,{configurable:!1,enumerable:!0,get:u})},l.r=function(s){Object.defineProperty(s,"__esModule",{value:!0})},l.n=function(s){var t=s&&s.__esModule?function(){return s.default}:function(){return s};return l.d(t,"a",t),t},l.o=function(s,t){return Object.prototype.hasOwnProperty.call(s,t)},l.p="/",l.oe=function(s){throw console.error(s),s};var o=l(l.s=ENTRY_MODULE);return o.default||o}var M="[\\.|\\-|\\+|\\w|/|@]+",I="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+M+").*?\\)";function W(f){return(f+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function C(f){return!isNaN(1*f)}function r(f,p,l){var o={};o[l]=[];var s=p.toString(),t=s.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!t)return o;for(var u=t[1],a=new RegExp("(\\\\n|\\W)"+W(u)+I,"g"),i;i=a.exec(s);){if(i[3]==="dll-reference")continue;o[l].push(i[3])}for(a=new RegExp("\\("+W(u)+'\\("(dll-reference\\s('+M+'))"\\)\\)'+I,"g");i=a.exec(s);)f[i[2]]||(o[l].push(i[1]),f[i[2]]=j(i[1]).m),o[i[2]]=o[i[2]]||[],o[i[2]].push(i[4]);for(var D=Object.keys(o),w=0;w<D.length;w++)for(var S=0;S<o[D[w]].length;S++)C(o[D[w]][S])&&(o[D[w]][S]=1*o[D[w]][S]);return o}function A(f){var p=Object.keys(f);return p.reduce(function(l,o){return l||f[o].length>0},!1)}function v(f,p){for(var l={main:[p]},o={main:[]},s={main:{}};A(l);)for(var t=Object.keys(l),u=0;u<t.length;u++){var a=t[u],i=l[a],D=i.pop();if(s[a]=s[a]||{},s[a][D]||!f[a][D])continue;s[a][D]=!0,o[a]=o[a]||[],o[a].push(D);for(var w=r(f,f[a][D],a),S=Object.keys(w),L=0;L<S.length;L++)l[S[L]]=l[S[L]]||[],l[S[L]]=l[S[L]].concat(w[S[L]])}return o}Z.exports=function(f,p){p=p||{};var l={main:j.m},o=p.all?{main:Object.keys(l.main)}:v(l,f),s="";Object.keys(o).filter(function(D){return D!=="main"}).forEach(function(D){for(var w=0;o[D][w];)w++;o[D].push(w),l[D][w]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",s=s+"var "+D+" = ("+G.toString().replace("ENTRY_MODULE",JSON.stringify(w))+")({"+o[D].map(function(S){return""+JSON.stringify(S)+": "+l[D][S].toString()}).join(",")+`});
`}),s=s+"new (("+G.toString().replace("ENTRY_MODULE",JSON.stringify(f))+")({"+o.main.map(function(D){return""+JSON.stringify(D)+": "+l.main[D].toString()}).join(",")+"}))(self);";var t=new window.Blob([s],{type:"text/javascript"});if(p.bare)return t;var u=window.URL||window.webkitURL||window.mozURL||window.msURL,a=u.createObjectURL(t),i=new window.Worker(a);return i.objectURL=a,i}},"./src/config.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"hlsDefaultConfig",function(){return L}),j.d(V,"mergeConfig",function(){return _}),j.d(V,"enableStreamingMode",function(){return b});var G=j("./src/controller/abr-controller.ts"),M=j("./src/controller/audio-stream-controller.ts"),I=j("./src/controller/audio-track-controller.ts"),W=j("./src/controller/subtitle-stream-controller.ts"),C=j("./src/controller/subtitle-track-controller.ts"),r=j("./src/controller/buffer-controller.ts"),A=j("./src/controller/timeline-controller.ts"),v=j("./src/controller/cap-level-controller.ts"),f=j("./src/controller/fps-controller.ts"),p=j("./src/controller/eme-controller.ts"),l=j("./src/controller/cmcd-controller.ts"),o=j("./src/utils/xhr-loader.ts"),s=j("./src/utils/fetch-loader.ts"),t=j("./src/utils/cues.ts"),u=j("./src/utils/mediakeys-helper.ts"),a=j("./src/utils/logger.ts");function i(){return i=Object.assign||function(g){for(var m=1;m<arguments.length;m++){var y=arguments[m];for(var x in y)Object.prototype.hasOwnProperty.call(y,x)&&(g[x]=y[x])}return g},i.apply(this,arguments)}function D(g,m){var y=Object.keys(g);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(g);m&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(g,O).enumerable})),y.push.apply(y,x)}return y}function w(g){for(var m=1;m<arguments.length;m++){var y=arguments[m]!=null?arguments[m]:{};m%2?D(Object(y),!0).forEach(function(x){S(g,x,y[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(y)):D(Object(y)).forEach(function(x){Object.defineProperty(g,x,Object.getOwnPropertyDescriptor(y,x))})}return g}function S(g,m,y){return m in g?Object.defineProperty(g,m,{value:y,enumerable:!0,configurable:!0,writable:!0}):g[m]=y,g}var L=w(w({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:o.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:G.default,bufferController:r.default,capLevelController:v.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:u.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},P()),{},{subtitleStreamController:W.SubtitleStreamController,subtitleTrackController:C.default,timelineController:A.TimelineController,audioStreamController:M.default,audioTrackController:I.default,emeController:p.default,cmcdController:l.default});function P(){return{cueHandler:t.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 _(g,m){if((m.liveSyncDurationCount||m.liveMaxLatencyDurationCount)&&(m.liveSyncDuration||m.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(m.liveMaxLatencyDurationCount!==void 0&&(m.liveSyncDurationCount===void 0||m.liveMaxLatencyDurationCount<=m.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(m.liveMaxLatencyDuration!==void 0&&(m.liveSyncDuration===void 0||m.liveMaxLatencyDuration<=m.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return i({},g,m)}function b(g){var m=g.loader;if(m!==s.default&&m!==o.default)a.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),g.progressive=!1;else{var y=Object(s.fetchSupported)();y&&(g.loader=s.default,g.progressive=!0,g.enableSoftwareAES=!0,a.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(Z,V,j){"use strict";j.r(V);var G=j("./src/polyfills/number.ts"),M=j("./src/utils/ewma-bandwidth-estimator.ts"),I=j("./src/events.ts"),W=j("./src/utils/buffer-helper.ts"),C=j("./src/errors.ts"),r=j("./src/types/loader.ts"),A=j("./src/utils/logger.ts");function v(l,o){for(var s=0;s<o.length;s++){var t=o[s];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(l,t.key,t)}}function f(l,o,s){return o&&v(l.prototype,o),s&&v(l,s),l}var p=function(){function l(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 t=s.config;this.bwEstimator=new M.default(t.abrEwmaSlowVoD,t.abrEwmaFastVoD,t.abrEwmaDefaultEstimate),this.registerListeners()}var o=l.prototype;return o.registerListeners=function(){var t=this.hls;t.on(I.Events.FRAG_LOADING,this.onFragLoading,this),t.on(I.Events.FRAG_LOADED,this.onFragLoaded,this),t.on(I.Events.FRAG_BUFFERED,this.onFragBuffered,this),t.on(I.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.on(I.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var t=this.hls;t.off(I.Events.FRAG_LOADING,this.onFragLoading,this),t.off(I.Events.FRAG_LOADED,this.onFragLoaded,this),t.off(I.Events.FRAG_BUFFERED,this.onFragBuffered,this),t.off(I.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.off(I.Events.ERROR,this.onError,this)},o.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},o.onFragLoading=function(t,u){var a=u.frag;if(a.type===r.PlaylistLevelType.MAIN&&!this.timer){var i;this.fragCurrent=a,this.partCurrent=(i=u.part)!=null?i:null,this.timer=self.setInterval(this.onCheck,100)}},o.onLevelLoaded=function(t,u){var a=this.hls.config;u.details.live?this.bwEstimator.update(a.abrEwmaSlowLive,a.abrEwmaFastLive):this.bwEstimator.update(a.abrEwmaSlowVoD,a.abrEwmaFastVoD)},o._abandonRulesCheck=function(){var t=this.fragCurrent,u=this.partCurrent,a=this.hls,i=a.autoLevelEnabled,D=a.config,w=a.media;if(!t||!w)return;var S=u?u.stats:t.stats,L=u?u.duration:t.duration;if(S.aborted){A.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!i||w.paused||!w.playbackRate||!w.readyState)return;var P=performance.now()-S.loading.start,_=Math.abs(w.playbackRate);if(P<=500*L/_)return;var b=a.levels,g=a.minAutoLevel,m=b[t.level],y=S.total||Math.max(S.loaded,Math.round(L*m.maxBitrate/8)),x=Math.max(1,S.bwEstimate?S.bwEstimate/8:S.loaded*1e3/P),O=(y-S.loaded)/x,H=w.currentTime,F=(W.BufferHelper.bufferInfo(w,H,D.maxBufferHole).end-H)/_;if(F>=2*L/_||O<=F)return;var R=Number.POSITIVE_INFINITY,U;for(U=t.level-1;U>g;U--){var k=b[U].maxBitrate;if(R=L*k/(8*.8*x),R<F)break}if(R>=O)return;var d=this.bwEstimator.getEstimate();A.logger.warn("Fragment "+t.sn+(u?" part "+u.index:"")+" of level "+t.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+U+`
Current BW estimate: `+(Object(G.isFiniteNumber)(d)?(d/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+O.toFixed(3)+` s
Estimated load time for the next fragment: `+R.toFixed(3)+` s
Time to underbuffer: `+F.toFixed(3)+" s"),a.nextLoadLevel=U,this.bwEstimator.sample(P,S.loaded),this.clearTimer(),t.loader&&(this.fragCurrent=this.partCurrent=null,t.loader.abort()),a.trigger(I.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:t,part:u,stats:S})},o.onFragLoaded=function(t,u){var a=u.frag,i=u.part;if(a.type===r.PlaylistLevelType.MAIN&&Object(G.isFiniteNumber)(a.sn)){var D=i?i.stats:a.stats,w=i?i.duration:a.duration;if(this.clearTimer(),this.lastLoadedFragLevel=a.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var S=this.hls.levels[a.level],L=(S.loaded?S.loaded.bytes:0)+D.loaded,P=(S.loaded?S.loaded.duration:0)+w;S.loaded={bytes:L,duration:P},S.realBitrate=Math.round(8*L/P)}if(a.bitrateTest){var _={stats:D,frag:a,part:i,id:a.type};this.onFragBuffered(I.Events.FRAG_BUFFERED,_),a.bitrateTest=!1}}},o.onFragBuffered=function(t,u){var a=u.frag,i=u.part,D=i?i.stats:a.stats;if(D.aborted)return;if(a.type!==r.PlaylistLevelType.MAIN||a.sn==="initSegment")return;var w=D.parsing.end-D.loading.start;this.bwEstimator.sample(w,D.loaded),D.bwEstimate=this.bwEstimator.getEstimate(),a.bitrateTest?this.bitrateTestDelay=w/1e3:this.bitrateTestDelay=0},o.onError=function(t,u){switch(u.details){case C.ErrorDetails.FRAG_LOAD_ERROR:case C.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},o.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},o.getNextABRAutoLevel=function(){var t=this.fragCurrent,u=this.partCurrent,a=this.hls,i=a.maxAutoLevel,D=a.config,w=a.minAutoLevel,S=a.media,L=u?u.duration:t?t.duration:0,P=S?S.currentTime:0,_=S&&S.playbackRate!==0?Math.abs(S.playbackRate):1,b=this.bwEstimator?this.bwEstimator.getEstimate():D.abrEwmaDefaultEstimate,g=(W.BufferHelper.bufferInfo(S,P,D.maxBufferHole).end-P)/_,m=this.findBestLevel(b,w,i,g,D.abrBandWidthFactor,D.abrBandWidthUpFactor);if(m>=0)return m;A.logger.trace((g?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var y=L?Math.min(L,D.maxStarvationDelay):D.maxStarvationDelay,x=D.abrBandWidthFactor,O=D.abrBandWidthUpFactor;if(!g){var H=this.bitrateTestDelay;if(H){var F=L?Math.min(L,D.maxLoadingDelay):D.maxLoadingDelay;y=F-H,A.logger.trace("bitrate test took "+Math.round(1e3*H)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*y)+" ms"),x=O=1}}return m=this.findBestLevel(b,w,i,g+y,x,O),Math.max(m,0)},o.findBestLevel=function(t,u,a,i,D,w){for(var S,L=this.fragCurrent,P=this.partCurrent,_=this.lastLoadedFragLevel,b=this.hls.levels,g=b[_],m=!!(g!=null&&(S=g.details)!==null&&S!==void 0&&S.live),y=g==null?void 0:g.codecSet,x=P?P.duration:L?L.duration:0,O=a;O>=u;O--){var H=b[O];if(!H||y&&H.codecSet!==y)continue;var F=H.details,R=(P?F==null?void 0:F.partTarget:F==null?void 0:F.averagetargetduration)||x,U=void 0;O<=_?U=D*t:U=w*t;var k=b[O].maxBitrate,d=k*R/U;if(A.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+O+"/"+Math.round(U)+"/"+k+"/"+R+"/"+i+"/"+d),U>k&&(!d||m&&!this.bitrateTestDelay||d<i))return O}return-1},f(l,[{key:"nextAutoLevel",get:function(){var t=this._nextAutoLevel,u=this.bwEstimator;if(t!==-1&&(!u||!u.canEstimate()))return t;var a=this.getNextABRAutoLevel();return t!==-1&&(a=Math.min(t,a)),a},set:function(t){this._nextAutoLevel=t}}]),l}();V.default=p},"./src/controller/audio-stream-controller.ts":function(Z,V,j){"use strict";j.r(V);var G=j("./src/polyfills/number.ts"),M=j("./src/controller/base-stream-controller.ts"),I=j("./src/events.ts"),W=j("./src/utils/buffer-helper.ts"),C=j("./src/controller/fragment-tracker.ts"),r=j("./src/types/level.ts"),A=j("./src/types/loader.ts"),v=j("./src/loader/fragment.ts"),f=j("./src/demux/chunk-cache.ts"),p=j("./src/demux/transmuxer-interface.ts"),l=j("./src/types/transmuxer.ts"),o=j("./src/controller/fragment-finders.ts"),s=j("./src/utils/discontinuities.ts"),t=j("./src/errors.ts"),u=j("./src/utils/logger.ts");function a(){return a=Object.assign||function(L){for(var P=1;P<arguments.length;P++){var _=arguments[P];for(var b in _)Object.prototype.hasOwnProperty.call(_,b)&&(L[b]=_[b])}return L},a.apply(this,arguments)}function i(L,P){L.prototype=Object.create(P.prototype),L.prototype.constructor=L,D(L,P)}function D(L,P){return D=Object.setPrototypeOf||function(b,g){return b.__proto__=g,b},D(L,P)}var w=100,S=function(L){i(P,L);function P(b,g){var m;return m=L.call(this,b,g,"[audio-stream-controller]")||this,m.videoBuffer=null,m.videoTrackCC=-1,m.waitingVideoCC=-1,m.audioSwitch=!1,m.trackId=-1,m.waitingData=null,m.mainDetails=null,m.bufferFlushed=!1,m._registerListeners(),m}var _=P.prototype;return _.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},_._registerListeners=function(){var g=this.hls;g.on(I.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.on(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.on(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),g.on(I.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.on(I.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),g.on(I.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),g.on(I.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),g.on(I.Events.ERROR,this.onError,this),g.on(I.Events.BUFFER_RESET,this.onBufferReset,this),g.on(I.Events.BUFFER_CREATED,this.onBufferCreated,this),g.on(I.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),g.on(I.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),g.on(I.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_._unregisterListeners=function(){var g=this.hls;g.off(I.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.off(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.off(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),g.off(I.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.off(I.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),g.off(I.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),g.off(I.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),g.off(I.Events.ERROR,this.onError,this),g.off(I.Events.BUFFER_RESET,this.onBufferReset,this),g.off(I.Events.BUFFER_CREATED,this.onBufferCreated,this),g.off(I.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),g.off(I.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),g.off(I.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_.onInitPtsFound=function(g,m){var y=m.frag,x=m.id,O=m.initPTS;if(x==="main"){var H=y.cc;this.initPTS[y.cc]=O,this.log("InitPTS for cc: "+H+" found from main: "+O),this.videoTrackCC=H,this.state===M.State.WAITING_INIT_PTS&&this.tick()}},_.startLoad=function(g){if(!this.levels){this.startPosition=g,this.state=M.State.STOPPED;return}var m=this.lastCurrentTime;this.stopLoad(),this.setInterval(w),this.fragLoadError=0,m>0&&g===-1?(this.log("Override startPosition with lastCurrentTime @"+m.toFixed(3)),this.state=M.State.IDLE):(this.loadedmetadata=!1,this.state=M.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=g,this.tick()},_.doTick=function(){switch(this.state){case M.State.IDLE:this.doTickIdle();break;case M.State.WAITING_TRACK:{var g,m=this.levels,y=this.trackId,x=m==null||((g=m[y])===null||g===void 0)?void 0:g.details;if(x){if(this.waitForCdnTuneIn(x))break;this.state=M.State.WAITING_INIT_PTS}break}case M.State.FRAG_LOADING_WAITING_RETRY:{var O,H=performance.now(),F=this.retryDate;(!F||H>=F||(O=this.media)!==null&&O!==void 0&&O.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=M.State.IDLE);break}case M.State.WAITING_INIT_PTS:{var R=this.waitingData;if(R){var U=R.frag,k=R.part,d=R.cache,z=R.complete;if(this.initPTS[U.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=M.State.FRAG_LOADING;var Y=d.flush(),re={frag:U,part:k,payload:Y,networkDetails:null};this._handleFragmentLoadProgress(re),z&&L.prototype._handleFragmentLoadComplete.call(this,re)}else if(this.videoTrackCC!==this.waitingVideoCC)u.logger.log("Waiting fragment cc ("+U.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var le=this.getLoadPosition(),Ne=W.BufferHelper.bufferInfo(this.mediaBuffer,le,this.config.maxBufferHole),Ce=Object(o.fragmentWithinToleranceTest)(Ne.end,this.config.maxFragLookUpTolerance,U);Ce<0&&(u.logger.log("Waiting fragment cc ("+U.cc+") @ "+U.start+" cancelled because another fragment at "+Ne.end+" is needed"),this.clearWaitingFragment())}}else this.state=M.State.IDLE}}this.onTickEnd()},_.clearWaitingFragment=function(){var g=this.waitingData;g&&(this.fragmentTracker.removeFragment(g.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=M.State.IDLE)},_.onTickEnd=function(){var g=this.media;if(!g||!g.readyState)return;var m=this.mediaBuffer?this.mediaBuffer:g,y=m.buffered;!this.loadedmetadata&&y.length&&(this.loadedmetadata=!0),this.lastCurrentTime=g.currentTime},_.doTickIdle=function(){var g,m,y=this.hls,x=this.levels,O=this.media,H=this.trackId,F=y.config;if(!x||!x[H])return;if(!O&&(this.startFragRequested||!F.startFragPrefetch))return;var R=x[H],U=R.details;if(!U||U.live&&this.levelLastLoaded!==H||this.waitForCdnTuneIn(U)){this.state=M.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,v.ElementaryStreamTypes.AUDIO,A.PlaylistLevelType.AUDIO));var k=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,A.PlaylistLevelType.AUDIO);if(k===null)return;var d=k.len,z=this.getMaxBufferLength(),Y=this.audioSwitch;if(d>=z&&!Y)return;if(!Y&&this._streamEnded(k,U)){y.trigger(I.Events.BUFFER_EOS,{type:"audio"}),this.state=M.State.ENDED;return}var re=U.fragments,le=re[0].start,Ne=k.end;if(Y){var Ce=this.getLoadPosition();Ne=Ce,U.PTSKnown&&Ce<le&&((k.end>le||k.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),O.currentTime=le+.05))}var Te=this.getNextFragment(Ne,U);if(!Te){this.bufferFlushed=!0;return}((g=Te.decryptdata)===null||g===void 0?void 0:g.keyFormat)==="identity"&&!((m=Te.decryptdata)!==null&&m!==void 0&&m.key)?this.loadKey(Te,U):this.loadFragment(Te,U,Ne)},_.getMaxBufferLength=function(){var g=L.prototype.getMaxBufferLength.call(this),m=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,A.PlaylistLevelType.MAIN);return m===null?g:Math.max(g,m.len)},_.onMediaDetaching=function(){this.videoBuffer=null,L.prototype.onMediaDetaching.call(this)},_.onAudioTracksUpdated=function(g,m){var y=m.audioTracks;this.resetTransmuxer(),this.levels=y.map(function(x){return new r.Level(x)})},_.onAudioTrackSwitching=function(g,m){var y=!!m.url;this.trackId=m.id;var x=this.fragCurrent;x!=null&&x.loader&&x.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),y?this.setInterval(w):this.resetTransmuxer(),y?(this.audioSwitch=!0,this.state=M.State.IDLE):this.state=M.State.STOPPED,this.tick()},_.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},_.onLevelLoaded=function(g,m){this.mainDetails=m.details},_.onAudioTrackLoaded=function(g,m){var y,x=this.levels,O=m.details,H=m.id;if(!x){this.warn("Audio tracks were reset while loading level "+H);return}this.log("Track "+H+" loaded ["+O.startSN+","+O.endSN+"],duration:"+O.totalduration);var F=x[H],R=0;if(O.live||(y=F.details)!==null&&y!==void 0&&y.live){var U=this.mainDetails;if(O.fragments[0]||(O.deltaUpdateFailed=!0),O.deltaUpdateFailed||!U)return;!F.details&&O.hasProgramDateTime&&U.hasProgramDateTime?(Object(s.alignMediaPlaylistByPDT)(O,U),R=O.fragments[0].start):R=this.alignPlaylists(O,F.details)}F.details=O,this.levelLastLoaded=H,!this.startFragRequested&&(this.mainDetails||!O.live)&&this.setStartPosition(F.details,R),this.state===M.State.WAITING_TRACK&&!this.waitForCdnTuneIn(O)&&(this.state=M.State.IDLE),this.tick()},_._handleFragmentLoadProgress=function(g){var m,y=g.frag,x=g.part,O=g.payload,H=this.config,F=this.trackId,R=this.levels;if(!R){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+y.sn+" of level "+y.level+" will not be buffered");return}var U=R[F];console.assert(U,"Audio track is defined on fragment load progress");var k=U.details;console.assert(k,"Audio track details are defined on fragment load progress");var d=H.defaultAudioCodec||U.audioCodec||"mp4a.40.2",z=this.transmuxer;z||(z=this.transmuxer=new p.default(this.hls,A.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var Y=this.initPTS[y.cc],re=(m=y.initSegment)===null||m===void 0?void 0:m.data;if(Y!==void 0){var le=!1,Ne=x?x.index:-1,Ce=Ne!==-1,Te=new l.ChunkMetadata(y.level,y.sn,y.stats.chunkCount,O.byteLength,Ne,Ce);z.push(O,re,d,"",y,x,k.totalduration,le,Te,Y)}else{u.logger.log("Unknown video PTS for cc "+y.cc+", waiting for video PTS before demuxing audio frag "+y.sn+" of ["+k.startSN+" ,"+k.endSN+"],track "+F);var Fe=this.waitingData=this.waitingData||{frag:y,part:x,cache:new f.default,complete:!1},Ve=Fe.cache;Ve.push(new Uint8Array(O)),this.waitingVideoCC=this.videoTrackCC,this.state=M.State.WAITING_INIT_PTS}},_._handleFragmentLoadComplete=function(g){if(this.waitingData){this.waitingData.complete=!0;return}L.prototype._handleFragmentLoadComplete.call(this,g)},_.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},_.onBufferCreated=function(g,m){var y=m.tracks.audio;y&&(this.mediaBuffer=y.buffer),m.tracks.video&&(this.videoBuffer=m.tracks.video.buffer)},_.onFragBuffered=function(g,m){var y=m.frag,x=m.part;if(y.type!==A.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(y)){this.warn("Fragment "+y.sn+(x?" p: "+x.index:"")+" of level "+y.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}y.sn!=="initSegment"&&(this.fragPrevious=y,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(I.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(y,x)},_.onError=function(g,m){switch(m.details){case t.ErrorDetails.FRAG_LOAD_ERROR:case t.ErrorDetails.FRAG_LOAD_TIMEOUT:case t.ErrorDetails.KEY_LOAD_ERROR:case t.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(A.PlaylistLevelType.AUDIO,m);break;case t.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case t.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==M.State.ERROR&&this.state!==M.State.STOPPED&&(this.state=m.fatal?M.State.ERROR:M.State.IDLE,this.warn(m.details+" while loading frag, switching to "+this.state+" state"));break;case t.ErrorDetails.BUFFER_FULL_ERROR:if(m.parent==="audio"&&(this.state===M.State.PARSING||this.state===M.State.PARSED)){var y=!0,x=this.getFwdBufferInfo(this.mediaBuffer,A.PlaylistLevelType.AUDIO);x&&x.len>.5&&(y=!this.reduceMaxBufferLength(x.len)),y&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,L.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},_.onBufferFlushed=function(g,m){var y=m.type;y===v.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},_._handleTransmuxComplete=function(g){var m,y="audio",x=this.hls,O=g.remuxResult,H=g.chunkMeta,F=this.getCurrentContext(H);if(!F){this.warn("The loading context changed while buffering fragment "+H.sn+" of level "+H.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(H.level);return}var R=F.frag,U=F.part,k=O.audio,d=O.text,z=O.id3,Y=O.initSegment;if(this.fragContextChanged(R))return;if(this.state=M.State.PARSING,this.audioSwitch&&k&&this.completeAudioSwitch(),Y!=null&&Y.tracks&&(this._bufferInitSegment(Y.tracks,R,H),x.trigger(I.Events.FRAG_PARSING_INIT_SEGMENT,{frag:R,id:y,tracks:Y.tracks})),k){var re=k.startPTS,le=k.endPTS,Ne=k.startDTS,Ce=k.endDTS;U&&(U.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:re,endPTS:le,startDTS:Ne,endDTS:Ce}),R.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,re,le,Ne,Ce),this.bufferFragmentData(k,R,U,H)}if(z!=null&&(m=z.samples)!==null&&m!==void 0&&m.length){var Te=a({frag:R,id:y},z);x.trigger(I.Events.FRAG_PARSING_METADATA,Te)}if(d){var Fe=a({frag:R,id:y},d);x.trigger(I.Events.FRAG_PARSING_USERDATA,Fe)}},_._bufferInitSegment=function(g,m,y){if(this.state!==M.State.PARSING)return;g.video&&delete g.video;var x=g.audio;if(!x)return;x.levelCodec=x.codec,x.id="audio",this.log("Init audio buffer, container:"+x.container+", codecs[parsed]=["+x.codec+"]"),this.hls.trigger(I.Events.BUFFER_CODECS,g);var O=x.initSegment;if(O!=null&&O.byteLength){var H={type:"audio",frag:m,part:null,chunkMeta:y,parent:m.type,data:O};this.hls.trigger(I.Events.BUFFER_APPENDING,H)}this.tick()},_.loadFragment=function(g,m,y){var x=this.fragmentTracker.getState(g);this.fragCurrent=g,(this.audioSwitch||x===C.FragmentState.NOT_LOADED||x===C.FragmentState.PARTIAL)&&(g.sn==="initSegment"?this._loadInitSegment(g):m.live&&!Object(G.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=M.State.WAITING_INIT_PTS):(this.startFragRequested=!0,L.prototype.loadFragment.call(this,g,m,y)))},_.completeAudioSwitch=function(){var g=this.hls,m=this.media,y=this.trackId;m&&(this.log("Switching audio track : flushing all audio"),L.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,g.trigger(I.Events.AUDIO_TRACK_SWITCHED,{id:y})},P}(M.default);V.default=S},"./src/controller/audio-track-controller.ts":function(Z,V,j){"use strict";j.r(V);var G=j("./src/events.ts"),M=j("./src/errors.ts"),I=j("./src/controller/base-playlist-controller.ts"),W=j("./src/types/loader.ts");function C(p,l){for(var o=0;o<l.length;o++){var s=l[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(p,s.key,s)}}function r(p,l,o){return l&&C(p.prototype,l),o&&C(p,o),p}function A(p,l){p.prototype=Object.create(l.prototype),p.prototype.constructor=p,v(p,l)}function v(p,l){return v=Object.setPrototypeOf||function(s,t){return s.__proto__=t,s},v(p,l)}var f=function(p){A(l,p);function l(s){var t;return t=p.call(this,s,"[audio-track-controller]")||this,t.tracks=[],t.groupId=null,t.tracksInGroup=[],t.trackId=-1,t.trackName="",t.selectDefaultTrack=!0,t.registerListeners(),t}var o=l.prototype;return o.registerListeners=function(){var t=this.hls;t.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(G.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(G.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(G.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(G.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var t=this.hls;t.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(G.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(G.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(G.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(G.Events.ERROR,this.onError,this)},o.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,p.prototype.destroy.call(this)},o.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},o.onManifestParsed=function(t,u){this.tracks=u.audioTracks||[]},o.onAudioTrackLoaded=function(t,u){var a=u.id,i=u.details,D=this.tracksInGroup[a];if(!D){this.warn("Invalid audio track id "+a);return}var w=D.details;D.details=u.details,this.log("audioTrack "+a+" loaded ["+i.startSN+"-"+i.endSN+"]"),a===this.trackId&&(this.retryCount=0,this.playlistLoaded(a,u,w))},o.onLevelLoading=function(t,u){this.switchLevel(u.level)},o.onLevelSwitching=function(t,u){this.switchLevel(u.level)},o.switchLevel=function(t){var u=this.hls.levels[t];if(!(u!=null&&u.audioGroupIds))return;var a=u.audioGroupIds[u.urlId];if(this.groupId!==a){this.groupId=a;var i=this.tracks.filter(function(w){return!a||w.groupId===a});this.selectDefaultTrack&&!i.some(function(w){return w.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=i;var D={audioTracks:i};this.log("Updating audio tracks, "+i.length+' track(s) found in "'+a+'" group-id'),this.hls.trigger(G.Events.AUDIO_TRACKS_UPDATED,D),this.selectInitialTrack()}},o.onError=function(t,u){if(p.prototype.onError.call(this,t,u),u.fatal||!u.context)return;u.context.type===W.PlaylistContextType.AUDIO_TRACK&&u.context.id===this.trackId&&u.context.groupId===this.groupId&&this.retryLoadingOrFail(u)},o.setAudioTrack=function(t){var u=this.tracksInGroup;if(t<0||t>=u.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var a=u[this.trackId];this.log("Now switching to audio-track index "+t);var i=u[t],D=i.id,w=i.groupId,S=w===void 0?"":w,L=i.name,P=i.type,_=i.url;if(this.trackId=t,this.trackName=L,this.selectDefaultTrack=!1,this.hls.trigger(G.Events.AUDIO_TRACK_SWITCHING,{id:D,groupId:S,name:L,type:P,url:_}),i.details&&!i.details.live)return;var b=this.switchParams(i.url,a==null?void 0:a.details);this.loadPlaylist(b)},o.selectInitialTrack=function(){var t=this.tracksInGroup;console.assert(t.length,"Initial audio track should be selected when tracks are known");var u=this.trackName,a=this.findTrackId(u)||this.findTrackId();a!==-1?this.setAudioTrack(a):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(G.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},o.findTrackId=function(t){for(var u=this.tracksInGroup,a=0;a<u.length;a++){var i=u[a];if((!this.selectDefaultTrack||i.default)&&(!t||t===i.name))return i.id}return-1},o.loadPlaylist=function(t){var u=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(u)){var a=u.id,i=u.groupId,D=u.url;if(t)try{D=t.addDirectives(D)}catch(w){this.warn("Could not construct new URL with HLS Delivery Directives: "+w)}this.log("loading audio-track playlist for id: "+a),this.clearTimer(),this.hls.trigger(G.Events.AUDIO_TRACK_LOADING,{url:D,id:a,groupId:i,deliveryDirectives:t||null})}},r(l,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(t){this.selectDefaultTrack=!1,this.setAudioTrack(t)}}]),l}(I.default);V.default=f},"./src/controller/base-playlist-controller.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"default",function(){return r});var G=j("./src/polyfills/number.ts"),M=j("./src/types/level.ts"),I=j("./src/controller/level-helper.ts"),W=j("./src/utils/logger.ts"),C=j("./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=W.logger.log.bind(W.logger,p+":"),this.warn=W.logger.warn.bind(W.logger,p+":"),this.hls=f}var v=A.prototype;return v.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},v.onError=function(p,l){l.fatal&&l.type===C.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},v.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},v.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},v.stopLoad=function(){this.canLoad=!1,this.clearTimer()},v.switchParams=function(p,l){var o=l==null?void 0:l.renditionReports;if(o)for(var s=0;s<o.length;s++){var t=o[s],u=""+t.URI;if(u===p.substr(-u.length)){var a=parseInt(t["LAST-MSN"]),i=parseInt(t["LAST-PART"]);if(l&&this.hls.config.lowLatencyMode){var D=Math.min(l.age-l.partTarget,l.targetduration);i!==void 0&&D>l.partTarget&&(i+=1)}if(Object(G.isFiniteNumber)(a))return new M.HlsUrlParameters(a,Object(G.isFiniteNumber)(i)?i:void 0,M.HlsSkip.No)}}},v.loadPlaylist=function(p){},v.shouldLoadTrack=function(p){return this.canLoad&&p&&!!p.url&&(!p.details||p.details.live)},v.playlistLoaded=function(p,l,o){var s=this,t=l.details,u=l.stats,a=u.loading.end?Math.max(0,self.performance.now()-u.loading.end):0;if(t.advancedDateTime=Date.now()-a,t.live||o!=null&&o.live){if(t.reloaded(o),o&&this.log("live playlist "+p+" "+(t.advanced?"REFRESHED "+t.lastPartSn+"-"+t.lastPartIndex:"MISSED")),o&&t.fragments.length>0&&Object(I.mergeDetails)(o,t),!this.canLoad||!t.live)return;var i,D=void 0,w=void 0;if(t.canBlockReload&&t.endSN&&t.advanced){var S=this.hls.config.lowLatencyMode,L=t.lastPartSn,P=t.endSN,_=t.lastPartIndex,b=_!==-1,g=L===P,m=S?0:_;b?(D=g?P+1:L,w=g?m:_+1):D=P+1;var y=t.age,x=y+t.ageHeader,O=Math.min(x-t.partTarget,t.targetduration*1.5);if(O>0){if(o&&O>o.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+o.tuneInGoal+" to: "+O+" with playlist age: "+t.age),O=0;else{var H=Math.floor(O/t.targetduration);if(D+=H,w!==void 0){var F=Math.round(O%t.targetduration/t.partTarget);w+=F}this.log("CDN Tune-in age: "+t.ageHeader+"s last advanced "+y.toFixed(2)+"s goal: "+O+" skip sn "+H+" to part "+w)}t.tuneInGoal=O}if(i=this.getDeliveryDirectives(t,l.deliveryDirectives,D,w),S||!g){this.loadPlaylist(i);return}}else i=this.getDeliveryDirectives(t,l.deliveryDirectives,D,w);var R=Object(I.computeReloadInterval)(t,u);D!==void 0&&t.canBlockReload&&(R-=t.partTarget||1),this.log("reload live playlist "+p+" in "+Math.round(R)+" ms"),this.timer=self.setTimeout(function(){return s.loadPlaylist(i)},R)}else this.clearTimer()},v.getDeliveryDirectives=function(p,l,o,s){var t=Object(M.getSkipValue)(p,o);return l!=null&&l.skip&&p.deltaUpdateFailed&&(o=l.msn,s=l.part,t=M.HlsSkip.No),new M.HlsUrlParameters(o,s,t)},v.retryLoadingOrFail=function(p){var l=this,o=this.hls.config,s=this.retryCount<o.levelLoadingMaxRetry;if(s){var t;if(this.retryCount++,p.details.indexOf("LoadTimeOut")>-1&&(t=p.context)!==null&&t!==void 0&&t.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+p.details+'"'),this.loadPlaylist();else{var u=Math.min(Math.pow(2,this.retryCount)*o.levelLoadingRetryDelay,o.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return l.loadPlaylist()},u),this.warn("retry playlist loading #"+this.retryCount+" in "+u+' 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(Z,V,j){"use strict";j.r(V),j.d(V,"State",function(){return P}),j.d(V,"default",function(){return _});var G=j("./src/polyfills/number.ts"),M=j("./src/task-loop.ts"),I=j("./src/controller/fragment-tracker.ts"),W=j("./src/utils/buffer-helper.ts"),C=j("./src/utils/logger.ts"),r=j("./src/events.ts"),A=j("./src/errors.ts"),v=j("./src/types/transmuxer.ts"),f=j("./src/utils/mp4-tools.ts"),p=j("./src/utils/discontinuities.ts"),l=j("./src/controller/fragment-finders.ts"),o=j("./src/controller/level-helper.ts"),s=j("./src/loader/fragment-loader.ts"),t=j("./src/crypt/decrypter.ts"),u=j("./src/utils/time-ranges.ts"),a=j("./src/types/loader.ts");function i(b,g){for(var m=0;m<g.length;m++){var y=g[m];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(b,y.key,y)}}function D(b,g,m){return g&&i(b.prototype,g),m&&i(b,m),b}function w(b){if(b===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b}function S(b,g){b.prototype=Object.create(g.prototype),b.prototype.constructor=b,L(b,g)}function L(b,g){return L=Object.setPrototypeOf||function(y,x){return y.__proto__=x,y},L(b,g)}var P={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"},_=function(b){S(g,b);function g(y,x,O){var H;return H=b.call(this)||this,H.hls=void 0,H.fragPrevious=null,H.fragCurrent=null,H.fragmentTracker=void 0,H.transmuxer=null,H._state=P.STOPPED,H.media=void 0,H.mediaBuffer=void 0,H.config=void 0,H.bitrateTest=!1,H.lastCurrentTime=0,H.nextLoadPosition=0,H.startPosition=0,H.loadedmetadata=!1,H.fragLoadError=0,H.retryDate=0,H.levels=null,H.fragmentLoader=void 0,H.levelLastLoaded=null,H.startFragRequested=!1,H.decrypter=void 0,H.initPTS=[],H.onvseeking=null,H.onvended=null,H.logPrefix="",H.log=void 0,H.warn=void 0,H.logPrefix=O,H.log=C.logger.log.bind(C.logger,O+":"),H.warn=C.logger.warn.bind(C.logger,O+":"),H.hls=y,H.fragmentLoader=new s.default(y.config),H.fragmentTracker=x,H.config=y.config,H.decrypter=new t.default(y,y.config),y.on(r.Events.KEY_LOADED,H.onKeyLoaded,w(H)),H}var m=g.prototype;return m.doTick=function(){this.onTickEnd()},m.onTickEnd=function(){},m.startLoad=function(x){},m.stopLoad=function(){this.fragmentLoader.abort();var x=this.fragCurrent;x&&this.fragmentTracker.removeFragment(x),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=P.STOPPED},m._streamEnded=function(x,O){var H=this.fragCurrent,F=this.fragmentTracker;if(!O.live&&H&&H.sn===O.endSN&&!x.nextStart){var R=F.getState(H);return R===I.FragmentState.PARTIAL||R===I.FragmentState.OK}return!1},m.onMediaAttached=function(x,O){var H=this.media=this.mediaBuffer=O.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),H.addEventListener("seeking",this.onvseeking),H.addEventListener("ended",this.onvended);var F=this.config;this.levels&&F.autoStartLoad&&this.state===P.STOPPED&&this.startLoad(F.startPosition)},m.onMediaDetaching=function(){var x=this.media;x!=null&&x.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),x&&(x.removeEventListener("seeking",this.onvseeking),x.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},m.onMediaSeeking=function(){var x=this.config,O=this.fragCurrent,H=this.media,F=this.mediaBuffer,R=this.state,U=H?H.currentTime:0,k=W.BufferHelper.bufferInfo(F||H,U,x.maxBufferHole);if(this.log("media seeking to "+(Object(G.isFiniteNumber)(U)?U.toFixed(3):U)+", state: "+R),R===P.ENDED)this.resetLoadingState();else if(O&&!k.len){var d=x.maxFragLookUpTolerance,z=O.start-d,Y=O.start+O.duration+d,re=U>Y;(U<z||re)&&(re&&O.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),O.loader.abort()),this.resetLoadingState())}H&&(this.lastCurrentTime=U),!this.loadedmetadata&&!k.len&&(this.nextLoadPosition=this.startPosition=U),this.tickImmediate()},m.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},m.onKeyLoaded=function(x,O){if(this.state!==P.KEY_LOADING||O.frag!==this.fragCurrent||!this.levels)return;this.state=P.IDLE;var H=this.levels[O.frag.level].details;H&&this.loadFragment(O.frag,H,O.frag.start)},m.onHandlerDestroying=function(){this.stopLoad(),b.prototype.onHandlerDestroying.call(this)},m.onHandlerDestroyed=function(){this.state=P.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,b.prototype.onHandlerDestroyed.call(this)},m.loadKey=function(x,O){this.log("Loading key for "+x.sn+" of ["+O.startSN+"-"+O.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+x.level),this.state=P.KEY_LOADING,this.fragCurrent=x,this.hls.trigger(r.Events.KEY_LOADING,{frag:x})},m.loadFragment=function(x,O,H){this._loadFragForPlayback(x,O,H)},m._loadFragForPlayback=function(x,O,H){var F=this,R=function(k){if(F.fragContextChanged(x)){F.warn("Fragment "+x.sn+(k.part?" p: "+k.part.index:"")+" of level "+x.level+" was dropped during download."),F.fragmentTracker.removeFragment(x);return}x.stats.chunkCount++,F._handleFragmentLoadProgress(k)};this._doFragLoad(x,O,H,R).then(function(U){if(!U)return;F.fragLoadError=0;var k=F.state;if(F.fragContextChanged(x)){(k===P.FRAG_LOADING||k===P.BACKTRACKING||!F.fragCurrent&&k===P.PARSING)&&(F.fragmentTracker.removeFragment(x),F.state=P.IDLE);return}if("payload"in U&&(F.log("Loaded fragment "+x.sn+" of level "+x.level),F.hls.trigger(r.Events.FRAG_LOADED,U),F.state===P.BACKTRACKING)){F.fragmentTracker.backtrack(x,U),F.resetFragmentLoading(x);return}F._handleFragmentLoadComplete(U)}).catch(function(U){F.warn(U),F.resetFragmentLoading(x)})},m.flushMainBuffer=function(x,O,H){if(H===void 0&&(H=null),!(x-O))return;var F={startOffset:x,endOffset:O,type:H};this.fragLoadError=0,this.hls.trigger(r.Events.BUFFER_FLUSHING,F)},m._loadInitSegment=function(x){var O=this;this._doFragLoad(x).then(function(H){if(!H||O.fragContextChanged(x)||!O.levels)throw new Error("init load aborted");return H}).then(function(H){var F=O.hls,R=H.payload,U=x.decryptdata;if(R&&R.byteLength>0&&U&&U.key&&U.iv&&U.method==="AES-128"){var k=self.performance.now();return O.decrypter.webCryptoDecrypt(new Uint8Array(R),U.key.buffer,U.iv.buffer).then(function(d){var z=self.performance.now();return F.trigger(r.Events.FRAG_DECRYPTED,{frag:x,payload:d,stats:{tstart:k,tdecrypt:z}}),H.payload=d,H})}return H}).then(function(H){var F=O.fragCurrent,R=O.hls,U=O.levels;if(!U)throw new Error("init load aborted, missing levels");var k=U[x.level].details;console.assert(k,"Level details are defined when init segment is loaded");var d=x.stats;O.state=P.IDLE,O.fragLoadError=0,x.data=new Uint8Array(H.payload),d.parsing.start=d.buffering.start=self.performance.now(),d.parsing.end=d.buffering.end=self.performance.now(),H.frag===F&&R.trigger(r.Events.FRAG_BUFFERED,{stats:d,frag:F,part:null,id:x.type}),O.tick()}).catch(function(H){O.warn(H),O.resetFragmentLoading(x)})},m.fragContextChanged=function(x){var O=this.fragCurrent;return!x||!O||x.level!==O.level||x.sn!==O.sn||x.urlId!==O.urlId},m.fragBufferedComplete=function(x,O){var H=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+x.type+" sn: "+x.sn+(O?" part: "+O.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+x.level+" "+u.default.toString(W.BufferHelper.getBuffered(H))),this.state=P.IDLE,this.tick()},m._handleFragmentLoadComplete=function(x){var O=this.transmuxer;if(!O)return;var H=x.frag,F=x.part,R=x.partsLoaded,U=!R||R.length===0||R.some(function(d){return!d}),k=new v.ChunkMetadata(H.level,H.sn,H.stats.chunkCount+1,0,F?F.index:-1,!U);O.flush(k)},m._handleFragmentLoadProgress=function(x){},m._doFragLoad=function(x,O,H,F){var R=this;if(H===void 0&&(H=null),!this.levels)throw new Error("frag load aborted, missing levels");if(H=Math.max(x.start,H||0),this.config.lowLatencyMode&&O){var U=O.partList;if(U&&F){H>x.end&&O.fragmentHint&&(x=O.fragmentHint);var k=this.getNextPart(U,x,H);if(k>-1){var d=U[k];return this.log("Loading part sn: "+x.sn+" p: "+d.index+" cc: "+x.cc+" of playlist ["+O.startSN+"-"+O.endSN+"] parts [0-"+k+"-"+(U.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+x.level+", target: "+parseFloat(H.toFixed(3))),this.nextLoadPosition=d.start+d.duration,this.state=P.FRAG_LOADING,this.hls.trigger(r.Events.FRAG_LOADING,{frag:x,part:U[k],targetBufferTime:H}),this.doFragPartsLoad(x,U,k,F).catch(function(z){return R.handleFragLoadError(z)})}else if(!x.url||this.loadedEndOfParts(U,H))return Promise.resolve(null)}}return this.log("Loading fragment "+x.sn+" cc: "+x.cc+" "+(O?"of ["+O.startSN+"-"+O.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+x.level+", target: "+parseFloat(H.toFixed(3))),Object(G.isFiniteNumber)(x.sn)&&!this.bitrateTest&&(this.nextLoadPosition=x.start+x.duration),this.state=P.FRAG_LOADING,this.hls.trigger(r.Events.FRAG_LOADING,{frag:x,targetBufferTime:H}),this.fragmentLoader.load(x,F).catch(function(z){return R.handleFragLoadError(z)})},m.doFragPartsLoad=function(x,O,H,F){var R=this;return new Promise(function(U,k){var d=[],z=function Y(re){var le=O[re];R.fragmentLoader.loadPart(x,le,F).then(function(Ne){d[le.index]=Ne;var Ce=Ne.part;R.hls.trigger(r.Events.FRAG_LOADED,Ne);var Te=O[re+1];if(Te&&Te.fragment===x)Y(re+1);else return U({frag:x,part:Ce,partsLoaded:d})}).catch(k)};z(H)})},m.handleFragLoadError=function(x){var O=x.data;return O&&O.details===A.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(O.frag,O.part):this.hls.trigger(r.Events.ERROR,O),null},m._handleTransmuxerFlush=function(x){var O=this.getCurrentContext(x);if(!O||this.state!==P.PARSING){this.fragCurrent||(this.state=P.IDLE);return}var H=O.frag,F=O.part,R=O.level,U=self.performance.now();H.stats.parsing.end=U,F&&(F.stats.parsing.end=U),this.updateLevelTiming(H,F,R,x.partial)},m.getCurrentContext=function(x){var O=this.levels,H=x.level,F=x.sn,R=x.part;if(!O||!O[H])return this.warn("Levels object was unset while buffering fragment "+F+" of level "+H+". The current chunk will not be buffered."),null;var U=O[H],k=R>-1?Object(o.getPartWith)(U,F,R):null,d=k?k.fragment:Object(o.getFragmentWithSN)(U,F,this.fragCurrent);return d?{frag:d,part:k,level:U}:null},m.bufferFragmentData=function(x,O,H,F){if(!x||this.state!==P.PARSING)return;var R=x.data1,U=x.data2,k=R;if(R&&U&&(k=Object(f.appendUint8Array)(R,U)),!k||!k.length)return;var d={type:x.type,frag:O,part:H,chunkMeta:F,parent:O.type,data:k};this.hls.trigger(r.Events.BUFFER_APPENDING,d),x.dropped&&x.independent&&!H&&this.flushBufferGap(O)},m.flushBufferGap=function(x){var O=this.media;if(!O)return;if(!W.BufferHelper.isBuffered(O,O.currentTime)){this.flushMainBuffer(0,x.start);return}var H=O.currentTime,F=W.BufferHelper.bufferInfo(O,H,0),R=x.duration,U=Math.min(this.config.maxFragLookUpTolerance*2,R*.25),k=Math.max(Math.min(x.start-U,F.end-U),H+U);x.start-k>U&&this.flushMainBuffer(k,x.start)},m.getFwdBufferInfo=function(x,O){var H=this.config,F=this.getLoadPosition();if(!Object(G.isFiniteNumber)(F))return null;var R=W.BufferHelper.bufferInfo(x,F,H.maxBufferHole);if(R.len===0&&R.nextStart!==void 0){var U=this.fragmentTracker.getBufferedFrag(F,O);if(U&&R.nextStart<U.end)return W.BufferHelper.bufferInfo(x,F,Math.max(R.nextStart,H.maxBufferHole))}return R},m.getMaxBufferLength=function(x){var O=this.config,H;return x?H=Math.max(8*O.maxBufferSize/x,O.maxBufferLength):H=O.maxBufferLength,Math.min(H,O.maxMaxBufferLength)},m.reduceMaxBufferLength=function(x){var O=this.config,H=x||O.maxBufferLength;return O.maxMaxBufferLength>=H?(O.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+O.maxMaxBufferLength+"s"),!0):!1},m.getNextFragment=function(x,O){var H,F,R=O.fragments,U=R.length;if(!U)return null;var k=this.config,d=R[0].start,z;if(O.live){var Y=k.initialLiveManifestSize;if(U<Y)return this.warn("Not enough fragments to start playback (have: "+U+", need: "+Y+")"),null;!O.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(z=this.getInitialLiveFragment(O,R),this.startPosition=z?this.hls.liveSyncPosition||z.start:x)}else x<=d&&(z=R[0]);if(!z){var re=k.lowLatencyMode?O.partEnd:O.fragmentEnd;z=this.getFragmentAtPosition(x,re,O)}return(H=z)!==null&&H!==void 0&&H.initSegment&&!((F=z)!==null&&F!==void 0&&F.initSegment.data)&&!this.bitrateTest&&(z=z.initSegment),z},m.getNextPart=function(x,O,H){for(var F=-1,R=!1,U=!0,k=0,d=x.length;k<d;k++){var z=x[k];if(U=U&&!z.independent,F>-1&&H<z.start)break;var Y=z.loaded;!Y&&(R||z.independent||U)&&z.fragment===O&&(F=k),R=Y}return F},m.loadedEndOfParts=function(x,O){var H=x[x.length-1];return H&&O>H.start&&H.loaded},m.getInitialLiveFragment=function(x,O){var H=this.fragPrevious,F=null;if(H){if(x.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+H.programDateTime),F=Object(l.findFragmentByPDT)(O,H.endProgramDateTime,this.config.maxFragLookUpTolerance)),!F){var R=H.sn+1;if(R>=x.startSN&&R<=x.endSN){var U=O[R-x.startSN];H.cc===U.cc&&(F=U,this.log("Live playlist, switching playlist, load frag with next SN: "+F.sn))}F||(F=Object(l.findFragWithCC)(O,H.cc),F&&this.log("Live playlist, switching playlist, load frag with same CC: "+F.sn))}}else{var k=this.hls.liveSyncPosition;k!==null&&(F=this.getFragmentAtPosition(k,this.bitrateTest?x.fragmentEnd:x.edge,x))}return F},m.getFragmentAtPosition=function(x,O,H){var F=this.config,R=this.fragPrevious,U=H.fragments,k=H.endSN,d=H.fragmentHint,z=F.maxFragLookUpTolerance,Y=!!(F.lowLatencyMode&&H.partList&&d);Y&&d&&!this.bitrateTest&&(U=U.concat(d),k=d.sn);var re;if(x<O){var le=x>O-z?0:z;re=Object(l.findFragmentByPTS)(R,U,x,le)}else re=U[U.length-1];if(re){var Ne=re.sn-H.startSN,Ce=R&&re.level===R.level,Te=U[Ne+1],Fe=this.fragmentTracker.getState(re);if(Fe===I.FragmentState.BACKTRACKED){re=null;for(var Ve=Ne;U[Ve]&&this.fragmentTracker.getState(U[Ve])===I.FragmentState.BACKTRACKED;)R?re=U[Ve--]:re=U[--Ve];re||(re=Te)}else R&&re.sn===R.sn&&!Y&&(Ce&&(re.sn<k&&this.fragmentTracker.getState(Te)!==I.FragmentState.OK?(this.log("SN "+re.sn+" just loaded, load next one: "+Te.sn),re=Te):re=null))}return re},m.synchronizeToLiveEdge=function(x){var O=this.config,H=this.media;if(!H)return;var F=this.hls.liveSyncPosition,R=H.currentTime,U=x.fragments[0].start,k=x.edge,d=R>=U-O.maxFragLookUpTolerance&&R<=k;if(F!==null&&H.duration>F&&(R<F||!d)){var z=O.liveMaxLatencyDuration!==void 0?O.liveMaxLatencyDuration:O.liveMaxLatencyDurationCount*x.targetduration;(!d&&H.readyState<4||R<k-z)&&(this.loadedmetadata||(this.nextLoadPosition=F),H.readyState&&(this.warn("Playback: "+R.toFixed(3)+" is located too far from the end of live sliding playlist: "+k+", reset currentTime to : "+F.toFixed(3)),H.currentTime=F))}},m.alignPlaylists=function(x,O){var H=this.levels,F=this.levelLastLoaded,R=this.fragPrevious,U=F!==null?H[F]:null,k=x.fragments.length;if(!k)return this.warn("No fragments in live playlist"),0;var d=x.fragments[0].start,z=!O,Y=x.alignedSliding&&Object(G.isFiniteNumber)(d);if(z||!Y&&!d){Object(p.alignStream)(R,U,x);var re=x.fragments[0].start;return this.log("Live playlist sliding: "+re.toFixed(2)+" start-sn: "+(O?O.startSN:"na")+"->"+x.startSN+" prev-sn: "+(R?R.sn:"na")+" fragments: "+k),re}return d},m.waitForCdnTuneIn=function(x){var O=3;return x.live&&x.canBlockReload&&x.tuneInGoal>Math.max(x.partHoldBack,x.partTarget*O)},m.setStartPosition=function(x,O){var H=this.startPosition;if(H<O&&(H=-1),H===-1||this.lastCurrentTime===-1){var F=x.startTimeOffset;Object(G.isFiniteNumber)(F)?(H=O+F,F<0&&(H+=x.totalduration),H=Math.min(Math.max(O,H),O+x.totalduration),this.log("Start time offset "+F+" found in playlist, adjust startPosition to "+H),this.startPosition=H):x.live?H=this.hls.liveSyncPosition||O:this.startPosition=H=0,this.lastCurrentTime=H}this.nextLoadPosition=H},m.getLoadPosition=function(){var x=this.media,O=0;return this.loadedmetadata&&x?O=x.currentTime:this.nextLoadPosition&&(O=this.nextLoadPosition),O},m.handleFragLoadAborted=function(x,O){this.transmuxer&&x.sn!=="initSegment"&&x.stats.aborted&&(this.warn("Fragment "+x.sn+(O?" part"+O.index:"")+" of level "+x.level+" was aborted"),this.resetFragmentLoading(x))},m.resetFragmentLoading=function(x){(!this.fragCurrent||!this.fragContextChanged(x))&&(this.state=P.IDLE)},m.onFragmentOrKeyLoadError=function(x,O){if(O.fatal)return;var H=O.frag;if(!H||H.type!==x)return;var F=this.fragCurrent;console.assert(F&&H.sn===F.sn&&H.level===F.level&&H.urlId===F.urlId,"Frag load error must match current frag to retry");var R=this.config;if(this.fragLoadError+1<=R.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(H.level))return;var U=Math.min(Math.pow(2,this.fragLoadError)*R.fragLoadingRetryDelay,R.fragLoadingMaxRetryTimeout);this.warn("Fragment "+H.sn+" of "+x+" "+H.level+" failed to load, retrying in "+U+"ms"),this.retryDate=self.performance.now()+U,this.fragLoadError++,this.state=P.FRAG_LOADING_WAITING_RETRY}else O.levelRetry?(x===a.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=P.IDLE):(C.logger.error(O.details+" reaches max retry, redispatch as fatal ..."),O.fatal=!0,this.hls.stopLoad(),this.state=P.ERROR)},m.afterBufferFlushed=function(x,O,H){if(!x)return;var F=W.BufferHelper.getBuffered(x);this.fragmentTracker.detectEvictedFragments(O,F,H),this.state===P.ENDED&&this.resetLoadingState()},m.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=P.IDLE},m.resetLiveStartWhenNotLoaded=function(x){if(!this.loadedmetadata){this.startFragRequested=!1;var O=this.levels?this.levels[x].details:null;if(O!=null&&O.live)return this.startPosition=-1,this.setStartPosition(O,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},m.updateLevelTiming=function(x,O,H,F){var R=this,U=H.details;console.assert(!!U,"level.details must be defined");var k=Object.keys(x.elementaryStreams).reduce(function(d,z){var Y=x.elementaryStreams[z];if(Y){var re=Y.endPTS-Y.startPTS;if(re<=0)return R.warn("Could not parse fragment "+x.sn+" "+z+" duration reliably ("+re+") resetting transmuxer to fallback to playlist timing"),R.resetTransmuxer(),d||!1;var le=F?0:Object(o.updateFragPTSDTS)(U,x,Y.startPTS,Y.endPTS,Y.startDTS,Y.endDTS);return R.hls.trigger(r.Events.LEVEL_PTS_UPDATED,{details:U,level:H,drift:le,type:z,frag:x,start:Y.startPTS,end:Y.endPTS}),!0}return d},!1);k?(this.state=P.PARSED,this.hls.trigger(r.Events.FRAG_PARSED,{frag:x,part:O})):this.resetLoadingState()},m.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},D(g,[{key:"state",get:function(){return this._state},set:function(x){var O=this._state;O!==x&&(this._state=x,this.log(O+"->"+x))}}]),g}(M.default)},"./src/controller/buffer-controller.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"default",function(){return l});var G=j("./src/polyfills/number.ts"),M=j("./src/events.ts"),I=j("./src/utils/logger.ts"),W=j("./src/errors.ts"),C=j("./src/utils/buffer-helper.ts"),r=j("./src/utils/mediasource-helper.ts"),A=j("./src/loader/fragment.ts"),v=j("./src/controller/buffer-operation-queue.ts"),f=Object(r.getMediaSource)(),p=/([ha]vc.)(?:\.[^.,]+)+/,l=function(){function o(t){var u=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 a=u.hls,i=u.media,D=u.mediaSource;I.logger.log("[buffer-controller]: Media source opened"),i&&(u.updateMediaElementDuration(),a.trigger(M.Events.MEDIA_ATTACHED,{media:i})),D&&D.removeEventListener("sourceopen",u._onMediaSourceOpen),u.checkPendingTracks()},this._onMediaSourceClose=function(){I.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){I.logger.log("[buffer-controller]: Media source ended")},this.hls=t,this._initSourceBuffer(),this.registerListeners()}var s=o.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 u=this.hls;u.on(M.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(M.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(M.Events.BUFFER_RESET,this.onBufferReset,this),u.on(M.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.on(M.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.on(M.Events.BUFFER_EOS,this.onBufferEos,this),u.on(M.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.on(M.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.on(M.Events.FRAG_PARSED,this.onFragParsed,this),u.on(M.Events.FRAG_CHANGED,this.onFragChanged,this)},s.unregisterListeners=function(){var u=this.hls;u.off(M.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(M.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(M.Events.BUFFER_RESET,this.onBufferReset,this),u.off(M.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.off(M.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.off(M.Events.BUFFER_EOS,this.onBufferEos,this),u.off(M.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.off(M.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.off(M.Events.FRAG_PARSED,this.onFragParsed,this),u.off(M.Events.FRAG_CHANGED,this.onFragChanged,this)},s._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new v.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},s.onManifestParsed=function(u,a){var i=2;(a.audio&&!a.video||!a.altAudio)&&(i=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=i,this.details=null,I.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},s.onMediaAttaching=function(u,a){var i=this.media=a.media;if(i&&f){var D=this.mediaSource=new f;D.addEventListener("sourceopen",this._onMediaSourceOpen),D.addEventListener("sourceended",this._onMediaSourceEnded),D.addEventListener("sourceclose",this._onMediaSourceClose),i.src=self.URL.createObjectURL(D),this._objectUrl=i.src}},s.onMediaDetaching=function(){var u=this.media,a=this.mediaSource,i=this._objectUrl;if(a){if(I.logger.log("[buffer-controller]: media source detaching"),a.readyState==="open")try{a.endOfStream()}catch(D){I.logger.warn("[buffer-controller]: onMediaDetaching: "+D.message+" while calling endOfStream")}this.onBufferReset(),a.removeEventListener("sourceopen",this._onMediaSourceOpen),a.removeEventListener("sourceended",this._onMediaSourceEnded),a.removeEventListener("sourceclose",this._onMediaSourceClose),u&&(i&&self.URL.revokeObjectURL(i),u.src===i?(u.removeAttribute("src"),u.load()):I.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(M.Events.MEDIA_DETACHED,void 0)},s.onBufferReset=function(){var u=this;this.getSourceBufferTypes().forEach(function(a){var i=u.sourceBuffer[a];try{i&&(u.removeBufferListeners(a),u.mediaSource&&u.mediaSource.removeSourceBuffer(i),u.sourceBuffer[a]=void 0)}catch(D){I.logger.warn("[buffer-controller]: Failed to reset the "+a+" buffer",D)}}),this._initSourceBuffer()},s.onBufferCodecs=function(u,a){var i=this,D=this.getSourceBufferTypes().length;if(Object.keys(a).forEach(function(w){if(D){var S=i.tracks[w];if(S&&typeof S.buffer.changeType=="function"){var L=a[w],P=L.codec,_=L.levelCodec,b=L.container,g=(S.levelCodec||S.codec).replace(p,"$1"),m=(_||P).replace(p,"$1");if(g!==m){var y=b+";codecs="+(_||P);i.appendChangeType(w,y)}}}else i.pendingTracks[w]=a[w]}),D)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},s.appendChangeType=function(u,a){var i=this,D=this.operationQueue,w={execute:function(){var L=i.sourceBuffer[u];L&&(I.logger.log("[buffer-controller]: changing "+u+" sourceBuffer type to "+a),L.changeType(a)),D.shiftAndExecuteNext(u)},onStart:function(){},onComplete:function(){},onError:function(L){I.logger.warn("[buffer-controller]: Failed to change "+u+" SourceBuffer type",L)}};D.append(w,u)},s.onBufferAppending=function(u,a){var i=this,D=this.hls,w=this.operationQueue,S=this.tracks,L=a.data,P=a.type,_=a.frag,b=a.part,g=a.chunkMeta,m=g.buffering[P],y=self.performance.now();m.start=y;var x=_.stats.buffering,O=b?b.stats.buffering:null;x.start===0&&(x.start=y),O&&O.start===0&&(O.start=y);var H=S.audio,F=P==="audio"&&g.id===1&&(H==null?void 0:H.container)==="audio/mpeg",R={execute:function(){if(m.executeStart=self.performance.now(),F){var k=i.sourceBuffer[P];if(k){var d=_.start-k.timestampOffset;Math.abs(d)>=.1&&(I.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+_.start+" (delta: "+d+") sn: "+_.sn+")"),k.timestampOffset=_.start)}}i.appendExecutor(L,P)},onStart:function(){},onComplete:function(){var k=self.performance.now();m.executeEnd=m.end=k,x.first===0&&(x.first=k),O&&O.first===0&&(O.first=k);var d=i.sourceBuffer,z={};for(var Y in d)z[Y]=C.BufferHelper.getBuffered(d[Y]);i.appendError=0,i.hls.trigger(M.Events.BUFFER_APPENDED,{type:P,frag:_,part:b,chunkMeta:g,parent:_.type,timeRanges:z})},onError:function(k){I.logger.error("[buffer-controller]: Error encountered while trying to append to the "+P+" SourceBuffer",k);var d={type:W.ErrorTypes.MEDIA_ERROR,parent:_.type,details:W.ErrorDetails.BUFFER_APPEND_ERROR,err:k,fatal:!1};k.code===DOMException.QUOTA_EXCEEDED_ERR?d.details=W.ErrorDetails.BUFFER_FULL_ERROR:(i.appendError++,d.details=W.ErrorDetails.BUFFER_APPEND_ERROR,i.appendError>D.config.appendErrorMaxRetry&&(I.logger.error("[buffer-controller]: Failed "+D.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),d.fatal=!0)),D.trigger(M.Events.ERROR,d)}};w.append(R,P)},s.onBufferFlushing=function(u,a){var i=this,D=this.operationQueue,w=function(L){return{execute:i.removeExecutor.bind(i,L,a.startOffset,a.endOffset),onStart:function(){},onComplete:function(){i.hls.trigger(M.Events.BUFFER_FLUSHED,{type:L})},onError:function(_){I.logger.warn("[buffer-controller]: Failed to remove from "+L+" SourceBuffer",_)}}};a.type?D.append(w(a.type),a.type):this.getSourceBufferTypes().forEach(function(S){D.append(w(S),S)})},s.onFragParsed=function(u,a){var i=this,D=a.frag,w=a.part,S=[],L=w?w.elementaryStreams:D.elementaryStreams;L[A.ElementaryStreamTypes.AUDIOVIDEO]?S.push("audiovideo"):(L[A.ElementaryStreamTypes.AUDIO]&&S.push("audio"),L[A.ElementaryStreamTypes.VIDEO]&&S.push("video"));var P=function(){var b=self.performance.now();D.stats.buffering.end=b,w&&(w.stats.buffering.end=b);var g=w?w.stats:D.stats;i.hls.trigger(M.Events.FRAG_BUFFERED,{frag:D,part:w,stats:g,id:D.type})};S.length===0&&I.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+D.type+" level: "+D.level+" sn: "+D.sn),this.blockBuffers(P,S)},s.onFragChanged=function(u,a){this.flushBackBuffer()},s.onBufferEos=function(u,a){var i=this,D=this.getSourceBufferTypes().reduce(function(w,S){var L=i.sourceBuffer[S];return(!a.type||a.type===S)&&(L&&!L.ended&&(L.ended=!0,I.logger.log("[buffer-controller]: "+S+" sourceBuffer now EOS"))),w&&!!(!L||L.ended)},!0);D&&this.blockBuffers(function(){var w=i.mediaSource;if(!w||w.readyState!=="open")return;w.endOfStream()})},s.onLevelUpdated=function(u,a){var i=a.details;if(!i.fragments.length)return;this.details=i,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},s.flushBackBuffer=function(){var u=this.hls,a=this.details,i=this.media,D=this.sourceBuffer;if(!i||a===null)return;var w=this.getSourceBufferTypes();if(!w.length)return;var S=a.live&&u.config.liveBackBufferLength!==null?u.config.liveBackBufferLength:u.config.backBufferLength;if(!Object(G.isFiniteNumber)(S)||S<0)return;var L=i.currentTime,P=a.levelTargetDuration,_=Math.max(S,P),b=Math.floor(L/P)*P-_;w.forEach(function(g){var m=D[g];if(m){var y=C.BufferHelper.getBuffered(m);y.length>0&&b>y.start(0)&&(u.trigger(M.Events.BACK_BUFFER_REACHED,{bufferEnd:b}),a.live&&u.trigger(M.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:b}),u.trigger(M.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:b,type:g}))}})},s.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var u=this.details,a=this.hls,i=this.media,D=this.mediaSource,w=u.fragments[0].start+u.totalduration,S=i.duration,L=Object(G.isFiniteNumber)(D.duration)?D.duration:0;u.live&&a.config.liveDurationInfinity?(I.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),D.duration=Infinity,this.updateSeekableRange(u)):(w>L&&w>S||!Object(G.isFiniteNumber)(S))&&(I.logger.log("[buffer-controller]: Updating Media Source duration to "+w.toFixed(3)),D.duration=w)},s.updateSeekableRange=function(u){var a=this.mediaSource,i=u.fragments,D=i.length;if(D&&u.live&&a!==null&&a!==void 0&&a.setLiveSeekableRange){var w=Math.max(0,i[0].start),S=Math.max(w,w+u.totalduration);a.setLiveSeekableRange(w,S)}},s.checkPendingTracks=function(){var u=this.bufferCodecEventsExpected,a=this.operationQueue,i=this.pendingTracks,D=Object.keys(i).length;if(D&&!u||D===2){this.createSourceBuffers(i),this.pendingTracks={};var w=this.getSourceBufferTypes();if(w.length===0){this.hls.trigger(M.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}w.forEach(function(S){a.executeNext(S)})}},s.createSourceBuffers=function(u){var a=this.sourceBuffer,i=this.mediaSource;if(!i)throw Error("createSourceBuffers called when mediaSource was null");var D=0;for(var w in u)if(!a[w]){var S=u[w];if(!S)throw Error("source buffer exists for track "+w+", however track does not");var L=S.levelCodec||S.codec,P=S.container+";codecs="+L;I.logger.log("[buffer-controller]: creating sourceBuffer("+P+")");try{var _=a[w]=i.addSourceBuffer(P),b=w;this.addBufferListener(b,"updatestart",this._onSBUpdateStart),this.addBufferListener(b,"updateend",this._onSBUpdateEnd),this.addBufferListener(b,"error",this._onSBUpdateError),this.tracks[w]={buffer:_,codec:L,container:S.container,levelCodec:S.levelCodec,id:S.id},D++}catch(g){I.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+g.message),this.hls.trigger(M.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:g,mimeType:P})}}D&&this.hls.trigger(M.Events.BUFFER_CREATED,{tracks:this.tracks})},s._onSBUpdateStart=function(u){var a=this.operationQueue,i=a.current(u);i.onStart()},s._onSBUpdateEnd=function(u){var a=this.operationQueue,i=a.current(u);i.onComplete(),a.shiftAndExecuteNext(u)},s._onSBUpdateError=function(u,a){I.logger.error("[buffer-controller]: "+u+" SourceBuffer error",a),this.hls.trigger(M.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var i=this.operationQueue.current(u);i&&i.onError(a)},s.removeExecutor=function(u,a,i){var D=this.media,w=this.mediaSource,S=this.operationQueue,L=this.sourceBuffer,P=L[u];if(!D||!w||!P){I.logger.warn("[buffer-controller]: Attempting to remove from the "+u+" SourceBuffer, but it does not exist"),S.shiftAndExecuteNext(u);return}var _=Object(G.isFiniteNumber)(D.duration)?D.duration:Infinity,b=Object(G.isFiniteNumber)(w.duration)?w.duration:Infinity,g=Math.max(0,a),m=Math.min(i,_,b);m>g?(I.logger.log("[buffer-controller]: Removing ["+g+","+m+"] from the "+u+" SourceBuffer"),console.assert(!P.updating,u+" sourceBuffer must not be updating"),P.remove(g,m)):S.shiftAndExecuteNext(u)},s.appendExecutor=function(u,a){var i=this.operationQueue,D=this.sourceBuffer,w=D[a];if(!w){I.logger.warn("[buffer-controller]: Attempting to append to the "+a+" SourceBuffer, but it does not exist"),i.shiftAndExecuteNext(a);return}w.ended=!1,console.assert(!w.updating,a+" sourceBuffer must not be updating"),w.appendBuffer(u)},s.blockBuffers=function(u,a){var i=this;if(a===void 0&&(a=this.getSourceBufferTypes()),!a.length){I.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(u);return}var D=this.operationQueue,w=a.map(function(S){return D.appendBlocker(S)});Promise.all(w).then(function(){u(),a.forEach(function(S){var L=i.sourceBuffer[S];(!L||!L.updating)&&D.shiftAndExecuteNext(S)})})},s.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},s.addBufferListener=function(u,a,i){var D=this.sourceBuffer[u];if(!D)return;var w=i.bind(this,u);this.listeners[u].push({event:a,listener:w}),D.addEventListener(a,w)},s.removeBufferListeners=function(u){var a=this.sourceBuffer[u];if(!a)return;this.listeners[u].forEach(function(i){a.removeEventListener(i.event,i.listener)})},o}()},"./src/controller/buffer-operation-queue.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"default",function(){return M});var G=j("./src/utils/logger.ts"),M=function(){function I(C){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=C}var W=I.prototype;return W.append=function(r,A){var v=this.queues[A];v.push(r),v.length===1&&this.buffers[A]&&this.executeNext(A)},W.insertAbort=function(r,A){var v=this.queues[A];v.unshift(r),this.executeNext(A)},W.appendBlocker=function(r){var A,v=new Promise(function(p){A=p}),f={execute:A,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(f,r),v},W.executeNext=function(r){var A=this.buffers,v=this.queues,f=A[r],p=v[r];if(p.length){var l=p[0];try{l.execute()}catch(o){G.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),l.onError(o),(!f||!f.updating)&&(p.shift(),this.executeNext(r))}}},W.shiftAndExecuteNext=function(r){this.queues[r].shift(),this.executeNext(r)},W.current=function(r){return this.queues[r][0]},I}()},"./src/controller/cap-level-controller.ts":function(Z,V,j){"use strict";j.r(V);var G=j("./src/events.ts");function M(C,r){for(var A=0;A<r.length;A++){var v=r[A];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(C,v.key,v)}}function I(C,r,A){return r&&M(C.prototype,r),A&&M(C,A),C}var W=function(){function C(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=C.prototype;return r.setStreamController=function(v){this.streamController=v},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 v=this.hls;v.on(G.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.on(G.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.on(G.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},r.unregisterListener=function(){var v=this.hls;v.off(G.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),v.off(G.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),v.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.off(G.Events.BUFFER_CODECS,this.onBufferCodecs,this),v.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},r.onFpsDropLevelCapping=function(v,f){C.isLevelAllowed(f.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(f.droppedLevel)},r.onMediaAttaching=function(v,f){this.media=f.media instanceof HTMLVideoElement?f.media:null},r.onManifestParsed=function(v,f){var p=this.hls;this.restrictedLevels=[],this.firstLevel=f.firstLevel,p.config.capLevelToPlayerSize&&f.video&&this.startCapping()},r.onBufferCodecs=function(v,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 v=this.hls.levels;if(v.length){var f=this.hls;f.autoLevelCapping=this.getMaxLevel(v.length-1),f.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=f.autoLevelCapping}}},r.getMaxLevel=function(v){var f=this,p=this.hls.levels;if(!p.length)return-1;var l=p.filter(function(o,s){return C.isLevelAllowed(s,f.restrictedLevels)&&s<=v});return this.clientRect=null,C.getMaxLevelByMediaSize(l,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 v=this.media,f={width:0,height:0};if(v){var p=v.getBoundingClientRect();f.width=p.width,f.height=p.height,!f.width&&!f.height&&(f.width=p.right-p.left||v.width||0,f.height=p.bottom-p.top||v.height||0)}return this.clientRect=f,f},C.isLevelAllowed=function(v,f){return f===void 0&&(f=[]),f.indexOf(v)===-1},C.getMaxLevelByMediaSize=function(v,f,p){if(!v||!v.length)return-1;for(var l=function(a,i){return i?a.width!==i.width||a.height!==i.height:!0},o=v.length-1,s=0;s<v.length;s+=1){var t=v[s];if((t.width>=f||t.height>=p)&&l(t,v[s+1])){o=s;break}}return o},I(C,[{key:"mediaWidth",get:function(){return this.getDimensions().width*C.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*C.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var v=1;try{v=self.devicePixelRatio}catch(f){}return v}}]),C}();V.default=W},"./src/controller/cmcd-controller.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"default",function(){return l});var G=j("./src/events.ts"),M=j("./src/types/cmcd.ts"),I=j("./src/utils/buffer-helper.ts"),W=j("./src/utils/logger.ts");function C(o,s){for(var t=0;t<s.length;t++){var u=s[t];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(o,u.key,u)}}function r(o,s,t){return s&&C(o.prototype,s),t&&C(o,t),o}function A(o,s){var t=typeof Symbol!="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(t)return(t=t.call(o)).next.bind(t);if(Array.isArray(o)||(t=v(o))||s&&o&&typeof o.length=="number"){t&&(o=t);var u=0;return function(){return u>=o.length?{done:!0}:{done:!1,value:o[u++]}}}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 v(o,s){if(!o)return;if(typeof o=="string")return f(o,s);var t=Object.prototype.toString.call(o).slice(8,-1);if(t==="Object"&&o.constructor&&(t=o.constructor.name),t==="Map"||t==="Set")return Array.from(o);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return f(o,s)}function f(o,s){(s==null||s>o.length)&&(s=o.length);for(var t=0,u=new Array(s);t<s;t++)u[t]=o[t];return u}function p(){return p=Object.assign||function(o){for(var s=1;s<arguments.length;s++){var t=arguments[s];for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(o[u]=t[u])}return o},p.apply(this,arguments)}var l=function(){function o(t){var u=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(){u.initialized&&(u.starved=!0),u.buffering=!0},this.onPlaying=function(){u.initialized||(u.initialized=!0),u.buffering=!1},this.applyPlaylistData=function(D){try{u.apply(D,{ot:M.CMCDObjectType.MANIFEST,su:!u.initialized})}catch(w){W.logger.warn("Could not generate manifest CMCD data.",w)}},this.applyFragmentData=function(D){try{var w=D.frag,S=u.hls.levels[w.level],L=u.getObjectType(w),P={d:w.duration*1e3,ot:L};(L===M.CMCDObjectType.VIDEO||L===M.CMCDObjectType.AUDIO||L==M.CMCDObjectType.MUXED)&&(P.br=S.bitrate/1e3,P.tb=u.getTopBandwidth(L),P.bl=u.getBufferLength(L)),u.apply(D,P)}catch(_){W.logger.warn("Could not generate segment CMCD data.",_)}},this.hls=t;var a=this.config=t.config,i=a.cmcd;i!=null&&(a.pLoader=this.createPlaylistLoader(),a.fLoader=this.createFragmentLoader(),this.sid=i.sessionId||o.uuid(),this.cid=i.contentId,this.useHeaders=i.useHeaders===!0,this.registerListeners())}var s=o.prototype;return s.registerListeners=function(){var u=this.hls;u.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(G.Events.MEDIA_DETACHED,this.onMediaDetached,this),u.on(G.Events.BUFFER_CREATED,this.onBufferCreated,this)},s.unregisterListeners=function(){var u=this.hls;u.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(G.Events.MEDIA_DETACHED,this.onMediaDetached,this),u.off(G.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(u,a){this.media=a.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(u,a){var i,D;this.audioBuffer=(i=a.tracks.audio)===null||i===void 0?void 0:i.buffer,this.videoBuffer=(D=a.tracks.video)===null||D===void 0?void 0:D.buffer},s.createData=function(){var u;return{v:M.CMCDVersion,sf:M.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(u=this.media)===null||u===void 0?void 0:u.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},s.apply=function(u,a){a===void 0&&(a={}),p(a,this.createData());var i=a.ot===M.CMCDObjectType.INIT||a.ot===M.CMCDObjectType.VIDEO||a.ot===M.CMCDObjectType.MUXED;if(this.starved&&i&&(a.bs=!0,a.su=!0,this.starved=!1),a.su==null&&(a.su=this.buffering),this.useHeaders){var D=o.toHeaders(a);if(!Object.keys(D).length)return;u.headers||(u.headers={}),p(u.headers,D)}else{var w=o.toQuery(a);if(!w)return;u.url=o.appendQueryToUri(u.url,w)}},s.getObjectType=function(u){var a=u.type;return a==="subtitle"?M.CMCDObjectType.TIMED_TEXT:u.sn==="initSegment"?M.CMCDObjectType.INIT:a==="audio"?M.CMCDObjectType.AUDIO:a==="main"?this.hls.audioTracks.length?M.CMCDObjectType.VIDEO:M.CMCDObjectType.MUXED:void 0},s.getTopBandwidth=function(u){for(var a=0,i=u===M.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,D=A(i),w;!(w=D()).done;){var S=w.value;S.bitrate>a&&(a=S.bitrate)}return a>0?a:NaN},s.getBufferLength=function(u){var a=this.hls.media,i=u===M.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!i||!a)return NaN;var D=I.BufferHelper.bufferInfo(i,a.currentTime,this.config.maxBufferHole);return D.len*1e3},s.createPlaylistLoader=function(){var u=this.config.pLoader,a=this.applyPlaylistData,i=u||this.config.loader;return function(){function D(S){this.loader=void 0,this.loader=new i(S)}var w=D.prototype;return w.destroy=function(){this.loader.destroy()},w.abort=function(){this.loader.abort()},w.load=function(L,P,_){a(L),this.loader.load(L,P,_)},r(D,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),D}()},s.createFragmentLoader=function(){var u=this.config.fLoader,a=this.applyFragmentData,i=u||this.config.loader;return function(){function D(S){this.loader=void 0,this.loader=new i(S)}var w=D.prototype;return w.destroy=function(){this.loader.destroy()},w.abort=function(){this.loader.abort()},w.load=function(L,P,_){a(L),this.loader.load(L,P,_)},r(D,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),D}()},o.uuid=function(){var u=URL.createObjectURL(new Blob),a=u.toString();return URL.revokeObjectURL(u),a.substr(a.lastIndexOf("/")+1)},o.serialize=function(u){for(var a=[],i=function(F){return!Number.isNaN(F)&&F!=null&&F!==""&&F!==!1},D=function(F){return Math.round(F)},w=function(F){return D(F/100)*100},S=function(F){return encodeURIComponent(F)},L={br:D,d:D,bl:w,dl:w,mtp:w,nor:S,rtp:w,tb:D},P=Object.keys(u||{}).sort(),_=A(P),b;!(b=_()).done;){var g=b.value,m=u[g];if(!i(m))continue;if(g==="v"&&m===1)continue;if(g=="pr"&&m===1)continue;var y=L[g];y&&(m=y(m));var x=typeof m,O=void 0;g==="ot"||g==="sf"||g==="st"?O=g+"="+m:x==="boolean"?O=g:x==="number"?O=g+"="+m:O=g+"="+JSON.stringify(m),a.push(O)}return a.join(",")},o.toHeaders=function(u){for(var a=Object.keys(u),i={},D=["Object","Request","Session","Status"],w=[{},{},{},{}],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},L=0,P=a;L<P.length;L++){var _=P[L],b=S[_]!=null?S[_]:1;w[b][_]=u[_]}for(var g=0;g<w.length;g++){var m=o.serialize(w[g]);m&&(i["CMCD-"+D[g]]=m)}return i},o.toQuery=function(u){return"CMCD="+encodeURIComponent(o.serialize(u))},o.appendQueryToUri=function(u,a){if(!a)return u;var i=u.includes("?")?"&":"?";return""+u+i+a},o}()},"./src/controller/eme-controller.ts":function(Z,V,j){"use strict";j.r(V);var G=j("./src/events.ts"),M=j("./src/errors.ts"),I=j("./src/utils/logger.ts"),W=j("./src/utils/mediakeys-helper.ts");function C(l,o){for(var s=0;s<o.length;s++){var t=o[s];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(l,t.key,t)}}function r(l,o,s){return o&&C(l.prototype,o),s&&C(l,s),l}var A=3,v=function(o,s,t){var u={audioCapabilities:[],videoCapabilities:[]};return o.forEach(function(a){u.audioCapabilities.push({contentType:'audio/mp4; codecs="'+a+'"',robustness:t.audioRobustness||""})}),s.forEach(function(a){u.videoCapabilities.push({contentType:'video/mp4; codecs="'+a+'"',robustness:t.videoRobustness||""})}),[u]},f=function(o,s,t,u){switch(o){case W.KeySystems.WIDEVINE:return v(s,t,u);default:throw new Error("Unknown key-system: "+o)}},p=function(){function l(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 o=l.prototype;return o.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},o._registerListeners=function(){this.hls.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(G.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this)},o._unregisterListeners=function(){this.hls.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(G.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this)},o.getLicenseServerUrl=function(t){switch(t){case W.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+t+'"')},o._attemptKeySystemAccess=function(t,u,a){var i=this,D=f(t,u,a,this._drmSystemOptions);I.logger.log("Requesting encrypted media key-system access");var w=this.requestMediaKeySystemAccess(t,D);this.mediaKeysPromise=w.then(function(S){return i._onMediaKeySystemAccessObtained(t,S)}),w.catch(function(S){I.logger.error('Failed to obtain key-system "'+t+'" access:',S)})},o._onMediaKeySystemAccessObtained=function(t,u){var a=this;I.logger.log('Access for key-system "'+t+'" obtained');var i={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:u,mediaKeySystemDomain:t};this._mediaKeysList.push(i);var D=Promise.resolve().then(function(){return u.createMediaKeys()}).then(function(w){return i.mediaKeys=w,I.logger.log('Media-keys created for key-system "'+t+'"'),a._onMediaKeysCreated(),w});return D.catch(function(w){I.logger.error("Failed to create media-keys:",w)}),D},o._onMediaKeysCreated=function(){var t=this;this._mediaKeysList.forEach(function(u){u.mediaKeysSession||(u.mediaKeysSession=u.mediaKeys.createSession(),t._onNewMediaKeySession(u.mediaKeysSession))})},o._onNewMediaKeySession=function(t){var u=this;I.logger.log("New key-system session "+t.sessionId),t.addEventListener("message",function(a){u._onKeySessionMessage(t,a.message)},!1)},o._onKeySessionMessage=function(t,u){I.logger.log("Got EME message event, creating license request"),this._requestLicense(u,function(a){I.logger.log("Received license data (length: "+(a&&a.byteLength)+"), updating key-session"),t.update(a)})},o.onMediaEncrypted=function(t){var u=this;if(I.logger.log('Media is encrypted using "'+t.initDataType+'" init data type'),!this.mediaKeysPromise){I.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(G.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var a=function(D){if(!u._media)return;u._attemptSetMediaKeys(D),u._generateRequestWithPreferredKeySession(t.initDataType,t.initData)};this.mediaKeysPromise.then(a).catch(a)},o._attemptSetMediaKeys=function(t){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var u=this._mediaKeysList[0];if(!u||!u.mediaKeys){I.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(G.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}I.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(u.mediaKeys),this._hasSetMediaKeys=!0}},o._generateRequestWithPreferredKeySession=function(t,u){var a=this,i=this._mediaKeysList[0];if(!i){I.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(G.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(i.mediaKeysSessionInitialized){I.logger.warn("Key-Session already initialized but requested again");return}var D=i.mediaKeysSession;if(!D){I.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(G.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!u){I.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(G.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}I.logger.log('Generating key-session request for "'+t+'" init data type'),i.mediaKeysSessionInitialized=!0,D.generateRequest(t,u).then(function(){I.logger.debug("Key-session generation succeeded")}).catch(function(w){I.logger.error("Error generating key-session request:",w),a.hls.trigger(G.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},o._createLicenseXhr=function(t,u,a){var i=new XMLHttpRequest;i.responseType="arraybuffer",i.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,i,t,u,a);var D=this._licenseXhrSetup;if(D)try{D.call(this.hls,i,t),D=void 0}catch(w){I.logger.error(w)}try{i.readyState||i.open("POST",t,!0),D&&D.call(this.hls,i,t)}catch(w){throw new Error("issue setting up KeySystem license XHR "+w)}return i},o._onLicenseRequestReadyStageChange=function(t,u,a,i){switch(t.readyState){case 4:if(t.status===200){this._requestLicenseFailureCount=0,I.logger.log("License request succeeded");var D=t.response,w=this._licenseResponseCallback;if(w)try{D=w.call(this.hls,t,u)}catch(L){I.logger.error(L)}i(D)}else{if(I.logger.error("License Request XHR failed ("+u+"). Status: "+t.status+" ("+t.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>A){this.hls.trigger(G.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var S=A-this._requestLicenseFailureCount+1;I.logger.warn("Retrying license request, "+S+" attempts left"),this._requestLicense(a,i)}break}},o._generateLicenseRequestChallenge=function(t,u){switch(t.mediaKeySystemDomain){case W.KeySystems.WIDEVINE:return u}throw new Error("unsupported key-system: "+t.mediaKeySystemDomain)},o._requestLicense=function(t,u){I.logger.log("Requesting content license for key-system");var a=this._mediaKeysList[0];if(!a){I.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(G.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var i=this.getLicenseServerUrl(a.mediaKeySystemDomain),D=this._createLicenseXhr(i,t,u);I.logger.log("Sending license request to URL: "+i);var w=this._generateLicenseRequestChallenge(a,t);D.send(w)}catch(S){I.logger.error("Failure requesting DRM license: "+S),this.hls.trigger(G.Events.ERROR,{type:M.ErrorTypes.KEY_SYSTEM_ERROR,details:M.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},o.onMediaAttached=function(t,u){if(!this._emeEnabled)return;var a=u.media;this._media=a,a.addEventListener("encrypted",this._onMediaEncrypted)},o.onMediaDetached=function(){var t=this._media,u=this._mediaKeysList;if(!t)return;t.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(u.map(function(a){if(a.mediaKeysSession)return a.mediaKeysSession.close().catch(function(){})})).then(function(){return t.setMediaKeys(null)}).catch(function(){})},o.onManifestParsed=function(t,u){if(!this._emeEnabled)return;var a=u.levels.map(function(D){return D.audioCodec}).filter(function(D){return!!D}),i=u.levels.map(function(D){return D.videoCodec}).filter(function(D){return!!D});this._attemptKeySystemAccess(W.KeySystems.WIDEVINE,a,i)},r(l,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),l}();V.default=p},"./src/controller/fps-controller.ts":function(Z,V,j){"use strict";j.r(V);var G=j("./src/events.ts"),M=j("./src/utils/logger.ts"),I=function(){function W(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 C=W.prototype;return C.setStreamController=function(A){this.streamController=A},C.registerListeners=function(){this.hls.on(G.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},C.unregisterListeners=function(){this.hls.off(G.Events.MEDIA_ATTACHING,this.onMediaAttaching)},C.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},C.onMediaAttaching=function(A,v){var f=this.hls.config;if(f.capLevelOnFPSDrop){var p=v.media instanceof self.HTMLVideoElement?v.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)}},C.checkFPS=function(A,v,f){var p=performance.now();if(v){if(this.lastTime){var l=p-this.lastTime,o=f-this.lastDroppedFrames,s=v-this.lastDecodedFrames,t=1e3*o/l,u=this.hls;if(u.trigger(G.Events.FPS_DROP,{currentDropped:o,currentDecoded:s,totalDroppedFrames:f}),t>0&&o>u.config.fpsDroppedMonitoringThreshold*s){var a=u.currentLevel;M.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+a),a>0&&(u.autoLevelCapping===-1||u.autoLevelCapping>=a)&&(a=a-1,u.trigger(G.Events.FPS_DROP_LEVEL_CAPPING,{level:a,droppedLevel:u.currentLevel}),u.autoLevelCapping=a,this.streamController.nextLevelSwitch())}}this.lastTime=p,this.lastDroppedFrames=f,this.lastDecodedFrames=v}},C.checkFPSInterval=function(){var A=this.media;if(A)if(this.isVideoPlaybackQualityAvailable){var v=A.getVideoPlaybackQuality();this.checkFPS(A,v.totalVideoFrames,v.droppedVideoFrames)}else this.checkFPS(A,A.webkitDecodedFrameCount,A.webkitDroppedFrameCount)},W}();V.default=I},"./src/controller/fragment-finders.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"findFragmentByPDT",function(){return I}),j.d(V,"findFragmentByPTS",function(){return W}),j.d(V,"fragmentWithinToleranceTest",function(){return C}),j.d(V,"pdtWithinToleranceTest",function(){return r}),j.d(V,"findFragWithCC",function(){return A});var G=j("./src/polyfills/number.ts"),M=j("./src/utils/binary-search.ts");function I(v,f,p){if(f===null||!Array.isArray(v)||!v.length||!Object(G.isFiniteNumber)(f))return null;var l=v[0].programDateTime;if(f<(l||0))return null;var o=v[v.length-1].endProgramDateTime;if(f>=(o||0))return null;p=p||0;for(var s=0;s<v.length;++s){var t=v[s];if(r(f,p,t))return t}return null}function W(v,f,p,l){p===void 0&&(p=0),l===void 0&&(l=0);var o=null;if(v?o=f[v.sn-f[0].sn+1]||null:p===0&&f[0].start===0&&(o=f[0]),o&&C(p,l,o)===0)return o;var s=M.default.search(f,C.bind(null,p,l));return s||o}function C(v,f,p){v===void 0&&(v=0),f===void 0&&(f=0);var l=Math.min(f,p.duration+(p.deltaPTS?p.deltaPTS:0));return p.start+p.duration-l<=v?1:p.start-l>v&&p.start?-1:0}function r(v,f,p){var l=Math.min(f,p.duration+(p.deltaPTS?p.deltaPTS:0))*1e3,o=p.endProgramDateTime||0;return o-l>v}function A(v,f){return M.default.search(v,function(p){return p.cc<f?1:p.cc>f?-1:0})}},"./src/controller/fragment-tracker.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"FragmentState",function(){return I}),j.d(V,"FragmentTracker",function(){return W});var G=j("./src/events.ts"),M=j("./src/types/loader.ts"),I;(function(A){A.NOT_LOADED="NOT_LOADED",A.BACKTRACKED="BACKTRACKED",A.APPENDING="APPENDING",A.PARTIAL="PARTIAL",A.OK="OK"})(I||(I={}));var W=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 v=A.prototype;return v._registerListeners=function(){var p=this.hls;p.on(G.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.on(G.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.on(G.Events.FRAG_LOADED,this.onFragLoaded,this)},v._unregisterListeners=function(){var p=this.hls;p.off(G.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.off(G.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.off(G.Events.FRAG_LOADED,this.onFragLoaded,this)},v.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},v.getAppendedFrag=function(p,l){if(l===M.PlaylistLevelType.MAIN){var o=this.activeFragment,s=this.activeParts;if(!o)return null;if(s)for(var t=s.length;t--;){var u=s[t],a=u?u.end:o.appendedPTS;if(u.start<=p&&a!==void 0&&p<=a)return t>9&&(this.activeParts=s.slice(t-9)),u}else if(o.start<=p&&o.appendedPTS!==void 0&&p<=o.appendedPTS)return o}return this.getBufferedFrag(p,l)},v.getBufferedFrag=function(p,l){for(var o=this.fragments,s=Object.keys(o),t=s.length;t--;){var u=o[s[t]];if((u==null?void 0:u.body.type)===l&&u.buffered){var a=u.body;if(a.start<=p&&p<=a.end)return a}}return null},v.detectEvictedFragments=function(p,l,o){var s=this;Object.keys(this.fragments).forEach(function(t){var u=s.fragments[t];if(!u)return;if(!u.buffered){u.body.type===o&&s.removeFragment(u.body);return}var a=u.range[p];if(!a)return;a.time.some(function(i){var D=!s.isTimeBuffered(i.startPTS,i.endPTS,l);return D&&s.removeFragment(u.body),D})})},v.detectPartialFragments=function(p){var l=this,o=this.timeRanges,s=p.frag,t=p.part;if(!o||s.sn==="initSegment")return;var u=r(s),a=this.fragments[u];if(!a)return;Object.keys(o).forEach(function(i){var D=s.elementaryStreams[i];if(!D)return;var w=o[i],S=t!==null||D.partial===!0;a.range[i]=l.getBufferedTimes(s,t,S,w)}),a.backtrack=a.loaded=null,Object.keys(a.range).length?a.buffered=!0:this.removeFragment(a.body)},v.fragBuffered=function(p){var l=r(p),o=this.fragments[l];o&&(o.backtrack=o.loaded=null,o.buffered=!0)},v.getBufferedTimes=function(p,l,o,s){for(var t={time:[],partial:o},u=l?l.start:p.start,a=l?l.end:p.end,i=p.minEndPTS||a,D=p.maxStartPTS||u,w=0;w<s.length;w++){var S=s.start(w)-this.bufferPadding,L=s.end(w)+this.bufferPadding;if(D>=S&&i<=L){t.time.push({startPTS:Math.max(u,s.start(w)),endPTS:Math.min(a,s.end(w))});break}else if(u<L&&a>S)t.partial=!0,t.time.push({startPTS:Math.max(u,s.start(w)),endPTS:Math.min(a,s.end(w))});else if(a<=S)break}return t},v.getPartialFragment=function(p){var l=null,o,s,t,u=0,a=this.bufferPadding,i=this.fragments;return Object.keys(i).forEach(function(D){var w=i[D];if(!w)return;C(w)&&(s=w.body.start-a,t=w.body.end+a,p>=s&&p<=t&&(o=Math.min(p-s,t-p),u<=o&&(l=w.body,u=o)))}),l},v.getState=function(p){var l=r(p),o=this.fragments[l];return o?o.buffered?C(o)?I.PARTIAL:I.OK:o.backtrack?I.BACKTRACKED:I.APPENDING:I.NOT_LOADED},v.backtrack=function(p,l){var o=r(p),s=this.fragments[o];if(!s||s.backtrack)return null;var t=s.backtrack=l||s.loaded;return s.loaded=null,t},v.getBacktrackData=function(p){var l=r(p),o=this.fragments[l];if(o){var s,t=o.backtrack;if(t!=null&&(s=t.payload)!==null&&s!==void 0&&s.byteLength)return t;this.removeFragment(p)}return null},v.isTimeBuffered=function(p,l,o){for(var s,t,u=0;u<o.length;u++){if(s=o.start(u)-this.bufferPadding,t=o.end(u)+this.bufferPadding,p>=s&&l<=t)return!0;if(l<=s)return!1}return!1},v.onFragLoaded=function(p,l){var o=l.frag,s=l.part;if(o.sn==="initSegment"||o.bitrateTest||s)return;var t=r(o);this.fragments[t]={body:o,loaded:l,backtrack:null,buffered:!1,range:Object.create(null)}},v.onBufferAppended=function(p,l){var o=this,s=l.frag,t=l.part,u=l.timeRanges;if(s.type===M.PlaylistLevelType.MAIN)if(this.activeFragment=s,t){var a=this.activeParts;a||(this.activeParts=a=[]),a.push(t)}else this.activeParts=null;this.timeRanges=u,Object.keys(u).forEach(function(i){var D=u[i];if(o.detectEvictedFragments(i,D),!t)for(var w=0;w<D.length;w++)s.appendedPTS=Math.max(D.end(w),s.appendedPTS||0)})},v.onFragBuffered=function(p,l){this.detectPartialFragments(l)},v.hasFragment=function(p){var l=r(p);return!!this.fragments[l]},v.removeFragmentsInRange=function(p,l,o){var s=this;Object.keys(this.fragments).forEach(function(t){var u=s.fragments[t];if(!u)return;if(u.buffered){var a=u.body;a.type===o&&a.start<l&&a.end>p&&s.removeFragment(a)}})},v.removeFragment=function(p){var l=r(p);p.stats.loaded=0,p.clearElementaryStreamInfo(),delete this.fragments[l]},v.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},A}();function C(A){var v,f;return A.buffered&&(((v=A.range.video)===null||v===void 0?void 0:v.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(Z,V,j){"use strict";j.r(V),j.d(V,"STALL_MINIMUM_DURATION_MS",function(){return C}),j.d(V,"MAX_START_GAP_JUMP",function(){return r}),j.d(V,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return A}),j.d(V,"SKIP_BUFFER_RANGE_START",function(){return v}),j.d(V,"default",function(){return f});var G=j("./src/utils/buffer-helper.ts"),M=j("./src/errors.ts"),I=j("./src/events.ts"),W=j("./src/utils/logger.ts"),C=250,r=2,A=.1,v=.05,f=function(){function p(o,s,t,u){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=o,this.media=s,this.fragmentTracker=t,this.hls=u}var l=p.prototype;return l.destroy=function(){this.hls=this.fragmentTracker=this.media=null},l.poll=function(s){var t=this.config,u=this.media,a=this.stalled,i=u.currentTime,D=u.seeking,w=this.seeking&&!D,S=!this.seeking&&D;if(this.seeking=D,i!==s){if(this.moved=!0,a!==null){if(this.stallReported){var L=self.performance.now()-a;W.logger.warn("playback not stuck anymore @"+i+", after "+Math.round(L)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((S||w)&&(this.stalled=null),u.paused||u.ended||u.playbackRate===0||!G.BufferHelper.getBuffered(u).length)return;var P=G.BufferHelper.bufferInfo(u,i,0),_=P.len>0,b=P.nextStart||0;if(!_&&!b)return;if(D){var g=P.len>r,m=!b||b-i>r&&!this.fragmentTracker.getPartialFragment(i);if(g||m)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var y,x=Math.max(b,P.start||0)-i,O=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,H=O==null||((y=O.details)===null||y===void 0)?void 0:y.live,F=H?O.details.targetduration*2:r;if(x>0&&x<=F){this._trySkipBufferHole(null);return}}var R=self.performance.now();if(a===null){this.stalled=R;return}var U=R-a;!D&&U>=C&&this._reportStall(P.len);var k=G.BufferHelper.bufferInfo(u,i,t.maxBufferHole);this._tryFixBufferStall(k,U)},l._tryFixBufferStall=function(s,t){var u=this.config,a=this.fragmentTracker,i=this.media,D=i.currentTime,w=a.getPartialFragment(D);if(w){var S=this._trySkipBufferHole(w);if(S)return}s.len>u.maxBufferHole&&t>u.highBufferWatchdogPeriod*1e3&&(W.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},l._reportStall=function(s){var t=this.hls,u=this.media,a=this.stallReported;a||(this.stallReported=!0,W.logger.warn("Playback stalling at @"+u.currentTime+" due to low buffer (buffer="+s+")"),t.trigger(I.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:s}))},l._trySkipBufferHole=function(s){for(var t=this.config,u=this.hls,a=this.media,i=a.currentTime,D=0,w=G.BufferHelper.getBuffered(a),S=0;S<w.length;S++){var L=w.start(S);if(i+t.maxBufferHole>=D&&i<L){var P=Math.max(L+v,a.currentTime+A);return W.logger.warn("skipping hole, adjusting currentTime from "+i+" to "+P),this.moved=!0,this.stalled=null,a.currentTime=P,s&&u.trigger(I.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+i+" to "+P,frag:s}),P}D=w.end(S)}return 0},l._tryNudgeBuffer=function(){var s=this.config,t=this.hls,u=this.media,a=u.currentTime,i=(this.nudgeRetry||0)+1;if(this.nudgeRetry=i,i<s.nudgeMaxRetry){var D=a+i*s.nudgeOffset;W.logger.warn("Nudging 'currentTime' from "+a+" to "+D),u.currentTime=D,t.trigger(I.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else W.logger.error("Playhead still not moving while enough data buffered @"+a+" after "+s.nudgeMaxRetry+" nudges"),t.trigger(I.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},p}()},"./src/controller/id3-track-controller.ts":function(Z,V,j){"use strict";j.r(V);var G=j("./src/events.ts"),M=j("./src/utils/texttrack-utils.ts"),I=j("./src/demux/id3.ts"),W=.25,C=function(){function r(v){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=v,this._registerListeners()}var A=r.prototype;return A.destroy=function(){this._unregisterListeners()},A._registerListeners=function(){var f=this.hls;f.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.on(G.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),f.on(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},A._unregisterListeners=function(){var f=this.hls;f.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(G.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),f.off(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},A.onMediaAttached=function(f,p){this.media=p.media},A.onMediaDetaching=function(){if(!this.id3Track)return;Object(M.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 l=f[p];if(l.kind==="metadata"&&l.label==="id3")return Object(M.sendAddTrackEvent)(l,this.media),l}return this.media.addTextTrack("metadata","id3")},A.onFragParsingMetadata=function(f,p){if(!this.media)return;var l=p.frag,o=p.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var s=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,t=0;t<o.length;t++){var u=I.getID3Frames(o[t].data);if(u){var a=o[t].pts,i=t<o.length-1?o[t+1].pts:l.end,D=i-a;D<=0&&(i=a+W);for(var w=0;w<u.length;w++){var S=u[w];if(!I.isTimeStampFrame(S)){var L=new s(a,i,"");L.value=S,this.id3Track.addCue(L)}}}}},A.onBufferFlushing=function(f,p){var l=p.startOffset,o=p.endOffset,s=p.type;if(!s||s==="audio"){var t=this.id3Track;t&&Object(M.removeCuesInRange)(t,l,o)}},r}();V.default=C},"./src/controller/latency-controller.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"default",function(){return r});var G=j("./src/errors.ts"),M=j("./src/events.ts"),I=j("./src/utils/logger.ts");function W(A,v){for(var f=0;f<v.length;f++){var p=v[f];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(A,p.key,p)}}function C(A,v,f){return v&&W(A.prototype,v),f&&W(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 v=A.prototype;return v.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},v.registerListeners=function(){this.hls.on(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(M.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(M.Events.ERROR,this.onError,this)},v.unregisterListeners=function(){this.hls.off(M.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(M.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(M.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(M.Events.ERROR,this.onError)},v.onMediaAttached=function(p,l){this.media=l.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},v.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},v.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},v.onLevelUpdated=function(p,l){var o=l.details;this.levelDetails=o,o.advanced&&this.timeupdate(),!o.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},v.onError=function(p,l){if(l.details!==G.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,I.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},v.timeupdate=function(){var p=this.media,l=this.levelDetails;if(!p||!l)return;this.currentTime=p.currentTime;var o=this.computeLatency();if(o===null)return;this._latency=o;var s=this.config,t=s.lowLatencyMode,u=s.maxLiveSyncPlaybackRate;if(!t||u===1)return;var a=this.targetLatency;if(a===null)return;var i=o-a,D=Math.min(this.maxLatency,a+l.targetduration),w=i<D;if(l.live&&w&&i>.05&&this.forwardBufferLength>1){var S=Math.min(2,Math.max(1,u)),L=Math.round(2/(1+Math.exp(-.75*i-this.edgeStalled))*20)/20;p.playbackRate=Math.min(S,Math.max(1,L))}else p.playbackRate!==1&&p.playbackRate!==0&&(p.playbackRate=1)},v.estimateLiveEdge=function(){var p=this.levelDetails;return p===null?null:p.edge+p.age},v.computeLatency=function(){var p=this.estimateLiveEdge();return p===null?null:p-this.currentTime},C(A,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var p=this.config,l=this.levelDetails;return p.liveMaxLatencyDuration!==void 0?p.liveMaxLatencyDuration:l?p.liveMaxLatencyDurationCount*l.targetduration:0}},{key:"targetLatency",get:function(){var p=this.levelDetails;if(p===null)return null;var l=p.holdBack,o=p.partHoldBack,s=p.targetduration,t=this.config,u=t.liveSyncDuration,a=t.liveSyncDurationCount,i=t.lowLatencyMode,D=this.hls.userConfig,w=i&&o||l;(D.liveSyncDuration||D.liveSyncDurationCount||w===0)&&(w=u!==void 0?u:a*s);var S=s,L=1;return w+Math.min(this.stallCount*L,S)}},{key:"liveSyncPosition",get:function(){var p=this.estimateLiveEdge(),l=this.targetLatency,o=this.levelDetails;if(p===null||l===null||o===null)return null;var s=o.edge,t=p-l-this.edgeStalled,u=s-o.totalduration,a=s-(this.config.lowLatencyMode&&o.partTarget||o.targetduration);return Math.min(Math.max(u,t),a)}},{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 l=(this.config.lowLatencyMode&&p.partTarget||p.targetduration)*3;return Math.max(p.age-l,0)}},{key:"forwardBufferLength",get:function(){var p=this.media,l=this.levelDetails;if(!p||!l)return 0;var o=p.buffered.length;return o?p.buffered.end(o-1):l.edge-this.currentTime}}]),A}()},"./src/controller/level-controller.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"default",function(){return t});var G=j("./src/types/level.ts"),M=j("./src/events.ts"),I=j("./src/errors.ts"),W=j("./src/utils/codecs.ts"),C=j("./src/controller/level-helper.ts"),r=j("./src/controller/base-playlist-controller.ts"),A=j("./src/types/loader.ts");function v(){return v=Object.assign||function(u){for(var a=1;a<arguments.length;a++){var i=arguments[a];for(var D in i)Object.prototype.hasOwnProperty.call(i,D)&&(u[D]=i[D])}return u},v.apply(this,arguments)}function f(u,a){for(var i=0;i<a.length;i++){var D=a[i];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(u,D.key,D)}}function p(u,a,i){return a&&f(u.prototype,a),i&&f(u,i),u}function l(u,a){u.prototype=Object.create(a.prototype),u.prototype.constructor=u,o(u,a)}function o(u,a){return o=Object.setPrototypeOf||function(D,w){return D.__proto__=w,D},o(u,a)}var s=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),t=function(u){l(a,u);function a(D){var w;return w=u.call(this,D,"[level-controller]")||this,w._levels=[],w._firstLevel=-1,w._startLevel=void 0,w.currentLevelIndex=-1,w.manualLevelIndex=-1,w.onParsedComplete=void 0,w._registerListeners(),w}var i=a.prototype;return i._registerListeners=function(){var w=this.hls;w.on(M.Events.MANIFEST_LOADED,this.onManifestLoaded,this),w.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.on(M.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),w.on(M.Events.FRAG_LOADED,this.onFragLoaded,this),w.on(M.Events.ERROR,this.onError,this)},i._unregisterListeners=function(){var w=this.hls;w.off(M.Events.MANIFEST_LOADED,this.onManifestLoaded,this),w.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.off(M.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),w.off(M.Events.FRAG_LOADED,this.onFragLoaded,this),w.off(M.Events.ERROR,this.onError,this)},i.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,u.prototype.destroy.call(this)},i.startLoad=function(){var w=this._levels;w.forEach(function(S){S.loadError=0}),u.prototype.startLoad.call(this)},i.onManifestLoaded=function(w,S){var L=[],P=[],_=[],b,g={},m,y=!1,x=!1,O=!1;if(S.levels.forEach(function(U){var k=U.attrs;y=y||!!(U.width&&U.height),x=x||!!U.videoCodec,O=O||!!U.audioCodec,s&&U.audioCodec&&U.audioCodec.indexOf("mp4a.40.34")!==-1&&(U.audioCodec=void 0);var d=U.bitrate+"-"+U.attrs.RESOLUTION+"-"+U.attrs.CODECS;m=g[d],m?m.url.push(U.url):(m=new G.Level(U),g[d]=m,L.push(m)),k&&(k.AUDIO&&Object(C.addGroupId)(m,"audio",k.AUDIO),k.SUBTITLES&&Object(C.addGroupId)(m,"text",k.SUBTITLES))}),(y||x)&&O&&(L=L.filter(function(U){var k=U.videoCodec,d=U.width,z=U.height;return!!k||!!(d&&z)})),L=L.filter(function(U){var k=U.audioCodec,d=U.videoCodec;return(!k||Object(W.isCodecSupportedInMp4)(k,"audio"))&&(!d||Object(W.isCodecSupportedInMp4)(d,"video"))}),S.audioTracks&&(P=S.audioTracks.filter(function(U){return!U.audioCodec||Object(W.isCodecSupportedInMp4)(U.audioCodec,"audio")}),Object(C.assignTrackIdsByGroup)(P)),S.subtitles&&(_=S.subtitles,Object(C.assignTrackIdsByGroup)(_)),L.length>0){b=L[0].bitrate,L.sort(function(U,k){return U.bitrate-k.bitrate}),this._levels=L;for(var H=0;H<L.length;H++)if(L[H].bitrate===b){this._firstLevel=H,this.log("manifest loaded, "+L.length+" level(s) found, first bitrate: "+b);break}var F=O&&!x,R={levels:L,audioTracks:P,subtitleTracks:_,firstLevel:this._firstLevel,stats:S.stats,audio:O,video:x,altAudio:!F&&P.some(function(U){return!!U.url})};this.hls.trigger(M.Events.MANIFEST_PARSED,R),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(M.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:S.url,reason:"no level with compatible codecs found in manifest"})},i.onError=function(w,S){if(u.prototype.onError.call(this,w,S),S.fatal)return;var L=S.context,P=this._levels[this.currentLevelIndex];if(L&&(L.type===A.PlaylistContextType.AUDIO_TRACK&&P.audioGroupIds&&L.groupId===P.audioGroupIds[P.urlId]||L.type===A.PlaylistContextType.SUBTITLE_TRACK&&P.textGroupIds&&L.groupId===P.textGroupIds[P.urlId])){this.redundantFailover(this.currentLevelIndex);return}var _=!1,b=!0,g;switch(S.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:if(S.frag){var m=this._levels[S.frag.level];m?(m.fragmentError++,m.fragmentError>this.hls.config.fragLoadingMaxRetry&&(g=S.frag.level)):g=S.frag.level}break;case I.ErrorDetails.LEVEL_LOAD_ERROR:case I.ErrorDetails.LEVEL_LOAD_TIMEOUT:L&&(L.deliveryDirectives&&(b=!1),g=L.level),_=!0;break;case I.ErrorDetails.REMUX_ALLOC_ERROR:g=S.level,_=!0;break}g!==void 0&&this.recoverLevel(S,g,_,b)},i.recoverLevel=function(w,S,L,P){var _=w.details,b=this._levels[S];if(b.loadError++,L){var g=this.retryLoadingOrFail(w);if(g)w.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(P){var m=b.url.length;if(m>1&&b.loadError<m)w.levelRetry=!0,this.redundantFailover(S);else if(this.manualLevelIndex===-1){var y=S===0?this._levels.length-1:S-1;this.currentLevelIndex!==y&&this._levels[y].loadError===0&&(this.warn(_+": switch to "+y),w.levelRetry=!0,this.hls.nextAutoLevel=y)}}},i.redundantFailover=function(w){var S=this._levels[w],L=S.url.length;if(L>1){var P=(S.urlId+1)%L;this.warn("Switching to redundant URL-id "+P),this._levels.forEach(function(_){_.urlId=P}),this.level=w}},i.onFragLoaded=function(w,S){var L=S.frag;if(L!==void 0&&L.type===A.PlaylistLevelType.MAIN){var P=this._levels[L.level];P!==void 0&&(P.fragmentError=0,P.loadError=0)}},i.onLevelLoaded=function(w,S){var L,P=S.level,_=S.details,b=this._levels[P];if(!b){var g;this.warn("Invalid level index "+P),(g=S.deliveryDirectives)!==null&&g!==void 0&&g.skip&&(_.deltaUpdateFailed=!0);return}P===this.currentLevelIndex?(b.fragmentError===0&&(b.loadError=0,this.retryCount=0),this.playlistLoaded(P,S,b.details)):(L=S.deliveryDirectives)!==null&&L!==void 0&&L.skip&&(_.deltaUpdateFailed=!0)},i.onAudioTrackSwitched=function(w,S){var L=this.hls.levels[this.currentLevelIndex];if(!L)return;if(L.audioGroupIds){for(var P=-1,_=this.hls.audioTracks[S.id].groupId,b=0;b<L.audioGroupIds.length;b++)if(L.audioGroupIds[b]===_){P=b;break}P!==L.urlId&&(L.urlId=P,this.startLoad())}},i.loadPlaylist=function(w){var S=this.currentLevelIndex,L=this._levels[S];if(this.canLoad&&L&&L.url.length>0){var P=L.urlId,_=L.url[P];if(w)try{_=w.addDirectives(_)}catch(b){this.warn("Could not construct new URL with HLS Delivery Directives: "+b)}this.log("Attempt loading level index "+S+(w?" at sn "+w.msn+" part "+w.part:"")+" with URL-id "+P+" "+_),this.clearTimer(),this.hls.trigger(M.Events.LEVEL_LOADING,{url:_,level:S,id:P,deliveryDirectives:w||null})}},i.removeLevel=function(w,S){var L=function(b,g){return g!==S},P=this._levels.filter(function(_,b){return b!==w?!0:_.url.length>1&&S!==void 0?(_.url=_.url.filter(L),_.audioGroupIds&&(_.audioGroupIds=_.audioGroupIds.filter(L)),_.textGroupIds&&(_.textGroupIds=_.textGroupIds.filter(L)),_.urlId=0,!0):!1}).map(function(_,b){var g=_.details;return g!=null&&g.fragments&&g.fragments.forEach(function(m){m.level=b}),_});this._levels=P,this.hls.trigger(M.Events.LEVELS_UPDATED,{levels:P})},p(a,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(w){var S,L=this._levels;if(L.length===0)return;if(this.currentLevelIndex===w&&(S=L[w])!==null&&S!==void 0&&S.details)return;if(w<0||w>=L.length){var P=w<0;if(this.hls.trigger(M.Events.ERROR,{type:I.ErrorTypes.OTHER_ERROR,details:I.ErrorDetails.LEVEL_SWITCH_ERROR,level:w,fatal:P,reason:"invalid level idx"}),P)return;w=Math.min(w,L.length-1)}this.clearTimer();var _=this.currentLevelIndex,b=L[_],g=L[w];this.log("switching to level "+w+" from "+_),this.currentLevelIndex=w;var m=v({},g,{level:w,maxBitrate:g.maxBitrate,uri:g.uri,urlId:g.urlId});delete m._urlId,this.hls.trigger(M.Events.LEVEL_SWITCHING,m);var y=g.details;if(!y||y.live){var x=this.switchParams(g.uri,b==null?void 0:b.details);this.loadPlaylist(x)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(w){this.manualLevelIndex=w,this._startLevel===void 0&&(this._startLevel=w),w!==-1&&(this.level=w)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(w){this._firstLevel=w}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var w=this.hls.config.startLevel;return w!==void 0?w:this._firstLevel}else return this._startLevel},set:function(w){this._startLevel=w}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(w){this.level=w,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=w)}}]),a}(r.default)},"./src/controller/level-helper.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"addGroupId",function(){return I}),j.d(V,"assignTrackIdsByGroup",function(){return W}),j.d(V,"updatePTS",function(){return C}),j.d(V,"updateFragPTSDTS",function(){return A}),j.d(V,"mergeDetails",function(){return v}),j.d(V,"mapPartIntersection",function(){return f}),j.d(V,"mapFragmentIntersection",function(){return p}),j.d(V,"adjustSliding",function(){return l}),j.d(V,"addSliding",function(){return o}),j.d(V,"computeReloadInterval",function(){return s}),j.d(V,"getFragmentWithSN",function(){return t}),j.d(V,"getPartWith",function(){return u});var G=j("./src/polyfills/number.ts"),M=j("./src/utils/logger.ts");function I(a,i,D){switch(i){case"audio":a.audioGroupIds||(a.audioGroupIds=[]),a.audioGroupIds.push(D);break;case"text":a.textGroupIds||(a.textGroupIds=[]),a.textGroupIds.push(D);break}}function W(a){var i={};a.forEach(function(D){var w=D.groupId||"";D.id=i[w]=i[w]||0,i[w]++})}function C(a,i,D){var w=a[i],S=a[D];r(w,S)}function r(a,i){var D=i.startPTS;if(Object(G.isFiniteNumber)(D)){var w=0,S;i.sn>a.sn?(w=D-a.start,S=a):(w=a.start-D,S=i),S.duration!==w&&(S.duration=w)}else if(i.sn>a.sn){var L=a.cc===i.cc;L&&a.minEndPTS?i.start=a.start+(a.minEndPTS-a.start):i.start=a.start+a.duration}else i.start=Math.max(a.start-i.duration,0)}function A(a,i,D,w,S,L){var P=w-D;P<=0&&(M.logger.warn("Fragment should have a positive duration",i),w=D+i.duration,L=S+i.duration);var _=D,b=w,g=i.startPTS,m=i.endPTS;if(Object(G.isFiniteNumber)(g)){var y=Math.abs(g-D);Object(G.isFiniteNumber)(i.deltaPTS)?i.deltaPTS=Math.max(y,i.deltaPTS):i.deltaPTS=y,_=Math.max(D,g),D=Math.min(D,g),S=Math.min(S,i.startDTS),b=Math.min(w,m),w=Math.max(w,m),L=Math.max(L,i.endDTS)}i.duration=w-D;var x=D-i.start;i.appendedPTS=w,i.start=i.startPTS=D,i.maxStartPTS=_,i.startDTS=S,i.endPTS=w,i.minEndPTS=b,i.endDTS=L;var O=i.sn;if(!a||O<a.startSN||O>a.endSN)return 0;var H,F=O-a.startSN,R=a.fragments;for(R[F]=i,H=F;H>0;H--)r(R[H],R[H-1]);for(H=F;H<R.length-1;H++)r(R[H],R[H+1]);return a.fragmentHint&&r(R[R.length-1],a.fragmentHint),a.PTSKnown=a.alignedSliding=!0,x}function v(a,i){for(var D=null,w=a.fragments,S=w.length-1;S>=0;S--){var L=w[S].initSegment;if(L){D=L;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;var P=0,_;if(p(a,i,function(H,F){H.relurl&&(P=H.cc-F.cc),Object(G.isFiniteNumber)(H.startPTS)&&Object(G.isFiniteNumber)(H.endPTS)&&(F.start=F.startPTS=H.startPTS,F.startDTS=H.startDTS,F.appendedPTS=H.appendedPTS,F.maxStartPTS=H.maxStartPTS,F.endPTS=H.endPTS,F.endDTS=H.endDTS,F.minEndPTS=H.minEndPTS,F.duration=H.endPTS-H.startPTS,F.duration&&(_=F),i.PTSKnown=i.alignedSliding=!0),F.elementaryStreams=H.elementaryStreams,F.loader=H.loader,F.stats=H.stats,F.urlId=H.urlId,H.initSegment&&(F.initSegment=H.initSegment,D=H.initSegment)}),D){var b=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments;b.forEach(function(H){var F;(!H.initSegment||H.initSegment.relurl===((F=D)===null||F===void 0?void 0:F.relurl))&&(H.initSegment=D)})}if(i.skippedSegments&&(i.deltaUpdateFailed=i.fragments.some(function(H){return!H}),i.deltaUpdateFailed)){M.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var g=i.skippedSegments;g--;)i.fragments.shift();i.startSN=i.fragments[0].sn,i.startCC=i.fragments[0].cc}var m=i.fragments;if(P){M.logger.warn("discontinuity sliding from playlist, take drift into account");for(var y=0;y<m.length;y++)m[y].cc+=P}i.skippedSegments&&(i.startCC=i.fragments[0].cc),f(a.partList,i.partList,function(H,F){F.elementaryStreams=H.elementaryStreams,F.stats=H.stats}),_?A(i,_,_.startPTS,_.endPTS,_.startDTS,_.endDTS):l(a,i),m.length&&(i.totalduration=i.edge-m[0].start),i.driftStartTime=a.driftStartTime,i.driftStart=a.driftStart;var x=i.advancedDateTime;if(i.advanced&&x){var O=i.edge;i.driftStart||(i.driftStartTime=x,i.driftStart=O),i.driftEndTime=x,i.driftEnd=O}else i.driftEndTime=a.driftEndTime,i.driftEnd=a.driftEnd,i.advancedDateTime=a.advancedDateTime}function f(a,i,D){if(a&&i)for(var w=0,S=0,L=a.length;S<=L;S++){var P=a[S],_=i[S+w];P&&_&&P.index===_.index&&P.fragment.sn===_.fragment.sn?D(P,_):w--}}function p(a,i,D){for(var w=i.skippedSegments,S=Math.max(a.startSN,i.startSN)-i.startSN,L=(a.fragmentHint?1:0)+(w?i.endSN:Math.min(a.endSN,i.endSN))-i.startSN,P=i.startSN-a.startSN,_=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments,b=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments,g=S;g<=L;g++){var m=b[P+g],y=_[g];w&&!y&&g<w&&(y=i.fragments[g]=m),m&&y&&D(m,y)}}function l(a,i){var D=i.startSN+i.skippedSegments-a.startSN,w=a.fragments;if(D<0||D>=w.length)return;o(i,w[D].start)}function o(a,i){if(i){for(var D=a.fragments,w=a.skippedSegments;w<D.length;w++)D[w].start+=i;a.fragmentHint&&(a.fragmentHint.start+=i)}}function s(a,i){var D=1e3*a.levelTargetDuration,w=D/2,S=a.age,L=S>0&&S<D*3,P=i.loading.end-i.loading.start,_,b=a.availabilityDelay;if(a.updated===!1)if(L){var g=333*a.misses;_=Math.max(Math.min(w,P*2),g),a.availabilityDelay=(a.availabilityDelay||0)+_}else _=w;else L?(b=Math.min(b||D/2,S),a.availabilityDelay=b,_=b+D-S):_=D-P;return Math.round(_)}function t(a,i,D){if(!a||!a.details)return null;var w=a.details,S=w.fragments[i-w.startSN];return S||(S=w.fragmentHint,S&&S.sn===i?S:i<w.startSN&&D&&D.sn===i?D:null)}function u(a,i,D){if(!a||!a.details)return null;var w=a.details.partList;if(w)for(var S=w.length;S--;){var L=w[S];if(L.index===D&&L.fragment.sn===i)return L}return null}},"./src/controller/stream-controller.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"default",function(){return w});var G=j("./src/polyfills/number.ts"),M=j("./src/controller/base-stream-controller.ts"),I=j("./src/is-supported.ts"),W=j("./src/events.ts"),C=j("./src/utils/buffer-helper.ts"),r=j("./src/controller/fragment-tracker.ts"),A=j("./src/types/loader.ts"),v=j("./src/loader/fragment.ts"),f=j("./src/demux/transmuxer-interface.ts"),p=j("./src/types/transmuxer.ts"),l=j("./src/controller/gap-controller.ts"),o=j("./src/errors.ts"),s=j("./src/utils/logger.ts");function t(S,L){for(var P=0;P<L.length;P++){var _=L[P];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(S,_.key,_)}}function u(S,L,P){return L&&t(S.prototype,L),P&&t(S,P),S}function a(S,L){S.prototype=Object.create(L.prototype),S.prototype.constructor=S,i(S,L)}function i(S,L){return i=Object.setPrototypeOf||function(_,b){return _.__proto__=b,_},i(S,L)}var D=100,w=function(S){a(L,S);function L(_,b){var g;return g=S.call(this,_,b,"[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 P=L.prototype;return P._registerListeners=function(){var b=this.hls;b.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.on(W.Events.LEVEL_LOADING,this.onLevelLoading,this),b.on(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.on(W.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),b.on(W.Events.ERROR,this.onError,this),b.on(W.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.on(W.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.on(W.Events.BUFFER_CREATED,this.onBufferCreated,this),b.on(W.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.on(W.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),b.on(W.Events.FRAG_BUFFERED,this.onFragBuffered,this)},P._unregisterListeners=function(){var b=this.hls;b.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.off(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.off(W.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),b.off(W.Events.ERROR,this.onError,this),b.off(W.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.off(W.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.off(W.Events.BUFFER_CREATED,this.onBufferCreated,this),b.off(W.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.off(W.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),b.off(W.Events.FRAG_BUFFERED,this.onFragBuffered,this)},P.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},P.startLoad=function(b){if(this.levels){var g=this.lastCurrentTime,m=this.hls;if(this.stopLoad(),this.setInterval(D),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var y=m.startLevel;y===-1&&(m.config.testBandwidth?(y=0,this.bitrateTest=!0):y=m.nextAutoLevel),this.level=m.nextLoadLevel=y,this.loadedmetadata=!1}g>0&&b===-1&&(this.log("Override startPosition with lastCurrentTime @"+g.toFixed(3)),b=g),this.state=M.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=b,this.tick()}else this._forceStartLoad=!0,this.state=M.State.STOPPED},P.stopLoad=function(){this._forceStartLoad=!1,S.prototype.stopLoad.call(this)},P.doTick=function(){switch(this.state){case M.State.IDLE:this.doTickIdle();break;case M.State.WAITING_LEVEL:{var b,g=this.levels,m=this.level,y=g==null||((b=g[m])===null||b===void 0)?void 0:b.details;if(y&&(!y.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(y))break;this.state=M.State.IDLE;break}break}case M.State.FRAG_LOADING_WAITING_RETRY:{var x,O=self.performance.now(),H=this.retryDate;(!H||O>=H||(x=this.media)!==null&&x!==void 0&&x.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=M.State.IDLE)}break;default:break}this.onTickEnd()},P.onTickEnd=function(){S.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},P.doTickIdle=function(){var b,g,m=this.hls,y=this.levelLastLoaded,x=this.levels,O=this.media,H=m.config,F=m.nextLoadLevel;if(y===null||!O&&(this.startFragRequested||!H.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!x||!x[F])return;var R=x[F];this.level=m.nextLoadLevel=F;var U=R.details;if(!U||this.state===M.State.WAITING_LEVEL||U.live&&this.levelLastLoaded!==F){this.state=M.State.WAITING_LEVEL;return}var k=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:O,A.PlaylistLevelType.MAIN);if(k===null)return;var d=k.len,z=this.getMaxBufferLength(R.maxBitrate);if(d>=z)return;if(this._streamEnded(k,U)){var Y={};this.altAudio&&(Y.type="video"),this.hls.trigger(W.Events.BUFFER_EOS,Y),this.state=M.State.ENDED;return}var re=k.end,le=this.getNextFragment(re,U);if(this.couldBacktrack&&!this.fragPrevious&&le&&le.sn!=="initSegment"){var Ne=le.sn-U.startSN;Ne>1&&(le=U.fragments[Ne-1],this.fragmentTracker.removeFragment(le))}if(le&&this.fragmentTracker.getState(le)===r.FragmentState.OK&&this.nextLoadPosition>re){var Ce=this.audioOnly&&!this.altAudio?v.ElementaryStreamTypes.AUDIO:v.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(O,Ce,A.PlaylistLevelType.MAIN),le=this.getNextFragment(this.nextLoadPosition,U)}if(!le)return;le.initSegment&&!le.initSegment.data&&!this.bitrateTest&&(le=le.initSegment),((b=le.decryptdata)===null||b===void 0?void 0:b.keyFormat)==="identity"&&!((g=le.decryptdata)!==null&&g!==void 0&&g.key)?this.loadKey(le,U):this.loadFragment(le,U,re)},P.loadFragment=function(b,g,m){var y,x=this.fragmentTracker.getState(b);if(this.fragCurrent=b,x===r.FragmentState.BACKTRACKED){var O=this.fragmentTracker.getBacktrackData(b);if(O){this._handleFragmentLoadProgress(O),this._handleFragmentLoadComplete(O);return}else x=r.FragmentState.NOT_LOADED}x===r.FragmentState.NOT_LOADED||x===r.FragmentState.PARTIAL?b.sn==="initSegment"?this._loadInitSegment(b):this.bitrateTest?(b.bitrateTest=!0,this.log("Fragment "+b.sn+" of level "+b.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(b)):(this.startFragRequested=!0,S.prototype.loadFragment.call(this,b,g,m)):x===r.FragmentState.APPENDING?this.reduceMaxBufferLength(b.duration)&&this.fragmentTracker.removeFragment(b):((y=this.media)===null||y===void 0?void 0:y.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},P.getAppendedFrag=function(b){var g=this.fragmentTracker.getAppendedFrag(b,A.PlaylistLevelType.MAIN);return g&&"fragment"in g?g.fragment:g},P.getBufferedFrag=function(b){return this.fragmentTracker.getBufferedFrag(b,A.PlaylistLevelType.MAIN)},P.followingBufferedFrag=function(b){return b?this.getBufferedFrag(b.end+.5):null},P.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},P.nextLevelSwitch=function(){var b=this.levels,g=this.media;if(g!=null&&g.readyState){var m,y=this.getAppendedFrag(g.currentTime);if(y&&y.start>1&&this.flushMainBuffer(0,y.start-1),!g.paused&&b){var x=this.hls.nextLoadLevel,O=b[x],H=this.fragLastKbps;H&&this.fragCurrent?m=this.fragCurrent.duration*O.maxBitrate/(1e3*H)+1:m=0}else m=0;var F=this.getBufferedFrag(g.currentTime+m);if(F){var R=this.followingBufferedFrag(F);if(R){this.abortCurrentFrag();var U=R.maxStartPTS?R.maxStartPTS:R.start,k=R.duration,d=Math.max(F.end,U+Math.min(Math.max(k-this.config.maxFragLookUpTolerance,k*.5),k*.75));this.flushMainBuffer(d,Number.POSITIVE_INFINITY)}}}},P.abortCurrentFrag=function(){var b=this.fragCurrent;this.fragCurrent=null,b!=null&&b.loader&&b.loader.abort(),this.state===M.State.KEY_LOADING&&(this.state=M.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},P.flushMainBuffer=function(b,g){S.prototype.flushMainBuffer.call(this,b,g,this.altAudio?"video":null)},P.onMediaAttached=function(b,g){S.prototype.onMediaAttached.call(this,b,g);var m=g.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),m.addEventListener("playing",this.onvplaying),m.addEventListener("seeked",this.onvseeked),this.gapController=new l.default(this.config,m,this.fragmentTracker,this.hls)},P.onMediaDetaching=function(){var b=this.media;b&&(b.removeEventListener("playing",this.onvplaying),b.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)},P.onMediaPlaying=function(){this.tick()},P.onMediaSeeked=function(){var b=this.media,g=b?b.currentTime:null;Object(G.isFiniteNumber)(g)&&this.log("Media seeked to "+g.toFixed(3)),this.tick()},P.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(W.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},P.onManifestParsed=function(b,g){var m=!1,y=!1,x;g.levels.forEach(function(O){x=O.audioCodec,x&&(x.indexOf("mp4a.40.2")!==-1&&(m=!0),x.indexOf("mp4a.40.5")!==-1&&(y=!0))}),this.audioCodecSwitch=m&&y&&!Object(I.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},P.onLevelLoading=function(b,g){var m=this.levels;if(!m||this.state!==M.State.IDLE)return;var y=m[g.level];(!y.details||y.details.live&&this.levelLastLoaded!==g.level||this.waitForCdnTuneIn(y.details))&&(this.state=M.State.WAITING_LEVEL)},P.onLevelLoaded=function(b,g){var m,y=this.levels,x=g.level,O=g.details,H=O.totalduration;if(!y){this.warn("Levels were reset while loading level "+x);return}this.log("Level "+x+" loaded ["+O.startSN+","+O.endSN+"], cc ["+O.startCC+", "+O.endCC+"] duration:"+H);var F=this.fragCurrent;F&&(this.state===M.State.FRAG_LOADING||this.state===M.State.FRAG_LOADING_WAITING_RETRY)&&(F.level!==g.level&&F.loader&&(this.state=M.State.IDLE,F.loader.abort()));var R=y[x],U=0;if(O.live||(m=R.details)!==null&&m!==void 0&&m.live){if(O.fragments[0]||(O.deltaUpdateFailed=!0),O.deltaUpdateFailed)return;U=this.alignPlaylists(O,R.details)}if(R.details=O,this.levelLastLoaded=x,this.hls.trigger(W.Events.LEVEL_UPDATED,{details:O,level:x}),this.state===M.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(O))return;this.state=M.State.IDLE}this.startFragRequested?O.live&&this.synchronizeToLiveEdge(O):this.setStartPosition(O,U),this.tick()},P._handleFragmentLoadProgress=function(b){var g,m=b.frag,y=b.part,x=b.payload,O=this.levels;if(!O){this.warn("Levels were reset while fragment load was in progress. Fragment "+m.sn+" of level "+m.level+" will not be buffered");return}var H=O[m.level],F=H.details;if(!F){this.warn("Dropping fragment "+m.sn+" of level "+m.level+" after level details were reset");return}var R=H.videoCodec,U=F.PTSKnown||!F.live,k=(g=m.initSegment)===null||g===void 0?void 0:g.data,d=this._getAudioCodec(H),z=this.transmuxer=this.transmuxer||new f.default(this.hls,A.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),Y=y?y.index:-1,re=Y!==-1,le=new p.ChunkMetadata(m.level,m.sn,m.stats.chunkCount,x.byteLength,Y,re),Ne=this.initPTS[m.cc];z.push(x,k,d,R,m,y,F.totalduration,U,le,Ne)},P.onAudioTrackSwitching=function(b,g){var m=this.altAudio,y=!!g.url,x=g.id;if(!y){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var O=this.fragCurrent;O!=null&&O.loader&&(this.log("Switching to main audio track, cancel main fragment load"),O.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var H=this.hls;m&&H.trigger(W.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),H.trigger(W.Events.AUDIO_TRACK_SWITCHED,{id:x})}},P.onAudioTrackSwitched=function(b,g){var m=g.id,y=!!this.hls.audioTracks[m].url;if(y){var x=this.videoBuffer;x&&this.mediaBuffer!==x&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=x)}this.altAudio=y,this.tick()},P.onBufferCreated=function(b,g){var m=g.tracks,y,x,O=!1;for(var H in m){var F=m[H];if(F.id==="main"){if(x=H,y=F,H==="video"){var R=m[H];R&&(this.videoBuffer=R.buffer)}}else O=!0}O&&y?(this.log("Alternate track found, use "+x+".buffered to schedule main fragment loading"),this.mediaBuffer=y.buffer):this.mediaBuffer=this.media},P.onFragBuffered=function(b,g){var m=g.frag,y=g.part;if(m&&m.type!==A.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(m)){this.warn("Fragment "+m.sn+(y?" p: "+y.index:"")+" of level "+m.level+" finished buffering, but was aborted. state: "+this.state),this.state===M.State.PARSED&&(this.state=M.State.IDLE);return}var x=y?y.stats:m.stats;this.fragLastKbps=Math.round(8*x.total/(x.buffering.end-x.loading.first)),m.sn!=="initSegment"&&(this.fragPrevious=m),this.fragBufferedComplete(m,y)},P.onError=function(b,g){switch(g.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:case o.ErrorDetails.KEY_LOAD_ERROR:case o.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(A.PlaylistLevelType.MAIN,g);break;case o.ErrorDetails.LEVEL_LOAD_ERROR:case o.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==M.State.ERROR&&(g.fatal?(this.warn(""+g.details),this.state=M.State.ERROR):!g.levelRetry&&this.state===M.State.WAITING_LEVEL&&(this.state=M.State.IDLE));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(g.parent==="main"&&(this.state===M.State.PARSING||this.state===M.State.PARSED)){var m=!0,y=this.getFwdBufferInfo(this.media,A.PlaylistLevelType.MAIN);y&&y.len>.5&&(m=!this.reduceMaxBufferLength(y.len)),m&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},P.checkBuffer=function(){var b=this.media,g=this.gapController;if(!b||!g||!b.readyState)return;var m=C.BufferHelper.getBuffered(b);!this.loadedmetadata&&m.length?(this.loadedmetadata=!0,this.seekToStartPos()):g.poll(this.lastCurrentTime),this.lastCurrentTime=b.currentTime},P.onFragLoadEmergencyAborted=function(){this.state=M.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},P.onBufferFlushed=function(b,g){var m=g.type;if(m!==v.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var y=(m===v.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(y,m,A.PlaylistLevelType.MAIN)}},P.onLevelsUpdated=function(b,g){this.levels=g.levels},P.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},P.seekToStartPos=function(){var b=this.media,g=b.currentTime,m=this.startPosition;if(m>=0&&g<m){if(b.seeking){s.logger.log("could not seek to "+m+", already seeking at "+g);return}var y=C.BufferHelper.getBuffered(b),x=y.length?y.start(0):0,O=x-m;O>0&&(O<this.config.maxBufferHole||O<this.config.maxFragLookUpTolerance)&&(s.logger.log("adjusting start position by "+O+" to match buffer start"),m+=O,this.startPosition=m),this.log("seek to target start position "+m+" from current time "+g),b.currentTime=m}},P._getAudioCodec=function(b){var g=this.config.defaultAudioCodec||b.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},P._loadBitrateTestFrag=function(b){var g=this;this._doFragLoad(b).then(function(m){var y=g.hls;if(!m||y.nextLoadLevel||g.fragContextChanged(b))return;g.fragLoadError=0,g.state=M.State.IDLE,g.startFragRequested=!1,g.bitrateTest=!1;var x=b.stats;x.parsing.start=x.parsing.end=x.buffering.start=x.buffering.end=self.performance.now(),y.trigger(W.Events.FRAG_LOADED,m)})},P._handleTransmuxComplete=function(b){var g,m="main",y=this.hls,x=b.remuxResult,O=b.chunkMeta,H=this.getCurrentContext(O);if(!H){this.warn("The loading context changed while buffering fragment "+O.sn+" of level "+O.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(O.level);return}var F=H.frag,R=H.part,U=H.level,k=x.video,d=x.text,z=x.id3,Y=x.initSegment,re=this.altAudio?void 0:x.audio;if(this.fragContextChanged(F))return;if(this.state=M.State.PARSING,Y){Y.tracks&&(this._bufferInitSegment(U,Y.tracks,F,O),y.trigger(W.Events.FRAG_PARSING_INIT_SEGMENT,{frag:F,id:m,tracks:Y.tracks}));var le=Y.initPTS,Ne=Y.timescale;Object(G.isFiniteNumber)(le)&&(this.initPTS[F.cc]=le,y.trigger(W.Events.INIT_PTS_FOUND,{frag:F,id:m,initPTS:le,timescale:Ne}))}if(k&&x.independent!==!1){if(U.details){var Ce=k.startPTS,Te=k.endPTS,Fe=k.startDTS,Ve=k.endDTS;if(R)R.elementaryStreams[k.type]={startPTS:Ce,endPTS:Te,startDTS:Fe,endDTS:Ve};else if(k.firstKeyFrame&&k.independent&&(this.couldBacktrack=!0),k.dropped&&k.independent){var xe=this.getLoadPosition()+this.config.maxBufferHole;if(xe<Ce){this.backtrack(F);return}F.setElementaryStreamInfo(k.type,F.start,Te,F.start,Ve,!0)}F.setElementaryStreamInfo(k.type,Ce,Te,Fe,Ve),this.bufferFragmentData(k,F,R,O)}}else if(x.independent===!1){this.backtrack(F);return}if(re){var ye=re.startPTS,oe=re.endPTS,Se=re.startDTS,_e=re.endDTS;R&&(R.elementaryStreams[v.ElementaryStreamTypes.AUDIO]={startPTS:ye,endPTS:oe,startDTS:Se,endDTS:_e}),F.setElementaryStreamInfo(v.ElementaryStreamTypes.AUDIO,ye,oe,Se,_e),this.bufferFragmentData(re,F,R,O)}if(z!=null&&(g=z.samples)!==null&&g!==void 0&&g.length){var He={frag:F,id:m,samples:z.samples};y.trigger(W.Events.FRAG_PARSING_METADATA,He)}if(d){var rt={frag:F,id:m,samples:d.samples};y.trigger(W.Events.FRAG_PARSING_USERDATA,rt)}},P._bufferInitSegment=function(b,g,m,y){var x=this;if(this.state!==M.State.PARSING)return;this.audioOnly=!!g.audio&&!g.video,this.altAudio&&!this.audioOnly&&delete g.audio;var O=g.audio,H=g.video,F=g.audiovideo;if(O){var R=b.audioCodec,U=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(R&&(R.indexOf("mp4a.40.5")!==-1?R="mp4a.40.2":R="mp4a.40.5"),O.metadata.channelCount!==1&&U.indexOf("firefox")===-1&&(R="mp4a.40.5")),U.indexOf("android")!==-1&&O.container!=="audio/mpeg"&&(R="mp4a.40.2",this.log("Android: force audio codec to "+R)),b.audioCodec&&b.audioCodec!==R&&this.log('Swapping manifest audio codec "'+b.audioCodec+'" for "'+R+'"'),O.levelCodec=R,O.id="main",this.log("Init audio buffer, container:"+O.container+", codecs[selected/level/parsed]=["+(R||"")+"/"+(b.audioCodec||"")+"/"+O.codec+"]")}H&&(H.levelCodec=b.videoCodec,H.id="main",this.log("Init video buffer, container:"+H.container+", codecs[level/parsed]=["+(b.videoCodec||"")+"/"+H.codec+"]")),F&&this.log("Init audiovideo buffer, container:"+F.container+", codecs[level/parsed]=["+(b.attrs.CODECS||"")+"/"+F.codec+"]"),this.hls.trigger(W.Events.BUFFER_CODECS,g),Object.keys(g).forEach(function(k){var d=g[k],z=d.initSegment;z!=null&&z.byteLength&&x.hls.trigger(W.Events.BUFFER_APPENDING,{type:k,data:z,frag:m,part:null,chunkMeta:y,parent:m.type})}),this.tick()},P.backtrack=function(b){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(b);var g=this.fragmentTracker.backtrack(b);this.fragPrevious=null,this.nextLoadPosition=b.start,g?this.resetFragmentLoading(b):this.state=M.State.BACKTRACKING},P.checkFragmentChanged=function(){var b=this.media,g=null;if(b&&b.readyState>1&&b.seeking===!1){var m=b.currentTime;if(C.BufferHelper.isBuffered(b,m)?g=this.getAppendedFrag(m):C.BufferHelper.isBuffered(b,m+.1)&&(g=this.getAppendedFrag(m+.1)),g){var y=this.fragPlaying,x=g.level;(!y||g.sn!==y.sn||y.level!==x||g.urlId!==y.urlId)&&(this.hls.trigger(W.Events.FRAG_CHANGED,{frag:g}),(!y||y.level!==x)&&this.hls.trigger(W.Events.LEVEL_SWITCHED,{level:x}),this.fragPlaying=g)}}},u(L,[{key:"nextLevel",get:function(){var b=this.nextBufferedFrag;return b?b.level:-1}},{key:"currentLevel",get:function(){var b=this.media;if(b){var g=this.getAppendedFrag(b.currentTime);if(g)return g.level}return-1}},{key:"nextBufferedFrag",get:function(){var b=this.media;if(b){var g=this.getAppendedFrag(b.currentTime);return this.followingBufferedFrag(g)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),L}(M.default)},"./src/controller/subtitle-stream-controller.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"SubtitleStreamController",function(){return a});var G=j("./src/events.ts"),M=j("./src/utils/logger.ts"),I=j("./src/utils/buffer-helper.ts"),W=j("./src/controller/fragment-finders.ts"),C=j("./src/utils/discontinuities.ts"),r=j("./src/controller/level-helper.ts"),A=j("./src/controller/fragment-tracker.ts"),v=j("./src/controller/base-stream-controller.ts"),f=j("./src/types/loader.ts"),p=j("./src/types/level.ts");function l(i,D){for(var w=0;w<D.length;w++){var S=D[w];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(i,S.key,S)}}function o(i,D,w){return D&&l(i.prototype,D),w&&l(i,w),i}function s(i,D){i.prototype=Object.create(D.prototype),i.prototype.constructor=i,t(i,D)}function t(i,D){return t=Object.setPrototypeOf||function(S,L){return S.__proto__=L,S},t(i,D)}var u=500,a=function(i){s(D,i);function D(S,L){var P;return P=i.call(this,S,L,"[subtitle-stream-controller]")||this,P.levels=[],P.currentTrackId=-1,P.tracksBuffered=[],P.mainDetails=null,P._registerListeners(),P}var w=D.prototype;return w.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},w._registerListeners=function(){var L=this.hls;L.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),L.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),L.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),L.on(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),L.on(G.Events.ERROR,this.onError,this),L.on(G.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),L.on(G.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),L.on(G.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),L.on(G.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),L.on(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},w._unregisterListeners=function(){var L=this.hls;L.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),L.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),L.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),L.off(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),L.off(G.Events.ERROR,this.onError,this),L.off(G.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),L.off(G.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),L.off(G.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),L.off(G.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),L.off(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},w.startLoad=function(){this.stopLoad(),this.state=v.State.IDLE,this.setInterval(u),this.tick()},w.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},w.onLevelLoaded=function(L,P){this.mainDetails=P.details},w.onSubtitleFragProcessed=function(L,P){var _=P.frag,b=P.success;if(this.fragPrevious=_,this.state=v.State.IDLE,!b)return;var g=this.tracksBuffered[this.currentTrackId];if(!g)return;for(var m,y=_.start,x=0;x<g.length;x++)if(y>=g[x].start&&y<=g[x].end){m=g[x];break}var O=_.start+_.duration;m?m.end=O:(m={start:y,end:O},g.push(m)),this.fragmentTracker.fragBuffered(_)},w.onBufferFlushing=function(L,P){var _=P.startOffset,b=P.endOffset;if(_===0&&b!==Number.POSITIVE_INFINITY){var g=this.currentTrackId,m=this.levels;if(!m.length||!m[g]||!m[g].details)return;var y=m[g].details,x=y.targetduration,O=b-x;if(O<=0)return;P.endOffsetSubtitles=Math.max(0,O),this.tracksBuffered.forEach(function(H){for(var F=0;F<H.length;){if(H[F].end<=O){H.shift();continue}else if(H[F].start<O)H[F].start=O;else break;F++}}),this.fragmentTracker.removeFragmentsInRange(_,O,f.PlaylistLevelType.SUBTITLE)}},w.onError=function(L,P){var _,b=P.frag;if(!b||b.type!==f.PlaylistLevelType.SUBTITLE)return;(_=this.fragCurrent)!==null&&_!==void 0&&_.loader&&this.fragCurrent.loader.abort(),this.state=v.State.IDLE},w.onSubtitleTracksUpdated=function(L,P){var _=this,b=P.subtitleTracks;this.tracksBuffered=[],this.levels=b.map(function(g){return new p.Level(g)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(g){_.tracksBuffered[g.id]=[]}),this.mediaBuffer=null},w.onSubtitleTrackSwitch=function(L,P){if(this.currentTrackId=P.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var _=this.levels[this.currentTrackId];_!=null&&_.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,_&&this.setInterval(u)},w.onSubtitleTrackLoaded=function(L,P){var _,b=P.details,g=P.id,m=this.currentTrackId,y=this.levels;if(!y.length)return;var x=y[m];if(g>=y.length||g!==m||!x)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,b.live||(_=x.details)!==null&&_!==void 0&&_.live){var O=this.mainDetails;if(b.deltaUpdateFailed||!O)return;var H=O.fragments[0];if(!x.details)b.hasProgramDateTime&&O.hasProgramDateTime?Object(C.alignMediaPlaylistByPDT)(b,O):H&&Object(r.addSliding)(b,H.start);else{var F=this.alignPlaylists(b,x.details);F===0&&H&&Object(r.addSliding)(b,H.start)}}if(x.details=b,this.levelLastLoaded=g,this.tick(),b.live&&!this.fragCurrent&&this.media&&this.state===v.State.IDLE){var R=Object(W.findFragmentByPTS)(null,b.fragments,this.media.currentTime,0);R||(this.warn("Subtitle playlist not aligned with playback"),x.details=void 0)}},w._handleFragmentLoadComplete=function(L){var P=L.frag,_=L.payload,b=P.decryptdata,g=this.hls;if(this.fragContextChanged(P))return;if(_&&_.byteLength>0&&b&&b.key&&b.iv&&b.method==="AES-128"){var m=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(_),b.key.buffer,b.iv.buffer).then(function(y){var x=performance.now();g.trigger(G.Events.FRAG_DECRYPTED,{frag:P,payload:y,stats:{tstart:m,tdecrypt:x}})})}},w.doTick=function(){if(!this.media){this.state=v.State.IDLE;return}if(this.state===v.State.IDLE){var L,P=this.currentTrackId,_=this.levels;if(!_.length||!_[P]||!_[P].details)return;var b=_[P].details,g=b.targetduration,m=this.config,y=this.media,x=I.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,y.currentTime-g,m.maxBufferHole),O=x.end,H=x.len,F=this.getMaxBufferLength()+g;if(H>F)return;console.assert(b,"Subtitle track details are defined on idle subtitle stream controller tick");var R=b.fragments,U=R.length,k=b.edge,d,z=this.fragPrevious;if(O<k){var Y=m.maxFragLookUpTolerance;z&&b.hasProgramDateTime&&(d=Object(W.findFragmentByPDT)(R,z.endProgramDateTime,Y)),d||(d=Object(W.findFragmentByPTS)(z,R,O,Y),!d&&z&&z.start<R[0].start&&(d=R[0]))}else d=R[U-1];(L=d)!==null&&L!==void 0&&L.encrypted?(M.logger.log("Loading key for "+d.sn),this.state=v.State.KEY_LOADING,this.hls.trigger(G.Events.KEY_LOADING,{frag:d})):d&&this.fragmentTracker.getState(d)===A.FragmentState.NOT_LOADED&&this.loadFragment(d,b,O)}},w.loadFragment=function(L,P,_){this.fragCurrent=L,i.prototype.loadFragment.call(this,L,P,_)},o(D,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),D}(v.default)},"./src/controller/subtitle-track-controller.ts":function(Z,V,j){"use strict";j.r(V);var G=j("./src/events.ts"),M=j("./src/utils/texttrack-utils.ts"),I=j("./src/controller/base-playlist-controller.ts"),W=j("./src/types/loader.ts");function C(l,o){for(var s=0;s<o.length;s++){var t=o[s];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(l,t.key,t)}}function r(l,o,s){return o&&C(l.prototype,o),s&&C(l,s),l}function A(l,o){l.prototype=Object.create(o.prototype),l.prototype.constructor=l,v(l,o)}function v(l,o){return v=Object.setPrototypeOf||function(t,u){return t.__proto__=u,t},v(l,o)}var f=function(l){A(o,l);function o(t){var u;return u=l.call(this,t,"[subtitle-track-controller]")||this,u.media=null,u.tracks=[],u.groupId=null,u.tracksInGroup=[],u.trackId=-1,u.selectDefaultTrack=!0,u.queuedDefaultTrack=-1,u.trackChangeListener=function(){return u.onTextTracksChanged()},u.asyncPollTrackChange=function(){return u.pollTrackChange(0)},u.useTextTrackPolling=!1,u.subtitlePollingInterval=-1,u.subtitleDisplay=!0,u.registerListeners(),u}var s=o.prototype;return s.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,l.prototype.destroy.call(this)},s.registerListeners=function(){var u=this.hls;u.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(G.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(G.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.on(G.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),u.on(G.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var u=this.hls;u.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(G.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(G.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.off(G.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),u.off(G.Events.ERROR,this.onError,this)},s.onMediaAttached=function(u,a){if(this.media=a.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(u){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,u)},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 u=p(this.media.textTracks);u.forEach(function(a){Object(M.clearCurrentCues)(a)}),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(u,a){this.tracks=a.subtitleTracks},s.onSubtitleTrackLoaded=function(u,a){var i=a.id,D=a.details,w=this.trackId,S=this.tracksInGroup[w];if(!S){this.warn("Invalid subtitle track id "+i);return}var L=S.details;S.details=a.details,this.log("subtitle track "+i+" loaded ["+D.startSN+"-"+D.endSN+"]"),i===this.trackId&&(this.retryCount=0,this.playlistLoaded(i,a,L))},s.onLevelLoading=function(u,a){this.switchLevel(a.level)},s.onLevelSwitching=function(u,a){this.switchLevel(a.level)},s.switchLevel=function(u){var a=this.hls.levels[u];if(!(a!=null&&a.textGroupIds))return;var i=a.textGroupIds[a.urlId];if(this.groupId!==i){var D=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,w=this.tracks.filter(function(P){return!i||P.groupId===i});this.tracksInGroup=w;var S=this.findTrackId(D==null?void 0:D.name)||this.findTrackId();this.groupId=i;var L={subtitleTracks:w};this.log("Updating subtitle tracks, "+w.length+' track(s) found in "'+i+'" group-id'),this.hls.trigger(G.Events.SUBTITLE_TRACKS_UPDATED,L),S!==-1&&this.setSubtitleTrack(S,D)}},s.findTrackId=function(u){for(var a=this.tracksInGroup,i=0;i<a.length;i++){var D=a[i];if((!this.selectDefaultTrack||D.default)&&(!u||u===D.name))return D.id}return-1},s.onError=function(u,a){if(l.prototype.onError.call(this,u,a),a.fatal||!a.context)return;a.context.type===W.PlaylistContextType.SUBTITLE_TRACK&&a.context.id===this.trackId&&a.context.groupId===this.groupId&&this.retryLoadingOrFail(a)},s.loadPlaylist=function(u){var a=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(a)){var i=a.id,D=a.groupId,w=a.url;if(u)try{w=u.addDirectives(w)}catch(S){this.warn("Could not construct new URL with HLS Delivery Directives: "+S)}this.log("Loading subtitle playlist for id "+i),this.hls.trigger(G.Events.SUBTITLE_TRACK_LOADING,{url:w,id:i,groupId:D,deliveryDirectives:u||null})}},s.toggleTrackModes=function(u){var a=this,i=this.media,D=this.subtitleDisplay,w=this.trackId;if(!i)return;var S=p(i.textTracks),L=S.filter(function(b){return b.groupId===a.groupId});if(u===-1)[].slice.call(S).forEach(function(b){b.mode="disabled"});else{var P=L[w];P&&(P.mode="disabled")}var _=L[u];_&&(_.mode=D?"showing":"hidden")},s.setSubtitleTrack=function(u,a){var i,D=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=u;return}if(this.trackId!==u&&this.toggleTrackModes(u),this.trackId===u&&(u===-1||(i=D[u])!==null&&i!==void 0&&i.details)||u<-1||u>=D.length)return;this.clearTimer();var w=D[u];if(this.log("Switching to subtitle track "+u),this.trackId=u,w){var S=w.id,L=w.groupId,P=L===void 0?"":L,_=w.name,b=w.type,g=w.url;this.hls.trigger(G.Events.SUBTITLE_TRACK_SWITCH,{id:S,groupId:P,name:_,type:b,url:g});var m=this.switchParams(w.url,a==null?void 0:a.details);this.loadPlaylist(m)}else this.hls.trigger(G.Events.SUBTITLE_TRACK_SWITCH,{id:u})},s.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var u=-1,a=p(this.media.textTracks),i=0;i<a.length;i++)if(a[i].mode==="hidden")u=i;else if(a[i].mode==="showing"){u=i;break}this.subtitleTrack!==u&&(this.subtitleTrack=u)},r(o,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(u){this.selectDefaultTrack=!1;var a=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(u,a)}}]),o}(I.default);function p(l){for(var o=[],s=0;s<l.length;s++){var t=l[s];t.kind==="subtitles"&&t.label&&o.push(l[s])}return o}V.default=f},"./src/controller/timeline-controller.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"TimelineController",function(){return p});var G=j("./src/polyfills/number.ts"),M=j("./src/events.ts"),I=j("./src/utils/cea-608-parser.ts"),W=j("./src/utils/output-filter.ts"),C=j("./src/utils/webvtt-parser.ts"),r=j("./src/utils/texttrack-utils.ts"),A=j("./src/utils/imsc1-ttml-parser.ts"),v=j("./src/types/loader.ts"),f=j("./src/utils/logger.ts"),p=function(){function t(a){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=a,this.config=a.config,this.Cues=a.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 i=new W.default(this,"textTrack1"),D=new W.default(this,"textTrack2"),w=new W.default(this,"textTrack3"),S=new W.default(this,"textTrack4");this.cea608Parser1=new I.default(1,i,D),this.cea608Parser2=new I.default(3,w,S)}a.on(M.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(M.Events.MANIFEST_LOADED,this.onManifestLoaded,this),a.on(M.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),a.on(M.Events.FRAG_LOADING,this.onFragLoading,this),a.on(M.Events.FRAG_LOADED,this.onFragLoaded,this),a.on(M.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),a.on(M.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),a.on(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),a.on(M.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),a.on(M.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var u=t.prototype;return u.destroy=function(){var i=this.hls;i.off(M.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(M.Events.MANIFEST_LOADED,this.onManifestLoaded,this),i.off(M.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),i.off(M.Events.FRAG_LOADING,this.onFragLoading,this),i.off(M.Events.FRAG_LOADED,this.onFragLoaded,this),i.off(M.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),i.off(M.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),i.off(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),i.off(M.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),i.off(M.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},u.addCues=function(i,D,w,S,L){for(var P=!1,_=L.length;_--;){var b=L[_],g=o(b[0],b[1],D,w);if(g>=0&&(b[0]=Math.min(b[0],D),b[1]=Math.max(b[1],w),P=!0,g/(w-D)>.5))return}if(P||L.push([D,w]),this.config.renderTextTracksNatively){var m=this.captionsTracks[i];this.Cues.newCue(m,D,w,S)}else{var y=this.Cues.newCue(null,D,w,S);this.hls.trigger(M.Events.CUES_PARSED,{type:"captions",cues:y,track:i})}},u.onInitPtsFound=function(i,D){var w=this,S=D.frag,L=D.id,P=D.initPTS,_=D.timescale,b=this.unparsedVttFrags;L==="main"&&(this.initPTS[S.cc]=P,this.timescale[S.cc]=_),b.length&&(this.unparsedVttFrags=[],b.forEach(function(g){w.onFragLoaded(M.Events.FRAG_LOADED,g)}))},u.getExistingTrack=function(i){var D=this.media;if(D)for(var w=0;w<D.textTracks.length;w++){var S=D.textTracks[w];if(S[i])return S}return null},u.createCaptionsTrack=function(i){this.config.renderTextTracksNatively?this.createNativeTrack(i):this.createNonNativeTrack(i)},u.createNativeTrack=function(i){if(this.captionsTracks[i])return;var D=this.captionsProperties,w=this.captionsTracks,S=this.media,L=D[i],P=L.label,_=L.languageCode,b=this.getExistingTrack(i);if(b)w[i]=b,Object(r.clearCurrentCues)(w[i]),Object(r.sendAddTrackEvent)(w[i],S);else{var g=this.createTextTrack("captions",P,_);g&&(g[i]=!0,w[i]=g)}},u.createNonNativeTrack=function(i){if(this.nonNativeCaptionsTracks[i])return;var D=this.captionsProperties[i];if(!D)return;var w=D.label,S={_id:i,label:w,kind:"captions",default:D.media?!!D.media.default:!1,closedCaptions:D.media};this.nonNativeCaptionsTracks[i]=S,this.hls.trigger(M.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[S]})},u.createTextTrack=function(i,D,w){var S=this.media;return S?S.addTextTrack(i,D,w):void 0},u.onMediaAttaching=function(i,D){this.media=D.media,this._cleanTracks()},u.onMediaDetaching=function(){var i=this.captionsTracks;Object.keys(i).forEach(function(D){Object(r.clearCurrentCues)(i[D]),delete i[D]}),this.nonNativeCaptionsTracks={}},u.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())},u._cleanTracks=function(){var i=this.media;if(!i)return;var D=i.textTracks;if(D)for(var w=0;w<D.length;w++)Object(r.clearCurrentCues)(D[w])},u.onSubtitleTracksUpdated=function(i,D){var w=this;this.textTracks=[];var S=D.subtitleTracks||[],L=S.some(function(g){return g.textCodec===A.IMSC1_CODEC});if(this.config.enableWebVTT||L&&this.config.enableIMSC1){var P=this.tracks&&S&&this.tracks.length===S.length;if(this.tracks=S||[],this.config.renderTextTracksNatively){var _=this.media?this.media.textTracks:[];this.tracks.forEach(function(g,m){var y;if(m<_.length){for(var x=null,O=0;O<_.length;O++)if(l(_[O],g)){x=_[O];break}x&&(y=x)}y?Object(r.clearCurrentCues)(y):(y=w.createTextTrack("subtitles",g.name,g.lang),y&&(y.mode="disabled")),y&&(y.groupId=g.groupId,w.textTracks.push(y))})}else if(!P&&this.tracks&&this.tracks.length){var b=this.tracks.map(function(g){return{label:g.name,kind:g.type.toLowerCase(),default:g.default,subtitleTrack:g}});this.hls.trigger(M.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:b})}}},u.onManifestLoaded=function(i,D){var w=this;this.config.enableCEA708Captions&&D.captions&&D.captions.forEach(function(S){var L=/(?:CC|SERVICE)([1-4])/.exec(S.instreamId);if(!L)return;var P="textTrack"+L[1],_=w.captionsProperties[P];if(!_)return;_.label=S.name,S.lang&&(_.languageCode=S.lang),_.media=S})},u.onFragLoading=function(i,D){var w=this.cea608Parser1,S=this.cea608Parser2,L=this.lastSn,P=this.lastPartIndex;if(!this.enabled||!(w&&S))return;if(D.frag.type===v.PlaylistLevelType.MAIN){var _,b,g=D.frag.sn,m=(_=D==null||((b=D.part)===null||b===void 0)?void 0:b.index)!=null?_:-1;g===L+1||g===L&&m===P+1||(w.reset(),S.reset()),this.lastSn=g,this.lastPartIndex=m}},u.onFragLoaded=function(i,D){var w=D.frag,S=D.payload,L=this.initPTS,P=this.unparsedVttFrags;if(w.type===v.PlaylistLevelType.SUBTITLE)if(S.byteLength){if(!Object(G.isFiniteNumber)(L[w.cc])){P.push(D),L.length&&this.hls.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:w,error:new Error("Missing initial subtitle PTS")});return}var _=w.decryptdata;if(_==null||_.key==null||_.method!=="AES-128"){var b=this.tracks[w.level],g=this.vttCCs;g[w.cc]||(g[w.cc]={start:w.start,prevCC:this.prevCC,new:!0},this.prevCC=w.cc),b&&b.textCodec===A.IMSC1_CODEC?this._parseIMSC1(w,S):this._parseVTTs(w,S,g)}}else this.hls.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:w,error:new Error("Empty subtitle payload")})},u._parseIMSC1=function(i,D){var w=this,S=this.hls;Object(A.parseIMSC1)(D,this.initPTS[i.cc],this.timescale[i.cc],function(L){w._appendCues(L,i.level),S.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:i})},function(L){f.logger.log("Failed to parse IMSC1: "+L),S.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:L})})},u._parseVTTs=function(i,D,w){var S=this,L=this.hls;Object(C.parseWebVTT)(D,this.initPTS[i.cc],this.timescale[i.cc],w,i.cc,i.start,function(P){S._appendCues(P,i.level),L.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:i})},function(P){S._fallbackToIMSC1(i,D),f.logger.log("Failed to parse VTT cue: "+P),L.trigger(M.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:P})})},u._fallbackToIMSC1=function(i,D){var w=this,S=this.tracks[i.level];S.textCodec||Object(A.parseIMSC1)(D,this.initPTS[i.cc],this.timescale[i.cc],function(){S.textCodec=A.IMSC1_CODEC,w._parseIMSC1(i,D)},function(){S.textCodec="wvtt"})},u._appendCues=function(i,D){var w=this.hls;if(this.config.renderTextTracksNatively){var S=this.textTracks[D];if(S.mode==="disabled")return;i.forEach(function(_){return Object(r.addCueToTrack)(S,_)})}else{var L=this.tracks[D],P=L.default?"default":"subtitles"+D;w.trigger(M.Events.CUES_PARSED,{type:"subtitles",cues:i,track:P})}},u.onFragDecrypted=function(i,D){var w=D.frag;if(w.type===v.PlaylistLevelType.SUBTITLE){if(!Object(G.isFiniteNumber)(this.initPTS[w.cc])){this.unparsedVttFrags.push(D);return}this.onFragLoaded(M.Events.FRAG_LOADED,D)}},u.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},u.onFragParsingUserdata=function(i,D){var w=this.cea608Parser1,S=this.cea608Parser2;if(!this.enabled||!(w&&S))return;for(var L=0;L<D.samples.length;L++){var P=D.samples[L].bytes;if(P){var _=this.extractCea608Data(P);w.addData(D.samples[L].pts,_[0]),S.addData(D.samples[L].pts,_[1])}}},u.onBufferFlushing=function(i,D){var w=D.startOffset,S=D.endOffset,L=D.endOffsetSubtitles,P=D.type,_=this.media;if(!_||_.currentTime<S)return;if(!P||P==="video"){var b=this.captionsTracks;Object.keys(b).forEach(function(m){return Object(r.removeCuesInRange)(b[m],w,S)})}if(this.config.renderTextTracksNatively&&(w===0&&L!==void 0)){var g=this.textTracks;Object.keys(g).forEach(function(m){return Object(r.removeCuesInRange)(g[m],w,L)})}},u.extractCea608Data=function(i){for(var D=i[0]&31,w=2,S=[[],[]],L=0;L<D;L++){var P=i[w++],_=127&i[w++],b=127&i[w++],g=(4&P)!==0,m=3&P;if(_===0&&b===0)continue;g&&((m===0||m===1)&&(S[m].push(_),S[m].push(b)))}return S},t}();function l(t,u){return t&&t.label===u.name&&!(t.textTrack1||t.textTrack2)}function o(t,u,a,i){return Math.min(u,i)-Math.max(t,a)}function s(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"default",function(){return G});var G=function(){function M(W,C){this.subtle=void 0,this.aesIV=void 0,this.subtle=W,this.aesIV=C}var I=M.prototype;return I.decrypt=function(C,r){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},r,C)},M}()},"./src/crypt/aes-decryptor.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"removePadding",function(){return M}),j.d(V,"default",function(){return I});var G=j("./src/utils/typed-array.ts");function M(W){var C=W.byteLength,r=C&&new DataView(W.buffer).getUint8(C-1);return r?Object(G.sliceUint8)(W,0,C-r):W}var I=function(){function W(){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 C=W.prototype;return C.uint8ArrayToUint32Array_=function(A){for(var v=new DataView(A),f=new Uint32Array(4),p=0;p<4;p++)f[p]=v.getUint32(p*4);return f},C.initTable=function(){var A=this.sBox,v=this.invSBox,f=this.subMix,p=f[0],l=f[1],o=f[2],s=f[3],t=this.invSubMix,u=t[0],a=t[1],i=t[2],D=t[3],w=new Uint32Array(256),S=0,L=0,P=0;for(P=0;P<256;P++)P<128?w[P]=P<<1:w[P]=P<<1^283;for(P=0;P<256;P++){var _=L^L<<1^L<<2^L<<3^L<<4;_=_>>>8^_&255^99,A[S]=_,v[_]=S;var b=w[S],g=w[b],m=w[g],y=w[_]*257^_*16843008;p[S]=y<<24|y>>>8,l[S]=y<<16|y>>>16,o[S]=y<<8|y>>>24,s[S]=y,y=m*16843009^g*65537^b*257^S*16843008,u[_]=y<<24|y>>>8,a[_]=y<<16|y>>>16,i[_]=y<<8|y>>>24,D[_]=y,S?(S=b^w[w[w[m^b]]],L^=w[w[L]]):S=L=1}},C.expandKey=function(A){for(var v=this.uint8ArrayToUint32Array_(A),f=!0,p=0;p<v.length&&f;)f=v[p]===this.key[p],p++;if(f)return;this.key=v;var l=this.keySize=v.length;if(l!==4&&l!==6&&l!==8)throw new Error("Invalid aes key size="+l);var o=this.ksRows=(l+6+1)*4,s,t,u=this.keySchedule=new Uint32Array(o),a=this.invKeySchedule=new Uint32Array(o),i=this.sBox,D=this.rcon,w=this.invSubMix,S=w[0],L=w[1],P=w[2],_=w[3],b,g;for(s=0;s<o;s++){if(s<l){b=u[s]=v[s];continue}g=b,s%l===0?(g=g<<8|g>>>24,g=i[g>>>24]<<24|i[g>>>16&255]<<16|i[g>>>8&255]<<8|i[g&255],g^=D[s/l|0]<<24):l>6&&s%l===4&&(g=i[g>>>24]<<24|i[g>>>16&255]<<16|i[g>>>8&255]<<8|i[g&255]),u[s]=b=(u[s-l]^g)>>>0}for(t=0;t<o;t++)s=o-t,t&3?g=u[s]:g=u[s-4],t<4||s<=4?a[t]=g:a[t]=S[i[g>>>24]]^L[i[g>>>16&255]]^P[i[g>>>8&255]]^_[i[g&255]],a[t]=a[t]>>>0},C.networkToHostOrderSwap=function(A){return A<<24|(A&65280)<<8|(A&16711680)>>8|A>>>24},C.decrypt=function(A,v,f){for(var p=this.keySize+6,l=this.invKeySchedule,o=this.invSBox,s=this.invSubMix,t=s[0],u=s[1],a=s[2],i=s[3],D=this.uint8ArrayToUint32Array_(f),w=D[0],S=D[1],L=D[2],P=D[3],_=new Int32Array(A),b=new Int32Array(_.length),g,m,y,x,O,H,F,R,U,k,d,z,Y,re,le=this.networkToHostOrderSwap;v<_.length;){for(U=le(_[v]),k=le(_[v+1]),d=le(_[v+2]),z=le(_[v+3]),O=U^l[0],H=z^l[1],F=d^l[2],R=k^l[3],Y=4,re=1;re<p;re++)g=t[O>>>24]^u[H>>16&255]^a[F>>8&255]^i[R&255]^l[Y],m=t[H>>>24]^u[F>>16&255]^a[R>>8&255]^i[O&255]^l[Y+1],y=t[F>>>24]^u[R>>16&255]^a[O>>8&255]^i[H&255]^l[Y+2],x=t[R>>>24]^u[O>>16&255]^a[H>>8&255]^i[F&255]^l[Y+3],O=g,H=m,F=y,R=x,Y=Y+4;g=o[O>>>24]<<24^o[H>>16&255]<<16^o[F>>8&255]<<8^o[R&255]^l[Y],m=o[H>>>24]<<24^o[F>>16&255]<<16^o[R>>8&255]<<8^o[O&255]^l[Y+1],y=o[F>>>24]<<24^o[R>>16&255]<<16^o[O>>8&255]<<8^o[H&255]^l[Y+2],x=o[R>>>24]<<24^o[O>>16&255]<<16^o[H>>8&255]<<8^o[F&255]^l[Y+3],b[v]=le(g^w),b[v+1]=le(x^S),b[v+2]=le(y^L),b[v+3]=le(m^P),w=U,S=k,L=d,P=z,v=v+4}return b.buffer},W}()},"./src/crypt/decrypter.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"default",function(){return v});var G=j("./src/crypt/aes-crypto.ts"),M=j("./src/crypt/fast-aes-key.ts"),I=j("./src/crypt/aes-decryptor.ts"),W=j("./src/utils/logger.ts"),C=j("./src/utils/mp4-tools.ts"),r=j("./src/utils/typed-array.ts"),A=16,v=function(){function f(l,o,s){var t=s===void 0?{}:s,u=t.removePKCS7Padding,a=u===void 0?!0:u;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=l,this.config=o,this.removePKCS7Padding=a,a)try{var i=self.crypto;i&&(this.subtle=i.subtle||i.webkitSubtle)}catch(D){}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 o=this.currentResult;if(!o){this.reset();return}var s=new Uint8Array(o);return this.reset(),this.removePKCS7Padding?Object(I.removePadding)(s):s},p.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},p.decrypt=function(o,s,t,u){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(o),s,t);var a=this.flush();a&&u(a.buffer)}else this.webCryptoDecrypt(new Uint8Array(o),s,t).then(u)},p.softwareDecrypt=function(o,s,t){var u=this.currentIV,a=this.currentResult,i=this.remainderData;this.logOnce("JS AES decrypt"),i&&(o=Object(C.appendUint8Array)(i,o),this.remainderData=null);var D=this.getValidChunk(o);if(!D.length)return null;u&&(t=u);var w=this.softwareDecrypter;w||(w=this.softwareDecrypter=new I.default),w.expandKey(s);var S=a;return this.currentResult=w.decrypt(D.buffer,0,t),this.currentIV=Object(r.sliceUint8)(D,-16).buffer,S||null},p.webCryptoDecrypt=function(o,s,t){var u=this,a=this.subtle;return(this.key!==s||!this.fastAesKey)&&(this.key=s,this.fastAesKey=new M.default(a,s)),this.fastAesKey.expandKey().then(function(i){if(!a)return Promise.reject(new Error("web crypto not initialized"));var D=new G.default(a,t);return D.decrypt(o.buffer,i)}).catch(function(i){return u.onWebCryptoError(i,o,s,t)})},p.onWebCryptoError=function(o,s,t,u){return W.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",o),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(s,t,u)},p.getValidChunk=function(o){var s=o,t=o.length-o.length%A;return t!==o.length&&(s=Object(r.sliceUint8)(o,0,t),this.remainderData=Object(r.sliceUint8)(o,t)),s},p.logOnce=function(o){if(!this.logEnabled)return;W.logger.log("[decrypter.ts]: "+o),this.logEnabled=!1},f}()},"./src/crypt/fast-aes-key.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"default",function(){return G});var G=function(){function M(W,C){this.subtle=void 0,this.key=void 0,this.subtle=W,this.key=C}var I=M.prototype;return I.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},M}()},"./src/demux/aacdemuxer.ts":function(Z,V,j){"use strict";j.r(V);var G=j("./src/demux/base-audio-demuxer.ts"),M=j("./src/demux/adts.ts"),I=j("./src/utils/logger.ts"),W=j("./src/demux/id3.ts");function C(v,f){v.prototype=Object.create(f.prototype),v.prototype.constructor=v,r(v,f)}function r(v,f){return r=Object.setPrototypeOf||function(l,o){return l.__proto__=o,l},r(v,f)}var A=function(v){C(f,v);function f(l,o){var s;return s=v.call(this)||this,s.observer=void 0,s.config=void 0,s.observer=l,s.config=o,s}var p=f.prototype;return p.resetInitSegment=function(o,s,t){v.prototype.resetInitSegment.call(this,o,s,t),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:o,duration:t,inputTimeScale:9e4,dropped:0}},f.probe=function(o){if(!o)return!1;for(var s=W.getID3Data(o,0)||[],t=s.length,u=o.length;t<u;t++)if(M.probe(o,t))return I.logger.log("ADTS sync word found !"),!0;return!1},p.canParse=function(o,s){return M.canParse(o,s)},p.appendFrame=function(o,s,t){M.initTrackConfig(o,this.observer,s,t,o.manifestCodec);var u=M.appendFrame(o,s,t,this.initPTS,this.frameIndex);if(u&&u.missing===0)return u},f}(G.default);A.minProbeByteLength=9,V.default=A},"./src/demux/adts.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"getAudioConfig",function(){return W}),j.d(V,"isHeaderPattern",function(){return C}),j.d(V,"getHeaderLength",function(){return r}),j.d(V,"getFullFrameLength",function(){return A}),j.d(V,"canGetFrameLength",function(){return v}),j.d(V,"isHeader",function(){return f}),j.d(V,"canParse",function(){return p}),j.d(V,"probe",function(){return l}),j.d(V,"initTrackConfig",function(){return o}),j.d(V,"getFrameDuration",function(){return s}),j.d(V,"parseFrameHeader",function(){return t}),j.d(V,"appendFrame",function(){return u});var G=j("./src/utils/logger.ts"),M=j("./src/errors.ts"),I=j("./src/events.ts");function W(a,i,D,w){var S,L,P,_,b=navigator.userAgent.toLowerCase(),g=w,m=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];S=((i[D+2]&192)>>>6)+1;var y=(i[D+2]&60)>>>2;if(y>m.length-1){a.trigger(I.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+y});return}return P=(i[D+2]&1)<<2,P|=(i[D+3]&192)>>>6,G.logger.log("manifest codec:"+w+", ADTS type:"+S+", samplingIndex:"+y),/firefox/i.test(b)?y>=6?(S=5,_=new Array(4),L=y-3):(S=2,_=new Array(2),L=y):b.indexOf("android")!==-1?(S=2,_=new Array(2),L=y):(S=5,_=new Array(4),w&&(w.indexOf("mp4a.40.29")!==-1||w.indexOf("mp4a.40.5")!==-1)||!w&&y>=6?L=y-3:((w&&w.indexOf("mp4a.40.2")!==-1&&(y>=6&&P===1||/vivaldi/i.test(b))||!w&&P===1)&&(S=2,_=new Array(2)),L=y)),_[0]=S<<3,_[0]|=(y&14)>>1,_[1]|=(y&1)<<7,_[1]|=P<<3,S===5&&(_[1]|=(L&14)>>1,_[2]=(L&1)<<7,_[2]|=2<<2,_[3]=0),{config:_,samplerate:m[y],channelCount:P,codec:"mp4a.40."+S,manifestCodec:g}}function C(a,i){return a[i]===255&&(a[i+1]&246)===240}function r(a,i){return a[i+1]&1?7:9}function A(a,i){return(a[i+3]&3)<<11|a[i+4]<<3|(a[i+5]&224)>>>5}function v(a,i){return i+5<a.length}function f(a,i){return i+1<a.length&&C(a,i)}function p(a,i){return v(a,i)&&C(a,i)&&A(a,i)<=a.length-i}function l(a,i){if(f(a,i)){var D=r(a,i);if(i+D>=a.length)return!1;var w=A(a,i);if(w<=D)return!1;var S=i+w;return S===a.length||f(a,S)}return!1}function o(a,i,D,w,S){if(!a.samplerate){var L=W(i,D,w,S);if(!L)return;a.config=L.config,a.samplerate=L.samplerate,a.channelCount=L.channelCount,a.codec=L.codec,a.manifestCodec=L.manifestCodec,G.logger.log("parsed codec:"+a.codec+", rate:"+L.samplerate+", channels:"+L.channelCount)}}function s(a){return 1024*9e4/a}function t(a,i,D,w,S){var L=r(a,i),P=A(a,i);if(P-=L,P>0){var _=D+w*S;return{headerLength:L,frameLength:P,stamp:_}}}function u(a,i,D,w,S){var L=s(a.samplerate),P=t(i,D,w,S,L);if(P){var _=P.frameLength,b=P.headerLength,g=P.stamp,m=b+_,y=Math.max(0,D+m-i.length),x;y?(x=new Uint8Array(m-b),x.set(i.subarray(D+b,i.length),0)):x=i.subarray(D+b,D+m);var O={unit:x,pts:g};return y||a.samples.push(O),{sample:O,length:m,missing:y}}}},"./src/demux/base-audio-demuxer.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"initPTSFn",function(){return A});var G=j("./src/polyfills/number.ts"),M=j("./src/demux/id3.ts"),I=j("./src/demux/dummy-demuxed-track.ts"),W=j("./src/utils/mp4-tools.ts"),C=j("./src/utils/typed-array.ts"),r=function(){function v(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var f=v.prototype;return f.resetInitSegment=function(l,o,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(l,o){return!1},f.appendFrame=function(l,o,s){},f.demux=function(l,o){this.cachedData&&(l=Object(W.appendUint8Array)(this.cachedData,l),this.cachedData=null);var s=M.getID3Data(l,0),t=s?s.length:0,u,a,i=this._audioTrack,D=this._id3Track,w=s?M.getTimeStamp(s):void 0,S=l.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=A(w,o)),s&&s.length>0&&D.samples.push({pts:this.initPTS,dts:this.initPTS,data:s}),a=this.initPTS;t<S;){if(this.canParse(l,t)){var L=this.appendFrame(i,l,t);L?(this.frameIndex++,a=L.sample.pts,t+=L.length,u=t):t=S}else M.canParse(l,t)?(s=M.getID3Data(l,t),D.samples.push({pts:a,dts:a,data:s}),t+=s.length,u=t):t++;if(t===S&&u!==S){var P=Object(C.sliceUint8)(l,u);this.cachedData?this.cachedData=Object(W.appendUint8Array)(this.cachedData,P):this.cachedData=P}}return{audioTrack:i,avcTrack:Object(I.dummyTrack)(),id3Track:D,textTrack:Object(I.dummyTrack)()}},f.demuxSampleAes=function(l,o,s){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},f.flush=function(l){var o=this.cachedData;return o&&(this.cachedData=null,this.demux(o,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(I.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(I.dummyTrack)()}},f.destroy=function(){},v}(),A=function(f,p){return Object(G.isFiniteNumber)(f)?f*90:p*9e4};V.default=r},"./src/demux/chunk-cache.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"default",function(){return G});var G=function(){function I(){this.chunks=[],this.dataLength=0}var W=I.prototype;return W.push=function(r){this.chunks.push(r),this.dataLength+=r.length},W.flush=function(){var r=this.chunks,A=this.dataLength,v;if(r.length)r.length===1?v=r[0]:v=M(r,A);else return new Uint8Array(0);return this.reset(),v},W.reset=function(){this.chunks.length=0,this.dataLength=0},I}();function M(I,W){for(var C=new Uint8Array(W),r=0,A=0;A<I.length;A++){var v=I[A];C.set(v,r),r+=v.length}return C}},"./src/demux/dummy-demuxed-track.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"dummyTrack",function(){return G});function G(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(Z,V,j){"use strict";j.r(V);var G=j("./src/utils/logger.ts"),M=function(){function I(C){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=C,this.bytesAvailable=C.byteLength,this.word=0,this.bitsAvailable=0}var W=I.prototype;return W.loadWord=function(){var r=this.data,A=this.bytesAvailable,v=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(v,v+p)),this.word=new DataView(f.buffer).getUint32(0),this.bitsAvailable=p*8,this.bytesAvailable-=p},W.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)},W.readBits=function(r){var A=Math.min(this.bitsAvailable,r),v=this.word>>>32-A;return r>32&&G.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?v<<A|this.readBits(A):v},W.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()},W.skipUEG=function(){this.skipBits(1+this.skipLZ())},W.skipEG=function(){this.skipBits(1+this.skipLZ())},W.readUEG=function(){var r=this.skipLZ();return this.readBits(r+1)-1},W.readEG=function(){var r=this.readUEG();return 1&r?1+r>>>1:-1*(r>>>1)},W.readBoolean=function(){return this.readBits(1)===1},W.readUByte=function(){return this.readBits(8)},W.readUShort=function(){return this.readBits(16)},W.readUInt=function(){return this.readBits(32)},W.skipScalingList=function(r){for(var A=8,v=8,f,p=0;p<r;p++)v!==0&&(f=this.readEG(),v=(A+f+256)%256),A=v===0?A:v},W.readSPS=function(){var r=0,A=0,v=0,f=0,p,l,o,s=this.readUByte.bind(this),t=this.readBits.bind(this),u=this.readUEG.bind(this),a=this.readBoolean.bind(this),i=this.skipBits.bind(this),D=this.skipEG.bind(this),w=this.skipUEG.bind(this),S=this.skipScalingList.bind(this);s();var L=s();if(t(5),i(3),s(),w(),L===100||L===110||L===122||L===244||L===44||L===83||L===86||L===118||L===128){var P=u();if(P===3&&i(1),w(),w(),i(1),a())for(l=P!==3?8:12,o=0;o<l;o++)a()&&(o<6?S(16):S(64))}w();var _=u();if(_===0)u();else if(_===1)for(i(1),D(),D(),p=u(),o=0;o<p;o++)D();w(),i(1);var b=u(),g=u(),m=t(1);m===0&&i(1),i(1),a()&&(r=u(),A=u(),v=u(),f=u());var y=[1,1];if(a()&&a()){var x=s();switch(x){case 1:y=[1,1];break;case 2:y=[12,11];break;case 3:y=[10,11];break;case 4:y=[16,11];break;case 5:y=[40,33];break;case 6:y=[24,11];break;case 7:y=[20,11];break;case 8:y=[32,11];break;case 9:y=[80,33];break;case 10:y=[18,11];break;case 11:y=[15,11];break;case 12:y=[64,33];break;case 13:y=[160,99];break;case 14:y=[4,3];break;case 15:y=[3,2];break;case 16:y=[2,1];break;case 255:{y=[s()<<8|s(),s()<<8|s()];break}}}return{width:Math.ceil((b+1)*16-r*2-A*2),height:(2-m)*(g+1)*16-(m?2:4)*(v+f),pixelRatio:y}},W.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},I}();V.default=M},"./src/demux/id3.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"isHeader",function(){return G}),j.d(V,"isFooter",function(){return M}),j.d(V,"getID3Data",function(){return I}),j.d(V,"canParse",function(){return C}),j.d(V,"getTimeStamp",function(){return r}),j.d(V,"isTimeStampFrame",function(){return A}),j.d(V,"getID3Frames",function(){return f}),j.d(V,"decodeFrame",function(){return p}),j.d(V,"utf8ArrayToStr",function(){return u}),j.d(V,"testables",function(){return a});var G=function(S,L){return L+10<=S.length&&(S[L]===73&&S[L+1]===68&&S[L+2]===51&&(S[L+3]<255&&S[L+4]<255&&(S[L+6]<128&&S[L+7]<128&&S[L+8]<128&&S[L+9]<128)))},M=function(S,L){return L+10<=S.length&&(S[L]===51&&S[L+1]===68&&S[L+2]===73&&(S[L+3]<255&&S[L+4]<255&&(S[L+6]<128&&S[L+7]<128&&S[L+8]<128&&S[L+9]<128)))},I=function(S,L){for(var P=L,_=0;G(S,L);){_+=10;var b=W(S,L+6);_+=b,M(S,L+10)&&(_+=10),L+=_}return _>0?S.subarray(P,P+_):void 0},W=function(S,L){var P=0;return P=(S[L]&127)<<21,P|=(S[L+1]&127)<<14,P|=(S[L+2]&127)<<7,P|=S[L+3]&127,P},C=function(S,L){return G(S,L)&&W(S,L+6)+10<=S.length-L},r=function(S){for(var L=f(S),P=0;P<L.length;P++){var _=L[P];if(A(_))return t(_)}return},A=function(S){return S&&S.key==="PRIV"&&S.info==="com.apple.streaming.transportStreamTimestamp"},v=function(S){var L=String.fromCharCode(S[0],S[1],S[2],S[3]),P=W(S,4),_=10;return{type:L,size:P,data:S.subarray(_,_+P)}},f=function(S){for(var L=0,P=[];G(S,L);){var _=W(S,L+6);L+=10;for(var b=L+_;L+8<b;){var g=v(S.subarray(L)),m=p(g);m&&P.push(m),L+=g.size+10}M(S,L)&&(L+=10)}return P},p=function(S){return S.type==="PRIV"?l(S):S.type[0]==="W"?s(S):o(S)},l=function(S){if(S.size<2)return;var L=u(S.data,!0),P=new Uint8Array(S.data.subarray(L.length+1));return{key:S.type,info:L,data:P.buffer}},o=function(S){if(S.size<2)return;if(S.type==="TXXX"){var L=1,P=u(S.data.subarray(L),!0);L+=P.length+1;var _=u(S.data.subarray(L));return{key:S.type,info:P,data:_}}var b=u(S.data.subarray(1));return{key:S.type,data:b}},s=function(S){if(S.type==="WXXX"){if(S.size<2)return;var L=1,P=u(S.data.subarray(L),!0);L+=P.length+1;var _=u(S.data.subarray(L));return{key:S.type,info:P,data:_}}var b=u(S.data);return{key:S.type,data:b}},t=function(S){if(S.data.byteLength===8){var L=new Uint8Array(S.data),P=L[3]&1,_=(L[4]<<23)+(L[5]<<15)+(L[6]<<7)+L[7];return _/=45,P&&(_+=4772185884e-2),Math.round(_)}return},u=function(S,L){L===void 0&&(L=!1);var P=D();if(P){var _=P.decode(S);if(L){var b=_.indexOf("\0");return b!==-1?_.substring(0,b):_}return _.replace(/\0/g,"")}for(var g=S.length,m,y,x,O="",H=0;H<g;){if(m=S[H++],m===0&&L)return O;if(m===0||m===3)continue;switch(m>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:O+=String.fromCharCode(m);break;case 12:case 13:y=S[H++],O+=String.fromCharCode((m&31)<<6|y&63);break;case 14:y=S[H++],x=S[H++],O+=String.fromCharCode((m&15)<<12|(y&63)<<6|(x&63)<<0);break;default:}}return O},a={decodeTextFrame:o},i;function D(){return!i&&typeof self.TextDecoder!="undefined"&&(i=new self.TextDecoder("utf-8")),i}},"./src/demux/mp3demuxer.ts":function(Z,V,j){"use strict";j.r(V);var G=j("./src/demux/base-audio-demuxer.ts"),M=j("./src/demux/id3.ts"),I=j("./src/utils/logger.ts"),W=j("./src/demux/mpegaudio.ts");function C(v,f){v.prototype=Object.create(f.prototype),v.prototype.constructor=v,r(v,f)}function r(v,f){return r=Object.setPrototypeOf||function(l,o){return l.__proto__=o,l},r(v,f)}var A=function(v){C(f,v);function f(){return v.apply(this,arguments)||this}var p=f.prototype;return p.resetInitSegment=function(o,s,t){v.prototype.resetInitSegment.call(this,o,s,t),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:o,duration:t,inputTimeScale:9e4,dropped:0}},f.probe=function(o){if(!o)return!1;for(var s=M.getID3Data(o,0)||[],t=s.length,u=o.length;t<u;t++)if(W.probe(o,t))return I.logger.log("MPEG Audio sync word found !"),!0;return!1},p.canParse=function(o,s){return W.canParse(o,s)},p.appendFrame=function(o,s,t){return this.initPTS===null?void 0:W.appendFrame(o,s,t,this.initPTS,this.frameIndex)},f}(G.default);A.minProbeByteLength=4,V.default=A},"./src/demux/mp4demuxer.ts":function(Z,V,j){"use strict";j.r(V);var G=j("./src/utils/mp4-tools.ts"),M=j("./src/demux/dummy-demuxed-track.ts"),I=function(){function W(r,A){this.remainderData=null,this.config=void 0,this.config=A}var C=W.prototype;return C.resetTimeStamp=function(){},C.resetInitSegment=function(){},C.resetContiguity=function(){},W.probe=function(A){return Object(G.findBox)({data:A,start:0,end:Math.min(A.length,16384)},["moof"]).length>0},C.demux=function(A){var v=A,f=Object(M.dummyTrack)();if(this.config.progressive){this.remainderData&&(v=Object(G.appendUint8Array)(this.remainderData,A));var p=Object(G.segmentValidRange)(v);this.remainderData=p.remainder,f.samples=p.valid||new Uint8Array}else f.samples=v;return{audioTrack:Object(M.dummyTrack)(),avcTrack:f,id3Track:Object(M.dummyTrack)(),textTrack:Object(M.dummyTrack)()}},C.flush=function(){var A=Object(M.dummyTrack)();return A.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(M.dummyTrack)(),avcTrack:A,id3Track:Object(M.dummyTrack)(),textTrack:Object(M.dummyTrack)()}},C.demuxSampleAes=function(A,v,f){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},C.destroy=function(){},W}();I.minProbeByteLength=1024,V.default=I},"./src/demux/mpegaudio.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"appendFrame",function(){return r}),j.d(V,"parseHeader",function(){return A}),j.d(V,"isHeaderPattern",function(){return v}),j.d(V,"isHeader",function(){return f}),j.d(V,"canParse",function(){return p}),j.d(V,"probe",function(){return l});var G=null,M=[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],I=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],W=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],C=[0,1,1,4];function r(o,s,t,u,a){if(t+24>s.length)return;var i=A(s,t);if(i&&t+i.frameLength<=s.length){var D=i.samplesPerFrame*9e4/i.sampleRate,w=u+a*D,S={unit:s.subarray(t,t+i.frameLength),pts:w,dts:w};return o.config=[],o.channelCount=i.channelCount,o.samplerate=i.sampleRate,o.samples.push(S),{sample:S,length:i.frameLength,missing:0}}}function A(o,s){var t=o[s+1]>>3&3,u=o[s+1]>>1&3,a=o[s+2]>>4&15,i=o[s+2]>>2&3;if(t!==1&&a!==0&&a!==15&&i!==3){var D=o[s+2]>>1&1,w=o[s+3]>>6,S=t===3?3-u:u===3?3:4,L=M[S*14+a-1]*1e3,P=t===3?0:t===2?1:2,_=I[P*3+i],b=w===3?1:2,g=W[t][u],m=C[u],y=g*8*m,x=Math.floor(g*L/_+D)*m;if(G===null){var O=navigator.userAgent||"",H=O.match(/Chrome\/(\d+)/i);G=H?parseInt(H[1]):0}var F=!!G&&G<=87;return F&&u===2&&L>=224e3&&w===0&&(o[s+3]=o[s+3]|128),{sampleRate:_,channelCount:b,frameLength:x,samplesPerFrame:y}}}function v(o,s){return o[s]===255&&(o[s+1]&224)===224&&(o[s+1]&6)!==0}function f(o,s){return s+1<o.length&&v(o,s)}function p(o,s){var t=4;return v(o,s)&&t<=o.length-s}function l(o,s){if(s+1<o.length&&v(o,s)){var t=4,u=A(o,s),a=t;u!=null&&u.frameLength&&(a=u.frameLength);var i=s+a;return i===o.length||f(o,i)}return!1}},"./src/demux/sample-aes.ts":function(Z,V,j){"use strict";j.r(V);var G=j("./src/crypt/decrypter.ts"),M=j("./src/demux/tsdemuxer.ts"),I=function(){function W(r,A,v){this.keyData=void 0,this.decrypter=void 0,this.keyData=v,this.decrypter=new G.default(r,A,{removePKCS7Padding:!1})}var C=W.prototype;return C.decryptBuffer=function(A,v){this.decrypter.decrypt(A,this.keyData.key.buffer,this.keyData.iv.buffer,v)},C.decryptAacSample=function(A,v,f,p){var l=A[v].unit,o=l.subarray(16,l.length-l.length%16),s=o.buffer.slice(o.byteOffset,o.byteOffset+o.length),t=this;this.decryptBuffer(s,function(u){var a=new Uint8Array(u);l.set(a,16),p||t.decryptAacSamples(A,v+1,f)})},C.decryptAacSamples=function(A,v,f){for(;;v++){if(v>=A.length){f();return}if(A[v].unit.length<32)continue;var p=this.decrypter.isSync();if(this.decryptAacSample(A,v,f,p),!p)return}},C.getAvcEncryptedData=function(A){for(var v=Math.floor((A.length-48)/160)*16+16,f=new Int8Array(v),p=0,l=32;l<=A.length-16;l+=160,p+=16)f.set(A.subarray(l,l+16),p);return f},C.getAvcDecryptedUnit=function(A,v){for(var f=new Uint8Array(v),p=0,l=32;l<=A.length-16;l+=160,p+=16)A.set(f.subarray(p,p+16),l);return A},C.decryptAvcSample=function(A,v,f,p,l,o){var s=Object(M.discardEPB)(l.data),t=this.getAvcEncryptedData(s),u=this;this.decryptBuffer(t.buffer,function(a){l.data=u.getAvcDecryptedUnit(s,a),o||u.decryptAvcSamples(A,v,f+1,p)})},C.decryptAvcSamples=function(A,v,f,p){if(A instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;v++,f=0){if(v>=A.length){p();return}for(var l=A[v].units;!(f>=l.length);f++){var o=l[f];if(o.data.length<=48||o.type!==1&&o.type!==5)continue;var s=this.decrypter.isSync();if(this.decryptAvcSample(A,v,f,p,o,s),!s)return}}},W}();V.default=I},"./src/demux/transmuxer-interface.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"default",function(){return l});var G=j("./node_modules/webworkify-webpack/index.js"),M=j.n(G),I=j("./src/events.ts"),W=j("./src/demux/transmuxer.ts"),C=j("./src/utils/logger.ts"),r=j("./src/errors.ts"),A=j("./src/utils/mediasource-helper.ts"),v=j("./node_modules/eventemitter3/index.js"),f=j.n(v),p=Object(A.getMediaSource)()||{isTypeSupported:function(){return!1}},l=function(){function o(t,u,a,i){var D=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=t,this.id=u,this.onTransmuxComplete=a,this.onFlush=i;var w=t.config,S=function(g,m){m=m||{},m.frag=D.frag,m.id=D.id,t.trigger(g,m)};this.observer=new v.EventEmitter,this.observer.on(I.Events.FRAG_DECRYPTED,S),this.observer.on(I.Events.ERROR,S);var L={mp4:p.isTypeSupported("video/mp4"),mpeg:p.isTypeSupported("audio/mpeg"),mp3:p.isTypeSupported('audio/mp4; codecs="mp3"')},P=navigator.vendor;if(w.enableWorker&&typeof Worker!="undefined"){C.logger.log("demuxing in webworker");var _;try{_=this.worker=G("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),_.addEventListener("message",this.onwmsg),_.onerror=function(b){t.trigger(I.Events.ERROR,{type:r.ErrorTypes.OTHER_ERROR,details:r.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(b.message+" ("+b.filename+":"+b.lineno+")")})},_.postMessage({cmd:"init",typeSupported:L,vendor:P,id:u,config:JSON.stringify(w)})}catch(b){C.logger.warn("Error in worker:",b),C.logger.error("Error while initializing DemuxerWorker, fallback to inline"),_&&self.URL.revokeObjectURL(_.objectURL),this.transmuxer=new W.default(this.observer,L,w,P,u),this.worker=null}}else this.transmuxer=new W.default(this.observer,L,w,P,u)}var s=o.prototype;return s.destroy=function(){var u=this.worker;if(u)u.removeEventListener("message",this.onwmsg),u.terminate(),this.worker=null;else{var a=this.transmuxer;a&&(a.destroy(),this.transmuxer=null)}var i=this.observer;i&&i.removeAllListeners(),this.observer=null},s.push=function(u,a,i,D,w,S,L,P,_,b){var g=this;_.transmuxing.start=self.performance.now();var m=this.transmuxer,y=this.worker,x=S?S.start:w.start,O=w.decryptdata,H=this.frag,F=!(H&&w.cc===H.cc),R=!(H&&_.level===H.level),U=H?_.sn-H.sn:-1,k=this.part?_.part-this.part.index:1,d=!R&&(U===1||U===0&&k===1),z=self.performance.now();(R||U||w.stats.parsing.start===0)&&(w.stats.parsing.start=z),S&&(k||!d)&&(S.stats.parsing.start=z);var Y=new W.TransmuxState(F,d,P,R,x);if(!d||F){C.logger.log("[transmuxer-interface, "+w.type+"]: Starting new transmux session for sn: "+_.sn+" p: "+_.part+" level: "+_.level+" id: "+_.id+`
discontinuity: `+F+`
trackSwitch: `+R+`
contiguous: `+d+`
accurateTimeOffset: `+P+`
timeOffset: `+x);var re=new W.TransmuxConfig(i,D,a,L,b);this.configureTransmuxer(re)}if(this.frag=w,this.part=S,y)y.postMessage({cmd:"demux",data:u,decryptdata:O,chunkMeta:_,state:Y},u instanceof ArrayBuffer?[u]:[]);else if(m){var le=m.push(u,O,_,Y);Object(W.isPromise)(le)?le.then(function(Ne){g.handleTransmuxComplete(Ne)}):this.handleTransmuxComplete(le)}},s.flush=function(u){var a=this;u.transmuxing.start=self.performance.now();var i=this.transmuxer,D=this.worker;if(D)D.postMessage({cmd:"flush",chunkMeta:u});else if(i){var w=i.flush(u);Object(W.isPromise)(w)?w.then(function(S){a.handleFlushResult(S,u)}):this.handleFlushResult(w,u)}},s.handleFlushResult=function(u,a){var i=this;u.forEach(function(D){i.handleTransmuxComplete(D)}),this.onFlush(a)},s.onWorkerMessage=function(u){var a=u.data,i=this.hls;switch(a.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(a.data);break}case"flush":{this.onFlush(a.data);break}default:{a.data=a.data||{},a.data.frag=this.frag,a.data.id=this.id,i.trigger(a.event,a.data);break}}},s.configureTransmuxer=function(u){var a=this.worker,i=this.transmuxer;a?a.postMessage({cmd:"configure",config:u}):i&&i.configure(u)},s.handleTransmuxComplete=function(u){u.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(u)},o}()},"./src/demux/transmuxer-worker.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"default",function(){return r});var G=j("./src/demux/transmuxer.ts"),M=j("./src/events.ts"),I=j("./src/utils/logger.ts"),W=j("./node_modules/eventemitter3/index.js"),C=j.n(W);function r(l){var o=new W.EventEmitter,s=function(u,a){l.postMessage({event:u,data:a})};o.on(M.Events.FRAG_DECRYPTED,s),o.on(M.Events.ERROR,s),l.addEventListener("message",function(t){var u=t.data;switch(u.cmd){case"init":{var a=JSON.parse(u.config);l.transmuxer=new G.default(o,u.typeSupported,a,u.vendor,u.id),Object(I.enableLogs)(a.debug),s("init",null);break}case"configure":{l.transmuxer.configure(u.config);break}case"demux":{var i=l.transmuxer.push(u.data,u.decryptdata,u.chunkMeta,u.state);Object(G.isPromise)(i)?i.then(function(S){A(l,S)}):A(l,i);break}case"flush":{var D=u.chunkMeta,w=l.transmuxer.flush(D);Object(G.isPromise)(w)?w.then(function(S){f(l,S,D)}):f(l,w,D);break}default:break}})}function A(l,o){if(p(o.remuxResult))return;var s=[],t=o.remuxResult,u=t.audio,a=t.video;u&&v(s,u),a&&v(s,a),l.postMessage({event:"transmuxComplete",data:o},s)}function v(l,o){o.data1&&l.push(o.data1.buffer),o.data2&&l.push(o.data2.buffer)}function f(l,o,s){o.forEach(function(t){A(l,t)}),l.postMessage({event:"flush",data:s})}function p(l){return!l.audio&&!l.video&&!l.text&&!l.id3&&!l.initSegment}},"./src/demux/transmuxer.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"default",function(){return a}),j.d(V,"isPromise",function(){return w}),j.d(V,"TransmuxConfig",function(){return S}),j.d(V,"TransmuxState",function(){return L});var G=j("./src/events.ts"),M=j("./src/errors.ts"),I=j("./src/crypt/decrypter.ts"),W=j("./src/demux/aacdemuxer.ts"),C=j("./src/demux/mp4demuxer.ts"),r=j("./src/demux/tsdemuxer.ts"),A=j("./src/demux/mp3demuxer.ts"),v=j("./src/remux/mp4-remuxer.ts"),f=j("./src/remux/passthrough-remuxer.ts"),p=j("./src/demux/chunk-cache.ts"),l=j("./src/utils/mp4-tools.ts"),o=j("./src/utils/logger.ts"),s;try{s=self.performance.now.bind(self.performance)}catch(P){o.logger.debug("Unable to use Performance API on this environment"),s=self.Date.now}var t=[{demux:r.default,remux:v.default},{demux:C.default,remux:f.default},{demux:W.default,remux:v.default},{demux:A.default,remux:v.default}],u=1024;t.forEach(function(P){var _=P.demux;u=Math.max(u,_.minProbeByteLength)});var a=function(){function P(b,g,m,y,x){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=b,this.typeSupported=g,this.config=m,this.vendor=y,this.id=x}var _=P.prototype;return _.configure=function(g){this.transmuxConfig=g,this.decrypter&&this.decrypter.reset()},_.push=function(g,m,y,x){var O=this,H=y.transmuxing;H.executeStart=s();var F=new Uint8Array(g),R=this.cache,U=this.config,k=this.currentTransmuxState,d=this.transmuxConfig;x&&(this.currentTransmuxState=x);var z=i(F,m);if(z&&z.method==="AES-128"){var Y=this.getDecrypter();if(U.enableSoftwareAES){var re=Y.softwareDecrypt(F,z.key.buffer,z.iv.buffer);if(!re)return H.executeEnd=s(),D(y);F=new Uint8Array(re)}else return this.decryptionPromise=Y.webCryptoDecrypt(F,z.key.buffer,z.iv.buffer).then(function($){var Q=O.push($,null,y);return O.decryptionPromise=null,Q}),this.decryptionPromise}var le=x||k,Ne=le.contiguous,Ce=le.discontinuity,Te=le.trackSwitch,Fe=le.accurateTimeOffset,Ve=le.timeOffset,xe=d.audioCodec,ye=d.videoCodec,oe=d.defaultInitPts,Se=d.duration,_e=d.initSegmentData;if((Ce||Te)&&this.resetInitSegment(_e,xe,ye,Se),Ce&&this.resetInitialTimestamp(oe),Ne||this.resetContiguity(),this.needsProbing(F,Ce,Te)){if(R.dataLength){var He=R.flush();F=Object(l.appendUint8Array)(He,F)}this.configureTransmuxer(F,d)}var rt=this.transmux(F,z,Ve,Fe,y),ae=this.currentTransmuxState;return ae.contiguous=!0,ae.discontinuity=!1,ae.trackSwitch=!1,H.executeEnd=s(),rt},_.flush=function(g){var m=this,y=g.transmuxing;y.executeStart=s();var x=this.decrypter,O=this.cache,H=this.currentTransmuxState,F=this.decryptionPromise;if(F)return F.then(function(){return m.flush(g)});var R=[],U=H.timeOffset;if(x){var k=x.flush();k&&R.push(this.push(k,null,g))}var d=O.dataLength;O.reset();var z=this.demuxer,Y=this.remuxer;if(!z||!Y)return d>=u&&this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),y.executeEnd=s(),[D(g)];var re=z.flush(U);return w(re)?re.then(function(le){return m.flushRemux(R,le,g),R}):(this.flushRemux(R,re,g),R)},_.flushRemux=function(g,m,y){var x=m.audioTrack,O=m.avcTrack,H=m.id3Track,F=m.textTrack,R=this.currentTransmuxState,U=R.accurateTimeOffset,k=R.timeOffset;o.logger.log("[transmuxer.ts]: Flushed fragment "+y.sn+(y.part>-1?" p: "+y.part:"")+" of level "+y.level);var d=this.remuxer.remux(x,O,H,F,k,U,!0,this.id);g.push({remuxResult:d,chunkMeta:y}),y.transmuxing.executeEnd=s()},_.resetInitialTimestamp=function(g){var m=this.demuxer,y=this.remuxer;if(!m||!y)return;m.resetTimeStamp(g),y.resetTimeStamp(g)},_.resetContiguity=function(){var g=this.demuxer,m=this.remuxer;if(!g||!m)return;g.resetContiguity(),m.resetNextTimestamp()},_.resetInitSegment=function(g,m,y,x){var O=this.demuxer,H=this.remuxer;if(!O||!H)return;O.resetInitSegment(m,y,x),H.resetInitSegment(g,m,y)},_.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},_.transmux=function(g,m,y,x,O){var H;return m&&m.method==="SAMPLE-AES"?H=this.transmuxSampleAes(g,m,y,x,O):H=this.transmuxUnencrypted(g,y,x,O),H},_.transmuxUnencrypted=function(g,m,y,x){var O=this.demuxer.demux(g,m,!1,!this.config.progressive),H=O.audioTrack,F=O.avcTrack,R=O.id3Track,U=O.textTrack,k=this.remuxer.remux(H,F,R,U,m,y,!1,this.id);return{remuxResult:k,chunkMeta:x}},_.transmuxSampleAes=function(g,m,y,x,O){var H=this;return this.demuxer.demuxSampleAes(g,m,y).then(function(F){var R=H.remuxer.remux(F.audioTrack,F.avcTrack,F.id3Track,F.textTrack,y,x,!1,H.id);return{remuxResult:R,chunkMeta:O}})},_.configureTransmuxer=function(g,m){for(var y=this.config,x=this.observer,O=this.typeSupported,H=this.vendor,F=m.audioCodec,R=m.defaultInitPts,U=m.duration,k=m.initSegmentData,d=m.videoCodec,z,Y=0,re=t.length;Y<re;Y++)if(t[Y].demux.probe(g)){z=t[Y];break}z||(o.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),z={demux:C.default,remux:f.default});var le=this.demuxer,Ne=this.remuxer,Ce=z.remux,Te=z.demux;(!Ne||!(Ne instanceof Ce))&&(this.remuxer=new Ce(x,y,O,H)),(!le||!(le instanceof Te))&&(this.demuxer=new Te(x,y,O),this.probe=Te.probe),this.resetInitSegment(k,F,d,U),this.resetInitialTimestamp(R)},_.needsProbing=function(g,m,y){return!this.demuxer||!this.remuxer||m||y},_.getDecrypter=function(){var g=this.decrypter;return g||(g=this.decrypter=new I.default(this.observer,this.config)),g},P}();function i(P,_){var b=null;return P.byteLength>0&&_!=null&&_.key!=null&&_.iv!==null&&_.method!=null&&(b=_),b}var D=function(_){return{remuxResult:{},chunkMeta:_}};function w(P){return"then"in P&&P.then instanceof Function}var S=function(_,b,g,m,y){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=_,this.videoCodec=b,this.initSegmentData=g,this.duration=m,this.defaultInitPts=y},L=function(_,b,g,m,y){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=_,this.contiguous=b,this.accurateTimeOffset=g,this.trackSwitch=m,this.timeOffset=y}},"./src/demux/tsdemuxer.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"discardEPB",function(){return D});var G=j("./src/demux/adts.ts"),M=j("./src/demux/mpegaudio.ts"),I=j("./src/demux/exp-golomb.ts"),W=j("./src/demux/id3.ts"),C=j("./src/demux/sample-aes.ts"),r=j("./src/events.ts"),A=j("./src/utils/mp4-tools.ts"),v=j("./src/utils/logger.ts"),f=j("./src/errors.ts"),p={video:1,audio:2,id3:3,text:4},l=function(){function w(L,P,_){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=L,this.config=P,this.typeSupported=_}w.probe=function(P){var _=w.syncOffset(P);return _<0?!1:(_&&v.logger.warn("MPEG2-TS detected but first sync word found @ offset "+_+", junk ahead ?"),!0)},w.syncOffset=function(P){for(var _=Math.min(1e3,P.length-3*188),b=0;b<_;){if(P[b]===71&&P[b+188]===71&&P[b+2*188]===71)return b;b++}return-1},w.createTrack=function(P,_){return{container:P==="video"||P==="audio"?"video/mp2t":void 0,type:P,id:p[P],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:P==="audio"?_:void 0}};var S=w.prototype;return S.resetInitSegment=function(P,_,b){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=w.createTrack("video",b),this._audioTrack=w.createTrack("audio",b),this._id3Track=w.createTrack("id3",b),this._txtTrack=w.createTrack("text",b),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=P,this.videoCodec=_,this._duration=b},S.resetTimeStamp=function(){},S.resetContiguity=function(){var P=this._audioTrack,_=this._avcTrack,b=this._id3Track;P&&(P.pesData=null),_&&(_.pesData=null),b&&(b.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},S.demux=function(P,_,b,g){b===void 0&&(b=!1),g===void 0&&(g=!1),b||(this.sampleAes=null);var m,y=this._avcTrack,x=this._audioTrack,O=this._id3Track,H=y.pid,F=y.pesData,R=x.pid,U=O.pid,k=x.pesData,d=O.pesData,z=!1,Y=this.pmtParsed,re=this._pmtId,le=P.length;if(this.remainderData&&(P=Object(A.appendUint8Array)(this.remainderData,P),le=P.length,this.remainderData=null),le<188&&!g)return this.remainderData=P,{audioTrack:x,avcTrack:y,id3Track:O,textTrack:this._txtTrack};var Ne=Math.max(0,w.syncOffset(P));le-=(le+Ne)%188,le<P.byteLength&&!g&&(this.remainderData=new Uint8Array(P.buffer,le,P.buffer.byteLength-le));for(var Ce=Ne;Ce<le;Ce+=188)if(P[Ce]===71){var Te=!!(P[Ce+1]&64),Fe=((P[Ce+1]&31)<<8)+P[Ce+2],Ve=(P[Ce+3]&48)>>4,xe=void 0;if(Ve>1){if(xe=Ce+5+P[Ce+4],xe===Ce+188)continue}else xe=Ce+4;switch(Fe){case H:Te&&(F&&(m=u(F))&&this.parseAVCPES(m,!1),F={data:[],size:0}),F&&(F.data.push(P.subarray(xe,Ce+188)),F.size+=Ce+188-xe);break;case R:Te&&(k&&(m=u(k))&&(x.isAAC?this.parseAACPES(m):this.parseMPEGPES(m)),k={data:[],size:0}),k&&(k.data.push(P.subarray(xe,Ce+188)),k.size+=Ce+188-xe);break;case U:Te&&(d&&(m=u(d))&&this.parseID3PES(m),d={data:[],size:0}),d&&(d.data.push(P.subarray(xe,Ce+188)),d.size+=Ce+188-xe);break;case 0:Te&&(xe+=P[xe]+1),re=this._pmtId=s(P,xe);break;case re:{Te&&(xe+=P[xe]+1);var ye=t(P,xe,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,b);H=ye.avc,H>0&&(y.pid=H),R=ye.audio,R>0&&(x.pid=R,x.isAAC=ye.isAAC),U=ye.id3,U>0&&(O.pid=U),z&&!Y&&(v.logger.log("reparse from beginning"),z=!1,Ce=Ne-188),Y=this.pmtParsed=!0;break}case 17:case 8191:break;default:z=!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"});y.pesData=F,x.pesData=k,O.pesData=d;var oe={audioTrack:x,avcTrack:y,id3Track:O,textTrack:this._txtTrack};return g&&this.extractRemainingSamples(oe),oe},S.flush=function(){var P=this.remainderData;this.remainderData=null;var _;return P?_=this.demux(P,-1,!1,!0):_={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(_),this.sampleAes?this.decrypt(_,this.sampleAes):_},S.extractRemainingSamples=function(P){var _=P.audioTrack,b=P.avcTrack,g=P.id3Track,m=b.pesData,y=_.pesData,x=g.pesData,O;m&&(O=u(m))?(this.parseAVCPES(O,!0),b.pesData=null):b.pesData=m,y&&(O=u(y))?(_.isAAC?this.parseAACPES(O):this.parseMPEGPES(O),_.pesData=null):(y!=null&&y.size&&v.logger.log("last AAC PES packet truncated,might overlap between fragments"),_.pesData=y),x&&(O=u(x))?(this.parseID3PES(O),g.pesData=null):g.pesData=x},S.demuxSampleAes=function(P,_,b){var g=this.demux(P,b,!0,!this.config.progressive),m=this.sampleAes=new C.default(this.observer,this.config,_);return this.decrypt(g,m)},S.decrypt=function(P,_){return new Promise(function(b){var g=P.audioTrack,m=P.avcTrack;g.samples&&g.isAAC?_.decryptAacSamples(g.samples,0,function(){m.samples?_.decryptAvcSamples(m.samples,0,0,function(){b(P)}):b(P)}):m.samples&&_.decryptAvcSamples(m.samples,0,0,function(){b(P)})})},S.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},S.parseAVCPES=function(P,_){var b=this,g=this._avcTrack,m=this.parseAVCNALu(P.data),y=!1,x=this.avcSample,O,H=!1;P.data=null,x&&m.length&&!g.audFound&&(a(x,g),x=this.avcSample=o(!1,P.pts,P.dts,"")),m.forEach(function(F){switch(F.type){case 1:{O=!0,x||(x=b.avcSample=o(!0,P.pts,P.dts,"")),y&&(x.debug+="NDR "),x.frame=!0;var R=F.data;if(H&&R.length>4){var U=new I.default(R).readSliceType();(U===2||U===4||U===7||U===9)&&(x.key=!0)}break}case 5:O=!0,x||(x=b.avcSample=o(!0,P.pts,P.dts,"")),y&&(x.debug+="IDR "),x.key=!0,x.frame=!0;break;case 6:{O=!0,y&&x&&(x.debug+="SEI ");var k=new I.default(D(F.data));k.readUByte();for(var d=0,z=0,Y=!1,re=0;!Y&&k.bytesAvailable>1;){d=0;do re=k.readUByte(),d+=re;while(re===255);z=0;do re=k.readUByte(),z+=re;while(re===255);if(d===4&&k.bytesAvailable!==0){Y=!0;var le=k.readUByte();if(le===181){var Ne=k.readUShort();if(Ne===49){var Ce=k.readUInt();if(Ce===1195456820){var Te=k.readUByte();if(Te===3){for(var Fe=k.readUByte(),Ve=k.readUByte(),xe=31&Fe,ye=[Fe,Ve],oe=0;oe<xe;oe++)ye.push(k.readUByte()),ye.push(k.readUByte()),ye.push(k.readUByte());i(b._txtTrack.samples,{type:3,pts:P.pts,bytes:ye})}}}}}else if(d===5&&k.bytesAvailable!==0){if(Y=!0,z>16){for(var Se=[],_e=0;_e<16;_e++)Se.push(k.readUByte().toString(16)),(_e===3||_e===5||_e===7||_e===9)&&Se.push("-");for(var He=z-16,rt=new Uint8Array(He),ae=0;ae<He;ae++)rt[ae]=k.readUByte();i(b._txtTrack.samples,{pts:P.pts,payloadType:d,uuid:Se.join(""),userData:Object(W.utf8ArrayToStr)(rt),userDataBytes:rt})}}else if(z<k.bytesAvailable)for(var $=0;$<z;$++)k.readUByte()}break}case 7:if(O=!0,H=!0,y&&x&&(x.debug+="SPS "),!g.sps){var Q=new I.default(F.data),te=Q.readSPS();g.width=te.width,g.height=te.height,g.pixelRatio=te.pixelRatio,g.sps=[F.data],g.duration=b._duration;for(var he=F.data.subarray(1,4),ge="avc1.",we=0;we<3;we++){var ft=he[we].toString(16);ft.length<2&&(ft="0"+ft),ge+=ft}g.codec=ge}break;case 8:O=!0,y&&x&&(x.debug+="PPS "),g.pps||(g.pps=[F.data]);break;case 9:O=!1,g.audFound=!0,x&&a(x,g),x=b.avcSample=o(!1,P.pts,P.dts,y?"AUD ":"");break;case 12:O=!1;break;default:O=!1,x&&(x.debug+="unknown NAL "+F.type+" ");break}if(x&&O){var Pt=x.units;Pt.push(F)}}),_&&x&&(a(x,g),this.avcSample=null)},S.getLastNalUnit=function(){var P,_=this.avcSample,b;if(!_||_.units.length===0){var g=this._avcTrack.samples;_=g[g.length-1]}if((P=_)!==null&&P!==void 0&&P.units){var m=_.units;b=m[m.length-1]}return b},S.parseAVCNALu=function(P){var _=P.byteLength,b=this._avcTrack,g=b.naluState||0,m=g,y=[],x=0,O,H,F,R=-1,U=0;for(g===-1&&(R=0,U=P[0]&31,g=0,x=1);x<_;){if(O=P[x++],!g){g=O?0:1;continue}if(g===1){g=O?0:2;continue}if(!O)g=3;else if(O===1){if(R>=0){var k={data:P.subarray(R,x-g-1),type:U};y.push(k)}else{var d=this.getLastNalUnit();if(d&&(m&&x<=4-m&&(d.state&&(d.data=d.data.subarray(0,d.data.byteLength-m))),H=x-g-1,H>0)){var z=new Uint8Array(d.data.byteLength+H);z.set(d.data,0),z.set(P.subarray(0,H),d.data.byteLength),d.data=z,d.state=0}}x<_?(F=P[x]&31,R=x,U=F,g=0):g=-1}else g=0}if(R>=0&&g>=0){var Y={data:P.subarray(R,_),type:U,state:g};y.push(Y)}if(y.length===0){var re=this.getLastNalUnit();if(re){var le=new Uint8Array(re.data.byteLength+P.byteLength);le.set(re.data,0),le.set(P,re.data.byteLength),re.data=le}}return b.naluState=g,y},S.parseAACPES=function(P){var _=0,b=this._audioTrack,g=this.aacOverFlow,m=P.data;if(g){this.aacOverFlow=null;var y=g.sample.unit.byteLength,x=Math.min(g.missing,y),O=y-x;g.sample.unit.set(m.subarray(0,x),O),b.samples.push(g.sample),_=g.missing}var H,F;for(H=_,F=m.length;H<F-1&&!G.isHeader(m,H);H++);if(H!==_){var R,U;if(H<F-1?(R="AAC PES did not start with ADTS header,offset:"+H,U=!1):(R="no ADTS header found in AAC PES",U=!0),v.logger.warn("parsing error:"+R),this.observer.emit(r.Events.ERROR,r.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_PARSING_ERROR,fatal:U,reason:R}),U)return}G.initTrackConfig(b,this.observer,m,H,this.audioCodec);var k;if(P.pts!==void 0)k=P.pts;else if(g){var d=G.getFrameDuration(b.samplerate);k=g.sample.pts+d}else{v.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var z=0;H<F;)if(G.isHeader(m,H)){if(H+5<F){var Y=G.appendFrame(b,m,H,k,z);if(Y)if(Y.missing)this.aacOverFlow=Y;else{H+=Y.length,z++;continue}}break}else H++},S.parseMPEGPES=function(P){var _=P.data,b=_.length,g=0,m=0,y=P.pts;if(y===void 0){v.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;m<b;)if(M.isHeader(_,m)){var x=M.appendFrame(this._audioTrack,_,m,y,g);if(x)m+=x.length,g++;else break}else m++},S.parseID3PES=function(P){if(P.pts===void 0){v.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(P)},w}();l.minProbeByteLength=188;function o(w,S,L,P){return{key:w,frame:!1,pts:S,dts:L,units:[],debug:P,length:0}}function s(w,S){return(w[S+10]&31)<<8|w[S+11]}function t(w,S,L,P){var _={audio:-1,avc:-1,id3:-1,isAAC:!0},b=(w[S+1]&15)<<8|w[S+2],g=S+3+b-4,m=(w[S+10]&15)<<8|w[S+11];for(S+=12+m;S<g;){var y=(w[S+1]&31)<<8|w[S+2];switch(w[S]){case 207:if(!P){v.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:_.audio===-1&&(_.audio=y);break;case 21:_.id3===-1&&(_.id3=y);break;case 219:if(!P){v.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:_.avc===-1&&(_.avc=y);break;case 3:case 4:L?_.audio===-1&&(_.audio=y,_.isAAC=!1):v.logger.log("MPEG audio found, not supported in this browser");break;case 36:v.logger.warn("Unsupported HEVC stream type found");break;default:break}S+=((w[S+3]&15)<<8|w[S+4])+5}return _}function u(w){var S=0,L,P,_,b,g,m=w.data;if(!w||w.size===0)return null;for(;m[0].length<19&&m.length>1;){var y=new Uint8Array(m[0].length+m[1].length);y.set(m[0]),y.set(m[1],m[0].length),m[0]=y,m.splice(1,1)}L=m[0];var x=(L[0]<<16)+(L[1]<<8)+L[2];if(x===1){if(P=(L[4]<<8)+L[5],P&&P>w.size-6)return null;var O=L[7];O&192&&(b=(L[9]&14)*536870912+(L[10]&255)*4194304+(L[11]&254)*16384+(L[12]&255)*128+(L[13]&254)/2,O&64?(g=(L[14]&14)*536870912+(L[15]&255)*4194304+(L[16]&254)*16384+(L[17]&255)*128+(L[18]&254)/2,b-g>60*9e4&&(v.logger.warn(Math.round((b-g)/9e4)+"s delta between PTS and DTS, align them"),b=g)):g=b),_=L[8];var H=_+9;if(w.size<=H)return null;w.size-=H;for(var F=new Uint8Array(w.size),R=0,U=m.length;R<U;R++){L=m[R];var k=L.byteLength;if(H)if(H>k){H-=k;continue}else L=L.subarray(H),k-=H,H=0;F.set(L,S),S+=k}return P&&(P-=_+3),{data:F,pts:b,dts:g,len:P}}return null}function a(w,S){if(w.units.length&&w.frame){if(w.pts===void 0){var L=S.samples,P=L.length;if(P){var _=L[P-1];w.pts=_.pts,w.dts=_.dts}else{S.dropped++;return}}S.samples.push(w)}w.debug.length&&v.logger.log(w.pts+"/"+w.dts+":"+w.debug)}function i(w,S){var L=w.length;if(L>0){if(S.pts>=w[L-1].pts)w.push(S);else for(var P=L-1;P>=0;P--)if(S.pts<w[P].pts){w.splice(P,0,S);break}}else w.push(S)}function D(w){for(var S=w.byteLength,L=[],P=1;P<S-2;)w[P]===0&&w[P+1]===0&&w[P+2]===3?(L.push(P+2),P+=2):P++;if(L.length===0)return w;var _=S-L.length,b=new Uint8Array(_),g=0;for(P=0;P<_;g++,P++)g===L[0]&&(g++,L.shift()),b[P]=w[g];return b}V.default=l},"./src/errors.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"ErrorTypes",function(){return G}),j.d(V,"ErrorDetails",function(){return M});var G;(function(I){I.NETWORK_ERROR="networkError",I.MEDIA_ERROR="mediaError",I.KEY_SYSTEM_ERROR="keySystemError",I.MUX_ERROR="muxError",I.OTHER_ERROR="otherError"})(G||(G={}));var M;(function(I){I.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",I.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",I.KEY_SYSTEM_NO_SESSION="keySystemNoSession",I.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",I.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",I.MANIFEST_LOAD_ERROR="manifestLoadError",I.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",I.MANIFEST_PARSING_ERROR="manifestParsingError",I.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",I.LEVEL_EMPTY_ERROR="levelEmptyError",I.LEVEL_LOAD_ERROR="levelLoadError",I.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",I.LEVEL_SWITCH_ERROR="levelSwitchError",I.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",I.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",I.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",I.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",I.FRAG_LOAD_ERROR="fragLoadError",I.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",I.FRAG_DECRYPT_ERROR="fragDecryptError",I.FRAG_PARSING_ERROR="fragParsingError",I.REMUX_ALLOC_ERROR="remuxAllocError",I.KEY_LOAD_ERROR="keyLoadError",I.KEY_LOAD_TIMEOUT="keyLoadTimeOut",I.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",I.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",I.BUFFER_APPEND_ERROR="bufferAppendError",I.BUFFER_APPENDING_ERROR="bufferAppendingError",I.BUFFER_STALLED_ERROR="bufferStalledError",I.BUFFER_FULL_ERROR="bufferFullError",I.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",I.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",I.INTERNAL_EXCEPTION="internalException",I.INTERNAL_ABORTED="aborted",I.UNKNOWN="unknown"})(M||(M={}))},"./src/events.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"Events",function(){return G});var G;(function(M){M.MEDIA_ATTACHING="hlsMediaAttaching",M.MEDIA_ATTACHED="hlsMediaAttached",M.MEDIA_DETACHING="hlsMediaDetaching",M.MEDIA_DETACHED="hlsMediaDetached",M.BUFFER_RESET="hlsBufferReset",M.BUFFER_CODECS="hlsBufferCodecs",M.BUFFER_CREATED="hlsBufferCreated",M.BUFFER_APPENDING="hlsBufferAppending",M.BUFFER_APPENDED="hlsBufferAppended",M.BUFFER_EOS="hlsBufferEos",M.BUFFER_FLUSHING="hlsBufferFlushing",M.BUFFER_FLUSHED="hlsBufferFlushed",M.MANIFEST_LOADING="hlsManifestLoading",M.MANIFEST_LOADED="hlsManifestLoaded",M.MANIFEST_PARSED="hlsManifestParsed",M.LEVEL_SWITCHING="hlsLevelSwitching",M.LEVEL_SWITCHED="hlsLevelSwitched",M.LEVEL_LOADING="hlsLevelLoading",M.LEVEL_LOADED="hlsLevelLoaded",M.LEVEL_UPDATED="hlsLevelUpdated",M.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",M.LEVELS_UPDATED="hlsLevelsUpdated",M.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",M.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",M.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",M.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",M.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",M.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",M.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",M.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",M.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",M.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",M.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",M.CUES_PARSED="hlsCuesParsed",M.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",M.INIT_PTS_FOUND="hlsInitPtsFound",M.FRAG_LOADING="hlsFragLoading",M.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",M.FRAG_LOADED="hlsFragLoaded",M.FRAG_DECRYPTED="hlsFragDecrypted",M.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",M.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",M.FRAG_PARSING_METADATA="hlsFragParsingMetadata",M.FRAG_PARSED="hlsFragParsed",M.FRAG_BUFFERED="hlsFragBuffered",M.FRAG_CHANGED="hlsFragChanged",M.FPS_DROP="hlsFpsDrop",M.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",M.ERROR="hlsError",M.DESTROYING="hlsDestroying",M.KEY_LOADING="hlsKeyLoading",M.KEY_LOADED="hlsKeyLoaded",M.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",M.BACK_BUFFER_REACHED="hlsBackBufferReached"})(G||(G={}))},"./src/hls.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"default",function(){return w});var G=j("./node_modules/url-toolkit/src/url-toolkit.js"),M=j.n(G),I=j("./src/loader/playlist-loader.ts"),W=j("./src/loader/key-loader.ts"),C=j("./src/controller/id3-track-controller.ts"),r=j("./src/controller/latency-controller.ts"),A=j("./src/controller/level-controller.ts"),v=j("./src/controller/fragment-tracker.ts"),f=j("./src/controller/stream-controller.ts"),p=j("./src/is-supported.ts"),l=j("./src/utils/logger.ts"),o=j("./src/config.ts"),s=j("./node_modules/eventemitter3/index.js"),t=j.n(s),u=j("./src/events.ts"),a=j("./src/errors.ts");function i(S,L){for(var P=0;P<L.length;P++){var _=L[P];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(S,_.key,_)}}function D(S,L,P){return L&&i(S.prototype,L),P&&i(S,P),S}var w=function(){S.isSupported=function(){return Object(p.isSupported)()};function S(P){P===void 0&&(P={}),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 _=this.config=Object(o.mergeConfig)(S.DefaultConfig,P);this.userConfig=P,Object(l.enableLogs)(_.debug),this._autoLevelCapping=-1,_.progressive&&Object(o.enableStreamingMode)(_);var b=_.abrController,g=_.bufferController,m=_.capLevelController,y=_.fpsController,x=this.abrController=new b(this),O=this.bufferController=new g(this),H=this.capLevelController=new m(this),F=new y(this),R=new I.default(this),U=new W.default(this),k=new C.default(this),d=this.levelController=new A.default(this),z=new v.FragmentTracker(this),Y=this.streamController=new f.default(this,z);H.setStreamController(Y),F.setStreamController(Y);var re=[d,Y];this.networkControllers=re;var le=[R,U,x,O,H,F,k,z];this.audioTrackController=this.createController(_.audioTrackController,null,re),this.createController(_.audioStreamController,z,re),this.subtitleTrackController=this.createController(_.subtitleTrackController,null,re),this.createController(_.subtitleStreamController,z,re),this.createController(_.timelineController,null,le),this.emeController=this.createController(_.emeController,null,le),this.cmcdController=this.createController(_.cmcdController,null,le),this.latencyController=this.createController(r.default,null,le),this.coreComponents=le}var L=S.prototype;return L.createController=function(_,b,g){if(_){var m=b?new _(this,b):new _(this);return g&&g.push(m),m}return null},L.on=function(_,b,g){g===void 0&&(g=this),this._emitter.on(_,b,g)},L.once=function(_,b,g){g===void 0&&(g=this),this._emitter.once(_,b,g)},L.removeAllListeners=function(_){this._emitter.removeAllListeners(_)},L.off=function(_,b,g,m){g===void 0&&(g=this),this._emitter.off(_,b,g,m)},L.listeners=function(_){return this._emitter.listeners(_)},L.emit=function(_,b,g){return this._emitter.emit(_,b,g)},L.trigger=function(_,b){if(this.config.debug)return this.emit(_,_,b);try{return this.emit(_,_,b)}catch(g){l.logger.error("An internal error happened while handling event "+_+'. Error message: "'+g.message+'". Here is a stacktrace:',g),this.trigger(u.Events.ERROR,{type:a.ErrorTypes.OTHER_ERROR,details:a.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:_,error:g})}return!1},L.listenerCount=function(_){return this._emitter.listenerCount(_)},L.destroy=function(){l.logger.log("destroy"),this.trigger(u.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(_){return _.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(_){return _.destroy()}),this.coreComponents.length=0},L.attachMedia=function(_){l.logger.log("attachMedia"),this._media=_,this.trigger(u.Events.MEDIA_ATTACHING,{media:_})},L.detachMedia=function(){l.logger.log("detachMedia"),this.trigger(u.Events.MEDIA_DETACHING,void 0),this._media=null},L.loadSource=function(_){this.stopLoad();var b=this.media,g=this.url,m=this.url=G.buildAbsoluteURL(self.location.href,_,{alwaysNormalize:!0});l.logger.log("loadSource:"+m),b&&g&&g!==m&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(b)),this.trigger(u.Events.MANIFEST_LOADING,{url:_})},L.startLoad=function(_){_===void 0&&(_=-1),l.logger.log("startLoad("+_+")"),this.networkControllers.forEach(function(b){b.startLoad(_)})},L.stopLoad=function(){l.logger.log("stopLoad"),this.networkControllers.forEach(function(_){_.stopLoad()})},L.swapAudioCodec=function(){l.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},L.recoverMediaError=function(){l.logger.log("recoverMediaError");var _=this._media;this.detachMedia(),_&&this.attachMedia(_)},L.removeLevel=function(_,b){b===void 0&&(b=0),this.levelController.removeLevel(_,b)},D(S,[{key:"levels",get:function(){var _=this.levelController.levels;return _||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(_){l.logger.log("set currentLevel:"+_),this.loadLevel=_,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(_){l.logger.log("set nextLevel:"+_),this.levelController.manualLevel=_,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(_){l.logger.log("set loadLevel:"+_),this.levelController.manualLevel=_}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(_){this.levelController.nextLoadLevel=_}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(_){l.logger.log("set firstLevel:"+_),this.levelController.firstLevel=_}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(_){l.logger.log("set startLevel:"+_),_!==-1&&(_=Math.max(_,this.minAutoLevel)),this.levelController.startLevel=_}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(_){var b=!!_;b!==this.config.capLevelToPlayerSize&&(b?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=b)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(_){this._autoLevelCapping!==_&&(l.logger.log("set autoLevelCapping:"+_),this._autoLevelCapping=_)}},{key:"bandwidthEstimate",get:function(){var _=this.abrController.bwEstimator;return _?_.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var _=this.levels,b=this.config.minAutoBitrate;if(!_)return 0;for(var g=_.length,m=0;m<g;m++)if(_[m].maxBitrate>b)return m;return 0}},{key:"maxAutoLevel",get:function(){var _=this.levels,b=this.autoLevelCapping,g;return b===-1&&_&&_.length?g=_.length-1:g=b,g}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(_){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,_)}},{key:"audioTracks",get:function(){var _=this.audioTrackController;return _?_.audioTracks:[]}},{key:"audioTrack",get:function(){var _=this.audioTrackController;return _?_.audioTrack:-1},set:function(_){var b=this.audioTrackController;b&&(b.audioTrack=_)}},{key:"subtitleTracks",get:function(){var _=this.subtitleTrackController;return _?_.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var _=this.subtitleTrackController;return _?_.subtitleTrack:-1},set:function(_){var b=this.subtitleTrackController;b&&(b.subtitleTrack=_)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var _=this.subtitleTrackController;return _?_.subtitleDisplay:!1},set:function(_){var b=this.subtitleTrackController;b&&(b.subtitleDisplay=_)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(_){this.config.lowLatencyMode=_}},{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 u.Events}},{key:"ErrorTypes",get:function(){return a.ErrorTypes}},{key:"ErrorDetails",get:function(){return a.ErrorDetails}},{key:"DefaultConfig",get:function(){return S.defaultConfig?S.defaultConfig:o.hlsDefaultConfig},set:function(_){S.defaultConfig=_}}]),S}();w.defaultConfig=void 0},"./src/is-supported.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"isSupported",function(){return I}),j.d(V,"changeTypeSupported",function(){return W});var G=j("./src/utils/mediasource-helper.ts");function M(){return self.SourceBuffer||self.WebKitSourceBuffer}function I(){var C=Object(G.getMediaSource)();if(!C)return!1;var r=M(),A=C&&typeof C.isTypeSupported=="function"&&C.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),v=!r||r.prototype&&typeof r.prototype.appendBuffer=="function"&&typeof r.prototype.remove=="function";return!!A&&!!v}function W(){var C,r=M();return typeof(r==null||((C=r.prototype)===null||C===void 0)?void 0:C.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"default",function(){return l}),j.d(V,"LoadError",function(){return s});var G=j("./src/polyfills/number.ts"),M=j("./src/errors.ts");function I(t,u){t.prototype=Object.create(u.prototype),t.prototype.constructor=t,v(t,u)}function W(t){var u=typeof Map=="function"?new Map:void 0;return W=function(i){if(i===null||!A(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof u!="undefined"){if(u.has(i))return u.get(i);u.set(i,D)}function D(){return C(i,arguments,f(this).constructor)}return D.prototype=Object.create(i.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),v(D,i)},W(t)}function C(t,u,a){return r()?C=Reflect.construct:C=function(D,w,S){var L=[null];L.push.apply(L,w);var P=Function.bind.apply(D,L),_=new P;return S&&v(_,S.prototype),_},C.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(t){return!1}}function A(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function v(t,u){return v=Object.setPrototypeOf||function(i,D){return i.__proto__=D,i},v(t,u)}function f(t){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},f(t)}var p=Math.pow(2,17),l=function(){function t(a){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=a}var u=t.prototype;return u.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},u.abort=function(){this.loader&&this.loader.abort()},u.load=function(i,D){var w=this,S=i.url;if(!S)return Promise.reject(new s({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:i,networkDetails:null},"Fragment does not have a "+(S?"part list":"url")));this.abort();var L=this.config,P=L.fLoader,_=L.loader;return new Promise(function(b,g){w.loader&&w.loader.destroy();var m=w.loader=i.loader=P?new P(L):new _(L),y=o(i),x={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:p};i.stats=m.stats,m.load(y,x,{onSuccess:function(H,F,R,U){w.resetLoader(i,m),b({frag:i,part:null,payload:H.data,networkDetails:U})},onError:function(H,F,R){w.resetLoader(i,m),g(new s({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:i,response:H,networkDetails:R}))},onAbort:function(H,F,R){w.resetLoader(i,m),g(new s({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:i,networkDetails:R}))},onTimeout:function(H,F,R){w.resetLoader(i,m),g(new s({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:i,networkDetails:R}))},onProgress:function(H,F,R,U){D&&D({frag:i,part:null,payload:R,networkDetails:U})}})})},u.loadPart=function(i,D,w){var S=this;this.abort();var L=this.config,P=L.fLoader,_=L.loader;return new Promise(function(b,g){S.loader&&S.loader.destroy();var m=S.loader=i.loader=P?new P(L):new _(L),y=o(i,D),x={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:p};D.stats=m.stats,m.load(y,x,{onSuccess:function(H,F,R,U){S.resetLoader(i,m),S.updateStatsFromPart(i,D);var k={frag:i,part:D,payload:H.data,networkDetails:U};w(k),b(k)},onError:function(H,F,R){S.resetLoader(i,m),g(new s({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:i,part:D,response:H,networkDetails:R}))},onAbort:function(H,F,R){i.stats.aborted=D.stats.aborted,S.resetLoader(i,m),g(new s({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:i,part:D,networkDetails:R}))},onTimeout:function(H,F,R){S.resetLoader(i,m),g(new s({type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:i,part:D,networkDetails:R}))}})})},u.updateStatsFromPart=function(i,D){var w=i.stats,S=D.stats,L=S.total;if(w.loaded+=S.loaded,L){var P=Math.round(i.duration/D.duration),_=Math.min(Math.round(w.loaded/L),P),b=P-_,g=b*Math.round(w.loaded/_);w.total=w.loaded+g}else w.total=Math.max(w.loaded,w.total);var m=w.loading,y=S.loading;m.start?m.first+=y.first-y.start:(m.start=y.start,m.first=y.first),m.end=y.end},u.resetLoader=function(i,D){i.loader=null,this.loader===D&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),D.destroy()},t}();function o(t,u){u===void 0&&(u=null);var a=u||t,i={frag:t,part:u,responseType:"arraybuffer",url:a.url,headers:{},rangeStart:0,rangeEnd:0},D=a.byteRangeStartOffset,w=a.byteRangeEndOffset;return Object(G.isFiniteNumber)(D)&&Object(G.isFiniteNumber)(w)&&(i.rangeStart=D,i.rangeEnd=w),i}var s=function(t){I(u,t);function u(a){for(var i,D=arguments.length,w=new Array(D>1?D-1:0),S=1;S<D;S++)w[S-1]=arguments[S];return i=t.call.apply(t,[this].concat(w))||this,i.data=void 0,i.data=a,i}return u}(W(Error))},"./src/loader/fragment.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"ElementaryStreamTypes",function(){return l}),j.d(V,"BaseSegment",function(){return o}),j.d(V,"Fragment",function(){return s}),j.d(V,"Part",function(){return t});var G=j("./src/polyfills/number.ts"),M=j("./node_modules/url-toolkit/src/url-toolkit.js"),I=j.n(M),W=j("./src/utils/logger.ts"),C=j("./src/loader/level-key.ts"),r=j("./src/loader/load-stats.ts");function A(u,a){u.prototype=Object.create(a.prototype),u.prototype.constructor=u,v(u,a)}function v(u,a){return v=Object.setPrototypeOf||function(D,w){return D.__proto__=w,D},v(u,a)}function f(u,a){for(var i=0;i<a.length;i++){var D=a[i];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(u,D.key,D)}}function p(u,a,i){return a&&f(u.prototype,a),i&&f(u,i),u}var l;(function(u){u.AUDIO="audio",u.VIDEO="video",u.AUDIOVIDEO="audiovideo"})(l||(l={}));var o=function(){function u(i){var D;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(D={},D[l.AUDIO]=null,D[l.VIDEO]=null,D[l.AUDIOVIDEO]=null,D),this.baseurl=i}var a=u.prototype;return a.setByteRange=function(D,w){var S=D.split("@",2),L=[];S.length===1?L[0]=w?w.byteRangeEndOffset:0:L[0]=parseInt(S[1]),L[1]=parseInt(S[0])+L[0],this._byteRange=L},p(u,[{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(M.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(D){this._url=D}}]),u}(),s=function(u){A(a,u);function a(D,w){var S;return S=u.call(this,w)||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=D,S}var i=a.prototype;return i.createInitializationVector=function(w){for(var S=new Uint8Array(16),L=12;L<16;L++)S[L]=w>>8*(15-L)&255;return S},i.setDecryptDataFromLevelKey=function(w,S){var L=w;return(w==null?void 0:w.method)==="AES-128"&&w.uri&&!w.iv&&(L=C.LevelKey.fromURI(w.uri),L.method=w.method,L.iv=this.createInitializationVector(S),L.keyFormat="identity"),L},i.setElementaryStreamInfo=function(w,S,L,P,_,b){b===void 0&&(b=!1);var g=this.elementaryStreams,m=g[w];if(!m){g[w]={startPTS:S,endPTS:L,startDTS:P,endDTS:_,partial:b};return}m.startPTS=Math.min(m.startPTS,S),m.endPTS=Math.max(m.endPTS,L),m.startDTS=Math.min(m.startDTS,P),m.endDTS=Math.max(m.endDTS,_)},i.clearElementaryStreamInfo=function(){var w=this.elementaryStreams;w[l.AUDIO]=null,w[l.VIDEO]=null,w[l.AUDIOVIDEO]=null},p(a,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var w=this.sn;typeof w!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&W.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),w=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,w)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(G.isFiniteNumber)(this.programDateTime))return null;var w=Object(G.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+w*1e3}},{key:"encrypted",get:function(){var w;return!!((w=this.decryptdata)!==null&&w!==void 0&&w.keyFormat&&this.decryptdata.uri)}}]),a}(o),t=function(u){A(a,u);function a(i,D,w,S,L){var P;P=u.call(this,w)||this,P.fragOffset=0,P.duration=0,P.gap=!1,P.independent=!1,P.relurl=void 0,P.fragment=void 0,P.index=void 0,P.stats=new r.LoadStats,P.duration=i.decimalFloatingPoint("DURATION"),P.gap=i.bool("GAP"),P.independent=i.bool("INDEPENDENT"),P.relurl=i.enumeratedString("URI"),P.fragment=D,P.index=S;var _=i.enumeratedString("BYTERANGE");return _&&P.setByteRange(_,L),L&&(P.fragOffset=L.fragOffset+L.duration),P}return p(a,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var D=this.elementaryStreams;return!!(D.audio||D.video||D.audiovideo)}}]),a}(o)},"./src/loader/key-loader.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"default",function(){return W});var G=j("./src/events.ts"),M=j("./src/errors.ts"),I=j("./src/utils/logger.ts"),W=function(){function C(A){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=A,this._registerListeners()}var r=C.prototype;return r._registerListeners=function(){this.hls.on(G.Events.KEY_LOADING,this.onKeyLoading,this)},r._unregisterListeners=function(){this.hls.off(G.Events.KEY_LOADING,this.onKeyLoading)},r.destroy=function(){this._unregisterListeners();for(var v in this.loaders){var f=this.loaders[v];f&&f.destroy()}this.loaders={}},r.onKeyLoading=function(v,f){var p=f.frag,l=p.type,o=this.loaders[l];if(!p.decryptdata){I.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var s=p.decryptdata.uri;if(s!==this.decrypturl||this.decryptkey===null){var t=this.hls.config;if(o&&(I.logger.warn("abort previous key loader for type:"+l),o.abort()),!s){I.logger.warn("key uri is falsy");return}var u=t.loader,a=p.loader=this.loaders[l]=new u(t);this.decrypturl=s,this.decryptkey=null;var i={url:s,frag:p,responseType:"arraybuffer"},D={timeout:t.fragLoadingTimeOut,maxRetry:0,retryDelay:t.fragLoadingRetryDelay,maxRetryDelay:t.fragLoadingMaxRetryTimeout,highWaterMark:0},w={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};a.load(i,D,w)}else this.decryptkey&&(p.decryptdata.key=this.decryptkey,this.hls.trigger(G.Events.KEY_LOADED,{frag:p}))},r.loadsuccess=function(v,f,p){var l=p.frag;if(!l.decryptdata){I.logger.error("after key load, decryptdata unset");return}this.decryptkey=l.decryptdata.key=new Uint8Array(v.data),l.loader=null,delete this.loaders[l.type],this.hls.trigger(G.Events.KEY_LOADED,{frag:l})},r.loaderror=function(v,f){var p=f.frag,l=p.loader;l&&l.abort(),delete this.loaders[p.type],this.hls.trigger(G.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:p,response:v})},r.loadtimeout=function(v,f){var p=f.frag,l=p.loader;l&&l.abort(),delete this.loaders[p.type],this.hls.trigger(G.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:p})},C}()},"./src/loader/level-details.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"LevelDetails",function(){return C});var G=j("./src/polyfills/number.ts");function M(r,A){for(var v=0;v<A.length;v++){var f=A[v];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(r,f.key,f)}}function I(r,A,v){return A&&M(r.prototype,A),v&&M(r,v),r}var W=10,C=function(){function r(v){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=v}var A=r.prototype;return A.reloaded=function(f){if(!f){this.advanced=!0,this.updated=!0;return}var p=this.lastPartSn-f.lastPartSn,l=this.lastPartIndex-f.lastPartIndex;this.updated=this.endSN!==f.endSN||!!l||!!p,this.advanced=this.endSN>f.endSN||p>0||p===0&&l>0,this.updated||this.advanced?this.misses=Math.floor(f.misses*.6):this.misses=f.misses+1,this.availabilityDelay=f.availabilityDelay},I(r,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(G.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||W}},{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(Z,V,j){"use strict";j.r(V),j.d(V,"LevelKey",function(){return C});var G=j("./node_modules/url-toolkit/src/url-toolkit.js"),M=j.n(G);function I(r,A){for(var v=0;v<A.length;v++){var f=A[v];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(r,f.key,f)}}function W(r,A,v){return A&&I(r.prototype,A),v&&I(r,v),r}var C=function(){r.fromURL=function(v,f){return new r(v,f)},r.fromURI=function(v){return new r(v)};function r(A,v){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,v?this._uri=Object(G.buildAbsoluteURL)(A,v,{alwaysNormalize:!0}):this._uri=A}return W(r,[{key:"uri",get:function(){return this._uri}}]),r}()},"./src/loader/load-stats.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"LoadStats",function(){return G});var G=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(Z,V,j){"use strict";j.r(V),j.d(V,"default",function(){return a});var G=j("./src/polyfills/number.ts"),M=j("./node_modules/url-toolkit/src/url-toolkit.js"),I=j.n(M),W=j("./src/loader/fragment.ts"),C=j("./src/loader/level-details.ts"),r=j("./src/loader/level-key.ts"),A=j("./src/utils/attr-list.ts"),v=j("./src/utils/logger.ts"),f=j("./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,l=/#EXT-X-MEDIA:(.*)/g,o=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("|")),t=/\.(mp4|m4s|m4v|m4a)$/i;function u(L){var P,_;return t.test((P=(_=M.parseURL(L))===null||_===void 0?void 0:_.path)!=null?P:"")}var a=function(){function L(){}return L.findGroup=function(_,b){for(var g=0;g<_.length;g++){var m=_[g];if(m.id===b)return m}},L.convertAVC1ToAVCOTI=function(_){var b=_.split(".");if(b.length>2){var g=b.shift()+".";return g+=parseInt(b.shift()).toString(16),g+=("000"+parseInt(b.shift()).toString(16)).substr(-4),g}return _},L.resolve=function(_,b){return M.buildAbsoluteURL(b,_,{alwaysNormalize:!0})},L.parseMasterPlaylist=function(_,b){var g=[],m={},y=!1;p.lastIndex=0;for(var x;(x=p.exec(_))!=null;)if(x[1]){var O=new A.AttrList(x[1]),H={attrs:O,bitrate:O.decimalInteger("AVERAGE-BANDWIDTH")||O.decimalInteger("BANDWIDTH"),name:O.NAME,url:L.resolve(x[2],b)},F=O.decimalResolution("RESOLUTION");F&&(H.width=F.width,H.height=F.height),i((O.CODECS||"").split(/[ ,]+/).filter(function(U){return U}),H),H.videoCodec&&H.videoCodec.indexOf("avc1")!==-1&&(H.videoCodec=L.convertAVC1ToAVCOTI(H.videoCodec)),g.push(H)}else if(x[3]){var R=new A.AttrList(x[3]);R["DATA-ID"]&&(y=!0,m[R["DATA-ID"]]=R)}return{levels:g,sessionData:y?m:null}},L.parseMasterPlaylistMedia=function(_,b,g,m){m===void 0&&(m=[]);var y,x=[],O=0;for(l.lastIndex=0;(y=l.exec(_))!==null;){var H=new A.AttrList(y[1]);if(H.TYPE===g){var F={attrs:H,bitrate:0,id:O++,groupId:H["GROUP-ID"],instreamId:H["INSTREAM-ID"],name:H.NAME||H.LANGUAGE||"",type:g,default:H.bool("DEFAULT"),autoselect:H.bool("AUTOSELECT"),forced:H.bool("FORCED"),lang:H.LANGUAGE,url:H.URI?L.resolve(H.URI,b):""};if(m.length){var R=L.findGroup(m,F.groupId)||m[0];D(F,R,"audioCodec"),D(F,R,"textCodec")}x.push(F)}}return x},L.parseLevelPlaylist=function(_,b,g,m,y){var x=new C.LevelDetails(b),O=x.fragments,H=null,F=0,R=0,U=0,k=0,d=null,z=new W.Fragment(m,b),Y,re,le,Ne=-1,Ce=!1;for(o.lastIndex=0,x.m3u8=_;(Y=o.exec(_))!==null;){Ce&&(Ce=!1,z=new W.Fragment(m,b),z.start=U,z.sn=F,z.cc=k,z.level=g,H&&(z.initSegment=H,z.rawProgramDateTime=H.rawProgramDateTime));var Te=Y[1];if(Te){z.duration=parseFloat(Te);var Fe=(" "+Y[2]).slice(1);z.title=Fe||null,z.tagList.push(Fe?["INF",Te,Fe]:["INF",Te])}else if(Y[3])Object(G.isFiniteNumber)(z.duration)&&(z.start=U,le&&(z.levelkey=le),z.sn=F,z.level=g,z.cc=k,z.urlId=y,O.push(z),z.relurl=(" "+Y[3]).slice(1),S(z,d),d=z,U+=z.duration,F++,R=0,Ce=!0);else if(Y[4]){var Ve=(" "+Y[4]).slice(1);d?z.setByteRange(Ve,d):z.setByteRange(Ve)}else if(Y[5])z.rawProgramDateTime=(" "+Y[5]).slice(1),z.tagList.push(["PROGRAM-DATE-TIME",z.rawProgramDateTime]),Ne===-1&&(Ne=O.length);else{if(Y=Y[0].match(s),!Y){v.logger.warn("No matches on slow regex match for level playlist!");continue}for(re=1;re<Y.length&&!(typeof Y[re]!="undefined");re++);var xe=(" "+Y[re]).slice(1),ye=(" "+Y[re+1]).slice(1),oe=Y[re+2]?(" "+Y[re+2]).slice(1):"";switch(xe){case"PLAYLIST-TYPE":x.type=ye.toUpperCase();break;case"MEDIA-SEQUENCE":F=x.startSN=parseInt(ye);break;case"SKIP":{var Se=new A.AttrList(ye),_e=Se.decimalInteger("SKIPPED-SEGMENTS");if(Object(G.isFiniteNumber)(_e)){x.skippedSegments=_e;for(var He=_e;He--;)O.unshift(null);F+=_e}var rt=Se.enumeratedString("RECENTLY-REMOVED-DATERANGES");rt&&(x.recentlyRemovedDateranges=rt.split(" "));break}case"TARGETDURATION":x.targetduration=parseFloat(ye);break;case"VERSION":x.version=parseInt(ye);break;case"EXTM3U":break;case"ENDLIST":x.live=!1;break;case"#":(ye||oe)&&z.tagList.push(oe?[ye,oe]:[ye]);break;case"DIS":k++;case"GAP":z.tagList.push([xe]);break;case"BITRATE":z.tagList.push([xe,ye]);break;case"DISCONTINUITY-SEQ":k=parseInt(ye);break;case"KEY":{var ae,$=new A.AttrList(ye),Q=$.enumeratedString("METHOD"),te=$.URI,he=$.hexadecimalInteger("IV"),ge=$.enumeratedString("KEYFORMATVERSIONS"),we=$.enumeratedString("KEYID"),ft=(ae=$.enumeratedString("KEYFORMAT"))!=null?ae:"identity",Pt=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Pt.indexOf(ft)>-1){v.logger.warn("Keyformat "+ft+" is not supported from the manifest");continue}else if(ft!=="identity")continue;Q&&(le=r.LevelKey.fromURL(b,te),te&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Q)>=0&&(le.method=Q,le.keyFormat=ft,we&&(le.keyID=we),ge&&(le.keyFormatVersions=ge),le.iv=he));break}case"START":{var jt=new A.AttrList(ye),qe=jt.decimalFloatingPoint("TIME-OFFSET");Object(G.isFiniteNumber)(qe)&&(x.startTimeOffset=qe);break}case"MAP":{var Mt=new A.AttrList(ye);z.relurl=Mt.URI,Mt.BYTERANGE&&z.setByteRange(Mt.BYTERANGE),z.level=g,z.sn="initSegment",le&&(z.levelkey=le),z.initSegment=null,H=z,Ce=!0;break}case"SERVER-CONTROL":{var sn=new A.AttrList(ye);x.canBlockReload=sn.bool("CAN-BLOCK-RELOAD"),x.canSkipUntil=sn.optionalFloat("CAN-SKIP-UNTIL",0),x.canSkipDateRanges=x.canSkipUntil>0&&sn.bool("CAN-SKIP-DATERANGES"),x.partHoldBack=sn.optionalFloat("PART-HOLD-BACK",0),x.holdBack=sn.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var at=new A.AttrList(ye);x.partTarget=at.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Qe=x.partList;Qe||(Qe=x.partList=[]);var Et=R>0?Qe[Qe.length-1]:void 0,It=R++,dt=new W.Part(new A.AttrList(ye),z,b,It,Et);Qe.push(dt),z.duration+=dt.duration;break}case"PRELOAD-HINT":{var mt=new A.AttrList(ye);x.preloadHint=mt;break}case"RENDITION-REPORT":{var We=new A.AttrList(ye);x.renditionReports=x.renditionReports||[],x.renditionReports.push(We);break}default:v.logger.warn("line parsed but not handled: "+Y);break}}}d&&!d.relurl?(O.pop(),U-=d.duration,x.partList&&(x.fragmentHint=d)):x.partList&&(S(z,d),z.cc=k,x.fragmentHint=z);var De=O.length,Le=O[0],de=O[De-1];if(U+=x.skippedSegments*x.targetduration,U>0&&De&&de){x.averagetargetduration=U/De;var fe=de.sn;x.endSN=fe!=="initSegment"?fe:0,Le&&(x.startCC=Le.cc,Le.initSegment||x.fragments.every(function(Ee){return Ee.relurl&&u(Ee.relurl)})&&(v.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),z=new W.Fragment(m,b),z.relurl=de.relurl,z.level=g,z.sn="initSegment",Le.initSegment=z,x.needSidxRanges=!0))}else x.endSN=0,x.startCC=0;return x.fragmentHint&&(U+=x.fragmentHint.duration),x.totalduration=U,x.endCC=k,Ne>0&&w(O,Ne),x},L}();function i(L,P){["video","audio","text"].forEach(function(_){var b=L.filter(function(m){return Object(f.isCodecType)(m,_)});if(b.length){var g=b.filter(function(m){return m.lastIndexOf("avc1",0)===0||m.lastIndexOf("mp4a",0)===0});P[_+"Codec"]=g.length>0?g[0]:b[0],L=L.filter(function(m){return b.indexOf(m)===-1})}}),P.unknownCodecs=L}function D(L,P,_){var b=P[_];b&&(L[_]=b)}function w(L,P){for(var _=L[P],b=P;b--;){var g=L[b];if(!g)return;g.programDateTime=_.programDateTime-g.duration*1e3,_=g}}function S(L,P){L.rawProgramDateTime?L.programDateTime=Date.parse(L.rawProgramDateTime):P!=null&&P.programDateTime&&(L.programDateTime=P.endProgramDateTime),Object(G.isFiniteNumber)(L.programDateTime)||(L.programDateTime=null,L.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(Z,V,j){"use strict";j.r(V);var G=j("./src/polyfills/number.ts"),M=j("./src/events.ts"),I=j("./src/errors.ts"),W=j("./src/utils/logger.ts"),C=j("./src/utils/mp4-tools.ts"),r=j("./src/loader/m3u8-parser.ts"),A=j("./src/types/loader.ts"),v=j("./src/utils/attr-list.ts");function f(o){var s=o.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(o,s){var t=o.url;return(t===void 0||t.indexOf("data:")===0)&&(t=s.url),t}var l=function(){function o(t){this.hls=void 0,this.loaders=Object.create(null),this.hls=t,this.registerListeners()}var s=o.prototype;return s.registerListeners=function(){var u=this.hls;u.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(M.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(M.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.on(M.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},s.unregisterListeners=function(){var u=this.hls;u.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(M.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(M.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.off(M.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},s.createInternalLoader=function(u){var a=this.hls.config,i=a.pLoader,D=a.loader,w=i||D,S=new w(a);return u.loader=S,this.loaders[u.type]=S,S},s.getInternalLoader=function(u){return this.loaders[u.type]},s.resetInternalLoader=function(u){this.loaders[u]&&delete this.loaders[u]},s.destroyInternalLoaders=function(){for(var u in this.loaders){var a=this.loaders[u];a&&a.destroy(),this.resetInternalLoader(u)}},s.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},s.onManifestLoading=function(u,a){var i=a.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:A.PlaylistContextType.MANIFEST,url:i,deliveryDirectives:null})},s.onLevelLoading=function(u,a){var i=a.id,D=a.level,w=a.url,S=a.deliveryDirectives;this.load({id:i,groupId:null,level:D,responseType:"text",type:A.PlaylistContextType.LEVEL,url:w,deliveryDirectives:S})},s.onAudioTrackLoading=function(u,a){var i=a.id,D=a.groupId,w=a.url,S=a.deliveryDirectives;this.load({id:i,groupId:D,level:null,responseType:"text",type:A.PlaylistContextType.AUDIO_TRACK,url:w,deliveryDirectives:S})},s.onSubtitleTrackLoading=function(u,a){var i=a.id,D=a.groupId,w=a.url,S=a.deliveryDirectives;this.load({id:i,groupId:D,level:null,responseType:"text",type:A.PlaylistContextType.SUBTITLE_TRACK,url:w,deliveryDirectives:S})},s.load=function(u){var a,i=this.hls.config,D=this.getInternalLoader(u);if(D){var w=D.context;if(w&&w.url===u.url){W.logger.trace("[playlist-loader]: playlist request ongoing");return}W.logger.log("[playlist-loader]: aborting previous loader for type: "+u.type),D.abort()}var S,L,P,_;switch(u.type){case A.PlaylistContextType.MANIFEST:S=i.manifestLoadingMaxRetry,L=i.manifestLoadingTimeOut,P=i.manifestLoadingRetryDelay,_=i.manifestLoadingMaxRetryTimeout;break;case A.PlaylistContextType.LEVEL:case A.PlaylistContextType.AUDIO_TRACK:case A.PlaylistContextType.SUBTITLE_TRACK:S=0,L=i.levelLoadingTimeOut;break;default:S=i.levelLoadingMaxRetry,L=i.levelLoadingTimeOut,P=i.levelLoadingRetryDelay,_=i.levelLoadingMaxRetryTimeout;break}if(D=this.createInternalLoader(u),(a=u.deliveryDirectives)!==null&&a!==void 0&&a.part){var b;if(u.type===A.PlaylistContextType.LEVEL&&u.level!==null?b=this.hls.levels[u.level].details:u.type===A.PlaylistContextType.AUDIO_TRACK&&u.id!==null?b=this.hls.audioTracks[u.id].details:u.type===A.PlaylistContextType.SUBTITLE_TRACK&&u.id!==null&&(b=this.hls.subtitleTracks[u.id].details),b){var g=b.partTarget,m=b.targetduration;g&&m&&(L=Math.min(Math.max(g*3,m*.8)*1e3,L))}}var y={timeout:L,maxRetry:S,retryDelay:P,maxRetryDelay:_,highWaterMark:0},x={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};D.load(u,y,x)},s.loadsuccess=function(u,a,i,D){if(D===void 0&&(D=null),i.isSidxRequest){this.handleSidxRequest(u,i),this.handlePlaylistLoaded(u,a,i,D);return}this.resetInternalLoader(i.type);var w=u.data;if(w.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(u,i,"no EXTM3U delimiter",D);return}a.parsing.start=performance.now(),w.indexOf("#EXTINF:")>0||w.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(u,a,i,D):this.handleMasterPlaylist(u,a,i,D)},s.loaderror=function(u,a,i){i===void 0&&(i=null),this.handleNetworkError(a,i,!1,u)},s.loadtimeout=function(u,a,i){i===void 0&&(i=null),this.handleNetworkError(a,i,!0)},s.handleMasterPlaylist=function(u,a,i,D){var w=this.hls,S=u.data,L=p(u,i),P=r.default.parseMasterPlaylist(S,L),_=P.levels,b=P.sessionData;if(!_.length){this.handleManifestParsingError(u,i,"no level found in manifest",D);return}var g=_.map(function(F){return{id:F.attrs.AUDIO,audioCodec:F.audioCodec}}),m=_.map(function(F){return{id:F.attrs.SUBTITLES,textCodec:F.textCodec}}),y=r.default.parseMasterPlaylistMedia(S,L,"AUDIO",g),x=r.default.parseMasterPlaylistMedia(S,L,"SUBTITLES",m),O=r.default.parseMasterPlaylistMedia(S,L,"CLOSED-CAPTIONS");if(y.length){var H=y.some(function(F){return!F.url});!H&&_[0].audioCodec&&!_[0].attrs.AUDIO&&(W.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),y.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new v.AttrList({}),bitrate:0,url:""}))}w.trigger(M.Events.MANIFEST_LOADED,{levels:_,audioTracks:y,subtitles:x,captions:O,url:L,stats:a,networkDetails:D,sessionData:b})},s.handleTrackOrLevelPlaylist=function(u,a,i,D){var w=this.hls,S=i.id,L=i.level,P=i.type,_=p(u,i),b=Object(G.isFiniteNumber)(S)?S:0,g=Object(G.isFiniteNumber)(L)?L:b,m=f(i),y=r.default.parseLevelPlaylist(u.data,_,g,m,b);if(!y.fragments.length){w.trigger(M.Events.ERROR,{type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:_,reason:"no fragments found in level",level:typeof i.level=="number"?i.level:void 0});return}if(P===A.PlaylistContextType.MANIFEST){var x={attrs:new v.AttrList({}),bitrate:0,details:y,name:"",url:_};w.trigger(M.Events.MANIFEST_LOADED,{levels:[x],audioTracks:[],url:_,stats:a,networkDetails:D,sessionData:null})}if(a.parsing.end=performance.now(),y.needSidxRanges){var O,H=(O=y.fragments[0].initSegment)===null||O===void 0?void 0:O.url;this.load({url:H,isSidxRequest:!0,type:P,level:L,levelDetails:y,id:S,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}i.levelDetails=y,this.handlePlaylistLoaded(u,a,i,D)},s.handleSidxRequest=function(u,a){var i=Object(C.parseSegmentIndex)(new Uint8Array(u.data));if(!i)return;var D=i.references,w=a.levelDetails;D.forEach(function(S,L){var P=S.info,_=w.fragments[L];_.byteRange.length===0&&_.setByteRange(String(1+P.end-P.start)+"@"+String(P.start)),_.initSegment&&_.initSegment.setByteRange(String(i.moovEndOffset)+"@0")})},s.handleManifestParsingError=function(u,a,i,D){this.hls.trigger(M.Events.ERROR,{type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:a.type===A.PlaylistContextType.MANIFEST,url:u.url,reason:i,response:u,context:a,networkDetails:D})},s.handleNetworkError=function(u,a,i,D){i===void 0&&(i=!1),W.logger.warn("[playlist-loader]: A network "+(i?"timeout":"error")+" occurred while loading "+u.type+" level: "+u.level+" id: "+u.id+' group-id: "'+u.groupId+'"');var w=I.ErrorDetails.UNKNOWN,S=!1,L=this.getInternalLoader(u);switch(u.type){case A.PlaylistContextType.MANIFEST:w=i?I.ErrorDetails.MANIFEST_LOAD_TIMEOUT:I.ErrorDetails.MANIFEST_LOAD_ERROR,S=!0;break;case A.PlaylistContextType.LEVEL:w=i?I.ErrorDetails.LEVEL_LOAD_TIMEOUT:I.ErrorDetails.LEVEL_LOAD_ERROR,S=!1;break;case A.PlaylistContextType.AUDIO_TRACK:w=i?I.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:I.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,S=!1;break;case A.PlaylistContextType.SUBTITLE_TRACK:w=i?I.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:I.ErrorDetails.SUBTITLE_LOAD_ERROR,S=!1;break}L&&this.resetInternalLoader(u.type);var P={type:I.ErrorTypes.NETWORK_ERROR,details:w,fatal:S,url:u.url,loader:L,context:u,networkDetails:a};D&&(P.response=D),this.hls.trigger(M.Events.ERROR,P)},s.handlePlaylistLoaded=function(u,a,i,D){var w=i.type,S=i.level,L=i.id,P=i.groupId,_=i.loader,b=i.levelDetails,g=i.deliveryDirectives;if(!(b!=null&&b.targetduration)){this.handleManifestParsingError(u,i,"invalid target duration",D);return}if(!_)return;b.live&&(_.getCacheAge&&(b.ageHeader=_.getCacheAge()||0),(!_.getCacheAge||isNaN(b.ageHeader))&&(b.ageHeader=0));switch(w){case A.PlaylistContextType.MANIFEST:case A.PlaylistContextType.LEVEL:this.hls.trigger(M.Events.LEVEL_LOADED,{details:b,level:S||0,id:L||0,stats:a,networkDetails:D,deliveryDirectives:g});break;case A.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(M.Events.AUDIO_TRACK_LOADED,{details:b,id:L||0,groupId:P||"",stats:a,networkDetails:D,deliveryDirectives:g});break;case A.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(M.Events.SUBTITLE_TRACK_LOADED,{details:b,id:L||0,groupId:P||"",stats:a,networkDetails:D,deliveryDirectives:g});break}},o}();V.default=l},"./src/polyfills/number.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"isFiniteNumber",function(){return G}),j.d(V,"MAX_SAFE_INTEGER",function(){return M});var G=Number.isFinite||function(I){return typeof I=="number"&&isFinite(I)},M=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(Z,V,j){"use strict";j.r(V);var G=function(){function M(){}return M.getSilentFrame=function(W,C){switch(W){case"mp4a.40.2":if(C===1)return new Uint8Array([0,200,0,128,35,128]);if(C===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(C===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(C===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(C===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(C===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(C===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(C===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(C===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},M}();V.default=G},"./src/remux/mp4-generator.ts":function(Z,V,j){"use strict";j.r(V);var G=Math.pow(2,32)-1,M=function(){function I(){}return I.init=function(){I.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 C;for(C in I.types)I.types.hasOwnProperty(C)&&(I.types[C]=[C.charCodeAt(0),C.charCodeAt(1),C.charCodeAt(2),C.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]);I.HDLR_TYPES={video:r,audio:A};var v=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]);I.STTS=I.STSC=I.STCO=f,I.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),I.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),I.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),I.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var p=new Uint8Array([105,115,111,109]),l=new Uint8Array([97,118,99,49]),o=new Uint8Array([0,0,0,1]);I.FTYP=I.box(I.types.ftyp,p,o,p,l),I.DINF=I.box(I.types.dinf,I.box(I.types.dref,v))},I.box=function(C){for(var r=8,A=arguments.length,v=new Array(A>1?A-1:0),f=1;f<A;f++)v[f-1]=arguments[f];for(var p=v.length,l=p;p--;)r+=v[p].byteLength;var o=new Uint8Array(r);for(o[0]=r>>24&255,o[1]=r>>16&255,o[2]=r>>8&255,o[3]=r&255,o.set(C,4),p=0,r=8;p<l;p++)o.set(v[p],r),r+=v[p].byteLength;return o},I.hdlr=function(C){return I.box(I.types.hdlr,I.HDLR_TYPES[C])},I.mdat=function(C){return I.box(I.types.mdat,C)},I.mdhd=function(C,r){r*=C;var A=Math.floor(r/(G+1)),v=Math.floor(r%(G+1));return I.box(I.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,C>>24&255,C>>16&255,C>>8&255,C&255,A>>24,A>>16&255,A>>8&255,A&255,v>>24,v>>16&255,v>>8&255,v&255,85,196,0,0]))},I.mdia=function(C){return I.box(I.types.mdia,I.mdhd(C.timescale,C.duration),I.hdlr(C.type),I.minf(C))},I.mfhd=function(C){return I.box(I.types.mfhd,new Uint8Array([0,0,0,0,C>>24,C>>16&255,C>>8&255,C&255]))},I.minf=function(C){return C.type==="audio"?I.box(I.types.minf,I.box(I.types.smhd,I.SMHD),I.DINF,I.stbl(C)):I.box(I.types.minf,I.box(I.types.vmhd,I.VMHD),I.DINF,I.stbl(C))},I.moof=function(C,r,A){return I.box(I.types.moof,I.mfhd(C),I.traf(A,r))},I.moov=function(C){for(var r=C.length,A=[];r--;)A[r]=I.trak(C[r]);return I.box.apply(null,[I.types.moov,I.mvhd(C[0].timescale,C[0].duration)].concat(A).concat(I.mvex(C)))},I.mvex=function(C){for(var r=C.length,A=[];r--;)A[r]=I.trex(C[r]);return I.box.apply(null,[I.types.mvex].concat(A))},I.mvhd=function(C,r){r*=C;var A=Math.floor(r/(G+1)),v=Math.floor(r%(G+1)),f=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,C>>24&255,C>>16&255,C>>8&255,C&255,A>>24,A>>16&255,A>>8&255,A&255,v>>24,v>>16&255,v>>8&255,v&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 I.box(I.types.mvhd,f)},I.sdtp=function(C){var r=C.samples||[],A=new Uint8Array(4+r.length),v,f;for(v=0;v<r.length;v++)f=r[v].flags,A[v+4]=f.dependsOn<<4|f.isDependedOn<<2|f.hasRedundancy;return I.box(I.types.sdtp,A)},I.stbl=function(C){return I.box(I.types.stbl,I.stsd(C),I.box(I.types.stts,I.STTS),I.box(I.types.stsc,I.STSC),I.box(I.types.stsz,I.STSZ),I.box(I.types.stco,I.STCO))},I.avc1=function(C){var r=[],A=[],v,f,p;for(v=0;v<C.sps.length;v++)f=C.sps[v],p=f.byteLength,r.push(p>>>8&255),r.push(p&255),r=r.concat(Array.prototype.slice.call(f));for(v=0;v<C.pps.length;v++)f=C.pps[v],p=f.byteLength,A.push(p>>>8&255),A.push(p&255),A=A.concat(Array.prototype.slice.call(f));var l=I.box(I.types.avcC,new Uint8Array([1,r[3],r[4],r[5],252|3,224|C.sps.length].concat(r).concat([C.pps.length]).concat(A))),o=C.width,s=C.height,t=C.pixelRatio[0],u=C.pixelRatio[1];return I.box(I.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,o>>8&255,o&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]),l,I.box(I.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),I.box(I.types.pasp,new Uint8Array([t>>24,t>>16&255,t>>8&255,t&255,u>>24,u>>16&255,u>>8&255,u&255])))},I.esds=function(C){var r=C.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(C.config).concat([6,1,2]))},I.mp4a=function(C){var r=C.samplerate;return I.box(I.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,C.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]),I.box(I.types.esds,I.esds(C)))},I.mp3=function(C){var r=C.samplerate;return I.box(I.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,C.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]))},I.stsd=function(C){return C.type==="audio"?!C.isAAC&&C.codec==="mp3"?I.box(I.types.stsd,I.STSD,I.mp3(C)):I.box(I.types.stsd,I.STSD,I.mp4a(C)):I.box(I.types.stsd,I.STSD,I.avc1(C))},I.tkhd=function(C){var r=C.id,A=C.duration*C.timescale,v=C.width,f=C.height,p=Math.floor(A/(G+1)),l=Math.floor(A%(G+1));return I.box(I.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,l>>24,l>>16&255,l>>8&255,l&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,v>>8&255,v&255,0,0,f>>8&255,f&255,0,0]))},I.traf=function(C,r){var A=I.sdtp(C),v=C.id,f=Math.floor(r/(G+1)),p=Math.floor(r%(G+1));return I.box(I.types.traf,I.box(I.types.tfhd,new Uint8Array([0,0,0,0,v>>24,v>>16&255,v>>8&255,v&255])),I.box(I.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])),I.trun(C,A.length+16+20+8+16+8+8),A)},I.trak=function(C){return C.duration=C.duration||4294967295,I.box(I.types.trak,I.tkhd(C),I.mdia(C))},I.trex=function(C){var r=C.id;return I.box(I.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]))},I.trun=function(C,r){var A=C.samples||[],v=A.length,f=12+16*v,p=new Uint8Array(f),l,o,s,t,u,a;for(r+=8+f,p.set([0,0,15,1,v>>>24&255,v>>>16&255,v>>>8&255,v&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255],0),l=0;l<v;l++)o=A[l],s=o.duration,t=o.size,u=o.flags,a=o.cts,p.set([s>>>24&255,s>>>16&255,s>>>8&255,s&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.paddingValue<<1|u.isNonSync,u.degradPrio&240<<8,u.degradPrio&15,a>>>24&255,a>>>16&255,a>>>8&255,a&255],12+16*l);return I.box(I.types.trun,p)},I.initSegment=function(C){I.types||I.init();var r=I.moov(C),A=new Uint8Array(I.FTYP.byteLength+r.byteLength);return A.set(I.FTYP),A.set(r,I.FTYP.byteLength),A},I}();M.types=void 0,M.HDLR_TYPES=void 0,M.STTS=void 0,M.STSC=void 0,M.STCO=void 0,M.STSZ=void 0,M.VMHD=void 0,M.SMHD=void 0,M.STSD=void 0,M.FTYP=void 0,M.DINF=void 0,V.default=M},"./src/remux/mp4-remuxer.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"default",function(){return a}),j.d(V,"normalizePts",function(){return i});var G=j("./src/polyfills/number.ts"),M=j("./src/remux/aac-helper.ts"),I=j("./src/remux/mp4-generator.ts"),W=j("./src/events.ts"),C=j("./src/errors.ts"),r=j("./src/utils/logger.ts"),A=j("./src/types/loader.ts"),v=j("./src/utils/timescale-conversion.ts");function f(){return f=Object.assign||function(L){for(var P=1;P<arguments.length;P++){var _=arguments[P];for(var b in _)Object.prototype.hasOwnProperty.call(_,b)&&(L[b]=_[b])}return L},f.apply(this,arguments)}var p=10*1e3,l=1024,o=1152,s=null,t=null,u=!1,a=function(){function L(_,b,g,m){if(m===void 0&&(m=""),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=_,this.config=b,this.typeSupported=g,this.ISGenerated=!1,s===null){var y=navigator.userAgent||"",x=y.match(/Chrome\/(\d+)/i);s=x?parseInt(x[1]):0}if(t===null){var O=navigator.userAgent.match(/Safari\/(\d+)/i);t=O?parseInt(O[1]):0}u=!!s&&s<75||!!t&&t<600}var P=L.prototype;return P.destroy=function(){},P.resetTimeStamp=function(b){r.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=b},P.resetNextTimestamp=function(){r.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},P.resetInitSegment=function(){r.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},P.getVideoStartPts=function(b){var g=!1,m=b.reduce(function(y,x){var O=x.pts-y;return O<-4294967296?(g=!0,i(y,x.pts)):O>0?y:x.pts},b[0].pts);return g&&r.logger.debug("PTS rollover detected"),m},P.remux=function(b,g,m,y,x,O,H,F){var R,U,k,d,z,Y,re=x,le=x,Ne=b.pid>-1,Ce=g.pid>-1,Te=g.samples.length,Fe=b.samples.length>0,Ve=Te>1,xe=(!Ne||Fe)&&(!Ce||Ve)||this.ISGenerated||H;if(xe){this.ISGenerated||(k=this.generateIS(b,g,x));var ye=this.isVideoContiguous,oe=-1;if(Ve&&(oe=D(g.samples),!ye&&this.config.forceKeyFrameOnDiscontinuity))if(Y=!0,oe>0){r.logger.warn("[mp4-remuxer]: Dropped "+oe+" out of "+Te+" video samples due to a missing keyframe");var Se=this.getVideoStartPts(g.samples);g.samples=g.samples.slice(oe),g.dropped+=oe,le+=(g.samples[0].pts-Se)/(g.timescale||9e4)}else oe===-1&&(r.logger.warn("[mp4-remuxer]: No keyframe found out of "+Te+" video samples"),Y=!1);if(this.ISGenerated){if(Fe&&Ve){var _e=this.getVideoStartPts(g.samples),He=i(b.samples[0].pts,_e)-_e,rt=He/g.inputTimeScale;re+=Math.max(0,rt),le+=Math.max(0,-rt)}if(Fe){if(b.samplerate||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),k=this.generateIS(b,g,x)),U=this.remuxAudio(b,re,this.isAudioContiguous,O,Ce||Ve||F===A.PlaylistLevelType.AUDIO?le:void 0),Ve){var ae=U?U.endPTS-U.startPTS:0;g.inputTimeScale||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),k=this.generateIS(b,g,x)),R=this.remuxVideo(g,le,ye,ae)}}else Ve&&(R=this.remuxVideo(g,le,ye,0));R&&(R.firstKeyFrame=oe,R.independent=oe!==-1)}}return this.ISGenerated&&(m.samples.length&&(z=this.remuxID3(m,x)),y.samples.length&&(d=this.remuxText(y,x))),{audio:U,video:R,initSegment:k,independent:Y,text:d,id3:z}},P.generateIS=function(b,g,m){var y=b.samples,x=g.samples,O=this.typeSupported,H={},F=!Object(G.isFiniteNumber)(this._initPTS),R="audio/mp4",U,k,d;if(F&&(U=k=Infinity),b.config&&y.length&&(b.timescale=b.samplerate,b.isAAC||(O.mpeg?(R="audio/mpeg",b.codec=""):O.mp3&&(b.codec="mp3")),H.audio={id:"audio",container:R,codec:b.codec,initSegment:!b.isAAC&&O.mpeg?new Uint8Array(0):I.default.initSegment([b]),metadata:{channelCount:b.channelCount}},F&&(d=b.inputTimeScale,U=k=y[0].pts-Math.round(d*m))),g.sps&&g.pps&&x.length&&(g.timescale=g.inputTimeScale,H.video={id:"main",container:"video/mp4",codec:g.codec,initSegment:I.default.initSegment([g]),metadata:{width:g.width,height:g.height}},F)){d=g.inputTimeScale;var z=this.getVideoStartPts(x),Y=Math.round(d*m);k=Math.min(k,i(x[0].dts,z)-Y),U=Math.min(U,z-Y)}if(Object.keys(H).length)return this.ISGenerated=!0,F&&(this._initPTS=U,this._initDTS=k),{tracks:H,initPTS:U,timescale:d}},P.remuxVideo=function(b,g,m,y){var x=b.inputTimeScale,O=b.samples,H=[],F=O.length,R=this._initPTS,U=this.nextAvcDts,k=8,d,z,Y,re=Number.POSITIVE_INFINITY,le=Number.NEGATIVE_INFINITY,Ne=0,Ce=!1;if(!m||U===null){var Te=g*x,Fe=O[0].pts-i(O[0].dts,O[0].pts);U=Te-Fe}for(var Ve=0;Ve<F;Ve++){var xe=O[Ve];if(xe.pts=i(xe.pts-R,U),xe.dts=i(xe.dts-R,U),xe.dts>xe.pts){var ye=9e4*.2;Ne=Math.max(Math.min(Ne,xe.pts-xe.dts),-1*ye)}xe.dts<O[Ve>0?Ve-1:Ve].dts&&(Ce=!0)}Ce&&O.sort(function(Gt,xt){var Rt=Gt.dts-xt.dts,gt=Gt.pts-xt.pts;return Rt||gt}),z=O[0].dts,Y=O[O.length-1].dts;var oe=Math.round((Y-z)/(F-1));if(Ne<0){if(Ne<oe*-2){r.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(v.toMsFromMpegTsClock)(-oe,!0)+" ms");for(var Se=Ne,_e=0;_e<F;_e++)O[_e].dts=Se=Math.max(Se,O[_e].pts-oe),O[_e].pts=Math.max(Se,O[_e].pts)}else{r.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(v.toMsFromMpegTsClock)(Ne,!0)+" ms to overcome this issue");for(var He=0;He<F;He++)O[He].dts=O[He].dts+Ne}z=O[0].dts}if(m){var rt=z-U,ae=rt>oe,$=rt<-1;if(ae||$){ae?r.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(rt,!0)+" ms ("+rt+"dts) hole between fragments detected, filling it"):r.logger.warn("AVC: "+Object(v.toMsFromMpegTsClock)(-rt,!0)+" ms ("+rt+"dts) overlapping between fragments detected"),z=U;var Q=O[0].pts-rt;O[0].dts=z,O[0].pts=Q,r.logger.log("Video: First PTS/DTS adjusted: "+Object(v.toMsFromMpegTsClock)(Q,!0)+"/"+Object(v.toMsFromMpegTsClock)(z,!0)+", delta: "+Object(v.toMsFromMpegTsClock)(rt,!0)+" ms")}}u&&(z=Math.max(0,z));for(var te=0,he=0,ge=0;ge<F;ge++){for(var we=O[ge],ft=we.units,Pt=ft.length,jt=0,qe=0;qe<Pt;qe++)jt+=ft[qe].data.length;he+=jt,te+=Pt,we.length=jt,we.dts=Math.max(we.dts,z),we.pts=Math.max(we.pts,we.dts,0),re=Math.min(we.pts,re),le=Math.max(we.pts,le)}Y=O[F-1].dts;var Mt=he+4*te+8,sn;try{sn=new Uint8Array(Mt)}catch(Gt){this.observer.emit(W.Events.ERROR,W.Events.ERROR,{type:C.ErrorTypes.MUX_ERROR,details:C.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Mt,reason:"fail allocating video mdat "+Mt});return}var at=new DataView(sn.buffer);at.setUint32(0,Mt),sn.set(I.default.types.mdat,4);for(var Qe=0;Qe<F;Qe++){for(var Et=O[Qe],It=Et.units,dt=0,mt=0,We=It.length;mt<We;mt++){var De=It[mt],Le=De.data,de=De.data.byteLength;at.setUint32(k,de),k+=4,sn.set(Le,k),k+=de,dt+=4+de}if(Qe<F-1)d=O[Qe+1].dts-Et.dts;else{var fe=this.config,Ee=Et.dts-O[Qe>0?Qe-1:Qe].dts;if(fe.stretchShortVideoTrack&&this.nextAudioPts!==null){var Pe=Math.floor(fe.maxBufferHole*x),Ue=(y?re+y*x:this.nextAudioPts)-Et.pts;Ue>Pe?(d=Ue-Ee,d<0&&(d=Ee),r.logger.log("[mp4-remuxer]: It is approximately "+Ue/90+" ms to the next segment; using duration "+d/90+" ms for the last video frame.")):d=Ee}else d=Ee}var lt=Math.round(Et.pts-Et.dts);H.push(new w(Et.key,d,dt,lt))}if(H.length&&s&&s<70){var Ot=H[0].flags;Ot.dependsOn=2,Ot.isNonSync=0}console.assert(d!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=U=Y+d,this.isVideoContiguous=!0;var cn=I.default.moof(b.sequenceNumber++,z,f({},b,{samples:H})),An="video",Ct={data1:cn,data2:sn,startPTS:re/x,endPTS:(le+d)/x,startDTS:z/x,endDTS:U/x,type:An,hasAudio:!1,hasVideo:!0,nb:H.length,dropped:b.dropped};return b.samples=[],b.dropped=0,console.assert(sn.length,"MDAT length must not be zero"),Ct},P.remuxAudio=function(b,g,m,y,x){var O=b.inputTimeScale,H=b.samplerate?b.samplerate:O,F=O/H,R=b.isAAC?l:o,U=R*F,k=this._initPTS,d=!b.isAAC&&this.typeSupported.mpeg,z=[],Y=b.samples,re=d?0:8,le=this.nextAudioPts||-1,Ne=g*O;if(this.isAudioContiguous=m=m||Y.length&&le>0&&(y&&Math.abs(Ne-le)<9e3||Math.abs(i(Y[0].pts-k,Ne)-le)<20*U),Y.forEach(function(Le){Le.pts=i(Le.pts-k,Ne)}),!m||le<0){if(Y=Y.filter(function(Le){return Le.pts>=0}),!Y.length)return;x===0?le=0:y?le=Math.max(0,Ne):le=Y[0].pts}if(b.isAAC)for(var Ce=x!==void 0,Te=this.config.maxAudioFramesDrift,Fe=0,Ve=le;Fe<Y.length;Fe++){var xe=Y[Fe],ye=xe.pts,oe=ye-Ve,Se=Math.abs(1e3*oe/O);if(oe<=-Te*U&&Ce)Fe===0&&(r.logger.warn("Audio frame @ "+(ye/O).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*oe/O)+" ms."),this.nextAudioPts=le=Ve=ye);else if(oe>=Te*U&&Se<p&&Ce){var _e=Math.round(oe/U);Ve=ye-_e*U,Ve<0&&(_e--,Ve+=U),Fe===0&&(this.nextAudioPts=le=Ve),r.logger.warn("[mp4-remuxer]: Injecting "+_e+" audio frame @ "+(Ve/O).toFixed(3)+"s due to "+Math.round(1e3*oe/O)+" ms gap.");for(var He=0;He<_e;He++){var rt=Math.max(Ve,0),ae=M.default.getSilentFrame(b.manifestCodec||b.codec,b.channelCount);ae||(r.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ae=xe.unit.subarray()),Y.splice(Fe,0,{unit:ae,pts:rt}),Ve+=U,Fe++}}xe.pts=Ve,Ve+=U}for(var $=null,Q=null,te,he=0,ge=Y.length;ge--;)he+=Y[ge].unit.byteLength;for(var we=0,ft=Y.length;we<ft;we++){var Pt=Y[we],jt=Pt.unit,qe=Pt.pts;if(Q!==null){var Mt=z[we-1];Mt.duration=Math.round((qe-Q)/F)}else if(m&&b.isAAC&&(qe=le),$=qe,he>0){he+=re;try{te=new Uint8Array(he)}catch(Le){this.observer.emit(W.Events.ERROR,W.Events.ERROR,{type:C.ErrorTypes.MUX_ERROR,details:C.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:he,reason:"fail allocating audio mdat "+he});return}if(!d){var sn=new DataView(te.buffer);sn.setUint32(0,he),te.set(I.default.types.mdat,4)}}else return;te.set(jt,re);var at=jt.byteLength;re+=at,z.push(new w(!0,R,at,0)),Q=qe}var Qe=z.length;if(!Qe)return;var Et=z[z.length-1];this.nextAudioPts=le=Q+F*Et.duration;var It=d?new Uint8Array(0):I.default.moof(b.sequenceNumber++,$/F,f({},b,{samples:z}));b.samples=[];var dt=$/O,mt=le/O,We="audio",De={data1:It,data2:te,startPTS:dt,endPTS:mt,startDTS:dt,endDTS:mt,type:We,hasAudio:!0,hasVideo:!1,nb:Qe};return this.isAudioContiguous=!0,console.assert(te.length,"MDAT length must not be zero"),De},P.remuxEmptyAudio=function(b,g,m,y){var x=b.inputTimeScale,O=b.samplerate?b.samplerate:x,H=x/O,F=this.nextAudioPts,R=(F!==null?F:y.startDTS*x)+this._initDTS,U=y.endDTS*x+this._initDTS,k=H*l,d=Math.ceil((U-R)/k),z=M.default.getSilentFrame(b.manifestCodec||b.codec,b.channelCount);if(r.logger.warn("[mp4-remuxer]: remux empty Audio"),!z){r.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var Y=[],re=0;re<d;re++){var le=R+re*k;Y.push({unit:z,pts:le,dts:le})}return b.samples=Y,this.remuxAudio(b,g,m,!1)},P.remuxID3=function(b,g){var m=b.samples.length;if(!m)return;for(var y=b.inputTimeScale,x=this._initPTS,O=this._initDTS,H=0;H<m;H++){var F=b.samples[H];F.pts=i(F.pts-x,g*y)/y,F.dts=i(F.dts-O,g*y)/y}var R=b.samples;return b.samples=[],{samples:R}},P.remuxText=function(b,g){var m=b.samples.length;if(!m)return;for(var y=b.inputTimeScale,x=this._initPTS,O=0;O<m;O++){var H=b.samples[O];H.pts=i(H.pts-x,g*y)/y}b.samples.sort(function(R,U){return R.pts-U.pts});var F=b.samples;return b.samples=[],{samples:F}},L}();function i(L,P){var _;if(P===null)return L;for(P<L?_=-8589934592:_=8589934592;Math.abs(L-P)>4294967296;)L+=_;return L}function D(L){for(var P=0;P<L.length;P++)if(L[P].key)return P;return-1}var w=function(P,_,b,g){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=_,this.size=b,this.cts=g,this.flags=new S(P)},S=function(P){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=P?2:1,this.isNonSync=P?0:1}},"./src/remux/passthrough-remuxer.ts":function(Z,V,j){"use strict";j.r(V);var G=j("./src/polyfills/number.ts"),M=j("./src/utils/mp4-tools.ts"),I=j("./src/loader/fragment.ts"),W=j("./src/utils/logger.ts"),C=function(){function v(){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=v.prototype;return f.destroy=function(){},f.resetTimeStamp=function(l){this.initPTS=l,this.lastEndDTS=null},f.resetNextTimestamp=function(){this.lastEndDTS=null},f.resetInitSegment=function(l,o,s){this.audioCodec=o,this.videoCodec=s,this.generateInitSegment(l),this.emitInitSegment=!0},f.generateInitSegment=function(l){var o=this.audioCodec,s=this.videoCodec;if(!l||!l.byteLength){this.initTracks=void 0,this.initData=void 0;return}var t=this.initData=Object(M.parseInitSegment)(l);o||(o=A(t.audio,I.ElementaryStreamTypes.AUDIO)),s||(s=A(t.video,I.ElementaryStreamTypes.VIDEO));var u={};t.audio&&t.video?u.audiovideo={container:"video/mp4",codec:o+","+s,initSegment:l,id:"main"}:t.audio?u.audio={container:"audio/mp4",codec:o,initSegment:l,id:"audio"}:t.video?u.video={container:"video/mp4",codec:s,initSegment:l,id:"main"}:W.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=u},f.remux=function(l,o,s,t,u){var a=this.initPTS,i=this.lastEndDTS,D={audio:void 0,video:void 0,text:t,id3:s,initSegment:void 0};Object(G.isFiniteNumber)(i)||(i=this.lastEndDTS=u||0);var w=o.samples;if(!w||!w.length)return D;var S={initPTS:void 0,timescale:1},L=this.initData;if((!L||!L.length)&&(this.generateInitSegment(w),L=this.initData),!L||!L.length)return W.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),D;this.emitInitSegment&&(S.tracks=this.initTracks,this.emitInitSegment=!1),Object(G.isFiniteNumber)(a)||(this.initPTS=S.initPTS=a=r(L,w,i));var P=Object(M.getDuration)(w,L),_=i,b=P+_;Object(M.offsetStartDTS)(L,w,a),P>0?this.lastEndDTS=b:(W.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var g=!!L.audio,m=!!L.video,y="";g&&(y+="audio"),m&&(y+="video");var x={data1:w,startPTS:_,startDTS:_,endPTS:b,endDTS:b,type:y,hasAudio:g,hasVideo:m,nb:1,dropped:0};return D.audio=x.type==="audio"?x:void 0,D.video=x.type!=="audio"?x:void 0,D.text=t,D.id3=s,D.initSegment=S,D},v}(),r=function(f,p,l){return Object(M.getStartDTS)(f,p)-l};function A(v,f){var p=v==null?void 0:v.codec;return p&&p.length>4?p:p==="hvc1"?"hvc1.1.c.L120.90":p==="av01"?"av01.0.04M.08":p==="avc1"||f===I.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}V.default=C},"./src/task-loop.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"default",function(){return G});var G=function(){function M(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var I=M.prototype;return I.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},I.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},I.onHandlerDestroyed=function(){},I.hasInterval=function(){return!!this._tickInterval},I.hasNextTick=function(){return!!this._tickTimer},I.setInterval=function(C){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,C),!0)},I.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},I.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},I.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},I.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},I.doTick=function(){},M}()},"./src/types/cmcd.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"CMCDVersion",function(){return G}),j.d(V,"CMCDObjectType",function(){return M}),j.d(V,"CMCDStreamingFormat",function(){return I}),j.d(V,"CMCDStreamType",function(){return W});var G=1,M;(function(C){C.MANIFEST="m",C.AUDIO="a",C.VIDEO="v",C.MUXED="av",C.INIT="i",C.CAPTION="c",C.TIMED_TEXT="tt",C.KEY="k",C.OTHER="o"})(M||(M={}));var I;(function(C){C.DASH="d",C.HLS="h",C.SMOOTH="s",C.OTHER="o"})(I||(I={}));var W;(function(C){C.VOD="v",C.LIVE="l"})(W||(W={}))},"./src/types/level.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"HlsSkip",function(){return I}),j.d(V,"getSkipValue",function(){return W}),j.d(V,"HlsUrlParameters",function(){return C}),j.d(V,"Level",function(){return r});function G(A,v){for(var f=0;f<v.length;f++){var p=v[f];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(A,p.key,p)}}function M(A,v,f){return v&&G(A.prototype,v),f&&G(A,f),A}var I;(function(A){A.No="",A.Yes="YES",A.v2="v2"})(I||(I={}));function W(A,v){var f=A.canSkipUntil,p=A.canSkipDateRanges,l=A.endSN,o=v!==void 0?v-l:0;return f&&o<f?p?I.v2:I.Yes:I.No}var C=function(){function A(f,p,l){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=f,this.part=p,this.skip=l}var v=A.prototype;return v.addDirectives=function(p){var l=new self.URL(p);return this.msn!==void 0&&l.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&l.searchParams.set("_HLS_part",this.part.toString()),this.skip&&l.searchParams.set("_HLS_skip",this.skip),l.toString()},A}(),r=function(){function A(v){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=[v.url],this.attrs=v.attrs,this.bitrate=v.bitrate,v.details&&(this.details=v.details),this.id=v.id||0,this.name=v.name,this.width=v.width||0,this.height=v.height||0,this.audioCodec=v.audioCodec,this.videoCodec=v.videoCodec,this.unknownCodecs=v.unknownCodecs,this.codecSet=[v.videoCodec,v.audioCodec].filter(function(f){return f}).join(",").replace(/\.[^.,]+/g,"")}return M(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(Z,V,j){"use strict";j.r(V),j.d(V,"PlaylistContextType",function(){return G}),j.d(V,"PlaylistLevelType",function(){return M});var G;(function(I){I.MANIFEST="manifest",I.LEVEL="level",I.AUDIO_TRACK="audioTrack",I.SUBTITLE_TRACK="subtitleTrack"})(G||(G={}));var M;(function(I){I.MAIN="main",I.AUDIO="audio",I.SUBTITLE="subtitle"})(M||(M={}))},"./src/types/transmuxer.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"ChunkMetadata",function(){return G});var G=function(W,C,r,A,v,f){A===void 0&&(A=0),v===void 0&&(v=-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=M(),this.buffering={audio:M(),video:M(),audiovideo:M()},this.level=W,this.sn=C,this.id=r,this.size=A,this.part=v,this.partial=f};function M(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"AttrList",function(){return I});var G=/^(\d+)x(\d+)$/,M=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,I=function(){function W(r){typeof r=="string"&&(r=W.parseAttrList(r));for(var A in r)r.hasOwnProperty(A)&&(this[A]=r[A])}var C=W.prototype;return C.decimalInteger=function(A){var v=parseInt(this[A],10);return v>Number.MAX_SAFE_INTEGER?Infinity:v},C.hexadecimalInteger=function(A){if(this[A]){var v=(this[A]||"0x").slice(2);v=(v.length&1?"0":"")+v;for(var f=new Uint8Array(v.length/2),p=0;p<v.length/2;p++)f[p]=parseInt(v.slice(p*2,p*2+2),16);return f}else return null},C.hexadecimalIntegerAsNumber=function(A){var v=parseInt(this[A],16);return v>Number.MAX_SAFE_INTEGER?Infinity:v},C.decimalFloatingPoint=function(A){return parseFloat(this[A])},C.optionalFloat=function(A,v){var f=this[A];return f?parseFloat(f):v},C.enumeratedString=function(A){return this[A]},C.bool=function(A){return this[A]==="YES"},C.decimalResolution=function(A){var v=G.exec(this[A]);return v===null?void 0:{width:parseInt(v[1],10),height:parseInt(v[2],10)}},W.parseAttrList=function(A){var v,f={},p='"';for(M.lastIndex=0;(v=M.exec(A))!==null;){var l=v[2];l.indexOf(p)===0&&l.lastIndexOf(p)===l.length-1&&(l=l.slice(1,-1)),f[v[1]]=l}return f},W}()},"./src/utils/binary-search.ts":function(Z,V,j){"use strict";j.r(V);var G={search:function(I,W){for(var C=0,r=I.length-1,A=null,v=null;C<=r;){A=(C+r)/2|0,v=I[A];var f=W(v);if(f>0)C=A+1;else if(f<0)r=A-1;else return v}return null}};V.default=G},"./src/utils/buffer-helper.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"BufferHelper",function(){return I});var G=j("./src/utils/logger.ts"),M={length:0,start:function(){return 0},end:function(){return 0}},I=function(){function W(){}return W.isBuffered=function(r,A){try{if(r){for(var v=W.getBuffered(r),f=0;f<v.length;f++)if(A>=v.start(f)&&A<=v.end(f))return!0}}catch(p){}return!1},W.bufferInfo=function(r,A,v){try{if(r){var f=W.getBuffered(r),p=[],l;for(l=0;l<f.length;l++)p.push({start:f.start(l),end:f.end(l)});return this.bufferedInfo(p,A,v)}}catch(o){}return{len:0,start:A,end:A,nextStart:void 0}},W.bufferedInfo=function(r,A,v){A=Math.max(0,A),r.sort(function(S,L){var P=S.start-L.start;return P||L.end-S.end});var f=[];if(v)for(var p=0;p<r.length;p++){var l=f.length;if(l){var o=f[l-1].end;r[p].start-o<v?r[p].end>o&&(f[l-1].end=r[p].end):f.push(r[p])}else f.push(r[p])}else f=r;for(var s=0,t,u=A,a=A,i=0;i<f.length;i++){var D=f[i].start,w=f[i].end;if(A+v>=D&&A<w)u=D,a=w,s=a-A;else if(A+v<D){t=D;break}}return{len:s,start:u||0,end:a||0,nextStart:t}},W.getBuffered=function(r){try{return r.buffered}catch(A){return G.logger.log("failed to get media.buffered",A),M}},W}()},"./src/utils/cea-608-parser.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"Row",function(){return a}),j.d(V,"CaptionScreen",function(){return i});var G=j("./src/utils/logger.ts"),M={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},I=function(b){var g=b;return M.hasOwnProperty(b)&&(g=M[b]),String.fromCharCode(g)},W=15,C=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},v={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"],l;(function(_){_[_.ERROR=0]="ERROR",_[_.TEXT=1]="TEXT",_[_.WARNING=2]="WARNING",_[_.INFO=2]="INFO",_[_.DEBUG=3]="DEBUG",_[_.DATA=3]="DATA"})(l||(l={}));var o=function(){function _(){this.time=null,this.verboseLevel=l.ERROR}var b=_.prototype;return b.log=function(m,y){this.verboseLevel>=m&&G.logger.log(this.time+" ["+m+"] "+y)},_}(),s=function(b){for(var g=[],m=0;m<b.length;m++)g.push(b[m].toString(16));return g},t=function(){function _(g,m,y,x,O){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=m||!1,this.italics=y||!1,this.background=x||"black",this.flash=O||!1}var b=_.prototype;return b.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},b.setStyles=function(m){for(var y=["foreground","underline","italics","background","flash"],x=0;x<y.length;x++){var O=y[x];m.hasOwnProperty(O)&&(this[O]=m[O])}},b.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},b.equals=function(m){return this.foreground===m.foreground&&this.underline===m.underline&&this.italics===m.italics&&this.background===m.background&&this.flash===m.flash},b.copy=function(m){this.foreground=m.foreground,this.underline=m.underline,this.italics=m.italics,this.background=m.background,this.flash=m.flash},b.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},_}(),u=function(){function _(g,m,y,x,O,H){this.uchar=void 0,this.penState=void 0,this.uchar=g||" ",this.penState=new t(m,y,x,O,H)}var b=_.prototype;return b.reset=function(){this.uchar=" ",this.penState.reset()},b.setChar=function(m,y){this.uchar=m,this.penState.copy(y)},b.setPenState=function(m){this.penState.copy(m)},b.equals=function(m){return this.uchar===m.uchar&&this.penState.equals(m.penState)},b.copy=function(m){this.uchar=m.uchar,this.penState.copy(m.penState)},b.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},_}(),a=function(){function _(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 m=0;m<C;m++)this.chars.push(new u);this.logger=g,this.pos=0,this.currPenState=new t}var b=_.prototype;return b.equals=function(m){for(var y=!0,x=0;x<C;x++)if(!this.chars[x].equals(m.chars[x])){y=!1;break}return y},b.copy=function(m){for(var y=0;y<C;y++)this.chars[y].copy(m.chars[y])},b.isEmpty=function(){for(var m=!0,y=0;y<C;y++)if(!this.chars[y].isEmpty()){m=!1;break}return m},b.setCursor=function(m){this.pos!==m&&(this.pos=m),this.pos<0?(this.logger.log(l.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>C&&(this.logger.log(l.DEBUG,"Too large cursor position "+this.pos),this.pos=C)},b.moveCursor=function(m){var y=this.pos+m;if(m>1)for(var x=this.pos+1;x<y+1;x++)this.chars[x].setPenState(this.currPenState);this.setCursor(y)},b.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},b.insertChar=function(m){m>=144&&this.backSpace();var y=I(m);if(this.pos>=C){this.logger.log(l.ERROR,"Cannot insert "+m.toString(16)+" ("+y+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(y,this.currPenState),this.moveCursor(1)},b.clearFromPos=function(m){var y;for(y=m;y<C;y++)this.chars[y].reset()},b.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},b.clearToEndOfRow=function(){this.clearFromPos(this.pos)},b.getTextString=function(){for(var m=[],y=!0,x=0;x<C;x++){var O=this.chars[x].uchar;O!==" "&&(y=!1),m.push(O)}return y?"":m.join("")},b.setPenStyles=function(m){this.currPenState.setStyles(m);var y=this.chars[this.pos];y.setPenState(this.currPenState)},_}(),i=function(){function _(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 m=0;m<W;m++)this.rows.push(new a(g));this.logger=g,this.currRow=W-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var b=_.prototype;return b.reset=function(){for(var m=0;m<W;m++)this.rows[m].clear();this.currRow=W-1},b.equals=function(m){for(var y=!0,x=0;x<W;x++)if(!this.rows[x].equals(m.rows[x])){y=!1;break}return y},b.copy=function(m){for(var y=0;y<W;y++)this.rows[y].copy(m.rows[y])},b.isEmpty=function(){for(var m=!0,y=0;y<W;y++)if(!this.rows[y].isEmpty()){m=!1;break}return m},b.backSpace=function(){var m=this.rows[this.currRow];m.backSpace()},b.clearToEndOfRow=function(){var m=this.rows[this.currRow];m.clearToEndOfRow()},b.insertChar=function(m){var y=this.rows[this.currRow];y.insertChar(m)},b.setPen=function(m){var y=this.rows[this.currRow];y.setPenStyles(m)},b.moveCursor=function(m){var y=this.rows[this.currRow];y.moveCursor(m)},b.setCursor=function(m){this.logger.log(l.INFO,"setCursor: "+m);var y=this.rows[this.currRow];y.setCursor(m)},b.setPAC=function(m){this.logger.log(l.INFO,"pacData = "+JSON.stringify(m));var y=m.row-1;if(this.nrRollUpRows&&y<this.nrRollUpRows-1&&(y=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==y){for(var x=0;x<W;x++)this.rows[x].clear();var O=this.currRow+1-this.nrRollUpRows,H=this.lastOutputScreen;if(H){var F=H.rows[O].cueStartTime,R=this.logger.time;if(F&&R!==null&&F<R)for(var U=0;U<this.nrRollUpRows;U++)this.rows[y-this.nrRollUpRows+U+1].copy(H.rows[O+U])}}this.currRow=y;var k=this.rows[this.currRow];if(m.indent!==null){var d=m.indent,z=Math.max(d-1,0);k.setCursor(m.indent),m.color=k.chars[z].penState.foreground}var Y={foreground:m.color,underline:m.underline,italics:m.italics,background:"black",flash:!1};this.setPen(Y)},b.setBkgData=function(m){this.logger.log(l.INFO,"bkgData = "+JSON.stringify(m)),this.backSpace(),this.setPen(m),this.insertChar(32)},b.setRollUpRows=function(m){this.nrRollUpRows=m},b.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(l.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(l.TEXT,this.getDisplayText());var m=this.currRow+1-this.nrRollUpRows,y=this.rows.splice(m,1)[0];y.clear(),this.rows.splice(this.currRow,0,y),this.logger.log(l.INFO,"Rolling up")},b.getDisplayText=function(m){m=m||!1;for(var y=[],x="",O=-1,H=0;H<W;H++){var F=this.rows[H].getTextString();F&&(O=H+1,m?y.push("Row "+O+": '"+F+"'"):y.push(F.trim()))}return y.length>0&&(m?x="["+y.join(" | ")+"]":x=y.join(`
`)),x},b.getTextAndFormat=function(){return this.rows},_}(),D=function(){function _(g,m,y){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=m,this.mode=null,this.verbose=0,this.displayedMemory=new i(y),this.nonDisplayedMemory=new i(y),this.lastOutputScreen=new i(y),this.currRollUpRow=this.displayedMemory.rows[W-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=y}var b=_.prototype;return b.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[W-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},b.getHandler=function(){return this.outputFilter},b.setHandler=function(m){this.outputFilter=m},b.setPAC=function(m){this.writeScreen.setPAC(m)},b.setBkgData=function(m){this.writeScreen.setBkgData(m)},b.setMode=function(m){if(m===this.mode)return;this.mode=m,this.logger.log(l.INFO,"MODE="+m),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=m},b.insertChars=function(m){for(var y=0;y<m.length;y++)this.writeScreen.insertChar(m[y]);var x=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(l.INFO,x+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(l.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},b.ccRCL=function(){this.logger.log(l.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},b.ccBS=function(){if(this.logger.log(l.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},b.ccAOF=function(){},b.ccAON=function(){},b.ccDER=function(){this.logger.log(l.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},b.ccRU=function(m){this.logger.log(l.INFO,"RU("+m+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(m)},b.ccFON=function(){this.logger.log(l.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},b.ccRDC=function(){this.logger.log(l.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},b.ccTR=function(){this.logger.log(l.INFO,"TR"),this.setMode("MODE_TEXT")},b.ccRTD=function(){this.logger.log(l.INFO,"RTD"),this.setMode("MODE_TEXT")},b.ccEDM=function(){this.logger.log(l.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},b.ccCR=function(){this.logger.log(l.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},b.ccENM=function(){this.logger.log(l.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},b.ccEOC=function(){if(this.logger.log(l.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var m=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=m,this.writeScreen=this.nonDisplayedMemory,this.logger.log(l.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},b.ccTO=function(m){this.logger.log(l.INFO,"TO("+m+") - Tab Offset"),this.writeScreen.moveCursor(m)},b.ccMIDROW=function(m){var y={flash:!1};if(y.underline=m%2===1,y.italics=m>=46,y.italics)y.foreground="white";else{var x=Math.floor(m/2)-16,O=["white","green","blue","cyan","red","yellow","magenta"];y.foreground=O[x]}this.logger.log(l.INFO,"MIDROW: "+JSON.stringify(y)),this.writeScreen.setPen(y)},b.outputDataUpdate=function(m){m===void 0&&(m=!1);var y=this.logger.time;if(y===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=y:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,y,this.lastOutputScreen),m&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:y),this.lastOutputScreen.copy(this.displayedMemory))},b.cueSplitAtTime=function(m){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,m,this.displayedMemory),this.cueStartTime=m))},_}(),w=function(){function _(g,m,y){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var x=new o;this.channels=[null,new D(g,m,x),new D(g+1,y,x)],this.cmdHistory=P(),this.logger=x}var b=_.prototype;return b.getHandler=function(m){return this.channels[m].getHandler()},b.setHandler=function(m,y){this.channels[m].setHandler(y)},b.addData=function(m,y){var x,O,H,F=!1;this.logger.time=m;for(var R=0;R<y.length;R+=2){if(O=y[R]&127,H=y[R+1]&127,O===0&&H===0)continue;if(this.logger.log(l.DATA,"["+s([y[R],y[R+1]])+"] -> ("+s([O,H])+")"),x=this.parseCmd(O,H),x||(x=this.parseMidrow(O,H)),x||(x=this.parsePAC(O,H)),x||(x=this.parseBackgroundAttributes(O,H)),!x&&(F=this.parseChars(O,H),F)){var U=this.currentChannel;if(U&&U>0){var k=this.channels[U];k.insertChars(F)}else this.logger.log(l.WARNING,"No channel found yet. TEXT-MODE?")}!x&&!F&&this.logger.log(l.WARNING,"Couldn't parse cleaned data "+s([O,H])+" orig: "+s([y[R],y[R+1]]))}},b.parseCmd=function(m,y){var x=this.cmdHistory,O=(m===20||m===28||m===21||m===29)&&y>=32&&y<=47,H=(m===23||m===31)&&y>=33&&y<=35;if(!(O||H))return!1;if(L(m,y,x))return S(null,null,x),this.logger.log(l.DEBUG,"Repeated command ("+s([m,y])+") is dropped"),!0;var F=m===20||m===21||m===23?1:2,R=this.channels[F];return m===20||m===21||m===28||m===29?y===32?R.ccRCL():y===33?R.ccBS():y===34?R.ccAOF():y===35?R.ccAON():y===36?R.ccDER():y===37?R.ccRU(2):y===38?R.ccRU(3):y===39?R.ccRU(4):y===40?R.ccFON():y===41?R.ccRDC():y===42?R.ccTR():y===43?R.ccRTD():y===44?R.ccEDM():y===45?R.ccCR():y===46?R.ccENM():y===47&&R.ccEOC():R.ccTO(y-32),S(m,y,x),this.currentChannel=F,!0},b.parseMidrow=function(m,y){var x=0;if((m===17||m===25)&&y>=32&&y<=47){if(m===17?x=1:x=2,x!==this.currentChannel)return this.logger.log(l.ERROR,"Mismatch channel in midrow parsing"),!1;var O=this.channels[x];return O?(O.ccMIDROW(y),this.logger.log(l.DEBUG,"MIDROW ("+s([m,y])+")"),!0):!1}return!1},b.parsePAC=function(m,y){var x,O=this.cmdHistory,H=(m>=17&&m<=23||m>=25&&m<=31)&&y>=64&&y<=127,F=(m===16||m===24)&&y>=64&&y<=95;if(!(H||F))return!1;if(L(m,y,O))return S(null,null,O),!0;var R=m<=23?1:2;y>=64&&y<=95?x=R===1?r[m]:v[m]:x=R===1?A[m]:f[m];var U=this.channels[R];return U?(U.setPAC(this.interpretPAC(x,y)),S(m,y,O),this.currentChannel=R,!0):!1},b.interpretPAC=function(m,y){var x,O={color:null,italics:!1,indent:null,underline:!1,row:m};return y>95?x=y-96:x=y-64,O.underline=(x&1)===1,x<=13?O.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(x/2)]:x<=15?(O.italics=!0,O.color="white"):O.indent=Math.floor((x-16)/2)*4,O},b.parseChars=function(m,y){var x,O=null,H=null;if(m>=25?(x=2,H=m-8):(x=1,H=m),H>=17&&H<=19){var F;H===17?F=y+80:H===18?F=y+112:F=y+144,this.logger.log(l.INFO,"Special char '"+I(F)+"' in channel "+x),O=[F]}else m>=32&&m<=127&&(O=y===0?[m]:[m,y]);if(O){var R=s(O);this.logger.log(l.DEBUG,"Char codes = "+R.join(",")),S(m,y,this.cmdHistory)}return O},b.parseBackgroundAttributes=function(m,y){var x=(m===16||m===24)&&y>=32&&y<=47,O=(m===23||m===31)&&y>=45&&y<=47;if(!(x||O))return!1;var H,F={};m===16||m===24?(H=Math.floor((y-32)/2),F.background=p[H],y%2===1&&(F.background=F.background+"_semi")):y===45?F.background="transparent":(F.foreground="black",y===47&&(F.underline=!0));var R=m<=23?1:2,U=this.channels[R];return U.setBkgData(F),S(m,y,this.cmdHistory),!0},b.reset=function(){for(var m=0;m<Object.keys(this.channels).length;m++){var y=this.channels[m];y&&y.reset()}this.cmdHistory=P()},b.cueSplitAtTime=function(m){for(var y=0;y<this.channels.length;y++){var x=this.channels[y];x&&x.cueSplitAtTime(m)}},_}();function S(_,b,g){g.a=_,g.b=b}function L(_,b,g){return g.a===_&&g.b===b}function P(){return{a:null,b:null}}V.default=w},"./src/utils/codecs.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"isCodecType",function(){return M}),j.d(V,"isCodecSupportedInMp4",function(){return I});var G={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 M(W,C){var r=G[C];return!!r&&r[W.slice(0,4)]===!0}function I(W,C){return MediaSource.isTypeSupported((C||"video")+'/mp4;codecs="'+W+'"')}},"./src/utils/cues.ts":function(Z,V,j){"use strict";j.r(V);var G=j("./src/utils/vttparser.ts"),M=j("./src/utils/webvtt-parser.ts"),I=j("./src/utils/texttrack-utils.ts"),W=/\s/,C={newCue:function(A,v,f,p){for(var l=[],o,s,t,u,a,i=self.VTTCue||self.TextTrackCue,D=0;D<p.rows.length;D++)if(o=p.rows[D],t=!0,u=0,a="",!o.isEmpty()){for(var w=0;w<o.chars.length;w++)W.test(o.chars[w].uchar)&&t?u++:(a+=o.chars[w].uchar,t=!1);o.cueStartTime=v,v===f&&(f+=1e-4),u>=16?u--:u++;var S=Object(G.fixLineBreaks)(a.trim()),L=Object(M.generateCueId)(v,f,S);(!A||!A.cues||!A.cues.getCueById(L))&&(s=new i(v,f,S),s.id=L,s.line=D+1,s.align="left",s.position=10+Math.min(80,Math.floor(u*8/32)*10),l.push(s))}return A&&l.length&&(l.sort(function(P,_){return P.line==="auto"||_.line==="auto"?0:P.line>8&&_.line>8?_.line-P.line:P.line-_.line}),l.forEach(function(P){return Object(I.addCueToTrack)(A,P)})),l}};V.default=C},"./src/utils/discontinuities.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"findFirstFragWithCC",function(){return W}),j.d(V,"shouldAlignOnDiscontinuities",function(){return C}),j.d(V,"findDiscontinuousReferenceFrag",function(){return r}),j.d(V,"adjustSlidingStart",function(){return v}),j.d(V,"alignStream",function(){return f}),j.d(V,"alignPDT",function(){return l}),j.d(V,"alignFragmentByPDTDelta",function(){return o}),j.d(V,"alignMediaPlaylistByPDT",function(){return s});var G=j("./src/polyfills/number.ts"),M=j("./src/utils/logger.ts"),I=j("./src/controller/level-helper.ts");function W(t,u){for(var a=null,i=0,D=t.length;i<D;i++){var w=t[i];if(w&&w.cc===u){a=w;break}}return a}function C(t,u,a){return!!(u.details&&(a.endCC>a.startCC||t&&t.cc<a.startCC))}function r(t,u){var a=t.fragments,i=u.fragments;if(!i.length||!a.length){M.logger.log("No fragments to align");return}var D=W(a,i[0].cc);if(!D||D&&!D.startPTS){M.logger.log("No frag in previous level to align on");return}return D}function A(t,u){if(t){var a=t.start+u;t.start=t.startPTS=a,t.endPTS=a+t.duration}}function v(t,u){for(var a=u.fragments,i=0,D=a.length;i<D;i++)A(a[i],t);u.fragmentHint&&A(u.fragmentHint,t),u.alignedSliding=!0}function f(t,u,a){if(!u)return;p(t,a,u),!a.alignedSliding&&u.details&&l(a,u.details),!a.alignedSliding&&u.details&&!a.skippedSegments&&Object(I.adjustSliding)(u.details,a)}function p(t,u,a){if(C(t,a,u)){var i=r(a.details,u);i&&Object(G.isFiniteNumber)(i.start)&&(M.logger.log("Adjusting PTS using last level due to CC increase within current level "+u.url),v(i.start,u))}}function l(t,u){if(!u.fragments.length||!t.hasProgramDateTime||!u.hasProgramDateTime)return;var a=u.fragments[0].programDateTime,i=t.fragments[0].programDateTime,D=(i-a)/1e3+u.fragments[0].start;D&&Object(G.isFiniteNumber)(D)&&(M.logger.log("Adjusting PTS using programDateTime delta "+(i-a)+"ms, sliding:"+D.toFixed(3)+" "+t.url+" "),v(D,t))}function o(t,u){var a=t.programDateTime;if(!a)return;var i=(a-u)/1e3;t.start=t.startPTS=i,t.endPTS=i+t.duration}function s(t,u){if(!u.fragments.length||!t.hasProgramDateTime||!u.hasProgramDateTime)return;var a=u.fragments[0].programDateTime,i=u.fragments[0].start,D=a-i*1e3;t.fragments.forEach(function(w){o(w,D)}),t.fragmentHint&&o(t.fragmentHint,D),t.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(Z,V,j){"use strict";j.r(V);var G=j("./src/utils/ewma.ts"),M=function(){function I(C,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 G.default(C),this.fast_=new G.default(r)}var W=I.prototype;return W.update=function(r,A){var v=this.slow_,f=this.fast_;this.slow_.halfLife!==r&&(this.slow_=new G.default(r,v.getEstimate(),v.getTotalWeight())),this.fast_.halfLife!==A&&(this.fast_=new G.default(A,f.getEstimate(),f.getTotalWeight()))},W.sample=function(r,A){r=Math.max(r,this.minDelayMs_);var v=8*A,f=r/1e3,p=v/f;this.fast_.sample(f,p),this.slow_.sample(f,p)},W.canEstimate=function(){var r=this.fast_;return r&&r.getTotalWeight()>=this.minWeight_},W.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},W.destroy=function(){},I}();V.default=M},"./src/utils/ewma.ts":function(Z,V,j){"use strict";j.r(V);var G=function(){function M(W,C,r){C===void 0&&(C=0),r===void 0&&(r=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=W,this.alpha_=W?Math.exp(Math.log(.5)/W):0,this.estimate_=C,this.totalWeight_=r}var I=M.prototype;return I.sample=function(C,r){var A=Math.pow(this.alpha_,C);this.estimate_=r*(1-A)+A*this.estimate_,this.totalWeight_+=C},I.getTotalWeight=function(){return this.totalWeight_},I.getEstimate=function(){if(this.alpha_){var C=1-Math.pow(this.alpha_,this.totalWeight_);if(C)return this.estimate_/C}return this.estimate_},M}();V.default=G},"./src/utils/fetch-loader.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"fetchSupported",function(){return o});var G=j("./src/polyfills/number.ts"),M=j("./src/loader/load-stats.ts"),I=j("./src/demux/chunk-cache.ts");function W(i,D){i.prototype=Object.create(D.prototype),i.prototype.constructor=i,f(i,D)}function C(i){var D=typeof Map=="function"?new Map:void 0;return C=function(S){if(S===null||!v(S))return S;if(typeof S!="function")throw new TypeError("Super expression must either be null or a function");if(typeof D!="undefined"){if(D.has(S))return D.get(S);D.set(S,L)}function L(){return r(S,arguments,p(this).constructor)}return L.prototype=Object.create(S.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),f(L,S)},C(i)}function r(i,D,w){return A()?r=Reflect.construct:r=function(L,P,_){var b=[null];b.push.apply(b,P);var g=Function.bind.apply(L,b),m=new g;return _&&f(m,_.prototype),m},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(i){return!1}}function v(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function f(i,D){return f=Object.setPrototypeOf||function(S,L){return S.__proto__=L,S},f(i,D)}function p(i){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(w){return w.__proto__||Object.getPrototypeOf(w)},p(i)}function l(){return l=Object.assign||function(i){for(var D=1;D<arguments.length;D++){var w=arguments[D];for(var S in w)Object.prototype.hasOwnProperty.call(w,S)&&(i[S]=w[S])}return i},l.apply(this,arguments)}function o(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(i){}return!1}var s=function(){function i(w){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=w.fetchSetup||u,this.controller=new self.AbortController,this.stats=new M.LoadStats}var D=i.prototype;return D.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},D.abortInternal=function(){var S=this.response;(!S||!S.ok)&&(this.stats.aborted=!0,this.controller.abort())},D.abort=function(){var S;this.abortInternal(),(S=this.callbacks)!==null&&S!==void 0&&S.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},D.load=function(S,L,P){var _=this,b=this.stats;if(b.loading.start)throw new Error("Loader can only be used once.");b.loading.start=self.performance.now();var g=t(S,this.controller.signal),m=P.onProgress,y=S.responseType==="arraybuffer",x=y?"byteLength":"length";this.context=S,this.config=L,this.callbacks=P,this.request=this.fetchSetup(S,g),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){_.abortInternal(),P.onTimeout(b,S,_.response)},L.timeout),self.fetch(this.request).then(function(O){if(_.response=_.loader=O,!O.ok){var H=O.status,F=O.statusText;throw new a(F||"fetch, bad network response",H,O)}return b.loading.first=Math.max(self.performance.now(),b.loading.start),b.total=parseInt(O.headers.get("Content-Length")||"0"),m&&Object(G.isFiniteNumber)(L.highWaterMark)?_.loadProgressively(O,b,S,L.highWaterMark,m):y?O.arrayBuffer():O.text()}).then(function(O){var H=_.response;self.clearTimeout(_.requestTimeout),b.loading.end=Math.max(self.performance.now(),b.loading.first),b.loaded=b.total=O[x];var F={url:H.url,data:O};m&&!Object(G.isFiniteNumber)(L.highWaterMark)&&m(b,S,O,H),P.onSuccess(F,b,S,H)}).catch(function(O){if(self.clearTimeout(_.requestTimeout),b.aborted)return;var H=O.code||0;P.onError({code:H,text:O.message},S,O.details)})},D.getCacheAge=function(){var S=null;if(this.response){var L=this.response.headers.get("age");S=L?parseFloat(L):null}return S},D.loadProgressively=function(S,L,P,_,b){_===void 0&&(_=0);var g=new I.default,m=S.body.getReader(),y=function x(){return m.read().then(function(O){if(O.done)return g.dataLength&&b(L,P,g.flush(),S),Promise.resolve(new ArrayBuffer(0));var H=O.value,F=H.length;return L.loaded+=F,F<_||g.dataLength?(g.push(H),g.dataLength>=_&&b(L,P,g.flush(),S)):b(L,P,H,S),x()}).catch(function(){return Promise.reject()})};return y()},i}();function t(i,D){var w={method:"GET",mode:"cors",credentials:"same-origin",signal:D,headers:new self.Headers(l({},i.headers))};return i.rangeEnd&&w.headers.set("Range","bytes="+i.rangeStart+"-"+String(i.rangeEnd-1)),w}function u(i,D){return new self.Request(i.url,D)}var a=function(i){W(D,i);function D(w,S,L){var P;return P=i.call(this,w)||this,P.code=void 0,P.details=void 0,P.code=S,P.details=L,P}return D}(C(Error));V.default=s},"./src/utils/imsc1-ttml-parser.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"IMSC1_CODEC",function(){return v}),j.d(V,"parseIMSC1",function(){return o});var G=j("./src/utils/mp4-tools.ts"),M=j("./src/utils/vttparser.ts"),I=j("./src/utils/vttcue.ts"),W=j("./src/demux/id3.ts"),C=j("./src/utils/timescale-conversion.ts"),r=j("./src/utils/webvtt-parser.ts");function A(){return A=Object.assign||function(_){for(var b=1;b<arguments.length;b++){var g=arguments[b];for(var m in g)Object.prototype.hasOwnProperty.call(g,m)&&(_[m]=g[m])}return _},A.apply(this,arguments)}var v="stpp.ttml.im1t",f=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,p=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,l={left:"start",center:"center",right:"end",start:"start",end:"end"};function o(_,b,g,m,y){var x=Object(G.findBox)(new Uint8Array(_),["mdat"]);if(x.length===0){y(new Error("Could not parse IMSC1 mdat"));return}var O=x[0],H=Object(W.utf8ArrayToStr)(new Uint8Array(_,O.start,O.end-O.start)),F=Object(C.toTimescaleFromScale)(b,1,g);try{m(s(H,F))}catch(R){y(R)}}function s(_,b){var g=new DOMParser,m=g.parseFromString(_,"text/xml"),y=m.getElementsByTagName("tt")[0];if(!y)throw new Error("Invalid ttml");var x={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},O=Object.keys(x).reduce(function(k,d){return k[d]=y.getAttribute("ttp:"+d)||x[d],k},{}),H=y.getAttribute("xml:space")!=="preserve",F=u(t(y,"styling","style")),R=u(t(y,"layout","region")),U=t(y,"body","[begin]");return[].map.call(U,function(k){var d=a(k,H);if(!d||!k.hasAttribute("begin"))return null;var z=S(k.getAttribute("begin"),O),Y=S(k.getAttribute("dur"),O),re=S(k.getAttribute("end"),O);if(z===null)throw w(k);if(re===null){if(Y===null)throw w(k);re=z+Y}var le=new I.default(z-b,re-b,d);le.id=Object(r.generateCueId)(le.startTime,le.endTime,le.text);var Ne=R[k.getAttribute("region")],Ce=F[k.getAttribute("style")];le.position=10,le.size=80;var Te=i(Ne,Ce),Fe=Te.textAlign;if(Fe){var Ve=l[Fe];Ve&&(le.lineAlign=Ve),le.align=Fe}return A(le,Te),le}).filter(function(k){return k!==null})}function t(_,b,g){var m=_.getElementsByTagName(b)[0];return m?[].slice.call(m.querySelectorAll(g)):[]}function u(_){return _.reduce(function(b,g){var m=g.getAttribute("xml:id");return m&&(b[m]=g),b},{})}function a(_,b){return[].slice.call(_.childNodes).reduce(function(g,m,y){var x;return m.nodeName==="br"&&y?g+`
`:(x=m.childNodes)!==null&&x!==void 0&&x.length?a(m,b):b?g+m.textContent.trim().replace(/\s+/g," "):g+m.textContent},"")}function i(_,b){var g="http://www.w3.org/ns/ttml#styling",m=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return m.reduce(function(y,x){var O=D(b,g,x)||D(_,g,x);return O&&(y[x]=O),y},{})}function D(_,b,g){return _.hasAttributeNS(b,g)?_.getAttributeNS(b,g):null}function w(_){return new Error("Could not parse ttml timestamp "+_)}function S(_,b){if(!_)return null;var g=Object(M.parseTimeStamp)(_);return g===null&&(f.test(_)?g=L(_,b):p.test(_)&&(g=P(_,b))),g}function L(_,b){var g=f.exec(_),m=(g[4]|0)+(g[5]|0)/b.subFrameRate;return(g[1]|0)*3600+(g[2]|0)*60+(g[3]|0)+m/b.frameRate}function P(_,b){var g=p.exec(_),m=Number(g[1]),y=g[2];switch(y){case"h":return m*3600;case"m":return m*60;case"ms":return m*1e3;case"f":return m/b.frameRate;case"t":return m/b.tickRate}return m}},"./src/utils/logger.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"enableLogs",function(){return r}),j.d(V,"logger",function(){return A});var G=function(){},M={trace:G,debug:G,log:G,warn:G,info:G,error:G},I=M;function W(v){var f=self.console[v];return f?f.bind(self.console,"["+v+"] >"):G}function C(v){for(var f=arguments.length,p=new Array(f>1?f-1:0),l=1;l<f;l++)p[l-1]=arguments[l];p.forEach(function(o){I[o]=v[o]?v[o].bind(v):W(o)})}function r(v){if(self.console&&v===!0||typeof v=="object"){C(v,"debug","log","info","warn","error");try{I.log()}catch(f){I=M}}else I=M}var A=I},"./src/utils/mediakeys-helper.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"KeySystems",function(){return G}),j.d(V,"requestMediaKeySystemAccess",function(){return M});var G;(function(I){I.WIDEVINE="com.widevine.alpha",I.PLAYREADY="com.microsoft.playready"})(G||(G={}));var M=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"getMediaSource",function(){return G});function G(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"bin2str",function(){return C}),j.d(V,"readUint16",function(){return r}),j.d(V,"readUint32",function(){return A}),j.d(V,"writeUint32",function(){return v}),j.d(V,"findBox",function(){return f}),j.d(V,"parseSegmentIndex",function(){return p}),j.d(V,"parseInitSegment",function(){return l}),j.d(V,"getStartDTS",function(){return o}),j.d(V,"getDuration",function(){return s}),j.d(V,"computeRawDurationFromSamples",function(){return t}),j.d(V,"offsetStartDTS",function(){return u}),j.d(V,"segmentValidRange",function(){return a}),j.d(V,"appendUint8Array",function(){return i});var G=j("./src/utils/typed-array.ts"),M=j("./src/loader/fragment.ts"),I=Math.pow(2,32)-1,W=[].push;function C(D){return String.fromCharCode.apply(null,D)}function r(D,w){"data"in D&&(w+=D.start,D=D.data);var S=D[w]<<8|D[w+1];return S<0?65536+S:S}function A(D,w){"data"in D&&(w+=D.start,D=D.data);var S=D[w]<<24|D[w+1]<<16|D[w+2]<<8|D[w+3];return S<0?4294967296+S:S}function v(D,w,S){"data"in D&&(w+=D.start,D=D.data),D[w]=S>>24,D[w+1]=S>>16&255,D[w+2]=S>>8&255,D[w+3]=S&255}function f(D,w){var S=[];if(!w.length)return S;var L,P,_;"data"in D?(L=D.data,P=D.start,_=D.end):(L=D,P=0,_=L.byteLength);for(var b=P;b<_;){var g=A(L,b),m=C(L.subarray(b+4,b+8)),y=g>1?b+g:_;if(m===w[0])if(w.length===1)S.push({data:L,start:b+8,end:y});else{var x=f({data:L,start:b+8,end:y},w.slice(1));x.length&&W.apply(S,x)}b=y}return S}function p(D){var w=f(D,["moov"]),S=w[0],L=S?S.end:null,P=f(D,["sidx"]);if(!P||!P[0])return null;var _=[],b=P[0],g=b.data[0],m=g===0?8:16,y=A(b,m);m+=4;var x=0,O=0;g===0?m+=8:m+=16,m+=2;var H=b.end+O,F=r(b,m);m+=2;for(var R=0;R<F;R++){var U=m,k=A(b,U);U+=4;var d=k&2147483647,z=(k&2147483648)>>>31;if(z===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Y=A(b,U);U+=4,_.push({referenceSize:d,subsegmentDuration:Y,info:{duration:Y/y,start:H,end:H+d-1}}),H+=d,U+=4,m=U}return{earliestPresentationTime:x,timescale:y,version:g,referencesCount:F,references:_,moovEndOffset:L}}function l(D){for(var w=[],S=f(D,["moov","trak"]),L=0;L<S.length;L++){var P=S[L],_=f(P,["tkhd"])[0];if(_){var b=_.data[_.start],g=b===0?12:20,m=A(_,g),y=f(P,["mdia","mdhd"])[0];if(y){b=y.data[y.start],g=b===0?12:20;var x=A(y,g),O=f(P,["mdia","hdlr"])[0];if(O){var H=C(O.data.subarray(O.start+8,O.start+12)),F={soun:M.ElementaryStreamTypes.AUDIO,vide:M.ElementaryStreamTypes.VIDEO}[H];if(F){var R=f(P,["mdia","minf","stbl","stsd"])[0],U=void 0;R&&(U=C(R.data.subarray(R.start+12,R.start+16))),w[m]={timescale:x,type:F},w[F]={timescale:x,id:m,codec:U}}}}}}var k=f(D,["moov","mvex","trex"]);return k.forEach(function(d){var z=A(d,4),Y=w[z];Y&&(Y.default={duration:A(d,12),flags:A(d,20)})}),w}function o(D,w){return f(w,["moof","traf"]).reduce(function(S,L){var P=f(L,["tfdt"])[0],_=P.data[P.start],b=f(L,["tfhd"]).reduce(function(g,m){var y=A(m,4),x=D[y];if(x){var O=A(P,4);_===1&&(O*=Math.pow(2,32),O+=A(P,8));var H=x.timescale||9e4,F=O/H;if(isFinite(F)&&(g===null||F<g))return F}return g},null);return b!==null&&isFinite(b)&&(S===null||b<S)?b:S},null)||0}function s(D,w){for(var S=0,L=0,P=0,_=f(D,["moof","traf"]),b=0;b<_.length;b++){var g=_[b],m=f(g,["tfhd"])[0],y=A(m,4),x=w[y];if(!x)continue;var O=x.default,H=A(m,0)|(O==null?void 0:O.flags),F=O==null?void 0:O.duration;H&8&&(H&2?F=A(m,12):F=A(m,8));for(var R=x.timescale||9e4,U=f(g,["trun"]),k=0;k<U.length;k++){if(F){var d=A(U[k],4);S=F*d}else S=t(U[k]);x.type===M.ElementaryStreamTypes.VIDEO?L+=S/R:x.type===M.ElementaryStreamTypes.AUDIO&&(P+=S/R)}}if(L===0&&P===0){var z=p(D);if(z!=null&&z.references)return z.references.reduce(function(Y,re){return Y+re.info.duration||0},0)}return L||P}function t(D){var w=A(D,0),S=8;w&1&&(S+=4),w&4&&(S+=4);for(var L=0,P=A(D,4),_=0;_<P;_++){if(w&256){var b=A(D,S);L+=b,S+=4}w&512&&(S+=4),w&1024&&(S+=4),w&2048&&(S+=4)}return L}function u(D,w,S){f(w,["moof","traf"]).forEach(function(L){f(L,["tfhd"]).forEach(function(P){var _=A(P,4),b=D[_];if(!b)return;var g=b.timescale||9e4;f(L,["tfdt"]).forEach(function(m){var y=m.data[m.start],x=A(m,4);if(y===0)v(m,4,x-S*g);else{x*=Math.pow(2,32),x+=A(m,8),x-=S*g,x=Math.max(x,0);var O=Math.floor(x/(I+1)),H=Math.floor(x%(I+1));v(m,4,O),v(m,8,H)}})})})}function a(D){var w={valid:null,remainder:null},S=f(D,["moof"]);if(S){if(S.length<2)return w.remainder=D,w}else return w;var L=S[S.length-1];return w.valid=Object(G.sliceUint8)(D,0,L.start-8),w.remainder=Object(G.sliceUint8)(D,L.start-8),w}function i(D,w){var S=new Uint8Array(D.length+w.length);return S.set(D),S.set(w,D.length),S}},"./src/utils/output-filter.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"default",function(){return G});var G=function(){function M(W,C){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=W,this.trackName=C}var I=M.prototype;return I.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},I.newCue=function(C,r,A){(this.startTime===null||this.startTime>C)&&(this.startTime=C),this.endTime=r,this.screen=A,this.timelineController.createCaptionsTrack(this.trackName)},I.reset=function(){this.cueRanges=[]},M}()},"./src/utils/texttrack-utils.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"sendAddTrackEvent",function(){return M}),j.d(V,"addCueToTrack",function(){return I}),j.d(V,"clearCurrentCues",function(){return W}),j.d(V,"removeCuesInRange",function(){return C}),j.d(V,"getCuesInRange",function(){return A});var G=j("./src/utils/logger.ts");function M(v,f){var p;try{p=new Event("addtrack")}catch(l){p=document.createEvent("Event"),p.initEvent("addtrack",!1,!1)}p.track=v,f.dispatchEvent(p)}function I(v,f){var p=v.mode;if(p==="disabled"&&(v.mode="hidden"),v.cues&&!v.cues.getCueById(f.id))try{if(v.addCue(f),!v.cues.getCueById(f.id))throw new Error("addCue is failed for: "+f)}catch(o){G.logger.debug("[texttrack-utils]: "+o);var l=new self.TextTrackCue(f.startTime,f.endTime,f.text);l.id=f.id,v.addCue(l)}p==="disabled"&&(v.mode=p)}function W(v){var f=v.mode;if(f==="disabled"&&(v.mode="hidden"),v.cues)for(var p=v.cues.length;p--;)v.removeCue(v.cues[p]);f==="disabled"&&(v.mode=f)}function C(v,f,p){var l=v.mode;if(l==="disabled"&&(v.mode="hidden"),v.cues&&v.cues.length>0)for(var o=A(v.cues,f,p),s=0;s<o.length;s++)v.removeCue(o[s]);l==="disabled"&&(v.mode=l)}function r(v,f){if(f<v[0].startTime)return 0;var p=v.length-1;if(f>v[p].endTime)return-1;for(var l=0,o=p;l<=o;){var s=Math.floor((o+l)/2);if(f<v[s].startTime)o=s-1;else if(f>v[s].startTime&&l<p)l=s+1;else return s}return v[l].startTime-f<f-v[o].startTime?l:o}function A(v,f,p){var l=[],o=r(v,f);if(o>-1)for(var s=o,t=v.length;s<t;s++){var u=v[s];if(u.startTime>=f&&u.endTime<=p)l.push(u);else if(u.startTime>p)return l}return l}},"./src/utils/time-ranges.ts":function(Z,V,j){"use strict";j.r(V);var G={toString:function(I){for(var W="",C=I.length,r=0;r<C;r++)W+="["+I.start(r).toFixed(3)+","+I.end(r).toFixed(3)+"]";return W}};V.default=G},"./src/utils/timescale-conversion.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"toTimescaleFromBase",function(){return M}),j.d(V,"toTimescaleFromScale",function(){return I}),j.d(V,"toMsFromMpegTsClock",function(){return W}),j.d(V,"toMpegTsClockFromTimescale",function(){return C});var G=9e4;function M(r,A,v,f){v===void 0&&(v=1),f===void 0&&(f=!1);var p=r*A*v;return f?Math.round(p):p}function I(r,A,v,f){return v===void 0&&(v=1),f===void 0&&(f=!1),M(r,A,1/v,f)}function W(r,A){return A===void 0&&(A=!1),M(r,1e3,1/G,A)}function C(r,A){return A===void 0&&(A=1),M(r,G,1/A)}},"./src/utils/typed-array.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"sliceUint8",function(){return G});function G(M,I,W){return Uint8Array.prototype.slice?M.slice(I,W):new Uint8Array(Array.prototype.slice.call(M,I,W))}},"./src/utils/vttcue.ts":function(Z,V,j){"use strict";j.r(V),V.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var G=["","lr","rl"],M=["start","middle","end","left","right"];function I(v,f){if(typeof f!="string")return!1;if(!Array.isArray(v))return!1;var p=f.toLowerCase();return~v.indexOf(p)?p:!1}function W(v){return I(G,v)}function C(v){return I(M,v)}function r(v){for(var f=arguments.length,p=new Array(f>1?f-1:0),l=1;l<f;l++)p[l-1]=arguments[l];for(var o=1;o<arguments.length;o++){var s=arguments[o];for(var t in s)v[t]=s[t]}return v}function A(v,f,p){var l=this,o={enumerable:!0};l.hasBeenReset=!1;var s="",t=!1,u=v,a=f,i=p,D=null,w="",S=!0,L="auto",P="start",_=50,b="middle",g=50,m="middle";Object.defineProperty(l,"id",r({},o,{get:function(){return s},set:function(x){s=""+x}})),Object.defineProperty(l,"pauseOnExit",r({},o,{get:function(){return t},set:function(x){t=!!x}})),Object.defineProperty(l,"startTime",r({},o,{get:function(){return u},set:function(x){if(typeof x!="number")throw new TypeError("Start time must be set to a number.");u=x,this.hasBeenReset=!0}})),Object.defineProperty(l,"endTime",r({},o,{get:function(){return a},set:function(x){if(typeof x!="number")throw new TypeError("End time must be set to a number.");a=x,this.hasBeenReset=!0}})),Object.defineProperty(l,"text",r({},o,{get:function(){return i},set:function(x){i=""+x,this.hasBeenReset=!0}})),Object.defineProperty(l,"region",r({},o,{get:function(){return D},set:function(x){D=x,this.hasBeenReset=!0}})),Object.defineProperty(l,"vertical",r({},o,{get:function(){return w},set:function(x){var O=W(x);if(O===!1)throw new SyntaxError("An invalid or illegal string was specified.");w=O,this.hasBeenReset=!0}})),Object.defineProperty(l,"snapToLines",r({},o,{get:function(){return S},set:function(x){S=!!x,this.hasBeenReset=!0}})),Object.defineProperty(l,"line",r({},o,{get:function(){return L},set:function(x){if(typeof x!="number"&&x!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");L=x,this.hasBeenReset=!0}})),Object.defineProperty(l,"lineAlign",r({},o,{get:function(){return P},set:function(x){var O=C(x);if(!O)throw new SyntaxError("An invalid or illegal string was specified.");P=O,this.hasBeenReset=!0}})),Object.defineProperty(l,"position",r({},o,{get:function(){return _},set:function(x){if(x<0||x>100)throw new Error("Position must be between 0 and 100.");_=x,this.hasBeenReset=!0}})),Object.defineProperty(l,"positionAlign",r({},o,{get:function(){return b},set:function(x){var O=C(x);if(!O)throw new SyntaxError("An invalid or illegal string was specified.");b=O,this.hasBeenReset=!0}})),Object.defineProperty(l,"size",r({},o,{get:function(){return g},set:function(x){if(x<0||x>100)throw new Error("Size must be between 0 and 100.");g=x,this.hasBeenReset=!0}})),Object.defineProperty(l,"align",r({},o,{get:function(){return m},set:function(x){var O=C(x);if(!O)throw new SyntaxError("An invalid or illegal string was specified.");m=O,this.hasBeenReset=!0}})),l.displayState=void 0}return A.prototype.getCueAsHTML=function(){var v=self.WebVTT;return v.convertCueToDOMTree(self,this.text)},A}()},"./src/utils/vttparser.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"parseTimeStamp",function(){return I}),j.d(V,"fixLineBreaks",function(){return f}),j.d(V,"VTTParser",function(){return p});var G=j("./src/utils/vttcue.ts"),M=function(){function l(){}var o=l.prototype;return o.decode=function(t,u){if(!t)return"";if(typeof t!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))},l}();function I(l){function o(t,u,a,i){return(t|0)*3600+(u|0)*60+(a|0)+parseFloat(i||0)}var s=l.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return s?parseFloat(s[2])>59?o(s[2],s[3],0,s[4]):o(s[1],s[2],s[3],s[4]):null}var W=function(){function l(){this.values=Object.create(null)}var o=l.prototype;return o.set=function(t,u){!this.get(t)&&u!==""&&(this.values[t]=u)},o.get=function(t,u,a){return a?this.has(t)?this.values[t]:u[a]:this.has(t)?this.values[t]:u},o.has=function(t){return t in this.values},o.alt=function(t,u,a){for(var i=0;i<a.length;++i)if(u===a[i]){this.set(t,u);break}},o.integer=function(t,u){/^-?\d+$/.test(u)&&this.set(t,parseInt(u,10))},o.percent=function(t,u){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(u)){var a=parseFloat(u);if(a>=0&&a<=100)return this.set(t,a),!0}return!1},l}();function C(l,o,s,t){var u=t?l.split(t):[l];for(var a in u){if(typeof u[a]!="string")continue;var i=u[a].split(s);if(i.length!==2)continue;var D=i[0],w=i[1];o(D,w)}}var r=new G.default(0,0,""),A=r.align==="middle"?"middle":"center";function v(l,o,s){var t=l;function u(){var D=I(l);if(D===null)throw new Error("Malformed timestamp: "+t);return l=l.replace(/^[^\sa-zA-Z-]+/,""),D}function a(D,w){var S=new W;C(D,function(_,b){var g;switch(_){case"region":for(var m=s.length-1;m>=0;m--)if(s[m].id===b){S.set(_,s[m].region);break}break;case"vertical":S.alt(_,b,["rl","lr"]);break;case"line":g=b.split(","),S.integer(_,g[0]),S.percent(_,g[0])&&S.set("snapToLines",!1),S.alt(_,g[0],["auto"]),g.length===2&&S.alt("lineAlign",g[1],["start",A,"end"]);break;case"position":g=b.split(","),S.percent(_,g[0]),g.length===2&&S.alt("positionAlign",g[1],["start",A,"end","line-left","line-right","auto"]);break;case"size":S.percent(_,b);break;case"align":S.alt(_,b,["start",A,"end","left","right"]);break}},/:/,/\s/),w.region=S.get("region",null),w.vertical=S.get("vertical","");var L=S.get("line","auto");L==="auto"&&r.line===-1&&(L=-1),w.line=L,w.lineAlign=S.get("lineAlign","start"),w.snapToLines=S.get("snapToLines",!0),w.size=S.get("size",100),w.align=S.get("align",A);var P=S.get("position","auto");P==="auto"&&r.position===50&&(P=w.align==="start"||w.align==="left"?0:w.align==="end"||w.align==="right"?100:50),w.position=P}function i(){l=l.replace(/^\s+/,"")}if(i(),o.startTime=u(),i(),l.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+t);l=l.substr(3),i(),o.endTime=u(),i(),a(l,o)}function f(l){return l.replace(/<br(?: \/)?>/gi,`
`)}var p=function(){function l(){this.state="INITIAL",this.buffer="",this.decoder=new M,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var o=l.prototype;return o.parse=function(t){var u=this;t&&(u.buffer+=u.decoder.decode(t,{stream:!0}));function a(){var P=u.buffer,_=0;for(P=f(P);_<P.length&&P[_]!=="\r"&&P[_]!==`
`;)++_;var b=P.substr(0,_);return P[_]==="\r"&&++_,P[_]===`
`&&++_,u.buffer=P.substr(_),b}function i(P){C(P,function(_,b){},/:/)}try{var D="";if(u.state==="INITIAL"){if(!/\r\n|\n/.test(u.buffer))return this;D=a();var w=D.match(/^()?WEBVTT([ \t].*)?$/);if(!w||!w[0])throw new Error("Malformed WebVTT signature.");u.state="HEADER"}for(var S=!1;u.buffer;){if(!/\r\n|\n/.test(u.buffer))return this;S?S=!1:D=a();switch(u.state){case"HEADER":/:/.test(D)?i(D):D||(u.state="ID");continue;case"NOTE":D||(u.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(D)){u.state="NOTE";break}if(!D)continue;if(u.cue=new G.default(0,0,""),u.state="CUE",D.indexOf("-->")===-1){u.cue.id=D;continue}case"CUE":if(!u.cue){u.state="BADCUE";continue}try{v(D,u.cue,u.regionList)}catch(P){u.cue=null,u.state="BADCUE";continue}u.state="CUETEXT";continue;case"CUETEXT":{var L=D.indexOf("-->")!==-1;if(!D||L&&(S=!0)){u.oncue&&u.cue&&u.oncue(u.cue),u.cue=null,u.state="ID";continue}if(u.cue===null)continue;u.cue.text&&(u.cue.text+=`
`),u.cue.text+=D}continue;case"BADCUE":D||(u.state="ID")}}}catch(P){u.state==="CUETEXT"&&u.cue&&u.oncue&&u.oncue(u.cue),u.cue=null,u.state=u.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},o.flush=function(){var t=this;try{if((t.cue||t.state==="HEADER")&&(t.buffer+=`
`,t.parse()),t.state==="INITIAL"||t.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(u){t.onparsingerror&&t.onparsingerror(u)}return t.onflush&&t.onflush(),this},l}()},"./src/utils/webvtt-parser.ts":function(Z,V,j){"use strict";j.r(V),j.d(V,"generateCueId",function(){return p}),j.d(V,"parseWebVTT",function(){return o});var G=j("./src/polyfills/number.ts"),M=j("./src/utils/vttparser.ts"),I=j("./src/demux/id3.ts"),W=j("./src/utils/timescale-conversion.ts"),C=j("./src/remux/mp4-remuxer.ts"),r=/\r\n|\n\r|\n|\r/g,A=function(t,u,a){return a===void 0&&(a=0),t.substr(a,u.length)===u},v=function(t){var u=parseInt(t.substr(-3)),a=parseInt(t.substr(-6,2)),i=parseInt(t.substr(-9,2)),D=t.length>9?parseInt(t.substr(0,t.indexOf(":"))):0;if(!Object(G.isFiniteNumber)(u)||!Object(G.isFiniteNumber)(a)||!Object(G.isFiniteNumber)(i)||!Object(G.isFiniteNumber)(D))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+t);return u+=1e3*a,u+=60*1e3*i,u+=60*60*1e3*D,u},f=function(t){for(var u=5381,a=t.length;a;)u=u*33^t.charCodeAt(--a);return(u>>>0).toString()};function p(s,t,u){return f(s.toString())+f(t.toString())+f(u)}var l=function(t,u,a){var i=t[u],D=t[i.prevCC];if(!D||!D.new&&i.new){t.ccOffset=t.presentationOffset=i.start,i.new=!1;return}for(;(w=D)!==null&&w!==void 0&&w.new;){var w;t.ccOffset+=i.start-D.start,i.new=!1,i=D,D=t[i.prevCC]}t.presentationOffset=a};function o(s,t,u,a,i,D,w,S){var L=new M.VTTParser,P=Object(I.utf8ArrayToStr)(new Uint8Array(s)).trim().replace(r,`
`).split(`
`),_=[],b=Object(W.toMpegTsClockFromTimescale)(t,u),g="00:00.000",m=0,y=0,x,O=!0,H=!1;L.oncue=function(F){var R=a[i],U=a.ccOffset,k=(m-b)/9e4;if(R!=null&&R.new&&(y!==void 0?U=a.ccOffset=R.start:l(a,i,k)),k&&(U=k-a.presentationOffset),H){var d=F.endTime-F.startTime,z=Object(C.normalizePts)((F.startTime+U-y)*9e4,D*9e4)/9e4;F.startTime=z,F.endTime=z+d}var Y=F.text.trim();F.text=decodeURIComponent(encodeURIComponent(Y)),F.id||(F.id=p(F.startTime,F.endTime,Y)),F.endTime>0&&_.push(F)},L.onparsingerror=function(F){x=F},L.onflush=function(){if(x){S(x);return}w(_)},P.forEach(function(F){if(O)if(A(F,"X-TIMESTAMP-MAP=")){O=!1,H=!0,F.substr(16).split(",").forEach(function(R){A(R,"LOCAL:")?g=R.substr(6):A(R,"MPEGTS:")&&(m=parseInt(R.substr(7)))});try{y=v(g)/1e3}catch(R){H=!1,x=R}return}else F===""&&(O=!1);L.parse(F+`
`)}),L.flush()}},"./src/utils/xhr-loader.ts":function(Z,V,j){"use strict";j.r(V);var G=j("./src/utils/logger.ts"),M=j("./src/loader/load-stats.ts"),I=/^age:\s*[\d.]+\s*$/m,W=function(){function C(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 M.LoadStats,this.retryDelay=0}var r=C.prototype;return r.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},r.abortInternal=function(){var v=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),v&&(v.onreadystatechange=null,v.onprogress=null,v.readyState!==4&&(this.stats.aborted=!0,v.abort()))},r.abort=function(){var v;this.abortInternal(),(v=this.callbacks)!==null&&v!==void 0&&v.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},r.load=function(v,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=v,this.config=f,this.callbacks=p,this.retryDelay=f.retryDelay,this.loadInternal()},r.loadInternal=function(){var v=this.config,f=this.context;if(!v)return;var p=this.loader=new self.XMLHttpRequest,l=this.stats;l.loading.first=0,l.loaded=0;var o=this.xhrSetup;try{if(o)try{o(p,f.url)}catch(u){p.open("GET",f.url,!0),o(p,f.url)}p.readyState||p.open("GET",f.url,!0);var s=this.context.headers;if(s)for(var t in s)p.setRequestHeader(t,s[t])}catch(u){this.callbacks.onError({code:p.status,text:u.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),v.timeout),p.send()},r.readystatechange=function(){var v=this.context,f=this.loader,p=this.stats;if(!v||!f)return;var l=f.readyState,o=this.config;if(p.aborted)return;if(l>=2)if(self.clearTimeout(this.requestTimeout),p.loading.first===0&&(p.loading.first=Math.max(self.performance.now(),p.loading.start)),l===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 t,u;if(v.responseType==="arraybuffer"?(t=f.response,u=t.byteLength):(t=f.responseText,u=t.length),p.loaded=p.total=u,!this.callbacks)return;var a=this.callbacks.onProgress;if(a&&a(p,v,t,f),!this.callbacks)return;var i={url:f.responseURL,data:t};this.callbacks.onSuccess(i,p,v,f)}else p.retry>=o.maxRetry||s>=400&&s<499?(G.logger.error(s+" while loading "+v.url),this.callbacks.onError({code:s,text:f.statusText},v,f)):(G.logger.warn(s+" while loading "+v.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,o.maxRetryDelay),p.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),o.timeout)},r.loadtimeout=function(){G.logger.warn("timeout while loading "+this.context.url);var v=this.callbacks;v&&(this.abortInternal(),v.onTimeout(this.stats,this.context,this.loader))},r.loadprogress=function(v){var f=this.stats;f.loaded=v.loaded,v.lengthComputable&&(f.total=v.total)},r.getCacheAge=function(){var v=null;if(this.loader&&I.test(this.loader.getAllResponseHeaders())){var f=this.loader.getResponseHeader("age");v=f?parseFloat(f):null}return v},C}();V.default=W}}).default})},vHTk:function(Bt,ve,T){Bt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return jt});var Z=T("rePB"),V=T("VTBJ"),j=T("KQm4"),G=T("U8pU"),M=T("ODXe"),I=T("q1tI"),W=T("TSYQ"),C=T.n(W),r=T("Gytx"),A=T.n(r),v=T("Kwbf"),f=T("t23M"),p=T("qx4F"),l=T("6eGT"),o=T("IBYe"),s=T("Ff2n"),t=T("c+Xe"),u=T("fyJ8"),a=T("biw7");function i(at,Qe,Et,It,dt){var mt=Et[at]||{},We=Et[Qe]||{},De,Le;mt.fixed==="left"?De=It.left[at]:We.fixed==="right"&&(Le=It.right[Qe]);var de=!1,fe=!1,Ee=!1,Pe=!1,Ue=Et[Qe+1],lt=Et[at-1];if(dt==="rtl"){if(De!==void 0){var Ot=lt&&lt.fixed==="left";Pe=!Ot}else if(Le!==void 0){var cn=Ue&&Ue.fixed==="right";Ee=!cn}}else if(De!==void 0){var An=Ue&&Ue.fixed==="left";de=!An}else if(Le!==void 0){var Ct=lt&&lt.fixed==="right";fe=!Ct}return{fixLeft:De,fixRight:Le,lastFixLeft:de,firstFixRight:fe,lastFixRight:Ee,firstFixLeft:Pe,isSticky:It.isSticky}}var D=T("sR1s");function w(at){var Qe=at.cells,Et=at.stickyOffsets,It=at.flattenColumns,dt=at.rowComponent,mt=at.cellComponent,We=at.onHeaderRow,De=at.index,Le=I.useContext(a.a),de=Le.prefixCls,fe=Le.direction,Ee;We&&(Ee=We(Qe.map(function(Ue){return Ue.column}),De));var Pe=Object(D.a)(Qe.map(function(Ue){return Ue.column}));return I.createElement(dt,Object.assign({},Ee),Qe.map(function(Ue,lt){var Ot=Ue.column,cn=i(Ue.colStart,Ue.colEnd,It,Et,fe),An;return Ot&&Ot.onHeaderCell&&(An=Ue.column.onHeaderCell(Ot)),I.createElement(u.a,Object.assign({},Ue,{ellipsis:Ot.ellipsis,align:Ot.align,component:mt,prefixCls:de,key:Pe[lt]},cn,{additionalProps:An,rowType:"header"}))}))}w.displayName="HeaderRow";var S=w;function L(at){var Qe=[];function Et(We,De){var Le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Qe[Le]=Qe[Le]||[];var de=De,fe=We.filter(Boolean).map(function(Ee){var Pe={key:Ee.key,className:Ee.className||"",children:Ee.title,column:Ee,colStart:de},Ue=1,lt=Ee.children;return lt&&lt.length>0&&(Ue=Et(lt,de,Le+1).reduce(function(Ot,cn){return Ot+cn},0),Pe.hasSubColumns=!0),"colSpan"in Ee&&(Ue=Ee.colSpan),"rowSpan"in Ee&&(Pe.rowSpan=Ee.rowSpan),Pe.colSpan=Ue,Pe.colEnd=Pe.colStart+Ue-1,Qe[Le].push(Pe),de+=Ue,Ue});return fe}Et(at,0);for(var It=Qe.length,dt=function(De){Qe[De].forEach(function(Le){!("rowSpan"in Le)&&!Le.hasSubColumns&&(Le.rowSpan=It-De)})},mt=0;mt<It;mt+=1)dt(mt);return Qe}function P(at){var Qe=at.stickyOffsets,Et=at.columns,It=at.flattenColumns,dt=at.onHeaderRow,mt=I.useContext(a.a),We=mt.prefixCls,De=mt.getComponent,Le=I.useMemo(function(){return L(Et)},[Et]),de=De(["header","wrapper"],"thead"),fe=De(["header","row"],"tr"),Ee=De(["header","cell"],"th");return I.createElement(de,{className:"".concat(We,"-thead")},Le.map(function(Pe,Ue){var lt=I.createElement(S,{key:Ue,flattenColumns:It,cells:Pe,stickyOffsets:Qe,rowComponent:fe,cellComponent:Ee,onHeaderRow:dt,index:Ue});return lt}))}var _=P,b=T("hW8S");function g(at){for(var Qe=at.colWidths,Et=at.columns,It=at.columCount,dt=[],mt=It||Et.length,We=!1,De=mt-1;De>=0;De-=1){var Le=Qe[De],de=Et&&Et[De],fe=de&&de[b.a];(Le||fe||We)&&(dt.unshift(I.createElement("col",Object.assign({key:De,style:{width:Le,minWidth:Le}},fe))),We=!0)}return I.createElement("colgroup",null,dt)}var m=g;function y(at,Qe){return Object(I.useMemo)(function(){for(var Et=[],It=0;It<Qe;It+=1){var dt=at[It];if(dt!==void 0)Et[It]=dt;else return null}return Et},[at.join("_"),Qe])}var x=I.forwardRef(function(at,Qe){var Et=at.noData,It=at.columns,dt=at.flattenColumns,mt=at.colWidths,We=at.columCount,De=at.stickyOffsets,Le=at.direction,de=at.fixHeader,fe=at.offsetHeader,Ee=at.stickyClassName,Pe=at.onScroll,Ue=Object(s.a)(at,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),lt=I.useContext(a.a),Ot=lt.prefixCls,cn=lt.scrollbarSize,An=lt.isSticky,Ct=An&&!de?0:cn,Gt=I.useRef(null),xt=I.useCallback(function(nn){Object(t.b)(Qe,nn),Object(t.b)(Gt,nn)},[]);I.useEffect(function(){var nn;function qt(Ke){var st=Ke.currentTarget,bt=Ke.deltaX;bt&&(Pe({currentTarget:st,scrollLeft:st.scrollLeft+bt}),Ke.preventDefault())}return(nn=Gt.current)===null||nn===void 0||nn.addEventListener("wheel",qt),function(){var Ke;(Ke=Gt.current)===null||Ke===void 0||Ke.removeEventListener("wheel",qt)}},[]);var Rt=dt[dt.length-1],gt={fixed:Rt?Rt.fixed:null,onHeaderCell:function(){return{className:"".concat(Ot,"-cell-scrollbar")}}},be=Object(I.useMemo)(function(){return Ct?[].concat(Object(j.a)(It),[gt]):It},[Ct,It]),Ie=Object(I.useMemo)(function(){return Ct?[].concat(Object(j.a)(dt),[gt]):dt},[Ct,dt]),Dt=Object(I.useMemo)(function(){var nn=De.right,qt=De.left;return Object(V.a)(Object(V.a)({},De),{},{left:Le==="rtl"?[].concat(Object(j.a)(qt.map(function(Ke){return Ke+Ct})),[0]):qt,right:Le==="rtl"?nn:[].concat(Object(j.a)(nn.map(function(Ke){return Ke+Ct})),[0]),isSticky:An})},[Ct,De,An]),ht=y(mt,We);return I.createElement("div",{style:Object(V.a)({overflow:"hidden"},An?{top:fe}:{}),ref:xt,className:C()("".concat(Ot,"-header"),Object(Z.a)({},Ee,!!Ee))},I.createElement("table",{style:{tableLayout:"fixed",visibility:Et||ht?null:"hidden"}},I.createElement(m,{colWidths:ht?[].concat(Object(j.a)(ht),[Ct]):[],columCount:We+1,columns:Ie}),I.createElement(_,Object.assign({},Ue,{stickyOffsets:Dt,columns:be,flattenColumns:Ie}))))});x.displayName="FixedHeader";var O=x,H=I.createContext(null),F=H;function R(at){var Qe=at.prefixCls,Et=at.children,It=at.component,dt=at.cellComponent,mt=at.fixHeader,We=at.fixColumn,De=at.horizonScroll,Le=at.className,de=at.expanded,fe=at.componentWidth,Ee=at.colSpan,Pe=I.useContext(a.a),Ue=Pe.scrollbarSize;return I.useMemo(function(){var lt=Et;return We&&(lt=I.createElement("div",{style:{width:fe-(mt?Ue:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Qe,"-expanded-row-fixed")},lt)),I.createElement(It,{className:Le,style:{display:de?null:"none"}},I.createElement(u.a,{component:dt,prefixCls:Qe,colSpan:Ee},lt))},[Et,It,mt,De,Le,de,fe,Ee,Ue])}var U=R;function k(at){var Qe=at.className,Et=at.style,It=at.record,dt=at.index,mt=at.rowKey,We=at.getRowKey,De=at.rowExpandable,Le=at.expandedKeys,de=at.onRow,fe=at.indent,Ee=fe===void 0?0:fe,Pe=at.rowComponent,Ue=at.cellComponent,lt=at.childrenColumnName,Ot=I.useContext(a.a),cn=Ot.prefixCls,An=Ot.fixedInfoList,Ct=I.useContext(F),Gt=Ct.fixHeader,xt=Ct.fixColumn,Rt=Ct.horizonScroll,gt=Ct.componentWidth,be=Ct.flattenColumns,Ie=Ct.expandableType,Dt=Ct.expandRowByClick,ht=Ct.onTriggerExpand,nn=Ct.rowClassName,qt=Ct.expandedRowClassName,Ke=Ct.indentSize,st=Ct.expandIcon,bt=Ct.expandedRowRender,Ft=Ct.expandIconColumnIndex,$t=I.useState(!1),gn=Object(M.a)($t,2),er=gn[0],Hn=gn[1],yn=Le&&Le.has(at.recordKey);I.useEffect(function(){yn&&Hn(!0)},[yn]);var Sr=Ie==="row"&&(!De||De(It)),_r=Ie==="nest",ar=lt&&It&&It[lt],cr=Sr||_r,Pr;de&&(Pr=de(It,dt));var Qr=function(N){if(Dt&&cr&&ht(It,N),Pr&&Pr.onClick){for(var B,X=arguments.length,ue=new Array(X>1?X-1:0),q=1;q<X;q++)ue[q-1]=arguments[q];(B=Pr).onClick.apply(B,[N].concat(ue))}},ca;typeof nn=="string"?ca=nn:typeof nn=="function"&&(ca=nn(It,dt,Ee));var hn=Object(D.a)(be),ir=I.createElement(Pe,Object.assign({},Pr,{"data-row-key":mt,className:C()(Qe,"".concat(cn,"-row"),"".concat(cn,"-row-level-").concat(Ee),ca,Pr&&Pr.className),style:Object(V.a)(Object(V.a)({},Et),Pr?Pr.style:null),onClick:Qr}),be.map(function(ee,N){var B=ee.render,X=ee.dataIndex,ue=ee.className,q=hn[N],Ze=An[N],Jt;N===(Ft||0)&&_r&&(Jt=I.createElement(I.Fragment,null,I.createElement("span",{style:{paddingLeft:"".concat(Ke*Ee,"px")},className:"".concat(cn,"-row-indent indent-level-").concat(Ee)}),st({prefixCls:cn,expanded:yn,expandable:ar,record:It,onExpand:ht})));var On;return ee.onCell&&(On=ee.onCell(It,dt)),I.createElement(u.a,Object.assign({className:ue,ellipsis:ee.ellipsis,align:ee.align,component:Ue,prefixCls:cn,key:q,record:It,index:dt,dataIndex:X,render:B,shouldCellUpdate:ee.shouldCellUpdate},Ze,{appendNode:Jt,additionalProps:On}))})),va;if(Sr&&(er||yn)){var Pa=bt(It,dt,Ee+1,yn),sa=qt&&qt(It,dt,Ee);va=I.createElement(U,{expanded:yn,className:C()("".concat(cn,"-expanded-row"),"".concat(cn,"-expanded-row-level-").concat(Ee+1),sa),prefixCls:cn,fixHeader:Gt,fixColumn:xt,horizonScroll:Rt,component:Pe,componentWidth:gt,cellComponent:Ue,colSpan:be.length},Pa)}var la;return ar&&yn&&(la=(It[lt]||[]).map(function(ee,N){var B=We(ee,N);return I.createElement(k,Object.assign({},at,{key:B,rowKey:B,record:ee,recordKey:B,index:N,indent:Ee+1}))})),I.createElement(I.Fragment,null,ir,va,la)}k.displayName="BodyRow";var d=k,z=I.createContext(null),Y=z;function re(at){var Qe=at.columnKey,Et=at.onColumnResize,It=I.useRef();return I.useEffect(function(){It.current&&Et(Qe,It.current.offsetWidth)},[]),I.createElement(f.a,{onResize:function(mt){var We=mt.offsetWidth;Et(Qe,We)}},I.createElement("td",{ref:It,style:{padding:0,border:0,height:0}},I.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function le(at){var Qe=at.data,Et=at.getRowKey,It=at.measureColumnWidth,dt=at.expandedKeys,mt=at.onRow,We=at.rowExpandable,De=at.emptyNode,Le=at.childrenColumnName,de=I.useContext(Y),fe=de.onColumnResize,Ee=I.useContext(a.a),Pe=Ee.prefixCls,Ue=Ee.getComponent,lt=I.useContext(F),Ot=lt.fixHeader,cn=lt.horizonScroll,An=lt.flattenColumns,Ct=lt.componentWidth;return I.useMemo(function(){var Gt=Ue(["body","wrapper"],"tbody"),xt=Ue(["body","row"],"tr"),Rt=Ue(["body","cell"],"td"),gt;Qe.length?gt=Qe.map(function(Ie,Dt){var ht=Et(Ie,Dt);return I.createElement(d,{key:ht,rowKey:ht,record:Ie,recordKey:ht,index:Dt,rowComponent:xt,cellComponent:Rt,expandedKeys:dt,onRow:mt,getRowKey:Et,rowExpandable:We,childrenColumnName:Le})}):gt=I.createElement(U,{expanded:!0,className:"".concat(Pe,"-placeholder"),prefixCls:Pe,fixHeader:Ot,fixColumn:cn,horizonScroll:cn,component:xt,componentWidth:Ct,cellComponent:Rt,colSpan:An.length},De);var be=Object(D.a)(An);return I.createElement(Gt,{className:"".concat(Pe,"-tbody")},It&&I.createElement("tr",{"aria-hidden":"true",className:"".concat(Pe,"-measure-row"),style:{height:0}},be.map(function(Ie){return I.createElement(re,{key:Ie,columnKey:Ie,onColumnResize:fe})})),gt)},[Qe,Pe,mt,It,dt,Et,Ue,Ct,De,An])}var Ne=I.memo(le);Ne.displayName="Body";var Ce=Ne,Te=T("wRmb"),Fe=T("xEkU"),Ve=T.n(Fe);function xe(at){var Qe=Object(I.useRef)(at),Et=Object(I.useState)({}),It=Object(M.a)(Et,2),dt=It[1],mt=Object(I.useRef)(null),We=Object(I.useRef)([]);function De(Le){mt.current===null&&(We.current=[],mt.current=Ve()(function(){We.current.forEach(function(de){Qe.current=de(Qe.current)}),mt.current=null,dt({})})),We.current.push(Le)}return Object(I.useEffect)(function(){return function(){Ve.a.cancel(mt.current)}},[]),[Qe.current,De]}function ye(at){var Qe=Object(I.useRef)(at),Et=Object(I.useRef)(null);function It(){window.clearTimeout(Et.current)}function dt(We){Qe.current=We,It(),Et.current=window.setTimeout(function(){Qe.current=null,Et.current=null},100)}function mt(){return Qe.current}return Object(I.useEffect)(function(){return It},[]),[dt,mt]}function oe(at,Qe,Et){var It=Object(I.useMemo)(function(){for(var dt=[],mt=[],We=0,De=0,Le=0;Le<Qe;Le+=1)if(Et==="rtl"){mt[Le]=De,De+=at[Le]||0;var de=Qe-Le-1;dt[de]=We,We+=at[de]||0}else{dt[Le]=We,We+=at[Le]||0;var fe=Qe-Le-1;mt[fe]=De,De+=at[fe]||0}return{left:dt,right:mt}},[at,Qe,Et]);return It}var Se=oe;function _e(at){var Qe=at.className,Et=at.children;return I.createElement("div",{className:Qe},Et)}var He=_e,rt=T("n6Qo");function ae(at){var Qe,Et=at.prefixCls,It=at.record,dt=at.onExpand,mt=at.expanded,We=at.expandable,De="".concat(Et,"-row-expand-icon");if(!We)return I.createElement("span",{className:C()(De,"".concat(Et,"-row-spaced"))});var Le=function(fe){dt(It,fe),fe.stopPropagation()};return I.createElement("span",{className:C()(De,(Qe={},Object(Z.a)(Qe,"".concat(Et,"-row-expanded"),mt),Object(Z.a)(Qe,"".concat(Et,"-row-collapsed"),!mt),Qe)),onClick:Le})}function $(at,Qe,Et){var It=[];function dt(mt){(mt||[]).forEach(function(We,De){It.push(Qe(We,De)),dt(We[Et])})}return dt(at),It}var Q=T("zT1h"),te=T("y0+3"),he=function(Qe,Et){var It,dt,mt=Qe.scrollBodyRef,We=Qe.onScroll,De=Qe.offsetScroll,Le=I.useContext(a.a),de=Le.prefixCls,fe=((It=mt.current)===null||It===void 0?void 0:It.scrollWidth)||0,Ee=((dt=mt.current)===null||dt===void 0?void 0:dt.clientWidth)||0,Pe=fe&&Ee*(Ee/fe),Ue=I.useRef(),lt=xe({scrollLeft:0,isHiddenScrollBar:!1}),Ot=Object(M.a)(lt,2),cn=Ot[0],An=Ot[1],Ct=I.useRef({delta:0,x:0}),Gt=I.useState(!1),xt=Object(M.a)(Gt,2),Rt=xt[0],gt=xt[1],be=function(){gt(!1)},Ie=function(Ke){Ke.persist(),Ct.current.delta=Ke.pageX-cn.scrollLeft,Ct.current.x=0,gt(!0),Ke.preventDefault()},Dt=function(Ke){var st,bt=Ke||((st=window)===null||st===void 0?void 0:st.event),Ft=bt.buttons;if(!Rt||Ft===0){Rt&&gt(!1);return}var $t=Ct.current.x+Ke.pageX-Ct.current.x-Ct.current.delta;$t<=0&&($t=0),$t+Pe>=Ee&&($t=Ee-Pe),We({scrollLeft:$t/Ee*(fe+2)}),Ct.current.x=Ke.pageX},ht=function(){var Ke=Object(te.b)(mt.current).top,st=Ke+mt.current.offsetHeight,bt=document.documentElement.scrollTop+window.innerHeight;st-Object(p.a)()<=bt||Ke>=bt-De?An(function(Ft){return Object(V.a)(Object(V.a)({},Ft),{},{isHiddenScrollBar:!0})}):An(function(Ft){return Object(V.a)(Object(V.a)({},Ft),{},{isHiddenScrollBar:!1})})},nn=function(Ke){An(function(st){return Object(V.a)(Object(V.a)({},st),{},{scrollLeft:Ke/fe*Ee||0})})};return I.useImperativeHandle(Et,function(){return{setScrollLeft:nn}}),I.useEffect(function(){var qt=Object(Q.a)(document.body,"mouseup",be,!1),Ke=Object(Q.a)(document.body,"mousemove",Dt,!1);return ht(),function(){qt.remove(),Ke.remove()}},[Pe,Rt]),I.useEffect(function(){var qt=Object(Q.a)(window,"scroll",ht,!1),Ke=Object(Q.a)(window,"resize",ht,!1);return function(){qt.remove(),Ke.remove()}},[]),I.useEffect(function(){cn.isHiddenScrollBar||An(function(qt){var Ke,st;return Object(V.a)(Object(V.a)({},qt),{},{scrollLeft:mt.current.scrollLeft/((Ke=mt.current)===null||Ke===void 0?void 0:Ke.scrollWidth)*((st=mt.current)===null||st===void 0?void 0:st.clientWidth)})})},[cn.isHiddenScrollBar]),fe<=Ee||!Pe||cn.isHiddenScrollBar?null:I.createElement("div",{style:{height:Object(p.a)(),width:Ee,bottom:De},className:"".concat(de,"-sticky-scroll")},I.createElement("div",{onMouseDown:Ie,ref:Ue,className:C()("".concat(de,"-sticky-scroll-bar"),Object(Z.a)({},"".concat(de,"-sticky-scroll-bar-active"),Rt)),style:{width:"".concat(Pe,"px"),transform:"translate3d(".concat(cn.scrollLeft,"px, 0, 0)")}}))},ge=I.forwardRef(he);function we(at,Qe){return I.useMemo(function(){var Et=!!at;return{isSticky:Et,stickyClassName:Et?"".concat(Qe,"-sticky-header"):"",offsetHeader:Object(G.a)(at)==="object"&&at.offsetHeader||0,offsetScroll:Object(G.a)(at)==="object"&&at.offsetScroll||0}},[at,Qe])}var ft=[],Pt={},jt="rc-table-internal-hook",qe=I.memo(function(at){var Qe=at.children;return Qe},function(at,Qe){return A()(at.props,Qe.props)?at.pingLeft!==Qe.pingLeft||at.pingRight!==Qe.pingRight:!1});function Mt(at){var Qe,Et=at.prefixCls,It=at.className,dt=at.rowClassName,mt=at.style,We=at.data,De=at.rowKey,Le=at.scroll,de=at.tableLayout,fe=at.direction,Ee=at.title,Pe=at.footer,Ue=at.summary,lt=at.id,Ot=at.showHeader,cn=at.components,An=at.emptyText,Ct=at.onRow,Gt=at.onHeaderRow,xt=at.internalHooks,Rt=at.transformColumns,gt=at.internalRefs,be=at.sticky,Ie=We||ft,Dt=!!Ie.length,ht=I.useState(0),nn=Object(M.a)(ht,2),qt=nn[0],Ke=nn[1];I.useEffect(function(){Ke(Object(p.a)())});var st=I.useMemo(function(){return Object(D.c)(cn,{})},[cn]),bt=I.useCallback(function(Wt,Ht){return Object(D.b)(st,Wt)||Ht},[st]),Ft=I.useMemo(function(){return typeof De=="function"?De:function(Wt){var Ht=Wt&&Wt[De];return Ht}},[De]),$t=Object(b.c)(at),gn=$t.expandIcon,er=$t.expandedRowKeys,Hn=$t.defaultExpandedRowKeys,yn=$t.defaultExpandAllRows,Sr=$t.expandedRowRender,_r=$t.onExpand,ar=$t.onExpandedRowsChange,cr=$t.expandRowByClick,Pr=$t.rowExpandable,Qr=$t.expandIconColumnIndex,ca=$t.expandedRowClassName,hn=$t.childrenColumnName,ir=$t.indentSize,va=gn||ae,Pa=hn||"children",sa=I.useMemo(function(){return Sr?"row":at.expandable&&xt===jt&&at.expandable.__PARENT_RENDER_ICON__||Ie.some(function(Wt){return Wt&&Object(G.a)(Wt)==="object"&&Wt[Pa]})?"nest":!1},[!!Sr,Ie]),la=I.useState(function(){return Hn||(yn?$(Ie,Ft,Pa):[])}),ee=Object(M.a)(la,2),N=ee[0],B=ee[1],X=I.useMemo(function(){return new Set(er||N||[])},[er,N]),ue=I.useCallback(function(Wt){var Ht=Ft(Wt,Ie.indexOf(Wt)),dn,Xt=X.has(Ht);Xt?(X.delete(Ht),dn=Object(j.a)(X)):dn=[].concat(Object(j.a)(X),[Ht]),B(dn),_r&&_r(!Xt,Wt),ar&&ar(dn)},[Ft,X,Ie,_r,ar]),q=I.useState(0),Ze=Object(M.a)(q,2),Jt=Ze[0],On=Ze[1],Xn=Object(Te.b)(Object(V.a)(Object(V.a)(Object(V.a)({},at),$t),{},{expandable:!!Sr,expandedKeys:X,getRowKey:Ft,onTriggerExpand:ue,expandIcon:va,expandIconColumnIndex:Qr,direction:fe}),xt===jt?Rt:null),un=Object(M.a)(Xn,2),nr=un[0],mr=un[1],Kr=I.useMemo(function(){return{columns:nr,flattenColumns:mr}},[nr,mr]),ma=I.useRef(),da=I.useRef(),Zr=I.useRef(),za=I.useState(!1),oi=Object(M.a)(za,2),ua=oi[0],Na=oi[1],ti=I.useState(!1),Ga=Object(M.a)(ti,2),ba=Ga[0],zn=Ga[1],bn=xe(new Map),kn=Object(M.a)(bn,2),Wn=kn[0],dr=kn[1],ne=Object(D.a)(mr),Re=ne.map(function(Wt){return Wn.get(Wt)}),$e=I.useMemo(function(){return Re},[Re.join("_")]),Be=Se($e,mr.length,fe),Ye=Le&&Object(D.d)(Le.y),et=Le&&Object(D.d)(Le.x),it=et&&mr.some(function(Wt){var Ht=Wt.fixed;return Ht}),Ae=I.useRef(),ze=we(be,Et),yt=ze.isSticky,en=ze.offsetHeader,Tt=ze.offsetScroll,vt=ze.stickyClassName,ct,St,Ut;Ye&&(St={overflowY:"scroll",maxHeight:Le.y}),et&&(ct={overflowX:"auto"},Ye||(St={overflowY:"hidden"}),Ut={width:Le.x===!0?"auto":Le.x,minWidth:"100%"});var At=I.useCallback(function(Wt,Ht){dr(function(dn){var Xt=new Map(dn);return Xt.set(Wt,Ht),Xt})},[]),on=ye(null),xn=Object(M.a)(on,2),vn=xn[0],Qt=xn[1];function Dn(Wt,Ht){if(!Ht)return;typeof Ht=="function"?Ht(Wt):Ht.scrollLeft!==Wt&&(Ht.scrollLeft=Wt)}var Rn=function(Ht){var dn=Ht.currentTarget,Xt=Ht.scrollLeft,ln=typeof Xt=="number"?Xt:dn.scrollLeft,Zn=dn||Pt;if(!Qt()||Qt()===Zn){var qn;vn(Zn),Dn(ln,da.current),Dn(ln,Zr.current),Dn(ln,(qn=Ae.current)===null||qn===void 0?void 0:qn.setScrollLeft)}if(dn){var En=dn.scrollWidth,Tr=dn.clientWidth;Na(ln>0),zn(ln<En-Tr)}},zt=function(){Zr.current&&Rn({currentTarget:Zr.current})},Kt=function(Ht){var dn=Ht.width;zt(),On(ma.current?ma.current.offsetWidth:dn)};I.useEffect(function(){return zt},[]),I.useEffect(function(){et&&zt()},[et]),I.useEffect(function(){xt===jt&&gt&&(gt.body.current=Zr.current)});var Cn=bt(["table"],"table"),Zt=I.useMemo(function(){return de||(it?Le.x==="max-content"?"auto":"fixed":Ye||mr.some(function(Wt){var Ht=Wt.ellipsis;return Ht})?"fixed":"auto")},[Ye,it,mr,de]),Nn,Vt={colWidths:$e,columCount:mr.length,stickyOffsets:Be,onHeaderRow:Gt,fixHeader:Ye},Un=I.useMemo(function(){return Dt?null:typeof An=="function"?An():An},[Dt,An]),Lt=I.createElement(Ce,{data:Ie,measureColumnWidth:Ye||et||yt,expandedKeys:X,rowExpandable:Pr,getRowKey:Ft,onRow:Ct,emptyNode:Un,childrenColumnName:Pa}),kt=I.createElement(m,{colWidths:mr.map(function(Wt){var Ht=Wt.width;return Ht}),columns:mr}),sr=Ue&&I.createElement(rt.b,null,Ue(Ie)),Sn=bt(["body"]);if(Ye||yt){var Mn;typeof Sn=="function"?(Mn=Sn(Ie,{scrollbarSize:qt,ref:Zr,onScroll:Rn}),Vt.colWidths=mr.map(function(Wt,Ht){var dn=Wt.width,Xt=Ht===nr.length-1?dn-qt:dn;return typeof Xt=="number"&&!Number.isNaN(Xt)?Xt:(Object(v.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):Mn=I.createElement("div",{style:Object(V.a)(Object(V.a)({},ct),St),onScroll:Rn,ref:Zr,className:C()("".concat(Et,"-body"))},I.createElement(Cn,{style:Object(V.a)(Object(V.a)({},Ut),{},{tableLayout:Zt})},kt,Lt,sr),yt&&I.createElement(ge,{ref:Ae,offsetScroll:Tt,scrollBodyRef:Zr,onScroll:Rn})),Nn=I.createElement(I.Fragment,null,Ot!==!1&&I.createElement(O,Object.assign({noData:!Ie.length},Vt,Kr,{direction:fe,offsetHeader:en,stickyClassName:vt,ref:da,onScroll:Rn})),Mn)}else Nn=I.createElement("div",{style:Object(V.a)(Object(V.a)({},ct),St),className:C()("".concat(Et,"-content")),onScroll:Rn,ref:Zr},I.createElement(Cn,{style:Object(V.a)(Object(V.a)({},Ut),{},{tableLayout:Zt})},kt,Ot!==!1&&I.createElement(_,Object.assign({},Vt,Kr)),Lt,sr));var wn=Object(b.b)(at),an=I.createElement("div",Object.assign({className:C()(Et,It,(Qe={},Object(Z.a)(Qe,"".concat(Et,"-rtl"),fe==="rtl"),Object(Z.a)(Qe,"".concat(Et,"-ping-left"),ua),Object(Z.a)(Qe,"".concat(Et,"-ping-right"),ba),Object(Z.a)(Qe,"".concat(Et,"-layout-fixed"),de==="fixed"),Object(Z.a)(Qe,"".concat(Et,"-fixed-header"),Ye),Object(Z.a)(Qe,"".concat(Et,"-fixed-column"),it),Object(Z.a)(Qe,"".concat(Et,"-scroll-horizontal"),et),Object(Z.a)(Qe,"".concat(Et,"-has-fix-left"),mr[0]&&mr[0].fixed),Object(Z.a)(Qe,"".concat(Et,"-has-fix-right"),mr[mr.length-1]&&mr[mr.length-1].fixed==="right"),Qe)),style:mt,id:lt,ref:ma},wn),I.createElement(qe,{pingLeft:ua,pingRight:ba,props:Object(V.a)(Object(V.a)({},at),{},{stickyOffsets:Be,mergedExpandedKeys:X})},Ee&&I.createElement(He,{className:"".concat(Et,"-title")},Ee(Ie)),I.createElement("div",{className:"".concat(Et,"-container")},Nn),Pe&&I.createElement(He,{className:"".concat(Et,"-footer")},Pe(Ie))));et&&(an=I.createElement(f.a,{onResize:Kt},an));var Yt=I.useMemo(function(){return{prefixCls:Et,getComponent:bt,scrollbarSize:qt,direction:fe,fixedInfoList:mr.map(function(Wt,Ht){return i(Ht,Ht,mr,Be,fe)}),isSticky:yt}},[Et,bt,qt,fe,mr,Be,fe,yt]),Gn=I.useMemo(function(){return Object(V.a)(Object(V.a)({},Kr),{},{tableLayout:Zt,rowClassName:dt,expandedRowClassName:ca,componentWidth:Jt,fixHeader:Ye,fixColumn:it,horizonScroll:et,expandIcon:va,expandableType:sa,expandRowByClick:cr,expandedRowRender:Sr,onTriggerExpand:ue,expandIconColumnIndex:Qr,indentSize:ir})},[Kr,Zt,dt,ca,Jt,Ye,it,et,va,sa,cr,Sr,ue,Qr,ir]),mn=I.useMemo(function(){return{onColumnResize:At}},[At]);return I.createElement(a.a.Provider,{value:Yt},I.createElement(F.Provider,{value:Gn},I.createElement(Y.Provider,{value:mn},an)))}Mt.Column=o.a,Mt.ColumnGroup=l.a,Mt.Summary=rt.a,Mt.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var sn=ve.b=Mt},wRmb:function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return A});var Z=T("rePB"),V=T("KQm4"),j=T("VTBJ"),G=T("Ff2n"),M=T("q1tI"),I=T.n(M),W=T("Kwbf"),C=T("Zm9Q"),r=T("hW8S");function A(o){return Object(C.a)(o).filter(function(s){return M.isValidElement(s)}).map(function(s){var t=s.key,u=s.props,a=u.children,i=Object(G.a)(u,["children"]),D=Object(j.a)({key:t},i);return a&&(D.children=A(a)),D})}function v(o){return o.reduce(function(s,t){var u=t.fixed,a=u===!0?"left":u,i=t.children;return i&&i.length>0?[].concat(Object(V.a)(s),Object(V.a)(v(i).map(function(D){return Object(j.a)({fixed:a},D)}))):[].concat(Object(V.a)(s),[Object(j.a)(Object(j.a)({},t),{},{fixed:a})])},[])}function f(o){for(var s=!0,t=0;t<o.length;t+=1){var u=o[t];if(s&&u.fixed!=="left")s=!1;else if(!s&&u.fixed==="left"){Object(W.a)(!1,"Index ".concat(t-1," of `columns` missing `fixed='left'` prop."));break}}for(var a=!0,i=o.length-1;i>=0;i-=1){var D=o[i];if(a&&D.fixed!=="right")a=!1;else if(!a&&D.fixed==="right"){Object(W.a)(!1,"Index ".concat(i+1," of `columns` missing `fixed='right'` prop."));break}}}function p(o){return o.map(function(s){var t=s.fixed,u=Object(G.a)(s,["fixed"]),a=t;return t==="left"?a="right":t==="right"&&(a="left"),Object(j.a)({fixed:a},u)})}function l(o,s){var t=o.prefixCls,u=o.columns,a=o.children,i=o.expandable,D=o.expandedKeys,w=o.getRowKey,S=o.onTriggerExpand,L=o.expandIcon,P=o.rowExpandable,_=o.expandIconColumnIndex,b=o.direction,g=o.expandRowByClick,m=M.useMemo(function(){return u||A(a)},[u,a]),y=M.useMemo(function(){if(i){var H,F=_||0,R=m[F],U=(H={},Object(Z.a)(H,r.a,{className:"".concat(t,"-expand-icon-col")}),Object(Z.a)(H,"title",""),Object(Z.a)(H,"fixed",R?R.fixed:null),Object(Z.a)(H,"className","".concat(t,"-row-expand-icon-cell")),Object(Z.a)(H,"render",function(z,Y,re){var le=w(Y,re),Ne=D.has(le),Ce=P?P(Y):!0,Te=L({prefixCls:t,expanded:Ne,expandable:Ce,record:Y,onExpand:S});return g?M.createElement("span",{onClick:function(Ve){return Ve.stopPropagation()}},Te):Te}),H),k=m.slice();return F>=0&&k.splice(F,0,U),k}return m},[i,m,w,D,L,b]),x=M.useMemo(function(){var H=y;return s&&(H=s(H)),H.length||(H=[{render:function(){return null}}]),H},[s,y,b]),O=M.useMemo(function(){return b==="rtl"?p(v(x)):v(x)},[x,b]);return[x,O]}ve.b=l},wzkS:function(Bt,ve,T){"use strict";T.d(ve,"c",function(){return M}),T.d(ve,"b",function(){return I}),T.d(ve,"d",function(){return W}),T.d(ve,"a",function(){return r}),T.d(ve,"e",function(){return A});var Z=T("9og8"),V=T("WmNS"),j=T.n(V),G=T("ErOA");function M(v){return Object(G.c)("libraries/".concat(v,".json"))}function I(){return Object(G.c)("library_tags.json")}function W(v){return C.apply(this,arguments)}function C(){return C=Object(Z.a)(j.a.mark(function v(f){var p;return j.a.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,Object(G.b)("attachments/".concat(f,".json"));case 2:return p=o.sent,o.abrupt("return",p.status===0);case 4:case"end":return o.stop()}},v)})),C.apply(this,arguments)}function r(v){return Object(G.f)("libraries.json",v)}function A(v,f){return Object(G.g)("libraries/".concat(v,".json"),f)}},xOL1:function(Bt,ve){Bt.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAbVJREFUOE+Nk79rFUEUhb+zE4OFwUD+CyGKKQQbSaMikQQ7C1tBBIsUQaJvl2Fn/cWDpAiIYJsi7YOIaCUWFoKKRhG0sbEzEImFGnev7G6yyXsxeU5159yZb87l3hG9q2WLiBO79FIwXpLp0s6cwITnQCMWrGDM43jdBckZQ0wTMdrong2R2Bxm0/98sZ8ozdcOEm5hjOC41u9Olc9ZQKySclOVkNhljCmCzjeAJM/4FbW5p+8k5tlggTtarfKxLSM6pHq4BTiL0SboaAOIi284jeP1nti+ApMEvdoEvEPMkOpJDZi1IwzwgqDh/wSsYZwk08ca4O0Qua3zW8OV5crmHg6u22EGbQ2nIbx+1IC6rrK+cYJW9gXEVrbxGUEj5bltQGJvgBapHu0LSGwCyEh1vBsQWwd4TNCDPg6uAOcImuoFlL1dJ9WNPg5uYwwRVM3MzhJmKIpjZK6e9bj4jNNpvL4QFx9wuoDXJ1r5IlH0llTtXgcXwa4SolObnYnwKnbFcfEcdJ+gpW6AtzFynuIop/Fn053u4CA5yzjO4FV9tu0Syl2S38WiSWBgD8AfoEPQ7Fb+LwIiyhxWwe2KAAAAAElFTkSuQmCC"},"y0+3":function(Bt,ve,T){"use strict";T.d(ve,"a",function(){return v}),T.d(ve,"b",function(){return p});var Z=/margin|padding|width|height|max|min|offset/,V={left:!0,top:!0},j={cssFloat:1,styleFloat:1,float:1};function G(l){return l.nodeType===1?l.ownerDocument.defaultView.getComputedStyle(l,null):{}}function M(l,o,s){if(o=o.toLowerCase(),s==="auto"){if(o==="height")return l.offsetHeight;if(o==="width")return l.offsetWidth}return o in V||(V[o]=Z.test(o)),V[o]?parseFloat(s)||0:s}function I(l,o){var s=arguments.length,t=G(l);return o=j[o]?"cssFloat"in l.style?"cssFloat":"styleFloat":o,s===1?t:M(l,o,t[o]||l.style[o])}function W(l,o,s){var t=arguments.length;if(o=j[o]?"cssFloat"in l.style?"cssFloat":"styleFloat":o,t===3)return typeof s=="number"&&Z.test(o)&&(s="".concat(s,"px")),l.style[o]=s,s;for(var u in o)o.hasOwnProperty(u)&&W(l,u,o[u]);return G(l)}function C(l){return l===document.body?document.documentElement.clientWidth:l.offsetWidth}function r(l){return l===document.body?window.innerHeight||document.documentElement.clientHeight:l.offsetHeight}function A(){var l=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),o=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:l,height:o}}function v(){var l=document.documentElement.clientWidth,o=window.innerHeight||document.documentElement.clientHeight;return{width:l,height:o}}function f(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function p(l){var o=l.getBoundingClientRect(),s=document.documentElement;return{left:o.left+(window.pageXOffset||s.scrollLeft)-(s.clientLeft||document.body.clientLeft||0),top:o.top+(window.pageYOffset||s.scrollTop)-(s.clientTop||document.body.clientTop||0)}}},y5JW:function(Bt,ve,T){"use strict";T.d(ve,"c",function(){return s}),T.d(ve,"a",function(){return t});var Z=T("DZo9"),V=T("8z0m"),j=T("+L6B"),G=T("2/Rp"),M=T("9og8"),I=T("miYZ"),W=T("tsqr"),C=T("k1fw"),r=T("oBTY"),A=T("WmNS"),v=T.n(A),f=T("q1tI"),p=T.n(f),l=T("m3rI"),o=T("wzkS"),s="\u3000\u3000";function t(u){var a=["Bytes","KB","MB","GB","TB"];if(u==0)return"0 Byte";var i=parseInt(""+Math.floor(Math.log(u)/Math.log(1024)),10);return(u/Math.pow(1024,i)).toFixed(1)+" "+a[i]}ve.b=function(u){var a=u.value,i=a===void 0?[]:a,D=u.action,w=u.onChange,S=u.className,L=u.maxSize,P=L===void 0?150:L,_=u.title,b=_===void 0?"\u6587\u4EF6\u4E0A\u4F20":_,g=u.accept,m=g===void 0?null:g,y={multiple:!1,fileList:i,accept:m,withCredentials:!0,beforeUpload:function(H){var F=H.size/1024/1024;return!0},action:"".concat(l.a.API_SERVER,"/api/attachments.json"),onChange:function(H){var F,R,U=Object(r.a)(H.fileList);if(U=U.map(function(z){return z.name.indexOf(s)===-1&&(z.name="".concat(z.name).concat(s).concat(t(z.size))),Object(C.a)({},z)}),H.file.status==="done"&&((F=H.file)===null||F===void 0||((R=F.response)===null||R===void 0)?void 0:R.status)===-1){var k,d;W.b.error((k=H.file)===null||k===void 0||((d=k.response)===null||d===void 0)?void 0:d.message),w([]);return}w(U)},onRemove:function(){var O=Object(M.a)(v.a.mark(function F(R){var U,k,d;return v.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:if(U=R.size/1024/1024,!(R.status==="uploading")){Y.next=3;break}return Y.abrupt("return",!0);case 3:if(U<P){Y.next=7;break}return Y.abrupt("return",!0);case 7:if(k=R.response?R.response.id:R.uid,!k){Y.next=15;break}return Y.next=11,Object(o.d)(R.response?R.response.id:R.id);case 11:return d=Y.sent,Y.abrupt("return",d);case 15:return Y.abrupt("return",!0);case 16:case"end":return Y.stop()}},F)}));function H(F){return O.apply(this,arguments)}return H}()};function x(O){O.preventDefault(),O.stopPropagation()}return p.a.createElement("div",{className:"single-upload ".concat(S||"")},p.a.createElement(V.a,y,p.a.createElement(G.a,{type:"primary",title:i.length>0?"\u6BCF\u6B21\u53EA\u80FD\u4E0A\u4F20\u4E00\u4E2A\u8D44\u6E90\uFF0C \u5220\u9664\u4E0B\u9762\u8D44\u6E90\u53EF\u91CD\u65B0\u4E0A\u4F20 ":"",disabled:i.length>0,ghost:!0},b),p.a.createElement("span",{onClick:x,style:{marginLeft:10}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",P,"M)"," ")))}},yHk2:function(Bt,ve,T){"use strict";var Z=T("sRBo"),V=T("kaz8"),j=T("giR+"),G=T("fyUT"),M=T("14J3"),I=T("BMrR"),W=T("5NDa"),C=T("5rEg"),r=T("y8nQ"),A=T("Vl3Y"),v=T("0Owb"),f=T("OaEy"),p=T("2fM7"),l=T("oBTY"),o=T("jCWc"),s=T("kPKH"),t=T("PpiC"),u=T("tJVT"),a=T("iQDF"),i=T("+eQT"),D=T("q1tI"),w=T.n(D),S=T("/MfK"),L=T("w5pM"),P=T("wd/R"),_=T.n(P),b=T("9kvl"),g=T("eozf"),m=i.a.RangePicker,y=function(O){var H=O.disabled,F=O.shixunHomeworks,R=O.selectOptions,U=O.form,k=O.data,d=F.workSetting,z=Object(D.useState)([]),Y=Object(u.a)(z,2),re=Y[0],le=Y[1],Ne=Object(D.useMemo)(function(){return R==null?void 0:R.filter(function(Te){return!re.includes(Te.value)})},[re,R]);Object(D.useEffect)(function(){var Te,Fe=(d==null||((Te=d.anonymous_comment_settings)===null||Te===void 0)?void 0:Te.filter(function(Ve){return Ve.evaluation_end}))||[];le(Fe.map(function(Ve){return Ve.group_name}))},[d]);var Ce=function(Fe){var Ve,xe=d==null||((Ve=d.anonymous_appeal_settings)===null||Ve===void 0)?void 0:Ve.find(function(ye){return ye.group_id===Fe});return k.anonymous_appeal&&xe&&(xe==null?void 0:xe.appeal_time)!==null};return w.a.createElement(A.a.List,{name:"anonymous_comment_settings"},function(Te,Fe){var Ve=Fe.add,xe=Fe.remove;return w.a.createElement(w.a.Fragment,null,Te.map(function(ye){var oe,Se,_e=ye.key,He=ye.name,rt=Object(t.a)(ye,["key","name"]),ae=U.getFieldValue(["anonymous_comment_settings",He]),$=ae.deleteflag,Q=_()((oe=ae.evaluation_start)===null||oe===void 0?void 0:oe[0])<=_()(),te=!$&&Q?[!0,Ce(ae==null?void 0:ae.group_id)]:[!1,!1];return w.a.createElement("div",{key:_e},w.a.createElement(I.a,{align:"top",style:{marginLeft:30,marginBottom:30}},w.a.createElement(s.a,null,"\u533F\u8BC4\u89C4\u5219",_e+1,"\uFF1A"),w.a.createElement(s.a,{flex:1},w.a.createElement(I.a,{align:"middle",style:{marginBottom:16}},w.a.createElement(s.a,{span:8},w.a.createElement(A.a.Item,Object(v.a)({},rt,{name:[He,"group_name"]}),w.a.createElement(p.a,{mode:"multiple",disabled:H||!$,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",options:Ne||[],onSelect:function(ge){le(function(we){return[].concat(Object(l.a)(we),[ge])})},onDeselect:function(ge){le(function(we){return we.filter(function(ft){return ft!==ge})})}}))),w.a.createElement(s.a,{className:"ml20"},w.a.createElement(A.a.Item,Object(v.a)({},rt,{name:[He,"evaluation_start"]}),w.a.createElement(m,{ranges:{\u6B64\u523B:function(){var ge,we=ae==null||((ge=ae.evaluation_start)===null||ge===void 0)?void 0:ge[0];return[we?_()(we):_()(),_()()]}},disabled:H||te,allowClear:!1,disabledDate:function(ge){return Object(g.b)(ge,d==null?void 0:d.course_end_date)},disabledTime:function(ge){return Object(g.c)(ge)},showTime:{format:"HH:mm"},format:"YYYY-MM-DD HH:mm"}))),w.a.createElement(A.a.Item,Object(v.a)({},rt,{name:[He,"deleteflag"]}),w.a.createElement(C.a,{type:"hidden"})),_e!==0&&!H&&$&&w.a.createElement(S.a,{className:"ml20",onClick:function(){var ge=U.getFieldValue(["anonymous_comment_settings",He,"group_name"])||[];le(function(we){return we.filter(function(ft){return!ge.includes(ft)})}),xe(He)}}),!H&&Te.length<(d==null||((Se=d.anonymous_comment_settings)===null||Se===void 0)?void 0:Se.length)&&w.a.createElement(L.a,{className:"c-green ml20",onClick:function(){Ve({deleteflag:!0})}})),w.a.createElement(I.a,{align:"middle"},w.a.createElement(s.a,{span:4},w.a.createElement(A.a.Item,Object(v.a)({},rt,{label:"\u533F\u8BC4\u6570\u91CF",name:[He,"evaluation_num"]}),w.a.createElement(G.a,{min:0,disabled:H||!$&&Q}))),w.a.createElement(s.a,{span:4},w.a.createElement(A.a.Item,Object(v.a)({},rt,{label:"\u7F3A\u8BC4\u6263\u5206",name:[He,"absence_penalty"]}),w.a.createElement(G.a,{min:0,disabled:H}))),w.a.createElement(s.a,{className:"ml20"},w.a.createElement(A.a.Item,Object(v.a)({},rt,{name:[He,"student_comment"],valuePropName:"checked"}),w.a.createElement(V.a,{disabled:H}))),w.a.createElement(s.a,{className:"ml10"},"\u533F\u8BC4\u8BA1\u5165\u5DF2\u8BC4\u9605")))))}))})};ve.a=Object(b.a)(function(x){var O=x.shixunHomeworks;return{shixunHomeworks:O}})(y)},"yTi+":function(Bt,ve,T){Bt.exports=T.p+"static/AssistantCode3.fdd8db3c.jpeg"},zetH:function(Bt,ve,T){Bt.exports={flex_box_center:"flex_box_center___Joa_H",flex_space_between:"flex_space_between___3VhCy",flex_box_vertical_center:"flex_box_vertical_center___3wSNZ",flex_box_center_end:"flex_box_center_end___3z8HR",flex_box_column:"flex_box_column___KdHzx",form:"form___3KoYn",efficiency:"efficiency___1LMk4"}}}]);