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

441 lines
1.5 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[83,3,5,6,7,8,13],{"+NIl":function(Gt,et,k){(function(re){re(k("VrN/"))})(function(re){"use strict";re.defineMode("stex",function(Y,j){"use strict";function G(r,n){r.cmdState.push(n)}function L(r){return r.cmdState.length>0?r.cmdState[r.cmdState.length-1]:null}function P(r){var n=r.cmdState.pop();n&&n.closeBracket()}function H(r){for(var n=r.cmdState,a=n.length-1;a>=0;a--){var l=n[a];if(l.name=="DEFAULT")continue;return l}return{styleIdentifier:function(){return null}}}function O(r,n,a){return function(){this.name=r,this.bracketNo=0,this.style=n,this.styles=a,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var I={};I.importmodule=O("importmodule","tag",["string","builtin"]),I.documentclass=O("documentclass","tag",["","atom"]),I.usepackage=O("usepackage","tag",["atom"]),I.begin=O("begin","tag",["atom"]),I.end=O("end","tag",["atom"]),I.label=O("label","tag",["atom"]),I.ref=O("ref","tag",["atom"]),I.eqref=O("eqref","tag",["atom"]),I.cite=O("cite","tag",["atom"]),I.bibitem=O("bibitem","tag",["atom"]),I.Bibitem=O("Bibitem","tag",["atom"]),I.RBibitem=O("RBibitem","tag",["atom"]),I.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function x(r,n){r.f=n}function p(r,n){var a;if(r.match(/^\\[a-zA-Z@]+/)){var l=r.current().slice(1);return a=I.hasOwnProperty(l)?I[l]:I.DEFAULT,a=new a,G(n,a),x(n,h),a.style}if(r.match(/^\\[$&%#{}_]/))return"tag";if(r.match(/^\\[,;!\/\\]/))return"tag";if(r.match("\\["))return x(n,function(u,c){return m(u,c,"\\]")}),"keyword";if(r.match("\\("))return x(n,function(u,c){return m(u,c,"\\)")}),"keyword";if(r.match("$$"))return x(n,function(u,c){return m(u,c,"$$")}),"keyword";if(r.match("$"))return x(n,function(u,c){return m(u,c,"$")}),"keyword";var s=r.next();if(s=="%")return r.skipToEnd(),"comment";if(s=="}"||s=="]"){if(a=L(n),a)a.closeBracket(s),x(n,h);else return"error";return"bracket"}else return s=="{"||s=="["?(a=I.DEFAULT,a=new a,G(n,a),"bracket"):/\d/.test(s)?(r.eatWhile(/[\w.%]/),"atom"):(r.eatWhile(/[\w\-_]/),a=H(n),a.name=="begin"&&(a.argument=r.current()),a.styleIdentifier())}function m(r,n,a){if(r.eatSpace())return null;if(a&&r.match(a))return x(n,p),"keyword";if(r.match(/^\\[a-zA-Z@]+/))return"tag";if(r.match(/^[a-zA-Z]+/))return"variable-2";if(r.match(/^\\[$&%#{}_]/))return"tag";if(r.match(/^\\[,;!\/]/))return"tag";if(r.match(/^[\^_&]/))return"tag";if(r.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(r.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var l=r.next();return l=="{"||l=="}"||l=="["||l=="]"||l=="("||l==")"?"bracket":l=="%"?(r.skipToEnd(),"comment"):"error"}function h(r,n){var a=r.peek(),l;return a=="{"||a=="["?(l=L(n),l.openBracket(a),r.eat(a),x(n,p),"bracket"):/[ \t\r]/.test(a)?(r.eat(a),null):(x(n,p),P(n),p(r,n))}return{startState:function(){var r=j.inMathMode?function(n,a){return m(n,a)}:p;return{cmdState:[],f:r}},copyState:function(r){return{cmdState:r.cmdState.slice(),f:r.f}},token:function(r,n){return n.f(r,n)},blankLine:function(r){r.f=p,r.cmdState.length=0},lineComment:"%"}}),re.defineMIME("text/x-stex","stex"),re.defineMIME("text/x-latex","stex")})},"+ua5":function(Gt,et,k){},"19Vz":function(Gt,et,k){(function(re){re(k("VrN/"))})(function(re){re.defineOption("placeholder","",function(O,I,x){var p=x&&x!=re.Init;if(I&&!p)O.on("blur",L),O.on("change",P),O.on("swapDoc",P),re.on(O.getInputField(),"compositionupdate",O.state.placeholderCompose=function(){G(O)}),P(O);else if(!I&&p){O.off("blur",L),O.off("change",P),O.off("swapDoc",P),re.off(O.getInputField(),"compositionupdate",O.state.placeholderCompose),Y(O);var m=O.getWrapperElement();m.className=m.className.replace(" CodeMirror-empty","")}I&&!O.hasFocus()&&L(O)});function Y(O){O.state.placeholder&&(O.state.placeholder.parentNode.removeChild(O.state.placeholder),O.state.placeholder=null)}function j(O){Y(O);var I=O.state.placeholder=document.createElement("pre");I.style.cssText="height: 0; overflow: visible",I.style.direction=O.getOption("direction"),I.className="CodeMirror-placeholder CodeMirror-line-like";var x=O.getOption("placeholder");typeof x=="string"&&(x=document.createTextNode(x)),I.appendChild(x),O.display.lineSpace.insertBefore(I,O.display.lineSpace.firstChild)}function G(O){setTimeout(function(){var I=!1,x=O.getInputField();x.nodeName=="TEXTAREA"?I=!x.value:O.lineCount()==1&&(I=!/[^\u200b]/.test(x.querySelector(".CodeMirror-line").textContent)),I?j(O):Y(O)},20)}function L(O){H(O)&&j(O)}function P(O){var I=O.getWrapperElement(),x=H(O);I.className=I.className.replace(" CodeMirror-empty","")+(x?" CodeMirror-empty":""),x?j(O):Y(O)}function H(O){return O.lineCount()===1&&O.getLine(0)===""}})},"1eCo":function(Gt,et,k){(function(re){re(k("VrN/"))})(function(re){"use strict";var Y={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},j={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};re.defineMode("xml",function(G,L){var P=G.indentUnit,H={},O=L.htmlMode?Y:j;for(var I in O)H[I]=O[I];for(var I in L)H[I]=L[I];var x,p;function m(d,g){function E(U){return g.tokenize=U,U(d,g)}var T=d.next();if(T=="<")return d.eat("!")?d.eat("[")?d.match("CDATA[")?E(n("atom","]]>")):null:d.match("--")?E(n("comment","-->")):d.match("DOCTYPE",!0,!0)?(d.eatWhile(/[\w\._\-]/),E(a(1))):null:d.eat("?")?(d.eatWhile(/[\w\._\-]/),g.tokenize=n("meta","?>"),"meta"):(x=d.eat("/")?"closeTag":"openTag",g.tokenize=h,"tag bracket");if(T=="&"){var F;return d.eat("#")?d.eat("x")?F=d.eatWhile(/[a-fA-F\d]/)&&d.eat(";"):F=d.eatWhile(/[\d]/)&&d.eat(";"):F=d.eatWhile(/[\w\.\-:]/)&&d.eat(";"),F?"atom":"error"}else return d.eatWhile(/[^&<]/),null}m.isInText=!0;function h(d,g){var E=d.next();if(E==">"||E=="/"&&d.eat(">"))return g.tokenize=m,x=E==">"?"endTag":"selfcloseTag","tag bracket";if(E=="=")return x="equals",null;if(E=="<"){g.tokenize=m,g.state=c,g.tagName=g.tagStart=null;var T=g.tokenize(d,g);return T?T+" tag error":"tag error"}else return/[\'\"]/.test(E)?(g.tokenize=r(E),g.stringStartCol=d.column(),g.tokenize(d,g)):(d.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function r(d){var g=function(E,T){for(;!E.eol();)if(E.next()==d){T.tokenize=h;break}return"string"};return g.isInAttribute=!0,g}function n(d,g){return function(E,T){for(;!E.eol();){if(E.match(g)){T.tokenize=m;break}E.next()}return d}}function a(d){return function(g,E){for(var T;(T=g.next())!=null;){if(T=="<")return E.tokenize=a(d+1),E.tokenize(g,E);if(T==">")if(d==1){E.tokenize=m;break}else return E.tokenize=a(d-1),E.tokenize(g,E)}return"meta"}}function l(d,g,E){this.prev=d.context,this.tagName=g,this.indent=d.indented,this.startOfLine=E,(H.doNotIndent.hasOwnProperty(g)||d.context&&d.context.noIndent)&&(this.noIndent=!0)}function s(d){d.context&&(d.context=d.context.prev)}function u(d,g){for(var E;;){if(!d.context)return;if(E=d.context.tagName,!H.contextGrabbers.hasOwnProperty(E)||!H.contextGrabbers[E].hasOwnProperty(g))return;s(d)}}function c(d,g,E){return d=="openTag"?(E.tagStart=g.column(),R):d=="closeTag"?w:c}function R(d,g,E){return d=="word"?(E.tagName=g.current(),p="tag",S):H.allowMissingTagName&&d=="endTag"?(p="tag bracket",S(d,g,E)):(p="error",R)}function w(d,g,E){if(d=="word"){var T=g.current();return E.context&&E.context.tagName!=T&&H.implicitlyClosed.hasOwnProperty(E.context.tagName)&&s(E),E.context&&E.context.tagName==T||H.matchClosing===!1?(p="tag",C):(p="tag error",D)}else return H.allowMissingTagName&&d=="endTag"?(p="tag bracket",C(d,g,E)):(p="error",D)}function C(d,g,E){return d!="endTag"?(p="error",C):(s(E),c)}function D(d,g,E){return p="error",C(d,g,E)}function S(d,g,E){if(d=="word")return p="attribute",b;if(d=="endTag"||d=="selfcloseTag"){var T=E.tagName,F=E.tagStart;return E.tagName=E.tagStart=null,d=="selfcloseTag"||H.autoSelfClosers.hasOwnProperty(T)?u(E,T):(u(E,T),E.context=new l(E,T,F==E.indented)),c}return p="error",S}function b(d,g,E){return d=="equals"?_:(H.allowMissing||(p="error"),S(d,g,E))}function _(d,g,E){return d=="string"?f:d=="word"&&H.allowUnquoted?(p="string",S):(p="error",S(d,g,E))}function f(d,g,E){return d=="string"?f:S(d,g,E)}return{startState:function(d){var g={tokenize:m,state:c,indented:d||0,tagName:null,tagStart:null,context:null};return d!=null&&(g.baseIndent=d),g},token:function(d,g){if(!g.tagName&&d.sol()&&(g.indented=d.indentation()),d.eatSpace())return null;x=null;var E=g.tokenize(d,g);return(E||x)&&E!="comment"&&(p=null,g.state=g.state(x||E,d,g),p&&(E=p=="error"?E+" error":p)),E},indent:function(d,g,E){var T=d.context;if(d.tokenize.isInAttribute)return d.tagStart==d.indented?d.stringStartCol+1:d.indented+P;if(T&&T.noIndent)return re.Pass;if(d.tokenize!=h&&d.tokenize!=m)return E?E.match(/^(\s*)/)[0].length:0;if(d.tagName)return H.multilineTagIndentPastTag!==!1?d.tagStart+d.tagName.length+2:d.tagStart+P*(H.multilineTagIndentFactor||1);if(H.alignCDATA&&/<!\[CDATA\[/.test(g))return 0;var F=g&&/^<(\/)?([\w_:\.-]*)/.exec(g);if(F&&F[1])for(;T;)if(T.tagName==F[2]){T=T.prev;break}else if(H.implicitlyClosed.hasOwnProperty(T.tagName))T=T.prev;else break;else if(F)for(;T;){var U=H.contextGrabbers[T.tagName];if(U&&U.hasOwnProperty(F[2]))T=T.prev;else break}for(;T&&T.prev&&!T.startOfLine;)T=T.prev;return T?T.indent+P:d.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:H.htmlMode?"html":"xml",helperType:H.htmlMode?"html":"xml",skipAttribute:function(d){d.state==_&&(d.state=S)},xmlCurrentTag:function(d){return d.tagName?{name:d.tagName,close:d.type=="closeTag"}:null},xmlCurrentContext:function(d){for(var g=[],E=d.context;E;E=E.prev)E.tagName&&g.push(E.tagName);return g.reverse()}}}),re.defineMIME("text/xml","xml"),re.defineMIME("application/xml","xml"),re.mimeModes.hasOwnProperty("text/html")||re.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(Gt,et,k){"use strict";k.d(et,"d",function(){return Pt}),k.d(et,"b",function(){return ze}),k.d(et,"c",function(){return Dt}),k.d(et,"a",function(){return mn});var re=k("VTBJ"),Y=k("1OyB"),j=k("vuIU"),G=k("JX7q"),L=k("Ji7U"),P=k("LK+K"),H=k("q1tI"),O=k("I8Z2"),I=k("BGR+"),x=k("wx14"),p=k("rePB"),m=k("4IlW"),h=k("2GS6"),r=k("Gytx"),n=k.n(r),a=k("TSYQ"),l=k.n(a),s=k("U8pU"),u=k("ODXe"),c=/iPhone/i,R=/iPod/i,w=/iPad/i,C=/\bAndroid(?:.+)Mobile\b/i,D=/Android/i,S=/\bAndroid(?:.+)SD4930UR\b/i,b=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,_=/Windows Phone/i,f=/\bWindows(?:.+)ARM\b/i,d=/BlackBerry/i,g=/BB10/i,E=/Opera Mini/i,T=/\b(CriOS|Chrome)(?:.+)Mobile/i,F=/Mobile(?:.+)Firefox\b/i;function U(Vt,Tt){return Vt.test(Tt)}function K(Vt){var Tt=Vt||(typeof navigator!="undefined"?navigator.userAgent:""),Rt=Tt.split("[FBAN");if(typeof Rt[1]!="undefined"){var mt=Rt,_e=Object(u.a)(mt,1);Tt=_e[0]}if(Rt=Tt.split("Twitter"),typeof Rt[1]!="undefined"){var Ge=Rt,kt=Object(u.a)(Ge,1);Tt=kt[0]}var vt={apple:{phone:U(c,Tt)&&!U(_,Tt),ipod:U(R,Tt),tablet:!U(c,Tt)&&U(w,Tt)&&!U(_,Tt),device:(U(c,Tt)||U(R,Tt)||U(w,Tt))&&!U(_,Tt)},amazon:{phone:U(S,Tt),tablet:!U(S,Tt)&&U(b,Tt),device:U(S,Tt)||U(b,Tt)},android:{phone:!U(_,Tt)&&U(S,Tt)||!U(_,Tt)&&U(C,Tt),tablet:!U(_,Tt)&&!U(S,Tt)&&!U(C,Tt)&&(U(b,Tt)||U(D,Tt)),device:!U(_,Tt)&&(U(S,Tt)||U(b,Tt)||U(C,Tt)||U(D,Tt))||U(/\bokhttp\b/i,Tt)},windows:{phone:U(_,Tt),tablet:U(f,Tt),device:U(_,Tt)||U(f,Tt)},other:{blackberry:U(d,Tt),blackberry10:U(g,Tt),opera:U(E,Tt),firefox:U(F,Tt),chrome:U(T,Tt),device:U(d,Tt)||U(g,Tt)||U(E,Tt)||U(F,Tt)||U(T,Tt)},any:null,phone:null,tablet:null};return vt.any=vt.apple.device||vt.android.device||vt.windows.device||vt.other.device,vt.phone=vt.apple.phone||vt.android.phone||vt.windows.phone,vt.tablet=vt.apple.tablet||vt.android.tablet||vt.windows.tablet,vt}var z=Object(re.a)(Object(re.a)({},K()),{},{isMobile:K}),M=z;function y(){}function W(Vt,Tt,Rt){var mt=Tt||"";return Vt.key||"".concat(mt,"item_").concat(Rt)}function X(Vt){return"".concat(Vt,"-menu-")}function te(Vt,Tt){var Rt=-1;H.Children.forEach(Vt,function(mt){Rt+=1,mt&&mt.type&&mt.type.isMenuItemGroup?H.Children.forEach(mt.props.children,function(_e){Rt+=1,Tt(_e,Rt)}):Tt(mt,Rt)})}function pe(Vt,Tt,Rt){if(!Vt||Rt.find)return;H.Children.forEach(Vt,function(mt){if(mt){var _e=mt.type;if(!_e||!(_e.isSubMenu||_e.isMenuItem||_e.isMenuItemGroup))return;Tt.indexOf(mt.key)!==-1?Rt.find=!0:mt.props.children&&pe(mt.props.children,Tt,Rt)}})}var Ie=["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"],Ee=function(Tt){var Rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,mt=Tt&&typeof Tt.getBoundingClientRect=="function"&&Tt.getBoundingClientRect().width;if(mt){if(Rt){var _e=getComputedStyle(Tt),Ge=_e.marginLeft,kt=_e.marginRight;mt+=+Ge.replace("px","")+ +kt.replace("px","")}mt=+mt.toFixed(6)}return mt||0},Te=function(Tt,Rt,mt){Tt&&Object(s.a)(Tt.style)==="object"&&(Tt.style[Rt]=mt)},We=function(){return M.any},He=k("KQm4"),Ce=k("Ff2n"),ue=k("i8i4"),se=k("bdgK"),we=k("uciX"),ge=k("8XRh"),Ke={adjustX:1,adjustY:1},st={topLeft:{points:["bl","tl"],overflow:Ke,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Ke,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:Ke,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:Ke,offset:[4,0]}},ne={topLeft:{points:["bl","tl"],overflow:Ke,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Ke,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:Ke,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:Ke,offset:[4,0]}},$=st,J=0,me={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},xe=function(Tt,Rt,mt){var _e=X(Rt),Ge=Tt.getState();Tt.setState({defaultActiveFirst:Object(re.a)(Object(re.a)({},Ge.defaultActiveFirst),{},Object(p.a)({},_e,mt))})},ke=function(Vt){Object(L.a)(Rt,Vt);var Tt=Object(P.a)(Rt);function Rt(mt){var _e;Object(Y.a)(this,Rt),_e=Tt.call(this,mt),_e.onDestroy=function(Le){_e.props.onDestroy(Le)},_e.onKeyDown=function(Le){var tt=Le.keyCode,Lt=_e.menuInstance,Ht=_e.props,ln=Ht.isOpen,hn=Ht.store;if(tt===m.a.ENTER)return _e.onTitleClick(Le),xe(hn,_e.props.eventKey,!0),!0;if(tt===m.a.RIGHT)return ln?Lt.onKeyDown(Le):(_e.triggerOpenChange(!0),xe(hn,_e.props.eventKey,!0)),!0;if(tt===m.a.LEFT){var ir;if(ln)ir=Lt.onKeyDown(Le);else return;return ir||(_e.triggerOpenChange(!1),ir=!0),ir}return ln&&(tt===m.a.UP||tt===m.a.DOWN)?Lt.onKeyDown(Le):void 0},_e.onOpenChange=function(Le){_e.props.onOpenChange(Le)},_e.onPopupVisibleChange=function(Le){_e.triggerOpenChange(Le,Le?"mouseenter":"mouseleave")},_e.onMouseEnter=function(Le){var tt=_e.props,Lt=tt.eventKey,Ht=tt.onMouseEnter,ln=tt.store;xe(ln,_e.props.eventKey,!1),Ht({key:Lt,domEvent:Le})},_e.onMouseLeave=function(Le){var tt=_e.props,Lt=tt.parentMenu,Ht=tt.eventKey,ln=tt.onMouseLeave;Lt.subMenuInstance=Object(G.a)(_e),ln({key:Ht,domEvent:Le})},_e.onTitleMouseEnter=function(Le){var tt=_e.props,Lt=tt.eventKey,Ht=tt.onItemHover,ln=tt.onTitleMouseEnter;Ht({key:Lt,hover:!0}),ln({key:Lt,domEvent:Le})},_e.onTitleMouseLeave=function(Le){var tt=_e.props,Lt=tt.parentMenu,Ht=tt.eventKey,ln=tt.onItemHover,hn=tt.onTitleMouseLeave;Lt.subMenuInstance=Object(G.a)(_e),ln({key:Ht,hover:!1}),hn({key:Ht,domEvent:Le})},_e.onTitleClick=function(Le){var tt=Object(G.a)(_e),Lt=tt.props;if(Lt.onTitleClick({key:Lt.eventKey,domEvent:Le}),Lt.triggerSubMenuAction==="hover")return;_e.triggerOpenChange(!Lt.isOpen,"click"),xe(Lt.store,_e.props.eventKey,!1)},_e.onSubMenuClick=function(Le){typeof _e.props.onClick=="function"&&_e.props.onClick(_e.addKeyPath(Le))},_e.onSelect=function(Le){_e.props.onSelect(Le)},_e.onDeselect=function(Le){_e.props.onDeselect(Le)},_e.getPrefixCls=function(){return"".concat(_e.props.rootPrefixCls,"-submenu")},_e.getActiveClassName=function(){return"".concat(_e.getPrefixCls(),"-active")},_e.getDisabledClassName=function(){return"".concat(_e.getPrefixCls(),"-disabled")},_e.getSelectedClassName=function(){return"".concat(_e.getPrefixCls(),"-selected")},_e.getOpenClassName=function(){return"".concat(_e.props.rootPrefixCls,"-submenu-open")},_e.saveMenuInstance=function(Le){_e.menuInstance=Le},_e.addKeyPath=function(Le){return Object(re.a)(Object(re.a)({},Le),{},{keyPath:(Le.keyPath||[]).concat(_e.props.eventKey)})},_e.triggerOpenChange=function(Le,tt){var Lt=_e.props.eventKey,Ht=function(){_e.onOpenChange({key:Lt,item:Object(G.a)(_e),trigger:tt,open:Le})};tt==="mouseenter"?_e.mouseenterTimeout=setTimeout(function(){Ht()},0):Ht()},_e.isChildrenSelected=function(){var Le={find:!1};return pe(_e.props.children,_e.props.selectedKeys,Le),Le.find},_e.isOpen=function(){return _e.props.openKeys.indexOf(_e.props.eventKey)!==-1},_e.adjustWidth=function(){if(!_e.subMenuTitle||!_e.menuInstance)return;var Le=ue.findDOMNode(_e.menuInstance);if(Le.offsetWidth>=_e.subMenuTitle.offsetWidth)return;Le.style.minWidth="".concat(_e.subMenuTitle.offsetWidth,"px")},_e.saveSubMenuTitle=function(Le){_e.subMenuTitle=Le},_e.getBaseProps=function(){var Le=Object(G.a)(_e),tt=Le.props;return{mode:tt.mode==="horizontal"?"vertical":tt.mode,visible:_e.props.isOpen,level:tt.level+1,inlineIndent:tt.inlineIndent,focusable:!1,onClick:_e.onSubMenuClick,onSelect:_e.onSelect,onDeselect:_e.onDeselect,onDestroy:_e.onDestroy,selectedKeys:tt.selectedKeys,eventKey:"".concat(tt.eventKey,"-menu-"),openKeys:tt.openKeys,motion:tt.motion,onOpenChange:_e.onOpenChange,subMenuOpenDelay:tt.subMenuOpenDelay,parentMenu:Object(G.a)(_e),subMenuCloseDelay:tt.subMenuCloseDelay,forceSubMenuRender:tt.forceSubMenuRender,triggerSubMenuAction:tt.triggerSubMenuAction,builtinPlacements:tt.builtinPlacements,defaultActiveFirst:tt.store.getState().defaultActiveFirst[X(tt.eventKey)],multiple:tt.multiple,prefixCls:tt.rootPrefixCls,id:_e.internalMenuId,manualRef:_e.saveMenuInstance,itemIcon:tt.itemIcon,expandIcon:tt.expandIcon,direction:tt.direction}},_e.getMotion=function(Le,tt){var Lt=Object(G.a)(_e),Ht=Lt.haveRendered,ln=_e.props,hn=ln.motion,ir=ln.rootPrefixCls,Un=Object(re.a)(Object(re.a)({},hn),{},{leavedClassName:"".concat(ir,"-hidden"),removeOnLeave:!1,motionAppear:Ht||!tt||Le!=="inline"});return Un};var Ge=mt.store,kt=mt.eventKey,vt=Ge.getState(),Qt=vt.defaultActiveFirst;_e.isRootMenu=!1;var Jt=!1;return Qt&&(Jt=Qt[kt]),xe(Ge,kt,Jt),_e}return Object(j.a)(Rt,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var _e=this,Ge=this.props,kt=Ge.mode,vt=Ge.parentMenu,Qt=Ge.manualRef;if(Qt&&Qt(this),kt!=="horizontal"||!vt.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return _e.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var _e=this.props,Ge=_e.onDestroy,kt=_e.eventKey;Ge&&Ge(kt),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(_e){var Ge=this,kt=this.getBaseProps(),vt=this.getMotion(kt.mode,kt.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||kt.visible||kt.forceSubMenuRender,!this.haveOpened)return H.createElement("div",null);var Qt=kt.direction;return H.createElement(ge.default,Object.assign({visible:kt.visible},vt),function(Jt){var Le=Jt.className,tt=Jt.style,Lt=l()("".concat(kt.prefixCls,"-sub"),Le,Object(p.a)({},"".concat(kt.prefixCls,"-rtl"),Qt==="rtl"));return H.createElement(Ve,Object.assign({},kt,{id:Ge.internalMenuId,className:Lt,style:tt}),_e)})}},{key:"render",value:function(){var _e,Ge=Object(re.a)({},this.props),kt=Ge.isOpen,vt=this.getPrefixCls(),Qt=Ge.mode==="inline",Jt=l()(vt,"".concat(vt,"-").concat(Ge.mode),(_e={},Object(p.a)(_e,Ge.className,!!Ge.className),Object(p.a)(_e,this.getOpenClassName(),kt),Object(p.a)(_e,this.getActiveClassName(),Ge.active||kt&&!Qt),Object(p.a)(_e,this.getDisabledClassName(),Ge.disabled),Object(p.a)(_e,this.getSelectedClassName(),this.isChildrenSelected()),_e));this.internalMenuId||(Ge.eventKey?this.internalMenuId="".concat(Ge.eventKey,"$Menu"):(J+=1,this.internalMenuId="$__$".concat(J,"$Menu")));var Le={},tt={},Lt={};Ge.disabled||(Le={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},tt={onClick:this.onTitleClick},Lt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Ht={},ln=Ge.direction;Qt&&(ln==="rtl"?Ht.paddingRight=Ge.inlineIndent*Ge.level:Ht.paddingLeft=Ge.inlineIndent*Ge.level);var hn={};this.props.isOpen&&(hn={"aria-owns":this.internalMenuId});var ir=null;Ge.mode!=="horizontal"&&(ir=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(ir=H.createElement(this.props.expandIcon,Object(re.a)({},this.props))));var Un=H.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:Ht,className:"".concat(vt,"-title"),role:"button"},Lt,tt,{"aria-expanded":kt},hn,{"aria-haspopup":"true",title:typeof Ge.title=="string"?Ge.title:void 0}),Ge.title,ir||H.createElement("i",{className:"".concat(vt,"-arrow")})),dn=this.renderChildren(Ge.children),fr=Ge.parentMenu.isRootMenu?Ge.parentMenu.props.getPopupContainer:function(ri){return ri.parentNode},Kr=me[Ge.mode],tr=Ge.popupOffset?{offset:Ge.popupOffset}:{},rr=Ge.mode==="inline"?"":Ge.popupClassName;rr+=ln==="rtl"?" ".concat(vt,"-rtl"):"";var Nr=Ge.disabled,oi=Ge.triggerSubMenuAction,hi=Ge.subMenuOpenDelay,an=Ge.forceSubMenuRender,Xn=Ge.subMenuCloseDelay,fi=Ge.builtinPlacements;Ie.forEach(function(ri){return delete Ge[ri]}),delete Ge.onClick;var Ei=ln==="rtl"?Object.assign({},ne,fi):Object.assign({},st,fi);return delete Ge.direction,H.createElement("li",Object.assign({},Ge,Le,{className:Jt,role:"menuitem"}),Qt&&Un,Qt&&dn,!Qt&&H.createElement(we.a,{prefixCls:vt,popupClassName:l()("".concat(vt,"-popup"),rr),getPopupContainer:fr,builtinPlacements:Ei,popupPlacement:Kr,popupVisible:kt,popupAlign:tr,popup:dn,action:Nr?[]:[oi],mouseEnterDelay:hi,mouseLeaveDelay:Xn,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:an},Un))}}]),Rt}(H.Component);ke.defaultProps={onMouseEnter:y,onMouseLeave:y,onTitleMouseEnter:y,onTitleMouseLeave:y,onTitleClick:y,manualRef:y,mode:"vertical",title:""};var $e=Object(O.b)(function(Vt,Tt){var Rt=Vt.openKeys,mt=Vt.activeKey,_e=Vt.selectedKeys,Ge=Tt.eventKey,kt=Tt.subMenuKey;return{isOpen:Rt.indexOf(Ge)>-1,active:mt[kt]===Ge,selectedKeys:_e}})(ke);$e.isSubMenu=!0;var Pt=$e,Xt="menuitem-overflowed",Bt=.5,lt=function(Vt){Object(L.a)(Rt,Vt);var Tt=Object(P.a)(Rt);function Rt(){var mt;return Object(Y.a)(this,Rt),mt=Tt.apply(this,arguments),mt.resizeObserver=null,mt.mutationObserver=null,mt.originalTotalWidth=0,mt.overflowedItems=[],mt.menuItemSizes=[],mt.cancelFrameId=null,mt.state={lastVisibleIndex:void 0},mt.getMenuItemNodes=function(){var _e=mt.props.prefixCls,Ge=ue.findDOMNode(Object(G.a)(mt));return Ge?[].slice.call(Ge.children).filter(function(kt){return kt.className.split(" ").indexOf("".concat(_e,"-overflowed-submenu"))<0}):[]},mt.getOverflowedSubMenuItem=function(_e,Ge,kt){var vt=mt.props,Qt=vt.overflowedIndicator,Jt=vt.level,Le=vt.mode,tt=vt.prefixCls,Lt=vt.theme;if(Jt!==1||Le!=="horizontal")return null;var Ht=mt.props.children[0],ln=Ht.props,hn=ln.children,ir=ln.title,Un=ln.style,dn=Object(Ce.a)(ln,["children","title","style"]),fr=Object(re.a)({},Un),Kr="".concat(_e,"-overflowed-indicator"),tr="".concat(_e,"-overflowed-indicator");Ge.length===0&&kt!==!0?fr=Object(re.a)(Object(re.a)({},fr),{},{display:"none"}):kt&&(fr=Object(re.a)(Object(re.a)({},fr),{},{visibility:"hidden",position:"absolute"}),Kr="".concat(Kr,"-placeholder"),tr="".concat(tr,"-placeholder"));var rr=Lt?"".concat(tt,"-").concat(Lt):"",Nr={};return Ie.forEach(function(oi){dn[oi]!==void 0&&(Nr[oi]=dn[oi])}),H.createElement(Pt,Object.assign({title:Qt,className:"".concat(tt,"-overflowed-submenu"),popupClassName:rr},Nr,{key:Kr,eventKey:tr,disabled:!1,style:fr}),Ge)},mt.setChildrenWidthAndResize=function(){if(mt.props.mode!=="horizontal")return;var _e=ue.findDOMNode(Object(G.a)(mt));if(!_e)return;var Ge=_e.children;if(!Ge||Ge.length===0)return;var kt=_e.children[Ge.length-1];Te(kt,"display","inline-block");var vt=mt.getMenuItemNodes(),Qt=vt.filter(function(Jt){return Jt.className.split(" ").indexOf(Xt)>=0});Qt.forEach(function(Jt){Te(Jt,"display","inline-block")}),mt.menuItemSizes=vt.map(function(Jt){return Ee(Jt,!0)}),Qt.forEach(function(Jt){Te(Jt,"display","none")}),mt.overflowedIndicatorWidth=Ee(_e.children[_e.children.length-1],!0),mt.originalTotalWidth=mt.menuItemSizes.reduce(function(Jt,Le){return Jt+Le},0),mt.handleResize(),Te(kt,"display","none")},mt.handleResize=function(){if(mt.props.mode!=="horizontal")return;var _e=ue.findDOMNode(Object(G.a)(mt));if(!_e)return;var Ge=Ee(_e);mt.overflowedItems=[];var kt=0,vt;mt.originalTotalWidth>Ge+Bt&&(vt=-1,mt.menuItemSizes.forEach(function(Qt){kt+=Qt,kt+mt.overflowedIndicatorWidth<=Ge&&(vt+=1)})),mt.setState({lastVisibleIndex:vt})},mt}return Object(j.a)(Rt,[{key:"componentDidMount",value:function(){var _e=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var Ge=ue.findDOMNode(this);if(!Ge)return;this.resizeObserver=new se.default(function(kt){kt.forEach(function(){var vt=_e.cancelFrameId;cancelAnimationFrame(vt),_e.cancelFrameId=requestAnimationFrame(_e.setChildrenWidthAndResize)})}),[].slice.call(Ge.children).concat(Ge).forEach(function(kt){_e.resizeObserver.observe(kt)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){_e.resizeObserver.disconnect(),[].slice.call(Ge.children).concat(Ge).forEach(function(kt){_e.resizeObserver.observe(kt)}),_e.setChildrenWidthAndResize()}),this.mutationObserver.observe(Ge,{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(_e){var Ge=this,kt=this.state.lastVisibleIndex;return(_e||[]).reduce(function(vt,Qt,Jt){var Le=Qt;if(Ge.props.mode==="horizontal"){var tt=Ge.getOverflowedSubMenuItem(Qt.props.eventKey,[]);kt!==void 0&&Ge.props.className.indexOf("".concat(Ge.props.prefixCls,"-root"))!==-1&&(Jt>kt&&(Le=H.cloneElement(Qt,{style:{display:"none"},eventKey:"".concat(Qt.props.eventKey,"-hidden"),className:"".concat(Xt)})),Jt===kt+1&&(Ge.overflowedItems=_e.slice(kt+1).map(function(Ht){return H.cloneElement(Ht,{key:Ht.props.eventKey,mode:"vertical-left"})}),tt=Ge.getOverflowedSubMenuItem(Qt.props.eventKey,Ge.overflowedItems)));var Lt=[].concat(Object(He.a)(vt),[tt,Le]);return Jt===_e.length-1&&Lt.push(Ge.getOverflowedSubMenuItem(Qt.props.eventKey,[],!0)),Lt}return[].concat(Object(He.a)(vt),[Le])},[])}},{key:"render",value:function(){var _e=this.props,Ge=_e.visible,kt=_e.prefixCls,vt=_e.overflowedIndicator,Qt=_e.mode,Jt=_e.level,Le=_e.tag,tt=_e.children,Lt=_e.theme,Ht=Object(Ce.a)(_e,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),ln=Le;return H.createElement(ln,Object.assign({},Ht),this.renderChildren(tt))}}]),Rt}(H.Component);lt.defaultProps={tag:"div",className:""};var jt=lt;function pn(Vt){return Vt.length?Vt.every(function(Tt){return!!Tt.props.disabled}):!0}function it(Vt,Tt,Rt){var mt=Vt.getState();Vt.setState({activeKey:Object(re.a)(Object(re.a)({},mt.activeKey),{},Object(p.a)({},Tt,Rt))})}function Ze(Vt){return Vt.eventKey||"0-menu-"}function bt(Vt,Tt){var Rt=Tt,mt=Vt.children,_e=Vt.eventKey;if(Rt){var Ge;if(te(mt,function(kt,vt){kt&&kt.props&&!kt.props.disabled&&Rt===W(kt,_e,vt)&&(Ge=!0)}),Ge)return Rt}return Rt=null,Vt.defaultActiveFirst&&te(mt,function(kt,vt){!Rt&&kt&&!kt.props.disabled&&(Rt=W(kt,_e,vt))}),Rt}function Mt(Vt){if(Vt){var Tt=this.instanceArray.indexOf(Vt);Tt!==-1?this.instanceArray[Tt]=Vt:this.instanceArray.push(Vt)}}var ct=function(Vt){Object(L.a)(Rt,Vt);var Tt=Object(P.a)(Rt);function Rt(mt){var _e;return Object(Y.a)(this,Rt),_e=Tt.call(this,mt),_e.onKeyDown=function(Ge,kt){var vt=Ge.keyCode,Qt;if(_e.getFlatInstanceArray().forEach(function(Le){Le&&Le.props.active&&Le.onKeyDown&&(Qt=Le.onKeyDown(Ge))}),Qt)return 1;var Jt=null;return(vt===m.a.UP||vt===m.a.DOWN)&&(Jt=_e.step(vt===m.a.UP?-1:1)),Jt?(Ge.preventDefault(),it(_e.props.store,Ze(_e.props),Jt.props.eventKey),typeof kt=="function"&&kt(Jt),1):void 0},_e.onItemHover=function(Ge){var kt=Ge.key,vt=Ge.hover;it(_e.props.store,Ze(_e.props),vt?kt:null)},_e.onDeselect=function(Ge){_e.props.onDeselect(Ge)},_e.onSelect=function(Ge){_e.props.onSelect(Ge)},_e.onClick=function(Ge){_e.props.onClick(Ge)},_e.onOpenChange=function(Ge){_e.props.onOpenChange(Ge)},_e.onDestroy=function(Ge){_e.props.onDestroy(Ge)},_e.getFlatInstanceArray=function(){return _e.instanceArray},_e.step=function(Ge){var kt=_e.getFlatInstanceArray(),vt=_e.props.store.getState().activeKey[Ze(_e.props)],Qt=kt.length;if(!Qt)return null;Ge<0&&(kt=kt.concat().reverse());var Jt=-1;if(kt.every(function(Ht,ln){return Ht&&Ht.props.eventKey===vt?(Jt=ln,!1):!0}),!_e.props.defaultActiveFirst&&Jt!==-1&&pn(kt.slice(Jt,Qt-1)))return;var Le=(Jt+1)%Qt,tt=Le;do{var Lt=kt[tt];if(!Lt||Lt.props.disabled)tt=(tt+1)%Qt;else return Lt}while(tt!==Le);return null},_e.renderCommonMenuItem=function(Ge,kt,vt){var Qt=_e.props.store.getState(),Jt=Object(G.a)(_e),Le=Jt.props,tt=W(Ge,Le.eventKey,kt),Lt=Ge.props;if(!Lt||typeof Ge.type=="string")return Ge;var Ht=tt===Qt.activeKey,ln=Object(re.a)(Object(re.a)({mode:Lt.mode||Le.mode,level:Le.level,inlineIndent:Le.inlineIndent,renderMenuItem:_e.renderMenuItem,rootPrefixCls:Le.prefixCls,index:kt,parentMenu:Le.parentMenu,manualRef:Lt.disabled?void 0:Object(h.a)(Ge.ref,Mt.bind(Object(G.a)(_e))),eventKey:tt,active:!Lt.disabled&&Ht,multiple:Le.multiple,onClick:function(ir){(Lt.onClick||y)(ir),_e.onClick(ir)},onItemHover:_e.onItemHover,motion:Le.motion,subMenuOpenDelay:Le.subMenuOpenDelay,subMenuCloseDelay:Le.subMenuCloseDelay,forceSubMenuRender:Le.forceSubMenuRender,onOpenChange:_e.onOpenChange,onDeselect:_e.onDeselect,onSelect:_e.onSelect,builtinPlacements:Le.builtinPlacements,itemIcon:Lt.itemIcon||_e.props.itemIcon,expandIcon:Lt.expandIcon||_e.props.expandIcon},vt),{},{direction:Le.direction});return(Le.mode==="inline"||We())&&(ln.triggerSubMenuAction="click"),H.cloneElement(Ge,ln)},_e.renderMenuItem=function(Ge,kt,vt){if(!Ge)return null;var Qt=_e.props.store.getState(),Jt={openKeys:Qt.openKeys,selectedKeys:Qt.selectedKeys,triggerSubMenuAction:_e.props.triggerSubMenuAction,subMenuKey:vt};return _e.renderCommonMenuItem(Ge,kt,Jt)},mt.store.setState({activeKey:Object(re.a)(Object(re.a)({},mt.store.getState().activeKey),{},Object(p.a)({},mt.eventKey,bt(mt,mt.activeKey)))}),_e.instanceArray=[],_e}return Object(j.a)(Rt,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(_e){return this.props.visible||_e.visible||this.props.className!==_e.className||!n()(this.props.style,_e.style)}},{key:"componentDidUpdate",value:function(_e){var Ge=this.props,kt="activeKey"in Ge?Ge.activeKey:Ge.store.getState().activeKey[Ze(Ge)],vt=bt(Ge,kt);if(vt!==kt)it(Ge.store,Ze(Ge),vt);else if("activeKey"in _e){var Qt=bt(_e,_e.activeKey);vt!==Qt&&it(Ge.store,Ze(Ge),vt)}}},{key:"render",value:function(){var _e=this,Ge=Object(x.a)({},this.props);this.instanceArray=[];var kt=l()(Ge.prefixCls,Ge.className,"".concat(Ge.prefixCls,"-").concat(Ge.mode)),vt={className:kt,role:Ge.role||"menu"};Ge.id&&(vt.id=Ge.id),Ge.focusable&&(vt.tabIndex=0,vt.onKeyDown=this.onKeyDown);var Qt=Ge.prefixCls,Jt=Ge.eventKey,Le=Ge.visible,tt=Ge.level,Lt=Ge.mode,Ht=Ge.overflowedIndicator,ln=Ge.theme;return Ie.forEach(function(hn){return delete Ge[hn]}),delete Ge.onClick,H.createElement(jt,Object.assign({},Ge,{prefixCls:Qt,mode:Lt,tag:"ul",level:tt,theme:ln,visible:Le,overflowedIndicator:Ht},vt),H.Children.map(Ge.children,function(hn,ir){return _e.renderMenuItem(hn,ir,Jt||"0-menu-")}))}}]),Rt}(H.Component);ct.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:y};var wt=Object(O.b)()(ct),Ve=wt,Se=k("Kwbf");function Pe(Vt,Tt,Rt){var mt=Vt.prefixCls,_e=Vt.motion,Ge=Vt.defaultMotions,kt=Ge===void 0?{}:Ge,vt=Vt.openAnimation,Qt=Vt.openTransitionName,Jt=Tt.switchingModeFromInline;if(_e)return _e;if(Object(s.a)(vt)==="object"&&vt)Object(Se.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof vt=="string")return{motionName:"".concat(mt,"-open-").concat(vt)};if(Qt)return{motionName:Qt};var Le=kt[Rt];return Le||(Jt?null:kt.other)}var ce=function(Vt){Object(L.a)(Rt,Vt);var Tt=Object(P.a)(Rt);function Rt(mt){var _e;Object(Y.a)(this,Rt),_e=Tt.call(this,mt),_e.inlineOpenKeys=[],_e.onSelect=function(vt){var Qt=Object(G.a)(_e),Jt=Qt.props;if(Jt.selectable){var Le=_e.store.getState(),tt=Le.selectedKeys,Lt=vt.key;Jt.multiple?tt=tt.concat([Lt]):tt=[Lt],"selectedKeys"in Jt||_e.store.setState({selectedKeys:tt}),Jt.onSelect(Object(re.a)(Object(re.a)({},vt),{},{selectedKeys:tt}))}},_e.onClick=function(vt){var Qt=_e.getRealMenuMode(),Jt=Object(G.a)(_e),Le=Jt.store,tt=Jt.props.onOpenChange;Qt!=="inline"&&!("openKeys"in _e.props)&&(Le.setState({openKeys:[]}),tt([])),_e.props.onClick(vt)},_e.onKeyDown=function(vt,Qt){_e.innerMenu.getWrappedInstance().onKeyDown(vt,Qt)},_e.onOpenChange=function(vt){var Qt=Object(G.a)(_e),Jt=Qt.props,Le=_e.store.getState().openKeys.concat(),tt=!1,Lt=function(ln){var hn=!1;if(ln.open)hn=Le.indexOf(ln.key)===-1,hn&&Le.push(ln.key);else{var ir=Le.indexOf(ln.key);hn=ir!==-1,hn&&Le.splice(ir,1)}tt=tt||hn};Array.isArray(vt)?vt.forEach(Lt):Lt(vt),tt&&("openKeys"in _e.props||_e.store.setState({openKeys:Le}),Jt.onOpenChange(Le))},_e.onDeselect=function(vt){var Qt=Object(G.a)(_e),Jt=Qt.props;if(Jt.selectable){var Le=_e.store.getState().selectedKeys.concat(),tt=vt.key,Lt=Le.indexOf(tt);Lt!==-1&&Le.splice(Lt,1),"selectedKeys"in Jt||_e.store.setState({selectedKeys:Le}),Jt.onDeselect(Object(re.a)(Object(re.a)({},vt),{},{selectedKeys:Le}))}},_e.onMouseEnter=function(vt){_e.restoreModeVerticalFromInline();var Qt=_e.props.onMouseEnter;Qt&&Qt(vt)},_e.onTransitionEnd=function(vt){var Qt=vt.propertyName==="width"&&vt.target===vt.currentTarget,Jt=vt.target.className,Le=Object.prototype.toString.call(Jt)==="[object SVGAnimatedString]"?Jt.animVal:Jt,tt=vt.propertyName==="font-size"&&Le.indexOf("anticon")>=0;(Qt||tt)&&_e.restoreModeVerticalFromInline()},_e.setInnerMenu=function(vt){_e.innerMenu=vt},_e.isRootMenu=!0;var Ge=mt.defaultSelectedKeys,kt=mt.defaultOpenKeys;return"selectedKeys"in mt&&(Ge=mt.selectedKeys||[]),"openKeys"in mt&&(kt=mt.openKeys||[]),_e.store=Object(O.c)({selectedKeys:Ge,openKeys:kt,activeKey:{"0-menu-":bt(mt,mt.activeKey)}}),_e.state={switchingModeFromInline:!1},_e}return Object(j.a)(Rt,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(_e){this.updateOpentKeysWhenSwitchMode(_e),this.updateMiniStore();var Ge=this.props,kt=Ge.siderCollapsed,vt=Ge.inlineCollapsed,Qt=Ge.onOpenChange;(!_e.inlineCollapsed&&vt||!_e.siderCollapsed&&kt)&&Qt([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(_e){var Ge=this.props,kt=this.store,vt=this.inlineOpenKeys,Qt=kt.getState(),Jt={};_e.mode==="inline"&&Ge.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in Ge||((Ge.inlineCollapsed&&!_e.inlineCollapsed||Ge.siderCollapsed&&!_e.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=Qt.openKeys.concat(),Jt.openKeys=[]),(!Ge.inlineCollapsed&&_e.inlineCollapsed||!Ge.siderCollapsed&&_e.siderCollapsed)&&(Jt.openKeys=vt,this.inlineOpenKeys=[])),Object.keys(Jt).length&&kt.setState(Jt)}},{key:"updateMenuDisplay",value:function(){var _e=this.props.collapsedWidth,Ge=this.store,kt=this.prevOpenKeys,vt=this.getInlineCollapsed()&&(_e===0||_e==="0"||_e==="0px");vt?(this.prevOpenKeys=Ge.getState().openKeys.concat(),this.store.setState({openKeys:[]})):kt&&(this.store.setState({openKeys:kt}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var _e=this.props.mode,Ge=this.state.switchingModeFromInline,kt=this.getInlineCollapsed();return Ge&&kt?"inline":kt?"vertical":_e}},{key:"getInlineCollapsed",value:function(){var _e=this.props,Ge=_e.inlineCollapsed,kt=_e.siderCollapsed;return kt!==void 0?kt:Ge}},{key:"restoreModeVerticalFromInline",value:function(){var _e=this.state.switchingModeFromInline;_e&&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 _e=Object(re.a)({},Object(I.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),Ge=this.getRealMenuMode();return _e.className+=" ".concat(_e.prefixCls,"-root"),_e.direction==="rtl"&&(_e.className+=" ".concat(_e.prefixCls,"-rtl")),_e=Object(re.a)(Object(re.a)({},_e),{},{mode:Ge,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Pe(this.props,this.state,Ge)}),delete _e.openAnimation,delete _e.openTransitionName,H.createElement(O.a,{store:this.store},H.createElement(Ve,Object.assign({},_e,{ref:this.setInnerMenu}),this.props.children))}}]),Rt}(H.Component);ce.defaultProps={selectable:!0,onClick:y,onSelect:y,onOpenChange:y,onDeselect:y,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:H.createElement("span",null,"\xB7\xB7\xB7")};var de=ce,be=function(Vt){Object(L.a)(Rt,Vt);var Tt=Object(P.a)(Rt);function Rt(){var mt;return Object(Y.a)(this,Rt),mt=Tt.apply(this,arguments),mt.onKeyDown=function(_e){var Ge=_e.keyCode;return Ge===m.a.ENTER?(mt.onClick(_e),!0):void 0},mt.onMouseLeave=function(_e){var Ge=mt.props,kt=Ge.eventKey,vt=Ge.onItemHover,Qt=Ge.onMouseLeave;vt({key:kt,hover:!1}),Qt({key:kt,domEvent:_e})},mt.onMouseEnter=function(_e){var Ge=mt.props,kt=Ge.eventKey,vt=Ge.onItemHover,Qt=Ge.onMouseEnter;vt({key:kt,hover:!0}),Qt({key:kt,domEvent:_e})},mt.onClick=function(_e){var Ge=mt.props,kt=Ge.eventKey,vt=Ge.multiple,Qt=Ge.onClick,Jt=Ge.onSelect,Le=Ge.onDeselect,tt=Ge.isSelected,Lt={key:kt,keyPath:[kt],item:Object(G.a)(mt),domEvent:_e};Qt(Lt),vt?tt?Le(Lt):Jt(Lt):tt||Jt(Lt)},mt.saveNode=function(_e){mt.node=_e},mt}return Object(j.a)(Rt,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var _e=this.props;_e.onDestroy&&_e.onDestroy(_e.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 _e,Ge=Object(re.a)({},this.props),kt=l()(this.getPrefixCls(),Ge.className,(_e={},Object(p.a)(_e,this.getActiveClassName(),!Ge.disabled&&Ge.active),Object(p.a)(_e,this.getSelectedClassName(),Ge.isSelected),Object(p.a)(_e,this.getDisabledClassName(),Ge.disabled),_e)),vt=Object(re.a)(Object(re.a)({},Ge.attribute),{},{title:typeof Ge.title=="string"?Ge.title:void 0,className:kt,role:Ge.role||"menuitem","aria-disabled":Ge.disabled});Ge.role==="option"?vt=Object(re.a)(Object(re.a)({},vt),{},{role:"option","aria-selected":Ge.isSelected}):(Ge.role===null||Ge.role==="none")&&(vt.role="none");var Qt={onClick:Ge.disabled?null:this.onClick,onMouseLeave:Ge.disabled?null:this.onMouseLeave,onMouseEnter:Ge.disabled?null:this.onMouseEnter},Jt=Object(re.a)({},Ge.style);Ge.mode==="inline"&&(Ge.direction==="rtl"?Jt.paddingRight=Ge.inlineIndent*Ge.level:Jt.paddingLeft=Ge.inlineIndent*Ge.level),Ie.forEach(function(tt){return delete Ge[tt]}),delete Ge.direction;var Le=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Le=H.createElement(this.props.itemIcon,this.props)),H.createElement("li",Object.assign({},Object(I.default)(Ge,["onClick","onMouseEnter","onMouseLeave","onSelect"]),vt,Qt,{style:Jt,ref:this.saveNode}),Ge.children,Le)}}]),Rt}(H.Component);be.isMenuItem=!0,be.defaultProps={onSelect:y,onMouseEnter:y,onMouseLeave:y,manualRef:y};var je=Object(O.b)(function(Vt,Tt){var Rt=Vt.activeKey,mt=Vt.selectedKeys,_e=Tt.eventKey,Ge=Tt.subMenuKey;return{active:Rt[Ge]===_e,isSelected:mt.indexOf(_e)!==-1}})(be),ze=je,ut=function(Vt){Object(L.a)(Rt,Vt);var Tt=Object(P.a)(Rt);function Rt(){var mt;return Object(Y.a)(this,Rt),mt=Tt.apply(this,arguments),mt.renderInnerMenuItem=function(_e){var Ge=mt.props,kt=Ge.renderMenuItem,vt=Ge.index;return kt(_e,vt,mt.props.subMenuKey)},mt}return Object(j.a)(Rt,[{key:"render",value:function(){var _e=Object(x.a)({},this.props),Ge=_e.className,kt=Ge===void 0?"":Ge,vt=_e.rootPrefixCls,Qt="".concat(vt,"-item-group-title"),Jt="".concat(vt,"-item-group-list"),Le=_e.title,tt=_e.children;return Ie.forEach(function(Lt){return delete _e[Lt]}),delete _e.onClick,delete _e.direction,H.createElement("li",Object.assign({},_e,{className:"".concat(kt," ").concat(vt,"-item-group")}),H.createElement("div",{className:Qt,title:typeof Le=="string"?Le:void 0},Le),H.createElement("ul",{className:Jt},H.Children.map(tt,this.renderInnerMenuItem)))}}]),Rt}(H.Component);ut.isMenuItemGroup=!0,ut.defaultProps={disabled:!0};var Dt=ut,rn=function(Tt){var Rt=Tt.className,mt=Tt.rootPrefixCls,_e=Tt.style;return H.createElement("li",{className:"".concat(Rt," ").concat(mt,"-item-divider"),style:_e})};rn.defaultProps={disabled:!0,className:"",style:{}};var mn=rn,gt=et.e=de},"49sm":function(Gt,et){var k={}.toString;Gt.exports=Array.isArray||function(re){return k.call(re)=="[object Array]"}},"4KPa":function(Gt,et,k){"use strict";var re=k("giR+"),Y=k("fyUT"),j=k("14J3"),G=k("BMrR"),L=k("iQDF"),P=k("+eQT"),H=k("jCWc"),O=k("kPKH"),I=k("q1tI"),x=k.n(I),p=k("9kvl"),m=k("wd/R"),h=k.n(m),r=k("eozf"),n=function(l){var s=l.data,u=l.disabled,c=l.setData,R=l.shixunHomeworks,w=R.workSetting,C=R.workList;return x.a.createElement("div",null,x.a.createElement(G.a,{align:"middle",className:"mt25 pl70"},x.a.createElement(O.a,null,"\u7ED3\u675F\u65F6\u95F4:"),x.a.createElement(O.a,{className:"ml5"},x.a.createElement(P.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:u,disabledDate:function(S){return Object(r.b)(S,w==null?void 0:w.course_end_date)},disabledTime:function(S){return Object(r.c)(S)},value:s.appeal_time?h()(s.appeal_time):"",onChange:function(S,b){s.appeal_time=b,c(Object.assign({},s))}})),x.a.createElement(O.a,null,x.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u533F\u8BC4TA\u4EBA\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)"))),x.a.createElement(G.a,{align:"middle",className:"mt25 pl70"},x.a.createElement(O.a,null,"\u8FDD\u89C4\u533F\u8BC4\u6263\u5206:"),x.a.createElement(O.a,{className:"ml5"},x.a.createElement(Y.a,{disabled:u,value:s.appeal_penalty,min:0,onChange:function(S){s.appeal_penalty=S,c(Object.assign({},s))}})),x.a.createElement(O.a,{flex:"1",className:"ml5"},x.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)"))))};et.a=Object(p.a)(function(a){var l=a.shixunHomeworks;return{shixunHomeworks:l}})(n)},"4wi7":function(Gt,et,k){"use strict";var re=k("14J3"),Y=k("BMrR"),j=k("sRBo"),G=k("kaz8"),L=k("5NDa"),P=k("5rEg"),H=k("9og8"),O=k("tJVT"),I=k("WmNS"),x=k.n(I),p=k("q1tI"),m=k.n(p),h=k("oOBs"),r=k.n(h),n=k("xOL1"),a=k.n(n),l=k("BdwD"),s=function(c){var R=c.data,w=c.value,C=w===void 0?[]:w,D=c.handleChangePage,S=c.setSelectedRowKeys,b=c.selectedRowKeys,_=c.onChange,f=_===void 0?function(){}:_,d=Object(p.useState)([]),g=Object(O.a)(d,2),E=g[0],T=g[1],F=Object(p.useState)([]),U=Object(O.a)(F,2),K=U[0],z=U[1],M=Object(p.useState)([]),y=Object(O.a)(M,2),W=y[0],X=y[1],te=Object(p.useState)(1),pe=Object(O.a)(te,2),Ie=pe[0],Ee=pe[1],Te=Object(p.useState)(),We=Object(O.a)(Te,2),He=We[0],Ce=We[1];return Object(p.useEffect)(function(){T(R),z([]),X([])},[R]),Object(p.useEffect)(function(){S&&(z(b),X(b))},[b]),m.a.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},m.a.createElement("div",{className:r.a.leftdiv},m.a.createElement(P.a.Search,{size:"large",onChange:function(){var ue=Object(H.a)(x.a.mark(function se(we){return x.a.wrap(function(Ke){for(;;)switch(Ke.prev=Ke.next){case 0:T(R.filter(function(st){var ne;return st==null||((ne=st.name)===null||ne===void 0)?void 0:ne.includes(we.target.value)}));case 1:case"end":return Ke.stop()}},se)}));return function(se){return ue.apply(this,arguments)}}(),placeholder:"\u53EF\u8F93\u5165\u73ED\u7EA7\u540D\u79F0\u67E5\u8BE2"}),E.length===0&&m.a.createElement(l.a,{styles:{margin:"70px auto"},customText:"\u6682\u65E0\u5206\u73ED"}),m.a.createElement("div",{style:{height:"85%",overflow:"auto",overflowX:"hidden"}},m.a.createElement(G.a.Group,{value:K.map(function(ue){return"".concat(ue.id)}),onChange:function(se){S(E.filter(function(we){return se.includes("".concat(we.id))}))},style:{marginTop:"10px"}},E.map(function(ue,se){return m.a.createElement(Y.a,{key:ue.id,style:{marginTop:"10px",lineHeight:"24px",display:"flex",width:200}},m.a.createElement(G.a,{style:{display:"flex",height:"24px",alignItems:"center"},disabled:ue.is_published,value:"".concat(ue.id)},m.a.createElement("div",{className:r.a.listClass},m.a.createElement("span",{className:r.a.spantitle,style:{width:ue.is_published?"108px":"170px"}},ue.name),ue.is_published&&m.a.createElement("span",{style:{width:"52px",height:"24px",background:"#B8B8B8",borderRadius:"13px",color:"white",lineHeight:"24px",textAlign:"center",display:"inline-block"}},"\u5DF2\u53D1\u5E03"))))})))),m.a.createElement("div",{className:r.a.rightdiv},m.a.createElement(P.a.Search,{onChange:function(se){X(K.filter(function(we){return we.name.includes(se.target.value)}))},size:"large",placeholder:"\u53EF\u8F93\u5165\u73ED\u7EA7\u540D\u79F0\u67E5\u8BE2"}),W.length===0&&m.a.createElement(l.a,{styles:{margin:"70px auto"},customText:"\u6682\u672A\u9009\u62E9\u5206\u73ED"}),W.length>0&&m.a.createElement("div",{style:{marginTop:"10px",height:"85%",overflow:"hidden",position:"relative"}},m.a.createElement("div",{style:{overflowX:"hidden",overflowY:"scroll",position:"absolute",left:0,top:0,right:-17,bottom:0}},W.map(function(ue,se){return m.a.createElement(Y.a,{justify:"space-between",style:{marginTop:"10px"},key:ue.id},m.a.createElement("div",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",marginRight:"5px",marginLeft:"5px",width:"75%"}},ue.name),m.a.createElement("img",{src:a.a,style:{cursor:"pointer",height:"16px",marginRight:17},onClick:function(){S(K.filter(function(ge){return"".concat(ge.id)!="".concat(ue.id)}))}}))})))))};et.a=s},"500L":function(Gt,et,k){"use strict";k.d(et,"a",function(){return w});var re=k("+L6B"),Y=k("2/Rp"),j=k("2qtc"),G=k("kLXV"),L=k("9og8"),P=k("k1fw"),H=k("miYZ"),O=k("tsqr"),I=k("oBTY"),x=k("tJVT"),p=k("DZo9"),m=k("8z0m"),h=k("WmNS"),r=k.n(h),n=k("q1tI"),a=k.n(n),l=k("m3rI"),s=k("wzkS"),u=k("y5JW"),c=k("LtfV"),R=m.a.Dragger;function w(C){var D=[];return C&&C.length>0&&(D=C.map(function(S){return{uid:S.id,id:S.id,name:S.title+u.c+S.filesize,url:S.url,filesize:S.filesize,status:"done",response:{id:S.id}}})),D}et.b=function(C){var D=C.value,S=C.onChange,b=C.action,_=C.className,f=C.maxSize,d=f===void 0?150:f,g=C.title,E=g===void 0?"\u4E0A\u4F20\u9644\u4EF6":g,T=C.showRemoveModal,F=T===void 0?!1:T,U=C.accept,K=U===void 0?"":U,z=C.additionalText,M=C.isDragger,y=C.number,W=y===void 0?1e3:y,X=C.aloneClear,te=X===void 0?!1:X,pe=Object(n.useState)(!1),Ie=Object(x.a)(pe,2),Ee=Ie[0],Te=Ie[1],We=Object(n.useState)(D||[]),He=Object(x.a)(We,2),Ce=He[0],ue=He[1];Object(n.useEffect)(function(){D&&(ue(Object(I.a)(D)),W===(D==null?void 0:D.length)&&Te(!0))},[D]);var se=function(){setTimeout(function(){Ce.pop(),ue(Object(I.a)(Ce))},500)},we={multiple:!0,disabled:Ee,accept:K,withCredentials:!0,fileList:Ce,beforeUpload:function(st,ne){var $=st.size/1024/1024;return Ce.concat(ne).length>W?(Ce.pop(),ue(Object(I.a)(Ce)),O.b.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20".concat(W,"\u4E2A\u6587\u4EF6")),te?Promise.reject():(se(),!1)):!0},action:b||"".concat(l.a.API_SERVER,"/api/attachments.json"),onChange:function(st){var ne,$,J=Object(I.a)(st.fileList);if(st.file.status==="done"&&((ne=st.file)===null||ne===void 0||(($=ne.response)===null||$===void 0)?void 0:$.status)===-1){var me,xe;O.b.error((me=st.file)===null||me===void 0||((xe=me.response)===null||xe===void 0)?void 0:xe.message);return}J.length>=W?Te(!0):Te(!1),ue(Object(I.a)(J)),J=J.map(function(ke){var $e;if(ke!=null&&($e=ke.response)!==null&&$e!==void 0&&$e.id){var Pt;ke.url="/api/attachments/".concat(ke==null||((Pt=ke.response)===null||Pt===void 0)?void 0:Pt.id)}return ke.name.indexOf(u.c)===-1&&(ke.name="".concat(ke.name).concat(u.c).concat(Object(u.a)(ke.size))),Object(P.a)({},ke)}),console.log("info:",st),S(J)},onRemove:function(){var Ke=Object(L.a)(r.a.mark(function ne($){var J;return r.a.wrap(function(xe){for(;;)switch(xe.prev=xe.next){case 0:if(J=function(){var ke=Object(L.a)(r.a.mark(function $e(){var Pt,Xt;return r.a.wrap(function(lt){for(;;)switch(lt.prev=lt.next){case 0:if(Pt=$.response?$.response.id:$.id,!Pt){lt.next=8;break}return lt.next=4,Object(s.d)($.response?$.response.id:$.uid);case 4:return Xt=lt.sent,lt.abrupt("return",Xt);case 8:return lt.abrupt("return",!0);case 9:case"end":return lt.stop()}},$e)}));return function(){return ke.apply(this,arguments)}}(),!F){xe.next=5;break}return xe.abrupt("return",new Promise(function(ke,$e){G.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:a.a.createElement("div",{className:"tc font16"},"\u662F\u5426\u786E\u8BA4\u5220\u9664?"),onOk:function(){var Pt=Object(L.a)(r.a.mark(function Bt(){var lt;return r.a.wrap(function(pn){for(;;)switch(pn.prev=pn.next){case 0:return pn.next=2,J();case 2:lt=pn.sent,O.b.success("\u5220\u9664\u6210\u529F"),ke(!0);case 5:case"end":return pn.stop()}},Bt)}));function Xt(){return Pt.apply(this,arguments)}return Xt}(),onCancel:function(){return ke(!1)}})}));case 5:return xe.next=7,J();case 7:return xe.abrupt("return",xe.sent);case 8:case"end":return xe.stop()}},ne)}));function st(ne){return Ke.apply(this,arguments)}return st}()};function ge(Ke){Ke.preventDefault(),Ke.stopPropagation()}return a.a.createElement("div",{className:"multi-upload ".concat(_||"")},M&&a.a.createElement(R,we,a.a.createElement("p",{className:"ant-upload-drag-icon"},a.a.createElement(c.a,null)),a.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",a.a.createElement("br",null),"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u9650\u5236\u4E3A",d,"MB)"," "),z),!M&&a.a.createElement(m.a,we,a.a.createElement(Y.a,{disabled:Ee},E),a.a.createElement("span",{onClick:ge,style:{marginLeft:10,color:"#FA6400"}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",d,"MB)"," ")))}},"55Ip":function(Gt,et,k){"use strict";k.d(et,"a",function(){return u});var re=k("Ty5D"),Y=k("dI71"),j=k("q1tI"),G=k.n(j),L=k("YS25"),P=k("17x9"),H=k.n(P),O=k("wx14"),I=k("zLVn"),x=k("9R94"),p=function(_){Object(Y.a)(f,_);function f(){for(var g,E=arguments.length,T=new Array(E),F=0;F<E;F++)T[F]=arguments[F];return g=_.call.apply(_,[this].concat(T))||this,g.history=Object(L.a)(g.props),g}var d=f.prototype;return d.render=function(){return G.a.createElement(re.c,{history:this.history,children:this.props.children})},f}(G.a.Component),m=function(_){Object(Y.a)(f,_);function f(){for(var g,E=arguments.length,T=new Array(E),F=0;F<E;F++)T[F]=arguments[F];return g=_.call.apply(_,[this].concat(T))||this,g.history=Object(L.b)(g.props),g}var d=f.prototype;return d.render=function(){return G.a.createElement(re.c,{history:this.history,children:this.props.children})},f}(G.a.Component),h=function(f,d){return typeof f=="function"?f(d):f},r=function(f,d){return typeof f=="string"?Object(L.c)(f,null,null,d):f},n=function(f){return f},a=G.a.forwardRef;typeof a=="undefined"&&(a=n);function l(_){return!!(_.metaKey||_.altKey||_.ctrlKey||_.shiftKey)}var s=a(function(_,f){var d=_.innerRef,g=_.navigate,E=_.onClick,T=Object(I.a)(_,["innerRef","navigate","onClick"]),F=T.target,U=Object(O.a)({},T,{onClick:function(z){try{E&&E(z)}catch(M){throw z.preventDefault(),M}!z.defaultPrevented&&z.button===0&&(!F||F==="_self")&&!l(z)&&(z.preventDefault(),g())}});return n!==a?U.ref=f||d:U.ref=d,G.a.createElement("a",U)}),u=a(function(_,f){var d=_.component,g=d===void 0?s:d,E=_.replace,T=_.to,F=_.innerRef,U=Object(I.a)(_,["component","replace","to","innerRef"]);return G.a.createElement(re.e.Consumer,null,function(K){K||Object(x.a)(!1);var z=K.history,M=r(h(T,K.location),K.location),y=M?z.createHref(M):"",W=Object(O.a)({},U,{href:y,navigate:function(){var te=h(T,K.location),pe=E?z.replace:z.push;pe(te)}});return n!==a?W.ref=f||F:W.innerRef=F,G.a.createElement(g,W)})});if(!1)var c,R;var w=function(f){return f},C=G.a.forwardRef;typeof C=="undefined"&&(C=w);function D(){for(var _=arguments.length,f=new Array(_),d=0;d<_;d++)f[d]=arguments[d];return f.filter(function(g){return g}).join(" ")}var S=C(function(_,f){var d=_["aria-current"],g=d===void 0?"page":d,E=_.activeClassName,T=E===void 0?"active":E,F=_.activeStyle,U=_.className,K=_.exact,z=_.isActive,M=_.location,y=_.sensitive,W=_.strict,X=_.style,te=_.to,pe=_.innerRef,Ie=Object(I.a)(_,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return G.a.createElement(re.e.Consumer,null,function(Ee){Ee||Object(x.a)(!1);var Te=M||Ee.location,We=r(h(te,Te),Te),He=We.pathname,Ce=He&&He.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ue=Ce?Object(re.f)(Te.pathname,{path:Ce,exact:K,sensitive:y,strict:W}):null,se=!!(z?z(ue,Te):ue),we=se?D(U,T):U,ge=se?Object(O.a)({},X,{},F):X,Ke=Object(O.a)({"aria-current":se&&g||null,className:we,style:ge,to:We},Ie);return w!==C?Ke.ref=f||pe:Ke.innerRef=pe,G.a.createElement(u,Ke)})});if(!1)var b},"5VF8":function(Gt,et,k){"use strict";var re=k("2qtc"),Y=k("kLXV"),j=k("5NDa"),G=k("5rEg"),L=k("k1fw"),P=k("9og8"),H=k("y8nQ"),O=k("Vl3Y"),I=k("tJVT"),x=k("WmNS"),p=k.n(x),m=k("q1tI"),h=k.n(m),r=k("XYT7"),n=k("Ty5D"),a=k("9kvl"),l=k("500L"),s=function(c){var R=c.classroomList,w=c.loading,C=c.dispatch,D=Object(n.i)(),S=O.a.useForm(),b=Object(I.a)(S,1),_=b[0];return h.a.createElement(Y.a,{centered:!0,title:"\u8865\u4EA4\u9644\u4EF6",visible:R.actionTabs.key==="\u8865\u4EA4\u9644\u4EF6",bodyStyle:{minHeight:200},onOk:Object(P.a)(p.a.mark(function f(){var d,g,E,T;return p.a.wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return U.next=2,_.validateFields();case 2:return g=Object(L.a)({},_.getFieldValue()),E=R.actionTabs.selectArrs,g.attachment_ids=(d=g.attachment_ids)===null||d===void 0?void 0:d.map(function(K){return K.response.id}),U.next=7,Object(r.V)(Object(L.a)(Object(L.a)({},g),{},{homeworkId:E.work_id}));case 7:T=U.sent,T.status===0&&(_.resetFields(),C({type:"classroomList/setActionTabs",payload:{}}));case 9:case"end":return U.stop()}},f)})),onCancel:function(){C({type:"classroomList/setActionTabs",payload:{}})}},h.a.createElement(O.a,{form:_,initialValues:{}},h.a.createElement(O.a.Item,{name:"attachment_ids",rules:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u9644\u4EF6"}]},h.a.createElement(l.b,null)),h.a.createElement(O.a.Item,{name:"description"},h.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}))))};et.a=Object(a.a)(function(u){var c=u.classroomList,R=u.loading;return{classroomList:c,loading:R}})(s)},"5VLF":function(Gt,et,k){"use strict";var re,Y;function j(G,L,P){var H=function(O,I){return G.js_beautify(O,I)};return H.js=G.js_beautify,H.css=L.css_beautify,H.html=P.html_beautify,H.js_beautify=G.js_beautify,H.css_beautify=L.css_beautify,H.html_beautify=P.html_beautify,H}!(re=[k("6UM0"),k("TXwP"),k("psGv")],Y=function(G,L,P){return j(G,L,P)}.apply(et,re),Y!==void 0&&(Gt.exports=Y))},"6+eU":function(Gt,et,k){"use strict";k.d(et,"a",function(){return C});var re=k("wx14"),Y=k("rePB"),j=k("VTBJ"),G=k("1OyB"),L=k("vuIU"),P=k("Ji7U"),H=k("LK+K"),O=k("q1tI"),I=k.n(O),x=k("TSYQ"),p=k.n(x),m=function(S){var b,_="".concat(S.rootPrefixCls,"-item"),f=p()(_,"".concat(_,"-").concat(S.page),(b={},Object(Y.a)(b,"".concat(_,"-active"),S.active),Object(Y.a)(b,S.className,!!S.className),Object(Y.a)(b,"".concat(_,"-disabled"),!S.page),b)),d=function(){S.onClick(S.page)},g=function(T){S.onKeyPress(T,S.onClick,S.page)};return I.a.createElement("li",{title:S.showTitle?S.page:null,className:f,onClick:d,onKeyPress:g,tabIndex:"0"},S.itemRender(S.page,"page",I.a.createElement("a",{rel:"nofollow"},S.page)))},h=m,r={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},n=function(D){Object(P.a)(b,D);var S=Object(H.a)(b);function b(){var _;Object(G.a)(this,b);for(var f=arguments.length,d=new Array(f),g=0;g<f;g++)d[g]=arguments[g];return _=S.call.apply(S,[this].concat(d)),_.state={goInputText:""},_.buildOptionText=function(E){return"".concat(E," ").concat(_.props.locale.items_per_page)},_.changeSize=function(E){_.props.changeSize(Number(E))},_.handleChange=function(E){_.setState({goInputText:E.target.value})},_.handleBlur=function(E){var T=_.props,F=T.goButton,U=T.quickGo,K=T.rootPrefixCls,z=_.state.goInputText;if(F||z==="")return;if(E.relatedTarget&&(E.relatedTarget.className.indexOf("".concat(K,"-prev"))>=0||E.relatedTarget.className.indexOf("".concat(K,"-next"))>=0))return;_.setState({goInputText:""}),U(_.getValidValue())},_.go=function(E){var T=_.state.goInputText;if(T==="")return;(E.keyCode===r.ENTER||E.type==="click")&&(_.setState({goInputText:""}),_.props.quickGo(_.getValidValue()))},_}return Object(L.a)(b,[{key:"getValidValue",value:function(){var f=this.state,d=f.goInputText,g=f.current;return!d||isNaN(d)?g:Number(d)}},{key:"getPageSizeOptions",value:function(){var f=this.props,d=f.pageSize,g=f.pageSizeOptions;return g.some(function(E){return E.toString()===d.toString()})?g:g.concat([d.toString()]).sort(function(E,T){var F=isNaN(Number(E))?0:Number(E),U=isNaN(Number(T))?0:Number(T);return F-U})}},{key:"render",value:function(){var f=this,d=this.props,g=d.pageSize,E=d.locale,T=d.rootPrefixCls,F=d.changeSize,U=d.quickGo,K=d.goButton,z=d.selectComponentClass,M=d.buildOptionText,y=d.selectPrefixCls,W=d.disabled,X=this.state.goInputText,te="".concat(T,"-options"),pe=z,Ie=null,Ee=null,Te=null;if(!F&&!U)return null;var We=this.getPageSizeOptions();if(F&&pe){var He=We.map(function(Ce,ue){return I.a.createElement(pe.Option,{key:ue,value:Ce.toString()},(M||f.buildOptionText)(Ce))});Ie=I.a.createElement(pe,{disabled:W,prefixCls:y,showSearch:!1,className:"".concat(te,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(g||We[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ue){return ue.parentNode}},He)}return U&&(K&&(Te=typeof K=="boolean"?I.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:W,className:"".concat(te,"-quick-jumper-button")},E.jump_to_confirm):I.a.createElement("span",{onClick:this.go,onKeyUp:this.go},K)),Ee=I.a.createElement("div",{className:"".concat(te,"-quick-jumper")},E.jump_to,I.a.createElement("input",{disabled:W,type:"text",value:X,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),E.page,Te)),I.a.createElement("li",{className:"".concat(te)},Ie,Ee)}}]),b}(I.a.Component);n.defaultProps={pageSizeOptions:["10","20","50","100"]};var a=n,l=k("N2Kk");function s(){}function u(D){return typeof D=="number"&&isFinite(D)&&Math.floor(D)===D}function c(D,S,b){return b}function R(D,S,b){var _=typeof D=="undefined"?S.pageSize:D;return Math.floor((b.total-1)/_)+1}var w=function(D){Object(P.a)(b,D);var S=Object(H.a)(b);function b(_){var f;Object(G.a)(this,b),f=S.call(this,_),f.getJumpPrevPage=function(){return Math.max(1,f.state.current-(f.props.showLessItems?3:5))},f.getJumpNextPage=function(){return Math.min(R(void 0,f.state,f.props),f.state.current+(f.props.showLessItems?3:5))},f.getItemIcon=function(F,U){var K=f.props.prefixCls,z=F||I.a.createElement("button",{type:"button","aria-label":U,className:"".concat(K,"-item-link")});return typeof F=="function"&&(z=I.a.createElement(F,Object(j.a)({},f.props))),z},f.savePaginationNode=function(F){f.paginationNode=F},f.isValid=function(F){return u(F)&&F!==f.state.current},f.shouldDisplayQuickJumper=function(){var F=f.props,U=F.showQuickJumper,K=F.pageSize,z=F.total;return z<=K?!1:U},f.handleKeyDown=function(F){(F.keyCode===r.ARROW_UP||F.keyCode===r.ARROW_DOWN)&&F.preventDefault()},f.handleKeyUp=function(F){var U=f.getValidValue(F),K=f.state.currentInputValue;U!==K&&f.setState({currentInputValue:U}),F.keyCode===r.ENTER?f.handleChange(U):F.keyCode===r.ARROW_UP?f.handleChange(U-1):F.keyCode===r.ARROW_DOWN&&f.handleChange(U+1)},f.changePageSize=function(F){var U=f.state.current,K=R(F,f.state,f.props);U=U>K?K:U,K===0&&(U=f.state.current),typeof F=="number"&&("pageSize"in f.props||f.setState({pageSize:F}),"current"in f.props||f.setState({current:U,currentInputValue:U})),f.props.onShowSizeChange(U,F),"onChange"in f.props&&f.props.onChange&&f.props.onChange(U,F)},f.handleChange=function(F){var U=f.props.disabled,K=F;if(f.isValid(K)&&!U){var z=R(void 0,f.state,f.props);K>z?K=z:K<1&&(K=1),"current"in f.props||f.setState({current:K,currentInputValue:K});var M=f.state.pageSize;return f.props.onChange(K,M),K}return f.state.current},f.prev=function(){f.hasPrev()&&f.handleChange(f.state.current-1)},f.next=function(){f.hasNext()&&f.handleChange(f.state.current+1)},f.jumpPrev=function(){f.handleChange(f.getJumpPrevPage())},f.jumpNext=function(){f.handleChange(f.getJumpNextPage())},f.hasPrev=function(){return f.state.current>1},f.hasNext=function(){return f.state.current<R(void 0,f.state,f.props)},f.runIfEnter=function(F,U){if(F.key==="Enter"||F.charCode===13){for(var K=arguments.length,z=new Array(K>2?K-2:0),M=2;M<K;M++)z[M-2]=arguments[M];U.apply(void 0,z)}},f.runIfEnterPrev=function(F){f.runIfEnter(F,f.prev)},f.runIfEnterNext=function(F){f.runIfEnter(F,f.next)},f.runIfEnterJumpPrev=function(F){f.runIfEnter(F,f.jumpPrev)},f.runIfEnterJumpNext=function(F){f.runIfEnter(F,f.jumpNext)},f.handleGoTO=function(F){(F.keyCode===r.ENTER||F.type==="click")&&f.handleChange(f.state.currentInputValue)};var d=_.onChange!==s,g="current"in _;g&&!d&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var E=_.defaultCurrent;"current"in _&&(E=_.current);var T=_.defaultPageSize;return"pageSize"in _&&(T=_.pageSize),E=Math.min(E,R(T,void 0,_)),f.state={current:E,currentInputValue:E,pageSize:T},f}return Object(L.a)(b,[{key:"componentDidUpdate",value:function(f,d){var g=this.props.prefixCls;if(d.current!==this.state.current&&this.paginationNode){var E=this.paginationNode.querySelector(".".concat(g,"-item-").concat(d.current));E&&document.activeElement===E&&E.blur()}}},{key:"getValidValue",value:function(f){var d=f.target.value,g=R(void 0,this.state,this.props),E=this.state.currentInputValue,T;return d===""?T=d:isNaN(Number(d))?T=E:d>=g?T=g:T=Number(d),T}},{key:"getShowSizeChanger",value:function(){var f=this.props,d=f.showSizeChanger,g=f.total,E=f.totalBoundaryShowSizeChanger;return typeof d!="undefined"?d:g>E}},{key:"renderPrev",value:function(f){var d=this.props,g=d.prevIcon,E=d.itemRender,T=E(f,"prev",this.getItemIcon(g,"prev page")),F=!this.hasPrev();return Object(O.isValidElement)(T)?Object(O.cloneElement)(T,{disabled:F}):T}},{key:"renderNext",value:function(f){var d=this.props,g=d.nextIcon,E=d.itemRender,T=E(f,"next",this.getItemIcon(g,"next page")),F=!this.hasNext();return Object(O.isValidElement)(T)?Object(O.cloneElement)(T,{disabled:F}):T}},{key:"render",value:function(){var f=this,d=this.props,g=d.prefixCls,E=d.className,T=d.style,F=d.disabled,U=d.hideOnSinglePage,K=d.total,z=d.locale,M=d.showQuickJumper,y=d.showLessItems,W=d.showTitle,X=d.showTotal,te=d.simple,pe=d.itemRender,Ie=d.showPrevNextJumpers,Ee=d.jumpPrevIcon,Te=d.jumpNextIcon,We=d.selectComponentClass,He=d.selectPrefixCls,Ce=d.pageSizeOptions,ue=this.state,se=ue.current,we=ue.pageSize,ge=ue.currentInputValue;if(U===!0&&K<=we)return null;var Ke=R(void 0,this.state,this.props),st=[],ne=null,$=null,J=null,me=null,xe=null,ke=M&&M.goButton,$e=y?1:2,Pt=se-1>0?se-1:0,Xt=se+1<Ke?se+1:Ke,Bt=Object.keys(this.props).reduce(function(ce,de){return(de.substr(0,5)==="data-"||de.substr(0,5)==="aria-"||de==="role")&&(ce[de]=f.props[de]),ce},{});if(te)return ke&&(typeof ke=="boolean"?xe=I.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},z.jump_to_confirm):xe=I.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},ke),xe=I.a.createElement("li",{title:W?"".concat(z.jump_to).concat(se,"/").concat(Ke):null,className:"".concat(g,"-simple-pager")},xe)),I.a.createElement("ul",Object(re.a)({className:p()(g,"".concat(g,"-simple"),Object(Y.a)({},"".concat(g,"-disabled"),F),E),style:T,ref:this.savePaginationNode},Bt),I.a.createElement("li",{title:W?z.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:p()("".concat(g,"-prev"),Object(Y.a)({},"".concat(g,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(Pt)),I.a.createElement("li",{title:W?"".concat(se,"/").concat(Ke):null,className:"".concat(g,"-simple-pager")},I.a.createElement("input",{type:"text",value:ge,disabled:F,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),I.a.createElement("span",{className:"".concat(g,"-slash")},"/"),Ke),I.a.createElement("li",{title:W?z.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:p()("".concat(g,"-next"),Object(Y.a)({},"".concat(g,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Xt)),xe);if(Ke<=3+$e*2){var lt={locale:z,rootPrefixCls:g,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:W,itemRender:pe};Ke||st.push(I.a.createElement(h,Object(re.a)({},lt,{key:"noPager",page:Ke,className:"".concat(g,"-disabled")})));for(var jt=1;jt<=Ke;jt+=1){var pn=se===jt;st.push(I.a.createElement(h,Object(re.a)({},lt,{key:jt,page:jt,active:pn})))}}else{var it=y?z.prev_3:z.prev_5,Ze=y?z.next_3:z.next_5;Ie&&(ne=I.a.createElement("li",{title:W?it:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:p()("".concat(g,"-jump-prev"),Object(Y.a)({},"".concat(g,"-jump-prev-custom-icon"),!!Ee))},pe(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(Ee,"prev page"))),$=I.a.createElement("li",{title:W?Ze:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:p()("".concat(g,"-jump-next"),Object(Y.a)({},"".concat(g,"-jump-next-custom-icon"),!!Te))},pe(this.getJumpNextPage(),"jump-next",this.getItemIcon(Te,"next page")))),me=I.a.createElement(h,{locale:z,last:!0,rootPrefixCls:g,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Ke,page:Ke,active:!1,showTitle:W,itemRender:pe}),J=I.a.createElement(h,{locale:z,rootPrefixCls:g,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:W,itemRender:pe});var bt=Math.max(1,se-$e),Mt=Math.min(se+$e,Ke);se-1<=$e&&(Mt=1+$e*2),Ke-se<=$e&&(bt=Ke-$e*2);for(var ct=bt;ct<=Mt;ct+=1){var wt=se===ct;st.push(I.a.createElement(h,{locale:z,rootPrefixCls:g,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:ct,page:ct,active:wt,showTitle:W,itemRender:pe}))}se-1>=$e*2&&se!==1+2&&(st[0]=Object(O.cloneElement)(st[0],{className:"".concat(g,"-item-after-jump-prev")}),st.unshift(ne)),Ke-se>=$e*2&&se!==Ke-2&&(st[st.length-1]=Object(O.cloneElement)(st[st.length-1],{className:"".concat(g,"-item-before-jump-next")}),st.push($)),bt!==1&&st.unshift(J),Mt!==Ke&&st.push(me)}var Ve=null;X&&(Ve=I.a.createElement("li",{className:"".concat(g,"-total-text")},X(K,[K===0?0:(se-1)*we+1,se*we>K?K:se*we])));var Se=!this.hasPrev()||!Ke,Pe=!this.hasNext()||!Ke;return I.a.createElement("ul",Object(re.a)({className:p()(g,E,Object(Y.a)({},"".concat(g,"-disabled"),F)),style:T,unselectable:"unselectable",ref:this.savePaginationNode},Bt),Ve,I.a.createElement("li",{title:W?z.prev_page:null,onClick:this.prev,tabIndex:Se?null:0,onKeyPress:this.runIfEnterPrev,className:p()("".concat(g,"-prev"),Object(Y.a)({},"".concat(g,"-disabled"),Se)),"aria-disabled":Se},this.renderPrev(Pt)),st,I.a.createElement("li",{title:W?z.next_page:null,onClick:this.next,tabIndex:Pe?null:0,onKeyPress:this.runIfEnterNext,className:p()("".concat(g,"-next"),Object(Y.a)({},"".concat(g,"-disabled"),Pe)),"aria-disabled":Pe},this.renderNext(Xt)),I.a.createElement(a,{disabled:F,locale:z,rootPrefixCls:g,selectComponentClass:We,selectPrefixCls:He,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:se,pageSize:we,pageSizeOptions:Ce,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:ke}))}}],[{key:"getDerivedStateFromProps",value:function(f,d){var g={};if("current"in f&&(g.current=f.current,f.current!==d.current&&(g.currentInputValue=g.current)),"pageSize"in f&&f.pageSize!==d.pageSize){var E=d.current,T=R(f.pageSize,d,f);E=E>T?T:E,"current"in f||(g.current=E,g.currentInputValue=E),g.pageSize=f.pageSize}return g}}]),b}(I.a.Component);w.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:s,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:s,locale:l.a,style:{},itemRender:c,totalBoundaryShowSizeChanger:50};var C=w},"632R":function(Gt,et,k){Gt.exports={flex_box_center:"flex_box_center___3r4d7",flex_space_between:"flex_space_between___v1RZU",flex_box_vertical_center:"flex_box_vertical_center___1hRcP",flex_box_center_end:"flex_box_center_end___3kWTo",flex_box_column:"flex_box_column___TGF_8",title:"title___jGN8C",export:"export___20Rrn",bg:"bg___5TRgA",tabs:"tabs___3dNSC",workListTabWrap:"workListTabWrap___2wgNK",workListTabButton:"workListTabButton___34vXT"}},"6RRn":function(Gt,et,k){"use strict";var re=k("wCXF"),Y=k("n6Qo");k.d(et,"b",function(){return Y.a});var j=k("IBYe"),G=k("6eGT"),L=k("hW8S");k.d(et,"a",function(){return L.a}),et.c=re.b},"6UM0":function(Gt,et,k){var re,Y;(function(){var j;(function(){"use strict";var L=[function(I,x,p){var m=p(1).Beautifier,h=p(5).Options;function r(n,a){var l=new m(n,a);return l.beautify()}I.exports=r,I.exports.defaultOptions=function(){return new h}},function(I,x,p){var m=p(2).Output,h=p(3).Token,r=p(4),n=p(5).Options,a=p(7).Tokenizer,l=p(7).line_starters,s=p(7).positionable_operators,u=p(7).TOKEN;function c(y,W){return W.indexOf(y)!==-1}function R(y){return y.replace(/^\s+/g,"")}function w(y){for(var W={},X=0;X<y.length;X++)W[y[X].replace(/-/g,"_")]=y[X];return W}function C(y,W){return y&&y.type===u.RESERVED&&y.text===W}function D(y,W){return y&&y.type===u.RESERVED&&c(y.text,W)}var S=["case","return","do","if","throw","else","await","break","continue","async"],b=["before-newline","after-newline","preserve-newline"],_=w(b),f=[_.before_newline,_.preserve_newline],d={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function g(y,W){if(W.multiline_frame||W.mode===d.ForInitializer||W.mode===d.Conditional)return;y.remove_indent(W.start_line_index)}function E(y){y=y.replace(r.allLineBreaks,`
`);for(var W=[],X=y.indexOf(`
`);X!==-1;)W.push(y.substring(0,X)),y=y.substring(X+1),X=y.indexOf(`
`);return y.length&&W.push(y),W}function T(y){return y===d.ArrayLiteral}function F(y){return c(y,[d.Expression,d.ForInitializer,d.Conditional])}function U(y,W){for(var X=0;X<y.length;X++){var te=y[X].trim();if(te.charAt(0)!==W)return!1}return!0}function K(y,W){for(var X=0,te=y.length,pe;X<te;X++)if(pe=y[X],pe&&pe.indexOf(W)!==0)return!1;return!0}function z(y,W){W=W||{},this._source_text=y||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new n(W)}z.prototype.create_flags=function(y,W){var X=0;y&&(X=y.indentation_level,!this._output.just_added_newline()&&y.line_indent_level>X&&(X=y.line_indent_level));var te={mode:W,parent:y,last_token:y?y.last_token:new h(u.START_BLOCK,""),last_word:y?y.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:X,alignment:0,line_indent_level:y?y.line_indent_level:X,start_line_index:this._output.get_line_number(),ternary_depth:0};return te},z.prototype._reset=function(y){var W=y.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new m(this._options,W),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(d.BlockStatement);var X=new a(y,this._options);return this._tokens=X.tokenize(),y},z.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var y,W=this._reset(this._source_text),X=this._options.eol;this._options.eol==="auto"&&(X=`
`,W&&r.lineBreak.test(W||"")&&(X=W.match(r.lineBreak)[0]));for(var te=this._tokens.next();te;)this.handle_token(te),this._last_last_text=this._flags.last_token.text,this._flags.last_token=te,te=this._tokens.next();return y=this._output.get_code(X),y},z.prototype.handle_token=function(y,W){y.type===u.START_EXPR?this.handle_start_expr(y):y.type===u.END_EXPR?this.handle_end_expr(y):y.type===u.START_BLOCK?this.handle_start_block(y):y.type===u.END_BLOCK?this.handle_end_block(y):y.type===u.WORD?this.handle_word(y):y.type===u.RESERVED?this.handle_word(y):y.type===u.SEMICOLON?this.handle_semicolon(y):y.type===u.STRING?this.handle_string(y):y.type===u.EQUALS?this.handle_equals(y):y.type===u.OPERATOR?this.handle_operator(y):y.type===u.COMMA?this.handle_comma(y):y.type===u.BLOCK_COMMENT?this.handle_block_comment(y,W):y.type===u.COMMENT?this.handle_comment(y,W):y.type===u.DOT?this.handle_dot(y):y.type===u.EOF?this.handle_eof(y):y.type===u.UNKNOWN?this.handle_unknown(y,W):this.handle_unknown(y,W)},z.prototype.handle_whitespace_and_comments=function(y,W){var X=y.newlines,te=this._options.keep_array_indentation&&T(this._flags.mode);if(y.comments_before)for(var pe=y.comments_before.next();pe;)this.handle_whitespace_and_comments(pe,W),this.handle_token(pe,W),pe=y.comments_before.next();if(te)for(var Ie=0;Ie<X;Ie+=1)this.print_newline(Ie>0,W);else if(this._options.max_preserve_newlines&&X>this._options.max_preserve_newlines&&(X=this._options.max_preserve_newlines),this._options.preserve_newlines&&X>1){this.print_newline(!1,W);for(var Ee=1;Ee<X;Ee+=1)this.print_newline(!0,W)}};var M=["async","break","continue","return","throw","yield"];z.prototype.allow_wrap_or_preserved_newline=function(y,W){if(W=W===void 0?!1:W,this._output.just_added_newline())return;var X=this._options.preserve_newlines&&y.newlines||W,te=c(this._flags.last_token.text,s)||c(y.text,s);if(te){var pe=c(this._flags.last_token.text,s)&&c(this._options.operator_position,f)||c(y.text,s);X=X&&pe}if(X)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(D(this._flags.last_token,M))return;this._output.set_wrap_point()}},z.prototype.print_newline=function(y,W){if(!W&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==u.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var X=this._tokens.peek();this._flags.mode===d.Statement&&!(this._flags.if_block&&C(X,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(y)&&(this._flags.multiline_frame=!0)},z.prototype.print_token_line_indentation=function(y){this._output.just_added_newline()&&(this._options.keep_array_indentation&&y.newlines&&(y.text==="["||T(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(y.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},z.prototype.print_token=function(y){if(this._output.raw){this._output.add_raw_token(y);return}if(this._options.comma_first&&y.previous&&y.previous.type===u.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var W=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(W),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(y),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(y),this._output.non_breaking_space=!0,this._output.add_token(y.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},z.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},z.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))},z.prototype.set_mode=function(y){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,y),this._flags=this.create_flags(this._previous_flags,y),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},z.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===d.Statement&&g(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},z.prototype.start_of_object_property=function(){return this._flags.parent.mode===d.ObjectLiteral&&this._flags.mode===d.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||D(this._flags.last_token,["get","set"]))},z.prototype.start_of_statement=function(y){var W=!1;return W=W||D(this._flags.last_token,["var","let","const"])&&y.type===u.WORD,W=W||C(this._flags.last_token,"do"),W=W||!(this._flags.parent.mode===d.ObjectLiteral&&this._flags.mode===d.Statement)&&D(this._flags.last_token,M)&&!y.newlines,W=W||C(this._flags.last_token,"else")&&!(C(y,"if")&&!y.comments_before),W=W||this._flags.last_token.type===u.END_EXPR&&(this._previous_flags.mode===d.ForInitializer||this._previous_flags.mode===d.Conditional),W=W||this._flags.last_token.type===u.WORD&&this._flags.mode===d.BlockStatement&&!this._flags.in_case&&!(y.text==="--"||y.text==="++")&&this._last_last_text!=="function"&&y.type!==u.WORD&&y.type!==u.RESERVED,W=W||this._flags.mode===d.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||D(this._flags.last_token,["get","set"])),W?(this.set_mode(d.Statement),this.indent(),this.handle_whitespace_and_comments(y,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y,D(y,["do","for","if","while"])),!0):!1},z.prototype.handle_start_expr=function(y){this.start_of_statement(y)||this.handle_whitespace_and_comments(y);var W=d.Expression;if(y.text==="["){if(this._flags.last_token.type===u.WORD||this._flags.last_token.text===")"){D(this._flags.last_token,l)&&(this._output.space_before_token=!0),this.print_token(y),this.set_mode(W),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}W=d.ArrayLiteral,T(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())),c(this._flags.last_token.type,[u.START_EXPR,u.END_EXPR,u.WORD,u.OPERATOR,u.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===u.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,W=d.ForInitializer):c(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,W=d.Conditional):c(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&y.whitespace_before===""?this._output.space_before_token=!1:(c(this._flags.last_token.text,l)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===u.EQUALS||this._flags.last_token.type===u.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y);else if(this._flags.last_token.type===u.WORD){this._output.space_before_token=!1;var X=this._tokens.peek(-3);if(this._options.space_after_named_function&&X){var te=this._tokens.peek(-4);D(X,["async","function"])||X.text==="*"&&D(te,["async","function"])?this._output.space_before_token=!0:this._flags.mode===d.ObjectLiteral?(X.text==="{"||X.text===","||X.text==="*"&&(te.text==="{"||te.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(y);(this._flags.last_token.type===u.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(c(this._last_last_text,["function","yield"])||this._flags.mode===d.ObjectLiteral&&c(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===u.START_BLOCK?this.print_newline():(this._flags.last_token.type===u.END_EXPR||this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===u.COMMA)&&this.allow_wrap_or_preserved_newline(y,y.newlines),this.print_token(y),this.set_mode(W),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},z.prototype.handle_end_expr=function(y){for(;this._flags.mode===d.Statement;)this.restore_mode();this.handle_whitespace_and_comments(y),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(y,y.text==="]"&&T(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===u.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(y),this.restore_mode(),g(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===d.Conditional&&(this._previous_flags.mode=d.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},z.prototype.handle_start_block=function(y){this.handle_whitespace_and_comments(y);var W=this._tokens.peek(),X=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===u.END_EXPR?(this.set_mode(d.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(d.BlockStatement):X&&(c(X.text,[":",","])&&c(W.type,[u.STRING,u.WORD,u.RESERVED])||c(W.text,["get","set","..."])&&c(X.type,[u.WORD,u.RESERVED]))?c(this._last_last_text,["class","interface"])&&!c(X.text,[":",","])?this.set_mode(d.BlockStatement):this.set_mode(d.ObjectLiteral):this._flags.last_token.type===u.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(d.BlockStatement):c(this._flags.last_token.type,[u.EQUALS,u.START_EXPR,u.COMMA,u.OPERATOR])||D(this._flags.last_token,["return","throw","import","default"])?this.set_mode(d.ObjectLiteral):this.set_mode(d.BlockStatement),this._flags.last_token&&(D(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var te=!W.comments_before&&W.text==="}",pe=te&&this._flags.last_word==="function"&&this._flags.last_token.type===u.END_EXPR;if(this._options.brace_preserve_inline){var Ie=0,Ee=null;this._flags.inline_frame=!0;do if(Ie+=1,Ee=this._tokens.peek(Ie-1),Ee.newlines){this._flags.inline_frame=!1;break}while(Ee.type!==u.EOF&&!(Ee.type===u.END_BLOCK&&Ee.opened===y))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&y.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==u.OPERATOR&&(pe||this._flags.last_token.type===u.EQUALS||D(this._flags.last_token,S)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(T(this._previous_flags.mode)&&(this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.COMMA)&&((this._flags.last_token.type===u.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(y),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==u.OPERATOR&&this._flags.last_token.type!==u.START_EXPR&&(this._flags.last_token.type===u.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(y),this.indent(),!te&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},z.prototype.handle_end_block=function(y){for(this.handle_whitespace_and_comments(y);this._flags.mode===d.Statement;)this.restore_mode();var W=this._flags.last_token.type===u.START_BLOCK;this._flags.inline_frame&&!W?this._output.space_before_token=!0:this._options.brace_style==="expand"?W||this.print_newline():W||(T(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(y)},z.prototype.handle_word=function(y){if(y.type===u.RESERVED){if(c(y.text,["set","get"])&&this._flags.mode!==d.ObjectLiteral)y.type=u.WORD;else if(y.text==="import"&&c(this._tokens.peek().text,["(","."]))y.type=u.WORD;else if(c(y.text,["as","from"])&&!this._flags.import_block)y.type=u.WORD;else if(this._flags.mode===d.ObjectLiteral){var W=this._tokens.peek();W.text===":"&&(y.type=u.WORD)}}if(this.start_of_statement(y)?D(this._flags.last_token,["var","let","const"])&&y.type===u.WORD&&(this._flags.declaration_statement=!0):y.newlines&&!F(this._flags.mode)&&(this._flags.last_token.type!==u.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==u.EQUALS&&(this._options.preserve_newlines||!D(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(y),this.print_newline()):this.handle_whitespace_and_comments(y),this._flags.do_block&&!this._flags.do_while)if(C(y,"while")){this._output.space_before_token=!0,this.print_token(y),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&C(y,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===d.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&D(y,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(y),this._flags.in_case=!0;return}if((this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.EQUALS||this._flags.last_token.type===u.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y)),C(y,"function")){(c(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(c(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===u.OPERATOR))&&(!this._output.just_added_blankline()&&!y.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD?D(this._flags.last_token,["get","set","new","export"])||D(this._flags.last_token,M)?this._output.space_before_token=!0:C(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===u.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(F(this._flags.mode)||T(this._flags.mode))||this.print_newline(),this.print_token(y),this._flags.last_word=y.text;return}var X="NONE";if(this._flags.last_token.type===u.END_BLOCK?this._previous_flags.inline_frame?X="SPACE":D(y,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&y.newlines?X="NEWLINE":(X="SPACE",this._output.space_before_token=!0):X="NEWLINE":this._flags.last_token.type===u.SEMICOLON&&this._flags.mode===d.BlockStatement?X="NEWLINE":this._flags.last_token.type===u.SEMICOLON&&F(this._flags.mode)?X="SPACE":this._flags.last_token.type===u.STRING?X="NEWLINE":this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD||this._flags.last_token.text==="*"&&(c(this._last_last_text,["function","yield"])||this._flags.mode===d.ObjectLiteral&&c(this._last_last_text,["{",","]))?X="SPACE":this._flags.last_token.type===u.START_BLOCK?this._flags.inline_frame?X="SPACE":X="NEWLINE":this._flags.last_token.type===u.END_EXPR&&(this._output.space_before_token=!0,X="NEWLINE"),D(y,l)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?X="SPACE":X="NEWLINE"),D(y,["else","catch","finally"]))if((!(this._flags.last_token.type===u.END_BLOCK&&this._previous_flags.mode===d.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&y.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var te=this._output.current_line;te.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else X==="NEWLINE"?D(this._flags.last_token,S)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&D(y,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==u.END_EXPR?(this._flags.last_token.type!==u.START_EXPR||!D(y,["var","let","const"]))&&this._flags.last_token.text!==":"&&(C(y,"if")&&C(y.previous,"else")?this._output.space_before_token=!0:this.print_newline()):D(y,l)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&T(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():X==="SPACE"&&(this._output.space_before_token=!0);y.previous&&(y.previous.type===u.WORD||y.previous.type===u.RESERVED)&&(this._output.space_before_token=!0),this.print_token(y),this._flags.last_word=y.text,y.type===u.RESERVED&&(y.text==="do"?this._flags.do_block=!0:y.text==="if"?this._flags.if_block=!0:y.text==="import"?this._flags.import_block=!0:this._flags.import_block&&C(y,"from")&&(this._flags.import_block=!1))},z.prototype.handle_semicolon=function(y){this.start_of_statement(y)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(y);for(var W=this._tokens.peek();this._flags.mode===d.Statement&&!(this._flags.if_block&&C(W,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(y)},z.prototype.handle_string=function(y){y.text.startsWith("`")&&y.newlines===0&&y.whitespace_before===""&&(y.previous.text===")"||this._flags.last_token.type===u.WORD)||(this.start_of_statement(y)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(y),this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.EQUALS||this._flags.last_token.type===u.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y):y.text.startsWith("`")&&this._flags.last_token.type===u.END_EXPR&&(y.previous.text==="]"||y.previous.text===")")&&y.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(y)},z.prototype.handle_equals=function(y){this.start_of_statement(y)||this.handle_whitespace_and_comments(y),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(y),this._output.space_before_token=!0},z.prototype.handle_comma=function(y){this.handle_whitespace_and_comments(y,!0),this.print_token(y),this._output.space_before_token=!0,this._flags.declaration_statement?(F(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(y)):this._flags.mode===d.ObjectLiteral||this._flags.mode===d.Statement&&this._flags.parent.mode===d.ObjectLiteral?(this._flags.mode===d.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(y)},z.prototype.handle_operator=function(y){var W=y.text==="*"&&(D(this._flags.last_token,["function","yield"])||c(this._flags.last_token.type,[u.START_BLOCK,u.COMMA,u.END_BLOCK,u.SEMICOLON])),X=c(y.text,["-","+"])&&(c(this._flags.last_token.type,[u.START_BLOCK,u.START_EXPR,u.EQUALS,u.OPERATOR])||c(this._flags.last_token.text,l)||this._flags.last_token.text===",");if(!this.start_of_statement(y)){var te=!W;this.handle_whitespace_and_comments(y,te)}if(y.text==="*"&&this._flags.last_token.type===u.DOT){this.print_token(y);return}if(y.text==="::"){this.print_token(y);return}if(this._flags.last_token.type===u.OPERATOR&&c(this._options.operator_position,f)&&this.allow_wrap_or_preserved_newline(y),y.text===":"&&this._flags.in_case){this.print_token(y),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==u.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var pe=!0,Ie=!0,Ee=!1;if(y.text===":"?this._flags.ternary_depth===0?pe=!1:(this._flags.ternary_depth-=1,Ee=!0):y.text==="?"&&(this._flags.ternary_depth+=1),!X&&!W&&this._options.preserve_newlines&&c(y.text,s)){var Te=y.text===":",We=Te&&Ee,He=Te&&!Ee;switch(this._options.operator_position){case _.before_newline:this._output.space_before_token=!He,this.print_token(y),(!Te||We)&&this.allow_wrap_or_preserved_newline(y),this._output.space_before_token=!0;return;case _.after_newline:this._output.space_before_token=!0,!Te||We?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(y):this._output.space_before_token=!1,this.print_token(y),this._output.space_before_token=!0;return;case _.preserve_newline:He||this.allow_wrap_or_preserved_newline(y),pe=!(this._output.just_added_newline()||He),this._output.space_before_token=pe,this.print_token(y),this._output.space_before_token=!0;return}}if(W){this.allow_wrap_or_preserved_newline(y),pe=!1;var Ce=this._tokens.peek();Ie=Ce&&c(Ce.type,[u.WORD,u.RESERVED])}else if(y.text==="...")this.allow_wrap_or_preserved_newline(y),pe=this._flags.last_token.type===u.START_BLOCK,Ie=!1;else if(c(y.text,["--","++","!","~"])||X){if((this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR)&&this.allow_wrap_or_preserved_newline(y),pe=!1,Ie=!1,y.newlines&&(y.text==="--"||y.text==="++"||y.text==="~")){var ue=D(this._flags.last_token,S)&&y.newlines;ue&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ue,!0)}this._flags.last_token.text===";"&&F(this._flags.mode)&&(pe=!0),this._flags.last_token.type===u.RESERVED?pe=!0:this._flags.last_token.type===u.END_EXPR?pe=!(this._flags.last_token.text==="]"&&(y.text==="--"||y.text==="++")):this._flags.last_token.type===u.OPERATOR&&(pe=c(y.text,["--","-","++","+"])&&c(this._flags.last_token.text,["--","-","++","+"]),c(y.text,["+","-"])&&c(this._flags.last_token.text,["--","++"])&&(Ie=!0)),(this._flags.mode===d.BlockStatement&&!this._flags.inline_frame||this._flags.mode===d.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||pe,this.print_token(y),this._output.space_before_token=Ie},z.prototype.handle_block_comment=function(y,W){if(this._output.raw){this._output.add_raw_token(y),y.directives&&y.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(y.directives){this.print_newline(!1,W),this.print_token(y),y.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!r.newline.test(y.text)&&!y.newlines){this._output.space_before_token=!0,this.print_token(y),this._output.space_before_token=!0;return}else this.print_block_commment(y,W)},z.prototype.print_block_commment=function(y,W){var X=E(y.text),te,pe=!1,Ie=!1,Ee=y.whitespace_before,Te=Ee.length;if(this.print_newline(!1,W),this.print_token_line_indentation(y),this._output.add_token(X[0]),this.print_newline(!1,W),X.length>1){for(X=X.slice(1),pe=U(X,"*"),Ie=K(X,Ee),pe&&(this._flags.alignment=1),te=0;te<X.length;te++)pe?(this.print_token_line_indentation(y),this._output.add_token(R(X[te]))):Ie&&X[te]?(this.print_token_line_indentation(y),this._output.add_token(X[te].substring(Te))):(this._output.current_line.set_indent(-1),this._output.add_token(X[te])),this.print_newline(!1,W);this._flags.alignment=0}},z.prototype.handle_comment=function(y,W){y.newlines?this.print_newline(!1,W):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(y),this.print_newline(!1,W)},z.prototype.handle_dot=function(y){this.start_of_statement(y)||this.handle_whitespace_and_comments(y,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),D(this._flags.last_token,S)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(y,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(y)},z.prototype.handle_unknown=function(y,W){this.print_token(y),y.text[y.text.length-1]===`
`&&this.print_newline(!1,W)},z.prototype.handle_eof=function(y){for(;this._flags.mode===d.Statement;)this.restore_mode();this.handle_whitespace_and_comments(y)},I.exports.Beautifier=z},function(I){function x(h){this.__parent=h,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=[]}x.prototype.clone_empty=function(){var h=new x(this.__parent);return h.set_indent(this.__indent_count,this.__alignment_count),h},x.prototype.item=function(h){return h<0?this.__items[this.__items.length+h]:this.__items[h]},x.prototype.has_match=function(h){for(var r=this.__items.length-1;r>=0;r--)if(this.__items[r].match(h))return!0;return!1},x.prototype.set_indent=function(h,r){this.is_empty()&&(this.__indent_count=h||0,this.__alignment_count=r||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},x.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)},x.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},x.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var h=this.__parent.current_line;return h.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),h.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),h.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,h.__items[0]===" "&&(h.__items.splice(0,1),h.__character_count-=1),!0}return!1},x.prototype.is_empty=function(){return this.__items.length===0},x.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},x.prototype.push=function(h){this.__items.push(h);var r=h.lastIndexOf(`
`);r!==-1?this.__character_count=h.length-r:this.__character_count+=h.length},x.prototype.pop=function(){var h=null;return this.is_empty()||(h=this.__items.pop(),this.__character_count-=h.length),h},x.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},x.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},x.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},x.prototype.toString=function(){var h="";return this.is_empty()?this.__parent.indent_empty_lines&&(h=this.__parent.get_indent_string(this.__indent_count)):(h=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),h+=this.__items.join("")),h};function p(h,r){this.__cache=[""],this.__indent_size=h.indent_size,this.__indent_string=h.indent_char,h.indent_with_tabs||(this.__indent_string=new Array(h.indent_size+1).join(h.indent_char)),r=r||"",h.indent_level>0&&(r=new Array(h.indent_level+1).join(this.__indent_string)),this.__base_string=r,this.__base_string_length=r.length}p.prototype.get_indent_size=function(h,r){var n=this.__base_string_length;return r=r||0,h<0&&(n=0),n+=h*this.__indent_size,n+=r,n},p.prototype.get_indent_string=function(h,r){var n=this.__base_string;return r=r||0,h<0&&(h=0,n=""),r+=h*this.__indent_size,this.__ensure_cache(r),n+=this.__cache[r],n},p.prototype.__ensure_cache=function(h){for(;h>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var h=this.__cache.length,r=0,n="";this.__indent_size&&h>=this.__indent_size&&(r=Math.floor(h/this.__indent_size),h-=r*this.__indent_size,n=new Array(r+1).join(this.__indent_string)),h&&(n+=new Array(h+1).join(" ")),this.__cache.push(n)};function m(h,r){this.__indent_cache=new p(h,r),this.raw=!1,this._end_with_newline=h.end_with_newline,this.indent_size=h.indent_size,this.wrap_line_length=h.wrap_line_length,this.indent_empty_lines=h.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new x(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(h,r){return this.__indent_cache.get_indent_string(h,r)},m.prototype.get_indent_size=function(h,r){return this.__indent_cache.get_indent_size(h,r)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(h){return this.is_empty()||!h&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(h){this.trim(!0);var r=this.current_line.pop();r&&(r[r.length-1]===`
`&&(r=r.replace(/\n+$/g,"")),this.current_line.push(r)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join(`
`);return h!==`
`&&(n=n.replace(/[\n]/g,h)),n},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(h,r){return h=h||0,r=r||0,this.next_line.set_indent(h,r),this.__lines.length>1?(this.current_line.set_indent(h,r),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(h){for(var r=0;r<h.newlines;r++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(h.whitespace_before),this.current_line.push(h.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(h){this.__add_space_before_token(),this.current_line.push(h),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.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(" "))},m.prototype.remove_indent=function(h){for(var r=this.__lines.length;h<r;)this.__lines[h]._remove_indent(),h++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(h){for(h=h===void 0?!1:h,this.current_line.trim();h&&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},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(h,r){for(var n=this.__lines.length-2;n>=0;){var a=this.__lines[n];if(a.is_empty())break;if(a.item(0).indexOf(h)!==0&&a.item(-1)!==r){this.__lines.splice(n+1,0,new x(this)),this.previous_line=this.__lines[this.__lines.length-2];break}n--}},I.exports.Output=m},function(I){function x(p,m,h,r){this.type=p,this.text=m,this.comments_before=null,this.newlines=h||0,this.whitespace_before=r||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}I.exports.Token=x},function(I,x){var p="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",h="\\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",r="\\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",n="(?:\\\\u[0-9a-fA-F]{4}|["+p+h+"])",a="(?:\\\\u[0-9a-fA-F]{4}|["+m+h+r+"])*";x.identifier=new RegExp(n+a,"g"),x.identifierStart=new RegExp(n),x.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+m+h+r+"])+");var l=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;x.newline=/[\n\r\u2028\u2029]/,x.lineBreak=new RegExp(`\r
|`+x.newline.source),x.allLineBreaks=new RegExp(x.lineBreak.source,"g")},function(I,x,p){var m=p(6).Options,h=["before-newline","after-newline","preserve-newline"];function r(n){m.call(this,n,"js");var a=this.raw_options.brace_style||null;a==="expand-strict"?this.raw_options.brace_style="expand":a==="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 l=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var s=0;s<l.length;s++)l[s]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=l[s];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",h),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}r.prototype=new m,I.exports.Options=r},function(I){function x(h,r){this.raw_options=p(h,r),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"])}x.prototype._get_array=function(h,r){var n=this.raw_options[h],a=r||[];return typeof n=="object"?n!==null&&typeof n.concat=="function"&&(a=n.concat()):typeof n=="string"&&(a=n.split(/[^a-zA-Z0-9_\/\-]+/)),a},x.prototype._get_boolean=function(h,r){var n=this.raw_options[h],a=n===void 0?!!r:!!n;return a},x.prototype._get_characters=function(h,r){var n=this.raw_options[h],a=r||"";return typeof n=="string"&&(a=n.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),a},x.prototype._get_number=function(h,r){var n=this.raw_options[h];r=parseInt(r,10),isNaN(r)&&(r=0);var a=parseInt(n,10);return isNaN(a)&&(a=r),a},x.prototype._get_selection=function(h,r,n){var a=this._get_selection_list(h,r,n);if(a.length!==1)throw new Error("Invalid Option Value: The option '"+h+`' can only be one of the following values:
`+r+`
You passed in: '`+this.raw_options[h]+"'");return a[0]},x.prototype._get_selection_list=function(h,r,n){if(!r||r.length===0)throw new Error("Selection list cannot be empty.");if(n=n||[r[0]],!this._is_valid_selection(n,r))throw new Error("Invalid Default Value!");var a=this._get_array(h,n);if(!this._is_valid_selection(a,r))throw new Error("Invalid Option Value: The option '"+h+`' can contain only the following values:
`+r+`
You passed in: '`+this.raw_options[h]+"'");return a},x.prototype._is_valid_selection=function(h,r){return h.length&&r.length&&!h.some(function(n){return r.indexOf(n)===-1})};function p(h,r){var n={};h=m(h);var a;for(a in h)a!==r&&(n[a]=h[a]);if(r&&h[r])for(a in h[r])n[a]=h[r][a];return n}function m(h){var r={},n;for(n in h){var a=n.replace(/-/g,"_");r[a]=h[n]}return r}I.exports.Options=x,I.exports.normalizeOpts=m,I.exports.mergeOpts=p},function(I,x,p){var m=p(8).InputScanner,h=p(9).Tokenizer,r=p(9).TOKEN,n=p(13).Directives,a=p(4),l=p(12).Pattern,s=p(14).TemplatablePattern;function u(U,K){return K.indexOf(U)!==-1}var c={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:r.START,RAW:r.RAW,EOF:r.EOF},R=new n(/\/\*/,/\*\//),w=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,C=/[0-9]/,D=/[^\d\.]/,S=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),b=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";b=b.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),b="\\?\\.(?!\\d) "+b,b=b.replace(/ /g,"|");var _=new RegExp(b),f="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),d=f.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),g=new RegExp("^(?:"+d.join("|")+")$"),E,T=function(U,K){h.call(this,U,K),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var z=new l(this._input),M=new s(this._input).read_options(this._options);this.__patterns={template:M,identifier:M.starting_with(a.identifier).matching(a.identifierMatch),number:z.matching(w),punct:z.matching(_),comment:z.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:z.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:z.matching(/<!--/),html_comment_end:z.matching(/-->/),include:z.starting_with(/#include/).until_after(a.lineBreak),shebang:z.starting_with(/#!/).until_after(a.lineBreak),xml:z.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:M.until(/['\\\n\r\u2028\u2029]/),double_quote:M.until(/["\\\n\r\u2028\u2029]/),template_text:M.until(/[`\\$]/),template_expression:M.until(/[`}\\]/)}};T.prototype=new h,T.prototype._is_comment=function(U){return U.type===c.COMMENT||U.type===c.BLOCK_COMMENT||U.type===c.UNKNOWN},T.prototype._is_opening=function(U){return U.type===c.START_BLOCK||U.type===c.START_EXPR},T.prototype._is_closing=function(U,K){return(U.type===c.END_BLOCK||U.type===c.END_EXPR)&&K&&(U.text==="]"&&K.text==="["||U.text===")"&&K.text==="("||U.text==="}"&&K.text==="{")},T.prototype._reset=function(){E=!1},T.prototype._get_next_token=function(U,K){var z=null;this._readWhitespace();var M=this._input.peek();return M===null?this._create_token(c.EOF,""):(z=z||this._read_non_javascript(M),z=z||this._read_string(M),z=z||this._read_word(U),z=z||this._read_singles(M),z=z||this._read_comment(M),z=z||this._read_regexp(M,U),z=z||this._read_xml(M,U),z=z||this._read_punctuation(),z=z||this._create_token(c.UNKNOWN,this._input.next()),z)},T.prototype._read_word=function(U){var K;if(K=this.__patterns.identifier.read(),K!=="")return K=K.replace(a.allLineBreaks,`
`),!(U.type===c.DOT||U.type===c.RESERVED&&(U.text==="set"||U.text==="get"))&&g.test(K)?(K==="in"||K==="of")&&(U.type===c.WORD||U.type===c.STRING)?this._create_token(c.OPERATOR,K):this._create_token(c.RESERVED,K):this._create_token(c.WORD,K);if(K=this.__patterns.number.read(),K!=="")return this._create_token(c.WORD,K)},T.prototype._read_singles=function(U){var K=null;return U==="("||U==="["?K=this._create_token(c.START_EXPR,U):U===")"||U==="]"?K=this._create_token(c.END_EXPR,U):U==="{"?K=this._create_token(c.START_BLOCK,U):U==="}"?K=this._create_token(c.END_BLOCK,U):U===";"?K=this._create_token(c.SEMICOLON,U):U==="."&&D.test(this._input.peek(1))?K=this._create_token(c.DOT,U):U===","&&(K=this._create_token(c.COMMA,U)),K&&this._input.next(),K},T.prototype._read_punctuation=function(){var U=this.__patterns.punct.read();if(U!=="")return U==="="?this._create_token(c.EQUALS,U):U==="?."?this._create_token(c.DOT,U):this._create_token(c.OPERATOR,U)},T.prototype._read_non_javascript=function(U){var K="";if(U==="#"){if(this._is_first_token()&&(K=this.__patterns.shebang.read(),K))return this._create_token(c.UNKNOWN,K.trim()+`
`);if(K=this.__patterns.include.read(),K)return this._create_token(c.UNKNOWN,K.trim()+`
`);U=this._input.next();var z="#";if(this._input.hasNext()&&this._input.testChar(C)){do U=this._input.next(),z+=U;while(this._input.hasNext()&&U!=="#"&&U!=="=");return U==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(z+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(z+="{}",this._input.next(),this._input.next())),this._create_token(c.WORD,z)}this._input.back()}else if(U==="<"&&this._is_first_token()){if(K=this.__patterns.html_comment_start.read(),K){for(;this._input.hasNext()&&!this._input.testChar(a.newline);)K+=this._input.next();return E=!0,this._create_token(c.COMMENT,K)}}else if(E&&U==="-"&&(K=this.__patterns.html_comment_end.read(),K))return E=!1,this._create_token(c.COMMENT,K);return null},T.prototype._read_comment=function(U){var K=null;if(U==="/"){var z="";if(this._input.peek(1)==="*"){z=this.__patterns.block_comment.read();var M=R.get_directives(z);M&&M.ignore==="start"&&(z+=R.readIgnored(this._input)),z=z.replace(a.allLineBreaks,`
`),K=this._create_token(c.BLOCK_COMMENT,z),K.directives=M}else this._input.peek(1)==="/"&&(z=this.__patterns.comment.read(),K=this._create_token(c.COMMENT,z))}return K},T.prototype._read_string=function(U){if(U==="`"||U==="'"||U==='"'){var K=this._input.next();return this.has_char_escapes=!1,U==="`"?K+=this._read_string_recursive("`",!0,"${"):K+=this._read_string_recursive(U),this.has_char_escapes&&this._options.unescape_strings&&(K=F(K)),this._input.peek()===U&&(K+=this._input.next()),K=K.replace(a.allLineBreaks,`
`),this._create_token(c.STRING,K)}return null},T.prototype._allow_regexp_or_xml=function(U){return U.type===c.RESERVED&&u(U.text,["return","case","throw","else","do","typeof","yield"])||U.type===c.END_EXPR&&U.text===")"&&U.opened.previous.type===c.RESERVED&&u(U.opened.previous.text,["if","while","for"])||u(U.type,[c.COMMENT,c.START_EXPR,c.START_BLOCK,c.START,c.END_BLOCK,c.OPERATOR,c.EQUALS,c.EOF,c.SEMICOLON,c.COMMA])},T.prototype._read_regexp=function(U,K){if(U==="/"&&this._allow_regexp_or_xml(K)){for(var z=this._input.next(),M=!1,y=!1;this._input.hasNext()&&(M||y||this._input.peek()!==U)&&!this._input.testChar(a.newline);)z+=this._input.peek(),M?M=!1:(M=this._input.peek()==="\\",this._input.peek()==="["?y=!0:this._input.peek()==="]"&&(y=!1)),this._input.next();return this._input.peek()===U&&(z+=this._input.next(),z+=this._input.read(a.identifier)),this._create_token(c.STRING,z)}return null},T.prototype._read_xml=function(U,K){if(this._options.e4x&&U==="<"&&this._allow_regexp_or_xml(K)){var z="",M=this.__patterns.xml.read_match();if(M){for(var y=M[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),W=y.indexOf("{")===0,X=0;M;){var te=!!M[1],pe=M[2],Ie=!!M[M.length-1]||pe.slice(0,8)==="![CDATA[";if(!Ie&&(pe===y||W&&pe.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(te?--X:++X),z+=M[0],X<=0)break;M=this.__patterns.xml.read_match()}return M||(z+=this._input.match(/[\s\S]*/g)[0]),z=z.replace(a.allLineBreaks,`
`),this._create_token(c.STRING,z)}}return null};function F(U){for(var K="",z=0,M=new m(U),y=null;M.hasNext();)if(y=M.match(/([\s]|[^\\]|\\\\)+/g),y&&(K+=y[0]),M.peek()==="\\"){if(M.next(),M.peek()==="x")y=M.match(/x([0-9A-Fa-f]{2})/g);else if(M.peek()==="u")y=M.match(/u([0-9A-Fa-f]{4})/g);else{K+="\\",M.hasNext()&&(K+=M.next());continue}if(!y)return U;if(z=parseInt(y[1],16),z>126&&z<=255&&y[0].indexOf("x")===0)return U;if(z>=0&&z<32){K+="\\"+y[0];continue}else z===34||z===39||z===92?K+="\\"+String.fromCharCode(z):K+=String.fromCharCode(z)}return K}T.prototype._read_string_recursive=function(U,K,z){var M,y;U==="'"?y=this.__patterns.single_quote:U==='"'?y=this.__patterns.double_quote:U==="`"?y=this.__patterns.template_text:U==="}"&&(y=this.__patterns.template_expression);for(var W=y.read(),X="";this._input.hasNext();){if(X=this._input.next(),X===U||!K&&a.newline.test(X)){this._input.back();break}else X==="\\"&&this._input.hasNext()?(M=this._input.peek(),M==="x"||M==="u"?this.has_char_escapes=!0:M==="\r"&&this._input.peek(1)===`
`&&this._input.next(),X+=this._input.next()):z&&(z==="${"&&X==="$"&&this._input.peek()==="{"&&(X+=this._input.next()),z===X&&(U==="`"?X+=this._read_string_recursive("}",K,"`"):X+=this._read_string_recursive("`",K,"${"),this._input.hasNext()&&(X+=this._input.next())));X+=y.read(),W+=X}return W},I.exports.Tokenizer=T,I.exports.TOKEN=c,I.exports.positionable_operators=S.slice(),I.exports.line_starters=f.slice()},function(I){var x=RegExp.prototype.hasOwnProperty("sticky");function p(m){this.__input=m||"",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 m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},p.prototype.peek=function(m){var h=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(h=this.__input.charAt(m)),h},p.prototype.__match=function(m,h){m.lastIndex=h;var r=m.exec(this.__input);return r&&!(x&&m.sticky)&&(r.index!==h&&(r=null)),r},p.prototype.test=function(m,h){return h=h||0,h+=this.__position,h>=0&&h<this.__input_length?!!this.__match(m,h):!1},p.prototype.testChar=function(m,h){var r=this.peek(h);return m.lastIndex=0,r!==null&&m.test(r)},p.prototype.match=function(m){var h=this.__match(m,this.__position);return h?this.__position+=h[0].length:h=null,h},p.prototype.read=function(m,h,r){var n="",a;return m&&(a=this.match(m),a&&(n+=a[0])),h&&(a||!m)&&(n+=this.readUntil(h,r)),n},p.prototype.readUntil=function(m,h){var r="",n=this.__position;m.lastIndex=this.__position;var a=m.exec(this.__input);return a?(n=a.index,h&&(n+=a[0].length)):n=this.__input_length,r=this.__input.substring(this.__position,n),this.__position=n,r},p.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},p.prototype.get_regexp=function(m,h){var r=null,n="g";return h&&x&&(n="y"),typeof m=="string"&&m!==""?r=new RegExp(m,n):m&&(r=new RegExp(m.source,n)),r},p.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},p.prototype.peekUntilAfter=function(m){var h=this.__position,r=this.readUntilAfter(m);return this.__position=h,r},p.prototype.lookBack=function(m){var h=this.__position-1;return h>=m.length&&this.__input.substring(h-m.length,h).toLowerCase()===m},I.exports.InputScanner=p},function(I,x,p){var m=p(8).InputScanner,h=p(3).Token,r=p(10).TokenStream,n=p(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(s,u){this._input=new m(s),this._options=u||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new n(this._input)};l.prototype.tokenize=function(){this._input.restart(),this.__tokens=new r,this._reset();for(var s,u=new h(a.START,""),c=null,R=[],w=new r;u.type!==a.EOF;){for(s=this._get_next_token(u,c);this._is_comment(s);)w.add(s),s=this._get_next_token(u,c);w.isEmpty()||(s.comments_before=w,w=new r),s.parent=c,this._is_opening(s)?(R.push(c),c=s):c&&this._is_closing(s,c)&&(s.opened=c,c.closed=s,c=R.pop(),s.parent=c),s.previous=u,u.next=s,this.__tokens.add(s),u=s}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(s,u){this._readWhitespace();var c=this._input.read(/.+/g);return c?this._create_token(a.RAW,c):this._create_token(a.EOF,"")},l.prototype._is_comment=function(s){return!1},l.prototype._is_opening=function(s){return!1},l.prototype._is_closing=function(s,u){return!1},l.prototype._create_token=function(s,u){var c=new h(s,u,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return c},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},I.exports.Tokenizer=l,I.exports.TOKEN=a},function(I){function x(p){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=p}x.prototype.restart=function(){this.__position=0},x.prototype.isEmpty=function(){return this.__tokens_length===0},x.prototype.hasNext=function(){return this.__position<this.__tokens_length},x.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__tokens[this.__position],this.__position+=1),p},x.prototype.peek=function(p){var m=null;return p=p||0,p+=this.__position,p>=0&&p<this.__tokens_length&&(m=this.__tokens[p]),m},x.prototype.add=function(p){this.__parent_token&&(p.parent=this.__parent_token),this.__tokens.push(p),this.__tokens_length+=1},I.exports.TokenStream=x},function(I,x,p){var m=p(12).Pattern;function h(r,n){m.call(this,r,n),n?this._line_regexp=this._input.get_regexp(n._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}h.prototype=new m,h.prototype.__set_whitespace_patterns=function(r,n){r+="\\t ",n+="\\n\\r",this._match_pattern=this._input.get_regexp("["+r+n+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+n+"]")},h.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var r=this._input.read(this._match_pattern);if(r===" ")this.whitespace_before_token=" ";else if(r){var n=this.__split(this._newline_regexp,r);this.newline_count=n.length-1,this.whitespace_before_token=n[this.newline_count]}return r},h.prototype.matching=function(r,n){var a=this._create();return a.__set_whitespace_patterns(r,n),a._update(),a},h.prototype._create=function(){return new h(this._input,this)},h.prototype.__split=function(r,n){r.lastIndex=0;for(var a=0,l=[],s=r.exec(n);s;)l.push(n.substring(a,s.index)),a=s.index+s[0].length,s=r.exec(n);return a<n.length?l.push(n.substring(a,n.length)):l.push(""),l},I.exports.WhitespacePattern=h},function(I){function x(p,m){this._input=p,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,m&&(this._starting_pattern=this._input.get_regexp(m._starting_pattern,!0),this._match_pattern=this._input.get_regexp(m._match_pattern,!0),this._until_pattern=this._input.get_regexp(m._until_pattern),this._until_after=m._until_after)}x.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},x.prototype.read_match=function(){return this._input.match(this._match_pattern)},x.prototype.until_after=function(p){var m=this._create();return m._until_after=!0,m._until_pattern=this._input.get_regexp(p),m._update(),m},x.prototype.until=function(p){var m=this._create();return m._until_after=!1,m._until_pattern=this._input.get_regexp(p),m._update(),m},x.prototype.starting_with=function(p){var m=this._create();return m._starting_pattern=this._input.get_regexp(p,!0),m._update(),m},x.prototype.matching=function(p){var m=this._create();return m._match_pattern=this._input.get_regexp(p,!0),m._update(),m},x.prototype._create=function(){return new x(this._input,this)},x.prototype._update=function(){},I.exports.Pattern=x},function(I){function x(p,m){p=typeof p=="string"?p:p.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(p+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(p+/\sbeautify\signore:end\s/.source+m,"g")}x.prototype.get_directives=function(p){if(!p.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var h=this.__directive_pattern.exec(p);h;)m[h[1]]=h[2],h=this.__directive_pattern.exec(p);return m},x.prototype.readIgnored=function(p){return p.readUntilAfter(this.__directives_end_ignore_pattern)},I.exports.Directives=x},function(I,x,p){var m=p(12).Pattern,h={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function r(n,a){m.call(this,n,a),this.__template_pattern=null,this._disabled=Object.assign({},h),this._excluded=Object.assign({},h),a&&(this.__template_pattern=this._input.get_regexp(a.__template_pattern),this._excluded=Object.assign(this._excluded,a._excluded),this._disabled=Object.assign(this._disabled,a._disabled));var l=new m(n);this.__patterns={handlebars_comment:l.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:l.starting_with(/{{{/).until_after(/}}}/),handlebars:l.starting_with(/{{/).until_after(/}}/),php:l.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:l.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:l.starting_with(/{%/).until_after(/%}/),django_value:l.starting_with(/{{/).until_after(/}}/),django_comment:l.starting_with(/{#/).until_after(/#}/),smarty:l.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:l.starting_with(/{\*/).until_after(/\*}/),smarty_literal:l.starting_with(/{literal}/).until_after(/{\/literal}/)}}r.prototype=new m,r.prototype._create=function(){return new r(this._input,this)},r.prototype._update=function(){this.__set_templated_pattern()},r.prototype.disable=function(n){var a=this._create();return a._disabled[n]=!0,a._update(),a},r.prototype.read_options=function(n){var a=this._create();for(var l in h)a._disabled[l]=n.templating.indexOf(l)===-1;return a._update(),a},r.prototype.exclude=function(n){var a=this._create();return a._excluded[n]=!0,a._update(),a},r.prototype.read=function(){var n="";this._match_pattern?n=this._input.read(this._starting_pattern):n=this._input.read(this._starting_pattern,this.__template_pattern);for(var a=this._read_template();a;)this._match_pattern?a+=this._input.read(this._match_pattern):a+=this._input.readUntil(this.__template_pattern),n+=a,a=this._read_template();return this._until_after&&(n+=this._input.readUntilAfter(this._until_pattern)),n},r.prototype.__set_templated_pattern=function(){var n=[];this._disabled.php||n.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||n.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||n.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(n.push(this.__patterns.django._starting_pattern.source),n.push(this.__patterns.django_value._starting_pattern.source),n.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||n.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&n.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+n.join("|")+")")},r.prototype._read_template=function(){var n="",a=this._input.peek();if(a==="<"){var l=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&l==="?"&&(n=n||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&l==="%"&&(n=n||this.__patterns.erb.read())}else a==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(n=n||this.__patterns.handlebars_comment.read(),n=n||this.__patterns.handlebars_unescaped.read(),n=n||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(n=n||this.__patterns.django_value.read()),this._excluded.django||(n=n||this.__patterns.django_comment.read(),n=n||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(n=n||this.__patterns.smarty_comment.read(),n=n||this.__patterns.smarty_literal.read(),n=n||this.__patterns.smarty.read()));return n},I.exports.TemplatablePattern=r}],P={};function H(I){var x=P[I];if(x!==void 0)return x.exports;var p=P[I]={exports:{}};return L[I](p,p.exports,H),p.exports}var O=H(0);j=O})();var G=j;!(re=[],Y=function(){return{js_beautify:G}}.apply(et,re),Y!==void 0&&(Gt.exports=Y))})()},"6eGT":function(Gt,et,k){"use strict";function re(Y){return null}et.a=re},"6fgh":function(Gt,et,k){"use strict";k.d(et,"a",function(){return L}),k.d(et,"b",function(){return P});var re=k("wd/R"),Y=k.n(re),j=k("LvDl"),G=k.n(j),L=function(O){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"YYYY-MM-DD",x=Object(j.cloneDeepWith)(O,function(p){if(p instanceof Y.a)return p.format(I)});return x},P=function H(O,I,x){var p=function(a){return Reflect.toString.call(a)==="[object Object]"};if(!p(O)&&!Array.isArray(O))return O;for(var m=0,h=Object.keys(O);m<h.length;m++){var r=h[m];Array.isArray(O[r])?O[r]=O[r].map(function(n){return H(n,I,x)}):p(O[r])?O[r]=H(O[r],I,x):I.includes(r)&&typeof O[r]=="string"&&(O[r]=x?Y()(O[r],x):Y()(O[r]))}return O}},"6vEo":function(Gt,et,k){"use strict";var re=k("2qtc"),Y=k("kLXV"),j=k("cWXX"),G=k("/ezw"),L=k("14J3"),P=k("BMrR"),H=k("jCWc"),O=k("kPKH"),I=k("7Kak"),x=k("9yH6"),p=k("5NDa"),m=k("5rEg"),h=k("oBTY"),r=k("k1fw"),n=k("9og8"),a=k("y8nQ"),l=k("Vl3Y"),s=k("tJVT"),u=k("WmNS"),c=k.n(u),R=k("q1tI"),w=k.n(R),C=k("RotF"),D=k.n(C),S=k("XYT7"),b=k("Ty5D"),_=k("9kvl"),f=function(g){var E,T,F,U=g.classroomList,K=g.loading,z=g.user,M=g.dispatch,y=Object(b.i)(),W=l.a.useForm(),X=Object(s.a)(W,1),te=X[0],pe=Object(R.useState)(!0),Ie=Object(s.a)(pe,2),Ee=Ie[0],Te=Ie[1],We=Object(R.useState)([]),He=Object(s.a)(We,2),Ce=He[0],ue=He[1],se=Object(R.useState)({page:1,limit:20,keyword:""}),we=Object(s.a)(se,2),ge=we[0],Ke=we[1],st=function(){var ne=Object(n.a)(c.a.mark(function $(){var J,me;return c.a.wrap(function(ke){for(;;)switch(ke.prev=ke.next){case 0:return ke.next=2,M({type:"shixunHomeworks/getProjectList",payload:Object(r.a)(Object(r.a)({},y),ge)});case 2:me=ke.sent,me.projects&&ue([].concat(Object(h.a)(Ce),Object(h.a)(me.projects))),((J=me.projects)===null||J===void 0?void 0:J.length)<20&&Te(!1);case 5:case"end":return ke.stop()}},$)}));return function(){return ne.apply(this,arguments)}}();return Object(R.useEffect)(function(){U.actionTabs.key==="\u5173\u8054\u9879\u76EE"&&(st(),Ce=[],ge.page=1,ge.keyword="")},[U.actionTabs.key]),w.a.createElement(Y.a,{centered:!0,title:"\u5173\u8054\u9879\u76EE",visible:U.actionTabs.key==="\u5173\u8054\u9879\u76EE",bodyStyle:{minHeight:100},onOk:Object(n.a)(c.a.mark(function ne(){var $,J,me,xe,ke;return c.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.next=2,te.validateFields();case 2:return $=Object(r.a)({},te.getFieldValue()),J=U.actionTabs,me=J.selectArrs,xe=J.cb,Pt.next=6,Object(S.S)(Object(r.a)(Object(r.a)({},$),{},{homeworkId:me.homework_id}));case 6:ke=Pt.sent,ke.status===0&&(xe?xe():M({type:"classroomList/getClassroomCommonHomeworksList",payload:Object(r.a)({},U.actionTabs.params)}),M({type:"classroomList/setActionTabs",payload:{}}));case 8:case"end":return Pt.stop()}},ne)})),onCancel:function(){M({type:"classroomList/setActionTabs",payload:{}})}},w.a.createElement(G.a,{loading:K["shixunHomeworks/getProjectList"],active:!0},Ce==""?w.a.createElement("aside",null,w.a.createElement("div",{className:"tc font14 pt20"},"\u60A8\u5F53\u524D\u5C1A\u672A\u7BA1\u7406\u4EFB\u4F55\u9879\u76EE\uFF0C\u8BF7\u5148",w.a.createElement("a",{href:"".concat((E=z.navigationInfo)===null||E===void 0||((T=E.top)===null||T===void 0)?void 0:T.old_url,"/projects/deposit/new"),target:"_blank"},"\u521B\u5EFA\u9879\u76EE"),"\u518D\u5173\u8054")):w.a.createElement("aside",null,w.a.createElement("div",{className:" mb20"},w.a.createElement(m.a.Search,{onSearch:function($){$===""?delete ge.keyword:ge.keyword=$,Ce=[],Te(!0),st()},placeholder:"\u8BF7\u8F93\u5165\u9879\u76EE\u540D\u79F0\u8FDB\u884C\u641C\u7D22",allowClear:!0,size:"large"})),w.a.createElement(l.a,{form:te,initialValues:{}},w.a.createElement(l.a.Item,{name:"project_id",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u9879\u76EE"}]},w.a.createElement(x.a.Group,null,w.a.createElement(D.a,{initialLoad:!1,pageStart:1,threshold:20,loadMore:function($){ge.page++,st()},hasMore:Ee,useWindow:!1},(F=Ce)===null||F===void 0?void 0:F.map(function(ne,$){return w.a.createElement(P.a,{key:$},w.a.createElement(O.a,null,w.a.createElement(x.a,{value:ne.id},ne.name)))}))))))))};et.a=Object(_.a)(function(d){var g=d.classroomList,E=d.user,T=d.loading;return{classroomList:g,user:E,loading:T.effects}})(f)},"7Cbv":function(Gt,et,k){"use strict";var re=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Y=new Uint8Array(16);function j(){if(!re)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return re(Y)}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 L(h){return typeof h=="string"&&G.test(h)}for(var P=L,H=[],O=0;O<256;++O)H.push((O+256).toString(16).substr(1));function I(h){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(H[h[r+0]]+H[h[r+1]]+H[h[r+2]]+H[h[r+3]]+"-"+H[h[r+4]]+H[h[r+5]]+"-"+H[h[r+6]]+H[h[r+7]]+"-"+H[h[r+8]]+H[h[r+9]]+"-"+H[h[r+10]]+H[h[r+11]]+H[h[r+12]]+H[h[r+13]]+H[h[r+14]]+H[h[r+15]]).toLowerCase();if(!P(n))throw TypeError("Stringified UUID is invalid");return n}var x=I;function p(h,r,n){h=h||{};var a=h.random||(h.rng||j)();if(a[6]=a[6]&15|64,a[8]=a[8]&63|128,r){n=n||0;for(var l=0;l<16;++l)r[n+l]=a[l];return r}return x(a)}var m=et.a=p},"7ahc":function(Gt,et,k){"use strict";k.d(et,"a",function(){return R});var re=k("k1fw"),Y=k("0Owb"),j=k("+L6B"),G=k("2/Rp"),L=k("y8nQ"),P=k("Vl3Y"),H=k("tJVT"),O=k("OaEy"),I=k("2fM7"),x=k("q1tI"),p=k.n(x),m=k("VrN/"),h=k.n(m),r=k("p77/"),n=k.n(r),a=k("c5Ni"),l=k.n(a),s=I.a.Option,u={labelCol:{span:4},wrapperCol:{span:20}},c={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"]};et.b=function(w){var C=w.callback,D=w.onCancel,S=Object(x.useState)("python"),b=Object(H.a)(S,2),_=b[0],f=b[1];function d(E){f(c[E][1])}function g(E){C(E)}return p.a.createElement(P.a,Object(Y.a)({},u,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:g}),p.a.createElement(P.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},p.a.createElement(I.a,{onChange:d},Object.keys(c).map(function(E){return p.a.createElement(s,{key:E,value:E},c[E][0])}))),p.a.createElement(P.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},p.a.createElement(R,{mode:_})),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(G.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(G.a,{type:"ghost",onClick:D},"\u53D6\u6D88")))};function R(w){var C=w.value,D=w.onChange,S=w.mode,b=w.options,_=b===void 0?{}:b,f=Object(x.useRef)(),d=Object(x.useState)(),g=Object(H.a)(d,2),E=g[0],T=g[1];return Object(x.useEffect)(function(){if(E){function F(U){var K=U.getValue();D&&D(K)}return E.on("change",F),function(){E.off("change",F)}}},[E,D]),Object(x.useEffect)(function(){E&&E.setOption("mode",S)},[E,S]),Object(x.useEffect)(function(){E&&((C!==E.getValue()||C==="")&&setTimeout(function(){E.setValue(C||" ")},300))},[E,C]),Object(x.useEffect)(function(){if(f.current&&!E){var F=h.a.fromTextArea(f.current,Object(re.a)({mode:S,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},_));T(F)}},[f.current,E]),p.a.createElement("div",{className:"my-codemirror-container"},p.a.createElement("textarea",{ref:f}))}},"7ixt":function(Gt,et,k){"use strict";k.d(et,"a",function(){return j});var re={adjustX:1,adjustY:1},Y=[0,0],j={left:{points:["cr","cl"],overflow:re,offset:[-4,0],targetOffset:Y},right:{points:["cl","cr"],overflow:re,offset:[4,0],targetOffset:Y},top:{points:["bc","tc"],overflow:re,offset:[0,-4],targetOffset:Y},bottom:{points:["tc","bc"],overflow:re,offset:[0,4],targetOffset:Y},topLeft:{points:["bl","tl"],overflow:re,offset:[0,-4],targetOffset:Y},leftTop:{points:["tr","tl"],overflow:re,offset:[-4,0],targetOffset:Y},topRight:{points:["br","tr"],overflow:re,offset:[0,-4],targetOffset:Y},rightTop:{points:["tl","tr"],overflow:re,offset:[4,0],targetOffset:Y},bottomRight:{points:["tr","br"],overflow:re,offset:[0,4],targetOffset:Y},rightBottom:{points:["bl","br"],overflow:re,offset:[4,0],targetOffset:Y},bottomLeft:{points:["tl","bl"],overflow:re,offset:[0,4],targetOffset:Y},leftBottom:{points:["br","bl"],overflow:re,offset:[-4,0],targetOffset:Y}},G=j},"815F":function(Gt,et,k){"use strict";k.d(et,"e",function(){return H}),k.d(et,"c",function(){return I}),k.d(et,"d",function(){return x}),k.d(et,"a",function(){return m}),k.d(et,"f",function(){return h}),k.d(et,"b",function(){return r});var re=k("KQm4"),Y=k("VTBJ"),j=k("Ff2n"),G=k("Zm9Q"),L=k("Kwbf"),P=k("OZM5");function H(n,a){return n!=null?n:a}function O(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],a=new Map;function l(s){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(s||[]).forEach(function(c){var R=c.key,w=c.children;Object(L.a)(R!=null,"Tree node must have a certain key: [".concat(u).concat(R,"]"));var C=String(R);Object(L.a)(!a.has(C)||R===null||R===void 0,"Same 'key' exist in the Tree: ".concat(C)),a.set(C,!0),l(w,"".concat(u).concat(C," > "))})}l(n)}function I(n){function a(l){var s=Object(G.a)(l);return s.map(function(u){if(!Object(P.i)(u))return Object(L.a)(!u,"Tree/TreeNode can only accept TreeNode as children."),null;var c=u.key,R=u.props,w=R.children,C=Object(j.a)(R,["children"]),D=Object(Y.a)({key:c},C),S=a(w);return S.length&&(D.children=S),D}).filter(function(u){return u})}return a(n)}function x(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],l=new Set(a===!0?[]:a),s=[];function u(c){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return c.map(function(w,C){var D=Object(P.h)(R?R.pos:"0",C),S=H(w.key,D),b=Object(Y.a)(Object(Y.a)({},w),{},{parent:R,pos:D,children:null,data:w,isStart:[].concat(Object(re.a)(R?R.isStart:[]),[C===0]),isEnd:[].concat(Object(re.a)(R?R.isEnd:[]),[C===c.length-1])});return s.push(b),a===!0||l.has(S)?b.children=u(w.children||[],b):b.children=[],b})}return u(n),s}function p(n,a,l){var s;l?typeof l=="string"?s=function(R){return R[l]}:typeof l=="function"&&(s=function(R){return l(R)}):s=function(R,w){return H(R.key,w)};function u(c,R,w){var C=c?c.children:n,D=c?Object(P.h)(w.pos,R):"0";if(c){var S=s(c,D),b={node:c,index:R,pos:D,key:S,parentPos:w.node?w.pos:null,level:w.level+1};a(b)}C&&C.forEach(function(_,f){u(_,f,{node:c,pos:D,level:w?w.level+1:-1})})}u(null)}function m(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=a.initWrapper,s=a.processEntity,u=a.onProcessFinished,c=arguments.length>2?arguments[2]:void 0,R={},w={},C={posEntities:R,keyEntities:w};return l&&(C=l(C)||C),p(n,function(D){var S=D.node,b=D.index,_=D.pos,f=D.key,d=D.parentPos,g=D.level,E={node:S,index:b,key:f,pos:_,level:g},T=H(f,_);R[_]=E,w[T]=E,E.parent=R[d],E.parent&&(E.parent.children=E.parent.children||[],E.parent.children.push(E)),s&&s(E,C)},c),u&&u(C),C}function h(n,a){var l=a.expandedKeys,s=a.selectedKeys,u=a.loadedKeys,c=a.loadingKeys,R=a.checkedKeys,w=a.halfCheckedKeys,C=a.dragOverNodeKey,D=a.dropPosition,S=a.keyEntities,b=S[n],_={eventKey:n,expanded:l.indexOf(n)!==-1,selected:s.indexOf(n)!==-1,loaded:u.indexOf(n)!==-1,loading:c.indexOf(n)!==-1,checked:R.indexOf(n)!==-1,halfChecked:w.indexOf(n)!==-1,pos:String(b?b.pos:""),dragOver:C===n&&D===0,dragOverGapTop:C===n&&D===-1,dragOverGapBottom:C===n&&D===1};return _}function r(n){var a=n.data,l=n.expanded,s=n.selected,u=n.checked,c=n.loaded,R=n.loading,w=n.halfChecked,C=n.dragOver,D=n.dragOverGapTop,S=n.dragOverGapBottom,b=n.pos,_=n.active,f=Object(Y.a)(Object(Y.a)({},a),{},{expanded:l,selected:s,checked:u,loaded:c,loading:R,halfChecked:w,dragOver:C,dragOverGapTop:D,dragOverGapBottom:S,pos:b,active:_});return"props"in f||Object.defineProperty(f,"props",{get:function(){return Object(L.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),n}}),f}},"8B0h":function(Gt,et,k){Gt.exports={flex_box_center:"flex_box_center___gEqtP",flex_space_between:"flex_space_between___grlN6",flex_box_vertical_center:"flex_box_vertical_center___1EQOE",flex_box_center_end:"flex_box_center_end___qI1rq",flex_box_column:"flex_box_column___1hiVF",form:"form___24-lt",efficiency:"efficiency___15_hw",configworksContainer:"configworksContainer___1ymgD"}},"8EBN":function(Gt,et,k){(function(re){re(k("VrN/"))})(function(re){"use strict";re.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var Y=0;Y<re.modeInfo.length;Y++){var j=re.modeInfo[Y];j.mimes&&(j.mime=j.mimes[0])}re.findModeByMIME=function(G){G=G.toLowerCase();for(var L=0;L<re.modeInfo.length;L++){var P=re.modeInfo[L];if(P.mime==G)return P;if(P.mimes){for(var H=0;H<P.mimes.length;H++)if(P.mimes[H]==G)return P}}if(/\+xml$/.test(G))return re.findModeByMIME("application/xml");if(/\+json$/.test(G))return re.findModeByMIME("application/json")},re.findModeByExtension=function(G){G=G.toLowerCase();for(var L=0;L<re.modeInfo.length;L++){var P=re.modeInfo[L];if(P.ext){for(var H=0;H<P.ext.length;H++)if(P.ext[H]==G)return P}}},re.findModeByFileName=function(G){for(var L=0;L<re.modeInfo.length;L++){var P=re.modeInfo[L];if(P.file&&P.file.test(G))return P}var H=G.lastIndexOf("."),O=H>-1&&G.substring(H+1,G.length);if(O)return re.findModeByExtension(O)},re.findModeByName=function(G){G=G.toLowerCase();for(var L=0;L<re.modeInfo.length;L++){var P=re.modeInfo[L];if(P.name.toLowerCase()==G)return P;if(P.alias){for(var H=0;H<P.alias.length;H++)if(P.alias[H].toLowerCase()==G)return P}}}})},"8GSA":function(Gt,et,k){"use strict";var re=k("+L6B"),Y=k("2/Rp"),j=k("0Owb"),G=k("miYZ"),L=k("tsqr"),P=k("2qtc"),H=k("kLXV"),O=k("9og8"),I=k("tJVT"),x=k("WmNS"),p=k.n(x),m=k("q1tI"),h=k.n(m),r=k("xOOu"),n=k.n(r),a=k("m3rI"),l=function(u,c){var R=u.files,w=R===void 0?[]:R,C=u.name,D=u.buttonProps,S=D===void 0?{}:D,b=u.hide,_=u.onOk,f=_===void 0?function(){}:_,d=Object(m.useState)(!1),g=Object(I.a)(d,2),E=g[0],T=g[1],F=Object(m.useRef)(new n.a);Object(m.useImperativeHandle)(c,function(){return{exportReport:U}});var U=function(){var W=Object(O.a)(p.a.mark(function X(te){var pe,Ie,Ee,Te,We,He,Ce;return p.a.wrap(function(se){for(;;)switch(se.prev=se.next){case 0:Ce=function(){return Ce=Object(O.a)(p.a.mark(function ge(){var Ke;return p.a.wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:z({},"".concat(a.a.API_SERVER,"/api/attachments/").concat(pe==null||((Ke=pe[Ee])===null||Ke===void 0)?void 0:Ke.id),function(){var $=Object(O.a)(p.a.mark(function J(me,xe){var ke,$e,Pt,Xt,Bt;return p.a.wrap(function(jt){for(;;)switch(jt.prev=jt.next){case 0:if(!(((ke=me.target.response)===null||ke===void 0?void 0:ke.type)==="application/json")){jt.next=8;break}return jt.next=3,K(me.target.response);case 3:if(Pt=jt.sent,!Pt.message){jt.next=8;break}return L.b.warn((Pt==null?void 0:Pt.message)||"\u4E0B\u8F7D\u51FA\u9519, \u8BF7\u8054\u7CFB\u7BA1\u7406\u5458"),T(!1),jt.abrupt("return");case 8:Xt=new Blob([me.target.response],{type:"application/vnd.ms-excel;charset=utf-8"}),Te=Te+Xt.size,Bt=pe==null||(($e=pe[Ee])===null||$e===void 0)?void 0:$e.filename,setTimeout(Object(O.a)(p.a.mark(function pn(){return p.a.wrap(function(Ze){for(;;)switch(Ze.prev=Ze.next){case 0:F.current.file(Bt,Xt),Ie.update({content:h.a.createElement("div",null,"\u5F53\u524D\u8FDB\u5EA6: ",h.a.createElement("span",{className:"c-blue"},Ee+1),"/",pe==null?void 0:pe.length,We>0?h.a.createElement("span",null,"(\u5DF2\u62C6\u5206",We,"\u4E2Azip\u5305)"):"")}),Ee===(pe==null?void 0:pe.length)-1?y(Ie,We>0?We+1:0):Te>900*1024*1024?(We++,Te=0,M(We,function(){Ee++,He()})):(Ee++,He());case 3:case"end":return Ze.stop()}},pn)})),2600);case 12:case"end":return jt.stop()}},J)}));return function(J,me){return $.apply(this,arguments)}}());case 1:case"end":return ne.stop()}},ge)})),Ce.apply(this,arguments)},He=function(){return Ce.apply(this,arguments)},pe=te||w,T(!0),Ee=0,Te=0,We=0,Ie=H.a.info({width:460,title:h.a.createElement("div",null,"\u6B63\u5728\u5BFC\u51FA\u9644\u4EF6,",h.a.createElement("span",{className:"c-red"},"\u8BF7\u52FF\u5173\u95ED\u6216\u64CD\u4F5C\u5F53\u524D\u6D4F\u89C8\u5668\u7A97\u53E3")),content:h.a.createElement("div",null,"\u5F53\u524D\u8FDB\u5EA6: ",h.a.createElement("span",{className:"c-blue"},Ee+1),"/",pe==null?void 0:pe.length),maskClosable:!1,okText:"\u6211\u77E5\u9053\u4E86",onOk:function(){}}),He();case 9:case"end":return se.stop()}},X)}));return function(te){return W.apply(this,arguments)}}();function K(W){return new Promise(function(X){var te=new FileReader;te.readAsText(W,"utf-8"),te.addEventListener("loadend",function(){var pe=JSON.parse(te.result);X(pe)})})}var z=function(X,te,pe,Ie){var Ee=te,Te=new window.XMLHttpRequest;return Te.withCredentials=!0,Te.addEventListener("load",function(We){pe(We,Te)},!1),Te.addEventListener("error",function(We){Ie&&Ie(We)},!1),Te.responseType="blob",Te.open("GET",Ee),Te.send(null),Te},M=function(X,te){F.current.generateAsync({type:"blob"}).then(function(pe){var Ie=document.createElement("a");Ie.href=window.URL.createObjectURL(pe),Ie.download=C+"-".concat(X)+".zip",document.body.appendChild(Ie);var Ee=document.createEvent("MouseEvents");Ee.initEvent("click",!1,!1),Ie.dispatchEvent(Ee),document.body.removeChild(Ie),F.current=new n.a,te()})},y=function(X,te){F.current.generateAsync({type:"blob"}).then(function(pe){var Ie=document.createElement("a");Ie.href=window.URL.createObjectURL(pe),te>0?Ie.download=C+"-".concat(te)+".zip":Ie.download=C+".zip",document.body.appendChild(Ie);var Ee=document.createEvent("MouseEvents");Ee.initEvent("click",!1,!1),Ie.dispatchEvent(Ee),document.body.removeChild(Ie),X.destroy(),T(!1),f(),F.current=new n.a})};return b?h.a.createElement(h.a.Fragment,null):h.a.createElement(Y.a,Object(j.a)({},S,{onClick:function(){return U()},loading:E}),"\u4E0B\u8F7D")};et.a=Object(m.forwardRef)(l)},"8hTe":function(Gt,et,k){Gt.exports={button:"button___1wy9m"}},"9Bee":function(Gt,et,k){"use strict";var re=k("DYRE"),Y=k("zeV3"),j=k("+L6B"),G=k("2/Rp"),L=k("k1fw"),P=k("9og8"),H=k("tJVT"),O=k("WmNS"),I=k.n(O),x=k("q1tI"),p=k.n(x),m=k("vg9a"),h=k("DlQD"),r=k.n(h),n=k("rUJ1");function a(ee,A){var N=ee.match(/^(\s+)(?:```)/);if(N===null)return A;var V=N[1];return A.split(`
`).map(function(oe){var q=oe.match(/^\s+/);if(q===null)return oe;var Je=Object(H.a)(q,1),Kt=Je[0];return Kt.length>=V.length?oe.slice(V.length):oe}).join(`
`)}var l=[],s=["<ul>"],u=new r.a.Renderer,c=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function R(){l.length=0,s=["<ul>"]}var w={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function C(ee,A,N,V){if(A>=ee.length||ee[A].level<=N)return A;var oe=ee[A];V.push("<li><a href='#"+oe.anchor+"'>"+oe.text+"</a>"),A++;var q=[];return A=C(ee,A,oe.level,q),q.length>0&&(V.push("<ul>"),q.forEach(function(Je){V.push(Je)}),V.push("</ul>")),V.push("</li>"),A=C(ee,A,N,V),A}function D(){return C(l,0,0,s),s.push("</ul>"),s.join("")}var S={heading:function(A){var N=c.exec(A);if(N)return{type:"heading",raw:N[0],depth:N[1].length,text:N[2]}},fences:function(A){var N=this.rules.block.fences.exec(A);if(N){var V=N[0],oe=a(V,N[3]||""),q=N[2]?N[2].trim():N[2];if(["latex","katex","math"].indexOf(q)>=0){var Je=f(),Kt=oe;oe=Je,d[Je]={type:"block",expression:Kt}}return{type:"code",raw:V,lang:q,text:oe}}}},b=/(?:\${2})([^\n`]+?)(?:\${2})/gi,_=0,f=function(){return"__special_katext_id_".concat(_++,"__")},d={};function g(){return d}function E(){_=0,d={}}function T(ee){return ee=ee.replace(b,function(A,N){var V=f();return d[V]={type:"inline",expression:N},V}),ee}var F=u.listitem;u.listitem=function(ee){return F(T(ee))};var U=u.paragraph;u.paragraph=function(ee){return U(T(ee))};var K=u.tablecell;u.tablecell=function(ee,A){return K(T(ee),A)},u.code=function(ee,A,N){var V=(A||"").match(/\S*/)[0];return V?["latex","katex","math"].indexOf(V)>=0?"<p class='editormd-tex'>".concat(ee,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(A,'">').concat(N?ee:Object(n.escape)(ee,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(N?ee:Object(n.escape)(ee,!0))+"</code></pre>"},u.heading=function(ee,A,N){var V=this.options.headerPrefix+N.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return l.push({anchor:V,level:A,text:ee}),"<h"+A+' id="'+V+'">'+ee+"</h"+A+">"},r.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),r.a.use({tokenizer:S,renderer:u});var z=r.a,M=k("SJMd"),y=k("ulZh"),W=k.n(y),X=k("m3rI"),te=k("Oy/b"),pe=k("p5ED"),Ie=k("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 Ee=function(ee,A){return(Ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(N,V){N.__proto__=V}||function(N,V){for(var oe in V)Object.prototype.hasOwnProperty.call(V,oe)&&(N[oe]=V[oe])})(ee,A)};function Te(ee,A){function N(){this.constructor=ee}Ee(ee,A),ee.prototype=A===null?Object.create(A):(N.prototype=A.prototype,new N)}function We(ee,A,N,V){return new(N||(N=Promise))(function(oe,q){function Je(Bn){try{gn(V.next(Bn))}catch(en){q(en)}}function Kt(Bn){try{gn(V.throw(Bn))}catch(en){q(en)}}function gn(Bn){var en;Bn.done?oe(Bn.value):(en=Bn.value,en instanceof N?en:new N(function(Gn){Gn(en)})).then(Je,Kt)}gn((V=V.apply(ee,A||[])).next())})}function He(ee,A){var N,V,oe,q,Je={label:0,sent:function(){if(1&oe[0])throw oe[1];return oe[1]},trys:[],ops:[]};return q={next:Kt(0),throw:Kt(1),return:Kt(2)},typeof Symbol=="function"&&(q[Symbol.iterator]=function(){return this}),q;function Kt(gn){return function(Bn){return function(en){if(N)throw new TypeError("Generator is already executing.");for(;Je;)try{if(N=1,V&&(oe=2&en[0]?V.return:en[0]?V.throw||((oe=V.return)&&oe.call(V),0):V.next)&&!(oe=oe.call(V,en[1])).done)return oe;switch(V=0,oe&&(en=[2&en[0],oe.value]),en[0]){case 0:case 1:oe=en;break;case 4:return Je.label++,{value:en[1],done:!1};case 5:Je.label++,V=en[1],en=[0];continue;case 7:en=Je.ops.pop(),Je.trys.pop();continue;default:if(!(oe=Je.trys,(oe=oe.length>0&&oe[oe.length-1])||en[0]!==6&&en[0]!==2)){Je=0;continue}if(en[0]===3&&(!oe||en[1]>oe[0]&&en[1]<oe[3])){Je.label=en[1];break}if(en[0]===6&&Je.label<oe[1]){Je.label=oe[1],oe=en;break}if(oe&&Je.label<oe[2]){Je.label=oe[2],Je.ops.push(en);break}oe[2]&&Je.ops.pop(),Je.trys.pop();continue}en=A.call(ee,Je)}catch(Gn){en=[6,Gn],V=0}finally{N=oe=0}if(5&en[0])throw en[1];return{value:en[0]?en[1]:void 0,done:!0}}([gn,Bn])}}}function Ce(){for(var ee=0,A=0,N=arguments.length;A<N;A++)ee+=arguments[A].length;var V=Array(ee),oe=0;for(A=0;A<N;A++)for(var q=arguments[A],Je=0,Kt=q.length;Je<Kt;Je++,oe++)V[oe]=q[Je];return V}var ue=function(){function ee(){}return ee.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ee.setAttributes=function(A,N){for(var V=0,oe=N;V<oe.length;V++){var q=oe[V],Je=q[0],Kt=q[1];A.setAttribute(Je,Kt)}},ee.createRect=function(A,N,V){var oe=document.createElementNS("http://www.w3.org/2000/svg","rect");return oe.setAttribute("width",A.toString()),oe.setAttribute("height",N.toString()),V&&ee.setAttributes(oe,V),oe},ee.createLine=function(A,N,V,oe,q){var Je=document.createElementNS("http://www.w3.org/2000/svg","line");return Je.setAttribute("x1",A.toString()),Je.setAttribute("y1",N.toString()),Je.setAttribute("x2",V.toString()),Je.setAttribute("y2",oe.toString()),q&&ee.setAttributes(Je,q),Je},ee.createPolygon=function(A,N){var V=document.createElementNS("http://www.w3.org/2000/svg","polygon");return V.setAttribute("points",A),N&&ee.setAttributes(V,N),V},ee.createCircle=function(A,N){var V=document.createElementNS("http://www.w3.org/2000/svg","circle");return V.setAttribute("cx",(A/2).toString()),V.setAttribute("cy",(A/2).toString()),V.setAttribute("r",A.toString()),N&&ee.setAttributes(V,N),V},ee.createEllipse=function(A,N,V){var oe=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return oe.setAttribute("cx",(A/2).toString()),oe.setAttribute("cy",(N/2).toString()),oe.setAttribute("rx",(A/2).toString()),oe.setAttribute("ry",(N/2).toString()),V&&ee.setAttributes(oe,V),oe},ee.createGroup=function(A){var N=document.createElementNS("http://www.w3.org/2000/svg","g");return A&&ee.setAttributes(N,A),N},ee.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ee.createMarker=function(A,N,V,oe,q,Je,Kt){var gn=document.createElementNS("http://www.w3.org/2000/svg","marker");return ee.setAttributes(gn,[["id",A],["orient",N],["markerWidth",V.toString()],["markerHeight",oe.toString()],["refX",q.toString()],["refY",Je.toString()]]),gn.appendChild(Kt),gn},ee.createText=function(A){var N=document.createElementNS("http://www.w3.org/2000/svg","text");return N.setAttribute("x","0"),N.setAttribute("y","0"),A&&ee.setAttributes(N,A),N},ee.createTSpan=function(A,N){var V=document.createElementNS("http://www.w3.org/2000/svg","tspan");return V.textContent=A,N&&ee.setAttributes(V,N),V},ee.createImage=function(A){var N=document.createElementNS("http://www.w3.org/2000/svg","image");return A&&ee.setAttributes(N,A),N},ee.createPoint=function(A,N){var V=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return V.x=A,V.y=N,V},ee.createPath=function(A,N){var V=document.createElementNS("http://www.w3.org/2000/svg","path");return V.setAttribute("d",A),N&&ee.setAttributes(V,N),V},ee}(),se=function(){function ee(){}return ee.addKey=function(A){ee.key=A},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}(),we=function(){function ee(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return ee.prototype.rasterize=function(A,N,V){var oe=this;return new Promise(function(q){var Je=V!==void 0?V:document.createElement("canvas");A===null&&(oe.markersOnly=!0,oe.naturalSize=!1);var Kt=document.createElementNS("http://www.w3.org/2000/svg","svg");Kt.setAttribute("xmlns","http://www.w3.org/2000/svg"),Kt.setAttribute("width",N.width.baseVal.valueAsString),Kt.setAttribute("height",N.height.baseVal.valueAsString),Kt.setAttribute("viewBox","0 0 "+N.viewBox.baseVal.width.toString()+" "+N.viewBox.baseVal.height.toString()),Kt.innerHTML=N.innerHTML,oe.naturalSize===!0?(Kt.width.baseVal.value=A.naturalWidth,Kt.height.baseVal.value=A.naturalHeight):oe.width!==void 0&&oe.height!==void 0&&(Kt.width.baseVal.value=oe.width,Kt.height.baseVal.value=oe.height),Je.width=Kt.width.baseVal.value,Je.height=Kt.height.baseVal.value;var gn=Kt.outerHTML,Bn=Je.getContext("2d");oe.markersOnly!==!0&&Bn.drawImage(A,0,0,Je.width,Je.height);var en=window.URL,Gn=new Image(Je.width,Je.height);Gn.setAttribute("crossOrigin","anonymous");var ar=new Blob([gn],{type:"image/svg+xml"}),Ur=en.createObjectURL(ar);Gn.onload=function(){Bn.drawImage(Gn,0,0),en.revokeObjectURL(Ur);var si=Je.toDataURL(oe.imageType,oe.imageQuality);q(si)},Gn.src=Ur})},ee}(),ge=function(){},Ke=function(){function ee(A){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+A+"_"}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(A){return this.styleSheet===void 0&&this.addStyleSheet(),A.name=""+this.classNamePrefix+A.localName,this.classes.push(A),this.styleSheet.sheet.insertRule("."+A.name+" {"+A.style+"}",this.styleSheet.sheet.cssRules.length),A},ee.prototype.addRule=function(A){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(A),this.styleSheet.sheet.insertRule(A.selector+" {"+A.style+"}",this.styleSheet.sheet.cssRules.length)},ee.prototype.addStyleSheet=function(){var A;this.styleSheet=document.createElement("style"),((A=this.styleSheetRoot)!==null&&A!==void 0?A:document.head).appendChild(this.styleSheet),this.addRule(new st("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new st("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new st("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new ne("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new ne("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},ee.prototype.removeStyleSheet=function(){var A;this.styleSheet&&(((A=this.styleSheetRoot)!==null&&A!==void 0?A:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ee}(),st=function(ee,A){this.selector=ee,this.style=A},ne=function(ee,A){this.localName=ee,this.style=A},$=function(){function ee(A,N,V,oe,q){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=A,this.displayMode=N,this.markerItems=V,this.uiStyleSettings=oe,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(A){var N=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=A,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var V=document.createElement("div");V.className=this.toolbarBlockStyleClass.name,V.style.whiteSpace="nowrap",this.uiContainer.appendChild(V),this.addActionButton(V,'<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(V,'<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(V,'<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(V,'<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(V,'<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(V,'<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(V,'<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(V,'<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 Je=document.createElement("div");Je.className=""+N.toolbarButtonStyleClass.name,Je.setAttribute("data-type-name",q.typeName),Je.innerHTML=q.icon,Je.addEventListener("click",function(){N.markerToolbarButtonClicked(Je,q)}),N.buttons.push(Je),N.markerButtons.push(Je)}),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 oe=document.createElement("div");oe.className=this.toolbarBlockStyleClass.name,oe.style.whiteSpace="nowrap",oe.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(oe),this.addActionButton(oe,'<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(oe,'<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(A){this.buttonClickListeners.push(A)},ee.prototype.removeButtonClickListener=function(A){this.buttonClickListeners.indexOf(A)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(A),1)},ee.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},ee.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var A=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var N=0;N<this.markerButtons.length;N++)N<A||N===A&&this.markerButtons.length-1===A?this.markerButtonBlock.appendChild(this.markerButtons[N]):(N===A&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[N]))}},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 A=this;this.buttons.forEach(function(N){N.className=N.className.replace(A.uiStyleSettings.toolbarButtonStyleColorsClassName?A.uiStyleSettings.toolbarButtonStyleColorsClassName:A.toolbarButtonStyleColorsClass.name,"").trim(),N.className=N.className.replace(A.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?A.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:A.toolbarActiveButtonStyleColorsClass.name,"").trim(),N.className+=" "+(A.uiStyleSettings.toolbarButtonStyleColorsClassName?A.uiStyleSettings.toolbarButtonStyleColorsClassName:A.toolbarButtonStyleColorsClass.name)})},ee.prototype.addActionButton=function(A,N,V){var oe=this,q=document.createElement("div");switch(q.className=""+this.toolbarButtonStyleClass.name,q.innerHTML=N,q.setAttribute("data-action",V),q.addEventListener("click",function(){oe.actionToolbarButtonClicked(q,V)}),V){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}A.appendChild(q),this.buttons.push(q)},ee.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ne("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 ne("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ne("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new ne("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 ne("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var A=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ne("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*A)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*A)+`px;
padding: `+A+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ne("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ne("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new st("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new st("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},ee.prototype.markerToolbarButtonClicked=function(A,N){this.setActiveButton(A),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(V){return V("marker",N)}),this.markerButtonOverflowBlock.style.display="none"},ee.prototype.actionToolbarButtonClicked=function(A,N){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(V){return V("action",N)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},ee.prototype.setActiveButton=function(A){this.resetButtonStyles(),A.className=A.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),A.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},ee.prototype.setActiveMarkerButton=function(A){var N=this.markerButtons.find(function(V){return V.getAttribute("data-type-name")===A});N&&this.setActiveButton(N)},ee.prototype.setCurrentMarker=function(A){var N=this;this.currentMarker=A,this.buttons.filter(function(V){return/delete|notes/.test(V.getAttribute("data-action"))}).forEach(function(V){N.currentMarker===void 0?(V.style.fillOpacity="0.4",V.style.pointerEvents="none"):(V.style.fillOpacity="1",V.style.pointerEvents="all")})},ee}(),J=function(){function ee(A,N,V,oe){this.panels=[],this.panelButtons=[],this.markerjsContainer=A,this.displayMode=N,this.uiStyleSettings=V,this.styles=oe,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return ee.prototype.addStyles=function(){var A;this.toolboxStyleClass=this.styles.addClass(new ne("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 ne("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var N=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ne("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ne("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ne("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 ne("toolbox-panel-row_colors",`
background-color: `+((A=this.uiStyleSettings.toolboxBackgroundColor)!==null&&A!==void 0?A:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new ne("toolbox_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.toolboxButtonStyleColorsClass=this.styles.addClass(new ne("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ne("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new st("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new st("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},ee.prototype.show=function(A){var N;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=A,this.uiContainer.className=this.toolboxStyleClass.name+" "+((N=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&N!==void 0?N:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},ee.prototype.setPanelButtons=function(A){var N,V,oe=this;this.panels=A,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((N=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&N!==void 0?N:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((V=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&V!==void 0?V:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(q){var Je;q.uiStyleSettings=oe.uiStyleSettings;var Kt=document.createElement("div");Kt.className=oe.toolboxButtonStyleClass.name+" "+((Je=oe.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Je!==void 0?Je:oe.toolboxButtonStyleColorsClass.name),Kt.innerHTML=q.icon,Kt.title=q.title,Kt.addEventListener("click",function(){oe.panelButtonClick(q)}),oe.panelButtons.push(Kt),oe.buttonRow.appendChild(Kt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},ee.prototype.panelButtonClick=function(A){var N=this,V=-1;if(A!==this.activePanel){V=this.panels.indexOf(A),this.panelRow.innerHTML="";var oe=A.getUi();oe.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(oe),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=A}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){N.displayMode==="inline"?N.panelRow.style.display="none":N.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(q,Je){var Kt,gn;q.className=N.toolboxButtonStyleClass.name+" "+(Je===V?""+((Kt=N.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Kt!==void 0?Kt:N.toolboxActiveButtonStyleColorsClass.name):""+((gn=N.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&gn!==void 0?gn:N.toolboxButtonStyleColorsClass.name))})},ee}(),me=function(ee,A){this.title=ee,this.icon=A},xe=function(ee){function A(N,V,oe,q){var Je=ee.call(this,N,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 Je.colors=[],Je.addTransparent=!1,Je.colorBoxes=[],Je.colors=V,Je.currentColor=oe,Je.setCurrentColor=Je.setCurrentColor.bind(Je),Je.getColorBox=Je.getColorBox.bind(Je),Je}return Te(A,ee),A.prototype.getUi=function(){var N=this,V=document.createElement("div");return V.style.overflow="hidden",V.style.whiteSpace="nowrap",this.colors.forEach(function(oe){var q=N.getColorBox(oe);V.appendChild(q),N.colorBoxes.push(q)}),V},A.prototype.getColorBox=function(N){var V=this,oe=this.uiStyleSettings.toolbarHeight/4,q=this.uiStyleSettings.toolbarHeight-oe,Je=document.createElement("div");Je.style.display="inline-block",Je.style.boxSizing="content-box",Je.style.width=q-2+"px",Je.style.height=q-2+"px",Je.style.padding="1px",Je.style.marginRight="2px",Je.style.marginBottom="2px",Je.style.borderWidth="2px",Je.style.borderStyle="solid",Je.style.borderRadius=(q+2)/2+"px",Je.style.borderColor=N===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Je.addEventListener("click",function(){V.setCurrentColor(N,Je)});var Kt=document.createElement("div");return Kt.style.display="inline-block",Kt.style.width=q-2+"px",Kt.style.height=q-2+"px",Kt.style.backgroundColor=N,Kt.style.borderRadius=q/2+"px",N==="transparent"&&(Kt.style.fill=this.uiStyleSettings.toolboxAccentColor,Kt.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>`),Je.appendChild(Kt),Je},A.prototype.setCurrentColor=function(N,V){var oe=this;this.currentColor=N,this.colorBoxes.forEach(function(q){q.style.borderColor=q===V?oe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(N)},A}(me),ke=function(){function ee(A,N,V){this._state="new",this._isSelected=!1,this._container=A,this._overlayContainer=N,this.globalSettings=V,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(A){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(A,N){},ee.prototype.dblClick=function(A,N){},ee.prototype.manipulate=function(A){},ee.prototype.pointerUp=function(A){this.stateChanged()},ee.prototype.dispose=function(){},ee.prototype.addMarkerVisualToContainer=function(A){this.container.childNodes.length>0?this.container.insertBefore(A,this.container.childNodes[0]):this.container.appendChild(A)},ee.prototype.getState=function(){return{typeName:ee.typeName,state:this.state,notes:this.notes}},ee.prototype.restoreState=function(A){this._state=A.state,this.notes=A.notes},ee.prototype.scale=function(A,N){},ee.prototype.colorChanged=function(A){this.onColorChanged&&this.onColorChanged(A),this.stateChanged()},ee.prototype.fillColorChanged=function(A){this.onFillColorChanged&&this.onFillColorChanged(A),this.stateChanged()},ee.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var A=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),A.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(A)&&this.onStateChanged(this)}},ee.typeName="MarkerBase",ee}(),$e=function(){function ee(){this.findGripByVisual=this.findGripByVisual.bind(this)}return ee.prototype.findGripByVisual=function(A){return this.topLeft.ownsTarget(A)?this.topLeft:this.topCenter.ownsTarget(A)?this.topCenter:this.topRight.ownsTarget(A)?this.topRight:this.centerLeft.ownsTarget(A)?this.centerLeft:this.centerRight.ownsTarget(A)?this.centerRight:this.bottomLeft.ownsTarget(A)?this.bottomLeft:this.bottomCenter.ownsTarget(A)?this.bottomCenter:this.bottomRight.ownsTarget(A)?this.bottomRight:void 0},ee}(),Pt=function(){function ee(){this.GRIP_SIZE=10,this.visual=ue.createGroup(),this.visual.appendChild(ue.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ue.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ee.prototype.ownsTarget=function(A){return A===this.visual||A===this.visual.childNodes[0]||A===this.visual.childNodes[1]},ee}(),Xt=function(){function ee(){}return ee.toITransformMatrix=function(A){return{a:A.a,b:A.b,c:A.c,d:A.d,e:A.e,f:A.f}},ee.toSVGMatrix=function(A,N){return A.a=N.a,A.b=N.b,A.c=N.c,A.d=N.d,A.e=N.e,A.f=N.f,A},ee}(),Bt=function(ee){function A(N,V,oe){var q=ee.call(this,N,V,oe)||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(ue.createTransform()),q.setupControlBox(),q}return Te(A,ee),Object.defineProperty(A.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"visual",{get:function(){return this._visual},set:function(N){this._visual=N;var V=ue.createTransform();this._visual.transform.baseVal.appendItem(V)},enumerable:!1,configurable:!0}),A.prototype.ownsTarget=function(N){return!!ee.prototype.ownsTarget.call(this,N)||!!(this.controlGrips.findGripByVisual(N)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(N))},A.prototype.pointerDown=function(N,V){ee.prototype.pointerDown.call(this,N,V),this.state==="new"&&(this.left=N.x,this.top=N.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var oe=this.unrotatePoint(N);if(this.manipulationStartX=oe.x,this.manipulationStartY=oe.y,this.offsetX=oe.x-this.left,this.offsetY=oe.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(V),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(V)){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 Je=this.container.transform.baseVal.getItem(0);Je.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Je,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},A.prototype.pointerUp=function(N){var V=this.state;ee.prototype.pointerUp.call(this,N),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(N),this._state="select",V==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},A.prototype.moveVisual=function(N){this.visual.style.transform="translate("+N.x+"px, "+N.y+"px)"},A.prototype.manipulate=function(N){var V=this.unrotatePoint(N);this.state==="creating"?this.resize(N):this.state==="move"?(this.left=this.manipulationStartLeft+(V.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(V.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(V):this.state==="rotate"&&this.rotate(N)},A.prototype.resize=function(N){var V=this.manipulationStartLeft,oe=this.manipulationStartWidth,q=this.manipulationStartTop,Je=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:V=this.manipulationStartLeft+N.x-this.manipulationStartX,oe=this.manipulationStartWidth+this.manipulationStartLeft-V;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:oe=this.manipulationStartWidth+N.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:q=this.manipulationStartTop+N.y-this.manipulationStartY,Je=this.manipulationStartHeight+this.manipulationStartTop-q;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Je=this.manipulationStartHeight+N.y-this.manipulationStartY}oe>=0?(this.left=V,this.width=oe):(this.left=V+oe,this.width=-oe),Je>=0?(this.top=q,this.height=Je):(this.top=q+Je,this.height=-Je),this.setSize()},A.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},A.prototype.rotate=function(N){if(Math.abs(N.x-this.centerX)>.1){var V=Math.sign(N.x-this.centerX);this.rotationAngle=180*Math.atan((N.y-this.centerY)/(N.x-this.centerX))/Math.PI+90*V,this.applyRotation()}},A.prototype.applyRotation=function(){var N=this.container.transform.baseVal.getItem(0);N.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(N,0)},A.prototype.rotatePoint=function(N){if(this.rotationAngle===0)return N;var V=this.container.getCTM(),oe=ue.createPoint(N.x,N.y);return{x:(oe=oe.matrixTransform(V)).x,y:oe.y}},A.prototype.unrotatePoint=function(N){if(this.rotationAngle===0)return N;var V=this.container.getCTM();V=V.inverse();var oe=ue.createPoint(N.x,N.y);return{x:(oe=oe.matrixTransform(V)).x,y:oe.y}},A.prototype.select=function(){ee.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},A.prototype.deselect=function(){ee.prototype.deselect.call(this),this.controlBox.style.display="none"},A.prototype.setupControlBox=function(){this.controlBox=ue.createGroup();var N=ue.createTransform();N.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(N),this.container.appendChild(this.controlBox),this.controlRect=ue.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=ue.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 $e,this.addControlGrips(),this.controlBox.style.display="none"},A.prototype.adjustControlBox=function(){var N=this.controlBox.transform.baseVal.getItem(0);N.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(N,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()},A.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()},A.prototype.createGrip=function(){var N=new Pt;return N.visual.transform.baseVal.appendItem(ue.createTransform()),this.controlBox.appendChild(N.visual),N},A.prototype.positionGrips=function(){var N=this.controlGrips.topLeft.GRIP_SIZE,V=-N/2,oe=V,q=(this.width+this.CB_DISTANCE)/2-N/2,Je=(this.height+this.CB_DISTANCE)/2-N/2,Kt=this.height+this.CB_DISTANCE-N/2,gn=this.width+this.CB_DISTANCE-N/2;this.positionGrip(this.controlGrips.topLeft.visual,V,oe),this.positionGrip(this.controlGrips.topCenter.visual,q,oe),this.positionGrip(this.controlGrips.topRight.visual,gn,oe),this.positionGrip(this.controlGrips.centerLeft.visual,V,Je),this.positionGrip(this.controlGrips.centerRight.visual,gn,Je),this.positionGrip(this.controlGrips.bottomLeft.visual,V,Kt),this.positionGrip(this.controlGrips.bottomCenter.visual,q,Kt),this.positionGrip(this.controlGrips.bottomRight.visual,gn,Kt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,q,oe-3*this.CB_DISTANCE)},A.prototype.positionGrip=function(N,V,oe){var q=N.transform.baseVal.getItem(0);q.setTranslate(V,oe),N.transform.baseVal.replaceItem(q,0)},A.prototype.hideControlBox=function(){this.controlBox.style.display="none"},A.prototype.showControlBox=function(){this.controlBox.style.display=""},A.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Xt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Xt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},ee.prototype.getState.call(this))},A.prototype.restoreState=function(N){ee.prototype.restoreState.call(this,N);var V=N;this.left=V.left,this.top=V.top,this.width=V.width,this.height=V.height,this.rotationAngle=V.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Xt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,V.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Xt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,V.containerTransformMatrix))},A.prototype.scale=function(N,V){ee.prototype.scale.call(this,N,V);var oe=this.rotatePoint({x:this.left,y:this.top}),q=this.unrotatePoint({x:oe.x*N,y:oe.y*V});this.left=q.x,this.top=q.y,this.width=this.width*N,this.height=this.height*V,this.adjustControlBox()},A}(ke),lt=function(ee){function A(N,V,oe){var q=ee.call(this,N,V,oe)||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(A,ee),A.prototype.ownsTarget=function(N){return!(!ee.prototype.ownsTarget.call(this,N)&&N!==this.visual)},A.prototype.createVisual=function(){this.visual=ue.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)},A.prototype.pointerDown=function(N,V){ee.prototype.pointerDown.call(this,N,V),this.state==="new"&&(this.createVisual(),this.moveVisual(N),this._state="creating")},A.prototype.manipulate=function(N){ee.prototype.manipulate.call(this,N)},A.prototype.resize=function(N){ee.prototype.resize.call(this,N),this.setSize()},A.prototype.setSize=function(){ee.prototype.setSize.call(this),ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},A.prototype.pointerUp=function(N){ee.prototype.pointerUp.call(this,N),this.setSize()},A.prototype.setStrokeColor=function(N){this.strokeColor=N,this.visual&&ue.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(N),this.stateChanged()},A.prototype.setFillColor=function(N){this.fillColor=N,this.visual&&ue.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},A.prototype.setStrokeWidth=function(N){this.strokeWidth=N,this.visual&&ue.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},A.prototype.setStrokeDasharray=function(N){this.strokeDasharray=N,this.visual&&ue.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},A.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))},A.prototype.restoreState=function(N){var V=N;this.fillColor=V.fillColor,this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.opacity=V.opacity,this.createVisual(),ee.prototype.restoreState.call(this,N),this.setSize()},A.prototype.scale=function(N,V){ee.prototype.scale.call(this,N,V),this.setSize()},A.title="Rectangle marker",A}(Bt),jt=function(ee){function A(N,V,oe,q){var Je=ee.call(this,N,q||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Je.widths=[],Je.widthBoxes=[],Je.widths=V,Je.currentWidth=oe,Je.setCurrentWidth=Je.setCurrentWidth.bind(Je),Je}return Te(A,ee),A.prototype.getUi=function(){var N=this,V=document.createElement("div");return V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2",this.widths.forEach(function(oe){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=oe===N.currentWidth?N.uiStyleSettings.toolboxAccentColor:"transparent",q.addEventListener("click",function(){N.setCurrentWidth(oe,q)}),V.appendChild(q);var Je=document.createElement("div");Je.innerText=oe.toString(),Je.style.marginRight="5px",q.appendChild(Je);var Kt=document.createElement("div");Kt.style.minHeight="20px",Kt.style.flexGrow="2",Kt.style.display="flex",Kt.style.alignItems="center";var gn=document.createElement("hr");gn.style.minWidth="20px",gn.style.border="0px",gn.style.borderTop=oe+"px solid "+N.uiStyleSettings.toolboxColor,gn.style.flexGrow="2",Kt.appendChild(gn),q.appendChild(Kt),N.widthBoxes.push(q)}),V},A.prototype.setCurrentWidth=function(N,V){var oe=this;this.currentWidth=N,this.widthBoxes.forEach(function(q){q.style.borderColor=q===V?oe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},A}(me),pn=function(ee){function A(N,V,oe,q){var Je=ee.call(this,N,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 Je.styles=[],Je.styleBoxes=[],Je.styles=V,Je.currentStyle=oe,Je.setCurrentStyle=Je.setCurrentStyle.bind(Je),Je}return Te(A,ee),A.prototype.getUi=function(){var N=this,V=document.createElement("div");return V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2",this.styles.forEach(function(oe){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/N.styles.length-5+"%",q.style.borderColor=oe===N.currentStyle?N.uiStyleSettings.toolboxAccentColor:"transparent",q.addEventListener("click",function(){N.setCurrentStyle(oe,q)}),V.appendChild(q);var Je=document.createElement("div");Je.style.minHeight="20px",Je.style.flexGrow="2",Je.style.overflow="hidden";var Kt=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+N.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(oe!==""?'stroke-dasharray="'+oe+'"':"")+` />
</svg>`;Je.innerHTML=Kt,q.appendChild(Je),N.styleBoxes.push(q)}),V},A.prototype.setCurrentStyle=function(N,V){var oe=this;this.currentStyle=N,this.styleBoxes.forEach(function(q){q.style.borderColor=q===V?oe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},A}(me),it=function(ee){function A(N,V,oe){var q=ee.call(this,N,V,oe)||this;return q.strokeColor=oe.defaultColor,q.strokeWidth=oe.defaultStrokeWidth,q.strokeDasharray=oe.defaultStrokeDasharray,q.strokePanel=new xe("Line color",oe.defaultColorSet,oe.defaultColor),q.strokePanel.onColorChanged=q.setStrokeColor,q.strokeWidthPanel=new jt("Line width",oe.defaultStrokeWidths,oe.defaultStrokeWidth),q.strokeWidthPanel.onWidthChanged=q.setStrokeWidth,q.strokeStylePanel=new pn("Line style",oe.defaultStrokeDasharrays,oe.defaultStrokeDasharray),q.strokeStylePanel.onStyleChanged=q.setStrokeDasharray,q}return Te(A,ee),Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var N=ee.prototype.getState.call(this);return N.typeName=A.typeName,N},A.typeName="FrameMarker",A.title="Frame marker",A.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',A}(lt),Ze=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},bt=function(ee){function A(N,V,oe){var q=ee.call(this,N,V,oe)||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(A,ee),A.prototype.ownsTarget=function(N){return!!ee.prototype.ownsTarget.call(this,N)||!(!this.grip1.ownsTarget(N)&&!this.grip2.ownsTarget(N))},A.prototype.pointerDown=function(N,V){ee.prototype.pointerDown.call(this,N,V),this.manipulationStartX=N.x,this.manipulationStartY=N.y,this.state==="new"&&(this.x1=N.x,this.y1=N.y,this.x2=N.x,this.y2=N.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(V)?this.activeGrip=this.grip1:this.grip2.ownsTarget(V)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},A.prototype.pointerUp=function(N){var V=this.state;ee.prototype.pointerUp.call(this,N),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(N),this._state="select",V==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},A.prototype.adjustVisual=function(){},A.prototype.manipulate=function(N){this.state==="creating"?this.resize(N):this.state==="move"?(this.x1=this.manipulationStartX1+N.x-this.manipulationStartX,this.y1=this.manipulationStartY1+N.y-this.manipulationStartY,this.x2=this.manipulationStartX2+N.x-this.manipulationStartX,this.y2=this.manipulationStartY2+N.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(N)},A.prototype.resize=function(N){switch(this.activeGrip){case this.grip1:this.x1=N.x,this.y1=N.y;break;case this.grip2:case void 0:this.x2=N.x,this.y2=N.y}this.adjustVisual(),this.adjustControlBox()},A.prototype.select=function(){ee.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},A.prototype.deselect=function(){ee.prototype.deselect.call(this),this.controlBox.style.display="none"},A.prototype.setupControlBox=function(){this.controlBox=ue.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},A.prototype.adjustControlBox=function(){this.positionGrips()},A.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},A.prototype.createGrip=function(){var N=new Pt;return N.visual.transform.baseVal.appendItem(ue.createTransform()),this.controlBox.appendChild(N.visual),N},A.prototype.positionGrips=function(){var N=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-N/2,this.y1-N/2),this.positionGrip(this.grip2.visual,this.x2-N/2,this.y2-N/2)},A.prototype.positionGrip=function(N,V,oe){var q=N.transform.baseVal.getItem(0);q.setTranslate(V,oe),N.transform.baseVal.replaceItem(q,0)},A.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},ee.prototype.getState.call(this))},A.prototype.restoreState=function(N){ee.prototype.restoreState.call(this,N);var V=N;this.x1=V.x1,this.y1=V.y1,this.x2=V.x2,this.y2=V.y2},A.prototype.scale=function(N,V){ee.prototype.scale.call(this,N,V),this.x1=this.x1*N,this.y1=this.y1*V,this.x2=this.x2*N,this.y2=this.y2*V,this.adjustVisual(),this.adjustControlBox()},A}(ke),Mt=function(ee){function A(N,V,oe){var q=ee.call(this,N,V,oe)||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=oe.defaultColor,q.strokeWidth=oe.defaultStrokeWidth,q.strokeDasharray=oe.defaultStrokeDasharray,q.strokePanel=new xe("Line color",oe.defaultColorSet,oe.defaultColor),q.strokePanel.onColorChanged=q.setStrokeColor,q.strokeWidthPanel=new jt("Line width",oe.defaultStrokeWidths,oe.defaultStrokeWidth),q.strokeWidthPanel.onWidthChanged=q.setStrokeWidth,q.strokeStylePanel=new pn("Line style",oe.defaultStrokeDasharrays,oe.defaultStrokeDasharray),q.strokeStylePanel.onStyleChanged=q.setStrokeDasharray,q}return Te(A,ee),A.prototype.ownsTarget=function(N){return!(!ee.prototype.ownsTarget.call(this,N)&&N!==this.visual&&N!==this.selectorLine&&N!==this.visibleLine)},A.prototype.createVisual=function(){this.visual=ue.createGroup(),this.selectorLine=ue.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ue.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)},A.prototype.pointerDown=function(N,V){ee.prototype.pointerDown.call(this,N,V),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},A.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()),ue.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ue.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ue.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},A.prototype.setStrokeColor=function(N){this.strokeColor=N,this.adjustVisual(),this.colorChanged(N)},A.prototype.setStrokeWidth=function(N){this.strokeWidth=N,this.adjustVisual()},A.prototype.setStrokeDasharray=function(N){this.strokeDasharray=N,this.adjustVisual(),this.stateChanged()},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var N=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},ee.prototype.getState.call(this));return N.typeName=A.typeName,N},A.prototype.restoreState=function(N){ee.prototype.restoreState.call(this,N);var V=N;this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.createVisual(),this.adjustVisual()},A.typeName="LineMarker",A.title="Line marker",A.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',A}(bt),ct=function(ee){function A(N,V,oe,q){var Je=ee.call(this,N,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 Je.fonts=[],Je.fontBoxes=[],Je.fonts=V,Je.currentFont=oe,Je.setCurrentFont=Je.setCurrentFont.bind(Je),Je}return Te(A,ee),A.prototype.getUi=function(){var N=this,V=document.createElement("div");return V.style.overflow="hidden",V.style.flexGrow="2",this.fonts.forEach(function(oe){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/N.fonts.length-5+"%",q.style.borderColor=oe===N.currentFont?N.uiStyleSettings.toolboxAccentColor:"transparent",q.addEventListener("click",function(){N.setCurrentFont(oe,q)}),V.appendChild(q);var Je=document.createElement("div");Je.style.display="flex",Je.style.minHeight="20px",Je.style.flexGrow="2",Je.style.fontFamily=oe,Je.style.overflow="hidden";var Kt=document.createElement("div");Kt.style.whiteSpace="nowrap",Kt.style.overflow="hidden",Kt.style.textOverflow="ellipsis",Kt.innerHTML="The quick brown fox jumps over the lazy dog",Je.appendChild(Kt),q.appendChild(Je),N.fontBoxes.push(q)}),V},A.prototype.setCurrentFont=function(N,V){var oe=this;this.currentFont=N,this.fontBoxes.forEach(function(q){q.style.borderColor=q===V?oe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},A}(me),wt=function(ee){function A(N,V,oe){var q=ee.call(this,N,V,oe)||this;return q.color="transparent",q.padding=5,q.DEFAULT_TEXT="your text here",q.text=q.DEFAULT_TEXT,q.isMoved=!1,q.color=oe.defaultColor,q.fontFamily=oe.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 xe("Color",oe.defaultColorSet,oe.defaultColor),q.colorPanel.onColorChanged=q.setColor,q.fontFamilyPanel=new ct("Font",oe.defaultFontFamilies,oe.defaultFontFamily),q.fontFamilyPanel.onFontChanged=q.setFont,q}return Te(A,ee),A.prototype.ownsTarget=function(N){if(ee.prototype.ownsTarget.call(this,N)||N===this.visual||N===this.textElement||N===this.bgRectangle)return!0;var V=!1;return this.textElement.childNodes.forEach(function(oe){oe===N&&(V=!0)}),V},A.prototype.createVisual=function(){this.visual=ue.createGroup(),this.bgRectangle=ue.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ue.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ue.createTransform()),this.textElement.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},A.prototype.pointerDown=function(N,V){ee.prototype.pointerDown.call(this,N,V),this.isMoved=!1,this.pointerDownPoint=N,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(N),this._state="creating")},A.prototype.renderText=function(){var N=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(V){N.textElement.appendChild(ue.createTSpan(V.trim()===""?" ":V.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},A.prototype.getTextScale=function(){var N=this.textElement.getBBox(),V=1;if(N.width>0&&N.height>0){var oe=(1*this.width-this.width*this.padding*2/100)/N.width,q=(1*this.height-this.height*this.padding*2/100)/N.height;V=Math.min(oe,q)}return V},A.prototype.getTextPosition=function(N){var V=this.textElement.getBBox(),oe=0,q=0;return V.width>0&&V.height>0&&(oe=(this.width-V.width*N)/2,q=this.height/2-V.height*N/2),{x:oe,y:q}},A.prototype.sizeText=function(){var N=this.textElement.getBBox(),V=this.getTextScale(),oe=this.getTextPosition(V);oe.y-=N.y*V,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+oe.x+"px, "+oe.y+"px) scale("+V+", "+V+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(oe.x,oe.y),this.textElement.transform.baseVal.getItem(1).setScale(V,V))},A.prototype.manipulate=function(N){ee.prototype.manipulate.call(this,N),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(N.x-this.pointerDownPoint.x)>5||Math.abs(N.y-this.pointerDownPoint.y)>5)},A.prototype.resize=function(N){ee.prototype.resize.call(this,N),this.isMoved=!0,this.setSize(),this.sizeText()},A.prototype.setSize=function(){ee.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},A.prototype.pointerUp=function(N){var V=this.state;V==="creating"&&(this._suppressMarkerCreateEvent=!0),ee.prototype.pointerUp.call(this,N),this.setSize(),(V==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},A.prototype.showTextEditor=function(){var N=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(V){V.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var V=Number.parseFloat(N.textEditor.style.fontSize);N.textEditor.clientWidth>=Number.parseInt(N.textEditor.style.maxWidth)&&V>.9;)V-=.1,N.textEditor.style.fontSize=Math.max(V,.9)+"em"}),this.textEditor.addEventListener("keyup",function(V){V.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(V){if(V.clipboardData){var oe=V.clipboardData.getData("text"),q=window.getSelection();if(!q.rangeCount)return!1;q.deleteFromDocument(),q.getRangeAt(0).insertNode(document.createTextNode(oe)),V.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){N.textEditDivClicked(N.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},A.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var N=this.getTextScale(),V=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),oe=this.textElement.getBBox(),q={x:oe.width*N,y:oe.height*N};V.x-=q.x/2,V.y-=q.y/2,this.textEditor.style.top=V.y+"px",this.textEditor.style.left=V.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-V.x+"px",this.textEditor.style.fontSize=Math.max(16*N,12)+"px",this.textElement.style.display="none"}},A.prototype.textEditDivClicked=function(N){this.text=N.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},A.prototype.select=function(){ee.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},A.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),ee.prototype.deselect.call(this)},A.prototype.dblClick=function(N,V){ee.prototype.dblClick.call(this,N,V),this.showTextEditor()},A.prototype.setColor=function(N){this.textElement&&ue.setAttributes(this.textElement,[["fill",N]]),this.color=N,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(N)},A.prototype.setFont=function(N){this.textElement&&ue.setAttributes(this.textElement,[["font-family",N]]),this.fontFamily=N,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},A.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},A.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var N=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},ee.prototype.getState.call(this));return N.typeName=A.typeName,N},A.prototype.restoreState=function(N){var V=N;this.color=V.color,this.fontFamily=V.fontFamily,this.padding=V.padding,this.text=V.text,this.createVisual(),ee.prototype.restoreState.call(this,N),this.setSize()},A.prototype.scale=function(N,V){ee.prototype.scale.call(this,N,V),this.setSize(),this.sizeText(),this.positionTextEditor()},A.typeName="TextMarker",A.title="Text marker",A.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>',A}(Bt),Ve=function(ee){function A(N,V,oe){var q=ee.call(this,N,V,oe)||this;return q.color="transparent",q.lineWidth=3,q.drawing=!1,q.pixelRatio=1,q.color=oe.defaultColor,q.lineWidth=oe.defaultStrokeWidth,q.pixelRatio=oe.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 xe("Color",oe.defaultColorSet,oe.defaultColor),q.colorPanel.onColorChanged=q.setColor,q.lineWidthPanel=new jt("Line width",oe.defaultStrokeWidths,oe.defaultStrokeWidth),q.lineWidthPanel.onWidthChanged=q.setLineWidth,q}return Te(A,ee),A.prototype.ownsTarget=function(N){return!(!ee.prototype.ownsTarget.call(this,N)&&N!==this.visual&&N!==this.drawingImage)},A.prototype.createVisual=function(){this.visual=ue.createGroup(),this.drawingImage=ue.createImage(),this.visual.appendChild(this.drawingImage);var N=ue.createTransform();this.visual.transform.baseVal.appendItem(N),this.addMarkerVisualToContainer(this.visual)},A.prototype.pointerDown=function(N,V){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(N.x,N.y),this.drawing=!0):ee.prototype.pointerDown.call(this,N,V)},A.prototype.manipulate=function(N){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(N.x,N.y),this.canvasContext.stroke()):ee.prototype.manipulate.call(this,N)},A.prototype.resize=function(N){ee.prototype.resize.call(this,N),ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},A.prototype.pointerUp=function(N){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):ee.prototype.pointerUp.call(this,N)},A.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)},A.prototype.select=function(){this.state==="creating"&&this.finishCreation(),ee.prototype.select.call(this)},A.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),ee.prototype.deselect.call(this)},A.prototype.finishCreation=function(){for(var N=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),V=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],oe=V[0],q=V[1],Je=V[2],Kt=V[3],gn=!1,Bn=0;Bn<this.canvasElement.height;Bn++)for(var en=0;en<this.canvasElement.width;en++)N.data[Bn*this.canvasElement.width*4+4*en+3]>0&&(gn=!0,Bn<q&&(q=Bn),en<oe&&(oe=en),Bn>Kt&&(Kt=Bn),en>Je&&(Je=en));if(gn){this.left=oe/this.pixelRatio,this.top=q/this.pixelRatio,this.width=(Je-oe)/this.pixelRatio,this.height=(Kt-q)/this.pixelRatio;var Gn=document.createElement("canvas");Gn.width=Je-oe,Gn.height=Kt-q,Gn.getContext("2d").putImageData(this.canvasContext.getImageData(oe,q,Je-oe,Kt-q),0,0),this.drawingImgUrl=Gn.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},A.prototype.setDrawingImage=function(){ue.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},A.prototype.setColor=function(N){this.color=N,this.colorChanged(N)},A.prototype.setLineWidth=function(N){this.lineWidth=N},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var N=Object.assign({drawingImgUrl:this.drawingImgUrl},ee.prototype.getState.call(this));return N.typeName=A.typeName,N},A.prototype.restoreState=function(N){this.createVisual(),ee.prototype.restoreState.call(this,N),this.drawingImgUrl=N.drawingImgUrl,this.setDrawingImage()},A.prototype.scale=function(N,V){ee.prototype.scale.call(this,N,V),this.setDrawingImage()},A.typeName="FreehandMarker",A.title="Freehand marker",A.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>',A}(Bt),Se=function(ee){function A(N,V,oe){var q=ee.call(this,N,oe||'<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=V,q.setCurrentType=q.setCurrentType.bind(q),q}return Te(A,ee),A.prototype.getUi=function(){var N=this,V=document.createElement("div");V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2";for(var oe=function(Kt){var gn="both";switch(Kt){case 0:gn="both";break;case 1:gn="start";break;case 2:gn="end";break;case 3:gn="none"}var Bn=document.createElement("div");if(Bn.style.display="flex",Bn.style.flexGrow="2",Bn.style.alignItems="center",Bn.style.justifyContent="space-between",Bn.style.padding="5px",Bn.style.borderWidth="2px",Bn.style.borderStyle="solid",Bn.style.borderColor=gn===q.currentType?q.uiStyleSettings.toolboxAccentColor:"transparent",Bn.addEventListener("click",function(){N.setCurrentType(gn,Bn)}),V.appendChild(Bn),gn==="both"||gn==="start"){var en=document.createElement("div");en.style.display="flex",en.style.alignItems="center",en.style.minHeight="20px",en.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>`,en.style.marginLeft="5px",Bn.appendChild(en)}var Gn=document.createElement("div");Gn.style.display="flex",Gn.style.alignItems="center",Gn.style.minHeight="20px",Gn.style.flexGrow="2";var ar=document.createElement("hr");if(ar.style.minWidth="20px",ar.style.border="0px",ar.style.borderTop="3px solid "+(q.uiStyleSettings!==void 0?q.uiStyleSettings.toolboxColor:"#eeeeee"),ar.style.flexGrow="2",Gn.appendChild(ar),Bn.appendChild(Gn),gn==="both"||gn==="end"){var Ur=document.createElement("div");Ur.style.display="flex",Ur.style.alignItems="center",Ur.style.minHeight="20px",Ur.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>`,Ur.style.marginRight="5px",Bn.appendChild(Ur)}q.typeBoxes.push(Bn)},q=this,Je=0;Je<4;Je++)oe(Je);return V},A.prototype.setCurrentType=function(N,V){var oe=this;this.currentType=N,this.typeBoxes.forEach(function(q){q.style.borderColor=q===V?oe.uiStyleSettings!==void 0?oe.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},A}(me),Pe=function(ee){function A(N,V,oe){var q=ee.call(this,N,V,oe)||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 Se("Arrow type","end"),q.arrowTypePanel.onArrowTypeChanged=q.setArrowType,q}return Te(A,ee),A.prototype.ownsTarget=function(N){return!(!ee.prototype.ownsTarget.call(this,N)&&N!==this.arrow1&&N!==this.arrow2)},A.prototype.getArrowPoints=function(N,V){var oe=this.arrowBaseWidth+2*this.strokeWidth,q=this.arrowBaseHeight+2*this.strokeWidth;return N-oe/2+","+(V+q/2)+" "+N+","+(V-q/2)+" "+(N+oe/2)+","+(V+q/2)},A.prototype.createTips=function(){this.arrow1=ue.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ue.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.arrow2)},A.prototype.pointerDown=function(N,V){ee.prototype.pointerDown.call(this,N,V),this.state==="creating"&&this.createTips()},A.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",ue.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ue.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var N=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),V=this.arrow1.transform.baseVal.getItem(0);V.setRotate(N,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(V,0);var oe=this.arrow2.transform.baseVal.getItem(0);oe.setRotate(N+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(oe,0)}},A.prototype.setArrowType=function(N){this.arrowType=N,this.adjustVisual(),this.stateChanged()},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var N=Object.assign({arrowType:this.arrowType},ee.prototype.getState.call(this));return N.typeName=A.typeName,N},A.prototype.restoreState=function(N){ee.prototype.restoreState.call(this,N);var V=N;this.arrowType=V.arrowType,this.createTips(),this.adjustVisual()},A.typeName="ArrowMarker",A.title="Arrow marker",A.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',A}(Mt),ce=function(ee){function A(N,V,oe){var q=ee.call(this,N,V,oe)||this;return q.fillColor=oe.defaultFillColor,q.strokeWidth=0,q.fillPanel=new xe("Color",oe.defaultColorSet,oe.defaultFillColor),q.fillPanel.onColorChanged=q.setFillColor,q}return Te(A,ee),Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var N=ee.prototype.getState.call(this);return N.typeName=A.typeName,N},A.typeName="CoverMarker",A.title="Cover marker",A.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',A}(lt),de=function(ee){function A(N,V,oe,q){var Je=ee.call(this,N,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 Je.opacities=[],Je.opacityBoxes=[],Je.opacities=V,Je.currentOpacity=oe,Je.setCurrentOpacity=Je.setCurrentOpacity.bind(Je),Je}return Te(A,ee),A.prototype.getUi=function(){var N=this,V=document.createElement("div");return V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2",V.style.justifyContent="space-between",this.opacities.forEach(function(oe){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=oe===N.currentOpacity?N.uiStyleSettings.toolboxAccentColor:"transparent",q.addEventListener("click",function(){N.setCurrentOpacity(oe,q)}),V.appendChild(q);var Je=document.createElement("div");Je.innerText=100*oe+"%",q.appendChild(Je),N.opacityBoxes.push(q)}),V},A.prototype.setCurrentOpacity=function(N,V){var oe=this;this.currentOpacity=N,this.opacityBoxes.forEach(function(q){q.style.borderColor=q===V?oe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},A}(me),be=function(ee){function A(N,V,oe){var q=ee.call(this,N,V,oe)||this;return q.setOpacity=q.setOpacity.bind(q),q.fillColor=oe.defaultHighlightColor,q.strokeWidth=0,q.opacity=oe.defaultHighlightOpacity,q.fillPanel=new xe("Color",oe.defaultColorSet,q.fillColor),q.fillPanel.onColorChanged=q.setFillColor,q.opacityPanel=new de("Opacity",oe.defaultOpacitySteps,q.opacity),q.opacityPanel.onOpacityChanged=q.setOpacity,q}return Te(A,ee),A.prototype.setOpacity=function(N){this.opacity=N,this.visual&&ue.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var N=ee.prototype.getState.call(this);return N.typeName=A.typeName,N},A.typeName="HighlightMarker",A.title="Highlight marker",A.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>',A}(ce),je='<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>',ze=function(ee){function A(N,V,oe){var q=ee.call(this,N,V,oe)||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=oe.defaultStrokeColor,q.bgColor=oe.defaultFillColor,q.fontFamily=oe.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 xe("Text color",oe.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 xe("Fill color",oe.defaultColorSet,q.bgColor,je),q.bgColorPanel.onColorChanged=q.setBgColor,q.fontFamilyPanel=new ct("Font",oe.defaultFontFamilies,oe.defaultFontFamily),q.fontFamilyPanel.onFontChanged=q.setFont,q.tipGrip=new Pt,q.tipGrip.visual.transform.baseVal.appendItem(ue.createTransform()),q.controlBox.appendChild(q.tipGrip.visual),q}return Te(A,ee),A.prototype.ownsTarget=function(N){return ee.prototype.ownsTarget.call(this,N)||this.tipGrip.ownsTarget(N)||this.tip===N},A.prototype.createTip=function(){ue.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ue.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},A.prototype.pointerDown=function(N,V){this.state==="new"&&ee.prototype.pointerDown.call(this,N,V),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(V)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):ee.prototype.pointerDown.call(this,N,V)},A.prototype.pointerUp=function(N){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,ee.prototype.pointerUp.call(this,N);else{var V=this.state==="creating";ee.prototype.pointerUp.call(this,N),this.setTipPoints(V),this.positionTip()}},A.prototype.manipulate=function(N){if(this.tipMoving){var V=this.unrotatePoint(N);this.tipPosition={x:V.x-this.manipulationStartLeft,y:V.y-this.manipulationStartTop},this.positionTip()}else ee.prototype.manipulate.call(this,N)},A.prototype.setBgColor=function(N){this.bgRectangle&&this.tip&&(ue.setAttributes(this.bgRectangle,[["fill",N]]),ue.setAttributes(this.tip,[["fill",N]])),this.bgColor=N,this.fillColorChanged(N)},A.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},A.prototype.setTipPoints=function(N){N===void 0&&(N=!1);var V=Math.min(this.height/2,15),oe=this.height/5;N&&(this.tipPosition={x:V+oe/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))?(oe=this.width/5,V=Math.min(this.width/2,15),this.tipBase1Position={x:V,y:0},this.tipBase2Position={x:V+oe,y:0}):(this.tipBase1Position={x:0,y:V},this.tipBase2Position={x:0,y:V+oe}):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))?(oe=this.width/5,V=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-V-oe,y:0},this.tipBase2Position={x:this.width-V,y:0}):(this.tipBase1Position={x:this.width,y:V},this.tipBase2Position={x:this.width,y:V+oe}):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))?(oe=this.width/5,V=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-V-oe,y:this.height},this.tipBase2Position={x:this.width-V,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-V-oe},this.tipBase2Position={x:this.width,y:this.height-V}):q<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(oe=this.width/5,V=Math.min(this.width/2,15),this.tipBase1Position={x:V,y:this.height},this.tipBase2Position={x:V+oe,y:this.height}):(this.tipBase1Position={x:0,y:this.height-V},this.tipBase2Position={x:0,y:this.height-V-oe})},A.prototype.resize=function(N){ee.prototype.resize.call(this,N),this.positionTip()},A.prototype.positionTip=function(){ue.setAttributes(this.tip,[["points",this.getTipPoints()]]);var N=this.tipGrip.visual.transform.baseVal.getItem(0);N.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(N,0)},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),A.prototype.select=function(){this.positionTip(),ee.prototype.select.call(this)},A.prototype.getState=function(){var N=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},ee.prototype.getState.call(this));return N.typeName=A.typeName,N},A.prototype.restoreState=function(N){var V=N;this.bgColor=V.bgColor,this.tipPosition=V.tipPosition,ee.prototype.restoreState.call(this,N),this.createTip(),this.setTipPoints()},A.prototype.scale=function(N,V){ee.prototype.scale.call(this,N,V),this.tipPosition={x:this.tipPosition.x*N,y:this.tipPosition.y*V},this.positionTip()},A.typeName="CalloutMarker",A.title="Callout marker",A.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>',A}(wt),ut=function(ee){function A(N,V,oe){var q=ee.call(this,N,V,oe)||this;return q.fillColor="transparent",q.strokeColor="transparent",q.strokeWidth=0,q.strokeDasharray="",q.opacity=1,q.strokeColor=oe.defaultColor,q.strokeWidth=oe.defaultStrokeWidth,q.strokeDasharray=oe.defaultStrokeDasharray,q.fillColor=oe.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 xe("Line color",Ce(oe.defaultColorSet,["transparent"]),oe.defaultColor),q.strokePanel.onColorChanged=q.setStrokeColor,q.fillPanel=new xe("Fill color",Ce(oe.defaultColorSet,["transparent"]),q.fillColor,je),q.fillPanel.onColorChanged=q.setFillColor,q.strokeWidthPanel=new jt("Line width",oe.defaultStrokeWidths,oe.defaultStrokeWidth),q.strokeWidthPanel.onWidthChanged=q.setStrokeWidth,q.strokeStylePanel=new pn("Line style",oe.defaultStrokeDasharrays,oe.defaultStrokeDasharray),q.strokeStylePanel.onStyleChanged=q.setStrokeDasharray,q.opacityPanel=new de("Opacity",oe.defaultOpacitySteps,q.opacity),q.opacityPanel.onOpacityChanged=q.setOpacity,q}return Te(A,ee),A.prototype.ownsTarget=function(N){return!(!ee.prototype.ownsTarget.call(this,N)&&N!==this.visual)},A.prototype.createVisual=function(){this.visual=ue.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)},A.prototype.pointerDown=function(N,V){ee.prototype.pointerDown.call(this,N,V),this.state==="new"&&(this.createVisual(),this.moveVisual(N),this._state="creating")},A.prototype.manipulate=function(N){ee.prototype.manipulate.call(this,N)},A.prototype.resize=function(N){ee.prototype.resize.call(this,N),this.setSize()},A.prototype.setSize=function(){ee.prototype.setSize.call(this),ue.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},A.prototype.pointerUp=function(N){ee.prototype.pointerUp.call(this,N),this.setSize()},A.prototype.setStrokeColor=function(N){this.strokeColor=N,this.visual&&ue.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(N),this.stateChanged()},A.prototype.setFillColor=function(N){this.fillColor=N,this.visual&&ue.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(N),this.stateChanged()},A.prototype.setStrokeWidth=function(N){this.strokeWidth=N,this.visual&&ue.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},A.prototype.setStrokeDasharray=function(N){this.strokeDasharray=N,this.visual&&ue.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},A.prototype.setOpacity=function(N){this.opacity=N,this.visual&&ue.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var N=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ee.prototype.getState.call(this));return N.typeName=A.typeName,N},A.prototype.restoreState=function(N){var V=N;this.fillColor=V.fillColor,this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.opacity=V.opacity,this.createVisual(),ee.prototype.restoreState.call(this,N),this.setSize()},A.prototype.scale=function(N,V){ee.prototype.scale.call(this,N,V),this.setSize()},A.typeName="EllipseMarker",A.title="Ellipse marker",A.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>',A}(Bt),Dt=function(ee){function A(N,V,oe){return ee.call(this,N,V,oe)||this}return Te(A,ee),Object.defineProperty(A.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),A.prototype.ownsTarget=function(N){return!(!ee.prototype.ownsTarget.call(this,N)&&N!==this.tip1&&N!==this.tip2)},A.prototype.createTips=function(){this.tip1=ue.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(ue.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ue.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(ue.createTransform()),this.visual.appendChild(this.tip2)},A.prototype.pointerDown=function(N,V){ee.prototype.pointerDown.call(this,N,V),this.state==="creating"&&this.createTips()},A.prototype.adjustVisual=function(){if(ee.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ue.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()]]),ue.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 N=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),V=this.tip1.transform.baseVal.getItem(0);V.setRotate(N,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(V,0);var oe=this.tip2.transform.baseVal.getItem(0);oe.setRotate(N+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(oe,0)}},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var N=ee.prototype.getState.call(this);return N.typeName=A.typeName,N},A.prototype.restoreState=function(N){ee.prototype.restoreState.call(this,N),this.createTips(),this.adjustVisual()},A.typeName="MeasurementMarker",A.title="Measurement marker",A.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>',A}(Mt),rn=function(ee){function A(N,V,oe){var q=ee.call(this,N,V,oe)||this;return q.strokePanel.colors=oe.defaultColorSet,q.fillColor="transparent",q}return Te(A,ee),Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var N=ee.prototype.getState.call(this);return N.typeName=A.typeName,N},A.typeName="EllipseFrameMarker",A.title="Ellipse frame marker",A.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>',A}(ut),mn=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(A){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(A)||(this.undoStack.push(A),JSON.stringify(this.lastRedoStep)!==JSON.stringify(A)&&this.redoStack.splice(0,this.redoStack.length))},ee.prototype.replaceLastUndoStep=function(A){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=A)},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 A=this.undoStack.pop();return A!==void 0&&this.redoStack.push(A),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}(),gt=function(ee){function A(N,V,oe){var q=ee.call(this,N,V,oe)||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=oe.defaultColor,q.strokeWidth=oe.defaultStrokeWidth,q.strokeDasharray=oe.defaultStrokeDasharray,q.strokePanel=new xe("Line color",oe.defaultColorSet,oe.defaultColor),q.strokePanel.onColorChanged=q.setStrokeColor,q.strokeWidthPanel=new jt("Line width",oe.defaultStrokeWidths,oe.defaultStrokeWidth),q.strokeWidthPanel.onWidthChanged=q.setStrokeWidth,q.strokeStylePanel=new pn("Line style",oe.defaultStrokeDasharrays,oe.defaultStrokeDasharray),q.strokeStylePanel.onStyleChanged=q.setStrokeDasharray,q}return Te(A,ee),A.prototype.ownsTarget=function(N){return!(!ee.prototype.ownsTarget.call(this,N)&&N!==this.visual&&N!==this.selectorCurve&&N!==this.visibleCurve&&!this.curveGrip.ownsTarget(N))},A.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},A.prototype.createVisual=function(){this.visual=ue.createGroup(),this.selectorCurve=ue.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ue.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)},A.prototype.pointerDown=function(N,V){ee.prototype.pointerDown.call(this,N,V),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=N.x,this.curveY=N.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(V)&&(this.activeGrip=this.curveGrip,this._state="resize")},A.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ue.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ue.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ue.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},A.prototype.setupControlBox=function(){ee.prototype.setupControlBox.call(this),this.curveControlLine1=ue.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ue.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)},A.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,ee.prototype.addControlGrips.call(this)},A.prototype.positionGrips=function(){ee.prototype.positionGrips.call(this);var N=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-N/2,this.curveY-N/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()))},A.prototype.manipulate=function(N){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+N.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+N.y-this.manipulationStartY),ee.prototype.manipulate.call(this,N)},A.prototype.resize=function(N){this.activeGrip===this.curveGrip&&(this.curveX=N.x,this.curveY=N.y),ee.prototype.resize.call(this,N),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},A.prototype.setStrokeColor=function(N){this.strokeColor=N,this.adjustVisual(),this.colorChanged(N)},A.prototype.setStrokeWidth=function(N){this.strokeWidth=N,this.adjustVisual()},A.prototype.setStrokeDasharray=function(N){this.strokeDasharray=N,this.adjustVisual()},A.prototype.scale=function(N,V){this.curveX=this.curveX*N,this.curveY=this.curveY*V,ee.prototype.scale.call(this,N,V)},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var N=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},ee.prototype.getState.call(this));return N.typeName=A.typeName,N},A.prototype.restoreState=function(N){ee.prototype.restoreState.call(this,N);var V=N;this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.curveX=V.curveX,this.curveY=V.curveY,this.createVisual(),this.adjustVisual()},A.typeName="CurveMarker",A.title="Curve marker",A.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>',A}(bt),Vt=function(){function ee(A,N){N===void 0&&(N=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=A,this.cancelable=N}return Object.defineProperty(ee.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),ee.prototype.preventDefault=function(){this._defaultPrevented=!0},ee}(),Tt=function(ee){function A(N,V,oe){var q=ee.call(this,N,!1)||this;return q.dataUrl=V,q.state=oe,q}return Te(A,ee),A}(Vt),Rt=function(ee){function A(N,V,oe){oe===void 0&&(oe=!1);var q=ee.call(this,N,oe)||this;return q.marker=V,q}return Te(A,ee),A}(Vt),mt=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(A,N){this[A].push(N)},ee.prototype.removeEventListener=function(A,N){var V=this[A].indexOf(N);V>-1&&this[A].splice(V,1)},ee}(),_e=function(){function ee(A){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ze,this._isOpen=!1,this.undoRedoManager=new mn,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 mt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=ee.instanceCounter++,this.styles=new Ke(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=A,this.targetRoot=document.body,this.width=A.clientWidth,this.height=A.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[it,Ve,Pe,wt,rn,ut,be,ze,Dt,ce,Mt,gt]},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[it,Ve,Pe,wt,ut,be,ze]},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"BASIC_MARKER_TYPES",{get:function(){return[it,Ve,Pe,wt,be]},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(A){var N=this;this._availableMarkerTypes.splice(0),A.forEach(function(V){if(typeof V=="string"){var oe=N.ALL_MARKER_TYPES.find(function(q){return q.typeName===V});oe!==void 0&&N._availableMarkerTypes.push(oe)}else N._availableMarkerTypes.push(V)})},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(A){this._zoomLevel=A,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(),se.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},ee.prototype.show=function(){var A=this;this.styles.styleSheetRoot===void 0&&ge.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ge.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(N){return N(new Vt(A))})},ee.prototype.render=function(){return We(this,void 0,void 0,function(){var A;return He(this,function(N){switch(N.label){case 0:return this.setCurrentMarker(),(A=new we).naturalSize=this.renderAtNaturalSize,A.imageType=this.renderImageType,A.imageQuality=this.renderImageQuality,A.markersOnly=this.renderMarkersOnly,A.width=this.renderWidth,A.height=this.renderHeight,[4,A.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return N.sent(),[4,A.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,N.sent()]}})})},ee.prototype.close=function(A){var N=this;if(A===void 0&&(A=!1),this.isOpen){var V=!1;A||this.eventListeners.beforeclose.forEach(function(oe){var q=new Vt(N,!0);oe(q),q.defaultPrevented&&(V=!0)}),V||(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(oe){return oe(new Vt(N))}),this.detachEvents(),this._isOpen=!1)}},ee.prototype.addMarkersToToolbar=function(){for(var A,N=[],V=0;V<arguments.length;V++)N[V]=arguments[V];(A=this._availableMarkerTypes).push.apply(A,N)},ee.prototype.addRenderEventListener=function(A){this.addEventListener("render",function(N){A(N.dataUrl,N.state)})},ee.prototype.removeRenderEventListener=function(A){},ee.prototype.addCloseEventListener=function(A){this.addEventListener("close",function(){A()})},ee.prototype.removeCloseEventListener=function(A){},ee.prototype.setupResizeObserver=function(){var A=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){A.resize(A.target.clientWidth,A.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return A.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},ee.prototype.onPopupTargetResize=function(){var A=1*this.target.clientWidth/this.target.clientHeight,N=this.editorCanvas.clientWidth/A>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*A:this.editorCanvas.clientWidth,V=N<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/A;this.resize(N,V)},ee.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ee.prototype.resize=function(A,N){this._isResizing=!0;var V=A/this.imageWidth,oe=N/this.imageHeight;this.imageWidth=Math.round(A),this.imageHeight=Math.round(N),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(V,oe),this._isResizing=!1},ee.prototype.scaleMarkers=function(A,N){var V,oe=this;this._currentMarker&&this._currentMarker instanceof wt?this._currentMarker.scale(A,N):(V=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(q){q!==oe._currentMarker&&q.scale(A,N)}),V!==void 0&&this.setCurrentMarker(V)},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 A=this.editingTarget.getBoundingClientRect(),N=this.editorCanvas.getBoundingClientRect();this.left=A.left-N.left,this.top=A.top-N.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 A,N=[],V=0;V<arguments.length;V++)N[V]=arguments[V];this.defs=ue.createDefs(),this.addDefsToImage(),(A=this.defs).append.apply(A,N)},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 A=document.createElement("a");A.href="https://markerjs.com/",A.target="_blank",A.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>',A.title="Powered by marker.js",A.style.display="grid",A.style.alignItems="center",A.style.justifyItems="center",A.style.padding="3px",A.style.width="20px",A.style.height="20px",this.logoUI.appendChild(A),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 A=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=A+"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 J(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(A){this.markerImage.removeChild(A.container),this.markers.indexOf(A)>-1&&this.markers.splice(this.markers.indexOf(A),1),A.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(A,N){if(A==="marker"&&N!==void 0)this.createNewMarker(N);else if(A==="action")switch(N){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 A=this;if(this._currentMarker!==void 0){var N=!1;if(this.eventListeners.markerbeforedelete.forEach(function(oe){var q=new Rt(A,A._currentMarker,!0);oe(q),q.defaultPrevented&&(N=!0)}),!N){var V=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(oe){return oe(new Rt(A,V))})}}},ee.prototype.clear=function(){var A=this,N=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Je){var Kt=new Rt(A,void 0,!0);Je(Kt),Kt.defaultPrevented&&(N=!0)}),!N)){this.setCurrentMarker();for(var V=function(Je){var Kt=oe.markers[Je];oe.setCurrentMarker(oe.markers[Je]),oe._currentMarker.dispose(),oe.markerImage.removeChild(oe._currentMarker.container),oe.markers.splice(oe.markers.indexOf(oe._currentMarker),1),oe.eventListeners.markerdelete.forEach(function(gn){return gn(new Rt(A,Kt))})},oe=this,q=this.markers.length-1;q>=0;q--)V(q);this.addUndoStep()}},Object.defineProperty(ee.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),ee.prototype.showNotesEditor=function(){var A;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=(A=this._currentMarker.notes)!==null&&A!==void 0?A:"",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 A=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var N=this.getState(),V=this.undoRedoManager.getLastUndoStep();if(!V||V.width===N.width&&V.height===N.height){var oe=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(N),oe<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(q){return q(new Vt(A))})}else this.undoRedoManager.replaceLastUndoStep(N),this.eventListeners.statechange.forEach(function(q){return q(new Vt(A))})}},ee.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},ee.prototype.undoStep=function(){var A=this,N=this.undoRedoManager.undo();N!==void 0&&(this.restoreState(N),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(V){return V(new Vt(A))}))},ee.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},ee.prototype.redoStep=function(){var A=this,N=this.undoRedoManager.redo();N!==void 0&&(this.restoreState(N),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(V){return V(new Vt(A))}))},ee.prototype.stepZoom=function(){var A=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=A<this.zoomSteps.length-1?this.zoomSteps[A+1]:this.zoomSteps[0]},ee.prototype.panTo=function(A){this.contentDiv.scrollBy({left:this.prevPanPoint.x-A.x,top:this.prevPanPoint.y-A.y}),this.prevPanPoint=A},ee.prototype.startRenderAndClose=function(){return We(this,void 0,void 0,function(){var A,N,V=this;return He(this,function(oe){switch(oe.label){case 0:return[4,this.render()];case 1:return A=oe.sent(),N=this.getState(),this.eventListeners.render.forEach(function(q){return q(new Tt(V,A,N))}),this.close(!0),[2]}})})},ee.prototype.getState=function(A){A===!0&&this.setCurrentMarker();var N={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(V){return N.markers.push(V.getState())}),N},ee.prototype.restoreState=function(A){var N=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);A.markers.forEach(function(V){var oe=N._availableMarkerTypes.find(function(Je){return Je.typeName===V.typeName});if(oe!==void 0){var q=N.addNewMarker(oe);q.restoreState(V),N.markers.push(q)}}),A.width&&A.height&&(A.width!==this.imageWidth||A.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/A.width,this.imageHeight/A.height),this.eventListeners.restorestate.forEach(function(V){return V(new Vt(N))})},ee.prototype.addNewMarker=function(A){var N=ue.createGroup();return this.markerImage.appendChild(N),new A(N,this.overlayContainer,this.settings)},ee.prototype.createNewMarker=function(A){var N,V=this;(N=typeof A=="string"?this._availableMarkerTypes.find(function(oe){return oe.typeName===A}):A)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(N),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(N.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(oe){return oe(new Rt(V,V._currentMarker))}))},ee.prototype.markerCreated=function(A){var N=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(A),this.setCurrentMarker(A),A instanceof Ve&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Ve):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(V){return V(new Rt(N,N._currentMarker))})},ee.prototype.colorChanged=function(A){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=A,this.settings.defaultStrokeColor=A)},ee.prototype.fillColorChanged=function(A){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=A)},ee.prototype.markerStateChanged=function(A){var N=this;this.eventListeners.markerchange.forEach(function(V){return V(new Rt(N,A))})},ee.prototype.setCurrentMarker=function(A){var N=this;this._currentMarker!==A&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(V){return V(new Rt(N,N._currentMarker))})),this._currentMarker=A,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(V){return V(new Rt(N,N._currentMarker))}))},ee.prototype.onPointerDown=function(A){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||A.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var N=this.markers.find(function(V){return V.ownsTarget(A.target)});N!==void 0?(this.setCurrentMarker(N),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(A.clientX,A.clientY),A.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:A.clientX,y:A.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(A.clientX,A.clientY))},ee.prototype.onDblClick=function(A){if(this._isFocused||this.focus(),this.mode==="select"){var N=this.markers.find(function(V){return V.ownsTarget(A.target)});N!==void 0&&N!==this._currentMarker&&this.setCurrentMarker(N),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(A.clientX,A.clientY),A.target):this.setCurrentMarker()}},ee.prototype.onPointerMove=function(A){this.touchPoints!==1&&A.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||A.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(A.clientX,A.clientY)):this.zoomLevel>1&&this.panTo({x:A.clientX,y:A.clientY}))},ee.prototype.onPointerUp=function(A){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(A.clientX,A.clientY)),this.isDragging=!1,this.addUndoStep()},ee.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},ee.prototype.onKeyUp=function(A){this._currentMarker===void 0||this.notesArea!==void 0||A.key!=="Delete"&&A.key!=="Backspace"||this.deleteSelectedMarker()},ee.prototype.clientToLocalCoordinates=function(A,N){var V=this.markerImage.getBoundingClientRect();return{x:(A-V.left)/this.zoomLevel,y:(N-V.top)/this.zoomLevel}},ee.prototype.onWindowResize=function(){this.positionUI()},ee.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var A=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=A+"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(A){se.addKey(A)},ee.prototype.addEventListener=function(A,N){this.eventListeners.addEventListener(A,N)},ee.prototype.removeEventListener=function(A,N){this.eventListeners.removeEventListener(A,N)},ee.prototype.renderState=function(A){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(A),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(ee.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),ee.prototype.focus=function(){var A=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(N){return N(new Vt(A))}))},ee.prototype.blur=function(){var A=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(N){return N(new Vt(A))}))},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 Ge=function(ee,A){return(Ge=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(N,V){N.__proto__=V}||function(N,V){for(var oe in V)Object.prototype.hasOwnProperty.call(V,oe)&&(N[oe]=V[oe])})(ee,A)};function kt(ee,A){if(typeof A!="function"&&A!==null)throw new TypeError("Class extends value "+String(A)+" is not a constructor or null");function N(){this.constructor=ee}Ge(ee,A),ee.prototype=A===null?Object.create(A):(N.prototype=A.prototype,new N)}function vt(ee,A,N,V){return new(N||(N=Promise))(function(oe,q){function Je(Bn){try{gn(V.next(Bn))}catch(en){q(en)}}function Kt(Bn){try{gn(V.throw(Bn))}catch(en){q(en)}}function gn(Bn){var en;Bn.done?oe(Bn.value):(en=Bn.value,en instanceof N?en:new N(function(Gn){Gn(en)})).then(Je,Kt)}gn((V=V.apply(ee,A||[])).next())})}function Qt(ee,A){var N,V,oe,q,Je={label:0,sent:function(){if(1&oe[0])throw oe[1];return oe[1]},trys:[],ops:[]};return q={next:Kt(0),throw:Kt(1),return:Kt(2)},typeof Symbol=="function"&&(q[Symbol.iterator]=function(){return this}),q;function Kt(gn){return function(Bn){return function(en){if(N)throw new TypeError("Generator is already executing.");for(;Je;)try{if(N=1,V&&(oe=2&en[0]?V.return:en[0]?V.throw||((oe=V.return)&&oe.call(V),0):V.next)&&!(oe=oe.call(V,en[1])).done)return oe;switch(V=0,oe&&(en=[2&en[0],oe.value]),en[0]){case 0:case 1:oe=en;break;case 4:return Je.label++,{value:en[1],done:!1};case 5:Je.label++,V=en[1],en=[0];continue;case 7:en=Je.ops.pop(),Je.trys.pop();continue;default:if(!(oe=Je.trys,(oe=oe.length>0&&oe[oe.length-1])||en[0]!==6&&en[0]!==2)){Je=0;continue}if(en[0]===3&&(!oe||en[1]>oe[0]&&en[1]<oe[3])){Je.label=en[1];break}if(en[0]===6&&Je.label<oe[1]){Je.label=oe[1],oe=en;break}if(oe&&Je.label<oe[2]){Je.label=oe[2],Je.ops.push(en);break}oe[2]&&Je.ops.pop(),Je.trys.pop();continue}en=A.call(ee,Je)}catch(Gn){en=[6,Gn],V=0}finally{N=oe=0}if(5&en[0])throw en[1];return{value:en[0]?en[1]:void 0,done:!0}}([gn,Bn])}}}var Jt=function(){function ee(){}return ee.addKey=function(A){ee.key=A},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}(),Le=function(){function ee(){}return ee.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ee.setAttributes=function(A,N){for(var V=0,oe=N;V<oe.length;V++){var q=oe[V],Je=q[0],Kt=q[1];A.setAttribute(Je,Kt)}},ee.createRect=function(A,N,V){var oe=document.createElementNS("http://www.w3.org/2000/svg","rect");return oe.setAttribute("width",A.toString()),oe.setAttribute("height",N.toString()),V&&ee.setAttributes(oe,V),oe},ee.createLine=function(A,N,V,oe,q){var Je=document.createElementNS("http://www.w3.org/2000/svg","line");return Je.setAttribute("x1",A.toString()),Je.setAttribute("y1",N.toString()),Je.setAttribute("x2",V.toString()),Je.setAttribute("y2",oe.toString()),q&&ee.setAttributes(Je,q),Je},ee.createPolygon=function(A,N){var V=document.createElementNS("http://www.w3.org/2000/svg","polygon");return V.setAttribute("points",A),N&&ee.setAttributes(V,N),V},ee.createCircle=function(A,N){var V=document.createElementNS("http://www.w3.org/2000/svg","circle");return V.setAttribute("cx",(A/2).toString()),V.setAttribute("cy",(A/2).toString()),V.setAttribute("r",A.toString()),N&&ee.setAttributes(V,N),V},ee.createEllipse=function(A,N,V){var oe=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return oe.setAttribute("cx",(A/2).toString()),oe.setAttribute("cy",(N/2).toString()),oe.setAttribute("rx",(A/2).toString()),oe.setAttribute("ry",(N/2).toString()),V&&ee.setAttributes(oe,V),oe},ee.createGroup=function(A){var N=document.createElementNS("http://www.w3.org/2000/svg","g");return A&&ee.setAttributes(N,A),N},ee.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ee.createMarker=function(A,N,V,oe,q,Je,Kt){var gn=document.createElementNS("http://www.w3.org/2000/svg","marker");return ee.setAttributes(gn,[["id",A],["orient",N],["markerWidth",V.toString()],["markerHeight",oe.toString()],["refX",q.toString()],["refY",Je.toString()]]),gn.appendChild(Kt),gn},ee.createText=function(A){var N=document.createElementNS("http://www.w3.org/2000/svg","text");return N.setAttribute("x","0"),N.setAttribute("y","0"),A&&ee.setAttributes(N,A),N},ee.createTSpan=function(A,N){var V=document.createElementNS("http://www.w3.org/2000/svg","tspan");return V.textContent=A,N&&ee.setAttributes(V,N),V},ee.createImage=function(A){var N=document.createElementNS("http://www.w3.org/2000/svg","image");return A&&ee.setAttributes(N,A),N},ee.createPoint=function(A,N){var V=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return V.x=A,V.y=N,V},ee.createPath=function(A,N){var V=document.createElementNS("http://www.w3.org/2000/svg","path");return V.setAttribute("d",A),N&&ee.setAttributes(V,N),V},ee.createElement=function(A,N){var V=document.createElementNS("http://www.w3.org/2000/svg",A);return N&&ee.setAttributes(V,N),V},ee.getHollowRectanglePath=function(A,N,V,oe,q,Je,Kt,gn){return"M"+A+","+N+"V"+(N+oe)+"H"+(A+V)+"V"+N+"H"+q+"V"+Je+"H"+(q+Kt)+"V"+(Je+gn)+"H"+q+"V"+N+"Z"},ee}(),tt=function(){function ee(A){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+A+"_"}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(A){return this.styleSheet===void 0&&this.addStyleSheet(),A.name=""+this.classNamePrefix+A.localName,this.classes.push(A),this.styleSheet.sheet.insertRule("."+A.name+" {"+A.style+"}",this.styleSheet.sheet.cssRules.length),A},ee.prototype.addRule=function(A){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(A),this.styleSheet.sheet.insertRule(A.selector+" {"+A.style+"}",this.styleSheet.sheet.cssRules.length)},ee.prototype.addStyleSheet=function(){var A;this.styleSheet=document.createElement("style"),((A=this.styleSheetRoot)!==null&&A!==void 0?A:document.head).appendChild(this.styleSheet),this.addRule(new Lt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Lt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Lt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Ht("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Ht("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},ee.prototype.removeStyleSheet=function(){var A;this.styleSheet&&(((A=this.styleSheetRoot)!==null&&A!==void 0?A:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ee}(),Lt=function(ee,A){this.selector=ee,this.style=A},Ht=function(ee,A){this.localName=ee,this.style=A},ln=function(){function ee(){this.blocks=[],this.display=""}return ee.prototype.addButtonBlock=function(A){A.className=this.blockClassName,A.buttonClassName=this.buttonClassName,A.buttonColorsClassName=this.buttonColorsClassName,A.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(A)},ee.prototype.addElementBlock=function(A){A.className===void 0&&(A.className=this.blockClassName),this.blocks.push(A)},ee.prototype.getUI=function(){var A=document.createElement("div");return A.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,A.style.display=this.display,this.blocks.forEach(function(N){return A.appendChild(N.getUI())}),A},ee}(),hn=function(){function ee(){}return ee.prototype.getUI=function(){var A=document.createElement("div");if(A.className=this.className,this.minWidth!==void 0&&(A.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":A.style.justifyContent="flex-start";break;case"center":A.style.justifyContent="center";break;case"end":A.style.justifyContent="flex-end"}return A.style.whiteSpace="nowrap",A},ee}(),ir=function(ee){function A(){var N=ee!==null&&ee.apply(this,arguments)||this;return N.buttons=[],N}return kt(A,ee),A.prototype.addButton=function(N){N.className=this.buttonClassName,N.colorsClassName=this.buttonColorsClassName,N.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(N)},A.prototype.getUI=function(){var N=ee.prototype.getUI.call(this);return this.buttons.forEach(function(V){return N.appendChild(V.getUI())}),N},A}(hn),Un=function(){function ee(A,N){this._isActive=!1,this._isHidden=!1,this._icon=A,this.title=N,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(ee.prototype,"icon",{get:function(){return this._icon},set:function(A){this._icon=A,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"isActive",{get:function(){return this._isActive},set:function(A){this._isActive=A,this.adjustClassName()},enumerable:!1,configurable:!0}),ee.prototype.getUI=function(){var A=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 A.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}(),dn=function(ee){function A(){var N=ee!==null&&ee.apply(this,arguments)||this;return N.elements=[],N}return kt(A,ee),A.prototype.addElement=function(N){this.elements.push(N)},A.prototype.getUI=function(){var N=ee.prototype.getUI.call(this);return this.elements.forEach(function(V){return N.appendChild(V)}),N},A}(hn),fr=function(){function ee(A,N){this.horizontal=A,this.vertical=N}return Object.defineProperty(ee.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),ee.prototype.getVerticalLength=function(A){return A/this.ratio},ee.prototype.getHorizontalLength=function(A){return A*this.ratio},ee}(),Kr=function(){function ee(){}return ee.getIcon=function(A,N){if(A>0&&N>0){var V=new fr(A,N),oe=V.ratio>=1?20:V.getHorizontalLength(20),q=V.ratio<1?20:V.getVerticalLength(20),Je=document.createElementNS("http://www.w3.org/2000/svg","svg");Je.setAttribute("xmlns","http://www.w3.org/2000/svg"),Je.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Je);var Kt=Le.createDefs();Je.appendChild(Kt);var gn=Le.createElement("clipPath",[["id","text-bg-clip"]]);Kt.appendChild(gn);var Bn=Le.createPath(Le.getHollowRectanglePath((24-oe)/2,(24-q)/2,oe,q,(24-oe)/2+2,(24-q)/2+2,oe-4,q-4));Je.appendChild(Bn);var en=Le.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);en.appendChild(Le.createTSpan(A+":"+N)),Je.appendChild(en);var Gn=en.getBBox();Le.setAttributes(en,[["x",((24-Gn.width)/2).toString()],["y",((24-Gn.height)/2-Gn.y).toString()]]);var ar=Le.createPath(Le.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Gn.width))/2,(24-Math.ceil(Gn.height))/2,Math.ceil(Gn.width),Math.ceil(Gn.height)));return gn.appendChild(ar),Le.setAttributes(Bn,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Je),Je.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}(),tr=function(ee){function A(N,V,oe){var q=ee.call(this,N,V)||this;return q.isDropdownOpen=!1,q.onClick=q.dropdownButtonClicked,q.dropdownButtons=oe,q}return kt(A,ee),A.prototype.setupDropdown=function(){var N=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(V){V.className=N.className,V.colorsClassName=N.colorsClassName,N.dropdownBlock.appendChild(V.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},A.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},A.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},A.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},A.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},A.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},A}(Un),rr=function(){function ee(A,N){this.GRIP_SIZE=10,this.color=A,this.fillColor=N,this.visual=Le.createGroup(),this.visual.appendChild(Le.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Le.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(A){return A===this.visual||A===this.visual.childNodes[0]||A===this.visual.childNodes[1]},ee.prototype.setCenter=function(A,N){this.visual.childNodes.forEach(function(V){return Le.setAttributes(V,[["cx",A.toString()],["cy",N.toString()]])})},ee}(),Nr=function(){function ee(A,N,V,oe){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=A,this.canvasHeight=N,this.margin=V,this.container=oe,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(A){this._aspectRatio=A,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(A){this._isGridVisible=A,this.gridContainer&&Le.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(A){this._zoomFactor=A,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),ee.prototype.open=function(){var A=this;this.cropShadeElement=Le.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Le.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var N=0;N<this.numberOfGridLines;N++)this.horizontalGridLines.push(Le.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Le.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(V){return A.gridContainer.appendChild(V)}),this.verticalGridLines.forEach(function(V){return A.gridContainer.appendChild(V)}),this.cropRectElement=Le.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new rr(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new rr(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new rr(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new rr(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},ee.prototype.setCropRectangle=function(A){this.cropRect=A;var N=Object.assign({},this.cropRect);this.zoomFactor!==1&&(N.width=this.cropRect.width*this.zoomFactor,N.height=this.cropRect.height*this.zoomFactor,N.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-N.width/2,N.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-N.height/2),Le.setAttributes(this.cropRectElement,[["x",N.x.toString()],["y",N.y.toString()],["width",N.width.toString()],["height",N.height.toString()]]);var V=N.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(q,Je){var Kt=N.y+V*(Je+1);Le.setAttributes(q,[["x1",""+N.x],["y1",""+Kt],["x2",""+(N.x+N.width)],["y2",""+Kt]])});var oe=N.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(q,Je){var Kt=N.x+oe*(Je+1);Le.setAttributes(q,[["x1",""+Kt],["y1",""+N.y],["x2",""+Kt],["y2",""+(N.y+N.height)]])}),Le.setAttributes(this.cropShadeElement,[["d",Le.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,N.x,N.y,N.width,N.height)]]),this.topLeftGrip.setCenter(N.x,N.y),this.topRightGrip.setCenter(N.x+N.width,N.y),this.bottomLeftGrip.setCenter(N.x,N.y+N.height),this.bottomRightGrip.setCenter(N.x+N.width,N.y+N.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(A,N){var V=this.container.getBoundingClientRect();return{x:A-V.left+this.margin,y:N-V.top+this.margin}},ee.prototype.onPointerDown=function(A){this.container.setPointerCapture(A.pointerId),this.previousPoint=this.clientToLocalCoordinates(A.clientX,A.clientY),this.cropRectElement===A.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(A.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(A.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(A.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(A.target)&&(this.activeGrip=this.bottomRightGrip)},ee.prototype.onPointerMove=function(A){if(this.isMoving)this.move(this.clientToLocalCoordinates(A.clientX,A.clientY));else if(this.activeGrip){var N=this.clientToLocalCoordinates(A.clientX,A.clientY);this.resize(N)}A.preventDefault()},ee.prototype.onPointerUp=function(A){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(A.pointerId)},ee.prototype.move=function(A){var N=A.x-this.previousPoint.x,V=A.y-this.previousPoint.y;this.zoomFactor!==1&&(N=-N/this.zoomFactor,V=-V/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+N),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+V),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=A},ee.prototype.resize=function(A){var N=Object.assign({},this.cropRect),V=A.x-this.previousPoint.x,oe=A.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:N.x+V<this.margin&&(V=this.margin-N.x),N.x+=V,N.width=this.cropRect.x+this.cropRect.width-N.x;break;case this.bottomRightGrip:case this.topRightGrip:N.width+V>this.canvasWidth*this.zoomFactor&&(V=this.canvasWidth*this.zoomFactor-N.width),N.width+=V}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(N.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(V),N.height=this.aspectRatio.getVerticalLength(N.width)):(N.y+=oe,N.height=this.cropRect.y+this.cropRect.height-N.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?N.height=this.aspectRatio.getVerticalLength(N.width):N.height+=oe}N.width<10&&(N.x=this.cropRect.x,N.width=10),N.height<10&&(N.y=this.cropRect.y,N.height=10),this.previousPoint=A,N.x>=this.margin&&N.y>=this.margin&&N.x-this.margin+N.width<=this.canvasWidth&&N.y-this.margin+N.height<=this.canvasHeight&&(this.cropRect=N,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 A=this.cropRect.x+this.cropRect.width/2,N=this.cropRect.y+this.cropRect.height/2,V=this.aspectRatio.getHorizontalLength(this.cropRect.height),oe=this.aspectRatio.getVerticalLength(this.cropRect.width);V/this.canvasWidth<oe/this.canvasHeight?this.cropRect.width=V:this.cropRect.height=oe,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=A-this.cropRect.width/2,this.cropRect.y=N-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(A,N,V,oe,q,Je){var Kt=V/A,gn=oe/N;return{x:(q.x-Je)*Kt+Je,y:(q.y-Je)*gn+Je,width:q.width*Kt,height:q.height*gn}},ee.prototype.scaleCanvas=function(A,N){var V=this.getRescaledRect(this.canvasWidth,this.canvasHeight,A,N,this.cropRect,this.margin);this.canvasWidth=A,this.canvasHeight=N,this.onCropChange&&this.onCropChange(V),this.setCropRectangle(V)},ee}(),oi=function(){function ee(A){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=A,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(A){this._angle=A,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(A){this.controlContainer.setPointerCapture(A.pointerId),this.isDragging=!0,this.previousPoint={x:A.clientX,y:A.clientY}},ee.prototype.onPointerMove=function(A){this.isDragging&&(this.onAngleChange&&this.onAngleChange((A.clientX-this.previousPoint.x)/5),this.previousPoint.x=A.clientX)},ee.prototype.onPointerUp=function(A){this.isDragging&&this.onAngleChange&&this.onAngleChange((A.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(A.pointerId)},ee.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var A=this.angleLabelText.getBBox();Le.setAttributes(this.angleLabelElement,[["x",((this.width-A.width)/2).toString()],["y",(this.height/2).toString()]])}},ee.prototype.positionScaleShape=function(){if(this.scaleShape){var A=this.scaleShape.transform.baseVal.getItem(0);A.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(A,0)}},ee.prototype.getVisual=function(){var A=document.createElementNS("http://www.w3.org/2000/svg","svg");A.setAttribute("xmlns","http://www.w3.org/2000/svg"),A.setAttribute("width",this.width+"px"),A.setAttribute("height",this.height+"px"),A.setAttribute("viewBox","0 0 "+this.width+" "+this.height),A.style.flexShrink="0",document.body.appendChild(A);for(var N="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,V=1;V<=this.width/5+10;V++){var oe=V%5==0?this.height/3:this.height/6;N+="h4v"+-oe+"h1v"+oe}N+="v1H0Z",this.scaleShape=Le.createPath(N);var q=Le.createTransform();this.scaleShape.transform.baseVal.appendItem(q),A.appendChild(this.scaleShape),this.angleLabelElement=Le.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Le.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Je=Le.createTSpan("");return Je.innerHTML="&deg;",this.angleLabelElement.appendChild(Je),A.appendChild(this.angleLabelElement),document.body.removeChild(A),A},ee}(),hi=function(){function ee(){this.naturalSize=!1,this.imageType="image/png"}return ee.prototype.rasterize=function(A,N,V,oe,q,Je,Kt){var gn=this;return new Promise(function(Bn){var en=document.createElement("canvas");en.width=A.width.baseVal.value-2*oe,en.height=A.height.baseVal.value-2*oe;var Gn=1,ar=1;gn.naturalSize===!0?(Gn=N.naturalWidth/(A.width.baseVal.value-2*oe)/Je,ar=N.naturalHeight/(A.height.baseVal.value-2*oe)/Kt,en.width=N.naturalWidth/Je,en.height=N.naturalHeight/Kt):gn.width!==void 0&&gn.height!==void 0&&(Gn=gn.width/V.width,ar=gn.height/V.height,en.width*=Gn,en.height*=ar);var Ur=en.getContext("2d");Ur.translate(en.width/2,en.height/2),Ur.rotate(q*Math.PI/180),Ur.scale(Je,Kt),Ur.translate(-en.width/2,-en.height/2),Ur.drawImage(N,0,0,en.width,en.height);var si=document.createElement("canvas");si.width=V.width*Gn,si.height=V.height*ar,si.getContext("2d").putImageData(Ur.getImageData((V.x-oe)*Gn,(V.y-oe)*ar,V.width*Gn,V.height*ar),0,0),Bn(si.toDataURL(gn.imageType,gn.imageQuality))})},ee}(),an=function(){function ee(A){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 tt(this.instanceNo),this.target=A,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(A){this._zoomToCropEnabled=A,A?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(A){this._isGridVisible=A,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"gridLines",{get:function(){return this._gridLines},set:function(A){this._gridLines=A,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(A){this._rotationAngle=A,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 A;return(A=this._aspectRatio)!==null&&A!==void 0?A:this.aspectRatios[0]},set:function(A){this._aspectRatio=A},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(A){A===void 0&&(A=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),A||this.closeEventListeners.forEach(function(N){return N()}),this._isOpen=!1)},ee.prototype.addRenderEventListener=function(A){this.renderEventListeners.push(A)},ee.prototype.removeRenderEventListener=function(A){this.renderEventListeners.indexOf(A)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(A),1)},ee.prototype.addCloseEventListener=function(A){this.closeEventListeners.push(A)},ee.prototype.removeCloseEventListener=function(A){this.closeEventListeners.indexOf(A)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(A),1)},ee.prototype.setupResizeObserver=function(){var A=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){A.resize(A.target.clientWidth,A.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 A=1*this.target.clientWidth/this.target.clientHeight,N=this.contentDiv.clientWidth/A>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*A:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,V=N+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/A;this.resize(N,V)}},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",Le.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(A,N){this.imageWidth=Math.round(A),this.imageHeight=Math.round(N),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 A=document.createElement("canvas");A.width=this.target.naturalWidth,A.height=this.target.naturalHeight,A.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var N=A.toDataURL();Le.setAttributes(this.editingTarget,[["href",N]]),this.setEditingTargetSize()},ee.prototype.setTopLeft=function(){var A=this.target.getBoundingClientRect(),N=this.editorCanvas.getBoundingClientRect();this.left=A.left-N.left-this.CANVAS_MARGIN,this.top=A.top-N.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=Le.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Le.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Le.createGroup(),this.editingTargetRotationScaleContainer=Le.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var A=Le.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(A);var N=Le.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(N),this.editingTargetContainer=Le.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=Le.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Nr(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 A=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,N=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=A+"px "+N+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-A+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-N+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(A){this.cropRect=A,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 A=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,N=this.target.offsetTop>A+this.CANVAS_MARGIN?this.target.offsetTop-(A+this.CANVAS_MARGIN):0;this.coverDiv.style.top=N+"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 A=this;this.topToolbar=new ln,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 N=new ir;N.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(N);var V=[];this.aspectRatios.forEach(function(ar){var Ur=new Un(Kr.getIcon(ar.horizontal,ar.vertical),ar.horizontal===0&&ar.vertical===0?"FREE":ar.horizontal+":"+ar.vertical);Ur.onClick=function(){return A.ratioButtonClicked(ar)},V.push(Ur)}),this.aspectRatioButton=new tr(Kr.getIcon(0,0),"Aspect ratio",V),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,N.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var oe=new Un('<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");oe.isActive=this.isGridVisible,oe.onClick=function(){A.isGridVisible=!A.isGridVisible,oe.isActive=A.isGridVisible},N.addButton(oe);var q=new Un('<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(){A.zoomToCropEnabled=!A.zoomToCropEnabled,q.isActive=A.zoomToCropEnabled},N.addButton(q),!Jt.isLicensed){var Je=new dn;this.topToolbar.addElementBlock(Je);var Kt=document.createElement("div");Kt.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var gn=document.createElement("a");gn.style.color="currentColor",gn.href="https://markerjs.com/products/cropro",gn.target="_blank",gn.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>',Kt.appendChild(gn),Je.addElement(Kt)}var Bn=new ir;Bn.minWidth=3*this.toolbarHeight+"px",Bn.contentAlign="end",this.topToolbar.addButtonBlock(Bn);var en=new Un('<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");en.onClick=this.startRenderAndClose,Bn.addButton(en),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(en.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Gn=new Un('<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");Gn.onClick=this.close,Bn.addButton(Gn),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Gn.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},ee.prototype.addBottomToolbar=function(){var A=this;this.bottomToolbar=new ln,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 N=new ir;N.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(N);var V=new Un('<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");V.onClick=this.rotateLeftButtonClicked,N.addButton(V);var oe=new Un('<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");oe.onClick=this.rotateRightButtonClicked,N.addButton(oe);var q=new dn;q.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(q),this.straightener=new oi("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(Bn){A.rotateBy(Bn),A.straightener.angle=A.rotationAngle},q.addElement(this.straightener.getUI());var Je=new ir;Je.minWidth=2*this.toolbarHeight+"px",Je.contentAlign="end",this.bottomToolbar.addButtonBlock(Je);var Kt=new Un('<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");Kt.onClick=this.flipHorizontallyButtonClicked,Je.addButton(Kt);var gn=new Un('<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");gn.onClick=this.flipVerticallyButtonClicked,Je.addButton(gn)},ee.prototype.ratioButtonClicked=function(A){this.aspectRatio=A,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},ee.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Kr.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 fr(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(A){if(A){var N=this.cropLayer.getRescaledRect(A.width,A.height,this.imageWidth,this.imageHeight,A.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(N),this.cropRectChanged(N),this.flippedHorizontally=A.flippedHorizontally,this.flippedVertically=A.flippedVertically,this.applyFlip(),this.rotationAngle=A.rotationAngle,this.applyRotation()}},ee.prototype.clientToLocalCoordinates=function(A,N){var V=this.cropImage.getBoundingClientRect();return{x:A-V.left,y:N-V.top}},ee.prototype.onWindowResize=function(){this.positionUI()},ee.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var A=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=A+"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 A=this.rotationAngle-90;this.rotationAngle%90!=0&&(A+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(A)},ee.prototype.rotateRightButtonClicked=function(){var A=this.rotationAngle+90;this.rotationAngle%90!=0&&(A-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(A)},ee.prototype.rotateTo=function(A){A=(A=A>180?A-360:A)<=-180?A+360:A,this.rotationAngle=A,this.applyRotation()},ee.prototype.rotateBy=function(A){this.rotateTo((this.rotationAngle+A)%360)},ee.prototype.applyRotation=function(){var A=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var N=this.editingTargetRotationContainer.transform.baseVal.getItem(0);N.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(N,0);var V=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/V.width,this.imageHeight/V.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=A},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 vt(this,void 0,void 0,function(){var A,N;return Qt(this,function(V){switch(V.label){case 0:return[4,this.render()];case 1:return A=V.sent(),N=this.getState(),this.renderEventListeners.forEach(function(oe){return oe(A,N)}),this.close(!0),[2]}})})},ee.prototype.render=function(){return vt(this,void 0,void 0,function(){var A;return Qt(this,function(N){switch(N.label){case 0:return(A=new hi).naturalSize=this.renderAtNaturalSize,A.imageType=this.renderImageType,A.imageQuality=this.renderImageQuality,A.width=this.renderWidth,A.height=this.renderHeight,this.unzoomFromCrop(),Le.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,A.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 N.sent(),[4,A.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,N.sent()]}})})},ee.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ht("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 Ht("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ht("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var A=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ht("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*A)+`px;
height: `+(this.toolbarHeight-2*A)+`px;
padding: `+A+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ht("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ht("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new Lt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new Lt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Ht("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 Ht("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Ht("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 Ht("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*A)+`px;
padding: `+A+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Ht("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},ee.instanceCounter=0,ee}(),Xn=k("8hTe"),fi=k.n(Xn),Ei=/<pre[^>]*>/g;function ri(ee){var A=document.createElement("div");return A.innerHTML=ee,A.childNodes.length===0?"":A.childNodes[0].nodeValue}var ii=et.a=function(ee){var A=ee.value,N=A===void 0?"":A,V=ee.edit,oe=V===void 0?!1:V,q=ee.className,Je=ee.showTextOnly,Kt=ee.showLines,gn=ee.replaces,Bn=ee.zoomImg,en=ee.hasMask,Gn=ee.style,ar=Gn===void 0?{}:Gn,Ur=ee.stylesPrev,si=Ur===void 0?{}:Ur,Jr=String(N),qr=Object(x.useRef)(),Ni=Object(x.useRef)(),Qi=Object(x.useState)(""),ai=Object(H.a)(Qi,2),Ri=ai[0],Vi=ai[1],Ui=Object(x.useState)("office"),pi=Object(H.a)(Ui,2),Ji=pi[0],Mi=pi[1],ea=function(){var Be=new an(Ni.current);Be.displayMode="popup",Be.addRenderEventListener(function(){var rt=Object(P.a)(I.a.mark(function ht(Me){var ft;return I.a.wrap(function(Ct){for(;;)switch(Ct.prev=Ct.next){case 0:return qr.current.style.display="none",Ct.next=3,Object(Ie.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Me}});case 3:ft=Ct.sent,ft!=null&&ft.id&&gn(Ni.current.getAttribute("src").replace(X.a.API_SERVER,""),"/api/attachments/".concat(ft==null?void 0:ft.id,"?type=").concat(ft.content_type));case 5:case"end":return Ct.stop()}},ht)}));return function(ht){return rt.apply(this,arguments)}}()),Be.show()},la=function(){var Be=new _e(Ni.current);Be.settings.displayMode="popup",Be.addEventListener("render",function(){var rt=Object(P.a)(I.a.mark(function ht(Me){var ft;return I.a.wrap(function(Ct){for(;;)switch(Ct.prev=Ct.next){case 0:if(qr.current.style.display="none",!Ni.current){Ct.next=6;break}return Ct.next=4,Object(Ie.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Me.dataUrl}});case 4:ft=Ct.sent,ft!=null&&ft.id&&gn(Ni.current.getAttribute("src").replace(X.a.API_SERVER,""),"/api/attachments/".concat(ft==null?void 0:ft.id,"?type=").concat(ft.content_type));case 6:case"end":return Ct.stop()}},ht)}));return function(ht){return rt.apply(this,arguments)}}()),Be.show(),window.markerArea=Be},Nn=Object(x.useMemo)(function(){qr.current&&(qr.current.style.zIndex=-1);try{var at=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Be=/\"\/api\/attachments\/|\"\/attachments\/download\//g,rt=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Jr=Jr.replace(at,"("+X.a.API_SERVER+"/api/attachments/").replace(Be,'"'+X.a.API_SERVER+"/api/attachments/").replace(rt,'"'+X.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(Ot){}var ht=z(Jr),Me=g();if(Jr.match(/\[TOC\]/)&&(ht=ht.replace("<p>[TOC]</p>",D()),R()),ht=ht.replace(/(__special_katext_id_\d+__)/g,function(Ot,Ct){var _t=Me[Ct],Et=_t.type,St=_t.expression;return Object(te.renderToString)(ri(St)||"",{displayMode:Et==="block",throwOnError:!1,output:"html"})}),ht=ht.replace(/▁/g,"\u2581\u2581\u2581"),E(),Je){var ft=document.createElement("div");return ft.innerHTML=ht,ft.innerText}return setTimeout(function(){return Ae()},500),ht},[Jr]),Q=Object(x.useRef)();w.WebkitLineClamp=Kt,Kt&&(ar=Object(L.a)(Object(L.a)({},ar),w));function ve(at){var Be=at.target;if(Be.tagName.toUpperCase()==="IMG"){if(Bn){var rt=Be.getAttribute("src");Vi(rt),Mi("image")}}else if(Be.tagName.toUpperCase()==="A"){var ht=Be.getAttribute("href");if(ht.indexOf("office")>-1)at.preventDefault(),Vi(ht),Mi("office");else if(ht.indexOf("application/pdf")>-1)at.preventDefault(),Vi(ht),Mi("pdf");else if(ht.indexOf("text/html")>-1)at.preventDefault(),Vi(ht),Mi("html");else if(ht.startsWith("#")){at.preventDefault();var Me=document.getElementById(ht.replace("#",""));Me&&Me.scrollIntoView(!0)}}}var Ae=function(){var Be,rt=(Be=Q.current)===null||Be===void 0?void 0:Be.querySelectorAll("video");rt==null||rt.forEach(function(ht){if(ht.oncontextmenu=function(){return!1},ht.src.indexOf(".m3u8")>-1&&!ht.canPlayType("application/vnd.apple.mpegurl")){if(W.a.isSupported()){var Me=new W.a;Me.loadSource(ht.src),Me.attachMedia(ht)}}})};Object(x.useEffect)(function(){if(Q.current&&Nn&&(Nn.match(Ei)&&window.PR.prettyPrint()),Q.current)return Q.current.addEventListener("click",ve),function(){Q.current.removeEventListener("click",ve),E(),R()}},[Nn,Q.current,ve]);var De=function(Be){if(!oe)return;Be.target.nodeName==="IMG"?(qr.current.style.zIndex=1,qr.current.style.display="flex",qr.current.style.width=Be.target.clientWidth+"px",qr.current.style.height=Be.target.clientHeight+"px",qr.current.style.top=Be.target.offsetTop+"px",qr.current.style.left=Be.target.offsetLeft+"px",Ni.current.src=Be.target.getAttribute("src")):qr.current.style.display="none"};return p.a.createElement("div",{style:{position:"relative"}},p.a.createElement("div",{ref:Q,style:Object(L.a)({},ar),className:"".concat(q||""," markdown-body ").concat(fi.a.mdBody),onMouseOver:De,dangerouslySetInnerHTML:{__html:Nn}}),p.a.createElement("div",{ref:qr,className:fi.a.button},p.a.createElement(Y.a,null,p.a.createElement(G.a,{onClick:function(){return ea()}},"\u88C1\u526A"),p.a.createElement(G.a,{onClick:function(){return la()}},"\u7F16\u8F91"))),p.a.createElement("img",{ref:Ni,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),p.a.createElement(pe.a,{close:!0,data:Ri,type:Ri!=null&&Ri.length?Ji:"",style:Object(L.a)({},si),onClose:function(){return Vi("")}}))}},"9VGf":function(Gt,et,k){"use strict";k.d(et,"a",function(){return j});var re=k("q1tI"),Y=k.n(re);function j(G,L){var P=Object(re.useRef)();Object(re.useEffect)(function(){P.current=G}),Object(re.useEffect)(function(){function H(){P.current()}if(L!==null){var O=setInterval(H,L);return function(){return clearInterval(O)}}},[L])}},AHFd:function(Gt,et,k){"use strict";k.d(et,"a",function(){return O});var re=k("giR+"),Y=k("fyUT"),j=k("OaEy"),G=k("2fM7"),L=k("tJVT"),P=k("q1tI"),H=k.n(P),O;(function(x){x[x.Number=1]="Number",x[x.Percent=2]="Percent"})(O||(O={}));var I=function(p){var m=p.value,h=p.onChange,r=p.disabled,n=p.hidePercentOption,a=n===void 0?!1:n,l=Object(P.useMemo)(function(){return a?O.Number:O.Percent},[a]),s=Object(P.useState)(l),u=Object(L.a)(s,2),c=u[0],R=u[1],w=Object(P.useCallback)(function(D){return c===O.Number?"".concat(D,"\u5206"):"".concat(D,"%")},[c]),C=Object(P.useCallback)(function(D){if(c===O.Number){var S=D.replace("\u5206","");return isNaN(parseInt(S,10))?0:S}else{var b=D.replace("%","");return b}},[c]);return Object(P.useEffect)(function(){R(m.type)},[m]),H.a.createElement("div",{style:{display:"inline-block"}},H.a.createElement(G.a,{onChange:function(S){R(S),h({type:S,inputValue:S===O.Number?5:20})},value:c||l,style:{width:100},options:a?[{label:"\u5206\u503C",value:O.Number}]:[{label:"\u767E\u5206\u6BD4",value:O.Percent},{label:"\u5206\u503C",value:O.Number}],disabled:r}),H.a.createElement(Y.a,{disabled:r,value:m.inputValue,formatter:w,parser:C,max:c===O.Percent?100:Number.MAX_SAFE_INTEGER,min:0,precision:0,onChange:function(S){h({type:c,inputValue:S})}}))};et.b=I},BU3w:function(Gt,et,k){"use strict";k.d(et,"a",function(){return P});var re=k("MNnm"),Y="rc-util-key";function j(H){if(H.attachTo)return H.attachTo;var O=document.querySelector("head");return O||document.body}function G(H){var O,I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(re.a)())return null;var x=document.createElement("style");if((O=I.csp)===null||O===void 0?void 0:O.nonce){var p;x.nonce=(p=I.csp)===null||p===void 0?void 0:p.nonce}x.innerHTML=H;var m=j(I),h=m.firstChild;return I.prepend&&m.prepend?m.prepend(x):I.prepend&&h?m.insertBefore(x,h):m.appendChild(x),x}var L=new Map;function P(H,O){var I=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},x=j(I);if(!L.has(x)){var p=G("",I),m=p.parentNode;L.set(x,m),m.removeChild(p)}var h=Array.from(L.get(x).children).find(function(s){return s.tagName==="STYLE"&&s[Y]===O});if(h){var r,n;if(((r=I.csp)===null||r===void 0?void 0:r.nonce)&&h.nonce!==((n=I.csp)===null||n===void 0?void 0:n.nonce)){var a;h.nonce=(a=I.csp)===null||a===void 0?void 0:a.nonce}return h.innerHTML!==H&&(h.innerHTML=H),h}var l=G(H,I);return l[Y]=O,l}},Bd2K:function(Gt,et,k){(function(re){re(k("VrN/"),k("osHv"))})(function(re){re.defineOption("autoCloseTags",!1,function(I,x,p){if(p!=re.Init&&p&&I.removeKeyMap("autoCloseTags"),!x)return;var m={name:"autoCloseTags"};(typeof x!="object"||x.whenClosing!==!1)&&(m["'/'"]=function(h){return P(h)}),(typeof x!="object"||x.whenOpening!==!1)&&(m["'>'"]=function(h){return G(h)}),I.addKeyMap(m)});var Y=["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(I){if(I.getOption("disableInput"))return re.Pass;for(var x=I.listSelections(),p=[],m=I.getOption("autoCloseTags"),h=0;h<x.length;h++){if(!x[h].empty())return re.Pass;var r=x[h].head,n=I.getTokenAt(r),a=re.innerMode(I.getMode(),n.state),l=a.state,s=a.mode.xmlCurrentTag&&a.mode.xmlCurrentTag(l),u=s&&s.name;if(!u)return re.Pass;var c=a.mode.configuration=="html",R=typeof m=="object"&&m.dontCloseTags||c&&Y,w=typeof m=="object"&&m.indentTags||c&&j;n.end>r.ch&&(u=u.slice(0,u.length-n.end+r.ch));var C=u.toLowerCase();if(!u||n.type=="string"&&(n.end!=r.ch||!/[\"\']/.test(n.string.charAt(n.string.length-1))||n.string.length==1)||n.type=="tag"&&s.close||n.string.indexOf("/")==r.ch-n.start-1||R&&H(R,C)>-1||O(I,a.mode.xmlCurrentContext&&a.mode.xmlCurrentContext(l)||[],u,r,!0))return re.Pass;var D=typeof m=="object"&&m.emptyTags;if(D&&H(D,u)>-1){p[h]={text:"/>",newPos:re.Pos(r.line,r.ch+2)};continue}var S=w&&H(w,C)>-1;p[h]={indent:S,text:">"+(S?`
`:"")+"</"+u+">",newPos:S?re.Pos(r.line+1,0):re.Pos(r.line,r.ch+1)}}for(var b=typeof m=="object"&&m.dontIndentOnAutoClose,h=x.length-1;h>=0;h--){var _=p[h];I.replaceRange(_.text,x[h].head,x[h].anchor,"+insert");var f=I.listSelections().slice(0);f[h]={head:_.newPos,anchor:_.newPos},I.setSelections(f),!b&&_.indent&&(I.indentLine(_.newPos.line,null,!0),I.indentLine(_.newPos.line+1,null,!0))}}function L(I,x){for(var p=I.listSelections(),m=[],h=x?"/":"</",r=I.getOption("autoCloseTags"),n=typeof r=="object"&&r.dontIndentOnSlash,a=0;a<p.length;a++){if(!p[a].empty())return re.Pass;var l=p[a].head,s=I.getTokenAt(l),u=re.innerMode(I.getMode(),s.state),c=u.state;if(x&&(s.type=="string"||s.string.charAt(0)!="<"||s.start!=l.ch-1))return re.Pass;var R,w=u.mode.name!="xml"&&I.getMode().name=="htmlmixed";if(w&&u.mode.name=="javascript")R=h+"script";else if(w&&u.mode.name=="css")R=h+"style";else{var C=u.mode.xmlCurrentContext&&u.mode.xmlCurrentContext(c);if(!C||C.length&&O(I,C,C[C.length-1],l))return re.Pass;R=h+C[C.length-1]}I.getLine(l.line).charAt(s.end)!=">"&&(R+=">"),m[a]=R}if(I.replaceSelections(m),p=I.listSelections(),!n)for(var a=0;a<p.length;a++)(a==p.length-1||p[a].head.line<p[a+1].head.line)&&I.indentLine(p[a].head.line)}function P(I){return I.getOption("disableInput")?re.Pass:L(I,!0)}re.commands.closeTag=function(I){return L(I)};function H(I,x){if(I.indexOf)return I.indexOf(x);for(var p=0,m=I.length;p<m;++p)if(I[p]==x)return p;return-1}function O(I,x,p,m,h){if(!re.scanForClosingTag)return!1;var r=Math.min(I.lastLine()+1,m.line+500),n=re.scanForClosingTag(I,m,null,r);if(!n||n.tag!=p)return!1;for(var a=h?1:0,l=x.length-1;l>=0&&x[l]==p;l--)++a;m=n.to;for(var l=1;l<a;l++){var s=re.scanForClosingTag(I,m,null,r);if(!s||s.tag!=p)return!1;m=s.to}return!0}})},BdwD:function(Gt,et,k){"use strict";var re=k("+L6B"),Y=k("2/Rp"),j=k("0Owb"),G=k("k1fw"),L=k("q1tI"),P=k.n(L),H=k("FOrL"),O=k.n(H),I=function(p){var m=p.buttonProps,h=m===void 0?{}:m,r=p.styles,n=r===void 0?{}:r,a=p.customText,l=p.ButtonText,s=p.ButtonClick,u=p.Buttonclass,c=p.ButtonTwo;return P.a.createElement("section",{className:"tc animated fadeIn",style:Object(G.a)(Object(G.a)({},{color:"#999",margin:"200px auto"}),n)},P.a.createElement("img",{src:O.a}),P.a.createElement("p",{className:"mt20 font14"},a||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),l&&P.a.createElement(Y.a,Object(j.a)({className:u,onClick:s},h),l),c&&c)};et.a=I},BjJ7:function(Gt,et,k){"use strict";k.d(et,"d",function(){return Y}),k.d(et,"c",function(){return j}),k.d(et,"e",function(){return G}),k.d(et,"b",function(){return L}),k.d(et,"a",function(){return H});var re=k("m3rI");function Y(O){var I=!0;if(O.length>0){for(var x=0;x<O.length;x++)if(O[x].compile_success==0||!O[x].compile_success){I=!1;break}}else I=!1;return I}function j(O){for(var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",x=[],p=0;p<O.length;p++){var m=O[p],h=I?"".concat(I,"/").concat(m.name):"".concat(m.name);x.push({title:m.name,isLeaf:!(m.type==="tree"),key:h})}return x}function G(O,I,x){for(var p=0;p<O.length;p++){var m=O[p];if(m.key===I){m.children=x;break}m.children&&G(m.children,I,x)}return O}function L(O,I,x){var p;return function(){var m=this,h=arguments,r=function(){p=null,x||O.apply(m,h)},n=x&&!p;clearTimeout(p),p=setTimeout(r,I),n&&O.apply(m,h)}}var P=!0,H=re.a.API_SERVER},"C+DQ":function(Gt,et,k){},DlQD:function(Gt,et,k){(function(re,Y){Gt.exports=Y()})(this,function(){"use strict";function re(Ve,Se){for(var Pe=0;Pe<Se.length;Pe++){var ce=Se[Pe];ce.enumerable=ce.enumerable||!1,ce.configurable=!0,"value"in ce&&(ce.writable=!0),Object.defineProperty(Ve,ce.key,ce)}}function Y(Ve,Se,Pe){return Se&&re(Ve.prototype,Se),Pe&&re(Ve,Pe),Ve}function j(Ve,Se){if(!Ve)return;if(typeof Ve=="string")return G(Ve,Se);var Pe=Object.prototype.toString.call(Ve).slice(8,-1);if(Pe==="Object"&&Ve.constructor&&(Pe=Ve.constructor.name),Pe==="Map"||Pe==="Set")return Array.from(Ve);if(Pe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Pe))return G(Ve,Se)}function G(Ve,Se){(Se==null||Se>Ve.length)&&(Se=Ve.length);for(var Pe=0,ce=new Array(Se);Pe<Se;Pe++)ce[Pe]=Ve[Pe];return ce}function L(Ve,Se){var Pe;if(typeof Symbol=="undefined"||Ve[Symbol.iterator]==null){if(Array.isArray(Ve)||(Pe=j(Ve))||Se&&Ve&&typeof Ve.length=="number"){Pe&&(Ve=Pe);var ce=0;return function(){return ce>=Ve.length?{done:!0}:{done:!1,value:Ve[ce++]}}}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 Pe=Ve[Symbol.iterator](),Pe.next.bind(Pe)}function P(Ve,Se){return Se={exports:{}},Ve(Se,Se.exports),Se.exports}var H=P(function(Ve){function Se(){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 Pe(ce){Ve.exports.defaults=ce}Ve.exports={defaults:Se(),getDefaults:Se,changeDefaults:Pe}}),O=H.defaults,I=H.getDefaults,x=H.changeDefaults,p=/[&<>"']/,m=/[&<>"']/g,h=/[<>"']|&(?!#?\w+;)/,r=/[<>"']|&(?!#?\w+;)/g,n={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},a=function(Se){return n[Se]};function l(Ve,Se){if(Se){if(p.test(Ve))return Ve.replace(m,a)}else if(h.test(Ve))return Ve.replace(r,a);return Ve}var s=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function u(Ve){return Ve.replace(s,function(Se,Pe){return Pe=Pe.toLowerCase(),Pe==="colon"?":":Pe.charAt(0)==="#"?Pe.charAt(1)==="x"?String.fromCharCode(parseInt(Pe.substring(2),16)):String.fromCharCode(+Pe.substring(1)):""})}var c=/(^|[^\[])\^/g;function R(Ve,Se){Ve=Ve.source||Ve,Se=Se||"";var Pe={replace:function(de,be){return be=be.source||be,be=be.replace(c,"$1"),Ve=Ve.replace(de,be),Pe},getRegex:function(){return new RegExp(Ve,Se)}};return Pe}var w=/[^\w:]/g,C=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function D(Ve,Se,Pe){if(Ve){var ce;try{ce=decodeURIComponent(u(Pe)).replace(w,"").toLowerCase()}catch(de){return null}if(ce.indexOf("javascript:")===0||ce.indexOf("vbscript:")===0||ce.indexOf("data:")===0)return null}Se&&!C.test(Pe)&&(Pe=d(Se,Pe));try{Pe=encodeURI(Pe).replace(/%25/g,"%")}catch(de){return null}return Pe}var S={},b=/^[^:]+:\/*[^/]*$/,_=/^([^:]+:)[\s\S]*$/,f=/^([^:]+:\/*[^/]*)[\s\S]*$/;function d(Ve,Se){S[" "+Ve]||(b.test(Ve)?S[" "+Ve]=Ve+"/":S[" "+Ve]=F(Ve,"/",!0)),Ve=S[" "+Ve];var Pe=Ve.indexOf(":")===-1;return Se.substring(0,2)==="//"?Pe?Se:Ve.replace(_,"$1")+Se:Se.charAt(0)==="/"?Pe?Se:Ve.replace(f,"$1")+Se:Ve+Se}var g={exec:function(){}};function E(Ve){for(var Se=1,Pe,ce;Se<arguments.length;Se++){Pe=arguments[Se];for(ce in Pe)Object.prototype.hasOwnProperty.call(Pe,ce)&&(Ve[ce]=Pe[ce])}return Ve}function T(Ve,Se){var Pe=Ve.replace(/\|/g,function(be,je,ze){for(var ut=!1,Dt=je;--Dt>=0&&ze[Dt]==="\\";)ut=!ut;return ut?"|":" |"}),ce=Pe.split(/ \|/),de=0;if(ce.length>Se)ce.splice(Se);else for(;ce.length<Se;)ce.push("");for(;de<ce.length;de++)ce[de]=ce[de].trim().replace(/\\\|/g,"|");return ce}function F(Ve,Se,Pe){var ce=Ve.length;if(ce===0)return"";for(var de=0;de<ce;){var be=Ve.charAt(ce-de-1);if(be===Se&&!Pe)de++;else if(be!==Se&&Pe)de++;else break}return Ve.substr(0,ce-de)}function U(Ve,Se){if(Ve.indexOf(Se[1])===-1)return-1;for(var Pe=Ve.length,ce=0,de=0;de<Pe;de++)if(Ve[de]==="\\")de++;else if(Ve[de]===Se[0])ce++;else if(Ve[de]===Se[1]&&(ce--,ce<0))return de;return-1}function K(Ve){Ve&&Ve.sanitize&&!Ve.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 z={escape:l,unescape:u,edit:R,cleanUrl:D,resolveUrl:d,noopTest:g,merge:E,splitCells:T,rtrim:F,findClosingBracket:U,checkSanitizeDeprecation:K},M=H.defaults,y=z.rtrim,W=z.splitCells,X=z.escape,te=z.findClosingBracket;function pe(Ve,Se,Pe){var ce=Se.href,de=Se.title?X(Se.title):null,be=Ve[1].replace(/\\([\[\]])/g,"$1");return Ve[0].charAt(0)!=="!"?{type:"link",raw:Pe,href:ce,title:de,text:be}:{type:"image",raw:Pe,href:ce,title:de,text:X(be)}}function Ie(Ve,Se){var Pe=Ve.match(/^(\s+)(?:```)/);if(Pe===null)return Se;var ce=Pe[1];return Se.split(`
`).map(function(de){var be=de.match(/^\s+/);if(be===null)return de;var je=be[0];return je.length>=ce.length?de.slice(ce.length):de}).join(`
`)}var Ee=function(){function Ve(Pe){this.options=Pe||M}var Se=Ve.prototype;return Se.space=function(ce){var de=this.rules.block.newline.exec(ce);if(de)return de[0].length>1?{type:"space",raw:de[0]}:{raw:`
`}},Se.code=function(ce,de){var be=this.rules.block.code.exec(ce);if(be){var je=de[de.length-1];if(je&&je.type==="paragraph")return{raw:be[0],text:be[0].trimRight()};var ze=be[0].replace(/^ {4}/gm,"");return{type:"code",raw:be[0],codeBlockStyle:"indented",text:this.options.pedantic?ze:y(ze,`
`)}}},Se.fences=function(ce){var de=this.rules.block.fences.exec(ce);if(de){var be=de[0],je=Ie(be,de[3]||"");return{type:"code",raw:be,lang:de[2]?de[2].trim():de[2],text:je}}},Se.heading=function(ce){var de=this.rules.block.heading.exec(ce);if(de)return{type:"heading",raw:de[0],depth:de[1].length,text:de[2]}},Se.nptable=function(ce){var de=this.rules.block.nptable.exec(ce);if(de){var be={type:"table",header:W(de[1].replace(/^ *| *\| *$/g,"")),align:de[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:de[3]?de[3].replace(/\n$/,"").split(`
`):[],raw:de[0]};if(be.header.length===be.align.length){var je=be.align.length,ze;for(ze=0;ze<je;ze++)/^ *-+: *$/.test(be.align[ze])?be.align[ze]="right":/^ *:-+: *$/.test(be.align[ze])?be.align[ze]="center":/^ *:-+ *$/.test(be.align[ze])?be.align[ze]="left":be.align[ze]=null;for(je=be.cells.length,ze=0;ze<je;ze++)be.cells[ze]=W(be.cells[ze],be.header.length);return be}}},Se.hr=function(ce){var de=this.rules.block.hr.exec(ce);if(de)return{type:"hr",raw:de[0]}},Se.blockquote=function(ce){var de=this.rules.block.blockquote.exec(ce);if(de){var be=de[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:de[0],text:be}}},Se.list=function(ce){var de=this.rules.block.list.exec(ce);if(de){for(var be=de[0],je=de[2],ze=je.length>1,ut=je[je.length-1]===")",Dt={type:"list",raw:be,ordered:ze,start:ze?+je.slice(0,-1):"",loose:!1,items:[]},rn=de[0].match(this.rules.block.item),mn=!1,gt,Vt,Tt,Rt,mt,_e,Ge,kt=rn.length,vt=0;vt<kt;vt++)gt=rn[vt],be=gt,Vt=gt.length,gt=gt.replace(/^ *([*+-]|\d+[.)]) */,""),~gt.indexOf(`
`)&&(Vt-=gt.length,gt=this.options.pedantic?gt.replace(/^ {1,4}/gm,""):gt.replace(new RegExp("^ {1,"+Vt+"}","gm"),"")),vt!==kt-1&&(Tt=this.rules.block.bullet.exec(rn[vt+1])[0],(ze?Tt.length===1||!ut&&Tt[Tt.length-1]===")":Tt.length>1||this.options.smartLists&&Tt!==je)&&(Rt=rn.slice(vt+1).join(`
`),Dt.raw=Dt.raw.substring(0,Dt.raw.length-Rt.length),vt=kt-1)),mt=mn||/\n\n(?!\s*$)/.test(gt),vt!==kt-1&&(mn=gt.charAt(gt.length-1)===`
`,mt||(mt=mn)),mt&&(Dt.loose=!0),_e=/^\[[ xX]\] /.test(gt),Ge=void 0,_e&&(Ge=gt[1]!==" ",gt=gt.replace(/^\[[ xX]\] +/,"")),Dt.items.push({type:"list_item",raw:be,task:_e,checked:Ge,loose:mt,text:gt});return Dt}},Se.html=function(ce){var de=this.rules.block.html.exec(ce);if(de)return{type:this.options.sanitize?"paragraph":"html",raw:de[0],pre:!this.options.sanitizer&&(de[1]==="pre"||de[1]==="script"||de[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(de[0]):X(de[0]):de[0]}},Se.def=function(ce){var de=this.rules.block.def.exec(ce);if(de){de[3]&&(de[3]=de[3].substring(1,de[3].length-1));var be=de[1].toLowerCase().replace(/\s+/g," ");return{tag:be,raw:de[0],href:de[2],title:de[3]}}},Se.table=function(ce){var de=this.rules.block.table.exec(ce);if(de){var be={type:"table",header:W(de[1].replace(/^ *| *\| *$/g,"")),align:de[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:de[3]?de[3].replace(/\n$/,"").split(`
`):[]};if(be.header.length===be.align.length){be.raw=de[0];var je=be.align.length,ze;for(ze=0;ze<je;ze++)/^ *-+: *$/.test(be.align[ze])?be.align[ze]="right":/^ *:-+: *$/.test(be.align[ze])?be.align[ze]="center":/^ *:-+ *$/.test(be.align[ze])?be.align[ze]="left":be.align[ze]=null;for(je=be.cells.length,ze=0;ze<je;ze++)be.cells[ze]=W(be.cells[ze].replace(/^ *\| *| *\| *$/g,""),be.header.length);return be}}},Se.lheading=function(ce){var de=this.rules.block.lheading.exec(ce);if(de)return{type:"heading",raw:de[0],depth:de[2].charAt(0)==="="?1:2,text:de[1]}},Se.paragraph=function(ce){var de=this.rules.block.paragraph.exec(ce);if(de)return{type:"paragraph",raw:de[0],text:de[1].charAt(de[1].length-1)===`
`?de[1].slice(0,-1):de[1]}},Se.text=function(ce,de){var be=this.rules.block.text.exec(ce);if(be){var je=de[de.length-1];return je&&je.type==="text"?{raw:be[0],text:be[0]}:{type:"text",raw:be[0],text:be[0]}}},Se.escape=function(ce){var de=this.rules.inline.escape.exec(ce);if(de)return{type:"escape",raw:de[0],text:X(de[1])}},Se.tag=function(ce,de,be){var je=this.rules.inline.tag.exec(ce);if(je)return!de&&/^<a /i.test(je[0])?de=!0:de&&/^<\/a>/i.test(je[0])&&(de=!1),!be&&/^<(pre|code|kbd|script)(\s|>)/i.test(je[0])?be=!0:be&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(je[0])&&(be=!1),{type:this.options.sanitize?"text":"html",raw:je[0],inLink:de,inRawBlock:be,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(je[0]):X(je[0]):je[0]}},Se.link=function(ce){var de=this.rules.inline.link.exec(ce);if(de){var be=te(de[2],"()");if(be>-1){var je=de[0].indexOf("!")===0?5:4,ze=je+de[1].length+be;de[2]=de[2].substring(0,be),de[0]=de[0].substring(0,ze).trim(),de[3]=""}var ut=de[2],Dt="";if(this.options.pedantic){var rn=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ut);rn?(ut=rn[1],Dt=rn[3]):Dt=""}else Dt=de[3]?de[3].slice(1,-1):"";ut=ut.trim().replace(/^<([\s\S]*)>$/,"$1");var mn=pe(de,{href:ut&&ut.replace(this.rules.inline._escapes,"$1"),title:Dt&&Dt.replace(this.rules.inline._escapes,"$1")},de[0]);return mn}},Se.reflink=function(ce,de){var be;if((be=this.rules.inline.reflink.exec(ce))||(be=this.rules.inline.nolink.exec(ce))){var je=(be[2]||be[1]).replace(/\s+/g," ");if(je=de[je.toLowerCase()],!je||!je.href){var ze=be[0].charAt(0);return{type:"text",raw:ze,text:ze}}var ut=pe(be,je,be[0]);return ut}},Se.strong=function(ce,de,be){be===void 0&&(be="");var je=this.rules.inline.strong.start.exec(ce);if(je&&(!je[1]||je[1]&&(be===""||this.rules.inline.punctuation.exec(be)))){de=de.slice(-1*ce.length);var ze=je[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ze.lastIndex=0;for(var ut;(je=ze.exec(de))!=null;)if(ut=this.rules.inline.strong.middle.exec(de.slice(0,je.index+3)),ut)return{type:"strong",raw:ce.slice(0,ut[0].length),text:ce.slice(2,ut[0].length-2)}}},Se.em=function(ce,de,be){be===void 0&&(be="");var je=this.rules.inline.em.start.exec(ce);if(je&&(!je[1]||je[1]&&(be===""||this.rules.inline.punctuation.exec(be)))){de=de.slice(-1*ce.length);var ze=je[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ze.lastIndex=0;for(var ut;(je=ze.exec(de))!=null;)if(ut=this.rules.inline.em.middle.exec(de.slice(0,je.index+2)),ut)return{type:"em",raw:ce.slice(0,ut[0].length),text:ce.slice(1,ut[0].length-1)}}},Se.codespan=function(ce){var de=this.rules.inline.code.exec(ce);if(de){var be=de[2].replace(/\n/g," "),je=/[^ ]/.test(be),ze=be.startsWith(" ")&&be.endsWith(" ");return je&&ze&&(be=be.substring(1,be.length-1)),be=X(be,!0),{type:"codespan",raw:de[0],text:be}}},Se.br=function(ce){var de=this.rules.inline.br.exec(ce);if(de)return{type:"br",raw:de[0]}},Se.del=function(ce){var de=this.rules.inline.del.exec(ce);if(de)return{type:"del",raw:de[0],text:de[1]}},Se.autolink=function(ce,de){var be=this.rules.inline.autolink.exec(ce);if(be){var je,ze;return be[2]==="@"?(je=X(this.options.mangle?de(be[1]):be[1]),ze="mailto:"+je):(je=X(be[1]),ze=je),{type:"link",raw:be[0],text:je,href:ze,tokens:[{type:"text",raw:je,text:je}]}}},Se.url=function(ce,de){var be;if(be=this.rules.inline.url.exec(ce)){var je,ze;if(be[2]==="@")je=X(this.options.mangle?de(be[0]):be[0]),ze="mailto:"+je;else{var ut;do ut=be[0],be[0]=this.rules.inline._backpedal.exec(be[0])[0];while(ut!==be[0]);je=X(be[0]),be[1]==="www."?ze="http://"+je:ze=je}return{type:"link",raw:be[0],text:je,href:ze,tokens:[{type:"text",raw:je,text:je}]}}},Se.inlineText=function(ce,de,be){var je=this.rules.inline.text.exec(ce);if(je){var ze;return de?ze=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(je[0]):X(je[0]):je[0]:ze=X(this.options.smartypants?be(je[0]):je[0]),{type:"text",raw:je[0],text:ze}}},Ve}(),Te=z.noopTest,We=z.edit,He=z.merge,Ce={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]+/};Ce._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,Ce._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,Ce.def=We(Ce.def).replace("label",Ce._label).replace("title",Ce._title).getRegex(),Ce.bullet=/(?:[*+-]|\d{1,9}[.)])/,Ce.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,Ce.item=We(Ce.item,"gm").replace(/bull/g,Ce.bullet).getRegex(),Ce.list=We(Ce.list).replace(/bull/g,Ce.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Ce.def.source+")").getRegex(),Ce._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",Ce._comment=/<!--(?!-?>)[\s\S]*?-->/,Ce.html=We(Ce.html,"i").replace("comment",Ce._comment).replace("tag",Ce._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ce.paragraph=We(Ce._paragraph).replace("hr",Ce.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",Ce._tag).getRegex(),Ce.blockquote=We(Ce.blockquote).replace("paragraph",Ce.paragraph).getRegex(),Ce.normal=He({},Ce),Ce.gfm=He({},Ce.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*|$)"}),Ce.gfm.nptable=We(Ce.gfm.nptable).replace("hr",Ce.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",Ce._tag).getRegex(),Ce.gfm.table=We(Ce.gfm.table).replace("hr",Ce.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",Ce._tag).getRegex(),Ce.pedantic=He({},Ce.normal,{html:We(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ce._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:We(Ce.normal._paragraph).replace("hr",Ce.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",Ce.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ue={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])/};ue._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ue.punctuation=We(ue.punctuation).replace(/punctuation/g,ue._punctuation).getRegex(),ue._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ue._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ue.em.start=We(ue.em.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.middle=We(ue.em.middle).replace(/punctuation/g,ue._punctuation).replace(/overlapSkip/g,ue._overlapSkip).getRegex(),ue.em.endAst=We(ue.em.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.endUnd=We(ue.em.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.start=We(ue.strong.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.middle=We(ue.strong.middle).replace(/punctuation/g,ue._punctuation).replace(/blockSkip/g,ue._blockSkip).getRegex(),ue.strong.endAst=We(ue.strong.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.endUnd=We(ue.strong.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.blockSkip=We(ue._blockSkip,"g").getRegex(),ue.overlapSkip=We(ue._overlapSkip,"g").getRegex(),ue._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ue._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ue._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])?)+(?![-_])/,ue.autolink=We(ue.autolink).replace("scheme",ue._scheme).replace("email",ue._email).getRegex(),ue._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ue.tag=We(ue.tag).replace("comment",Ce._comment).replace("attribute",ue._attribute).getRegex(),ue._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ue._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ue._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ue.link=We(ue.link).replace("label",ue._label).replace("href",ue._href).replace("title",ue._title).getRegex(),ue.reflink=We(ue.reflink).replace("label",ue._label).getRegex(),ue.reflinkSearch=We(ue.reflinkSearch,"g").replace("reflink",ue.reflink).replace("nolink",ue.nolink).getRegex(),ue.normal=He({},ue),ue.pedantic=He({},ue.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:We(/^!?\[(label)\]\((.*?)\)/).replace("label",ue._label).getRegex(),reflink:We(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ue._label).getRegex()}),ue.gfm=He({},ue.normal,{escape:We(ue.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),ue.gfm.url=We(ue.gfm.url,"i").replace("email",ue.gfm._extended_email).getRegex(),ue.breaks=He({},ue.gfm,{br:We(ue.br).replace("{2,}","*").getRegex(),text:We(ue.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var se={block:Ce,inline:ue},we=H.defaults,ge=se.block,Ke=se.inline;function st(Ve){return Ve.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 ne(Ve){var Se="",Pe,ce,de=Ve.length;for(Pe=0;Pe<de;Pe++)ce=Ve.charCodeAt(Pe),Math.random()>.5&&(ce="x"+ce.toString(16)),Se+="&#"+ce+";";return Se}var $=function(){function Ve(Pe){this.tokens=[],this.tokens.links=Object.create(null),this.options=Pe||we,this.options.tokenizer=this.options.tokenizer||new Ee,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ce={block:ge.normal,inline:Ke.normal};this.options.pedantic?(ce.block=ge.pedantic,ce.inline=Ke.pedantic):this.options.gfm&&(ce.block=ge.gfm,this.options.breaks?ce.inline=Ke.breaks:ce.inline=Ke.gfm),this.tokenizer.rules=ce}Ve.lex=function(ce,de){var be=new Ve(de);return be.lex(ce)};var Se=Ve.prototype;return Se.lex=function(ce){return ce=ce.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(ce,this.tokens,!0),this.inline(this.tokens),this.tokens},Se.blockTokens=function(ce,de,be){de===void 0&&(de=[]),be===void 0&&(be=!0),ce=ce.replace(/^ +$/gm,"");for(var je,ze,ut,Dt;ce;){if(je=this.tokenizer.space(ce)){ce=ce.substring(je.raw.length),je.type&&de.push(je);continue}if(je=this.tokenizer.code(ce,de)){ce=ce.substring(je.raw.length),je.type?de.push(je):(Dt=de[de.length-1],Dt.raw+=`
`+je.raw,Dt.text+=`
`+je.text);continue}if(je=this.tokenizer.fences(ce)){ce=ce.substring(je.raw.length),de.push(je);continue}if(je=this.tokenizer.heading(ce)){ce=ce.substring(je.raw.length),de.push(je);continue}if(je=this.tokenizer.nptable(ce)){ce=ce.substring(je.raw.length),de.push(je);continue}if(je=this.tokenizer.hr(ce)){ce=ce.substring(je.raw.length),de.push(je);continue}if(je=this.tokenizer.blockquote(ce)){ce=ce.substring(je.raw.length),je.tokens=this.blockTokens(je.text,[],be),de.push(je);continue}if(je=this.tokenizer.list(ce)){for(ce=ce.substring(je.raw.length),ut=je.items.length,ze=0;ze<ut;ze++)je.items[ze].tokens=this.blockTokens(je.items[ze].text,[],!1);de.push(je);continue}if(je=this.tokenizer.html(ce)){ce=ce.substring(je.raw.length),de.push(je);continue}if(be&&(je=this.tokenizer.def(ce))){ce=ce.substring(je.raw.length),this.tokens.links[je.tag]||(this.tokens.links[je.tag]={href:je.href,title:je.title});continue}if(je=this.tokenizer.table(ce)){ce=ce.substring(je.raw.length),de.push(je);continue}if(je=this.tokenizer.lheading(ce)){ce=ce.substring(je.raw.length),de.push(je);continue}if(be&&(je=this.tokenizer.paragraph(ce))){ce=ce.substring(je.raw.length),de.push(je);continue}if(je=this.tokenizer.text(ce,de)){ce=ce.substring(je.raw.length),je.type?de.push(je):(Dt=de[de.length-1],Dt.raw+=`
`+je.raw,Dt.text+=`
`+je.text);continue}if(ce){var rn="Infinite loop on byte: "+ce.charCodeAt(0);if(this.options.silent){console.error(rn);break}else throw new Error(rn)}}return de},Se.inline=function(ce){var de,be,je,ze,ut,Dt,rn=ce.length;for(de=0;de<rn;de++){Dt=ce[de];switch(Dt.type){case"paragraph":case"text":case"heading":{Dt.tokens=[],this.inlineTokens(Dt.text,Dt.tokens);break}case"table":{for(Dt.tokens={header:[],cells:[]},ze=Dt.header.length,be=0;be<ze;be++)Dt.tokens.header[be]=[],this.inlineTokens(Dt.header[be],Dt.tokens.header[be]);for(ze=Dt.cells.length,be=0;be<ze;be++)for(ut=Dt.cells[be],Dt.tokens.cells[be]=[],je=0;je<ut.length;je++)Dt.tokens.cells[be][je]=[],this.inlineTokens(ut[je],Dt.tokens.cells[be][je]);break}case"blockquote":{this.inline(Dt.tokens);break}case"list":{for(ze=Dt.items.length,be=0;be<ze;be++)this.inline(Dt.items[be].tokens);break}}}return ce},Se.inlineTokens=function(ce,de,be,je,ze){de===void 0&&(de=[]),be===void 0&&(be=!1),je===void 0&&(je=!1),ze===void 0&&(ze="");var ut,Dt=ce,rn;if(this.tokens.links){var mn=Object.keys(this.tokens.links);if(mn.length>0)for(;(rn=this.tokenizer.rules.inline.reflinkSearch.exec(Dt))!=null;)mn.includes(rn[0].slice(rn[0].lastIndexOf("[")+1,-1))&&(Dt=Dt.slice(0,rn.index)+"["+"a".repeat(rn[0].length-2)+"]"+Dt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(rn=this.tokenizer.rules.inline.blockSkip.exec(Dt))!=null;)Dt=Dt.slice(0,rn.index)+"["+"a".repeat(rn[0].length-2)+"]"+Dt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ce;){if(ut=this.tokenizer.escape(ce)){ce=ce.substring(ut.raw.length),de.push(ut);continue}if(ut=this.tokenizer.tag(ce,be,je)){ce=ce.substring(ut.raw.length),be=ut.inLink,je=ut.inRawBlock,de.push(ut);continue}if(ut=this.tokenizer.link(ce)){ce=ce.substring(ut.raw.length),ut.type==="link"&&(ut.tokens=this.inlineTokens(ut.text,[],!0,je)),de.push(ut);continue}if(ut=this.tokenizer.reflink(ce,this.tokens.links)){ce=ce.substring(ut.raw.length),ut.type==="link"&&(ut.tokens=this.inlineTokens(ut.text,[],!0,je)),de.push(ut);continue}if(ut=this.tokenizer.strong(ce,Dt,ze)){ce=ce.substring(ut.raw.length),ut.tokens=this.inlineTokens(ut.text,[],be,je),de.push(ut);continue}if(ut=this.tokenizer.em(ce,Dt,ze)){ce=ce.substring(ut.raw.length),ut.tokens=this.inlineTokens(ut.text,[],be,je),de.push(ut);continue}if(ut=this.tokenizer.codespan(ce)){ce=ce.substring(ut.raw.length),de.push(ut);continue}if(ut=this.tokenizer.br(ce)){ce=ce.substring(ut.raw.length),de.push(ut);continue}if(ut=this.tokenizer.del(ce)){ce=ce.substring(ut.raw.length),ut.tokens=this.inlineTokens(ut.text,[],be,je),de.push(ut);continue}if(ut=this.tokenizer.autolink(ce,ne)){ce=ce.substring(ut.raw.length),de.push(ut);continue}if(!be&&(ut=this.tokenizer.url(ce,ne))){ce=ce.substring(ut.raw.length),de.push(ut);continue}if(ut=this.tokenizer.inlineText(ce,je,st)){ce=ce.substring(ut.raw.length),ze=ut.raw.slice(-1),de.push(ut);continue}if(ce){var gt="Infinite loop on byte: "+ce.charCodeAt(0);if(this.options.silent){console.error(gt);break}else throw new Error(gt)}}return de},Y(Ve,null,[{key:"rules",get:function(){return{block:ge,inline:Ke}}}]),Ve}(),J=H.defaults,me=z.cleanUrl,xe=z.escape,ke=function(){function Ve(Pe){this.options=Pe||J}var Se=Ve.prototype;return Se.code=function(ce,de,be){var je=(de||"").match(/\S*/)[0];if(this.options.highlight){var ze=this.options.highlight(ce,je);ze!=null&&ze!==ce&&(be=!0,ce=ze)}return je?'<pre><code class="'+this.options.langPrefix+xe(je,!0)+'">'+(be?ce:xe(ce,!0))+`</code></pre>
`:"<pre><code>"+(be?ce:xe(ce,!0))+`</code></pre>
`},Se.blockquote=function(ce){return`<blockquote>
`+ce+`</blockquote>
`},Se.html=function(ce){return ce},Se.heading=function(ce,de,be,je){return this.options.headerIds?"<h"+de+' id="'+this.options.headerPrefix+je.slug(be)+'">'+ce+"</h"+de+`>
`:"<h"+de+">"+ce+"</h"+de+`>
`},Se.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},Se.list=function(ce,de,be){var je=de?"ol":"ul",ze=de&&be!==1?' start="'+be+'"':"";return"<"+je+ze+`>
`+ce+"</"+je+`>
`},Se.listitem=function(ce){return"<li>"+ce+`</li>
`},Se.checkbox=function(ce){return"<input "+(ce?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Se.paragraph=function(ce){return"<p>"+ce+`</p>
`},Se.table=function(ce,de){return de&&(de="<tbody>"+de+"</tbody>"),`<table>
<thead>
`+ce+`</thead>
`+de+`</table>
`},Se.tablerow=function(ce){return`<tr>
`+ce+`</tr>
`},Se.tablecell=function(ce,de){var be=de.header?"th":"td",je=de.align?"<"+be+' align="'+de.align+'">':"<"+be+">";return je+ce+"</"+be+`>
`},Se.strong=function(ce){return"<strong>"+ce+"</strong>"},Se.em=function(ce){return"<em>"+ce+"</em>"},Se.codespan=function(ce){return"<code>"+ce+"</code>"},Se.br=function(){return this.options.xhtml?"<br/>":"<br>"},Se.del=function(ce){return"<del>"+ce+"</del>"},Se.link=function(ce,de,be){if(ce=me(this.options.sanitize,this.options.baseUrl,ce),ce===null)return be;var je='<a href="'+xe(ce)+'"';return de&&(je+=' title="'+de+'"'),je+=">"+be+"</a>",je},Se.image=function(ce,de,be){if(ce=me(this.options.sanitize,this.options.baseUrl,ce),ce===null)return be;var je='<img src="'+ce+'" alt="'+be+'"';return de&&(je+=' title="'+de+'"'),je+=this.options.xhtml?"/>":">",je},Se.text=function(ce){return ce},Ve}(),$e=function(){function Ve(){}var Se=Ve.prototype;return Se.strong=function(ce){return ce},Se.em=function(ce){return ce},Se.codespan=function(ce){return ce},Se.del=function(ce){return ce},Se.html=function(ce){return ce},Se.text=function(ce){return ce},Se.link=function(ce,de,be){return""+be},Se.image=function(ce,de,be){return""+be},Se.br=function(){return""},Ve}(),Pt=function(){function Ve(){this.seen={}}var Se=Ve.prototype;return Se.slug=function(ce){var de=ce.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(de)){var be=de;do this.seen[be]++,de=be+"-"+this.seen[be];while(this.seen.hasOwnProperty(de))}return this.seen[de]=0,de},Ve}(),Xt=H.defaults,Bt=z.unescape,lt=function(){function Ve(Pe){this.options=Pe||Xt,this.options.renderer=this.options.renderer||new ke,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new $e,this.slugger=new Pt}Ve.parse=function(ce,de){var be=new Ve(de);return be.parse(ce)};var Se=Ve.prototype;return Se.parse=function(ce,de){de===void 0&&(de=!0);var be="",je,ze,ut,Dt,rn,mn,gt,Vt,Tt,Rt,mt,_e,Ge,kt,vt,Qt,Jt,Le,tt=ce.length;for(je=0;je<tt;je++){Rt=ce[je];switch(Rt.type){case"space":continue;case"hr":{be+=this.renderer.hr();continue}case"heading":{be+=this.renderer.heading(this.parseInline(Rt.tokens),Rt.depth,Bt(this.parseInline(Rt.tokens,this.textRenderer)),this.slugger);continue}case"code":{be+=this.renderer.code(Rt.text,Rt.lang,Rt.escaped);continue}case"table":{for(Vt="",gt="",Dt=Rt.header.length,ze=0;ze<Dt;ze++)gt+=this.renderer.tablecell(this.parseInline(Rt.tokens.header[ze]),{header:!0,align:Rt.align[ze]});for(Vt+=this.renderer.tablerow(gt),Tt="",Dt=Rt.cells.length,ze=0;ze<Dt;ze++){for(mn=Rt.tokens.cells[ze],gt="",rn=mn.length,ut=0;ut<rn;ut++)gt+=this.renderer.tablecell(this.parseInline(mn[ut]),{header:!1,align:Rt.align[ut]});Tt+=this.renderer.tablerow(gt)}be+=this.renderer.table(Vt,Tt);continue}case"blockquote":{Tt=this.parse(Rt.tokens),be+=this.renderer.blockquote(Tt);continue}case"list":{for(mt=Rt.ordered,_e=Rt.start,Ge=Rt.loose,Dt=Rt.items.length,Tt="",ze=0;ze<Dt;ze++)vt=Rt.items[ze],Qt=vt.checked,Jt=vt.task,kt="",vt.task&&(Le=this.renderer.checkbox(Qt),Ge?vt.tokens.length>0&&vt.tokens[0].type==="text"?(vt.tokens[0].text=Le+" "+vt.tokens[0].text,vt.tokens[0].tokens&&vt.tokens[0].tokens.length>0&&vt.tokens[0].tokens[0].type==="text"&&(vt.tokens[0].tokens[0].text=Le+" "+vt.tokens[0].tokens[0].text)):vt.tokens.unshift({type:"text",text:Le}):kt+=Le),kt+=this.parse(vt.tokens,Ge),Tt+=this.renderer.listitem(kt,Jt,Qt);be+=this.renderer.list(Tt,mt,_e);continue}case"html":{be+=this.renderer.html(Rt.text);continue}case"paragraph":{be+=this.renderer.paragraph(this.parseInline(Rt.tokens));continue}case"text":{for(Tt=Rt.tokens?this.parseInline(Rt.tokens):Rt.text;je+1<tt&&ce[je+1].type==="text";)Rt=ce[++je],Tt+=`
`+(Rt.tokens?this.parseInline(Rt.tokens):Rt.text);be+=de?this.renderer.paragraph(Tt):Tt;continue}default:{var Lt='Token with "'+Rt.type+'" type was not found.';if(this.options.silent){console.error(Lt);return}else throw new Error(Lt)}}}return be},Se.parseInline=function(ce,de){de=de||this.renderer;var be="",je,ze,ut=ce.length;for(je=0;je<ut;je++){ze=ce[je];switch(ze.type){case"escape":{be+=de.text(ze.text);break}case"html":{be+=de.html(ze.text);break}case"link":{be+=de.link(ze.href,ze.title,this.parseInline(ze.tokens,de));break}case"image":{be+=de.image(ze.href,ze.title,ze.text);break}case"strong":{be+=de.strong(this.parseInline(ze.tokens,de));break}case"em":{be+=de.em(this.parseInline(ze.tokens,de));break}case"codespan":{be+=de.codespan(ze.text);break}case"br":{be+=de.br();break}case"del":{be+=de.del(this.parseInline(ze.tokens,de));break}case"text":{be+=de.text(ze.text);break}default:{var Dt='Token with "'+ze.type+'" type was not found.';if(this.options.silent){console.error(Dt);return}else throw new Error(Dt)}}}return be},Ve}(),jt=z.merge,pn=z.checkSanitizeDeprecation,it=z.escape,Ze=H.getDefaults,bt=H.changeDefaults,Mt=H.defaults;function ct(Ve,Se,Pe){if(typeof Ve=="undefined"||Ve===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Ve!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Ve)+", string expected");if(typeof Se=="function"&&(Pe=Se,Se=null),Se=jt({},ct.defaults,Se||{}),pn(Se),Pe){var ce=Se.highlight,de;try{de=$.lex(Ve,Se)}catch(ut){return Pe(ut)}var be=function(Dt){var rn;if(!Dt)try{rn=lt.parse(de,Se)}catch(mn){Dt=mn}return Se.highlight=ce,Dt?Pe(Dt):Pe(null,rn)};if(!ce||ce.length<3)return be();if(delete Se.highlight,!de.length)return be();var je=0;ct.walkTokens(de,function(ut){ut.type==="code"&&(je++,setTimeout(function(){ce(ut.text,ut.lang,function(Dt,rn){if(Dt)return be(Dt);rn!=null&&rn!==ut.text&&(ut.text=rn,ut.escaped=!0),je--,je===0&&be()})},0))}),je===0&&be();return}try{var ze=$.lex(Ve,Se);return Se.walkTokens&&ct.walkTokens(ze,Se.walkTokens),lt.parse(ze,Se)}catch(ut){if(ut.message+=`
Please report this to https://github.com/markedjs/marked.`,Se.silent)return"<p>An error occurred:</p><pre>"+it(ut.message+"",!0)+"</pre>";throw ut}}ct.options=ct.setOptions=function(Ve){return jt(ct.defaults,Ve),bt(ct.defaults),ct},ct.getDefaults=Ze,ct.defaults=Mt,ct.use=function(Ve){var Se=jt({},Ve);if(Ve.renderer&&function(){var ce=ct.defaults.renderer||new ke,de=function(ze){var ut=ce[ze];ce[ze]=function(){for(var Dt=arguments.length,rn=new Array(Dt),mn=0;mn<Dt;mn++)rn[mn]=arguments[mn];var gt=Ve.renderer[ze].apply(ce,rn);return gt===!1&&(gt=ut.apply(ce,rn)),gt}};for(var be in Ve.renderer)de(be);Se.renderer=ce}(),Ve.tokenizer&&function(){var ce=ct.defaults.tokenizer||new Ee,de=function(ze){var ut=ce[ze];ce[ze]=function(){for(var Dt=arguments.length,rn=new Array(Dt),mn=0;mn<Dt;mn++)rn[mn]=arguments[mn];var gt=Ve.tokenizer[ze].apply(ce,rn);return gt===!1&&(gt=ut.apply(ce,rn)),gt}};for(var be in Ve.tokenizer)de(be);Se.tokenizer=ce}(),Ve.walkTokens){var Pe=ct.defaults.walkTokens;Se.walkTokens=function(ce){Ve.walkTokens(ce),Pe&&Pe(ce)}}ct.setOptions(Se)},ct.walkTokens=function(Ve,Se){for(var Pe=L(Ve),ce;!(ce=Pe()).done;){var de=ce.value;Se(de);switch(de.type){case"table":{for(var be=L(de.tokens.header),je;!(je=be()).done;){var ze=je.value;ct.walkTokens(ze,Se)}for(var ut=L(de.tokens.cells),Dt;!(Dt=ut()).done;)for(var rn=Dt.value,mn=L(rn),gt;!(gt=mn()).done;){var Vt=gt.value;ct.walkTokens(Vt,Se)}break}case"list":{ct.walkTokens(de.items,Se);break}default:de.tokens&&ct.walkTokens(de.tokens,Se)}}},ct.Parser=lt,ct.parser=lt.parse,ct.Renderer=ke,ct.TextRenderer=$e,ct.Lexer=$,ct.lexer=$.lex,ct.Tokenizer=Ee,ct.Slugger=Pt,ct.parse=ct;var wt=ct;return wt})},ELLl:function(Gt,et,k){(function(re){re(k("VrN/"))})(function(re){var Y={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},j=re.Pos;re.defineOption("autoCloseBrackets",!1,function(n,a,l){l&&l!=re.Init&&(n.removeKeyMap(L),n.state.closeBrackets=null),a&&(P(G(a,"pairs")),n.state.closeBrackets=a,n.addKeyMap(L))});function G(n,a){return a=="pairs"&&typeof n=="string"?n:typeof n=="object"&&n[a]!=null?n[a]:Y[a]}var L={Backspace:I,Enter:x};function P(n){for(var a=0;a<n.length;a++){var l=n.charAt(a),s="'"+l+"'";L[s]||(L[s]=H(l))}}P(Y.pairs+"`");function H(n){return function(a){return m(a,n)}}function O(n){var a=n.state.closeBrackets;if(!a||a.override)return a;var l=n.getModeAt(n.getCursor());return l.closeBrackets||a}function I(n){var a=O(n);if(!a||n.getOption("disableInput"))return re.Pass;for(var l=G(a,"pairs"),s=n.listSelections(),u=0;u<s.length;u++){if(!s[u].empty())return re.Pass;var c=h(n,s[u].head);if(!c||l.indexOf(c)%2!=0)return re.Pass}for(var u=s.length-1;u>=0;u--){var R=s[u].head;n.replaceRange("",j(R.line,R.ch-1),j(R.line,R.ch+1),"+delete")}}function x(n){var a=O(n),l=a&&G(a,"explode");if(!l||n.getOption("disableInput"))return re.Pass;for(var s=n.listSelections(),u=0;u<s.length;u++){if(!s[u].empty())return re.Pass;var c=h(n,s[u].head);if(!c||l.indexOf(c)%2!=0)return re.Pass}n.operation(function(){var R=n.lineSeparator()||`
`;n.replaceSelection(R+R,null),n.execCommand("goCharLeft"),s=n.listSelections();for(var w=0;w<s.length;w++){var C=s[w].head.line;n.indentLine(C,null,!0),n.indentLine(C+1,null,!0)}})}function p(n){var a=re.cmpPos(n.anchor,n.head)>0;return{anchor:new j(n.anchor.line,n.anchor.ch+(a?-1:1)),head:new j(n.head.line,n.head.ch+(a?1:-1))}}function m(n,a){var l=O(n);if(!l||n.getOption("disableInput"))return re.Pass;var s=G(l,"pairs"),u=s.indexOf(a);if(u==-1)return re.Pass;for(var c=G(l,"closeBefore"),R=G(l,"triples"),w=s.charAt(u+1)==a,C=n.listSelections(),D=u%2==0,S,b=0;b<C.length;b++){var _=C[b],f=_.head,d,g=n.getRange(f,j(f.line,f.ch+1));if(D&&!_.empty())d="surround";else if((w||!D)&&g==a)w&&r(n,f)?d="both":R.indexOf(a)>=0&&n.getRange(f,j(f.line,f.ch+3))==a+a+a?d="skipThree":d="skip";else if(w&&f.ch>1&&R.indexOf(a)>=0&&n.getRange(j(f.line,f.ch-2),f)==a+a){if(f.ch>2&&/\bstring/.test(n.getTokenTypeAt(j(f.line,f.ch-2))))return re.Pass;d="addFour"}else if(w){var E=f.ch==0?" ":n.getRange(j(f.line,f.ch-1),f);if(!re.isWordChar(g)&&E!=a&&!re.isWordChar(E))d="both";else return re.Pass}else if(D&&(g.length===0||/\s/.test(g)||c.indexOf(g)>-1))d="both";else return re.Pass;if(!S)S=d;else if(S!=d)return re.Pass}var T=u%2?s.charAt(u-1):a,F=u%2?a:s.charAt(u+1);n.operation(function(){if(S=="skip")n.execCommand("goCharRight");else if(S=="skipThree")for(var U=0;U<3;U++)n.execCommand("goCharRight");else if(S=="surround"){for(var K=n.getSelections(),U=0;U<K.length;U++)K[U]=T+K[U]+F;n.replaceSelections(K,"around"),K=n.listSelections().slice();for(var U=0;U<K.length;U++)K[U]=p(K[U]);n.setSelections(K)}else S=="both"?(n.replaceSelection(T+F,null),n.triggerElectric(T+F),n.execCommand("goCharLeft")):S=="addFour"&&(n.replaceSelection(T+T+T+T,"before"),n.execCommand("goCharRight"))})}function h(n,a){var l=n.getRange(j(a.line,a.ch-1),j(a.line,a.ch+1));return l.length==2?l:null}function r(n,a){var l=n.getTokenAt(j(a.line,a.ch+1));return/\bstring/.test(l.type)&&l.start==a.ch&&(a.ch==0||!/\bstring/.test(n.getTokenTypeAt(a)))}})},FOrL:function(Gt,et,k){Gt.exports=k.p+"static/nodata.a6b3f948.png"},GUfm:function(Gt,et,k){Gt.exports={wrap:"wrap___2nb3E",MdEditor:"MdEditor___1glSN",workListButtonWrap:"workListButtonWrap___2I8CU",anticon:"anticon___Xuf4M",workListClass:"workListClass___2ETig",left:"left___w3OLq",visible:"visible___10L9C",status:"status___3sIxf",tips:"tips___1c8cd",tableWrapper:"tableWrapper___2w4Cd"}},GfqC:function(Gt,et,k){"use strict";var re=k("q1tI"),Y=k.n(re),j=k("TSYQ"),G=k.n(j);function L(z,M){var y="cannot "+z.method+" "+z.action+" "+M.status+"'",W=new Error(y);return W.status=M.status,W.method=z.method,W.url=z.action,W}function P(z){var M=z.responseText||z.response;if(!M)return M;try{return JSON.parse(M)}catch(y){return M}}function H(z){var M=new XMLHttpRequest;z.onProgress&&M.upload&&(M.upload.onprogress=function(te){te.total>0&&(te.percent=te.loaded/te.total*100),z.onProgress(te)});var y=new FormData;z.data&&Object.keys(z.data).forEach(function(X){var te=z.data[X];if(Array.isArray(te)){te.forEach(function(pe){y.append(X+"[]",pe)});return}y.append(X,z.data[X])}),z.file instanceof Blob?y.append(z.filename,z.file,z.file.name):y.append(z.filename,z.file),M.onerror=function(te){z.onError(te)},M.onload=function(){return M.status<200||M.status>=300?z.onError(L(z,M),P(M)):z.onSuccess(P(M),M)},M.open(z.method,z.action,!0),z.withCredentials&&"withCredentials"in M&&(M.withCredentials=!0);var W=z.headers||{};return W["X-Requested-With"]!==null&&M.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(W).forEach(function(X){W[X]!==null&&M.setRequestHeader(X,W[X])}),M.send(y),{abort:function(){M.abort()}}}var O=+new Date,I=0;function x(){return"rc-upload-"+O+"-"+ ++I}function p(z,M){return z.indexOf(M,z.length-M.length)!==-1}var m=function(z,M){if(z&&M){var y=Array.isArray(M)?M:M.split(","),W=z.name||"",X=z.type||"",te=X.replace(/\/.*$/,"");return y.some(function(pe){var Ie=pe.trim();return Ie.charAt(0)==="."?p(W.toLowerCase(),Ie.toLowerCase()):/\/\*$/.test(Ie)?te===Ie.replace(/\/.*$/,""):X===Ie})}return!0};function h(z,M){var y=z.createReader(),W=[];function X(){y.readEntries(function(te){var pe=Array.prototype.slice.apply(te);W=W.concat(pe);var Ie=!pe.length;Ie?M(W):X()})}X()}var r=function(M,y,W){var X=function te(pe,Ie){Ie=Ie||"",pe.isFile?pe.file(function(Ee){W(Ee)&&(pe.fullPath&&!Ee.webkitRelativePath&&(Object.defineProperties(Ee,{webkitRelativePath:{writable:!0}}),Ee.webkitRelativePath=pe.fullPath.replace(/^\//,""),Object.defineProperties(Ee,{webkitRelativePath:{writable:!1}})),y([Ee]))}):pe.isDirectory&&h(pe,function(Ee){Ee.forEach(function(Te){te(Te,""+Ie+pe.name+"/")})})};M.forEach(function(te){X(te.webkitGetAsEntry())})},n=r,a=Object.assign||function(z){for(var M=1;M<arguments.length;M++){var y=arguments[M];for(var W in y)Object.prototype.hasOwnProperty.call(y,W)&&(z[W]=y[W])}return z},l=function(){function z(M,y){var W=[],X=!0,te=!1,pe=void 0;try{for(var Ie=M[Symbol.iterator](),Ee;!(X=(Ee=Ie.next()).done)&&!(W.push(Ee.value),y&&W.length===y);X=!0);}catch(Te){te=!0,pe=Te}finally{try{!X&&Ie.return&&Ie.return()}finally{if(te)throw pe}}return W}return function(M,y){if(Array.isArray(M))return M;if(Symbol.iterator in Object(M))return z(M,y);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function z(M,y){for(var W=0;W<y.length;W++){var X=y[W];X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X&&(X.writable=!0),Object.defineProperty(M,X.key,X)}}return function(M,y,W){return y&&z(M.prototype,y),W&&z(M,W),M}}();function u(z,M,y){return M in z?Object.defineProperty(z,M,{value:y,enumerable:!0,configurable:!0,writable:!0}):z[M]=y,z}function c(z,M){var y={};for(var W in z){if(M.indexOf(W)>=0)continue;if(!Object.prototype.hasOwnProperty.call(z,W))continue;y[W]=z[W]}return y}function R(z,M){if(!(z instanceof M))throw new TypeError("Cannot call a class as a function")}function w(z,M){if(!z)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M&&(typeof M=="object"||typeof M=="function")?M:z}function C(z,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof M);z.prototype=Object.create(M&&M.prototype,{constructor:{value:z,enumerable:!1,writable:!0,configurable:!0}}),M&&(Object.setPrototypeOf?Object.setPrototypeOf(z,M):z.__proto__=M)}var D=function(M){return Object.keys(M).reduce(function(y,W){return(W.substr(0,5)==="data-"||W.substr(0,5)==="aria-"||W==="role")&&(y[W]=M[W]),y},{})},S=function(z){C(M,z);function M(){var y,W,X,te;R(this,M);for(var pe=arguments.length,Ie=Array(pe),Ee=0;Ee<pe;Ee++)Ie[Ee]=arguments[Ee];return te=(W=(X=w(this,(y=M.__proto__||Object.getPrototypeOf(M)).call.apply(y,[this].concat(Ie))),X),X.state={uid:x()},X.reqs={},X.onChange=function(Te){var We=Te.target.files;X.uploadFiles(We),X.reset()},X.onClick=function(Te){var We=X.fileInput;if(!We)return;var He=X.props,Ce=He.children,ue=He.onClick;Ce&&Ce.type==="button"&&(We.parentNode.focus(),We.parentNode.querySelector("button").blur()),We.click(),ue&&ue(Te)},X.onKeyDown=function(Te){Te.key==="Enter"&&X.onClick()},X.onFileDrop=function(Te){var We=X.props.multiple;if(Te.preventDefault(),Te.type==="dragover")return;if(X.props.directory)n(Array.prototype.slice.call(Te.dataTransfer.items),X.uploadFiles,function(Ce){return m(Ce,X.props.accept)});else{var He=Array.prototype.slice.call(Te.dataTransfer.files).filter(function(Ce){return m(Ce,X.props.accept)});We===!1&&(He=He.slice(0,1)),X.uploadFiles(He)}},X.uploadFiles=function(Te){var We=Array.prototype.slice.call(Te);We.map(function(He){return He.uid=x(),He}).forEach(function(He){X.upload(He,We)})},X.saveFileInput=function(Te){X.fileInput=Te},W),w(X,te)}return s(M,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(W,X){var te=this,pe=this.props;if(!pe.beforeUpload)return setTimeout(function(){return te.post(W)},0);var Ie=pe.beforeUpload(W,X);Ie&&Ie.then?Ie.then(function(Ee){var Te=Object.prototype.toString.call(Ee);return Te==="[object File]"||Te==="[object Blob]"?te.post(Ee):te.post(W)}).catch(function(Ee){console.log(Ee)}):Ie!==!1&&setTimeout(function(){return te.post(W)},0);return}},{key:"post",value:function(W){var X=this;if(!this._isMounted)return;var te=this.props,pe=te.onStart,Ie=te.onProgress,Ee=te.transformFile,Te=Ee===void 0?function(We){return We}:Ee;new Promise(function(We){var He=te.action;return typeof He=="function"&&(He=He(W)),We(He)}).then(function(We){var He=W.uid,Ce=te.customRequest||H,ue=Promise.resolve(Te(W)).then(function(se){var we=te.data;return typeof we=="function"&&(we=we(se)),Promise.all([se,we])}).catch(function(se){console.error(se)});ue.then(function(se){var we=l(se,2),ge=we[0],Ke=we[1],st={action:We,filename:te.name,data:Ke,file:ge,headers:te.headers,withCredentials:te.withCredentials,method:te.method||"post",onProgress:Ie?function(ne){Ie(ne,W)}:null,onSuccess:function($,J){delete X.reqs[He],te.onSuccess($,W,J)},onError:function($,J){delete X.reqs[He],te.onError($,J,W)}};pe(W),X.reqs[He]=Ce(st)})})}},{key:"reset",value:function(){this.setState({uid:x()})}},{key:"abort",value:function(W){var X=this.reqs;if(W){var te=W;W&&W.uid&&(te=W.uid),X[te]&&X[te].abort&&X[te].abort(),delete X[te]}else Object.keys(X).forEach(function(pe){X[pe]&&X[pe].abort&&X[pe].abort(),delete X[pe]})}},{key:"render",value:function(){var W,X=this.props,te=X.component,pe=X.prefixCls,Ie=X.className,Ee=X.disabled,Te=X.id,We=X.style,He=X.multiple,Ce=X.accept,ue=X.children,se=X.directory,we=X.openFileDialogOnClick,ge=X.onMouseEnter,Ke=X.onMouseLeave,st=c(X,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),ne=G()((W={},u(W,pe,!0),u(W,pe+"-disabled",Ee),u(W,Ie,Ie),W)),$=Ee?{}:{onClick:we?this.onClick:function(){},onKeyDown:we?this.onKeyDown:function(){},onMouseEnter:ge,onMouseLeave:Ke,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return Y.a.createElement(te,a({},$,{className:ne,role:"button",style:We}),Y.a.createElement("input",a({},D(st),{id:Te,type:"file",ref:this.saveFileInput,onClick:function(me){return me.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:Ce,directory:se?"directory":null,webkitdirectory:se?"webkitdirectory":null,multiple:He,onChange:this.onChange})),ue)}}]),M}(re.Component),b=S,_=Object.assign||function(z){for(var M=1;M<arguments.length;M++){var y=arguments[M];for(var W in y)Object.prototype.hasOwnProperty.call(y,W)&&(z[W]=y[W])}return z},f=function(){function z(M,y){for(var W=0;W<y.length;W++){var X=y[W];X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X&&(X.writable=!0),Object.defineProperty(M,X.key,X)}}return function(M,y,W){return y&&z(M.prototype,y),W&&z(M,W),M}}();function d(z,M){if(!(z instanceof M))throw new TypeError("Cannot call a class as a function")}function g(z,M){if(!z)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M&&(typeof M=="object"||typeof M=="function")?M:z}function E(z,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof M);z.prototype=Object.create(M&&M.prototype,{constructor:{value:z,enumerable:!1,writable:!0,configurable:!0}}),M&&(Object.setPrototypeOf?Object.setPrototypeOf(z,M):z.__proto__=M)}function T(){}var F=function(z){E(M,z);function M(){var y,W,X,te;d(this,M);for(var pe=arguments.length,Ie=Array(pe),Ee=0;Ee<pe;Ee++)Ie[Ee]=arguments[Ee];return te=(W=(X=g(this,(y=M.__proto__||Object.getPrototypeOf(M)).call.apply(y,[this].concat(Ie))),X),X.saveUploader=function(Te){X.uploader=Te},W),g(X,te)}return f(M,[{key:"abort",value:function(W){this.uploader.abort(W)}},{key:"render",value:function(){return Y.a.createElement(b,_({},this.props,{ref:this.saveUploader}))}}]),M}(re.Component);F.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:T,onError:T,onSuccess:T,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var U=F,K=et.a=U},Gytx:function(Gt,et){Gt.exports=function(re,Y,j,G){var L=j?j.call(G,re,Y):void 0;if(L!==void 0)return!!L;if(re===Y)return!0;if(typeof re!="object"||!re||typeof Y!="object"||!Y)return!1;var P=Object.keys(re),H=Object.keys(Y);if(P.length!==H.length)return!1;for(var O=Object.prototype.hasOwnProperty.bind(Y),I=0;I<P.length;I++){var x=P[I];if(!O(x))return!1;var p=re[x],m=Y[x];if(L=j?j.call(G,p,m,x):void 0,L===!1||L===void 0&&p!==m)return!1}return!0}},H7XF:function(Gt,et,k){"use strict";et.byteLength=O,et.toByteArray=x,et.fromByteArray=h;for(var re=[],Y=[],j=typeof Uint8Array!="undefined"?Uint8Array:Array,G="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",L=0,P=G.length;L<P;++L)re[L]=G[L],Y[G.charCodeAt(L)]=L;Y["-".charCodeAt(0)]=62,Y["_".charCodeAt(0)]=63;function H(r){var n=r.length;if(n%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var a=r.indexOf("=");a===-1&&(a=n);var l=a===n?0:4-a%4;return[a,l]}function O(r){var n=H(r),a=n[0],l=n[1];return(a+l)*3/4-l}function I(r,n,a){return(n+a)*3/4-a}function x(r){var n,a=H(r),l=a[0],s=a[1],u=new j(I(r,l,s)),c=0,R=s>0?l-4:l,w;for(w=0;w<R;w+=4)n=Y[r.charCodeAt(w)]<<18|Y[r.charCodeAt(w+1)]<<12|Y[r.charCodeAt(w+2)]<<6|Y[r.charCodeAt(w+3)],u[c++]=n>>16&255,u[c++]=n>>8&255,u[c++]=n&255;return s===2&&(n=Y[r.charCodeAt(w)]<<2|Y[r.charCodeAt(w+1)]>>4,u[c++]=n&255),s===1&&(n=Y[r.charCodeAt(w)]<<10|Y[r.charCodeAt(w+1)]<<4|Y[r.charCodeAt(w+2)]>>2,u[c++]=n>>8&255,u[c++]=n&255),u}function p(r){return re[r>>18&63]+re[r>>12&63]+re[r>>6&63]+re[r&63]}function m(r,n,a){for(var l,s=[],u=n;u<a;u+=3)l=(r[u]<<16&16711680)+(r[u+1]<<8&65280)+(r[u+2]&255),s.push(p(l));return s.join("")}function h(r){for(var n,a=r.length,l=a%3,s=[],u=16383,c=0,R=a-l;c<R;c+=u)s.push(m(r,c,c+u>R?R:c+u));return l===1?(n=r[a-1],s.push(re[n>>2]+re[n<<4&63]+"==")):l===2&&(n=(r[a-2]<<8)+r[a-1],s.push(re[n>>10]+re[n>>4&63]+re[n<<2&63]+"=")),s.join("")}},HDXh:function(Gt,et,k){"use strict";(function(re){/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <http://feross.org>
* @license MIT
*/var Y=k("H7XF"),j=k("kVK+"),G=k("49sm");et.Buffer=O,et.SlowBuffer=s,et.INSPECT_MAX_BYTES=50,O.TYPED_ARRAY_SUPPORT=re.TYPED_ARRAY_SUPPORT!==void 0?re.TYPED_ARRAY_SUPPORT:L(),et.kMaxLength=P();function L(){try{var ne=new Uint8Array(1);return ne.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},ne.foo()===42&&typeof ne.subarray=="function"&&ne.subarray(1,1).byteLength===0}catch($){return!1}}function P(){return O.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function H(ne,$){if(P()<$)throw new RangeError("Invalid typed array length");return O.TYPED_ARRAY_SUPPORT?(ne=new Uint8Array($),ne.__proto__=O.prototype):(ne===null&&(ne=new O($)),ne.length=$),ne}function O(ne,$,J){if(!O.TYPED_ARRAY_SUPPORT&&!(this instanceof O))return new O(ne,$,J);if(typeof ne=="number"){if(typeof $=="string")throw new Error("If encoding is specified then the first argument must be a string");return m(this,ne)}return I(this,ne,$,J)}O.poolSize=8192,O._augment=function(ne){return ne.__proto__=O.prototype,ne};function I(ne,$,J,me){if(typeof $=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&$ instanceof ArrayBuffer?n(ne,$,J,me):typeof $=="string"?h(ne,$,J):a(ne,$)}O.from=function(ne,$,J){return I(null,ne,$,J)},O.TYPED_ARRAY_SUPPORT&&(O.prototype.__proto__=Uint8Array.prototype,O.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&O[Symbol.species]===O&&Object.defineProperty(O,Symbol.species,{value:null,configurable:!0}));function x(ne){if(typeof ne!="number")throw new TypeError('"size" argument must be a number');if(ne<0)throw new RangeError('"size" argument must not be negative')}function p(ne,$,J,me){return x($),$<=0?H(ne,$):J!==void 0?typeof me=="string"?H(ne,$).fill(J,me):H(ne,$).fill(J):H(ne,$)}O.alloc=function(ne,$,J){return p(null,ne,$,J)};function m(ne,$){if(x($),ne=H(ne,$<0?0:l($)|0),!O.TYPED_ARRAY_SUPPORT)for(var J=0;J<$;++J)ne[J]=0;return ne}O.allocUnsafe=function(ne){return m(null,ne)},O.allocUnsafeSlow=function(ne){return m(null,ne)};function h(ne,$,J){if((typeof J!="string"||J==="")&&(J="utf8"),!O.isEncoding(J))throw new TypeError('"encoding" must be a valid string encoding');var me=u($,J)|0;ne=H(ne,me);var xe=ne.write($,J);return xe!==me&&(ne=ne.slice(0,xe)),ne}function r(ne,$){var J=$.length<0?0:l($.length)|0;ne=H(ne,J);for(var me=0;me<J;me+=1)ne[me]=$[me]&255;return ne}function n(ne,$,J,me){if($.byteLength,J<0||$.byteLength<J)throw new RangeError("'offset' is out of bounds");if($.byteLength<J+(me||0))throw new RangeError("'length' is out of bounds");return J===void 0&&me===void 0?$=new Uint8Array($):me===void 0?$=new Uint8Array($,J):$=new Uint8Array($,J,me),O.TYPED_ARRAY_SUPPORT?(ne=$,ne.__proto__=O.prototype):ne=r(ne,$),ne}function a(ne,$){if(O.isBuffer($)){var J=l($.length)|0;return ne=H(ne,J),ne.length===0||$.copy(ne,0,0,J),ne}if($){if(typeof ArrayBuffer!="undefined"&&$.buffer instanceof ArrayBuffer||"length"in $)return typeof $.length!="number"||st($.length)?H(ne,0):r(ne,$);if($.type==="Buffer"&&G($.data))return r(ne,$.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function l(ne){if(ne>=P())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+P().toString(16)+" bytes");return ne|0}function s(ne){return+ne!=ne&&(ne=0),O.alloc(+ne)}O.isBuffer=function($){return!!($!=null&&$._isBuffer)},O.compare=function($,J){if(!O.isBuffer($)||!O.isBuffer(J))throw new TypeError("Arguments must be Buffers");if($===J)return 0;for(var me=$.length,xe=J.length,ke=0,$e=Math.min(me,xe);ke<$e;++ke)if($[ke]!==J[ke]){me=$[ke],xe=J[ke];break}return me<xe?-1:xe<me?1:0},O.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}},O.concat=function($,J){if(!G($))throw new TypeError('"list" argument must be an Array of Buffers');if($.length===0)return O.alloc(0);var me;if(J===void 0)for(J=0,me=0;me<$.length;++me)J+=$[me].length;var xe=O.allocUnsafe(J),ke=0;for(me=0;me<$.length;++me){var $e=$[me];if(!O.isBuffer($e))throw new TypeError('"list" argument must be an Array of Buffers');$e.copy(xe,ke),ke+=$e.length}return xe};function u(ne,$){if(O.isBuffer(ne))return ne.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(ne)||ne instanceof ArrayBuffer))return ne.byteLength;typeof ne!="string"&&(ne=""+ne);var J=ne.length;if(J===0)return 0;for(var me=!1;;)switch($){case"ascii":case"latin1":case"binary":return J;case"utf8":case"utf-8":case void 0:return ue(ne).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return J*2;case"hex":return J>>>1;case"base64":return ge(ne).length;default:if(me)return ue(ne).length;$=(""+$).toLowerCase(),me=!0}}O.byteLength=u;function c(ne,$,J){var me=!1;if(($===void 0||$<0)&&($=0),$>this.length)return"";if((J===void 0||J>this.length)&&(J=this.length),J<=0)return"";if(J>>>=0,$>>>=0,J<=$)return"";for(ne||(ne="utf8");;)switch(ne){case"hex":return z(this,$,J);case"utf8":case"utf-8":return E(this,$,J);case"ascii":return U(this,$,J);case"latin1":case"binary":return K(this,$,J);case"base64":return g(this,$,J);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,$,J);default:if(me)throw new TypeError("Unknown encoding: "+ne);ne=(ne+"").toLowerCase(),me=!0}}O.prototype._isBuffer=!0;function R(ne,$,J){var me=ne[$];ne[$]=ne[J],ne[J]=me}O.prototype.swap16=function(){var $=this.length;if($%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var J=0;J<$;J+=2)R(this,J,J+1);return this},O.prototype.swap32=function(){var $=this.length;if($%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var J=0;J<$;J+=4)R(this,J,J+3),R(this,J+1,J+2);return this},O.prototype.swap64=function(){var $=this.length;if($%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var J=0;J<$;J+=8)R(this,J,J+7),R(this,J+1,J+6),R(this,J+2,J+5),R(this,J+3,J+4);return this},O.prototype.toString=function(){var $=this.length|0;return $===0?"":arguments.length===0?E(this,0,$):c.apply(this,arguments)},O.prototype.equals=function($){if(!O.isBuffer($))throw new TypeError("Argument must be a Buffer");return this===$?!0:O.compare(this,$)===0},O.prototype.inspect=function(){var $="",J=et.INSPECT_MAX_BYTES;return this.length>0&&($=this.toString("hex",0,J).match(/.{2}/g).join(" "),this.length>J&&($+=" ... ")),"<Buffer "+$+">"},O.prototype.compare=function($,J,me,xe,ke){if(!O.isBuffer($))throw new TypeError("Argument must be a Buffer");if(J===void 0&&(J=0),me===void 0&&(me=$?$.length:0),xe===void 0&&(xe=0),ke===void 0&&(ke=this.length),J<0||me>$.length||xe<0||ke>this.length)throw new RangeError("out of range index");if(xe>=ke&&J>=me)return 0;if(xe>=ke)return-1;if(J>=me)return 1;if(J>>>=0,me>>>=0,xe>>>=0,ke>>>=0,this===$)return 0;for(var $e=ke-xe,Pt=me-J,Xt=Math.min($e,Pt),Bt=this.slice(xe,ke),lt=$.slice(J,me),jt=0;jt<Xt;++jt)if(Bt[jt]!==lt[jt]){$e=Bt[jt],Pt=lt[jt];break}return $e<Pt?-1:Pt<$e?1:0};function w(ne,$,J,me,xe){if(ne.length===0)return-1;if(typeof J=="string"?(me=J,J=0):J>2147483647?J=2147483647:J<-2147483648&&(J=-2147483648),J=+J,isNaN(J)&&(J=xe?0:ne.length-1),J<0&&(J=ne.length+J),J>=ne.length){if(xe)return-1;J=ne.length-1}else if(J<0)if(xe)J=0;else return-1;if(typeof $=="string"&&($=O.from($,me)),O.isBuffer($))return $.length===0?-1:C(ne,$,J,me,xe);if(typeof $=="number")return $=$&255,O.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?xe?Uint8Array.prototype.indexOf.call(ne,$,J):Uint8Array.prototype.lastIndexOf.call(ne,$,J):C(ne,[$],J,me,xe);throw new TypeError("val must be string, number or Buffer")}function C(ne,$,J,me,xe){var ke=1,$e=ne.length,Pt=$.length;if(me!==void 0&&(me=String(me).toLowerCase(),me==="ucs2"||me==="ucs-2"||me==="utf16le"||me==="utf-16le")){if(ne.length<2||$.length<2)return-1;ke=2,$e/=2,Pt/=2,J/=2}function Xt(it,Ze){return ke===1?it[Ze]:it.readUInt16BE(Ze*ke)}var Bt;if(xe){var lt=-1;for(Bt=J;Bt<$e;Bt++)if(Xt(ne,Bt)===Xt($,lt===-1?0:Bt-lt)){if(lt===-1&&(lt=Bt),Bt-lt+1===Pt)return lt*ke}else lt!==-1&&(Bt-=Bt-lt),lt=-1}else for(J+Pt>$e&&(J=$e-Pt),Bt=J;Bt>=0;Bt--){for(var jt=!0,pn=0;pn<Pt;pn++)if(Xt(ne,Bt+pn)!==Xt($,pn)){jt=!1;break}if(jt)return Bt}return-1}O.prototype.includes=function($,J,me){return this.indexOf($,J,me)!==-1},O.prototype.indexOf=function($,J,me){return w(this,$,J,me,!0)},O.prototype.lastIndexOf=function($,J,me){return w(this,$,J,me,!1)};function D(ne,$,J,me){J=Number(J)||0;var xe=ne.length-J;me?(me=Number(me),me>xe&&(me=xe)):me=xe;var ke=$.length;if(ke%2!==0)throw new TypeError("Invalid hex string");me>ke/2&&(me=ke/2);for(var $e=0;$e<me;++$e){var Pt=parseInt($.substr($e*2,2),16);if(isNaN(Pt))return $e;ne[J+$e]=Pt}return $e}function S(ne,$,J,me){return Ke(ue($,ne.length-J),ne,J,me)}function b(ne,$,J,me){return Ke(se($),ne,J,me)}function _(ne,$,J,me){return b(ne,$,J,me)}function f(ne,$,J,me){return Ke(ge($),ne,J,me)}function d(ne,$,J,me){return Ke(we($,ne.length-J),ne,J,me)}O.prototype.write=function($,J,me,xe){if(J===void 0)xe="utf8",me=this.length,J=0;else if(me===void 0&&typeof J=="string")xe=J,me=this.length,J=0;else if(isFinite(J))J=J|0,isFinite(me)?(me=me|0,xe===void 0&&(xe="utf8")):(xe=me,me=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var ke=this.length-J;if((me===void 0||me>ke)&&(me=ke),$.length>0&&(me<0||J<0)||J>this.length)throw new RangeError("Attempt to write outside buffer bounds");xe||(xe="utf8");for(var $e=!1;;)switch(xe){case"hex":return D(this,$,J,me);case"utf8":case"utf-8":return S(this,$,J,me);case"ascii":return b(this,$,J,me);case"latin1":case"binary":return _(this,$,J,me);case"base64":return f(this,$,J,me);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return d(this,$,J,me);default:if($e)throw new TypeError("Unknown encoding: "+xe);xe=(""+xe).toLowerCase(),$e=!0}},O.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function g(ne,$,J){return $===0&&J===ne.length?Y.fromByteArray(ne):Y.fromByteArray(ne.slice($,J))}function E(ne,$,J){J=Math.min(ne.length,J);for(var me=[],xe=$;xe<J;){var ke=ne[xe],$e=null,Pt=ke>239?4:ke>223?3:ke>191?2:1;if(xe+Pt<=J){var Xt,Bt,lt,jt;switch(Pt){case 1:ke<128&&($e=ke);break;case 2:Xt=ne[xe+1],(Xt&192)===128&&(jt=(ke&31)<<6|Xt&63,jt>127&&($e=jt));break;case 3:Xt=ne[xe+1],Bt=ne[xe+2],(Xt&192)===128&&(Bt&192)===128&&(jt=(ke&15)<<12|(Xt&63)<<6|Bt&63,jt>2047&&(jt<55296||jt>57343)&&($e=jt));break;case 4:Xt=ne[xe+1],Bt=ne[xe+2],lt=ne[xe+3],(Xt&192)===128&&(Bt&192)===128&&(lt&192)===128&&(jt=(ke&15)<<18|(Xt&63)<<12|(Bt&63)<<6|lt&63,jt>65535&&jt<1114112&&($e=jt))}}$e===null?($e=65533,Pt=1):$e>65535&&($e-=65536,me.push($e>>>10&1023|55296),$e=56320|$e&1023),me.push($e),xe+=Pt}return F(me)}var T=4096;function F(ne){var $=ne.length;if($<=T)return String.fromCharCode.apply(String,ne);for(var J="",me=0;me<$;)J+=String.fromCharCode.apply(String,ne.slice(me,me+=T));return J}function U(ne,$,J){var me="";J=Math.min(ne.length,J);for(var xe=$;xe<J;++xe)me+=String.fromCharCode(ne[xe]&127);return me}function K(ne,$,J){var me="";J=Math.min(ne.length,J);for(var xe=$;xe<J;++xe)me+=String.fromCharCode(ne[xe]);return me}function z(ne,$,J){var me=ne.length;(!$||$<0)&&($=0),(!J||J<0||J>me)&&(J=me);for(var xe="",ke=$;ke<J;++ke)xe+=Ce(ne[ke]);return xe}function M(ne,$,J){for(var me=ne.slice($,J),xe="",ke=0;ke<me.length;ke+=2)xe+=String.fromCharCode(me[ke]+me[ke+1]*256);return xe}O.prototype.slice=function($,J){var me=this.length;$=~~$,J=J===void 0?me:~~J,$<0?($+=me,$<0&&($=0)):$>me&&($=me),J<0?(J+=me,J<0&&(J=0)):J>me&&(J=me),J<$&&(J=$);var xe;if(O.TYPED_ARRAY_SUPPORT)xe=this.subarray($,J),xe.__proto__=O.prototype;else{var ke=J-$;xe=new O(ke,void 0);for(var $e=0;$e<ke;++$e)xe[$e]=this[$e+$]}return xe};function y(ne,$,J){if(ne%1!==0||ne<0)throw new RangeError("offset is not uint");if(ne+$>J)throw new RangeError("Trying to access beyond buffer length")}O.prototype.readUIntLE=function($,J,me){$=$|0,J=J|0,me||y($,J,this.length);for(var xe=this[$],ke=1,$e=0;++$e<J&&(ke*=256);)xe+=this[$+$e]*ke;return xe},O.prototype.readUIntBE=function($,J,me){$=$|0,J=J|0,me||y($,J,this.length);for(var xe=this[$+--J],ke=1;J>0&&(ke*=256);)xe+=this[$+--J]*ke;return xe},O.prototype.readUInt8=function($,J){return J||y($,1,this.length),this[$]},O.prototype.readUInt16LE=function($,J){return J||y($,2,this.length),this[$]|this[$+1]<<8},O.prototype.readUInt16BE=function($,J){return J||y($,2,this.length),this[$]<<8|this[$+1]},O.prototype.readUInt32LE=function($,J){return J||y($,4,this.length),(this[$]|this[$+1]<<8|this[$+2]<<16)+this[$+3]*16777216},O.prototype.readUInt32BE=function($,J){return J||y($,4,this.length),this[$]*16777216+(this[$+1]<<16|this[$+2]<<8|this[$+3])},O.prototype.readIntLE=function($,J,me){$=$|0,J=J|0,me||y($,J,this.length);for(var xe=this[$],ke=1,$e=0;++$e<J&&(ke*=256);)xe+=this[$+$e]*ke;return ke*=128,xe>=ke&&(xe-=Math.pow(2,8*J)),xe},O.prototype.readIntBE=function($,J,me){$=$|0,J=J|0,me||y($,J,this.length);for(var xe=J,ke=1,$e=this[$+--xe];xe>0&&(ke*=256);)$e+=this[$+--xe]*ke;return ke*=128,$e>=ke&&($e-=Math.pow(2,8*J)),$e},O.prototype.readInt8=function($,J){return J||y($,1,this.length),this[$]&128?(255-this[$]+1)*-1:this[$]},O.prototype.readInt16LE=function($,J){J||y($,2,this.length);var me=this[$]|this[$+1]<<8;return me&32768?me|4294901760:me},O.prototype.readInt16BE=function($,J){J||y($,2,this.length);var me=this[$+1]|this[$]<<8;return me&32768?me|4294901760:me},O.prototype.readInt32LE=function($,J){return J||y($,4,this.length),this[$]|this[$+1]<<8|this[$+2]<<16|this[$+3]<<24},O.prototype.readInt32BE=function($,J){return J||y($,4,this.length),this[$]<<24|this[$+1]<<16|this[$+2]<<8|this[$+3]},O.prototype.readFloatLE=function($,J){return J||y($,4,this.length),j.read(this,$,!0,23,4)},O.prototype.readFloatBE=function($,J){return J||y($,4,this.length),j.read(this,$,!1,23,4)},O.prototype.readDoubleLE=function($,J){return J||y($,8,this.length),j.read(this,$,!0,52,8)},O.prototype.readDoubleBE=function($,J){return J||y($,8,this.length),j.read(this,$,!1,52,8)};function W(ne,$,J,me,xe,ke){if(!O.isBuffer(ne))throw new TypeError('"buffer" argument must be a Buffer instance');if($>xe||$<ke)throw new RangeError('"value" argument is out of bounds');if(J+me>ne.length)throw new RangeError("Index out of range")}O.prototype.writeUIntLE=function($,J,me,xe){if($=+$,J=J|0,me=me|0,!xe){var ke=Math.pow(2,8*me)-1;W(this,$,J,me,ke,0)}var $e=1,Pt=0;for(this[J]=$&255;++Pt<me&&($e*=256);)this[J+Pt]=$/$e&255;return J+me},O.prototype.writeUIntBE=function($,J,me,xe){if($=+$,J=J|0,me=me|0,!xe){var ke=Math.pow(2,8*me)-1;W(this,$,J,me,ke,0)}var $e=me-1,Pt=1;for(this[J+$e]=$&255;--$e>=0&&(Pt*=256);)this[J+$e]=$/Pt&255;return J+me},O.prototype.writeUInt8=function($,J,me){return $=+$,J=J|0,me||W(this,$,J,1,255,0),O.TYPED_ARRAY_SUPPORT||($=Math.floor($)),this[J]=$&255,J+1};function X(ne,$,J,me){$<0&&($=65535+$+1);for(var xe=0,ke=Math.min(ne.length-J,2);xe<ke;++xe)ne[J+xe]=($&255<<8*(me?xe:1-xe))>>>(me?xe:1-xe)*8}O.prototype.writeUInt16LE=function($,J,me){return $=+$,J=J|0,me||W(this,$,J,2,65535,0),O.TYPED_ARRAY_SUPPORT?(this[J]=$&255,this[J+1]=$>>>8):X(this,$,J,!0),J+2},O.prototype.writeUInt16BE=function($,J,me){return $=+$,J=J|0,me||W(this,$,J,2,65535,0),O.TYPED_ARRAY_SUPPORT?(this[J]=$>>>8,this[J+1]=$&255):X(this,$,J,!1),J+2};function te(ne,$,J,me){$<0&&($=4294967295+$+1);for(var xe=0,ke=Math.min(ne.length-J,4);xe<ke;++xe)ne[J+xe]=$>>>(me?xe:3-xe)*8&255}O.prototype.writeUInt32LE=function($,J,me){return $=+$,J=J|0,me||W(this,$,J,4,4294967295,0),O.TYPED_ARRAY_SUPPORT?(this[J+3]=$>>>24,this[J+2]=$>>>16,this[J+1]=$>>>8,this[J]=$&255):te(this,$,J,!0),J+4},O.prototype.writeUInt32BE=function($,J,me){return $=+$,J=J|0,me||W(this,$,J,4,4294967295,0),O.TYPED_ARRAY_SUPPORT?(this[J]=$>>>24,this[J+1]=$>>>16,this[J+2]=$>>>8,this[J+3]=$&255):te(this,$,J,!1),J+4},O.prototype.writeIntLE=function($,J,me,xe){if($=+$,J=J|0,!xe){var ke=Math.pow(2,8*me-1);W(this,$,J,me,ke-1,-ke)}var $e=0,Pt=1,Xt=0;for(this[J]=$&255;++$e<me&&(Pt*=256);)$<0&&Xt===0&&this[J+$e-1]!==0&&(Xt=1),this[J+$e]=($/Pt>>0)-Xt&255;return J+me},O.prototype.writeIntBE=function($,J,me,xe){if($=+$,J=J|0,!xe){var ke=Math.pow(2,8*me-1);W(this,$,J,me,ke-1,-ke)}var $e=me-1,Pt=1,Xt=0;for(this[J+$e]=$&255;--$e>=0&&(Pt*=256);)$<0&&Xt===0&&this[J+$e+1]!==0&&(Xt=1),this[J+$e]=($/Pt>>0)-Xt&255;return J+me},O.prototype.writeInt8=function($,J,me){return $=+$,J=J|0,me||W(this,$,J,1,127,-128),O.TYPED_ARRAY_SUPPORT||($=Math.floor($)),$<0&&($=255+$+1),this[J]=$&255,J+1},O.prototype.writeInt16LE=function($,J,me){return $=+$,J=J|0,me||W(this,$,J,2,32767,-32768),O.TYPED_ARRAY_SUPPORT?(this[J]=$&255,this[J+1]=$>>>8):X(this,$,J,!0),J+2},O.prototype.writeInt16BE=function($,J,me){return $=+$,J=J|0,me||W(this,$,J,2,32767,-32768),O.TYPED_ARRAY_SUPPORT?(this[J]=$>>>8,this[J+1]=$&255):X(this,$,J,!1),J+2},O.prototype.writeInt32LE=function($,J,me){return $=+$,J=J|0,me||W(this,$,J,4,2147483647,-2147483648),O.TYPED_ARRAY_SUPPORT?(this[J]=$&255,this[J+1]=$>>>8,this[J+2]=$>>>16,this[J+3]=$>>>24):te(this,$,J,!0),J+4},O.prototype.writeInt32BE=function($,J,me){return $=+$,J=J|0,me||W(this,$,J,4,2147483647,-2147483648),$<0&&($=4294967295+$+1),O.TYPED_ARRAY_SUPPORT?(this[J]=$>>>24,this[J+1]=$>>>16,this[J+2]=$>>>8,this[J+3]=$&255):te(this,$,J,!1),J+4};function pe(ne,$,J,me,xe,ke){if(J+me>ne.length)throw new RangeError("Index out of range");if(J<0)throw new RangeError("Index out of range")}function Ie(ne,$,J,me,xe){return xe||pe(ne,$,J,4,34028234663852886e22,-34028234663852886e22),j.write(ne,$,J,me,23,4),J+4}O.prototype.writeFloatLE=function($,J,me){return Ie(this,$,J,!0,me)},O.prototype.writeFloatBE=function($,J,me){return Ie(this,$,J,!1,me)};function Ee(ne,$,J,me,xe){return xe||pe(ne,$,J,8,17976931348623157e292,-17976931348623157e292),j.write(ne,$,J,me,52,8),J+8}O.prototype.writeDoubleLE=function($,J,me){return Ee(this,$,J,!0,me)},O.prototype.writeDoubleBE=function($,J,me){return Ee(this,$,J,!1,me)},O.prototype.copy=function($,J,me,xe){if(me||(me=0),!xe&&xe!==0&&(xe=this.length),J>=$.length&&(J=$.length),J||(J=0),xe>0&&xe<me&&(xe=me),xe===me)return 0;if($.length===0||this.length===0)return 0;if(J<0)throw new RangeError("targetStart out of bounds");if(me<0||me>=this.length)throw new RangeError("sourceStart out of bounds");if(xe<0)throw new RangeError("sourceEnd out of bounds");xe>this.length&&(xe=this.length),$.length-J<xe-me&&(xe=$.length-J+me);var ke=xe-me,$e;if(this===$&&me<J&&J<xe)for($e=ke-1;$e>=0;--$e)$[$e+J]=this[$e+me];else if(ke<1e3||!O.TYPED_ARRAY_SUPPORT)for($e=0;$e<ke;++$e)$[$e+J]=this[$e+me];else Uint8Array.prototype.set.call($,this.subarray(me,me+ke),J);return ke},O.prototype.fill=function($,J,me,xe){if(typeof $=="string"){if(typeof J=="string"?(xe=J,J=0,me=this.length):typeof me=="string"&&(xe=me,me=this.length),$.length===1){var ke=$.charCodeAt(0);ke<256&&($=ke)}if(xe!==void 0&&typeof xe!="string")throw new TypeError("encoding must be a string");if(typeof xe=="string"&&!O.isEncoding(xe))throw new TypeError("Unknown encoding: "+xe)}else typeof $=="number"&&($=$&255);if(J<0||this.length<J||this.length<me)throw new RangeError("Out of range index");if(me<=J)return this;J=J>>>0,me=me===void 0?this.length:me>>>0,$||($=0);var $e;if(typeof $=="number")for($e=J;$e<me;++$e)this[$e]=$;else{var Pt=O.isBuffer($)?$:ue(new O($,xe).toString()),Xt=Pt.length;for($e=0;$e<me-J;++$e)this[$e+J]=Pt[$e%Xt]}return this};var Te=/[^+\/0-9A-Za-z-_]/g;function We(ne){if(ne=He(ne).replace(Te,""),ne.length<2)return"";for(;ne.length%4!==0;)ne=ne+"=";return ne}function He(ne){return ne.trim?ne.trim():ne.replace(/^\s+|\s+$/g,"")}function Ce(ne){return ne<16?"0"+ne.toString(16):ne.toString(16)}function ue(ne,$){$=$||Infinity;for(var J,me=ne.length,xe=null,ke=[],$e=0;$e<me;++$e){if(J=ne.charCodeAt($e),J>55295&&J<57344){if(!xe){if(J>56319){($-=3)>-1&&ke.push(239,191,189);continue}else if($e+1===me){($-=3)>-1&&ke.push(239,191,189);continue}xe=J;continue}if(J<56320){($-=3)>-1&&ke.push(239,191,189),xe=J;continue}J=(xe-55296<<10|J-56320)+65536}else xe&&(($-=3)>-1&&ke.push(239,191,189));if(xe=null,J<128){if(($-=1)<0)break;ke.push(J)}else if(J<2048){if(($-=2)<0)break;ke.push(J>>6|192,J&63|128)}else if(J<65536){if(($-=3)<0)break;ke.push(J>>12|224,J>>6&63|128,J&63|128)}else if(J<1114112){if(($-=4)<0)break;ke.push(J>>18|240,J>>12&63|128,J>>6&63|128,J&63|128)}else throw new Error("Invalid code point")}return ke}function se(ne){for(var $=[],J=0;J<ne.length;++J)$.push(ne.charCodeAt(J)&255);return $}function we(ne,$){for(var J,me,xe,ke=[],$e=0;$e<ne.length&&!(($-=2)<0);++$e)J=ne.charCodeAt($e),me=J>>8,xe=J%256,ke.push(xe),ke.push(me);return ke}function ge(ne){return Y.toByteArray(We(ne))}function Ke(ne,$,J,me){for(var xe=0;xe<me&&!(xe+J>=$.length||xe>=ne.length);++xe)$[xe+J]=ne[xe];return xe}function st(ne){return ne!==ne}}).call(this,k("IyRk"))},HmJG:function(Gt,et,k){},I8Z2:function(Gt,et,k){"use strict";k.d(et,"a",function(){return G}),k.d(et,"b",function(){return h}),k.d(et,"c",function(){return n});var re=k("q1tI"),Y=function(){var a=function(l,s){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,c){u.__proto__=c}||function(u,c){for(var R in c)c.hasOwnProperty(R)&&(u[R]=c[R])},a(l,s)};return function(l,s){a(l,s);function u(){this.constructor=l}l.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),j=re.createContext(null),G=function(a){Y(l,a);function l(){return a!==null&&a.apply(this,arguments)||this}return l.prototype.render=function(){return re.createElement(j.Provider,{value:this.props.store},this.props.children)},l}(re.Component),L=k("Gytx"),P=k.n(L),H=k("2mql"),O=k.n(H),I=function(){var a=function(l,s){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,c){u.__proto__=c}||function(u,c){for(var R in c)c.hasOwnProperty(R)&&(u[R]=c[R])},a(l,s)};return function(l,s){a(l,s);function u(){this.constructor=l}l.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),x=function(){return x=Object.assign||function(a){for(var l,s=1,u=arguments.length;s<u;s++){l=arguments[s];for(var c in l)Object.prototype.hasOwnProperty.call(l,c)&&(a[c]=l[c])}return a},x.apply(this,arguments)};function p(a){return a.displayName||a.name||"Component"}var m=function(){return{}};function h(a,l){l===void 0&&(l={});var s=!!a,u=a||m;return function(R){var w=function(D){I(S,D);function S(b,_){var f=D.call(this,b,_)||this;return f.unsubscribe=null,f.handleChange=function(){if(!f.unsubscribe)return;var d=u(f.store.getState(),f.props);f.setState({subscribed:d})},f.store=f.context,f.state={subscribed:u(f.store.getState(),b),store:f.store,props:b},f}return S.getDerivedStateFromProps=function(b,_){return a&&a.length===2&&b!==_.props?{subscribed:u(_.store.getState(),b),props:b}:{props:b}},S.prototype.componentDidMount=function(){this.trySubscribe()},S.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},S.prototype.shouldComponentUpdate=function(b,_){return!P()(this.props,b)||!P()(this.state.subscribed,_.subscribed)},S.prototype.trySubscribe=function(){s&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},S.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},S.prototype.render=function(){var b=x(x(x({},this.props),this.state.subscribed),{store:this.store});return re.createElement(R,x({},b,{ref:this.props.miniStoreForwardedRef}))},S.displayName="Connect("+p(R)+")",S.contextType=j,S}(re.Component);if(l.forwardRef){var C=re.forwardRef(function(D,S){return re.createElement(w,x({},D,{miniStoreForwardedRef:S}))});return O()(C,R)}return O()(w,R)}}var r=function(){return r=Object.assign||function(a){for(var l,s=1,u=arguments.length;s<u;s++){l=arguments[s];for(var c in l)Object.prototype.hasOwnProperty.call(l,c)&&(a[c]=l[c])}return a},r.apply(this,arguments)};function n(a){var l=a,s=[];function u(w){l=r(r({},l),w);for(var C=0;C<s.length;C++)s[C]()}function c(){return l}function R(w){return s.push(w),function(){var D=s.indexOf(w);s.splice(D,1)}}return{setState:u,getState:c,subscribe:R}}},IBYe:function(Gt,et,k){"use strict";function re(Y){return null}et.a=re},IQq8:function(Gt,et,k){Gt.exports=k.p+"static/fengzhu.c74c3e9f.svg"},LSTS:function(Gt,et,k){"use strict";Object.defineProperty(et,"__esModule",{value:!0});var re=function(){function m(h,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(h,a.key,a)}}return function(h,r,n){return r&&m(h.prototype,r),n&&m(h,n),h}}(),Y=k("q1tI"),j=P(Y),G=k("17x9"),L=P(G);function P(m){return m&&m.__esModule?m:{default:m}}function H(m,h){var r={};for(var n in m){if(h.indexOf(n)>=0)continue;if(!Object.prototype.hasOwnProperty.call(m,n))continue;r[n]=m[n]}return r}function O(m,h){if(!(m instanceof h))throw new TypeError("Cannot call a class as a function")}function I(m,h){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:m}function x(m,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);m.prototype=Object.create(h&&h.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(m,h):m.__proto__=h)}var p=function(m){x(h,m);function h(r){O(this,h);var n=I(this,(h.__proto__||Object.getPrototypeOf(h)).call(this,r));return n.scrollListener=n.scrollListener.bind(n),n.eventListenerOptions=n.eventListenerOptions.bind(n),n.mousewheelListener=n.mousewheelListener.bind(n),n}return re(h,[{key:"componentDidMount",value:function(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}},{key:"componentDidUpdate",value:function(){if(this.props.isReverse&&this.loadMore){var n=this.getParentElement(this.scrollComponent);n.scrollTop=n.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var n=!1,a={get passive(){n=!0}};try{document.addEventListener("test",null,a),document.removeEventListener("test",null,a)}catch(l){}return n}},{key:"eventListenerOptions",value:function(){var n=this.props.useCapture;return this.isPassiveSupported()&&(n={useCapture:this.props.useCapture,passive:!0}),n}},{key:"setDefaultLoader",value:function(n){this.defaultLoader=n}},{key:"detachMousewheelListener",value:function(){var n=window;this.props.useWindow===!1&&(n=this.scrollComponent.parentNode),n.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var n=window;this.props.useWindow===!1&&(n=this.getParentElement(this.scrollComponent)),n.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),n.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(n){var a=this.props.getScrollParent&&this.props.getScrollParent();return a!=null?a:n&&n.parentNode}},{key:"filterProps",value:function(n){return n}},{key:"attachScrollListener",value:function(){var n=this.getParentElement(this.scrollComponent);if(!this.props.hasMore||!n)return;var a=window;this.props.useWindow===!1&&(a=n),a.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),a.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),a.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}},{key:"mousewheelListener",value:function(n){n.deltaY===1&&!this.isPassiveSupported()&&n.preventDefault()}},{key:"scrollListener",value:function(){var n=this.scrollComponent,a=window,l=this.getParentElement(n),s=void 0;if(this.props.useWindow){var u=document.documentElement||document.body.parentNode||document.body,c=a.pageYOffset!==void 0?a.pageYOffset:u.scrollTop;this.props.isReverse?s=c:s=this.calculateOffset(n,c)}else this.props.isReverse?s=l.scrollTop:s=n.scrollHeight-l.scrollTop-l.clientHeight;s<Number(this.props.threshold)&&n&&n.offsetParent!==null&&(this.detachScrollListener(),this.beforeScrollHeight=l.scrollHeight,this.beforeScrollTop=l.scrollTop,typeof this.props.loadMore=="function"&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}},{key:"calculateOffset",value:function(n,a){return n?this.calculateTopPosition(n)+(n.offsetHeight-a-window.innerHeight):0}},{key:"calculateTopPosition",value:function(n){return n?n.offsetTop+this.calculateTopPosition(n.offsetParent):0}},{key:"render",value:function(){var n=this,a=this.filterProps(this.props),l=a.children,s=a.element,u=a.hasMore,c=a.initialLoad,R=a.isReverse,w=a.loader,C=a.loadMore,D=a.pageStart,S=a.ref,b=a.threshold,_=a.useCapture,f=a.useWindow,d=a.getScrollParent,g=H(a,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]);g.ref=function(T){n.scrollComponent=T,S&&S(T)};var E=[l];return u&&(w?R?E.unshift(w):E.push(w):this.defaultLoader&&(R?E.unshift(this.defaultLoader):E.push(this.defaultLoader))),j.default.createElement(s,g,E)}}]),h}(Y.Component);p.propTypes={children:L.default.node.isRequired,element:L.default.node,hasMore:L.default.bool,initialLoad:L.default.bool,isReverse:L.default.bool,loader:L.default.node,loadMore:L.default.func.isRequired,pageStart:L.default.number,ref:L.default.func,getScrollParent:L.default.func,threshold:L.default.number,useCapture:L.default.bool,useWindow:L.default.bool},p.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},et.default=p,Gt.exports=et.default},LdHM:function(Gt,et,k){"use strict";k.d(et,"b",function(){return c}),k.d(et,"a",function(){return w});var re=k("1OyB"),Y=k("vuIU"),j=k("Ji7U"),G=k("LK+K"),L=k("q1tI"),P=k("rePB"),H=k("Ff2n"),O=k("ODXe"),I=k("4IlW"),x=k("bX4T"),p=k("YrtM"),m=k("TSYQ"),h=k.n(m),r=k("+nKL"),n=k("8OUc"),a=function(W,X){var te=W.prefixCls,pe=W.id,Ie=W.flattenOptions,Ee=W.childrenAsData,Te=W.values,We=W.searchValue,He=W.multiple,Ce=W.defaultActiveFirstOption,ue=W.height,se=W.itemHeight,we=W.notFoundContent,ge=W.open,Ke=W.menuItemSelectedIcon,st=W.virtual,ne=W.onSelect,$=W.onToggleOpen,J=W.onActiveValue,me=W.onScroll,xe=W.onMouseEnter,ke="".concat(te,"-item"),$e=Object(p.a)(function(){return Ie},[ge,Ie],function(wt,Ve){return Ve[0]&&wt[1]!==Ve[1]}),Pt=L.useRef(null),Xt=function(Ve){Ve.preventDefault()},Bt=function(Ve){Pt.current&&Pt.current.scrollTo({index:Ve})},lt=function(Ve){for(var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Pe=$e.length,ce=0;ce<Pe;ce+=1){var de=(Ve+ce*Se+Pe)%Pe,be=$e[de],je=be.group,ze=be.data;if(!je&&!ze.disabled)return de}return-1},jt=L.useState(function(){return lt(0)}),pn=Object(O.a)(jt,2),it=pn[0],Ze=pn[1],bt=function(Ve){Ze(Ve);var Se=$e[Ve];if(!Se){J(null,-1);return}J(Se.data.value,Ve)};L.useEffect(function(){bt(Ce!==!1?lt(0):-1)},[$e.length,We]),L.useEffect(function(){var wt=setTimeout(function(){if(!He&&ge&&Te.size===1){var Ve=Array.from(Te)[0],Se=$e.findIndex(function(Pe){var ce=Pe.data;return ce.value===Ve});bt(Se),Bt(Se)}});return function(){return clearTimeout(wt)}},[ge]);var Mt=function(Ve){Ve!==void 0&&ne(Ve,{selected:!Te.has(Ve)}),He||$(!1)};if(L.useImperativeHandle(X,function(){return{onKeyDown:function(Ve){var Se=Ve.which;switch(Se){case I.a.UP:case I.a.DOWN:{var Pe=0;if(Se===I.a.UP?Pe=-1:Se===I.a.DOWN&&(Pe=1),Pe!==0){var ce=lt(it+Pe,Pe);Bt(ce),bt(ce)}break}case I.a.ENTER:{var de=$e[it];de&&!de.data.disabled?Mt(de.data.value):Mt(void 0),ge&&Ve.preventDefault();break}case I.a.ESC:$(!1)}},onKeyUp:function(){},scrollTo:function(Ve){Bt(Ve)}}}),$e.length===0)return L.createElement("div",{role:"listbox",id:"".concat(pe,"_list"),className:"".concat(ke,"-empty"),onMouseDown:Xt},we);function ct(wt){var Ve=$e[wt];if(!Ve)return null;var Se=Ve.data||{},Pe=Se.value,ce=Se.label,de=Se.children,be=Object(x.a)(Se,!0),je=Ee?de:ce;return Ve?L.createElement("div",Object.assign({"aria-label":typeof je=="string"?je:null},be,{key:wt,role:"option",id:"".concat(pe,"_list_").concat(wt),"aria-selected":Te.has(Pe)}),Pe):null}return L.createElement(L.Fragment,null,L.createElement("div",{role:"listbox",id:"".concat(pe,"_list"),style:{height:0,width:0,overflow:"hidden"}},ct(it-1),ct(it),ct(it+1)),L.createElement(r.a,{itemKey:"key",ref:Pt,data:$e,height:ue,itemHeight:se,fullHeight:!1,onMouseDown:Xt,onScroll:me,virtual:st,onMouseEnter:xe},function(wt,Ve){var Se,Pe=wt.group,ce=wt.groupOption,de=wt.data,be=de.label,je=de.key;if(Pe)return L.createElement("div",{className:h()(ke,"".concat(ke,"-group"))},be!==void 0?be:je);var ze=de.disabled,ut=de.value,Dt=de.title,rn=de.children,mn=de.style,gt=de.className,Vt=Object(H.a)(de,["disabled","value","title","children","style","className"]),Tt=Te.has(ut),Rt="".concat(ke,"-option"),mt=h()(ke,Rt,gt,(Se={},Object(P.a)(Se,"".concat(Rt,"-grouped"),ce),Object(P.a)(Se,"".concat(Rt,"-active"),it===Ve&&!ze),Object(P.a)(Se,"".concat(Rt,"-disabled"),ze),Object(P.a)(Se,"".concat(Rt,"-selected"),Tt),Se)),_e=Ee?rn:be,Ge=!Ke||typeof Ke=="function"||Tt;return L.createElement("div",Object.assign({},Vt,{"aria-selected":Tt,className:mt,title:Dt,onMouseMove:function(){if(it===Ve||ze)return;bt(Ve)},onClick:function(){ze||Mt(ut)},style:mn}),L.createElement("div",{className:"".concat(Rt,"-content")},_e||ut),L.isValidElement(Ke)||Tt,Ge&&L.createElement(n.a,{className:"".concat(ke,"-option-state"),customizeIcon:Ke,customizeIconProps:{isSelected:Tt}},Tt?"\u2713":null))}))},l=L.forwardRef(a);l.displayName="OptionList";var s=l,u=function(){return null};u.isSelectOption=!0;var c=u,R=function(){return null};R.isSelectOptGroup=!0;var w=R,C=k("VTBJ"),D=k("Zm9Q");function S(y){var W=y.key,X=y.props,te=X.children,pe=X.value,Ie=Object(H.a)(X,["children","value"]);return Object(C.a)({key:W,value:pe!==void 0?pe:W,children:te},Ie)}function b(y){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(D.a)(y).map(function(X,te){if(!L.isValidElement(X)||!X.type)return null;var pe=X.type.isSelectOptGroup,Ie=X.key,Ee=X.props,Te=Ee.children,We=Object(H.a)(Ee,["children"]);return W||!pe?S(X):Object(C.a)(Object(C.a)({key:"__RC_SELECT_GRP__".concat(Ie===null?te:Ie,"__"),label:Ie},We),{},{options:b(Te)})}).filter(function(X){return X})}var _=k("2Qr1"),f=k("qNPg"),d=k("U8pU"),g=k("Kwbf"),E=k("WKfj");function T(y){var W=y.mode,X=y.options,te=y.children,pe=y.backfill,Ie=y.allowClear,Ee=y.placeholder,Te=y.getInputElement,We=y.showSearch,He=y.onSearch,Ce=y.defaultOpen,ue=y.autoFocus,se=y.labelInValue,we=y.value,ge=y.inputValue,Ke=y.optionLabelProp,st=W==="multiple"||W==="tags",ne=We!==void 0?We:st||W==="combobox",$=X||b(te);if(Object(g.a)(W!=="tags"||$.every(function(ke){return!ke.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),W==="tags"||W==="combobox"){var J=$.some(function(ke){return ke.options?ke.options.some(function($e){return typeof("value"in $e?$e.value:$e.key)=="number"}):typeof("value"in ke?ke.value:ke.key)=="number"});Object(g.a)(!J,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(g.a)(W!=="combobox"||!Ke,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(g.a)(W==="combobox"||!pe,"`backfill` only works with `combobox` mode."),Object(g.a)(W==="combobox"||!Te,"`getInputElement` only work with `combobox` mode."),Object(g.b)(W!=="combobox"||!Te||!Ie||!Ee,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),He&&!ne&&W!=="combobox"&&W!=="tags"&&Object(g.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(g.b)(!Ce||ue,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),we!=null){var me=Object(E.d)(we);Object(g.a)(!se||me.every(function(ke){return Object(d.a)(ke)==="object"&&("key"in ke||"value"in ke)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(g.a)(!st||Array.isArray(we),"`value` should be array when `mode` is `multiple` or `tags`")}if(te){var xe=null;Object(D.a)(te).some(function(ke){if(!L.isValidElement(ke)||!ke.type)return!1;var $e=ke.type;if($e.isSelectOption)return!1;if($e.isSelectOptGroup){var Pt=Object(D.a)(ke.props.children).every(function(Xt){return!L.isValidElement(Xt)||!ke.type||Xt.type.isSelectOption?!0:(xe=Xt.type,!1)});return!Pt}return xe=$e,!0}),xe&&Object(g.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(xe.displayName||xe.name||xe,"`.")),Object(g.a)(ge===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var F=T,U=Object(f.a)({prefixCls:"rc-select",components:{optionList:s},convertChildrenToData:b,flattenOptions:_.d,getLabeledValue:_.e,filterOptions:_.b,isValueDisabled:_.g,findValueOption:_.c,warningProps:F,fillOptionsWithMissingValue:_.a}),K=function(y){Object(j.a)(X,y);var W=Object(G.a)(X);function X(){var te;return Object(re.a)(this,X),te=W.apply(this,arguments),te.selectRef=L.createRef(),te.focus=function(){te.selectRef.current.focus()},te.blur=function(){te.selectRef.current.blur()},te}return Object(Y.a)(X,[{key:"render",value:function(){return L.createElement(U,Object.assign({ref:this.selectRef},this.props))}}]),X}(L.Component);K.Option=c,K.OptGroup=w;var z=K,M=et.c=z},M8RZ:function(Gt,et,k){"use strict";k.d(et,"a",function(){return I});var re=k("fWQN"),Y=k("mtLc"),j=k("yKVA"),G=k("879j"),L=k("q1tI"),P=k.n(L),H=k("i8i4"),O=k.n(H),I=function(x){Object(j.a)(m,x);var p=Object(G.a)(m);function m(h){var r;Object(re.a)(this,m),r=p.call(this,h);var n=window.document;return r.node=n.createElement("div"),n.body.appendChild(r.node),r}return Object(Y.a)(m,[{key:"render",value:function(){var r=this.props.children;return Object(H.createPortal)(r,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),m}(P.a.Component)},Nnv5:function(Gt,et,k){Gt.exports={flex_box_center:"flex_box_center___2bJec",flex_space_between:"flex_space_between___2ahJ7",flex_box_vertical_center:"flex_box_vertical_center___2dSx8",flex_box_center_end:"flex_box_center_end___1Vr--",flex_box_column:"flex_box_column___nACsK",wrap:"wrap___2DR4Y",sys:"sys___2U2iV",head:"head___3qxDP",list:"list___uTkEt",name:"name___3QGED",tr:"tr___1zJeC"}},NvD2:function(Gt,et,k){"use strict";k.d(et,"a",function(){return P});var re=k("Kwbf");function Y(H,O){var I=new Set;return H.forEach(function(x){O.has(x)||I.add(x)}),I}function j(H){var O=H||{},I=O.disabled,x=O.disableCheckbox,p=O.checkable;return!!(I||x)||p===!1}function G(H,O,I,x){for(var p=new Set(H),m=new Set,h=0;h<=I;h+=1){var r=O.get(h)||new Set;r.forEach(function(s){var u=s.key,c=s.node,R=s.children,w=R===void 0?[]:R;p.has(u)&&!x(c)&&w.filter(function(C){return!x(C.node)}).forEach(function(C){p.add(C.key)})})}for(var n=new Set,a=I;a>=0;a-=1){var l=O.get(a)||new Set;l.forEach(function(s){var u=s.parent,c=s.node;if(x(c)||!s.parent||n.has(s.parent.key))return;if(x(s.parent.node)){n.add(u.key);return}var R=!0,w=!1;(u.children||[]).filter(function(C){return!x(C.node)}).forEach(function(C){var D=C.key,S=p.has(D);R&&!S&&(R=!1),!w&&(S||m.has(D))&&(w=!0)}),R&&p.add(u.key),w&&m.add(u.key),n.add(u.key)})}return{checkedKeys:Array.from(p),halfCheckedKeys:Array.from(Y(m,p))}}function L(H,O,I,x,p){for(var m=new Set(H),h=new Set(O),r=0;r<=x;r+=1){var n=I.get(r)||new Set;n.forEach(function(u){var c=u.key,R=u.node,w=u.children,C=w===void 0?[]:w;!m.has(c)&&!h.has(c)&&!p(R)&&C.filter(function(D){return!p(D.node)}).forEach(function(D){m.delete(D.key)})})}h=new Set;for(var a=new Set,l=x;l>=0;l-=1){var s=I.get(l)||new Set;s.forEach(function(u){var c=u.parent,R=u.node;if(p(R)||!u.parent||a.has(u.parent.key))return;if(p(u.parent.node)){a.add(c.key);return}var w=!0,C=!1;(c.children||[]).filter(function(D){return!p(D.node)}).forEach(function(D){var S=D.key,b=m.has(S);w&&!b&&(w=!1),!C&&(b||h.has(S))&&(C=!0)}),w||m.delete(c.key),C&&h.add(c.key),a.add(c.key)})}return{checkedKeys:Array.from(m),halfCheckedKeys:Array.from(Y(h,m))}}function P(H,O,I,x){var p=[],m;x?m=x:m=j;var h=new Set(H.filter(function(l){var s=!!I[l];return s||p.push(l),s})),r=new Map,n=0;Object.keys(I).forEach(function(l){var s=I[l],u=s.level,c=r.get(u);c||(c=new Set,r.set(u,c)),c.add(s),n=Math.max(n,u)}),Object(re.a)(!p.length,"Tree missing follow keys: ".concat(p.slice(0,100).map(function(l){return"'".concat(l,"'")}).join(", ")));var a;return O===!0?a=G(h,r,n,m):a=L(h,O.halfCheckedKeys,r,n,m),a}},OLES:function(Gt,et,k){"use strict";var re=k("U8pU"),Y=k("VTBJ"),j=k("Ff2n"),G=k("q1tI"),L=k("uciX"),P=k("7ixt"),H=function(h){var r=h.overlay,n=h.prefixCls,a=h.id,l=h.overlayInnerStyle;return G.createElement("div",{className:"".concat(n,"-inner"),id:a,role:"tooltip",style:l},typeof r=="function"?r():r)},O=H,I=function(h,r){var n=h.overlayClassName,a=h.trigger,l=a===void 0?["hover"]:a,s=h.mouseEnterDelay,u=s===void 0?0:s,c=h.mouseLeaveDelay,R=c===void 0?.1:c,w=h.overlayStyle,C=h.prefixCls,D=C===void 0?"rc-tooltip":C,S=h.children,b=h.onVisibleChange,_=h.afterVisibleChange,f=h.transitionName,d=h.animation,g=h.placement,E=g===void 0?"right":g,T=h.align,F=T===void 0?{}:T,U=h.destroyTooltipOnHide,K=U===void 0?!1:U,z=h.defaultVisible,M=h.getTooltipContainer,y=h.overlayInnerStyle,W=Object(j.a)(h,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),X=Object(G.useRef)(null);Object(G.useImperativeHandle)(r,function(){return X.current});var te=Object(Y.a)({},W);"visible"in h&&(te.popupVisible=h.visible);var pe=function(){var He=h.arrowContent,Ce=He===void 0?null:He,ue=h.overlay,se=h.id;return[G.createElement("div",{className:"".concat(D,"-arrow"),key:"arrow"},Ce),G.createElement(O,{key:"content",prefixCls:D,id:se,overlay:ue,overlayInnerStyle:y})]},Ie=!1,Ee=!1;if(typeof K=="boolean")Ie=K;else if(K&&Object(re.a)(K)==="object"){var Te=K.keepParent;Ie=Te===!0,Ee=Te===!1}return G.createElement(L.a,Object.assign({popupClassName:n,prefixCls:D,popup:pe,action:l,builtinPlacements:P.a,popupPlacement:E,ref:X,popupAlign:F,getPopupContainer:M,onPopupVisibleChange:b,afterPopupVisibleChange:_,popupTransitionName:f,popupAnimation:d,defaultPopupVisible:z,destroyPopupOnHide:Ie,autoDestroy:Ee,mouseLeaveDelay:R,popupStyle:w,mouseEnterDelay:u},te),S)},x=Object(G.forwardRef)(I),p=et.a=x},OZM5:function(Gt,et,k){"use strict";k.d(et,"b",function(){return x}),k.d(et,"a",function(){return p}),k.d(et,"k",function(){return m}),k.d(et,"h",function(){return h}),k.d(et,"i",function(){return r}),k.d(et,"g",function(){return n}),k.d(et,"c",function(){return a}),k.d(et,"d",function(){return l}),k.d(et,"j",function(){return c}),k.d(et,"e",function(){return R}),k.d(et,"f",function(){return w});var re=k("KQm4"),Y=k("U8pU"),j=k("Ff2n"),G=k("q1tI"),L=k.n(G),P=k("Kwbf"),H=k("WaYH"),O=.25,I=2;function x(C,D){var S=C.slice(),b=S.indexOf(D);return b>=0&&S.splice(b,1),S}function p(C,D){var S=C.slice();return S.indexOf(D)===-1&&S.push(D),S}function m(C){return C.split("-")}function h(C,D){return"".concat(C,"-").concat(D)}function r(C){return C&&C.type&&C.type.isTreeNode}function n(C,D){var S=[C],b=D[C];function _(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];f.forEach(function(d){var g=d.key,E=d.children;S.push(g),_(E)})}return _(b.children),S}function a(C,D){var S=C.clientY,b=D.selectHandle.getBoundingClientRect(),_=b.top,f=b.bottom,d=b.height,g=Math.max(d*O,I);return S<=_+g?-1:S>=f-g?1:0}function l(C,D){if(!C)return;var S=D.multiple;return S?C.slice():C.length?[C[0]]:C}var s=function(D){return D};function u(C,D){if(!C)return[];var S=D||{},b=S.processProps,_=b===void 0?s:b,f=Array.isArray(C)?C:[C];return f.map(function(d){var g=d.children,E=Object(j.a)(d,["children"]),T=u(g,D);return L.a.createElement(H.a,Object.assign({},_(E)),T)})}function c(C){if(!C)return null;var D;if(Array.isArray(C))D={checkedKeys:C,halfCheckedKeys:void 0};else if(Object(Y.a)(C)==="object")D={checkedKeys:C.checked||void 0,halfCheckedKeys:C.halfChecked||void 0};else return Object(P.a)(!1,"`checkedKeys` is not an array or an object"),null;return D}function R(C,D){var S=new Set;function b(_){if(S.has(_))return;var f=D[_];if(!f)return;S.add(_);var d=f.parent,g=f.node;if(g.disabled)return;d&&b(d.key)}return(C||[]).forEach(function(_){b(_)}),Object(re.a)(S)}function w(C){var D={};return Object.keys(C).forEach(function(S){(S.startsWith("data-")||S.startsWith("aria-"))&&(D[S]=C[S])}),D}},Ot1p:function(Gt,et,k){"use strict";var re=k("2qtc"),Y=k("kLXV"),j=k("rAM+"),G=k("miYZ"),L=k("tsqr"),P=k("9og8"),H=k("tJVT"),O=k("jrin"),I=k("WmNS"),x=k.n(I),p=k("q1tI"),m=k.n(p),h=k("VrN/"),r=k.n(h),n=k("bdgK"),a=k("p77/"),l=k("Bd2K"),s=k("ELLl"),u=k("19Vz"),c=k("lZu9"),R=k("+NIl"),w=k("kSUc"),C=k("9Bee"),D=function(ze){var ut=ze.value,Dt=ut===void 0?"":ut,rn=ze.className,mn=ze.showTextOnly,gt=ze.showLines,Vt=ze.style,Tt=Vt===void 0?{}:Vt,Rt=Object(p.useMemo)(function(){return""},[Dt]);return m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{dangerouslySetInnerHTML:{__html:Rt}}))},S=k("0Owb"),b=k("dejd"),_=k("C+DQ"),f=k("1vsH"),d=k("m3rI"),g=[{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 E(ze){var ut=ze.onActionCallback,Dt=ze.title,rn=ze.icon,mn=ze.actionName,gt=ze.className,Vt=gt===void 0?"":gt,Tt=ze.children;function Rt(){ut(mn)}return m.a.createElement("a",{title:Dt,className:Vt,onClick:Rt},m.a.createElement("i",{className:"md-iconfont ".concat(rn)}),Tt)}var T=function(ze){var ut=ze.watch,Dt=ze.showNullButton,rn=ze.onActionCallback,mn=ze.fullScreen,gt=ze.insertTemp,Vt=ze.hidetoolBar,Tt=ze.uuid,Rt=ze.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(f.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(f.F)("_educoder_session"),"&key=").concat(Tt,"&api=").concat(encodeURIComponent(d.a.PROXY_SERVER)));var mt=[].concat(g,[{title:"".concat(ut?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(ut?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return m.a.createElement("ul",{className:"markdown-toolbar-container"},!Vt&&mt.map(function(_e,Ge){return m.a.createElement("li",{key:Ge},_e.actionName?m.a.createElement(E,Object(S.a)({},_e,{onActionCallback:rn})):m.a.createElement("span",{className:"v-line"}))}),Dt?m.a.createElement("li",null,m.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:rn},m.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,gt&&m.a.createElement("li",null,m.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(gt),onActionCallback:rn},m.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),m.a.createElement("li",{className:"btn-full-screen"},m.a.createElement(E,{icon:"".concat(mn?"icon-shrink":"icon-enlarge"),title:mn?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:rn})))},F=k("M8RZ"),U=k("+L6B"),K=k("2/Rp"),z=k("y8nQ"),M=k("Vl3Y"),y=k("5NDa"),W=k("5rEg"),X={labelCol:{span:4},wrapperCol:{span:20}},te=function(ze){var ut=ze.callback,Dt=ze.onCancel;function rn(mn){ut(mn)}return m.a.createElement(M.a,Object(S.a)({},X,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:rn}),m.a.createElement(M.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},m.a.createElement(W.a,null)),m.a.createElement(M.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},m.a.createElement(W.a,null)),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(K.a,{type:"ghost",onClick:Dt},"\u53D6\u6D88")))},pe=k("7ahc"),Ie=k("HmJG"),Ee=k("BjJ7"),Te=M.a.useForm,We={width:280,marginRight:10},He={labelCol:{span:5},wrapperCol:{span:19}},Ce=function(ze){var ut=ze.callback,Dt=ze.onCancel,rn=Te(),mn=Object(H.a)(rn,1),gt=mn[0];function Vt(mt){ut(mt)}function Tt(mt,_e){if(mt.status===-1){L.b.error(mt.message);return}gt.setFieldsValue({src:"/api/attachments/".concat(mt.id),type:_e.type})}function Rt(mt){var _e=mt.target.files[0];se(_e,Tt)}return m.a.createElement(M.a,Object(S.a)({form:gt},He,{className:"upload-image-panel",onFinish:Vt}),m.a.createElement(M.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},m.a.createElement("div",{className:"flex-container"},m.a.createElement(M.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},m.a.createElement(W.a,{style:We})),m.a.createElement(ue,{onFileChange:Rt}))),m.a.createElement(M.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},m.a.createElement(W.a,{style:{width:264}})),m.a.createElement(M.a.Item,{style:{textAlign:"right"}},m.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(K.a,{type:"ghost",onClick:Dt},"\u53D6\u6D88")))};function ue(ze){var ut=ze.onFileChange;return m.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",m.a.createElement("input",{type:"file",onChange:ut}))}function se(ze,ut){if(!ze)throw new String("\u6CA1\u6709\u6587\u4EF6");var Dt=new FormData;Dt.append("editormd-image-file",ze),Dt.append("file_param_name","editormd-image-file"),Dt.append("byxhr","true");var rn=new window.XMLHttpRequest;rn.withCredentials=!0,rn.addEventListener("load",function(mn){ut(JSON.parse(mn.target.responseText),ze)},!1),rn.addEventListener("error",function(mn){console.error(mn)},!1),rn.open("POST","".concat(Ee.a,"/api/attachments.json")),rn.send(Dt)}var we=k("giR+"),ge=k("fyUT"),Ke=k("7Kak"),st=k("9yH6"),ne=st.a.Group,$={margin:"0 8px"},J=function(ze){var ut=ze.callback,Dt=ze.onCancel;function rn(mn){ut(mn)}return m.a.createElement(M.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:rn},m.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},m.a.createElement("span",{style:$},"\u5355\u5143\u683C\u6570\uFF1A"),m.a.createElement("span",{style:$},"\u884C\u6570"),m.a.createElement(M.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},m.a.createElement(ge.a,null)),m.a.createElement("span",{style:$},"\u5217\u6570"),m.a.createElement(M.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},m.a.createElement(ge.a,null))),m.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},m.a.createElement("span",{style:$},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),m.a.createElement(M.a.Item,{name:"align"},m.a.createElement(ne,null,m.a.createElement(st.a,{value:"default"},m.a.createElement("i",{className:"fa fa-align-justify"})),m.a.createElement(st.a,{value:"left"},m.a.createElement("i",{className:"fa fa-align-left"})),m.a.createElement(st.a,{value:"center"},m.a.createElement("i",{className:"fa fa-align-center"})),m.a.createElement(st.a,{value:"right"},m.a.createElement("i",{className:"fa fa-align-right"}))))),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(K.a,{type:"ghost",onClick:Dt},"\u53D6\u6D88")))},me=k("ErOA"),xe=k("7Cbv"),ke="link",$e="upload-image",Pt="code-block",Xt="add-table",Bt="------------",lt={default:Bt,left:":".concat(Bt),center:":".concat(Bt,":"),right:"".concat(Bt,":")},jt=k("9VGf"),pn,it;function Ze(){}var bt=0,Mt=1e4,ct="\u2581",wt=`
**\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 Ve(ze){return/^\d+$/.test(ze)?"".concat(ze,"px"):ze}var Se=navigator.platform.toUpperCase().indexOf("MAC")>=0,Pe=Se?"Cmd":"Ctrl",ce=["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"],de=(pn={},Object(O.a)(pn,Pe+"-B","bold"),Object(O.a)(pn,Pe+"-I","italic"),pn),be=(it={},Object(O.a)(it,ke,"\u6DFB\u52A0\u94FE\u63A5"),Object(O.a)(it,Pt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(O.a)(it,$e,"\u6DFB\u52A0\u6587\u4EF6"),Object(O.a)(it,Xt,"\u6DFB\u52A0\u8868\u683C"),it),je=et.a=function(ze){var ut=ze.defaultValue,Dt=ut===void 0?"":ut,rn=ze.onChange,mn=ze.width,gt=mn===void 0?"100%":mn,Vt=ze.height,Tt=Vt===void 0?400:Vt,Rt=ze.miniToolbar,mt=Rt===void 0?!1:Rt,_e=ze.isFocus,Ge=_e===void 0?!1:_e,kt=ze.watch,vt=ze.insertTemp,Qt=ze.mode,Jt=Qt===void 0?"markdown":Qt,Le=ze.id,tt=Le===void 0?"markdown-editor-id":Le,Lt=ze.showResizeBar,Ht=Lt===void 0?!1:Lt,ln=ze.noStorage,hn=ln===void 0?!1:ln,ir=ze.showNullButton,Un=ir===void 0?!1:ir,dn=ze.hidetoolBar,fr=dn===void 0?!1:dn,Kr=ze.fullScreen,tr=Kr===void 0?!1:Kr,rr=ze.onBlur,Nr=ze.onCMBeforeChange,oi=ze.onFullScreen,hi=ze.className,an=hi===void 0?"":hi,Xn=ze.disablePaste,fi=Xn===void 0?!1:Xn,Ei=ze.placeholder,ri=Ei===void 0?"":Ei,ii=ze.values,ee=ii===void 0?"":ii,A=Object(p.useState)(null),N=Object(H.a)(A,2),V=N[0],oe=N[1],q=Object(p.useState)(Dt),Je=Object(H.a)(q,2),Kt=Je[0],gn=Je[1],Bn=Object(p.useState)(kt),en=Object(H.a)(Bn,2),Gn=en[0],ar=en[1],Ur=Object(p.useState)(tr),si=Object(H.a)(Ur,2),Jr=si[0],qr=si[1],Ni=Object(p.useState)(""),Qi=Object(H.a)(Ni,2),ai=Qi[0],Ri=Qi[1],Vi=Object(p.useState)(0),Ui=Object(H.a)(Vi,2),pi=Ui[0],Ji=Ui[1],Mi=Object(p.useState)(Tt),ea=Object(H.a)(Mi,2),la=ea[0],Nn=ea[1],Q=Object(p.useState)(!1),ve=Object(H.a)(Q,2),Ae=ve[0],De=ve[1],at=Object(p.useRef)(Object(xe.a)()),Be=Object(p.useRef)(!1),rt=Object(p.useRef)(),ht=Object(p.useRef)(),Me=Object(p.useRef)(),ft=Object(p.useRef)(),Ot=Object(p.useRef)(),Ct=function(){var Oe=Object(P.a)(x.a.mark(function It(){var Ut,tn;return x.a.wrap(function(Sn){for(;;)switch(Sn.prev=Sn.next){case 0:return Sn.next=2,Object(me.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:at.current}});case 2:tn=Sn.sent,tn!=null&&(Ut=tn.attachments)!==null&&Ut!==void 0&&Ut.length&&(console.log("cm:",V,ht),tn.attachments.map(function(An){An.content_type.indexOf("image")>-1?V.replaceSelection("![,](/api/attachments/".concat(An.id,"?type=").concat(An.content_type,")")):An.content_type.indexOf("video")>-1?V.replaceSelection('<video width="100%" controls src="'.concat(d.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):An.content_type.indexOf("pdf")>-1?V.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(An.id,"?type=").concat(An.content_type,'&disposition=inline" target="_blank">').concat(An.name,"</a>")):V.replaceSelection("[".concat(An.name,"](").concat(d.a.API_SERVER,"/api/attachments/").concat(An.id,"?type=").concat(An.content_type,")"))}));case 4:case"end":return Sn.stop()}},It)}));return function(){return Oe.apply(this,arguments)}}();Object(p.useEffect)(function(){gn(ee),V==null||V.setValue(ee)},[ee]),Object(p.useEffect)(function(){oi==null||oi(Jr)},[Jr]),Object(p.useEffect)(function(){if(ht.current){var Oe=r.a.fromTextArea(ht.current,{mode:Jt,lineNumbers:!mt,lineWrapping:!0,value:Dt,autoCloseTags:!0,autoCloseBrackets:!0});Ge&&Oe.focus();function It(Ut,tn){if(fi){tn.preventDefault();return}var un=tn.clipboardData;if(un){var Sn=un.types.toString(),An=un.items;if(Sn==="Files"||un.types.indexOf("Files")>-1){if(tn.preventDefault(),Jt=="stex")return;try{var $n,pr=An[1];(($n=An[0])===null||$n===void 0?void 0:$n.kind)==="file"&&(pr=An[0]);var Tn=pr.getAsFile(),jn=Tn.name.split(".").pop();se(Tn,function(wn){if(wn.id){var fn,Kn,yr;(Tn==null||((fn=Tn.type)===null||fn===void 0)?void 0:fn.indexOf("image"))>-1?Oe.replaceSelection("![,](/api/attachments/".concat(wn.id,"?type=").concat(wn.content_type,")")):(Tn==null||((Kn=Tn.type)===null||Kn===void 0)?void 0:Kn.indexOf("video"))>-1?Oe.replaceSelection('<video width="100%" controls src="'.concat(d.a.API_SERVER,"/api/attachments/").concat(wn.id,'"></video>')):(Tn==null||((yr=Tn.type)===null||yr===void 0)?void 0:yr.indexOf("pdf"))>-1?Oe.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(wn.id,"?type=").concat(Tn.type,'&disposition=inline" target="_blank">').concat(Tn.name,"</a>")):ce.includes(jn)?Oe.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(wn.id,'?type=office&disposition=inline" target="_blank">').concat(Tn.name,"</a>")):Oe.replaceSelection("[".concat(Tn.name,"](").concat(d.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){L.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Oe.on("paste",It),Oe.on("dragleave",function(Ut,tn){Me.current.classList.remove("mouse-hover-md")}),Oe.on("dragover",function(Ut,tn){Me.current.classList.add("mouse-hover-md")}),Oe.on("drop",function(Ut,tn){Me.current.classList.add("mouse-hover-md");var un;if(un=tn.dataTransfer.files,un.length>0){tn.preventDefault(),tn.stopPropagation();for(var Sn=function(pr){var Tn=un[pr],jn=Tn.name.split(".").pop();se(Tn,function(wn){if(wn.id){var fn,Kn,yr;(Tn==null||((fn=Tn.type)===null||fn===void 0)?void 0:fn.indexOf("image"))>-1?Oe.replaceSelection("![,](/api/attachments/".concat(wn.id,"?type=").concat(wn.content_type,")")):(Tn==null||((Kn=Tn.type)===null||Kn===void 0)?void 0:Kn.indexOf("video"))>-1?Oe.replaceSelection('<video width="100%" controls src="'.concat(d.a.API_SERVER,"/api/attachments/").concat(wn.id,'"></video>')):(Tn==null||((yr=Tn.type)===null||yr===void 0)?void 0:yr.indexOf("pdf"))>-1?Oe.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(wn.id,"?type=").concat(Tn.type,'&disposition=inline" target="_blank">').concat(Tn.name,"</a>")):ce.includes(jn)?Oe.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(wn.id,'?type=office&disposition=inline" target="_blank">').concat(Tn.name,"</a>")):Oe.replaceSelection("[".concat(Tn.name,"](").concat(d.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")})},An=0;An<un.length;An++)Sn(An)}}),oe(Oe),function(){Oe.off("paste",It)}}},[]);var _t=Object(p.useCallback)(function(){if(Me.current)try{}catch(Oe){console.log(Oe,"---- to set md editor body height")}},[la,Me,Jr]);Object(p.useEffect)(function(){function Oe(){var Ut=new n.default(function(tn){var un=Object(j.a)(tn),Sn;try{for(un.s();!(Sn=un.n()).done;){var An=Sn.value;(An.target.offsetHeight>0||An.target.offsetWidth>0)&&(_t(),V.setSize("100%","100%"),V.refresh())}}catch($n){un.e($n)}finally{un.f()}});return Ut.observe(ht.current.parentElement),Ut}if(V){var It=Oe();return function(){It.unobserve(ht.current.parentElement)}}},[V,_t]),Object(p.useEffect)(function(){if(V){for(var Oe=[],It=function(){var An=tn[Ut];un=Object(H.a)(An,2);var $n=un[0],pr=un[1],Tn=Object(O.a)({},$n,function(){Et(pr)});Oe.push(Tn),V.addKeyMap(Tn)},Ut=0,tn=Object.entries(de);Ut<tn.length;Ut++){var un;It()}return rt.current=setInterval(function(){Be.current&&Ct()},4e3),function(){clearInterval(rt.current);var Sn=Object(j.a)(Oe),An;try{for(Sn.s();!(An=Sn.n()).done;){var $n=An.value;V.removeKeyMap($n)}}catch(pr){Sn.e(pr)}finally{Sn.f()}}}},[V]),Object(p.useEffect)(function(){tr!==Jr&&qr(tr)},[tr]),Object(jt.a)(function(){if(!hn&&pi>0){var Oe=new Date().getTime(),It=window.sessionStorage.getItem(tt);Oe>=pi+Mt&&(!It||It!==Kt)&&(window.sessionStorage.setItem(tt,Kt),De(!0))}},Mt),Object(p.useEffect)(function(){ar(kt)},[V,kt]),Object(p.useEffect)(function(){V&&(Ge&&V.focus())},[V,Ge]),Object(p.useEffect)(function(){if(Gn&&V){var Oe=V.getScrollerElement();function It(Ut){var tn=Ut.target;if(Ot.current){var un=tn.scrollTop/tn.scrollHeight;Ot.current.scrollTop=Ot.current.scrollHeight*un}}return Oe.addEventListener("scroll",It),function(){Oe.removeEventListener("scroll",It)}}},[V,Gn]),Object(p.useEffect)(function(){if(V&&Nr){function Oe(It,Ut){Nr(It,Ut)}return V.on("beforeChange",Oe),function(){V.off("beforeChange",Oe)}}},[V,Nr]),Object(p.useEffect)(function(){if(V&&rr){function Oe(){rr(V.getValue())}return V.on("blur",Oe),function(){V.off("blur",Oe)}}},[V,rr]),Object(p.useEffect)(function(){if(V){function Oe(It){var Ut=It.getValue();gn(Ut),Ji(new Date().getTime()),It.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),rn&&rn(Ut)}return V.on("change",Oe),function(){V.off("change",Oe)}}},[V,rn]),Object(p.useEffect)(function(){V&&(Dt==null?(V.setValue(""),gn("")):Dt!==V.getValue()&&(V.setValue(Dt),gn(Dt),V.setCursor(V.lineCount(),0)))},[V,Dt]);var Et=Object(p.useCallback)(function(Oe){var It=V.getCursor(),Ut=V.getSelection(),tn=Ut.split(`
`);switch(Oe){case"bold":return V.replaceSelection("**"+Ut+"**"),Ut===""&&V.setCursor(It.line,It.ch+2),V.focus();case"italic":return V.replaceSelection("*"+Ut+"*"),Ut===""&&V.setCursor(It.line,It.ch+1),V.focus();case"code":return V.replaceSelection("`"+Ut+"`"),Ut===""&&V.setCursor(It.line,It.ch+1),V.focus();case"inline-latex":return V.replaceSelection("`$$"+Ut+"$$`"),Ut===""&&V.setCursor(It.line,It.ch+3),V.focus();case"latex":return V.replaceSelection("```latex\n"+Ut+"\n```"),V.setCursor(It.line+1,Ut.length+1),V.focus();case"line-break":return V.replaceSelection(`<br/>
`),V.focus();case"list-ul":return Ut===""?V.replaceSelection("- "+Ut):V.replaceSelection(tn.map(function(un){return un===""?"":"- ".concat(un)}).join(`
`)),V.focus();case"list-ol":return Ut===""?V.replaceSelection("1. "+Ut):V.replaceSelection(tn.map(function(un,Sn){return un===""?"":"".concat(Sn+1,". ").concat(un)}).join(`
`)),V.focus();case"add-null-ch":return Ut===""&&V.setCursor(It.line,It.ch+1),V.replaceSelection(ct),V.focus();case"inster-template-1":return Ut===""&&V.setCursor(It.line,It.ch),V.replaceSelection(wt),V.focus();case"eraser":return V.setValue(""),V.focus();case"trigger-watch":return ar(!Gn),V.focus();case"trigger-full-screen":return qr(!Jr),V.focus();case ke:Ri(ke);return;case Pt:Ri(Pt);return;case $e:Ri($e);return;case Xt:Ri(Xt);return;default:throw new Error}},[V,Gn,Jr]),St=Object(p.useCallback)(function(Oe){Ri("");switch(ai){case ke:var It=Oe.title,Ut=Oe.link;return V.replaceSelection("[".concat(It,"](").concat(Ut,")")),V.focus();case Pt:var tn=Oe.language,un=Oe.content;return V.replaceSelection(["```"+tn,un,"```"].join(`
`)),V.focus();case $e:var Sn=Oe.src,An=Oe.alt;return An?V.replaceSelection("![ ".concat(An," ]( ").concat(Sn,' "').concat(An,'" )')):V.replaceSelection("![,](".concat(Sn,")")),V.focus();case Xt:for(var $n=Oe.row,pr=Oe.col,Tn=Oe.align,jn=`
`,wn=0;wn<$n;wn++){for(var fn=[],Kn=[],yr=0;yr<pr;yr++)wn===1&&Kn.push(lt[Tn]),fn.push(" ");wn===1&&(jn+="| ".concat(Kn.join(" | "),` |
`)),jn+="| ".concat(fn.join(pr===1?"":" | "),` |
`)}return V.replaceSelection(jn+`
`),V.focus();default:throw new Error}},[V,ai]),Fe=Object(p.useMemo)(function(){switch(ai){case ke:return m.a.createElement(te,{callback:St,onCancel:At});case Pt:return m.a.createElement(pe.b,{callback:St,onCancel:At});case $e:return m.a.createElement(Ce,{callback:St,onCancel:At});case Xt:return m.a.createElement(J,{callback:St,onCancel:At});default:return null}},[ai]);function At(){Ri("")}Object(p.useEffect)(function(){if(ft.current){var Oe=ft.current,It=!1,Ut=0;function tn(An){It=!0,Ut=An.pageY}function un(){It=!1}function Sn(An){if(It){var $n=An.pageY-Ut;$n<0&&($n=0),$n>300&&($n=300);var pr=Tt+$n+"px";Nn(pr)}}return Oe.addEventListener("mousedown",tn),document.addEventListener("mousemove",Sn),document.addEventListener("mouseup",un),function(){Oe.removeEventListener("mousedown",tn),document.removeEventListener("mousemove",Sn),document.removeEventListener("mouseup",un)}}},[V,ft]),Object(p.useEffect)(function(){Nn(Tt)},[Tt]);var Zt=Ve(gt),sn=Ve(la),On={width:Zt,height:sn},In=Object(p.useMemo)(function(){if(pi){var Oe=new Date(pi),It=Oe.getHours(),Ut=Oe.getMinutes(),tn=Oe.getSeconds();return It=It<10?"0"+It:It,Ut=Ut<10?"0"+Ut:Ut,tn=tn<10?"0"+tn:tn,"".concat(It,":").concat(Ut,":").concat(tn)}return 0},[pi]);function Ft(){window.sessionStorage.removeItem(tt),De(!1),Ji(0)}function $t(){De(!1),Ji(0),V.setValue(window.sessionStorage.getItem(tt))}function Fn(Oe,It){var Ut=V.getValue();Ut=Ut.replace(Oe,It),gn(Ut),V==null||V.setValue(Ut)}return m.a.createElement(p.Fragment,null,m.a.createElement("div",{className:"markdown-editor-wrapper",ref:Me},m.a.createElement("div",{className:"markdown-editor-container ".concat(an," ").concat(Gn?"on-preview":""," ").concat(mt?"mini":""," ").concat(Jr?"full-screen":""),style:On},m.a.createElement(T,{insertTemp:vt,watch:Gn,fullScreen:Jr,showNullButton:Un,onActionCallback:Et,hidetoolBar:fr,uuid:at.current,setOpenPhones:function(){Be.current=!0}}),m.a.createElement("div",{className:"markdown-editor-body"},m.a.createElement("div",{className:"codemirror-container"},m.a.createElement("textarea",{ref:ht,placeholder:ri})),Gn?m.a.createElement("div",{ref:Ot,className:"preview-container"},Jt==="stex"&&m.a.createElement(D,{value:Kt}),Jt!=="stex"&&m.a.createElement(C.a,{edit:!0,value:Kt,replaces:Fn})):null))),Ht?m.a.createElement("a",{ref:ft,className:"editor-resize"}):null,m.a.createElement(F.a,null,be[ai]?m.a.createElement(Y.a,{centered:!0,title:be[ai],visible:!0,onCancel:At,footer:null,className:"markdown-popup-form"},Fe):null))}},RotF:function(Gt,et,k){Gt.exports=k("LSTS")},"SA+Z":function(Gt,et,k){var re=k("wTVA"),Y=k("EbDI"),j=k("ZhPi"),G=k("wkBT");function L(P){return re(P)||Y(P)||j(P)||G()}Gt.exports=L,Gt.exports.__esModule=!0,Gt.exports.default=Gt.exports},SJMd:function(Gt,et){/**
* @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 k,re,Y,j=!1,G,L;window.PR_SHOULD_USE_CONTINUATION=!0;var P,H;(function(){var O=window,I=["break,continue,do,else,for,if,return,while"],x=[I,"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"],p=[x,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],m=[p,"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"],h=[p,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],r=[p,"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"],n="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",a=[p,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],l="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",s=[I,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],u=[I,"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"],c=[I,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=[m,r,h,a,l,s,u,c],w=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,C="str",D="kwd",S="com",b="typ",_="lit",f="pun",d="pln",g="tag",E="dec",T="src",F="atn",U="atv",K="nocode",z="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function M(ne){for(var $=0,J=!1,me=!1,xe=0,ke=ne.length;xe<ke;++xe){var $e=ne[xe];if($e.ignoreCase)me=!0;else if(/[a-z]/i.test($e.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){J=!0,me=!1;break}}var Pt={b:8,t:9,n:10,v:11,f:12,r:13};function Xt(it){var Ze=it.charCodeAt(0);if(Ze!==92)return Ze;var bt=it.charAt(1);return Ze=Pt[bt],Ze||("0"<=bt&&bt<="7"?parseInt(it.substring(1),8):bt==="u"||bt==="x"?parseInt(it.substring(2),16):it.charCodeAt(1))}function Bt(it){if(it<32)return(it<16?"\\x0":"\\x")+it.toString(16);var Ze=String.fromCharCode(it);return Ze==="\\"||Ze==="-"||Ze==="]"||Ze==="^"?"\\"+Ze:Ze}function lt(it){var Ze=it.substring(1,it.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),bt=[],Mt=Ze[0]==="^",ct=["["];Mt&&ct.push("^");for(var wt=Mt?1:0,Ve=Ze.length;wt<Ve;++wt){var Se=Ze[wt];if(/\\[bdsw]/i.test(Se))ct.push(Se);else{var Pe=Xt(Se),ce;wt+2<Ve&&Ze[wt+1]==="-"?(ce=Xt(Ze[wt+2]),wt+=2):ce=Pe,bt.push([Pe,ce]),ce<65||Pe>122||(ce<65||Pe>90||bt.push([Math.max(65,Pe)|32,Math.min(ce,90)|32]),ce<97||Pe>122||bt.push([Math.max(97,Pe)&~32,Math.min(ce,122)&~32]))}}bt.sort(function(ze,ut){return ze[0]-ut[0]||ut[1]-ze[1]});for(var de=[],be=[],wt=0;wt<bt.length;++wt){var je=bt[wt];je[0]<=be[1]+1?be[1]=Math.max(be[1],je[1]):de.push(be=je)}for(var wt=0;wt<de.length;++wt){var je=de[wt];ct.push(Bt(je[0])),je[1]>je[0]&&(je[1]+1>je[0]&&ct.push("-"),ct.push(Bt(je[1])))}return ct.push("]"),ct.join("")}function jt(it){for(var Ze=it.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),bt=Ze.length,Mt=[],ct=0,wt=0;ct<bt;++ct){var Ve=Ze[ct];if(Ve==="(")++wt;else if(Ve.charAt(0)==="\\"){var Se=+Ve.substring(1);Se&&(Se<=wt?Mt[Se]=-1:Ze[ct]=Bt(Se))}}for(var ct=1;ct<Mt.length;++ct)Mt[ct]===-1&&(Mt[ct]=++$);for(var ct=0,wt=0;ct<bt;++ct){var Ve=Ze[ct];if(Ve==="(")++wt,Mt[wt]||(Ze[ct]="(?:");else if(Ve.charAt(0)==="\\"){var Se=+Ve.substring(1);Se&&Se<=wt&&(Ze[ct]="\\"+Mt[Se])}}for(var ct=0;ct<bt;++ct)Ze[ct]==="^"&&Ze[ct+1]!=="^"&&(Ze[ct]="");if(it.ignoreCase&&J)for(var ct=0;ct<bt;++ct){var Ve=Ze[ct],Pe=Ve.charAt(0);Ve.length>=2&&Pe==="["?Ze[ct]=lt(Ve):Pe!=="\\"&&(Ze[ct]=Ve.replace(/[a-zA-Z]/g,function(be){var je=be.charCodeAt(0);return"["+String.fromCharCode(je&~32,je|32)+"]"}))}return Ze.join("")}for(var pn=[],xe=0,ke=ne.length;xe<ke;++xe){var $e=ne[xe];if($e.global||$e.multiline)throw new Error(""+$e);pn.push("(?:"+jt($e)+")")}return new RegExp(pn.join("|"),me?"gi":"g")}function y(ne,$){var J=/(?:^|\s)nocode(?:\s|$)/,me=[],xe=0,ke=[],$e=0;function Pt(Xt){var Bt=Xt.nodeType;if(Bt==1){if(J.test(Xt.className))return;for(var lt=Xt.firstChild;lt;lt=lt.nextSibling)Pt(lt);var jt=Xt.nodeName.toLowerCase();(jt==="br"||jt==="li")&&(me[$e]=`
`,ke[$e<<1]=xe++,ke[$e++<<1|1]=Xt)}else if(Bt==3||Bt==4){var pn=Xt.nodeValue;pn.length&&($?pn=pn.replace(/\r\n?/g,`
`):pn=pn.replace(/[ \t\r\n]+/g," "),me[$e]=pn,ke[$e<<1]=xe,xe+=pn.length,ke[$e++<<1|1]=Xt)}}return Pt(ne),{sourceCode:me.join("").replace(/\n$/,""),spans:ke}}function W(ne,$,J,me,xe){if(!J)return;var ke={sourceNode:ne,pre:1,langExtension:null,numberLines:null,sourceCode:J,spans:null,basePos:$,decorations:null};me(ke),xe.push.apply(xe,ke.decorations)}var X=/\S/;function te(ne){for(var $=void 0,J=ne.firstChild;J;J=J.nextSibling){var me=J.nodeType;$=me===1?$?ne:J:me===3&&X.test(J.nodeValue)?ne:$}return $===ne?void 0:$}function pe(ne,$){var J={},me;(function(){for(var $e=ne.concat($),Pt=[],Xt={},Bt=0,lt=$e.length;Bt<lt;++Bt){var jt=$e[Bt],pn=jt[3];if(pn)for(var it=pn.length;--it>=0;)J[pn.charAt(it)]=jt;var Ze=jt[1],bt=""+Ze;Xt.hasOwnProperty(bt)||(Pt.push(Ze),Xt[bt]=null)}Pt.push(/[\0-\uffff]/),me=M(Pt)})();var xe=$.length,ke=function($e){for(var Pt=$e.sourceCode,Xt=$e.basePos,Bt=$e.sourceNode,lt=[Xt,d],jt=0,pn=Pt.match(me)||[],it={},Ze=0,bt=pn.length;Ze<bt;++Ze){var Mt=pn[Ze],ct=it[Mt],wt=void 0,Ve;if(typeof ct=="string")Ve=!1;else{var Se=J[Mt.charAt(0)];if(Se)wt=Mt.match(Se[1]),ct=Se[0];else{for(var Pe=0;Pe<xe;++Pe)if(Se=$[Pe],wt=Mt.match(Se[1]),wt){ct=Se[0];break}wt||(ct=d)}Ve=ct.length>=5&&ct.substring(0,5)==="lang-",Ve&&!(wt&&typeof wt[1]=="string")&&(Ve=!1,ct=T),Ve||(it[Mt]=ct)}var ce=jt;if(jt+=Mt.length,!Ve)lt.push(Xt+ce,ct);else{var de=wt[1],be=Mt.indexOf(de),je=be+de.length;wt[2]&&(je=Mt.length-wt[2].length,be=je-de.length);var ze=ct.substring(5);W(Bt,Xt+ce,Mt.substring(0,be),ke,lt),W(Bt,Xt+ce+be,de,ue(ze,de),lt),W(Bt,Xt+ce+je,Mt.substring(je),ke,lt)}}$e.decorations=lt};return ke}function Ie(ne){var $=[],J=[];ne.tripleQuotedStrings?$.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ne.multiLineStrings?$.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):$.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ne.verbatimStrings&&J.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var me=ne.hashComments;me&&(ne.cStyleComments?(me>1?$.push([S,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):$.push([S,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),J.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):$.push([S,/^#[^\r\n]*/,null,"#"])),ne.cStyleComments&&(J.push([S,/^\/\/[^\r\n]*/,null]),J.push([S,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var xe=ne.regexLiterals;if(xe){var ke=xe>1?"":`
\r`,$e=ke?".":"[\\S\\s]",Pt="/(?=[^/*"+ke+"])(?:[^/\\x5B\\x5C"+ke+"]|\\x5C"+$e+"|\\x5B(?:[^\\x5C\\x5D"+ke+"]|\\x5C"+$e+")*(?:\\x5D|$))+/";J.push(["lang-regex",RegExp("^"+z+"("+Pt+")")])}var Xt=ne.types;Xt&&J.push([b,Xt]);var Bt=(""+ne.keywords).replace(/^ | $/g,"");Bt.length&&J.push([D,new RegExp("^(?:"+Bt.replace(/[\s,]+/g,"|")+")\\b"),null]),$.push([d,/^\s+/,null,` \r
\xA0`]);var lt="^.[^\\s\\w.$@'\"`/\\\\]*";return ne.regexLiterals&&(lt+="(?!s*/)"),J.push([_,/^@[a-z_$][a-z_$@0-9]*/i,null],[b,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[d,/^[a-z_$][a-z_$@0-9]*/i,null],[_,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[d,/^\\[\s\S]?/,null],[f,new RegExp(lt),null]),pe($,J)}var Ee=Ie({keywords:R,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Te(ne,$,J){for(var me=/(?:^|\s)nocode(?:\s|$)/,xe=/\r\n?|\n/,ke=ne.ownerDocument,$e=ke.createElement("li");ne.firstChild;)$e.appendChild(ne.firstChild);var Pt=[$e];function Xt(Ze){var bt=Ze.nodeType;if(bt==1&&!me.test(Ze.className))if(Ze.nodeName==="br")Bt(Ze),Ze.parentNode&&Ze.parentNode.removeChild(Ze);else for(var Mt=Ze.firstChild;Mt;Mt=Mt.nextSibling)Xt(Mt);else if((bt==3||bt==4)&&J){var ct=Ze.nodeValue,wt=ct.match(xe);if(wt){var Ve=ct.substring(0,wt.index);Ze.nodeValue=Ve;var Se=ct.substring(wt.index+wt[0].length);if(Se){var Pe=Ze.parentNode;Pe.insertBefore(ke.createTextNode(Se),Ze.nextSibling)}Bt(Ze),Ve||Ze.parentNode.removeChild(Ze)}}}function Bt(Ze){for(;!Ze.nextSibling;)if(Ze=Ze.parentNode,!Ze)return;function bt(wt,Ve){var Se=Ve?wt.cloneNode(!1):wt,Pe=wt.parentNode;if(Pe){var ce=bt(Pe,1),de=wt.nextSibling;ce.appendChild(Se);for(var be=de;be;be=de)de=be.nextSibling,ce.appendChild(be)}return Se}for(var Mt=bt(Ze.nextSibling,0),ct;(ct=Mt.parentNode)&&ct.nodeType===1;)Mt=ct;Pt.push(Mt)}for(var lt=0;lt<Pt.length;++lt)Xt(Pt[lt]);$===($|0)&&Pt[0].setAttribute("value",$);var jt=ke.createElement("ol");jt.className="linenums";for(var pn=Math.max(0,$-1|0)||0,lt=0,it=Pt.length;lt<it;++lt)$e=Pt[lt],$e.className="L"+(lt+pn)%10,$e.firstChild||$e.appendChild(ke.createTextNode("\xA0")),jt.appendChild($e);ne.appendChild(jt)}function We(ne){var $=/\bMSIE\s(\d+)/.exec(navigator.userAgent);$=$&&+$[1]<=8;var J=/\n/g,me=ne.sourceCode,xe=me.length,ke=0,$e=ne.spans,Pt=$e.length,Xt=0,Bt=ne.decorations,lt=Bt.length,jt=0;Bt[lt]=xe;var pn,it;for(it=pn=0;it<lt;)Bt[it]!==Bt[it+2]?(Bt[pn++]=Bt[it++],Bt[pn++]=Bt[it++]):it+=2;for(lt=pn,it=pn=0;it<lt;){for(var Ze=Bt[it],bt=Bt[it+1],Mt=it+2;Mt+2<=lt&&Bt[Mt+1]===bt;)Mt+=2;Bt[pn++]=Ze,Bt[pn++]=bt,it=Mt}lt=Bt.length=pn;var ct=ne.sourceNode,wt="";ct&&(wt=ct.style.display,ct.style.display="none");try{for(var Ve=null;Xt<Pt;){var Se=$e[Xt],Pe=$e[Xt+2]||xe,ce=Bt[jt+2]||xe,Mt=Math.min(Pe,ce),de=$e[Xt+1],be;if(de.nodeType!==1&&(be=me.substring(ke,Mt))){$&&(be=be.replace(J,"\r")),de.nodeValue=be;var je=de.ownerDocument,ze=je.createElement("span");ze.className=Bt[jt+1];var ut=de.parentNode;ut.replaceChild(ze,de),ze.appendChild(de),ke<Pe&&($e[Xt+1]=de=je.createTextNode(me.substring(Mt,Pe)),ut.insertBefore(de,ze.nextSibling))}ke=Mt,ke>=Pe&&(Xt+=2),ke>=ce&&(jt+=2)}}finally{ct&&(ct.style.display=wt)}}var He={};function Ce(ne,$){for(var J=$.length;--J>=0;){var me=$[J];He.hasOwnProperty(me)?O.console&&console.warn("cannot override language handler %s",me):He[me]=ne}}function ue(ne,$){return ne&&He.hasOwnProperty(ne)||(ne=/^\s*</.test($)?"default-markup":"default-code"),He[ne]}Ce(Ee,["default-code"]),Ce(pe([],[[d,/^[^<?]+/],[E,/^<!\w[^>]*(?:>|$)/],[S,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[f,/^(?:<[%?]|[%?]>)/],["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"]),Ce(pe([[d,/^[\s]+/,null,` \r
`],[U,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[g,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[F,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[f,/^[=<>\/]+/],["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"]),Ce(pe([],[[U,/^[\s\S]+/]]),["uq.val"]),Ce(Ie({keywords:m,hashComments:!0,cStyleComments:!0,types:w}),["c","cc","cpp","cxx","cyc","m"]),Ce(Ie({keywords:"null,true,false"}),["json"]),Ce(Ie({keywords:r,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:w}),["cs"]),Ce(Ie({keywords:h,cStyleComments:!0}),["java"]),Ce(Ie({keywords:c,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),Ce(Ie({keywords:s,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),Ce(Ie({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),Ce(Ie({keywords:u,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),Ce(Ie({keywords:a,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),Ce(Ie({keywords:n,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),Ce(pe([],[[C,/^[\s\S]+/]]),["regex"]);function se(ne){var $=ne.langExtension;try{var J=y(ne.sourceNode,ne.pre),me=J.sourceCode;ne.sourceCode=me,ne.spans=J.spans,ne.basePos=0,ue($,me)(ne),We(ne)}catch(xe){O.console&&console.log(xe&&xe.stack||xe)}}function we(ne,$,J){var me=J||!1,xe=$||null,ke=document.createElement("div");ke.innerHTML="<pre>"+ne+"</pre>",ke=ke.firstChild,me&&Te(ke,me,!0);var $e={langExtension:xe,numberLines:me,sourceNode:ke,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return se($e),ke.innerHTML}function ge(ne,$){var J=$||document.body,me=J.ownerDocument||document;function xe(Se){return J.getElementsByTagName(Se)}for(var ke=[xe("pre"),xe("code"),xe("xmp")],$e=[],Pt=0;Pt<ke.length;++Pt)for(var Xt=0,Bt=ke[Pt].length;Xt<Bt;++Xt)$e.push(ke[Pt][Xt]);ke=null;var lt=Date;lt.now||(lt={now:function(){return+new Date}});var jt=0,pn=/\blang(?:uage)?-([\w.]+)(?!\S)/,it=/\bprettyprint\b/,Ze=/\bprettyprinted\b/,bt=/pre|xmp/i,Mt=/^code$/i,ct=/^(?:pre|code|xmp)$/i,wt={};function Ve(){for(var Se=O.PR_SHOULD_USE_CONTINUATION?lt.now()+250:Infinity;jt<$e.length&&lt.now()<Se;jt++){for(var Pe=$e[jt],ce=wt,de=Pe;de=de.previousSibling;){var be=de.nodeType,je=(be===7||be===8)&&de.nodeValue;if(je?!/^\??prettify\b/.test(je):be!==3||/\S/.test(de.nodeValue))break;if(je){ce={},je.replace(/\b(\w+)=([\w:.%+-]+)/g,function(kt,vt,Qt){ce[vt]=Qt});break}}var ze=Pe.className;if((ce!==wt||it.test(ze))&&!Ze.test(ze)){for(var ut=!1,Dt=Pe.parentNode;Dt;Dt=Dt.parentNode){var rn=Dt.tagName;if(ct.test(rn)&&Dt.className&&it.test(Dt.className)){ut=!0;break}}if(!ut){Pe.className+=" prettyprinted";var mn=ce.lang;if(!mn){mn=ze.match(pn);var gt;!mn&&(gt=te(Pe))&&Mt.test(gt.tagName)&&(mn=gt.className.match(pn)),mn&&(mn=mn[1])}var Vt;if(bt.test(Pe.tagName))Vt=1;else{var Tt=Pe.currentStyle,Rt=me.defaultView,mt=Tt?Tt.whiteSpace:Rt&&Rt.getComputedStyle?Rt.getComputedStyle(Pe,null).getPropertyValue("white-space"):0;Vt=mt&&mt.substring(0,3)==="pre"}var _e=ce.linenums;(_e=_e==="true"||+_e)||(_e=ze.match(/\blinenums\b(?::(\d+))?/),_e=_e?_e[1]&&_e[1].length?+_e[1]:!0:!1),_e&&Te(Pe,_e,Vt);var Ge={langExtension:mn,sourceNode:Pe,numberLines:_e,pre:Vt,sourceCode:null,basePos:null,spans:null,decorations:null};se(Ge)}}}jt<$e.length?O.setTimeout(Ve,250):typeof ne=="function"&&ne()}Ve()}var Ke=O.PR={createSimpleLexer:pe,registerLangHandler:Ce,sourceDecorator:Ie,PR_ATTRIB_NAME:F,PR_ATTRIB_VALUE:U,PR_COMMENT:S,PR_DECLARATION:E,PR_KEYWORD:D,PR_LITERAL:_,PR_NOCODE:K,PR_PLAIN:d,PR_PUNCTUATION:f,PR_SOURCE:T,PR_STRING:C,PR_TAG:g,PR_TYPE:b,prettyPrintOne:j?O.prettyPrintOne=we:P=we,prettyPrint:H=j?O.prettyPrint=ge:H=ge},st=O.define;typeof st=="function"&&st.amd&&st("google-code-prettify",[],function(){return Ke})})()},TXwP:function(Gt,et,k){var re,Y;(function(){var j;(function(){"use strict";var L=[,,function(I){function x(h){this.__parent=h,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=[]}x.prototype.clone_empty=function(){var h=new x(this.__parent);return h.set_indent(this.__indent_count,this.__alignment_count),h},x.prototype.item=function(h){return h<0?this.__items[this.__items.length+h]:this.__items[h]},x.prototype.has_match=function(h){for(var r=this.__items.length-1;r>=0;r--)if(this.__items[r].match(h))return!0;return!1},x.prototype.set_indent=function(h,r){this.is_empty()&&(this.__indent_count=h||0,this.__alignment_count=r||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},x.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)},x.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},x.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var h=this.__parent.current_line;return h.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),h.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),h.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,h.__items[0]===" "&&(h.__items.splice(0,1),h.__character_count-=1),!0}return!1},x.prototype.is_empty=function(){return this.__items.length===0},x.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},x.prototype.push=function(h){this.__items.push(h);var r=h.lastIndexOf(`
`);r!==-1?this.__character_count=h.length-r:this.__character_count+=h.length},x.prototype.pop=function(){var h=null;return this.is_empty()||(h=this.__items.pop(),this.__character_count-=h.length),h},x.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},x.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},x.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},x.prototype.toString=function(){var h="";return this.is_empty()?this.__parent.indent_empty_lines&&(h=this.__parent.get_indent_string(this.__indent_count)):(h=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),h+=this.__items.join("")),h};function p(h,r){this.__cache=[""],this.__indent_size=h.indent_size,this.__indent_string=h.indent_char,h.indent_with_tabs||(this.__indent_string=new Array(h.indent_size+1).join(h.indent_char)),r=r||"",h.indent_level>0&&(r=new Array(h.indent_level+1).join(this.__indent_string)),this.__base_string=r,this.__base_string_length=r.length}p.prototype.get_indent_size=function(h,r){var n=this.__base_string_length;return r=r||0,h<0&&(n=0),n+=h*this.__indent_size,n+=r,n},p.prototype.get_indent_string=function(h,r){var n=this.__base_string;return r=r||0,h<0&&(h=0,n=""),r+=h*this.__indent_size,this.__ensure_cache(r),n+=this.__cache[r],n},p.prototype.__ensure_cache=function(h){for(;h>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var h=this.__cache.length,r=0,n="";this.__indent_size&&h>=this.__indent_size&&(r=Math.floor(h/this.__indent_size),h-=r*this.__indent_size,n=new Array(r+1).join(this.__indent_string)),h&&(n+=new Array(h+1).join(" ")),this.__cache.push(n)};function m(h,r){this.__indent_cache=new p(h,r),this.raw=!1,this._end_with_newline=h.end_with_newline,this.indent_size=h.indent_size,this.wrap_line_length=h.wrap_line_length,this.indent_empty_lines=h.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new x(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}m.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},m.prototype.get_line_number=function(){return this.__lines.length},m.prototype.get_indent_string=function(h,r){return this.__indent_cache.get_indent_string(h,r)},m.prototype.get_indent_size=function(h,r){return this.__indent_cache.get_indent_size(h,r)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(h){return this.is_empty()||!h&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(h){this.trim(!0);var r=this.current_line.pop();r&&(r[r.length-1]===`
`&&(r=r.replace(/\n+$/g,"")),this.current_line.push(r)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join(`
`);return h!==`
`&&(n=n.replace(/[\n]/g,h)),n},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(h,r){return h=h||0,r=r||0,this.next_line.set_indent(h,r),this.__lines.length>1?(this.current_line.set_indent(h,r),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(h){for(var r=0;r<h.newlines;r++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(h.whitespace_before),this.current_line.push(h.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(h){this.__add_space_before_token(),this.current_line.push(h),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},m.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(" "))},m.prototype.remove_indent=function(h){for(var r=this.__lines.length;h<r;)this.__lines[h]._remove_indent(),h++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(h){for(h=h===void 0?!1:h,this.current_line.trim();h&&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},m.prototype.just_added_newline=function(){return this.current_line.is_empty()},m.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},m.prototype.ensure_empty_line_above=function(h,r){for(var n=this.__lines.length-2;n>=0;){var a=this.__lines[n];if(a.is_empty())break;if(a.item(0).indexOf(h)!==0&&a.item(-1)!==r){this.__lines.splice(n+1,0,new x(this)),this.previous_line=this.__lines[this.__lines.length-2];break}n--}},I.exports.Output=m},,,,function(I){function x(h,r){this.raw_options=p(h,r),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"])}x.prototype._get_array=function(h,r){var n=this.raw_options[h],a=r||[];return typeof n=="object"?n!==null&&typeof n.concat=="function"&&(a=n.concat()):typeof n=="string"&&(a=n.split(/[^a-zA-Z0-9_\/\-]+/)),a},x.prototype._get_boolean=function(h,r){var n=this.raw_options[h],a=n===void 0?!!r:!!n;return a},x.prototype._get_characters=function(h,r){var n=this.raw_options[h],a=r||"";return typeof n=="string"&&(a=n.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),a},x.prototype._get_number=function(h,r){var n=this.raw_options[h];r=parseInt(r,10),isNaN(r)&&(r=0);var a=parseInt(n,10);return isNaN(a)&&(a=r),a},x.prototype._get_selection=function(h,r,n){var a=this._get_selection_list(h,r,n);if(a.length!==1)throw new Error("Invalid Option Value: The option '"+h+`' can only be one of the following values:
`+r+`
You passed in: '`+this.raw_options[h]+"'");return a[0]},x.prototype._get_selection_list=function(h,r,n){if(!r||r.length===0)throw new Error("Selection list cannot be empty.");if(n=n||[r[0]],!this._is_valid_selection(n,r))throw new Error("Invalid Default Value!");var a=this._get_array(h,n);if(!this._is_valid_selection(a,r))throw new Error("Invalid Option Value: The option '"+h+`' can contain only the following values:
`+r+`
You passed in: '`+this.raw_options[h]+"'");return a},x.prototype._is_valid_selection=function(h,r){return h.length&&r.length&&!h.some(function(n){return r.indexOf(n)===-1})};function p(h,r){var n={};h=m(h);var a;for(a in h)a!==r&&(n[a]=h[a]);if(r&&h[r])for(a in h[r])n[a]=h[r][a];return n}function m(h){var r={},n;for(n in h){var a=n.replace(/-/g,"_");r[a]=h[n]}return r}I.exports.Options=x,I.exports.normalizeOpts=m,I.exports.mergeOpts=p},,function(I){var x=RegExp.prototype.hasOwnProperty("sticky");function p(m){this.__input=m||"",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 m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},p.prototype.peek=function(m){var h=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(h=this.__input.charAt(m)),h},p.prototype.__match=function(m,h){m.lastIndex=h;var r=m.exec(this.__input);return r&&!(x&&m.sticky)&&(r.index!==h&&(r=null)),r},p.prototype.test=function(m,h){return h=h||0,h+=this.__position,h>=0&&h<this.__input_length?!!this.__match(m,h):!1},p.prototype.testChar=function(m,h){var r=this.peek(h);return m.lastIndex=0,r!==null&&m.test(r)},p.prototype.match=function(m){var h=this.__match(m,this.__position);return h?this.__position+=h[0].length:h=null,h},p.prototype.read=function(m,h,r){var n="",a;return m&&(a=this.match(m),a&&(n+=a[0])),h&&(a||!m)&&(n+=this.readUntil(h,r)),n},p.prototype.readUntil=function(m,h){var r="",n=this.__position;m.lastIndex=this.__position;var a=m.exec(this.__input);return a?(n=a.index,h&&(n+=a[0].length)):n=this.__input_length,r=this.__input.substring(this.__position,n),this.__position=n,r},p.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},p.prototype.get_regexp=function(m,h){var r=null,n="g";return h&&x&&(n="y"),typeof m=="string"&&m!==""?r=new RegExp(m,n):m&&(r=new RegExp(m.source,n)),r},p.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},p.prototype.peekUntilAfter=function(m){var h=this.__position,r=this.readUntilAfter(m);return this.__position=h,r},p.prototype.lookBack=function(m){var h=this.__position-1;return h>=m.length&&this.__input.substring(h-m.length,h).toLowerCase()===m},I.exports.InputScanner=p},,,,,function(I){function x(p,m){p=typeof p=="string"?p:p.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(p+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(p+/\sbeautify\signore:end\s/.source+m,"g")}x.prototype.get_directives=function(p){if(!p.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var h=this.__directive_pattern.exec(p);h;)m[h[1]]=h[2],h=this.__directive_pattern.exec(p);return m},x.prototype.readIgnored=function(p){return p.readUntilAfter(this.__directives_end_ignore_pattern)},I.exports.Directives=x},,function(I,x,p){var m=p(16).Beautifier,h=p(17).Options;function r(n,a){var l=new m(n,a);return l.beautify()}I.exports=r,I.exports.defaultOptions=function(){return new h}},function(I,x,p){var m=p(17).Options,h=p(2).Output,r=p(8).InputScanner,n=p(13).Directives,a=new n(/\/\*/,/\*\//),l=/\r\n|[\r\n]/,s=/\r\n|[\r\n]/g,u=/\s/,c=/(?:\s|\n)+/g,R=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,w=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function C(D,S){this._source_text=D||"",this._options=new m(S),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"]}C.prototype.eatString=function(D){var S="";for(this._ch=this._input.next();this._ch;){if(S+=this._ch,this._ch==="\\")S+=this._input.next();else if(D.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return S},C.prototype.eatWhitespace=function(D){for(var S=u.test(this._input.peek()),b=0;u.test(this._input.peek());)this._ch=this._input.next(),D&&this._ch===`
`&&((b===0||b<this._options.max_preserve_newlines)&&(b++,this._output.add_new_line(!0)));return S},C.prototype.foundNestedPseudoClass=function(){for(var D=0,S=1,b=this._input.peek(S);b;){if(b==="{")return!0;if(b==="(")D+=1;else if(b===")"){if(D===0)return!1;D-=1}else if(b===";"||b==="}")return!1;S++,b=this._input.peek(S)}return!1},C.prototype.print_string=function(D){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(D)},C.prototype.preserveSingleSpace=function(D){D&&(this._output.space_before_token=!0)},C.prototype.indent=function(){this._indentLevel++},C.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},C.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var D=this._source_text,S=this._options.eol;S==="auto"&&(S=`
`,D&&l.test(D||"")&&(S=D.match(l)[0])),D=D.replace(s,`
`);var b=D.match(/^[\t ]*/)[0];this._output=new h(this._options,b),this._input=new r(D),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var _=0,f=!1,d=!1,g=!1,E=!1,T=!1,F=!1,U=this._ch,K=!1,z,M,y;z=this._input.read(c),M=z!=="",y=U,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),U=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var W=this._input.read(R),X=a.get_directives(W);X&&X.ignore==="start"&&(W+=a.readIgnored(this._input)),this.print_string(W),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(M),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var te=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);te.match(/[ :]$/)&&(te=this.eatString(": ").replace(/\s$/,""),this.print_string(te),this._output.space_before_token=!0),te=te.replace(/\s$/,""),te==="extend"?E=!0:te==="import"&&(T=!0),te in this.NESTED_AT_RULE?(this._nestedLevel+=1,te in this.CONDITIONAL_GROUP_RULE&&(g=!0)):!f&&_===0&&te.indexOf(":")!==-1&&(d=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(M),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")d&&(d=!1,this.outdent()),g?(g=!1,f=this._indentLevel>=this._nestedLevel):f=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&f&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(y==="("?this._output.space_before_token=!1:y!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),y==="{"&&this._output.trim(!0),T=!1,E=!1,d&&(this.outdent(),d=!1),this.print_string(this._ch),f=!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 pe=0;pe<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;pe++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[pe])){K=!0;break}(f||g)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!E&&_===0?(this.print_string(":"),d||(d=!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 Ie=y==='"'||y==="'";this.preserveSingleSpace(Ie||M),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")K=!1,_===0?(d&&(this.outdent(),d=!1),E=!1,T=!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(),_++,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(")")),_&&(_--,this.outdent()));else{var Ee=!1;this._input.lookBack("with")&&(Ee=!0),this.preserveSingleSpace(M||Ee),this.print_string(this._ch),d&&y==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),F=!0):(this.eatWhitespace(),_++,this.indent())}else if(this._ch===")")_&&(_--,this.outdent()),F&&this._input.peek()===";"&&this._options.selector_separator_newline&&(F=!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&&(!d||F)&&_===0&&!T&&!E?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!d&&_===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&u.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(M),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),u.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var Te=y==='"'||y==="'";this.preserveSingleSpace(Te||M),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&K&&this._output.add_new_line()}var We=this._output.get_code(S);return We},I.exports.Beautifier=C},function(I,x,p){var m=p(6).Options;function h(r){m.call(this,r,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var n=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||n;var a=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var l=0;l<a.length;l++)a[l]!=="expand"?this.brace_style="collapse":this.brace_style=a[l]}h.prototype=new m,I.exports.Options=h}],P={};function H(I){var x=P[I];if(x!==void 0)return x.exports;var p=P[I]={exports:{}};return L[I](p,p.exports,H),p.exports}var O=H(15);j=O})();var G=j;!(re=[],Y=function(){return{css_beautify:G}}.apply(et,re),Y!==void 0&&(Gt.exports=Y))})()},TreJ:function(Gt,et,k){"use strict";var re=k("sRBo"),Y=k("kaz8"),j=k("giR+"),G=k("fyUT"),L=k("14J3"),P=k("BMrR"),H=k("iQDF"),O=k("+eQT"),I=k("jCWc"),x=k("kPKH"),p=k("q1tI"),m=k.n(p),h=k("wd/R"),r=k.n(h),n=k("9kvl"),a=k("eozf"),l=function(u){var c=u.data,R=u.setData,w=u.disabled,C=u.shixunHomeworks,D=C.workSetting,S=r()(D==null?void 0:D.evaluation_start)<=r()(),b=c.anonymous_appeal;return m.a.createElement("div",null,m.a.createElement(P.a,{align:"middle",className:"pl30"},m.a.createElement(x.a,null,"\u5F00\u59CB\u65F6\u95F4:"),m.a.createElement(x.a,{className:"ml5"},m.a.createElement(O.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(f){return Object(a.b)(f,D==null?void 0:D.course_end_date)},disabledTime:function(f){return Object(a.c)(f)},disabled:w||S||b,value:c.evaluation_start?r()(c.evaluation_start):"",onChange:function(f,d){c.evaluation_start=d,R(Object.assign({},c))}})),m.a.createElement(x.a,null,m.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)"))),m.a.createElement(P.a,{align:"middle",className:"mt25 pl30"},m.a.createElement(x.a,null,"\u7ED3\u675F\u65F6\u95F4:"),m.a.createElement(x.a,{className:"ml5"},m.a.createElement(O.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(f){return Object(a.b)(f,D==null?void 0:D.course_end_date,c.evaluation_start)},disabledTime:function(f){return Object(a.c)(f,r()(c.evaluation_start))},disabled:w||b,value:c.evaluation_end?r()(c.evaluation_end):"",onChange:function(f,d){c.evaluation_end=d,R(Object.assign({},c))}})),m.a.createElement(x.a,null,m.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u533F\u8BC4TA\u4EBA\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)"))),m.a.createElement(P.a,{align:"middle",className:"mt25 pl30"},m.a.createElement(x.a,null,"\u533F\u8BC4\u6570\u91CF:"),m.a.createElement(x.a,{className:"ml5"},m.a.createElement(G.a,{disabled:w||S||b,value:c.evaluation_num,onChange:function(f){c.evaluation_num=f,R(Object.assign({},c))}})),m.a.createElement(x.a,{flex:"1",className:"ml5"},m.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)"))),m.a.createElement(P.a,{align:"middle",className:"mt25 pl30"},m.a.createElement(x.a,null,"\u7F3A\u8BC4\u6263\u5206:"),m.a.createElement(x.a,{className:"ml5"},m.a.createElement(G.a,{min:0,disabled:w,value:c.absence_penalty,onChange:function(f){c.absence_penalty=f,R(Object.assign({},c))}})),m.a.createElement(x.a,{flex:"1",className:"ml5"},"\u5206",m.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u7F3A\u8BC4\u65F6\uFF0C\u5176\u6210\u7EE9\u5C06\u88AB\u6263\u51CF\u7684\u5206\u503C)"))),c.anonymous_comment&&m.a.createElement(m.a.Fragment,null,m.a.createElement(P.a,null,m.a.createElement(x.a,{span:24,className:"mt15 pl30"},m.a.createElement(Y.a,{checked:c.student_comment,disabled:w,onChange:function(){c.student_comment=!c.student_comment,R(Object.assign({},c))}},m.a.createElement("strong",null,"\u533F\u8BC4\u8BA1\u5165\u5DF2\u8BC4\u9605")),m.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)")))))};et.a=Object(n.a)(function(s){var u=s.shixunHomeworks;return{shixunHomeworks:u}})(l)},"VrN/":function(Gt,et,k){(function(re,Y){Gt.exports=Y()})(this,function(){"use strict";var re=navigator.userAgent,Y=navigator.platform,j=/gecko\/\d/i.test(re),G=/MSIE \d/.test(re),L=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(re),P=/Edge\/(\d+)/.exec(re),H=G||L||P,O=H&&(G?document.documentMode||6:+(P||L)[1]),I=!P&&/WebKit\//.test(re),x=I&&/Qt\/\d+\.\d+/.test(re),p=!P&&/Chrome\//.test(re),m=/Opera\//.test(re),h=/Apple Computer/.test(navigator.vendor),r=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(re),n=/PhantomJS/.test(re),a=!P&&/AppleWebKit/.test(re)&&/Mobile\/\w+/.test(re),l=/Android/.test(re),s=a||l||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(re),u=a||/Mac/.test(Y),c=/\bCrOS\b/.test(re),R=/win/i.test(Y),w=m&&re.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(m=!1,I=!0);var C=u&&(x||m&&(w==null||w<12.11)),D=j||H&&O>=9;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var b=function(e,t){var o=e.className,i=S(t).exec(o);if(i){var v=o.slice(i.index+i[0].length);e.className=o.slice(0,i.index)+(v?i[1]+v:"")}};function _(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function f(e,t){return _(e).appendChild(t)}function d(e,t,o,i){var v=document.createElement(e);if(o&&(v.className=o),i&&(v.style.cssText=i),typeof t=="string")v.appendChild(document.createTextNode(t));else if(t)for(var B=0;B<t.length;++B)v.appendChild(t[B]);return v}function g(e,t,o,i){var v=d(e,t,o,i);return v.setAttribute("role","presentation"),v}var E;document.createRange?E=function(e,t,o,i){var v=document.createRange();return v.setEnd(i||e,o),v.setStart(e,t),v}:E=function(e,t,o){var i=document.body.createTextRange();try{i.moveToElementText(e.parentNode)}catch(v){return i}return i.collapse(!0),i.moveEnd("character",o),i.moveStart("character",t),i};function T(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function F(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function U(e,t){var o=e.className;S(t).test(o)||(e.className+=(o?" ":"")+t)}function K(e,t){for(var o=e.split(" "),i=0;i<o.length;i++)o[i]&&!S(o[i]).test(t)&&(t+=" "+o[i]);return t}var z=function(e){e.select()};a?z=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:H&&(z=function(e){try{e.select()}catch(t){}});function M(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function y(e,t,o){t||(t={});for(var i in e)e.hasOwnProperty(i)&&(o!==!1||!t.hasOwnProperty(i))&&(t[i]=e[i]);return t}function W(e,t,o,i,v){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var B=i||0,Z=v||0;;){var ie=e.indexOf(" ",B);if(ie<0||ie>=t)return Z+(t-B);Z+=ie-B,Z+=o-Z%o,B=ie+1}}var X=function(){this.id=null,this.f=null,this.time=0,this.handler=M(this.onTimeout,this)};X.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},X.prototype.set=function(e,t){this.f=t;var o=+new Date+e;(!this.id||o<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=o)};function te(e,t){for(var o=0;o<e.length;++o)if(e[o]==t)return o;return-1}var pe=50,Ie={toString:function(){return"CodeMirror.Pass"}},Ee={scroll:!1},Te={origin:"*mouse"},We={origin:"+move"};function He(e,t,o){for(var i=0,v=0;;){var B=e.indexOf(" ",i);B==-1&&(B=e.length);var Z=B-i;if(B==e.length||v+Z>=t)return i+Math.min(Z,t-v);if(v+=B-i,v+=o-v%o,i=B+1,v>=t)return i}}var Ce=[""];function ue(e){for(;Ce.length<=e;)Ce.push(se(Ce)+" ");return Ce[e]}function se(e){return e[e.length-1]}function we(e,t){for(var o=[],i=0;i<e.length;i++)o[i]=t(e[i],i);return o}function ge(e,t,o){for(var i=0,v=o(t);i<e.length&&o(e[i])<=v;)i++;e.splice(i,0,t)}function Ke(){}function st(e,t){var o;return Object.create?o=Object.create(e):(Ke.prototype=e,o=new Ke),t&&y(t,o),o}var ne=/[\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()||ne.test(e))}function J(e,t){return t?t.source.indexOf("\\w")>-1&&$(e)?!0:t.test(e):$(e)}function me(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var xe=/[\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 ke(e){return e.charCodeAt(0)>=768&&xe.test(e)}function $e(e,t,o){for(;(o<0?t>0:t<e.length)&&ke(e.charAt(t));)t+=o;return t}function Pt(e,t,o){for(var i=t>o?-1:1;;){if(t==o)return t;var v=(t+o)/2,B=i<0?Math.ceil(v):Math.floor(v);if(B==t)return e(B)?t:o;e(B)?o=B:t=B+i}}function Xt(e,t,o,i){if(!e)return i(t,o,"ltr",0);for(var v=!1,B=0;B<e.length;++B){var Z=e[B];(Z.from<o&&Z.to>t||t==o&&Z.to==t)&&(i(Math.max(Z.from,t),Math.min(Z.to,o),Z.level==1?"rtl":"ltr",B),v=!0)}v||i(t,o,"ltr")}var Bt=null;function lt(e,t,o){var i;Bt=null;for(var v=0;v<e.length;++v){var B=e[v];if(B.from<t&&B.to>t)return v;B.to==t&&(B.from!=B.to&&o=="before"?i=v:Bt=v),B.from==t&&(B.from!=B.to&&o!="before"?i=v:Bt=v)}return i!=null?i:Bt}var jt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function o(he){return he<=247?e.charAt(he):1424<=he&&he<=1524?"R":1536<=he&&he<=1785?t.charAt(he-1536):1774<=he&&he<=2220?"r":8192<=he&&he<=8203?"w":he==8204?"b":"L"}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,v=/[stwN]/,B=/[LRr]/,Z=/[Lb1n]/,ie=/[1n]/;function ae(he,Xe,nt){this.level=he,this.from=Xe,this.to=nt}return function(he,Xe){var nt=Xe=="ltr"?"L":"R";if(he.length==0||Xe=="ltr"&&!i.test(he))return!1;for(var xt=he.length,yt=[],Yt=0;Yt<xt;++Yt)yt.push(o(he.charCodeAt(Yt)));for(var cn=0,Cn=nt;cn<xt;++cn){var Ln=yt[cn];Ln=="m"?yt[cn]=Cn:Cn=Ln}for(var Hn=0,Mn=nt;Hn<xt;++Hn){var Yn=yt[Hn];Yn=="1"&&Mn=="r"?yt[Hn]="n":B.test(Yn)&&(Mn=Yn,Yn=="r"&&(yt[Hn]="R"))}for(var vr=1,sr=yt[0];vr<xt-1;++vr){var Ir=yt[vr];Ir=="+"&&sr=="1"&&yt[vr+1]=="1"?yt[vr]="1":Ir==","&&sr==yt[vr+1]&&(sr=="1"||sr=="n")&&(yt[vr]=sr),sr=Ir}for(var ci=0;ci<xt;++ci){var Hi=yt[ci];if(Hi==",")yt[ci]="N";else if(Hi=="%"){var bi=void 0;for(bi=ci+1;bi<xt&&yt[bi]=="%";++bi);for(var sa=ci&&yt[ci-1]=="!"||bi<xt&&yt[bi]=="1"?"1":"N",ra=ci;ra<bi;++ra)yt[ra]=sa;ci=bi-1}}for(var Pi=0,ia=nt;Pi<xt;++Pi){var Gi=yt[Pi];ia=="L"&&Gi=="1"?yt[Pi]="L":B.test(Gi)&&(ia=Gi)}for(var Ii=0;Ii<xt;++Ii)if(v.test(yt[Ii])){var Li=void 0;for(Li=Ii+1;Li<xt&&v.test(yt[Li]);++Li);for(var Ti=(Ii?yt[Ii-1]:nt)=="L",aa=(Li<xt?yt[Li]:nt)=="L",Oo=Ti==aa?Ti?"L":"R":nt,to=Ii;to<Li;++to)yt[to]=Oo;Ii=Li-1}for(var $i=[],La,Wi=0;Wi<xt;)if(Z.test(yt[Wi])){var ms=Wi;for(++Wi;Wi<xt&&Z.test(yt[Wi]);++Wi);$i.push(new ae(0,ms,Wi))}else{var za=Wi,lo=$i.length,uo=Xe=="rtl"?1:0;for(++Wi;Wi<xt&&yt[Wi]!="L";++Wi);for(var qi=za;qi<Wi;)if(ie.test(yt[qi])){za<qi&&($i.splice(lo,0,new ae(1,za,qi)),lo+=uo);var So=qi;for(++qi;qi<Wi&&ie.test(yt[qi]);++qi);$i.splice(lo,0,new ae(2,So,qi)),lo+=uo,za=qi}else++qi;za<Wi&&$i.splice(lo,0,new ae(1,za,Wi))}return Xe=="ltr"&&($i[0].level==1&&(La=he.match(/^\s+/))&&($i[0].from=La[0].length,$i.unshift(new ae(0,0,La[0].length))),se($i).level==1&&(La=he.match(/\s+$/))&&(se($i).to-=La[0].length,$i.push(new ae(0,xt-La[0].length,xt)))),Xe=="rtl"?$i.reverse():$i}}();function pn(e,t){var o=e.order;return o==null&&(o=e.order=jt(e.text,t)),o}var it=[],Ze=function(e,t,o){if(e.addEventListener)e.addEventListener(t,o,!1);else if(e.attachEvent)e.attachEvent("on"+t,o);else{var i=e._handlers||(e._handlers={});i[t]=(i[t]||it).concat(o)}};function bt(e,t){return e._handlers&&e._handlers[t]||it}function Mt(e,t,o){if(e.removeEventListener)e.removeEventListener(t,o,!1);else if(e.detachEvent)e.detachEvent("on"+t,o);else{var i=e._handlers,v=i&&i[t];if(v){var B=te(v,o);B>-1&&(i[t]=v.slice(0,B).concat(v.slice(B+1)))}}}function ct(e,t){var o=bt(e,t);if(!o.length)return;for(var i=Array.prototype.slice.call(arguments,2),v=0;v<o.length;++v)o[v].apply(null,i)}function wt(e,t,o){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ct(e,o||t.type,e,t),be(t)||t.codemirrorIgnore}function Ve(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var o=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),i=0;i<t.length;++i)te(o,t[i])==-1&&o.push(t[i])}function Se(e,t){return bt(e,t).length>0}function Pe(e){e.prototype.on=function(t,o){Ze(this,t,o)},e.prototype.off=function(t,o){Mt(this,t,o)}}function ce(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function de(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function be(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function je(e){ce(e),de(e)}function ze(e){return e.target||e.srcElement}function ut(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),u&&e.ctrlKey&&t==1&&(t=3),t}var Dt=function(){if(H&&O<9)return!1;var e=d("div");return"draggable"in e||"dragDrop"in e}(),rn;function mn(e){if(rn==null){var t=d("span","\u200B");f(e,d("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(rn=t.offsetWidth<=1&&t.offsetHeight>2&&!(H&&O<8))}var o=rn?d("span","\u200B"):d("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return o.setAttribute("cm-text",""),o}var gt;function Vt(e){if(gt!=null)return gt;var t=f(e,document.createTextNode("A\u062EA")),o=E(t,0,1).getBoundingClientRect(),i=E(t,1,2).getBoundingClientRect();return _(e),!o||o.left==o.right?!1:gt=i.right-o.right<3}var Tt=`
b`.split(/\n/).length!=3?function(e){for(var t=0,o=[],i=e.length;t<=i;){var v=e.indexOf(`
`,t);v==-1&&(v=e.length);var B=e.slice(t,e.charAt(v-1)=="\r"?v-1:v),Z=B.indexOf("\r");Z!=-1?(o.push(B.slice(0,Z)),t+=Z+1):(o.push(B),t=v+1)}return o}:function(e){return e.split(/\r\n?|\n/)},Rt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(o){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},mt=function(){var e=d("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),_e=null;function Ge(e){if(_e!=null)return _e;var t=f(e,d("span","x")),o=t.getBoundingClientRect(),i=E(t,0,1).getBoundingClientRect();return _e=Math.abs(o.left-i.left)>1}var kt={},vt={};function Qt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),kt[e]=t}function Jt(e,t){vt[e]=t}function Le(e){if(typeof e=="string"&&vt.hasOwnProperty(e))e=vt[e];else if(e&&typeof e.name=="string"&&vt.hasOwnProperty(e.name)){var t=vt[e.name];typeof t=="string"&&(t={name:t}),e=st(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Le("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Le("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function tt(e,t){t=Le(t);var o=kt[t.name];if(!o)return tt(e,"text/plain");var i=o(e,t);if(Lt.hasOwnProperty(t.name)){var v=Lt[t.name];for(var B in v){if(!v.hasOwnProperty(B))continue;i.hasOwnProperty(B)&&(i["_"+B]=i[B]),i[B]=v[B]}}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(var Z in t.modeProps)i[Z]=t.modeProps[Z];return i}var Lt={};function Ht(e,t){var o=Lt.hasOwnProperty(e)?Lt[e]:Lt[e]={};y(t,o)}function ln(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var o={};for(var i in t){var v=t[i];v instanceof Array&&(v=v.concat([])),o[i]=v}return o}function hn(e,t){for(var o;e.innerMode&&!(o=e.innerMode(t),!o||o.mode==e);)t=o.state,e=o.mode;return o||{mode:e,state:t}}function ir(e,t,o){return e.startState?e.startState(t,o):!0}var Un=function(e,t,o){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=o};Un.prototype.eol=function(){return this.pos>=this.string.length},Un.prototype.sol=function(){return this.pos==this.lineStart},Un.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Un.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Un.prototype.eat=function(e){var t=this.string.charAt(this.pos),o;if(typeof e=="string"?o=t==e:o=t&&(e.test?e.test(t):e(t)),o)return++this.pos,t},Un.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Un.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Un.prototype.skipToEnd=function(){this.pos=this.string.length},Un.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Un.prototype.backUp=function(e){this.pos-=e},Un.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=W(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?W(this.string,this.lineStart,this.tabSize):0)},Un.prototype.indentation=function(){return W(this.string,null,this.tabSize)-(this.lineStart?W(this.string,this.lineStart,this.tabSize):0)},Un.prototype.match=function(e,t,o){if(typeof e=="string"){var i=function(Z){return o?Z.toLowerCase():Z},v=this.string.substr(this.pos,e.length);if(i(v)==i(e))return t!==!1&&(this.pos+=e.length),!0}else{var B=this.string.slice(this.pos).match(e);return B&&B.index>0?null:(B&&t!==!1&&(this.pos+=B[0].length),B)}},Un.prototype.current=function(){return this.string.slice(this.start,this.pos)},Un.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Un.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Un.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function dn(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var o=e;!o.lines;)for(var i=0;;++i){var v=o.children[i],B=v.chunkSize();if(t<B){o=v;break}t-=B}return o.lines[t]}function fr(e,t,o){var i=[],v=t.line;return e.iter(t.line,o.line+1,function(B){var Z=B.text;v==o.line&&(Z=Z.slice(0,o.ch)),v==t.line&&(Z=Z.slice(t.ch)),i.push(Z),++v}),i}function Kr(e,t,o){var i=[];return e.iter(t,o,function(v){i.push(v.text)}),i}function tr(e,t){var o=t-e.height;if(o)for(var i=e;i;i=i.parent)i.height+=o}function rr(e){if(e.parent==null)return null;for(var t=e.parent,o=te(t.lines,e),i=t.parent;i;t=i,i=i.parent)for(var v=0;!(i.children[v]==t);++v)o+=i.children[v].chunkSize();return o+t.first}function Nr(e,t){var o=e.first;e:do{for(var i=0;i<e.children.length;++i){var v=e.children[i],B=v.height;if(t<B){e=v;continue e}t-=B,o+=v.chunkSize()}return o}while(!e.lines);for(var Z=0;Z<e.lines.length;++Z){var ie=e.lines[Z],ae=ie.height;if(t<ae)break;t-=ae}return o+Z}function oi(e,t){return t>=e.first&&t<e.first+e.size}function hi(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function an(e,t,o){if(o===void 0&&(o=null),!(this instanceof an))return new an(e,t,o);this.line=e,this.ch=t,this.sticky=o}function Xn(e,t){return e.line-t.line||e.ch-t.ch}function fi(e,t){return e.sticky==t.sticky&&Xn(e,t)==0}function Ei(e){return an(e.line,e.ch)}function ri(e,t){return Xn(e,t)<0?t:e}function ii(e,t){return Xn(e,t)<0?e:t}function ee(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function A(e,t){if(t.line<e.first)return an(e.first,0);var o=e.first+e.size-1;return t.line>o?an(o,dn(e,o).text.length):N(t,dn(e,t.line).text.length)}function N(e,t){var o=e.ch;return o==null||o>t?an(e.line,t):o<0?an(e.line,0):e}function V(e,t){for(var o=[],i=0;i<t.length;i++)o[i]=A(e,t[i]);return o}var oe=function(e,t){this.state=e,this.lookAhead=t},q=function(e,t,o,i){this.state=t,this.doc=e,this.line=o,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};q.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},q.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},q.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},q.fromSaved=function(e,t,o){return t instanceof oe?new q(e,ln(e.mode,t.state),o,t.lookAhead):new q(e,ln(e.mode,t),o)},q.prototype.save=function(e){var t=e!==!1?ln(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new oe(t,this.maxLookAhead):t};function Je(e,t,o,i){var v=[e.state.modeGen],B={};Jr(e,t.text,e.doc.mode,o,function(he,Xe){return v.push(he,Xe)},B,i);for(var Z=o.state,ie=function(he){o.baseTokens=v;var Xe=e.state.overlays[he],nt=1,xt=0;o.state=!0,Jr(e,t.text,Xe.mode,o,function(yt,Yt){for(var cn=nt;xt<yt;){var Cn=v[nt];Cn>yt&&v.splice(nt,1,yt,v[nt+1],Cn),nt+=2,xt=Math.min(yt,Cn)}if(!Yt)return;if(Xe.opaque)v.splice(cn,nt-cn,yt,"overlay "+Yt),nt=cn+2;else for(;cn<nt;cn+=2){var Ln=v[cn+1];v[cn+1]=(Ln?Ln+" ":"")+"overlay "+Yt}},B),o.state=Z,o.baseTokens=null,o.baseTokenPos=1},ae=0;ae<e.state.overlays.length;++ae)ie(ae);return{styles:v,classes:B.bgClass||B.textClass?B:null}}function Kt(e,t,o){if(!t.styles||t.styles[0]!=e.state.modeGen){var i=gn(e,rr(t)),v=t.text.length>e.options.maxHighlightLength&&ln(e.doc.mode,i.state),B=Je(e,t,i);v&&(i.state=v),t.stateAfter=i.save(!v),t.styles=B.styles,B.classes?t.styleClasses=B.classes:t.styleClasses&&(t.styleClasses=null),o===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function gn(e,t,o){var i=e.doc,v=e.display;if(!i.mode.startState)return new q(i,!0,t);var B=qr(e,t,o),Z=B>i.first&&dn(i,B-1).stateAfter,ie=Z?q.fromSaved(i,Z,B):new q(i,ir(i.mode),B);return i.iter(B,t,function(ae){Bn(e,ae.text,ie);var he=ie.line;ae.stateAfter=he==t-1||he%5==0||he>=v.viewFrom&&he<v.viewTo?ie.save():null,ie.nextLine()}),o&&(i.modeFrontier=ie.line),ie}function Bn(e,t,o,i){var v=e.doc.mode,B=new Un(t,e.options.tabSize,o);for(B.start=B.pos=i||0,t==""&&en(v,o.state);!B.eol();)Gn(v,B,o.state),B.start=B.pos}function en(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var o=hn(e,t);if(o.mode.blankLine)return o.mode.blankLine(o.state)}function Gn(e,t,o,i){for(var v=0;v<10;v++){i&&(i[0]=hn(e,o).mode);var B=e.token(t,o);if(t.pos>t.start)return B}throw new Error("Mode "+e.name+" failed to advance stream.")}var ar=function(e,t,o){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=o};function Ur(e,t,o,i){var v=e.doc,B=v.mode,Z;t=A(v,t);var ie=dn(v,t.line),ae=gn(e,t.line,o),he=new Un(ie.text,e.options.tabSize,ae),Xe;for(i&&(Xe=[]);(i||he.pos<t.ch)&&!he.eol();)he.start=he.pos,Z=Gn(B,he,ae.state),i&&Xe.push(new ar(he,Z,ln(v.mode,ae.state)));return i?Xe:new ar(he,Z,ae.state)}function si(e,t){if(e)for(;;){var o=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!o)break;e=e.slice(0,o.index)+e.slice(o.index+o[0].length);var i=o[1]?"bgClass":"textClass";t[i]==null?t[i]=o[2]:new RegExp("(?:^|\\s)"+o[2]+"(?:$|\\s)").test(t[i])||(t[i]+=" "+o[2])}return e}function Jr(e,t,o,i,v,B,Z){var ie=o.flattenSpans;ie==null&&(ie=e.options.flattenSpans);var ae=0,he=null,Xe=new Un(t,e.options.tabSize,i),nt,xt=e.options.addModeClass&&[null];for(t==""&&si(en(o,i.state),B);!Xe.eol();){if(Xe.pos>e.options.maxHighlightLength?(ie=!1,Z&&Bn(e,t,i,Xe.pos),Xe.pos=t.length,nt=null):nt=si(Gn(o,Xe,i.state,xt),B),xt){var yt=xt[0].name;yt&&(nt="m-"+(nt?yt+" "+nt:yt))}if(!ie||he!=nt){for(;ae<Xe.start;)ae=Math.min(Xe.start,ae+5e3),v(ae,he);he=nt}Xe.start=Xe.pos}for(;ae<Xe.pos;){var Yt=Math.min(Xe.pos,ae+5e3);v(Yt,he),ae=Yt}}function qr(e,t,o){for(var i,v,B=e.doc,Z=o?-1:t-(e.doc.mode.innerMode?1e3:100),ie=t;ie>Z;--ie){if(ie<=B.first)return B.first;var ae=dn(B,ie-1),he=ae.stateAfter;if(he&&(!o||ie+(he instanceof oe?he.lookAhead:0)<=B.modeFrontier))return ie;var Xe=W(ae.text,null,e.options.tabSize);(v==null||i>Xe)&&(v=ie-1,i=Xe)}return v}function Ni(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var o=e.first,i=t-1;i>o;i--){var v=dn(e,i).stateAfter;if(v&&(!(v instanceof oe)||i+v.lookAhead<t)){o=i+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,o)}var Qi=!1,ai=!1;function Ri(){Qi=!0}function Vi(){ai=!0}function Ui(e,t,o){this.marker=e,this.from=t,this.to=o}function pi(e,t){if(e)for(var o=0;o<e.length;++o){var i=e[o];if(i.marker==t)return i}}function Ji(e,t){for(var o,i=0;i<e.length;++i)e[i]!=t&&(o||(o=[])).push(e[i]);return o}function Mi(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function ea(e,t,o){var i;if(e)for(var v=0;v<e.length;++v){var B=e[v],Z=B.marker,ie=B.from==null||(Z.inclusiveLeft?B.from<=t:B.from<t);if(ie||B.from==t&&Z.type=="bookmark"&&(!o||!B.marker.insertLeft)){var ae=B.to==null||(Z.inclusiveRight?B.to>=t:B.to>t);(i||(i=[])).push(new Ui(Z,B.from,ae?null:B.to))}}return i}function la(e,t,o){var i;if(e)for(var v=0;v<e.length;++v){var B=e[v],Z=B.marker,ie=B.to==null||(Z.inclusiveRight?B.to>=t:B.to>t);if(ie||B.from==t&&Z.type=="bookmark"&&(!o||B.marker.insertLeft)){var ae=B.from==null||(Z.inclusiveLeft?B.from<=t:B.from<t);(i||(i=[])).push(new Ui(Z,ae?null:B.from-t,B.to==null?null:B.to-t))}}return i}function Nn(e,t){if(t.full)return null;var o=oi(e,t.from.line)&&dn(e,t.from.line).markedSpans,i=oi(e,t.to.line)&&dn(e,t.to.line).markedSpans;if(!o&&!i)return null;var v=t.from.ch,B=t.to.ch,Z=Xn(t.from,t.to)==0,ie=ea(o,v,Z),ae=la(i,B,Z),he=t.text.length==1,Xe=se(t.text).length+(he?v:0);if(ie)for(var nt=0;nt<ie.length;++nt){var xt=ie[nt];if(xt.to==null){var yt=pi(ae,xt.marker);yt?he&&(xt.to=yt.to==null?null:yt.to+Xe):xt.to=v}}if(ae)for(var Yt=0;Yt<ae.length;++Yt){var cn=ae[Yt];if(cn.to!=null&&(cn.to+=Xe),cn.from==null){var Cn=pi(ie,cn.marker);Cn||(cn.from=Xe,he&&(ie||(ie=[])).push(cn))}else cn.from+=Xe,he&&(ie||(ie=[])).push(cn)}ie&&(ie=Q(ie)),ae&&ae!=ie&&(ae=Q(ae));var Ln=[ie];if(!he){var Hn=t.text.length-2,Mn;if(Hn>0&&ie)for(var Yn=0;Yn<ie.length;++Yn)ie[Yn].to==null&&(Mn||(Mn=[])).push(new Ui(ie[Yn].marker,null,null));for(var vr=0;vr<Hn;++vr)Ln.push(Mn);Ln.push(ae)}return Ln}function Q(e){for(var t=0;t<e.length;++t){var o=e[t];o.from!=null&&o.from==o.to&&o.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function ve(e,t,o){var i=null;if(e.iter(t.line,o.line+1,function(yt){if(yt.markedSpans)for(var Yt=0;Yt<yt.markedSpans.length;++Yt){var cn=yt.markedSpans[Yt].marker;cn.readOnly&&(!i||te(i,cn)==-1)&&(i||(i=[])).push(cn)}}),!i)return null;for(var v=[{from:t,to:o}],B=0;B<i.length;++B)for(var Z=i[B],ie=Z.find(0),ae=0;ae<v.length;++ae){var he=v[ae];if(Xn(he.to,ie.from)<0||Xn(he.from,ie.to)>0)continue;var Xe=[ae,1],nt=Xn(he.from,ie.from),xt=Xn(he.to,ie.to);(nt<0||!Z.inclusiveLeft&&!nt)&&Xe.push({from:he.from,to:ie.from}),(xt>0||!Z.inclusiveRight&&!xt)&&Xe.push({from:ie.to,to:he.to}),v.splice.apply(v,Xe),ae+=Xe.length-3}return v}function Ae(e){var t=e.markedSpans;if(!t)return;for(var o=0;o<t.length;++o)t[o].marker.detachLine(e);e.markedSpans=null}function De(e,t){if(!t)return;for(var o=0;o<t.length;++o)t[o].marker.attachLine(e);e.markedSpans=t}function at(e){return e.inclusiveLeft?-1:0}function Be(e){return e.inclusiveRight?1:0}function rt(e,t){var o=e.lines.length-t.lines.length;if(o!=0)return o;var i=e.find(),v=t.find(),B=Xn(i.from,v.from)||at(e)-at(t);if(B)return-B;var Z=Xn(i.to,v.to)||Be(e)-Be(t);return Z||t.id-e.id}function ht(e,t){var o=ai&&e.markedSpans,i;if(o)for(var v=void 0,B=0;B<o.length;++B)v=o[B],v.marker.collapsed&&(t?v.from:v.to)==null&&(!i||rt(i,v.marker)<0)&&(i=v.marker);return i}function Me(e){return ht(e,!0)}function ft(e){return ht(e,!1)}function Ot(e,t){var o=ai&&e.markedSpans,i;if(o)for(var v=0;v<o.length;++v){var B=o[v];B.marker.collapsed&&(B.from==null||B.from<t)&&(B.to==null||B.to>t)&&(!i||rt(i,B.marker)<0)&&(i=B.marker)}return i}function Ct(e,t,o,i,v){var B=dn(e,t),Z=ai&&B.markedSpans;if(Z)for(var ie=0;ie<Z.length;++ie){var ae=Z[ie];if(!ae.marker.collapsed)continue;var he=ae.marker.find(0),Xe=Xn(he.from,o)||at(ae.marker)-at(v),nt=Xn(he.to,i)||Be(ae.marker)-Be(v);if(Xe>=0&&nt<=0||Xe<=0&&nt>=0)continue;if(Xe<=0&&(ae.marker.inclusiveRight&&v.inclusiveLeft?Xn(he.to,o)>=0:Xn(he.to,o)>0)||Xe>=0&&(ae.marker.inclusiveRight&&v.inclusiveLeft?Xn(he.from,i)<=0:Xn(he.from,i)<0))return!0}}function _t(e){for(var t;t=Me(e);)e=t.find(-1,!0).line;return e}function Et(e){for(var t;t=ft(e);)e=t.find(1,!0).line;return e}function St(e){for(var t,o;t=ft(e);)e=t.find(1,!0).line,(o||(o=[])).push(e);return o}function Fe(e,t){var o=dn(e,t),i=_t(o);return o==i?t:rr(i)}function At(e,t){if(t>e.lastLine())return t;var o=dn(e,t),i;if(!Zt(e,o))return t;for(;i=ft(o);)o=i.find(1,!0).line;return rr(o)+1}function Zt(e,t){var o=ai&&t.markedSpans;if(o)for(var i=void 0,v=0;v<o.length;++v){if(i=o[v],!i.marker.collapsed)continue;if(i.from==null)return!0;if(i.marker.widgetNode)continue;if(i.from==0&&i.marker.inclusiveLeft&&sn(e,t,i))return!0}}function sn(e,t,o){if(o.to==null){var i=o.marker.find(1,!0);return sn(e,i.line,pi(i.line.markedSpans,o.marker))}if(o.marker.inclusiveRight&&o.to==t.text.length)return!0;for(var v=void 0,B=0;B<t.markedSpans.length;++B)if(v=t.markedSpans[B],v.marker.collapsed&&!v.marker.widgetNode&&v.from==o.to&&(v.to==null||v.to!=o.from)&&(v.marker.inclusiveLeft||o.marker.inclusiveRight)&&sn(e,t,v))return!0}function On(e){e=_t(e);for(var t=0,o=e.parent,i=0;i<o.lines.length;++i){var v=o.lines[i];if(v==e)break;t+=v.height}for(var B=o.parent;B;o=B,B=o.parent)for(var Z=0;Z<B.children.length;++Z){var ie=B.children[Z];if(ie==o)break;t+=ie.height}return t}function In(e){if(e.height==0)return 0;for(var t=e.text.length,o,i=e;o=Me(i);){var v=o.find(0,!0);i=v.from.line,t+=v.from.ch-v.to.ch}for(i=e;o=ft(i);){var B=o.find(0,!0);t-=i.text.length-B.from.ch,i=B.to.line,t+=i.text.length-B.to.ch}return t}function Ft(e){var t=e.display,o=e.doc;t.maxLine=dn(o,o.first),t.maxLineLength=In(t.maxLine),t.maxLineChanged=!0,o.iter(function(i){var v=In(i);v>t.maxLineLength&&(t.maxLineLength=v,t.maxLine=i)})}var $t=function(e,t,o){this.text=e,De(this,t),this.height=o?o(this):1};$t.prototype.lineNo=function(){return rr(this)},Pe($t);function Fn(e,t,o,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Ae(e),De(e,o);var v=i?i(e):1;v!=e.height&&tr(e,v)}function Oe(e){e.parent=null,Ae(e)}var It={},Ut={};function tn(e,t){if(!e||/^\s*$/.test(e))return null;var o=t.addModeClass?Ut:It;return o[e]||(o[e]=e.replace(/\S+/g,"cm-$&"))}function un(e,t){var o=g("span",null,null,I?"padding-right: .1px":null),i={pre:g("pre",[o],"CodeMirror-line"),content:o,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var v=0;v<=(t.rest?t.rest.length:0);v++){var B=v?t.rest[v-1]:t.line,Z=void 0;i.pos=0,i.addToken=An,Vt(e.display.measure)&&(Z=pn(B,e.doc.direction))&&(i.addToken=pr(i.addToken,Z)),i.map=[];var ie=t!=e.display.externalMeasured&&rr(B);jn(B,i,Kt(e,B,ie)),B.styleClasses&&(B.styleClasses.bgClass&&(i.bgClass=K(B.styleClasses.bgClass,i.bgClass||"")),B.styleClasses.textClass&&(i.textClass=K(B.styleClasses.textClass,i.textClass||""))),i.map.length==0&&i.map.push(0,0,i.content.appendChild(mn(e.display.measure))),v==0?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(I){var ae=i.content.lastChild;(/\bcm-tab\b/.test(ae.className)||ae.querySelector&&ae.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return ct(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=K(i.pre.className,i.textClass||"")),i}function Sn(e){var t=d("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function An(e,t,o,i,v,B,Z){if(!t)return;var ie=e.splitSpaces?$n(t,e.trailingSpace):t,ae=e.cm.state.specialChars,he=!1,Xe;if(!ae.test(t))e.col+=t.length,Xe=document.createTextNode(ie),e.map.push(e.pos,e.pos+t.length,Xe),H&&O<9&&(he=!0),e.pos+=t.length;else{Xe=document.createDocumentFragment();for(var nt=0;;){ae.lastIndex=nt;var xt=ae.exec(t),yt=xt?xt.index-nt:t.length-nt;if(yt){var Yt=document.createTextNode(ie.slice(nt,nt+yt));H&&O<9?Xe.appendChild(d("span",[Yt])):Xe.appendChild(Yt),e.map.push(e.pos,e.pos+yt,Yt),e.col+=yt,e.pos+=yt}if(!xt)break;nt+=yt+1;var cn=void 0;if(xt[0]==" "){var Cn=e.cm.options.tabSize,Ln=Cn-e.col%Cn;cn=Xe.appendChild(d("span",ue(Ln),"cm-tab")),cn.setAttribute("role","presentation"),cn.setAttribute("cm-text"," "),e.col+=Ln}else xt[0]=="\r"||xt[0]==`
`?(cn=Xe.appendChild(d("span",xt[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),cn.setAttribute("cm-text",xt[0]),e.col+=1):(cn=e.cm.options.specialCharPlaceholder(xt[0]),cn.setAttribute("cm-text",xt[0]),H&&O<9?Xe.appendChild(d("span",[cn])):Xe.appendChild(cn),e.col+=1);e.map.push(e.pos,e.pos+1,cn),e.pos++}}if(e.trailingSpace=ie.charCodeAt(t.length-1)==32,o||i||v||he||B||Z){var Hn=o||"";i&&(Hn+=i),v&&(Hn+=v);var Mn=d("span",[Xe],Hn,B);if(Z)for(var Yn in Z)Z.hasOwnProperty(Yn)&&Yn!="style"&&Yn!="class"&&Mn.setAttribute(Yn,Z[Yn]);return e.content.appendChild(Mn)}e.content.appendChild(Xe)}function $n(e,t){if(e.length>1&&!/ /.test(e))return e;for(var o=t,i="",v=0;v<e.length;v++){var B=e.charAt(v);B==" "&&o&&(v==e.length-1||e.charCodeAt(v+1)==32)&&(B="\xA0"),i+=B,o=B==" "}return i}function pr(e,t){return function(o,i,v,B,Z,ie,ae){v=v?v+" cm-force-border":"cm-force-border";for(var he=o.pos,Xe=he+i.length;;){for(var nt=void 0,xt=0;xt<t.length&&!(nt=t[xt],nt.to>he&&nt.from<=he);xt++);if(nt.to>=Xe)return e(o,i,v,B,Z,ie,ae);e(o,i.slice(0,nt.to-he),v,B,null,ie,ae),B=null,i=i.slice(nt.to-he),he=nt.to}}}function Tn(e,t,o,i){var v=!i&&o.widgetNode;v&&e.map.push(e.pos,e.pos+t,v),!i&&e.cm.display.input.needsContentAttribute&&(v||(v=e.content.appendChild(document.createElement("span"))),v.setAttribute("cm-marker",o.id)),v&&(e.cm.display.input.setUneditable(v),e.content.appendChild(v)),e.pos+=t,e.trailingSpace=!1}function jn(e,t,o){var i=e.markedSpans,v=e.text,B=0;if(!i){for(var Z=1;Z<o.length;Z+=2)t.addToken(t,v.slice(B,B=o[Z]),tn(o[Z+1],t.cm.options));return}for(var ie=v.length,ae=0,he=1,Xe="",nt,xt,yt=0,Yt,cn,Cn,Ln,Hn;;){if(yt==ae){Yt=cn=Cn=xt="",Hn=null,Ln=null,yt=Infinity;for(var Mn=[],Yn=void 0,vr=0;vr<i.length;++vr){var sr=i[vr],Ir=sr.marker;if(Ir.type=="bookmark"&&sr.from==ae&&Ir.widgetNode)Mn.push(Ir);else if(sr.from<=ae&&(sr.to==null||sr.to>ae||Ir.collapsed&&sr.to==ae&&sr.from==ae)){if(sr.to!=null&&sr.to!=ae&&yt>sr.to&&(yt=sr.to,cn=""),Ir.className&&(Yt+=" "+Ir.className),Ir.css&&(xt=(xt?xt+";":"")+Ir.css),Ir.startStyle&&sr.from==ae&&(Cn+=" "+Ir.startStyle),Ir.endStyle&&sr.to==yt&&(Yn||(Yn=[])).push(Ir.endStyle,sr.to),Ir.title&&((Hn||(Hn={})).title=Ir.title),Ir.attributes)for(var ci in Ir.attributes)(Hn||(Hn={}))[ci]=Ir.attributes[ci];Ir.collapsed&&(!Ln||rt(Ln.marker,Ir)<0)&&(Ln=sr)}else sr.from>ae&&yt>sr.from&&(yt=sr.from)}if(Yn)for(var Hi=0;Hi<Yn.length;Hi+=2)Yn[Hi+1]==yt&&(cn+=" "+Yn[Hi]);if(!Ln||Ln.from==ae)for(var bi=0;bi<Mn.length;++bi)Tn(t,0,Mn[bi]);if(Ln&&(Ln.from||0)==ae){if(Tn(t,(Ln.to==null?ie+1:Ln.to)-ae,Ln.marker,Ln.from==null),Ln.to==null)return;Ln.to==ae&&(Ln=!1)}}if(ae>=ie)break;for(var sa=Math.min(ie,yt);;){if(Xe){var ra=ae+Xe.length;if(!Ln){var Pi=ra>sa?Xe.slice(0,sa-ae):Xe;t.addToken(t,Pi,nt?nt+Yt:Yt,Cn,ae+Pi.length==yt?cn:"",xt,Hn)}if(ra>=sa){Xe=Xe.slice(sa-ae),ae=sa;break}ae=ra,Cn=""}Xe=v.slice(B,B=o[he++]),nt=tn(o[he++],t.cm.options)}}}function wn(e,t,o){this.line=t,this.rest=St(t),this.size=this.rest?rr(se(this.rest))-o+1:1,this.node=this.text=null,this.hidden=Zt(e,t)}function fn(e,t,o){for(var i=[],v,B=t;B<o;B=v){var Z=new wn(e.doc,dn(e.doc,B),B);v=B+Z.size,i.push(Z)}return i}var Kn=null;function yr(e){Kn?Kn.ops.push(e):e.ownsGroup=Kn={ops:[e],delayedCallbacks:[]}}function hr(e){var t=e.delayedCallbacks,o=0;do{for(;o<t.length;o++)t[o].call(null);for(var i=0;i<e.ops.length;i++){var v=e.ops[i];if(v.cursorActivityHandlers)for(;v.cursorActivityCalled<v.cursorActivityHandlers.length;)v.cursorActivityHandlers[v.cursorActivityCalled++].call(null,v.cm)}}while(o<t.length)}function xn(e,t){var o=e.ownsGroup;if(!o)return;try{hr(o)}finally{Kn=null,t(o)}}var Wt=null;function qt(e,t){var o=bt(e,t);if(!o.length)return;var i=Array.prototype.slice.call(arguments,2),v;Kn?v=Kn.delayedCallbacks:Wt?v=Wt:(v=Wt=[],setTimeout(Dn,0));for(var B=function(ie){v.push(function(){return o[ie].apply(null,i)})},Z=0;Z<o.length;++Z)B(Z)}function Dn(){var e=Wt;Wt=null;for(var t=0;t<e.length;++t)e[t]()}function bn(e,t,o,i){for(var v=0;v<t.changes.length;v++){var B=t.changes[v];B=="text"?Gr(e,t):B=="gutter"?mr(e,t,o,i):B=="class"?Hr(e,t):B=="widget"&&Rn(e,t,i)}t.changes=null}function er(e){return e.node==e.text&&(e.node=d("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),H&&O<8&&(e.node.style.zIndex=2)),e.node}function jr(e,t){var o=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(o&&(o+=" CodeMirror-linebackground"),t.background)o?t.background.className=o:(t.background.parentNode.removeChild(t.background),t.background=null);else if(o){var i=er(t);t.background=i.insertBefore(d("div",null,o),i.firstChild),e.display.input.setUneditable(t.background)}}function br(e,t){var o=e.display.externalMeasured;return o&&o.line==t.line?(e.display.externalMeasured=null,t.measure=o.measure,o.built):un(e,t)}function Gr(e,t){var o=t.text.className,i=br(e,t);t.text==t.node&&(t.node=i.pre),t.text.parentNode.replaceChild(i.pre,t.text),t.text=i.pre,i.bgClass!=t.bgClass||i.textClass!=t.textClass?(t.bgClass=i.bgClass,t.textClass=i.textClass,Hr(e,t)):o&&(t.text.className=o)}function Hr(e,t){jr(e,t),t.line.wrapClass?er(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var o=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=o||""}function mr(e,t,o,i){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var v=er(t);t.gutterBackground=d("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),v.insertBefore(t.gutterBackground,t.text)}var B=t.line.gutterMarkers;if(e.options.lineNumbers||B){var Z=er(t),ie=t.gutter=d("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(e.display.input.setUneditable(ie),Z.insertBefore(ie,t.text),t.line.gutterClass&&(ie.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!B||!B["CodeMirror-linenumbers"])&&(t.lineNumber=ie.appendChild(d("div",hi(e.options,o),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),B)for(var ae=0;ae<e.display.gutterSpecs.length;++ae){var he=e.display.gutterSpecs[ae].className,Xe=B.hasOwnProperty(he)&&B[he];Xe&&ie.appendChild(d("div",[Xe],"CodeMirror-gutter-elt","left: "+i.gutterLeft[he]+"px; width: "+i.gutterWidth[he]+"px"))}}}function Rn(e,t,o){t.alignable&&(t.alignable=null);for(var i=S("CodeMirror-linewidget"),v=t.node.firstChild,B=void 0;v;v=B)B=v.nextSibling,i.test(v.className)&&t.node.removeChild(v);kr(e,t,o)}function Tr(e,t,o,i){var v=br(e,t);return t.text=t.node=v.pre,v.bgClass&&(t.bgClass=v.bgClass),v.textClass&&(t.textClass=v.textClass),Hr(e,t),mr(e,t,o,i),kr(e,t,i),t.node}function kr(e,t,o){if(mi(e,t.line,t,o,!0),t.rest)for(var i=0;i<t.rest.length;i++)mi(e,t.rest[i],t,o,!1)}function mi(e,t,o,i,v){if(!t.widgets)return;for(var B=er(o),Z=0,ie=t.widgets;Z<ie.length;++Z){var ae=ie[Z],he=d("div",[ae.node],"CodeMirror-linewidget"+(ae.className?" "+ae.className:""));ae.handleMouseEvents||he.setAttribute("cm-ignore-events","true"),Vr(ae,he,o,i),e.display.input.setUneditable(he),v&&ae.above?B.insertBefore(he,o.gutter||o.text):B.appendChild(he),qt(ae,"redraw")}}function Vr(e,t,o,i){if(e.noHScroll){(o.alignable||(o.alignable=[])).push(t);var v=i.wrapperWidth;t.style.left=i.fixedPos+"px",e.coverGutter||(v-=i.gutterTotalWidth,t.style.paddingLeft=i.gutterTotalWidth+"px"),t.style.width=v+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-i.gutterTotalWidth+"px"))}function Cr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!T(document.body,e.node)){var o="position: relative;";e.coverGutter&&(o+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(o+="width: "+t.display.wrapper.clientWidth+"px;"),f(t.display.measure,d("div",[e.node],null,o))}return e.height=e.node.parentNode.offsetHeight}function Fr(e,t){for(var o=ze(t);o!=e.wrapper;o=o.parentNode)if(!o||o.nodeType==1&&o.getAttribute("cm-ignore-events")=="true"||o.parentNode==e.sizer&&o!=e.mover)return!0}function ti(e){return e.lineSpace.offsetTop}function Re(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function qe(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=f(e.measure,d("pre","x","CodeMirror-line-like")),o=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,i={left:parseInt(o.paddingLeft),right:parseInt(o.paddingRight)};return!isNaN(i.left)&&!isNaN(i.right)&&(e.cachedPaddingH=i),i}function ot(e){return pe-e.display.nativeBarWidth}function Ne(e){return e.display.scroller.clientWidth-ot(e)-e.display.barWidth}function le(e){return e.display.scroller.clientHeight-ot(e)-e.display.barHeight}function ye(e,t,o){var i=e.options.lineWrapping,v=i&&Ne(e);if(!t.measure.heights||i&&t.measure.width!=v){var B=t.measure.heights=[];if(i){t.measure.width=v;for(var Z=t.text.firstChild.getClientRects(),ie=0;ie<Z.length-1;ie++){var ae=Z[ie],he=Z[ie+1];Math.abs(ae.bottom-he.bottom)>2&&B.push((ae.bottom+he.top)/2-o.top)}}B.push(o.bottom-o.top)}}function fe(e,t,o){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var i=0;i<e.rest.length;i++)if(e.rest[i]==t)return{map:e.measure.maps[i],cache:e.measure.caches[i]};for(var v=0;v<e.rest.length;v++)if(rr(e.rest[v])>o)return{map:e.measure.maps[v],cache:e.measure.caches[v],before:!0}}function Ue(e,t){t=_t(t);var o=rr(t),i=e.display.externalMeasured=new wn(e.doc,t,o);i.lineN=o;var v=i.built=un(e,i);return i.text=v.pre,f(e.display.lineMeasure,v.pre),i}function Ye(e,t,o,i){return pt(e,Qe(e,t),o,i)}function dt(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[ei(e,t)];var o=e.display.externalMeasured;if(o&&t>=o.lineN&&t<o.lineN+o.size)return o}function Qe(e,t){var o=rr(t),i=dt(e,o);i&&!i.text?i=null:i&&i.changes&&(bn(e,i,o,nr(e)),e.curOp.forceUpdate=!0),i||(i=Ue(e,t));var v=fe(i,t,o);return{line:t,view:i,rect:null,map:v.map,cache:v.cache,before:v.before,hasHeights:!1}}function pt(e,t,o,i,v){t.before&&(o=-1);var B=o+(i||""),Z;return t.cache.hasOwnProperty(B)?Z=t.cache[B]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(ye(e,t.view,t.rect),t.hasHeights=!0),Z=_n(e,t,o,i),Z.bogus||(t.cache[B]=Z)),{left:Z.left,right:Z.right,top:v?Z.rtop:Z.top,bottom:v?Z.rbottom:Z.bottom}}var Nt={left:0,right:0,top:0,bottom:0};function zt(e,t,o){for(var i,v,B,Z,ie,ae,he=0;he<e.length;he+=3)if(ie=e[he],ae=e[he+1],t<ie?(v=0,B=1,Z="left"):t<ae?(v=t-ie,B=v+1):(he==e.length-3||t==ae&&e[he+3]>t)&&(B=ae-ie,v=B-1,t>=ae&&(Z="right")),v!=null){if(i=e[he+2],ie==ae&&o==(i.insertLeft?"left":"right")&&(Z=o),o=="left"&&v==0)for(;he&&e[he-2]==e[he-3]&&e[he-1].insertLeft;)i=e[(he-=3)+2],Z="left";if(o=="right"&&v==ae-ie)for(;he<e.length-3&&e[he+3]==e[he+4]&&!e[he+5].insertLeft;)i=e[(he+=3)+2],Z="right";break}return{node:i,start:v,end:B,collapse:Z,coverStart:ie,coverEnd:ae}}function nn(e,t){var o=Nt;if(t=="left")for(var i=0;i<e.length&&!((o=e[i]).left!=o.right);i++);else for(var v=e.length-1;v>=0&&!((o=e[v]).left!=o.right);v--);return o}function _n(e,t,o,i){var v=zt(t.map,o,i),B=v.node,Z=v.start,ie=v.end,ae=v.collapse,he;if(B.nodeType==3){for(var Xe=0;Xe<4;Xe++){for(;Z&&ke(t.line.text.charAt(v.coverStart+Z));)--Z;for(;v.coverStart+ie<v.coverEnd&&ke(t.line.text.charAt(v.coverStart+ie));)++ie;if(H&&O<9&&Z==0&&ie==v.coverEnd-v.coverStart?he=B.parentNode.getBoundingClientRect():he=nn(E(B,Z,ie).getClientRects(),i),he.left||he.right||Z==0)break;ie=Z,Z=Z-1,ae="right"}H&&O<11&&(he=Pn(e.display.measure,he))}else{Z>0&&(ae=i="right");var nt;e.options.lineWrapping&&(nt=B.getClientRects()).length>1?he=nt[i=="right"?nt.length-1:0]:he=B.getBoundingClientRect()}if(H&&O<9&&!Z&&(!he||!he.left&&!he.right)){var xt=B.parentNode.getClientRects()[0];xt?he={left:xt.left,right:xt.left+Or(e.display),top:xt.top,bottom:xt.bottom}:he=Nt}for(var yt=he.top-t.rect.top,Yt=he.bottom-t.rect.top,cn=(yt+Yt)/2,Cn=t.view.measure.heights,Ln=0;Ln<Cn.length-1&&!(cn<Cn[Ln]);Ln++);var Hn=Ln?Cn[Ln-1]:0,Mn=Cn[Ln],Yn={left:(ae=="right"?he.right:he.left)-t.rect.left,right:(ae=="left"?he.left:he.right)-t.rect.left,top:Hn,bottom:Mn};return!he.left&&!he.right&&(Yn.bogus=!0),e.options.singleCursorHeightPerLine||(Yn.rtop=yt,Yn.rbottom=Yt),Yn}function Pn(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ge(e))return t;var o=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*o,right:t.right*o,top:t.top*i,bottom:t.bottom*i}}function Zn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function qn(e){e.display.externalMeasure=null,_(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Zn(e.display.view[t])}function cr(e){qn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function lr(){return p&&l?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ur(){return p&&l?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function gr(e){var t=0;if(e.widgets)for(var o=0;o<e.widgets.length;++o)e.widgets[o].above&&(t+=Cr(e.widgets[o]));return t}function Er(e,t,o,i,v){if(!v){var B=gr(t);o.top+=B,o.bottom+=B}if(i=="line")return o;i||(i="local");var Z=On(t);if(i=="local"?Z+=ti(e.display):Z-=e.display.viewOffset,i=="page"||i=="window"){var ie=e.display.lineSpace.getBoundingClientRect();Z+=ie.top+(i=="window"?0:ur());var ae=ie.left+(i=="window"?0:lr());o.left+=ae,o.right+=ae}return o.top+=Z,o.bottom+=Z,o}function Vn(e,t,o){if(o=="div")return t;var i=t.left,v=t.top;if(o=="page")i-=lr(),v-=ur();else if(o=="local"||!o){var B=e.display.sizer.getBoundingClientRect();i+=B.left,v+=B.top}var Z=e.display.lineSpace.getBoundingClientRect();return{left:i-Z.left,top:v-Z.top}}function Pr(e,t,o,i,v){return i||(i=dn(e.doc,t.line)),Er(e,i,Ye(e,i,t.ch,v),o)}function Qn(e,t,o,i,v,B){i=i||dn(e.doc,t.line),v||(v=Qe(e,i));function Z(Yt,cn){var Cn=pt(e,v,Yt,cn?"right":"left",B);return cn?Cn.left=Cn.right:Cn.right=Cn.left,Er(e,i,Cn,o)}var ie=pn(i,e.doc.direction),ae=t.ch,he=t.sticky;if(ae>=i.text.length?(ae=i.text.length,he="before"):ae<=0&&(ae=0,he="after"),!ie)return Z(he=="before"?ae-1:ae,he=="before");function Xe(Yt,cn,Cn){var Ln=ie[cn],Hn=Ln.level==1;return Z(Cn?Yt-1:Yt,Hn!=Cn)}var nt=lt(ie,ae,he),xt=Bt,yt=Xe(ae,nt,he=="before");return xt!=null&&(yt.other=Xe(ae,xt,he!="before")),yt}function on(e,t){var o=0;t=A(e.doc,t),e.options.lineWrapping||(o=Or(e.display)*t.ch);var i=dn(e.doc,t.line),v=On(i)+ti(e.display);return{left:o,right:o,top:v,bottom:v+i.height}}function vn(e,t,o,i,v){var B=an(e,t,o);return B.xRel=v,i&&(B.outside=i),B}function dr(e,t,o){var i=e.doc;if(o+=e.display.viewOffset,o<0)return vn(i.first,0,null,-1,-1);var v=Nr(i,o),B=i.first+i.size-1;if(v>B)return vn(i.first+i.size-1,dn(i,B).text.length,null,1,1);t<0&&(t=0);for(var Z=dn(i,v);;){var ie=Yr(e,Z,v,t,o),ae=Ot(Z,ie.ch+(ie.xRel>0||ie.outside>0?1:0));if(!ae)return ie;var he=ae.find(1);if(he.line==v)return he;Z=dn(i,v=he.line)}}function wr(e,t,o,i){i-=gr(t);var v=t.text.length,B=Pt(function(Z){return pt(e,o,Z-1).bottom<=i},v,0);return v=Pt(function(Z){return pt(e,o,Z).top>i},B,v),{begin:B,end:v}}function Wn(e,t,o,i){o||(o=Qe(e,t));var v=Er(e,t,pt(e,o,i),"line").top;return wr(e,t,o,v)}function xr(e,t,o,i){return e.bottom<=o?!1:e.top>o?!0:(i?e.left:e.right)>t}function Yr(e,t,o,i,v){v-=On(t);var B=Qe(e,t),Z=gr(t),ie=0,ae=t.text.length,he=!0,Xe=pn(t,e.doc.direction);if(Xe){var nt=(e.options.lineWrapping?Wr:Sr)(e,t,o,B,Xe,i,v);he=nt.level!=1,ie=he?nt.from:nt.to-1,ae=he?nt.to:nt.from-1}var xt=null,yt=null,Yt=Pt(function(vr){var sr=pt(e,B,vr);return sr.top+=Z,sr.bottom+=Z,xr(sr,i,v,!1)?(sr.top<=v&&sr.left<=i&&(xt=vr,yt=sr),!0):!1},ie,ae),cn,Cn,Ln=!1;if(yt){var Hn=i-yt.left<yt.right-i,Mn=Hn==he;Yt=xt+(Mn?0:1),Cn=Mn?"after":"before",cn=Hn?yt.left:yt.right}else{!he&&(Yt==ae||Yt==ie)&&Yt++,Cn=Yt==0?"after":Yt==t.text.length?"before":pt(e,B,Yt-(he?1:0)).bottom+Z<=v==he?"after":"before";var Yn=Qn(e,an(o,Yt,Cn),"line",t,B);cn=Yn.left,Ln=v<Yn.top?-1:v>=Yn.bottom?1:0}return Yt=$e(t.text,Yt,1),vn(o,Yt,Cn,Ln,i-cn)}function Sr(e,t,o,i,v,B,Z){var ie=Pt(function(nt){var xt=v[nt],yt=xt.level!=1;return xr(Qn(e,an(o,yt?xt.to:xt.from,yt?"before":"after"),"line",t,i),B,Z,!0)},0,v.length-1),ae=v[ie];if(ie>0){var he=ae.level!=1,Xe=Qn(e,an(o,he?ae.from:ae.to,he?"after":"before"),"line",t,i);xr(Xe,B,Z,!0)&&Xe.top>Z&&(ae=v[ie-1])}return ae}function Wr(e,t,o,i,v,B,Z){var ie=wr(e,t,i,Z),ae=ie.begin,he=ie.end;/\s/.test(t.text.charAt(he-1))&&he--;for(var Xe=null,nt=null,xt=0;xt<v.length;xt++){var yt=v[xt];if(yt.from>=he||yt.to<=ae)continue;var Yt=yt.level!=1,cn=pt(e,i,Yt?Math.min(he,yt.to)-1:Math.max(ae,yt.from)).right,Cn=cn<B?B-cn+1e9:cn-B;(!Xe||nt>Cn)&&(Xe=yt,nt=Cn)}return Xe||(Xe=v[v.length-1]),Xe.from<ae&&(Xe={from:ae,to:Xe.to,level:Xe.level}),Xe.to>he&&(Xe={from:Xe.from,to:he,level:Xe.level}),Xe}var Rr;function Ar(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Rr==null){Rr=d("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Rr.appendChild(document.createTextNode("x")),Rr.appendChild(d("br"));Rr.appendChild(document.createTextNode("x"))}f(e.measure,Rr);var o=Rr.offsetHeight/50;return o>3&&(e.cachedTextHeight=o),_(e.measure),o||1}function Or(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=d("span","xxxxxxxxxx"),o=d("pre",[t],"CodeMirror-line-like");f(e.measure,o);var i=t.getBoundingClientRect(),v=(i.right-i.left)/10;return v>2&&(e.cachedCharWidth=v),v||10}function nr(e){for(var t=e.display,o={},i={},v=t.gutters.clientLeft,B=t.gutters.firstChild,Z=0;B;B=B.nextSibling,++Z){var ie=e.display.gutterSpecs[Z].className;o[ie]=B.offsetLeft+B.clientLeft+v,i[ie]=B.clientWidth}return{fixedPos:li(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:o,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function li(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Yi(e){var t=Ar(e.display),o=e.options.lineWrapping,i=o&&Math.max(5,e.display.scroller.clientWidth/Or(e.display)-3);return function(v){if(Zt(e.doc,v))return 0;var B=0;if(v.widgets)for(var Z=0;Z<v.widgets.length;Z++)v.widgets[Z].height&&(B+=v.widgets[Z].height);return o?B+(Math.ceil(v.text.length/i)||1)*t:B+t}}function wi(e){var t=e.doc,o=Yi(e);t.iter(function(i){var v=o(i);v!=i.height&&tr(i,v)})}function gi(e,t,o,i){var v=e.display;if(!o&&ze(t).getAttribute("cm-not-content")=="true")return null;var B,Z,ie=v.lineSpace.getBoundingClientRect();try{B=t.clientX-ie.left,Z=t.clientY-ie.top}catch(nt){return null}var ae=dr(e,B,Z),he;if(i&&ae.xRel>0&&(he=dn(e.doc,ae.line).text).length==ae.ch){var Xe=W(he,he.length,e.options.tabSize)-he.length;ae=an(ae.line,Math.max(0,Math.round((B-qe(e.display).left)/Or(e.display))-Xe))}return ae}function ei(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var o=e.display.view,i=0;i<o.length;i++)if(t-=o[i].size,t<0)return i}function Xr(e,t,o,i){t==null&&(t=e.doc.first),o==null&&(o=e.doc.first+e.doc.size),i||(i=0);var v=e.display;if(i&&o<v.viewTo&&(v.updateLineNumbers==null||v.updateLineNumbers>t)&&(v.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=v.viewTo)ai&&Fe(e.doc,t)<v.viewTo&&yn(e);else if(o<=v.viewFrom)ai&&At(e.doc,o+i)>v.viewFrom?yn(e):(v.viewFrom+=i,v.viewTo+=i);else if(t<=v.viewFrom&&o>=v.viewTo)yn(e);else if(t<=v.viewFrom){var B=zn(e,o,o+i,1);B?(v.view=v.view.slice(B.index),v.viewFrom=B.lineN,v.viewTo+=i):yn(e)}else if(o>=v.viewTo){var Z=zn(e,t,t,-1);Z?(v.view=v.view.slice(0,Z.index),v.viewTo=Z.lineN):yn(e)}else{var ie=zn(e,t,t,-1),ae=zn(e,o,o+i,1);ie&&ae?(v.view=v.view.slice(0,ie.index).concat(fn(e,ie.lineN,ae.lineN)).concat(v.view.slice(ae.index)),v.viewTo+=i):yn(e)}var he=v.externalMeasured;he&&(o<he.lineN?he.lineN+=i:t<he.lineN+he.size&&(v.externalMeasured=null))}function En(e,t,o){e.curOp.viewChanged=!0;var i=e.display,v=e.display.externalMeasured;if(v&&t>=v.lineN&&t<v.lineN+v.size&&(i.externalMeasured=null),t<i.viewFrom||t>=i.viewTo)return;var B=i.view[ei(e,t)];if(B.node==null)return;var Z=B.changes||(B.changes=[]);te(Z,o)==-1&&Z.push(o)}function yn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function zn(e,t,o,i){var v=ei(e,t),B,Z=e.display.view;if(!ai||o==e.doc.first+e.doc.size)return{index:v,lineN:o};for(var ie=e.display.viewFrom,ae=0;ae<v;ae++)ie+=Z[ae].size;if(ie!=t){if(i>0){if(v==Z.length-1)return null;B=ie+Z[v].size-t,v++}else B=ie-t;t+=B,o+=B}for(;Fe(e.doc,o)!=o;){if(v==(i<0?0:Z.length-1))return null;o+=i*Z[v-(i<0?1:0)].size,v+=i}return{index:v,lineN:o}}function Br(e,t,o){var i=e.display,v=i.view;v.length==0||t>=i.viewTo||o<=i.viewFrom?(i.view=fn(e,t,o),i.viewFrom=t):(i.viewFrom>t?i.view=fn(e,t,i.viewFrom).concat(i.view):i.viewFrom<t&&(i.view=i.view.slice(ei(e,t))),i.viewFrom=t,i.viewTo<o?i.view=i.view.concat(fn(e,i.viewTo,o)):i.viewTo>o&&(i.view=i.view.slice(0,ei(e,o)))),i.viewTo=o}function or(e){for(var t=e.display.view,o=0,i=0;i<t.length;i++){var v=t[i];!v.hidden&&(!v.node||v.changes)&&++o}return o}function Lr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ji(e,t){t===void 0&&(t=!0);for(var o=e.doc,i={},v=i.cursors=document.createDocumentFragment(),B=i.selection=document.createDocumentFragment(),Z=0;Z<o.sel.ranges.length;Z++){if(!t&&Z==o.sel.primIndex)continue;var ie=o.sel.ranges[Z];if(ie.from().line>=e.display.viewTo||ie.to().line<e.display.viewFrom)continue;var ae=ie.empty();(ae||e.options.showCursorWhenSelecting)&&Fi(e,ie.head,v),ae||Zr(e,ie,B)}return i}function Fi(e,t,o){var i=Qn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),v=o.appendChild(d("div","\xA0","CodeMirror-cursor"));if(v.style.left=i.left+"px",v.style.top=i.top+"px",v.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var B=o.appendChild(d("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));B.style.display="",B.style.left=i.other.left+"px",B.style.top=i.other.top+"px",B.style.height=(i.other.bottom-i.other.top)*.85+"px"}}function $r(e,t){return e.top-t.top||e.left-t.left}function Zr(e,t,o){var i=e.display,v=e.doc,B=document.createDocumentFragment(),Z=qe(e.display),ie=Z.left,ae=Math.max(i.sizerWidth,Ne(e)-i.sizer.offsetLeft)-Z.right,he=v.direction=="ltr";function Xe(Mn,Yn,vr,sr){Yn<0&&(Yn=0),Yn=Math.round(Yn),sr=Math.round(sr),B.appendChild(d("div",null,"CodeMirror-selected","position: absolute; left: "+Mn+`px;
top: `+Yn+"px; width: "+(vr==null?ae-Mn:vr)+`px;
height: `+(sr-Yn)+"px"))}function nt(Mn,Yn,vr){var sr=dn(v,Mn),Ir=sr.text.length,ci,Hi;function bi(Pi,ia){return Pr(e,an(Mn,Pi),"div",sr,ia)}function sa(Pi,ia,Gi){var Ii=Wn(e,sr,null,Pi),Li=ia=="ltr"==(Gi=="after")?"left":"right",Ti=Gi=="after"?Ii.begin:Ii.end-(/\s/.test(sr.text.charAt(Ii.end-1))?2:1);return bi(Ti,Li)[Li]}var ra=pn(sr,v.direction);return Xt(ra,Yn||0,vr==null?Ir:vr,function(Pi,ia,Gi,Ii){var Li=Gi=="ltr",Ti=bi(Pi,Li?"left":"right"),aa=bi(ia-1,Li?"right":"left"),Oo=Yn==null&&Pi==0,to=vr==null&&ia==Ir,$i=Ii==0,La=!ra||Ii==ra.length-1;if(aa.top-Ti.top<=3){var Wi=(he?Oo:to)&&$i,ms=(he?to:Oo)&&La,za=Wi?ie:(Li?Ti:aa).left,lo=ms?ae:(Li?aa:Ti).right;Xe(za,Ti.top,lo-za,Ti.bottom)}else{var uo,qi,So,gs;Li?(uo=he&&Oo&&$i?ie:Ti.left,qi=he?ae:sa(Pi,Gi,"before"),So=he?ie:sa(ia,Gi,"after"),gs=he&&to&&La?ae:aa.right):(uo=he?sa(Pi,Gi,"before"):ie,qi=!he&&Oo&&$i?ae:Ti.right,So=!he&&to&&La?ie:aa.left,gs=he?sa(ia,Gi,"after"):ae),Xe(uo,Ti.top,qi-uo,Ti.bottom),Ti.bottom<aa.top&&Xe(ie,Ti.bottom,null,aa.top),Xe(So,aa.top,gs-So,aa.bottom)}(!ci||$r(Ti,ci)<0)&&(ci=Ti),$r(aa,ci)<0&&(ci=aa),(!Hi||$r(Ti,Hi)<0)&&(Hi=Ti),$r(aa,Hi)<0&&(Hi=aa)}),{start:ci,end:Hi}}var xt=t.from(),yt=t.to();if(xt.line==yt.line)nt(xt.line,xt.ch,yt.ch);else{var Yt=dn(v,xt.line),cn=dn(v,yt.line),Cn=_t(Yt)==_t(cn),Ln=nt(xt.line,xt.ch,Cn?Yt.text.length+1:null).end,Hn=nt(yt.line,Cn?0:null,yt.ch).start;Cn&&(Ln.top<Hn.top-2?(Xe(Ln.right,Ln.top,null,Ln.bottom),Xe(ie,Hn.top,Hn.left,Hn.bottom)):Xe(Ln.right,Ln.top,Hn.left-Ln.right,Ln.bottom)),Ln.bottom<Hn.top&&Xe(ie,Ln.bottom,null,Hn.top)}o.appendChild(B)}function xi(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var o=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Ta(e),t.cursorDiv.style.visibility=(o=!o)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Ma(e){e.state.focused||(e.display.input.focus(),ua(e))}function no(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ta(e))},100)}function ua(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(ct(e,"focus",e,t),e.state.focused=!0,U(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),I&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),xi(e)}function Ta(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(ct(e,"blur",e,t),e.state.focused=!1,b(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function wa(e){for(var t=e.display,o=t.lineDiv.offsetTop,i=0;i<t.view.length;i++){var v=t.view[i],B=e.options.lineWrapping,Z=void 0,ie=0;if(v.hidden)continue;if(H&&O<8){var ae=v.node.offsetTop+v.node.offsetHeight;Z=ae-o,o=ae}else{var he=v.node.getBoundingClientRect();Z=he.bottom-he.top,!B&&v.text.firstChild&&(ie=v.text.firstChild.getBoundingClientRect().right-he.left-1)}var Xe=v.line.height-Z;if((Xe>.005||Xe<-.005)&&(tr(v.line,Z),Oa(v.line),v.rest))for(var nt=0;nt<v.rest.length;nt++)Oa(v.rest[nt]);if(ie>e.display.sizerWidth){var xt=Math.ceil(ie/Or(e.display));xt>e.display.maxLineLength&&(e.display.maxLineLength=xt,e.display.maxLine=v.line,e.display.maxLineChanged=!0)}}}function Oa(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var o=e.widgets[t],i=o.node.parentNode;i&&(o.height=i.offsetHeight)}}function ka(e,t,o){var i=o&&o.top!=null?Math.max(0,o.top):e.scroller.scrollTop;i=Math.floor(i-ti(e));var v=o&&o.bottom!=null?o.bottom:i+e.wrapper.clientHeight,B=Nr(t,i),Z=Nr(t,v);if(o&&o.ensure){var ie=o.ensure.from.line,ae=o.ensure.to.line;ie<B?(B=ie,Z=Nr(t,On(dn(t,ie))+e.wrapper.clientHeight)):Math.min(ae,t.lastLine())>=Z&&(B=Nr(t,On(dn(t,ae))-e.wrapper.clientHeight),Z=ae)}return{from:B,to:Math.max(Z,B+1)}}function co(e,t){if(wt(e,"scrollCursorIntoView"))return;var o=e.display,i=o.sizer.getBoundingClientRect(),v=null;if(t.top+i.top<0?v=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(v=!1),v!=null&&!n){var B=d("div","\u200B",null,`position: absolute;
top: `+(t.top-o.viewOffset-ti(e.display))+`px;
height: `+(t.bottom-t.top+ot(e)+o.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(B),B.scrollIntoView(v),e.display.lineSpace.removeChild(B)}}function Ro(e,t,o,i){i==null&&(i=0);var v;!e.options.lineWrapping&&t==o&&(t=t.ch?an(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,o=t.sticky=="before"?an(t.line,t.ch+1,"before"):t);for(var B=0;B<5;B++){var Z=!1,ie=Qn(e,t),ae=!o||o==t?ie:Qn(e,o);v={left:Math.min(ie.left,ae.left),top:Math.min(ie.top,ae.top)-i,right:Math.max(ie.left,ae.left),bottom:Math.max(ie.bottom,ae.bottom)+i};var he=Sa(e,v),Xe=e.doc.scrollTop,nt=e.doc.scrollLeft;if(he.scrollTop!=null&&(Da(e,he.scrollTop),Math.abs(e.doc.scrollTop-Xe)>1&&(Z=!0)),he.scrollLeft!=null&&(ki(e,he.scrollLeft),Math.abs(e.doc.scrollLeft-nt)>1&&(Z=!0)),!Z)break}return v}function Ga(e,t){var o=Sa(e,t);o.scrollTop!=null&&Da(e,o.scrollTop),o.scrollLeft!=null&&ki(e,o.scrollLeft)}function Sa(e,t){var o=e.display,i=Ar(e.display);t.top<0&&(t.top=0);var v=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:o.scroller.scrollTop,B=le(e),Z={};t.bottom-t.top>B&&(t.bottom=t.top+B);var ie=e.doc.height+Re(o),ae=t.top<i,he=t.bottom>ie-i;if(t.top<v)Z.scrollTop=ae?0:t.top;else if(t.bottom>v+B){var Xe=Math.min(t.top,(he?ie:t.bottom)-B);Xe!=v&&(Z.scrollTop=Xe)}var nt=e.options.fixedGutter?0:o.gutters.offsetWidth,xt=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:o.scroller.scrollLeft-nt,yt=Ne(e)-o.gutters.offsetWidth,Yt=t.right-t.left>yt;return Yt&&(t.right=t.left+yt),t.left<10?Z.scrollLeft=0:t.left<xt?Z.scrollLeft=Math.max(0,t.left+nt-(Yt?0:10)):t.right>yt+xt-3&&(Z.scrollLeft=t.right+(Yt?0:10)-yt),Z}function Va(e,t){if(t==null)return;Ya(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function _a(e){Ya(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Ra(e,t,o){(t!=null||o!=null)&&Ya(e),t!=null&&(e.curOp.scrollLeft=t),o!=null&&(e.curOp.scrollTop=o)}function ho(e,t){Ya(e),e.curOp.scrollToPos=t}function Ya(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var o=on(e,t.from),i=on(e,t.to);Aa(e,o,i,t.margin)}}function Aa(e,t,o,i){var v=Sa(e,{left:Math.min(t.left,o.left),top:Math.min(t.top,o.top)-i,right:Math.max(t.right,o.right),bottom:Math.max(t.bottom,o.bottom)+i});Ra(e,v.scrollLeft,v.scrollTop)}function Da(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;j||Ua(e,{top:t}),ya(e,t,!0),j&&Ua(e),Na(e,100)}function ya(e,t,o){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!o)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function ki(e,t,o,i){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(o?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!i)return;e.doc.scrollLeft=t,Mr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function fa(e){var t=e.display,o=t.gutters.offsetWidth,i=Math.round(e.doc.height+Re(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?o:0,docHeight:i,scrollHeight:i+ot(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:o}}var pa=function(e,t,o){this.cm=o;var i=this.vert=d("div",[d("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),v=this.horiz=d("div",[d("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=v.tabIndex=-1,e(i),e(v),Ze(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),Ze(v,"scroll",function(){v.clientWidth&&t(v.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,H&&O<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};pa.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,o=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(o){this.vert.style.display="block",this.vert.style.bottom=t?i+"px":"0";var v=e.viewHeight-(t?i:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+v)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=o?i+"px":"0",this.horiz.style.left=e.barLeft+"px";var B=e.viewWidth-e.barLeft-(o?i:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+B)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(i==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:o?i:0,bottom:t?i:0}},pa.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},pa.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},pa.prototype.zeroWidthHack=function(){var e=u&&!r?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new X,this.disableVert=new X},pa.prototype.enableZeroWidthBar=function(e,t,o){e.style.pointerEvents="auto";function i(){var v=e.getBoundingClientRect(),B=o=="vert"?document.elementFromPoint(v.right-1,(v.top+v.bottom)/2):document.elementFromPoint((v.right+v.left)/2,v.bottom-1);B!=e?e.style.pointerEvents="none":t.set(1e3,i)}t.set(1e3,i)},pa.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ba=function(){};ba.prototype.update=function(){return{bottom:0,right:0}},ba.prototype.setScrollLeft=function(){},ba.prototype.setScrollTop=function(){},ba.prototype.clear=function(){};function ma(e,t){t||(t=fa(e));var o=e.display.barWidth,i=e.display.barHeight;Xa(e,t);for(var v=0;v<4&&o!=e.display.barWidth||i!=e.display.barHeight;v++)o!=e.display.barWidth&&e.options.lineWrapping&&wa(e),Xa(e,fa(e)),o=e.display.barWidth,i=e.display.barHeight}function Xa(e,t){var o=e.display,i=o.scrollbars.update(t);o.sizer.style.paddingRight=(o.barWidth=i.right)+"px",o.sizer.style.paddingBottom=(o.barHeight=i.bottom)+"px",o.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(o.scrollbarFiller.style.display="block",o.scrollbarFiller.style.height=i.bottom+"px",o.scrollbarFiller.style.width=i.right+"px"):o.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(o.gutterFiller.style.display="block",o.gutterFiller.style.height=i.bottom+"px",o.gutterFiller.style.width=t.gutterWidth+"px"):o.gutterFiller.style.display=""}var $a={native:pa,null:ba};function Qa(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&b(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new $a[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ze(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,o){o=="horizontal"?ki(e,t):Da(e,t)},e),e.display.scrollbars.addClass&&U(e.display.wrapper,e.display.scrollbars.addClass)}var Ia=0;function ca(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:++Ia},yr(e.curOp)}function Ea(e){var t=e.curOp;t&&xn(t,function(o){for(var i=0;i<o.ops.length;i++)o.ops[i].cm.curOp=null;ro(o)})}function ro(e){for(var t=e.ops,o=0;o<t.length;o++)Ao(t[o]);for(var i=0;i<t.length;i++)Do(t[i]);for(var v=0;v<t.length;v++)fo(t[v]);for(var B=0;B<t.length;B++)io(t[B]);for(var Z=0;Z<t.length;Z++)po(t[Z])}function Ao(e){var t=e.cm,o=t.display;ao(t),e.updateMaxLine&&Ft(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<o.viewFrom||e.scrollToPos.to.line>=o.viewTo)||o.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ta(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Do(e){e.updatedDisplay=e.mustUpdate&&xa(e.cm,e.update)}function fo(e){var t=e.cm,o=t.display;e.updatedDisplay&&wa(t),e.barMeasure=fa(t),o.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ye(t,o.maxLine,o.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(o.scroller.clientWidth,o.sizer.offsetLeft+e.adjustWidthTo+ot(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,o.sizer.offsetLeft+e.adjustWidthTo-Ne(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=o.input.prepareSelection())}function io(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&ki(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var o=e.focus&&e.focus==F();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,o),(e.updatedDisplay||e.startHeight!=t.doc.height)&&ma(t,e.barMeasure),e.updatedDisplay&&Qr(t,e.barMeasure),e.selectionChanged&&xi(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),o&&Ma(e.cm)}function po(e){var t=e.cm,o=t.display,i=t.doc;if(e.updatedDisplay&&Ja(t,e.update),o.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(o.wheelStartX=o.wheelStartY=null),e.scrollTop!=null&&ya(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&ki(t,e.scrollLeft,!0,!0),e.scrollToPos){var v=Ro(t,A(i,e.scrollToPos.from),A(i,e.scrollToPos.to),e.scrollToPos.margin);co(t,v)}var B=e.maybeHiddenMarkers,Z=e.maybeUnhiddenMarkers;if(B)for(var ie=0;ie<B.length;++ie)B[ie].lines.length||ct(B[ie],"hide");if(Z)for(var ae=0;ae<Z.length;++ae)Z[ae].lines.length&&ct(Z[ae],"unhide");o.wrapper.offsetHeight&&(i.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&ct(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Ki(e,t){if(e.curOp)return t();ca(e);try{return t()}finally{Ea(e)}}function vi(e,t){return function(){if(e.curOp)return t.apply(e,arguments);ca(e);try{return t.apply(e,arguments)}finally{Ea(e)}}}function Ai(e){return function(){if(this.curOp)return e.apply(this,arguments);ca(this);try{return e.apply(this,arguments)}finally{Ea(this)}}}function _i(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);ca(t);try{return e.apply(this,arguments)}finally{Ea(t)}}}function Na(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,M(mo,e))}function mo(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var o=+new Date+e.options.workTime,i=gn(e,t.highlightFrontier),v=[];t.iter(i.line,Math.min(t.first+t.size,e.display.viewTo+500),function(B){if(i.line>=e.display.viewFrom){var Z=B.styles,ie=B.text.length>e.options.maxHighlightLength?ln(t.mode,i.state):null,ae=Je(e,B,i,!0);ie&&(i.state=ie),B.styles=ae.styles;var he=B.styleClasses,Xe=ae.classes;Xe?B.styleClasses=Xe:he&&(B.styleClasses=null);for(var nt=!Z||Z.length!=B.styles.length||he!=Xe&&(!he||!Xe||he.bgClass!=Xe.bgClass||he.textClass!=Xe.textClass),xt=0;!nt&&xt<Z.length;++xt)nt=Z[xt]!=B.styles[xt];nt&&v.push(i.line),B.stateAfter=i.save(),i.nextLine()}else B.text.length<=e.options.maxHighlightLength&&Bn(e,B.text,i),B.stateAfter=i.line%5==0?i.save():null,i.nextLine();if(+new Date>o)return Na(e,e.options.workDelay),!0}),t.highlightFrontier=i.line,t.modeFrontier=Math.max(t.modeFrontier,i.line),v.length&&Ki(e,function(){for(var B=0;B<v.length;B++)En(e,v[B],"text")})}var ta=function(e,t,o){var i=e.display;this.viewport=t,this.visible=ka(i,e.doc,t),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.wrapperWidth=i.wrapper.clientWidth,this.oldDisplayWidth=Ne(e),this.force=o,this.dims=nr(e),this.events=[]};ta.prototype.signal=function(e,t){Se(e,t)&&this.events.push(arguments)},ta.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ct.apply(null,this.events[e])};function ao(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=ot(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=ot(e)+"px",t.scrollbarsClipped=!0)}function oo(e){if(e.hasFocus())return null;var t=F();if(!t||!T(e.display.lineDiv,t))return null;var o={activeElt:t};if(window.getSelection){var i=window.getSelection();i.anchorNode&&i.extend&&T(e.display.lineDiv,i.anchorNode)&&(o.anchorNode=i.anchorNode,o.anchorOffset=i.anchorOffset,o.focusNode=i.focusNode,o.focusOffset=i.focusOffset)}return o}function so(e){if(!e||!e.activeElt||e.activeElt==F())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&T(document.body,e.anchorNode)&&T(document.body,e.focusNode)){var t=window.getSelection(),o=document.createRange();o.setEnd(e.anchorNode,e.anchorOffset),o.collapse(!1),t.removeAllRanges(),t.addRange(o),t.extend(e.focusNode,e.focusOffset)}}function xa(e,t){var o=e.display,i=e.doc;if(t.editorIsHidden)return yn(e),!1;if(!t.force&&t.visible.from>=o.viewFrom&&t.visible.to<=o.viewTo&&(o.updateLineNumbers==null||o.updateLineNumbers>=o.viewTo)&&o.renderedView==o.view&&or(e)==0)return!1;di(e)&&(yn(e),t.dims=nr(e));var v=i.first+i.size,B=Math.max(t.visible.from-e.options.viewportMargin,i.first),Z=Math.min(v,t.visible.to+e.options.viewportMargin);o.viewFrom<B&&B-o.viewFrom<20&&(B=Math.max(i.first,o.viewFrom)),o.viewTo>Z&&o.viewTo-Z<20&&(Z=Math.min(v,o.viewTo)),ai&&(B=Fe(e.doc,B),Z=At(e.doc,Z));var ie=B!=o.viewFrom||Z!=o.viewTo||o.lastWrapHeight!=t.wrapperHeight||o.lastWrapWidth!=t.wrapperWidth;Br(e,B,Z),o.viewOffset=On(dn(e.doc,o.viewFrom)),e.display.mover.style.top=o.viewOffset+"px";var ae=or(e);if(!ie&&ae==0&&!t.force&&o.renderedView==o.view&&(o.updateLineNumbers==null||o.updateLineNumbers>=o.viewTo))return!1;var he=oo(e);return ae>4&&(o.lineDiv.style.display="none"),go(e,o.updateLineNumbers,t.dims),ae>4&&(o.lineDiv.style.display=""),o.renderedView=o.view,so(he),_(o.cursorDiv),_(o.selectionDiv),o.gutters.style.height=o.sizer.style.minHeight=0,ie&&(o.lastWrapHeight=t.wrapperHeight,o.lastWrapWidth=t.wrapperWidth,Na(e,400)),o.updateLineNumbers=null,!0}function Ja(e,t){for(var o=t.viewport,i=!0;;i=!1){if(!i||!e.options.lineWrapping||t.oldDisplayWidth==Ne(e)){if(o&&o.top!=null&&(o={top:Math.min(e.doc.height+Re(e.display)-le(e),o.top)}),t.visible=ka(e.display,e.doc,o),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else i&&(t.visible=ka(e.display,e.doc,o));if(!xa(e,t))break;wa(e);var v=fa(e);Lr(e),ma(e,v),Qr(e,v),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Ua(e,t){var o=new ta(e,t);if(xa(e,o)){wa(e),Ja(e,o);var i=fa(e);Lr(e),ma(e,i),Qr(e,i),o.finish()}}function go(e,t,o){var i=e.display,v=e.options.lineNumbers,B=i.lineDiv,Z=B.firstChild;function ie(Yt){var cn=Yt.nextSibling;return I&&u&&e.display.currentWheelTarget==Yt?Yt.style.display="none":Yt.parentNode.removeChild(Yt),cn}for(var ae=i.view,he=i.viewFrom,Xe=0;Xe<ae.length;Xe++){var nt=ae[Xe];if(!nt.hidden)if(!nt.node||nt.node.parentNode!=B){var xt=Tr(e,nt,he,o);B.insertBefore(xt,Z)}else{for(;Z!=nt.node;)Z=ie(Z);var yt=v&&t!=null&&t<=he&&nt.lineNumber;nt.changes&&(te(nt.changes,"gutter")>-1&&(yt=!1),bn(e,nt,he,o)),yt&&(_(nt.lineNumber),nt.lineNumber.appendChild(document.createTextNode(hi(e.options,he)))),Z=nt.node.nextSibling}he+=nt.size}for(;Z;)Z=ie(Z)}function Za(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Qr(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+ot(e)+"px"}function Mr(e){var t=e.display,o=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var i=li(t)-t.scroller.scrollLeft+e.doc.scrollLeft,v=t.gutters.offsetWidth,B=i+"px",Z=0;Z<o.length;Z++)if(!o[Z].hidden){e.options.fixedGutter&&(o[Z].gutter&&(o[Z].gutter.style.left=B),o[Z].gutterBackground&&(o[Z].gutterBackground.style.left=B));var ie=o[Z].alignable;if(ie)for(var ae=0;ae<ie.length;ae++)ie[ae].style.left=B}e.options.fixedGutter&&(t.gutters.style.left=i+v+"px")}function di(e){if(!e.options.lineNumbers)return!1;var t=e.doc,o=hi(e.options,t.first+t.size-1),i=e.display;if(o.length!=i.lineNumChars){var v=i.measure.appendChild(d("div",[d("div",o)],"CodeMirror-linenumber CodeMirror-gutter-elt")),B=v.firstChild.offsetWidth,Z=v.offsetWidth-B;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(B,i.lineGutter.offsetWidth-Z)+1,i.lineNumWidth=i.lineNumInnerWidth+Z,i.lineNumChars=i.lineNumInnerWidth?o.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",Za(e.display),!0}return!1}function Bi(e,t){for(var o=[],i=!1,v=0;v<e.length;v++){var B=e[v],Z=null;if(typeof B!="string"&&(Z=B.style,B=B.className),B=="CodeMirror-linenumbers")if(t)i=!0;else continue;o.push({className:B,style:Z})}return t&&!i&&o.push({className:"CodeMirror-linenumbers",style:null}),o}function Pa(e){var t=e.gutters,o=e.gutterSpecs;_(t),e.lineGutter=null;for(var i=0;i<o.length;++i){var v=o[i],B=v.className,Z=v.style,ie=t.appendChild(d("div",null,"CodeMirror-gutter "+B));Z&&(ie.style.cssText=Z),B=="CodeMirror-linenumbers"&&(e.lineGutter=ie,ie.style.width=(e.lineNumWidth||1)+"px")}t.style.display=o.length?"":"none",Za(e)}function da(e){Pa(e.display),Xr(e),Mr(e)}function ja(e,t,o,i){var v=this;this.input=o,v.scrollbarFiller=d("div",null,"CodeMirror-scrollbar-filler"),v.scrollbarFiller.setAttribute("cm-not-content","true"),v.gutterFiller=d("div",null,"CodeMirror-gutter-filler"),v.gutterFiller.setAttribute("cm-not-content","true"),v.lineDiv=g("div",null,"CodeMirror-code"),v.selectionDiv=d("div",null,null,"position: relative; z-index: 1"),v.cursorDiv=d("div",null,"CodeMirror-cursors"),v.measure=d("div",null,"CodeMirror-measure"),v.lineMeasure=d("div",null,"CodeMirror-measure"),v.lineSpace=g("div",[v.measure,v.lineMeasure,v.selectionDiv,v.cursorDiv,v.lineDiv],null,"position: relative; outline: none");var B=g("div",[v.lineSpace],"CodeMirror-lines");v.mover=d("div",[B],null,"position: relative"),v.sizer=d("div",[v.mover],"CodeMirror-sizer"),v.sizerWidth=null,v.heightForcer=d("div",null,null,"position: absolute; height: "+pe+"px; width: 1px;"),v.gutters=d("div",null,"CodeMirror-gutters"),v.lineGutter=null,v.scroller=d("div",[v.sizer,v.heightForcer,v.gutters],"CodeMirror-scroll"),v.scroller.setAttribute("tabIndex","-1"),v.wrapper=d("div",[v.scrollbarFiller,v.gutterFiller,v.scroller],"CodeMirror"),H&&O<8&&(v.gutters.style.zIndex=-1,v.scroller.style.paddingRight=0),!I&&!(j&&s)&&(v.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(v.wrapper):e(v.wrapper)),v.viewFrom=v.viewTo=t.first,v.reportedViewFrom=v.reportedViewTo=t.first,v.view=[],v.renderedView=null,v.externalMeasured=null,v.viewOffset=0,v.lastWrapHeight=v.lastWrapWidth=0,v.updateLineNumbers=null,v.nativeBarWidth=v.barHeight=v.barWidth=0,v.scrollbarsClipped=!1,v.lineNumWidth=v.lineNumInnerWidth=v.lineNumChars=null,v.alignWidgets=!1,v.cachedCharWidth=v.cachedTextHeight=v.cachedPaddingH=null,v.maxLine=null,v.maxLineLength=0,v.maxLineChanged=!1,v.wheelDX=v.wheelDY=v.wheelStartX=v.wheelStartY=null,v.shift=!1,v.selForContextMenu=null,v.activeTouch=null,v.gutterSpecs=Bi(i.gutters,i.lineNumbers),Pa(v),o.init(v)}var ha=0,Ci=null;H?Ci=-.53:j?Ci=15:p?Ci=-.7:h&&(Ci=-1/3);function Fa(e){var t=e.wheelDeltaX,o=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),o==null&&e.detail&&e.axis==e.VERTICAL_AXIS?o=e.detail:o==null&&(o=e.wheelDelta),{x:t,y:o}}function Ba(e){var t=Fa(e);return t.x*=Ci,t.y*=Ci,t}function Ha(e,t){var o=Fa(t),i=o.x,v=o.y,B=e.display,Z=B.scroller,ie=Z.scrollWidth>Z.clientWidth,ae=Z.scrollHeight>Z.clientHeight;if(!(i&&ie||v&&ae))return;if(v&&u&&I){e:for(var he=t.target,Xe=B.view;he!=Z;he=he.parentNode)for(var nt=0;nt<Xe.length;nt++)if(Xe[nt].node==he){e.display.currentWheelTarget=he;break e}}if(i&&!j&&!m&&Ci!=null){v&&ae&&Da(e,Math.max(0,Z.scrollTop+v*Ci)),ki(e,Math.max(0,Z.scrollLeft+i*Ci)),(!v||v&&ae)&&ce(t),B.wheelStartX=null;return}if(v&&Ci!=null){var xt=v*Ci,yt=e.doc.scrollTop,Yt=yt+B.wrapper.clientHeight;xt<0?yt=Math.max(0,yt+xt-50):Yt=Math.min(e.doc.height,Yt+xt+50),Ua(e,{top:yt,bottom:Yt})}ha<20&&(B.wheelStartX==null?(B.wheelStartX=Z.scrollLeft,B.wheelStartY=Z.scrollTop,B.wheelDX=i,B.wheelDY=v,setTimeout(function(){if(B.wheelStartX==null)return;var cn=Z.scrollLeft-B.wheelStartX,Cn=Z.scrollTop-B.wheelStartY,Ln=Cn&&B.wheelDY&&Cn/B.wheelDY||cn&&B.wheelDX&&cn/B.wheelDX;if(B.wheelStartX=B.wheelStartY=null,!Ln)return;Ci=(Ci*ha+Ln)/(ha+1),++ha},200)):(B.wheelDX+=i,B.wheelDY+=v))}var zi=function(e,t){this.ranges=e,this.primIndex=t};zi.prototype.primary=function(){return this.ranges[this.primIndex]},zi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var o=this.ranges[t],i=e.ranges[t];if(!fi(o.anchor,i.anchor)||!fi(o.head,i.head))return!1}return!0},zi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new zr(Ei(this.ranges[t].anchor),Ei(this.ranges[t].head));return new zi(e,this.primIndex)},zi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},zi.prototype.contains=function(e,t){t||(t=e);for(var o=0;o<this.ranges.length;o++){var i=this.ranges[o];if(Xn(t,i.from())>=0&&Xn(e,i.to())<=0)return o}return-1};var zr=function(e,t){this.anchor=e,this.head=t};zr.prototype.from=function(){return ii(this.anchor,this.head)},zr.prototype.to=function(){return ri(this.anchor,this.head)},zr.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function _r(e,t,o){var i=e&&e.options.selectionsMayTouch,v=t[o];t.sort(function(xt,yt){return Xn(xt.from(),yt.from())}),o=te(t,v);for(var B=1;B<t.length;B++){var Z=t[B],ie=t[B-1],ae=Xn(ie.to(),Z.from());if(i&&!Z.empty()?ae>0:ae>=0){var he=ii(ie.from(),Z.from()),Xe=ri(ie.to(),Z.to()),nt=ie.empty()?Z.from()==Z.head:ie.from()==ie.head;B<=o&&--o,t.splice(--B,2,new zr(nt?Xe:he,nt?he:Xe))}}return new zi(t,o)}function kn(e,t){return new zi([new zr(e,t||e)],0)}function Jn(e){return e.text?an(e.from.line+e.text.length-1,se(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Dr(e,t){if(Xn(e,t.from)<0)return e;if(Xn(e,t.to)<=0)return Jn(t);var o=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=Jn(t).ch-t.to.ch),an(o,i)}function ui(e,t){for(var o=[],i=0;i<e.sel.ranges.length;i++){var v=e.sel.ranges[i];o.push(new zr(Dr(v.anchor,t),Dr(v.head,t)))}return _r(e.cm,o,e.sel.primIndex)}function ga(e,t,o){return e.line==t.line?an(o.line,e.ch-t.ch+o.ch):an(o.line+(e.line-t.line),e.ch)}function oa(e,t,o){for(var i=[],v=an(e.first,0),B=v,Z=0;Z<t.length;Z++){var ie=t[Z],ae=ga(ie.from,v,B),he=ga(Jn(ie),v,B);if(v=ie.to,B=he,o=="around"){var Xe=e.sel.ranges[Z],nt=Xn(Xe.head,Xe.anchor)<0;i[Z]=new zr(nt?he:ae,nt?ae:he)}else i[Z]=new zr(ae,ae)}return new zi(i,e.sel.primIndex)}function Di(e){e.doc.mode=tt(e.options,e.doc.modeOption),Zi(e)}function Zi(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Na(e,100),e.state.modeGen++,e.curOp&&Xr(e)}function va(e,t){return t.from.ch==0&&t.to.ch==0&&se(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Wa(e,t,o,i){function v(Hn){return o?o[Hn]:null}function B(Hn,Mn,Yn){Fn(Hn,Mn,Yn,i),qt(Hn,"change",Hn,t)}function Z(Hn,Mn){for(var Yn=[],vr=Hn;vr<Mn;++vr)Yn.push(new $t(he[vr],v(vr),i));return Yn}var ie=t.from,ae=t.to,he=t.text,Xe=dn(e,ie.line),nt=dn(e,ae.line),xt=se(he),yt=v(he.length-1),Yt=ae.line-ie.line;if(t.full)e.insert(0,Z(0,he.length)),e.remove(he.length,e.size-he.length);else if(va(e,t)){var cn=Z(0,he.length-1);B(nt,nt.text,yt),Yt&&e.remove(ie.line,Yt),cn.length&&e.insert(ie.line,cn)}else if(Xe==nt)if(he.length==1)B(Xe,Xe.text.slice(0,ie.ch)+xt+Xe.text.slice(ae.ch),yt);else{var Cn=Z(1,he.length-1);Cn.push(new $t(xt+Xe.text.slice(ae.ch),yt,i)),B(Xe,Xe.text.slice(0,ie.ch)+he[0],v(0)),e.insert(ie.line+1,Cn)}else if(he.length==1)B(Xe,Xe.text.slice(0,ie.ch)+he[0]+nt.text.slice(ae.ch),v(0)),e.remove(ie.line+1,Yt);else{B(Xe,Xe.text.slice(0,ie.ch)+he[0],v(0)),B(nt,xt+nt.text.slice(ae.ch),yt);var Ln=Z(1,he.length-1);Yt>1&&e.remove(ie.line+1,Yt-1),e.insert(ie.line+1,Ln)}qt(e,"change",e,t)}function Oi(e,t,o){function i(v,B,Z){if(v.linked)for(var ie=0;ie<v.linked.length;++ie){var ae=v.linked[ie];if(ae.doc==B)continue;var he=Z&&ae.sharedHist;if(o&&!he)continue;t(ae.doc,he),i(ae.doc,v,he)}}i(e,null,!0)}function vs(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,wi(e),Di(e),_s(e),e.options.lineWrapping||Ft(e),e.options.mode=t.modeOption,Xr(e)}function _s(e){(e.doc.direction=="rtl"?U:b)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Ki(e,function(){_s(e),Xr(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,t){var o={from:Ei(t.from),to:Jn(t),text:fr(e,t.from,t.to)};return Es(e,o,t.from.line,t.to.line+1),Oi(e,function(i){return Es(i,o,t.from.line,t.to.line+1)},!0),o}function ys(e){for(;e.length;){var t=se(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return ys(e.done),se(e.done);if(e.done.length&&!se(e.done).ranges)return se(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),se(e.done)}function bs(e,t,o,i){var v=e.history;v.undone.length=0;var B=+new Date,Z,ie;if((v.lastOp==i||v.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&v.lastModTime>B-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(Z=pl(v,v.lastOp==i)))ie=se(Z.changes),Xn(t.from,t.to)==0&&Xn(t.from,ie.to)==0?ie.to=Jn(t):Z.changes.push(rs(e,t));else{var ae=se(v.done);for((!ae||!ae.ranges)&&Go(e.sel,v.done),Z={changes:[rs(e,t)],generation:v.generation},v.done.push(Z);v.done.length>v.undoDepth;)v.done.shift(),v.done[0].ranges||v.done.shift()}v.done.push(o),v.generation=++v.maxGeneration,v.lastModTime=v.lastSelTime=B,v.lastOp=v.lastSelOp=i,v.lastOrigin=v.lastSelOrigin=t.origin,ie||ct(e,"historyAdded")}function ml(e,t,o,i){var v=t.charAt(0);return v=="*"||v=="+"&&o.ranges.length==i.ranges.length&&o.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,o,i){var v=e.history,B=i&&i.origin;o==v.lastSelOp||B&&v.lastSelOrigin==B&&(v.lastModTime==v.lastSelTime&&v.lastOrigin==B||ml(e,B,se(v.done),t))?v.done[v.done.length-1]=t:Go(t,v.done),v.lastSelTime=+new Date,v.lastSelOrigin=B,v.lastSelOp=o,i&&i.clearRedo!==!1&&ys(v.undone)}function Go(e,t){var o=se(t);o&&o.ranges&&o.equals(e)||t.push(e)}function Es(e,t,o,i){var v=t["spans_"+e.id],B=0;e.iter(Math.max(e.first,o),Math.min(e.first+e.size,i),function(Z){Z.markedSpans&&((v||(v=t["spans_"+e.id]={}))[B]=Z.markedSpans),++B})}function vl(e){if(!e)return null;for(var t,o=0;o<e.length;++o)e[o].marker.explicitlyCleared?t||(t=e.slice(0,o)):t&&t.push(e[o]);return t?t.length?t:null:e}function _l(e,t){var o=t["spans_"+e.id];if(!o)return null;for(var i=[],v=0;v<t.text.length;++v)i.push(vl(o[v]));return i}function xs(e,t){var o=_l(e,t),i=Nn(e,t);if(!o)return i;if(!i)return o;for(var v=0;v<o.length;++v){var B=o[v],Z=i[v];if(B&&Z){e:for(var ie=0;ie<Z.length;++ie){for(var ae=Z[ie],he=0;he<B.length;++he)if(B[he].marker==ae.marker)continue e;B.push(ae)}}else Z&&(o[v]=Z)}return o}function vo(e,t,o){for(var i=[],v=0;v<e.length;++v){var B=e[v];if(B.ranges){i.push(o?zi.prototype.deepCopy.call(B):B);continue}var Z=B.changes,ie=[];i.push({changes:ie});for(var ae=0;ae<Z.length;++ae){var he=Z[ae],Xe=void 0;if(ie.push({from:he.from,to:he.to,text:he.text}),t)for(var nt in he)(Xe=nt.match(/^spans_(\d+)$/))&&(te(t,Number(Xe[1]))>-1&&(se(ie)[nt]=he[nt],delete he[nt]))}}return i}function is(e,t,o,i){if(i){var v=e.anchor;if(o){var B=Xn(t,v)<0;B!=Xn(o,v)<0?(v=t,t=o):B!=Xn(t,o)<0&&(t=o)}return new zr(v,t)}else return new zr(o||t,t)}function Vo(e,t,o,i,v){v==null&&(v=e.cm&&(e.cm.display.shift||e.extend)),Xi(e,new zi([is(e.sel.primary(),t,o,v)],0),i)}function Cs(e,t,o){for(var i=[],v=e.cm&&(e.cm.display.shift||e.extend),B=0;B<e.sel.ranges.length;B++)i[B]=is(e.sel.ranges[B],t[B],null,v);var Z=_r(e.cm,i,e.sel.primIndex);Xi(e,Z,o)}function as(e,t,o,i){var v=e.sel.ranges.slice(0);v[t]=o,Xi(e,_r(e.cm,v,e.sel.primIndex),i)}function Ts(e,t,o,i){Xi(e,kn(t,o),i)}function yl(e,t,o){var i={ranges:t.ranges,update:function(v){this.ranges=[];for(var B=0;B<v.length;B++)this.ranges[B]=new zr(A(e,v[B].anchor),A(e,v[B].head))},origin:o&&o.origin};return ct(e,"beforeSelectionChange",e,i),e.cm&&ct(e.cm,"beforeSelectionChange",e.cm,i),i.ranges!=t.ranges?_r(e.cm,i.ranges,i.ranges.length-1):t}function ws(e,t,o){var i=e.history.done,v=se(i);v&&v.ranges?(i[i.length-1]=t,Yo(e,t,o)):Xi(e,t,o)}function Xi(e,t,o){Yo(e,t,o),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,o)}function Yo(e,t,o){(Se(e,"beforeSelectionChange")||e.cm&&Se(e.cm,"beforeSelectionChange"))&&(t=yl(e,t,o));var i=o&&o.bias||(Xn(t.primary().head,e.sel.primary().head)<0?-1:1);Os(e,Rs(e,t,i,!0)),!(o&&o.scroll===!1)&&e.cm&&_a(e.cm)}function Os(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Ve(e.cm)),qt(e,"cursorActivity",e)}function Ss(e){Os(e,Rs(e,e.sel,null,!1))}function Rs(e,t,o,i){for(var v,B=0;B<t.ranges.length;B++){var Z=t.ranges[B],ie=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[B],ae=Xo(e,Z.anchor,ie&&ie.anchor,o,i),he=Xo(e,Z.head,ie&&ie.head,o,i);(v||ae!=Z.anchor||he!=Z.head)&&(v||(v=t.ranges.slice(0,B)),v[B]=new zr(ae,he))}return v?_r(e.cm,v,t.primIndex):t}function _o(e,t,o,i,v){var B=dn(e,t.line);if(B.markedSpans)for(var Z=0;Z<B.markedSpans.length;++Z){var ie=B.markedSpans[Z],ae=ie.marker,he="selectLeft"in ae?!ae.selectLeft:ae.inclusiveLeft,Xe="selectRight"in ae?!ae.selectRight:ae.inclusiveRight;if((ie.from==null||(he?ie.from<=t.ch:ie.from<t.ch))&&(ie.to==null||(Xe?ie.to>=t.ch:ie.to>t.ch))){if(v&&(ct(ae,"beforeCursorEnter"),ae.explicitlyCleared))if(B.markedSpans){--Z;continue}else break;if(!ae.atomic)continue;if(o){var nt=ae.find(i<0?1:-1),xt=void 0;if((i<0?Xe:he)&&(nt=As(e,nt,-i,nt&&nt.line==t.line?B:null)),nt&&nt.line==t.line&&(xt=Xn(nt,o))&&(i<0?xt<0:xt>0))return _o(e,nt,t,i,v)}var yt=ae.find(i<0?-1:1);return(i<0?he:Xe)&&(yt=As(e,yt,i,yt.line==t.line?B:null)),yt?_o(e,yt,t,i,v):null}}return t}function Xo(e,t,o,i,v){var B=i||1,Z=_o(e,t,o,B,v)||!v&&_o(e,t,o,B,!0)||_o(e,t,o,-B,v)||!v&&_o(e,t,o,-B,!0);return Z||(e.cantEdit=!0,an(e.first,0))}function As(e,t,o,i){return o<0&&t.ch==0?t.line>e.first?A(e,an(t.line-1)):null:o>0&&t.ch==(i||dn(e,t.line)).text.length?t.line<e.first+e.size-1?an(t.line+1,0):null:new an(t.line,t.ch+o)}function Ds(e){e.setSelection(an(e.firstLine(),0),an(e.lastLine()),Ee)}function Ps(e,t,o){var i={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return i.canceled=!0}};return o&&(i.update=function(v,B,Z,ie){v&&(i.from=A(e,v)),B&&(i.to=A(e,B)),Z&&(i.text=Z),ie!==void 0&&(i.origin=ie)}),ct(e,"beforeChange",e,i),e.cm&&ct(e.cm,"beforeChange",e.cm,i),i.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:i.from,to:i.to,text:i.text,origin:i.origin}}function yo(e,t,o){if(e.cm){if(!e.cm.curOp)return vi(e.cm,yo)(e,t,o);if(e.cm.state.suppressEdits)return}if((Se(e,"beforeChange")||e.cm&&Se(e.cm,"beforeChange"))&&(t=Ps(e,t,!0),!t))return;var i=Qi&&!o&&ve(e,t.from,t.to);if(i)for(var v=i.length-1;v>=0;--v)Ls(e,{from:i[v].from,to:i[v].to,text:v?[""]:t.text,origin:t.origin});else Ls(e,t)}function Ls(e,t){if(t.text.length==1&&t.text[0]==""&&Xn(t.from,t.to)==0)return;var o=ui(e,t);bs(e,t,o,e.cm?e.cm.curOp.id:NaN),Po(e,t,o,Nn(e,t));var i=[];Oi(e,function(v,B){!B&&te(i,v.history)==-1&&(Ns(v.history,t),i.push(v.history)),Po(v,t,null,Nn(v,t))})}function $o(e,t,o){var i=e.cm&&e.cm.state.suppressEdits;if(i&&!o)return;for(var v=e.history,B,Z=e.sel,ie=t=="undo"?v.done:v.undone,ae=t=="undo"?v.undone:v.done,he=0;he<ie.length&&!(B=ie[he],o?B.ranges&&!B.equals(e.sel):!B.ranges);he++);if(he==ie.length)return;for(v.lastOrigin=v.lastSelOrigin=null;;)if(B=ie.pop(),B.ranges){if(Go(B,ae),o&&!B.equals(e.sel)){Xi(e,B,{clearRedo:!1});return}Z=B}else if(i){ie.push(B);return}else break;var Xe=[];Go(Z,ae),ae.push({changes:Xe,generation:v.generation}),v.generation=B.generation||++v.maxGeneration;for(var nt=Se(e,"beforeChange")||e.cm&&Se(e.cm,"beforeChange"),xt=function(cn){var Cn=B.changes[cn];if(Cn.origin=t,nt&&!Ps(e,Cn,!1))return ie.length=0,{};Xe.push(rs(e,Cn));var Ln=cn?ui(e,Cn):se(ie);Po(e,Cn,Ln,xs(e,Cn)),!cn&&e.cm&&e.cm.scrollIntoView({from:Cn.from,to:Jn(Cn)});var Hn=[];Oi(e,function(Mn,Yn){!Yn&&te(Hn,Mn.history)==-1&&(Ns(Mn.history,Cn),Hn.push(Mn.history)),Po(Mn,Cn,null,xs(Mn,Cn))})},yt=B.changes.length-1;yt>=0;--yt){var Yt=xt(yt);if(Yt)return Yt.v}}function Ms(e,t){if(t==0)return;if(e.first+=t,e.sel=new zi(we(e.sel.ranges,function(v){return new zr(an(v.anchor.line+t,v.anchor.ch),an(v.head.line+t,v.head.ch))}),e.sel.primIndex),e.cm){Xr(e.cm,e.first,e.first-t,t);for(var o=e.cm.display,i=o.viewFrom;i<o.viewTo;i++)En(e.cm,i,"gutter")}}function Po(e,t,o,i){if(e.cm&&!e.cm.curOp)return vi(e.cm,Po)(e,t,o,i);if(t.to.line<e.first){Ms(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var v=t.text.length-1-(e.first-t.from.line);Ms(e,v),t={from:an(e.first,0),to:an(t.to.line+v,t.to.ch),text:[se(t.text)],origin:t.origin}}var B=e.lastLine();t.to.line>B&&(t={from:t.from,to:an(B,dn(e,B).text.length),text:[t.text[0]],origin:t.origin}),t.removed=fr(e,t.from,t.to),o||(o=ui(e,t)),e.cm?bl(e.cm,t,i):Wa(e,t,i),Yo(e,o,Ee),e.cantEdit&&Xo(e,an(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,o){var i=e.doc,v=e.display,B=t.from,Z=t.to,ie=!1,ae=B.line;e.options.lineWrapping||(ae=rr(_t(dn(i,B.line))),i.iter(ae,Z.line+1,function(yt){if(yt==v.maxLine)return ie=!0,!0})),i.sel.contains(t.from,t.to)>-1&&Ve(e),Wa(i,t,o,Yi(e)),e.options.lineWrapping||(i.iter(ae,B.line+t.text.length,function(yt){var Yt=In(yt);Yt>v.maxLineLength&&(v.maxLine=yt,v.maxLineLength=Yt,v.maxLineChanged=!0,ie=!1)}),ie&&(e.curOp.updateMaxLine=!0)),Ni(i,B.line),Na(e,400);var he=t.text.length-(Z.line-B.line)-1;t.full?Xr(e):B.line==Z.line&&t.text.length==1&&!va(e.doc,t)?En(e,B.line,"text"):Xr(e,B.line,Z.line+1,he);var Xe=Se(e,"changes"),nt=Se(e,"change");if(nt||Xe){var xt={from:B,to:Z,text:t.text,removed:t.removed,origin:t.origin};nt&&qt(e,"change",e,xt),Xe&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(xt)}e.display.selForContextMenu=null}function bo(e,t,o,i,v){var B;i||(i=o),Xn(i,o)<0&&(B=[i,o],o=B[0],i=B[1]),typeof t=="string"&&(t=e.splitLines(t)),yo(e,{from:o,to:i,text:t,origin:v})}function ks(e,t,o,i){o<e.line?e.line+=i:t<e.line&&(e.line=t,e.ch=0)}function Is(e,t,o,i){for(var v=0;v<e.length;++v){var B=e[v],Z=!0;if(B.ranges){B.copied||(B=e[v]=B.deepCopy(),B.copied=!0);for(var ie=0;ie<B.ranges.length;ie++)ks(B.ranges[ie].anchor,t,o,i),ks(B.ranges[ie].head,t,o,i);continue}for(var ae=0;ae<B.changes.length;++ae){var he=B.changes[ae];if(o<he.from.line)he.from=an(he.from.line+i,he.from.ch),he.to=an(he.to.line+i,he.to.ch);else if(t<=he.to.line){Z=!1;break}}Z||(e.splice(0,v+1),v=0)}}function Ns(e,t){var o=t.from.line,i=t.to.line,v=t.text.length-(i-o)-1;Is(e.done,o,i,v),Is(e.undone,o,i,v)}function Lo(e,t,o,i){var v=t,B=t;return typeof t=="number"?B=dn(e,ee(e,t)):v=rr(t),v==null?null:(i(B,v)&&e.cm&&En(e.cm,v,o),B)}function Mo(e){this.lines=e,this.parent=null;for(var t=0,o=0;o<e.length;++o)e[o].parent=this,t+=e[o].height;this.height=t}Mo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var o=e,i=e+t;o<i;++o){var v=this.lines[o];this.height-=v.height,Oe(v),qt(v,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,o){this.height+=o,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=this},iterN:function(e,t,o){for(var i=e+t;e<i;++e)if(o(this.lines[e]))return!0}};function ko(e){this.children=e;for(var t=0,o=0,i=0;i<e.length;++i){var v=e[i];t+=v.chunkSize(),o+=v.height,v.parent=this}this.size=t,this.height=o,this.parent=null}ko.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var o=0;o<this.children.length;++o){var i=this.children[o],v=i.chunkSize();if(e<v){var B=Math.min(t,v-e),Z=i.height;if(i.removeInner(e,B),this.height-=Z-i.height,v==B&&(this.children.splice(o--,1),i.parent=null),(t-=B)==0)break;e=0}else e-=v}if(this.size-t<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 t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,o){this.size+=t.length,this.height+=o;for(var i=0;i<this.children.length;++i){var v=this.children[i],B=v.chunkSize();if(e<=B){if(v.insertInner(e,t,o),v.lines&&v.lines.length>50){for(var Z=v.lines.length%25+25,ie=Z;ie<v.lines.length;){var ae=new Mo(v.lines.slice(ie,ie+=25));v.height-=ae.height,this.children.splice(++i,0,ae),ae.parent=this}v.lines=v.lines.slice(0,Z),this.maybeSpill()}break}e-=B}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),o=new ko(t);if(e.parent){e.size-=o.size,e.height-=o.height;var v=te(e.parent.children,e);e.parent.children.splice(v+1,0,o)}else{var i=new ko(e.children);i.parent=e,e.children=[i,o],e=i}o.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,o){for(var i=0;i<this.children.length;++i){var v=this.children[i],B=v.chunkSize();if(e<B){var Z=Math.min(t,B-e);if(v.iterN(e,Z,o))return!0;if((t-=Z)==0)break;e=0}else e-=B}}};var Io=function(e,t,o){if(o)for(var i in o)o.hasOwnProperty(i)&&(this[i]=o[i]);this.doc=e,this.node=t};Io.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,o=this.line,i=rr(o);if(i==null||!t)return;for(var v=0;v<t.length;++v)t[v]==this&&t.splice(v--,1);t.length||(o.widgets=null);var B=Cr(this);tr(o,Math.max(0,o.height-B)),e&&(Ki(e,function(){Us(e,o,-B),En(e,i,"widget")}),qt(e,"lineWidgetCleared",e,this,i))},Io.prototype.changed=function(){var e=this,t=this.height,o=this.doc.cm,i=this.line;this.height=null;var v=Cr(this)-t;if(!v)return;Zt(this.doc,i)||tr(i,i.height+v),o&&Ki(o,function(){o.curOp.forceUpdate=!0,Us(o,i,v),qt(o,"lineWidgetChanged",o,e,rr(i))})},Pe(Io);function Us(e,t,o){On(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Va(e,o)}function El(e,t,o,i){var v=new Io(e,o,i),B=e.cm;return B&&v.noHScroll&&(B.display.alignWidgets=!0),Lo(e,t,"widget",function(Z){var ie=Z.widgets||(Z.widgets=[]);if(v.insertAt==null?ie.push(v):ie.splice(Math.min(ie.length-1,Math.max(0,v.insertAt)),0,v),v.line=Z,B&&!Zt(e,Z)){var ae=On(Z)<e.scrollTop;tr(Z,Z.height+Cr(v)),ae&&Va(B,v.height),B.curOp.forceUpdate=!0}return!0}),B&&qt(B,"lineWidgetAdded",B,v,typeof t=="number"?t:rr(t)),v}var js=0,qa=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++js};qa.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&ca(e),Se(this,"clear")){var o=this.find();o&&qt(this,"clear",o.from,o.to)}for(var i=null,v=null,B=0;B<this.lines.length;++B){var Z=this.lines[B],ie=pi(Z.markedSpans,this);e&&!this.collapsed?En(e,rr(Z),"text"):e&&(ie.to!=null&&(v=rr(Z)),ie.from!=null&&(i=rr(Z))),Z.markedSpans=Ji(Z.markedSpans,ie),ie.from==null&&this.collapsed&&!Zt(this.doc,Z)&&e&&tr(Z,Ar(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var ae=0;ae<this.lines.length;++ae){var he=_t(this.lines[ae]),Xe=In(he);Xe>e.display.maxLineLength&&(e.display.maxLine=he,e.display.maxLineLength=Xe,e.display.maxLineChanged=!0)}i!=null&&e&&this.collapsed&&Xr(e,i,v+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ss(e.doc)),e&&qt(e,"markerCleared",e,this,i,v),t&&Ea(e),this.parent&&this.parent.clear()},qa.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var o,i,v=0;v<this.lines.length;++v){var B=this.lines[v],Z=pi(B.markedSpans,this);if(Z.from!=null&&(o=an(t?B:rr(B),Z.from),e==-1))return o;if(Z.to!=null&&(i=an(t?B:rr(B),Z.to),e==1))return i}return o&&{from:o,to:i}},qa.prototype.changed=function(){var e=this,t=this.find(-1,!0),o=this,i=this.doc.cm;if(!t||!i)return;Ki(i,function(){var v=t.line,B=rr(t.line),Z=dt(i,B);if(Z&&(Zn(Z),i.curOp.selectionChanged=i.curOp.forceUpdate=!0),i.curOp.updateMaxLine=!0,!Zt(o.doc,v)&&o.height!=null){var ie=o.height;o.height=null;var ae=Cr(o)-ie;ae&&tr(v,v.height+ae)}qt(i,"markerChanged",i,e)})},qa.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||te(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},qa.prototype.detachLine=function(e){if(this.lines.splice(te(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Pe(qa);function Eo(e,t,o,i,v){if(i&&i.shared)return xl(e,t,o,i,v);if(e.cm&&!e.cm.curOp)return vi(e.cm,Eo)(e,t,o,i,v);var B=new qa(e,v),Z=Xn(t,o);if(i&&y(i,B,!1),Z>0||Z==0&&B.clearWhenEmpty!==!1)return B;if(B.replacedWith&&(B.collapsed=!0,B.widgetNode=g("span",[B.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||B.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(B.widgetNode.insertLeft=!0)),B.collapsed){if(Ct(e,t.line,t,o,B)||t.line!=o.line&&Ct(e,o.line,t,o,B))throw new Error("Inserting collapsed marker partially overlapping an existing one");Vi()}B.addToHistory&&bs(e,{from:t,to:o,origin:"markText"},e.sel,NaN);var ie=t.line,ae=e.cm,he;if(e.iter(ie,o.line+1,function(nt){ae&&B.collapsed&&!ae.options.lineWrapping&&_t(nt)==ae.display.maxLine&&(he=!0),B.collapsed&&ie!=t.line&&tr(nt,0),Mi(nt,new Ui(B,ie==t.line?t.ch:null,ie==o.line?o.ch:null)),++ie}),B.collapsed&&e.iter(t.line,o.line+1,function(nt){Zt(e,nt)&&tr(nt,0)}),B.clearOnEnter&&Ze(B,"beforeCursorEnter",function(){return B.clear()}),B.readOnly&&(Ri(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),B.collapsed&&(B.id=++js,B.atomic=!0),ae){if(he&&(ae.curOp.updateMaxLine=!0),B.collapsed)Xr(ae,t.line,o.line+1);else if(B.className||B.startStyle||B.endStyle||B.css||B.attributes||B.title)for(var Xe=t.line;Xe<=o.line;Xe++)En(ae,Xe,"text");B.atomic&&Ss(ae.doc),qt(ae,"markerAdded",ae,B)}return B}var No=function(e,t){this.markers=e,this.primary=t;for(var o=0;o<e.length;++o)e[o].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();qt(this,"clear")},No.prototype.find=function(e,t){return this.primary.find(e,t)},Pe(No);function xl(e,t,o,i,v){i=y(i),i.shared=!1;var B=[Eo(e,t,o,i,v)],Z=B[0],ie=i.widgetNode;return Oi(e,function(ae){ie&&(i.widgetNode=ie.cloneNode(!0)),B.push(Eo(ae,A(ae,t),A(ae,o),i,v));for(var he=0;he<ae.linked.length;++he)if(ae.linked[he].isParent)return;Z=se(B)}),new No(B,Z)}function Fs(e){return e.findMarks(an(e.first,0),e.clipPos(an(e.lastLine())),function(t){return t.parent})}function Cl(e,t){for(var o=0;o<t.length;o++){var i=t[o],v=i.find(),B=e.clipPos(v.from),Z=e.clipPos(v.to);if(Xn(B,Z)){var ie=Eo(e,B,Z,i.primary,i.primary.type);i.markers.push(ie),ie.parent=i}}}function Tl(e){for(var t=function(i){var v=e[i],B=[v.primary.doc];Oi(v.primary.doc,function(ae){return B.push(ae)});for(var Z=0;Z<v.markers.length;Z++){var ie=v.markers[Z];te(B,ie.doc)==-1&&(ie.parent=null,v.markers.splice(Z--,1))}},o=0;o<e.length;o++)t(o)}var wl=0,na=function(e,t,o,i,v){if(!(this instanceof na))return new na(e,t,o,i,v);o==null&&(o=0),ko.call(this,[new Mo([new $t("",null)])]),this.first=o,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=o;var B=an(o,0);this.sel=kn(B),this.history=new zo(null),this.id=++wl,this.modeOption=t,this.lineSep=i,this.direction=v=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Wa(this,{from:B,to:B,text:e}),Xi(this,kn(B),Ee)};na.prototype=st(ko.prototype,{constructor:na,iter:function(e,t,o){o?this.iterN(e-this.first,t-e,o):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var o=0,i=0;i<t.length;++i)o+=t[i].height;this.insertInner(e-this.first,t,o)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Kr(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:_i(function(e){var t=an(this.first,0),o=this.first+this.size-1;yo(this,{from:t,to:an(o,dn(this,o).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Ra(this.cm,0,0),Xi(this,kn(t),Ee)}),replaceRange:function(e,t,o,i){t=A(this,t),o=o?A(this,o):t,bo(this,e,t,o,i)},getRange:function(e,t,o){var i=fr(this,A(this,e),A(this,t));return o===!1?i:i.join(o||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(oi(this,e))return dn(this,e)},getLineNumber:function(e){return rr(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=dn(this,e)),_t(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return A(this,e)},getCursor:function(e){var t=this.sel.primary(),o;return e==null||e=="head"?o=t.head:e=="anchor"?o=t.anchor:e=="end"||e=="to"||e===!1?o=t.to():o=t.from(),o},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:_i(function(e,t,o){Ts(this,A(this,typeof e=="number"?an(e,t||0):e),null,o)}),setSelection:_i(function(e,t,o){Ts(this,A(this,e),A(this,t||e),o)}),extendSelection:_i(function(e,t,o){Vo(this,A(this,e),t&&A(this,t),o)}),extendSelections:_i(function(e,t){Cs(this,V(this,e),t)}),extendSelectionsBy:_i(function(e,t){var o=we(this.sel.ranges,e);Cs(this,V(this,o),t)}),setSelections:_i(function(e,t,o){if(!e.length)return;for(var i=[],v=0;v<e.length;v++)i[v]=new zr(A(this,e[v].anchor),A(this,e[v].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Xi(this,_r(this.cm,i,t),o)}),addSelection:_i(function(e,t,o){var i=this.sel.ranges.slice(0);i.push(new zr(A(this,e),A(this,t||e))),Xi(this,_r(this.cm,i,i.length-1),o)}),getSelection:function(e){for(var t=this.sel.ranges,o,i=0;i<t.length;i++){var v=fr(this,t[i].from(),t[i].to());o=o?o.concat(v):v}return e===!1?o:o.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],o=this.sel.ranges,i=0;i<o.length;i++){var v=fr(this,o[i].from(),o[i].to());e!==!1&&(v=v.join(e||this.lineSeparator())),t[i]=v}return t},replaceSelection:function(e,t,o){for(var i=[],v=0;v<this.sel.ranges.length;v++)i[v]=e;this.replaceSelections(i,t,o||"+input")},replaceSelections:_i(function(e,t,o){for(var i=[],v=this.sel,B=0;B<v.ranges.length;B++){var Z=v.ranges[B];i[B]={from:Z.from(),to:Z.to(),text:this.splitLines(e[B]),origin:o}}for(var ie=t&&t!="end"&&oa(this,i,t),ae=i.length-1;ae>=0;ae--)yo(this,i[ae]);ie?ws(this,ie):this.cm&&_a(this.cm)}),undo:_i(function(){$o(this,"undo")}),redo:_i(function(){$o(this,"redo")}),undoSelection:_i(function(){$o(this,"undo",!0)}),redoSelection:_i(function(){$o(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,o=0,i=0;i<e.done.length;i++)e.done[i].ranges||++t;for(var v=0;v<e.undone.length;v++)e.undone[v].ranges||++o;return{undo:t,redo:o}},clearHistory:function(){var e=this;this.history=new zo(this.history.maxGeneration),Oi(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:vo(this.history.done),undone:vo(this.history.undone)}},setHistory:function(e){var t=this.history=new zo(this.history.maxGeneration);t.done=vo(e.done.slice(0),null,!0),t.undone=vo(e.undone.slice(0),null,!0)},setGutterMarker:_i(function(e,t,o){return Lo(this,e,"gutter",function(i){var v=i.gutterMarkers||(i.gutterMarkers={});return v[t]=o,!o&&me(v)&&(i.gutterMarkers=null),!0})}),clearGutter:_i(function(e){var t=this;this.iter(function(o){o.gutterMarkers&&o.gutterMarkers[e]&&Lo(t,o,"gutter",function(){return o.gutterMarkers[e]=null,me(o.gutterMarkers)&&(o.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!oi(this,e))return null;if(t=e,e=dn(this,e),!e)return null}else if(t=rr(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:_i(function(e,t,o){return Lo(this,e,t=="gutter"?"gutter":"class",function(i){var v=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!i[v])i[v]=o;else{if(S(o).test(i[v]))return!1;i[v]+=" "+o}return!0})}),removeLineClass:_i(function(e,t,o){return Lo(this,e,t=="gutter"?"gutter":"class",function(i){var v=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",B=i[v];if(B)if(o==null)i[v]=null;else{var Z=B.match(S(o));if(!Z)return!1;var ie=Z.index+Z[0].length;i[v]=B.slice(0,Z.index)+(!Z.index||ie==B.length?"":" ")+B.slice(ie)||null}else return!1;return!0})}),addLineWidget:_i(function(e,t,o){return El(this,e,t,o)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,o){return Eo(this,A(this,e),A(this,t),o,o&&o.type||"range")},setBookmark:function(e,t){var o={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=A(this,e),Eo(this,e,e,o,"bookmark")},findMarksAt:function(e){e=A(this,e);var t=[],o=dn(this,e.line).markedSpans;if(o)for(var i=0;i<o.length;++i){var v=o[i];(v.from==null||v.from<=e.ch)&&(v.to==null||v.to>=e.ch)&&t.push(v.marker.parent||v.marker)}return t},findMarks:function(e,t,o){e=A(this,e),t=A(this,t);var i=[],v=e.line;return this.iter(e.line,t.line+1,function(B){var Z=B.markedSpans;if(Z)for(var ie=0;ie<Z.length;ie++){var ae=Z[ie];!(ae.to!=null&&v==e.line&&e.ch>=ae.to||ae.from==null&&v!=e.line||ae.from!=null&&v==t.line&&ae.from>=t.ch)&&(!o||o(ae.marker))&&i.push(ae.marker.parent||ae.marker)}++v}),i},getAllMarks:function(){var e=[];return this.iter(function(t){var o=t.markedSpans;if(o)for(var i=0;i<o.length;++i)o[i].from!=null&&e.push(o[i].marker)}),e},posFromIndex:function(e){var t,o=this.first,i=this.lineSeparator().length;return this.iter(function(v){var B=v.text.length+i;if(B>e)return t=e,!0;e-=B,++o}),A(this,an(o,t))},indexFromPos:function(e){e=A(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var o=this.lineSeparator().length;return this.iter(this.first,e.line,function(i){t+=i.text.length+o}),t},copy:function(e){var t=new na(Kr(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,o=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<o&&(o=e.to);var i=new na(Kr(this,t,o),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:e.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Cl(i,Fs(this)),i},unlinkDoc:function(e){if(e instanceof yi&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var o=this.linked[t];if(o.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Tl(Fs(this));break}if(e.history==this.history){var i=[e.id];Oi(e,function(v){return i.push(v.id)},!0),e.history=new zo(null),e.history.done=vo(this.history.done,i),e.history.undone=vo(this.history.undone,i)}},iterLinkedDocs:function(e){Oi(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Tt(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:_i(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&fl(this.cm)})}),na.prototype.eachLine=na.prototype.iter;var Bs=0;function Ol(e){var t=this;if(Hs(t),wt(t,e)||Fr(t.display,e))return;ce(e),H&&(Bs=+new Date);var o=gi(t,e,!0),i=e.dataTransfer.files;if(!o||t.isReadOnly())return;if(i&&i.length&&window.FileReader&&window.File)for(var v=i.length,B=Array(v),Z=0,ie=function(){++Z==v&&vi(t,function(){o=A(t.doc,o);var yt={from:o,to:o,text:t.doc.splitLines(B.filter(function(Yt){return Yt!=null}).join(t.doc.lineSeparator())),origin:"paste"};yo(t.doc,yt),ws(t.doc,kn(A(t.doc,o),A(t.doc,Jn(yt))))})()},ae=function(yt,Yt){if(t.options.allowDropFileTypes&&te(t.options.allowDropFileTypes,yt.type)==-1){ie();return}var cn=new FileReader;cn.onerror=function(){return ie()},cn.onload=function(){var Cn=cn.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Cn)){ie();return}B[Yt]=Cn,ie()},cn.readAsText(yt)},he=0;he<i.length;he++)ae(i[he],he);else{if(t.state.draggingText&&t.doc.sel.contains(o)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var Xe=e.dataTransfer.getData("Text");if(Xe){var nt;if(t.state.draggingText&&!t.state.draggingText.copy&&(nt=t.listSelections()),Yo(t.doc,kn(o,o)),nt)for(var xt=0;xt<nt.length;++xt)bo(t.doc,"",nt[xt].anchor,nt[xt].head,"drag");t.replaceSelection(Xe,"around","paste"),t.display.input.focus()}}catch(yt){}}}function Sl(e,t){if(H&&(!e.state.draggingText||+new Date-Bs<100)){je(t);return}if(wt(e,t)||Fr(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!h){var o=d("img",null,null,"position: fixed; left: 0; top: 0;");o.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",m&&(o.width=o.height=1,e.display.wrapper.appendChild(o),o._top=o.offsetTop),t.dataTransfer.setDragImage(o,0,0),m&&o.parentNode.removeChild(o)}}function Rl(e,t){var o=gi(e,t);if(!o)return;var i=document.createDocumentFragment();Fi(e,o,i),e.display.dragCursor||(e.display.dragCursor=d("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),f(e.display.dragCursor,i)}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 t=document.getElementsByClassName("CodeMirror"),o=[],i=0;i<t.length;i++){var v=t[i].CodeMirror;v&&o.push(v)}o.length&&o[0].operation(function(){for(var B=0;B<o.length;B++)e(o[B])})}var Ks=!1;function Al(){if(Ks)return;Dl(),Ks=!0}function Dl(){var e;Ze(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ws(Pl)},100))}),Ze(window,"blur",function(){return Ws(Ta)})}function Pl(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var eo={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++)eo[Uo+48]=eo[Uo+96]=String(Uo);for(var Qo=65;Qo<=90;Qo++)eo[Qo]=String.fromCharCode(Qo);for(var jo=1;jo<=12;jo++)eo[jo+111]=eo[jo+63235]="F"+jo;var Ka={};Ka.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"},Ka.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"},Ka.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"},Ka.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"]},Ka.default=u?Ka.macDefault:Ka.pcDefault;function Ll(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var o,i,v,B,Z=0;Z<t.length-1;Z++){var ie=t[Z];if(/^(cmd|meta|m)$/i.test(ie))B=!0;else if(/^a(lt)?$/i.test(ie))o=!0;else if(/^(c|ctrl|control)$/i.test(ie))i=!0;else if(/^s(hift)?$/i.test(ie))v=!0;else throw new Error("Unrecognized modifier name: "+ie)}return o&&(e="Alt-"+e),i&&(e="Ctrl-"+e),B&&(e="Cmd-"+e),v&&(e="Shift-"+e),e}function Ml(e){var t={};for(var o in e)if(e.hasOwnProperty(o)){var i=e[o];if(/^(name|fallthrough|(de|at)tach)$/.test(o))continue;if(i=="..."){delete e[o];continue}for(var v=we(o.split(" "),Ll),B=0;B<v.length;B++){var Z=void 0,ie=void 0;B==v.length-1?(ie=v.join(" "),Z=i):(ie=v.slice(0,B+1).join(" "),Z="...");var ae=t[ie];if(!ae)t[ie]=Z;else if(ae!=Z)throw new Error("Inconsistent bindings for "+ie)}delete e[o]}for(var he in t)e[he]=t[he];return e}function xo(e,t,o,i){t=Jo(t);var v=t.call?t.call(e,i):t[e];if(v===!1)return"nothing";if(v==="...")return"multi";if(v!=null&&o(v))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return xo(e,t.fallthrough,o,i);for(var B=0;B<t.fallthrough.length;B++){var Z=xo(e,t.fallthrough[B],o,i);if(Z)return Z}}}function zs(e){var t=typeof e=="string"?e:eo[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Gs(e,t,o){var i=e;return t.altKey&&i!="Alt"&&(e="Alt-"+e),(C?t.metaKey:t.ctrlKey)&&i!="Ctrl"&&(e="Ctrl-"+e),(C?t.ctrlKey:t.metaKey)&&i!="Mod"&&(e="Cmd-"+e),!o&&t.shiftKey&&i!="Shift"&&(e="Shift-"+e),e}function Vs(e,t){if(m&&e.keyCode==34&&e.char)return!1;var o=eo[e.keyCode];return o==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(o=e.code),Gs(o,e,t))}function Jo(e){return typeof e=="string"?Ka[e]:e}function Co(e,t){for(var o=e.doc.sel.ranges,i=[],v=0;v<o.length;v++){for(var B=t(o[v]);i.length&&Xn(B.from,se(i).to)<=0;){var Z=i.pop();if(Xn(Z.from,B.from)<0){B.from=Z.from;break}}i.push(B)}Ki(e,function(){for(var ie=i.length-1;ie>=0;ie--)bo(e.doc,"",i[ie].from,i[ie].to,"+delete");_a(e)})}function os(e,t,o){var i=$e(e.text,t+o,o);return i<0||i>e.text.length?null:i}function ss(e,t,o){var i=os(e,t.ch,o);return i==null?null:new an(t.line,i,o<0?"after":"before")}function ls(e,t,o,i,v){if(e){t.doc.direction=="rtl"&&(v=-v);var B=pn(o,t.doc.direction);if(B){var Z=v<0?se(B):B[0],ie=v<0==(Z.level==1),ae=ie?"after":"before",he;if(Z.level>0||t.doc.direction=="rtl"){var Xe=Qe(t,o);he=v<0?o.text.length-1:0;var nt=pt(t,Xe,he).top;he=Pt(function(xt){return pt(t,Xe,xt).top==nt},v<0==(Z.level==1)?Z.from:Z.to-1,he),ae=="before"&&(he=os(o,he,1))}else he=v<0?Z.to:Z.from;return new an(i,he,ae)}}return new an(i,v<0?o.text.length:0,v<0?"before":"after")}function kl(e,t,o,i){var v=pn(t,e.doc.direction);if(!v)return ss(t,o,i);o.ch>=t.text.length?(o.ch=t.text.length,o.sticky="before"):o.ch<=0&&(o.ch=0,o.sticky="after");var B=lt(v,o.ch,o.sticky),Z=v[B];if(e.doc.direction=="ltr"&&Z.level%2==0&&(i>0?Z.to>o.ch:Z.from<o.ch))return ss(t,o,i);var ie=function(Ln,Hn){return os(t,Ln instanceof an?Ln.ch:Ln,Hn)},ae,he=function(Ln){return e.options.lineWrapping?(ae=ae||Qe(e,t),Wn(e,t,ae,Ln)):{begin:0,end:t.text.length}},Xe=he(o.sticky=="before"?ie(o,-1):o.ch);if(e.doc.direction=="rtl"||Z.level==1){var nt=Z.level==1==i<0,xt=ie(o,nt?1:-1);if(xt!=null&&(nt?xt<=Z.to&&xt<=Xe.end:xt>=Z.from&&xt>=Xe.begin)){var yt=nt?"before":"after";return new an(o.line,xt,yt)}}var Yt=function(Ln,Hn,Mn){for(var Yn=function(ci,Hi){return Hi?new an(o.line,ie(ci,1),"before"):new an(o.line,ci,"after")};Ln>=0&&Ln<v.length;Ln+=Hn){var vr=v[Ln],sr=Hn>0==(vr.level!=1),Ir=sr?Mn.begin:ie(Mn.end,-1);if(vr.from<=Ir&&Ir<vr.to)return Yn(Ir,sr);if(Ir=sr?vr.from:ie(vr.to,-1),Mn.begin<=Ir&&Ir<Mn.end)return Yn(Ir,sr)}},cn=Yt(B+i,i,Xe);if(cn)return cn;var Cn=i>0?Xe.end:ie(Xe.begin,-1);return Cn!=null&&!(i>0&&Cn==t.text.length)&&(cn=Yt(i>0?0:v.length-1,i,he(Cn)),cn)?cn:null}var Fo={selectAll:Ds,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ee)},killLine:function(e){return Co(e,function(t){if(t.empty()){var o=dn(e.doc,t.head.line).text.length;return t.head.ch==o&&t.head.line<e.lastLine()?{from:t.head,to:an(t.head.line+1,0)}:{from:t.head,to:an(t.head.line,o)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Co(e,function(t){return{from:an(t.from().line,0),to:A(e.doc,an(t.to().line+1,0))}})},delLineLeft:function(e){return Co(e,function(t){return{from:an(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Co(e,function(t){var o=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:o},"div");return{from:i,to:t.from()}})},delWrappedLineRight:function(e){return Co(e,function(t){var o=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:o},"div");return{from:t.from(),to:i}})},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(an(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(an(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Ys(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Xs(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Il(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var o=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:o},"div")},We)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var o=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:o},"div")},We)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var o=e.cursorCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:o},"div");return i.ch<e.getLine(i.line).search(/\S/)?Xs(e,t.head):i},We)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],o=e.listSelections(),i=e.options.tabSize,v=0;v<o.length;v++){var B=o[v].from(),Z=W(e.getLine(B.line),B.ch,i);t.push(ue(i-Z%i))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Ki(e,function(){for(var t=e.listSelections(),o=[],i=0;i<t.length;i++){if(!t[i].empty())continue;var v=t[i].head,B=dn(e.doc,v.line).text;if(B){if(v.ch==B.length&&(v=new an(v.line,v.ch-1)),v.ch>0)v=new an(v.line,v.ch+1),e.replaceRange(B.charAt(v.ch-1)+B.charAt(v.ch-2),an(v.line,v.ch-2),v,"+transpose");else if(v.line>e.doc.first){var Z=dn(e.doc,v.line-1).text;Z&&(v=new an(v.line,1),e.replaceRange(B.charAt(0)+e.doc.lineSeparator()+Z.charAt(Z.length-1),an(v.line-1,Z.length-1),v,"+transpose"))}}o.push(new zr(v,v))}e.setSelections(o)})},newlineAndIndent:function(e){return Ki(e,function(){for(var t=e.listSelections(),o=t.length-1;o>=0;o--)e.replaceRange(e.doc.lineSeparator(),t[o].anchor,t[o].head,"+input");t=e.listSelections();for(var i=0;i<t.length;i++)e.indentLine(t[i].from().line,null,!0);_a(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ys(e,t){var o=dn(e.doc,t),i=_t(o);return i!=o&&(t=rr(i)),ls(!0,e,i,t,1)}function Il(e,t){var o=dn(e.doc,t),i=Et(o);return i!=o&&(t=rr(i)),ls(!0,e,o,t,-1)}function Xs(e,t){var o=Ys(e,t.line),i=dn(e.doc,o.line),v=pn(i,e.doc.direction);if(!v||v[0].level==0){var B=Math.max(o.ch,i.text.search(/\S/)),Z=t.line==o.line&&t.ch<=B&&t.ch;return an(o.line,Z?0:B,o.sticky)}return o}function Zo(e,t,o){if(typeof t=="string"&&(t=Fo[t],!t))return!1;e.display.input.ensurePolled();var i=e.display.shift,v=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),o&&(e.display.shift=!1),v=t(e)!=Ie}finally{e.display.shift=i,e.state.suppressEdits=!1}return v}function Nl(e,t,o){for(var i=0;i<e.state.keyMaps.length;i++){var v=xo(t,e.state.keyMaps[i],o,e);if(v)return v}return e.options.extraKeys&&xo(t,e.options.extraKeys,o,e)||xo(t,e.options.keyMap,o,e)}var Ul=new X;function Bo(e,t,o,i){var v=e.state.keySeq;if(v){if(zs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==v&&(e.state.keySeq=null,e.display.input.reset())}),$s(e,v+" "+t,o,i))return!0}return $s(e,t,o,i)}function $s(e,t,o,i){var v=Nl(e,t,i);return v=="multi"&&(e.state.keySeq=t),v=="handled"&&qt(e,"keyHandled",e,t,o),(v=="handled"||v=="multi")&&(ce(o),xi(e)),!!v}function Qs(e,t){var o=Vs(t,!0);return o?t.shiftKey&&!e.state.keySeq?Bo(e,"Shift-"+o,t,function(i){return Zo(e,i,!0)})||Bo(e,o,t,function(i){if(typeof i=="string"?/^go[A-Z]/.test(i):i.motion)return Zo(e,i)}):Bo(e,o,t,function(i){return Zo(e,i)}):!1}function jl(e,t,o){return Bo(e,"'"+o+"'",t,function(i){return Zo(e,i,!0)})}var us=null;function Js(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=F(),wt(t,e))return;H&&O<11&&e.keyCode==27&&(e.returnValue=!1);var o=e.keyCode;t.display.shift=o==16||e.shiftKey;var i=Qs(t,e);m&&(us=i?o:null,!i&&o==88&&!mt&&(u?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),j&&!u&&!i&&o==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),o==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fl(t)}function Fl(e){var t=e.display.lineDiv;U(t,"CodeMirror-crosshair");function o(i){(i.keyCode==18||!i.altKey)&&(b(t,"CodeMirror-crosshair"),Mt(document,"keyup",o),Mt(document,"mouseover",o))}Ze(document,"keyup",o),Ze(document,"mouseover",o)}function Zs(e){e.keyCode==16&&(this.doc.sel.shift=!1),wt(this,e)}function qs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Fr(t.display,e)||wt(t,e)||e.ctrlKey&&!e.altKey||u&&e.metaKey)return;var o=e.keyCode,i=e.charCode;if(m&&o==us){us=null,ce(e);return}if(m&&(!e.which||e.which<10)&&Qs(t,e))return;var v=String.fromCharCode(i==null?o:i);if(v=="\b")return;if(jl(t,e,v))return;t.display.input.onKeyPress(e)}var Bl=400,cs=function(e,t,o){this.time=e,this.pos=t,this.button=o};cs.prototype.compare=function(e,t,o){return this.time+Bl>e&&Xn(t,this.pos)==0&&o==this.button};var Ho,Wo;function Hl(e,t){var o=+new Date;return Wo&&Wo.compare(o,e,t)?(Ho=Wo=null,"triple"):Ho&&Ho.compare(o,e,t)?(Wo=new cs(o,e,t),Ho=null,"double"):(Ho=new cs(o,e,t),Wo=null,"single")}function el(e){var t=this,o=t.display;if(wt(t,e)||o.activeTouch&&o.input.supportsTouch())return;if(o.input.ensurePolled(),o.shift=e.shiftKey,Fr(o,e)){I||(o.scroller.draggable=!1,setTimeout(function(){return o.scroller.draggable=!0},100));return}if(ds(t,e))return;var i=gi(t,e),v=ut(e),B=i?Hl(i,v):"single";if(window.focus(),v==1&&t.state.selectingText&&t.state.selectingText(e),i&&Wl(t,v,i,B,e))return;v==1?i?zl(t,i,B,e):ze(e)==o.scroller&&ce(e):v==2?(i&&Vo(t.doc,i),setTimeout(function(){return o.input.focus()},20)):v==3&&(D?t.display.input.onContextMenu(e):no(t))}function Wl(e,t,o,i,v){var B="Click";return i=="double"?B="Double"+B:i=="triple"&&(B="Triple"+B),B=(t==1?"Left":t==2?"Middle":"Right")+B,Bo(e,Gs(B,v),v,function(Z){if(typeof Z=="string"&&(Z=Fo[Z]),!Z)return!1;var ie=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),ie=Z(e,o)!=Ie}finally{e.state.suppressEdits=!1}return ie})}function Kl(e,t,o){var i=e.getOption("configureMouse"),v=i?i(e,t,o):{};if(v.unit==null){var B=c?o.shiftKey&&o.metaKey:o.altKey;v.unit=B?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(v.extend==null||e.doc.extend)&&(v.extend=e.doc.extend||o.shiftKey),v.addNew==null&&(v.addNew=u?o.metaKey:o.ctrlKey),v.moveOnDrag==null&&(v.moveOnDrag=!(u?o.altKey:o.ctrlKey)),v}function zl(e,t,o,i){H?setTimeout(M(Ma,e),0):e.curOp.focus=F();var v=Kl(e,o,i),B=e.doc.sel,Z;e.options.dragDrop&&Dt&&!e.isReadOnly()&&o=="single"&&(Z=B.contains(t))>-1&&(Xn((Z=B.ranges[Z]).from(),t)<0||t.xRel>0)&&(Xn(Z.to(),t)>0||t.xRel<0)?Gl(e,i,t,v):Vl(e,i,t,v)}function Gl(e,t,o,i){var v=e.display,B=!1,Z=vi(e,function(he){I&&(v.scroller.draggable=!1),e.state.draggingText=!1,Mt(v.wrapper.ownerDocument,"mouseup",Z),Mt(v.wrapper.ownerDocument,"mousemove",ie),Mt(v.scroller,"dragstart",ae),Mt(v.scroller,"drop",Z),B||(ce(he),i.addNew||Vo(e.doc,o,null,null,i.extend),I&&!h||H&&O==9?setTimeout(function(){v.wrapper.ownerDocument.body.focus({preventScroll:!0}),v.input.focus()},20):v.input.focus())}),ie=function(he){B=B||Math.abs(t.clientX-he.clientX)+Math.abs(t.clientY-he.clientY)>=10},ae=function(){return B=!0};I&&(v.scroller.draggable=!0),e.state.draggingText=Z,Z.copy=!i.moveOnDrag,v.scroller.dragDrop&&v.scroller.dragDrop(),Ze(v.wrapper.ownerDocument,"mouseup",Z),Ze(v.wrapper.ownerDocument,"mousemove",ie),Ze(v.scroller,"dragstart",ae),Ze(v.scroller,"drop",Z),no(e),setTimeout(function(){return v.input.focus()},20)}function tl(e,t,o){if(o=="char")return new zr(t,t);if(o=="word")return e.findWordAt(t);if(o=="line")return new zr(an(t.line,0),A(e.doc,an(t.line+1,0)));var i=o(e,t);return new zr(i.from,i.to)}function Vl(e,t,o,i){var v=e.display,B=e.doc;ce(t);var Z,ie,ae=B.sel,he=ae.ranges;if(i.addNew&&!i.extend?(ie=B.sel.contains(o),ie>-1?Z=he[ie]:Z=new zr(o,o)):(Z=B.sel.primary(),ie=B.sel.primIndex),i.unit=="rectangle")i.addNew||(Z=new zr(o,o)),o=gi(e,t,!0,!0),ie=-1;else{var Xe=tl(e,o,i.unit);i.extend?Z=is(Z,Xe.anchor,Xe.head,i.extend):Z=Xe}i.addNew?ie==-1?(ie=he.length,Xi(B,_r(e,he.concat([Z]),ie),{scroll:!1,origin:"*mouse"})):he.length>1&&he[ie].empty()&&i.unit=="char"&&!i.extend?(Xi(B,_r(e,he.slice(0,ie).concat(he.slice(ie+1)),0),{scroll:!1,origin:"*mouse"}),ae=B.sel):as(B,ie,Z,Te):(ie=0,Xi(B,new zi([Z],0),Te),ae=B.sel);var nt=o;function xt(Mn){if(Xn(nt,Mn)==0)return;if(nt=Mn,i.unit=="rectangle"){for(var Yn=[],vr=e.options.tabSize,sr=W(dn(B,o.line).text,o.ch,vr),Ir=W(dn(B,Mn.line).text,Mn.ch,vr),ci=Math.min(sr,Ir),Hi=Math.max(sr,Ir),bi=Math.min(o.line,Mn.line),sa=Math.min(e.lastLine(),Math.max(o.line,Mn.line));bi<=sa;bi++){var ra=dn(B,bi).text,Pi=He(ra,ci,vr);ci==Hi?Yn.push(new zr(an(bi,Pi),an(bi,Pi))):ra.length>Pi&&Yn.push(new zr(an(bi,Pi),an(bi,He(ra,Hi,vr))))}Yn.length||Yn.push(new zr(o,o)),Xi(B,_r(e,ae.ranges.slice(0,ie).concat(Yn),ie),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Mn)}else{var ia=Z,Gi=tl(e,Mn,i.unit),Ii=ia.anchor,Li;Xn(Gi.anchor,Ii)>0?(Li=Gi.head,Ii=ii(ia.from(),Gi.anchor)):(Li=Gi.anchor,Ii=ri(ia.to(),Gi.head));var Ti=ae.ranges.slice(0);Ti[ie]=Yl(e,new zr(A(B,Ii),Li)),Xi(B,_r(e,Ti,ie),Te)}}var yt=v.wrapper.getBoundingClientRect(),Yt=0;function cn(Mn){var Yn=++Yt,vr=gi(e,Mn,!0,i.unit=="rectangle");if(!vr)return;if(Xn(vr,nt)!=0){e.curOp.focus=F(),xt(vr);var sr=ka(v,B);(vr.line>=sr.to||vr.line<sr.from)&&setTimeout(vi(e,function(){Yt==Yn&&cn(Mn)}),150)}else{var Ir=Mn.clientY<yt.top?-20:Mn.clientY>yt.bottom?20:0;Ir&&setTimeout(vi(e,function(){if(Yt!=Yn)return;v.scroller.scrollTop+=Ir,cn(Mn)}),50)}}function Cn(Mn){e.state.selectingText=!1,Yt=Infinity,Mn&&(ce(Mn),v.input.focus()),Mt(v.wrapper.ownerDocument,"mousemove",Ln),Mt(v.wrapper.ownerDocument,"mouseup",Hn),B.history.lastSelOrigin=null}var Ln=vi(e,function(Mn){Mn.buttons===0||!ut(Mn)?Cn(Mn):cn(Mn)}),Hn=vi(e,Cn);e.state.selectingText=Hn,Ze(v.wrapper.ownerDocument,"mousemove",Ln),Ze(v.wrapper.ownerDocument,"mouseup",Hn)}function Yl(e,t){var o=t.anchor,i=t.head,v=dn(e.doc,o.line);if(Xn(o,i)==0&&o.sticky==i.sticky)return t;var B=pn(v);if(!B)return t;var Z=lt(B,o.ch,o.sticky),ie=B[Z];if(ie.from!=o.ch&&ie.to!=o.ch)return t;var ae=Z+(ie.from==o.ch==(ie.level!=1)?0:1);if(ae==0||ae==B.length)return t;var he;if(i.line!=o.line)he=(i.line-o.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Xe=lt(B,i.ch,i.sticky),nt=Xe-Z||(i.ch-o.ch)*(ie.level==1?-1:1);Xe==ae-1||Xe==ae?he=nt<0:he=nt>0}var xt=B[ae+(he?-1:0)],yt=he==(xt.level==1),Yt=yt?xt.from:xt.to,cn=yt?"after":"before";return o.ch==Yt&&o.sticky==cn?t:new zr(new an(o.line,Yt,cn),i)}function nl(e,t,o,i){var v,B;if(t.touches)v=t.touches[0].clientX,B=t.touches[0].clientY;else try{v=t.clientX,B=t.clientY}catch(xt){return!1}if(v>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&ce(t);var Z=e.display,ie=Z.lineDiv.getBoundingClientRect();if(B>ie.bottom||!Se(e,o))return be(t);B-=ie.top-Z.viewOffset;for(var ae=0;ae<e.display.gutterSpecs.length;++ae){var he=Z.gutters.childNodes[ae];if(he&&he.getBoundingClientRect().right>=v){var Xe=Nr(e.doc,B),nt=e.display.gutterSpecs[ae];return ct(e,o,e,Xe,nt.className,t),be(t)}}}function ds(e,t){return nl(e,t,"gutterClick",!0)}function rl(e,t){if(Fr(e.display,t)||Xl(e,t))return;if(wt(e,t,"contextmenu"))return;D||e.display.input.onContextMenu(t)}function Xl(e,t){return Se(e,"gutterContextMenu")?nl(e,t,"gutterContextMenu",!1):!1}function il(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),cr(e)}var To={toString:function(){return"CodeMirror.Init"}},al={},qo={};function $l(e){var t=e.optionHandlers;function o(i,v,B,Z){e.defaults[i]=v,B&&(t[i]=Z?function(ie,ae,he){he!=To&&B(ie,ae,he)}:B)}e.defineOption=o,e.Init=To,o("value","",function(i,v){return i.setValue(v)},!0),o("mode",null,function(i,v){i.doc.modeOption=v,Di(i)},!0),o("indentUnit",2,Di,!0),o("indentWithTabs",!1),o("smartIndent",!0),o("tabSize",4,function(i){Zi(i),cr(i),Xr(i)},!0),o("lineSeparator",null,function(i,v){if(i.doc.lineSep=v,!v)return;var B=[],Z=i.doc.first;i.doc.iter(function(ae){for(var he=0;;){var Xe=ae.text.indexOf(v,he);if(Xe==-1)break;he=Xe+v.length,B.push(an(Z,Xe))}Z++});for(var ie=B.length-1;ie>=0;ie--)bo(i.doc,v,B[ie],an(B[ie].line,B[ie].ch+v.length))}),o("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(i,v,B){i.state.specialChars=new RegExp(v.source+(v.test(" ")?"":"| "),"g"),B!=To&&i.refresh()}),o("specialCharPlaceholder",Sn,function(i){return i.refresh()},!0),o("electricChars",!0),o("inputStyle",s?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),o("spellcheck",!1,function(i,v){return i.getInputField().spellcheck=v},!0),o("autocorrect",!1,function(i,v){return i.getInputField().autocorrect=v},!0),o("autocapitalize",!1,function(i,v){return i.getInputField().autocapitalize=v},!0),o("rtlMoveVisually",!R),o("wholeLineUpdateBefore",!0),o("theme","default",function(i){il(i),da(i)},!0),o("keyMap","default",function(i,v,B){var Z=Jo(v),ie=B!=To&&Jo(B);ie&&ie.detach&&ie.detach(i,Z),Z.attach&&Z.attach(i,ie||null)}),o("extraKeys",null),o("configureMouse",null),o("lineWrapping",!1,Jl,!0),o("gutters",[],function(i,v){i.display.gutterSpecs=Bi(v,i.options.lineNumbers),da(i)},!0),o("fixedGutter",!0,function(i,v){i.display.gutters.style.left=v?li(i.display)+"px":"0",i.refresh()},!0),o("coverGutterNextToScrollbar",!1,function(i){return ma(i)},!0),o("scrollbarStyle","native",function(i){Qa(i),ma(i),i.display.scrollbars.setScrollTop(i.doc.scrollTop),i.display.scrollbars.setScrollLeft(i.doc.scrollLeft)},!0),o("lineNumbers",!1,function(i,v){i.display.gutterSpecs=Bi(i.options.gutters,v),da(i)},!0),o("firstLineNumber",1,da,!0),o("lineNumberFormatter",function(i){return i},da,!0),o("showCursorWhenSelecting",!1,Lr,!0),o("resetSelectionOnContextMenu",!0),o("lineWiseCopyCut",!0),o("pasteLinesPerSelection",!0),o("selectionsMayTouch",!1),o("readOnly",!1,function(i,v){v=="nocursor"&&(Ta(i),i.display.input.blur()),i.display.input.readOnlyChanged(v)}),o("screenReaderLabel",null,function(i,v){v=v===""?null:v,i.display.input.screenReaderLabelChanged(v)}),o("disableInput",!1,function(i,v){v||i.display.input.reset()},!0),o("dragDrop",!0,Ql),o("allowDropFileTypes",null),o("cursorBlinkRate",530),o("cursorScrollMargin",0),o("cursorHeight",1,Lr,!0),o("singleCursorHeightPerLine",!0,Lr,!0),o("workTime",100),o("workDelay",100),o("flattenSpans",!0,Zi,!0),o("addModeClass",!1,Zi,!0),o("pollInterval",100),o("undoDepth",200,function(i,v){return i.doc.history.undoDepth=v}),o("historyEventDelay",1250),o("viewportMargin",10,function(i){return i.refresh()},!0),o("maxHighlightLength",1e4,Zi,!0),o("moveInputWithCursor",!0,function(i,v){v||i.display.input.resetPosition()}),o("tabindex",null,function(i,v){return i.display.input.getField().tabIndex=v||""}),o("autofocus",null),o("direction","ltr",function(i,v){return i.doc.setDirection(v)},!0),o("phrases",null)}function Ql(e,t,o){var i=o&&o!=To;if(!t!=!i){var v=e.display.dragFunctions,B=t?Ze:Mt;B(e.display.scroller,"dragstart",v.start),B(e.display.scroller,"dragenter",v.enter),B(e.display.scroller,"dragover",v.over),B(e.display.scroller,"dragleave",v.leave),B(e.display.scroller,"drop",v.drop)}}function Jl(e){e.options.lineWrapping?(U(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(b(e.display.wrapper,"CodeMirror-wrap"),Ft(e)),wi(e),Xr(e),cr(e),setTimeout(function(){return ma(e)},100)}function yi(e,t){var o=this;if(!(this instanceof yi))return new yi(e,t);this.options=t=t?y(t):{},y(al,t,!1);var i=t.value;typeof i=="string"?i=new na(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var v=new yi.inputStyles[t.inputStyle](this),B=this.display=new ja(e,i,v,t);B.wrapper.CodeMirror=this,il(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Qa(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 X,keySeq:null,specialChars:null},t.autofocus&&!s&&B.input.focus(),H&&O<11&&setTimeout(function(){return o.display.input.reset(!0)},20),Zl(this),Al(),ca(this),this.curOp.forceUpdate=!0,vs(this,i),t.autofocus&&!s||this.hasFocus()?setTimeout(function(){o.hasFocus()&&!o.state.focused&&ua(o)},20):Ta(this);for(var Z in qo)qo.hasOwnProperty(Z)&&qo[Z](this,t[Z],To);di(this),t.finishInit&&t.finishInit(this);for(var ie=0;ie<hs.length;++ie)hs[ie](this);Ea(this),I&&t.lineWrapping&&getComputedStyle(B.lineDiv).textRendering=="optimizelegibility"&&(B.lineDiv.style.textRendering="auto")}yi.defaults=al,yi.optionHandlers=qo;function Zl(e){var t=e.display;Ze(t.scroller,"mousedown",vi(e,el)),H&&O<11?Ze(t.scroller,"dblclick",vi(e,function(ae){if(wt(e,ae))return;var he=gi(e,ae);if(!he||ds(e,ae)||Fr(e.display,ae))return;ce(ae);var Xe=e.findWordAt(he);Vo(e.doc,Xe.anchor,Xe.head)})):Ze(t.scroller,"dblclick",function(ae){return wt(e,ae)||ce(ae)}),Ze(t.scroller,"contextmenu",function(ae){return rl(e,ae)}),Ze(t.input.getField(),"contextmenu",function(ae){t.scroller.contains(ae.target)||rl(e,ae)});var o,i={end:0};function v(){t.activeTouch&&(o=setTimeout(function(){return t.activeTouch=null},1e3),i=t.activeTouch,i.end=+new Date)}function B(ae){if(ae.touches.length!=1)return!1;var he=ae.touches[0];return he.radiusX<=1&&he.radiusY<=1}function Z(ae,he){if(he.left==null)return!0;var Xe=he.left-ae.left,nt=he.top-ae.top;return Xe*Xe+nt*nt>20*20}Ze(t.scroller,"touchstart",function(ae){if(!wt(e,ae)&&!B(ae)&&!ds(e,ae)){t.input.ensurePolled(),clearTimeout(o);var he=+new Date;t.activeTouch={start:he,moved:!1,prev:he-i.end<=300?i:null},ae.touches.length==1&&(t.activeTouch.left=ae.touches[0].pageX,t.activeTouch.top=ae.touches[0].pageY)}}),Ze(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ze(t.scroller,"touchend",function(ae){var he=t.activeTouch;if(he&&!Fr(t,ae)&&he.left!=null&&!he.moved&&new Date-he.start<300){var Xe=e.coordsChar(t.activeTouch,"page"),nt;!he.prev||Z(he,he.prev)?nt=new zr(Xe,Xe):!he.prev.prev||Z(he,he.prev.prev)?nt=e.findWordAt(Xe):nt=new zr(an(Xe.line,0),A(e.doc,an(Xe.line+1,0))),e.setSelection(nt.anchor,nt.head),e.focus(),ce(ae)}v()}),Ze(t.scroller,"touchcancel",v),Ze(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Da(e,t.scroller.scrollTop),ki(e,t.scroller.scrollLeft,!0),ct(e,"scroll",e))}),Ze(t.scroller,"mousewheel",function(ae){return Ha(e,ae)}),Ze(t.scroller,"DOMMouseScroll",function(ae){return Ha(e,ae)}),Ze(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(ae){wt(e,ae)||je(ae)},over:function(ae){wt(e,ae)||(Rl(e,ae),je(ae))},start:function(ae){return Sl(e,ae)},drop:vi(e,Ol),leave:function(ae){wt(e,ae)||Hs(e)}};var ie=t.input.getField();Ze(ie,"keyup",function(ae){return Zs.call(e,ae)}),Ze(ie,"keydown",vi(e,Js)),Ze(ie,"keypress",vi(e,qs)),Ze(ie,"focus",function(ae){return ua(e,ae)}),Ze(ie,"blur",function(ae){return Ta(e,ae)})}var hs=[];yi.defineInitHook=function(e){return hs.push(e)};function Ko(e,t,o,i){var v=e.doc,B;o==null&&(o="add"),o=="smart"&&(v.mode.indent?B=gn(e,t).state:o="prev");var Z=e.options.tabSize,ie=dn(v,t),ae=W(ie.text,null,Z);ie.stateAfter&&(ie.stateAfter=null);var he=ie.text.match(/^\s*/)[0],Xe;if(!i&&!/\S/.test(ie.text))Xe=0,o="not";else if(o=="smart"&&(Xe=v.mode.indent(B,ie.text.slice(he.length),ie.text),Xe==Ie||Xe>150)){if(!i)return;o="prev"}o=="prev"?t>v.first?Xe=W(dn(v,t-1).text,null,Z):Xe=0:o=="add"?Xe=ae+e.options.indentUnit:o=="subtract"?Xe=ae-e.options.indentUnit:typeof o=="number"&&(Xe=ae+o),Xe=Math.max(0,Xe);var nt="",xt=0;if(e.options.indentWithTabs)for(var yt=Math.floor(Xe/Z);yt;--yt)xt+=Z,nt+=" ";if(xt<Xe&&(nt+=ue(Xe-xt)),nt!=he)return bo(v,nt,an(t,0),an(t,he.length),"+input"),ie.stateAfter=null,!0;for(var Yt=0;Yt<v.sel.ranges.length;Yt++){var cn=v.sel.ranges[Yt];if(cn.head.line==t&&cn.head.ch<he.length){var Cn=an(t,he.length);as(v,Yt,new zr(Cn,Cn));break}}}var Ca=null;function es(e){Ca=e}function fs(e,t,o,i,v){var B=e.doc;e.display.shift=!1,i||(i=B.sel);var Z=+new Date-200,ie=v=="paste"||e.state.pasteIncoming>Z,ae=Tt(t),he=null;if(ie&&i.ranges.length>1)if(Ca&&Ca.text.join(`
`)==t){if(i.ranges.length%Ca.text.length==0){he=[];for(var Xe=0;Xe<Ca.text.length;Xe++)he.push(B.splitLines(Ca.text[Xe]))}}else ae.length==i.ranges.length&&e.options.pasteLinesPerSelection&&(he=we(ae,function(Ln){return[Ln]}));for(var nt=e.curOp.updateInput,xt=i.ranges.length-1;xt>=0;xt--){var yt=i.ranges[xt],Yt=yt.from(),cn=yt.to();yt.empty()&&(o&&o>0?Yt=an(Yt.line,Yt.ch-o):e.state.overwrite&&!ie?cn=an(cn.line,Math.min(dn(B,cn.line).text.length,cn.ch+se(ae).length)):ie&&Ca&&Ca.lineWise&&Ca.text.join(`
`)==ae.join(`
`)&&(Yt=cn=an(Yt.line,0)));var Cn={from:Yt,to:cn,text:he?he[xt%he.length]:ae,origin:v||(ie?"paste":e.state.cutIncoming>Z?"cut":"+input")};yo(e.doc,Cn),qt(e,"inputRead",e,Cn)}t&&!ie&&sl(e,t),_a(e),e.curOp.updateInput<2&&(e.curOp.updateInput=nt),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ol(e,t){var o=e.clipboardData&&e.clipboardData.getData("Text");if(o)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Ki(t,function(){return fs(t,o,0,null,"paste")}),!0}function sl(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var o=e.doc.sel,i=o.ranges.length-1;i>=0;i--){var v=o.ranges[i];if(v.head.ch>100||i&&o.ranges[i-1].head.line==v.head.line)continue;var B=e.getModeAt(v.head),Z=!1;if(B.electricChars){for(var ie=0;ie<B.electricChars.length;ie++)if(t.indexOf(B.electricChars.charAt(ie))>-1){Z=Ko(e,v.head.line,"smart");break}}else B.electricInput&&(B.electricInput.test(dn(e.doc,v.head.line).text.slice(0,v.head.ch))&&(Z=Ko(e,v.head.line,"smart")));Z&&qt(e,"electricInput",e,v.head.line)}}function ll(e){for(var t=[],o=[],i=0;i<e.doc.sel.ranges.length;i++){var v=e.doc.sel.ranges[i].head.line,B={anchor:an(v,0),head:an(v+1,0)};o.push(B),t.push(e.getRange(B.anchor,B.head))}return{text:t,ranges:o}}function ul(e,t,o,i){e.setAttribute("autocorrect",o?"":"off"),e.setAttribute("autocapitalize",i?"":"off"),e.setAttribute("spellcheck",!!t)}function cl(){var e=d("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=d("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return I?e.style.width="1000px":e.setAttribute("wrap","off"),a&&(e.style.border="1px solid black"),ul(e),t}function ql(e){var t=e.optionHandlers,o=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(i,v){var B=this.options,Z=B[i];if(B[i]==v&&i!="mode")return;B[i]=v,t.hasOwnProperty(i)&&vi(this,t[i])(this,v,Z),ct(this,"optionChange",this,i)},getOption:function(i){return this.options[i]},getDoc:function(){return this.doc},addKeyMap:function(i,v){this.state.keyMaps[v?"push":"unshift"](Jo(i))},removeKeyMap:function(i){for(var v=this.state.keyMaps,B=0;B<v.length;++B)if(v[B]==i||v[B].name==i)return v.splice(B,1),!0},addOverlay:Ai(function(i,v){var B=i.token?i:e.getMode(this.options,i);if(B.startState)throw new Error("Overlays may not be stateful.");ge(this.state.overlays,{mode:B,modeSpec:i,opaque:v&&v.opaque,priority:v&&v.priority||0},function(Z){return Z.priority}),this.state.modeGen++,Xr(this)}),removeOverlay:Ai(function(i){for(var v=this.state.overlays,B=0;B<v.length;++B){var Z=v[B].modeSpec;if(Z==i||typeof i=="string"&&Z.name==i){v.splice(B,1),this.state.modeGen++,Xr(this);return}}}),indentLine:Ai(function(i,v,B){typeof v!="string"&&typeof v!="number"&&(v==null?v=this.options.smartIndent?"smart":"prev":v=v?"add":"subtract"),oi(this.doc,i)&&Ko(this,i,v,B)}),indentSelection:Ai(function(i){for(var v=this.doc.sel.ranges,B=-1,Z=0;Z<v.length;Z++){var ie=v[Z];if(ie.empty())ie.head.line>B&&(Ko(this,ie.head.line,i,!0),B=ie.head.line,Z==this.doc.sel.primIndex&&_a(this));else{var ae=ie.from(),he=ie.to(),Xe=Math.max(B,ae.line);B=Math.min(this.lastLine(),he.line-(he.ch?0:1))+1;for(var nt=Xe;nt<B;++nt)Ko(this,nt,i);var xt=this.doc.sel.ranges;ae.ch==0&&v.length==xt.length&&xt[Z].from().ch>0&&as(this.doc,Z,new zr(ae,xt[Z].to()),Ee)}}}),getTokenAt:function(i,v){return Ur(this,i,v)},getLineTokens:function(i,v){return Ur(this,an(i),v,!0)},getTokenTypeAt:function(i){i=A(this.doc,i);var v=Kt(this,dn(this.doc,i.line)),B=0,Z=(v.length-1)/2,ie=i.ch,ae;if(ie==0)ae=v[2];else for(;;){var he=B+Z>>1;if((he?v[he*2-1]:0)>=ie)Z=he;else if(v[he*2+1]<ie)B=he+1;else{ae=v[he*2+2];break}}var Xe=ae?ae.indexOf("overlay "):-1;return Xe<0?ae:Xe==0?null:ae.slice(0,Xe-1)},getModeAt:function(i){var v=this.doc.mode;return v.innerMode?e.innerMode(v,this.getTokenAt(i).state).mode:v},getHelper:function(i,v){return this.getHelpers(i,v)[0]},getHelpers:function(i,v){var B=[];if(!o.hasOwnProperty(v))return B;var Z=o[v],ie=this.getModeAt(i);if(typeof ie[v]=="string")Z[ie[v]]&&B.push(Z[ie[v]]);else if(ie[v])for(var ae=0;ae<ie[v].length;ae++){var he=Z[ie[v][ae]];he&&B.push(he)}else ie.helperType&&Z[ie.helperType]?B.push(Z[ie.helperType]):Z[ie.name]&&B.push(Z[ie.name]);for(var Xe=0;Xe<Z._global.length;Xe++){var nt=Z._global[Xe];nt.pred(ie,this)&&te(B,nt.val)==-1&&B.push(nt.val)}return B},getStateAfter:function(i,v){var B=this.doc;return i=ee(B,i==null?B.first+B.size-1:i),gn(this,i+1,v).state},cursorCoords:function(i,v){var B,Z=this.doc.sel.primary();return i==null?B=Z.head:typeof i=="object"?B=A(this.doc,i):B=i?Z.from():Z.to(),Qn(this,B,v||"page")},charCoords:function(i,v){return Pr(this,A(this.doc,i),v||"page")},coordsChar:function(i,v){return i=Vn(this,i,v||"page"),dr(this,i.left,i.top)},lineAtHeight:function(i,v){return i=Vn(this,{top:i,left:0},v||"page").top,Nr(this.doc,i+this.display.viewOffset)},heightAtLine:function(i,v,B){var Z=!1,ie;if(typeof i=="number"){var ae=this.doc.first+this.doc.size-1;i<this.doc.first?i=this.doc.first:i>ae&&(i=ae,Z=!0),ie=dn(this.doc,i)}else ie=i;return Er(this,ie,{top:0,left:0},v||"page",B||Z).top+(Z?this.doc.height-On(ie):0)},defaultTextHeight:function(){return Ar(this.display)},defaultCharWidth:function(){return Or(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(i,v,B,Z,ie){var ae=this.display;i=Qn(this,A(this.doc,i));var he=i.bottom,Xe=i.left;if(v.style.position="absolute",v.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(v),ae.sizer.appendChild(v),Z=="over")he=i.top;else if(Z=="above"||Z=="near"){var nt=Math.max(ae.wrapper.clientHeight,this.doc.height),xt=Math.max(ae.sizer.clientWidth,ae.lineSpace.clientWidth);(Z=="above"||i.bottom+v.offsetHeight>nt)&&i.top>v.offsetHeight?he=i.top-v.offsetHeight:i.bottom+v.offsetHeight<=nt&&(he=i.bottom),Xe+v.offsetWidth>xt&&(Xe=xt-v.offsetWidth)}v.style.top=he+"px",v.style.left=v.style.right="",ie=="right"?(Xe=ae.sizer.clientWidth-v.offsetWidth,v.style.right="0px"):(ie=="left"?Xe=0:ie=="middle"&&(Xe=(ae.sizer.clientWidth-v.offsetWidth)/2),v.style.left=Xe+"px"),B&&Ga(this,{left:Xe,top:he,right:Xe+v.offsetWidth,bottom:he+v.offsetHeight})},triggerOnKeyDown:Ai(Js),triggerOnKeyPress:Ai(qs),triggerOnKeyUp:Zs,triggerOnMouseDown:Ai(el),execCommand:function(i){if(Fo.hasOwnProperty(i))return Fo[i].call(null,this)},triggerElectric:Ai(function(i){sl(this,i)}),findPosH:function(i,v,B,Z){var ie=1;v<0&&(ie=-1,v=-v);for(var ae=A(this.doc,i),he=0;he<v&&!(ae=ps(this.doc,ae,ie,B,Z),ae.hitSide);++he);return ae},moveH:Ai(function(i,v){var B=this;this.extendSelectionsBy(function(Z){return B.display.shift||B.doc.extend||Z.empty()?ps(B.doc,Z.head,i,v,B.options.rtlMoveVisually):i<0?Z.from():Z.to()},We)}),deleteH:Ai(function(i,v){var B=this.doc.sel,Z=this.doc;B.somethingSelected()?Z.replaceSelection("",null,"+delete"):Co(this,function(ie){var ae=ps(Z,ie.head,i,v,!1);return i<0?{from:ae,to:ie.head}:{from:ie.head,to:ae}})}),findPosV:function(i,v,B,Z){var ie=1,ae=Z;v<0&&(ie=-1,v=-v);for(var he=A(this.doc,i),Xe=0;Xe<v;++Xe){var nt=Qn(this,he,"div");if(ae==null?ae=nt.left:nt.left=ae,he=dl(this,nt,ie,B),he.hitSide)break}return he},moveV:Ai(function(i,v){var B=this,Z=this.doc,ie=[],ae=!this.display.shift&&!Z.extend&&Z.sel.somethingSelected();if(Z.extendSelectionsBy(function(Xe){if(ae)return i<0?Xe.from():Xe.to();var nt=Qn(B,Xe.head,"div");Xe.goalColumn!=null&&(nt.left=Xe.goalColumn),ie.push(nt.left);var xt=dl(B,nt,i,v);return v=="page"&&Xe==Z.sel.primary()&&Va(B,Pr(B,xt,"div").top-nt.top),xt},We),ie.length)for(var he=0;he<Z.sel.ranges.length;he++)Z.sel.ranges[he].goalColumn=ie[he]}),findWordAt:function(i){var v=this.doc,B=dn(v,i.line).text,Z=i.ch,ie=i.ch;if(B){var ae=this.getHelper(i,"wordChars");(i.sticky=="before"||ie==B.length)&&Z?--Z:++ie;for(var he=B.charAt(Z),Xe=J(he,ae)?function(nt){return J(nt,ae)}:/\s/.test(he)?function(nt){return/\s/.test(nt)}:function(nt){return!/\s/.test(nt)&&!J(nt)};Z>0&&Xe(B.charAt(Z-1));)--Z;for(;ie<B.length&&Xe(B.charAt(ie));)++ie}return new zr(an(i.line,Z),an(i.line,ie))},toggleOverwrite:function(i){if(i!=null&&i==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?U(this.display.cursorDiv,"CodeMirror-overwrite"):b(this.display.cursorDiv,"CodeMirror-overwrite"),ct(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==F()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Ai(function(i,v){Ra(this,i,v)}),getScrollInfo:function(){var i=this.display.scroller;return{left:i.scrollLeft,top:i.scrollTop,height:i.scrollHeight-ot(this)-this.display.barHeight,width:i.scrollWidth-ot(this)-this.display.barWidth,clientHeight:le(this),clientWidth:Ne(this)}},scrollIntoView:Ai(function(i,v){i==null?(i={from:this.doc.sel.primary().head,to:null},v==null&&(v=this.options.cursorScrollMargin)):typeof i=="number"?i={from:an(i,0),to:null}:i.from==null&&(i={from:i,to:null}),i.to||(i.to=i.from),i.margin=v||0,i.from.line!=null?ho(this,i):Aa(this,i.from,i.to,i.margin)}),setSize:Ai(function(i,v){var B=this,Z=function(ae){return typeof ae=="number"||/^\d+$/.test(String(ae))?ae+"px":ae};i!=null&&(this.display.wrapper.style.width=Z(i)),v!=null&&(this.display.wrapper.style.height=Z(v)),this.options.lineWrapping&&qn(this);var ie=this.display.viewFrom;this.doc.iter(ie,this.display.viewTo,function(ae){if(ae.widgets){for(var he=0;he<ae.widgets.length;he++)if(ae.widgets[he].noHScroll){En(B,ie,"widget");break}}++ie}),this.curOp.forceUpdate=!0,ct(this,"refresh",this)}),operation:function(i){return Ki(this,i)},startOperation:function(){return ca(this)},endOperation:function(){return Ea(this)},refresh:Ai(function(){var i=this.display.cachedTextHeight;Xr(this),this.curOp.forceUpdate=!0,cr(this),Ra(this,this.doc.scrollLeft,this.doc.scrollTop),Za(this.display),(i==null||Math.abs(i-Ar(this.display))>.5||this.options.lineWrapping)&&wi(this),ct(this,"refresh",this)}),swapDoc:Ai(function(i){var v=this.doc;return v.cm=null,this.state.selectingText&&this.state.selectingText(),vs(this,i),cr(this),this.display.input.reset(),Ra(this,i.scrollLeft,i.scrollTop),this.curOp.forceScroll=!0,qt(this,"swapDoc",this,v),v}),phrase:function(i){var v=this.options.phrases;return v&&Object.prototype.hasOwnProperty.call(v,i)?v[i]:i},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}},Pe(e),e.registerHelper=function(i,v,B){o.hasOwnProperty(i)||(o[i]=e[i]={_global:[]}),o[i][v]=B},e.registerGlobalHelper=function(i,v,B,Z){e.registerHelper(i,v,Z),o[i]._global.push({pred:B,val:Z})}}function ps(e,t,o,i,v){var B=t,Z=o,ie=dn(e,t.line),ae=v&&e.direction=="rtl"?-o:o;function he(){var Hn=t.line+ae;return Hn<e.first||Hn>=e.first+e.size?!1:(t=new an(Hn,t.ch,t.sticky),ie=dn(e,Hn))}function Xe(Hn){var Mn;if(i=="codepoint"){var Yn=ie.text.charCodeAt(t.ch+(i>0?0:-1));isNaN(Yn)?Mn=null:Mn=new an(t.line,Math.max(0,Math.min(ie.text.length,t.ch+o*(Yn>=55296&&Yn<56320?2:1))),-o)}else v?Mn=kl(e.cm,ie,t,o):Mn=ss(ie,t,o);if(Mn==null)if(!Hn&&he())t=ls(v,e.cm,ie,t.line,ae);else return!1;else t=Mn;return!0}if(i=="char"||i=="codepoint")Xe();else if(i=="column")Xe(!0);else if(i=="word"||i=="group")for(var nt=null,xt=i=="group",yt=e.cm&&e.cm.getHelper(t,"wordChars"),Yt=!0;!(o<0&&!Xe(!Yt));Yt=!1){var cn=ie.text.charAt(t.ch)||`
`,Cn=J(cn,yt)?"w":xt&&cn==`
`?"n":!xt||/\s/.test(cn)?null:"p";if(xt&&!Yt&&!Cn&&(Cn="s"),nt&&nt!=Cn){o<0&&(o=1,Xe(),t.sticky="after");break}if(Cn&&(nt=Cn),o>0&&!Xe(!Yt))break}var Ln=Xo(e,t,B,Z,!0);return fi(B,Ln)&&(Ln.hitSide=!0),Ln}function dl(e,t,o,i){var v=e.doc,B=t.left,Z;if(i=="page"){var ie=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ae=Math.max(ie-.5*Ar(e.display),3);Z=(o>0?t.bottom:t.top)+o*ae}else i=="line"&&(Z=o>0?t.bottom+3:t.top-3);for(var he;!(he=dr(e,B,Z),!he.outside);){if(o<0?Z<=0:Z>=v.height){he.hitSide=!0;break}Z+=o*5}return he}var ni=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new X,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};ni.prototype.init=function(e){var t=this,o=this,i=o.cm,v=o.div=e.lineDiv;ul(v,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize);function B(ie){for(var ae=ie.target;ae;ae=ae.parentNode){if(ae==v)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ae.className))break}return!1}Ze(v,"paste",function(ie){if(!B(ie)||wt(i,ie)||ol(ie,i))return;O<=11&&setTimeout(vi(i,function(){return t.updateFromDOM()}),20)}),Ze(v,"compositionstart",function(ie){t.composing={data:ie.data,done:!1}}),Ze(v,"compositionupdate",function(ie){t.composing||(t.composing={data:ie.data,done:!1})}),Ze(v,"compositionend",function(ie){t.composing&&(ie.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ze(v,"touchstart",function(){return o.forceCompositionEnd()}),Ze(v,"input",function(){t.composing||t.readFromDOMSoon()});function Z(ie){if(!B(ie)||wt(i,ie))return;if(i.somethingSelected())es({lineWise:!1,text:i.getSelections()}),ie.type=="cut"&&i.replaceSelection("",null,"cut");else if(i.options.lineWiseCopyCut){var ae=ll(i);es({lineWise:!0,text:ae.text}),ie.type=="cut"&&i.operation(function(){i.setSelections(ae.ranges,0,Ee),i.replaceSelection("",null,"cut")})}else return;if(ie.clipboardData){ie.clipboardData.clearData();var he=Ca.text.join(`
`);if(ie.clipboardData.setData("Text",he),ie.clipboardData.getData("Text")==he){ie.preventDefault();return}}var Xe=cl(),nt=Xe.firstChild;i.display.lineSpace.insertBefore(Xe,i.display.lineSpace.firstChild),nt.value=Ca.text.join(`
`);var xt=document.activeElement;z(nt),setTimeout(function(){i.display.lineSpace.removeChild(Xe),xt.focus(),xt==v&&o.showPrimarySelection()},50)}Ze(v,"copy",Z),Ze(v,"cut",Z)},ni.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},ni.prototype.prepareSelection=function(){var e=ji(this.cm,!1);return e.focus=document.activeElement==this.div,e},ni.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},ni.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},ni.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,o=t.doc.sel.primary(),i=o.from(),v=o.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||v.line<t.display.viewFrom){e.removeAllRanges();return}var B=ts(t,e.anchorNode,e.anchorOffset),Z=ts(t,e.focusNode,e.focusOffset);if(B&&!B.bad&&Z&&!Z.bad&&Xn(ii(B,Z),i)==0&&Xn(ri(B,Z),v)==0)return;var ie=t.display.view,ae=i.line>=t.display.viewFrom&&hl(t,i)||{node:ie[0].measure.map[2],offset:0},he=v.line<t.display.viewTo&&hl(t,v);if(!he){var Xe=ie[ie.length-1].measure,nt=Xe.maps?Xe.maps[Xe.maps.length-1]:Xe.map;he={node:nt[nt.length-1],offset:nt[nt.length-2]-nt[nt.length-3]}}if(!ae||!he){e.removeAllRanges();return}var xt=e.rangeCount&&e.getRangeAt(0),yt;try{yt=E(ae.node,ae.offset,he.offset,he.node)}catch(Yt){}yt&&(!j&&t.state.focused?(e.collapse(ae.node,ae.offset),yt.collapsed||(e.removeAllRanges(),e.addRange(yt))):(e.removeAllRanges(),e.addRange(yt)),xt&&e.anchorNode==null?e.addRange(xt):j&&this.startGracePeriod()),this.rememberSelection()},ni.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)},ni.prototype.showMultipleSelections=function(e){f(this.cm.display.cursorDiv,e.cursors),f(this.cm.display.selectionDiv,e.selection)},ni.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},ni.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return T(this.div,t)},ni.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},ni.prototype.blur=function(){this.div.blur()},ni.prototype.getField=function(){return this.div},ni.prototype.supportsTouch=function(){return!0},ni.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Ki(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},ni.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},ni.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(l&&p&&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 o=ts(t,e.anchorNode,e.anchorOffset),i=ts(t,e.focusNode,e.focusOffset);o&&i&&Ki(t,function(){Xi(t.doc,kn(o,i),Ee),(o.bad||i.bad)&&(t.curOp.selectionChanged=!0)})},ni.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,o=e.doc.sel.primary(),i=o.from(),v=o.to();if(i.ch==0&&i.line>e.firstLine()&&(i=an(i.line-1,dn(e.doc,i.line-1).length)),v.ch==dn(e.doc,v.line).text.length&&v.line<e.lastLine()&&(v=an(v.line+1,0)),i.line<t.viewFrom||v.line>t.viewTo-1)return!1;var B,Z,ie;i.line==t.viewFrom||(B=ei(e,i.line))==0?(Z=rr(t.view[0].line),ie=t.view[0].node):(Z=rr(t.view[B].line),ie=t.view[B-1].node.nextSibling);var ae=ei(e,v.line),he,Xe;if(ae==t.view.length-1?(he=t.viewTo-1,Xe=t.lineDiv.lastChild):(he=rr(t.view[ae+1].line)-1,Xe=t.view[ae+1].node.previousSibling),!ie)return!1;for(var nt=e.doc.splitLines(tu(e,ie,Xe,Z,he)),xt=fr(e.doc,an(Z,0),an(he,dn(e.doc,he).text.length));nt.length>1&&xt.length>1;)if(se(nt)==se(xt))nt.pop(),xt.pop(),he--;else if(nt[0]==xt[0])nt.shift(),xt.shift(),Z++;else break;for(var yt=0,Yt=0,cn=nt[0],Cn=xt[0],Ln=Math.min(cn.length,Cn.length);yt<Ln&&cn.charCodeAt(yt)==Cn.charCodeAt(yt);)++yt;for(var Hn=se(nt),Mn=se(xt),Yn=Math.min(Hn.length-(nt.length==1?yt:0),Mn.length-(xt.length==1?yt:0));Yt<Yn&&Hn.charCodeAt(Hn.length-Yt-1)==Mn.charCodeAt(Mn.length-Yt-1);)++Yt;if(nt.length==1&&xt.length==1&&Z==i.line)for(;yt&&yt>i.ch&&Hn.charCodeAt(Hn.length-Yt-1)==Mn.charCodeAt(Mn.length-Yt-1);)yt--,Yt++;nt[nt.length-1]=Hn.slice(0,Hn.length-Yt).replace(/^\u200b+/,""),nt[0]=nt[0].slice(yt).replace(/\u200b+$/,"");var vr=an(Z,yt),sr=an(he,xt.length?se(xt).length-Yt:0);if(nt.length>1||nt[0]||Xn(vr,sr))return bo(e.doc,nt,vr,sr,"+input"),!0},ni.prototype.ensurePolled=function(){this.forceCompositionEnd()},ni.prototype.reset=function(){this.forceCompositionEnd()},ni.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},ni.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)},ni.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Ki(this.cm,function(){return Xr(e.cm)})},ni.prototype.setUneditable=function(e){e.contentEditable="false"},ni.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||vi(this.cm,fs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},ni.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},ni.prototype.onContextMenu=function(){},ni.prototype.resetPosition=function(){},ni.prototype.needsContentAttribute=!0;function hl(e,t){var o=dt(e,t.line);if(!o||o.hidden)return null;var i=dn(e.doc,t.line),v=fe(o,i,t.line),B=pn(i,e.doc.direction),Z="left";if(B){var ie=lt(B,t.ch);Z=ie%2?"right":"left"}var ae=zt(v.map,t.ch,Z);return ae.offset=ae.collapse=="right"?ae.end:ae.start,ae}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function wo(e,t){return t&&(e.bad=!0),e}function tu(e,t,o,i,v){var B="",Z=!1,ie=e.doc.lineSeparator(),ae=!1;function he(yt){return function(Yt){return Yt.id==yt}}function Xe(){Z&&(B+=ie,ae&&(B+=ie),Z=ae=!1)}function nt(yt){yt&&(Xe(),B+=yt)}function xt(yt){if(yt.nodeType==1){var Yt=yt.getAttribute("cm-text");if(Yt){nt(Yt);return}var cn=yt.getAttribute("cm-marker"),Cn;if(cn){var Ln=e.findMarks(an(i,0),an(v+1,0),he(+cn));Ln.length&&(Cn=Ln[0].find(0))&&nt(fr(e.doc,Cn.from,Cn.to).join(ie));return}if(yt.getAttribute("contenteditable")=="false")return;var Hn=/^(pre|div|p|li|table|br)$/i.test(yt.nodeName);if(!/^br$/i.test(yt.nodeName)&&yt.textContent.length==0)return;Hn&&Xe();for(var Mn=0;Mn<yt.childNodes.length;Mn++)xt(yt.childNodes[Mn]);/^(pre|p)$/i.test(yt.nodeName)&&(ae=!0),Hn&&(Z=!0)}else yt.nodeType==3&&nt(yt.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(xt(t),t==o);)t=t.nextSibling,ae=!1;return B}function ts(e,t,o){var i;if(t==e.display.lineDiv){if(i=e.display.lineDiv.childNodes[o],!i)return wo(e.clipPos(an(e.display.viewTo-1)),!0);t=null,o=0}else for(i=t;;i=i.parentNode){if(!i||i==e.display.lineDiv)return null;if(i.parentNode&&i.parentNode==e.display.lineDiv)break}for(var v=0;v<e.display.view.length;v++){var B=e.display.view[v];if(B.node==i)return nu(B,t,o)}}function nu(e,t,o){var i=e.text.firstChild,v=!1;if(!t||!T(i,t))return wo(an(rr(e.line),0),!0);if(t==i&&(v=!0,t=i.childNodes[o],o=0,!t)){var B=e.rest?se(e.rest):e.line;return wo(an(rr(B),B.text.length),v)}var Z=t.nodeType==3?t:null,ie=t;for(!Z&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(Z=t.firstChild,o&&(o=Z.nodeValue.length));ie.parentNode!=i;)ie=ie.parentNode;var ae=e.measure,he=ae.maps;function Xe(Cn,Ln,Hn){for(var Mn=-1;Mn<(he?he.length:0);Mn++)for(var Yn=Mn<0?ae.map:he[Mn],vr=0;vr<Yn.length;vr+=3){var sr=Yn[vr+2];if(sr==Cn||sr==Ln){var Ir=rr(Mn<0?e.line:e.rest[Mn]),ci=Yn[vr]+Hn;return(Hn<0||sr!=Cn)&&(ci=Yn[vr+(Hn?1:0)]),an(Ir,ci)}}}var nt=Xe(Z,ie,o);if(nt)return wo(nt,v);for(var xt=ie.nextSibling,yt=Z?Z.nodeValue.length-o:0;xt;xt=xt.nextSibling){if(nt=Xe(xt,xt.firstChild,0),nt)return wo(an(nt.line,nt.ch-yt),v);yt+=xt.textContent.length}for(var Yt=ie.previousSibling,cn=o;Yt;Yt=Yt.previousSibling){if(nt=Xe(Yt,Yt.firstChild,-1),nt)return wo(an(nt.line,nt.ch+cn),v);cn+=Yt.textContent.length}}var Si=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new X,this.hasSelection=!1,this.composing=null};Si.prototype.init=function(e){var t=this,o=this,i=this.cm;this.createField(e);var v=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),a&&(v.style.width="0px"),Ze(v,"input",function(){H&&O>=9&&t.hasSelection&&(t.hasSelection=null),o.poll()}),Ze(v,"paste",function(Z){if(wt(i,Z)||ol(Z,i))return;i.state.pasteIncoming=+new Date,o.fastPoll()});function B(Z){if(wt(i,Z))return;if(i.somethingSelected())es({lineWise:!1,text:i.getSelections()});else if(i.options.lineWiseCopyCut){var ie=ll(i);es({lineWise:!0,text:ie.text}),Z.type=="cut"?i.setSelections(ie.ranges,null,Ee):(o.prevInput="",v.value=ie.text.join(`
`),z(v))}else return;Z.type=="cut"&&(i.state.cutIncoming=+new Date)}Ze(v,"cut",B),Ze(v,"copy",B),Ze(e.scroller,"paste",function(Z){if(Fr(e,Z)||wt(i,Z))return;if(!v.dispatchEvent){i.state.pasteIncoming=+new Date,o.focus();return}var ie=new Event("paste");ie.clipboardData=Z.clipboardData,v.dispatchEvent(ie)}),Ze(e.lineSpace,"selectstart",function(Z){Fr(e,Z)||ce(Z)}),Ze(v,"compositionstart",function(){var Z=i.getCursor("from");o.composing&&o.composing.range.clear(),o.composing={start:Z,range:i.markText(Z,i.getCursor("to"),{className:"CodeMirror-composing"})}}),Ze(v,"compositionend",function(){o.composing&&(o.poll(),o.composing.range.clear(),o.composing=null)})},Si.prototype.createField=function(e){this.wrapper=cl(),this.textarea=this.wrapper.firstChild},Si.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Si.prototype.prepareSelection=function(){var e=this.cm,t=e.display,o=e.doc,i=ji(e);if(e.options.moveInputWithCursor){var v=Qn(e,o.sel.primary().head,"div"),B=t.wrapper.getBoundingClientRect(),Z=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,v.top+Z.top-B.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,v.left+Z.left-B.left))}return i},Si.prototype.showSelection=function(e){var t=this.cm,o=t.display;f(o.cursorDiv,e.cursors),f(o.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Si.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var o=t.getSelection();this.textarea.value=o,t.state.focused&&z(this.textarea),H&&O>=9&&(this.hasSelection=o)}else e||(this.prevInput=this.textarea.value="",H&&O>=9&&(this.hasSelection=null))},Si.prototype.getField=function(){return this.textarea},Si.prototype.supportsTouch=function(){return!1},Si.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!s||F()!=this.textarea))try{this.textarea.focus()}catch(e){}},Si.prototype.blur=function(){this.textarea.blur()},Si.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Si.prototype.receivedFocus=function(){this.slowPoll()},Si.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()})},Si.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function o(){var i=t.poll();!i&&!e?(e=!0,t.polling.set(60,o)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,o)},Si.prototype.poll=function(){var e=this,t=this.cm,o=this.textarea,i=this.prevInput;if(this.contextMenuPending||!t.state.focused||Rt(o)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var v=o.value;if(v==i&&!t.somethingSelected())return!1;if(H&&O>=9&&this.hasSelection===v||u&&/[\uf700-\uf7ff]/.test(v))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var B=v.charCodeAt(0);if(B==8203&&!i&&(i="\u200B"),B==8666)return this.reset(),this.cm.execCommand("undo")}for(var Z=0,ie=Math.min(i.length,v.length);Z<ie&&i.charCodeAt(Z)==v.charCodeAt(Z);)++Z;return Ki(t,function(){fs(t,v.slice(Z),i.length-Z,null,e.composing?"*compose":null),v.length>1e3||v.indexOf(`
`)>-1?o.value=e.prevInput="":e.prevInput=v,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Si.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Si.prototype.onKeyPress=function(){H&&O>=9&&(this.hasSelection=null),this.fastPoll()},Si.prototype.onContextMenu=function(e){var t=this,o=t.cm,i=o.display,v=t.textarea;t.contextMenuPending&&t.contextMenuPending();var B=gi(o,e),Z=i.scroller.scrollTop;if(!B||m)return;var ie=o.options.resetSelectionOnContextMenu;ie&&o.doc.sel.contains(B)==-1&&vi(o,Xi)(o.doc,kn(B),Ee);var ae=v.style.cssText,he=t.wrapper.style.cssText,Xe=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",v.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: `+(H?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var nt;I&&(nt=window.scrollY),i.input.focus(),I&&window.scrollTo(null,nt),i.input.reset(),o.somethingSelected()||(v.value=t.prevInput=" "),t.contextMenuPending=yt,i.selForContextMenu=o.doc.sel,clearTimeout(i.detectingSelectAll);function xt(){if(v.selectionStart!=null){var cn=o.somethingSelected(),Cn="\u200B"+(cn?v.value:"");v.value="\u21DA",v.value=Cn,t.prevInput=cn?"":"\u200B",v.selectionStart=1,v.selectionEnd=Cn.length,i.selForContextMenu=o.doc.sel}}function yt(){if(t.contextMenuPending!=yt)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=he,v.style.cssText=ae,H&&O<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=Z),v.selectionStart!=null){(!H||H&&O<9)&&xt();var cn=0,Cn=function(){i.selForContextMenu==o.doc.sel&&v.selectionStart==0&&v.selectionEnd>0&&t.prevInput=="\u200B"?vi(o,Ds)(o):cn++<10?i.detectingSelectAll=setTimeout(Cn,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(Cn,200)}}if(H&&O>=9&&xt(),D){je(e);var Yt=function(){Mt(window,"mouseup",Yt),setTimeout(yt,20)};Ze(window,"mouseup",Yt)}else setTimeout(yt,50)},Si.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Si.prototype.setUneditable=function(){},Si.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?y(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var o=F();t.autofocus=o==e||e.getAttribute("autofocus")!=null&&o==document.body}function i(){e.value=ie.getValue()}var v;if(e.form&&(Ze(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var B=e.form;v=B.submit;try{var Z=B.submit=function(){i(),B.submit=v,B.submit(),B.submit=Z}}catch(ae){}}t.finishInit=function(ae){ae.save=i,ae.getTextArea=function(){return e},ae.toTextArea=function(){ae.toTextArea=isNaN,i(),e.parentNode.removeChild(ae.getWrapperElement()),e.style.display="",e.form&&(Mt(e.form,"submit",i),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=v))}},e.style.display="none";var ie=yi(function(ae){return e.parentNode.insertBefore(ae,e.nextSibling)},t);return ie}function iu(e){e.off=Mt,e.on=Ze,e.wheelEventPixels=Ba,e.Doc=na,e.splitLines=Tt,e.countColumn=W,e.findColumn=He,e.isWordChar=$,e.Pass=Ie,e.signal=ct,e.Line=$t,e.changeEnd=Jn,e.scrollbarModel=$a,e.Pos=an,e.cmpPos=Xn,e.modes=kt,e.mimeModes=vt,e.resolveMode=Le,e.getMode=tt,e.modeExtensions=Lt,e.extendMode=Ht,e.copyState=ln,e.startState=ir,e.innerMode=hn,e.commands=Fo,e.keyMap=Ka,e.keyName=Vs,e.isModifierKey=zs,e.lookupKey=xo,e.normalizeKeyMap=Ml,e.StringStream=Un,e.SharedTextMarker=No,e.TextMarker=qa,e.LineWidget=Io,e.e_preventDefault=ce,e.e_stopPropagation=de,e.e_stop=je,e.addClass=U,e.contains=T,e.rmClass=b,e.keyNames=eo}$l(yi),ql(yi);var au="iter insert remove copy getEditor constructor".split(" ");for(var ns in na.prototype)na.prototype.hasOwnProperty(ns)&&te(au,ns)<0&&(yi.prototype[ns]=function(e){return function(){return e.apply(this.doc,arguments)}}(na.prototype[ns]));return Pe(na),yi.inputStyles={textarea:Si,contenteditable:ni},yi.defineMode=function(e){!yi.defaults.mode&&e!="null"&&(yi.defaults.mode=e),Qt.apply(this,arguments)},yi.defineMIME=Jt,yi.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),yi.defineMIME("text/plain","null"),yi.defineExtension=function(e,t){yi.prototype[e]=t},yi.defineDocExtension=function(e,t){na.prototype[e]=t},yi.fromTextArea=ru,iu(yi),yi.version="5.58.2",yi})},WaYH:function(Gt,et,k){"use strict";var re=k("rePB"),Y=k("Ff2n"),j=k("VTBJ"),G=k("1OyB"),L=k("vuIU"),P=k("JX7q"),H=k("Ji7U"),O=k("LK+K"),I=k("q1tI"),x=k("TSYQ"),p=k.n(x),m=k("sboe"),h=k("OZM5"),r=function(D){var S=D.prefixCls,b=D.level,_=D.isStart,f=D.isEnd;if(!b)return null;for(var d="".concat(S,"-indent-unit"),g=[],E=0;E<b;E+=1){var T;g.push(I.createElement("span",{key:E,className:p()(d,(T={},Object(re.a)(T,"".concat(d,"-start"),_[E+1]),Object(re.a)(T,"".concat(d,"-end"),f[E+1]),Object(re.a)(T,"".concat(d,"-end-first-level"),!E&&f[0]),T))}))}return I.createElement("span",{"aria-hidden":"true",className:"".concat(S,"-indent")},g)},n=r,a=k("815F"),l="open",s="close",u="---",c=function(C){Object(H.a)(S,C);var D=Object(O.a)(S);function S(){var b;return Object(G.a)(this,S),b=D.apply(this,arguments),b.state={dragNodeHighlight:!1},b.onSelectorClick=function(_){var f=b.props.context.onNodeClick;f(_,Object(a.b)(b.props)),b.isSelectable()?b.onSelect(_):b.onCheck(_)},b.onSelectorDoubleClick=function(_){var f=b.props.context.onNodeDoubleClick;f(_,Object(a.b)(b.props))},b.onSelect=function(_){if(b.isDisabled())return;var f=b.props.context.onNodeSelect;_.preventDefault(),f(_,Object(a.b)(b.props))},b.onCheck=function(_){if(b.isDisabled())return;var f=b.props,d=f.disableCheckbox,g=f.checked,E=b.props.context.onNodeCheck;if(!b.isCheckable()||d)return;_.preventDefault();var T=!g;E(_,Object(a.b)(b.props),T)},b.onMouseEnter=function(_){var f=b.props.context.onNodeMouseEnter;f(_,Object(a.b)(b.props))},b.onMouseLeave=function(_){var f=b.props.context.onNodeMouseLeave;f(_,Object(a.b)(b.props))},b.onContextMenu=function(_){var f=b.props.context.onNodeContextMenu;f(_,Object(a.b)(b.props))},b.onDragStart=function(_){var f=b.props.context.onNodeDragStart;_.stopPropagation(),b.setState({dragNodeHighlight:!0}),f(_,Object(P.a)(b));try{_.dataTransfer.setData("text/plain","")}catch(d){}},b.onDragEnter=function(_){var f=b.props.context.onNodeDragEnter;_.preventDefault(),_.stopPropagation(),f(_,Object(P.a)(b))},b.onDragOver=function(_){var f=b.props.context.onNodeDragOver;_.preventDefault(),_.stopPropagation(),f(_,Object(P.a)(b))},b.onDragLeave=function(_){var f=b.props.context.onNodeDragLeave;_.stopPropagation(),f(_,Object(P.a)(b))},b.onDragEnd=function(_){var f=b.props.context.onNodeDragEnd;_.stopPropagation(),b.setState({dragNodeHighlight:!1}),f(_,Object(P.a)(b))},b.onDrop=function(_){var f=b.props.context.onNodeDrop;_.preventDefault(),_.stopPropagation(),b.setState({dragNodeHighlight:!1}),f(_,Object(P.a)(b))},b.onExpand=function(_){var f=b.props.context.onNodeExpand;f(_,Object(a.b)(b.props))},b.setSelectHandle=function(_){b.selectHandle=_},b.getNodeState=function(){var _=b.props.expanded;return b.isLeaf()?null:_?l:s},b.hasChildren=function(){var _=b.props.eventKey,f=b.props.context.keyEntities,d=f[_]||{},g=d.children;return!!(g||[]).length},b.isLeaf=function(){var _=b.props,f=_.isLeaf,d=_.loaded,g=b.props.context.loadData,E=b.hasChildren();return f===!1?!1:f||!g&&!E||g&&d&&!E},b.isDisabled=function(){var _=b.props.disabled,f=b.props.context.disabled;return!!(f||_)},b.isCheckable=function(){var _=b.props.checkable,f=b.props.context.checkable;return!f||_===!1?!1:f},b.syncLoadData=function(_){var f=_.expanded,d=_.loading,g=_.loaded,E=b.props.context,T=E.loadData,F=E.onNodeLoad;if(d)return;T&&f&&!b.isLeaf()&&(!b.hasChildren()&&!g&&F(Object(a.b)(b.props)))},b.renderSwitcher=function(){var _=b.props,f=_.expanded,d=_.switcherIcon,g=b.props.context,E=g.prefixCls,T=g.switcherIcon,F=d||T;if(b.isLeaf())return I.createElement("span",{className:p()("".concat(E,"-switcher"),"".concat(E,"-switcher-noop"))},typeof F=="function"?F(Object(j.a)(Object(j.a)({},b.props),{},{isLeaf:!0})):F);var U=p()("".concat(E,"-switcher"),"".concat(E,"-switcher_").concat(f?l:s));return I.createElement("span",{onClick:b.onExpand,className:U},typeof F=="function"?F(Object(j.a)(Object(j.a)({},b.props),{},{isLeaf:!1})):F)},b.renderCheckbox=function(){var _=b.props,f=_.checked,d=_.halfChecked,g=_.disableCheckbox,E=b.props.context.prefixCls,T=b.isDisabled(),F=b.isCheckable();if(!F)return null;var U=typeof F!="boolean"?F:null;return I.createElement("span",{className:p()("".concat(E,"-checkbox"),f&&"".concat(E,"-checkbox-checked"),!f&&d&&"".concat(E,"-checkbox-indeterminate"),(T||g)&&"".concat(E,"-checkbox-disabled")),onClick:b.onCheck},U)},b.renderIcon=function(){var _=b.props.loading,f=b.props.context.prefixCls;return I.createElement("span",{className:p()("".concat(f,"-iconEle"),"".concat(f,"-icon__").concat(b.getNodeState()||"docu"),_&&"".concat(f,"-icon_loading"))})},b.renderSelector=function(){var _=b.state.dragNodeHighlight,f=b.props,d=f.title,g=f.selected,E=f.icon,T=f.loading,F=f.data,U=b.props.context,K=U.prefixCls,z=U.showIcon,M=U.icon,y=U.draggable,W=U.loadData,X=U.titleRender,te=b.isDisabled(),pe="".concat(K,"-node-content-wrapper"),Ie;if(z){var Ee=E||M;Ie=Ee?I.createElement("span",{className:p()("".concat(K,"-iconEle"),"".concat(K,"-icon__customize"))},typeof Ee=="function"?Ee(b.props):Ee):b.renderIcon()}else W&&T&&(Ie=b.renderIcon());var Te;typeof d=="function"?Te=d(F):X?Te=X(F):Te=d;var We=I.createElement("span",{className:"".concat(K,"-title")},Te);return I.createElement("span",{ref:b.setSelectHandle,title:typeof d=="string"?d:"",className:p()("".concat(pe),"".concat(pe,"-").concat(b.getNodeState()||"normal"),!te&&(g||_)&&"".concat(K,"-node-selected"),!te&&y&&"draggable"),draggable:!te&&y||void 0,"aria-grabbed":!te&&y||void 0,onMouseEnter:b.onMouseEnter,onMouseLeave:b.onMouseLeave,onContextMenu:b.onContextMenu,onClick:b.onSelectorClick,onDoubleClick:b.onSelectorDoubleClick,onDragStart:y?b.onDragStart:void 0},Ie,We)},b}return Object(L.a)(S,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var _=this.props.selectable,f=this.props.context.selectable;return typeof _=="boolean"?_:f}},{key:"render",value:function(){var _,f=this.props,d=f.eventKey,g=f.className,E=f.style,T=f.dragOver,F=f.dragOverGapTop,U=f.dragOverGapBottom,K=f.isLeaf,z=f.isStart,M=f.isEnd,y=f.expanded,W=f.selected,X=f.checked,te=f.halfChecked,pe=f.loading,Ie=f.domRef,Ee=f.active,Te=f.onMouseMove,We=Object(Y.a)(f,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),He=this.props.context,Ce=He.prefixCls,ue=He.filterTreeNode,se=He.draggable,we=He.keyEntities,ge=this.isDisabled(),Ke=Object(h.f)(We),st=we[d]||{},ne=st.level,$=M[M.length-1];return I.createElement("div",Object.assign({ref:Ie,className:p()(g,"".concat(Ce,"-treenode"),(_={},Object(re.a)(_,"".concat(Ce,"-treenode-disabled"),ge),Object(re.a)(_,"".concat(Ce,"-treenode-switcher-").concat(y?"open":"close"),!K),Object(re.a)(_,"".concat(Ce,"-treenode-checkbox-checked"),X),Object(re.a)(_,"".concat(Ce,"-treenode-checkbox-indeterminate"),te),Object(re.a)(_,"".concat(Ce,"-treenode-selected"),W),Object(re.a)(_,"".concat(Ce,"-treenode-loading"),pe),Object(re.a)(_,"".concat(Ce,"-treenode-active"),Ee),Object(re.a)(_,"".concat(Ce,"-treenode-leaf-last"),$),Object(re.a)(_,"drag-over",!ge&&T),Object(re.a)(_,"drag-over-gap-top",!ge&&F),Object(re.a)(_,"drag-over-gap-bottom",!ge&&U),Object(re.a)(_,"filter-node",ue&&ue(Object(a.b)(this.props))),_)),style:E,onDragEnter:se?this.onDragEnter:void 0,onDragOver:se?this.onDragOver:void 0,onDragLeave:se?this.onDragLeave:void 0,onDrop:se?this.onDrop:void 0,onDragEnd:se?this.onDragEnd:void 0,onMouseMove:Te},Ke),I.createElement(n,{prefixCls:Ce,level:ne,isStart:z,isEnd:M}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),S}(I.Component),R=function(D){return I.createElement(m.a.Consumer,null,function(S){return I.createElement(c,Object.assign({},D,{context:S}))})};R.displayName="TreeNode",R.defaultProps={title:u},R.isTreeNode=1;var w=et.a=R},Y1PL:function(Gt,et,k){"use strict";k.r(et),k.d(et,"ResizableTextArea",function(){return te});var re=k("wx14"),Y=k("1OyB"),j=k("vuIU"),G=k("Ji7U"),L=k("LK+K"),P=k("q1tI"),H=k("VTBJ"),O=k("rePB"),I=k("Zm9Q"),x=k("Kwbf"),p=k("c+Xe"),m=k("m+aA"),h=k("bdgK"),r=new Map;function n(Ee){Ee.forEach(function(Te){var We,He=Te.target;(We=r.get(He))===null||We===void 0||We.forEach(function(Ce){return Ce(He)})})}var a=new h.default(n),l=null,s=null;function u(Ee,Te){r.has(Ee)||(r.set(Ee,new Set),a.observe(Ee)),r.get(Ee).add(Te)}function c(Ee,Te){r.has(Ee)&&(r.get(Ee).delete(Te),r.get(Ee).size||(a.unobserve(Ee),r.delete(Ee)))}var R=function(Ee){Object(G.a)(We,Ee);var Te=Object(L.a)(We);function We(){return Object(Y.a)(this,We),Te.apply(this,arguments)}return Object(j.a)(We,[{key:"render",value:function(){return this.props.children}}]),We}(P.Component),w=P.createContext(null);function C(Ee){var Te=Ee.children,We=Ee.onBatchResize,He=P.useRef(0),Ce=P.useRef([]),ue=P.useContext(w),se=P.useCallback(function(we,ge,Ke){He.current+=1;var st=He.current;Ce.current.push({size:we,element:ge,data:Ke}),Promise.resolve().then(function(){st===He.current&&(We==null||We(Ce.current),Ce.current=[])}),ue==null||ue(we,ge,Ke)},[We,ue]);return P.createElement(w.Provider,{value:se},Te)}function D(Ee){var Te=Ee.children,We=Ee.disabled,He=P.useRef(null),Ce=P.useRef(null),ue=P.useContext(w),se=P.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),we=P.isValidElement(Te)&&Object(p.c)(Te),ge=we?Te.ref:null,Ke=P.useMemo(function(){return Object(p.a)(ge,He)},[ge,He]),st=P.useRef(Ee);st.current=Ee;var ne=P.useCallback(function($){var J=st.current,me=J.onResize,xe=J.data,ke=$.getBoundingClientRect(),$e=ke.width,Pt=ke.height,Xt=$.offsetWidth,Bt=$.offsetHeight,lt=Math.floor($e),jt=Math.floor(Pt);if(se.current.width!==lt||se.current.height!==jt||se.current.offsetWidth!==Xt||se.current.offsetHeight!==Bt){var pn={width:lt,height:jt,offsetWidth:Xt,offsetHeight:Bt};se.current=pn;var it=Xt===Math.round($e)?$e:Xt,Ze=Bt===Math.round(Pt)?Pt:Bt,bt=Object(H.a)(Object(H.a)({},pn),{},{offsetWidth:it,offsetHeight:Ze});ue==null||ue(bt,$,xe),me&&Promise.resolve().then(function(){me(bt,$)})}},[]);return P.useEffect(function(){var $=Object(m.a)(He.current)||Object(m.a)(Ce.current);return $&&!We&&u($,ne),function(){return c($,ne)}},[He.current,We]),P.createElement(R,{ref:Ce},we?P.cloneElement(Te,{ref:Ke}):Te)}var S="rc-observer-key";function b(Ee){var Te=Ee.children,We=Object(I.a)(Te);return We.map(function(He,Ce){var ue=(He==null?void 0:He.key)||"".concat(S,"-").concat(Ce);return P.createElement(D,Object(re.a)({},Ee,{key:ue}),He)})}b.Collection=C;var _=b,f=k("bT9E"),d=k("TSYQ"),g=k.n(d),E=`
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
`,T=["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"],F={},U;function K(Ee){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,We=Ee.getAttribute("id")||Ee.getAttribute("data-reactid")||Ee.getAttribute("name");if(Te&&F[We])return F[We];var He=window.getComputedStyle(Ee),Ce=He.getPropertyValue("box-sizing")||He.getPropertyValue("-moz-box-sizing")||He.getPropertyValue("-webkit-box-sizing"),ue=parseFloat(He.getPropertyValue("padding-bottom"))+parseFloat(He.getPropertyValue("padding-top")),se=parseFloat(He.getPropertyValue("border-bottom-width"))+parseFloat(He.getPropertyValue("border-top-width")),we=T.map(function(Ke){return"".concat(Ke,":").concat(He.getPropertyValue(Ke))}).join(";"),ge={sizingStyle:we,paddingSize:ue,borderSize:se,boxSizing:Ce};return Te&&We&&(F[We]=ge),ge}function z(Ee){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,We=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,He=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;U||(U=document.createElement("textarea"),U.setAttribute("tab-index","-1"),U.setAttribute("aria-hidden","true"),document.body.appendChild(U)),Ee.getAttribute("wrap")?U.setAttribute("wrap",Ee.getAttribute("wrap")):U.removeAttribute("wrap");var Ce=K(Ee,Te),ue=Ce.paddingSize,se=Ce.borderSize,we=Ce.boxSizing,ge=Ce.sizingStyle;U.setAttribute("style","".concat(ge,";").concat(E)),U.value=Ee.value||Ee.placeholder||"";var Ke=Number.MIN_SAFE_INTEGER,st=Number.MAX_SAFE_INTEGER,ne=U.scrollHeight,$;if(we==="border-box"?ne+=se:we==="content-box"&&(ne-=ue),We!==null||He!==null){U.value=" ";var J=U.scrollHeight-ue;We!==null&&(Ke=J*We,we==="border-box"&&(Ke=Ke+ue+se),ne=Math.max(Ke,ne)),He!==null&&(st=J*He,we==="border-box"&&(st=st+ue+se),$=ne>st?"":"hidden",ne=Math.min(st,ne))}return{height:ne,minHeight:Ke,maxHeight:st,overflowY:$,resize:"none"}}var M=k("Gytx"),y=k.n(M),W;(function(Ee){Ee[Ee.NONE=0]="NONE",Ee[Ee.RESIZING=1]="RESIZING",Ee[Ee.RESIZED=2]="RESIZED"})(W||(W={}));var X=function(Ee){Object(G.a)(We,Ee);var Te=Object(L.a)(We);function We(He){var Ce;return Object(Y.a)(this,We),Ce=Te.call(this,He),Ce.nextFrameActionId=void 0,Ce.resizeFrameId=void 0,Ce.textArea=void 0,Ce.saveTextArea=function(ue){Ce.textArea=ue},Ce.handleResize=function(ue){var se=Ce.state.resizeStatus,we=Ce.props,ge=we.autoSize,Ke=we.onResize;if(se!==W.NONE)return;typeof Ke=="function"&&Ke(ue),ge&&Ce.resizeOnNextFrame()},Ce.resizeOnNextFrame=function(){cancelAnimationFrame(Ce.nextFrameActionId),Ce.nextFrameActionId=requestAnimationFrame(Ce.resizeTextarea)},Ce.resizeTextarea=function(){var ue=Ce.props.autoSize;if(!ue||!Ce.textArea)return;var se=ue.minRows,we=ue.maxRows,ge=z(Ce.textArea,!1,se,we);Ce.setState({textareaStyles:ge,resizeStatus:W.RESIZING},function(){cancelAnimationFrame(Ce.resizeFrameId),Ce.resizeFrameId=requestAnimationFrame(function(){Ce.setState({resizeStatus:W.RESIZED},function(){Ce.resizeFrameId=requestAnimationFrame(function(){Ce.setState({resizeStatus:W.NONE}),Ce.fixFirefoxAutoScroll()})})})})},Ce.renderTextArea=function(){var ue=Ce.props,se=ue.prefixCls,we=se===void 0?"rc-textarea":se,ge=ue.autoSize,Ke=ue.onResize,st=ue.className,ne=ue.disabled,$=Ce.state,J=$.textareaStyles,me=$.resizeStatus,xe=Object(f.a)(Ce.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),ke=g()(we,st,Object(O.a)({},"".concat(we,"-disabled"),ne));"value"in xe&&(xe.value=xe.value||"");var $e=Object(H.a)(Object(H.a)(Object(H.a)({},Ce.props.style),J),me===W.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return P.createElement(_,{onResize:Ce.handleResize,disabled:!(ge||Ke)},P.createElement("textarea",Object(re.a)({},xe,{className:ke,style:$e,ref:Ce.saveTextArea})))},Ce.state={textareaStyles:{},resizeStatus:W.NONE},Ce}return Object(j.a)(We,[{key:"componentDidUpdate",value:function(Ce){(Ce.value!==this.props.value||!y()(Ce.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 Ce=this.textArea.selectionStart,ue=this.textArea.selectionEnd;this.textArea.setSelectionRange(Ce,ue)}}catch(se){}}},{key:"render",value:function(){return this.renderTextArea()}}]),We}(P.Component),te=X,pe=function(Ee){Object(G.a)(We,Ee);var Te=Object(L.a)(We);function We(He){var Ce;Object(Y.a)(this,We),Ce=Te.call(this,He),Ce.resizableTextArea=void 0,Ce.focus=function(){Ce.resizableTextArea.textArea.focus()},Ce.saveTextArea=function(se){Ce.resizableTextArea=se},Ce.handleChange=function(se){var we=Ce.props.onChange;Ce.setValue(se.target.value,function(){Ce.resizableTextArea.resizeTextarea()}),we&&we(se)},Ce.handleKeyDown=function(se){var we=Ce.props,ge=we.onPressEnter,Ke=we.onKeyDown;se.keyCode===13&&ge&&ge(se),Ke&&Ke(se)};var ue=typeof He.value=="undefined"||He.value===null?He.defaultValue:He.value;return Ce.state={value:ue},Ce}return Object(j.a)(We,[{key:"setValue",value:function(Ce,ue){"value"in this.props||this.setState({value:Ce},ue)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return P.createElement(te,Object(re.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(Ce){return"value"in Ce?{value:Ce.value}:null}}]),We}(P.Component),Ie=et.default=pe},ZW9T:function(Gt,et,k){"use strict";k.d(et,"a",function(){return z});var re=k("k1fw"),Y=k("miYZ"),j=k("tsqr"),G=k("rAM+"),L=k("tJVT"),P=k("PpiC"),H=k("q1tI"),O=k.n(H),I=k("bdgK"),x=k("oBTY"),p=k("9og8"),m=k("WmNS"),h=k.n(m),r={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"]},n={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"]},a={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","for","friend","gcnew","generic","goto","if","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:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"for",content:["for( ; ; ){"," $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 <sstream>",content:["#include <sstream>"].join(`
`)},{label:"#include <string>",content:["#include <string>"].join(`
`)},{label:"#include <cmath>",content:["#include <cmath>"].join(`
`)}]},l={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(`
`)}]},s=k("5VLF"),u=k.n(s),c={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},R=function(y,W){return W.map(function(X){return{label:X,kind:y.languages.CompletionItemKind.Keyword,insertText:X}})},w=function(y){return Object.keys(c.tables).map(function(W){return{label:W,kind:y.languages.CompletionItemKind.Variable,insertText:W}})},C=function(y,W){var X=c.tables[y];return X?X.map(function(te){return{label:te,kind:W.languages.CompletionItemKind.Field,insertText:te}}):[]};function D(M,y,W,X,te){var pe=y.getWordUntilPosition(W),Ie={startLineNumber:W.lineNumber,endLineNumber:W.lineNumber,startColumn:pe.startColumn,endColumn:pe.endColumn},Ee=X.map(function(Te){return{label:Te,kind:M.languages.CompletionItemKind.Keyword,insertText:Te,insertTextRules:M.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ie}});return te.map(function(Te){Ee.push(Object(re.a)(Object(re.a)({},Te),{},{range:Ie}))}),Ee}var S=function(M){c.languages.map(function(te){return M.languages.registerDocumentFormattingEditProvider(te,{provideDocumentFormattingEdits:function(Ie,Ee,Te){return Object(p.a)(h.a.mark(function We(){var He;return h.a.wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:return He=u()(Ie.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}),ue.abrupt("return",[{range:Ie.getFullModelRange(),text:He}]);case 2:case"end":return ue.stop()}},We)}))()}}),te});var y=a.quickKey.map(function(te){return{label:te.label,kind:M.languages.CompletionItemKind.Method,insertText:te.content,insertTextRules:M.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),W=l.quickKey.map(function(te){return{label:te.label,kind:M.languages.CompletionItemKind.Method,insertText:te.content,insertTextRules:M.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),X=n.quickKey.map(function(te){return{label:te.label,kind:M.languages.CompletionItemKind.Method,insertText:te.content,insertTextRules:M.languages.CompletionItemInsertTextRule.InsertAsSnippet}});M.languages.registerCompletionItemProvider("cpp",{triggerCharacters:["."," ","#"].concat(Object(x.a)(a.keywords),Object(x.a)(a.quickKey.map(function(te){return te.label}))),provideCompletionItems:function(pe,Ie){var Ee=pe.getValueInRange({startLineNumber:Ie.lineNumber,startColumn:1,endLineNumber:Ie.lineNumber,endColumn:Ie.column}),Te=Ee.match(/cu/gim);console.log("match:",Te,Ie,Ee,pe);var We=[],He=Ie.lineNumber,Ce=Ie.column,ue=pe.getValueInRange({startLineNumber:He,startColumn:0,endLineNumber:He,endColumn:Ce}),se=ue.trim().split(/\s+/),we=se[se.length-1];if(we.endsWith(".")){var ge=we.slice(0,we.length-1);Object.keys(c.tables).includes(ge)&&(We=Object(x.a)(C(ge,M)))}else we==="."?We=[]:We=[].concat(Object(x.a)(w(M)),Object(x.a)(R(M,a.keywords)),Object(x.a)(y));return{suggestions:We}}}),M.languages.registerCompletionItemProvider("c",{triggerCharacters:["."," ","#"].concat(Object(x.a)(r.keywords)),provideCompletionItems:function(pe,Ie){var Ee=pe.getValueInRange({startLineNumber:Ie.lineNumber,startColumn:1,endLineNumber:Ie.lineNumber,endColumn:Ie.column}),Te=Ee.match(/cu/gim);console.log("match:",Te,Ie,Ee,pe);var We=[],He=Ie.lineNumber,Ce=Ie.column,ue=pe.getValueInRange({startLineNumber:He,startColumn:0,endLineNumber:He,endColumn:Ce}),se=ue.trim().split(/\s+/),we=se[se.length-1];if(we.endsWith(".")){var ge=we.slice(0,we.length-1);Object.keys(c.tables).includes(ge)&&(We=Object(x.a)(C(ge,M)))}else we==="."?We=[]:We=[].concat(Object(x.a)(w(M)),Object(x.a)(R(M,r.keywords)));return{suggestions:We}}}),M.languages.registerCompletionItemProvider("java",{triggerCharacters:["."," "].concat(Object(x.a)(n.keywords)),provideCompletionItems:function(pe,Ie){var Ee=[],Te=Ie.lineNumber,We=Ie.column,He=pe.getValueInRange({startLineNumber:Te,startColumn:0,endLineNumber:Te,endColumn:We}),Ce=He.trim().split(/\s+/),ue=Ce[Ce.length-1];if(ue.endsWith(".")){var se=ue.slice(0,ue.length-1);Object.keys(c.tables).includes(se)&&(Ee=Object(x.a)(C(se,M)))}else ue==="."?Ee=[]:Ee=[].concat(Object(x.a)(w(M)),Object(x.a)(R(M,n.keywords)),Object(x.a)(X));return{suggestions:Ee}}}),M.languages.registerCompletionItemProvider("python",{triggerCharacters:["."," "].concat(Object(x.a)(l.keywords)),provideCompletionItems:function(pe,Ie){var Ee=[],Te=Ie.lineNumber,We=Ie.column,He=pe.getValueInRange({startLineNumber:Te,startColumn:0,endLineNumber:Te,endColumn:We}),Ce=He.trim().split(/\s+/),ue=Ce[Ce.length-1];if(ue.endsWith(".")){var se=ue.slice(0,ue.length-1);Object.keys(c.tables).includes(se)&&(Ee=Object(x.a)(C(se,M)))}else ue==="."?Ee=[]:Ee=[].concat(Object(x.a)(w(M)),Object(x.a)(R(M,l.keywords)),Object(x.a)(W));return{suggestions:Ee}}})},b="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",_=k("LvDl"),f=k("+ua5");function d(M){return/^\d+$/.test(M)?"".concat(M,"px"):M}function g(){}var E=!1,T={"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 M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],y=M;if(Array.isArray(M)){for(var W=0;W<M.length;W++){var X=T[M[W]];if(X)return X}return y[0]}return T[y]||y}var U=null,K=et.b=function(M){var y=M.width,W=y===void 0?"100%":y,X=M.height,te=X===void 0?"100%":X,pe=M.value,Ie=M.language,Ee=Ie===void 0?"javascript":Ie,Te=M.style,We=Te===void 0?{}:Te,He=M.options,Ce=He===void 0?{}:He,ue=M.overrideServices,se=ue===void 0?{}:ue,we=M.theme,ge=we===void 0?"vs-dark":we,Ke=M.onEditBlur,st=M.onSave,ne=M.autoHeight,$=ne===void 0?!1:ne,J=M.forbidCopy,me=J===void 0?!1:J,xe=M.onChange,ke=xe===void 0?g:xe,$e=M.editorDidMount,Pt=$e===void 0?g:$e,Xt=M.onFocus,Bt=Xt===void 0?g:Xt,lt=M.filename,jt=lt===void 0?"educoder.txt":lt,pn=M.errorLine,it=M.errorContent,Ze=it===void 0?"":it,bt=Object(P.a)(M,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),Mt=Object(H.useRef)(),ct=Object(H.useRef)({}),wt=Object(H.useRef)(),Ve=Object(H.useRef)(!1),Se=Object(H.useRef)(),Pe=Object(H.useState)(!1),ce=Object(L.a)(Pe,2),de=ce[0],be=ce[1];function je(){var Le;return Mt.current&&(Le=new I.default(function(tt){var Lt=Object(G.a)(tt),Ht;try{for(Lt.s();!(Ht=Lt.n()).done;){var ln=Ht.value;(ln.target.offsetHeight>0||ln.target.offsetWidth>0)&&ct.current.instance.layout()}}catch(hn){Lt.e(hn)}finally{Lt.f()}}),Le.observe(Mt.current)),Le}function ze(){j.b.warn(decodeURIComponent(b))}var ut=function(){var tt=ct.current.instance;if(pe!=null&&tt&&de){var Lt=tt.getModel();Lt&&pe!==Lt.getValue()&&(E=!0,Lt.setValue(pe),tt.layout(),E=!1)}};Object(H.useEffect)(function(){wt.current&&clearTimeout(wt.current),wt.current=setTimeout(function(){ut()},500)},[pe,de,ct.current]),Object(H.useEffect)(function(){if(pn&&ct.current&&ct.current.instance){var Le=ct.current.instance;Le.changeViewZones(function(Lt){var Ht=document.createElement("div");Ht.style.padding="10px 20px",Ht.style.width="calc(100% - 20px)",Ht.className="my-error-line-wrp",Ht.innerHTML=Ze,Lt.addZone({afterLineNumber:pn||11,heightInLines:3,domNode:Ht})});var tt={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}};Le.addOverlayWidget(tt),Le.revealPositionInCenter({lineNumber:20,column:1})}},[pn,ct.current,de]);function Dt(){var Le=ct.current.instance;if(Le){var tt=Le.getSelection(),Lt=ct.current.pastePos||{},Ht=new U.Range(Lt.startLineNumber||tt.endLineNumber,Lt.startColumn||tt.endColumn,Lt.endLineNumber||tt.endLineNumber,Lt.endColumn||tt.endColumn);setTimeout(function(){Le.executeEdits("",[{range:Ht,text:""}])},300)}}function rn(Le){(window.navigator.platform.match("Mac")?Le.metaKey:Le.ctrlKey)&&Le.keyCode==83&&(Le.preventDefault(),st())}var mn=function(){if($&&ct.current.instance){var tt=ct.current.instance.getContentHeight();Qt(tt<te?te:tt)}else Qt(te)};function gt(Le){var tt=document.createEvent("MouseEvents");tt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Le.dispatchEvent(tt)}function Vt(Le,tt){var Lt=window.URL||window.webkitURL||window,Ht=new Blob([tt]),ln=document.createElementNS("http://www.w3.org/1999/xhtml","a");ln.href=Lt.createObjectURL(Ht),ln.download=Le,gt(ln)}Object(H.useEffect)(function(){mn()},[mn]),Object(H.useEffect)(function(){Mt.current&&!de&&k.e(27).then(k.t.bind(null,"M/lh",7)).then(function(Le){try{U=Le,ct.current.instance=U.editor.create(Mt.current,{value:pe,language:F(Ee),theme:ge,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},se);var tt=ct.current.instance;if(Pt(tt,U),setTimeout(function(){mn(),ct.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Vt(jt||"educoder.txt",tt.getValue())}})},500),ct.current.subscription=tt.onDidChangeModelContent(function(Ht){Ve.current?clearTimeout(Se.current):(mn(),ke(tt.getValue(),Ht)),Se.current=setTimeout(function(){Ve.current=!1},500)}),window.Monaco||S(U),me&&(tt.addCommand(U.KeyMod.CtrlCmd|U.KeyMod.Shift|U.KeyCode.KEY_V,function(){return ze(),null}),tt.addCommand(U.KeyMod.CtrlCmd|U.KeyCode.KEY_C,function(){return ze(),null})),window.Monaco=U,Ke&&tt.onDidBlurEditorWidget(function(){Ke(tt.getValue())}),Bt&&tt.onDidFocusEditorText(function(){Bt(tt.getValue())}),me){tt.addCommand(U.KeyMod.CtrlCmd|U.KeyCode.KEY_V,function(){return ze(),null}),tt.onDidPaste(function(Ht){ct.current.pastePos=Ht});try{window.addEventListener("paste",Dt)}catch(Ht){}}var Lt=je();return be(!0),function(){var Ht=ct.current.instance;Ht.dispose();var ln=Ht.getModel();ln&&ln.dispose(),ct.current.subscription&&ct.current.subscription.dispose(),me&&window.removeEventListener("paste",Dt),Lt.unobserve(Mt.current)}}catch(Ht){}})},[]),Object(H.useEffect)(function(){var Le=ct.current.instance;if(Le&&de)return document.addEventListener("keydown",rn,!1),function(){document.removeEventListener("keydown",rn)}},[st,de]),Object(H.useEffect)(function(){var Le=ct.current.instance;if(Le&&de){var tt=F(Ee);U.editor.setModelLanguage(Le.getModel(),tt),console.log("language:",Ee,Le.getModel(),tt)}},[Ee,de]),Object(H.useEffect)(function(){var Le=ct.current.instance;Le&&de&&U.editor.setTheme(ge)},[ge,de]),Object(H.useEffect)(function(){var Le=ct.current.instance;Le&&de&&(Le.updateOptions(Object(re.a)({},Ce)),setTimeout(function(){Le.getModel().updateOptions(Object(re.a)({},Ce))},200))},[JSON.stringify(Ce),de]),Object(H.useEffect)(function(){var Le=ct.current.instance;Le&&de&&Le.layout()},[W,te,de]);var Tt=Object(H.useState)(d(W)),Rt=Object(L.a)(Tt,2),mt=Rt[0],_e=Rt[1],Ge=Object(H.useState)(d(te)),kt=Object(L.a)(Ge,2),vt=kt[0],Qt=kt[1],Jt=Object(re.a)(Object(re.a)({},We),{},{width:mt,height:vt});return O.a.createElement("div",{className:"my-monaco-editor",ref:Mt,style:Jt})};function z(M){var y=M.width,W=y===void 0?"100%":y,X=M.height,te=X===void 0?"100%":X,pe=M.original,Ie=M.modified,Ee=M.language,Te=M.options,We=Te===void 0?{}:Te,He=Object(H.useRef)(),Ce=Object(H.useState)(null),ue=Object(L.a)(Ce,2),se=ue[0],we=ue[1];function ge($){var J;return He.current&&(J=new I.default(function(me){var xe=Object(G.a)(me),ke;try{for(xe.s();!(ke=xe.n()).done;){var $e=ke.value;($e.target.offsetHeight>0||$e.target.offsetWidth>0)&&$.layout()}}catch(Pt){xe.e(Pt)}finally{xe.f()}}),J.observe(He.current)),J}Object(H.useEffect)(function(){He.current&&k.e(27).then(k.t.bind(null,"M/lh",7)).then(function($){U=$;var J=U.editor.createDiffEditor(He.current,Object(re.a)(Object(re.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},We),{},{wordWrap:!0}));we(J);var me=ge(J);return function(){J.dispose();var xe=J.getModel();xe&&xe.dispose(),me.unobserve(He.current)}})},[]),Object(H.useEffect)(function(){se&&se.setModel({original:U.editor.createModel(pe,Ee),modified:U.editor.createModel(Ie,Ee)})},[pe,Ie,Ee,se]);var Ke=d(W),st=d(te),ne={width:Ke,height:st};return O.a.createElement("div",{className:"my-diff-editor",ref:He,style:ne})}},ZpRC:function(Gt,et,k){"use strict";function re(p){return typeof p=="object"&&p!=null&&p.nodeType===1}function Y(p,m){return(!m||p!=="hidden")&&p!=="visible"&&p!=="clip"}function j(p,m){if(p.clientHeight<p.scrollHeight||p.clientWidth<p.scrollWidth){var h=getComputedStyle(p,null);return Y(h.overflowY,m)||Y(h.overflowX,m)||function(r){var n=function(a){if(!a.ownerDocument||!a.ownerDocument.defaultView)return null;try{return a.ownerDocument.defaultView.frameElement}catch(l){return null}}(r);return!!n&&(n.clientHeight<r.scrollHeight||n.clientWidth<r.scrollWidth)}(p)}return!1}function G(p,m,h,r,n,a,l,s){return a<p&&l>m||a>p&&l<m?0:a<=p&&s<=h||l>=m&&s>=h?a-p-r:l>m&&s<h||a<p&&s>h?l-m+n:0}var L=function(p,m){var h=window,r=m.scrollMode,n=m.block,a=m.inline,l=m.boundary,s=m.skipOverflowHiddenElements,u=typeof l=="function"?l:function(J){return J!==l};if(!re(p))throw new TypeError("Invalid target");for(var c=document.scrollingElement||document.documentElement,R=[],w=p;re(w)&&u(w);){if((w=w.parentElement)===c){R.push(w);break}w!=null&&w===document.body&&j(w)&&!j(document.documentElement)||w!=null&&j(w,s)&&R.push(w)}for(var C=h.visualViewport?h.visualViewport.width:innerWidth,D=h.visualViewport?h.visualViewport.height:innerHeight,S=window.scrollX||pageXOffset,b=window.scrollY||pageYOffset,_=p.getBoundingClientRect(),f=_.height,d=_.width,g=_.top,E=_.right,T=_.bottom,F=_.left,U=n==="start"||n==="nearest"?g:n==="end"?T:g+f/2,K=a==="center"?F+d/2:a==="end"?E:F,z=[],M=0;M<R.length;M++){var y=R[M],W=y.getBoundingClientRect(),X=W.height,te=W.width,pe=W.top,Ie=W.right,Ee=W.bottom,Te=W.left;if(r==="if-needed"&&g>=0&&F>=0&&T<=D&&E<=C&&g>=pe&&T<=Ee&&F>=Te&&E<=Ie)return z;var We=getComputedStyle(y),He=parseInt(We.borderLeftWidth,10),Ce=parseInt(We.borderTopWidth,10),ue=parseInt(We.borderRightWidth,10),se=parseInt(We.borderBottomWidth,10),we=0,ge=0,Ke="offsetWidth"in y?y.offsetWidth-y.clientWidth-He-ue:0,st="offsetHeight"in y?y.offsetHeight-y.clientHeight-Ce-se:0;if(c===y)we=n==="start"?U:n==="end"?U-D:n==="nearest"?G(b,b+D,D,Ce,se,b+U,b+U+f,f):U-D/2,ge=a==="start"?K:a==="center"?K-C/2:a==="end"?K-C:G(S,S+C,C,He,ue,S+K,S+K+d,d),we=Math.max(0,we+b),ge=Math.max(0,ge+S);else{we=n==="start"?U-pe-Ce:n==="end"?U-Ee+se+st:n==="nearest"?G(pe,Ee,X,Ce,se+st,U,U+f,f):U-(pe+X/2)+st/2,ge=a==="start"?K-Te-He:a==="center"?K-(Te+te/2)+Ke/2:a==="end"?K-Ie+ue+Ke:G(Te,Ie,te,He,ue+Ke,K,K+d,d);var ne=y.scrollLeft,$=y.scrollTop;U+=$-(we=Math.max(0,Math.min($+we,y.scrollHeight-X+st))),K+=ne-(ge=Math.max(0,Math.min(ne+ge,y.scrollWidth-te+Ke)))}z.push({el:y,top:we,left:ge})}return z};function P(p){return p===Object(p)&&Object.keys(p).length!==0}function H(p,m){m===void 0&&(m="auto");var h="scrollBehavior"in document.body.style;p.forEach(function(r){var n=r.el,a=r.top,l=r.left;n.scroll&&h?n.scroll({top:a,left:l,behavior:m}):(n.scrollTop=a,n.scrollLeft=l)})}function O(p){return p===!1?{block:"end",inline:"nearest"}:P(p)?p:{block:"start",inline:"nearest"}}function I(p,m){var h=!p.ownerDocument.documentElement.contains(p);if(P(m)&&typeof m.behavior=="function")return m.behavior(h?[]:L(p,m));if(h)return;var r=O(m);return H(L(p,r),r.behavior)}var x=et.a=I},Zss7:function(Gt,et,k){var re;(function(Y){var j=/^\s+/,G=/\s+$/,L=0,P=Y.round,H=Y.min,O=Y.max,I=Y.random;function x(se,we){if(se=se||"",we=we||{},se instanceof x)return se;if(!(this instanceof x))return new x(se,we);var ge=p(se);this._originalInput=se,this._r=ge.r,this._g=ge.g,this._b=ge.b,this._a=ge.a,this._roundA=P(100*this._a)/100,this._format=we.format||ge.format,this._gradientType=we.gradientType,this._r<1&&(this._r=P(this._r)),this._g<1&&(this._g=P(this._g)),this._b<1&&(this._b=P(this._b)),this._ok=ge.ok,this._tc_id=L++}x.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 se=this.toRgb();return(se.r*299+se.g*587+se.b*114)/1e3},getLuminance:function(){var se=this.toRgb(),we,ge,Ke,st,ne,$;return we=se.r/255,ge=se.g/255,Ke=se.b/255,we<=.03928?st=we/12.92:st=Y.pow((we+.055)/1.055,2.4),ge<=.03928?ne=ge/12.92:ne=Y.pow((ge+.055)/1.055,2.4),Ke<=.03928?$=Ke/12.92:$=Y.pow((Ke+.055)/1.055,2.4),.2126*st+.7152*ne+.0722*$},setAlpha:function(se){return this._a=z(se),this._roundA=P(100*this._a)/100,this},toHsv:function(){var se=n(this._r,this._g,this._b);return{h:se.h*360,s:se.s,v:se.v,a:this._a}},toHsvString:function(){var se=n(this._r,this._g,this._b),we=P(se.h*360),ge=P(se.s*100),Ke=P(se.v*100);return this._a==1?"hsv("+we+", "+ge+"%, "+Ke+"%)":"hsva("+we+", "+ge+"%, "+Ke+"%, "+this._roundA+")"},toHsl:function(){var se=h(this._r,this._g,this._b);return{h:se.h*360,s:se.s,l:se.l,a:this._a}},toHslString:function(){var se=h(this._r,this._g,this._b),we=P(se.h*360),ge=P(se.s*100),Ke=P(se.l*100);return this._a==1?"hsl("+we+", "+ge+"%, "+Ke+"%)":"hsla("+we+", "+ge+"%, "+Ke+"%, "+this._roundA+")"},toHex:function(se){return l(this._r,this._g,this._b,se)},toHexString:function(se){return"#"+this.toHex(se)},toHex8:function(se){return s(this._r,this._g,this._b,this._a,se)},toHex8String:function(se){return"#"+this.toHex8(se)},toRgb:function(){return{r:P(this._r),g:P(this._g),b:P(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+P(this._r)+", "+P(this._g)+", "+P(this._b)+")":"rgba("+P(this._r)+", "+P(this._g)+", "+P(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:P(M(this._r,255)*100)+"%",g:P(M(this._g,255)*100)+"%",b:P(M(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+P(M(this._r,255)*100)+"%, "+P(M(this._g,255)*100)+"%, "+P(M(this._b,255)*100)+"%)":"rgba("+P(M(this._r,255)*100)+"%, "+P(M(this._g,255)*100)+"%, "+P(M(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:U[l(this._r,this._g,this._b,!0)]||!1},toFilter:function(se){var we="#"+u(this._r,this._g,this._b,this._a),ge=we,Ke=this._gradientType?"GradientType = 1, ":"";if(se){var st=x(se);ge="#"+u(st._r,st._g,st._b,st._a)}return"progid:DXImageTransform.Microsoft.gradient("+Ke+"startColorstr="+we+",endColorstr="+ge+")"},toString:function(se){var we=!!se;se=se||this._format;var ge=!1,Ke=this._a<1&&this._a>=0,st=!we&&Ke&&(se==="hex"||se==="hex6"||se==="hex3"||se==="hex4"||se==="hex8"||se==="name");return st?se==="name"&&this._a===0?this.toName():this.toRgbString():(se==="rgb"&&(ge=this.toRgbString()),se==="prgb"&&(ge=this.toPercentageRgbString()),(se==="hex"||se==="hex6")&&(ge=this.toHexString()),se==="hex3"&&(ge=this.toHexString(!0)),se==="hex4"&&(ge=this.toHex8String(!0)),se==="hex8"&&(ge=this.toHex8String()),se==="name"&&(ge=this.toName()),se==="hsl"&&(ge=this.toHslString()),se==="hsv"&&(ge=this.toHsvString()),ge||this.toHexString())},clone:function(){return x(this.toString())},_applyModification:function(se,we){var ge=se.apply(null,[this].concat([].slice.call(we)));return this._r=ge._r,this._g=ge._g,this._b=ge._b,this.setAlpha(ge._a),this},lighten:function(){return this._applyModification(C,arguments)},brighten:function(){return this._applyModification(D,arguments)},darken:function(){return this._applyModification(S,arguments)},desaturate:function(){return this._applyModification(c,arguments)},saturate:function(){return this._applyModification(R,arguments)},greyscale:function(){return this._applyModification(w,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(se,we){return se.apply(null,[this].concat([].slice.call(we)))},analogous:function(){return this._applyCombination(E,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(T,arguments)},splitcomplement:function(){return this._applyCombination(g,arguments)},triad:function(){return this._applyCombination(f,arguments)},tetrad:function(){return this._applyCombination(d,arguments)}},x.fromRatio=function(se,we){if(typeof se=="object"){var ge={};for(var Ke in se)se.hasOwnProperty(Ke)&&(Ke==="a"?ge[Ke]=se[Ke]:ge[Ke]=Ie(se[Ke]));se=ge}return x(se,we)};function p(se){var we={r:0,g:0,b:0},ge=1,Ke=null,st=null,ne=null,$=!1,J=!1;return typeof se=="string"&&(se=Ce(se)),typeof se=="object"&&(He(se.r)&&He(se.g)&&He(se.b)?(we=m(se.r,se.g,se.b),$=!0,J=String(se.r).substr(-1)==="%"?"prgb":"rgb"):He(se.h)&&He(se.s)&&He(se.v)?(Ke=Ie(se.s),st=Ie(se.v),we=a(se.h,Ke,st),$=!0,J="hsv"):He(se.h)&&He(se.s)&&He(se.l)&&(Ke=Ie(se.s),ne=Ie(se.l),we=r(se.h,Ke,ne),$=!0,J="hsl"),se.hasOwnProperty("a")&&(ge=se.a)),ge=z(ge),{ok:$,format:se.format||J,r:H(255,O(we.r,0)),g:H(255,O(we.g,0)),b:H(255,O(we.b,0)),a:ge}}function m(se,we,ge){return{r:M(se,255)*255,g:M(we,255)*255,b:M(ge,255)*255}}function h(se,we,ge){se=M(se,255),we=M(we,255),ge=M(ge,255);var Ke=O(se,we,ge),st=H(se,we,ge),ne,$,J=(Ke+st)/2;if(Ke==st)ne=$=0;else{var me=Ke-st;$=J>.5?me/(2-Ke-st):me/(Ke+st);switch(Ke){case se:ne=(we-ge)/me+(we<ge?6:0);break;case we:ne=(ge-se)/me+2;break;case ge:ne=(se-we)/me+4;break}ne/=6}return{h:ne,s:$,l:J}}function r(se,we,ge){var Ke,st,ne;se=M(se,360),we=M(we,100),ge=M(ge,100);function $(xe,ke,$e){return $e<0&&($e+=1),$e>1&&($e-=1),$e<1/6?xe+(ke-xe)*6*$e:$e<1/2?ke:$e<2/3?xe+(ke-xe)*(2/3-$e)*6:xe}if(we===0)Ke=st=ne=ge;else{var J=ge<.5?ge*(1+we):ge+we-ge*we,me=2*ge-J;Ke=$(me,J,se+1/3),st=$(me,J,se),ne=$(me,J,se-1/3)}return{r:Ke*255,g:st*255,b:ne*255}}function n(se,we,ge){se=M(se,255),we=M(we,255),ge=M(ge,255);var Ke=O(se,we,ge),st=H(se,we,ge),ne,$,J=Ke,me=Ke-st;if($=Ke===0?0:me/Ke,Ke==st)ne=0;else{switch(Ke){case se:ne=(we-ge)/me+(we<ge?6:0);break;case we:ne=(ge-se)/me+2;break;case ge:ne=(se-we)/me+4;break}ne/=6}return{h:ne,s:$,v:J}}function a(se,we,ge){se=M(se,360)*6,we=M(we,100),ge=M(ge,100);var Ke=Y.floor(se),st=se-Ke,ne=ge*(1-we),$=ge*(1-st*we),J=ge*(1-(1-st)*we),me=Ke%6,xe=[ge,$,ne,ne,J,ge][me],ke=[J,ge,ge,$,ne,ne][me],$e=[ne,ne,J,ge,ge,$][me];return{r:xe*255,g:ke*255,b:$e*255}}function l(se,we,ge,Ke){var st=[pe(P(se).toString(16)),pe(P(we).toString(16)),pe(P(ge).toString(16))];return Ke&&st[0].charAt(0)==st[0].charAt(1)&&st[1].charAt(0)==st[1].charAt(1)&&st[2].charAt(0)==st[2].charAt(1)?st[0].charAt(0)+st[1].charAt(0)+st[2].charAt(0):st.join("")}function s(se,we,ge,Ke,st){var ne=[pe(P(se).toString(16)),pe(P(we).toString(16)),pe(P(ge).toString(16)),pe(Ee(Ke))];return st&&ne[0].charAt(0)==ne[0].charAt(1)&&ne[1].charAt(0)==ne[1].charAt(1)&&ne[2].charAt(0)==ne[2].charAt(1)&&ne[3].charAt(0)==ne[3].charAt(1)?ne[0].charAt(0)+ne[1].charAt(0)+ne[2].charAt(0)+ne[3].charAt(0):ne.join("")}function u(se,we,ge,Ke){var st=[pe(Ee(Ke)),pe(P(se).toString(16)),pe(P(we).toString(16)),pe(P(ge).toString(16))];return st.join("")}x.equals=function(se,we){return!se||!we?!1:x(se).toRgbString()==x(we).toRgbString()},x.random=function(){return x.fromRatio({r:I(),g:I(),b:I()})};function c(se,we){we=we===0?0:we||10;var ge=x(se).toHsl();return ge.s-=we/100,ge.s=y(ge.s),x(ge)}function R(se,we){we=we===0?0:we||10;var ge=x(se).toHsl();return ge.s+=we/100,ge.s=y(ge.s),x(ge)}function w(se){return x(se).desaturate(100)}function C(se,we){we=we===0?0:we||10;var ge=x(se).toHsl();return ge.l+=we/100,ge.l=y(ge.l),x(ge)}function D(se,we){we=we===0?0:we||10;var ge=x(se).toRgb();return ge.r=O(0,H(255,ge.r-P(255*-(we/100)))),ge.g=O(0,H(255,ge.g-P(255*-(we/100)))),ge.b=O(0,H(255,ge.b-P(255*-(we/100)))),x(ge)}function S(se,we){we=we===0?0:we||10;var ge=x(se).toHsl();return ge.l-=we/100,ge.l=y(ge.l),x(ge)}function b(se,we){var ge=x(se).toHsl(),Ke=(ge.h+we)%360;return ge.h=Ke<0?360+Ke:Ke,x(ge)}function _(se){var we=x(se).toHsl();return we.h=(we.h+180)%360,x(we)}function f(se){var we=x(se).toHsl(),ge=we.h;return[x(se),x({h:(ge+120)%360,s:we.s,l:we.l}),x({h:(ge+240)%360,s:we.s,l:we.l})]}function d(se){var we=x(se).toHsl(),ge=we.h;return[x(se),x({h:(ge+90)%360,s:we.s,l:we.l}),x({h:(ge+180)%360,s:we.s,l:we.l}),x({h:(ge+270)%360,s:we.s,l:we.l})]}function g(se){var we=x(se).toHsl(),ge=we.h;return[x(se),x({h:(ge+72)%360,s:we.s,l:we.l}),x({h:(ge+216)%360,s:we.s,l:we.l})]}function E(se,we,ge){we=we||6,ge=ge||30;var Ke=x(se).toHsl(),st=360/ge,ne=[x(se)];for(Ke.h=(Ke.h-(st*we>>1)+720)%360;--we;)Ke.h=(Ke.h+st)%360,ne.push(x(Ke));return ne}function T(se,we){we=we||6;for(var ge=x(se).toHsv(),Ke=ge.h,st=ge.s,ne=ge.v,$=[],J=1/we;we--;)$.push(x({h:Ke,s:st,v:ne})),ne=(ne+J)%1;return $}x.mix=function(se,we,ge){ge=ge===0?0:ge||50;var Ke=x(se).toRgb(),st=x(we).toRgb(),ne=ge/100,$={r:(st.r-Ke.r)*ne+Ke.r,g:(st.g-Ke.g)*ne+Ke.g,b:(st.b-Ke.b)*ne+Ke.b,a:(st.a-Ke.a)*ne+Ke.a};return x($)},x.readability=function(se,we){var ge=x(se),Ke=x(we);return(Y.max(ge.getLuminance(),Ke.getLuminance())+.05)/(Y.min(ge.getLuminance(),Ke.getLuminance())+.05)},x.isReadable=function(se,we,ge){var Ke=x.readability(se,we),st,ne;ne=!1,st=ue(ge);switch(st.level+st.size){case"AAsmall":case"AAAlarge":ne=Ke>=4.5;break;case"AAlarge":ne=Ke>=3;break;case"AAAsmall":ne=Ke>=7;break}return ne},x.mostReadable=function(se,we,ge){var Ke=null,st=0,ne,$,J,me;ge=ge||{},$=ge.includeFallbackColors,J=ge.level,me=ge.size;for(var xe=0;xe<we.length;xe++)ne=x.readability(se,we[xe]),ne>st&&(st=ne,Ke=x(we[xe]));return x.isReadable(se,Ke,{level:J,size:me})||!$?Ke:(ge.includeFallbackColors=!1,x.mostReadable(se,["#fff","#000"],ge))};var F=x.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"},U=x.hexNames=K(F);function K(se){var we={};for(var ge in se)se.hasOwnProperty(ge)&&(we[se[ge]]=ge);return we}function z(se){return se=parseFloat(se),(isNaN(se)||se<0||se>1)&&(se=1),se}function M(se,we){X(se)&&(se="100%");var ge=te(se);return se=H(we,O(0,parseFloat(se))),ge&&(se=parseInt(se*we,10)/100),Y.abs(se-we)<1e-6?1:se%we/parseFloat(we)}function y(se){return H(1,O(0,se))}function W(se){return parseInt(se,16)}function X(se){return typeof se=="string"&&se.indexOf(".")!=-1&&parseFloat(se)===1}function te(se){return typeof se=="string"&&se.indexOf("%")!=-1}function pe(se){return se.length==1?"0"+se:""+se}function Ie(se){return se<=1&&(se=se*100+"%"),se}function Ee(se){return Y.round(parseFloat(se)*255).toString(16)}function Te(se){return W(se)/255}var We=function(){var se="[-\\+]?\\d+%?",we="[-\\+]?\\d*\\.\\d+%?",ge="(?:"+we+")|(?:"+se+")",Ke="[\\s|\\(]+("+ge+")[,|\\s]+("+ge+")[,|\\s]+("+ge+")\\s*\\)?",st="[\\s|\\(]+("+ge+")[,|\\s]+("+ge+")[,|\\s]+("+ge+")[,|\\s]+("+ge+")\\s*\\)?";return{CSS_UNIT:new RegExp(ge),rgb:new RegExp("rgb"+Ke),rgba:new RegExp("rgba"+st),hsl:new RegExp("hsl"+Ke),hsla:new RegExp("hsla"+st),hsv:new RegExp("hsv"+Ke),hsva:new RegExp("hsva"+st),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 He(se){return!!We.CSS_UNIT.exec(se)}function Ce(se){se=se.replace(j,"").replace(G,"").toLowerCase();var we=!1;if(F[se])se=F[se],we=!0;else if(se=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var ge;return(ge=We.rgb.exec(se))?{r:ge[1],g:ge[2],b:ge[3]}:(ge=We.rgba.exec(se))?{r:ge[1],g:ge[2],b:ge[3],a:ge[4]}:(ge=We.hsl.exec(se))?{h:ge[1],s:ge[2],l:ge[3]}:(ge=We.hsla.exec(se))?{h:ge[1],s:ge[2],l:ge[3],a:ge[4]}:(ge=We.hsv.exec(se))?{h:ge[1],s:ge[2],v:ge[3]}:(ge=We.hsva.exec(se))?{h:ge[1],s:ge[2],v:ge[3],a:ge[4]}:(ge=We.hex8.exec(se))?{r:W(ge[1]),g:W(ge[2]),b:W(ge[3]),a:Te(ge[4]),format:we?"name":"hex8"}:(ge=We.hex6.exec(se))?{r:W(ge[1]),g:W(ge[2]),b:W(ge[3]),format:we?"name":"hex"}:(ge=We.hex4.exec(se))?{r:W(ge[1]+""+ge[1]),g:W(ge[2]+""+ge[2]),b:W(ge[3]+""+ge[3]),a:Te(ge[4]+""+ge[4]),format:we?"name":"hex8"}:(ge=We.hex3.exec(se))?{r:W(ge[1]+""+ge[1]),g:W(ge[2]+""+ge[2]),b:W(ge[3]+""+ge[3]),format:we?"name":"hex"}:!1}function ue(se){var we,ge;return se=se||{level:"AA",size:"small"},we=(se.level||"AA").toUpperCase(),ge=(se.size||"small").toLowerCase(),we!=="AA"&&we!=="AAA"&&(we="AA"),ge!=="small"&&ge!=="large"&&(ge="small"),{level:we,size:ge}}Gt.exports?Gt.exports=x:!(re=function(){return x}.call(et,k,et,Gt),re!==void 0&&(Gt.exports=re))})(Math)},bT9E:function(Gt,et,k){"use strict";k.d(et,"a",function(){return Y});var re=k("VTBJ");function Y(j,G){var L=Object(re.a)({},j);return Array.isArray(G)&&G.forEach(function(P){delete L[P]}),L}},biw7:function(Gt,et,k){"use strict";var re=k("q1tI"),Y=k.n(re),j=re.createContext(null);et.a=j},c5Ni:function(Gt,et,k){},cguq:function(Gt,et,k){"use strict";var re=k("14J3"),Y=k("BMrR"),j=k("5NDa"),G=k("5rEg"),L=k("iQDF"),P=k("+eQT"),H=k("giR+"),O=k("fyUT"),I=k("y8nQ"),x=k("Vl3Y"),p=k("0Owb"),m=k("OaEy"),h=k("2fM7"),r=k("oBTY"),n=k("jCWc"),a=k("kPKH"),l=k("PpiC"),s=k("tJVT"),u=k("q1tI"),c=k.n(u),R=k("/MfK"),w=k("w5pM"),C=k("9kvl"),D=k("eozf"),S=function(_){var f=_.disabled,d=_.shixunHomeworks,g=_.selectOptions,E=_.form,T=d.workSetting,F=Object(u.useState)([]),U=Object(s.a)(F,2),K=U[0],z=U[1],M=Object(u.useMemo)(function(){return g==null?void 0:g.filter(function(y){return!K.includes(y.value)})},[K,g]);return Object(u.useEffect)(function(){var y,W=(T==null||((y=T.anonymous_appeal_settings)===null||y===void 0)?void 0:y.filter(function(X){return X.appeal_time}))||[];z(W.map(function(X){return X.group_name}))},[T]),c.a.createElement(x.a.List,{name:"anonymous_appeal_settings"},function(y,W){var X=W.add,te=W.remove;return c.a.createElement(c.a.Fragment,null,y.map(function(pe){var Ie,Ee=pe.key,Te=pe.name,We=Object(l.a)(pe,["key","name"]),He=E.getFieldValue(["anonymous_appeal_settings",Te]),Ce=He.deleteflag;return c.a.createElement("div",{key:Ee},c.a.createElement(Y.a,{align:"middle",style:{marginLeft:30,marginBottom:30}},c.a.createElement(a.a,null,"\u7533\u8BC9\u89C4\u5219",Ee+1,"\uFF1A"),c.a.createElement(a.a,{span:8},c.a.createElement(x.a.Item,Object(p.a)({},We,{name:[pe.name,"group_name"]}),c.a.createElement(h.a,{mode:"multiple",disabled:f||!Ce,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",options:M||[],onSelect:function(se){z(function(we){return[].concat(Object(r.a)(we),[se])})},onDeselect:function(se){z(function(we){return we.filter(function(ge){return ge!==se})})}}))),c.a.createElement(a.a,{className:"ml20"},c.a.createElement(x.a.Item,Object(p.a)({},We,{label:"\u8FDD\u89C4\u533F\u8BC4\u6263\u5206",name:[pe.name,"appeal_penalty"]}),c.a.createElement(O.a,{min:0,disabled:f}))),c.a.createElement(a.a,{className:"ml20"},c.a.createElement(x.a.Item,Object(p.a)({},We,{label:"\u7ED3\u675F\u65F6\u95F4",name:[pe.name,"appeal_time"]}),c.a.createElement(P.a,{allowClear:!1,style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u7ED3\u675F\u65F6\u95F4",disabled:f,disabledDate:function(se){return Object(D.b)(se,T==null?void 0:T.course_end_date)},disabledTime:function(se){return Object(D.c)(se)},showTime:{format:"HH:mm"},format:"YYYY-MM-DD HH:mm"}))),c.a.createElement(x.a.Item,Object(p.a)({},We,{name:[Te,"deleteflag"]}),c.a.createElement(G.a,{type:"hidden"})),Ee!==0&&!f&&Ce&&c.a.createElement(R.a,{className:"ml20",onClick:function(){var se=E.getFieldValue(["anonymous_appeal_settings",Te,"group_name"])||[];z(function(we){return we.filter(function(ge){return!se.includes(ge)})}),te(Te)}}),!f&&y.length<(T==null||((Ie=T.anonymous_appeal_settings)===null||Ie===void 0)?void 0:Ie.length)&&c.a.createElement(w.a,{className:"c-green ml20",onClick:function(){X({deleteflag:!0})}})))}))})};et.a=Object(C.a)(function(b){var _=b.shixunHomeworks;return{shixunHomeworks:_}})(S)},dejd:function(Gt,et,k){},dmUQ:function(Gt,et,k){"use strict";var re=k("Ff2n"),Y=k("rePB"),j=k("1OyB"),G=k("vuIU"),L=k("Ji7U"),P=k("md7G"),H=k("foSv"),O=k("q1tI"),I=k.n(O),x=k("TSYQ"),p=k.n(x),m=k("4IlW");function h(f,d){var g=Object.keys(f);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(f);d&&(E=E.filter(function(T){return Object.getOwnPropertyDescriptor(f,T).enumerable})),g.push.apply(g,E)}return g}function r(f){for(var d=1;d<arguments.length;d++){var g=arguments[d]!=null?arguments[d]:{};d%2?h(Object(g),!0).forEach(function(E){Object(Y.a)(f,E,g[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(g)):h(Object(g)).forEach(function(E){Object.defineProperty(f,E,Object.getOwnPropertyDescriptor(g,E))})}return f}function n(f){var d=a();return function(){var E=Object(H.a)(f),T;if(d){var F=Object(H.a)(this).constructor;T=Reflect.construct(E,arguments,F)}else T=E.apply(this,arguments);return Object(P.a)(this,T)}}function a(){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(f){return!1}}function l(){}function s(f){f.preventDefault()}var u=function(d){return d.replace(/[^\w.-]+/g,"")},c=200,R=600,w=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,C=function(d){return d!=null},D=function(d,g){return g===d||typeof g=="number"&&typeof d=="number"&&isNaN(g)&&isNaN(d)},S=function(f){Object(L.a)(g,f);var d=n(g);function g(E){var T;Object(j.a)(this,g),T=d.call(this,E),T.onKeyDown=function(K){var z=T.props,M=z.onKeyDown,y=z.onPressEnter;if(K.keyCode===m.a.UP){var W=T.getRatio(K);T.up(K,W,null),T.stop()}else if(K.keyCode===m.a.DOWN){var X=T.getRatio(K);T.down(K,X,null),T.stop()}else K.keyCode===m.a.ENTER&&y&&y(K);if(T.recordCursorPosition(),T.lastKeyCode=K.keyCode,M){for(var te=arguments.length,pe=new Array(te>1?te-1:0),Ie=1;Ie<te;Ie++)pe[Ie-1]=arguments[Ie];M.apply(void 0,[K].concat(pe))}},T.onKeyUp=function(K){var z=T.props.onKeyUp;if(T.stop(),T.recordCursorPosition(),z){for(var M=arguments.length,y=new Array(M>1?M-1:0),W=1;W<M;W++)y[W-1]=arguments[W];z.apply(void 0,[K].concat(y))}},T.onChange=function(K){var z=T.props.onChange;T.state.focused&&(T.inputting=!0),T.rawInput=T.props.parser(T.getValueFromEvent(K)),T.setState({inputValue:T.rawInput}),z(T.toNumber(T.rawInput))},T.onMouseUp=function(){var K=T.props.onMouseUp;T.recordCursorPosition(),K&&K.apply(void 0,arguments)},T.onFocus=function(){var K;T.setState({focused:!0}),(K=T.props).onFocus.apply(K,arguments)},T.onBlur=function(){var K=T.props.onBlur;T.inputting=!1,T.setState({focused:!1});var z=T.getCurrentValidValue(T.state.inputValue),M=T.setValue(z,l);if(K){var y=T.input.value,W=T.getInputDisplayValue({focus:!1,value:M});T.input.value=W&&Number(W),K.apply(void 0,arguments),T.input.value=y}},T.getRatio=function(K){var z=1;return K.metaKey||K.ctrlKey?z=.1:K.shiftKey&&(z=10),z},T.getFullNum=function(K){return isNaN(K)?K:/e/i.test(String(K))?Number(K).toFixed(18).replace(/\.?0+$/,""):K},T.getPrecision=function(K){if(C(T.props.precision))return T.props.precision;var z=String(K);if(z.indexOf("e-")>=0)return parseInt(z.slice(z.indexOf("e-")+2),10);var M=0;return z.indexOf(".")>=0&&(M=z.length-z.indexOf(".")-1),M},T.getInputDisplayValue=function(K){var z=K||T.state,M=z.focused,y=z.inputValue,W=z.value,X;M?X=y:X=T.toPrecisionAsStep(W),X==null&&(X="");var te=T.formatWrapper(X);return C(T.props.decimalSeparator)&&(te=te.toString().replace(".",T.props.decimalSeparator)),te},T.recordCursorPosition=function(){try{T.cursorStart=T.input.selectionStart,T.cursorEnd=T.input.selectionEnd,T.currentValue=T.input.value,T.cursorBefore=T.input.value.substring(0,T.cursorStart),T.cursorAfter=T.input.value.substring(T.cursorEnd)}catch(K){}},T.restoreByAfter=function(K){if(K===void 0)return!1;var z=T.input.value,M=z.lastIndexOf(K);if(M===-1)return!1;var y=T.cursorBefore.length;return T.lastKeyCode===m.a.DELETE&&T.cursorBefore.charAt(y-1)===K[0]?(T.fixCaret(y,y),!0):M+K.length===z.length?(T.fixCaret(M,M),!0):!1},T.partRestoreByAfter=function(K){return K===void 0?!1:Array.prototype.some.call(K,function(z,M){var y=K.substring(M);return T.restoreByAfter(y)})},T.isNotCompleteNumber=function(K){return isNaN(K)||K===""||K===null||K&&K.toString().indexOf(".")===K.toString().length-1},T.stop=function(){T.autoStepTimer&&clearTimeout(T.autoStepTimer)},T.down=function(K,z,M){T.pressingUpOrDown=!0,T.step("down",K,z,M)},T.up=function(K,z,M){T.pressingUpOrDown=!0,T.step("up",K,z,M)},T.saveInput=function(K){T.input=K};var F=E.value;F===void 0&&(F=E.defaultValue),T.state={focused:E.autoFocus};var U=T.getValidValue(T.toNumber(F));return T.state=r(r({},T.state),{},{inputValue:T.toPrecisionAsStep(U),value:U}),T}return Object(G.a)(g,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(T){var F=this.props,U=F.value,K=F.onChange,z=F.max,M=F.min,y=this.state.focused;if(T){if(!D(T.value,U)||!D(T.max,z)||!D(T.min,M)){var W=y?U:this.getValidValue(U),X;this.pressingUpOrDown?X=W:this.inputting?X=this.rawInput:X=this.toPrecisionAsStep(W),this.setState({value:W,inputValue:X})}var te="value"in this.props?U:this.state.value;"max"in this.props&&T.max!==z&&typeof te=="number"&&te>z&&K&&K(z),"min"in this.props&&T.min!==M&&typeof te=="number"&&te<M&&K&&K(M)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var pe=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===m.a.BACKSPACE?pe=this.cursorStart-1:this.lastKeyCode===m.a.DELETE&&(pe=this.cursorStart):pe=this.input.value.length,this.fixCaret(pe,pe)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case m.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case m.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Ie){}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(T){var F=T;return F===""?F="":this.isNotCompleteNumber(parseFloat(F))?F=this.state.value:F=this.getValidValue(F),this.toNumber(F)}},{key:"getValueFromEvent",value:function(T){var F=T.target.value.trim().replace(/。/g,".");return C(this.props.decimalSeparator)&&(F=F.replace(this.props.decimalSeparator,".")),F}},{key:"getValidValue",value:function(T){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,K=parseFloat(T);return isNaN(K)?T:(K<F&&(K=F),K>U&&(K=U),K)}},{key:"setValue",value:function(T,F){var U=this.props.precision,K=this.isNotCompleteNumber(parseFloat(T))?null:parseFloat(T),z=this.state.value,M=z===void 0?null:z,y=this.state.inputValue,W=y===void 0?null:y,X=typeof K=="number"?K.toFixed(U):"".concat(K),te=K!==M||X!=="".concat(W);return"value"in this.props?(W=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:W},F)):this.setState({value:K,inputValue:this.toPrecisionAsStep(T)},F),te&&this.props.onChange(K),K}},{key:"getMaxPrecision",value:function(T){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,U=this.props,K=U.precision,z=U.step;if(C(K))return K;var M=this.getPrecision(F),y=this.getPrecision(z),W=this.getPrecision(T);return T?Math.max(W,M+y):M+y}},{key:"getPrecisionFactor",value:function(T){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,U=this.getMaxPrecision(T,F);return Math.pow(10,U)}},{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(T){return this.props.formatter?this.props.formatter(T):T}},{key:"toPrecisionAsStep",value:function(T){if(this.isNotCompleteNumber(T)||T==="")return T;var F=Math.abs(this.getMaxPrecision(T));return isNaN(F)?T.toString():Number(T).toFixed(F)}},{key:"toNumber",value:function(T){var F=this.props.precision,U=this.state.focused,K=T&&T.length>16&&U;return this.isNotCompleteNumber(T)||K?T:C(F)?Math.round(T*Math.pow(10,F))/Math.pow(10,F):Number(T)}},{key:"upStep",value:function(T,F){var U=this.props.step,K=this.getPrecisionFactor(T,F),z=Math.abs(this.getMaxPrecision(T,F)),M=((K*T+K*U*F)/K).toFixed(z);return this.toNumber(M)}},{key:"downStep",value:function(T,F){var U=this.props.step,K=this.getPrecisionFactor(T,F),z=Math.abs(this.getMaxPrecision(T,F)),M=((K*T-K*U*F)/K).toFixed(z);return this.toNumber(M)}},{key:"step",value:function(T,F){var U=this,K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,z=arguments.length>3?arguments[3]:void 0;this.stop(),F&&(F.persist(),F.preventDefault());var M=this.props;if(M.disabled)return;var y=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(y))return;var W=this["".concat(T,"Step")](y,K),X=W>M.max||W<M.min;if(W>M.max?W=M.max:W<M.min&&(W=M.min),this.setValue(W,null),this.setState({focused:!0},function(){U.pressingUpOrDown=!1}),X)return;this.autoStepTimer=setTimeout(function(){U[T](F,K,!0)},z?c:R)}},{key:"fixCaret",value:function(T,F){if(T===void 0||F===void 0||!this.input||!this.input.value)return;try{var U=this.input.selectionStart,K=this.input.selectionEnd;(T!==U||F!==K)&&this.input.setSelectionRange(T,F)}catch(z){}}},{key:"render",value:function(){var T,F=this.props,U=F.prefixCls,K=F.disabled,z=F.readOnly,M=F.useTouch,y=F.autoComplete,W=F.upHandler,X=F.downHandler,te=F.className,pe=F.max,Ie=F.min,Ee=F.style,Te=F.title,We=F.onMouseEnter,He=F.onMouseLeave,Ce=F.onMouseOver,ue=F.onMouseOut,se=F.required,we=F.onClick,ge=F.tabIndex,Ke=F.type,st=F.placeholder,ne=F.id,$=F.inputMode,J=F.pattern,me=F.step,xe=F.maxLength,ke=F.autoFocus,$e=F.name,Pt=F.onPaste,Xt=F.onInput,Bt=Object(re.a)(F,["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"]),lt=this.state,jt=lt.value,pn=lt.focused,it=p()(U,(T={},Object(Y.a)(T,te,!!te),Object(Y.a)(T,"".concat(U,"-disabled"),K),Object(Y.a)(T,"".concat(U,"-focused"),pn),T)),Ze={};Object.keys(Bt).forEach(function(je){(je.substr(0,5)==="data-"||je.substr(0,5)==="aria-"||je==="role")&&(Ze[je]=Bt[je])});var bt=!z&&!K,Mt=this.getInputDisplayValue(null),ct=(jt||jt===0)&&(isNaN(jt)||Number(jt)>=pe),wt=(jt||jt===0)&&(isNaN(jt)||Number(jt)<=Ie),Ve=ct||K||z,Se=wt||K||z,Pe=p()("".concat(U,"-handler"),"".concat(U,"-handler-up"),Object(Y.a)({},"".concat(U,"-handler-up-disabled"),Ve)),ce=p()("".concat(U,"-handler"),"".concat(U,"-handler-down"),Object(Y.a)({},"".concat(U,"-handler-down-disabled"),Se)),de=M?{onTouchStart:Ve?l:this.up,onTouchEnd:this.stop}:{onMouseDown:Ve?l:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},be=M?{onTouchStart:Se?l:this.down,onTouchEnd:this.stop}:{onMouseDown:Se?l:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return I.a.createElement("div",{className:it,style:Ee,title:Te,onMouseEnter:We,onMouseLeave:He,onMouseOver:Ce,onMouseOut:ue,onFocus:function(){return null},onBlur:function(){return null}},I.a.createElement("div",{className:"".concat(U,"-handler-wrap")},I.a.createElement("span",Object.assign({unselectable:"on"},de,{role:"button","aria-label":"Increase Value","aria-disabled":Ve,className:Pe}),W||I.a.createElement("span",{unselectable:"on",className:"".concat(U,"-handler-up-inner"),onClick:s})),I.a.createElement("span",Object.assign({unselectable:"on"},be,{role:"button","aria-label":"Decrease Value","aria-disabled":Se,className:ce}),X||I.a.createElement("span",{unselectable:"on",className:"".concat(U,"-handler-down-inner"),onClick:s}))),I.a.createElement("div",{className:"".concat(U,"-input-wrap")},I.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Ie,"aria-valuemax":pe,"aria-valuenow":jt,required:se,type:Ke,placeholder:st,onPaste:Pt,onClick:we,onMouseUp:this.onMouseUp,className:"".concat(U,"-input"),tabIndex:ge,autoComplete:y,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:bt?this.onKeyDown:l,onKeyUp:bt?this.onKeyUp:l,autoFocus:ke,maxLength:xe,readOnly:z,disabled:K,max:pe,min:Ie,step:me,name:$e,title:Te,id:ne,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Mt),pattern:J,inputMode:$,onInput:Xt},Ze))))}}]),g}(I.a.Component);S.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:w,min:-w,step:1,style:{},onChange:l,onKeyDown:l,onPressEnter:l,onFocus:l,onBlur:l,parser:u,required:!1,autoComplete:"off"};var b=S,_=et.a=b},eozf:function(Gt,et,k){"use strict";k.d(et,"b",function(){return He}),k.d(et,"c",function(){return Ce});var re=k("sRBo"),Y=k("kaz8"),j=k("5Dmo"),G=k("3S7+"),L=k("/zsF"),P=k("PArb"),H=k("7Kak"),O=k("9yH6"),I=k("14J3"),x=k("BMrR"),p=k("+L6B"),m=k("2/Rp"),h=k("jCWc"),r=k("kPKH"),n=k("2qtc"),a=k("kLXV"),l=k("9og8"),s=k("miYZ"),u=k("tsqr"),c=k("oBTY"),R=k("k1fw"),w=k("tJVT"),C=k("OaEy"),D=k("2fM7"),S=k("iQDF"),b=k("+eQT"),_=k("WmNS"),f=k.n(_),d=k("q1tI"),g=k.n(d),E=k("/MfK"),T=k("w5pM"),F=k("Lyp1"),U=k("wd/R"),K=k.n(U),z=k("xKgJ"),M=k("ErOA"),y=k("LvDl"),W=k.n(y),X=k("1vsH"),te=k("zetH"),pe=k.n(te),Ie=k("Ty5D"),Ee=k("9kvl"),Te=k("AHFd");function We(ge,Ke){for(var st=[],ne=ge;ne<Ke;ne++)st.push(ne);return st}var He=function(Ke,st,ne){var $=Ke<K()().startOf("day"),J=Ke>K()(st).endOf("day"),me=Ke<K()(ne).startOf("day");return st?ne?K()()<=K()(ne)?me||J:$||J:Ke&&$||J:ne&&K()()<=K()(ne)?me:$},Ce=function(Ke,st){var ne=parseInt(K()(Ke).format("HH")),$=parseInt(K()().format("HH")),J=parseInt(K()().format("mm"));if(!Ke)return{disabledHours:function(){return We(0,$)},disabledMinutes:function(){return We(0,J)}};if(st){var me=parseInt(K()(st).format("HH")),xe=parseInt(K()(st).format("mm"));return K()(Ke).isSame(K()(st),"day")?{disabledHours:function(){return We(0,me)},disabledMinutes:function(){return ne<=me?We(0,xe):[]}}:void 0}return K()(Ke).isSame(K()(),"day")?{disabledHours:function(){return We(0,$)},disabledMinutes:function(){return K()(Ke).isSame(K()(),"hour")&&ne<=$?We(0,J):[]}}:void 0},ue=b.a.RangePicker,se=D.a.Option,we=function(Ke){var st,ne,$,J,me,xe,ke,$e=Ke.shixunHomeworks,Pt=Ke.loading,Xt=Ke.dispatch,Bt=Object(Ie.i)(),lt=$e.workSetting,jt=$e.workList,pn=$e.changeData,it=Object(d.useState)(!0),Ze=Object(w.a)(it,2),bt=Ze[0],Mt=Ze[1],ct=Object(d.useState)(!1),wt=Object(w.a)(ct,2),Ve=wt[0],Se=wt[1],Pe=Object(d.useState)([]),ce=Object(w.a)(Pe,2),de=ce[0],be=ce[1],je=Object(d.useState)([]),ze=Object(w.a)(je,2),ut=ze[0],Dt=ze[1],rn=Object(d.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}),mn=Object(w.a)(rn,2),gt=mn[0],Vt=mn[1];Object(d.useEffect)(function(){return Tt(),function(){be([].concat())}},[]);var Tt=function(){Xt({type:"shixunHomeworks/getWorkSetting",payload:Object(R.a)({},Bt)})};Object(d.useEffect)(function(){var Le;if(!(lt!=null&&lt.course_id))return;Object.keys(gt).map(function(tt){gt[tt]=lt[tt]}),(!gt.allow_late||!gt.unified_late)&&(gt.late_penalty=20,gt.penalty_type=Te.a.Percent),gt.unified_setting||(gt.unified_late=!1,gt.unified_anonymous_comment=!1,gt.unified_anonymous_appeal=!1),de=JSON.parse(JSON.stringify(lt.group_settings.map(function(tt){return Object(R.a)(Object(R.a)({},tt),{},{group_name:[tt.group_name]})}).filter(function(tt){return tt.publish_time!==null}))),ut=JSON.parse(JSON.stringify(lt.allow_late_settings.map(function(tt){return Object(R.a)(Object(R.a)({},tt),{},{group_name:[tt.group_name]})}).filter(function(tt){return tt.late_time!==null}))),Vt(Object(R.a)({},gt)),be(Object(c.a)(de)),((Le=ut)===null||Le===void 0?void 0:Le.length)<=0?Dt([{penalty_type:Te.a.Percent,late_penalty:20}]):Dt(Object(c.a)(ut))},[lt]);var Rt=function(){var tt,Lt,Ht=JSON.parse(JSON.stringify(gt));if(Ht.challenge_settings.filter(function(hn){return!hn.hide}),Ht.categoryId=Bt.categoryId,(tt=Ht.challenge_settings)!==null&&tt!==void 0&&tt.every(function(hn){return!hn.checked})){u.b.warn("\u5173\u5361\u4E0D\u80FD\u5168\u90E8\u8BBE\u7F6E\u4E3A\u53EF\u4E0D\u505A");return}if(gt.unified_setting||(de=(Lt=de)===null||Lt===void 0?void 0:Lt.map(function(hn){var ir;if(!hn.publish_time||!hn.end_time)throw u.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(!hn.group_name)throw u.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return hn.group_name=typeof(hn==null?void 0:hn.group_name)=="string"?[hn==null?void 0:hn.group_name]:hn==null?void 0:hn.group_name,hn.group_id=(ir=lt.group_settings)===null||ir===void 0?void 0:ir.filter(function(Un){var dn;return hn==null||((dn=hn.group_name)===null||dn===void 0)?void 0:dn.includes(Un.group_name)}).map(function(Un){return Un.group_id||Un.id}).toString().split(","),hn})),Ht.group_settings=de,gt.allow_late)if(gt.unified_late){if(gt.late_penalty===null||gt.late_penalty===void 0||gt.late_penalty<0||gt.late_penalty>100)throw u.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(!gt.late_time)throw u.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 ln;ut=(ln=ut)===null||ln===void 0?void 0:ln.map(function(hn){var ir,Un;if(hn.late_penalty===null||hn.late_penalty===void 0||hn.late_penalty<0||hn.late_penalty>100)throw u.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(!hn.late_time)throw u.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(!hn.group_name)throw u.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return hn.group_name=typeof(hn==null?void 0:hn.group_name)=="string"?[hn==null?void 0:hn.group_name]:hn==null?void 0:hn.group_name,hn.group_id=hn==null||((ir=hn.group_name)===null||ir===void 0||((Un=ir.map(function(dn){var fr,Kr,tr=(fr=lt.group_settings)===null||fr===void 0||((Kr=fr.filter(function(rr){return(rr==null?void 0:rr.group_name)===dn}))===null||Kr===void 0)?void 0:Kr[0];return tr==null?void 0:tr.group_id}))===null||Un===void 0))?void 0:Un.toString().split(","),hn}),Ht.allow_late_settings=ut}mt(Ht)},mt=function(tt){var Lt,Ht;if(tt.total_score===null){u.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}if(tt!=null&&tt.work_efficiency&&tt.eff_score===null){u.b.warn("\u6548\u7387\u5206\u4E0D\u80FD\u4E3A\u7A7A");return}var ln=tt.challenge_settings.reduce(function(Un,dn){return Un+Number(dn.challenge_score)},0);if((ln==null?void 0:ln.toFixed(10))!==((Lt=tt.total_score-tt.eff_score)===null||Lt===void 0?void 0:Lt.toFixed(10))){u.b.warn("\u6548\u7387\u5206\u52A0\u5173\u5361\u4EFB\u52A1\u603B\u5206\u5FC5\u987B\u7B49\u4E8E\u603B\u5206\u503C\uFF1A".concat(tt.total_score,"\u5206"));return}var hn={shixun_evaluation:tt.shixun_evaluation,challenge_settings:tt.challenge_settings},ir=function(){var Un=Object(l.a)(f.a.mark(function dn(){var fr;return f.a.wrap(function(tr){for(;;)switch(tr.prev=tr.next){case 0:return Se(!0),tr.next=3,Object(M.a)("/api/homework_commons/".concat(Bt.categoryId,"/publish_setting.json"),{method:"post",body:Object(R.a)({},tt)});case 3:fr=tr.sent,fr.status===0&&(u.b.success("\u66F4\u65B0\u6210\u529F"),Mt(!0),Tt(),Xt({type:"shixunHomeworks/getWorkList",payload:Object(R.a)({},Bt)})),Se(!1);case 6:case"end":return tr.stop()}},dn)}));return function(){return Un.apply(this,arguments)}}();!Object(y.isEqual)(pn,hn)&&!(jt!=null&&(Ht=jt.homework_status)!==null&&Ht!==void 0&&Ht.includes("\u672A\u53D1\u5E03"))?a.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:ir}):ir()},_e=function(tt,Lt){var Ht,ln=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"group_id";return Lt?Lt.find(function(hn){return hn[ln]===tt}):lt==null||((Ht=lt.group_settings)===null||Ht===void 0)?void 0:Ht.find(function(hn){return hn.group_id[0]===tt})},Ge=(lt==null?void 0:lt.allow_late)||(lt==null?void 0:lt.anonymous_comment),kt=function(tt){var Lt=_e(tt,lt==null?void 0:lt.allow_late_settings,"id"),Ht=_e(tt,lt==null?void 0:lt.anonymous_comment_settings);return(lt==null?void 0:lt.allow_late)&&Lt&&(Lt==null?void 0:Lt.late_time)!==null||(lt==null?void 0:lt.anonymous_comment)&&Ht&&(Ht==null?void 0:Ht.evaluation_start)!==null},vt=Object(d.useMemo)(function(){var Le;if(lt!=null&&lt.unified_setting){var tt;return!(jt!=null&&(tt=jt.homework_status)!==null&&tt!==void 0&&tt.includes("\u5DF2\u622A\u6B62"))||(lt==null?void 0:lt.allow_late)||(lt==null?void 0:lt.anonymous_comment)}var Lt=lt==null||((Le=lt.group_settings)===null||Le===void 0)?void 0:Le.some(function(Ht){return K()(Ht.end_time)<=K()()});return!Lt||(lt==null?void 0:lt.allow_late)||(lt==null?void 0:lt.all_group_late)},[lt,jt]),Qt=lt==null?void 0:lt.anonymous_comment,Jt=function(tt){if(!tt)return!1;var Lt=_e(tt,lt==null?void 0:lt.anonymous_comment_settings);return(lt==null?void 0:lt.anonymous_comment)&&Lt&&(Lt==null?void 0:Lt.evaluation_start)!==null};return g.a.createElement("section",{className:[pe.a.form," bg-white pl30 pr30 pt10"].join(" ")},g.a.createElement(x.a,null,g.a.createElement(r.a,{span:24},g.a.createElement(x.a,{align:"middle"},g.a.createElement(r.a,{flex:"1"}),g.a.createElement(r.a,null,Object(z.c)()&&bt&&g.a.createElement(m.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return Mt(!1)}},"\u7F16\u8F91\u8BBE\u7F6E")))),g.a.createElement("div",null,g.a.createElement("label",null,"\u53D1\u5E03\u65B9\u5F0F\uFF1A")," ",g.a.createElement(O.a.Group,{disabled:bt||!(jt!=null&&(st=jt.homework_status)!==null&&st!==void 0&&st.includes("\u672A\u53D1\u5E03")),value:gt.unified_setting,onChange:function(tt){var Lt;if(!(jt!=null&&(Lt=jt.homework_status)!==null&&Lt!==void 0&&Lt.includes("\u672A\u53D1\u5E03"))){u.b.error("\u5DF2\u53D1\u5E03\uFF0C\u4E0D\u80FD\u518D\u4FEE\u6539\u7EDF\u4E00\u8BBE\u7F6E");return}if(gt.unified_setting=!gt.unified_setting,gt.unified_setting||(gt.unified_late=!1),Vt(Object.assign({},gt)),gt.unified_setting===!1&&de==""){be(de.concat({}));return}gt.unified_setting&&(be([]),Dt([{late_penalty:5}]))}},g.a.createElement(O.a,{value:!0},"\u7EDF\u4E00\u53D1\u5E03"),g.a.createElement(O.a,{disabled:(lt==null||((ne=lt.group_settings)===null||ne===void 0)?void 0:ne.length)===0,value:!1},"\u5206\u73ED\u53D1\u5E03")),(lt==null||(($=lt.group_settings)===null||$===void 0)?void 0:$.length)===0&&g.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"))),gt.unified_setting&&g.a.createElement("div",null,g.a.createElement(x.a,{align:"middle",className:"mt25 pl30"},g.a.createElement(r.a,null,"\u53D1\u5E03\u65F6\u95F4:"),g.a.createElement(r.a,{className:"ml5"},g.a.createElement(b.a,{disabled:bt||!(jt!=null&&(J=jt.homework_status)!==null&&J!==void 0&&J.includes("\u672A\u53D1\u5E03")||jt!=null&&(me=jt.homework_status)!==null&&me!==void 0&&me.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(tt){return He(tt,lt==null?void 0:lt.course_end_date)},disabledTime:function(tt){return Ce(tt)},value:gt.publish_time?K()(gt.publish_time):"",onChange:function(tt,Lt){gt.publish_time=Lt,(gt.end_time==""||!gt.end_time)&&gt.unified_setting&&(gt.end_time=K()(tt).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),Vt(Object.assign({},gt))}})),g.a.createElement(r.a,null,g.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u7684\u65F6\u95F4)"))),g.a.createElement(x.a,{align:"middle",className:"mt25 pl30"},g.a.createElement(r.a,null,"\u622A\u6B62\u65F6\u95F4:"),g.a.createElement(r.a,{className:"ml5"},g.a.createElement(b.a,{style:{width:170},allowClear:!1,placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:K()(Object(X.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:bt||Ge,disabledDate:function(tt){return He(tt,lt==null?void 0:lt.course_end_date,gt.publish_time)},disabledTime:function(tt){return Ce(tt,gt.publish_time)},value:gt.end_time?K()(gt.end_time):"",onChange:function(tt,Lt){gt.end_time=Lt,Vt(Object.assign({},gt))}})),g.a.createElement(r.a,null,g.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)")))),!gt.unified_setting&&((xe=de)===null||xe===void 0?void 0:xe.length)>0&&g.a.createElement(x.a,{style:{marginTop:30,paddingTop:40,marginLeft:40,borderTop:"1px solid #eee"}},g.a.createElement(r.a,{span:24},g.a.createElement(x.a,null,g.a.createElement(r.a,{span:10}),g.a.createElement(r.a,{span:10},g.a.createElement(x.a,{className:"c-grey-c ml30"},g.a.createElement(r.a,{flex:"1"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u65F6\u95F4)"),g.a.createElement(r.a,{flex:"1"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u65F6\u95F4\u622A\u70B9)"))),g.a.createElement(r.a,{span:4}))),de&&de.map(function(Le,tt){var Lt,Ht,ln,hn,ir;return g.a.createElement(r.a,{span:24,key:tt},g.a.createElement(x.a,{gutter:[8,16]},g.a.createElement(r.a,{span:10},g.a.createElement(x.a,{gutter:[8,16]},g.a.createElement(r.a,null,"\u53D1\u5E03\u89C4\u5219 ",tt+1),g.a.createElement(r.a,{flex:"1",style:{maxWidth:300}},g.a.createElement(D.a,{disabled:bt||!(jt!=null&&(Lt=jt.homework_status)!==null&&Lt!==void 0&&Lt.includes("\u672A\u53D1\u5E03"))&&Le.id,className:"ml20",mode:"multiple",style:{width:"100%"},value:Le.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(dn){de[tt].group_name=dn,de[tt].group_id=Le.group_id;var fr=Object(y.flattenDeep)(de.map(function(tr){return tr.group_name})),Kr=ut.map(function(tr){var rr=(tr==null?void 0:tr.group_name)||[];return Object(R.a)(Object(R.a)({},tr),{},{group_name:Object(y.remove)(rr,function(Nr){return fr.includes(Nr)})})});Dt(Kr),be(de.slice())}},lt.group_settings&&lt.group_settings.map(function(Un){var dn=de.map(function(fr){return fr.group_name}).flat();if(!dn.includes(Un.group_name))return g.a.createElement(se,{value:Un.group_name,key:Un.id},Un.group_name)}))))),g.a.createElement(r.a,{span:10},g.a.createElement("div",{className:"ml30"},g.a.createElement(ue,{ranges:{\u6B64\u523B:[Le.publish_time?K()(Le.publish_time):K()(),K()()]},allowClear:!1,disabled:bt||(K()()<=K()((Ht=_e((ln=Le.group_id)===null||ln===void 0?void 0:ln[0]))===null||Ht===void 0?void 0:Ht.publish_time)?!1:[!0,kt((hn=Le.group_id)===null||hn===void 0?void 0:hn[0])]),style:{width:400},placeholder:["\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4","\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4"],disabledDate:function(dn){return He(dn,lt==null?void 0:lt.course_end_date)},disabledTime:function(dn){return Ce(dn)},showTime:{showNow:!0,format:"HH:mm",defaultValue:[K()(Object(X.d)(),"HH:mm"),K()(Object(X.d)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:Le.publish_time&&[K()(Le.publish_time),Le.end_time?K()(Le.end_time):void 0],onChange:function(dn,fr){de[tt].publish_time=fr[0],de[tt].end_time=fr[1],be(Object(c.a)(de))}}))),!bt&&g.a.createElement(r.a,{span:4},tt>0&&!Le.id&&g.a.createElement(E.a,{onClick:function(){de=de.filter(function(dn,fr){return tt!==fr}),be(de.slice()),setTimeout(function(){return be(de.slice())},10)}}),de.length<(lt==null||((ir=lt.group_settings)===null||ir===void 0)?void 0:ir.length)&&g.a.createElement(T.a,{className:"c-green ml20",onClick:function(){be(de.concat({}))}}))))})),g.a.createElement(P.a,null),g.a.createElement(x.a,null,g.a.createElement(r.a,null,g.a.createElement("strong",null,"\u8865\u4EA4\u8BBE\u7F6E"),g.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"},g.a.createElement(F.a,{style:{marginLeft:4,cursor:"pointer"}}))),g.a.createElement(r.a,{span:24,className:"mt15 pl30"},g.a.createElement(Y.a,{checked:gt.allow_late,disabled:bt||vt,onChange:function(){gt.allow_late=!gt.allow_late,ut==""&&Dt([{late_penalty:5}]),Vt(Object.assign({},gt))}},g.a.createElement("strong",null,"\u5F00\u542F\u8865\u4EA4")),g.a.createElement(G.a,{overlayStyle:{width:380,maxWidth:380},title:g.a.createElement("div",{style:{display:"flex",flexFlow:"column"}},g.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219\u8BF4\u660E"),g.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"),g.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"))},g.a.createElement(F.a,null)))),(gt==null?void 0:gt.allow_late)&&g.a.createElement("div",{style:{marginLeft:22}},g.a.createElement("div",{className:"ml30 mt20"},g.a.createElement("span",null,"\u8865\u4EA4\u65B9\u5F0F\uFF1A"),g.a.createElement(O.a.Group,{disabled:bt||(lt==null?void 0:lt.anonymous_comment)||(lt==null?void 0:lt.allow_late),value:gt.unified_late,onChange:function(tt){gt.unified_late=tt.target.value,ut==""&&!tt.target.value&&Dt([{penalty_type:Te.a.Percent,late_penalty:20}]),Vt(Object(R.a)({},gt))}},(gt==null?void 0:gt.unified_setting)&&g.a.createElement(O.a,{value:!0}," \u7EDF\u4E00\u8865\u4EA4 "),(lt==null||((ke=lt.group_settings)===null||ke===void 0)?void 0:ke.length)>0&&g.a.createElement(O.a,{value:!1}," \u5206\u73ED\u8865\u4EA4 "))),gt!=null&&gt.unified_late?g.a.createElement(g.a.Fragment,null,g.a.createElement(x.a,{align:"middle",className:"mt25 pl30"},g.a.createElement(r.a,null,"\u8865\u4EA4\u6263\u5206:"),g.a.createElement(r.a,{className:"ml5"},g.a.createElement(Te.b,{disabled:bt||Qt,value:{type:gt.penalty_type,inputValue:gt.late_penalty},onChange:function(tt){Vt(Object(R.a)(Object(R.a)({},gt),{},{late_penalty:tt.inputValue,penalty_type:tt.type}))}})),g.a.createElement(r.a,{flex:"1",className:"ml5"},g.a.createElement("span",{className:"c-grey-c ml10"},gt.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)"))),g.a.createElement(x.a,{align:"middle",className:"mt25 pl30"},g.a.createElement(r.a,null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4:"),g.a.createElement(r.a,{className:"ml5"},g.a.createElement(b.a,{allowClear:!1,style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:K()(Object(X.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:bt||Qt,value:gt.late_time?K()(gt.late_time):"",disabledDate:function(tt){return He(tt,lt==null?void 0:lt.course_end_date)},onChange:function(tt,Lt){gt.late_time=Lt,Vt(Object.assign({},gt))}})),g.a.createElement(r.a,null,g.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u201C\u5EF6\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)")))):ut.map(function(Le,tt){var Lt;return g.a.createElement(r.a,{span:24,key:tt},g.a.createElement(x.a,{className:"mt25"},g.a.createElement(r.a,{style:{marginLeft:30}},g.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219",tt+1,"\uFF1A"),g.a.createElement(D.a,{disabled:bt||!(jt!=null&&(Lt=jt.homework_status)!==null&&Lt!==void 0&&Lt.includes("\u672A\u53D1\u5E03"))&&Le.id||(lt==null?void 0:lt.anonymous_comment),mode:"multiple",style:{width:306},value:typeof Le.group_name=="string"?[Le.group_name]:Le.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(ln){ut[tt].group_name=ln,ut[tt].group_id=Le.group_id,Dt(ut.slice())}},lt.group_settings&&lt.group_settings.map(function(Ht){var ln=ut.map(function(ir){return ir.group_name}).flat(),hn=de.map(function(ir){return ir.group_name}).flat();if(gt!=null&&gt.unified_setting){if(!ln.includes(Ht.group_name))return g.a.createElement(se,{value:Ht.group_name,key:Ht.id},Ht.group_name)}else if(hn.includes(Ht.group_name)&&(!ln.includes(Ht.group_name)&&K()(Ht.end_time)<=K()()))return g.a.createElement(se,{value:Ht.group_name,key:Ht.id},Ht.group_name)}))),g.a.createElement(r.a,{className:"ml20"},g.a.createElement("span",null,"\u8865\u4EA4\u6263\u5206\uFF1A"),g.a.createElement(Te.b,{disabled:bt||Jt(Le.id),value:{type:Le.penalty_type,inputValue:Le.late_penalty},onChange:function(ln){ut[tt].late_penalty=ln.inputValue,ut[tt].penalty_type=ln.type,Dt(Object(c.a)(ut))}})),g.a.createElement(r.a,{className:"ml20"},g.a.createElement("span",null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4\uFF1A"),g.a.createElement(b.a,{disabled:bt||Jt(Le.id),style:{width:200},showTime:{format:"HH:mm",defaultValue:K()(Object(X.d)(),"HH:mm")},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",disabledDate:function(ln){return He(ln,lt==null?void 0:lt.course_end_date)},format:"YYYY-MM-DD HH:mm",value:Le!=null&&Le.late_time?K()(Le.late_time):void 0,onChange:function(ln,hn){ut[tt].late_time=hn,Dt(Object(c.a)(ut))}})),!bt&&g.a.createElement(r.a,{className:"ml20"},tt>0&&!Le.id&&g.a.createElement(E.a,{onClick:function(){ut=ut.filter(function(ln,hn){return tt!==hn}),Dt(ut.slice()),setTimeout(function(){return Dt(ut.slice())},10)}}),g.a.createElement(T.a,{className:"c-green ml20",onClick:function(){Dt(ut.concat({penalty_type:Te.a.Percent,late_minus_score:20}))}}))))})),g.a.createElement(P.a,null),!bt&&g.a.createElement(r.a,{className:"mb50"},g.a.createElement(m.a,{type:"primary",size:"large",style:{marginTop:"40px"},loading:Ve,onClick:function(){return Rt()}},"\u63D0\u4EA4"),g.a.createElement(m.a,{type:"primary",size:"large",ghost:!0,className:"ml20",onClick:function(){Mt(!0),Tt()}},"\u53D6\u6D88")))};et.a=Object(Ee.a)(function(ge){var Ke=ge.shixunHomeworks,st=ge.loading;return{shixunHomeworks:Ke,loading:st.effects}})(we)},fyJ8:function(Gt,et,k){"use strict";var re=k("rePB"),Y=k("VTBJ"),j=k("Ff2n"),G=k("U8pU"),L=k("q1tI"),P=k.n(L),H=k("TSYQ"),O=k.n(H),I=k("c+Xe"),x=k("sR1s");function p(a){return a&&Object(G.a)(a)==="object"&&!Array.isArray(a)&&!L.isValidElement(a)}function m(a){return typeof a=="string"?!0:Object(I.c)(a)}function h(a,l){var s,u=a.prefixCls,c=a.className,R=a.record,w=a.index,C=a.dataIndex,D=a.render,S=a.children,b=a.component,_=b===void 0?"td":b,f=a.colSpan,d=a.rowSpan,g=a.fixLeft,E=a.fixRight,T=a.firstFixLeft,F=a.lastFixLeft,U=a.firstFixRight,K=a.lastFixRight,z=a.appendNode,M=a.additionalProps,y=M===void 0?{}:M,W=a.ellipsis,X=a.align,te=a.rowType,pe=a.isSticky,Ie="".concat(u,"-cell"),Ee,Te;if(S)Te=S;else{var We=Object(x.b)(R,C);if(Te=We,D){var He=D(We,R,w);p(He)?(Te=He.children,Ee=He.props):Te=He}}Object(G.a)(Te)==="object"&&!Array.isArray(Te)&&!L.isValidElement(Te)&&(Te=null),W&&(F||U)&&(Te=L.createElement("span",{className:"".concat(Ie,"-content")},Te));var Ce=Ee||{},ue=Ce.colSpan,se=Ce.rowSpan,we=Ce.style,ge=Ce.className,Ke=Object(j.a)(Ce,["colSpan","rowSpan","style","className"]),st=ue!==void 0?ue:f,ne=se!==void 0?se:d;if(st===0||ne===0)return null;var $={},J=typeof g=="number",me=typeof E=="number";J&&($.position="sticky",$.left=g),me&&($.position="sticky",$.right=E);var xe={};X&&(xe.textAlign=X);var ke,$e=W===!0?{showTitle:!0}:W;$e&&($e.showTitle||te==="header")&&(typeof Te=="string"||typeof Te=="number"?ke=Te.toString():L.isValidElement(Te)&&typeof Te.props.children=="string"&&(ke=Te.props.children));var Pt=Object(Y.a)(Object(Y.a)(Object(Y.a)({title:ke},Ke),y),{},{colSpan:st&&st!==1?st:null,rowSpan:ne&&ne!==1?ne:null,className:O()(Ie,c,(s={},Object(re.a)(s,"".concat(Ie,"-fix-left"),J),Object(re.a)(s,"".concat(Ie,"-fix-left-first"),T),Object(re.a)(s,"".concat(Ie,"-fix-left-last"),F),Object(re.a)(s,"".concat(Ie,"-fix-right"),me),Object(re.a)(s,"".concat(Ie,"-fix-right-first"),U),Object(re.a)(s,"".concat(Ie,"-fix-right-last"),K),Object(re.a)(s,"".concat(Ie,"-ellipsis"),W),Object(re.a)(s,"".concat(Ie,"-with-append"),z),Object(re.a)(s,"".concat(Ie,"-fix-sticky"),(J||me)&&pe),s),y.className,ge),style:Object(Y.a)(Object(Y.a)(Object(Y.a)(Object(Y.a)({},y.style),xe),$),we),ref:m(_)?l:null});return L.createElement(_,Object.assign({},Pt),z,Te)}var r=L.forwardRef(h);r.displayName="Cell";var n=L.memo(r,function(a,l){return l.shouldCellUpdate?!l.shouldCellUpdate(l.record,a.record):!1});et.a=n},gbAR:function(Gt,et,k){"use strict";k.r(et);var re=k("Znn+"),Y=k("ZTPi"),j=k("sPJy"),G=k("bE4q"),L=k("miYZ"),P=k("tsqr"),H=k("9og8"),O=k("+L6B"),I=k("2/Rp"),x=k("k1fw"),p=k("tJVT"),m=k("WmNS"),h=k.n(m),r=k("q1tI"),n=k.n(r),a=k("Ty5D"),l=k("9kvl"),s=k("55Ip"),u=k("jhfD"),c=k("1vsH"),R=k("xKgJ"),w=k("2qtc"),C=k("kLXV"),D=k("giR+"),S=k("fyUT"),b=k("7Kak"),_=k("9yH6"),f=k("DjyN"),d=k("NUBc"),g=k("g9YV"),E=k("wCAj"),T=k("qVdP"),F=k("jsC+"),U=k("5NDa"),K=k("5rEg"),z=k("14J3"),M=k("BMrR"),y=k("sRBo"),W=k("kaz8"),X=k("jCWc"),te=k("kPKH"),pe=k("lUTK"),Ie=k("BvKs"),Ee=k("5Dmo"),Te=k("3S7+"),We=k("jrin"),He=k("oBTY"),Ce=k("y8nQ"),ue=k("Vl3Y"),se=k("8Skl"),we=k("y3Kf"),ge=k("Llu2"),Ke=k("0NbB"),st=k("wd/R"),ne=k.n(st),$=k("ErOA"),J=k("BdwD"),me=function(Q){var ve=Q.shixunHomeworks,Ae=Q.dispatch,De=Object(a.i)();return n.a.createElement(C.a,{centered:!0,title:"\u63D0\u793A",visible:ve.actionTabs.key==="\u6253\u56DE\u91CD\u505A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(H.a)(h.a.mark(function at(){var Be;return h.a.wrap(function(ht){for(;;)switch(ht.prev=ht.next){case 0:return ht.next=2,Object($.a)("/api/myshixuns/".concat(ve.actionTabs.selectArrs.myshixun_identifier,"/reset_my_game.json"),{method:"post",body:{course_id:De.coursesId}});case 2:Be=ht.sent,Be.status===0&&(P.b.success("\u5220\u9664\u6210\u529F"),Ae({type:"shixunHomeworks/setActionTabs",payload:{}}),Ae({type:"shixunHomeworks/getWorkList",payload:Object(x.a)({},ve.actionTabs.params)}));case 4:case"end":return ht.stop()}},at)})),onCancel:function(){Ae({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement("p",null,"\u8BE5\u4F5C\u4E1A\u5C06\u88AB\u6253\u56DE\u91CD\u505A\uFF0C\u5B66\u751F\u5B9E\u8BAD\u8BB0\u5F55\u5C06\u88AB\u6E05\u7A7A!"),n.a.createElement("p",null,"\u786E\u5B9A\u6253\u56DE?"))},xe=Object(l.a)(function(Nn){var Q=Nn.shixunHomeworks;return{shixunHomeworks:Q}})(me),ke=function(Q){var ve=Q.shixunHomeworks,Ae=Q.dispatch,De=Object(a.i)(),at=Object(r.useState)(!0),Be=Object(p.a)(at,2),rt=Be[0],ht=Be[1],Me=ue.a.useForm(),ft=Object(p.a)(Me,1),Ot=ft[0];return n.a.createElement(n.a.Fragment,null,n.a.createElement(C.a,{centered:!0,title:"\u8C03\u5206",visible:ve.actionTabs.key==="\u8C03\u5206",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(H.a)(h.a.mark(function Ct(){var _t,Et;return h.a.wrap(function(Fe){for(;;)switch(Fe.prev=Fe.next){case 0:return Fe.next=2,Ot.validateFields();case 2:return _t=Ot.getFieldsValue(),Fe.next=5,Object($.a)("/api/student_works/".concat(ve.actionTabs.id,"/adjust_score.json"),{method:"post",body:Object(x.a)({},_t)});case 5:Et=Fe.sent,Et.status===0&&(P.b.success("\u8BC4\u9605\u6210\u529F"),Ot.resetFields(),Ae({type:"shixunHomeworks/setActionTabs",payload:{}}),Ae({type:"shixunHomeworks/getWorkList",payload:Object(x.a)({},ve.actionTabs.params)}));case 7:case"end":return Fe.stop()}},Ct)})),onCancel:function(){Ae({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.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"),n.a.createElement(ue.a,{form:Ot,layout:"horizontal"},n.a.createElement("div",{style:{display:"flex",alignItems:"baseline"}},n.a.createElement(ue.a.Item,{label:"\u6210\u7EE9",name:"score",rules:[{required:!0,message:"\u8BF7\u8F93\u5165!"}]},n.a.createElement(S.a,{min:0,placeholder:"\u8BF7\u586B\u5199\u5206\u6570"})),n.a.createElement("span",{className:"ml10"},"\u5206")),n.a.createElement("div",null,n.a.createElement(ue.a.Item,{name:"comment"},n.a.createElement(K.a.TextArea,{placeholder:"\u8BF7\u586B\u5199\u60A8\u5BF9\u4F5C\u54C1\u8C03\u5206\u7684\u539F\u56E0",rows:8}))))))},$e=Object(l.a)(function(Nn){var Q=Nn.shixunHomeworks;return{shixunHomeworks:Q}})(ke),Pt=k("Ot1p"),Xt=k("GUfm"),Bt=k.n(Xt),lt=k("mgmH"),jt=Object(r.createRef)(),pn=function(Q){var ve,Ae,De,at,Be,rt,ht,Me,ft,Ot,Ct,_t=Q.shixunHomeworks,Et=Q.loading,St=Q.user,Fe=Q.dispatch,At=Q.zip,Zt=Q.btnLoading,sn=Q.setBtnLoading,On=Object(r.useState)(Object(x.a)(Object(x.a)({},Object(a.i)()),{page:1,limit:20})),In=Object(p.a)(On,2),Ft=In[0],$t=In[1],Fn=Object(a.h)(),Oe=_t.workList,It=Object(r.useState)({}),Ut=Object(p.a)(It,2),tn=Ut[0],un=Ut[1],Sn=Object(r.useState)(""),An=Object(p.a)(Sn,2),$n=An[0],pr=An[1],Tn=Object(r.useState)(""),jn=Object(p.a)(Tn,2),wn=jn[0],fn=jn[1],Kn=Object(r.useState)(""),yr=Object(p.a)(Kn,2),hr=yr[0],xn=yr[1],Wt=Object(r.useState)([]),qt=Object(p.a)(Wt,2),Dn=qt[0],bn=qt[1],er=Object(r.useState)(),jr=Object(p.a)(er,2),br=jr[0],Gr=jr[1],Hr=Object(r.useState)([]),mr=Object(p.a)(Hr,2),Rn=mr[0],Tr=mr[1],kr=Object(r.useState)({}),mi=Object(p.a)(kr,2),Vr=mi[0],Cr=mi[1],Fr=Object(r.useState)(!1),ti=Object(p.a)(Fr,2),Re=ti[0],qe=ti[1],ot=Object(r.useState)([]),Ne=Object(p.a)(ot,2),le=Ne[0],ye=Ne[1],fe=Object(r.useState)(!1),Ue=Object(p.a)(fe,2),Ye=Ue[0],dt=Ue[1],Qe=Object(r.useState)(),pt=Object(p.a)(Qe,2),Nt=pt[0],zt=pt[1],nn=Object(r.useState)(1),_n=Object(p.a)(nn,2),Pn=_n[0],Zn=_n[1],qn=Object(r.useState)(),cr=Object(p.a)(qn,2),lr=cr[0],ur=cr[1],gr=Object(r.useState)(),Er=Object(p.a)(gr,2),Vn=Er[0],Pr=Er[1],Qn=Object(r.useState)(),on=Object(p.a)(Qn,2),vn=on[0],dr=on[1],wr=Object(r.useState)({status:!1,visible:!0}),Wn=Object(p.a)(wr,2),xr=Wn[0],Yr=Wn[1],Sr=ue.a.useForm(),Wr=Object(p.a)(Sr,1),Rr=Wr[0];Object(r.useEffect)(function(){jt&&jt.current&&(jt.current.clientHeight>47?Yr({status:!0,visible:!0}):Yr({status:!1,visible:!0}))},[Oe.course_group_info&&Oe.course_group_info.length]),Object(r.useEffect)(function(){Oe!=null&&Oe.course_id&&(Object(R.c)()?Tr([]):Tr([Object(x.a)(Object(x.a)({},Oe),{isMe:!0})]))},[Oe==null?void 0:Oe.course_id]),Object(r.useEffect)(function(){Oe!=null&&Oe.course_id&&setTimeout(function(){bn(Object(He.a)(Oe.student_works))},400)},[Oe]);var Ar=function(){var En=Object(H.a)(h.a.mark(function yn(){var zn;return h.a.wrap(function(or){for(;;)switch(or.prev=or.next){case 0:return or.next=2,Fe({type:"shixunHomeworks/getWorkList",payload:Object(x.a)({},Ft)});case 2:zn=or.sent,Object(R.c)()?bn(Object(He.a)(zn.student_works)):bn(Object(He.a)(zn));case 4:case"end":return or.stop()}},yn)}));return function(){return En.apply(this,arguments)}}();function Or(){Zn(1),Gr(""),ur(""),Pr(""),dr(""),ye([])}var nr=function(){Ft.page=1;var yn=Object.assign({},Rr.getFieldValue());delete Ft.course_group,delete Ft.teacher_comment,Object.keys(yn).map(function(zn){switch(zn){case"teacher_comment":case"member_work":if(yn[zn].length>1||!yn[zn].length)delete Ft[zn],Rr.setFieldsValue(Object(We.a)({},zn,"all"));else{var Br;Ft[zn]=(Br=yn[zn])===null||Br===void 0?void 0:Br[0]}break;case"work_status":yn[zn].includes("all")||Oe.task_status.length===yn[zn].length||!yn[zn].length?(delete Ft.work_status,Rr.setFieldsValue(Object(We.a)({},"work_status","all"))):(Ft.work_status=yn[zn],Rr.setFieldsValue(Object(We.a)({},"work_status",Ft.work_status)));break;case"course_group_info":yn[zn].includes("all")||Oe[zn].length===yn[zn].length||!yn[zn].length?(delete Ft.course_group,Rr.setFieldsValue(Object(We.a)({},"course_group_info","all"))):(Ft.course_group=yn[zn],Rr.setFieldsValue(Object(We.a)({},"course_group_info",Ft.course_group)));break}}),Ar()},li=function(yn,zn){Ft.page=yn,Ft.limit=20,Ar()},Yi=[{name:"\u7EC4\u957F",id:1},{name:"\u7EC4\u5458",id:0}],wi=[{title:"\u5E8F\u53F7",dataIndex:"name",align:"center",width:50,fixed:"left",render:function(yn,zn,Br){return Ft.limit*(Ft.page-1)+Br+1}},{title:"\u59D3\u540D",align:"center",dataIndex:"user_name",width:90,fixed:"left",render:function(yn,zn){return n.a.createElement("div",null,yn,n.a.createElement("br",null),zn.is_leader&&n.a.createElement("span",{className:"leader"},"\u7EC4\u957F"))}},Object(R.c)()&&{title:"\u5B66\u53F7",align:"center",dataIndex:"student_id",sortOrder:Vr.student_id,sortDirections:["descend","ascend"],width:90,sorter:function(yn,zn){return yn.id-zn.id},render:function(yn){return yn}},Object(R.c)()&&{title:"\u5206\u73ED",align:"center",dataIndex:"group_name"},{title:"\u5206\u7EC4",align:"center",dataIndex:"work_group",width:70,render:function(yn){return n.a.createElement("span",{className:"c-blue"},yn)}},(Oe==null?void 0:Oe.base_on_project)&&{title:"\u5173\u8054\u9879\u76EE",align:"center",dataIndex:"base_on_project",width:70,render:function(yn,zn){var Br,or,Lr,ji,Fi,$r;return((Br=zn.project_info)===null||Br===void 0?void 0:Br.id)!==-1?n.a.createElement("a",{target:"_blank",href:"".concat((or=St.navigationInfo)===null||or===void 0||((Lr=or.top)===null||Lr===void 0)?void 0:Lr.old_url).concat((ji=zn.project_info)===null||ji===void 0?void 0:ji.id),className:"c-blue"},(Fi=zn.project_info)===null||Fi===void 0?void 0:Fi.name):($r=zn.project_info)===null||$r===void 0?void 0:$r.name}},(Oe==null?void 0:Oe.base_on_project)&&{title:"\u4EE3\u7801\u884C\u6570",align:"center",dataIndex:"code_lines_count",render:function(yn){return yn||"--"}},(Oe==null?void 0:Oe.base_on_project)&&{title:"issue\u6570\u91CF",align:"center",dataIndex:"issues_count",render:function(yn){return yn||"--"}},{title:"\u4F5C\u54C1\u72B6\u6001",dataIndex:"work_status",width:"8%",align:"center",render:function(yn){return yn===-1?"\u91CD\u505A\u4E2D":n.a.createElement(c.a,{status:yn})}},{title:"\u6253\u56DE\u6B21\u6570",dataIndex:"redo_count",width:"8%",align:"center",render:function(yn){return yn||"--"}},{title:"\u66F4\u65B0\u65F6\u95F4",align:"center",dataIndex:"update_time",sortOrder:Vr.update_time,sortDirections:["descend","ascend"],width:105,sorter:function(yn,zn){return yn.id-zn.id},render:function(yn){return yn?ne()(yn).format("YYYY-MM-DD HH:mm"):"--"}},{title:"\u6559\u5E08\u8BC4\u5206",align:"center",dataIndex:"teacher_score",width:75},{title:"\u52A9\u6559\u8BC4\u5206",align:"center",dataIndex:"teaching_asistant_score",width:75},Oe.anonymous_comment&&{title:"\u533F\u8BC4\u8BC4\u5206",align:"center",dataIndex:"student_score",width:75},(Object(R.c)()||Object(R.s)()&&!(Oe!=null&&Oe.anonymous_comment)&&!Oe.anonymous_appeal||Object(R.s)()&&((ve=Oe.homework_status)===null||ve===void 0?void 0:ve.includes("\u5DF2\u622A\u6B62")))&&{title:"\u5F53\u524D\u6210\u7EE9",width:"9%",align:"center",dataIndex:"work_score",sortOrder:Vr.work_score,sortDirections:["descend","ascend"],sorter:!0,render:function(yn){return yn}},{title:"\u64CD\u4F5C",width:"8%",align:"center",dataInex:"action",fixed:"right",render:function(yn,zn){return zn.work_status===0&&!Object(R.c)()?n.a.createElement("div",null,"--"):n.a.createElement("div",null,!Object(R.c)()&&n.a.createElement(s.a,{className:"c-blue",target:"_blank",to:"/classrooms/".concat(Ft.coursesId,"/group_homework/").concat(Ft.categoryId,"/review/").concat(zn.id)},"\u67E5\u770B"),Object(R.c)()&&n.a.createElement(s.a,{className:"c-blue",target:"_blank",to:"/classrooms/".concat(Ft.coursesId,"/group_homework/").concat(Ft.categoryId,"/review/").concat(zn.id)},zn.has_comment?"\u5DF2\u8BC4\u9605":"\u8BC4\u9605"),n.a.createElement("br",null),Object(R.c)()&&n.a.createElement(Te.a,{placement:"bottom",title:n.a.createElement("p",null,"\u8C03\u6574\u5B66\u751F\u5F53\u524D\u6210\u7EE9",n.a.createElement("br",null),"\u5176\u5B83\u5386\u53F2\u8BC4\u5206\u5C06\u5168\u90E8\u5931\u6548")},n.a.createElement("a",{className:"c-green",onClick:function(or){or.preventDefault(),Fe({type:"shixunHomeworks/setActionTabs",payload:{key:"\u8C03\u5206",selectArrs:zn,id:zn.id,params:Ft}})}},"\u8C03\u5206")))}}].filter(function(En){return!!En}),gi=Object(He.a)(wi.map(function(En){return Object(x.a)({},En)}));gi[0].render=function(En){return"\u6211"};var ei=function(){var En=Object(H.a)(h.a.mark(function yn(){var zn,Br;return h.a.wrap(function(Lr){for(;;)switch(Lr.prev=Lr.next){case 0:return sn(!0),Lr.next=3,Object($.a)("/api/homework_commons/".concat(Ft==null?void 0:Ft.categoryId,"/export_student_works.json"),{method:"get",params:JSON.parse(sessionStorage.all_student_works_params)});case 3:zn=Lr.sent,zn.status===0?(Br=At.current)===null||Br===void 0||Br.exportReport(zn.files):sn(!1);case 5:case"end":return Lr.stop()}},yn)}));return function(){return En.apply(this,arguments)}}(),Xr=function(){return n.a.createElement(Ie.a,null,n.a.createElement(Ie.a.Item,{key:"1"},n.a.createElement("span",{onClick:function(){return Object(lt.h)(JSON.parse(sessionStorage.all_student_works_params),"group_work_list")}},"\u5BFC\u51FA\u6210\u7EE9")),n.a.createElement(Ie.a.Item,{key:"3"},n.a.createElement(I.a,{loading:Zt,ghost:!0,style:{paddingLeft:0,background:"transparent"},type:"text",onClick:function(){return ei()}},"\u5BFC\u51FA\u4F5C\u54C1\u9644\u4EF6")),n.a.createElement(Ie.a.Item,{key:"2"},n.a.createElement(s.a,{to:"/classrooms/".concat(Ft.coursesId,"/exportlist/group_work_list")},"\u5386\u53F2\u5BFC\u51FA")))};return n.a.createElement("section",{className:"".concat(Bt.a.wrap," minH500")},n.a.createElement("aside",null,n.a.createElement("aside",{className:"minH500 bg-white pl30 ".concat(Object(R.c)()?"pt30":""," pr30")},!(Oe!=null&&Oe.all_member_count)&&!Et["shixunHomeworks/getWorkList"]&&((Oe==null||((Ae=Oe.homework_status)===null||Ae===void 0)?void 0:Ae.includes("\u672A\u53D1\u5E03"))||(Oe==null||((De=Oe.homework_status)===null||De===void 0)?void 0:De.includes("\u672A\u5F00\u59CB")))&&n.a.createElement("aside",{className:"bg-white inline-block w100"},n.a.createElement(J.a,null)),!Object(R.c)()&&n.a.createElement("aside",{className:"pt10 pb10"},n.a.createElement("span",{className:"c-orange"},Oe.commit_count),"\u5DF2\u4EA4",n.a.createElement("span",{className:"ml10"},Oe.uncommit_count),"\u672A\u4EA4",(Oe==null||((at=Oe.left_time)===null||at===void 0)?void 0:at.time)&&n.a.createElement("span",{className:"ml10"},n.a.createElement("span",null,Oe==null||((Be=Oe.left_time)===null||Be===void 0)?void 0:Be.status),n.a.createElement("span",{className:"c-orange"},Oe==null||((rt=Oe.left_time)===null||rt===void 0)?void 0:rt.time))),n.a.createElement("aside",null,!(Oe!=null&&(ht=Oe.homework_status)!==null&&ht!==void 0&&ht.includes("\u672A\u53D1\u5E03"))&&!(Oe!=null&&(Me=Oe.homework_status)!==null&&Me!==void 0&&Me.includes("\u672A\u5F00\u59CB"))&&n.a.createElement("aside",null,Object(R.c)()&&n.a.createElement("aside",{className:"mb30"},n.a.createElement(ue.a,{form:Rr,onChange:nr,initialValues:(ft={},Object(We.a)(ft,"member_work","all"),Object(We.a)(ft,"work_status","all"),Object(We.a)(ft,"course_group_info","all"),Object(We.a)(ft,"teacher_comment","all"),ft)},n.a.createElement(ue.a.Item,{name:"teacher_comment"},n.a.createElement(W.a.Group,{style:{width:"100%"}},n.a.createElement(M.a,null,n.a.createElement(te.a,{flex:"80px",style:{fontSize:14}},"\u4F60\u7684\u8BC4\u9605:"),n.a.createElement(te.a,{flex:"80px"},n.a.createElement(W.a,{value:"all",checked:!tn.teacher_comment},"\u5168\u90E8")),n.a.createElement(te.a,{flex:"1"},Oe.teacher_comment&&Oe.teacher_comment.map(function(En){return n.a.createElement(W.a,{value:En.id,key:En.id},En.name,"(",En.count,")")}))))),n.a.createElement(ue.a.Item,{name:"work_status"},n.a.createElement(W.a.Group,{value:[],style:{width:"100%"}},n.a.createElement(M.a,null,n.a.createElement(te.a,{flex:"80px",style:{fontSize:14}},"\u4F5C\u54C1\u72B6\u6001:"),n.a.createElement(te.a,{flex:"80px"},n.a.createElement(W.a,{value:"all",checked:!tn.work_status},"\u5168\u90E8")),n.a.createElement(te.a,{flex:"1"},Oe.task_status&&Oe.task_status.map(function(En){return n.a.createElement(W.a,{name:"work_status",value:En.id,key:En.id},En.name,"(",En.count,")")}))))),n.a.createElement(ue.a.Item,{name:"member_work"},n.a.createElement(W.a.Group,{style:{width:"100%"}},n.a.createElement(M.a,null,n.a.createElement(te.a,{flex:"80px",style:{fontSize:14}},"\u7EC4\u5185\u89D2\u8272:"),n.a.createElement(te.a,{flex:"80px"},n.a.createElement(W.a,{value:"all"},"\u5168\u90E8")),n.a.createElement(te.a,{flex:"1"},Yi.map(function(En){return n.a.createElement(W.a,{value:En.id,key:En.id},En.name)}))))),n.a.createElement(ue.a.Item,{name:"course_group_info"},n.a.createElement(W.a.Group,{style:{width:"100%"}},n.a.createElement(M.a,null,n.a.createElement(te.a,{flex:"80px",style:{fontSize:14}},"\u5206\u73ED\u60C5\u51B5:"),n.a.createElement(te.a,{flex:"80px"},n.a.createElement(W.a,{value:"all",checked:!tn.course_group},"\u5168\u90E8")),n.a.createElement(te.a,{flex:"1",className:"".concat(Bt.a.workListClass," ").concat(xr.visible?Bt.a.visible:""," ").concat(xr.status?"":Bt.a.status)},n.a.createElement("div",{ref:jt,className:Bt.a.left},Oe.course_group_info&&Oe.course_group_info.map(function(En){return n.a.createElement(W.a,{value:En.course_group_id,key:En.course_group_id},En.group_group_name,"(",En.count,")")})),xr.status&&n.a.createElement("div",{className:Bt.a.tips,onClick:function(){return Yr(Object(x.a)(Object(x.a)({},xr),{},{visible:!xr.visible}))}},n.a.createElement("span",null,xr.visible?"\u5C55\u5F00":"\u6536\u8D77",xr.visible?n.a.createElement(se.a,{style:{marginBottom:"3px",marginLeft:"2px"}}):n.a.createElement(we.a,{style:{marginBottom:"3px",marginLeft:"2px"}})))))))),n.a.createElement(M.a,{align:"middle"},n.a.createElement(te.a,{flex:"1"},n.a.createElement(M.a,{align:"middle"},n.a.createElement(te.a,null,n.a.createElement(K.a.Search,{allowClear:!0,placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D\u6216\u8005\u5B66\u53F7\u641C\u7D22",onSearch:function(yn){Ft.page=1,Ft.search=yn,Fe({type:"shixunHomeworks/getWorkList",payload:Object(x.a)({},Ft)})},style:{width:240}})),n.a.createElement(te.a,null,n.a.createElement("span",{className:"ml5 c-red"},Oe.work_count),"\u4E2A\u68C0\u7D22\u7ED3\u679C\uFF08",Oe.work_count,"\u4E2A\u5B66\u751F\uFF09"))),n.a.createElement(te.a,{style:{textAlign:"end"},className:Bt.a.workListButtonWrap},n.a.createElement(F.a,{overlay:Xr},n.a.createElement(I.a,null,n.a.createElement(ge.a,null),"\u5BFC\u51FA",n.a.createElement(Ke.a,null)))))),!!Rn.length&&n.a.createElement(E.a,{className:"mb10 ".concat(Bt.a.tableWrapper),dataSource:Rn,columns:gi,pagination:!1,showHeader:!1,loading:!1,scroll:{x:"max-content"}}),n.a.createElement("aside",{className:"mb30"},n.a.createElement(E.a,{loading:Et["shixunHomeworks/getWorkList"],className:Bt.a.tableWrapper,hideOnSinglePage:!0,pagination:!1,dataSource:Dn,columns:wi,onChange:function(yn,zn,Br){if(Vr={},Br.order===void 0){Vr[Br.field]="descend";switch(Br.field){case"student_id":pr("descend"),Ft.b_order="desc";break}}else Ft.b_order=Br.order.replace("end",""),Vr[Br.field]=Br.order;Cr(Object(x.a)({},Vr)),Ft.order=Br.field,Fe({type:"shixunHomeworks/getWorkList",payload:Object(x.a)({},Ft)})},scroll:{x:"max-content"}}))))),n.a.createElement("aside",{className:"tc mb50 mt30"},n.a.createElement(d.a,{showSizeChanger:!1,hideOnSinglePage:!0,onChange:li,defaultCurrent:Ft.page||1,current:Ft.page||1,defaultPageSize:20,total:_t.workList.work_count}))),n.a.createElement($e,null),n.a.createElement(xe,null),Re&&n.a.createElement(C.a,{title:"\u4E00\u952E\u6253\u56DE\u91CD\u505A",visible:Re,centered:!0,destroyOnClose:!0,forceRender:!0,width:700,onOk:Object(H.a)(h.a.mark(function En(){var yn,zn;return h.a.wrap(function(or){for(;;)switch(or.prev=or.next){case 0:if(!(Pn===2)){or.next=13;break}if(!(le.length<=0)){or.next=4;break}return P.b.info("\u8BF7\u9009\u62E9\u4F5C\u4E1A\u72B6\u6001"),or.abrupt("return");case 4:if(vn){or.next=7;break}return P.b.info("\u8BC4\u8BED\u4E0D\u80FD\u4E3A\u7A7A"),or.abrupt("return");case 7:return or.next=9,Object($.a)("/api/homework_commons/".concat(Ft.categoryId,"/confirm_redo_modal.json"),{method:"post",body:{id:Ft.categoryId,comment:vn,status:le}});case 9:yn=or.sent,yn.status===0&&(zt(yn),qe(!1),dt(!0)),or.next=32;break;case 13:if(!(Vn===0||lr===0)){or.next=16;break}or.next=22;break;case 16:if(Vn){or.next=19;break}return P.b.info("\u6700\u4F4E\u5206\u4E0D\u80FD\u4E3A\u7A7A"),or.abrupt("return");case 19:if(lr){or.next=22;break}return P.b.info("\u6700\u9AD8\u5206\u4E0D\u80FD\u4E3A\u7A7A"),or.abrupt("return");case 22:if(!(Vn>lr)){or.next=25;break}return P.b.info("\u6700\u9AD8\u5206\u4E0D\u80FD\u5927\u4E8E\u6700\u4F4E\u5206"),or.abrupt("return");case 25:if(vn){or.next=28;break}return P.b.info("\u8BC4\u8BED\u4E0D\u80FD\u4E3A\u7A7A"),or.abrupt("return");case 28:return or.next=30,Object($.a)("/api/homework_commons/".concat(Ft.categoryId,"/confirm_redo_modal.json"),{method:"post",body:{id:Ft.categoryId,comment:vn,min_score:Vn,max_score:lr}});case 30:zn=or.sent,zn.status===0&&(zt(zn),qe(!1),dt(!0));case 32:case"end":return or.stop()}},En)})),onCancel:function(){qe(!1),Or()}},n.a.createElement("div",{style:{padding:"32px"}},n.a.createElement("div",null,n.a.createElement("div",null,n.a.createElement("span",{style:{width:"80px"}},"\u6253\u56DE\u65B9\u5F0F\uFF1A"),n.a.createElement(_.a.Group,{value:Pn,onChange:function(yn){Zn(yn.target.value)}},n.a.createElement(_.a,{value:1},"\u6309\u6210\u7EE9\u6253\u56DE"),n.a.createElement(_.a,{value:2},"\u6309\u4F5C\u4E1A\u72B6\u6001\u6253\u56DE"))),Pn===1&&n.a.createElement("div",{style:{display:"flex",marginTop:"20px"}},n.a.createElement("span",{style:{width:"70px",textAlign:"end"}},n.a.createElement("span",{style:{color:"red"}},"*"),"\u6700\u4F4E\u5206\uFF1A"),n.a.createElement(S.a,{min:0,max:100,value:Vn,onChange:function(yn){return Pr(yn)},style:{width:"100px"}}),n.a.createElement("span",{style:{width:"80px",textAlign:"end"}},n.a.createElement("span",{style:{color:"red"}},"*"),"\u6700\u9AD8\u5206\uFF1A"),n.a.createElement(S.a,{min:0,max:100,value:lr,onChange:function(yn){return ur(yn)},style:{width:"100px"}})),Pn===2&&n.a.createElement("div",{style:{display:"flex",marginTop:"20px"}},n.a.createElement("span",{style:{width:"80px"}},"\u4F5C\u4E1A\u72B6\u6001\uFF1A"),n.a.createElement(W.a.Group,{onChange:function(yn){ye(Object(He.a)(yn))},style:{width:"100%"}},(Ot=Oe.task_status)===null||Ot===void 0?void 0:Ot.map(function(En,yn){return n.a.createElement(W.a,{name:"task_status",value:En.id},En.name,"(",En.count,")")}))),n.a.createElement("div",{style:{display:"flex",marginTop:"20px"}},n.a.createElement("span",{style:{width:"70px",textAlign:"end"}},n.a.createElement("span",{style:{color:"red"}},"*")," \u8BC4\u8BED\uFF1A"),n.a.createElement(Pt.a,{className:Bt.a.MdEditor,onChange:function(yn){return dr(yn)},placeholder:"\u8BF7\u586B\u5199\u8BC4\u8BED"}))))),Ye&&n.a.createElement(C.a,{visible:Ye,title:"\u6253\u56DE\u786E\u8BA4",onOk:Object(H.a)(h.a.mark(function En(){var yn,zn;return h.a.wrap(function(or){for(;;)switch(or.prev=or.next){case 0:if(!(Pn===2)){or.next=7;break}return or.next=3,Object($.a)("/api/homework_commons/".concat(Ft.categoryId,"/batch_redo_modal.json"),{method:"post",body:{id:Ft.categoryId,comment:vn,status:le}});case 3:yn=or.sent,yn.status===0&&(P.b.info("\u6253\u56DE\u6210\u529F"),Or(),Ar(),dt(!1)),or.next=11;break;case 7:return or.next=9,Object($.a)("/api/homework_commons/".concat(Ft.categoryId,"/batch_redo_modal.json"),{method:"post",body:{id:Ft.categoryId,comment:vn,min_score:Vn,max_score:lr}});case 9:zn=or.sent,zn.status===0&&(P.b.info("\u6253\u56DE\u6210\u529F"),Or(),Ar(),dt(!1));case 11:case"end":return or.stop()}},En)})),onCancel:function(){Or(),dt(!1)}},n.a.createElement("div",{style:{padding:"32px"}},Pn===1&&n.a.createElement("span",null,"\u786E\u8BA4\u5C06\u6210\u7EE9\u5728",Vn,"-",lr,"\u7684\u5B66\u751F\u8FDB\u884C\u6253\u56DE\u91CD\u505A\u5417\uFF1F"),Pn===2&&n.a.createElement("span",null,"\u786E\u8BA4\u5C06\u4F5C\u4E1A\u72B6\u6001\u4E3A",((Ct=Oe.task_status)===null||Ct===void 0?void 0:Ct.filter(function(En){return le==null?void 0:le.includes(En.id)}).map(function(En){return En.name}).toString())+",","\u7684\u5B66\u751F\u8FDB\u884C\u4F5C\u4E1A\u6253\u56DE\u91CD\u505A\u5417\uFF1F"),n.a.createElement("br",null),n.a.createElement("span",null,"\u8BE5\u6761\u4EF6\u4E0B\u5171\u6709",Nt==null?void 0:Nt.count,"\u540D\u5B66\u751F"))))},it=Object(l.a)(function(Nn){var Q=Nn.shixunHomeworks,ve=Nn.user,Ae=Nn.loading;return{shixunHomeworks:Q,loading:Ae.effects,user:ve}})(pn),Ze=k("m3rI"),bt=k("9Bee"),Mt=function(Q){var ve=Q.shixunHomeworks,Ae=Q.dispatch,De=Object(a.i)();return n.a.createElement(C.a,{centered:!0,title:"\u63D0\u793A",visible:ve.actionTabs.key==="\u5220\u9664",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(H.a)(h.a.mark(function at(){var Be;return h.a.wrap(function(ht){for(;;)switch(ht.prev=ht.next){case 0:return ht.next=2,Ae({type:"shixunHomeworks/deleteReply",payload:{object_id:ve.actionTabs.selectArr.id,object_type:"journals_for_message"}});case 2:Be=ht.sent,Be.status===0&&(P.b.success("\u5220\u9664\u6210\u529F"),Ae({type:"shixunHomeworks/setActionTabs",payload:{}}),Ae({type:"shixunHomeworks/getReplyList",payload:Object(x.a)({},ve.actionTabs.params)}));case 4:case"end":return ht.stop()}},at)})),onCancel:function(){Ae({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement("p",null,"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417\uFF1F"))},ct=Object(l.a)(function(Nn){var Q=Nn.shixunHomeworks;return{shixunHomeworks:Q}})(Mt),wt=k("/MfK"),Ve=k("BtR2"),Se=k("nqnY"),Pe=k.n(Se);ne.a.lang("ZH-cn");var ce=function(Q){var ve,Ae,De,at,Be=Q.shixunHomeworks,rt=Q.classroomList,ht=Q.globalSetting,Me=Q.loading,ft=Q.user,Ot=Q.dispatch,Ct=Object(r.useState)(Object(x.a)({},Object(a.i)())),_t=Object(p.a)(Ct,2),Et=_t[0],St=_t[1],Fe=Object(r.useState)(!1),At=Object(p.a)(Fe,2),Zt=At[0],sn=At[1],On=Object(r.useState)(-1),In=Object(p.a)(On,2),Ft=In[0],$t=In[1],Fn=Object(r.useState)(""),Oe=Object(p.a)(Fn,2),It=Oe[0],Ut=Oe[1],tn=Object(r.useState)(""),un=Object(p.a)(tn,2),Sn=un[0],An=un[1],$n=Be.workList,pr=rt.detailLeftMenus,Tn=Be.shixunHomeworksDetail,jn=Be.replyList,wn=Be.workDetail;return Et.page_size=10,Object(r.useEffect)(function(){Ot({type:"shixunHomeworks/getReplyList",payload:Object(x.a)({},Et)}),Ot({type:"shixunHomeworks/getWorkDetail",payload:Object(x.a)({},Et)}),pr.course_modules||Ot({type:"classroomList/getClassroomLeftMenus",payload:Object(x.a)({},Et)})},[Et.categoryId]),n.a.createElement("section",{className:Pe.a.bg},n.a.createElement("section",{className:""},n.a.createElement("aside",{className:[Pe.a.desc,"c-black","font14","bg-white"].join(" ")},Be.actionTabs.key!=="\u7F16\u8F91\u4F5C\u4E1A"&&n.a.createElement(bt.a,{value:(wn==null?void 0:wn.description)||"\u6682\u65E0\uFF5E"}),"\u5206\u7EC4\u8981\u6C42\uFF1A",wn==null||((ve=wn.group_info)===null||ve===void 0)?void 0:ve.min_num," ~ ",wn==null||((Ae=wn.group_info)===null||Ae===void 0)?void 0:Ae.max_num,"\u4EBA ",n.a.createElement("span",{className:"c-light-black"},"\uFF08\u5B66\u751F\u63D0\u4EA4\u4F5C\u54C1\u65F6\u9700\u8981\u5173\u8054\u540C\u7EC4\u6210\u5458\uFF0C\u7EC4\u5185\u6210\u5458\u4F5C\u54C1\u5171\u4EAB\uFF09"),n.a.createElement("br",null),"\u57FA\u4E8E\u9879\u76EE\u5B9E\u65BD\uFF1A",wn!=null&&(De=wn.group_info)!==null&&De!==void 0&&De.base_on_project?"\u662F":"\u5426",n.a.createElement("span",{className:"c-light-black"},"\uFF08\u5B66\u751F\u5FC5\u987B\u5728\u672C\u5E73\u53F0\u521B\u5EFA\u9879\u76EE\uFF0C\u9879\u76EE\u7BA1\u7406\u5458\u53EF\u4EE5\u63D0\u4EA4\u4F5C\u54C1\uFF09"),wn==null||((at=wn.attachments)===null||at===void 0)?void 0:at.map(function(fn,Kn){return n.a.createElement("div",null,n.a.createElement("a",{href:"".concat(Ze.a.API_SERVER).concat(fn.url)},n.a.createElement("span",{className:"iconfont icon-fujian c-green font14"}),n.a.createElement("span",{className:"ml10 c-black"},fn.title),n.a.createElement("span",{className:"c-light-black ml20 font12"},fn.filesize)))}),Be.actionTabs.key==="\u7F16\u8F91\u4F5C\u4E1A"&&n.a.createElement("aside",{className:["bg-white"].join(" ")},n.a.createElement(Pt.a,{onChange:function(Kn){Ut(Kn)},defaultValue:wn==null?void 0:wn.explanation,height:200,isFocus:!0,watch:!0}),n.a.createElement(M.a,null,n.a.createElement(te.a,{span:24,className:"tr"},n.a.createElement(I.a,{type:"default",size:"large",onClick:Object(H.a)(h.a.mark(function fn(){return h.a.wrap(function(yr){for(;;)switch(yr.prev=yr.next){case 0:Ot({type:"shixunHomeworks/setActionTabs",payload:{key:""}});case 1:case"end":return yr.stop()}},fn)}))},"\u53D6\u6D88"),n.a.createElement(I.a,{type:"primary",size:"large",className:"ml20",onClick:Object(H.a)(h.a.mark(function fn(){var Kn;return h.a.wrap(function(hr){for(;;)switch(hr.prev=hr.next){case 0:if(!(It==="")){hr.next=4;break}P.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),hr.next=8;break;case 4:return hr.next=6,Ot({type:"shixunHomeworks/updateWork",payload:{explanation:It,categoryId:Et.categoryId}});case 6:Kn=hr.sent,Kn.status===0&&(P.b.success("\u64CD\u4F5C\u6210\u529F"),Ot({type:"shixunHomeworks/setActionTabs",payload:{key:""}}),Ot({type:"shixunHomeworks/getWorkDetail",payload:Object(x.a)({},Et)}));case 8:case"end":return hr.stop()}},fn)}))},"\u4FDD\u5B58"))))),n.a.createElement("aside",{className:[Pe.a.reply,"bg-white","mt20"].join(" ")},Zt&&n.a.createElement(Pt.a,{onChange:function(Kn){Ut(Kn)},height:200,isFocus:!0,watch:!0}),n.a.createElement(M.a,{onClick:function(){sn(!0)}},n.a.createElement(te.a,{flex:"1"},!Zt&&n.a.createElement(K.a,{size:"large",className:"current",placeholder:"\u8BF4\u70B9\u4EC0\u4E48",disabled:!0})),n.a.createElement(te.a,null,n.a.createElement(I.a,{type:"primary",size:"large",onClick:Object(H.a)(h.a.mark(function fn(){var Kn;return h.a.wrap(function(hr){for(;;)switch(hr.prev=hr.next){case 0:if(!(It==="")){hr.next=4;break}P.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),hr.next=8;break;case 4:return hr.next=6,Ot({type:"shixunHomeworks/createReply",payload:{journals_for_message:{jour_id:Et.categoryId,jour_type:"HomeworkCommon",reply_id:1,notes:It}}});case 6:Kn=hr.sent,Kn.status===0&&(P.b.success("\u53D1\u5E03\u6210\u529F"),Ot({type:"shixunHomeworks/getReplyList",payload:Object(x.a)({},Et)}),sn(!1),Ut(""));case 8:case"end":return hr.stop()}},fn)}))},"\u53D1\u8868")))),(jn==null?void 0:jn.comments)&&jn.comments!=""&&n.a.createElement("aside",{className:[Pe.a.replyList,"bg-white"].join(" ")},jn==null?void 0:jn.comments.map(function(fn,Kn){var yr,hr,xn,Wt;return n.a.createElement(M.a,{gutter:[12,12],key:Kn},n.a.createElement(te.a,{flex:"40px"},n.a.createElement("img",{className:Pe.a.headpic,width:"40",src:"".concat(Ze.a.IMG_SERVER,"/images/").concat(fn==null||((yr=fn.author)===null||yr===void 0)?void 0:yr.image_url)})),n.a.createElement(te.a,{flex:"1"},n.a.createElement(M.a,{align:"middle"},n.a.createElement(te.a,{span:20},n.a.createElement("span",{className:"c-light-black"},fn==null||((hr=fn.author)===null||hr===void 0)?void 0:hr.name),n.a.createElement("span",{className:"c-light-black ml10"},fn==null?void 0:fn.time," \u53D1\u5E03")),n.a.createElement(te.a,{className:"tr",span:4},n.a.createElement("div",{className:"tr"},(Object(R.c)()||(ft==null||((xn=ft.userInfo)===null||xn===void 0)?void 0:xn.login)===(fn==null||((Wt=fn.author)===null||Wt===void 0)?void 0:Wt.login))&&n.a.createElement(Te.a,{title:"\u5220\u9664"},n.a.createElement(wt.a,{className:"current",onClick:function(){Ot({type:"shixunHomeworks/setActionTabs",payload:{key:"\u5220\u9664",params:Et,selectArr:fn}})}})))),n.a.createElement(te.a,{span:24},n.a.createElement(bt.a,{value:fn.content})),fn.children&&n.a.createElement("aside",{className:Pe.a.comment},fn.children.map(function(qt,Dn){var bn,er;return n.a.createElement(M.a,{key:Dn},n.a.createElement(te.a,{span:24},n.a.createElement(M.a,null,n.a.createElement(te.a,{flex:"1"},qt.author.name,n.a.createElement("span",{className:"c-light-black ml10"},qt==null?void 0:qt.time)),n.a.createElement(te.a,null,(Object(R.c)()||(ft==null||((bn=ft.userInfo)===null||bn===void 0)?void 0:bn.login)===(qt==null||((er=qt.author)===null||er===void 0)?void 0:er.login))&&n.a.createElement(Te.a,{title:"\u5220\u9664"},n.a.createElement(wt.a,{className:"current",onClick:function(){Ot({type:"shixunHomeworks/setActionTabs",payload:{key:"\u5220\u9664",params:Et,selectArr:qt}})}}))))),n.a.createElement(te.a,null,n.a.createElement(bt.a,{value:qt.content})))})),n.a.createElement(te.a,{span:24,className:"mt5 c-light-black"},Ft===Kn&&n.a.createElement("aside",null,n.a.createElement(Pt.a,{onChange:function(Dn){An(Dn)},height:150,isFocus:!0}),n.a.createElement(M.a,null,n.a.createElement(te.a,{span:24,className:"tr"},n.a.createElement(I.a,{type:"primary",size:"large",onClick:Object(H.a)(h.a.mark(function qt(){return h.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:if(!(Sn==="")){bn.next=4;break}P.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),bn.next=9;break;case 4:return bn.next=6,Ot({type:"shixunHomeworks/createReply",payload:{journals_for_message:{jour_id:Et.categoryId,jour_type:"HomeworkCommon",m_parent_id:fn.id,reply_id:1,notes:Sn}}});case 6:Ot({type:"shixunHomeworks/getReplyList",payload:Object(x.a)({},Et)}),P.b.success("\u53D1\u5E03\u6210\u529F"),$t(-1);case 9:case"end":return bn.stop()}},qt)}))},"\u53D1\u8868")))),Ft!==Kn&&n.a.createElement("div",{className:"tr"},n.a.createElement("span",{className:"iconfont icon-huifu1 mr5 ml30",onClick:function(){return $t(Kn)}}),!!fn.user_praise&&n.a.createElement("span",{className:"c-orange"},n.a.createElement(Ve.a,{className:"mr5 ml30",onClick:Object(H.a)(h.a.mark(function qt(){return h.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return bn.next=2,Ot({type:"shixunHomeworks/replyUnLike",payload:{object_id:fn.id,object_type:"journals_for_message"}});case 2:Ot({type:"shixunHomeworks/getReplyList",payload:Object(x.a)({},Et)});case 3:case"end":return bn.stop()}},qt)}))}),!!fn.praise_count&&fn.praise_count),!fn.user_praise&&n.a.createElement("span",null,n.a.createElement(Ve.a,{className:"mr5 ml30",onClick:Object(H.a)(h.a.mark(function qt(){return h.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return bn.next=2,Ot({type:"shixunHomeworks/replyLike",payload:{object_id:fn.id,object_type:"journals_for_message"}});case 2:Ot({type:"shixunHomeworks/getReplyList",payload:Object(x.a)({},Et)});case 3:case"end":return bn.stop()}},qt)}))}),!!fn.praise_count&&fn.praise_count))))))}))),n.a.createElement("aside",{className:"tc mt30 pb30"},n.a.createElement(d.a,{defaultCurrent:1,total:jn==null?void 0:jn.total_count,hideOnSinglePage:!0,current:Et.page||1,onChange:function(Kn){Et.page=Kn,Ot({type:"shixunHomeworks/getReplyList",payload:Object(x.a)({},Et)})}})),n.a.createElement(ct,null))},de=Object(l.a)(function(Nn){var Q=Nn.shixunHomeworks,ve=Nn.classroomList,Ae=Nn.user,De=Nn.loading,at=Nn.globalSetting;return{shixunHomeworks:Q,globalSetting:at,user:Ae,classroomList:ve,loading:De.effects}})(ce);ne.a.lang("ZH-cn");var be=function(Q){var ve,Ae=Q.shixunHomeworks,De=Q.classroomList,at=Q.globalSetting,Be=Q.loading,rt=Q.dispatch,ht=Object(a.i)(),Me=De.detailLeftMenus,ft=Ae.replyList,Ot=Ae.referenceAnswer;return ht.page_size=10,Object(r.useEffect)(function(){rt({type:"shixunHomeworks/getReplyList",payload:Object(x.a)({},ht)}),rt({type:"shixunHomeworks/getReferenceAnswer",payload:{coursesId:ht.categoryId}}),Me.course_modules||rt({type:"classroomList/getClassroomLeftMenus",payload:Object(x.a)({},ht)})},[ht.categoryId]),n.a.createElement("section",{className:"pb30 pl30 pr30 pt30 bg-white"},n.a.createElement("aside",{className:["c-black","font14"].join(" ")},Ae.actionTabs.key!=="\u7F16\u8F91\u4F5C\u4E1A"&&n.a.createElement("div",null,(Ot==null?void 0:Ot.reference_answer)&&n.a.createElement(bt.a,{value:Ot==null?void 0:Ot.reference_answer}),!(Ot!=null&&Ot.reference_answer)&&n.a.createElement(J.a,null)),Ot==null||((ve=Ot.attachments)===null||ve===void 0)?void 0:ve.map(function(Ct,_t){return n.a.createElement("div",null,n.a.createElement("a",{href:"".concat(Ze.a.API_SERVER).concat(Ct.url)},n.a.createElement("span",{className:"iconfont icon-fujian c-green font14"}),n.a.createElement("span",{className:"ml10 c-black"},Ct.title),n.a.createElement("span",{className:"c-light-black ml20 font12"},Ct.filesize)))})))},je=Object(l.a)(function(Nn){var Q=Nn.shixunHomeworks,ve=Nn.classroomList,Ae=Nn.loading,De=Nn.globalSetting;return{shixunHomeworks:Q,globalSetting:De,classroomList:ve,loading:Ae.effects}})(be),ze=k("iQDF"),ut=k("+eQT"),Dt=k("PpiC"),rn=k("oUNq"),mn=k("4wi7"),gt=k("eozf"),Vt=function(Q){var ve=Q.classroomList,Ae=Q.dispatch,De=Q.courseEndTime,at=Object(Dt.a)(Q,["classroomList","dispatch","courseEndTime"]),Be=Object(a.i)(),rt=ue.a.useForm(),ht=Object(p.a)(rt,1),Me=ht[0],ft=Object(r.useState)(1),Ot=Object(p.a)(ft,2),Ct=Ot[0],_t=Ot[1],Et=Object(r.useState)([]),St=Object(p.a)(Et,2),Fe=St[0],At=St[1],Zt=Object(r.useState)(0),sn=Object(p.a)(Zt,2),On=sn[0],In=sn[1],Ft=Object(r.useState)(20),$t=Object(p.a)(Ft,2),Fn=$t[0],Oe=$t[1],It=Object(r.useState)(!0),Ut=Object(p.a)(It,2),tn=Ut[0],un=Ut[1],Sn=Object(r.useState)(!1),An=Object(p.a)(Sn,2),$n=An[0],pr=An[1],Tn=Object(r.useState)(!1),jn=Object(p.a)(Tn,2),wn=jn[0],fn=jn[1],Kn=Object(r.useState)([]),yr=Object(p.a)(Kn,2),hr=yr[0],xn=yr[1],Wt=Object(r.useState)(!0),qt=Object(p.a)(Wt,2),Dn=qt[0],bn=qt[1];Object(r.useEffect)(function(){ve.actionTabs.key==="\u7ACB\u5373\u53D1\u5E03"&&er()},[ve.actionTabs]),Object(r.useEffect)(function(){if($n){if(wn)return;Ae({type:"classroomList/setActionTabs",payload:{}}),Object(R.c)()?Ae({type:"classroomList/getClassroomTeacherCommonList",payload:Object(x.a)(Object(x.a)({},ve.actionTabs.params),{},{type:1})}):Ae({type:"classroomList/getClassroomCommonList",payload:Object(x.a)({},ve.actionTabs.params)})}},[$n]);var er=function(){var mr=Object(H.a)(h.a.mark(function Rn(Tr){var kr,mi;return h.a.wrap(function(Cr){for(;;)switch(Cr.prev=Cr.next){case 0:return un(!0),Cr.next=3,Object(rn.D)(Object(x.a)(Object(x.a)({},Be),{},{page:Tr||Ct,limit:2e4,homework_id:ve.actionTabs.type===1?"":ve.actionTabs.selectArrs[0]}));case 3:kr=Cr.sent,kr==null||kr.course_groups.map(function(Fr){Fr.key=Fr.id,Fr.title=Fr.name,Fr.disabled=Fr.is_published}),kr&&(At([].concat(Object(He.a)(Fe),Object(He.a)(kr==null?void 0:kr.course_groups))),In(kr==null?void 0:kr.course_groups_count),un(!1),Tr||Me.setFieldsValue((mi={},Object(We.a)(mi,"publish_time",ne()(ne()(new Date).add(0,"days").format("YYYY-MM-DD HH:mm"))),Object(We.a)(mi,"end_time",ne()(ne()(new Date(Object(c.b)("/"))).add(7,"days").format("YYYY-MM-DD HH:mm"))),mi)));case 6:case"end":return Cr.stop()}},Rn)}));return function(Tr){return mr.apply(this,arguments)}}(),jr=function(Rn){_t(Rn),er(Rn)},br=function(){var mr=Object(H.a)(h.a.mark(function Rn(){var Tr,kr,mi;return h.a.wrap(function(Cr){for(;;)switch(Cr.prev=Cr.next){case 0:if(Tr=Object(x.a)({},Me.getFieldsValue()),!(Tr.end_time<=Tr.publish_time)){Cr.next=4;break}return P.b.info("\u622A\u6B62\u65F6\u95F4\u4E0D\u80FD\u5927\u4E8E\u6216\u7B49\u4E8E\u53D1\u5E03\u65F6\u95F4"),Cr.abrupt("return");case 4:if(!((hr==null?void 0:hr.length)<=0&&!Dn&&Fe.length>0)){Cr.next=7;break}return P.b.info("\u53D1\u5E03\u73ED\u7EA7\u4E0D\u80FD\u4E3A\u7A7A"),Cr.abrupt("return");case 7:return kr={homework_ids:Object(He.a)(ve.actionTabs.selectArrs),group_ids:hr.map(function(Fr){return Fr.id}),end_time:ne()(Tr.end_time).format("YYYY-MM-DD HH:mm"),publish_time:ne()(Tr.publish_time).format("YYYY-MM-DD HH:mm"),unified_setting:Dn},Cr.next=10,Object($.a)("/api/courses/".concat(Be.coursesId,"/homework_commons/publish_with_homework_list_position.json"),{method:"post",body:Object(x.a)({},kr)});case 10:mi=Cr.sent,mi.status===0&&(Object(c.cb)(["\u6559\u5B66\u8BFE\u5802","\u56FE\u6587\u4F5C\u4E1A","\u7ACB\u5373\u53D1\u5E03"]),P.b.success("\u53D1\u5E03\u6210\u529F"),Ae({type:"classroomList/setActionTabs",payload:{key:"\u6E05\u9664\u9009\u62E9\u6570\u636E"}}),at.type==="edit"&&(at.onCallback&&at.onCallback()),Object(R.c)()?ve.actionTabs.detail?(Ae({type:"shixunHomeworks/setActionTabs",payload:{}}),Ae({type:"shixunHomeworks/getWorkList",payload:Object(x.a)({},Be)}),Ae({type:"shixunHomeworks/getWorkSetting",payload:Object(x.a)({},Be)})):Ae({type:"classroomList/getClassroomTeacherCommonList",payload:Object(x.a)(Object(x.a)({},ve.actionTabs.params),{},{type:3})}):Ae({type:"classroomList/getClassroomCommonList",payload:Object(x.a)({},ve.actionTabs.params)}),localStorage.getItem("Noviceguide")==="0"||Ae({type:"shixunHomeworks/setActionTabs",payload:{key:"\u5E95\u90E8\u5F39\u7A97",type:13,text:n.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 Cr.stop()}},Rn)}));return function(){return mr.apply(this,arguments)}}(),Gr=function(){_t(1),At([]),xn([])},Hr=On>Ct*Fn;return n.a.createElement(C.a,{width:600,centered:!0,title:"\u53D1\u5E03\u4F5C\u4E1A",visible:ve.actionTabs.key==="\u7ACB\u5373\u53D1\u5E03",okText:"\u53D1\u5E03\u4F5C\u4E1A",cancelText:"\u6682\u4E0D\u53D1\u5E03",onOk:br,onCancel:function(){Gr(),Ae({type:"classroomList/setActionTabs",payload:{}})}},n.a.createElement("p",{className:"tc"},"\u5B66\u751F\u5C06\u7ACB\u5373\u6536\u5230\u4F5C\u4E1A",n.a.createElement("br",null),'\u672C\u64CD\u4F5C\u53EA\u5BF9"\u672A\u53D1\u5E03"\u7684\u4F5C\u4E1A\u6709\u6548'),Fe&&n.a.createElement(ue.a,{form:Me},n.a.createElement("div",{style:{paddingLeft:0}},n.a.createElement(M.a,{className:"mt30",align:"middle"},n.a.createElement(te.a,null,n.a.createElement(ue.a.Item,{name:"publish_time",label:"\u53D1\u5E03\u65F6\u95F4"},n.a.createElement(ut.a,{style:{width:155,marginRight:"25px"},getPopupContainer:function(Rn){return Rn.parentNode},disabledDate:function(Rn){return Object(gt.b)(Rn,De)},disabledTime:function(Rn){return Object(gt.c)(Rn)},placeholder:"\u8BF7\u9009\u62E9\u7ED3\u675F\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:ne()(Object(c.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",allowClear:!1}))),n.a.createElement(te.a,{className:"ml20"},n.a.createElement(ue.a.Item,{name:"end_time",label:"\u622A\u6B62\u65F6\u95F4"},n.a.createElement(ut.a,{style:{width:170},getPopupContainer:function(Rn){return Rn.parentNode},placeholder:"\u8BF7\u9009\u62E9\u7ED3\u675F\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:ne()(Object(c.d)(),"HH:mm")},disabledDate:function(Rn){return Object(gt.b)(Rn,De,Me.getFieldValue("publish_time"))},disabledTime:function(Rn){return Object(gt.c)(Rn,Me.getFieldValue("publish_time"))},format:"YYYY-MM-DD HH:mm",allowClear:!1})))),ve.actionTabs.type===2&&n.a.createElement(M.a,{style:{marginBottom:"10px"}},n.a.createElement("span",{className:"mr5"},"\u53D1\u5E03\u8BBE\u7F6E:"),n.a.createElement(_.a.Group,{value:Dn,onChange:function(Rn){bn(Rn.target.value),xn([])}},n.a.createElement(_.a,{value:!0},"\u7EDF\u4E00\u53D1\u5E03"),n.a.createElement(_.a,{className:"ml20",disabled:Fe.length<=0,value:!1},"\u5206\u73ED\u53D1\u5E03"))),Fe.length<=0&&ve.actionTabs.type===2&&n.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"')),(ve.actionTabs.type===1||!Dn)&&Fe.length>0&&n.a.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"10px"}},n.a.createElement("span",{style:{flex:1}},n.a.createElement(W.a,{checked:hr.length===Fe.length,onChange:function(Rn){hr.length===Fe.length?xn([]):xn(Fe.filter(function(Tr){return!Tr.is_published}))}},"\u5168\u9009")," "),n.a.createElement("span",{style:{width:16}}),n.a.createElement("span",{style:{flex:1}},"\u5DF2\u9009\u62E9",hr.length||0,"\u4E2A\u5206\u73ED")),(ve.actionTabs.type===1||!Dn)&&Fe.length>0&&n.a.createElement(mn.a,{data:Fe,selectedRowKeys:hr,setSelectedRowKeys:xn})))},Tt=Object(l.a)(function(Nn){var Q=Nn.classroomList;return{classroomList:Q}})(Vt),Rt=k("qbod"),mt=k.n(Rt),_e=function(Q){var ve=Q.classroomList,Ae=Q.dispatch,De=Q.cb,at=Object(Dt.a)(Q,["classroomList","dispatch","cb"]),Be=Object(a.i)(),rt=Object(r.useState)(null),ht=Object(p.a)(rt,2),Me=ht[0],ft=ht[1],Ot=Object(r.useState)([1,2,3,4,5]),Ct=Object(p.a)(Ot,2),_t=Ct[0],Et=Ct[1],St=Object(r.useState)(!1),Fe=Object(p.a)(St,2),At=Fe[0],Zt=Fe[1];Object(r.useEffect)(function(){ve.actionTabs.key==="\u667A\u80FD\u5206\u7EC4"},[ve.actionTabs]);var sn=function(){var In=Object(H.a)(h.a.mark(function Ft(){var $t;return h.a.wrap(function(Oe){for(;;)switch(Oe.prev=Oe.next){case 0:if(Me){Oe.next=3;break}return P.b.warn("\u6BCF\u4E2A\u5C0F\u7EC4\u5B66\u751F\u4EBA\u6570\u4E0D\u80FD\u4E3A\u7A7A"),Oe.abrupt("return");case 3:return Oe.next=5,Object($.a)("/api/is_checkout_data.json",{method:"get",params:{id:Be==null?void 0:Be.categoryId,group_num:Me}});case 5:$t=Oe.sent,($t==null?void 0:$t.status)===0&&(Ae({type:"classroomList/setActionTabs",payload:{}}),De());case 7:case"end":return Oe.stop()}},Ft)}));return function(){return In.apply(this,arguments)}}(),On=[{id:1,name:"\u603B\u5B66\u65F6"},{id:2,name:"\u6D3B\u8DC3\u65F6\u6BB5"},{id:3,name:"\u5386\u53F2\u6210\u7EE9"},{id:4,name:"\u4E0A\u8BFE\u6B21\u6570"},{id:5,name:"\u4E92\u52A8\u6B21\u6570"}];return n.a.createElement(C.a,{width:500,centered:!0,afterClose:function(){Zt(!1),ft(null),Et([1,2,3,4,5])},title:"\u667A\u80FD\u5206\u7EC4",visible:ve.actionTabs.key==="\u667A\u80FD\u5206\u7EC4",footer:null,onCancel:function(){Ae({type:"classroomList/setActionTabs",payload:{}})}},n.a.createElement("div",{className:mt.a.model},n.a.createElement("div",null,"\u6BCF\u4E2A\u5C0F\u7EC4\u5B66\u751F\u4EBA\u6570\uFF1A",n.a.createElement(S.a,{min:1,max:100,value:Me,onChange:function(Ft){ft(Ft)}})),n.a.createElement("div",{className:"mt20 mb10"},"\u5206\u7EC4\u89C4\u5219\uFF1A"),n.a.createElement(W.a.Group,{value:_t,onChange:function(Ft){Et(Ft)}},On==null?void 0:On.map(function(In,Ft){return n.a.createElement(W.a,{value:In.id}," ",In.name," ")})),n.a.createElement("div",{className:"tr mb10 mt20"},n.a.createElement(I.a,{onClick:sn,type:"primary"},"\u5F00\u59CB\u667A\u80FD\u5206\u7EC4"))))},Ge=Object(l.a)(function(Nn){var Q=Nn.classroomList;return{classroomList:Q}})(_e),kt=function(Q){var ve=Q.classroomList,Ae=Q.dispatch,De=Q.courseEndTime,at=Object(Dt.a)(Q,["classroomList","dispatch","courseEndTime"]),Be=Object(a.i)(),rt=ue.a.useForm(),ht=Object(p.a)(rt,1),Me=ht[0],ft=Object(r.useState)(1),Ot=Object(p.a)(ft,2),Ct=Ot[0],_t=Ot[1],Et=Object(r.useState)([]),St=Object(p.a)(Et,2),Fe=St[0],At=St[1],Zt=Object(r.useState)(0),sn=Object(p.a)(Zt,2),On=sn[0],In=sn[1],Ft=Object(r.useState)(20),$t=Object(p.a)(Ft,2),Fn=$t[0],Oe=$t[1],It=Object(r.useState)(!0),Ut=Object(p.a)(It,2),tn=Ut[0],un=Ut[1],Sn=Object(r.useState)(),An=Object(p.a)(Sn,2),$n=An[0],pr=An[1],Tn=Object(r.useState)([]),jn=Object(p.a)(Tn,2),wn=jn[0],fn=jn[1];Be.id=Be.coursesId,Object(r.useEffect)(function(){ve.actionTabs.key==="\u7ACB\u5373\u622A\u6B62"?Kn():(fn([]),At([]))},[ve.actionTabs.key]);var Kn=function(){var xn=Object(H.a)(h.a.mark(function Wt(qt){var Dn,bn,er;return h.a.wrap(function(br){for(;;)switch(br.prev=br.next){case 0:return un(!0),br.next=3,Object(rn.D)(Object(x.a)(Object(x.a)({},Be),{},{page:qt||Ct,limit:Fn,homework_id:ve.actionTabs.type===1?"":ve.actionTabs.selectArrs[0],end_homework_action:!0}));case 3:Dn=br.sent,Dn==null||Dn.course_groups.map(function(Gr){Gr.key=Gr.id}),Dn&&(At([].concat(Object(He.a)(Fe),Object(He.a)(Dn==null?void 0:Dn.course_groups))),In(Dn==null?void 0:Dn.group_count),pr(Dn==null?void 0:Dn.course_groups),un(!1),qt||Me.setFieldsValue((er={},Object(We.a)(er,"group_ids",Dn==null||((bn=Dn.course_groups)===null||bn===void 0)?void 0:bn.map(function(Gr){return String(Gr.id)})),Object(We.a)(er,"end_time",ne()(ne()(new Date).add(0,"days").format("YYYY-MM-DD HH:mm"))),er)));case 6:case"end":return br.stop()}},Wt)}));return function(qt){return xn.apply(this,arguments)}}(),yr=function(){var xn=Object(H.a)(h.a.mark(function Wt(){var qt,Dn;return h.a.wrap(function(er){for(;;)switch(er.prev=er.next){case 0:return qt=Object(x.a)({},Me.getFieldsValue()),console.log("----",qt.group_ids),er.next=4,Object($.a)("/api/courses/".concat(Be.id,"/homework_commons/end_with_homework_list_position.json"),{method:"post",body:{homework_ids:Object(He.a)(ve.actionTabs.selectArrs),group_ids:(wn==null?void 0:wn.length)>0?wn:[],unified_setting:!(Fe!=null&&Fe.length),end_time:ne()(qt.end_time).format("YYYY-MM-DD HH:mm")}});case 4:Dn=er.sent,Dn.status===0&&(hr(),Object(c.cb)(["\u6559\u5B66\u8BFE\u5802","\u56FE\u6587\u4F5C\u4E1A","\u7ACB\u5373\u622A\u6B62"]),P.b.success("\u64CD\u4F5C\u6210\u529F"),Ae({type:"classroomList/setActionTabs",payload:{key:"\u6E05\u9664\u9009\u62E9\u6570\u636E"}}),at.type==="edit"&&(at.onCallback&&at.onCallback()),Object(R.c)()?(Ae({type:"classroomList/setActionTabs",payload:{}}),Ae({type:"classroomList/getClassroomTeacherCommonList",payload:Object(x.a)(Object(x.a)({},ve.actionTabs.params),{},{type:3})})):Ae({type:"classroomList/getClassroomCommonList",payload:Object(x.a)({},ve.actionTabs.params)}));case 6:case"end":return er.stop()}},Wt)}));return function(){return xn.apply(this,arguments)}}(),hr=function(){_t(1),At([])};return n.a.createElement(C.a,{centered:!0,title:"\u622A\u6B62\u4F5C\u4E1A",visible:ve.actionTabs.key==="\u7ACB\u5373\u622A\u6B62",okText:"\u622A\u6B62\u4F5C\u4E1A",cancelText:"\u6682\u4E0D\u622A\u6B62",onOk:yr,onCancel:function(){hr(),Ae({type:"classroomList/setActionTabs",payload:{}})}},n.a.createElement("p",{className:"tc"},"\u5B66\u751F\u5C06\u4E0D\u80FD\u518D\u63D0\u4EA4\u4F5C\u4E1A",n.a.createElement("br",null),'\u672C\u64CD\u4F5C\u53EA\u5BF9"\u63D0\u4EA4\u4E2D" \u201C\u8865\u4EA4\u4E2D\u201D\u7684\u4F5C\u4E1A\u6709\u6548'),Fe&&n.a.createElement(ue.a,{form:Me},n.a.createElement(M.a,null,n.a.createElement("span",{className:"mr5"},"\u622A\u6B62\u65F6\u95F4:"),n.a.createElement(ue.a.Item,{name:"end_time"},n.a.createElement(ut.a,{style:{width:170},getPopupContainer:function(Wt){return Wt.parentNode},disabledDate:function(Wt){return Object(gt.b)(Wt,De)},disabledTime:function(Wt){return Object(gt.c)(Wt)},placeholder:"\u8BF7\u9009\u62E9\u7ED3\u675F\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:ne()(Object(c.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",allowClear:!1}))),($n==null?void 0:$n.length)>0&&n.a.createElement(M.a,null,n.a.createElement("span",{className:"mr5"},"\u9009\u62E9\u73ED\u7EA7:"),n.a.createElement(K.a.Search,{style:{width:"300px"},onChange:function(Wt){At($n.filter(function(qt){return qt.name.indexOf(Wt.target.value)>-1}))}})),(Fe==null?void 0:Fe.length)>0&&ve.actionTabs.type===1&&n.a.createElement(E.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(Wt,qt){fn(Wt)}},rowKey:"id",pagination:!1,dataSource:Fe,columns:[{title:"\u73ED\u7EA7",dataIndex:"name",key:"name"}]}),(Fe==null?void 0:Fe.length)>0&&ve.actionTabs.type===2&&n.a.createElement(E.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(Wt,qt){fn(Wt)}},rowKey:"id",pagination:!1,dataSource:Fe,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"}]})))},vt=Object(l.a)(function(Nn){var Q=Nn.classroomList;return{classroomList:Q}})(kt),Qt=k("rAM+"),Jt=k("LvDl"),Le=k("8B0h"),tt=k.n(Le),Lt=k("CiB2"),Ht=function(Q){var ve,Ae;Object(Lt.a)(Q);var De=Object(r.useState)(!0),at=Object(p.a)(De,2),Be=at[0],rt=at[1],ht=Object(r.useState)(!1),Me=Object(p.a)(ht,2),ft=Me[0],Ot=Me[1],Ct=Object(r.useState)([]),_t=Object(p.a)(Ct,2),Et=_t[0],St=_t[1],Fe=Object(r.useState)([]),At=Object(p.a)(Fe,2),Zt=At[0],sn=At[1],On=Object(r.useState)([]),In=Object(p.a)(On,2),Ft=In[0],$t=In[1],Fn=Object(r.useState)([]),Oe=Object(p.a)(Fn,2),It=Oe[0],Ut=Oe[1],tn=Object(a.i)();function un(){return Sn.apply(this,arguments)}function Sn(){return Sn=Object(H.a)(h.a.mark(function Tn(){var jn;return h.a.wrap(function(fn){for(;;)switch(fn.prev=fn.next){case 0:return fn.next=2,Object($.a)("/api/homework_commons/".concat(tn.categoryId,"/homework_common_collaborators.json"),{method:"get"});case 2:jn=fn.sent,sn(jn);case 4:case"end":return fn.stop()}},Tn)})),Sn.apply(this,arguments)}function An(){return $n.apply(this,arguments)}function $n(){return $n=Object(H.a)(h.a.mark(function Tn(){var jn;return h.a.wrap(function(fn){for(;;)switch(fn.prev=fn.next){case 0:return fn.next=2,Object($.a)("/api/courses/".concat(tn==null?void 0:tn.coursesId,"/teachers"),{method:"get",params:{homework_id:tn.categoryId}});case 2:jn=fn.sent,jn==null||jn.teacher_list.map(function(Kn){Kn.key=Kn.user_id}),$t(jn==null?void 0:jn.teacher_list),Ut(jn==null?void 0:jn.teacher_list);case 6:case"end":return fn.stop()}},Tn)})),$n.apply(this,arguments)}Object(r.useEffect)(function(){un(),An()},[tn]);var pr=function(){};return n.a.createElement("section",{className:[tt.a.form," bg-white pl30 pr30 pt10"].join(" ")},n.a.createElement(M.a,null,n.a.createElement(te.a,{flex:"1"},n.a.createElement("span",{style:{fontSize:"16px"}},"\u534F\u4F5C\u8BBE\u7F6E"),(Zt==null?void 0:Zt.can_edit)&&n.a.createElement("span",{style:{cursor:"pointer",color:"#0152d9",marginLeft:"10px"},onClick:function(){Ot(!0)}},"+\u6DFB\u52A0\u534F\u4F5C\u8005"))),n.a.createElement(M.a,{style:{marginTop:"20px",marginBottom:"20px"}},(Zt==null||((ve=Zt.data)===null||ve===void 0)?void 0:ve.length)<=0&&n.a.createElement(J.a,{customText:"\u8BE5\u4F5C\u4E1A\u6682\u65E0\u534F\u4F5C\u8005"}),Zt==null||((Ae=Zt.data)===null||Ae===void 0)?void 0:Ae.map(function(Tn){return n.a.createElement("span",{key:Tn.id,style:{display:"inline-flex",height:"40px",borderRadius:"4px",border:"1px solid #44D7B6",padding:"7px 20px",color:"#44D7B6",marginRight:"40px",marginBottom:20}},n.a.createElement("span",{style:{flex:"1"}},Tn==null?void 0:Tn.real_name),(Zt==null?void 0:Zt.can_edit)&&n.a.createElement("span",{style:{cursor:"pointer",marginLeft:"10px"},onClick:Object(H.a)(h.a.mark(function jn(){var wn;return h.a.wrap(function(Kn){for(;;)switch(Kn.prev=Kn.next){case 0:return Kn.next=2,Object($.a)("/api/homework_commons/".concat(tn.categoryId,"/homework_common_collaborators/delete.json"),{method:"delete",body:{user_id:Tn.id}});case 2:wn=Kn.sent,wn.status===0&&(P.b.info("\u5220\u9664\u6210\u529F"),un(),An());case 4:case"end":return Kn.stop()}},jn)}))},"X"))})),n.a.createElement(M.a,null,!Be&&n.a.createElement(te.a,{className:"mb50"},n.a.createElement(I.a,{type:"primary",size:"large",onClick:function(){return pr()}},"\u63D0\u4EA4"),n.a.createElement(I.a,{type:"primary",size:"large",ghost:!0,className:"ml20",onClick:function(){rt(!0)}},"\u53D6\u6D88"))),n.a.createElement(C.a,{title:"\u6DFB\u52A0\u534F\u4F5C\u8005",visible:ft,onCancel:function(){return Ot(!1)},onOk:Object(H.a)(h.a.mark(function Tn(){var jn;return h.a.wrap(function(fn){for(;;)switch(fn.prev=fn.next){case 0:if(!(Et.length===0)){fn.next=3;break}return P.b.info("\u8BF7\u9009\u62E9\u534F\u4F5C\u8001\u5E08"),fn.abrupt("return");case 3:return fn.next=5,Object($.a)("/api/homework_commons/".concat(tn.categoryId,"/homework_common_collaborators.json"),{method:"post",body:{user_ids:Et}});case 5:jn=fn.sent,jn.status===0&&(P.b.info("\u6DFB\u52A0\u6210\u529F"),St([]),un(),An(),Ot(!1));case 7:case"end":return fn.stop()}},Tn)}))},n.a.createElement("div",null,n.a.createElement("div",{style:{display:"flex"}},n.a.createElement("label",{style:{width:"50px"}},"\u59D3\u540D\uFF1A")," ",n.a.createElement(K.a.Search,{onChange:function(jn){$t(It.filter(function(wn){return wn.name.indexOf(jn.target.value)>-1}))}})),n.a.createElement(E.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(jn,wn){St(jn)},selectedRowKeys:Et,getCheckboxProps:function(jn){return{disabled:jn.is_collaborator}}},pagination:!1,dataSource:Ft,columns:[{title:"\u59D3\u540D",dataIndex:"name",key:"name"},{title:"\u89D2\u8272",dataIndex:"role",key:"role"}]}))))},ln=Object(l.a)(function(Nn){var Q=Nn.shixunHomeworks,ve=Nn.loading;return{shixunHomeworks:Q,loading:ve.effects}})(Ht),hn=k("AHFd"),ir=k("OaEy"),Un=k("2fM7"),dn=k("w5pM"),fr=k("Lyp1"),Kr=ut.a.RangePicker,tr=Un.a.Option,rr=function(Q){var ve,Ae,De,at,Be,rt=Q.disabled,ht=Q.setDisabled,Me=Q.data,ft=Q.setData,Ot=Q.shixunHomeworks,Ct=Q.groupSettings,_t=Q.setGroupSetting,Et=Q.repairSettings,St=Q.setRepairSetting,Fe=Ot.workSetting,At=Ot.workList,Zt=Object(r.useMemo)(function(){var Oe;if(Fe!=null&&Fe.unified_setting){var It;return!(At!=null&&(It=At.homework_status)!==null&&It!==void 0&&It.includes("\u5DF2\u622A\u6B62"))||(Fe==null?void 0:Fe.allow_late)||(Fe==null?void 0:Fe.anonymous_comment)}var Ut=Fe==null||((Oe=Fe.group_settings)===null||Oe===void 0)?void 0:Oe.some(function(tn){return ne()(tn.end_time)<=ne()()});return!Ut||(Fe==null?void 0:Fe.allow_late)||(Fe==null?void 0:Fe.all_group_late)},[Fe,At]),sn=function(It,Ut){var tn,un=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"group_id";return Ut?Ut.find(function(Sn){return Sn[un]===It}):Fe==null||((tn=Fe.group_settings)===null||tn===void 0)?void 0:tn.find(function(Sn){return Sn.group_id[0]===It})},On=(Fe==null?void 0:Fe.allow_late)||(Fe==null?void 0:Fe.anonymous_comment),In=function(It){var Ut=sn(It,Fe==null?void 0:Fe.allow_late_settings,"id"),tn=sn(It,Fe==null?void 0:Fe.anonymous_comment_settings);return(Fe==null?void 0:Fe.allow_late)&&Ut&&(Ut==null?void 0:Ut.late_time)!==null||(Fe==null?void 0:Fe.anonymous_comment)&&tn&&(tn==null?void 0:tn.evaluation_start)!==null},Ft=Fe==null?void 0:Fe.anonymous_comment,$t=function(It){if(!It)return!1;var Ut=sn(It,Fe==null?void 0:Fe.anonymous_comment_settings);return(Fe==null?void 0:Fe.anonymous_comment)&&Ut&&(Ut==null?void 0:Ut.evaluation_start)!==null},Fn=function(It){var Ut=sn(It,Fe==null?void 0:Fe.anonymous_comment_settings);return Ut&&(Ut==null?void 0:Ut.evaluation_start)!==null};return n.a.createElement("div",{className:"bg-white pl30 pr30 pb30"},n.a.createElement(M.a,null,n.a.createElement(te.a,{span:24},n.a.createElement(M.a,{align:"middle"},n.a.createElement(te.a,{flex:"1"},n.a.createElement("h1",{className:"mt15"},"\u53D1\u5E03\u8BBE\u7F6E")),n.a.createElement(te.a,null,Object(R.c)()&&rt&&n.a.createElement(I.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return ht(!1)}},"\u7F16\u8F91\u8BBE\u7F6E")))),(Fe==null||((ve=Fe.group_settings)===null||ve===void 0)?void 0:ve.length)>0?n.a.createElement(te.a,{span:24,className:"mt10"},n.a.createElement(W.a,{checked:Me.unified_setting,disabled:rt||!(At!=null&&(Ae=At.homework_status)!==null&&Ae!==void 0&&Ae.includes("\u672A\u53D1\u5E03")),onChange:function(){var It;if(!(At!=null&&(It=At.homework_status)!==null&&It!==void 0&&It.includes("\u672A\u53D1\u5E03"))){P.b.error("\u5DF2\u53D1\u5E03\uFF0C\u4E0D\u80FD\u518D\u4FEE\u6539\u7EDF\u4E00\u8BBE\u7F6E");return}if(Me.unified_setting=!Me.unified_setting,Me.unified_setting||(Me.unified_late=!1),ft(Object.assign({},Me)),Ct==""){_t([{}]);return}Me.unified_setting&&(_t([]),St([{late_penalty:5}]))}},n.a.createElement("strong",null,"\u7EDF\u4E00\u8BBE\u7F6E")),n.a.createElement("span",{className:"c-grey-c font12"},"(\u9009\u4E2D\u5219\u6240\u6709\u5206\u73ED\u4F7F\u7528\u76F8\u540C\u7684\u53D1\u5E03\u8BBE\u7F6E\uFF0C\u4EC5\u8BFE\u5802\u7BA1\u7406\u5458\u53EF\u4FEE\u6539\uFF1B\u5426\u5219\u5404\u4E2A\u5206\u73ED\u5141\u8BB8\u5355\u72EC\u8BBE\u7F6E)")):null),Me.unified_setting&&n.a.createElement("div",null,n.a.createElement(M.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(te.a,null,"\u53D1\u5E03\u65F6\u95F4:"),n.a.createElement(te.a,{className:"ml5"},n.a.createElement(ut.a,{style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:ne()(Object(c.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",allowClear:!1,disabled:rt||!(At!=null&&(De=At.homework_status)!==null&&De!==void 0&&De.includes("\u672A\u53D1\u5E03")||At!=null&&(at=At.homework_status)!==null&&at!==void 0&&at.includes("\u672A\u5F00\u59CB")),value:Me.publish_time?ne()(Me.publish_time):"",disabledDate:function(It){return Object(gt.b)(It,Fe==null?void 0:Fe.course_end_date)},disabledTime:function(It){return Object(gt.c)(It)},onChange:function(It,Ut){Me.publish_time=Ut,!Me.end_time&&Me.unified_setting&&(Me.end_time=ne()(It).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),ft(Object.assign({},Me))}})),n.a.createElement(te.a,null,n.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u7684\u65F6\u95F4)"))),n.a.createElement(M.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(te.a,null,"\u622A\u6B62\u65F6\u95F4:"),n.a.createElement(te.a,{className:"ml5"},n.a.createElement(ut.a,{allowClear:!1,style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:ne()(Object(c.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:rt||On,disabledDate:function(It){return Object(gt.b)(It,Fe==null?void 0:Fe.course_end_date,Me.publish_time)},disabledTime:function(It){return Object(gt.c)(It,Me.publish_time)},value:Me.end_time?ne()(Me.end_time):"",onChange:function(It,Ut){Me.end_time=Ut,ft(Object.assign({},Me))}})),n.a.createElement(te.a,null,n.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)")))),!Me.unified_setting&&n.a.createElement(M.a,{style:{marginTop:30,paddingTop:40,marginLeft:40,borderTop:"1px solid #eee"}},n.a.createElement(te.a,{span:24},n.a.createElement(M.a,null,n.a.createElement(te.a,{span:10}),n.a.createElement(te.a,{span:1}),n.a.createElement(te.a,{span:9},n.a.createElement(M.a,{className:"c-grey-c "},n.a.createElement(te.a,{flex:"1"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u65F6\u95F4)"),n.a.createElement(te.a,{flex:"1"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u65F6\u95F4\u622A\u70B9)"))),n.a.createElement(te.a,{span:4}))),Ct&&Ct.map(function(Oe,It){var Ut,tn,un,Sn,An;return n.a.createElement(te.a,{span:24,key:It},n.a.createElement(M.a,null,n.a.createElement(te.a,{span:10},n.a.createElement(M.a,{gutter:[8,16]},n.a.createElement(te.a,null,"\u53D1\u5E03\u89C4\u5219 ",It+1),n.a.createElement(te.a,{flex:"auto",style:{maxWidth:350}},n.a.createElement(Un.a,{disabled:rt||!(At!=null&&(Ut=At.homework_status)!==null&&Ut!==void 0&&Ut.includes("\u672A\u53D1\u5E03"))&&Oe.id,className:"ml20",mode:"multiple",style:{width:"100%"},value:Oe.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(pr){Ct[It].group_name=pr,Ct[It].group_id=Oe.group_id;var Tn=Object(Jt.flattenDeep)(Ct.map(function(wn){return wn.group_name})),jn=Et.map(function(wn){var fn=(wn==null?void 0:wn.group_name)||[];return Object(x.a)(Object(x.a)({},wn),{},{group_name:Object(Jt.remove)(fn,function(Kn){return Tn.includes(Kn)})})});St(jn),_t(Ct.slice())}},Fe.group_settings&&Fe.group_settings.map(function($n){if(!Ct.map(function(pr){return pr.group_name}).toString().split(",").includes(String($n.group_name)))return n.a.createElement(tr,{value:$n.group_name,key:$n.id},$n.group_name)}))))),n.a.createElement(te.a,{span:1}),n.a.createElement(te.a,{span:9},n.a.createElement(Kr,{allowClear:!1,ranges:{\u6B64\u523B:[Oe.publish_time?ne()(Oe.publish_time):ne()(),ne()()]},disabled:rt||(ne()()<=ne()((tn=sn((un=Oe.group_id)===null||un===void 0?void 0:un[0]))===null||tn===void 0?void 0:tn.publish_time)?!1:[!0,In((Sn=Oe.group_id)===null||Sn===void 0?void 0:Sn[0])]),style:{width:400},placeholder:["\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4","\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4"],disabledDate:function(pr){return Object(gt.b)(pr,Fe==null?void 0:Fe.course_end_date)},disabledTime:function(pr){return Object(gt.c)(pr)},showTime:{format:"HH:mm",defaultValue:[ne()(Object(c.d)(),"HH:mm"),ne()(Object(c.d)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:Oe.publish_time&&[ne()(Oe.publish_time),ne()(Oe.end_time)],onChange:function(pr,Tn){Ct[It].publish_time=Tn[0],Ct[It].end_time=Tn[1],_t(Object(He.a)(Ct))}})),!rt&&n.a.createElement(te.a,{span:4},It>0&&!Oe.id&&n.a.createElement(wt.a,{onClick:function(){Ct=Ct.filter(function(pr,Tn){return It!==Tn}),_t(Ct.slice()),setTimeout(function(){return _t(Ct.slice())},10)}}),Ct.length<(Fe==null||((An=Fe.group_settings)===null||An===void 0)?void 0:An.length)&&n.a.createElement(dn.a,{className:"c-green ml20",onClick:function(){_t(Ct.concat({}))}}))))})),n.a.createElement(M.a,null,n.a.createElement(te.a,null,n.a.createElement("strong",null,"\u8865\u4EA4\u8BBE\u7F6E"),n.a.createElement(Te.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"},n.a.createElement(fr.a,{style:{marginLeft:4,cursor:"pointer"}}))),n.a.createElement(te.a,{span:24,className:"mt15 pl30"},n.a.createElement(W.a,{checked:Me.allow_late,disabled:rt||Zt,onChange:function(){Me.allow_late=!Me.allow_late,Et==""&&St([{late_penalty:5}]),ft(Object.assign({},Me))}},n.a.createElement("strong",null,"\u5F00\u542F\u8865\u4EA4")),n.a.createElement("span",{className:"c-grey-c font12"},"(\u9009\u4E2D\uFF0C\u5219\u5141\u8BB8\u5B66\u751F\u5EF6\u65F6\u63D0\u4EA4\u4F5C\u54C1)"))),(Me==null?void 0:Me.allow_late)&&n.a.createElement("div",{style:{marginLeft:22}},n.a.createElement("div",{className:"ml30 mt20"},n.a.createElement("span",null,"\u8865\u4EA4\u65B9\u5F0F\uFF1A"),n.a.createElement(_.a.Group,{disabled:rt||(Fe==null?void 0:Fe.anonymous_comment)||(Fe==null?void 0:Fe.allow_late),value:Me.unified_late,onChange:function(It){Me.unified_late=It.target.value,Et==""&&!It.target.value&&St([{late_penalty:5}]),ft(Object(x.a)({},Me))}},(Me==null?void 0:Me.unified_setting)&&n.a.createElement(_.a,{value:!0}," \u7EDF\u4E00\u8865\u4EA4 "),(Fe==null||((Be=Fe.group_settings)===null||Be===void 0)?void 0:Be.length)&&n.a.createElement(_.a,{value:!1}," \u5206\u73ED\u8865\u4EA4 "))),Me!=null&&Me.unified_late?n.a.createElement(n.a.Fragment,null,n.a.createElement(M.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(te.a,null,"\u8865\u4EA4\u6263\u5206:"),n.a.createElement(te.a,{className:"ml5"},n.a.createElement(S.a,{disabled:rt||Ft,min:0,value:Me.late_penalty,onChange:function(It){Me.late_penalty=It,ft(Object.assign({},Me))}})),n.a.createElement(te.a,{flex:"1",className:"ml5"},"\u5206",n.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)"))),n.a.createElement(M.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(te.a,null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4:"),n.a.createElement(te.a,{className:"ml5"},n.a.createElement(ut.a,{allowClear:!1,style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:ne()(Object(c.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:rt||Ft,value:Me.late_time?ne()(Me.late_time):"",disabledDate:function(It){return Object(gt.b)(It,Fe==null?void 0:Fe.course_end_date)},disabledTime:function(It){return Object(gt.c)(It)},onChange:function(It,Ut){Me.late_time=Ut,ft(Object.assign({},Me))}})),n.a.createElement(te.a,null,n.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u201C\u5EF6\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)")))):Et.map(function(Oe,It){var Ut;return n.a.createElement(te.a,{span:24,key:It},n.a.createElement(M.a,{className:"mt25",align:"middle"},n.a.createElement(te.a,{style:{marginLeft:30}},n.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219",It+1,"\uFF1A"),n.a.createElement(Un.a,{disabled:rt||!(At!=null&&(Ut=At.homework_status)!==null&&Ut!==void 0&&Ut.includes("\u672A\u53D1\u5E03"))&&Oe.id,mode:"multiple",style:{width:306},value:typeof Oe.group_name=="string"?[Oe.group_name]:Oe.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(un){Et[It].group_name=un,Et[It].group_id=Oe.group_id,St(Et.slice())}},Fe.group_settings&&Fe.group_settings.map(function(tn){if(Me!=null&&Me.unified_setting&&(!Et.map(function(un){return un.group_name}).toString().split(",").includes(String(tn.group_name))&&!Fn(tn.id)))return n.a.createElement(tr,{value:tn.group_name,key:tn.id},tn.group_name);if(Ct.map(function(un){return un.group_name}).toString().split(",").includes(String(tn.group_name))&&(!Et.map(function(un){return un.group_name}).toString().split(",").includes(String(tn.group_name))&&ne()(tn.end_time)<=ne()()&&!Fn(tn.id)))return n.a.createElement(tr,{value:tn.group_name,key:tn.id},tn.group_name)}))),n.a.createElement(te.a,{className:"ml20"},n.a.createElement("span",null,"\u8865\u4EA4\u6263\u5206\uFF1A"),n.a.createElement(S.a,{min:0,max:100,disabled:rt||$t(Oe.id),defaultValue:Oe.late_penalty,onChange:function(un){Et[It].late_penalty=un,Et[It].penalty_type=hn.a.Number}})),n.a.createElement(te.a,{className:"ml20"},n.a.createElement("span",null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4\uFF1A"),n.a.createElement(ut.a,{disabled:rt||$t(Oe.id),style:{width:200},showTime:{format:"HH:mm",defaultValue:ne()(Object(c.d)(),"HH:mm")},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",disabledDate:function(un){return Object(gt.b)(un,Fe==null?void 0:Fe.course_end_date)},disabledTime:function(un){return Object(gt.c)(un)},format:"YYYY-MM-DD HH:mm",value:Oe!=null&&Oe.late_time?ne()(Oe.late_time):void 0,onChange:function(un,Sn){Et[It].late_time=Sn,St(Object(He.a)(Et))}})),!rt&&n.a.createElement(te.a,{className:"ml20"},It>0&&!Oe.id&&n.a.createElement(wt.a,{onClick:function(){Et=Et.filter(function(un,Sn){return It!==Sn}),St(Et.slice()),setTimeout(function(){return St(Et.slice())},10)}}),n.a.createElement(dn.a,{className:"c-green ml20",onClick:function(){St(Et.concat({penalty_type:hn.a.Number,late_penalty:5}))}}))))})))},Nr=Object(l.a)(function(Nn){var Q=Nn.shixunHomeworks;return{shixunHomeworks:Q}})(rr),oi=k("Q9mQ"),hi=k("diRs"),an=function(Q){var ve=Q.disabled,Ae=Q.setDisabled,De=Q.data,at=Q.setData,Be=Q.shixunHomeworks,rt=Be.workSetting,ht=Be.workList;return n.a.createElement("div",{className:"bg-white pl30 pr30 pb30"},n.a.createElement(M.a,{align:"middle"},n.a.createElement(te.a,{flex:"1"},n.a.createElement("h1",{className:"mt15"},"\u8BC4\u5206\u8BBE\u7F6E")),n.a.createElement(te.a,null,Object(R.c)()&&ve&&n.a.createElement(I.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return Ae(!1)}},"\u7F16\u8F91\u8BBE\u7F6E"))),n.a.createElement(M.a,{className:"mt25",style:{paddingLeft:40}},n.a.createElement(te.a,null,n.a.createElement("strong",null,"\u52A9\u6559\u8BC4\u5206")),n.a.createElement(te.a,{span:24,className:"pl30 mt10"})),n.a.createElement(M.a,{style:{paddingLeft:65}},n.a.createElement(_.a.Group,{disabled:ve,value:De.ta_mode,onChange:function(ft){De.ta_mode=ft.target.value,at(Object(x.a)({},De))}},n.a.createElement(_.a,{value:1,style:{marginTop:15}},n.a.createElement("strong",null,"\u666E\u901A\u6A21\u5F0F"),n.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")),n.a.createElement("br",null),n.a.createElement(_.a,{value:0,style:{marginTop:15}},n.a.createElement("strong",null,"\u590D\u5BA1\u6A21\u5F0F"),n.a.createElement("span",{className:"c-grey-c"},"\uFF08\u9009\u4E2D\uFF0C\u5219\u53EA\u53D6\u6700\u65B0\u7684\u52A9\u6559\u8BC4\u5206\uFF09")))),n.a.createElement(M.a,{className:"mt25",style:{paddingLeft:40}},n.a.createElement(te.a,null,n.a.createElement("strong",null,"\u6700\u7EC8\u6210\u7EE9\u7EC4\u6210\uFF1A")),n.a.createElement(te.a,{span:24,className:"pl30 mt10"})),n.a.createElement(M.a,{style:{paddingLeft:65}},n.a.createElement(_.a.Group,{disabled:ve,value:De.final_mode,onChange:function(ft){De.final_mode=ft.target.value,at(Object(x.a)({},De))}},n.a.createElement(_.a,{value:!1,style:{marginTop:15}},n.a.createElement("strong",null,"\u591A\u9879\u8BC4\u5206\u914D\u6BD4"),n.a.createElement("span",{className:"c-grey-c"},"\uFF08\u9009\u4E2D\uFF0C\u5219\u6309\u7167\u6BD4\u4F8B\u8BA1\u7B97\u6700\u7EC8\u6210\u7EE9\uFF09",n.a.createElement(hi.a,{overlayClassName:"edu-popover",placement:"bottomLeft",content:n.a.createElement("span",{className:"font14"},"\u8BA1\u7B97\u8BF4\u660E\uFF1A",n.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 - ( ",n.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 )",n.a.createElement("br",null),n.a.createElement("br",null),"\u6CE8\u610F",n.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",n.a.createElement("br",null),"\u8BC4\u5206\u9009\u9879\u4E0A\u3002",n.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",n.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"),trigger:"click"},n.a.createElement("span",{className:"mt10 ml10 current font14"},n.a.createElement(fr.a,null))))),n.a.createElement(M.a,{align:"middle",className:"mt25 pl30 font14"},n.a.createElement(te.a,null,"\u6559\u5E08\u8BC4\u5206:"),n.a.createElement(te.a,{className:"ml5"},n.a.createElement(S.a,{disabled:ve,value:De.te_proportion,onChange:function(ft){De.te_proportion=ft,at(Object.assign({},De))}}),n.a.createElement("span",{className:"ml10"},"%"))),n.a.createElement(M.a,{align:"middle",className:"mt25 pl30 font14"},n.a.createElement(te.a,null,"\u52A9\u6559\u8BC4\u5206:"),n.a.createElement(te.a,{className:"ml5"},n.a.createElement(S.a,{disabled:ve,value:De.ta_proportion,onChange:function(ft){De.ta_proportion=ft,at(Object.assign({},De))}}),n.a.createElement("span",{className:"ml10"},"%"))),n.a.createElement(M.a,{align:"middle",className:"mt25 pl30 font14"},n.a.createElement(te.a,null,"\u5B66\u751F\u533F\u8BC4:"),n.a.createElement(te.a,{className:"ml5"},n.a.createElement(S.a,{disabled:ve,value:De.st_proportion,onChange:function(ft){De.st_proportion=ft,at(Object.assign({},De))}}),n.a.createElement("span",{className:"ml10"},"%"))),n.a.createElement("br",null),n.a.createElement(_.a,{value:!0,style:{marginTop:15}},n.a.createElement("strong",null,"\u5355\u9879\u8BC4\u5206\u4F18\u5148"),n.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",n.a.createElement(hi.a,{overlayClassName:"edu-popover",placement:"bottomLeft",content:n.a.createElement("span",{className:"font14"},"\u8BA1\u7B97\u8BF4\u660E\uFF1A",n.a.createElement("br",null),"\u4F18\u5148\u987A\u5E8F\u6392\u524D\u7684\u975E\u96F6\u8BC4\u5206 * 100% - ",n.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 )",n.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"),trigger:"click"},n.a.createElement("span",{className:"mt10 ml10 current font14"},n.a.createElement(fr.a,null)))),n.a.createElement("br",null),n.a.createElement("span",null,"\uFF08\u6559\u5E08\u8BC4\u5206 \u2192 \u6559\u8F85\u8BC4\u5206 \u2192 \u5B66\u751F\u533F\u8BC4\u8BC4\u5206\uFF09")))))},Xn=Object(l.a)(function(Nn){var Q=Nn.shixunHomeworks;return{shixunHomeworks:Q}})(an),fi=function(Q){var ve=Q.disabled,Ae=Q.setDisabled,De=Q.data,at=Q.setData,Be=Q.shixunHomeworks,rt=Be.workSetting,ht=Be.workList;return n.a.createElement("div",{className:"bg-white pl30 pr30 pb30"},n.a.createElement(M.a,null,n.a.createElement(te.a,{span:24},n.a.createElement(M.a,{align:"middle"},n.a.createElement(te.a,{flex:"1"},n.a.createElement("h1",{className:"mt15"},"\u516C\u5F00\u8BBE\u7F6E")),n.a.createElement(te.a,null,Object(R.c)()&&ve&&n.a.createElement(I.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return Ae(!1)}},"\u7F16\u8F91\u8BBE\u7F6E")))),n.a.createElement(te.a,{span:24,className:"mt15 pl30"},n.a.createElement(W.a,{checked:De.work_public,disabled:ve,onChange:function(ft){De.work_public=ft.target.checked,at(Object.assign({},De))}},n.a.createElement("strong",null,"\u516C\u5F00\u4F5C\u54C1")),n.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)")),n.a.createElement(te.a,{span:24,className:"mt15 pl30"},n.a.createElement(W.a,{checked:De.score_open,disabled:ve,onChange:function(ft){De.score_open=ft.target.checked,at(Object.assign({},De))}},n.a.createElement("strong",null,"\u516C\u5F00\u6210\u7EE9")),n.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)")),n.a.createElement(te.a,{span:24,className:"mt15 pl30 pb40"},n.a.createElement(W.a,{checked:De.answer_public,disabled:ve,onChange:function(ft){De.answer_public=ft.target.checked,at(Object.assign({},De))}},n.a.createElement("strong",null,"\u516C\u5F00\u7B54\u6848")),n.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)"))))},Ei=Object(l.a)(function(Nn){var Q=Nn.shixunHomeworks;return{shixunHomeworks:Q}})(fi),ri=k("/zsF"),ii=k("PArb"),ee=k("TreJ"),A=k("yHk2"),N=k("4KPa"),V=k("cguq"),oe=k("6fgh"),q=function(Q,ve){if(ve==="comment"){var Ae=Q==null?void 0:Q.filter(function(Me){return Me.evaluation_end!==null});if(Ae.length===0)return[{deleteflag:!0}];var De=Object(oe.b)(Ae,["evaluation_start","evaluation_end"]),at=De.map(function(Me){return Object(x.a)(Object(x.a)({},Me),{},{evaluation_start:[Me.evaluation_start,Me.evaluation_end],group_name:[Me.group_name],deleteflag:!1})});return at}else if(ve==="appeal"){var Be=Q==null?void 0:Q.filter(function(Me){return Me.appeal_time!==null});if(Be.length===0)return[{deleteflag:!0}];var rt=Object(oe.b)(Be,["appeal_time"]),ht=rt.map(function(Me){return Object(x.a)(Object(x.a)({},Me),{},{group_name:[Me.group_name],deleteflag:!1})});return ht}},Je=function(Q){var ve,Ae,De,at,Be,rt=Q.disabled,ht=Q.setDisabled,Me=Q.data,ft=Q.setData,Ot=Q.shixunHomeworks,Ct=Q.commentGroupSelectOptions,_t=Q.appealGroupSelectOptions,Et=Q.groupCommentFormInstance,St=Q.groupAppealFormInstance,Fe=Ot.workSetting,At=Ot.workList,Zt=(Fe==null||((ve=Fe.homework_status)===null||ve===void 0)?void 0:ve.includes("\u5DF2\u622A\u6B62"))||(Ct==null?void 0:Ct.length)>0,sn=(Fe==null||((Ae=Fe.anonymous_appeal_settings)===null||Ae===void 0)?void 0:Ae.length)>0,On=(Fe==null?void 0:Fe.anonymous_comment)&&(Fe==null?void 0:Fe.unified_anonymous_comment)&&(At==null||((De=At.homework_status)===null||De===void 0)?void 0:De.includes("\u5DF2\u622A\u6B62"))||sn;return n.a.createElement("div",{className:"bg-white pl30 pr30 pb30"},n.a.createElement(M.a,null,n.a.createElement(te.a,{span:24},n.a.createElement(M.a,{align:"middle"},n.a.createElement(te.a,{flex:"1"},n.a.createElement(M.a,{align:"middle",className:"mt15"},n.a.createElement("h1",{style:{marginBottom:0}},"\u533F\u8BC4\u8BBE\u7F6E"),n.a.createElement(Te.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"},n.a.createElement(fr.a,{style:{marginLeft:4,cursor:"pointer"}})))),n.a.createElement(te.a,null,Object(R.c)()&&rt&&n.a.createElement(I.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return ht(!1)}},"\u7F16\u8F91\u8BBE\u7F6E")))),n.a.createElement(te.a,{span:24,className:"mt15 pl30"},n.a.createElement(W.a,{checked:Me.anonymous_comment,disabled:rt||!Zt||(Fe==null?void 0:Fe.anonymous_comment),onChange:function(){Me.anonymous_comment=!Me.anonymous_comment,Me.allow_late&&!Me.evaluation_start?Me.late_time&&Me.late_time!=""&&(Me.evaluation_start=ne()(Me.late_time).add(14,"day").format("YYYY-MM-DD HH:mm:ss"),Me.evaluation_end=ne()(Me.late_time).add(28,"day").format("YYYY-MM-DD HH:mm:ss")):Me.unified_setting&&!Me.evaluation_start&&(Me.end_time&&Me.end_time!=""&&(Me.evaluation_start=ne()(Me.end_time).add(14,"day").format("YYYY-MM-DD HH:mm:ss"),Me.evaluation_end=ne()(Me.end_time).add(28,"day").format("YYYY-MM-DD HH:mm:ss"))),Me.anonymous_comment&&(Me.evaluation_num=parseInt(Me.evaluation_num)?Me.evaluation_num:3,Me.absence_penalty=parseInt(Me.absence_penalty)?Me.absence_penalty:3),ft(Object.assign({},Me))}},n.a.createElement("strong",null,"\u542F\u7528\u533F\u8BC4")),n.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!)"))),Me.anonymous_comment&&n.a.createElement(n.a.Fragment,null,n.a.createElement(M.a,{align:"middle",className:"mt25 mb25 pl30"},n.a.createElement(te.a,null,"\u533F\u8BC4\u65B9\u5F0F:"),n.a.createElement(te.a,{className:"ml5"},n.a.createElement(_.a.Group,{value:Me.unified_anonymous_comment,disabled:rt||Me.anonymous_appeal||(Fe==null?void 0:Fe.anonymous_comment),onChange:function(Ft){ft(function($t){return Object(x.a)(Object(x.a)({},$t),{},{unified_anonymous_comment:Ft.target.value})}),Et.resetFields()}},(Fe==null?void 0:Fe.unified_setting)&&(Fe==null?void 0:Fe.unified_late)&&n.a.createElement(_.a,{value:!0},"\u7EDF\u4E00\u533F\u8BC4"),(Fe==null||((at=Fe.group_settings)===null||at===void 0)?void 0:at.length)>0&&n.a.createElement(_.a,{value:!1},"\u5206\u73ED\u533F\u8BC4")))),Me.unified_anonymous_comment?n.a.createElement(ee.a,{data:Me,setData:ft,disabled:rt}):n.a.createElement(ue.a,{form:Et,autoComplete:"off",initialValues:Fe!=null&&Fe.unified_anonymous_comment?{anonymous_comment_settings:[{deleteflag:!0}]}:{anonymous_comment_settings:q(Fe==null?void 0:Fe.anonymous_comment_settings,"comment")}},n.a.createElement(A.a,{disabled:rt,selectOptions:Ct,form:Et,data:Me}))),n.a.createElement(ii.a,null),n.a.createElement(n.a.Fragment,null,n.a.createElement(M.a,null,n.a.createElement(te.a,{span:24,className:"mt15 pl30"},n.a.createElement(W.a,{checked:Me.anonymous_appeal,disabled:rt||!On||(Fe==null?void 0:Fe.anonymous_appeal),onChange:function(){Me.anonymous_appeal=!Me.anonymous_appeal,Me.anonymous_appeal&&(Me.appeal_penalty=parseInt(Me.appeal_penalty)?Me.appeal_penalty:2),ft(Object.assign({},Me))}},n.a.createElement("strong",null,"\u542F\u7528\u533F\u8BC4\u7533\u8BC9")),n.a.createElement(hi.a,{overlayClassName:"edu-popover",placement:"bottomLeft",content:n.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",n.a.createElement("br",null),n.a.createElement("br",null),"1\u3001\u63A5\u53D7\u5B66\u751F\u7684\u5408\u7406\u7533\u8BC9\uFF1A",n.a.createElement("br",null),n.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"),n.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"),n.a.createElement("br",null),"2\u3001\u62D2\u7EDD\u5B66\u751F\u7684\u4E0D\u5408\u7406\u7533\u8BC9\uFF1A",n.a.createElement("br",null),n.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"),n.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"},n.a.createElement("span",{className:"mt10 ml10 current font14"},n.a.createElement(fr.a,null))))),Me.anonymous_appeal&&n.a.createElement(n.a.Fragment,null,n.a.createElement(M.a,{align:"middle",className:"mt25 mb25 pl30"},n.a.createElement(te.a,null,"\u7533\u8BC9\u65B9\u5F0F:"),n.a.createElement(te.a,{className:"ml5"},n.a.createElement(_.a.Group,{value:Me.unified_anonymous_appeal,disabled:rt||(Fe==null?void 0:Fe.anonymous_appeal),onChange:function(Ft){ft(function($t){return Object(x.a)(Object(x.a)({},$t),{},{unified_anonymous_appeal:Ft.target.value})}),St.resetFields()}},(Fe==null?void 0:Fe.unified_anonymous_comment)&&n.a.createElement(_.a,{value:!0},"\u7EDF\u4E00\u7533\u8BC9"),(Fe==null||((Be=Fe.group_settings)===null||Be===void 0)?void 0:Be.length)>0&&n.a.createElement(_.a,{value:!1},"\u5206\u73ED\u7533\u8BC9")))),Me.unified_anonymous_appeal?n.a.createElement(N.a,{data:Me,setData:ft,disabled:rt}):n.a.createElement(ue.a,{form:St,initialValues:Fe!=null&&Fe.unified_anonymous_appeal?{anonymous_appeal_settings:[{deleteflag:!0}]}:{anonymous_appeal_settings:q(Fe==null?void 0:Fe.anonymous_appeal_settings,"appeal")}},n.a.createElement(V.a,{disabled:rt,selectOptions:_t,form:St})))))},Kt=Object(l.a)(function(Nn){var Q=Nn.shixunHomeworks;return{shixunHomeworks:Q}})(Je),gn=function(Q){var ve,Ae,De=Q.shixunHomeworks,at=Q.dispatch,Be=Object(a.i)(),rt=De.workSetting,ht=De.workList,Me=Object(r.useState)(!0),ft=Object(p.a)(Me,2),Ot=ft[0],Ct=ft[1],_t=Object(r.useState)([]),Et=Object(p.a)(_t,2),St=Et[0],Fe=Et[1],At=Object(r.useState)([]),Zt=Object(p.a)(At,2),sn=Zt[0],On=Zt[1],In=Object(r.useState)({unified_setting:!1,publish_time:"",end_time:"",ta_mode:1,final_mode:!1,st_proportion:"20%",ta_proportion:"30%",te_proportion:"50%",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,allow_late:!1,unified_late:!0,late_time:"",late_penalty:0,penalty_type:hn.a.Number,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}),Ft=Object(p.a)(In,2),$t=Ft[0],Fn=Ft[1];Object(r.useEffect)(function(){Oe()},[]),Object(r.useEffect)(function(){if(!(rt!=null&&rt.course_id))return;Object.keys($t).map(function(Wt){Wt.indexOf("proportion")>-1&&(rt[Wt]=rt[Wt]*100),$t[Wt]=rt[Wt]}),(!$t.allow_late||!$t.unified_late)&&($t.late_penalty=5),$t.unified_setting||($t.unified_late=!1,$t.unified_anonymous_comment=!1,$t.unified_anonymous_appeal=!1),St=JSON.parse(JSON.stringify(rt.group_settings.map(function(Wt){return Object(x.a)(Object(x.a)({},Wt),{},{group_name:[Wt.group_name]})}).filter(function(Wt){return Wt.publish_time!==null}))),sn=JSON.parse(JSON.stringify(rt.allow_late_settings.map(function(Wt){return Object(x.a)(Object(x.a)({},Wt),{},{group_name:[Wt.group_name]})}).filter(function(Wt){return Wt.late_time!==null}))),Fn(Object(x.a)({},$t)),Fe(Object(He.a)(St)),On(Object(He.a)(sn))},[rt]);var Oe=function(){var Wt=Object(H.a)(h.a.mark(function qt(){return h.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return bn.next=2,at({type:"shixunHomeworks/getWorkSetting",payload:Object(x.a)({},Be)});case 2:An.resetFields(),Tn.resetFields();case 4:case"end":return bn.stop()}},qt)}));return function(){return Wt.apply(this,arguments)}}(),It=function(){var Wt=Object(H.a)(h.a.mark(function qt(){var Dn,bn,er,jr,br,Gr;return h.a.wrap(function(mr){for(;;)switch(mr.prev=mr.next){case 0:if(bn=JSON.parse(JSON.stringify($t)),bn.categoryId=Be.categoryId,$t.unified_setting||(St=(Dn=St)===null||Dn===void 0?void 0:Dn.map(function(Rn){var Tr,kr;if(!Rn.publish_time||!Rn.end_time)throw P.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(!Rn.group_name)throw P.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return Rn.group_name=typeof(Rn==null?void 0:Rn.group_name)=="string"?[Rn==null?void 0:Rn.group_name]:Rn==null?void 0:Rn.group_name,Rn.group_id=Rn==null||((Tr=Rn.group_name)===null||Tr===void 0||((kr=Tr.map(function(mi){var Vr,Cr,Fr=(Vr=rt.group_settings)===null||Vr===void 0||((Cr=Vr.filter(function(ti){return(ti==null?void 0:ti.group_name)===mi}))===null||Cr===void 0)?void 0:Cr[0];return Fr==null?void 0:Fr.group_id}))===null||kr===void 0))?void 0:kr.toString().split(","),Rn})),bn.group_settings=St,!$t.allow_late){mr.next=16;break}if(!$t.unified_late){mr.next=14;break}if(!($t.late_penalty===null||$t.late_penalty===void 0||$t.late_penalty<0||$t.late_penalty>100)){mr.next=9;break}throw P.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($t.late_time){mr.next=12;break}throw P.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:mr.next=16;break;case 14:sn=(er=sn)===null||er===void 0?void 0:er.map(function(Rn){var Tr,kr;if(Rn.penalty_type=hn.a.Number,Rn.late_penalty===null||Rn.late_penalty===void 0||Rn.late_penalty<0||Rn.late_penalty>100)throw P.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(!Rn.late_time)throw P.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(!Rn.group_name)throw P.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return Rn.group_name=typeof(Rn==null?void 0:Rn.group_name)=="string"?[Rn==null?void 0:Rn.group_name]:Rn==null?void 0:Rn.group_name,Rn.group_id=Rn==null||((Tr=Rn.group_name)===null||Tr===void 0||((kr=Tr.map(function(mi){var Vr,Cr,Fr=(Vr=rt.group_settings)===null||Vr===void 0||((Cr=Vr.filter(function(ti){return(ti==null?void 0:ti.group_name)===mi}))===null||Cr===void 0)?void 0:Cr[0];return Fr==null?void 0:Fr.group_id}))===null||kr===void 0))?void 0:kr.toString().split(","),Rn}),bn.allow_late_settings=sn;case 16:if(!$t.evaluation_start){mr.next=23;break}if(!($t.end_time&&ne()($t.evaluation_start)<=ne()($t.end_time))){mr.next=20;break}throw P.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 20:if(!($t.late_time&&ne()($t.evaluation_start)<=ne()($t.late_time))){mr.next=23;break}throw P.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 23:if(Object.keys(bn).map(function(Rn){Rn.indexOf("proportion")>-1&&(bn[Rn]=bn[Rn]/100)}),!(hr==="3")){mr.next=38;break}if(!(bn.anonymous_comment&&!bn.unified_anonymous_comment)){mr.next=31;break}return mr.next=28,wn();case 28:jr=mr.sent,bn.anonymous_comment_settings=jr.anonymous_comment_settings,["evaluation_end","evaluation_num","evaluation_start","student_comment","absence_penalty"].forEach(function(Rn){Reflect.deleteProperty(bn,Rn)});case 31:return bn.anonymous_appeal&&!bn.unified_anonymous_appeal&&(br=fn(),bn.anonymous_appeal_settings=br.anonymous_appeal_settings,["appeal_time","appeal_penalty"].forEach(function(Rn){Reflect.deleteProperty(bn,Rn)})),mr.next=34,Object($.a)("/api/homework_commons/".concat(Be.categoryId,"/evaluation_setting.json"),{method:"post",body:Object(x.a)({},bn)});case 34:Gr=mr.sent,Gr.status===0&&(P.b.success("\u66F4\u65B0\u6210\u529F"),Ct(!0),Oe()),mr.next=39;break;case 38:at({type:"shixunHomeworks/updateSetting",payload:Object(x.a)(Object(x.a)({},bn),{},{penalty_type:hn.a.Number})}).then(function(Rn){Rn.status===0&&(P.b.success("\u66F4\u65B0\u6210\u529F"),Ct(!0),Oe())});case 39:case"end":return mr.stop()}},qt)}));return function(){return Wt.apply(this,arguments)}}(),Ut=rt==null||((ve=rt.anonymous_comment_settings)===null||ve===void 0)?void 0:ve.map(function(Wt){return{label:Wt.group_name,value:Wt.group_name,id:Wt.group_id}}),tn=rt==null||((Ae=rt.anonymous_appeal_settings)===null||Ae===void 0)?void 0:Ae.map(function(Wt){return{label:Wt.group_name,value:Wt.group_name,id:Wt.group_id}}),un=ue.a.useForm(),Sn=Object(p.a)(un,1),An=Sn[0],$n=ue.a.useForm(),pr=Object(p.a)($n,1),Tn=pr[0],jn=function(qt,Dn){return qt.map(function(bn){return Dn.find(function(er){return er.value===bn}).id})},wn=function(){var Wt=Object(H.a)(h.a.mark(function qt(){var Dn,bn,er,jr,br;return h.a.wrap(function(Hr){for(;;)switch(Hr.prev=Hr.next){case 0:Dn=Object(oe.a)(An.getFieldsValue(),"YYYY-MM-DD HH:mm"),bn=Object(Jt.cloneDeep)(Dn),er=Object(Qt.a)(bn.anonymous_comment_settings||[]),Hr.prev=3,er.s();case 5:if((jr=er.n()).done){Hr.next=19;break}if(br=jr.value,br!=null&&br.evaluation_start){Hr.next=10;break}return P.b.warning("\u533F\u8BC4\u5F00\u59CB\u65F6\u95F4\u4E0D\u80FD\u4E3A\u7A7A"),Hr.abrupt("return",Promise.reject());case 10:if(br.group_name){Hr.next=13;break}return P.b.warning("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),Hr.abrupt("return",Promise.reject());case 13:br.evaluation_end=br==null?void 0:br.evaluation_start[1],br.evaluation_start=br==null?void 0:br.evaluation_start[0],br.group_id=jn(br.group_name,Ut),Reflect.deleteProperty(br,"deleteflag");case 17:Hr.next=5;break;case 19:Hr.next=24;break;case 21:Hr.prev=21,Hr.t0=Hr.catch(3),er.e(Hr.t0);case 24:return Hr.prev=24,er.f(),Hr.finish(24);case 27:return Hr.abrupt("return",bn);case 28:case"end":return Hr.stop()}},qt,null,[[3,21,24,27]])}));return function(){return Wt.apply(this,arguments)}}(),fn=function(){var qt=Object(oe.a)(Tn.getFieldsValue(),"YYYY-MM-DD HH:mm"),Dn=Object(Jt.cloneDeep)(qt),bn=Object(Qt.a)(Dn.anonymous_appeal_settings||[]),er;try{for(bn.s();!(er=bn.n()).done;){var jr=er.value;jr.group_id=jn(jr.group_name,tn),Reflect.deleteProperty(jr,"deleteflag")}}catch(br){bn.e(br)}finally{bn.f()}return Dn},Kn=Object(r.useState)("1"),yr=Object(p.a)(Kn,2),hr=yr[0],xn=yr[1];return n.a.createElement("section",{className:[tt.a.form,"mb50",tt.a.configworksContainer].join(" ")},n.a.createElement(Y.a,{defaultActiveKey:"1",activeKey:hr,onChange:xn},n.a.createElement(Y.a.TabPane,{tab:"\u53D1\u5E03\u8BBE\u7F6E",key:"1"},n.a.createElement(Nr,{disabled:Ot,setDisabled:Ct,data:$t,setData:Fn,groupSettings:St,setGroupSetting:Fe,repairSettings:sn,setRepairSetting:On})),n.a.createElement(Y.a.TabPane,{tab:"\u533F\u8BC4\u8BBE\u7F6E",key:"3"},n.a.createElement(Kt,{disabled:Ot,setDisabled:Ct,data:$t,setData:Fn,commentGroupSelectOptions:Ut,appealGroupSelectOptions:tn,groupCommentFormInstance:An,groupAppealFormInstance:Tn})),n.a.createElement(Y.a.TabPane,{tab:"\u8BC4\u5206\u8BBE\u7F6E",key:"4"},n.a.createElement(Xn,{disabled:Ot,setDisabled:Ct,data:$t,setData:Fn})),n.a.createElement(Y.a.TabPane,{tab:"\u516C\u5F00\u8BBE\u7F6E",key:"5"},n.a.createElement(Ei,{disabled:Ot,setDisabled:Ct,data:$t,setData:Fn})),n.a.createElement(Y.a.TabPane,{tab:"\u534F\u4F5C\u8BBE\u7F6E",key:"6"},n.a.createElement(ln,null))),n.a.createElement(M.a,null,!Ot&&n.a.createElement(te.a,{className:"mt20 btn-w120"},n.a.createElement(I.a,{type:"primary",size:"large",onClick:function(){return It()}},"\u63D0\u4EA4"),n.a.createElement(I.a,{onClick:function(){Ct(!0),Oe()},type:"primary",size:"large",ghost:!0,className:"ml20"},"\u53D6\u6D88"))))},Bn=Object(l.a)(function(Nn){var Q=Nn.shixunHomeworks;return{shixunHomeworks:Q}})(gn),en=k("cWXX"),Gn=k("/ezw"),ar=k("R9oj"),Ur=k("ECub"),si=k("Nnv5"),Jr=k.n(si),qr=function(Q){var ve=Q.exercise,Ae=Q.dispatch,De=Q.user,at=Q.studentGroupingIndex,Be=Object(a.i)(),rt=Object(r.useState)({page:1,limit:10,exercise_id:Be==null?void 0:Be.categoryId}),ht=Object(p.a)(rt,2),Me=ht[0],ft=ht[1],Ot=Object(r.useState)([]),Ct=Object(p.a)(Ot,2),_t=Ct[0],Et=Ct[1],St=Object(r.useState)(0),Fe=Object(p.a)(St,2),At=Fe[0],Zt=Fe[1],sn=Object(r.useState)(!0),On=Object(p.a)(sn,2),In=On[0],Ft=On[1];Object(r.useEffect)(function(){$t(Object(x.a)(Object(x.a)({},Me),{},{page:1})),ft(Object(x.a)(Object(x.a)({},Me),{},{page:1}))},[at]);var $t=function(){var Oe=Object(H.a)(h.a.mark(function It(Ut){var tn;return h.a.wrap(function(Sn){for(;;)switch(Sn.prev=Sn.next){case 0:return Ft(!0),Sn.next=3,Object($.a)("/api/checkout_data.json",{method:"get",params:Object(x.a)({},Be)});case 3:tn=Sn.sent,(tn==null?void 0:tn.errmsg)==="\u6210\u529F"&&Et(Object.values(tn==null?void 0:tn.group_info)),Ft(!1);case 6:case"end":return Sn.stop()}},It)}));return function(Ut){return Oe.apply(this,arguments)}}();console.log(_t,2222);var Fn=function(It,Ut){Me.page=It,Me.limit=Ut,ft(Object(x.a)({},Me)),$t(Me)};return n.a.createElement("section",{className:Jr.a.wrap},n.a.createElement("div",{className:Jr.a.warpList},n.a.createElement(Gn.a,{loading:In,active:!0},_t.length?n.a.createElement("div",{className:Jr.a.sys},n.a.createElement("ol",{className:Jr.a.head},n.a.createElement("li",null,"\u5E8F\u53F7"),n.a.createElement("li",null,"\u59D3\u540D"),n.a.createElement("li",null,"\u5B66\u53F7"),n.a.createElement("li",null,"\u73ED\u7EA7"),n.a.createElement("li",null,"\u603B\u5B66\u65F6"),n.a.createElement("li",null,"\u4E0A\u8BFE\u6B21\u6570"),n.a.createElement("li",null,"\u4E92\u52A8\u6B21\u6570"),n.a.createElement("li",null,"\u5386\u53F2\u6210\u7EE9"),n.a.createElement("li",null,"\u6D3B\u8DC3\u65F6\u95F4"),n.a.createElement("li",null,"\u91D1\u5E01")),_t.map(function(Oe,It){return n.a.createElement("div",{className:Jr.a.list,key:It},n.a.createElement("div",{className:Jr.a.name},"\u7B2C",It+1,"\u7EC4"),Oe==null?void 0:Oe.map(function(Ut,tn){return n.a.createElement("ol",{key:tn,className:Jr.a.tr},n.a.createElement("li",null,tn+1),n.a.createElement("li",null,Ut.\u59D3\u540D),n.a.createElement("li",null,Ut.\u5B66\u53F7),n.a.createElement("li",null,Ut.\u73ED\u7EA7),n.a.createElement("li",null,Ut.\u603B\u5B66\u65F6),n.a.createElement("li",null,Ut.\u4E0A\u8BFE\u6B21\u6570),n.a.createElement("li",null,Ut.\u4E92\u52A8\u6B21\u6570),n.a.createElement("li",null,Ut.\u5386\u53F2\u6210\u7EE9),n.a.createElement("li",null,Ut.\u6D3B\u8DC3\u65F6\u95F4),n.a.createElement("li",null,Ut.\u91D1\u5E01))}))})):n.a.createElement(Ur.a,null)),n.a.createElement(d.a,{showTotal:function(It){return n.a.createElement("span",{className:"mr10"},"\u5171",n.a.createElement("span",{className:"c-orange"},It),"\u6761\u6570\u636E")},className:"tc mt20",showSizeChanger:!1,showQuickJumper:!1,hideOnSinglePage:!0,onChange:Fn,pageSize:Me==null?void 0:Me.limit,current:Me.page,total:At})))},Ni=Object(l.a)(function(Nn){var Q=Nn.user;return{user:Q}})(qr),Qi=k("5VF8"),ai=k("6vEo"),Ri=k("XYT7"),Vi=k("8GSA"),Ui=k("IQq8"),pi=k.n(Ui),Ji=k("632R"),Mi=k.n(Ji),ea=function(Q){var ve,Ae,De=Q.shixunHomeworks,at=Q.user,Be=Q.dispatch,rt=Object(r.useState)(Object(x.a)({},Object(a.i)())),ht=Object(p.a)(rt,2),Me=ht[0],ft=ht[1],Ot=Object(a.h)(),Ct=Object(r.useState)(Ot.query.tabs||"0"),_t=Object(p.a)(Ct,2),Et=_t[0],St=_t[1],Fe=Object(r.useState)(!1),At=Object(p.a)(Fe,2),Zt=At[0],sn=At[1],On=Object(r.useState)(1),In=Object(p.a)(On,2),Ft=In[0],$t=In[1],Fn=Object(r.useRef)(null),Oe=De.workList;Ot.query.category_id&&ft(Object(x.a)(Object(x.a)({},Me),{},{category:Ot.query.category_id})),Object(r.useEffect)(function(){It()},[Me.coursesId]);var It=function(){Be({type:"shixunHomeworks/getWorkList",payload:Object(x.a)({},Me)})},Ut=[{name:Object(R.c)()?"\u4F5C\u4E1A\u5217\u8868":"\u4F5C\u54C1\u5217\u8868",id:0,compontent:n.a.createElement(it,{zip:Fn,btnLoading:Zt,setBtnLoading:sn})},{name:"\u5B66\u751F\u5206\u7EC4",id:5,compontent:n.a.createElement("div",{className:"minH500"},n.a.createElement(Ni,{studentGroupingIndex:Ft}))},{name:"\u4F5C\u4E1A\u63CF\u8FF0",id:1,compontent:n.a.createElement("div",{className:"minH500"},n.a.createElement(de,null))},{name:"\u53C2\u8003\u7B54\u6848",id:2,compontent:n.a.createElement(je,null)},{name:Object(R.c)()?"\u8BBE\u7F6E":"\u5F97\u5206\u89C4\u5219",id:3,compontent:n.a.createElement(Bn,null)}].filter(function(un){return Oe!=null&&Oe.view_answer?Object(R.u)()?un:un.name!=="\u5B66\u751F\u5206\u7EC4":un.name!=="\u53C2\u8003\u7B54\u6848"}),tn=function(){var Sn,An,$n,pr,Tn,jn,wn,fn,Kn,yr,hr,xn;return n.a.createElement("div",{className:Mi.a.workListTabButton},Object(R.c)()&&n.a.createElement(n.a.Fragment,null,(((Sn=Oe.homework_status)===null||Sn===void 0?void 0:Sn.includes("\u672A\u53D1\u5E03"))||((An=Oe.homework_status)===null||An===void 0?void 0:An.includes("\u672A\u5F00\u59CB")))&&n.a.createElement(I.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-yishezhifabushijian1"}),onClick:function(qt){qt.preventDefault(),Be({type:"classroomList/setActionTabs",payload:{key:"\u7ACB\u5373\u53D1\u5E03",selectArrs:[Me.categoryId],selectArrsAll:[Oe],params:Object(x.a)(Object(x.a)({},Me),{},{id:Me.coursesId}),type:2}})}},"\u7ACB\u5373\u53D1\u5E03"),!(($n=Oe.homework_status)!==null&&$n!==void 0&&$n.includes("\u672A\u53D1\u5E03"))&&!((pr=Oe.homework_status)!==null&&pr!==void 0&&pr.includes("\u672A\u5F00\u59CB"))&&!((Tn=Oe.homework_status)!==null&&Tn!==void 0&&Tn.includes("\u5DF2\u622A\u6B62"))&&n.a.createElement(I.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-jiezhishiyan"}),onClick:function(qt){qt.preventDefault(),Be({type:"classroomList/setActionTabs",payload:{key:"\u7ACB\u5373\u622A\u6B62",selectArrs:[Me.categoryId],selectArrsAll:[],params:Object(x.a)(Object(x.a)({},Me),{},{id:Me.coursesId}),type:2}})}},"\u7ACB\u5373\u622A\u6B62"),Object(R.u)()&&n.a.createElement(I.a,{type:"primary",icon:n.a.createElement("img",{style:{transform:"translate(-3px, -1px)"},src:pi.a}),onClick:function(){Be({type:"classroomList/setActionTabs",payload:{key:"\u667A\u80FD\u5206\u7EC4",params:Object(x.a)(Object(x.a)({},Me),{},{id:Me.coursesId})}})}},"\u667A\u80FD\u5206\u7EC4"),n.a.createElement(I.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-bianji2"}),onClick:function(){return l.d.push("/classrooms/".concat(Me.coursesId,"/group_homework/").concat(Me.categoryId,"/edit"))}},"\u7F16\u8F91\u4F5C\u4E1A")),(Oe==null||((jn=Oe.work_statuses)===null||jn===void 0)?void 0:jn.includes("\u53D6\u6D88\u5173\u8054"))&&n.a.createElement(I.a,{type:"primary",onClick:Object(H.a)(h.a.mark(function Wt(){var qt;return h.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return bn.next=2,Object(Ri.h)({homeworkId:Me.categoryId});case 2:qt=bn.sent,(qt==null?void 0:qt.status)===0&&(P.b.success("\u53D6\u6D88\u5173\u8054\u6210\u529F"),Be({type:"shixunHomeworks/getWorkList",payload:Object(x.a)({},Me)}));case 4:case"end":return bn.stop()}},Wt)}))},"\u53D6\u6D88\u5173\u8054"),(Oe==null||((wn=Oe.work_statuses)===null||wn===void 0)?void 0:wn.includes("\u5173\u8054\u9879\u76EE"))&&n.a.createElement(I.a,{type:"primary",onClick:function(){var qt,Dn;return Object(c.S)("".concat((qt=at.navigationInfo)===null||qt===void 0||((Dn=qt.top)===null||Dn===void 0)?void 0:Dn.old_url,"/projects/deposit/new"))}},"\u521B\u5EFA\u9879\u76EE"),(Oe==null||((fn=Oe.work_statuses)===null||fn===void 0)?void 0:fn.includes("\u5173\u8054\u9879\u76EE"))&&n.a.createElement(I.a,{type:"primary",onClick:function(qt){qt.preventDefault(),Be({type:"classroomList/setActionTabs",payload:{key:"\u5173\u8054\u9879\u76EE",params:Me,selectArrs:{homework_id:Me.categoryId},cb:function(){Be({type:"shixunHomeworks/getWorkList",payload:Object(x.a)({},Me)})}}})}},"\u5173\u8054\u9879\u76EE"),(Oe==null||((Kn=Oe.work_statuses)===null||Kn===void 0)?void 0:Kn.includes("\u63D0\u4EA4\u4F5C\u54C1"))&&n.a.createElement(I.a,{type:"primary",onClick:function(){return Object(c.S)("/classrooms/".concat(Oe.course_id,"/group_homework/").concat(Oe.homework_id,"/post"))}},"\u63D0\u4EA4\u4F5C\u54C1"),(Oe==null||((yr=Oe.work_statuses)===null||yr===void 0)?void 0:yr.includes("\u4FEE\u6539\u4F5C\u54C1"))&&n.a.createElement(I.a,{type:"primary",onClick:function(){return Object(c.S)("/classrooms/".concat(Oe.course_id,"/group_homework/").concat(Oe.homework_id,"/").concat(Oe.id,"/edit"))}},"\u4FEE\u6539\u4F5C\u54C1"),(Oe==null||((hr=Oe.work_statuses)===null||hr===void 0)?void 0:hr.includes("\u8865\u4EA4\u4F5C\u54C1"))&&n.a.createElement(I.a,{type:"primary",onClick:function(){return Object(c.S)("/classrooms/".concat(Oe.course_id,"/group_homework/").concat(Oe.homework_id,"/post"))}},"\u8865\u4EA4\u4F5C\u54C1"),(Oe==null||((xn=Oe.work_statuses)===null||xn===void 0)?void 0:xn.includes("\u8865\u4EA4\u9644\u4EF6"))&&n.a.createElement(I.a,{type:"primary",onClick:function(){Be({type:"classroomList/setActionTabs",payload:{key:"\u8865\u4EA4\u9644\u4EF6",params:Me,selectArrs:Object(x.a)({},Oe)}})}},"\u8865\u4EA4\u9644\u4EF6"))};return n.a.createElement("section",{className:Mi.a.bg},n.a.createElement("div",{className:"edu-container"},Oe.homework_name&&n.a.createElement("section",{className:"animated fadeIn"},n.a.createElement("aside",{className:"mt10"},Oe.category&&n.a.createElement(G.a,{separator:">"},n.a.createElement(G.a.Item,null,n.a.createElement(s.a,{to:"/classrooms/".concat(Oe.course_id,"/group_homework")},Oe.course_name)),n.a.createElement(G.a.Item,null,n.a.createElement(s.a,{to:"/classrooms/".concat(Oe==null?void 0:Oe.course_id,"/group_homework/").concat(Oe!=null&&(ve=Oe.category)!==null&&ve!==void 0&&ve.main?"":Oe==null||((Ae=Oe.category)===null||Ae===void 0)?void 0:Ae.category_id)},Oe.category.category_name)),n.a.createElement(G.a.Item,null,"\u4F5C\u4E1A\u8BE6\u60C5"))),n.a.createElement("aside",{className:[Mi.a.title,"mt20"].join(" ")},n.a.createElement(s.a,{to:"/classrooms/".concat(Oe.course_id,"/group_homework")},n.a.createElement(u.a,{className:"font16 c-black"})),n.a.createElement("strong",{className:"font20 ml5"},Oe.homework_name),n.a.createElement(c.m,{status:Oe.homework_status}))),n.a.createElement("aside",{className:"mt30 relative ".concat(Mi.a.workListTabWrap)},n.a.createElement(Y.a,{type:"card",activeKey:Et,tabBarExtraContent:tn(),onTabClick:function(Sn,An){if(parseInt(Sn)===2){if(!(Oe!=null&&Oe.view_answer)){P.b.info("\u672C\u6B21\u4F5C\u4E1A\u8001\u5E08\u672A\u516C\u5F00\u7B54\u6848");return}(Oe==null?void 0:Oe.time_status)>2||Object(R.d)()?St(Sn):P.b.info("\u622A\u6B62\u4E4B\u540E\u7684\u8BD5\u5377\u624D\u80FD\u67E5\u770B\u7B54\u6848")}else St(Sn)},className:Mi.a.tabs},Ut.map(function(un,Sn){return n.a.createElement(Y.a.TabPane,{tab:un.name,key:un.id},un.compontent)})))),n.a.createElement(ai.a,null),n.a.createElement(Qi.a,null),n.a.createElement(Tt,{type:"edit",onCallback:function(){return It()},courseEndTime:Oe==null?void 0:Oe.course_end_date}),n.a.createElement(vt,{type:"edit",onCallback:function(){return It()},courseEndTime:Oe==null?void 0:Oe.course_end_date}),n.a.createElement(Ge,{cb:function(){$t(Ft+1),St("5")}}),n.a.createElement(Vi.a,{ref:Fn,hide:!0,name:"".concat(Oe==null?void 0:Oe.homework_name,"-\u4F5C\u54C1\u9644\u4EF6"),onOk:function(){return sn(!1)}}))},la=et.default=Object(l.a)(function(Nn){var Q=Nn.user,ve=Nn.shixunHomeworks,Ae=Nn.loading,De=Nn.globalSetting;return{user:Q,shixunHomeworks:ve,globalSetting:De,loading:Ae.effects}})(ea)},h78n:function(Gt,et,k){"use strict";k.d(et,"a",function(){return T});var re=k("q1tI"),Y=k.n(re),j=k("TSYQ"),G=k.n(j),L={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},P=function(K){var z=K.map(function(){return Object(re.useRef)()}),M=Object(re.useRef)();return Object(re.useEffect)(function(){var y=Date.now(),W=!1;Object.keys(z).forEach(function(X){var te=z[X].current;if(!te)return;W=!0;var pe=te.style;pe.transitionDuration=".3s, .3s, .3s, .06s",M.current&&y-M.current<100&&(pe.transitionDuration="0s, 0s")}),W&&(M.current=Date.now())}),[z]};function H(){return H=Object.assign||function(U){for(var K=1;K<arguments.length;K++){var z=arguments[K];for(var M in z)Object.prototype.hasOwnProperty.call(z,M)&&(U[M]=z[M])}return U},H.apply(this,arguments)}function O(U,K){return h(U)||m(U,K)||x(U,K)||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 x(U,K){if(!U)return;if(typeof U=="string")return p(U,K);var z=Object.prototype.toString.call(U).slice(8,-1);if(z==="Object"&&U.constructor&&(z=U.constructor.name),z==="Map"||z==="Set")return Array.from(U);if(z==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(z))return p(U,K)}function p(U,K){(K==null||K>U.length)&&(K=U.length);for(var z=0,M=new Array(K);z<K;z++)M[z]=U[z];return M}function m(U,K){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(U)))return;var z=[],M=!0,y=!1,W=void 0;try{for(var X=U[Symbol.iterator](),te;!(M=(te=X.next()).done)&&!(z.push(te.value),K&&z.length===K);M=!0);}catch(pe){y=!0,W=pe}finally{try{!M&&X.return!=null&&X.return()}finally{if(y)throw W}}return z}function h(U){if(Array.isArray(U))return U}function r(U,K){if(U==null)return{};var z=n(U,K),M,y;if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(U);for(y=0;y<W.length;y++){if(M=W[y],K.indexOf(M)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(U,M))continue;z[M]=U[M]}}return z}function n(U,K){if(U==null)return{};var z={},M=Object.keys(U),y,W;for(W=0;W<M.length;W++){if(y=M[W],K.indexOf(y)>=0)continue;z[y]=U[y]}return z}var a=function(K){var z=K.className,M=K.percent,y=K.prefixCls,W=K.strokeColor,X=K.strokeLinecap,te=K.strokeWidth,pe=K.style,Ie=K.trailColor,Ee=K.trailWidth,Te=K.transition,We=r(K,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete We.gapPosition;var He=Array.isArray(M)?M:[M],Ce=Array.isArray(W)?W:[W],ue=P(He),se=O(ue,1),we=se[0],ge=te/2,Ke=100-te/2,st="M ".concat(X==="round"?ge:0,",").concat(ge,`
L `).concat(X==="round"?Ke:100,",").concat(ge),ne="0 0 100 ".concat(te),$=0;return Y.a.createElement("svg",H({className:G()("".concat(y,"-line"),z),viewBox:ne,preserveAspectRatio:"none",style:pe},We),Y.a.createElement("path",{className:"".concat(y,"-line-trail"),d:st,strokeLinecap:X,stroke:Ie,strokeWidth:Ee||te,fillOpacity:"0"}),He.map(function(J,me){var xe={strokeDasharray:"".concat(J,"px, 100px"),strokeDashoffset:"-".concat($,"px"),transition:Te||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},ke=Ce[me]||Ce[Ce.length-1];return $+=J,Y.a.createElement("path",{key:me,className:"".concat(y,"-line-path"),d:st,strokeLinecap:X,stroke:ke,strokeWidth:te,fillOpacity:"0",ref:we[me],style:xe})}))};a.defaultProps=L;var l=a;function s(){return s=Object.assign||function(U){for(var K=1;K<arguments.length;K++){var z=arguments[K];for(var M in z)Object.prototype.hasOwnProperty.call(z,M)&&(U[M]=z[M])}return U},s.apply(this,arguments)}function u(U,K){return D(U)||C(U,K)||R(U,K)||c()}function c(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function R(U,K){if(!U)return;if(typeof U=="string")return w(U,K);var z=Object.prototype.toString.call(U).slice(8,-1);if(z==="Object"&&U.constructor&&(z=U.constructor.name),z==="Map"||z==="Set")return Array.from(U);if(z==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(z))return w(U,K)}function w(U,K){(K==null||K>U.length)&&(K=U.length);for(var z=0,M=new Array(K);z<K;z++)M[z]=U[z];return M}function C(U,K){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(U)))return;var z=[],M=!0,y=!1,W=void 0;try{for(var X=U[Symbol.iterator](),te;!(M=(te=X.next()).done)&&!(z.push(te.value),K&&z.length===K);M=!0);}catch(pe){y=!0,W=pe}finally{try{!M&&X.return!=null&&X.return()}finally{if(y)throw W}}return z}function D(U){if(Array.isArray(U))return U}function S(U,K){if(U==null)return{};var z=b(U,K),M,y;if(Object.getOwnPropertySymbols){var W=Object.getOwnPropertySymbols(U);for(y=0;y<W.length;y++){if(M=W[y],K.indexOf(M)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(U,M))continue;z[M]=U[M]}}return z}function b(U,K){if(U==null)return{};var z={},M=Object.keys(U),y,W;for(W=0;W<M.length;W++){if(y=M[W],K.indexOf(y)>=0)continue;z[y]=U[y]}return z}var _=0;function f(U){return+U.replace("%","")}function d(U){return Array.isArray(U)?U:[U]}function g(U,K,z,M){var y=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,W=arguments.length>5?arguments[5]:void 0,X=50-M/2,te=0,pe=-X,Ie=0,Ee=-2*X;switch(W){case"left":te=-X,pe=0,Ie=2*X,Ee=0;break;case"right":te=X,pe=0,Ie=-2*X,Ee=0;break;case"bottom":pe=X,Ee=2*X;break;default:}var Te="M 50,50 m ".concat(te,",").concat(pe,`
a `).concat(X,",").concat(X," 0 1 1 ").concat(Ie,",").concat(-Ee,`
a `).concat(X,",").concat(X," 0 1 1 ").concat(-Ie,",").concat(Ee),We=Math.PI*2*X,He={stroke:z,strokeDasharray:"".concat(K/100*(We-y),"px ").concat(We,"px"),strokeDashoffset:"-".concat(y/2+U/100*(We-y),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Te,pathStyle:He}}var E=function(K){var z=K.prefixCls,M=K.strokeWidth,y=K.trailWidth,W=K.gapDegree,X=K.gapPosition,te=K.trailColor,pe=K.strokeLinecap,Ie=K.style,Ee=K.className,Te=K.strokeColor,We=K.percent,He=S(K,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),Ce=Object(re.useMemo)(function(){return _+=1,_},[]),ue=g(0,100,te,M,W,X),se=ue.pathString,we=ue.pathStyle,ge=d(We),Ke=d(Te),st=Ke.find(function(xe){return Object.prototype.toString.call(xe)==="[object Object]"}),ne=P(ge),$=u(ne,1),J=$[0],me=function(){var ke=0;return ge.map(function($e,Pt){var Xt=Ke[Pt]||Ke[Ke.length-1],Bt=Object.prototype.toString.call(Xt)==="[object Object]"?"url(#".concat(z,"-gradient-").concat(Ce,")"):"",lt=g(ke,$e,Xt,M,W,X);return ke+=$e,Y.a.createElement("path",{key:Pt,className:"".concat(z,"-circle-path"),d:lt.pathString,stroke:Bt,strokeLinecap:pe,strokeWidth:M,opacity:$e===0?0:1,fillOpacity:"0",style:lt.pathStyle,ref:J[Pt]})})};return Y.a.createElement("svg",s({className:G()("".concat(z,"-circle"),Ee),viewBox:"0 0 100 100",style:Ie},He),st&&Y.a.createElement("defs",null,Y.a.createElement("linearGradient",{id:"".concat(z,"-gradient-").concat(Ce),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(st).sort(function(xe,ke){return f(xe)-f(ke)}).map(function(xe,ke){return Y.a.createElement("stop",{key:ke,offset:xe,stopColor:st[xe]})}))),Y.a.createElement("path",{className:"".concat(z,"-circle-trail"),d:se,stroke:te,strokeLinecap:pe,strokeWidth:y||M,fillOpacity:"0",style:we}),me().reverse())};E.defaultProps=L;var T=E,F={Line:l,Circle:T}},hW8S:function(Gt,et,k){"use strict";k.d(et,"a",function(){return G}),k.d(et,"c",function(){return L}),k.d(et,"b",function(){return P});var re=k("VTBJ"),Y=k("Ff2n"),j=k("Kwbf"),G="RC_TABLE_INTERNAL_COL_DEFINE";function L(H){var O=H.expandable,I=Object(Y.a)(H,["expandable"]);return"expandable"in H?Object(re.a)(Object(re.a)({},I),O):I}function P(H){return Object.keys(H).reduce(function(O,I){return(I.substr(0,5)==="data-"||I.substr(0,5)==="aria-")&&(O[I]=H[I]),O},{})}},k3GJ:function(Gt,et,k){"use strict";k.d(et,"a",function(){return Tr});var re=k("rePB"),Y=k("ODXe"),j=k("Ff2n"),G=k("VTBJ"),L=k("q1tI"),P=k("TSYQ"),H=k.n(P),O=k("Zm9Q"),I=k("6cGi"),x=k("KQm4"),p=k("xEkU"),m=k.n(p),h=k("t23M");function r(Re){var qe=Object(L.useRef)(),ot=Object(L.useRef)(!1);function Ne(){for(var le=arguments.length,ye=new Array(le),fe=0;fe<le;fe++)ye[fe]=arguments[fe];ot.current||(m.a.cancel(qe.current),qe.current=m()(function(){Re.apply(void 0,ye)}))}return Object(L.useEffect)(function(){return function(){ot.current=!0,m.a.cancel(qe.current)}},[]),Ne}function n(Re){var qe=Object(L.useRef)([]),ot=Object(L.useState)({}),Ne=Object(Y.a)(ot,2),le=Ne[1],ye=Object(L.useRef)(typeof Re=="function"?Re():Re),fe=r(function(){var Ye=ye.current;qe.current.forEach(function(dt){Ye=dt(Ye)}),qe.current=[],ye.current=Ye,le({})});function Ue(Ye){qe.current.push(Ye),fe()}return[ye.current,Ue]}var a=k("4IlW");function l(Re,qe){var ot,Ne=Re.prefixCls,le=Re.id,ye=Re.active,fe=Re.rtl,Ue=Re.tab,Ye=Ue.key,dt=Ue.tab,Qe=Ue.disabled,pt=Ue.closeIcon,Nt=Re.tabBarGutter,zt=Re.tabPosition,nn=Re.closable,_n=Re.renderWrapper,Pn=Re.removeAriaLabel,Zn=Re.editable,qn=Re.onClick,cr=Re.onRemove,lr=Re.onFocus,ur="".concat(Ne,"-tab");L.useEffect(function(){return cr},[]);var gr={};zt==="top"||zt==="bottom"?gr[fe?"marginLeft":"marginRight"]=Nt:gr.marginBottom=Nt;var Er=Zn&&nn!==!1&&!Qe;function Vn(on){if(Qe)return;qn(on)}function Pr(on){on.preventDefault(),on.stopPropagation(),Zn.onEdit("remove",{key:Ye,event:on})}var Qn=L.createElement("div",{key:Ye,ref:qe,className:H()(ur,(ot={},Object(re.a)(ot,"".concat(ur,"-with-remove"),Er),Object(re.a)(ot,"".concat(ur,"-active"),ye),Object(re.a)(ot,"".concat(ur,"-disabled"),Qe),ot)),style:gr,onClick:Vn},L.createElement("div",{role:"tab","aria-selected":ye,id:le&&"".concat(le,"-tab-").concat(Ye),className:"".concat(ur,"-btn"),"aria-controls":le&&"".concat(le,"-panel-").concat(Ye),"aria-disabled":Qe,tabIndex:Qe?null:0,onClick:function(vn){vn.stopPropagation(),Vn(vn)},onKeyDown:function(vn){[a.a.SPACE,a.a.ENTER].includes(vn.which)&&(vn.preventDefault(),Vn(vn))},onFocus:lr},dt),Er&&L.createElement("button",{type:"button","aria-label":Pn||"remove",tabIndex:0,className:"".concat(ur,"-remove"),onClick:function(vn){vn.stopPropagation(),Pr(vn)}},pt||Zn.removeIcon||"\xD7"));return _n&&(Qn=_n(Qn)),Qn}var s=L.forwardRef(l),u={width:0,height:0,left:0,top:0};function c(Re,qe,ot){return Object(L.useMemo)(function(){for(var Ne,le=new Map,ye=qe.get((Ne=Re[0])===null||Ne===void 0?void 0:Ne.key)||u,fe=ye.left+ye.width,Ue=0;Ue<Re.length;Ue+=1){var Ye=Re[Ue].key,dt=qe.get(Ye);if(!dt){var Qe;dt=qe.get((Qe=Re[Ue-1])===null||Qe===void 0?void 0:Qe.key)||u}var pt=le.get(Ye)||Object(G.a)({},dt);pt.right=fe-pt.left-pt.width,le.set(Ye,pt)}return le},[Re.map(function(Ne){return Ne.key}).join("_"),qe,ot])}var R={width:0,height:0,left:0,top:0,right:0};function w(Re,qe,ot,Ne,le){var ye=le.tabs,fe=le.tabPosition,Ue=le.rtl,Ye,dt,Qe;["top","bottom"].includes(fe)?(Ye="width",dt=Ue?"right":"left",Qe=Math.abs(qe.left)):(Ye="height",dt="top",Qe=-qe.top);var pt=qe[Ye],Nt=ot[Ye],zt=Ne[Ye],nn=pt;return Nt+zt>pt&&(nn=pt-zt),Object(L.useMemo)(function(){if(!ye.length)return[0,0];for(var _n=ye.length,Pn=_n,Zn=0;Zn<_n;Zn+=1){var qn=Re.get(ye[Zn].key)||R;if(qn[dt]+qn[Ye]>Qe+nn){Pn=Zn-1;break}}for(var cr=0,lr=_n-1;lr>=0;lr-=1){var ur=Re.get(ye[lr].key)||R;if(ur[dt]<Qe){cr=lr+1;break}}return[cr,Pn]},[Re,Qe,nn,fe,ye.map(function(_n){return _n.key}).join("_"),Ue])}var C=k("wx14"),D=k("1OyB"),S=k("vuIU"),b=k("JX7q"),_=k("Ji7U"),f=k("LK+K"),d=k("I8Z2"),g=k("bT9E"),E=k("2GS6"),T=k("Gytx"),F=k.n(T),U=k("U8pU"),K=/iPhone/i,z=/iPod/i,M=/iPad/i,y=/\bAndroid(?:.+)Mobile\b/i,W=/Android/i,X=/\bAndroid(?:.+)SD4930UR\b/i,te=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,pe=/Windows Phone/i,Ie=/\bWindows(?:.+)ARM\b/i,Ee=/BlackBerry/i,Te=/BB10/i,We=/Opera Mini/i,He=/\b(CriOS|Chrome)(?:.+)Mobile/i,Ce=/Mobile(?:.+)Firefox\b/i;function ue(Re,qe){return Re.test(qe)}function se(Re){var qe=Re||(typeof navigator!="undefined"?navigator.userAgent:""),ot=(qe||"").split("[FBAN");if(typeof ot[1]!="undefined"){var Ne=ot,le=Object(Y.a)(Ne,1);qe=le[0]}if(ot=qe.split("Twitter"),typeof ot[1]!="undefined"){var ye=ot,fe=Object(Y.a)(ye,1);qe=fe[0]}var Ue={apple:{phone:ue(K,qe)&&!ue(pe,qe),ipod:ue(z,qe),tablet:!ue(K,qe)&&ue(M,qe)&&!ue(pe,qe),device:(ue(K,qe)||ue(z,qe)||ue(M,qe))&&!ue(pe,qe)},amazon:{phone:ue(X,qe),tablet:!ue(X,qe)&&ue(te,qe),device:ue(X,qe)||ue(te,qe)},android:{phone:!ue(pe,qe)&&ue(X,qe)||!ue(pe,qe)&&ue(y,qe),tablet:!ue(pe,qe)&&!ue(X,qe)&&!ue(y,qe)&&(ue(te,qe)||ue(W,qe)),device:!ue(pe,qe)&&(ue(X,qe)||ue(te,qe)||ue(y,qe)||ue(W,qe))||ue(/\bokhttp\b/i,qe)},windows:{phone:ue(pe,qe),tablet:ue(Ie,qe),device:ue(pe,qe)||ue(Ie,qe)},other:{blackberry:ue(Ee,qe),blackberry10:ue(Te,qe),opera:ue(We,qe),firefox:ue(Ce,qe),chrome:ue(He,qe),device:ue(Ee,qe)||ue(Te,qe)||ue(We,qe)||ue(Ce,qe)||ue(He,qe)},any:null,phone:null,tablet:null};return Ue.any=Ue.apple.device||Ue.android.device||Ue.windows.device||Ue.other.device,Ue.phone=Ue.apple.phone||Ue.android.phone||Ue.windows.phone,Ue.tablet=Ue.apple.tablet||Ue.android.tablet||Ue.windows.tablet,Ue}var we=Object(G.a)(Object(G.a)({},se()),{},{isMobile:se}),ge=we;function Ke(){}function st(Re,qe,ot){var Ne=qe||"";return Re.key||"".concat(Ne,"item_").concat(ot)}function ne(Re){return"".concat(Re,"-menu-")}function $(Re,qe){var ot=-1;L.Children.forEach(Re,function(Ne){ot+=1,Ne&&Ne.type&&Ne.type.isMenuItemGroup?L.Children.forEach(Ne.props.children,function(le){ot+=1,qe(le,ot)}):qe(Ne,ot)})}function J(Re,qe,ot){if(!Re||ot.find)return;L.Children.forEach(Re,function(Ne){if(Ne){var le=Ne.type;if(!le||!(le.isSubMenu||le.isMenuItem||le.isMenuItemGroup))return;qe.indexOf(Ne.key)!==-1?ot.find=!0:Ne.props.children&&J(Ne.props.children,qe,ot)}})}var me=["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"],xe=function(qe){var ot=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ne=qe&&typeof qe.getBoundingClientRect=="function"&&qe.getBoundingClientRect().width;if(Ne){if(ot){var le=getComputedStyle(qe),ye=le.marginLeft,fe=le.marginRight;Ne+=+ye.replace("px","")+ +fe.replace("px","")}Ne=+Ne.toFixed(6)}return Ne||0},ke=function(qe,ot,Ne){qe&&Object(U.a)(qe.style)==="object"&&(qe.style[ot]=Ne)},$e=function(){return ge.any},Pt=k("bdgK"),Xt=k("i8i4"),Bt=k.n(Xt),lt=k("wgJM"),jt=k("l4aY"),pn=k("m+aA"),it=k("c+Xe"),Ze=k("zT1h"),bt=k("QC+M");function Mt(Re,qe,ot){return ot?Re[0]===qe[0]:Re[0]===qe[0]&&Re[1]===qe[1]}function ct(Re,qe,ot){var Ne=Re[qe]||{};return Object(G.a)(Object(G.a)({},Ne),ot)}function wt(Re,qe,ot,Ne){for(var le=ot.points,ye=Object.keys(Re),fe=0;fe<ye.length;fe+=1){var Ue=ye[fe];if(Mt(Re[Ue].points,le,Ne))return"".concat(qe,"-placement-").concat(Ue)}return""}var Ve=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Re=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(Re)||/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(Re==null?void 0:Re.substr(0,4)))},Se=k("MNnm");function Pe(Re,qe){var ot={};return ot[Re.toLowerCase()]=qe.toLowerCase(),ot["Webkit".concat(Re)]="webkit".concat(qe),ot["Moz".concat(Re)]="moz".concat(qe),ot["ms".concat(Re)]="MS".concat(qe),ot["O".concat(Re)]="o".concat(qe.toLowerCase()),ot}function ce(Re,qe){var ot={animationend:Pe("Animation","AnimationEnd"),transitionend:Pe("Transition","TransitionEnd")};return Re&&("AnimationEvent"in qe||delete ot.animationend.animation,"TransitionEvent"in qe||delete ot.transitionend.transition),ot}var de=ce(Object(Se.a)(),typeof window!="undefined"?window:{}),be={};if(Object(Se.a)()){var je=document.createElement("div");be=je.style}var ze={};function ut(Re){if(ze[Re])return ze[Re];var qe=de[Re];if(qe)for(var ot=Object.keys(qe),Ne=ot.length,le=0;le<Ne;le+=1){var ye=ot[le];if(Object.prototype.hasOwnProperty.call(qe,ye)&&ye in be)return ze[Re]=qe[ye],ze[Re]}return""}var Dt=ut("animationend"),rn=ut("transitionend"),mn=!!(Dt&&rn),gt=Dt||"animationend",Vt=rn||"transitionend";function Tt(Re,qe){if(!Re)return null;if(Object(U.a)(Re)==="object"){var ot=qe.replace(/-\w/g,function(Ne){return Ne[1].toUpperCase()});return Re[ot]}return"".concat(Re,"-").concat(qe)}var Rt="none",mt="appear",_e="enter",Ge="leave",kt="none",vt="prepare",Qt="start",Jt="active",Le="end";function tt(Re){var qe=Object(L.useRef)(!1),ot=Object(L.useState)(Re),Ne=Object(Y.a)(ot,2),le=Ne[0],ye=Ne[1];function fe(Ue){qe.current||ye(Ue)}return Object(L.useEffect)(function(){return function(){qe.current=!0}},[]),[le,fe]}var Lt=Object(Se.a)()?L.useLayoutEffect:L.useEffect,Ht=Lt,ln=function(){var Re=L.useRef(null);function qe(){lt.a.cancel(Re.current)}function ot(Ne){var le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;qe();var ye=Object(lt.a)(function(){le<=1?Ne({isCanceled:function(){return ye!==Re.current}}):ot(Ne,le-1)});Re.current=ye}return L.useEffect(function(){return function(){qe()}},[]),[ot,qe]},hn=[vt,Qt,Jt,Le],ir=!1,Un=!0;function dn(Re){return Re===Jt||Re===Le}var fr=function(Re,qe){var ot=L.useState(kt),Ne=Object(Y.a)(ot,2),le=Ne[0],ye=Ne[1],fe=ln(),Ue=Object(Y.a)(fe,2),Ye=Ue[0],dt=Ue[1];function Qe(){ye(vt)}return Ht(function(){if(le!==kt&&le!==Le){var pt=hn.indexOf(le),Nt=hn[pt+1],zt=qe(le);zt===ir?ye(Nt):Ye(function(nn){function _n(){if(nn.isCanceled())return;ye(Nt)}zt===!0?_n():Promise.resolve(zt).then(_n)})}},[Re,le]),L.useEffect(function(){return function(){dt()}},[]),[Qe,le]},Kr=function(Re){var qe=Object(L.useRef)(),ot=Object(L.useRef)(Re);ot.current=Re;var Ne=L.useCallback(function(fe){ot.current(fe)},[]);function le(fe){fe&&(fe.removeEventListener(Vt,Ne),fe.removeEventListener(gt,Ne))}function ye(fe){qe.current&&qe.current!==fe&&le(qe.current),fe&&fe!==qe.current&&(fe.addEventListener(Vt,Ne),fe.addEventListener(gt,Ne),qe.current=fe)}return L.useEffect(function(){return function(){le(qe.current)}},[]),[ye,le]};function tr(Re,qe,ot,Ne){var le=Ne.motionEnter,ye=le===void 0?!0:le,fe=Ne.motionAppear,Ue=fe===void 0?!0:fe,Ye=Ne.motionLeave,dt=Ye===void 0?!0:Ye,Qe=Ne.motionDeadline,pt=Ne.motionLeaveImmediately,Nt=Ne.onAppearPrepare,zt=Ne.onEnterPrepare,nn=Ne.onLeavePrepare,_n=Ne.onAppearStart,Pn=Ne.onEnterStart,Zn=Ne.onLeaveStart,qn=Ne.onAppearActive,cr=Ne.onEnterActive,lr=Ne.onLeaveActive,ur=Ne.onAppearEnd,gr=Ne.onEnterEnd,Er=Ne.onLeaveEnd,Vn=Ne.onVisibleChanged,Pr=tt(),Qn=Object(Y.a)(Pr,2),on=Qn[0],vn=Qn[1],dr=tt(Rt),wr=Object(Y.a)(dr,2),Wn=wr[0],xr=wr[1],Yr=tt(null),Sr=Object(Y.a)(Yr,2),Wr=Sr[0],Rr=Sr[1],Ar=Object(L.useRef)(!1),Or=Object(L.useRef)(null),nr=Object(L.useRef)(!1),li=Object(L.useRef)(null);function Yi(){var $r=ot();return $r||li.current}var wi=Object(L.useRef)(!1);function gi($r){var Zr=Yi();if($r&&!$r.deadline&&$r.target!==Zr)return;var xi;Wn===mt&&wi.current?xi=ur==null?void 0:ur(Zr,$r):Wn===_e&&wi.current?xi=gr==null?void 0:gr(Zr,$r):Wn===Ge&&wi.current&&(xi=Er==null?void 0:Er(Zr,$r)),xi!==!1&&!nr.current&&(xr(Rt),Rr(null))}var ei=Kr(gi),Xr=Object(Y.a)(ei,1),En=Xr[0],yn=L.useMemo(function(){var $r,Zr,xi;switch(Wn){case"appear":return $r={},Object(re.a)($r,vt,Nt),Object(re.a)($r,Qt,_n),Object(re.a)($r,Jt,qn),$r;case"enter":return Zr={},Object(re.a)(Zr,vt,zt),Object(re.a)(Zr,Qt,Pn),Object(re.a)(Zr,Jt,cr),Zr;case"leave":return xi={},Object(re.a)(xi,vt,nn),Object(re.a)(xi,Qt,Zn),Object(re.a)(xi,Jt,lr),xi;default:return{}}},[Wn]),zn=fr(Wn,function($r){if($r===vt){var Zr=yn[vt];return Zr?Zr(Yi()):ir}if(Lr in yn){var xi;Rr(((xi=yn[Lr])===null||xi===void 0?void 0:xi.call(yn,Yi(),null))||null)}return Lr===Jt&&(En(Yi()),Qe>0&&(clearTimeout(Or.current),Or.current=setTimeout(function(){gi({deadline:!0})},Qe))),Un}),Br=Object(Y.a)(zn,2),or=Br[0],Lr=Br[1],ji=dn(Lr);wi.current=ji,Ht(function(){vn(qe);var $r=Ar.current;if(Ar.current=!0,!Re)return;var Zr;!$r&&qe&&Ue&&(Zr=mt),$r&&qe&&ye&&(Zr=_e),($r&&!qe&&dt||!$r&&pt&&!qe&&dt)&&(Zr=Ge),Zr&&(xr(Zr),or())},[qe]),Object(L.useEffect)(function(){(Wn===mt&&!Ue||Wn===_e&&!ye||Wn===Ge&&!dt)&&xr(Rt)},[Ue,ye,dt]),Object(L.useEffect)(function(){return function(){clearTimeout(Or.current),nr.current=!0}},[]),Object(L.useEffect)(function(){on!==void 0&&Wn===Rt&&(Vn==null||Vn(on))},[on,Wn]);var Fi=Wr;return yn[vt]&&Lr===Qt&&(Fi=Object(G.a)({transition:"none"},Fi)),[Wn,Lr,Fi,on!=null?on:qe]}var rr=function(Re){Object(_.a)(ot,Re);var qe=Object(f.a)(ot);function ot(){return Object(D.a)(this,ot),qe.apply(this,arguments)}return Object(S.a)(ot,[{key:"render",value:function(){return this.props.children}}]),ot}(L.Component),Nr=rr;function oi(Re){var qe=Re;Object(U.a)(Re)==="object"&&(qe=Re.transitionSupport);function ot(le){return!!(le.motionName&&qe)}var Ne=L.forwardRef(function(le,ye){var fe=le.visible,Ue=fe===void 0?!0:fe,Ye=le.removeOnLeave,dt=Ye===void 0?!0:Ye,Qe=le.forceRender,pt=le.children,Nt=le.motionName,zt=le.leavedClassName,nn=le.eventProps,_n=ot(le),Pn=Object(L.useRef)(),Zn=Object(L.useRef)();function qn(){try{return Object(pn.a)(Pn.current||Zn.current)}catch(xr){return null}}var cr=tr(_n,Ue,qn,le),lr=Object(Y.a)(cr,4),ur=lr[0],gr=lr[1],Er=lr[2],Vn=lr[3],Pr=L.useRef(Vn);Vn&&(Pr.current=!0);var Qn=Object(L.useRef)(ye);Qn.current=ye;var on=L.useCallback(function(xr){Pn.current=xr,Object(it.b)(Qn.current,xr)},[]),vn,dr=Object(G.a)(Object(G.a)({},nn),{},{visible:Ue});if(!pt)vn=null;else if(ur===Rt||!ot(le))Vn?vn=pt(Object(G.a)({},dr),on):!dt&&Pr.current?vn=pt(Object(G.a)(Object(G.a)({},dr),{},{className:zt}),on):Qe?vn=pt(Object(G.a)(Object(G.a)({},dr),{},{style:{display:"none"}}),on):vn=null;else{var wr,Wn;gr===vt?Wn="prepare":dn(gr)?Wn="active":gr===Qt&&(Wn="start"),vn=pt(Object(G.a)(Object(G.a)({},dr),{},{className:H()(Tt(Nt,ur),(wr={},Object(re.a)(wr,Tt(Nt,"".concat(ur,"-").concat(Wn)),Wn),Object(re.a)(wr,Nt,typeof Nt=="string"),wr)),style:Er}),on)}return L.createElement(Nr,{ref:Zn},vn)});return Ne.displayName="CSSMotion",Ne}var hi=oi(mn),an="add",Xn="keep",fi="remove",Ei="removed";function ri(Re){var qe;return Re&&Object(U.a)(Re)==="object"&&"key"in Re?qe=Re:qe={key:Re},Object(G.a)(Object(G.a)({},qe),{},{key:String(qe.key)})}function ii(){var Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Re.map(ri)}function ee(){var Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],ot=[],Ne=0,le=qe.length,ye=ii(Re),fe=ii(qe);ye.forEach(function(dt){for(var Qe=!1,pt=Ne;pt<le;pt+=1){var Nt=fe[pt];if(Nt.key===dt.key){Ne<pt&&(ot=ot.concat(fe.slice(Ne,pt).map(function(zt){return Object(G.a)(Object(G.a)({},zt),{},{status:an})})),Ne=pt),ot.push(Object(G.a)(Object(G.a)({},Nt),{},{status:Xn})),Ne+=1,Qe=!0;break}}Qe||ot.push(Object(G.a)(Object(G.a)({},dt),{},{status:fi}))}),Ne<le&&(ot=ot.concat(fe.slice(Ne).map(function(dt){return Object(G.a)(Object(G.a)({},dt),{},{status:an})})));var Ue={};ot.forEach(function(dt){var Qe=dt.key;Ue[Qe]=(Ue[Qe]||0)+1});var Ye=Object.keys(Ue).filter(function(dt){return Ue[dt]>1});return Ye.forEach(function(dt){ot=ot.filter(function(Qe){var pt=Qe.key,Nt=Qe.status;return pt!==dt||Nt!==fi}),ot.forEach(function(Qe){Qe.key===dt&&(Qe.status=Xn)})}),ot}var A=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function N(Re){var qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:hi,ot=function(Ne){Object(_.a)(ye,Ne);var le=Object(f.a)(ye);function ye(){var fe;return Object(D.a)(this,ye),fe=le.apply(this,arguments),fe.state={keyEntities:[]},fe.removeKey=function(Ue){fe.setState(function(Ye){var dt=Ye.keyEntities;return{keyEntities:dt.map(function(Qe){return Qe.key!==Ue?Qe:Object(G.a)(Object(G.a)({},Qe),{},{status:Ei})})}})},fe}return Object(S.a)(ye,[{key:"render",value:function(){var Ue=this,Ye=this.state.keyEntities,dt=this.props,Qe=dt.component,pt=dt.children,Nt=dt.onVisibleChanged,zt=Object(j.a)(dt,["component","children","onVisibleChanged"]),nn=Qe||L.Fragment,_n={};return A.forEach(function(Pn){_n[Pn]=zt[Pn],delete zt[Pn]}),delete zt.keys,L.createElement(nn,zt,Ye.map(function(Pn){var Zn=Pn.status,qn=Object(j.a)(Pn,["status"]),cr=Zn===an||Zn===Xn;return L.createElement(qe,Object(C.a)({},_n,{key:qn.key,visible:cr,eventProps:qn,onVisibleChanged:function(ur){Nt==null||Nt(ur,{key:qn.key}),ur||Ue.removeKey(qn.key)}}),pt)}))}}],[{key:"getDerivedStateFromProps",value:function(Ue,Ye){var dt=Ue.keys,Qe=Ye.keyEntities,pt=ii(dt),Nt=ee(Qe,pt);return{keyEntities:Nt.filter(function(zt){var nn=Qe.find(function(_n){var Pn=_n.key;return zt.key===Pn});return!(nn&&nn.status===Ei&&zt.status===fi)})}}}]),ye}(L.Component);return ot.defaultProps={component:"div"},ot}var V=N(mn),oe=hi;function q(Re){var qe=Re.prefixCls,ot=Re.motion,Ne=Re.animation,le=Re.transitionName;return ot||(Ne?{motionName:"".concat(qe,"-").concat(Ne)}:le?{motionName:le}:null)}function Je(Re){var qe=Re.prefixCls,ot=Re.visible,Ne=Re.zIndex,le=Re.mask,ye=Re.maskMotion,fe=Re.maskAnimation,Ue=Re.maskTransitionName;if(!le)return null;var Ye={};return(ye||Ue||fe)&&(Ye=Object(G.a)({motionAppear:!0},q({motion:ye,prefixCls:qe,transitionName:Ue,animation:fe}))),L.createElement(oe,Object(C.a)({},Ye,{visible:ot,removeOnLeave:!0}),function(dt){var Qe=dt.className;return L.createElement("div",{style:{zIndex:Ne},className:H()("".concat(qe,"-mask"),Qe)})})}var Kt=k("9mu1"),gn=k("o0o1"),Bn=k.n(gn),en=k("HaE+"),Gn=["measure","align",null,"motion"],ar=function(Re,qe){var ot=Object(L.useState)(null),Ne=Object(Y.a)(ot,2),le=Ne[0],ye=Ne[1],fe=Object(L.useRef)(),Ue=Object(L.useRef)(!1);function Ye(pt){Ue.current||ye(pt)}function dt(){lt.a.cancel(fe.current)}function Qe(pt){dt(),fe.current=Object(lt.a)(function(){Ye(function(Nt){switch(le){case"align":return"motion";case"motion":return"stable";default:}return Nt}),pt==null||pt()})}return Object(L.useEffect)(function(){Ye("measure")},[Re]),Object(L.useEffect)(function(){switch(le){case"measure":qe();break;default:}le&&(fe.current=Object(lt.a)(Object(en.a)(Bn.a.mark(function pt(){var Nt,zt;return Bn.a.wrap(function(_n){for(;;)switch(_n.prev=_n.next){case 0:Nt=Gn.indexOf(le),zt=Gn[Nt+1],zt&&Nt!==-1&&Ye(zt);case 3:case"end":return _n.stop()}},pt)}))))},[le]),Object(L.useEffect)(function(){return function(){Ue.current=!0,dt()}},[]),[le,Qe]},Ur=function(Re){var qe=L.useState({width:0,height:0}),ot=Object(Y.a)(qe,2),Ne=ot[0],le=ot[1];function ye(Ue){le({width:Ue.offsetWidth,height:Ue.offsetHeight})}var fe=L.useMemo(function(){var Ue={};if(Re){var Ye=Ne.width,dt=Ne.height;Re.indexOf("height")!==-1&&dt?Ue.height=dt:Re.indexOf("minHeight")!==-1&&dt&&(Ue.minHeight=dt),Re.indexOf("width")!==-1&&Ye?Ue.width=Ye:Re.indexOf("minWidth")!==-1&&Ye&&(Ue.minWidth=Ye)}return Ue},[Re,Ne]);return[fe,ye]},si=L.forwardRef(function(Re,qe){var ot=Re.visible,Ne=Re.prefixCls,le=Re.className,ye=Re.style,fe=Re.children,Ue=Re.zIndex,Ye=Re.stretch,dt=Re.destroyPopupOnHide,Qe=Re.forceRender,pt=Re.align,Nt=Re.point,zt=Re.getRootDomNode,nn=Re.getClassNameFromAlign,_n=Re.onAlign,Pn=Re.onMouseEnter,Zn=Re.onMouseLeave,qn=Re.onMouseDown,cr=Re.onTouchStart,lr=Object(L.useRef)(),ur=Object(L.useRef)(),gr=Object(L.useState)(),Er=Object(Y.a)(gr,2),Vn=Er[0],Pr=Er[1],Qn=Ur(Ye),on=Object(Y.a)(Qn,2),vn=on[0],dr=on[1];function wr(){Ye&&dr(zt())}var Wn=ar(ot,wr),xr=Object(Y.a)(Wn,2),Yr=xr[0],Sr=xr[1],Wr=Object(L.useRef)();function Rr(){return Nt||zt}function Ar(){var ei;(ei=lr.current)===null||ei===void 0||ei.forceAlign()}function Or(ei,Xr){var En=nn(Xr);Vn!==En&&Pr(En),Yr==="align"&&(Vn!==En?Promise.resolve().then(function(){Ar()}):Sr(function(){var yn;(yn=Wr.current)===null||yn===void 0||yn.call(Wr)}),_n==null||_n(ei,Xr))}var nr=Object(G.a)({},q(Re));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(ei){var Xr=nr[ei];nr[ei]=function(En,yn){return Sr(),Xr==null?void 0:Xr(En,yn)}});function li(){return new Promise(function(ei){Wr.current=ei})}L.useEffect(function(){!nr.motionName&&Yr==="motion"&&Sr()},[nr.motionName,Yr]),L.useImperativeHandle(qe,function(){return{forceAlign:Ar,getElement:function(){return ur.current}}});var Yi=Object(G.a)(Object(G.a)({},vn),{},{zIndex:Ue,opacity:Yr==="motion"||Yr==="stable"||!ot?void 0:0,pointerEvents:Yr==="stable"?void 0:"none"},ye),wi=!0;(pt==null?void 0:pt.points)&&(Yr==="align"||Yr==="stable")&&(wi=!1);var gi=fe;return L.Children.count(fe)>1&&(gi=L.createElement("div",{className:"".concat(Ne,"-content")},fe)),L.createElement(oe,Object(C.a)({visible:ot,ref:ur,leavedClassName:"".concat(Ne,"-hidden")},nr,{onAppearPrepare:li,onEnterPrepare:li,removeOnLeave:dt,forceRender:Qe}),function(ei,Xr){var En=ei.className,yn=ei.style,zn=H()(Ne,le,Vn,En);return L.createElement(Kt.a,{target:Rr(),key:"popup",ref:lr,monitorWindowResize:!0,disabled:wi,align:pt,onAlign:Or},L.createElement("div",{ref:Xr,className:zn,onMouseEnter:Pn,onMouseLeave:Zn,onMouseDownCapture:qn,onTouchStartCapture:cr,style:Object(G.a)(Object(G.a)({},yn),Yi)},gi))})});si.displayName="PopupInner";var Jr=si,qr=L.forwardRef(function(Re,qe){var ot=Re.prefixCls,Ne=Re.visible,le=Re.zIndex,ye=Re.children,fe=Re.mobile;fe=fe===void 0?{}:fe;var Ue=fe.popupClassName,Ye=fe.popupStyle,dt=fe.popupMotion,Qe=dt===void 0?{}:dt,pt=fe.popupRender,Nt=L.useRef();L.useImperativeHandle(qe,function(){return{forceAlign:function(){},getElement:function(){return Nt.current}}});var zt=Object(G.a)({zIndex:le},Ye),nn=ye;return L.Children.count(ye)>1&&(nn=L.createElement("div",{className:"".concat(ot,"-content")},ye)),pt&&(nn=pt(nn)),L.createElement(oe,Object(C.a)({visible:Ne,ref:Nt,removeOnLeave:!0},Qe),function(_n,Pn){var Zn=_n.className,qn=_n.style,cr=H()(ot,Ue,Zn);return L.createElement("div",{ref:Pn,className:cr,style:Object(G.a)(Object(G.a)({},qn),zt)},nn)})});qr.displayName="MobilePopupInner";var Ni=qr,Qi=["visible","mobile"],ai=L.forwardRef(function(Re,qe){var ot=Re.visible,Ne=Re.mobile,le=Object(j.a)(Re,Qi),ye=Object(L.useState)(ot),fe=Object(Y.a)(ye,2),Ue=fe[0],Ye=fe[1],dt=Object(L.useState)(!1),Qe=Object(Y.a)(dt,2),pt=Qe[0],Nt=Qe[1],zt=Object(G.a)(Object(G.a)({},le),{},{visible:Ue});Object(L.useEffect)(function(){Ye(ot),ot&&Ne&&Nt(Ve())},[ot,Ne]);var nn=pt?L.createElement(Ni,Object(C.a)({},zt,{mobile:Ne,ref:qe})):L.createElement(Jr,Object(C.a)({},zt,{ref:qe}));return L.createElement("div",null,L.createElement(Je,zt),nn)});ai.displayName="Popup";var Ri=ai,Vi=L.createContext(null),Ui=Vi;function pi(){}function Ji(){return""}function Mi(Re){return Re?Re.ownerDocument:window.document}var ea=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function la(Re){var qe=function(ot){Object(_.a)(le,ot);var Ne=Object(f.a)(le);function le(ye){var fe;Object(D.a)(this,le),fe=Ne.call(this,ye),fe.popupRef=L.createRef(),fe.triggerRef=L.createRef(),fe.attachId=void 0,fe.clickOutsideHandler=void 0,fe.touchOutsideHandler=void 0,fe.contextMenuOutsideHandler1=void 0,fe.contextMenuOutsideHandler2=void 0,fe.mouseDownTimeout=void 0,fe.focusTime=void 0,fe.preClickTime=void 0,fe.preTouchTime=void 0,fe.delayTimer=void 0,fe.hasPopupMouseDown=void 0,fe.onMouseEnter=function(Ye){var dt=fe.props.mouseEnterDelay;fe.fireEvents("onMouseEnter",Ye),fe.delaySetPopupVisible(!0,dt,dt?null:Ye)},fe.onMouseMove=function(Ye){fe.fireEvents("onMouseMove",Ye),fe.setPoint(Ye)},fe.onMouseLeave=function(Ye){fe.fireEvents("onMouseLeave",Ye),fe.delaySetPopupVisible(!1,fe.props.mouseLeaveDelay)},fe.onPopupMouseEnter=function(){fe.clearDelayTimer()},fe.onPopupMouseLeave=function(Ye){var dt;if(Ye.relatedTarget&&!Ye.relatedTarget.setTimeout&&Object(jt.a)((dt=fe.popupRef.current)===null||dt===void 0?void 0:dt.getElement(),Ye.relatedTarget))return;fe.delaySetPopupVisible(!1,fe.props.mouseLeaveDelay)},fe.onFocus=function(Ye){fe.fireEvents("onFocus",Ye),fe.clearDelayTimer(),fe.isFocusToShow()&&(fe.focusTime=Date.now(),fe.delaySetPopupVisible(!0,fe.props.focusDelay))},fe.onMouseDown=function(Ye){fe.fireEvents("onMouseDown",Ye),fe.preClickTime=Date.now()},fe.onTouchStart=function(Ye){fe.fireEvents("onTouchStart",Ye),fe.preTouchTime=Date.now()},fe.onBlur=function(Ye){fe.fireEvents("onBlur",Ye),fe.clearDelayTimer(),fe.isBlurToHide()&&fe.delaySetPopupVisible(!1,fe.props.blurDelay)},fe.onContextMenu=function(Ye){Ye.preventDefault(),fe.fireEvents("onContextMenu",Ye),fe.setPopupVisible(!0,Ye)},fe.onContextMenuClose=function(){fe.isContextMenuToShow()&&fe.close()},fe.onClick=function(Ye){if(fe.fireEvents("onClick",Ye),fe.focusTime){var dt;if(fe.preClickTime&&fe.preTouchTime?dt=Math.min(fe.preClickTime,fe.preTouchTime):fe.preClickTime?dt=fe.preClickTime:fe.preTouchTime&&(dt=fe.preTouchTime),Math.abs(dt-fe.focusTime)<20)return;fe.focusTime=0}fe.preClickTime=0,fe.preTouchTime=0,fe.isClickToShow()&&(fe.isClickToHide()||fe.isBlurToHide())&&Ye&&Ye.preventDefault&&Ye.preventDefault();var Qe=!fe.state.popupVisible;(fe.isClickToHide()&&!Qe||Qe&&fe.isClickToShow())&&fe.setPopupVisible(!fe.state.popupVisible,Ye)},fe.onPopupMouseDown=function(){if(fe.hasPopupMouseDown=!0,clearTimeout(fe.mouseDownTimeout),fe.mouseDownTimeout=window.setTimeout(function(){fe.hasPopupMouseDown=!1},0),fe.context){var Ye;(Ye=fe.context).onPopupMouseDown.apply(Ye,arguments)}},fe.onDocumentClick=function(Ye){if(fe.props.mask&&!fe.props.maskClosable)return;var dt=Ye.target,Qe=fe.getRootDomNode(),pt=fe.getPopupDomNode();(!Object(jt.a)(Qe,dt)||fe.isContextMenuOnly())&&!Object(jt.a)(pt,dt)&&!fe.hasPopupMouseDown&&fe.close()},fe.getRootDomNode=function(){var Ye=fe.props.getTriggerDOMNode;if(Ye)return Ye(fe.triggerRef.current);try{var dt=Object(pn.a)(fe.triggerRef.current);if(dt)return dt}catch(Qe){}return Bt.a.findDOMNode(Object(b.a)(fe))},fe.getPopupClassNameFromAlign=function(Ye){var dt=[],Qe=fe.props,pt=Qe.popupPlacement,Nt=Qe.builtinPlacements,zt=Qe.prefixCls,nn=Qe.alignPoint,_n=Qe.getPopupClassNameFromAlign;return pt&&Nt&&dt.push(wt(Nt,zt,Ye,nn)),_n&&dt.push(_n(Ye)),dt.join(" ")},fe.getComponent=function(){var Ye=fe.props,dt=Ye.prefixCls,Qe=Ye.destroyPopupOnHide,pt=Ye.popupClassName,Nt=Ye.onPopupAlign,zt=Ye.popupMotion,nn=Ye.popupAnimation,_n=Ye.popupTransitionName,Pn=Ye.popupStyle,Zn=Ye.mask,qn=Ye.maskAnimation,cr=Ye.maskTransitionName,lr=Ye.maskMotion,ur=Ye.zIndex,gr=Ye.popup,Er=Ye.stretch,Vn=Ye.alignPoint,Pr=Ye.mobile,Qn=Ye.forceRender,on=fe.state,vn=on.popupVisible,dr=on.point,wr=fe.getPopupAlign(),Wn={};return fe.isMouseEnterToShow()&&(Wn.onMouseEnter=fe.onPopupMouseEnter),fe.isMouseLeaveToHide()&&(Wn.onMouseLeave=fe.onPopupMouseLeave),Wn.onMouseDown=fe.onPopupMouseDown,Wn.onTouchStart=fe.onPopupMouseDown,L.createElement(Ri,Object(C.a)({prefixCls:dt,destroyPopupOnHide:Qe,visible:vn,point:Vn&&dr,className:pt,align:wr,onAlign:Nt,animation:nn,getClassNameFromAlign:fe.getPopupClassNameFromAlign},Wn,{stretch:Er,getRootDomNode:fe.getRootDomNode,style:Pn,mask:Zn,zIndex:ur,transitionName:_n,maskAnimation:qn,maskTransitionName:cr,maskMotion:lr,ref:fe.popupRef,motion:zt,mobile:Pr,forceRender:Qn}),typeof gr=="function"?gr():gr)},fe.attachParent=function(Ye){lt.a.cancel(fe.attachId);var dt=fe.props,Qe=dt.getPopupContainer,pt=dt.getDocument,Nt=fe.getRootDomNode(),zt;Qe?(Nt||Qe.length===0)&&(zt=Qe(Nt)):zt=pt(fe.getRootDomNode()).body,zt?zt.appendChild(Ye):fe.attachId=Object(lt.a)(function(){fe.attachParent(Ye)})},fe.getContainer=function(){var Ye=fe.props.getDocument,dt=Ye(fe.getRootDomNode()).createElement("div");return dt.style.position="absolute",dt.style.top="0",dt.style.left="0",dt.style.width="100%",fe.attachParent(dt),dt},fe.setPoint=function(Ye){var dt=fe.props.alignPoint;if(!dt||!Ye)return;fe.setState({point:{pageX:Ye.pageX,pageY:Ye.pageY}})},fe.handlePortalUpdate=function(){fe.state.prevPopupVisible!==fe.state.popupVisible&&fe.props.afterPopupVisibleChange(fe.state.popupVisible)},fe.triggerContextValue={onPopupMouseDown:fe.onPopupMouseDown};var Ue;return"popupVisible"in ye?Ue=!!ye.popupVisible:Ue=!!ye.defaultPopupVisible,fe.state={prevPopupVisible:Ue,popupVisible:Ue},ea.forEach(function(Ye){fe["fire".concat(Ye)]=function(dt){fe.fireEvents(Ye,dt)}}),fe}return Object(S.a)(le,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var fe=this.props,Ue=this.state;if(Ue.popupVisible){var Ye;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(Ye=fe.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Ze.a)(Ye,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(Ye=Ye||fe.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Ze.a)(Ye,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(Ye=Ye||fe.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Ze.a)(Ye,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Ze.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),lt.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var fe;return((fe=this.popupRef.current)===null||fe===void 0?void 0:fe.getElement())||null}},{key:"getPopupAlign",value:function(){var fe=this.props,Ue=fe.popupPlacement,Ye=fe.popupAlign,dt=fe.builtinPlacements;return Ue&&dt?ct(dt,Ue,Ye):Ye}},{key:"setPopupVisible",value:function(fe,Ue){var Ye=this.props.alignPoint,dt=this.state.popupVisible;this.clearDelayTimer(),dt!==fe&&("popupVisible"in this.props||this.setState({popupVisible:fe,prevPopupVisible:dt}),this.props.onPopupVisibleChange(fe)),Ye&&Ue&&fe&&this.setPoint(Ue)}},{key:"delaySetPopupVisible",value:function(fe,Ue,Ye){var dt=this,Qe=Ue*1e3;if(this.clearDelayTimer(),Qe){var pt=Ye?{pageX:Ye.pageX,pageY:Ye.pageY}:null;this.delayTimer=window.setTimeout(function(){dt.setPopupVisible(fe,pt),dt.clearDelayTimer()},Qe)}else this.setPopupVisible(fe,Ye)}},{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(fe){var Ue=this.props.children.props,Ye=this.props;return Ue[fe]&&Ye[fe]?this["fire".concat(fe)]:Ue[fe]||Ye[fe]}},{key:"isClickToShow",value:function(){var fe=this.props,Ue=fe.action,Ye=fe.showAction;return Ue.indexOf("click")!==-1||Ye.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var fe=this.props.action;return fe==="contextMenu"||fe.length===1&&fe[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var fe=this.props,Ue=fe.action,Ye=fe.showAction;return Ue.indexOf("contextMenu")!==-1||Ye.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var fe=this.props,Ue=fe.action,Ye=fe.hideAction;return Ue.indexOf("click")!==-1||Ye.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var fe=this.props,Ue=fe.action,Ye=fe.showAction;return Ue.indexOf("hover")!==-1||Ye.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var fe=this.props,Ue=fe.action,Ye=fe.hideAction;return Ue.indexOf("hover")!==-1||Ye.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var fe=this.props,Ue=fe.action,Ye=fe.showAction;return Ue.indexOf("focus")!==-1||Ye.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var fe=this.props,Ue=fe.action,Ye=fe.hideAction;return Ue.indexOf("focus")!==-1||Ye.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var fe;(fe=this.popupRef.current)===null||fe===void 0||fe.forceAlign()}}},{key:"fireEvents",value:function(fe,Ue){var Ye=this.props.children.props[fe];Ye&&Ye(Ue);var dt=this.props[fe];dt&&dt(Ue)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var fe=this.state.popupVisible,Ue=this.props,Ye=Ue.children,dt=Ue.forceRender,Qe=Ue.alignPoint,pt=Ue.className,Nt=Ue.autoDestroy,zt=L.Children.only(Ye),nn={key:"trigger"};this.isContextMenuToShow()?nn.onContextMenu=this.onContextMenu:nn.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(nn.onClick=this.onClick,nn.onMouseDown=this.onMouseDown,nn.onTouchStart=this.onTouchStart):(nn.onClick=this.createTwoChains("onClick"),nn.onMouseDown=this.createTwoChains("onMouseDown"),nn.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(nn.onMouseEnter=this.onMouseEnter,Qe&&(nn.onMouseMove=this.onMouseMove)):nn.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?nn.onMouseLeave=this.onMouseLeave:nn.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(nn.onFocus=this.onFocus,nn.onBlur=this.onBlur):(nn.onFocus=this.createTwoChains("onFocus"),nn.onBlur=this.createTwoChains("onBlur"));var _n=H()(zt&&zt.props&&zt.props.className,pt);_n&&(nn.className=_n);var Pn=Object(G.a)({},nn);Object(it.c)(zt)&&(Pn.ref=Object(it.a)(this.triggerRef,zt.ref));var Zn=L.cloneElement(zt,Pn),qn;return(fe||this.popupRef.current||dt)&&(qn=L.createElement(Re,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!fe&&Nt&&(qn=null),L.createElement(Ui.Provider,{value:this.triggerContextValue},Zn,qn)}}],[{key:"getDerivedStateFromProps",value:function(fe,Ue){var Ye=fe.popupVisible,dt={};return Ye!==void 0&&Ue.popupVisible!==Ye&&(dt.popupVisible=Ye,dt.prevPopupVisible=Ue.popupVisible),dt}}]),le}(L.Component);return qe.contextType=Ui,qe.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:Ji,getDocument:Mi,onPopupVisibleChange:pi,afterPopupVisibleChange:pi,onPopupAlign:pi,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},qe}var Nn=la(bt.a),Q={adjustX:1,adjustY:1},ve={topLeft:{points:["bl","tl"],overflow:Q,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Q,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:Q,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:Q,offset:[4,0]}},Ae={topLeft:{points:["bl","tl"],overflow:Q,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Q,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:Q,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:Q,offset:[4,0]}},De=ve,at=0,Be={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},rt=function(qe,ot,Ne){var le=ne(ot),ye=qe.getState();qe.setState({defaultActiveFirst:Object(G.a)(Object(G.a)({},ye.defaultActiveFirst),{},Object(re.a)({},le,Ne))})},ht=function(Re){Object(_.a)(ot,Re);var qe=Object(f.a)(ot);function ot(Ne){var le;Object(D.a)(this,ot),le=qe.call(this,Ne),le.onDestroy=function(Qe){le.props.onDestroy(Qe)},le.onKeyDown=function(Qe){var pt=Qe.keyCode,Nt=le.menuInstance,zt=le.props.store,nn=le.getVisible();if(pt===a.a.ENTER)return le.onTitleClick(Qe),rt(zt,le.props.eventKey,!0),!0;if(pt===a.a.RIGHT)return nn?Nt.onKeyDown(Qe):(le.triggerOpenChange(!0),rt(zt,le.props.eventKey,!0)),!0;if(pt===a.a.LEFT){var _n;if(nn)_n=Nt.onKeyDown(Qe);else return;return _n||(le.triggerOpenChange(!1),_n=!0),_n}return nn&&(pt===a.a.UP||pt===a.a.DOWN)?Nt.onKeyDown(Qe):void 0},le.onOpenChange=function(Qe){le.props.onOpenChange(Qe)},le.onPopupVisibleChange=function(Qe){le.triggerOpenChange(Qe,Qe?"mouseenter":"mouseleave")},le.onMouseEnter=function(Qe){var pt=le.props,Nt=pt.eventKey,zt=pt.onMouseEnter,nn=pt.store;rt(nn,le.props.eventKey,!1),zt({key:Nt,domEvent:Qe})},le.onMouseLeave=function(Qe){var pt=le.props,Nt=pt.parentMenu,zt=pt.eventKey,nn=pt.onMouseLeave;Nt.subMenuInstance=Object(b.a)(le),nn({key:zt,domEvent:Qe})},le.onTitleMouseEnter=function(Qe){var pt=le.props,Nt=pt.eventKey,zt=pt.onItemHover,nn=pt.onTitleMouseEnter;zt({key:Nt,hover:!0}),nn({key:Nt,domEvent:Qe})},le.onTitleMouseLeave=function(Qe){var pt=le.props,Nt=pt.parentMenu,zt=pt.eventKey,nn=pt.onItemHover,_n=pt.onTitleMouseLeave;Nt.subMenuInstance=Object(b.a)(le),nn({key:zt,hover:!1}),_n({key:zt,domEvent:Qe})},le.onTitleClick=function(Qe){var pt=Object(b.a)(le),Nt=pt.props;if(Nt.onTitleClick({key:Nt.eventKey,domEvent:Qe}),Nt.triggerSubMenuAction==="hover")return;le.triggerOpenChange(!le.getVisible(),"click"),rt(Nt.store,le.props.eventKey,!1)},le.onSubMenuClick=function(Qe){typeof le.props.onClick=="function"&&le.props.onClick(le.addKeyPath(Qe))},le.onSelect=function(Qe){le.props.onSelect(Qe)},le.onDeselect=function(Qe){le.props.onDeselect(Qe)},le.getPrefixCls=function(){return"".concat(le.props.rootPrefixCls,"-submenu")},le.getActiveClassName=function(){return"".concat(le.getPrefixCls(),"-active")},le.getDisabledClassName=function(){return"".concat(le.getPrefixCls(),"-disabled")},le.getSelectedClassName=function(){return"".concat(le.getPrefixCls(),"-selected")},le.getOpenClassName=function(){return"".concat(le.props.rootPrefixCls,"-submenu-open")},le.getVisible=function(){return le.state.isOpen},le.getMode=function(){return le.state.mode},le.saveMenuInstance=function(Qe){le.menuInstance=Qe},le.addKeyPath=function(Qe){return Object(G.a)(Object(G.a)({},Qe),{},{keyPath:(Qe.keyPath||[]).concat(le.props.eventKey)})},le.triggerOpenChange=function(Qe,pt){var Nt=le.props.eventKey,zt=function(){le.onOpenChange({key:Nt,item:Object(b.a)(le),trigger:pt,open:Qe})};pt==="mouseenter"?le.mouseenterTimeout=setTimeout(function(){zt()},0):zt()},le.isChildrenSelected=function(){var Qe={find:!1};return J(le.props.children,le.props.selectedKeys,Qe),Qe.find},le.isInlineMode=function(){return le.getMode()==="inline"},le.adjustWidth=function(){if(!le.subMenuTitle||!le.menuInstance)return;var Qe=Xt.findDOMNode(le.menuInstance);if(Qe.offsetWidth>=le.subMenuTitle.offsetWidth)return;Qe.style.minWidth="".concat(le.subMenuTitle.offsetWidth,"px")},le.saveSubMenuTitle=function(Qe){le.subMenuTitle=Qe},le.getBaseProps=function(){var Qe=Object(b.a)(le),pt=Qe.props,Nt=le.getMode();return{mode:Nt==="horizontal"?"vertical":Nt,visible:le.getVisible(),level:pt.level+1,inlineIndent:pt.inlineIndent,focusable:!1,onClick:le.onSubMenuClick,onSelect:le.onSelect,onDeselect:le.onDeselect,onDestroy:le.onDestroy,selectedKeys:pt.selectedKeys,eventKey:"".concat(pt.eventKey,"-menu-"),openKeys:pt.openKeys,motion:pt.motion,onOpenChange:le.onOpenChange,subMenuOpenDelay:pt.subMenuOpenDelay,parentMenu:Object(b.a)(le),subMenuCloseDelay:pt.subMenuCloseDelay,forceSubMenuRender:pt.forceSubMenuRender,triggerSubMenuAction:pt.triggerSubMenuAction,builtinPlacements:pt.builtinPlacements,defaultActiveFirst:pt.store.getState().defaultActiveFirst[ne(pt.eventKey)],multiple:pt.multiple,prefixCls:pt.rootPrefixCls,id:le.internalMenuId,manualRef:le.saveMenuInstance,itemIcon:pt.itemIcon,expandIcon:pt.expandIcon,direction:pt.direction}},le.getMotion=function(Qe,pt){var Nt=Object(b.a)(le),zt=Nt.haveRendered,nn=le.props,_n=nn.motion,Pn=nn.rootPrefixCls,Zn=Object(G.a)(Object(G.a)({},_n),{},{leavedClassName:"".concat(Pn,"-hidden"),removeOnLeave:!1,motionAppear:zt||!pt||Qe!=="inline"});return Zn};var ye=Ne.store,fe=Ne.eventKey,Ue=ye.getState(),Ye=Ue.defaultActiveFirst;le.isRootMenu=!1;var dt=!1;return Ye&&(dt=Ye[fe]),rt(ye,fe,dt),le.state={mode:Ne.mode,isOpen:Ne.isOpen},le}return Object(S.a)(ot,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var le=this,ye=this.props,fe=ye.mode,Ue=ye.parentMenu,Ye=ye.manualRef,dt=ye.isOpen,Qe=function(){le.setState({mode:fe,isOpen:dt})},pt=dt!==this.state.isOpen,Nt=fe!==this.state.mode;if((Nt||pt)&&(lt.a.cancel(this.updateStateRaf),Nt?this.updateStateRaf=Object(lt.a)(Qe):Qe()),Ye&&Ye(this),fe!=="horizontal"||!(Ue==null?void 0:Ue.isRootMenu)||!dt)return;this.minWidthTimeout=setTimeout(function(){return le.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var le=this.props,ye=le.onDestroy,fe=le.eventKey;ye&&ye(fe),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),lt.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(le,ye){var fe=this.getBaseProps();return L.createElement(Ft,Object(C.a)({},fe,{id:this.internalMenuId,className:le,style:ye}),this.props.children)}},{key:"renderChildren",value:function(){var le=this,ye=this.getBaseProps(),fe=ye.mode,Ue=ye.visible,Ye=ye.forceSubMenuRender,dt=ye.direction,Qe=this.getMotion(fe,Ue);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||Ue||Ye,!this.haveOpened)return L.createElement("div",null);var pt=H()("".concat(ye.prefixCls,"-sub"),Object(re.a)({},"".concat(ye.prefixCls,"-rtl"),dt==="rtl"));return this.isInlineMode()?L.createElement(oe,Object(C.a)({visible:ye.visible,forceRender:Ye},Qe),function(Nt){var zt=Nt.className,nn=Nt.style,_n=H()(pt,zt);return le.renderPopupMenu(_n,nn)}):this.renderPopupMenu(pt)}},{key:"render",value:function(){var le,ye,fe,Ue=Object(G.a)({},this.props),Ye=this.getVisible(),dt=this.getPrefixCls(),Qe=this.isInlineMode(),pt=this.getMode(),Nt=H()(dt,"".concat(dt,"-").concat(pt),(le={},Object(re.a)(le,Ue.className,!!Ue.className),Object(re.a)(le,this.getOpenClassName(),Ye),Object(re.a)(le,this.getActiveClassName(),Ue.active||Ye&&!Qe),Object(re.a)(le,this.getDisabledClassName(),Ue.disabled),Object(re.a)(le,this.getSelectedClassName(),this.isChildrenSelected()),le));this.internalMenuId||(Ue.eventKey?this.internalMenuId="".concat(Ue.eventKey,"$Menu"):(at+=1,this.internalMenuId="$__$".concat(at,"$Menu")));var zt={},nn={},_n={};Ue.disabled||(zt={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},nn={onClick:this.onTitleClick},_n={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Pn={},Zn=Ue.direction,qn=Zn==="rtl";Qe&&(qn?Pn.paddingRight=Ue.inlineIndent*Ue.level:Pn.paddingLeft=Ue.inlineIndent*Ue.level);var cr={};this.getVisible()&&(cr={"aria-owns":this.internalMenuId});var lr=null;pt!=="horizontal"&&(lr=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(lr=L.createElement(this.props.expandIcon,Object(G.a)({},this.props))));var ur=L.createElement("div",Object(C.a)({ref:this.saveSubMenuTitle,style:Pn,className:"".concat(dt,"-title"),role:"button"},_n,nn,{"aria-expanded":Ye},cr,{"aria-haspopup":"true",title:typeof Ue.title=="string"?Ue.title:void 0}),Ue.title,lr||L.createElement("i",{className:"".concat(dt,"-arrow")})),gr=this.renderChildren(),Er=((ye=Ue.parentMenu)===null||ye===void 0?void 0:ye.isRootMenu)?Ue.parentMenu.props.getPopupContainer:function(Rr){return Rr.parentNode},Vn=Be[pt],Pr=Ue.popupOffset?{offset:Ue.popupOffset}:{},Qn=H()((fe={},Object(re.a)(fe,Ue.popupClassName,Ue.popupClassName&&!Qe),Object(re.a)(fe,"".concat(dt,"-rtl"),qn),fe)),on=Ue.disabled,vn=Ue.triggerSubMenuAction,dr=Ue.subMenuOpenDelay,wr=Ue.forceSubMenuRender,Wn=Ue.subMenuCloseDelay,xr=Ue.builtinPlacements;me.forEach(function(Rr){return delete Ue[Rr]}),delete Ue.onClick;var Yr=qn?Object(G.a)(Object(G.a)({},Ae),xr):Object(G.a)(Object(G.a)({},ve),xr);delete Ue.direction;var Sr=this.getBaseProps(),Wr=Qe?null:this.getMotion(Sr.mode,Sr.visible);return L.createElement("li",Object(C.a)({},Ue,zt,{className:Nt,role:"menuitem"}),L.createElement(Nn,{prefixCls:dt,popupClassName:H()("".concat(dt,"-popup"),Qn),getPopupContainer:Er,builtinPlacements:Yr,popupPlacement:Vn,popupVisible:Qe?!1:Ye,popupAlign:Pr,popup:Qe?null:gr,action:on||Qe?[]:[vn],mouseEnterDelay:dr,mouseLeaveDelay:Wn,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:wr,popupMotion:Wr},ur),Qe?gr:null)}}]),ot}(L.Component);ht.defaultProps={onMouseEnter:Ke,onMouseLeave:Ke,onTitleMouseEnter:Ke,onTitleMouseLeave:Ke,onTitleClick:Ke,manualRef:Ke,mode:"vertical",title:""};var Me=Object(d.b)(function(Re,qe){var ot=Re.openKeys,Ne=Re.activeKey,le=Re.selectedKeys,ye=qe.eventKey,fe=qe.subMenuKey;return{isOpen:ot.indexOf(ye)>-1,active:Ne[fe]===ye,selectedKeys:le}})(ht);Me.isSubMenu=!0;var ft=Me,Ot="menuitem-overflowed",Ct=.5,_t=function(Re){Object(_.a)(ot,Re);var qe=Object(f.a)(ot);function ot(){var Ne;return Object(D.a)(this,ot),Ne=qe.apply(this,arguments),Ne.resizeObserver=null,Ne.mutationObserver=null,Ne.originalTotalWidth=0,Ne.overflowedItems=[],Ne.menuItemSizes=[],Ne.cancelFrameId=null,Ne.state={lastVisibleIndex:void 0},Ne.childRef=L.createRef(),Ne.getMenuItemNodes=function(){var le=Ne.props.prefixCls,ye=Ne.childRef.current;return ye?[].slice.call(ye.children).filter(function(fe){return fe.className.split(" ").indexOf("".concat(le,"-overflowed-submenu"))<0}):[]},Ne.getOverflowedSubMenuItem=function(le,ye,fe){var Ue=Ne.props,Ye=Ue.overflowedIndicator,dt=Ue.level,Qe=Ue.mode,pt=Ue.prefixCls,Nt=Ue.theme;if(dt!==1||Qe!=="horizontal")return null;var zt=Ne.props.children[0],nn=zt.props,_n=nn.children,Pn=nn.title,Zn=nn.style,qn=Object(j.a)(nn,["children","title","style"]),cr=Object(G.a)({},Zn),lr="".concat(le,"-overflowed-indicator"),ur="".concat(le,"-overflowed-indicator");ye.length===0&&fe!==!0?cr=Object(G.a)(Object(G.a)({},cr),{},{display:"none"}):fe&&(cr=Object(G.a)(Object(G.a)({},cr),{},{visibility:"hidden",position:"absolute"}),lr="".concat(lr,"-placeholder"),ur="".concat(ur,"-placeholder"));var gr=Nt?"".concat(pt,"-").concat(Nt):"",Er={};return me.forEach(function(Vn){qn[Vn]!==void 0&&(Er[Vn]=qn[Vn])}),L.createElement(ft,Object(C.a)({title:Ye,className:"".concat(pt,"-overflowed-submenu"),popupClassName:gr},Er,{key:lr,eventKey:ur,disabled:!1,style:cr}),ye)},Ne.setChildrenWidthAndResize=function(){if(Ne.props.mode!=="horizontal")return;var le=Ne.childRef.current;if(!le)return;var ye=le.children;if(!ye||ye.length===0)return;var fe=le.children[ye.length-1];ke(fe,"display","inline-block");var Ue=Ne.getMenuItemNodes(),Ye=Ue.filter(function(dt){return dt.className.split(" ").indexOf(Ot)>=0});Ye.forEach(function(dt){ke(dt,"display","inline-block")}),Ne.menuItemSizes=Ue.map(function(dt){return xe(dt,!0)}),Ye.forEach(function(dt){ke(dt,"display","none")}),Ne.overflowedIndicatorWidth=xe(le.children[le.children.length-1],!0),Ne.originalTotalWidth=Ne.menuItemSizes.reduce(function(dt,Qe){return dt+Qe},0),Ne.handleResize(),ke(fe,"display","none")},Ne.handleResize=function(){if(Ne.props.mode!=="horizontal")return;var le=Ne.childRef.current;if(!le)return;var ye=xe(le);Ne.overflowedItems=[];var fe=0,Ue;Ne.originalTotalWidth>ye+Ct&&(Ue=-1,Ne.menuItemSizes.forEach(function(Ye){fe+=Ye,fe+Ne.overflowedIndicatorWidth<=ye&&(Ue+=1)})),Ne.setState({lastVisibleIndex:Ue})},Ne}return Object(S.a)(ot,[{key:"componentDidMount",value:function(){var le=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var ye=this.childRef.current;if(!ye)return;this.resizeObserver=new Pt.default(function(fe){fe.forEach(function(){var Ue=le.cancelFrameId;cancelAnimationFrame(Ue),le.cancelFrameId=requestAnimationFrame(le.setChildrenWidthAndResize)})}),[].slice.call(ye.children).concat(ye).forEach(function(fe){le.resizeObserver.observe(fe)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){le.resizeObserver.disconnect(),[].slice.call(ye.children).concat(ye).forEach(function(fe){le.resizeObserver.observe(fe)}),le.setChildrenWidthAndResize()}),this.mutationObserver.observe(ye,{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(le){var ye=this,fe=this.state.lastVisibleIndex;return(le||[]).reduce(function(Ue,Ye,dt){var Qe=Ye;if(ye.props.mode==="horizontal"){var pt=ye.getOverflowedSubMenuItem(Ye.props.eventKey,[]);fe!==void 0&&ye.props.className.indexOf("".concat(ye.props.prefixCls,"-root"))!==-1&&(dt>fe&&(Qe=L.cloneElement(Ye,{style:{display:"none"},eventKey:"".concat(Ye.props.eventKey,"-hidden"),className:"".concat(Ot)})),dt===fe+1&&(ye.overflowedItems=le.slice(fe+1).map(function(zt){return L.cloneElement(zt,{key:zt.props.eventKey,mode:"vertical-left"})}),pt=ye.getOverflowedSubMenuItem(Ye.props.eventKey,ye.overflowedItems)));var Nt=[].concat(Object(x.a)(Ue),[pt,Qe]);return dt===le.length-1&&Nt.push(ye.getOverflowedSubMenuItem(Ye.props.eventKey,[],!0)),Nt}return[].concat(Object(x.a)(Ue),[Qe])},[])}},{key:"render",value:function(){var le=this.props,ye=le.visible,fe=le.prefixCls,Ue=le.overflowedIndicator,Ye=le.mode,dt=le.level,Qe=le.tag,pt=le.children,Nt=le.theme,zt=Object(j.a)(le,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),nn=Qe;return L.createElement(nn,Object(C.a)({ref:this.childRef},zt),this.renderChildren(pt))}}]),ot}(L.Component);_t.defaultProps={tag:"div",className:""};var Et=_t;function St(Re){return Re.length?Re.every(function(qe){return!!qe.props.disabled}):!0}function Fe(Re,qe,ot){var Ne=Re.getState();Re.setState({activeKey:Object(G.a)(Object(G.a)({},Ne.activeKey),{},Object(re.a)({},qe,ot))})}function At(Re){return Re.eventKey||"0-menu-"}function Zt(Re,qe){var ot=qe,Ne=Re.children,le=Re.eventKey;if(ot){var ye;if($(Ne,function(fe,Ue){fe&&fe.props&&!fe.props.disabled&&ot===st(fe,le,Ue)&&(ye=!0)}),ye)return ot}return ot=null,Re.defaultActiveFirst&&$(Ne,function(fe,Ue){!ot&&fe&&!fe.props.disabled&&(ot=st(fe,le,Ue))}),ot}function sn(Re){if(!Re)return;var qe=this.instanceArray.indexOf(Re);qe!==-1?this.instanceArray[qe]=Re:this.instanceArray.push(Re)}var On=function(Re){Object(_.a)(ot,Re);var qe=Object(f.a)(ot);function ot(Ne){var le;return Object(D.a)(this,ot),le=qe.call(this,Ne),le.onKeyDown=function(ye,fe){var Ue=ye.keyCode,Ye;if(le.getFlatInstanceArray().forEach(function(Qe){Qe&&Qe.props.active&&Qe.onKeyDown&&(Ye=Qe.onKeyDown(ye))}),Ye)return 1;var dt=null;return(Ue===a.a.UP||Ue===a.a.DOWN)&&(dt=le.step(Ue===a.a.UP?-1:1)),dt?(ye.preventDefault(),Fe(le.props.store,At(le.props),dt.props.eventKey),typeof fe=="function"&&fe(dt),1):void 0},le.onItemHover=function(ye){var fe=ye.key,Ue=ye.hover;Fe(le.props.store,At(le.props),Ue?fe:null)},le.onDeselect=function(ye){le.props.onDeselect(ye)},le.onSelect=function(ye){le.props.onSelect(ye)},le.onClick=function(ye){le.props.onClick(ye)},le.onOpenChange=function(ye){le.props.onOpenChange(ye)},le.onDestroy=function(ye){le.props.onDestroy(ye)},le.getFlatInstanceArray=function(){return le.instanceArray},le.step=function(ye){var fe=le.getFlatInstanceArray(),Ue=le.props.store.getState().activeKey[At(le.props)],Ye=fe.length;if(!Ye)return null;ye<0&&(fe=fe.concat().reverse());var dt=-1;if(fe.every(function(zt,nn){return zt&&zt.props.eventKey===Ue?(dt=nn,!1):!0}),!le.props.defaultActiveFirst&&dt!==-1&&St(fe.slice(dt,Ye-1)))return;var Qe=(dt+1)%Ye,pt=Qe;do{var Nt=fe[pt];if(!Nt||Nt.props.disabled)pt=(pt+1)%Ye;else return Nt}while(pt!==Qe);return null},le.renderCommonMenuItem=function(ye,fe,Ue){var Ye=le.props.store.getState(),dt=Object(b.a)(le),Qe=dt.props,pt=st(ye,Qe.eventKey,fe),Nt=ye.props;if(!Nt||typeof ye.type=="string")return ye;var zt=pt===Ye.activeKey,nn=Object(G.a)(Object(G.a)({mode:Nt.mode||Qe.mode,level:Qe.level,inlineIndent:Qe.inlineIndent,renderMenuItem:le.renderMenuItem,rootPrefixCls:Qe.prefixCls,index:fe,parentMenu:Qe.parentMenu,manualRef:Nt.disabled?void 0:Object(E.a)(ye.ref,sn.bind(Object(b.a)(le))),eventKey:pt,active:!Nt.disabled&&zt,multiple:Qe.multiple,onClick:function(Pn){(Nt.onClick||Ke)(Pn),le.onClick(Pn)},onItemHover:le.onItemHover,motion:Qe.motion,subMenuOpenDelay:Qe.subMenuOpenDelay,subMenuCloseDelay:Qe.subMenuCloseDelay,forceSubMenuRender:Qe.forceSubMenuRender,onOpenChange:le.onOpenChange,onDeselect:le.onDeselect,onSelect:le.onSelect,builtinPlacements:Qe.builtinPlacements,itemIcon:Nt.itemIcon||le.props.itemIcon,expandIcon:Nt.expandIcon||le.props.expandIcon},Ue),{},{direction:Qe.direction});return(Qe.mode==="inline"||$e())&&(nn.triggerSubMenuAction="click"),L.cloneElement(ye,Object(G.a)(Object(G.a)({},nn),{},{key:pt||fe}))},le.renderMenuItem=function(ye,fe,Ue){if(!ye)return null;var Ye=le.props.store.getState(),dt={openKeys:Ye.openKeys,selectedKeys:Ye.selectedKeys,triggerSubMenuAction:le.props.triggerSubMenuAction,subMenuKey:Ue};return le.renderCommonMenuItem(ye,fe,dt)},Ne.store.setState({activeKey:Object(G.a)(Object(G.a)({},Ne.store.getState().activeKey),{},Object(re.a)({},Ne.eventKey,Zt(Ne,Ne.activeKey)))}),le.instanceArray=[],le}return Object(S.a)(ot,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(le){return this.props.visible||le.visible||this.props.className!==le.className||!F()(this.props.style,le.style)}},{key:"componentDidUpdate",value:function(le){var ye=this.props,fe="activeKey"in ye?ye.activeKey:ye.store.getState().activeKey[At(ye)],Ue=Zt(ye,fe);if(Ue!==fe)Fe(ye.store,At(ye),Ue);else if("activeKey"in le){var Ye=Zt(le,le.activeKey);Ue!==Ye&&Fe(ye.store,At(ye),Ue)}}},{key:"render",value:function(){var le=this,ye=Object(C.a)({},this.props);this.instanceArray=[];var fe=H()(ye.prefixCls,ye.className,"".concat(ye.prefixCls,"-").concat(ye.mode)),Ue={className:fe,role:ye.role||"menu"};ye.id&&(Ue.id=ye.id),ye.focusable&&(Ue.tabIndex=0,Ue.onKeyDown=this.onKeyDown);var Ye=ye.prefixCls,dt=ye.eventKey,Qe=ye.visible,pt=ye.level,Nt=ye.mode,zt=ye.overflowedIndicator,nn=ye.theme;return me.forEach(function(_n){return delete ye[_n]}),delete ye.onClick,L.createElement(Et,Object(C.a)({},ye,{prefixCls:Ye,mode:Nt,tag:"ul",level:pt,theme:nn,visible:Qe,overflowedIndicator:zt},Ue),Object(O.a)(ye.children).map(function(_n,Pn){return le.renderMenuItem(_n,Pn,dt||"0-menu-")}))}}]),ot}(L.Component);On.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:Ke};var In=Object(d.b)()(On),Ft=In,$t=k("Kwbf");function Fn(Re,qe,ot){var Ne=Re.prefixCls,le=Re.motion,ye=Re.defaultMotions,fe=ye===void 0?{}:ye,Ue=Re.openAnimation,Ye=Re.openTransitionName,dt=qe.switchingModeFromInline;if(le)return le;if(Object(U.a)(Ue)==="object"&&Ue)Object($t.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof Ue=="string")return{motionName:"".concat(Ne,"-open-").concat(Ue)};if(Ye)return{motionName:Ye};var Qe=fe[ot];return Qe||(dt?null:fe.other)}var Oe=function(Re){Object(_.a)(ot,Re);var qe=Object(f.a)(ot);function ot(Ne){var le;Object(D.a)(this,ot),le=qe.call(this,Ne),le.onSelect=function(Ue){var Ye=Object(b.a)(le),dt=Ye.props;if(dt.selectable){var Qe=le.store.getState(),pt=Qe.selectedKeys,Nt=Ue.key;dt.multiple?pt=pt.concat([Nt]):pt=[Nt],"selectedKeys"in dt||le.store.setState({selectedKeys:pt}),dt.onSelect(Object(G.a)(Object(G.a)({},Ue),{},{selectedKeys:pt}))}},le.onClick=function(Ue){var Ye=le.getRealMenuMode(),dt=Object(b.a)(le),Qe=dt.store,pt=dt.props.onOpenChange;Ye!=="inline"&&!("openKeys"in le.props)&&(Qe.setState({openKeys:[]}),pt([])),le.props.onClick(Ue)},le.onKeyDown=function(Ue,Ye){le.innerMenu.getWrappedInstance().onKeyDown(Ue,Ye)},le.onOpenChange=function(Ue){var Ye=Object(b.a)(le),dt=Ye.props,Qe=le.store.getState().openKeys.concat(),pt=!1,Nt=function(nn){var _n=!1;if(nn.open)_n=Qe.indexOf(nn.key)===-1,_n&&Qe.push(nn.key);else{var Pn=Qe.indexOf(nn.key);_n=Pn!==-1,_n&&Qe.splice(Pn,1)}pt=pt||_n};Array.isArray(Ue)?Ue.forEach(Nt):Nt(Ue),pt&&("openKeys"in le.props||le.store.setState({openKeys:Qe}),dt.onOpenChange(Qe))},le.onDeselect=function(Ue){var Ye=Object(b.a)(le),dt=Ye.props;if(dt.selectable){var Qe=le.store.getState().selectedKeys.concat(),pt=Ue.key,Nt=Qe.indexOf(pt);Nt!==-1&&Qe.splice(Nt,1),"selectedKeys"in dt||le.store.setState({selectedKeys:Qe}),dt.onDeselect(Object(G.a)(Object(G.a)({},Ue),{},{selectedKeys:Qe}))}},le.onMouseEnter=function(Ue){le.restoreModeVerticalFromInline();var Ye=le.props.onMouseEnter;Ye&&Ye(Ue)},le.onTransitionEnd=function(Ue){var Ye=Ue.propertyName==="width"&&Ue.target===Ue.currentTarget,dt=Ue.target.className,Qe=Object.prototype.toString.call(dt)==="[object SVGAnimatedString]"?dt.animVal:dt,pt=Ue.propertyName==="font-size"&&Qe.indexOf("anticon")>=0;(Ye||pt)&&le.restoreModeVerticalFromInline()},le.setInnerMenu=function(Ue){le.innerMenu=Ue},le.isRootMenu=!0;var ye=Ne.defaultSelectedKeys,fe=Ne.defaultOpenKeys;return"selectedKeys"in Ne&&(ye=Ne.selectedKeys||[]),"openKeys"in Ne&&(fe=Ne.openKeys||[]),le.store=Object(d.c)({selectedKeys:ye,openKeys:fe,activeKey:{"0-menu-":Zt(Ne,Ne.activeKey)}}),le.state={switchingModeFromInline:!1,prevProps:Ne,inlineOpenKeys:[],store:le.store},le}return Object(S.a)(ot,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(le){var ye=this.props,fe=ye.siderCollapsed,Ue=ye.inlineCollapsed,Ye=ye.onOpenChange;(!le.inlineCollapsed&&Ue||!le.siderCollapsed&&fe)&&Ye([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var le=this.props.collapsedWidth,ye=this.store,fe=this.prevOpenKeys,Ue=this.getInlineCollapsed()&&(le===0||le==="0"||le==="0px");Ue?(this.prevOpenKeys=ye.getState().openKeys.concat(),this.store.setState({openKeys:[]})):fe&&(this.store.setState({openKeys:fe}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var le=this.props.mode,ye=this.state.switchingModeFromInline,fe=this.getInlineCollapsed();return ye&&fe?"inline":fe?"vertical":le}},{key:"getInlineCollapsed",value:function(){var le=this.props,ye=le.inlineCollapsed,fe=le.siderCollapsed;return fe!==void 0?fe:ye}},{key:"restoreModeVerticalFromInline",value:function(){var le=this.state.switchingModeFromInline;le&&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 le=Object(G.a)({},Object(g.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),ye=this.getRealMenuMode();return le.className+=" ".concat(le.prefixCls,"-root"),le.direction==="rtl"&&(le.className+=" ".concat(le.prefixCls,"-rtl")),le=Object(G.a)(Object(G.a)({},le),{},{mode:ye,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Fn(this.props,this.state,ye)}),delete le.openAnimation,delete le.openTransitionName,L.createElement(d.a,{store:this.store},L.createElement(Ft,Object(C.a)({},le,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(le,ye){var fe=ye.prevProps,Ue=ye.store,Ye=Ue.getState(),dt={},Qe={prevProps:le};return fe.mode==="inline"&&le.mode!=="inline"&&(Qe.switchingModeFromInline=!0),"openKeys"in le?dt.openKeys=le.openKeys||[]:((le.inlineCollapsed&&!fe.inlineCollapsed||le.siderCollapsed&&!fe.siderCollapsed)&&(Qe.switchingModeFromInline=!0,Qe.inlineOpenKeys=Ye.openKeys,dt.openKeys=[]),(!le.inlineCollapsed&&fe.inlineCollapsed||!le.siderCollapsed&&fe.siderCollapsed)&&(dt.openKeys=ye.inlineOpenKeys,Qe.inlineOpenKeys=[])),Object.keys(dt).length&&Ue.setState(dt),Qe}}]),ot}(L.Component);Oe.defaultProps={selectable:!0,onClick:Ke,onSelect:Ke,onOpenChange:Ke,onDeselect:Ke,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:L.createElement("span",null,"\xB7\xB7\xB7")};var It=Oe,Ut=function(Re){Object(_.a)(ot,Re);var qe=Object(f.a)(ot);function ot(){var Ne;return Object(D.a)(this,ot),Ne=qe.apply(this,arguments),Ne.onKeyDown=function(le){var ye=le.keyCode;return ye===a.a.ENTER?(Ne.onClick(le),!0):void 0},Ne.onMouseLeave=function(le){var ye=Ne.props,fe=ye.eventKey,Ue=ye.onItemHover,Ye=ye.onMouseLeave;Ue({key:fe,hover:!1}),Ye({key:fe,domEvent:le})},Ne.onMouseEnter=function(le){var ye=Ne.props,fe=ye.eventKey,Ue=ye.onItemHover,Ye=ye.onMouseEnter;Ue({key:fe,hover:!0}),Ye({key:fe,domEvent:le})},Ne.onClick=function(le){var ye=Ne.props,fe=ye.eventKey,Ue=ye.multiple,Ye=ye.onClick,dt=ye.onSelect,Qe=ye.onDeselect,pt=ye.isSelected,Nt={key:fe,keyPath:[fe],item:Object(b.a)(Ne),domEvent:le};Ye(Nt),Ue?pt?Qe(Nt):dt(Nt):pt||dt(Nt)},Ne.saveNode=function(le){Ne.node=le},Ne}return Object(S.a)(ot,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var le=this.props;le.onDestroy&&le.onDestroy(le.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 le,ye=Object(G.a)({},this.props),fe=H()(this.getPrefixCls(),ye.className,(le={},Object(re.a)(le,this.getActiveClassName(),!ye.disabled&&ye.active),Object(re.a)(le,this.getSelectedClassName(),ye.isSelected),Object(re.a)(le,this.getDisabledClassName(),ye.disabled),le)),Ue=Object(G.a)(Object(G.a)({},ye.attribute),{},{title:typeof ye.title=="string"?ye.title:void 0,className:fe,role:ye.role||"menuitem","aria-disabled":ye.disabled});ye.role==="option"?Ue=Object(G.a)(Object(G.a)({},Ue),{},{role:"option","aria-selected":ye.isSelected}):(ye.role===null||ye.role==="none")&&(Ue.role="none");var Ye={onClick:ye.disabled?null:this.onClick,onMouseLeave:ye.disabled?null:this.onMouseLeave,onMouseEnter:ye.disabled?null:this.onMouseEnter},dt=Object(G.a)({},ye.style);ye.mode==="inline"&&(ye.direction==="rtl"?dt.paddingRight=ye.inlineIndent*ye.level:dt.paddingLeft=ye.inlineIndent*ye.level),me.forEach(function(pt){return delete ye[pt]}),delete ye.direction;var Qe=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Qe=L.createElement(this.props.itemIcon,this.props)),L.createElement("li",Object(C.a)({},Object(g.a)(ye,["onClick","onMouseEnter","onMouseLeave","onSelect"]),Ue,Ye,{style:dt,ref:this.saveNode}),ye.children,Qe)}}]),ot}(L.Component);Ut.isMenuItem=!0,Ut.defaultProps={onSelect:Ke,onMouseEnter:Ke,onMouseLeave:Ke,manualRef:Ke};var tn=Object(d.b)(function(Re,qe){var ot=Re.activeKey,Ne=Re.selectedKeys,le=qe.eventKey,ye=qe.subMenuKey;return{active:ot[ye]===le,isSelected:Array.isArray(Ne)?Ne.indexOf(le)!==-1:Ne===le}})(Ut),un=tn,Sn=function(Re){Object(_.a)(ot,Re);var qe=Object(f.a)(ot);function ot(){var Ne;return Object(D.a)(this,ot),Ne=qe.apply(this,arguments),Ne.renderInnerMenuItem=function(le){var ye=Ne.props,fe=ye.renderMenuItem,Ue=ye.index;return fe(le,Ue,Ne.props.subMenuKey)},Ne}return Object(S.a)(ot,[{key:"render",value:function(){var le=Object(C.a)({},this.props),ye=le.className,fe=ye===void 0?"":ye,Ue=le.rootPrefixCls,Ye="".concat(Ue,"-item-group-title"),dt="".concat(Ue,"-item-group-list"),Qe=le.title,pt=le.children;return me.forEach(function(Nt){return delete le[Nt]}),delete le.direction,L.createElement("li",Object(C.a)({},le,{onClick:function(zt){return zt.stopPropagation()},className:"".concat(fe," ").concat(Ue,"-item-group")}),L.createElement("div",{className:Ye,title:typeof Qe=="string"?Qe:void 0},Qe),L.createElement("ul",{className:dt},L.Children.map(pt,this.renderInnerMenuItem)))}}]),ot}(L.Component);Sn.isMenuItemGroup=!0,Sn.defaultProps={disabled:!0};var An=Sn,$n=function(qe){var ot=qe.className,Ne=qe.rootPrefixCls,le=qe.style;return L.createElement("li",{className:"".concat(ot," ").concat(Ne,"-item-divider"),style:le})};$n.defaultProps={disabled:!0,className:"",style:{}};var pr=$n,Tn=It,jn=k("eDIo");function wn(Re,qe){var ot=Re.prefixCls,Ne=Re.editable,le=Re.locale,ye=Re.style;return!Ne||Ne.showAdd===!1?null:L.createElement("button",{ref:qe,type:"button",className:"".concat(ot,"-nav-add"),style:ye,"aria-label":(le==null?void 0:le.addAriaLabel)||"Add tab",onClick:function(Ue){Ne.onEdit("add",{event:Ue})}},Ne.addIcon||"+")}var fn=L.forwardRef(wn);function Kn(Re,qe){var ot=Re.prefixCls,Ne=Re.id,le=Re.tabs,ye=Re.locale,fe=Re.mobile,Ue=Re.moreIcon,Ye=Ue===void 0?"More":Ue,dt=Re.moreTransitionName,Qe=Re.style,pt=Re.className,Nt=Re.editable,zt=Re.tabBarGutter,nn=Re.rtl,_n=Re.onTabClick,Pn=Object(L.useState)(!1),Zn=Object(Y.a)(Pn,2),qn=Zn[0],cr=Zn[1],lr=Object(L.useState)(null),ur=Object(Y.a)(lr,2),gr=ur[0],Er=ur[1],Vn="".concat(Ne,"-more-popup"),Pr="".concat(ot,"-dropdown"),Qn=gr!==null?"".concat(Vn,"-").concat(gr):null,on=ye==null?void 0:ye.dropdownAriaLabel,vn=L.createElement(Tn,{onClick:function(Wr){var Rr=Wr.key,Ar=Wr.domEvent;_n(Rr,Ar),cr(!1)},id:Vn,tabIndex:-1,role:"listbox","aria-activedescendant":Qn,selectedKeys:[gr],"aria-label":on!==void 0?on:"expanded dropdown"},le.map(function(Sr){return L.createElement(un,{key:Sr.key,id:"".concat(Vn,"-").concat(Sr.key),role:"option","aria-controls":Ne&&"".concat(Ne,"-panel-").concat(Sr.key),disabled:Sr.disabled},Sr.tab)}));function dr(Sr){for(var Wr=le.filter(function(li){return!li.disabled}),Rr=Wr.findIndex(function(li){return li.key===gr})||0,Ar=Wr.length,Or=0;Or<Ar;Or+=1){Rr=(Rr+Sr+Ar)%Ar;var nr=Wr[Rr];if(!nr.disabled){Er(nr.key);return}}}function wr(Sr){var Wr=Sr.which;if(!qn){[a.a.DOWN,a.a.SPACE,a.a.ENTER].includes(Wr)&&(cr(!0),Sr.preventDefault());return}switch(Wr){case a.a.UP:dr(-1),Sr.preventDefault();break;case a.a.DOWN:dr(1),Sr.preventDefault();break;case a.a.ESC:cr(!1);break;case a.a.SPACE:case a.a.ENTER:gr!==null&&_n(gr,Sr);break}}Object(L.useEffect)(function(){var Sr=document.getElementById(Qn);Sr&&Sr.scrollIntoView&&Sr.scrollIntoView(!1)},[gr]),Object(L.useEffect)(function(){qn||Er(null)},[qn]);var Wn=Object(re.a)({},nn?"marginLeft":"marginRight",zt);le.length||(Wn.visibility="hidden",Wn.order=1);var xr=H()(Object(re.a)({},"".concat(Pr,"-rtl"),nn)),Yr=fe?null:L.createElement(jn.a,{prefixCls:Pr,overlay:vn,trigger:["hover"],visible:qn,transitionName:dt,onVisibleChange:cr,overlayClassName:xr,mouseEnterDelay:.1,mouseLeaveDelay:.1},L.createElement("button",{type:"button",className:"".concat(ot,"-nav-more"),style:Wn,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":Vn,id:"".concat(Ne,"-more"),"aria-expanded":qn,onKeyDown:wr},Ye));return L.createElement("div",{className:H()("".concat(ot,"-nav-operations"),pt),style:Qe,ref:qe},Yr,L.createElement(fn,{prefixCls:ot,locale:ye,editable:Nt}))}var yr=L.forwardRef(Kn),hr=Object(L.createContext)(null),xn=.1,Wt=.01,qt=20,Dn=Math.pow(.995,qt);function bn(){var Re=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(Re)||/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(Re.substr(0,4)))}function er(Re,qe){var ot=Object(L.useState)(),Ne=Object(Y.a)(ot,2),le=Ne[0],ye=Ne[1],fe=Object(L.useState)(0),Ue=Object(Y.a)(fe,2),Ye=Ue[0],dt=Ue[1],Qe=Object(L.useState)(0),pt=Object(Y.a)(Qe,2),Nt=pt[0],zt=pt[1],nn=Object(L.useState)(),_n=Object(Y.a)(nn,2),Pn=_n[0],Zn=_n[1],qn=Object(L.useRef)();function cr(on){var vn=on.touches[0],dr=vn.screenX,wr=vn.screenY;ye({x:dr,y:wr}),window.clearInterval(qn.current)}function lr(on){if(!le)return;on.preventDefault();var vn=on.touches[0],dr=vn.screenX,wr=vn.screenY;ye({x:dr,y:wr});var Wn=dr-le.x,xr=wr-le.y;qe(Wn,xr);var Yr=Date.now();dt(Yr),zt(Yr-Ye),Zn({x:Wn,y:xr})}function ur(){if(!le)return;if(ye(null),Zn(null),Pn){var on=Pn.x/Nt,vn=Pn.y/Nt,dr=Math.abs(on),wr=Math.abs(vn);if(Math.max(dr,wr)<xn)return;var Wn=on,xr=vn;qn.current=window.setInterval(function(){if(Math.abs(Wn)<Wt&&Math.abs(xr)<Wt){window.clearInterval(qn.current);return}Wn*=Dn,xr*=Dn,qe(Wn*qt,xr*qt)},qt)}}var gr=Object(L.useRef)(0),Er=Object(L.useRef)(!1),Vn=Object(L.useRef)();function Pr(on){var vn=on.deltaX,dr=on.deltaY,wr=0,Wn=Math.abs(vn),xr=Math.abs(dr);Wn===xr?wr=Vn.current==="x"?vn:dr:Wn>xr?(wr=vn,Vn.current="x"):(wr=dr,Vn.current="y");var Yr=Date.now();Yr-gr.current>100&&(Er.current=!1),(qe(-wr,-wr)||Er.current)&&(on.preventDefault(),Er.current=!0),gr.current=Yr}var Qn=Object(L.useRef)(null);Qn.current={onTouchStart:cr,onTouchMove:lr,onTouchEnd:ur,onWheel:Pr},L.useEffect(function(){function on(Wn){Qn.current.onTouchStart(Wn)}function vn(Wn){Qn.current.onTouchMove(Wn)}function dr(Wn){Qn.current.onTouchEnd(Wn)}function wr(Wn){Qn.current.onWheel(Wn)}return document.addEventListener("touchmove",vn,{passive:!1}),document.addEventListener("touchend",dr,{passive:!1}),Re.current.addEventListener("touchstart",on,{passive:!1}),Re.current.addEventListener("wheel",wr),function(){document.removeEventListener("touchmove",vn),document.removeEventListener("touchend",dr)}},[])}function jr(){var Re=Object(L.useRef)(new Map);function qe(Ne){return Re.current.has(Ne)||Re.current.set(Ne,L.createRef()),Re.current.get(Ne)}function ot(Ne){Re.current.delete(Ne)}return[qe,ot]}function br(Re,qe){var ot=L.useRef(Re),Ne=L.useState({}),le=Object(Y.a)(Ne,2),ye=le[1];function fe(Ue){var Ye=typeof Ue=="function"?Ue(ot.current):Ue;Ye!==ot.current&&qe(Ye,ot.current),ot.current=Ye,ye({})}return[ot.current,fe]}var Gr=function(qe){var ot=qe.position,Ne=qe.prefixCls,le=qe.extra;if(!le)return null;var ye,fe=le;return ot==="right"&&(ye=fe.right||!fe.left&&fe||null),ot==="left"&&(ye=fe.left||null),ye?L.createElement("div",{className:"".concat(Ne,"-extra-content")},ye):null};function Hr(Re,qe){var ot,Ne=L.useContext(hr),le=Ne.prefixCls,ye=Ne.tabs,fe=Re.className,Ue=Re.style,Ye=Re.id,dt=Re.animated,Qe=Re.activeKey,pt=Re.rtl,Nt=Re.extra,zt=Re.editable,nn=Re.locale,_n=Re.tabPosition,Pn=Re.tabBarGutter,Zn=Re.children,qn=Re.onTabClick,cr=Re.onTabScroll,lr=Object(L.useRef)(),ur=Object(L.useRef)(),gr=Object(L.useRef)(),Er=Object(L.useRef)(),Vn=jr(),Pr=Object(Y.a)(Vn,2),Qn=Pr[0],on=Pr[1],vn=_n==="top"||_n==="bottom",dr=br(0,function(Qr,Mr){vn&&cr&&cr({direction:Qr>Mr?"left":"right"})}),wr=Object(Y.a)(dr,2),Wn=wr[0],xr=wr[1],Yr=br(0,function(Qr,Mr){!vn&&cr&&cr({direction:Qr>Mr?"top":"bottom"})}),Sr=Object(Y.a)(Yr,2),Wr=Sr[0],Rr=Sr[1],Ar=Object(L.useState)(0),Or=Object(Y.a)(Ar,2),nr=Or[0],li=Or[1],Yi=Object(L.useState)(0),wi=Object(Y.a)(Yi,2),gi=wi[0],ei=wi[1],Xr=Object(L.useState)(0),En=Object(Y.a)(Xr,2),yn=En[0],zn=En[1],Br=Object(L.useState)(0),or=Object(Y.a)(Br,2),Lr=or[0],ji=or[1],Fi=Object(L.useState)(null),$r=Object(Y.a)(Fi,2),Zr=$r[0],xi=$r[1],Ma=Object(L.useState)(null),no=Object(Y.a)(Ma,2),ua=no[0],Ta=no[1],wa=Object(L.useState)(0),Oa=Object(Y.a)(wa,2),ka=Oa[0],co=Oa[1],Ro=Object(L.useState)(0),Ga=Object(Y.a)(Ro,2),Sa=Ga[0],Va=Ga[1],_a=n(new Map),Ra=Object(Y.a)(_a,2),ho=Ra[0],Ya=Ra[1],Aa=c(ye,ho,nr),Da="".concat(le,"-nav-operations-hidden"),ya=0,ki=0;vn?pt?(ya=0,ki=Math.max(0,nr-Zr)):(ya=Math.min(0,Zr-nr),ki=0):(ya=Math.min(0,ua-gi),ki=0);function fa(Qr){return Qr<ya?[ya,!1]:Qr>ki?[ki,!1]:[Qr,!0]}var pa=Object(L.useRef)(),ba=Object(L.useState)(),ma=Object(Y.a)(ba,2),Xa=ma[0],$a=ma[1];function Qa(){$a(Date.now())}function Ia(){window.clearTimeout(pa.current)}er(lr,function(Qr,Mr){var di=!1;function Bi(Pa,da){Pa(function(ja){var ha=fa(ja+da),Ci=Object(Y.a)(ha,2),Fa=Ci[0],Ba=Ci[1];return di=Ba,Fa})}if(vn){if(Zr>=nr)return di;Bi(xr,Qr)}else{if(ua>=gi)return di;Bi(Rr,Mr)}return Ia(),Qa(),di}),Object(L.useEffect)(function(){return Ia(),Xa&&(pa.current=window.setTimeout(function(){$a(0)},100)),Ia},[Xa]);function ca(){var Qr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Qe,Mr=Aa.get(Qr);if(!Mr)return;if(vn){var di=Wn;pt?Mr.right<Wn?di=Mr.right:Mr.right+Mr.width>Wn+Zr&&(di=Mr.right+Mr.width-Zr):Mr.left<-Wn?di=-Mr.left:Mr.left+Mr.width>-Wn+Zr&&(di=-(Mr.left+Mr.width-Zr)),Rr(0),xr(fa(di)[0])}else{var Bi=Wr;Mr.top<-Wr?Bi=-Mr.top:Mr.top+Mr.height>-Wr+ua&&(Bi=-(Mr.top+Mr.height-ua)),xr(0),Rr(fa(Bi)[0])}}var Ea=w(Aa,{width:Zr,height:ua,left:Wn,top:Wr},{width:yn,height:Lr},{width:ka,height:Sa},Object(G.a)(Object(G.a)({},Re),{},{tabs:ye})),ro=Object(Y.a)(Ea,2),Ao=ro[0],Do=ro[1],fo=ye.map(function(Qr){var Mr=Qr.key;return L.createElement(s,{id:Ye,prefixCls:le,key:Mr,rtl:pt,tab:Qr,closable:Qr.closable,editable:zt,active:Mr===Qe,tabPosition:_n,tabBarGutter:Pn,renderWrapper:Zn,removeAriaLabel:nn==null?void 0:nn.removeAriaLabel,ref:Qn(Mr),onClick:function(Bi){qn(Mr,Bi)},onRemove:function(){on(Mr)},onFocus:function(){ca(Mr),Qa(),pt||(lr.current.scrollLeft=0),lr.current.scrollTop=0}})}),io=r(function(){var Qr,Mr,di,Bi,Pa,da,ja,ha,Ci,Fa=((Qr=lr.current)===null||Qr===void 0?void 0:Qr.offsetWidth)||0,Ba=((Mr=lr.current)===null||Mr===void 0?void 0:Mr.offsetHeight)||0,Ha=((di=Er.current)===null||di===void 0?void 0:di.offsetWidth)||0,zi=((Bi=Er.current)===null||Bi===void 0?void 0:Bi.offsetHeight)||0,zr=((Pa=gr.current)===null||Pa===void 0?void 0:Pa.offsetWidth)||0,_r=((da=gr.current)===null||da===void 0?void 0:da.offsetHeight)||0;xi(Fa),Ta(Ba),co(Ha),Va(zi);var kn=(((ja=ur.current)===null||ja===void 0?void 0:ja.offsetWidth)||0)-Ha,Jn=(((ha=ur.current)===null||ha===void 0?void 0:ha.offsetHeight)||0)-zi;li(kn),ei(Jn);var Dr=(Ci=gr.current)===null||Ci===void 0?void 0:Ci.className.includes(Da);zn(kn-(Dr?0:zr)),ji(Jn-(Dr?0:_r)),Ya(function(){var ui=new Map;return ye.forEach(function(ga){var oa=ga.key,Di=Qn(oa).current;Di&&ui.set(oa,{width:Di.offsetWidth,height:Di.offsetHeight,left:Di.offsetLeft,top:Di.offsetTop})}),ui})}),po=ye.slice(0,Ao),Ki=ye.slice(Do+1),vi=[].concat(Object(x.a)(po),Object(x.a)(Ki)),Ai=Object(L.useState)(),_i=Object(Y.a)(Ai,2),Na=_i[0],mo=_i[1],ta=Aa.get(Qe),ao=Object(L.useRef)();function oo(){m.a.cancel(ao.current)}Object(L.useEffect)(function(){var Qr={};return ta&&(vn?(pt?Qr.right=ta.right:Qr.left=ta.left,Qr.width=ta.width):(Qr.top=ta.top,Qr.height=ta.height)),oo(),ao.current=m()(function(){mo(Qr)}),oo},[ta,vn,pt]),Object(L.useEffect)(function(){ca()},[Qe,ta,Aa,vn]),Object(L.useEffect)(function(){io()},[pt,Pn,Qe,ye.map(function(Qr){return Qr.key}).join("_")]);var so=!!vi.length,xa="".concat(le,"-nav-wrap"),Ja,Ua,go,Za;return vn?pt?(Ua=Wn>0,Ja=Wn+Zr<nr):(Ja=Wn<0,Ua=-Wn+Zr<nr):(go=Wr<0,Za=-Wr+ua<gi),L.createElement("div",{ref:qe,role:"tablist",className:H()("".concat(le,"-nav"),fe),style:Ue,onKeyDown:function(){Qa()}},L.createElement(Gr,{position:"left",extra:Nt,prefixCls:le}),L.createElement(h.a,{onResize:io},L.createElement("div",{className:H()(xa,(ot={},Object(re.a)(ot,"".concat(xa,"-ping-left"),Ja),Object(re.a)(ot,"".concat(xa,"-ping-right"),Ua),Object(re.a)(ot,"".concat(xa,"-ping-top"),go),Object(re.a)(ot,"".concat(xa,"-ping-bottom"),Za),ot)),ref:lr},L.createElement(h.a,{onResize:io},L.createElement("div",{ref:ur,className:"".concat(le,"-nav-list"),style:{transform:"translate(".concat(Wn,"px, ").concat(Wr,"px)"),transition:Xa?"none":void 0}},fo,L.createElement(fn,{ref:Er,prefixCls:le,locale:nn,editable:zt,style:{visibility:so?"hidden":null}}),L.createElement("div",{className:H()("".concat(le,"-ink-bar"),Object(re.a)({},"".concat(le,"-ink-bar-animated"),dt.inkBar)),style:Na}))))),L.createElement(yr,Object.assign({},Re,{ref:gr,prefixCls:le,tabs:vi,className:!so&&Da})),L.createElement(Gr,{position:"right",extra:Nt,prefixCls:le}))}var mr=L.forwardRef(Hr);function Rn(Re){var qe=Re.id,ot=Re.activeKey,Ne=Re.animated,le=Re.tabPosition,ye=Re.rtl,fe=Re.destroyInactiveTabPane,Ue=L.useContext(hr),Ye=Ue.prefixCls,dt=Ue.tabs,Qe=Ne.tabPane,pt=dt.findIndex(function(Nt){return Nt.key===ot});return L.createElement("div",{className:H()("".concat(Ye,"-content-holder"))},L.createElement("div",{className:H()("".concat(Ye,"-content"),"".concat(Ye,"-content-").concat(le),Object(re.a)({},"".concat(Ye,"-content-animated"),Qe)),style:pt&&Qe?Object(re.a)({},ye?"marginRight":"marginLeft","-".concat(pt,"00%")):null},dt.map(function(Nt){return L.cloneElement(Nt.node,{key:Nt.key,prefixCls:Ye,tabKey:Nt.key,id:qe,animated:Qe,active:Nt.key===ot,destroyInactiveTabPane:fe})})))}function Tr(Re){var qe=Re.prefixCls,ot=Re.forceRender,Ne=Re.className,le=Re.style,ye=Re.id,fe=Re.active,Ue=Re.animated,Ye=Re.destroyInactiveTabPane,dt=Re.tabKey,Qe=Re.children,pt=L.useState(ot),Nt=Object(Y.a)(pt,2),zt=Nt[0],nn=Nt[1];L.useEffect(function(){fe?nn(!0):Ye&&nn(!1)},[fe,Ye]);var _n={};return fe||(Ue?(_n.visibility="hidden",_n.height=0,_n.overflowY="hidden"):_n.display="none"),L.createElement("div",{id:ye&&"".concat(ye,"-panel-").concat(dt),role:"tabpanel",tabIndex:fe?0:-1,"aria-labelledby":ye&&"".concat(ye,"-tab-").concat(dt),"aria-hidden":!fe,style:Object(G.a)(Object(G.a)({},_n),le),className:H()("".concat(qe,"-tabpane"),fe&&"".concat(qe,"-tabpane-active"),Ne)},(fe||zt||ot)&&Qe)}var kr=0;function mi(Re){return Object(O.a)(Re).map(function(qe){if(L.isValidElement(qe)){var ot=qe.key!==void 0?String(qe.key):void 0;return Object(G.a)(Object(G.a)({key:ot},qe.props),{},{node:qe})}return null}).filter(function(qe){return qe})}function Vr(Re,qe){var ot,Ne=Re.id,le=Re.prefixCls,ye=le===void 0?"rc-tabs":le,fe=Re.className,Ue=Re.children,Ye=Re.direction,dt=Re.activeKey,Qe=Re.defaultActiveKey,pt=Re.editable,Nt=Re.animated,zt=Re.tabPosition,nn=zt===void 0?"top":zt,_n=Re.tabBarGutter,Pn=Re.tabBarStyle,Zn=Re.tabBarExtraContent,qn=Re.locale,cr=Re.moreIcon,lr=Re.moreTransitionName,ur=Re.destroyInactiveTabPane,gr=Re.renderTabBar,Er=Re.onChange,Vn=Re.onTabClick,Pr=Re.onTabScroll,Qn=Object(j.a)(Re,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),on=mi(Ue),vn=Ye==="rtl",dr;Nt===!1?dr={inkBar:!1,tabPane:!1}:dr=Object(G.a)({inkBar:!0,tabPane:!1},Nt!==!0?Nt:null);var wr=Object(L.useState)(!1),Wn=Object(Y.a)(wr,2),xr=Wn[0],Yr=Wn[1];Object(L.useEffect)(function(){Yr(bn())},[]);var Sr=Object(I.a)(function(){var Lr;return(Lr=on[0])===null||Lr===void 0?void 0:Lr.key},{value:dt,defaultValue:Qe}),Wr=Object(Y.a)(Sr,2),Rr=Wr[0],Ar=Wr[1],Or=Object(L.useState)(function(){return on.findIndex(function(Lr){return Lr.key===Rr})}),nr=Object(Y.a)(Or,2),li=nr[0],Yi=nr[1];Object(L.useEffect)(function(){var Lr=on.findIndex(function(Fi){return Fi.key===Rr});if(Lr===-1){var ji;Lr=Math.max(0,Math.min(li,on.length-1)),Ar((ji=on[Lr])===null||ji===void 0?void 0:ji.key)}Yi(Lr)},[on.map(function(Lr){return Lr.key}).join("_"),Rr,li]);var wi=Object(I.a)(null,{value:Ne}),gi=Object(Y.a)(wi,2),ei=gi[0],Xr=gi[1],En=nn;xr&&!["left","right"].includes(nn)&&(En="top"),Object(L.useEffect)(function(){Ne||(Xr("rc-tabs-".concat(kr)),kr+=1)},[]);function yn(Lr,ji){Vn==null||Vn(Lr,ji),Ar(Lr),Er==null||Er(Lr)}var zn={id:ei,activeKey:Rr,animated:dr,tabPosition:En,rtl:vn,mobile:xr},Br,or=Object(G.a)(Object(G.a)({},zn),{},{editable:pt,locale:qn,moreIcon:cr,moreTransitionName:lr,tabBarGutter:_n,onTabClick:yn,onTabScroll:Pr,extra:Zn,style:Pn,panes:Ue});return gr?Br=gr(or,mr):Br=L.createElement(mr,Object.assign({},or)),L.createElement(hr.Provider,{value:{tabs:on,prefixCls:ye}},L.createElement("div",Object.assign({ref:qe,id:Ne,className:H()(ye,"".concat(ye,"-").concat(En),(ot={},Object(re.a)(ot,"".concat(ye,"-mobile"),xr),Object(re.a)(ot,"".concat(ye,"-editable"),pt),Object(re.a)(ot,"".concat(ye,"-rtl"),vn),ot),fe)},Qn),Br,L.createElement(Rn,Object.assign({destroyInactiveTabPane:ur},zn,{animated:dr}))))}var Cr=L.forwardRef(Vr);Cr.TabPane=Tr;var Fr=Cr,ti=et.b=Fr},kSUc:function(Gt,et,k){},"kVK+":function(Gt,et){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */et.read=function(k,re,Y,j,G){var L,P,H=G*8-j-1,O=(1<<H)-1,I=O>>1,x=-7,p=Y?G-1:0,m=Y?-1:1,h=k[re+p];for(p+=m,L=h&(1<<-x)-1,h>>=-x,x+=H;x>0;L=L*256+k[re+p],p+=m,x-=8);for(P=L&(1<<-x)-1,L>>=-x,x+=j;x>0;P=P*256+k[re+p],p+=m,x-=8);if(L===0)L=1-I;else{if(L===O)return P?NaN:(h?-1:1)*Infinity;P=P+Math.pow(2,j),L=L-I}return(h?-1:1)*P*Math.pow(2,L-j)},et.write=function(k,re,Y,j,G,L){var P,H,O,I=L*8-G-1,x=(1<<I)-1,p=x>>1,m=G===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=j?0:L-1,r=j?1:-1,n=re<0||re===0&&1/re<0?1:0;for(re=Math.abs(re),isNaN(re)||re===Infinity?(H=isNaN(re)?1:0,P=x):(P=Math.floor(Math.log(re)/Math.LN2),re*(O=Math.pow(2,-P))<1&&(P--,O*=2),P+p>=1?re+=m/O:re+=m*Math.pow(2,1-p),re*O>=2&&(P++,O/=2),P+p>=x?(H=0,P=x):P+p>=1?(H=(re*O-1)*Math.pow(2,G),P=P+p):(H=re*Math.pow(2,p-1)*Math.pow(2,G),P=0));G>=8;k[Y+h]=H&255,h+=r,H/=256,G-=8);for(P=P<<G|H,I+=G;I>0;k[Y+h]=P&255,h+=r,P/=256,I-=8);k[Y+h-r]|=n*128}},lZu9:function(Gt,et,k){(function(re){re(k("VrN/"),k("1eCo"),k("8EBN"))})(function(re){"use strict";re.defineMode("markdown",function(Y,j){var G=re.getMode(Y,"text/html"),L=G.name=="null";function P(M){if(re.findModeByName){var y=re.findModeByName(M);y&&(M=y.mime||y.mimes[0])}var W=re.getMode(Y,M);return W.name=="null"?null:W}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 H={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var O in H)H.hasOwnProperty(O)&&j.tokenTypeOverrides[O]&&(H[O]=j.tokenTypeOverrides[O]);var I=/^([*\-_])(?:\s*\1){2,}\s*$/,x=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,p=/^\[(x| )\](?=\s)/i,m=j.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,h=/^ {0,3}(?:\={1,}|-{2,})\s*$/,r=/^[^#!\[\]*_\\<>` "'(~:]+/,n=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,a=/^\s*\[[^\]]+?\]:.*$/,l=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,s=" ";function u(M,y,W){return y.f=y.inline=W,W(M,y)}function c(M,y,W){return y.f=y.block=W,W(M,y)}function R(M){return!M||!/\S/.test(M.string)}function w(M){if(M.linkTitle=!1,M.linkHref=!1,M.linkText=!1,M.em=!1,M.strong=!1,M.strikethrough=!1,M.quote=0,M.indentedCode=!1,M.f==D){var y=L;if(!y){var W=re.innerMode(G,M.htmlState);y=W.mode.name=="xml"&&W.state.tagStart===null&&!W.state.context&&W.state.tokenize.isInText}y&&(M.f=f,M.block=C,M.htmlState=null)}return M.trailingSpace=0,M.trailingSpaceNewLine=!1,M.prevLine=M.thisLine,M.thisLine={stream:null},null}function C(M,y){var W=M.column()===y.indentation,X=R(y.prevLine.stream),te=y.indentedCode,pe=y.prevLine.hr,Ie=y.list!==!1,Ee=(y.listStack[y.listStack.length-1]||0)+3;y.indentedCode=!1;var Te=y.indentation;if(y.indentationDiff===null&&(y.indentationDiff=y.indentation,Ie)){for(y.list=null;Te<y.listStack[y.listStack.length-1];)y.listStack.pop(),y.listStack.length?y.indentation=y.listStack[y.listStack.length-1]:y.list=!1;y.list!==!1&&(y.indentationDiff=Te-y.listStack[y.listStack.length-1])}var We=!X&&!pe&&!y.prevLine.header&&(!Ie||!te)&&!y.prevLine.fencedCodeEnd,He=(y.list===!1||pe||X)&&y.indentation<=Ee&&M.match(I),Ce=null;if(y.indentationDiff>=4&&(te||y.prevLine.fencedCodeEnd||y.prevLine.header||X))return M.skipToEnd(),y.indentedCode=!0,H.code;if(M.eatSpace())return null;if(W&&y.indentation<=Ee&&(Ce=M.match(m))&&Ce[1].length<=6)return y.quote=0,y.header=Ce[1].length,y.thisLine.header=!0,j.highlightFormatting&&(y.formatting="header"),y.f=y.inline,b(y);if(y.indentation<=Ee&&M.eat(">"))return y.quote=W?1:y.quote+1,j.highlightFormatting&&(y.formatting="quote"),M.eatSpace(),b(y);if(!He&&!y.setext&&W&&y.indentation<=Ee&&(Ce=M.match(x))){var ue=Ce[1]?"ol":"ul";return y.indentation=Te+M.current().length,y.list=!0,y.quote=0,y.listStack.push(y.indentation),y.em=!1,y.strong=!1,y.code=!1,y.strikethrough=!1,j.taskLists&&M.match(p,!1)&&(y.taskList=!0),y.f=y.inline,j.highlightFormatting&&(y.formatting=["list","list-"+ue]),b(y)}else{if(W&&y.indentation<=Ee&&(Ce=M.match(n,!0)))return y.quote=0,y.fencedEndRE=new RegExp(Ce[1]+"+ *$"),y.localMode=j.fencedCodeBlockHighlighting&&P(Ce[2]||j.fencedCodeBlockDefaultMode),y.localMode&&(y.localState=re.startState(y.localMode)),y.f=y.block=S,j.highlightFormatting&&(y.formatting="code-block"),y.code=-1,b(y);if(y.setext||(!We||!Ie)&&!y.quote&&y.list===!1&&!y.code&&!He&&!a.test(M.string)&&(Ce=M.lookAhead(1))&&(Ce=Ce.match(h)))return y.setext?(y.header=y.setext,y.setext=0,M.skipToEnd(),j.highlightFormatting&&(y.formatting="header")):(y.header=Ce[0].charAt(0)=="="?1:2,y.setext=y.header),y.thisLine.header=!0,y.f=y.inline,b(y);if(He)return M.skipToEnd(),y.hr=!0,y.thisLine.hr=!0,H.hr;if(M.peek()==="[")return u(M,y,F)}return u(M,y,y.inline)}function D(M,y){var W=G.token(M,y.htmlState);if(!L){var X=re.innerMode(G,y.htmlState);(X.mode.name=="xml"&&X.state.tagStart===null&&!X.state.context&&X.state.tokenize.isInText||y.md_inside&&M.current().indexOf(">")>-1)&&(y.f=f,y.block=C,y.htmlState=null)}return W}function S(M,y){var W=y.listStack[y.listStack.length-1]||0,X=y.indentation<W,te=W+3;if(y.fencedEndRE&&y.indentation<=te&&(X||M.match(y.fencedEndRE))){j.highlightFormatting&&(y.formatting="code-block");var pe;return X||(pe=b(y)),y.localMode=y.localState=null,y.block=C,y.f=f,y.fencedEndRE=null,y.code=0,y.thisLine.fencedCodeEnd=!0,X?c(M,y,y.block):pe}else return y.localMode?y.localMode.token(M,y.localState):(M.skipToEnd(),H.code)}function b(M){var y=[];if(M.formatting){y.push(H.formatting),typeof M.formatting=="string"&&(M.formatting=[M.formatting]);for(var W=0;W<M.formatting.length;W++)y.push(H.formatting+"-"+M.formatting[W]),M.formatting[W]==="header"&&y.push(H.formatting+"-"+M.formatting[W]+"-"+M.header),M.formatting[W]==="quote"&&(!j.maxBlockquoteDepth||j.maxBlockquoteDepth>=M.quote?y.push(H.formatting+"-"+M.formatting[W]+"-"+M.quote):y.push("error"))}if(M.taskOpen)return y.push("meta"),y.length?y.join(" "):null;if(M.taskClosed)return y.push("property"),y.length?y.join(" "):null;if(M.linkHref?y.push(H.linkHref,"url"):(M.strong&&y.push(H.strong),M.em&&y.push(H.em),M.strikethrough&&y.push(H.strikethrough),M.emoji&&y.push(H.emoji),M.linkText&&y.push(H.linkText),M.code&&y.push(H.code),M.image&&y.push(H.image),M.imageAltText&&y.push(H.imageAltText,"link"),M.imageMarker&&y.push(H.imageMarker)),M.header&&y.push(H.header,H.header+"-"+M.header),M.quote&&(y.push(H.quote),!j.maxBlockquoteDepth||j.maxBlockquoteDepth>=M.quote?y.push(H.quote+"-"+M.quote):y.push(H.quote+"-"+j.maxBlockquoteDepth)),M.list!==!1){var X=(M.listStack.length-1)%3;X?X===1?y.push(H.list2):y.push(H.list3):y.push(H.list1)}return M.trailingSpaceNewLine?y.push("trailing-space-new-line"):M.trailingSpace&&y.push("trailing-space-"+(M.trailingSpace%2?"a":"b")),y.length?y.join(" "):null}function _(M,y){return M.match(r,!0)?b(y):void 0}function f(M,y){var W=y.text(M,y);if(typeof W!="undefined")return W;if(y.list)return y.list=null,b(y);if(y.taskList){var X=M.match(p,!0)[1]===" ";return X?y.taskOpen=!0:y.taskClosed=!0,j.highlightFormatting&&(y.formatting="task"),y.taskList=!1,b(y)}if(y.taskOpen=!1,y.taskClosed=!1,y.header&&M.match(/^#+$/,!0))return j.highlightFormatting&&(y.formatting="header"),b(y);var te=M.next();if(y.linkTitle){y.linkTitle=!1;var pe=te;te==="("&&(pe=")"),pe=(pe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ie="^\\s*(?:[^"+pe+"\\\\]+|\\\\\\\\|\\\\.)"+pe;if(M.match(new RegExp(Ie),!0))return H.linkHref}if(te==="`"){var Ee=y.formatting;j.highlightFormatting&&(y.formatting="code"),M.eatWhile("`");var Te=M.current().length;if(y.code==0&&(!y.quote||Te==1))return y.code=Te,b(y);if(Te==y.code){var We=b(y);return y.code=0,We}else return y.formatting=Ee,b(y)}else if(y.code)return b(y);if(te==="\\"&&(M.next(),j.highlightFormatting)){var He=b(y),Ce=H.formatting+"-escape";return He?He+" "+Ce:Ce}if(te==="!"&&M.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return y.imageMarker=!0,y.image=!0,j.highlightFormatting&&(y.formatting="image"),b(y);if(te==="["&&y.imageMarker&&M.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return y.imageMarker=!1,y.imageAltText=!0,j.highlightFormatting&&(y.formatting="image"),b(y);if(te==="]"&&y.imageAltText){j.highlightFormatting&&(y.formatting="image");var He=b(y);return y.imageAltText=!1,y.image=!1,y.inline=y.f=g,He}if(te==="["&&!y.image)return y.linkText&&M.match(/^.*?\]/)||(y.linkText=!0,j.highlightFormatting&&(y.formatting="link")),b(y);if(te==="]"&&y.linkText){j.highlightFormatting&&(y.formatting="link");var He=b(y);return y.linkText=!1,y.inline=y.f=M.match(/\(.*?\)| ?\[.*?\]/,!1)?g:f,He}if(te==="<"&&M.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){y.f=y.inline=d,j.highlightFormatting&&(y.formatting="link");var He=b(y);return He?He+=" ":He="",He+H.linkInline}if(te==="<"&&M.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){y.f=y.inline=d,j.highlightFormatting&&(y.formatting="link");var He=b(y);return He?He+=" ":He="",He+H.linkEmail}if(j.xml&&te==="<"&&M.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ue=M.string.indexOf(">",M.pos);if(ue!=-1){var se=M.string.substring(M.start,ue);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(se)&&(y.md_inside=!0)}return M.backUp(1),y.htmlState=re.startState(G),c(M,y,D)}if(j.xml&&te==="<"&&M.match(/^\/\w*?>/))return y.md_inside=!1,"tag";if(te==="*"||te==="_"){for(var we=1,ge=M.pos==1?" ":M.string.charAt(M.pos-2);we<3&&M.eat(te);)we++;var Ke=M.peek()||" ",st=!/\s/.test(Ke)&&(!l.test(Ke)||/\s/.test(ge)||l.test(ge)),ne=!/\s/.test(ge)&&(!l.test(ge)||/\s/.test(Ke)||l.test(Ke)),$=null,J=null;if(we%2&&(!y.em&&st&&(te==="*"||!ne||l.test(ge))?$=!0:y.em==te&&ne&&(te==="*"||!st||l.test(Ke))&&($=!1)),we>1&&(!y.strong&&st&&(te==="*"||!ne||l.test(ge))?J=!0:y.strong==te&&ne&&(te==="*"||!st||l.test(Ke))&&(J=!1)),J!=null||$!=null){j.highlightFormatting&&(y.formatting=$==null?"strong":J==null?"em":"strong em"),$===!0&&(y.em=te),J===!0&&(y.strong=te);var We=b(y);return $===!1&&(y.em=!1),J===!1&&(y.strong=!1),We}}else if(te===" "&&(M.eat("*")||M.eat("_"))){if(M.peek()===" ")return b(y);M.backUp(1)}if(j.strikethrough){if(te==="~"&&M.eatWhile(te)){if(y.strikethrough){j.highlightFormatting&&(y.formatting="strikethrough");var We=b(y);return y.strikethrough=!1,We}else if(M.match(/^[^\s]/,!1))return y.strikethrough=!0,j.highlightFormatting&&(y.formatting="strikethrough"),b(y)}else if(te===" "&&M.match(/^~~/,!0)){if(M.peek()===" ")return b(y);M.backUp(2)}}if(j.emoji&&te===":"&&M.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){y.emoji=!0,j.highlightFormatting&&(y.formatting="emoji");var me=b(y);return y.emoji=!1,me}return te===" "&&(M.match(/^ +$/,!1)?y.trailingSpace++:y.trailingSpace&&(y.trailingSpaceNewLine=!0)),b(y)}function d(M,y){var W=M.next();if(W===">"){y.f=y.inline=f,j.highlightFormatting&&(y.formatting="link");var X=b(y);return X?X+=" ":X="",X+H.linkInline}return M.match(/^[^>]+/,!0),H.linkInline}function g(M,y){if(M.eatSpace())return null;var W=M.next();return W==="("||W==="["?(y.f=y.inline=T(W==="("?")":"]"),j.highlightFormatting&&(y.formatting="link-string"),y.linkHref=!0,b(y)):"error"}var E={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function T(M){return function(y,W){var X=y.next();if(X===M){W.f=W.inline=f,j.highlightFormatting&&(W.formatting="link-string");var te=b(W);return W.linkHref=!1,te}return y.match(E[M]),W.linkHref=!0,b(W)}}function F(M,y){return M.match(/^([^\]\\]|\\.)*\]:/,!1)?(y.f=U,M.next(),j.highlightFormatting&&(y.formatting="link"),y.linkText=!0,b(y)):u(M,y,f)}function U(M,y){if(M.match(/^\]:/,!0)){y.f=y.inline=K,j.highlightFormatting&&(y.formatting="link");var W=b(y);return y.linkText=!1,W}return M.match(/^([^\]\\]|\\.)+/,!0),H.linkText}function K(M,y){return M.eatSpace()?null:(M.match(/^[^\s]+/,!0),M.peek()===void 0?y.linkTitle=!0:M.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),y.f=y.inline=f,H.linkHref+" url")}var z={startState:function(){return{f:C,prevLine:{stream:null},thisLine:{stream:null},block:C,htmlState:null,indentation:0,inline:f,text:_,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(M){return{f:M.f,prevLine:M.prevLine,thisLine:M.thisLine,block:M.block,htmlState:M.htmlState&&re.copyState(G,M.htmlState),indentation:M.indentation,localMode:M.localMode,localState:M.localMode?re.copyState(M.localMode,M.localState):null,inline:M.inline,text:M.text,formatting:!1,linkText:M.linkText,linkTitle:M.linkTitle,linkHref:M.linkHref,code:M.code,em:M.em,strong:M.strong,strikethrough:M.strikethrough,emoji:M.emoji,header:M.header,setext:M.setext,hr:M.hr,taskList:M.taskList,list:M.list,listStack:M.listStack.slice(0),quote:M.quote,indentedCode:M.indentedCode,trailingSpace:M.trailingSpace,trailingSpaceNewLine:M.trailingSpaceNewLine,md_inside:M.md_inside,fencedEndRE:M.fencedEndRE}},token:function(M,y){if(y.formatting=!1,M!=y.thisLine.stream){if(y.header=0,y.hr=!1,M.match(/^\s*$/,!0))return w(y),null;if(y.prevLine=y.thisLine,y.thisLine={stream:M},y.taskList=!1,y.trailingSpace=0,y.trailingSpaceNewLine=!1,!y.localState&&(y.f=y.block,y.f!=D)){var W=M.match(/^\s*/,!0)[0].replace(/\t/g,s).length;if(y.indentation=W,y.indentationDiff=null,W>0)return null}}return y.f(M,y)},innerMode:function(M){return M.block==D?{state:M.htmlState,mode:G}:M.localState?{state:M.localState,mode:M.localMode}:{state:M,mode:z}},indent:function(M,y,W){return M.block==D&&G.indent?G.indent(M.htmlState,y,W):M.localState&&M.localMode.indent?M.localMode.indent(M.localState,y,W):re.Pass},blankLine:w,getType:b,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return z},"xml"),re.defineMIME("text/markdown","markdown"),re.defineMIME("text/x-markdown","markdown")})},mgmH:function(Gt,et,k){"use strict";k.d(et,"d",function(){return h}),k.d(et,"b",function(){return r}),k.d(et,"e",function(){return n}),k.d(et,"c",function(){return a}),k.d(et,"n",function(){return l}),k.d(et,"g",function(){return s}),k.d(et,"h",function(){return u}),k.d(et,"j",function(){return R}),k.d(et,"a",function(){return w}),k.d(et,"l",function(){return C}),k.d(et,"f",function(){return D}),k.d(et,"k",function(){return S}),k.d(et,"m",function(){return b}),k.d(et,"i",function(){return _}),k.d(et,"o",function(){return f}),k.d(et,"t",function(){return d}),k.d(et,"s",function(){return g}),k.d(et,"p",function(){return E}),k.d(et,"q",function(){return T}),k.d(et,"r",function(){return F}),k.d(et,"v",function(){return U}),k.d(et,"u",function(){return K});var re=k("miYZ"),Y=k("tsqr"),j=k("k1fw"),G=k("9og8"),L=k("WmNS"),P=k.n(L),H=k("oUNq"),O=k("9kvl"),I=k("1vsH"),x=k("m3rI"),p=function(){Object(O.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u751F\u6210\u6587\u4EF6\uFF0C\u8BF7\u7A0D\u540E..."}})},m=function(){Object(O.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}})},h=function(){var z=Object(G.a)(P.a.mark(function M(y){var W;return P.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return p(),te.next=3,Object(H.t)(Object(j.a)({},y));case 3:if(W=te.sent,!(W.status===0)){te.next=7;break}return te.next=7,Object(I.w)("",Object(I.Y)({url:x.a.API_SERVER+"/api/courses/".concat(y.coursesId,"/export_couser_info.json"),query:y}));case 7:m();case 8:case"end":return te.stop()}},M)}));return function(y){return z.apply(this,arguments)}}(),r=function(){var z=Object(G.a)(P.a.mark(function M(y){var W;return P.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return te.next=2,Object(H.r)(Object(j.a)({},y));case 2:if(W=te.sent,!(W.status===0)){te.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),O.d.push("/classrooms/".concat(y.coursesId,"/exportlist/course_member_act_score")),te.next=13;break;case 8:if(!(W.status===-2)){te.next=12;break}return te.abrupt("return",W);case 12:W.status===-3&&(Object(O.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),O.d.push("/classrooms/".concat(y.coursesId,"/exportlist/course_member_act_score")));case 13:case"end":return te.stop()}},M)}));return function(y){return z.apply(this,arguments)}}(),n=function(){var z=Object(G.a)(P.a.mark(function M(y){var W;return P.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return te.next=2,Object(H.u)(Object(j.a)({},y));case 2:if(W=te.sent,!(W.status===0)){te.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),O.d.push("/classrooms/".concat(y.coursesId,"/exportlist/course_total_score")),te.next=13;break;case 8:if(!(W.status===-2)){te.next=12;break}return te.abrupt("return",W);case 12:W.status===-3&&(Object(O.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),O.d.push("/classrooms/".concat(y.coursesId,"/exportlist/course_total_score")));case 13:case"end":return te.stop()}},M)}));return function(y){return z.apply(this,arguments)}}(),a=function(){var z=Object(G.a)(P.a.mark(function M(y){var W;return P.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return te.next=2,Object(H.s)(Object(j.a)({},y));case 2:if(W=te.sent,!(W.status===0)){te.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),O.d.push("/classrooms/".concat(y.coursesId,"/exportlist/course_total_exercise_and_other")),te.next=13;break;case 8:if(!(W.status===-2)){te.next=12;break}return te.abrupt("return",W);case 12:W.status===-3&&(Object(O.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),O.d.push("/classrooms/".concat(y.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return te.stop()}},M)}));return function(y){return z.apply(this,arguments)}}(),l=function(){var z=Object(G.a)(P.a.mark(function M(y){var W;return P.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return te.next=2,Object(H.z)(Object(j.a)({},y));case 2:if(W=te.sent,!(W.status===0)){te.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),O.d.push("/classrooms/".concat(y.coursesId,"/exportlist/course_total_exercise_and_other")),te.next=13;break;case 8:if(!(W.status===-2)){te.next=12;break}return te.abrupt("return",W);case 12:W.status===-3&&(Object(O.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),O.d.push("/classrooms/".concat(y.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return te.stop()}},M)}));return function(y){return z.apply(this,arguments)}}(),s=function(){var z=Object(G.a)(P.a.mark(function M(y){var W;return P.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return te.next=2,Object(H.v)(Object(j.a)({},y));case 2:if(W=te.sent,!(W.status===0)){te.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),O.d.push("/classrooms/".concat(y.coursesId,"/exportlist/course_total_homework")),te.next=13;break;case 8:if(!(W.status===-2)){te.next=12;break}return te.abrupt("return",W);case 12:W.status===-3&&(Object(O.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),O.d.push("/classrooms/".concat(y.coursesId,"/exportlist/course_total_homework")));case 13:case"end":return te.stop()}},M)}));return function(y){return z.apply(this,arguments)}}(),u=function(){var z=Object(G.a)(P.a.mark(function M(y,W){var X;return P.a.wrap(function(pe){for(;;)switch(pe.prev=pe.next){case 0:return pe.next=2,Object(H.x)(Object(j.a)({},y));case 2:X=pe.sent,X.status===0?(Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),O.d.push("/classrooms/".concat(y.coursesId,"/exportlist/").concat(W))):X.status===-3&&(Object(O.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),O.d.push("/classrooms/".concat(y.coursesId,"/exportlist/").concat(W)));case 4:case"end":return pe.stop()}},M)}));return function(y,W){return z.apply(this,arguments)}}(),c=function(){var z=Object(G.a)(P.a.mark(function M(y){var W;return P.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return p(),te.next=3,Object(H.w)(Object(j.a)({},y));case 3:if(W=te.sent,!(W.status===0)){te.next=7;break}return te.next=7,Object(I.w)("",Object(I.Y)({url:x.a.API_SERVER+"/api/homework_commons/".concat(y.categoryId,"/works_list.zip"),query:y}));case 7:m();case 8:case"end":return te.stop()}},M)}));return function(y){return z.apply(this,arguments)}}(),R=function(){var z=Object(G.a)(P.a.mark(function M(y){var W;return P.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return p(),te.next=3,Object(H.A)(Object(j.a)({},y));case 3:if(W=te.sent,!(W.status===0)){te.next=7;break}return te.next=7,Object(I.w)("",Object(I.Y)({url:x.a.API_SERVER+"/api/polls/".concat(y.categoryId,"/commit_result.xlsx"),query:y}));case 7:m();case 8:case"end":return te.stop()}},M)}));return function(y){return z.apply(this,arguments)}}(),w=function(){var z=Object(G.a)(P.a.mark(function M(y){return P.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(I.v)("",Object(I.Y)({url:x.a.API_SERVER+"/api/courses/".concat(y.coursesId,"/attendances/export_xlsx_data.xlsx"),query:y}));case 2:case"end":return X.stop()}},M)}));return function(y){return z.apply(this,arguments)}}(),C=function(){var z=Object(G.a)(P.a.mark(function M(y){return P.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(I.v)("",Object(I.Y)({url:x.a.API_SERVER+"/api/courses/".concat(y.coursesId,"/video_study_statics.xlsx"),query:y}));case 2:case"end":return X.stop()}},M)}));return function(y){return z.apply(this,arguments)}}(),D=function(){var z=Object(G.a)(P.a.mark(function M(y){return P.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(I.v)("",Object(I.Y)({url:x.a.API_SERVER+"/api/courses/".concat(y.coursesId,"/export_course_students_info.xlsx"),query:y}));case 2:case"end":return X.stop()}},M)}));return function(y){return z.apply(this,arguments)}}(),S=function(){var z=Object(G.a)(P.a.mark(function M(y){return P.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(I.v)("",Object(I.Y)({url:x.a.API_SERVER+"/api/item_banks/export.xlsx",query:y}));case 2:case"end":return X.stop()}},M)}));return function(y){return z.apply(this,arguments)}}(),b=function(){var z=Object(G.a)(P.a.mark(function M(y){return P.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(I.v)("",Object(I.Y)({url:x.a.API_SERVER+"/api/competitions/region_reports.xlsx",query:y}));case 2:case"end":return X.stop()}},M)}));return function(y){return z.apply(this,arguments)}}(),_=function(){var z=Object(G.a)(P.a.mark(function M(y){var W;return P.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return te.next=2,Object(H.y)(Object(j.a)({},y));case 2:W=te.sent,W.status===0?(Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),O.d.push("/classrooms/".concat(y.coursesId,"/exportlist/exercise_score"))):W.status===-3&&(Object(O.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),O.d.push("/classrooms/".concat(y.coursesId,"/exportlist/exercise_score")));case 4:case"end":return te.stop()}},M)}));return function(y){return z.apply(this,arguments)}}(),f=function(){var z=Object(G.a)(P.a.mark(function M(y){return P.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return console.log("----------","\u8C03\u7528\u4E0B\u8F7D"),X.next=3,Object(I.v)("",Object(I.Y)({url:x.a.API_SERVER+"/api/export_records/".concat(y.id,".xlsx"),query:y}));case 3:case"end":return X.stop()}},M)}));return function(y){return z.apply(this,arguments)}}(),d=function(){var z=Object(G.a)(P.a.mark(function M(y){return P.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(I.v)("",Object(I.Y)({url:x.a.API_SERVER+"/api/ec_major_schools/0/ec_years.xlsx",query:y}));case 2:case"end":return X.stop()}},M)}));return function(y){return z.apply(this,arguments)}}(),g=function(){var z=Object(G.a)(P.a.mark(function M(y){return P.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(I.v)("",Object(I.Y)({url:x.a.API_SERVER+"/api/ec_years/".concat(y==null?void 0:y.ec_year_id,"/ec_training_objectives.xlsx"),query:y}));case 2:case"end":return X.stop()}},M)}));return function(y){return z.apply(this,arguments)}}(),E=function(){var z=Object(G.a)(P.a.mark(function M(y){return P.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(I.v)(y==null?void 0:y.name,Object(I.Y)({url:x.a.API_SERVER+"/api/attachments/get_ecs_attachment.docx",query:y}));case 2:case"end":return X.stop()}},M)}));return function(y){return z.apply(this,arguments)}}(),T=function(){var z=Object(G.a)(P.a.mark(function M(y){return P.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(I.v)("",Object(I.Y)({url:x.a.API_SERVER+"/api/ec_years/".concat(y==null?void 0:y.ec_year_id,"/ec_courses.xlsx"),query:y}));case 2:case"end":return X.stop()}},M)}));return function(y){return z.apply(this,arguments)}}(),F=function(){var z=Object(G.a)(P.a.mark(function M(y){return P.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(I.v)("",Object(I.Y)({url:x.a.API_SERVER+"/api/ec_years/".concat(y==null?void 0:y.ec_year_id,"/ec_graduation_requirements.xlsx"),query:y}));case 2:case"end":return X.stop()}},M)}));return function(y){return z.apply(this,arguments)}}(),U=function(){var z=Object(G.a)(P.a.mark(function M(y){return P.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(I.v)("",Object(I.Y)({url:x.a.API_SERVER+"/api/courses/rank_list.xlsx",query:y}));case 2:case"end":return X.stop()}},M)}));return function(y){return z.apply(this,arguments)}}(),K=function(){var z=Object(G.a)(P.a.mark(function M(y){return P.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(I.v)("",Object(I.Y)({url:x.a.API_SERVER+"/api/courses/question_rank_list.xlsx",query:y}));case 2:case"end":return X.stop()}},M)}));return function(y){return z.apply(this,arguments)}}()},n6Qo:function(Gt,et,k){"use strict";k.d(et,"a",function(){return O});var re=k("q1tI"),Y=k("biw7"),j=k("fyJ8");function G(I){var x=I.className,p=I.index,m=I.children,h=I.colSpan,r=I.rowSpan,n=re.useContext(Y.a),a=n.prefixCls,l=n.fixedInfoList,s=l[p];return re.createElement(j.a,Object.assign({className:x,index:p,component:"td",prefixCls:a,record:null,dataIndex:null,render:function(){return{children:m,props:{colSpan:h,rowSpan:r}}}},s))}function L(I){return re.createElement("tr",Object.assign({},I))}function P(I){var x=I.children,p=re.useContext(Y.a),m=p.prefixCls;return re.createElement("tfoot",{className:"".concat(m,"-summary")},x)}var H=et.b=P,O={Cell:G,Row:L}},nqnY:function(Gt,et,k){Gt.exports={flex_box_center:"flex_box_center___37JBt",flex_space_between:"flex_space_between___3r1Lz",flex_box_vertical_center:"flex_box_vertical_center___19lKq",flex_box_center_end:"flex_box_center_end___2LfTp",flex_box_column:"flex_box_column___1ZPkn",top:"top___1rypn",desc:"desc___yUqaB",liked:"liked___17506",likedActive:"likedActive___2w83T",reply:"reply___3RGQi",replyList:"replyList___18BLu",comment:"comment___2nNFC",headpic:"headpic___yXxQj"}},oOBs:function(Gt,et,k){Gt.exports={leftdiv:"leftdiv___1FhsT",listClass:"listClass___1Y2ac",spantitle:"spantitle___1pL39",rightdiv:"rightdiv___3ZICD"}},ogmK:function(Gt,et,k){"use strict";k.d(et,"a",function(){return la});var re=k("1OyB"),Y=k("vuIU"),j=k("Ji7U"),G=k("LK+K"),L=k("rePB"),P=k("VTBJ"),H=k("ODXe"),O=k("q1tI"),I=k("TSYQ"),x=k.n(I),p=k("Kwbf"),m=k("6cGi"),h=k("U8pU"),r=k("4IlW"),n=O.createContext({}),a=n,l={visibility:"hidden"};function s(Q){var ve=Q.prefixCls,Ae=Q.prevIcon,De=Ae===void 0?"\u2039":Ae,at=Q.nextIcon,Be=at===void 0?"\u203A":at,rt=Q.superPrevIcon,ht=rt===void 0?"\xAB":rt,Me=Q.superNextIcon,ft=Me===void 0?"\xBB":Me,Ot=Q.onSuperPrev,Ct=Q.onSuperNext,_t=Q.onPrev,Et=Q.onNext,St=Q.children,Fe=O.useContext(a),At=Fe.hideNextBtn,Zt=Fe.hidePrevBtn;return O.createElement("div",{className:ve},Ot&&O.createElement("button",{type:"button",onClick:Ot,tabIndex:-1,className:"".concat(ve,"-super-prev-btn"),style:Zt?l:{}},ht),_t&&O.createElement("button",{type:"button",onClick:_t,tabIndex:-1,className:"".concat(ve,"-prev-btn"),style:Zt?l:{}},De),O.createElement("div",{className:"".concat(ve,"-view")},St),Et&&O.createElement("button",{type:"button",onClick:Et,tabIndex:-1,className:"".concat(ve,"-next-btn"),style:At?l:{}},Be),Ct&&O.createElement("button",{type:"button",onClick:Ct,tabIndex:-1,className:"".concat(ve,"-super-next-btn"),style:At?l:{}},ft))}var u=s;function c(Q){var ve=O.useContext(a),Ae=ve.hideHeader;if(Ae)return null;var De=Q.prefixCls,at=Q.generateConfig,Be=Q.locale,rt=Q.value,ht=Q.format,Me="".concat(De,"-header");return O.createElement(u,{prefixCls:Me},rt?at.locale.format(Be.locale,rt,ht):"\xA0")}var R=c,w=k("YrtM"),C=k("KQm4"),D=new Map;function S(Q,ve,Ae){if(D.get(Q)&&cancelAnimationFrame(D.get(Q)),Ae<=0){D.set(Q,requestAnimationFrame(function(){Q.scrollTop=ve}));return}var De=ve-Q.scrollTop,at=De/Ae*10;D.set(Q,requestAnimationFrame(function(){Q.scrollTop+=at,Q.scrollTop!==ve&&S(Q,ve,Ae-10)}))}function b(Q,ve){var Ae=ve.onLeftRight,De=ve.onCtrlLeftRight,at=ve.onUpDown,Be=ve.onPageUpDown,rt=ve.onEnter,ht=Q.which,Me=Q.ctrlKey,ft=Q.metaKey;switch(ht){case r.a.LEFT:if(Me||ft){if(De)return De(-1),!0}else if(Ae)return Ae(-1),!0;break;case r.a.RIGHT:if(Me||ft){if(De)return De(1),!0}else if(Ae)return Ae(1),!0;break;case r.a.UP:if(at)return at(-1),!0;break;case r.a.DOWN:if(at)return at(1),!0;break;case r.a.PAGE_UP:if(Be)return Be(-1),!0;break;case r.a.PAGE_DOWN:if(Be)return Be(1),!0;break;case r.a.ENTER:if(rt)return rt(),!0;break}return!1}function _(Q,ve,Ae,De){var at=Q;if(!at)switch(ve){case"time":at=De?"hh:mm:ss a":"HH:mm:ss";break;case"week":at="gggg-wo";break;case"month":at="YYYY-MM";break;case"quarter":at="YYYY-[Q]Q";break;case"year":at="YYYY";break;default:at=Ae?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD"}return at}function f(Q,ve){var Ae=Q==="time"?8:10;return Math.max(Ae,ve.length)+2}var d=null,g=new Set;function E(Q){return!d&&typeof window!="undefined"&&window.addEventListener&&(d=function(Ae){Object(C.a)(g).forEach(function(De){De(Ae)})},window.addEventListener("mousedown",d)),g.add(Q),function(){g.delete(Q),g.size===0&&(window.removeEventListener("mousedown",d),d=null)}}var T=function(ve){return ve==="month"||ve==="date"?"year":ve},F=function(ve){return ve==="date"?"month":ve},U=function(ve){return ve==="month"||ve==="date"?"quarter":ve},K=function(ve){return ve==="date"?"week":ve},z={year:T,month:F,quarter:U,week:K,time:null,date:null};function M(Q,ve){return Q.some(function(Ae){return Ae&&Ae.contains(ve)})}function y(Q){var ve=Q.prefixCls,Ae=Q.units,De=Q.onSelect,at=Q.value,Be=Q.active,rt=Q.hideDisabledOptions,ht="".concat(ve,"-cell"),Me=O.useContext(a),ft=Me.open,Ot=O.useRef(null),Ct=O.useRef(new Map);return O.useLayoutEffect(function(){var _t=Ct.current.get(at);_t&&ft!==!1&&S(Ot.current,_t.offsetTop,120)},[at]),O.useLayoutEffect(function(){if(ft){var _t=Ct.current.get(at);_t&&S(Ot.current,_t.offsetTop,0)}},[ft]),O.createElement("ul",{className:x()("".concat(ve,"-column"),Object(L.a)({},"".concat(ve,"-column-active"),Be)),ref:Ot,style:{position:"relative"}},Ae.map(function(_t){var Et;return rt&&_t.disabled?null:O.createElement("li",{key:_t.value,ref:function(Fe){Ct.current.set(_t.value,Fe)},className:x()(ht,(Et={},Object(L.a)(Et,"".concat(ht,"-disabled"),_t.disabled),Object(L.a)(Et,"".concat(ht,"-selected"),at===_t.value),Et)),onClick:function(){if(_t.disabled)return;De(_t.value)}},O.createElement("div",{className:"".concat(ht,"-inner")},_t.label))}))}var W=y;function X(Q,ve){for(var Ae=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"0",De=String(Q);De.length<ve;)De="".concat(Ae).concat(Q);return De}var te=function(){for(var ve=arguments.length,Ae=new Array(ve),De=0;De<ve;De++)Ae[De]=arguments[De];return Ae};function pe(Q){return Q==null?[]:Array.isArray(Q)?Q:[Q]}function Ie(Q){var ve={};return Object.keys(Q).forEach(function(Ae){(Ae.substr(0,5)==="data-"||Ae.substr(0,5)==="aria-"||Ae==="role"||Ae==="name")&&Ae.substr(0,7)!=="data-__"&&(ve[Ae]=Q[Ae])}),ve}function Ee(Q,ve){return Q?Q[ve]:null}function Te(Q,ve,Ae){var De=[Ee(Q,0),Ee(Q,1)];return De[Ae]=typeof ve=="function"?ve(De[Ae]):ve,!De[0]&&!De[1]?null:De}function We(Q,ve,Ae,De,at){var Be=Q.setHour(ve,Ae);return Be=Q.setMinute(Be,De),Be=Q.setSecond(Be,at),Be}function He(Q,ve,Ae,De,at,Be){var rt=Math.floor(Q/De)*De;if(rt<Q)return[rt,60-at,60-Be];var ht=Math.floor(ve/at)*at;if(ht<ve)return[rt,ht,60-Be];var Me=Math.floor(Ae/Be)*Be;return[rt,ht,Me]}function Ce(Q,ve){if(Q.length!==ve.length)return!0;for(var Ae=0;Ae<Q.length;Ae+=1)if(Q[Ae].disabled!==ve[Ae].disabled)return!0;return!1}function ue(Q,ve,Ae,De){for(var at=[],Be=Q;Be<=ve;Be+=Ae)at.push({label:X(Be,2),value:Be,disabled:(De||[]).includes(Be)});return at}function se(Q){var ve=Q.generateConfig,Ae=Q.prefixCls,De=Q.operationRef,at=Q.activeColumnIndex,Be=Q.value,rt=Q.showHour,ht=Q.showMinute,Me=Q.showSecond,ft=Q.use12Hours,Ot=Q.hourStep,Ct=Ot===void 0?1:Ot,_t=Q.minuteStep,Et=_t===void 0?1:_t,St=Q.secondStep,Fe=St===void 0?1:St,At=Q.disabledHours,Zt=Q.disabledMinutes,sn=Q.disabledSeconds,On=Q.hideDisabledOptions,In=Q.onSelect,Ft=[],$t="".concat(Ae,"-content"),Fn="".concat(Ae,"-time-panel"),Oe,It=Be?ve.getHour(Be):-1,Ut=Be?ve.getMinute(Be):-1,tn=Be?ve.getSecond(Be):-1,un=function(Wt,qt,Dn,bn){var er=Be||ve.getNow(),jr=Math.max(0,qt),br=Math.max(0,Dn),Gr=Math.max(0,bn);return er=We(ve,er,!ft||!Wt?jr:jr+12,br,Gr),er},Sn=ue(0,23,Ct,At&&At()),An=Object(w.a)(function(){return Sn},Sn,Ce);ft&&(Oe=It>=12,It%=12);var $n=O.useMemo(function(){if(!ft)return[!1,!1];var xn=[!0,!0];return An.forEach(function(Wt){var qt=Wt.disabled,Dn=Wt.value;if(qt)return;Dn>=12?xn[1]=!1:xn[0]=!1}),xn},[ft,An]),pr=Object(H.a)($n,2),Tn=pr[0],jn=pr[1],wn=O.useMemo(function(){return ft?An.filter(Oe?function(xn){return xn.value>=12}:function(xn){return xn.value<12}).map(function(xn){var Wt=xn.value%12,qt=Wt===0?"12":X(Wt,2);return Object(P.a)(Object(P.a)({},xn),{},{label:qt,value:Wt})}):An},[ft,An]),fn=ue(0,59,Et,Zt&&Zt(It)),Kn=ue(0,59,Fe,sn&&sn(It,Ut));De.current={onUpDown:function(Wt){var qt=Ft[at];if(qt)for(var Dn=qt.units.findIndex(function(br){return br.value===qt.value}),bn=qt.units.length,er=1;er<bn;er+=1){var jr=qt.units[(Dn+Wt*er+bn)%bn];if(jr.disabled!==!0){qt.onSelect(jr.value);break}}}};function yr(xn,Wt,qt,Dn,bn){xn!==!1&&Ft.push({node:O.cloneElement(Wt,{prefixCls:Fn,value:qt,active:at===Ft.length,onSelect:bn,units:Dn,hideDisabledOptions:On}),onSelect:bn,value:qt,units:Dn})}yr(rt,O.createElement(W,{key:"hour"}),It,wn,function(xn){In(un(Oe,xn,Ut,tn),"mouse")}),yr(ht,O.createElement(W,{key:"minute"}),Ut,fn,function(xn){In(un(Oe,It,xn,tn),"mouse")}),yr(Me,O.createElement(W,{key:"second"}),tn,Kn,function(xn){In(un(Oe,It,Ut,xn),"mouse")});var hr=-1;return typeof Oe=="boolean"&&(hr=Oe?1:0),yr(ft===!0,O.createElement(W,{key:"12hours"}),hr,[{label:"AM",value:0,disabled:Tn},{label:"PM",value:1,disabled:jn}],function(xn){In(un(!!xn,It,Ut,tn),"mouse")}),O.createElement("div",{className:$t},Ft.map(function(xn){var Wt=xn.node;return Wt}))}var we=se,ge=function(ve){return ve.filter(function(Ae){return Ae!==!1}).length};function Ke(Q){var ve=Q.generateConfig,Ae=Q.format,De=Ae===void 0?"HH:mm:ss":Ae,at=Q.prefixCls,Be=Q.active,rt=Q.operationRef,ht=Q.showHour,Me=Q.showMinute,ft=Q.showSecond,Ot=Q.use12Hours,Ct=Ot===void 0?!1:Ot,_t=Q.onSelect,Et=Q.value,St="".concat(at,"-time-panel"),Fe=O.useRef(),At=O.useState(-1),Zt=Object(H.a)(At,2),sn=Zt[0],On=Zt[1],In=ge([ht,Me,ft,Ct]);return rt.current={onKeyDown:function($t){return b($t,{onLeftRight:function(Oe){On((sn+Oe+In)%In)},onUpDown:function(Oe){sn===-1?On(0):Fe.current&&Fe.current.onUpDown(Oe)},onEnter:function(){_t(Et||ve.getNow(),"key"),On(-1)}})},onBlur:function(){On(-1)}},O.createElement("div",{className:x()(St,Object(L.a)({},"".concat(St,"-active"),Be))},O.createElement(R,Object.assign({},Q,{format:De,prefixCls:at})),O.createElement(we,Object.assign({},Q,{prefixCls:at,activeColumnIndex:sn,operationRef:Fe})))}var st=Ke,ne=7;function $(Q,ve){return!Q&&!ve?!0:!Q||!ve?!1:void 0}function J(Q,ve,Ae){var De=$(ve,Ae);if(typeof De=="boolean")return De;var at=Math.floor(Q.getYear(ve)/10),Be=Math.floor(Q.getYear(Ae)/10);return at===Be}function me(Q,ve,Ae){var De=$(ve,Ae);return typeof De=="boolean"?De:Q.getYear(ve)===Q.getYear(Ae)}function xe(Q,ve){var Ae=Math.floor(Q.getMonth(ve)/3);return Ae+1}function ke(Q,ve,Ae){var De=$(ve,Ae);return typeof De=="boolean"?De:me(Q,ve,Ae)&&xe(Q,ve)===xe(Q,Ae)}function $e(Q,ve,Ae){var De=$(ve,Ae);return typeof De=="boolean"?De:me(Q,ve,Ae)&&Q.getMonth(ve)===Q.getMonth(Ae)}function Pt(Q,ve,Ae){var De=$(ve,Ae);return typeof De=="boolean"?De:Q.getYear(ve)===Q.getYear(Ae)&&Q.getMonth(ve)===Q.getMonth(Ae)&&Q.getDate(ve)===Q.getDate(Ae)}function Xt(Q,ve,Ae){var De=$(ve,Ae);return typeof De=="boolean"?De:Q.getHour(ve)===Q.getHour(Ae)&&Q.getMinute(ve)===Q.getMinute(Ae)&&Q.getSecond(ve)===Q.getSecond(Ae)}function Bt(Q,ve,Ae,De){var at=$(Ae,De);return typeof at=="boolean"?at:Q.locale.getWeek(ve,Ae)===Q.locale.getWeek(ve,De)}function lt(Q,ve,Ae){return Pt(Q,ve,Ae)&&Xt(Q,ve,Ae)}function jt(Q,ve,Ae,De){return!ve||!Ae||!De?!1:!Pt(Q,ve,De)&&!Pt(Q,Ae,De)&&Q.isAfter(De,ve)&&Q.isAfter(Ae,De)}function pn(Q,ve,Ae){var De=ve.locale.getWeekFirstDay(Q),at=ve.setDate(Ae,1),Be=ve.getWeekDay(at),rt=ve.addDate(at,De-Be);return ve.getMonth(rt)===ve.getMonth(Ae)&&ve.getDate(rt)>1&&(rt=ve.addDate(rt,-7)),rt}function it(Q,ve,Ae){var De=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;switch(ve){case"year":return Ae.addYear(Q,De*10);case"quarter":case"month":return Ae.addYear(Q,De);default:return Ae.addMonth(Q,De)}}var Ze=O.createContext({}),bt=Ze;function Mt(Q){var ve=Q.cellPrefixCls,Ae=Q.generateConfig,De=Q.rangedValue,at=Q.hoverRangedValue,Be=Q.isInView,rt=Q.isSameCell,ht=Q.offsetCell,Me=Q.today,ft=Q.value;function Ot(Ct){var _t,Et=ht(Ct,-1),St=ht(Ct,1),Fe=Ee(De,0),At=Ee(De,1),Zt=Ee(at,0),sn=Ee(at,1),On=jt(Ae,Zt,sn,Ct);function In(Ut){return rt(Fe,Ut)}function Ft(Ut){return rt(At,Ut)}var $t=rt(Zt,Ct),Fn=rt(sn,Ct),Oe=(On||Fn)&&(!Be(Et)||Ft(Et)),It=(On||$t)&&(!Be(St)||In(St));return _t={},Object(L.a)(_t,"".concat(ve,"-in-view"),Be(Ct)),Object(L.a)(_t,"".concat(ve,"-in-range"),jt(Ae,Fe,At,Ct)),Object(L.a)(_t,"".concat(ve,"-range-start"),In(Ct)),Object(L.a)(_t,"".concat(ve,"-range-end"),Ft(Ct)),Object(L.a)(_t,"".concat(ve,"-range-start-single"),In(Ct)&&!At),Object(L.a)(_t,"".concat(ve,"-range-end-single"),Ft(Ct)&&!Fe),Object(L.a)(_t,"".concat(ve,"-range-start-near-hover"),In(Ct)&&(rt(Et,Zt)||jt(Ae,Zt,sn,Et))),Object(L.a)(_t,"".concat(ve,"-range-end-near-hover"),Ft(Ct)&&(rt(St,sn)||jt(Ae,Zt,sn,St))),Object(L.a)(_t,"".concat(ve,"-range-hover"),On),Object(L.a)(_t,"".concat(ve,"-range-hover-start"),$t),Object(L.a)(_t,"".concat(ve,"-range-hover-end"),Fn),Object(L.a)(_t,"".concat(ve,"-range-hover-edge-start"),Oe),Object(L.a)(_t,"".concat(ve,"-range-hover-edge-end"),It),Object(L.a)(_t,"".concat(ve,"-range-hover-edge-start-near-range"),Oe&&rt(Et,At)),Object(L.a)(_t,"".concat(ve,"-range-hover-edge-end-near-range"),It&&rt(St,Fe)),Object(L.a)(_t,"".concat(ve,"-today"),rt(Me,Ct)),Object(L.a)(_t,"".concat(ve,"-selected"),rt(ft,Ct)),_t}return Ot}function ct(Q){for(var ve=Q.prefixCls,Ae=Q.disabledDate,De=Q.onSelect,at=Q.rowNum,Be=Q.colNum,rt=Q.prefixColumn,ht=Q.rowClassName,Me=Q.baseDate,ft=Q.getCellClassName,Ot=Q.getCellText,Ct=Q.getCellNode,_t=Q.getCellDate,Et=Q.titleCell,St=Q.headerCells,Fe=O.useContext(a),At=Fe.onDateMouseEnter,Zt=Fe.onDateMouseLeave,sn="".concat(ve,"-cell"),On=[],In=0;In<at;In+=1){for(var Ft=[],$t=void 0,Fn=function(Ut){var tn=In*Be+Ut,un=_t(Me,tn),Sn=Ae&&Ae(un);Ut===0&&($t=un,rt&&Ft.push(rt($t))),Ft.push(O.createElement("td",{key:Ut,title:Et&&Et(un),className:x()(sn,Object(P.a)(Object(L.a)({},"".concat(sn,"-disabled"),Sn),ft(un))),onClick:function(){Sn||De(un)},onMouseEnter:function(){!Sn&&At&&At(un)},onMouseLeave:function(){!Sn&&Zt&&Zt(un)}},Ct?Ct(un):O.createElement("div",{className:"".concat(sn,"-inner")},Ot(un))))},Oe=0;Oe<Be;Oe+=1)Fn(Oe);On.push(O.createElement("tr",{key:In,className:ht&&ht($t)},Ft))}return O.createElement("div",{className:"".concat(ve,"-body")},O.createElement("table",{className:"".concat(ve,"-content")},St&&O.createElement("thead",null,O.createElement("tr",null,St)),O.createElement("tbody",null,On)))}function wt(Q){var ve=Q.prefixCls,Ae=Q.generateConfig,De=Q.prefixColumn,at=Q.locale,Be=Q.rowCount,rt=Q.viewDate,ht=Q.value,Me=Q.dateRender,ft=O.useContext(bt),Ot=ft.rangedValue,Ct=ft.hoverRangedValue,_t=pn(at.locale,Ae,rt),Et="".concat(ve,"-cell"),St=Ae.locale.getWeekFirstDay(at.locale),Fe=Ae.getNow(),At=[],Zt=at.shortWeekDays||(Ae.locale.getShortWeekDays?Ae.locale.getShortWeekDays(at.locale):[]);De&&At.push(O.createElement("th",{key:"empty","aria-label":"empty cell"}));for(var sn=0;sn<ne;sn+=1)At.push(O.createElement("th",{key:sn},Zt[(sn+St)%ne]));var On=Mt({cellPrefixCls:Et,today:Fe,value:ht,generateConfig:Ae,rangedValue:De?null:Ot,hoverRangedValue:De?null:Ct,isSameCell:function($t,Fn){return Pt(Ae,$t,Fn)},isInView:function($t){return $e(Ae,$t,rt)},offsetCell:function($t,Fn){return Ae.addDate($t,Fn)}}),In=Me?function(Ft){return Me(Ft,Fe)}:void 0;return O.createElement(ct,Object.assign({},Q,{rowNum:Be,colNum:ne,baseDate:_t,getCellNode:In,getCellText:Ae.getDate,getCellClassName:On,getCellDate:Ae.addDate,titleCell:function($t){return Ae.locale.format(at.locale,$t,"YYYY-MM-DD")},headerCells:At}))}var Ve=wt;function Se(Q){var ve=Q.prefixCls,Ae=Q.generateConfig,De=Q.locale,at=Q.viewDate,Be=Q.onNextMonth,rt=Q.onPrevMonth,ht=Q.onNextYear,Me=Q.onPrevYear,ft=Q.onYearClick,Ot=Q.onMonthClick,Ct=O.useContext(a),_t=Ct.hideHeader;if(_t)return null;var Et="".concat(ve,"-header"),St=De.shortMonths||(Ae.locale.getShortMonths?Ae.locale.getShortMonths(De.locale):[]),Fe=Ae.getMonth(at),At=O.createElement("button",{type:"button",key:"year",onClick:ft,tabIndex:-1,className:"".concat(ve,"-year-btn")},Ae.locale.format(De.locale,at,De.yearFormat)),Zt=O.createElement("button",{type:"button",key:"month",onClick:Ot,tabIndex:-1,className:"".concat(ve,"-month-btn")},De.monthFormat?Ae.locale.format(De.locale,at,De.monthFormat):St[Fe]),sn=De.monthBeforeYear?[Zt,At]:[At,Zt];return O.createElement(u,Object.assign({},Q,{prefixCls:Et,onSuperPrev:Me,onPrev:rt,onNext:Be,onSuperNext:ht}),sn)}var Pe=Se,ce=6;function de(Q){var ve=Q.prefixCls,Ae=Q.panelName,De=Ae===void 0?"date":Ae,at=Q.keyboardConfig,Be=Q.active,rt=Q.operationRef,ht=Q.generateConfig,Me=Q.value,ft=Q.viewDate,Ot=Q.onViewDateChange,Ct=Q.onPanelChange,_t=Q.onSelect,Et="".concat(ve,"-").concat(De,"-panel");rt.current={onKeyDown:function(Zt){return b(Zt,Object(P.a)({onLeftRight:function(On){_t(ht.addDate(Me||ft,On),"key")},onCtrlLeftRight:function(On){_t(ht.addYear(Me||ft,On),"key")},onUpDown:function(On){_t(ht.addDate(Me||ft,On*ne),"key")},onPageUpDown:function(On){_t(ht.addMonth(Me||ft,On),"key")}},at))}};var St=function(Zt){var sn=ht.addYear(ft,Zt);Ot(sn),Ct(null,sn)},Fe=function(Zt){var sn=ht.addMonth(ft,Zt);Ot(sn),Ct(null,sn)};return O.createElement("div",{className:x()(Et,Object(L.a)({},"".concat(Et,"-active"),Be))},O.createElement(Pe,Object.assign({},Q,{prefixCls:ve,value:Me,viewDate:ft,onPrevYear:function(){St(-1)},onNextYear:function(){St(1)},onPrevMonth:function(){Fe(-1)},onNextMonth:function(){Fe(1)},onMonthClick:function(){Ct("month",ft)},onYearClick:function(){Ct("year",ft)}})),O.createElement(Ve,Object.assign({},Q,{onSelect:function(Zt){return _t(Zt,"mouse")},prefixCls:ve,value:Me,viewDate:ft,rowCount:ce})))}var be=de;function je(Q,ve,Ae){if(!Ae)return ve;var De=ve;return De=Q.setHour(De,Q.getHour(Ae)),De=Q.setMinute(De,Q.getMinute(Ae)),De=Q.setSecond(De,Q.getSecond(Ae)),De}var ze=te("date","time");function ut(Q){var ve=Q.prefixCls,Ae=Q.operationRef,De=Q.generateConfig,at=Q.value,Be=Q.defaultValue,rt=Q.disabledTime,ht=Q.showTime,Me=Q.onSelect,ft="".concat(ve,"-datetime-panel"),Ot=O.useState(null),Ct=Object(H.a)(Ot,2),_t=Ct[0],Et=Ct[1],St=O.useRef({}),Fe=O.useRef({}),At=Object(h.a)(ht)==="object"?Object(P.a)({},ht):{};function Zt(Ft){var $t=ze.indexOf(_t)+Ft,Fn=ze[$t]||null;return Fn}var sn=function($t){Fe.current.onBlur&&Fe.current.onBlur($t),Et(null)};Ae.current={onKeyDown:function($t){if($t.which===r.a.TAB){var Fn=Zt($t.shiftKey?-1:1);return Et(Fn),Fn&&$t.preventDefault(),!0}if(_t){var Oe=_t==="date"?St:Fe;return Oe.current&&Oe.current.onKeyDown&&Oe.current.onKeyDown($t),!0}return[r.a.LEFT,r.a.RIGHT,r.a.UP,r.a.DOWN].includes($t.which)?(Et("date"),!0):!1},onBlur:sn,onClose:sn};var On=function($t,Fn){var Oe=$t;Fn==="date"&&!at&&At.defaultValue?(Oe=De.setHour(Oe,De.getHour(At.defaultValue)),Oe=De.setMinute(Oe,De.getMinute(At.defaultValue)),Oe=De.setSecond(Oe,De.getSecond(At.defaultValue))):Fn==="time"&&!at&&Be&&(Oe=De.setYear(Oe,De.getYear(Be)),Oe=De.setMonth(Oe,De.getMonth(Be)),Oe=De.setDate(Oe,De.getDate(Be))),Me&&Me(Oe,"mouse")},In=rt?rt(at||null):{};return O.createElement("div",{className:x()(ft,Object(L.a)({},"".concat(ft,"-active"),_t))},O.createElement(be,Object.assign({},Q,{operationRef:St,active:_t==="date",onSelect:function($t){On(je(De,$t,ht&&Object(h.a)(ht)==="object"?ht.defaultValue:null),"date")}})),O.createElement(st,Object.assign({},Q,{format:void 0},At,In,{defaultValue:void 0,operationRef:Fe,active:_t==="time",onSelect:function($t){On($t,"time")}})))}var Dt=ut;function rn(Q){var ve=Q.prefixCls,Ae=Q.generateConfig,De=Q.locale,at=Q.value,Be="".concat(ve,"-cell"),rt=function(Ot){return O.createElement("td",{key:"week",className:x()(Be,"".concat(Be,"-week"))},Ae.locale.getWeek(De.locale,Ot))},ht="".concat(ve,"-week-panel-row"),Me=function(Ot){return x()(ht,Object(L.a)({},"".concat(ht,"-selected"),Bt(Ae,De.locale,at,Ot)))};return O.createElement(be,Object.assign({},Q,{panelName:"week",prefixColumn:rt,rowClassName:Me,keyboardConfig:{onLeftRight:null}}))}var mn=rn;function gt(Q){var ve=Q.prefixCls,Ae=Q.generateConfig,De=Q.locale,at=Q.viewDate,Be=Q.onNextYear,rt=Q.onPrevYear,ht=Q.onYearClick,Me=O.useContext(a),ft=Me.hideHeader;if(ft)return null;var Ot="".concat(ve,"-header");return O.createElement(u,Object.assign({},Q,{prefixCls:Ot,onSuperPrev:rt,onSuperNext:Be}),O.createElement("button",{type:"button",onClick:ht,className:"".concat(ve,"-year-btn")},Ae.locale.format(De.locale,at,De.yearFormat)))}var Vt=gt,Tt=3,Rt=4;function mt(Q){var ve=Q.prefixCls,Ae=Q.locale,De=Q.value,at=Q.viewDate,Be=Q.generateConfig,rt=Q.monthCellRender,ht=O.useContext(bt),Me=ht.rangedValue,ft=ht.hoverRangedValue,Ot="".concat(ve,"-cell"),Ct=Mt({cellPrefixCls:Ot,value:De,generateConfig:Be,rangedValue:Me,hoverRangedValue:ft,isSameCell:function(At,Zt){return $e(Be,At,Zt)},isInView:function(){return!0},offsetCell:function(At,Zt){return Be.addMonth(At,Zt)}}),_t=Ae.shortMonths||(Be.locale.getShortMonths?Be.locale.getShortMonths(Ae.locale):[]),Et=Be.setMonth(at,0),St=rt?function(Fe){return rt(Fe,Ae)}:void 0;return O.createElement(ct,Object.assign({},Q,{rowNum:Rt,colNum:Tt,baseDate:Et,getCellNode:St,getCellText:function(At){return Ae.monthFormat?Be.locale.format(Ae.locale,At,Ae.monthFormat):_t[Be.getMonth(At)]},getCellClassName:Ct,getCellDate:Be.addMonth,titleCell:function(At){return Be.locale.format(Ae.locale,At,"YYYY-MM")}}))}var _e=mt;function Ge(Q){var ve=Q.prefixCls,Ae=Q.operationRef,De=Q.onViewDateChange,at=Q.generateConfig,Be=Q.value,rt=Q.viewDate,ht=Q.onPanelChange,Me=Q.onSelect,ft="".concat(ve,"-month-panel");Ae.current={onKeyDown:function(_t){return b(_t,{onLeftRight:function(St){Me(at.addMonth(Be||rt,St),"key")},onCtrlLeftRight:function(St){Me(at.addYear(Be||rt,St),"key")},onUpDown:function(St){Me(at.addMonth(Be||rt,St*Tt),"key")},onEnter:function(){ht("date",Be||rt)}})}};var Ot=function(_t){var Et=at.addYear(rt,_t);De(Et),ht(null,Et)};return O.createElement("div",{className:ft},O.createElement(Vt,Object.assign({},Q,{prefixCls:ve,onPrevYear:function(){Ot(-1)},onNextYear:function(){Ot(1)},onYearClick:function(){ht("year",rt)}})),O.createElement(_e,Object.assign({},Q,{prefixCls:ve,onSelect:function(_t){Me(_t,"mouse"),ht("date",_t)}})))}var kt=Ge;function vt(Q){var ve=Q.prefixCls,Ae=Q.generateConfig,De=Q.locale,at=Q.viewDate,Be=Q.onNextYear,rt=Q.onPrevYear,ht=Q.onYearClick,Me=O.useContext(a),ft=Me.hideHeader;if(ft)return null;var Ot="".concat(ve,"-header");return O.createElement(u,Object.assign({},Q,{prefixCls:Ot,onSuperPrev:rt,onSuperNext:Be}),O.createElement("button",{type:"button",onClick:ht,className:"".concat(ve,"-year-btn")},Ae.locale.format(De.locale,at,De.yearFormat)))}var Qt=vt,Jt=4,Le=1;function tt(Q){var ve=Q.prefixCls,Ae=Q.locale,De=Q.value,at=Q.viewDate,Be=Q.generateConfig,rt=O.useContext(bt),ht=rt.rangedValue,Me=rt.hoverRangedValue,ft="".concat(ve,"-cell"),Ot=Mt({cellPrefixCls:ft,value:De,generateConfig:Be,rangedValue:ht,hoverRangedValue:Me,isSameCell:function(Et,St){return ke(Be,Et,St)},isInView:function(){return!0},offsetCell:function(Et,St){return Be.addMonth(Et,St*3)}}),Ct=Be.setDate(Be.setMonth(at,0),1);return O.createElement(ct,Object.assign({},Q,{rowNum:Le,colNum:Jt,baseDate:Ct,getCellText:function(Et){return Be.locale.format(Ae.locale,Et,Ae.quarterFormat||"[Q]Q")},getCellClassName:Ot,getCellDate:function(Et,St){return Be.addMonth(Et,St*3)},titleCell:function(Et){return Be.locale.format(Ae.locale,Et,"YYYY-[Q]Q")}}))}var Lt=tt;function Ht(Q){var ve=Q.prefixCls,Ae=Q.operationRef,De=Q.onViewDateChange,at=Q.generateConfig,Be=Q.value,rt=Q.viewDate,ht=Q.onPanelChange,Me=Q.onSelect,ft="".concat(ve,"-quarter-panel");Ae.current={onKeyDown:function(_t){return b(_t,{onLeftRight:function(St){Me(at.addMonth(Be||rt,St*3),"key")},onCtrlLeftRight:function(St){Me(at.addYear(Be||rt,St),"key")},onUpDown:function(St){Me(at.addYear(Be||rt,St),"key")}})}};var Ot=function(_t){var Et=at.addYear(rt,_t);De(Et),ht(null,Et)};return O.createElement("div",{className:ft},O.createElement(Qt,Object.assign({},Q,{prefixCls:ve,onPrevYear:function(){Ot(-1)},onNextYear:function(){Ot(1)},onYearClick:function(){ht("year",rt)}})),O.createElement(Lt,Object.assign({},Q,{prefixCls:ve,onSelect:function(_t){Me(_t,"mouse")}})))}var ln=Ht;function hn(Q){var ve=Q.prefixCls,Ae=Q.generateConfig,De=Q.viewDate,at=Q.onPrevDecade,Be=Q.onNextDecade,rt=Q.onDecadeClick,ht=O.useContext(a),Me=ht.hideHeader;if(Me)return null;var ft="".concat(ve,"-header"),Ot=Ae.getYear(De),Ct=Math.floor(Ot/tr)*tr,_t=Ct+tr-1;return O.createElement(u,Object.assign({},Q,{prefixCls:ft,onSuperPrev:at,onSuperNext:Be}),O.createElement("button",{type:"button",onClick:rt,className:"".concat(ve,"-decade-btn")},Ct,"-",_t))}var ir=hn,Un=3,dn=4;function fr(Q){var ve=Q.prefixCls,Ae=Q.value,De=Q.viewDate,at=Q.locale,Be=Q.generateConfig,rt=O.useContext(bt),ht=rt.rangedValue,Me=rt.hoverRangedValue,ft="".concat(ve,"-cell"),Ot=Be.getYear(De),Ct=Math.floor(Ot/tr)*tr,_t=Ct+tr-1,Et=Be.setYear(De,Ct-Math.ceil((Un*dn-tr)/2)),St=function(Zt){var sn=Be.getYear(Zt);return Ct<=sn&&sn<=_t},Fe=Mt({cellPrefixCls:ft,value:Ae,generateConfig:Be,rangedValue:ht,hoverRangedValue:Me,isSameCell:function(Zt,sn){return me(Be,Zt,sn)},isInView:St,offsetCell:function(Zt,sn){return Be.addYear(Zt,sn)}});return O.createElement(ct,Object.assign({},Q,{rowNum:dn,colNum:Un,baseDate:Et,getCellText:Be.getYear,getCellClassName:Fe,getCellDate:Be.addYear,titleCell:function(Zt){return Be.locale.format(at.locale,Zt,"YYYY")}}))}var Kr=fr,tr=10;function rr(Q){var ve=Q.prefixCls,Ae=Q.operationRef,De=Q.onViewDateChange,at=Q.generateConfig,Be=Q.value,rt=Q.viewDate,ht=Q.sourceMode,Me=Q.onSelect,ft=Q.onPanelChange,Ot="".concat(ve,"-year-panel");Ae.current={onKeyDown:function(Et){return b(Et,{onLeftRight:function(Fe){Me(at.addYear(Be||rt,Fe),"key")},onCtrlLeftRight:function(Fe){Me(at.addYear(Be||rt,Fe*tr),"key")},onUpDown:function(Fe){Me(at.addYear(Be||rt,Fe*Un),"key")},onEnter:function(){ft(ht==="date"?"date":"month",Be||rt)}})}};var Ct=function(Et){var St=at.addYear(rt,Et*10);De(St),ft(null,St)};return O.createElement("div",{className:Ot},O.createElement(ir,Object.assign({},Q,{prefixCls:ve,onPrevDecade:function(){Ct(-1)},onNextDecade:function(){Ct(1)},onDecadeClick:function(){ft("decade",rt)}})),O.createElement(Kr,Object.assign({},Q,{prefixCls:ve,onSelect:function(Et){ft(ht==="date"?"date":"month",Et),Me(Et,"mouse")}})))}var Nr=rr;function oi(Q){var ve=Q.prefixCls,Ae=Q.generateConfig,De=Q.viewDate,at=Q.onPrevDecades,Be=Q.onNextDecades,rt=O.useContext(a),ht=rt.hideHeader;if(ht)return null;var Me="".concat(ve,"-header"),ft=Ae.getYear(De),Ot=Math.floor(ft/ii)*ii,Ct=Ot+ii-1;return O.createElement(u,Object.assign({},Q,{prefixCls:Me,onSuperPrev:at,onSuperNext:Be}),Ot,"-",Ct)}var hi=oi,an=3,Xn=4;function fi(Q){var ve=ri-1,Ae=Q.prefixCls,De=Q.viewDate,at=Q.generateConfig,Be=Q.disabledDate,rt="".concat(Ae,"-cell"),ht=at.getYear(De),Me=Math.floor(ht/ri)*ri,ft=Math.floor(ht/ii)*ii,Ot=ft+ii-1,Ct=at.setYear(De,ft-Math.ceil((an*Xn*ri-ii)/2)),_t=function(St){var Fe,At=Be&&Be(St),Zt=at.getYear(St),sn=Zt+ve;return Fe={},Object(L.a)(Fe,"".concat(rt,"-disabled"),At),Object(L.a)(Fe,"".concat(rt,"-in-view"),ft<=Zt&&sn<=Ot),Object(L.a)(Fe,"".concat(rt,"-selected"),Zt===Me),Fe};return O.createElement(ct,Object.assign({},Q,{rowNum:Xn,colNum:an,baseDate:Ct,getCellText:function(St){var Fe=at.getYear(St);return"".concat(Fe,"-").concat(Fe+ve)},getCellClassName:_t,getCellDate:function(St,Fe){return at.addYear(St,Fe*ri)}}))}var Ei=fi,ri=10,ii=ri*10;function ee(Q){var ve=Q.prefixCls,Ae=Q.onViewDateChange,De=Q.generateConfig,at=Q.viewDate,Be=Q.operationRef,rt=Q.onSelect,ht=Q.onPanelChange,Me="".concat(ve,"-decade-panel");Be.current={onKeyDown:function(_t){return b(_t,{onLeftRight:function(St){rt(De.addYear(at,St*ri),"key")},onCtrlLeftRight:function(St){rt(De.addYear(at,St*ii),"key")},onUpDown:function(St){rt(De.addYear(at,St*ri*an),"key")},onEnter:function(){ht("year",at)}})}};var ft=function(_t){var Et=De.addYear(at,_t*ii);Ae(Et),ht(null,Et)},Ot=function(_t){rt(_t,"mouse"),ht("year",_t)};return O.createElement("div",{className:Me},O.createElement(hi,Object.assign({},Q,{prefixCls:ve,onPrevDecades:function(){ft(-1)},onNextDecades:function(){ft(1)}})),O.createElement(Ei,Object.assign({},Q,{prefixCls:ve,onSelect:Ot})))}var A=ee;function N(Q,ve,Ae){return Ae?O.createElement("div",{className:"".concat(Q,"-footer-extra")},Ae(ve)):null}function V(Q){var ve=Q.prefixCls,Ae=Q.rangeList,De=Ae===void 0?[]:Ae,at=Q.components,Be=at===void 0?{}:at,rt=Q.needConfirmButton,ht=Q.onNow,Me=Q.onOk,ft=Q.okDisabled,Ot=Q.showNow,Ct=Q.locale,_t,Et;if(De.length){var St=Be.rangeItem||"span";_t=O.createElement(O.Fragment,null,De.map(function(At){var Zt=At.label,sn=At.onClick,On=At.onMouseEnter,In=At.onMouseLeave;return O.createElement("li",{key:Zt,className:"".concat(ve,"-preset")},O.createElement(St,{onClick:sn,onMouseEnter:On,onMouseLeave:In},Zt))}))}if(rt){var Fe=Be.button||"button";ht&&!_t&&Ot!==!1&&(_t=O.createElement("li",{className:"".concat(ve,"-now")},O.createElement("a",{className:"".concat(ve,"-now-btn"),onClick:ht},Ct.now))),Et=rt&&O.createElement("li",{className:"".concat(ve,"-ok")},O.createElement(Fe,{disabled:ft,onClick:Me},Ct.ok))}return!_t&&!Et?null:O.createElement("ul",{className:"".concat(ve,"-ranges")},_t,Et)}function oe(Q){var ve,Ae=Q.prefixCls,De=Ae===void 0?"rc-picker":Ae,at=Q.className,Be=Q.style,rt=Q.locale,ht=Q.generateConfig,Me=Q.value,ft=Q.defaultValue,Ot=Q.pickerValue,Ct=Q.defaultPickerValue,_t=Q.disabledDate,Et=Q.mode,St=Q.picker,Fe=St===void 0?"date":St,At=Q.tabIndex,Zt=At===void 0?0:At,sn=Q.showNow,On=Q.showTime,In=Q.showToday,Ft=Q.renderExtraFooter,$t=Q.hideHeader,Fn=Q.onSelect,Oe=Q.onChange,It=Q.onPanelChange,Ut=Q.onMouseDown,tn=Q.onPickerValueChange,un=Q.onOk,Sn=Q.components,An=Q.direction,$n=Q.hourStep,pr=$n===void 0?1:$n,Tn=Q.minuteStep,jn=Tn===void 0?1:Tn,wn=Q.secondStep,fn=wn===void 0?1:wn,Kn=Fe==="date"&&!!On||Fe==="time",yr=24%pr===0,hr=60%jn===0,xn=60%fn===0,Wt=O.useContext(a),qt=Wt.operationRef,Dn=Wt.panelRef,bn=Wt.onSelect,er=Wt.hideRanges,jr=Wt.defaultOpenValue,br=O.useContext(bt),Gr=br.inRange,Hr=br.panelPosition,mr=br.rangedValue,Rn=br.hoverRangedValue,Tr=O.useRef({}),kr=O.useRef(!0),mi=Object(m.a)(null,{value:Me,defaultValue:ft,postState:function(on){return!on&&jr&&Fe==="time"?jr:on}}),Vr=Object(H.a)(mi,2),Cr=Vr[0],Fr=Vr[1],ti=Object(m.a)(null,{value:Ot,defaultValue:Ct||Cr,postState:function(on){return on||ht.getNow()}}),Re=Object(H.a)(ti,2),qe=Re[0],ot=Re[1],Ne=function(on){ot(on),tn&&tn(on)},le=function(on){var vn=z[Fe];return vn?vn(on):on},ye=Object(m.a)(function(){return Fe==="time"?"time":le("date")},{value:Et}),fe=Object(H.a)(ye,2),Ue=fe[0],Ye=fe[1];O.useEffect(function(){Ye(Fe)},[Fe]);var dt=O.useState(function(){return Ue}),Qe=Object(H.a)(dt,2),pt=Qe[0],Nt=Qe[1],zt=function(on,vn){var dr=le(on||Ue);Nt(Ue),Ye(dr),It&&(Ue!==dr||lt(ht,qe,qe))&&It(vn,dr)},nn=function(on,vn){var dr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;(Ue===Fe||dr)&&(Fr(on),Fn&&Fn(on),bn&&bn(on,vn),Oe&&!lt(ht,on,Cr)&&Oe(on))},_n=function(on){return Tr.current&&Tr.current.onKeyDown?([r.a.LEFT,r.a.RIGHT,r.a.UP,r.a.DOWN,r.a.PAGE_UP,r.a.PAGE_DOWN,r.a.ENTER].includes(on.which)&&on.preventDefault(),Tr.current.onKeyDown(on)):(Object(p.a)(!1,"Panel not correct handle keyDown event. Please help to fire issue about this."),!1)},Pn=function(on){Tr.current&&Tr.current.onBlur&&Tr.current.onBlur(on)};qt&&Hr!=="right"&&(qt.current={onKeyDown:_n,onClose:function(){Tr.current&&Tr.current.onClose&&Tr.current.onClose()}}),O.useEffect(function(){Me&&!kr.current&&ot(Me)},[Me]),O.useEffect(function(){kr.current=!1},[]);var Zn,qn=Object(P.a)(Object(P.a)({},Q),{},{operationRef:Tr,prefixCls:De,viewDate:qe,value:Cr,onViewDateChange:Ne,sourceMode:pt,onPanelChange:zt,disabledDate:Ue!=="decade"?_t:void 0});delete qn.onChange,delete qn.onSelect;switch(Ue){case"decade":Zn=O.createElement(A,Object.assign({},qn,{onSelect:function(on,vn){Ne(on),nn(on,vn)}}));break;case"year":Zn=O.createElement(Nr,Object.assign({},qn,{onSelect:function(on,vn){Ne(on),nn(on,vn)}}));break;case"month":Zn=O.createElement(kt,Object.assign({},qn,{onSelect:function(on,vn){Ne(on),nn(on,vn)}}));break;case"quarter":Zn=O.createElement(ln,Object.assign({},qn,{onSelect:function(on,vn){Ne(on),nn(on,vn)}}));break;case"week":Zn=O.createElement(mn,Object.assign({},qn,{onSelect:function(on,vn){Ne(on),nn(on,vn)}}));break;case"time":delete qn.showTime,Zn=O.createElement(st,Object.assign({},qn,Object(h.a)(On)==="object"?On:null,{onSelect:function(on,vn){Ne(on),nn(on,vn)}}));break;default:On?Zn=O.createElement(Dt,Object.assign({},qn,{onSelect:function(on,vn){Ne(on),nn(on,vn)}})):Zn=O.createElement(be,Object.assign({},qn,{onSelect:function(on,vn){Ne(on),nn(on,vn)}}))}var cr,lr,ur=function(){var on=ht.getNow(),vn=He(ht.getHour(on),ht.getMinute(on),ht.getSecond(on),yr?pr:1,hr?jn:1,xn?fn:1),dr=We(ht,on,vn[0],vn[1],vn[2]);nn(dr,"submit")};er||(cr=N(De,Ue,Ft),lr=V({prefixCls:De,components:Sn,needConfirmButton:Kn,okDisabled:!Cr||_t&&_t(Cr),locale:rt,showNow:sn,onNow:Kn&&ur,onOk:function(){Cr&&(nn(Cr,"submit",!0),un&&un(Cr))}}));var gr;if(In&&Ue==="date"&&Fe==="date"&&!On){var Er=ht.getNow(),Vn="".concat(De,"-today-btn"),Pr=_t&&_t(Er);gr=O.createElement("a",{className:x()(Vn,Pr&&"".concat(Vn,"-disabled")),"aria-disabled":Pr,onClick:function(){Pr||nn(Er,"mouse",!0)}},rt.today)}return O.createElement(a.Provider,{value:Object(P.a)(Object(P.a)({},Wt),{},{hideHeader:"hideHeader"in Q?$t:Wt.hideHeader,hidePrevBtn:Gr&&Hr==="right",hideNextBtn:Gr&&Hr==="left"})},O.createElement("div",{tabIndex:Zt,className:x()("".concat(De,"-panel"),at,(ve={},Object(L.a)(ve,"".concat(De,"-panel-has-range"),mr&&mr[0]&&mr[1]),Object(L.a)(ve,"".concat(De,"-panel-has-range-hover"),Rn&&Rn[0]&&Rn[1]),Object(L.a)(ve,"".concat(De,"-panel-rtl"),An==="rtl"),ve)),style:Be,onKeyDown:_n,onBlur:Pn,onMouseDown:Ut,ref:Dn},Zn,cr||lr||gr?O.createElement("div",{className:"".concat(De,"-footer")},cr,lr,gr):null))}var q=oe,Je=k("uciX"),Kt={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 gn(Q){var ve,Ae=Q.prefixCls,De=Q.popupElement,at=Q.popupStyle,Be=Q.visible,rt=Q.dropdownClassName,ht=Q.dropdownAlign,Me=Q.transitionName,ft=Q.getPopupContainer,Ot=Q.children,Ct=Q.range,_t=Q.popupPlacement,Et=Q.direction,St="".concat(Ae,"-dropdown"),Fe=function(){return _t!==void 0?_t:Et==="rtl"?"bottomRight":"bottomLeft"};return O.createElement(Je.a,{showAction:[],hideAction:[],popupPlacement:Fe(),builtinPlacements:Kt,prefixCls:St,popupTransitionName:Me,popup:De,popupAlign:ht,popupVisible:Be,popupClassName:x()(rt,(ve={},Object(L.a)(ve,"".concat(St,"-range"),Ct),Object(L.a)(ve,"".concat(St,"-rtl"),Et==="rtl"),ve)),popupStyle:at,getPopupContainer:ft},Ot)}var Bn=gn;function en(Q){var ve=Q.open,Ae=Q.value,De=Q.isClickOutside,at=Q.triggerOpen,Be=Q.forwardKeyDown,rt=Q.blurToCancel,ht=Q.onSubmit,Me=Q.onCancel,ft=Q.onFocus,Ot=Q.onBlur,Ct=Object(O.useState)(!1),_t=Object(H.a)(Ct,2),Et=_t[0],St=_t[1],Fe=Object(O.useState)(!1),At=Object(H.a)(Fe,2),Zt=At[0],sn=At[1],On=Object(O.useRef)(!1),In=Object(O.useRef)(!1),Ft={onMouseDown:function(){St(!0),at(!0)},onKeyDown:function(Fn){switch(Fn.which){case r.a.ENTER:{ve?ht()!==!1&&St(!0):at(!0),Fn.preventDefault();return}case r.a.TAB:{Et&&ve&&!Fn.shiftKey?(St(!1),Fn.preventDefault()):!Et&&ve&&(!Be(Fn)&&Fn.shiftKey&&(St(!0),Fn.preventDefault()));return}case r.a.ESC:{St(!0),Me();return}}!ve&&![r.a.SHIFT].includes(Fn.which)?at(!0):Et||Be(Fn)},onFocus:function(Fn){St(!0),sn(!0),ft&&ft(Fn)},onBlur:function(Fn){if(On.current||!De(document.activeElement)){On.current=!1;return}rt?setTimeout(function(){De(document.activeElement)&&Me()},0):ve&&(at(!1),In.current&&ht()),sn(!1),Ot&&Ot(Fn)}};return Object(O.useEffect)(function(){In.current=!1},[ve]),Object(O.useEffect)(function(){In.current=!0},[Ae]),Object(O.useEffect)(function(){return E(function($t){var Fn=$t.target;ve&&(De(Fn)?Zt||at(!1):(On.current=!0,requestAnimationFrame(function(){On.current=!1})))})}),[Ft,{focused:Zt,typing:Et}]}function Gn(Q){var ve=Q.valueTexts,Ae=Q.onTextChange,De=O.useState(""),at=Object(H.a)(De,2),Be=at[0],rt=at[1],ht=O.useRef([]);ht.current=ve;function Me(Ot){rt(Ot),Ae(Ot)}function ft(){rt(ht.current[0])}return O.useEffect(function(){ve.every(function(Ot){return Ot!==Be})&&ft()},[ve.join("||")]),[Be,Me,ft]}var ar=k("Gytx"),Ur=k.n(ar);function si(Q,ve){var Ae=ve.formatList,De=ve.generateConfig,at=ve.locale;return Object(w.a)(function(){if(!Q)return[[""],""];for(var Be="",rt=[],ht=0;ht<Ae.length;ht+=1){var Me=Ae[ht],ft=De.locale.format(at.locale,Q,Me);rt.push(ft),ht===0&&(Be=ft)}return[rt,Be]},[Q,Ae],function(Be,rt){return Be[0]!==rt[0]||!Ur()(Be[1],rt[1])})}function Jr(Q,ve){var Ae=ve.formatList,De=ve.generateConfig,at=ve.locale,Be=Object(O.useState)(null),rt=Object(H.a)(Be,2),ht=rt[0],Me=rt[1],ft=Object(O.useRef)(null);function Ot(At){var Zt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(cancelAnimationFrame(ft.current),Zt){Me(At);return}ft.current=requestAnimationFrame(function(){Me(At)})}var Ct=si(ht,{formatList:Ae,generateConfig:De,locale:at}),_t=Object(H.a)(Ct,2),Et=_t[1];function St(At){Ot(At)}function Fe(){var At=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;Ot(null,At)}return Object(O.useEffect)(function(){Fe(!0)},[Q]),Object(O.useEffect)(function(){return function(){return cancelAnimationFrame(ft.current)}},[]),[Et,St,Fe]}function qr(Q){var ve,Ae=Q.prefixCls,De=Ae===void 0?"rc-picker":Ae,at=Q.id,Be=Q.tabIndex,rt=Q.style,ht=Q.className,Me=Q.dropdownClassName,ft=Q.dropdownAlign,Ot=Q.popupStyle,Ct=Q.transitionName,_t=Q.generateConfig,Et=Q.locale,St=Q.inputReadOnly,Fe=Q.allowClear,At=Q.autoFocus,Zt=Q.showTime,sn=Q.picker,On=sn===void 0?"date":sn,In=Q.format,Ft=Q.use12Hours,$t=Q.value,Fn=Q.defaultValue,Oe=Q.open,It=Q.defaultOpen,Ut=Q.defaultOpenValue,tn=Q.suffixIcon,un=Q.clearIcon,Sn=Q.disabled,An=Q.disabledDate,$n=Q.placeholder,pr=Q.getPopupContainer,Tn=Q.pickerRef,jn=Q.panelRender,wn=Q.onChange,fn=Q.onOpenChange,Kn=Q.onFocus,yr=Q.onBlur,hr=Q.onMouseDown,xn=Q.onMouseUp,Wt=Q.onMouseEnter,qt=Q.onMouseLeave,Dn=Q.onContextMenu,bn=Q.onClick,er=Q.direction,jr=Q.autoComplete,br=jr===void 0?"off":jr,Gr=O.useRef(null),Hr=On==="date"&&!!Zt||On==="time",mr=pe(_(In,On,Zt,Ft)),Rn=O.useRef(null),Tr=O.useRef(null),kr=Object(m.a)(null,{value:$t,defaultValue:Fn}),mi=Object(H.a)(kr,2),Vr=mi[0],Cr=mi[1],Fr=O.useState(Vr),ti=Object(H.a)(Fr,2),Re=ti[0],qe=ti[1],ot=O.useRef(null),Ne=Object(m.a)(!1,{value:Oe,defaultValue:It,postState:function(nr){return Sn?!1:nr},onChange:function(nr){fn&&fn(nr),!nr&&ot.current&&ot.current.onClose&&ot.current.onClose()}}),le=Object(H.a)(Ne,2),ye=le[0],fe=le[1],Ue=si(Re,{formatList:mr,generateConfig:_t,locale:Et}),Ye=Object(H.a)(Ue,2),dt=Ye[0],Qe=Ye[1],pt=Gn({valueTexts:dt,onTextChange:function(nr){var li=_t.locale.parse(Et.locale,nr,mr);li&&(!An||!An(li))&&qe(li)}}),Nt=Object(H.a)(pt,3),zt=Nt[0],nn=Nt[1],_n=Nt[2],Pn=function(nr){qe(nr),Cr(nr),wn&&!lt(_t,Vr,nr)&&wn(nr,nr?_t.locale.format(Et.locale,nr,mr[0]):"")},Zn=function(nr){if(Sn&&nr)return;fe(nr)},qn=function(nr){return ye&&ot.current&&ot.current.onKeyDown?ot.current.onKeyDown(nr):(Object(p.a)(!1,"Picker not correct forward KeyDown operation. Please help to fire issue about this."),!1)},cr=function(){xn&&xn.apply(void 0,arguments),Gr.current&&(Gr.current.focus(),Zn(!0))},lr=en({blurToCancel:Hr,open:ye,value:zt,triggerOpen:Zn,forwardKeyDown:qn,isClickOutside:function(nr){return!M([Rn.current,Tr.current],nr)},onSubmit:function(){return An&&An(Re)?!1:(Pn(Re),Zn(!1),_n(),!0)},onCancel:function(){Zn(!1),qe(Vr),_n()},onFocus:Kn,onBlur:yr}),ur=Object(H.a)(lr,2),gr=ur[0],Er=ur[1],Vn=Er.focused,Pr=Er.typing;O.useEffect(function(){ye||(qe(Vr),!dt.length||dt[0]===""?nn(""):Qe!==zt&&_n())},[ye,dt]),O.useEffect(function(){ye||_n()},[On]),O.useEffect(function(){qe(Vr)},[Vr]),Tn&&(Tn.current={focus:function(){Gr.current&&Gr.current.focus()},blur:function(){Gr.current&&Gr.current.blur()}});var Qn=Object(P.a)(Object(P.a)({},Q),{},{className:void 0,style:void 0,pickerValue:void 0,onPickerValueChange:void 0}),on=O.createElement(q,Object.assign({},Qn,{generateConfig:_t,className:x()(Object(L.a)({},"".concat(De,"-panel-focused"),!Pr)),value:Re,locale:Et,tabIndex:-1,onChange:qe,direction:er}));jn&&(on=jn(on));var vn=O.createElement("div",{className:"".concat(De,"-panel-container"),onMouseDown:function(nr){nr.preventDefault()}},on),dr;tn&&(dr=O.createElement("span",{className:"".concat(De,"-suffix")},tn));var wr;Fe&&Vr&&!Sn&&(wr=O.createElement("span",{onMouseDown:function(nr){nr.preventDefault(),nr.stopPropagation()},onMouseUp:function(nr){nr.preventDefault(),nr.stopPropagation(),Pn(null),Zn(!1)},className:"".concat(De,"-clear")},un||O.createElement("span",{className:"".concat(De,"-clear-btn")})));var Wn=function(nr,li){(li==="submit"||li!=="key"&&!Hr)&&(Pn(nr),Zn(!1))},xr=er==="rtl"?"bottomRight":"bottomLeft",Yr=Jr(zt,{formatList:mr,generateConfig:_t,locale:Et}),Sr=Object(H.a)(Yr,3),Wr=Sr[0],Rr=Sr[1],Ar=Sr[2];return O.createElement(a.Provider,{value:{operationRef:ot,hideHeader:On==="time",panelRef:Rn,onSelect:Wn,open:ye,defaultOpenValue:Ut,onDateMouseEnter:Rr,onDateMouseLeave:Ar}},O.createElement(Bn,{visible:ye,popupElement:vn,popupStyle:Ot,prefixCls:De,dropdownClassName:Me,dropdownAlign:ft,getPopupContainer:pr,transitionName:Ct,popupPlacement:xr,direction:er},O.createElement("div",{className:x()(De,ht,(ve={},Object(L.a)(ve,"".concat(De,"-disabled"),Sn),Object(L.a)(ve,"".concat(De,"-focused"),Vn),Object(L.a)(ve,"".concat(De,"-rtl"),er==="rtl"),ve)),style:rt,onMouseDown:hr,onMouseUp:cr,onMouseEnter:Wt,onMouseLeave:qt,onContextMenu:Dn,onClick:bn},O.createElement("div",{className:x()("".concat(De,"-input"),Object(L.a)({},"".concat(De,"-input-placeholder"),!!Wr)),ref:Tr},O.createElement("input",Object.assign({id:at,tabIndex:Be,disabled:Sn,readOnly:St||!Pr,value:Wr||zt,onChange:function(nr){nn(nr.target.value)},autoFocus:At,placeholder:$n,ref:Gr,title:zt},gr,{size:f(On,mr[0])},Ie(Q),{autoComplete:br})),dr,wr))))}var Ni=function(Q){Object(j.a)(Ae,Q);var ve=Object(G.a)(Ae);function Ae(){var De;return Object(re.a)(this,Ae),De=ve.apply(this,arguments),De.pickerRef=O.createRef(),De.focus=function(){De.pickerRef.current&&De.pickerRef.current.focus()},De.blur=function(){De.pickerRef.current&&De.pickerRef.current.blur()},De}return Object(Y.a)(Ae,[{key:"render",value:function(){return O.createElement(qr,Object.assign({},this.props,{pickerRef:this.pickerRef}))}}]),Ae}(O.Component),Qi=Ni;function ai(Q,ve,Ae){var De=Q.picker,at=Q.locale,Be=Q.selectedValue,rt=Q.disabledDate,ht=Q.disabled,Me=Q.generateConfig,ft=Ee(Be,0),Ot=Ee(Be,1);function Ct(At){var Zt=Me.getYear(At),sn=Me.locale.getWeek(at.locale,At);return Zt*100+sn}function _t(At){var Zt=Me.getYear(At),sn=Me.getMonth(At);return Zt*100+sn}function Et(At){var Zt=Me.getYear(At),sn=xe(Me,At);return Zt*10+sn}var St=O.useCallback(function(At){if(rt&&rt(At))return!0;if(ht[1]&&Ot)return!Pt(Me,At,Ot)&&Me.isAfter(At,Ot);if(ve&&Ot)switch(De){case"quarter":return Et(At)>Et(Ot);case"month":return _t(At)>_t(Ot);case"week":return Ct(At)>Ct(Ot);default:return!Pt(Me,At,Ot)&&Me.isAfter(At,Ot)}return!1},[rt,ht[1],Ot,ve]),Fe=O.useCallback(function(At){if(rt&&rt(At))return!0;if(ht[0]&&ft)return!Pt(Me,At,Ot)&&Me.isAfter(ft,At);if(Ae&&ft)switch(De){case"quarter":return Et(At)<Et(ft);case"month":return _t(At)<_t(ft);case"week":return Ct(At)<Ct(ft);default:return!Pt(Me,At,ft)&&Me.isAfter(ft,At)}return!1},[rt,ht[0],ft,Ae]);return[St,Fe]}function Ri(Q,ve,Ae,De){var at=it(Q,Ae,De,1);function Be(rt){return rt(Q,ve)?"same":rt(at,ve)?"closing":"far"}switch(Ae){case"year":return Be(function(rt,ht){return J(De,rt,ht)});case"quarter":case"month":return Be(function(rt,ht){return me(De,rt,ht)});default:return Be(function(rt,ht){return $e(De,rt,ht)})}}function Vi(Q,ve,Ae,De){var at=Ee(Q,0),Be=Ee(Q,1);if(ve===0)return at;if(at&&Be){var rt=Ri(at,Be,Ae,De);switch(rt){case"same":return at;case"closing":return at;default:return it(Be,Ae,De,-1)}}return at}function Ui(Q){var ve=Q.values,Ae=Q.picker,De=Q.defaultDates,at=Q.generateConfig,Be=O.useState(function(){return[Ee(De,0),Ee(De,1)]}),rt=Object(H.a)(Be,2),ht=rt[0],Me=rt[1],ft=O.useState(null),Ot=Object(H.a)(ft,2),Ct=Ot[0],_t=Ot[1],Et=Ee(ve,0),St=Ee(ve,1);function Fe(Zt){return ht[Zt]?ht[Zt]:Ee(Ct,Zt)||Vi(ve,Zt,Ae,at)||Et||St||at.getNow()}function At(Zt,sn){if(Zt){var On=Te(Ct,Zt,sn);Me(Te(ht,null,sn)||[null,null]);var In=(sn+1)%2;Ee(ve,In)||(On=Te(On,Zt,In)),_t(On)}else(Et||St)&&_t(null)}return[Fe,At]}function pi(Q,ve){return Q&&Q[0]&&Q[1]&&ve.isAfter(Q[0],Q[1])?[Q[1],Q[0]]:Q}function Ji(Q,ve,Ae,De){return Q||De&&De[ve]?!0:!!Ae[(ve+1)%2]}function Mi(Q){var ve,Ae,De,at=Q.prefixCls,Be=at===void 0?"rc-picker":at,rt=Q.id,ht=Q.style,Me=Q.className,ft=Q.popupStyle,Ot=Q.dropdownClassName,Ct=Q.transitionName,_t=Q.dropdownAlign,Et=Q.getPopupContainer,St=Q.generateConfig,Fe=Q.locale,At=Q.placeholder,Zt=Q.autoFocus,sn=Q.disabled,On=Q.format,In=Q.picker,Ft=In===void 0?"date":In,$t=Q.showTime,Fn=Q.use12Hours,Oe=Q.separator,It=Oe===void 0?"~":Oe,Ut=Q.value,tn=Q.defaultValue,un=Q.defaultPickerValue,Sn=Q.open,An=Q.defaultOpen,$n=Q.disabledDate,pr=Q.disabledTime,Tn=Q.dateRender,jn=Q.panelRender,wn=Q.ranges,fn=Q.allowEmpty,Kn=Q.allowClear,yr=Q.suffixIcon,hr=Q.clearIcon,xn=Q.pickerRef,Wt=Q.inputReadOnly,qt=Q.mode,Dn=Q.renderExtraFooter,bn=Q.onChange,er=Q.onOpenChange,jr=Q.onPanelChange,br=Q.onCalendarChange,Gr=Q.onFocus,Hr=Q.onBlur,mr=Q.onOk,Rn=Q.components,Tr=Q.order,kr=Q.direction,mi=Q.activePickerIndex,Vr=Q.autoComplete,Cr=Vr===void 0?"off":Vr,Fr=Ft==="date"&&!!$t||Ft==="time",ti=Object(O.useRef)({}),Re=Object(O.useRef)(null),qe=Object(O.useRef)(null),ot=Object(O.useRef)(null),Ne=Object(O.useRef)(null),le=Object(O.useRef)(null),ye=Object(O.useRef)(null),fe=Object(O.useRef)(null),Ue=pe(_(On,Ft,$t,Fn)),Ye=Object(m.a)(0,{value:mi}),dt=Object(H.a)(Ye,2),Qe=dt[0],pt=dt[1],Nt=Object(O.useRef)(null),zt=O.useMemo(function(){return Array.isArray(sn)?sn:[sn||!1,sn||!1]},[sn]),nn=Object(m.a)(null,{value:Ut,defaultValue:tn,postState:function(kn){return Ft==="time"&&!Tr?kn:pi(kn,St)}}),_n=Object(H.a)(nn,2),Pn=_n[0],Zn=_n[1],qn=Ui({values:Pn,picker:Ft,defaultDates:un,generateConfig:St}),cr=Object(H.a)(qn,2),lr=cr[0],ur=cr[1],gr=Object(m.a)(Pn,{postState:function(kn){var Jn=kn;if(zt[0]&&zt[1])return Jn;for(var Dr=0;Dr<2;Dr+=1)zt[Dr]&&!Ee(Jn,Dr)&&!Ee(fn,Dr)&&(Jn=Te(Jn,St.getNow(),Dr));return Jn}}),Er=Object(H.a)(gr,2),Vn=Er[0],Pr=Er[1],Qn=Object(m.a)([Ft,Ft],{value:qt}),on=Object(H.a)(Qn,2),vn=on[0],dr=on[1];Object(O.useEffect)(function(){dr([Ft,Ft])},[Ft]);var wr=function(kn,Jn){dr(kn),jr&&jr(Jn,kn)},Wn=ai({picker:Ft,selectedValue:Vn,locale:Fe,disabled:zt,disabledDate:$n,generateConfig:St},ti.current[1],ti.current[0]),xr=Object(H.a)(Wn,2),Yr=xr[0],Sr=xr[1],Wr=Object(m.a)(!1,{value:Sn,defaultValue:An,postState:function(kn){return zt[Qe]?!1:kn},onChange:function(kn){er&&er(kn),!kn&&Nt.current&&Nt.current.onClose&&Nt.current.onClose()}}),Rr=Object(H.a)(Wr,2),Ar=Rr[0],Or=Rr[1],nr=Ar&&Qe===0,li=Ar&&Qe===1,Yi=Object(O.useState)(0),wi=Object(H.a)(Yi,2),gi=wi[0],ei=wi[1];Object(O.useEffect)(function(){!Ar&&Re.current&&ei(Re.current.offsetWidth)},[Ar]);var Xr=O.useRef();function En(_r,kn){if(_r)clearTimeout(Xr.current),ti.current[kn]=!0,pt(kn),Or(_r),Ar||ur(null,kn);else if(Qe===kn){Or(_r);var Jn=ti.current;Xr.current=setTimeout(function(){Jn===ti.current&&(ti.current={})})}}function yn(_r){En(!0,_r),setTimeout(function(){var kn=[ye,fe][_r];kn.current&&kn.current.focus()},0)}function zn(_r,kn){var Jn=_r,Dr=Ee(Jn,0),ui=Ee(Jn,1);Dr&&ui&&St.isAfter(Dr,ui)&&(Ft==="week"&&!Bt(St,Fe.locale,Dr,ui)||Ft==="quarter"&&!ke(St,Dr,ui)||Ft!=="week"&&Ft!=="quarter"&&Ft!=="time"&&!Pt(St,Dr,ui)?(kn===0?(Jn=[Dr,null],ui=null):(Dr=null,Jn=[null,ui]),ti.current=Object(L.a)({},kn,!0)):(Ft!=="time"||Tr!==!1)&&(Jn=pi(Jn,St))),Pr(Jn);var ga=Jn&&Jn[0]?St.locale.format(Fe.locale,Jn[0],Ue[0]):"",oa=Jn&&Jn[1]?St.locale.format(Fe.locale,Jn[1],Ue[0]):"";if(br){var Di={range:kn===0?"start":"end"};br(Jn,[ga,oa],Di)}var Zi=Ji(Dr,0,zt,fn),va=Ji(ui,1,zt,fn),Wa=Jn===null||Zi&&va;Wa&&(Zn(Jn),bn&&(!lt(St,Ee(Pn,0),Dr)||!lt(St,Ee(Pn,1),ui))&&bn(Jn,[ga,oa]));var Oi=null;kn===0&&!zt[1]?Oi=1:kn===1&&!zt[0]&&(Oi=0),Oi!==null&&Oi!==Qe&&(!ti.current[Oi]||!Ee(Jn,Oi))&&Ee(Jn,kn)?yn(Oi):En(!1,kn)}var Br=function(kn){return Ar&&Nt.current&&Nt.current.onKeyDown?Nt.current.onKeyDown(kn):(Object(p.a)(!1,"Picker not correct forward KeyDown operation. Please help to fire issue about this."),!1)},or={formatList:Ue,generateConfig:St,locale:Fe},Lr=si(Ee(Vn,0),or),ji=Object(H.a)(Lr,2),Fi=ji[0],$r=ji[1],Zr=si(Ee(Vn,1),or),xi=Object(H.a)(Zr,2),Ma=xi[0],no=xi[1],ua=function(kn,Jn){var Dr=St.locale.parse(Fe.locale,kn,Ue),ui=Jn===0?Yr:Sr;Dr&&!ui(Dr)&&(Pr(Te(Vn,Dr,Jn)),ur(Dr,Jn))},Ta=Gn({valueTexts:Fi,onTextChange:function(kn){return ua(kn,0)}}),wa=Object(H.a)(Ta,3),Oa=wa[0],ka=wa[1],co=wa[2],Ro=Gn({valueTexts:Ma,onTextChange:function(kn){return ua(kn,1)}}),Ga=Object(H.a)(Ro,3),Sa=Ga[0],Va=Ga[1],_a=Ga[2],Ra=Object(O.useState)(null),ho=Object(H.a)(Ra,2),Ya=ho[0],Aa=ho[1],Da=Object(O.useState)(null),ya=Object(H.a)(Da,2),ki=ya[0],fa=ya[1],pa=Jr(Oa,{formatList:Ue,generateConfig:St,locale:Fe}),ba=Object(H.a)(pa,3),ma=ba[0],Xa=ba[1],$a=ba[2],Qa=Jr(Sa,{formatList:Ue,generateConfig:St,locale:Fe}),Ia=Object(H.a)(Qa,3),ca=Ia[0],Ea=Ia[1],ro=Ia[2],Ao=function(kn){fa(Te(Vn,kn,Qe)),Qe===0?Xa(kn):Ea(kn)},Do=function(){fa(Te(Vn,null,Qe)),Qe===0?$a():ro()},fo=function(kn,Jn){return{blurToCancel:Fr,forwardKeyDown:Br,onBlur:Hr,isClickOutside:function(ui){return!M([qe.current,ot.current,Ne.current],ui)},onFocus:function(ui){pt(kn),Gr&&Gr(ui)},triggerOpen:function(ui){En(ui,kn)},onSubmit:function(){zn(Vn,kn),Jn()},onCancel:function(){En(!1,kn),Pr(Pn),Jn()}}},io=en(Object(P.a)(Object(P.a)({},fo(0,co)),{},{open:nr,value:Oa})),po=Object(H.a)(io,2),Ki=po[0],vi=po[1],Ai=vi.focused,_i=vi.typing,Na=en(Object(P.a)(Object(P.a)({},fo(1,_a)),{},{open:li,value:Sa})),mo=Object(H.a)(Na,2),ta=mo[0],ao=mo[1],oo=ao.focused,so=ao.typing,xa=function(kn){!Ar&&!ye.current.contains(kn.target)&&!fe.current.contains(kn.target)&&(zt[0]?zt[1]||yn(1):yn(0))},Ja=function(kn){Ar&&(Ai||oo)&&!ye.current.contains(kn.target)&&!fe.current.contains(kn.target)&&kn.preventDefault()},Ua=Pn&&Pn[0]?St.locale.format(Fe.locale,Pn[0],"YYYYMMDDHHmmss"):"",go=Pn&&Pn[1]?St.locale.format(Fe.locale,Pn[1],"YYYYMMDDHHmmss"):"";Object(O.useEffect)(function(){Ar||(Pr(Pn),!Fi.length||Fi[0]===""?ka(""):$r!==Oa&&co(),!Ma.length||Ma[0]===""?Va(""):no!==Sa&&_a())},[Ar,Fi,Ma]),Object(O.useEffect)(function(){Pr(Pn)},[Ua,go]),xn&&(xn.current={focus:function(){ye.current&&ye.current.focus()},blur:function(){ye.current&&ye.current.blur(),fe.current&&fe.current.blur()}});var Za=Object.keys(wn||{}),Qr=Za.map(function(_r){var kn=wn[_r],Jn=typeof kn=="function"?kn():kn;return{label:_r,onClick:function(){zn(Jn,null),En(!1,Qe)},onMouseEnter:function(){Aa(Jn)},onMouseLeave:function(){Aa(null)}}});function Mr(){var _r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,kn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Jn=null;Ar&&ki&&ki[0]&&ki[1]&&St.isAfter(ki[1],ki[0])&&(Jn=ki);var Dr=$t;if($t&&Object(h.a)($t)==="object"&&$t.defaultValue){var ui=$t.defaultValue;Dr=Object(P.a)(Object(P.a)({},$t),{},{defaultValue:Ee(ui,Qe)||void 0})}var ga=null;return Tn&&(ga=function(Di,Zi){return Tn(Di,Zi,{range:Qe?"end":"start"})}),O.createElement(bt.Provider,{value:{inRange:!0,panelPosition:_r,rangedValue:Ya||Vn,hoverRangedValue:Jn}},O.createElement(q,Object.assign({},Q,kn,{dateRender:ga,showTime:Dr,mode:vn[Qe],generateConfig:St,style:void 0,direction:kr,disabledDate:Qe===0?Yr:Sr,disabledTime:function(Di){return pr?pr(Di,Qe===0?"start":"end"):!1},className:x()(Object(L.a)({},"".concat(Be,"-panel-focused"),Qe===0?!_i:!so)),value:Ee(Vn,Qe),locale:Fe,tabIndex:-1,onPanelChange:function(Di,Zi){wr(Te(vn,Zi,Qe),Te(Vn,Di,Qe));var va=Di;_r==="right"&&vn[Qe]===Zi&&(va=it(va,Zi,St,-1)),ur(va,Qe)},onOk:null,onSelect:void 0,onChange:void 0,defaultValue:void 0,defaultPickerValue:void 0})))}var di=0,Bi=0;Qe&&ot.current&&le.current&&qe.current&&(di=ot.current.offsetWidth+le.current.offsetWidth,qe.current.offsetWidth&&di>qe.current.offsetWidth&&(Bi=di));var Pa=kr==="rtl"?{right:di}:{left:di};function da(){var _r,kn=N(Be,vn[Qe],Dn),Jn=V({prefixCls:Be,components:Rn,needConfirmButton:Fr,okDisabled:!Ee(Vn,Qe)||$n&&$n(Vn[Qe]),locale:Fe,rangeList:Qr,onOk:function(){Ee(Vn,Qe)&&(zn(Vn,Qe),mr&&mr(Vn))}});if(Ft!=="time"&&!$t){var Dr=lr(Qe),ui=it(Dr,Ft,St),ga=vn[Qe],oa=ga===Ft,Di=Mr(oa?"left":!1,{pickerValue:Dr,onPickerValueChange:function(Oi){ur(Oi,Qe)}}),Zi=Mr("right",{pickerValue:ui,onPickerValueChange:function(Oi){ur(it(Oi,Ft,St,-1),Qe)}});kr==="rtl"?_r=O.createElement(O.Fragment,null,Zi,oa&&Di):_r=O.createElement(O.Fragment,null,Di,oa&&Zi)}else _r=Mr();var va=O.createElement(O.Fragment,null,O.createElement("div",{className:"".concat(Be,"-panels")},_r),(kn||Jn)&&O.createElement("div",{className:"".concat(Be,"-footer")},kn,Jn));return jn&&(va=jn(va)),O.createElement("div",{className:"".concat(Be,"-panel-container"),style:{marginLeft:Bi},ref:qe,onMouseDown:function(Oi){Oi.preventDefault()}},va)}var ja=O.createElement("div",{className:x()("".concat(Be,"-range-wrapper"),"".concat(Be,"-").concat(Ft,"-range-wrapper")),style:{minWidth:gi}},O.createElement("div",{className:"".concat(Be,"-range-arrow"),style:Pa}),da()),ha;yr&&(ha=O.createElement("span",{className:"".concat(Be,"-suffix")},yr));var Ci;Kn&&(Ee(Pn,0)&&!zt[0]||Ee(Pn,1)&&!zt[1])&&(Ci=O.createElement("span",{onMouseDown:function(kn){kn.preventDefault(),kn.stopPropagation()},onMouseUp:function(kn){kn.preventDefault(),kn.stopPropagation();var Jn=Pn;zt[0]||(Jn=Te(Jn,null,0)),zt[1]||(Jn=Te(Jn,null,1)),zn(Jn,null),En(!1,Qe)},className:"".concat(Be,"-clear")},hr||O.createElement("span",{className:"".concat(Be,"-clear-btn")})));var Fa={size:f(Ft,Ue[0])},Ba=0,Ha=0;ot.current&&Ne.current&&le.current&&(Qe===0?Ha=ot.current.offsetWidth:(Ba=di,Ha=Ne.current.offsetWidth));var zi=kr==="rtl"?{right:Ba}:{left:Ba},zr=function(kn,Jn){var Dr=Te(Vn,kn,Qe);Jn==="submit"||Jn!=="key"&&!Fr?(zn(Dr,Qe),Qe===0?$a():ro()):Pr(Dr)};return O.createElement(a.Provider,{value:{operationRef:Nt,hideHeader:Ft==="time",onDateMouseEnter:Ao,onDateMouseLeave:Do,hideRanges:!0,onSelect:zr,open:Ar}},O.createElement(Bn,{visible:Ar,popupElement:ja,popupStyle:ft,prefixCls:Be,dropdownClassName:Ot,dropdownAlign:_t,getPopupContainer:Et,transitionName:Ct,range:!0,direction:kr},O.createElement("div",Object.assign({ref:Re,className:x()(Be,"".concat(Be,"-range"),Me,(ve={},Object(L.a)(ve,"".concat(Be,"-disabled"),zt[0]&&zt[1]),Object(L.a)(ve,"".concat(Be,"-focused"),Qe===0?Ai:oo),Object(L.a)(ve,"".concat(Be,"-rtl"),kr==="rtl"),ve)),style:ht,onClick:xa,onMouseDown:Ja},Ie(Q)),O.createElement("div",{className:x()("".concat(Be,"-input"),(Ae={},Object(L.a)(Ae,"".concat(Be,"-input-active"),Qe===0),Object(L.a)(Ae,"".concat(Be,"-input-placeholder"),!!ma),Ae)),ref:ot},O.createElement("input",Object.assign({id:rt,disabled:zt[0],readOnly:Wt||!_i,value:ma||Oa,onChange:function(kn){ka(kn.target.value)},autoFocus:Zt,placeholder:Ee(At,0)||"",ref:ye},Ki,Fa,{autoComplete:Cr}))),O.createElement("div",{className:"".concat(Be,"-range-separator"),ref:le},It),O.createElement("div",{className:x()("".concat(Be,"-input"),(De={},Object(L.a)(De,"".concat(Be,"-input-active"),Qe===1),Object(L.a)(De,"".concat(Be,"-input-placeholder"),!!ca),De)),ref:Ne},O.createElement("input",Object.assign({disabled:zt[1],readOnly:Wt||!so,value:ca||Sa,onChange:function(kn){Va(kn.target.value)},placeholder:Ee(At,1)||"",ref:fe},ta,Fa,{autoComplete:Cr}))),O.createElement("div",{className:"".concat(Be,"-active-bar"),style:Object(P.a)(Object(P.a)({},zi),{},{width:Ha,position:"absolute"})}),ha,Ci)))}var ea=function(Q){Object(j.a)(Ae,Q);var ve=Object(G.a)(Ae);function Ae(){var De;return Object(re.a)(this,Ae),De=ve.apply(this,arguments),De.pickerRef=O.createRef(),De.focus=function(){De.pickerRef.current&&De.pickerRef.current.focus()},De.blur=function(){De.pickerRef.current&&De.pickerRef.current.blur()},De}return Object(Y.a)(Ae,[{key:"render",value:function(){return O.createElement(Mi,Object.assign({},this.props,{pickerRef:this.pickerRef}))}}]),Ae}(O.Component),la=ea,Nn=et.b=Qi},osHv:function(Gt,et,k){(function(re){re(k("VrN/"))})(function(re){"use strict";var Y=re.Pos;function j(l,s){return l.line-s.line||l.ch-s.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",L=G+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",P=new RegExp("<(/?)(["+G+"]["+L+"]*)","g");function H(l,s,u,c){this.line=s,this.ch=u,this.cm=l,this.text=l.getLine(s),this.min=c?Math.max(c.from,l.firstLine()):l.firstLine(),this.max=c?Math.min(c.to-1,l.lastLine()):l.lastLine()}function O(l,s){var u=l.cm.getTokenTypeAt(Y(l.line,s));return u&&/\btag\b/.test(u)}function I(l){return l.line>=l.max?void 0:(l.ch=0,l.text=l.cm.getLine(++l.line),!0)}function x(l){return l.line<=l.min?void 0:(l.text=l.cm.getLine(--l.line),l.ch=l.text.length,!0)}function p(l){for(;;){var s=l.text.indexOf(">",l.ch);if(s==-1){if(I(l))continue;return}if(!O(l,s+1)){l.ch=s+1;continue}var u=l.text.lastIndexOf("/",s),c=u>-1&&!/\S/.test(l.text.slice(u+1,s));return l.ch=s+1,c?"selfClose":"regular"}}function m(l){for(;;){var s=l.ch?l.text.lastIndexOf("<",l.ch-1):-1;if(s==-1){if(x(l))continue;return}if(!O(l,s+1)){l.ch=s;continue}P.lastIndex=s,l.ch=s;var u=P.exec(l.text);if(u&&u.index==s)return u}}function h(l){for(;;){P.lastIndex=l.ch;var s=P.exec(l.text);if(!s){if(I(l))continue;return}if(!O(l,s.index+1)){l.ch=s.index+1;continue}return l.ch=s.index+s[0].length,s}}function r(l){for(;;){var s=l.ch?l.text.lastIndexOf(">",l.ch-1):-1;if(s==-1){if(x(l))continue;return}if(!O(l,s+1)){l.ch=s;continue}var u=l.text.lastIndexOf("/",s),c=u>-1&&!/\S/.test(l.text.slice(u+1,s));return l.ch=s+1,c?"selfClose":"regular"}}function n(l,s){for(var u=[];;){var c=h(l),R,w=l.line,C=l.ch-(c?c[0].length:0);if(!c||!(R=p(l)))return;if(R=="selfClose")continue;if(c[1]){for(var D=u.length-1;D>=0;--D)if(u[D]==c[2]){u.length=D;break}if(D<0&&(!s||s==c[2]))return{tag:c[2],from:Y(w,C),to:Y(l.line,l.ch)}}else u.push(c[2])}}function a(l,s){for(var u=[];;){var c=r(l);if(!c)return;if(c=="selfClose"){m(l);continue}var R=l.line,w=l.ch,C=m(l);if(!C)return;if(C[1])u.push(C[2]);else{for(var D=u.length-1;D>=0;--D)if(u[D]==C[2]){u.length=D;break}if(D<0&&(!s||s==C[2]))return{tag:C[2],from:Y(l.line,l.ch),to:Y(R,w)}}}}re.registerHelper("fold","xml",function(l,s){for(var u=new H(l,s.line,0);;){var c=h(u);if(!c||u.line!=s.line)return;var R=p(u);if(!R)return;if(!c[1]&&R!="selfClose"){var w=Y(u.line,u.ch),C=n(u,c[2]);return C&&j(C.from,w)>0?{from:w,to:C.from}:null}}}),re.findMatchingTag=function(l,s,u){var c=new H(l,s.line,s.ch,u);if(c.text.indexOf(">")==-1&&c.text.indexOf("<")==-1)return;var R=p(c),w=R&&Y(c.line,c.ch),C=R&&m(c);if(!R||!C||j(c,s)>0)return;var D={from:Y(c.line,c.ch),to:w,tag:C[2]};return R=="selfClose"?{open:D,close:null,at:"open"}:C[1]?{open:a(c,C[2]),close:D,at:"close"}:(c=new H(l,w.line,w.ch,u),{open:D,close:n(c,C[2]),at:"open"})},re.findEnclosingTag=function(l,s,u,c){for(var R=new H(l,s.line,s.ch,u);;){var w=a(R,c);if(!w)break;var C=new H(l,s.line,s.ch,u),D=n(C,w.tag);if(D)return{open:w,close:D}}},re.scanForClosingTag=function(l,s,u,c){var R=new H(l,s.line,s.ch,c?{from:0,to:c}:null);return n(R,u)}})},p5ED:function(Gt,et,k){"use strict";var re=k("+L6B"),Y=k("2/Rp"),j=k("5Dmo"),G=k("3S7+"),L=k("k1fw"),P=k("tJVT"),H=k("q1tI"),O=k.n(H),I=k("vHTk"),x=k.n(I),p=k("yEEn"),m=k("ZW9T"),h=k("1vsH");et.a=function(r){var n=r.name,a=r.data,l=r.theme,s=r.type,u=r.filename,c=r.monacoEditor,R=r.className,w=r.style,C=r.close,D=r.onClose,S=r.hasMask,b=Object(H.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),_=Object(P.a)(b,2),f=_[0],d=_[1],g=Object(H.useState)(""),E=Object(P.a)(g,2),T=E[0],F=E[1],U,K=1024*1024,z=10*K,M=Object(H.useRef)();s==="office"&&(U=Object(h.T)(a).filesize,U>z&&(s="other")),u&&(c.filename=u),Object(H.useEffect)(function(){var X,te,pe=(X=document.cookie)===null||X===void 0||((te=X.replace(/\s/g,""))===null||te===void 0)?void 0:te.split(";");pe==null||pe.map(function(Ie){var Ee=Ie.split("=");Ee[0]==="_educoder_session"&&F(Ee[1])})},[]);var y=function(){if(a.startsWith("http")||a.startsWith("/")){W();return}Object(h.z)(u||"educoder",a,u)},W=function(){Object(h.x)(u||n,a)};return console.log("data:",a,"fileanme:",u," name:",n),O.a.createElement("div",{style:Object(L.a)({},w||{}),className:"".concat(S&&x.a.bgBlack," ").concat(s?x.a.wrp:"hide")},C&&O.a.createElement("div",{className:x.a.close,ref:M},O.a.createElement(G.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return M.current}},O.a.createElement("span",{onClick:W},O.a.createElement("i",{className:"icon-quxiaozhiding"}))),O.a.createElement(G.a,{title:"\u5173\u95ED",getPopupContainer:function(){return M.current}},O.a.createElement("span",{className:"",onClick:D},O.a.createElement("i",{className:"icon-guanbi1"})))),O.a.createElement("div",{className:"".concat(x.a[R]," ").concat(R," ").concat(x.a.monaco," ").concat(s==="txt"?"show":"hide")},s==="txt"&&O.a.createElement(m.b,c)),s==="audio"&&O.a.createElement("audio",{src:"".concat(a!=null&&a.startsWith("/")||(a==null?void 0:a.indexOf("https://"))>-1?a:"data:audio/mp3;base64,").concat(a),autoPlay:!0}),s==="video"&&O.a.createElement(O.a.Fragment,null,a!=null&&a.startsWith("/")?O.a.createElement("video",{controls:!0,src:"".concat(a),autoPlay:!0}):O.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(a),autoPlay:!0})),s==="html"&&O.a.createElement("iframe",{src:a+"&disposition=inline"}),s==="pdf"&&O.a.createElement("embed",{className:x.a.embed,src:a}),s==="image"&&O.a.createElement(O.a.Fragment,null,O.a.createElement("img",{src:"".concat(a!=null&&a.startsWith("/")||(a==null?void 0:a.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(a)})),s==="other"&&O.a.createElement("div",null,O.a.createElement(Y.a,{type:"primary",size:"large",onClick:y},O.a.createElement(p.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(s==="download"||s==="office")&&O.a.createElement(Y.a,{type:"primary",size:"large",onClick:y},O.a.createElement(p.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Gt,et,k){},psGv:function(Gt,et,k){var re,Y;(function(){var j;(function(){"use strict";var H=[,,function(p){function m(n){this.__parent=n,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=[]}m.prototype.clone_empty=function(){var n=new m(this.__parent);return n.set_indent(this.__indent_count,this.__alignment_count),n},m.prototype.item=function(n){return n<0?this.__items[this.__items.length+n]:this.__items[n]},m.prototype.has_match=function(n){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(n))return!0;return!1},m.prototype.set_indent=function(n,a){this.is_empty()&&(this.__indent_count=n||0,this.__alignment_count=a||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},m.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)},m.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},m.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var n=this.__parent.current_line;return n.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),n.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),n.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,n.__items[0]===" "&&(n.__items.splice(0,1),n.__character_count-=1),!0}return!1},m.prototype.is_empty=function(){return this.__items.length===0},m.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},m.prototype.push=function(n){this.__items.push(n);var a=n.lastIndexOf(`
`);a!==-1?this.__character_count=n.length-a:this.__character_count+=n.length},m.prototype.pop=function(){var n=null;return this.is_empty()||(n=this.__items.pop(),this.__character_count-=n.length),n},m.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},m.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},m.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},m.prototype.toString=function(){var n="";return this.is_empty()?this.__parent.indent_empty_lines&&(n=this.__parent.get_indent_string(this.__indent_count)):(n=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),n+=this.__items.join("")),n};function h(n,a){this.__cache=[""],this.__indent_size=n.indent_size,this.__indent_string=n.indent_char,n.indent_with_tabs||(this.__indent_string=new Array(n.indent_size+1).join(n.indent_char)),a=a||"",n.indent_level>0&&(a=new Array(n.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}h.prototype.get_indent_size=function(n,a){var l=this.__base_string_length;return a=a||0,n<0&&(l=0),l+=n*this.__indent_size,l+=a,l},h.prototype.get_indent_string=function(n,a){var l=this.__base_string;return a=a||0,n<0&&(n=0,l=""),a+=n*this.__indent_size,this.__ensure_cache(a),l+=this.__cache[a],l},h.prototype.__ensure_cache=function(n){for(;n>=this.__cache.length;)this.__add_column()},h.prototype.__add_column=function(){var n=this.__cache.length,a=0,l="";this.__indent_size&&n>=this.__indent_size&&(a=Math.floor(n/this.__indent_size),n-=a*this.__indent_size,l=new Array(a+1).join(this.__indent_string)),n&&(l+=new Array(n+1).join(" ")),this.__cache.push(l)};function r(n,a){this.__indent_cache=new h(n,a),this.raw=!1,this._end_with_newline=n.end_with_newline,this.indent_size=n.indent_size,this.wrap_line_length=n.wrap_line_length,this.indent_empty_lines=n.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new m(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}r.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},r.prototype.get_line_number=function(){return this.__lines.length},r.prototype.get_indent_string=function(n,a){return this.__indent_cache.get_indent_string(n,a)},r.prototype.get_indent_size=function(n,a){return this.__indent_cache.get_indent_size(n,a)},r.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},r.prototype.add_new_line=function(n){return this.is_empty()||!n&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},r.prototype.get_code=function(n){this.trim(!0);var a=this.current_line.pop();a&&(a[a.length-1]===`
`&&(a=a.replace(/\n+$/g,"")),this.current_line.push(a)),this._end_with_newline&&this.__add_outputline();var l=this.__lines.join(`
`);return n!==`
`&&(l=l.replace(/[\n]/g,n)),l},r.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},r.prototype.set_indent=function(n,a){return n=n||0,a=a||0,this.next_line.set_indent(n,a),this.__lines.length>1?(this.current_line.set_indent(n,a),!0):(this.current_line.set_indent(),!1)},r.prototype.add_raw_token=function(n){for(var a=0;a<n.newlines;a++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(n.whitespace_before),this.current_line.push(n.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},r.prototype.add_token=function(n){this.__add_space_before_token(),this.current_line.push(n),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},r.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(" "))},r.prototype.remove_indent=function(n){for(var a=this.__lines.length;n<a;)this.__lines[n]._remove_indent(),n++;this.current_line._remove_wrap_indent()},r.prototype.trim=function(n){for(n=n===void 0?!1:n,this.current_line.trim();n&&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},r.prototype.just_added_newline=function(){return this.current_line.is_empty()},r.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},r.prototype.ensure_empty_line_above=function(n,a){for(var l=this.__lines.length-2;l>=0;){var s=this.__lines[l];if(s.is_empty())break;if(s.item(0).indexOf(n)!==0&&s.item(-1)!==a){this.__lines.splice(l+1,0,new m(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},p.exports.Output=r},function(p){function m(h,r,n,a){this.type=h,this.text=r,this.comments_before=null,this.newlines=n||0,this.whitespace_before=a||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}p.exports.Token=m},,,function(p){function m(n,a){this.raw_options=h(n,a),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}m.prototype._get_array=function(n,a){var l=this.raw_options[n],s=a||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(s=l.concat()):typeof l=="string"&&(s=l.split(/[^a-zA-Z0-9_\/\-]+/)),s},m.prototype._get_boolean=function(n,a){var l=this.raw_options[n],s=l===void 0?!!a:!!l;return s},m.prototype._get_characters=function(n,a){var l=this.raw_options[n],s=a||"";return typeof l=="string"&&(s=l.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),s},m.prototype._get_number=function(n,a){var l=this.raw_options[n];a=parseInt(a,10),isNaN(a)&&(a=0);var s=parseInt(l,10);return isNaN(s)&&(s=a),s},m.prototype._get_selection=function(n,a,l){var s=this._get_selection_list(n,a,l);if(s.length!==1)throw new Error("Invalid Option Value: The option '"+n+`' can only be one of the following values:
`+a+`
You passed in: '`+this.raw_options[n]+"'");return s[0]},m.prototype._get_selection_list=function(n,a,l){if(!a||a.length===0)throw new Error("Selection list cannot be empty.");if(l=l||[a[0]],!this._is_valid_selection(l,a))throw new Error("Invalid Default Value!");var s=this._get_array(n,l);if(!this._is_valid_selection(s,a))throw new Error("Invalid Option Value: The option '"+n+`' can contain only the following values:
`+a+`
You passed in: '`+this.raw_options[n]+"'");return s},m.prototype._is_valid_selection=function(n,a){return n.length&&a.length&&!n.some(function(l){return a.indexOf(l)===-1})};function h(n,a){var l={};n=r(n);var s;for(s in n)s!==a&&(l[s]=n[s]);if(a&&n[a])for(s in n[a])l[s]=n[a][s];return l}function r(n){var a={},l;for(l in n){var s=l.replace(/-/g,"_");a[s]=n[l]}return a}p.exports.Options=m,p.exports.normalizeOpts=r,p.exports.mergeOpts=h},,function(p){var m=RegExp.prototype.hasOwnProperty("sticky");function h(r){this.__input=r||"",this.__input_length=this.__input.length,this.__position=0}h.prototype.restart=function(){this.__position=0},h.prototype.back=function(){this.__position>0&&(this.__position-=1)},h.prototype.hasNext=function(){return this.__position<this.__input_length},h.prototype.next=function(){var r=null;return this.hasNext()&&(r=this.__input.charAt(this.__position),this.__position+=1),r},h.prototype.peek=function(r){var n=null;return r=r||0,r+=this.__position,r>=0&&r<this.__input_length&&(n=this.__input.charAt(r)),n},h.prototype.__match=function(r,n){r.lastIndex=n;var a=r.exec(this.__input);return a&&!(m&&r.sticky)&&(a.index!==n&&(a=null)),a},h.prototype.test=function(r,n){return n=n||0,n+=this.__position,n>=0&&n<this.__input_length?!!this.__match(r,n):!1},h.prototype.testChar=function(r,n){var a=this.peek(n);return r.lastIndex=0,a!==null&&r.test(a)},h.prototype.match=function(r){var n=this.__match(r,this.__position);return n?this.__position+=n[0].length:n=null,n},h.prototype.read=function(r,n,a){var l="",s;return r&&(s=this.match(r),s&&(l+=s[0])),n&&(s||!r)&&(l+=this.readUntil(n,a)),l},h.prototype.readUntil=function(r,n){var a="",l=this.__position;r.lastIndex=this.__position;var s=r.exec(this.__input);return s?(l=s.index,n&&(l+=s[0].length)):l=this.__input_length,a=this.__input.substring(this.__position,l),this.__position=l,a},h.prototype.readUntilAfter=function(r){return this.readUntil(r,!0)},h.prototype.get_regexp=function(r,n){var a=null,l="g";return n&&m&&(l="y"),typeof r=="string"&&r!==""?a=new RegExp(r,l):r&&(a=new RegExp(r.source,l)),a},h.prototype.get_literal_regexp=function(r){return RegExp(r.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},h.prototype.peekUntilAfter=function(r){var n=this.__position,a=this.readUntilAfter(r);return this.__position=n,a},h.prototype.lookBack=function(r){var n=this.__position-1;return n>=r.length&&this.__input.substring(n-r.length,n).toLowerCase()===r},p.exports.InputScanner=h},function(p,m,h){var r=h(8).InputScanner,n=h(3).Token,a=h(10).TokenStream,l=h(11).WhitespacePattern,s={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},u=function(c,R){this._input=new r(c),this._options=R||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new l(this._input)};u.prototype.tokenize=function(){this._input.restart(),this.__tokens=new a,this._reset();for(var c,R=new n(s.START,""),w=null,C=[],D=new a;R.type!==s.EOF;){for(c=this._get_next_token(R,w);this._is_comment(c);)D.add(c),c=this._get_next_token(R,w);D.isEmpty()||(c.comments_before=D,D=new a),c.parent=w,this._is_opening(c)?(C.push(w),w=c):w&&this._is_closing(c,w)&&(c.opened=w,w.closed=c,w=C.pop(),c.parent=w),c.previous=R,R.next=c,this.__tokens.add(c),R=c}return this.__tokens},u.prototype._is_first_token=function(){return this.__tokens.isEmpty()},u.prototype._reset=function(){},u.prototype._get_next_token=function(c,R){this._readWhitespace();var w=this._input.read(/.+/g);return w?this._create_token(s.RAW,w):this._create_token(s.EOF,"")},u.prototype._is_comment=function(c){return!1},u.prototype._is_opening=function(c){return!1},u.prototype._is_closing=function(c,R){return!1},u.prototype._create_token=function(c,R){var w=new n(c,R,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return w},u.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},p.exports.Tokenizer=u,p.exports.TOKEN=s},function(p){function m(h){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=h}m.prototype.restart=function(){this.__position=0},m.prototype.isEmpty=function(){return this.__tokens_length===0},m.prototype.hasNext=function(){return this.__position<this.__tokens_length},m.prototype.next=function(){var h=null;return this.hasNext()&&(h=this.__tokens[this.__position],this.__position+=1),h},m.prototype.peek=function(h){var r=null;return h=h||0,h+=this.__position,h>=0&&h<this.__tokens_length&&(r=this.__tokens[h]),r},m.prototype.add=function(h){this.__parent_token&&(h.parent=this.__parent_token),this.__tokens.push(h),this.__tokens_length+=1},p.exports.TokenStream=m},function(p,m,h){var r=h(12).Pattern;function n(a,l){r.call(this,a,l),l?this._line_regexp=this._input.get_regexp(l._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}n.prototype=new r,n.prototype.__set_whitespace_patterns=function(a,l){a+="\\t ",l+="\\n\\r",this._match_pattern=this._input.get_regexp("["+a+l+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+l+"]")},n.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var a=this._input.read(this._match_pattern);if(a===" ")this.whitespace_before_token=" ";else if(a){var l=this.__split(this._newline_regexp,a);this.newline_count=l.length-1,this.whitespace_before_token=l[this.newline_count]}return a},n.prototype.matching=function(a,l){var s=this._create();return s.__set_whitespace_patterns(a,l),s._update(),s},n.prototype._create=function(){return new n(this._input,this)},n.prototype.__split=function(a,l){a.lastIndex=0;for(var s=0,u=[],c=a.exec(l);c;)u.push(l.substring(s,c.index)),s=c.index+c[0].length,c=a.exec(l);return s<l.length?u.push(l.substring(s,l.length)):u.push(""),u},p.exports.WhitespacePattern=n},function(p){function m(h,r){this._input=h,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,r&&(this._starting_pattern=this._input.get_regexp(r._starting_pattern,!0),this._match_pattern=this._input.get_regexp(r._match_pattern,!0),this._until_pattern=this._input.get_regexp(r._until_pattern),this._until_after=r._until_after)}m.prototype.read=function(){var h=this._input.read(this._starting_pattern);return(!this._starting_pattern||h)&&(h+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),h},m.prototype.read_match=function(){return this._input.match(this._match_pattern)},m.prototype.until_after=function(h){var r=this._create();return r._until_after=!0,r._until_pattern=this._input.get_regexp(h),r._update(),r},m.prototype.until=function(h){var r=this._create();return r._until_after=!1,r._until_pattern=this._input.get_regexp(h),r._update(),r},m.prototype.starting_with=function(h){var r=this._create();return r._starting_pattern=this._input.get_regexp(h,!0),r._update(),r},m.prototype.matching=function(h){var r=this._create();return r._match_pattern=this._input.get_regexp(h,!0),r._update(),r},m.prototype._create=function(){return new m(this._input,this)},m.prototype._update=function(){},p.exports.Pattern=m},function(p){function m(h,r){h=typeof h=="string"?h:h.source,r=typeof r=="string"?r:r.source,this.__directives_block_pattern=new RegExp(h+/ beautify( \w+[:]\w+)+ /.source+r,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(h+/\sbeautify\signore:end\s/.source+r,"g")}m.prototype.get_directives=function(h){if(!h.match(this.__directives_block_pattern))return null;var r={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(h);n;)r[n[1]]=n[2],n=this.__directive_pattern.exec(h);return r},m.prototype.readIgnored=function(h){return h.readUntilAfter(this.__directives_end_ignore_pattern)},p.exports.Directives=m},function(p,m,h){var r=h(12).Pattern,n={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function a(l,s){r.call(this,l,s),this.__template_pattern=null,this._disabled=Object.assign({},n),this._excluded=Object.assign({},n),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 u=new r(l);this.__patterns={handlebars_comment:u.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:u.starting_with(/{{{/).until_after(/}}}/),handlebars:u.starting_with(/{{/).until_after(/}}/),php:u.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:u.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:u.starting_with(/{%/).until_after(/%}/),django_value:u.starting_with(/{{/).until_after(/}}/),django_comment:u.starting_with(/{#/).until_after(/#}/),smarty:u.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:u.starting_with(/{\*/).until_after(/\*}/),smarty_literal:u.starting_with(/{literal}/).until_after(/{\/literal}/)}}a.prototype=new r,a.prototype._create=function(){return new a(this._input,this)},a.prototype._update=function(){this.__set_templated_pattern()},a.prototype.disable=function(l){var s=this._create();return s._disabled[l]=!0,s._update(),s},a.prototype.read_options=function(l){var s=this._create();for(var u in n)s._disabled[u]=l.templating.indexOf(u)===-1;return s._update(),s},a.prototype.exclude=function(l){var s=this._create();return s._excluded[l]=!0,s._update(),s},a.prototype.read=function(){var l="";this._match_pattern?l=this._input.read(this._starting_pattern):l=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),l+=s,s=this._read_template();return this._until_after&&(l+=this._input.readUntilAfter(this._until_pattern)),l},a.prototype.__set_templated_pattern=function(){var l=[];this._disabled.php||l.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||l.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||l.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(l.push(this.__patterns.django._starting_pattern.source),l.push(this.__patterns.django_value._starting_pattern.source),l.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||l.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&l.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+l.join("|")+")")},a.prototype._read_template=function(){var l="",s=this._input.peek();if(s==="<"){var u=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&u==="?"&&(l=l||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&u==="%"&&(l=l||this.__patterns.erb.read())}else s==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(l=l||this.__patterns.handlebars_comment.read(),l=l||this.__patterns.handlebars_unescaped.read(),l=l||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(l=l||this.__patterns.django_value.read()),this._excluded.django||(l=l||this.__patterns.django_comment.read(),l=l||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(l=l||this.__patterns.smarty_comment.read(),l=l||this.__patterns.smarty_literal.read(),l=l||this.__patterns.smarty.read()));return l},p.exports.TemplatablePattern=a},,,,function(p,m,h){var r=h(19).Beautifier,n=h(20).Options;function a(l,s,u,c){var R=new r(l,s,u,c);return R.beautify()}p.exports=a,p.exports.defaultOptions=function(){return new n}},function(p,m,h){var r=h(20).Options,n=h(2).Output,a=h(21).Tokenizer,l=h(21).TOKEN,s=/\r\n|[\r\n]/,u=/\r\n|[\r\n]/g,c=function(g,E){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=g.max_preserve_newlines,this.preserve_newlines=g.preserve_newlines,this._output=new n(g,E)};c.prototype.current_line_has_match=function(g){return this._output.current_line.has_match(g)},c.prototype.set_space_before_token=function(g,E){this._output.space_before_token=g,this._output.non_breaking_space=E},c.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},c.prototype.add_raw_token=function(g){this._output.add_raw_token(g)},c.prototype.print_preserved_newlines=function(g){var E=0;g.type!==l.TEXT&&g.previous.type!==l.TEXT&&(E=g.newlines?1:0),this.preserve_newlines&&(E=g.newlines<this.max_preserve_newlines+1?g.newlines:this.max_preserve_newlines+1);for(var T=0;T<E;T++)this.print_newline(T>0);return E!==0},c.prototype.traverse_whitespace=function(g){return g.whitespace_before||g.newlines?(this.print_preserved_newlines(g)||(this._output.space_before_token=!0),!0):!1},c.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},c.prototype.print_newline=function(g){this._output.add_new_line(g)},c.prototype.print_token=function(g){g.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(g.text))},c.prototype.indent=function(){this.indent_level++},c.prototype.get_full_indent=function(g){return g=this.indent_level+(g||0),g<1?"":this._output.get_indent_string(g)};var R=function(g){for(var E=null,T=g.next;T.type!==l.EOF&&g.closed!==T;){if(T.type===l.ATTRIBUTE&&T.text==="type"){T.next&&T.next.type===l.EQUALS&&T.next.next&&T.next.next.type===l.VALUE&&(E=T.next.next.text);break}T=T.next}return E},w=function(g,E){var T=null,F=null;return E.closed?(g==="script"?T="text/javascript":g==="style"&&(T="text/css"),T=R(E)||T,T.search("text/css")>-1?F="css":T.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?F="javascript":T.search(/(text|application|dojo)\/(x-)?(html)/)>-1?F="html":T.search(/test\/null/)>-1&&(F="null"),F):null};function C(g,E){return E.indexOf(g)!==-1}function D(g,E,T){this.parent=g||null,this.tag=E?E.tag_name:"",this.indent_level=T||0,this.parser_token=E||null}function S(g){this._printer=g,this._current_frame=null}S.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},S.prototype.record_tag=function(g){var E=new D(this._current_frame,g,this._printer.indent_level);this._current_frame=E},S.prototype._try_pop_frame=function(g){var E=null;return g&&(E=g.parser_token,this._printer.indent_level=g.indent_level,this._current_frame=g.parent),E},S.prototype._get_frame=function(g,E){for(var T=this._current_frame;T&&!(g.indexOf(T.tag)!==-1);){if(E&&E.indexOf(T.tag)!==-1){T=null;break}T=T.parent}return T},S.prototype.try_pop=function(g,E){var T=this._get_frame([g],E);return this._try_pop_frame(T)},S.prototype.indent_to_tag=function(g){var E=this._get_frame(g);E&&(this._printer.indent_level=E.indent_level)};function b(g,E,T,F){this._source_text=g||"",E=E||{},this._js_beautify=T,this._css_beautify=F,this._tag_stack=null;var U=new r(E,"html");this._options=U,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"}b.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var g=this._source_text,E=this._options.eol;this._options.eol==="auto"&&(E=`
`,g&&s.test(g)&&(E=g.match(s)[0])),g=g.replace(u,`
`);var T=g.match(/^[\t ]*/)[0],F={text:"",type:""},U=new _,K=new c(this._options,T),z=new a(g,this._options).tokenize();this._tag_stack=new S(K);for(var M=null,y=z.next();y.type!==l.EOF;)y.type===l.TAG_OPEN||y.type===l.COMMENT?(M=this._handle_tag_open(K,y,U,F),U=M):y.type===l.ATTRIBUTE||y.type===l.EQUALS||y.type===l.VALUE||y.type===l.TEXT&&!U.tag_complete?M=this._handle_inside_tag(K,y,U,z):y.type===l.TAG_CLOSE?M=this._handle_tag_close(K,y,U):y.type===l.TEXT?M=this._handle_text(K,y,U):K.add_raw_token(y),F=M,y=z.next();var W=K._output.get_code(E);return W},b.prototype._handle_tag_close=function(g,E,T){var F={text:E.text,type:E.type};return g.alignment_size=0,T.tag_complete=!0,g.set_space_before_token(E.newlines||E.whitespace_before!=="",!0),T.is_unformatted?g.add_raw_token(E):(T.tag_start_char==="<"&&(g.set_space_before_token(E.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&T.has_wrapped_attrs&&g.print_newline(!1)),g.print_token(E)),T.indent_content&&!(T.is_unformatted||T.is_content_unformatted)&&(g.indent(),T.indent_content=!1),!T.is_inline_element&&!(T.is_unformatted||T.is_content_unformatted)&&g.set_wrap_point(),F},b.prototype._handle_inside_tag=function(g,E,T,F){var U=T.has_wrapped_attrs,K={text:E.text,type:E.type};if(g.set_space_before_token(E.newlines||E.whitespace_before!=="",!0),T.is_unformatted)g.add_raw_token(E);else if(T.tag_start_char==="{"&&E.type===l.TEXT)g.print_preserved_newlines(E)?(E.newlines=0,g.add_raw_token(E)):g.print_token(E);else{if(E.type===l.ATTRIBUTE?(g.set_space_before_token(!0),T.attr_count+=1):(E.type===l.EQUALS||E.type===l.VALUE&&E.previous.type===l.EQUALS)&&g.set_space_before_token(!1),E.type===l.ATTRIBUTE&&T.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(g.traverse_whitespace(E),U=U||E.newlines!==0),this._is_wrap_attributes_force)){var z=T.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&T.attr_count===1){var M=!0,y=0,W;do{if(W=F.peek(y),W.type===l.ATTRIBUTE){M=!1;break}y+=1}while(y<4&&W.type!==l.EOF&&W.type!==l.TAG_CLOSE);z=!M}z&&(g.print_newline(!1),U=!0)}g.print_token(E),U=U||g.previous_token_wrapped(),T.has_wrapped_attrs=U}return K},b.prototype._handle_text=function(g,E,T){var F={text:E.text,type:"TK_CONTENT"};return T.custom_beautifier_name?this._print_custom_beatifier_text(g,E,T):T.is_unformatted||T.is_content_unformatted?g.add_raw_token(E):(g.traverse_whitespace(E),g.print_token(E)),F},b.prototype._print_custom_beatifier_text=function(g,E,T){var F=this;if(E.text!==""){var U=E.text,K,z=1,M="",y="";T.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?K=this._js_beautify:T.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?K=this._css_beautify:T.custom_beautifier_name==="html"&&(K=function(Ee,Te){var We=new b(Ee,Te,F._js_beautify,F._css_beautify);return We.beautify()}),this._options.indent_scripts==="keep"?z=0:this._options.indent_scripts==="separate"&&(z=-g.indent_level);var W=g.get_full_indent(z);if(U=U.replace(/\n[ \t]*$/,""),T.custom_beautifier_name!=="html"&&U[0]==="<"&&U.match(/^(<!--|<!\[CDATA\[)/)){var X=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(U);if(!X){g.add_raw_token(E);return}M=W+X[1]+`
`,U=X[4],X[5]&&(y=W+X[5]),U=U.replace(/\n[ \t]*$/,""),(X[2]||X[3].indexOf(`
`)!==-1)&&(X=X[3].match(/[ \t]+$/),X&&(E.whitespace_before=X[0]))}if(U)if(K){var te=function(){this.eol=`
`};te.prototype=this._options.raw_options;var pe=new te;U=K(W+U,pe)}else{var Ie=E.whitespace_before;Ie&&(U=U.replace(new RegExp(`
(`+Ie+")?","g"),`
`)),U=W+U.replace(/\n/g,`
`+W)}M&&(U?U=M+U+`
`+y:U=M+y),g.print_newline(!1),U&&(E.text=U,E.whitespace_before="",E.newlines=0,g.add_raw_token(E),g.print_newline(!0))}},b.prototype._handle_tag_open=function(g,E,T,F){var U=this._get_tag_open_token(E);return(T.is_unformatted||T.is_content_unformatted)&&!T.is_empty_element&&E.type===l.TAG_OPEN&&E.text.indexOf("</")===0?(g.add_raw_token(E),U.start_tag_token=this._tag_stack.try_pop(U.tag_name)):(g.traverse_whitespace(E),this._set_tag_position(g,E,U,T,F),U.is_inline_element||g.set_wrap_point(),g.print_token(E)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(U.alignment_size=E.text.length+1),!U.tag_complete&&!U.is_unformatted&&(g.alignment_size=U.alignment_size),U};var _=function(g,E){if(this.parent=g||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="",!E)this.tag_complete=!0;else{var T;this.tag_start_char=E.text[0],this.text=E.text,this.tag_start_char==="<"?(T=E.text.match(/^<([^\s>]*)/),this.tag_check=T?T[1]:""):(T=E.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=T?T[1]:"",(E.text.startsWith("{{#>")||E.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&E.next!==null?this.tag_check=E.next.text.split(" ")[0]:this.tag_check=E.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),E.type===l.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||E.closed&&E.closed.text==="/>";var F=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(F=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(F)))}};b.prototype._get_tag_open_token=function(g){var E=new _(this._tag_stack.get_parser_token(),g);return E.alignment_size=this._options.wrap_attributes_indent_size,E.is_end_tag=E.is_end_tag||C(E.tag_check,this._options.void_elements),E.is_empty_element=E.tag_complete||E.is_start_tag&&E.is_end_tag,E.is_unformatted=!E.tag_complete&&C(E.tag_check,this._options.unformatted),E.is_content_unformatted=!E.is_empty_element&&C(E.tag_check,this._options.content_unformatted),E.is_inline_element=C(E.tag_name,this._options.inline)||E.tag_name.includes("-")||E.tag_start_char==="{",E},b.prototype._set_tag_position=function(g,E,T,F,U){if(T.is_empty_element||(T.is_end_tag?T.start_tag_token=this._tag_stack.try_pop(T.tag_name):(this._do_optional_end_element(T)&&(T.is_inline_element||g.print_newline(!1)),this._tag_stack.record_tag(T),(T.tag_name==="script"||T.tag_name==="style")&&!(T.is_unformatted||T.is_content_unformatted)&&(T.custom_beautifier_name=w(T.tag_check,E)))),C(T.tag_check,this._options.extra_liners)&&(g.print_newline(!1),g._output.just_added_blankline()||g.print_newline(!0)),T.is_empty_element){if(T.tag_start_char==="{"&&T.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),T.indent_content=!0;var K=g.current_line_has_match(/{{#if/);K||g.print_newline(!1)}T.tag_name==="!--"&&U.type===l.TAG_CLOSE&&F.is_end_tag&&T.text.indexOf(`
`)===-1||(T.is_inline_element||T.is_unformatted||g.print_newline(!1),this._calcluate_parent_multiline(g,T))}else if(T.is_end_tag){var z=!1;z=T.start_tag_token&&T.start_tag_token.multiline_content,z=z||!T.is_inline_element&&!(F.is_inline_element||F.is_unformatted)&&!(U.type===l.TAG_CLOSE&&T.start_tag_token===F)&&U.type!=="TK_CONTENT",(T.is_content_unformatted||T.is_unformatted)&&(z=!1),z&&g.print_newline(!1)}else T.indent_content=!T.custom_beautifier_name,T.tag_start_char==="<"&&(T.tag_name==="html"?T.indent_content=this._options.indent_inner_html:T.tag_name==="head"?T.indent_content=this._options.indent_head_inner_html:T.tag_name==="body"&&(T.indent_content=this._options.indent_body_inner_html)),!(T.is_inline_element||T.is_unformatted)&&(U.type!=="TK_CONTENT"||T.is_content_unformatted)&&g.print_newline(!1),this._calcluate_parent_multiline(g,T)},b.prototype._calcluate_parent_multiline=function(g,E){E.parent&&g._output.just_added_newline()&&!((E.is_inline_element||E.is_unformatted)&&E.parent.is_inline_element)&&(E.parent.multiline_content=!0)};var f=["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"],d=["a","audio","del","ins","map","noscript","video"];b.prototype._do_optional_end_element=function(g){var E=null;if(g.is_empty_element||!g.is_start_tag||!g.parent)return;if(g.tag_name==="body")E=E||this._tag_stack.try_pop("head");else if(g.tag_name==="li")E=E||this._tag_stack.try_pop("li",["ol","ul"]);else if(g.tag_name==="dd"||g.tag_name==="dt")E=E||this._tag_stack.try_pop("dt",["dl"]),E=E||this._tag_stack.try_pop("dd",["dl"]);else if(g.parent.tag_name==="p"&&f.indexOf(g.tag_name)!==-1){var T=g.parent.parent;(!T||d.indexOf(T.tag_name)===-1)&&(E=E||this._tag_stack.try_pop("p"))}else g.tag_name==="rp"||g.tag_name==="rt"?(E=E||this._tag_stack.try_pop("rt",["ruby","rtc"]),E=E||this._tag_stack.try_pop("rp",["ruby","rtc"])):g.tag_name==="optgroup"?E=E||this._tag_stack.try_pop("optgroup",["select"]):g.tag_name==="option"?E=E||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):g.tag_name==="colgroup"?E=E||this._tag_stack.try_pop("caption",["table"]):g.tag_name==="thead"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"])):g.tag_name==="tbody"||g.tag_name==="tfoot"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"]),E=E||this._tag_stack.try_pop("thead",["table"]),E=E||this._tag_stack.try_pop("tbody",["table"])):g.tag_name==="tr"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"]),E=E||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(g.tag_name==="th"||g.tag_name==="td")&&(E=E||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),E=E||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return g.parent=this._tag_stack.get_parser_token(),E},p.exports.Beautifier=b},function(p,m,h){var r=h(6).Options;function n(a){r.call(this,a,"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"])}n.prototype=new r,p.exports.Options=n},function(p,m,h){var r=h(9).Tokenizer,n=h(9).TOKEN,a=h(13).Directives,l=h(14).TemplatablePattern,s=h(12).Pattern,u={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:n.START,RAW:n.RAW,EOF:n.EOF},c=new a(/<\!--/,/-->/),R=function(w,C){r.call(this,w,C),this._current_tag_name="";var D=new l(this._input).read_options(this._options),S=new s(this._input);if(this.__patterns={word:D.until(/[\n\r\t <]/),single_quote:D.until_after(/'/),double_quote:D.until_after(/"/),attribute:D.until(/[\n\r\t =>]|\/>/),element_name:D.until(/[\n\r\t >\/]/),handlebars_comment:S.starting_with(/{{!--/).until_after(/--}}/),handlebars:S.starting_with(/{{/).until_after(/}}/),handlebars_open:S.until(/[\n\r\t }]/),handlebars_raw_close:S.until(/}}/),comment:S.starting_with(/<!--/).until_after(/-->/),cdata:S.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:S.starting_with(/<!\[/).until_after(/]>/),processing:S.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 b=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=S.matching(b).until_after(b)}};R.prototype=new r,R.prototype._is_comment=function(w){return!1},R.prototype._is_opening=function(w){return w.type===u.TAG_OPEN},R.prototype._is_closing=function(w,C){return w.type===u.TAG_CLOSE&&C&&((w.text===">"||w.text==="/>")&&C.text[0]==="<"||w.text==="}}"&&C.text[0]==="{"&&C.text[1]==="{")},R.prototype._reset=function(){this._current_tag_name=""},R.prototype._get_next_token=function(w,C){var D=null;this._readWhitespace();var S=this._input.peek();return S===null?this._create_token(u.EOF,""):(D=D||this._read_open_handlebars(S,C),D=D||this._read_attribute(S,w,C),D=D||this._read_close(S,C),D=D||this._read_raw_content(S,w,C),D=D||this._read_content_word(S),D=D||this._read_comment_or_cdata(S),D=D||this._read_processing(S),D=D||this._read_open(S,C),D=D||this._create_token(u.UNKNOWN,this._input.next()),D)},R.prototype._read_comment_or_cdata=function(w){var C=null,D=null,S=null;if(w==="<"){var b=this._input.peek(1);b==="!"&&(D=this.__patterns.comment.read(),D?(S=c.get_directives(D),S&&S.ignore==="start"&&(D+=c.readIgnored(this._input))):D=this.__patterns.cdata.read()),D&&(C=this._create_token(u.COMMENT,D),C.directives=S)}return C},R.prototype._read_processing=function(w){var C=null,D=null,S=null;if(w==="<"){var b=this._input.peek(1);(b==="!"||b==="?")&&(D=this.__patterns.conditional_comment.read(),D=D||this.__patterns.processing.read()),D&&(C=this._create_token(u.COMMENT,D),C.directives=S)}return C},R.prototype._read_open=function(w,C){var D=null,S=null;return C||w==="<"&&(D=this._input.next(),this._input.peek()==="/"&&(D+=this._input.next()),D+=this.__patterns.element_name.read(),S=this._create_token(u.TAG_OPEN,D)),S},R.prototype._read_open_handlebars=function(w,C){var D=null,S=null;return C||this._options.indent_handlebars&&w==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(D=this.__patterns.handlebars_comment.read(),D=D||this.__patterns.handlebars.read(),S=this._create_token(u.COMMENT,D)):(D=this.__patterns.handlebars_open.read(),S=this._create_token(u.TAG_OPEN,D))),S},R.prototype._read_close=function(w,C){var D=null,S=null;return C&&(C.text[0]==="<"&&(w===">"||w==="/"&&this._input.peek(1)===">")?(D=this._input.next(),w==="/"&&(D+=this._input.next()),S=this._create_token(u.TAG_CLOSE,D)):C.text[0]==="{"&&w==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),S=this._create_token(u.TAG_CLOSE,"}}"))),S},R.prototype._read_attribute=function(w,C,D){var S=null,b="";if(D&&D.text[0]==="<")if(w==="=")S=this._create_token(u.EQUALS,this._input.next());else if(w==='"'||w==="'"){var _=this._input.next();w==='"'?_+=this.__patterns.double_quote.read():_+=this.__patterns.single_quote.read(),S=this._create_token(u.VALUE,_)}else b=this.__patterns.attribute.read(),b&&(C.type===u.EQUALS?S=this._create_token(u.VALUE,b):S=this._create_token(u.ATTRIBUTE,b));return S},R.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)},R.prototype._read_raw_content=function(w,C,D){var S="";if(D&&D.text[0]==="{")S=this.__patterns.handlebars_raw_close.read();else if(C.type===u.TAG_CLOSE&&C.opened.text[0]==="<"&&C.text[0]!=="/"){var b=C.opened.text.substr(1).toLowerCase();if(b==="script"||b==="style"){var _=this._read_comment_or_cdata(w);if(_)return _.type=u.TEXT,_;S=this._input.readUntil(new RegExp("</"+b+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(b)&&(S=this._input.readUntil(new RegExp("</"+b+"[\\n\\r\\t ]*?>","ig")))}return S?this._create_token(u.TEXT,S):null},R.prototype._read_content_word=function(w){var C="";if(this._options.unformatted_content_delimiter&&(w===this._options.unformatted_content_delimiter[0]&&(C=this.__patterns.unformatted_content_delimiter.read())),C||(C=this.__patterns.word.read()),C)return this._create_token(u.TEXT,C)},p.exports.Tokenizer=R,p.exports.TOKEN=u}],O={};function I(p){var m=O[p];if(m!==void 0)return m.exports;var h=O[p]={exports:{}};return H[p](h,h.exports,I),h.exports}var x=I(18);j=x})();var G=j;if(!0)!(re=[k,k("6UM0"),k("TXwP")],Y=function(H){var O=k("6UM0"),I=k("TXwP");return{html_beautify:function(x,p){return G(x,p,O.js_beautify,I.css_beautify)}}}.apply(et,re),Y!==void 0&&(Gt.exports=Y));else var L,P})()},qbod:function(Gt,et,k){},"rAM+":function(Gt,et,k){"use strict";k.d(et,"a",function(){return Y});var re=k("Qw5x");function Y(j,G){var L;if(typeof Symbol=="undefined"||j[Symbol.iterator]==null){if(Array.isArray(j)||(L=Object(re.a)(j))||G&&j&&typeof j.length=="number"){L&&(j=L);var P=0,H=function(){};return{s:H,n:function(){return P>=j.length?{done:!0}:{done:!1,value:j[P++]}},e:function(m){throw m},f:H}}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 O=!0,I=!1,x;return{s:function(){L=j[Symbol.iterator]()},n:function(){var m=L.next();return O=m.done,m},e:function(m){I=!0,x=m},f:function(){try{!O&&L.return!=null&&L.return()}finally{if(I)throw x}}}}},rUJ1:function(Gt,et){const k=/[&<>"']/,re=/[&<>"']/g,Y=/[<>"']|&(?!#?\w+;)/,j=/[<>"']|&(?!#?\w+;)/g,G={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},L=S=>G[S];function P(S,b){if(b){if(k.test(S))return S.replace(re,L)}else if(Y.test(S))return S.replace(j,L);return S}const H=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function O(S){return S.replace(H,(b,_)=>(_=_.toLowerCase(),_==="colon"?":":_.charAt(0)==="#"?_.charAt(1)==="x"?String.fromCharCode(parseInt(_.substring(2),16)):String.fromCharCode(+_.substring(1)):""))}const I=/(^|[^\[])\^/g;function x(S,b){S=S.source||S,b=b||"";const _={replace:(f,d)=>(d=d.source||d,d=d.replace(I,"$1"),S=S.replace(f,d),_),getRegex:()=>new RegExp(S,b)};return _}const p=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function h(S,b,_){if(S){let f;try{f=decodeURIComponent(O(_)).replace(p,"").toLowerCase()}catch(d){return null}if(f.indexOf("javascript:")===0||f.indexOf("vbscript:")===0||f.indexOf("data:")===0)return null}b&&!m.test(_)&&(_=s(b,_));try{_=encodeURI(_).replace(/%25/g,"%")}catch(f){return null}return _}const r={},n=/^[^:]+:\/*[^/]*$/,a=/^([^:]+:)[\s\S]*$/,l=/^([^:]+:\/*[^/]*)[\s\S]*$/;function s(S,b){r[" "+S]||(n.test(S)?r[" "+S]=S+"/":r[" "+S]=w(S,"/",!0)),S=r[" "+S];const _=S.indexOf(":")===-1;return b.substring(0,2)==="//"?_?b:S.replace(a,"$1")+b:b.charAt(0)==="/"?_?b:S.replace(l,"$1")+b:S+b}const u={exec:function(){}};function c(S){let b=1,_,f;for(;b<arguments.length;b++){_=arguments[b];for(f in _)Object.prototype.hasOwnProperty.call(_,f)&&(S[f]=_[f])}return S}function R(S,b){const _=S.replace(/\|/g,(g,E,T)=>{let F=!1,U=E;for(;--U>=0&&T[U]==="\\";)F=!F;return F?"|":" |"}),f=_.split(/ \|/);let d=0;if(f.length>b)f.splice(b);else for(;f.length<b;)f.push("");for(;d<f.length;d++)f[d]=f[d].trim().replace(/\\\|/g,"|");return f}function w(S,b,_){const f=S.length;if(f===0)return"";let d=0;for(;d<f;){const g=S.charAt(f-d-1);if(g===b&&!_)d++;else if(g!==b&&_)d++;else break}return S.substr(0,f-d)}function C(S,b){if(S.indexOf(b[1])===-1)return-1;const _=S.length;let f=0,d=0;for(;d<_;d++)if(S[d]==="\\")d++;else if(S[d]===b[0])f++;else if(S[d]===b[1]&&(f--,f<0))return d;return-1}function D(S){S&&S.sanitize&&!S.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")}Gt.exports={escape:P,unescape:O,edit:x,cleanUrl:h,resolveUrl:s,noopTest:u,merge:c,splitCells:R,rtrim:w,findClosingBracket:C,checkSanitizeDeprecation:D}},sR1s:function(Gt,et,k){"use strict";k.d(et,"b",function(){return G}),k.d(et,"a",function(){return L}),k.d(et,"c",function(){return P}),k.d(et,"d",function(){return H});var re=k("U8pU"),Y="RC_TABLE_KEY";function j(O){return O==null?[]:Array.isArray(O)?O:[O]}function G(O,I){if(!I&&typeof I!="number")return O;for(var x=j(I),p=O,m=0;m<x.length;m+=1){if(!p)return null;var h=x[m];p=p[h]}return p}function L(O){var I=[],x={};return O.forEach(function(p){for(var m=p||{},h=m.key,r=m.dataIndex,n=h||j(r).join("-")||Y;x[n];)n="".concat(n,"_next");x[n]=!0,I.push(n)}),I}function P(){var O={};function I(h,r){r&&Object.keys(r).forEach(function(n){var a=r[n];a&&Object(re.a)(a)==="object"?(h[n]=h[n]||{},I(h[n],a)):h[n]=a})}for(var x=arguments.length,p=new Array(x),m=0;m<x;m++)p[m]=arguments[m];return p.forEach(function(h){I(O,h)}),O}function H(O){return O!=null}},sboe:function(Gt,et,k){"use strict";k.d(et,"a",function(){return j});var re=k("q1tI"),Y=k.n(re),j=re.createContext(null)},t23M:function(Gt,et,k){"use strict";var re=k("VTBJ"),Y=k("1OyB"),j=k("vuIU"),G=k("Ji7U"),L=k("LK+K"),P=k("q1tI"),H=k.n(P),O=k("m+aA"),I=k("Zm9Q"),x=k("Kwbf"),p=k("c+Xe"),m=k("bdgK"),h="rc-observer-key",r=function(n){Object(G.a)(l,n);var a=Object(L.a)(l);function l(){var s;return Object(Y.a)(this,l),s=a.apply(this,arguments),s.resizeObserver=null,s.childNode=null,s.currentElement=null,s.state={width:0,height:0,offsetHeight:0,offsetWidth:0},s.onResize=function(u){var c=s.props.onResize,R=u[0].target,w=R.getBoundingClientRect(),C=w.width,D=w.height,S=R.offsetWidth,b=R.offsetHeight,_=Math.floor(C),f=Math.floor(D);if(s.state.width!==_||s.state.height!==f||s.state.offsetWidth!==S||s.state.offsetHeight!==b){var d={width:_,height:f,offsetWidth:S,offsetHeight:b};s.setState(d),c&&Promise.resolve().then(function(){c(Object(re.a)(Object(re.a)({},d),{},{offsetWidth:S,offsetHeight:b}))})}},s.setChildNode=function(u){s.childNode=u},s}return Object(j.a)(l,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var u=this.props.disabled;if(u){this.destroyObserver();return}var c=Object(O.a)(this.childNode||this),R=c!==this.currentElement;R&&(this.destroyObserver(),this.currentElement=c),!this.resizeObserver&&c&&(this.resizeObserver=new m.default(this.onResize),this.resizeObserver.observe(c))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var u=this.props.children,c=Object(I.a)(u);if(c.length>1)Object(x.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(c.length===0)return Object(x.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var R=c[0];if(P.isValidElement(R)&&Object(p.c)(R)){var w=R.ref;c[0]=P.cloneElement(R,{ref:Object(p.a)(w,this.setChildNode)})}return c.length===1?c[0]:c.map(function(C,D){return!P.isValidElement(C)||"key"in C&&C.key!==null?C:P.cloneElement(C,{key:"".concat(h,"-").concat(D)})})}}]),l}(P.Component);r.displayName="ResizeObserver",et.a=r},ulZh:function(Gt,et,k){typeof window!="undefined"&&function(Y,j){Gt.exports=j()}(this,function(){return function(re){var Y={};function j(G){if(Y[G])return Y[G].exports;var L=Y[G]={i:G,l:!1,exports:{}};return re[G].call(L.exports,L,L.exports,j),L.l=!0,L.exports}return j.m=re,j.c=Y,j.d=function(G,L,P){j.o(G,L)||Object.defineProperty(G,L,{enumerable:!0,get:P})},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,L){if(L&1&&(G=j(G)),L&8)return G;if(L&4&&typeof G=="object"&&G&&G.__esModule)return G;var P=Object.create(null);if(j.r(P),Object.defineProperty(P,"default",{enumerable:!0,value:G}),L&2&&typeof G!="string")for(var H in G)j.d(P,H,function(O){return G[O]}.bind(null,H));return P},j.n=function(G){var L=G&&G.__esModule?function(){return G.default}:function(){return G};return j.d(L,"a",L),L},j.o=function(G,L){return Object.prototype.hasOwnProperty.call(G,L)},j.p="/dist/",j(j.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(re,Y,j){"use strict";var G=Object.prototype.hasOwnProperty,L="~";function P(){}Object.create&&(P.prototype=Object.create(null),new P().__proto__||(L=!1));function H(p,m,h){this.fn=p,this.context=m,this.once=h||!1}function O(p,m,h,r,n){if(typeof h!="function")throw new TypeError("The listener must be a function");var a=new H(h,r||p,n),l=L?L+m:m;return p._events[l]?p._events[l].fn?p._events[l]=[p._events[l],a]:p._events[l].push(a):(p._events[l]=a,p._eventsCount++),p}function I(p,m){--p._eventsCount===0?p._events=new P:delete p._events[m]}function x(){this._events=new P,this._eventsCount=0}x.prototype.eventNames=function(){var m=[],h,r;if(this._eventsCount===0)return m;for(r in h=this._events)G.call(h,r)&&m.push(L?r.slice(1):r);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(h)):m},x.prototype.listeners=function(m){var h=L?L+m:m,r=this._events[h];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,a=r.length,l=new Array(a);n<a;n++)l[n]=r[n].fn;return l},x.prototype.listenerCount=function(m){var h=L?L+m:m,r=this._events[h];return r?r.fn?1:r.length:0},x.prototype.emit=function(m,h,r,n,a,l){var s=L?L+m:m;if(!this._events[s])return!1;var u=this._events[s],c=arguments.length,R,w;if(u.fn){u.once&&this.removeListener(m,u.fn,void 0,!0);switch(c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,h),!0;case 3:return u.fn.call(u.context,h,r),!0;case 4:return u.fn.call(u.context,h,r,n),!0;case 5:return u.fn.call(u.context,h,r,n,a),!0;case 6:return u.fn.call(u.context,h,r,n,a,l),!0}for(w=1,R=new Array(c-1);w<c;w++)R[w-1]=arguments[w];u.fn.apply(u.context,R)}else{var C=u.length,D;for(w=0;w<C;w++){u[w].once&&this.removeListener(m,u[w].fn,void 0,!0);switch(c){case 1:u[w].fn.call(u[w].context);break;case 2:u[w].fn.call(u[w].context,h);break;case 3:u[w].fn.call(u[w].context,h,r);break;case 4:u[w].fn.call(u[w].context,h,r,n);break;default:if(!R)for(D=1,R=new Array(c-1);D<c;D++)R[D-1]=arguments[D];u[w].fn.apply(u[w].context,R)}}}return!0},x.prototype.on=function(m,h,r){return O(this,m,h,r,!1)},x.prototype.once=function(m,h,r){return O(this,m,h,r,!0)},x.prototype.removeListener=function(m,h,r,n){var a=L?L+m:m;if(!this._events[a])return this;if(!h)return I(this,a),this;var l=this._events[a];if(l.fn)l.fn===h&&(!n||l.once)&&(!r||l.context===r)&&I(this,a);else{for(var s=0,u=[],c=l.length;s<c;s++)(l[s].fn!==h||n&&!l[s].once||r&&l[s].context!==r)&&u.push(l[s]);u.length?this._events[a]=u.length===1?u[0]:u:I(this,a)}return this},x.prototype.removeAllListeners=function(m){var h;return m?(h=L?L+m:m,this._events[h]&&I(this,h)):(this._events=new P,this._eventsCount=0),this},x.prototype.off=x.prototype.removeListener,x.prototype.addListener=x.prototype.on,x.prefixed=L,x.EventEmitter=x,re.exports=x},"./node_modules/url-toolkit/src/url-toolkit.js":function(re,Y,j){(function(G){var L=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,P=/^([^\/?#]*)([^]*)$/,H=/(?:\/|^)\.(?=\/)/g,O=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,I={buildAbsoluteURL:function(x,p,m){if(m=m||{},x=x.trim(),p=p.trim(),!p){if(!m.alwaysNormalize)return x;var h=I.parseURL(x);if(!h)throw new Error("Error trying to parse base URL.");return h.path=I.normalizePath(h.path),I.buildURLFromParts(h)}var r=I.parseURL(p);if(!r)throw new Error("Error trying to parse relative URL.");if(r.scheme)return m.alwaysNormalize?(r.path=I.normalizePath(r.path),I.buildURLFromParts(r)):p;var n=I.parseURL(x);if(!n)throw new Error("Error trying to parse base URL.");if(!n.netLoc&&n.path&&n.path[0]!=="/"){var a=P.exec(n.path);n.netLoc=a[1],n.path=a[2]}n.netLoc&&!n.path&&(n.path="/");var l={scheme:n.scheme,netLoc:r.netLoc,path:null,params:r.params,query:r.query,fragment:r.fragment};if(!r.netLoc&&(l.netLoc=n.netLoc,r.path[0]!=="/"))if(!r.path)l.path=n.path,r.params||(l.params=n.params,r.query||(l.query=n.query));else{var s=n.path,u=s.substring(0,s.lastIndexOf("/")+1)+r.path;l.path=I.normalizePath(u)}return l.path===null&&(l.path=m.alwaysNormalize?I.normalizePath(r.path):r.path),I.buildURLFromParts(l)},parseURL:function(x){var p=L.exec(x);return p?{scheme:p[1]||"",netLoc:p[2]||"",path:p[3]||"",params:p[4]||"",query:p[5]||"",fragment:p[6]||""}:null},normalizePath:function(x){for(x=x.split("").reverse().join("").replace(H,"");x.length!==(x=x.replace(O,"")).length;);return x.split("").reverse().join("")},buildURLFromParts:function(x){return x.scheme+x.netLoc+x.path+x.params+x.query+x.fragment}};re.exports=I})(this)},"./node_modules/webworkify-webpack/index.js":function(re,Y,j){function G(m){var h={};function r(a){if(h[a])return h[a].exports;var l=h[a]={i:a,l:!1,exports:{}};return m[a].call(l.exports,l,l.exports,r),l.l=!0,l.exports}r.m=m,r.c=h,r.i=function(a){return a},r.d=function(a,l,s){r.o(a,l)||Object.defineProperty(a,l,{configurable:!1,enumerable:!0,get:s})},r.r=function(a){Object.defineProperty(a,"__esModule",{value:!0})},r.n=function(a){var l=a&&a.__esModule?function(){return a.default}:function(){return a};return r.d(l,"a",l),l},r.o=function(a,l){return Object.prototype.hasOwnProperty.call(a,l)},r.p="/",r.oe=function(a){throw console.error(a),a};var n=r(r.s=ENTRY_MODULE);return n.default||n}var L="[\\.|\\-|\\+|\\w|/|@]+",P="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+L+").*?\\)";function H(m){return(m+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function O(m){return!isNaN(1*m)}function I(m,h,r){var n={};n[r]=[];var a=h.toString(),l=a.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!l)return n;for(var s=l[1],u=new RegExp("(\\\\n|\\W)"+H(s)+P,"g"),c;c=u.exec(a);){if(c[3]==="dll-reference")continue;n[r].push(c[3])}for(u=new RegExp("\\("+H(s)+'\\("(dll-reference\\s('+L+'))"\\)\\)'+P,"g");c=u.exec(a);)m[c[2]]||(n[r].push(c[1]),m[c[2]]=j(c[1]).m),n[c[2]]=n[c[2]]||[],n[c[2]].push(c[4]);for(var R=Object.keys(n),w=0;w<R.length;w++)for(var C=0;C<n[R[w]].length;C++)O(n[R[w]][C])&&(n[R[w]][C]=1*n[R[w]][C]);return n}function x(m){var h=Object.keys(m);return h.reduce(function(r,n){return r||m[n].length>0},!1)}function p(m,h){for(var r={main:[h]},n={main:[]},a={main:{}};x(r);)for(var l=Object.keys(r),s=0;s<l.length;s++){var u=l[s],c=r[u],R=c.pop();if(a[u]=a[u]||{},a[u][R]||!m[u][R])continue;a[u][R]=!0,n[u]=n[u]||[],n[u].push(R);for(var w=I(m,m[u][R],u),C=Object.keys(w),D=0;D<C.length;D++)r[C[D]]=r[C[D]]||[],r[C[D]]=r[C[D]].concat(w[C[D]])}return n}re.exports=function(m,h){h=h||{};var r={main:j.m},n=h.all?{main:Object.keys(r.main)}:p(r,m),a="";Object.keys(n).filter(function(R){return R!=="main"}).forEach(function(R){for(var w=0;n[R][w];)w++;n[R].push(w),r[R][w]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",a=a+"var "+R+" = ("+G.toString().replace("ENTRY_MODULE",JSON.stringify(w))+")({"+n[R].map(function(C){return""+JSON.stringify(C)+": "+r[R][C].toString()}).join(",")+`});
`}),a=a+"new (("+G.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+n.main.map(function(R){return""+JSON.stringify(R)+": "+r.main[R].toString()}).join(",")+"}))(self);";var l=new window.Blob([a],{type:"text/javascript"});if(h.bare)return l;var s=window.URL||window.webkitURL||window.mozURL||window.msURL,u=s.createObjectURL(l),c=new window.Worker(u);return c.objectURL=u,c}},"./src/config.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"hlsDefaultConfig",function(){return D}),j.d(Y,"mergeConfig",function(){return b}),j.d(Y,"enableStreamingMode",function(){return _});var G=j("./src/controller/abr-controller.ts"),L=j("./src/controller/audio-stream-controller.ts"),P=j("./src/controller/audio-track-controller.ts"),H=j("./src/controller/subtitle-stream-controller.ts"),O=j("./src/controller/subtitle-track-controller.ts"),I=j("./src/controller/buffer-controller.ts"),x=j("./src/controller/timeline-controller.ts"),p=j("./src/controller/cap-level-controller.ts"),m=j("./src/controller/fps-controller.ts"),h=j("./src/controller/eme-controller.ts"),r=j("./src/controller/cmcd-controller.ts"),n=j("./src/utils/xhr-loader.ts"),a=j("./src/utils/fetch-loader.ts"),l=j("./src/utils/cues.ts"),s=j("./src/utils/mediakeys-helper.ts"),u=j("./src/utils/logger.ts");function c(){return c=Object.assign||function(f){for(var d=1;d<arguments.length;d++){var g=arguments[d];for(var E in g)Object.prototype.hasOwnProperty.call(g,E)&&(f[E]=g[E])}return f},c.apply(this,arguments)}function R(f,d){var g=Object.keys(f);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(f);d&&(E=E.filter(function(T){return Object.getOwnPropertyDescriptor(f,T).enumerable})),g.push.apply(g,E)}return g}function w(f){for(var d=1;d<arguments.length;d++){var g=arguments[d]!=null?arguments[d]:{};d%2?R(Object(g),!0).forEach(function(E){C(f,E,g[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(g)):R(Object(g)).forEach(function(E){Object.defineProperty(f,E,Object.getOwnPropertyDescriptor(g,E))})}return f}function C(f,d,g){return d in f?Object.defineProperty(f,d,{value:g,enumerable:!0,configurable:!0,writable:!0}):f[d]=g,f}var D=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:n.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:G.default,bufferController:I.default,capLevelController:p.default,fpsController:m.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:s.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},S()),{},{subtitleStreamController:H.SubtitleStreamController,subtitleTrackController:O.default,timelineController:x.TimelineController,audioStreamController:L.default,audioTrackController:P.default,emeController:h.default,cmcdController:r.default});function S(){return{cueHandler:l.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 b(f,d){if((d.liveSyncDurationCount||d.liveMaxLatencyDurationCount)&&(d.liveSyncDuration||d.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(d.liveMaxLatencyDurationCount!==void 0&&(d.liveSyncDurationCount===void 0||d.liveMaxLatencyDurationCount<=d.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(d.liveMaxLatencyDuration!==void 0&&(d.liveSyncDuration===void 0||d.liveMaxLatencyDuration<=d.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return c({},f,d)}function _(f){var d=f.loader;if(d!==a.default&&d!==n.default)u.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),f.progressive=!1;else{var g=Object(a.fetchSupported)();g&&(f.loader=a.default,f.progressive=!0,f.enableSoftwareAES=!0,u.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(re,Y,j){"use strict";j.r(Y);var G=j("./src/polyfills/number.ts"),L=j("./src/utils/ewma-bandwidth-estimator.ts"),P=j("./src/events.ts"),H=j("./src/utils/buffer-helper.ts"),O=j("./src/errors.ts"),I=j("./src/types/loader.ts"),x=j("./src/utils/logger.ts");function p(r,n){for(var a=0;a<n.length;a++){var l=n[a];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(r,l.key,l)}}function m(r,n,a){return n&&p(r.prototype,n),a&&p(r,a),r}var h=function(){function r(a){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=a;var l=a.config;this.bwEstimator=new L.default(l.abrEwmaSlowVoD,l.abrEwmaFastVoD,l.abrEwmaDefaultEstimate),this.registerListeners()}var n=r.prototype;return n.registerListeners=function(){var l=this.hls;l.on(P.Events.FRAG_LOADING,this.onFragLoading,this),l.on(P.Events.FRAG_LOADED,this.onFragLoaded,this),l.on(P.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.on(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.on(P.Events.ERROR,this.onError,this)},n.unregisterListeners=function(){var l=this.hls;l.off(P.Events.FRAG_LOADING,this.onFragLoading,this),l.off(P.Events.FRAG_LOADED,this.onFragLoaded,this),l.off(P.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.off(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.off(P.Events.ERROR,this.onError,this)},n.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},n.onFragLoading=function(l,s){var u=s.frag;if(u.type===I.PlaylistLevelType.MAIN&&!this.timer){var c;this.fragCurrent=u,this.partCurrent=(c=s.part)!=null?c:null,this.timer=self.setInterval(this.onCheck,100)}},n.onLevelLoaded=function(l,s){var u=this.hls.config;s.details.live?this.bwEstimator.update(u.abrEwmaSlowLive,u.abrEwmaFastLive):this.bwEstimator.update(u.abrEwmaSlowVoD,u.abrEwmaFastVoD)},n._abandonRulesCheck=function(){var l=this.fragCurrent,s=this.partCurrent,u=this.hls,c=u.autoLevelEnabled,R=u.config,w=u.media;if(!l||!w)return;var C=s?s.stats:l.stats,D=s?s.duration:l.duration;if(C.aborted){x.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!c||w.paused||!w.playbackRate||!w.readyState)return;var S=performance.now()-C.loading.start,b=Math.abs(w.playbackRate);if(S<=500*D/b)return;var _=u.levels,f=u.minAutoLevel,d=_[l.level],g=C.total||Math.max(C.loaded,Math.round(D*d.maxBitrate/8)),E=Math.max(1,C.bwEstimate?C.bwEstimate/8:C.loaded*1e3/S),T=(g-C.loaded)/E,F=w.currentTime,U=(H.BufferHelper.bufferInfo(w,F,R.maxBufferHole).end-F)/b;if(U>=2*D/b||T<=U)return;var K=Number.POSITIVE_INFINITY,z;for(z=l.level-1;z>f;z--){var M=_[z].maxBitrate;if(K=D*M/(8*.8*E),K<U)break}if(K>=T)return;var y=this.bwEstimator.getEstimate();x.logger.warn("Fragment "+l.sn+(s?" part "+s.index:"")+" of level "+l.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+z+`
Current BW estimate: `+(Object(G.isFiniteNumber)(y)?(y/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+T.toFixed(3)+` s
Estimated load time for the next fragment: `+K.toFixed(3)+` s
Time to underbuffer: `+U.toFixed(3)+" s"),u.nextLoadLevel=z,this.bwEstimator.sample(S,C.loaded),this.clearTimer(),l.loader&&(this.fragCurrent=this.partCurrent=null,l.loader.abort()),u.trigger(P.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:l,part:s,stats:C})},n.onFragLoaded=function(l,s){var u=s.frag,c=s.part;if(u.type===I.PlaylistLevelType.MAIN&&Object(G.isFiniteNumber)(u.sn)){var R=c?c.stats:u.stats,w=c?c.duration:u.duration;if(this.clearTimer(),this.lastLoadedFragLevel=u.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var C=this.hls.levels[u.level],D=(C.loaded?C.loaded.bytes:0)+R.loaded,S=(C.loaded?C.loaded.duration:0)+w;C.loaded={bytes:D,duration:S},C.realBitrate=Math.round(8*D/S)}if(u.bitrateTest){var b={stats:R,frag:u,part:c,id:u.type};this.onFragBuffered(P.Events.FRAG_BUFFERED,b),u.bitrateTest=!1}}},n.onFragBuffered=function(l,s){var u=s.frag,c=s.part,R=c?c.stats:u.stats;if(R.aborted)return;if(u.type!==I.PlaylistLevelType.MAIN||u.sn==="initSegment")return;var w=R.parsing.end-R.loading.start;this.bwEstimator.sample(w,R.loaded),R.bwEstimate=this.bwEstimator.getEstimate(),u.bitrateTest?this.bitrateTestDelay=w/1e3:this.bitrateTestDelay=0},n.onError=function(l,s){switch(s.details){case O.ErrorDetails.FRAG_LOAD_ERROR:case O.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},n.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},n.getNextABRAutoLevel=function(){var l=this.fragCurrent,s=this.partCurrent,u=this.hls,c=u.maxAutoLevel,R=u.config,w=u.minAutoLevel,C=u.media,D=s?s.duration:l?l.duration:0,S=C?C.currentTime:0,b=C&&C.playbackRate!==0?Math.abs(C.playbackRate):1,_=this.bwEstimator?this.bwEstimator.getEstimate():R.abrEwmaDefaultEstimate,f=(H.BufferHelper.bufferInfo(C,S,R.maxBufferHole).end-S)/b,d=this.findBestLevel(_,w,c,f,R.abrBandWidthFactor,R.abrBandWidthUpFactor);if(d>=0)return d;x.logger.trace((f?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var g=D?Math.min(D,R.maxStarvationDelay):R.maxStarvationDelay,E=R.abrBandWidthFactor,T=R.abrBandWidthUpFactor;if(!f){var F=this.bitrateTestDelay;if(F){var U=D?Math.min(D,R.maxLoadingDelay):R.maxLoadingDelay;g=U-F,x.logger.trace("bitrate test took "+Math.round(1e3*F)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*g)+" ms"),E=T=1}}return d=this.findBestLevel(_,w,c,f+g,E,T),Math.max(d,0)},n.findBestLevel=function(l,s,u,c,R,w){for(var C,D=this.fragCurrent,S=this.partCurrent,b=this.lastLoadedFragLevel,_=this.hls.levels,f=_[b],d=!!(f!=null&&(C=f.details)!==null&&C!==void 0&&C.live),g=f==null?void 0:f.codecSet,E=S?S.duration:D?D.duration:0,T=u;T>=s;T--){var F=_[T];if(!F||g&&F.codecSet!==g)continue;var U=F.details,K=(S?U==null?void 0:U.partTarget:U==null?void 0:U.averagetargetduration)||E,z=void 0;T<=b?z=R*l:z=w*l;var M=_[T].maxBitrate,y=M*K/z;if(x.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+T+"/"+Math.round(z)+"/"+M+"/"+K+"/"+c+"/"+y),z>M&&(!y||d&&!this.bitrateTestDelay||y<c))return T}return-1},m(r,[{key:"nextAutoLevel",get:function(){var l=this._nextAutoLevel,s=this.bwEstimator;if(l!==-1&&(!s||!s.canEstimate()))return l;var u=this.getNextABRAutoLevel();return l!==-1&&(u=Math.min(l,u)),u},set:function(l){this._nextAutoLevel=l}}]),r}();Y.default=h},"./src/controller/audio-stream-controller.ts":function(re,Y,j){"use strict";j.r(Y);var G=j("./src/polyfills/number.ts"),L=j("./src/controller/base-stream-controller.ts"),P=j("./src/events.ts"),H=j("./src/utils/buffer-helper.ts"),O=j("./src/controller/fragment-tracker.ts"),I=j("./src/types/level.ts"),x=j("./src/types/loader.ts"),p=j("./src/loader/fragment.ts"),m=j("./src/demux/chunk-cache.ts"),h=j("./src/demux/transmuxer-interface.ts"),r=j("./src/types/transmuxer.ts"),n=j("./src/controller/fragment-finders.ts"),a=j("./src/utils/discontinuities.ts"),l=j("./src/errors.ts"),s=j("./src/utils/logger.ts");function u(){return u=Object.assign||function(D){for(var S=1;S<arguments.length;S++){var b=arguments[S];for(var _ in b)Object.prototype.hasOwnProperty.call(b,_)&&(D[_]=b[_])}return D},u.apply(this,arguments)}function c(D,S){D.prototype=Object.create(S.prototype),D.prototype.constructor=D,R(D,S)}function R(D,S){return R=Object.setPrototypeOf||function(_,f){return _.__proto__=f,_},R(D,S)}var w=100,C=function(D){c(S,D);function S(_,f){var d;return d=D.call(this,_,f,"[audio-stream-controller]")||this,d.videoBuffer=null,d.videoTrackCC=-1,d.waitingVideoCC=-1,d.audioSwitch=!1,d.trackId=-1,d.waitingData=null,d.mainDetails=null,d.bufferFlushed=!1,d._registerListeners(),d}var b=S.prototype;return b.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},b._registerListeners=function(){var f=this.hls;f.on(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.on(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.on(P.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),f.on(P.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),f.on(P.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),f.on(P.Events.ERROR,this.onError,this),f.on(P.Events.BUFFER_RESET,this.onBufferReset,this),f.on(P.Events.BUFFER_CREATED,this.onBufferCreated,this),f.on(P.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),f.on(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),f.on(P.Events.FRAG_BUFFERED,this.onFragBuffered,this)},b._unregisterListeners=function(){var f=this.hls;f.off(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.off(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.off(P.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),f.off(P.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),f.off(P.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),f.off(P.Events.ERROR,this.onError,this),f.off(P.Events.BUFFER_RESET,this.onBufferReset,this),f.off(P.Events.BUFFER_CREATED,this.onBufferCreated,this),f.off(P.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),f.off(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),f.off(P.Events.FRAG_BUFFERED,this.onFragBuffered,this)},b.onInitPtsFound=function(f,d){var g=d.frag,E=d.id,T=d.initPTS;if(E==="main"){var F=g.cc;this.initPTS[g.cc]=T,this.log("InitPTS for cc: "+F+" found from main: "+T),this.videoTrackCC=F,this.state===L.State.WAITING_INIT_PTS&&this.tick()}},b.startLoad=function(f){if(!this.levels){this.startPosition=f,this.state=L.State.STOPPED;return}var d=this.lastCurrentTime;this.stopLoad(),this.setInterval(w),this.fragLoadError=0,d>0&&f===-1?(this.log("Override startPosition with lastCurrentTime @"+d.toFixed(3)),this.state=L.State.IDLE):(this.loadedmetadata=!1,this.state=L.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=f,this.tick()},b.doTick=function(){switch(this.state){case L.State.IDLE:this.doTickIdle();break;case L.State.WAITING_TRACK:{var f,d=this.levels,g=this.trackId,E=d==null||((f=d[g])===null||f===void 0)?void 0:f.details;if(E){if(this.waitForCdnTuneIn(E))break;this.state=L.State.WAITING_INIT_PTS}break}case L.State.FRAG_LOADING_WAITING_RETRY:{var T,F=performance.now(),U=this.retryDate;(!U||F>=U||(T=this.media)!==null&&T!==void 0&&T.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=L.State.IDLE);break}case L.State.WAITING_INIT_PTS:{var K=this.waitingData;if(K){var z=K.frag,M=K.part,y=K.cache,W=K.complete;if(this.initPTS[z.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=L.State.FRAG_LOADING;var X=y.flush(),te={frag:z,part:M,payload:X,networkDetails:null};this._handleFragmentLoadProgress(te),W&&D.prototype._handleFragmentLoadComplete.call(this,te)}else if(this.videoTrackCC!==this.waitingVideoCC)s.logger.log("Waiting fragment cc ("+z.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var pe=this.getLoadPosition(),Ie=H.BufferHelper.bufferInfo(this.mediaBuffer,pe,this.config.maxBufferHole),Ee=Object(n.fragmentWithinToleranceTest)(Ie.end,this.config.maxFragLookUpTolerance,z);Ee<0&&(s.logger.log("Waiting fragment cc ("+z.cc+") @ "+z.start+" cancelled because another fragment at "+Ie.end+" is needed"),this.clearWaitingFragment())}}else this.state=L.State.IDLE}}this.onTickEnd()},b.clearWaitingFragment=function(){var f=this.waitingData;f&&(this.fragmentTracker.removeFragment(f.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=L.State.IDLE)},b.onTickEnd=function(){var f=this.media;if(!f||!f.readyState)return;var d=this.mediaBuffer?this.mediaBuffer:f,g=d.buffered;!this.loadedmetadata&&g.length&&(this.loadedmetadata=!0),this.lastCurrentTime=f.currentTime},b.doTickIdle=function(){var f,d,g=this.hls,E=this.levels,T=this.media,F=this.trackId,U=g.config;if(!E||!E[F])return;if(!T&&(this.startFragRequested||!U.startFragPrefetch))return;var K=E[F],z=K.details;if(!z||z.live&&this.levelLastLoaded!==F||this.waitForCdnTuneIn(z)){this.state=L.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,p.ElementaryStreamTypes.AUDIO,x.PlaylistLevelType.AUDIO));var M=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,x.PlaylistLevelType.AUDIO);if(M===null)return;var y=M.len,W=this.getMaxBufferLength(),X=this.audioSwitch;if(y>=W&&!X)return;if(!X&&this._streamEnded(M,z)){g.trigger(P.Events.BUFFER_EOS,{type:"audio"}),this.state=L.State.ENDED;return}var te=z.fragments,pe=te[0].start,Ie=M.end;if(X){var Ee=this.getLoadPosition();Ie=Ee,z.PTSKnown&&Ee<pe&&((M.end>pe||M.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),T.currentTime=pe+.05))}var Te=this.getNextFragment(Ie,z);if(!Te){this.bufferFlushed=!0;return}((f=Te.decryptdata)===null||f===void 0?void 0:f.keyFormat)==="identity"&&!((d=Te.decryptdata)!==null&&d!==void 0&&d.key)?this.loadKey(Te,z):this.loadFragment(Te,z,Ie)},b.getMaxBufferLength=function(){var f=D.prototype.getMaxBufferLength.call(this),d=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,x.PlaylistLevelType.MAIN);return d===null?f:Math.max(f,d.len)},b.onMediaDetaching=function(){this.videoBuffer=null,D.prototype.onMediaDetaching.call(this)},b.onAudioTracksUpdated=function(f,d){var g=d.audioTracks;this.resetTransmuxer(),this.levels=g.map(function(E){return new I.Level(E)})},b.onAudioTrackSwitching=function(f,d){var g=!!d.url;this.trackId=d.id;var E=this.fragCurrent;E!=null&&E.loader&&E.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),g?this.setInterval(w):this.resetTransmuxer(),g?(this.audioSwitch=!0,this.state=L.State.IDLE):this.state=L.State.STOPPED,this.tick()},b.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},b.onLevelLoaded=function(f,d){this.mainDetails=d.details},b.onAudioTrackLoaded=function(f,d){var g,E=this.levels,T=d.details,F=d.id;if(!E){this.warn("Audio tracks were reset while loading level "+F);return}this.log("Track "+F+" loaded ["+T.startSN+","+T.endSN+"],duration:"+T.totalduration);var U=E[F],K=0;if(T.live||(g=U.details)!==null&&g!==void 0&&g.live){var z=this.mainDetails;if(T.fragments[0]||(T.deltaUpdateFailed=!0),T.deltaUpdateFailed||!z)return;!U.details&&T.hasProgramDateTime&&z.hasProgramDateTime?(Object(a.alignMediaPlaylistByPDT)(T,z),K=T.fragments[0].start):K=this.alignPlaylists(T,U.details)}U.details=T,this.levelLastLoaded=F,!this.startFragRequested&&(this.mainDetails||!T.live)&&this.setStartPosition(U.details,K),this.state===L.State.WAITING_TRACK&&!this.waitForCdnTuneIn(T)&&(this.state=L.State.IDLE),this.tick()},b._handleFragmentLoadProgress=function(f){var d,g=f.frag,E=f.part,T=f.payload,F=this.config,U=this.trackId,K=this.levels;if(!K){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+g.sn+" of level "+g.level+" will not be buffered");return}var z=K[U];console.assert(z,"Audio track is defined on fragment load progress");var M=z.details;console.assert(M,"Audio track details are defined on fragment load progress");var y=F.defaultAudioCodec||z.audioCodec||"mp4a.40.2",W=this.transmuxer;W||(W=this.transmuxer=new h.default(this.hls,x.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var X=this.initPTS[g.cc],te=(d=g.initSegment)===null||d===void 0?void 0:d.data;if(X!==void 0){var pe=!1,Ie=E?E.index:-1,Ee=Ie!==-1,Te=new r.ChunkMetadata(g.level,g.sn,g.stats.chunkCount,T.byteLength,Ie,Ee);W.push(T,te,y,"",g,E,M.totalduration,pe,Te,X)}else{s.logger.log("Unknown video PTS for cc "+g.cc+", waiting for video PTS before demuxing audio frag "+g.sn+" of ["+M.startSN+" ,"+M.endSN+"],track "+U);var We=this.waitingData=this.waitingData||{frag:g,part:E,cache:new m.default,complete:!1},He=We.cache;He.push(new Uint8Array(T)),this.waitingVideoCC=this.videoTrackCC,this.state=L.State.WAITING_INIT_PTS}},b._handleFragmentLoadComplete=function(f){if(this.waitingData){this.waitingData.complete=!0;return}D.prototype._handleFragmentLoadComplete.call(this,f)},b.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},b.onBufferCreated=function(f,d){var g=d.tracks.audio;g&&(this.mediaBuffer=g.buffer),d.tracks.video&&(this.videoBuffer=d.tracks.video.buffer)},b.onFragBuffered=function(f,d){var g=d.frag,E=d.part;if(g.type!==x.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(g)){this.warn("Fragment "+g.sn+(E?" p: "+E.index:"")+" of level "+g.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}g.sn!=="initSegment"&&(this.fragPrevious=g,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(P.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(g,E)},b.onError=function(f,d){switch(d.details){case l.ErrorDetails.FRAG_LOAD_ERROR:case l.ErrorDetails.FRAG_LOAD_TIMEOUT:case l.ErrorDetails.KEY_LOAD_ERROR:case l.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(x.PlaylistLevelType.AUDIO,d);break;case l.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case l.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==L.State.ERROR&&this.state!==L.State.STOPPED&&(this.state=d.fatal?L.State.ERROR:L.State.IDLE,this.warn(d.details+" while loading frag, switching to "+this.state+" state"));break;case l.ErrorDetails.BUFFER_FULL_ERROR:if(d.parent==="audio"&&(this.state===L.State.PARSING||this.state===L.State.PARSED)){var g=!0,E=this.getFwdBufferInfo(this.mediaBuffer,x.PlaylistLevelType.AUDIO);E&&E.len>.5&&(g=!this.reduceMaxBufferLength(E.len)),g&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,D.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},b.onBufferFlushed=function(f,d){var g=d.type;g===p.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},b._handleTransmuxComplete=function(f){var d,g="audio",E=this.hls,T=f.remuxResult,F=f.chunkMeta,U=this.getCurrentContext(F);if(!U){this.warn("The loading context changed while buffering fragment "+F.sn+" of level "+F.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(F.level);return}var K=U.frag,z=U.part,M=T.audio,y=T.text,W=T.id3,X=T.initSegment;if(this.fragContextChanged(K))return;if(this.state=L.State.PARSING,this.audioSwitch&&M&&this.completeAudioSwitch(),X!=null&&X.tracks&&(this._bufferInitSegment(X.tracks,K,F),E.trigger(P.Events.FRAG_PARSING_INIT_SEGMENT,{frag:K,id:g,tracks:X.tracks})),M){var te=M.startPTS,pe=M.endPTS,Ie=M.startDTS,Ee=M.endDTS;z&&(z.elementaryStreams[p.ElementaryStreamTypes.AUDIO]={startPTS:te,endPTS:pe,startDTS:Ie,endDTS:Ee}),K.setElementaryStreamInfo(p.ElementaryStreamTypes.AUDIO,te,pe,Ie,Ee),this.bufferFragmentData(M,K,z,F)}if(W!=null&&(d=W.samples)!==null&&d!==void 0&&d.length){var Te=u({frag:K,id:g},W);E.trigger(P.Events.FRAG_PARSING_METADATA,Te)}if(y){var We=u({frag:K,id:g},y);E.trigger(P.Events.FRAG_PARSING_USERDATA,We)}},b._bufferInitSegment=function(f,d,g){if(this.state!==L.State.PARSING)return;f.video&&delete f.video;var E=f.audio;if(!E)return;E.levelCodec=E.codec,E.id="audio",this.log("Init audio buffer, container:"+E.container+", codecs[parsed]=["+E.codec+"]"),this.hls.trigger(P.Events.BUFFER_CODECS,f);var T=E.initSegment;if(T!=null&&T.byteLength){var F={type:"audio",frag:d,part:null,chunkMeta:g,parent:d.type,data:T};this.hls.trigger(P.Events.BUFFER_APPENDING,F)}this.tick()},b.loadFragment=function(f,d,g){var E=this.fragmentTracker.getState(f);this.fragCurrent=f,(this.audioSwitch||E===O.FragmentState.NOT_LOADED||E===O.FragmentState.PARTIAL)&&(f.sn==="initSegment"?this._loadInitSegment(f):d.live&&!Object(G.isFiniteNumber)(this.initPTS[f.cc])?(this.log("Waiting for video PTS in continuity counter "+f.cc+" of live stream before loading audio fragment "+f.sn+" of level "+this.trackId),this.state=L.State.WAITING_INIT_PTS):(this.startFragRequested=!0,D.prototype.loadFragment.call(this,f,d,g)))},b.completeAudioSwitch=function(){var f=this.hls,d=this.media,g=this.trackId;d&&(this.log("Switching audio track : flushing all audio"),D.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,f.trigger(P.Events.AUDIO_TRACK_SWITCHED,{id:g})},S}(L.default);Y.default=C},"./src/controller/audio-track-controller.ts":function(re,Y,j){"use strict";j.r(Y);var G=j("./src/events.ts"),L=j("./src/errors.ts"),P=j("./src/controller/base-playlist-controller.ts"),H=j("./src/types/loader.ts");function O(h,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(h,a.key,a)}}function I(h,r,n){return r&&O(h.prototype,r),n&&O(h,n),h}function x(h,r){h.prototype=Object.create(r.prototype),h.prototype.constructor=h,p(h,r)}function p(h,r){return p=Object.setPrototypeOf||function(a,l){return a.__proto__=l,a},p(h,r)}var m=function(h){x(r,h);function r(a){var l;return l=h.call(this,a,"[audio-track-controller]")||this,l.tracks=[],l.groupId=null,l.tracksInGroup=[],l.trackId=-1,l.trackName="",l.selectDefaultTrack=!0,l.registerListeners(),l}var n=r.prototype;return n.registerListeners=function(){var l=this.hls;l.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on(G.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on(G.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.on(G.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.on(G.Events.ERROR,this.onError,this)},n.unregisterListeners=function(){var l=this.hls;l.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off(G.Events.LEVEL_LOADING,this.onLevelLoading,this),l.off(G.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.off(G.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.off(G.Events.ERROR,this.onError,this)},n.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,h.prototype.destroy.call(this)},n.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},n.onManifestParsed=function(l,s){this.tracks=s.audioTracks||[]},n.onAudioTrackLoaded=function(l,s){var u=s.id,c=s.details,R=this.tracksInGroup[u];if(!R){this.warn("Invalid audio track id "+u);return}var w=R.details;R.details=s.details,this.log("audioTrack "+u+" loaded ["+c.startSN+"-"+c.endSN+"]"),u===this.trackId&&(this.retryCount=0,this.playlistLoaded(u,s,w))},n.onLevelLoading=function(l,s){this.switchLevel(s.level)},n.onLevelSwitching=function(l,s){this.switchLevel(s.level)},n.switchLevel=function(l){var s=this.hls.levels[l];if(!(s!=null&&s.audioGroupIds))return;var u=s.audioGroupIds[s.urlId];if(this.groupId!==u){this.groupId=u;var c=this.tracks.filter(function(w){return!u||w.groupId===u});this.selectDefaultTrack&&!c.some(function(w){return w.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=c;var R={audioTracks:c};this.log("Updating audio tracks, "+c.length+' track(s) found in "'+u+'" group-id'),this.hls.trigger(G.Events.AUDIO_TRACKS_UPDATED,R),this.selectInitialTrack()}},n.onError=function(l,s){if(h.prototype.onError.call(this,l,s),s.fatal||!s.context)return;s.context.type===H.PlaylistContextType.AUDIO_TRACK&&s.context.id===this.trackId&&s.context.groupId===this.groupId&&this.retryLoadingOrFail(s)},n.setAudioTrack=function(l){var s=this.tracksInGroup;if(l<0||l>=s.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var u=s[this.trackId];this.log("Now switching to audio-track index "+l);var c=s[l],R=c.id,w=c.groupId,C=w===void 0?"":w,D=c.name,S=c.type,b=c.url;if(this.trackId=l,this.trackName=D,this.selectDefaultTrack=!1,this.hls.trigger(G.Events.AUDIO_TRACK_SWITCHING,{id:R,groupId:C,name:D,type:S,url:b}),c.details&&!c.details.live)return;var _=this.switchParams(c.url,u==null?void 0:u.details);this.loadPlaylist(_)},n.selectInitialTrack=function(){var l=this.tracksInGroup;console.assert(l.length,"Initial audio track should be selected when tracks are known");var s=this.trackName,u=this.findTrackId(s)||this.findTrackId();u!==-1?this.setAudioTrack(u):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(G.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},n.findTrackId=function(l){for(var s=this.tracksInGroup,u=0;u<s.length;u++){var c=s[u];if((!this.selectDefaultTrack||c.default)&&(!l||l===c.name))return c.id}return-1},n.loadPlaylist=function(l){var s=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(s)){var u=s.id,c=s.groupId,R=s.url;if(l)try{R=l.addDirectives(R)}catch(w){this.warn("Could not construct new URL with HLS Delivery Directives: "+w)}this.log("loading audio-track playlist for id: "+u),this.clearTimer(),this.hls.trigger(G.Events.AUDIO_TRACK_LOADING,{url:R,id:u,groupId:c,deliveryDirectives:l||null})}},I(r,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(l){this.selectDefaultTrack=!1,this.setAudioTrack(l)}}]),r}(P.default);Y.default=m},"./src/controller/base-playlist-controller.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"default",function(){return I});var G=j("./src/polyfills/number.ts"),L=j("./src/types/level.ts"),P=j("./src/controller/level-helper.ts"),H=j("./src/utils/logger.ts"),O=j("./src/errors.ts"),I=function(){function x(m,h){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=H.logger.log.bind(H.logger,h+":"),this.warn=H.logger.warn.bind(H.logger,h+":"),this.hls=m}var p=x.prototype;return p.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},p.onError=function(h,r){r.fatal&&r.type===O.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},p.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},p.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},p.stopLoad=function(){this.canLoad=!1,this.clearTimer()},p.switchParams=function(h,r){var n=r==null?void 0:r.renditionReports;if(n)for(var a=0;a<n.length;a++){var l=n[a],s=""+l.URI;if(s===h.substr(-s.length)){var u=parseInt(l["LAST-MSN"]),c=parseInt(l["LAST-PART"]);if(r&&this.hls.config.lowLatencyMode){var R=Math.min(r.age-r.partTarget,r.targetduration);c!==void 0&&R>r.partTarget&&(c+=1)}if(Object(G.isFiniteNumber)(u))return new L.HlsUrlParameters(u,Object(G.isFiniteNumber)(c)?c:void 0,L.HlsSkip.No)}}},p.loadPlaylist=function(h){},p.shouldLoadTrack=function(h){return this.canLoad&&h&&!!h.url&&(!h.details||h.details.live)},p.playlistLoaded=function(h,r,n){var a=this,l=r.details,s=r.stats,u=s.loading.end?Math.max(0,self.performance.now()-s.loading.end):0;if(l.advancedDateTime=Date.now()-u,l.live||n!=null&&n.live){if(l.reloaded(n),n&&this.log("live playlist "+h+" "+(l.advanced?"REFRESHED "+l.lastPartSn+"-"+l.lastPartIndex:"MISSED")),n&&l.fragments.length>0&&Object(P.mergeDetails)(n,l),!this.canLoad||!l.live)return;var c,R=void 0,w=void 0;if(l.canBlockReload&&l.endSN&&l.advanced){var C=this.hls.config.lowLatencyMode,D=l.lastPartSn,S=l.endSN,b=l.lastPartIndex,_=b!==-1,f=D===S,d=C?0:b;_?(R=f?S+1:D,w=f?d:b+1):R=S+1;var g=l.age,E=g+l.ageHeader,T=Math.min(E-l.partTarget,l.targetduration*1.5);if(T>0){if(n&&T>n.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+n.tuneInGoal+" to: "+T+" with playlist age: "+l.age),T=0;else{var F=Math.floor(T/l.targetduration);if(R+=F,w!==void 0){var U=Math.round(T%l.targetduration/l.partTarget);w+=U}this.log("CDN Tune-in age: "+l.ageHeader+"s last advanced "+g.toFixed(2)+"s goal: "+T+" skip sn "+F+" to part "+w)}l.tuneInGoal=T}if(c=this.getDeliveryDirectives(l,r.deliveryDirectives,R,w),C||!f){this.loadPlaylist(c);return}}else c=this.getDeliveryDirectives(l,r.deliveryDirectives,R,w);var K=Object(P.computeReloadInterval)(l,s);R!==void 0&&l.canBlockReload&&(K-=l.partTarget||1),this.log("reload live playlist "+h+" in "+Math.round(K)+" ms"),this.timer=self.setTimeout(function(){return a.loadPlaylist(c)},K)}else this.clearTimer()},p.getDeliveryDirectives=function(h,r,n,a){var l=Object(L.getSkipValue)(h,n);return r!=null&&r.skip&&h.deltaUpdateFailed&&(n=r.msn,a=r.part,l=L.HlsSkip.No),new L.HlsUrlParameters(n,a,l)},p.retryLoadingOrFail=function(h){var r=this,n=this.hls.config,a=this.retryCount<n.levelLoadingMaxRetry;if(a){var l;if(this.retryCount++,h.details.indexOf("LoadTimeOut")>-1&&(l=h.context)!==null&&l!==void 0&&l.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+h.details+'"'),this.loadPlaylist();else{var s=Math.min(Math.pow(2,this.retryCount)*n.levelLoadingRetryDelay,n.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return r.loadPlaylist()},s),this.warn("retry playlist loading #"+this.retryCount+" in "+s+' ms after "'+h.details+'"')}}else this.warn('cannot recover from error "'+h.details+'"'),this.clearTimer(),h.fatal=!0;return a},x}()},"./src/controller/base-stream-controller.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"State",function(){return S}),j.d(Y,"default",function(){return b});var G=j("./src/polyfills/number.ts"),L=j("./src/task-loop.ts"),P=j("./src/controller/fragment-tracker.ts"),H=j("./src/utils/buffer-helper.ts"),O=j("./src/utils/logger.ts"),I=j("./src/events.ts"),x=j("./src/errors.ts"),p=j("./src/types/transmuxer.ts"),m=j("./src/utils/mp4-tools.ts"),h=j("./src/utils/discontinuities.ts"),r=j("./src/controller/fragment-finders.ts"),n=j("./src/controller/level-helper.ts"),a=j("./src/loader/fragment-loader.ts"),l=j("./src/crypt/decrypter.ts"),s=j("./src/utils/time-ranges.ts"),u=j("./src/types/loader.ts");function c(_,f){for(var d=0;d<f.length;d++){var g=f[d];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(_,g.key,g)}}function R(_,f,d){return f&&c(_.prototype,f),d&&c(_,d),_}function w(_){if(_===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _}function C(_,f){_.prototype=Object.create(f.prototype),_.prototype.constructor=_,D(_,f)}function D(_,f){return D=Object.setPrototypeOf||function(g,E){return g.__proto__=E,g},D(_,f)}var S={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"},b=function(_){C(f,_);function f(g,E,T){var F;return F=_.call(this)||this,F.hls=void 0,F.fragPrevious=null,F.fragCurrent=null,F.fragmentTracker=void 0,F.transmuxer=null,F._state=S.STOPPED,F.media=void 0,F.mediaBuffer=void 0,F.config=void 0,F.bitrateTest=!1,F.lastCurrentTime=0,F.nextLoadPosition=0,F.startPosition=0,F.loadedmetadata=!1,F.fragLoadError=0,F.retryDate=0,F.levels=null,F.fragmentLoader=void 0,F.levelLastLoaded=null,F.startFragRequested=!1,F.decrypter=void 0,F.initPTS=[],F.onvseeking=null,F.onvended=null,F.logPrefix="",F.log=void 0,F.warn=void 0,F.logPrefix=T,F.log=O.logger.log.bind(O.logger,T+":"),F.warn=O.logger.warn.bind(O.logger,T+":"),F.hls=g,F.fragmentLoader=new a.default(g.config),F.fragmentTracker=E,F.config=g.config,F.decrypter=new l.default(g,g.config),g.on(I.Events.KEY_LOADED,F.onKeyLoaded,w(F)),F}var d=f.prototype;return d.doTick=function(){this.onTickEnd()},d.onTickEnd=function(){},d.startLoad=function(E){},d.stopLoad=function(){this.fragmentLoader.abort();var E=this.fragCurrent;E&&this.fragmentTracker.removeFragment(E),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=S.STOPPED},d._streamEnded=function(E,T){var F=this.fragCurrent,U=this.fragmentTracker;if(!T.live&&F&&F.sn===T.endSN&&!E.nextStart){var K=U.getState(F);return K===P.FragmentState.PARTIAL||K===P.FragmentState.OK}return!1},d.onMediaAttached=function(E,T){var F=this.media=this.mediaBuffer=T.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),F.addEventListener("seeking",this.onvseeking),F.addEventListener("ended",this.onvended);var U=this.config;this.levels&&U.autoStartLoad&&this.state===S.STOPPED&&this.startLoad(U.startPosition)},d.onMediaDetaching=function(){var E=this.media;E!=null&&E.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),E&&(E.removeEventListener("seeking",this.onvseeking),E.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},d.onMediaSeeking=function(){var E=this.config,T=this.fragCurrent,F=this.media,U=this.mediaBuffer,K=this.state,z=F?F.currentTime:0,M=H.BufferHelper.bufferInfo(U||F,z,E.maxBufferHole);if(this.log("media seeking to "+(Object(G.isFiniteNumber)(z)?z.toFixed(3):z)+", state: "+K),K===S.ENDED)this.resetLoadingState();else if(T&&!M.len){var y=E.maxFragLookUpTolerance,W=T.start-y,X=T.start+T.duration+y,te=z>X;(z<W||te)&&(te&&T.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),T.loader.abort()),this.resetLoadingState())}F&&(this.lastCurrentTime=z),!this.loadedmetadata&&!M.len&&(this.nextLoadPosition=this.startPosition=z),this.tickImmediate()},d.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},d.onKeyLoaded=function(E,T){if(this.state!==S.KEY_LOADING||T.frag!==this.fragCurrent||!this.levels)return;this.state=S.IDLE;var F=this.levels[T.frag.level].details;F&&this.loadFragment(T.frag,F,T.frag.start)},d.onHandlerDestroying=function(){this.stopLoad(),_.prototype.onHandlerDestroying.call(this)},d.onHandlerDestroyed=function(){this.state=S.STOPPED,this.hls.off(I.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,_.prototype.onHandlerDestroyed.call(this)},d.loadKey=function(E,T){this.log("Loading key for "+E.sn+" of ["+T.startSN+"-"+T.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+E.level),this.state=S.KEY_LOADING,this.fragCurrent=E,this.hls.trigger(I.Events.KEY_LOADING,{frag:E})},d.loadFragment=function(E,T,F){this._loadFragForPlayback(E,T,F)},d._loadFragForPlayback=function(E,T,F){var U=this,K=function(M){if(U.fragContextChanged(E)){U.warn("Fragment "+E.sn+(M.part?" p: "+M.part.index:"")+" of level "+E.level+" was dropped during download."),U.fragmentTracker.removeFragment(E);return}E.stats.chunkCount++,U._handleFragmentLoadProgress(M)};this._doFragLoad(E,T,F,K).then(function(z){if(!z)return;U.fragLoadError=0;var M=U.state;if(U.fragContextChanged(E)){(M===S.FRAG_LOADING||M===S.BACKTRACKING||!U.fragCurrent&&M===S.PARSING)&&(U.fragmentTracker.removeFragment(E),U.state=S.IDLE);return}if("payload"in z&&(U.log("Loaded fragment "+E.sn+" of level "+E.level),U.hls.trigger(I.Events.FRAG_LOADED,z),U.state===S.BACKTRACKING)){U.fragmentTracker.backtrack(E,z),U.resetFragmentLoading(E);return}U._handleFragmentLoadComplete(z)}).catch(function(z){U.warn(z),U.resetFragmentLoading(E)})},d.flushMainBuffer=function(E,T,F){if(F===void 0&&(F=null),!(E-T))return;var U={startOffset:E,endOffset:T,type:F};this.fragLoadError=0,this.hls.trigger(I.Events.BUFFER_FLUSHING,U)},d._loadInitSegment=function(E){var T=this;this._doFragLoad(E).then(function(F){if(!F||T.fragContextChanged(E)||!T.levels)throw new Error("init load aborted");return F}).then(function(F){var U=T.hls,K=F.payload,z=E.decryptdata;if(K&&K.byteLength>0&&z&&z.key&&z.iv&&z.method==="AES-128"){var M=self.performance.now();return T.decrypter.webCryptoDecrypt(new Uint8Array(K),z.key.buffer,z.iv.buffer).then(function(y){var W=self.performance.now();return U.trigger(I.Events.FRAG_DECRYPTED,{frag:E,payload:y,stats:{tstart:M,tdecrypt:W}}),F.payload=y,F})}return F}).then(function(F){var U=T.fragCurrent,K=T.hls,z=T.levels;if(!z)throw new Error("init load aborted, missing levels");var M=z[E.level].details;console.assert(M,"Level details are defined when init segment is loaded");var y=E.stats;T.state=S.IDLE,T.fragLoadError=0,E.data=new Uint8Array(F.payload),y.parsing.start=y.buffering.start=self.performance.now(),y.parsing.end=y.buffering.end=self.performance.now(),F.frag===U&&K.trigger(I.Events.FRAG_BUFFERED,{stats:y,frag:U,part:null,id:E.type}),T.tick()}).catch(function(F){T.warn(F),T.resetFragmentLoading(E)})},d.fragContextChanged=function(E){var T=this.fragCurrent;return!E||!T||E.level!==T.level||E.sn!==T.sn||E.urlId!==T.urlId},d.fragBufferedComplete=function(E,T){var F=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+E.type+" sn: "+E.sn+(T?" part: "+T.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+E.level+" "+s.default.toString(H.BufferHelper.getBuffered(F))),this.state=S.IDLE,this.tick()},d._handleFragmentLoadComplete=function(E){var T=this.transmuxer;if(!T)return;var F=E.frag,U=E.part,K=E.partsLoaded,z=!K||K.length===0||K.some(function(y){return!y}),M=new p.ChunkMetadata(F.level,F.sn,F.stats.chunkCount+1,0,U?U.index:-1,!z);T.flush(M)},d._handleFragmentLoadProgress=function(E){},d._doFragLoad=function(E,T,F,U){var K=this;if(F===void 0&&(F=null),!this.levels)throw new Error("frag load aborted, missing levels");if(F=Math.max(E.start,F||0),this.config.lowLatencyMode&&T){var z=T.partList;if(z&&U){F>E.end&&T.fragmentHint&&(E=T.fragmentHint);var M=this.getNextPart(z,E,F);if(M>-1){var y=z[M];return this.log("Loading part sn: "+E.sn+" p: "+y.index+" cc: "+E.cc+" of playlist ["+T.startSN+"-"+T.endSN+"] parts [0-"+M+"-"+(z.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+E.level+", target: "+parseFloat(F.toFixed(3))),this.nextLoadPosition=y.start+y.duration,this.state=S.FRAG_LOADING,this.hls.trigger(I.Events.FRAG_LOADING,{frag:E,part:z[M],targetBufferTime:F}),this.doFragPartsLoad(E,z,M,U).catch(function(W){return K.handleFragLoadError(W)})}else if(!E.url||this.loadedEndOfParts(z,F))return Promise.resolve(null)}}return this.log("Loading fragment "+E.sn+" cc: "+E.cc+" "+(T?"of ["+T.startSN+"-"+T.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+E.level+", target: "+parseFloat(F.toFixed(3))),Object(G.isFiniteNumber)(E.sn)&&!this.bitrateTest&&(this.nextLoadPosition=E.start+E.duration),this.state=S.FRAG_LOADING,this.hls.trigger(I.Events.FRAG_LOADING,{frag:E,targetBufferTime:F}),this.fragmentLoader.load(E,U).catch(function(W){return K.handleFragLoadError(W)})},d.doFragPartsLoad=function(E,T,F,U){var K=this;return new Promise(function(z,M){var y=[],W=function X(te){var pe=T[te];K.fragmentLoader.loadPart(E,pe,U).then(function(Ie){y[pe.index]=Ie;var Ee=Ie.part;K.hls.trigger(I.Events.FRAG_LOADED,Ie);var Te=T[te+1];if(Te&&Te.fragment===E)X(te+1);else return z({frag:E,part:Ee,partsLoaded:y})}).catch(M)};W(F)})},d.handleFragLoadError=function(E){var T=E.data;return T&&T.details===x.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(T.frag,T.part):this.hls.trigger(I.Events.ERROR,T),null},d._handleTransmuxerFlush=function(E){var T=this.getCurrentContext(E);if(!T||this.state!==S.PARSING){this.fragCurrent||(this.state=S.IDLE);return}var F=T.frag,U=T.part,K=T.level,z=self.performance.now();F.stats.parsing.end=z,U&&(U.stats.parsing.end=z),this.updateLevelTiming(F,U,K,E.partial)},d.getCurrentContext=function(E){var T=this.levels,F=E.level,U=E.sn,K=E.part;if(!T||!T[F])return this.warn("Levels object was unset while buffering fragment "+U+" of level "+F+". The current chunk will not be buffered."),null;var z=T[F],M=K>-1?Object(n.getPartWith)(z,U,K):null,y=M?M.fragment:Object(n.getFragmentWithSN)(z,U,this.fragCurrent);return y?{frag:y,part:M,level:z}:null},d.bufferFragmentData=function(E,T,F,U){if(!E||this.state!==S.PARSING)return;var K=E.data1,z=E.data2,M=K;if(K&&z&&(M=Object(m.appendUint8Array)(K,z)),!M||!M.length)return;var y={type:E.type,frag:T,part:F,chunkMeta:U,parent:T.type,data:M};this.hls.trigger(I.Events.BUFFER_APPENDING,y),E.dropped&&E.independent&&!F&&this.flushBufferGap(T)},d.flushBufferGap=function(E){var T=this.media;if(!T)return;if(!H.BufferHelper.isBuffered(T,T.currentTime)){this.flushMainBuffer(0,E.start);return}var F=T.currentTime,U=H.BufferHelper.bufferInfo(T,F,0),K=E.duration,z=Math.min(this.config.maxFragLookUpTolerance*2,K*.25),M=Math.max(Math.min(E.start-z,U.end-z),F+z);E.start-M>z&&this.flushMainBuffer(M,E.start)},d.getFwdBufferInfo=function(E,T){var F=this.config,U=this.getLoadPosition();if(!Object(G.isFiniteNumber)(U))return null;var K=H.BufferHelper.bufferInfo(E,U,F.maxBufferHole);if(K.len===0&&K.nextStart!==void 0){var z=this.fragmentTracker.getBufferedFrag(U,T);if(z&&K.nextStart<z.end)return H.BufferHelper.bufferInfo(E,U,Math.max(K.nextStart,F.maxBufferHole))}return K},d.getMaxBufferLength=function(E){var T=this.config,F;return E?F=Math.max(8*T.maxBufferSize/E,T.maxBufferLength):F=T.maxBufferLength,Math.min(F,T.maxMaxBufferLength)},d.reduceMaxBufferLength=function(E){var T=this.config,F=E||T.maxBufferLength;return T.maxMaxBufferLength>=F?(T.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+T.maxMaxBufferLength+"s"),!0):!1},d.getNextFragment=function(E,T){var F,U,K=T.fragments,z=K.length;if(!z)return null;var M=this.config,y=K[0].start,W;if(T.live){var X=M.initialLiveManifestSize;if(z<X)return this.warn("Not enough fragments to start playback (have: "+z+", need: "+X+")"),null;!T.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(W=this.getInitialLiveFragment(T,K),this.startPosition=W?this.hls.liveSyncPosition||W.start:E)}else E<=y&&(W=K[0]);if(!W){var te=M.lowLatencyMode?T.partEnd:T.fragmentEnd;W=this.getFragmentAtPosition(E,te,T)}return(F=W)!==null&&F!==void 0&&F.initSegment&&!((U=W)!==null&&U!==void 0&&U.initSegment.data)&&!this.bitrateTest&&(W=W.initSegment),W},d.getNextPart=function(E,T,F){for(var U=-1,K=!1,z=!0,M=0,y=E.length;M<y;M++){var W=E[M];if(z=z&&!W.independent,U>-1&&F<W.start)break;var X=W.loaded;!X&&(K||W.independent||z)&&W.fragment===T&&(U=M),K=X}return U},d.loadedEndOfParts=function(E,T){var F=E[E.length-1];return F&&T>F.start&&F.loaded},d.getInitialLiveFragment=function(E,T){var F=this.fragPrevious,U=null;if(F){if(E.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+F.programDateTime),U=Object(r.findFragmentByPDT)(T,F.endProgramDateTime,this.config.maxFragLookUpTolerance)),!U){var K=F.sn+1;if(K>=E.startSN&&K<=E.endSN){var z=T[K-E.startSN];F.cc===z.cc&&(U=z,this.log("Live playlist, switching playlist, load frag with next SN: "+U.sn))}U||(U=Object(r.findFragWithCC)(T,F.cc),U&&this.log("Live playlist, switching playlist, load frag with same CC: "+U.sn))}}else{var M=this.hls.liveSyncPosition;M!==null&&(U=this.getFragmentAtPosition(M,this.bitrateTest?E.fragmentEnd:E.edge,E))}return U},d.getFragmentAtPosition=function(E,T,F){var U=this.config,K=this.fragPrevious,z=F.fragments,M=F.endSN,y=F.fragmentHint,W=U.maxFragLookUpTolerance,X=!!(U.lowLatencyMode&&F.partList&&y);X&&y&&!this.bitrateTest&&(z=z.concat(y),M=y.sn);var te;if(E<T){var pe=E>T-W?0:W;te=Object(r.findFragmentByPTS)(K,z,E,pe)}else te=z[z.length-1];if(te){var Ie=te.sn-F.startSN,Ee=K&&te.level===K.level,Te=z[Ie+1],We=this.fragmentTracker.getState(te);if(We===P.FragmentState.BACKTRACKED){te=null;for(var He=Ie;z[He]&&this.fragmentTracker.getState(z[He])===P.FragmentState.BACKTRACKED;)K?te=z[He--]:te=z[--He];te||(te=Te)}else K&&te.sn===K.sn&&!X&&(Ee&&(te.sn<M&&this.fragmentTracker.getState(Te)!==P.FragmentState.OK?(this.log("SN "+te.sn+" just loaded, load next one: "+Te.sn),te=Te):te=null))}return te},d.synchronizeToLiveEdge=function(E){var T=this.config,F=this.media;if(!F)return;var U=this.hls.liveSyncPosition,K=F.currentTime,z=E.fragments[0].start,M=E.edge,y=K>=z-T.maxFragLookUpTolerance&&K<=M;if(U!==null&&F.duration>U&&(K<U||!y)){var W=T.liveMaxLatencyDuration!==void 0?T.liveMaxLatencyDuration:T.liveMaxLatencyDurationCount*E.targetduration;(!y&&F.readyState<4||K<M-W)&&(this.loadedmetadata||(this.nextLoadPosition=U),F.readyState&&(this.warn("Playback: "+K.toFixed(3)+" is located too far from the end of live sliding playlist: "+M+", reset currentTime to : "+U.toFixed(3)),F.currentTime=U))}},d.alignPlaylists=function(E,T){var F=this.levels,U=this.levelLastLoaded,K=this.fragPrevious,z=U!==null?F[U]:null,M=E.fragments.length;if(!M)return this.warn("No fragments in live playlist"),0;var y=E.fragments[0].start,W=!T,X=E.alignedSliding&&Object(G.isFiniteNumber)(y);if(W||!X&&!y){Object(h.alignStream)(K,z,E);var te=E.fragments[0].start;return this.log("Live playlist sliding: "+te.toFixed(2)+" start-sn: "+(T?T.startSN:"na")+"->"+E.startSN+" prev-sn: "+(K?K.sn:"na")+" fragments: "+M),te}return y},d.waitForCdnTuneIn=function(E){var T=3;return E.live&&E.canBlockReload&&E.tuneInGoal>Math.max(E.partHoldBack,E.partTarget*T)},d.setStartPosition=function(E,T){var F=this.startPosition;if(F<T&&(F=-1),F===-1||this.lastCurrentTime===-1){var U=E.startTimeOffset;Object(G.isFiniteNumber)(U)?(F=T+U,U<0&&(F+=E.totalduration),F=Math.min(Math.max(T,F),T+E.totalduration),this.log("Start time offset "+U+" found in playlist, adjust startPosition to "+F),this.startPosition=F):E.live?F=this.hls.liveSyncPosition||T:this.startPosition=F=0,this.lastCurrentTime=F}this.nextLoadPosition=F},d.getLoadPosition=function(){var E=this.media,T=0;return this.loadedmetadata&&E?T=E.currentTime:this.nextLoadPosition&&(T=this.nextLoadPosition),T},d.handleFragLoadAborted=function(E,T){this.transmuxer&&E.sn!=="initSegment"&&E.stats.aborted&&(this.warn("Fragment "+E.sn+(T?" part"+T.index:"")+" of level "+E.level+" was aborted"),this.resetFragmentLoading(E))},d.resetFragmentLoading=function(E){(!this.fragCurrent||!this.fragContextChanged(E))&&(this.state=S.IDLE)},d.onFragmentOrKeyLoadError=function(E,T){if(T.fatal)return;var F=T.frag;if(!F||F.type!==E)return;var U=this.fragCurrent;console.assert(U&&F.sn===U.sn&&F.level===U.level&&F.urlId===U.urlId,"Frag load error must match current frag to retry");var K=this.config;if(this.fragLoadError+1<=K.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(F.level))return;var z=Math.min(Math.pow(2,this.fragLoadError)*K.fragLoadingRetryDelay,K.fragLoadingMaxRetryTimeout);this.warn("Fragment "+F.sn+" of "+E+" "+F.level+" failed to load, retrying in "+z+"ms"),this.retryDate=self.performance.now()+z,this.fragLoadError++,this.state=S.FRAG_LOADING_WAITING_RETRY}else T.levelRetry?(E===u.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=S.IDLE):(O.logger.error(T.details+" reaches max retry, redispatch as fatal ..."),T.fatal=!0,this.hls.stopLoad(),this.state=S.ERROR)},d.afterBufferFlushed=function(E,T,F){if(!E)return;var U=H.BufferHelper.getBuffered(E);this.fragmentTracker.detectEvictedFragments(T,U,F),this.state===S.ENDED&&this.resetLoadingState()},d.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=S.IDLE},d.resetLiveStartWhenNotLoaded=function(E){if(!this.loadedmetadata){this.startFragRequested=!1;var T=this.levels?this.levels[E].details:null;if(T!=null&&T.live)return this.startPosition=-1,this.setStartPosition(T,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},d.updateLevelTiming=function(E,T,F,U){var K=this,z=F.details;console.assert(!!z,"level.details must be defined");var M=Object.keys(E.elementaryStreams).reduce(function(y,W){var X=E.elementaryStreams[W];if(X){var te=X.endPTS-X.startPTS;if(te<=0)return K.warn("Could not parse fragment "+E.sn+" "+W+" duration reliably ("+te+") resetting transmuxer to fallback to playlist timing"),K.resetTransmuxer(),y||!1;var pe=U?0:Object(n.updateFragPTSDTS)(z,E,X.startPTS,X.endPTS,X.startDTS,X.endDTS);return K.hls.trigger(I.Events.LEVEL_PTS_UPDATED,{details:z,level:F,drift:pe,type:W,frag:E,start:X.startPTS,end:X.endPTS}),!0}return y},!1);M?(this.state=S.PARSED,this.hls.trigger(I.Events.FRAG_PARSED,{frag:E,part:T})):this.resetLoadingState()},d.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},R(f,[{key:"state",get:function(){return this._state},set:function(E){var T=this._state;T!==E&&(this._state=E,this.log(T+"->"+E))}}]),f}(L.default)},"./src/controller/buffer-controller.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"default",function(){return r});var G=j("./src/polyfills/number.ts"),L=j("./src/events.ts"),P=j("./src/utils/logger.ts"),H=j("./src/errors.ts"),O=j("./src/utils/buffer-helper.ts"),I=j("./src/utils/mediasource-helper.ts"),x=j("./src/loader/fragment.ts"),p=j("./src/controller/buffer-operation-queue.ts"),m=Object(I.getMediaSource)(),h=/([ha]vc.)(?:\.[^.,]+)+/,r=function(){function n(l){var s=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var u=s.hls,c=s.media,R=s.mediaSource;P.logger.log("[buffer-controller]: Media source opened"),c&&(s.updateMediaElementDuration(),u.trigger(L.Events.MEDIA_ATTACHED,{media:c})),R&&R.removeEventListener("sourceopen",s._onMediaSourceOpen),s.checkPendingTracks()},this._onMediaSourceClose=function(){P.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){P.logger.log("[buffer-controller]: Media source ended")},this.hls=l,this._initSourceBuffer(),this.registerListeners()}var a=n.prototype;return a.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},a.destroy=function(){this.unregisterListeners(),this.details=null},a.registerListeners=function(){var s=this.hls;s.on(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(L.Events.BUFFER_RESET,this.onBufferReset,this),s.on(L.Events.BUFFER_APPENDING,this.onBufferAppending,this),s.on(L.Events.BUFFER_CODECS,this.onBufferCodecs,this),s.on(L.Events.BUFFER_EOS,this.onBufferEos,this),s.on(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),s.on(L.Events.LEVEL_UPDATED,this.onLevelUpdated,this),s.on(L.Events.FRAG_PARSED,this.onFragParsed,this),s.on(L.Events.FRAG_CHANGED,this.onFragChanged,this)},a.unregisterListeners=function(){var s=this.hls;s.off(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(L.Events.BUFFER_RESET,this.onBufferReset,this),s.off(L.Events.BUFFER_APPENDING,this.onBufferAppending,this),s.off(L.Events.BUFFER_CODECS,this.onBufferCodecs,this),s.off(L.Events.BUFFER_EOS,this.onBufferEos,this),s.off(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),s.off(L.Events.LEVEL_UPDATED,this.onLevelUpdated,this),s.off(L.Events.FRAG_PARSED,this.onFragParsed,this),s.off(L.Events.FRAG_CHANGED,this.onFragChanged,this)},a._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new p.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},a.onManifestParsed=function(s,u){var c=2;(u.audio&&!u.video||!u.altAudio)&&(c=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=c,this.details=null,P.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},a.onMediaAttaching=function(s,u){var c=this.media=u.media;if(c&&m){var R=this.mediaSource=new m;R.addEventListener("sourceopen",this._onMediaSourceOpen),R.addEventListener("sourceended",this._onMediaSourceEnded),R.addEventListener("sourceclose",this._onMediaSourceClose),c.src=self.URL.createObjectURL(R),this._objectUrl=c.src}},a.onMediaDetaching=function(){var s=this.media,u=this.mediaSource,c=this._objectUrl;if(u){if(P.logger.log("[buffer-controller]: media source detaching"),u.readyState==="open")try{u.endOfStream()}catch(R){P.logger.warn("[buffer-controller]: onMediaDetaching: "+R.message+" while calling endOfStream")}this.onBufferReset(),u.removeEventListener("sourceopen",this._onMediaSourceOpen),u.removeEventListener("sourceended",this._onMediaSourceEnded),u.removeEventListener("sourceclose",this._onMediaSourceClose),s&&(c&&self.URL.revokeObjectURL(c),s.src===c?(s.removeAttribute("src"),s.load()):P.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(L.Events.MEDIA_DETACHED,void 0)},a.onBufferReset=function(){var s=this;this.getSourceBufferTypes().forEach(function(u){var c=s.sourceBuffer[u];try{c&&(s.removeBufferListeners(u),s.mediaSource&&s.mediaSource.removeSourceBuffer(c),s.sourceBuffer[u]=void 0)}catch(R){P.logger.warn("[buffer-controller]: Failed to reset the "+u+" buffer",R)}}),this._initSourceBuffer()},a.onBufferCodecs=function(s,u){var c=this,R=this.getSourceBufferTypes().length;if(Object.keys(u).forEach(function(w){if(R){var C=c.tracks[w];if(C&&typeof C.buffer.changeType=="function"){var D=u[w],S=D.codec,b=D.levelCodec,_=D.container,f=(C.levelCodec||C.codec).replace(h,"$1"),d=(b||S).replace(h,"$1");if(f!==d){var g=_+";codecs="+(b||S);c.appendChangeType(w,g)}}}else c.pendingTracks[w]=u[w]}),R)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},a.appendChangeType=function(s,u){var c=this,R=this.operationQueue,w={execute:function(){var D=c.sourceBuffer[s];D&&(P.logger.log("[buffer-controller]: changing "+s+" sourceBuffer type to "+u),D.changeType(u)),R.shiftAndExecuteNext(s)},onStart:function(){},onComplete:function(){},onError:function(D){P.logger.warn("[buffer-controller]: Failed to change "+s+" SourceBuffer type",D)}};R.append(w,s)},a.onBufferAppending=function(s,u){var c=this,R=this.hls,w=this.operationQueue,C=this.tracks,D=u.data,S=u.type,b=u.frag,_=u.part,f=u.chunkMeta,d=f.buffering[S],g=self.performance.now();d.start=g;var E=b.stats.buffering,T=_?_.stats.buffering:null;E.start===0&&(E.start=g),T&&T.start===0&&(T.start=g);var F=C.audio,U=S==="audio"&&f.id===1&&(F==null?void 0:F.container)==="audio/mpeg",K={execute:function(){if(d.executeStart=self.performance.now(),U){var M=c.sourceBuffer[S];if(M){var y=b.start-M.timestampOffset;Math.abs(y)>=.1&&(P.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+b.start+" (delta: "+y+") sn: "+b.sn+")"),M.timestampOffset=b.start)}}c.appendExecutor(D,S)},onStart:function(){},onComplete:function(){var M=self.performance.now();d.executeEnd=d.end=M,E.first===0&&(E.first=M),T&&T.first===0&&(T.first=M);var y=c.sourceBuffer,W={};for(var X in y)W[X]=O.BufferHelper.getBuffered(y[X]);c.appendError=0,c.hls.trigger(L.Events.BUFFER_APPENDED,{type:S,frag:b,part:_,chunkMeta:f,parent:b.type,timeRanges:W})},onError:function(M){P.logger.error("[buffer-controller]: Error encountered while trying to append to the "+S+" SourceBuffer",M);var y={type:H.ErrorTypes.MEDIA_ERROR,parent:b.type,details:H.ErrorDetails.BUFFER_APPEND_ERROR,err:M,fatal:!1};M.code===DOMException.QUOTA_EXCEEDED_ERR?y.details=H.ErrorDetails.BUFFER_FULL_ERROR:(c.appendError++,y.details=H.ErrorDetails.BUFFER_APPEND_ERROR,c.appendError>R.config.appendErrorMaxRetry&&(P.logger.error("[buffer-controller]: Failed "+R.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),y.fatal=!0)),R.trigger(L.Events.ERROR,y)}};w.append(K,S)},a.onBufferFlushing=function(s,u){var c=this,R=this.operationQueue,w=function(D){return{execute:c.removeExecutor.bind(c,D,u.startOffset,u.endOffset),onStart:function(){},onComplete:function(){c.hls.trigger(L.Events.BUFFER_FLUSHED,{type:D})},onError:function(b){P.logger.warn("[buffer-controller]: Failed to remove from "+D+" SourceBuffer",b)}}};u.type?R.append(w(u.type),u.type):this.getSourceBufferTypes().forEach(function(C){R.append(w(C),C)})},a.onFragParsed=function(s,u){var c=this,R=u.frag,w=u.part,C=[],D=w?w.elementaryStreams:R.elementaryStreams;D[x.ElementaryStreamTypes.AUDIOVIDEO]?C.push("audiovideo"):(D[x.ElementaryStreamTypes.AUDIO]&&C.push("audio"),D[x.ElementaryStreamTypes.VIDEO]&&C.push("video"));var S=function(){var _=self.performance.now();R.stats.buffering.end=_,w&&(w.stats.buffering.end=_);var f=w?w.stats:R.stats;c.hls.trigger(L.Events.FRAG_BUFFERED,{frag:R,part:w,stats:f,id:R.type})};C.length===0&&P.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+R.type+" level: "+R.level+" sn: "+R.sn),this.blockBuffers(S,C)},a.onFragChanged=function(s,u){this.flushBackBuffer()},a.onBufferEos=function(s,u){var c=this,R=this.getSourceBufferTypes().reduce(function(w,C){var D=c.sourceBuffer[C];return(!u.type||u.type===C)&&(D&&!D.ended&&(D.ended=!0,P.logger.log("[buffer-controller]: "+C+" sourceBuffer now EOS"))),w&&!!(!D||D.ended)},!0);R&&this.blockBuffers(function(){var w=c.mediaSource;if(!w||w.readyState!=="open")return;w.endOfStream()})},a.onLevelUpdated=function(s,u){var c=u.details;if(!c.fragments.length)return;this.details=c,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},a.flushBackBuffer=function(){var s=this.hls,u=this.details,c=this.media,R=this.sourceBuffer;if(!c||u===null)return;var w=this.getSourceBufferTypes();if(!w.length)return;var C=u.live&&s.config.liveBackBufferLength!==null?s.config.liveBackBufferLength:s.config.backBufferLength;if(!Object(G.isFiniteNumber)(C)||C<0)return;var D=c.currentTime,S=u.levelTargetDuration,b=Math.max(C,S),_=Math.floor(D/S)*S-b;w.forEach(function(f){var d=R[f];if(d){var g=O.BufferHelper.getBuffered(d);g.length>0&&_>g.start(0)&&(s.trigger(L.Events.BACK_BUFFER_REACHED,{bufferEnd:_}),u.live&&s.trigger(L.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:_}),s.trigger(L.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:_,type:f}))}})},a.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var s=this.details,u=this.hls,c=this.media,R=this.mediaSource,w=s.fragments[0].start+s.totalduration,C=c.duration,D=Object(G.isFiniteNumber)(R.duration)?R.duration:0;s.live&&u.config.liveDurationInfinity?(P.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),R.duration=Infinity,this.updateSeekableRange(s)):(w>D&&w>C||!Object(G.isFiniteNumber)(C))&&(P.logger.log("[buffer-controller]: Updating Media Source duration to "+w.toFixed(3)),R.duration=w)},a.updateSeekableRange=function(s){var u=this.mediaSource,c=s.fragments,R=c.length;if(R&&s.live&&u!==null&&u!==void 0&&u.setLiveSeekableRange){var w=Math.max(0,c[0].start),C=Math.max(w,w+s.totalduration);u.setLiveSeekableRange(w,C)}},a.checkPendingTracks=function(){var s=this.bufferCodecEventsExpected,u=this.operationQueue,c=this.pendingTracks,R=Object.keys(c).length;if(R&&!s||R===2){this.createSourceBuffers(c),this.pendingTracks={};var w=this.getSourceBufferTypes();if(w.length===0){this.hls.trigger(L.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}w.forEach(function(C){u.executeNext(C)})}},a.createSourceBuffers=function(s){var u=this.sourceBuffer,c=this.mediaSource;if(!c)throw Error("createSourceBuffers called when mediaSource was null");var R=0;for(var w in s)if(!u[w]){var C=s[w];if(!C)throw Error("source buffer exists for track "+w+", however track does not");var D=C.levelCodec||C.codec,S=C.container+";codecs="+D;P.logger.log("[buffer-controller]: creating sourceBuffer("+S+")");try{var b=u[w]=c.addSourceBuffer(S),_=w;this.addBufferListener(_,"updatestart",this._onSBUpdateStart),this.addBufferListener(_,"updateend",this._onSBUpdateEnd),this.addBufferListener(_,"error",this._onSBUpdateError),this.tracks[w]={buffer:b,codec:D,container:C.container,levelCodec:C.levelCodec,id:C.id},R++}catch(f){P.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+f.message),this.hls.trigger(L.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:f,mimeType:S})}}R&&this.hls.trigger(L.Events.BUFFER_CREATED,{tracks:this.tracks})},a._onSBUpdateStart=function(s){var u=this.operationQueue,c=u.current(s);c.onStart()},a._onSBUpdateEnd=function(s){var u=this.operationQueue,c=u.current(s);c.onComplete(),u.shiftAndExecuteNext(s)},a._onSBUpdateError=function(s,u){P.logger.error("[buffer-controller]: "+s+" SourceBuffer error",u),this.hls.trigger(L.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var c=this.operationQueue.current(s);c&&c.onError(u)},a.removeExecutor=function(s,u,c){var R=this.media,w=this.mediaSource,C=this.operationQueue,D=this.sourceBuffer,S=D[s];if(!R||!w||!S){P.logger.warn("[buffer-controller]: Attempting to remove from the "+s+" SourceBuffer, but it does not exist"),C.shiftAndExecuteNext(s);return}var b=Object(G.isFiniteNumber)(R.duration)?R.duration:Infinity,_=Object(G.isFiniteNumber)(w.duration)?w.duration:Infinity,f=Math.max(0,u),d=Math.min(c,b,_);d>f?(P.logger.log("[buffer-controller]: Removing ["+f+","+d+"] from the "+s+" SourceBuffer"),console.assert(!S.updating,s+" sourceBuffer must not be updating"),S.remove(f,d)):C.shiftAndExecuteNext(s)},a.appendExecutor=function(s,u){var c=this.operationQueue,R=this.sourceBuffer,w=R[u];if(!w){P.logger.warn("[buffer-controller]: Attempting to append to the "+u+" SourceBuffer, but it does not exist"),c.shiftAndExecuteNext(u);return}w.ended=!1,console.assert(!w.updating,u+" sourceBuffer must not be updating"),w.appendBuffer(s)},a.blockBuffers=function(s,u){var c=this;if(u===void 0&&(u=this.getSourceBufferTypes()),!u.length){P.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(s);return}var R=this.operationQueue,w=u.map(function(C){return R.appendBlocker(C)});Promise.all(w).then(function(){s(),u.forEach(function(C){var D=c.sourceBuffer[C];(!D||!D.updating)&&R.shiftAndExecuteNext(C)})})},a.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},a.addBufferListener=function(s,u,c){var R=this.sourceBuffer[s];if(!R)return;var w=c.bind(this,s);this.listeners[s].push({event:u,listener:w}),R.addEventListener(u,w)},a.removeBufferListeners=function(s){var u=this.sourceBuffer[s];if(!u)return;this.listeners[s].forEach(function(c){u.removeEventListener(c.event,c.listener)})},n}()},"./src/controller/buffer-operation-queue.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"default",function(){return L});var G=j("./src/utils/logger.ts"),L=function(){function P(O){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=O}var H=P.prototype;return H.append=function(I,x){var p=this.queues[x];p.push(I),p.length===1&&this.buffers[x]&&this.executeNext(x)},H.insertAbort=function(I,x){var p=this.queues[x];p.unshift(I),this.executeNext(x)},H.appendBlocker=function(I){var x,p=new Promise(function(h){x=h}),m={execute:x,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(m,I),p},H.executeNext=function(I){var x=this.buffers,p=this.queues,m=x[I],h=p[I];if(h.length){var r=h[0];try{r.execute()}catch(n){G.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),r.onError(n),(!m||!m.updating)&&(h.shift(),this.executeNext(I))}}},H.shiftAndExecuteNext=function(I){this.queues[I].shift(),this.executeNext(I)},H.current=function(I){return this.queues[I][0]},P}()},"./src/controller/cap-level-controller.ts":function(re,Y,j){"use strict";j.r(Y);var G=j("./src/events.ts");function L(O,I){for(var x=0;x<I.length;x++){var p=I[x];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(O,p.key,p)}}function P(O,I,x){return I&&L(O.prototype,I),x&&L(O,x),O}var H=function(){function O(x){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=x,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var I=O.prototype;return I.setStreamController=function(p){this.streamController=p},I.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},I.registerListeners=function(){var p=this.hls;p.on(G.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),p.on(G.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),p.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),p.on(G.Events.BUFFER_CODECS,this.onBufferCodecs,this),p.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},I.unregisterListener=function(){var p=this.hls;p.off(G.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),p.off(G.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),p.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),p.off(G.Events.BUFFER_CODECS,this.onBufferCodecs,this),p.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},I.onFpsDropLevelCapping=function(p,m){O.isLevelAllowed(m.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(m.droppedLevel)},I.onMediaAttaching=function(p,m){this.media=m.media instanceof HTMLVideoElement?m.media:null},I.onManifestParsed=function(p,m){var h=this.hls;this.restrictedLevels=[],this.firstLevel=m.firstLevel,h.config.capLevelToPlayerSize&&m.video&&this.startCapping()},I.onBufferCodecs=function(p,m){var h=this.hls;h.config.capLevelToPlayerSize&&m.video&&this.startCapping()},I.onMediaDetaching=function(){this.stopCapping()},I.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var p=this.hls.levels;if(p.length){var m=this.hls;m.autoLevelCapping=this.getMaxLevel(p.length-1),m.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=m.autoLevelCapping}}},I.getMaxLevel=function(p){var m=this,h=this.hls.levels;if(!h.length)return-1;var r=h.filter(function(n,a){return O.isLevelAllowed(a,m.restrictedLevels)&&a<=p});return this.clientRect=null,O.getMaxLevelByMediaSize(r,this.mediaWidth,this.mediaHeight)},I.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()},I.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},I.getDimensions=function(){if(this.clientRect)return this.clientRect;var p=this.media,m={width:0,height:0};if(p){var h=p.getBoundingClientRect();m.width=h.width,m.height=h.height,!m.width&&!m.height&&(m.width=h.right-h.left||p.width||0,m.height=h.bottom-h.top||p.height||0)}return this.clientRect=m,m},O.isLevelAllowed=function(p,m){return m===void 0&&(m=[]),m.indexOf(p)===-1},O.getMaxLevelByMediaSize=function(p,m,h){if(!p||!p.length)return-1;for(var r=function(u,c){return c?u.width!==c.width||u.height!==c.height:!0},n=p.length-1,a=0;a<p.length;a+=1){var l=p[a];if((l.width>=m||l.height>=h)&&r(l,p[a+1])){n=a;break}}return n},P(O,[{key:"mediaWidth",get:function(){return this.getDimensions().width*O.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*O.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var p=1;try{p=self.devicePixelRatio}catch(m){}return p}}]),O}();Y.default=H},"./src/controller/cmcd-controller.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"default",function(){return r});var G=j("./src/events.ts"),L=j("./src/types/cmcd.ts"),P=j("./src/utils/buffer-helper.ts"),H=j("./src/utils/logger.ts");function O(n,a){for(var l=0;l<a.length;l++){var s=a[l];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(n,s.key,s)}}function I(n,a,l){return a&&O(n.prototype,a),l&&O(n,l),n}function x(n,a){var l=typeof Symbol!="undefined"&&n[Symbol.iterator]||n["@@iterator"];if(l)return(l=l.call(n)).next.bind(l);if(Array.isArray(n)||(l=p(n))||a&&n&&typeof n.length=="number"){l&&(n=l);var s=0;return function(){return s>=n.length?{done:!0}:{done:!1,value:n[s++]}}}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 p(n,a){if(!n)return;if(typeof n=="string")return m(n,a);var l=Object.prototype.toString.call(n).slice(8,-1);if(l==="Object"&&n.constructor&&(l=n.constructor.name),l==="Map"||l==="Set")return Array.from(n);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return m(n,a)}function m(n,a){(a==null||a>n.length)&&(a=n.length);for(var l=0,s=new Array(a);l<a;l++)s[l]=n[l];return s}function h(){return h=Object.assign||function(n){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var s in l)Object.prototype.hasOwnProperty.call(l,s)&&(n[s]=l[s])}return n},h.apply(this,arguments)}var r=function(){function n(l){var s=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(){s.initialized&&(s.starved=!0),s.buffering=!0},this.onPlaying=function(){s.initialized||(s.initialized=!0),s.buffering=!1},this.applyPlaylistData=function(R){try{s.apply(R,{ot:L.CMCDObjectType.MANIFEST,su:!s.initialized})}catch(w){H.logger.warn("Could not generate manifest CMCD data.",w)}},this.applyFragmentData=function(R){try{var w=R.frag,C=s.hls.levels[w.level],D=s.getObjectType(w),S={d:w.duration*1e3,ot:D};(D===L.CMCDObjectType.VIDEO||D===L.CMCDObjectType.AUDIO||D==L.CMCDObjectType.MUXED)&&(S.br=C.bitrate/1e3,S.tb=s.getTopBandwidth(D),S.bl=s.getBufferLength(D)),s.apply(R,S)}catch(b){H.logger.warn("Could not generate segment CMCD data.",b)}},this.hls=l;var u=this.config=l.config,c=u.cmcd;c!=null&&(u.pLoader=this.createPlaylistLoader(),u.fLoader=this.createFragmentLoader(),this.sid=c.sessionId||n.uuid(),this.cid=c.contentId,this.useHeaders=c.useHeaders===!0,this.registerListeners())}var a=n.prototype;return a.registerListeners=function(){var s=this.hls;s.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(G.Events.MEDIA_DETACHED,this.onMediaDetached,this),s.on(G.Events.BUFFER_CREATED,this.onBufferCreated,this)},a.unregisterListeners=function(){var s=this.hls;s.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(G.Events.MEDIA_DETACHED,this.onMediaDetached,this),s.off(G.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},a.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},a.onMediaAttached=function(s,u){this.media=u.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},a.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},a.onBufferCreated=function(s,u){var c,R;this.audioBuffer=(c=u.tracks.audio)===null||c===void 0?void 0:c.buffer,this.videoBuffer=(R=u.tracks.video)===null||R===void 0?void 0:R.buffer},a.createData=function(){var s;return{v:L.CMCDVersion,sf:L.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(s=this.media)===null||s===void 0?void 0:s.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},a.apply=function(s,u){u===void 0&&(u={}),h(u,this.createData());var c=u.ot===L.CMCDObjectType.INIT||u.ot===L.CMCDObjectType.VIDEO||u.ot===L.CMCDObjectType.MUXED;if(this.starved&&c&&(u.bs=!0,u.su=!0,this.starved=!1),u.su==null&&(u.su=this.buffering),this.useHeaders){var R=n.toHeaders(u);if(!Object.keys(R).length)return;s.headers||(s.headers={}),h(s.headers,R)}else{var w=n.toQuery(u);if(!w)return;s.url=n.appendQueryToUri(s.url,w)}},a.getObjectType=function(s){var u=s.type;return u==="subtitle"?L.CMCDObjectType.TIMED_TEXT:s.sn==="initSegment"?L.CMCDObjectType.INIT:u==="audio"?L.CMCDObjectType.AUDIO:u==="main"?this.hls.audioTracks.length?L.CMCDObjectType.VIDEO:L.CMCDObjectType.MUXED:void 0},a.getTopBandwidth=function(s){for(var u=0,c=s===L.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,R=x(c),w;!(w=R()).done;){var C=w.value;C.bitrate>u&&(u=C.bitrate)}return u>0?u:NaN},a.getBufferLength=function(s){var u=this.hls.media,c=s===L.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!c||!u)return NaN;var R=P.BufferHelper.bufferInfo(c,u.currentTime,this.config.maxBufferHole);return R.len*1e3},a.createPlaylistLoader=function(){var s=this.config.pLoader,u=this.applyPlaylistData,c=s||this.config.loader;return function(){function R(C){this.loader=void 0,this.loader=new c(C)}var w=R.prototype;return w.destroy=function(){this.loader.destroy()},w.abort=function(){this.loader.abort()},w.load=function(D,S,b){u(D),this.loader.load(D,S,b)},I(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},a.createFragmentLoader=function(){var s=this.config.fLoader,u=this.applyFragmentData,c=s||this.config.loader;return function(){function R(C){this.loader=void 0,this.loader=new c(C)}var w=R.prototype;return w.destroy=function(){this.loader.destroy()},w.abort=function(){this.loader.abort()},w.load=function(D,S,b){u(D),this.loader.load(D,S,b)},I(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},n.uuid=function(){var s=URL.createObjectURL(new Blob),u=s.toString();return URL.revokeObjectURL(s),u.substr(u.lastIndexOf("/")+1)},n.serialize=function(s){for(var u=[],c=function(U){return!Number.isNaN(U)&&U!=null&&U!==""&&U!==!1},R=function(U){return Math.round(U)},w=function(U){return R(U/100)*100},C=function(U){return encodeURIComponent(U)},D={br:R,d:R,bl:w,dl:w,mtp:w,nor:C,rtp:w,tb:R},S=Object.keys(s||{}).sort(),b=x(S),_;!(_=b()).done;){var f=_.value,d=s[f];if(!c(d))continue;if(f==="v"&&d===1)continue;if(f=="pr"&&d===1)continue;var g=D[f];g&&(d=g(d));var E=typeof d,T=void 0;f==="ot"||f==="sf"||f==="st"?T=f+"="+d:E==="boolean"?T=f:E==="number"?T=f+"="+d:T=f+"="+JSON.stringify(d),u.push(T)}return u.join(",")},n.toHeaders=function(s){for(var u=Object.keys(s),c={},R=["Object","Request","Session","Status"],w=[{},{},{},{}],C={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},D=0,S=u;D<S.length;D++){var b=S[D],_=C[b]!=null?C[b]:1;w[_][b]=s[b]}for(var f=0;f<w.length;f++){var d=n.serialize(w[f]);d&&(c["CMCD-"+R[f]]=d)}return c},n.toQuery=function(s){return"CMCD="+encodeURIComponent(n.serialize(s))},n.appendQueryToUri=function(s,u){if(!u)return s;var c=s.includes("?")?"&":"?";return""+s+c+u},n}()},"./src/controller/eme-controller.ts":function(re,Y,j){"use strict";j.r(Y);var G=j("./src/events.ts"),L=j("./src/errors.ts"),P=j("./src/utils/logger.ts"),H=j("./src/utils/mediakeys-helper.ts");function O(r,n){for(var a=0;a<n.length;a++){var l=n[a];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(r,l.key,l)}}function I(r,n,a){return n&&O(r.prototype,n),a&&O(r,a),r}var x=3,p=function(n,a,l){var s={audioCapabilities:[],videoCapabilities:[]};return n.forEach(function(u){s.audioCapabilities.push({contentType:'audio/mp4; codecs="'+u+'"',robustness:l.audioRobustness||""})}),a.forEach(function(u){s.videoCapabilities.push({contentType:'video/mp4; codecs="'+u+'"',robustness:l.videoRobustness||""})}),[s]},m=function(n,a,l,s){switch(n){case H.KeySystems.WIDEVINE:return p(a,l,s);default:throw new Error("Unknown key-system: "+n)}},h=function(){function r(a){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=a,this._config=a.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 n=r.prototype;return n.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},n._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)},n._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)},n.getLicenseServerUrl=function(l){switch(l){case H.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+l+'"')},n._attemptKeySystemAccess=function(l,s,u){var c=this,R=m(l,s,u,this._drmSystemOptions);P.logger.log("Requesting encrypted media key-system access");var w=this.requestMediaKeySystemAccess(l,R);this.mediaKeysPromise=w.then(function(C){return c._onMediaKeySystemAccessObtained(l,C)}),w.catch(function(C){P.logger.error('Failed to obtain key-system "'+l+'" access:',C)})},n._onMediaKeySystemAccessObtained=function(l,s){var u=this;P.logger.log('Access for key-system "'+l+'" obtained');var c={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:s,mediaKeySystemDomain:l};this._mediaKeysList.push(c);var R=Promise.resolve().then(function(){return s.createMediaKeys()}).then(function(w){return c.mediaKeys=w,P.logger.log('Media-keys created for key-system "'+l+'"'),u._onMediaKeysCreated(),w});return R.catch(function(w){P.logger.error("Failed to create media-keys:",w)}),R},n._onMediaKeysCreated=function(){var l=this;this._mediaKeysList.forEach(function(s){s.mediaKeysSession||(s.mediaKeysSession=s.mediaKeys.createSession(),l._onNewMediaKeySession(s.mediaKeysSession))})},n._onNewMediaKeySession=function(l){var s=this;P.logger.log("New key-system session "+l.sessionId),l.addEventListener("message",function(u){s._onKeySessionMessage(l,u.message)},!1)},n._onKeySessionMessage=function(l,s){P.logger.log("Got EME message event, creating license request"),this._requestLicense(s,function(u){P.logger.log("Received license data (length: "+(u&&u.byteLength)+"), updating key-session"),l.update(u)})},n.onMediaEncrypted=function(l){var s=this;if(P.logger.log('Media is encrypted using "'+l.initDataType+'" init data type'),!this.mediaKeysPromise){P.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(G.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var u=function(R){if(!s._media)return;s._attemptSetMediaKeys(R),s._generateRequestWithPreferredKeySession(l.initDataType,l.initData)};this.mediaKeysPromise.then(u).catch(u)},n._attemptSetMediaKeys=function(l){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var s=this._mediaKeysList[0];if(!s||!s.mediaKeys){P.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(G.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}P.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(s.mediaKeys),this._hasSetMediaKeys=!0}},n._generateRequestWithPreferredKeySession=function(l,s){var u=this,c=this._mediaKeysList[0];if(!c){P.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(G.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(c.mediaKeysSessionInitialized){P.logger.warn("Key-Session already initialized but requested again");return}var R=c.mediaKeysSession;if(!R){P.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(G.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!s){P.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(G.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}P.logger.log('Generating key-session request for "'+l+'" init data type'),c.mediaKeysSessionInitialized=!0,R.generateRequest(l,s).then(function(){P.logger.debug("Key-session generation succeeded")}).catch(function(w){P.logger.error("Error generating key-session request:",w),u.hls.trigger(G.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},n._createLicenseXhr=function(l,s,u){var c=new XMLHttpRequest;c.responseType="arraybuffer",c.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,c,l,s,u);var R=this._licenseXhrSetup;if(R)try{R.call(this.hls,c,l),R=void 0}catch(w){P.logger.error(w)}try{c.readyState||c.open("POST",l,!0),R&&R.call(this.hls,c,l)}catch(w){throw new Error("issue setting up KeySystem license XHR "+w)}return c},n._onLicenseRequestReadyStageChange=function(l,s,u,c){switch(l.readyState){case 4:if(l.status===200){this._requestLicenseFailureCount=0,P.logger.log("License request succeeded");var R=l.response,w=this._licenseResponseCallback;if(w)try{R=w.call(this.hls,l,s)}catch(D){P.logger.error(D)}c(R)}else{if(P.logger.error("License Request XHR failed ("+s+"). Status: "+l.status+" ("+l.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>x){this.hls.trigger(G.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var C=x-this._requestLicenseFailureCount+1;P.logger.warn("Retrying license request, "+C+" attempts left"),this._requestLicense(u,c)}break}},n._generateLicenseRequestChallenge=function(l,s){switch(l.mediaKeySystemDomain){case H.KeySystems.WIDEVINE:return s}throw new Error("unsupported key-system: "+l.mediaKeySystemDomain)},n._requestLicense=function(l,s){P.logger.log("Requesting content license for key-system");var u=this._mediaKeysList[0];if(!u){P.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(G.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var c=this.getLicenseServerUrl(u.mediaKeySystemDomain),R=this._createLicenseXhr(c,l,s);P.logger.log("Sending license request to URL: "+c);var w=this._generateLicenseRequestChallenge(u,l);R.send(w)}catch(C){P.logger.error("Failure requesting DRM license: "+C),this.hls.trigger(G.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},n.onMediaAttached=function(l,s){if(!this._emeEnabled)return;var u=s.media;this._media=u,u.addEventListener("encrypted",this._onMediaEncrypted)},n.onMediaDetached=function(){var l=this._media,s=this._mediaKeysList;if(!l)return;l.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(s.map(function(u){if(u.mediaKeysSession)return u.mediaKeysSession.close().catch(function(){})})).then(function(){return l.setMediaKeys(null)}).catch(function(){})},n.onManifestParsed=function(l,s){if(!this._emeEnabled)return;var u=s.levels.map(function(R){return R.audioCodec}).filter(function(R){return!!R}),c=s.levels.map(function(R){return R.videoCodec}).filter(function(R){return!!R});this._attemptKeySystemAccess(H.KeySystems.WIDEVINE,u,c)},I(r,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),r}();Y.default=h},"./src/controller/fps-controller.ts":function(re,Y,j){"use strict";j.r(Y);var G=j("./src/events.ts"),L=j("./src/utils/logger.ts"),P=function(){function H(I){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=I,this.registerListeners()}var O=H.prototype;return O.setStreamController=function(x){this.streamController=x},O.registerListeners=function(){this.hls.on(G.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},O.unregisterListeners=function(){this.hls.off(G.Events.MEDIA_ATTACHING,this.onMediaAttaching)},O.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},O.onMediaAttaching=function(x,p){var m=this.hls.config;if(m.capLevelOnFPSDrop){var h=p.media instanceof self.HTMLVideoElement?p.media:null;this.media=h,h&&typeof h.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),m.fpsDroppedMonitoringPeriod)}},O.checkFPS=function(x,p,m){var h=performance.now();if(p){if(this.lastTime){var r=h-this.lastTime,n=m-this.lastDroppedFrames,a=p-this.lastDecodedFrames,l=1e3*n/r,s=this.hls;if(s.trigger(G.Events.FPS_DROP,{currentDropped:n,currentDecoded:a,totalDroppedFrames:m}),l>0&&n>s.config.fpsDroppedMonitoringThreshold*a){var u=s.currentLevel;L.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+u),u>0&&(s.autoLevelCapping===-1||s.autoLevelCapping>=u)&&(u=u-1,s.trigger(G.Events.FPS_DROP_LEVEL_CAPPING,{level:u,droppedLevel:s.currentLevel}),s.autoLevelCapping=u,this.streamController.nextLevelSwitch())}}this.lastTime=h,this.lastDroppedFrames=m,this.lastDecodedFrames=p}},O.checkFPSInterval=function(){var x=this.media;if(x)if(this.isVideoPlaybackQualityAvailable){var p=x.getVideoPlaybackQuality();this.checkFPS(x,p.totalVideoFrames,p.droppedVideoFrames)}else this.checkFPS(x,x.webkitDecodedFrameCount,x.webkitDroppedFrameCount)},H}();Y.default=P},"./src/controller/fragment-finders.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"findFragmentByPDT",function(){return P}),j.d(Y,"findFragmentByPTS",function(){return H}),j.d(Y,"fragmentWithinToleranceTest",function(){return O}),j.d(Y,"pdtWithinToleranceTest",function(){return I}),j.d(Y,"findFragWithCC",function(){return x});var G=j("./src/polyfills/number.ts"),L=j("./src/utils/binary-search.ts");function P(p,m,h){if(m===null||!Array.isArray(p)||!p.length||!Object(G.isFiniteNumber)(m))return null;var r=p[0].programDateTime;if(m<(r||0))return null;var n=p[p.length-1].endProgramDateTime;if(m>=(n||0))return null;h=h||0;for(var a=0;a<p.length;++a){var l=p[a];if(I(m,h,l))return l}return null}function H(p,m,h,r){h===void 0&&(h=0),r===void 0&&(r=0);var n=null;if(p?n=m[p.sn-m[0].sn+1]||null:h===0&&m[0].start===0&&(n=m[0]),n&&O(h,r,n)===0)return n;var a=L.default.search(m,O.bind(null,h,r));return a||n}function O(p,m,h){p===void 0&&(p=0),m===void 0&&(m=0);var r=Math.min(m,h.duration+(h.deltaPTS?h.deltaPTS:0));return h.start+h.duration-r<=p?1:h.start-r>p&&h.start?-1:0}function I(p,m,h){var r=Math.min(m,h.duration+(h.deltaPTS?h.deltaPTS:0))*1e3,n=h.endProgramDateTime||0;return n-r>p}function x(p,m){return L.default.search(p,function(h){return h.cc<m?1:h.cc>m?-1:0})}},"./src/controller/fragment-tracker.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"FragmentState",function(){return P}),j.d(Y,"FragmentTracker",function(){return H});var G=j("./src/events.ts"),L=j("./src/types/loader.ts"),P;(function(x){x.NOT_LOADED="NOT_LOADED",x.BACKTRACKED="BACKTRACKED",x.APPENDING="APPENDING",x.PARTIAL="PARTIAL",x.OK="OK"})(P||(P={}));var H=function(){function x(m){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=m,this._registerListeners()}var p=x.prototype;return p._registerListeners=function(){var h=this.hls;h.on(G.Events.BUFFER_APPENDED,this.onBufferAppended,this),h.on(G.Events.FRAG_BUFFERED,this.onFragBuffered,this),h.on(G.Events.FRAG_LOADED,this.onFragLoaded,this)},p._unregisterListeners=function(){var h=this.hls;h.off(G.Events.BUFFER_APPENDED,this.onBufferAppended,this),h.off(G.Events.FRAG_BUFFERED,this.onFragBuffered,this),h.off(G.Events.FRAG_LOADED,this.onFragLoaded,this)},p.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},p.getAppendedFrag=function(h,r){if(r===L.PlaylistLevelType.MAIN){var n=this.activeFragment,a=this.activeParts;if(!n)return null;if(a)for(var l=a.length;l--;){var s=a[l],u=s?s.end:n.appendedPTS;if(s.start<=h&&u!==void 0&&h<=u)return l>9&&(this.activeParts=a.slice(l-9)),s}else if(n.start<=h&&n.appendedPTS!==void 0&&h<=n.appendedPTS)return n}return this.getBufferedFrag(h,r)},p.getBufferedFrag=function(h,r){for(var n=this.fragments,a=Object.keys(n),l=a.length;l--;){var s=n[a[l]];if((s==null?void 0:s.body.type)===r&&s.buffered){var u=s.body;if(u.start<=h&&h<=u.end)return u}}return null},p.detectEvictedFragments=function(h,r,n){var a=this;Object.keys(this.fragments).forEach(function(l){var s=a.fragments[l];if(!s)return;if(!s.buffered){s.body.type===n&&a.removeFragment(s.body);return}var u=s.range[h];if(!u)return;u.time.some(function(c){var R=!a.isTimeBuffered(c.startPTS,c.endPTS,r);return R&&a.removeFragment(s.body),R})})},p.detectPartialFragments=function(h){var r=this,n=this.timeRanges,a=h.frag,l=h.part;if(!n||a.sn==="initSegment")return;var s=I(a),u=this.fragments[s];if(!u)return;Object.keys(n).forEach(function(c){var R=a.elementaryStreams[c];if(!R)return;var w=n[c],C=l!==null||R.partial===!0;u.range[c]=r.getBufferedTimes(a,l,C,w)}),u.backtrack=u.loaded=null,Object.keys(u.range).length?u.buffered=!0:this.removeFragment(u.body)},p.fragBuffered=function(h){var r=I(h),n=this.fragments[r];n&&(n.backtrack=n.loaded=null,n.buffered=!0)},p.getBufferedTimes=function(h,r,n,a){for(var l={time:[],partial:n},s=r?r.start:h.start,u=r?r.end:h.end,c=h.minEndPTS||u,R=h.maxStartPTS||s,w=0;w<a.length;w++){var C=a.start(w)-this.bufferPadding,D=a.end(w)+this.bufferPadding;if(R>=C&&c<=D){l.time.push({startPTS:Math.max(s,a.start(w)),endPTS:Math.min(u,a.end(w))});break}else if(s<D&&u>C)l.partial=!0,l.time.push({startPTS:Math.max(s,a.start(w)),endPTS:Math.min(u,a.end(w))});else if(u<=C)break}return l},p.getPartialFragment=function(h){var r=null,n,a,l,s=0,u=this.bufferPadding,c=this.fragments;return Object.keys(c).forEach(function(R){var w=c[R];if(!w)return;O(w)&&(a=w.body.start-u,l=w.body.end+u,h>=a&&h<=l&&(n=Math.min(h-a,l-h),s<=n&&(r=w.body,s=n)))}),r},p.getState=function(h){var r=I(h),n=this.fragments[r];return n?n.buffered?O(n)?P.PARTIAL:P.OK:n.backtrack?P.BACKTRACKED:P.APPENDING:P.NOT_LOADED},p.backtrack=function(h,r){var n=I(h),a=this.fragments[n];if(!a||a.backtrack)return null;var l=a.backtrack=r||a.loaded;return a.loaded=null,l},p.getBacktrackData=function(h){var r=I(h),n=this.fragments[r];if(n){var a,l=n.backtrack;if(l!=null&&(a=l.payload)!==null&&a!==void 0&&a.byteLength)return l;this.removeFragment(h)}return null},p.isTimeBuffered=function(h,r,n){for(var a,l,s=0;s<n.length;s++){if(a=n.start(s)-this.bufferPadding,l=n.end(s)+this.bufferPadding,h>=a&&r<=l)return!0;if(r<=a)return!1}return!1},p.onFragLoaded=function(h,r){var n=r.frag,a=r.part;if(n.sn==="initSegment"||n.bitrateTest||a)return;var l=I(n);this.fragments[l]={body:n,loaded:r,backtrack:null,buffered:!1,range:Object.create(null)}},p.onBufferAppended=function(h,r){var n=this,a=r.frag,l=r.part,s=r.timeRanges;if(a.type===L.PlaylistLevelType.MAIN)if(this.activeFragment=a,l){var u=this.activeParts;u||(this.activeParts=u=[]),u.push(l)}else this.activeParts=null;this.timeRanges=s,Object.keys(s).forEach(function(c){var R=s[c];if(n.detectEvictedFragments(c,R),!l)for(var w=0;w<R.length;w++)a.appendedPTS=Math.max(R.end(w),a.appendedPTS||0)})},p.onFragBuffered=function(h,r){this.detectPartialFragments(r)},p.hasFragment=function(h){var r=I(h);return!!this.fragments[r]},p.removeFragmentsInRange=function(h,r,n){var a=this;Object.keys(this.fragments).forEach(function(l){var s=a.fragments[l];if(!s)return;if(s.buffered){var u=s.body;u.type===n&&u.start<r&&u.end>h&&a.removeFragment(u)}})},p.removeFragment=function(h){var r=I(h);h.stats.loaded=0,h.clearElementaryStreamInfo(),delete this.fragments[r]},p.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},x}();function O(x){var p,m;return x.buffered&&(((p=x.range.video)===null||p===void 0?void 0:p.partial)||((m=x.range.audio)===null||m===void 0?void 0:m.partial))}function I(x){return x.type+"_"+x.level+"_"+x.urlId+"_"+x.sn}},"./src/controller/gap-controller.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"STALL_MINIMUM_DURATION_MS",function(){return O}),j.d(Y,"MAX_START_GAP_JUMP",function(){return I}),j.d(Y,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return x}),j.d(Y,"SKIP_BUFFER_RANGE_START",function(){return p}),j.d(Y,"default",function(){return m});var G=j("./src/utils/buffer-helper.ts"),L=j("./src/errors.ts"),P=j("./src/events.ts"),H=j("./src/utils/logger.ts"),O=250,I=2,x=.1,p=.05,m=function(){function h(n,a,l,s){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=n,this.media=a,this.fragmentTracker=l,this.hls=s}var r=h.prototype;return r.destroy=function(){this.hls=this.fragmentTracker=this.media=null},r.poll=function(a){var l=this.config,s=this.media,u=this.stalled,c=s.currentTime,R=s.seeking,w=this.seeking&&!R,C=!this.seeking&&R;if(this.seeking=R,c!==a){if(this.moved=!0,u!==null){if(this.stallReported){var D=self.performance.now()-u;H.logger.warn("playback not stuck anymore @"+c+", after "+Math.round(D)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((C||w)&&(this.stalled=null),s.paused||s.ended||s.playbackRate===0||!G.BufferHelper.getBuffered(s).length)return;var S=G.BufferHelper.bufferInfo(s,c,0),b=S.len>0,_=S.nextStart||0;if(!b&&!_)return;if(R){var f=S.len>I,d=!_||_-c>I&&!this.fragmentTracker.getPartialFragment(c);if(f||d)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var g,E=Math.max(_,S.start||0)-c,T=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,F=T==null||((g=T.details)===null||g===void 0)?void 0:g.live,U=F?T.details.targetduration*2:I;if(E>0&&E<=U){this._trySkipBufferHole(null);return}}var K=self.performance.now();if(u===null){this.stalled=K;return}var z=K-u;!R&&z>=O&&this._reportStall(S.len);var M=G.BufferHelper.bufferInfo(s,c,l.maxBufferHole);this._tryFixBufferStall(M,z)},r._tryFixBufferStall=function(a,l){var s=this.config,u=this.fragmentTracker,c=this.media,R=c.currentTime,w=u.getPartialFragment(R);if(w){var C=this._trySkipBufferHole(w);if(C)return}a.len>s.maxBufferHole&&l>s.highBufferWatchdogPeriod*1e3&&(H.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},r._reportStall=function(a){var l=this.hls,s=this.media,u=this.stallReported;u||(this.stallReported=!0,H.logger.warn("Playback stalling at @"+s.currentTime+" due to low buffer (buffer="+a+")"),l.trigger(P.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:a}))},r._trySkipBufferHole=function(a){for(var l=this.config,s=this.hls,u=this.media,c=u.currentTime,R=0,w=G.BufferHelper.getBuffered(u),C=0;C<w.length;C++){var D=w.start(C);if(c+l.maxBufferHole>=R&&c<D){var S=Math.max(D+p,u.currentTime+x);return H.logger.warn("skipping hole, adjusting currentTime from "+c+" to "+S),this.moved=!0,this.stalled=null,u.currentTime=S,a&&s.trigger(P.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+c+" to "+S,frag:a}),S}R=w.end(C)}return 0},r._tryNudgeBuffer=function(){var a=this.config,l=this.hls,s=this.media,u=s.currentTime,c=(this.nudgeRetry||0)+1;if(this.nudgeRetry=c,c<a.nudgeMaxRetry){var R=u+c*a.nudgeOffset;H.logger.warn("Nudging 'currentTime' from "+u+" to "+R),s.currentTime=R,l.trigger(P.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else H.logger.error("Playhead still not moving while enough data buffered @"+u+" after "+a.nudgeMaxRetry+" nudges"),l.trigger(P.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},h}()},"./src/controller/id3-track-controller.ts":function(re,Y,j){"use strict";j.r(Y);var G=j("./src/events.ts"),L=j("./src/utils/texttrack-utils.ts"),P=j("./src/demux/id3.ts"),H=.25,O=function(){function I(p){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=p,this._registerListeners()}var x=I.prototype;return x.destroy=function(){this._unregisterListeners()},x._registerListeners=function(){var m=this.hls;m.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.on(G.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.on(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},x._unregisterListeners=function(){var m=this.hls;m.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.off(G.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.off(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},x.onMediaAttached=function(m,h){this.media=h.media},x.onMediaDetaching=function(){if(!this.id3Track)return;Object(L.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},x.getID3Track=function(m){if(!this.media)return;for(var h=0;h<m.length;h++){var r=m[h];if(r.kind==="metadata"&&r.label==="id3")return Object(L.sendAddTrackEvent)(r,this.media),r}return this.media.addTextTrack("metadata","id3")},x.onFragParsingMetadata=function(m,h){if(!this.media)return;var r=h.frag,n=h.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var a=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,l=0;l<n.length;l++){var s=P.getID3Frames(n[l].data);if(s){var u=n[l].pts,c=l<n.length-1?n[l+1].pts:r.end,R=c-u;R<=0&&(c=u+H);for(var w=0;w<s.length;w++){var C=s[w];if(!P.isTimeStampFrame(C)){var D=new a(u,c,"");D.value=C,this.id3Track.addCue(D)}}}}},x.onBufferFlushing=function(m,h){var r=h.startOffset,n=h.endOffset,a=h.type;if(!a||a==="audio"){var l=this.id3Track;l&&Object(L.removeCuesInRange)(l,r,n)}},I}();Y.default=O},"./src/controller/latency-controller.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"default",function(){return I});var G=j("./src/errors.ts"),L=j("./src/events.ts"),P=j("./src/utils/logger.ts");function H(x,p){for(var m=0;m<p.length;m++){var h=p[m];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(x,h.key,h)}}function O(x,p,m){return p&&H(x.prototype,p),m&&H(x,m),x}var I=function(){function x(m){var h=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 h.timeupdate()},this.hls=m,this.config=m.config,this.registerListeners()}var p=x.prototype;return p.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},p.registerListeners=function(){this.hls.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(L.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(L.Events.ERROR,this.onError,this)},p.unregisterListeners=function(){this.hls.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(L.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(L.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(L.Events.ERROR,this.onError)},p.onMediaAttached=function(h,r){this.media=r.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},p.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},p.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},p.onLevelUpdated=function(h,r){var n=r.details;this.levelDetails=n,n.advanced&&this.timeupdate(),!n.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},p.onError=function(h,r){if(r.details!==G.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,P.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},p.timeupdate=function(){var h=this.media,r=this.levelDetails;if(!h||!r)return;this.currentTime=h.currentTime;var n=this.computeLatency();if(n===null)return;this._latency=n;var a=this.config,l=a.lowLatencyMode,s=a.maxLiveSyncPlaybackRate;if(!l||s===1)return;var u=this.targetLatency;if(u===null)return;var c=n-u,R=Math.min(this.maxLatency,u+r.targetduration),w=c<R;if(r.live&&w&&c>.05&&this.forwardBufferLength>1){var C=Math.min(2,Math.max(1,s)),D=Math.round(2/(1+Math.exp(-.75*c-this.edgeStalled))*20)/20;h.playbackRate=Math.min(C,Math.max(1,D))}else h.playbackRate!==1&&h.playbackRate!==0&&(h.playbackRate=1)},p.estimateLiveEdge=function(){var h=this.levelDetails;return h===null?null:h.edge+h.age},p.computeLatency=function(){var h=this.estimateLiveEdge();return h===null?null:h-this.currentTime},O(x,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var h=this.config,r=this.levelDetails;return h.liveMaxLatencyDuration!==void 0?h.liveMaxLatencyDuration:r?h.liveMaxLatencyDurationCount*r.targetduration:0}},{key:"targetLatency",get:function(){var h=this.levelDetails;if(h===null)return null;var r=h.holdBack,n=h.partHoldBack,a=h.targetduration,l=this.config,s=l.liveSyncDuration,u=l.liveSyncDurationCount,c=l.lowLatencyMode,R=this.hls.userConfig,w=c&&n||r;(R.liveSyncDuration||R.liveSyncDurationCount||w===0)&&(w=s!==void 0?s:u*a);var C=a,D=1;return w+Math.min(this.stallCount*D,C)}},{key:"liveSyncPosition",get:function(){var h=this.estimateLiveEdge(),r=this.targetLatency,n=this.levelDetails;if(h===null||r===null||n===null)return null;var a=n.edge,l=h-r-this.edgeStalled,s=a-n.totalduration,u=a-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(s,l),u)}},{key:"drift",get:function(){var h=this.levelDetails;return h===null?1:h.drift}},{key:"edgeStalled",get:function(){var h=this.levelDetails;if(h===null)return 0;var r=(this.config.lowLatencyMode&&h.partTarget||h.targetduration)*3;return Math.max(h.age-r,0)}},{key:"forwardBufferLength",get:function(){var h=this.media,r=this.levelDetails;if(!h||!r)return 0;var n=h.buffered.length;return n?h.buffered.end(n-1):r.edge-this.currentTime}}]),x}()},"./src/controller/level-controller.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"default",function(){return l});var G=j("./src/types/level.ts"),L=j("./src/events.ts"),P=j("./src/errors.ts"),H=j("./src/utils/codecs.ts"),O=j("./src/controller/level-helper.ts"),I=j("./src/controller/base-playlist-controller.ts"),x=j("./src/types/loader.ts");function p(){return p=Object.assign||function(s){for(var u=1;u<arguments.length;u++){var c=arguments[u];for(var R in c)Object.prototype.hasOwnProperty.call(c,R)&&(s[R]=c[R])}return s},p.apply(this,arguments)}function m(s,u){for(var c=0;c<u.length;c++){var R=u[c];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(s,R.key,R)}}function h(s,u,c){return u&&m(s.prototype,u),c&&m(s,c),s}function r(s,u){s.prototype=Object.create(u.prototype),s.prototype.constructor=s,n(s,u)}function n(s,u){return n=Object.setPrototypeOf||function(R,w){return R.__proto__=w,R},n(s,u)}var a=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),l=function(s){r(u,s);function u(R){var w;return w=s.call(this,R,"[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 c=u.prototype;return c._registerListeners=function(){var w=this.hls;w.on(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),w.on(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.on(L.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),w.on(L.Events.FRAG_LOADED,this.onFragLoaded,this),w.on(L.Events.ERROR,this.onError,this)},c._unregisterListeners=function(){var w=this.hls;w.off(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),w.off(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.off(L.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),w.off(L.Events.FRAG_LOADED,this.onFragLoaded,this),w.off(L.Events.ERROR,this.onError,this)},c.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,s.prototype.destroy.call(this)},c.startLoad=function(){var w=this._levels;w.forEach(function(C){C.loadError=0}),s.prototype.startLoad.call(this)},c.onManifestLoaded=function(w,C){var D=[],S=[],b=[],_,f={},d,g=!1,E=!1,T=!1;if(C.levels.forEach(function(z){var M=z.attrs;g=g||!!(z.width&&z.height),E=E||!!z.videoCodec,T=T||!!z.audioCodec,a&&z.audioCodec&&z.audioCodec.indexOf("mp4a.40.34")!==-1&&(z.audioCodec=void 0);var y=z.bitrate+"-"+z.attrs.RESOLUTION+"-"+z.attrs.CODECS;d=f[y],d?d.url.push(z.url):(d=new G.Level(z),f[y]=d,D.push(d)),M&&(M.AUDIO&&Object(O.addGroupId)(d,"audio",M.AUDIO),M.SUBTITLES&&Object(O.addGroupId)(d,"text",M.SUBTITLES))}),(g||E)&&T&&(D=D.filter(function(z){var M=z.videoCodec,y=z.width,W=z.height;return!!M||!!(y&&W)})),D=D.filter(function(z){var M=z.audioCodec,y=z.videoCodec;return(!M||Object(H.isCodecSupportedInMp4)(M,"audio"))&&(!y||Object(H.isCodecSupportedInMp4)(y,"video"))}),C.audioTracks&&(S=C.audioTracks.filter(function(z){return!z.audioCodec||Object(H.isCodecSupportedInMp4)(z.audioCodec,"audio")}),Object(O.assignTrackIdsByGroup)(S)),C.subtitles&&(b=C.subtitles,Object(O.assignTrackIdsByGroup)(b)),D.length>0){_=D[0].bitrate,D.sort(function(z,M){return z.bitrate-M.bitrate}),this._levels=D;for(var F=0;F<D.length;F++)if(D[F].bitrate===_){this._firstLevel=F,this.log("manifest loaded, "+D.length+" level(s) found, first bitrate: "+_);break}var U=T&&!E,K={levels:D,audioTracks:S,subtitleTracks:b,firstLevel:this._firstLevel,stats:C.stats,audio:T,video:E,altAudio:!U&&S.some(function(z){return!!z.url})};this.hls.trigger(L.Events.MANIFEST_PARSED,K),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(L.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:C.url,reason:"no level with compatible codecs found in manifest"})},c.onError=function(w,C){if(s.prototype.onError.call(this,w,C),C.fatal)return;var D=C.context,S=this._levels[this.currentLevelIndex];if(D&&(D.type===x.PlaylistContextType.AUDIO_TRACK&&S.audioGroupIds&&D.groupId===S.audioGroupIds[S.urlId]||D.type===x.PlaylistContextType.SUBTITLE_TRACK&&S.textGroupIds&&D.groupId===S.textGroupIds[S.urlId])){this.redundantFailover(this.currentLevelIndex);return}var b=!1,_=!0,f;switch(C.details){case P.ErrorDetails.FRAG_LOAD_ERROR:case P.ErrorDetails.FRAG_LOAD_TIMEOUT:case P.ErrorDetails.KEY_LOAD_ERROR:case P.ErrorDetails.KEY_LOAD_TIMEOUT:if(C.frag){var d=this._levels[C.frag.level];d?(d.fragmentError++,d.fragmentError>this.hls.config.fragLoadingMaxRetry&&(f=C.frag.level)):f=C.frag.level}break;case P.ErrorDetails.LEVEL_LOAD_ERROR:case P.ErrorDetails.LEVEL_LOAD_TIMEOUT:D&&(D.deliveryDirectives&&(_=!1),f=D.level),b=!0;break;case P.ErrorDetails.REMUX_ALLOC_ERROR:f=C.level,b=!0;break}f!==void 0&&this.recoverLevel(C,f,b,_)},c.recoverLevel=function(w,C,D,S){var b=w.details,_=this._levels[C];if(_.loadError++,D){var f=this.retryLoadingOrFail(w);if(f)w.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(S){var d=_.url.length;if(d>1&&_.loadError<d)w.levelRetry=!0,this.redundantFailover(C);else if(this.manualLevelIndex===-1){var g=C===0?this._levels.length-1:C-1;this.currentLevelIndex!==g&&this._levels[g].loadError===0&&(this.warn(b+": switch to "+g),w.levelRetry=!0,this.hls.nextAutoLevel=g)}}},c.redundantFailover=function(w){var C=this._levels[w],D=C.url.length;if(D>1){var S=(C.urlId+1)%D;this.warn("Switching to redundant URL-id "+S),this._levels.forEach(function(b){b.urlId=S}),this.level=w}},c.onFragLoaded=function(w,C){var D=C.frag;if(D!==void 0&&D.type===x.PlaylistLevelType.MAIN){var S=this._levels[D.level];S!==void 0&&(S.fragmentError=0,S.loadError=0)}},c.onLevelLoaded=function(w,C){var D,S=C.level,b=C.details,_=this._levels[S];if(!_){var f;this.warn("Invalid level index "+S),(f=C.deliveryDirectives)!==null&&f!==void 0&&f.skip&&(b.deltaUpdateFailed=!0);return}S===this.currentLevelIndex?(_.fragmentError===0&&(_.loadError=0,this.retryCount=0),this.playlistLoaded(S,C,_.details)):(D=C.deliveryDirectives)!==null&&D!==void 0&&D.skip&&(b.deltaUpdateFailed=!0)},c.onAudioTrackSwitched=function(w,C){var D=this.hls.levels[this.currentLevelIndex];if(!D)return;if(D.audioGroupIds){for(var S=-1,b=this.hls.audioTracks[C.id].groupId,_=0;_<D.audioGroupIds.length;_++)if(D.audioGroupIds[_]===b){S=_;break}S!==D.urlId&&(D.urlId=S,this.startLoad())}},c.loadPlaylist=function(w){var C=this.currentLevelIndex,D=this._levels[C];if(this.canLoad&&D&&D.url.length>0){var S=D.urlId,b=D.url[S];if(w)try{b=w.addDirectives(b)}catch(_){this.warn("Could not construct new URL with HLS Delivery Directives: "+_)}this.log("Attempt loading level index "+C+(w?" at sn "+w.msn+" part "+w.part:"")+" with URL-id "+S+" "+b),this.clearTimer(),this.hls.trigger(L.Events.LEVEL_LOADING,{url:b,level:C,id:S,deliveryDirectives:w||null})}},c.removeLevel=function(w,C){var D=function(_,f){return f!==C},S=this._levels.filter(function(b,_){return _!==w?!0:b.url.length>1&&C!==void 0?(b.url=b.url.filter(D),b.audioGroupIds&&(b.audioGroupIds=b.audioGroupIds.filter(D)),b.textGroupIds&&(b.textGroupIds=b.textGroupIds.filter(D)),b.urlId=0,!0):!1}).map(function(b,_){var f=b.details;return f!=null&&f.fragments&&f.fragments.forEach(function(d){d.level=_}),b});this._levels=S,this.hls.trigger(L.Events.LEVELS_UPDATED,{levels:S})},h(u,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(w){var C,D=this._levels;if(D.length===0)return;if(this.currentLevelIndex===w&&(C=D[w])!==null&&C!==void 0&&C.details)return;if(w<0||w>=D.length){var S=w<0;if(this.hls.trigger(L.Events.ERROR,{type:P.ErrorTypes.OTHER_ERROR,details:P.ErrorDetails.LEVEL_SWITCH_ERROR,level:w,fatal:S,reason:"invalid level idx"}),S)return;w=Math.min(w,D.length-1)}this.clearTimer();var b=this.currentLevelIndex,_=D[b],f=D[w];this.log("switching to level "+w+" from "+b),this.currentLevelIndex=w;var d=p({},f,{level:w,maxBitrate:f.maxBitrate,uri:f.uri,urlId:f.urlId});delete d._urlId,this.hls.trigger(L.Events.LEVEL_SWITCHING,d);var g=f.details;if(!g||g.live){var E=this.switchParams(f.uri,_==null?void 0:_.details);this.loadPlaylist(E)}}},{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)}}]),u}(I.default)},"./src/controller/level-helper.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"addGroupId",function(){return P}),j.d(Y,"assignTrackIdsByGroup",function(){return H}),j.d(Y,"updatePTS",function(){return O}),j.d(Y,"updateFragPTSDTS",function(){return x}),j.d(Y,"mergeDetails",function(){return p}),j.d(Y,"mapPartIntersection",function(){return m}),j.d(Y,"mapFragmentIntersection",function(){return h}),j.d(Y,"adjustSliding",function(){return r}),j.d(Y,"addSliding",function(){return n}),j.d(Y,"computeReloadInterval",function(){return a}),j.d(Y,"getFragmentWithSN",function(){return l}),j.d(Y,"getPartWith",function(){return s});var G=j("./src/polyfills/number.ts"),L=j("./src/utils/logger.ts");function P(u,c,R){switch(c){case"audio":u.audioGroupIds||(u.audioGroupIds=[]),u.audioGroupIds.push(R);break;case"text":u.textGroupIds||(u.textGroupIds=[]),u.textGroupIds.push(R);break}}function H(u){var c={};u.forEach(function(R){var w=R.groupId||"";R.id=c[w]=c[w]||0,c[w]++})}function O(u,c,R){var w=u[c],C=u[R];I(w,C)}function I(u,c){var R=c.startPTS;if(Object(G.isFiniteNumber)(R)){var w=0,C;c.sn>u.sn?(w=R-u.start,C=u):(w=u.start-R,C=c),C.duration!==w&&(C.duration=w)}else if(c.sn>u.sn){var D=u.cc===c.cc;D&&u.minEndPTS?c.start=u.start+(u.minEndPTS-u.start):c.start=u.start+u.duration}else c.start=Math.max(u.start-c.duration,0)}function x(u,c,R,w,C,D){var S=w-R;S<=0&&(L.logger.warn("Fragment should have a positive duration",c),w=R+c.duration,D=C+c.duration);var b=R,_=w,f=c.startPTS,d=c.endPTS;if(Object(G.isFiniteNumber)(f)){var g=Math.abs(f-R);Object(G.isFiniteNumber)(c.deltaPTS)?c.deltaPTS=Math.max(g,c.deltaPTS):c.deltaPTS=g,b=Math.max(R,f),R=Math.min(R,f),C=Math.min(C,c.startDTS),_=Math.min(w,d),w=Math.max(w,d),D=Math.max(D,c.endDTS)}c.duration=w-R;var E=R-c.start;c.appendedPTS=w,c.start=c.startPTS=R,c.maxStartPTS=b,c.startDTS=C,c.endPTS=w,c.minEndPTS=_,c.endDTS=D;var T=c.sn;if(!u||T<u.startSN||T>u.endSN)return 0;var F,U=T-u.startSN,K=u.fragments;for(K[U]=c,F=U;F>0;F--)I(K[F],K[F-1]);for(F=U;F<K.length-1;F++)I(K[F],K[F+1]);return u.fragmentHint&&I(K[K.length-1],u.fragmentHint),u.PTSKnown=u.alignedSliding=!0,E}function p(u,c){for(var R=null,w=u.fragments,C=w.length-1;C>=0;C--){var D=w[C].initSegment;if(D){R=D;break}}u.fragmentHint&&delete u.fragmentHint.endPTS;var S=0,b;if(h(u,c,function(F,U){F.relurl&&(S=F.cc-U.cc),Object(G.isFiniteNumber)(F.startPTS)&&Object(G.isFiniteNumber)(F.endPTS)&&(U.start=U.startPTS=F.startPTS,U.startDTS=F.startDTS,U.appendedPTS=F.appendedPTS,U.maxStartPTS=F.maxStartPTS,U.endPTS=F.endPTS,U.endDTS=F.endDTS,U.minEndPTS=F.minEndPTS,U.duration=F.endPTS-F.startPTS,U.duration&&(b=U),c.PTSKnown=c.alignedSliding=!0),U.elementaryStreams=F.elementaryStreams,U.loader=F.loader,U.stats=F.stats,U.urlId=F.urlId,F.initSegment&&(U.initSegment=F.initSegment,R=F.initSegment)}),R){var _=c.fragmentHint?c.fragments.concat(c.fragmentHint):c.fragments;_.forEach(function(F){var U;(!F.initSegment||F.initSegment.relurl===((U=R)===null||U===void 0?void 0:U.relurl))&&(F.initSegment=R)})}if(c.skippedSegments&&(c.deltaUpdateFailed=c.fragments.some(function(F){return!F}),c.deltaUpdateFailed)){L.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var f=c.skippedSegments;f--;)c.fragments.shift();c.startSN=c.fragments[0].sn,c.startCC=c.fragments[0].cc}var d=c.fragments;if(S){L.logger.warn("discontinuity sliding from playlist, take drift into account");for(var g=0;g<d.length;g++)d[g].cc+=S}c.skippedSegments&&(c.startCC=c.fragments[0].cc),m(u.partList,c.partList,function(F,U){U.elementaryStreams=F.elementaryStreams,U.stats=F.stats}),b?x(c,b,b.startPTS,b.endPTS,b.startDTS,b.endDTS):r(u,c),d.length&&(c.totalduration=c.edge-d[0].start),c.driftStartTime=u.driftStartTime,c.driftStart=u.driftStart;var E=c.advancedDateTime;if(c.advanced&&E){var T=c.edge;c.driftStart||(c.driftStartTime=E,c.driftStart=T),c.driftEndTime=E,c.driftEnd=T}else c.driftEndTime=u.driftEndTime,c.driftEnd=u.driftEnd,c.advancedDateTime=u.advancedDateTime}function m(u,c,R){if(u&&c)for(var w=0,C=0,D=u.length;C<=D;C++){var S=u[C],b=c[C+w];S&&b&&S.index===b.index&&S.fragment.sn===b.fragment.sn?R(S,b):w--}}function h(u,c,R){for(var w=c.skippedSegments,C=Math.max(u.startSN,c.startSN)-c.startSN,D=(u.fragmentHint?1:0)+(w?c.endSN:Math.min(u.endSN,c.endSN))-c.startSN,S=c.startSN-u.startSN,b=c.fragmentHint?c.fragments.concat(c.fragmentHint):c.fragments,_=u.fragmentHint?u.fragments.concat(u.fragmentHint):u.fragments,f=C;f<=D;f++){var d=_[S+f],g=b[f];w&&!g&&f<w&&(g=c.fragments[f]=d),d&&g&&R(d,g)}}function r(u,c){var R=c.startSN+c.skippedSegments-u.startSN,w=u.fragments;if(R<0||R>=w.length)return;n(c,w[R].start)}function n(u,c){if(c){for(var R=u.fragments,w=u.skippedSegments;w<R.length;w++)R[w].start+=c;u.fragmentHint&&(u.fragmentHint.start+=c)}}function a(u,c){var R=1e3*u.levelTargetDuration,w=R/2,C=u.age,D=C>0&&C<R*3,S=c.loading.end-c.loading.start,b,_=u.availabilityDelay;if(u.updated===!1)if(D){var f=333*u.misses;b=Math.max(Math.min(w,S*2),f),u.availabilityDelay=(u.availabilityDelay||0)+b}else b=w;else D?(_=Math.min(_||R/2,C),u.availabilityDelay=_,b=_+R-C):b=R-S;return Math.round(b)}function l(u,c,R){if(!u||!u.details)return null;var w=u.details,C=w.fragments[c-w.startSN];return C||(C=w.fragmentHint,C&&C.sn===c?C:c<w.startSN&&R&&R.sn===c?R:null)}function s(u,c,R){if(!u||!u.details)return null;var w=u.details.partList;if(w)for(var C=w.length;C--;){var D=w[C];if(D.index===R&&D.fragment.sn===c)return D}return null}},"./src/controller/stream-controller.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"default",function(){return w});var G=j("./src/polyfills/number.ts"),L=j("./src/controller/base-stream-controller.ts"),P=j("./src/is-supported.ts"),H=j("./src/events.ts"),O=j("./src/utils/buffer-helper.ts"),I=j("./src/controller/fragment-tracker.ts"),x=j("./src/types/loader.ts"),p=j("./src/loader/fragment.ts"),m=j("./src/demux/transmuxer-interface.ts"),h=j("./src/types/transmuxer.ts"),r=j("./src/controller/gap-controller.ts"),n=j("./src/errors.ts"),a=j("./src/utils/logger.ts");function l(C,D){for(var S=0;S<D.length;S++){var b=D[S];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(C,b.key,b)}}function s(C,D,S){return D&&l(C.prototype,D),S&&l(C,S),C}function u(C,D){C.prototype=Object.create(D.prototype),C.prototype.constructor=C,c(C,D)}function c(C,D){return c=Object.setPrototypeOf||function(b,_){return b.__proto__=_,b},c(C,D)}var R=100,w=function(C){u(D,C);function D(b,_){var f;return f=C.call(this,b,_,"[stream-controller]")||this,f.audioCodecSwap=!1,f.gapController=null,f.level=-1,f._forceStartLoad=!1,f.altAudio=!1,f.audioOnly=!1,f.fragPlaying=null,f.onvplaying=null,f.onvseeked=null,f.fragLastKbps=0,f.stalled=!1,f.couldBacktrack=!1,f.audioCodecSwitch=!1,f.videoBuffer=null,f._registerListeners(),f}var S=D.prototype;return S._registerListeners=function(){var _=this.hls;_.on(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),_.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),_.on(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),_.on(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),_.on(H.Events.LEVEL_LOADING,this.onLevelLoading,this),_.on(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.on(H.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),_.on(H.Events.ERROR,this.onError,this),_.on(H.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),_.on(H.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),_.on(H.Events.BUFFER_CREATED,this.onBufferCreated,this),_.on(H.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),_.on(H.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),_.on(H.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S._unregisterListeners=function(){var _=this.hls;_.off(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),_.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),_.off(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),_.off(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),_.off(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.off(H.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),_.off(H.Events.ERROR,this.onError,this),_.off(H.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),_.off(H.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),_.off(H.Events.BUFFER_CREATED,this.onBufferCreated,this),_.off(H.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),_.off(H.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),_.off(H.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},S.startLoad=function(_){if(this.levels){var f=this.lastCurrentTime,d=this.hls;if(this.stopLoad(),this.setInterval(R),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var g=d.startLevel;g===-1&&(d.config.testBandwidth?(g=0,this.bitrateTest=!0):g=d.nextAutoLevel),this.level=d.nextLoadLevel=g,this.loadedmetadata=!1}f>0&&_===-1&&(this.log("Override startPosition with lastCurrentTime @"+f.toFixed(3)),_=f),this.state=L.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=_,this.tick()}else this._forceStartLoad=!0,this.state=L.State.STOPPED},S.stopLoad=function(){this._forceStartLoad=!1,C.prototype.stopLoad.call(this)},S.doTick=function(){switch(this.state){case L.State.IDLE:this.doTickIdle();break;case L.State.WAITING_LEVEL:{var _,f=this.levels,d=this.level,g=f==null||((_=f[d])===null||_===void 0)?void 0:_.details;if(g&&(!g.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(g))break;this.state=L.State.IDLE;break}break}case L.State.FRAG_LOADING_WAITING_RETRY:{var E,T=self.performance.now(),F=this.retryDate;(!F||T>=F||(E=this.media)!==null&&E!==void 0&&E.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=L.State.IDLE)}break;default:break}this.onTickEnd()},S.onTickEnd=function(){C.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},S.doTickIdle=function(){var _,f,d=this.hls,g=this.levelLastLoaded,E=this.levels,T=this.media,F=d.config,U=d.nextLoadLevel;if(g===null||!T&&(this.startFragRequested||!F.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!E||!E[U])return;var K=E[U];this.level=d.nextLoadLevel=U;var z=K.details;if(!z||this.state===L.State.WAITING_LEVEL||z.live&&this.levelLastLoaded!==U){this.state=L.State.WAITING_LEVEL;return}var M=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:T,x.PlaylistLevelType.MAIN);if(M===null)return;var y=M.len,W=this.getMaxBufferLength(K.maxBitrate);if(y>=W)return;if(this._streamEnded(M,z)){var X={};this.altAudio&&(X.type="video"),this.hls.trigger(H.Events.BUFFER_EOS,X),this.state=L.State.ENDED;return}var te=M.end,pe=this.getNextFragment(te,z);if(this.couldBacktrack&&!this.fragPrevious&&pe&&pe.sn!=="initSegment"){var Ie=pe.sn-z.startSN;Ie>1&&(pe=z.fragments[Ie-1],this.fragmentTracker.removeFragment(pe))}if(pe&&this.fragmentTracker.getState(pe)===I.FragmentState.OK&&this.nextLoadPosition>te){var Ee=this.audioOnly&&!this.altAudio?p.ElementaryStreamTypes.AUDIO:p.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(T,Ee,x.PlaylistLevelType.MAIN),pe=this.getNextFragment(this.nextLoadPosition,z)}if(!pe)return;pe.initSegment&&!pe.initSegment.data&&!this.bitrateTest&&(pe=pe.initSegment),((_=pe.decryptdata)===null||_===void 0?void 0:_.keyFormat)==="identity"&&!((f=pe.decryptdata)!==null&&f!==void 0&&f.key)?this.loadKey(pe,z):this.loadFragment(pe,z,te)},S.loadFragment=function(_,f,d){var g,E=this.fragmentTracker.getState(_);if(this.fragCurrent=_,E===I.FragmentState.BACKTRACKED){var T=this.fragmentTracker.getBacktrackData(_);if(T){this._handleFragmentLoadProgress(T),this._handleFragmentLoadComplete(T);return}else E=I.FragmentState.NOT_LOADED}E===I.FragmentState.NOT_LOADED||E===I.FragmentState.PARTIAL?_.sn==="initSegment"?this._loadInitSegment(_):this.bitrateTest?(_.bitrateTest=!0,this.log("Fragment "+_.sn+" of level "+_.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(_)):(this.startFragRequested=!0,C.prototype.loadFragment.call(this,_,f,d)):E===I.FragmentState.APPENDING?this.reduceMaxBufferLength(_.duration)&&this.fragmentTracker.removeFragment(_):((g=this.media)===null||g===void 0?void 0:g.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},S.getAppendedFrag=function(_){var f=this.fragmentTracker.getAppendedFrag(_,x.PlaylistLevelType.MAIN);return f&&"fragment"in f?f.fragment:f},S.getBufferedFrag=function(_){return this.fragmentTracker.getBufferedFrag(_,x.PlaylistLevelType.MAIN)},S.followingBufferedFrag=function(_){return _?this.getBufferedFrag(_.end+.5):null},S.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},S.nextLevelSwitch=function(){var _=this.levels,f=this.media;if(f!=null&&f.readyState){var d,g=this.getAppendedFrag(f.currentTime);if(g&&g.start>1&&this.flushMainBuffer(0,g.start-1),!f.paused&&_){var E=this.hls.nextLoadLevel,T=_[E],F=this.fragLastKbps;F&&this.fragCurrent?d=this.fragCurrent.duration*T.maxBitrate/(1e3*F)+1:d=0}else d=0;var U=this.getBufferedFrag(f.currentTime+d);if(U){var K=this.followingBufferedFrag(U);if(K){this.abortCurrentFrag();var z=K.maxStartPTS?K.maxStartPTS:K.start,M=K.duration,y=Math.max(U.end,z+Math.min(Math.max(M-this.config.maxFragLookUpTolerance,M*.5),M*.75));this.flushMainBuffer(y,Number.POSITIVE_INFINITY)}}}},S.abortCurrentFrag=function(){var _=this.fragCurrent;this.fragCurrent=null,_!=null&&_.loader&&_.loader.abort(),this.state===L.State.KEY_LOADING&&(this.state=L.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},S.flushMainBuffer=function(_,f){C.prototype.flushMainBuffer.call(this,_,f,this.altAudio?"video":null)},S.onMediaAttached=function(_,f){C.prototype.onMediaAttached.call(this,_,f);var d=f.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),d.addEventListener("playing",this.onvplaying),d.addEventListener("seeked",this.onvseeked),this.gapController=new r.default(this.config,d,this.fragmentTracker,this.hls)},S.onMediaDetaching=function(){var _=this.media;_&&(_.removeEventListener("playing",this.onvplaying),_.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),C.prototype.onMediaDetaching.call(this)},S.onMediaPlaying=function(){this.tick()},S.onMediaSeeked=function(){var _=this.media,f=_?_.currentTime:null;Object(G.isFiniteNumber)(f)&&this.log("Media seeked to "+f.toFixed(3)),this.tick()},S.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(H.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},S.onManifestParsed=function(_,f){var d=!1,g=!1,E;f.levels.forEach(function(T){E=T.audioCodec,E&&(E.indexOf("mp4a.40.2")!==-1&&(d=!0),E.indexOf("mp4a.40.5")!==-1&&(g=!0))}),this.audioCodecSwitch=d&&g&&!Object(P.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=f.levels,this.startFragRequested=!1},S.onLevelLoading=function(_,f){var d=this.levels;if(!d||this.state!==L.State.IDLE)return;var g=d[f.level];(!g.details||g.details.live&&this.levelLastLoaded!==f.level||this.waitForCdnTuneIn(g.details))&&(this.state=L.State.WAITING_LEVEL)},S.onLevelLoaded=function(_,f){var d,g=this.levels,E=f.level,T=f.details,F=T.totalduration;if(!g){this.warn("Levels were reset while loading level "+E);return}this.log("Level "+E+" loaded ["+T.startSN+","+T.endSN+"], cc ["+T.startCC+", "+T.endCC+"] duration:"+F);var U=this.fragCurrent;U&&(this.state===L.State.FRAG_LOADING||this.state===L.State.FRAG_LOADING_WAITING_RETRY)&&(U.level!==f.level&&U.loader&&(this.state=L.State.IDLE,U.loader.abort()));var K=g[E],z=0;if(T.live||(d=K.details)!==null&&d!==void 0&&d.live){if(T.fragments[0]||(T.deltaUpdateFailed=!0),T.deltaUpdateFailed)return;z=this.alignPlaylists(T,K.details)}if(K.details=T,this.levelLastLoaded=E,this.hls.trigger(H.Events.LEVEL_UPDATED,{details:T,level:E}),this.state===L.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(T))return;this.state=L.State.IDLE}this.startFragRequested?T.live&&this.synchronizeToLiveEdge(T):this.setStartPosition(T,z),this.tick()},S._handleFragmentLoadProgress=function(_){var f,d=_.frag,g=_.part,E=_.payload,T=this.levels;if(!T){this.warn("Levels were reset while fragment load was in progress. Fragment "+d.sn+" of level "+d.level+" will not be buffered");return}var F=T[d.level],U=F.details;if(!U){this.warn("Dropping fragment "+d.sn+" of level "+d.level+" after level details were reset");return}var K=F.videoCodec,z=U.PTSKnown||!U.live,M=(f=d.initSegment)===null||f===void 0?void 0:f.data,y=this._getAudioCodec(F),W=this.transmuxer=this.transmuxer||new m.default(this.hls,x.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),X=g?g.index:-1,te=X!==-1,pe=new h.ChunkMetadata(d.level,d.sn,d.stats.chunkCount,E.byteLength,X,te),Ie=this.initPTS[d.cc];W.push(E,M,y,K,d,g,U.totalduration,z,pe,Ie)},S.onAudioTrackSwitching=function(_,f){var d=this.altAudio,g=!!f.url,E=f.id;if(!g){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var T=this.fragCurrent;T!=null&&T.loader&&(this.log("Switching to main audio track, cancel main fragment load"),T.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var F=this.hls;d&&F.trigger(H.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),F.trigger(H.Events.AUDIO_TRACK_SWITCHED,{id:E})}},S.onAudioTrackSwitched=function(_,f){var d=f.id,g=!!this.hls.audioTracks[d].url;if(g){var E=this.videoBuffer;E&&this.mediaBuffer!==E&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=E)}this.altAudio=g,this.tick()},S.onBufferCreated=function(_,f){var d=f.tracks,g,E,T=!1;for(var F in d){var U=d[F];if(U.id==="main"){if(E=F,g=U,F==="video"){var K=d[F];K&&(this.videoBuffer=K.buffer)}}else T=!0}T&&g?(this.log("Alternate track found, use "+E+".buffered to schedule main fragment loading"),this.mediaBuffer=g.buffer):this.mediaBuffer=this.media},S.onFragBuffered=function(_,f){var d=f.frag,g=f.part;if(d&&d.type!==x.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(d)){this.warn("Fragment "+d.sn+(g?" p: "+g.index:"")+" of level "+d.level+" finished buffering, but was aborted. state: "+this.state),this.state===L.State.PARSED&&(this.state=L.State.IDLE);return}var E=g?g.stats:d.stats;this.fragLastKbps=Math.round(8*E.total/(E.buffering.end-E.loading.first)),d.sn!=="initSegment"&&(this.fragPrevious=d),this.fragBufferedComplete(d,g)},S.onError=function(_,f){switch(f.details){case n.ErrorDetails.FRAG_LOAD_ERROR:case n.ErrorDetails.FRAG_LOAD_TIMEOUT:case n.ErrorDetails.KEY_LOAD_ERROR:case n.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(x.PlaylistLevelType.MAIN,f);break;case n.ErrorDetails.LEVEL_LOAD_ERROR:case n.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==L.State.ERROR&&(f.fatal?(this.warn(""+f.details),this.state=L.State.ERROR):!f.levelRetry&&this.state===L.State.WAITING_LEVEL&&(this.state=L.State.IDLE));break;case n.ErrorDetails.BUFFER_FULL_ERROR:if(f.parent==="main"&&(this.state===L.State.PARSING||this.state===L.State.PARSED)){var d=!0,g=this.getFwdBufferInfo(this.media,x.PlaylistLevelType.MAIN);g&&g.len>.5&&(d=!this.reduceMaxBufferLength(g.len)),d&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},S.checkBuffer=function(){var _=this.media,f=this.gapController;if(!_||!f||!_.readyState)return;var d=O.BufferHelper.getBuffered(_);!this.loadedmetadata&&d.length?(this.loadedmetadata=!0,this.seekToStartPos()):f.poll(this.lastCurrentTime),this.lastCurrentTime=_.currentTime},S.onFragLoadEmergencyAborted=function(){this.state=L.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},S.onBufferFlushed=function(_,f){var d=f.type;if(d!==p.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var g=(d===p.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(g,d,x.PlaylistLevelType.MAIN)}},S.onLevelsUpdated=function(_,f){this.levels=f.levels},S.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},S.seekToStartPos=function(){var _=this.media,f=_.currentTime,d=this.startPosition;if(d>=0&&f<d){if(_.seeking){a.logger.log("could not seek to "+d+", already seeking at "+f);return}var g=O.BufferHelper.getBuffered(_),E=g.length?g.start(0):0,T=E-d;T>0&&(T<this.config.maxBufferHole||T<this.config.maxFragLookUpTolerance)&&(a.logger.log("adjusting start position by "+T+" to match buffer start"),d+=T,this.startPosition=d),this.log("seek to target start position "+d+" from current time "+f),_.currentTime=d}},S._getAudioCodec=function(_){var f=this.config.defaultAudioCodec||_.audioCodec;return this.audioCodecSwap&&f&&(this.log("Swapping audio codec"),f.indexOf("mp4a.40.5")!==-1?f="mp4a.40.2":f="mp4a.40.5"),f},S._loadBitrateTestFrag=function(_){var f=this;this._doFragLoad(_).then(function(d){var g=f.hls;if(!d||g.nextLoadLevel||f.fragContextChanged(_))return;f.fragLoadError=0,f.state=L.State.IDLE,f.startFragRequested=!1,f.bitrateTest=!1;var E=_.stats;E.parsing.start=E.parsing.end=E.buffering.start=E.buffering.end=self.performance.now(),g.trigger(H.Events.FRAG_LOADED,d)})},S._handleTransmuxComplete=function(_){var f,d="main",g=this.hls,E=_.remuxResult,T=_.chunkMeta,F=this.getCurrentContext(T);if(!F){this.warn("The loading context changed while buffering fragment "+T.sn+" of level "+T.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(T.level);return}var U=F.frag,K=F.part,z=F.level,M=E.video,y=E.text,W=E.id3,X=E.initSegment,te=this.altAudio?void 0:E.audio;if(this.fragContextChanged(U))return;if(this.state=L.State.PARSING,X){X.tracks&&(this._bufferInitSegment(z,X.tracks,U,T),g.trigger(H.Events.FRAG_PARSING_INIT_SEGMENT,{frag:U,id:d,tracks:X.tracks}));var pe=X.initPTS,Ie=X.timescale;Object(G.isFiniteNumber)(pe)&&(this.initPTS[U.cc]=pe,g.trigger(H.Events.INIT_PTS_FOUND,{frag:U,id:d,initPTS:pe,timescale:Ie}))}if(M&&E.independent!==!1){if(z.details){var Ee=M.startPTS,Te=M.endPTS,We=M.startDTS,He=M.endDTS;if(K)K.elementaryStreams[M.type]={startPTS:Ee,endPTS:Te,startDTS:We,endDTS:He};else if(M.firstKeyFrame&&M.independent&&(this.couldBacktrack=!0),M.dropped&&M.independent){var Ce=this.getLoadPosition()+this.config.maxBufferHole;if(Ce<Ee){this.backtrack(U);return}U.setElementaryStreamInfo(M.type,U.start,Te,U.start,He,!0)}U.setElementaryStreamInfo(M.type,Ee,Te,We,He),this.bufferFragmentData(M,U,K,T)}}else if(E.independent===!1){this.backtrack(U);return}if(te){var ue=te.startPTS,se=te.endPTS,we=te.startDTS,ge=te.endDTS;K&&(K.elementaryStreams[p.ElementaryStreamTypes.AUDIO]={startPTS:ue,endPTS:se,startDTS:we,endDTS:ge}),U.setElementaryStreamInfo(p.ElementaryStreamTypes.AUDIO,ue,se,we,ge),this.bufferFragmentData(te,U,K,T)}if(W!=null&&(f=W.samples)!==null&&f!==void 0&&f.length){var Ke={frag:U,id:d,samples:W.samples};g.trigger(H.Events.FRAG_PARSING_METADATA,Ke)}if(y){var st={frag:U,id:d,samples:y.samples};g.trigger(H.Events.FRAG_PARSING_USERDATA,st)}},S._bufferInitSegment=function(_,f,d,g){var E=this;if(this.state!==L.State.PARSING)return;this.audioOnly=!!f.audio&&!f.video,this.altAudio&&!this.audioOnly&&delete f.audio;var T=f.audio,F=f.video,U=f.audiovideo;if(T){var K=_.audioCodec,z=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(K&&(K.indexOf("mp4a.40.5")!==-1?K="mp4a.40.2":K="mp4a.40.5"),T.metadata.channelCount!==1&&z.indexOf("firefox")===-1&&(K="mp4a.40.5")),z.indexOf("android")!==-1&&T.container!=="audio/mpeg"&&(K="mp4a.40.2",this.log("Android: force audio codec to "+K)),_.audioCodec&&_.audioCodec!==K&&this.log('Swapping manifest audio codec "'+_.audioCodec+'" for "'+K+'"'),T.levelCodec=K,T.id="main",this.log("Init audio buffer, container:"+T.container+", codecs[selected/level/parsed]=["+(K||"")+"/"+(_.audioCodec||"")+"/"+T.codec+"]")}F&&(F.levelCodec=_.videoCodec,F.id="main",this.log("Init video buffer, container:"+F.container+", codecs[level/parsed]=["+(_.videoCodec||"")+"/"+F.codec+"]")),U&&this.log("Init audiovideo buffer, container:"+U.container+", codecs[level/parsed]=["+(_.attrs.CODECS||"")+"/"+U.codec+"]"),this.hls.trigger(H.Events.BUFFER_CODECS,f),Object.keys(f).forEach(function(M){var y=f[M],W=y.initSegment;W!=null&&W.byteLength&&E.hls.trigger(H.Events.BUFFER_APPENDING,{type:M,data:W,frag:d,part:null,chunkMeta:g,parent:d.type})}),this.tick()},S.backtrack=function(_){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(_);var f=this.fragmentTracker.backtrack(_);this.fragPrevious=null,this.nextLoadPosition=_.start,f?this.resetFragmentLoading(_):this.state=L.State.BACKTRACKING},S.checkFragmentChanged=function(){var _=this.media,f=null;if(_&&_.readyState>1&&_.seeking===!1){var d=_.currentTime;if(O.BufferHelper.isBuffered(_,d)?f=this.getAppendedFrag(d):O.BufferHelper.isBuffered(_,d+.1)&&(f=this.getAppendedFrag(d+.1)),f){var g=this.fragPlaying,E=f.level;(!g||f.sn!==g.sn||g.level!==E||f.urlId!==g.urlId)&&(this.hls.trigger(H.Events.FRAG_CHANGED,{frag:f}),(!g||g.level!==E)&&this.hls.trigger(H.Events.LEVEL_SWITCHED,{level:E}),this.fragPlaying=f)}}},s(D,[{key:"nextLevel",get:function(){var _=this.nextBufferedFrag;return _?_.level:-1}},{key:"currentLevel",get:function(){var _=this.media;if(_){var f=this.getAppendedFrag(_.currentTime);if(f)return f.level}return-1}},{key:"nextBufferedFrag",get:function(){var _=this.media;if(_){var f=this.getAppendedFrag(_.currentTime);return this.followingBufferedFrag(f)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),D}(L.default)},"./src/controller/subtitle-stream-controller.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"SubtitleStreamController",function(){return u});var G=j("./src/events.ts"),L=j("./src/utils/logger.ts"),P=j("./src/utils/buffer-helper.ts"),H=j("./src/controller/fragment-finders.ts"),O=j("./src/utils/discontinuities.ts"),I=j("./src/controller/level-helper.ts"),x=j("./src/controller/fragment-tracker.ts"),p=j("./src/controller/base-stream-controller.ts"),m=j("./src/types/loader.ts"),h=j("./src/types/level.ts");function r(c,R){for(var w=0;w<R.length;w++){var C=R[w];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(c,C.key,C)}}function n(c,R,w){return R&&r(c.prototype,R),w&&r(c,w),c}function a(c,R){c.prototype=Object.create(R.prototype),c.prototype.constructor=c,l(c,R)}function l(c,R){return l=Object.setPrototypeOf||function(C,D){return C.__proto__=D,C},l(c,R)}var s=500,u=function(c){a(R,c);function R(C,D){var S;return S=c.call(this,C,D,"[subtitle-stream-controller]")||this,S.levels=[],S.currentTrackId=-1,S.tracksBuffered=[],S.mainDetails=null,S._registerListeners(),S}var w=R.prototype;return w.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},w._registerListeners=function(){var D=this.hls;D.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),D.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),D.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),D.on(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),D.on(G.Events.ERROR,this.onError,this),D.on(G.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),D.on(G.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),D.on(G.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),D.on(G.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),D.on(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},w._unregisterListeners=function(){var D=this.hls;D.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),D.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),D.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),D.off(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),D.off(G.Events.ERROR,this.onError,this),D.off(G.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),D.off(G.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),D.off(G.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),D.off(G.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),D.off(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},w.startLoad=function(){this.stopLoad(),this.state=p.State.IDLE,this.setInterval(s),this.tick()},w.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},w.onLevelLoaded=function(D,S){this.mainDetails=S.details},w.onSubtitleFragProcessed=function(D,S){var b=S.frag,_=S.success;if(this.fragPrevious=b,this.state=p.State.IDLE,!_)return;var f=this.tracksBuffered[this.currentTrackId];if(!f)return;for(var d,g=b.start,E=0;E<f.length;E++)if(g>=f[E].start&&g<=f[E].end){d=f[E];break}var T=b.start+b.duration;d?d.end=T:(d={start:g,end:T},f.push(d)),this.fragmentTracker.fragBuffered(b)},w.onBufferFlushing=function(D,S){var b=S.startOffset,_=S.endOffset;if(b===0&&_!==Number.POSITIVE_INFINITY){var f=this.currentTrackId,d=this.levels;if(!d.length||!d[f]||!d[f].details)return;var g=d[f].details,E=g.targetduration,T=_-E;if(T<=0)return;S.endOffsetSubtitles=Math.max(0,T),this.tracksBuffered.forEach(function(F){for(var U=0;U<F.length;){if(F[U].end<=T){F.shift();continue}else if(F[U].start<T)F[U].start=T;else break;U++}}),this.fragmentTracker.removeFragmentsInRange(b,T,m.PlaylistLevelType.SUBTITLE)}},w.onError=function(D,S){var b,_=S.frag;if(!_||_.type!==m.PlaylistLevelType.SUBTITLE)return;(b=this.fragCurrent)!==null&&b!==void 0&&b.loader&&this.fragCurrent.loader.abort(),this.state=p.State.IDLE},w.onSubtitleTracksUpdated=function(D,S){var b=this,_=S.subtitleTracks;this.tracksBuffered=[],this.levels=_.map(function(f){return new h.Level(f)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(f){b.tracksBuffered[f.id]=[]}),this.mediaBuffer=null},w.onSubtitleTrackSwitch=function(D,S){if(this.currentTrackId=S.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var b=this.levels[this.currentTrackId];b!=null&&b.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,b&&this.setInterval(s)},w.onSubtitleTrackLoaded=function(D,S){var b,_=S.details,f=S.id,d=this.currentTrackId,g=this.levels;if(!g.length)return;var E=g[d];if(f>=g.length||f!==d||!E)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,_.live||(b=E.details)!==null&&b!==void 0&&b.live){var T=this.mainDetails;if(_.deltaUpdateFailed||!T)return;var F=T.fragments[0];if(!E.details)_.hasProgramDateTime&&T.hasProgramDateTime?Object(O.alignMediaPlaylistByPDT)(_,T):F&&Object(I.addSliding)(_,F.start);else{var U=this.alignPlaylists(_,E.details);U===0&&F&&Object(I.addSliding)(_,F.start)}}if(E.details=_,this.levelLastLoaded=f,this.tick(),_.live&&!this.fragCurrent&&this.media&&this.state===p.State.IDLE){var K=Object(H.findFragmentByPTS)(null,_.fragments,this.media.currentTime,0);K||(this.warn("Subtitle playlist not aligned with playback"),E.details=void 0)}},w._handleFragmentLoadComplete=function(D){var S=D.frag,b=D.payload,_=S.decryptdata,f=this.hls;if(this.fragContextChanged(S))return;if(b&&b.byteLength>0&&_&&_.key&&_.iv&&_.method==="AES-128"){var d=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(b),_.key.buffer,_.iv.buffer).then(function(g){var E=performance.now();f.trigger(G.Events.FRAG_DECRYPTED,{frag:S,payload:g,stats:{tstart:d,tdecrypt:E}})})}},w.doTick=function(){if(!this.media){this.state=p.State.IDLE;return}if(this.state===p.State.IDLE){var D,S=this.currentTrackId,b=this.levels;if(!b.length||!b[S]||!b[S].details)return;var _=b[S].details,f=_.targetduration,d=this.config,g=this.media,E=P.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,g.currentTime-f,d.maxBufferHole),T=E.end,F=E.len,U=this.getMaxBufferLength()+f;if(F>U)return;console.assert(_,"Subtitle track details are defined on idle subtitle stream controller tick");var K=_.fragments,z=K.length,M=_.edge,y,W=this.fragPrevious;if(T<M){var X=d.maxFragLookUpTolerance;W&&_.hasProgramDateTime&&(y=Object(H.findFragmentByPDT)(K,W.endProgramDateTime,X)),y||(y=Object(H.findFragmentByPTS)(W,K,T,X),!y&&W&&W.start<K[0].start&&(y=K[0]))}else y=K[z-1];(D=y)!==null&&D!==void 0&&D.encrypted?(L.logger.log("Loading key for "+y.sn),this.state=p.State.KEY_LOADING,this.hls.trigger(G.Events.KEY_LOADING,{frag:y})):y&&this.fragmentTracker.getState(y)===x.FragmentState.NOT_LOADED&&this.loadFragment(y,_,T)}},w.loadFragment=function(D,S,b){this.fragCurrent=D,c.prototype.loadFragment.call(this,D,S,b)},n(R,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),R}(p.default)},"./src/controller/subtitle-track-controller.ts":function(re,Y,j){"use strict";j.r(Y);var G=j("./src/events.ts"),L=j("./src/utils/texttrack-utils.ts"),P=j("./src/controller/base-playlist-controller.ts"),H=j("./src/types/loader.ts");function O(r,n){for(var a=0;a<n.length;a++){var l=n[a];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(r,l.key,l)}}function I(r,n,a){return n&&O(r.prototype,n),a&&O(r,a),r}function x(r,n){r.prototype=Object.create(n.prototype),r.prototype.constructor=r,p(r,n)}function p(r,n){return p=Object.setPrototypeOf||function(l,s){return l.__proto__=s,l},p(r,n)}var m=function(r){x(n,r);function n(l){var s;return s=r.call(this,l,"[subtitle-track-controller]")||this,s.media=null,s.tracks=[],s.groupId=null,s.tracksInGroup=[],s.trackId=-1,s.selectDefaultTrack=!0,s.queuedDefaultTrack=-1,s.trackChangeListener=function(){return s.onTextTracksChanged()},s.asyncPollTrackChange=function(){return s.pollTrackChange(0)},s.useTextTrackPolling=!1,s.subtitlePollingInterval=-1,s.subtitleDisplay=!0,s.registerListeners(),s}var a=n.prototype;return a.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,r.prototype.destroy.call(this)},a.registerListeners=function(){var s=this.hls;s.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(G.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(G.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.on(G.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),s.on(G.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var s=this.hls;s.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(G.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(G.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.off(G.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),s.off(G.Events.ERROR,this.onError,this)},a.onMediaAttached=function(s,u){if(this.media=u.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},a.pollTrackChange=function(s){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,s)},a.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var s=h(this.media.textTracks);s.forEach(function(u){Object(L.clearCurrentCues)(u)}),this.subtitleTrack=-1,this.media=null},a.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},a.onManifestParsed=function(s,u){this.tracks=u.subtitleTracks},a.onSubtitleTrackLoaded=function(s,u){var c=u.id,R=u.details,w=this.trackId,C=this.tracksInGroup[w];if(!C){this.warn("Invalid subtitle track id "+c);return}var D=C.details;C.details=u.details,this.log("subtitle track "+c+" loaded ["+R.startSN+"-"+R.endSN+"]"),c===this.trackId&&(this.retryCount=0,this.playlistLoaded(c,u,D))},a.onLevelLoading=function(s,u){this.switchLevel(u.level)},a.onLevelSwitching=function(s,u){this.switchLevel(u.level)},a.switchLevel=function(s){var u=this.hls.levels[s];if(!(u!=null&&u.textGroupIds))return;var c=u.textGroupIds[u.urlId];if(this.groupId!==c){var R=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,w=this.tracks.filter(function(S){return!c||S.groupId===c});this.tracksInGroup=w;var C=this.findTrackId(R==null?void 0:R.name)||this.findTrackId();this.groupId=c;var D={subtitleTracks:w};this.log("Updating subtitle tracks, "+w.length+' track(s) found in "'+c+'" group-id'),this.hls.trigger(G.Events.SUBTITLE_TRACKS_UPDATED,D),C!==-1&&this.setSubtitleTrack(C,R)}},a.findTrackId=function(s){for(var u=this.tracksInGroup,c=0;c<u.length;c++){var R=u[c];if((!this.selectDefaultTrack||R.default)&&(!s||s===R.name))return R.id}return-1},a.onError=function(s,u){if(r.prototype.onError.call(this,s,u),u.fatal||!u.context)return;u.context.type===H.PlaylistContextType.SUBTITLE_TRACK&&u.context.id===this.trackId&&u.context.groupId===this.groupId&&this.retryLoadingOrFail(u)},a.loadPlaylist=function(s){var u=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(u)){var c=u.id,R=u.groupId,w=u.url;if(s)try{w=s.addDirectives(w)}catch(C){this.warn("Could not construct new URL with HLS Delivery Directives: "+C)}this.log("Loading subtitle playlist for id "+c),this.hls.trigger(G.Events.SUBTITLE_TRACK_LOADING,{url:w,id:c,groupId:R,deliveryDirectives:s||null})}},a.toggleTrackModes=function(s){var u=this,c=this.media,R=this.subtitleDisplay,w=this.trackId;if(!c)return;var C=h(c.textTracks),D=C.filter(function(_){return _.groupId===u.groupId});if(s===-1)[].slice.call(C).forEach(function(_){_.mode="disabled"});else{var S=D[w];S&&(S.mode="disabled")}var b=D[s];b&&(b.mode=R?"showing":"hidden")},a.setSubtitleTrack=function(s,u){var c,R=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=s;return}if(this.trackId!==s&&this.toggleTrackModes(s),this.trackId===s&&(s===-1||(c=R[s])!==null&&c!==void 0&&c.details)||s<-1||s>=R.length)return;this.clearTimer();var w=R[s];if(this.log("Switching to subtitle track "+s),this.trackId=s,w){var C=w.id,D=w.groupId,S=D===void 0?"":D,b=w.name,_=w.type,f=w.url;this.hls.trigger(G.Events.SUBTITLE_TRACK_SWITCH,{id:C,groupId:S,name:b,type:_,url:f});var d=this.switchParams(w.url,u==null?void 0:u.details);this.loadPlaylist(d)}else this.hls.trigger(G.Events.SUBTITLE_TRACK_SWITCH,{id:s})},a.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var s=-1,u=h(this.media.textTracks),c=0;c<u.length;c++)if(u[c].mode==="hidden")s=c;else if(u[c].mode==="showing"){s=c;break}this.subtitleTrack!==s&&(this.subtitleTrack=s)},I(n,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(s){this.selectDefaultTrack=!1;var u=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(s,u)}}]),n}(P.default);function h(r){for(var n=[],a=0;a<r.length;a++){var l=r[a];l.kind==="subtitles"&&l.label&&n.push(r[a])}return n}Y.default=m},"./src/controller/timeline-controller.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"TimelineController",function(){return h});var G=j("./src/polyfills/number.ts"),L=j("./src/events.ts"),P=j("./src/utils/cea-608-parser.ts"),H=j("./src/utils/output-filter.ts"),O=j("./src/utils/webvtt-parser.ts"),I=j("./src/utils/texttrack-utils.ts"),x=j("./src/utils/imsc1-ttml-parser.ts"),p=j("./src/types/loader.ts"),m=j("./src/utils/logger.ts"),h=function(){function l(u){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=a(),this.captionsProperties=void 0,this.hls=u,this.config=u.config,this.Cues=u.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var c=new H.default(this,"textTrack1"),R=new H.default(this,"textTrack2"),w=new H.default(this,"textTrack3"),C=new H.default(this,"textTrack4");this.cea608Parser1=new P.default(1,c,R),this.cea608Parser2=new P.default(3,w,C)}u.on(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),u.on(L.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),u.on(L.Events.FRAG_LOADING,this.onFragLoading,this),u.on(L.Events.FRAG_LOADED,this.onFragLoaded,this),u.on(L.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),u.on(L.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),u.on(L.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.on(L.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),u.on(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var s=l.prototype;return s.destroy=function(){var c=this.hls;c.off(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),c.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.off(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),c.off(L.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),c.off(L.Events.FRAG_LOADING,this.onFragLoading,this),c.off(L.Events.FRAG_LOADED,this.onFragLoaded,this),c.off(L.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),c.off(L.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),c.off(L.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),c.off(L.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),c.off(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},s.addCues=function(c,R,w,C,D){for(var S=!1,b=D.length;b--;){var _=D[b],f=n(_[0],_[1],R,w);if(f>=0&&(_[0]=Math.min(_[0],R),_[1]=Math.max(_[1],w),S=!0,f/(w-R)>.5))return}if(S||D.push([R,w]),this.config.renderTextTracksNatively){var d=this.captionsTracks[c];this.Cues.newCue(d,R,w,C)}else{var g=this.Cues.newCue(null,R,w,C);this.hls.trigger(L.Events.CUES_PARSED,{type:"captions",cues:g,track:c})}},s.onInitPtsFound=function(c,R){var w=this,C=R.frag,D=R.id,S=R.initPTS,b=R.timescale,_=this.unparsedVttFrags;D==="main"&&(this.initPTS[C.cc]=S,this.timescale[C.cc]=b),_.length&&(this.unparsedVttFrags=[],_.forEach(function(f){w.onFragLoaded(L.Events.FRAG_LOADED,f)}))},s.getExistingTrack=function(c){var R=this.media;if(R)for(var w=0;w<R.textTracks.length;w++){var C=R.textTracks[w];if(C[c])return C}return null},s.createCaptionsTrack=function(c){this.config.renderTextTracksNatively?this.createNativeTrack(c):this.createNonNativeTrack(c)},s.createNativeTrack=function(c){if(this.captionsTracks[c])return;var R=this.captionsProperties,w=this.captionsTracks,C=this.media,D=R[c],S=D.label,b=D.languageCode,_=this.getExistingTrack(c);if(_)w[c]=_,Object(I.clearCurrentCues)(w[c]),Object(I.sendAddTrackEvent)(w[c],C);else{var f=this.createTextTrack("captions",S,b);f&&(f[c]=!0,w[c]=f)}},s.createNonNativeTrack=function(c){if(this.nonNativeCaptionsTracks[c])return;var R=this.captionsProperties[c];if(!R)return;var w=R.label,C={_id:c,label:w,kind:"captions",default:R.media?!!R.media.default:!1,closedCaptions:R.media};this.nonNativeCaptionsTracks[c]=C,this.hls.trigger(L.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[C]})},s.createTextTrack=function(c,R,w){var C=this.media;return C?C.addTextTrack(c,R,w):void 0},s.onMediaAttaching=function(c,R){this.media=R.media,this._cleanTracks()},s.onMediaDetaching=function(){var c=this.captionsTracks;Object.keys(c).forEach(function(R){Object(I.clearCurrentCues)(c[R]),delete c[R]}),this.nonNativeCaptionsTracks={}},s.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=a(),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())},s._cleanTracks=function(){var c=this.media;if(!c)return;var R=c.textTracks;if(R)for(var w=0;w<R.length;w++)Object(I.clearCurrentCues)(R[w])},s.onSubtitleTracksUpdated=function(c,R){var w=this;this.textTracks=[];var C=R.subtitleTracks||[],D=C.some(function(f){return f.textCodec===x.IMSC1_CODEC});if(this.config.enableWebVTT||D&&this.config.enableIMSC1){var S=this.tracks&&C&&this.tracks.length===C.length;if(this.tracks=C||[],this.config.renderTextTracksNatively){var b=this.media?this.media.textTracks:[];this.tracks.forEach(function(f,d){var g;if(d<b.length){for(var E=null,T=0;T<b.length;T++)if(r(b[T],f)){E=b[T];break}E&&(g=E)}g?Object(I.clearCurrentCues)(g):(g=w.createTextTrack("subtitles",f.name,f.lang),g&&(g.mode="disabled")),g&&(g.groupId=f.groupId,w.textTracks.push(g))})}else if(!S&&this.tracks&&this.tracks.length){var _=this.tracks.map(function(f){return{label:f.name,kind:f.type.toLowerCase(),default:f.default,subtitleTrack:f}});this.hls.trigger(L.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:_})}}},s.onManifestLoaded=function(c,R){var w=this;this.config.enableCEA708Captions&&R.captions&&R.captions.forEach(function(C){var D=/(?:CC|SERVICE)([1-4])/.exec(C.instreamId);if(!D)return;var S="textTrack"+D[1],b=w.captionsProperties[S];if(!b)return;b.label=C.name,C.lang&&(b.languageCode=C.lang),b.media=C})},s.onFragLoading=function(c,R){var w=this.cea608Parser1,C=this.cea608Parser2,D=this.lastSn,S=this.lastPartIndex;if(!this.enabled||!(w&&C))return;if(R.frag.type===p.PlaylistLevelType.MAIN){var b,_,f=R.frag.sn,d=(b=R==null||((_=R.part)===null||_===void 0)?void 0:_.index)!=null?b:-1;f===D+1||f===D&&d===S+1||(w.reset(),C.reset()),this.lastSn=f,this.lastPartIndex=d}},s.onFragLoaded=function(c,R){var w=R.frag,C=R.payload,D=this.initPTS,S=this.unparsedVttFrags;if(w.type===p.PlaylistLevelType.SUBTITLE)if(C.byteLength){if(!Object(G.isFiniteNumber)(D[w.cc])){S.push(R),D.length&&this.hls.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:w,error:new Error("Missing initial subtitle PTS")});return}var b=w.decryptdata;if(b==null||b.key==null||b.method!=="AES-128"){var _=this.tracks[w.level],f=this.vttCCs;f[w.cc]||(f[w.cc]={start:w.start,prevCC:this.prevCC,new:!0},this.prevCC=w.cc),_&&_.textCodec===x.IMSC1_CODEC?this._parseIMSC1(w,C):this._parseVTTs(w,C,f)}}else this.hls.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:w,error:new Error("Empty subtitle payload")})},s._parseIMSC1=function(c,R){var w=this,C=this.hls;Object(x.parseIMSC1)(R,this.initPTS[c.cc],this.timescale[c.cc],function(D){w._appendCues(D,c.level),C.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:c})},function(D){m.logger.log("Failed to parse IMSC1: "+D),C.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:c,error:D})})},s._parseVTTs=function(c,R,w){var C=this,D=this.hls;Object(O.parseWebVTT)(R,this.initPTS[c.cc],this.timescale[c.cc],w,c.cc,c.start,function(S){C._appendCues(S,c.level),D.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:c})},function(S){C._fallbackToIMSC1(c,R),m.logger.log("Failed to parse VTT cue: "+S),D.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:c,error:S})})},s._fallbackToIMSC1=function(c,R){var w=this,C=this.tracks[c.level];C.textCodec||Object(x.parseIMSC1)(R,this.initPTS[c.cc],this.timescale[c.cc],function(){C.textCodec=x.IMSC1_CODEC,w._parseIMSC1(c,R)},function(){C.textCodec="wvtt"})},s._appendCues=function(c,R){var w=this.hls;if(this.config.renderTextTracksNatively){var C=this.textTracks[R];if(C.mode==="disabled")return;c.forEach(function(b){return Object(I.addCueToTrack)(C,b)})}else{var D=this.tracks[R],S=D.default?"default":"subtitles"+R;w.trigger(L.Events.CUES_PARSED,{type:"subtitles",cues:c,track:S})}},s.onFragDecrypted=function(c,R){var w=R.frag;if(w.type===p.PlaylistLevelType.SUBTITLE){if(!Object(G.isFiniteNumber)(this.initPTS[w.cc])){this.unparsedVttFrags.push(R);return}this.onFragLoaded(L.Events.FRAG_LOADED,R)}},s.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},s.onFragParsingUserdata=function(c,R){var w=this.cea608Parser1,C=this.cea608Parser2;if(!this.enabled||!(w&&C))return;for(var D=0;D<R.samples.length;D++){var S=R.samples[D].bytes;if(S){var b=this.extractCea608Data(S);w.addData(R.samples[D].pts,b[0]),C.addData(R.samples[D].pts,b[1])}}},s.onBufferFlushing=function(c,R){var w=R.startOffset,C=R.endOffset,D=R.endOffsetSubtitles,S=R.type,b=this.media;if(!b||b.currentTime<C)return;if(!S||S==="video"){var _=this.captionsTracks;Object.keys(_).forEach(function(d){return Object(I.removeCuesInRange)(_[d],w,C)})}if(this.config.renderTextTracksNatively&&(w===0&&D!==void 0)){var f=this.textTracks;Object.keys(f).forEach(function(d){return Object(I.removeCuesInRange)(f[d],w,D)})}},s.extractCea608Data=function(c){for(var R=c[0]&31,w=2,C=[[],[]],D=0;D<R;D++){var S=c[w++],b=127&c[w++],_=127&c[w++],f=(4&S)!==0,d=3&S;if(b===0&&_===0)continue;f&&((d===0||d===1)&&(C[d].push(b),C[d].push(_)))}return C},l}();function r(l,s){return l&&l.label===s.name&&!(l.textTrack1||l.textTrack2)}function n(l,s,u,c){return Math.min(s,c)-Math.max(l,u)}function a(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"default",function(){return G});var G=function(){function L(H,O){this.subtle=void 0,this.aesIV=void 0,this.subtle=H,this.aesIV=O}var P=L.prototype;return P.decrypt=function(O,I){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},I,O)},L}()},"./src/crypt/aes-decryptor.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"removePadding",function(){return L}),j.d(Y,"default",function(){return P});var G=j("./src/utils/typed-array.ts");function L(H){var O=H.byteLength,I=O&&new DataView(H.buffer).getUint8(O-1);return I?Object(G.sliceUint8)(H,0,O-I):H}var P=function(){function H(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var O=H.prototype;return O.uint8ArrayToUint32Array_=function(x){for(var p=new DataView(x),m=new Uint32Array(4),h=0;h<4;h++)m[h]=p.getUint32(h*4);return m},O.initTable=function(){var x=this.sBox,p=this.invSBox,m=this.subMix,h=m[0],r=m[1],n=m[2],a=m[3],l=this.invSubMix,s=l[0],u=l[1],c=l[2],R=l[3],w=new Uint32Array(256),C=0,D=0,S=0;for(S=0;S<256;S++)S<128?w[S]=S<<1:w[S]=S<<1^283;for(S=0;S<256;S++){var b=D^D<<1^D<<2^D<<3^D<<4;b=b>>>8^b&255^99,x[C]=b,p[b]=C;var _=w[C],f=w[_],d=w[f],g=w[b]*257^b*16843008;h[C]=g<<24|g>>>8,r[C]=g<<16|g>>>16,n[C]=g<<8|g>>>24,a[C]=g,g=d*16843009^f*65537^_*257^C*16843008,s[b]=g<<24|g>>>8,u[b]=g<<16|g>>>16,c[b]=g<<8|g>>>24,R[b]=g,C?(C=_^w[w[w[d^_]]],D^=w[w[D]]):C=D=1}},O.expandKey=function(x){for(var p=this.uint8ArrayToUint32Array_(x),m=!0,h=0;h<p.length&&m;)m=p[h]===this.key[h],h++;if(m)return;this.key=p;var r=this.keySize=p.length;if(r!==4&&r!==6&&r!==8)throw new Error("Invalid aes key size="+r);var n=this.ksRows=(r+6+1)*4,a,l,s=this.keySchedule=new Uint32Array(n),u=this.invKeySchedule=new Uint32Array(n),c=this.sBox,R=this.rcon,w=this.invSubMix,C=w[0],D=w[1],S=w[2],b=w[3],_,f;for(a=0;a<n;a++){if(a<r){_=s[a]=p[a];continue}f=_,a%r===0?(f=f<<8|f>>>24,f=c[f>>>24]<<24|c[f>>>16&255]<<16|c[f>>>8&255]<<8|c[f&255],f^=R[a/r|0]<<24):r>6&&a%r===4&&(f=c[f>>>24]<<24|c[f>>>16&255]<<16|c[f>>>8&255]<<8|c[f&255]),s[a]=_=(s[a-r]^f)>>>0}for(l=0;l<n;l++)a=n-l,l&3?f=s[a]:f=s[a-4],l<4||a<=4?u[l]=f:u[l]=C[c[f>>>24]]^D[c[f>>>16&255]]^S[c[f>>>8&255]]^b[c[f&255]],u[l]=u[l]>>>0},O.networkToHostOrderSwap=function(x){return x<<24|(x&65280)<<8|(x&16711680)>>8|x>>>24},O.decrypt=function(x,p,m){for(var h=this.keySize+6,r=this.invKeySchedule,n=this.invSBox,a=this.invSubMix,l=a[0],s=a[1],u=a[2],c=a[3],R=this.uint8ArrayToUint32Array_(m),w=R[0],C=R[1],D=R[2],S=R[3],b=new Int32Array(x),_=new Int32Array(b.length),f,d,g,E,T,F,U,K,z,M,y,W,X,te,pe=this.networkToHostOrderSwap;p<b.length;){for(z=pe(b[p]),M=pe(b[p+1]),y=pe(b[p+2]),W=pe(b[p+3]),T=z^r[0],F=W^r[1],U=y^r[2],K=M^r[3],X=4,te=1;te<h;te++)f=l[T>>>24]^s[F>>16&255]^u[U>>8&255]^c[K&255]^r[X],d=l[F>>>24]^s[U>>16&255]^u[K>>8&255]^c[T&255]^r[X+1],g=l[U>>>24]^s[K>>16&255]^u[T>>8&255]^c[F&255]^r[X+2],E=l[K>>>24]^s[T>>16&255]^u[F>>8&255]^c[U&255]^r[X+3],T=f,F=d,U=g,K=E,X=X+4;f=n[T>>>24]<<24^n[F>>16&255]<<16^n[U>>8&255]<<8^n[K&255]^r[X],d=n[F>>>24]<<24^n[U>>16&255]<<16^n[K>>8&255]<<8^n[T&255]^r[X+1],g=n[U>>>24]<<24^n[K>>16&255]<<16^n[T>>8&255]<<8^n[F&255]^r[X+2],E=n[K>>>24]<<24^n[T>>16&255]<<16^n[F>>8&255]<<8^n[U&255]^r[X+3],_[p]=pe(f^w),_[p+1]=pe(E^C),_[p+2]=pe(g^D),_[p+3]=pe(d^S),w=z,C=M,D=y,S=W,p=p+4}return _.buffer},H}()},"./src/crypt/decrypter.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"default",function(){return p});var G=j("./src/crypt/aes-crypto.ts"),L=j("./src/crypt/fast-aes-key.ts"),P=j("./src/crypt/aes-decryptor.ts"),H=j("./src/utils/logger.ts"),O=j("./src/utils/mp4-tools.ts"),I=j("./src/utils/typed-array.ts"),x=16,p=function(){function m(r,n,a){var l=a===void 0?{}:a,s=l.removePKCS7Padding,u=s===void 0?!0:s;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=r,this.config=n,this.removePKCS7Padding=u,u)try{var c=self.crypto;c&&(this.subtle=c.subtle||c.webkitSubtle)}catch(R){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var h=m.prototype;return h.destroy=function(){this.observer=null},h.isSync=function(){return this.config.enableSoftwareAES},h.flush=function(){var n=this.currentResult;if(!n){this.reset();return}var a=new Uint8Array(n);return this.reset(),this.removePKCS7Padding?Object(P.removePadding)(a):a},h.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},h.decrypt=function(n,a,l,s){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(n),a,l);var u=this.flush();u&&s(u.buffer)}else this.webCryptoDecrypt(new Uint8Array(n),a,l).then(s)},h.softwareDecrypt=function(n,a,l){var s=this.currentIV,u=this.currentResult,c=this.remainderData;this.logOnce("JS AES decrypt"),c&&(n=Object(O.appendUint8Array)(c,n),this.remainderData=null);var R=this.getValidChunk(n);if(!R.length)return null;s&&(l=s);var w=this.softwareDecrypter;w||(w=this.softwareDecrypter=new P.default),w.expandKey(a);var C=u;return this.currentResult=w.decrypt(R.buffer,0,l),this.currentIV=Object(I.sliceUint8)(R,-16).buffer,C||null},h.webCryptoDecrypt=function(n,a,l){var s=this,u=this.subtle;return(this.key!==a||!this.fastAesKey)&&(this.key=a,this.fastAesKey=new L.default(u,a)),this.fastAesKey.expandKey().then(function(c){if(!u)return Promise.reject(new Error("web crypto not initialized"));var R=new G.default(u,l);return R.decrypt(n.buffer,c)}).catch(function(c){return s.onWebCryptoError(c,n,a,l)})},h.onWebCryptoError=function(n,a,l,s){return H.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",n),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(a,l,s)},h.getValidChunk=function(n){var a=n,l=n.length-n.length%x;return l!==n.length&&(a=Object(I.sliceUint8)(n,0,l),this.remainderData=Object(I.sliceUint8)(n,l)),a},h.logOnce=function(n){if(!this.logEnabled)return;H.logger.log("[decrypter.ts]: "+n),this.logEnabled=!1},m}()},"./src/crypt/fast-aes-key.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"default",function(){return G});var G=function(){function L(H,O){this.subtle=void 0,this.key=void 0,this.subtle=H,this.key=O}var P=L.prototype;return P.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},L}()},"./src/demux/aacdemuxer.ts":function(re,Y,j){"use strict";j.r(Y);var G=j("./src/demux/base-audio-demuxer.ts"),L=j("./src/demux/adts.ts"),P=j("./src/utils/logger.ts"),H=j("./src/demux/id3.ts");function O(p,m){p.prototype=Object.create(m.prototype),p.prototype.constructor=p,I(p,m)}function I(p,m){return I=Object.setPrototypeOf||function(r,n){return r.__proto__=n,r},I(p,m)}var x=function(p){O(m,p);function m(r,n){var a;return a=p.call(this)||this,a.observer=void 0,a.config=void 0,a.observer=r,a.config=n,a}var h=m.prototype;return h.resetInitSegment=function(n,a,l){p.prototype.resetInitSegment.call(this,n,a,l),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:n,duration:l,inputTimeScale:9e4,dropped:0}},m.probe=function(n){if(!n)return!1;for(var a=H.getID3Data(n,0)||[],l=a.length,s=n.length;l<s;l++)if(L.probe(n,l))return P.logger.log("ADTS sync word found !"),!0;return!1},h.canParse=function(n,a){return L.canParse(n,a)},h.appendFrame=function(n,a,l){L.initTrackConfig(n,this.observer,a,l,n.manifestCodec);var s=L.appendFrame(n,a,l,this.initPTS,this.frameIndex);if(s&&s.missing===0)return s},m}(G.default);x.minProbeByteLength=9,Y.default=x},"./src/demux/adts.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"getAudioConfig",function(){return H}),j.d(Y,"isHeaderPattern",function(){return O}),j.d(Y,"getHeaderLength",function(){return I}),j.d(Y,"getFullFrameLength",function(){return x}),j.d(Y,"canGetFrameLength",function(){return p}),j.d(Y,"isHeader",function(){return m}),j.d(Y,"canParse",function(){return h}),j.d(Y,"probe",function(){return r}),j.d(Y,"initTrackConfig",function(){return n}),j.d(Y,"getFrameDuration",function(){return a}),j.d(Y,"parseFrameHeader",function(){return l}),j.d(Y,"appendFrame",function(){return s});var G=j("./src/utils/logger.ts"),L=j("./src/errors.ts"),P=j("./src/events.ts");function H(u,c,R,w){var C,D,S,b,_=navigator.userAgent.toLowerCase(),f=w,d=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];C=((c[R+2]&192)>>>6)+1;var g=(c[R+2]&60)>>>2;if(g>d.length-1){u.trigger(P.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+g});return}return S=(c[R+2]&1)<<2,S|=(c[R+3]&192)>>>6,G.logger.log("manifest codec:"+w+", ADTS type:"+C+", samplingIndex:"+g),/firefox/i.test(_)?g>=6?(C=5,b=new Array(4),D=g-3):(C=2,b=new Array(2),D=g):_.indexOf("android")!==-1?(C=2,b=new Array(2),D=g):(C=5,b=new Array(4),w&&(w.indexOf("mp4a.40.29")!==-1||w.indexOf("mp4a.40.5")!==-1)||!w&&g>=6?D=g-3:((w&&w.indexOf("mp4a.40.2")!==-1&&(g>=6&&S===1||/vivaldi/i.test(_))||!w&&S===1)&&(C=2,b=new Array(2)),D=g)),b[0]=C<<3,b[0]|=(g&14)>>1,b[1]|=(g&1)<<7,b[1]|=S<<3,C===5&&(b[1]|=(D&14)>>1,b[2]=(D&1)<<7,b[2]|=2<<2,b[3]=0),{config:b,samplerate:d[g],channelCount:S,codec:"mp4a.40."+C,manifestCodec:f}}function O(u,c){return u[c]===255&&(u[c+1]&246)===240}function I(u,c){return u[c+1]&1?7:9}function x(u,c){return(u[c+3]&3)<<11|u[c+4]<<3|(u[c+5]&224)>>>5}function p(u,c){return c+5<u.length}function m(u,c){return c+1<u.length&&O(u,c)}function h(u,c){return p(u,c)&&O(u,c)&&x(u,c)<=u.length-c}function r(u,c){if(m(u,c)){var R=I(u,c);if(c+R>=u.length)return!1;var w=x(u,c);if(w<=R)return!1;var C=c+w;return C===u.length||m(u,C)}return!1}function n(u,c,R,w,C){if(!u.samplerate){var D=H(c,R,w,C);if(!D)return;u.config=D.config,u.samplerate=D.samplerate,u.channelCount=D.channelCount,u.codec=D.codec,u.manifestCodec=D.manifestCodec,G.logger.log("parsed codec:"+u.codec+", rate:"+D.samplerate+", channels:"+D.channelCount)}}function a(u){return 1024*9e4/u}function l(u,c,R,w,C){var D=I(u,c),S=x(u,c);if(S-=D,S>0){var b=R+w*C;return{headerLength:D,frameLength:S,stamp:b}}}function s(u,c,R,w,C){var D=a(u.samplerate),S=l(c,R,w,C,D);if(S){var b=S.frameLength,_=S.headerLength,f=S.stamp,d=_+b,g=Math.max(0,R+d-c.length),E;g?(E=new Uint8Array(d-_),E.set(c.subarray(R+_,c.length),0)):E=c.subarray(R+_,R+d);var T={unit:E,pts:f};return g||u.samples.push(T),{sample:T,length:d,missing:g}}}},"./src/demux/base-audio-demuxer.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"initPTSFn",function(){return x});var G=j("./src/polyfills/number.ts"),L=j("./src/demux/id3.ts"),P=j("./src/demux/dummy-demuxed-track.ts"),H=j("./src/utils/mp4-tools.ts"),O=j("./src/utils/typed-array.ts"),I=function(){function p(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var m=p.prototype;return m.resetInitSegment=function(r,n,a){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},m.resetTimeStamp=function(){},m.resetContiguity=function(){},m.canParse=function(r,n){return!1},m.appendFrame=function(r,n,a){},m.demux=function(r,n){this.cachedData&&(r=Object(H.appendUint8Array)(this.cachedData,r),this.cachedData=null);var a=L.getID3Data(r,0),l=a?a.length:0,s,u,c=this._audioTrack,R=this._id3Track,w=a?L.getTimeStamp(a):void 0,C=r.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=x(w,n)),a&&a.length>0&&R.samples.push({pts:this.initPTS,dts:this.initPTS,data:a}),u=this.initPTS;l<C;){if(this.canParse(r,l)){var D=this.appendFrame(c,r,l);D?(this.frameIndex++,u=D.sample.pts,l+=D.length,s=l):l=C}else L.canParse(r,l)?(a=L.getID3Data(r,l),R.samples.push({pts:u,dts:u,data:a}),l+=a.length,s=l):l++;if(l===C&&s!==C){var S=Object(O.sliceUint8)(r,s);this.cachedData?this.cachedData=Object(H.appendUint8Array)(this.cachedData,S):this.cachedData=S}}return{audioTrack:c,avcTrack:Object(P.dummyTrack)(),id3Track:R,textTrack:Object(P.dummyTrack)()}},m.demuxSampleAes=function(r,n,a){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},m.flush=function(r){var n=this.cachedData;return n&&(this.cachedData=null,this.demux(n,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(P.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(P.dummyTrack)()}},m.destroy=function(){},p}(),x=function(m,h){return Object(G.isFiniteNumber)(m)?m*90:h*9e4};Y.default=I},"./src/demux/chunk-cache.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"default",function(){return G});var G=function(){function P(){this.chunks=[],this.dataLength=0}var H=P.prototype;return H.push=function(I){this.chunks.push(I),this.dataLength+=I.length},H.flush=function(){var I=this.chunks,x=this.dataLength,p;if(I.length)I.length===1?p=I[0]:p=L(I,x);else return new Uint8Array(0);return this.reset(),p},H.reset=function(){this.chunks.length=0,this.dataLength=0},P}();function L(P,H){for(var O=new Uint8Array(H),I=0,x=0;x<P.length;x++){var p=P[x];O.set(p,I),I+=p.length}return O}},"./src/demux/dummy-demuxed-track.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"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(re,Y,j){"use strict";j.r(Y);var G=j("./src/utils/logger.ts"),L=function(){function P(O){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=O,this.bytesAvailable=O.byteLength,this.word=0,this.bitsAvailable=0}var H=P.prototype;return H.loadWord=function(){var I=this.data,x=this.bytesAvailable,p=I.byteLength-x,m=new Uint8Array(4),h=Math.min(4,x);if(h===0)throw new Error("no bytes available");m.set(I.subarray(p,p+h)),this.word=new DataView(m.buffer).getUint32(0),this.bitsAvailable=h*8,this.bytesAvailable-=h},H.skipBits=function(I){var x;this.bitsAvailable>I?(this.word<<=I,this.bitsAvailable-=I):(I-=this.bitsAvailable,x=I>>3,I-=x>>3,this.bytesAvailable-=x,this.loadWord(),this.word<<=I,this.bitsAvailable-=I)},H.readBits=function(I){var x=Math.min(this.bitsAvailable,I),p=this.word>>>32-x;return I>32&&G.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=x,this.bitsAvailable>0?this.word<<=x:this.bytesAvailable>0&&this.loadWord(),x=I-x,x>0&&this.bitsAvailable?p<<x|this.readBits(x):p},H.skipLZ=function(){var I;for(I=0;I<this.bitsAvailable;++I)if((this.word&2147483648>>>I)!==0)return this.word<<=I,this.bitsAvailable-=I,I;return this.loadWord(),I+this.skipLZ()},H.skipUEG=function(){this.skipBits(1+this.skipLZ())},H.skipEG=function(){this.skipBits(1+this.skipLZ())},H.readUEG=function(){var I=this.skipLZ();return this.readBits(I+1)-1},H.readEG=function(){var I=this.readUEG();return 1&I?1+I>>>1:-1*(I>>>1)},H.readBoolean=function(){return this.readBits(1)===1},H.readUByte=function(){return this.readBits(8)},H.readUShort=function(){return this.readBits(16)},H.readUInt=function(){return this.readBits(32)},H.skipScalingList=function(I){for(var x=8,p=8,m,h=0;h<I;h++)p!==0&&(m=this.readEG(),p=(x+m+256)%256),x=p===0?x:p},H.readSPS=function(){var I=0,x=0,p=0,m=0,h,r,n,a=this.readUByte.bind(this),l=this.readBits.bind(this),s=this.readUEG.bind(this),u=this.readBoolean.bind(this),c=this.skipBits.bind(this),R=this.skipEG.bind(this),w=this.skipUEG.bind(this),C=this.skipScalingList.bind(this);a();var D=a();if(l(5),c(3),a(),w(),D===100||D===110||D===122||D===244||D===44||D===83||D===86||D===118||D===128){var S=s();if(S===3&&c(1),w(),w(),c(1),u())for(r=S!==3?8:12,n=0;n<r;n++)u()&&(n<6?C(16):C(64))}w();var b=s();if(b===0)s();else if(b===1)for(c(1),R(),R(),h=s(),n=0;n<h;n++)R();w(),c(1);var _=s(),f=s(),d=l(1);d===0&&c(1),c(1),u()&&(I=s(),x=s(),p=s(),m=s());var g=[1,1];if(u()&&u()){var E=a();switch(E){case 1:g=[1,1];break;case 2:g=[12,11];break;case 3:g=[10,11];break;case 4:g=[16,11];break;case 5:g=[40,33];break;case 6:g=[24,11];break;case 7:g=[20,11];break;case 8:g=[32,11];break;case 9:g=[80,33];break;case 10:g=[18,11];break;case 11:g=[15,11];break;case 12:g=[64,33];break;case 13:g=[160,99];break;case 14:g=[4,3];break;case 15:g=[3,2];break;case 16:g=[2,1];break;case 255:{g=[a()<<8|a(),a()<<8|a()];break}}}return{width:Math.ceil((_+1)*16-I*2-x*2),height:(2-d)*(f+1)*16-(d?2:4)*(p+m),pixelRatio:g}},H.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},P}();Y.default=L},"./src/demux/id3.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"isHeader",function(){return G}),j.d(Y,"isFooter",function(){return L}),j.d(Y,"getID3Data",function(){return P}),j.d(Y,"canParse",function(){return O}),j.d(Y,"getTimeStamp",function(){return I}),j.d(Y,"isTimeStampFrame",function(){return x}),j.d(Y,"getID3Frames",function(){return m}),j.d(Y,"decodeFrame",function(){return h}),j.d(Y,"utf8ArrayToStr",function(){return s}),j.d(Y,"testables",function(){return u});var G=function(C,D){return D+10<=C.length&&(C[D]===73&&C[D+1]===68&&C[D+2]===51&&(C[D+3]<255&&C[D+4]<255&&(C[D+6]<128&&C[D+7]<128&&C[D+8]<128&&C[D+9]<128)))},L=function(C,D){return D+10<=C.length&&(C[D]===51&&C[D+1]===68&&C[D+2]===73&&(C[D+3]<255&&C[D+4]<255&&(C[D+6]<128&&C[D+7]<128&&C[D+8]<128&&C[D+9]<128)))},P=function(C,D){for(var S=D,b=0;G(C,D);){b+=10;var _=H(C,D+6);b+=_,L(C,D+10)&&(b+=10),D+=b}return b>0?C.subarray(S,S+b):void 0},H=function(C,D){var S=0;return S=(C[D]&127)<<21,S|=(C[D+1]&127)<<14,S|=(C[D+2]&127)<<7,S|=C[D+3]&127,S},O=function(C,D){return G(C,D)&&H(C,D+6)+10<=C.length-D},I=function(C){for(var D=m(C),S=0;S<D.length;S++){var b=D[S];if(x(b))return l(b)}return},x=function(C){return C&&C.key==="PRIV"&&C.info==="com.apple.streaming.transportStreamTimestamp"},p=function(C){var D=String.fromCharCode(C[0],C[1],C[2],C[3]),S=H(C,4),b=10;return{type:D,size:S,data:C.subarray(b,b+S)}},m=function(C){for(var D=0,S=[];G(C,D);){var b=H(C,D+6);D+=10;for(var _=D+b;D+8<_;){var f=p(C.subarray(D)),d=h(f);d&&S.push(d),D+=f.size+10}L(C,D)&&(D+=10)}return S},h=function(C){return C.type==="PRIV"?r(C):C.type[0]==="W"?a(C):n(C)},r=function(C){if(C.size<2)return;var D=s(C.data,!0),S=new Uint8Array(C.data.subarray(D.length+1));return{key:C.type,info:D,data:S.buffer}},n=function(C){if(C.size<2)return;if(C.type==="TXXX"){var D=1,S=s(C.data.subarray(D),!0);D+=S.length+1;var b=s(C.data.subarray(D));return{key:C.type,info:S,data:b}}var _=s(C.data.subarray(1));return{key:C.type,data:_}},a=function(C){if(C.type==="WXXX"){if(C.size<2)return;var D=1,S=s(C.data.subarray(D),!0);D+=S.length+1;var b=s(C.data.subarray(D));return{key:C.type,info:S,data:b}}var _=s(C.data);return{key:C.type,data:_}},l=function(C){if(C.data.byteLength===8){var D=new Uint8Array(C.data),S=D[3]&1,b=(D[4]<<23)+(D[5]<<15)+(D[6]<<7)+D[7];return b/=45,S&&(b+=4772185884e-2),Math.round(b)}return},s=function(C,D){D===void 0&&(D=!1);var S=R();if(S){var b=S.decode(C);if(D){var _=b.indexOf("\0");return _!==-1?b.substring(0,_):b}return b.replace(/\0/g,"")}for(var f=C.length,d,g,E,T="",F=0;F<f;){if(d=C[F++],d===0&&D)return T;if(d===0||d===3)continue;switch(d>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:T+=String.fromCharCode(d);break;case 12:case 13:g=C[F++],T+=String.fromCharCode((d&31)<<6|g&63);break;case 14:g=C[F++],E=C[F++],T+=String.fromCharCode((d&15)<<12|(g&63)<<6|(E&63)<<0);break;default:}}return T},u={decodeTextFrame:n},c;function R(){return!c&&typeof self.TextDecoder!="undefined"&&(c=new self.TextDecoder("utf-8")),c}},"./src/demux/mp3demuxer.ts":function(re,Y,j){"use strict";j.r(Y);var G=j("./src/demux/base-audio-demuxer.ts"),L=j("./src/demux/id3.ts"),P=j("./src/utils/logger.ts"),H=j("./src/demux/mpegaudio.ts");function O(p,m){p.prototype=Object.create(m.prototype),p.prototype.constructor=p,I(p,m)}function I(p,m){return I=Object.setPrototypeOf||function(r,n){return r.__proto__=n,r},I(p,m)}var x=function(p){O(m,p);function m(){return p.apply(this,arguments)||this}var h=m.prototype;return h.resetInitSegment=function(n,a,l){p.prototype.resetInitSegment.call(this,n,a,l),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:n,duration:l,inputTimeScale:9e4,dropped:0}},m.probe=function(n){if(!n)return!1;for(var a=L.getID3Data(n,0)||[],l=a.length,s=n.length;l<s;l++)if(H.probe(n,l))return P.logger.log("MPEG Audio sync word found !"),!0;return!1},h.canParse=function(n,a){return H.canParse(n,a)},h.appendFrame=function(n,a,l){return this.initPTS===null?void 0:H.appendFrame(n,a,l,this.initPTS,this.frameIndex)},m}(G.default);x.minProbeByteLength=4,Y.default=x},"./src/demux/mp4demuxer.ts":function(re,Y,j){"use strict";j.r(Y);var G=j("./src/utils/mp4-tools.ts"),L=j("./src/demux/dummy-demuxed-track.ts"),P=function(){function H(I,x){this.remainderData=null,this.config=void 0,this.config=x}var O=H.prototype;return O.resetTimeStamp=function(){},O.resetInitSegment=function(){},O.resetContiguity=function(){},H.probe=function(x){return Object(G.findBox)({data:x,start:0,end:Math.min(x.length,16384)},["moof"]).length>0},O.demux=function(x){var p=x,m=Object(L.dummyTrack)();if(this.config.progressive){this.remainderData&&(p=Object(G.appendUint8Array)(this.remainderData,x));var h=Object(G.segmentValidRange)(p);this.remainderData=h.remainder,m.samples=h.valid||new Uint8Array}else m.samples=p;return{audioTrack:Object(L.dummyTrack)(),avcTrack:m,id3Track:Object(L.dummyTrack)(),textTrack:Object(L.dummyTrack)()}},O.flush=function(){var x=Object(L.dummyTrack)();return x.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(L.dummyTrack)(),avcTrack:x,id3Track:Object(L.dummyTrack)(),textTrack:Object(L.dummyTrack)()}},O.demuxSampleAes=function(x,p,m){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},O.destroy=function(){},H}();P.minProbeByteLength=1024,Y.default=P},"./src/demux/mpegaudio.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"appendFrame",function(){return I}),j.d(Y,"parseHeader",function(){return x}),j.d(Y,"isHeaderPattern",function(){return p}),j.d(Y,"isHeader",function(){return m}),j.d(Y,"canParse",function(){return h}),j.d(Y,"probe",function(){return r});var G=null,L=[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],P=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],H=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],O=[0,1,1,4];function I(n,a,l,s,u){if(l+24>a.length)return;var c=x(a,l);if(c&&l+c.frameLength<=a.length){var R=c.samplesPerFrame*9e4/c.sampleRate,w=s+u*R,C={unit:a.subarray(l,l+c.frameLength),pts:w,dts:w};return n.config=[],n.channelCount=c.channelCount,n.samplerate=c.sampleRate,n.samples.push(C),{sample:C,length:c.frameLength,missing:0}}}function x(n,a){var l=n[a+1]>>3&3,s=n[a+1]>>1&3,u=n[a+2]>>4&15,c=n[a+2]>>2&3;if(l!==1&&u!==0&&u!==15&&c!==3){var R=n[a+2]>>1&1,w=n[a+3]>>6,C=l===3?3-s:s===3?3:4,D=L[C*14+u-1]*1e3,S=l===3?0:l===2?1:2,b=P[S*3+c],_=w===3?1:2,f=H[l][s],d=O[s],g=f*8*d,E=Math.floor(f*D/b+R)*d;if(G===null){var T=navigator.userAgent||"",F=T.match(/Chrome\/(\d+)/i);G=F?parseInt(F[1]):0}var U=!!G&&G<=87;return U&&s===2&&D>=224e3&&w===0&&(n[a+3]=n[a+3]|128),{sampleRate:b,channelCount:_,frameLength:E,samplesPerFrame:g}}}function p(n,a){return n[a]===255&&(n[a+1]&224)===224&&(n[a+1]&6)!==0}function m(n,a){return a+1<n.length&&p(n,a)}function h(n,a){var l=4;return p(n,a)&&l<=n.length-a}function r(n,a){if(a+1<n.length&&p(n,a)){var l=4,s=x(n,a),u=l;s!=null&&s.frameLength&&(u=s.frameLength);var c=a+u;return c===n.length||m(n,c)}return!1}},"./src/demux/sample-aes.ts":function(re,Y,j){"use strict";j.r(Y);var G=j("./src/crypt/decrypter.ts"),L=j("./src/demux/tsdemuxer.ts"),P=function(){function H(I,x,p){this.keyData=void 0,this.decrypter=void 0,this.keyData=p,this.decrypter=new G.default(I,x,{removePKCS7Padding:!1})}var O=H.prototype;return O.decryptBuffer=function(x,p){this.decrypter.decrypt(x,this.keyData.key.buffer,this.keyData.iv.buffer,p)},O.decryptAacSample=function(x,p,m,h){var r=x[p].unit,n=r.subarray(16,r.length-r.length%16),a=n.buffer.slice(n.byteOffset,n.byteOffset+n.length),l=this;this.decryptBuffer(a,function(s){var u=new Uint8Array(s);r.set(u,16),h||l.decryptAacSamples(x,p+1,m)})},O.decryptAacSamples=function(x,p,m){for(;;p++){if(p>=x.length){m();return}if(x[p].unit.length<32)continue;var h=this.decrypter.isSync();if(this.decryptAacSample(x,p,m,h),!h)return}},O.getAvcEncryptedData=function(x){for(var p=Math.floor((x.length-48)/160)*16+16,m=new Int8Array(p),h=0,r=32;r<=x.length-16;r+=160,h+=16)m.set(x.subarray(r,r+16),h);return m},O.getAvcDecryptedUnit=function(x,p){for(var m=new Uint8Array(p),h=0,r=32;r<=x.length-16;r+=160,h+=16)x.set(m.subarray(h,h+16),r);return x},O.decryptAvcSample=function(x,p,m,h,r,n){var a=Object(L.discardEPB)(r.data),l=this.getAvcEncryptedData(a),s=this;this.decryptBuffer(l.buffer,function(u){r.data=s.getAvcDecryptedUnit(a,u),n||s.decryptAvcSamples(x,p,m+1,h)})},O.decryptAvcSamples=function(x,p,m,h){if(x instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;p++,m=0){if(p>=x.length){h();return}for(var r=x[p].units;!(m>=r.length);m++){var n=r[m];if(n.data.length<=48||n.type!==1&&n.type!==5)continue;var a=this.decrypter.isSync();if(this.decryptAvcSample(x,p,m,h,n,a),!a)return}}},H}();Y.default=P},"./src/demux/transmuxer-interface.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"default",function(){return r});var G=j("./node_modules/webworkify-webpack/index.js"),L=j.n(G),P=j("./src/events.ts"),H=j("./src/demux/transmuxer.ts"),O=j("./src/utils/logger.ts"),I=j("./src/errors.ts"),x=j("./src/utils/mediasource-helper.ts"),p=j("./node_modules/eventemitter3/index.js"),m=j.n(p),h=Object(x.getMediaSource)()||{isTypeSupported:function(){return!1}},r=function(){function n(l,s,u,c){var R=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=l,this.id=s,this.onTransmuxComplete=u,this.onFlush=c;var w=l.config,C=function(f,d){d=d||{},d.frag=R.frag,d.id=R.id,l.trigger(f,d)};this.observer=new p.EventEmitter,this.observer.on(P.Events.FRAG_DECRYPTED,C),this.observer.on(P.Events.ERROR,C);var D={mp4:h.isTypeSupported("video/mp4"),mpeg:h.isTypeSupported("audio/mpeg"),mp3:h.isTypeSupported('audio/mp4; codecs="mp3"')},S=navigator.vendor;if(w.enableWorker&&typeof Worker!="undefined"){O.logger.log("demuxing in webworker");var b;try{b=this.worker=G("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),b.addEventListener("message",this.onwmsg),b.onerror=function(_){l.trigger(P.Events.ERROR,{type:I.ErrorTypes.OTHER_ERROR,details:I.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(_.message+" ("+_.filename+":"+_.lineno+")")})},b.postMessage({cmd:"init",typeSupported:D,vendor:S,id:s,config:JSON.stringify(w)})}catch(_){O.logger.warn("Error in worker:",_),O.logger.error("Error while initializing DemuxerWorker, fallback to inline"),b&&self.URL.revokeObjectURL(b.objectURL),this.transmuxer=new H.default(this.observer,D,w,S,s),this.worker=null}}else this.transmuxer=new H.default(this.observer,D,w,S,s)}var a=n.prototype;return a.destroy=function(){var s=this.worker;if(s)s.removeEventListener("message",this.onwmsg),s.terminate(),this.worker=null;else{var u=this.transmuxer;u&&(u.destroy(),this.transmuxer=null)}var c=this.observer;c&&c.removeAllListeners(),this.observer=null},a.push=function(s,u,c,R,w,C,D,S,b,_){var f=this;b.transmuxing.start=self.performance.now();var d=this.transmuxer,g=this.worker,E=C?C.start:w.start,T=w.decryptdata,F=this.frag,U=!(F&&w.cc===F.cc),K=!(F&&b.level===F.level),z=F?b.sn-F.sn:-1,M=this.part?b.part-this.part.index:1,y=!K&&(z===1||z===0&&M===1),W=self.performance.now();(K||z||w.stats.parsing.start===0)&&(w.stats.parsing.start=W),C&&(M||!y)&&(C.stats.parsing.start=W);var X=new H.TransmuxState(U,y,S,K,E);if(!y||U){O.logger.log("[transmuxer-interface, "+w.type+"]: Starting new transmux session for sn: "+b.sn+" p: "+b.part+" level: "+b.level+" id: "+b.id+`
discontinuity: `+U+`
trackSwitch: `+K+`
contiguous: `+y+`
accurateTimeOffset: `+S+`
timeOffset: `+E);var te=new H.TransmuxConfig(c,R,u,D,_);this.configureTransmuxer(te)}if(this.frag=w,this.part=C,g)g.postMessage({cmd:"demux",data:s,decryptdata:T,chunkMeta:b,state:X},s instanceof ArrayBuffer?[s]:[]);else if(d){var pe=d.push(s,T,b,X);Object(H.isPromise)(pe)?pe.then(function(Ie){f.handleTransmuxComplete(Ie)}):this.handleTransmuxComplete(pe)}},a.flush=function(s){var u=this;s.transmuxing.start=self.performance.now();var c=this.transmuxer,R=this.worker;if(R)R.postMessage({cmd:"flush",chunkMeta:s});else if(c){var w=c.flush(s);Object(H.isPromise)(w)?w.then(function(C){u.handleFlushResult(C,s)}):this.handleFlushResult(w,s)}},a.handleFlushResult=function(s,u){var c=this;s.forEach(function(R){c.handleTransmuxComplete(R)}),this.onFlush(u)},a.onWorkerMessage=function(s){var u=s.data,c=this.hls;switch(u.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(u.data);break}case"flush":{this.onFlush(u.data);break}default:{u.data=u.data||{},u.data.frag=this.frag,u.data.id=this.id,c.trigger(u.event,u.data);break}}},a.configureTransmuxer=function(s){var u=this.worker,c=this.transmuxer;u?u.postMessage({cmd:"configure",config:s}):c&&c.configure(s)},a.handleTransmuxComplete=function(s){s.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(s)},n}()},"./src/demux/transmuxer-worker.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"default",function(){return I});var G=j("./src/demux/transmuxer.ts"),L=j("./src/events.ts"),P=j("./src/utils/logger.ts"),H=j("./node_modules/eventemitter3/index.js"),O=j.n(H);function I(r){var n=new H.EventEmitter,a=function(s,u){r.postMessage({event:s,data:u})};n.on(L.Events.FRAG_DECRYPTED,a),n.on(L.Events.ERROR,a),r.addEventListener("message",function(l){var s=l.data;switch(s.cmd){case"init":{var u=JSON.parse(s.config);r.transmuxer=new G.default(n,s.typeSupported,u,s.vendor,s.id),Object(P.enableLogs)(u.debug),a("init",null);break}case"configure":{r.transmuxer.configure(s.config);break}case"demux":{var c=r.transmuxer.push(s.data,s.decryptdata,s.chunkMeta,s.state);Object(G.isPromise)(c)?c.then(function(C){x(r,C)}):x(r,c);break}case"flush":{var R=s.chunkMeta,w=r.transmuxer.flush(R);Object(G.isPromise)(w)?w.then(function(C){m(r,C,R)}):m(r,w,R);break}default:break}})}function x(r,n){if(h(n.remuxResult))return;var a=[],l=n.remuxResult,s=l.audio,u=l.video;s&&p(a,s),u&&p(a,u),r.postMessage({event:"transmuxComplete",data:n},a)}function p(r,n){n.data1&&r.push(n.data1.buffer),n.data2&&r.push(n.data2.buffer)}function m(r,n,a){n.forEach(function(l){x(r,l)}),r.postMessage({event:"flush",data:a})}function h(r){return!r.audio&&!r.video&&!r.text&&!r.id3&&!r.initSegment}},"./src/demux/transmuxer.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"default",function(){return u}),j.d(Y,"isPromise",function(){return w}),j.d(Y,"TransmuxConfig",function(){return C}),j.d(Y,"TransmuxState",function(){return D});var G=j("./src/events.ts"),L=j("./src/errors.ts"),P=j("./src/crypt/decrypter.ts"),H=j("./src/demux/aacdemuxer.ts"),O=j("./src/demux/mp4demuxer.ts"),I=j("./src/demux/tsdemuxer.ts"),x=j("./src/demux/mp3demuxer.ts"),p=j("./src/remux/mp4-remuxer.ts"),m=j("./src/remux/passthrough-remuxer.ts"),h=j("./src/demux/chunk-cache.ts"),r=j("./src/utils/mp4-tools.ts"),n=j("./src/utils/logger.ts"),a;try{a=self.performance.now.bind(self.performance)}catch(S){n.logger.debug("Unable to use Performance API on this environment"),a=self.Date.now}var l=[{demux:I.default,remux:p.default},{demux:O.default,remux:m.default},{demux:H.default,remux:p.default},{demux:x.default,remux:p.default}],s=1024;l.forEach(function(S){var b=S.demux;s=Math.max(s,b.minProbeByteLength)});var u=function(){function S(_,f,d,g,E){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 h.default,this.observer=_,this.typeSupported=f,this.config=d,this.vendor=g,this.id=E}var b=S.prototype;return b.configure=function(f){this.transmuxConfig=f,this.decrypter&&this.decrypter.reset()},b.push=function(f,d,g,E){var T=this,F=g.transmuxing;F.executeStart=a();var U=new Uint8Array(f),K=this.cache,z=this.config,M=this.currentTransmuxState,y=this.transmuxConfig;E&&(this.currentTransmuxState=E);var W=c(U,d);if(W&&W.method==="AES-128"){var X=this.getDecrypter();if(z.enableSoftwareAES){var te=X.softwareDecrypt(U,W.key.buffer,W.iv.buffer);if(!te)return F.executeEnd=a(),R(g);U=new Uint8Array(te)}else return this.decryptionPromise=X.webCryptoDecrypt(U,W.key.buffer,W.iv.buffer).then(function($){var J=T.push($,null,g);return T.decryptionPromise=null,J}),this.decryptionPromise}var pe=E||M,Ie=pe.contiguous,Ee=pe.discontinuity,Te=pe.trackSwitch,We=pe.accurateTimeOffset,He=pe.timeOffset,Ce=y.audioCodec,ue=y.videoCodec,se=y.defaultInitPts,we=y.duration,ge=y.initSegmentData;if((Ee||Te)&&this.resetInitSegment(ge,Ce,ue,we),Ee&&this.resetInitialTimestamp(se),Ie||this.resetContiguity(),this.needsProbing(U,Ee,Te)){if(K.dataLength){var Ke=K.flush();U=Object(r.appendUint8Array)(Ke,U)}this.configureTransmuxer(U,y)}var st=this.transmux(U,W,He,We,g),ne=this.currentTransmuxState;return ne.contiguous=!0,ne.discontinuity=!1,ne.trackSwitch=!1,F.executeEnd=a(),st},b.flush=function(f){var d=this,g=f.transmuxing;g.executeStart=a();var E=this.decrypter,T=this.cache,F=this.currentTransmuxState,U=this.decryptionPromise;if(U)return U.then(function(){return d.flush(f)});var K=[],z=F.timeOffset;if(E){var M=E.flush();M&&K.push(this.push(M,null,f))}var y=T.dataLength;T.reset();var W=this.demuxer,X=this.remuxer;if(!W||!X)return y>=s&&this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),g.executeEnd=a(),[R(f)];var te=W.flush(z);return w(te)?te.then(function(pe){return d.flushRemux(K,pe,f),K}):(this.flushRemux(K,te,f),K)},b.flushRemux=function(f,d,g){var E=d.audioTrack,T=d.avcTrack,F=d.id3Track,U=d.textTrack,K=this.currentTransmuxState,z=K.accurateTimeOffset,M=K.timeOffset;n.logger.log("[transmuxer.ts]: Flushed fragment "+g.sn+(g.part>-1?" p: "+g.part:"")+" of level "+g.level);var y=this.remuxer.remux(E,T,F,U,M,z,!0,this.id);f.push({remuxResult:y,chunkMeta:g}),g.transmuxing.executeEnd=a()},b.resetInitialTimestamp=function(f){var d=this.demuxer,g=this.remuxer;if(!d||!g)return;d.resetTimeStamp(f),g.resetTimeStamp(f)},b.resetContiguity=function(){var f=this.demuxer,d=this.remuxer;if(!f||!d)return;f.resetContiguity(),d.resetNextTimestamp()},b.resetInitSegment=function(f,d,g,E){var T=this.demuxer,F=this.remuxer;if(!T||!F)return;T.resetInitSegment(d,g,E),F.resetInitSegment(f,d,g)},b.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},b.transmux=function(f,d,g,E,T){var F;return d&&d.method==="SAMPLE-AES"?F=this.transmuxSampleAes(f,d,g,E,T):F=this.transmuxUnencrypted(f,g,E,T),F},b.transmuxUnencrypted=function(f,d,g,E){var T=this.demuxer.demux(f,d,!1,!this.config.progressive),F=T.audioTrack,U=T.avcTrack,K=T.id3Track,z=T.textTrack,M=this.remuxer.remux(F,U,K,z,d,g,!1,this.id);return{remuxResult:M,chunkMeta:E}},b.transmuxSampleAes=function(f,d,g,E,T){var F=this;return this.demuxer.demuxSampleAes(f,d,g).then(function(U){var K=F.remuxer.remux(U.audioTrack,U.avcTrack,U.id3Track,U.textTrack,g,E,!1,F.id);return{remuxResult:K,chunkMeta:T}})},b.configureTransmuxer=function(f,d){for(var g=this.config,E=this.observer,T=this.typeSupported,F=this.vendor,U=d.audioCodec,K=d.defaultInitPts,z=d.duration,M=d.initSegmentData,y=d.videoCodec,W,X=0,te=l.length;X<te;X++)if(l[X].demux.probe(f)){W=l[X];break}W||(n.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),W={demux:O.default,remux:m.default});var pe=this.demuxer,Ie=this.remuxer,Ee=W.remux,Te=W.demux;(!Ie||!(Ie instanceof Ee))&&(this.remuxer=new Ee(E,g,T,F)),(!pe||!(pe instanceof Te))&&(this.demuxer=new Te(E,g,T),this.probe=Te.probe),this.resetInitSegment(M,U,y,z),this.resetInitialTimestamp(K)},b.needsProbing=function(f,d,g){return!this.demuxer||!this.remuxer||d||g},b.getDecrypter=function(){var f=this.decrypter;return f||(f=this.decrypter=new P.default(this.observer,this.config)),f},S}();function c(S,b){var _=null;return S.byteLength>0&&b!=null&&b.key!=null&&b.iv!==null&&b.method!=null&&(_=b),_}var R=function(b){return{remuxResult:{},chunkMeta:b}};function w(S){return"then"in S&&S.then instanceof Function}var C=function(b,_,f,d,g){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=b,this.videoCodec=_,this.initSegmentData=f,this.duration=d,this.defaultInitPts=g},D=function(b,_,f,d,g){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=b,this.contiguous=_,this.accurateTimeOffset=f,this.trackSwitch=d,this.timeOffset=g}},"./src/demux/tsdemuxer.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"discardEPB",function(){return R});var G=j("./src/demux/adts.ts"),L=j("./src/demux/mpegaudio.ts"),P=j("./src/demux/exp-golomb.ts"),H=j("./src/demux/id3.ts"),O=j("./src/demux/sample-aes.ts"),I=j("./src/events.ts"),x=j("./src/utils/mp4-tools.ts"),p=j("./src/utils/logger.ts"),m=j("./src/errors.ts"),h={video:1,audio:2,id3:3,text:4},r=function(){function w(D,S,b){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=D,this.config=S,this.typeSupported=b}w.probe=function(S){var b=w.syncOffset(S);return b<0?!1:(b&&p.logger.warn("MPEG2-TS detected but first sync word found @ offset "+b+", junk ahead ?"),!0)},w.syncOffset=function(S){for(var b=Math.min(1e3,S.length-3*188),_=0;_<b;){if(S[_]===71&&S[_+188]===71&&S[_+2*188]===71)return _;_++}return-1},w.createTrack=function(S,b){return{container:S==="video"||S==="audio"?"video/mp2t":void 0,type:S,id:h[S],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:S==="audio"?b:void 0}};var C=w.prototype;return C.resetInitSegment=function(S,b,_){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=w.createTrack("video",_),this._audioTrack=w.createTrack("audio",_),this._id3Track=w.createTrack("id3",_),this._txtTrack=w.createTrack("text",_),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=S,this.videoCodec=b,this._duration=_},C.resetTimeStamp=function(){},C.resetContiguity=function(){var S=this._audioTrack,b=this._avcTrack,_=this._id3Track;S&&(S.pesData=null),b&&(b.pesData=null),_&&(_.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},C.demux=function(S,b,_,f){_===void 0&&(_=!1),f===void 0&&(f=!1),_||(this.sampleAes=null);var d,g=this._avcTrack,E=this._audioTrack,T=this._id3Track,F=g.pid,U=g.pesData,K=E.pid,z=T.pid,M=E.pesData,y=T.pesData,W=!1,X=this.pmtParsed,te=this._pmtId,pe=S.length;if(this.remainderData&&(S=Object(x.appendUint8Array)(this.remainderData,S),pe=S.length,this.remainderData=null),pe<188&&!f)return this.remainderData=S,{audioTrack:E,avcTrack:g,id3Track:T,textTrack:this._txtTrack};var Ie=Math.max(0,w.syncOffset(S));pe-=(pe+Ie)%188,pe<S.byteLength&&!f&&(this.remainderData=new Uint8Array(S.buffer,pe,S.buffer.byteLength-pe));for(var Ee=Ie;Ee<pe;Ee+=188)if(S[Ee]===71){var Te=!!(S[Ee+1]&64),We=((S[Ee+1]&31)<<8)+S[Ee+2],He=(S[Ee+3]&48)>>4,Ce=void 0;if(He>1){if(Ce=Ee+5+S[Ee+4],Ce===Ee+188)continue}else Ce=Ee+4;switch(We){case F:Te&&(U&&(d=s(U))&&this.parseAVCPES(d,!1),U={data:[],size:0}),U&&(U.data.push(S.subarray(Ce,Ee+188)),U.size+=Ee+188-Ce);break;case K:Te&&(M&&(d=s(M))&&(E.isAAC?this.parseAACPES(d):this.parseMPEGPES(d)),M={data:[],size:0}),M&&(M.data.push(S.subarray(Ce,Ee+188)),M.size+=Ee+188-Ce);break;case z:Te&&(y&&(d=s(y))&&this.parseID3PES(d),y={data:[],size:0}),y&&(y.data.push(S.subarray(Ce,Ee+188)),y.size+=Ee+188-Ce);break;case 0:Te&&(Ce+=S[Ce]+1),te=this._pmtId=a(S,Ce);break;case te:{Te&&(Ce+=S[Ce]+1);var ue=l(S,Ce,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,_);F=ue.avc,F>0&&(g.pid=F),K=ue.audio,K>0&&(E.pid=K,E.isAAC=ue.isAAC),z=ue.id3,z>0&&(T.pid=z),W&&!X&&(p.logger.log("reparse from beginning"),W=!1,Ee=Ie-188),X=this.pmtParsed=!0;break}case 17:case 8191:break;default:W=!0;break}}else this.observer.emit(I.Events.ERROR,I.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});g.pesData=U,E.pesData=M,T.pesData=y;var se={audioTrack:E,avcTrack:g,id3Track:T,textTrack:this._txtTrack};return f&&this.extractRemainingSamples(se),se},C.flush=function(){var S=this.remainderData;this.remainderData=null;var b;return S?b=this.demux(S,-1,!1,!0):b={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(b),this.sampleAes?this.decrypt(b,this.sampleAes):b},C.extractRemainingSamples=function(S){var b=S.audioTrack,_=S.avcTrack,f=S.id3Track,d=_.pesData,g=b.pesData,E=f.pesData,T;d&&(T=s(d))?(this.parseAVCPES(T,!0),_.pesData=null):_.pesData=d,g&&(T=s(g))?(b.isAAC?this.parseAACPES(T):this.parseMPEGPES(T),b.pesData=null):(g!=null&&g.size&&p.logger.log("last AAC PES packet truncated,might overlap between fragments"),b.pesData=g),E&&(T=s(E))?(this.parseID3PES(T),f.pesData=null):f.pesData=E},C.demuxSampleAes=function(S,b,_){var f=this.demux(S,_,!0,!this.config.progressive),d=this.sampleAes=new O.default(this.observer,this.config,b);return this.decrypt(f,d)},C.decrypt=function(S,b){return new Promise(function(_){var f=S.audioTrack,d=S.avcTrack;f.samples&&f.isAAC?b.decryptAacSamples(f.samples,0,function(){d.samples?b.decryptAvcSamples(d.samples,0,0,function(){_(S)}):_(S)}):d.samples&&b.decryptAvcSamples(d.samples,0,0,function(){_(S)})})},C.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},C.parseAVCPES=function(S,b){var _=this,f=this._avcTrack,d=this.parseAVCNALu(S.data),g=!1,E=this.avcSample,T,F=!1;S.data=null,E&&d.length&&!f.audFound&&(u(E,f),E=this.avcSample=n(!1,S.pts,S.dts,"")),d.forEach(function(U){switch(U.type){case 1:{T=!0,E||(E=_.avcSample=n(!0,S.pts,S.dts,"")),g&&(E.debug+="NDR "),E.frame=!0;var K=U.data;if(F&&K.length>4){var z=new P.default(K).readSliceType();(z===2||z===4||z===7||z===9)&&(E.key=!0)}break}case 5:T=!0,E||(E=_.avcSample=n(!0,S.pts,S.dts,"")),g&&(E.debug+="IDR "),E.key=!0,E.frame=!0;break;case 6:{T=!0,g&&E&&(E.debug+="SEI ");var M=new P.default(R(U.data));M.readUByte();for(var y=0,W=0,X=!1,te=0;!X&&M.bytesAvailable>1;){y=0;do te=M.readUByte(),y+=te;while(te===255);W=0;do te=M.readUByte(),W+=te;while(te===255);if(y===4&&M.bytesAvailable!==0){X=!0;var pe=M.readUByte();if(pe===181){var Ie=M.readUShort();if(Ie===49){var Ee=M.readUInt();if(Ee===1195456820){var Te=M.readUByte();if(Te===3){for(var We=M.readUByte(),He=M.readUByte(),Ce=31&We,ue=[We,He],se=0;se<Ce;se++)ue.push(M.readUByte()),ue.push(M.readUByte()),ue.push(M.readUByte());c(_._txtTrack.samples,{type:3,pts:S.pts,bytes:ue})}}}}}else if(y===5&&M.bytesAvailable!==0){if(X=!0,W>16){for(var we=[],ge=0;ge<16;ge++)we.push(M.readUByte().toString(16)),(ge===3||ge===5||ge===7||ge===9)&&we.push("-");for(var Ke=W-16,st=new Uint8Array(Ke),ne=0;ne<Ke;ne++)st[ne]=M.readUByte();c(_._txtTrack.samples,{pts:S.pts,payloadType:y,uuid:we.join(""),userData:Object(H.utf8ArrayToStr)(st),userDataBytes:st})}}else if(W<M.bytesAvailable)for(var $=0;$<W;$++)M.readUByte()}break}case 7:if(T=!0,F=!0,g&&E&&(E.debug+="SPS "),!f.sps){var J=new P.default(U.data),me=J.readSPS();f.width=me.width,f.height=me.height,f.pixelRatio=me.pixelRatio,f.sps=[U.data],f.duration=_._duration;for(var xe=U.data.subarray(1,4),ke="avc1.",$e=0;$e<3;$e++){var Pt=xe[$e].toString(16);Pt.length<2&&(Pt="0"+Pt),ke+=Pt}f.codec=ke}break;case 8:T=!0,g&&E&&(E.debug+="PPS "),f.pps||(f.pps=[U.data]);break;case 9:T=!1,f.audFound=!0,E&&u(E,f),E=_.avcSample=n(!1,S.pts,S.dts,g?"AUD ":"");break;case 12:T=!1;break;default:T=!1,E&&(E.debug+="unknown NAL "+U.type+" ");break}if(E&&T){var Xt=E.units;Xt.push(U)}}),b&&E&&(u(E,f),this.avcSample=null)},C.getLastNalUnit=function(){var S,b=this.avcSample,_;if(!b||b.units.length===0){var f=this._avcTrack.samples;b=f[f.length-1]}if((S=b)!==null&&S!==void 0&&S.units){var d=b.units;_=d[d.length-1]}return _},C.parseAVCNALu=function(S){var b=S.byteLength,_=this._avcTrack,f=_.naluState||0,d=f,g=[],E=0,T,F,U,K=-1,z=0;for(f===-1&&(K=0,z=S[0]&31,f=0,E=1);E<b;){if(T=S[E++],!f){f=T?0:1;continue}if(f===1){f=T?0:2;continue}if(!T)f=3;else if(T===1){if(K>=0){var M={data:S.subarray(K,E-f-1),type:z};g.push(M)}else{var y=this.getLastNalUnit();if(y&&(d&&E<=4-d&&(y.state&&(y.data=y.data.subarray(0,y.data.byteLength-d))),F=E-f-1,F>0)){var W=new Uint8Array(y.data.byteLength+F);W.set(y.data,0),W.set(S.subarray(0,F),y.data.byteLength),y.data=W,y.state=0}}E<b?(U=S[E]&31,K=E,z=U,f=0):f=-1}else f=0}if(K>=0&&f>=0){var X={data:S.subarray(K,b),type:z,state:f};g.push(X)}if(g.length===0){var te=this.getLastNalUnit();if(te){var pe=new Uint8Array(te.data.byteLength+S.byteLength);pe.set(te.data,0),pe.set(S,te.data.byteLength),te.data=pe}}return _.naluState=f,g},C.parseAACPES=function(S){var b=0,_=this._audioTrack,f=this.aacOverFlow,d=S.data;if(f){this.aacOverFlow=null;var g=f.sample.unit.byteLength,E=Math.min(f.missing,g),T=g-E;f.sample.unit.set(d.subarray(0,E),T),_.samples.push(f.sample),b=f.missing}var F,U;for(F=b,U=d.length;F<U-1&&!G.isHeader(d,F);F++);if(F!==b){var K,z;if(F<U-1?(K="AAC PES did not start with ADTS header,offset:"+F,z=!1):(K="no ADTS header found in AAC PES",z=!0),p.logger.warn("parsing error:"+K),this.observer.emit(I.Events.ERROR,I.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:z,reason:K}),z)return}G.initTrackConfig(_,this.observer,d,F,this.audioCodec);var M;if(S.pts!==void 0)M=S.pts;else if(f){var y=G.getFrameDuration(_.samplerate);M=f.sample.pts+y}else{p.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var W=0;F<U;)if(G.isHeader(d,F)){if(F+5<U){var X=G.appendFrame(_,d,F,M,W);if(X)if(X.missing)this.aacOverFlow=X;else{F+=X.length,W++;continue}}break}else F++},C.parseMPEGPES=function(S){var b=S.data,_=b.length,f=0,d=0,g=S.pts;if(g===void 0){p.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;d<_;)if(L.isHeader(b,d)){var E=L.appendFrame(this._audioTrack,b,d,g,f);if(E)d+=E.length,f++;else break}else d++},C.parseID3PES=function(S){if(S.pts===void 0){p.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(S)},w}();r.minProbeByteLength=188;function n(w,C,D,S){return{key:w,frame:!1,pts:C,dts:D,units:[],debug:S,length:0}}function a(w,C){return(w[C+10]&31)<<8|w[C+11]}function l(w,C,D,S){var b={audio:-1,avc:-1,id3:-1,isAAC:!0},_=(w[C+1]&15)<<8|w[C+2],f=C+3+_-4,d=(w[C+10]&15)<<8|w[C+11];for(C+=12+d;C<f;){var g=(w[C+1]&31)<<8|w[C+2];switch(w[C]){case 207:if(!S){p.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:b.audio===-1&&(b.audio=g);break;case 21:b.id3===-1&&(b.id3=g);break;case 219:if(!S){p.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:b.avc===-1&&(b.avc=g);break;case 3:case 4:D?b.audio===-1&&(b.audio=g,b.isAAC=!1):p.logger.log("MPEG audio found, not supported in this browser");break;case 36:p.logger.warn("Unsupported HEVC stream type found");break;default:break}C+=((w[C+3]&15)<<8|w[C+4])+5}return b}function s(w){var C=0,D,S,b,_,f,d=w.data;if(!w||w.size===0)return null;for(;d[0].length<19&&d.length>1;){var g=new Uint8Array(d[0].length+d[1].length);g.set(d[0]),g.set(d[1],d[0].length),d[0]=g,d.splice(1,1)}D=d[0];var E=(D[0]<<16)+(D[1]<<8)+D[2];if(E===1){if(S=(D[4]<<8)+D[5],S&&S>w.size-6)return null;var T=D[7];T&192&&(_=(D[9]&14)*536870912+(D[10]&255)*4194304+(D[11]&254)*16384+(D[12]&255)*128+(D[13]&254)/2,T&64?(f=(D[14]&14)*536870912+(D[15]&255)*4194304+(D[16]&254)*16384+(D[17]&255)*128+(D[18]&254)/2,_-f>60*9e4&&(p.logger.warn(Math.round((_-f)/9e4)+"s delta between PTS and DTS, align them"),_=f)):f=_),b=D[8];var F=b+9;if(w.size<=F)return null;w.size-=F;for(var U=new Uint8Array(w.size),K=0,z=d.length;K<z;K++){D=d[K];var M=D.byteLength;if(F)if(F>M){F-=M;continue}else D=D.subarray(F),M-=F,F=0;U.set(D,C),C+=M}return S&&(S-=b+3),{data:U,pts:_,dts:f,len:S}}return null}function u(w,C){if(w.units.length&&w.frame){if(w.pts===void 0){var D=C.samples,S=D.length;if(S){var b=D[S-1];w.pts=b.pts,w.dts=b.dts}else{C.dropped++;return}}C.samples.push(w)}w.debug.length&&p.logger.log(w.pts+"/"+w.dts+":"+w.debug)}function c(w,C){var D=w.length;if(D>0){if(C.pts>=w[D-1].pts)w.push(C);else for(var S=D-1;S>=0;S--)if(C.pts<w[S].pts){w.splice(S,0,C);break}}else w.push(C)}function R(w){for(var C=w.byteLength,D=[],S=1;S<C-2;)w[S]===0&&w[S+1]===0&&w[S+2]===3?(D.push(S+2),S+=2):S++;if(D.length===0)return w;var b=C-D.length,_=new Uint8Array(b),f=0;for(S=0;S<b;f++,S++)f===D[0]&&(f++,D.shift()),_[S]=w[f];return _}Y.default=r},"./src/errors.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"ErrorTypes",function(){return G}),j.d(Y,"ErrorDetails",function(){return L});var G;(function(P){P.NETWORK_ERROR="networkError",P.MEDIA_ERROR="mediaError",P.KEY_SYSTEM_ERROR="keySystemError",P.MUX_ERROR="muxError",P.OTHER_ERROR="otherError"})(G||(G={}));var L;(function(P){P.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",P.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",P.KEY_SYSTEM_NO_SESSION="keySystemNoSession",P.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",P.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",P.MANIFEST_LOAD_ERROR="manifestLoadError",P.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",P.MANIFEST_PARSING_ERROR="manifestParsingError",P.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",P.LEVEL_EMPTY_ERROR="levelEmptyError",P.LEVEL_LOAD_ERROR="levelLoadError",P.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",P.LEVEL_SWITCH_ERROR="levelSwitchError",P.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",P.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",P.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",P.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",P.FRAG_LOAD_ERROR="fragLoadError",P.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",P.FRAG_DECRYPT_ERROR="fragDecryptError",P.FRAG_PARSING_ERROR="fragParsingError",P.REMUX_ALLOC_ERROR="remuxAllocError",P.KEY_LOAD_ERROR="keyLoadError",P.KEY_LOAD_TIMEOUT="keyLoadTimeOut",P.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",P.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",P.BUFFER_APPEND_ERROR="bufferAppendError",P.BUFFER_APPENDING_ERROR="bufferAppendingError",P.BUFFER_STALLED_ERROR="bufferStalledError",P.BUFFER_FULL_ERROR="bufferFullError",P.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",P.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",P.INTERNAL_EXCEPTION="internalException",P.INTERNAL_ABORTED="aborted",P.UNKNOWN="unknown"})(L||(L={}))},"./src/events.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"Events",function(){return G});var G;(function(L){L.MEDIA_ATTACHING="hlsMediaAttaching",L.MEDIA_ATTACHED="hlsMediaAttached",L.MEDIA_DETACHING="hlsMediaDetaching",L.MEDIA_DETACHED="hlsMediaDetached",L.BUFFER_RESET="hlsBufferReset",L.BUFFER_CODECS="hlsBufferCodecs",L.BUFFER_CREATED="hlsBufferCreated",L.BUFFER_APPENDING="hlsBufferAppending",L.BUFFER_APPENDED="hlsBufferAppended",L.BUFFER_EOS="hlsBufferEos",L.BUFFER_FLUSHING="hlsBufferFlushing",L.BUFFER_FLUSHED="hlsBufferFlushed",L.MANIFEST_LOADING="hlsManifestLoading",L.MANIFEST_LOADED="hlsManifestLoaded",L.MANIFEST_PARSED="hlsManifestParsed",L.LEVEL_SWITCHING="hlsLevelSwitching",L.LEVEL_SWITCHED="hlsLevelSwitched",L.LEVEL_LOADING="hlsLevelLoading",L.LEVEL_LOADED="hlsLevelLoaded",L.LEVEL_UPDATED="hlsLevelUpdated",L.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",L.LEVELS_UPDATED="hlsLevelsUpdated",L.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",L.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",L.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",L.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",L.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",L.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",L.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",L.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",L.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",L.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",L.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",L.CUES_PARSED="hlsCuesParsed",L.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",L.INIT_PTS_FOUND="hlsInitPtsFound",L.FRAG_LOADING="hlsFragLoading",L.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",L.FRAG_LOADED="hlsFragLoaded",L.FRAG_DECRYPTED="hlsFragDecrypted",L.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",L.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",L.FRAG_PARSING_METADATA="hlsFragParsingMetadata",L.FRAG_PARSED="hlsFragParsed",L.FRAG_BUFFERED="hlsFragBuffered",L.FRAG_CHANGED="hlsFragChanged",L.FPS_DROP="hlsFpsDrop",L.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",L.ERROR="hlsError",L.DESTROYING="hlsDestroying",L.KEY_LOADING="hlsKeyLoading",L.KEY_LOADED="hlsKeyLoaded",L.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",L.BACK_BUFFER_REACHED="hlsBackBufferReached"})(G||(G={}))},"./src/hls.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"default",function(){return w});var G=j("./node_modules/url-toolkit/src/url-toolkit.js"),L=j.n(G),P=j("./src/loader/playlist-loader.ts"),H=j("./src/loader/key-loader.ts"),O=j("./src/controller/id3-track-controller.ts"),I=j("./src/controller/latency-controller.ts"),x=j("./src/controller/level-controller.ts"),p=j("./src/controller/fragment-tracker.ts"),m=j("./src/controller/stream-controller.ts"),h=j("./src/is-supported.ts"),r=j("./src/utils/logger.ts"),n=j("./src/config.ts"),a=j("./node_modules/eventemitter3/index.js"),l=j.n(a),s=j("./src/events.ts"),u=j("./src/errors.ts");function c(C,D){for(var S=0;S<D.length;S++){var b=D[S];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(C,b.key,b)}}function R(C,D,S){return D&&c(C.prototype,D),S&&c(C,S),C}var w=function(){C.isSupported=function(){return Object(h.isSupported)()};function C(S){S===void 0&&(S={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new a.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 b=this.config=Object(n.mergeConfig)(C.DefaultConfig,S);this.userConfig=S,Object(r.enableLogs)(b.debug),this._autoLevelCapping=-1,b.progressive&&Object(n.enableStreamingMode)(b);var _=b.abrController,f=b.bufferController,d=b.capLevelController,g=b.fpsController,E=this.abrController=new _(this),T=this.bufferController=new f(this),F=this.capLevelController=new d(this),U=new g(this),K=new P.default(this),z=new H.default(this),M=new O.default(this),y=this.levelController=new x.default(this),W=new p.FragmentTracker(this),X=this.streamController=new m.default(this,W);F.setStreamController(X),U.setStreamController(X);var te=[y,X];this.networkControllers=te;var pe=[K,z,E,T,F,U,M,W];this.audioTrackController=this.createController(b.audioTrackController,null,te),this.createController(b.audioStreamController,W,te),this.subtitleTrackController=this.createController(b.subtitleTrackController,null,te),this.createController(b.subtitleStreamController,W,te),this.createController(b.timelineController,null,pe),this.emeController=this.createController(b.emeController,null,pe),this.cmcdController=this.createController(b.cmcdController,null,pe),this.latencyController=this.createController(I.default,null,pe),this.coreComponents=pe}var D=C.prototype;return D.createController=function(b,_,f){if(b){var d=_?new b(this,_):new b(this);return f&&f.push(d),d}return null},D.on=function(b,_,f){f===void 0&&(f=this),this._emitter.on(b,_,f)},D.once=function(b,_,f){f===void 0&&(f=this),this._emitter.once(b,_,f)},D.removeAllListeners=function(b){this._emitter.removeAllListeners(b)},D.off=function(b,_,f,d){f===void 0&&(f=this),this._emitter.off(b,_,f,d)},D.listeners=function(b){return this._emitter.listeners(b)},D.emit=function(b,_,f){return this._emitter.emit(b,_,f)},D.trigger=function(b,_){if(this.config.debug)return this.emit(b,b,_);try{return this.emit(b,b,_)}catch(f){r.logger.error("An internal error happened while handling event "+b+'. Error message: "'+f.message+'". Here is a stacktrace:',f),this.trigger(s.Events.ERROR,{type:u.ErrorTypes.OTHER_ERROR,details:u.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:b,error:f})}return!1},D.listenerCount=function(b){return this._emitter.listenerCount(b)},D.destroy=function(){r.logger.log("destroy"),this.trigger(s.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(b){return b.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(b){return b.destroy()}),this.coreComponents.length=0},D.attachMedia=function(b){r.logger.log("attachMedia"),this._media=b,this.trigger(s.Events.MEDIA_ATTACHING,{media:b})},D.detachMedia=function(){r.logger.log("detachMedia"),this.trigger(s.Events.MEDIA_DETACHING,void 0),this._media=null},D.loadSource=function(b){this.stopLoad();var _=this.media,f=this.url,d=this.url=G.buildAbsoluteURL(self.location.href,b,{alwaysNormalize:!0});r.logger.log("loadSource:"+d),_&&f&&f!==d&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(_)),this.trigger(s.Events.MANIFEST_LOADING,{url:b})},D.startLoad=function(b){b===void 0&&(b=-1),r.logger.log("startLoad("+b+")"),this.networkControllers.forEach(function(_){_.startLoad(b)})},D.stopLoad=function(){r.logger.log("stopLoad"),this.networkControllers.forEach(function(b){b.stopLoad()})},D.swapAudioCodec=function(){r.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},D.recoverMediaError=function(){r.logger.log("recoverMediaError");var b=this._media;this.detachMedia(),b&&this.attachMedia(b)},D.removeLevel=function(b,_){_===void 0&&(_=0),this.levelController.removeLevel(b,_)},R(C,[{key:"levels",get:function(){var b=this.levelController.levels;return b||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(b){r.logger.log("set currentLevel:"+b),this.loadLevel=b,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(b){r.logger.log("set nextLevel:"+b),this.levelController.manualLevel=b,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(b){r.logger.log("set loadLevel:"+b),this.levelController.manualLevel=b}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(b){this.levelController.nextLoadLevel=b}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(b){r.logger.log("set firstLevel:"+b),this.levelController.firstLevel=b}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(b){r.logger.log("set startLevel:"+b),b!==-1&&(b=Math.max(b,this.minAutoLevel)),this.levelController.startLevel=b}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(b){var _=!!b;_!==this.config.capLevelToPlayerSize&&(_?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=_)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(b){this._autoLevelCapping!==b&&(r.logger.log("set autoLevelCapping:"+b),this._autoLevelCapping=b)}},{key:"bandwidthEstimate",get:function(){var b=this.abrController.bwEstimator;return b?b.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var b=this.levels,_=this.config.minAutoBitrate;if(!b)return 0;for(var f=b.length,d=0;d<f;d++)if(b[d].maxBitrate>_)return d;return 0}},{key:"maxAutoLevel",get:function(){var b=this.levels,_=this.autoLevelCapping,f;return _===-1&&b&&b.length?f=b.length-1:f=_,f}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(b){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,b)}},{key:"audioTracks",get:function(){var b=this.audioTrackController;return b?b.audioTracks:[]}},{key:"audioTrack",get:function(){var b=this.audioTrackController;return b?b.audioTrack:-1},set:function(b){var _=this.audioTrackController;_&&(_.audioTrack=b)}},{key:"subtitleTracks",get:function(){var b=this.subtitleTrackController;return b?b.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var b=this.subtitleTrackController;return b?b.subtitleTrack:-1},set:function(b){var _=this.subtitleTrackController;_&&(_.subtitleTrack=b)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var b=this.subtitleTrackController;return b?b.subtitleDisplay:!1},set:function(b){var _=this.subtitleTrackController;_&&(_.subtitleDisplay=b)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(b){this.config.lowLatencyMode=b}},{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 s.Events}},{key:"ErrorTypes",get:function(){return u.ErrorTypes}},{key:"ErrorDetails",get:function(){return u.ErrorDetails}},{key:"DefaultConfig",get:function(){return C.defaultConfig?C.defaultConfig:n.hlsDefaultConfig},set:function(b){C.defaultConfig=b}}]),C}();w.defaultConfig=void 0},"./src/is-supported.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"isSupported",function(){return P}),j.d(Y,"changeTypeSupported",function(){return H});var G=j("./src/utils/mediasource-helper.ts");function L(){return self.SourceBuffer||self.WebKitSourceBuffer}function P(){var O=Object(G.getMediaSource)();if(!O)return!1;var I=L(),x=O&&typeof O.isTypeSupported=="function"&&O.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),p=!I||I.prototype&&typeof I.prototype.appendBuffer=="function"&&typeof I.prototype.remove=="function";return!!x&&!!p}function H(){var O,I=L();return typeof(I==null||((O=I.prototype)===null||O===void 0)?void 0:O.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"default",function(){return r}),j.d(Y,"LoadError",function(){return a});var G=j("./src/polyfills/number.ts"),L=j("./src/errors.ts");function P(l,s){l.prototype=Object.create(s.prototype),l.prototype.constructor=l,p(l,s)}function H(l){var s=typeof Map=="function"?new Map:void 0;return H=function(c){if(c===null||!x(c))return c;if(typeof c!="function")throw new TypeError("Super expression must either be null or a function");if(typeof s!="undefined"){if(s.has(c))return s.get(c);s.set(c,R)}function R(){return O(c,arguments,m(this).constructor)}return R.prototype=Object.create(c.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),p(R,c)},H(l)}function O(l,s,u){return I()?O=Reflect.construct:O=function(R,w,C){var D=[null];D.push.apply(D,w);var S=Function.bind.apply(R,D),b=new S;return C&&p(b,C.prototype),b},O.apply(null,arguments)}function I(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(l){return!1}}function x(l){return Function.toString.call(l).indexOf("[native code]")!==-1}function p(l,s){return p=Object.setPrototypeOf||function(c,R){return c.__proto__=R,c},p(l,s)}function m(l){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},m(l)}var h=Math.pow(2,17),r=function(){function l(u){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=u}var s=l.prototype;return s.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},s.abort=function(){this.loader&&this.loader.abort()},s.load=function(c,R){var w=this,C=c.url;if(!C)return Promise.reject(new a({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:c,networkDetails:null},"Fragment does not have a "+(C?"part list":"url")));this.abort();var D=this.config,S=D.fLoader,b=D.loader;return new Promise(function(_,f){w.loader&&w.loader.destroy();var d=w.loader=c.loader=S?new S(D):new b(D),g=n(c),E={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:h};c.stats=d.stats,d.load(g,E,{onSuccess:function(F,U,K,z){w.resetLoader(c,d),_({frag:c,part:null,payload:F.data,networkDetails:z})},onError:function(F,U,K){w.resetLoader(c,d),f(new a({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:c,response:F,networkDetails:K}))},onAbort:function(F,U,K){w.resetLoader(c,d),f(new a({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:c,networkDetails:K}))},onTimeout:function(F,U,K){w.resetLoader(c,d),f(new a({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:c,networkDetails:K}))},onProgress:function(F,U,K,z){R&&R({frag:c,part:null,payload:K,networkDetails:z})}})})},s.loadPart=function(c,R,w){var C=this;this.abort();var D=this.config,S=D.fLoader,b=D.loader;return new Promise(function(_,f){C.loader&&C.loader.destroy();var d=C.loader=c.loader=S?new S(D):new b(D),g=n(c,R),E={timeout:D.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:D.fragLoadingMaxRetryTimeout,highWaterMark:h};R.stats=d.stats,d.load(g,E,{onSuccess:function(F,U,K,z){C.resetLoader(c,d),C.updateStatsFromPart(c,R);var M={frag:c,part:R,payload:F.data,networkDetails:z};w(M),_(M)},onError:function(F,U,K){C.resetLoader(c,d),f(new a({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:c,part:R,response:F,networkDetails:K}))},onAbort:function(F,U,K){c.stats.aborted=R.stats.aborted,C.resetLoader(c,d),f(new a({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:c,part:R,networkDetails:K}))},onTimeout:function(F,U,K){C.resetLoader(c,d),f(new a({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:c,part:R,networkDetails:K}))}})})},s.updateStatsFromPart=function(c,R){var w=c.stats,C=R.stats,D=C.total;if(w.loaded+=C.loaded,D){var S=Math.round(c.duration/R.duration),b=Math.min(Math.round(w.loaded/D),S),_=S-b,f=_*Math.round(w.loaded/b);w.total=w.loaded+f}else w.total=Math.max(w.loaded,w.total);var d=w.loading,g=C.loading;d.start?d.first+=g.first-g.start:(d.start=g.start,d.first=g.first),d.end=g.end},s.resetLoader=function(c,R){c.loader=null,this.loader===R&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),R.destroy()},l}();function n(l,s){s===void 0&&(s=null);var u=s||l,c={frag:l,part:s,responseType:"arraybuffer",url:u.url,headers:{},rangeStart:0,rangeEnd:0},R=u.byteRangeStartOffset,w=u.byteRangeEndOffset;return Object(G.isFiniteNumber)(R)&&Object(G.isFiniteNumber)(w)&&(c.rangeStart=R,c.rangeEnd=w),c}var a=function(l){P(s,l);function s(u){for(var c,R=arguments.length,w=new Array(R>1?R-1:0),C=1;C<R;C++)w[C-1]=arguments[C];return c=l.call.apply(l,[this].concat(w))||this,c.data=void 0,c.data=u,c}return s}(H(Error))},"./src/loader/fragment.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"ElementaryStreamTypes",function(){return r}),j.d(Y,"BaseSegment",function(){return n}),j.d(Y,"Fragment",function(){return a}),j.d(Y,"Part",function(){return l});var G=j("./src/polyfills/number.ts"),L=j("./node_modules/url-toolkit/src/url-toolkit.js"),P=j.n(L),H=j("./src/utils/logger.ts"),O=j("./src/loader/level-key.ts"),I=j("./src/loader/load-stats.ts");function x(s,u){s.prototype=Object.create(u.prototype),s.prototype.constructor=s,p(s,u)}function p(s,u){return p=Object.setPrototypeOf||function(R,w){return R.__proto__=w,R},p(s,u)}function m(s,u){for(var c=0;c<u.length;c++){var R=u[c];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(s,R.key,R)}}function h(s,u,c){return u&&m(s.prototype,u),c&&m(s,c),s}var r;(function(s){s.AUDIO="audio",s.VIDEO="video",s.AUDIOVIDEO="audiovideo"})(r||(r={}));var n=function(){function s(c){var R;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(R={},R[r.AUDIO]=null,R[r.VIDEO]=null,R[r.AUDIOVIDEO]=null,R),this.baseurl=c}var u=s.prototype;return u.setByteRange=function(R,w){var C=R.split("@",2),D=[];C.length===1?D[0]=w?w.byteRangeEndOffset:0:D[0]=parseInt(C[1]),D[1]=parseInt(C[0])+D[0],this._byteRange=D},h(s,[{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(L.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(R){this._url=R}}]),s}(),a=function(s){x(u,s);function u(R,w){var C;return C=s.call(this,w)||this,C._decryptdata=null,C.rawProgramDateTime=null,C.programDateTime=null,C.tagList=[],C.duration=0,C.sn=0,C.levelkey=void 0,C.type=void 0,C.loader=null,C.level=-1,C.cc=0,C.startPTS=void 0,C.endPTS=void 0,C.appendedPTS=void 0,C.startDTS=void 0,C.endDTS=void 0,C.start=0,C.deltaPTS=void 0,C.maxStartPTS=void 0,C.minEndPTS=void 0,C.stats=new I.LoadStats,C.urlId=0,C.data=void 0,C.bitrateTest=!1,C.title=null,C.initSegment=null,C.type=R,C}var c=u.prototype;return c.createInitializationVector=function(w){for(var C=new Uint8Array(16),D=12;D<16;D++)C[D]=w>>8*(15-D)&255;return C},c.setDecryptDataFromLevelKey=function(w,C){var D=w;return(w==null?void 0:w.method)==="AES-128"&&w.uri&&!w.iv&&(D=O.LevelKey.fromURI(w.uri),D.method=w.method,D.iv=this.createInitializationVector(C),D.keyFormat="identity"),D},c.setElementaryStreamInfo=function(w,C,D,S,b,_){_===void 0&&(_=!1);var f=this.elementaryStreams,d=f[w];if(!d){f[w]={startPTS:C,endPTS:D,startDTS:S,endDTS:b,partial:_};return}d.startPTS=Math.min(d.startPTS,C),d.endPTS=Math.max(d.endPTS,D),d.startDTS=Math.min(d.startDTS,S),d.endDTS=Math.max(d.endDTS,b)},c.clearElementaryStreamInfo=function(){var w=this.elementaryStreams;w[r.AUDIO]=null,w[r.VIDEO]=null,w[r.AUDIOVIDEO]=null},h(u,[{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&&H.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)}}]),u}(n),l=function(s){x(u,s);function u(c,R,w,C,D){var S;S=s.call(this,w)||this,S.fragOffset=0,S.duration=0,S.gap=!1,S.independent=!1,S.relurl=void 0,S.fragment=void 0,S.index=void 0,S.stats=new I.LoadStats,S.duration=c.decimalFloatingPoint("DURATION"),S.gap=c.bool("GAP"),S.independent=c.bool("INDEPENDENT"),S.relurl=c.enumeratedString("URI"),S.fragment=R,S.index=C;var b=c.enumeratedString("BYTERANGE");return b&&S.setByteRange(b,D),D&&(S.fragOffset=D.fragOffset+D.duration),S}return h(u,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var R=this.elementaryStreams;return!!(R.audio||R.video||R.audiovideo)}}]),u}(n)},"./src/loader/key-loader.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"default",function(){return H});var G=j("./src/events.ts"),L=j("./src/errors.ts"),P=j("./src/utils/logger.ts"),H=function(){function O(x){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=x,this._registerListeners()}var I=O.prototype;return I._registerListeners=function(){this.hls.on(G.Events.KEY_LOADING,this.onKeyLoading,this)},I._unregisterListeners=function(){this.hls.off(G.Events.KEY_LOADING,this.onKeyLoading)},I.destroy=function(){this._unregisterListeners();for(var p in this.loaders){var m=this.loaders[p];m&&m.destroy()}this.loaders={}},I.onKeyLoading=function(p,m){var h=m.frag,r=h.type,n=this.loaders[r];if(!h.decryptdata){P.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var a=h.decryptdata.uri;if(a!==this.decrypturl||this.decryptkey===null){var l=this.hls.config;if(n&&(P.logger.warn("abort previous key loader for type:"+r),n.abort()),!a){P.logger.warn("key uri is falsy");return}var s=l.loader,u=h.loader=this.loaders[r]=new s(l);this.decrypturl=a,this.decryptkey=null;var c={url:a,frag:h,responseType:"arraybuffer"},R={timeout:l.fragLoadingTimeOut,maxRetry:0,retryDelay:l.fragLoadingRetryDelay,maxRetryDelay:l.fragLoadingMaxRetryTimeout,highWaterMark:0},w={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};u.load(c,R,w)}else this.decryptkey&&(h.decryptdata.key=this.decryptkey,this.hls.trigger(G.Events.KEY_LOADED,{frag:h}))},I.loadsuccess=function(p,m,h){var r=h.frag;if(!r.decryptdata){P.logger.error("after key load, decryptdata unset");return}this.decryptkey=r.decryptdata.key=new Uint8Array(p.data),r.loader=null,delete this.loaders[r.type],this.hls.trigger(G.Events.KEY_LOADED,{frag:r})},I.loaderror=function(p,m){var h=m.frag,r=h.loader;r&&r.abort(),delete this.loaders[h.type],this.hls.trigger(G.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:h,response:p})},I.loadtimeout=function(p,m){var h=m.frag,r=h.loader;r&&r.abort(),delete this.loaders[h.type],this.hls.trigger(G.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:h})},O}()},"./src/loader/level-details.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"LevelDetails",function(){return O});var G=j("./src/polyfills/number.ts");function L(I,x){for(var p=0;p<x.length;p++){var m=x[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(I,m.key,m)}}function P(I,x,p){return x&&L(I.prototype,x),p&&L(I,p),I}var H=10,O=function(){function I(p){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=p}var x=I.prototype;return x.reloaded=function(m){if(!m){this.advanced=!0,this.updated=!0;return}var h=this.lastPartSn-m.lastPartSn,r=this.lastPartIndex-m.lastPartIndex;this.updated=this.endSN!==m.endSN||!!r||!!h,this.advanced=this.endSN>m.endSN||h>0||h===0&&r>0,this.updated||this.advanced?this.misses=Math.floor(m.misses*.6):this.misses=m.misses+1,this.availabilityDelay=m.availabilityDelay},P(I,[{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||H}},{key:"drift",get:function(){var m=this.driftEndTime-this.driftStartTime;if(m>0){var h=this.driftEnd-this.driftStart;return h*1e3/m}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var m;return(m=this.fragments)!==null&&m!==void 0&&m.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 m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var m;return(m=this.partList)!==null&&m!==void 0&&m.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),I}()},"./src/loader/level-key.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"LevelKey",function(){return O});var G=j("./node_modules/url-toolkit/src/url-toolkit.js"),L=j.n(G);function P(I,x){for(var p=0;p<x.length;p++){var m=x[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(I,m.key,m)}}function H(I,x,p){return x&&P(I.prototype,x),p&&P(I,p),I}var O=function(){I.fromURL=function(p,m){return new I(p,m)},I.fromURI=function(p){return new I(p)};function I(x,p){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,p?this._uri=Object(G.buildAbsoluteURL)(x,p,{alwaysNormalize:!0}):this._uri=x}return H(I,[{key:"uri",get:function(){return this._uri}}]),I}()},"./src/loader/load-stats.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"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(re,Y,j){"use strict";j.r(Y),j.d(Y,"default",function(){return u});var G=j("./src/polyfills/number.ts"),L=j("./node_modules/url-toolkit/src/url-toolkit.js"),P=j.n(L),H=j("./src/loader/fragment.ts"),O=j("./src/loader/level-details.ts"),I=j("./src/loader/level-key.ts"),x=j("./src/utils/attr-list.ts"),p=j("./src/utils/logger.ts"),m=j("./src/utils/codecs.ts"),h=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,r=/#EXT-X-MEDIA:(.*)/g,n=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),a=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("|")),l=/\.(mp4|m4s|m4v|m4a)$/i;function s(D){var S,b;return l.test((S=(b=L.parseURL(D))===null||b===void 0?void 0:b.path)!=null?S:"")}var u=function(){function D(){}return D.findGroup=function(b,_){for(var f=0;f<b.length;f++){var d=b[f];if(d.id===_)return d}},D.convertAVC1ToAVCOTI=function(b){var _=b.split(".");if(_.length>2){var f=_.shift()+".";return f+=parseInt(_.shift()).toString(16),f+=("000"+parseInt(_.shift()).toString(16)).substr(-4),f}return b},D.resolve=function(b,_){return L.buildAbsoluteURL(_,b,{alwaysNormalize:!0})},D.parseMasterPlaylist=function(b,_){var f=[],d={},g=!1;h.lastIndex=0;for(var E;(E=h.exec(b))!=null;)if(E[1]){var T=new x.AttrList(E[1]),F={attrs:T,bitrate:T.decimalInteger("AVERAGE-BANDWIDTH")||T.decimalInteger("BANDWIDTH"),name:T.NAME,url:D.resolve(E[2],_)},U=T.decimalResolution("RESOLUTION");U&&(F.width=U.width,F.height=U.height),c((T.CODECS||"").split(/[ ,]+/).filter(function(z){return z}),F),F.videoCodec&&F.videoCodec.indexOf("avc1")!==-1&&(F.videoCodec=D.convertAVC1ToAVCOTI(F.videoCodec)),f.push(F)}else if(E[3]){var K=new x.AttrList(E[3]);K["DATA-ID"]&&(g=!0,d[K["DATA-ID"]]=K)}return{levels:f,sessionData:g?d:null}},D.parseMasterPlaylistMedia=function(b,_,f,d){d===void 0&&(d=[]);var g,E=[],T=0;for(r.lastIndex=0;(g=r.exec(b))!==null;){var F=new x.AttrList(g[1]);if(F.TYPE===f){var U={attrs:F,bitrate:0,id:T++,groupId:F["GROUP-ID"],instreamId:F["INSTREAM-ID"],name:F.NAME||F.LANGUAGE||"",type:f,default:F.bool("DEFAULT"),autoselect:F.bool("AUTOSELECT"),forced:F.bool("FORCED"),lang:F.LANGUAGE,url:F.URI?D.resolve(F.URI,_):""};if(d.length){var K=D.findGroup(d,U.groupId)||d[0];R(U,K,"audioCodec"),R(U,K,"textCodec")}E.push(U)}}return E},D.parseLevelPlaylist=function(b,_,f,d,g){var E=new O.LevelDetails(_),T=E.fragments,F=null,U=0,K=0,z=0,M=0,y=null,W=new H.Fragment(d,_),X,te,pe,Ie=-1,Ee=!1;for(n.lastIndex=0,E.m3u8=b;(X=n.exec(b))!==null;){Ee&&(Ee=!1,W=new H.Fragment(d,_),W.start=z,W.sn=U,W.cc=M,W.level=f,F&&(W.initSegment=F,W.rawProgramDateTime=F.rawProgramDateTime));var Te=X[1];if(Te){W.duration=parseFloat(Te);var We=(" "+X[2]).slice(1);W.title=We||null,W.tagList.push(We?["INF",Te,We]:["INF",Te])}else if(X[3])Object(G.isFiniteNumber)(W.duration)&&(W.start=z,pe&&(W.levelkey=pe),W.sn=U,W.level=f,W.cc=M,W.urlId=g,T.push(W),W.relurl=(" "+X[3]).slice(1),C(W,y),y=W,z+=W.duration,U++,K=0,Ee=!0);else if(X[4]){var He=(" "+X[4]).slice(1);y?W.setByteRange(He,y):W.setByteRange(He)}else if(X[5])W.rawProgramDateTime=(" "+X[5]).slice(1),W.tagList.push(["PROGRAM-DATE-TIME",W.rawProgramDateTime]),Ie===-1&&(Ie=T.length);else{if(X=X[0].match(a),!X){p.logger.warn("No matches on slow regex match for level playlist!");continue}for(te=1;te<X.length&&!(typeof X[te]!="undefined");te++);var Ce=(" "+X[te]).slice(1),ue=(" "+X[te+1]).slice(1),se=X[te+2]?(" "+X[te+2]).slice(1):"";switch(Ce){case"PLAYLIST-TYPE":E.type=ue.toUpperCase();break;case"MEDIA-SEQUENCE":U=E.startSN=parseInt(ue);break;case"SKIP":{var we=new x.AttrList(ue),ge=we.decimalInteger("SKIPPED-SEGMENTS");if(Object(G.isFiniteNumber)(ge)){E.skippedSegments=ge;for(var Ke=ge;Ke--;)T.unshift(null);U+=ge}var st=we.enumeratedString("RECENTLY-REMOVED-DATERANGES");st&&(E.recentlyRemovedDateranges=st.split(" "));break}case"TARGETDURATION":E.targetduration=parseFloat(ue);break;case"VERSION":E.version=parseInt(ue);break;case"EXTM3U":break;case"ENDLIST":E.live=!1;break;case"#":(ue||se)&&W.tagList.push(se?[ue,se]:[ue]);break;case"DIS":M++;case"GAP":W.tagList.push([Ce]);break;case"BITRATE":W.tagList.push([Ce,ue]);break;case"DISCONTINUITY-SEQ":M=parseInt(ue);break;case"KEY":{var ne,$=new x.AttrList(ue),J=$.enumeratedString("METHOD"),me=$.URI,xe=$.hexadecimalInteger("IV"),ke=$.enumeratedString("KEYFORMATVERSIONS"),$e=$.enumeratedString("KEYID"),Pt=(ne=$.enumeratedString("KEYFORMAT"))!=null?ne:"identity",Xt=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Xt.indexOf(Pt)>-1){p.logger.warn("Keyformat "+Pt+" is not supported from the manifest");continue}else if(Pt!=="identity")continue;J&&(pe=I.LevelKey.fromURL(_,me),me&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(J)>=0&&(pe.method=J,pe.keyFormat=Pt,$e&&(pe.keyID=$e),ke&&(pe.keyFormatVersions=ke),pe.iv=xe));break}case"START":{var Bt=new x.AttrList(ue),lt=Bt.decimalFloatingPoint("TIME-OFFSET");Object(G.isFiniteNumber)(lt)&&(E.startTimeOffset=lt);break}case"MAP":{var jt=new x.AttrList(ue);W.relurl=jt.URI,jt.BYTERANGE&&W.setByteRange(jt.BYTERANGE),W.level=f,W.sn="initSegment",pe&&(W.levelkey=pe),W.initSegment=null,F=W,Ee=!0;break}case"SERVER-CONTROL":{var pn=new x.AttrList(ue);E.canBlockReload=pn.bool("CAN-BLOCK-RELOAD"),E.canSkipUntil=pn.optionalFloat("CAN-SKIP-UNTIL",0),E.canSkipDateRanges=E.canSkipUntil>0&&pn.bool("CAN-SKIP-DATERANGES"),E.partHoldBack=pn.optionalFloat("PART-HOLD-BACK",0),E.holdBack=pn.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var it=new x.AttrList(ue);E.partTarget=it.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ze=E.partList;Ze||(Ze=E.partList=[]);var bt=K>0?Ze[Ze.length-1]:void 0,Mt=K++,ct=new H.Part(new x.AttrList(ue),W,_,Mt,bt);Ze.push(ct),W.duration+=ct.duration;break}case"PRELOAD-HINT":{var wt=new x.AttrList(ue);E.preloadHint=wt;break}case"RENDITION-REPORT":{var Ve=new x.AttrList(ue);E.renditionReports=E.renditionReports||[],E.renditionReports.push(Ve);break}default:p.logger.warn("line parsed but not handled: "+X);break}}}y&&!y.relurl?(T.pop(),z-=y.duration,E.partList&&(E.fragmentHint=y)):E.partList&&(C(W,y),W.cc=M,E.fragmentHint=W);var Se=T.length,Pe=T[0],ce=T[Se-1];if(z+=E.skippedSegments*E.targetduration,z>0&&Se&&ce){E.averagetargetduration=z/Se;var de=ce.sn;E.endSN=de!=="initSegment"?de:0,Pe&&(E.startCC=Pe.cc,Pe.initSegment||E.fragments.every(function(be){return be.relurl&&s(be.relurl)})&&(p.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),W=new H.Fragment(d,_),W.relurl=ce.relurl,W.level=f,W.sn="initSegment",Pe.initSegment=W,E.needSidxRanges=!0))}else E.endSN=0,E.startCC=0;return E.fragmentHint&&(z+=E.fragmentHint.duration),E.totalduration=z,E.endCC=M,Ie>0&&w(T,Ie),E},D}();function c(D,S){["video","audio","text"].forEach(function(b){var _=D.filter(function(d){return Object(m.isCodecType)(d,b)});if(_.length){var f=_.filter(function(d){return d.lastIndexOf("avc1",0)===0||d.lastIndexOf("mp4a",0)===0});S[b+"Codec"]=f.length>0?f[0]:_[0],D=D.filter(function(d){return _.indexOf(d)===-1})}}),S.unknownCodecs=D}function R(D,S,b){var _=S[b];_&&(D[b]=_)}function w(D,S){for(var b=D[S],_=S;_--;){var f=D[_];if(!f)return;f.programDateTime=b.programDateTime-f.duration*1e3,b=f}}function C(D,S){D.rawProgramDateTime?D.programDateTime=Date.parse(D.rawProgramDateTime):S!=null&&S.programDateTime&&(D.programDateTime=S.endProgramDateTime),Object(G.isFiniteNumber)(D.programDateTime)||(D.programDateTime=null,D.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(re,Y,j){"use strict";j.r(Y);var G=j("./src/polyfills/number.ts"),L=j("./src/events.ts"),P=j("./src/errors.ts"),H=j("./src/utils/logger.ts"),O=j("./src/utils/mp4-tools.ts"),I=j("./src/loader/m3u8-parser.ts"),x=j("./src/types/loader.ts"),p=j("./src/utils/attr-list.ts");function m(n){var a=n.type;switch(a){case x.PlaylistContextType.AUDIO_TRACK:return x.PlaylistLevelType.AUDIO;case x.PlaylistContextType.SUBTITLE_TRACK:return x.PlaylistLevelType.SUBTITLE;default:return x.PlaylistLevelType.MAIN}}function h(n,a){var l=n.url;return(l===void 0||l.indexOf("data:")===0)&&(l=a.url),l}var r=function(){function n(l){this.hls=void 0,this.loaders=Object.create(null),this.hls=l,this.registerListeners()}var a=n.prototype;return a.registerListeners=function(){var s=this.hls;s.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(L.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(L.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),s.on(L.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},a.unregisterListeners=function(){var s=this.hls;s.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(L.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(L.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),s.off(L.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},a.createInternalLoader=function(s){var u=this.hls.config,c=u.pLoader,R=u.loader,w=c||R,C=new w(u);return s.loader=C,this.loaders[s.type]=C,C},a.getInternalLoader=function(s){return this.loaders[s.type]},a.resetInternalLoader=function(s){this.loaders[s]&&delete this.loaders[s]},a.destroyInternalLoaders=function(){for(var s in this.loaders){var u=this.loaders[s];u&&u.destroy(),this.resetInternalLoader(s)}},a.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},a.onManifestLoading=function(s,u){var c=u.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:x.PlaylistContextType.MANIFEST,url:c,deliveryDirectives:null})},a.onLevelLoading=function(s,u){var c=u.id,R=u.level,w=u.url,C=u.deliveryDirectives;this.load({id:c,groupId:null,level:R,responseType:"text",type:x.PlaylistContextType.LEVEL,url:w,deliveryDirectives:C})},a.onAudioTrackLoading=function(s,u){var c=u.id,R=u.groupId,w=u.url,C=u.deliveryDirectives;this.load({id:c,groupId:R,level:null,responseType:"text",type:x.PlaylistContextType.AUDIO_TRACK,url:w,deliveryDirectives:C})},a.onSubtitleTrackLoading=function(s,u){var c=u.id,R=u.groupId,w=u.url,C=u.deliveryDirectives;this.load({id:c,groupId:R,level:null,responseType:"text",type:x.PlaylistContextType.SUBTITLE_TRACK,url:w,deliveryDirectives:C})},a.load=function(s){var u,c=this.hls.config,R=this.getInternalLoader(s);if(R){var w=R.context;if(w&&w.url===s.url){H.logger.trace("[playlist-loader]: playlist request ongoing");return}H.logger.log("[playlist-loader]: aborting previous loader for type: "+s.type),R.abort()}var C,D,S,b;switch(s.type){case x.PlaylistContextType.MANIFEST:C=c.manifestLoadingMaxRetry,D=c.manifestLoadingTimeOut,S=c.manifestLoadingRetryDelay,b=c.manifestLoadingMaxRetryTimeout;break;case x.PlaylistContextType.LEVEL:case x.PlaylistContextType.AUDIO_TRACK:case x.PlaylistContextType.SUBTITLE_TRACK:C=0,D=c.levelLoadingTimeOut;break;default:C=c.levelLoadingMaxRetry,D=c.levelLoadingTimeOut,S=c.levelLoadingRetryDelay,b=c.levelLoadingMaxRetryTimeout;break}if(R=this.createInternalLoader(s),(u=s.deliveryDirectives)!==null&&u!==void 0&&u.part){var _;if(s.type===x.PlaylistContextType.LEVEL&&s.level!==null?_=this.hls.levels[s.level].details:s.type===x.PlaylistContextType.AUDIO_TRACK&&s.id!==null?_=this.hls.audioTracks[s.id].details:s.type===x.PlaylistContextType.SUBTITLE_TRACK&&s.id!==null&&(_=this.hls.subtitleTracks[s.id].details),_){var f=_.partTarget,d=_.targetduration;f&&d&&(D=Math.min(Math.max(f*3,d*.8)*1e3,D))}}var g={timeout:D,maxRetry:C,retryDelay:S,maxRetryDelay:b,highWaterMark:0},E={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};R.load(s,g,E)},a.loadsuccess=function(s,u,c,R){if(R===void 0&&(R=null),c.isSidxRequest){this.handleSidxRequest(s,c),this.handlePlaylistLoaded(s,u,c,R);return}this.resetInternalLoader(c.type);var w=s.data;if(w.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(s,c,"no EXTM3U delimiter",R);return}u.parsing.start=performance.now(),w.indexOf("#EXTINF:")>0||w.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(s,u,c,R):this.handleMasterPlaylist(s,u,c,R)},a.loaderror=function(s,u,c){c===void 0&&(c=null),this.handleNetworkError(u,c,!1,s)},a.loadtimeout=function(s,u,c){c===void 0&&(c=null),this.handleNetworkError(u,c,!0)},a.handleMasterPlaylist=function(s,u,c,R){var w=this.hls,C=s.data,D=h(s,c),S=I.default.parseMasterPlaylist(C,D),b=S.levels,_=S.sessionData;if(!b.length){this.handleManifestParsingError(s,c,"no level found in manifest",R);return}var f=b.map(function(U){return{id:U.attrs.AUDIO,audioCodec:U.audioCodec}}),d=b.map(function(U){return{id:U.attrs.SUBTITLES,textCodec:U.textCodec}}),g=I.default.parseMasterPlaylistMedia(C,D,"AUDIO",f),E=I.default.parseMasterPlaylistMedia(C,D,"SUBTITLES",d),T=I.default.parseMasterPlaylistMedia(C,D,"CLOSED-CAPTIONS");if(g.length){var F=g.some(function(U){return!U.url});!F&&b[0].audioCodec&&!b[0].attrs.AUDIO&&(H.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),g.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new p.AttrList({}),bitrate:0,url:""}))}w.trigger(L.Events.MANIFEST_LOADED,{levels:b,audioTracks:g,subtitles:E,captions:T,url:D,stats:u,networkDetails:R,sessionData:_})},a.handleTrackOrLevelPlaylist=function(s,u,c,R){var w=this.hls,C=c.id,D=c.level,S=c.type,b=h(s,c),_=Object(G.isFiniteNumber)(C)?C:0,f=Object(G.isFiniteNumber)(D)?D:_,d=m(c),g=I.default.parseLevelPlaylist(s.data,b,f,d,_);if(!g.fragments.length){w.trigger(L.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:b,reason:"no fragments found in level",level:typeof c.level=="number"?c.level:void 0});return}if(S===x.PlaylistContextType.MANIFEST){var E={attrs:new p.AttrList({}),bitrate:0,details:g,name:"",url:b};w.trigger(L.Events.MANIFEST_LOADED,{levels:[E],audioTracks:[],url:b,stats:u,networkDetails:R,sessionData:null})}if(u.parsing.end=performance.now(),g.needSidxRanges){var T,F=(T=g.fragments[0].initSegment)===null||T===void 0?void 0:T.url;this.load({url:F,isSidxRequest:!0,type:S,level:D,levelDetails:g,id:C,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}c.levelDetails=g,this.handlePlaylistLoaded(s,u,c,R)},a.handleSidxRequest=function(s,u){var c=Object(O.parseSegmentIndex)(new Uint8Array(s.data));if(!c)return;var R=c.references,w=u.levelDetails;R.forEach(function(C,D){var S=C.info,b=w.fragments[D];b.byteRange.length===0&&b.setByteRange(String(1+S.end-S.start)+"@"+String(S.start)),b.initSegment&&b.initSegment.setByteRange(String(c.moovEndOffset)+"@0")})},a.handleManifestParsingError=function(s,u,c,R){this.hls.trigger(L.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:u.type===x.PlaylistContextType.MANIFEST,url:s.url,reason:c,response:s,context:u,networkDetails:R})},a.handleNetworkError=function(s,u,c,R){c===void 0&&(c=!1),H.logger.warn("[playlist-loader]: A network "+(c?"timeout":"error")+" occurred while loading "+s.type+" level: "+s.level+" id: "+s.id+' group-id: "'+s.groupId+'"');var w=P.ErrorDetails.UNKNOWN,C=!1,D=this.getInternalLoader(s);switch(s.type){case x.PlaylistContextType.MANIFEST:w=c?P.ErrorDetails.MANIFEST_LOAD_TIMEOUT:P.ErrorDetails.MANIFEST_LOAD_ERROR,C=!0;break;case x.PlaylistContextType.LEVEL:w=c?P.ErrorDetails.LEVEL_LOAD_TIMEOUT:P.ErrorDetails.LEVEL_LOAD_ERROR,C=!1;break;case x.PlaylistContextType.AUDIO_TRACK:w=c?P.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:P.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,C=!1;break;case x.PlaylistContextType.SUBTITLE_TRACK:w=c?P.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:P.ErrorDetails.SUBTITLE_LOAD_ERROR,C=!1;break}D&&this.resetInternalLoader(s.type);var S={type:P.ErrorTypes.NETWORK_ERROR,details:w,fatal:C,url:s.url,loader:D,context:s,networkDetails:u};R&&(S.response=R),this.hls.trigger(L.Events.ERROR,S)},a.handlePlaylistLoaded=function(s,u,c,R){var w=c.type,C=c.level,D=c.id,S=c.groupId,b=c.loader,_=c.levelDetails,f=c.deliveryDirectives;if(!(_!=null&&_.targetduration)){this.handleManifestParsingError(s,c,"invalid target duration",R);return}if(!b)return;_.live&&(b.getCacheAge&&(_.ageHeader=b.getCacheAge()||0),(!b.getCacheAge||isNaN(_.ageHeader))&&(_.ageHeader=0));switch(w){case x.PlaylistContextType.MANIFEST:case x.PlaylistContextType.LEVEL:this.hls.trigger(L.Events.LEVEL_LOADED,{details:_,level:C||0,id:D||0,stats:u,networkDetails:R,deliveryDirectives:f});break;case x.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(L.Events.AUDIO_TRACK_LOADED,{details:_,id:D||0,groupId:S||"",stats:u,networkDetails:R,deliveryDirectives:f});break;case x.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(L.Events.SUBTITLE_TRACK_LOADED,{details:_,id:D||0,groupId:S||"",stats:u,networkDetails:R,deliveryDirectives:f});break}},n}();Y.default=r},"./src/polyfills/number.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"isFiniteNumber",function(){return G}),j.d(Y,"MAX_SAFE_INTEGER",function(){return L});var G=Number.isFinite||function(P){return typeof P=="number"&&isFinite(P)},L=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(re,Y,j){"use strict";j.r(Y);var G=function(){function L(){}return L.getSilentFrame=function(H,O){switch(H){case"mp4a.40.2":if(O===1)return new Uint8Array([0,200,0,128,35,128]);if(O===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(O===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(O===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(O===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(O===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(O===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(O===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(O===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},L}();Y.default=G},"./src/remux/mp4-generator.ts":function(re,Y,j){"use strict";j.r(Y);var G=Math.pow(2,32)-1,L=function(){function P(){}return P.init=function(){P.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 O;for(O in P.types)P.types.hasOwnProperty(O)&&(P.types[O]=[O.charCodeAt(0),O.charCodeAt(1),O.charCodeAt(2),O.charCodeAt(3)]);var I=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]),x=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]);P.HDLR_TYPES={video:I,audio:x};var p=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),m=new Uint8Array([0,0,0,0,0,0,0,0]);P.STTS=P.STSC=P.STCO=m,P.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),P.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),P.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),P.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var h=new Uint8Array([105,115,111,109]),r=new Uint8Array([97,118,99,49]),n=new Uint8Array([0,0,0,1]);P.FTYP=P.box(P.types.ftyp,h,n,h,r),P.DINF=P.box(P.types.dinf,P.box(P.types.dref,p))},P.box=function(O){for(var I=8,x=arguments.length,p=new Array(x>1?x-1:0),m=1;m<x;m++)p[m-1]=arguments[m];for(var h=p.length,r=h;h--;)I+=p[h].byteLength;var n=new Uint8Array(I);for(n[0]=I>>24&255,n[1]=I>>16&255,n[2]=I>>8&255,n[3]=I&255,n.set(O,4),h=0,I=8;h<r;h++)n.set(p[h],I),I+=p[h].byteLength;return n},P.hdlr=function(O){return P.box(P.types.hdlr,P.HDLR_TYPES[O])},P.mdat=function(O){return P.box(P.types.mdat,O)},P.mdhd=function(O,I){I*=O;var x=Math.floor(I/(G+1)),p=Math.floor(I%(G+1));return P.box(P.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,O>>24&255,O>>16&255,O>>8&255,O&255,x>>24,x>>16&255,x>>8&255,x&255,p>>24,p>>16&255,p>>8&255,p&255,85,196,0,0]))},P.mdia=function(O){return P.box(P.types.mdia,P.mdhd(O.timescale,O.duration),P.hdlr(O.type),P.minf(O))},P.mfhd=function(O){return P.box(P.types.mfhd,new Uint8Array([0,0,0,0,O>>24,O>>16&255,O>>8&255,O&255]))},P.minf=function(O){return O.type==="audio"?P.box(P.types.minf,P.box(P.types.smhd,P.SMHD),P.DINF,P.stbl(O)):P.box(P.types.minf,P.box(P.types.vmhd,P.VMHD),P.DINF,P.stbl(O))},P.moof=function(O,I,x){return P.box(P.types.moof,P.mfhd(O),P.traf(x,I))},P.moov=function(O){for(var I=O.length,x=[];I--;)x[I]=P.trak(O[I]);return P.box.apply(null,[P.types.moov,P.mvhd(O[0].timescale,O[0].duration)].concat(x).concat(P.mvex(O)))},P.mvex=function(O){for(var I=O.length,x=[];I--;)x[I]=P.trex(O[I]);return P.box.apply(null,[P.types.mvex].concat(x))},P.mvhd=function(O,I){I*=O;var x=Math.floor(I/(G+1)),p=Math.floor(I%(G+1)),m=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,O>>24&255,O>>16&255,O>>8&255,O&255,x>>24,x>>16&255,x>>8&255,x&255,p>>24,p>>16&255,p>>8&255,p&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 P.box(P.types.mvhd,m)},P.sdtp=function(O){var I=O.samples||[],x=new Uint8Array(4+I.length),p,m;for(p=0;p<I.length;p++)m=I[p].flags,x[p+4]=m.dependsOn<<4|m.isDependedOn<<2|m.hasRedundancy;return P.box(P.types.sdtp,x)},P.stbl=function(O){return P.box(P.types.stbl,P.stsd(O),P.box(P.types.stts,P.STTS),P.box(P.types.stsc,P.STSC),P.box(P.types.stsz,P.STSZ),P.box(P.types.stco,P.STCO))},P.avc1=function(O){var I=[],x=[],p,m,h;for(p=0;p<O.sps.length;p++)m=O.sps[p],h=m.byteLength,I.push(h>>>8&255),I.push(h&255),I=I.concat(Array.prototype.slice.call(m));for(p=0;p<O.pps.length;p++)m=O.pps[p],h=m.byteLength,x.push(h>>>8&255),x.push(h&255),x=x.concat(Array.prototype.slice.call(m));var r=P.box(P.types.avcC,new Uint8Array([1,I[3],I[4],I[5],252|3,224|O.sps.length].concat(I).concat([O.pps.length]).concat(x))),n=O.width,a=O.height,l=O.pixelRatio[0],s=O.pixelRatio[1];return P.box(P.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,n>>8&255,n&255,a>>8&255,a&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),r,P.box(P.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),P.box(P.types.pasp,new Uint8Array([l>>24,l>>16&255,l>>8&255,l&255,s>>24,s>>16&255,s>>8&255,s&255])))},P.esds=function(O){var I=O.config.length;return new Uint8Array([0,0,0,0,3,23+I,0,1,0,4,15+I,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([I]).concat(O.config).concat([6,1,2]))},P.mp4a=function(O){var I=O.samplerate;return P.box(P.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,O.channelCount,0,16,0,0,0,0,I>>8&255,I&255,0,0]),P.box(P.types.esds,P.esds(O)))},P.mp3=function(O){var I=O.samplerate;return P.box(P.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,O.channelCount,0,16,0,0,0,0,I>>8&255,I&255,0,0]))},P.stsd=function(O){return O.type==="audio"?!O.isAAC&&O.codec==="mp3"?P.box(P.types.stsd,P.STSD,P.mp3(O)):P.box(P.types.stsd,P.STSD,P.mp4a(O)):P.box(P.types.stsd,P.STSD,P.avc1(O))},P.tkhd=function(O){var I=O.id,x=O.duration*O.timescale,p=O.width,m=O.height,h=Math.floor(x/(G+1)),r=Math.floor(x%(G+1));return P.box(P.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,I>>24&255,I>>16&255,I>>8&255,I&255,0,0,0,0,h>>24,h>>16&255,h>>8&255,h&255,r>>24,r>>16&255,r>>8&255,r&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,p>>8&255,p&255,0,0,m>>8&255,m&255,0,0]))},P.traf=function(O,I){var x=P.sdtp(O),p=O.id,m=Math.floor(I/(G+1)),h=Math.floor(I%(G+1));return P.box(P.types.traf,P.box(P.types.tfhd,new Uint8Array([0,0,0,0,p>>24,p>>16&255,p>>8&255,p&255])),P.box(P.types.tfdt,new Uint8Array([1,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,h>>24,h>>16&255,h>>8&255,h&255])),P.trun(O,x.length+16+20+8+16+8+8),x)},P.trak=function(O){return O.duration=O.duration||4294967295,P.box(P.types.trak,P.tkhd(O),P.mdia(O))},P.trex=function(O){var I=O.id;return P.box(P.types.trex,new Uint8Array([0,0,0,0,I>>24,I>>16&255,I>>8&255,I&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},P.trun=function(O,I){var x=O.samples||[],p=x.length,m=12+16*p,h=new Uint8Array(m),r,n,a,l,s,u;for(I+=8+m,h.set([0,0,15,1,p>>>24&255,p>>>16&255,p>>>8&255,p&255,I>>>24&255,I>>>16&255,I>>>8&255,I&255],0),r=0;r<p;r++)n=x[r],a=n.duration,l=n.size,s=n.flags,u=n.cts,h.set([a>>>24&255,a>>>16&255,a>>>8&255,a&255,l>>>24&255,l>>>16&255,l>>>8&255,l&255,s.isLeading<<2|s.dependsOn,s.isDependedOn<<6|s.hasRedundancy<<4|s.paddingValue<<1|s.isNonSync,s.degradPrio&240<<8,s.degradPrio&15,u>>>24&255,u>>>16&255,u>>>8&255,u&255],12+16*r);return P.box(P.types.trun,h)},P.initSegment=function(O){P.types||P.init();var I=P.moov(O),x=new Uint8Array(P.FTYP.byteLength+I.byteLength);return x.set(P.FTYP),x.set(I,P.FTYP.byteLength),x},P}();L.types=void 0,L.HDLR_TYPES=void 0,L.STTS=void 0,L.STSC=void 0,L.STCO=void 0,L.STSZ=void 0,L.VMHD=void 0,L.SMHD=void 0,L.STSD=void 0,L.FTYP=void 0,L.DINF=void 0,Y.default=L},"./src/remux/mp4-remuxer.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"default",function(){return u}),j.d(Y,"normalizePts",function(){return c});var G=j("./src/polyfills/number.ts"),L=j("./src/remux/aac-helper.ts"),P=j("./src/remux/mp4-generator.ts"),H=j("./src/events.ts"),O=j("./src/errors.ts"),I=j("./src/utils/logger.ts"),x=j("./src/types/loader.ts"),p=j("./src/utils/timescale-conversion.ts");function m(){return m=Object.assign||function(D){for(var S=1;S<arguments.length;S++){var b=arguments[S];for(var _ in b)Object.prototype.hasOwnProperty.call(b,_)&&(D[_]=b[_])}return D},m.apply(this,arguments)}var h=10*1e3,r=1024,n=1152,a=null,l=null,s=!1,u=function(){function D(b,_,f,d){if(d===void 0&&(d=""),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=b,this.config=_,this.typeSupported=f,this.ISGenerated=!1,a===null){var g=navigator.userAgent||"",E=g.match(/Chrome\/(\d+)/i);a=E?parseInt(E[1]):0}if(l===null){var T=navigator.userAgent.match(/Safari\/(\d+)/i);l=T?parseInt(T[1]):0}s=!!a&&a<75||!!l&&l<600}var S=D.prototype;return S.destroy=function(){},S.resetTimeStamp=function(_){I.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=_},S.resetNextTimestamp=function(){I.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},S.resetInitSegment=function(){I.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},S.getVideoStartPts=function(_){var f=!1,d=_.reduce(function(g,E){var T=E.pts-g;return T<-4294967296?(f=!0,c(g,E.pts)):T>0?g:E.pts},_[0].pts);return f&&I.logger.debug("PTS rollover detected"),d},S.remux=function(_,f,d,g,E,T,F,U){var K,z,M,y,W,X,te=E,pe=E,Ie=_.pid>-1,Ee=f.pid>-1,Te=f.samples.length,We=_.samples.length>0,He=Te>1,Ce=(!Ie||We)&&(!Ee||He)||this.ISGenerated||F;if(Ce){this.ISGenerated||(M=this.generateIS(_,f,E));var ue=this.isVideoContiguous,se=-1;if(He&&(se=R(f.samples),!ue&&this.config.forceKeyFrameOnDiscontinuity))if(X=!0,se>0){I.logger.warn("[mp4-remuxer]: Dropped "+se+" out of "+Te+" video samples due to a missing keyframe");var we=this.getVideoStartPts(f.samples);f.samples=f.samples.slice(se),f.dropped+=se,pe+=(f.samples[0].pts-we)/(f.timescale||9e4)}else se===-1&&(I.logger.warn("[mp4-remuxer]: No keyframe found out of "+Te+" video samples"),X=!1);if(this.ISGenerated){if(We&&He){var ge=this.getVideoStartPts(f.samples),Ke=c(_.samples[0].pts,ge)-ge,st=Ke/f.inputTimeScale;te+=Math.max(0,st),pe+=Math.max(0,-st)}if(We){if(_.samplerate||(I.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),M=this.generateIS(_,f,E)),z=this.remuxAudio(_,te,this.isAudioContiguous,T,Ee||He||U===x.PlaylistLevelType.AUDIO?pe:void 0),He){var ne=z?z.endPTS-z.startPTS:0;f.inputTimeScale||(I.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),M=this.generateIS(_,f,E)),K=this.remuxVideo(f,pe,ue,ne)}}else He&&(K=this.remuxVideo(f,pe,ue,0));K&&(K.firstKeyFrame=se,K.independent=se!==-1)}}return this.ISGenerated&&(d.samples.length&&(W=this.remuxID3(d,E)),g.samples.length&&(y=this.remuxText(g,E))),{audio:z,video:K,initSegment:M,independent:X,text:y,id3:W}},S.generateIS=function(_,f,d){var g=_.samples,E=f.samples,T=this.typeSupported,F={},U=!Object(G.isFiniteNumber)(this._initPTS),K="audio/mp4",z,M,y;if(U&&(z=M=Infinity),_.config&&g.length&&(_.timescale=_.samplerate,_.isAAC||(T.mpeg?(K="audio/mpeg",_.codec=""):T.mp3&&(_.codec="mp3")),F.audio={id:"audio",container:K,codec:_.codec,initSegment:!_.isAAC&&T.mpeg?new Uint8Array(0):P.default.initSegment([_]),metadata:{channelCount:_.channelCount}},U&&(y=_.inputTimeScale,z=M=g[0].pts-Math.round(y*d))),f.sps&&f.pps&&E.length&&(f.timescale=f.inputTimeScale,F.video={id:"main",container:"video/mp4",codec:f.codec,initSegment:P.default.initSegment([f]),metadata:{width:f.width,height:f.height}},U)){y=f.inputTimeScale;var W=this.getVideoStartPts(E),X=Math.round(y*d);M=Math.min(M,c(E[0].dts,W)-X),z=Math.min(z,W-X)}if(Object.keys(F).length)return this.ISGenerated=!0,U&&(this._initPTS=z,this._initDTS=M),{tracks:F,initPTS:z,timescale:y}},S.remuxVideo=function(_,f,d,g){var E=_.inputTimeScale,T=_.samples,F=[],U=T.length,K=this._initPTS,z=this.nextAvcDts,M=8,y,W,X,te=Number.POSITIVE_INFINITY,pe=Number.NEGATIVE_INFINITY,Ie=0,Ee=!1;if(!d||z===null){var Te=f*E,We=T[0].pts-c(T[0].dts,T[0].pts);z=Te-We}for(var He=0;He<U;He++){var Ce=T[He];if(Ce.pts=c(Ce.pts-K,z),Ce.dts=c(Ce.dts-K,z),Ce.dts>Ce.pts){var ue=9e4*.2;Ie=Math.max(Math.min(Ie,Ce.pts-Ce.dts),-1*ue)}Ce.dts<T[He>0?He-1:He].dts&&(Ee=!0)}Ee&&T.sort(function(Vt,Tt){var Rt=Vt.dts-Tt.dts,mt=Vt.pts-Tt.pts;return Rt||mt}),W=T[0].dts,X=T[T.length-1].dts;var se=Math.round((X-W)/(U-1));if(Ie<0){if(Ie<se*-2){I.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(p.toMsFromMpegTsClock)(-se,!0)+" ms");for(var we=Ie,ge=0;ge<U;ge++)T[ge].dts=we=Math.max(we,T[ge].pts-se),T[ge].pts=Math.max(we,T[ge].pts)}else{I.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(p.toMsFromMpegTsClock)(Ie,!0)+" ms to overcome this issue");for(var Ke=0;Ke<U;Ke++)T[Ke].dts=T[Ke].dts+Ie}W=T[0].dts}if(d){var st=W-z,ne=st>se,$=st<-1;if(ne||$){ne?I.logger.warn("AVC: "+Object(p.toMsFromMpegTsClock)(st,!0)+" ms ("+st+"dts) hole between fragments detected, filling it"):I.logger.warn("AVC: "+Object(p.toMsFromMpegTsClock)(-st,!0)+" ms ("+st+"dts) overlapping between fragments detected"),W=z;var J=T[0].pts-st;T[0].dts=W,T[0].pts=J,I.logger.log("Video: First PTS/DTS adjusted: "+Object(p.toMsFromMpegTsClock)(J,!0)+"/"+Object(p.toMsFromMpegTsClock)(W,!0)+", delta: "+Object(p.toMsFromMpegTsClock)(st,!0)+" ms")}}s&&(W=Math.max(0,W));for(var me=0,xe=0,ke=0;ke<U;ke++){for(var $e=T[ke],Pt=$e.units,Xt=Pt.length,Bt=0,lt=0;lt<Xt;lt++)Bt+=Pt[lt].data.length;xe+=Bt,me+=Xt,$e.length=Bt,$e.dts=Math.max($e.dts,W),$e.pts=Math.max($e.pts,$e.dts,0),te=Math.min($e.pts,te),pe=Math.max($e.pts,pe)}X=T[U-1].dts;var jt=xe+4*me+8,pn;try{pn=new Uint8Array(jt)}catch(Vt){this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:O.ErrorTypes.MUX_ERROR,details:O.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:jt,reason:"fail allocating video mdat "+jt});return}var it=new DataView(pn.buffer);it.setUint32(0,jt),pn.set(P.default.types.mdat,4);for(var Ze=0;Ze<U;Ze++){for(var bt=T[Ze],Mt=bt.units,ct=0,wt=0,Ve=Mt.length;wt<Ve;wt++){var Se=Mt[wt],Pe=Se.data,ce=Se.data.byteLength;it.setUint32(M,ce),M+=4,pn.set(Pe,M),M+=ce,ct+=4+ce}if(Ze<U-1)y=T[Ze+1].dts-bt.dts;else{var de=this.config,be=bt.dts-T[Ze>0?Ze-1:Ze].dts;if(de.stretchShortVideoTrack&&this.nextAudioPts!==null){var je=Math.floor(de.maxBufferHole*E),ze=(g?te+g*E:this.nextAudioPts)-bt.pts;ze>je?(y=ze-be,y<0&&(y=be),I.logger.log("[mp4-remuxer]: It is approximately "+ze/90+" ms to the next segment; using duration "+y/90+" ms for the last video frame.")):y=be}else y=be}var ut=Math.round(bt.pts-bt.dts);F.push(new w(bt.key,y,ct,ut))}if(F.length&&a&&a<70){var Dt=F[0].flags;Dt.dependsOn=2,Dt.isNonSync=0}console.assert(y!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=z=X+y,this.isVideoContiguous=!0;var rn=P.default.moof(_.sequenceNumber++,W,m({},_,{samples:F})),mn="video",gt={data1:rn,data2:pn,startPTS:te/E,endPTS:(pe+y)/E,startDTS:W/E,endDTS:z/E,type:mn,hasAudio:!1,hasVideo:!0,nb:F.length,dropped:_.dropped};return _.samples=[],_.dropped=0,console.assert(pn.length,"MDAT length must not be zero"),gt},S.remuxAudio=function(_,f,d,g,E){var T=_.inputTimeScale,F=_.samplerate?_.samplerate:T,U=T/F,K=_.isAAC?r:n,z=K*U,M=this._initPTS,y=!_.isAAC&&this.typeSupported.mpeg,W=[],X=_.samples,te=y?0:8,pe=this.nextAudioPts||-1,Ie=f*T;if(this.isAudioContiguous=d=d||X.length&&pe>0&&(g&&Math.abs(Ie-pe)<9e3||Math.abs(c(X[0].pts-M,Ie)-pe)<20*z),X.forEach(function(Pe){Pe.pts=c(Pe.pts-M,Ie)}),!d||pe<0){if(X=X.filter(function(Pe){return Pe.pts>=0}),!X.length)return;E===0?pe=0:g?pe=Math.max(0,Ie):pe=X[0].pts}if(_.isAAC)for(var Ee=E!==void 0,Te=this.config.maxAudioFramesDrift,We=0,He=pe;We<X.length;We++){var Ce=X[We],ue=Ce.pts,se=ue-He,we=Math.abs(1e3*se/T);if(se<=-Te*z&&Ee)We===0&&(I.logger.warn("Audio frame @ "+(ue/T).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*se/T)+" ms."),this.nextAudioPts=pe=He=ue);else if(se>=Te*z&&we<h&&Ee){var ge=Math.round(se/z);He=ue-ge*z,He<0&&(ge--,He+=z),We===0&&(this.nextAudioPts=pe=He),I.logger.warn("[mp4-remuxer]: Injecting "+ge+" audio frame @ "+(He/T).toFixed(3)+"s due to "+Math.round(1e3*se/T)+" ms gap.");for(var Ke=0;Ke<ge;Ke++){var st=Math.max(He,0),ne=L.default.getSilentFrame(_.manifestCodec||_.codec,_.channelCount);ne||(I.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ne=Ce.unit.subarray()),X.splice(We,0,{unit:ne,pts:st}),He+=z,We++}}Ce.pts=He,He+=z}for(var $=null,J=null,me,xe=0,ke=X.length;ke--;)xe+=X[ke].unit.byteLength;for(var $e=0,Pt=X.length;$e<Pt;$e++){var Xt=X[$e],Bt=Xt.unit,lt=Xt.pts;if(J!==null){var jt=W[$e-1];jt.duration=Math.round((lt-J)/U)}else if(d&&_.isAAC&&(lt=pe),$=lt,xe>0){xe+=te;try{me=new Uint8Array(xe)}catch(Pe){this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:O.ErrorTypes.MUX_ERROR,details:O.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:xe,reason:"fail allocating audio mdat "+xe});return}if(!y){var pn=new DataView(me.buffer);pn.setUint32(0,xe),me.set(P.default.types.mdat,4)}}else return;me.set(Bt,te);var it=Bt.byteLength;te+=it,W.push(new w(!0,K,it,0)),J=lt}var Ze=W.length;if(!Ze)return;var bt=W[W.length-1];this.nextAudioPts=pe=J+U*bt.duration;var Mt=y?new Uint8Array(0):P.default.moof(_.sequenceNumber++,$/U,m({},_,{samples:W}));_.samples=[];var ct=$/T,wt=pe/T,Ve="audio",Se={data1:Mt,data2:me,startPTS:ct,endPTS:wt,startDTS:ct,endDTS:wt,type:Ve,hasAudio:!0,hasVideo:!1,nb:Ze};return this.isAudioContiguous=!0,console.assert(me.length,"MDAT length must not be zero"),Se},S.remuxEmptyAudio=function(_,f,d,g){var E=_.inputTimeScale,T=_.samplerate?_.samplerate:E,F=E/T,U=this.nextAudioPts,K=(U!==null?U:g.startDTS*E)+this._initDTS,z=g.endDTS*E+this._initDTS,M=F*r,y=Math.ceil((z-K)/M),W=L.default.getSilentFrame(_.manifestCodec||_.codec,_.channelCount);if(I.logger.warn("[mp4-remuxer]: remux empty Audio"),!W){I.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var X=[],te=0;te<y;te++){var pe=K+te*M;X.push({unit:W,pts:pe,dts:pe})}return _.samples=X,this.remuxAudio(_,f,d,!1)},S.remuxID3=function(_,f){var d=_.samples.length;if(!d)return;for(var g=_.inputTimeScale,E=this._initPTS,T=this._initDTS,F=0;F<d;F++){var U=_.samples[F];U.pts=c(U.pts-E,f*g)/g,U.dts=c(U.dts-T,f*g)/g}var K=_.samples;return _.samples=[],{samples:K}},S.remuxText=function(_,f){var d=_.samples.length;if(!d)return;for(var g=_.inputTimeScale,E=this._initPTS,T=0;T<d;T++){var F=_.samples[T];F.pts=c(F.pts-E,f*g)/g}_.samples.sort(function(K,z){return K.pts-z.pts});var U=_.samples;return _.samples=[],{samples:U}},D}();function c(D,S){var b;if(S===null)return D;for(S<D?b=-8589934592:b=8589934592;Math.abs(D-S)>4294967296;)D+=b;return D}function R(D){for(var S=0;S<D.length;S++)if(D[S].key)return S;return-1}var w=function(S,b,_,f){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=b,this.size=_,this.cts=f,this.flags=new C(S)},C=function(S){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=S?2:1,this.isNonSync=S?0:1}},"./src/remux/passthrough-remuxer.ts":function(re,Y,j){"use strict";j.r(Y);var G=j("./src/polyfills/number.ts"),L=j("./src/utils/mp4-tools.ts"),P=j("./src/loader/fragment.ts"),H=j("./src/utils/logger.ts"),O=function(){function p(){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 m=p.prototype;return m.destroy=function(){},m.resetTimeStamp=function(r){this.initPTS=r,this.lastEndDTS=null},m.resetNextTimestamp=function(){this.lastEndDTS=null},m.resetInitSegment=function(r,n,a){this.audioCodec=n,this.videoCodec=a,this.generateInitSegment(r),this.emitInitSegment=!0},m.generateInitSegment=function(r){var n=this.audioCodec,a=this.videoCodec;if(!r||!r.byteLength){this.initTracks=void 0,this.initData=void 0;return}var l=this.initData=Object(L.parseInitSegment)(r);n||(n=x(l.audio,P.ElementaryStreamTypes.AUDIO)),a||(a=x(l.video,P.ElementaryStreamTypes.VIDEO));var s={};l.audio&&l.video?s.audiovideo={container:"video/mp4",codec:n+","+a,initSegment:r,id:"main"}:l.audio?s.audio={container:"audio/mp4",codec:n,initSegment:r,id:"audio"}:l.video?s.video={container:"video/mp4",codec:a,initSegment:r,id:"main"}:H.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=s},m.remux=function(r,n,a,l,s){var u=this.initPTS,c=this.lastEndDTS,R={audio:void 0,video:void 0,text:l,id3:a,initSegment:void 0};Object(G.isFiniteNumber)(c)||(c=this.lastEndDTS=s||0);var w=n.samples;if(!w||!w.length)return R;var C={initPTS:void 0,timescale:1},D=this.initData;if((!D||!D.length)&&(this.generateInitSegment(w),D=this.initData),!D||!D.length)return H.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),R;this.emitInitSegment&&(C.tracks=this.initTracks,this.emitInitSegment=!1),Object(G.isFiniteNumber)(u)||(this.initPTS=C.initPTS=u=I(D,w,c));var S=Object(L.getDuration)(w,D),b=c,_=S+b;Object(L.offsetStartDTS)(D,w,u),S>0?this.lastEndDTS=_:(H.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var f=!!D.audio,d=!!D.video,g="";f&&(g+="audio"),d&&(g+="video");var E={data1:w,startPTS:b,startDTS:b,endPTS:_,endDTS:_,type:g,hasAudio:f,hasVideo:d,nb:1,dropped:0};return R.audio=E.type==="audio"?E:void 0,R.video=E.type!=="audio"?E:void 0,R.text=l,R.id3=a,R.initSegment=C,R},p}(),I=function(m,h,r){return Object(L.getStartDTS)(m,h)-r};function x(p,m){var h=p==null?void 0:p.codec;return h&&h.length>4?h:h==="hvc1"?"hvc1.1.c.L120.90":h==="av01"?"av01.0.04M.08":h==="avc1"||m===P.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}Y.default=O},"./src/task-loop.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"default",function(){return G});var G=function(){function L(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var P=L.prototype;return P.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},P.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},P.onHandlerDestroyed=function(){},P.hasInterval=function(){return!!this._tickInterval},P.hasNextTick=function(){return!!this._tickTimer},P.setInterval=function(O){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,O),!0)},P.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},P.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},P.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},P.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},P.doTick=function(){},L}()},"./src/types/cmcd.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"CMCDVersion",function(){return G}),j.d(Y,"CMCDObjectType",function(){return L}),j.d(Y,"CMCDStreamingFormat",function(){return P}),j.d(Y,"CMCDStreamType",function(){return H});var G=1,L;(function(O){O.MANIFEST="m",O.AUDIO="a",O.VIDEO="v",O.MUXED="av",O.INIT="i",O.CAPTION="c",O.TIMED_TEXT="tt",O.KEY="k",O.OTHER="o"})(L||(L={}));var P;(function(O){O.DASH="d",O.HLS="h",O.SMOOTH="s",O.OTHER="o"})(P||(P={}));var H;(function(O){O.VOD="v",O.LIVE="l"})(H||(H={}))},"./src/types/level.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"HlsSkip",function(){return P}),j.d(Y,"getSkipValue",function(){return H}),j.d(Y,"HlsUrlParameters",function(){return O}),j.d(Y,"Level",function(){return I});function G(x,p){for(var m=0;m<p.length;m++){var h=p[m];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(x,h.key,h)}}function L(x,p,m){return p&&G(x.prototype,p),m&&G(x,m),x}var P;(function(x){x.No="",x.Yes="YES",x.v2="v2"})(P||(P={}));function H(x,p){var m=x.canSkipUntil,h=x.canSkipDateRanges,r=x.endSN,n=p!==void 0?p-r:0;return m&&n<m?h?P.v2:P.Yes:P.No}var O=function(){function x(m,h,r){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=m,this.part=h,this.skip=r}var p=x.prototype;return p.addDirectives=function(h){var r=new self.URL(h);return this.msn!==void 0&&r.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&r.searchParams.set("_HLS_part",this.part.toString()),this.skip&&r.searchParams.set("_HLS_skip",this.skip),r.toString()},x}(),I=function(){function x(p){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=[p.url],this.attrs=p.attrs,this.bitrate=p.bitrate,p.details&&(this.details=p.details),this.id=p.id||0,this.name=p.name,this.width=p.width||0,this.height=p.height||0,this.audioCodec=p.audioCodec,this.videoCodec=p.videoCodec,this.unknownCodecs=p.unknownCodecs,this.codecSet=[p.videoCodec,p.audioCodec].filter(function(m){return m}).join(",").replace(/\.[^.,]+/g,"")}return L(x,[{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(m){var h=m%this.url.length;this._urlId!==h&&(this.details=void 0,this._urlId=h)}}]),x}()},"./src/types/loader.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"PlaylistContextType",function(){return G}),j.d(Y,"PlaylistLevelType",function(){return L});var G;(function(P){P.MANIFEST="manifest",P.LEVEL="level",P.AUDIO_TRACK="audioTrack",P.SUBTITLE_TRACK="subtitleTrack"})(G||(G={}));var L;(function(P){P.MAIN="main",P.AUDIO="audio",P.SUBTITLE="subtitle"})(L||(L={}))},"./src/types/transmuxer.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"ChunkMetadata",function(){return G});var G=function(H,O,I,x,p,m){x===void 0&&(x=0),p===void 0&&(p=-1),m===void 0&&(m=!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=L(),this.buffering={audio:L(),video:L(),audiovideo:L()},this.level=H,this.sn=O,this.id=I,this.size=x,this.part=p,this.partial=m};function L(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"AttrList",function(){return P});var G=/^(\d+)x(\d+)$/,L=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,P=function(){function H(I){typeof I=="string"&&(I=H.parseAttrList(I));for(var x in I)I.hasOwnProperty(x)&&(this[x]=I[x])}var O=H.prototype;return O.decimalInteger=function(x){var p=parseInt(this[x],10);return p>Number.MAX_SAFE_INTEGER?Infinity:p},O.hexadecimalInteger=function(x){if(this[x]){var p=(this[x]||"0x").slice(2);p=(p.length&1?"0":"")+p;for(var m=new Uint8Array(p.length/2),h=0;h<p.length/2;h++)m[h]=parseInt(p.slice(h*2,h*2+2),16);return m}else return null},O.hexadecimalIntegerAsNumber=function(x){var p=parseInt(this[x],16);return p>Number.MAX_SAFE_INTEGER?Infinity:p},O.decimalFloatingPoint=function(x){return parseFloat(this[x])},O.optionalFloat=function(x,p){var m=this[x];return m?parseFloat(m):p},O.enumeratedString=function(x){return this[x]},O.bool=function(x){return this[x]==="YES"},O.decimalResolution=function(x){var p=G.exec(this[x]);return p===null?void 0:{width:parseInt(p[1],10),height:parseInt(p[2],10)}},H.parseAttrList=function(x){var p,m={},h='"';for(L.lastIndex=0;(p=L.exec(x))!==null;){var r=p[2];r.indexOf(h)===0&&r.lastIndexOf(h)===r.length-1&&(r=r.slice(1,-1)),m[p[1]]=r}return m},H}()},"./src/utils/binary-search.ts":function(re,Y,j){"use strict";j.r(Y);var G={search:function(P,H){for(var O=0,I=P.length-1,x=null,p=null;O<=I;){x=(O+I)/2|0,p=P[x];var m=H(p);if(m>0)O=x+1;else if(m<0)I=x-1;else return p}return null}};Y.default=G},"./src/utils/buffer-helper.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"BufferHelper",function(){return P});var G=j("./src/utils/logger.ts"),L={length:0,start:function(){return 0},end:function(){return 0}},P=function(){function H(){}return H.isBuffered=function(I,x){try{if(I){for(var p=H.getBuffered(I),m=0;m<p.length;m++)if(x>=p.start(m)&&x<=p.end(m))return!0}}catch(h){}return!1},H.bufferInfo=function(I,x,p){try{if(I){var m=H.getBuffered(I),h=[],r;for(r=0;r<m.length;r++)h.push({start:m.start(r),end:m.end(r)});return this.bufferedInfo(h,x,p)}}catch(n){}return{len:0,start:x,end:x,nextStart:void 0}},H.bufferedInfo=function(I,x,p){x=Math.max(0,x),I.sort(function(C,D){var S=C.start-D.start;return S||D.end-C.end});var m=[];if(p)for(var h=0;h<I.length;h++){var r=m.length;if(r){var n=m[r-1].end;I[h].start-n<p?I[h].end>n&&(m[r-1].end=I[h].end):m.push(I[h])}else m.push(I[h])}else m=I;for(var a=0,l,s=x,u=x,c=0;c<m.length;c++){var R=m[c].start,w=m[c].end;if(x+p>=R&&x<w)s=R,u=w,a=u-x;else if(x+p<R){l=R;break}}return{len:a,start:s||0,end:u||0,nextStart:l}},H.getBuffered=function(I){try{return I.buffered}catch(x){return G.logger.log("failed to get media.buffered",x),L}},H}()},"./src/utils/cea-608-parser.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"Row",function(){return u}),j.d(Y,"CaptionScreen",function(){return c});var G=j("./src/utils/logger.ts"),L={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},P=function(_){var f=_;return L.hasOwnProperty(_)&&(f=L[_]),String.fromCharCode(f)},H=15,O=100,I={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},x={17:2,18:4,21:6,22:8,23:10,19:13,20:15},p={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},m={25:2,26:4,29:6,30:8,31:10,27:13,28:15},h=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],r;(function(b){b[b.ERROR=0]="ERROR",b[b.TEXT=1]="TEXT",b[b.WARNING=2]="WARNING",b[b.INFO=2]="INFO",b[b.DEBUG=3]="DEBUG",b[b.DATA=3]="DATA"})(r||(r={}));var n=function(){function b(){this.time=null,this.verboseLevel=r.ERROR}var _=b.prototype;return _.log=function(d,g){this.verboseLevel>=d&&G.logger.log(this.time+" ["+d+"] "+g)},b}(),a=function(_){for(var f=[],d=0;d<_.length;d++)f.push(_[d].toString(16));return f},l=function(){function b(f,d,g,E,T){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=f||"white",this.underline=d||!1,this.italics=g||!1,this.background=E||"black",this.flash=T||!1}var _=b.prototype;return _.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},_.setStyles=function(d){for(var g=["foreground","underline","italics","background","flash"],E=0;E<g.length;E++){var T=g[E];d.hasOwnProperty(T)&&(this[T]=d[T])}},_.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},_.equals=function(d){return this.foreground===d.foreground&&this.underline===d.underline&&this.italics===d.italics&&this.background===d.background&&this.flash===d.flash},_.copy=function(d){this.foreground=d.foreground,this.underline=d.underline,this.italics=d.italics,this.background=d.background,this.flash=d.flash},_.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},b}(),s=function(){function b(f,d,g,E,T,F){this.uchar=void 0,this.penState=void 0,this.uchar=f||" ",this.penState=new l(d,g,E,T,F)}var _=b.prototype;return _.reset=function(){this.uchar=" ",this.penState.reset()},_.setChar=function(d,g){this.uchar=d,this.penState.copy(g)},_.setPenState=function(d){this.penState.copy(d)},_.equals=function(d){return this.uchar===d.uchar&&this.penState.equals(d.penState)},_.copy=function(d){this.uchar=d.uchar,this.penState.copy(d.penState)},_.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},b}(),u=function(){function b(f){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var d=0;d<O;d++)this.chars.push(new s);this.logger=f,this.pos=0,this.currPenState=new l}var _=b.prototype;return _.equals=function(d){for(var g=!0,E=0;E<O;E++)if(!this.chars[E].equals(d.chars[E])){g=!1;break}return g},_.copy=function(d){for(var g=0;g<O;g++)this.chars[g].copy(d.chars[g])},_.isEmpty=function(){for(var d=!0,g=0;g<O;g++)if(!this.chars[g].isEmpty()){d=!1;break}return d},_.setCursor=function(d){this.pos!==d&&(this.pos=d),this.pos<0?(this.logger.log(r.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>O&&(this.logger.log(r.DEBUG,"Too large cursor position "+this.pos),this.pos=O)},_.moveCursor=function(d){var g=this.pos+d;if(d>1)for(var E=this.pos+1;E<g+1;E++)this.chars[E].setPenState(this.currPenState);this.setCursor(g)},_.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},_.insertChar=function(d){d>=144&&this.backSpace();var g=P(d);if(this.pos>=O){this.logger.log(r.ERROR,"Cannot insert "+d.toString(16)+" ("+g+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(g,this.currPenState),this.moveCursor(1)},_.clearFromPos=function(d){var g;for(g=d;g<O;g++)this.chars[g].reset()},_.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},_.clearToEndOfRow=function(){this.clearFromPos(this.pos)},_.getTextString=function(){for(var d=[],g=!0,E=0;E<O;E++){var T=this.chars[E].uchar;T!==" "&&(g=!1),d.push(T)}return g?"":d.join("")},_.setPenStyles=function(d){this.currPenState.setStyles(d);var g=this.chars[this.pos];g.setPenState(this.currPenState)},b}(),c=function(){function b(f){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var d=0;d<H;d++)this.rows.push(new u(f));this.logger=f,this.currRow=H-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var _=b.prototype;return _.reset=function(){for(var d=0;d<H;d++)this.rows[d].clear();this.currRow=H-1},_.equals=function(d){for(var g=!0,E=0;E<H;E++)if(!this.rows[E].equals(d.rows[E])){g=!1;break}return g},_.copy=function(d){for(var g=0;g<H;g++)this.rows[g].copy(d.rows[g])},_.isEmpty=function(){for(var d=!0,g=0;g<H;g++)if(!this.rows[g].isEmpty()){d=!1;break}return d},_.backSpace=function(){var d=this.rows[this.currRow];d.backSpace()},_.clearToEndOfRow=function(){var d=this.rows[this.currRow];d.clearToEndOfRow()},_.insertChar=function(d){var g=this.rows[this.currRow];g.insertChar(d)},_.setPen=function(d){var g=this.rows[this.currRow];g.setPenStyles(d)},_.moveCursor=function(d){var g=this.rows[this.currRow];g.moveCursor(d)},_.setCursor=function(d){this.logger.log(r.INFO,"setCursor: "+d);var g=this.rows[this.currRow];g.setCursor(d)},_.setPAC=function(d){this.logger.log(r.INFO,"pacData = "+JSON.stringify(d));var g=d.row-1;if(this.nrRollUpRows&&g<this.nrRollUpRows-1&&(g=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==g){for(var E=0;E<H;E++)this.rows[E].clear();var T=this.currRow+1-this.nrRollUpRows,F=this.lastOutputScreen;if(F){var U=F.rows[T].cueStartTime,K=this.logger.time;if(U&&K!==null&&U<K)for(var z=0;z<this.nrRollUpRows;z++)this.rows[g-this.nrRollUpRows+z+1].copy(F.rows[T+z])}}this.currRow=g;var M=this.rows[this.currRow];if(d.indent!==null){var y=d.indent,W=Math.max(y-1,0);M.setCursor(d.indent),d.color=M.chars[W].penState.foreground}var X={foreground:d.color,underline:d.underline,italics:d.italics,background:"black",flash:!1};this.setPen(X)},_.setBkgData=function(d){this.logger.log(r.INFO,"bkgData = "+JSON.stringify(d)),this.backSpace(),this.setPen(d),this.insertChar(32)},_.setRollUpRows=function(d){this.nrRollUpRows=d},_.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(r.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(r.TEXT,this.getDisplayText());var d=this.currRow+1-this.nrRollUpRows,g=this.rows.splice(d,1)[0];g.clear(),this.rows.splice(this.currRow,0,g),this.logger.log(r.INFO,"Rolling up")},_.getDisplayText=function(d){d=d||!1;for(var g=[],E="",T=-1,F=0;F<H;F++){var U=this.rows[F].getTextString();U&&(T=F+1,d?g.push("Row "+T+": '"+U+"'"):g.push(U.trim()))}return g.length>0&&(d?E="["+g.join(" | ")+"]":E=g.join(`
`)),E},_.getTextAndFormat=function(){return this.rows},b}(),R=function(){function b(f,d,g){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=f,this.outputFilter=d,this.mode=null,this.verbose=0,this.displayedMemory=new c(g),this.nonDisplayedMemory=new c(g),this.lastOutputScreen=new c(g),this.currRollUpRow=this.displayedMemory.rows[H-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=g}var _=b.prototype;return _.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[H-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},_.getHandler=function(){return this.outputFilter},_.setHandler=function(d){this.outputFilter=d},_.setPAC=function(d){this.writeScreen.setPAC(d)},_.setBkgData=function(d){this.writeScreen.setBkgData(d)},_.setMode=function(d){if(d===this.mode)return;this.mode=d,this.logger.log(r.INFO,"MODE="+d),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=d},_.insertChars=function(d){for(var g=0;g<d.length;g++)this.writeScreen.insertChar(d[g]);var E=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(r.INFO,E+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(r.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},_.ccRCL=function(){this.logger.log(r.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},_.ccBS=function(){if(this.logger.log(r.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},_.ccAOF=function(){},_.ccAON=function(){},_.ccDER=function(){this.logger.log(r.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},_.ccRU=function(d){this.logger.log(r.INFO,"RU("+d+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(d)},_.ccFON=function(){this.logger.log(r.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},_.ccRDC=function(){this.logger.log(r.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},_.ccTR=function(){this.logger.log(r.INFO,"TR"),this.setMode("MODE_TEXT")},_.ccRTD=function(){this.logger.log(r.INFO,"RTD"),this.setMode("MODE_TEXT")},_.ccEDM=function(){this.logger.log(r.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},_.ccCR=function(){this.logger.log(r.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},_.ccENM=function(){this.logger.log(r.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},_.ccEOC=function(){if(this.logger.log(r.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var d=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=d,this.writeScreen=this.nonDisplayedMemory,this.logger.log(r.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},_.ccTO=function(d){this.logger.log(r.INFO,"TO("+d+") - Tab Offset"),this.writeScreen.moveCursor(d)},_.ccMIDROW=function(d){var g={flash:!1};if(g.underline=d%2===1,g.italics=d>=46,g.italics)g.foreground="white";else{var E=Math.floor(d/2)-16,T=["white","green","blue","cyan","red","yellow","magenta"];g.foreground=T[E]}this.logger.log(r.INFO,"MIDROW: "+JSON.stringify(g)),this.writeScreen.setPen(g)},_.outputDataUpdate=function(d){d===void 0&&(d=!1);var g=this.logger.time;if(g===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=g:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,g,this.lastOutputScreen),d&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:g),this.lastOutputScreen.copy(this.displayedMemory))},_.cueSplitAtTime=function(d){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,d,this.displayedMemory),this.cueStartTime=d))},b}(),w=function(){function b(f,d,g){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var E=new n;this.channels=[null,new R(f,d,E),new R(f+1,g,E)],this.cmdHistory=S(),this.logger=E}var _=b.prototype;return _.getHandler=function(d){return this.channels[d].getHandler()},_.setHandler=function(d,g){this.channels[d].setHandler(g)},_.addData=function(d,g){var E,T,F,U=!1;this.logger.time=d;for(var K=0;K<g.length;K+=2){if(T=g[K]&127,F=g[K+1]&127,T===0&&F===0)continue;if(this.logger.log(r.DATA,"["+a([g[K],g[K+1]])+"] -> ("+a([T,F])+")"),E=this.parseCmd(T,F),E||(E=this.parseMidrow(T,F)),E||(E=this.parsePAC(T,F)),E||(E=this.parseBackgroundAttributes(T,F)),!E&&(U=this.parseChars(T,F),U)){var z=this.currentChannel;if(z&&z>0){var M=this.channels[z];M.insertChars(U)}else this.logger.log(r.WARNING,"No channel found yet. TEXT-MODE?")}!E&&!U&&this.logger.log(r.WARNING,"Couldn't parse cleaned data "+a([T,F])+" orig: "+a([g[K],g[K+1]]))}},_.parseCmd=function(d,g){var E=this.cmdHistory,T=(d===20||d===28||d===21||d===29)&&g>=32&&g<=47,F=(d===23||d===31)&&g>=33&&g<=35;if(!(T||F))return!1;if(D(d,g,E))return C(null,null,E),this.logger.log(r.DEBUG,"Repeated command ("+a([d,g])+") is dropped"),!0;var U=d===20||d===21||d===23?1:2,K=this.channels[U];return d===20||d===21||d===28||d===29?g===32?K.ccRCL():g===33?K.ccBS():g===34?K.ccAOF():g===35?K.ccAON():g===36?K.ccDER():g===37?K.ccRU(2):g===38?K.ccRU(3):g===39?K.ccRU(4):g===40?K.ccFON():g===41?K.ccRDC():g===42?K.ccTR():g===43?K.ccRTD():g===44?K.ccEDM():g===45?K.ccCR():g===46?K.ccENM():g===47&&K.ccEOC():K.ccTO(g-32),C(d,g,E),this.currentChannel=U,!0},_.parseMidrow=function(d,g){var E=0;if((d===17||d===25)&&g>=32&&g<=47){if(d===17?E=1:E=2,E!==this.currentChannel)return this.logger.log(r.ERROR,"Mismatch channel in midrow parsing"),!1;var T=this.channels[E];return T?(T.ccMIDROW(g),this.logger.log(r.DEBUG,"MIDROW ("+a([d,g])+")"),!0):!1}return!1},_.parsePAC=function(d,g){var E,T=this.cmdHistory,F=(d>=17&&d<=23||d>=25&&d<=31)&&g>=64&&g<=127,U=(d===16||d===24)&&g>=64&&g<=95;if(!(F||U))return!1;if(D(d,g,T))return C(null,null,T),!0;var K=d<=23?1:2;g>=64&&g<=95?E=K===1?I[d]:p[d]:E=K===1?x[d]:m[d];var z=this.channels[K];return z?(z.setPAC(this.interpretPAC(E,g)),C(d,g,T),this.currentChannel=K,!0):!1},_.interpretPAC=function(d,g){var E,T={color:null,italics:!1,indent:null,underline:!1,row:d};return g>95?E=g-96:E=g-64,T.underline=(E&1)===1,E<=13?T.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(E/2)]:E<=15?(T.italics=!0,T.color="white"):T.indent=Math.floor((E-16)/2)*4,T},_.parseChars=function(d,g){var E,T=null,F=null;if(d>=25?(E=2,F=d-8):(E=1,F=d),F>=17&&F<=19){var U;F===17?U=g+80:F===18?U=g+112:U=g+144,this.logger.log(r.INFO,"Special char '"+P(U)+"' in channel "+E),T=[U]}else d>=32&&d<=127&&(T=g===0?[d]:[d,g]);if(T){var K=a(T);this.logger.log(r.DEBUG,"Char codes = "+K.join(",")),C(d,g,this.cmdHistory)}return T},_.parseBackgroundAttributes=function(d,g){var E=(d===16||d===24)&&g>=32&&g<=47,T=(d===23||d===31)&&g>=45&&g<=47;if(!(E||T))return!1;var F,U={};d===16||d===24?(F=Math.floor((g-32)/2),U.background=h[F],g%2===1&&(U.background=U.background+"_semi")):g===45?U.background="transparent":(U.foreground="black",g===47&&(U.underline=!0));var K=d<=23?1:2,z=this.channels[K];return z.setBkgData(U),C(d,g,this.cmdHistory),!0},_.reset=function(){for(var d=0;d<Object.keys(this.channels).length;d++){var g=this.channels[d];g&&g.reset()}this.cmdHistory=S()},_.cueSplitAtTime=function(d){for(var g=0;g<this.channels.length;g++){var E=this.channels[g];E&&E.cueSplitAtTime(d)}},b}();function C(b,_,f){f.a=b,f.b=_}function D(b,_,f){return f.a===b&&f.b===_}function S(){return{a:null,b:null}}Y.default=w},"./src/utils/codecs.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"isCodecType",function(){return L}),j.d(Y,"isCodecSupportedInMp4",function(){return P});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 L(H,O){var I=G[O];return!!I&&I[H.slice(0,4)]===!0}function P(H,O){return MediaSource.isTypeSupported((O||"video")+'/mp4;codecs="'+H+'"')}},"./src/utils/cues.ts":function(re,Y,j){"use strict";j.r(Y);var G=j("./src/utils/vttparser.ts"),L=j("./src/utils/webvtt-parser.ts"),P=j("./src/utils/texttrack-utils.ts"),H=/\s/,O={newCue:function(x,p,m,h){for(var r=[],n,a,l,s,u,c=self.VTTCue||self.TextTrackCue,R=0;R<h.rows.length;R++)if(n=h.rows[R],l=!0,s=0,u="",!n.isEmpty()){for(var w=0;w<n.chars.length;w++)H.test(n.chars[w].uchar)&&l?s++:(u+=n.chars[w].uchar,l=!1);n.cueStartTime=p,p===m&&(m+=1e-4),s>=16?s--:s++;var C=Object(G.fixLineBreaks)(u.trim()),D=Object(L.generateCueId)(p,m,C);(!x||!x.cues||!x.cues.getCueById(D))&&(a=new c(p,m,C),a.id=D,a.line=R+1,a.align="left",a.position=10+Math.min(80,Math.floor(s*8/32)*10),r.push(a))}return x&&r.length&&(r.sort(function(S,b){return S.line==="auto"||b.line==="auto"?0:S.line>8&&b.line>8?b.line-S.line:S.line-b.line}),r.forEach(function(S){return Object(P.addCueToTrack)(x,S)})),r}};Y.default=O},"./src/utils/discontinuities.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"findFirstFragWithCC",function(){return H}),j.d(Y,"shouldAlignOnDiscontinuities",function(){return O}),j.d(Y,"findDiscontinuousReferenceFrag",function(){return I}),j.d(Y,"adjustSlidingStart",function(){return p}),j.d(Y,"alignStream",function(){return m}),j.d(Y,"alignPDT",function(){return r}),j.d(Y,"alignFragmentByPDTDelta",function(){return n}),j.d(Y,"alignMediaPlaylistByPDT",function(){return a});var G=j("./src/polyfills/number.ts"),L=j("./src/utils/logger.ts"),P=j("./src/controller/level-helper.ts");function H(l,s){for(var u=null,c=0,R=l.length;c<R;c++){var w=l[c];if(w&&w.cc===s){u=w;break}}return u}function O(l,s,u){return!!(s.details&&(u.endCC>u.startCC||l&&l.cc<u.startCC))}function I(l,s){var u=l.fragments,c=s.fragments;if(!c.length||!u.length){L.logger.log("No fragments to align");return}var R=H(u,c[0].cc);if(!R||R&&!R.startPTS){L.logger.log("No frag in previous level to align on");return}return R}function x(l,s){if(l){var u=l.start+s;l.start=l.startPTS=u,l.endPTS=u+l.duration}}function p(l,s){for(var u=s.fragments,c=0,R=u.length;c<R;c++)x(u[c],l);s.fragmentHint&&x(s.fragmentHint,l),s.alignedSliding=!0}function m(l,s,u){if(!s)return;h(l,u,s),!u.alignedSliding&&s.details&&r(u,s.details),!u.alignedSliding&&s.details&&!u.skippedSegments&&Object(P.adjustSliding)(s.details,u)}function h(l,s,u){if(O(l,u,s)){var c=I(u.details,s);c&&Object(G.isFiniteNumber)(c.start)&&(L.logger.log("Adjusting PTS using last level due to CC increase within current level "+s.url),p(c.start,s))}}function r(l,s){if(!s.fragments.length||!l.hasProgramDateTime||!s.hasProgramDateTime)return;var u=s.fragments[0].programDateTime,c=l.fragments[0].programDateTime,R=(c-u)/1e3+s.fragments[0].start;R&&Object(G.isFiniteNumber)(R)&&(L.logger.log("Adjusting PTS using programDateTime delta "+(c-u)+"ms, sliding:"+R.toFixed(3)+" "+l.url+" "),p(R,l))}function n(l,s){var u=l.programDateTime;if(!u)return;var c=(u-s)/1e3;l.start=l.startPTS=c,l.endPTS=c+l.duration}function a(l,s){if(!s.fragments.length||!l.hasProgramDateTime||!s.hasProgramDateTime)return;var u=s.fragments[0].programDateTime,c=s.fragments[0].start,R=u-c*1e3;l.fragments.forEach(function(w){n(w,R)}),l.fragmentHint&&n(l.fragmentHint,R),l.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(re,Y,j){"use strict";j.r(Y);var G=j("./src/utils/ewma.ts"),L=function(){function P(O,I,x){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=x,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new G.default(O),this.fast_=new G.default(I)}var H=P.prototype;return H.update=function(I,x){var p=this.slow_,m=this.fast_;this.slow_.halfLife!==I&&(this.slow_=new G.default(I,p.getEstimate(),p.getTotalWeight())),this.fast_.halfLife!==x&&(this.fast_=new G.default(x,m.getEstimate(),m.getTotalWeight()))},H.sample=function(I,x){I=Math.max(I,this.minDelayMs_);var p=8*x,m=I/1e3,h=p/m;this.fast_.sample(m,h),this.slow_.sample(m,h)},H.canEstimate=function(){var I=this.fast_;return I&&I.getTotalWeight()>=this.minWeight_},H.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},H.destroy=function(){},P}();Y.default=L},"./src/utils/ewma.ts":function(re,Y,j){"use strict";j.r(Y);var G=function(){function L(H,O,I){O===void 0&&(O=0),I===void 0&&(I=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=H,this.alpha_=H?Math.exp(Math.log(.5)/H):0,this.estimate_=O,this.totalWeight_=I}var P=L.prototype;return P.sample=function(O,I){var x=Math.pow(this.alpha_,O);this.estimate_=I*(1-x)+x*this.estimate_,this.totalWeight_+=O},P.getTotalWeight=function(){return this.totalWeight_},P.getEstimate=function(){if(this.alpha_){var O=1-Math.pow(this.alpha_,this.totalWeight_);if(O)return this.estimate_/O}return this.estimate_},L}();Y.default=G},"./src/utils/fetch-loader.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"fetchSupported",function(){return n});var G=j("./src/polyfills/number.ts"),L=j("./src/loader/load-stats.ts"),P=j("./src/demux/chunk-cache.ts");function H(c,R){c.prototype=Object.create(R.prototype),c.prototype.constructor=c,m(c,R)}function O(c){var R=typeof Map=="function"?new Map:void 0;return O=function(C){if(C===null||!p(C))return C;if(typeof C!="function")throw new TypeError("Super expression must either be null or a function");if(typeof R!="undefined"){if(R.has(C))return R.get(C);R.set(C,D)}function D(){return I(C,arguments,h(this).constructor)}return D.prototype=Object.create(C.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),m(D,C)},O(c)}function I(c,R,w){return x()?I=Reflect.construct:I=function(D,S,b){var _=[null];_.push.apply(_,S);var f=Function.bind.apply(D,_),d=new f;return b&&m(d,b.prototype),d},I.apply(null,arguments)}function x(){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(c){return!1}}function p(c){return Function.toString.call(c).indexOf("[native code]")!==-1}function m(c,R){return m=Object.setPrototypeOf||function(C,D){return C.__proto__=D,C},m(c,R)}function h(c){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(w){return w.__proto__||Object.getPrototypeOf(w)},h(c)}function r(){return r=Object.assign||function(c){for(var R=1;R<arguments.length;R++){var w=arguments[R];for(var C in w)Object.prototype.hasOwnProperty.call(w,C)&&(c[C]=w[C])}return c},r.apply(this,arguments)}function n(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(c){}return!1}var a=function(){function c(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||s,this.controller=new self.AbortController,this.stats=new L.LoadStats}var R=c.prototype;return R.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},R.abortInternal=function(){var C=this.response;(!C||!C.ok)&&(this.stats.aborted=!0,this.controller.abort())},R.abort=function(){var C;this.abortInternal(),(C=this.callbacks)!==null&&C!==void 0&&C.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},R.load=function(C,D,S){var b=this,_=this.stats;if(_.loading.start)throw new Error("Loader can only be used once.");_.loading.start=self.performance.now();var f=l(C,this.controller.signal),d=S.onProgress,g=C.responseType==="arraybuffer",E=g?"byteLength":"length";this.context=C,this.config=D,this.callbacks=S,this.request=this.fetchSetup(C,f),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){b.abortInternal(),S.onTimeout(_,C,b.response)},D.timeout),self.fetch(this.request).then(function(T){if(b.response=b.loader=T,!T.ok){var F=T.status,U=T.statusText;throw new u(U||"fetch, bad network response",F,T)}return _.loading.first=Math.max(self.performance.now(),_.loading.start),_.total=parseInt(T.headers.get("Content-Length")||"0"),d&&Object(G.isFiniteNumber)(D.highWaterMark)?b.loadProgressively(T,_,C,D.highWaterMark,d):g?T.arrayBuffer():T.text()}).then(function(T){var F=b.response;self.clearTimeout(b.requestTimeout),_.loading.end=Math.max(self.performance.now(),_.loading.first),_.loaded=_.total=T[E];var U={url:F.url,data:T};d&&!Object(G.isFiniteNumber)(D.highWaterMark)&&d(_,C,T,F),S.onSuccess(U,_,C,F)}).catch(function(T){if(self.clearTimeout(b.requestTimeout),_.aborted)return;var F=T.code||0;S.onError({code:F,text:T.message},C,T.details)})},R.getCacheAge=function(){var C=null;if(this.response){var D=this.response.headers.get("age");C=D?parseFloat(D):null}return C},R.loadProgressively=function(C,D,S,b,_){b===void 0&&(b=0);var f=new P.default,d=C.body.getReader(),g=function E(){return d.read().then(function(T){if(T.done)return f.dataLength&&_(D,S,f.flush(),C),Promise.resolve(new ArrayBuffer(0));var F=T.value,U=F.length;return D.loaded+=U,U<b||f.dataLength?(f.push(F),f.dataLength>=b&&_(D,S,f.flush(),C)):_(D,S,F,C),E()}).catch(function(){return Promise.reject()})};return g()},c}();function l(c,R){var w={method:"GET",mode:"cors",credentials:"same-origin",signal:R,headers:new self.Headers(r({},c.headers))};return c.rangeEnd&&w.headers.set("Range","bytes="+c.rangeStart+"-"+String(c.rangeEnd-1)),w}function s(c,R){return new self.Request(c.url,R)}var u=function(c){H(R,c);function R(w,C,D){var S;return S=c.call(this,w)||this,S.code=void 0,S.details=void 0,S.code=C,S.details=D,S}return R}(O(Error));Y.default=a},"./src/utils/imsc1-ttml-parser.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"IMSC1_CODEC",function(){return p}),j.d(Y,"parseIMSC1",function(){return n});var G=j("./src/utils/mp4-tools.ts"),L=j("./src/utils/vttparser.ts"),P=j("./src/utils/vttcue.ts"),H=j("./src/demux/id3.ts"),O=j("./src/utils/timescale-conversion.ts"),I=j("./src/utils/webvtt-parser.ts");function x(){return x=Object.assign||function(b){for(var _=1;_<arguments.length;_++){var f=arguments[_];for(var d in f)Object.prototype.hasOwnProperty.call(f,d)&&(b[d]=f[d])}return b},x.apply(this,arguments)}var p="stpp.ttml.im1t",m=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,h=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,r={left:"start",center:"center",right:"end",start:"start",end:"end"};function n(b,_,f,d,g){var E=Object(G.findBox)(new Uint8Array(b),["mdat"]);if(E.length===0){g(new Error("Could not parse IMSC1 mdat"));return}var T=E[0],F=Object(H.utf8ArrayToStr)(new Uint8Array(b,T.start,T.end-T.start)),U=Object(O.toTimescaleFromScale)(_,1,f);try{d(a(F,U))}catch(K){g(K)}}function a(b,_){var f=new DOMParser,d=f.parseFromString(b,"text/xml"),g=d.getElementsByTagName("tt")[0];if(!g)throw new Error("Invalid ttml");var E={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},T=Object.keys(E).reduce(function(M,y){return M[y]=g.getAttribute("ttp:"+y)||E[y],M},{}),F=g.getAttribute("xml:space")!=="preserve",U=s(l(g,"styling","style")),K=s(l(g,"layout","region")),z=l(g,"body","[begin]");return[].map.call(z,function(M){var y=u(M,F);if(!y||!M.hasAttribute("begin"))return null;var W=C(M.getAttribute("begin"),T),X=C(M.getAttribute("dur"),T),te=C(M.getAttribute("end"),T);if(W===null)throw w(M);if(te===null){if(X===null)throw w(M);te=W+X}var pe=new P.default(W-_,te-_,y);pe.id=Object(I.generateCueId)(pe.startTime,pe.endTime,pe.text);var Ie=K[M.getAttribute("region")],Ee=U[M.getAttribute("style")];pe.position=10,pe.size=80;var Te=c(Ie,Ee),We=Te.textAlign;if(We){var He=r[We];He&&(pe.lineAlign=He),pe.align=We}return x(pe,Te),pe}).filter(function(M){return M!==null})}function l(b,_,f){var d=b.getElementsByTagName(_)[0];return d?[].slice.call(d.querySelectorAll(f)):[]}function s(b){return b.reduce(function(_,f){var d=f.getAttribute("xml:id");return d&&(_[d]=f),_},{})}function u(b,_){return[].slice.call(b.childNodes).reduce(function(f,d,g){var E;return d.nodeName==="br"&&g?f+`
`:(E=d.childNodes)!==null&&E!==void 0&&E.length?u(d,_):_?f+d.textContent.trim().replace(/\s+/g," "):f+d.textContent},"")}function c(b,_){var f="http://www.w3.org/ns/ttml#styling",d=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return d.reduce(function(g,E){var T=R(_,f,E)||R(b,f,E);return T&&(g[E]=T),g},{})}function R(b,_,f){return b.hasAttributeNS(_,f)?b.getAttributeNS(_,f):null}function w(b){return new Error("Could not parse ttml timestamp "+b)}function C(b,_){if(!b)return null;var f=Object(L.parseTimeStamp)(b);return f===null&&(m.test(b)?f=D(b,_):h.test(b)&&(f=S(b,_))),f}function D(b,_){var f=m.exec(b),d=(f[4]|0)+(f[5]|0)/_.subFrameRate;return(f[1]|0)*3600+(f[2]|0)*60+(f[3]|0)+d/_.frameRate}function S(b,_){var f=h.exec(b),d=Number(f[1]),g=f[2];switch(g){case"h":return d*3600;case"m":return d*60;case"ms":return d*1e3;case"f":return d/_.frameRate;case"t":return d/_.tickRate}return d}},"./src/utils/logger.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"enableLogs",function(){return I}),j.d(Y,"logger",function(){return x});var G=function(){},L={trace:G,debug:G,log:G,warn:G,info:G,error:G},P=L;function H(p){var m=self.console[p];return m?m.bind(self.console,"["+p+"] >"):G}function O(p){for(var m=arguments.length,h=new Array(m>1?m-1:0),r=1;r<m;r++)h[r-1]=arguments[r];h.forEach(function(n){P[n]=p[n]?p[n].bind(p):H(n)})}function I(p){if(self.console&&p===!0||typeof p=="object"){O(p,"debug","log","info","warn","error");try{P.log()}catch(m){P=L}}else P=L}var x=P},"./src/utils/mediakeys-helper.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"KeySystems",function(){return G}),j.d(Y,"requestMediaKeySystemAccess",function(){return L});var G;(function(P){P.WIDEVINE="com.widevine.alpha",P.PLAYREADY="com.microsoft.playready"})(G||(G={}));var L=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"getMediaSource",function(){return G});function G(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"bin2str",function(){return O}),j.d(Y,"readUint16",function(){return I}),j.d(Y,"readUint32",function(){return x}),j.d(Y,"writeUint32",function(){return p}),j.d(Y,"findBox",function(){return m}),j.d(Y,"parseSegmentIndex",function(){return h}),j.d(Y,"parseInitSegment",function(){return r}),j.d(Y,"getStartDTS",function(){return n}),j.d(Y,"getDuration",function(){return a}),j.d(Y,"computeRawDurationFromSamples",function(){return l}),j.d(Y,"offsetStartDTS",function(){return s}),j.d(Y,"segmentValidRange",function(){return u}),j.d(Y,"appendUint8Array",function(){return c});var G=j("./src/utils/typed-array.ts"),L=j("./src/loader/fragment.ts"),P=Math.pow(2,32)-1,H=[].push;function O(R){return String.fromCharCode.apply(null,R)}function I(R,w){"data"in R&&(w+=R.start,R=R.data);var C=R[w]<<8|R[w+1];return C<0?65536+C:C}function x(R,w){"data"in R&&(w+=R.start,R=R.data);var C=R[w]<<24|R[w+1]<<16|R[w+2]<<8|R[w+3];return C<0?4294967296+C:C}function p(R,w,C){"data"in R&&(w+=R.start,R=R.data),R[w]=C>>24,R[w+1]=C>>16&255,R[w+2]=C>>8&255,R[w+3]=C&255}function m(R,w){var C=[];if(!w.length)return C;var D,S,b;"data"in R?(D=R.data,S=R.start,b=R.end):(D=R,S=0,b=D.byteLength);for(var _=S;_<b;){var f=x(D,_),d=O(D.subarray(_+4,_+8)),g=f>1?_+f:b;if(d===w[0])if(w.length===1)C.push({data:D,start:_+8,end:g});else{var E=m({data:D,start:_+8,end:g},w.slice(1));E.length&&H.apply(C,E)}_=g}return C}function h(R){var w=m(R,["moov"]),C=w[0],D=C?C.end:null,S=m(R,["sidx"]);if(!S||!S[0])return null;var b=[],_=S[0],f=_.data[0],d=f===0?8:16,g=x(_,d);d+=4;var E=0,T=0;f===0?d+=8:d+=16,d+=2;var F=_.end+T,U=I(_,d);d+=2;for(var K=0;K<U;K++){var z=d,M=x(_,z);z+=4;var y=M&2147483647,W=(M&2147483648)>>>31;if(W===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var X=x(_,z);z+=4,b.push({referenceSize:y,subsegmentDuration:X,info:{duration:X/g,start:F,end:F+y-1}}),F+=y,z+=4,d=z}return{earliestPresentationTime:E,timescale:g,version:f,referencesCount:U,references:b,moovEndOffset:D}}function r(R){for(var w=[],C=m(R,["moov","trak"]),D=0;D<C.length;D++){var S=C[D],b=m(S,["tkhd"])[0];if(b){var _=b.data[b.start],f=_===0?12:20,d=x(b,f),g=m(S,["mdia","mdhd"])[0];if(g){_=g.data[g.start],f=_===0?12:20;var E=x(g,f),T=m(S,["mdia","hdlr"])[0];if(T){var F=O(T.data.subarray(T.start+8,T.start+12)),U={soun:L.ElementaryStreamTypes.AUDIO,vide:L.ElementaryStreamTypes.VIDEO}[F];if(U){var K=m(S,["mdia","minf","stbl","stsd"])[0],z=void 0;K&&(z=O(K.data.subarray(K.start+12,K.start+16))),w[d]={timescale:E,type:U},w[U]={timescale:E,id:d,codec:z}}}}}}var M=m(R,["moov","mvex","trex"]);return M.forEach(function(y){var W=x(y,4),X=w[W];X&&(X.default={duration:x(y,12),flags:x(y,20)})}),w}function n(R,w){return m(w,["moof","traf"]).reduce(function(C,D){var S=m(D,["tfdt"])[0],b=S.data[S.start],_=m(D,["tfhd"]).reduce(function(f,d){var g=x(d,4),E=R[g];if(E){var T=x(S,4);b===1&&(T*=Math.pow(2,32),T+=x(S,8));var F=E.timescale||9e4,U=T/F;if(isFinite(U)&&(f===null||U<f))return U}return f},null);return _!==null&&isFinite(_)&&(C===null||_<C)?_:C},null)||0}function a(R,w){for(var C=0,D=0,S=0,b=m(R,["moof","traf"]),_=0;_<b.length;_++){var f=b[_],d=m(f,["tfhd"])[0],g=x(d,4),E=w[g];if(!E)continue;var T=E.default,F=x(d,0)|(T==null?void 0:T.flags),U=T==null?void 0:T.duration;F&8&&(F&2?U=x(d,12):U=x(d,8));for(var K=E.timescale||9e4,z=m(f,["trun"]),M=0;M<z.length;M++){if(U){var y=x(z[M],4);C=U*y}else C=l(z[M]);E.type===L.ElementaryStreamTypes.VIDEO?D+=C/K:E.type===L.ElementaryStreamTypes.AUDIO&&(S+=C/K)}}if(D===0&&S===0){var W=h(R);if(W!=null&&W.references)return W.references.reduce(function(X,te){return X+te.info.duration||0},0)}return D||S}function l(R){var w=x(R,0),C=8;w&1&&(C+=4),w&4&&(C+=4);for(var D=0,S=x(R,4),b=0;b<S;b++){if(w&256){var _=x(R,C);D+=_,C+=4}w&512&&(C+=4),w&1024&&(C+=4),w&2048&&(C+=4)}return D}function s(R,w,C){m(w,["moof","traf"]).forEach(function(D){m(D,["tfhd"]).forEach(function(S){var b=x(S,4),_=R[b];if(!_)return;var f=_.timescale||9e4;m(D,["tfdt"]).forEach(function(d){var g=d.data[d.start],E=x(d,4);if(g===0)p(d,4,E-C*f);else{E*=Math.pow(2,32),E+=x(d,8),E-=C*f,E=Math.max(E,0);var T=Math.floor(E/(P+1)),F=Math.floor(E%(P+1));p(d,4,T),p(d,8,F)}})})})}function u(R){var w={valid:null,remainder:null},C=m(R,["moof"]);if(C){if(C.length<2)return w.remainder=R,w}else return w;var D=C[C.length-1];return w.valid=Object(G.sliceUint8)(R,0,D.start-8),w.remainder=Object(G.sliceUint8)(R,D.start-8),w}function c(R,w){var C=new Uint8Array(R.length+w.length);return C.set(R),C.set(w,R.length),C}},"./src/utils/output-filter.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"default",function(){return G});var G=function(){function L(H,O){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=H,this.trackName=O}var P=L.prototype;return P.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},P.newCue=function(O,I,x){(this.startTime===null||this.startTime>O)&&(this.startTime=O),this.endTime=I,this.screen=x,this.timelineController.createCaptionsTrack(this.trackName)},P.reset=function(){this.cueRanges=[]},L}()},"./src/utils/texttrack-utils.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"sendAddTrackEvent",function(){return L}),j.d(Y,"addCueToTrack",function(){return P}),j.d(Y,"clearCurrentCues",function(){return H}),j.d(Y,"removeCuesInRange",function(){return O}),j.d(Y,"getCuesInRange",function(){return x});var G=j("./src/utils/logger.ts");function L(p,m){var h;try{h=new Event("addtrack")}catch(r){h=document.createEvent("Event"),h.initEvent("addtrack",!1,!1)}h.track=p,m.dispatchEvent(h)}function P(p,m){var h=p.mode;if(h==="disabled"&&(p.mode="hidden"),p.cues&&!p.cues.getCueById(m.id))try{if(p.addCue(m),!p.cues.getCueById(m.id))throw new Error("addCue is failed for: "+m)}catch(n){G.logger.debug("[texttrack-utils]: "+n);var r=new self.TextTrackCue(m.startTime,m.endTime,m.text);r.id=m.id,p.addCue(r)}h==="disabled"&&(p.mode=h)}function H(p){var m=p.mode;if(m==="disabled"&&(p.mode="hidden"),p.cues)for(var h=p.cues.length;h--;)p.removeCue(p.cues[h]);m==="disabled"&&(p.mode=m)}function O(p,m,h){var r=p.mode;if(r==="disabled"&&(p.mode="hidden"),p.cues&&p.cues.length>0)for(var n=x(p.cues,m,h),a=0;a<n.length;a++)p.removeCue(n[a]);r==="disabled"&&(p.mode=r)}function I(p,m){if(m<p[0].startTime)return 0;var h=p.length-1;if(m>p[h].endTime)return-1;for(var r=0,n=h;r<=n;){var a=Math.floor((n+r)/2);if(m<p[a].startTime)n=a-1;else if(m>p[a].startTime&&r<h)r=a+1;else return a}return p[r].startTime-m<m-p[n].startTime?r:n}function x(p,m,h){var r=[],n=I(p,m);if(n>-1)for(var a=n,l=p.length;a<l;a++){var s=p[a];if(s.startTime>=m&&s.endTime<=h)r.push(s);else if(s.startTime>h)return r}return r}},"./src/utils/time-ranges.ts":function(re,Y,j){"use strict";j.r(Y);var G={toString:function(P){for(var H="",O=P.length,I=0;I<O;I++)H+="["+P.start(I).toFixed(3)+","+P.end(I).toFixed(3)+"]";return H}};Y.default=G},"./src/utils/timescale-conversion.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"toTimescaleFromBase",function(){return L}),j.d(Y,"toTimescaleFromScale",function(){return P}),j.d(Y,"toMsFromMpegTsClock",function(){return H}),j.d(Y,"toMpegTsClockFromTimescale",function(){return O});var G=9e4;function L(I,x,p,m){p===void 0&&(p=1),m===void 0&&(m=!1);var h=I*x*p;return m?Math.round(h):h}function P(I,x,p,m){return p===void 0&&(p=1),m===void 0&&(m=!1),L(I,x,1/p,m)}function H(I,x){return x===void 0&&(x=!1),L(I,1e3,1/G,x)}function O(I,x){return x===void 0&&(x=1),L(I,G,1/x)}},"./src/utils/typed-array.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"sliceUint8",function(){return G});function G(L,P,H){return Uint8Array.prototype.slice?L.slice(P,H):new Uint8Array(Array.prototype.slice.call(L,P,H))}},"./src/utils/vttcue.ts":function(re,Y,j){"use strict";j.r(Y),Y.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var G=["","lr","rl"],L=["start","middle","end","left","right"];function P(p,m){if(typeof m!="string")return!1;if(!Array.isArray(p))return!1;var h=m.toLowerCase();return~p.indexOf(h)?h:!1}function H(p){return P(G,p)}function O(p){return P(L,p)}function I(p){for(var m=arguments.length,h=new Array(m>1?m-1:0),r=1;r<m;r++)h[r-1]=arguments[r];for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var l in a)p[l]=a[l]}return p}function x(p,m,h){var r=this,n={enumerable:!0};r.hasBeenReset=!1;var a="",l=!1,s=p,u=m,c=h,R=null,w="",C=!0,D="auto",S="start",b=50,_="middle",f=50,d="middle";Object.defineProperty(r,"id",I({},n,{get:function(){return a},set:function(E){a=""+E}})),Object.defineProperty(r,"pauseOnExit",I({},n,{get:function(){return l},set:function(E){l=!!E}})),Object.defineProperty(r,"startTime",I({},n,{get:function(){return s},set:function(E){if(typeof E!="number")throw new TypeError("Start time must be set to a number.");s=E,this.hasBeenReset=!0}})),Object.defineProperty(r,"endTime",I({},n,{get:function(){return u},set:function(E){if(typeof E!="number")throw new TypeError("End time must be set to a number.");u=E,this.hasBeenReset=!0}})),Object.defineProperty(r,"text",I({},n,{get:function(){return c},set:function(E){c=""+E,this.hasBeenReset=!0}})),Object.defineProperty(r,"region",I({},n,{get:function(){return R},set:function(E){R=E,this.hasBeenReset=!0}})),Object.defineProperty(r,"vertical",I({},n,{get:function(){return w},set:function(E){var T=H(E);if(T===!1)throw new SyntaxError("An invalid or illegal string was specified.");w=T,this.hasBeenReset=!0}})),Object.defineProperty(r,"snapToLines",I({},n,{get:function(){return C},set:function(E){C=!!E,this.hasBeenReset=!0}})),Object.defineProperty(r,"line",I({},n,{get:function(){return D},set:function(E){if(typeof E!="number"&&E!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");D=E,this.hasBeenReset=!0}})),Object.defineProperty(r,"lineAlign",I({},n,{get:function(){return S},set:function(E){var T=O(E);if(!T)throw new SyntaxError("An invalid or illegal string was specified.");S=T,this.hasBeenReset=!0}})),Object.defineProperty(r,"position",I({},n,{get:function(){return b},set:function(E){if(E<0||E>100)throw new Error("Position must be between 0 and 100.");b=E,this.hasBeenReset=!0}})),Object.defineProperty(r,"positionAlign",I({},n,{get:function(){return _},set:function(E){var T=O(E);if(!T)throw new SyntaxError("An invalid or illegal string was specified.");_=T,this.hasBeenReset=!0}})),Object.defineProperty(r,"size",I({},n,{get:function(){return f},set:function(E){if(E<0||E>100)throw new Error("Size must be between 0 and 100.");f=E,this.hasBeenReset=!0}})),Object.defineProperty(r,"align",I({},n,{get:function(){return d},set:function(E){var T=O(E);if(!T)throw new SyntaxError("An invalid or illegal string was specified.");d=T,this.hasBeenReset=!0}})),r.displayState=void 0}return x.prototype.getCueAsHTML=function(){var p=self.WebVTT;return p.convertCueToDOMTree(self,this.text)},x}()},"./src/utils/vttparser.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"parseTimeStamp",function(){return P}),j.d(Y,"fixLineBreaks",function(){return m}),j.d(Y,"VTTParser",function(){return h});var G=j("./src/utils/vttcue.ts"),L=function(){function r(){}var n=r.prototype;return n.decode=function(l,s){if(!l)return"";if(typeof l!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(l))},r}();function P(r){function n(l,s,u,c){return(l|0)*3600+(s|0)*60+(u|0)+parseFloat(c||0)}var a=r.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return a?parseFloat(a[2])>59?n(a[2],a[3],0,a[4]):n(a[1],a[2],a[3],a[4]):null}var H=function(){function r(){this.values=Object.create(null)}var n=r.prototype;return n.set=function(l,s){!this.get(l)&&s!==""&&(this.values[l]=s)},n.get=function(l,s,u){return u?this.has(l)?this.values[l]:s[u]:this.has(l)?this.values[l]:s},n.has=function(l){return l in this.values},n.alt=function(l,s,u){for(var c=0;c<u.length;++c)if(s===u[c]){this.set(l,s);break}},n.integer=function(l,s){/^-?\d+$/.test(s)&&this.set(l,parseInt(s,10))},n.percent=function(l,s){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(s)){var u=parseFloat(s);if(u>=0&&u<=100)return this.set(l,u),!0}return!1},r}();function O(r,n,a,l){var s=l?r.split(l):[r];for(var u in s){if(typeof s[u]!="string")continue;var c=s[u].split(a);if(c.length!==2)continue;var R=c[0],w=c[1];n(R,w)}}var I=new G.default(0,0,""),x=I.align==="middle"?"middle":"center";function p(r,n,a){var l=r;function s(){var R=P(r);if(R===null)throw new Error("Malformed timestamp: "+l);return r=r.replace(/^[^\sa-zA-Z-]+/,""),R}function u(R,w){var C=new H;O(R,function(b,_){var f;switch(b){case"region":for(var d=a.length-1;d>=0;d--)if(a[d].id===_){C.set(b,a[d].region);break}break;case"vertical":C.alt(b,_,["rl","lr"]);break;case"line":f=_.split(","),C.integer(b,f[0]),C.percent(b,f[0])&&C.set("snapToLines",!1),C.alt(b,f[0],["auto"]),f.length===2&&C.alt("lineAlign",f[1],["start",x,"end"]);break;case"position":f=_.split(","),C.percent(b,f[0]),f.length===2&&C.alt("positionAlign",f[1],["start",x,"end","line-left","line-right","auto"]);break;case"size":C.percent(b,_);break;case"align":C.alt(b,_,["start",x,"end","left","right"]);break}},/:/,/\s/),w.region=C.get("region",null),w.vertical=C.get("vertical","");var D=C.get("line","auto");D==="auto"&&I.line===-1&&(D=-1),w.line=D,w.lineAlign=C.get("lineAlign","start"),w.snapToLines=C.get("snapToLines",!0),w.size=C.get("size",100),w.align=C.get("align",x);var S=C.get("position","auto");S==="auto"&&I.position===50&&(S=w.align==="start"||w.align==="left"?0:w.align==="end"||w.align==="right"?100:50),w.position=S}function c(){r=r.replace(/^\s+/,"")}if(c(),n.startTime=s(),c(),r.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+l);r=r.substr(3),c(),n.endTime=s(),c(),u(r,n)}function m(r){return r.replace(/<br(?: \/)?>/gi,`
`)}var h=function(){function r(){this.state="INITIAL",this.buffer="",this.decoder=new L,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var n=r.prototype;return n.parse=function(l){var s=this;l&&(s.buffer+=s.decoder.decode(l,{stream:!0}));function u(){var S=s.buffer,b=0;for(S=m(S);b<S.length&&S[b]!=="\r"&&S[b]!==`
`;)++b;var _=S.substr(0,b);return S[b]==="\r"&&++b,S[b]===`
`&&++b,s.buffer=S.substr(b),_}function c(S){O(S,function(b,_){},/:/)}try{var R="";if(s.state==="INITIAL"){if(!/\r\n|\n/.test(s.buffer))return this;R=u();var w=R.match(/^()?WEBVTT([ \t].*)?$/);if(!w||!w[0])throw new Error("Malformed WebVTT signature.");s.state="HEADER"}for(var C=!1;s.buffer;){if(!/\r\n|\n/.test(s.buffer))return this;C?C=!1:R=u();switch(s.state){case"HEADER":/:/.test(R)?c(R):R||(s.state="ID");continue;case"NOTE":R||(s.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(R)){s.state="NOTE";break}if(!R)continue;if(s.cue=new G.default(0,0,""),s.state="CUE",R.indexOf("-->")===-1){s.cue.id=R;continue}case"CUE":if(!s.cue){s.state="BADCUE";continue}try{p(R,s.cue,s.regionList)}catch(S){s.cue=null,s.state="BADCUE";continue}s.state="CUETEXT";continue;case"CUETEXT":{var D=R.indexOf("-->")!==-1;if(!R||D&&(C=!0)){s.oncue&&s.cue&&s.oncue(s.cue),s.cue=null,s.state="ID";continue}if(s.cue===null)continue;s.cue.text&&(s.cue.text+=`
`),s.cue.text+=R}continue;case"BADCUE":R||(s.state="ID")}}}catch(S){s.state==="CUETEXT"&&s.cue&&s.oncue&&s.oncue(s.cue),s.cue=null,s.state=s.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},n.flush=function(){var l=this;try{if((l.cue||l.state==="HEADER")&&(l.buffer+=`
`,l.parse()),l.state==="INITIAL"||l.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(s){l.onparsingerror&&l.onparsingerror(s)}return l.onflush&&l.onflush(),this},r}()},"./src/utils/webvtt-parser.ts":function(re,Y,j){"use strict";j.r(Y),j.d(Y,"generateCueId",function(){return h}),j.d(Y,"parseWebVTT",function(){return n});var G=j("./src/polyfills/number.ts"),L=j("./src/utils/vttparser.ts"),P=j("./src/demux/id3.ts"),H=j("./src/utils/timescale-conversion.ts"),O=j("./src/remux/mp4-remuxer.ts"),I=/\r\n|\n\r|\n|\r/g,x=function(l,s,u){return u===void 0&&(u=0),l.substr(u,s.length)===s},p=function(l){var s=parseInt(l.substr(-3)),u=parseInt(l.substr(-6,2)),c=parseInt(l.substr(-9,2)),R=l.length>9?parseInt(l.substr(0,l.indexOf(":"))):0;if(!Object(G.isFiniteNumber)(s)||!Object(G.isFiniteNumber)(u)||!Object(G.isFiniteNumber)(c)||!Object(G.isFiniteNumber)(R))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+l);return s+=1e3*u,s+=60*1e3*c,s+=60*60*1e3*R,s},m=function(l){for(var s=5381,u=l.length;u;)s=s*33^l.charCodeAt(--u);return(s>>>0).toString()};function h(a,l,s){return m(a.toString())+m(l.toString())+m(s)}var r=function(l,s,u){var c=l[s],R=l[c.prevCC];if(!R||!R.new&&c.new){l.ccOffset=l.presentationOffset=c.start,c.new=!1;return}for(;(w=R)!==null&&w!==void 0&&w.new;){var w;l.ccOffset+=c.start-R.start,c.new=!1,c=R,R=l[c.prevCC]}l.presentationOffset=u};function n(a,l,s,u,c,R,w,C){var D=new L.VTTParser,S=Object(P.utf8ArrayToStr)(new Uint8Array(a)).trim().replace(I,`
`).split(`
`),b=[],_=Object(H.toMpegTsClockFromTimescale)(l,s),f="00:00.000",d=0,g=0,E,T=!0,F=!1;D.oncue=function(U){var K=u[c],z=u.ccOffset,M=(d-_)/9e4;if(K!=null&&K.new&&(g!==void 0?z=u.ccOffset=K.start:r(u,c,M)),M&&(z=M-u.presentationOffset),F){var y=U.endTime-U.startTime,W=Object(O.normalizePts)((U.startTime+z-g)*9e4,R*9e4)/9e4;U.startTime=W,U.endTime=W+y}var X=U.text.trim();U.text=decodeURIComponent(encodeURIComponent(X)),U.id||(U.id=h(U.startTime,U.endTime,X)),U.endTime>0&&b.push(U)},D.onparsingerror=function(U){E=U},D.onflush=function(){if(E){C(E);return}w(b)},S.forEach(function(U){if(T)if(x(U,"X-TIMESTAMP-MAP=")){T=!1,F=!0,U.substr(16).split(",").forEach(function(K){x(K,"LOCAL:")?f=K.substr(6):x(K,"MPEGTS:")&&(d=parseInt(K.substr(7)))});try{g=p(f)/1e3}catch(K){F=!1,E=K}return}else U===""&&(T=!1);D.parse(U+`
`)}),D.flush()}},"./src/utils/xhr-loader.ts":function(re,Y,j){"use strict";j.r(Y);var G=j("./src/utils/logger.ts"),L=j("./src/loader/load-stats.ts"),P=/^age:\s*[\d.]+\s*$/m,H=function(){function O(x){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=x?x.xhrSetup:null,this.stats=new L.LoadStats,this.retryDelay=0}var I=O.prototype;return I.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},I.abortInternal=function(){var p=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),p&&(p.onreadystatechange=null,p.onprogress=null,p.readyState!==4&&(this.stats.aborted=!0,p.abort()))},I.abort=function(){var p;this.abortInternal(),(p=this.callbacks)!==null&&p!==void 0&&p.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},I.load=function(p,m,h){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=p,this.config=m,this.callbacks=h,this.retryDelay=m.retryDelay,this.loadInternal()},I.loadInternal=function(){var p=this.config,m=this.context;if(!p)return;var h=this.loader=new self.XMLHttpRequest,r=this.stats;r.loading.first=0,r.loaded=0;var n=this.xhrSetup;try{if(n)try{n(h,m.url)}catch(s){h.open("GET",m.url,!0),n(h,m.url)}h.readyState||h.open("GET",m.url,!0);var a=this.context.headers;if(a)for(var l in a)h.setRequestHeader(l,a[l])}catch(s){this.callbacks.onError({code:h.status,text:s.message},m,h);return}m.rangeEnd&&h.setRequestHeader("Range","bytes="+m.rangeStart+"-"+(m.rangeEnd-1)),h.onreadystatechange=this.readystatechange.bind(this),h.onprogress=this.loadprogress.bind(this),h.responseType=m.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),p.timeout),h.send()},I.readystatechange=function(){var p=this.context,m=this.loader,h=this.stats;if(!p||!m)return;var r=m.readyState,n=this.config;if(h.aborted)return;if(r>=2)if(self.clearTimeout(this.requestTimeout),h.loading.first===0&&(h.loading.first=Math.max(self.performance.now(),h.loading.start)),r===4){m.onreadystatechange=null,m.onprogress=null;var a=m.status;if(a>=200&&a<300){h.loading.end=Math.max(self.performance.now(),h.loading.first);var l,s;if(p.responseType==="arraybuffer"?(l=m.response,s=l.byteLength):(l=m.responseText,s=l.length),h.loaded=h.total=s,!this.callbacks)return;var u=this.callbacks.onProgress;if(u&&u(h,p,l,m),!this.callbacks)return;var c={url:m.responseURL,data:l};this.callbacks.onSuccess(c,h,p,m)}else h.retry>=n.maxRetry||a>=400&&a<499?(G.logger.error(a+" while loading "+p.url),this.callbacks.onError({code:a,text:m.statusText},p,m)):(G.logger.warn(a+" while loading "+p.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,n.maxRetryDelay),h.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout)},I.loadtimeout=function(){G.logger.warn("timeout while loading "+this.context.url);var p=this.callbacks;p&&(this.abortInternal(),p.onTimeout(this.stats,this.context,this.loader))},I.loadprogress=function(p){var m=this.stats;m.loaded=p.loaded,p.lengthComputable&&(m.total=p.total)},I.getCacheAge=function(){var p=null;if(this.loader&&P.test(this.loader.getAllResponseHeaders())){var m=this.loader.getResponseHeader("age");p=m?parseFloat(m):null}return p},O}();Y.default=H}}).default})},vHTk:function(Gt,et,k){Gt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(Gt,et,k){"use strict";k.d(et,"a",function(){return Bt});var re=k("rePB"),Y=k("VTBJ"),j=k("KQm4"),G=k("U8pU"),L=k("ODXe"),P=k("q1tI"),H=k("TSYQ"),O=k.n(H),I=k("Gytx"),x=k.n(I),p=k("Kwbf"),m=k("t23M"),h=k("qx4F"),r=k("6eGT"),n=k("IBYe"),a=k("Ff2n"),l=k("c+Xe"),s=k("fyJ8"),u=k("biw7");function c(it,Ze,bt,Mt,ct){var wt=bt[it]||{},Ve=bt[Ze]||{},Se,Pe;wt.fixed==="left"?Se=Mt.left[it]:Ve.fixed==="right"&&(Pe=Mt.right[Ze]);var ce=!1,de=!1,be=!1,je=!1,ze=bt[Ze+1],ut=bt[it-1];if(ct==="rtl"){if(Se!==void 0){var Dt=ut&&ut.fixed==="left";je=!Dt}else if(Pe!==void 0){var rn=ze&&ze.fixed==="right";be=!rn}}else if(Se!==void 0){var mn=ze&&ze.fixed==="left";ce=!mn}else if(Pe!==void 0){var gt=ut&&ut.fixed==="right";de=!gt}return{fixLeft:Se,fixRight:Pe,lastFixLeft:ce,firstFixRight:de,lastFixRight:be,firstFixLeft:je,isSticky:Mt.isSticky}}var R=k("sR1s");function w(it){var Ze=it.cells,bt=it.stickyOffsets,Mt=it.flattenColumns,ct=it.rowComponent,wt=it.cellComponent,Ve=it.onHeaderRow,Se=it.index,Pe=P.useContext(u.a),ce=Pe.prefixCls,de=Pe.direction,be;Ve&&(be=Ve(Ze.map(function(ze){return ze.column}),Se));var je=Object(R.a)(Ze.map(function(ze){return ze.column}));return P.createElement(ct,Object.assign({},be),Ze.map(function(ze,ut){var Dt=ze.column,rn=c(ze.colStart,ze.colEnd,Mt,bt,de),mn;return Dt&&Dt.onHeaderCell&&(mn=ze.column.onHeaderCell(Dt)),P.createElement(s.a,Object.assign({},ze,{ellipsis:Dt.ellipsis,align:Dt.align,component:wt,prefixCls:ce,key:je[ut]},rn,{additionalProps:mn,rowType:"header"}))}))}w.displayName="HeaderRow";var C=w;function D(it){var Ze=[];function bt(Ve,Se){var Pe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Ze[Pe]=Ze[Pe]||[];var ce=Se,de=Ve.filter(Boolean).map(function(be){var je={key:be.key,className:be.className||"",children:be.title,column:be,colStart:ce},ze=1,ut=be.children;return ut&&ut.length>0&&(ze=bt(ut,ce,Pe+1).reduce(function(Dt,rn){return Dt+rn},0),je.hasSubColumns=!0),"colSpan"in be&&(ze=be.colSpan),"rowSpan"in be&&(je.rowSpan=be.rowSpan),je.colSpan=ze,je.colEnd=je.colStart+ze-1,Ze[Pe].push(je),ce+=ze,ze});return de}bt(it,0);for(var Mt=Ze.length,ct=function(Se){Ze[Se].forEach(function(Pe){!("rowSpan"in Pe)&&!Pe.hasSubColumns&&(Pe.rowSpan=Mt-Se)})},wt=0;wt<Mt;wt+=1)ct(wt);return Ze}function S(it){var Ze=it.stickyOffsets,bt=it.columns,Mt=it.flattenColumns,ct=it.onHeaderRow,wt=P.useContext(u.a),Ve=wt.prefixCls,Se=wt.getComponent,Pe=P.useMemo(function(){return D(bt)},[bt]),ce=Se(["header","wrapper"],"thead"),de=Se(["header","row"],"tr"),be=Se(["header","cell"],"th");return P.createElement(ce,{className:"".concat(Ve,"-thead")},Pe.map(function(je,ze){var ut=P.createElement(C,{key:ze,flattenColumns:Mt,cells:je,stickyOffsets:Ze,rowComponent:de,cellComponent:be,onHeaderRow:ct,index:ze});return ut}))}var b=S,_=k("hW8S");function f(it){for(var Ze=it.colWidths,bt=it.columns,Mt=it.columCount,ct=[],wt=Mt||bt.length,Ve=!1,Se=wt-1;Se>=0;Se-=1){var Pe=Ze[Se],ce=bt&&bt[Se],de=ce&&ce[_.a];(Pe||de||Ve)&&(ct.unshift(P.createElement("col",Object.assign({key:Se,style:{width:Pe,minWidth:Pe}},de))),Ve=!0)}return P.createElement("colgroup",null,ct)}var d=f;function g(it,Ze){return Object(P.useMemo)(function(){for(var bt=[],Mt=0;Mt<Ze;Mt+=1){var ct=it[Mt];if(ct!==void 0)bt[Mt]=ct;else return null}return bt},[it.join("_"),Ze])}var E=P.forwardRef(function(it,Ze){var bt=it.noData,Mt=it.columns,ct=it.flattenColumns,wt=it.colWidths,Ve=it.columCount,Se=it.stickyOffsets,Pe=it.direction,ce=it.fixHeader,de=it.offsetHeader,be=it.stickyClassName,je=it.onScroll,ze=Object(a.a)(it,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),ut=P.useContext(u.a),Dt=ut.prefixCls,rn=ut.scrollbarSize,mn=ut.isSticky,gt=mn&&!ce?0:rn,Vt=P.useRef(null),Tt=P.useCallback(function(Qt){Object(l.b)(Ze,Qt),Object(l.b)(Vt,Qt)},[]);P.useEffect(function(){var Qt;function Jt(Le){var tt=Le.currentTarget,Lt=Le.deltaX;Lt&&(je({currentTarget:tt,scrollLeft:tt.scrollLeft+Lt}),Le.preventDefault())}return(Qt=Vt.current)===null||Qt===void 0||Qt.addEventListener("wheel",Jt),function(){var Le;(Le=Vt.current)===null||Le===void 0||Le.removeEventListener("wheel",Jt)}},[]);var Rt=ct[ct.length-1],mt={fixed:Rt?Rt.fixed:null,onHeaderCell:function(){return{className:"".concat(Dt,"-cell-scrollbar")}}},_e=Object(P.useMemo)(function(){return gt?[].concat(Object(j.a)(Mt),[mt]):Mt},[gt,Mt]),Ge=Object(P.useMemo)(function(){return gt?[].concat(Object(j.a)(ct),[mt]):ct},[gt,ct]),kt=Object(P.useMemo)(function(){var Qt=Se.right,Jt=Se.left;return Object(Y.a)(Object(Y.a)({},Se),{},{left:Pe==="rtl"?[].concat(Object(j.a)(Jt.map(function(Le){return Le+gt})),[0]):Jt,right:Pe==="rtl"?Qt:[].concat(Object(j.a)(Qt.map(function(Le){return Le+gt})),[0]),isSticky:mn})},[gt,Se,mn]),vt=g(wt,Ve);return P.createElement("div",{style:Object(Y.a)({overflow:"hidden"},mn?{top:de}:{}),ref:Tt,className:O()("".concat(Dt,"-header"),Object(re.a)({},be,!!be))},P.createElement("table",{style:{tableLayout:"fixed",visibility:bt||vt?null:"hidden"}},P.createElement(d,{colWidths:vt?[].concat(Object(j.a)(vt),[gt]):[],columCount:Ve+1,columns:Ge}),P.createElement(b,Object.assign({},ze,{stickyOffsets:kt,columns:_e,flattenColumns:Ge}))))});E.displayName="FixedHeader";var T=E,F=P.createContext(null),U=F;function K(it){var Ze=it.prefixCls,bt=it.children,Mt=it.component,ct=it.cellComponent,wt=it.fixHeader,Ve=it.fixColumn,Se=it.horizonScroll,Pe=it.className,ce=it.expanded,de=it.componentWidth,be=it.colSpan,je=P.useContext(u.a),ze=je.scrollbarSize;return P.useMemo(function(){var ut=bt;return Ve&&(ut=P.createElement("div",{style:{width:de-(wt?ze:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Ze,"-expanded-row-fixed")},ut)),P.createElement(Mt,{className:Pe,style:{display:ce?null:"none"}},P.createElement(s.a,{component:ct,prefixCls:Ze,colSpan:be},ut))},[bt,Mt,wt,Se,Pe,ce,de,be,ze])}var z=K;function M(it){var Ze=it.className,bt=it.style,Mt=it.record,ct=it.index,wt=it.rowKey,Ve=it.getRowKey,Se=it.rowExpandable,Pe=it.expandedKeys,ce=it.onRow,de=it.indent,be=de===void 0?0:de,je=it.rowComponent,ze=it.cellComponent,ut=it.childrenColumnName,Dt=P.useContext(u.a),rn=Dt.prefixCls,mn=Dt.fixedInfoList,gt=P.useContext(U),Vt=gt.fixHeader,Tt=gt.fixColumn,Rt=gt.horizonScroll,mt=gt.componentWidth,_e=gt.flattenColumns,Ge=gt.expandableType,kt=gt.expandRowByClick,vt=gt.onTriggerExpand,Qt=gt.rowClassName,Jt=gt.expandedRowClassName,Le=gt.indentSize,tt=gt.expandIcon,Lt=gt.expandedRowRender,Ht=gt.expandIconColumnIndex,ln=P.useState(!1),hn=Object(L.a)(ln,2),ir=hn[0],Un=hn[1],dn=Pe&&Pe.has(it.recordKey);P.useEffect(function(){dn&&Un(!0)},[dn]);var fr=Ge==="row"&&(!Se||Se(Mt)),Kr=Ge==="nest",tr=ut&&Mt&&Mt[ut],rr=fr||Kr,Nr;ce&&(Nr=ce(Mt,ct));var oi=function(A){if(kt&&rr&&vt(Mt,A),Nr&&Nr.onClick){for(var N,V=arguments.length,oe=new Array(V>1?V-1:0),q=1;q<V;q++)oe[q-1]=arguments[q];(N=Nr).onClick.apply(N,[A].concat(oe))}},hi;typeof Qt=="string"?hi=Qt:typeof Qt=="function"&&(hi=Qt(Mt,ct,be));var an=Object(R.a)(_e),Xn=P.createElement(je,Object.assign({},Nr,{"data-row-key":wt,className:O()(Ze,"".concat(rn,"-row"),"".concat(rn,"-row-level-").concat(be),hi,Nr&&Nr.className),style:Object(Y.a)(Object(Y.a)({},bt),Nr?Nr.style:null),onClick:oi}),_e.map(function(ee,A){var N=ee.render,V=ee.dataIndex,oe=ee.className,q=an[A],Je=mn[A],Kt;A===(Ht||0)&&Kr&&(Kt=P.createElement(P.Fragment,null,P.createElement("span",{style:{paddingLeft:"".concat(Le*be,"px")},className:"".concat(rn,"-row-indent indent-level-").concat(be)}),tt({prefixCls:rn,expanded:dn,expandable:tr,record:Mt,onExpand:vt})));var gn;return ee.onCell&&(gn=ee.onCell(Mt,ct)),P.createElement(s.a,Object.assign({className:oe,ellipsis:ee.ellipsis,align:ee.align,component:ze,prefixCls:rn,key:q,record:Mt,index:ct,dataIndex:V,render:N,shouldCellUpdate:ee.shouldCellUpdate},Je,{appendNode:Kt,additionalProps:gn}))})),fi;if(fr&&(ir||dn)){var Ei=Lt(Mt,ct,be+1,dn),ri=Jt&&Jt(Mt,ct,be);fi=P.createElement(z,{expanded:dn,className:O()("".concat(rn,"-expanded-row"),"".concat(rn,"-expanded-row-level-").concat(be+1),ri),prefixCls:rn,fixHeader:Vt,fixColumn:Tt,horizonScroll:Rt,component:je,componentWidth:mt,cellComponent:ze,colSpan:_e.length},Ei)}var ii;return tr&&dn&&(ii=(Mt[ut]||[]).map(function(ee,A){var N=Ve(ee,A);return P.createElement(M,Object.assign({},it,{key:N,rowKey:N,record:ee,recordKey:N,index:A,indent:be+1}))})),P.createElement(P.Fragment,null,Xn,fi,ii)}M.displayName="BodyRow";var y=M,W=P.createContext(null),X=W;function te(it){var Ze=it.columnKey,bt=it.onColumnResize,Mt=P.useRef();return P.useEffect(function(){Mt.current&&bt(Ze,Mt.current.offsetWidth)},[]),P.createElement(m.a,{onResize:function(wt){var Ve=wt.offsetWidth;bt(Ze,Ve)}},P.createElement("td",{ref:Mt,style:{padding:0,border:0,height:0}},P.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function pe(it){var Ze=it.data,bt=it.getRowKey,Mt=it.measureColumnWidth,ct=it.expandedKeys,wt=it.onRow,Ve=it.rowExpandable,Se=it.emptyNode,Pe=it.childrenColumnName,ce=P.useContext(X),de=ce.onColumnResize,be=P.useContext(u.a),je=be.prefixCls,ze=be.getComponent,ut=P.useContext(U),Dt=ut.fixHeader,rn=ut.horizonScroll,mn=ut.flattenColumns,gt=ut.componentWidth;return P.useMemo(function(){var Vt=ze(["body","wrapper"],"tbody"),Tt=ze(["body","row"],"tr"),Rt=ze(["body","cell"],"td"),mt;Ze.length?mt=Ze.map(function(Ge,kt){var vt=bt(Ge,kt);return P.createElement(y,{key:vt,rowKey:vt,record:Ge,recordKey:vt,index:kt,rowComponent:Tt,cellComponent:Rt,expandedKeys:ct,onRow:wt,getRowKey:bt,rowExpandable:Ve,childrenColumnName:Pe})}):mt=P.createElement(z,{expanded:!0,className:"".concat(je,"-placeholder"),prefixCls:je,fixHeader:Dt,fixColumn:rn,horizonScroll:rn,component:Tt,componentWidth:gt,cellComponent:Rt,colSpan:mn.length},Se);var _e=Object(R.a)(mn);return P.createElement(Vt,{className:"".concat(je,"-tbody")},Mt&&P.createElement("tr",{"aria-hidden":"true",className:"".concat(je,"-measure-row"),style:{height:0}},_e.map(function(Ge){return P.createElement(te,{key:Ge,columnKey:Ge,onColumnResize:de})})),mt)},[Ze,je,wt,Mt,ct,bt,ze,gt,Se,mn])}var Ie=P.memo(pe);Ie.displayName="Body";var Ee=Ie,Te=k("wRmb"),We=k("xEkU"),He=k.n(We);function Ce(it){var Ze=Object(P.useRef)(it),bt=Object(P.useState)({}),Mt=Object(L.a)(bt,2),ct=Mt[1],wt=Object(P.useRef)(null),Ve=Object(P.useRef)([]);function Se(Pe){wt.current===null&&(Ve.current=[],wt.current=He()(function(){Ve.current.forEach(function(ce){Ze.current=ce(Ze.current)}),wt.current=null,ct({})})),Ve.current.push(Pe)}return Object(P.useEffect)(function(){return function(){He.a.cancel(wt.current)}},[]),[Ze.current,Se]}function ue(it){var Ze=Object(P.useRef)(it),bt=Object(P.useRef)(null);function Mt(){window.clearTimeout(bt.current)}function ct(Ve){Ze.current=Ve,Mt(),bt.current=window.setTimeout(function(){Ze.current=null,bt.current=null},100)}function wt(){return Ze.current}return Object(P.useEffect)(function(){return Mt},[]),[ct,wt]}function se(it,Ze,bt){var Mt=Object(P.useMemo)(function(){for(var ct=[],wt=[],Ve=0,Se=0,Pe=0;Pe<Ze;Pe+=1)if(bt==="rtl"){wt[Pe]=Se,Se+=it[Pe]||0;var ce=Ze-Pe-1;ct[ce]=Ve,Ve+=it[ce]||0}else{ct[Pe]=Ve,Ve+=it[Pe]||0;var de=Ze-Pe-1;wt[de]=Se,Se+=it[de]||0}return{left:ct,right:wt}},[it,Ze,bt]);return Mt}var we=se;function ge(it){var Ze=it.className,bt=it.children;return P.createElement("div",{className:Ze},bt)}var Ke=ge,st=k("n6Qo");function ne(it){var Ze,bt=it.prefixCls,Mt=it.record,ct=it.onExpand,wt=it.expanded,Ve=it.expandable,Se="".concat(bt,"-row-expand-icon");if(!Ve)return P.createElement("span",{className:O()(Se,"".concat(bt,"-row-spaced"))});var Pe=function(de){ct(Mt,de),de.stopPropagation()};return P.createElement("span",{className:O()(Se,(Ze={},Object(re.a)(Ze,"".concat(bt,"-row-expanded"),wt),Object(re.a)(Ze,"".concat(bt,"-row-collapsed"),!wt),Ze)),onClick:Pe})}function $(it,Ze,bt){var Mt=[];function ct(wt){(wt||[]).forEach(function(Ve,Se){Mt.push(Ze(Ve,Se)),ct(Ve[bt])})}return ct(it),Mt}var J=k("zT1h"),me=k("y0+3"),xe=function(Ze,bt){var Mt,ct,wt=Ze.scrollBodyRef,Ve=Ze.onScroll,Se=Ze.offsetScroll,Pe=P.useContext(u.a),ce=Pe.prefixCls,de=((Mt=wt.current)===null||Mt===void 0?void 0:Mt.scrollWidth)||0,be=((ct=wt.current)===null||ct===void 0?void 0:ct.clientWidth)||0,je=de&&be*(be/de),ze=P.useRef(),ut=Ce({scrollLeft:0,isHiddenScrollBar:!1}),Dt=Object(L.a)(ut,2),rn=Dt[0],mn=Dt[1],gt=P.useRef({delta:0,x:0}),Vt=P.useState(!1),Tt=Object(L.a)(Vt,2),Rt=Tt[0],mt=Tt[1],_e=function(){mt(!1)},Ge=function(Le){Le.persist(),gt.current.delta=Le.pageX-rn.scrollLeft,gt.current.x=0,mt(!0),Le.preventDefault()},kt=function(Le){var tt,Lt=Le||((tt=window)===null||tt===void 0?void 0:tt.event),Ht=Lt.buttons;if(!Rt||Ht===0){Rt&&mt(!1);return}var ln=gt.current.x+Le.pageX-gt.current.x-gt.current.delta;ln<=0&&(ln=0),ln+je>=be&&(ln=be-je),Ve({scrollLeft:ln/be*(de+2)}),gt.current.x=Le.pageX},vt=function(){var Le=Object(me.b)(wt.current).top,tt=Le+wt.current.offsetHeight,Lt=document.documentElement.scrollTop+window.innerHeight;tt-Object(h.a)()<=Lt||Le>=Lt-Se?mn(function(Ht){return Object(Y.a)(Object(Y.a)({},Ht),{},{isHiddenScrollBar:!0})}):mn(function(Ht){return Object(Y.a)(Object(Y.a)({},Ht),{},{isHiddenScrollBar:!1})})},Qt=function(Le){mn(function(tt){return Object(Y.a)(Object(Y.a)({},tt),{},{scrollLeft:Le/de*be||0})})};return P.useImperativeHandle(bt,function(){return{setScrollLeft:Qt}}),P.useEffect(function(){var Jt=Object(J.a)(document.body,"mouseup",_e,!1),Le=Object(J.a)(document.body,"mousemove",kt,!1);return vt(),function(){Jt.remove(),Le.remove()}},[je,Rt]),P.useEffect(function(){var Jt=Object(J.a)(window,"scroll",vt,!1),Le=Object(J.a)(window,"resize",vt,!1);return function(){Jt.remove(),Le.remove()}},[]),P.useEffect(function(){rn.isHiddenScrollBar||mn(function(Jt){var Le,tt;return Object(Y.a)(Object(Y.a)({},Jt),{},{scrollLeft:wt.current.scrollLeft/((Le=wt.current)===null||Le===void 0?void 0:Le.scrollWidth)*((tt=wt.current)===null||tt===void 0?void 0:tt.clientWidth)})})},[rn.isHiddenScrollBar]),de<=be||!je||rn.isHiddenScrollBar?null:P.createElement("div",{style:{height:Object(h.a)(),width:be,bottom:Se},className:"".concat(ce,"-sticky-scroll")},P.createElement("div",{onMouseDown:Ge,ref:ze,className:O()("".concat(ce,"-sticky-scroll-bar"),Object(re.a)({},"".concat(ce,"-sticky-scroll-bar-active"),Rt)),style:{width:"".concat(je,"px"),transform:"translate3d(".concat(rn.scrollLeft,"px, 0, 0)")}}))},ke=P.forwardRef(xe);function $e(it,Ze){return P.useMemo(function(){var bt=!!it;return{isSticky:bt,stickyClassName:bt?"".concat(Ze,"-sticky-header"):"",offsetHeader:Object(G.a)(it)==="object"&&it.offsetHeader||0,offsetScroll:Object(G.a)(it)==="object"&&it.offsetScroll||0}},[it,Ze])}var Pt=[],Xt={},Bt="rc-table-internal-hook",lt=P.memo(function(it){var Ze=it.children;return Ze},function(it,Ze){return x()(it.props,Ze.props)?it.pingLeft!==Ze.pingLeft||it.pingRight!==Ze.pingRight:!1});function jt(it){var Ze,bt=it.prefixCls,Mt=it.className,ct=it.rowClassName,wt=it.style,Ve=it.data,Se=it.rowKey,Pe=it.scroll,ce=it.tableLayout,de=it.direction,be=it.title,je=it.footer,ze=it.summary,ut=it.id,Dt=it.showHeader,rn=it.components,mn=it.emptyText,gt=it.onRow,Vt=it.onHeaderRow,Tt=it.internalHooks,Rt=it.transformColumns,mt=it.internalRefs,_e=it.sticky,Ge=Ve||Pt,kt=!!Ge.length,vt=P.useState(0),Qt=Object(L.a)(vt,2),Jt=Qt[0],Le=Qt[1];P.useEffect(function(){Le(Object(h.a)())});var tt=P.useMemo(function(){return Object(R.c)(rn,{})},[rn]),Lt=P.useCallback(function(xn,Wt){return Object(R.b)(tt,xn)||Wt},[tt]),Ht=P.useMemo(function(){return typeof Se=="function"?Se:function(xn){var Wt=xn&&xn[Se];return Wt}},[Se]),ln=Object(_.c)(it),hn=ln.expandIcon,ir=ln.expandedRowKeys,Un=ln.defaultExpandedRowKeys,dn=ln.defaultExpandAllRows,fr=ln.expandedRowRender,Kr=ln.onExpand,tr=ln.onExpandedRowsChange,rr=ln.expandRowByClick,Nr=ln.rowExpandable,oi=ln.expandIconColumnIndex,hi=ln.expandedRowClassName,an=ln.childrenColumnName,Xn=ln.indentSize,fi=hn||ne,Ei=an||"children",ri=P.useMemo(function(){return fr?"row":it.expandable&&Tt===Bt&&it.expandable.__PARENT_RENDER_ICON__||Ge.some(function(xn){return xn&&Object(G.a)(xn)==="object"&&xn[Ei]})?"nest":!1},[!!fr,Ge]),ii=P.useState(function(){return Un||(dn?$(Ge,Ht,Ei):[])}),ee=Object(L.a)(ii,2),A=ee[0],N=ee[1],V=P.useMemo(function(){return new Set(ir||A||[])},[ir,A]),oe=P.useCallback(function(xn){var Wt=Ht(xn,Ge.indexOf(xn)),qt,Dn=V.has(Wt);Dn?(V.delete(Wt),qt=Object(j.a)(V)):qt=[].concat(Object(j.a)(V),[Wt]),N(qt),Kr&&Kr(!Dn,xn),tr&&tr(qt)},[Ht,V,Ge,Kr,tr]),q=P.useState(0),Je=Object(L.a)(q,2),Kt=Je[0],gn=Je[1],Bn=Object(Te.b)(Object(Y.a)(Object(Y.a)(Object(Y.a)({},it),ln),{},{expandable:!!fr,expandedKeys:V,getRowKey:Ht,onTriggerExpand:oe,expandIcon:fi,expandIconColumnIndex:oi,direction:de}),Tt===Bt?Rt:null),en=Object(L.a)(Bn,2),Gn=en[0],ar=en[1],Ur=P.useMemo(function(){return{columns:Gn,flattenColumns:ar}},[Gn,ar]),si=P.useRef(),Jr=P.useRef(),qr=P.useRef(),Ni=P.useState(!1),Qi=Object(L.a)(Ni,2),ai=Qi[0],Ri=Qi[1],Vi=P.useState(!1),Ui=Object(L.a)(Vi,2),pi=Ui[0],Ji=Ui[1],Mi=Ce(new Map),ea=Object(L.a)(Mi,2),la=ea[0],Nn=ea[1],Q=Object(R.a)(ar),ve=Q.map(function(xn){return la.get(xn)}),Ae=P.useMemo(function(){return ve},[ve.join("_")]),De=we(Ae,ar.length,de),at=Pe&&Object(R.d)(Pe.y),Be=Pe&&Object(R.d)(Pe.x),rt=Be&&ar.some(function(xn){var Wt=xn.fixed;return Wt}),ht=P.useRef(),Me=$e(_e,bt),ft=Me.isSticky,Ot=Me.offsetHeader,Ct=Me.offsetScroll,_t=Me.stickyClassName,Et,St,Fe;at&&(St={overflowY:"scroll",maxHeight:Pe.y}),Be&&(Et={overflowX:"auto"},at||(St={overflowY:"hidden"}),Fe={width:Pe.x===!0?"auto":Pe.x,minWidth:"100%"});var At=P.useCallback(function(xn,Wt){Nn(function(qt){var Dn=new Map(qt);return Dn.set(xn,Wt),Dn})},[]),Zt=ue(null),sn=Object(L.a)(Zt,2),On=sn[0],In=sn[1];function Ft(xn,Wt){if(!Wt)return;typeof Wt=="function"?Wt(xn):Wt.scrollLeft!==xn&&(Wt.scrollLeft=xn)}var $t=function(Wt){var qt=Wt.currentTarget,Dn=Wt.scrollLeft,bn=typeof Dn=="number"?Dn:qt.scrollLeft,er=qt||Xt;if(!In()||In()===er){var jr;On(er),Ft(bn,Jr.current),Ft(bn,qr.current),Ft(bn,(jr=ht.current)===null||jr===void 0?void 0:jr.setScrollLeft)}if(qt){var br=qt.scrollWidth,Gr=qt.clientWidth;Ri(bn>0),Ji(bn<br-Gr)}},Fn=function(){qr.current&&$t({currentTarget:qr.current})},Oe=function(Wt){var qt=Wt.width;Fn(),gn(si.current?si.current.offsetWidth:qt)};P.useEffect(function(){return Fn},[]),P.useEffect(function(){Be&&Fn()},[Be]),P.useEffect(function(){Tt===Bt&&mt&&(mt.body.current=qr.current)});var It=Lt(["table"],"table"),Ut=P.useMemo(function(){return ce||(rt?Pe.x==="max-content"?"auto":"fixed":at||ar.some(function(xn){var Wt=xn.ellipsis;return Wt})?"fixed":"auto")},[at,rt,ar,ce]),tn,un={colWidths:Ae,columCount:ar.length,stickyOffsets:De,onHeaderRow:Vt,fixHeader:at},Sn=P.useMemo(function(){return kt?null:typeof mn=="function"?mn():mn},[kt,mn]),An=P.createElement(Ee,{data:Ge,measureColumnWidth:at||Be||ft,expandedKeys:V,rowExpandable:Nr,getRowKey:Ht,onRow:gt,emptyNode:Sn,childrenColumnName:Ei}),$n=P.createElement(d,{colWidths:ar.map(function(xn){var Wt=xn.width;return Wt}),columns:ar}),pr=ze&&P.createElement(st.b,null,ze(Ge)),Tn=Lt(["body"]);if(at||ft){var jn;typeof Tn=="function"?(jn=Tn(Ge,{scrollbarSize:Jt,ref:qr,onScroll:$t}),un.colWidths=ar.map(function(xn,Wt){var qt=xn.width,Dn=Wt===Gn.length-1?qt-Jt:qt;return typeof Dn=="number"&&!Number.isNaN(Dn)?Dn:(Object(p.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):jn=P.createElement("div",{style:Object(Y.a)(Object(Y.a)({},Et),St),onScroll:$t,ref:qr,className:O()("".concat(bt,"-body"))},P.createElement(It,{style:Object(Y.a)(Object(Y.a)({},Fe),{},{tableLayout:Ut})},$n,An,pr),ft&&P.createElement(ke,{ref:ht,offsetScroll:Ct,scrollBodyRef:qr,onScroll:$t})),tn=P.createElement(P.Fragment,null,Dt!==!1&&P.createElement(T,Object.assign({noData:!Ge.length},un,Ur,{direction:de,offsetHeader:Ot,stickyClassName:_t,ref:Jr,onScroll:$t})),jn)}else tn=P.createElement("div",{style:Object(Y.a)(Object(Y.a)({},Et),St),className:O()("".concat(bt,"-content")),onScroll:$t,ref:qr},P.createElement(It,{style:Object(Y.a)(Object(Y.a)({},Fe),{},{tableLayout:Ut})},$n,Dt!==!1&&P.createElement(b,Object.assign({},un,Ur)),An,pr));var wn=Object(_.b)(it),fn=P.createElement("div",Object.assign({className:O()(bt,Mt,(Ze={},Object(re.a)(Ze,"".concat(bt,"-rtl"),de==="rtl"),Object(re.a)(Ze,"".concat(bt,"-ping-left"),ai),Object(re.a)(Ze,"".concat(bt,"-ping-right"),pi),Object(re.a)(Ze,"".concat(bt,"-layout-fixed"),ce==="fixed"),Object(re.a)(Ze,"".concat(bt,"-fixed-header"),at),Object(re.a)(Ze,"".concat(bt,"-fixed-column"),rt),Object(re.a)(Ze,"".concat(bt,"-scroll-horizontal"),Be),Object(re.a)(Ze,"".concat(bt,"-has-fix-left"),ar[0]&&ar[0].fixed),Object(re.a)(Ze,"".concat(bt,"-has-fix-right"),ar[ar.length-1]&&ar[ar.length-1].fixed==="right"),Ze)),style:wt,id:ut,ref:si},wn),P.createElement(lt,{pingLeft:ai,pingRight:pi,props:Object(Y.a)(Object(Y.a)({},it),{},{stickyOffsets:De,mergedExpandedKeys:V})},be&&P.createElement(Ke,{className:"".concat(bt,"-title")},be(Ge)),P.createElement("div",{className:"".concat(bt,"-container")},tn),je&&P.createElement(Ke,{className:"".concat(bt,"-footer")},je(Ge))));Be&&(fn=P.createElement(m.a,{onResize:Oe},fn));var Kn=P.useMemo(function(){return{prefixCls:bt,getComponent:Lt,scrollbarSize:Jt,direction:de,fixedInfoList:ar.map(function(xn,Wt){return c(Wt,Wt,ar,De,de)}),isSticky:ft}},[bt,Lt,Jt,de,ar,De,de,ft]),yr=P.useMemo(function(){return Object(Y.a)(Object(Y.a)({},Ur),{},{tableLayout:Ut,rowClassName:ct,expandedRowClassName:hi,componentWidth:Kt,fixHeader:at,fixColumn:rt,horizonScroll:Be,expandIcon:fi,expandableType:ri,expandRowByClick:rr,expandedRowRender:fr,onTriggerExpand:oe,expandIconColumnIndex:oi,indentSize:Xn})},[Ur,Ut,ct,hi,Kt,at,rt,Be,fi,ri,rr,fr,oe,oi,Xn]),hr=P.useMemo(function(){return{onColumnResize:At}},[At]);return P.createElement(u.a.Provider,{value:Kn},P.createElement(U.Provider,{value:yr},P.createElement(X.Provider,{value:hr},fn)))}jt.Column=n.a,jt.ColumnGroup=r.a,jt.Summary=st.a,jt.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var pn=et.b=jt},wRmb:function(Gt,et,k){"use strict";k.d(et,"a",function(){return x});var re=k("rePB"),Y=k("KQm4"),j=k("VTBJ"),G=k("Ff2n"),L=k("q1tI"),P=k.n(L),H=k("Kwbf"),O=k("Zm9Q"),I=k("hW8S");function x(n){return Object(O.a)(n).filter(function(a){return L.isValidElement(a)}).map(function(a){var l=a.key,s=a.props,u=s.children,c=Object(G.a)(s,["children"]),R=Object(j.a)({key:l},c);return u&&(R.children=x(u)),R})}function p(n){return n.reduce(function(a,l){var s=l.fixed,u=s===!0?"left":s,c=l.children;return c&&c.length>0?[].concat(Object(Y.a)(a),Object(Y.a)(p(c).map(function(R){return Object(j.a)({fixed:u},R)}))):[].concat(Object(Y.a)(a),[Object(j.a)(Object(j.a)({},l),{},{fixed:u})])},[])}function m(n){for(var a=!0,l=0;l<n.length;l+=1){var s=n[l];if(a&&s.fixed!=="left")a=!1;else if(!a&&s.fixed==="left"){Object(H.a)(!1,"Index ".concat(l-1," of `columns` missing `fixed='left'` prop."));break}}for(var u=!0,c=n.length-1;c>=0;c-=1){var R=n[c];if(u&&R.fixed!=="right")u=!1;else if(!u&&R.fixed==="right"){Object(H.a)(!1,"Index ".concat(c+1," of `columns` missing `fixed='right'` prop."));break}}}function h(n){return n.map(function(a){var l=a.fixed,s=Object(G.a)(a,["fixed"]),u=l;return l==="left"?u="right":l==="right"&&(u="left"),Object(j.a)({fixed:u},s)})}function r(n,a){var l=n.prefixCls,s=n.columns,u=n.children,c=n.expandable,R=n.expandedKeys,w=n.getRowKey,C=n.onTriggerExpand,D=n.expandIcon,S=n.rowExpandable,b=n.expandIconColumnIndex,_=n.direction,f=n.expandRowByClick,d=L.useMemo(function(){return s||x(u)},[s,u]),g=L.useMemo(function(){if(c){var F,U=b||0,K=d[U],z=(F={},Object(re.a)(F,I.a,{className:"".concat(l,"-expand-icon-col")}),Object(re.a)(F,"title",""),Object(re.a)(F,"fixed",K?K.fixed:null),Object(re.a)(F,"className","".concat(l,"-row-expand-icon-cell")),Object(re.a)(F,"render",function(W,X,te){var pe=w(X,te),Ie=R.has(pe),Ee=S?S(X):!0,Te=D({prefixCls:l,expanded:Ie,expandable:Ee,record:X,onExpand:C});return f?L.createElement("span",{onClick:function(He){return He.stopPropagation()}},Te):Te}),F),M=d.slice();return U>=0&&M.splice(U,0,z),M}return d},[c,d,w,R,D,_]),E=L.useMemo(function(){var F=g;return a&&(F=a(F)),F.length||(F=[{render:function(){return null}}]),F},[a,g,_]),T=L.useMemo(function(){return _==="rtl"?h(p(E)):p(E)},[E,_]);return[E,T]}et.b=r},wzkS:function(Gt,et,k){"use strict";k.d(et,"c",function(){return L}),k.d(et,"b",function(){return P}),k.d(et,"d",function(){return H}),k.d(et,"a",function(){return I}),k.d(et,"e",function(){return x});var re=k("9og8"),Y=k("WmNS"),j=k.n(Y),G=k("ErOA");function L(p){return Object(G.c)("libraries/".concat(p,".json"))}function P(){return Object(G.c)("library_tags.json")}function H(p){return O.apply(this,arguments)}function O(){return O=Object(re.a)(j.a.mark(function p(m){var h;return j.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Object(G.b)("attachments/".concat(m,".json"));case 2:return h=n.sent,n.abrupt("return",h.status===0);case 4:case"end":return n.stop()}},p)})),O.apply(this,arguments)}function I(p){return Object(G.f)("libraries.json",p)}function x(p,m){return Object(G.g)("libraries/".concat(p,".json"),m)}},xOL1:function(Gt,et){Gt.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAbVJREFUOE+Nk79rFUEUhb+zE4OFwUD+CyGKKQQbSaMikQQ7C1tBBIsUQaJvl2Fn/cWDpAiIYJsi7YOIaCUWFoKKRhG0sbEzEImFGnev7G6yyXsxeU5159yZb87l3hG9q2WLiBO79FIwXpLp0s6cwITnQCMWrGDM43jdBckZQ0wTMdrong2R2Bxm0/98sZ8ozdcOEm5hjOC41u9Olc9ZQKySclOVkNhljCmCzjeAJM/4FbW5p+8k5tlggTtarfKxLSM6pHq4BTiL0SboaAOIi284jeP1nti+ApMEvdoEvEPMkOpJDZi1IwzwgqDh/wSsYZwk08ca4O0Qua3zW8OV5crmHg6u22EGbQ2nIbx+1IC6rrK+cYJW9gXEVrbxGUEj5bltQGJvgBapHu0LSGwCyEh1vBsQWwd4TNCDPg6uAOcImuoFlL1dJ9WNPg5uYwwRVM3MzhJmKIpjZK6e9bj4jNNpvL4QFx9wuoDXJ1r5IlH0llTtXgcXwa4SolObnYnwKnbFcfEcdJ+gpW6AtzFynuIop/Fn053u4CA5yzjO4FV9tu0Syl2S38WiSWBgD8AfoEPQ7Fb+LwIiyhxWwe2KAAAAAElFTkSuQmCC"},"y0+3":function(Gt,et,k){"use strict";k.d(et,"a",function(){return p}),k.d(et,"b",function(){return h});var re=/margin|padding|width|height|max|min|offset/,Y={left:!0,top:!0},j={cssFloat:1,styleFloat:1,float:1};function G(r){return r.nodeType===1?r.ownerDocument.defaultView.getComputedStyle(r,null):{}}function L(r,n,a){if(n=n.toLowerCase(),a==="auto"){if(n==="height")return r.offsetHeight;if(n==="width")return r.offsetWidth}return n in Y||(Y[n]=re.test(n)),Y[n]?parseFloat(a)||0:a}function P(r,n){var a=arguments.length,l=G(r);return n=j[n]?"cssFloat"in r.style?"cssFloat":"styleFloat":n,a===1?l:L(r,n,l[n]||r.style[n])}function H(r,n,a){var l=arguments.length;if(n=j[n]?"cssFloat"in r.style?"cssFloat":"styleFloat":n,l===3)return typeof a=="number"&&re.test(n)&&(a="".concat(a,"px")),r.style[n]=a,a;for(var s in n)n.hasOwnProperty(s)&&H(r,s,n[s]);return G(r)}function O(r){return r===document.body?document.documentElement.clientWidth:r.offsetWidth}function I(r){return r===document.body?window.innerHeight||document.documentElement.clientHeight:r.offsetHeight}function x(){var r=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),n=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:r,height:n}}function p(){var r=document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight;return{width:r,height:n}}function m(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function h(r){var n=r.getBoundingClientRect(),a=document.documentElement;return{left:n.left+(window.pageXOffset||a.scrollLeft)-(a.clientLeft||document.body.clientLeft||0),top:n.top+(window.pageYOffset||a.scrollTop)-(a.clientTop||document.body.clientTop||0)}}},y5JW:function(Gt,et,k){"use strict";k.d(et,"c",function(){return a}),k.d(et,"a",function(){return l});var re=k("DZo9"),Y=k("8z0m"),j=k("+L6B"),G=k("2/Rp"),L=k("9og8"),P=k("miYZ"),H=k("tsqr"),O=k("k1fw"),I=k("oBTY"),x=k("WmNS"),p=k.n(x),m=k("q1tI"),h=k.n(m),r=k("m3rI"),n=k("wzkS"),a="\u3000\u3000";function l(s){var u=["Bytes","KB","MB","GB","TB"];if(s==0)return"0 Byte";var c=parseInt(""+Math.floor(Math.log(s)/Math.log(1024)),10);return(s/Math.pow(1024,c)).toFixed(1)+" "+u[c]}et.b=function(s){var u=s.value,c=u===void 0?[]:u,R=s.action,w=s.onChange,C=s.className,D=s.maxSize,S=D===void 0?150:D,b=s.title,_=b===void 0?"\u6587\u4EF6\u4E0A\u4F20":b,f=s.accept,d=f===void 0?null:f,g={multiple:!1,fileList:c,accept:d,withCredentials:!0,beforeUpload:function(F){var U=F.size/1024/1024;return!0},action:"".concat(r.a.API_SERVER,"/api/attachments.json"),onChange:function(F){var U,K,z=Object(I.a)(F.fileList);if(z=z.map(function(W){return W.name.indexOf(a)===-1&&(W.name="".concat(W.name).concat(a).concat(l(W.size))),Object(O.a)({},W)}),F.file.status==="done"&&((U=F.file)===null||U===void 0||((K=U.response)===null||K===void 0)?void 0:K.status)===-1){var M,y;H.b.error((M=F.file)===null||M===void 0||((y=M.response)===null||y===void 0)?void 0:y.message),w([]);return}w(z)},onRemove:function(){var T=Object(L.a)(p.a.mark(function U(K){var z,M,y;return p.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:if(z=K.size/1024/1024,!(K.status==="uploading")){X.next=3;break}return X.abrupt("return",!0);case 3:if(z<S){X.next=7;break}return X.abrupt("return",!0);case 7:if(M=K.response?K.response.id:K.uid,!M){X.next=15;break}return X.next=11,Object(n.d)(K.response?K.response.id:K.id);case 11:return y=X.sent,X.abrupt("return",y);case 15:return X.abrupt("return",!0);case 16:case"end":return X.stop()}},U)}));function F(U){return T.apply(this,arguments)}return F}()};function E(T){T.preventDefault(),T.stopPropagation()}return h.a.createElement("div",{className:"single-upload ".concat(C||"")},h.a.createElement(Y.a,g,h.a.createElement(G.a,{type:"primary",title:c.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:c.length>0,ghost:!0},_),h.a.createElement("span",{onClick:E,style:{marginLeft:10}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",S,"M)"," ")))}},yHk2:function(Gt,et,k){"use strict";var re=k("sRBo"),Y=k("kaz8"),j=k("giR+"),G=k("fyUT"),L=k("14J3"),P=k("BMrR"),H=k("5NDa"),O=k("5rEg"),I=k("y8nQ"),x=k("Vl3Y"),p=k("0Owb"),m=k("OaEy"),h=k("2fM7"),r=k("oBTY"),n=k("jCWc"),a=k("kPKH"),l=k("PpiC"),s=k("tJVT"),u=k("iQDF"),c=k("+eQT"),R=k("q1tI"),w=k.n(R),C=k("/MfK"),D=k("w5pM"),S=k("wd/R"),b=k.n(S),_=k("9kvl"),f=k("eozf"),d=c.a.RangePicker,g=function(T){var F=T.disabled,U=T.shixunHomeworks,K=T.selectOptions,z=T.form,M=T.data,y=U.workSetting,W=Object(R.useState)([]),X=Object(s.a)(W,2),te=X[0],pe=X[1],Ie=Object(R.useMemo)(function(){return K==null?void 0:K.filter(function(Te){return!te.includes(Te.value)})},[te,K]);Object(R.useEffect)(function(){var Te,We=(y==null||((Te=y.anonymous_comment_settings)===null||Te===void 0)?void 0:Te.filter(function(He){return He.evaluation_end}))||[];pe(We.map(function(He){return He.group_name}))},[y]);var Ee=function(We){var He,Ce=y==null||((He=y.anonymous_appeal_settings)===null||He===void 0)?void 0:He.find(function(ue){return ue.group_id===We});return M.anonymous_appeal&&Ce&&(Ce==null?void 0:Ce.appeal_time)!==null};return w.a.createElement(x.a.List,{name:"anonymous_comment_settings"},function(Te,We){var He=We.add,Ce=We.remove;return w.a.createElement(w.a.Fragment,null,Te.map(function(ue){var se,we,ge=ue.key,Ke=ue.name,st=Object(l.a)(ue,["key","name"]),ne=z.getFieldValue(["anonymous_comment_settings",Ke]),$=ne.deleteflag,J=b()((se=ne.evaluation_start)===null||se===void 0?void 0:se[0])<=b()(),me=!$&&J?[!0,Ee(ne==null?void 0:ne.group_id)]:[!1,!1];return w.a.createElement("div",{key:ge},w.a.createElement(P.a,{align:"top",style:{marginLeft:30,marginBottom:30}},w.a.createElement(a.a,null,"\u533F\u8BC4\u89C4\u5219",ge+1,"\uFF1A"),w.a.createElement(a.a,{flex:1},w.a.createElement(P.a,{align:"middle",style:{marginBottom:16}},w.a.createElement(a.a,{span:8},w.a.createElement(x.a.Item,Object(p.a)({},st,{name:[Ke,"group_name"]}),w.a.createElement(h.a,{mode:"multiple",disabled:F||!$,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",options:Ie||[],onSelect:function(ke){pe(function($e){return[].concat(Object(r.a)($e),[ke])})},onDeselect:function(ke){pe(function($e){return $e.filter(function(Pt){return Pt!==ke})})}}))),w.a.createElement(a.a,{className:"ml20"},w.a.createElement(x.a.Item,Object(p.a)({},st,{name:[Ke,"evaluation_start"]}),w.a.createElement(d,{ranges:{\u6B64\u523B:function(){var ke,$e=ne==null||((ke=ne.evaluation_start)===null||ke===void 0)?void 0:ke[0];return[$e?b()($e):b()(),b()()]}},disabled:F||me,allowClear:!1,disabledDate:function(ke){return Object(f.b)(ke,y==null?void 0:y.course_end_date)},disabledTime:function(ke){return Object(f.c)(ke)},showTime:{format:"HH:mm"},format:"YYYY-MM-DD HH:mm"}))),w.a.createElement(x.a.Item,Object(p.a)({},st,{name:[Ke,"deleteflag"]}),w.a.createElement(O.a,{type:"hidden"})),ge!==0&&!F&&$&&w.a.createElement(C.a,{className:"ml20",onClick:function(){var ke=z.getFieldValue(["anonymous_comment_settings",Ke,"group_name"])||[];pe(function($e){return $e.filter(function(Pt){return!ke.includes(Pt)})}),Ce(Ke)}}),!F&&Te.length<(y==null||((we=y.anonymous_comment_settings)===null||we===void 0)?void 0:we.length)&&w.a.createElement(D.a,{className:"c-green ml20",onClick:function(){He({deleteflag:!0})}})),w.a.createElement(P.a,{align:"middle"},w.a.createElement(a.a,{span:4},w.a.createElement(x.a.Item,Object(p.a)({},st,{label:"\u533F\u8BC4\u6570\u91CF",name:[Ke,"evaluation_num"]}),w.a.createElement(G.a,{min:0,disabled:F||!$&&J}))),w.a.createElement(a.a,{span:4},w.a.createElement(x.a.Item,Object(p.a)({},st,{label:"\u7F3A\u8BC4\u6263\u5206",name:[Ke,"absence_penalty"]}),w.a.createElement(G.a,{min:0,disabled:F}))),w.a.createElement(a.a,{className:"ml20"},w.a.createElement(x.a.Item,Object(p.a)({},st,{name:[Ke,"student_comment"],valuePropName:"checked"}),w.a.createElement(Y.a,{disabled:F}))),w.a.createElement(a.a,{className:"ml10"},"\u533F\u8BC4\u8BA1\u5165\u5DF2\u8BC4\u9605")))))}))})};et.a=Object(_.a)(function(E){var T=E.shixunHomeworks;return{shixunHomeworks:T}})(g)},zetH:function(Gt,et,k){Gt.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"}}}]);