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.
434 lines
1.4 MiB
434 lines
1.4 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[105,3,5,7,8,13],{"+92d":function(tn,Qe,I){tn.exports=I.p+"static/b1.8d46544a.svg"},"+NIl":function(tn,Qe,I){(function(te){te(I("VrN/"))})(function(te){"use strict";te.defineMode("stex",function(Y,N){"use strict";function K(d,s){d.cmdState.push(s)}function A(d){return d.cmdState.length>0?d.cmdState[d.cmdState.length-1]:null}function M(d){var s=d.cmdState.pop();s&&s.closeBracket()}function H(d){for(var s=d.cmdState,r=s.length-1;r>=0;r--){var u=s[r];if(u.name=="DEFAULT")continue;return u}return{styleIdentifier:function(){return null}}}function P(d,s,r){return function(){this.name=d,this.bracketNo=0,this.style=s,this.styles=r,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var k={};k.importmodule=P("importmodule","tag",["string","builtin"]),k.documentclass=P("documentclass","tag",["","atom"]),k.usepackage=P("usepackage","tag",["atom"]),k.begin=P("begin","tag",["atom"]),k.end=P("end","tag",["atom"]),k.label=P("label","tag",["atom"]),k.ref=P("ref","tag",["atom"]),k.eqref=P("eqref","tag",["atom"]),k.cite=P("cite","tag",["atom"]),k.bibitem=P("bibitem","tag",["atom"]),k.Bibitem=P("Bibitem","tag",["atom"]),k.RBibitem=P("RBibitem","tag",["atom"]),k.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function D(d,s){d.f=s}function b(d,s){var r;if(d.match(/^\\[a-zA-Z@]+/)){var u=d.current().slice(1);return r=k.hasOwnProperty(u)?k[u]:k.DEFAULT,r=new r,K(s,r),D(s,f),r.style}if(d.match(/^\\[$&%#{}_]/))return"tag";if(d.match(/^\\[,;!\/\\]/))return"tag";if(d.match("\\["))return D(s,function(a,n){return m(a,n,"\\]")}),"keyword";if(d.match("\\("))return D(s,function(a,n){return m(a,n,"\\)")}),"keyword";if(d.match("$$"))return D(s,function(a,n){return m(a,n,"$$")}),"keyword";if(d.match("$"))return D(s,function(a,n){return m(a,n,"$")}),"keyword";var o=d.next();if(o=="%")return d.skipToEnd(),"comment";if(o=="}"||o=="]"){if(r=A(s),r)r.closeBracket(o),D(s,f);else return"error";return"bracket"}else return o=="{"||o=="["?(r=k.DEFAULT,r=new r,K(s,r),"bracket"):/\d/.test(o)?(d.eatWhile(/[\w.%]/),"atom"):(d.eatWhile(/[\w\-_]/),r=H(s),r.name=="begin"&&(r.argument=d.current()),r.styleIdentifier())}function m(d,s,r){if(d.eatSpace())return null;if(r&&d.match(r))return D(s,b),"keyword";if(d.match(/^\\[a-zA-Z@]+/))return"tag";if(d.match(/^[a-zA-Z]+/))return"variable-2";if(d.match(/^\\[$&%#{}_]/))return"tag";if(d.match(/^\\[,;!\/]/))return"tag";if(d.match(/^[\^_&]/))return"tag";if(d.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(d.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var u=d.next();return u=="{"||u=="}"||u=="["||u=="]"||u=="("||u==")"?"bracket":u=="%"?(d.skipToEnd(),"comment"):"error"}function f(d,s){var r=d.peek(),u;return r=="{"||r=="["?(u=A(s),u.openBracket(r),d.eat(r),D(s,b),"bracket"):/[ \t\r]/.test(r)?(d.eat(r),null):(D(s,b),M(s),b(d,s))}return{startState:function(){var d=N.inMathMode?function(s,r){return m(s,r)}:b;return{cmdState:[],f:d}},copyState:function(d){return{cmdState:d.cmdState.slice(),f:d.f}},token:function(d,s){return s.f(d,s)},blankLine:function(d){d.f=b,d.cmdState.length=0},lineComment:"%"}}),te.defineMIME("text/x-stex","stex"),te.defineMIME("text/x-latex","stex")})},"+ua5":function(tn,Qe,I){},"19Vz":function(tn,Qe,I){(function(te){te(I("VrN/"))})(function(te){te.defineOption("placeholder","",function(P,k,D){var b=D&&D!=te.Init;if(k&&!b)P.on("blur",A),P.on("change",M),P.on("swapDoc",M),te.on(P.getInputField(),"compositionupdate",P.state.placeholderCompose=function(){K(P)}),M(P);else if(!k&&b){P.off("blur",A),P.off("change",M),P.off("swapDoc",M),te.off(P.getInputField(),"compositionupdate",P.state.placeholderCompose),Y(P);var m=P.getWrapperElement();m.className=m.className.replace(" CodeMirror-empty","")}k&&!P.hasFocus()&&A(P)});function Y(P){P.state.placeholder&&(P.state.placeholder.parentNode.removeChild(P.state.placeholder),P.state.placeholder=null)}function N(P){Y(P);var k=P.state.placeholder=document.createElement("pre");k.style.cssText="height: 0; overflow: visible",k.style.direction=P.getOption("direction"),k.className="CodeMirror-placeholder CodeMirror-line-like";var D=P.getOption("placeholder");typeof D=="string"&&(D=document.createTextNode(D)),k.appendChild(D),P.display.lineSpace.insertBefore(k,P.display.lineSpace.firstChild)}function K(P){setTimeout(function(){var k=!1,D=P.getInputField();D.nodeName=="TEXTAREA"?k=!D.value:P.lineCount()==1&&(k=!/[^\u200b]/.test(D.querySelector(".CodeMirror-line").textContent)),k?N(P):Y(P)},20)}function A(P){H(P)&&N(P)}function M(P){var k=P.getWrapperElement(),D=H(P);k.className=k.className.replace(" CodeMirror-empty","")+(D?" CodeMirror-empty":""),D?N(P):Y(P)}function H(P){return P.lineCount()===1&&P.getLine(0)===""}})},"1ZF9":function(tn,Qe,I){tn.exports=I.p+"static/Authorize.cc9c212f.png"},"1eCo":function(tn,Qe,I){(function(te){te(I("VrN/"))})(function(te){"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},N={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};te.defineMode("xml",function(K,A){var M=K.indentUnit,H={},P=A.htmlMode?Y:N;for(var k in P)H[k]=P[k];for(var k in A)H[k]=A[k];var D,b;function m(c,v){function p(F){return v.tokenize=F,F(c,v)}var E=c.next();if(E=="<")return c.eat("!")?c.eat("[")?c.match("CDATA[")?p(s("atom","]]>")):null:c.match("--")?p(s("comment","-->")):c.match("DOCTYPE",!0,!0)?(c.eatWhile(/[\w\._\-]/),p(r(1))):null:c.eat("?")?(c.eatWhile(/[\w\._\-]/),v.tokenize=s("meta","?>"),"meta"):(D=c.eat("/")?"closeTag":"openTag",v.tokenize=f,"tag bracket");if(E=="&"){var U;return c.eat("#")?c.eat("x")?U=c.eatWhile(/[a-fA-F\d]/)&&c.eat(";"):U=c.eatWhile(/[\d]/)&&c.eat(";"):U=c.eatWhile(/[\w\.\-:]/)&&c.eat(";"),U?"atom":"error"}else return c.eatWhile(/[^&<]/),null}m.isInText=!0;function f(c,v){var p=c.next();if(p==">"||p=="/"&&c.eat(">"))return v.tokenize=m,D=p==">"?"endTag":"selfcloseTag","tag bracket";if(p=="=")return D="equals",null;if(p=="<"){v.tokenize=m,v.state=n,v.tagName=v.tagStart=null;var E=v.tokenize(c,v);return E?E+" tag error":"tag error"}else return/[\'\"]/.test(p)?(v.tokenize=d(p),v.stringStartCol=c.column(),v.tokenize(c,v)):(c.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function d(c){var v=function(p,E){for(;!p.eol();)if(p.next()==c){E.tokenize=f;break}return"string"};return v.isInAttribute=!0,v}function s(c,v){return function(p,E){for(;!p.eol();){if(p.match(v)){E.tokenize=m;break}p.next()}return c}}function r(c){return function(v,p){for(var E;(E=v.next())!=null;){if(E=="<")return p.tokenize=r(c+1),p.tokenize(v,p);if(E==">")if(c==1){p.tokenize=m;break}else return p.tokenize=r(c-1),p.tokenize(v,p)}return"meta"}}function u(c,v,p){this.prev=c.context,this.tagName=v,this.indent=c.indented,this.startOfLine=p,(H.doNotIndent.hasOwnProperty(v)||c.context&&c.context.noIndent)&&(this.noIndent=!0)}function o(c){c.context&&(c.context=c.context.prev)}function a(c,v){for(var p;;){if(!c.context)return;if(p=c.context.tagName,!H.contextGrabbers.hasOwnProperty(p)||!H.contextGrabbers[p].hasOwnProperty(v))return;o(c)}}function n(c,v,p){return c=="openTag"?(p.tagStart=v.column(),R):c=="closeTag"?w:n}function R(c,v,p){return c=="word"?(p.tagName=v.current(),b="tag",C):H.allowMissingTagName&&c=="endTag"?(b="tag bracket",C(c,v,p)):(b="error",R)}function w(c,v,p){if(c=="word"){var E=v.current();return p.context&&p.context.tagName!=E&&H.implicitlyClosed.hasOwnProperty(p.context.tagName)&&o(p),p.context&&p.context.tagName==E||H.matchClosing===!1?(b="tag",x):(b="tag error",O)}else return H.allowMissingTagName&&c=="endTag"?(b="tag bracket",x(c,v,p)):(b="error",O)}function x(c,v,p){return c!="endTag"?(b="error",x):(o(p),n)}function O(c,v,p){return b="error",x(c,v,p)}function C(c,v,p){if(c=="word")return b="attribute",_;if(c=="endTag"||c=="selfcloseTag"){var E=p.tagName,U=p.tagStart;return p.tagName=p.tagStart=null,c=="selfcloseTag"||H.autoSelfClosers.hasOwnProperty(E)?a(p,E):(a(p,E),p.context=new u(p,E,U==p.indented)),n}return b="error",C}function _(c,v,p){return c=="equals"?y:(H.allowMissing||(b="error"),C(c,v,p))}function y(c,v,p){return c=="string"?h:c=="word"&&H.allowUnquoted?(b="string",C):(b="error",C(c,v,p))}function h(c,v,p){return c=="string"?h:C(c,v,p)}return{startState:function(c){var v={tokenize:m,state:n,indented:c||0,tagName:null,tagStart:null,context:null};return c!=null&&(v.baseIndent=c),v},token:function(c,v){if(!v.tagName&&c.sol()&&(v.indented=c.indentation()),c.eatSpace())return null;D=null;var p=v.tokenize(c,v);return(p||D)&&p!="comment"&&(b=null,v.state=v.state(D||p,c,v),b&&(p=b=="error"?p+" error":b)),p},indent:function(c,v,p){var E=c.context;if(c.tokenize.isInAttribute)return c.tagStart==c.indented?c.stringStartCol+1:c.indented+M;if(E&&E.noIndent)return te.Pass;if(c.tokenize!=f&&c.tokenize!=m)return p?p.match(/^(\s*)/)[0].length:0;if(c.tagName)return H.multilineTagIndentPastTag!==!1?c.tagStart+c.tagName.length+2:c.tagStart+M*(H.multilineTagIndentFactor||1);if(H.alignCDATA&&/<!\[CDATA\[/.test(v))return 0;var U=v&&/^<(\/)?([\w_:\.-]*)/.exec(v);if(U&&U[1])for(;E;)if(E.tagName==U[2]){E=E.prev;break}else if(H.implicitlyClosed.hasOwnProperty(E.tagName))E=E.prev;else break;else if(U)for(;E;){var F=H.contextGrabbers[E.tagName];if(F&&F.hasOwnProperty(U[2]))E=E.prev;else break}for(;E&&E.prev&&!E.startOfLine;)E=E.prev;return E?E.indent+M:c.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:H.htmlMode?"html":"xml",helperType:H.htmlMode?"html":"xml",skipAttribute:function(c){c.state==y&&(c.state=C)},xmlCurrentTag:function(c){return c.tagName?{name:c.tagName,close:c.type=="closeTag"}:null},xmlCurrentContext:function(c){for(var v=[],p=c.context;p;p=p.prev)p.tagName&&v.push(p.tagName);return v.reverse()}}}),te.defineMIME("text/xml","xml"),te.defineMIME("application/xml","xml"),te.mimeModes.hasOwnProperty("text/html")||te.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(tn,Qe,I){"use strict";I.d(Qe,"d",function(){return An}),I.d(Qe,"b",function(){return me}),I.d(Qe,"c",function(){return Tt}),I.d(Qe,"a",function(){return En});var te=I("VTBJ"),Y=I("1OyB"),N=I("vuIU"),K=I("JX7q"),A=I("Ji7U"),M=I("LK+K"),H=I("q1tI"),P=I("I8Z2"),k=I("BGR+"),D=I("wx14"),b=I("rePB"),m=I("4IlW"),f=I("2GS6"),d=I("Gytx"),s=I.n(d),r=I("TSYQ"),u=I.n(r),o=I("U8pU"),a=I("ODXe"),n=/iPhone/i,R=/iPod/i,w=/iPad/i,x=/\bAndroid(?:.+)Mobile\b/i,O=/Android/i,C=/\bAndroid(?:.+)SD4930UR\b/i,_=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,y=/Windows Phone/i,h=/\bWindows(?:.+)ARM\b/i,c=/BlackBerry/i,v=/BB10/i,p=/Opera Mini/i,E=/\b(CriOS|Chrome)(?:.+)Mobile/i,U=/Mobile(?:.+)Firefox\b/i;function F(Qt,gt){return Qt.test(gt)}function z(Qt){var gt=Qt||(typeof navigator!="undefined"?navigator.userAgent:""),yt=gt.split("[FBAN");if(typeof yt[1]!="undefined"){var rt=yt,ce=Object(a.a)(rt,1);gt=ce[0]}if(yt=gt.split("Twitter"),typeof yt[1]!="undefined"){var Re=yt,At=Object(a.a)(Re,1);gt=At[0]}var ot={apple:{phone:F(n,gt)&&!F(y,gt),ipod:F(R,gt),tablet:!F(n,gt)&&F(w,gt)&&!F(y,gt),device:(F(n,gt)||F(R,gt)||F(w,gt))&&!F(y,gt)},amazon:{phone:F(C,gt),tablet:!F(C,gt)&&F(_,gt),device:F(C,gt)||F(_,gt)},android:{phone:!F(y,gt)&&F(C,gt)||!F(y,gt)&&F(x,gt),tablet:!F(y,gt)&&!F(C,gt)&&!F(x,gt)&&(F(_,gt)||F(O,gt)),device:!F(y,gt)&&(F(C,gt)||F(_,gt)||F(x,gt)||F(O,gt))||F(/\bokhttp\b/i,gt)},windows:{phone:F(y,gt),tablet:F(h,gt),device:F(y,gt)||F(h,gt)},other:{blackberry:F(c,gt),blackberry10:F(v,gt),opera:F(p,gt),firefox:F(U,gt),chrome:F(E,gt),device:F(c,gt)||F(v,gt)||F(p,gt)||F(U,gt)||F(E,gt)},any:null,phone:null,tablet:null};return ot.any=ot.apple.device||ot.android.device||ot.windows.device||ot.other.device,ot.phone=ot.apple.phone||ot.android.phone||ot.windows.phone,ot.tablet=ot.apple.tablet||ot.android.tablet||ot.windows.tablet,ot}var G=Object(te.a)(Object(te.a)({},z()),{},{isMobile:z}),B=G;function T(){}function V(Qt,gt,yt){var rt=gt||"";return Qt.key||"".concat(rt,"item_").concat(yt)}function Z(Qt){return"".concat(Qt,"-menu-")}function oe(Qt,gt){var yt=-1;H.Children.forEach(Qt,function(rt){yt+=1,rt&&rt.type&&rt.type.isMenuItemGroup?H.Children.forEach(rt.props.children,function(ce){yt+=1,gt(ce,yt)}):gt(rt,yt)})}function pe(Qt,gt,yt){if(!Qt||yt.find)return;H.Children.forEach(Qt,function(rt){if(rt){var ce=rt.type;if(!ce||!(ce.isSubMenu||ce.isMenuItem||ce.isMenuItemGroup))return;gt.indexOf(rt.key)!==-1?yt.find=!0:rt.props.children&&pe(rt.props.children,gt,yt)}})}var Ye=["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(gt){var yt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,rt=gt&&typeof gt.getBoundingClientRect=="function"&>.getBoundingClientRect().width;if(rt){if(yt){var ce=getComputedStyle(gt),Re=ce.marginLeft,At=ce.marginRight;rt+=+Re.replace("px","")+ +At.replace("px","")}rt=+rt.toFixed(6)}return rt||0},Ie=function(gt,yt,rt){gt&&Object(o.a)(gt.style)==="object"&&(gt.style[yt]=rt)},Je=function(){return B.any},Ke=I("KQm4"),be=I("Ff2n"),de=I("i8i4"),nt=I("bdgK"),Kt=I("uciX"),jt=I("8XRh"),wt={adjustX:1,adjustY:1},ze={topLeft:{points:["bl","tl"],overflow:wt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:wt,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:wt,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:wt,offset:[4,0]}},ft={topLeft:{points:["bl","tl"],overflow:wt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:wt,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:wt,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:wt,offset:[4,0]}},dt=ze,Nt=0,Ze={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Bt=function(gt,yt,rt){var ce=Z(yt),Re=gt.getState();gt.setState({defaultActiveFirst:Object(te.a)(Object(te.a)({},Re.defaultActiveFirst),{},Object(b.a)({},ce,rt))})},Ut=function(Qt){Object(A.a)(yt,Qt);var gt=Object(M.a)(yt);function yt(rt){var ce;Object(Y.a)(this,yt),ce=gt.call(this,rt),ce.onDestroy=function(_e){ce.props.onDestroy(_e)},ce.onKeyDown=function(_e){var Ne=_e.keyCode,xt=ce.menuInstance,Xt=ce.props,vn=Xt.isOpen,Mn=Xt.store;if(Ne===m.a.ENTER)return ce.onTitleClick(_e),Bt(Mn,ce.props.eventKey,!0),!0;if(Ne===m.a.RIGHT)return vn?xt.onKeyDown(_e):(ce.triggerOpenChange(!0),Bt(Mn,ce.props.eventKey,!0)),!0;if(Ne===m.a.LEFT){var ci;if(vn)ci=xt.onKeyDown(_e);else return;return ci||(ce.triggerOpenChange(!1),ci=!0),ci}return vn&&(Ne===m.a.UP||Ne===m.a.DOWN)?xt.onKeyDown(_e):void 0},ce.onOpenChange=function(_e){ce.props.onOpenChange(_e)},ce.onPopupVisibleChange=function(_e){ce.triggerOpenChange(_e,_e?"mouseenter":"mouseleave")},ce.onMouseEnter=function(_e){var Ne=ce.props,xt=Ne.eventKey,Xt=Ne.onMouseEnter,vn=Ne.store;Bt(vn,ce.props.eventKey,!1),Xt({key:xt,domEvent:_e})},ce.onMouseLeave=function(_e){var Ne=ce.props,xt=Ne.parentMenu,Xt=Ne.eventKey,vn=Ne.onMouseLeave;xt.subMenuInstance=Object(K.a)(ce),vn({key:Xt,domEvent:_e})},ce.onTitleMouseEnter=function(_e){var Ne=ce.props,xt=Ne.eventKey,Xt=Ne.onItemHover,vn=Ne.onTitleMouseEnter;Xt({key:xt,hover:!0}),vn({key:xt,domEvent:_e})},ce.onTitleMouseLeave=function(_e){var Ne=ce.props,xt=Ne.parentMenu,Xt=Ne.eventKey,vn=Ne.onItemHover,Mn=Ne.onTitleMouseLeave;xt.subMenuInstance=Object(K.a)(ce),vn({key:Xt,hover:!1}),Mn({key:Xt,domEvent:_e})},ce.onTitleClick=function(_e){var Ne=Object(K.a)(ce),xt=Ne.props;if(xt.onTitleClick({key:xt.eventKey,domEvent:_e}),xt.triggerSubMenuAction==="hover")return;ce.triggerOpenChange(!xt.isOpen,"click"),Bt(xt.store,ce.props.eventKey,!1)},ce.onSubMenuClick=function(_e){typeof ce.props.onClick=="function"&&ce.props.onClick(ce.addKeyPath(_e))},ce.onSelect=function(_e){ce.props.onSelect(_e)},ce.onDeselect=function(_e){ce.props.onDeselect(_e)},ce.getPrefixCls=function(){return"".concat(ce.props.rootPrefixCls,"-submenu")},ce.getActiveClassName=function(){return"".concat(ce.getPrefixCls(),"-active")},ce.getDisabledClassName=function(){return"".concat(ce.getPrefixCls(),"-disabled")},ce.getSelectedClassName=function(){return"".concat(ce.getPrefixCls(),"-selected")},ce.getOpenClassName=function(){return"".concat(ce.props.rootPrefixCls,"-submenu-open")},ce.saveMenuInstance=function(_e){ce.menuInstance=_e},ce.addKeyPath=function(_e){return Object(te.a)(Object(te.a)({},_e),{},{keyPath:(_e.keyPath||[]).concat(ce.props.eventKey)})},ce.triggerOpenChange=function(_e,Ne){var xt=ce.props.eventKey,Xt=function(){ce.onOpenChange({key:xt,item:Object(K.a)(ce),trigger:Ne,open:_e})};Ne==="mouseenter"?ce.mouseenterTimeout=setTimeout(function(){Xt()},0):Xt()},ce.isChildrenSelected=function(){var _e={find:!1};return pe(ce.props.children,ce.props.selectedKeys,_e),_e.find},ce.isOpen=function(){return ce.props.openKeys.indexOf(ce.props.eventKey)!==-1},ce.adjustWidth=function(){if(!ce.subMenuTitle||!ce.menuInstance)return;var _e=de.findDOMNode(ce.menuInstance);if(_e.offsetWidth>=ce.subMenuTitle.offsetWidth)return;_e.style.minWidth="".concat(ce.subMenuTitle.offsetWidth,"px")},ce.saveSubMenuTitle=function(_e){ce.subMenuTitle=_e},ce.getBaseProps=function(){var _e=Object(K.a)(ce),Ne=_e.props;return{mode:Ne.mode==="horizontal"?"vertical":Ne.mode,visible:ce.props.isOpen,level:Ne.level+1,inlineIndent:Ne.inlineIndent,focusable:!1,onClick:ce.onSubMenuClick,onSelect:ce.onSelect,onDeselect:ce.onDeselect,onDestroy:ce.onDestroy,selectedKeys:Ne.selectedKeys,eventKey:"".concat(Ne.eventKey,"-menu-"),openKeys:Ne.openKeys,motion:Ne.motion,onOpenChange:ce.onOpenChange,subMenuOpenDelay:Ne.subMenuOpenDelay,parentMenu:Object(K.a)(ce),subMenuCloseDelay:Ne.subMenuCloseDelay,forceSubMenuRender:Ne.forceSubMenuRender,triggerSubMenuAction:Ne.triggerSubMenuAction,builtinPlacements:Ne.builtinPlacements,defaultActiveFirst:Ne.store.getState().defaultActiveFirst[Z(Ne.eventKey)],multiple:Ne.multiple,prefixCls:Ne.rootPrefixCls,id:ce.internalMenuId,manualRef:ce.saveMenuInstance,itemIcon:Ne.itemIcon,expandIcon:Ne.expandIcon,direction:Ne.direction}},ce.getMotion=function(_e,Ne){var xt=Object(K.a)(ce),Xt=xt.haveRendered,vn=ce.props,Mn=vn.motion,ci=vn.rootPrefixCls,$n=Object(te.a)(Object(te.a)({},Mn),{},{leavedClassName:"".concat(ci,"-hidden"),removeOnLeave:!1,motionAppear:Xt||!Ne||_e!=="inline"});return $n};var Re=rt.store,At=rt.eventKey,ot=Re.getState(),Yt=ot.defaultActiveFirst;ce.isRootMenu=!1;var rn=!1;return Yt&&(rn=Yt[At]),Bt(Re,At,rn),ce}return Object(N.a)(yt,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ce=this,Re=this.props,At=Re.mode,ot=Re.parentMenu,Yt=Re.manualRef;if(Yt&&Yt(this),At!=="horizontal"||!ot.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return ce.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var ce=this.props,Re=ce.onDestroy,At=ce.eventKey;Re&&Re(At),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(ce){var Re=this,At=this.getBaseProps(),ot=this.getMotion(At.mode,At.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||At.visible||At.forceSubMenuRender,!this.haveOpened)return H.createElement("div",null);var Yt=At.direction;return H.createElement(jt.default,Object.assign({visible:At.visible},ot),function(rn){var _e=rn.className,Ne=rn.style,xt=u()("".concat(At.prefixCls,"-sub"),_e,Object(b.a)({},"".concat(At.prefixCls,"-rtl"),Yt==="rtl"));return H.createElement(Ae,Object.assign({},At,{id:Re.internalMenuId,className:xt,style:Ne}),ce)})}},{key:"render",value:function(){var ce,Re=Object(te.a)({},this.props),At=Re.isOpen,ot=this.getPrefixCls(),Yt=Re.mode==="inline",rn=u()(ot,"".concat(ot,"-").concat(Re.mode),(ce={},Object(b.a)(ce,Re.className,!!Re.className),Object(b.a)(ce,this.getOpenClassName(),At),Object(b.a)(ce,this.getActiveClassName(),Re.active||At&&!Yt),Object(b.a)(ce,this.getDisabledClassName(),Re.disabled),Object(b.a)(ce,this.getSelectedClassName(),this.isChildrenSelected()),ce));this.internalMenuId||(Re.eventKey?this.internalMenuId="".concat(Re.eventKey,"$Menu"):(Nt+=1,this.internalMenuId="$__$".concat(Nt,"$Menu")));var _e={},Ne={},xt={};Re.disabled||(_e={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},Ne={onClick:this.onTitleClick},xt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Xt={},vn=Re.direction;Yt&&(vn==="rtl"?Xt.paddingRight=Re.inlineIndent*Re.level:Xt.paddingLeft=Re.inlineIndent*Re.level);var Mn={};this.props.isOpen&&(Mn={"aria-owns":this.internalMenuId});var ci=null;Re.mode!=="horizontal"&&(ci=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(ci=H.createElement(this.props.expandIcon,Object(te.a)({},this.props))));var $n=H.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:Xt,className:"".concat(ot,"-title"),role:"button"},xt,Ne,{"aria-expanded":At},Mn,{"aria-haspopup":"true",title:typeof Re.title=="string"?Re.title:void 0}),Re.title,ci||H.createElement("i",{className:"".concat(ot,"-arrow")})),Cn=this.renderChildren(Re.children),Ti=Re.parentMenu.isRootMenu?Re.parentMenu.props.getPopupContainer:function(tr){return tr.parentNode},Wi=Ze[Re.mode],hi=Re.popupOffset?{offset:Re.popupOffset}:{},fi=Re.mode==="inline"?"":Re.popupClassName;fi+=vn==="rtl"?" ".concat(ot,"-rtl"):"";var ji=Re.disabled,er=Re.triggerSubMenuAction,yr=Re.subMenuOpenDelay,cn=Re.forceSubMenuRender,ri=Re.subMenuCloseDelay,pr=Re.builtinPlacements;Ye.forEach(function(tr){return delete Re[tr]}),delete Re.onClick;var Cr=vn==="rtl"?Object.assign({},ft,pr):Object.assign({},ze,pr);return delete Re.direction,H.createElement("li",Object.assign({},Re,_e,{className:rn,role:"menuitem"}),Yt&&$n,Yt&&Cn,!Yt&&H.createElement(Kt.a,{prefixCls:ot,popupClassName:u()("".concat(ot,"-popup"),fi),getPopupContainer:Ti,builtinPlacements:Cr,popupPlacement:Wi,popupVisible:At,popupAlign:hi,popup:Cn,action:ji?[]:[er],mouseEnterDelay:yr,mouseLeaveDelay:ri,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:cn},$n))}}]),yt}(H.Component);Ut.defaultProps={onMouseEnter:T,onMouseLeave:T,onTitleMouseEnter:T,onTitleMouseLeave:T,onTitleClick:T,manualRef:T,mode:"vertical",title:""};var Mt=Object(P.b)(function(Qt,gt){var yt=Qt.openKeys,rt=Qt.activeKey,ce=Qt.selectedKeys,Re=gt.eventKey,At=gt.subMenuKey;return{isOpen:yt.indexOf(Re)>-1,active:rt[At]===Re,selectedKeys:ce}})(Ut);Mt.isSubMenu=!0;var An=Mt,mn="menuitem-overflowed",pn=.5,tt=function(Qt){Object(A.a)(yt,Qt);var gt=Object(M.a)(yt);function yt(){var rt;return Object(Y.a)(this,yt),rt=gt.apply(this,arguments),rt.resizeObserver=null,rt.mutationObserver=null,rt.originalTotalWidth=0,rt.overflowedItems=[],rt.menuItemSizes=[],rt.cancelFrameId=null,rt.state={lastVisibleIndex:void 0},rt.getMenuItemNodes=function(){var ce=rt.props.prefixCls,Re=de.findDOMNode(Object(K.a)(rt));return Re?[].slice.call(Re.children).filter(function(At){return At.className.split(" ").indexOf("".concat(ce,"-overflowed-submenu"))<0}):[]},rt.getOverflowedSubMenuItem=function(ce,Re,At){var ot=rt.props,Yt=ot.overflowedIndicator,rn=ot.level,_e=ot.mode,Ne=ot.prefixCls,xt=ot.theme;if(rn!==1||_e!=="horizontal")return null;var Xt=rt.props.children[0],vn=Xt.props,Mn=vn.children,ci=vn.title,$n=vn.style,Cn=Object(be.a)(vn,["children","title","style"]),Ti=Object(te.a)({},$n),Wi="".concat(ce,"-overflowed-indicator"),hi="".concat(ce,"-overflowed-indicator");Re.length===0&&At!==!0?Ti=Object(te.a)(Object(te.a)({},Ti),{},{display:"none"}):At&&(Ti=Object(te.a)(Object(te.a)({},Ti),{},{visibility:"hidden",position:"absolute"}),Wi="".concat(Wi,"-placeholder"),hi="".concat(hi,"-placeholder"));var fi=xt?"".concat(Ne,"-").concat(xt):"",ji={};return Ye.forEach(function(er){Cn[er]!==void 0&&(ji[er]=Cn[er])}),H.createElement(An,Object.assign({title:Yt,className:"".concat(Ne,"-overflowed-submenu"),popupClassName:fi},ji,{key:Wi,eventKey:hi,disabled:!1,style:Ti}),Re)},rt.setChildrenWidthAndResize=function(){if(rt.props.mode!=="horizontal")return;var ce=de.findDOMNode(Object(K.a)(rt));if(!ce)return;var Re=ce.children;if(!Re||Re.length===0)return;var At=ce.children[Re.length-1];Ie(At,"display","inline-block");var ot=rt.getMenuItemNodes(),Yt=ot.filter(function(rn){return rn.className.split(" ").indexOf(mn)>=0});Yt.forEach(function(rn){Ie(rn,"display","inline-block")}),rt.menuItemSizes=ot.map(function(rn){return xe(rn,!0)}),Yt.forEach(function(rn){Ie(rn,"display","none")}),rt.overflowedIndicatorWidth=xe(ce.children[ce.children.length-1],!0),rt.originalTotalWidth=rt.menuItemSizes.reduce(function(rn,_e){return rn+_e},0),rt.handleResize(),Ie(At,"display","none")},rt.handleResize=function(){if(rt.props.mode!=="horizontal")return;var ce=de.findDOMNode(Object(K.a)(rt));if(!ce)return;var Re=xe(ce);rt.overflowedItems=[];var At=0,ot;rt.originalTotalWidth>Re+pn&&(ot=-1,rt.menuItemSizes.forEach(function(Yt){At+=Yt,At+rt.overflowedIndicatorWidth<=Re&&(ot+=1)})),rt.setState({lastVisibleIndex:ot})},rt}return Object(N.a)(yt,[{key:"componentDidMount",value:function(){var ce=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var Re=de.findDOMNode(this);if(!Re)return;this.resizeObserver=new nt.default(function(At){At.forEach(function(){var ot=ce.cancelFrameId;cancelAnimationFrame(ot),ce.cancelFrameId=requestAnimationFrame(ce.setChildrenWidthAndResize)})}),[].slice.call(Re.children).concat(Re).forEach(function(At){ce.resizeObserver.observe(At)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){ce.resizeObserver.disconnect(),[].slice.call(Re.children).concat(Re).forEach(function(At){ce.resizeObserver.observe(At)}),ce.setChildrenWidthAndResize()}),this.mutationObserver.observe(Re,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(ce){var Re=this,At=this.state.lastVisibleIndex;return(ce||[]).reduce(function(ot,Yt,rn){var _e=Yt;if(Re.props.mode==="horizontal"){var Ne=Re.getOverflowedSubMenuItem(Yt.props.eventKey,[]);At!==void 0&&Re.props.className.indexOf("".concat(Re.props.prefixCls,"-root"))!==-1&&(rn>At&&(_e=H.cloneElement(Yt,{style:{display:"none"},eventKey:"".concat(Yt.props.eventKey,"-hidden"),className:"".concat(mn)})),rn===At+1&&(Re.overflowedItems=ce.slice(At+1).map(function(Xt){return H.cloneElement(Xt,{key:Xt.props.eventKey,mode:"vertical-left"})}),Ne=Re.getOverflowedSubMenuItem(Yt.props.eventKey,Re.overflowedItems)));var xt=[].concat(Object(Ke.a)(ot),[Ne,_e]);return rn===ce.length-1&&xt.push(Re.getOverflowedSubMenuItem(Yt.props.eventKey,[],!0)),xt}return[].concat(Object(Ke.a)(ot),[_e])},[])}},{key:"render",value:function(){var ce=this.props,Re=ce.visible,At=ce.prefixCls,ot=ce.overflowedIndicator,Yt=ce.mode,rn=ce.level,_e=ce.tag,Ne=ce.children,xt=ce.theme,Xt=Object(be.a)(ce,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),vn=_e;return H.createElement(vn,Object.assign({},Xt),this.renderChildren(Ne))}}]),yt}(H.Component);tt.defaultProps={tag:"div",className:""};var fn=tt;function In(Qt){return Qt.length?Qt.every(function(gt){return!!gt.props.disabled}):!0}function He(Qt,gt,yt){var rt=Qt.getState();Qt.setState({activeKey:Object(te.a)(Object(te.a)({},rt.activeKey),{},Object(b.a)({},gt,yt))})}function Ue(Qt){return Qt.eventKey||"0-menu-"}function pt(Qt,gt){var yt=gt,rt=Qt.children,ce=Qt.eventKey;if(yt){var Re;if(oe(rt,function(At,ot){At&&At.props&&!At.props.disabled&&yt===V(At,ce,ot)&&(Re=!0)}),Re)return yt}return yt=null,Qt.defaultActiveFirst&&oe(rt,function(At,ot){!yt&&At&&!At.props.disabled&&(yt=V(At,ce,ot))}),yt}function Ct(Qt){if(Qt){var gt=this.instanceArray.indexOf(Qt);gt!==-1?this.instanceArray[gt]=Qt:this.instanceArray.push(Qt)}}var Ge=function(Qt){Object(A.a)(yt,Qt);var gt=Object(M.a)(yt);function yt(rt){var ce;return Object(Y.a)(this,yt),ce=gt.call(this,rt),ce.onKeyDown=function(Re,At){var ot=Re.keyCode,Yt;if(ce.getFlatInstanceArray().forEach(function(_e){_e&&_e.props.active&&_e.onKeyDown&&(Yt=_e.onKeyDown(Re))}),Yt)return 1;var rn=null;return(ot===m.a.UP||ot===m.a.DOWN)&&(rn=ce.step(ot===m.a.UP?-1:1)),rn?(Re.preventDefault(),He(ce.props.store,Ue(ce.props),rn.props.eventKey),typeof At=="function"&&At(rn),1):void 0},ce.onItemHover=function(Re){var At=Re.key,ot=Re.hover;He(ce.props.store,Ue(ce.props),ot?At:null)},ce.onDeselect=function(Re){ce.props.onDeselect(Re)},ce.onSelect=function(Re){ce.props.onSelect(Re)},ce.onClick=function(Re){ce.props.onClick(Re)},ce.onOpenChange=function(Re){ce.props.onOpenChange(Re)},ce.onDestroy=function(Re){ce.props.onDestroy(Re)},ce.getFlatInstanceArray=function(){return ce.instanceArray},ce.step=function(Re){var At=ce.getFlatInstanceArray(),ot=ce.props.store.getState().activeKey[Ue(ce.props)],Yt=At.length;if(!Yt)return null;Re<0&&(At=At.concat().reverse());var rn=-1;if(At.every(function(Xt,vn){return Xt&&Xt.props.eventKey===ot?(rn=vn,!1):!0}),!ce.props.defaultActiveFirst&&rn!==-1&&In(At.slice(rn,Yt-1)))return;var _e=(rn+1)%Yt,Ne=_e;do{var xt=At[Ne];if(!xt||xt.props.disabled)Ne=(Ne+1)%Yt;else return xt}while(Ne!==_e);return null},ce.renderCommonMenuItem=function(Re,At,ot){var Yt=ce.props.store.getState(),rn=Object(K.a)(ce),_e=rn.props,Ne=V(Re,_e.eventKey,At),xt=Re.props;if(!xt||typeof Re.type=="string")return Re;var Xt=Ne===Yt.activeKey,vn=Object(te.a)(Object(te.a)({mode:xt.mode||_e.mode,level:_e.level,inlineIndent:_e.inlineIndent,renderMenuItem:ce.renderMenuItem,rootPrefixCls:_e.prefixCls,index:At,parentMenu:_e.parentMenu,manualRef:xt.disabled?void 0:Object(f.a)(Re.ref,Ct.bind(Object(K.a)(ce))),eventKey:Ne,active:!xt.disabled&&Xt,multiple:_e.multiple,onClick:function(ci){(xt.onClick||T)(ci),ce.onClick(ci)},onItemHover:ce.onItemHover,motion:_e.motion,subMenuOpenDelay:_e.subMenuOpenDelay,subMenuCloseDelay:_e.subMenuCloseDelay,forceSubMenuRender:_e.forceSubMenuRender,onOpenChange:ce.onOpenChange,onDeselect:ce.onDeselect,onSelect:ce.onSelect,builtinPlacements:_e.builtinPlacements,itemIcon:xt.itemIcon||ce.props.itemIcon,expandIcon:xt.expandIcon||ce.props.expandIcon},ot),{},{direction:_e.direction});return(_e.mode==="inline"||Je())&&(vn.triggerSubMenuAction="click"),H.cloneElement(Re,vn)},ce.renderMenuItem=function(Re,At,ot){if(!Re)return null;var Yt=ce.props.store.getState(),rn={openKeys:Yt.openKeys,selectedKeys:Yt.selectedKeys,triggerSubMenuAction:ce.props.triggerSubMenuAction,subMenuKey:ot};return ce.renderCommonMenuItem(Re,At,rn)},rt.store.setState({activeKey:Object(te.a)(Object(te.a)({},rt.store.getState().activeKey),{},Object(b.a)({},rt.eventKey,pt(rt,rt.activeKey)))}),ce.instanceArray=[],ce}return Object(N.a)(yt,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(ce){return this.props.visible||ce.visible||this.props.className!==ce.className||!s()(this.props.style,ce.style)}},{key:"componentDidUpdate",value:function(ce){var Re=this.props,At="activeKey"in Re?Re.activeKey:Re.store.getState().activeKey[Ue(Re)],ot=pt(Re,At);if(ot!==At)He(Re.store,Ue(Re),ot);else if("activeKey"in ce){var Yt=pt(ce,ce.activeKey);ot!==Yt&&He(Re.store,Ue(Re),ot)}}},{key:"render",value:function(){var ce=this,Re=Object(D.a)({},this.props);this.instanceArray=[];var At=u()(Re.prefixCls,Re.className,"".concat(Re.prefixCls,"-").concat(Re.mode)),ot={className:At,role:Re.role||"menu"};Re.id&&(ot.id=Re.id),Re.focusable&&(ot.tabIndex=0,ot.onKeyDown=this.onKeyDown);var Yt=Re.prefixCls,rn=Re.eventKey,_e=Re.visible,Ne=Re.level,xt=Re.mode,Xt=Re.overflowedIndicator,vn=Re.theme;return Ye.forEach(function(Mn){return delete Re[Mn]}),delete Re.onClick,H.createElement(fn,Object.assign({},Re,{prefixCls:Yt,mode:xt,tag:"ul",level:Ne,theme:vn,visible:_e,overflowedIndicator:Xt},ot),H.Children.map(Re.children,function(Mn,ci){return ce.renderMenuItem(Mn,ci,rn||"0-menu-")}))}}]),yt}(H.Component);Ge.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:T};var vt=Object(P.b)()(Ge),Ae=vt,ge=I("Kwbf");function Ee(Qt,gt,yt){var rt=Qt.prefixCls,ce=Qt.motion,Re=Qt.defaultMotions,At=Re===void 0?{}:Re,ot=Qt.openAnimation,Yt=Qt.openTransitionName,rn=gt.switchingModeFromInline;if(ce)return ce;if(Object(o.a)(ot)==="object"&&ot)Object(ge.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof ot=="string")return{motionName:"".concat(rt,"-open-").concat(ot)};if(Yt)return{motionName:Yt};var _e=At[yt];return _e||(rn?null:At.other)}var ae=function(Qt){Object(A.a)(yt,Qt);var gt=Object(M.a)(yt);function yt(rt){var ce;Object(Y.a)(this,yt),ce=gt.call(this,rt),ce.inlineOpenKeys=[],ce.onSelect=function(ot){var Yt=Object(K.a)(ce),rn=Yt.props;if(rn.selectable){var _e=ce.store.getState(),Ne=_e.selectedKeys,xt=ot.key;rn.multiple?Ne=Ne.concat([xt]):Ne=[xt],"selectedKeys"in rn||ce.store.setState({selectedKeys:Ne}),rn.onSelect(Object(te.a)(Object(te.a)({},ot),{},{selectedKeys:Ne}))}},ce.onClick=function(ot){var Yt=ce.getRealMenuMode(),rn=Object(K.a)(ce),_e=rn.store,Ne=rn.props.onOpenChange;Yt!=="inline"&&!("openKeys"in ce.props)&&(_e.setState({openKeys:[]}),Ne([])),ce.props.onClick(ot)},ce.onKeyDown=function(ot,Yt){ce.innerMenu.getWrappedInstance().onKeyDown(ot,Yt)},ce.onOpenChange=function(ot){var Yt=Object(K.a)(ce),rn=Yt.props,_e=ce.store.getState().openKeys.concat(),Ne=!1,xt=function(vn){var Mn=!1;if(vn.open)Mn=_e.indexOf(vn.key)===-1,Mn&&_e.push(vn.key);else{var ci=_e.indexOf(vn.key);Mn=ci!==-1,Mn&&_e.splice(ci,1)}Ne=Ne||Mn};Array.isArray(ot)?ot.forEach(xt):xt(ot),Ne&&("openKeys"in ce.props||ce.store.setState({openKeys:_e}),rn.onOpenChange(_e))},ce.onDeselect=function(ot){var Yt=Object(K.a)(ce),rn=Yt.props;if(rn.selectable){var _e=ce.store.getState().selectedKeys.concat(),Ne=ot.key,xt=_e.indexOf(Ne);xt!==-1&&_e.splice(xt,1),"selectedKeys"in rn||ce.store.setState({selectedKeys:_e}),rn.onDeselect(Object(te.a)(Object(te.a)({},ot),{},{selectedKeys:_e}))}},ce.onMouseEnter=function(ot){ce.restoreModeVerticalFromInline();var Yt=ce.props.onMouseEnter;Yt&&Yt(ot)},ce.onTransitionEnd=function(ot){var Yt=ot.propertyName==="width"&&ot.target===ot.currentTarget,rn=ot.target.className,_e=Object.prototype.toString.call(rn)==="[object SVGAnimatedString]"?rn.animVal:rn,Ne=ot.propertyName==="font-size"&&_e.indexOf("anticon")>=0;(Yt||Ne)&&ce.restoreModeVerticalFromInline()},ce.setInnerMenu=function(ot){ce.innerMenu=ot},ce.isRootMenu=!0;var Re=rt.defaultSelectedKeys,At=rt.defaultOpenKeys;return"selectedKeys"in rt&&(Re=rt.selectedKeys||[]),"openKeys"in rt&&(At=rt.openKeys||[]),ce.store=Object(P.c)({selectedKeys:Re,openKeys:At,activeKey:{"0-menu-":pt(rt,rt.activeKey)}}),ce.state={switchingModeFromInline:!1},ce}return Object(N.a)(yt,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(ce){this.updateOpentKeysWhenSwitchMode(ce),this.updateMiniStore();var Re=this.props,At=Re.siderCollapsed,ot=Re.inlineCollapsed,Yt=Re.onOpenChange;(!ce.inlineCollapsed&&ot||!ce.siderCollapsed&&At)&&Yt([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(ce){var Re=this.props,At=this.store,ot=this.inlineOpenKeys,Yt=At.getState(),rn={};ce.mode==="inline"&&Re.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in Re||((Re.inlineCollapsed&&!ce.inlineCollapsed||Re.siderCollapsed&&!ce.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=Yt.openKeys.concat(),rn.openKeys=[]),(!Re.inlineCollapsed&&ce.inlineCollapsed||!Re.siderCollapsed&&ce.siderCollapsed)&&(rn.openKeys=ot,this.inlineOpenKeys=[])),Object.keys(rn).length&&At.setState(rn)}},{key:"updateMenuDisplay",value:function(){var ce=this.props.collapsedWidth,Re=this.store,At=this.prevOpenKeys,ot=this.getInlineCollapsed()&&(ce===0||ce==="0"||ce==="0px");ot?(this.prevOpenKeys=Re.getState().openKeys.concat(),this.store.setState({openKeys:[]})):At&&(this.store.setState({openKeys:At}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var ce=this.props.mode,Re=this.state.switchingModeFromInline,At=this.getInlineCollapsed();return Re&&At?"inline":At?"vertical":ce}},{key:"getInlineCollapsed",value:function(){var ce=this.props,Re=ce.inlineCollapsed,At=ce.siderCollapsed;return At!==void 0?At:Re}},{key:"restoreModeVerticalFromInline",value:function(){var ce=this.state.switchingModeFromInline;ce&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var ce=Object(te.a)({},Object(k.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),Re=this.getRealMenuMode();return ce.className+=" ".concat(ce.prefixCls,"-root"),ce.direction==="rtl"&&(ce.className+=" ".concat(ce.prefixCls,"-rtl")),ce=Object(te.a)(Object(te.a)({},ce),{},{mode:Re,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Ee(this.props,this.state,Re)}),delete ce.openAnimation,delete ce.openTransitionName,H.createElement(P.a,{store:this.store},H.createElement(Ae,Object.assign({},ce,{ref:this.setInnerMenu}),this.props.children))}}]),yt}(H.Component);ae.defaultProps={selectable:!0,onClick:T,onSelect:T,onOpenChange:T,onDeselect:T,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 re=ae,he=function(Qt){Object(A.a)(yt,Qt);var gt=Object(M.a)(yt);function yt(){var rt;return Object(Y.a)(this,yt),rt=gt.apply(this,arguments),rt.onKeyDown=function(ce){var Re=ce.keyCode;return Re===m.a.ENTER?(rt.onClick(ce),!0):void 0},rt.onMouseLeave=function(ce){var Re=rt.props,At=Re.eventKey,ot=Re.onItemHover,Yt=Re.onMouseLeave;ot({key:At,hover:!1}),Yt({key:At,domEvent:ce})},rt.onMouseEnter=function(ce){var Re=rt.props,At=Re.eventKey,ot=Re.onItemHover,Yt=Re.onMouseEnter;ot({key:At,hover:!0}),Yt({key:At,domEvent:ce})},rt.onClick=function(ce){var Re=rt.props,At=Re.eventKey,ot=Re.multiple,Yt=Re.onClick,rn=Re.onSelect,_e=Re.onDeselect,Ne=Re.isSelected,xt={key:At,keyPath:[At],item:Object(K.a)(rt),domEvent:ce};Yt(xt),ot?Ne?_e(xt):rn(xt):Ne||rn(xt)},rt.saveNode=function(ce){rt.node=ce},rt}return Object(N.a)(yt,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var ce=this.props;ce.onDestroy&&ce.onDestroy(ce.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var ce,Re=Object(te.a)({},this.props),At=u()(this.getPrefixCls(),Re.className,(ce={},Object(b.a)(ce,this.getActiveClassName(),!Re.disabled&&Re.active),Object(b.a)(ce,this.getSelectedClassName(),Re.isSelected),Object(b.a)(ce,this.getDisabledClassName(),Re.disabled),ce)),ot=Object(te.a)(Object(te.a)({},Re.attribute),{},{title:typeof Re.title=="string"?Re.title:void 0,className:At,role:Re.role||"menuitem","aria-disabled":Re.disabled});Re.role==="option"?ot=Object(te.a)(Object(te.a)({},ot),{},{role:"option","aria-selected":Re.isSelected}):(Re.role===null||Re.role==="none")&&(ot.role="none");var Yt={onClick:Re.disabled?null:this.onClick,onMouseLeave:Re.disabled?null:this.onMouseLeave,onMouseEnter:Re.disabled?null:this.onMouseEnter},rn=Object(te.a)({},Re.style);Re.mode==="inline"&&(Re.direction==="rtl"?rn.paddingRight=Re.inlineIndent*Re.level:rn.paddingLeft=Re.inlineIndent*Re.level),Ye.forEach(function(Ne){return delete Re[Ne]}),delete Re.direction;var _e=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(_e=H.createElement(this.props.itemIcon,this.props)),H.createElement("li",Object.assign({},Object(k.default)(Re,["onClick","onMouseEnter","onMouseLeave","onSelect"]),ot,Yt,{style:rn,ref:this.saveNode}),Re.children,_e)}}]),yt}(H.Component);he.isMenuItem=!0,he.defaultProps={onSelect:T,onMouseEnter:T,onMouseLeave:T,manualRef:T};var ve=Object(P.b)(function(Qt,gt){var yt=Qt.activeKey,rt=Qt.selectedKeys,ce=gt.eventKey,Re=gt.subMenuKey;return{active:yt[Re]===ce,isSelected:rt.indexOf(ce)!==-1}})(he),me=ve,Be=function(Qt){Object(A.a)(yt,Qt);var gt=Object(M.a)(yt);function yt(){var rt;return Object(Y.a)(this,yt),rt=gt.apply(this,arguments),rt.renderInnerMenuItem=function(ce){var Re=rt.props,At=Re.renderMenuItem,ot=Re.index;return At(ce,ot,rt.props.subMenuKey)},rt}return Object(N.a)(yt,[{key:"render",value:function(){var ce=Object(D.a)({},this.props),Re=ce.className,At=Re===void 0?"":Re,ot=ce.rootPrefixCls,Yt="".concat(ot,"-item-group-title"),rn="".concat(ot,"-item-group-list"),_e=ce.title,Ne=ce.children;return Ye.forEach(function(xt){return delete ce[xt]}),delete ce.onClick,delete ce.direction,H.createElement("li",Object.assign({},ce,{className:"".concat(At," ").concat(ot,"-item-group")}),H.createElement("div",{className:Yt,title:typeof _e=="string"?_e:void 0},_e),H.createElement("ul",{className:rn},H.Children.map(Ne,this.renderInnerMenuItem)))}}]),yt}(H.Component);Be.isMenuItemGroup=!0,Be.defaultProps={disabled:!0};var Tt=Be,Jt=function(gt){var yt=gt.className,rt=gt.rootPrefixCls,ce=gt.style;return H.createElement("li",{className:"".concat(yt," ").concat(rt,"-item-divider"),style:ce})};Jt.defaultProps={disabled:!0,className:"",style:{}};var En=Jt,mt=Qe.e=re},"4wi7":function(tn,Qe,I){"use strict";var te=I("14J3"),Y=I("BMrR"),N=I("sRBo"),K=I("kaz8"),A=I("5NDa"),M=I("5rEg"),H=I("9og8"),P=I("tJVT"),k=I("WmNS"),D=I.n(k),b=I("q1tI"),m=I.n(b),f=I("oOBs"),d=I.n(f),s=I("xOL1"),r=I.n(s),u=I("BdwD"),o=function(n){var R=n.data,w=n.value,x=w===void 0?[]:w,O=n.handleChangePage,C=n.setSelectedRowKeys,_=n.selectedRowKeys,y=n.onChange,h=y===void 0?function(){}:y,c=Object(b.useState)([]),v=Object(P.a)(c,2),p=v[0],E=v[1],U=Object(b.useState)([]),F=Object(P.a)(U,2),z=F[0],G=F[1],B=Object(b.useState)([]),T=Object(P.a)(B,2),V=T[0],Z=T[1],oe=Object(b.useState)(1),pe=Object(P.a)(oe,2),Ye=pe[0],xe=pe[1],Ie=Object(b.useState)(),Je=Object(P.a)(Ie,2),Ke=Je[0],be=Je[1];return Object(b.useEffect)(function(){E(R),G([]),Z([])},[R]),Object(b.useEffect)(function(){C&&(G(_),Z(_))},[_]),m.a.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},m.a.createElement("div",{className:d.a.leftdiv},m.a.createElement(M.a.Search,{size:"large",onChange:function(){var de=Object(H.a)(D.a.mark(function nt(Kt){return D.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:E(R.filter(function(ze){var ft;return ze==null||((ft=ze.name)===null||ft===void 0)?void 0:ft.includes(Kt.target.value)}));case 1:case"end":return wt.stop()}},nt)}));return function(nt){return de.apply(this,arguments)}}(),placeholder:"\u53EF\u8F93\u5165\u73ED\u7EA7\u540D\u79F0\u67E5\u8BE2"}),p.length===0&&m.a.createElement(u.a,{styles:{margin:"70px auto"},customText:"\u6682\u65E0\u5206\u73ED"}),m.a.createElement("div",{style:{height:"85%",overflow:"auto",overflowX:"hidden"}},m.a.createElement(K.a.Group,{value:z.map(function(de){return"".concat(de.id)}),onChange:function(nt){C(p.filter(function(Kt){return nt.includes("".concat(Kt.id))}))},style:{marginTop:"10px"}},p.map(function(de,nt){return m.a.createElement(Y.a,{key:de.id,style:{marginTop:"10px",lineHeight:"24px",display:"flex",width:200}},m.a.createElement(K.a,{style:{display:"flex",height:"24px",alignItems:"center"},disabled:de.is_published,value:"".concat(de.id)},m.a.createElement("div",{className:d.a.listClass},m.a.createElement("span",{className:d.a.spantitle,style:{width:de.is_published?"108px":"170px"}},de.name),de.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:d.a.rightdiv},m.a.createElement(M.a.Search,{onChange:function(nt){Z(z.filter(function(Kt){return Kt.name.includes(nt.target.value)}))},size:"large",placeholder:"\u53EF\u8F93\u5165\u73ED\u7EA7\u540D\u79F0\u67E5\u8BE2"}),V.length===0&&m.a.createElement(u.a,{styles:{margin:"70px auto"},customText:"\u6682\u672A\u9009\u62E9\u5206\u73ED"}),V.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}},V.map(function(de,nt){return m.a.createElement(Y.a,{justify:"space-between",style:{marginTop:"10px"},key:de.id},m.a.createElement("div",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",marginRight:"5px",marginLeft:"5px",width:"75%"}},de.name),m.a.createElement("img",{src:r.a,style:{cursor:"pointer",height:"16px",marginRight:17},onClick:function(){C(z.filter(function(jt){return"".concat(jt.id)!="".concat(de.id)}))}}))})))))};Qe.a=o},"55Ip":function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return a});var te=I("Ty5D"),Y=I("dI71"),N=I("q1tI"),K=I.n(N),A=I("YS25"),M=I("17x9"),H=I.n(M),P=I("wx14"),k=I("zLVn"),D=I("9R94"),b=function(y){Object(Y.a)(h,y);function h(){for(var v,p=arguments.length,E=new Array(p),U=0;U<p;U++)E[U]=arguments[U];return v=y.call.apply(y,[this].concat(E))||this,v.history=Object(A.a)(v.props),v}var c=h.prototype;return c.render=function(){return K.a.createElement(te.c,{history:this.history,children:this.props.children})},h}(K.a.Component),m=function(y){Object(Y.a)(h,y);function h(){for(var v,p=arguments.length,E=new Array(p),U=0;U<p;U++)E[U]=arguments[U];return v=y.call.apply(y,[this].concat(E))||this,v.history=Object(A.b)(v.props),v}var c=h.prototype;return c.render=function(){return K.a.createElement(te.c,{history:this.history,children:this.props.children})},h}(K.a.Component),f=function(h,c){return typeof h=="function"?h(c):h},d=function(h,c){return typeof h=="string"?Object(A.c)(h,null,null,c):h},s=function(h){return h},r=K.a.forwardRef;typeof r=="undefined"&&(r=s);function u(y){return!!(y.metaKey||y.altKey||y.ctrlKey||y.shiftKey)}var o=r(function(y,h){var c=y.innerRef,v=y.navigate,p=y.onClick,E=Object(k.a)(y,["innerRef","navigate","onClick"]),U=E.target,F=Object(P.a)({},E,{onClick:function(G){try{p&&p(G)}catch(B){throw G.preventDefault(),B}!G.defaultPrevented&&G.button===0&&(!U||U==="_self")&&!u(G)&&(G.preventDefault(),v())}});return s!==r?F.ref=h||c:F.ref=c,K.a.createElement("a",F)}),a=r(function(y,h){var c=y.component,v=c===void 0?o:c,p=y.replace,E=y.to,U=y.innerRef,F=Object(k.a)(y,["component","replace","to","innerRef"]);return K.a.createElement(te.e.Consumer,null,function(z){z||Object(D.a)(!1);var G=z.history,B=d(f(E,z.location),z.location),T=B?G.createHref(B):"",V=Object(P.a)({},F,{href:T,navigate:function(){var oe=f(E,z.location),pe=p?G.replace:G.push;pe(oe)}});return s!==r?V.ref=h||U:V.innerRef=U,K.a.createElement(v,V)})});if(!1)var n,R;var w=function(h){return h},x=K.a.forwardRef;typeof x=="undefined"&&(x=w);function O(){for(var y=arguments.length,h=new Array(y),c=0;c<y;c++)h[c]=arguments[c];return h.filter(function(v){return v}).join(" ")}var C=x(function(y,h){var c=y["aria-current"],v=c===void 0?"page":c,p=y.activeClassName,E=p===void 0?"active":p,U=y.activeStyle,F=y.className,z=y.exact,G=y.isActive,B=y.location,T=y.sensitive,V=y.strict,Z=y.style,oe=y.to,pe=y.innerRef,Ye=Object(k.a)(y,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return K.a.createElement(te.e.Consumer,null,function(xe){xe||Object(D.a)(!1);var Ie=B||xe.location,Je=d(f(oe,Ie),Ie),Ke=Je.pathname,be=Ke&&Ke.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),de=be?Object(te.f)(Ie.pathname,{path:be,exact:z,sensitive:T,strict:V}):null,nt=!!(G?G(de,Ie):de),Kt=nt?O(F,E):F,jt=nt?Object(P.a)({},Z,{},U):Z,wt=Object(P.a)({"aria-current":nt&&v||null,className:Kt,style:jt,to:Je},Ye);return w!==x?wt.ref=h||pe:wt.innerRef=pe,K.a.createElement(a,wt)})});if(!1)var _},"5VLF":function(tn,Qe,I){"use strict";var te,Y;function N(K,A,M){var H=function(P,k){return K.js_beautify(P,k)};return H.js=K.js_beautify,H.css=A.css_beautify,H.html=M.html_beautify,H.js_beautify=K.js_beautify,H.css_beautify=A.css_beautify,H.html_beautify=M.html_beautify,H}!(te=[I("6UM0"),I("TXwP"),I("psGv")],Y=function(K,A,M){return N(K,A,M)}.apply(Qe,te),Y!==void 0&&(tn.exports=Y))},"6+eU":function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return x});var te=I("wx14"),Y=I("rePB"),N=I("VTBJ"),K=I("1OyB"),A=I("vuIU"),M=I("Ji7U"),H=I("LK+K"),P=I("q1tI"),k=I.n(P),D=I("TSYQ"),b=I.n(D),m=function(C){var _,y="".concat(C.rootPrefixCls,"-item"),h=b()(y,"".concat(y,"-").concat(C.page),(_={},Object(Y.a)(_,"".concat(y,"-active"),C.active),Object(Y.a)(_,C.className,!!C.className),Object(Y.a)(_,"".concat(y,"-disabled"),!C.page),_)),c=function(){C.onClick(C.page)},v=function(E){C.onKeyPress(E,C.onClick,C.page)};return k.a.createElement("li",{title:C.showTitle?C.page:null,className:h,onClick:c,onKeyPress:v,tabIndex:"0"},C.itemRender(C.page,"page",k.a.createElement("a",{rel:"nofollow"},C.page)))},f=m,d={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},s=function(O){Object(M.a)(_,O);var C=Object(H.a)(_);function _(){var y;Object(K.a)(this,_);for(var h=arguments.length,c=new Array(h),v=0;v<h;v++)c[v]=arguments[v];return y=C.call.apply(C,[this].concat(c)),y.state={goInputText:""},y.buildOptionText=function(p){return"".concat(p," ").concat(y.props.locale.items_per_page)},y.changeSize=function(p){y.props.changeSize(Number(p))},y.handleChange=function(p){y.setState({goInputText:p.target.value})},y.handleBlur=function(p){var E=y.props,U=E.goButton,F=E.quickGo,z=E.rootPrefixCls,G=y.state.goInputText;if(U||G==="")return;if(p.relatedTarget&&(p.relatedTarget.className.indexOf("".concat(z,"-prev"))>=0||p.relatedTarget.className.indexOf("".concat(z,"-next"))>=0))return;y.setState({goInputText:""}),F(y.getValidValue())},y.go=function(p){var E=y.state.goInputText;if(E==="")return;(p.keyCode===d.ENTER||p.type==="click")&&(y.setState({goInputText:""}),y.props.quickGo(y.getValidValue()))},y}return Object(A.a)(_,[{key:"getValidValue",value:function(){var h=this.state,c=h.goInputText,v=h.current;return!c||isNaN(c)?v:Number(c)}},{key:"getPageSizeOptions",value:function(){var h=this.props,c=h.pageSize,v=h.pageSizeOptions;return v.some(function(p){return p.toString()===c.toString()})?v:v.concat([c.toString()]).sort(function(p,E){var U=isNaN(Number(p))?0:Number(p),F=isNaN(Number(E))?0:Number(E);return U-F})}},{key:"render",value:function(){var h=this,c=this.props,v=c.pageSize,p=c.locale,E=c.rootPrefixCls,U=c.changeSize,F=c.quickGo,z=c.goButton,G=c.selectComponentClass,B=c.buildOptionText,T=c.selectPrefixCls,V=c.disabled,Z=this.state.goInputText,oe="".concat(E,"-options"),pe=G,Ye=null,xe=null,Ie=null;if(!U&&!F)return null;var Je=this.getPageSizeOptions();if(U&&pe){var Ke=Je.map(function(be,de){return k.a.createElement(pe.Option,{key:de,value:be.toString()},(B||h.buildOptionText)(be))});Ye=k.a.createElement(pe,{disabled:V,prefixCls:T,showSearch:!1,className:"".concat(oe,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(v||Je[0]).toString(),onChange:this.changeSize,getPopupContainer:function(de){return de.parentNode}},Ke)}return F&&(z&&(Ie=typeof z=="boolean"?k.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:V,className:"".concat(oe,"-quick-jumper-button")},p.jump_to_confirm):k.a.createElement("span",{onClick:this.go,onKeyUp:this.go},z)),xe=k.a.createElement("div",{className:"".concat(oe,"-quick-jumper")},p.jump_to,k.a.createElement("input",{disabled:V,type:"text",value:Z,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),p.page,Ie)),k.a.createElement("li",{className:"".concat(oe)},Ye,xe)}}]),_}(k.a.Component);s.defaultProps={pageSizeOptions:["10","20","50","100"]};var r=s,u=I("N2Kk");function o(){}function a(O){return typeof O=="number"&&isFinite(O)&&Math.floor(O)===O}function n(O,C,_){return _}function R(O,C,_){var y=typeof O=="undefined"?C.pageSize:O;return Math.floor((_.total-1)/y)+1}var w=function(O){Object(M.a)(_,O);var C=Object(H.a)(_);function _(y){var h;Object(K.a)(this,_),h=C.call(this,y),h.getJumpPrevPage=function(){return Math.max(1,h.state.current-(h.props.showLessItems?3:5))},h.getJumpNextPage=function(){return Math.min(R(void 0,h.state,h.props),h.state.current+(h.props.showLessItems?3:5))},h.getItemIcon=function(U,F){var z=h.props.prefixCls,G=U||k.a.createElement("button",{type:"button","aria-label":F,className:"".concat(z,"-item-link")});return typeof U=="function"&&(G=k.a.createElement(U,Object(N.a)({},h.props))),G},h.savePaginationNode=function(U){h.paginationNode=U},h.isValid=function(U){return a(U)&&U!==h.state.current},h.shouldDisplayQuickJumper=function(){var U=h.props,F=U.showQuickJumper,z=U.pageSize,G=U.total;return G<=z?!1:F},h.handleKeyDown=function(U){(U.keyCode===d.ARROW_UP||U.keyCode===d.ARROW_DOWN)&&U.preventDefault()},h.handleKeyUp=function(U){var F=h.getValidValue(U),z=h.state.currentInputValue;F!==z&&h.setState({currentInputValue:F}),U.keyCode===d.ENTER?h.handleChange(F):U.keyCode===d.ARROW_UP?h.handleChange(F-1):U.keyCode===d.ARROW_DOWN&&h.handleChange(F+1)},h.changePageSize=function(U){var F=h.state.current,z=R(U,h.state,h.props);F=F>z?z:F,z===0&&(F=h.state.current),typeof U=="number"&&("pageSize"in h.props||h.setState({pageSize:U}),"current"in h.props||h.setState({current:F,currentInputValue:F})),h.props.onShowSizeChange(F,U),"onChange"in h.props&&h.props.onChange&&h.props.onChange(F,U)},h.handleChange=function(U){var F=h.props.disabled,z=U;if(h.isValid(z)&&!F){var G=R(void 0,h.state,h.props);z>G?z=G:z<1&&(z=1),"current"in h.props||h.setState({current:z,currentInputValue:z});var B=h.state.pageSize;return h.props.onChange(z,B),z}return h.state.current},h.prev=function(){h.hasPrev()&&h.handleChange(h.state.current-1)},h.next=function(){h.hasNext()&&h.handleChange(h.state.current+1)},h.jumpPrev=function(){h.handleChange(h.getJumpPrevPage())},h.jumpNext=function(){h.handleChange(h.getJumpNextPage())},h.hasPrev=function(){return h.state.current>1},h.hasNext=function(){return h.state.current<R(void 0,h.state,h.props)},h.runIfEnter=function(U,F){if(U.key==="Enter"||U.charCode===13){for(var z=arguments.length,G=new Array(z>2?z-2:0),B=2;B<z;B++)G[B-2]=arguments[B];F.apply(void 0,G)}},h.runIfEnterPrev=function(U){h.runIfEnter(U,h.prev)},h.runIfEnterNext=function(U){h.runIfEnter(U,h.next)},h.runIfEnterJumpPrev=function(U){h.runIfEnter(U,h.jumpPrev)},h.runIfEnterJumpNext=function(U){h.runIfEnter(U,h.jumpNext)},h.handleGoTO=function(U){(U.keyCode===d.ENTER||U.type==="click")&&h.handleChange(h.state.currentInputValue)};var c=y.onChange!==o,v="current"in y;v&&!c&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var p=y.defaultCurrent;"current"in y&&(p=y.current);var E=y.defaultPageSize;return"pageSize"in y&&(E=y.pageSize),p=Math.min(p,R(E,void 0,y)),h.state={current:p,currentInputValue:p,pageSize:E},h}return Object(A.a)(_,[{key:"componentDidUpdate",value:function(h,c){var v=this.props.prefixCls;if(c.current!==this.state.current&&this.paginationNode){var p=this.paginationNode.querySelector(".".concat(v,"-item-").concat(c.current));p&&document.activeElement===p&&p.blur()}}},{key:"getValidValue",value:function(h){var c=h.target.value,v=R(void 0,this.state,this.props),p=this.state.currentInputValue,E;return c===""?E=c:isNaN(Number(c))?E=p:c>=v?E=v:E=Number(c),E}},{key:"getShowSizeChanger",value:function(){var h=this.props,c=h.showSizeChanger,v=h.total,p=h.totalBoundaryShowSizeChanger;return typeof c!="undefined"?c:v>p}},{key:"renderPrev",value:function(h){var c=this.props,v=c.prevIcon,p=c.itemRender,E=p(h,"prev",this.getItemIcon(v,"prev page")),U=!this.hasPrev();return Object(P.isValidElement)(E)?Object(P.cloneElement)(E,{disabled:U}):E}},{key:"renderNext",value:function(h){var c=this.props,v=c.nextIcon,p=c.itemRender,E=p(h,"next",this.getItemIcon(v,"next page")),U=!this.hasNext();return Object(P.isValidElement)(E)?Object(P.cloneElement)(E,{disabled:U}):E}},{key:"render",value:function(){var h=this,c=this.props,v=c.prefixCls,p=c.className,E=c.style,U=c.disabled,F=c.hideOnSinglePage,z=c.total,G=c.locale,B=c.showQuickJumper,T=c.showLessItems,V=c.showTitle,Z=c.showTotal,oe=c.simple,pe=c.itemRender,Ye=c.showPrevNextJumpers,xe=c.jumpPrevIcon,Ie=c.jumpNextIcon,Je=c.selectComponentClass,Ke=c.selectPrefixCls,be=c.pageSizeOptions,de=this.state,nt=de.current,Kt=de.pageSize,jt=de.currentInputValue;if(F===!0&&z<=Kt)return null;var wt=R(void 0,this.state,this.props),ze=[],ft=null,dt=null,Nt=null,Ze=null,Bt=null,Ut=B&&B.goButton,Mt=T?1:2,An=nt-1>0?nt-1:0,mn=nt+1<wt?nt+1:wt,pn=Object.keys(this.props).reduce(function(ae,re){return(re.substr(0,5)==="data-"||re.substr(0,5)==="aria-"||re==="role")&&(ae[re]=h.props[re]),ae},{});if(oe)return Ut&&(typeof Ut=="boolean"?Bt=k.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},G.jump_to_confirm):Bt=k.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Ut),Bt=k.a.createElement("li",{title:V?"".concat(G.jump_to).concat(nt,"/").concat(wt):null,className:"".concat(v,"-simple-pager")},Bt)),k.a.createElement("ul",Object(te.a)({className:b()(v,"".concat(v,"-simple"),Object(Y.a)({},"".concat(v,"-disabled"),U),p),style:E,ref:this.savePaginationNode},pn),k.a.createElement("li",{title:V?G.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:b()("".concat(v,"-prev"),Object(Y.a)({},"".concat(v,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(An)),k.a.createElement("li",{title:V?"".concat(nt,"/").concat(wt):null,className:"".concat(v,"-simple-pager")},k.a.createElement("input",{type:"text",value:jt,disabled:U,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),k.a.createElement("span",{className:"".concat(v,"-slash")},"/"),wt),k.a.createElement("li",{title:V?G.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:b()("".concat(v,"-next"),Object(Y.a)({},"".concat(v,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(mn)),Bt);if(wt<=3+Mt*2){var tt={locale:G,rootPrefixCls:v,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:V,itemRender:pe};wt||ze.push(k.a.createElement(f,Object(te.a)({},tt,{key:"noPager",page:wt,className:"".concat(v,"-disabled")})));for(var fn=1;fn<=wt;fn+=1){var In=nt===fn;ze.push(k.a.createElement(f,Object(te.a)({},tt,{key:fn,page:fn,active:In})))}}else{var He=T?G.prev_3:G.prev_5,Ue=T?G.next_3:G.next_5;Ye&&(ft=k.a.createElement("li",{title:V?He:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:b()("".concat(v,"-jump-prev"),Object(Y.a)({},"".concat(v,"-jump-prev-custom-icon"),!!xe))},pe(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(xe,"prev page"))),dt=k.a.createElement("li",{title:V?Ue:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:b()("".concat(v,"-jump-next"),Object(Y.a)({},"".concat(v,"-jump-next-custom-icon"),!!Ie))},pe(this.getJumpNextPage(),"jump-next",this.getItemIcon(Ie,"next page")))),Ze=k.a.createElement(f,{locale:G,last:!0,rootPrefixCls:v,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:wt,page:wt,active:!1,showTitle:V,itemRender:pe}),Nt=k.a.createElement(f,{locale:G,rootPrefixCls:v,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:V,itemRender:pe});var pt=Math.max(1,nt-Mt),Ct=Math.min(nt+Mt,wt);nt-1<=Mt&&(Ct=1+Mt*2),wt-nt<=Mt&&(pt=wt-Mt*2);for(var Ge=pt;Ge<=Ct;Ge+=1){var vt=nt===Ge;ze.push(k.a.createElement(f,{locale:G,rootPrefixCls:v,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Ge,page:Ge,active:vt,showTitle:V,itemRender:pe}))}nt-1>=Mt*2&&nt!==1+2&&(ze[0]=Object(P.cloneElement)(ze[0],{className:"".concat(v,"-item-after-jump-prev")}),ze.unshift(ft)),wt-nt>=Mt*2&&nt!==wt-2&&(ze[ze.length-1]=Object(P.cloneElement)(ze[ze.length-1],{className:"".concat(v,"-item-before-jump-next")}),ze.push(dt)),pt!==1&&ze.unshift(Nt),Ct!==wt&&ze.push(Ze)}var Ae=null;Z&&(Ae=k.a.createElement("li",{className:"".concat(v,"-total-text")},Z(z,[z===0?0:(nt-1)*Kt+1,nt*Kt>z?z:nt*Kt])));var ge=!this.hasPrev()||!wt,Ee=!this.hasNext()||!wt;return k.a.createElement("ul",Object(te.a)({className:b()(v,p,Object(Y.a)({},"".concat(v,"-disabled"),U)),style:E,unselectable:"unselectable",ref:this.savePaginationNode},pn),Ae,k.a.createElement("li",{title:V?G.prev_page:null,onClick:this.prev,tabIndex:ge?null:0,onKeyPress:this.runIfEnterPrev,className:b()("".concat(v,"-prev"),Object(Y.a)({},"".concat(v,"-disabled"),ge)),"aria-disabled":ge},this.renderPrev(An)),ze,k.a.createElement("li",{title:V?G.next_page:null,onClick:this.next,tabIndex:Ee?null:0,onKeyPress:this.runIfEnterNext,className:b()("".concat(v,"-next"),Object(Y.a)({},"".concat(v,"-disabled"),Ee)),"aria-disabled":Ee},this.renderNext(mn)),k.a.createElement(r,{disabled:U,locale:G,rootPrefixCls:v,selectComponentClass:Je,selectPrefixCls:Ke,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:nt,pageSize:Kt,pageSizeOptions:be,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Ut}))}}],[{key:"getDerivedStateFromProps",value:function(h,c){var v={};if("current"in h&&(v.current=h.current,h.current!==c.current&&(v.currentInputValue=v.current)),"pageSize"in h&&h.pageSize!==c.pageSize){var p=c.current,E=R(h.pageSize,c,h);p=p>E?E:p,"current"in h||(v.current=p,v.currentInputValue=p),v.pageSize=h.pageSize}return v}}]),_}(k.a.Component);w.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:o,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:o,locale:u.a,style:{},itemRender:n,totalBoundaryShowSizeChanger:50};var x=w},"6RRn":function(tn,Qe,I){"use strict";var te=I("wCXF"),Y=I("n6Qo");I.d(Qe,"b",function(){return Y.a});var N=I("IBYe"),K=I("6eGT"),A=I("hW8S");I.d(Qe,"a",function(){return A.a}),Qe.c=te.b},"6UM0":function(tn,Qe,I){var te,Y;(function(){var N;(function(){"use strict";var A=[function(k,D,b){var m=b(1).Beautifier,f=b(5).Options;function d(s,r){var u=new m(s,r);return u.beautify()}k.exports=d,k.exports.defaultOptions=function(){return new f}},function(k,D,b){var m=b(2).Output,f=b(3).Token,d=b(4),s=b(5).Options,r=b(7).Tokenizer,u=b(7).line_starters,o=b(7).positionable_operators,a=b(7).TOKEN;function n(T,V){return V.indexOf(T)!==-1}function R(T){return T.replace(/^\s+/g,"")}function w(T){for(var V={},Z=0;Z<T.length;Z++)V[T[Z].replace(/-/g,"_")]=T[Z];return V}function x(T,V){return T&&T.type===a.RESERVED&&T.text===V}function O(T,V){return T&&T.type===a.RESERVED&&n(T.text,V)}var C=["case","return","do","if","throw","else","await","break","continue","async"],_=["before-newline","after-newline","preserve-newline"],y=w(_),h=[y.before_newline,y.preserve_newline],c={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function v(T,V){if(V.multiline_frame||V.mode===c.ForInitializer||V.mode===c.Conditional)return;T.remove_indent(V.start_line_index)}function p(T){T=T.replace(d.allLineBreaks,`
|
|
`);for(var V=[],Z=T.indexOf(`
|
|
`);Z!==-1;)V.push(T.substring(0,Z)),T=T.substring(Z+1),Z=T.indexOf(`
|
|
`);return T.length&&V.push(T),V}function E(T){return T===c.ArrayLiteral}function U(T){return n(T,[c.Expression,c.ForInitializer,c.Conditional])}function F(T,V){for(var Z=0;Z<T.length;Z++){var oe=T[Z].trim();if(oe.charAt(0)!==V)return!1}return!0}function z(T,V){for(var Z=0,oe=T.length,pe;Z<oe;Z++)if(pe=T[Z],pe&&pe.indexOf(V)!==0)return!1;return!0}function G(T,V){V=V||{},this._source_text=T||"",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 s(V)}G.prototype.create_flags=function(T,V){var Z=0;T&&(Z=T.indentation_level,!this._output.just_added_newline()&&T.line_indent_level>Z&&(Z=T.line_indent_level));var oe={mode:V,parent:T,last_token:T?T.last_token:new f(a.START_BLOCK,""),last_word:T?T.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:Z,alignment:0,line_indent_level:T?T.line_indent_level:Z,start_line_index:this._output.get_line_number(),ternary_depth:0};return oe},G.prototype._reset=function(T){var V=T.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new m(this._options,V),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(c.BlockStatement);var Z=new r(T,this._options);return this._tokens=Z.tokenize(),T},G.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var T,V=this._reset(this._source_text),Z=this._options.eol;this._options.eol==="auto"&&(Z=`
|
|
`,V&&d.lineBreak.test(V||"")&&(Z=V.match(d.lineBreak)[0]));for(var oe=this._tokens.next();oe;)this.handle_token(oe),this._last_last_text=this._flags.last_token.text,this._flags.last_token=oe,oe=this._tokens.next();return T=this._output.get_code(Z),T},G.prototype.handle_token=function(T,V){T.type===a.START_EXPR?this.handle_start_expr(T):T.type===a.END_EXPR?this.handle_end_expr(T):T.type===a.START_BLOCK?this.handle_start_block(T):T.type===a.END_BLOCK?this.handle_end_block(T):T.type===a.WORD?this.handle_word(T):T.type===a.RESERVED?this.handle_word(T):T.type===a.SEMICOLON?this.handle_semicolon(T):T.type===a.STRING?this.handle_string(T):T.type===a.EQUALS?this.handle_equals(T):T.type===a.OPERATOR?this.handle_operator(T):T.type===a.COMMA?this.handle_comma(T):T.type===a.BLOCK_COMMENT?this.handle_block_comment(T,V):T.type===a.COMMENT?this.handle_comment(T,V):T.type===a.DOT?this.handle_dot(T):T.type===a.EOF?this.handle_eof(T):T.type===a.UNKNOWN?this.handle_unknown(T,V):this.handle_unknown(T,V)},G.prototype.handle_whitespace_and_comments=function(T,V){var Z=T.newlines,oe=this._options.keep_array_indentation&&E(this._flags.mode);if(T.comments_before)for(var pe=T.comments_before.next();pe;)this.handle_whitespace_and_comments(pe,V),this.handle_token(pe,V),pe=T.comments_before.next();if(oe)for(var Ye=0;Ye<Z;Ye+=1)this.print_newline(Ye>0,V);else if(this._options.max_preserve_newlines&&Z>this._options.max_preserve_newlines&&(Z=this._options.max_preserve_newlines),this._options.preserve_newlines&&Z>1){this.print_newline(!1,V);for(var xe=1;xe<Z;xe+=1)this.print_newline(!0,V)}};var B=["async","break","continue","return","throw","yield"];G.prototype.allow_wrap_or_preserved_newline=function(T,V){if(V=V===void 0?!1:V,this._output.just_added_newline())return;var Z=this._options.preserve_newlines&&T.newlines||V,oe=n(this._flags.last_token.text,o)||n(T.text,o);if(oe){var pe=n(this._flags.last_token.text,o)&&n(this._options.operator_position,h)||n(T.text,o);Z=Z&&pe}if(Z)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(O(this._flags.last_token,B))return;this._output.set_wrap_point()}},G.prototype.print_newline=function(T,V){if(!V&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==a.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var Z=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&x(Z,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(T)&&(this._flags.multiline_frame=!0)},G.prototype.print_token_line_indentation=function(T){this._output.just_added_newline()&&(this._options.keep_array_indentation&&T.newlines&&(T.text==="["||E(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(T.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))},G.prototype.print_token=function(T){if(this._output.raw){this._output.add_raw_token(T);return}if(this._options.comma_first&&T.previous&&T.previous.type===a.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var V=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(V),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(T),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(T),this._output.non_breaking_space=!0,this._output.add_token(T.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},G.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},G.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))},G.prototype.set_mode=function(T){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,T),this._flags=this.create_flags(this._previous_flags,T),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},G.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===c.Statement&&v(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},G.prototype.start_of_object_property=function(){return this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||O(this._flags.last_token,["get","set"]))},G.prototype.start_of_statement=function(T){var V=!1;return V=V||O(this._flags.last_token,["var","let","const"])&&T.type===a.WORD,V=V||x(this._flags.last_token,"do"),V=V||!(this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement)&&O(this._flags.last_token,B)&&!T.newlines,V=V||x(this._flags.last_token,"else")&&!(x(T,"if")&&!T.comments_before),V=V||this._flags.last_token.type===a.END_EXPR&&(this._previous_flags.mode===c.ForInitializer||this._previous_flags.mode===c.Conditional),V=V||this._flags.last_token.type===a.WORD&&this._flags.mode===c.BlockStatement&&!this._flags.in_case&&!(T.text==="--"||T.text==="++")&&this._last_last_text!=="function"&&T.type!==a.WORD&&T.type!==a.RESERVED,V=V||this._flags.mode===c.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||O(this._flags.last_token,["get","set"])),V?(this.set_mode(c.Statement),this.indent(),this.handle_whitespace_and_comments(T,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(T,O(T,["do","for","if","while"])),!0):!1},G.prototype.handle_start_expr=function(T){this.start_of_statement(T)||this.handle_whitespace_and_comments(T);var V=c.Expression;if(T.text==="["){if(this._flags.last_token.type===a.WORD||this._flags.last_token.text===")"){O(this._flags.last_token,u)&&(this._output.space_before_token=!0),this.print_token(T),this.set_mode(V),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}V=c.ArrayLiteral,E(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())),n(this._flags.last_token.type,[a.START_EXPR,a.END_EXPR,a.WORD,a.OPERATOR,a.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===a.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,V=c.ForInitializer):n(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,V=c.Conditional):n(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&T.whitespace_before===""?this._output.space_before_token=!1:(n(this._flags.last_token.text,u)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===a.EQUALS||this._flags.last_token.type===a.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(T);else if(this._flags.last_token.type===a.WORD){this._output.space_before_token=!1;var Z=this._tokens.peek(-3);if(this._options.space_after_named_function&&Z){var oe=this._tokens.peek(-4);O(Z,["async","function"])||Z.text==="*"&&O(oe,["async","function"])?this._output.space_before_token=!0:this._flags.mode===c.ObjectLiteral?(Z.text==="{"||Z.text===","||Z.text==="*"&&(oe.text==="{"||oe.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(T);(this._flags.last_token.type===a.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(n(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&n(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===a.START_BLOCK?this.print_newline():(this._flags.last_token.type===a.END_EXPR||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===a.COMMA)&&this.allow_wrap_or_preserved_newline(T,T.newlines),this.print_token(T),this.set_mode(V),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},G.prototype.handle_end_expr=function(T){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(T),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(T,T.text==="]"&&E(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===a.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(T),this.restore_mode(),v(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===c.Conditional&&(this._previous_flags.mode=c.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},G.prototype.handle_start_block=function(T){this.handle_whitespace_and_comments(T);var V=this._tokens.peek(),Z=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===a.END_EXPR?(this.set_mode(c.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(c.BlockStatement):Z&&(n(Z.text,[":",","])&&n(V.type,[a.STRING,a.WORD,a.RESERVED])||n(V.text,["get","set","..."])&&n(Z.type,[a.WORD,a.RESERVED]))?n(this._last_last_text,["class","interface"])&&!n(Z.text,[":",","])?this.set_mode(c.BlockStatement):this.set_mode(c.ObjectLiteral):this._flags.last_token.type===a.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(c.BlockStatement):n(this._flags.last_token.type,[a.EQUALS,a.START_EXPR,a.COMMA,a.OPERATOR])||O(this._flags.last_token,["return","throw","import","default"])?this.set_mode(c.ObjectLiteral):this.set_mode(c.BlockStatement),this._flags.last_token&&(O(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var oe=!V.comments_before&&V.text==="}",pe=oe&&this._flags.last_word==="function"&&this._flags.last_token.type===a.END_EXPR;if(this._options.brace_preserve_inline){var Ye=0,xe=null;this._flags.inline_frame=!0;do if(Ye+=1,xe=this._tokens.peek(Ye-1),xe.newlines){this._flags.inline_frame=!1;break}while(xe.type!==a.EOF&&!(xe.type===a.END_BLOCK&&xe.opened===T))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&T.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==a.OPERATOR&&(pe||this._flags.last_token.type===a.EQUALS||O(this._flags.last_token,C)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(E(this._previous_flags.mode)&&(this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.COMMA)&&((this._flags.last_token.type===a.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(T),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==a.OPERATOR&&this._flags.last_token.type!==a.START_EXPR&&(this._flags.last_token.type===a.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(T),this.indent(),!oe&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},G.prototype.handle_end_block=function(T){for(this.handle_whitespace_and_comments(T);this._flags.mode===c.Statement;)this.restore_mode();var V=this._flags.last_token.type===a.START_BLOCK;this._flags.inline_frame&&!V?this._output.space_before_token=!0:this._options.brace_style==="expand"?V||this.print_newline():V||(E(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(T)},G.prototype.handle_word=function(T){if(T.type===a.RESERVED){if(n(T.text,["set","get"])&&this._flags.mode!==c.ObjectLiteral)T.type=a.WORD;else if(T.text==="import"&&n(this._tokens.peek().text,["(","."]))T.type=a.WORD;else if(n(T.text,["as","from"])&&!this._flags.import_block)T.type=a.WORD;else if(this._flags.mode===c.ObjectLiteral){var V=this._tokens.peek();V.text===":"&&(T.type=a.WORD)}}if(this.start_of_statement(T)?O(this._flags.last_token,["var","let","const"])&&T.type===a.WORD&&(this._flags.declaration_statement=!0):T.newlines&&!U(this._flags.mode)&&(this._flags.last_token.type!==a.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==a.EQUALS&&(this._options.preserve_newlines||!O(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(T),this.print_newline()):this.handle_whitespace_and_comments(T),this._flags.do_block&&!this._flags.do_while)if(x(T,"while")){this._output.space_before_token=!0,this.print_token(T),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&&x(T,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===c.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&O(T,["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(T),this._flags.in_case=!0;return}if((this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.EQUALS||this._flags.last_token.type===a.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(T)),x(T,"function")){(n(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(n(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===a.OPERATOR))&&(!this._output.just_added_blankline()&&!T.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD?O(this._flags.last_token,["get","set","new","export"])||O(this._flags.last_token,B)?this._output.space_before_token=!0:x(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===a.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(U(this._flags.mode)||E(this._flags.mode))||this.print_newline(),this.print_token(T),this._flags.last_word=T.text;return}var Z="NONE";if(this._flags.last_token.type===a.END_BLOCK?this._previous_flags.inline_frame?Z="SPACE":O(T,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&T.newlines?Z="NEWLINE":(Z="SPACE",this._output.space_before_token=!0):Z="NEWLINE":this._flags.last_token.type===a.SEMICOLON&&this._flags.mode===c.BlockStatement?Z="NEWLINE":this._flags.last_token.type===a.SEMICOLON&&U(this._flags.mode)?Z="SPACE":this._flags.last_token.type===a.STRING?Z="NEWLINE":this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD||this._flags.last_token.text==="*"&&(n(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&n(this._last_last_text,["{",","]))?Z="SPACE":this._flags.last_token.type===a.START_BLOCK?this._flags.inline_frame?Z="SPACE":Z="NEWLINE":this._flags.last_token.type===a.END_EXPR&&(this._output.space_before_token=!0,Z="NEWLINE"),O(T,u)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?Z="SPACE":Z="NEWLINE"),O(T,["else","catch","finally"]))if((!(this._flags.last_token.type===a.END_BLOCK&&this._previous_flags.mode===c.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&T.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var oe=this._output.current_line;oe.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else Z==="NEWLINE"?O(this._flags.last_token,C)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&O(T,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==a.END_EXPR?(this._flags.last_token.type!==a.START_EXPR||!O(T,["var","let","const"]))&&this._flags.last_token.text!==":"&&(x(T,"if")&&x(T.previous,"else")?this._output.space_before_token=!0:this.print_newline()):O(T,u)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&E(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():Z==="SPACE"&&(this._output.space_before_token=!0);T.previous&&(T.previous.type===a.WORD||T.previous.type===a.RESERVED)&&(this._output.space_before_token=!0),this.print_token(T),this._flags.last_word=T.text,T.type===a.RESERVED&&(T.text==="do"?this._flags.do_block=!0:T.text==="if"?this._flags.if_block=!0:T.text==="import"?this._flags.import_block=!0:this._flags.import_block&&x(T,"from")&&(this._flags.import_block=!1))},G.prototype.handle_semicolon=function(T){this.start_of_statement(T)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(T);for(var V=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&x(V,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(T)},G.prototype.handle_string=function(T){T.text.startsWith("`")&&T.newlines===0&&T.whitespace_before===""&&(T.previous.text===")"||this._flags.last_token.type===a.WORD)||(this.start_of_statement(T)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(T),this._flags.last_token.type===a.RESERVED||this._flags.last_token.type===a.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR||this._flags.last_token.type===a.EQUALS||this._flags.last_token.type===a.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(T):T.text.startsWith("`")&&this._flags.last_token.type===a.END_EXPR&&(T.previous.text==="]"||T.previous.text===")")&&T.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(T)},G.prototype.handle_equals=function(T){this.start_of_statement(T)||this.handle_whitespace_and_comments(T),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(T),this._output.space_before_token=!0},G.prototype.handle_comma=function(T){this.handle_whitespace_and_comments(T,!0),this.print_token(T),this._output.space_before_token=!0,this._flags.declaration_statement?(U(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(T)):this._flags.mode===c.ObjectLiteral||this._flags.mode===c.Statement&&this._flags.parent.mode===c.ObjectLiteral?(this._flags.mode===c.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(T)},G.prototype.handle_operator=function(T){var V=T.text==="*"&&(O(this._flags.last_token,["function","yield"])||n(this._flags.last_token.type,[a.START_BLOCK,a.COMMA,a.END_BLOCK,a.SEMICOLON])),Z=n(T.text,["-","+"])&&(n(this._flags.last_token.type,[a.START_BLOCK,a.START_EXPR,a.EQUALS,a.OPERATOR])||n(this._flags.last_token.text,u)||this._flags.last_token.text===",");if(!this.start_of_statement(T)){var oe=!V;this.handle_whitespace_and_comments(T,oe)}if(T.text==="*"&&this._flags.last_token.type===a.DOT){this.print_token(T);return}if(T.text==="::"){this.print_token(T);return}if(this._flags.last_token.type===a.OPERATOR&&n(this._options.operator_position,h)&&this.allow_wrap_or_preserved_newline(T),T.text===":"&&this._flags.in_case){this.print_token(T),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==a.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var pe=!0,Ye=!0,xe=!1;if(T.text===":"?this._flags.ternary_depth===0?pe=!1:(this._flags.ternary_depth-=1,xe=!0):T.text==="?"&&(this._flags.ternary_depth+=1),!Z&&!V&&this._options.preserve_newlines&&n(T.text,o)){var Ie=T.text===":",Je=Ie&&xe,Ke=Ie&&!xe;switch(this._options.operator_position){case y.before_newline:this._output.space_before_token=!Ke,this.print_token(T),(!Ie||Je)&&this.allow_wrap_or_preserved_newline(T),this._output.space_before_token=!0;return;case y.after_newline:this._output.space_before_token=!0,!Ie||Je?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(T):this._output.space_before_token=!1,this.print_token(T),this._output.space_before_token=!0;return;case y.preserve_newline:Ke||this.allow_wrap_or_preserved_newline(T),pe=!(this._output.just_added_newline()||Ke),this._output.space_before_token=pe,this.print_token(T),this._output.space_before_token=!0;return}}if(V){this.allow_wrap_or_preserved_newline(T),pe=!1;var be=this._tokens.peek();Ye=be&&n(be.type,[a.WORD,a.RESERVED])}else if(T.text==="...")this.allow_wrap_or_preserved_newline(T),pe=this._flags.last_token.type===a.START_BLOCK,Ye=!1;else if(n(T.text,["--","++","!","~"])||Z){if((this._flags.last_token.type===a.COMMA||this._flags.last_token.type===a.START_EXPR)&&this.allow_wrap_or_preserved_newline(T),pe=!1,Ye=!1,T.newlines&&(T.text==="--"||T.text==="++"||T.text==="~")){var de=O(this._flags.last_token,C)&&T.newlines;de&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(de,!0)}this._flags.last_token.text===";"&&U(this._flags.mode)&&(pe=!0),this._flags.last_token.type===a.RESERVED?pe=!0:this._flags.last_token.type===a.END_EXPR?pe=!(this._flags.last_token.text==="]"&&(T.text==="--"||T.text==="++")):this._flags.last_token.type===a.OPERATOR&&(pe=n(T.text,["--","-","++","+"])&&n(this._flags.last_token.text,["--","-","++","+"]),n(T.text,["+","-"])&&n(this._flags.last_token.text,["--","++"])&&(Ye=!0)),(this._flags.mode===c.BlockStatement&&!this._flags.inline_frame||this._flags.mode===c.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(T),this._output.space_before_token=Ye},G.prototype.handle_block_comment=function(T,V){if(this._output.raw){this._output.add_raw_token(T),T.directives&&T.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(T.directives){this.print_newline(!1,V),this.print_token(T),T.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!d.newline.test(T.text)&&!T.newlines){this._output.space_before_token=!0,this.print_token(T),this._output.space_before_token=!0;return}else this.print_block_commment(T,V)},G.prototype.print_block_commment=function(T,V){var Z=p(T.text),oe,pe=!1,Ye=!1,xe=T.whitespace_before,Ie=xe.length;if(this.print_newline(!1,V),this.print_token_line_indentation(T),this._output.add_token(Z[0]),this.print_newline(!1,V),Z.length>1){for(Z=Z.slice(1),pe=F(Z,"*"),Ye=z(Z,xe),pe&&(this._flags.alignment=1),oe=0;oe<Z.length;oe++)pe?(this.print_token_line_indentation(T),this._output.add_token(R(Z[oe]))):Ye&&Z[oe]?(this.print_token_line_indentation(T),this._output.add_token(Z[oe].substring(Ie))):(this._output.current_line.set_indent(-1),this._output.add_token(Z[oe])),this.print_newline(!1,V);this._flags.alignment=0}},G.prototype.handle_comment=function(T,V){T.newlines?this.print_newline(!1,V):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(T),this.print_newline(!1,V)},G.prototype.handle_dot=function(T){this.start_of_statement(T)||this.handle_whitespace_and_comments(T,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),O(this._flags.last_token,C)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(T,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(T)},G.prototype.handle_unknown=function(T,V){this.print_token(T),T.text[T.text.length-1]===`
|
|
`&&this.print_newline(!1,V)},G.prototype.handle_eof=function(T){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(T)},k.exports.Beautifier=G},function(k){function D(f){this.__parent=f,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=[]}D.prototype.clone_empty=function(){var f=new D(this.__parent);return f.set_indent(this.__indent_count,this.__alignment_count),f},D.prototype.item=function(f){return f<0?this.__items[this.__items.length+f]:this.__items[f]},D.prototype.has_match=function(f){for(var d=this.__items.length-1;d>=0;d--)if(this.__items[d].match(f))return!0;return!1},D.prototype.set_indent=function(f,d){this.is_empty()&&(this.__indent_count=f||0,this.__alignment_count=d||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},D.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)},D.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},D.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var f=this.__parent.current_line;return f.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),f.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),f.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,f.__items[0]===" "&&(f.__items.splice(0,1),f.__character_count-=1),!0}return!1},D.prototype.is_empty=function(){return this.__items.length===0},D.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},D.prototype.push=function(f){this.__items.push(f);var d=f.lastIndexOf(`
|
|
`);d!==-1?this.__character_count=f.length-d:this.__character_count+=f.length},D.prototype.pop=function(){var f=null;return this.is_empty()||(f=this.__items.pop(),this.__character_count-=f.length),f},D.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},D.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},D.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},D.prototype.toString=function(){var f="";return this.is_empty()?this.__parent.indent_empty_lines&&(f=this.__parent.get_indent_string(this.__indent_count)):(f=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),f+=this.__items.join("")),f};function b(f,d){this.__cache=[""],this.__indent_size=f.indent_size,this.__indent_string=f.indent_char,f.indent_with_tabs||(this.__indent_string=new Array(f.indent_size+1).join(f.indent_char)),d=d||"",f.indent_level>0&&(d=new Array(f.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}b.prototype.get_indent_size=function(f,d){var s=this.__base_string_length;return d=d||0,f<0&&(s=0),s+=f*this.__indent_size,s+=d,s},b.prototype.get_indent_string=function(f,d){var s=this.__base_string;return d=d||0,f<0&&(f=0,s=""),d+=f*this.__indent_size,this.__ensure_cache(d),s+=this.__cache[d],s},b.prototype.__ensure_cache=function(f){for(;f>=this.__cache.length;)this.__add_column()},b.prototype.__add_column=function(){var f=this.__cache.length,d=0,s="";this.__indent_size&&f>=this.__indent_size&&(d=Math.floor(f/this.__indent_size),f-=d*this.__indent_size,s=new Array(d+1).join(this.__indent_string)),f&&(s+=new Array(f+1).join(" ")),this.__cache.push(s)};function m(f,d){this.__indent_cache=new b(f,d),this.raw=!1,this._end_with_newline=f.end_with_newline,this.indent_size=f.indent_size,this.wrap_line_length=f.wrap_line_length,this.indent_empty_lines=f.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new D(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(f,d){return this.__indent_cache.get_indent_string(f,d)},m.prototype.get_indent_size=function(f,d){return this.__indent_cache.get_indent_size(f,d)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(f){return this.is_empty()||!f&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(f){this.trim(!0);var d=this.current_line.pop();d&&(d[d.length-1]===`
|
|
`&&(d=d.replace(/\n+$/g,"")),this.current_line.push(d)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(`
|
|
`);return f!==`
|
|
`&&(s=s.replace(/[\n]/g,f)),s},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(f,d){return f=f||0,d=d||0,this.next_line.set_indent(f,d),this.__lines.length>1?(this.current_line.set_indent(f,d),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(f){for(var d=0;d<f.newlines;d++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(f.whitespace_before),this.current_line.push(f.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(f){this.__add_space_before_token(),this.current_line.push(f),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(f){for(var d=this.__lines.length;f<d;)this.__lines[f]._remove_indent(),f++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(f){for(f=f===void 0?!1:f,this.current_line.trim();f&&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(f,d){for(var s=this.__lines.length-2;s>=0;){var r=this.__lines[s];if(r.is_empty())break;if(r.item(0).indexOf(f)!==0&&r.item(-1)!==d){this.__lines.splice(s+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},k.exports.Output=m},function(k){function D(b,m,f,d){this.type=b,this.text=m,this.comments_before=null,this.newlines=f||0,this.whitespace_before=d||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}k.exports.Token=D},function(k,D){var b="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",f="\\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",d="\\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",s="(?:\\\\u[0-9a-fA-F]{4}|["+b+f+"])",r="(?:\\\\u[0-9a-fA-F]{4}|["+m+f+d+"])*";D.identifier=new RegExp(s+r,"g"),D.identifierStart=new RegExp(s),D.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+m+f+d+"])+");var u=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;D.newline=/[\n\r\u2028\u2029]/,D.lineBreak=new RegExp(`\r
|
|
|`+D.newline.source),D.allLineBreaks=new RegExp(D.lineBreak.source,"g")},function(k,D,b){var m=b(6).Options,f=["before-newline","after-newline","preserve-newline"];function d(s){m.call(this,s,"js");var r=this.raw_options.brace_style||null;r==="expand-strict"?this.raw_options.brace_style="expand":r==="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 u=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var o=0;o<u.length;o++)u[o]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=u[o];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",f),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}d.prototype=new m,k.exports.Options=d},function(k){function D(f,d){this.raw_options=b(f,d),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"])}D.prototype._get_array=function(f,d){var s=this.raw_options[f],r=d||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(r=s.concat()):typeof s=="string"&&(r=s.split(/[^a-zA-Z0-9_\/\-]+/)),r},D.prototype._get_boolean=function(f,d){var s=this.raw_options[f],r=s===void 0?!!d:!!s;return r},D.prototype._get_characters=function(f,d){var s=this.raw_options[f],r=d||"";return typeof s=="string"&&(r=s.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),r},D.prototype._get_number=function(f,d){var s=this.raw_options[f];d=parseInt(d,10),isNaN(d)&&(d=0);var r=parseInt(s,10);return isNaN(r)&&(r=d),r},D.prototype._get_selection=function(f,d,s){var r=this._get_selection_list(f,d,s);if(r.length!==1)throw new Error("Invalid Option Value: The option '"+f+`' can only be one of the following values:
|
|
`+d+`
|
|
You passed in: '`+this.raw_options[f]+"'");return r[0]},D.prototype._get_selection_list=function(f,d,s){if(!d||d.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[d[0]],!this._is_valid_selection(s,d))throw new Error("Invalid Default Value!");var r=this._get_array(f,s);if(!this._is_valid_selection(r,d))throw new Error("Invalid Option Value: The option '"+f+`' can contain only the following values:
|
|
`+d+`
|
|
You passed in: '`+this.raw_options[f]+"'");return r},D.prototype._is_valid_selection=function(f,d){return f.length&&d.length&&!f.some(function(s){return d.indexOf(s)===-1})};function b(f,d){var s={};f=m(f);var r;for(r in f)r!==d&&(s[r]=f[r]);if(d&&f[d])for(r in f[d])s[r]=f[d][r];return s}function m(f){var d={},s;for(s in f){var r=s.replace(/-/g,"_");d[r]=f[s]}return d}k.exports.Options=D,k.exports.normalizeOpts=m,k.exports.mergeOpts=b},function(k,D,b){var m=b(8).InputScanner,f=b(9).Tokenizer,d=b(9).TOKEN,s=b(13).Directives,r=b(4),u=b(12).Pattern,o=b(14).TemplatablePattern;function a(F,z){return z.indexOf(F)!==-1}var n={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:d.START,RAW:d.RAW,EOF:d.EOF},R=new s(/\/\*/,/\*\//),w=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,x=/[0-9]/,O=/[^\d\.]/,C=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),_=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";_=_.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),_="\\?\\.(?!\\d) "+_,_=_.replace(/ /g,"|");var y=new RegExp(_),h="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),c=h.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),v=new RegExp("^(?:"+c.join("|")+")$"),p,E=function(F,z){f.call(this,F,z),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var G=new u(this._input),B=new o(this._input).read_options(this._options);this.__patterns={template:B,identifier:B.starting_with(r.identifier).matching(r.identifierMatch),number:G.matching(w),punct:G.matching(y),comment:G.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:G.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:G.matching(/<!--/),html_comment_end:G.matching(/-->/),include:G.starting_with(/#include/).until_after(r.lineBreak),shebang:G.starting_with(/#!/).until_after(r.lineBreak),xml:G.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:B.until(/['\\\n\r\u2028\u2029]/),double_quote:B.until(/["\\\n\r\u2028\u2029]/),template_text:B.until(/[`\\$]/),template_expression:B.until(/[`}\\]/)}};E.prototype=new f,E.prototype._is_comment=function(F){return F.type===n.COMMENT||F.type===n.BLOCK_COMMENT||F.type===n.UNKNOWN},E.prototype._is_opening=function(F){return F.type===n.START_BLOCK||F.type===n.START_EXPR},E.prototype._is_closing=function(F,z){return(F.type===n.END_BLOCK||F.type===n.END_EXPR)&&z&&(F.text==="]"&&z.text==="["||F.text===")"&&z.text==="("||F.text==="}"&&z.text==="{")},E.prototype._reset=function(){p=!1},E.prototype._get_next_token=function(F,z){var G=null;this._readWhitespace();var B=this._input.peek();return B===null?this._create_token(n.EOF,""):(G=G||this._read_non_javascript(B),G=G||this._read_string(B),G=G||this._read_word(F),G=G||this._read_singles(B),G=G||this._read_comment(B),G=G||this._read_regexp(B,F),G=G||this._read_xml(B,F),G=G||this._read_punctuation(),G=G||this._create_token(n.UNKNOWN,this._input.next()),G)},E.prototype._read_word=function(F){var z;if(z=this.__patterns.identifier.read(),z!=="")return z=z.replace(r.allLineBreaks,`
|
|
`),!(F.type===n.DOT||F.type===n.RESERVED&&(F.text==="set"||F.text==="get"))&&v.test(z)?(z==="in"||z==="of")&&(F.type===n.WORD||F.type===n.STRING)?this._create_token(n.OPERATOR,z):this._create_token(n.RESERVED,z):this._create_token(n.WORD,z);if(z=this.__patterns.number.read(),z!=="")return this._create_token(n.WORD,z)},E.prototype._read_singles=function(F){var z=null;return F==="("||F==="["?z=this._create_token(n.START_EXPR,F):F===")"||F==="]"?z=this._create_token(n.END_EXPR,F):F==="{"?z=this._create_token(n.START_BLOCK,F):F==="}"?z=this._create_token(n.END_BLOCK,F):F===";"?z=this._create_token(n.SEMICOLON,F):F==="."&&O.test(this._input.peek(1))?z=this._create_token(n.DOT,F):F===","&&(z=this._create_token(n.COMMA,F)),z&&this._input.next(),z},E.prototype._read_punctuation=function(){var F=this.__patterns.punct.read();if(F!=="")return F==="="?this._create_token(n.EQUALS,F):F==="?."?this._create_token(n.DOT,F):this._create_token(n.OPERATOR,F)},E.prototype._read_non_javascript=function(F){var z="";if(F==="#"){if(this._is_first_token()&&(z=this.__patterns.shebang.read(),z))return this._create_token(n.UNKNOWN,z.trim()+`
|
|
`);if(z=this.__patterns.include.read(),z)return this._create_token(n.UNKNOWN,z.trim()+`
|
|
`);F=this._input.next();var G="#";if(this._input.hasNext()&&this._input.testChar(x)){do F=this._input.next(),G+=F;while(this._input.hasNext()&&F!=="#"&&F!=="=");return F==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(G+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(G+="{}",this._input.next(),this._input.next())),this._create_token(n.WORD,G)}this._input.back()}else if(F==="<"&&this._is_first_token()){if(z=this.__patterns.html_comment_start.read(),z){for(;this._input.hasNext()&&!this._input.testChar(r.newline);)z+=this._input.next();return p=!0,this._create_token(n.COMMENT,z)}}else if(p&&F==="-"&&(z=this.__patterns.html_comment_end.read(),z))return p=!1,this._create_token(n.COMMENT,z);return null},E.prototype._read_comment=function(F){var z=null;if(F==="/"){var G="";if(this._input.peek(1)==="*"){G=this.__patterns.block_comment.read();var B=R.get_directives(G);B&&B.ignore==="start"&&(G+=R.readIgnored(this._input)),G=G.replace(r.allLineBreaks,`
|
|
`),z=this._create_token(n.BLOCK_COMMENT,G),z.directives=B}else this._input.peek(1)==="/"&&(G=this.__patterns.comment.read(),z=this._create_token(n.COMMENT,G))}return z},E.prototype._read_string=function(F){if(F==="`"||F==="'"||F==='"'){var z=this._input.next();return this.has_char_escapes=!1,F==="`"?z+=this._read_string_recursive("`",!0,"${"):z+=this._read_string_recursive(F),this.has_char_escapes&&this._options.unescape_strings&&(z=U(z)),this._input.peek()===F&&(z+=this._input.next()),z=z.replace(r.allLineBreaks,`
|
|
`),this._create_token(n.STRING,z)}return null},E.prototype._allow_regexp_or_xml=function(F){return F.type===n.RESERVED&&a(F.text,["return","case","throw","else","do","typeof","yield"])||F.type===n.END_EXPR&&F.text===")"&&F.opened.previous.type===n.RESERVED&&a(F.opened.previous.text,["if","while","for"])||a(F.type,[n.COMMENT,n.START_EXPR,n.START_BLOCK,n.START,n.END_BLOCK,n.OPERATOR,n.EQUALS,n.EOF,n.SEMICOLON,n.COMMA])},E.prototype._read_regexp=function(F,z){if(F==="/"&&this._allow_regexp_or_xml(z)){for(var G=this._input.next(),B=!1,T=!1;this._input.hasNext()&&(B||T||this._input.peek()!==F)&&!this._input.testChar(r.newline);)G+=this._input.peek(),B?B=!1:(B=this._input.peek()==="\\",this._input.peek()==="["?T=!0:this._input.peek()==="]"&&(T=!1)),this._input.next();return this._input.peek()===F&&(G+=this._input.next(),G+=this._input.read(r.identifier)),this._create_token(n.STRING,G)}return null},E.prototype._read_xml=function(F,z){if(this._options.e4x&&F==="<"&&this._allow_regexp_or_xml(z)){var G="",B=this.__patterns.xml.read_match();if(B){for(var T=B[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),V=T.indexOf("{")===0,Z=0;B;){var oe=!!B[1],pe=B[2],Ye=!!B[B.length-1]||pe.slice(0,8)==="![CDATA[";if(!Ye&&(pe===T||V&&pe.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(oe?--Z:++Z),G+=B[0],Z<=0)break;B=this.__patterns.xml.read_match()}return B||(G+=this._input.match(/[\s\S]*/g)[0]),G=G.replace(r.allLineBreaks,`
|
|
`),this._create_token(n.STRING,G)}}return null};function U(F){for(var z="",G=0,B=new m(F),T=null;B.hasNext();)if(T=B.match(/([\s]|[^\\]|\\\\)+/g),T&&(z+=T[0]),B.peek()==="\\"){if(B.next(),B.peek()==="x")T=B.match(/x([0-9A-Fa-f]{2})/g);else if(B.peek()==="u")T=B.match(/u([0-9A-Fa-f]{4})/g);else{z+="\\",B.hasNext()&&(z+=B.next());continue}if(!T)return F;if(G=parseInt(T[1],16),G>126&&G<=255&&T[0].indexOf("x")===0)return F;if(G>=0&&G<32){z+="\\"+T[0];continue}else G===34||G===39||G===92?z+="\\"+String.fromCharCode(G):z+=String.fromCharCode(G)}return z}E.prototype._read_string_recursive=function(F,z,G){var B,T;F==="'"?T=this.__patterns.single_quote:F==='"'?T=this.__patterns.double_quote:F==="`"?T=this.__patterns.template_text:F==="}"&&(T=this.__patterns.template_expression);for(var V=T.read(),Z="";this._input.hasNext();){if(Z=this._input.next(),Z===F||!z&&r.newline.test(Z)){this._input.back();break}else Z==="\\"&&this._input.hasNext()?(B=this._input.peek(),B==="x"||B==="u"?this.has_char_escapes=!0:B==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),Z+=this._input.next()):G&&(G==="${"&&Z==="$"&&this._input.peek()==="{"&&(Z+=this._input.next()),G===Z&&(F==="`"?Z+=this._read_string_recursive("}",z,"`"):Z+=this._read_string_recursive("`",z,"${"),this._input.hasNext()&&(Z+=this._input.next())));Z+=T.read(),V+=Z}return V},k.exports.Tokenizer=E,k.exports.TOKEN=n,k.exports.positionable_operators=C.slice(),k.exports.line_starters=h.slice()},function(k){var D=RegExp.prototype.hasOwnProperty("sticky");function b(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}b.prototype.restart=function(){this.__position=0},b.prototype.back=function(){this.__position>0&&(this.__position-=1)},b.prototype.hasNext=function(){return this.__position<this.__input_length},b.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},b.prototype.peek=function(m){var f=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(f=this.__input.charAt(m)),f},b.prototype.__match=function(m,f){m.lastIndex=f;var d=m.exec(this.__input);return d&&!(D&&m.sticky)&&(d.index!==f&&(d=null)),d},b.prototype.test=function(m,f){return f=f||0,f+=this.__position,f>=0&&f<this.__input_length?!!this.__match(m,f):!1},b.prototype.testChar=function(m,f){var d=this.peek(f);return m.lastIndex=0,d!==null&&m.test(d)},b.prototype.match=function(m){var f=this.__match(m,this.__position);return f?this.__position+=f[0].length:f=null,f},b.prototype.read=function(m,f,d){var s="",r;return m&&(r=this.match(m),r&&(s+=r[0])),f&&(r||!m)&&(s+=this.readUntil(f,d)),s},b.prototype.readUntil=function(m,f){var d="",s=this.__position;m.lastIndex=this.__position;var r=m.exec(this.__input);return r?(s=r.index,f&&(s+=r[0].length)):s=this.__input_length,d=this.__input.substring(this.__position,s),this.__position=s,d},b.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},b.prototype.get_regexp=function(m,f){var d=null,s="g";return f&&D&&(s="y"),typeof m=="string"&&m!==""?d=new RegExp(m,s):m&&(d=new RegExp(m.source,s)),d},b.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},b.prototype.peekUntilAfter=function(m){var f=this.__position,d=this.readUntilAfter(m);return this.__position=f,d},b.prototype.lookBack=function(m){var f=this.__position-1;return f>=m.length&&this.__input.substring(f-m.length,f).toLowerCase()===m},k.exports.InputScanner=b},function(k,D,b){var m=b(8).InputScanner,f=b(3).Token,d=b(10).TokenStream,s=b(11).WhitespacePattern,r={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},u=function(o,a){this._input=new m(o),this._options=a||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};u.prototype.tokenize=function(){this._input.restart(),this.__tokens=new d,this._reset();for(var o,a=new f(r.START,""),n=null,R=[],w=new d;a.type!==r.EOF;){for(o=this._get_next_token(a,n);this._is_comment(o);)w.add(o),o=this._get_next_token(a,n);w.isEmpty()||(o.comments_before=w,w=new d),o.parent=n,this._is_opening(o)?(R.push(n),n=o):n&&this._is_closing(o,n)&&(o.opened=n,n.closed=o,n=R.pop(),o.parent=n),o.previous=a,a.next=o,this.__tokens.add(o),a=o}return this.__tokens},u.prototype._is_first_token=function(){return this.__tokens.isEmpty()},u.prototype._reset=function(){},u.prototype._get_next_token=function(o,a){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(r.RAW,n):this._create_token(r.EOF,"")},u.prototype._is_comment=function(o){return!1},u.prototype._is_opening=function(o){return!1},u.prototype._is_closing=function(o,a){return!1},u.prototype._create_token=function(o,a){var n=new f(o,a,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return n},u.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},k.exports.Tokenizer=u,k.exports.TOKEN=r},function(k){function D(b){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=b}D.prototype.restart=function(){this.__position=0},D.prototype.isEmpty=function(){return this.__tokens_length===0},D.prototype.hasNext=function(){return this.__position<this.__tokens_length},D.prototype.next=function(){var b=null;return this.hasNext()&&(b=this.__tokens[this.__position],this.__position+=1),b},D.prototype.peek=function(b){var m=null;return b=b||0,b+=this.__position,b>=0&&b<this.__tokens_length&&(m=this.__tokens[b]),m},D.prototype.add=function(b){this.__parent_token&&(b.parent=this.__parent_token),this.__tokens.push(b),this.__tokens_length+=1},k.exports.TokenStream=D},function(k,D,b){var m=b(12).Pattern;function f(d,s){m.call(this,d,s),s?this._line_regexp=this._input.get_regexp(s._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}f.prototype=new m,f.prototype.__set_whitespace_patterns=function(d,s){d+="\\t ",s+="\\n\\r",this._match_pattern=this._input.get_regexp("["+d+s+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+s+"]")},f.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var d=this._input.read(this._match_pattern);if(d===" ")this.whitespace_before_token=" ";else if(d){var s=this.__split(this._newline_regexp,d);this.newline_count=s.length-1,this.whitespace_before_token=s[this.newline_count]}return d},f.prototype.matching=function(d,s){var r=this._create();return r.__set_whitespace_patterns(d,s),r._update(),r},f.prototype._create=function(){return new f(this._input,this)},f.prototype.__split=function(d,s){d.lastIndex=0;for(var r=0,u=[],o=d.exec(s);o;)u.push(s.substring(r,o.index)),r=o.index+o[0].length,o=d.exec(s);return r<s.length?u.push(s.substring(r,s.length)):u.push(""),u},k.exports.WhitespacePattern=f},function(k){function D(b,m){this._input=b,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)}D.prototype.read=function(){var b=this._input.read(this._starting_pattern);return(!this._starting_pattern||b)&&(b+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),b},D.prototype.read_match=function(){return this._input.match(this._match_pattern)},D.prototype.until_after=function(b){var m=this._create();return m._until_after=!0,m._until_pattern=this._input.get_regexp(b),m._update(),m},D.prototype.until=function(b){var m=this._create();return m._until_after=!1,m._until_pattern=this._input.get_regexp(b),m._update(),m},D.prototype.starting_with=function(b){var m=this._create();return m._starting_pattern=this._input.get_regexp(b,!0),m._update(),m},D.prototype.matching=function(b){var m=this._create();return m._match_pattern=this._input.get_regexp(b,!0),m._update(),m},D.prototype._create=function(){return new D(this._input,this)},D.prototype._update=function(){},k.exports.Pattern=D},function(k){function D(b,m){b=typeof b=="string"?b:b.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(b+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(b+/\sbeautify\signore:end\s/.source+m,"g")}D.prototype.get_directives=function(b){if(!b.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var f=this.__directive_pattern.exec(b);f;)m[f[1]]=f[2],f=this.__directive_pattern.exec(b);return m},D.prototype.readIgnored=function(b){return b.readUntilAfter(this.__directives_end_ignore_pattern)},k.exports.Directives=D},function(k,D,b){var m=b(12).Pattern,f={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function d(s,r){m.call(this,s,r),this.__template_pattern=null,this._disabled=Object.assign({},f),this._excluded=Object.assign({},f),r&&(this.__template_pattern=this._input.get_regexp(r.__template_pattern),this._excluded=Object.assign(this._excluded,r._excluded),this._disabled=Object.assign(this._disabled,r._disabled));var u=new m(s);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}/)}}d.prototype=new m,d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){this.__set_templated_pattern()},d.prototype.disable=function(s){var r=this._create();return r._disabled[s]=!0,r._update(),r},d.prototype.read_options=function(s){var r=this._create();for(var u in f)r._disabled[u]=s.templating.indexOf(u)===-1;return r._update(),r},d.prototype.exclude=function(s){var r=this._create();return r._excluded[s]=!0,r._update(),r},d.prototype.read=function(){var s="";this._match_pattern?s=this._input.read(this._starting_pattern):s=this._input.read(this._starting_pattern,this.__template_pattern);for(var r=this._read_template();r;)this._match_pattern?r+=this._input.read(this._match_pattern):r+=this._input.readUntil(this.__template_pattern),s+=r,r=this._read_template();return this._until_after&&(s+=this._input.readUntilAfter(this._until_pattern)),s},d.prototype.__set_templated_pattern=function(){var s=[];this._disabled.php||s.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||s.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||s.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(s.push(this.__patterns.django._starting_pattern.source),s.push(this.__patterns.django_value._starting_pattern.source),s.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||s.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&s.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+s.join("|")+")")},d.prototype._read_template=function(){var s="",r=this._input.peek();if(r==="<"){var u=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&u==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&u==="%"&&(s=s||this.__patterns.erb.read())}else r==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(s=s||this.__patterns.handlebars_comment.read(),s=s||this.__patterns.handlebars_unescaped.read(),s=s||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(s=s||this.__patterns.django_value.read()),this._excluded.django||(s=s||this.__patterns.django_comment.read(),s=s||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(s=s||this.__patterns.smarty_comment.read(),s=s||this.__patterns.smarty_literal.read(),s=s||this.__patterns.smarty.read()));return s},k.exports.TemplatablePattern=d}],M={};function H(k){var D=M[k];if(D!==void 0)return D.exports;var b=M[k]={exports:{}};return A[k](b,b.exports,H),b.exports}var P=H(0);N=P})();var K=N;!(te=[],Y=function(){return{js_beautify:K}}.apply(Qe,te),Y!==void 0&&(tn.exports=Y))})()},"6eGT":function(tn,Qe,I){"use strict";function te(Y){return null}Qe.a=te},"7Cbv":function(tn,Qe,I){"use strict";var te=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 N(){if(!te)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return te(Y)}var K=/^(?:[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 A(f){return typeof f=="string"&&K.test(f)}for(var M=A,H=[],P=0;P<256;++P)H.push((P+256).toString(16).substr(1));function k(f){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=(H[f[d+0]]+H[f[d+1]]+H[f[d+2]]+H[f[d+3]]+"-"+H[f[d+4]]+H[f[d+5]]+"-"+H[f[d+6]]+H[f[d+7]]+"-"+H[f[d+8]]+H[f[d+9]]+"-"+H[f[d+10]]+H[f[d+11]]+H[f[d+12]]+H[f[d+13]]+H[f[d+14]]+H[f[d+15]]).toLowerCase();if(!M(s))throw TypeError("Stringified UUID is invalid");return s}var D=k;function b(f,d,s){f=f||{};var r=f.random||(f.rng||N)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,d){s=s||0;for(var u=0;u<16;++u)d[s+u]=r[u];return d}return D(r)}var m=Qe.a=b},"7ahc":function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return R});var te=I("k1fw"),Y=I("0Owb"),N=I("+L6B"),K=I("2/Rp"),A=I("y8nQ"),M=I("Vl3Y"),H=I("tJVT"),P=I("OaEy"),k=I("2fM7"),D=I("q1tI"),b=I.n(D),m=I("VrN/"),f=I.n(m),d=I("p77/"),s=I.n(d),r=I("c5Ni"),u=I.n(r),o=k.a.Option,a={labelCol:{span:4},wrapperCol:{span:20}},n={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"]};Qe.b=function(w){var x=w.callback,O=w.onCancel,C=Object(D.useState)("python"),_=Object(H.a)(C,2),y=_[0],h=_[1];function c(p){h(n[p][1])}function v(p){x(p)}return b.a.createElement(M.a,Object(Y.a)({},a,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:v}),b.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},b.a.createElement(k.a,{onChange:c},Object.keys(n).map(function(p){return b.a.createElement(o,{key:p,value:p},n[p][0])}))),b.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},b.a.createElement(R,{mode:y})),b.a.createElement("div",{className:"flex-container flex-end"},b.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),b.a.createElement(K.a,{type:"ghost",onClick:O},"\u53D6\u6D88")))};function R(w){var x=w.value,O=w.onChange,C=w.mode,_=w.options,y=_===void 0?{}:_,h=Object(D.useRef)(),c=Object(D.useState)(),v=Object(H.a)(c,2),p=v[0],E=v[1];return Object(D.useEffect)(function(){if(p){function U(F){var z=F.getValue();O&&O(z)}return p.on("change",U),function(){p.off("change",U)}}},[p,O]),Object(D.useEffect)(function(){p&&p.setOption("mode",C)},[p,C]),Object(D.useEffect)(function(){p&&((x!==p.getValue()||x==="")&&setTimeout(function(){p.setValue(x||" ")},300))},[p,x]),Object(D.useEffect)(function(){if(h.current&&!p){var U=f.a.fromTextArea(h.current,Object(te.a)({mode:C,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},y));E(U)}},[h.current,p]),b.a.createElement("div",{className:"my-codemirror-container"},b.a.createElement("textarea",{ref:h}))}},"7ixt":function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return N});var te={adjustX:1,adjustY:1},Y=[0,0],N={left:{points:["cr","cl"],overflow:te,offset:[-4,0],targetOffset:Y},right:{points:["cl","cr"],overflow:te,offset:[4,0],targetOffset:Y},top:{points:["bc","tc"],overflow:te,offset:[0,-4],targetOffset:Y},bottom:{points:["tc","bc"],overflow:te,offset:[0,4],targetOffset:Y},topLeft:{points:["bl","tl"],overflow:te,offset:[0,-4],targetOffset:Y},leftTop:{points:["tr","tl"],overflow:te,offset:[-4,0],targetOffset:Y},topRight:{points:["br","tr"],overflow:te,offset:[0,-4],targetOffset:Y},rightTop:{points:["tl","tr"],overflow:te,offset:[4,0],targetOffset:Y},bottomRight:{points:["tr","br"],overflow:te,offset:[0,4],targetOffset:Y},rightBottom:{points:["bl","br"],overflow:te,offset:[4,0],targetOffset:Y},bottomLeft:{points:["tl","bl"],overflow:te,offset:[0,4],targetOffset:Y},leftBottom:{points:["br","bl"],overflow:te,offset:[-4,0],targetOffset:Y}},K=N},"815F":function(tn,Qe,I){"use strict";I.d(Qe,"e",function(){return H}),I.d(Qe,"c",function(){return k}),I.d(Qe,"d",function(){return D}),I.d(Qe,"a",function(){return m}),I.d(Qe,"f",function(){return f}),I.d(Qe,"b",function(){return d});var te=I("KQm4"),Y=I("VTBJ"),N=I("Ff2n"),K=I("Zm9Q"),A=I("Kwbf"),M=I("OZM5");function H(s,r){return s!=null?s:r}function P(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=new Map;function u(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(o||[]).forEach(function(n){var R=n.key,w=n.children;Object(A.a)(R!=null,"Tree node must have a certain key: [".concat(a).concat(R,"]"));var x=String(R);Object(A.a)(!r.has(x)||R===null||R===void 0,"Same 'key' exist in the Tree: ".concat(x)),r.set(x,!0),u(w,"".concat(a).concat(x," > "))})}u(s)}function k(s){function r(u){var o=Object(K.a)(u);return o.map(function(a){if(!Object(M.i)(a))return Object(A.a)(!a,"Tree/TreeNode can only accept TreeNode as children."),null;var n=a.key,R=a.props,w=R.children,x=Object(N.a)(R,["children"]),O=Object(Y.a)({key:n},x),C=r(w);return C.length&&(O.children=C),O}).filter(function(a){return a})}return r(s)}function D(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],u=new Set(r===!0?[]:r),o=[];function a(n){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return n.map(function(w,x){var O=Object(M.h)(R?R.pos:"0",x),C=H(w.key,O),_=Object(Y.a)(Object(Y.a)({},w),{},{parent:R,pos:O,children:null,data:w,isStart:[].concat(Object(te.a)(R?R.isStart:[]),[x===0]),isEnd:[].concat(Object(te.a)(R?R.isEnd:[]),[x===n.length-1])});return o.push(_),r===!0||u.has(C)?_.children=a(w.children||[],_):_.children=[],_})}return a(s),o}function b(s,r,u){var o;u?typeof u=="string"?o=function(R){return R[u]}:typeof u=="function"&&(o=function(R){return u(R)}):o=function(R,w){return H(R.key,w)};function a(n,R,w){var x=n?n.children:s,O=n?Object(M.h)(w.pos,R):"0";if(n){var C=o(n,O),_={node:n,index:R,pos:O,key:C,parentPos:w.node?w.pos:null,level:w.level+1};r(_)}x&&x.forEach(function(y,h){a(y,h,{node:n,pos:O,level:w?w.level+1:-1})})}a(null)}function m(s){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=r.initWrapper,o=r.processEntity,a=r.onProcessFinished,n=arguments.length>2?arguments[2]:void 0,R={},w={},x={posEntities:R,keyEntities:w};return u&&(x=u(x)||x),b(s,function(O){var C=O.node,_=O.index,y=O.pos,h=O.key,c=O.parentPos,v=O.level,p={node:C,index:_,key:h,pos:y,level:v},E=H(h,y);R[y]=p,w[E]=p,p.parent=R[c],p.parent&&(p.parent.children=p.parent.children||[],p.parent.children.push(p)),o&&o(p,x)},n),a&&a(x),x}function f(s,r){var u=r.expandedKeys,o=r.selectedKeys,a=r.loadedKeys,n=r.loadingKeys,R=r.checkedKeys,w=r.halfCheckedKeys,x=r.dragOverNodeKey,O=r.dropPosition,C=r.keyEntities,_=C[s],y={eventKey:s,expanded:u.indexOf(s)!==-1,selected:o.indexOf(s)!==-1,loaded:a.indexOf(s)!==-1,loading:n.indexOf(s)!==-1,checked:R.indexOf(s)!==-1,halfChecked:w.indexOf(s)!==-1,pos:String(_?_.pos:""),dragOver:x===s&&O===0,dragOverGapTop:x===s&&O===-1,dragOverGapBottom:x===s&&O===1};return y}function d(s){var r=s.data,u=s.expanded,o=s.selected,a=s.checked,n=s.loaded,R=s.loading,w=s.halfChecked,x=s.dragOver,O=s.dragOverGapTop,C=s.dragOverGapBottom,_=s.pos,y=s.active,h=Object(Y.a)(Object(Y.a)({},r),{},{expanded:u,selected:o,checked:a,loaded:n,loading:R,halfChecked:w,dragOver:x,dragOverGapTop:O,dragOverGapBottom:C,pos:_,active:y});return"props"in h||Object.defineProperty(h,"props",{get:function(){return Object(A.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),s}}),h}},"8EBN":function(tn,Qe,I){(function(te){te(I("VrN/"))})(function(te){"use strict";te.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<te.modeInfo.length;Y++){var N=te.modeInfo[Y];N.mimes&&(N.mime=N.mimes[0])}te.findModeByMIME=function(K){K=K.toLowerCase();for(var A=0;A<te.modeInfo.length;A++){var M=te.modeInfo[A];if(M.mime==K)return M;if(M.mimes){for(var H=0;H<M.mimes.length;H++)if(M.mimes[H]==K)return M}}if(/\+xml$/.test(K))return te.findModeByMIME("application/xml");if(/\+json$/.test(K))return te.findModeByMIME("application/json")},te.findModeByExtension=function(K){K=K.toLowerCase();for(var A=0;A<te.modeInfo.length;A++){var M=te.modeInfo[A];if(M.ext){for(var H=0;H<M.ext.length;H++)if(M.ext[H]==K)return M}}},te.findModeByFileName=function(K){for(var A=0;A<te.modeInfo.length;A++){var M=te.modeInfo[A];if(M.file&&M.file.test(K))return M}var H=K.lastIndexOf("."),P=H>-1&&K.substring(H+1,K.length);if(P)return te.findModeByExtension(P)},te.findModeByName=function(K){K=K.toLowerCase();for(var A=0;A<te.modeInfo.length;A++){var M=te.modeInfo[A];if(M.name.toLowerCase()==K)return M;if(M.alias){for(var H=0;H<M.alias.length;H++)if(M.alias[H].toLowerCase()==K)return M}}}})},"8hTe":function(tn,Qe,I){tn.exports={button:"button___1wy9m"}},"9Bee":function(tn,Qe,I){"use strict";var te=I("DYRE"),Y=I("zeV3"),N=I("+L6B"),K=I("2/Rp"),A=I("k1fw"),M=I("9og8"),H=I("tJVT"),P=I("WmNS"),k=I.n(P),D=I("q1tI"),b=I.n(D),m=I("vg9a"),f=I("DlQD"),d=I.n(f),s=I("rUJ1");function r(X,S){var L=X.match(/^(\s+)(?:```)/);if(L===null)return S;var W=L[1];return S.split(`
|
|
`).map(function(ne){var Q=ne.match(/^\s+/);if(Q===null)return ne;var ke=Object(H.a)(Q,1),Vt=ke[0];return Vt.length>=W.length?ne.slice(W.length):ne}).join(`
|
|
`)}var u=[],o=["<ul>"],a=new d.a.Renderer,n=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function R(){u.length=0,o=["<ul>"]}var w={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function x(X,S,L,W){if(S>=X.length||X[S].level<=L)return S;var ne=X[S];W.push("<li><a href='#"+ne.anchor+"'>"+ne.text+"</a>"),S++;var Q=[];return S=x(X,S,ne.level,Q),Q.length>0&&(W.push("<ul>"),Q.forEach(function(ke){W.push(ke)}),W.push("</ul>")),W.push("</li>"),S=x(X,S,L,W),S}function O(){return x(u,0,0,o),o.push("</ul>"),o.join("")}var C={heading:function(S){var L=n.exec(S);if(L)return{type:"heading",raw:L[0],depth:L[1].length,text:L[2]}},fences:function(S){var L=this.rules.block.fences.exec(S);if(L){var W=L[0],ne=r(W,L[3]||""),Q=L[2]?L[2].trim():L[2];if(["latex","katex","math"].indexOf(Q)>=0){var ke=h(),Vt=ne;ne=ke,c[ke]={type:"block",expression:Vt}}return{type:"code",raw:W,lang:Q,text:ne}}}},_=/(?:\${2})([^\n`]+?)(?:\${2})/gi,y=0,h=function(){return"__special_katext_id_".concat(y++,"__")},c={};function v(){return c}function p(){y=0,c={}}function E(X){return X=X.replace(_,function(S,L){var W=h();return c[W]={type:"inline",expression:L},W}),X}var U=a.listitem;a.listitem=function(X){return U(E(X))};var F=a.paragraph;a.paragraph=function(X){return F(E(X))};var z=a.tablecell;a.tablecell=function(X,S){return z(E(X),S)},a.code=function(X,S,L){var W=(S||"").match(/\S*/)[0];return W?["latex","katex","math"].indexOf(W)>=0?"<p class='editormd-tex'>".concat(X,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(S,'">').concat(L?X:Object(s.escape)(X,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(L?X:Object(s.escape)(X,!0))+"</code></pre>"},a.heading=function(X,S,L){var W=this.options.headerPrefix+L.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return u.push({anchor:W,level:S,text:X}),"<h"+S+' id="'+W+'">'+X+"</h"+S+">"},d.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),d.a.use({tokenizer:C,renderer:a});var G=d.a,B=I("SJMd"),T=I("ulZh"),V=I.n(T),Z=I("m3rI"),oe=I("Oy/b"),pe=I("p5ED"),Ye=I("ErOA");/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var xe=function(X,S){return(xe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,W){L.__proto__=W}||function(L,W){for(var ne in W)Object.prototype.hasOwnProperty.call(W,ne)&&(L[ne]=W[ne])})(X,S)};function Ie(X,S){function L(){this.constructor=X}xe(X,S),X.prototype=S===null?Object.create(S):(L.prototype=S.prototype,new L)}function Je(X,S,L,W){return new(L||(L=Promise))(function(ne,Q){function ke(Qn){try{kn(W.next(Qn))}catch(nn){Q(nn)}}function Vt(Qn){try{kn(W.throw(Qn))}catch(nn){Q(nn)}}function kn(Qn){var nn;Qn.done?ne(Qn.value):(nn=Qn.value,nn instanceof L?nn:new L(function(ti){ti(nn)})).then(ke,Vt)}kn((W=W.apply(X,S||[])).next())})}function Ke(X,S){var L,W,ne,Q,ke={label:0,sent:function(){if(1&ne[0])throw ne[1];return ne[1]},trys:[],ops:[]};return Q={next:Vt(0),throw:Vt(1),return:Vt(2)},typeof Symbol=="function"&&(Q[Symbol.iterator]=function(){return this}),Q;function Vt(kn){return function(Qn){return function(nn){if(L)throw new TypeError("Generator is already executing.");for(;ke;)try{if(L=1,W&&(ne=2&nn[0]?W.return:nn[0]?W.throw||((ne=W.return)&&ne.call(W),0):W.next)&&!(ne=ne.call(W,nn[1])).done)return ne;switch(W=0,ne&&(nn=[2&nn[0],ne.value]),nn[0]){case 0:case 1:ne=nn;break;case 4:return ke.label++,{value:nn[1],done:!1};case 5:ke.label++,W=nn[1],nn=[0];continue;case 7:nn=ke.ops.pop(),ke.trys.pop();continue;default:if(!(ne=ke.trys,(ne=ne.length>0&&ne[ne.length-1])||nn[0]!==6&&nn[0]!==2)){ke=0;continue}if(nn[0]===3&&(!ne||nn[1]>ne[0]&&nn[1]<ne[3])){ke.label=nn[1];break}if(nn[0]===6&&ke.label<ne[1]){ke.label=ne[1],ne=nn;break}if(ne&&ke.label<ne[2]){ke.label=ne[2],ke.ops.push(nn);break}ne[2]&&ke.ops.pop(),ke.trys.pop();continue}nn=S.call(X,ke)}catch(ti){nn=[6,ti],W=0}finally{L=ne=0}if(5&nn[0])throw nn[1];return{value:nn[0]?nn[1]:void 0,done:!0}}([kn,Qn])}}}function be(){for(var X=0,S=0,L=arguments.length;S<L;S++)X+=arguments[S].length;var W=Array(X),ne=0;for(S=0;S<L;S++)for(var Q=arguments[S],ke=0,Vt=Q.length;ke<Vt;ke++,ne++)W[ne]=Q[ke];return W}var de=function(){function X(){}return X.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},X.setAttributes=function(S,L){for(var W=0,ne=L;W<ne.length;W++){var Q=ne[W],ke=Q[0],Vt=Q[1];S.setAttribute(ke,Vt)}},X.createRect=function(S,L,W){var ne=document.createElementNS("http://www.w3.org/2000/svg","rect");return ne.setAttribute("width",S.toString()),ne.setAttribute("height",L.toString()),W&&X.setAttributes(ne,W),ne},X.createLine=function(S,L,W,ne,Q){var ke=document.createElementNS("http://www.w3.org/2000/svg","line");return ke.setAttribute("x1",S.toString()),ke.setAttribute("y1",L.toString()),ke.setAttribute("x2",W.toString()),ke.setAttribute("y2",ne.toString()),Q&&X.setAttributes(ke,Q),ke},X.createPolygon=function(S,L){var W=document.createElementNS("http://www.w3.org/2000/svg","polygon");return W.setAttribute("points",S),L&&X.setAttributes(W,L),W},X.createCircle=function(S,L){var W=document.createElementNS("http://www.w3.org/2000/svg","circle");return W.setAttribute("cx",(S/2).toString()),W.setAttribute("cy",(S/2).toString()),W.setAttribute("r",S.toString()),L&&X.setAttributes(W,L),W},X.createEllipse=function(S,L,W){var ne=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ne.setAttribute("cx",(S/2).toString()),ne.setAttribute("cy",(L/2).toString()),ne.setAttribute("rx",(S/2).toString()),ne.setAttribute("ry",(L/2).toString()),W&&X.setAttributes(ne,W),ne},X.createGroup=function(S){var L=document.createElementNS("http://www.w3.org/2000/svg","g");return S&&X.setAttributes(L,S),L},X.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},X.createMarker=function(S,L,W,ne,Q,ke,Vt){var kn=document.createElementNS("http://www.w3.org/2000/svg","marker");return X.setAttributes(kn,[["id",S],["orient",L],["markerWidth",W.toString()],["markerHeight",ne.toString()],["refX",Q.toString()],["refY",ke.toString()]]),kn.appendChild(Vt),kn},X.createText=function(S){var L=document.createElementNS("http://www.w3.org/2000/svg","text");return L.setAttribute("x","0"),L.setAttribute("y","0"),S&&X.setAttributes(L,S),L},X.createTSpan=function(S,L){var W=document.createElementNS("http://www.w3.org/2000/svg","tspan");return W.textContent=S,L&&X.setAttributes(W,L),W},X.createImage=function(S){var L=document.createElementNS("http://www.w3.org/2000/svg","image");return S&&X.setAttributes(L,S),L},X.createPoint=function(S,L){var W=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return W.x=S,W.y=L,W},X.createPath=function(S,L){var W=document.createElementNS("http://www.w3.org/2000/svg","path");return W.setAttribute("d",S),L&&X.setAttributes(W,L),W},X}(),nt=function(){function X(){}return X.addKey=function(S){X.key=S},Object.defineProperty(X,"isLicensed",{get:function(){return!!X.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(X.key)},enumerable:!1,configurable:!0}),X}(),Kt=function(){function X(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return X.prototype.rasterize=function(S,L,W){var ne=this;return new Promise(function(Q){var ke=W!==void 0?W:document.createElement("canvas");S===null&&(ne.markersOnly=!0,ne.naturalSize=!1);var Vt=document.createElementNS("http://www.w3.org/2000/svg","svg");Vt.setAttribute("xmlns","http://www.w3.org/2000/svg"),Vt.setAttribute("width",L.width.baseVal.valueAsString),Vt.setAttribute("height",L.height.baseVal.valueAsString),Vt.setAttribute("viewBox","0 0 "+L.viewBox.baseVal.width.toString()+" "+L.viewBox.baseVal.height.toString()),Vt.innerHTML=L.innerHTML,ne.naturalSize===!0?(Vt.width.baseVal.value=S.naturalWidth,Vt.height.baseVal.value=S.naturalHeight):ne.width!==void 0&&ne.height!==void 0&&(Vt.width.baseVal.value=ne.width,Vt.height.baseVal.value=ne.height),ke.width=Vt.width.baseVal.value,ke.height=Vt.height.baseVal.value;var kn=Vt.outerHTML,Qn=ke.getContext("2d");ne.markersOnly!==!0&&Qn.drawImage(S,0,0,ke.width,ke.height);var nn=window.URL,ti=new Image(ke.width,ke.height);ti.setAttribute("crossOrigin","anonymous");var qn=new Blob([kn],{type:"image/svg+xml"}),Li=nn.createObjectURL(qn);ti.onload=function(){Qn.drawImage(ti,0,0),nn.revokeObjectURL(Li);var lr=ke.toDataURL(ne.imageType,ne.imageQuality);Q(lr)},ti.src=Li})},X}(),jt=function(){},wt=function(){function X(S){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+S+"_"}return Object.defineProperty(X.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(X.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(X.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),X.prototype.addClass=function(S){return this.styleSheet===void 0&&this.addStyleSheet(),S.name=""+this.classNamePrefix+S.localName,this.classes.push(S),this.styleSheet.sheet.insertRule("."+S.name+" {"+S.style+"}",this.styleSheet.sheet.cssRules.length),S},X.prototype.addRule=function(S){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(S),this.styleSheet.sheet.insertRule(S.selector+" {"+S.style+"}",this.styleSheet.sheet.cssRules.length)},X.prototype.addStyleSheet=function(){var S;this.styleSheet=document.createElement("style"),((S=this.styleSheetRoot)!==null&&S!==void 0?S:document.head).appendChild(this.styleSheet),this.addRule(new ze("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new ze("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new ze("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new ft("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new ft("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},X.prototype.removeStyleSheet=function(){var S;this.styleSheet&&(((S=this.styleSheetRoot)!==null&&S!==void 0?S:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},X}(),ze=function(X,S){this.selector=X,this.style=S},ft=function(X,S){this.localName=X,this.style=S},dt=function(){function X(S,L,W,ne,Q){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=S,this.displayMode=L,this.markerItems=W,this.uiStyleSettings=ne,this.styles=Q,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return X.prototype.show=function(S){var L=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=S,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var W=document.createElement("div");W.className=this.toolbarBlockStyleClass.name,W.style.whiteSpace="nowrap",this.uiContainer.appendChild(W),this.addActionButton(W,'<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(W,'<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(W,'<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(W,'<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(W,'<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(W,'<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(W,'<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(W,'<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 ke=document.createElement("div");ke.className=""+L.toolbarButtonStyleClass.name,ke.setAttribute("data-type-name",Q.typeName),ke.innerHTML=Q.icon,ke.addEventListener("click",function(){L.markerToolbarButtonClicked(ke,Q)}),L.buttons.push(ke),L.markerButtons.push(ke)}),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 ne=document.createElement("div");ne.className=this.toolbarBlockStyleClass.name,ne.style.whiteSpace="nowrap",ne.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ne),this.addActionButton(ne,'<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(ne,'<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()},X.prototype.addButtonClickListener=function(S){this.buttonClickListeners.push(S)},X.prototype.removeButtonClickListener=function(S){this.buttonClickListeners.indexOf(S)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(S),1)},X.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},X.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var S=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var L=0;L<this.markerButtons.length;L++)L<S||L===S&&this.markerButtons.length-1===S?this.markerButtonBlock.appendChild(this.markerButtons[L]):(L===S&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[L]))}},X.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")},X.prototype.resetButtonStyles=function(){var S=this;this.buttons.forEach(function(L){L.className=L.className.replace(S.uiStyleSettings.toolbarButtonStyleColorsClassName?S.uiStyleSettings.toolbarButtonStyleColorsClassName:S.toolbarButtonStyleColorsClass.name,"").trim(),L.className=L.className.replace(S.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?S.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:S.toolbarActiveButtonStyleColorsClass.name,"").trim(),L.className+=" "+(S.uiStyleSettings.toolbarButtonStyleColorsClassName?S.uiStyleSettings.toolbarButtonStyleColorsClassName:S.toolbarButtonStyleColorsClass.name)})},X.prototype.addActionButton=function(S,L,W){var ne=this,Q=document.createElement("div");switch(Q.className=""+this.toolbarButtonStyleClass.name,Q.innerHTML=L,Q.setAttribute("data-action",W),Q.addEventListener("click",function(){ne.actionToolbarButtonClicked(Q,W)}),W){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}S.appendChild(Q),this.buttons.push(Q)},X.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ft("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 ft("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ft("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new ft("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 ft("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var S=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ft("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*S)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*S)+`px;
|
|
padding: `+S+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ft("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ft("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new ze("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new ze("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},X.prototype.markerToolbarButtonClicked=function(S,L){this.setActiveButton(S),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(W){return W("marker",L)}),this.markerButtonOverflowBlock.style.display="none"},X.prototype.actionToolbarButtonClicked=function(S,L){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(W){return W("action",L)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},X.prototype.setActiveButton=function(S){this.resetButtonStyles(),S.className=S.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),S.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},X.prototype.setActiveMarkerButton=function(S){var L=this.markerButtons.find(function(W){return W.getAttribute("data-type-name")===S});L&&this.setActiveButton(L)},X.prototype.setCurrentMarker=function(S){var L=this;this.currentMarker=S,this.buttons.filter(function(W){return/delete|notes/.test(W.getAttribute("data-action"))}).forEach(function(W){L.currentMarker===void 0?(W.style.fillOpacity="0.4",W.style.pointerEvents="none"):(W.style.fillOpacity="1",W.style.pointerEvents="all")})},X}(),Nt=function(){function X(S,L,W,ne){this.panels=[],this.panelButtons=[],this.markerjsContainer=S,this.displayMode=L,this.uiStyleSettings=W,this.styles=ne,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return X.prototype.addStyles=function(){var S;this.toolboxStyleClass=this.styles.addClass(new ft("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 ft("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var L=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ft("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ft("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ft("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 ft("toolbox-panel-row_colors",`
|
|
background-color: `+((S=this.uiStyleSettings.toolboxBackgroundColor)!==null&&S!==void 0?S:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new ft("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*L)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*L)+`px;
|
|
padding: `+L+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new ft("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ft("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new ze("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new ze("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},X.prototype.show=function(S){var L;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=S,this.uiContainer.className=this.toolboxStyleClass.name+" "+((L=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&L!==void 0?L:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},X.prototype.setPanelButtons=function(S){var L,W,ne=this;this.panels=S,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((L=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&L!==void 0?L:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((W=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&W!==void 0?W:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Q){var ke;Q.uiStyleSettings=ne.uiStyleSettings;var Vt=document.createElement("div");Vt.className=ne.toolboxButtonStyleClass.name+" "+((ke=ne.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ke!==void 0?ke:ne.toolboxButtonStyleColorsClass.name),Vt.innerHTML=Q.icon,Vt.title=Q.title,Vt.addEventListener("click",function(){ne.panelButtonClick(Q)}),ne.panelButtons.push(Vt),ne.buttonRow.appendChild(Vt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},X.prototype.panelButtonClick=function(S){var L=this,W=-1;if(S!==this.activePanel){W=this.panels.indexOf(S),this.panelRow.innerHTML="";var ne=S.getUi();ne.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ne),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=S}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){L.displayMode==="inline"?L.panelRow.style.display="none":L.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(Q,ke){var Vt,kn;Q.className=L.toolboxButtonStyleClass.name+" "+(ke===W?""+((Vt=L.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Vt!==void 0?Vt:L.toolboxActiveButtonStyleColorsClass.name):""+((kn=L.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&kn!==void 0?kn:L.toolboxButtonStyleColorsClass.name))})},X}(),Ze=function(X,S){this.title=X,this.icon=S},Bt=function(X){function S(L,W,ne,Q){var ke=X.call(this,L,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 ke.colors=[],ke.addTransparent=!1,ke.colorBoxes=[],ke.colors=W,ke.currentColor=ne,ke.setCurrentColor=ke.setCurrentColor.bind(ke),ke.getColorBox=ke.getColorBox.bind(ke),ke}return Ie(S,X),S.prototype.getUi=function(){var L=this,W=document.createElement("div");return W.style.overflow="hidden",W.style.whiteSpace="nowrap",this.colors.forEach(function(ne){var Q=L.getColorBox(ne);W.appendChild(Q),L.colorBoxes.push(Q)}),W},S.prototype.getColorBox=function(L){var W=this,ne=this.uiStyleSettings.toolbarHeight/4,Q=this.uiStyleSettings.toolbarHeight-ne,ke=document.createElement("div");ke.style.display="inline-block",ke.style.boxSizing="content-box",ke.style.width=Q-2+"px",ke.style.height=Q-2+"px",ke.style.padding="1px",ke.style.marginRight="2px",ke.style.marginBottom="2px",ke.style.borderWidth="2px",ke.style.borderStyle="solid",ke.style.borderRadius=(Q+2)/2+"px",ke.style.borderColor=L===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ke.addEventListener("click",function(){W.setCurrentColor(L,ke)});var Vt=document.createElement("div");return Vt.style.display="inline-block",Vt.style.width=Q-2+"px",Vt.style.height=Q-2+"px",Vt.style.backgroundColor=L,Vt.style.borderRadius=Q/2+"px",L==="transparent"&&(Vt.style.fill=this.uiStyleSettings.toolboxAccentColor,Vt.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>`),ke.appendChild(Vt),ke},S.prototype.setCurrentColor=function(L,W){var ne=this;this.currentColor=L,this.colorBoxes.forEach(function(Q){Q.style.borderColor=Q===W?ne.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(L)},S}(Ze),Ut=function(){function X(S,L,W){this._state="new",this._isSelected=!1,this._container=S,this._overlayContainer=L,this.globalSettings=W,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(X.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),X.prototype.ownsTarget=function(S){return!1},Object.defineProperty(X.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),X.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},X.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},X.prototype.pointerDown=function(S,L){},X.prototype.dblClick=function(S,L){},X.prototype.manipulate=function(S){},X.prototype.pointerUp=function(S){this.stateChanged()},X.prototype.dispose=function(){},X.prototype.addMarkerVisualToContainer=function(S){this.container.childNodes.length>0?this.container.insertBefore(S,this.container.childNodes[0]):this.container.appendChild(S)},X.prototype.getState=function(){return{typeName:X.typeName,state:this.state,notes:this.notes}},X.prototype.restoreState=function(S){this._state=S.state,this.notes=S.notes},X.prototype.scale=function(S,L){},X.prototype.colorChanged=function(S){this.onColorChanged&&this.onColorChanged(S),this.stateChanged()},X.prototype.fillColorChanged=function(S){this.onFillColorChanged&&this.onFillColorChanged(S),this.stateChanged()},X.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var S=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),S.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(S)&&this.onStateChanged(this)}},X.typeName="MarkerBase",X}(),Mt=function(){function X(){this.findGripByVisual=this.findGripByVisual.bind(this)}return X.prototype.findGripByVisual=function(S){return this.topLeft.ownsTarget(S)?this.topLeft:this.topCenter.ownsTarget(S)?this.topCenter:this.topRight.ownsTarget(S)?this.topRight:this.centerLeft.ownsTarget(S)?this.centerLeft:this.centerRight.ownsTarget(S)?this.centerRight:this.bottomLeft.ownsTarget(S)?this.bottomLeft:this.bottomCenter.ownsTarget(S)?this.bottomCenter:this.bottomRight.ownsTarget(S)?this.bottomRight:void 0},X}(),An=function(){function X(){this.GRIP_SIZE=10,this.visual=de.createGroup(),this.visual.appendChild(de.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(de.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return X.prototype.ownsTarget=function(S){return S===this.visual||S===this.visual.childNodes[0]||S===this.visual.childNodes[1]},X}(),mn=function(){function X(){}return X.toITransformMatrix=function(S){return{a:S.a,b:S.b,c:S.c,d:S.d,e:S.e,f:S.f}},X.toSVGMatrix=function(S,L){return S.a=L.a,S.b=L.b,S.c=L.c,S.d=L.d,S.e=L.e,S.f=L.f,S},X}(),pn=function(X){function S(L,W,ne){var Q=X.call(this,L,W,ne)||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(de.createTransform()),Q.setupControlBox(),Q}return Ie(S,X),Object.defineProperty(S.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"visual",{get:function(){return this._visual},set:function(L){this._visual=L;var W=de.createTransform();this._visual.transform.baseVal.appendItem(W)},enumerable:!1,configurable:!0}),S.prototype.ownsTarget=function(L){return!!X.prototype.ownsTarget.call(this,L)||!!(this.controlGrips.findGripByVisual(L)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(L))},S.prototype.pointerDown=function(L,W){X.prototype.pointerDown.call(this,L,W),this.state==="new"&&(this.left=L.x,this.top=L.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ne=this.unrotatePoint(L);if(this.manipulationStartX=ne.x,this.manipulationStartY=ne.y,this.offsetX=ne.x-this.left,this.offsetY=ne.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(W),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(W)){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 ke=this.container.transform.baseVal.getItem(0);ke.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ke,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},S.prototype.pointerUp=function(L){var W=this.state;X.prototype.pointerUp.call(this,L),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(L),this._state="select",W==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},S.prototype.moveVisual=function(L){this.visual.style.transform="translate("+L.x+"px, "+L.y+"px)"},S.prototype.manipulate=function(L){var W=this.unrotatePoint(L);this.state==="creating"?this.resize(L):this.state==="move"?(this.left=this.manipulationStartLeft+(W.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(W.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(W):this.state==="rotate"&&this.rotate(L)},S.prototype.resize=function(L){var W=this.manipulationStartLeft,ne=this.manipulationStartWidth,Q=this.manipulationStartTop,ke=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:W=this.manipulationStartLeft+L.x-this.manipulationStartX,ne=this.manipulationStartWidth+this.manipulationStartLeft-W;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ne=this.manipulationStartWidth+L.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Q=this.manipulationStartTop+L.y-this.manipulationStartY,ke=this.manipulationStartHeight+this.manipulationStartTop-Q;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ke=this.manipulationStartHeight+L.y-this.manipulationStartY}ne>=0?(this.left=W,this.width=ne):(this.left=W+ne,this.width=-ne),ke>=0?(this.top=Q,this.height=ke):(this.top=Q+ke,this.height=-ke),this.setSize()},S.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},S.prototype.rotate=function(L){if(Math.abs(L.x-this.centerX)>.1){var W=Math.sign(L.x-this.centerX);this.rotationAngle=180*Math.atan((L.y-this.centerY)/(L.x-this.centerX))/Math.PI+90*W,this.applyRotation()}},S.prototype.applyRotation=function(){var L=this.container.transform.baseVal.getItem(0);L.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(L,0)},S.prototype.rotatePoint=function(L){if(this.rotationAngle===0)return L;var W=this.container.getCTM(),ne=de.createPoint(L.x,L.y);return{x:(ne=ne.matrixTransform(W)).x,y:ne.y}},S.prototype.unrotatePoint=function(L){if(this.rotationAngle===0)return L;var W=this.container.getCTM();W=W.inverse();var ne=de.createPoint(L.x,L.y);return{x:(ne=ne.matrixTransform(W)).x,y:ne.y}},S.prototype.select=function(){X.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},S.prototype.deselect=function(){X.prototype.deselect.call(this),this.controlBox.style.display="none"},S.prototype.setupControlBox=function(){this.controlBox=de.createGroup();var L=de.createTransform();L.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(L),this.container.appendChild(this.controlBox),this.controlRect=de.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=de.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 Mt,this.addControlGrips(),this.controlBox.style.display="none"},S.prototype.adjustControlBox=function(){var L=this.controlBox.transform.baseVal.getItem(0);L.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(L,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},S.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},S.prototype.createGrip=function(){var L=new An;return L.visual.transform.baseVal.appendItem(de.createTransform()),this.controlBox.appendChild(L.visual),L},S.prototype.positionGrips=function(){var L=this.controlGrips.topLeft.GRIP_SIZE,W=-L/2,ne=W,Q=(this.width+this.CB_DISTANCE)/2-L/2,ke=(this.height+this.CB_DISTANCE)/2-L/2,Vt=this.height+this.CB_DISTANCE-L/2,kn=this.width+this.CB_DISTANCE-L/2;this.positionGrip(this.controlGrips.topLeft.visual,W,ne),this.positionGrip(this.controlGrips.topCenter.visual,Q,ne),this.positionGrip(this.controlGrips.topRight.visual,kn,ne),this.positionGrip(this.controlGrips.centerLeft.visual,W,ke),this.positionGrip(this.controlGrips.centerRight.visual,kn,ke),this.positionGrip(this.controlGrips.bottomLeft.visual,W,Vt),this.positionGrip(this.controlGrips.bottomCenter.visual,Q,Vt),this.positionGrip(this.controlGrips.bottomRight.visual,kn,Vt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Q,ne-3*this.CB_DISTANCE)},S.prototype.positionGrip=function(L,W,ne){var Q=L.transform.baseVal.getItem(0);Q.setTranslate(W,ne),L.transform.baseVal.replaceItem(Q,0)},S.prototype.hideControlBox=function(){this.controlBox.style.display="none"},S.prototype.showControlBox=function(){this.controlBox.style.display=""},S.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:mn.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:mn.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},X.prototype.getState.call(this))},S.prototype.restoreState=function(L){X.prototype.restoreState.call(this,L);var W=L;this.left=W.left,this.top=W.top,this.width=W.width,this.height=W.height,this.rotationAngle=W.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(mn.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,W.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(mn.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,W.containerTransformMatrix))},S.prototype.scale=function(L,W){X.prototype.scale.call(this,L,W);var ne=this.rotatePoint({x:this.left,y:this.top}),Q=this.unrotatePoint({x:ne.x*L,y:ne.y*W});this.left=Q.x,this.top=Q.y,this.width=this.width*L,this.height=this.height*W,this.adjustControlBox()},S}(Ut),tt=function(X){function S(L,W,ne){var Q=X.call(this,L,W,ne)||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 Ie(S,X),S.prototype.ownsTarget=function(L){return!(!X.prototype.ownsTarget.call(this,L)&&L!==this.visual)},S.prototype.createVisual=function(){this.visual=de.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},S.prototype.pointerDown=function(L,W){X.prototype.pointerDown.call(this,L,W),this.state==="new"&&(this.createVisual(),this.moveVisual(L),this._state="creating")},S.prototype.manipulate=function(L){X.prototype.manipulate.call(this,L)},S.prototype.resize=function(L){X.prototype.resize.call(this,L),this.setSize()},S.prototype.setSize=function(){X.prototype.setSize.call(this),de.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},S.prototype.pointerUp=function(L){X.prototype.pointerUp.call(this,L),this.setSize()},S.prototype.setStrokeColor=function(L){this.strokeColor=L,this.visual&&de.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(L),this.stateChanged()},S.prototype.setFillColor=function(L){this.fillColor=L,this.visual&&de.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},S.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.visual&&de.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},S.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.visual&&de.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},S.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},X.prototype.getState.call(this))},S.prototype.restoreState=function(L){var W=L;this.fillColor=W.fillColor,this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.opacity=W.opacity,this.createVisual(),X.prototype.restoreState.call(this,L),this.setSize()},S.prototype.scale=function(L,W){X.prototype.scale.call(this,L,W),this.setSize()},S.title="Rectangle marker",S}(pn),fn=function(X){function S(L,W,ne,Q){var ke=X.call(this,L,Q||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return ke.widths=[],ke.widthBoxes=[],ke.widths=W,ke.currentWidth=ne,ke.setCurrentWidth=ke.setCurrentWidth.bind(ke),ke}return Ie(S,X),S.prototype.getUi=function(){var L=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",this.widths.forEach(function(ne){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=ne===L.currentWidth?L.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){L.setCurrentWidth(ne,Q)}),W.appendChild(Q);var ke=document.createElement("div");ke.innerText=ne.toString(),ke.style.marginRight="5px",Q.appendChild(ke);var Vt=document.createElement("div");Vt.style.minHeight="20px",Vt.style.flexGrow="2",Vt.style.display="flex",Vt.style.alignItems="center";var kn=document.createElement("hr");kn.style.minWidth="20px",kn.style.border="0px",kn.style.borderTop=ne+"px solid "+L.uiStyleSettings.toolboxColor,kn.style.flexGrow="2",Vt.appendChild(kn),Q.appendChild(Vt),L.widthBoxes.push(Q)}),W},S.prototype.setCurrentWidth=function(L,W){var ne=this;this.currentWidth=L,this.widthBoxes.forEach(function(Q){Q.style.borderColor=Q===W?ne.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},S}(Ze),In=function(X){function S(L,W,ne,Q){var ke=X.call(this,L,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 ke.styles=[],ke.styleBoxes=[],ke.styles=W,ke.currentStyle=ne,ke.setCurrentStyle=ke.setCurrentStyle.bind(ke),ke}return Ie(S,X),S.prototype.getUi=function(){var L=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",this.styles.forEach(function(ne){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/L.styles.length-5+"%",Q.style.borderColor=ne===L.currentStyle?L.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){L.setCurrentStyle(ne,Q)}),W.appendChild(Q);var ke=document.createElement("div");ke.style.minHeight="20px",ke.style.flexGrow="2",ke.style.overflow="hidden";var Vt=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+L.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(ne!==""?'stroke-dasharray="'+ne+'"':"")+` />
|
|
</svg>`;ke.innerHTML=Vt,Q.appendChild(ke),L.styleBoxes.push(Q)}),W},S.prototype.setCurrentStyle=function(L,W){var ne=this;this.currentStyle=L,this.styleBoxes.forEach(function(Q){Q.style.borderColor=Q===W?ne.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},S}(Ze),He=function(X){function S(L,W,ne){var Q=X.call(this,L,W,ne)||this;return Q.strokeColor=ne.defaultColor,Q.strokeWidth=ne.defaultStrokeWidth,Q.strokeDasharray=ne.defaultStrokeDasharray,Q.strokePanel=new Bt("Line color",ne.defaultColorSet,ne.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.strokeWidthPanel=new fn("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new In("Line style",ne.defaultStrokeDasharrays,ne.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q}return Ie(S,X),Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=X.prototype.getState.call(this);return L.typeName=S.typeName,L},S.typeName="FrameMarker",S.title="Frame marker",S.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',S}(tt),Ue=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},pt=function(X){function S(L,W,ne){var Q=X.call(this,L,W,ne)||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 Ie(S,X),S.prototype.ownsTarget=function(L){return!!X.prototype.ownsTarget.call(this,L)||!(!this.grip1.ownsTarget(L)&&!this.grip2.ownsTarget(L))},S.prototype.pointerDown=function(L,W){X.prototype.pointerDown.call(this,L,W),this.manipulationStartX=L.x,this.manipulationStartY=L.y,this.state==="new"&&(this.x1=L.x,this.y1=L.y,this.x2=L.x,this.y2=L.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(W)?this.activeGrip=this.grip1:this.grip2.ownsTarget(W)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},S.prototype.pointerUp=function(L){var W=this.state;X.prototype.pointerUp.call(this,L),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(L),this._state="select",W==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},S.prototype.adjustVisual=function(){},S.prototype.manipulate=function(L){this.state==="creating"?this.resize(L):this.state==="move"?(this.x1=this.manipulationStartX1+L.x-this.manipulationStartX,this.y1=this.manipulationStartY1+L.y-this.manipulationStartY,this.x2=this.manipulationStartX2+L.x-this.manipulationStartX,this.y2=this.manipulationStartY2+L.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(L)},S.prototype.resize=function(L){switch(this.activeGrip){case this.grip1:this.x1=L.x,this.y1=L.y;break;case this.grip2:case void 0:this.x2=L.x,this.y2=L.y}this.adjustVisual(),this.adjustControlBox()},S.prototype.select=function(){X.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},S.prototype.deselect=function(){X.prototype.deselect.call(this),this.controlBox.style.display="none"},S.prototype.setupControlBox=function(){this.controlBox=de.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},S.prototype.adjustControlBox=function(){this.positionGrips()},S.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},S.prototype.createGrip=function(){var L=new An;return L.visual.transform.baseVal.appendItem(de.createTransform()),this.controlBox.appendChild(L.visual),L},S.prototype.positionGrips=function(){var L=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-L/2,this.y1-L/2),this.positionGrip(this.grip2.visual,this.x2-L/2,this.y2-L/2)},S.prototype.positionGrip=function(L,W,ne){var Q=L.transform.baseVal.getItem(0);Q.setTranslate(W,ne),L.transform.baseVal.replaceItem(Q,0)},S.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},X.prototype.getState.call(this))},S.prototype.restoreState=function(L){X.prototype.restoreState.call(this,L);var W=L;this.x1=W.x1,this.y1=W.y1,this.x2=W.x2,this.y2=W.y2},S.prototype.scale=function(L,W){X.prototype.scale.call(this,L,W),this.x1=this.x1*L,this.y1=this.y1*W,this.x2=this.x2*L,this.y2=this.y2*W,this.adjustVisual(),this.adjustControlBox()},S}(Ut),Ct=function(X){function S(L,W,ne){var Q=X.call(this,L,W,ne)||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=ne.defaultColor,Q.strokeWidth=ne.defaultStrokeWidth,Q.strokeDasharray=ne.defaultStrokeDasharray,Q.strokePanel=new Bt("Line color",ne.defaultColorSet,ne.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.strokeWidthPanel=new fn("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new In("Line style",ne.defaultStrokeDasharrays,ne.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q}return Ie(S,X),S.prototype.ownsTarget=function(L){return!(!X.prototype.ownsTarget.call(this,L)&&L!==this.visual&&L!==this.selectorLine&&L!==this.visibleLine)},S.prototype.createVisual=function(){this.visual=de.createGroup(),this.selectorLine=de.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=de.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},S.prototype.pointerDown=function(L,W){X.prototype.pointerDown.call(this,L,W),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},S.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),de.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),de.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),de.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},S.prototype.setStrokeColor=function(L){this.strokeColor=L,this.adjustVisual(),this.colorChanged(L)},S.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.adjustVisual()},S.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.adjustVisual(),this.stateChanged()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},X.prototype.getState.call(this));return L.typeName=S.typeName,L},S.prototype.restoreState=function(L){X.prototype.restoreState.call(this,L);var W=L;this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.createVisual(),this.adjustVisual()},S.typeName="LineMarker",S.title="Line marker",S.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',S}(pt),Ge=function(X){function S(L,W,ne,Q){var ke=X.call(this,L,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 ke.fonts=[],ke.fontBoxes=[],ke.fonts=W,ke.currentFont=ne,ke.setCurrentFont=ke.setCurrentFont.bind(ke),ke}return Ie(S,X),S.prototype.getUi=function(){var L=this,W=document.createElement("div");return W.style.overflow="hidden",W.style.flexGrow="2",this.fonts.forEach(function(ne){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/L.fonts.length-5+"%",Q.style.borderColor=ne===L.currentFont?L.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){L.setCurrentFont(ne,Q)}),W.appendChild(Q);var ke=document.createElement("div");ke.style.display="flex",ke.style.minHeight="20px",ke.style.flexGrow="2",ke.style.fontFamily=ne,ke.style.overflow="hidden";var Vt=document.createElement("div");Vt.style.whiteSpace="nowrap",Vt.style.overflow="hidden",Vt.style.textOverflow="ellipsis",Vt.innerHTML="The quick brown fox jumps over the lazy dog",ke.appendChild(Vt),Q.appendChild(ke),L.fontBoxes.push(Q)}),W},S.prototype.setCurrentFont=function(L,W){var ne=this;this.currentFont=L,this.fontBoxes.forEach(function(Q){Q.style.borderColor=Q===W?ne.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},S}(Ze),vt=function(X){function S(L,W,ne){var Q=X.call(this,L,W,ne)||this;return Q.color="transparent",Q.padding=5,Q.DEFAULT_TEXT="your text here",Q.text=Q.DEFAULT_TEXT,Q.isMoved=!1,Q.color=ne.defaultColor,Q.fontFamily=ne.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 Bt("Color",ne.defaultColorSet,ne.defaultColor),Q.colorPanel.onColorChanged=Q.setColor,Q.fontFamilyPanel=new Ge("Font",ne.defaultFontFamilies,ne.defaultFontFamily),Q.fontFamilyPanel.onFontChanged=Q.setFont,Q}return Ie(S,X),S.prototype.ownsTarget=function(L){if(X.prototype.ownsTarget.call(this,L)||L===this.visual||L===this.textElement||L===this.bgRectangle)return!0;var W=!1;return this.textElement.childNodes.forEach(function(ne){ne===L&&(W=!0)}),W},S.prototype.createVisual=function(){this.visual=de.createGroup(),this.bgRectangle=de.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=de.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(de.createTransform()),this.textElement.transform.baseVal.appendItem(de.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},S.prototype.pointerDown=function(L,W){X.prototype.pointerDown.call(this,L,W),this.isMoved=!1,this.pointerDownPoint=L,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(L),this._state="creating")},S.prototype.renderText=function(){var L=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(W){L.textElement.appendChild(de.createTSpan(W.trim()===""?" ":W.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},S.prototype.getTextScale=function(){var L=this.textElement.getBBox(),W=1;if(L.width>0&&L.height>0){var ne=(1*this.width-this.width*this.padding*2/100)/L.width,Q=(1*this.height-this.height*this.padding*2/100)/L.height;W=Math.min(ne,Q)}return W},S.prototype.getTextPosition=function(L){var W=this.textElement.getBBox(),ne=0,Q=0;return W.width>0&&W.height>0&&(ne=(this.width-W.width*L)/2,Q=this.height/2-W.height*L/2),{x:ne,y:Q}},S.prototype.sizeText=function(){var L=this.textElement.getBBox(),W=this.getTextScale(),ne=this.getTextPosition(W);ne.y-=L.y*W,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ne.x+"px, "+ne.y+"px) scale("+W+", "+W+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ne.x,ne.y),this.textElement.transform.baseVal.getItem(1).setScale(W,W))},S.prototype.manipulate=function(L){X.prototype.manipulate.call(this,L),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(L.x-this.pointerDownPoint.x)>5||Math.abs(L.y-this.pointerDownPoint.y)>5)},S.prototype.resize=function(L){X.prototype.resize.call(this,L),this.isMoved=!0,this.setSize(),this.sizeText()},S.prototype.setSize=function(){X.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(de.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),de.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},S.prototype.pointerUp=function(L){var W=this.state;W==="creating"&&(this._suppressMarkerCreateEvent=!0),X.prototype.pointerUp.call(this,L),this.setSize(),(W==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},S.prototype.showTextEditor=function(){var L=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(W){W.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var W=Number.parseFloat(L.textEditor.style.fontSize);L.textEditor.clientWidth>=Number.parseInt(L.textEditor.style.maxWidth)&&W>.9;)W-=.1,L.textEditor.style.fontSize=Math.max(W,.9)+"em"}),this.textEditor.addEventListener("keyup",function(W){W.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(W){if(W.clipboardData){var ne=W.clipboardData.getData("text"),Q=window.getSelection();if(!Q.rangeCount)return!1;Q.deleteFromDocument(),Q.getRangeAt(0).insertNode(document.createTextNode(ne)),W.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){L.textEditDivClicked(L.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},S.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var L=this.getTextScale(),W=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ne=this.textElement.getBBox(),Q={x:ne.width*L,y:ne.height*L};W.x-=Q.x/2,W.y-=Q.y/2,this.textEditor.style.top=W.y+"px",this.textEditor.style.left=W.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-W.x+"px",this.textEditor.style.fontSize=Math.max(16*L,12)+"px",this.textElement.style.display="none"}},S.prototype.textEditDivClicked=function(L){this.text=L.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},S.prototype.select=function(){X.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},S.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),X.prototype.deselect.call(this)},S.prototype.dblClick=function(L,W){X.prototype.dblClick.call(this,L,W),this.showTextEditor()},S.prototype.setColor=function(L){this.textElement&&de.setAttributes(this.textElement,[["fill",L]]),this.color=L,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(L)},S.prototype.setFont=function(L){this.textElement&&de.setAttributes(this.textElement,[["font-family",L]]),this.fontFamily=L,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},S.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},S.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},X.prototype.getState.call(this));return L.typeName=S.typeName,L},S.prototype.restoreState=function(L){var W=L;this.color=W.color,this.fontFamily=W.fontFamily,this.padding=W.padding,this.text=W.text,this.createVisual(),X.prototype.restoreState.call(this,L),this.setSize()},S.prototype.scale=function(L,W){X.prototype.scale.call(this,L,W),this.setSize(),this.sizeText(),this.positionTextEditor()},S.typeName="TextMarker",S.title="Text marker",S.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>',S}(pn),Ae=function(X){function S(L,W,ne){var Q=X.call(this,L,W,ne)||this;return Q.color="transparent",Q.lineWidth=3,Q.drawing=!1,Q.pixelRatio=1,Q.color=ne.defaultColor,Q.lineWidth=ne.defaultStrokeWidth,Q.pixelRatio=ne.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 Bt("Color",ne.defaultColorSet,ne.defaultColor),Q.colorPanel.onColorChanged=Q.setColor,Q.lineWidthPanel=new fn("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),Q.lineWidthPanel.onWidthChanged=Q.setLineWidth,Q}return Ie(S,X),S.prototype.ownsTarget=function(L){return!(!X.prototype.ownsTarget.call(this,L)&&L!==this.visual&&L!==this.drawingImage)},S.prototype.createVisual=function(){this.visual=de.createGroup(),this.drawingImage=de.createImage(),this.visual.appendChild(this.drawingImage);var L=de.createTransform();this.visual.transform.baseVal.appendItem(L),this.addMarkerVisualToContainer(this.visual)},S.prototype.pointerDown=function(L,W){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(L.x,L.y),this.drawing=!0):X.prototype.pointerDown.call(this,L,W)},S.prototype.manipulate=function(L){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(L.x,L.y),this.canvasContext.stroke()):X.prototype.manipulate.call(this,L)},S.prototype.resize=function(L){X.prototype.resize.call(this,L),de.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),de.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},S.prototype.pointerUp=function(L){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):X.prototype.pointerUp.call(this,L)},S.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},S.prototype.select=function(){this.state==="creating"&&this.finishCreation(),X.prototype.select.call(this)},S.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),X.prototype.deselect.call(this)},S.prototype.finishCreation=function(){for(var L=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),W=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ne=W[0],Q=W[1],ke=W[2],Vt=W[3],kn=!1,Qn=0;Qn<this.canvasElement.height;Qn++)for(var nn=0;nn<this.canvasElement.width;nn++)L.data[Qn*this.canvasElement.width*4+4*nn+3]>0&&(kn=!0,Qn<Q&&(Q=Qn),nn<ne&&(ne=nn),Qn>Vt&&(Vt=Qn),nn>ke&&(ke=nn));if(kn){this.left=ne/this.pixelRatio,this.top=Q/this.pixelRatio,this.width=(ke-ne)/this.pixelRatio,this.height=(Vt-Q)/this.pixelRatio;var ti=document.createElement("canvas");ti.width=ke-ne,ti.height=Vt-Q,ti.getContext("2d").putImageData(this.canvasContext.getImageData(ne,Q,ke-ne,Vt-Q),0,0),this.drawingImgUrl=ti.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},S.prototype.setDrawingImage=function(){de.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),de.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},S.prototype.setColor=function(L){this.color=L,this.colorChanged(L)},S.prototype.setLineWidth=function(L){this.lineWidth=L},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=Object.assign({drawingImgUrl:this.drawingImgUrl},X.prototype.getState.call(this));return L.typeName=S.typeName,L},S.prototype.restoreState=function(L){this.createVisual(),X.prototype.restoreState.call(this,L),this.drawingImgUrl=L.drawingImgUrl,this.setDrawingImage()},S.prototype.scale=function(L,W){X.prototype.scale.call(this,L,W),this.setDrawingImage()},S.typeName="FreehandMarker",S.title="Freehand marker",S.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>',S}(pn),ge=function(X){function S(L,W,ne){var Q=X.call(this,L,ne||'<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=W,Q.setCurrentType=Q.setCurrentType.bind(Q),Q}return Ie(S,X),S.prototype.getUi=function(){var L=this,W=document.createElement("div");W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2";for(var ne=function(Vt){var kn="both";switch(Vt){case 0:kn="both";break;case 1:kn="start";break;case 2:kn="end";break;case 3:kn="none"}var Qn=document.createElement("div");if(Qn.style.display="flex",Qn.style.flexGrow="2",Qn.style.alignItems="center",Qn.style.justifyContent="space-between",Qn.style.padding="5px",Qn.style.borderWidth="2px",Qn.style.borderStyle="solid",Qn.style.borderColor=kn===Q.currentType?Q.uiStyleSettings.toolboxAccentColor:"transparent",Qn.addEventListener("click",function(){L.setCurrentType(kn,Qn)}),W.appendChild(Qn),kn==="both"||kn==="start"){var nn=document.createElement("div");nn.style.display="flex",nn.style.alignItems="center",nn.style.minHeight="20px",nn.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>`,nn.style.marginLeft="5px",Qn.appendChild(nn)}var ti=document.createElement("div");ti.style.display="flex",ti.style.alignItems="center",ti.style.minHeight="20px",ti.style.flexGrow="2";var qn=document.createElement("hr");if(qn.style.minWidth="20px",qn.style.border="0px",qn.style.borderTop="3px solid "+(Q.uiStyleSettings!==void 0?Q.uiStyleSettings.toolboxColor:"#eeeeee"),qn.style.flexGrow="2",ti.appendChild(qn),Qn.appendChild(ti),kn==="both"||kn==="end"){var Li=document.createElement("div");Li.style.display="flex",Li.style.alignItems="center",Li.style.minHeight="20px",Li.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>`,Li.style.marginRight="5px",Qn.appendChild(Li)}Q.typeBoxes.push(Qn)},Q=this,ke=0;ke<4;ke++)ne(ke);return W},S.prototype.setCurrentType=function(L,W){var ne=this;this.currentType=L,this.typeBoxes.forEach(function(Q){Q.style.borderColor=Q===W?ne.uiStyleSettings!==void 0?ne.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},S}(Ze),Ee=function(X){function S(L,W,ne){var Q=X.call(this,L,W,ne)||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 ge("Arrow type","end"),Q.arrowTypePanel.onArrowTypeChanged=Q.setArrowType,Q}return Ie(S,X),S.prototype.ownsTarget=function(L){return!(!X.prototype.ownsTarget.call(this,L)&&L!==this.arrow1&&L!==this.arrow2)},S.prototype.getArrowPoints=function(L,W){var ne=this.arrowBaseWidth+2*this.strokeWidth,Q=this.arrowBaseHeight+2*this.strokeWidth;return L-ne/2+","+(W+Q/2)+" "+L+","+(W-Q/2)+" "+(L+ne/2)+","+(W+Q/2)},S.prototype.createTips=function(){this.arrow1=de.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(de.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=de.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(de.createTransform()),this.visual.appendChild(this.arrow2)},S.prototype.pointerDown=function(L,W){X.prototype.pointerDown.call(this,L,W),this.state==="creating"&&this.createTips()},S.prototype.adjustVisual=function(){if(X.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",de.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),de.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var L=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),W=this.arrow1.transform.baseVal.getItem(0);W.setRotate(L,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(W,0);var ne=this.arrow2.transform.baseVal.getItem(0);ne.setRotate(L+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ne,0)}},S.prototype.setArrowType=function(L){this.arrowType=L,this.adjustVisual(),this.stateChanged()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=Object.assign({arrowType:this.arrowType},X.prototype.getState.call(this));return L.typeName=S.typeName,L},S.prototype.restoreState=function(L){X.prototype.restoreState.call(this,L);var W=L;this.arrowType=W.arrowType,this.createTips(),this.adjustVisual()},S.typeName="ArrowMarker",S.title="Arrow marker",S.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',S}(Ct),ae=function(X){function S(L,W,ne){var Q=X.call(this,L,W,ne)||this;return Q.fillColor=ne.defaultFillColor,Q.strokeWidth=0,Q.fillPanel=new Bt("Color",ne.defaultColorSet,ne.defaultFillColor),Q.fillPanel.onColorChanged=Q.setFillColor,Q}return Ie(S,X),Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=X.prototype.getState.call(this);return L.typeName=S.typeName,L},S.typeName="CoverMarker",S.title="Cover marker",S.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',S}(tt),re=function(X){function S(L,W,ne,Q){var ke=X.call(this,L,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 ke.opacities=[],ke.opacityBoxes=[],ke.opacities=W,ke.currentOpacity=ne,ke.setCurrentOpacity=ke.setCurrentOpacity.bind(ke),ke}return Ie(S,X),S.prototype.getUi=function(){var L=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",W.style.justifyContent="space-between",this.opacities.forEach(function(ne){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=ne===L.currentOpacity?L.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){L.setCurrentOpacity(ne,Q)}),W.appendChild(Q);var ke=document.createElement("div");ke.innerText=100*ne+"%",Q.appendChild(ke),L.opacityBoxes.push(Q)}),W},S.prototype.setCurrentOpacity=function(L,W){var ne=this;this.currentOpacity=L,this.opacityBoxes.forEach(function(Q){Q.style.borderColor=Q===W?ne.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},S}(Ze),he=function(X){function S(L,W,ne){var Q=X.call(this,L,W,ne)||this;return Q.setOpacity=Q.setOpacity.bind(Q),Q.fillColor=ne.defaultHighlightColor,Q.strokeWidth=0,Q.opacity=ne.defaultHighlightOpacity,Q.fillPanel=new Bt("Color",ne.defaultColorSet,Q.fillColor),Q.fillPanel.onColorChanged=Q.setFillColor,Q.opacityPanel=new re("Opacity",ne.defaultOpacitySteps,Q.opacity),Q.opacityPanel.onOpacityChanged=Q.setOpacity,Q}return Ie(S,X),S.prototype.setOpacity=function(L){this.opacity=L,this.visual&&de.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=X.prototype.getState.call(this);return L.typeName=S.typeName,L},S.typeName="HighlightMarker",S.title="Highlight marker",S.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>',S}(ae),ve='<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>',me=function(X){function S(L,W,ne){var Q=X.call(this,L,W,ne)||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=ne.defaultStrokeColor,Q.bgColor=ne.defaultFillColor,Q.fontFamily=ne.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 Bt("Text color",ne.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 Bt("Fill color",ne.defaultColorSet,Q.bgColor,ve),Q.bgColorPanel.onColorChanged=Q.setBgColor,Q.fontFamilyPanel=new Ge("Font",ne.defaultFontFamilies,ne.defaultFontFamily),Q.fontFamilyPanel.onFontChanged=Q.setFont,Q.tipGrip=new An,Q.tipGrip.visual.transform.baseVal.appendItem(de.createTransform()),Q.controlBox.appendChild(Q.tipGrip.visual),Q}return Ie(S,X),S.prototype.ownsTarget=function(L){return X.prototype.ownsTarget.call(this,L)||this.tipGrip.ownsTarget(L)||this.tip===L},S.prototype.createTip=function(){de.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=de.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},S.prototype.pointerDown=function(L,W){this.state==="new"&&X.prototype.pointerDown.call(this,L,W),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(W)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):X.prototype.pointerDown.call(this,L,W)},S.prototype.pointerUp=function(L){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,X.prototype.pointerUp.call(this,L);else{var W=this.state==="creating";X.prototype.pointerUp.call(this,L),this.setTipPoints(W),this.positionTip()}},S.prototype.manipulate=function(L){if(this.tipMoving){var W=this.unrotatePoint(L);this.tipPosition={x:W.x-this.manipulationStartLeft,y:W.y-this.manipulationStartTop},this.positionTip()}else X.prototype.manipulate.call(this,L)},S.prototype.setBgColor=function(L){this.bgRectangle&&this.tip&&(de.setAttributes(this.bgRectangle,[["fill",L]]),de.setAttributes(this.tip,[["fill",L]])),this.bgColor=L,this.fillColorChanged(L)},S.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},S.prototype.setTipPoints=function(L){L===void 0&&(L=!1);var W=Math.min(this.height/2,15),ne=this.height/5;L&&(this.tipPosition={x:W+ne/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))?(ne=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:W,y:0},this.tipBase2Position={x:W+ne,y:0}):(this.tipBase1Position={x:0,y:W},this.tipBase2Position={x:0,y:W+ne}):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))?(ne=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-W-ne,y:0},this.tipBase2Position={x:this.width-W,y:0}):(this.tipBase1Position={x:this.width,y:W},this.tipBase2Position={x:this.width,y:W+ne}):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))?(ne=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-W-ne,y:this.height},this.tipBase2Position={x:this.width-W,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-W-ne},this.tipBase2Position={x:this.width,y:this.height-W}):Q<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(ne=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:W,y:this.height},this.tipBase2Position={x:W+ne,y:this.height}):(this.tipBase1Position={x:0,y:this.height-W},this.tipBase2Position={x:0,y:this.height-W-ne})},S.prototype.resize=function(L){X.prototype.resize.call(this,L),this.positionTip()},S.prototype.positionTip=function(){de.setAttributes(this.tip,[["points",this.getTipPoints()]]);var L=this.tipGrip.visual.transform.baseVal.getItem(0);L.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(L,0)},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),S.prototype.select=function(){this.positionTip(),X.prototype.select.call(this)},S.prototype.getState=function(){var L=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},X.prototype.getState.call(this));return L.typeName=S.typeName,L},S.prototype.restoreState=function(L){var W=L;this.bgColor=W.bgColor,this.tipPosition=W.tipPosition,X.prototype.restoreState.call(this,L),this.createTip(),this.setTipPoints()},S.prototype.scale=function(L,W){X.prototype.scale.call(this,L,W),this.tipPosition={x:this.tipPosition.x*L,y:this.tipPosition.y*W},this.positionTip()},S.typeName="CalloutMarker",S.title="Callout marker",S.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>',S}(vt),Be=function(X){function S(L,W,ne){var Q=X.call(this,L,W,ne)||this;return Q.fillColor="transparent",Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.opacity=1,Q.strokeColor=ne.defaultColor,Q.strokeWidth=ne.defaultStrokeWidth,Q.strokeDasharray=ne.defaultStrokeDasharray,Q.fillColor=ne.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 Bt("Line color",be(ne.defaultColorSet,["transparent"]),ne.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.fillPanel=new Bt("Fill color",be(ne.defaultColorSet,["transparent"]),Q.fillColor,ve),Q.fillPanel.onColorChanged=Q.setFillColor,Q.strokeWidthPanel=new fn("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new In("Line style",ne.defaultStrokeDasharrays,ne.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q.opacityPanel=new re("Opacity",ne.defaultOpacitySteps,Q.opacity),Q.opacityPanel.onOpacityChanged=Q.setOpacity,Q}return Ie(S,X),S.prototype.ownsTarget=function(L){return!(!X.prototype.ownsTarget.call(this,L)&&L!==this.visual)},S.prototype.createVisual=function(){this.visual=de.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)},S.prototype.pointerDown=function(L,W){X.prototype.pointerDown.call(this,L,W),this.state==="new"&&(this.createVisual(),this.moveVisual(L),this._state="creating")},S.prototype.manipulate=function(L){X.prototype.manipulate.call(this,L)},S.prototype.resize=function(L){X.prototype.resize.call(this,L),this.setSize()},S.prototype.setSize=function(){X.prototype.setSize.call(this),de.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},S.prototype.pointerUp=function(L){X.prototype.pointerUp.call(this,L),this.setSize()},S.prototype.setStrokeColor=function(L){this.strokeColor=L,this.visual&&de.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(L),this.stateChanged()},S.prototype.setFillColor=function(L){this.fillColor=L,this.visual&&de.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(L),this.stateChanged()},S.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.visual&&de.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},S.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.visual&&de.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},S.prototype.setOpacity=function(L){this.opacity=L,this.visual&&de.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},X.prototype.getState.call(this));return L.typeName=S.typeName,L},S.prototype.restoreState=function(L){var W=L;this.fillColor=W.fillColor,this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.opacity=W.opacity,this.createVisual(),X.prototype.restoreState.call(this,L),this.setSize()},S.prototype.scale=function(L,W){X.prototype.scale.call(this,L,W),this.setSize()},S.typeName="EllipseMarker",S.title="Ellipse marker",S.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>',S}(pn),Tt=function(X){function S(L,W,ne){return X.call(this,L,W,ne)||this}return Ie(S,X),Object.defineProperty(S.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),S.prototype.ownsTarget=function(L){return!(!X.prototype.ownsTarget.call(this,L)&&L!==this.tip1&&L!==this.tip2)},S.prototype.createTips=function(){this.tip1=de.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(de.createTransform()),this.visual.appendChild(this.tip1),this.tip2=de.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(de.createTransform()),this.visual.appendChild(this.tip2)},S.prototype.pointerDown=function(L,W){X.prototype.pointerDown.call(this,L,W),this.state==="creating"&&this.createTips()},S.prototype.adjustVisual=function(){if(X.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(de.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()]]),de.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var L=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),W=this.tip1.transform.baseVal.getItem(0);W.setRotate(L,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(W,0);var ne=this.tip2.transform.baseVal.getItem(0);ne.setRotate(L+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ne,0)}},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=X.prototype.getState.call(this);return L.typeName=S.typeName,L},S.prototype.restoreState=function(L){X.prototype.restoreState.call(this,L),this.createTips(),this.adjustVisual()},S.typeName="MeasurementMarker",S.title="Measurement marker",S.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>',S}(Ct),Jt=function(X){function S(L,W,ne){var Q=X.call(this,L,W,ne)||this;return Q.strokePanel.colors=ne.defaultColorSet,Q.fillColor="transparent",Q}return Ie(S,X),Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=X.prototype.getState.call(this);return L.typeName=S.typeName,L},S.typeName="EllipseFrameMarker",S.title="Ellipse frame marker",S.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>',S}(Be),En=function(){function X(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(X.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),X.prototype.addUndoStep=function(S){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(S)||(this.undoStack.push(S),JSON.stringify(this.lastRedoStep)!==JSON.stringify(S)&&this.redoStack.splice(0,this.redoStack.length))},X.prototype.replaceLastUndoStep=function(S){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=S)},X.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},X.prototype.undo=function(){if(this.undoStack.length>1){var S=this.undoStack.pop();return S!==void 0&&this.redoStack.push(S),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},X.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},X}(),mt=function(X){function S(L,W,ne){var Q=X.call(this,L,W,ne)||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=ne.defaultColor,Q.strokeWidth=ne.defaultStrokeWidth,Q.strokeDasharray=ne.defaultStrokeDasharray,Q.strokePanel=new Bt("Line color",ne.defaultColorSet,ne.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.strokeWidthPanel=new fn("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new In("Line style",ne.defaultStrokeDasharrays,ne.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q}return Ie(S,X),S.prototype.ownsTarget=function(L){return!(!X.prototype.ownsTarget.call(this,L)&&L!==this.visual&&L!==this.selectorCurve&&L!==this.visibleCurve&&!this.curveGrip.ownsTarget(L))},S.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},S.prototype.createVisual=function(){this.visual=de.createGroup(),this.selectorCurve=de.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=de.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},S.prototype.pointerDown=function(L,W){X.prototype.pointerDown.call(this,L,W),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=L.x,this.curveY=L.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(W)&&(this.activeGrip=this.curveGrip,this._state="resize")},S.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),de.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),de.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),de.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},S.prototype.setupControlBox=function(){X.prototype.setupControlBox.call(this),this.curveControlLine1=de.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=de.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},S.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,X.prototype.addControlGrips.call(this)},S.prototype.positionGrips=function(){X.prototype.positionGrips.call(this);var L=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-L/2,this.curveY-L/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},S.prototype.manipulate=function(L){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+L.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+L.y-this.manipulationStartY),X.prototype.manipulate.call(this,L)},S.prototype.resize=function(L){this.activeGrip===this.curveGrip&&(this.curveX=L.x,this.curveY=L.y),X.prototype.resize.call(this,L),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},S.prototype.setStrokeColor=function(L){this.strokeColor=L,this.adjustVisual(),this.colorChanged(L)},S.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.adjustVisual()},S.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.adjustVisual()},S.prototype.scale=function(L,W){this.curveX=this.curveX*L,this.curveY=this.curveY*W,X.prototype.scale.call(this,L,W)},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},X.prototype.getState.call(this));return L.typeName=S.typeName,L},S.prototype.restoreState=function(L){X.prototype.restoreState.call(this,L);var W=L;this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.curveX=W.curveX,this.curveY=W.curveY,this.createVisual(),this.adjustVisual()},S.typeName="CurveMarker",S.title="Curve marker",S.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>',S}(pt),Qt=function(){function X(S,L){L===void 0&&(L=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=S,this.cancelable=L}return Object.defineProperty(X.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),X.prototype.preventDefault=function(){this._defaultPrevented=!0},X}(),gt=function(X){function S(L,W,ne){var Q=X.call(this,L,!1)||this;return Q.dataUrl=W,Q.state=ne,Q}return Ie(S,X),S}(Qt),yt=function(X){function S(L,W,ne){ne===void 0&&(ne=!1);var Q=X.call(this,L,ne)||this;return Q.marker=W,Q}return Ie(S,X),S}(Qt),rt=function(){function X(){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 X.prototype.addEventListener=function(S,L){this[S].push(L)},X.prototype.removeEventListener=function(S,L){var W=this[S].indexOf(L);W>-1&&this[S].splice(W,1)},X}(),ce=function(){function X(S){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ue,this._isOpen=!1,this.undoRedoManager=new En,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 rt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=X.instanceCounter++,this.styles=new wt(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=S,this.targetRoot=document.body,this.width=S.clientWidth,this.height=S.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(X.prototype,"ALL_MARKER_TYPES",{get:function(){return[He,Ae,Ee,vt,Jt,Be,he,me,Tt,ae,Ct,mt]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[He,Ae,Ee,vt,Be,he,me]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"BASIC_MARKER_TYPES",{get:function(){return[He,Ae,Ee,vt,he]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(S){var L=this;this._availableMarkerTypes.splice(0),S.forEach(function(W){if(typeof W=="string"){var ne=L.ALL_MARKER_TYPES.find(function(Q){return Q.typeName===W});ne!==void 0&&L._availableMarkerTypes.push(ne)}else L._availableMarkerTypes.push(W)})},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(S){this._zoomLevel=S,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),X.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),nt.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},X.prototype.show=function(){var S=this;this.styles.styleSheetRoot===void 0&&jt.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=jt.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(L){return L(new Qt(S))})},X.prototype.render=function(){return Je(this,void 0,void 0,function(){var S;return Ke(this,function(L){switch(L.label){case 0:return this.setCurrentMarker(),(S=new Kt).naturalSize=this.renderAtNaturalSize,S.imageType=this.renderImageType,S.imageQuality=this.renderImageQuality,S.markersOnly=this.renderMarkersOnly,S.width=this.renderWidth,S.height=this.renderHeight,[4,S.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return L.sent(),[4,S.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,L.sent()]}})})},X.prototype.close=function(S){var L=this;if(S===void 0&&(S=!1),this.isOpen){var W=!1;S||this.eventListeners.beforeclose.forEach(function(ne){var Q=new Qt(L,!0);ne(Q),Q.defaultPrevented&&(W=!0)}),W||(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(ne){return ne(new Qt(L))}),this.detachEvents(),this._isOpen=!1)}},X.prototype.addMarkersToToolbar=function(){for(var S,L=[],W=0;W<arguments.length;W++)L[W]=arguments[W];(S=this._availableMarkerTypes).push.apply(S,L)},X.prototype.addRenderEventListener=function(S){this.addEventListener("render",function(L){S(L.dataUrl,L.state)})},X.prototype.removeRenderEventListener=function(S){},X.prototype.addCloseEventListener=function(S){this.addEventListener("close",function(){S()})},X.prototype.removeCloseEventListener=function(S){},X.prototype.setupResizeObserver=function(){var S=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){S.resize(S.target.clientWidth,S.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return S.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},X.prototype.onPopupTargetResize=function(){var S=1*this.target.clientWidth/this.target.clientHeight,L=this.editorCanvas.clientWidth/S>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*S:this.editorCanvas.clientWidth,W=L<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/S;this.resize(L,W)},X.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},X.prototype.resize=function(S,L){this._isResizing=!0;var W=S/this.imageWidth,ne=L/this.imageHeight;this.imageWidth=Math.round(S),this.imageHeight=Math.round(L),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(W,ne),this._isResizing=!1},X.prototype.scaleMarkers=function(S,L){var W,ne=this;this._currentMarker&&this._currentMarker instanceof vt?this._currentMarker.scale(S,L):(W=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(Q){Q!==ne._currentMarker&&Q.scale(S,L)}),W!==void 0&&this.setCurrentMarker(W)},X.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"},X.prototype.setTopLeft=function(){var S=this.editingTarget.getBoundingClientRect(),L=this.editorCanvas.getBoundingClientRect();this.left=S.left-L.left,this.top=S.top-L.top},X.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)},X.prototype.addDefs=function(){for(var S,L=[],W=0;W<arguments.length;W++)L[W]=arguments[W];this.defs=de.createDefs(),this.addDefsToImage(),(S=this.defs).append.apply(S,L)},X.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},X.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)},X.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},X.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},X.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)},X.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},X.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)},X.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 S=document.createElement("a");S.href="https://markerjs.com/",S.target="_blank",S.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>',S.title="Powered by marker.js",S.style.display="grid",S.style.alignItems="center",S.style.justifyItems="center",S.style.padding="3px",S.style.width="20px",S.style.height="20px",this.logoUI.appendChild(S),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},X.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")},X.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"},X.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},X.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var S=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=S+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new dt(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 Nt(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},X.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},X.prototype.removeMarker=function(S){this.markerImage.removeChild(S.container),this.markers.indexOf(S)>-1&&this.markers.splice(this.markers.indexOf(S),1),S.dispose()},X.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())},X.prototype.toolbarButtonClicked=function(S,L){if(S==="marker"&&L!==void 0)this.createNewMarker(L);else if(S==="action")switch(L){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},X.prototype.deleteSelectedMarker=function(){var S=this;if(this._currentMarker!==void 0){var L=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ne){var Q=new yt(S,S._currentMarker,!0);ne(Q),Q.defaultPrevented&&(L=!0)}),!L){var W=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(ne){return ne(new yt(S,W))})}}},X.prototype.clear=function(){var S=this,L=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ke){var Vt=new yt(S,void 0,!0);ke(Vt),Vt.defaultPrevented&&(L=!0)}),!L)){this.setCurrentMarker();for(var W=function(ke){var Vt=ne.markers[ke];ne.setCurrentMarker(ne.markers[ke]),ne._currentMarker.dispose(),ne.markerImage.removeChild(ne._currentMarker.container),ne.markers.splice(ne.markers.indexOf(ne._currentMarker),1),ne.eventListeners.markerdelete.forEach(function(kn){return kn(new yt(S,Vt))})},ne=this,Q=this.markers.length-1;Q>=0;Q--)W(Q);this.addUndoStep()}},Object.defineProperty(X.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),X.prototype.showNotesEditor=function(){var S;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(S=this._currentMarker.notes)!==null&&S!==void 0?S:"",this.overlayContainer.appendChild(this.notesArea))},X.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)},X.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},X.prototype.addUndoStep=function(){var S=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var L=this.getState(),W=this.undoRedoManager.getLastUndoStep();if(!W||W.width===L.width&&W.height===L.height){var ne=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(L),ne<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(Q){return Q(new Qt(S))})}else this.undoRedoManager.replaceLastUndoStep(L),this.eventListeners.statechange.forEach(function(Q){return Q(new Qt(S))})}},X.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},X.prototype.undoStep=function(){var S=this,L=this.undoRedoManager.undo();L!==void 0&&(this.restoreState(L),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(W){return W(new Qt(S))}))},X.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},X.prototype.redoStep=function(){var S=this,L=this.undoRedoManager.redo();L!==void 0&&(this.restoreState(L),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(W){return W(new Qt(S))}))},X.prototype.stepZoom=function(){var S=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=S<this.zoomSteps.length-1?this.zoomSteps[S+1]:this.zoomSteps[0]},X.prototype.panTo=function(S){this.contentDiv.scrollBy({left:this.prevPanPoint.x-S.x,top:this.prevPanPoint.y-S.y}),this.prevPanPoint=S},X.prototype.startRenderAndClose=function(){return Je(this,void 0,void 0,function(){var S,L,W=this;return Ke(this,function(ne){switch(ne.label){case 0:return[4,this.render()];case 1:return S=ne.sent(),L=this.getState(),this.eventListeners.render.forEach(function(Q){return Q(new gt(W,S,L))}),this.close(!0),[2]}})})},X.prototype.getState=function(S){S===!0&&this.setCurrentMarker();var L={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(W){return L.markers.push(W.getState())}),L},X.prototype.restoreState=function(S){var L=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);S.markers.forEach(function(W){var ne=L._availableMarkerTypes.find(function(ke){return ke.typeName===W.typeName});if(ne!==void 0){var Q=L.addNewMarker(ne);Q.restoreState(W),L.markers.push(Q)}}),S.width&&S.height&&(S.width!==this.imageWidth||S.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/S.width,this.imageHeight/S.height),this.eventListeners.restorestate.forEach(function(W){return W(new Qt(L))})},X.prototype.addNewMarker=function(S){var L=de.createGroup();return this.markerImage.appendChild(L),new S(L,this.overlayContainer,this.settings)},X.prototype.createNewMarker=function(S){var L,W=this;(L=typeof S=="string"?this._availableMarkerTypes.find(function(ne){return ne.typeName===S}):S)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(L),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(L.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(ne){return ne(new yt(W,W._currentMarker))}))},X.prototype.markerCreated=function(S){var L=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(S),this.setCurrentMarker(S),S instanceof Ae&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Ae):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(W){return W(new yt(L,L._currentMarker))})},X.prototype.colorChanged=function(S){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=S,this.settings.defaultStrokeColor=S)},X.prototype.fillColorChanged=function(S){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=S)},X.prototype.markerStateChanged=function(S){var L=this;this.eventListeners.markerchange.forEach(function(W){return W(new yt(L,S))})},X.prototype.setCurrentMarker=function(S){var L=this;this._currentMarker!==S&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(W){return W(new yt(L,L._currentMarker))})),this._currentMarker=S,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(W){return W(new yt(L,L._currentMarker))}))},X.prototype.onPointerDown=function(S){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||S.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var L=this.markers.find(function(W){return W.ownsTarget(S.target)});L!==void 0?(this.setCurrentMarker(L),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(S.clientX,S.clientY),S.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:S.clientX,y:S.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(S.clientX,S.clientY))},X.prototype.onDblClick=function(S){if(this._isFocused||this.focus(),this.mode==="select"){var L=this.markers.find(function(W){return W.ownsTarget(S.target)});L!==void 0&&L!==this._currentMarker&&this.setCurrentMarker(L),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(S.clientX,S.clientY),S.target):this.setCurrentMarker()}},X.prototype.onPointerMove=function(S){this.touchPoints!==1&&S.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||S.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(S.clientX,S.clientY)):this.zoomLevel>1&&this.panTo({x:S.clientX,y:S.clientY}))},X.prototype.onPointerUp=function(S){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(S.clientX,S.clientY)),this.isDragging=!1,this.addUndoStep()},X.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},X.prototype.onKeyUp=function(S){this._currentMarker===void 0||this.notesArea!==void 0||S.key!=="Delete"&&S.key!=="Backspace"||this.deleteSelectedMarker()},X.prototype.clientToLocalCoordinates=function(S,L){var W=this.markerImage.getBoundingClientRect();return{x:(S-W.left)/this.zoomLevel,y:(L-W.top)/this.zoomLevel}},X.prototype.onWindowResize=function(){this.positionUI()},X.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var S=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=S+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},X.prototype.addLicenseKey=function(S){nt.addKey(S)},X.prototype.addEventListener=function(S,L){this.eventListeners.addEventListener(S,L)},X.prototype.removeEventListener=function(S,L){this.eventListeners.removeEventListener(S,L)},X.prototype.renderState=function(S){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(S),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(X.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),X.prototype.focus=function(){var S=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(L){return L(new Qt(S))}))},X.prototype.blur=function(){var S=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(L){return L(new Qt(S))}))},X.instanceCounter=0,X}();/* **********************************
|
|
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 Re=function(X,S){return(Re=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,W){L.__proto__=W}||function(L,W){for(var ne in W)Object.prototype.hasOwnProperty.call(W,ne)&&(L[ne]=W[ne])})(X,S)};function At(X,S){if(typeof S!="function"&&S!==null)throw new TypeError("Class extends value "+String(S)+" is not a constructor or null");function L(){this.constructor=X}Re(X,S),X.prototype=S===null?Object.create(S):(L.prototype=S.prototype,new L)}function ot(X,S,L,W){return new(L||(L=Promise))(function(ne,Q){function ke(Qn){try{kn(W.next(Qn))}catch(nn){Q(nn)}}function Vt(Qn){try{kn(W.throw(Qn))}catch(nn){Q(nn)}}function kn(Qn){var nn;Qn.done?ne(Qn.value):(nn=Qn.value,nn instanceof L?nn:new L(function(ti){ti(nn)})).then(ke,Vt)}kn((W=W.apply(X,S||[])).next())})}function Yt(X,S){var L,W,ne,Q,ke={label:0,sent:function(){if(1&ne[0])throw ne[1];return ne[1]},trys:[],ops:[]};return Q={next:Vt(0),throw:Vt(1),return:Vt(2)},typeof Symbol=="function"&&(Q[Symbol.iterator]=function(){return this}),Q;function Vt(kn){return function(Qn){return function(nn){if(L)throw new TypeError("Generator is already executing.");for(;ke;)try{if(L=1,W&&(ne=2&nn[0]?W.return:nn[0]?W.throw||((ne=W.return)&&ne.call(W),0):W.next)&&!(ne=ne.call(W,nn[1])).done)return ne;switch(W=0,ne&&(nn=[2&nn[0],ne.value]),nn[0]){case 0:case 1:ne=nn;break;case 4:return ke.label++,{value:nn[1],done:!1};case 5:ke.label++,W=nn[1],nn=[0];continue;case 7:nn=ke.ops.pop(),ke.trys.pop();continue;default:if(!(ne=ke.trys,(ne=ne.length>0&&ne[ne.length-1])||nn[0]!==6&&nn[0]!==2)){ke=0;continue}if(nn[0]===3&&(!ne||nn[1]>ne[0]&&nn[1]<ne[3])){ke.label=nn[1];break}if(nn[0]===6&&ke.label<ne[1]){ke.label=ne[1],ne=nn;break}if(ne&&ke.label<ne[2]){ke.label=ne[2],ke.ops.push(nn);break}ne[2]&&ke.ops.pop(),ke.trys.pop();continue}nn=S.call(X,ke)}catch(ti){nn=[6,ti],W=0}finally{L=ne=0}if(5&nn[0])throw nn[1];return{value:nn[0]?nn[1]:void 0,done:!0}}([kn,Qn])}}}var rn=function(){function X(){}return X.addKey=function(S){X.key=S},Object.defineProperty(X,"isLicensed",{get:function(){return!!X.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(X.key)},enumerable:!1,configurable:!0}),X}(),_e=function(){function X(){}return X.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},X.setAttributes=function(S,L){for(var W=0,ne=L;W<ne.length;W++){var Q=ne[W],ke=Q[0],Vt=Q[1];S.setAttribute(ke,Vt)}},X.createRect=function(S,L,W){var ne=document.createElementNS("http://www.w3.org/2000/svg","rect");return ne.setAttribute("width",S.toString()),ne.setAttribute("height",L.toString()),W&&X.setAttributes(ne,W),ne},X.createLine=function(S,L,W,ne,Q){var ke=document.createElementNS("http://www.w3.org/2000/svg","line");return ke.setAttribute("x1",S.toString()),ke.setAttribute("y1",L.toString()),ke.setAttribute("x2",W.toString()),ke.setAttribute("y2",ne.toString()),Q&&X.setAttributes(ke,Q),ke},X.createPolygon=function(S,L){var W=document.createElementNS("http://www.w3.org/2000/svg","polygon");return W.setAttribute("points",S),L&&X.setAttributes(W,L),W},X.createCircle=function(S,L){var W=document.createElementNS("http://www.w3.org/2000/svg","circle");return W.setAttribute("cx",(S/2).toString()),W.setAttribute("cy",(S/2).toString()),W.setAttribute("r",S.toString()),L&&X.setAttributes(W,L),W},X.createEllipse=function(S,L,W){var ne=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ne.setAttribute("cx",(S/2).toString()),ne.setAttribute("cy",(L/2).toString()),ne.setAttribute("rx",(S/2).toString()),ne.setAttribute("ry",(L/2).toString()),W&&X.setAttributes(ne,W),ne},X.createGroup=function(S){var L=document.createElementNS("http://www.w3.org/2000/svg","g");return S&&X.setAttributes(L,S),L},X.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},X.createMarker=function(S,L,W,ne,Q,ke,Vt){var kn=document.createElementNS("http://www.w3.org/2000/svg","marker");return X.setAttributes(kn,[["id",S],["orient",L],["markerWidth",W.toString()],["markerHeight",ne.toString()],["refX",Q.toString()],["refY",ke.toString()]]),kn.appendChild(Vt),kn},X.createText=function(S){var L=document.createElementNS("http://www.w3.org/2000/svg","text");return L.setAttribute("x","0"),L.setAttribute("y","0"),S&&X.setAttributes(L,S),L},X.createTSpan=function(S,L){var W=document.createElementNS("http://www.w3.org/2000/svg","tspan");return W.textContent=S,L&&X.setAttributes(W,L),W},X.createImage=function(S){var L=document.createElementNS("http://www.w3.org/2000/svg","image");return S&&X.setAttributes(L,S),L},X.createPoint=function(S,L){var W=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return W.x=S,W.y=L,W},X.createPath=function(S,L){var W=document.createElementNS("http://www.w3.org/2000/svg","path");return W.setAttribute("d",S),L&&X.setAttributes(W,L),W},X.createElement=function(S,L){var W=document.createElementNS("http://www.w3.org/2000/svg",S);return L&&X.setAttributes(W,L),W},X.getHollowRectanglePath=function(S,L,W,ne,Q,ke,Vt,kn){return"M"+S+","+L+"V"+(L+ne)+"H"+(S+W)+"V"+L+"H"+Q+"V"+ke+"H"+(Q+Vt)+"V"+(ke+kn)+"H"+Q+"V"+L+"Z"},X}(),Ne=function(){function X(S){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+S+"_"}return Object.defineProperty(X.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(X.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(X.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),X.prototype.addClass=function(S){return this.styleSheet===void 0&&this.addStyleSheet(),S.name=""+this.classNamePrefix+S.localName,this.classes.push(S),this.styleSheet.sheet.insertRule("."+S.name+" {"+S.style+"}",this.styleSheet.sheet.cssRules.length),S},X.prototype.addRule=function(S){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(S),this.styleSheet.sheet.insertRule(S.selector+" {"+S.style+"}",this.styleSheet.sheet.cssRules.length)},X.prototype.addStyleSheet=function(){var S;this.styleSheet=document.createElement("style"),((S=this.styleSheetRoot)!==null&&S!==void 0?S:document.head).appendChild(this.styleSheet),this.addRule(new xt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new xt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new xt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Xt("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Xt("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},X.prototype.removeStyleSheet=function(){var S;this.styleSheet&&(((S=this.styleSheetRoot)!==null&&S!==void 0?S:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},X}(),xt=function(X,S){this.selector=X,this.style=S},Xt=function(X,S){this.localName=X,this.style=S},vn=function(){function X(){this.blocks=[],this.display=""}return X.prototype.addButtonBlock=function(S){S.className=this.blockClassName,S.buttonClassName=this.buttonClassName,S.buttonColorsClassName=this.buttonColorsClassName,S.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(S)},X.prototype.addElementBlock=function(S){S.className===void 0&&(S.className=this.blockClassName),this.blocks.push(S)},X.prototype.getUI=function(){var S=document.createElement("div");return S.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,S.style.display=this.display,this.blocks.forEach(function(L){return S.appendChild(L.getUI())}),S},X}(),Mn=function(){function X(){}return X.prototype.getUI=function(){var S=document.createElement("div");if(S.className=this.className,this.minWidth!==void 0&&(S.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":S.style.justifyContent="flex-start";break;case"center":S.style.justifyContent="center";break;case"end":S.style.justifyContent="flex-end"}return S.style.whiteSpace="nowrap",S},X}(),ci=function(X){function S(){var L=X!==null&&X.apply(this,arguments)||this;return L.buttons=[],L}return At(S,X),S.prototype.addButton=function(L){L.className=this.buttonClassName,L.colorsClassName=this.buttonColorsClassName,L.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(L)},S.prototype.getUI=function(){var L=X.prototype.getUI.call(this);return this.buttons.forEach(function(W){return L.appendChild(W.getUI())}),L},S}(Mn),$n=function(){function X(S,L){this._isActive=!1,this._isHidden=!1,this._icon=S,this.title=L,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(X.prototype,"icon",{get:function(){return this._icon},set:function(S){this._icon=S,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isActive",{get:function(){return this._isActive},set:function(S){this._isActive=S,this.adjustClassName()},enumerable:!1,configurable:!0}),X.prototype.getUI=function(){var S=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 S.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},X.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,"")))},X.prototype.hide=function(){this._isHidden=!0},X}(),Cn=function(X){function S(){var L=X!==null&&X.apply(this,arguments)||this;return L.elements=[],L}return At(S,X),S.prototype.addElement=function(L){this.elements.push(L)},S.prototype.getUI=function(){var L=X.prototype.getUI.call(this);return this.elements.forEach(function(W){return L.appendChild(W)}),L},S}(Mn),Ti=function(){function X(S,L){this.horizontal=S,this.vertical=L}return Object.defineProperty(X.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),X.prototype.getVerticalLength=function(S){return S/this.ratio},X.prototype.getHorizontalLength=function(S){return S*this.ratio},X}(),Wi=function(){function X(){}return X.getIcon=function(S,L){if(S>0&&L>0){var W=new Ti(S,L),ne=W.ratio>=1?20:W.getHorizontalLength(20),Q=W.ratio<1?20:W.getVerticalLength(20),ke=document.createElementNS("http://www.w3.org/2000/svg","svg");ke.setAttribute("xmlns","http://www.w3.org/2000/svg"),ke.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ke);var Vt=_e.createDefs();ke.appendChild(Vt);var kn=_e.createElement("clipPath",[["id","text-bg-clip"]]);Vt.appendChild(kn);var Qn=_e.createPath(_e.getHollowRectanglePath((24-ne)/2,(24-Q)/2,ne,Q,(24-ne)/2+2,(24-Q)/2+2,ne-4,Q-4));ke.appendChild(Qn);var nn=_e.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);nn.appendChild(_e.createTSpan(S+":"+L)),ke.appendChild(nn);var ti=nn.getBBox();_e.setAttributes(nn,[["x",((24-ti.width)/2).toString()],["y",((24-ti.height)/2-ti.y).toString()]]);var qn=_e.createPath(_e.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(ti.width))/2,(24-Math.ceil(ti.height))/2,Math.ceil(ti.width),Math.ceil(ti.height)));return kn.appendChild(qn),_e.setAttributes(Qn,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ke),ke.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>'},X}(),hi=function(X){function S(L,W,ne){var Q=X.call(this,L,W)||this;return Q.isDropdownOpen=!1,Q.onClick=Q.dropdownButtonClicked,Q.dropdownButtons=ne,Q}return At(S,X),S.prototype.setupDropdown=function(){var L=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(W){W.className=L.className,W.colorsClassName=L.colorsClassName,L.dropdownBlock.appendChild(W.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},S.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},S.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},S.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},S.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},S.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},S}($n),fi=function(){function X(S,L){this.GRIP_SIZE=10,this.color=S,this.fillColor=L,this.visual=_e.createGroup(),this.visual.appendChild(_e.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(_e.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return X.prototype.ownsTarget=function(S){return S===this.visual||S===this.visual.childNodes[0]||S===this.visual.childNodes[1]},X.prototype.setCenter=function(S,L){this.visual.childNodes.forEach(function(W){return _e.setAttributes(W,[["cx",S.toString()],["cy",L.toString()]])})},X}(),ji=function(){function X(S,L,W,ne){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=S,this.canvasHeight=L,this.margin=W,this.container=ne,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(X.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(S){this._aspectRatio=S,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(S){this._isGridVisible=S,this.gridContainer&&_e.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(S){this._zoomFactor=S,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),X.prototype.open=function(){var S=this;this.cropShadeElement=_e.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=_e.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var L=0;L<this.numberOfGridLines;L++)this.horizontalGridLines.push(_e.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(_e.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(W){return S.gridContainer.appendChild(W)}),this.verticalGridLines.forEach(function(W){return S.gridContainer.appendChild(W)}),this.cropRectElement=_e.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new fi(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new fi(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new fi(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new fi(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},X.prototype.setCropRectangle=function(S){this.cropRect=S;var L=Object.assign({},this.cropRect);this.zoomFactor!==1&&(L.width=this.cropRect.width*this.zoomFactor,L.height=this.cropRect.height*this.zoomFactor,L.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-L.width/2,L.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-L.height/2),_e.setAttributes(this.cropRectElement,[["x",L.x.toString()],["y",L.y.toString()],["width",L.width.toString()],["height",L.height.toString()]]);var W=L.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(Q,ke){var Vt=L.y+W*(ke+1);_e.setAttributes(Q,[["x1",""+L.x],["y1",""+Vt],["x2",""+(L.x+L.width)],["y2",""+Vt]])});var ne=L.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(Q,ke){var Vt=L.x+ne*(ke+1);_e.setAttributes(Q,[["x1",""+Vt],["y1",""+L.y],["x2",""+Vt],["y2",""+(L.y+L.height)]])}),_e.setAttributes(this.cropShadeElement,[["d",_e.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,L.x,L.y,L.width,L.height)]]),this.topLeftGrip.setCenter(L.x,L.y),this.topRightGrip.setCenter(L.x+L.width,L.y),this.bottomLeftGrip.setCenter(L.x,L.y+L.height),this.bottomRightGrip.setCenter(L.x+L.width,L.y+L.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},X.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)},X.prototype.clientToLocalCoordinates=function(S,L){var W=this.container.getBoundingClientRect();return{x:S-W.left+this.margin,y:L-W.top+this.margin}},X.prototype.onPointerDown=function(S){this.container.setPointerCapture(S.pointerId),this.previousPoint=this.clientToLocalCoordinates(S.clientX,S.clientY),this.cropRectElement===S.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(S.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(S.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(S.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(S.target)&&(this.activeGrip=this.bottomRightGrip)},X.prototype.onPointerMove=function(S){if(this.isMoving)this.move(this.clientToLocalCoordinates(S.clientX,S.clientY));else if(this.activeGrip){var L=this.clientToLocalCoordinates(S.clientX,S.clientY);this.resize(L)}S.preventDefault()},X.prototype.onPointerUp=function(S){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(S.pointerId)},X.prototype.move=function(S){var L=S.x-this.previousPoint.x,W=S.y-this.previousPoint.y;this.zoomFactor!==1&&(L=-L/this.zoomFactor,W=-W/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+L),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+W),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=S},X.prototype.resize=function(S){var L=Object.assign({},this.cropRect),W=S.x-this.previousPoint.x,ne=S.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:L.x+W<this.margin&&(W=this.margin-L.x),L.x+=W,L.width=this.cropRect.x+this.cropRect.width-L.x;break;case this.bottomRightGrip:case this.topRightGrip:L.width+W>this.canvasWidth*this.zoomFactor&&(W=this.canvasWidth*this.zoomFactor-L.width),L.width+=W}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(L.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(W),L.height=this.aspectRatio.getVerticalLength(L.width)):(L.y+=ne,L.height=this.cropRect.y+this.cropRect.height-L.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?L.height=this.aspectRatio.getVerticalLength(L.width):L.height+=ne}L.width<10&&(L.x=this.cropRect.x,L.width=10),L.height<10&&(L.y=this.cropRect.y,L.height=10),this.previousPoint=S,L.x>=this.margin&&L.y>=this.margin&&L.x-this.margin+L.width<=this.canvasWidth&&L.y-this.margin+L.height<=this.canvasHeight&&(this.cropRect=L,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},X.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var S=this.cropRect.x+this.cropRect.width/2,L=this.cropRect.y+this.cropRect.height/2,W=this.aspectRatio.getHorizontalLength(this.cropRect.height),ne=this.aspectRatio.getVerticalLength(this.cropRect.width);W/this.canvasWidth<ne/this.canvasHeight?this.cropRect.width=W:this.cropRect.height=ne,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=S-this.cropRect.width/2,this.cropRect.y=L-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)}},X.prototype.getRescaledRect=function(S,L,W,ne,Q,ke){var Vt=W/S,kn=ne/L;return{x:(Q.x-ke)*Vt+ke,y:(Q.y-ke)*kn+ke,width:Q.width*Vt,height:Q.height*kn}},X.prototype.scaleCanvas=function(S,L){var W=this.getRescaledRect(this.canvasWidth,this.canvasHeight,S,L,this.cropRect,this.margin);this.canvasWidth=S,this.canvasHeight=L,this.onCropChange&&this.onCropChange(W),this.setCropRectangle(W)},X}(),er=function(){function X(S){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=S,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(X.prototype,"angle",{get:function(){return this._angle},set:function(S){this._angle=S,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),X.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},X.prototype.onPointerDown=function(S){this.controlContainer.setPointerCapture(S.pointerId),this.isDragging=!0,this.previousPoint={x:S.clientX,y:S.clientY}},X.prototype.onPointerMove=function(S){this.isDragging&&(this.onAngleChange&&this.onAngleChange((S.clientX-this.previousPoint.x)/5),this.previousPoint.x=S.clientX)},X.prototype.onPointerUp=function(S){this.isDragging&&this.onAngleChange&&this.onAngleChange((S.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(S.pointerId)},X.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var S=this.angleLabelText.getBBox();_e.setAttributes(this.angleLabelElement,[["x",((this.width-S.width)/2).toString()],["y",(this.height/2).toString()]])}},X.prototype.positionScaleShape=function(){if(this.scaleShape){var S=this.scaleShape.transform.baseVal.getItem(0);S.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(S,0)}},X.prototype.getVisual=function(){var S=document.createElementNS("http://www.w3.org/2000/svg","svg");S.setAttribute("xmlns","http://www.w3.org/2000/svg"),S.setAttribute("width",this.width+"px"),S.setAttribute("height",this.height+"px"),S.setAttribute("viewBox","0 0 "+this.width+" "+this.height),S.style.flexShrink="0",document.body.appendChild(S);for(var L="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,W=1;W<=this.width/5+10;W++){var ne=W%5==0?this.height/3:this.height/6;L+="h4v"+-ne+"h1v"+ne}L+="v1H0Z",this.scaleShape=_e.createPath(L);var Q=_e.createTransform();this.scaleShape.transform.baseVal.appendItem(Q),S.appendChild(this.scaleShape),this.angleLabelElement=_e.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=_e.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ke=_e.createTSpan("");return ke.innerHTML="°",this.angleLabelElement.appendChild(ke),S.appendChild(this.angleLabelElement),document.body.removeChild(S),S},X}(),yr=function(){function X(){this.naturalSize=!1,this.imageType="image/png"}return X.prototype.rasterize=function(S,L,W,ne,Q,ke,Vt){var kn=this;return new Promise(function(Qn){var nn=document.createElement("canvas");nn.width=S.width.baseVal.value-2*ne,nn.height=S.height.baseVal.value-2*ne;var ti=1,qn=1;kn.naturalSize===!0?(ti=L.naturalWidth/(S.width.baseVal.value-2*ne)/ke,qn=L.naturalHeight/(S.height.baseVal.value-2*ne)/Vt,nn.width=L.naturalWidth/ke,nn.height=L.naturalHeight/Vt):kn.width!==void 0&&kn.height!==void 0&&(ti=kn.width/W.width,qn=kn.height/W.height,nn.width*=ti,nn.height*=qn);var Li=nn.getContext("2d");Li.translate(nn.width/2,nn.height/2),Li.rotate(Q*Math.PI/180),Li.scale(ke,Vt),Li.translate(-nn.width/2,-nn.height/2),Li.drawImage(L,0,0,nn.width,nn.height);var lr=document.createElement("canvas");lr.width=W.width*ti,lr.height=W.height*qn,lr.getContext("2d").putImageData(Li.getImageData((W.x-ne)*ti,(W.y-ne)*qn,W.width*ti,W.height*qn),0,0),Qn(lr.toDataURL(kn.imageType,kn.imageQuality))})},X}(),cn=function(){function X(S){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=X.instanceCounter++,this.styles=new Ne(this.instanceNo),this.target=S,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(X.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(S){this._zoomToCropEnabled=S,S?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(S){this._isGridVisible=S,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"gridLines",{get:function(){return this._gridLines},set:function(S){this._gridLines=S,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(S){this._rotationAngle=S,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"aspectRatio",{get:function(){var S;return(S=this._aspectRatio)!==null&&S!==void 0?S:this.aspectRatios[0]},set:function(S){this._aspectRatio=S},enumerable:!1,configurable:!0}),X.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},X.prototype.show=function(){this.showUI(),this.open()},X.prototype.close=function(S){S===void 0&&(S=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),S||this.closeEventListeners.forEach(function(L){return L()}),this._isOpen=!1)},X.prototype.addRenderEventListener=function(S){this.renderEventListeners.push(S)},X.prototype.removeRenderEventListener=function(S){this.renderEventListeners.indexOf(S)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(S),1)},X.prototype.addCloseEventListener=function(S){this.closeEventListeners.push(S)},X.prototype.removeCloseEventListener=function(S){this.closeEventListeners.indexOf(S)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(S),1)},X.prototype.setupResizeObserver=function(){var S=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){S.resize(S.target.clientWidth,S.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},X.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var S=1*this.target.clientWidth/this.target.clientHeight,L=this.contentDiv.clientWidth/S>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*S:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,W=L+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/S;this.resize(L,W)}},X.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},X.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",_e.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},X.prototype.resize=function(S,L){this.imageWidth=Math.round(S),this.imageHeight=Math.round(L),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()},X.prototype.setEditingTarget=function(){var S=document.createElement("canvas");S.width=this.target.naturalWidth,S.height=this.target.naturalHeight,S.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var L=S.toDataURL();_e.setAttributes(this.editingTarget,[["href",L]]),this.setEditingTargetSize()},X.prototype.setTopLeft=function(){var S=this.target.getBoundingClientRect(),L=this.editorCanvas.getBoundingClientRect();this.left=S.left-L.left-this.CANVAS_MARGIN,this.top=S.top-L.top-this.CANVAS_MARGIN},X.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=_e.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=_e.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=_e.createGroup(),this.editingTargetRotationScaleContainer=_e.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var S=_e.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(S);var L=_e.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(L),this.editingTargetContainer=_e.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)},X.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},X.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=_e.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new ji(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()},X.prototype.zoomToCrop=function(){if(this.cropRect){var S=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,L=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=S+"px "+L+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-S+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-L+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},X.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)},X.prototype.cropRectChanged=function(S){this.cropRect=S,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},X.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},X.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"},X.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},X.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 S=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,L=this.target.offsetTop>S+this.CANVAS_MARGIN?this.target.offsetTop-(S+this.CANVAS_MARGIN):0;this.coverDiv.style.top=L+"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},X.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},X.prototype.addTopToolbar=function(){var S=this;this.topToolbar=new vn,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 L=new ci;L.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(L);var W=[];this.aspectRatios.forEach(function(qn){var Li=new $n(Wi.getIcon(qn.horizontal,qn.vertical),qn.horizontal===0&&qn.vertical===0?"FREE":qn.horizontal+":"+qn.vertical);Li.onClick=function(){return S.ratioButtonClicked(qn)},W.push(Li)}),this.aspectRatioButton=new hi(Wi.getIcon(0,0),"Aspect ratio",W),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,L.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ne=new $n('<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");ne.isActive=this.isGridVisible,ne.onClick=function(){S.isGridVisible=!S.isGridVisible,ne.isActive=S.isGridVisible},L.addButton(ne);var Q=new $n('<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(){S.zoomToCropEnabled=!S.zoomToCropEnabled,Q.isActive=S.zoomToCropEnabled},L.addButton(Q),!rn.isLicensed){var ke=new Cn;this.topToolbar.addElementBlock(ke);var Vt=document.createElement("div");Vt.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var kn=document.createElement("a");kn.style.color="currentColor",kn.href="https://markerjs.com/products/cropro",kn.target="_blank",kn.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>',Vt.appendChild(kn),ke.addElement(Vt)}var Qn=new ci;Qn.minWidth=3*this.toolbarHeight+"px",Qn.contentAlign="end",this.topToolbar.addButtonBlock(Qn);var nn=new $n('<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");nn.onClick=this.startRenderAndClose,Qn.addButton(nn),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(nn.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var ti=new $n('<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");ti.onClick=this.close,Qn.addButton(ti),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(ti.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},X.prototype.addBottomToolbar=function(){var S=this;this.bottomToolbar=new vn,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 L=new ci;L.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(L);var W=new $n('<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");W.onClick=this.rotateLeftButtonClicked,L.addButton(W);var ne=new $n('<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");ne.onClick=this.rotateRightButtonClicked,L.addButton(ne);var Q=new Cn;Q.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(Q),this.straightener=new er("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(Qn){S.rotateBy(Qn),S.straightener.angle=S.rotationAngle},Q.addElement(this.straightener.getUI());var ke=new ci;ke.minWidth=2*this.toolbarHeight+"px",ke.contentAlign="end",this.bottomToolbar.addButtonBlock(ke);var Vt=new $n('<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");Vt.onClick=this.flipHorizontallyButtonClicked,ke.addButton(Vt);var kn=new $n('<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");kn.onClick=this.flipVerticallyButtonClicked,ke.addButton(kn)},X.prototype.ratioButtonClicked=function(S){this.aspectRatio=S,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},X.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Wi.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},X.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Ti(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},X.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},X.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},X.prototype.restoreState=function(S){if(S){var L=this.cropLayer.getRescaledRect(S.width,S.height,this.imageWidth,this.imageHeight,S.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(L),this.cropRectChanged(L),this.flippedHorizontally=S.flippedHorizontally,this.flippedVertically=S.flippedVertically,this.applyFlip(),this.rotationAngle=S.rotationAngle,this.applyRotation()}},X.prototype.clientToLocalCoordinates=function(S,L){var W=this.cropImage.getBoundingClientRect();return{x:S-W.left,y:L-W.top}},X.prototype.onWindowResize=function(){this.positionUI()},X.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var S=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=S+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},X.prototype.rotateLeftButtonClicked=function(){var S=this.rotationAngle-90;this.rotationAngle%90!=0&&(S+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(S)},X.prototype.rotateRightButtonClicked=function(){var S=this.rotationAngle+90;this.rotationAngle%90!=0&&(S-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(S)},X.prototype.rotateTo=function(S){S=(S=S>180?S-360:S)<=-180?S+360:S,this.rotationAngle=S,this.applyRotation()},X.prototype.rotateBy=function(S){this.rotateTo((this.rotationAngle+S)%360)},X.prototype.applyRotation=function(){var S=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var L=this.editingTargetRotationContainer.transform.baseVal.getItem(0);L.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(L,0);var W=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/W.width,this.imageHeight/W.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=S},X.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},X.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},X.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},X.prototype.startRenderAndClose=function(){return ot(this,void 0,void 0,function(){var S,L;return Yt(this,function(W){switch(W.label){case 0:return[4,this.render()];case 1:return S=W.sent(),L=this.getState(),this.renderEventListeners.forEach(function(ne){return ne(S,L)}),this.close(!0),[2]}})})},X.prototype.render=function(){return ot(this,void 0,void 0,function(){var S;return Yt(this,function(L){switch(L.label){case 0:return(S=new yr).naturalSize=this.renderAtNaturalSize,S.imageType=this.renderImageType,S.imageQuality=this.renderImageQuality,S.width=this.renderWidth,S.height=this.renderHeight,this.unzoomFromCrop(),_e.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,S.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return L.sent(),[4,S.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,L.sent()]}})})},X.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Xt("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 Xt("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Xt("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var S=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Xt("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*S)+`px;
|
|
height: `+(this.toolbarHeight-2*S)+`px;
|
|
padding: `+S+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Xt("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Xt("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new xt("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new xt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Xt("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 Xt("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Xt("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 Xt("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*S)+`px;
|
|
padding: `+S+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Xt("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},X.instanceCounter=0,X}(),ri=I("8hTe"),pr=I.n(ri),Cr=/<pre[^>]*>/g;function tr(X){var S=document.createElement("div");return S.innerHTML=X,S.childNodes.length===0?"":S.childNodes[0].nodeValue}var nr=Qe.a=function(X){var S=X.value,L=S===void 0?"":S,W=X.edit,ne=W===void 0?!1:W,Q=X.className,ke=X.showTextOnly,Vt=X.showLines,kn=X.replaces,Qn=X.zoomImg,nn=X.hasMask,ti=X.style,qn=ti===void 0?{}:ti,Li=X.stylesPrev,lr=Li===void 0?{}:Li,ar=String(L),Ki=Object(D.useRef)(),Pr=Object(D.useRef)(),Vr=Object(D.useState)(""),Ai=Object(H.a)(Vr,2),wi=Ai[0],ir=Ai[1],Fi=Object(D.useState)("office"),Bn=Object(H.a)(Fi,2),gn=Bn[0],Tn=Bn[1],_n=function(){var Oe=new cn(Pr.current);Oe.displayMode="popup",Oe.addRenderEventListener(function(){var Ve=Object(M.a)(k.a.mark(function et(Ot){var Et;return k.a.wrap(function(ht){for(;;)switch(ht.prev=ht.next){case 0:return Ki.current.style.display="none",ht.next=3,Object(Ye.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Ot}});case 3:Et=ht.sent,Et!=null&&Et.id&&kn(Pr.current.getAttribute("src").replace(Z.a.API_SERVER,""),"/api/attachments/".concat(Et==null?void 0:Et.id,"?type=").concat(Et.content_type));case 5:case"end":return ht.stop()}},et)}));return function(et){return Ve.apply(this,arguments)}}()),Oe.show()},si=function(){var Oe=new ce(Pr.current);Oe.settings.displayMode="popup",Oe.addEventListener("render",function(){var Ve=Object(M.a)(k.a.mark(function et(Ot){var Et;return k.a.wrap(function(ht){for(;;)switch(ht.prev=ht.next){case 0:if(Ki.current.style.display="none",!Pr.current){ht.next=6;break}return ht.next=4,Object(Ye.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Ot.dataUrl}});case 4:Et=ht.sent,Et!=null&&Et.id&&kn(Pr.current.getAttribute("src").replace(Z.a.API_SERVER,""),"/api/attachments/".concat(Et==null?void 0:Et.id,"?type=").concat(Et.content_type));case 6:case"end":return ht.stop()}},et)}));return function(et){return Ve.apply(this,arguments)}}()),Oe.show(),window.markerArea=Oe},ai=Object(D.useMemo)(function(){Ki.current&&(Ki.current.style.zIndex=-1);try{var qe=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Oe=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Ve=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;ar=ar.replace(qe,"("+Z.a.API_SERVER+"/api/attachments/").replace(Oe,'"'+Z.a.API_SERVER+"/api/attachments/").replace(Ve,'"'+Z.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(je){}var et=G(ar),Ot=v();if(ar.match(/\[TOC\]/)&&(et=et.replace("<p>[TOC]</p>",O()),R()),et=et.replace(/(__special_katext_id_\d+__)/g,function(je,ht){var it=Ot[ht],st=it.type,bt=it.expression;return Object(oe.renderToString)(tr(bt)||"",{displayMode:st==="block",throwOnError:!1,output:"html"})}),et=et.replace(/▁/g,"\u2581\u2581\u2581"),p(),ke){var Et=document.createElement("div");return Et.innerHTML=et,Et.innerText}return setTimeout(function(){return Ce()},500),et},[ar]),J=Object(D.useRef)();w.WebkitLineClamp=Vt,Vt&&(qn=Object(A.a)(Object(A.a)({},qn),w));function ue(qe){var Oe=qe.target;if(Oe.tagName.toUpperCase()==="IMG"){if(Qn){var Ve=Oe.getAttribute("src");ir(Ve),Tn("image")}}else if(Oe.tagName.toUpperCase()==="A"){var et=Oe.getAttribute("href");if(et.indexOf("office")>-1)qe.preventDefault(),ir(et),Tn("office");else if(et.indexOf("application/pdf")>-1)qe.preventDefault(),ir(et),Tn("pdf");else if(et.indexOf("text/html")>-1)qe.preventDefault(),ir(et),Tn("html");else if(et.startsWith("#")){qe.preventDefault();var Ot=document.getElementById(et.replace("#",""));Ot&&Ot.scrollIntoView(!0)}}}var Ce=function(){var Oe,Ve=(Oe=J.current)===null||Oe===void 0?void 0:Oe.querySelectorAll("video");Ve==null||Ve.forEach(function(et){if(et.oncontextmenu=function(){return!1},et.src.indexOf(".m3u8")>-1&&!et.canPlayType("application/vnd.apple.mpegurl")){if(V.a.isSupported()){var Ot=new V.a;Ot.loadSource(et.src),Ot.attachMedia(et)}}})};Object(D.useEffect)(function(){if(J.current&&ai&&(ai.match(Cr)&&window.PR.prettyPrint()),J.current)return J.current.addEventListener("click",ue),function(){J.current.removeEventListener("click",ue),p(),R()}},[ai,J.current,ue]);var Te=function(Oe){if(!ne)return;Oe.target.nodeName==="IMG"?(Ki.current.style.zIndex=1,Ki.current.style.display="flex",Ki.current.style.width=Oe.target.clientWidth+"px",Ki.current.style.height=Oe.target.clientHeight+"px",Ki.current.style.top=Oe.target.offsetTop+"px",Ki.current.style.left=Oe.target.offsetLeft+"px",Pr.current.src=Oe.target.getAttribute("src")):Ki.current.style.display="none"};return b.a.createElement("div",{style:{position:"relative"}},b.a.createElement("div",{ref:J,style:Object(A.a)({},qn),className:"".concat(Q||""," markdown-body ").concat(pr.a.mdBody),onMouseOver:Te,dangerouslySetInnerHTML:{__html:ai}}),b.a.createElement("div",{ref:Ki,className:pr.a.button},b.a.createElement(Y.a,null,b.a.createElement(K.a,{onClick:function(){return _n()}},"\u88C1\u526A"),b.a.createElement(K.a,{onClick:function(){return si()}},"\u7F16\u8F91"))),b.a.createElement("img",{ref:Pr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),b.a.createElement(pe.a,{close:!0,data:wi,type:wi!=null&&wi.length?gn:"",style:Object(A.a)({},lr),onClose:function(){return ir("")}}))}},"9VGf":function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return N});var te=I("q1tI"),Y=I.n(te);function N(K,A){var M=Object(te.useRef)();Object(te.useEffect)(function(){M.current=K}),Object(te.useEffect)(function(){function H(){M.current()}if(A!==null){var P=setInterval(H,A);return function(){return clearInterval(P)}}},[A])}},AHFd:function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return P});var te=I("giR+"),Y=I("fyUT"),N=I("OaEy"),K=I("2fM7"),A=I("tJVT"),M=I("q1tI"),H=I.n(M),P;(function(D){D[D.Number=1]="Number",D[D.Percent=2]="Percent"})(P||(P={}));var k=function(b){var m=b.value,f=b.onChange,d=b.disabled,s=b.hidePercentOption,r=s===void 0?!1:s,u=Object(M.useMemo)(function(){return r?P.Number:P.Percent},[r]),o=Object(M.useState)(u),a=Object(A.a)(o,2),n=a[0],R=a[1],w=Object(M.useCallback)(function(O){return n===P.Number?"".concat(O,"\u5206"):"".concat(O,"%")},[n]),x=Object(M.useCallback)(function(O){if(n===P.Number){var C=O.replace("\u5206","");return isNaN(parseInt(C,10))?0:C}else{var _=O.replace("%","");return _}},[n]);return Object(M.useEffect)(function(){R(m.type)},[m]),H.a.createElement("div",{style:{display:"inline-block"}},H.a.createElement(K.a,{onChange:function(C){R(C),f({type:C,inputValue:C===P.Number?5:20})},value:n||u,style:{width:100},options:r?[{label:"\u5206\u503C",value:P.Number}]:[{label:"\u767E\u5206\u6BD4",value:P.Percent},{label:"\u5206\u503C",value:P.Number}],disabled:d}),H.a.createElement(Y.a,{disabled:d,value:m.inputValue,formatter:w,parser:x,max:n===P.Percent?100:Number.MAX_SAFE_INTEGER,min:0,precision:0,onChange:function(C){f({type:n,inputValue:C})}}))};Qe.b=k},BU3w:function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return M});var te=I("MNnm"),Y="rc-util-key";function N(H){if(H.attachTo)return H.attachTo;var P=document.querySelector("head");return P||document.body}function K(H){var P,k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(te.a)())return null;var D=document.createElement("style");if((P=k.csp)===null||P===void 0?void 0:P.nonce){var b;D.nonce=(b=k.csp)===null||b===void 0?void 0:b.nonce}D.innerHTML=H;var m=N(k),f=m.firstChild;return k.prepend&&m.prepend?m.prepend(D):k.prepend&&f?m.insertBefore(D,f):m.appendChild(D),D}var A=new Map;function M(H,P){var k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},D=N(k);if(!A.has(D)){var b=K("",k),m=b.parentNode;A.set(D,m),m.removeChild(b)}var f=Array.from(A.get(D).children).find(function(o){return o.tagName==="STYLE"&&o[Y]===P});if(f){var d,s;if(((d=k.csp)===null||d===void 0?void 0:d.nonce)&&f.nonce!==((s=k.csp)===null||s===void 0?void 0:s.nonce)){var r;f.nonce=(r=k.csp)===null||r===void 0?void 0:r.nonce}return f.innerHTML!==H&&(f.innerHTML=H),f}var u=K(H,k);return u[Y]=P,u}},Bd2K:function(tn,Qe,I){(function(te){te(I("VrN/"),I("osHv"))})(function(te){te.defineOption("autoCloseTags",!1,function(k,D,b){if(b!=te.Init&&b&&k.removeKeyMap("autoCloseTags"),!D)return;var m={name:"autoCloseTags"};(typeof D!="object"||D.whenClosing!==!1)&&(m["'/'"]=function(f){return M(f)}),(typeof D!="object"||D.whenOpening!==!1)&&(m["'>'"]=function(f){return K(f)}),k.addKeyMap(m)});var Y=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],N=["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 K(k){if(k.getOption("disableInput"))return te.Pass;for(var D=k.listSelections(),b=[],m=k.getOption("autoCloseTags"),f=0;f<D.length;f++){if(!D[f].empty())return te.Pass;var d=D[f].head,s=k.getTokenAt(d),r=te.innerMode(k.getMode(),s.state),u=r.state,o=r.mode.xmlCurrentTag&&r.mode.xmlCurrentTag(u),a=o&&o.name;if(!a)return te.Pass;var n=r.mode.configuration=="html",R=typeof m=="object"&&m.dontCloseTags||n&&Y,w=typeof m=="object"&&m.indentTags||n&&N;s.end>d.ch&&(a=a.slice(0,a.length-s.end+d.ch));var x=a.toLowerCase();if(!a||s.type=="string"&&(s.end!=d.ch||!/[\"\']/.test(s.string.charAt(s.string.length-1))||s.string.length==1)||s.type=="tag"&&o.close||s.string.indexOf("/")==d.ch-s.start-1||R&&H(R,x)>-1||P(k,r.mode.xmlCurrentContext&&r.mode.xmlCurrentContext(u)||[],a,d,!0))return te.Pass;var O=typeof m=="object"&&m.emptyTags;if(O&&H(O,a)>-1){b[f]={text:"/>",newPos:te.Pos(d.line,d.ch+2)};continue}var C=w&&H(w,x)>-1;b[f]={indent:C,text:">"+(C?`
|
|
|
|
`:"")+"</"+a+">",newPos:C?te.Pos(d.line+1,0):te.Pos(d.line,d.ch+1)}}for(var _=typeof m=="object"&&m.dontIndentOnAutoClose,f=D.length-1;f>=0;f--){var y=b[f];k.replaceRange(y.text,D[f].head,D[f].anchor,"+insert");var h=k.listSelections().slice(0);h[f]={head:y.newPos,anchor:y.newPos},k.setSelections(h),!_&&y.indent&&(k.indentLine(y.newPos.line,null,!0),k.indentLine(y.newPos.line+1,null,!0))}}function A(k,D){for(var b=k.listSelections(),m=[],f=D?"/":"</",d=k.getOption("autoCloseTags"),s=typeof d=="object"&&d.dontIndentOnSlash,r=0;r<b.length;r++){if(!b[r].empty())return te.Pass;var u=b[r].head,o=k.getTokenAt(u),a=te.innerMode(k.getMode(),o.state),n=a.state;if(D&&(o.type=="string"||o.string.charAt(0)!="<"||o.start!=u.ch-1))return te.Pass;var R,w=a.mode.name!="xml"&&k.getMode().name=="htmlmixed";if(w&&a.mode.name=="javascript")R=f+"script";else if(w&&a.mode.name=="css")R=f+"style";else{var x=a.mode.xmlCurrentContext&&a.mode.xmlCurrentContext(n);if(!x||x.length&&P(k,x,x[x.length-1],u))return te.Pass;R=f+x[x.length-1]}k.getLine(u.line).charAt(o.end)!=">"&&(R+=">"),m[r]=R}if(k.replaceSelections(m),b=k.listSelections(),!s)for(var r=0;r<b.length;r++)(r==b.length-1||b[r].head.line<b[r+1].head.line)&&k.indentLine(b[r].head.line)}function M(k){return k.getOption("disableInput")?te.Pass:A(k,!0)}te.commands.closeTag=function(k){return A(k)};function H(k,D){if(k.indexOf)return k.indexOf(D);for(var b=0,m=k.length;b<m;++b)if(k[b]==D)return b;return-1}function P(k,D,b,m,f){if(!te.scanForClosingTag)return!1;var d=Math.min(k.lastLine()+1,m.line+500),s=te.scanForClosingTag(k,m,null,d);if(!s||s.tag!=b)return!1;for(var r=f?1:0,u=D.length-1;u>=0&&D[u]==b;u--)++r;m=s.to;for(var u=1;u<r;u++){var o=te.scanForClosingTag(k,m,null,d);if(!o||o.tag!=b)return!1;m=o.to}return!0}})},BdwD:function(tn,Qe,I){"use strict";var te=I("+L6B"),Y=I("2/Rp"),N=I("0Owb"),K=I("k1fw"),A=I("q1tI"),M=I.n(A),H=I("FOrL"),P=I.n(H),k=function(b){var m=b.buttonProps,f=m===void 0?{}:m,d=b.styles,s=d===void 0?{}:d,r=b.customText,u=b.ButtonText,o=b.ButtonClick,a=b.Buttonclass,n=b.ButtonTwo;return M.a.createElement("section",{className:"tc animated fadeIn",style:Object(K.a)(Object(K.a)({},{color:"#999",margin:"200px auto"}),s)},M.a.createElement("img",{src:P.a}),M.a.createElement("p",{className:"mt20 font14"},r||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),u&&M.a.createElement(Y.a,Object(N.a)({className:a,onClick:o},f),u),n&&n)};Qe.a=k},BjJ7:function(tn,Qe,I){"use strict";I.d(Qe,"d",function(){return Y}),I.d(Qe,"c",function(){return N}),I.d(Qe,"e",function(){return K}),I.d(Qe,"b",function(){return A}),I.d(Qe,"a",function(){return H});var te=I("m3rI");function Y(P){var k=!0;if(P.length>0){for(var D=0;D<P.length;D++)if(P[D].compile_success==0||!P[D].compile_success){k=!1;break}}else k=!1;return k}function N(P){for(var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",D=[],b=0;b<P.length;b++){var m=P[b],f=k?"".concat(k,"/").concat(m.name):"".concat(m.name);D.push({title:m.name,isLeaf:!(m.type==="tree"),key:f})}return D}function K(P,k,D){for(var b=0;b<P.length;b++){var m=P[b];if(m.key===k){m.children=D;break}m.children&&K(m.children,k,D)}return P}function A(P,k,D){var b;return function(){var m=this,f=arguments,d=function(){b=null,D||P.apply(m,f)},s=D&&!b;clearTimeout(b),b=setTimeout(d,k),s&&P.apply(m,f)}}var M=!0,H=te.a.API_SERVER},"C+DQ":function(tn,Qe,I){},DlQD:function(tn,Qe,I){(function(te,Y){tn.exports=Y()})(this,function(){"use strict";function te(Ae,ge){for(var Ee=0;Ee<ge.length;Ee++){var ae=ge[Ee];ae.enumerable=ae.enumerable||!1,ae.configurable=!0,"value"in ae&&(ae.writable=!0),Object.defineProperty(Ae,ae.key,ae)}}function Y(Ae,ge,Ee){return ge&&te(Ae.prototype,ge),Ee&&te(Ae,Ee),Ae}function N(Ae,ge){if(!Ae)return;if(typeof Ae=="string")return K(Ae,ge);var Ee=Object.prototype.toString.call(Ae).slice(8,-1);if(Ee==="Object"&&Ae.constructor&&(Ee=Ae.constructor.name),Ee==="Map"||Ee==="Set")return Array.from(Ae);if(Ee==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ee))return K(Ae,ge)}function K(Ae,ge){(ge==null||ge>Ae.length)&&(ge=Ae.length);for(var Ee=0,ae=new Array(ge);Ee<ge;Ee++)ae[Ee]=Ae[Ee];return ae}function A(Ae,ge){var Ee;if(typeof Symbol=="undefined"||Ae[Symbol.iterator]==null){if(Array.isArray(Ae)||(Ee=N(Ae))||ge&&Ae&&typeof Ae.length=="number"){Ee&&(Ae=Ee);var ae=0;return function(){return ae>=Ae.length?{done:!0}:{done:!1,value:Ae[ae++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return Ee=Ae[Symbol.iterator](),Ee.next.bind(Ee)}function M(Ae,ge){return ge={exports:{}},Ae(ge,ge.exports),ge.exports}var H=M(function(Ae){function ge(){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 Ee(ae){Ae.exports.defaults=ae}Ae.exports={defaults:ge(),getDefaults:ge,changeDefaults:Ee}}),P=H.defaults,k=H.getDefaults,D=H.changeDefaults,b=/[&<>"']/,m=/[&<>"']/g,f=/[<>"']|&(?!#?\w+;)/,d=/[<>"']|&(?!#?\w+;)/g,s={"&":"&","<":"<",">":">",'"':""","'":"'"},r=function(ge){return s[ge]};function u(Ae,ge){if(ge){if(b.test(Ae))return Ae.replace(m,r)}else if(f.test(Ae))return Ae.replace(d,r);return Ae}var o=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function a(Ae){return Ae.replace(o,function(ge,Ee){return Ee=Ee.toLowerCase(),Ee==="colon"?":":Ee.charAt(0)==="#"?Ee.charAt(1)==="x"?String.fromCharCode(parseInt(Ee.substring(2),16)):String.fromCharCode(+Ee.substring(1)):""})}var n=/(^|[^\[])\^/g;function R(Ae,ge){Ae=Ae.source||Ae,ge=ge||"";var Ee={replace:function(re,he){return he=he.source||he,he=he.replace(n,"$1"),Ae=Ae.replace(re,he),Ee},getRegex:function(){return new RegExp(Ae,ge)}};return Ee}var w=/[^\w:]/g,x=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function O(Ae,ge,Ee){if(Ae){var ae;try{ae=decodeURIComponent(a(Ee)).replace(w,"").toLowerCase()}catch(re){return null}if(ae.indexOf("javascript:")===0||ae.indexOf("vbscript:")===0||ae.indexOf("data:")===0)return null}ge&&!x.test(Ee)&&(Ee=c(ge,Ee));try{Ee=encodeURI(Ee).replace(/%25/g,"%")}catch(re){return null}return Ee}var C={},_=/^[^:]+:\/*[^/]*$/,y=/^([^:]+:)[\s\S]*$/,h=/^([^:]+:\/*[^/]*)[\s\S]*$/;function c(Ae,ge){C[" "+Ae]||(_.test(Ae)?C[" "+Ae]=Ae+"/":C[" "+Ae]=U(Ae,"/",!0)),Ae=C[" "+Ae];var Ee=Ae.indexOf(":")===-1;return ge.substring(0,2)==="//"?Ee?ge:Ae.replace(y,"$1")+ge:ge.charAt(0)==="/"?Ee?ge:Ae.replace(h,"$1")+ge:Ae+ge}var v={exec:function(){}};function p(Ae){for(var ge=1,Ee,ae;ge<arguments.length;ge++){Ee=arguments[ge];for(ae in Ee)Object.prototype.hasOwnProperty.call(Ee,ae)&&(Ae[ae]=Ee[ae])}return Ae}function E(Ae,ge){var Ee=Ae.replace(/\|/g,function(he,ve,me){for(var Be=!1,Tt=ve;--Tt>=0&&me[Tt]==="\\";)Be=!Be;return Be?"|":" |"}),ae=Ee.split(/ \|/),re=0;if(ae.length>ge)ae.splice(ge);else for(;ae.length<ge;)ae.push("");for(;re<ae.length;re++)ae[re]=ae[re].trim().replace(/\\\|/g,"|");return ae}function U(Ae,ge,Ee){var ae=Ae.length;if(ae===0)return"";for(var re=0;re<ae;){var he=Ae.charAt(ae-re-1);if(he===ge&&!Ee)re++;else if(he!==ge&&Ee)re++;else break}return Ae.substr(0,ae-re)}function F(Ae,ge){if(Ae.indexOf(ge[1])===-1)return-1;for(var Ee=Ae.length,ae=0,re=0;re<Ee;re++)if(Ae[re]==="\\")re++;else if(Ae[re]===ge[0])ae++;else if(Ae[re]===ge[1]&&(ae--,ae<0))return re;return-1}function z(Ae){Ae&&Ae.sanitize&&!Ae.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 G={escape:u,unescape:a,edit:R,cleanUrl:O,resolveUrl:c,noopTest:v,merge:p,splitCells:E,rtrim:U,findClosingBracket:F,checkSanitizeDeprecation:z},B=H.defaults,T=G.rtrim,V=G.splitCells,Z=G.escape,oe=G.findClosingBracket;function pe(Ae,ge,Ee){var ae=ge.href,re=ge.title?Z(ge.title):null,he=Ae[1].replace(/\\([\[\]])/g,"$1");return Ae[0].charAt(0)!=="!"?{type:"link",raw:Ee,href:ae,title:re,text:he}:{type:"image",raw:Ee,href:ae,title:re,text:Z(he)}}function Ye(Ae,ge){var Ee=Ae.match(/^(\s+)(?:```)/);if(Ee===null)return ge;var ae=Ee[1];return ge.split(`
|
|
`).map(function(re){var he=re.match(/^\s+/);if(he===null)return re;var ve=he[0];return ve.length>=ae.length?re.slice(ae.length):re}).join(`
|
|
`)}var xe=function(){function Ae(Ee){this.options=Ee||B}var ge=Ae.prototype;return ge.space=function(ae){var re=this.rules.block.newline.exec(ae);if(re)return re[0].length>1?{type:"space",raw:re[0]}:{raw:`
|
|
`}},ge.code=function(ae,re){var he=this.rules.block.code.exec(ae);if(he){var ve=re[re.length-1];if(ve&&ve.type==="paragraph")return{raw:he[0],text:he[0].trimRight()};var me=he[0].replace(/^ {4}/gm,"");return{type:"code",raw:he[0],codeBlockStyle:"indented",text:this.options.pedantic?me:T(me,`
|
|
`)}}},ge.fences=function(ae){var re=this.rules.block.fences.exec(ae);if(re){var he=re[0],ve=Ye(he,re[3]||"");return{type:"code",raw:he,lang:re[2]?re[2].trim():re[2],text:ve}}},ge.heading=function(ae){var re=this.rules.block.heading.exec(ae);if(re)return{type:"heading",raw:re[0],depth:re[1].length,text:re[2]}},ge.nptable=function(ae){var re=this.rules.block.nptable.exec(ae);if(re){var he={type:"table",header:V(re[1].replace(/^ *| *\| *$/g,"")),align:re[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:re[3]?re[3].replace(/\n$/,"").split(`
|
|
`):[],raw:re[0]};if(he.header.length===he.align.length){var ve=he.align.length,me;for(me=0;me<ve;me++)/^ *-+: *$/.test(he.align[me])?he.align[me]="right":/^ *:-+: *$/.test(he.align[me])?he.align[me]="center":/^ *:-+ *$/.test(he.align[me])?he.align[me]="left":he.align[me]=null;for(ve=he.cells.length,me=0;me<ve;me++)he.cells[me]=V(he.cells[me],he.header.length);return he}}},ge.hr=function(ae){var re=this.rules.block.hr.exec(ae);if(re)return{type:"hr",raw:re[0]}},ge.blockquote=function(ae){var re=this.rules.block.blockquote.exec(ae);if(re){var he=re[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:re[0],text:he}}},ge.list=function(ae){var re=this.rules.block.list.exec(ae);if(re){for(var he=re[0],ve=re[2],me=ve.length>1,Be=ve[ve.length-1]===")",Tt={type:"list",raw:he,ordered:me,start:me?+ve.slice(0,-1):"",loose:!1,items:[]},Jt=re[0].match(this.rules.block.item),En=!1,mt,Qt,gt,yt,rt,ce,Re,At=Jt.length,ot=0;ot<At;ot++)mt=Jt[ot],he=mt,Qt=mt.length,mt=mt.replace(/^ *([*+-]|\d+[.)]) */,""),~mt.indexOf(`
|
|
`)&&(Qt-=mt.length,mt=this.options.pedantic?mt.replace(/^ {1,4}/gm,""):mt.replace(new RegExp("^ {1,"+Qt+"}","gm"),"")),ot!==At-1&&(gt=this.rules.block.bullet.exec(Jt[ot+1])[0],(me?gt.length===1||!Be&>[gt.length-1]===")":gt.length>1||this.options.smartLists&>!==ve)&&(yt=Jt.slice(ot+1).join(`
|
|
`),Tt.raw=Tt.raw.substring(0,Tt.raw.length-yt.length),ot=At-1)),rt=En||/\n\n(?!\s*$)/.test(mt),ot!==At-1&&(En=mt.charAt(mt.length-1)===`
|
|
`,rt||(rt=En)),rt&&(Tt.loose=!0),ce=/^\[[ xX]\] /.test(mt),Re=void 0,ce&&(Re=mt[1]!==" ",mt=mt.replace(/^\[[ xX]\] +/,"")),Tt.items.push({type:"list_item",raw:he,task:ce,checked:Re,loose:rt,text:mt});return Tt}},ge.html=function(ae){var re=this.rules.block.html.exec(ae);if(re)return{type:this.options.sanitize?"paragraph":"html",raw:re[0],pre:!this.options.sanitizer&&(re[1]==="pre"||re[1]==="script"||re[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(re[0]):Z(re[0]):re[0]}},ge.def=function(ae){var re=this.rules.block.def.exec(ae);if(re){re[3]&&(re[3]=re[3].substring(1,re[3].length-1));var he=re[1].toLowerCase().replace(/\s+/g," ");return{tag:he,raw:re[0],href:re[2],title:re[3]}}},ge.table=function(ae){var re=this.rules.block.table.exec(ae);if(re){var he={type:"table",header:V(re[1].replace(/^ *| *\| *$/g,"")),align:re[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:re[3]?re[3].replace(/\n$/,"").split(`
|
|
`):[]};if(he.header.length===he.align.length){he.raw=re[0];var ve=he.align.length,me;for(me=0;me<ve;me++)/^ *-+: *$/.test(he.align[me])?he.align[me]="right":/^ *:-+: *$/.test(he.align[me])?he.align[me]="center":/^ *:-+ *$/.test(he.align[me])?he.align[me]="left":he.align[me]=null;for(ve=he.cells.length,me=0;me<ve;me++)he.cells[me]=V(he.cells[me].replace(/^ *\| *| *\| *$/g,""),he.header.length);return he}}},ge.lheading=function(ae){var re=this.rules.block.lheading.exec(ae);if(re)return{type:"heading",raw:re[0],depth:re[2].charAt(0)==="="?1:2,text:re[1]}},ge.paragraph=function(ae){var re=this.rules.block.paragraph.exec(ae);if(re)return{type:"paragraph",raw:re[0],text:re[1].charAt(re[1].length-1)===`
|
|
`?re[1].slice(0,-1):re[1]}},ge.text=function(ae,re){var he=this.rules.block.text.exec(ae);if(he){var ve=re[re.length-1];return ve&&ve.type==="text"?{raw:he[0],text:he[0]}:{type:"text",raw:he[0],text:he[0]}}},ge.escape=function(ae){var re=this.rules.inline.escape.exec(ae);if(re)return{type:"escape",raw:re[0],text:Z(re[1])}},ge.tag=function(ae,re,he){var ve=this.rules.inline.tag.exec(ae);if(ve)return!re&&/^<a /i.test(ve[0])?re=!0:re&&/^<\/a>/i.test(ve[0])&&(re=!1),!he&&/^<(pre|code|kbd|script)(\s|>)/i.test(ve[0])?he=!0:he&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ve[0])&&(he=!1),{type:this.options.sanitize?"text":"html",raw:ve[0],inLink:re,inRawBlock:he,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ve[0]):Z(ve[0]):ve[0]}},ge.link=function(ae){var re=this.rules.inline.link.exec(ae);if(re){var he=oe(re[2],"()");if(he>-1){var ve=re[0].indexOf("!")===0?5:4,me=ve+re[1].length+he;re[2]=re[2].substring(0,he),re[0]=re[0].substring(0,me).trim(),re[3]=""}var Be=re[2],Tt="";if(this.options.pedantic){var Jt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Be);Jt?(Be=Jt[1],Tt=Jt[3]):Tt=""}else Tt=re[3]?re[3].slice(1,-1):"";Be=Be.trim().replace(/^<([\s\S]*)>$/,"$1");var En=pe(re,{href:Be&&Be.replace(this.rules.inline._escapes,"$1"),title:Tt&&Tt.replace(this.rules.inline._escapes,"$1")},re[0]);return En}},ge.reflink=function(ae,re){var he;if((he=this.rules.inline.reflink.exec(ae))||(he=this.rules.inline.nolink.exec(ae))){var ve=(he[2]||he[1]).replace(/\s+/g," ");if(ve=re[ve.toLowerCase()],!ve||!ve.href){var me=he[0].charAt(0);return{type:"text",raw:me,text:me}}var Be=pe(he,ve,he[0]);return Be}},ge.strong=function(ae,re,he){he===void 0&&(he="");var ve=this.rules.inline.strong.start.exec(ae);if(ve&&(!ve[1]||ve[1]&&(he===""||this.rules.inline.punctuation.exec(he)))){re=re.slice(-1*ae.length);var me=ve[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;me.lastIndex=0;for(var Be;(ve=me.exec(re))!=null;)if(Be=this.rules.inline.strong.middle.exec(re.slice(0,ve.index+3)),Be)return{type:"strong",raw:ae.slice(0,Be[0].length),text:ae.slice(2,Be[0].length-2)}}},ge.em=function(ae,re,he){he===void 0&&(he="");var ve=this.rules.inline.em.start.exec(ae);if(ve&&(!ve[1]||ve[1]&&(he===""||this.rules.inline.punctuation.exec(he)))){re=re.slice(-1*ae.length);var me=ve[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;me.lastIndex=0;for(var Be;(ve=me.exec(re))!=null;)if(Be=this.rules.inline.em.middle.exec(re.slice(0,ve.index+2)),Be)return{type:"em",raw:ae.slice(0,Be[0].length),text:ae.slice(1,Be[0].length-1)}}},ge.codespan=function(ae){var re=this.rules.inline.code.exec(ae);if(re){var he=re[2].replace(/\n/g," "),ve=/[^ ]/.test(he),me=he.startsWith(" ")&&he.endsWith(" ");return ve&&me&&(he=he.substring(1,he.length-1)),he=Z(he,!0),{type:"codespan",raw:re[0],text:he}}},ge.br=function(ae){var re=this.rules.inline.br.exec(ae);if(re)return{type:"br",raw:re[0]}},ge.del=function(ae){var re=this.rules.inline.del.exec(ae);if(re)return{type:"del",raw:re[0],text:re[1]}},ge.autolink=function(ae,re){var he=this.rules.inline.autolink.exec(ae);if(he){var ve,me;return he[2]==="@"?(ve=Z(this.options.mangle?re(he[1]):he[1]),me="mailto:"+ve):(ve=Z(he[1]),me=ve),{type:"link",raw:he[0],text:ve,href:me,tokens:[{type:"text",raw:ve,text:ve}]}}},ge.url=function(ae,re){var he;if(he=this.rules.inline.url.exec(ae)){var ve,me;if(he[2]==="@")ve=Z(this.options.mangle?re(he[0]):he[0]),me="mailto:"+ve;else{var Be;do Be=he[0],he[0]=this.rules.inline._backpedal.exec(he[0])[0];while(Be!==he[0]);ve=Z(he[0]),he[1]==="www."?me="http://"+ve:me=ve}return{type:"link",raw:he[0],text:ve,href:me,tokens:[{type:"text",raw:ve,text:ve}]}}},ge.inlineText=function(ae,re,he){var ve=this.rules.inline.text.exec(ae);if(ve){var me;return re?me=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ve[0]):Z(ve[0]):ve[0]:me=Z(this.options.smartypants?he(ve[0]):ve[0]),{type:"text",raw:ve[0],text:me}}},Ae}(),Ie=G.noopTest,Je=G.edit,Ke=G.merge,be={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Ie,table:Ie,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};be._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,be._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,be.def=Je(be.def).replace("label",be._label).replace("title",be._title).getRegex(),be.bullet=/(?:[*+-]|\d{1,9}[.)])/,be.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,be.item=Je(be.item,"gm").replace(/bull/g,be.bullet).getRegex(),be.list=Je(be.list).replace(/bull/g,be.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+be.def.source+")").getRegex(),be._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",be._comment=/<!--(?!-?>)[\s\S]*?-->/,be.html=Je(be.html,"i").replace("comment",be._comment).replace("tag",be._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),be.paragraph=Je(be._paragraph).replace("hr",be.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",be._tag).getRegex(),be.blockquote=Je(be.blockquote).replace("paragraph",be.paragraph).getRegex(),be.normal=Ke({},be),be.gfm=Ke({},be.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),be.gfm.nptable=Je(be.gfm.nptable).replace("hr",be.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",be._tag).getRegex(),be.gfm.table=Je(be.gfm.table).replace("hr",be.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",be._tag).getRegex(),be.pedantic=Ke({},be.normal,{html:Je(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",be._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Ie,paragraph:Je(be.normal._paragraph).replace("hr",be.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",be.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var de={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ie,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:Ie,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};de._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",de.punctuation=Je(de.punctuation).replace(/punctuation/g,de._punctuation).getRegex(),de._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",de._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",de.em.start=Je(de.em.start).replace(/punctuation/g,de._punctuation).getRegex(),de.em.middle=Je(de.em.middle).replace(/punctuation/g,de._punctuation).replace(/overlapSkip/g,de._overlapSkip).getRegex(),de.em.endAst=Je(de.em.endAst,"g").replace(/punctuation/g,de._punctuation).getRegex(),de.em.endUnd=Je(de.em.endUnd,"g").replace(/punctuation/g,de._punctuation).getRegex(),de.strong.start=Je(de.strong.start).replace(/punctuation/g,de._punctuation).getRegex(),de.strong.middle=Je(de.strong.middle).replace(/punctuation/g,de._punctuation).replace(/blockSkip/g,de._blockSkip).getRegex(),de.strong.endAst=Je(de.strong.endAst,"g").replace(/punctuation/g,de._punctuation).getRegex(),de.strong.endUnd=Je(de.strong.endUnd,"g").replace(/punctuation/g,de._punctuation).getRegex(),de.blockSkip=Je(de._blockSkip,"g").getRegex(),de.overlapSkip=Je(de._overlapSkip,"g").getRegex(),de._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,de._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,de._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])?)+(?![-_])/,de.autolink=Je(de.autolink).replace("scheme",de._scheme).replace("email",de._email).getRegex(),de._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,de.tag=Je(de.tag).replace("comment",be._comment).replace("attribute",de._attribute).getRegex(),de._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,de._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,de._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,de.link=Je(de.link).replace("label",de._label).replace("href",de._href).replace("title",de._title).getRegex(),de.reflink=Je(de.reflink).replace("label",de._label).getRegex(),de.reflinkSearch=Je(de.reflinkSearch,"g").replace("reflink",de.reflink).replace("nolink",de.nolink).getRegex(),de.normal=Ke({},de),de.pedantic=Ke({},de.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:Je(/^!?\[(label)\]\((.*?)\)/).replace("label",de._label).getRegex(),reflink:Je(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",de._label).getRegex()}),de.gfm=Ke({},de.normal,{escape:Je(de.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),de.gfm.url=Je(de.gfm.url,"i").replace("email",de.gfm._extended_email).getRegex(),de.breaks=Ke({},de.gfm,{br:Je(de.br).replace("{2,}","*").getRegex(),text:Je(de.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var nt={block:be,inline:de},Kt=H.defaults,jt=nt.block,wt=nt.inline;function ze(Ae){return Ae.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 ft(Ae){var ge="",Ee,ae,re=Ae.length;for(Ee=0;Ee<re;Ee++)ae=Ae.charCodeAt(Ee),Math.random()>.5&&(ae="x"+ae.toString(16)),ge+="&#"+ae+";";return ge}var dt=function(){function Ae(Ee){this.tokens=[],this.tokens.links=Object.create(null),this.options=Ee||Kt,this.options.tokenizer=this.options.tokenizer||new xe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ae={block:jt.normal,inline:wt.normal};this.options.pedantic?(ae.block=jt.pedantic,ae.inline=wt.pedantic):this.options.gfm&&(ae.block=jt.gfm,this.options.breaks?ae.inline=wt.breaks:ae.inline=wt.gfm),this.tokenizer.rules=ae}Ae.lex=function(ae,re){var he=new Ae(re);return he.lex(ae)};var ge=Ae.prototype;return ge.lex=function(ae){return ae=ae.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(ae,this.tokens,!0),this.inline(this.tokens),this.tokens},ge.blockTokens=function(ae,re,he){re===void 0&&(re=[]),he===void 0&&(he=!0),ae=ae.replace(/^ +$/gm,"");for(var ve,me,Be,Tt;ae;){if(ve=this.tokenizer.space(ae)){ae=ae.substring(ve.raw.length),ve.type&&re.push(ve);continue}if(ve=this.tokenizer.code(ae,re)){ae=ae.substring(ve.raw.length),ve.type?re.push(ve):(Tt=re[re.length-1],Tt.raw+=`
|
|
`+ve.raw,Tt.text+=`
|
|
`+ve.text);continue}if(ve=this.tokenizer.fences(ae)){ae=ae.substring(ve.raw.length),re.push(ve);continue}if(ve=this.tokenizer.heading(ae)){ae=ae.substring(ve.raw.length),re.push(ve);continue}if(ve=this.tokenizer.nptable(ae)){ae=ae.substring(ve.raw.length),re.push(ve);continue}if(ve=this.tokenizer.hr(ae)){ae=ae.substring(ve.raw.length),re.push(ve);continue}if(ve=this.tokenizer.blockquote(ae)){ae=ae.substring(ve.raw.length),ve.tokens=this.blockTokens(ve.text,[],he),re.push(ve);continue}if(ve=this.tokenizer.list(ae)){for(ae=ae.substring(ve.raw.length),Be=ve.items.length,me=0;me<Be;me++)ve.items[me].tokens=this.blockTokens(ve.items[me].text,[],!1);re.push(ve);continue}if(ve=this.tokenizer.html(ae)){ae=ae.substring(ve.raw.length),re.push(ve);continue}if(he&&(ve=this.tokenizer.def(ae))){ae=ae.substring(ve.raw.length),this.tokens.links[ve.tag]||(this.tokens.links[ve.tag]={href:ve.href,title:ve.title});continue}if(ve=this.tokenizer.table(ae)){ae=ae.substring(ve.raw.length),re.push(ve);continue}if(ve=this.tokenizer.lheading(ae)){ae=ae.substring(ve.raw.length),re.push(ve);continue}if(he&&(ve=this.tokenizer.paragraph(ae))){ae=ae.substring(ve.raw.length),re.push(ve);continue}if(ve=this.tokenizer.text(ae,re)){ae=ae.substring(ve.raw.length),ve.type?re.push(ve):(Tt=re[re.length-1],Tt.raw+=`
|
|
`+ve.raw,Tt.text+=`
|
|
`+ve.text);continue}if(ae){var Jt="Infinite loop on byte: "+ae.charCodeAt(0);if(this.options.silent){console.error(Jt);break}else throw new Error(Jt)}}return re},ge.inline=function(ae){var re,he,ve,me,Be,Tt,Jt=ae.length;for(re=0;re<Jt;re++){Tt=ae[re];switch(Tt.type){case"paragraph":case"text":case"heading":{Tt.tokens=[],this.inlineTokens(Tt.text,Tt.tokens);break}case"table":{for(Tt.tokens={header:[],cells:[]},me=Tt.header.length,he=0;he<me;he++)Tt.tokens.header[he]=[],this.inlineTokens(Tt.header[he],Tt.tokens.header[he]);for(me=Tt.cells.length,he=0;he<me;he++)for(Be=Tt.cells[he],Tt.tokens.cells[he]=[],ve=0;ve<Be.length;ve++)Tt.tokens.cells[he][ve]=[],this.inlineTokens(Be[ve],Tt.tokens.cells[he][ve]);break}case"blockquote":{this.inline(Tt.tokens);break}case"list":{for(me=Tt.items.length,he=0;he<me;he++)this.inline(Tt.items[he].tokens);break}}}return ae},ge.inlineTokens=function(ae,re,he,ve,me){re===void 0&&(re=[]),he===void 0&&(he=!1),ve===void 0&&(ve=!1),me===void 0&&(me="");var Be,Tt=ae,Jt;if(this.tokens.links){var En=Object.keys(this.tokens.links);if(En.length>0)for(;(Jt=this.tokenizer.rules.inline.reflinkSearch.exec(Tt))!=null;)En.includes(Jt[0].slice(Jt[0].lastIndexOf("[")+1,-1))&&(Tt=Tt.slice(0,Jt.index)+"["+"a".repeat(Jt[0].length-2)+"]"+Tt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Jt=this.tokenizer.rules.inline.blockSkip.exec(Tt))!=null;)Tt=Tt.slice(0,Jt.index)+"["+"a".repeat(Jt[0].length-2)+"]"+Tt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ae;){if(Be=this.tokenizer.escape(ae)){ae=ae.substring(Be.raw.length),re.push(Be);continue}if(Be=this.tokenizer.tag(ae,he,ve)){ae=ae.substring(Be.raw.length),he=Be.inLink,ve=Be.inRawBlock,re.push(Be);continue}if(Be=this.tokenizer.link(ae)){ae=ae.substring(Be.raw.length),Be.type==="link"&&(Be.tokens=this.inlineTokens(Be.text,[],!0,ve)),re.push(Be);continue}if(Be=this.tokenizer.reflink(ae,this.tokens.links)){ae=ae.substring(Be.raw.length),Be.type==="link"&&(Be.tokens=this.inlineTokens(Be.text,[],!0,ve)),re.push(Be);continue}if(Be=this.tokenizer.strong(ae,Tt,me)){ae=ae.substring(Be.raw.length),Be.tokens=this.inlineTokens(Be.text,[],he,ve),re.push(Be);continue}if(Be=this.tokenizer.em(ae,Tt,me)){ae=ae.substring(Be.raw.length),Be.tokens=this.inlineTokens(Be.text,[],he,ve),re.push(Be);continue}if(Be=this.tokenizer.codespan(ae)){ae=ae.substring(Be.raw.length),re.push(Be);continue}if(Be=this.tokenizer.br(ae)){ae=ae.substring(Be.raw.length),re.push(Be);continue}if(Be=this.tokenizer.del(ae)){ae=ae.substring(Be.raw.length),Be.tokens=this.inlineTokens(Be.text,[],he,ve),re.push(Be);continue}if(Be=this.tokenizer.autolink(ae,ft)){ae=ae.substring(Be.raw.length),re.push(Be);continue}if(!he&&(Be=this.tokenizer.url(ae,ft))){ae=ae.substring(Be.raw.length),re.push(Be);continue}if(Be=this.tokenizer.inlineText(ae,ve,ze)){ae=ae.substring(Be.raw.length),me=Be.raw.slice(-1),re.push(Be);continue}if(ae){var mt="Infinite loop on byte: "+ae.charCodeAt(0);if(this.options.silent){console.error(mt);break}else throw new Error(mt)}}return re},Y(Ae,null,[{key:"rules",get:function(){return{block:jt,inline:wt}}}]),Ae}(),Nt=H.defaults,Ze=G.cleanUrl,Bt=G.escape,Ut=function(){function Ae(Ee){this.options=Ee||Nt}var ge=Ae.prototype;return ge.code=function(ae,re,he){var ve=(re||"").match(/\S*/)[0];if(this.options.highlight){var me=this.options.highlight(ae,ve);me!=null&&me!==ae&&(he=!0,ae=me)}return ve?'<pre><code class="'+this.options.langPrefix+Bt(ve,!0)+'">'+(he?ae:Bt(ae,!0))+`</code></pre>
|
|
`:"<pre><code>"+(he?ae:Bt(ae,!0))+`</code></pre>
|
|
`},ge.blockquote=function(ae){return`<blockquote>
|
|
`+ae+`</blockquote>
|
|
`},ge.html=function(ae){return ae},ge.heading=function(ae,re,he,ve){return this.options.headerIds?"<h"+re+' id="'+this.options.headerPrefix+ve.slug(he)+'">'+ae+"</h"+re+`>
|
|
`:"<h"+re+">"+ae+"</h"+re+`>
|
|
`},ge.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},ge.list=function(ae,re,he){var ve=re?"ol":"ul",me=re&&he!==1?' start="'+he+'"':"";return"<"+ve+me+`>
|
|
`+ae+"</"+ve+`>
|
|
`},ge.listitem=function(ae){return"<li>"+ae+`</li>
|
|
`},ge.checkbox=function(ae){return"<input "+(ae?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ge.paragraph=function(ae){return"<p>"+ae+`</p>
|
|
`},ge.table=function(ae,re){return re&&(re="<tbody>"+re+"</tbody>"),`<table>
|
|
<thead>
|
|
`+ae+`</thead>
|
|
`+re+`</table>
|
|
`},ge.tablerow=function(ae){return`<tr>
|
|
`+ae+`</tr>
|
|
`},ge.tablecell=function(ae,re){var he=re.header?"th":"td",ve=re.align?"<"+he+' align="'+re.align+'">':"<"+he+">";return ve+ae+"</"+he+`>
|
|
`},ge.strong=function(ae){return"<strong>"+ae+"</strong>"},ge.em=function(ae){return"<em>"+ae+"</em>"},ge.codespan=function(ae){return"<code>"+ae+"</code>"},ge.br=function(){return this.options.xhtml?"<br/>":"<br>"},ge.del=function(ae){return"<del>"+ae+"</del>"},ge.link=function(ae,re,he){if(ae=Ze(this.options.sanitize,this.options.baseUrl,ae),ae===null)return he;var ve='<a href="'+Bt(ae)+'"';return re&&(ve+=' title="'+re+'"'),ve+=">"+he+"</a>",ve},ge.image=function(ae,re,he){if(ae=Ze(this.options.sanitize,this.options.baseUrl,ae),ae===null)return he;var ve='<img src="'+ae+'" alt="'+he+'"';return re&&(ve+=' title="'+re+'"'),ve+=this.options.xhtml?"/>":">",ve},ge.text=function(ae){return ae},Ae}(),Mt=function(){function Ae(){}var ge=Ae.prototype;return ge.strong=function(ae){return ae},ge.em=function(ae){return ae},ge.codespan=function(ae){return ae},ge.del=function(ae){return ae},ge.html=function(ae){return ae},ge.text=function(ae){return ae},ge.link=function(ae,re,he){return""+he},ge.image=function(ae,re,he){return""+he},ge.br=function(){return""},Ae}(),An=function(){function Ae(){this.seen={}}var ge=Ae.prototype;return ge.slug=function(ae){var re=ae.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(re)){var he=re;do this.seen[he]++,re=he+"-"+this.seen[he];while(this.seen.hasOwnProperty(re))}return this.seen[re]=0,re},Ae}(),mn=H.defaults,pn=G.unescape,tt=function(){function Ae(Ee){this.options=Ee||mn,this.options.renderer=this.options.renderer||new Ut,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Mt,this.slugger=new An}Ae.parse=function(ae,re){var he=new Ae(re);return he.parse(ae)};var ge=Ae.prototype;return ge.parse=function(ae,re){re===void 0&&(re=!0);var he="",ve,me,Be,Tt,Jt,En,mt,Qt,gt,yt,rt,ce,Re,At,ot,Yt,rn,_e,Ne=ae.length;for(ve=0;ve<Ne;ve++){yt=ae[ve];switch(yt.type){case"space":continue;case"hr":{he+=this.renderer.hr();continue}case"heading":{he+=this.renderer.heading(this.parseInline(yt.tokens),yt.depth,pn(this.parseInline(yt.tokens,this.textRenderer)),this.slugger);continue}case"code":{he+=this.renderer.code(yt.text,yt.lang,yt.escaped);continue}case"table":{for(Qt="",mt="",Tt=yt.header.length,me=0;me<Tt;me++)mt+=this.renderer.tablecell(this.parseInline(yt.tokens.header[me]),{header:!0,align:yt.align[me]});for(Qt+=this.renderer.tablerow(mt),gt="",Tt=yt.cells.length,me=0;me<Tt;me++){for(En=yt.tokens.cells[me],mt="",Jt=En.length,Be=0;Be<Jt;Be++)mt+=this.renderer.tablecell(this.parseInline(En[Be]),{header:!1,align:yt.align[Be]});gt+=this.renderer.tablerow(mt)}he+=this.renderer.table(Qt,gt);continue}case"blockquote":{gt=this.parse(yt.tokens),he+=this.renderer.blockquote(gt);continue}case"list":{for(rt=yt.ordered,ce=yt.start,Re=yt.loose,Tt=yt.items.length,gt="",me=0;me<Tt;me++)ot=yt.items[me],Yt=ot.checked,rn=ot.task,At="",ot.task&&(_e=this.renderer.checkbox(Yt),Re?ot.tokens.length>0&&ot.tokens[0].type==="text"?(ot.tokens[0].text=_e+" "+ot.tokens[0].text,ot.tokens[0].tokens&&ot.tokens[0].tokens.length>0&&ot.tokens[0].tokens[0].type==="text"&&(ot.tokens[0].tokens[0].text=_e+" "+ot.tokens[0].tokens[0].text)):ot.tokens.unshift({type:"text",text:_e}):At+=_e),At+=this.parse(ot.tokens,Re),gt+=this.renderer.listitem(At,rn,Yt);he+=this.renderer.list(gt,rt,ce);continue}case"html":{he+=this.renderer.html(yt.text);continue}case"paragraph":{he+=this.renderer.paragraph(this.parseInline(yt.tokens));continue}case"text":{for(gt=yt.tokens?this.parseInline(yt.tokens):yt.text;ve+1<Ne&&ae[ve+1].type==="text";)yt=ae[++ve],gt+=`
|
|
`+(yt.tokens?this.parseInline(yt.tokens):yt.text);he+=re?this.renderer.paragraph(gt):gt;continue}default:{var xt='Token with "'+yt.type+'" type was not found.';if(this.options.silent){console.error(xt);return}else throw new Error(xt)}}}return he},ge.parseInline=function(ae,re){re=re||this.renderer;var he="",ve,me,Be=ae.length;for(ve=0;ve<Be;ve++){me=ae[ve];switch(me.type){case"escape":{he+=re.text(me.text);break}case"html":{he+=re.html(me.text);break}case"link":{he+=re.link(me.href,me.title,this.parseInline(me.tokens,re));break}case"image":{he+=re.image(me.href,me.title,me.text);break}case"strong":{he+=re.strong(this.parseInline(me.tokens,re));break}case"em":{he+=re.em(this.parseInline(me.tokens,re));break}case"codespan":{he+=re.codespan(me.text);break}case"br":{he+=re.br();break}case"del":{he+=re.del(this.parseInline(me.tokens,re));break}case"text":{he+=re.text(me.text);break}default:{var Tt='Token with "'+me.type+'" type was not found.';if(this.options.silent){console.error(Tt);return}else throw new Error(Tt)}}}return he},Ae}(),fn=G.merge,In=G.checkSanitizeDeprecation,He=G.escape,Ue=H.getDefaults,pt=H.changeDefaults,Ct=H.defaults;function Ge(Ae,ge,Ee){if(typeof Ae=="undefined"||Ae===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Ae!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Ae)+", string expected");if(typeof ge=="function"&&(Ee=ge,ge=null),ge=fn({},Ge.defaults,ge||{}),In(ge),Ee){var ae=ge.highlight,re;try{re=dt.lex(Ae,ge)}catch(Be){return Ee(Be)}var he=function(Tt){var Jt;if(!Tt)try{Jt=tt.parse(re,ge)}catch(En){Tt=En}return ge.highlight=ae,Tt?Ee(Tt):Ee(null,Jt)};if(!ae||ae.length<3)return he();if(delete ge.highlight,!re.length)return he();var ve=0;Ge.walkTokens(re,function(Be){Be.type==="code"&&(ve++,setTimeout(function(){ae(Be.text,Be.lang,function(Tt,Jt){if(Tt)return he(Tt);Jt!=null&&Jt!==Be.text&&(Be.text=Jt,Be.escaped=!0),ve--,ve===0&&he()})},0))}),ve===0&&he();return}try{var me=dt.lex(Ae,ge);return ge.walkTokens&&Ge.walkTokens(me,ge.walkTokens),tt.parse(me,ge)}catch(Be){if(Be.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,ge.silent)return"<p>An error occurred:</p><pre>"+He(Be.message+"",!0)+"</pre>";throw Be}}Ge.options=Ge.setOptions=function(Ae){return fn(Ge.defaults,Ae),pt(Ge.defaults),Ge},Ge.getDefaults=Ue,Ge.defaults=Ct,Ge.use=function(Ae){var ge=fn({},Ae);if(Ae.renderer&&function(){var ae=Ge.defaults.renderer||new Ut,re=function(me){var Be=ae[me];ae[me]=function(){for(var Tt=arguments.length,Jt=new Array(Tt),En=0;En<Tt;En++)Jt[En]=arguments[En];var mt=Ae.renderer[me].apply(ae,Jt);return mt===!1&&(mt=Be.apply(ae,Jt)),mt}};for(var he in Ae.renderer)re(he);ge.renderer=ae}(),Ae.tokenizer&&function(){var ae=Ge.defaults.tokenizer||new xe,re=function(me){var Be=ae[me];ae[me]=function(){for(var Tt=arguments.length,Jt=new Array(Tt),En=0;En<Tt;En++)Jt[En]=arguments[En];var mt=Ae.tokenizer[me].apply(ae,Jt);return mt===!1&&(mt=Be.apply(ae,Jt)),mt}};for(var he in Ae.tokenizer)re(he);ge.tokenizer=ae}(),Ae.walkTokens){var Ee=Ge.defaults.walkTokens;ge.walkTokens=function(ae){Ae.walkTokens(ae),Ee&&Ee(ae)}}Ge.setOptions(ge)},Ge.walkTokens=function(Ae,ge){for(var Ee=A(Ae),ae;!(ae=Ee()).done;){var re=ae.value;ge(re);switch(re.type){case"table":{for(var he=A(re.tokens.header),ve;!(ve=he()).done;){var me=ve.value;Ge.walkTokens(me,ge)}for(var Be=A(re.tokens.cells),Tt;!(Tt=Be()).done;)for(var Jt=Tt.value,En=A(Jt),mt;!(mt=En()).done;){var Qt=mt.value;Ge.walkTokens(Qt,ge)}break}case"list":{Ge.walkTokens(re.items,ge);break}default:re.tokens&&Ge.walkTokens(re.tokens,ge)}}},Ge.Parser=tt,Ge.parser=tt.parse,Ge.Renderer=Ut,Ge.TextRenderer=Mt,Ge.Lexer=dt,Ge.lexer=dt.lex,Ge.Tokenizer=xe,Ge.Slugger=An,Ge.parse=Ge;var vt=Ge;return vt})},ELLl:function(tn,Qe,I){(function(te){te(I("VrN/"))})(function(te){var Y={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},N=te.Pos;te.defineOption("autoCloseBrackets",!1,function(s,r,u){u&&u!=te.Init&&(s.removeKeyMap(A),s.state.closeBrackets=null),r&&(M(K(r,"pairs")),s.state.closeBrackets=r,s.addKeyMap(A))});function K(s,r){return r=="pairs"&&typeof s=="string"?s:typeof s=="object"&&s[r]!=null?s[r]:Y[r]}var A={Backspace:k,Enter:D};function M(s){for(var r=0;r<s.length;r++){var u=s.charAt(r),o="'"+u+"'";A[o]||(A[o]=H(u))}}M(Y.pairs+"`");function H(s){return function(r){return m(r,s)}}function P(s){var r=s.state.closeBrackets;if(!r||r.override)return r;var u=s.getModeAt(s.getCursor());return u.closeBrackets||r}function k(s){var r=P(s);if(!r||s.getOption("disableInput"))return te.Pass;for(var u=K(r,"pairs"),o=s.listSelections(),a=0;a<o.length;a++){if(!o[a].empty())return te.Pass;var n=f(s,o[a].head);if(!n||u.indexOf(n)%2!=0)return te.Pass}for(var a=o.length-1;a>=0;a--){var R=o[a].head;s.replaceRange("",N(R.line,R.ch-1),N(R.line,R.ch+1),"+delete")}}function D(s){var r=P(s),u=r&&K(r,"explode");if(!u||s.getOption("disableInput"))return te.Pass;for(var o=s.listSelections(),a=0;a<o.length;a++){if(!o[a].empty())return te.Pass;var n=f(s,o[a].head);if(!n||u.indexOf(n)%2!=0)return te.Pass}s.operation(function(){var R=s.lineSeparator()||`
|
|
`;s.replaceSelection(R+R,null),s.execCommand("goCharLeft"),o=s.listSelections();for(var w=0;w<o.length;w++){var x=o[w].head.line;s.indentLine(x,null,!0),s.indentLine(x+1,null,!0)}})}function b(s){var r=te.cmpPos(s.anchor,s.head)>0;return{anchor:new N(s.anchor.line,s.anchor.ch+(r?-1:1)),head:new N(s.head.line,s.head.ch+(r?1:-1))}}function m(s,r){var u=P(s);if(!u||s.getOption("disableInput"))return te.Pass;var o=K(u,"pairs"),a=o.indexOf(r);if(a==-1)return te.Pass;for(var n=K(u,"closeBefore"),R=K(u,"triples"),w=o.charAt(a+1)==r,x=s.listSelections(),O=a%2==0,C,_=0;_<x.length;_++){var y=x[_],h=y.head,c,v=s.getRange(h,N(h.line,h.ch+1));if(O&&!y.empty())c="surround";else if((w||!O)&&v==r)w&&d(s,h)?c="both":R.indexOf(r)>=0&&s.getRange(h,N(h.line,h.ch+3))==r+r+r?c="skipThree":c="skip";else if(w&&h.ch>1&&R.indexOf(r)>=0&&s.getRange(N(h.line,h.ch-2),h)==r+r){if(h.ch>2&&/\bstring/.test(s.getTokenTypeAt(N(h.line,h.ch-2))))return te.Pass;c="addFour"}else if(w){var p=h.ch==0?" ":s.getRange(N(h.line,h.ch-1),h);if(!te.isWordChar(v)&&p!=r&&!te.isWordChar(p))c="both";else return te.Pass}else if(O&&(v.length===0||/\s/.test(v)||n.indexOf(v)>-1))c="both";else return te.Pass;if(!C)C=c;else if(C!=c)return te.Pass}var E=a%2?o.charAt(a-1):r,U=a%2?r:o.charAt(a+1);s.operation(function(){if(C=="skip")s.execCommand("goCharRight");else if(C=="skipThree")for(var F=0;F<3;F++)s.execCommand("goCharRight");else if(C=="surround"){for(var z=s.getSelections(),F=0;F<z.length;F++)z[F]=E+z[F]+U;s.replaceSelections(z,"around"),z=s.listSelections().slice();for(var F=0;F<z.length;F++)z[F]=b(z[F]);s.setSelections(z)}else C=="both"?(s.replaceSelection(E+U,null),s.triggerElectric(E+U),s.execCommand("goCharLeft")):C=="addFour"&&(s.replaceSelection(E+E+E+E,"before"),s.execCommand("goCharRight"))})}function f(s,r){var u=s.getRange(N(r.line,r.ch-1),N(r.line,r.ch+1));return u.length==2?u:null}function d(s,r){var u=s.getTokenAt(N(r.line,r.ch+1));return/\bstring/.test(u.type)&&u.start==r.ch&&(r.ch==0||!/\bstring/.test(s.getTokenTypeAt(r)))}})},F0VM:function(tn,Qe,I){tn.exports={flex_box_center:"flex_box_center___2fDN3",flex_space_between:"flex_space_between___BHBBv",flex_box_vertical_center:"flex_box_vertical_center___tpxsE",flex_box_center_end:"flex_box_center_end___rP7bQ",flex_box_column:"flex_box_column___1_rF-",md:"md___3SObb",title:"title___HfZ1b"}},FOrL:function(tn,Qe,I){tn.exports=I.p+"static/nodata.a6b3f948.png"},Gytx:function(tn,Qe){tn.exports=function(te,Y,N,K){var A=N?N.call(K,te,Y):void 0;if(A!==void 0)return!!A;if(te===Y)return!0;if(typeof te!="object"||!te||typeof Y!="object"||!Y)return!1;var M=Object.keys(te),H=Object.keys(Y);if(M.length!==H.length)return!1;for(var P=Object.prototype.hasOwnProperty.bind(Y),k=0;k<M.length;k++){var D=M[k];if(!P(D))return!1;var b=te[D],m=Y[D];if(A=N?N.call(K,b,m,D):void 0,A===!1||A===void 0&&b!==m)return!1}return!0}},HmJG:function(tn,Qe,I){},I8Z2:function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return K}),I.d(Qe,"b",function(){return f}),I.d(Qe,"c",function(){return s});var te=I("q1tI"),Y=function(){var r=function(u,o){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,n){a.__proto__=n}||function(a,n){for(var R in n)n.hasOwnProperty(R)&&(a[R]=n[R])},r(u,o)};return function(u,o){r(u,o);function a(){this.constructor=u}u.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}}(),N=te.createContext(null),K=function(r){Y(u,r);function u(){return r!==null&&r.apply(this,arguments)||this}return u.prototype.render=function(){return te.createElement(N.Provider,{value:this.props.store},this.props.children)},u}(te.Component),A=I("Gytx"),M=I.n(A),H=I("2mql"),P=I.n(H),k=function(){var r=function(u,o){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,n){a.__proto__=n}||function(a,n){for(var R in n)n.hasOwnProperty(R)&&(a[R]=n[R])},r(u,o)};return function(u,o){r(u,o);function a(){this.constructor=u}u.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}}(),D=function(){return D=Object.assign||function(r){for(var u,o=1,a=arguments.length;o<a;o++){u=arguments[o];for(var n in u)Object.prototype.hasOwnProperty.call(u,n)&&(r[n]=u[n])}return r},D.apply(this,arguments)};function b(r){return r.displayName||r.name||"Component"}var m=function(){return{}};function f(r,u){u===void 0&&(u={});var o=!!r,a=r||m;return function(R){var w=function(O){k(C,O);function C(_,y){var h=O.call(this,_,y)||this;return h.unsubscribe=null,h.handleChange=function(){if(!h.unsubscribe)return;var c=a(h.store.getState(),h.props);h.setState({subscribed:c})},h.store=h.context,h.state={subscribed:a(h.store.getState(),_),store:h.store,props:_},h}return C.getDerivedStateFromProps=function(_,y){return r&&r.length===2&&_!==y.props?{subscribed:a(y.store.getState(),_),props:_}:{props:_}},C.prototype.componentDidMount=function(){this.trySubscribe()},C.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},C.prototype.shouldComponentUpdate=function(_,y){return!M()(this.props,_)||!M()(this.state.subscribed,y.subscribed)},C.prototype.trySubscribe=function(){o&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},C.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},C.prototype.render=function(){var _=D(D(D({},this.props),this.state.subscribed),{store:this.store});return te.createElement(R,D({},_,{ref:this.props.miniStoreForwardedRef}))},C.displayName="Connect("+b(R)+")",C.contextType=N,C}(te.Component);if(u.forwardRef){var x=te.forwardRef(function(O,C){return te.createElement(w,D({},O,{miniStoreForwardedRef:C}))});return P()(x,R)}return P()(w,R)}}var d=function(){return d=Object.assign||function(r){for(var u,o=1,a=arguments.length;o<a;o++){u=arguments[o];for(var n in u)Object.prototype.hasOwnProperty.call(u,n)&&(r[n]=u[n])}return r},d.apply(this,arguments)};function s(r){var u=r,o=[];function a(w){u=d(d({},u),w);for(var x=0;x<o.length;x++)o[x]()}function n(){return u}function R(w){return o.push(w),function(){var O=o.indexOf(w);o.splice(O,1)}}return{setState:a,getState:n,subscribe:R}}},IBYe:function(tn,Qe,I){"use strict";function te(Y){return null}Qe.a=te},J66h:function(tn,Qe,I){(function(te){var Y,N;(function(K,A){tn.exports=A(K)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof te!="undefined"?te:this,function(K){"use strict";K=K||{};var A=K.Base64,M="2.6.4",H="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",P=function(E){for(var U={},F=0,z=E.length;F<z;F++)U[E.charAt(F)]=F;return U}(H),k=String.fromCharCode,D=function(E){if(E.length<2){var U=E.charCodeAt(0);return U<128?E:U<2048?k(192|U>>>6)+k(128|U&63):k(224|U>>>12&15)+k(128|U>>>6&63)+k(128|U&63)}else{var U=65536+(E.charCodeAt(0)-55296)*1024+(E.charCodeAt(1)-56320);return k(240|U>>>18&7)+k(128|U>>>12&63)+k(128|U>>>6&63)+k(128|U&63)}},b=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,m=function(E){return E.replace(b,D)},f=function(E){var U=[0,2,1][E.length%3],F=E.charCodeAt(0)<<16|(E.length>1?E.charCodeAt(1):0)<<8|(E.length>2?E.charCodeAt(2):0),z=[H.charAt(F>>>18),H.charAt(F>>>12&63),U>=2?"=":H.charAt(F>>>6&63),U>=1?"=":H.charAt(F&63)];return z.join("")},d=K.btoa&&typeof K.btoa=="function"?function(E){return K.btoa(E)}:function(E){if(E.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return E.replace(/[\s\S]{1,3}/g,f)},s=function(E){return d(m(String(E)))},r=function(E){return E.replace(/[+\/]/g,function(U){return U=="+"?"-":"_"}).replace(/=/g,"")},u=function(E,U){return U?r(s(E)):s(E)},o=function(E){return u(E,!0)},a;K.Uint8Array&&(a=function(E,U){for(var F="",z=0,G=E.length;z<G;z+=3){var B=E[z],T=E[z+1],V=E[z+2],Z=B<<16|T<<8|V;F+=H.charAt(Z>>>18)+H.charAt(Z>>>12&63)+(typeof T!="undefined"?H.charAt(Z>>>6&63):"=")+(typeof V!="undefined"?H.charAt(Z&63):"=")}return U?r(F):F});var n=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,R=function(E){switch(E.length){case 4:var U=(7&E.charCodeAt(0))<<18|(63&E.charCodeAt(1))<<12|(63&E.charCodeAt(2))<<6|63&E.charCodeAt(3),F=U-65536;return k((F>>>10)+55296)+k((F&1023)+56320);case 3:return k((15&E.charCodeAt(0))<<12|(63&E.charCodeAt(1))<<6|63&E.charCodeAt(2));default:return k((31&E.charCodeAt(0))<<6|63&E.charCodeAt(1))}},w=function(E){return E.replace(n,R)},x=function(E){var U=E.length,F=U%4,z=(U>0?P[E.charAt(0)]<<18:0)|(U>1?P[E.charAt(1)]<<12:0)|(U>2?P[E.charAt(2)]<<6:0)|(U>3?P[E.charAt(3)]:0),G=[k(z>>>16),k(z>>>8&255),k(z&255)];return G.length-=[0,0,2,1][F],G.join("")},O=K.atob&&typeof K.atob=="function"?function(E){return K.atob(E)}:function(E){return E.replace(/\S{1,4}/g,x)},C=function(E){return O(String(E).replace(/[^A-Za-z0-9\+\/]/g,""))},_=function(E){return w(O(E))},y=function(E){return String(E).replace(/[-_]/g,function(U){return U=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},h=function(E){return _(y(E))},c;K.Uint8Array&&(c=function(E){return Uint8Array.from(C(y(E)),function(U){return U.charCodeAt(0)})});var v=function(){var E=K.Base64;return K.Base64=A,E};if(K.Base64={VERSION:M,atob:C,btoa:d,fromBase64:h,toBase64:u,utob:m,encode:u,encodeURI:o,btou:w,decode:h,noConflict:v,fromUint8Array:a,toUint8Array:c},typeof Object.defineProperty=="function"){var p=function(E){return{value:E,enumerable:!1,writable:!0,configurable:!0}};K.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",p(function(){return h(this)})),Object.defineProperty(String.prototype,"toBase64",p(function(E){return u(this,E)})),Object.defineProperty(String.prototype,"toBase64URI",p(function(){return u(this,!0)}))}}return K.Meteor&&(Base64=K.Base64),tn.exports?tn.exports.Base64=K.Base64:!(Y=[],N=function(){return K.Base64}.apply(Qe,Y),N!==void 0&&(tn.exports=N)),{Base64:K.Base64}})}).call(this,I("IyRk"))},LSTS:function(tn,Qe,I){"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});var te=function(){function m(f,d){for(var s=0;s<d.length;s++){var r=d[s];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(f,r.key,r)}}return function(f,d,s){return d&&m(f.prototype,d),s&&m(f,s),f}}(),Y=I("q1tI"),N=M(Y),K=I("17x9"),A=M(K);function M(m){return m&&m.__esModule?m:{default:m}}function H(m,f){var d={};for(var s in m){if(f.indexOf(s)>=0)continue;if(!Object.prototype.hasOwnProperty.call(m,s))continue;d[s]=m[s]}return d}function P(m,f){if(!(m instanceof f))throw new TypeError("Cannot call a class as a function")}function k(m,f){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:m}function D(m,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);m.prototype=Object.create(f&&f.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(m,f):m.__proto__=f)}var b=function(m){D(f,m);function f(d){P(this,f);var s=k(this,(f.__proto__||Object.getPrototypeOf(f)).call(this,d));return s.scrollListener=s.scrollListener.bind(s),s.eventListenerOptions=s.eventListenerOptions.bind(s),s.mousewheelListener=s.mousewheelListener.bind(s),s}return te(f,[{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 s=this.getParentElement(this.scrollComponent);s.scrollTop=s.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var s=!1,r={get passive(){s=!0}};try{document.addEventListener("test",null,r),document.removeEventListener("test",null,r)}catch(u){}return s}},{key:"eventListenerOptions",value:function(){var s=this.props.useCapture;return this.isPassiveSupported()&&(s={useCapture:this.props.useCapture,passive:!0}),s}},{key:"setDefaultLoader",value:function(s){this.defaultLoader=s}},{key:"detachMousewheelListener",value:function(){var s=window;this.props.useWindow===!1&&(s=this.scrollComponent.parentNode),s.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var s=window;this.props.useWindow===!1&&(s=this.getParentElement(this.scrollComponent)),s.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),s.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(s){var r=this.props.getScrollParent&&this.props.getScrollParent();return r!=null?r:s&&s.parentNode}},{key:"filterProps",value:function(s){return s}},{key:"attachScrollListener",value:function(){var s=this.getParentElement(this.scrollComponent);if(!this.props.hasMore||!s)return;var r=window;this.props.useWindow===!1&&(r=s),r.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),r.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),r.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}},{key:"mousewheelListener",value:function(s){s.deltaY===1&&!this.isPassiveSupported()&&s.preventDefault()}},{key:"scrollListener",value:function(){var s=this.scrollComponent,r=window,u=this.getParentElement(s),o=void 0;if(this.props.useWindow){var a=document.documentElement||document.body.parentNode||document.body,n=r.pageYOffset!==void 0?r.pageYOffset:a.scrollTop;this.props.isReverse?o=n:o=this.calculateOffset(s,n)}else this.props.isReverse?o=u.scrollTop:o=s.scrollHeight-u.scrollTop-u.clientHeight;o<Number(this.props.threshold)&&s&&s.offsetParent!==null&&(this.detachScrollListener(),this.beforeScrollHeight=u.scrollHeight,this.beforeScrollTop=u.scrollTop,typeof this.props.loadMore=="function"&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}},{key:"calculateOffset",value:function(s,r){return s?this.calculateTopPosition(s)+(s.offsetHeight-r-window.innerHeight):0}},{key:"calculateTopPosition",value:function(s){return s?s.offsetTop+this.calculateTopPosition(s.offsetParent):0}},{key:"render",value:function(){var s=this,r=this.filterProps(this.props),u=r.children,o=r.element,a=r.hasMore,n=r.initialLoad,R=r.isReverse,w=r.loader,x=r.loadMore,O=r.pageStart,C=r.ref,_=r.threshold,y=r.useCapture,h=r.useWindow,c=r.getScrollParent,v=H(r,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]);v.ref=function(E){s.scrollComponent=E,C&&C(E)};var p=[u];return a&&(w?R?p.unshift(w):p.push(w):this.defaultLoader&&(R?p.unshift(this.defaultLoader):p.push(this.defaultLoader))),N.default.createElement(o,v,p)}}]),f}(Y.Component);b.propTypes={children:A.default.node.isRequired,element:A.default.node,hasMore:A.default.bool,initialLoad:A.default.bool,isReverse:A.default.bool,loader:A.default.node,loadMore:A.default.func.isRequired,pageStart:A.default.number,ref:A.default.func,getScrollParent:A.default.func,threshold:A.default.number,useCapture:A.default.bool,useWindow:A.default.bool},b.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},Qe.default=b,tn.exports=Qe.default},LdHM:function(tn,Qe,I){"use strict";I.d(Qe,"b",function(){return n}),I.d(Qe,"a",function(){return w});var te=I("1OyB"),Y=I("vuIU"),N=I("Ji7U"),K=I("LK+K"),A=I("q1tI"),M=I("rePB"),H=I("Ff2n"),P=I("ODXe"),k=I("4IlW"),D=I("bX4T"),b=I("YrtM"),m=I("TSYQ"),f=I.n(m),d=I("+nKL"),s=I("8OUc"),r=function(V,Z){var oe=V.prefixCls,pe=V.id,Ye=V.flattenOptions,xe=V.childrenAsData,Ie=V.values,Je=V.searchValue,Ke=V.multiple,be=V.defaultActiveFirstOption,de=V.height,nt=V.itemHeight,Kt=V.notFoundContent,jt=V.open,wt=V.menuItemSelectedIcon,ze=V.virtual,ft=V.onSelect,dt=V.onToggleOpen,Nt=V.onActiveValue,Ze=V.onScroll,Bt=V.onMouseEnter,Ut="".concat(oe,"-item"),Mt=Object(b.a)(function(){return Ye},[jt,Ye],function(vt,Ae){return Ae[0]&&vt[1]!==Ae[1]}),An=A.useRef(null),mn=function(Ae){Ae.preventDefault()},pn=function(Ae){An.current&&An.current.scrollTo({index:Ae})},tt=function(Ae){for(var ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ee=Mt.length,ae=0;ae<Ee;ae+=1){var re=(Ae+ae*ge+Ee)%Ee,he=Mt[re],ve=he.group,me=he.data;if(!ve&&!me.disabled)return re}return-1},fn=A.useState(function(){return tt(0)}),In=Object(P.a)(fn,2),He=In[0],Ue=In[1],pt=function(Ae){Ue(Ae);var ge=Mt[Ae];if(!ge){Nt(null,-1);return}Nt(ge.data.value,Ae)};A.useEffect(function(){pt(be!==!1?tt(0):-1)},[Mt.length,Je]),A.useEffect(function(){var vt=setTimeout(function(){if(!Ke&&jt&&Ie.size===1){var Ae=Array.from(Ie)[0],ge=Mt.findIndex(function(Ee){var ae=Ee.data;return ae.value===Ae});pt(ge),pn(ge)}});return function(){return clearTimeout(vt)}},[jt]);var Ct=function(Ae){Ae!==void 0&&ft(Ae,{selected:!Ie.has(Ae)}),Ke||dt(!1)};if(A.useImperativeHandle(Z,function(){return{onKeyDown:function(Ae){var ge=Ae.which;switch(ge){case k.a.UP:case k.a.DOWN:{var Ee=0;if(ge===k.a.UP?Ee=-1:ge===k.a.DOWN&&(Ee=1),Ee!==0){var ae=tt(He+Ee,Ee);pn(ae),pt(ae)}break}case k.a.ENTER:{var re=Mt[He];re&&!re.data.disabled?Ct(re.data.value):Ct(void 0),jt&&Ae.preventDefault();break}case k.a.ESC:dt(!1)}},onKeyUp:function(){},scrollTo:function(Ae){pn(Ae)}}}),Mt.length===0)return A.createElement("div",{role:"listbox",id:"".concat(pe,"_list"),className:"".concat(Ut,"-empty"),onMouseDown:mn},Kt);function Ge(vt){var Ae=Mt[vt];if(!Ae)return null;var ge=Ae.data||{},Ee=ge.value,ae=ge.label,re=ge.children,he=Object(D.a)(ge,!0),ve=xe?re:ae;return Ae?A.createElement("div",Object.assign({"aria-label":typeof ve=="string"?ve:null},he,{key:vt,role:"option",id:"".concat(pe,"_list_").concat(vt),"aria-selected":Ie.has(Ee)}),Ee):null}return A.createElement(A.Fragment,null,A.createElement("div",{role:"listbox",id:"".concat(pe,"_list"),style:{height:0,width:0,overflow:"hidden"}},Ge(He-1),Ge(He),Ge(He+1)),A.createElement(d.a,{itemKey:"key",ref:An,data:Mt,height:de,itemHeight:nt,fullHeight:!1,onMouseDown:mn,onScroll:Ze,virtual:ze,onMouseEnter:Bt},function(vt,Ae){var ge,Ee=vt.group,ae=vt.groupOption,re=vt.data,he=re.label,ve=re.key;if(Ee)return A.createElement("div",{className:f()(Ut,"".concat(Ut,"-group"))},he!==void 0?he:ve);var me=re.disabled,Be=re.value,Tt=re.title,Jt=re.children,En=re.style,mt=re.className,Qt=Object(H.a)(re,["disabled","value","title","children","style","className"]),gt=Ie.has(Be),yt="".concat(Ut,"-option"),rt=f()(Ut,yt,mt,(ge={},Object(M.a)(ge,"".concat(yt,"-grouped"),ae),Object(M.a)(ge,"".concat(yt,"-active"),He===Ae&&!me),Object(M.a)(ge,"".concat(yt,"-disabled"),me),Object(M.a)(ge,"".concat(yt,"-selected"),gt),ge)),ce=xe?Jt:he,Re=!wt||typeof wt=="function"||gt;return A.createElement("div",Object.assign({},Qt,{"aria-selected":gt,className:rt,title:Tt,onMouseMove:function(){if(He===Ae||me)return;pt(Ae)},onClick:function(){me||Ct(Be)},style:En}),A.createElement("div",{className:"".concat(yt,"-content")},ce||Be),A.isValidElement(wt)||gt,Re&&A.createElement(s.a,{className:"".concat(Ut,"-option-state"),customizeIcon:wt,customizeIconProps:{isSelected:gt}},gt?"\u2713":null))}))},u=A.forwardRef(r);u.displayName="OptionList";var o=u,a=function(){return null};a.isSelectOption=!0;var n=a,R=function(){return null};R.isSelectOptGroup=!0;var w=R,x=I("VTBJ"),O=I("Zm9Q");function C(T){var V=T.key,Z=T.props,oe=Z.children,pe=Z.value,Ye=Object(H.a)(Z,["children","value"]);return Object(x.a)({key:V,value:pe!==void 0?pe:V,children:oe},Ye)}function _(T){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(O.a)(T).map(function(Z,oe){if(!A.isValidElement(Z)||!Z.type)return null;var pe=Z.type.isSelectOptGroup,Ye=Z.key,xe=Z.props,Ie=xe.children,Je=Object(H.a)(xe,["children"]);return V||!pe?C(Z):Object(x.a)(Object(x.a)({key:"__RC_SELECT_GRP__".concat(Ye===null?oe:Ye,"__"),label:Ye},Je),{},{options:_(Ie)})}).filter(function(Z){return Z})}var y=I("2Qr1"),h=I("qNPg"),c=I("U8pU"),v=I("Kwbf"),p=I("WKfj");function E(T){var V=T.mode,Z=T.options,oe=T.children,pe=T.backfill,Ye=T.allowClear,xe=T.placeholder,Ie=T.getInputElement,Je=T.showSearch,Ke=T.onSearch,be=T.defaultOpen,de=T.autoFocus,nt=T.labelInValue,Kt=T.value,jt=T.inputValue,wt=T.optionLabelProp,ze=V==="multiple"||V==="tags",ft=Je!==void 0?Je:ze||V==="combobox",dt=Z||_(oe);if(Object(v.a)(V!=="tags"||dt.every(function(Ut){return!Ut.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),V==="tags"||V==="combobox"){var Nt=dt.some(function(Ut){return Ut.options?Ut.options.some(function(Mt){return typeof("value"in Mt?Mt.value:Mt.key)=="number"}):typeof("value"in Ut?Ut.value:Ut.key)=="number"});Object(v.a)(!Nt,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(v.a)(V!=="combobox"||!wt,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(v.a)(V==="combobox"||!pe,"`backfill` only works with `combobox` mode."),Object(v.a)(V==="combobox"||!Ie,"`getInputElement` only work with `combobox` mode."),Object(v.b)(V!=="combobox"||!Ie||!Ye||!xe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ke&&!ft&&V!=="combobox"&&V!=="tags"&&Object(v.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(v.b)(!be||de,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Kt!=null){var Ze=Object(p.d)(Kt);Object(v.a)(!nt||Ze.every(function(Ut){return Object(c.a)(Ut)==="object"&&("key"in Ut||"value"in Ut)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(v.a)(!ze||Array.isArray(Kt),"`value` should be array when `mode` is `multiple` or `tags`")}if(oe){var Bt=null;Object(O.a)(oe).some(function(Ut){if(!A.isValidElement(Ut)||!Ut.type)return!1;var Mt=Ut.type;if(Mt.isSelectOption)return!1;if(Mt.isSelectOptGroup){var An=Object(O.a)(Ut.props.children).every(function(mn){return!A.isValidElement(mn)||!Ut.type||mn.type.isSelectOption?!0:(Bt=mn.type,!1)});return!An}return Bt=Mt,!0}),Bt&&Object(v.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Bt.displayName||Bt.name||Bt,"`.")),Object(v.a)(jt===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var U=E,F=Object(h.a)({prefixCls:"rc-select",components:{optionList:o},convertChildrenToData:_,flattenOptions:y.d,getLabeledValue:y.e,filterOptions:y.b,isValueDisabled:y.g,findValueOption:y.c,warningProps:U,fillOptionsWithMissingValue:y.a}),z=function(T){Object(N.a)(Z,T);var V=Object(K.a)(Z);function Z(){var oe;return Object(te.a)(this,Z),oe=V.apply(this,arguments),oe.selectRef=A.createRef(),oe.focus=function(){oe.selectRef.current.focus()},oe.blur=function(){oe.selectRef.current.blur()},oe}return Object(Y.a)(Z,[{key:"render",value:function(){return A.createElement(F,Object.assign({ref:this.selectRef},this.props))}}]),Z}(A.Component);z.Option=n,z.OptGroup=w;var G=z,B=Qe.c=G},M8RZ:function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return k});var te=I("fWQN"),Y=I("mtLc"),N=I("yKVA"),K=I("879j"),A=I("q1tI"),M=I.n(A),H=I("i8i4"),P=I.n(H),k=function(D){Object(N.a)(m,D);var b=Object(K.a)(m);function m(f){var d;Object(te.a)(this,m),d=b.call(this,f);var s=window.document;return d.node=s.createElement("div"),s.body.appendChild(d.node),d}return Object(Y.a)(m,[{key:"render",value:function(){var d=this.props.children;return Object(H.createPortal)(d,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),m}(M.a.Component)},NLgs:function(tn,Qe,I){"use strict";I.d(Qe,"e",function(){return n}),I.d(Qe,"f",function(){return R}),I.d(Qe,"d",function(){return x}),I.d(Qe,"c",function(){return O}),I.d(Qe,"a",function(){return C}),I.d(Qe,"b",function(){return _});var te=I("miYZ"),Y=I("tsqr"),N=I("9og8"),K=I("2qtc"),A=I("kLXV"),M=I("WmNS"),H=I.n(M),P=I("q1tI"),k=I.n(P),D=I("9kvl"),b=I("xKgJ"),m=I("1vsH"),f=I("RCxd"),d=I("yTi+"),s=I.n(d),r=I("1ZF9"),u=I.n(r),o=I("NoGO"),a=I.n(o),n=function(h){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(R(h)&&w(c))},R=function(h){return Object(b.p)()?!0:(h({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},w=function(){var h,c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,v=Object(D.c)()._store.getState(),p=v.user;return(h=p.userInfo)!==null&&h!==void 0&&h.profile_completed?!0:(A.a.confirm({title:"\u63D0\u793A",width:530,centered:!0,content:c?"\u6309\u7167\u6709\u5173\u653F\u7B56\u89C4\u5B9A\uFF0C\u7279\u6B8A\u5B9E\u9A8C\u9700\u8981\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u624D\u80FD\u4F7F\u7528\uFF0C\u8BF7\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u7801":"\u60A8\u9700\u8981\u53BB\u5B8C\u5584\u60A8\u7684\u4E2A\u4EBA\u8D44\u6599\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD",okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){D.d.push("/account/profile/edit")}}),!1)},x=function(){var h,c=Object(D.c)()._store.getState(),v=c.user;return(h=v.userInfo)!==null&&h!==void 0&&h.professional_certification?!0:(A.a.confirm({title:"\u63D0\u793A",centered:!0,content:k.a.createElement("div",{className:"tc"},"\u60A8\u9700\u8981\u53BB\u5B8C\u6210\u60A8\u7684\u804C\u4E1A\u8BA4\u8BC1\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD"),okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){Object(m.S)("/account/certification")}}),!1)},O=function(){return Object(b.a)()?!0:(A.a.warning({centered:!0,width:530,title:"\u63D0\u793A",content:k.a.createElement("div",{className:"tc",style:{marginLeft:-38}},k.a.createElement("p",null,"\u626B\u7801\u52A0\u5934\u6B4C\u52A9\u6559\uFF0C\u7533\u8BF7\u64CD\u4F5C\u6743\u9650"),k.a.createElement("img",{src:a.a,width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1)},C=function(h,c){return h?!0:(A.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:k.a.createElement("div",null,k.a.createElement("p",null,c||"\u8BE5\u5B9E\u8DF5\u8D44\u6E90\u9700\u6388\u6743\u540E\u624D\u53EF\u4F7F\u7528\u3002 \u60A8\u53EF\u4EE5\u5728QQ\u670D\u52A1\u7FA4\u5411\u7BA1\u7406\u5458\u7533\u8BF7\uFF0C\u83B7\u5F97\u7EE7\u7EED\u64CD\u4F5C\u7684\u6743\u9650\u3002"),k.a.createElement("div",{style:{marginLeft:"110px"}},k.a.createElement("img",{src:u.a,width:200}),k.a.createElement("div",{style:{marginLeft:"35px"}},"\u7FA4\u53F7\uFF1A","714336072"))),okText:"\u7ACB\u5373\u8054\u7CFB",cancelText:"\u53D6\u6D88",onOk:function(){Object(m.S)("https://qm.qq.com/cgi-bin/qm/qr?k=tIyDPXUtE0yEk-MOJxhH55lTUJS-nYAM&jump_from=webapi")}}),!1)},_=function(h){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",v=Object(D.c)()._store.getState(),p=v.shixunsDetail.detail;return(p==null?void 0:p.public)===2||(p==null?void 0:p.public)===1||(p==null?void 0:p.shixun_status)===3?(A.a.info({centered:!0,icon:k.a.createElement(f.a,{style:{color:"#faad14"}}),width:460,title:"\u63D0\u793A",content:k.a.createElement("div",{className:"tc",style:{marginLeft:-38}},k.a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",paddingLeft:38,margin:"12px 0"}},k.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u72B6\u6001\u4E3A",(p==null?void 0:p.public)===2?"\u5DF2\u516C\u5F00":(p==null?void 0:p.public)===1?"\u5F85\u5BA1\u6838":"\u5DF2\u5173\u95ED","\uFF0C",c,"\u3002"),k.a.createElement("p",null,"\u5982\u6709\u9700\u8981\uFF0C\u8BF7\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u8FDB\u884C\u6280\u672F\u652F\u6301\u3002")),k.a.createElement("img",{style:{border:"4px solid #0152d9",borderRadius:"4px"},src:s.a,alt:"\u4E8C\u7EF4\u7801",width:160})),okText:"\u6211\u77E5\u9053\u4E86"}),!0):(p==null?void 0:p.shixun_status)===2?(A.a.confirm({centered:!0,icon:k.a.createElement(f.a,null),title:"\u63D0\u793A",content:k.a.createElement("div",null,k.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5DF2\u53D1\u5E03\uFF0C",c,"\u3002"),k.a.createElement("br",null),k.a.createElement("span",null,"\u5982\u6709\u9700\u8981\uFF0C\u60A8\u53EF\u4EE5\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u518D\u8FDB\u884C\u64CD\u4F5C\u3002")),okText:"\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){A.a.confirm({width:440,centered:!0,icon:k.a.createElement(f.a,{style:{color:"#faad14"}}),title:"\u63D0\u793A",content:"\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u5B66\u5458\u5C06\u65E0\u6CD5\u8FDB\u884C\u7EC3\u4E60\u3002\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F",okText:"\u786E\u5B9A\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){var U=Object(N.a)(H.a.mark(function z(){var G;return H.a.wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return T.next=2,h({type:"shixunsDetail/cancelRelease",payload:{id:p==null?void 0:p.identifier}});case 2:G=T.sent,G.status!==401&&(Y.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F\u3002\u5B9E\u8BAD\u56DE\u5230\u672A\u53D1\u5E03\u7684\u72B6\u6001\u3002"),h({type:"shixunsDetail/getShixunsDetail",payload:{id:p==null?void 0:p.identifier}}),h({type:"practiceSetting/getCommonData",payload:{id:p==null?void 0:p.identifier}}));case 4:case"end":return T.stop()}},z)}));function F(){return U.apply(this,arguments)}return F}()})}}),!0):!1}},Nd3P:function(tn,Qe,I){tn.exports={wrap:"wrap___h8kK3",maxWidth70:"maxWidth70___31ilo",maxWidth80:"maxWidth80___QYyBn",maxWidth100:"maxWidth100___1Caz0",maxWidth110:"maxWidth110___2Ikef",maxWidth120:"maxWidth120___1TY6-",reviewStatusTooltip:"reviewStatusTooltip___btvLr",color32C:"color32C___3168D",MdEditor:"MdEditor___1md-c",tr1:"tr1___33AUl"}},NoGO:function(tn,Qe,I){tn.exports=I.p+"static/newqrcode.d852fdfc.png"},NvD2:function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return M});var te=I("Kwbf");function Y(H,P){var k=new Set;return H.forEach(function(D){P.has(D)||k.add(D)}),k}function N(H){var P=H||{},k=P.disabled,D=P.disableCheckbox,b=P.checkable;return!!(k||D)||b===!1}function K(H,P,k,D){for(var b=new Set(H),m=new Set,f=0;f<=k;f+=1){var d=P.get(f)||new Set;d.forEach(function(o){var a=o.key,n=o.node,R=o.children,w=R===void 0?[]:R;b.has(a)&&!D(n)&&w.filter(function(x){return!D(x.node)}).forEach(function(x){b.add(x.key)})})}for(var s=new Set,r=k;r>=0;r-=1){var u=P.get(r)||new Set;u.forEach(function(o){var a=o.parent,n=o.node;if(D(n)||!o.parent||s.has(o.parent.key))return;if(D(o.parent.node)){s.add(a.key);return}var R=!0,w=!1;(a.children||[]).filter(function(x){return!D(x.node)}).forEach(function(x){var O=x.key,C=b.has(O);R&&!C&&(R=!1),!w&&(C||m.has(O))&&(w=!0)}),R&&b.add(a.key),w&&m.add(a.key),s.add(a.key)})}return{checkedKeys:Array.from(b),halfCheckedKeys:Array.from(Y(m,b))}}function A(H,P,k,D,b){for(var m=new Set(H),f=new Set(P),d=0;d<=D;d+=1){var s=k.get(d)||new Set;s.forEach(function(a){var n=a.key,R=a.node,w=a.children,x=w===void 0?[]:w;!m.has(n)&&!f.has(n)&&!b(R)&&x.filter(function(O){return!b(O.node)}).forEach(function(O){m.delete(O.key)})})}f=new Set;for(var r=new Set,u=D;u>=0;u-=1){var o=k.get(u)||new Set;o.forEach(function(a){var n=a.parent,R=a.node;if(b(R)||!a.parent||r.has(a.parent.key))return;if(b(a.parent.node)){r.add(n.key);return}var w=!0,x=!1;(n.children||[]).filter(function(O){return!b(O.node)}).forEach(function(O){var C=O.key,_=m.has(C);w&&!_&&(w=!1),!x&&(_||f.has(C))&&(x=!0)}),w||m.delete(n.key),x&&f.add(n.key),r.add(n.key)})}return{checkedKeys:Array.from(m),halfCheckedKeys:Array.from(Y(f,m))}}function M(H,P,k,D){var b=[],m;D?m=D:m=N;var f=new Set(H.filter(function(u){var o=!!k[u];return o||b.push(u),o})),d=new Map,s=0;Object.keys(k).forEach(function(u){var o=k[u],a=o.level,n=d.get(a);n||(n=new Set,d.set(a,n)),n.add(o),s=Math.max(s,a)}),Object(te.a)(!b.length,"Tree missing follow keys: ".concat(b.slice(0,100).map(function(u){return"'".concat(u,"'")}).join(", ")));var r;return P===!0?r=K(f,d,s,m):r=A(f,P.halfCheckedKeys,d,s,m),r}},OH33:function(tn,Qe,I){"use strict";I.r(Qe);var te=I("g9YV"),Y=I("wCAj"),N=I("Znn+"),K=I("ZTPi"),A=I("5Dmo"),M=I("3S7+"),H=I("sPJy"),P=I("bE4q"),k=I("+L6B"),D=I("2/Rp"),b=I("miYZ"),m=I("tsqr"),f=I("9og8"),d=I("2qtc"),s=I("kLXV"),r=I("tJVT"),u=I("WmNS"),o=I.n(u),a=I("q1tI"),n=I.n(a),R=I("ErOA"),w=I("Ty5D"),x=I("55Ip"),O=I("9kvl"),C=I("jhfD"),_=I("1vsH"),y=I("T2oS"),h=I("W9HT"),c=I("DjyN"),v=I("NUBc"),p=I("k1fw"),E=I("9Bee"),U=function(gn){var Tn=gn.shixunHomeworks,_n=gn.dispatch,si=Object(w.i)();return n.a.createElement(s.a,{centered:!0,title:"\u63D0\u793A",visible:Tn.actionTabs.key==="\u5220\u9664",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(f.a)(o.a.mark(function ai(){var J;return o.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return Ce.next=2,_n({type:"shixunHomeworks/deleteReply",payload:{object_id:Tn.actionTabs.selectArr.id,object_type:"journals_for_message"}});case 2:J=Ce.sent,J.status===0&&(m.b.success("\u5220\u9664\u6210\u529F"),_n({type:"shixunHomeworks/setActionTabs",payload:{}}),_n({type:"shixunHomeworks/getReplyList",payload:Object(p.a)({},Tn.actionTabs.params)}));case 4:case"end":return Ce.stop()}},ai)})),onCancel:function(){_n({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement("p",null,"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417\uFF1F"))},F=Object(O.a)(function(Bn){var gn=Bn.shixunHomeworks;return{shixunHomeworks:gn}})(U),z=I("wd/R"),G=I.n(z),B=I("iF7n"),T=I.n(B),V=I("xKgJ"),Z=I("BdwD");G.a.lang("ZH-cn");var oe=["","\u7B80\u5355","\u4E2D\u7B49","\u56F0\u96BE"],pe=function(gn){var Tn,_n,si=gn.shixunHomeworks,ai=gn.classroomList,J=gn.globalSetting,ue=gn.user,Ce=gn.loading,Te=gn.dispatch,qe=Object(a.useState)(Object(p.a)(Object(p.a)({},Object(w.i)()),{},{per_page:10})),Oe=Object(r.a)(qe,2),Ve=Oe[0],et=Oe[1],Ot=Object(a.useState)([]),Et=Object(r.a)(Ot,2),je=Et[0],ht=Et[1],it=Object(a.useState)(-1),st=Object(r.a)(it,2),bt=st[0],Lt=st[1],ct=Object(a.useState)(""),Gt=Object(r.a)(ct,2),on=Gt[0],Dn=Gt[1],Kn=Object(a.useState)(""),wn=Object(r.a)(Kn,2),Nn=wn[0],Pn=wn[1],Dt=ai.detailLeftMenus,sn=Object(w.h)(),Ft=Object(a.useState)({}),St=Object(r.a)(Ft,2),Un=St[0],Sn=St[1],zt=si.workDetail,lt=si.workList,jn=Object(a.useState)("1"),ln=Object(r.a)(jn,2),Jn=ln[0],$t=ln[1],On=Object(a.useState)(!1),Fn=Object(r.a)(On,2),hn=Fn[0],yi=Fn[1];Object(a.useEffect)(function(){lt.homework_status&&Rn()},[lt]);function Rn(){return bn.apply(this,arguments)}function bn(){return bn=Object(f.a)(o.a.mark(function Rt(){var Xe,kt,Pt;return o.a.wrap(function(zn){for(;;)switch(zn.prev=zn.next){case 0:return yi(!0),zn.next=3,Object(R.a)("/api/courses/".concat(Ve.coursesId,"/homework_commons/edit_hack_homework.json"),{method:"get",params:Object(p.a)(Object(p.a)({},Ve),{},{id:Ve.categoryId})});case 3:Pt=zn.sent,ht(Pt),yi(!1),Ve.defaultExpandedRowKeys=["".concat(Pt==null||((Xe=Pt.data)===null||Xe===void 0||((kt=Xe[0])===null||kt===void 0))?void 0:kt.identifier)],Jn!="2"&&$t(Pt!=null&&Pt.description?"1":"2"),et(Object(p.a)({},Ve));case 9:case"end":return zn.stop()}},Rt)})),bn.apply(this,arguments)}return n.a.createElement("section",{className:T.a.bg},n.a.createElement(h.a,{spinning:hn},n.a.createElement(K.a,{onChange:function(Xe){$t(Xe)},activeKey:Jn},n.a.createElement(K.a.TabPane,{key:1,tab:"\u8BF4\u660E"},n.a.createElement("section",{className:" edu-container",style:{padding:"20px 20px",background:"#fff"}},!(je!=null&&je.description)&&n.a.createElement(Z.a,{customText:"\u6682\u65E0\u8BF4\u660E"}),n.a.createElement(E.a,{value:(je==null?void 0:je.description)||""}))),n.a.createElement(K.a.TabPane,{key:2,tab:"\u9898\u76EE\u5217\u8868"},n.a.createElement("div",null,n.a.createElement("section",{className:" edu-container",style:{padding:"20px 20px",background:"#fff"}},Ve.defaultExpandedRowKeys&&n.a.createElement(Y.a,{dataSource:je==null?void 0:je.data,rowKey:function(Xe){return Xe==null?void 0:Xe.identifier},pagination:!1,expandable:{expandedRowRender:function(Xe){var kt,Pt;return n.a.createElement("div",{style:{padding:"10px 48px",borderRadius:2}},n.a.createElement("p",null,"\u9898\u76EE\uFF1A",Xe==null?void 0:Xe.name),n.a.createElement("p",null,"\u63CF\u8FF0\uFF1A",Xe==null?void 0:Xe.description),n.a.createElement("div",{style:{width:"100%",textAlign:"end"}},Object(V.c)()&&(je==null||((kt=je.homework_status)===null||kt===void 0)?void 0:kt.includes("\u672A\u53D1\u5E03"))&&n.a.createElement(D.a,{type:"primary",ghost:!0,onClick:function(){window.open("/problems/".concat(Xe==null?void 0:Xe.identifier,"/edit?type=1")),localStorage.setItem("program_homework",[Ve.coursesId,Ve.categoryId])}},"\u7F16\u8F91"),Object(V.c)()&&(je==null||((Pt=je.homework_status)===null||Pt===void 0)?void 0:Pt.includes("\u672A\u53D1\u5E03"))&&n.a.createElement(D.a,{type:"primary",style:{marginLeft:20},ghost:!0,onClick:function(){s.a.confirm({title:"\u63D0\u793A",content:"\u662F\u5426\u786E\u8BA4\u5220\u9664",okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var zn=Object(f.a)(o.a.mark(function oi(){var ei;return o.a.wrap(function(mi){for(;;)switch(mi.prev=mi.next){case 0:return mi.next=2,Object(R.a)("/api/problems/".concat(Xe==null?void 0:Xe.identifier,".json"),{method:"delete"});case 2:ei=mi.sent,(ei==null?void 0:ei.status)===0&&(m.b.info("\u5220\u9664\u6210\u529F"),Ve.page=1,Rn());case 4:case"end":return mi.stop()}},oi)}));function Ln(){return zn.apply(this,arguments)}return Ln}()})}},"\u5220\u9664")))},defaultExpandedRowKeys:Ve.defaultExpandedRowKeys},columns:[{title:"\u9898\u76EE",dataIndex:"name",ellipsis:!0,width:"20%",key:"name"},{title:"\u96BE\u5EA6",dataIndex:"difficult",key:"difficult",render:function(Xe,kt,Pt){return n.a.createElement("div",null,oe[Xe])}},{title:"\u901A\u8FC7\u7387",dataIndex:"pass_rate",key:"pass_rate"},{title:"\u901A\u8FC7\u4EBA\u6570",dataIndex:"submit_info",key:"submit_info"},{title:"\u77E5\u8BC6\u70B9",dataIndex:"tag_discipline",ellipsis:!0,width:"10%",key:"tag_discipline"},{title:"\u64CD\u4F5C",dataIndex:"identifier",key:"identifier",render:function(Xe,kt,Pt){return n.a.createElement("div",null,n.a.createElement("a",{href:"/classrooms/".concat(Ve.coursesId,"/program_homework/").concat(Ve.categoryId,"/").concat(Xe,"/ranking")},"\u6392\u884C"),n.a.createElement("a",{onClick:Object(f.a)(o.a.mark(function an(){var zn;return o.a.wrap(function(oi){for(;;)switch(oi.prev=oi.next){case 0:return oi.next=2,Object(R.a)("/api/problems/".concat(kt==null?void 0:kt.identifier,"/start.json"),{method:"get"});case 2:zn=oi.sent,zn&&(window.open("/myproblems/".concat(zn==null?void 0:zn.identifier,"?type=1")),localStorage.setItem("program_homework",[Ve.coursesId,Ve.categoryId]));case 4:case"end":return oi.stop()}},an)})),style:{margin:"0px 20px"}},Object(V.c)()?"\u4F53\u9A8C":"\u8FDB\u5165\u7B54\u9898"))}}]})),console.log("---",["".concat(je==null||((Tn=je.data)===null||Tn===void 0||((_n=Tn[0])===null||_n===void 0))?void 0:_n.identifier)]),n.a.createElement("aside",{className:"tc mt30 pb30"},n.a.createElement(v.a,{defaultCurrent:1,total:je==null?void 0:je.count,hideOnSinglePage:!0,showTotal:function(Xe){return n.a.createElement("span",null,"\u5171",Xe,"\u6761")},current:Ve.page||1,pageSize:Ve.per_page||10,onChange:function(Xe,kt){Ve.page=Xe,Ve.per_page=kt,et(Object(p.a)({},Ve)),Rn()}})))))),n.a.createElement(F,null))},Ye=Object(O.a)(function(Bn){var gn=Bn.shixunHomeworks,Tn=Bn.classroomList,_n=Bn.loading,si=Bn.user,ai=Bn.globalSetting;return{shixunHomeworks:gn,globalSetting:ai,classroomList:Tn,user:si,loading:_n.effects}})(pe),xe=I("oBTY"),Ie=I("giR+"),Je=I("fyUT"),Ke=I("7Kak"),be=I("9yH6"),de=I("qVdP"),nt=I("jsC+"),Kt=I("5NDa"),jt=I("5rEg"),wt=I("14J3"),ze=I("BMrR"),ft=I("sRBo"),dt=I("kaz8"),Nt=I("jCWc"),Ze=I("kPKH"),Bt=I("lUTK"),Ut=I("BvKs"),Mt=I("jrin"),An=I("y8nQ"),mn=I("Vl3Y"),pn=I("8Skl"),tt=I("y3Kf"),fn=I("Llu2"),In=I("0NbB"),He=I("T7RX"),Ue=I("PpiC"),pt=I("IMoZ"),Ct=function(gn){var Tn=gn.shixunHomeworks,_n=gn.dispatch,si=Object(Ue.a)(gn,["shixunHomeworks","dispatch"]),ai=Object(w.i)(),J=Object(a.useState)(!0),ue=Object(r.a)(J,2),Ce=ue[0],Te=ue[1],qe=Object(a.useState)(!1),Oe=Object(r.a)(qe,2),Ve=Oe[0],et=Oe[1],Ot=mn.a.useForm(),Et=Object(r.a)(Ot,1),je=Et[0],ht=function(){var it=Object(f.a)(o.a.mark(function st(){var bt,Lt;return o.a.wrap(function(Gt){for(;;)switch(Gt.prev=Gt.next){case 0:return bt=je.getFieldValue(),Gt.next=3,Object(R.a)("/api/homework_commons/".concat(ai.categoryId,"/batch_comment.json"),{method:"post",body:{student_work_ids:Object(xe.a)(Tn.actionTabs.selectArrs),cover_all:Ce,hidden_comment:bt.hidden_comment,comment:bt.comment}});case 3:Lt=Gt.sent,Lt.status===0&&(m.b.success("\u8BC4\u9605\u6210\u529F"),je.resetFields(),_n({type:"shixunHomeworks/setActionTabs",payload:{}}),_n({type:"shixunHomeworks/getWorkList",payload:Object(p.a)({},Tn.actionTabs.params)}));case 5:case"end":return Gt.stop()}},st)}));return function(){return it.apply(this,arguments)}}();return n.a.createElement(n.a.Fragment,null,n.a.createElement(s.a,{centered:!0,title:"\u4E00\u952E\u70B9\u8BC4",visible:Tn.actionTabs.key==="\u4E00\u952E\u70B9\u8BC4",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(f.a)(o.a.mark(function it(){var st;return o.a.wrap(function(Lt){for(;;)switch(Lt.prev=Lt.next){case 0:st=je.getFieldValue(),JSON.stringify(st)==="{}"||st.hidden_comment===""&&st.comment===""?et(!0):Tn.workList.partial_comment?_n({type:"shixunHomeworks/setActionTabs",payload:{key:"\u4E00\u952E\u70B9\u8BC4\u786E\u8BA4",selectArrs:Tn.actionTabs.selectArrs,params:Tn.actionTabs.params}}):ht();case 2:case"end":return Lt.stop()}},it)})),onCancel:function(){_n({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement(mn.a,{form:je,onChange:function(){Ve&&et(!1)}},n.a.createElement("p",null,"\u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),n.a.createElement(mn.a.Item,{name:"comment"},n.a.createElement(jt.a.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:8})),n.a.createElement("p",null,"\u4EC5\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),n.a.createElement(mn.a.Item,{name:"hidden_comment"},n.a.createElement(jt.a.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:8}))),Ve&&n.a.createElement("p",{className:"c-red"},"\u8BC4\u9605\u5185\u5BB9\u81F3\u5C11\u6709\u4E00\u4E2A\u4E0D\u4E3A\u7A7A")),n.a.createElement(s.a,{centered:!0,title:n.a.createElement("span",null,n.a.createElement(pt.a,{className:"c-orange mr20"}),"\u63D0\u793A"),visible:Tn.actionTabs.key==="\u4E00\u952E\u70B9\u8BC4\u786E\u8BA4",okText:"\u786E\u5B9A\u70B9\u8BC4",cancelText:"\u653E\u5F03\u70B9\u8BC4",onOk:function(){ht()},onCancel:function(){_n({type:"shixunHomeworks/setActionTabs",payload:{}})},width:400},n.a.createElement("div",{className:"tc"},n.a.createElement("p",null,"\u90E8\u5206\u5B66\u751F\u5DF2\u6709\u70B9\u8BC4\u5185\u5BB9\uFF0C\u662F\u5426\u8986\u76D6\u5DF2\u6709\u70B9\u8BC4\u5185\u5BB9\uFF1F"),n.a.createElement("p",null,n.a.createElement(be.a.Group,{onChange:function(st){Te(st.target.value)},value:Ce},n.a.createElement(be.a,{value:!0},"\u8986\u76D6\u5DF2\u6709\u70B9\u8BC4"),n.a.createElement(be.a,{value:!1},"\u8DF3\u8FC7\u5DF2\u6709\u70B9\u8BC4"))))))},Ge=Object(O.a)(function(Bn){var gn=Bn.shixunHomeworks;return{shixunHomeworks:gn}})(Ct),vt=I("XYT7"),Ae=I("Nd3P"),ge=I.n(Ae),Ee=function(gn){var Tn,_n,si,ai,J=gn.shixunHomeworks,ue=gn.dispatch,Ce=Object(Ue.a)(gn,["shixunHomeworks","dispatch"]),Te=Object(w.i)(),qe=Object(a.useState)(!1),Oe=Object(r.a)(qe,2),Ve=Oe[0],et=Oe[1],Ot=Object(a.useState)((Tn=J.actionTabs.selectArrs)===null||Tn===void 0||((_n=Tn.data)===null||_n===void 0)?void 0:_n.name),Et=Object(r.a)(Ot,2),je=Et[0],ht=Et[1],it=mn.a.useForm(),st=Object(r.a)(it,1),bt=st[0];Object(a.useEffect)(function(){var ct,Gt,on,Dn,Kn,wn;J.actionTabs.key==="\u66F4\u6539\u70B9\u8BC4"&&bt.setFieldsValue({comment:(ct=J.actionTabs.selectArrs)===null||ct===void 0||((Gt=ct.data)===null||Gt===void 0)?void 0:Gt.work_comment,hidden_comment:(on=J.actionTabs.selectArrs)===null||on===void 0||((Dn=on.data)===null||Dn===void 0)?void 0:Dn.work_comment_hidden}),ht((Kn=J.actionTabs.selectArrs)===null||Kn===void 0||((wn=Kn.data)===null||wn===void 0)?void 0:wn.name)},[J.actionTabs.key]);var Lt=function(){var ct=Object(f.a)(o.a.mark(function Gt(){var on,Dn,Kn,wn;return o.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:return Kn=bt.getFieldValue(),Pn.next=3,Object(R.a)("/api/student_works/".concat((on=J.actionTabs.selectArrs)===null||on===void 0||((Dn=on.data)===null||Dn===void 0)?void 0:Dn.homeworkId,"/shixun_work_comment.json"),{method:"post",body:{hidden_comment:Kn.hidden_comment,comment:Kn.comment}});case 3:if(wn=Pn.sent,!(wn.status===0)){Pn.next=9;break}return m.b.success("\u8BC4\u9605\u6210\u529F"),bt.resetFields(),ue({type:"shixunHomeworks/setActionTabs",payload:{}}),Pn.abrupt("return",ue({type:"shixunHomeworks/getWorkList",payload:Te}));case 9:case"end":return Pn.stop()}},Gt)}));return function(){return ct.apply(this,arguments)}}();return n.a.createElement(n.a.Fragment,null,n.a.createElement(s.a,{centered:!0,title:(si=J.actionTabs.selectArrs)!==null&&si!==void 0&&(ai=si.data)!==null&&ai!==void 0&&ai.work_comment_hidden?"\u66F4\u6539"+je+"\u70B9\u8BC4":je+"\u70B9\u8BC4",visible:J.actionTabs.key==="\u66F4\u6539\u70B9\u8BC4",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(f.a)(o.a.mark(function ct(){var Gt;return o.a.wrap(function(Dn){for(;;)switch(Dn.prev=Dn.next){case 0:Gt=bt.getFieldValue(),JSON.stringify(Gt)==="{}"||Gt.hidden_comment===""&&Gt.comment===""?et(!0):Lt();case 2:case"end":return Dn.stop()}},ct)})),onCancel:function(){ue({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement(mn.a,{form:bt,onChange:function(){Ve&&et(!1)}},n.a.createElement("p",null,"\u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),n.a.createElement(mn.a.Item,{name:"comment"},n.a.createElement(jt.a.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:8})),n.a.createElement("p",null,"\u4EC5\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),n.a.createElement(mn.a.Item,{name:"hidden_comment"},n.a.createElement(jt.a.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:8}))),Ve&&n.a.createElement("p",{className:"c-red"},"\u8BC4\u9605\u5185\u5BB9\u81F3\u5C11\u6709\u4E00\u4E2A\u4E0D\u4E3A\u7A7A")))},ae=Object(O.a)(function(Bn){var gn=Bn.shixunHomeworks;return{shixunHomeworks:gn}})(Ee),re=function(gn){var Tn=gn.shixunHomeworks,_n=gn.dispatch,si=Object(Ue.a)(gn,["shixunHomeworks","dispatch"]),ai=Object(w.i)(),J=Object(a.useState)([]),ue=Object(r.a)(J,2),Ce=ue[0],Te=ue[1],qe=Object(a.useState)([]),Oe=Object(r.a)(qe,2),Ve=Oe[0],et=Oe[1];Object(a.useEffect)(function(){Tn.actionTabs.key==="\u8D28\u91CF\u68C0\u6D4B"&&Ot()},[Tn.actionTabs.key]);function Ot(){return Et.apply(this,arguments)}function Et(){return Et=Object(f.a)(o.a.mark(function ht(){var it;return o.a.wrap(function(bt){for(;;)switch(bt.prev=bt.next){case 0:return bt.next=2,Object(R.a)("/api/homework_commons/".concat(ai.categoryId,"/code_quality_analyses/group_list.json"),{method:"GET",params:{page:1,limit:200}});case 2:it=bt.sent,Te(it);case 4:case"end":return bt.stop()}},ht)})),Et.apply(this,arguments)}var je=[{title:"\u5206\u73ED\u60C5\u51B5",dataIndex:"name"},{title:"\u6709\u6548\u4F5C\u54C1\u6570",dataIndex:"works_count"},{title:"\u68C0\u6D4B\u8FDB\u5EA6",dataIndex:"status"},{title:"\u4E0A\u6B21\u8BC4\u5206\u65F6\u95F4",dataIndex:"last_analysis_time"}];return n.a.createElement(n.a.Fragment,null,n.a.createElement(s.a,{centered:!0,title:"\u4EE3\u7801\u8D28\u91CF\u8BC4\u5206",visible:Tn.actionTabs.key==="\u8D28\u91CF\u68C0\u6D4B",width:700,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(f.a)(o.a.mark(function ht(){var it;return o.a.wrap(function(bt){for(;;)switch(bt.prev=bt.next){case 0:return bt.next=2,Object(R.a)("/api/homework_commons/".concat(ai.categoryId,"/code_quality_analyses.json"),{method:"POST",body:{group_ids:Ve}});case 2:it=bt.sent,(it==null?void 0:it.status)===0&&(O.d.replace("/classrooms/".concat(ai.coursesId,"/shixun_homework/").concat(ai.categoryId,"/detail?tabs=4")),window.location.reload(),_n({type:"shixunHomeworks/setActionTabs",payload:{}}),et([]));case 4:case"end":return bt.stop()}},ht)})),onCancel:function(){et([]),_n({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement(Y.a,{rowSelection:{type:"checkbox",onChange:function(it,st){et(Object(xe.a)(it))},selectedRowKeys:Ve,getCheckboxProps:function(it){return{disabled:it.status==="\u8FDB\u884C\u4E2D"||it.works_count===0}}},rowKey:function(it){return it.key||it.id},scroll:{y:300},pagination:!1,columns:je,dataSource:Ce==null?void 0:Ce.group_list})))},he=Object(O.a)(function(Bn){var gn=Bn.shixunHomeworks;return{shixunHomeworks:gn}})(re),ve=I("Ot1p"),me=I("mgmH"),Be=function(gn){var Tn,_n,si,ai,J,ue,Ce,Te,qe,Oe=gn.shixunHomeworks,Ve=gn.loading,et=gn.dispatch,Ot=gn.setExportParams,Et=gn.user,je=Object(w.i)(),ht=Object(a.useState)(Object(p.a)(Object(p.a)({},{page:1,limit:20,order:"work_score",b_order:"desc"}),je)),it=Object(r.a)(ht,2),st=it[0],bt=it[1],Lt=mn.a.useForm(),ct=Object(r.a)(Lt,1),Gt=ct[0],on=Object(a.useState)(),Dn=Object(r.a)(on,2),Kn=Dn[0],wn=Dn[1],Nn=Object(a.useState)({}),Pn=Object(r.a)(Nn,2),Dt=Pn[0],sn=Pn[1],Ft=Object(a.useState)([]),St=Object(r.a)(Ft,2),Un=St[0],Sn=St[1],zt=Object(a.useState)(!1),lt=Object(r.a)(zt,2),jn=lt[0],ln=lt[1],Jn=Object(a.useState)([]),$t=Object(r.a)(Jn,2),On=$t[0],Fn=$t[1],hn=Object(a.useState)(!1),yi=Object(r.a)(hn,2),Rn=yi[0],bn=yi[1],Rt=Object(a.useState)(),Xe=Object(r.a)(Rt,2),kt=Xe[0],Pt=Xe[1],an=Object(a.useState)(1),zn=Object(r.a)(an,2),Ln=zn[0],oi=zn[1],ei=Object(a.useState)(),Oi=Object(r.a)(ei,2),mi=Oi[0],bi=Oi[1],Ji=Object(a.useState)(),Vi=Object(r.a)(Ji,2),$i=Vi[0],gr=Vi[1],vr=Object(a.useState)(),ye=Object(r.a)(vr,2),Me=ye[0],We=ye[1],we=Object(a.useState)(),ie=Object(r.a)(we,2),fe=ie[0],le=ie[1],Se=Object(a.useState)(),De=Object(r.a)(Se,2),$e=De[0],Le=De[1],at=Object(a.useState)(!1),It=Object(r.a)(at,2),qt=It[0],un=It[1],Hn=Object(w.h)();Object(a.useEffect)(function(){return Gn(!0),function(){sn([]),Sn([])}},[st.coursesId]),Object(a.useEffect)(function(){var dn,Zt=JSON.parse(JSON.stringify(Oe.workList));!(Zt!=null&&(dn=Zt.student_works)!==null&&dn!==void 0&&dn.length)&&Zt!==null&&Zt!==void 0&&Zt.id?(Zt.student_works=[Object(p.a)({},Zt)],sn(Zt)):(Zt!=null&&Zt.id&&Sn([Object(p.a)(Object(p.a)({},Zt),{number:"\u6211"})]),sn(Object(p.a)({},Zt)))},[Oe.workList]);var Gn=function(Zt){Ot(Object(p.a)({},st));var yn=et({type:"shixunHomeworks/getWorkList",payload:st});return Zt&&yn.then(function(Ht){var Wt,pi,Pi;(Ht!=null&&(Wt=Ht.homework_status)!==null&&Wt!==void 0&&Wt.includes("\u8FDB\u884C\u4E2D")||Ht!=null&&(pi=Ht.homework_status)!==null&&pi!==void 0&&pi.includes("\u8865\u4EA4\u4E2D")||Ht!=null&&(Pi=Ht.homework_status)!==null&&Pi!==void 0&&Pi.includes("\u63D0\u4EA4\u4E2D"))&&!Object(V.s)()&&li()}),yn};Object(a.useEffect)(function(){di()},[]);var di=function(){var dn=Object(f.a)(o.a.mark(function Zt(){var yn;return o.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:return Wt.next=2,Object(vt.I)({categoryId:je.categoryId});case 2:yn=Wt.sent,wn(yn==null?void 0:yn.update_score);case 4:case"end":return Wt.stop()}},Zt)}));return function(){return dn.apply(this,arguments)}}(),li=function(){var dn=Object(f.a)(o.a.mark(function Zt(){var yn;return o.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:return et({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6210\u7EE9\u8BA1\u7B97\u4E2D\uFF0C\u8BF7\u7A0D\u5019..."}}),Wt.next=3,Object(vt.Z)({categoryId:je.categoryId});case 3:yn=Wt.sent,et({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}}),(yn==null?void 0:yn.status)===0&&(m.b.success(yn==null?void 0:yn.message),Gn());case 6:case"end":return Wt.stop()}},Zt)}));return function(){return dn.apply(this,arguments)}}(),Ei=function(){st.page=1;var Zt=Object.assign({},Gt.getFieldValue());delete st.course_group,delete st.teacher_comment,Object.keys(Zt).map(function(yn){switch(yn){case"task_status":Zt[yn].includes("all")||!Zt[yn].length?(delete st.work_status,Gt.setFieldsValue(Object(Mt.a)({},"task_status","all"))):(st.work_status=Zt[yn],Gt.setFieldsValue(Object(Mt.a)({},"task_status",st.work_status)));break;case"course_group_info":Zt[yn].includes("all")||!Zt[yn].length?(delete st.course_group,Gt.setFieldsValue(Object(Mt.a)({},"course_group_info","all"))):(st.course_group=Zt[yn],Gt.setFieldsValue(Object(Mt.a)({},"course_group_info",st.course_group)));break;case"teacher_comment":if(Zt[yn].includes("all")||!Zt[yn].length)delete st.teacher_comment,Gt.setFieldsValue(Object(Mt.a)({},"teacher_comment","all"));else{var Ht;st.teacher_comment=((Ht=Zt[yn])===null||Ht===void 0?void 0:Ht.length)===1?Number(Zt[yn][0]):"",Gt.setFieldsValue(Object(Mt.a)({},"teacher_comment",Zt[yn]))}break}}),Gn()};Object(a.useEffect)(function(){if(document.getElementById("divhe")){var dn=document.getElementById("divhe").scrollHeight;dn>47&&(Le(47),un(!0))}},[document.getElementById("divhe")]);var Ri=function(Zt,yn){st.page=Zt,st.limit=20,Gn()};function gi(){oi(1),bi(""),gr(""),We(""),le(""),Fn([])}var xi=[{title:"\u5E8F\u53F7",dataIndex:"number",align:"center",width:50,fixed:"left",ellipsis:{showTitle:!1},render:function(Zt,yn,Ht){return st.limit*(st.page-1)+Ht+1}},{title:"\u59D3\u540D",dataIndex:"user_name",align:"center",width:110,fixed:"left",ellipsis:{showTitle:!1},render:function(Zt){return n.a.createElement(M.a,{placement:"bottomLeft",title:Zt},n.a.createElement("span",{className:"current"},Zt))}},!(Dt!=null&&Dt.is_excellent)&&!Object(V.r)()&&{title:"\u5B66\u53F7",dataIndex:"student_id",align:"center",sorter:!0,fixed:"left",width:110,showSorterTooltip:!1,ellipsis:{showTitle:!1},sortOrder:st.order==="student_id"?st.b_order==="desc"?"descend":"ascend":null,render:function(Zt){return n.a.createElement(M.a,{placement:"bottomLeft",title:Zt||"--"},n.a.createElement("span",{className:"current"},Zt||"--"))}},{title:"\u5206\u73ED",dataIndex:"group_name",align:"center",width:180,fixed:"left",ellipsis:{showTitle:!1},render:function(Zt,yn){return Zt?n.a.createElement(M.a,{placement:"bottom",title:Zt},n.a.createElement("span",{className:"current"},Zt)):"--"}},{title:"\u4F5C\u4E1A\u72B6\u6001",dataIndex:"work_status",align:"center",width:80,fixed:"left",sorter:!0,ellipsis:{showTitle:!1},showSorterTooltip:!1,sortOrder:st.order==="work_status"?st.b_order==="desc"?"descend":"ascend":null,render:function(Zt){return n.a.createElement(_.f,{status:Zt})}},{title:"\u5B8C\u6210\u65F6\u95F4",align:"center",dataIndex:"achieve_time",ellipsis:{showTitle:!1},render:function(Zt,yn){return n.a.createElement(M.a,{placement:"bottomLeft",title:Zt},n.a.createElement("span",{className:"current"},Zt))}},{title:"\u901A\u8FC7\u60C5\u51B5",align:"center",dataIndex:"achieve_info",ellipsis:{showTitle:!1},render:function(Zt,yn){return n.a.createElement("span",null,Zt||"- -")}},{title:"\u6700\u7EC8\u6210\u7EE9",align:"center",dataIndex:"score",ellipsis:{showTitle:!1},render:function(Zt,yn){return n.a.createElement("span",null,Zt||"- -")}},{title:"\u5B8C\u6210\u65F6\u957F",dataIndex:"achieve_time_long",align:"center",render:function(Zt,yn){return Zt&&Zt!="--"?n.a.createElement(M.a,{placement:"bottom",title:Zt},n.a.createElement("span",{className:"current"},Zt)):"--"}},{title:n.a.createElement("span",null,"\u8BC4\u9605\u72B6\u6001"),align:"center",dataIndex:"has_comment",width:90,fixed:"right",ellipsis:!0,render:function(Zt){return Zt?"\u5DF2\u8BC4\u9605":"\u672A\u8BC4\u9605"}},{title:"\u64CD\u4F5C",dataInex:"action",align:"center",width:70,fixed:"right",ellipsis:!0,className:"workListTable",render:function(Zt,yn){return Object(V.s)()?n.a.createElement("div",null,Object(_.B)(yn==null?void 0:yn.work_status)==="\u672A\u5F00\u542F"?n.a.createElement("span",null,"--"):n.a.createElement(x.a,{target:"_blank",onClick:function(Wt){Wt.stopPropagation()},to:"/classrooms/".concat(st.coursesId,"/program_homework/").concat(st.categoryId,"/").concat(yn.id,"/").concat(yn.user_id,"/comment")},"\u67E5\u770B")):n.a.createElement("a",{target:"_blank",onClick:function(Wt){var pi;if(Wt.stopPropagation(),(pi=Et.userInfo)!==null&&pi!==void 0&&pi.professional_certification)window.open("/classrooms/".concat(st.coursesId,"/program_homework/").concat(st.categoryId,"/").concat(yn.id,"/").concat(yn.user_id,"/comment"),"_blank");else return s.a.confirm({title:"\u63D0\u793A",centered:!0,content:n.a.createElement("div",{className:"tc"},"\u60A8\u9700\u8981\u53BB\u5B8C\u6210\u60A8\u7684\u804C\u4E1A\u8BA4\u8BC1\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD"),okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){Object(_.S)("/account/certification")}}),!1}},"\u67E5\u770B\u4F5C\u4E1A")}}].filter(function(dn){return!!dn}),Di=function(){return n.a.createElement(Ut.a,null,n.a.createElement(Ut.a.Item,{onClick:function(){Object(me.h)(JSON.parse(sessionStorage.all_student_works_params),"shixun_work_list")},key:"1"},"\u5B66\u751F\u6210\u7EE9"),n.a.createElement(Ut.a.Item,{key:"2"},n.a.createElement(x.a,{to:"/classrooms/".concat(st.coursesId,"/exportlist/shixun_work_list")},"\u5386\u53F2\u5BFC\u51FA")))};return n.a.createElement(n.a.Fragment,null,n.a.createElement("section",{className:"".concat(ge.a.wrap," minH500 bg-white pl30 pr30 pt30")},((Tn=Dt.homework_status)===null||Tn===void 0?void 0:Tn.includes("\u672A\u53D1\u5E03"))&&n.a.createElement(Z.a,null),!((_n=Dt.homework_status)!==null&&_n!==void 0&&_n.includes("\u672A\u53D1\u5E03"))&&n.a.createElement("aside",null,!Object(V.c)()&&n.a.createElement("div",{className:"c-light-black font12"},n.a.createElement("span",null,"\u53D1\u5E03\u65F6\u95F4 ",Dt==null?void 0:Dt.publish_time),n.a.createElement("span",{className:"ml5"},"\u622A\u6B62\u65F6\u95F4 ",Dt==null?void 0:Dt.end_time),n.a.createElement("span",{className:"ml5"},"\u8865\u4EA4\u65F6\u95F4 ",(Dt==null?void 0:Dt.late_time)||"- -")),Object(V.c)()&&n.a.createElement(n.a.Fragment,null,n.a.createElement(mn.a,{form:Gt,onChange:Ei,initialValues:(si={},Object(Mt.a)(si,"task_status","all"),Object(Mt.a)(si,"course_group_info","all"),Object(Mt.a)(si,"teacher_comment","all"),si)},((ai=Dt.task_status)===null||ai===void 0?void 0:ai.length)>0&&n.a.createElement(mn.a.Item,{name:"task_status"},n.a.createElement(dt.a.Group,{value:[],style:{width:"100%"}},n.a.createElement(ze.a,null,n.a.createElement(Ze.a,{className:"font14",flex:"80px"},"\u4F5C\u4E1A\u72B6\u6001:"),n.a.createElement(Ze.a,{flex:"80px"},n.a.createElement(dt.a,{value:"all"},"\u5168\u90E8")),n.a.createElement(Ze.a,{flex:"1"},Dt.task_status&&Dt.task_status.map(function(dn,Zt){return n.a.createElement(dt.a,{name:"task_status",value:dn.id},dn.name,"(",dn.count,")")}))))),((J=Dt.course_group_info)===null||J===void 0?void 0:J.length)>0&&n.a.createElement(mn.a.Item,{name:"course_group_info"},n.a.createElement(dt.a.Group,{style:{width:"100%"}},n.a.createElement(ze.a,null,n.a.createElement(Ze.a,{className:"font14",flex:"80px"},"\u5206\u73ED\u60C5\u51B5:"),n.a.createElement(Ze.a,{flex:"80px"},n.a.createElement(dt.a,{value:"all"},"\u5168\u90E8")),n.a.createElement(Ze.a,{flex:"1",id:"divhe",style:{height:$e+"px",overflow:"hidden"}},(ue=Dt.course_group_info)===null||ue===void 0?void 0:ue.map(function(dn,Zt){return n.a.createElement(dt.a,{value:dn.course_group_id},dn.group_group_name,"(",dn.count,")")})),qt&&n.a.createElement("span",{onClick:function(){var Zt=document.getElementById("divhe").scrollHeight;$e>47?Le(47):Le(Zt)},style:{color:"rgb(76, 172, 255)",cursor:"pointer",alignItems:"flex-end",display:"flex"}},$e===47?"\u5C55\u5F00":"\u6536\u8D77",$e===47?n.a.createElement(pn.a,{style:{marginBottom:"3px",marginLeft:"2px"}}):n.a.createElement(tt.a,{style:{marginBottom:"3px",marginLeft:"2px"}}))))),((Ce=Dt.teacher_comment)===null||Ce===void 0?void 0:Ce.length)>0&&n.a.createElement(mn.a.Item,{name:"teacher_comment"},n.a.createElement(dt.a.Group,{style:{width:"100%"}},n.a.createElement(ze.a,null,n.a.createElement(Ze.a,{className:"font14",flex:"80px"},"\u8FFD\u52A0\u70B9\u8BC4:"),n.a.createElement(Ze.a,{flex:"80px"},n.a.createElement(dt.a,{value:"all"},"\u5168\u90E8")),n.a.createElement(Ze.a,{flex:"1"},Dt.teacher_comment&&Dt.teacher_comment.map(function(dn,Zt){return n.a.createElement(dt.a,{value:String(dn.id)},dn.name,"(",dn.count,")")})))))),n.a.createElement(ze.a,{align:"middle"},n.a.createElement(Ze.a,{flex:"1"},n.a.createElement(ze.a,{align:"middle"},n.a.createElement(Ze.a,null,n.a.createElement(jt.a.Search,{allowClear:!0,placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D\u6216\u8005\u5B66\u53F7\u641C\u7D22",onSearch:function(Zt){st.search=Zt,st.page=1,Gn()},style:{width:240}})),n.a.createElement(Ze.a,null,n.a.createElement("span",{className:"ml5"},n.a.createElement("span",{className:"c-red"},Dt.work_count),"\u4E2A\u68C0\u7D22\u7ED3\u679C\uFF08",Dt.work_count,"\u4E2A\u5B66\u751F\uFF09")))),n.a.createElement(Ze.a,null,Object(V.c)()&&n.a.createElement(D.a,{className:"ml10",onClick:function(){et({type:"shixunHomeworks/setActionTabs",payload:{key:"\u4EE3\u7801\u67E5\u91CD",selectArrs:Dt.student_works.map(function(Zt){return Zt.id}),params:st}})}},n.a.createElement("span",{className:"".concat(ge.a.tr1," iconfont icon-daimachazhong")}),"\u4EE3\u7801\u67E5\u91CD"),Object(V.c)()&&n.a.createElement(D.a,{className:"ml10",onClick:li},n.a.createElement("i",{className:"iconfont icon-gengxinchengji font14 pr5"}),"\u66F4\u65B0\u6210\u7EE9"),Object(V.c)()&&n.a.createElement(nt.a,{overlay:Di,className:"ml10"},n.a.createElement(D.a,null,n.a.createElement(fn.a,null),"\u5BFC\u51FA",n.a.createElement(In.a,null)))))),n.a.createElement(ze.a,{style:{justifyContent:"end",marginTop:"5px"}},Object(V.c)()&&Kn&&n.a.createElement("span",null,n.a.createElement("span",{style:{color:"red"}},"*"),"\u5217\u8868\u4E2D\u4F5C\u4E1A\u8BB0\u5F55\u5B58\u5728\u5DEE\u5F02\uFF0C\u8BF7\u70B9\u51FB\u201C\u66F4\u65B0\u6210\u7EE9\u201D\u6309\u94AE")),n.a.createElement(Y.a,{className:"mt30",loading:Ve["shixunHomeworks/getWorkList"],pagination:!1,style:{cursor:"pointer"},onRow:function(Zt){return{onClick:function(Ht){window.open("/classrooms/".concat(st.coursesId,"/program_homework/").concat(st.categoryId,"/").concat(Zt.id,"/").concat(Zt.user_id,"/comment"),"_blank")}}},dataSource:Dt.student_works,columns:xi,onChange:function(Zt,yn,Ht){Ht.field&&(st.order=Ht.field),Ht.order||(st.b_order="asc"),Ht.order==="ascend"&&(st.b_order="asc"),Ht.order==="descend"&&(st.b_order="desc"),Ht.order||(st.b_order="asc"),Gn()}}),n.a.createElement(Ge,null),n.a.createElement(ae,null),n.a.createElement(He.a,null)),n.a.createElement(s.a,{title:"\u4E00\u952E\u6253\u56DE\u91CD\u505A",visible:jn,centered:!0,destroyOnClose:!0,forceRender:!0,width:700,onOk:Object(f.a)(o.a.mark(function dn(){var Zt,yn;return o.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:if(!(Ln===2)){Wt.next=13;break}if(!(On.length<=0)){Wt.next=4;break}return m.b.info("\u8BF7\u9009\u62E9\u4F5C\u4E1A\u72B6\u6001"),Wt.abrupt("return");case 4:if(fe){Wt.next=7;break}return m.b.info("\u8BC4\u8BED\u4E0D\u80FD\u4E3A\u7A7A"),Wt.abrupt("return");case 7:return Wt.next=9,Object(R.a)("/api/homework_commons/".concat(st.categoryId,"/confirm_redo_modal.json"),{method:"post",body:{id:st.categoryId,comment:fe,status:On}});case 9:Zt=Wt.sent,Zt.status===0&&(Pt(Zt),ln(!1),bn(!0)),Wt.next=32;break;case 13:if(!(Me===0||$i===0)){Wt.next=16;break}Wt.next=22;break;case 16:if(Me){Wt.next=19;break}return m.b.info("\u6700\u4F4E\u5206\u4E0D\u80FD\u4E3A\u7A7A"),Wt.abrupt("return");case 19:if($i){Wt.next=22;break}return m.b.info("\u6700\u9AD8\u5206\u4E0D\u80FD\u4E3A\u7A7A"),Wt.abrupt("return");case 22:if(!(Me>$i)){Wt.next=25;break}return m.b.info("\u6700\u9AD8\u5206\u4E0D\u80FD\u5927\u4E8E\u6700\u4F4E\u5206"),Wt.abrupt("return");case 25:if(fe){Wt.next=28;break}return m.b.info("\u8BC4\u8BED\u4E0D\u80FD\u4E3A\u7A7A"),Wt.abrupt("return");case 28:return Wt.next=30,Object(R.a)("/api/homework_commons/".concat(st.categoryId,"/confirm_redo_modal.json"),{method:"post",body:{id:st.categoryId,comment:fe,min_score:Me,max_score:$i}});case 30:yn=Wt.sent,yn.status===0&&(Pt(yn),ln(!1),bn(!0));case 32:case"end":return Wt.stop()}},dn)})),onCancel:function(){ln(!1),gi()}},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(be.a.Group,{value:Ln,onChange:function(Zt){oi(Zt.target.value)}},n.a.createElement(be.a,{value:1},"\u6309\u6210\u7EE9\u6253\u56DE"),n.a.createElement(be.a,{value:2},"\u6309\u4F5C\u4E1A\u72B6\u6001\u6253\u56DE"))),Ln===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(Je.a,{min:0,max:100,value:Me,onChange:function(Zt){return We(Zt)},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(Je.a,{min:0,max:100,value:$i,onChange:function(Zt){return gr(Zt)},style:{width:"100px"}})),Ln===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(dt.a.Group,{onChange:function(Zt){Fn(Object(xe.a)(Zt))},style:{width:"100%"}},(Te=Dt.task_status)===null||Te===void 0?void 0:Te.map(function(dn,Zt){return n.a.createElement(dt.a,{name:"task_status",value:dn.id},dn.name,"(",dn.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(ve.a,{className:ge.a.MdEditor,onChange:function(Zt){return le(Zt)},placeholder:"\u8BF7\u586B\u5199\u8BC4\u8BED"}))))),n.a.createElement(s.a,{visible:Rn,title:"\u6253\u56DE\u786E\u8BA4",onOk:Object(f.a)(o.a.mark(function dn(){var Zt,yn;return o.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:if(!(Ln===2)){Wt.next=7;break}return Wt.next=3,Object(R.a)("/api/homework_commons/".concat(st.categoryId,"/batch_redo_modal.json"),{method:"post",body:{id:st.categoryId,comment:fe,status:On}});case 3:Zt=Wt.sent,Zt.status===0&&(m.b.info("\u6253\u56DE\u6210\u529F"),gi(),Gn(),bn(!1)),Wt.next=11;break;case 7:return Wt.next=9,Object(R.a)("/api/homework_commons/".concat(st.categoryId,"/batch_redo_modal.json"),{method:"post",body:{id:st.categoryId,comment:fe,min_score:Me,max_score:$i}});case 9:yn=Wt.sent,yn.status===0&&(m.b.info("\u6253\u56DE\u6210\u529F"),gi(),Gn(),bn(!1));case 11:case"end":return Wt.stop()}},dn)})),onCancel:function(){gi(),bn(!1)}},n.a.createElement("div",{style:{padding:"32px"}},Ln===1&&n.a.createElement("span",null,"\u786E\u8BA4\u5C06\u6210\u7EE9\u5728",Me,"-",$i,"\u7684\u5B66\u751F\u8FDB\u884C\u6253\u56DE\u91CD\u505A\u5417\uFF1F"),Ln===2&&n.a.createElement("span",null,"\u786E\u8BA4\u5C06\u4F5C\u4E1A\u72B6\u6001\u4E3A",((qe=Dt.task_status)===null||qe===void 0?void 0:qe.filter(function(dn){return On==null?void 0:On.includes(dn.id)}).map(function(dn){return dn.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",kt==null?void 0:kt.count,"\u540D\u5B66\u751F")))),n.a.createElement(he,null),n.a.createElement("aside",{className:"tc mb50 mt30"},n.a.createElement(v.a,{showQuickJumper:!0,hideOnSinglePage:!0,showSizeChanger:!1,onChange:Ri,current:st.page||1,defaultPageSize:20,total:Dt.work_count})))},Tt=Object(O.a)(function(Bn){var gn=Bn.shixunHomeworks,Tn=Bn.loading,_n=Bn.user;return{shixunHomeworks:gn,loading:Tn.effects,user:_n}})(Be),Jt=I("fOrg"),En=I("+KLJ"),mt=function(gn){var Tn,_n=gn.shixunHomeworks,si=gn.loading,ai=gn.dispatch,J=Object(w.i)(),ue=Object(a.useState)(Object(p.a)(Object(p.a)({},{page:1,limit:20,group_ids:[]}),J)),Ce=Object(r.a)(ue,2),Te=Ce[0],qe=Ce[1],Oe=Object(w.h)(),Ve=_n.codeReview,et=Object(a.useState)({}),Ot=Object(r.a)(et,2),Et=Ot[0],je=Ot[1],ht=mn.a.useForm(),it=Object(r.a)(ht,1),st=it[0];Te.order="code_rate",Te.sort="desc",Te.category=Te.categoryId,Object(a.useEffect)(function(){bt(),console.log("params",Te)},[Te]),Object(a.useEffect)(function(){_n.actionTabs.key==="\u6267\u884C\u4EE3\u7801\u67E5\u91CD"&&bt()},[_n.actionTabs.key]);var bt=function(){var on=Object(f.a)(o.a.mark(function Dn(){var Kn;return o.a.wrap(function(Nn){for(;;)switch(Nn.prev=Nn.next){case 0:return Nn.next=2,ai({type:"shixunHomeworks/getCodeReview",payload:Object(p.a)({},Te)});case 2:Kn=Nn.sent,Kn.status===-2&&setTimeout(function(){return bt()},1500);case 4:case"end":return Nn.stop()}},Dn)}));return function(){return on.apply(this,arguments)}}(),Lt=function(){},ct=function(Dn,Kn){Te.page=Dn,Te.limit=20,ai({type:"shixunHomeworks/getCodeReview",payload:Object(p.a)({},Te)})},Gt=[{title:"\u5E8F\u53F7",dataIndex:"number",render:function(Dn,Kn,wn){return Te.limit*(Te.page-1)+wn+1}},{title:"\u59D3\u540D",dataIndex:"username"},{title:"\u5B66\u53F7",dataIndex:"student_id"},{title:"\u76F8\u4F3C\u5EA6",dataIndex:"code_rate",render:function(Dn){return n.a.createElement("span",{className:"c-orange"},Dn)}},{title:"\u64CD\u4F5C",dataInex:"action",render:function(Dn,Kn){return n.a.createElement("div",null,n.a.createElement(x.a,{target:"_blank",to:"/classrooms/".concat(Te.coursesId,"/program_homework/").concat(Te.categoryId,"/review_detail/").concat(Kn.user_id)},"\u67E5\u770B"),n.a.createElement("br",null))}}];return n.a.createElement("section",{className:"minH500 bg-white pl30 pr30 pt10"},(Ve==null?void 0:Ve.status)===-2&&n.a.createElement(En.a,{message:"\u67E5\u91CD\u8FDB\u884C\u4E2D\uFF0C\u8BF7\u7A0D\u5019\u2026\u2026",className:"mb10 font14",type:"error"}),n.a.createElement(ze.a,null,n.a.createElement(Ze.a,{flex:"1"},n.a.createElement("p",{className:"mt10"},"\u67E5\u91CD\u65F6\u95F4\uFF1A",Ve.last_review_time,n.a.createElement(D.a,{ghost:!0,danger:!0,style:{color:"#29BD8B",borderColor:"#29BD8B",marginLeft:10},onClick:function(){ai({type:"shixunHomeworks/setActionTabs",payload:{key:"\u4EE3\u7801\u67E5\u91CD",params:Te}})}},"\u4EE3\u7801\u67E5\u91CD"))),n.a.createElement(Ze.a,null,n.a.createElement(jt.a.Search,{allowClear:!0,placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D\u6216\u8005\u5B66\u53F7\u641C\u7D22",onSearch:function(Dn){Te.search=Dn,ai({type:"shixunHomeworks/getCodeReview",payload:Te})},style:{width:200}}),n.a.createElement("span",{className:"ml5 c-red"}))),((Tn=Ve.group_info)===null||Tn===void 0?void 0:Tn.length)>0&&n.a.createElement(n.a.Fragment,null,n.a.createElement(ze.a,null,n.a.createElement(Ze.a,{flex:"80px",className:"font14"},"\u5206\u73ED\u60C5\u51B5:"),n.a.createElement(Ze.a,{flex:"80px"},n.a.createElement(dt.a,{checked:Te.group_ids=="",value:"all",onChange:function(Dn){delete Te.group_ids,Te.group_ids=[],Te.page=1,qe(Object(p.a)({},Te))}},"\u5168\u90E8")),n.a.createElement(Ze.a,{flex:"1"},Ve.group_info&&Ve.group_info.map(function(on,Dn){return n.a.createElement(dt.a,{style:{marginLeft:0},value:on.id,checked:Te.group_ids.includes(on.id),onChange:function(wn){wn.target.checked?Te.group_ids.push(on.id):Te.group_ids.splice(Te.group_ids.indexOf(on.id),1),Te.page=1,qe(Object(p.a)({},Te))}},on.name,"(",on.members_count,")")}))),n.a.createElement(ze.a,{className:"font14 c-red mt5"},n.a.createElement(Ze.a,null,"\u672C\u9875\u4EC5\u663E\u793A\u5168\u90E8\u5DF2\u67E5\u91CD\u5206\u73ED"))),n.a.createElement("p",{className:"mt10"},n.a.createElement("span",{className:"c-red"},Ve.copy_reviews_count),"\u4E2A\u7591\u4F3C\u6284\u88AD\u4F5C\u54C1\uFF08",Ve.all_reviews_count,"\u4F5C\u54C1\uFF09"),n.a.createElement(Y.a,{className:"mt30",loading:si["shixunHomeworks/getCodeReview"],pagination:!1,dataSource:Ve.users_reviews,columns:Gt,onChange:function(Dn,Kn,wn){wn.order==="ascend"&&(Te.b_order="asc"),wn.order==="descend"&&(Te.b_order="desc"),wn.order||delete Te.b_order,ai({type:"shixunHomeworks/getCodeReview",payload:Object(p.a)({},Te)})}}),n.a.createElement("aside",{className:"tc mb50 mt30"},n.a.createElement(v.a,{showSizeChanger:!1,onChange:ct,defaultCurrent:Te.page||1,current:Te.page||1,defaultPageSize:20,hideOnSinglePage:!0,total:Ve.copy_reviews_count})))},Qt=Object(O.a)(function(Bn){var gn=Bn.shixunHomeworks,Tn=Bn.loading;return{shixunHomeworks:gn,loading:Tn.effects}})(mt),gt=I("OaEy"),yt=I("2fM7"),rt=I("iQDF"),ce=I("+eQT"),Re=I("/MfK"),At=I("w5pM"),ot=I("Lyp1"),Yt=I("LvDl"),rn=I("xb3X"),_e=I.n(rn),Ne=I("AHFd"),xt=I("eozf"),Xt=ce.a.RangePicker,vn=yt.a.Option,Mn=function(gn){var Tn,_n,si,ai,J,ue,Ce,Te,qe,Oe,Ve=gn.shixunHomeworks,et=gn.loading,Ot=gn.dispatch,Et=Object(w.i)(),je=Ve.workSetting,ht=Ve.workList,it=Ve.changeData,st=Object(a.useState)(!0),bt=Object(r.a)(st,2),Lt=bt[0],ct=bt[1],Gt=Object(a.useState)(!1),on=Object(r.a)(Gt,2),Dn=on[0],Kn=on[1],wn=Object(a.useState)([]),Nn=Object(r.a)(wn,2),Pn=Nn[0],Dt=Nn[1],sn=Object(a.useState)([]),Ft=Object(r.a)(sn,2),St=Ft[0],Un=Ft[1],Sn=Object(a.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_minus_score:0,penalty_type:Ne.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,send_type:void 0,difficult_count:[],difficult_settings:[],late_penalty:0}),zt=Object(r.a)(Sn,2),lt=zt[0],jn=zt[1];Object(a.useEffect)(function(){return ln(),function(){Dt([].concat())}},[]);var ln=function(){Ot({type:"shixunHomeworks/getWorkSetting",payload:Object(p.a)({},Et)})};Object(a.useEffect)(function(){var Rt;if(!(je!=null&&je.course_id))return;Object.keys(lt).map(function(Xe){lt[Xe]=je[Xe]}),(!lt.allow_late||!lt.unified_late)&&(lt.late_minus_score=20,lt.penalty_type=Ne.a.Percent),lt.unified_setting||(lt.unified_late=!1,lt.unified_anonymous_comment=!1,lt.unified_anonymous_appeal=!1),Pn=JSON.parse(JSON.stringify(je.group_settings.map(function(Xe){return Object(p.a)(Object(p.a)({},Xe),{},{group_name:[Xe.group_name]})}).filter(function(Xe){return Xe.publish_time!==null}))),St=JSON.parse(JSON.stringify(je.allow_late_settings.map(function(Xe){return Object(p.a)(Object(p.a)({},Xe),{},{group_name:[Xe.group_name]})}).filter(function(Xe){return Xe.late_time!==null}))),lt.difficult_settings.length===0&&(lt.difficult_settings=[0,0,0]),jn(Object(p.a)({},lt)),Dt(Object(xe.a)(Pn)),((Rt=St)===null||Rt===void 0?void 0:Rt.length)<=0?Un([{late_minus_score:20}]):Un(Object(xe.a)(St))},[je]);var Jn=function(){var Xe,kt=JSON.parse(JSON.stringify(lt));if(kt.categoryId=Et.categoryId,lt.unified_setting||(Pn=(Xe=Pn)===null||Xe===void 0?void 0:Xe.map(function(an){var zn;if(!an.publish_time||!an.end_time)throw m.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(!an.group_name)throw m.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return an.group_name=typeof(an==null?void 0:an.group_name)=="string"?[an==null?void 0:an.group_name]:an==null?void 0:an.group_name,an.group_id=(zn=je.group_settings)===null||zn===void 0?void 0:zn.filter(function(Ln){var oi;return an==null||((oi=an.group_name)===null||oi===void 0)?void 0:oi.includes(Ln.group_name)}).map(function(Ln){return Ln.group_id||Ln.id}).toString().split(","),an})),kt.group_settings=Pn,lt.allow_late)if(lt.unified_late){if(lt.late_minus_score===null||lt.late_minus_score===void 0||lt.late_minus_score<0||lt.late_minus_score>100)throw m.b.error("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100"),new String("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100");if(!lt.late_time)throw m.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 Pt;St=(Pt=St)===null||Pt===void 0?void 0:Pt.map(function(an){var zn,Ln;if(an.late_minus_score===null||an.late_minus_score===void 0||an.late_minus_score<0||an.late_minus_score>100)throw m.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(!an.late_time)throw m.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(!an.group_name)throw m.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return an.group_name=typeof(an==null?void 0:an.group_name)=="string"?[an==null?void 0:an.group_name]:an==null?void 0:an.group_name,an.group_id=an==null||((zn=an.group_name)===null||zn===void 0||((Ln=zn.map(function(oi){var ei,Oi,mi=(ei=je.group_settings)===null||ei===void 0||((Oi=ei.filter(function(bi){return(bi==null?void 0:bi.group_name)===oi}))===null||Oi===void 0)?void 0:Oi[0];return mi==null?void 0:mi.group_id}))===null||Ln===void 0))?void 0:Ln.toString().split(","),an}),kt.allow_late_settings=St}kt.send_type===1&&(kt.difficult_settings=kt.difficult_settings.map(function(an){return an||0})),$t(kt)},$t=function(Xe){var kt;if(Xe.total_score===null){m.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}if(Xe!=null&&Xe.work_efficiency&&Xe.eff_score===null){m.b.warn("\u6548\u7387\u5206\u4E0D\u80FD\u4E3A\u7A7A");return}var Pt={shixun_evaluation:Xe.shixun_evaluation,challenge_settings:Xe.challenge_settings},an=function(){var zn=Object(f.a)(o.a.mark(function Ln(){var oi;return o.a.wrap(function(Oi){for(;;)switch(Oi.prev=Oi.next){case 0:return Kn(!0),Oi.next=3,Object(R.a)("/api/homework_commons/".concat(Et.categoryId,"/publish_setting.json"),{method:"post",body:Object(p.a)({},Xe)});case 3:oi=Oi.sent,oi.status===0&&(m.b.success("\u66F4\u65B0\u6210\u529F"),ct(!0),ln(),Ot({type:"shixunHomeworks/getWorkList",payload:Object(p.a)({},Et)})),Kn(!1);case 6:case"end":return Oi.stop()}},Ln)}));return function(){return zn.apply(this,arguments)}}();!Object(Yt.isEqual)(it,Pt)&&!(ht!=null&&(kt=ht.homework_status)!==null&&kt!==void 0&&kt.includes("\u672A\u53D1\u5E03"))?s.a.confirm({title:"\u66F4\u65B0\u6210\u7EE9",content:"\u60A8\u6539\u52A8\u4E86\u672C\u6B21\u4F5C\u4E1A\u7684\u5173\u5361\u5F97\u5206\u8BBE\u7F6E\uFF0C\u8FD9\u53EF\u80FD\u5BFC\u81F4\u5DF2\u5B8C\u6210\u4F5C\u4E1A\u7684\u5B66\u751F\u7684\u6210\u7EE9\u4EA7\u751F\u9519\u8BEF\u3002\u70B9\u51FB\u201C\u786E\u5B9A\u201D\u6309\u94AE\u5C06\u4FDD\u5B58\u6700\u65B0\u8BBE\u7F6E\u5E76\u6309\u6700\u65B0\u8BBE\u7F6E\u66F4\u65B0\u5168\u73ED\u6210\u7EE9\u3002",okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:an}):an()},On=function(Xe,kt){var Pt,an=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"group_id";return kt?kt.find(function(zn){return zn[an]===Xe}):je==null||((Pt=je.group_settings)===null||Pt===void 0)?void 0:Pt.find(function(zn){return zn.group_id[0]===Xe})},Fn=(je==null?void 0:je.allow_late)||(je==null?void 0:je.anonymous_comment),hn=function(Xe){var kt=On(Xe,je==null?void 0:je.allow_late_settings,"id"),Pt=On(Xe,je==null?void 0:je.anonymous_comment_settings);return(je==null?void 0:je.allow_late)&&kt&&(kt==null?void 0:kt.late_time)!==null||(je==null?void 0:je.anonymous_comment)&&Pt&&(Pt==null?void 0:Pt.evaluation_start)!==null},yi=Object(a.useMemo)(function(){var Rt;if(je!=null&&je.unified_setting){var Xe;return!(ht!=null&&(Xe=ht.homework_status)!==null&&Xe!==void 0&&Xe.includes("\u5DF2\u622A\u6B62"))||(je==null?void 0:je.allow_late)||(je==null?void 0:je.anonymous_comment)}var kt=je==null||((Rt=je.group_settings)===null||Rt===void 0)?void 0:Rt.some(function(Pt){return G()(Pt.end_time)<=G()()});return!kt||(je==null?void 0:je.allow_late)||(je==null?void 0:je.all_group_late)},[je,ht]),Rn=je==null?void 0:je.anonymous_comment,bn=function(Xe){if(!Xe)return!1;var kt=On(Xe,je==null?void 0:je.anonymous_comment_settings);return(je==null?void 0:je.anonymous_comment)&&kt&&(kt==null?void 0:kt.evaluation_start)!==null};return n.a.createElement("section",{className:_e.a.form},n.a.createElement(ze.a,{align:"middle"},n.a.createElement(Ze.a,{flex:"1"},n.a.createElement("div",{className:_e.a.title},"\u8BD5\u9898\u53D1\u5E03")),n.a.createElement(Ze.a,null,Object(V.c)()&&n.a.createElement(D.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return ct(!1)}},"\u7F16\u8F91\u8BBE\u7F6E"))),n.a.createElement("div",{className:"mt10"},n.a.createElement("label",{className:"mr20"},"\u53D1\u5E03\u65B9\u5F0F")," ",n.a.createElement(be.a.Group,{disabled:Lt||!(ht!=null&&(Tn=ht.homework_status)!==null&&Tn!==void 0&&Tn.includes("\u672A\u53D1\u5E03")),value:lt.send_type,onChange:function(Xe){lt.send_type=Xe.target.value,jn(Object.assign({},lt))}},n.a.createElement(be.a,{value:0},"\u5168\u90E8\u56FA\u5B9A\u8BD5\u9898"),n.a.createElement(be.a,{className:"ml20",value:1},"\u968F\u673A\u62BD\u9898")),lt.send_type===1&&n.a.createElement(ze.a,{className:"mt20",style:{marginLeft:94}},n.a.createElement(Ze.a,null,"\u7B80\u5355\u9898\u6570",n.a.createElement(Je.a,{precision:0,disabled:Lt||!(ht!=null&&(_n=ht.homework_status)!==null&&_n!==void 0&&_n.includes("\u672A\u53D1\u5E03")),placeholder:"\u6700\u5927".concat(lt.difficult_count[0]||0),min:0,max:lt.difficult_count[0]||0,value:lt.difficult_settings[0],onChange:function(Xe){lt.difficult_settings[0]=Xe,jn(Object.assign({},lt))},className:"ml10 mr20"})),n.a.createElement(Ze.a,null,"\u9002\u4E2D\u9898\u6570",n.a.createElement(Je.a,{precision:0,disabled:Lt||!(ht!=null&&(si=ht.homework_status)!==null&&si!==void 0&&si.includes("\u672A\u53D1\u5E03")),placeholder:"\u6700\u5927".concat(lt.difficult_count[1]||0),min:0,max:lt.difficult_count[1]||0,value:lt.difficult_settings[1],onChange:function(Xe){lt.difficult_settings[1]=Xe,jn(Object.assign({},lt))},className:"ml10 mr20"})),n.a.createElement(Ze.a,null,"\u56F0\u96BE\u9898\u6570",n.a.createElement(Je.a,{precision:0,disabled:Lt||!(ht!=null&&(ai=ht.homework_status)!==null&&ai!==void 0&&ai.includes("\u672A\u53D1\u5E03")),placeholder:"\u6700\u5927".concat(lt.difficult_count[2]||0),min:0,max:lt.difficult_count[2]||0,value:lt.difficult_settings[2],onChange:function(Xe){lt.difficult_settings[2]=Xe,jn(Object.assign({},lt))},className:"ml10 mr20"})))),n.a.createElement("div",{className:"mt30"},n.a.createElement("h1",{className:"mb10"},"\u53D1\u5E03\u8BBE\u7F6E"),n.a.createElement("label",{className:"mr20"},"\u53D1\u5E03\u65B9\u5F0F")," ",n.a.createElement(be.a.Group,{disabled:Lt||!(ht!=null&&(J=ht.homework_status)!==null&&J!==void 0&&J.includes("\u672A\u53D1\u5E03")),value:lt.unified_setting,onChange:function(Xe){var kt;if(!(ht!=null&&(kt=ht.homework_status)!==null&&kt!==void 0&&kt.includes("\u672A\u53D1\u5E03"))){m.b.error("\u5DF2\u53D1\u5E03\uFF0C\u4E0D\u80FD\u518D\u4FEE\u6539\u7EDF\u4E00\u8BBE\u7F6E");return}if(lt.unified_setting=!lt.unified_setting,lt.unified_setting||(lt.unified_late=!1),jn(Object.assign({},lt)),lt.unified_setting===!1&&Pn==""){Dt(Pn.concat({}));return}lt.unified_setting&&(Dt([]),Un([{late_minus_score:5}]))}},n.a.createElement(be.a,{value:!0},"\u7EDF\u4E00\u53D1\u5E03"),n.a.createElement(be.a,{className:"ml20",disabled:(je==null||((ue=je.group_settings)===null||ue===void 0)?void 0:ue.length)===0,value:!1},"\u5206\u73ED\u53D1\u5E03")),(je==null||((Ce=je.group_settings)===null||Ce===void 0)?void 0:Ce.length)===0&&n.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")),lt.unified_setting&&n.a.createElement("div",{style:{marginLeft:50}},n.a.createElement(ze.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(Ze.a,null,"\u53D1\u5E03\u65F6\u95F4"),n.a.createElement(Ze.a,{className:"ml10"},n.a.createElement(ce.a,{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(Xe){return Object(xt.b)(Xe,je==null?void 0:je.course_end_date)},disabledTime:function(Xe){return Object(xt.c)(Xe)},disabled:Lt||!(ht!=null&&(Te=ht.homework_status)!==null&&Te!==void 0&&Te.includes("\u672A\u53D1\u5E03")),value:lt.publish_time?G()(lt.publish_time):"",onChange:function(Xe,kt){lt.publish_time=kt,(lt.end_time==""||!lt.end_time)&<.unified_setting&&(lt.end_time=G()(Xe).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),jn(Object.assign({},lt))}})),n.a.createElement(Ze.a,null,n.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u7684\u65F6\u95F4)"))),n.a.createElement(ze.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(Ze.a,null,"\u622A\u6B62\u65F6\u95F4"),n.a.createElement(Ze.a,{className:"ml10"},n.a.createElement(ce.a,{style:{width:170},allowClear:!1,placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:G()(Object(_.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:Lt||Fn,disabledDate:function(Xe){return Object(xt.b)(Xe,je==null?void 0:je.course_end_date,lt.publish_time)},disabledTime:function(Xe){return Object(xt.c)(Xe,lt.publish_time)},value:lt.end_time?G()(lt.end_time):"",onChange:function(Xe,kt){lt.end_time=kt,jn(Object.assign({},lt))}})),n.a.createElement(Ze.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)")))),!lt.unified_setting&&((qe=Pn)===null||qe===void 0?void 0:qe.length)>0&&n.a.createElement(ze.a,{style:{marginTop:30,paddingTop:20,marginLeft:80,borderTop:"1px solid #eee"}},n.a.createElement(Ze.a,{span:24},n.a.createElement(ze.a,null,n.a.createElement(Ze.a,{span:10}),n.a.createElement(Ze.a,{span:10},n.a.createElement(ze.a,{className:"c-grey-c ml30"},n.a.createElement(Ze.a,{flex:"1"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u65F6\u95F4)"),n.a.createElement(Ze.a,{flex:"1"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u65F6\u95F4\u622A\u70B9)"))),n.a.createElement(Ze.a,{span:4}))),Pn&&Pn.map(function(Rt,Xe){var kt,Pt,an,zn,Ln;return n.a.createElement(Ze.a,{span:24,key:Xe},n.a.createElement(ze.a,{gutter:[8,16]},n.a.createElement(Ze.a,{span:10},n.a.createElement(ze.a,{gutter:[8,16]},n.a.createElement(Ze.a,null,"\u53D1\u5E03\u89C4\u5219 ",Xe+1),n.a.createElement(Ze.a,{flex:"1",style:{maxWidth:300}},n.a.createElement(yt.a,{disabled:Lt||!(ht!=null&&(kt=ht.homework_status)!==null&&kt!==void 0&&kt.includes("\u672A\u53D1\u5E03"))&&Rt.id,className:"ml20",mode:"multiple",style:{width:"100%"},value:Rt.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(ei){Pn[Xe].group_name=ei,Pn[Xe].group_id=Rt.group_id;var Oi=Object(Yt.flattenDeep)(Pn.map(function(bi){return bi.group_name})),mi=St.map(function(bi){var Ji=(bi==null?void 0:bi.group_name)||[];return Object(p.a)(Object(p.a)({},bi),{},{group_name:Object(Yt.remove)(Ji,function(Vi){return Oi.includes(Vi)})})});Un(mi),Dt(Pn.slice())}},je.group_settings&&je.group_settings.map(function(oi){if(!Pn.map(function(ei){return ei.group_name}).toString().split(",").includes(String(oi.group_name)))return n.a.createElement(vn,{value:oi.group_name,key:oi.id},oi.group_name)}))))),n.a.createElement(Ze.a,{span:10},n.a.createElement("div",{className:"ml30"},n.a.createElement(Xt,{allowClear:!1,ranges:{\u6B64\u523B:[Rt.publish_time?G()(Rt.publish_time):G()(),G()()]},disabled:Lt||(G()()<=G()((Pt=On((an=Rt.group_id)===null||an===void 0?void 0:an[0]))===null||Pt===void 0?void 0:Pt.publish_time)?!1:[!0,hn((zn=Rt.group_id)===null||zn===void 0?void 0:zn[0])]),style:{width:400},placeholder:["\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4","\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4"],disabledDate:function(ei){return Object(xt.b)(ei,je==null?void 0:je.course_end_date)},disabledTime:function(ei){return Object(xt.c)(ei)},showTime:{format:"HH:mm",defaultValue:[G()(Object(_.d)(),"HH:mm"),G()(Object(_.d)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:Rt.publish_time&&[G()(Rt.publish_time),Rt.end_time?G()(Rt.end_time):void 0],onChange:function(ei,Oi){Pn[Xe].publish_time=Oi[0],Pn[Xe].end_time=Oi[1],Dt(Object(xe.a)(Pn))}}))),!Lt&&n.a.createElement(Ze.a,{span:4},Xe>0&&!Rt.id&&n.a.createElement(Re.a,{onClick:function(){Pn=Pn.filter(function(ei,Oi){return Xe!==Oi}),Dt(Pn.slice()),setTimeout(function(){return Dt(Pn.slice())},10)}}),Pn.length<(je==null||((Ln=je.group_settings)===null||Ln===void 0)?void 0:Ln.length)&&n.a.createElement(At.a,{className:"c-green ml20",onClick:function(){Dt(Pn.concat({}))}}))))})),n.a.createElement(ze.a,{className:"mt30"},n.a.createElement(Ze.a,null,n.a.createElement(ze.a,{align:"middle"},n.a.createElement("h1",{style:{marginBottom:0}},"\u8865\u4EA4\u8BBE\u7F6E"),n.a.createElement(M.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(ot.a,{style:{marginLeft:4,cursor:"pointer"}})))),n.a.createElement(Ze.a,{span:24,className:"mt10"},n.a.createElement(dt.a,{checked:lt.allow_late,disabled:Lt||yi,onChange:function(){lt.allow_late=!lt.allow_late,St==""&&Un([{late_minus_score:5}]),jn(Object.assign({},lt))}},n.a.createElement("span",null,"\u5F00\u542F\u8865\u4EA4")),n.a.createElement(M.a,{overlayStyle:{width:380,maxWidth:380},title:n.a.createElement("div",{style:{display:"flex",flexFlow:"column"}},n.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219\u8BF4\u660E"),n.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"),n.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"))},n.a.createElement(ot.a,null)))),(lt==null?void 0:lt.allow_late)&&n.a.createElement("div",{style:{marginLeft:50}},n.a.createElement("div",{className:"ml30 mt20",style:{marginLeft:50}},n.a.createElement("span",null,"\u8865\u4EA4\u65B9\u5F0F\uFF1A"),n.a.createElement(be.a.Group,{disabled:Lt||(je==null?void 0:je.anonymous_comment)||(je==null?void 0:je.allow_late),value:lt.unified_late,onChange:function(Xe){lt.unified_late=Xe.target.value,St==""&&!Xe.target.value&&Un([{late_minus_score:5}]),jn(Object(p.a)({},lt))}},(lt==null?void 0:lt.unified_setting)&&n.a.createElement(be.a,{value:!0}," \u7EDF\u4E00\u8865\u4EA4 "),(je==null||((Oe=je.group_settings)===null||Oe===void 0)?void 0:Oe.length)&&n.a.createElement(be.a,{value:!1}," \u5206\u73ED\u8865\u4EA4 "))),lt!=null&<.unified_late?n.a.createElement(n.a.Fragment,null,n.a.createElement(ze.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(Ze.a,null,"\u8865\u4EA4\u6263\u5206:"),n.a.createElement(Ze.a,{className:"ml5"},n.a.createElement(Ne.b,{disabled:Lt||Rn,value:{type:lt.penalty_type,inputValue:lt.late_minus_score},onChange:function(Xe){jn(Object(p.a)(Object(p.a)({},lt),{},{late_minus_score:Xe.inputValue,penalty_type:Xe.type}))}})),n.a.createElement(Ze.a,{flex:"1",className:"ml5"},n.a.createElement("span",{className:"c-grey-c ml10"},lt.penalty_type===Ne.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)"))),n.a.createElement(ze.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(Ze.a,null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4:"),n.a.createElement(Ze.a,{className:"ml5"},n.a.createElement(ce.a,{allowClear:!1,style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:G()(Object(_.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:Lt||Rn,value:lt.late_time?G()(lt.late_time):"",disabledDate:function(Xe){return Object(xt.b)(Xe,je==null?void 0:je.course_end_date)},disabledTime:function(Xe){return Object(xt.c)(Xe)},onChange:function(Xe,kt){lt.late_time=kt,jn(Object.assign({},lt))}})),n.a.createElement(Ze.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)")))):St.map(function(Rt,Xe){var kt;return n.a.createElement(Ze.a,{span:24,key:Xe},n.a.createElement(ze.a,{className:"mt25"},n.a.createElement(Ze.a,{style:{marginLeft:30}},n.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219",Xe+1,"\uFF1A"),n.a.createElement(yt.a,{disabled:Lt||!(ht!=null&&(kt=ht.homework_status)!==null&&kt!==void 0&&kt.includes("\u672A\u53D1\u5E03"))&&Rt.id||(je==null?void 0:je.anonymous_comment),mode:"multiple",style:{width:306},value:typeof Rt.group_name=="string"?[Rt.group_name]:Rt.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(an){St[Xe].group_name=an,St[Xe].group_id=Rt.group_id,Un(St.slice())}},je.group_settings&&je.group_settings.map(function(Pt){if(lt!=null&<.unified_setting&&!St.map(function(an){return an.group_name}).toString().split(",").includes(String(Pt.group_name)))return n.a.createElement(vn,{value:Pt.group_name,key:Pt.id},Pt.group_name);if(Pn.map(function(an){return an.group_name}).toString().split(",").includes(String(Pt.group_name))&&(!St.map(function(an){return an.group_name}).toString().split(",").includes(String(Pt.group_name))&&G()(Pt.end_time)<=G()()))return n.a.createElement(vn,{value:Pt.group_name,key:Pt.id},Pt.group_name)}))),n.a.createElement(Ze.a,{className:"ml20"},n.a.createElement("span",null,"\u8865\u4EA4\u6263\u5206\uFF1A"),n.a.createElement(Ne.b,{disabled:Lt||bn(Rt.id),value:{type:Rt.penalty_type,inputValue:Rt.late_minus_score},onChange:function(an){St[Xe].late_minus_score=an.inputValue,St[Xe].penalty_type=an.type,Un(Object(xe.a)(St))}})),n.a.createElement(Ze.a,{className:"ml20"},n.a.createElement("span",null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4\uFF1A"),n.a.createElement(ce.a,{disabled:Lt||bn(Rt.id),style:{width:200},showTime:{format:"HH:mm",defaultValue:G()(Object(_.d)(),"HH:mm")},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",disabledDate:function(an){return Object(xt.b)(an,je==null?void 0:je.course_end_date)},disabledTime:function(an){return Object(xt.c)(an)},format:"YYYY-MM-DD HH:mm",value:Rt!=null&&Rt.late_time?G()(Rt.late_time):void 0,onChange:function(an,zn){St[Xe].late_time=zn,Un(Object(xe.a)(St))}})),!Lt&&n.a.createElement(Ze.a,{className:"ml20"},Xe>0&&!Rt.id&&n.a.createElement(Re.a,{onClick:function(){St=St.filter(function(an,zn){return Xe!==zn}),Un(St.slice()),setTimeout(function(){return Un(St.slice())},10)}}),n.a.createElement(At.a,{className:"c-green ml20",onClick:function(){Un(St.concat({penalty_type:Ne.a.Percent,late_minus_score:20}))}}))))})),n.a.createElement("div",{style:{height:100}}),!Lt&&n.a.createElement("div",{className:_e.a.btns},n.a.createElement(D.a,{type:"primary",loading:Dn,onClick:function(){return Jn()}},"\u63D0\u4EA4"),n.a.createElement(D.a,{type:"primary",ghost:!0,className:"ml20",onClick:function(){ct(!0),ln()}},"\u53D6\u6D88")))},ci=Object(O.a)(function(Bn){var gn=Bn.shixunHomeworks,Tn=Bn.loading;return{shixunHomeworks:gn,loading:Tn.effects}})(Mn);function $n(Bn,gn){for(var Tn=[],_n=Bn;_n<gn;_n++)Tn.push(_n);return Tn}var Cn=function(gn){var Tn=new Date,_n=G()(gn).format("HH");if(G()(gn).isSame(G()(Tn),"day")){var si=G()(Tn).format("HH"),ai=G()(Tn).format("mm");return{disabledHours:function(){return $n(0,24).splice(1,si*1-1)},disabledMinutes:function(){return console.log("\u7981\u6B62\u65F6\u95F4\uFF1A",_n,si),G()(gn).isSame(G()(Tn),"hour")&&_n<=si?$n(0,60).splice(0,ai):$n(60,60)}}}else if(G()(gn).isSame(G()(),"day")){var J=G()().format("HH"),ue=G()().format("mm");return{disabledHours:function(){return $n(0,24).splice(0,J)},disabledMinutes:function(){return _n<=J?$n(0,ue):$n(60,60)}}}else return},Ti=ce.a.RangePicker,Wi=yt.a.Option,hi=function(gn){var Tn,_n=gn.shixunHomeworks,si=gn.loading,ai=gn.dispatch,J=Object(w.i)(),ue=Object(w.h)(),Ce=_n.workSetting,Te=_n.workList,qe=_n.changeData,Oe=Object(a.useState)(!0),Ve=Object(r.a)(Oe,2),et=Ve[0],Ot=Ve[1],Et=Object(a.useState)({}),je=Object(r.a)(Et,2),ht=je[0],it=je[1],st=Object(a.useState)(!1),bt=Object(r.a)(st,2),Lt=bt[0],ct=bt[1],Gt=mn.a.useForm(),on=Object(r.a)(Gt,1),Dn=on[0],Kn=Object(a.useState)([]),wn=Object(r.a)(Kn,2),Nn=wn[0],Pn=wn[1],Dt=Object(a.useState)([]),sn=Object(r.a)(Dt,2),Ft=sn[0],St=sn[1],Un=Object(a.useState)(!1),Sn=Object(r.a)(Un,2),zt=Sn[0],lt=Sn[1],jn=Object(a.useState)([]),ln=Object(r.a)(jn,2),Jn=ln[0],$t=ln[1],On=Object(a.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_penalty:0,challenge_settings:[],work_efficiency:!1,shixun_evaluation:"",answer_open_evaluation:!1,answer_public:!1,score_open:!1,open_code:!1,rank_forbidden:!1,open_code_type:void 0,comment_public:!0,total_score:"",eff_score:0,rank_forbidden_start:"",rank_forbidden_end:""}),Fn=Object(r.a)(On,2),hn=Fn[0],yi=Fn[1];Object(a.useEffect)(function(){return Rn(),function(){Pn([].concat())}},[]);var Rn=function(){ai({type:"shixunHomeworks/getWorkSetting",payload:Object(p.a)({},J)})},bn=function(Pt){return Pt&&Pt<G()().startOf("day")};Object(a.useEffect)(function(){var kt;if(!(Ce!=null&&Ce.course_id))return;Object.keys(hn).map(function(Pt){hn[Pt]=Ce[Pt]}),(!hn.allow_late||!hn.unified_late)&&(hn.late_penalty=5),Nn=JSON.parse(JSON.stringify(Ce.group_settings.map(function(Pt){return Object(p.a)(Object(p.a)({},Pt),{},{group_name:[Pt.group_name]})}).filter(function(Pt){return Pt.publish_time!==null}))),Ft=JSON.parse(JSON.stringify(Ce.allow_late_settings.map(function(Pt){return Object(p.a)(Object(p.a)({},Pt),{},{group_name:[Pt.group_name]})}).filter(function(Pt){return Pt.rank_forbidden_start!==null}))),yi(Object(p.a)({},hn)),Pn(Object(xe.a)(Nn)),((kt=Ft)===null||kt===void 0?void 0:kt.length)<=0?St([{}]):St(Object(xe.a)(Ft))},[Ce]),console.log(hn,"data");var Rt=function(){var Pt,an=JSON.parse(JSON.stringify(hn));if(an.categoryId=J.categoryId,hn.unified_setting||(Nn=(Pt=Nn)===null||Pt===void 0?void 0:Pt.map(function(Ln){var oi;if(!Ln.publish_time||!Ln.end_time)throw m.b.error("\u8BF7\u628A\u5F00\u59CB\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u5F00\u59CB\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!Ln.group_name)throw m.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return Ln.group_name=typeof(Ln==null?void 0:Ln.group_name)=="string"?[Ln==null?void 0:Ln.group_name]:Ln==null?void 0:Ln.group_name,Ln.group_id=(oi=Ce.group_settings)===null||oi===void 0?void 0:oi.filter(function(ei){var Oi;return Ln==null||((Oi=Ln.group_name)===null||Oi===void 0)?void 0:Oi.includes(ei.group_name)}).map(function(ei){return ei.group_id||ei.id}).toString().split(","),Ln})),an.group_settings=Nn,hn.rank_forbidden)if(hn.unified_setting){if(!hn.rank_forbidden_start)throw m.b.error("\u8BF7\u628A\u5F00\u59CB\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u5F00\u59CB\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!hn.rank_forbidden_end)throw m.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(G()(hn.rank_forbidden_end)<G()(hn.rank_forbidden_start))throw m.b.error("\u622A\u6B62\u65F6\u95F4\u4E0D\u80FD\u65E9\u4E8E\u5F00\u59CB\u65F6\u95F4"),new String("\u622A\u6B62\u65F6\u95F4\u4E0D\u80FD\u65E9\u4E8E\u5F00\u59CB\u65F6\u95F4")}else{var zn;Ft=(zn=Ft)===null||zn===void 0?void 0:zn.map(function(Ln){var oi,ei;if(!Ln.rank_forbidden_start)throw m.b.error("\u8BF7\u628A\u5F00\u59CB\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u5F00\u59CB\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!Ln.rank_forbidden_end)throw m.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(!Ln.group_name)throw m.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return Ln.group_name=typeof(Ln==null?void 0:Ln.group_name)=="string"?[Ln==null?void 0:Ln.group_name]:Ln==null?void 0:Ln.group_name,Ln.group_id=Ln==null||((oi=Ln.group_name)===null||oi===void 0||((ei=oi.map(function(Oi){var mi,bi,Ji=(mi=Ce.group_settings)===null||mi===void 0||((bi=mi.filter(function(Vi){return(Vi==null?void 0:Vi.group_name)===Oi}))===null||bi===void 0)?void 0:bi[0];return Ji==null?void 0:Ji.group_id}))===null||ei===void 0))?void 0:ei.toString().split(","),Ln}),an.group_settingss=Ft}Xe(an)},Xe=function(Pt){if(console.log(Pt.total_score,Pt.eff_score),Pt.total_score===null){m.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}if(Pt!=null&&Pt.work_efficiency&&Pt.eff_score===null){m.b.warn("\u6548\u7387\u5206\u4E0D\u80FD\u4E3A\u7A7A");return}var an={shixun_evaluation:Pt.shixun_evaluation},zn=function(){var Ln=Object(f.a)(o.a.mark(function oi(){var ei;return o.a.wrap(function(mi){for(;;)switch(mi.prev=mi.next){case 0:return ct(!0),mi.next=3,Object(R.a)("/api/homework_commons/".concat(J.categoryId,"/public_setting.json"),{method:"post",body:Object(p.a)({},Pt)});case 3:ei=mi.sent,ei.status===0&&(m.b.success("\u66F4\u65B0\u6210\u529F"),Ot(!0),Rn(),ai({type:"shixunHomeworks/getWorkList",payload:Object(p.a)({},J)})),ct(!1);case 6:case"end":return mi.stop()}},oi)}));return function(){return Ln.apply(this,arguments)}}();zn()};return n.a.createElement("section",{className:_e.a.form},n.a.createElement(ze.a,{align:"middle"},n.a.createElement(Ze.a,{flex:"1"},n.a.createElement("div",{className:_e.a.title},"\u516C\u5F00\u8BBE\u7F6E")),n.a.createElement(Ze.a,null,(Ce==null?void 0:Ce.can_edit)&&n.a.createElement(D.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return Ot(!1)}},"\u7F16\u8F91\u8BBE\u7F6E"))),n.a.createElement(ze.a,null,n.a.createElement(Ze.a,{span:24,className:"mt15 mt20"},n.a.createElement(dt.a,{checked:hn.score_open,disabled:et,onChange:function(Pt){hn.score_open=Pt.target.checked,yi(Object.assign({},hn))}},n.a.createElement("span",{className:"font14"},"\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(Ze.a,{span:24,className:"mt15"},n.a.createElement(dt.a,{checked:hn.open_code,disabled:et,onChange:function(Pt){hn.open_code=Pt.target.checked,yi(Object.assign({},hn))}},n.a.createElement("span",{className:"font14"},"\u516C\u5F00\u4EE3\u7801")),n.a.createElement("span",{className:"c-grey-c font12"},"(\u9009\u4E2D\uFF0C\u5B66\u751F\u53EF\u4EE5\u67E5\u770B\u5176\u4ED6\u5B66\u751F\u7684\u4EE3\u7801\u8BE6\u60C5)")),!!hn.open_code&&n.a.createElement(Ze.a,{span:24,className:"mt10 ml25"},n.a.createElement(be.a.Group,{disabled:et,value:hn.open_code_type,onChange:function(Pt){hn.open_code_type=Pt.target.value,yi(Object.assign({},hn))}},n.a.createElement(be.a,{value:0},"\u4EFB\u610F\u65F6\u95F4\u67E5\u770B"),n.a.createElement(be.a,{style:{marginLeft:60},value:1},"\u7EC3\u4E60\u65F6\u95F4\u7ED3\u675F\u540E"))),n.a.createElement(Ze.a,{span:24,className:"mt15 mt20"},n.a.createElement(dt.a,{checked:hn.rank_forbidden,disabled:et,onChange:function(Pt){hn.rank_forbidden=Pt.target.checked,yi(Object.assign({},hn))}},n.a.createElement("span",{className:"font14"},"\u5F00\u542F\u5C01\u699C")),n.a.createElement("span",{className:"c-grey-c font12"},"(\u9009\u4E2D\u5219\u5728\u8BBE\u7F6E\u7684\u8FD9\u6BB5\u65F6\u95F4\u5185\uFF0C\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u4FE1\u606F\uFF0C\u5176\u4ED6\u65F6\u95F4\u53EF\u4EE5\u67E5\u770B)")),!!hn.rank_forbidden&&hn.unified_setting&&n.a.createElement(Ze.a,{span:24,className:"mt10 "},n.a.createElement("div",{style:{marginLeft:50}},n.a.createElement(ze.a,{align:"middle",className:"mt25 "},n.a.createElement(Ze.a,null,"\u5F00\u59CB\u65F6\u95F4"),n.a.createElement(Ze.a,{className:"ml10"},n.a.createElement(ce.a,{style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u5F00\u59CB\u65F6\u95F4",showTime:{format:"HH:mm"},allowClear:!1,format:"YYYY-MM-DD HH:mm",disabledDate:bn,disabledTime:Cn,disabled:et||G()()>G()(Ce.rank_forbidden_start),value:hn.rank_forbidden_start?G()(hn.rank_forbidden_start):"",onChange:function(Pt,an){hn.rank_forbidden_start=an,(hn.end_time==""||!hn.end_time)&&hn.unified_setting&&(hn.end_time=G()(Pt).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),yi(Object.assign({},hn))}})),n.a.createElement(Ze.a,null,n.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u7684\u5F00\u59CB\u65F6\u95F4)"))),n.a.createElement(ze.a,{align:"middle",className:"mt25"},n.a.createElement(Ze.a,null,"\u622A\u6B62\u65F6\u95F4"),n.a.createElement(Ze.a,{className:"ml10"},n.a.createElement(ce.a,{style:{width:170},allowClear:!1,placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:G()(Object(_.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:et,disabledDate:bn,value:hn.rank_forbidden_end?G()(hn.rank_forbidden_end):"",onChange:function(Pt,an){hn.rank_forbidden_end=an,yi(Object.assign({},hn))}})),n.a.createElement(Ze.a,null,n.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u7684\u7ED3\u675F\u65F6\u95F4)"))))),console.log("----",Nn),!hn.unified_setting&&((Tn=Nn)===null||Tn===void 0?void 0:Tn.length)>0&&!!hn.rank_forbidden&&n.a.createElement(ze.a,{style:{marginTop:30,paddingTop:20,marginLeft:80,borderTop:"1px solid #eee"}},n.a.createElement(Ze.a,{span:24},n.a.createElement(ze.a,null,n.a.createElement(Ze.a,{span:10}),n.a.createElement(Ze.a,{span:10},n.a.createElement(ze.a,{className:"c-grey-c ml30"},n.a.createElement(Ze.a,{flex:"1"},"(\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u7684\u5F00\u59CB\u65F6\u95F4)"),n.a.createElement(Ze.a,{flex:"1"},"(\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u7684\u7ED3\u675F\u65F6\u95F4)"))),n.a.createElement(Ze.a,{span:4}))),Ft.map(function(kt,Pt){var an,zn,Ln,oi,ei,Oi,mi;return n.a.createElement(Ze.a,{span:24,key:Pt},n.a.createElement(ze.a,{className:"mt25"},n.a.createElement(Ze.a,{style:{marginLeft:30}},n.a.createElement("span",null,"\u5C01\u699C\u89C4\u5219",Pt+1,"\uFF1A"),n.a.createElement(yt.a,{disabled:et||!(Te!=null&&(an=Te.homework_status)!==null&&an!==void 0&&an.includes("\u672A\u53D1\u5E03"))&&kt.id,mode:"multiple",style:{width:306},value:typeof kt.group_name=="string"?[kt.group_name]:kt.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(Ji){Ft[Pt].group_name=Ji,Ft[Pt].group_id=kt.group_id,St(Ft.slice())}},Ce.group_settings&&Ce.group_settings.map(function(bi){if(hn!=null&&hn.unified_setting&&!Ft.map(function(Ji){return Ji.group_name}).toString().split(",").includes(String(bi.group_name)))return n.a.createElement(Wi,{value:bi.group_name,key:bi.id},bi.group_name);if(Nn.map(function(Ji){return Ji.group_name}).toString().split(",").includes(String(bi.group_name))&&!Ft.map(function(Ji){return Ji.group_name}).toString().split(",").includes(String(bi.group_name)))return n.a.createElement(Wi,{value:bi.group_name,key:bi.id},bi.group_name)}))),n.a.createElement(Ze.a,{span:10},n.a.createElement("div",{className:"ml30"},n.a.createElement(Ti,{allowClear:!1,disabled:et||(Ce!=null&&(zn=Ce.group_settings)!==null&&zn!==void 0&&(Ln=zn.filter(function(bi){return bi.id===kt.id}))!==null&&Ln!==void 0&&(oi=Ln[0])!==null&&oi!==void 0&&oi.rank_forbidden_start?G()()<G()(Ce==null||((ei=Ce.group_settings)===null||ei===void 0||((Oi=ei.filter(function(bi){return bi.id===kt.id}))===null||Oi===void 0||((mi=Oi[0])===null||mi===void 0)))?void 0:mi.rank_forbidden_start)?!1:[!0,!1]:!1),style:{width:400},placeholder:["\u8BF7\u9009\u62E9\u5F00\u59CB\u65F6\u95F4","\u8BF7\u9009\u62E9\u7ED3\u675F\u65F6\u95F4"],disabledDate:bn,disabledTime:Cn,showTime:{format:"HH:mm",defaultValue:[G()(Object(_.d)(),"HH:mm"),G()(Object(_.d)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:kt.rank_forbidden_start&&[G()(kt.rank_forbidden_start),kt.rank_forbidden_end?G()(kt.rank_forbidden_end):void 0],onChange:function(Ji,Vi){Ft[Pt].rank_forbidden_start=Vi[0],Ft[Pt].rank_forbidden_end=Vi[1],St(Object(xe.a)(Ft))}}))),!et&&n.a.createElement(Ze.a,{className:"ml20"},Pt>0&&!kt.id&&n.a.createElement(Re.a,{onClick:function(){Ft=Ft.filter(function(Ji,Vi){return Pt!==Vi}),St(Ft.slice()),setTimeout(function(){return St(Ft.slice())},10)}}),n.a.createElement(At.a,{className:"c-green ml20",onClick:function(){St(Ft.concat({}))}}))))})),!et&&n.a.createElement("div",{className:_e.a.btns},n.a.createElement(D.a,{type:"primary",loading:Lt,onClick:function(){return Rt()}},"\u63D0\u4EA4"),n.a.createElement(D.a,{type:"primary",ghost:!0,className:"ml20",onClick:function(){Ot(!0),Rn()}},"\u53D6\u6D88"))),n.a.createElement(s.a,{title:"\u6DFB\u52A0\u534F\u4F5C\u8005",visible:zt,onCancel:function(){return lt(!1)}},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(jt.a.Search,{onChange:function(Pt){}})),n.a.createElement(Y.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(Pt,an){$t(Pt)}},pagination:!1,dataSource:[{name:"1"}],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"}]}))))},fi=Object(O.a)(function(Bn){var gn=Bn.shixunHomeworks,Tn=Bn.loading;return{shixunHomeworks:gn,loading:Tn.effects}})(hi),ji=function(gn){var Tn,_n=gn.shixunHomeworks,si=gn.loading,ai=gn.dispatch,J=Object(w.i)(),ue=_n.workSetting,Ce=_n.workList,Te=_n.changeData,qe=Object(a.useState)(!0),Oe=Object(r.a)(qe,2),Ve=Oe[0],et=Oe[1],Ot=Object(a.useState)(!1),Et=Object(r.a)(Ot,2),je=Et[0],ht=Et[1],it=Object(a.useState)(!1),st=Object(r.a)(it,2),bt=st[0],Lt=st[1],ct=mn.a.useForm(),Gt=Object(r.a)(ct,1),on=Gt[0],Dn=Object(a.useState)([]),Kn=Object(r.a)(Dn,2),wn=Kn[0],Nn=Kn[1],Pn=Object(a.useState)([]),Dt=Object(r.a)(Pn,2),sn=Dt[0],Ft=Dt[1],St=!(Ce!=null&&(Tn=Ce.homework_status)!==null&&Tn!==void 0&&Tn.includes("\u672A\u53D1\u5E03")),Un=Object(a.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_penalty:0,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,is_onpage_time:!0,training_time_rules:1,hack_settings:[],punish_time:void 0,hack_score_settings:void 0}),Sn=Object(r.a)(Un,2),zt=Sn[0],lt=Sn[1];Object(a.useEffect)(function(){return jn(),function(){Nn([].concat())}},[]);var jn=function(){ai({type:"shixunHomeworks/getWorkSetting",payload:Object(p.a)({},J)})};Object(a.useEffect)(function(){if(!(ue!=null&&ue.course_id))return;Object.keys(zt).map(function(On){zt[On]=ue[On]}),(!zt.allow_late||!zt.unified_late)&&(zt.late_penalty=5),wn=JSON.parse(JSON.stringify(ue.group_settings.map(function(On){return Object(p.a)(Object(p.a)({},On),{},{group_name:[On.group_name]})}).filter(function(On){return On.publish_time!==null}))),sn=JSON.parse(JSON.stringify(ue.allow_late_settings.map(function(On){return Object(p.a)(Object(p.a)({},On),{},{group_name:[On.group_name]})}).filter(function(On){return On.late_time!==null}))),$t(),lt(Object(p.a)({},zt)),Nn(Object(xe.a)(wn)),Ft(Object(xe.a)(sn))},[ue]);var ln=function(){var Fn=JSON.parse(JSON.stringify(zt));Jn(Fn)},Jn=function(Fn){if(console.log(Fn.total_score,Fn.eff_score),Fn.total_score===null){m.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}var hn=function(){var yi=Object(f.a)(o.a.mark(function Rn(){var bn;return o.a.wrap(function(Xe){for(;;)switch(Xe.prev=Xe.next){case 0:return ht(!0),Xe.next=3,Object(R.a)("/api/homework_commons/".concat(J.categoryId,"/hack_score_setting.json"),{method:"post",body:Object(p.a)({},Fn)});case 3:bn=Xe.sent,bn.status===0&&(m.b.success("\u66F4\u65B0\u6210\u529F"),et(!0),jn(),ai({type:"shixunHomeworks/getWorkList",payload:Object(p.a)({},J)})),ht(!1);case 6:case"end":return Xe.stop()}},Rn)}));return function(){return yi.apply(this,arguments)}}();(zt==null?void 0:zt.hack_score_settings)!==(ue==null?void 0:ue.hack_score_settings)&&St?s.a.confirm({title:"\u66F4\u65B0\u6210\u7EE9",content:"\u60A8\u6539\u52A8\u4E86\u672C\u6B21\u4F5C\u4E1A\u7684\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:hn}):hn()},$t=function(){var Fn,hn=zt.total_score,yi=(Fn=zt.hack_settings)===null||Fn===void 0?void 0:Fn.length,Rn=0,bn;switch(zt.hack_score_settings){case 0:var Rt=(hn/yi).toFixed(2);zt.hack_settings.map(function(ei,Oi){Rn=Oi,ei.hack_score=Rt>0?Rt:0}),bn=(hn-Rt*(yi-1)).toFixed(2),zt.hack_settings[Rn].hack_score=bn>0?bn:0;break;case 1:var Xe=[0,1,3,6],kt=0,Pt=zt.hack_settings.filter(function(ei){return ei.difficult===1}).length*Xe[1],an=zt.hack_settings.filter(function(ei){return ei.difficult===2}).length*Xe[2],zn=zt.hack_settings.filter(function(ei){return ei.difficult===3}).length*Xe[3],Ln=hn/(Pt+an+zn);console.log(Ln,2222),zt.hack_settings.map(function(ei,Oi){Rn=Oi,ei.hack_score=(Xe[ei.difficult]*Ln).toFixed(2),kt=kt+Number(ei.hack_score)});var oi=zt.hack_settings[Rn].hack_score;bn=(hn-kt+Number(oi)).toFixed(2),zt.hack_settings[Rn].hack_score=bn>0?bn:0;break}};return n.a.createElement("section",{className:_e.a.form},n.a.createElement(ze.a,{align:"middle"},n.a.createElement(Ze.a,{flex:"1"}),n.a.createElement(Ze.a,null,(ue==null?void 0:ue.can_edit)&&n.a.createElement(D.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return et(!1)}},"\u7F16\u8F91\u8BBE\u7F6E"))),n.a.createElement(ze.a,{align:"middle"},n.a.createElement(Ze.a,null,n.a.createElement("span",null,"\u603B\u5206\u503C"),n.a.createElement(Je.a,{min:0,className:"ml10 mr10",style:{width:160},value:zt.total_score,disabled:Ve||St,onChange:function(Fn){zt.total_score=Fn,lt(Object.assign({},zt)),$t()}}),"\xA0\u5206"),n.a.createElement(Ze.a,{style:{marginLeft:100}},n.a.createElement("span",null,"\u6D4B\u8BC4\u5355\u6B21\u62A5\u9519\u589E\u52A0\u65F6\u957F"),n.a.createElement(Je.a,{className:"ml10 mr10",style:{width:160},min:0,value:zt.punish_time,precision:0,disabled:Ve,onChange:function(Fn){zt.punish_time=Fn,lt(Object.assign({},zt)),$t()}}),"\xA0\u5206\u949F")),n.a.createElement(ze.a,{align:"middle",style:{marginTop:20}},n.a.createElement(Ze.a,null,n.a.createElement("span",null,"\u8BD5\u9898\u5206\u503C\u8BBE\u7F6E\u89C4\u5219")),n.a.createElement(Ze.a,{flex:"1"},n.a.createElement(mn.a.Item,{className:"ml20"},n.a.createElement(be.a.Group,{disabled:Ve||St,value:zt.hack_score_settings,onChange:function(Fn){zt.hack_score_settings=Fn.target.value,lt(Object.assign({},zt)),$t()}},n.a.createElement(be.a,{value:0},"\u5747\u5206\u6BD4\u4F8B"),n.a.createElement(be.a,{className:"ml20 mr20",value:1},"\u96BE\u6613\u5EA6"),n.a.createElement(be.a,{value:2},"\u81EA\u5B9A\u4E49\u5206\u503C"))))),n.a.createElement("div",{className:_e.a.hackList},zt.hack_settings&&zt.hack_settings.map(function(On,Fn){return n.a.createElement(ze.a,{key:Fn,align:"middle",style:{marginTop:20}},n.a.createElement(Ze.a,{flex:"1",className:"pr10"},n.a.createElement("strong",null,On.hack_name)),n.a.createElement(Ze.a,{flex:"150px"},n.a.createElement(Je.a,{min:0,step:.1,value:On.hack_score,disabled:Ve||zt.hack_score_settings!==2||St,onChange:function(yi){zt.hack_settings[Fn].hack_score=yi;var Rn=zt.hack_settings.reduce(function(bn,Rt){return bn+Number(Rt.hack_score)},0);zt.total_score=Rn.toFixed(2),lt(Object(p.a)({},zt))}}),n.a.createElement("span",{className:"ml10"},"\u5206")),n.a.createElement(Ze.a,{style:{lineHeight:"20px"}},On.difficult===1&&n.a.createElement("span",{className:"tag-style-border-small bg-green c-white mr10"},"\u7B80\u5355"),On.difficult===2&&n.a.createElement("span",{className:"tag-style-border-small bg-blue c-white mr10"},"\u9002\u4E2D"),On.difficult===3&&n.a.createElement("span",{className:"tag-style-border-small bg-orange c-white mr10"},"\u56F0\u96BE")))})),n.a.createElement("div",{style:{height:100}}),!Ve&&n.a.createElement("div",{className:_e.a.btns},n.a.createElement(D.a,{type:"primary",loading:je,onClick:function(){return ln()}},"\u63D0\u4EA4"),n.a.createElement(D.a,{type:"primary",ghost:!0,className:"ml20",onClick:function(){et(!0),jn()}},"\u53D6\u6D88")))},er=Object(O.a)(function(Bn){var gn=Bn.shixunHomeworks,Tn=Bn.loading;return{shixunHomeworks:gn,loading:Tn.effects}})(ji),yr=function(gn){var Tn,_n,si=gn.shixunHomeworks,ai=gn.loading,J=gn.dispatch,ue=Object(a.useState)(!0),Ce=Object(r.a)(ue,2),Te=Ce[0],qe=Ce[1],Oe=Object(a.useState)(!1),Ve=Object(r.a)(Oe,2),et=Ve[0],Ot=Ve[1],Et=Object(a.useState)([]),je=Object(r.a)(Et,2),ht=je[0],it=je[1],st=Object(a.useState)([]),bt=Object(r.a)(st,2),Lt=bt[0],ct=bt[1],Gt=Object(a.useState)([]),on=Object(r.a)(Gt,2),Dn=on[0],Kn=on[1],wn=Object(a.useState)([]),Nn=Object(r.a)(wn,2),Pn=Nn[0],Dt=Nn[1],sn=Object(w.i)();function Ft(){return St.apply(this,arguments)}function St(){return St=Object(f.a)(o.a.mark(function lt(){var jn;return o.a.wrap(function(Jn){for(;;)switch(Jn.prev=Jn.next){case 0:return Jn.next=2,Object(R.a)("/api/homework_commons/".concat(sn.categoryId,"/homework_common_collaborators.json"),{method:"get"});case 2:jn=Jn.sent,ct(jn);case 4:case"end":return Jn.stop()}},lt)})),St.apply(this,arguments)}function Un(){return Sn.apply(this,arguments)}function Sn(){return Sn=Object(f.a)(o.a.mark(function lt(){var jn;return o.a.wrap(function(Jn){for(;;)switch(Jn.prev=Jn.next){case 0:return Jn.next=2,Object(R.a)("/api/courses/".concat(sn==null?void 0:sn.coursesId,"/teachers"),{method:"get",params:{homework_id:sn.categoryId}});case 2:jn=Jn.sent,jn==null||jn.teacher_list.map(function($t){$t.key=$t.user_id}),Kn(jn==null?void 0:jn.teacher_list),Dt(jn==null?void 0:jn.teacher_list);case 6:case"end":return Jn.stop()}},lt)})),Sn.apply(this,arguments)}Object(a.useEffect)(function(){Ft(),Un()},[sn]);var zt=function(){};return n.a.createElement("section",{className:_e.a.form},n.a.createElement(ze.a,null,n.a.createElement(Ze.a,{flex:"1"},n.a.createElement("span",{style:{fontSize:"16px"}},"\u534F\u4F5C\u8BBE\u7F6E"),(Lt==null?void 0:Lt.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(ze.a,{style:{marginTop:"20px",marginBottom:"20px"}},(Lt==null||((Tn=Lt.data)===null||Tn===void 0)?void 0:Tn.length)<=0&&n.a.createElement(Z.a,{customText:"\u8BE5\u4F5C\u4E1A\u6682\u65E0\u534F\u4F5C\u8005"}),Lt==null||((_n=Lt.data)===null||_n===void 0)?void 0:_n.map(function(lt){return n.a.createElement("span",{style:{display:"inline-flex",height:"40px",borderRadius:"4px",border:"1px solid #44D7B6",padding:"7px 20px",color:"#44D7B6",marginRight:"40px"}},n.a.createElement("span",{style:{flex:"1"}},lt==null?void 0:lt.real_name),(Lt==null?void 0:Lt.can_edit)&&n.a.createElement("span",{style:{cursor:"pointer",marginLeft:"10px"},onClick:Object(f.a)(o.a.mark(function jn(){var ln;return o.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:return $t.next=2,Object(R.a)("/api/homework_commons/".concat(sn.categoryId,"/homework_common_collaborators/delete.json"),{method:"delete",body:{user_id:lt.id}});case 2:ln=$t.sent,ln.status===0&&(m.b.info("\u5220\u9664\u6210\u529F"),Ft(),Un());case 4:case"end":return $t.stop()}},jn)}))},"X"))})),n.a.createElement(ze.a,null,!Te&&n.a.createElement(Ze.a,{className:"mb50"},n.a.createElement(D.a,{type:"primary",size:"large",onClick:function(){return zt()}},"\u63D0\u4EA4"),n.a.createElement(D.a,{type:"primary",size:"large",ghost:!0,className:"ml20",onClick:function(){qe(!0)}},"\u53D6\u6D88"))),n.a.createElement(s.a,{title:"\u6DFB\u52A0\u534F\u4F5C\u8005",visible:et,onCancel:function(){return Ot(!1)},onOk:Object(f.a)(o.a.mark(function lt(){var jn;return o.a.wrap(function(Jn){for(;;)switch(Jn.prev=Jn.next){case 0:if(!(ht.length===0)){Jn.next=3;break}return m.b.info("\u8BF7\u9009\u62E9\u534F\u4F5C\u8001\u5E08"),Jn.abrupt("return");case 3:return Jn.next=5,Object(R.a)("/api/homework_commons/".concat(sn.categoryId,"/homework_common_collaborators.json"),{method:"post",body:{user_ids:ht}});case 5:jn=Jn.sent,jn.status===0&&(m.b.info("\u6DFB\u52A0\u6210\u529F"),it([]),Ft(),Un(),Ot(!1));case 7:case"end":return Jn.stop()}},lt)}))},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(jt.a.Search,{onChange:function(jn){Kn(Pn.filter(function(ln){return ln.name.indexOf(jn.target.value)>-1}))}})),n.a.createElement(Y.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(jn,ln){it(jn)},selectedRowKeys:ht,getCheckboxProps:function(jn){return{disabled:jn.is_collaborator}}},pagination:!1,dataSource:Dn,columns:[{title:"\u59D3\u540D",dataIndex:"name",key:"name"},{title:"\u89D2\u8272",dataIndex:"role",key:"role"}]}))))},cn=Object(O.a)(function(Bn){var gn=Bn.shixunHomeworks,Tn=Bn.loading;return{shixunHomeworks:gn,loading:Tn.effects}})(yr),ri=ce.a.RangePicker,pr=yt.a.Option,Cr=function(gn){var Tn=gn.shixunHomeworks,_n=gn.loading,si=gn.dispatch;return n.a.createElement("section",{className:"bg-white pl30 pr30 pt10 mb10"},n.a.createElement(K.a,null,n.a.createElement(K.a.TabPane,{tab:"\u53D1\u5E03\u8BBE\u7F6E",key:1},n.a.createElement(ci,null)),n.a.createElement(K.a.TabPane,{tab:"\u8BC4\u5206\u8BBE\u7F6E",key:2},n.a.createElement(er,null)),n.a.createElement(K.a.TabPane,{tab:"\u516C\u5F00\u8BBE\u7F6E",key:3},n.a.createElement(fi,null)),n.a.createElement(K.a.TabPane,{tab:"\u534F\u4F5C\u8BBE\u7F6E",key:4},n.a.createElement(cn,null))))},tr=Object(O.a)(function(Bn){var gn=Bn.shixunHomeworks,Tn=Bn.loading;return{shixunHomeworks:gn,loading:Tn.effects}})(Cr),nr=I("RotF"),X=I.n(nr),S=function(gn){var Tn,_n=gn.shixunHomeworks,si=gn.loading,ai=gn.dispatch,J=Object(w.i)(),ue=Object(w.h)(),Ce=Object(a.useState)([]),Te=Object(r.a)(Ce,2),qe=Te[0],Oe=Te[1],Ve=Object(a.useState)([]),et=Object(r.a)(Ve,2),Ot=et[0],Et=et[1],je=Object(a.useState)(!0),ht=Object(r.a)(je,2),it=ht[0],st=ht[1],bt=Object(a.useState)(!1),Lt=Object(r.a)(bt,2),ct=Lt[0],Gt=Lt[1],on=Object(a.useState)(1),Dn=Object(r.a)(on,2),Kn=Dn[0],wn=Dn[1],Nn=Object(a.useState)([]),Pn=Object(r.a)(Nn,2),Dt=Pn[0],sn=Pn[1],Ft=Object(a.useState)(!1),St=Object(r.a)(Ft,2),Un=St[0],Sn=St[1],zt=Object(a.useState)(!1),lt=Object(r.a)(zt,2),jn=lt[0],ln=lt[1];Object(a.useEffect)(function(){_n.actionTabs.key==="\u4EE3\u7801\u67E5\u91CD"?(On.resetFields(),Oe([]),Sn(!0),hn()):Sn(!1)},[_n.actionTabs.key]);var Jn=mn.a.useForm(),$t=Object(r.a)(Jn,1),On=$t[0],Fn=[],hn=function(){var bn=Object(f.a)(o.a.mark(function Rt(){var Xe,kt,Pt;return o.a.wrap(function(zn){for(;;)switch(zn.prev=zn.next){case 0:if(!(it&&!ct)){zn.next=11;break}return Gt(!0),wn(Kn+1),zn.next=5,Object(vt.x)(Object(p.a)(Object(p.a)({},J),{},{page:Kn}));case 5:kt=zn.sent,Pt=Object(xe.a)(kt.group_list),kt!=null&&kt.ungroup_list&&Pt.push({id:kt==null?void 0:kt.ungroup_list.id,name:kt==null?void 0:kt.ungroup_list.name,works_count:kt==null?void 0:kt.ungroup_list.work_count,last_review_time:kt==null?void 0:kt.ungroup_list.last_review_time}),Oe([].concat(Object(xe.a)(qe),Object(xe.a)(Pt))),Gt(!1),((Xe=kt.group_list)===null||Xe===void 0?void 0:Xe.length)<10&&st(!1);case 11:case"end":return zn.stop()}},Rt)}));return function(){return bn.apply(this,arguments)}}(),yi=function(){ai({type:"shixunHomeworks/setActionTabs",payload:{}}),ln(!1),st(!0),Gt(!1),wn(1),Oe([]),On.resetFields()},Rn=[{title:"",dataIndex:"id",width:280,render:function(Rt,Xe){return n.a.createElement(dt.a,{disabled:!(Xe.works_count>1),value:String(Xe.id)},Xe.name)}},{title:"\u6709\u6548\u4F5C\u54C1\u6570",dataIndex:"works_count"},{title:"\u4E0A\u6B21\u67E5\u91CD\u65F6\u95F4",dataIndex:"last_review_time",width:130}];return n.a.createElement(s.a,{centered:!0,title:"\u4EE3\u7801\u67E5\u91CD",keyboard:!1,maskClosable:!1,visible:Un,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",width:820,bodyStyle:{minHeight:200},onOk:Object(f.a)(o.a.mark(function bn(){var Rt,Xe;return o.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Rt=On.getFieldValue(),Pt.next=3,Object(R.a)("/api/homework_commons/".concat(J.categoryId,"/hack_homework_code_repeat.json"),{method:"post",body:{group_ids:Object(xe.a)(Rt.group_ids)}});case 3:if(Xe=Pt.sent,!(Xe.status===0)){Pt.next=11;break}return yi(),m.b.success("\u64CD\u4F5C\u6210\u529F"),Pt.next=9,ai({type:"shixunHomeworks/getWorkList",payload:_n.actionTabs.params});case 9:O.d.push("/classrooms/".concat(J.coursesId,"/program_homework/").concat(J.categoryId,"/detail?tabs=2")),ai({type:"shixunHomeworks/setActionTabs",payload:{key:"\u6267\u884C\u4EE3\u7801\u67E5\u91CD"}});case 11:case"end":return Pt.stop()}},bn)})),onCancel:yi},_n.codeReviewCourse&&n.a.createElement(mn.a,{form:On,onChange:function(Rt){sn(Object(p.a)({},On.getFieldValue()))},initialValues:(Tn={},Object(Mt.a)(Tn,"group_ids",Fn),Object(Mt.a)(Tn,"end_time",G()(G()().add(7,"days").format("YYYY-MM-DD HH:mm"))),Tn)},n.a.createElement("div",{className:"flexd-table-header mt20"},n.a.createElement(Y.a,{pagination:!1,dataSource:[],columns:Rn})),n.a.createElement(mn.a.Item,{name:"group_ids"},n.a.createElement(dt.a.Group,{className:"w100"},n.a.createElement("div",{style:{width:"100%",maxHeight:260,overflow:"auto"}},n.a.createElement(X.a,{initialLoad:!1,pageStart:1,threshold:20,loadMore:function(Rt){hn()},hasMore:it,useWindow:!1},n.a.createElement(Y.a,{loading:si.effects["shixunHomeworks/getCodeReviewCourse"],showHeader:!1,columns:Rn,dataSource:qe,pagination:!1})))))),n.a.createElement(ze.a,null,n.a.createElement(Ze.a,{className:"ml10"},n.a.createElement(dt.a,{checked:jn,onChange:function(Rt){ln(Rt.target.checked);var Xe=[];Rt.target.checked&&(Xe=qe.filter(function(kt){return kt.works_count>1}).map(function(kt){return kt.id+""})),On.setFieldsValue(Object(Mt.a)({},"group_ids",Xe))}},"\u5168\u9009"))))},L=Object(O.a)(function(Bn){var gn=Bn.shixunHomeworks,Tn=Bn.loading;return{shixunHomeworks:gn,loading:Tn}})(S),W=I("nPLb"),ne=I("XpUO"),Q=I("bTeP"),ke=I.n(Q),Vt=I("HBuW"),kn=I("NLgs"),Qn=I("m3rI"),nn=I("+92d"),ti=I.n(nn),qn=I("wwSX"),Li=I.n(qn),lr=I("zlzj"),ar=I.n(lr),Ki=I("deN7"),Pr=[ti.a,Li.a,ar.a],Vr=function(gn){var Tn,_n,si=gn.user,ai=Object(a.useState)(Object(p.a)(Object(p.a)({},Object(w.i)()),{},{page:1,per_page:10,rank_type:2,course_group:Object(V.s)()?[si.userInfo.course.course_group_id]:[]},Object(w.i)())),J=Object(r.a)(ai,2),ue=J[0],Ce=J[1],Te=Object(a.useState)([]),qe=Object(r.a)(Te,2),Oe=qe[0],Ve=qe[1],et=Object(a.useState)([]),Ot=Object(r.a)(et,2),Et=Ot[0],je=Ot[1],ht=Object(a.useState)([]),it=Object(r.a)(ht,2),st=it[0],bt=it[1],Lt=Object(a.useState)(!1),ct=Object(r.a)(Lt,2),Gt=ct[0],on=ct[1],Dn=Object(a.useState)([{title:"\u6392\u884C",dataIndex:"rank",width:100,fixed:"left",render:function(Ft,St,Un){return Ft<4?n.a.createElement("img",{src:Pr[Ft-1]}):Ft}},{title:"\u7528\u6237",dataIndex:"user_name",width:150,fixed:"left",key:"user_name",render:function(Ft,St,Un){return n.a.createElement("div",null,n.a.createElement("img",{style:{width:30,height:30,borderRadius:"50%",marginRight:10},src:Qn.a.IMG_SERVER+"/images/"+(St==null?void 0:St.image_url)}),Ft)}},{title:"\u5206\u73ED",dataIndex:"course_group",key:"course_group",ellipsis:!0,width:150,fixed:"left"},{title:"\u5B66\u53F7",dataIndex:"student_id",key:"student_id",width:150,ellipsis:!0,fixed:"left",render:function(Ft){return Ft||"- -"}},{title:"\u901A\u8FC7",dataIndex:"passed_count",width:100,fixed:"left",key:"passed_count"},{title:"\u5F97\u5206",dataIndex:"score",width:100,fixed:"left",key:"score"}]),Kn=Object(r.a)(Dn,2),wn=Kn[0],Nn=Kn[1];Object(a.useEffect)(function(){wn.splice(7);for(var sn=function(Sn){var zt,lt,jn,ln,Jn={};Jn.title=Oe!=null&&Oe.sent_type?n.a.createElement("span",null,"\u9898\u76EE"+(Sn+1)+"\uFF08".concat(Oe==null||((zt=Oe.question_data)===null||zt===void 0||((lt=zt[Sn])===null||lt===void 0))?void 0:lt.question_score,"\uFF09")):n.a.createElement("a",{onClick:Object(f.a)(o.a.mark(function $t(){var On,Fn,hn;return o.a.wrap(function(Rn){for(;;)switch(Rn.prev=Rn.next){case 0:return Rn.next=2,Object(R.a)("/api/problems/".concat(Oe==null||((On=Oe.question_data)===null||On===void 0||((Fn=On[Sn])===null||Fn===void 0))?void 0:Fn.identifier,"/start.json"),{method:"get"});case 2:hn=Rn.sent,hn&&(window.open("/myproblems/".concat(hn==null?void 0:hn.identifier,"?type=1")),localStorage.setItem("program_homework",[ue.coursesId,ue.categoryId]));case 4:case"end":return Rn.stop()}},$t)}))},"\u9898\u76EE"+(Sn+1)+"\uFF08".concat(Oe==null||((jn=Oe.question_data)===null||jn===void 0||((ln=jn[Sn])===null||ln===void 0))?void 0:ln.question_score,"\uFF09")),Jn.dataIndex="question_data",Jn.width=250,Jn.render=function($t,On){var Fn,hn,yi,Rn,bn;return n.a.createElement("div",null,($t==null||((Fn=$t[Sn])===null||Fn===void 0)?void 0:Fn.answer_question_time)&&n.a.createElement("div",null,n.a.createElement("span",{style:{cursor:"pointer"},className:"iconfont icon-shixun4 c-blue",onClick:Object(f.a)(o.a.mark(function Rt(){var Xe,kt,Pt,an,zn,Ln,oi,ei;return o.a.wrap(function(mi){for(;;)switch(mi.prev=mi.next){case 0:if($t!=null&&(Xe=$t[Sn])!==null&&Xe!==void 0&&Xe.open_code){mi.next=3;break}return m.b.info("\u6682\u4E0D\u5141\u8BB8\u67E5\u770B\u4EE3\u7801"),mi.abrupt("return");case 3:return mi.next=5,Object(R.a)("/api/courses/view_code.json",{method:"get",params:Object(p.a)(Object(p.a)({},ue),{},{id:ue.coursesId,homework_common_id:ue.categoryId,hack_user_code_id:$t==null||((kt=$t[Sn])===null||kt===void 0)?void 0:kt.hack_user_code_id})});case 5:ei=mi.sent,s.a.warning({icon:null,width:800,title:n.a.createElement("div",null,n.a.createElement("span",null,"\u4EE3\u7801"),n.a.createElement("span",null,"\u4F7F\u7528\u8BED\u8A00\uFF1A",$t==null||((Pt=$t[Sn])===null||Pt===void 0)?void 0:Pt.current_language),n.a.createElement("span",null,"\u8FD0\u884C\u5185\u5B58\uFF1A",$t==null||((an=$t[Sn])===null||an===void 0)?void 0:an.memory,"\uFF08KB\uFF09"),n.a.createElement("span",null,"\u8FD0\u884C\u65F6\u957F\uFF1A",$t==null||((zn=$t[Sn])===null||zn===void 0)?void 0:zn.run_time,"\uFF08ms\uFF09"),n.a.createElement("span",null,"\u5F97\u5206\uFF1A",$t==null||((Ln=$t[Sn])===null||Ln===void 0)?void 0:Ln.score)),content:n.a.createElement(Ki.a,{languages:[{language:$t==null||((oi=$t[Sn])===null||oi===void 0)?void 0:oi.language,code:ei==null?void 0:ei.code}],v:$t,shixunWorkReport:"shixunWorkReport",dispatch:"dispatch",autoHeight:!1,language:$t.language,game_id:$t.id,diff_code_count:$t.diff_code_count})});case 7:case"end":return mi.stop()}},Rt)}))}),n.a.createElement("span",{style:{margin:"0px 10px"}},($t==null||((hn=$t[Sn])===null||hn===void 0)?void 0:hn.answer_question_time)||"- -"),$t!=null&&(yi=$t[Sn])!==null&&yi!==void 0&&yi.submit_count?n.a.createElement(M.a,{title:"".concat(($t==null||((Rn=$t[Sn])===null||Rn===void 0)?void 0:Rn.submit_count)||0,"\u6B21\u5C1D\u8BD5\u51FA\u9519")},n.a.createElement("span",{style:{color:"red",marginRight:5},className:"iconfont icon-Bug"}),($t==null||((bn=$t[Sn])===null||bn===void 0)?void 0:bn.submit_count)||0):null))},wn.push(Jn)},Ft=0;Ft<(Oe==null||((St=Oe.question_data)===null||St===void 0)?void 0:St.length);Ft++){var St;sn(Ft)}Nn(Object(xe.a)(wn))},[Oe==null?void 0:Oe.question_data]),Object(a.useEffect)(function(){var sn;si!=null&&(sn=si.userInfo)!==null&&sn!==void 0&&sn.course&&(Object(V.s)()&&(ue.course_group=Object(V.s)()?[si.userInfo.course.course_group_id]:[],Ce(Object(p.a)({},ue))),Pn(1))},[si==null?void 0:si.userInfo]);function Pn(sn){return Dt.apply(this,arguments)}function Dt(){return Dt=Object(f.a)(o.a.mark(function sn(Ft){var St,Un,Sn,zt,lt,jn,ln;return o.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:return on(!0),$t.next=3,Object(R.a)("/api/courses/rank_list.json",{method:"get",params:Object(p.a)(Object(p.a)({},ue),{},{id:ue.coursesId,rank_type:2,homework_common_id:ue.categoryId})});case 3:if(St=$t.sent,Ve(St),on(!1),Object(V.s)()?(Ft===1&&je([St==null||((Un=St.course_group)===null||Un===void 0||((Sn=Un[0])===null||Sn===void 0))?void 0:Sn.id]),St!=null&&St.my_rank?bt([St==null?void 0:St.my_rank].concat(Object(xe.a)(St==null?void 0:St.rank_list))):bt(Object(xe.a)(St==null?void 0:St.rank_list))):bt(Object(xe.a)(St==null?void 0:St.rank_list)),Ft===1){for(zt={title:n.a.createElement(M.a,{title:`\u603B\u8017\u65F6\u65F6\u4E3A\u505A\u9898\u901A\u8FC7\u65F6\u957F\u548C\u7F5A\u65F6\u65F6\u957F\u7684\u603B\u548C\uFF0C
|
|
\u7F5A\u65F6\u65F6\u957F=\u8BC4\u6D4B\u51FA\u9519\u6B21\u6570X\u8BBE\u7F6E\u7684\u7F5A\u65F6\uFF08\u5F53\u524D\u4E3A`.concat(St==null?void 0:St.punish_time,"\u5206\uFF09")},n.a.createElement("span",{style:{marginRight:3}},"\u603B\u8017\u65F6")," ",n.a.createElement("span",{style:{fontSize:"14px"},className:"iconfont icon-tishixiaowenhao c-blue"})),dataIndex:"finish_time",width:150,ellipsis:!0,fixed:"left",key:"finish_time"},wn.push(zt),lt=function(Fn){var hn,yi,Rn,bn,Rt={};Rt.title=St!=null&&St.sent_type?n.a.createElement("span",null,"\u9898\u76EE"+(Fn+1)+"\uFF08".concat(St==null||((hn=St.question_data)===null||hn===void 0||((yi=hn[Fn])===null||yi===void 0))?void 0:yi.question_score,"\uFF09")):n.a.createElement("a",{onClick:Object(f.a)(o.a.mark(function Xe(){var kt,Pt,an;return o.a.wrap(function(Ln){for(;;)switch(Ln.prev=Ln.next){case 0:return Ln.next=2,Object(R.a)("/api/problems/".concat(St==null||((kt=St.question_data)===null||kt===void 0||((Pt=kt[Fn])===null||Pt===void 0))?void 0:Pt.identifier,"/start.json"),{method:"get"});case 2:an=Ln.sent,an&&(window.open("/myproblems/".concat(an==null?void 0:an.identifier,"?type=1")),localStorage.setItem("program_homework",[ue.coursesId,ue.categoryId]));case 4:case"end":return Ln.stop()}},Xe)}))},"\u9898\u76EE"+(Fn+1)+"\uFF08".concat(St==null||((Rn=St.question_data)===null||Rn===void 0||((bn=Rn[Fn])===null||bn===void 0))?void 0:bn.question_score,"\uFF09")),Rt.dataIndex="question_data",Rt.width=250,Rt.render=function(Xe,kt){var Pt,an,zn,Ln,oi;return n.a.createElement("div",null,(Xe==null||((Pt=Xe[Fn])===null||Pt===void 0)?void 0:Pt.answer_question_time)&&n.a.createElement("div",null,n.a.createElement("span",{style:{cursor:"pointer"},className:"iconfont icon-shixun4 c-blue",onClick:Object(f.a)(o.a.mark(function ei(){var Oi,mi,bi,Ji,Vi,$i,gr,vr;return o.a.wrap(function(Me){for(;;)switch(Me.prev=Me.next){case 0:if(Xe!=null&&(Oi=Xe[Fn])!==null&&Oi!==void 0&&Oi.open_code){Me.next=3;break}return m.b.info("\u6682\u4E0D\u5141\u8BB8\u67E5\u770B\u4EE3\u7801"),Me.abrupt("return");case 3:return Me.next=5,Object(R.a)("/api/courses/view_code.json",{method:"get",params:Object(p.a)(Object(p.a)({},ue),{},{id:ue.coursesId,homework_common_id:ue.categoryId,hack_user_code_id:Xe==null||((mi=Xe[Fn])===null||mi===void 0)?void 0:mi.hack_user_code_id})});case 5:vr=Me.sent,s.a.warning({icon:null,width:800,title:n.a.createElement("div",null,n.a.createElement("span",null,"\u4EE3\u7801"),n.a.createElement("span",null,"\u4F7F\u7528\u8BED\u8A00\uFF1A",Xe==null||((bi=Xe[Fn])===null||bi===void 0)?void 0:bi.current_language),n.a.createElement("span",null,"\u8FD0\u884C\u5185\u5B58\uFF1A",Xe==null||((Ji=Xe[Fn])===null||Ji===void 0)?void 0:Ji.memory,"\uFF08KB\uFF09"),n.a.createElement("span",null,"\u8FD0\u884C\u65F6\u957F\uFF1A",Xe==null||((Vi=Xe[Fn])===null||Vi===void 0)?void 0:Vi.run_time,"\uFF08ms\uFF09"),n.a.createElement("span",null,"\u5F97\u5206\uFF1A",Xe==null||(($i=Xe[Fn])===null||$i===void 0)?void 0:$i.score)),content:n.a.createElement(Ki.a,{languages:[{language:Xe==null||((gr=Xe[Fn])===null||gr===void 0)?void 0:gr.language,code:vr==null?void 0:vr.code}],v:Xe,shixunWorkReport:"shixunWorkReport",dispatch:"dispatch",autoHeight:!1,language:Xe.language,game_id:Xe.id,diff_code_count:Xe.diff_code_count})});case 7:case"end":return Me.stop()}},ei)}))}),n.a.createElement("span",{style:{margin:"0px 10px"}},(Xe==null||((an=Xe[Fn])===null||an===void 0)?void 0:an.answer_question_time)||"- -"),Xe!=null&&(zn=Xe[Fn])!==null&&zn!==void 0&&zn.submit_count?n.a.createElement(M.a,{title:"".concat((Xe==null||((Ln=Xe[Fn])===null||Ln===void 0)?void 0:Ln.submit_count)||0,"\u6B21\u5C1D\u8BD5\u51FA\u9519")},n.a.createElement("span",{style:{color:"red",marginRight:5},className:"iconfont icon-Bug"}),(Xe==null||((oi=Xe[Fn])===null||oi===void 0)?void 0:oi.submit_count)||0):null))},wn.push(Rt)},jn=0;jn<(St==null||((ln=St.question_data)===null||ln===void 0)?void 0:ln.length);jn++)lt(jn);Nn(Object(xe.a)(wn))}case 8:case"end":return $t.stop()}},sn)})),Dt.apply(this,arguments)}return console.log("----",wn),n.a.createElement("div",{style:{width:1200,margin:"0px auto"}},(Oe==null?void 0:Oe.message)==="\u5C01\u699C\u4E2D"?n.a.createElement(Z.a,{customText:"\u7B54\u9898\u65F6\u95F4\u8FDB\u5165\u5012\u8BA1\u65F6\uFF0C\u6682\u65F6\u5C01\u699C\uFF0C\u8BF7\u52A0\u901F\u7ADE\u6280\u901A\u5173\u7B54\u9898"}):n.a.createElement("div",{style:{background:"#fff",padding:20}},n.a.createElement("div",{style:{display:"inline-flex"}},n.a.createElement("label",null,"\u5206\u73ED\u60C5\u51B5\uFF1A"),Object(V.c)()&&n.a.createElement("div",{style:{flex:1}},n.a.createElement(dt.a.Group,{className:ke.a.checkboxgroup,value:Et,onChange:function(Ft){if(ue.type===1)je([]),ue.course_group=[],ue.page=1,Ce(Object(p.a)({},ue)),Pn();else if(ue.type===2){var St;je(["\u5168\u90E8"].concat()),ue.course_group=Oe==null||((St=Oe.course_group)===null||St===void 0)?void 0:St.map(function(Un){return Un.id}),ue.page=1,Ce(Object(p.a)({},ue)),Pn()}else je(Object(xe.a)(Ft.filter(function(Un){return Un!="\u5168\u90E8"}))),ue.course_group=Ft.filter(function(Un){return Un!="\u5168\u90E8"}),ue.page=1,Ce(Object(p.a)({},ue)),Pn()}},n.a.createElement(dt.a,{value:"\u5168\u90E8",onChange:function(Ft){Ft.target.checked?ue.type=2:ue.type=1}},"\u5168\u90E8\u5206\u73ED"),Oe==null||((Tn=Oe.course_group)===null||Tn===void 0)?void 0:Tn.map(function(sn,Ft){return n.a.createElement(dt.a,{onChange:function(Un){ue.type=3},value:sn.id},sn==null?void 0:sn.name)}))),Object(V.s)()&&n.a.createElement(be.a.Group,{onChange:function(Ft){Ft.target.value==="\u5168\u90E8"?(ue.course_group=[],ue.page=1,Ce(Object(p.a)({},ue)),Pn()):(ue.course_group=[Ft.target.value],ue.page=1,Ce(Object(p.a)({},ue)),Pn())},defaultValue:si.userInfo.course.course_group_id},n.a.createElement(be.a,{value:"\u5168\u90E8"},"\u5168\u90E8\u5206\u73ED"),Oe==null||((_n=Oe.course_group)===null||_n===void 0)?void 0:_n.map(function(sn,Ft){return n.a.createElement(be.a,{value:sn.id},sn.name)}))),Object(V.c)()&&n.a.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"space-between",marginTop:10}},n.a.createElement("span",{style:{fontSize:14,color:"#B1BACD"}},"\u6392\u884C\u89C4\u5219\uFF1A\u65F6\u95F4\u7ED3\u675F\u540E\u6B63\u5F0F\u5C01\u699C\uFF0C\u65F6\u95F4\u6BB5\u4E4B\u5916\u7684\u63D0\u4EA4\u4E0D\u8BA1\u5165\u6392\u884C\u3002 ",n.a.createElement("a",{onClick:function(){s.a.warning({title:"\u8BA1\u5206\u89C4\u5219",width:500,content:n.a.createElement("div",null,n.a.createElement("p",null,"\u6392\u540D\u89C4\u5219\uFF1A\u7ECF\u5178ACM\u89C4\u5219"),n.a.createElement("p",null,"AC\uFF08\u901A\u8FC7\u9898\u76EE\uFF09\u8D8A\u591A\uFF0C\u6392\u540D\u8D8A\u9760\u524D\u3002"),n.a.createElement("p",null,"AC\u76F8\u540C\uFF0C\u603B\u7528\u65F6\u8D8A\u5C11\uFF0C\u6392\u540D\u8D8A\u9760\u524D\u3002"),n.a.createElement("p",null,"\u603B\u7528\u65F6=\u2211\uFF08\u6BCF\u4E00\u4E2A\u9898\u76EE\u7684\u7528\u65F6\uFF09"),n.a.createElement("p",null,"\u6BCF\u4E00\u4E2A\u9898\u76EE\u7684\u7528\u65F6=\u6BD4\u8D5B\u5F00\u59CB\u5230\u63D0\u4EA4\u88AB\u901A\u8FC7\u7684\u65F6\u95F4+\u7F5A\u65F6"),n.a.createElement("p",null,"\u7F5A\u65F6=\uFF08\u901A\u8FC7\u524D\uFF09\u9519\u8BEF\u4EE3\u7801\u63D0\u4EA4\u6B21\u6570*\u6BCF\u6B21\u7F5A\u65F6"),n.a.createElement("p",null,"\u4E0D\u7B97\u7F5A\u65F6\u7684\u60C5\u51B5\uFF1A\u6CA1\u6709\u901A\u8FC7\u7684\u9898\u76EE\u3001\uFF08\u7CFB\u7EDF\uFF09\u5185\u90E8\u9519\u8BEF\u3001\u7F16\u8BD1\u9519\u8BEF"))})}},"\u70B9\u51FB\u67E5\u770B\u8BA1\u5206\u89C4\u5219")),n.a.createElement(D.a,{onClick:function(){Object(me.v)(Object(p.a)(Object(p.a)({},ue),{},{id:ue.coursesId,rank_type:2,homework_common_id:ue.categoryId}))}},"\u5BFC\u51FA")),n.a.createElement(h.a,{spinning:Gt},n.a.createElement(Y.a,{style:{marginTop:10},pagination:!1,scroll:{x:1200},rowClassName:function(Ft,St){return St===0&&Object(V.s)()&&ke.a.tables},dataSource:st,columns:wn})),n.a.createElement("div",{style:{width:"100%",textAlign:"center",marginTop:10}},n.a.createElement(v.a,{current:ue.page,pageSize:ue.per_page,total:Oe==null?void 0:Oe.count,hideOnSinglePage:!0,onChange:function(Ft,St){ue.page=Ft,ue.per_page=St,Ce(Object(p.a)({},ue)),Pn()}}))))},Ai=Object(O.a)(function(Bn){var gn=Bn.user;return{user:gn}})(Vr),wi=[{live:"A",gz:"0\u4E2A\u9519\u8BEF",ld:"0\u4E2A\u6F0F\u6D1E",gf:"0 - 5%"},{live:"B",gz:"\u81F3\u5C111\u4E2A\u6B21\u8981\u9519\u8BEF",ld:"\u81F3\u5C111\u4E2A\u6B21\u8981\u6F0F\u6D1E",gf:"6% - 10%"},{live:"C",gz:"\u81F3\u5C111\u4E2A\u4E3B\u8981\u9519\u8BEF",ld:"\u81F3\u5C111\u4E2A\u4E3B\u8981\u6F0F\u6D1E",gf:"11% - 20%"},{live:"D",gz:"\u81F3\u5C111\u4E2A\u4E25\u91CD\u9519\u8BEF",ld:"\u81F3\u5C111\u4E2A\u4E25\u91CD\u6F0F\u6D1E",gf:"21% - 50%"},{live:"E",gz:"\u81F3\u5C111\u4E2A\u5D29\u6E83\u9519\u8BEF",ld:"\u81F3\u5C111\u4E2A\u5D29\u6E83\u6F0F\u6D1E",gf:"\u8D85\u8FC750%"}],ir=function(gn){var Tn,_n=gn.shixunHomeworks,si=gn.globalSetting,ai=gn.loading,J=gn.dispatch,ue=Object(w.i)(),Ce=Object(w.h)(),Te=Object(w.g)(),qe=Object(a.useState)([]),Oe=Object(r.a)(qe,2),Ve=Oe[0],et=Oe[1],Ot=Object(a.useState)(Ce.query.tabs||"0"),Et=Object(r.a)(Ot,2),je=Et[0],ht=Et[1],it=Object(a.useState)({}),st=Object(r.a)(it,2),bt=st[0],Lt=st[1],ct=_n.workList,Gt=Object(a.useState)(!1),on=Object(r.a)(Gt,2),Dn=on[0],Kn=on[1],wn;ue.category=Ce.query.category_id,ue.order="work_score",ue.b_order="desc";var Nn=function(zt){ht(zt),zt==="0"&&J({type:"shixunHomeworks/getWorkList",payload:ue})},Pn=function(){s.a.confirm({centered:!0,width:530,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:n.a.createElement("div",{className:"tc font16"},"\u4F60\u5728\u8BE5\u5B9E\u8BAD\u7684\u5B66\u4E60\u8BB0\u5F55\u5C06\u88AB\u6E05\u7A7A\uFF0C\u65E0\u6CD5\u6062\u590D",n.a.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u91CD\u505A\uFF1F"),onOk:function(){var zt=Object(f.a)(o.a.mark(function jn(){var ln,Jn,$t;return o.a.wrap(function(Fn){for(;;)switch(Fn.prev=Fn.next){case 0:return Jn=(ln=_n.workList)===null||ln===void 0?void 0:ln.myshixun_identifier,Fn.next=3,Object(vt.X)({id:Jn});case 3:$t=Fn.sent,$t&&(m.b.info(`\u5DF2\u6E05\u7A7A\u672C\u5B9E\u8BAD\u7684\u5B66\u4E60\u8BB0\u5F55
|
|
|
|
\u8BF7\u70B9\u51FB\u201C\u5F00\u542F\u6311\u6218\u201D\u91CD\u505A\u8BFE\u7A0B\u5B9E\u9A8C`),J({type:"shixunHomeworks/getWorkList",payload:bt}));case 5:case"end":return Fn.stop()}},jn)}));function lt(){return zt.apply(this,arguments)}return lt}()})},Dt=function Sn(zt){var lt;zt=(lt=zt)!==null&<!==void 0&<.includes(".json")?zt:"".concat(zt,".json"),s.a.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:n.a.createElement("div",{className:"tc font16"},"\u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!"),onOk:function(){var jn=Object(f.a)(o.a.mark(function Jn(){var $t,On;return o.a.wrap(function(hn){for(;;)switch(hn.prev=hn.next){case 0:return hn.next=2,Object(Vt.Bb)({url:zt});case 2:if($t=hn.sent,$t){hn.next=5;break}return hn.abrupt("return");case 5:return m.b.success("\u91CD\u7F6E\u6210\u529F\uFF0C\u6B63\u5728\u8FDB\u5165\u5B9E\u8BAD\uFF01"),hn.next=8,Object(Vt.E)({id:$t.shixun_identifier});case 8:if(On=hn.sent,!(On!=null&&On.game_identifier)){hn.next=12;break}return Object(_.S)("/tasks/".concat(On.game_identifier,"?coursesId=").concat(ue.coursesId)),hn.abrupt("return");case 12:(On==null?void 0:On.status)===2?Sn(On==null?void 0:On.message):(On==null?void 0:On.status)===3&&sn(On==null?void 0:On.message);case 13:case"end":return hn.stop()}},Jn)}));function ln(){return jn.apply(this,arguments)}return ln}()})},sn=function(zt){s.a.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:n.a.createElement("div",{className:"tc font16"},"\u76EE\u524D\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5C1A\u5728\u5185\u6D4B\u4E2D\uFF0C\u5C06\u4E8E",zt,"\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01")})},Ft=function(){var Sn=Object(f.a)(o.a.mark(function zt(lt){var jn,ln;return o.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:return lt=(jn=lt)!==null&&jn!==void 0&&jn.includes(".json")?lt:"".concat(lt,".json"),$t.next=3,Object(Vt.Bb)({url:lt});case 3:if(ln=$t.sent,console.log(ln,"execRes"),!(ln!=null&&ln.game_identifier)){$t.next=8;break}return Object(_.S)("/tasks/".concat(ln.game_identifier,"?coursesId=").concat(ue.coursesId)),$t.abrupt("return");case 8:(ln==null?void 0:ln.status)===-3?Object(_.q)():(ln==null?void 0:ln.status)===2?Dt(ln==null?void 0:ln.message):(ln==null?void 0:ln.status)===3&&sn(ln==null?void 0:ln.message);case 9:case"end":return $t.stop()}},zt)}));return function(lt){return Sn.apply(this,arguments)}}(),St=[{name:"\u4F5C\u4E1A\u5217\u8868",id:"0",compontent:n.a.createElement(Tt,{setExportParams:Lt}),forceRender:!0},{name:"\u4F5C\u4E1A\u8BE6\u60C5",id:"1",compontent:n.a.createElement(Ye,null)},{name:"\u6392\u884C\u699C",id:"5",compontent:n.a.createElement(Ai,null)},{name:"\u4EE3\u7801\u67E5\u91CD",id:"2",compontent:n.a.createElement(Qt,null)},{name:Object(V.c)()?"\u9AD8\u7EA7\u8BBE\u7F6E":"\u5F97\u5206\u89C4\u5219",id:"3",compontent:n.a.createElement(tr,null)},{name:n.a.createElement("a",{style:{color:"#b9b8b8"},href:"/classrooms/".concat(ue.coursesId,"/program_homework/").concat(ue.categoryId,"/answer")},"\u89E3\u7B54&\u8BA8\u8BBA"),id:"6",compontent:!1}].filter(function(Sn){var zt;if(Object(V.s)())return Sn.name!=="\u4EE3\u7801\u67E5\u91CD";if(Object(V.s)()||(ct==null||((zt=ct.homework_status)===null||zt===void 0)?void 0:zt[0])!=="\u5DF2\u622A\u6B62")return Sn.name!=="\u8D28\u91CF\u68C0\u6D4B";var lt;return!ct.code_review&&(ct==null||((lt=ct.homework_status)===null||lt===void 0)?void 0:lt[0])!=="\u672A\u53D1\u5E03"?!0:Sn.name!=="\u4EE3\u7801\u67E5\u91CD"}).filter(function(Sn){return ct.open_code_quality_analysis?!0:Sn.name!=="\u8D28\u91CF\u68C0\u6D4B"}),Un=function(){var zt,lt,jn,ln,Jn,$t,On,Fn;return n.a.createElement("aside",{className:ke.a.workListTabButton},Object(V.s)()&&((zt=_n.workList)===null||zt===void 0?void 0:zt.redo_work)&&n.a.createElement(D.a,{onClick:Pn,type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-dahuizhongzuo3x"})},"\u91CD\u505A"),((lt=_n.workList)===null||lt===void 0?void 0:lt.shixun_status)>1&&((jn=_n.workList)===null||jn===void 0?void 0:jn.time_status)<5&&Object(V.s)()&&n.a.createElement(D.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-kaiqizhong"}),onClick:function(){var yi,Rn,bn,Rt,Xe,kt,Pt;if(!Object(kn.e)(J,!0))return;(yi=_n.workList)!==null&&yi!==void 0&&(Rn=yi.task_operation)!==null&&Rn!==void 0&&(bn=Rn[1])!==null&&bn!==void 0&&bn.includes("/")?Ft((Rt=_n.workList)===null||Rt===void 0||((Xe=Rt.task_operation)===null||Xe===void 0)?void 0:Xe[1]):Object(_.S)("/tasks/".concat((kt=_n.workList)===null||kt===void 0||((Pt=kt.task_operation)===null||Pt===void 0)?void 0:Pt[1]))}},(ln=_n.workList)===null||ln===void 0||((Jn=ln.task_operation)===null||Jn===void 0)?void 0:Jn[0]),(($t=_n.workList)===null||$t===void 0?void 0:$t.commit_des)&&n.a.createElement(D.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-tijiaozongjie"}),onClick:function(){var yi;Object(_.S)("/classrooms/".concat(ue.coursesId,"/shixun_homework/").concat(ue.categoryId,"/").concat((yi=_n.workList)===null||yi===void 0?void 0:yi.id,"/commitsummary"))}},(On=_n.workList)===null||On===void 0?void 0:On.commit_des),Object(V.c)()&&(ct==null||((Fn=ct.homework_status)===null||Fn===void 0)?void 0:Fn[0])==="\u672A\u53D1\u5E03"&&n.a.createElement(D.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-bianji2"}),onClick:function(){Te.push("/classrooms/".concat(ue.coursesId,"/program_homework/").concat(ue.categoryId,"/edit"))}},"\u7F16\u8F91\u4F5C\u4E1A"),Object(V.c)()&&ct.publish_immediately&&n.a.createElement(D.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-yishezhifabushijian1"}),onClick:function(){J({type:"classroomList/setActionTabs",payload:{key:"\u7ACB\u5373\u53D1\u5E03",selectArrs:[ue.categoryId],selectArrsAll:[ct],params:ue,detail:!0,type:2}})}},"\u7ACB\u5373\u53D1\u5E03"),Object(V.c)()&&ct.end_immediately&&n.a.createElement(D.a,{style:{background:"#0152d9",color:"#fff"},type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-jiezhishiyan"}),onClick:function(){J({type:"classroomList/setActionTabs",payload:{key:"\u7ACB\u5373\u622A\u6B62",params:ue,type:2,detail:!0,selectArrs:[ue.categoryId]}})}},"\u7ACB\u5373\u622A\u6B62"))};return n.a.createElement("section",null,n.a.createElement("div",{className:"edu-container"},ct.homework_name&&n.a.createElement("section",{className:"animated fadeIn"},n.a.createElement("aside",{className:"mt10"},ct.category&&n.a.createElement(P.a,{separator:">"},n.a.createElement(P.a.Item,null,n.a.createElement(x.a,{to:"/classrooms/".concat(ct.course_id,"/program_homework")},ct.course_name)),n.a.createElement(P.a.Item,null,n.a.createElement(x.a,{to:"/classrooms/".concat(ct.course_id,"/program_homework/").concat(ct.category.main?"":ct.category.category_id)},ct.category.category_name)),n.a.createElement(P.a.Item,null,"\u4F5C\u4E1A\u8BE6\u60C5"))),n.a.createElement("aside",{className:[ke.a.title,"mt20"].join(" ")},n.a.createElement(x.a,{to:"/classrooms/".concat(ct.course_id,"/program_homework/").concat(ct.category.main?"":ct.category.category_id)},n.a.createElement(C.a,{className:"font16 c-black"})),n.a.createElement(M.a,{title:ct.homework_name,placement:"bottom"},n.a.createElement("strong",{className:"font20 ml5"},ct.homework_name)),n.a.createElement(_.m,{temporary:!0,status:ct.homework_status}),Object(V.s)()&&n.a.createElement("span",{style:{fontWeight:800,color:"#0152d9",textAlign:"end",flex:1,cursor:"pointer"}},n.a.createElement(D.a,{onClick:Object(f.a)(o.a.mark(function Sn(){var zt,lt;return o.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:return ln.next=2,Object(R.a)("/api/problems/".concat((zt=_n.workList)===null||zt===void 0?void 0:zt.start_identifier,"/start.json"),{method:"get"});case 2:lt=ln.sent,lt&&(window.open("/myproblems/".concat(lt==null?void 0:lt.identifier,"?type=1")),localStorage.setItem("program_homework",[ue.coursesId,ue.categoryId]));case 4:case"end":return ln.stop()}},Sn)})),type:"primary"},(Tn=ct.homework_status)!==null&&Tn!==void 0&&Tn.includes("\u5DF2\u622A\u6B62")?"\u67E5\u770B\u4F5C\u4E1A":"\u8FDB\u5165\u7EC3\u4E60"," ")))),n.a.createElement("aside",{className:"mt30 relative ".concat(ke.a.workListTabWrap)},n.a.createElement(K.a,{type:"card",defaultActiveKey:je,activeKey:je,tabBarExtraContent:Un(),onChange:Nn},St.map(function(Sn,zt){return n.a.createElement(K.a.TabPane,{tab:Sn.name,key:Sn.id,forceRender:Sn.forceRender},Sn.compontent)})))),n.a.createElement(L,null),n.a.createElement(W.a,{courseEndTime:ct==null?void 0:ct.course_end_date}),n.a.createElement(ne.a,{courseEndTime:ct==null?void 0:ct.course_end_date}),n.a.createElement(s.a,{visible:Dn,title:"\u89C4\u5219\u8BF4\u660E",width:800,footer:null,onCancel:function(){Kn(!1)}},n.a.createElement("p",null,"\u4E00\u3001\u7B49\u7EA7\u89C4\u5219"),n.a.createElement("p",{style:{marginLeft:"10px"}},"1. \u7F3A\u9677\u7B49\u7EA7"),n.a.createElement("p",{style:{marginLeft:"10px"}},n.a.createElement(Y.a,{dataSource:wi,columns:[{title:"\u7B49\u7EA7",dataIndex:"live"},{title:"\u7F3A\u9677\u8BC4\u4F30\u89C4\u5219",dataIndex:"gz"},{title:"\u6F0F\u6D1E\u8BC4\u4F30\u89C4\u5219",dataIndex:"ld"},{title:"\u4EE3\u7801\u89C4\u8303\u8BC4\u4F30\u89C4\u5219",dataIndex:"gf"}],pagination:!1})),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u6CE8\uFF1A\u4EE3\u7801\u89C4\u8303\u8BC4\u4F30\u89C4\u5219\u4E2D\u6570\u503C\u6765\u6E90\u4E3A\u8BA1\u7B97\u6280\u672F\u503A\u52A1\u65F6\u95F4\u5360\u5F00\u53D1\u6240\u6709\u4EE3\u7801\u6240\u9700\u8981\u7684\u65F6\u95F4\u7684\u6BD4\u4F8B\uFF08Technical Debt Ratio\uFF09"),n.a.createElement("p",{style:{marginLeft:"20px"}},"Technical Debt Ratio = \u6280\u672F\u503A\u52A1\u65F6\u95F4 / \u5F00\u53D1\u65F6\u95F4"),n.a.createElement("p",{style:{marginLeft:"20px"}},"\u6280\u672F\u503A\u52A1\u65F6\u95F4\u4E3A\u4FEE\u590D\u6240\u6709\u95EE\u9898\u6240\u9700\u8981\u7684\u65F6\u95F4\u3002"),n.a.createElement("p",null,"\u4E8C\u3001\u590D\u6742\u5EA6\u89C4\u5219"),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u6839\u636E\u4EE3\u7801\u8DEF\u5F84\u6570\u8BA1\u7B97\u7684\u6570\u503C\uFF0C\u6BCF\u5F53\u4E00\u4E2A\u51FD\u6570\u7684\u63A7\u5236\u6D41\u5206\u53C9\u65F6\uFF0C\u590D\u6742\u5EA6\u8BA1\u6570\u5668\u5C31\u4F1A\u81EA\u589E\u4E00\u3002"),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u6BCF\u4E2A\u7A0B\u5E8F\u8BED\u8A00\u7684\u5173\u952E\u5B57\u5BF9\u5E94\u7684\u590D\u6742\u5EA6\u6570\u636E\u4E0D\u540C\uFF0C\u4F46\u6BCF\u4E2A\u51FD\u6570\u7684\u6700\u5C0F\u590D\u6742\u5EA6\u4E3A1\u3002\uFF08\u7279\u5B9A\u8BED\u8A00\u7684\u8BE6\u7EC6\u6570\u636E\u7565\uFF09"),n.a.createElement("p",null,"\u4E09\u3001\u4EE3\u7801\u8D28\u91CF\u5206\u89C4\u5219"),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u4EE3\u7801\u8D28\u91CF\u5206 = 0.5*\u7F3A\u9677\u5206\u6570 + 0.3*\u6F0F\u6D1E\u5206\u6570 + 0.2*\u4EE3\u7801\u89C4\u8303\u6027\u5206\u6570"),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u5176\u4E2D\uFF1A"),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u7F3A\u9677/\u6F0F\u6D1E/\u4EE3\u7801\u89C4\u8303\u6027\u5206\u6570\u8BA1\u7B97\u89C4\u5219\u4E3A\uFF1A100 - 100 *((100*\u5D29\u6E83\u6570 + 5*\u4E25\u91CD\u6570 + 3*\u4E3B\u8981\u6570 + 1*\u6B21\u6570\uFF09/ \u4EE3\u7801\u884C\u6570\uFF09"),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u6CE8\uFF1A\u5206\u6570\u4E3A\u7A7A\u7684\u4EE3\u8868\u4E0D\u652F\u6301\u7684\u6587\u4EF6\u683C\u5F0F\u3002")))},Fi=Qe.default=Object(O.a)(function(Bn){var gn=Bn.shixunHomeworks,Tn=Bn.loading,_n=Bn.globalSetting;return{shixunHomeworks:gn,globalSetting:_n,loading:Tn.effects}})(ir)},OLES:function(tn,Qe,I){"use strict";var te=I("U8pU"),Y=I("VTBJ"),N=I("Ff2n"),K=I("q1tI"),A=I("uciX"),M=I("7ixt"),H=function(f){var d=f.overlay,s=f.prefixCls,r=f.id,u=f.overlayInnerStyle;return K.createElement("div",{className:"".concat(s,"-inner"),id:r,role:"tooltip",style:u},typeof d=="function"?d():d)},P=H,k=function(f,d){var s=f.overlayClassName,r=f.trigger,u=r===void 0?["hover"]:r,o=f.mouseEnterDelay,a=o===void 0?0:o,n=f.mouseLeaveDelay,R=n===void 0?.1:n,w=f.overlayStyle,x=f.prefixCls,O=x===void 0?"rc-tooltip":x,C=f.children,_=f.onVisibleChange,y=f.afterVisibleChange,h=f.transitionName,c=f.animation,v=f.placement,p=v===void 0?"right":v,E=f.align,U=E===void 0?{}:E,F=f.destroyTooltipOnHide,z=F===void 0?!1:F,G=f.defaultVisible,B=f.getTooltipContainer,T=f.overlayInnerStyle,V=Object(N.a)(f,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),Z=Object(K.useRef)(null);Object(K.useImperativeHandle)(d,function(){return Z.current});var oe=Object(Y.a)({},V);"visible"in f&&(oe.popupVisible=f.visible);var pe=function(){var Ke=f.arrowContent,be=Ke===void 0?null:Ke,de=f.overlay,nt=f.id;return[K.createElement("div",{className:"".concat(O,"-arrow"),key:"arrow"},be),K.createElement(P,{key:"content",prefixCls:O,id:nt,overlay:de,overlayInnerStyle:T})]},Ye=!1,xe=!1;if(typeof z=="boolean")Ye=z;else if(z&&Object(te.a)(z)==="object"){var Ie=z.keepParent;Ye=Ie===!0,xe=Ie===!1}return K.createElement(A.a,Object.assign({popupClassName:s,prefixCls:O,popup:pe,action:u,builtinPlacements:M.a,popupPlacement:p,ref:Z,popupAlign:U,getPopupContainer:B,onPopupVisibleChange:_,afterPopupVisibleChange:y,popupTransitionName:h,popupAnimation:c,defaultPopupVisible:G,destroyPopupOnHide:Ye,autoDestroy:xe,mouseLeaveDelay:R,popupStyle:w,mouseEnterDelay:a},oe),C)},D=Object(K.forwardRef)(k),b=Qe.a=D},OZM5:function(tn,Qe,I){"use strict";I.d(Qe,"b",function(){return D}),I.d(Qe,"a",function(){return b}),I.d(Qe,"k",function(){return m}),I.d(Qe,"h",function(){return f}),I.d(Qe,"i",function(){return d}),I.d(Qe,"g",function(){return s}),I.d(Qe,"c",function(){return r}),I.d(Qe,"d",function(){return u}),I.d(Qe,"j",function(){return n}),I.d(Qe,"e",function(){return R}),I.d(Qe,"f",function(){return w});var te=I("KQm4"),Y=I("U8pU"),N=I("Ff2n"),K=I("q1tI"),A=I.n(K),M=I("Kwbf"),H=I("WaYH"),P=.25,k=2;function D(x,O){var C=x.slice(),_=C.indexOf(O);return _>=0&&C.splice(_,1),C}function b(x,O){var C=x.slice();return C.indexOf(O)===-1&&C.push(O),C}function m(x){return x.split("-")}function f(x,O){return"".concat(x,"-").concat(O)}function d(x){return x&&x.type&&x.type.isTreeNode}function s(x,O){var C=[x],_=O[x];function y(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];h.forEach(function(c){var v=c.key,p=c.children;C.push(v),y(p)})}return y(_.children),C}function r(x,O){var C=x.clientY,_=O.selectHandle.getBoundingClientRect(),y=_.top,h=_.bottom,c=_.height,v=Math.max(c*P,k);return C<=y+v?-1:C>=h-v?1:0}function u(x,O){if(!x)return;var C=O.multiple;return C?x.slice():x.length?[x[0]]:x}var o=function(O){return O};function a(x,O){if(!x)return[];var C=O||{},_=C.processProps,y=_===void 0?o:_,h=Array.isArray(x)?x:[x];return h.map(function(c){var v=c.children,p=Object(N.a)(c,["children"]),E=a(v,O);return A.a.createElement(H.a,Object.assign({},y(p)),E)})}function n(x){if(!x)return null;var O;if(Array.isArray(x))O={checkedKeys:x,halfCheckedKeys:void 0};else if(Object(Y.a)(x)==="object")O={checkedKeys:x.checked||void 0,halfCheckedKeys:x.halfChecked||void 0};else return Object(M.a)(!1,"`checkedKeys` is not an array or an object"),null;return O}function R(x,O){var C=new Set;function _(y){if(C.has(y))return;var h=O[y];if(!h)return;C.add(y);var c=h.parent,v=h.node;if(v.disabled)return;c&&_(c.key)}return(x||[]).forEach(function(y){_(y)}),Object(te.a)(C)}function w(x){var O={};return Object.keys(x).forEach(function(C){(C.startsWith("data-")||C.startsWith("aria-"))&&(O[C]=x[C])}),O}},Ot1p:function(tn,Qe,I){"use strict";var te=I("2qtc"),Y=I("kLXV"),N=I("rAM+"),K=I("miYZ"),A=I("tsqr"),M=I("9og8"),H=I("tJVT"),P=I("jrin"),k=I("WmNS"),D=I.n(k),b=I("q1tI"),m=I.n(b),f=I("VrN/"),d=I.n(f),s=I("bdgK"),r=I("p77/"),u=I("Bd2K"),o=I("ELLl"),a=I("19Vz"),n=I("lZu9"),R=I("+NIl"),w=I("kSUc"),x=I("9Bee"),O=function(me){var Be=me.value,Tt=Be===void 0?"":Be,Jt=me.className,En=me.showTextOnly,mt=me.showLines,Qt=me.style,gt=Qt===void 0?{}:Qt,yt=Object(b.useMemo)(function(){return""},[Tt]);return m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{dangerouslySetInnerHTML:{__html:yt}}))},C=I("0Owb"),_=I("dejd"),y=I("C+DQ"),h=I("1vsH"),c=I("m3rI"),v=[{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 p(me){var Be=me.onActionCallback,Tt=me.title,Jt=me.icon,En=me.actionName,mt=me.className,Qt=mt===void 0?"":mt,gt=me.children;function yt(){Be(En)}return m.a.createElement("a",{title:Tt,className:Qt,onClick:yt},m.a.createElement("i",{className:"md-iconfont ".concat(Jt)}),gt)}var E=function(me){var Be=me.watch,Tt=me.showNullButton,Jt=me.onActionCallback,En=me.fullScreen,mt=me.insertTemp,Qt=me.hidetoolBar,gt=me.uuid,yt=me.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(h.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(h.F)("_educoder_session"),"&key=").concat(gt,"&api=").concat(encodeURIComponent(c.a.PROXY_SERVER)));var rt=[].concat(v,[{title:"".concat(Be?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Be?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return m.a.createElement("ul",{className:"markdown-toolbar-container"},!Qt&&rt.map(function(ce,Re){return m.a.createElement("li",{key:Re},ce.actionName?m.a.createElement(p,Object(C.a)({},ce,{onActionCallback:Jt})):m.a.createElement("span",{className:"v-line"}))}),Tt?m.a.createElement("li",null,m.a.createElement(p,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Jt},m.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,mt&&m.a.createElement("li",null,m.a.createElement(p,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(mt),onActionCallback:Jt},m.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),m.a.createElement("li",{className:"btn-full-screen"},m.a.createElement(p,{icon:"".concat(En?"icon-shrink":"icon-enlarge"),title:En?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Jt})))},U=I("M8RZ"),F=I("+L6B"),z=I("2/Rp"),G=I("y8nQ"),B=I("Vl3Y"),T=I("5NDa"),V=I("5rEg"),Z={labelCol:{span:4},wrapperCol:{span:20}},oe=function(me){var Be=me.callback,Tt=me.onCancel;function Jt(En){Be(En)}return m.a.createElement(B.a,Object(C.a)({},Z,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Jt}),m.a.createElement(B.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},m.a.createElement(V.a,null)),m.a.createElement(B.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},m.a.createElement(V.a,null)),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(z.a,{type:"ghost",onClick:Tt},"\u53D6\u6D88")))},pe=I("7ahc"),Ye=I("HmJG"),xe=I("BjJ7"),Ie=B.a.useForm,Je={width:280,marginRight:10},Ke={labelCol:{span:5},wrapperCol:{span:19}},be=function(me){var Be=me.callback,Tt=me.onCancel,Jt=Ie(),En=Object(H.a)(Jt,1),mt=En[0];function Qt(rt){Be(rt)}function gt(rt,ce){if(rt.status===-1){A.b.error(rt.message);return}mt.setFieldsValue({src:"/api/attachments/".concat(rt.id),type:ce.type})}function yt(rt){var ce=rt.target.files[0];nt(ce,gt)}return m.a.createElement(B.a,Object(C.a)({form:mt},Ke,{className:"upload-image-panel",onFinish:Qt}),m.a.createElement(B.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},m.a.createElement("div",{className:"flex-container"},m.a.createElement(B.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},m.a.createElement(V.a,{style:Je})),m.a.createElement(de,{onFileChange:yt}))),m.a.createElement(B.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},m.a.createElement(V.a,{style:{width:264}})),m.a.createElement(B.a.Item,{style:{textAlign:"right"}},m.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(z.a,{type:"ghost",onClick:Tt},"\u53D6\u6D88")))};function de(me){var Be=me.onFileChange;return m.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",m.a.createElement("input",{type:"file",onChange:Be}))}function nt(me,Be){if(!me)throw new String("\u6CA1\u6709\u6587\u4EF6");var Tt=new FormData;Tt.append("editormd-image-file",me),Tt.append("file_param_name","editormd-image-file"),Tt.append("byxhr","true");var Jt=new window.XMLHttpRequest;Jt.withCredentials=!0,Jt.addEventListener("load",function(En){Be(JSON.parse(En.target.responseText),me)},!1),Jt.addEventListener("error",function(En){console.error(En)},!1),Jt.open("POST","".concat(xe.a,"/api/attachments.json")),Jt.send(Tt)}var Kt=I("giR+"),jt=I("fyUT"),wt=I("7Kak"),ze=I("9yH6"),ft=ze.a.Group,dt={margin:"0 8px"},Nt=function(me){var Be=me.callback,Tt=me.onCancel;function Jt(En){Be(En)}return m.a.createElement(B.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Jt},m.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},m.a.createElement("span",{style:dt},"\u5355\u5143\u683C\u6570\uFF1A"),m.a.createElement("span",{style:dt},"\u884C\u6570"),m.a.createElement(B.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},m.a.createElement(jt.a,null)),m.a.createElement("span",{style:dt},"\u5217\u6570"),m.a.createElement(B.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},m.a.createElement(jt.a,null))),m.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},m.a.createElement("span",{style:dt},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),m.a.createElement(B.a.Item,{name:"align"},m.a.createElement(ft,null,m.a.createElement(ze.a,{value:"default"},m.a.createElement("i",{className:"fa fa-align-justify"})),m.a.createElement(ze.a,{value:"left"},m.a.createElement("i",{className:"fa fa-align-left"})),m.a.createElement(ze.a,{value:"center"},m.a.createElement("i",{className:"fa fa-align-center"})),m.a.createElement(ze.a,{value:"right"},m.a.createElement("i",{className:"fa fa-align-right"}))))),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(z.a,{type:"ghost",onClick:Tt},"\u53D6\u6D88")))},Ze=I("ErOA"),Bt=I("7Cbv"),Ut="link",Mt="upload-image",An="code-block",mn="add-table",pn="------------",tt={default:pn,left:":".concat(pn),center:":".concat(pn,":"),right:"".concat(pn,":")},fn=I("9VGf"),In,He;function Ue(){}var pt=0,Ct=1e4,Ge="\u2581",vt=`
|
|
**\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 Ae(me){return/^\d+$/.test(me)?"".concat(me,"px"):me}var ge=navigator.platform.toUpperCase().indexOf("MAC")>=0,Ee=ge?"Cmd":"Ctrl",ae=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],re=(In={},Object(P.a)(In,Ee+"-B","bold"),Object(P.a)(In,Ee+"-I","italic"),In),he=(He={},Object(P.a)(He,Ut,"\u6DFB\u52A0\u94FE\u63A5"),Object(P.a)(He,An,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(P.a)(He,Mt,"\u6DFB\u52A0\u6587\u4EF6"),Object(P.a)(He,mn,"\u6DFB\u52A0\u8868\u683C"),He),ve=Qe.a=function(me){var Be=me.defaultValue,Tt=Be===void 0?"":Be,Jt=me.onChange,En=me.width,mt=En===void 0?"100%":En,Qt=me.height,gt=Qt===void 0?400:Qt,yt=me.miniToolbar,rt=yt===void 0?!1:yt,ce=me.isFocus,Re=ce===void 0?!1:ce,At=me.watch,ot=me.insertTemp,Yt=me.mode,rn=Yt===void 0?"markdown":Yt,_e=me.id,Ne=_e===void 0?"markdown-editor-id":_e,xt=me.showResizeBar,Xt=xt===void 0?!1:xt,vn=me.noStorage,Mn=vn===void 0?!1:vn,ci=me.showNullButton,$n=ci===void 0?!1:ci,Cn=me.hidetoolBar,Ti=Cn===void 0?!1:Cn,Wi=me.fullScreen,hi=Wi===void 0?!1:Wi,fi=me.onBlur,ji=me.onCMBeforeChange,er=me.onFullScreen,yr=me.className,cn=yr===void 0?"":yr,ri=me.disablePaste,pr=ri===void 0?!1:ri,Cr=me.placeholder,tr=Cr===void 0?"":Cr,nr=me.values,X=nr===void 0?"":nr,S=Object(b.useState)(null),L=Object(H.a)(S,2),W=L[0],ne=L[1],Q=Object(b.useState)(Tt),ke=Object(H.a)(Q,2),Vt=ke[0],kn=ke[1],Qn=Object(b.useState)(At),nn=Object(H.a)(Qn,2),ti=nn[0],qn=nn[1],Li=Object(b.useState)(hi),lr=Object(H.a)(Li,2),ar=lr[0],Ki=lr[1],Pr=Object(b.useState)(""),Vr=Object(H.a)(Pr,2),Ai=Vr[0],wi=Vr[1],ir=Object(b.useState)(0),Fi=Object(H.a)(ir,2),Bn=Fi[0],gn=Fi[1],Tn=Object(b.useState)(gt),_n=Object(H.a)(Tn,2),si=_n[0],ai=_n[1],J=Object(b.useState)(!1),ue=Object(H.a)(J,2),Ce=ue[0],Te=ue[1],qe=Object(b.useRef)(Object(Bt.a)()),Oe=Object(b.useRef)(!1),Ve=Object(b.useRef)(),et=Object(b.useRef)(),Ot=Object(b.useRef)(),Et=Object(b.useRef)(),je=Object(b.useRef)(),ht=function(){var Dt=Object(M.a)(D.a.mark(function sn(){var Ft,St;return D.a.wrap(function(Sn){for(;;)switch(Sn.prev=Sn.next){case 0:return Sn.next=2,Object(Ze.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:qe.current}});case 2:St=Sn.sent,St!=null&&(Ft=St.attachments)!==null&&Ft!==void 0&&Ft.length&&(console.log("cm:",W,et),St.attachments.map(function(zt){zt.content_type.indexOf("image")>-1?W.replaceSelection(".concat(zt.content_type,")")):zt.content_type.indexOf("video")>-1?W.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):zt.content_type.indexOf("pdf")>-1?W.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat(zt.id,"?type=").concat(zt.content_type,'&disposition=inline" target="_blank">').concat(zt.name,"</a>")):W.replaceSelection("[".concat(zt.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(zt.id,"?type=").concat(zt.content_type,")"))}));case 4:case"end":return Sn.stop()}},sn)}));return function(){return Dt.apply(this,arguments)}}();Object(b.useEffect)(function(){kn(X),W==null||W.setValue(X)},[X]),Object(b.useEffect)(function(){er==null||er(ar)},[ar]),Object(b.useEffect)(function(){if(et.current){var Dt=d.a.fromTextArea(et.current,{mode:rn,lineNumbers:!rt,lineWrapping:!0,value:Tt,autoCloseTags:!0,autoCloseBrackets:!0});Re&&Dt.focus();function sn(Ft,St){if(pr){St.preventDefault();return}var Un=St.clipboardData;if(Un){var Sn=Un.types.toString(),zt=Un.items;if(Sn==="Files"||Un.types.indexOf("Files")>-1){if(St.preventDefault(),rn=="stex")return;try{var lt,jn=zt[1];((lt=zt[0])===null||lt===void 0?void 0:lt.kind)==="file"&&(jn=zt[0]);var ln=jn.getAsFile(),Jn=ln.name.split(".").pop();nt(ln,function($t){if($t.id){var On,Fn,hn;(ln==null||((On=ln.type)===null||On===void 0)?void 0:On.indexOf("image"))>-1?Dt.replaceSelection(".concat($t.content_type,")")):(ln==null||((Fn=ln.type)===null||Fn===void 0)?void 0:Fn.indexOf("video"))>-1?Dt.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat($t.id,'"></video>')):(ln==null||((hn=ln.type)===null||hn===void 0)?void 0:hn.indexOf("pdf"))>-1?Dt.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat($t.id,"?type=").concat(ln.type,'&disposition=inline" target="_blank">').concat(ln.name,"</a>")):ae.includes(Jn)?Dt.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat($t.id,'?type=office&disposition=inline" target="_blank">').concat(ln.name,"</a>")):Dt.replaceSelection("[".concat(ln.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat($t.id,"?type=").concat($t.content_type,")"))}else($t==null?void 0:$t.status)===401&&(document.location.href="/user/login")})}catch($t){A.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Dt.on("paste",sn),Dt.on("dragleave",function(Ft,St){Ot.current.classList.remove("mouse-hover-md")}),Dt.on("dragover",function(Ft,St){Ot.current.classList.add("mouse-hover-md")}),Dt.on("drop",function(Ft,St){Ot.current.classList.add("mouse-hover-md");var Un;if(Un=St.dataTransfer.files,Un.length>0){St.preventDefault(),St.stopPropagation();for(var Sn=function(jn){var ln=Un[jn],Jn=ln.name.split(".").pop();nt(ln,function($t){if($t.id){var On,Fn,hn;(ln==null||((On=ln.type)===null||On===void 0)?void 0:On.indexOf("image"))>-1?Dt.replaceSelection(".concat($t.content_type,")")):(ln==null||((Fn=ln.type)===null||Fn===void 0)?void 0:Fn.indexOf("video"))>-1?Dt.replaceSelection('<video width="100%" controls src="'.concat(c.a.API_SERVER,"/api/attachments/").concat($t.id,'"></video>')):(ln==null||((hn=ln.type)===null||hn===void 0)?void 0:hn.indexOf("pdf"))>-1?Dt.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat($t.id,"?type=").concat(ln.type,'&disposition=inline" target="_blank">').concat(ln.name,"</a>")):ae.includes(Jn)?Dt.replaceSelection('<a href="'.concat(c.a.API_SERVER,"/api/attachments/").concat($t.id,'?type=office&disposition=inline" target="_blank">').concat(ln.name,"</a>")):Dt.replaceSelection("[".concat(ln.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat($t.id,"?type=").concat($t.content_type,")"))}else($t==null?void 0:$t.status)===401&&(document.location.href="/user/login")})},zt=0;zt<Un.length;zt++)Sn(zt)}}),ne(Dt),function(){Dt.off("paste",sn)}}},[]);var it=Object(b.useCallback)(function(){if(Ot.current)try{}catch(Dt){console.log(Dt,"---- to set md editor body height")}},[si,Ot,ar]);Object(b.useEffect)(function(){function Dt(){var Ft=new s.default(function(St){var Un=Object(N.a)(St),Sn;try{for(Un.s();!(Sn=Un.n()).done;){var zt=Sn.value;(zt.target.offsetHeight>0||zt.target.offsetWidth>0)&&(it(),W.setSize("100%","100%"),W.refresh())}}catch(lt){Un.e(lt)}finally{Un.f()}});return Ft.observe(et.current.parentElement),Ft}if(W){var sn=Dt();return function(){sn.unobserve(et.current.parentElement)}}},[W,it]),Object(b.useEffect)(function(){if(W){for(var Dt=[],sn=function(){var zt=St[Ft];Un=Object(H.a)(zt,2);var lt=Un[0],jn=Un[1],ln=Object(P.a)({},lt,function(){st(jn)});Dt.push(ln),W.addKeyMap(ln)},Ft=0,St=Object.entries(re);Ft<St.length;Ft++){var Un;sn()}return Ve.current=setInterval(function(){Oe.current&&ht()},4e3),function(){clearInterval(Ve.current);var Sn=Object(N.a)(Dt),zt;try{for(Sn.s();!(zt=Sn.n()).done;){var lt=zt.value;W.removeKeyMap(lt)}}catch(jn){Sn.e(jn)}finally{Sn.f()}}}},[W]),Object(b.useEffect)(function(){hi!==ar&&Ki(hi)},[hi]),Object(fn.a)(function(){if(!Mn&&Bn>0){var Dt=new Date().getTime(),sn=window.sessionStorage.getItem(Ne);Dt>=Bn+Ct&&(!sn||sn!==Vt)&&(window.sessionStorage.setItem(Ne,Vt),Te(!0))}},Ct),Object(b.useEffect)(function(){qn(At)},[W,At]),Object(b.useEffect)(function(){W&&(Re&&W.focus())},[W,Re]),Object(b.useEffect)(function(){if(ti&&W){var Dt=W.getScrollerElement();function sn(Ft){var St=Ft.target;if(je.current){var Un=St.scrollTop/St.scrollHeight;je.current.scrollTop=je.current.scrollHeight*Un}}return Dt.addEventListener("scroll",sn),function(){Dt.removeEventListener("scroll",sn)}}},[W,ti]),Object(b.useEffect)(function(){if(W&&ji){function Dt(sn,Ft){ji(sn,Ft)}return W.on("beforeChange",Dt),function(){W.off("beforeChange",Dt)}}},[W,ji]),Object(b.useEffect)(function(){if(W&&fi){function Dt(){fi(W.getValue())}return W.on("blur",Dt),function(){W.off("blur",Dt)}}},[W,fi]),Object(b.useEffect)(function(){if(W){function Dt(sn){var Ft=sn.getValue();kn(Ft),gn(new Date().getTime()),sn.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Jt&&Jt(Ft)}return W.on("change",Dt),function(){W.off("change",Dt)}}},[W,Jt]),Object(b.useEffect)(function(){W&&(Tt==null?(W.setValue(""),kn("")):Tt!==W.getValue()&&(W.setValue(Tt),kn(Tt),W.setCursor(W.lineCount(),0)))},[W,Tt]);var st=Object(b.useCallback)(function(Dt){var sn=W.getCursor(),Ft=W.getSelection(),St=Ft.split(`
|
|
`);switch(Dt){case"bold":return W.replaceSelection("**"+Ft+"**"),Ft===""&&W.setCursor(sn.line,sn.ch+2),W.focus();case"italic":return W.replaceSelection("*"+Ft+"*"),Ft===""&&W.setCursor(sn.line,sn.ch+1),W.focus();case"code":return W.replaceSelection("`"+Ft+"`"),Ft===""&&W.setCursor(sn.line,sn.ch+1),W.focus();case"inline-latex":return W.replaceSelection("`$$"+Ft+"$$`"),Ft===""&&W.setCursor(sn.line,sn.ch+3),W.focus();case"latex":return W.replaceSelection("```latex\n"+Ft+"\n```"),W.setCursor(sn.line+1,Ft.length+1),W.focus();case"line-break":return W.replaceSelection(`<br/>
|
|
`),W.focus();case"list-ul":return Ft===""?W.replaceSelection("- "+Ft):W.replaceSelection(St.map(function(Un){return Un===""?"":"- ".concat(Un)}).join(`
|
|
`)),W.focus();case"list-ol":return Ft===""?W.replaceSelection("1. "+Ft):W.replaceSelection(St.map(function(Un,Sn){return Un===""?"":"".concat(Sn+1,". ").concat(Un)}).join(`
|
|
`)),W.focus();case"add-null-ch":return Ft===""&&W.setCursor(sn.line,sn.ch+1),W.replaceSelection(Ge),W.focus();case"inster-template-1":return Ft===""&&W.setCursor(sn.line,sn.ch),W.replaceSelection(vt),W.focus();case"eraser":return W.setValue(""),W.focus();case"trigger-watch":return qn(!ti),W.focus();case"trigger-full-screen":return Ki(!ar),W.focus();case Ut:wi(Ut);return;case An:wi(An);return;case Mt:wi(Mt);return;case mn:wi(mn);return;default:throw new Error}},[W,ti,ar]),bt=Object(b.useCallback)(function(Dt){wi("");switch(Ai){case Ut:var sn=Dt.title,Ft=Dt.link;return W.replaceSelection("[".concat(sn,"](").concat(Ft,")")),W.focus();case An:var St=Dt.language,Un=Dt.content;return W.replaceSelection(["```"+St,Un,"```"].join(`
|
|
`)),W.focus();case Mt:var Sn=Dt.src,zt=Dt.alt;return zt?W.replaceSelection(".concat(Sn,' "').concat(zt,'" )')):W.replaceSelection("")),W.focus();case mn:for(var lt=Dt.row,jn=Dt.col,ln=Dt.align,Jn=`
|
|
`,$t=0;$t<lt;$t++){for(var On=[],Fn=[],hn=0;hn<jn;hn++)$t===1&&Fn.push(tt[ln]),On.push(" ");$t===1&&(Jn+="| ".concat(Fn.join(" | "),` |
|
|
`)),Jn+="| ".concat(On.join(jn===1?"":" | "),` |
|
|
`)}return W.replaceSelection(Jn+`
|
|
`),W.focus();default:throw new Error}},[W,Ai]),Lt=Object(b.useMemo)(function(){switch(Ai){case Ut:return m.a.createElement(oe,{callback:bt,onCancel:ct});case An:return m.a.createElement(pe.b,{callback:bt,onCancel:ct});case Mt:return m.a.createElement(be,{callback:bt,onCancel:ct});case mn:return m.a.createElement(Nt,{callback:bt,onCancel:ct});default:return null}},[Ai]);function ct(){wi("")}Object(b.useEffect)(function(){if(Et.current){var Dt=Et.current,sn=!1,Ft=0;function St(zt){sn=!0,Ft=zt.pageY}function Un(){sn=!1}function Sn(zt){if(sn){var lt=zt.pageY-Ft;lt<0&&(lt=0),lt>300&&(lt=300);var jn=gt+lt+"px";ai(jn)}}return Dt.addEventListener("mousedown",St),document.addEventListener("mousemove",Sn),document.addEventListener("mouseup",Un),function(){Dt.removeEventListener("mousedown",St),document.removeEventListener("mousemove",Sn),document.removeEventListener("mouseup",Un)}}},[W,Et]),Object(b.useEffect)(function(){ai(gt)},[gt]);var Gt=Ae(mt),on=Ae(si),Dn={width:Gt,height:on},Kn=Object(b.useMemo)(function(){if(Bn){var Dt=new Date(Bn),sn=Dt.getHours(),Ft=Dt.getMinutes(),St=Dt.getSeconds();return sn=sn<10?"0"+sn:sn,Ft=Ft<10?"0"+Ft:Ft,St=St<10?"0"+St:St,"".concat(sn,":").concat(Ft,":").concat(St)}return 0},[Bn]);function wn(){window.sessionStorage.removeItem(Ne),Te(!1),gn(0)}function Nn(){Te(!1),gn(0),W.setValue(window.sessionStorage.getItem(Ne))}function Pn(Dt,sn){var Ft=W.getValue();Ft=Ft.replace(Dt,sn),kn(Ft),W==null||W.setValue(Ft)}return m.a.createElement(b.Fragment,null,m.a.createElement("div",{className:"markdown-editor-wrapper",ref:Ot},m.a.createElement("div",{className:"markdown-editor-container ".concat(cn," ").concat(ti?"on-preview":""," ").concat(rt?"mini":""," ").concat(ar?"full-screen":""),style:Dn},m.a.createElement(E,{insertTemp:ot,watch:ti,fullScreen:ar,showNullButton:$n,onActionCallback:st,hidetoolBar:Ti,uuid:qe.current,setOpenPhones:function(){Oe.current=!0}}),m.a.createElement("div",{className:"markdown-editor-body"},m.a.createElement("div",{className:"codemirror-container"},m.a.createElement("textarea",{ref:et,placeholder:tr})),ti?m.a.createElement("div",{ref:je,className:"preview-container"},rn==="stex"&&m.a.createElement(O,{value:Vt}),rn!=="stex"&&m.a.createElement(x.a,{edit:!0,value:Vt,replaces:Pn})):null))),Xt?m.a.createElement("a",{ref:Et,className:"editor-resize"}):null,m.a.createElement(U.a,null,he[Ai]?m.a.createElement(Y.a,{centered:!0,title:he[Ai],visible:!0,onCancel:ct,footer:null,className:"markdown-popup-form"},Lt):null))}},RotF:function(tn,Qe,I){tn.exports=I("LSTS")},"SA+Z":function(tn,Qe,I){var te=I("wTVA"),Y=I("EbDI"),N=I("ZhPi"),K=I("wkBT");function A(M){return te(M)||Y(M)||N(M)||K()}tn.exports=A,tn.exports.__esModule=!0,tn.exports.default=tn.exports},SJMd:function(tn,Qe){/**
|
|
* @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 I,te,Y,N=!1,K,A;window.PR_SHOULD_USE_CONTINUATION=!0;var M,H;(function(){var P=window,k=["break,continue,do,else,for,if,return,while"],D=[k,"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"],b=[D,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],m=[b,"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"],f=[b,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],d=[b,"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"],s="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",r=[b,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],u="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",o=[k,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],a=[k,"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"],n=[k,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=[m,d,f,r,u,o,a,n],w=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,x="str",O="kwd",C="com",_="typ",y="lit",h="pun",c="pln",v="tag",p="dec",E="src",U="atn",F="atv",z="nocode",G="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function B(ft){for(var dt=0,Nt=!1,Ze=!1,Bt=0,Ut=ft.length;Bt<Ut;++Bt){var Mt=ft[Bt];if(Mt.ignoreCase)Ze=!0;else if(/[a-z]/i.test(Mt.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Nt=!0,Ze=!1;break}}var An={b:8,t:9,n:10,v:11,f:12,r:13};function mn(He){var Ue=He.charCodeAt(0);if(Ue!==92)return Ue;var pt=He.charAt(1);return Ue=An[pt],Ue||("0"<=pt&&pt<="7"?parseInt(He.substring(1),8):pt==="u"||pt==="x"?parseInt(He.substring(2),16):He.charCodeAt(1))}function pn(He){if(He<32)return(He<16?"\\x0":"\\x")+He.toString(16);var Ue=String.fromCharCode(He);return Ue==="\\"||Ue==="-"||Ue==="]"||Ue==="^"?"\\"+Ue:Ue}function tt(He){var Ue=He.substring(1,He.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")),pt=[],Ct=Ue[0]==="^",Ge=["["];Ct&&Ge.push("^");for(var vt=Ct?1:0,Ae=Ue.length;vt<Ae;++vt){var ge=Ue[vt];if(/\\[bdsw]/i.test(ge))Ge.push(ge);else{var Ee=mn(ge),ae;vt+2<Ae&&Ue[vt+1]==="-"?(ae=mn(Ue[vt+2]),vt+=2):ae=Ee,pt.push([Ee,ae]),ae<65||Ee>122||(ae<65||Ee>90||pt.push([Math.max(65,Ee)|32,Math.min(ae,90)|32]),ae<97||Ee>122||pt.push([Math.max(97,Ee)&~32,Math.min(ae,122)&~32]))}}pt.sort(function(me,Be){return me[0]-Be[0]||Be[1]-me[1]});for(var re=[],he=[],vt=0;vt<pt.length;++vt){var ve=pt[vt];ve[0]<=he[1]+1?he[1]=Math.max(he[1],ve[1]):re.push(he=ve)}for(var vt=0;vt<re.length;++vt){var ve=re[vt];Ge.push(pn(ve[0])),ve[1]>ve[0]&&(ve[1]+1>ve[0]&&Ge.push("-"),Ge.push(pn(ve[1])))}return Ge.push("]"),Ge.join("")}function fn(He){for(var Ue=He.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")),pt=Ue.length,Ct=[],Ge=0,vt=0;Ge<pt;++Ge){var Ae=Ue[Ge];if(Ae==="(")++vt;else if(Ae.charAt(0)==="\\"){var ge=+Ae.substring(1);ge&&(ge<=vt?Ct[ge]=-1:Ue[Ge]=pn(ge))}}for(var Ge=1;Ge<Ct.length;++Ge)Ct[Ge]===-1&&(Ct[Ge]=++dt);for(var Ge=0,vt=0;Ge<pt;++Ge){var Ae=Ue[Ge];if(Ae==="(")++vt,Ct[vt]||(Ue[Ge]="(?:");else if(Ae.charAt(0)==="\\"){var ge=+Ae.substring(1);ge&&ge<=vt&&(Ue[Ge]="\\"+Ct[ge])}}for(var Ge=0;Ge<pt;++Ge)Ue[Ge]==="^"&&Ue[Ge+1]!=="^"&&(Ue[Ge]="");if(He.ignoreCase&&Nt)for(var Ge=0;Ge<pt;++Ge){var Ae=Ue[Ge],Ee=Ae.charAt(0);Ae.length>=2&&Ee==="["?Ue[Ge]=tt(Ae):Ee!=="\\"&&(Ue[Ge]=Ae.replace(/[a-zA-Z]/g,function(he){var ve=he.charCodeAt(0);return"["+String.fromCharCode(ve&~32,ve|32)+"]"}))}return Ue.join("")}for(var In=[],Bt=0,Ut=ft.length;Bt<Ut;++Bt){var Mt=ft[Bt];if(Mt.global||Mt.multiline)throw new Error(""+Mt);In.push("(?:"+fn(Mt)+")")}return new RegExp(In.join("|"),Ze?"gi":"g")}function T(ft,dt){var Nt=/(?:^|\s)nocode(?:\s|$)/,Ze=[],Bt=0,Ut=[],Mt=0;function An(mn){var pn=mn.nodeType;if(pn==1){if(Nt.test(mn.className))return;for(var tt=mn.firstChild;tt;tt=tt.nextSibling)An(tt);var fn=mn.nodeName.toLowerCase();(fn==="br"||fn==="li")&&(Ze[Mt]=`
|
|
`,Ut[Mt<<1]=Bt++,Ut[Mt++<<1|1]=mn)}else if(pn==3||pn==4){var In=mn.nodeValue;In.length&&(dt?In=In.replace(/\r\n?/g,`
|
|
`):In=In.replace(/[ \t\r\n]+/g," "),Ze[Mt]=In,Ut[Mt<<1]=Bt,Bt+=In.length,Ut[Mt++<<1|1]=mn)}}return An(ft),{sourceCode:Ze.join("").replace(/\n$/,""),spans:Ut}}function V(ft,dt,Nt,Ze,Bt){if(!Nt)return;var Ut={sourceNode:ft,pre:1,langExtension:null,numberLines:null,sourceCode:Nt,spans:null,basePos:dt,decorations:null};Ze(Ut),Bt.push.apply(Bt,Ut.decorations)}var Z=/\S/;function oe(ft){for(var dt=void 0,Nt=ft.firstChild;Nt;Nt=Nt.nextSibling){var Ze=Nt.nodeType;dt=Ze===1?dt?ft:Nt:Ze===3&&Z.test(Nt.nodeValue)?ft:dt}return dt===ft?void 0:dt}function pe(ft,dt){var Nt={},Ze;(function(){for(var Mt=ft.concat(dt),An=[],mn={},pn=0,tt=Mt.length;pn<tt;++pn){var fn=Mt[pn],In=fn[3];if(In)for(var He=In.length;--He>=0;)Nt[In.charAt(He)]=fn;var Ue=fn[1],pt=""+Ue;mn.hasOwnProperty(pt)||(An.push(Ue),mn[pt]=null)}An.push(/[\0-\uffff]/),Ze=B(An)})();var Bt=dt.length,Ut=function(Mt){for(var An=Mt.sourceCode,mn=Mt.basePos,pn=Mt.sourceNode,tt=[mn,c],fn=0,In=An.match(Ze)||[],He={},Ue=0,pt=In.length;Ue<pt;++Ue){var Ct=In[Ue],Ge=He[Ct],vt=void 0,Ae;if(typeof Ge=="string")Ae=!1;else{var ge=Nt[Ct.charAt(0)];if(ge)vt=Ct.match(ge[1]),Ge=ge[0];else{for(var Ee=0;Ee<Bt;++Ee)if(ge=dt[Ee],vt=Ct.match(ge[1]),vt){Ge=ge[0];break}vt||(Ge=c)}Ae=Ge.length>=5&&Ge.substring(0,5)==="lang-",Ae&&!(vt&&typeof vt[1]=="string")&&(Ae=!1,Ge=E),Ae||(He[Ct]=Ge)}var ae=fn;if(fn+=Ct.length,!Ae)tt.push(mn+ae,Ge);else{var re=vt[1],he=Ct.indexOf(re),ve=he+re.length;vt[2]&&(ve=Ct.length-vt[2].length,he=ve-re.length);var me=Ge.substring(5);V(pn,mn+ae,Ct.substring(0,he),Ut,tt),V(pn,mn+ae+he,re,de(me,re),tt),V(pn,mn+ae+ve,Ct.substring(ve),Ut,tt)}}Mt.decorations=tt};return Ut}function Ye(ft){var dt=[],Nt=[];ft.tripleQuotedStrings?dt.push([x,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ft.multiLineStrings?dt.push([x,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):dt.push([x,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ft.verbatimStrings&&Nt.push([x,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ze=ft.hashComments;Ze&&(ft.cStyleComments?(Ze>1?dt.push([C,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):dt.push([C,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Nt.push([x,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):dt.push([C,/^#[^\r\n]*/,null,"#"])),ft.cStyleComments&&(Nt.push([C,/^\/\/[^\r\n]*/,null]),Nt.push([C,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Bt=ft.regexLiterals;if(Bt){var Ut=Bt>1?"":`
|
|
\r`,Mt=Ut?".":"[\\S\\s]",An="/(?=[^/*"+Ut+"])(?:[^/\\x5B\\x5C"+Ut+"]|\\x5C"+Mt+"|\\x5B(?:[^\\x5C\\x5D"+Ut+"]|\\x5C"+Mt+")*(?:\\x5D|$))+/";Nt.push(["lang-regex",RegExp("^"+G+"("+An+")")])}var mn=ft.types;mn&&Nt.push([_,mn]);var pn=(""+ft.keywords).replace(/^ | $/g,"");pn.length&&Nt.push([O,new RegExp("^(?:"+pn.replace(/[\s,]+/g,"|")+")\\b"),null]),dt.push([c,/^\s+/,null,` \r
|
|
\xA0`]);var tt="^.[^\\s\\w.$@'\"`/\\\\]*";return ft.regexLiterals&&(tt+="(?!s*/)"),Nt.push([y,/^@[a-z_$][a-z_$@0-9]*/i,null],[_,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[c,/^[a-z_$][a-z_$@0-9]*/i,null],[y,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[c,/^\\[\s\S]?/,null],[h,new RegExp(tt),null]),pe(dt,Nt)}var xe=Ye({keywords:R,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ie(ft,dt,Nt){for(var Ze=/(?:^|\s)nocode(?:\s|$)/,Bt=/\r\n?|\n/,Ut=ft.ownerDocument,Mt=Ut.createElement("li");ft.firstChild;)Mt.appendChild(ft.firstChild);var An=[Mt];function mn(Ue){var pt=Ue.nodeType;if(pt==1&&!Ze.test(Ue.className))if(Ue.nodeName==="br")pn(Ue),Ue.parentNode&&Ue.parentNode.removeChild(Ue);else for(var Ct=Ue.firstChild;Ct;Ct=Ct.nextSibling)mn(Ct);else if((pt==3||pt==4)&&Nt){var Ge=Ue.nodeValue,vt=Ge.match(Bt);if(vt){var Ae=Ge.substring(0,vt.index);Ue.nodeValue=Ae;var ge=Ge.substring(vt.index+vt[0].length);if(ge){var Ee=Ue.parentNode;Ee.insertBefore(Ut.createTextNode(ge),Ue.nextSibling)}pn(Ue),Ae||Ue.parentNode.removeChild(Ue)}}}function pn(Ue){for(;!Ue.nextSibling;)if(Ue=Ue.parentNode,!Ue)return;function pt(vt,Ae){var ge=Ae?vt.cloneNode(!1):vt,Ee=vt.parentNode;if(Ee){var ae=pt(Ee,1),re=vt.nextSibling;ae.appendChild(ge);for(var he=re;he;he=re)re=he.nextSibling,ae.appendChild(he)}return ge}for(var Ct=pt(Ue.nextSibling,0),Ge;(Ge=Ct.parentNode)&&Ge.nodeType===1;)Ct=Ge;An.push(Ct)}for(var tt=0;tt<An.length;++tt)mn(An[tt]);dt===(dt|0)&&An[0].setAttribute("value",dt);var fn=Ut.createElement("ol");fn.className="linenums";for(var In=Math.max(0,dt-1|0)||0,tt=0,He=An.length;tt<He;++tt)Mt=An[tt],Mt.className="L"+(tt+In)%10,Mt.firstChild||Mt.appendChild(Ut.createTextNode("\xA0")),fn.appendChild(Mt);ft.appendChild(fn)}function Je(ft){var dt=/\bMSIE\s(\d+)/.exec(navigator.userAgent);dt=dt&&+dt[1]<=8;var Nt=/\n/g,Ze=ft.sourceCode,Bt=Ze.length,Ut=0,Mt=ft.spans,An=Mt.length,mn=0,pn=ft.decorations,tt=pn.length,fn=0;pn[tt]=Bt;var In,He;for(He=In=0;He<tt;)pn[He]!==pn[He+2]?(pn[In++]=pn[He++],pn[In++]=pn[He++]):He+=2;for(tt=In,He=In=0;He<tt;){for(var Ue=pn[He],pt=pn[He+1],Ct=He+2;Ct+2<=tt&&pn[Ct+1]===pt;)Ct+=2;pn[In++]=Ue,pn[In++]=pt,He=Ct}tt=pn.length=In;var Ge=ft.sourceNode,vt="";Ge&&(vt=Ge.style.display,Ge.style.display="none");try{for(var Ae=null;mn<An;){var ge=Mt[mn],Ee=Mt[mn+2]||Bt,ae=pn[fn+2]||Bt,Ct=Math.min(Ee,ae),re=Mt[mn+1],he;if(re.nodeType!==1&&(he=Ze.substring(Ut,Ct))){dt&&(he=he.replace(Nt,"\r")),re.nodeValue=he;var ve=re.ownerDocument,me=ve.createElement("span");me.className=pn[fn+1];var Be=re.parentNode;Be.replaceChild(me,re),me.appendChild(re),Ut<Ee&&(Mt[mn+1]=re=ve.createTextNode(Ze.substring(Ct,Ee)),Be.insertBefore(re,me.nextSibling))}Ut=Ct,Ut>=Ee&&(mn+=2),Ut>=ae&&(fn+=2)}}finally{Ge&&(Ge.style.display=vt)}}var Ke={};function be(ft,dt){for(var Nt=dt.length;--Nt>=0;){var Ze=dt[Nt];Ke.hasOwnProperty(Ze)?P.console&&console.warn("cannot override language handler %s",Ze):Ke[Ze]=ft}}function de(ft,dt){return ft&&Ke.hasOwnProperty(ft)||(ft=/^\s*</.test(dt)?"default-markup":"default-code"),Ke[ft]}be(xe,["default-code"]),be(pe([],[[c,/^[^<?]+/],[p,/^<!\w[^>]*(?:>|$)/],[C,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[h,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),be(pe([[c,/^[\s]+/,null,` \r
|
|
`],[F,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[v,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[U,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[h,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),be(pe([],[[F,/^[\s\S]+/]]),["uq.val"]),be(Ye({keywords:m,hashComments:!0,cStyleComments:!0,types:w}),["c","cc","cpp","cxx","cyc","m"]),be(Ye({keywords:"null,true,false"}),["json"]),be(Ye({keywords:d,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:w}),["cs"]),be(Ye({keywords:f,cStyleComments:!0}),["java"]),be(Ye({keywords:n,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),be(Ye({keywords:o,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),be(Ye({keywords:u,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),be(Ye({keywords:a,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),be(Ye({keywords:r,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),be(Ye({keywords:s,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),be(pe([],[[x,/^[\s\S]+/]]),["regex"]);function nt(ft){var dt=ft.langExtension;try{var Nt=T(ft.sourceNode,ft.pre),Ze=Nt.sourceCode;ft.sourceCode=Ze,ft.spans=Nt.spans,ft.basePos=0,de(dt,Ze)(ft),Je(ft)}catch(Bt){P.console&&console.log(Bt&&Bt.stack||Bt)}}function Kt(ft,dt,Nt){var Ze=Nt||!1,Bt=dt||null,Ut=document.createElement("div");Ut.innerHTML="<pre>"+ft+"</pre>",Ut=Ut.firstChild,Ze&&Ie(Ut,Ze,!0);var Mt={langExtension:Bt,numberLines:Ze,sourceNode:Ut,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return nt(Mt),Ut.innerHTML}function jt(ft,dt){var Nt=dt||document.body,Ze=Nt.ownerDocument||document;function Bt(ge){return Nt.getElementsByTagName(ge)}for(var Ut=[Bt("pre"),Bt("code"),Bt("xmp")],Mt=[],An=0;An<Ut.length;++An)for(var mn=0,pn=Ut[An].length;mn<pn;++mn)Mt.push(Ut[An][mn]);Ut=null;var tt=Date;tt.now||(tt={now:function(){return+new Date}});var fn=0,In=/\blang(?:uage)?-([\w.]+)(?!\S)/,He=/\bprettyprint\b/,Ue=/\bprettyprinted\b/,pt=/pre|xmp/i,Ct=/^code$/i,Ge=/^(?:pre|code|xmp)$/i,vt={};function Ae(){for(var ge=P.PR_SHOULD_USE_CONTINUATION?tt.now()+250:Infinity;fn<Mt.length&&tt.now()<ge;fn++){for(var Ee=Mt[fn],ae=vt,re=Ee;re=re.previousSibling;){var he=re.nodeType,ve=(he===7||he===8)&&re.nodeValue;if(ve?!/^\??prettify\b/.test(ve):he!==3||/\S/.test(re.nodeValue))break;if(ve){ae={},ve.replace(/\b(\w+)=([\w:.%+-]+)/g,function(At,ot,Yt){ae[ot]=Yt});break}}var me=Ee.className;if((ae!==vt||He.test(me))&&!Ue.test(me)){for(var Be=!1,Tt=Ee.parentNode;Tt;Tt=Tt.parentNode){var Jt=Tt.tagName;if(Ge.test(Jt)&&Tt.className&&He.test(Tt.className)){Be=!0;break}}if(!Be){Ee.className+=" prettyprinted";var En=ae.lang;if(!En){En=me.match(In);var mt;!En&&(mt=oe(Ee))&&Ct.test(mt.tagName)&&(En=mt.className.match(In)),En&&(En=En[1])}var Qt;if(pt.test(Ee.tagName))Qt=1;else{var gt=Ee.currentStyle,yt=Ze.defaultView,rt=gt?gt.whiteSpace:yt&&yt.getComputedStyle?yt.getComputedStyle(Ee,null).getPropertyValue("white-space"):0;Qt=rt&&rt.substring(0,3)==="pre"}var ce=ae.linenums;(ce=ce==="true"||+ce)||(ce=me.match(/\blinenums\b(?::(\d+))?/),ce=ce?ce[1]&&ce[1].length?+ce[1]:!0:!1),ce&&Ie(Ee,ce,Qt);var Re={langExtension:En,sourceNode:Ee,numberLines:ce,pre:Qt,sourceCode:null,basePos:null,spans:null,decorations:null};nt(Re)}}}fn<Mt.length?P.setTimeout(Ae,250):typeof ft=="function"&&ft()}Ae()}var wt=P.PR={createSimpleLexer:pe,registerLangHandler:be,sourceDecorator:Ye,PR_ATTRIB_NAME:U,PR_ATTRIB_VALUE:F,PR_COMMENT:C,PR_DECLARATION:p,PR_KEYWORD:O,PR_LITERAL:y,PR_NOCODE:z,PR_PLAIN:c,PR_PUNCTUATION:h,PR_SOURCE:E,PR_STRING:x,PR_TAG:v,PR_TYPE:_,prettyPrintOne:N?P.prettyPrintOne=Kt:M=Kt,prettyPrint:H=N?P.prettyPrint=jt:H=jt},ze=P.define;typeof ze=="function"&&ze.amd&&ze("google-code-prettify",[],function(){return wt})})()},T7RX:function(tn,Qe,I){"use strict";var te=I("2qtc"),Y=I("kLXV"),N=I("k1fw"),K=I("miYZ"),A=I("tsqr"),M=I("9og8"),H=I("PpiC"),P=I("WmNS"),k=I.n(P),D=I("q1tI"),b=I.n(D),m=I("ErOA"),f=I("Ty5D"),d=I("9kvl"),s=function(u){var o=u.shixunHomeworks,a=u.dispatch,n=Object(H.a)(u,["shixunHomeworks","dispatch"]),R=Object(f.i)();return b.a.createElement(Y.a,{centered:!0,title:"\u63D0\u793A",visible:o.actionTabs.key==="\u6253\u56DE\u91CD\u505A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(M.a)(k.a.mark(function w(){var x;return k.a.wrap(function(C){for(;;)switch(C.prev=C.next){case 0:return C.next=2,Object(m.a)("/api/myshixuns/".concat(o.actionTabs.selectArrs.myshixun_identifier,"/reset_my_game.json"),{method:"GET",params:{course_id:R.coursesId}});case 2:x=C.sent,x.shixun_identifier&&(A.b.success("\u64CD\u4F5C\u6210\u529F"),a({type:"shixunHomeworks/setActionTabs",payload:{}}),a({type:"shixunHomeworks/getWorkList",payload:Object(N.a)({},o.actionTabs.params)}));case 4:case"end":return C.stop()}},w)})),onCancel:function(){a({type:"shixunHomeworks/setActionTabs",payload:{}})}},b.a.createElement("p",null,"\u8BE5\u4F5C\u4E1A\u5C06\u88AB\u6253\u56DE\u91CD\u505A\uFF0C\u5B66\u751F\u5B9E\u8BAD\u8BB0\u5F55\u5C06\u88AB\u6E05\u7A7A!"),b.a.createElement("p",null,"\u786E\u5B9A\u6253\u56DE?"))};Qe.a=Object(d.a)(function(r){var u=r.shixunHomeworks;return{shixunHomeworks:u}})(s)},TXwP:function(tn,Qe,I){var te,Y;(function(){var N;(function(){"use strict";var A=[,,function(k){function D(f){this.__parent=f,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=[]}D.prototype.clone_empty=function(){var f=new D(this.__parent);return f.set_indent(this.__indent_count,this.__alignment_count),f},D.prototype.item=function(f){return f<0?this.__items[this.__items.length+f]:this.__items[f]},D.prototype.has_match=function(f){for(var d=this.__items.length-1;d>=0;d--)if(this.__items[d].match(f))return!0;return!1},D.prototype.set_indent=function(f,d){this.is_empty()&&(this.__indent_count=f||0,this.__alignment_count=d||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},D.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)},D.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},D.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var f=this.__parent.current_line;return f.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),f.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),f.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,f.__items[0]===" "&&(f.__items.splice(0,1),f.__character_count-=1),!0}return!1},D.prototype.is_empty=function(){return this.__items.length===0},D.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},D.prototype.push=function(f){this.__items.push(f);var d=f.lastIndexOf(`
|
|
`);d!==-1?this.__character_count=f.length-d:this.__character_count+=f.length},D.prototype.pop=function(){var f=null;return this.is_empty()||(f=this.__items.pop(),this.__character_count-=f.length),f},D.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},D.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},D.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},D.prototype.toString=function(){var f="";return this.is_empty()?this.__parent.indent_empty_lines&&(f=this.__parent.get_indent_string(this.__indent_count)):(f=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),f+=this.__items.join("")),f};function b(f,d){this.__cache=[""],this.__indent_size=f.indent_size,this.__indent_string=f.indent_char,f.indent_with_tabs||(this.__indent_string=new Array(f.indent_size+1).join(f.indent_char)),d=d||"",f.indent_level>0&&(d=new Array(f.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}b.prototype.get_indent_size=function(f,d){var s=this.__base_string_length;return d=d||0,f<0&&(s=0),s+=f*this.__indent_size,s+=d,s},b.prototype.get_indent_string=function(f,d){var s=this.__base_string;return d=d||0,f<0&&(f=0,s=""),d+=f*this.__indent_size,this.__ensure_cache(d),s+=this.__cache[d],s},b.prototype.__ensure_cache=function(f){for(;f>=this.__cache.length;)this.__add_column()},b.prototype.__add_column=function(){var f=this.__cache.length,d=0,s="";this.__indent_size&&f>=this.__indent_size&&(d=Math.floor(f/this.__indent_size),f-=d*this.__indent_size,s=new Array(d+1).join(this.__indent_string)),f&&(s+=new Array(f+1).join(" ")),this.__cache.push(s)};function m(f,d){this.__indent_cache=new b(f,d),this.raw=!1,this._end_with_newline=f.end_with_newline,this.indent_size=f.indent_size,this.wrap_line_length=f.wrap_line_length,this.indent_empty_lines=f.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new D(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(f,d){return this.__indent_cache.get_indent_string(f,d)},m.prototype.get_indent_size=function(f,d){return this.__indent_cache.get_indent_size(f,d)},m.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},m.prototype.add_new_line=function(f){return this.is_empty()||!f&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},m.prototype.get_code=function(f){this.trim(!0);var d=this.current_line.pop();d&&(d[d.length-1]===`
|
|
`&&(d=d.replace(/\n+$/g,"")),this.current_line.push(d)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(`
|
|
`);return f!==`
|
|
`&&(s=s.replace(/[\n]/g,f)),s},m.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},m.prototype.set_indent=function(f,d){return f=f||0,d=d||0,this.next_line.set_indent(f,d),this.__lines.length>1?(this.current_line.set_indent(f,d),!0):(this.current_line.set_indent(),!1)},m.prototype.add_raw_token=function(f){for(var d=0;d<f.newlines;d++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(f.whitespace_before),this.current_line.push(f.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},m.prototype.add_token=function(f){this.__add_space_before_token(),this.current_line.push(f),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(f){for(var d=this.__lines.length;f<d;)this.__lines[f]._remove_indent(),f++;this.current_line._remove_wrap_indent()},m.prototype.trim=function(f){for(f=f===void 0?!1:f,this.current_line.trim();f&&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(f,d){for(var s=this.__lines.length-2;s>=0;){var r=this.__lines[s];if(r.is_empty())break;if(r.item(0).indexOf(f)!==0&&r.item(-1)!==d){this.__lines.splice(s+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},k.exports.Output=m},,,,function(k){function D(f,d){this.raw_options=b(f,d),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"])}D.prototype._get_array=function(f,d){var s=this.raw_options[f],r=d||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(r=s.concat()):typeof s=="string"&&(r=s.split(/[^a-zA-Z0-9_\/\-]+/)),r},D.prototype._get_boolean=function(f,d){var s=this.raw_options[f],r=s===void 0?!!d:!!s;return r},D.prototype._get_characters=function(f,d){var s=this.raw_options[f],r=d||"";return typeof s=="string"&&(r=s.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),r},D.prototype._get_number=function(f,d){var s=this.raw_options[f];d=parseInt(d,10),isNaN(d)&&(d=0);var r=parseInt(s,10);return isNaN(r)&&(r=d),r},D.prototype._get_selection=function(f,d,s){var r=this._get_selection_list(f,d,s);if(r.length!==1)throw new Error("Invalid Option Value: The option '"+f+`' can only be one of the following values:
|
|
`+d+`
|
|
You passed in: '`+this.raw_options[f]+"'");return r[0]},D.prototype._get_selection_list=function(f,d,s){if(!d||d.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[d[0]],!this._is_valid_selection(s,d))throw new Error("Invalid Default Value!");var r=this._get_array(f,s);if(!this._is_valid_selection(r,d))throw new Error("Invalid Option Value: The option '"+f+`' can contain only the following values:
|
|
`+d+`
|
|
You passed in: '`+this.raw_options[f]+"'");return r},D.prototype._is_valid_selection=function(f,d){return f.length&&d.length&&!f.some(function(s){return d.indexOf(s)===-1})};function b(f,d){var s={};f=m(f);var r;for(r in f)r!==d&&(s[r]=f[r]);if(d&&f[d])for(r in f[d])s[r]=f[d][r];return s}function m(f){var d={},s;for(s in f){var r=s.replace(/-/g,"_");d[r]=f[s]}return d}k.exports.Options=D,k.exports.normalizeOpts=m,k.exports.mergeOpts=b},,function(k){var D=RegExp.prototype.hasOwnProperty("sticky");function b(m){this.__input=m||"",this.__input_length=this.__input.length,this.__position=0}b.prototype.restart=function(){this.__position=0},b.prototype.back=function(){this.__position>0&&(this.__position-=1)},b.prototype.hasNext=function(){return this.__position<this.__input_length},b.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__input.charAt(this.__position),this.__position+=1),m},b.prototype.peek=function(m){var f=null;return m=m||0,m+=this.__position,m>=0&&m<this.__input_length&&(f=this.__input.charAt(m)),f},b.prototype.__match=function(m,f){m.lastIndex=f;var d=m.exec(this.__input);return d&&!(D&&m.sticky)&&(d.index!==f&&(d=null)),d},b.prototype.test=function(m,f){return f=f||0,f+=this.__position,f>=0&&f<this.__input_length?!!this.__match(m,f):!1},b.prototype.testChar=function(m,f){var d=this.peek(f);return m.lastIndex=0,d!==null&&m.test(d)},b.prototype.match=function(m){var f=this.__match(m,this.__position);return f?this.__position+=f[0].length:f=null,f},b.prototype.read=function(m,f,d){var s="",r;return m&&(r=this.match(m),r&&(s+=r[0])),f&&(r||!m)&&(s+=this.readUntil(f,d)),s},b.prototype.readUntil=function(m,f){var d="",s=this.__position;m.lastIndex=this.__position;var r=m.exec(this.__input);return r?(s=r.index,f&&(s+=r[0].length)):s=this.__input_length,d=this.__input.substring(this.__position,s),this.__position=s,d},b.prototype.readUntilAfter=function(m){return this.readUntil(m,!0)},b.prototype.get_regexp=function(m,f){var d=null,s="g";return f&&D&&(s="y"),typeof m=="string"&&m!==""?d=new RegExp(m,s):m&&(d=new RegExp(m.source,s)),d},b.prototype.get_literal_regexp=function(m){return RegExp(m.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},b.prototype.peekUntilAfter=function(m){var f=this.__position,d=this.readUntilAfter(m);return this.__position=f,d},b.prototype.lookBack=function(m){var f=this.__position-1;return f>=m.length&&this.__input.substring(f-m.length,f).toLowerCase()===m},k.exports.InputScanner=b},,,,,function(k){function D(b,m){b=typeof b=="string"?b:b.source,m=typeof m=="string"?m:m.source,this.__directives_block_pattern=new RegExp(b+/ beautify( \w+[:]\w+)+ /.source+m,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(b+/\sbeautify\signore:end\s/.source+m,"g")}D.prototype.get_directives=function(b){if(!b.match(this.__directives_block_pattern))return null;var m={};this.__directive_pattern.lastIndex=0;for(var f=this.__directive_pattern.exec(b);f;)m[f[1]]=f[2],f=this.__directive_pattern.exec(b);return m},D.prototype.readIgnored=function(b){return b.readUntilAfter(this.__directives_end_ignore_pattern)},k.exports.Directives=D},,function(k,D,b){var m=b(16).Beautifier,f=b(17).Options;function d(s,r){var u=new m(s,r);return u.beautify()}k.exports=d,k.exports.defaultOptions=function(){return new f}},function(k,D,b){var m=b(17).Options,f=b(2).Output,d=b(8).InputScanner,s=b(13).Directives,r=new s(/\/\*/,/\*\//),u=/\r\n|[\r\n]/,o=/\r\n|[\r\n]/g,a=/\s/,n=/(?:\s|\n)+/g,R=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,w=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function x(O,C){this._source_text=O||"",this._options=new m(C),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"]}x.prototype.eatString=function(O){var C="";for(this._ch=this._input.next();this._ch;){if(C+=this._ch,this._ch==="\\")C+=this._input.next();else if(O.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return C},x.prototype.eatWhitespace=function(O){for(var C=a.test(this._input.peek()),_=0;a.test(this._input.peek());)this._ch=this._input.next(),O&&this._ch===`
|
|
`&&((_===0||_<this._options.max_preserve_newlines)&&(_++,this._output.add_new_line(!0)));return C},x.prototype.foundNestedPseudoClass=function(){for(var O=0,C=1,_=this._input.peek(C);_;){if(_==="{")return!0;if(_==="(")O+=1;else if(_===")"){if(O===0)return!1;O-=1}else if(_===";"||_==="}")return!1;C++,_=this._input.peek(C)}return!1},x.prototype.print_string=function(O){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(O)},x.prototype.preserveSingleSpace=function(O){O&&(this._output.space_before_token=!0)},x.prototype.indent=function(){this._indentLevel++},x.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},x.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var O=this._source_text,C=this._options.eol;C==="auto"&&(C=`
|
|
`,O&&u.test(O||"")&&(C=O.match(u)[0])),O=O.replace(o,`
|
|
`);var _=O.match(/^[\t ]*/)[0];this._output=new f(this._options,_),this._input=new d(O),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var y=0,h=!1,c=!1,v=!1,p=!1,E=!1,U=!1,F=this._ch,z=!1,G,B,T;G=this._input.read(n),B=G!=="",T=F,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),F=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var V=this._input.read(R),Z=r.get_directives(V);Z&&Z.ignore==="start"&&(V+=r.readIgnored(this._input)),this.print_string(V),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(B),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var oe=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);oe.match(/[ :]$/)&&(oe=this.eatString(": ").replace(/\s$/,""),this.print_string(oe),this._output.space_before_token=!0),oe=oe.replace(/\s$/,""),oe==="extend"?p=!0:oe==="import"&&(E=!0),oe in this.NESTED_AT_RULE?(this._nestedLevel+=1,oe in this.CONDITIONAL_GROUP_RULE&&(v=!0)):!h&&y===0&&oe.indexOf(":")!==-1&&(c=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(B),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")c&&(c=!1,this.outdent()),v?(v=!1,h=this._indentLevel>=this._nestedLevel):h=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&h&&(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)):(T==="("?this._output.space_before_token=!1:T!==","&&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(),T==="{"&&this._output.trim(!0),E=!1,p=!1,c&&(this.outdent(),c=!1),this.print_string(this._ch),h=!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])){z=!0;break}(h||v)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!p&&y===0?(this.print_string(":"),c||(c=!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 Ye=T==='"'||T==="'";this.preserveSingleSpace(Ye||B),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")z=!1,y===0?(c&&(this.outdent(),c=!1),p=!1,E=!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(),y++,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(")")),y&&(y--,this.outdent()));else{var xe=!1;this._input.lookBack("with")&&(xe=!0),this.preserveSingleSpace(B||xe),this.print_string(this._ch),c&&T==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),U=!0):(this.eatWhitespace(),y++,this.indent())}else if(this._ch===")")y&&(y--,this.outdent()),U&&this._input.peek()===";"&&this._options.selector_separator_newline&&(U=!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&&(!c||U)&&y===0&&!E&&!p?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!c&&y===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&a.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(B),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),a.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var Ie=T==='"'||T==="'";this.preserveSingleSpace(Ie||B),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&z&&this._output.add_new_line()}var Je=this._output.get_code(C);return Je},k.exports.Beautifier=x},function(k,D,b){var m=b(6).Options;function f(d){m.call(this,d,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var s=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||s;var r=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var u=0;u<r.length;u++)r[u]!=="expand"?this.brace_style="collapse":this.brace_style=r[u]}f.prototype=new m,k.exports.Options=f}],M={};function H(k){var D=M[k];if(D!==void 0)return D.exports;var b=M[k]={exports:{}};return A[k](b,b.exports,H),b.exports}var P=H(15);N=P})();var K=N;!(te=[],Y=function(){return{css_beautify:K}}.apply(Qe,te),Y!==void 0&&(tn.exports=Y))})()},"VrN/":function(tn,Qe,I){(function(te,Y){tn.exports=Y()})(this,function(){"use strict";var te=navigator.userAgent,Y=navigator.platform,N=/gecko\/\d/i.test(te),K=/MSIE \d/.test(te),A=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(te),M=/Edge\/(\d+)/.exec(te),H=K||A||M,P=H&&(K?document.documentMode||6:+(M||A)[1]),k=!M&&/WebKit\//.test(te),D=k&&/Qt\/\d+\.\d+/.test(te),b=!M&&/Chrome\//.test(te),m=/Opera\//.test(te),f=/Apple Computer/.test(navigator.vendor),d=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(te),s=/PhantomJS/.test(te),r=!M&&/AppleWebKit/.test(te)&&/Mobile\/\w+/.test(te),u=/Android/.test(te),o=r||u||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(te),a=r||/Mac/.test(Y),n=/\bCrOS\b/.test(te),R=/win/i.test(Y),w=m&&te.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(m=!1,k=!0);var x=a&&(D||m&&(w==null||w<12.11)),O=N||H&&P>=9;function C(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var _=function(e,t){var l=e.className,i=C(t).exec(l);if(i){var g=l.slice(i.index+i[0].length);e.className=l.slice(0,i.index)+(g?i[1]+g:"")}};function y(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function h(e,t){return y(e).appendChild(t)}function c(e,t,l,i){var g=document.createElement(e);if(l&&(g.className=l),i&&(g.style.cssText=i),typeof t=="string")g.appendChild(document.createTextNode(t));else if(t)for(var j=0;j<t.length;++j)g.appendChild(t[j]);return g}function v(e,t,l,i){var g=c(e,t,l,i);return g.setAttribute("role","presentation"),g}var p;document.createRange?p=function(e,t,l,i){var g=document.createRange();return g.setEnd(i||e,l),g.setStart(e,t),g}:p=function(e,t,l){var i=document.body.createTextRange();try{i.moveToElementText(e.parentNode)}catch(g){return i}return i.collapse(!0),i.moveEnd("character",l),i.moveStart("character",t),i};function E(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 U(){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 F(e,t){var l=e.className;C(t).test(l)||(e.className+=(l?" ":"")+t)}function z(e,t){for(var l=e.split(" "),i=0;i<l.length;i++)l[i]&&!C(l[i]).test(t)&&(t+=" "+l[i]);return t}var G=function(e){e.select()};r?G=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:H&&(G=function(e){try{e.select()}catch(t){}});function B(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function T(e,t,l){t||(t={});for(var i in e)e.hasOwnProperty(i)&&(l!==!1||!t.hasOwnProperty(i))&&(t[i]=e[i]);return t}function V(e,t,l,i,g){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var j=i||0,$=g||0;;){var q=e.indexOf(" ",j);if(q<0||q>=t)return $+(t-j);$+=q-j,$+=l-$%l,j=q+1}}var Z=function(){this.id=null,this.f=null,this.time=0,this.handler=B(this.onTimeout,this)};Z.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Z.prototype.set=function(e,t){this.f=t;var l=+new Date+e;(!this.id||l<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=l)};function oe(e,t){for(var l=0;l<e.length;++l)if(e[l]==t)return l;return-1}var pe=50,Ye={toString:function(){return"CodeMirror.Pass"}},xe={scroll:!1},Ie={origin:"*mouse"},Je={origin:"+move"};function Ke(e,t,l){for(var i=0,g=0;;){var j=e.indexOf(" ",i);j==-1&&(j=e.length);var $=j-i;if(j==e.length||g+$>=t)return i+Math.min($,t-g);if(g+=j-i,g+=l-g%l,i=j+1,g>=t)return i}}var be=[""];function de(e){for(;be.length<=e;)be.push(nt(be)+" ");return be[e]}function nt(e){return e[e.length-1]}function Kt(e,t){for(var l=[],i=0;i<e.length;i++)l[i]=t(e[i],i);return l}function jt(e,t,l){for(var i=0,g=l(t);i<e.length&&l(e[i])<=g;)i++;e.splice(i,0,t)}function wt(){}function ze(e,t){var l;return Object.create?l=Object.create(e):(wt.prototype=e,l=new wt),t&&T(t,l),l}var ft=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function dt(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ft.test(e))}function Nt(e,t){return t?t.source.indexOf("\\w")>-1&&dt(e)?!0:t.test(e):dt(e)}function Ze(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Bt=/[\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 Ut(e){return e.charCodeAt(0)>=768&&Bt.test(e)}function Mt(e,t,l){for(;(l<0?t>0:t<e.length)&&Ut(e.charAt(t));)t+=l;return t}function An(e,t,l){for(var i=t>l?-1:1;;){if(t==l)return t;var g=(t+l)/2,j=i<0?Math.ceil(g):Math.floor(g);if(j==t)return e(j)?t:l;e(j)?l=j:t=j+i}}function mn(e,t,l,i){if(!e)return i(t,l,"ltr",0);for(var g=!1,j=0;j<e.length;++j){var $=e[j];($.from<l&&$.to>t||t==l&&$.to==t)&&(i(Math.max($.from,t),Math.min($.to,l),$.level==1?"rtl":"ltr",j),g=!0)}g||i(t,l,"ltr")}var pn=null;function tt(e,t,l){var i;pn=null;for(var g=0;g<e.length;++g){var j=e[g];if(j.from<t&&j.to>t)return g;j.to==t&&(j.from!=j.to&&l=="before"?i=g:pn=g),j.from==t&&(j.from!=j.to&&l!="before"?i=g:pn=g)}return i!=null?i:pn}var fn=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function l(se){return se<=247?e.charAt(se):1424<=se&&se<=1524?"R":1536<=se&&se<=1785?t.charAt(se-1536):1774<=se&&se<=2220?"r":8192<=se&&se<=8203?"w":se==8204?"b":"L"}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,g=/[stwN]/,j=/[LRr]/,$=/[Lb1n]/,q=/[1n]/;function ee(se,Pe,Fe){this.level=se,this.from=Pe,this.to=Fe}return function(se,Pe){var Fe=Pe=="ltr"?"L":"R";if(se.length==0||Pe=="ltr"&&!i.test(se))return!1;for(var _t=se.length,ut=[],en=0;en<_t;++en)ut.push(l(se.charCodeAt(en)));for(var xn=0,Wn=Fe;xn<_t;++xn){var Vn=ut[xn];Vn=="m"?ut[xn]=Wn:Wn=Vn}for(var Zn=0,Yn=Fe;Zn<_t;++Zn){var ii=ut[Zn];ii=="1"&&Yn=="r"?ut[Zn]="n":j.test(ii)&&(Yn=ii,ii=="r"&&(ut[Zn]="R"))}for(var Ci=1,_i=ut[0];Ci<_t-1;++Ci){var Ui=ut[Ci];Ui=="+"&&_i=="1"&&ut[Ci+1]=="1"?ut[Ci]="1":Ui==","&&_i==ut[Ci+1]&&(_i=="1"||_i=="n")&&(ut[Ci]=_i),_i=Ui}for(var fr=0;fr<_t;++fr){var Hr=ut[fr];if(Hr==",")ut[fr]="N";else if(Hr=="%"){var Tr=void 0;for(Tr=fr+1;Tr<_t&&ut[Tr]=="%";++Tr);for(var oa=fr&&ut[fr-1]=="!"||Tr<_t&&ut[Tr]=="1"?"1":"N",na=fr;na<Tr;++na)ut[na]=oa;fr=Tr-1}}for(var kr=0,ia=Fe;kr<_t;++kr){var Gr=ut[kr];ia=="L"&&Gr=="1"?ut[kr]="L":j.test(Gr)&&(ia=Gr)}for(var Ur=0;Ur<_t;++Ur)if(g.test(ut[Ur])){var Ir=void 0;for(Ir=Ur+1;Ir<_t&&g.test(ut[Ir]);++Ir);for(var Or=(Ur?ut[Ur-1]:Fe)=="L",ra=(Ir<_t?ut[Ir]:Fe)=="L",So=Or==ra?Or?"L":"R":Fe,to=Ur;to<Ir;++to)ut[to]=So;Ur=Ir-1}for(var Xr=[],La,Wr=0;Wr<_t;)if($.test(ut[Wr])){var ms=Wr;for(++Wr;Wr<_t&&$.test(ut[Wr]);++Wr);Xr.push(new ee(0,ms,Wr))}else{var za=Wr,lo=Xr.length,uo=Pe=="rtl"?1:0;for(++Wr;Wr<_t&&ut[Wr]!="L";++Wr);for(var Qr=za;Qr<Wr;)if(q.test(ut[Qr])){za<Qr&&(Xr.splice(lo,0,new ee(1,za,Qr)),lo+=uo);var Oo=Qr;for(++Qr;Qr<Wr&&q.test(ut[Qr]);++Qr);Xr.splice(lo,0,new ee(2,Oo,Qr)),lo+=uo,za=Qr}else++Qr;za<Wr&&Xr.splice(lo,0,new ee(1,za,Wr))}return Pe=="ltr"&&(Xr[0].level==1&&(La=se.match(/^\s+/))&&(Xr[0].from=La[0].length,Xr.unshift(new ee(0,0,La[0].length))),nt(Xr).level==1&&(La=se.match(/\s+$/))&&(nt(Xr).to-=La[0].length,Xr.push(new ee(0,_t-La[0].length,_t)))),Pe=="rtl"?Xr.reverse():Xr}}();function In(e,t){var l=e.order;return l==null&&(l=e.order=fn(e.text,t)),l}var He=[],Ue=function(e,t,l){if(e.addEventListener)e.addEventListener(t,l,!1);else if(e.attachEvent)e.attachEvent("on"+t,l);else{var i=e._handlers||(e._handlers={});i[t]=(i[t]||He).concat(l)}};function pt(e,t){return e._handlers&&e._handlers[t]||He}function Ct(e,t,l){if(e.removeEventListener)e.removeEventListener(t,l,!1);else if(e.detachEvent)e.detachEvent("on"+t,l);else{var i=e._handlers,g=i&&i[t];if(g){var j=oe(g,l);j>-1&&(i[t]=g.slice(0,j).concat(g.slice(j+1)))}}}function Ge(e,t){var l=pt(e,t);if(!l.length)return;for(var i=Array.prototype.slice.call(arguments,2),g=0;g<l.length;++g)l[g].apply(null,i)}function vt(e,t,l){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ge(e,l||t.type,e,t),he(t)||t.codemirrorIgnore}function Ae(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var l=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),i=0;i<t.length;++i)oe(l,t[i])==-1&&l.push(t[i])}function ge(e,t){return pt(e,t).length>0}function Ee(e){e.prototype.on=function(t,l){Ue(this,t,l)},e.prototype.off=function(t,l){Ct(this,t,l)}}function ae(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function re(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function he(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ve(e){ae(e),re(e)}function me(e){return e.target||e.srcElement}function Be(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),a&&e.ctrlKey&&t==1&&(t=3),t}var Tt=function(){if(H&&P<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e}(),Jt;function En(e){if(Jt==null){var t=c("span","\u200B");h(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Jt=t.offsetWidth<=1&&t.offsetHeight>2&&!(H&&P<8))}var l=Jt?c("span","\u200B"):c("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return l.setAttribute("cm-text",""),l}var mt;function Qt(e){if(mt!=null)return mt;var t=h(e,document.createTextNode("A\u062EA")),l=p(t,0,1).getBoundingClientRect(),i=p(t,1,2).getBoundingClientRect();return y(e),!l||l.left==l.right?!1:mt=i.right-l.right<3}var gt=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,l=[],i=e.length;t<=i;){var g=e.indexOf(`
|
|
`,t);g==-1&&(g=e.length);var j=e.slice(t,e.charAt(g-1)=="\r"?g-1:g),$=j.indexOf("\r");$!=-1?(l.push(j.slice(0,$)),t+=$+1):(l.push(j),t=g+1)}return l}:function(e){return e.split(/\r\n?|\n/)},yt=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(l){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},rt=function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),ce=null;function Re(e){if(ce!=null)return ce;var t=h(e,c("span","x")),l=t.getBoundingClientRect(),i=p(t,0,1).getBoundingClientRect();return ce=Math.abs(l.left-i.left)>1}var At={},ot={};function Yt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),At[e]=t}function rn(e,t){ot[e]=t}function _e(e){if(typeof e=="string"&&ot.hasOwnProperty(e))e=ot[e];else if(e&&typeof e.name=="string"&&ot.hasOwnProperty(e.name)){var t=ot[e.name];typeof t=="string"&&(t={name:t}),e=ze(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return _e("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return _e("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Ne(e,t){t=_e(t);var l=At[t.name];if(!l)return Ne(e,"text/plain");var i=l(e,t);if(xt.hasOwnProperty(t.name)){var g=xt[t.name];for(var j in g){if(!g.hasOwnProperty(j))continue;i.hasOwnProperty(j)&&(i["_"+j]=i[j]),i[j]=g[j]}}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(var $ in t.modeProps)i[$]=t.modeProps[$];return i}var xt={};function Xt(e,t){var l=xt.hasOwnProperty(e)?xt[e]:xt[e]={};T(t,l)}function vn(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var l={};for(var i in t){var g=t[i];g instanceof Array&&(g=g.concat([])),l[i]=g}return l}function Mn(e,t){for(var l;e.innerMode&&!(l=e.innerMode(t),!l||l.mode==e);)t=l.state,e=l.mode;return l||{mode:e,state:t}}function ci(e,t,l){return e.startState?e.startState(t,l):!0}var $n=function(e,t,l){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=l};$n.prototype.eol=function(){return this.pos>=this.string.length},$n.prototype.sol=function(){return this.pos==this.lineStart},$n.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},$n.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},$n.prototype.eat=function(e){var t=this.string.charAt(this.pos),l;if(typeof e=="string"?l=t==e:l=t&&(e.test?e.test(t):e(t)),l)return++this.pos,t},$n.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},$n.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},$n.prototype.skipToEnd=function(){this.pos=this.string.length},$n.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},$n.prototype.backUp=function(e){this.pos-=e},$n.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=V(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?V(this.string,this.lineStart,this.tabSize):0)},$n.prototype.indentation=function(){return V(this.string,null,this.tabSize)-(this.lineStart?V(this.string,this.lineStart,this.tabSize):0)},$n.prototype.match=function(e,t,l){if(typeof e=="string"){var i=function($){return l?$.toLowerCase():$},g=this.string.substr(this.pos,e.length);if(i(g)==i(e))return t!==!1&&(this.pos+=e.length),!0}else{var j=this.string.slice(this.pos).match(e);return j&&j.index>0?null:(j&&t!==!1&&(this.pos+=j[0].length),j)}},$n.prototype.current=function(){return this.string.slice(this.start,this.pos)},$n.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},$n.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},$n.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Cn(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 l=e;!l.lines;)for(var i=0;;++i){var g=l.children[i],j=g.chunkSize();if(t<j){l=g;break}t-=j}return l.lines[t]}function Ti(e,t,l){var i=[],g=t.line;return e.iter(t.line,l.line+1,function(j){var $=j.text;g==l.line&&($=$.slice(0,l.ch)),g==t.line&&($=$.slice(t.ch)),i.push($),++g}),i}function Wi(e,t,l){var i=[];return e.iter(t,l,function(g){i.push(g.text)}),i}function hi(e,t){var l=t-e.height;if(l)for(var i=e;i;i=i.parent)i.height+=l}function fi(e){if(e.parent==null)return null;for(var t=e.parent,l=oe(t.lines,e),i=t.parent;i;t=i,i=i.parent)for(var g=0;!(i.children[g]==t);++g)l+=i.children[g].chunkSize();return l+t.first}function ji(e,t){var l=e.first;e:do{for(var i=0;i<e.children.length;++i){var g=e.children[i],j=g.height;if(t<j){e=g;continue e}t-=j,l+=g.chunkSize()}return l}while(!e.lines);for(var $=0;$<e.lines.length;++$){var q=e.lines[$],ee=q.height;if(t<ee)break;t-=ee}return l+$}function er(e,t){return t>=e.first&&t<e.first+e.size}function yr(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function cn(e,t,l){if(l===void 0&&(l=null),!(this instanceof cn))return new cn(e,t,l);this.line=e,this.ch=t,this.sticky=l}function ri(e,t){return e.line-t.line||e.ch-t.ch}function pr(e,t){return e.sticky==t.sticky&&ri(e,t)==0}function Cr(e){return cn(e.line,e.ch)}function tr(e,t){return ri(e,t)<0?t:e}function nr(e,t){return ri(e,t)<0?e:t}function X(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function S(e,t){if(t.line<e.first)return cn(e.first,0);var l=e.first+e.size-1;return t.line>l?cn(l,Cn(e,l).text.length):L(t,Cn(e,t.line).text.length)}function L(e,t){var l=e.ch;return l==null||l>t?cn(e.line,t):l<0?cn(e.line,0):e}function W(e,t){for(var l=[],i=0;i<t.length;i++)l[i]=S(e,t[i]);return l}var ne=function(e,t){this.state=e,this.lookAhead=t},Q=function(e,t,l,i){this.state=t,this.doc=e,this.line=l,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,l){return t instanceof ne?new Q(e,vn(e.mode,t.state),l,t.lookAhead):new Q(e,vn(e.mode,t),l)},Q.prototype.save=function(e){var t=e!==!1?vn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ne(t,this.maxLookAhead):t};function ke(e,t,l,i){var g=[e.state.modeGen],j={};ar(e,t.text,e.doc.mode,l,function(se,Pe){return g.push(se,Pe)},j,i);for(var $=l.state,q=function(se){l.baseTokens=g;var Pe=e.state.overlays[se],Fe=1,_t=0;l.state=!0,ar(e,t.text,Pe.mode,l,function(ut,en){for(var xn=Fe;_t<ut;){var Wn=g[Fe];Wn>ut&&g.splice(Fe,1,ut,g[Fe+1],Wn),Fe+=2,_t=Math.min(ut,Wn)}if(!en)return;if(Pe.opaque)g.splice(xn,Fe-xn,ut,"overlay "+en),Fe=xn+2;else for(;xn<Fe;xn+=2){var Vn=g[xn+1];g[xn+1]=(Vn?Vn+" ":"")+"overlay "+en}},j),l.state=$,l.baseTokens=null,l.baseTokenPos=1},ee=0;ee<e.state.overlays.length;++ee)q(ee);return{styles:g,classes:j.bgClass||j.textClass?j:null}}function Vt(e,t,l){if(!t.styles||t.styles[0]!=e.state.modeGen){var i=kn(e,fi(t)),g=t.text.length>e.options.maxHighlightLength&&vn(e.doc.mode,i.state),j=ke(e,t,i);g&&(i.state=g),t.stateAfter=i.save(!g),t.styles=j.styles,j.classes?t.styleClasses=j.classes:t.styleClasses&&(t.styleClasses=null),l===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function kn(e,t,l){var i=e.doc,g=e.display;if(!i.mode.startState)return new Q(i,!0,t);var j=Ki(e,t,l),$=j>i.first&&Cn(i,j-1).stateAfter,q=$?Q.fromSaved(i,$,j):new Q(i,ci(i.mode),j);return i.iter(j,t,function(ee){Qn(e,ee.text,q);var se=q.line;ee.stateAfter=se==t-1||se%5==0||se>=g.viewFrom&&se<g.viewTo?q.save():null,q.nextLine()}),l&&(i.modeFrontier=q.line),q}function Qn(e,t,l,i){var g=e.doc.mode,j=new $n(t,e.options.tabSize,l);for(j.start=j.pos=i||0,t==""&&nn(g,l.state);!j.eol();)ti(g,j,l.state),j.start=j.pos}function nn(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var l=Mn(e,t);if(l.mode.blankLine)return l.mode.blankLine(l.state)}function ti(e,t,l,i){for(var g=0;g<10;g++){i&&(i[0]=Mn(e,l).mode);var j=e.token(t,l);if(t.pos>t.start)return j}throw new Error("Mode "+e.name+" failed to advance stream.")}var qn=function(e,t,l){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=l};function Li(e,t,l,i){var g=e.doc,j=g.mode,$;t=S(g,t);var q=Cn(g,t.line),ee=kn(e,t.line,l),se=new $n(q.text,e.options.tabSize,ee),Pe;for(i&&(Pe=[]);(i||se.pos<t.ch)&&!se.eol();)se.start=se.pos,$=ti(j,se,ee.state),i&&Pe.push(new qn(se,$,vn(g.mode,ee.state)));return i?Pe:new qn(se,$,ee.state)}function lr(e,t){if(e)for(;;){var l=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!l)break;e=e.slice(0,l.index)+e.slice(l.index+l[0].length);var i=l[1]?"bgClass":"textClass";t[i]==null?t[i]=l[2]:new RegExp("(?:^|\\s)"+l[2]+"(?:$|\\s)").test(t[i])||(t[i]+=" "+l[2])}return e}function ar(e,t,l,i,g,j,$){var q=l.flattenSpans;q==null&&(q=e.options.flattenSpans);var ee=0,se=null,Pe=new $n(t,e.options.tabSize,i),Fe,_t=e.options.addModeClass&&[null];for(t==""&&lr(nn(l,i.state),j);!Pe.eol();){if(Pe.pos>e.options.maxHighlightLength?(q=!1,$&&Qn(e,t,i,Pe.pos),Pe.pos=t.length,Fe=null):Fe=lr(ti(l,Pe,i.state,_t),j),_t){var ut=_t[0].name;ut&&(Fe="m-"+(Fe?ut+" "+Fe:ut))}if(!q||se!=Fe){for(;ee<Pe.start;)ee=Math.min(Pe.start,ee+5e3),g(ee,se);se=Fe}Pe.start=Pe.pos}for(;ee<Pe.pos;){var en=Math.min(Pe.pos,ee+5e3);g(en,se),ee=en}}function Ki(e,t,l){for(var i,g,j=e.doc,$=l?-1:t-(e.doc.mode.innerMode?1e3:100),q=t;q>$;--q){if(q<=j.first)return j.first;var ee=Cn(j,q-1),se=ee.stateAfter;if(se&&(!l||q+(se instanceof ne?se.lookAhead:0)<=j.modeFrontier))return q;var Pe=V(ee.text,null,e.options.tabSize);(g==null||i>Pe)&&(g=q-1,i=Pe)}return g}function Pr(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var l=e.first,i=t-1;i>l;i--){var g=Cn(e,i).stateAfter;if(g&&(!(g instanceof ne)||i+g.lookAhead<t)){l=i+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,l)}var Vr=!1,Ai=!1;function wi(){Vr=!0}function ir(){Ai=!0}function Fi(e,t,l){this.marker=e,this.from=t,this.to=l}function Bn(e,t){if(e)for(var l=0;l<e.length;++l){var i=e[l];if(i.marker==t)return i}}function gn(e,t){for(var l,i=0;i<e.length;++i)e[i]!=t&&(l||(l=[])).push(e[i]);return l}function Tn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function _n(e,t,l){var i;if(e)for(var g=0;g<e.length;++g){var j=e[g],$=j.marker,q=j.from==null||($.inclusiveLeft?j.from<=t:j.from<t);if(q||j.from==t&&$.type=="bookmark"&&(!l||!j.marker.insertLeft)){var ee=j.to==null||($.inclusiveRight?j.to>=t:j.to>t);(i||(i=[])).push(new Fi($,j.from,ee?null:j.to))}}return i}function si(e,t,l){var i;if(e)for(var g=0;g<e.length;++g){var j=e[g],$=j.marker,q=j.to==null||($.inclusiveRight?j.to>=t:j.to>t);if(q||j.from==t&&$.type=="bookmark"&&(!l||j.marker.insertLeft)){var ee=j.from==null||($.inclusiveLeft?j.from<=t:j.from<t);(i||(i=[])).push(new Fi($,ee?null:j.from-t,j.to==null?null:j.to-t))}}return i}function ai(e,t){if(t.full)return null;var l=er(e,t.from.line)&&Cn(e,t.from.line).markedSpans,i=er(e,t.to.line)&&Cn(e,t.to.line).markedSpans;if(!l&&!i)return null;var g=t.from.ch,j=t.to.ch,$=ri(t.from,t.to)==0,q=_n(l,g,$),ee=si(i,j,$),se=t.text.length==1,Pe=nt(t.text).length+(se?g:0);if(q)for(var Fe=0;Fe<q.length;++Fe){var _t=q[Fe];if(_t.to==null){var ut=Bn(ee,_t.marker);ut?se&&(_t.to=ut.to==null?null:ut.to+Pe):_t.to=g}}if(ee)for(var en=0;en<ee.length;++en){var xn=ee[en];if(xn.to!=null&&(xn.to+=Pe),xn.from==null){var Wn=Bn(q,xn.marker);Wn||(xn.from=Pe,se&&(q||(q=[])).push(xn))}else xn.from+=Pe,se&&(q||(q=[])).push(xn)}q&&(q=J(q)),ee&&ee!=q&&(ee=J(ee));var Vn=[q];if(!se){var Zn=t.text.length-2,Yn;if(Zn>0&&q)for(var ii=0;ii<q.length;++ii)q[ii].to==null&&(Yn||(Yn=[])).push(new Fi(q[ii].marker,null,null));for(var Ci=0;Ci<Zn;++Ci)Vn.push(Yn);Vn.push(ee)}return Vn}function J(e){for(var t=0;t<e.length;++t){var l=e[t];l.from!=null&&l.from==l.to&&l.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function ue(e,t,l){var i=null;if(e.iter(t.line,l.line+1,function(ut){if(ut.markedSpans)for(var en=0;en<ut.markedSpans.length;++en){var xn=ut.markedSpans[en].marker;xn.readOnly&&(!i||oe(i,xn)==-1)&&(i||(i=[])).push(xn)}}),!i)return null;for(var g=[{from:t,to:l}],j=0;j<i.length;++j)for(var $=i[j],q=$.find(0),ee=0;ee<g.length;++ee){var se=g[ee];if(ri(se.to,q.from)<0||ri(se.from,q.to)>0)continue;var Pe=[ee,1],Fe=ri(se.from,q.from),_t=ri(se.to,q.to);(Fe<0||!$.inclusiveLeft&&!Fe)&&Pe.push({from:se.from,to:q.from}),(_t>0||!$.inclusiveRight&&!_t)&&Pe.push({from:q.to,to:se.to}),g.splice.apply(g,Pe),ee+=Pe.length-3}return g}function Ce(e){var t=e.markedSpans;if(!t)return;for(var l=0;l<t.length;++l)t[l].marker.detachLine(e);e.markedSpans=null}function Te(e,t){if(!t)return;for(var l=0;l<t.length;++l)t[l].marker.attachLine(e);e.markedSpans=t}function qe(e){return e.inclusiveLeft?-1:0}function Oe(e){return e.inclusiveRight?1:0}function Ve(e,t){var l=e.lines.length-t.lines.length;if(l!=0)return l;var i=e.find(),g=t.find(),j=ri(i.from,g.from)||qe(e)-qe(t);if(j)return-j;var $=ri(i.to,g.to)||Oe(e)-Oe(t);return $||t.id-e.id}function et(e,t){var l=Ai&&e.markedSpans,i;if(l)for(var g=void 0,j=0;j<l.length;++j)g=l[j],g.marker.collapsed&&(t?g.from:g.to)==null&&(!i||Ve(i,g.marker)<0)&&(i=g.marker);return i}function Ot(e){return et(e,!0)}function Et(e){return et(e,!1)}function je(e,t){var l=Ai&&e.markedSpans,i;if(l)for(var g=0;g<l.length;++g){var j=l[g];j.marker.collapsed&&(j.from==null||j.from<t)&&(j.to==null||j.to>t)&&(!i||Ve(i,j.marker)<0)&&(i=j.marker)}return i}function ht(e,t,l,i,g){var j=Cn(e,t),$=Ai&&j.markedSpans;if($)for(var q=0;q<$.length;++q){var ee=$[q];if(!ee.marker.collapsed)continue;var se=ee.marker.find(0),Pe=ri(se.from,l)||qe(ee.marker)-qe(g),Fe=ri(se.to,i)||Oe(ee.marker)-Oe(g);if(Pe>=0&&Fe<=0||Pe<=0&&Fe>=0)continue;if(Pe<=0&&(ee.marker.inclusiveRight&&g.inclusiveLeft?ri(se.to,l)>=0:ri(se.to,l)>0)||Pe>=0&&(ee.marker.inclusiveRight&&g.inclusiveLeft?ri(se.from,i)<=0:ri(se.from,i)<0))return!0}}function it(e){for(var t;t=Ot(e);)e=t.find(-1,!0).line;return e}function st(e){for(var t;t=Et(e);)e=t.find(1,!0).line;return e}function bt(e){for(var t,l;t=Et(e);)e=t.find(1,!0).line,(l||(l=[])).push(e);return l}function Lt(e,t){var l=Cn(e,t),i=it(l);return l==i?t:fi(i)}function ct(e,t){if(t>e.lastLine())return t;var l=Cn(e,t),i;if(!Gt(e,l))return t;for(;i=Et(l);)l=i.find(1,!0).line;return fi(l)+1}function Gt(e,t){var l=Ai&&t.markedSpans;if(l)for(var i=void 0,g=0;g<l.length;++g){if(i=l[g],!i.marker.collapsed)continue;if(i.from==null)return!0;if(i.marker.widgetNode)continue;if(i.from==0&&i.marker.inclusiveLeft&&on(e,t,i))return!0}}function on(e,t,l){if(l.to==null){var i=l.marker.find(1,!0);return on(e,i.line,Bn(i.line.markedSpans,l.marker))}if(l.marker.inclusiveRight&&l.to==t.text.length)return!0;for(var g=void 0,j=0;j<t.markedSpans.length;++j)if(g=t.markedSpans[j],g.marker.collapsed&&!g.marker.widgetNode&&g.from==l.to&&(g.to==null||g.to!=l.from)&&(g.marker.inclusiveLeft||l.marker.inclusiveRight)&&on(e,t,g))return!0}function Dn(e){e=it(e);for(var t=0,l=e.parent,i=0;i<l.lines.length;++i){var g=l.lines[i];if(g==e)break;t+=g.height}for(var j=l.parent;j;l=j,j=l.parent)for(var $=0;$<j.children.length;++$){var q=j.children[$];if(q==l)break;t+=q.height}return t}function Kn(e){if(e.height==0)return 0;for(var t=e.text.length,l,i=e;l=Ot(i);){var g=l.find(0,!0);i=g.from.line,t+=g.from.ch-g.to.ch}for(i=e;l=Et(i);){var j=l.find(0,!0);t-=i.text.length-j.from.ch,i=j.to.line,t+=i.text.length-j.to.ch}return t}function wn(e){var t=e.display,l=e.doc;t.maxLine=Cn(l,l.first),t.maxLineLength=Kn(t.maxLine),t.maxLineChanged=!0,l.iter(function(i){var g=Kn(i);g>t.maxLineLength&&(t.maxLineLength=g,t.maxLine=i)})}var Nn=function(e,t,l){this.text=e,Te(this,t),this.height=l?l(this):1};Nn.prototype.lineNo=function(){return fi(this)},Ee(Nn);function Pn(e,t,l,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Ce(e),Te(e,l);var g=i?i(e):1;g!=e.height&&hi(e,g)}function Dt(e){e.parent=null,Ce(e)}var sn={},Ft={};function St(e,t){if(!e||/^\s*$/.test(e))return null;var l=t.addModeClass?Ft:sn;return l[e]||(l[e]=e.replace(/\S+/g,"cm-$&"))}function Un(e,t){var l=v("span",null,null,k?"padding-right: .1px":null),i={pre:v("pre",[l],"CodeMirror-line"),content:l,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var g=0;g<=(t.rest?t.rest.length:0);g++){var j=g?t.rest[g-1]:t.line,$=void 0;i.pos=0,i.addToken=zt,Qt(e.display.measure)&&($=In(j,e.doc.direction))&&(i.addToken=jn(i.addToken,$)),i.map=[];var q=t!=e.display.externalMeasured&&fi(j);Jn(j,i,Vt(e,j,q)),j.styleClasses&&(j.styleClasses.bgClass&&(i.bgClass=z(j.styleClasses.bgClass,i.bgClass||"")),j.styleClasses.textClass&&(i.textClass=z(j.styleClasses.textClass,i.textClass||""))),i.map.length==0&&i.map.push(0,0,i.content.appendChild(En(e.display.measure))),g==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(k){var ee=i.content.lastChild;(/\bcm-tab\b/.test(ee.className)||ee.querySelector&&ee.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return Ge(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=z(i.pre.className,i.textClass||"")),i}function Sn(e){var t=c("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function zt(e,t,l,i,g,j,$){if(!t)return;var q=e.splitSpaces?lt(t,e.trailingSpace):t,ee=e.cm.state.specialChars,se=!1,Pe;if(!ee.test(t))e.col+=t.length,Pe=document.createTextNode(q),e.map.push(e.pos,e.pos+t.length,Pe),H&&P<9&&(se=!0),e.pos+=t.length;else{Pe=document.createDocumentFragment();for(var Fe=0;;){ee.lastIndex=Fe;var _t=ee.exec(t),ut=_t?_t.index-Fe:t.length-Fe;if(ut){var en=document.createTextNode(q.slice(Fe,Fe+ut));H&&P<9?Pe.appendChild(c("span",[en])):Pe.appendChild(en),e.map.push(e.pos,e.pos+ut,en),e.col+=ut,e.pos+=ut}if(!_t)break;Fe+=ut+1;var xn=void 0;if(_t[0]==" "){var Wn=e.cm.options.tabSize,Vn=Wn-e.col%Wn;xn=Pe.appendChild(c("span",de(Vn),"cm-tab")),xn.setAttribute("role","presentation"),xn.setAttribute("cm-text"," "),e.col+=Vn}else _t[0]=="\r"||_t[0]==`
|
|
`?(xn=Pe.appendChild(c("span",_t[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),xn.setAttribute("cm-text",_t[0]),e.col+=1):(xn=e.cm.options.specialCharPlaceholder(_t[0]),xn.setAttribute("cm-text",_t[0]),H&&P<9?Pe.appendChild(c("span",[xn])):Pe.appendChild(xn),e.col+=1);e.map.push(e.pos,e.pos+1,xn),e.pos++}}if(e.trailingSpace=q.charCodeAt(t.length-1)==32,l||i||g||se||j||$){var Zn=l||"";i&&(Zn+=i),g&&(Zn+=g);var Yn=c("span",[Pe],Zn,j);if($)for(var ii in $)$.hasOwnProperty(ii)&&ii!="style"&&ii!="class"&&Yn.setAttribute(ii,$[ii]);return e.content.appendChild(Yn)}e.content.appendChild(Pe)}function lt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var l=t,i="",g=0;g<e.length;g++){var j=e.charAt(g);j==" "&&l&&(g==e.length-1||e.charCodeAt(g+1)==32)&&(j="\xA0"),i+=j,l=j==" "}return i}function jn(e,t){return function(l,i,g,j,$,q,ee){g=g?g+" cm-force-border":"cm-force-border";for(var se=l.pos,Pe=se+i.length;;){for(var Fe=void 0,_t=0;_t<t.length&&!(Fe=t[_t],Fe.to>se&&Fe.from<=se);_t++);if(Fe.to>=Pe)return e(l,i,g,j,$,q,ee);e(l,i.slice(0,Fe.to-se),g,j,null,q,ee),j=null,i=i.slice(Fe.to-se),se=Fe.to}}}function ln(e,t,l,i){var g=!i&&l.widgetNode;g&&e.map.push(e.pos,e.pos+t,g),!i&&e.cm.display.input.needsContentAttribute&&(g||(g=e.content.appendChild(document.createElement("span"))),g.setAttribute("cm-marker",l.id)),g&&(e.cm.display.input.setUneditable(g),e.content.appendChild(g)),e.pos+=t,e.trailingSpace=!1}function Jn(e,t,l){var i=e.markedSpans,g=e.text,j=0;if(!i){for(var $=1;$<l.length;$+=2)t.addToken(t,g.slice(j,j=l[$]),St(l[$+1],t.cm.options));return}for(var q=g.length,ee=0,se=1,Pe="",Fe,_t,ut=0,en,xn,Wn,Vn,Zn;;){if(ut==ee){en=xn=Wn=_t="",Zn=null,Vn=null,ut=Infinity;for(var Yn=[],ii=void 0,Ci=0;Ci<i.length;++Ci){var _i=i[Ci],Ui=_i.marker;if(Ui.type=="bookmark"&&_i.from==ee&&Ui.widgetNode)Yn.push(Ui);else if(_i.from<=ee&&(_i.to==null||_i.to>ee||Ui.collapsed&&_i.to==ee&&_i.from==ee)){if(_i.to!=null&&_i.to!=ee&&ut>_i.to&&(ut=_i.to,xn=""),Ui.className&&(en+=" "+Ui.className),Ui.css&&(_t=(_t?_t+";":"")+Ui.css),Ui.startStyle&&_i.from==ee&&(Wn+=" "+Ui.startStyle),Ui.endStyle&&_i.to==ut&&(ii||(ii=[])).push(Ui.endStyle,_i.to),Ui.title&&((Zn||(Zn={})).title=Ui.title),Ui.attributes)for(var fr in Ui.attributes)(Zn||(Zn={}))[fr]=Ui.attributes[fr];Ui.collapsed&&(!Vn||Ve(Vn.marker,Ui)<0)&&(Vn=_i)}else _i.from>ee&&ut>_i.from&&(ut=_i.from)}if(ii)for(var Hr=0;Hr<ii.length;Hr+=2)ii[Hr+1]==ut&&(xn+=" "+ii[Hr]);if(!Vn||Vn.from==ee)for(var Tr=0;Tr<Yn.length;++Tr)ln(t,0,Yn[Tr]);if(Vn&&(Vn.from||0)==ee){if(ln(t,(Vn.to==null?q+1:Vn.to)-ee,Vn.marker,Vn.from==null),Vn.to==null)return;Vn.to==ee&&(Vn=!1)}}if(ee>=q)break;for(var oa=Math.min(q,ut);;){if(Pe){var na=ee+Pe.length;if(!Vn){var kr=na>oa?Pe.slice(0,oa-ee):Pe;t.addToken(t,kr,Fe?Fe+en:en,Wn,ee+kr.length==ut?xn:"",_t,Zn)}if(na>=oa){Pe=Pe.slice(oa-ee),ee=oa;break}ee=na,Wn=""}Pe=g.slice(j,j=l[se++]),Fe=St(l[se++],t.cm.options)}}}function $t(e,t,l){this.line=t,this.rest=bt(t),this.size=this.rest?fi(nt(this.rest))-l+1:1,this.node=this.text=null,this.hidden=Gt(e,t)}function On(e,t,l){for(var i=[],g,j=t;j<l;j=g){var $=new $t(e.doc,Cn(e.doc,j),j);g=j+$.size,i.push($)}return i}var Fn=null;function hn(e){Fn?Fn.ops.push(e):e.ownsGroup=Fn={ops:[e],delayedCallbacks:[]}}function yi(e){var t=e.delayedCallbacks,l=0;do{for(;l<t.length;l++)t[l].call(null);for(var i=0;i<e.ops.length;i++){var g=e.ops[i];if(g.cursorActivityHandlers)for(;g.cursorActivityCalled<g.cursorActivityHandlers.length;)g.cursorActivityHandlers[g.cursorActivityCalled++].call(null,g.cm)}}while(l<t.length)}function Rn(e,t){var l=e.ownsGroup;if(!l)return;try{yi(l)}finally{Fn=null,t(l)}}var bn=null;function Rt(e,t){var l=pt(e,t);if(!l.length)return;var i=Array.prototype.slice.call(arguments,2),g;Fn?g=Fn.delayedCallbacks:bn?g=bn:(g=bn=[],setTimeout(Xe,0));for(var j=function(q){g.push(function(){return l[q].apply(null,i)})},$=0;$<l.length;++$)j($)}function Xe(){var e=bn;bn=null;for(var t=0;t<e.length;++t)e[t]()}function kt(e,t,l,i){for(var g=0;g<t.changes.length;g++){var j=t.changes[g];j=="text"?Ln(e,t):j=="gutter"?ei(e,t,l,i):j=="class"?oi(e,t):j=="widget"&&Oi(e,t,i)}t.changes=null}function Pt(e){return e.node==e.text&&(e.node=c("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),H&&P<8&&(e.node.style.zIndex=2)),e.node}function an(e,t){var l=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(l&&(l+=" CodeMirror-linebackground"),t.background)l?t.background.className=l:(t.background.parentNode.removeChild(t.background),t.background=null);else if(l){var i=Pt(t);t.background=i.insertBefore(c("div",null,l),i.firstChild),e.display.input.setUneditable(t.background)}}function zn(e,t){var l=e.display.externalMeasured;return l&&l.line==t.line?(e.display.externalMeasured=null,t.measure=l.measure,l.built):Un(e,t)}function Ln(e,t){var l=t.text.className,i=zn(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,oi(e,t)):l&&(t.text.className=l)}function oi(e,t){an(e,t),t.line.wrapClass?Pt(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var l=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=l||""}function ei(e,t,l,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 g=Pt(t);t.gutterBackground=c("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),g.insertBefore(t.gutterBackground,t.text)}var j=t.line.gutterMarkers;if(e.options.lineNumbers||j){var $=Pt(t),q=t.gutter=c("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(e.display.input.setUneditable(q),$.insertBefore(q,t.text),t.line.gutterClass&&(q.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!j||!j["CodeMirror-linenumbers"])&&(t.lineNumber=q.appendChild(c("div",yr(e.options,l),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),j)for(var ee=0;ee<e.display.gutterSpecs.length;++ee){var se=e.display.gutterSpecs[ee].className,Pe=j.hasOwnProperty(se)&&j[se];Pe&&q.appendChild(c("div",[Pe],"CodeMirror-gutter-elt","left: "+i.gutterLeft[se]+"px; width: "+i.gutterWidth[se]+"px"))}}}function Oi(e,t,l){t.alignable&&(t.alignable=null);for(var i=C("CodeMirror-linewidget"),g=t.node.firstChild,j=void 0;g;g=j)j=g.nextSibling,i.test(g.className)&&t.node.removeChild(g);bi(e,t,l)}function mi(e,t,l,i){var g=zn(e,t);return t.text=t.node=g.pre,g.bgClass&&(t.bgClass=g.bgClass),g.textClass&&(t.textClass=g.textClass),oi(e,t),ei(e,t,l,i),bi(e,t,i),t.node}function bi(e,t,l){if(Ji(e,t.line,t,l,!0),t.rest)for(var i=0;i<t.rest.length;i++)Ji(e,t.rest[i],t,l,!1)}function Ji(e,t,l,i,g){if(!t.widgets)return;for(var j=Pt(l),$=0,q=t.widgets;$<q.length;++$){var ee=q[$],se=c("div",[ee.node],"CodeMirror-linewidget"+(ee.className?" "+ee.className:""));ee.handleMouseEvents||se.setAttribute("cm-ignore-events","true"),Vi(ee,se,l,i),e.display.input.setUneditable(se),g&&ee.above?j.insertBefore(se,l.gutter||l.text):j.appendChild(se),Rt(ee,"redraw")}}function Vi(e,t,l,i){if(e.noHScroll){(l.alignable||(l.alignable=[])).push(t);var g=i.wrapperWidth;t.style.left=i.fixedPos+"px",e.coverGutter||(g-=i.gutterTotalWidth,t.style.paddingLeft=i.gutterTotalWidth+"px"),t.style.width=g+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-i.gutterTotalWidth+"px"))}function $i(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!E(document.body,e.node)){var l="position: relative;";e.coverGutter&&(l+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(l+="width: "+t.display.wrapper.clientWidth+"px;"),h(t.display.measure,c("div",[e.node],null,l))}return e.height=e.node.parentNode.offsetHeight}function gr(e,t){for(var l=me(t);l!=e.wrapper;l=l.parentNode)if(!l||l.nodeType==1&&l.getAttribute("cm-ignore-events")=="true"||l.parentNode==e.sizer&&l!=e.mover)return!0}function vr(e){return e.lineSpace.offsetTop}function ye(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Me(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=h(e.measure,c("pre","x","CodeMirror-line-like")),l=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,i={left:parseInt(l.paddingLeft),right:parseInt(l.paddingRight)};return!isNaN(i.left)&&!isNaN(i.right)&&(e.cachedPaddingH=i),i}function We(e){return pe-e.display.nativeBarWidth}function we(e){return e.display.scroller.clientWidth-We(e)-e.display.barWidth}function ie(e){return e.display.scroller.clientHeight-We(e)-e.display.barHeight}function fe(e,t,l){var i=e.options.lineWrapping,g=i&&we(e);if(!t.measure.heights||i&&t.measure.width!=g){var j=t.measure.heights=[];if(i){t.measure.width=g;for(var $=t.text.firstChild.getClientRects(),q=0;q<$.length-1;q++){var ee=$[q],se=$[q+1];Math.abs(ee.bottom-se.bottom)>2&&j.push((ee.bottom+se.top)/2-l.top)}}j.push(l.bottom-l.top)}}function le(e,t,l){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 g=0;g<e.rest.length;g++)if(fi(e.rest[g])>l)return{map:e.measure.maps[g],cache:e.measure.caches[g],before:!0}}function Se(e,t){t=it(t);var l=fi(t),i=e.display.externalMeasured=new $t(e.doc,t,l);i.lineN=l;var g=i.built=Un(e,i);return i.text=g.pre,h(e.display.lineMeasure,g.pre),i}function De(e,t,l,i){return at(e,Le(e,t),l,i)}function $e(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[ur(e,t)];var l=e.display.externalMeasured;if(l&&t>=l.lineN&&t<l.lineN+l.size)return l}function Le(e,t){var l=fi(t),i=$e(e,l);i&&!i.text?i=null:i&&i.changes&&(kt(e,i,l,vi(e)),e.curOp.forceUpdate=!0),i||(i=Se(e,t));var g=le(i,t,l);return{line:t,view:i,rect:null,map:g.map,cache:g.cache,before:g.before,hasHeights:!1}}function at(e,t,l,i,g){t.before&&(l=-1);var j=l+(i||""),$;return t.cache.hasOwnProperty(j)?$=t.cache[j]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(fe(e,t.view,t.rect),t.hasHeights=!0),$=Hn(e,t,l,i),$.bogus||(t.cache[j]=$)),{left:$.left,right:$.right,top:g?$.rtop:$.top,bottom:g?$.rbottom:$.bottom}}var It={left:0,right:0,top:0,bottom:0};function qt(e,t,l){for(var i,g,j,$,q,ee,se=0;se<e.length;se+=3)if(q=e[se],ee=e[se+1],t<q?(g=0,j=1,$="left"):t<ee?(g=t-q,j=g+1):(se==e.length-3||t==ee&&e[se+3]>t)&&(j=ee-q,g=j-1,t>=ee&&($="right")),g!=null){if(i=e[se+2],q==ee&&l==(i.insertLeft?"left":"right")&&($=l),l=="left"&&g==0)for(;se&&e[se-2]==e[se-3]&&e[se-1].insertLeft;)i=e[(se-=3)+2],$="left";if(l=="right"&&g==ee-q)for(;se<e.length-3&&e[se+3]==e[se+4]&&!e[se+5].insertLeft;)i=e[(se+=3)+2],$="right";break}return{node:i,start:g,end:j,collapse:$,coverStart:q,coverEnd:ee}}function un(e,t){var l=It;if(t=="left")for(var i=0;i<e.length&&!((l=e[i]).left!=l.right);i++);else for(var g=e.length-1;g>=0&&!((l=e[g]).left!=l.right);g--);return l}function Hn(e,t,l,i){var g=qt(t.map,l,i),j=g.node,$=g.start,q=g.end,ee=g.collapse,se;if(j.nodeType==3){for(var Pe=0;Pe<4;Pe++){for(;$&&Ut(t.line.text.charAt(g.coverStart+$));)--$;for(;g.coverStart+q<g.coverEnd&&Ut(t.line.text.charAt(g.coverStart+q));)++q;if(H&&P<9&&$==0&&q==g.coverEnd-g.coverStart?se=j.parentNode.getBoundingClientRect():se=un(p(j,$,q).getClientRects(),i),se.left||se.right||$==0)break;q=$,$=$-1,ee="right"}H&&P<11&&(se=Gn(e.display.measure,se))}else{$>0&&(ee=i="right");var Fe;e.options.lineWrapping&&(Fe=j.getClientRects()).length>1?se=Fe[i=="right"?Fe.length-1:0]:se=j.getBoundingClientRect()}if(H&&P<9&&!$&&(!se||!se.left&&!se.right)){var _t=j.parentNode.getClientRects()[0];_t?se={left:_t.left,right:_t.left+Bi(e.display),top:_t.top,bottom:_t.bottom}:se=It}for(var ut=se.top-t.rect.top,en=se.bottom-t.rect.top,xn=(ut+en)/2,Wn=t.view.measure.heights,Vn=0;Vn<Wn.length-1&&!(xn<Wn[Vn]);Vn++);var Zn=Vn?Wn[Vn-1]:0,Yn=Wn[Vn],ii={left:(ee=="right"?se.right:se.left)-t.rect.left,right:(ee=="left"?se.left:se.right)-t.rect.left,top:Zn,bottom:Yn};return!se.left&&!se.right&&(ii.bogus=!0),e.options.singleCursorHeightPerLine||(ii.rtop=ut,ii.rbottom=en),ii}function Gn(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Re(e))return t;var l=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*l,right:t.right*l,top:t.top*i,bottom:t.bottom*i}}function di(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 li(e){e.display.externalMeasure=null,y(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)di(e.display.view[t])}function Ei(e){li(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Ri(){return b&&u?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function gi(){return b&&u?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function xi(e){var t=0;if(e.widgets)for(var l=0;l<e.widgets.length;++l)e.widgets[l].above&&(t+=$i(e.widgets[l]));return t}function Di(e,t,l,i,g){if(!g){var j=xi(t);l.top+=j,l.bottom+=j}if(i=="line")return l;i||(i="local");var $=Dn(t);if(i=="local"?$+=vr(e.display):$-=e.display.viewOffset,i=="page"||i=="window"){var q=e.display.lineSpace.getBoundingClientRect();$+=q.top+(i=="window"?0:gi());var ee=q.left+(i=="window"?0:Ri());l.left+=ee,l.right+=ee}return l.top+=$,l.bottom+=$,l}function dn(e,t,l){if(l=="div")return t;var i=t.left,g=t.top;if(l=="page")i-=Ri(),g-=gi();else if(l=="local"||!l){var j=e.display.sizer.getBoundingClientRect();i+=j.left,g+=j.top}var $=e.display.lineSpace.getBoundingClientRect();return{left:i-$.left,top:g-$.top}}function Zt(e,t,l,i,g){return i||(i=Cn(e.doc,t.line)),Di(e,i,De(e,i,t.ch,g),l)}function yn(e,t,l,i,g,j){i=i||Cn(e.doc,t.line),g||(g=Le(e,i));function $(en,xn){var Wn=at(e,g,en,xn?"right":"left",j);return xn?Wn.left=Wn.right:Wn.right=Wn.left,Di(e,i,Wn,l)}var q=In(i,e.doc.direction),ee=t.ch,se=t.sticky;if(ee>=i.text.length?(ee=i.text.length,se="before"):ee<=0&&(ee=0,se="after"),!q)return $(se=="before"?ee-1:ee,se=="before");function Pe(en,xn,Wn){var Vn=q[xn],Zn=Vn.level==1;return $(Wn?en-1:en,Zn!=Wn)}var Fe=tt(q,ee,se),_t=pn,ut=Pe(ee,Fe,se=="before");return _t!=null&&(ut.other=Pe(ee,_t,se!="before")),ut}function Ht(e,t){var l=0;t=S(e.doc,t),e.options.lineWrapping||(l=Bi(e.display)*t.ch);var i=Cn(e.doc,t.line),g=Dn(i)+vr(e.display);return{left:l,right:l,top:g,bottom:g+i.height}}function Wt(e,t,l,i,g){var j=cn(e,t,l);return j.xRel=g,i&&(j.outside=i),j}function pi(e,t,l){var i=e.doc;if(l+=e.display.viewOffset,l<0)return Wt(i.first,0,null,-1,-1);var g=ji(i,l),j=i.first+i.size-1;if(g>j)return Wt(i.first+i.size-1,Cn(i,j).text.length,null,1,1);t<0&&(t=0);for(var $=Cn(i,g);;){var q=or(e,$,g,t,l),ee=je($,q.ch+(q.xRel>0||q.outside>0?1:0));if(!ee)return q;var se=ee.find(1);if(se.line==g)return se;$=Cn(i,g=se.line)}}function Pi(e,t,l,i){i-=xi(t);var g=t.text.length,j=An(function($){return at(e,l,$-1).bottom<=i},g,0);return g=An(function($){return at(e,l,$).top>i},j,g),{begin:j,end:g}}function ni(e,t,l,i){l||(l=Le(e,t));var g=Di(e,t,at(e,l,i),"line").top;return Pi(e,t,l,g)}function Ii(e,t,l,i){return e.bottom<=l?!1:e.top>l?!0:(i?e.left:e.right)>t}function or(e,t,l,i,g){g-=Dn(t);var j=Le(e,t),$=xi(t),q=0,ee=t.text.length,se=!0,Pe=In(t,e.doc.direction);if(Pe){var Fe=(e.options.lineWrapping?Yi:Ni)(e,t,l,j,Pe,i,g);se=Fe.level!=1,q=se?Fe.from:Fe.to-1,ee=se?Fe.to:Fe.from-1}var _t=null,ut=null,en=An(function(Ci){var _i=at(e,j,Ci);return _i.top+=$,_i.bottom+=$,Ii(_i,i,g,!1)?(_i.top<=g&&_i.left<=i&&(_t=Ci,ut=_i),!0):!1},q,ee),xn,Wn,Vn=!1;if(ut){var Zn=i-ut.left<ut.right-i,Yn=Zn==se;en=_t+(Yn?0:1),Wn=Yn?"after":"before",xn=Zn?ut.left:ut.right}else{!se&&(en==ee||en==q)&&en++,Wn=en==0?"after":en==t.text.length?"before":at(e,j,en-(se?1:0)).bottom+$<=g==se?"after":"before";var ii=yn(e,cn(l,en,Wn),"line",t,j);xn=ii.left,Vn=g<ii.top?-1:g>=ii.bottom?1:0}return en=Mt(t.text,en,1),Wt(l,en,Wn,Vn,i-xn)}function Ni(e,t,l,i,g,j,$){var q=An(function(Fe){var _t=g[Fe],ut=_t.level!=1;return Ii(yn(e,cn(l,ut?_t.to:_t.from,ut?"before":"after"),"line",t,i),j,$,!0)},0,g.length-1),ee=g[q];if(q>0){var se=ee.level!=1,Pe=yn(e,cn(l,se?ee.from:ee.to,se?"after":"before"),"line",t,i);Ii(Pe,j,$,!0)&&Pe.top>$&&(ee=g[q-1])}return ee}function Yi(e,t,l,i,g,j,$){var q=Pi(e,t,i,$),ee=q.begin,se=q.end;/\s/.test(t.text.charAt(se-1))&&se--;for(var Pe=null,Fe=null,_t=0;_t<g.length;_t++){var ut=g[_t];if(ut.from>=se||ut.to<=ee)continue;var en=ut.level!=1,xn=at(e,i,en?Math.min(se,ut.to)-1:Math.max(ee,ut.from)).right,Wn=xn<j?j-xn+1e9:xn-j;(!Pe||Fe>Wn)&&(Pe=ut,Fe=Wn)}return Pe||(Pe=g[g.length-1]),Pe.from<ee&&(Pe={from:ee,to:Pe.to,level:Pe.level}),Pe.to>se&&(Pe={from:Pe.from,to:se,level:Pe.level}),Pe}var zi;function Hi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(zi==null){zi=c("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)zi.appendChild(document.createTextNode("x")),zi.appendChild(c("br"));zi.appendChild(document.createTextNode("x"))}h(e.measure,zi);var l=zi.offsetHeight/50;return l>3&&(e.cachedTextHeight=l),y(e.measure),l||1}function Bi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=c("span","xxxxxxxxxx"),l=c("pre",[t],"CodeMirror-line-like");h(e.measure,l);var i=t.getBoundingClientRect(),g=(i.right-i.left)/10;return g>2&&(e.cachedCharWidth=g),g||10}function vi(e){for(var t=e.display,l={},i={},g=t.gutters.clientLeft,j=t.gutters.firstChild,$=0;j;j=j.nextSibling,++$){var q=e.display.gutterSpecs[$].className;l[q]=j.offsetLeft+j.clientLeft+g,i[q]=j.clientWidth}return{fixedPos:_r(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:l,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function _r(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Jr(e){var t=Hi(e.display),l=e.options.lineWrapping,i=l&&Math.max(5,e.display.scroller.clientWidth/Bi(e.display)-3);return function(g){if(Gt(e.doc,g))return 0;var j=0;if(g.widgets)for(var $=0;$<g.widgets.length;$++)g.widgets[$].height&&(j+=g.widgets[$].height);return l?j+(Math.ceil(g.text.length/i)||1)*t:j+t}}function jr(e){var t=e.doc,l=Jr(e);t.iter(function(i){var g=l(i);g!=i.height&&hi(i,g)})}function Rr(e,t,l,i){var g=e.display;if(!l&&me(t).getAttribute("cm-not-content")=="true")return null;var j,$,q=g.lineSpace.getBoundingClientRect();try{j=t.clientX-q.left,$=t.clientY-q.top}catch(Fe){return null}var ee=pi(e,j,$),se;if(i&&ee.xRel>0&&(se=Cn(e.doc,ee.line).text).length==ee.ch){var Pe=V(se,se.length,e.options.tabSize)-se.length;ee=cn(ee.line,Math.max(0,Math.round((j-Me(e.display).left)/Bi(e.display))-Pe))}return ee}function ur(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var l=e.display.view,i=0;i<l.length;i++)if(t-=l[i].size,t<0)return i}function Zi(e,t,l,i){t==null&&(t=e.doc.first),l==null&&(l=e.doc.first+e.doc.size),i||(i=0);var g=e.display;if(i&&l<g.viewTo&&(g.updateLineNumbers==null||g.updateLineNumbers>t)&&(g.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=g.viewTo)Ai&&Lt(e.doc,t)<g.viewTo&&dr(e);else if(l<=g.viewFrom)Ai&&ct(e.doc,l+i)>g.viewFrom?dr(e):(g.viewFrom+=i,g.viewTo+=i);else if(t<=g.viewFrom&&l>=g.viewTo)dr(e);else if(t<=g.viewFrom){var j=Fr(e,l,l+i,1);j?(g.view=g.view.slice(j.index),g.viewFrom=j.lineN,g.viewTo+=i):dr(e)}else if(l>=g.viewTo){var $=Fr(e,t,t,-1);$?(g.view=g.view.slice(0,$.index),g.viewTo=$.lineN):dr(e)}else{var q=Fr(e,t,t,-1),ee=Fr(e,l,l+i,1);q&&ee?(g.view=g.view.slice(0,q.index).concat(On(e,q.lineN,ee.lineN)).concat(g.view.slice(ee.index)),g.viewTo+=i):dr(e)}var se=g.externalMeasured;se&&(l<se.lineN?se.lineN+=i:t<se.lineN+se.size&&(g.externalMeasured=null))}function rr(e,t,l){e.curOp.viewChanged=!0;var i=e.display,g=e.display.externalMeasured;if(g&&t>=g.lineN&&t<g.lineN+g.size&&(i.externalMeasured=null),t<i.viewFrom||t>=i.viewTo)return;var j=i.view[ur(e,t)];if(j.node==null)return;var $=j.changes||(j.changes=[]);oe($,l)==-1&&$.push(l)}function dr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Fr(e,t,l,i){var g=ur(e,t),j,$=e.display.view;if(!Ai||l==e.doc.first+e.doc.size)return{index:g,lineN:l};for(var q=e.display.viewFrom,ee=0;ee<g;ee++)q+=$[ee].size;if(q!=t){if(i>0){if(g==$.length-1)return null;j=q+$[g].size-t,g++}else j=q-t;t+=j,l+=j}for(;Lt(e.doc,l)!=l;){if(g==(i<0?0:$.length-1))return null;l+=i*$[g-(i<0?1:0)].size,g+=i}return{index:g,lineN:l}}function ha(e,t,l){var i=e.display,g=i.view;g.length==0||t>=i.viewTo||l<=i.viewFrom?(i.view=On(e,t,l),i.viewFrom=t):(i.viewFrom>t?i.view=On(e,t,i.viewFrom).concat(i.view):i.viewFrom<t&&(i.view=i.view.slice(ur(e,t))),i.viewFrom=t,i.viewTo<l?i.view=i.view.concat(On(e,i.viewTo,l)):i.viewTo>l&&(i.view=i.view.slice(0,ur(e,l)))),i.viewTo=l}function sa(e){for(var t=e.display.view,l=0,i=0;i<t.length;i++){var g=t[i];!g.hidden&&(!g.node||g.changes)&&++l}return l}function qi(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Zr(e,t){t===void 0&&(t=!0);for(var l=e.doc,i={},g=i.cursors=document.createDocumentFragment(),j=i.selection=document.createDocumentFragment(),$=0;$<l.sel.ranges.length;$++){if(!t&&$==l.sel.primIndex)continue;var q=l.sel.ranges[$];if(q.from().line>=e.display.viewTo||q.to().line<e.display.viewFrom)continue;var ee=q.empty();(ee||e.options.showCursorWhenSelecting)&&qr(e,q.head,g),ee||Qi(e,q,j)}return i}function qr(e,t,l){var i=yn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),g=l.appendChild(c("div","\xA0","CodeMirror-cursor"));if(g.style.left=i.left+"px",g.style.top=i.top+"px",g.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var j=l.appendChild(c("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));j.style.display="",j.style.left=i.other.left+"px",j.style.top=i.other.top+"px",j.style.height=(i.other.bottom-i.other.top)*.85+"px"}}function sr(e,t){return e.top-t.top||e.left-t.left}function Qi(e,t,l){var i=e.display,g=e.doc,j=document.createDocumentFragment(),$=Me(e.display),q=$.left,ee=Math.max(i.sizerWidth,we(e)-i.sizer.offsetLeft)-$.right,se=g.direction=="ltr";function Pe(Yn,ii,Ci,_i){ii<0&&(ii=0),ii=Math.round(ii),_i=Math.round(_i),j.appendChild(c("div",null,"CodeMirror-selected","position: absolute; left: "+Yn+`px;
|
|
top: `+ii+"px; width: "+(Ci==null?ee-Yn:Ci)+`px;
|
|
height: `+(_i-ii)+"px"))}function Fe(Yn,ii,Ci){var _i=Cn(g,Yn),Ui=_i.text.length,fr,Hr;function Tr(kr,ia){return Zt(e,cn(Yn,kr),"div",_i,ia)}function oa(kr,ia,Gr){var Ur=ni(e,_i,null,kr),Ir=ia=="ltr"==(Gr=="after")?"left":"right",Or=Gr=="after"?Ur.begin:Ur.end-(/\s/.test(_i.text.charAt(Ur.end-1))?2:1);return Tr(Or,Ir)[Ir]}var na=In(_i,g.direction);return mn(na,ii||0,Ci==null?Ui:Ci,function(kr,ia,Gr,Ur){var Ir=Gr=="ltr",Or=Tr(kr,Ir?"left":"right"),ra=Tr(ia-1,Ir?"right":"left"),So=ii==null&&kr==0,to=Ci==null&&ia==Ui,Xr=Ur==0,La=!na||Ur==na.length-1;if(ra.top-Or.top<=3){var Wr=(se?So:to)&&Xr,ms=(se?to:So)&&La,za=Wr?q:(Ir?Or:ra).left,lo=ms?ee:(Ir?ra:Or).right;Pe(za,Or.top,lo-za,Or.bottom)}else{var uo,Qr,Oo,gs;Ir?(uo=se&&So&&Xr?q:Or.left,Qr=se?ee:oa(kr,Gr,"before"),Oo=se?q:oa(ia,Gr,"after"),gs=se&&to&&La?ee:ra.right):(uo=se?oa(kr,Gr,"before"):q,Qr=!se&&So&&Xr?ee:Or.right,Oo=!se&&to&&La?q:ra.left,gs=se?oa(ia,Gr,"after"):ee),Pe(uo,Or.top,Qr-uo,Or.bottom),Or.bottom<ra.top&&Pe(q,Or.bottom,null,ra.top),Pe(Oo,ra.top,gs-Oo,ra.bottom)}(!fr||sr(Or,fr)<0)&&(fr=Or),sr(ra,fr)<0&&(fr=ra),(!Hr||sr(Or,Hr)<0)&&(Hr=Or),sr(ra,Hr)<0&&(Hr=ra)}),{start:fr,end:Hr}}var _t=t.from(),ut=t.to();if(_t.line==ut.line)Fe(_t.line,_t.ch,ut.ch);else{var en=Cn(g,_t.line),xn=Cn(g,ut.line),Wn=it(en)==it(xn),Vn=Fe(_t.line,_t.ch,Wn?en.text.length+1:null).end,Zn=Fe(ut.line,Wn?0:null,ut.ch).start;Wn&&(Vn.top<Zn.top-2?(Pe(Vn.right,Vn.top,null,Vn.bottom),Pe(q,Zn.top,Zn.left,Zn.bottom)):Pe(Vn.right,Vn.top,Zn.left-Vn.right,Vn.bottom)),Vn.bottom<Zn.top&&Pe(q,Vn.bottom,null,Zn.top)}l.appendChild(j)}function wr(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var l=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Ta(e),t.cursorDiv.style.visibility=(l=!l)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Ma(e){e.state.focused||(e.display.input.focus(),la(e))}function no(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ta(e))},100)}function la(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Ge(e,"focus",e,t),e.state.focused=!0,F(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),k&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),wr(e)}function Ta(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Ge(e,"blur",e,t),e.state.focused=!1,_(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,l=t.lineDiv.offsetTop,i=0;i<t.view.length;i++){var g=t.view[i],j=e.options.lineWrapping,$=void 0,q=0;if(g.hidden)continue;if(H&&P<8){var ee=g.node.offsetTop+g.node.offsetHeight;$=ee-l,l=ee}else{var se=g.node.getBoundingClientRect();$=se.bottom-se.top,!j&&g.text.firstChild&&(q=g.text.firstChild.getBoundingClientRect().right-se.left-1)}var Pe=g.line.height-$;if((Pe>.005||Pe<-.005)&&(hi(g.line,$),Sa(g.line),g.rest))for(var Fe=0;Fe<g.rest.length;Fe++)Sa(g.rest[Fe]);if(q>e.display.sizerWidth){var _t=Math.ceil(q/Bi(e.display));_t>e.display.maxLineLength&&(e.display.maxLineLength=_t,e.display.maxLine=g.line,e.display.maxLineChanged=!0)}}}function Sa(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var l=e.widgets[t],i=l.node.parentNode;i&&(l.height=i.offsetHeight)}}function ka(e,t,l){var i=l&&l.top!=null?Math.max(0,l.top):e.scroller.scrollTop;i=Math.floor(i-vr(e));var g=l&&l.bottom!=null?l.bottom:i+e.wrapper.clientHeight,j=ji(t,i),$=ji(t,g);if(l&&l.ensure){var q=l.ensure.from.line,ee=l.ensure.to.line;q<j?(j=q,$=ji(t,Dn(Cn(t,q))+e.wrapper.clientHeight)):Math.min(ee,t.lastLine())>=$&&(j=ji(t,Dn(Cn(t,ee))-e.wrapper.clientHeight),$=ee)}return{from:j,to:Math.max($,j+1)}}function co(e,t){if(vt(e,"scrollCursorIntoView"))return;var l=e.display,i=l.sizer.getBoundingClientRect(),g=null;if(t.top+i.top<0?g=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(g=!1),g!=null&&!s){var j=c("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-l.viewOffset-vr(e.display))+`px;
|
|
height: `+(t.bottom-t.top+We(e)+l.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(j),j.scrollIntoView(g),e.display.lineSpace.removeChild(j)}}function Ro(e,t,l,i){i==null&&(i=0);var g;!e.options.lineWrapping&&t==l&&(t=t.ch?cn(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,l=t.sticky=="before"?cn(t.line,t.ch+1,"before"):t);for(var j=0;j<5;j++){var $=!1,q=yn(e,t),ee=!l||l==t?q:yn(e,l);g={left:Math.min(q.left,ee.left),top:Math.min(q.top,ee.top)-i,right:Math.max(q.left,ee.left),bottom:Math.max(q.bottom,ee.bottom)+i};var se=Oa(e,g),Pe=e.doc.scrollTop,Fe=e.doc.scrollLeft;if(se.scrollTop!=null&&(Da(e,se.scrollTop),Math.abs(e.doc.scrollTop-Pe)>1&&($=!0)),se.scrollLeft!=null&&(Nr(e,se.scrollLeft),Math.abs(e.doc.scrollLeft-Fe)>1&&($=!0)),!$)break}return g}function Ga(e,t){var l=Oa(e,t);l.scrollTop!=null&&Da(e,l.scrollTop),l.scrollLeft!=null&&Nr(e,l.scrollLeft)}function Oa(e,t){var l=e.display,i=Hi(e.display);t.top<0&&(t.top=0);var g=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:l.scroller.scrollTop,j=ie(e),$={};t.bottom-t.top>j&&(t.bottom=t.top+j);var q=e.doc.height+ye(l),ee=t.top<i,se=t.bottom>q-i;if(t.top<g)$.scrollTop=ee?0:t.top;else if(t.bottom>g+j){var Pe=Math.min(t.top,(se?q:t.bottom)-j);Pe!=g&&($.scrollTop=Pe)}var Fe=e.options.fixedGutter?0:l.gutters.offsetWidth,_t=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:l.scroller.scrollLeft-Fe,ut=we(e)-l.gutters.offsetWidth,en=t.right-t.left>ut;return en&&(t.right=t.left+ut),t.left<10?$.scrollLeft=0:t.left<_t?$.scrollLeft=Math.max(0,t.left+Fe-(en?0:10)):t.right>ut+_t-3&&($.scrollLeft=t.right+(en?0:10)-ut),$}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,l){(t!=null||l!=null)&&Ya(e),t!=null&&(e.curOp.scrollLeft=t),l!=null&&(e.curOp.scrollTop=l)}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 l=Ht(e,t.from),i=Ht(e,t.to);Aa(e,l,i,t.margin)}}function Aa(e,t,l,i){var g=Oa(e,{left:Math.min(t.left,l.left),top:Math.min(t.top,l.top)-i,right:Math.max(t.right,l.right),bottom:Math.max(t.bottom,l.bottom)+i});Ra(e,g.scrollLeft,g.scrollTop)}function Da(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;N||Ua(e,{top:t}),ya(e,t,!0),N&&Ua(e),Na(e,100)}function ya(e,t,l){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!l)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Nr(e,t,l,i){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(l?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!i)return;e.doc.scrollLeft=t,ki(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function fa(e){var t=e.display,l=t.gutters.offsetWidth,i=Math.round(e.doc.height+ye(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?l:0,docHeight:i,scrollHeight:i+We(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:l}}var pa=function(e,t,l){this.cm=l;var i=this.vert=c("div",[c("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),g=this.horiz=c("div",[c("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=g.tabIndex=-1,e(i),e(g),Ue(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),Ue(g,"scroll",function(){g.clientWidth&&t(g.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,H&&P<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};pa.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,l=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(l){this.vert.style.display="block",this.vert.style.bottom=t?i+"px":"0";var g=e.viewHeight-(t?i:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+g)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=l?i+"px":"0",this.horiz.style.left=e.barLeft+"px";var j=e.viewWidth-e.barLeft-(l?i:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+j)+"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:l?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=a&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Z,this.disableVert=new Z},pa.prototype.enableZeroWidthBar=function(e,t,l){e.style.pointerEvents="auto";function i(){var g=e.getBoundingClientRect(),j=l=="vert"?document.elementFromPoint(g.right-1,(g.top+g.bottom)/2):document.elementFromPoint((g.right+g.left)/2,g.bottom-1);j!=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 l=e.display.barWidth,i=e.display.barHeight;Xa(e,t);for(var g=0;g<4&&l!=e.display.barWidth||i!=e.display.barHeight;g++)l!=e.display.barWidth&&e.options.lineWrapping&&wa(e),Xa(e,fa(e)),l=e.display.barWidth,i=e.display.barHeight}function Xa(e,t){var l=e.display,i=l.scrollbars.update(t);l.sizer.style.paddingRight=(l.barWidth=i.right)+"px",l.sizer.style.paddingBottom=(l.barHeight=i.bottom)+"px",l.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(l.scrollbarFiller.style.display="block",l.scrollbarFiller.style.height=i.bottom+"px",l.scrollbarFiller.style.width=i.right+"px"):l.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(l.gutterFiller.style.display="block",l.gutterFiller.style.height=i.bottom+"px",l.gutterFiller.style.width=t.gutterWidth+"px"):l.gutterFiller.style.display=""}var $a={native:pa,null:ba};function Qa(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&_(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),Ue(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,l){l=="horizontal"?Nr(e,t):Da(e,t)},e),e.display.scrollbars.addClass&&F(e.display.wrapper,e.display.scrollbars.addClass)}var Ia=0;function ua(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},hn(e.curOp)}function Ea(e){var t=e.curOp;t&&Rn(t,function(l){for(var i=0;i<l.ops.length;i++)l.ops[i].cm.curOp=null;io(l)})}function io(e){for(var t=e.ops,l=0;l<t.length;l++)Ao(t[l]);for(var i=0;i<t.length;i++)Do(t[i]);for(var g=0;g<t.length;g++)fo(t[g]);for(var j=0;j<t.length;j++)ro(t[j]);for(var $=0;$<t.length;$++)po(t[$])}function Ao(e){var t=e.cm,l=t.display;ao(t),e.updateMaxLine&&wn(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<l.viewFrom||e.scrollToPos.to.line>=l.viewTo)||l.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ea(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,l=t.display;e.updatedDisplay&&wa(t),e.barMeasure=fa(t),l.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=De(t,l.maxLine,l.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(l.scroller.clientWidth,l.sizer.offsetLeft+e.adjustWidthTo+We(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,l.sizer.offsetLeft+e.adjustWidthTo-we(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=l.input.prepareSelection())}function ro(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Nr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var l=e.focus&&e.focus==U();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,l),(e.updatedDisplay||e.startHeight!=t.doc.height)&&ma(t,e.barMeasure),e.updatedDisplay&&Xi(t,e.barMeasure),e.selectionChanged&&wr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),l&&Ma(e.cm)}function po(e){var t=e.cm,l=t.display,i=t.doc;if(e.updatedDisplay&&Ja(t,e.update),l.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(l.wheelStartX=l.wheelStartY=null),e.scrollTop!=null&&ya(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Nr(t,e.scrollLeft,!0,!0),e.scrollToPos){var g=Ro(t,S(i,e.scrollToPos.from),S(i,e.scrollToPos.to),e.scrollToPos.margin);co(t,g)}var j=e.maybeHiddenMarkers,$=e.maybeUnhiddenMarkers;if(j)for(var q=0;q<j.length;++q)j[q].lines.length||Ge(j[q],"hide");if($)for(var ee=0;ee<$.length;++ee)$[ee].lines.length&&Ge($[ee],"unhide");l.wrapper.offsetHeight&&(i.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ge(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Kr(e,t){if(e.curOp)return t();ua(e);try{return t()}finally{Ea(e)}}function br(e,t){return function(){if(e.curOp)return t.apply(e,arguments);ua(e);try{return t.apply(e,arguments)}finally{Ea(e)}}}function Lr(e){return function(){if(this.curOp)return e.apply(this,arguments);ua(this);try{return e.apply(this,arguments)}finally{Ea(this)}}}function Er(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);ua(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,B(mo,e))}function mo(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var l=+new Date+e.options.workTime,i=kn(e,t.highlightFrontier),g=[];t.iter(i.line,Math.min(t.first+t.size,e.display.viewTo+500),function(j){if(i.line>=e.display.viewFrom){var $=j.styles,q=j.text.length>e.options.maxHighlightLength?vn(t.mode,i.state):null,ee=ke(e,j,i,!0);q&&(i.state=q),j.styles=ee.styles;var se=j.styleClasses,Pe=ee.classes;Pe?j.styleClasses=Pe:se&&(j.styleClasses=null);for(var Fe=!$||$.length!=j.styles.length||se!=Pe&&(!se||!Pe||se.bgClass!=Pe.bgClass||se.textClass!=Pe.textClass),_t=0;!Fe&&_t<$.length;++_t)Fe=$[_t]!=j.styles[_t];Fe&&g.push(i.line),j.stateAfter=i.save(),i.nextLine()}else j.text.length<=e.options.maxHighlightLength&&Qn(e,j.text,i),j.stateAfter=i.line%5==0?i.save():null,i.nextLine();if(+new Date>l)return Na(e,e.options.workDelay),!0}),t.highlightFrontier=i.line,t.modeFrontier=Math.max(t.modeFrontier,i.line),g.length&&Kr(e,function(){for(var j=0;j<g.length;j++)rr(e,g[j],"text")})}var ea=function(e,t,l){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=we(e),this.force=l,this.dims=vi(e),this.events=[]};ea.prototype.signal=function(e,t){ge(e,t)&&this.events.push(arguments)},ea.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ge.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=We(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=We(e)+"px",t.scrollbarsClipped=!0)}function oo(e){if(e.hasFocus())return null;var t=U();if(!t||!E(e.display.lineDiv,t))return null;var l={activeElt:t};if(window.getSelection){var i=window.getSelection();i.anchorNode&&i.extend&&E(e.display.lineDiv,i.anchorNode)&&(l.anchorNode=i.anchorNode,l.anchorOffset=i.anchorOffset,l.focusNode=i.focusNode,l.focusOffset=i.focusOffset)}return l}function so(e){if(!e||!e.activeElt||e.activeElt==U())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&E(document.body,e.anchorNode)&&E(document.body,e.focusNode)){var t=window.getSelection(),l=document.createRange();l.setEnd(e.anchorNode,e.anchorOffset),l.collapse(!1),t.removeAllRanges(),t.addRange(l),t.extend(e.focusNode,e.focusOffset)}}function xa(e,t){var l=e.display,i=e.doc;if(t.editorIsHidden)return dr(e),!1;if(!t.force&&t.visible.from>=l.viewFrom&&t.visible.to<=l.viewTo&&(l.updateLineNumbers==null||l.updateLineNumbers>=l.viewTo)&&l.renderedView==l.view&&sa(e)==0)return!1;mr(e)&&(dr(e),t.dims=vi(e));var g=i.first+i.size,j=Math.max(t.visible.from-e.options.viewportMargin,i.first),$=Math.min(g,t.visible.to+e.options.viewportMargin);l.viewFrom<j&&j-l.viewFrom<20&&(j=Math.max(i.first,l.viewFrom)),l.viewTo>$&&l.viewTo-$<20&&($=Math.min(g,l.viewTo)),Ai&&(j=Lt(e.doc,j),$=ct(e.doc,$));var q=j!=l.viewFrom||$!=l.viewTo||l.lastWrapHeight!=t.wrapperHeight||l.lastWrapWidth!=t.wrapperWidth;ha(e,j,$),l.viewOffset=Dn(Cn(e.doc,l.viewFrom)),e.display.mover.style.top=l.viewOffset+"px";var ee=sa(e);if(!q&&ee==0&&!t.force&&l.renderedView==l.view&&(l.updateLineNumbers==null||l.updateLineNumbers>=l.viewTo))return!1;var se=oo(e);return ee>4&&(l.lineDiv.style.display="none"),go(e,l.updateLineNumbers,t.dims),ee>4&&(l.lineDiv.style.display=""),l.renderedView=l.view,so(se),y(l.cursorDiv),y(l.selectionDiv),l.gutters.style.height=l.sizer.style.minHeight=0,q&&(l.lastWrapHeight=t.wrapperHeight,l.lastWrapWidth=t.wrapperWidth,Na(e,400)),l.updateLineNumbers=null,!0}function Ja(e,t){for(var l=t.viewport,i=!0;;i=!1){if(!i||!e.options.lineWrapping||t.oldDisplayWidth==we(e)){if(l&&l.top!=null&&(l={top:Math.min(e.doc.height+ye(e.display)-ie(e),l.top)}),t.visible=ka(e.display,e.doc,l),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else i&&(t.visible=ka(e.display,e.doc,l));if(!xa(e,t))break;wa(e);var g=fa(e);qi(e),ma(e,g),Xi(e,g),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 l=new ea(e,t);if(xa(e,l)){wa(e),Ja(e,l);var i=fa(e);qi(e),ma(e,i),Xi(e,i),l.finish()}}function go(e,t,l){var i=e.display,g=e.options.lineNumbers,j=i.lineDiv,$=j.firstChild;function q(en){var xn=en.nextSibling;return k&&a&&e.display.currentWheelTarget==en?en.style.display="none":en.parentNode.removeChild(en),xn}for(var ee=i.view,se=i.viewFrom,Pe=0;Pe<ee.length;Pe++){var Fe=ee[Pe];if(!Fe.hidden)if(!Fe.node||Fe.node.parentNode!=j){var _t=mi(e,Fe,se,l);j.insertBefore(_t,$)}else{for(;$!=Fe.node;)$=q($);var ut=g&&t!=null&&t<=se&&Fe.lineNumber;Fe.changes&&(oe(Fe.changes,"gutter")>-1&&(ut=!1),kt(e,Fe,se,l)),ut&&(y(Fe.lineNumber),Fe.lineNumber.appendChild(document.createTextNode(yr(e.options,se)))),$=Fe.node.nextSibling}se+=Fe.size}for(;$;)$=q($)}function Za(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Xi(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+We(e)+"px"}function ki(e){var t=e.display,l=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var i=_r(t)-t.scroller.scrollLeft+e.doc.scrollLeft,g=t.gutters.offsetWidth,j=i+"px",$=0;$<l.length;$++)if(!l[$].hidden){e.options.fixedGutter&&(l[$].gutter&&(l[$].gutter.style.left=j),l[$].gutterBackground&&(l[$].gutterBackground.style.left=j));var q=l[$].alignable;if(q)for(var ee=0;ee<q.length;ee++)q[ee].style.left=j}e.options.fixedGutter&&(t.gutters.style.left=i+g+"px")}function mr(e){if(!e.options.lineNumbers)return!1;var t=e.doc,l=yr(e.options,t.first+t.size-1),i=e.display;if(l.length!=i.lineNumChars){var g=i.measure.appendChild(c("div",[c("div",l)],"CodeMirror-linenumber CodeMirror-gutter-elt")),j=g.firstChild.offsetWidth,$=g.offsetWidth-j;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(j,i.lineGutter.offsetWidth-$)+1,i.lineNumWidth=i.lineNumInnerWidth+$,i.lineNumChars=i.lineNumInnerWidth?l.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",Za(e.display),!0}return!1}function Br(e,t){for(var l=[],i=!1,g=0;g<e.length;g++){var j=e[g],$=null;if(typeof j!="string"&&($=j.style,j=j.className),j=="CodeMirror-linenumbers")if(t)i=!0;else continue;l.push({className:j,style:$})}return t&&!i&&l.push({className:"CodeMirror-linenumbers",style:null}),l}function Pa(e){var t=e.gutters,l=e.gutterSpecs;y(t),e.lineGutter=null;for(var i=0;i<l.length;++i){var g=l[i],j=g.className,$=g.style,q=t.appendChild(c("div",null,"CodeMirror-gutter "+j));$&&(q.style.cssText=$),j=="CodeMirror-linenumbers"&&(e.lineGutter=q,q.style.width=(e.lineNumWidth||1)+"px")}t.style.display=l.length?"":"none",Za(e)}function da(e){Pa(e.display),Zi(e),ki(e)}function ja(e,t,l,i){var g=this;this.input=l,g.scrollbarFiller=c("div",null,"CodeMirror-scrollbar-filler"),g.scrollbarFiller.setAttribute("cm-not-content","true"),g.gutterFiller=c("div",null,"CodeMirror-gutter-filler"),g.gutterFiller.setAttribute("cm-not-content","true"),g.lineDiv=v("div",null,"CodeMirror-code"),g.selectionDiv=c("div",null,null,"position: relative; z-index: 1"),g.cursorDiv=c("div",null,"CodeMirror-cursors"),g.measure=c("div",null,"CodeMirror-measure"),g.lineMeasure=c("div",null,"CodeMirror-measure"),g.lineSpace=v("div",[g.measure,g.lineMeasure,g.selectionDiv,g.cursorDiv,g.lineDiv],null,"position: relative; outline: none");var j=v("div",[g.lineSpace],"CodeMirror-lines");g.mover=c("div",[j],null,"position: relative"),g.sizer=c("div",[g.mover],"CodeMirror-sizer"),g.sizerWidth=null,g.heightForcer=c("div",null,null,"position: absolute; height: "+pe+"px; width: 1px;"),g.gutters=c("div",null,"CodeMirror-gutters"),g.lineGutter=null,g.scroller=c("div",[g.sizer,g.heightForcer,g.gutters],"CodeMirror-scroll"),g.scroller.setAttribute("tabIndex","-1"),g.wrapper=c("div",[g.scrollbarFiller,g.gutterFiller,g.scroller],"CodeMirror"),H&&P<8&&(g.gutters.style.zIndex=-1,g.scroller.style.paddingRight=0),!k&&!(N&&o)&&(g.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(g.wrapper):e(g.wrapper)),g.viewFrom=g.viewTo=t.first,g.reportedViewFrom=g.reportedViewTo=t.first,g.view=[],g.renderedView=null,g.externalMeasured=null,g.viewOffset=0,g.lastWrapHeight=g.lastWrapWidth=0,g.updateLineNumbers=null,g.nativeBarWidth=g.barHeight=g.barWidth=0,g.scrollbarsClipped=!1,g.lineNumWidth=g.lineNumInnerWidth=g.lineNumChars=null,g.alignWidgets=!1,g.cachedCharWidth=g.cachedTextHeight=g.cachedPaddingH=null,g.maxLine=null,g.maxLineLength=0,g.maxLineChanged=!1,g.wheelDX=g.wheelDY=g.wheelStartX=g.wheelStartY=null,g.shift=!1,g.selForContextMenu=null,g.activeTouch=null,g.gutterSpecs=Br(i.gutters,i.lineNumbers),Pa(g),l.init(g)}var ca=0,Sr=null;H?Sr=-.53:N?Sr=15:b?Sr=-.7:f&&(Sr=-1/3);function Fa(e){var t=e.wheelDeltaX,l=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),l==null&&e.detail&&e.axis==e.VERTICAL_AXIS?l=e.detail:l==null&&(l=e.wheelDelta),{x:t,y:l}}function Ba(e){var t=Fa(e);return t.x*=Sr,t.y*=Sr,t}function Ha(e,t){var l=Fa(t),i=l.x,g=l.y,j=e.display,$=j.scroller,q=$.scrollWidth>$.clientWidth,ee=$.scrollHeight>$.clientHeight;if(!(i&&q||g&&ee))return;if(g&&a&&k){e:for(var se=t.target,Pe=j.view;se!=$;se=se.parentNode)for(var Fe=0;Fe<Pe.length;Fe++)if(Pe[Fe].node==se){e.display.currentWheelTarget=se;break e}}if(i&&!N&&!m&&Sr!=null){g&&ee&&Da(e,Math.max(0,$.scrollTop+g*Sr)),Nr(e,Math.max(0,$.scrollLeft+i*Sr)),(!g||g&&ee)&&ae(t),j.wheelStartX=null;return}if(g&&Sr!=null){var _t=g*Sr,ut=e.doc.scrollTop,en=ut+j.wrapper.clientHeight;_t<0?ut=Math.max(0,ut+_t-50):en=Math.min(e.doc.height,en+_t+50),Ua(e,{top:ut,bottom:en})}ca<20&&(j.wheelStartX==null?(j.wheelStartX=$.scrollLeft,j.wheelStartY=$.scrollTop,j.wheelDX=i,j.wheelDY=g,setTimeout(function(){if(j.wheelStartX==null)return;var xn=$.scrollLeft-j.wheelStartX,Wn=$.scrollTop-j.wheelStartY,Vn=Wn&&j.wheelDY&&Wn/j.wheelDY||xn&&j.wheelDX&&xn/j.wheelDX;if(j.wheelStartX=j.wheelStartY=null,!Vn)return;Sr=(Sr*ca+Vn)/(ca+1),++ca},200)):(j.wheelDX+=i,j.wheelDY+=g))}var zr=function(e,t){this.ranges=e,this.primIndex=t};zr.prototype.primary=function(){return this.ranges[this.primIndex]},zr.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 l=this.ranges[t],i=e.ranges[t];if(!pr(l.anchor,i.anchor)||!pr(l.head,i.head))return!1}return!0},zr.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Gi(Cr(this.ranges[t].anchor),Cr(this.ranges[t].head));return new zr(e,this.primIndex)},zr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},zr.prototype.contains=function(e,t){t||(t=e);for(var l=0;l<this.ranges.length;l++){var i=this.ranges[l];if(ri(t,i.from())>=0&&ri(e,i.to())<=0)return l}return-1};var Gi=function(e,t){this.anchor=e,this.head=t};Gi.prototype.from=function(){return nr(this.anchor,this.head)},Gi.prototype.to=function(){return tr(this.anchor,this.head)},Gi.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Si(e,t,l){var i=e&&e.options.selectionsMayTouch,g=t[l];t.sort(function(_t,ut){return ri(_t.from(),ut.from())}),l=oe(t,g);for(var j=1;j<t.length;j++){var $=t[j],q=t[j-1],ee=ri(q.to(),$.from());if(i&&!$.empty()?ee>0:ee>=0){var se=nr(q.from(),$.from()),Pe=tr(q.to(),$.to()),Fe=q.empty()?$.from()==$.head:q.from()==q.head;j<=l&&--l,t.splice(--j,2,new Gi(Fe?Pe:se,Fe?se:Pe))}}return new zr(t,l)}function Xn(e,t){return new zr([new Gi(e,t||e)],0)}function ui(e){return e.text?cn(e.from.line+e.text.length-1,nt(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Mi(e,t){if(ri(e,t.from)<0)return e;if(ri(e,t.to)<=0)return ui(t);var l=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=ui(t).ch-t.to.ch),cn(l,i)}function hr(e,t){for(var l=[],i=0;i<e.sel.ranges.length;i++){var g=e.sel.ranges[i];l.push(new Gi(Mi(g.anchor,t),Mi(g.head,t)))}return Si(e.cm,l,e.sel.primIndex)}function ga(e,t,l){return e.line==t.line?cn(l.line,e.ch-t.ch+l.ch):cn(l.line+(e.line-t.line),e.ch)}function aa(e,t,l){for(var i=[],g=cn(e.first,0),j=g,$=0;$<t.length;$++){var q=t[$],ee=ga(q.from,g,j),se=ga(ui(q),g,j);if(g=q.to,j=se,l=="around"){var Pe=e.sel.ranges[$],Fe=ri(Pe.head,Pe.anchor)<0;i[$]=new Gi(Fe?se:ee,Fe?ee:se)}else i[$]=new Gi(ee,ee)}return new zr(i,e.sel.primIndex)}function Mr(e){e.doc.mode=Ne(e.options,e.doc.modeOption),$r(e)}function $r(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&&Zi(e)}function va(e,t){return t.from.ch==0&&t.to.ch==0&&nt(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Wa(e,t,l,i){function g(Zn){return l?l[Zn]:null}function j(Zn,Yn,ii){Pn(Zn,Yn,ii,i),Rt(Zn,"change",Zn,t)}function $(Zn,Yn){for(var ii=[],Ci=Zn;Ci<Yn;++Ci)ii.push(new Nn(se[Ci],g(Ci),i));return ii}var q=t.from,ee=t.to,se=t.text,Pe=Cn(e,q.line),Fe=Cn(e,ee.line),_t=nt(se),ut=g(se.length-1),en=ee.line-q.line;if(t.full)e.insert(0,$(0,se.length)),e.remove(se.length,e.size-se.length);else if(va(e,t)){var xn=$(0,se.length-1);j(Fe,Fe.text,ut),en&&e.remove(q.line,en),xn.length&&e.insert(q.line,xn)}else if(Pe==Fe)if(se.length==1)j(Pe,Pe.text.slice(0,q.ch)+_t+Pe.text.slice(ee.ch),ut);else{var Wn=$(1,se.length-1);Wn.push(new Nn(_t+Pe.text.slice(ee.ch),ut,i)),j(Pe,Pe.text.slice(0,q.ch)+se[0],g(0)),e.insert(q.line+1,Wn)}else if(se.length==1)j(Pe,Pe.text.slice(0,q.ch)+se[0]+Fe.text.slice(ee.ch),g(0)),e.remove(q.line+1,en);else{j(Pe,Pe.text.slice(0,q.ch)+se[0],g(0)),j(Fe,_t+Fe.text.slice(ee.ch),ut);var Vn=$(1,se.length-1);en>1&&e.remove(q.line+1,en-1),e.insert(q.line+1,Vn)}Rt(e,"change",e,t)}function Ar(e,t,l){function i(g,j,$){if(g.linked)for(var q=0;q<g.linked.length;++q){var ee=g.linked[q];if(ee.doc==j)continue;var se=$&&ee.sharedHist;if(l&&!se)continue;t(ee.doc,se),i(ee.doc,g,se)}}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,jr(e),Mr(e),_s(e),e.options.lineWrapping||wn(e),e.options.mode=t.modeOption,Zi(e)}function _s(e){(e.doc.direction=="rtl"?F:_)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Kr(e,function(){_s(e),Zi(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 is(e,t){var l={from:Cr(t.from),to:ui(t),text:Ti(e,t.from,t.to)};return Es(e,l,t.from.line,t.to.line+1),Ar(e,function(i){return Es(i,l,t.from.line,t.to.line+1)},!0),l}function ys(e){for(;e.length;){var t=nt(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return ys(e.done),nt(e.done);if(e.done.length&&!nt(e.done).ranges)return nt(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),nt(e.done)}function bs(e,t,l,i){var g=e.history;g.undone.length=0;var j=+new Date,$,q;if((g.lastOp==i||g.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&g.lastModTime>j-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&($=pl(g,g.lastOp==i)))q=nt($.changes),ri(t.from,t.to)==0&&ri(t.from,q.to)==0?q.to=ui(t):$.changes.push(is(e,t));else{var ee=nt(g.done);for((!ee||!ee.ranges)&&Go(e.sel,g.done),$={changes:[is(e,t)],generation:g.generation},g.done.push($);g.done.length>g.undoDepth;)g.done.shift(),g.done[0].ranges||g.done.shift()}g.done.push(l),g.generation=++g.maxGeneration,g.lastModTime=g.lastSelTime=j,g.lastOp=g.lastSelOp=i,g.lastOrigin=g.lastSelOrigin=t.origin,q||Ge(e,"historyAdded")}function ml(e,t,l,i){var g=t.charAt(0);return g=="*"||g=="+"&&l.ranges.length==i.ranges.length&&l.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,l,i){var g=e.history,j=i&&i.origin;l==g.lastSelOp||j&&g.lastSelOrigin==j&&(g.lastModTime==g.lastSelTime&&g.lastOrigin==j||ml(e,j,nt(g.done),t))?g.done[g.done.length-1]=t:Go(t,g.done),g.lastSelTime=+new Date,g.lastSelOrigin=j,g.lastSelOp=l,i&&i.clearRedo!==!1&&ys(g.undone)}function Go(e,t){var l=nt(t);l&&l.ranges&&l.equals(e)||t.push(e)}function Es(e,t,l,i){var g=t["spans_"+e.id],j=0;e.iter(Math.max(e.first,l),Math.min(e.first+e.size,i),function($){$.markedSpans&&((g||(g=t["spans_"+e.id]={}))[j]=$.markedSpans),++j})}function vl(e){if(!e)return null;for(var t,l=0;l<e.length;++l)e[l].marker.explicitlyCleared?t||(t=e.slice(0,l)):t&&t.push(e[l]);return t?t.length?t:null:e}function _l(e,t){var l=t["spans_"+e.id];if(!l)return null;for(var i=[],g=0;g<t.text.length;++g)i.push(vl(l[g]));return i}function xs(e,t){var l=_l(e,t),i=ai(e,t);if(!l)return i;if(!i)return l;for(var g=0;g<l.length;++g){var j=l[g],$=i[g];if(j&&$){e:for(var q=0;q<$.length;++q){for(var ee=$[q],se=0;se<j.length;++se)if(j[se].marker==ee.marker)continue e;j.push(ee)}}else $&&(l[g]=$)}return l}function vo(e,t,l){for(var i=[],g=0;g<e.length;++g){var j=e[g];if(j.ranges){i.push(l?zr.prototype.deepCopy.call(j):j);continue}var $=j.changes,q=[];i.push({changes:q});for(var ee=0;ee<$.length;++ee){var se=$[ee],Pe=void 0;if(q.push({from:se.from,to:se.to,text:se.text}),t)for(var Fe in se)(Pe=Fe.match(/^spans_(\d+)$/))&&(oe(t,Number(Pe[1]))>-1&&(nt(q)[Fe]=se[Fe],delete se[Fe]))}}return i}function rs(e,t,l,i){if(i){var g=e.anchor;if(l){var j=ri(t,g)<0;j!=ri(l,g)<0?(g=t,t=l):j!=ri(t,l)<0&&(t=l)}return new Gi(g,t)}else return new Gi(l||t,t)}function Vo(e,t,l,i,g){g==null&&(g=e.cm&&(e.cm.display.shift||e.extend)),Yr(e,new zr([rs(e.sel.primary(),t,l,g)],0),i)}function Cs(e,t,l){for(var i=[],g=e.cm&&(e.cm.display.shift||e.extend),j=0;j<e.sel.ranges.length;j++)i[j]=rs(e.sel.ranges[j],t[j],null,g);var $=Si(e.cm,i,e.sel.primIndex);Yr(e,$,l)}function as(e,t,l,i){var g=e.sel.ranges.slice(0);g[t]=l,Yr(e,Si(e.cm,g,e.sel.primIndex),i)}function Ts(e,t,l,i){Yr(e,Xn(t,l),i)}function yl(e,t,l){var i={ranges:t.ranges,update:function(g){this.ranges=[];for(var j=0;j<g.length;j++)this.ranges[j]=new Gi(S(e,g[j].anchor),S(e,g[j].head))},origin:l&&l.origin};return Ge(e,"beforeSelectionChange",e,i),e.cm&&Ge(e.cm,"beforeSelectionChange",e.cm,i),i.ranges!=t.ranges?Si(e.cm,i.ranges,i.ranges.length-1):t}function ws(e,t,l){var i=e.history.done,g=nt(i);g&&g.ranges?(i[i.length-1]=t,Yo(e,t,l)):Yr(e,t,l)}function Yr(e,t,l){Yo(e,t,l),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,l)}function Yo(e,t,l){(ge(e,"beforeSelectionChange")||e.cm&&ge(e.cm,"beforeSelectionChange"))&&(t=yl(e,t,l));var i=l&&l.bias||(ri(t.primary().head,e.sel.primary().head)<0?-1:1);Ss(e,Rs(e,t,i,!0)),!(l&&l.scroll===!1)&&e.cm&&_a(e.cm)}function Ss(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Ae(e.cm)),Rt(e,"cursorActivity",e)}function Os(e){Ss(e,Rs(e,e.sel,null,!1))}function Rs(e,t,l,i){for(var g,j=0;j<t.ranges.length;j++){var $=t.ranges[j],q=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[j],ee=Xo(e,$.anchor,q&&q.anchor,l,i),se=Xo(e,$.head,q&&q.head,l,i);(g||ee!=$.anchor||se!=$.head)&&(g||(g=t.ranges.slice(0,j)),g[j]=new Gi(ee,se))}return g?Si(e.cm,g,t.primIndex):t}function _o(e,t,l,i,g){var j=Cn(e,t.line);if(j.markedSpans)for(var $=0;$<j.markedSpans.length;++$){var q=j.markedSpans[$],ee=q.marker,se="selectLeft"in ee?!ee.selectLeft:ee.inclusiveLeft,Pe="selectRight"in ee?!ee.selectRight:ee.inclusiveRight;if((q.from==null||(se?q.from<=t.ch:q.from<t.ch))&&(q.to==null||(Pe?q.to>=t.ch:q.to>t.ch))){if(g&&(Ge(ee,"beforeCursorEnter"),ee.explicitlyCleared))if(j.markedSpans){--$;continue}else break;if(!ee.atomic)continue;if(l){var Fe=ee.find(i<0?1:-1),_t=void 0;if((i<0?Pe:se)&&(Fe=As(e,Fe,-i,Fe&&Fe.line==t.line?j:null)),Fe&&Fe.line==t.line&&(_t=ri(Fe,l))&&(i<0?_t<0:_t>0))return _o(e,Fe,t,i,g)}var ut=ee.find(i<0?-1:1);return(i<0?se:Pe)&&(ut=As(e,ut,i,ut.line==t.line?j:null)),ut?_o(e,ut,t,i,g):null}}return t}function Xo(e,t,l,i,g){var j=i||1,$=_o(e,t,l,j,g)||!g&&_o(e,t,l,j,!0)||_o(e,t,l,-j,g)||!g&&_o(e,t,l,-j,!0);return $||(e.cantEdit=!0,cn(e.first,0))}function As(e,t,l,i){return l<0&&t.ch==0?t.line>e.first?S(e,cn(t.line-1)):null:l>0&&t.ch==(i||Cn(e,t.line)).text.length?t.line<e.first+e.size-1?cn(t.line+1,0):null:new cn(t.line,t.ch+l)}function Ds(e){e.setSelection(cn(e.firstLine(),0),cn(e.lastLine()),xe)}function Ps(e,t,l){var i={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return i.canceled=!0}};return l&&(i.update=function(g,j,$,q){g&&(i.from=S(e,g)),j&&(i.to=S(e,j)),$&&(i.text=$),q!==void 0&&(i.origin=q)}),Ge(e,"beforeChange",e,i),e.cm&&Ge(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,l){if(e.cm){if(!e.cm.curOp)return br(e.cm,yo)(e,t,l);if(e.cm.state.suppressEdits)return}if((ge(e,"beforeChange")||e.cm&&ge(e.cm,"beforeChange"))&&(t=Ps(e,t,!0),!t))return;var i=Vr&&!l&&ue(e,t.from,t.to);if(i)for(var g=i.length-1;g>=0;--g)Ls(e,{from:i[g].from,to:i[g].to,text:g?[""]:t.text,origin:t.origin});else Ls(e,t)}function Ls(e,t){if(t.text.length==1&&t.text[0]==""&&ri(t.from,t.to)==0)return;var l=hr(e,t);bs(e,t,l,e.cm?e.cm.curOp.id:NaN),Po(e,t,l,ai(e,t));var i=[];Ar(e,function(g,j){!j&&oe(i,g.history)==-1&&(Ns(g.history,t),i.push(g.history)),Po(g,t,null,ai(g,t))})}function $o(e,t,l){var i=e.cm&&e.cm.state.suppressEdits;if(i&&!l)return;for(var g=e.history,j,$=e.sel,q=t=="undo"?g.done:g.undone,ee=t=="undo"?g.undone:g.done,se=0;se<q.length&&!(j=q[se],l?j.ranges&&!j.equals(e.sel):!j.ranges);se++);if(se==q.length)return;for(g.lastOrigin=g.lastSelOrigin=null;;)if(j=q.pop(),j.ranges){if(Go(j,ee),l&&!j.equals(e.sel)){Yr(e,j,{clearRedo:!1});return}$=j}else if(i){q.push(j);return}else break;var Pe=[];Go($,ee),ee.push({changes:Pe,generation:g.generation}),g.generation=j.generation||++g.maxGeneration;for(var Fe=ge(e,"beforeChange")||e.cm&&ge(e.cm,"beforeChange"),_t=function(xn){var Wn=j.changes[xn];if(Wn.origin=t,Fe&&!Ps(e,Wn,!1))return q.length=0,{};Pe.push(is(e,Wn));var Vn=xn?hr(e,Wn):nt(q);Po(e,Wn,Vn,xs(e,Wn)),!xn&&e.cm&&e.cm.scrollIntoView({from:Wn.from,to:ui(Wn)});var Zn=[];Ar(e,function(Yn,ii){!ii&&oe(Zn,Yn.history)==-1&&(Ns(Yn.history,Wn),Zn.push(Yn.history)),Po(Yn,Wn,null,xs(Yn,Wn))})},ut=j.changes.length-1;ut>=0;--ut){var en=_t(ut);if(en)return en.v}}function Ms(e,t){if(t==0)return;if(e.first+=t,e.sel=new zr(Kt(e.sel.ranges,function(g){return new Gi(cn(g.anchor.line+t,g.anchor.ch),cn(g.head.line+t,g.head.ch))}),e.sel.primIndex),e.cm){Zi(e.cm,e.first,e.first-t,t);for(var l=e.cm.display,i=l.viewFrom;i<l.viewTo;i++)rr(e.cm,i,"gutter")}}function Po(e,t,l,i){if(e.cm&&!e.cm.curOp)return br(e.cm,Po)(e,t,l,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 g=t.text.length-1-(e.first-t.from.line);Ms(e,g),t={from:cn(e.first,0),to:cn(t.to.line+g,t.to.ch),text:[nt(t.text)],origin:t.origin}}var j=e.lastLine();t.to.line>j&&(t={from:t.from,to:cn(j,Cn(e,j).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ti(e,t.from,t.to),l||(l=hr(e,t)),e.cm?bl(e.cm,t,i):Wa(e,t,i),Yo(e,l,xe),e.cantEdit&&Xo(e,cn(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,l){var i=e.doc,g=e.display,j=t.from,$=t.to,q=!1,ee=j.line;e.options.lineWrapping||(ee=fi(it(Cn(i,j.line))),i.iter(ee,$.line+1,function(ut){if(ut==g.maxLine)return q=!0,!0})),i.sel.contains(t.from,t.to)>-1&&Ae(e),Wa(i,t,l,Jr(e)),e.options.lineWrapping||(i.iter(ee,j.line+t.text.length,function(ut){var en=Kn(ut);en>g.maxLineLength&&(g.maxLine=ut,g.maxLineLength=en,g.maxLineChanged=!0,q=!1)}),q&&(e.curOp.updateMaxLine=!0)),Pr(i,j.line),Na(e,400);var se=t.text.length-($.line-j.line)-1;t.full?Zi(e):j.line==$.line&&t.text.length==1&&!va(e.doc,t)?rr(e,j.line,"text"):Zi(e,j.line,$.line+1,se);var Pe=ge(e,"changes"),Fe=ge(e,"change");if(Fe||Pe){var _t={from:j,to:$,text:t.text,removed:t.removed,origin:t.origin};Fe&&Rt(e,"change",e,_t),Pe&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(_t)}e.display.selForContextMenu=null}function bo(e,t,l,i,g){var j;i||(i=l),ri(i,l)<0&&(j=[i,l],l=j[0],i=j[1]),typeof t=="string"&&(t=e.splitLines(t)),yo(e,{from:l,to:i,text:t,origin:g})}function ks(e,t,l,i){l<e.line?e.line+=i:t<e.line&&(e.line=t,e.ch=0)}function Is(e,t,l,i){for(var g=0;g<e.length;++g){var j=e[g],$=!0;if(j.ranges){j.copied||(j=e[g]=j.deepCopy(),j.copied=!0);for(var q=0;q<j.ranges.length;q++)ks(j.ranges[q].anchor,t,l,i),ks(j.ranges[q].head,t,l,i);continue}for(var ee=0;ee<j.changes.length;++ee){var se=j.changes[ee];if(l<se.from.line)se.from=cn(se.from.line+i,se.from.ch),se.to=cn(se.to.line+i,se.to.ch);else if(t<=se.to.line){$=!1;break}}$||(e.splice(0,g+1),g=0)}}function Ns(e,t){var l=t.from.line,i=t.to.line,g=t.text.length-(i-l)-1;Is(e.done,l,i,g),Is(e.undone,l,i,g)}function Lo(e,t,l,i){var g=t,j=t;return typeof t=="number"?j=Cn(e,X(e,t)):g=fi(t),g==null?null:(i(j,g)&&e.cm&&rr(e.cm,g,l),j)}function Mo(e){this.lines=e,this.parent=null;for(var t=0,l=0;l<e.length;++l)e[l].parent=this,t+=e[l].height;this.height=t}Mo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var l=e,i=e+t;l<i;++l){var g=this.lines[l];this.height-=g.height,Dt(g),Rt(g,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,l){this.height+=l,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,l){for(var i=e+t;e<i;++e)if(l(this.lines[e]))return!0}};function ko(e){this.children=e;for(var t=0,l=0,i=0;i<e.length;++i){var g=e[i];t+=g.chunkSize(),l+=g.height,g.parent=this}this.size=t,this.height=l,this.parent=null}ko.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var l=0;l<this.children.length;++l){var i=this.children[l],g=i.chunkSize();if(e<g){var j=Math.min(t,g-e),$=i.height;if(i.removeInner(e,j),this.height-=$-i.height,g==j&&(this.children.splice(l--,1),i.parent=null),(t-=j)==0)break;e=0}else e-=g}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Mo))){var q=[];this.collapse(q),this.children=[new Mo(q)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,l){this.size+=t.length,this.height+=l;for(var i=0;i<this.children.length;++i){var g=this.children[i],j=g.chunkSize();if(e<=j){if(g.insertInner(e,t,l),g.lines&&g.lines.length>50){for(var $=g.lines.length%25+25,q=$;q<g.lines.length;){var ee=new Mo(g.lines.slice(q,q+=25));g.height-=ee.height,this.children.splice(++i,0,ee),ee.parent=this}g.lines=g.lines.slice(0,$),this.maybeSpill()}break}e-=j}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),l=new ko(t);if(e.parent){e.size-=l.size,e.height-=l.height;var g=oe(e.parent.children,e);e.parent.children.splice(g+1,0,l)}else{var i=new ko(e.children);i.parent=e,e.children=[i,l],e=i}l.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,l){for(var i=0;i<this.children.length;++i){var g=this.children[i],j=g.chunkSize();if(e<j){var $=Math.min(t,j-e);if(g.iterN(e,$,l))return!0;if((t-=$)==0)break;e=0}else e-=j}}};var Io=function(e,t,l){if(l)for(var i in l)l.hasOwnProperty(i)&&(this[i]=l[i]);this.doc=e,this.node=t};Io.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,l=this.line,i=fi(l);if(i==null||!t)return;for(var g=0;g<t.length;++g)t[g]==this&&t.splice(g--,1);t.length||(l.widgets=null);var j=$i(this);hi(l,Math.max(0,l.height-j)),e&&(Kr(e,function(){Us(e,l,-j),rr(e,i,"widget")}),Rt(e,"lineWidgetCleared",e,this,i))},Io.prototype.changed=function(){var e=this,t=this.height,l=this.doc.cm,i=this.line;this.height=null;var g=$i(this)-t;if(!g)return;Gt(this.doc,i)||hi(i,i.height+g),l&&Kr(l,function(){l.curOp.forceUpdate=!0,Us(l,i,g),Rt(l,"lineWidgetChanged",l,e,fi(i))})},Ee(Io);function Us(e,t,l){Dn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Va(e,l)}function El(e,t,l,i){var g=new Io(e,l,i),j=e.cm;return j&&g.noHScroll&&(j.display.alignWidgets=!0),Lo(e,t,"widget",function($){var q=$.widgets||($.widgets=[]);if(g.insertAt==null?q.push(g):q.splice(Math.min(q.length-1,Math.max(0,g.insertAt)),0,g),g.line=$,j&&!Gt(e,$)){var ee=Dn($)<e.scrollTop;hi($,$.height+$i(g)),ee&&Va(j,g.height),j.curOp.forceUpdate=!0}return!0}),j&&Rt(j,"lineWidgetAdded",j,g,typeof t=="number"?t:fi(t)),g}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&&ua(e),ge(this,"clear")){var l=this.find();l&&Rt(this,"clear",l.from,l.to)}for(var i=null,g=null,j=0;j<this.lines.length;++j){var $=this.lines[j],q=Bn($.markedSpans,this);e&&!this.collapsed?rr(e,fi($),"text"):e&&(q.to!=null&&(g=fi($)),q.from!=null&&(i=fi($))),$.markedSpans=gn($.markedSpans,q),q.from==null&&this.collapsed&&!Gt(this.doc,$)&&e&&hi($,Hi(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var ee=0;ee<this.lines.length;++ee){var se=it(this.lines[ee]),Pe=Kn(se);Pe>e.display.maxLineLength&&(e.display.maxLine=se,e.display.maxLineLength=Pe,e.display.maxLineChanged=!0)}i!=null&&e&&this.collapsed&&Zi(e,i,g+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Os(e.doc)),e&&Rt(e,"markerCleared",e,this,i,g),t&&Ea(e),this.parent&&this.parent.clear()},qa.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var l,i,g=0;g<this.lines.length;++g){var j=this.lines[g],$=Bn(j.markedSpans,this);if($.from!=null&&(l=cn(t?j:fi(j),$.from),e==-1))return l;if($.to!=null&&(i=cn(t?j:fi(j),$.to),e==1))return i}return l&&{from:l,to:i}},qa.prototype.changed=function(){var e=this,t=this.find(-1,!0),l=this,i=this.doc.cm;if(!t||!i)return;Kr(i,function(){var g=t.line,j=fi(t.line),$=$e(i,j);if($&&(di($),i.curOp.selectionChanged=i.curOp.forceUpdate=!0),i.curOp.updateMaxLine=!0,!Gt(l.doc,g)&&l.height!=null){var q=l.height;l.height=null;var ee=$i(l)-q;ee&&hi(g,g.height+ee)}Rt(i,"markerChanged",i,e)})},qa.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||oe(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},qa.prototype.detachLine=function(e){if(this.lines.splice(oe(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Ee(qa);function Eo(e,t,l,i,g){if(i&&i.shared)return xl(e,t,l,i,g);if(e.cm&&!e.cm.curOp)return br(e.cm,Eo)(e,t,l,i,g);var j=new qa(e,g),$=ri(t,l);if(i&&T(i,j,!1),$>0||$==0&&j.clearWhenEmpty!==!1)return j;if(j.replacedWith&&(j.collapsed=!0,j.widgetNode=v("span",[j.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||j.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(j.widgetNode.insertLeft=!0)),j.collapsed){if(ht(e,t.line,t,l,j)||t.line!=l.line&&ht(e,l.line,t,l,j))throw new Error("Inserting collapsed marker partially overlapping an existing one");ir()}j.addToHistory&&bs(e,{from:t,to:l,origin:"markText"},e.sel,NaN);var q=t.line,ee=e.cm,se;if(e.iter(q,l.line+1,function(Fe){ee&&j.collapsed&&!ee.options.lineWrapping&&it(Fe)==ee.display.maxLine&&(se=!0),j.collapsed&&q!=t.line&&hi(Fe,0),Tn(Fe,new Fi(j,q==t.line?t.ch:null,q==l.line?l.ch:null)),++q}),j.collapsed&&e.iter(t.line,l.line+1,function(Fe){Gt(e,Fe)&&hi(Fe,0)}),j.clearOnEnter&&Ue(j,"beforeCursorEnter",function(){return j.clear()}),j.readOnly&&(wi(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),j.collapsed&&(j.id=++js,j.atomic=!0),ee){if(se&&(ee.curOp.updateMaxLine=!0),j.collapsed)Zi(ee,t.line,l.line+1);else if(j.className||j.startStyle||j.endStyle||j.css||j.attributes||j.title)for(var Pe=t.line;Pe<=l.line;Pe++)rr(ee,Pe,"text");j.atomic&&Os(ee.doc),Rt(ee,"markerAdded",ee,j)}return j}var No=function(e,t){this.markers=e,this.primary=t;for(var l=0;l<e.length;++l)e[l].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();Rt(this,"clear")},No.prototype.find=function(e,t){return this.primary.find(e,t)},Ee(No);function xl(e,t,l,i,g){i=T(i),i.shared=!1;var j=[Eo(e,t,l,i,g)],$=j[0],q=i.widgetNode;return Ar(e,function(ee){q&&(i.widgetNode=q.cloneNode(!0)),j.push(Eo(ee,S(ee,t),S(ee,l),i,g));for(var se=0;se<ee.linked.length;++se)if(ee.linked[se].isParent)return;$=nt(j)}),new No(j,$)}function Fs(e){return e.findMarks(cn(e.first,0),e.clipPos(cn(e.lastLine())),function(t){return t.parent})}function Cl(e,t){for(var l=0;l<t.length;l++){var i=t[l],g=i.find(),j=e.clipPos(g.from),$=e.clipPos(g.to);if(ri(j,$)){var q=Eo(e,j,$,i.primary,i.primary.type);i.markers.push(q),q.parent=i}}}function Tl(e){for(var t=function(i){var g=e[i],j=[g.primary.doc];Ar(g.primary.doc,function(ee){return j.push(ee)});for(var $=0;$<g.markers.length;$++){var q=g.markers[$];oe(j,q.doc)==-1&&(q.parent=null,g.markers.splice($--,1))}},l=0;l<e.length;l++)t(l)}var wl=0,ta=function(e,t,l,i,g){if(!(this instanceof ta))return new ta(e,t,l,i,g);l==null&&(l=0),ko.call(this,[new Mo([new Nn("",null)])]),this.first=l,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=l;var j=cn(l,0);this.sel=Xn(j),this.history=new zo(null),this.id=++wl,this.modeOption=t,this.lineSep=i,this.direction=g=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Wa(this,{from:j,to:j,text:e}),Yr(this,Xn(j),xe)};ta.prototype=ze(ko.prototype,{constructor:ta,iter:function(e,t,l){l?this.iterN(e-this.first,t-e,l):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var l=0,i=0;i<t.length;++i)l+=t[i].height;this.insertInner(e-this.first,t,l)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Wi(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Er(function(e){var t=cn(this.first,0),l=this.first+this.size-1;yo(this,{from:t,to:cn(l,Cn(this,l).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Ra(this.cm,0,0),Yr(this,Xn(t),xe)}),replaceRange:function(e,t,l,i){t=S(this,t),l=l?S(this,l):t,bo(this,e,t,l,i)},getRange:function(e,t,l){var i=Ti(this,S(this,e),S(this,t));return l===!1?i:i.join(l||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(er(this,e))return Cn(this,e)},getLineNumber:function(e){return fi(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Cn(this,e)),it(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return S(this,e)},getCursor:function(e){var t=this.sel.primary(),l;return e==null||e=="head"?l=t.head:e=="anchor"?l=t.anchor:e=="end"||e=="to"||e===!1?l=t.to():l=t.from(),l},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Er(function(e,t,l){Ts(this,S(this,typeof e=="number"?cn(e,t||0):e),null,l)}),setSelection:Er(function(e,t,l){Ts(this,S(this,e),S(this,t||e),l)}),extendSelection:Er(function(e,t,l){Vo(this,S(this,e),t&&S(this,t),l)}),extendSelections:Er(function(e,t){Cs(this,W(this,e),t)}),extendSelectionsBy:Er(function(e,t){var l=Kt(this.sel.ranges,e);Cs(this,W(this,l),t)}),setSelections:Er(function(e,t,l){if(!e.length)return;for(var i=[],g=0;g<e.length;g++)i[g]=new Gi(S(this,e[g].anchor),S(this,e[g].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Yr(this,Si(this.cm,i,t),l)}),addSelection:Er(function(e,t,l){var i=this.sel.ranges.slice(0);i.push(new Gi(S(this,e),S(this,t||e))),Yr(this,Si(this.cm,i,i.length-1),l)}),getSelection:function(e){for(var t=this.sel.ranges,l,i=0;i<t.length;i++){var g=Ti(this,t[i].from(),t[i].to());l=l?l.concat(g):g}return e===!1?l:l.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],l=this.sel.ranges,i=0;i<l.length;i++){var g=Ti(this,l[i].from(),l[i].to());e!==!1&&(g=g.join(e||this.lineSeparator())),t[i]=g}return t},replaceSelection:function(e,t,l){for(var i=[],g=0;g<this.sel.ranges.length;g++)i[g]=e;this.replaceSelections(i,t,l||"+input")},replaceSelections:Er(function(e,t,l){for(var i=[],g=this.sel,j=0;j<g.ranges.length;j++){var $=g.ranges[j];i[j]={from:$.from(),to:$.to(),text:this.splitLines(e[j]),origin:l}}for(var q=t&&t!="end"&&aa(this,i,t),ee=i.length-1;ee>=0;ee--)yo(this,i[ee]);q?ws(this,q):this.cm&&_a(this.cm)}),undo:Er(function(){$o(this,"undo")}),redo:Er(function(){$o(this,"redo")}),undoSelection:Er(function(){$o(this,"undo",!0)}),redoSelection:Er(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,l=0,i=0;i<e.done.length;i++)e.done[i].ranges||++t;for(var g=0;g<e.undone.length;g++)e.undone[g].ranges||++l;return{undo:t,redo:l}},clearHistory:function(){var e=this;this.history=new zo(this.history.maxGeneration),Ar(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:Er(function(e,t,l){return Lo(this,e,"gutter",function(i){var g=i.gutterMarkers||(i.gutterMarkers={});return g[t]=l,!l&&Ze(g)&&(i.gutterMarkers=null),!0})}),clearGutter:Er(function(e){var t=this;this.iter(function(l){l.gutterMarkers&&l.gutterMarkers[e]&&Lo(t,l,"gutter",function(){return l.gutterMarkers[e]=null,Ze(l.gutterMarkers)&&(l.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!er(this,e))return null;if(t=e,e=Cn(this,e),!e)return null}else if(t=fi(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:Er(function(e,t,l){return Lo(this,e,t=="gutter"?"gutter":"class",function(i){var g=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!i[g])i[g]=l;else{if(C(l).test(i[g]))return!1;i[g]+=" "+l}return!0})}),removeLineClass:Er(function(e,t,l){return Lo(this,e,t=="gutter"?"gutter":"class",function(i){var g=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",j=i[g];if(j)if(l==null)i[g]=null;else{var $=j.match(C(l));if(!$)return!1;var q=$.index+$[0].length;i[g]=j.slice(0,$.index)+(!$.index||q==j.length?"":" ")+j.slice(q)||null}else return!1;return!0})}),addLineWidget:Er(function(e,t,l){return El(this,e,t,l)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,l){return Eo(this,S(this,e),S(this,t),l,l&&l.type||"range")},setBookmark:function(e,t){var l={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=S(this,e),Eo(this,e,e,l,"bookmark")},findMarksAt:function(e){e=S(this,e);var t=[],l=Cn(this,e.line).markedSpans;if(l)for(var i=0;i<l.length;++i){var g=l[i];(g.from==null||g.from<=e.ch)&&(g.to==null||g.to>=e.ch)&&t.push(g.marker.parent||g.marker)}return t},findMarks:function(e,t,l){e=S(this,e),t=S(this,t);var i=[],g=e.line;return this.iter(e.line,t.line+1,function(j){var $=j.markedSpans;if($)for(var q=0;q<$.length;q++){var ee=$[q];!(ee.to!=null&&g==e.line&&e.ch>=ee.to||ee.from==null&&g!=e.line||ee.from!=null&&g==t.line&&ee.from>=t.ch)&&(!l||l(ee.marker))&&i.push(ee.marker.parent||ee.marker)}++g}),i},getAllMarks:function(){var e=[];return this.iter(function(t){var l=t.markedSpans;if(l)for(var i=0;i<l.length;++i)l[i].from!=null&&e.push(l[i].marker)}),e},posFromIndex:function(e){var t,l=this.first,i=this.lineSeparator().length;return this.iter(function(g){var j=g.text.length+i;if(j>e)return t=e,!0;e-=j,++l}),S(this,cn(l,t))},indexFromPos:function(e){e=S(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var l=this.lineSeparator().length;return this.iter(this.first,e.line,function(i){t+=i.text.length+l}),t},copy:function(e){var t=new ta(Wi(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,l=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<l&&(l=e.to);var i=new ta(Wi(this,t,l),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 xr&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var l=this.linked[t];if(l.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Tl(Fs(this));break}if(e.history==this.history){var i=[e.id];Ar(e,function(g){return i.push(g.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){Ar(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):gt(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:Er(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)})}),ta.prototype.eachLine=ta.prototype.iter;var Bs=0;function Sl(e){var t=this;if(Hs(t),vt(t,e)||gr(t.display,e))return;ae(e),H&&(Bs=+new Date);var l=Rr(t,e,!0),i=e.dataTransfer.files;if(!l||t.isReadOnly())return;if(i&&i.length&&window.FileReader&&window.File)for(var g=i.length,j=Array(g),$=0,q=function(){++$==g&&br(t,function(){l=S(t.doc,l);var ut={from:l,to:l,text:t.doc.splitLines(j.filter(function(en){return en!=null}).join(t.doc.lineSeparator())),origin:"paste"};yo(t.doc,ut),ws(t.doc,Xn(S(t.doc,l),S(t.doc,ui(ut))))})()},ee=function(ut,en){if(t.options.allowDropFileTypes&&oe(t.options.allowDropFileTypes,ut.type)==-1){q();return}var xn=new FileReader;xn.onerror=function(){return q()},xn.onload=function(){var Wn=xn.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Wn)){q();return}j[en]=Wn,q()},xn.readAsText(ut)},se=0;se<i.length;se++)ee(i[se],se);else{if(t.state.draggingText&&t.doc.sel.contains(l)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var Pe=e.dataTransfer.getData("Text");if(Pe){var Fe;if(t.state.draggingText&&!t.state.draggingText.copy&&(Fe=t.listSelections()),Yo(t.doc,Xn(l,l)),Fe)for(var _t=0;_t<Fe.length;++_t)bo(t.doc,"",Fe[_t].anchor,Fe[_t].head,"drag");t.replaceSelection(Pe,"around","paste"),t.display.input.focus()}}catch(ut){}}}function Ol(e,t){if(H&&(!e.state.draggingText||+new Date-Bs<100)){ve(t);return}if(vt(e,t)||gr(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!f){var l=c("img",null,null,"position: fixed; left: 0; top: 0;");l.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",m&&(l.width=l.height=1,e.display.wrapper.appendChild(l),l._top=l.offsetTop),t.dataTransfer.setDragImage(l,0,0),m&&l.parentNode.removeChild(l)}}function Rl(e,t){var l=Rr(e,t);if(!l)return;var i=document.createDocumentFragment();qr(e,l,i),e.display.dragCursor||(e.display.dragCursor=c("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),h(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"),l=[],i=0;i<t.length;i++){var g=t[i].CodeMirror;g&&l.push(g)}l.length&&l[0].operation(function(){for(var j=0;j<l.length;j++)e(l[j])})}var Ks=!1;function Al(){if(Ks)return;Dl(),Ks=!0}function Dl(){var e;Ue(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ws(Pl)},100))}),Ue(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=a?Ka.macDefault:Ka.pcDefault;function Ll(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var l,i,g,j,$=0;$<t.length-1;$++){var q=t[$];if(/^(cmd|meta|m)$/i.test(q))j=!0;else if(/^a(lt)?$/i.test(q))l=!0;else if(/^(c|ctrl|control)$/i.test(q))i=!0;else if(/^s(hift)?$/i.test(q))g=!0;else throw new Error("Unrecognized modifier name: "+q)}return l&&(e="Alt-"+e),i&&(e="Ctrl-"+e),j&&(e="Cmd-"+e),g&&(e="Shift-"+e),e}function Ml(e){var t={};for(var l in e)if(e.hasOwnProperty(l)){var i=e[l];if(/^(name|fallthrough|(de|at)tach)$/.test(l))continue;if(i=="..."){delete e[l];continue}for(var g=Kt(l.split(" "),Ll),j=0;j<g.length;j++){var $=void 0,q=void 0;j==g.length-1?(q=g.join(" "),$=i):(q=g.slice(0,j+1).join(" "),$="...");var ee=t[q];if(!ee)t[q]=$;else if(ee!=$)throw new Error("Inconsistent bindings for "+q)}delete e[l]}for(var se in t)e[se]=t[se];return e}function xo(e,t,l,i){t=Jo(t);var g=t.call?t.call(e,i):t[e];if(g===!1)return"nothing";if(g==="...")return"multi";if(g!=null&&l(g))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return xo(e,t.fallthrough,l,i);for(var j=0;j<t.fallthrough.length;j++){var $=xo(e,t.fallthrough[j],l,i);if($)return $}}}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,l){var i=e;return t.altKey&&i!="Alt"&&(e="Alt-"+e),(x?t.metaKey:t.ctrlKey)&&i!="Ctrl"&&(e="Ctrl-"+e),(x?t.ctrlKey:t.metaKey)&&i!="Mod"&&(e="Cmd-"+e),!l&&t.shiftKey&&i!="Shift"&&(e="Shift-"+e),e}function Vs(e,t){if(m&&e.keyCode==34&&e.char)return!1;var l=eo[e.keyCode];return l==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(l=e.code),Gs(l,e,t))}function Jo(e){return typeof e=="string"?Ka[e]:e}function Co(e,t){for(var l=e.doc.sel.ranges,i=[],g=0;g<l.length;g++){for(var j=t(l[g]);i.length&&ri(j.from,nt(i).to)<=0;){var $=i.pop();if(ri($.from,j.from)<0){j.from=$.from;break}}i.push(j)}Kr(e,function(){for(var q=i.length-1;q>=0;q--)bo(e.doc,"",i[q].from,i[q].to,"+delete");_a(e)})}function os(e,t,l){var i=Mt(e.text,t+l,l);return i<0||i>e.text.length?null:i}function ss(e,t,l){var i=os(e,t.ch,l);return i==null?null:new cn(t.line,i,l<0?"after":"before")}function ls(e,t,l,i,g){if(e){t.doc.direction=="rtl"&&(g=-g);var j=In(l,t.doc.direction);if(j){var $=g<0?nt(j):j[0],q=g<0==($.level==1),ee=q?"after":"before",se;if($.level>0||t.doc.direction=="rtl"){var Pe=Le(t,l);se=g<0?l.text.length-1:0;var Fe=at(t,Pe,se).top;se=An(function(_t){return at(t,Pe,_t).top==Fe},g<0==($.level==1)?$.from:$.to-1,se),ee=="before"&&(se=os(l,se,1))}else se=g<0?$.to:$.from;return new cn(i,se,ee)}}return new cn(i,g<0?l.text.length:0,g<0?"before":"after")}function kl(e,t,l,i){var g=In(t,e.doc.direction);if(!g)return ss(t,l,i);l.ch>=t.text.length?(l.ch=t.text.length,l.sticky="before"):l.ch<=0&&(l.ch=0,l.sticky="after");var j=tt(g,l.ch,l.sticky),$=g[j];if(e.doc.direction=="ltr"&&$.level%2==0&&(i>0?$.to>l.ch:$.from<l.ch))return ss(t,l,i);var q=function(Vn,Zn){return os(t,Vn instanceof cn?Vn.ch:Vn,Zn)},ee,se=function(Vn){return e.options.lineWrapping?(ee=ee||Le(e,t),ni(e,t,ee,Vn)):{begin:0,end:t.text.length}},Pe=se(l.sticky=="before"?q(l,-1):l.ch);if(e.doc.direction=="rtl"||$.level==1){var Fe=$.level==1==i<0,_t=q(l,Fe?1:-1);if(_t!=null&&(Fe?_t<=$.to&&_t<=Pe.end:_t>=$.from&&_t>=Pe.begin)){var ut=Fe?"before":"after";return new cn(l.line,_t,ut)}}var en=function(Vn,Zn,Yn){for(var ii=function(fr,Hr){return Hr?new cn(l.line,q(fr,1),"before"):new cn(l.line,fr,"after")};Vn>=0&&Vn<g.length;Vn+=Zn){var Ci=g[Vn],_i=Zn>0==(Ci.level!=1),Ui=_i?Yn.begin:q(Yn.end,-1);if(Ci.from<=Ui&&Ui<Ci.to)return ii(Ui,_i);if(Ui=_i?Ci.from:q(Ci.to,-1),Yn.begin<=Ui&&Ui<Yn.end)return ii(Ui,_i)}},xn=en(j+i,i,Pe);if(xn)return xn;var Wn=i>0?Pe.end:q(Pe.begin,-1);return Wn!=null&&!(i>0&&Wn==t.text.length)&&(xn=en(i>0?0:g.length-1,i,se(Wn)),xn)?xn:null}var Fo={selectAll:Ds,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),xe)},killLine:function(e){return Co(e,function(t){if(t.empty()){var l=Cn(e.doc,t.head.line).text.length;return t.head.ch==l&&t.head.line<e.lastLine()?{from:t.head,to:cn(t.head.line+1,0)}:{from:t.head,to:cn(t.head.line,l)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Co(e,function(t){return{from:cn(t.from().line,0),to:S(e.doc,cn(t.to().line+1,0))}})},delLineLeft:function(e){return Co(e,function(t){return{from:cn(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Co(e,function(t){var l=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:l},"div");return{from:i,to:t.from()}})},delWrappedLineRight:function(e){return Co(e,function(t){var l=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:l},"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(cn(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(cn(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 l=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:l},"div")},Je)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var l=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:l},"div")},Je)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var l=e.cursorCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:l},"div");return i.ch<e.getLine(i.line).search(/\S/)?Xs(e,t.head):i},Je)},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=[],l=e.listSelections(),i=e.options.tabSize,g=0;g<l.length;g++){var j=l[g].from(),$=V(e.getLine(j.line),j.ch,i);t.push(de(i-$%i))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Kr(e,function(){for(var t=e.listSelections(),l=[],i=0;i<t.length;i++){if(!t[i].empty())continue;var g=t[i].head,j=Cn(e.doc,g.line).text;if(j){if(g.ch==j.length&&(g=new cn(g.line,g.ch-1)),g.ch>0)g=new cn(g.line,g.ch+1),e.replaceRange(j.charAt(g.ch-1)+j.charAt(g.ch-2),cn(g.line,g.ch-2),g,"+transpose");else if(g.line>e.doc.first){var $=Cn(e.doc,g.line-1).text;$&&(g=new cn(g.line,1),e.replaceRange(j.charAt(0)+e.doc.lineSeparator()+$.charAt($.length-1),cn(g.line-1,$.length-1),g,"+transpose"))}}l.push(new Gi(g,g))}e.setSelections(l)})},newlineAndIndent:function(e){return Kr(e,function(){for(var t=e.listSelections(),l=t.length-1;l>=0;l--)e.replaceRange(e.doc.lineSeparator(),t[l].anchor,t[l].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 l=Cn(e.doc,t),i=it(l);return i!=l&&(t=fi(i)),ls(!0,e,i,t,1)}function Il(e,t){var l=Cn(e.doc,t),i=st(l);return i!=l&&(t=fi(i)),ls(!0,e,l,t,-1)}function Xs(e,t){var l=Ys(e,t.line),i=Cn(e.doc,l.line),g=In(i,e.doc.direction);if(!g||g[0].level==0){var j=Math.max(l.ch,i.text.search(/\S/)),$=t.line==l.line&&t.ch<=j&&t.ch;return cn(l.line,$?0:j,l.sticky)}return l}function Zo(e,t,l){if(typeof t=="string"&&(t=Fo[t],!t))return!1;e.display.input.ensurePolled();var i=e.display.shift,g=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),l&&(e.display.shift=!1),g=t(e)!=Ye}finally{e.display.shift=i,e.state.suppressEdits=!1}return g}function Nl(e,t,l){for(var i=0;i<e.state.keyMaps.length;i++){var g=xo(t,e.state.keyMaps[i],l,e);if(g)return g}return e.options.extraKeys&&xo(t,e.options.extraKeys,l,e)||xo(t,e.options.keyMap,l,e)}var Ul=new Z;function Bo(e,t,l,i){var g=e.state.keySeq;if(g){if(zs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==g&&(e.state.keySeq=null,e.display.input.reset())}),$s(e,g+" "+t,l,i))return!0}return $s(e,t,l,i)}function $s(e,t,l,i){var g=Nl(e,t,i);return g=="multi"&&(e.state.keySeq=t),g=="handled"&&Rt(e,"keyHandled",e,t,l),(g=="handled"||g=="multi")&&(ae(l),wr(e)),!!g}function Qs(e,t){var l=Vs(t,!0);return l?t.shiftKey&&!e.state.keySeq?Bo(e,"Shift-"+l,t,function(i){return Zo(e,i,!0)})||Bo(e,l,t,function(i){if(typeof i=="string"?/^go[A-Z]/.test(i):i.motion)return Zo(e,i)}):Bo(e,l,t,function(i){return Zo(e,i)}):!1}function jl(e,t,l){return Bo(e,"'"+l+"'",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=U(),vt(t,e))return;H&&P<11&&e.keyCode==27&&(e.returnValue=!1);var l=e.keyCode;t.display.shift=l==16||e.shiftKey;var i=Qs(t,e);m&&(us=i?l:null,!i&&l==88&&!rt&&(a?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),N&&!a&&!i&&l==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),l==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fl(t)}function Fl(e){var t=e.display.lineDiv;F(t,"CodeMirror-crosshair");function l(i){(i.keyCode==18||!i.altKey)&&(_(t,"CodeMirror-crosshair"),Ct(document,"keyup",l),Ct(document,"mouseover",l))}Ue(document,"keyup",l),Ue(document,"mouseover",l)}function Zs(e){e.keyCode==16&&(this.doc.sel.shift=!1),vt(this,e)}function qs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(gr(t.display,e)||vt(t,e)||e.ctrlKey&&!e.altKey||a&&e.metaKey)return;var l=e.keyCode,i=e.charCode;if(m&&l==us){us=null,ae(e);return}if(m&&(!e.which||e.which<10)&&Qs(t,e))return;var g=String.fromCharCode(i==null?l:i);if(g=="\b")return;if(jl(t,e,g))return;t.display.input.onKeyPress(e)}var Bl=400,ds=function(e,t,l){this.time=e,this.pos=t,this.button=l};ds.prototype.compare=function(e,t,l){return this.time+Bl>e&&ri(t,this.pos)==0&&l==this.button};var Ho,Wo;function Hl(e,t){var l=+new Date;return Wo&&Wo.compare(l,e,t)?(Ho=Wo=null,"triple"):Ho&&Ho.compare(l,e,t)?(Wo=new ds(l,e,t),Ho=null,"double"):(Ho=new ds(l,e,t),Wo=null,"single")}function el(e){var t=this,l=t.display;if(vt(t,e)||l.activeTouch&&l.input.supportsTouch())return;if(l.input.ensurePolled(),l.shift=e.shiftKey,gr(l,e)){k||(l.scroller.draggable=!1,setTimeout(function(){return l.scroller.draggable=!0},100));return}if(cs(t,e))return;var i=Rr(t,e),g=Be(e),j=i?Hl(i,g):"single";if(window.focus(),g==1&&t.state.selectingText&&t.state.selectingText(e),i&&Wl(t,g,i,j,e))return;g==1?i?zl(t,i,j,e):me(e)==l.scroller&&ae(e):g==2?(i&&Vo(t.doc,i),setTimeout(function(){return l.input.focus()},20)):g==3&&(O?t.display.input.onContextMenu(e):no(t))}function Wl(e,t,l,i,g){var j="Click";return i=="double"?j="Double"+j:i=="triple"&&(j="Triple"+j),j=(t==1?"Left":t==2?"Middle":"Right")+j,Bo(e,Gs(j,g),g,function($){if(typeof $=="string"&&($=Fo[$]),!$)return!1;var q=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),q=$(e,l)!=Ye}finally{e.state.suppressEdits=!1}return q})}function Kl(e,t,l){var i=e.getOption("configureMouse"),g=i?i(e,t,l):{};if(g.unit==null){var j=n?l.shiftKey&&l.metaKey:l.altKey;g.unit=j?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(g.extend==null||e.doc.extend)&&(g.extend=e.doc.extend||l.shiftKey),g.addNew==null&&(g.addNew=a?l.metaKey:l.ctrlKey),g.moveOnDrag==null&&(g.moveOnDrag=!(a?l.altKey:l.ctrlKey)),g}function zl(e,t,l,i){H?setTimeout(B(Ma,e),0):e.curOp.focus=U();var g=Kl(e,l,i),j=e.doc.sel,$;e.options.dragDrop&&Tt&&!e.isReadOnly()&&l=="single"&&($=j.contains(t))>-1&&(ri(($=j.ranges[$]).from(),t)<0||t.xRel>0)&&(ri($.to(),t)>0||t.xRel<0)?Gl(e,i,t,g):Vl(e,i,t,g)}function Gl(e,t,l,i){var g=e.display,j=!1,$=br(e,function(se){k&&(g.scroller.draggable=!1),e.state.draggingText=!1,Ct(g.wrapper.ownerDocument,"mouseup",$),Ct(g.wrapper.ownerDocument,"mousemove",q),Ct(g.scroller,"dragstart",ee),Ct(g.scroller,"drop",$),j||(ae(se),i.addNew||Vo(e.doc,l,null,null,i.extend),k&&!f||H&&P==9?setTimeout(function(){g.wrapper.ownerDocument.body.focus({preventScroll:!0}),g.input.focus()},20):g.input.focus())}),q=function(se){j=j||Math.abs(t.clientX-se.clientX)+Math.abs(t.clientY-se.clientY)>=10},ee=function(){return j=!0};k&&(g.scroller.draggable=!0),e.state.draggingText=$,$.copy=!i.moveOnDrag,g.scroller.dragDrop&&g.scroller.dragDrop(),Ue(g.wrapper.ownerDocument,"mouseup",$),Ue(g.wrapper.ownerDocument,"mousemove",q),Ue(g.scroller,"dragstart",ee),Ue(g.scroller,"drop",$),no(e),setTimeout(function(){return g.input.focus()},20)}function tl(e,t,l){if(l=="char")return new Gi(t,t);if(l=="word")return e.findWordAt(t);if(l=="line")return new Gi(cn(t.line,0),S(e.doc,cn(t.line+1,0)));var i=l(e,t);return new Gi(i.from,i.to)}function Vl(e,t,l,i){var g=e.display,j=e.doc;ae(t);var $,q,ee=j.sel,se=ee.ranges;if(i.addNew&&!i.extend?(q=j.sel.contains(l),q>-1?$=se[q]:$=new Gi(l,l)):($=j.sel.primary(),q=j.sel.primIndex),i.unit=="rectangle")i.addNew||($=new Gi(l,l)),l=Rr(e,t,!0,!0),q=-1;else{var Pe=tl(e,l,i.unit);i.extend?$=rs($,Pe.anchor,Pe.head,i.extend):$=Pe}i.addNew?q==-1?(q=se.length,Yr(j,Si(e,se.concat([$]),q),{scroll:!1,origin:"*mouse"})):se.length>1&&se[q].empty()&&i.unit=="char"&&!i.extend?(Yr(j,Si(e,se.slice(0,q).concat(se.slice(q+1)),0),{scroll:!1,origin:"*mouse"}),ee=j.sel):as(j,q,$,Ie):(q=0,Yr(j,new zr([$],0),Ie),ee=j.sel);var Fe=l;function _t(Yn){if(ri(Fe,Yn)==0)return;if(Fe=Yn,i.unit=="rectangle"){for(var ii=[],Ci=e.options.tabSize,_i=V(Cn(j,l.line).text,l.ch,Ci),Ui=V(Cn(j,Yn.line).text,Yn.ch,Ci),fr=Math.min(_i,Ui),Hr=Math.max(_i,Ui),Tr=Math.min(l.line,Yn.line),oa=Math.min(e.lastLine(),Math.max(l.line,Yn.line));Tr<=oa;Tr++){var na=Cn(j,Tr).text,kr=Ke(na,fr,Ci);fr==Hr?ii.push(new Gi(cn(Tr,kr),cn(Tr,kr))):na.length>kr&&ii.push(new Gi(cn(Tr,kr),cn(Tr,Ke(na,Hr,Ci))))}ii.length||ii.push(new Gi(l,l)),Yr(j,Si(e,ee.ranges.slice(0,q).concat(ii),q),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Yn)}else{var ia=$,Gr=tl(e,Yn,i.unit),Ur=ia.anchor,Ir;ri(Gr.anchor,Ur)>0?(Ir=Gr.head,Ur=nr(ia.from(),Gr.anchor)):(Ir=Gr.anchor,Ur=tr(ia.to(),Gr.head));var Or=ee.ranges.slice(0);Or[q]=Yl(e,new Gi(S(j,Ur),Ir)),Yr(j,Si(e,Or,q),Ie)}}var ut=g.wrapper.getBoundingClientRect(),en=0;function xn(Yn){var ii=++en,Ci=Rr(e,Yn,!0,i.unit=="rectangle");if(!Ci)return;if(ri(Ci,Fe)!=0){e.curOp.focus=U(),_t(Ci);var _i=ka(g,j);(Ci.line>=_i.to||Ci.line<_i.from)&&setTimeout(br(e,function(){en==ii&&xn(Yn)}),150)}else{var Ui=Yn.clientY<ut.top?-20:Yn.clientY>ut.bottom?20:0;Ui&&setTimeout(br(e,function(){if(en!=ii)return;g.scroller.scrollTop+=Ui,xn(Yn)}),50)}}function Wn(Yn){e.state.selectingText=!1,en=Infinity,Yn&&(ae(Yn),g.input.focus()),Ct(g.wrapper.ownerDocument,"mousemove",Vn),Ct(g.wrapper.ownerDocument,"mouseup",Zn),j.history.lastSelOrigin=null}var Vn=br(e,function(Yn){Yn.buttons===0||!Be(Yn)?Wn(Yn):xn(Yn)}),Zn=br(e,Wn);e.state.selectingText=Zn,Ue(g.wrapper.ownerDocument,"mousemove",Vn),Ue(g.wrapper.ownerDocument,"mouseup",Zn)}function Yl(e,t){var l=t.anchor,i=t.head,g=Cn(e.doc,l.line);if(ri(l,i)==0&&l.sticky==i.sticky)return t;var j=In(g);if(!j)return t;var $=tt(j,l.ch,l.sticky),q=j[$];if(q.from!=l.ch&&q.to!=l.ch)return t;var ee=$+(q.from==l.ch==(q.level!=1)?0:1);if(ee==0||ee==j.length)return t;var se;if(i.line!=l.line)se=(i.line-l.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Pe=tt(j,i.ch,i.sticky),Fe=Pe-$||(i.ch-l.ch)*(q.level==1?-1:1);Pe==ee-1||Pe==ee?se=Fe<0:se=Fe>0}var _t=j[ee+(se?-1:0)],ut=se==(_t.level==1),en=ut?_t.from:_t.to,xn=ut?"after":"before";return l.ch==en&&l.sticky==xn?t:new Gi(new cn(l.line,en,xn),i)}function nl(e,t,l,i){var g,j;if(t.touches)g=t.touches[0].clientX,j=t.touches[0].clientY;else try{g=t.clientX,j=t.clientY}catch(_t){return!1}if(g>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&ae(t);var $=e.display,q=$.lineDiv.getBoundingClientRect();if(j>q.bottom||!ge(e,l))return he(t);j-=q.top-$.viewOffset;for(var ee=0;ee<e.display.gutterSpecs.length;++ee){var se=$.gutters.childNodes[ee];if(se&&se.getBoundingClientRect().right>=g){var Pe=ji(e.doc,j),Fe=e.display.gutterSpecs[ee];return Ge(e,l,e,Pe,Fe.className,t),he(t)}}}function cs(e,t){return nl(e,t,"gutterClick",!0)}function il(e,t){if(gr(e.display,t)||Xl(e,t))return;if(vt(e,t,"contextmenu"))return;O||e.display.input.onContextMenu(t)}function Xl(e,t){return ge(e,"gutterContextMenu")?nl(e,t,"gutterContextMenu",!1):!1}function rl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Ei(e)}var To={toString:function(){return"CodeMirror.Init"}},al={},qo={};function $l(e){var t=e.optionHandlers;function l(i,g,j,$){e.defaults[i]=g,j&&(t[i]=$?function(q,ee,se){se!=To&&j(q,ee,se)}:j)}e.defineOption=l,e.Init=To,l("value","",function(i,g){return i.setValue(g)},!0),l("mode",null,function(i,g){i.doc.modeOption=g,Mr(i)},!0),l("indentUnit",2,Mr,!0),l("indentWithTabs",!1),l("smartIndent",!0),l("tabSize",4,function(i){$r(i),Ei(i),Zi(i)},!0),l("lineSeparator",null,function(i,g){if(i.doc.lineSep=g,!g)return;var j=[],$=i.doc.first;i.doc.iter(function(ee){for(var se=0;;){var Pe=ee.text.indexOf(g,se);if(Pe==-1)break;se=Pe+g.length,j.push(cn($,Pe))}$++});for(var q=j.length-1;q>=0;q--)bo(i.doc,g,j[q],cn(j[q].line,j[q].ch+g.length))}),l("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(i,g,j){i.state.specialChars=new RegExp(g.source+(g.test(" ")?"":"| "),"g"),j!=To&&i.refresh()}),l("specialCharPlaceholder",Sn,function(i){return i.refresh()},!0),l("electricChars",!0),l("inputStyle",o?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),l("spellcheck",!1,function(i,g){return i.getInputField().spellcheck=g},!0),l("autocorrect",!1,function(i,g){return i.getInputField().autocorrect=g},!0),l("autocapitalize",!1,function(i,g){return i.getInputField().autocapitalize=g},!0),l("rtlMoveVisually",!R),l("wholeLineUpdateBefore",!0),l("theme","default",function(i){rl(i),da(i)},!0),l("keyMap","default",function(i,g,j){var $=Jo(g),q=j!=To&&Jo(j);q&&q.detach&&q.detach(i,$),$.attach&&$.attach(i,q||null)}),l("extraKeys",null),l("configureMouse",null),l("lineWrapping",!1,Jl,!0),l("gutters",[],function(i,g){i.display.gutterSpecs=Br(g,i.options.lineNumbers),da(i)},!0),l("fixedGutter",!0,function(i,g){i.display.gutters.style.left=g?_r(i.display)+"px":"0",i.refresh()},!0),l("coverGutterNextToScrollbar",!1,function(i){return ma(i)},!0),l("scrollbarStyle","native",function(i){Qa(i),ma(i),i.display.scrollbars.setScrollTop(i.doc.scrollTop),i.display.scrollbars.setScrollLeft(i.doc.scrollLeft)},!0),l("lineNumbers",!1,function(i,g){i.display.gutterSpecs=Br(i.options.gutters,g),da(i)},!0),l("firstLineNumber",1,da,!0),l("lineNumberFormatter",function(i){return i},da,!0),l("showCursorWhenSelecting",!1,qi,!0),l("resetSelectionOnContextMenu",!0),l("lineWiseCopyCut",!0),l("pasteLinesPerSelection",!0),l("selectionsMayTouch",!1),l("readOnly",!1,function(i,g){g=="nocursor"&&(Ta(i),i.display.input.blur()),i.display.input.readOnlyChanged(g)}),l("screenReaderLabel",null,function(i,g){g=g===""?null:g,i.display.input.screenReaderLabelChanged(g)}),l("disableInput",!1,function(i,g){g||i.display.input.reset()},!0),l("dragDrop",!0,Ql),l("allowDropFileTypes",null),l("cursorBlinkRate",530),l("cursorScrollMargin",0),l("cursorHeight",1,qi,!0),l("singleCursorHeightPerLine",!0,qi,!0),l("workTime",100),l("workDelay",100),l("flattenSpans",!0,$r,!0),l("addModeClass",!1,$r,!0),l("pollInterval",100),l("undoDepth",200,function(i,g){return i.doc.history.undoDepth=g}),l("historyEventDelay",1250),l("viewportMargin",10,function(i){return i.refresh()},!0),l("maxHighlightLength",1e4,$r,!0),l("moveInputWithCursor",!0,function(i,g){g||i.display.input.resetPosition()}),l("tabindex",null,function(i,g){return i.display.input.getField().tabIndex=g||""}),l("autofocus",null),l("direction","ltr",function(i,g){return i.doc.setDirection(g)},!0),l("phrases",null)}function Ql(e,t,l){var i=l&&l!=To;if(!t!=!i){var g=e.display.dragFunctions,j=t?Ue:Ct;j(e.display.scroller,"dragstart",g.start),j(e.display.scroller,"dragenter",g.enter),j(e.display.scroller,"dragover",g.over),j(e.display.scroller,"dragleave",g.leave),j(e.display.scroller,"drop",g.drop)}}function Jl(e){e.options.lineWrapping?(F(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(_(e.display.wrapper,"CodeMirror-wrap"),wn(e)),jr(e),Zi(e),Ei(e),setTimeout(function(){return ma(e)},100)}function xr(e,t){var l=this;if(!(this instanceof xr))return new xr(e,t);this.options=t=t?T(t):{},T(al,t,!1);var i=t.value;typeof i=="string"?i=new ta(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var g=new xr.inputStyles[t.inputStyle](this),j=this.display=new ja(e,i,g,t);j.wrapper.CodeMirror=this,rl(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 Z,keySeq:null,specialChars:null},t.autofocus&&!o&&j.input.focus(),H&&P<11&&setTimeout(function(){return l.display.input.reset(!0)},20),Zl(this),Al(),ua(this),this.curOp.forceUpdate=!0,vs(this,i),t.autofocus&&!o||this.hasFocus()?setTimeout(function(){l.hasFocus()&&!l.state.focused&&la(l)},20):Ta(this);for(var $ in qo)qo.hasOwnProperty($)&&qo[$](this,t[$],To);mr(this),t.finishInit&&t.finishInit(this);for(var q=0;q<hs.length;++q)hs[q](this);Ea(this),k&&t.lineWrapping&&getComputedStyle(j.lineDiv).textRendering=="optimizelegibility"&&(j.lineDiv.style.textRendering="auto")}xr.defaults=al,xr.optionHandlers=qo;function Zl(e){var t=e.display;Ue(t.scroller,"mousedown",br(e,el)),H&&P<11?Ue(t.scroller,"dblclick",br(e,function(ee){if(vt(e,ee))return;var se=Rr(e,ee);if(!se||cs(e,ee)||gr(e.display,ee))return;ae(ee);var Pe=e.findWordAt(se);Vo(e.doc,Pe.anchor,Pe.head)})):Ue(t.scroller,"dblclick",function(ee){return vt(e,ee)||ae(ee)}),Ue(t.scroller,"contextmenu",function(ee){return il(e,ee)}),Ue(t.input.getField(),"contextmenu",function(ee){t.scroller.contains(ee.target)||il(e,ee)});var l,i={end:0};function g(){t.activeTouch&&(l=setTimeout(function(){return t.activeTouch=null},1e3),i=t.activeTouch,i.end=+new Date)}function j(ee){if(ee.touches.length!=1)return!1;var se=ee.touches[0];return se.radiusX<=1&&se.radiusY<=1}function $(ee,se){if(se.left==null)return!0;var Pe=se.left-ee.left,Fe=se.top-ee.top;return Pe*Pe+Fe*Fe>20*20}Ue(t.scroller,"touchstart",function(ee){if(!vt(e,ee)&&!j(ee)&&!cs(e,ee)){t.input.ensurePolled(),clearTimeout(l);var se=+new Date;t.activeTouch={start:se,moved:!1,prev:se-i.end<=300?i:null},ee.touches.length==1&&(t.activeTouch.left=ee.touches[0].pageX,t.activeTouch.top=ee.touches[0].pageY)}}),Ue(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ue(t.scroller,"touchend",function(ee){var se=t.activeTouch;if(se&&!gr(t,ee)&&se.left!=null&&!se.moved&&new Date-se.start<300){var Pe=e.coordsChar(t.activeTouch,"page"),Fe;!se.prev||$(se,se.prev)?Fe=new Gi(Pe,Pe):!se.prev.prev||$(se,se.prev.prev)?Fe=e.findWordAt(Pe):Fe=new Gi(cn(Pe.line,0),S(e.doc,cn(Pe.line+1,0))),e.setSelection(Fe.anchor,Fe.head),e.focus(),ae(ee)}g()}),Ue(t.scroller,"touchcancel",g),Ue(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Da(e,t.scroller.scrollTop),Nr(e,t.scroller.scrollLeft,!0),Ge(e,"scroll",e))}),Ue(t.scroller,"mousewheel",function(ee){return Ha(e,ee)}),Ue(t.scroller,"DOMMouseScroll",function(ee){return Ha(e,ee)}),Ue(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(ee){vt(e,ee)||ve(ee)},over:function(ee){vt(e,ee)||(Rl(e,ee),ve(ee))},start:function(ee){return Ol(e,ee)},drop:br(e,Sl),leave:function(ee){vt(e,ee)||Hs(e)}};var q=t.input.getField();Ue(q,"keyup",function(ee){return Zs.call(e,ee)}),Ue(q,"keydown",br(e,Js)),Ue(q,"keypress",br(e,qs)),Ue(q,"focus",function(ee){return la(e,ee)}),Ue(q,"blur",function(ee){return Ta(e,ee)})}var hs=[];xr.defineInitHook=function(e){return hs.push(e)};function Ko(e,t,l,i){var g=e.doc,j;l==null&&(l="add"),l=="smart"&&(g.mode.indent?j=kn(e,t).state:l="prev");var $=e.options.tabSize,q=Cn(g,t),ee=V(q.text,null,$);q.stateAfter&&(q.stateAfter=null);var se=q.text.match(/^\s*/)[0],Pe;if(!i&&!/\S/.test(q.text))Pe=0,l="not";else if(l=="smart"&&(Pe=g.mode.indent(j,q.text.slice(se.length),q.text),Pe==Ye||Pe>150)){if(!i)return;l="prev"}l=="prev"?t>g.first?Pe=V(Cn(g,t-1).text,null,$):Pe=0:l=="add"?Pe=ee+e.options.indentUnit:l=="subtract"?Pe=ee-e.options.indentUnit:typeof l=="number"&&(Pe=ee+l),Pe=Math.max(0,Pe);var Fe="",_t=0;if(e.options.indentWithTabs)for(var ut=Math.floor(Pe/$);ut;--ut)_t+=$,Fe+=" ";if(_t<Pe&&(Fe+=de(Pe-_t)),Fe!=se)return bo(g,Fe,cn(t,0),cn(t,se.length),"+input"),q.stateAfter=null,!0;for(var en=0;en<g.sel.ranges.length;en++){var xn=g.sel.ranges[en];if(xn.head.line==t&&xn.head.ch<se.length){var Wn=cn(t,se.length);as(g,en,new Gi(Wn,Wn));break}}}var Ca=null;function es(e){Ca=e}function fs(e,t,l,i,g){var j=e.doc;e.display.shift=!1,i||(i=j.sel);var $=+new Date-200,q=g=="paste"||e.state.pasteIncoming>$,ee=gt(t),se=null;if(q&&i.ranges.length>1)if(Ca&&Ca.text.join(`
|
|
`)==t){if(i.ranges.length%Ca.text.length==0){se=[];for(var Pe=0;Pe<Ca.text.length;Pe++)se.push(j.splitLines(Ca.text[Pe]))}}else ee.length==i.ranges.length&&e.options.pasteLinesPerSelection&&(se=Kt(ee,function(Vn){return[Vn]}));for(var Fe=e.curOp.updateInput,_t=i.ranges.length-1;_t>=0;_t--){var ut=i.ranges[_t],en=ut.from(),xn=ut.to();ut.empty()&&(l&&l>0?en=cn(en.line,en.ch-l):e.state.overwrite&&!q?xn=cn(xn.line,Math.min(Cn(j,xn.line).text.length,xn.ch+nt(ee).length)):q&&Ca&&Ca.lineWise&&Ca.text.join(`
|
|
`)==ee.join(`
|
|
`)&&(en=xn=cn(en.line,0)));var Wn={from:en,to:xn,text:se?se[_t%se.length]:ee,origin:g||(q?"paste":e.state.cutIncoming>$?"cut":"+input")};yo(e.doc,Wn),Rt(e,"inputRead",e,Wn)}t&&!q&&sl(e,t),_a(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Fe),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ol(e,t){var l=e.clipboardData&&e.clipboardData.getData("Text");if(l)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Kr(t,function(){return fs(t,l,0,null,"paste")}),!0}function sl(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var l=e.doc.sel,i=l.ranges.length-1;i>=0;i--){var g=l.ranges[i];if(g.head.ch>100||i&&l.ranges[i-1].head.line==g.head.line)continue;var j=e.getModeAt(g.head),$=!1;if(j.electricChars){for(var q=0;q<j.electricChars.length;q++)if(t.indexOf(j.electricChars.charAt(q))>-1){$=Ko(e,g.head.line,"smart");break}}else j.electricInput&&(j.electricInput.test(Cn(e.doc,g.head.line).text.slice(0,g.head.ch))&&($=Ko(e,g.head.line,"smart")));$&&Rt(e,"electricInput",e,g.head.line)}}function ll(e){for(var t=[],l=[],i=0;i<e.doc.sel.ranges.length;i++){var g=e.doc.sel.ranges[i].head.line,j={anchor:cn(g,0),head:cn(g+1,0)};l.push(j),t.push(e.getRange(j.anchor,j.head))}return{text:t,ranges:l}}function ul(e,t,l,i){e.setAttribute("autocorrect",l?"":"off"),e.setAttribute("autocapitalize",i?"":"off"),e.setAttribute("spellcheck",!!t)}function dl(){var e=c("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=c("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return k?e.style.width="1000px":e.setAttribute("wrap","off"),r&&(e.style.border="1px solid black"),ul(e),t}function ql(e){var t=e.optionHandlers,l=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(i,g){var j=this.options,$=j[i];if(j[i]==g&&i!="mode")return;j[i]=g,t.hasOwnProperty(i)&&br(this,t[i])(this,g,$),Ge(this,"optionChange",this,i)},getOption:function(i){return this.options[i]},getDoc:function(){return this.doc},addKeyMap:function(i,g){this.state.keyMaps[g?"push":"unshift"](Jo(i))},removeKeyMap:function(i){for(var g=this.state.keyMaps,j=0;j<g.length;++j)if(g[j]==i||g[j].name==i)return g.splice(j,1),!0},addOverlay:Lr(function(i,g){var j=i.token?i:e.getMode(this.options,i);if(j.startState)throw new Error("Overlays may not be stateful.");jt(this.state.overlays,{mode:j,modeSpec:i,opaque:g&&g.opaque,priority:g&&g.priority||0},function($){return $.priority}),this.state.modeGen++,Zi(this)}),removeOverlay:Lr(function(i){for(var g=this.state.overlays,j=0;j<g.length;++j){var $=g[j].modeSpec;if($==i||typeof i=="string"&&$.name==i){g.splice(j,1),this.state.modeGen++,Zi(this);return}}}),indentLine:Lr(function(i,g,j){typeof g!="string"&&typeof g!="number"&&(g==null?g=this.options.smartIndent?"smart":"prev":g=g?"add":"subtract"),er(this.doc,i)&&Ko(this,i,g,j)}),indentSelection:Lr(function(i){for(var g=this.doc.sel.ranges,j=-1,$=0;$<g.length;$++){var q=g[$];if(q.empty())q.head.line>j&&(Ko(this,q.head.line,i,!0),j=q.head.line,$==this.doc.sel.primIndex&&_a(this));else{var ee=q.from(),se=q.to(),Pe=Math.max(j,ee.line);j=Math.min(this.lastLine(),se.line-(se.ch?0:1))+1;for(var Fe=Pe;Fe<j;++Fe)Ko(this,Fe,i);var _t=this.doc.sel.ranges;ee.ch==0&&g.length==_t.length&&_t[$].from().ch>0&&as(this.doc,$,new Gi(ee,_t[$].to()),xe)}}}),getTokenAt:function(i,g){return Li(this,i,g)},getLineTokens:function(i,g){return Li(this,cn(i),g,!0)},getTokenTypeAt:function(i){i=S(this.doc,i);var g=Vt(this,Cn(this.doc,i.line)),j=0,$=(g.length-1)/2,q=i.ch,ee;if(q==0)ee=g[2];else for(;;){var se=j+$>>1;if((se?g[se*2-1]:0)>=q)$=se;else if(g[se*2+1]<q)j=se+1;else{ee=g[se*2+2];break}}var Pe=ee?ee.indexOf("overlay "):-1;return Pe<0?ee:Pe==0?null:ee.slice(0,Pe-1)},getModeAt:function(i){var g=this.doc.mode;return g.innerMode?e.innerMode(g,this.getTokenAt(i).state).mode:g},getHelper:function(i,g){return this.getHelpers(i,g)[0]},getHelpers:function(i,g){var j=[];if(!l.hasOwnProperty(g))return j;var $=l[g],q=this.getModeAt(i);if(typeof q[g]=="string")$[q[g]]&&j.push($[q[g]]);else if(q[g])for(var ee=0;ee<q[g].length;ee++){var se=$[q[g][ee]];se&&j.push(se)}else q.helperType&&$[q.helperType]?j.push($[q.helperType]):$[q.name]&&j.push($[q.name]);for(var Pe=0;Pe<$._global.length;Pe++){var Fe=$._global[Pe];Fe.pred(q,this)&&oe(j,Fe.val)==-1&&j.push(Fe.val)}return j},getStateAfter:function(i,g){var j=this.doc;return i=X(j,i==null?j.first+j.size-1:i),kn(this,i+1,g).state},cursorCoords:function(i,g){var j,$=this.doc.sel.primary();return i==null?j=$.head:typeof i=="object"?j=S(this.doc,i):j=i?$.from():$.to(),yn(this,j,g||"page")},charCoords:function(i,g){return Zt(this,S(this.doc,i),g||"page")},coordsChar:function(i,g){return i=dn(this,i,g||"page"),pi(this,i.left,i.top)},lineAtHeight:function(i,g){return i=dn(this,{top:i,left:0},g||"page").top,ji(this.doc,i+this.display.viewOffset)},heightAtLine:function(i,g,j){var $=!1,q;if(typeof i=="number"){var ee=this.doc.first+this.doc.size-1;i<this.doc.first?i=this.doc.first:i>ee&&(i=ee,$=!0),q=Cn(this.doc,i)}else q=i;return Di(this,q,{top:0,left:0},g||"page",j||$).top+($?this.doc.height-Dn(q):0)},defaultTextHeight:function(){return Hi(this.display)},defaultCharWidth:function(){return Bi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(i,g,j,$,q){var ee=this.display;i=yn(this,S(this.doc,i));var se=i.bottom,Pe=i.left;if(g.style.position="absolute",g.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(g),ee.sizer.appendChild(g),$=="over")se=i.top;else if($=="above"||$=="near"){var Fe=Math.max(ee.wrapper.clientHeight,this.doc.height),_t=Math.max(ee.sizer.clientWidth,ee.lineSpace.clientWidth);($=="above"||i.bottom+g.offsetHeight>Fe)&&i.top>g.offsetHeight?se=i.top-g.offsetHeight:i.bottom+g.offsetHeight<=Fe&&(se=i.bottom),Pe+g.offsetWidth>_t&&(Pe=_t-g.offsetWidth)}g.style.top=se+"px",g.style.left=g.style.right="",q=="right"?(Pe=ee.sizer.clientWidth-g.offsetWidth,g.style.right="0px"):(q=="left"?Pe=0:q=="middle"&&(Pe=(ee.sizer.clientWidth-g.offsetWidth)/2),g.style.left=Pe+"px"),j&&Ga(this,{left:Pe,top:se,right:Pe+g.offsetWidth,bottom:se+g.offsetHeight})},triggerOnKeyDown:Lr(Js),triggerOnKeyPress:Lr(qs),triggerOnKeyUp:Zs,triggerOnMouseDown:Lr(el),execCommand:function(i){if(Fo.hasOwnProperty(i))return Fo[i].call(null,this)},triggerElectric:Lr(function(i){sl(this,i)}),findPosH:function(i,g,j,$){var q=1;g<0&&(q=-1,g=-g);for(var ee=S(this.doc,i),se=0;se<g&&!(ee=ps(this.doc,ee,q,j,$),ee.hitSide);++se);return ee},moveH:Lr(function(i,g){var j=this;this.extendSelectionsBy(function($){return j.display.shift||j.doc.extend||$.empty()?ps(j.doc,$.head,i,g,j.options.rtlMoveVisually):i<0?$.from():$.to()},Je)}),deleteH:Lr(function(i,g){var j=this.doc.sel,$=this.doc;j.somethingSelected()?$.replaceSelection("",null,"+delete"):Co(this,function(q){var ee=ps($,q.head,i,g,!1);return i<0?{from:ee,to:q.head}:{from:q.head,to:ee}})}),findPosV:function(i,g,j,$){var q=1,ee=$;g<0&&(q=-1,g=-g);for(var se=S(this.doc,i),Pe=0;Pe<g;++Pe){var Fe=yn(this,se,"div");if(ee==null?ee=Fe.left:Fe.left=ee,se=cl(this,Fe,q,j),se.hitSide)break}return se},moveV:Lr(function(i,g){var j=this,$=this.doc,q=[],ee=!this.display.shift&&!$.extend&&$.sel.somethingSelected();if($.extendSelectionsBy(function(Pe){if(ee)return i<0?Pe.from():Pe.to();var Fe=yn(j,Pe.head,"div");Pe.goalColumn!=null&&(Fe.left=Pe.goalColumn),q.push(Fe.left);var _t=cl(j,Fe,i,g);return g=="page"&&Pe==$.sel.primary()&&Va(j,Zt(j,_t,"div").top-Fe.top),_t},Je),q.length)for(var se=0;se<$.sel.ranges.length;se++)$.sel.ranges[se].goalColumn=q[se]}),findWordAt:function(i){var g=this.doc,j=Cn(g,i.line).text,$=i.ch,q=i.ch;if(j){var ee=this.getHelper(i,"wordChars");(i.sticky=="before"||q==j.length)&&$?--$:++q;for(var se=j.charAt($),Pe=Nt(se,ee)?function(Fe){return Nt(Fe,ee)}:/\s/.test(se)?function(Fe){return/\s/.test(Fe)}:function(Fe){return!/\s/.test(Fe)&&!Nt(Fe)};$>0&&Pe(j.charAt($-1));)--$;for(;q<j.length&&Pe(j.charAt(q));)++q}return new Gi(cn(i.line,$),cn(i.line,q))},toggleOverwrite:function(i){if(i!=null&&i==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?F(this.display.cursorDiv,"CodeMirror-overwrite"):_(this.display.cursorDiv,"CodeMirror-overwrite"),Ge(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==U()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Lr(function(i,g){Ra(this,i,g)}),getScrollInfo:function(){var i=this.display.scroller;return{left:i.scrollLeft,top:i.scrollTop,height:i.scrollHeight-We(this)-this.display.barHeight,width:i.scrollWidth-We(this)-this.display.barWidth,clientHeight:ie(this),clientWidth:we(this)}},scrollIntoView:Lr(function(i,g){i==null?(i={from:this.doc.sel.primary().head,to:null},g==null&&(g=this.options.cursorScrollMargin)):typeof i=="number"?i={from:cn(i,0),to:null}:i.from==null&&(i={from:i,to:null}),i.to||(i.to=i.from),i.margin=g||0,i.from.line!=null?ho(this,i):Aa(this,i.from,i.to,i.margin)}),setSize:Lr(function(i,g){var j=this,$=function(ee){return typeof ee=="number"||/^\d+$/.test(String(ee))?ee+"px":ee};i!=null&&(this.display.wrapper.style.width=$(i)),g!=null&&(this.display.wrapper.style.height=$(g)),this.options.lineWrapping&&li(this);var q=this.display.viewFrom;this.doc.iter(q,this.display.viewTo,function(ee){if(ee.widgets){for(var se=0;se<ee.widgets.length;se++)if(ee.widgets[se].noHScroll){rr(j,q,"widget");break}}++q}),this.curOp.forceUpdate=!0,Ge(this,"refresh",this)}),operation:function(i){return Kr(this,i)},startOperation:function(){return ua(this)},endOperation:function(){return Ea(this)},refresh:Lr(function(){var i=this.display.cachedTextHeight;Zi(this),this.curOp.forceUpdate=!0,Ei(this),Ra(this,this.doc.scrollLeft,this.doc.scrollTop),Za(this.display),(i==null||Math.abs(i-Hi(this.display))>.5||this.options.lineWrapping)&&jr(this),Ge(this,"refresh",this)}),swapDoc:Lr(function(i){var g=this.doc;return g.cm=null,this.state.selectingText&&this.state.selectingText(),vs(this,i),Ei(this),this.display.input.reset(),Ra(this,i.scrollLeft,i.scrollTop),this.curOp.forceScroll=!0,Rt(this,"swapDoc",this,g),g}),phrase:function(i){var g=this.options.phrases;return g&&Object.prototype.hasOwnProperty.call(g,i)?g[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}},Ee(e),e.registerHelper=function(i,g,j){l.hasOwnProperty(i)||(l[i]=e[i]={_global:[]}),l[i][g]=j},e.registerGlobalHelper=function(i,g,j,$){e.registerHelper(i,g,$),l[i]._global.push({pred:j,val:$})}}function ps(e,t,l,i,g){var j=t,$=l,q=Cn(e,t.line),ee=g&&e.direction=="rtl"?-l:l;function se(){var Zn=t.line+ee;return Zn<e.first||Zn>=e.first+e.size?!1:(t=new cn(Zn,t.ch,t.sticky),q=Cn(e,Zn))}function Pe(Zn){var Yn;if(i=="codepoint"){var ii=q.text.charCodeAt(t.ch+(i>0?0:-1));isNaN(ii)?Yn=null:Yn=new cn(t.line,Math.max(0,Math.min(q.text.length,t.ch+l*(ii>=55296&&ii<56320?2:1))),-l)}else g?Yn=kl(e.cm,q,t,l):Yn=ss(q,t,l);if(Yn==null)if(!Zn&&se())t=ls(g,e.cm,q,t.line,ee);else return!1;else t=Yn;return!0}if(i=="char"||i=="codepoint")Pe();else if(i=="column")Pe(!0);else if(i=="word"||i=="group")for(var Fe=null,_t=i=="group",ut=e.cm&&e.cm.getHelper(t,"wordChars"),en=!0;!(l<0&&!Pe(!en));en=!1){var xn=q.text.charAt(t.ch)||`
|
|
`,Wn=Nt(xn,ut)?"w":_t&&xn==`
|
|
`?"n":!_t||/\s/.test(xn)?null:"p";if(_t&&!en&&!Wn&&(Wn="s"),Fe&&Fe!=Wn){l<0&&(l=1,Pe(),t.sticky="after");break}if(Wn&&(Fe=Wn),l>0&&!Pe(!en))break}var Vn=Xo(e,t,j,$,!0);return pr(j,Vn)&&(Vn.hitSide=!0),Vn}function cl(e,t,l,i){var g=e.doc,j=t.left,$;if(i=="page"){var q=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ee=Math.max(q-.5*Hi(e.display),3);$=(l>0?t.bottom:t.top)+l*ee}else i=="line"&&($=l>0?t.bottom+3:t.top-3);for(var se;!(se=pi(e,j,$),!se.outside);){if(l<0?$<=0:$>=g.height){se.hitSide=!0;break}$+=l*5}return se}var cr=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};cr.prototype.init=function(e){var t=this,l=this,i=l.cm,g=l.div=e.lineDiv;ul(g,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize);function j(q){for(var ee=q.target;ee;ee=ee.parentNode){if(ee==g)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ee.className))break}return!1}Ue(g,"paste",function(q){if(!j(q)||vt(i,q)||ol(q,i))return;P<=11&&setTimeout(br(i,function(){return t.updateFromDOM()}),20)}),Ue(g,"compositionstart",function(q){t.composing={data:q.data,done:!1}}),Ue(g,"compositionupdate",function(q){t.composing||(t.composing={data:q.data,done:!1})}),Ue(g,"compositionend",function(q){t.composing&&(q.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ue(g,"touchstart",function(){return l.forceCompositionEnd()}),Ue(g,"input",function(){t.composing||t.readFromDOMSoon()});function $(q){if(!j(q)||vt(i,q))return;if(i.somethingSelected())es({lineWise:!1,text:i.getSelections()}),q.type=="cut"&&i.replaceSelection("",null,"cut");else if(i.options.lineWiseCopyCut){var ee=ll(i);es({lineWise:!0,text:ee.text}),q.type=="cut"&&i.operation(function(){i.setSelections(ee.ranges,0,xe),i.replaceSelection("",null,"cut")})}else return;if(q.clipboardData){q.clipboardData.clearData();var se=Ca.text.join(`
|
|
`);if(q.clipboardData.setData("Text",se),q.clipboardData.getData("Text")==se){q.preventDefault();return}}var Pe=dl(),Fe=Pe.firstChild;i.display.lineSpace.insertBefore(Pe,i.display.lineSpace.firstChild),Fe.value=Ca.text.join(`
|
|
`);var _t=document.activeElement;G(Fe),setTimeout(function(){i.display.lineSpace.removeChild(Pe),_t.focus(),_t==g&&l.showPrimarySelection()},50)}Ue(g,"copy",$),Ue(g,"cut",$)},cr.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},cr.prototype.prepareSelection=function(){var e=Zr(this.cm,!1);return e.focus=document.activeElement==this.div,e},cr.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},cr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},cr.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,l=t.doc.sel.primary(),i=l.from(),g=l.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||g.line<t.display.viewFrom){e.removeAllRanges();return}var j=ts(t,e.anchorNode,e.anchorOffset),$=ts(t,e.focusNode,e.focusOffset);if(j&&!j.bad&&$&&!$.bad&&ri(nr(j,$),i)==0&&ri(tr(j,$),g)==0)return;var q=t.display.view,ee=i.line>=t.display.viewFrom&&hl(t,i)||{node:q[0].measure.map[2],offset:0},se=g.line<t.display.viewTo&&hl(t,g);if(!se){var Pe=q[q.length-1].measure,Fe=Pe.maps?Pe.maps[Pe.maps.length-1]:Pe.map;se={node:Fe[Fe.length-1],offset:Fe[Fe.length-2]-Fe[Fe.length-3]}}if(!ee||!se){e.removeAllRanges();return}var _t=e.rangeCount&&e.getRangeAt(0),ut;try{ut=p(ee.node,ee.offset,se.offset,se.node)}catch(en){}ut&&(!N&&t.state.focused?(e.collapse(ee.node,ee.offset),ut.collapsed||(e.removeAllRanges(),e.addRange(ut))):(e.removeAllRanges(),e.addRange(ut)),_t&&e.anchorNode==null?e.addRange(_t):N&&this.startGracePeriod()),this.rememberSelection()},cr.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)},cr.prototype.showMultipleSelections=function(e){h(this.cm.display.cursorDiv,e.cursors),h(this.cm.display.selectionDiv,e.selection)},cr.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},cr.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return E(this.div,t)},cr.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},cr.prototype.blur=function(){this.div.blur()},cr.prototype.getField=function(){return this.div},cr.prototype.supportsTouch=function(){return!0},cr.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Kr(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)},cr.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},cr.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(u&&b&&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 l=ts(t,e.anchorNode,e.anchorOffset),i=ts(t,e.focusNode,e.focusOffset);l&&i&&Kr(t,function(){Yr(t.doc,Xn(l,i),xe),(l.bad||i.bad)&&(t.curOp.selectionChanged=!0)})},cr.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,l=e.doc.sel.primary(),i=l.from(),g=l.to();if(i.ch==0&&i.line>e.firstLine()&&(i=cn(i.line-1,Cn(e.doc,i.line-1).length)),g.ch==Cn(e.doc,g.line).text.length&&g.line<e.lastLine()&&(g=cn(g.line+1,0)),i.line<t.viewFrom||g.line>t.viewTo-1)return!1;var j,$,q;i.line==t.viewFrom||(j=ur(e,i.line))==0?($=fi(t.view[0].line),q=t.view[0].node):($=fi(t.view[j].line),q=t.view[j-1].node.nextSibling);var ee=ur(e,g.line),se,Pe;if(ee==t.view.length-1?(se=t.viewTo-1,Pe=t.lineDiv.lastChild):(se=fi(t.view[ee+1].line)-1,Pe=t.view[ee+1].node.previousSibling),!q)return!1;for(var Fe=e.doc.splitLines(tu(e,q,Pe,$,se)),_t=Ti(e.doc,cn($,0),cn(se,Cn(e.doc,se).text.length));Fe.length>1&&_t.length>1;)if(nt(Fe)==nt(_t))Fe.pop(),_t.pop(),se--;else if(Fe[0]==_t[0])Fe.shift(),_t.shift(),$++;else break;for(var ut=0,en=0,xn=Fe[0],Wn=_t[0],Vn=Math.min(xn.length,Wn.length);ut<Vn&&xn.charCodeAt(ut)==Wn.charCodeAt(ut);)++ut;for(var Zn=nt(Fe),Yn=nt(_t),ii=Math.min(Zn.length-(Fe.length==1?ut:0),Yn.length-(_t.length==1?ut:0));en<ii&&Zn.charCodeAt(Zn.length-en-1)==Yn.charCodeAt(Yn.length-en-1);)++en;if(Fe.length==1&&_t.length==1&&$==i.line)for(;ut&&ut>i.ch&&Zn.charCodeAt(Zn.length-en-1)==Yn.charCodeAt(Yn.length-en-1);)ut--,en++;Fe[Fe.length-1]=Zn.slice(0,Zn.length-en).replace(/^\u200b+/,""),Fe[0]=Fe[0].slice(ut).replace(/\u200b+$/,"");var Ci=cn($,ut),_i=cn(se,_t.length?nt(_t).length-en:0);if(Fe.length>1||Fe[0]||ri(Ci,_i))return bo(e.doc,Fe,Ci,_i,"+input"),!0},cr.prototype.ensurePolled=function(){this.forceCompositionEnd()},cr.prototype.reset=function(){this.forceCompositionEnd()},cr.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},cr.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)},cr.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Kr(this.cm,function(){return Zi(e.cm)})},cr.prototype.setUneditable=function(e){e.contentEditable="false"},cr.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||br(this.cm,fs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},cr.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},cr.prototype.onContextMenu=function(){},cr.prototype.resetPosition=function(){},cr.prototype.needsContentAttribute=!0;function hl(e,t){var l=$e(e,t.line);if(!l||l.hidden)return null;var i=Cn(e.doc,t.line),g=le(l,i,t.line),j=In(i,e.doc.direction),$="left";if(j){var q=tt(j,t.ch);$=q%2?"right":"left"}var ee=qt(g.map,t.ch,$);return ee.offset=ee.collapse=="right"?ee.end:ee.start,ee}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function wo(e,t){return t&&(e.bad=!0),e}function tu(e,t,l,i,g){var j="",$=!1,q=e.doc.lineSeparator(),ee=!1;function se(ut){return function(en){return en.id==ut}}function Pe(){$&&(j+=q,ee&&(j+=q),$=ee=!1)}function Fe(ut){ut&&(Pe(),j+=ut)}function _t(ut){if(ut.nodeType==1){var en=ut.getAttribute("cm-text");if(en){Fe(en);return}var xn=ut.getAttribute("cm-marker"),Wn;if(xn){var Vn=e.findMarks(cn(i,0),cn(g+1,0),se(+xn));Vn.length&&(Wn=Vn[0].find(0))&&Fe(Ti(e.doc,Wn.from,Wn.to).join(q));return}if(ut.getAttribute("contenteditable")=="false")return;var Zn=/^(pre|div|p|li|table|br)$/i.test(ut.nodeName);if(!/^br$/i.test(ut.nodeName)&&ut.textContent.length==0)return;Zn&&Pe();for(var Yn=0;Yn<ut.childNodes.length;Yn++)_t(ut.childNodes[Yn]);/^(pre|p)$/i.test(ut.nodeName)&&(ee=!0),Zn&&($=!0)}else ut.nodeType==3&&Fe(ut.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(_t(t),t==l);)t=t.nextSibling,ee=!1;return j}function ts(e,t,l){var i;if(t==e.display.lineDiv){if(i=e.display.lineDiv.childNodes[l],!i)return wo(e.clipPos(cn(e.display.viewTo-1)),!0);t=null,l=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 g=0;g<e.display.view.length;g++){var j=e.display.view[g];if(j.node==i)return nu(j,t,l)}}function nu(e,t,l){var i=e.text.firstChild,g=!1;if(!t||!E(i,t))return wo(cn(fi(e.line),0),!0);if(t==i&&(g=!0,t=i.childNodes[l],l=0,!t)){var j=e.rest?nt(e.rest):e.line;return wo(cn(fi(j),j.text.length),g)}var $=t.nodeType==3?t:null,q=t;for(!$&&t.childNodes.length==1&&t.firstChild.nodeType==3&&($=t.firstChild,l&&(l=$.nodeValue.length));q.parentNode!=i;)q=q.parentNode;var ee=e.measure,se=ee.maps;function Pe(Wn,Vn,Zn){for(var Yn=-1;Yn<(se?se.length:0);Yn++)for(var ii=Yn<0?ee.map:se[Yn],Ci=0;Ci<ii.length;Ci+=3){var _i=ii[Ci+2];if(_i==Wn||_i==Vn){var Ui=fi(Yn<0?e.line:e.rest[Yn]),fr=ii[Ci]+Zn;return(Zn<0||_i!=Wn)&&(fr=ii[Ci+(Zn?1:0)]),cn(Ui,fr)}}}var Fe=Pe($,q,l);if(Fe)return wo(Fe,g);for(var _t=q.nextSibling,ut=$?$.nodeValue.length-l:0;_t;_t=_t.nextSibling){if(Fe=Pe(_t,_t.firstChild,0),Fe)return wo(cn(Fe.line,Fe.ch-ut),g);ut+=_t.textContent.length}for(var en=q.previousSibling,xn=l;en;en=en.previousSibling){if(Fe=Pe(en,en.firstChild,-1),Fe)return wo(cn(Fe.line,Fe.ch+xn),g);xn+=en.textContent.length}}var Dr=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Z,this.hasSelection=!1,this.composing=null};Dr.prototype.init=function(e){var t=this,l=this,i=this.cm;this.createField(e);var g=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),r&&(g.style.width="0px"),Ue(g,"input",function(){H&&P>=9&&t.hasSelection&&(t.hasSelection=null),l.poll()}),Ue(g,"paste",function($){if(vt(i,$)||ol($,i))return;i.state.pasteIncoming=+new Date,l.fastPoll()});function j($){if(vt(i,$))return;if(i.somethingSelected())es({lineWise:!1,text:i.getSelections()});else if(i.options.lineWiseCopyCut){var q=ll(i);es({lineWise:!0,text:q.text}),$.type=="cut"?i.setSelections(q.ranges,null,xe):(l.prevInput="",g.value=q.text.join(`
|
|
`),G(g))}else return;$.type=="cut"&&(i.state.cutIncoming=+new Date)}Ue(g,"cut",j),Ue(g,"copy",j),Ue(e.scroller,"paste",function($){if(gr(e,$)||vt(i,$))return;if(!g.dispatchEvent){i.state.pasteIncoming=+new Date,l.focus();return}var q=new Event("paste");q.clipboardData=$.clipboardData,g.dispatchEvent(q)}),Ue(e.lineSpace,"selectstart",function($){gr(e,$)||ae($)}),Ue(g,"compositionstart",function(){var $=i.getCursor("from");l.composing&&l.composing.range.clear(),l.composing={start:$,range:i.markText($,i.getCursor("to"),{className:"CodeMirror-composing"})}}),Ue(g,"compositionend",function(){l.composing&&(l.poll(),l.composing.range.clear(),l.composing=null)})},Dr.prototype.createField=function(e){this.wrapper=dl(),this.textarea=this.wrapper.firstChild},Dr.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Dr.prototype.prepareSelection=function(){var e=this.cm,t=e.display,l=e.doc,i=Zr(e);if(e.options.moveInputWithCursor){var g=yn(e,l.sel.primary().head,"div"),j=t.wrapper.getBoundingClientRect(),$=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,g.top+$.top-j.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,g.left+$.left-j.left))}return i},Dr.prototype.showSelection=function(e){var t=this.cm,l=t.display;h(l.cursorDiv,e.cursors),h(l.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Dr.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var l=t.getSelection();this.textarea.value=l,t.state.focused&&G(this.textarea),H&&P>=9&&(this.hasSelection=l)}else e||(this.prevInput=this.textarea.value="",H&&P>=9&&(this.hasSelection=null))},Dr.prototype.getField=function(){return this.textarea},Dr.prototype.supportsTouch=function(){return!1},Dr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!o||U()!=this.textarea))try{this.textarea.focus()}catch(e){}},Dr.prototype.blur=function(){this.textarea.blur()},Dr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Dr.prototype.receivedFocus=function(){this.slowPoll()},Dr.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()})},Dr.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function l(){var i=t.poll();!i&&!e?(e=!0,t.polling.set(60,l)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,l)},Dr.prototype.poll=function(){var e=this,t=this.cm,l=this.textarea,i=this.prevInput;if(this.contextMenuPending||!t.state.focused||yt(l)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var g=l.value;if(g==i&&!t.somethingSelected())return!1;if(H&&P>=9&&this.hasSelection===g||a&&/[\uf700-\uf7ff]/.test(g))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var j=g.charCodeAt(0);if(j==8203&&!i&&(i="\u200B"),j==8666)return this.reset(),this.cm.execCommand("undo")}for(var $=0,q=Math.min(i.length,g.length);$<q&&i.charCodeAt($)==g.charCodeAt($);)++$;return Kr(t,function(){fs(t,g.slice($),i.length-$,null,e.composing?"*compose":null),g.length>1e3||g.indexOf(`
|
|
`)>-1?l.value=e.prevInput="":e.prevInput=g,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Dr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Dr.prototype.onKeyPress=function(){H&&P>=9&&(this.hasSelection=null),this.fastPoll()},Dr.prototype.onContextMenu=function(e){var t=this,l=t.cm,i=l.display,g=t.textarea;t.contextMenuPending&&t.contextMenuPending();var j=Rr(l,e),$=i.scroller.scrollTop;if(!j||m)return;var q=l.options.resetSelectionOnContextMenu;q&&l.doc.sel.contains(j)==-1&&br(l,Yr)(l.doc,Xn(j),xe);var ee=g.style.cssText,se=t.wrapper.style.cssText,Pe=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",g.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-Pe.top-5)+"px; left: "+(e.clientX-Pe.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 Fe;k&&(Fe=window.scrollY),i.input.focus(),k&&window.scrollTo(null,Fe),i.input.reset(),l.somethingSelected()||(g.value=t.prevInput=" "),t.contextMenuPending=ut,i.selForContextMenu=l.doc.sel,clearTimeout(i.detectingSelectAll);function _t(){if(g.selectionStart!=null){var xn=l.somethingSelected(),Wn="\u200B"+(xn?g.value:"");g.value="\u21DA",g.value=Wn,t.prevInput=xn?"":"\u200B",g.selectionStart=1,g.selectionEnd=Wn.length,i.selForContextMenu=l.doc.sel}}function ut(){if(t.contextMenuPending!=ut)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=se,g.style.cssText=ee,H&&P<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=$),g.selectionStart!=null){(!H||H&&P<9)&&_t();var xn=0,Wn=function(){i.selForContextMenu==l.doc.sel&&g.selectionStart==0&&g.selectionEnd>0&&t.prevInput=="\u200B"?br(l,Ds)(l):xn++<10?i.detectingSelectAll=setTimeout(Wn,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(Wn,200)}}if(H&&P>=9&&_t(),O){ve(e);var en=function(){Ct(window,"mouseup",en),setTimeout(ut,20)};Ue(window,"mouseup",en)}else setTimeout(ut,50)},Dr.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Dr.prototype.setUneditable=function(){},Dr.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?T(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 l=U();t.autofocus=l==e||e.getAttribute("autofocus")!=null&&l==document.body}function i(){e.value=q.getValue()}var g;if(e.form&&(Ue(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var j=e.form;g=j.submit;try{var $=j.submit=function(){i(),j.submit=g,j.submit(),j.submit=$}}catch(ee){}}t.finishInit=function(ee){ee.save=i,ee.getTextArea=function(){return e},ee.toTextArea=function(){ee.toTextArea=isNaN,i(),e.parentNode.removeChild(ee.getWrapperElement()),e.style.display="",e.form&&(Ct(e.form,"submit",i),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=g))}},e.style.display="none";var q=xr(function(ee){return e.parentNode.insertBefore(ee,e.nextSibling)},t);return q}function ru(e){e.off=Ct,e.on=Ue,e.wheelEventPixels=Ba,e.Doc=ta,e.splitLines=gt,e.countColumn=V,e.findColumn=Ke,e.isWordChar=dt,e.Pass=Ye,e.signal=Ge,e.Line=Nn,e.changeEnd=ui,e.scrollbarModel=$a,e.Pos=cn,e.cmpPos=ri,e.modes=At,e.mimeModes=ot,e.resolveMode=_e,e.getMode=Ne,e.modeExtensions=xt,e.extendMode=Xt,e.copyState=vn,e.startState=ci,e.innerMode=Mn,e.commands=Fo,e.keyMap=Ka,e.keyName=Vs,e.isModifierKey=zs,e.lookupKey=xo,e.normalizeKeyMap=Ml,e.StringStream=$n,e.SharedTextMarker=No,e.TextMarker=qa,e.LineWidget=Io,e.e_preventDefault=ae,e.e_stopPropagation=re,e.e_stop=ve,e.addClass=F,e.contains=E,e.rmClass=_,e.keyNames=eo}$l(xr),ql(xr);var au="iter insert remove copy getEditor constructor".split(" ");for(var ns in ta.prototype)ta.prototype.hasOwnProperty(ns)&&oe(au,ns)<0&&(xr.prototype[ns]=function(e){return function(){return e.apply(this.doc,arguments)}}(ta.prototype[ns]));return Ee(ta),xr.inputStyles={textarea:Dr,contenteditable:cr},xr.defineMode=function(e){!xr.defaults.mode&&e!="null"&&(xr.defaults.mode=e),Yt.apply(this,arguments)},xr.defineMIME=rn,xr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),xr.defineMIME("text/plain","null"),xr.defineExtension=function(e,t){xr.prototype[e]=t},xr.defineDocExtension=function(e,t){ta.prototype[e]=t},xr.fromTextArea=iu,ru(xr),xr.version="5.58.2",xr})},WaYH:function(tn,Qe,I){"use strict";var te=I("rePB"),Y=I("Ff2n"),N=I("VTBJ"),K=I("1OyB"),A=I("vuIU"),M=I("JX7q"),H=I("Ji7U"),P=I("LK+K"),k=I("q1tI"),D=I("TSYQ"),b=I.n(D),m=I("sboe"),f=I("OZM5"),d=function(O){var C=O.prefixCls,_=O.level,y=O.isStart,h=O.isEnd;if(!_)return null;for(var c="".concat(C,"-indent-unit"),v=[],p=0;p<_;p+=1){var E;v.push(k.createElement("span",{key:p,className:b()(c,(E={},Object(te.a)(E,"".concat(c,"-start"),y[p+1]),Object(te.a)(E,"".concat(c,"-end"),h[p+1]),Object(te.a)(E,"".concat(c,"-end-first-level"),!p&&h[0]),E))}))}return k.createElement("span",{"aria-hidden":"true",className:"".concat(C,"-indent")},v)},s=d,r=I("815F"),u="open",o="close",a="---",n=function(x){Object(H.a)(C,x);var O=Object(P.a)(C);function C(){var _;return Object(K.a)(this,C),_=O.apply(this,arguments),_.state={dragNodeHighlight:!1},_.onSelectorClick=function(y){var h=_.props.context.onNodeClick;h(y,Object(r.b)(_.props)),_.isSelectable()?_.onSelect(y):_.onCheck(y)},_.onSelectorDoubleClick=function(y){var h=_.props.context.onNodeDoubleClick;h(y,Object(r.b)(_.props))},_.onSelect=function(y){if(_.isDisabled())return;var h=_.props.context.onNodeSelect;y.preventDefault(),h(y,Object(r.b)(_.props))},_.onCheck=function(y){if(_.isDisabled())return;var h=_.props,c=h.disableCheckbox,v=h.checked,p=_.props.context.onNodeCheck;if(!_.isCheckable()||c)return;y.preventDefault();var E=!v;p(y,Object(r.b)(_.props),E)},_.onMouseEnter=function(y){var h=_.props.context.onNodeMouseEnter;h(y,Object(r.b)(_.props))},_.onMouseLeave=function(y){var h=_.props.context.onNodeMouseLeave;h(y,Object(r.b)(_.props))},_.onContextMenu=function(y){var h=_.props.context.onNodeContextMenu;h(y,Object(r.b)(_.props))},_.onDragStart=function(y){var h=_.props.context.onNodeDragStart;y.stopPropagation(),_.setState({dragNodeHighlight:!0}),h(y,Object(M.a)(_));try{y.dataTransfer.setData("text/plain","")}catch(c){}},_.onDragEnter=function(y){var h=_.props.context.onNodeDragEnter;y.preventDefault(),y.stopPropagation(),h(y,Object(M.a)(_))},_.onDragOver=function(y){var h=_.props.context.onNodeDragOver;y.preventDefault(),y.stopPropagation(),h(y,Object(M.a)(_))},_.onDragLeave=function(y){var h=_.props.context.onNodeDragLeave;y.stopPropagation(),h(y,Object(M.a)(_))},_.onDragEnd=function(y){var h=_.props.context.onNodeDragEnd;y.stopPropagation(),_.setState({dragNodeHighlight:!1}),h(y,Object(M.a)(_))},_.onDrop=function(y){var h=_.props.context.onNodeDrop;y.preventDefault(),y.stopPropagation(),_.setState({dragNodeHighlight:!1}),h(y,Object(M.a)(_))},_.onExpand=function(y){var h=_.props.context.onNodeExpand;h(y,Object(r.b)(_.props))},_.setSelectHandle=function(y){_.selectHandle=y},_.getNodeState=function(){var y=_.props.expanded;return _.isLeaf()?null:y?u:o},_.hasChildren=function(){var y=_.props.eventKey,h=_.props.context.keyEntities,c=h[y]||{},v=c.children;return!!(v||[]).length},_.isLeaf=function(){var y=_.props,h=y.isLeaf,c=y.loaded,v=_.props.context.loadData,p=_.hasChildren();return h===!1?!1:h||!v&&!p||v&&c&&!p},_.isDisabled=function(){var y=_.props.disabled,h=_.props.context.disabled;return!!(h||y)},_.isCheckable=function(){var y=_.props.checkable,h=_.props.context.checkable;return!h||y===!1?!1:h},_.syncLoadData=function(y){var h=y.expanded,c=y.loading,v=y.loaded,p=_.props.context,E=p.loadData,U=p.onNodeLoad;if(c)return;E&&h&&!_.isLeaf()&&(!_.hasChildren()&&!v&&U(Object(r.b)(_.props)))},_.renderSwitcher=function(){var y=_.props,h=y.expanded,c=y.switcherIcon,v=_.props.context,p=v.prefixCls,E=v.switcherIcon,U=c||E;if(_.isLeaf())return k.createElement("span",{className:b()("".concat(p,"-switcher"),"".concat(p,"-switcher-noop"))},typeof U=="function"?U(Object(N.a)(Object(N.a)({},_.props),{},{isLeaf:!0})):U);var F=b()("".concat(p,"-switcher"),"".concat(p,"-switcher_").concat(h?u:o));return k.createElement("span",{onClick:_.onExpand,className:F},typeof U=="function"?U(Object(N.a)(Object(N.a)({},_.props),{},{isLeaf:!1})):U)},_.renderCheckbox=function(){var y=_.props,h=y.checked,c=y.halfChecked,v=y.disableCheckbox,p=_.props.context.prefixCls,E=_.isDisabled(),U=_.isCheckable();if(!U)return null;var F=typeof U!="boolean"?U:null;return k.createElement("span",{className:b()("".concat(p,"-checkbox"),h&&"".concat(p,"-checkbox-checked"),!h&&c&&"".concat(p,"-checkbox-indeterminate"),(E||v)&&"".concat(p,"-checkbox-disabled")),onClick:_.onCheck},F)},_.renderIcon=function(){var y=_.props.loading,h=_.props.context.prefixCls;return k.createElement("span",{className:b()("".concat(h,"-iconEle"),"".concat(h,"-icon__").concat(_.getNodeState()||"docu"),y&&"".concat(h,"-icon_loading"))})},_.renderSelector=function(){var y=_.state.dragNodeHighlight,h=_.props,c=h.title,v=h.selected,p=h.icon,E=h.loading,U=h.data,F=_.props.context,z=F.prefixCls,G=F.showIcon,B=F.icon,T=F.draggable,V=F.loadData,Z=F.titleRender,oe=_.isDisabled(),pe="".concat(z,"-node-content-wrapper"),Ye;if(G){var xe=p||B;Ye=xe?k.createElement("span",{className:b()("".concat(z,"-iconEle"),"".concat(z,"-icon__customize"))},typeof xe=="function"?xe(_.props):xe):_.renderIcon()}else V&&E&&(Ye=_.renderIcon());var Ie;typeof c=="function"?Ie=c(U):Z?Ie=Z(U):Ie=c;var Je=k.createElement("span",{className:"".concat(z,"-title")},Ie);return k.createElement("span",{ref:_.setSelectHandle,title:typeof c=="string"?c:"",className:b()("".concat(pe),"".concat(pe,"-").concat(_.getNodeState()||"normal"),!oe&&(v||y)&&"".concat(z,"-node-selected"),!oe&&T&&"draggable"),draggable:!oe&&T||void 0,"aria-grabbed":!oe&&T||void 0,onMouseEnter:_.onMouseEnter,onMouseLeave:_.onMouseLeave,onContextMenu:_.onContextMenu,onClick:_.onSelectorClick,onDoubleClick:_.onSelectorDoubleClick,onDragStart:T?_.onDragStart:void 0},Ye,Je)},_}return Object(A.a)(C,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var y=this.props.selectable,h=this.props.context.selectable;return typeof y=="boolean"?y:h}},{key:"render",value:function(){var y,h=this.props,c=h.eventKey,v=h.className,p=h.style,E=h.dragOver,U=h.dragOverGapTop,F=h.dragOverGapBottom,z=h.isLeaf,G=h.isStart,B=h.isEnd,T=h.expanded,V=h.selected,Z=h.checked,oe=h.halfChecked,pe=h.loading,Ye=h.domRef,xe=h.active,Ie=h.onMouseMove,Je=Object(Y.a)(h,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Ke=this.props.context,be=Ke.prefixCls,de=Ke.filterTreeNode,nt=Ke.draggable,Kt=Ke.keyEntities,jt=this.isDisabled(),wt=Object(f.f)(Je),ze=Kt[c]||{},ft=ze.level,dt=B[B.length-1];return k.createElement("div",Object.assign({ref:Ye,className:b()(v,"".concat(be,"-treenode"),(y={},Object(te.a)(y,"".concat(be,"-treenode-disabled"),jt),Object(te.a)(y,"".concat(be,"-treenode-switcher-").concat(T?"open":"close"),!z),Object(te.a)(y,"".concat(be,"-treenode-checkbox-checked"),Z),Object(te.a)(y,"".concat(be,"-treenode-checkbox-indeterminate"),oe),Object(te.a)(y,"".concat(be,"-treenode-selected"),V),Object(te.a)(y,"".concat(be,"-treenode-loading"),pe),Object(te.a)(y,"".concat(be,"-treenode-active"),xe),Object(te.a)(y,"".concat(be,"-treenode-leaf-last"),dt),Object(te.a)(y,"drag-over",!jt&&E),Object(te.a)(y,"drag-over-gap-top",!jt&&U),Object(te.a)(y,"drag-over-gap-bottom",!jt&&F),Object(te.a)(y,"filter-node",de&&de(Object(r.b)(this.props))),y)),style:p,onDragEnter:nt?this.onDragEnter:void 0,onDragOver:nt?this.onDragOver:void 0,onDragLeave:nt?this.onDragLeave:void 0,onDrop:nt?this.onDrop:void 0,onDragEnd:nt?this.onDragEnd:void 0,onMouseMove:Ie},wt),k.createElement(s,{prefixCls:be,level:ft,isStart:G,isEnd:B}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),C}(k.Component),R=function(O){return k.createElement(m.a.Consumer,null,function(C){return k.createElement(n,Object.assign({},O,{context:C}))})};R.displayName="TreeNode",R.defaultProps={title:a},R.isTreeNode=1;var w=Qe.a=R},XpUO:function(tn,Qe,I){"use strict";var te=I("2qtc"),Y=I("kLXV"),N=I("sRBo"),K=I("kaz8"),A=I("jCWc"),M=I("kPKH"),H=I("iQDF"),P=I("+eQT"),k=I("giR+"),D=I("fyUT"),b=I("14J3"),m=I("BMrR"),f=I("7Kak"),d=I("9yH6"),s=I("miYZ"),r=I("tsqr"),u=I("jrin"),o=I("9og8"),a=I("k1fw"),n=I("oBTY"),R=I("y8nQ"),w=I("Vl3Y"),x=I("tJVT"),O=I("PpiC"),C=I("WmNS"),_=I.n(C),y=I("q1tI"),h=I.n(y),c=I("wd/R"),v=I.n(c),p=I("ErOA"),E=I("xKgJ"),U=I("1vsH"),F=I("Ty5D"),z=I("9kvl"),G=I("4wi7"),B=I("oUNq"),T=I("eozf"),V=function(oe){var pe,Ye,xe,Ie,Je,Ke,be,de,nt,Kt,jt,wt,ze,ft,dt,Nt,Ze,Bt,Ut,Mt,An,mn,pn,tt,fn,In,He,Ue,pt,Ct,Ge,vt,Ae,ge,Ee,ae,re,he,ve,me=oe.classroomList,Be=oe.dispatch,Tt=oe.courseEndTime,Jt=Object(O.a)(oe,["classroomList","dispatch","courseEndTime"]),En=Object(F.i)(),mt=w.a.useForm(),Qt=Object(x.a)(mt,1),gt=Qt[0],yt=Object(y.useState)(1),rt=Object(x.a)(yt,2),ce=rt[0],Re=rt[1],At=Object(y.useState)([]),ot=Object(x.a)(At,2),Yt=ot[0],rn=ot[1],_e=Object(y.useState)(0),Ne=Object(x.a)(_e,2),xt=Ne[0],Xt=Ne[1],vn=Object(y.useState)(2e3),Mn=Object(x.a)(vn,2),ci=Mn[0],$n=Mn[1],Cn=Object(y.useState)(!0),Ti=Object(x.a)(Cn,2),Wi=Ti[0],hi=Ti[1],fi=Object(y.useState)(!1),ji=Object(x.a)(fi,2),er=ji[0],yr=ji[1],cn=Object(y.useState)(!1),ri=Object(x.a)(cn,2),pr=ri[0],Cr=ri[1],tr=Object(y.useState)([]),nr=Object(x.a)(tr,2),X=nr[0],S=nr[1],L=Object(y.useState)(!0),W=Object(x.a)(L,2),ne=W[0],Q=W[1],ke=Object(y.useState)(!((pe=me.actionTabs)!==null&&pe!==void 0&&(Ye=pe.selectArrsAll)!==null&&Ye!==void 0&&(xe=Ye[0])!==null&&xe!==void 0&&xe.send_type)),Vt=Object(x.a)(ke,2),kn=Vt[0],Qn=Vt[1],nn=Object(y.useState)([0,0,0]),ti=Object(x.a)(nn,2),qn=ti[0],Li=ti[1];Object(y.useEffect)(function(){if(me.actionTabs.key==="\u7ACB\u5373\u53D1\u5E03"){var Ai,wi,ir,Fi,Bn,gn;if((Ai=me.actionTabs)!==null&&Ai!==void 0&&(wi=Ai.selectArrsAll)!==null&&wi!==void 0&&(ir=wi[0])!==null&&ir!==void 0&&ir.can_publish){var ai,J,ue;Li(Object(n.a)((ai=me.actionTabs)===null||ai===void 0||((J=ai.selectArrsAll)===null||J===void 0||((ue=J[0])===null||ue===void 0))?void 0:ue.difficult_count))}else{var Tn,_n,si;Li(Object(n.a)((Tn=me.actionTabs)===null||Tn===void 0||((_n=Tn.selectArrsAll)===null||_n===void 0||((si=_n[0])===null||si===void 0))?void 0:si.difficult_settings))}if(Qn(!((Fi=me.actionTabs)!==null&&Fi!==void 0&&(Bn=Fi.selectArrsAll)!==null&&Bn!==void 0&&(gn=Bn[0])!==null&&gn!==void 0&&gn.send_type)),lr(),me.actionTabs.type===2){var Ce,Te=(Ce=me.actionTabs.selectArrsAll)===null||Ce===void 0?void 0:Ce[0];Q(Te.unified_setting)}}},[me.actionTabs]),Object(y.useEffect)(function(){if(er){if(pr)return;Be({type:"classroomList/setActionTabs",payload:{}}),Object(E.c)()?(Be({type:"classroomList/getClassroomTeacherCommonList",payload:Object(a.a)(Object(a.a)({},me.actionTabs.params),{},{type:1})}),Be({type:"shixunHomeworks/getWorkList",payload:Object(a.a)({},En)})):Be({type:"classroomList/getClassroomCommonList",payload:Object(a.a)({},me.actionTabs.params)})}},[er]);var lr=function(){var Ai=Object(o.a)(_.a.mark(function wi(ir){var Fi,Bn;return _.a.wrap(function(Tn){for(;;)switch(Tn.prev=Tn.next){case 0:return hi(!0),Tn.next=3,Object(B.D)(Object(a.a)(Object(a.a)({},En),{},{page:ir||ce,limit:2e4,homework_id:me.actionTabs.type===1?"":me.actionTabs.selectArrs[0]}));case 3:Fi=Tn.sent,Fi==null||Fi.course_groups.map(function(_n,si){_n.key=_n.id,_n.title=_n.name,_n.disabled=_n.is_published}),Fi&&(rn(Object(n.a)(Fi==null?void 0:Fi.course_groups)),Xt(Fi==null?void 0:Fi.course_groups_count),hi(!1),ir||gt.setFieldsValue((Bn={},Object(u.a)(Bn,"publish_time",v()(v()(new Date).add(0,"days").format("YYYY-MM-DD HH:mm"))),Object(u.a)(Bn,"end_time",v()(v()(new Date(Object(U.b)("/"))).add(7,"days").format("YYYY-MM-DD HH:mm"))),Bn)));case 6:case"end":return Tn.stop()}},wi)}));return function(ir){return Ai.apply(this,arguments)}}(),ar=function(){Object(E.c)()?me.actionTabs.detail?(Be({type:"shixunHomeworks/setActionTabs",payload:{}}),Be({type:"shixunHomeworks/getWorkList",payload:Object(a.a)({},En)}),Be({type:"shixunHomeworks/getWorkSetting",payload:Object(a.a)({},En)})):Be({type:"classroomList/getClassroomTeacherCommonList",payload:Object(a.a)(Object(a.a)({},me.actionTabs.params),{},{type:5})}):Be({type:"classroomList/getClassroomCommonList",payload:Object(a.a)({},me.actionTabs.params)})},Ki=function(){var Ai=Object(o.a)(_.a.mark(function wi(){var ir,Fi,Bn,gn;return _.a.wrap(function(_n){for(;;)switch(_n.prev=_n.next){case 0:if(Fi=Object(a.a)({},gt.getFieldsValue()),!(Fi.end_time<=Fi.publish_time)){_n.next=4;break}return r.b.info("\u622A\u6B62\u65F6\u95F4\u4E0D\u80FD\u5927\u4E8E\u6216\u7B49\u4E8E\u53D1\u5E03\u65F6\u95F4"),_n.abrupt("return");case 4:if(!((X==null?void 0:X.length)<=0&&!ne&&Yt.length>0)){_n.next=7;break}return r.b.info("\u53D1\u5E03\u73ED\u7EA7\u4E0D\u80FD\u4E3A\u7A7A"),_n.abrupt("return");case 7:if(!(qn.reduce(function(si,ai){return si+ai})===0&&!kn)){_n.next=10;break}return r.b.info("\u7B80\u5355\u9002\u4E2D\u56F0\u96BE\u9898\u6570\u76F8\u52A0\u4E0D\u80FD\u4E3A0"),_n.abrupt("return");case 10:return Bn={homework_ids:Object(n.a)(me.actionTabs.selectArrs),group_ids:X.length>0?X.map(function(si){return si.id}):(ir=me.detailCommonHomeworksList)===null||ir===void 0?void 0:ir.course_groups,end_time:v()(Fi.end_time).format("YYYY-MM-DD HH:mm"),publish_time:v()(Fi.publish_time).format("YYYY-MM-DD HH:mm"),difficult_settings:qn==null?void 0:qn.map(function(si){return si}),send_type:kn?"0":"1",unified_setting:!X.length},_n.next=13,Object(p.a)("/api/courses/".concat(En.coursesId,"/homework_commons/publish_with_homework_list_position.json"),{method:"post",body:Object(a.a)({},Bn)});case 13:gn=_n.sent,gn.status===0&&(Object(U.cb)(["\u6559\u5B66\u8BFE\u5802","\u56FE\u6587\u4F5C\u4E1A","\u7ACB\u5373\u53D1\u5E03"]),r.b.success("\u53D1\u5E03\u6210\u529F"),Be({type:"classroomList/setActionTabs",payload:{key:"\u6E05\u9664\u9009\u62E9\u6570\u636E"}}),Jt.onCallback&&Jt.onCallback(),ar(),localStorage.getItem("Noviceguide")==="0"||Be({type:"shixunHomeworks/setActionTabs",payload:{key:"\u5E95\u90E8\u5F39\u7A97",type:13,text:h.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 15:case"end":return _n.stop()}},wi)}));return function(){return Ai.apply(this,arguments)}}(),Pr=function(){Re(1),rn([]),S([])},Vr=xt>ce*ci;return h.a.createElement(Y.a,{width:600,centered:!0,title:"\u53D1\u5E03\u4F5C\u4E1A",visible:me.actionTabs.key==="\u7ACB\u5373\u53D1\u5E03",okText:"\u53D1\u5E03\u4F5C\u4E1A",cancelText:"\u6682\u4E0D\u53D1\u5E03",onOk:Ki,onCancel:function(){Pr(),ar(),Be({type:"classroomList/setActionTabs",payload:{}})}},h.a.createElement("p",{className:"tc"},"\u5B66\u751F\u5C06\u7ACB\u5373\u6536\u5230\u4F5C\u4E1A",h.a.createElement("br",null),'\u672C\u64CD\u4F5C\u53EA\u5BF9"\u672A\u53D1\u5E03"\u7684\u4F5C\u4E1A\u6709\u6548'),Yt&&h.a.createElement(w.a,{form:gt},h.a.createElement("div",{style:{paddingLeft:0}},me.actionTabs.type===2&&h.a.createElement(m.a,{style:{marginBottom:"10px"}},h.a.createElement("span",{className:"mr5"},"\u8BD5\u9898\u53D1\u9001:"),h.a.createElement(d.a.Group,{value:kn,disabled:!((Ie=me.actionTabs)!==null&&Ie!==void 0&&(Je=Ie.selectArrsAll)!==null&&Je!==void 0&&(Ke=Je[0])!==null&&Ke!==void 0&&Ke.can_publish),onChange:function(wi){Qn(wi.target.value)}},h.a.createElement(d.a,{value:!0},"\u5168\u90E8\u56FA\u5B9A\u8BD5\u9898"),h.a.createElement(d.a,{className:"ml20",value:!1},"\u968F\u673A\u62BD\u53D6"))),!kn&&h.a.createElement(m.a,{style:{marginBottom:"10px"}},h.a.createElement("span",{style:{marginRight:65}}),h.a.createElement("span",null,"\u7B80\u5355\u9898\u6570 ",h.a.createElement(D.a,{value:qn[0],onChange:function(wi){qn[0]=wi,Li(Object(n.a)(qn))},min:0,disabled:!((be=me.actionTabs)!==null&&be!==void 0&&(de=be.selectArrsAll)!==null&&de!==void 0&&(nt=de[0])!==null&&nt!==void 0&&nt.can_publish),placeholder:"\u6700\u5927".concat((Kt=me.actionTabs)===null||Kt===void 0||((jt=Kt.selectArrsAll)===null||jt===void 0||((wt=jt[0])===null||wt===void 0||((ze=wt.difficult_count)===null||ze===void 0)))?void 0:ze[0]),max:(ft=me.actionTabs)===null||ft===void 0||((dt=ft.selectArrsAll)===null||dt===void 0||((Nt=dt[0])===null||Nt===void 0||((Ze=Nt.difficult_count)===null||Ze===void 0)))?void 0:Ze[0],style:{width:60}})),h.a.createElement("span",{style:{margin:"0px 40px"}},"\u9002\u4E2D\u9898\u6570 ",h.a.createElement(D.a,{value:qn[1],onChange:function(wi){qn[1]=wi,Li(Object(n.a)(qn))},min:0,disabled:!((Bt=me.actionTabs)!==null&&Bt!==void 0&&(Ut=Bt.selectArrsAll)!==null&&Ut!==void 0&&(Mt=Ut[0])!==null&&Mt!==void 0&&Mt.can_publish),max:(An=me.actionTabs)===null||An===void 0||((mn=An.selectArrsAll)===null||mn===void 0||((pn=mn[0])===null||pn===void 0||((tt=pn.difficult_count)===null||tt===void 0)))?void 0:tt[1],placeholder:"\u6700\u5927".concat((fn=me.actionTabs)===null||fn===void 0||((In=fn.selectArrsAll)===null||In===void 0||((He=In[0])===null||He===void 0||((Ue=He.difficult_count)===null||Ue===void 0)))?void 0:Ue[1]),style:{width:60}})),h.a.createElement("span",null,"\u56F0\u96BE\u9898\u6570 ",h.a.createElement(D.a,{value:qn[2],onChange:function(wi){qn[2]=wi,Li(Object(n.a)(qn))},min:0,disabled:!((pt=me.actionTabs)!==null&&pt!==void 0&&(Ct=pt.selectArrsAll)!==null&&Ct!==void 0&&(Ge=Ct[0])!==null&&Ge!==void 0&&Ge.can_publish),placeholder:"\u6700\u5927".concat((vt=me.actionTabs)===null||vt===void 0||((Ae=vt.selectArrsAll)===null||Ae===void 0||((ge=Ae[0])===null||ge===void 0||((Ee=ge.difficult_count)===null||Ee===void 0)))?void 0:Ee[2]),max:(ae=me.actionTabs)===null||ae===void 0||((re=ae.selectArrsAll)===null||re===void 0||((he=re[0])===null||he===void 0||((ve=he.difficult_count)===null||ve===void 0)))?void 0:ve[2],style:{width:60}}))),h.a.createElement(m.a,{className:"mt30",align:"middle"},h.a.createElement(M.a,null,h.a.createElement(w.a.Item,{name:"publish_time",label:"\u53D1\u5E03\u65F6\u95F4"},h.a.createElement(P.a,{style:{width:155,marginRight:"25px"},getPopupContainer:function(wi){return wi.parentNode},disabledDate:function(wi){return Object(T.b)(wi,Tt)},disabledTime:function(wi){return Object(T.c)(wi)},placeholder:"\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:v()(Object(U.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",allowClear:!1}))),h.a.createElement(M.a,{className:"ml20"},h.a.createElement(w.a.Item,{name:"end_time",label:"\u622A\u6B62\u65F6\u95F4"},h.a.createElement(P.a,{style:{width:170},getPopupContainer:function(wi){return wi.parentNode},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:v()(Object(U.d)(),"HH:mm")},disabledDate:function(wi){return Object(T.b)(wi,Tt,gt.getFieldValue("publish_time"))},disabledTime:function(wi){return Object(T.c)(wi,gt.getFieldValue("publish_time"))},format:"YYYY-MM-DD HH:mm",allowClear:!1})))),me.actionTabs.type===2&&h.a.createElement(m.a,{style:{marginBottom:"10px"}},h.a.createElement("span",{className:"mr5"},"\u53D1\u5E03\u8BBE\u7F6E:"),h.a.createElement(d.a.Group,{value:ne,onChange:function(wi){Q(wi.target.value),S([])}},h.a.createElement(d.a,{value:!0},"\u7EDF\u4E00\u53D1\u5E03"),h.a.createElement(d.a,{className:"ml20",disabled:Yt.length<=0,value:!1},"\u5206\u73ED\u53D1\u5E03"))),Yt.length<=0&&me.actionTabs.type===2&&h.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"')),(me.actionTabs.type===1||!ne)&&Yt.length>0&&h.a.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"10px"}},h.a.createElement("span",{style:{flex:1}},h.a.createElement(K.a,{checked:X.length===Yt.length,onChange:function(wi){X.length===Yt.length?S([]):S(Yt.filter(function(ir){return!ir.is_published}))}},"\u5168\u9009")," "),h.a.createElement("span",{style:{width:16}}),h.a.createElement("span",{style:{flex:1}},"\u5DF2\u9009\u62E9",X.length||0,"\u4E2A\u5206\u73ED")),(me.actionTabs.type===1||!ne)&&Yt.length>0&&h.a.createElement(G.a,{data:Yt,selectedRowKeys:X,setSelectedRowKeys:S})))};Qe.a=Object(z.a)(function(Z){var oe=Z.classroomList;return{classroomList:oe}})(V)},Y1PL:function(tn,Qe,I){"use strict";I.r(Qe),I.d(Qe,"ResizableTextArea",function(){return oe});var te=I("wx14"),Y=I("1OyB"),N=I("vuIU"),K=I("Ji7U"),A=I("LK+K"),M=I("q1tI"),H=I("VTBJ"),P=I("rePB"),k=I("Zm9Q"),D=I("Kwbf"),b=I("c+Xe"),m=I("m+aA"),f=I("bdgK"),d=new Map;function s(xe){xe.forEach(function(Ie){var Je,Ke=Ie.target;(Je=d.get(Ke))===null||Je===void 0||Je.forEach(function(be){return be(Ke)})})}var r=new f.default(s),u=null,o=null;function a(xe,Ie){d.has(xe)||(d.set(xe,new Set),r.observe(xe)),d.get(xe).add(Ie)}function n(xe,Ie){d.has(xe)&&(d.get(xe).delete(Ie),d.get(xe).size||(r.unobserve(xe),d.delete(xe)))}var R=function(xe){Object(K.a)(Je,xe);var Ie=Object(A.a)(Je);function Je(){return Object(Y.a)(this,Je),Ie.apply(this,arguments)}return Object(N.a)(Je,[{key:"render",value:function(){return this.props.children}}]),Je}(M.Component),w=M.createContext(null);function x(xe){var Ie=xe.children,Je=xe.onBatchResize,Ke=M.useRef(0),be=M.useRef([]),de=M.useContext(w),nt=M.useCallback(function(Kt,jt,wt){Ke.current+=1;var ze=Ke.current;be.current.push({size:Kt,element:jt,data:wt}),Promise.resolve().then(function(){ze===Ke.current&&(Je==null||Je(be.current),be.current=[])}),de==null||de(Kt,jt,wt)},[Je,de]);return M.createElement(w.Provider,{value:nt},Ie)}function O(xe){var Ie=xe.children,Je=xe.disabled,Ke=M.useRef(null),be=M.useRef(null),de=M.useContext(w),nt=M.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Kt=M.isValidElement(Ie)&&Object(b.c)(Ie),jt=Kt?Ie.ref:null,wt=M.useMemo(function(){return Object(b.a)(jt,Ke)},[jt,Ke]),ze=M.useRef(xe);ze.current=xe;var ft=M.useCallback(function(dt){var Nt=ze.current,Ze=Nt.onResize,Bt=Nt.data,Ut=dt.getBoundingClientRect(),Mt=Ut.width,An=Ut.height,mn=dt.offsetWidth,pn=dt.offsetHeight,tt=Math.floor(Mt),fn=Math.floor(An);if(nt.current.width!==tt||nt.current.height!==fn||nt.current.offsetWidth!==mn||nt.current.offsetHeight!==pn){var In={width:tt,height:fn,offsetWidth:mn,offsetHeight:pn};nt.current=In;var He=mn===Math.round(Mt)?Mt:mn,Ue=pn===Math.round(An)?An:pn,pt=Object(H.a)(Object(H.a)({},In),{},{offsetWidth:He,offsetHeight:Ue});de==null||de(pt,dt,Bt),Ze&&Promise.resolve().then(function(){Ze(pt,dt)})}},[]);return M.useEffect(function(){var dt=Object(m.a)(Ke.current)||Object(m.a)(be.current);return dt&&!Je&&a(dt,ft),function(){return n(dt,ft)}},[Ke.current,Je]),M.createElement(R,{ref:be},Kt?M.cloneElement(Ie,{ref:wt}):Ie)}var C="rc-observer-key";function _(xe){var Ie=xe.children,Je=Object(k.a)(Ie);return Je.map(function(Ke,be){var de=(Ke==null?void 0:Ke.key)||"".concat(C,"-").concat(be);return M.createElement(O,Object(te.a)({},xe,{key:de}),Ke)})}_.Collection=x;var y=_,h=I("bT9E"),c=I("TSYQ"),v=I.n(c),p=`
|
|
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
|
|
`,E=["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"],U={},F;function z(xe){var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Je=xe.getAttribute("id")||xe.getAttribute("data-reactid")||xe.getAttribute("name");if(Ie&&U[Je])return U[Je];var Ke=window.getComputedStyle(xe),be=Ke.getPropertyValue("box-sizing")||Ke.getPropertyValue("-moz-box-sizing")||Ke.getPropertyValue("-webkit-box-sizing"),de=parseFloat(Ke.getPropertyValue("padding-bottom"))+parseFloat(Ke.getPropertyValue("padding-top")),nt=parseFloat(Ke.getPropertyValue("border-bottom-width"))+parseFloat(Ke.getPropertyValue("border-top-width")),Kt=E.map(function(wt){return"".concat(wt,":").concat(Ke.getPropertyValue(wt))}).join(";"),jt={sizingStyle:Kt,paddingSize:de,borderSize:nt,boxSizing:be};return Ie&&Je&&(U[Je]=jt),jt}function G(xe){var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Je=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Ke=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;F||(F=document.createElement("textarea"),F.setAttribute("tab-index","-1"),F.setAttribute("aria-hidden","true"),document.body.appendChild(F)),xe.getAttribute("wrap")?F.setAttribute("wrap",xe.getAttribute("wrap")):F.removeAttribute("wrap");var be=z(xe,Ie),de=be.paddingSize,nt=be.borderSize,Kt=be.boxSizing,jt=be.sizingStyle;F.setAttribute("style","".concat(jt,";").concat(p)),F.value=xe.value||xe.placeholder||"";var wt=Number.MIN_SAFE_INTEGER,ze=Number.MAX_SAFE_INTEGER,ft=F.scrollHeight,dt;if(Kt==="border-box"?ft+=nt:Kt==="content-box"&&(ft-=de),Je!==null||Ke!==null){F.value=" ";var Nt=F.scrollHeight-de;Je!==null&&(wt=Nt*Je,Kt==="border-box"&&(wt=wt+de+nt),ft=Math.max(wt,ft)),Ke!==null&&(ze=Nt*Ke,Kt==="border-box"&&(ze=ze+de+nt),dt=ft>ze?"":"hidden",ft=Math.min(ze,ft))}return{height:ft,minHeight:wt,maxHeight:ze,overflowY:dt,resize:"none"}}var B=I("Gytx"),T=I.n(B),V;(function(xe){xe[xe.NONE=0]="NONE",xe[xe.RESIZING=1]="RESIZING",xe[xe.RESIZED=2]="RESIZED"})(V||(V={}));var Z=function(xe){Object(K.a)(Je,xe);var Ie=Object(A.a)(Je);function Je(Ke){var be;return Object(Y.a)(this,Je),be=Ie.call(this,Ke),be.nextFrameActionId=void 0,be.resizeFrameId=void 0,be.textArea=void 0,be.saveTextArea=function(de){be.textArea=de},be.handleResize=function(de){var nt=be.state.resizeStatus,Kt=be.props,jt=Kt.autoSize,wt=Kt.onResize;if(nt!==V.NONE)return;typeof wt=="function"&&wt(de),jt&&be.resizeOnNextFrame()},be.resizeOnNextFrame=function(){cancelAnimationFrame(be.nextFrameActionId),be.nextFrameActionId=requestAnimationFrame(be.resizeTextarea)},be.resizeTextarea=function(){var de=be.props.autoSize;if(!de||!be.textArea)return;var nt=de.minRows,Kt=de.maxRows,jt=G(be.textArea,!1,nt,Kt);be.setState({textareaStyles:jt,resizeStatus:V.RESIZING},function(){cancelAnimationFrame(be.resizeFrameId),be.resizeFrameId=requestAnimationFrame(function(){be.setState({resizeStatus:V.RESIZED},function(){be.resizeFrameId=requestAnimationFrame(function(){be.setState({resizeStatus:V.NONE}),be.fixFirefoxAutoScroll()})})})})},be.renderTextArea=function(){var de=be.props,nt=de.prefixCls,Kt=nt===void 0?"rc-textarea":nt,jt=de.autoSize,wt=de.onResize,ze=de.className,ft=de.disabled,dt=be.state,Nt=dt.textareaStyles,Ze=dt.resizeStatus,Bt=Object(h.a)(be.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ut=v()(Kt,ze,Object(P.a)({},"".concat(Kt,"-disabled"),ft));"value"in Bt&&(Bt.value=Bt.value||"");var Mt=Object(H.a)(Object(H.a)(Object(H.a)({},be.props.style),Nt),Ze===V.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return M.createElement(y,{onResize:be.handleResize,disabled:!(jt||wt)},M.createElement("textarea",Object(te.a)({},Bt,{className:Ut,style:Mt,ref:be.saveTextArea})))},be.state={textareaStyles:{},resizeStatus:V.NONE},be}return Object(N.a)(Je,[{key:"componentDidUpdate",value:function(be){(be.value!==this.props.value||!T()(be.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var be=this.textArea.selectionStart,de=this.textArea.selectionEnd;this.textArea.setSelectionRange(be,de)}}catch(nt){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Je}(M.Component),oe=Z,pe=function(xe){Object(K.a)(Je,xe);var Ie=Object(A.a)(Je);function Je(Ke){var be;Object(Y.a)(this,Je),be=Ie.call(this,Ke),be.resizableTextArea=void 0,be.focus=function(){be.resizableTextArea.textArea.focus()},be.saveTextArea=function(nt){be.resizableTextArea=nt},be.handleChange=function(nt){var Kt=be.props.onChange;be.setValue(nt.target.value,function(){be.resizableTextArea.resizeTextarea()}),Kt&&Kt(nt)},be.handleKeyDown=function(nt){var Kt=be.props,jt=Kt.onPressEnter,wt=Kt.onKeyDown;nt.keyCode===13&&jt&&jt(nt),wt&&wt(nt)};var de=typeof Ke.value=="undefined"||Ke.value===null?Ke.defaultValue:Ke.value;return be.state={value:de},be}return Object(N.a)(Je,[{key:"setValue",value:function(be,de){"value"in this.props||this.setState({value:be},de)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return M.createElement(oe,Object(te.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(be){return"value"in be?{value:be.value}:null}}]),Je}(M.Component),Ye=Qe.default=pe},ZW9T:function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return G});var te=I("k1fw"),Y=I("miYZ"),N=I("tsqr"),K=I("rAM+"),A=I("tJVT"),M=I("PpiC"),H=I("q1tI"),P=I.n(H),k=I("bdgK"),D=I("oBTY"),b=I("9og8"),m=I("WmNS"),f=I.n(m),d={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"]},s={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"]},r={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(`
|
|
`)}]},u={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(`
|
|
`)}]},o=I("5VLF"),a=I.n(o),n={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(T,V){return V.map(function(Z){return{label:Z,kind:T.languages.CompletionItemKind.Keyword,insertText:Z}})},w=function(T){return Object.keys(n.tables).map(function(V){return{label:V,kind:T.languages.CompletionItemKind.Variable,insertText:V}})},x=function(T,V){var Z=n.tables[T];return Z?Z.map(function(oe){return{label:oe,kind:V.languages.CompletionItemKind.Field,insertText:oe}}):[]};function O(B,T,V,Z,oe){var pe=T.getWordUntilPosition(V),Ye={startLineNumber:V.lineNumber,endLineNumber:V.lineNumber,startColumn:pe.startColumn,endColumn:pe.endColumn},xe=Z.map(function(Ie){return{label:Ie,kind:B.languages.CompletionItemKind.Keyword,insertText:Ie,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ye}});return oe.map(function(Ie){xe.push(Object(te.a)(Object(te.a)({},Ie),{},{range:Ye}))}),xe}var C=function(B){n.languages.map(function(oe){return B.languages.registerDocumentFormattingEditProvider(oe,{provideDocumentFormattingEdits:function(Ye,xe,Ie){return Object(b.a)(f.a.mark(function Je(){var Ke;return f.a.wrap(function(de){for(;;)switch(de.prev=de.next){case 0:return Ke=a()(Ye.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}),de.abrupt("return",[{range:Ye.getFullModelRange(),text:Ke}]);case 2:case"end":return de.stop()}},Je)}))()}}),oe});var T=r.quickKey.map(function(oe){return{label:oe.label,kind:B.languages.CompletionItemKind.Method,insertText:oe.content,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),V=u.quickKey.map(function(oe){return{label:oe.label,kind:B.languages.CompletionItemKind.Method,insertText:oe.content,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),Z=s.quickKey.map(function(oe){return{label:oe.label,kind:B.languages.CompletionItemKind.Method,insertText:oe.content,insertTextRules:B.languages.CompletionItemInsertTextRule.InsertAsSnippet}});B.languages.registerCompletionItemProvider("cpp",{triggerCharacters:["."," ","#"].concat(Object(D.a)(r.keywords),Object(D.a)(r.quickKey.map(function(oe){return oe.label}))),provideCompletionItems:function(pe,Ye){var xe=pe.getValueInRange({startLineNumber:Ye.lineNumber,startColumn:1,endLineNumber:Ye.lineNumber,endColumn:Ye.column}),Ie=xe.match(/cu/gim);console.log("match:",Ie,Ye,xe,pe);var Je=[],Ke=Ye.lineNumber,be=Ye.column,de=pe.getValueInRange({startLineNumber:Ke,startColumn:0,endLineNumber:Ke,endColumn:be}),nt=de.trim().split(/\s+/),Kt=nt[nt.length-1];if(Kt.endsWith(".")){var jt=Kt.slice(0,Kt.length-1);Object.keys(n.tables).includes(jt)&&(Je=Object(D.a)(x(jt,B)))}else Kt==="."?Je=[]:Je=[].concat(Object(D.a)(w(B)),Object(D.a)(R(B,r.keywords)),Object(D.a)(T));return{suggestions:Je}}}),B.languages.registerCompletionItemProvider("c",{triggerCharacters:["."," ","#"].concat(Object(D.a)(d.keywords)),provideCompletionItems:function(pe,Ye){var xe=pe.getValueInRange({startLineNumber:Ye.lineNumber,startColumn:1,endLineNumber:Ye.lineNumber,endColumn:Ye.column}),Ie=xe.match(/cu/gim);console.log("match:",Ie,Ye,xe,pe);var Je=[],Ke=Ye.lineNumber,be=Ye.column,de=pe.getValueInRange({startLineNumber:Ke,startColumn:0,endLineNumber:Ke,endColumn:be}),nt=de.trim().split(/\s+/),Kt=nt[nt.length-1];if(Kt.endsWith(".")){var jt=Kt.slice(0,Kt.length-1);Object.keys(n.tables).includes(jt)&&(Je=Object(D.a)(x(jt,B)))}else Kt==="."?Je=[]:Je=[].concat(Object(D.a)(w(B)),Object(D.a)(R(B,d.keywords)));return{suggestions:Je}}}),B.languages.registerCompletionItemProvider("java",{triggerCharacters:["."," "].concat(Object(D.a)(s.keywords)),provideCompletionItems:function(pe,Ye){var xe=[],Ie=Ye.lineNumber,Je=Ye.column,Ke=pe.getValueInRange({startLineNumber:Ie,startColumn:0,endLineNumber:Ie,endColumn:Je}),be=Ke.trim().split(/\s+/),de=be[be.length-1];if(de.endsWith(".")){var nt=de.slice(0,de.length-1);Object.keys(n.tables).includes(nt)&&(xe=Object(D.a)(x(nt,B)))}else de==="."?xe=[]:xe=[].concat(Object(D.a)(w(B)),Object(D.a)(R(B,s.keywords)),Object(D.a)(Z));return{suggestions:xe}}}),B.languages.registerCompletionItemProvider("python",{triggerCharacters:["."," "].concat(Object(D.a)(u.keywords)),provideCompletionItems:function(pe,Ye){var xe=[],Ie=Ye.lineNumber,Je=Ye.column,Ke=pe.getValueInRange({startLineNumber:Ie,startColumn:0,endLineNumber:Ie,endColumn:Je}),be=Ke.trim().split(/\s+/),de=be[be.length-1];if(de.endsWith(".")){var nt=de.slice(0,de.length-1);Object.keys(n.tables).includes(nt)&&(xe=Object(D.a)(x(nt,B)))}else de==="."?xe=[]:xe=[].concat(Object(D.a)(w(B)),Object(D.a)(R(B,u.keywords)),Object(D.a)(V));return{suggestions:xe}}})},_="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",y=I("LvDl"),h=I("+ua5");function c(B){return/^\d+$/.test(B)?"".concat(B,"px"):B}function v(){}var p=!1,E={"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 U(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],T=B;if(Array.isArray(B)){for(var V=0;V<B.length;V++){var Z=E[B[V]];if(Z)return Z}return T[0]}return E[T]||T}var F=null,z=Qe.b=function(B){var T=B.width,V=T===void 0?"100%":T,Z=B.height,oe=Z===void 0?"100%":Z,pe=B.value,Ye=B.language,xe=Ye===void 0?"javascript":Ye,Ie=B.style,Je=Ie===void 0?{}:Ie,Ke=B.options,be=Ke===void 0?{}:Ke,de=B.overrideServices,nt=de===void 0?{}:de,Kt=B.theme,jt=Kt===void 0?"vs-dark":Kt,wt=B.onEditBlur,ze=B.onSave,ft=B.autoHeight,dt=ft===void 0?!1:ft,Nt=B.forbidCopy,Ze=Nt===void 0?!1:Nt,Bt=B.onChange,Ut=Bt===void 0?v:Bt,Mt=B.editorDidMount,An=Mt===void 0?v:Mt,mn=B.onFocus,pn=mn===void 0?v:mn,tt=B.filename,fn=tt===void 0?"educoder.txt":tt,In=B.errorLine,He=B.errorContent,Ue=He===void 0?"":He,pt=Object(M.a)(B,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),Ct=Object(H.useRef)(),Ge=Object(H.useRef)({}),vt=Object(H.useRef)(),Ae=Object(H.useRef)(!1),ge=Object(H.useRef)(),Ee=Object(H.useState)(!1),ae=Object(A.a)(Ee,2),re=ae[0],he=ae[1];function ve(){var _e;return Ct.current&&(_e=new k.default(function(Ne){var xt=Object(K.a)(Ne),Xt;try{for(xt.s();!(Xt=xt.n()).done;){var vn=Xt.value;(vn.target.offsetHeight>0||vn.target.offsetWidth>0)&&Ge.current.instance.layout()}}catch(Mn){xt.e(Mn)}finally{xt.f()}}),_e.observe(Ct.current)),_e}function me(){N.b.warn(decodeURIComponent(_))}var Be=function(){var Ne=Ge.current.instance;if(pe!=null&&Ne&&re){var xt=Ne.getModel();xt&&pe!==xt.getValue()&&(p=!0,xt.setValue(pe),Ne.layout(),p=!1)}};Object(H.useEffect)(function(){vt.current&&clearTimeout(vt.current),vt.current=setTimeout(function(){Be()},500)},[pe,re,Ge.current]),Object(H.useEffect)(function(){if(In&&Ge.current&&Ge.current.instance){var _e=Ge.current.instance;_e.changeViewZones(function(xt){var Xt=document.createElement("div");Xt.style.padding="10px 20px",Xt.style.width="calc(100% - 20px)",Xt.className="my-error-line-wrp",Xt.innerHTML=Ue,xt.addZone({afterLineNumber:In||11,heightInLines:3,domNode:Xt})});var Ne={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}};_e.addOverlayWidget(Ne),_e.revealPositionInCenter({lineNumber:20,column:1})}},[In,Ge.current,re]);function Tt(){var _e=Ge.current.instance;if(_e){var Ne=_e.getSelection(),xt=Ge.current.pastePos||{},Xt=new F.Range(xt.startLineNumber||Ne.endLineNumber,xt.startColumn||Ne.endColumn,xt.endLineNumber||Ne.endLineNumber,xt.endColumn||Ne.endColumn);setTimeout(function(){_e.executeEdits("",[{range:Xt,text:""}])},300)}}function Jt(_e){(window.navigator.platform.match("Mac")?_e.metaKey:_e.ctrlKey)&&_e.keyCode==83&&(_e.preventDefault(),ze())}var En=function(){if(dt&&Ge.current.instance){var Ne=Ge.current.instance.getContentHeight();Yt(Ne<oe?oe:Ne)}else Yt(oe)};function mt(_e){var Ne=document.createEvent("MouseEvents");Ne.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),_e.dispatchEvent(Ne)}function Qt(_e,Ne){var xt=window.URL||window.webkitURL||window,Xt=new Blob([Ne]),vn=document.createElementNS("http://www.w3.org/1999/xhtml","a");vn.href=xt.createObjectURL(Xt),vn.download=_e,mt(vn)}Object(H.useEffect)(function(){En()},[En]),Object(H.useEffect)(function(){Ct.current&&!re&&I.e(27).then(I.t.bind(null,"M/lh",7)).then(function(_e){try{F=_e,Ge.current.instance=F.editor.create(Ct.current,{value:pe,language:U(xe),theme:jt,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},nt);var Ne=Ge.current.instance;if(An(Ne,F),setTimeout(function(){En(),Ge.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Qt(fn||"educoder.txt",Ne.getValue())}})},500),Ge.current.subscription=Ne.onDidChangeModelContent(function(Xt){Ae.current?clearTimeout(ge.current):(En(),Ut(Ne.getValue(),Xt)),ge.current=setTimeout(function(){Ae.current=!1},500)}),window.Monaco||C(F),Ze&&(Ne.addCommand(F.KeyMod.CtrlCmd|F.KeyMod.Shift|F.KeyCode.KEY_V,function(){return me(),null}),Ne.addCommand(F.KeyMod.CtrlCmd|F.KeyCode.KEY_C,function(){return me(),null})),window.Monaco=F,wt&&Ne.onDidBlurEditorWidget(function(){wt(Ne.getValue())}),pn&&Ne.onDidFocusEditorText(function(){pn(Ne.getValue())}),Ze){Ne.addCommand(F.KeyMod.CtrlCmd|F.KeyCode.KEY_V,function(){return me(),null}),Ne.onDidPaste(function(Xt){Ge.current.pastePos=Xt});try{window.addEventListener("paste",Tt)}catch(Xt){}}var xt=ve();return he(!0),function(){var Xt=Ge.current.instance;Xt.dispose();var vn=Xt.getModel();vn&&vn.dispose(),Ge.current.subscription&&Ge.current.subscription.dispose(),Ze&&window.removeEventListener("paste",Tt),xt.unobserve(Ct.current)}}catch(Xt){}})},[]),Object(H.useEffect)(function(){var _e=Ge.current.instance;if(_e&&re)return document.addEventListener("keydown",Jt,!1),function(){document.removeEventListener("keydown",Jt)}},[ze,re]),Object(H.useEffect)(function(){var _e=Ge.current.instance;if(_e&&re){var Ne=U(xe);F.editor.setModelLanguage(_e.getModel(),Ne),console.log("language:",xe,_e.getModel(),Ne)}},[xe,re]),Object(H.useEffect)(function(){var _e=Ge.current.instance;_e&&re&&F.editor.setTheme(jt)},[jt,re]),Object(H.useEffect)(function(){var _e=Ge.current.instance;_e&&re&&(_e.updateOptions(Object(te.a)({},be)),setTimeout(function(){_e.getModel().updateOptions(Object(te.a)({},be))},200))},[JSON.stringify(be),re]),Object(H.useEffect)(function(){var _e=Ge.current.instance;_e&&re&&_e.layout()},[V,oe,re]);var gt=Object(H.useState)(c(V)),yt=Object(A.a)(gt,2),rt=yt[0],ce=yt[1],Re=Object(H.useState)(c(oe)),At=Object(A.a)(Re,2),ot=At[0],Yt=At[1],rn=Object(te.a)(Object(te.a)({},Je),{},{width:rt,height:ot});return P.a.createElement("div",{className:"my-monaco-editor",ref:Ct,style:rn})};function G(B){var T=B.width,V=T===void 0?"100%":T,Z=B.height,oe=Z===void 0?"100%":Z,pe=B.original,Ye=B.modified,xe=B.language,Ie=B.options,Je=Ie===void 0?{}:Ie,Ke=Object(H.useRef)(),be=Object(H.useState)(null),de=Object(A.a)(be,2),nt=de[0],Kt=de[1];function jt(dt){var Nt;return Ke.current&&(Nt=new k.default(function(Ze){var Bt=Object(K.a)(Ze),Ut;try{for(Bt.s();!(Ut=Bt.n()).done;){var Mt=Ut.value;(Mt.target.offsetHeight>0||Mt.target.offsetWidth>0)&&dt.layout()}}catch(An){Bt.e(An)}finally{Bt.f()}}),Nt.observe(Ke.current)),Nt}Object(H.useEffect)(function(){Ke.current&&I.e(27).then(I.t.bind(null,"M/lh",7)).then(function(dt){F=dt;var Nt=F.editor.createDiffEditor(Ke.current,Object(te.a)(Object(te.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},Je),{},{wordWrap:!0}));Kt(Nt);var Ze=jt(Nt);return function(){Nt.dispose();var Bt=Nt.getModel();Bt&&Bt.dispose(),Ze.unobserve(Ke.current)}})},[]),Object(H.useEffect)(function(){nt&&nt.setModel({original:F.editor.createModel(pe,xe),modified:F.editor.createModel(Ye,xe)})},[pe,Ye,xe,nt]);var wt=c(V),ze=c(oe),ft={width:wt,height:ze};return P.a.createElement("div",{className:"my-diff-editor",ref:Ke,style:ft})}},ZpRC:function(tn,Qe,I){"use strict";function te(b){return typeof b=="object"&&b!=null&&b.nodeType===1}function Y(b,m){return(!m||b!=="hidden")&&b!=="visible"&&b!=="clip"}function N(b,m){if(b.clientHeight<b.scrollHeight||b.clientWidth<b.scrollWidth){var f=getComputedStyle(b,null);return Y(f.overflowY,m)||Y(f.overflowX,m)||function(d){var s=function(r){if(!r.ownerDocument||!r.ownerDocument.defaultView)return null;try{return r.ownerDocument.defaultView.frameElement}catch(u){return null}}(d);return!!s&&(s.clientHeight<d.scrollHeight||s.clientWidth<d.scrollWidth)}(b)}return!1}function K(b,m,f,d,s,r,u,o){return r<b&&u>m||r>b&&u<m?0:r<=b&&o<=f||u>=m&&o>=f?r-b-d:u>m&&o<f||r<b&&o>f?u-m+s:0}var A=function(b,m){var f=window,d=m.scrollMode,s=m.block,r=m.inline,u=m.boundary,o=m.skipOverflowHiddenElements,a=typeof u=="function"?u:function(Nt){return Nt!==u};if(!te(b))throw new TypeError("Invalid target");for(var n=document.scrollingElement||document.documentElement,R=[],w=b;te(w)&&a(w);){if((w=w.parentElement)===n){R.push(w);break}w!=null&&w===document.body&&N(w)&&!N(document.documentElement)||w!=null&&N(w,o)&&R.push(w)}for(var x=f.visualViewport?f.visualViewport.width:innerWidth,O=f.visualViewport?f.visualViewport.height:innerHeight,C=window.scrollX||pageXOffset,_=window.scrollY||pageYOffset,y=b.getBoundingClientRect(),h=y.height,c=y.width,v=y.top,p=y.right,E=y.bottom,U=y.left,F=s==="start"||s==="nearest"?v:s==="end"?E:v+h/2,z=r==="center"?U+c/2:r==="end"?p:U,G=[],B=0;B<R.length;B++){var T=R[B],V=T.getBoundingClientRect(),Z=V.height,oe=V.width,pe=V.top,Ye=V.right,xe=V.bottom,Ie=V.left;if(d==="if-needed"&&v>=0&&U>=0&&E<=O&&p<=x&&v>=pe&&E<=xe&&U>=Ie&&p<=Ye)return G;var Je=getComputedStyle(T),Ke=parseInt(Je.borderLeftWidth,10),be=parseInt(Je.borderTopWidth,10),de=parseInt(Je.borderRightWidth,10),nt=parseInt(Je.borderBottomWidth,10),Kt=0,jt=0,wt="offsetWidth"in T?T.offsetWidth-T.clientWidth-Ke-de:0,ze="offsetHeight"in T?T.offsetHeight-T.clientHeight-be-nt:0;if(n===T)Kt=s==="start"?F:s==="end"?F-O:s==="nearest"?K(_,_+O,O,be,nt,_+F,_+F+h,h):F-O/2,jt=r==="start"?z:r==="center"?z-x/2:r==="end"?z-x:K(C,C+x,x,Ke,de,C+z,C+z+c,c),Kt=Math.max(0,Kt+_),jt=Math.max(0,jt+C);else{Kt=s==="start"?F-pe-be:s==="end"?F-xe+nt+ze:s==="nearest"?K(pe,xe,Z,be,nt+ze,F,F+h,h):F-(pe+Z/2)+ze/2,jt=r==="start"?z-Ie-Ke:r==="center"?z-(Ie+oe/2)+wt/2:r==="end"?z-Ye+de+wt:K(Ie,Ye,oe,Ke,de+wt,z,z+c,c);var ft=T.scrollLeft,dt=T.scrollTop;F+=dt-(Kt=Math.max(0,Math.min(dt+Kt,T.scrollHeight-Z+ze))),z+=ft-(jt=Math.max(0,Math.min(ft+jt,T.scrollWidth-oe+wt)))}G.push({el:T,top:Kt,left:jt})}return G};function M(b){return b===Object(b)&&Object.keys(b).length!==0}function H(b,m){m===void 0&&(m="auto");var f="scrollBehavior"in document.body.style;b.forEach(function(d){var s=d.el,r=d.top,u=d.left;s.scroll&&f?s.scroll({top:r,left:u,behavior:m}):(s.scrollTop=r,s.scrollLeft=u)})}function P(b){return b===!1?{block:"end",inline:"nearest"}:M(b)?b:{block:"start",inline:"nearest"}}function k(b,m){var f=!b.ownerDocument.documentElement.contains(b);if(M(m)&&typeof m.behavior=="function")return m.behavior(f?[]:A(b,m));if(f)return;var d=P(m);return H(A(b,d),d.behavior)}var D=Qe.a=k},bT9E:function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return Y});var te=I("VTBJ");function Y(N,K){var A=Object(te.a)({},N);return Array.isArray(K)&&K.forEach(function(M){delete A[M]}),A}},bTeP:function(tn,Qe,I){tn.exports={flex_box_center:"flex_box_center___14Ki3",flex_space_between:"flex_space_between___3TSad",flex_box_vertical_center:"flex_box_vertical_center___3pQXk",flex_box_center_end:"flex_box_center_end___29_cn",flex_box_column:"flex_box_column___16am0",title:"title___2mVJs",workListTabWrap:"workListTabWrap___1JlOB",workListTabButton:"workListTabButton___3umfp",tables:"tables___hLy6a",checkboxgroup:"checkboxgroup___2xMgu"}},biw7:function(tn,Qe,I){"use strict";var te=I("q1tI"),Y=I.n(te),N=te.createContext(null);Qe.a=N},c5Ni:function(tn,Qe,I){},deN7:function(tn,Qe,I){"use strict";var te=I("/zsF"),Y=I("PArb"),N=I("14J3"),K=I("BMrR"),A=I("jCWc"),M=I("kPKH"),H=I("+L6B"),P=I("2/Rp"),k=I("miYZ"),D=I("tsqr"),b=I("9og8"),m=I("giR+"),f=I("fyUT"),d=I("2qtc"),s=I("kLXV"),r=I("7Kak"),u=I("9yH6"),o=I("tJVT"),a=I("k1fw"),n=I("OaEy"),R=I("2fM7"),w=I("WmNS"),x=I.n(w),O=I("q1tI"),C=I.n(O),_=I("ZW9T"),y=I("F0VM"),h=I.n(y),c=I("xKgJ"),v=I("J66h"),p=I.n(v),E=I("ErOA"),U=I("Ty5D"),F=I("9Bee"),z=I("XYT7"),G=I("RCxd"),B=I("/MfK"),T=R.a.Option,V={selectOnLineNumbers:!0,readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,enableSplitViewResizing:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1},Z;(function(pe){pe[pe.SET_PATH=0]="SET_PATH",pe[pe.GET_PASSED_CONTENT=1]="GET_PASSED_CONTENT"})(Z||(Z={}));function oe(pe,Ye){switch(Ye.type){case Z.SET_PATH:return Object(a.a)(Object(a.a)({},pe),{},{selectedPath:Ye.payload});case Z.GET_PASSED_CONTENT:return Object(a.a)(Object(a.a)({},pe),{},{passedContent:Ye.payload});default:throw new Error}}Qe.a=function(pe){var Ye=pe.language,xe=pe.dispatch,Ie=pe.shixunWorkReport,Je=pe.v,Ke=pe.languages,be=pe.onPathChange,de=pe.autoHeight,nt=pe.diff_code_count,Kt=pe.data,jt=Object(O.useState)(Ke==null?void 0:Ke[0]),wt=Object(o.a)(jt,2),ze=wt[0],ft=wt[1],dt=Ie!="shixunWorkReport"&&Object(U.i)();return Object(O.useEffect)(function(){ft(Ke==null?void 0:Ke[0])},[]),Object(O.useEffect)(function(){var Nt;ft(Ke==null||((Nt=Ke.filter(function(Ze){return Ze.language===(ze==null?void 0:ze.language)}))===null||Nt===void 0)?void 0:Nt[0])},[Ke]),C.a.createElement(C.a.Fragment,null,C.a.createElement("h2",null," ",C.a.createElement("span",null,C.a.createElement("span",null,"\u6700\u540E\u901A\u5173\u7684\u4EE3\u7801"),(Ke==null?void 0:Ke.length)>1&&C.a.createElement(u.a.Group,{defaultValue:Ye,style:{marginLeft:10},onChange:function(Ze){var Bt;ft(Ke==null||((Bt=Ke.filter(function(Ut){return Ut.language===Ze.target.value}))===null||Bt===void 0)?void 0:Bt[0])}},Ke==null?void 0:Ke.map(function(Nt){return C.a.createElement(u.a,{value:Nt==null?void 0:Nt.language},Nt==null?void 0:Nt.language)}))),Object(c.c)()&&Ie!="shixunWorkReport"&&C.a.createElement("span",null,C.a.createElement("span",null,"\u5F97\u5206 ",ze==null?void 0:ze.score,"/",ze==null?void 0:ze.total_score),C.a.createElement(P.a,{style:{margin:"0px 10px"},onClick:function(){var Ze=ze==null?void 0:ze.score;s.a.confirm({title:"\u8C03\u5206",content:C.a.createElement("div",null,C.a.createElement("p",null,"\u5F97\u5206\uFF1A",ze==null?void 0:ze.score,"/",ze==null?void 0:ze.total_score),C.a.createElement("p",null,"\u8C03\u5206\uFF1A",C.a.createElement(f.a,{min:0,max:ze==null?void 0:ze.total_score,defaultValue:ze==null?void 0:ze.score,onChange:function(Ut){Ze=Ut}}))),okText:"\u786E\u8BA4",onOk:function(){var Bt=Object(b.a)(x.a.mark(function Mt(){var An;return x.a.wrap(function(pn){for(;;)switch(pn.prev=pn.next){case 0:return pn.next=2,Object(E.a)("/api/courses/".concat(dt==null?void 0:dt.coursesId,"/homework_commons/update_hack_score"),{method:"put",body:{course_id:dt==null?void 0:dt.coursesId,hack_user_code_id:ze==null?void 0:ze.hack_user_id,score:Ze}});case 2:An=pn.sent,An.status===0&&(D.b.success("\u8C03\u5206\u6210\u529F"),xe({type:"shixunHomeworks/setActionTabs",payload:{}}),xe({type:"shixunHomeworks/getShixunWorkReports",payload:Object(a.a)({},dt)}));case 4:case"end":return pn.stop()}},Mt)}));function Ut(){return Bt.apply(this,arguments)}return Ut}(),cancelText:"\u53D6\u6D88"})},type:"primary"},"\u8C03\u5206"),Object(c.c)()&&Ie!="shixunWorkReport"&&C.a.createElement(P.a,{onClick:function(){xe({type:"shixunHomeworks/setActionTabs",payload:{key:"\u66F4\u6539\u70B9\u8BC4",selectArrs:{myshixun_identifier:Ie.user_id,type:"1",language:ze==null?void 0:ze.language,v:Je,data:Object(a.a)({},Ie)}}})}},"\u70B9\u8BC4\u4EE3\u7801"))),C.a.createElement(_.b,{height:300,language:ze==null?void 0:ze.language,value:v.Base64.decode(ze==null?void 0:ze.code),autoHeight:de,theme:"default",options:V}),((ze==null?void 0:ze.comment)||(ze==null?void 0:ze.hidden_comment))&&C.a.createElement("div",null,C.a.createElement(K.a,{align:"middle",style:{borderTop:"1px solid #eee"}},C.a.createElement(M.a,{flex:1},C.a.createElement("h1",{className:h.a.title},"\u70B9\u8BC4\u5185\u5BB9")),C.a.createElement(M.a,{className:"pr30"},Object(c.c)()&&C.a.createElement(P.a,{onClick:Object(b.a)(x.a.mark(function Nt(){return x.a.wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:s.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",icon:C.a.createElement(G.a,null),content:"\u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F",onOk:function(){return Object(b.a)(x.a.mark(function Mt(){var An;return x.a.wrap(function(pn){for(;;)switch(pn.prev=pn.next){case 0:return pn.next=2,Object(z.m)({comment_id:ze==null?void 0:ze.comment_id,homeworkId:dt.homeworkId,type:"hack"});case 2:An=pn.sent,An.status===0&&(D.b.success("\u5220\u9664\u6210\u529F"),xe({type:"shixunHomeworks/getShixunWorkReports",payload:Object(a.a)({},dt)}));case 4:case"end":return pn.stop()}},Mt)}))()}});case 1:case"end":return Bt.stop()}},Nt)}))},C.a.createElement(B.a,null),"\u5220\u9664"))),C.a.createElement(Y.a,{style:{margin:0}}),(ze==null?void 0:ze.comment)&&C.a.createElement("aside",{className:"pl30 pr30 mt20"},C.a.createElement("span",{className:"c-light-black font12"},"# \u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),C.a.createElement("br",null),C.a.createElement(F.a,{value:ze==null?void 0:ze.comment})),(ze==null?void 0:ze.hidden_comment)&&C.a.createElement("aside",{className:"pl30 pr30 mt20"},C.a.createElement("span",{className:"c-light-black font12"},"# \u4EC5\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),C.a.createElement("br",null),C.a.createElement(F.a,{value:ze==null?void 0:ze.hidden_comment}))))}},dejd:function(tn,Qe,I){},dmUQ:function(tn,Qe,I){"use strict";var te=I("Ff2n"),Y=I("rePB"),N=I("1OyB"),K=I("vuIU"),A=I("Ji7U"),M=I("md7G"),H=I("foSv"),P=I("q1tI"),k=I.n(P),D=I("TSYQ"),b=I.n(D),m=I("4IlW");function f(h,c){var v=Object.keys(h);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(h);c&&(p=p.filter(function(E){return Object.getOwnPropertyDescriptor(h,E).enumerable})),v.push.apply(v,p)}return v}function d(h){for(var c=1;c<arguments.length;c++){var v=arguments[c]!=null?arguments[c]:{};c%2?f(Object(v),!0).forEach(function(p){Object(Y.a)(h,p,v[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(v)):f(Object(v)).forEach(function(p){Object.defineProperty(h,p,Object.getOwnPropertyDescriptor(v,p))})}return h}function s(h){var c=r();return function(){var p=Object(H.a)(h),E;if(c){var U=Object(H.a)(this).constructor;E=Reflect.construct(p,arguments,U)}else E=p.apply(this,arguments);return Object(M.a)(this,E)}}function r(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(h){return!1}}function u(){}function o(h){h.preventDefault()}var a=function(c){return c.replace(/[^\w.-]+/g,"")},n=200,R=600,w=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,x=function(c){return c!=null},O=function(c,v){return v===c||typeof v=="number"&&typeof c=="number"&&isNaN(v)&&isNaN(c)},C=function(h){Object(A.a)(v,h);var c=s(v);function v(p){var E;Object(N.a)(this,v),E=c.call(this,p),E.onKeyDown=function(z){var G=E.props,B=G.onKeyDown,T=G.onPressEnter;if(z.keyCode===m.a.UP){var V=E.getRatio(z);E.up(z,V,null),E.stop()}else if(z.keyCode===m.a.DOWN){var Z=E.getRatio(z);E.down(z,Z,null),E.stop()}else z.keyCode===m.a.ENTER&&T&&T(z);if(E.recordCursorPosition(),E.lastKeyCode=z.keyCode,B){for(var oe=arguments.length,pe=new Array(oe>1?oe-1:0),Ye=1;Ye<oe;Ye++)pe[Ye-1]=arguments[Ye];B.apply(void 0,[z].concat(pe))}},E.onKeyUp=function(z){var G=E.props.onKeyUp;if(E.stop(),E.recordCursorPosition(),G){for(var B=arguments.length,T=new Array(B>1?B-1:0),V=1;V<B;V++)T[V-1]=arguments[V];G.apply(void 0,[z].concat(T))}},E.onChange=function(z){var G=E.props.onChange;E.state.focused&&(E.inputting=!0),E.rawInput=E.props.parser(E.getValueFromEvent(z)),E.setState({inputValue:E.rawInput}),G(E.toNumber(E.rawInput))},E.onMouseUp=function(){var z=E.props.onMouseUp;E.recordCursorPosition(),z&&z.apply(void 0,arguments)},E.onFocus=function(){var z;E.setState({focused:!0}),(z=E.props).onFocus.apply(z,arguments)},E.onBlur=function(){var z=E.props.onBlur;E.inputting=!1,E.setState({focused:!1});var G=E.getCurrentValidValue(E.state.inputValue),B=E.setValue(G,u);if(z){var T=E.input.value,V=E.getInputDisplayValue({focus:!1,value:B});E.input.value=V&&Number(V),z.apply(void 0,arguments),E.input.value=T}},E.getRatio=function(z){var G=1;return z.metaKey||z.ctrlKey?G=.1:z.shiftKey&&(G=10),G},E.getFullNum=function(z){return isNaN(z)?z:/e/i.test(String(z))?Number(z).toFixed(18).replace(/\.?0+$/,""):z},E.getPrecision=function(z){if(x(E.props.precision))return E.props.precision;var G=String(z);if(G.indexOf("e-")>=0)return parseInt(G.slice(G.indexOf("e-")+2),10);var B=0;return G.indexOf(".")>=0&&(B=G.length-G.indexOf(".")-1),B},E.getInputDisplayValue=function(z){var G=z||E.state,B=G.focused,T=G.inputValue,V=G.value,Z;B?Z=T:Z=E.toPrecisionAsStep(V),Z==null&&(Z="");var oe=E.formatWrapper(Z);return x(E.props.decimalSeparator)&&(oe=oe.toString().replace(".",E.props.decimalSeparator)),oe},E.recordCursorPosition=function(){try{E.cursorStart=E.input.selectionStart,E.cursorEnd=E.input.selectionEnd,E.currentValue=E.input.value,E.cursorBefore=E.input.value.substring(0,E.cursorStart),E.cursorAfter=E.input.value.substring(E.cursorEnd)}catch(z){}},E.restoreByAfter=function(z){if(z===void 0)return!1;var G=E.input.value,B=G.lastIndexOf(z);if(B===-1)return!1;var T=E.cursorBefore.length;return E.lastKeyCode===m.a.DELETE&&E.cursorBefore.charAt(T-1)===z[0]?(E.fixCaret(T,T),!0):B+z.length===G.length?(E.fixCaret(B,B),!0):!1},E.partRestoreByAfter=function(z){return z===void 0?!1:Array.prototype.some.call(z,function(G,B){var T=z.substring(B);return E.restoreByAfter(T)})},E.isNotCompleteNumber=function(z){return isNaN(z)||z===""||z===null||z&&z.toString().indexOf(".")===z.toString().length-1},E.stop=function(){E.autoStepTimer&&clearTimeout(E.autoStepTimer)},E.down=function(z,G,B){E.pressingUpOrDown=!0,E.step("down",z,G,B)},E.up=function(z,G,B){E.pressingUpOrDown=!0,E.step("up",z,G,B)},E.saveInput=function(z){E.input=z};var U=p.value;U===void 0&&(U=p.defaultValue),E.state={focused:p.autoFocus};var F=E.getValidValue(E.toNumber(U));return E.state=d(d({},E.state),{},{inputValue:E.toPrecisionAsStep(F),value:F}),E}return Object(K.a)(v,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(E){var U=this.props,F=U.value,z=U.onChange,G=U.max,B=U.min,T=this.state.focused;if(E){if(!O(E.value,F)||!O(E.max,G)||!O(E.min,B)){var V=T?F:this.getValidValue(F),Z;this.pressingUpOrDown?Z=V:this.inputting?Z=this.rawInput:Z=this.toPrecisionAsStep(V),this.setState({value:V,inputValue:Z})}var oe="value"in this.props?F:this.state.value;"max"in this.props&&E.max!==G&&typeof oe=="number"&&oe>G&&z&&z(G),"min"in this.props&&E.min!==B&&typeof oe=="number"&&oe<B&&z&&z(B)}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(Ye){}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(E){var U=E;return U===""?U="":this.isNotCompleteNumber(parseFloat(U))?U=this.state.value:U=this.getValidValue(U),this.toNumber(U)}},{key:"getValueFromEvent",value:function(E){var U=E.target.value.trim().replace(/。/g,".");return x(this.props.decimalSeparator)&&(U=U.replace(this.props.decimalSeparator,".")),U}},{key:"getValidValue",value:function(E){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,z=parseFloat(E);return isNaN(z)?E:(z<U&&(z=U),z>F&&(z=F),z)}},{key:"setValue",value:function(E,U){var F=this.props.precision,z=this.isNotCompleteNumber(parseFloat(E))?null:parseFloat(E),G=this.state.value,B=G===void 0?null:G,T=this.state.inputValue,V=T===void 0?null:T,Z=typeof z=="number"?z.toFixed(F):"".concat(z),oe=z!==B||Z!=="".concat(V);return"value"in this.props?(V=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:V},U)):this.setState({value:z,inputValue:this.toPrecisionAsStep(E)},U),oe&&this.props.onChange(z),z}},{key:"getMaxPrecision",value:function(E){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.props,z=F.precision,G=F.step;if(x(z))return z;var B=this.getPrecision(U),T=this.getPrecision(G),V=this.getPrecision(E);return E?Math.max(V,B+T):B+T}},{key:"getPrecisionFactor",value:function(E){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.getMaxPrecision(E,U);return Math.pow(10,F)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(E){return this.props.formatter?this.props.formatter(E):E}},{key:"toPrecisionAsStep",value:function(E){if(this.isNotCompleteNumber(E)||E==="")return E;var U=Math.abs(this.getMaxPrecision(E));return isNaN(U)?E.toString():Number(E).toFixed(U)}},{key:"toNumber",value:function(E){var U=this.props.precision,F=this.state.focused,z=E&&E.length>16&&F;return this.isNotCompleteNumber(E)||z?E:x(U)?Math.round(E*Math.pow(10,U))/Math.pow(10,U):Number(E)}},{key:"upStep",value:function(E,U){var F=this.props.step,z=this.getPrecisionFactor(E,U),G=Math.abs(this.getMaxPrecision(E,U)),B=((z*E+z*F*U)/z).toFixed(G);return this.toNumber(B)}},{key:"downStep",value:function(E,U){var F=this.props.step,z=this.getPrecisionFactor(E,U),G=Math.abs(this.getMaxPrecision(E,U)),B=((z*E-z*F*U)/z).toFixed(G);return this.toNumber(B)}},{key:"step",value:function(E,U){var F=this,z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,G=arguments.length>3?arguments[3]:void 0;this.stop(),U&&(U.persist(),U.preventDefault());var B=this.props;if(B.disabled)return;var T=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(T))return;var V=this["".concat(E,"Step")](T,z),Z=V>B.max||V<B.min;if(V>B.max?V=B.max:V<B.min&&(V=B.min),this.setValue(V,null),this.setState({focused:!0},function(){F.pressingUpOrDown=!1}),Z)return;this.autoStepTimer=setTimeout(function(){F[E](U,z,!0)},G?n:R)}},{key:"fixCaret",value:function(E,U){if(E===void 0||U===void 0||!this.input||!this.input.value)return;try{var F=this.input.selectionStart,z=this.input.selectionEnd;(E!==F||U!==z)&&this.input.setSelectionRange(E,U)}catch(G){}}},{key:"render",value:function(){var E,U=this.props,F=U.prefixCls,z=U.disabled,G=U.readOnly,B=U.useTouch,T=U.autoComplete,V=U.upHandler,Z=U.downHandler,oe=U.className,pe=U.max,Ye=U.min,xe=U.style,Ie=U.title,Je=U.onMouseEnter,Ke=U.onMouseLeave,be=U.onMouseOver,de=U.onMouseOut,nt=U.required,Kt=U.onClick,jt=U.tabIndex,wt=U.type,ze=U.placeholder,ft=U.id,dt=U.inputMode,Nt=U.pattern,Ze=U.step,Bt=U.maxLength,Ut=U.autoFocus,Mt=U.name,An=U.onPaste,mn=U.onInput,pn=Object(te.a)(U,["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"]),tt=this.state,fn=tt.value,In=tt.focused,He=b()(F,(E={},Object(Y.a)(E,oe,!!oe),Object(Y.a)(E,"".concat(F,"-disabled"),z),Object(Y.a)(E,"".concat(F,"-focused"),In),E)),Ue={};Object.keys(pn).forEach(function(ve){(ve.substr(0,5)==="data-"||ve.substr(0,5)==="aria-"||ve==="role")&&(Ue[ve]=pn[ve])});var pt=!G&&!z,Ct=this.getInputDisplayValue(null),Ge=(fn||fn===0)&&(isNaN(fn)||Number(fn)>=pe),vt=(fn||fn===0)&&(isNaN(fn)||Number(fn)<=Ye),Ae=Ge||z||G,ge=vt||z||G,Ee=b()("".concat(F,"-handler"),"".concat(F,"-handler-up"),Object(Y.a)({},"".concat(F,"-handler-up-disabled"),Ae)),ae=b()("".concat(F,"-handler"),"".concat(F,"-handler-down"),Object(Y.a)({},"".concat(F,"-handler-down-disabled"),ge)),re=B?{onTouchStart:Ae?u:this.up,onTouchEnd:this.stop}:{onMouseDown:Ae?u:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},he=B?{onTouchStart:ge?u:this.down,onTouchEnd:this.stop}:{onMouseDown:ge?u:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return k.a.createElement("div",{className:He,style:xe,title:Ie,onMouseEnter:Je,onMouseLeave:Ke,onMouseOver:be,onMouseOut:de,onFocus:function(){return null},onBlur:function(){return null}},k.a.createElement("div",{className:"".concat(F,"-handler-wrap")},k.a.createElement("span",Object.assign({unselectable:"on"},re,{role:"button","aria-label":"Increase Value","aria-disabled":Ae,className:Ee}),V||k.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-up-inner"),onClick:o})),k.a.createElement("span",Object.assign({unselectable:"on"},he,{role:"button","aria-label":"Decrease Value","aria-disabled":ge,className:ae}),Z||k.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-down-inner"),onClick:o}))),k.a.createElement("div",{className:"".concat(F,"-input-wrap")},k.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Ye,"aria-valuemax":pe,"aria-valuenow":fn,required:nt,type:wt,placeholder:ze,onPaste:An,onClick:Kt,onMouseUp:this.onMouseUp,className:"".concat(F,"-input"),tabIndex:jt,autoComplete:T,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:pt?this.onKeyDown:u,onKeyUp:pt?this.onKeyUp:u,autoFocus:Ut,maxLength:Bt,readOnly:G,disabled:z,max:pe,min:Ye,step:Ze,name:Mt,title:Ie,id:ft,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Ct),pattern:Nt,inputMode:dt,onInput:mn},Ue))))}}]),v}(k.a.Component);C.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:w,min:-w,step:1,style:{},onChange:u,onKeyDown:u,onPressEnter:u,onFocus:u,onBlur:u,parser:a,required:!1,autoComplete:"off"};var _=C,y=Qe.a=_},eozf:function(tn,Qe,I){"use strict";I.d(Qe,"b",function(){return Ke}),I.d(Qe,"c",function(){return be});var te=I("sRBo"),Y=I("kaz8"),N=I("5Dmo"),K=I("3S7+"),A=I("/zsF"),M=I("PArb"),H=I("7Kak"),P=I("9yH6"),k=I("14J3"),D=I("BMrR"),b=I("+L6B"),m=I("2/Rp"),f=I("jCWc"),d=I("kPKH"),s=I("2qtc"),r=I("kLXV"),u=I("9og8"),o=I("miYZ"),a=I("tsqr"),n=I("oBTY"),R=I("k1fw"),w=I("tJVT"),x=I("OaEy"),O=I("2fM7"),C=I("iQDF"),_=I("+eQT"),y=I("WmNS"),h=I.n(y),c=I("q1tI"),v=I.n(c),p=I("/MfK"),E=I("w5pM"),U=I("Lyp1"),F=I("wd/R"),z=I.n(F),G=I("xKgJ"),B=I("ErOA"),T=I("LvDl"),V=I.n(T),Z=I("1vsH"),oe=I("zetH"),pe=I.n(oe),Ye=I("Ty5D"),xe=I("9kvl"),Ie=I("AHFd");function Je(jt,wt){for(var ze=[],ft=jt;ft<wt;ft++)ze.push(ft);return ze}var Ke=function(wt,ze,ft){var dt=wt<z()().startOf("day"),Nt=wt>z()(ze).endOf("day"),Ze=wt<z()(ft).startOf("day");return ze?ft?z()()<=z()(ft)?Ze||Nt:dt||Nt:wt&&dt||Nt:ft&&z()()<=z()(ft)?Ze:dt},be=function(wt,ze){var ft=parseInt(z()(wt).format("HH")),dt=parseInt(z()().format("HH")),Nt=parseInt(z()().format("mm"));if(!wt)return{disabledHours:function(){return Je(0,dt)},disabledMinutes:function(){return Je(0,Nt)}};if(ze){var Ze=parseInt(z()(ze).format("HH")),Bt=parseInt(z()(ze).format("mm"));return z()(wt).isSame(z()(ze),"day")?{disabledHours:function(){return Je(0,Ze)},disabledMinutes:function(){return ft<=Ze?Je(0,Bt):[]}}:void 0}return z()(wt).isSame(z()(),"day")?{disabledHours:function(){return Je(0,dt)},disabledMinutes:function(){return z()(wt).isSame(z()(),"hour")&&ft<=dt?Je(0,Nt):[]}}:void 0},de=_.a.RangePicker,nt=O.a.Option,Kt=function(wt){var ze,ft,dt,Nt,Ze,Bt,Ut,Mt=wt.shixunHomeworks,An=wt.loading,mn=wt.dispatch,pn=Object(Ye.i)(),tt=Mt.workSetting,fn=Mt.workList,In=Mt.changeData,He=Object(c.useState)(!0),Ue=Object(w.a)(He,2),pt=Ue[0],Ct=Ue[1],Ge=Object(c.useState)(!1),vt=Object(w.a)(Ge,2),Ae=vt[0],ge=vt[1],Ee=Object(c.useState)([]),ae=Object(w.a)(Ee,2),re=ae[0],he=ae[1],ve=Object(c.useState)([]),me=Object(w.a)(ve,2),Be=me[0],Tt=me[1],Jt=Object(c.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_penalty:0,penalty_type:Ie.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}),En=Object(w.a)(Jt,2),mt=En[0],Qt=En[1];Object(c.useEffect)(function(){return gt(),function(){he([].concat())}},[]);var gt=function(){mn({type:"shixunHomeworks/getWorkSetting",payload:Object(R.a)({},pn)})};Object(c.useEffect)(function(){var _e;if(!(tt!=null&&tt.course_id))return;Object.keys(mt).map(function(Ne){mt[Ne]=tt[Ne]}),(!mt.allow_late||!mt.unified_late)&&(mt.late_penalty=20,mt.penalty_type=Ie.a.Percent),mt.unified_setting||(mt.unified_late=!1,mt.unified_anonymous_comment=!1,mt.unified_anonymous_appeal=!1),re=JSON.parse(JSON.stringify(tt.group_settings.map(function(Ne){return Object(R.a)(Object(R.a)({},Ne),{},{group_name:[Ne.group_name]})}).filter(function(Ne){return Ne.publish_time!==null}))),Be=JSON.parse(JSON.stringify(tt.allow_late_settings.map(function(Ne){return Object(R.a)(Object(R.a)({},Ne),{},{group_name:[Ne.group_name]})}).filter(function(Ne){return Ne.late_time!==null}))),Qt(Object(R.a)({},mt)),he(Object(n.a)(re)),((_e=Be)===null||_e===void 0?void 0:_e.length)<=0?Tt([{penalty_type:Ie.a.Percent,late_penalty:20}]):Tt(Object(n.a)(Be))},[tt]);var yt=function(){var Ne,xt,Xt=JSON.parse(JSON.stringify(mt));if(Xt.challenge_settings.filter(function(Mn){return!Mn.hide}),Xt.categoryId=pn.categoryId,(Ne=Xt.challenge_settings)!==null&&Ne!==void 0&&Ne.every(function(Mn){return!Mn.checked})){a.b.warn("\u5173\u5361\u4E0D\u80FD\u5168\u90E8\u8BBE\u7F6E\u4E3A\u53EF\u4E0D\u505A");return}if(mt.unified_setting||(re=(xt=re)===null||xt===void 0?void 0:xt.map(function(Mn){var ci;if(!Mn.publish_time||!Mn.end_time)throw a.b.error("\u8BF7\u628A\u53D1\u5E03\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u53D1\u5E03\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!Mn.group_name)throw a.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return Mn.group_name=typeof(Mn==null?void 0:Mn.group_name)=="string"?[Mn==null?void 0:Mn.group_name]:Mn==null?void 0:Mn.group_name,Mn.group_id=(ci=tt.group_settings)===null||ci===void 0?void 0:ci.filter(function($n){var Cn;return Mn==null||((Cn=Mn.group_name)===null||Cn===void 0)?void 0:Cn.includes($n.group_name)}).map(function($n){return $n.group_id||$n.id}).toString().split(","),Mn})),Xt.group_settings=re,mt.allow_late)if(mt.unified_late){if(mt.late_penalty===null||mt.late_penalty===void 0||mt.late_penalty<0||mt.late_penalty>100)throw a.b.error("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100"),new String("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100");if(!mt.late_time)throw a.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574")}else{var vn;Be=(vn=Be)===null||vn===void 0?void 0:vn.map(function(Mn){var ci,$n;if(Mn.late_penalty===null||Mn.late_penalty===void 0||Mn.late_penalty<0||Mn.late_penalty>100)throw a.b.error("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100"),new String("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100");if(!Mn.late_time)throw a.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!Mn.group_name)throw a.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return Mn.group_name=typeof(Mn==null?void 0:Mn.group_name)=="string"?[Mn==null?void 0:Mn.group_name]:Mn==null?void 0:Mn.group_name,Mn.group_id=Mn==null||((ci=Mn.group_name)===null||ci===void 0||(($n=ci.map(function(Cn){var Ti,Wi,hi=(Ti=tt.group_settings)===null||Ti===void 0||((Wi=Ti.filter(function(fi){return(fi==null?void 0:fi.group_name)===Cn}))===null||Wi===void 0)?void 0:Wi[0];return hi==null?void 0:hi.group_id}))===null||$n===void 0))?void 0:$n.toString().split(","),Mn}),Xt.allow_late_settings=Be}rt(Xt)},rt=function(Ne){var xt,Xt;if(Ne.total_score===null){a.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}if(Ne!=null&&Ne.work_efficiency&&Ne.eff_score===null){a.b.warn("\u6548\u7387\u5206\u4E0D\u80FD\u4E3A\u7A7A");return}var vn=Ne.challenge_settings.reduce(function($n,Cn){return $n+Number(Cn.challenge_score)},0);if((vn==null?void 0:vn.toFixed(10))!==((xt=Ne.total_score-Ne.eff_score)===null||xt===void 0?void 0:xt.toFixed(10))){a.b.warn("\u6548\u7387\u5206\u52A0\u5173\u5361\u4EFB\u52A1\u603B\u5206\u5FC5\u987B\u7B49\u4E8E\u603B\u5206\u503C\uFF1A".concat(Ne.total_score,"\u5206"));return}var Mn={shixun_evaluation:Ne.shixun_evaluation,challenge_settings:Ne.challenge_settings},ci=function(){var $n=Object(u.a)(h.a.mark(function Cn(){var Ti;return h.a.wrap(function(hi){for(;;)switch(hi.prev=hi.next){case 0:return ge(!0),hi.next=3,Object(B.a)("/api/homework_commons/".concat(pn.categoryId,"/publish_setting.json"),{method:"post",body:Object(R.a)({},Ne)});case 3:Ti=hi.sent,Ti.status===0&&(a.b.success("\u66F4\u65B0\u6210\u529F"),Ct(!0),gt(),mn({type:"shixunHomeworks/getWorkList",payload:Object(R.a)({},pn)})),ge(!1);case 6:case"end":return hi.stop()}},Cn)}));return function(){return $n.apply(this,arguments)}}();!Object(T.isEqual)(In,Mn)&&!(fn!=null&&(Xt=fn.homework_status)!==null&&Xt!==void 0&&Xt.includes("\u672A\u53D1\u5E03"))?r.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:ci}):ci()},ce=function(Ne,xt){var Xt,vn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"group_id";return xt?xt.find(function(Mn){return Mn[vn]===Ne}):tt==null||((Xt=tt.group_settings)===null||Xt===void 0)?void 0:Xt.find(function(Mn){return Mn.group_id[0]===Ne})},Re=(tt==null?void 0:tt.allow_late)||(tt==null?void 0:tt.anonymous_comment),At=function(Ne){var xt=ce(Ne,tt==null?void 0:tt.allow_late_settings,"id"),Xt=ce(Ne,tt==null?void 0:tt.anonymous_comment_settings);return(tt==null?void 0:tt.allow_late)&&xt&&(xt==null?void 0:xt.late_time)!==null||(tt==null?void 0:tt.anonymous_comment)&&Xt&&(Xt==null?void 0:Xt.evaluation_start)!==null},ot=Object(c.useMemo)(function(){var _e;if(tt!=null&&tt.unified_setting){var Ne;return!(fn!=null&&(Ne=fn.homework_status)!==null&&Ne!==void 0&&Ne.includes("\u5DF2\u622A\u6B62"))||(tt==null?void 0:tt.allow_late)||(tt==null?void 0:tt.anonymous_comment)}var xt=tt==null||((_e=tt.group_settings)===null||_e===void 0)?void 0:_e.some(function(Xt){return z()(Xt.end_time)<=z()()});return!xt||(tt==null?void 0:tt.allow_late)||(tt==null?void 0:tt.all_group_late)},[tt,fn]),Yt=tt==null?void 0:tt.anonymous_comment,rn=function(Ne){if(!Ne)return!1;var xt=ce(Ne,tt==null?void 0:tt.anonymous_comment_settings);return(tt==null?void 0:tt.anonymous_comment)&&xt&&(xt==null?void 0:xt.evaluation_start)!==null};return v.a.createElement("section",{className:[pe.a.form," bg-white pl30 pr30 pt10"].join(" ")},v.a.createElement(D.a,null,v.a.createElement(d.a,{span:24},v.a.createElement(D.a,{align:"middle"},v.a.createElement(d.a,{flex:"1"}),v.a.createElement(d.a,null,Object(G.c)()&&pt&&v.a.createElement(m.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return Ct(!1)}},"\u7F16\u8F91\u8BBE\u7F6E")))),v.a.createElement("div",null,v.a.createElement("label",null,"\u53D1\u5E03\u65B9\u5F0F\uFF1A")," ",v.a.createElement(P.a.Group,{disabled:pt||!(fn!=null&&(ze=fn.homework_status)!==null&&ze!==void 0&&ze.includes("\u672A\u53D1\u5E03")),value:mt.unified_setting,onChange:function(Ne){var xt;if(!(fn!=null&&(xt=fn.homework_status)!==null&&xt!==void 0&&xt.includes("\u672A\u53D1\u5E03"))){a.b.error("\u5DF2\u53D1\u5E03\uFF0C\u4E0D\u80FD\u518D\u4FEE\u6539\u7EDF\u4E00\u8BBE\u7F6E");return}if(mt.unified_setting=!mt.unified_setting,mt.unified_setting||(mt.unified_late=!1),Qt(Object.assign({},mt)),mt.unified_setting===!1&&re==""){he(re.concat({}));return}mt.unified_setting&&(he([]),Tt([{late_penalty:5}]))}},v.a.createElement(P.a,{value:!0},"\u7EDF\u4E00\u53D1\u5E03"),v.a.createElement(P.a,{disabled:(tt==null||((ft=tt.group_settings)===null||ft===void 0)?void 0:ft.length)===0,value:!1},"\u5206\u73ED\u53D1\u5E03")),(tt==null||((dt=tt.group_settings)===null||dt===void 0)?void 0:dt.length)===0&&v.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"))),mt.unified_setting&&v.a.createElement("div",null,v.a.createElement(D.a,{align:"middle",className:"mt25 pl30"},v.a.createElement(d.a,null,"\u53D1\u5E03\u65F6\u95F4:"),v.a.createElement(d.a,{className:"ml5"},v.a.createElement(_.a,{disabled:pt||!(fn!=null&&(Nt=fn.homework_status)!==null&&Nt!==void 0&&Nt.includes("\u672A\u53D1\u5E03")||fn!=null&&(Ze=fn.homework_status)!==null&&Ze!==void 0&&Ze.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(Ne){return Ke(Ne,tt==null?void 0:tt.course_end_date)},disabledTime:function(Ne){return be(Ne)},value:mt.publish_time?z()(mt.publish_time):"",onChange:function(Ne,xt){mt.publish_time=xt,(mt.end_time==""||!mt.end_time)&&mt.unified_setting&&(mt.end_time=z()(Ne).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),Qt(Object.assign({},mt))}})),v.a.createElement(d.a,null,v.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u7684\u65F6\u95F4)"))),v.a.createElement(D.a,{align:"middle",className:"mt25 pl30"},v.a.createElement(d.a,null,"\u622A\u6B62\u65F6\u95F4:"),v.a.createElement(d.a,{className:"ml5"},v.a.createElement(_.a,{style:{width:170},allowClear:!1,placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:z()(Object(Z.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:pt||Re,disabledDate:function(Ne){return Ke(Ne,tt==null?void 0:tt.course_end_date,mt.publish_time)},disabledTime:function(Ne){return be(Ne,mt.publish_time)},value:mt.end_time?z()(mt.end_time):"",onChange:function(Ne,xt){mt.end_time=xt,Qt(Object.assign({},mt))}})),v.a.createElement(d.a,null,v.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)")))),!mt.unified_setting&&((Bt=re)===null||Bt===void 0?void 0:Bt.length)>0&&v.a.createElement(D.a,{style:{marginTop:30,paddingTop:40,marginLeft:40,borderTop:"1px solid #eee"}},v.a.createElement(d.a,{span:24},v.a.createElement(D.a,null,v.a.createElement(d.a,{span:10}),v.a.createElement(d.a,{span:10},v.a.createElement(D.a,{className:"c-grey-c ml30"},v.a.createElement(d.a,{flex:"1"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u65F6\u95F4)"),v.a.createElement(d.a,{flex:"1"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u65F6\u95F4\u622A\u70B9)"))),v.a.createElement(d.a,{span:4}))),re&&re.map(function(_e,Ne){var xt,Xt,vn,Mn,ci;return v.a.createElement(d.a,{span:24,key:Ne},v.a.createElement(D.a,{gutter:[8,16]},v.a.createElement(d.a,{span:10},v.a.createElement(D.a,{gutter:[8,16]},v.a.createElement(d.a,null,"\u53D1\u5E03\u89C4\u5219 ",Ne+1),v.a.createElement(d.a,{flex:"1",style:{maxWidth:300}},v.a.createElement(O.a,{disabled:pt||!(fn!=null&&(xt=fn.homework_status)!==null&&xt!==void 0&&xt.includes("\u672A\u53D1\u5E03"))&&_e.id,className:"ml20",mode:"multiple",style:{width:"100%"},value:_e.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(Cn){re[Ne].group_name=Cn,re[Ne].group_id=_e.group_id;var Ti=Object(T.flattenDeep)(re.map(function(hi){return hi.group_name})),Wi=Be.map(function(hi){var fi=(hi==null?void 0:hi.group_name)||[];return Object(R.a)(Object(R.a)({},hi),{},{group_name:Object(T.remove)(fi,function(ji){return Ti.includes(ji)})})});Tt(Wi),he(re.slice())}},tt.group_settings&&tt.group_settings.map(function($n){var Cn=re.map(function(Ti){return Ti.group_name}).flat();if(!Cn.includes($n.group_name))return v.a.createElement(nt,{value:$n.group_name,key:$n.id},$n.group_name)}))))),v.a.createElement(d.a,{span:10},v.a.createElement("div",{className:"ml30"},v.a.createElement(de,{ranges:{\u6B64\u523B:[_e.publish_time?z()(_e.publish_time):z()(),z()()]},allowClear:!1,disabled:pt||(z()()<=z()((Xt=ce((vn=_e.group_id)===null||vn===void 0?void 0:vn[0]))===null||Xt===void 0?void 0:Xt.publish_time)?!1:[!0,At((Mn=_e.group_id)===null||Mn===void 0?void 0:Mn[0])]),style:{width:400},placeholder:["\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4","\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4"],disabledDate:function(Cn){return Ke(Cn,tt==null?void 0:tt.course_end_date)},disabledTime:function(Cn){return be(Cn)},showTime:{showNow:!0,format:"HH:mm",defaultValue:[z()(Object(Z.d)(),"HH:mm"),z()(Object(Z.d)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:_e.publish_time&&[z()(_e.publish_time),_e.end_time?z()(_e.end_time):void 0],onChange:function(Cn,Ti){re[Ne].publish_time=Ti[0],re[Ne].end_time=Ti[1],he(Object(n.a)(re))}}))),!pt&&v.a.createElement(d.a,{span:4},Ne>0&&!_e.id&&v.a.createElement(p.a,{onClick:function(){re=re.filter(function(Cn,Ti){return Ne!==Ti}),he(re.slice()),setTimeout(function(){return he(re.slice())},10)}}),re.length<(tt==null||((ci=tt.group_settings)===null||ci===void 0)?void 0:ci.length)&&v.a.createElement(E.a,{className:"c-green ml20",onClick:function(){he(re.concat({}))}}))))})),v.a.createElement(M.a,null),v.a.createElement(D.a,null,v.a.createElement(d.a,null,v.a.createElement("strong",null,"\u8865\u4EA4\u8BBE\u7F6E"),v.a.createElement(K.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"},v.a.createElement(U.a,{style:{marginLeft:4,cursor:"pointer"}}))),v.a.createElement(d.a,{span:24,className:"mt15 pl30"},v.a.createElement(Y.a,{checked:mt.allow_late,disabled:pt||ot,onChange:function(){mt.allow_late=!mt.allow_late,Be==""&&Tt([{late_penalty:5}]),Qt(Object.assign({},mt))}},v.a.createElement("strong",null,"\u5F00\u542F\u8865\u4EA4")),v.a.createElement(K.a,{overlayStyle:{width:380,maxWidth:380},title:v.a.createElement("div",{style:{display:"flex",flexFlow:"column"}},v.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219\u8BF4\u660E"),v.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"),v.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"))},v.a.createElement(U.a,null)))),(mt==null?void 0:mt.allow_late)&&v.a.createElement("div",{style:{marginLeft:22}},v.a.createElement("div",{className:"ml30 mt20"},v.a.createElement("span",null,"\u8865\u4EA4\u65B9\u5F0F\uFF1A"),v.a.createElement(P.a.Group,{disabled:pt||(tt==null?void 0:tt.anonymous_comment)||(tt==null?void 0:tt.allow_late),value:mt.unified_late,onChange:function(Ne){mt.unified_late=Ne.target.value,Be==""&&!Ne.target.value&&Tt([{penalty_type:Ie.a.Percent,late_penalty:20}]),Qt(Object(R.a)({},mt))}},(mt==null?void 0:mt.unified_setting)&&v.a.createElement(P.a,{value:!0}," \u7EDF\u4E00\u8865\u4EA4 "),(tt==null||((Ut=tt.group_settings)===null||Ut===void 0)?void 0:Ut.length)>0&&v.a.createElement(P.a,{value:!1}," \u5206\u73ED\u8865\u4EA4 "))),mt!=null&&mt.unified_late?v.a.createElement(v.a.Fragment,null,v.a.createElement(D.a,{align:"middle",className:"mt25 pl30"},v.a.createElement(d.a,null,"\u8865\u4EA4\u6263\u5206:"),v.a.createElement(d.a,{className:"ml5"},v.a.createElement(Ie.b,{disabled:pt||Yt,value:{type:mt.penalty_type,inputValue:mt.late_penalty},onChange:function(Ne){Qt(Object(R.a)(Object(R.a)({},mt),{},{late_penalty:Ne.inputValue,penalty_type:Ne.type}))}})),v.a.createElement(d.a,{flex:"1",className:"ml5"},v.a.createElement("span",{className:"c-grey-c ml10"},mt.penalty_type===Ie.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)"))),v.a.createElement(D.a,{align:"middle",className:"mt25 pl30"},v.a.createElement(d.a,null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4:"),v.a.createElement(d.a,{className:"ml5"},v.a.createElement(_.a,{allowClear:!1,style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:z()(Object(Z.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:pt||Yt,value:mt.late_time?z()(mt.late_time):"",disabledDate:function(Ne){return Ke(Ne,tt==null?void 0:tt.course_end_date)},onChange:function(Ne,xt){mt.late_time=xt,Qt(Object.assign({},mt))}})),v.a.createElement(d.a,null,v.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u201C\u5EF6\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)")))):Be.map(function(_e,Ne){var xt;return v.a.createElement(d.a,{span:24,key:Ne},v.a.createElement(D.a,{className:"mt25"},v.a.createElement(d.a,{style:{marginLeft:30}},v.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219",Ne+1,"\uFF1A"),v.a.createElement(O.a,{disabled:pt||!(fn!=null&&(xt=fn.homework_status)!==null&&xt!==void 0&&xt.includes("\u672A\u53D1\u5E03"))&&_e.id||(tt==null?void 0:tt.anonymous_comment),mode:"multiple",style:{width:306},value:typeof _e.group_name=="string"?[_e.group_name]:_e.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(vn){Be[Ne].group_name=vn,Be[Ne].group_id=_e.group_id,Tt(Be.slice())}},tt.group_settings&&tt.group_settings.map(function(Xt){var vn=Be.map(function(ci){return ci.group_name}).flat(),Mn=re.map(function(ci){return ci.group_name}).flat();if(mt!=null&&mt.unified_setting){if(!vn.includes(Xt.group_name))return v.a.createElement(nt,{value:Xt.group_name,key:Xt.id},Xt.group_name)}else if(Mn.includes(Xt.group_name)&&(!vn.includes(Xt.group_name)&&z()(Xt.end_time)<=z()()))return v.a.createElement(nt,{value:Xt.group_name,key:Xt.id},Xt.group_name)}))),v.a.createElement(d.a,{className:"ml20"},v.a.createElement("span",null,"\u8865\u4EA4\u6263\u5206\uFF1A"),v.a.createElement(Ie.b,{disabled:pt||rn(_e.id),value:{type:_e.penalty_type,inputValue:_e.late_penalty},onChange:function(vn){Be[Ne].late_penalty=vn.inputValue,Be[Ne].penalty_type=vn.type,Tt(Object(n.a)(Be))}})),v.a.createElement(d.a,{className:"ml20"},v.a.createElement("span",null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4\uFF1A"),v.a.createElement(_.a,{disabled:pt||rn(_e.id),style:{width:200},showTime:{format:"HH:mm",defaultValue:z()(Object(Z.d)(),"HH:mm")},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",disabledDate:function(vn){return Ke(vn,tt==null?void 0:tt.course_end_date)},format:"YYYY-MM-DD HH:mm",value:_e!=null&&_e.late_time?z()(_e.late_time):void 0,onChange:function(vn,Mn){Be[Ne].late_time=Mn,Tt(Object(n.a)(Be))}})),!pt&&v.a.createElement(d.a,{className:"ml20"},Ne>0&&!_e.id&&v.a.createElement(p.a,{onClick:function(){Be=Be.filter(function(vn,Mn){return Ne!==Mn}),Tt(Be.slice()),setTimeout(function(){return Tt(Be.slice())},10)}}),v.a.createElement(E.a,{className:"c-green ml20",onClick:function(){Tt(Be.concat({penalty_type:Ie.a.Percent,late_minus_score:20}))}}))))})),v.a.createElement(M.a,null),!pt&&v.a.createElement(d.a,{className:"mb50"},v.a.createElement(m.a,{type:"primary",size:"large",style:{marginTop:"40px"},loading:Ae,onClick:function(){return yt()}},"\u63D0\u4EA4"),v.a.createElement(m.a,{type:"primary",size:"large",ghost:!0,className:"ml20",onClick:function(){Ct(!0),gt()}},"\u53D6\u6D88")))};Qe.a=Object(xe.a)(function(jt){var wt=jt.shixunHomeworks,ze=jt.loading;return{shixunHomeworks:wt,loading:ze.effects}})(Kt)},fyJ8:function(tn,Qe,I){"use strict";var te=I("rePB"),Y=I("VTBJ"),N=I("Ff2n"),K=I("U8pU"),A=I("q1tI"),M=I.n(A),H=I("TSYQ"),P=I.n(H),k=I("c+Xe"),D=I("sR1s");function b(r){return r&&Object(K.a)(r)==="object"&&!Array.isArray(r)&&!A.isValidElement(r)}function m(r){return typeof r=="string"?!0:Object(k.c)(r)}function f(r,u){var o,a=r.prefixCls,n=r.className,R=r.record,w=r.index,x=r.dataIndex,O=r.render,C=r.children,_=r.component,y=_===void 0?"td":_,h=r.colSpan,c=r.rowSpan,v=r.fixLeft,p=r.fixRight,E=r.firstFixLeft,U=r.lastFixLeft,F=r.firstFixRight,z=r.lastFixRight,G=r.appendNode,B=r.additionalProps,T=B===void 0?{}:B,V=r.ellipsis,Z=r.align,oe=r.rowType,pe=r.isSticky,Ye="".concat(a,"-cell"),xe,Ie;if(C)Ie=C;else{var Je=Object(D.b)(R,x);if(Ie=Je,O){var Ke=O(Je,R,w);b(Ke)?(Ie=Ke.children,xe=Ke.props):Ie=Ke}}Object(K.a)(Ie)==="object"&&!Array.isArray(Ie)&&!A.isValidElement(Ie)&&(Ie=null),V&&(U||F)&&(Ie=A.createElement("span",{className:"".concat(Ye,"-content")},Ie));var be=xe||{},de=be.colSpan,nt=be.rowSpan,Kt=be.style,jt=be.className,wt=Object(N.a)(be,["colSpan","rowSpan","style","className"]),ze=de!==void 0?de:h,ft=nt!==void 0?nt:c;if(ze===0||ft===0)return null;var dt={},Nt=typeof v=="number",Ze=typeof p=="number";Nt&&(dt.position="sticky",dt.left=v),Ze&&(dt.position="sticky",dt.right=p);var Bt={};Z&&(Bt.textAlign=Z);var Ut,Mt=V===!0?{showTitle:!0}:V;Mt&&(Mt.showTitle||oe==="header")&&(typeof Ie=="string"||typeof Ie=="number"?Ut=Ie.toString():A.isValidElement(Ie)&&typeof Ie.props.children=="string"&&(Ut=Ie.props.children));var An=Object(Y.a)(Object(Y.a)(Object(Y.a)({title:Ut},wt),T),{},{colSpan:ze&&ze!==1?ze:null,rowSpan:ft&&ft!==1?ft:null,className:P()(Ye,n,(o={},Object(te.a)(o,"".concat(Ye,"-fix-left"),Nt),Object(te.a)(o,"".concat(Ye,"-fix-left-first"),E),Object(te.a)(o,"".concat(Ye,"-fix-left-last"),U),Object(te.a)(o,"".concat(Ye,"-fix-right"),Ze),Object(te.a)(o,"".concat(Ye,"-fix-right-first"),F),Object(te.a)(o,"".concat(Ye,"-fix-right-last"),z),Object(te.a)(o,"".concat(Ye,"-ellipsis"),V),Object(te.a)(o,"".concat(Ye,"-with-append"),G),Object(te.a)(o,"".concat(Ye,"-fix-sticky"),(Nt||Ze)&&pe),o),T.className,jt),style:Object(Y.a)(Object(Y.a)(Object(Y.a)(Object(Y.a)({},T.style),Bt),dt),Kt),ref:m(y)?u:null});return A.createElement(y,Object.assign({},An),G,Ie)}var d=A.forwardRef(f);d.displayName="Cell";var s=A.memo(d,function(r,u){return u.shouldCellUpdate?!u.shouldCellUpdate(u.record,r.record):!1});Qe.a=s},hW8S:function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return K}),I.d(Qe,"c",function(){return A}),I.d(Qe,"b",function(){return M});var te=I("VTBJ"),Y=I("Ff2n"),N=I("Kwbf"),K="RC_TABLE_INTERNAL_COL_DEFINE";function A(H){var P=H.expandable,k=Object(Y.a)(H,["expandable"]);return"expandable"in H?Object(te.a)(Object(te.a)({},k),P):k}function M(H){return Object.keys(H).reduce(function(P,k){return(k.substr(0,5)==="data-"||k.substr(0,5)==="aria-")&&(P[k]=H[k]),P},{})}},iF7n:function(tn,Qe,I){tn.exports={flex_box_center:"flex_box_center___1Hyu4",flex_space_between:"flex_space_between___3ssyf",flex_box_vertical_center:"flex_box_vertical_center___1Gkv-",flex_box_center_end:"flex_box_center_end___1fs_5",flex_box_column:"flex_box_column___3KImt",top:"top___FkMRG",desc:"desc___zZgSM",liked:"liked___1eBGI",likedActive:"likedActive___1i_lJ",reply:"reply___1mww8",replyList:"replyList___3NmMj",comment:"comment___1kF3h"}},k3GJ:function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return mi});var te=I("rePB"),Y=I("ODXe"),N=I("Ff2n"),K=I("VTBJ"),A=I("q1tI"),M=I("TSYQ"),H=I.n(M),P=I("Zm9Q"),k=I("6cGi"),D=I("KQm4"),b=I("xEkU"),m=I.n(b),f=I("t23M");function d(ye){var Me=Object(A.useRef)(),We=Object(A.useRef)(!1);function we(){for(var ie=arguments.length,fe=new Array(ie),le=0;le<ie;le++)fe[le]=arguments[le];We.current||(m.a.cancel(Me.current),Me.current=m()(function(){ye.apply(void 0,fe)}))}return Object(A.useEffect)(function(){return function(){We.current=!0,m.a.cancel(Me.current)}},[]),we}function s(ye){var Me=Object(A.useRef)([]),We=Object(A.useState)({}),we=Object(Y.a)(We,2),ie=we[1],fe=Object(A.useRef)(typeof ye=="function"?ye():ye),le=d(function(){var De=fe.current;Me.current.forEach(function($e){De=$e(De)}),Me.current=[],fe.current=De,ie({})});function Se(De){Me.current.push(De),le()}return[fe.current,Se]}var r=I("4IlW");function u(ye,Me){var We,we=ye.prefixCls,ie=ye.id,fe=ye.active,le=ye.rtl,Se=ye.tab,De=Se.key,$e=Se.tab,Le=Se.disabled,at=Se.closeIcon,It=ye.tabBarGutter,qt=ye.tabPosition,un=ye.closable,Hn=ye.renderWrapper,Gn=ye.removeAriaLabel,di=ye.editable,li=ye.onClick,Ei=ye.onRemove,Ri=ye.onFocus,gi="".concat(we,"-tab");A.useEffect(function(){return Ei},[]);var xi={};qt==="top"||qt==="bottom"?xi[le?"marginLeft":"marginRight"]=It:xi.marginBottom=It;var Di=di&&un!==!1&&!Le;function dn(Ht){if(Le)return;li(Ht)}function Zt(Ht){Ht.preventDefault(),Ht.stopPropagation(),di.onEdit("remove",{key:De,event:Ht})}var yn=A.createElement("div",{key:De,ref:Me,className:H()(gi,(We={},Object(te.a)(We,"".concat(gi,"-with-remove"),Di),Object(te.a)(We,"".concat(gi,"-active"),fe),Object(te.a)(We,"".concat(gi,"-disabled"),Le),We)),style:xi,onClick:dn},A.createElement("div",{role:"tab","aria-selected":fe,id:ie&&"".concat(ie,"-tab-").concat(De),className:"".concat(gi,"-btn"),"aria-controls":ie&&"".concat(ie,"-panel-").concat(De),"aria-disabled":Le,tabIndex:Le?null:0,onClick:function(Wt){Wt.stopPropagation(),dn(Wt)},onKeyDown:function(Wt){[r.a.SPACE,r.a.ENTER].includes(Wt.which)&&(Wt.preventDefault(),dn(Wt))},onFocus:Ri},$e),Di&&A.createElement("button",{type:"button","aria-label":Gn||"remove",tabIndex:0,className:"".concat(gi,"-remove"),onClick:function(Wt){Wt.stopPropagation(),Zt(Wt)}},at||di.removeIcon||"\xD7"));return Hn&&(yn=Hn(yn)),yn}var o=A.forwardRef(u),a={width:0,height:0,left:0,top:0};function n(ye,Me,We){return Object(A.useMemo)(function(){for(var we,ie=new Map,fe=Me.get((we=ye[0])===null||we===void 0?void 0:we.key)||a,le=fe.left+fe.width,Se=0;Se<ye.length;Se+=1){var De=ye[Se].key,$e=Me.get(De);if(!$e){var Le;$e=Me.get((Le=ye[Se-1])===null||Le===void 0?void 0:Le.key)||a}var at=ie.get(De)||Object(K.a)({},$e);at.right=le-at.left-at.width,ie.set(De,at)}return ie},[ye.map(function(we){return we.key}).join("_"),Me,We])}var R={width:0,height:0,left:0,top:0,right:0};function w(ye,Me,We,we,ie){var fe=ie.tabs,le=ie.tabPosition,Se=ie.rtl,De,$e,Le;["top","bottom"].includes(le)?(De="width",$e=Se?"right":"left",Le=Math.abs(Me.left)):(De="height",$e="top",Le=-Me.top);var at=Me[De],It=We[De],qt=we[De],un=at;return It+qt>at&&(un=at-qt),Object(A.useMemo)(function(){if(!fe.length)return[0,0];for(var Hn=fe.length,Gn=Hn,di=0;di<Hn;di+=1){var li=ye.get(fe[di].key)||R;if(li[$e]+li[De]>Le+un){Gn=di-1;break}}for(var Ei=0,Ri=Hn-1;Ri>=0;Ri-=1){var gi=ye.get(fe[Ri].key)||R;if(gi[$e]<Le){Ei=Ri+1;break}}return[Ei,Gn]},[ye,Le,un,le,fe.map(function(Hn){return Hn.key}).join("_"),Se])}var x=I("wx14"),O=I("1OyB"),C=I("vuIU"),_=I("JX7q"),y=I("Ji7U"),h=I("LK+K"),c=I("I8Z2"),v=I("bT9E"),p=I("2GS6"),E=I("Gytx"),U=I.n(E),F=I("U8pU"),z=/iPhone/i,G=/iPod/i,B=/iPad/i,T=/\bAndroid(?:.+)Mobile\b/i,V=/Android/i,Z=/\bAndroid(?:.+)SD4930UR\b/i,oe=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,pe=/Windows Phone/i,Ye=/\bWindows(?:.+)ARM\b/i,xe=/BlackBerry/i,Ie=/BB10/i,Je=/Opera Mini/i,Ke=/\b(CriOS|Chrome)(?:.+)Mobile/i,be=/Mobile(?:.+)Firefox\b/i;function de(ye,Me){return ye.test(Me)}function nt(ye){var Me=ye||(typeof navigator!="undefined"?navigator.userAgent:""),We=(Me||"").split("[FBAN");if(typeof We[1]!="undefined"){var we=We,ie=Object(Y.a)(we,1);Me=ie[0]}if(We=Me.split("Twitter"),typeof We[1]!="undefined"){var fe=We,le=Object(Y.a)(fe,1);Me=le[0]}var Se={apple:{phone:de(z,Me)&&!de(pe,Me),ipod:de(G,Me),tablet:!de(z,Me)&&de(B,Me)&&!de(pe,Me),device:(de(z,Me)||de(G,Me)||de(B,Me))&&!de(pe,Me)},amazon:{phone:de(Z,Me),tablet:!de(Z,Me)&&de(oe,Me),device:de(Z,Me)||de(oe,Me)},android:{phone:!de(pe,Me)&&de(Z,Me)||!de(pe,Me)&&de(T,Me),tablet:!de(pe,Me)&&!de(Z,Me)&&!de(T,Me)&&(de(oe,Me)||de(V,Me)),device:!de(pe,Me)&&(de(Z,Me)||de(oe,Me)||de(T,Me)||de(V,Me))||de(/\bokhttp\b/i,Me)},windows:{phone:de(pe,Me),tablet:de(Ye,Me),device:de(pe,Me)||de(Ye,Me)},other:{blackberry:de(xe,Me),blackberry10:de(Ie,Me),opera:de(Je,Me),firefox:de(be,Me),chrome:de(Ke,Me),device:de(xe,Me)||de(Ie,Me)||de(Je,Me)||de(be,Me)||de(Ke,Me)},any:null,phone:null,tablet:null};return Se.any=Se.apple.device||Se.android.device||Se.windows.device||Se.other.device,Se.phone=Se.apple.phone||Se.android.phone||Se.windows.phone,Se.tablet=Se.apple.tablet||Se.android.tablet||Se.windows.tablet,Se}var Kt=Object(K.a)(Object(K.a)({},nt()),{},{isMobile:nt}),jt=Kt;function wt(){}function ze(ye,Me,We){var we=Me||"";return ye.key||"".concat(we,"item_").concat(We)}function ft(ye){return"".concat(ye,"-menu-")}function dt(ye,Me){var We=-1;A.Children.forEach(ye,function(we){We+=1,we&&we.type&&we.type.isMenuItemGroup?A.Children.forEach(we.props.children,function(ie){We+=1,Me(ie,We)}):Me(we,We)})}function Nt(ye,Me,We){if(!ye||We.find)return;A.Children.forEach(ye,function(we){if(we){var ie=we.type;if(!ie||!(ie.isSubMenu||ie.isMenuItem||ie.isMenuItemGroup))return;Me.indexOf(we.key)!==-1?We.find=!0:we.props.children&&Nt(we.props.children,Me,We)}})}var Ze=["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"],Bt=function(Me){var We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,we=Me&&typeof Me.getBoundingClientRect=="function"&&Me.getBoundingClientRect().width;if(we){if(We){var ie=getComputedStyle(Me),fe=ie.marginLeft,le=ie.marginRight;we+=+fe.replace("px","")+ +le.replace("px","")}we=+we.toFixed(6)}return we||0},Ut=function(Me,We,we){Me&&Object(F.a)(Me.style)==="object"&&(Me.style[We]=we)},Mt=function(){return jt.any},An=I("bdgK"),mn=I("i8i4"),pn=I.n(mn),tt=I("wgJM"),fn=I("l4aY"),In=I("m+aA"),He=I("c+Xe"),Ue=I("zT1h"),pt=I("QC+M");function Ct(ye,Me,We){return We?ye[0]===Me[0]:ye[0]===Me[0]&&ye[1]===Me[1]}function Ge(ye,Me,We){var we=ye[Me]||{};return Object(K.a)(Object(K.a)({},we),We)}function vt(ye,Me,We,we){for(var ie=We.points,fe=Object.keys(ye),le=0;le<fe.length;le+=1){var Se=fe[le];if(Ct(ye[Se].points,ie,we))return"".concat(Me,"-placement-").concat(Se)}return""}var Ae=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var ye=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(ye)||/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(ye==null?void 0:ye.substr(0,4)))},ge=I("MNnm");function Ee(ye,Me){var We={};return We[ye.toLowerCase()]=Me.toLowerCase(),We["Webkit".concat(ye)]="webkit".concat(Me),We["Moz".concat(ye)]="moz".concat(Me),We["ms".concat(ye)]="MS".concat(Me),We["O".concat(ye)]="o".concat(Me.toLowerCase()),We}function ae(ye,Me){var We={animationend:Ee("Animation","AnimationEnd"),transitionend:Ee("Transition","TransitionEnd")};return ye&&("AnimationEvent"in Me||delete We.animationend.animation,"TransitionEvent"in Me||delete We.transitionend.transition),We}var re=ae(Object(ge.a)(),typeof window!="undefined"?window:{}),he={};if(Object(ge.a)()){var ve=document.createElement("div");he=ve.style}var me={};function Be(ye){if(me[ye])return me[ye];var Me=re[ye];if(Me)for(var We=Object.keys(Me),we=We.length,ie=0;ie<we;ie+=1){var fe=We[ie];if(Object.prototype.hasOwnProperty.call(Me,fe)&&fe in he)return me[ye]=Me[fe],me[ye]}return""}var Tt=Be("animationend"),Jt=Be("transitionend"),En=!!(Tt&&Jt),mt=Tt||"animationend",Qt=Jt||"transitionend";function gt(ye,Me){if(!ye)return null;if(Object(F.a)(ye)==="object"){var We=Me.replace(/-\w/g,function(we){return we[1].toUpperCase()});return ye[We]}return"".concat(ye,"-").concat(Me)}var yt="none",rt="appear",ce="enter",Re="leave",At="none",ot="prepare",Yt="start",rn="active",_e="end";function Ne(ye){var Me=Object(A.useRef)(!1),We=Object(A.useState)(ye),we=Object(Y.a)(We,2),ie=we[0],fe=we[1];function le(Se){Me.current||fe(Se)}return Object(A.useEffect)(function(){return function(){Me.current=!0}},[]),[ie,le]}var xt=Object(ge.a)()?A.useLayoutEffect:A.useEffect,Xt=xt,vn=function(){var ye=A.useRef(null);function Me(){tt.a.cancel(ye.current)}function We(we){var ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;Me();var fe=Object(tt.a)(function(){ie<=1?we({isCanceled:function(){return fe!==ye.current}}):We(we,ie-1)});ye.current=fe}return A.useEffect(function(){return function(){Me()}},[]),[We,Me]},Mn=[ot,Yt,rn,_e],ci=!1,$n=!0;function Cn(ye){return ye===rn||ye===_e}var Ti=function(ye,Me){var We=A.useState(At),we=Object(Y.a)(We,2),ie=we[0],fe=we[1],le=vn(),Se=Object(Y.a)(le,2),De=Se[0],$e=Se[1];function Le(){fe(ot)}return Xt(function(){if(ie!==At&&ie!==_e){var at=Mn.indexOf(ie),It=Mn[at+1],qt=Me(ie);qt===ci?fe(It):De(function(un){function Hn(){if(un.isCanceled())return;fe(It)}qt===!0?Hn():Promise.resolve(qt).then(Hn)})}},[ye,ie]),A.useEffect(function(){return function(){$e()}},[]),[Le,ie]},Wi=function(ye){var Me=Object(A.useRef)(),We=Object(A.useRef)(ye);We.current=ye;var we=A.useCallback(function(le){We.current(le)},[]);function ie(le){le&&(le.removeEventListener(Qt,we),le.removeEventListener(mt,we))}function fe(le){Me.current&&Me.current!==le&&ie(Me.current),le&&le!==Me.current&&(le.addEventListener(Qt,we),le.addEventListener(mt,we),Me.current=le)}return A.useEffect(function(){return function(){ie(Me.current)}},[]),[fe,ie]};function hi(ye,Me,We,we){var ie=we.motionEnter,fe=ie===void 0?!0:ie,le=we.motionAppear,Se=le===void 0?!0:le,De=we.motionLeave,$e=De===void 0?!0:De,Le=we.motionDeadline,at=we.motionLeaveImmediately,It=we.onAppearPrepare,qt=we.onEnterPrepare,un=we.onLeavePrepare,Hn=we.onAppearStart,Gn=we.onEnterStart,di=we.onLeaveStart,li=we.onAppearActive,Ei=we.onEnterActive,Ri=we.onLeaveActive,gi=we.onAppearEnd,xi=we.onEnterEnd,Di=we.onLeaveEnd,dn=we.onVisibleChanged,Zt=Ne(),yn=Object(Y.a)(Zt,2),Ht=yn[0],Wt=yn[1],pi=Ne(yt),Pi=Object(Y.a)(pi,2),ni=Pi[0],Ii=Pi[1],or=Ne(null),Ni=Object(Y.a)(or,2),Yi=Ni[0],zi=Ni[1],Hi=Object(A.useRef)(!1),Bi=Object(A.useRef)(null),vi=Object(A.useRef)(!1),_r=Object(A.useRef)(null);function Jr(){var sr=We();return sr||_r.current}var jr=Object(A.useRef)(!1);function Rr(sr){var Qi=Jr();if(sr&&!sr.deadline&&sr.target!==Qi)return;var wr;ni===rt&&jr.current?wr=gi==null?void 0:gi(Qi,sr):ni===ce&&jr.current?wr=xi==null?void 0:xi(Qi,sr):ni===Re&&jr.current&&(wr=Di==null?void 0:Di(Qi,sr)),wr!==!1&&!vi.current&&(Ii(yt),zi(null))}var ur=Wi(Rr),Zi=Object(Y.a)(ur,1),rr=Zi[0],dr=A.useMemo(function(){var sr,Qi,wr;switch(ni){case"appear":return sr={},Object(te.a)(sr,ot,It),Object(te.a)(sr,Yt,Hn),Object(te.a)(sr,rn,li),sr;case"enter":return Qi={},Object(te.a)(Qi,ot,qt),Object(te.a)(Qi,Yt,Gn),Object(te.a)(Qi,rn,Ei),Qi;case"leave":return wr={},Object(te.a)(wr,ot,un),Object(te.a)(wr,Yt,di),Object(te.a)(wr,rn,Ri),wr;default:return{}}},[ni]),Fr=Ti(ni,function(sr){if(sr===ot){var Qi=dr[ot];return Qi?Qi(Jr()):ci}if(qi in dr){var wr;zi(((wr=dr[qi])===null||wr===void 0?void 0:wr.call(dr,Jr(),null))||null)}return qi===rn&&(rr(Jr()),Le>0&&(clearTimeout(Bi.current),Bi.current=setTimeout(function(){Rr({deadline:!0})},Le))),$n}),ha=Object(Y.a)(Fr,2),sa=ha[0],qi=ha[1],Zr=Cn(qi);jr.current=Zr,Xt(function(){Wt(Me);var sr=Hi.current;if(Hi.current=!0,!ye)return;var Qi;!sr&&Me&&Se&&(Qi=rt),sr&&Me&&fe&&(Qi=ce),(sr&&!Me&&$e||!sr&&at&&!Me&&$e)&&(Qi=Re),Qi&&(Ii(Qi),sa())},[Me]),Object(A.useEffect)(function(){(ni===rt&&!Se||ni===ce&&!fe||ni===Re&&!$e)&&Ii(yt)},[Se,fe,$e]),Object(A.useEffect)(function(){return function(){clearTimeout(Bi.current),vi.current=!0}},[]),Object(A.useEffect)(function(){Ht!==void 0&&ni===yt&&(dn==null||dn(Ht))},[Ht,ni]);var qr=Yi;return dr[ot]&&qi===Yt&&(qr=Object(K.a)({transition:"none"},qr)),[ni,qi,qr,Ht!=null?Ht:Me]}var fi=function(ye){Object(y.a)(We,ye);var Me=Object(h.a)(We);function We(){return Object(O.a)(this,We),Me.apply(this,arguments)}return Object(C.a)(We,[{key:"render",value:function(){return this.props.children}}]),We}(A.Component),ji=fi;function er(ye){var Me=ye;Object(F.a)(ye)==="object"&&(Me=ye.transitionSupport);function We(ie){return!!(ie.motionName&&Me)}var we=A.forwardRef(function(ie,fe){var le=ie.visible,Se=le===void 0?!0:le,De=ie.removeOnLeave,$e=De===void 0?!0:De,Le=ie.forceRender,at=ie.children,It=ie.motionName,qt=ie.leavedClassName,un=ie.eventProps,Hn=We(ie),Gn=Object(A.useRef)(),di=Object(A.useRef)();function li(){try{return Object(In.a)(Gn.current||di.current)}catch(Ii){return null}}var Ei=hi(Hn,Se,li,ie),Ri=Object(Y.a)(Ei,4),gi=Ri[0],xi=Ri[1],Di=Ri[2],dn=Ri[3],Zt=A.useRef(dn);dn&&(Zt.current=!0);var yn=Object(A.useRef)(fe);yn.current=fe;var Ht=A.useCallback(function(Ii){Gn.current=Ii,Object(He.b)(yn.current,Ii)},[]),Wt,pi=Object(K.a)(Object(K.a)({},un),{},{visible:Se});if(!at)Wt=null;else if(gi===yt||!We(ie))dn?Wt=at(Object(K.a)({},pi),Ht):!$e&&Zt.current?Wt=at(Object(K.a)(Object(K.a)({},pi),{},{className:qt}),Ht):Le?Wt=at(Object(K.a)(Object(K.a)({},pi),{},{style:{display:"none"}}),Ht):Wt=null;else{var Pi,ni;xi===ot?ni="prepare":Cn(xi)?ni="active":xi===Yt&&(ni="start"),Wt=at(Object(K.a)(Object(K.a)({},pi),{},{className:H()(gt(It,gi),(Pi={},Object(te.a)(Pi,gt(It,"".concat(gi,"-").concat(ni)),ni),Object(te.a)(Pi,It,typeof It=="string"),Pi)),style:Di}),Ht)}return A.createElement(ji,{ref:di},Wt)});return we.displayName="CSSMotion",we}var yr=er(En),cn="add",ri="keep",pr="remove",Cr="removed";function tr(ye){var Me;return ye&&Object(F.a)(ye)==="object"&&"key"in ye?Me=ye:Me={key:ye},Object(K.a)(Object(K.a)({},Me),{},{key:String(Me.key)})}function nr(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return ye.map(tr)}function X(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],We=[],we=0,ie=Me.length,fe=nr(ye),le=nr(Me);fe.forEach(function($e){for(var Le=!1,at=we;at<ie;at+=1){var It=le[at];if(It.key===$e.key){we<at&&(We=We.concat(le.slice(we,at).map(function(qt){return Object(K.a)(Object(K.a)({},qt),{},{status:cn})})),we=at),We.push(Object(K.a)(Object(K.a)({},It),{},{status:ri})),we+=1,Le=!0;break}}Le||We.push(Object(K.a)(Object(K.a)({},$e),{},{status:pr}))}),we<ie&&(We=We.concat(le.slice(we).map(function($e){return Object(K.a)(Object(K.a)({},$e),{},{status:cn})})));var Se={};We.forEach(function($e){var Le=$e.key;Se[Le]=(Se[Le]||0)+1});var De=Object.keys(Se).filter(function($e){return Se[$e]>1});return De.forEach(function($e){We=We.filter(function(Le){var at=Le.key,It=Le.status;return at!==$e||It!==pr}),We.forEach(function(Le){Le.key===$e&&(Le.status=ri)})}),We}var S=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function L(ye){var Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:yr,We=function(we){Object(y.a)(fe,we);var ie=Object(h.a)(fe);function fe(){var le;return Object(O.a)(this,fe),le=ie.apply(this,arguments),le.state={keyEntities:[]},le.removeKey=function(Se){le.setState(function(De){var $e=De.keyEntities;return{keyEntities:$e.map(function(Le){return Le.key!==Se?Le:Object(K.a)(Object(K.a)({},Le),{},{status:Cr})})}})},le}return Object(C.a)(fe,[{key:"render",value:function(){var Se=this,De=this.state.keyEntities,$e=this.props,Le=$e.component,at=$e.children,It=$e.onVisibleChanged,qt=Object(N.a)($e,["component","children","onVisibleChanged"]),un=Le||A.Fragment,Hn={};return S.forEach(function(Gn){Hn[Gn]=qt[Gn],delete qt[Gn]}),delete qt.keys,A.createElement(un,qt,De.map(function(Gn){var di=Gn.status,li=Object(N.a)(Gn,["status"]),Ei=di===cn||di===ri;return A.createElement(Me,Object(x.a)({},Hn,{key:li.key,visible:Ei,eventProps:li,onVisibleChanged:function(gi){It==null||It(gi,{key:li.key}),gi||Se.removeKey(li.key)}}),at)}))}}],[{key:"getDerivedStateFromProps",value:function(Se,De){var $e=Se.keys,Le=De.keyEntities,at=nr($e),It=X(Le,at);return{keyEntities:It.filter(function(qt){var un=Le.find(function(Hn){var Gn=Hn.key;return qt.key===Gn});return!(un&&un.status===Cr&&qt.status===pr)})}}}]),fe}(A.Component);return We.defaultProps={component:"div"},We}var W=L(En),ne=yr;function Q(ye){var Me=ye.prefixCls,We=ye.motion,we=ye.animation,ie=ye.transitionName;return We||(we?{motionName:"".concat(Me,"-").concat(we)}:ie?{motionName:ie}:null)}function ke(ye){var Me=ye.prefixCls,We=ye.visible,we=ye.zIndex,ie=ye.mask,fe=ye.maskMotion,le=ye.maskAnimation,Se=ye.maskTransitionName;if(!ie)return null;var De={};return(fe||Se||le)&&(De=Object(K.a)({motionAppear:!0},Q({motion:fe,prefixCls:Me,transitionName:Se,animation:le}))),A.createElement(ne,Object(x.a)({},De,{visible:We,removeOnLeave:!0}),function($e){var Le=$e.className;return A.createElement("div",{style:{zIndex:we},className:H()("".concat(Me,"-mask"),Le)})})}var Vt=I("9mu1"),kn=I("o0o1"),Qn=I.n(kn),nn=I("HaE+"),ti=["measure","align",null,"motion"],qn=function(ye,Me){var We=Object(A.useState)(null),we=Object(Y.a)(We,2),ie=we[0],fe=we[1],le=Object(A.useRef)(),Se=Object(A.useRef)(!1);function De(at){Se.current||fe(at)}function $e(){tt.a.cancel(le.current)}function Le(at){$e(),le.current=Object(tt.a)(function(){De(function(It){switch(ie){case"align":return"motion";case"motion":return"stable";default:}return It}),at==null||at()})}return Object(A.useEffect)(function(){De("measure")},[ye]),Object(A.useEffect)(function(){switch(ie){case"measure":Me();break;default:}ie&&(le.current=Object(tt.a)(Object(nn.a)(Qn.a.mark(function at(){var It,qt;return Qn.a.wrap(function(Hn){for(;;)switch(Hn.prev=Hn.next){case 0:It=ti.indexOf(ie),qt=ti[It+1],qt&&It!==-1&&De(qt);case 3:case"end":return Hn.stop()}},at)}))))},[ie]),Object(A.useEffect)(function(){return function(){Se.current=!0,$e()}},[]),[ie,Le]},Li=function(ye){var Me=A.useState({width:0,height:0}),We=Object(Y.a)(Me,2),we=We[0],ie=We[1];function fe(Se){ie({width:Se.offsetWidth,height:Se.offsetHeight})}var le=A.useMemo(function(){var Se={};if(ye){var De=we.width,$e=we.height;ye.indexOf("height")!==-1&&$e?Se.height=$e:ye.indexOf("minHeight")!==-1&&$e&&(Se.minHeight=$e),ye.indexOf("width")!==-1&&De?Se.width=De:ye.indexOf("minWidth")!==-1&&De&&(Se.minWidth=De)}return Se},[ye,we]);return[le,fe]},lr=A.forwardRef(function(ye,Me){var We=ye.visible,we=ye.prefixCls,ie=ye.className,fe=ye.style,le=ye.children,Se=ye.zIndex,De=ye.stretch,$e=ye.destroyPopupOnHide,Le=ye.forceRender,at=ye.align,It=ye.point,qt=ye.getRootDomNode,un=ye.getClassNameFromAlign,Hn=ye.onAlign,Gn=ye.onMouseEnter,di=ye.onMouseLeave,li=ye.onMouseDown,Ei=ye.onTouchStart,Ri=Object(A.useRef)(),gi=Object(A.useRef)(),xi=Object(A.useState)(),Di=Object(Y.a)(xi,2),dn=Di[0],Zt=Di[1],yn=Li(De),Ht=Object(Y.a)(yn,2),Wt=Ht[0],pi=Ht[1];function Pi(){De&&pi(qt())}var ni=qn(We,Pi),Ii=Object(Y.a)(ni,2),or=Ii[0],Ni=Ii[1],Yi=Object(A.useRef)();function zi(){return It||qt}function Hi(){var ur;(ur=Ri.current)===null||ur===void 0||ur.forceAlign()}function Bi(ur,Zi){var rr=un(Zi);dn!==rr&&Zt(rr),or==="align"&&(dn!==rr?Promise.resolve().then(function(){Hi()}):Ni(function(){var dr;(dr=Yi.current)===null||dr===void 0||dr.call(Yi)}),Hn==null||Hn(ur,Zi))}var vi=Object(K.a)({},Q(ye));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(ur){var Zi=vi[ur];vi[ur]=function(rr,dr){return Ni(),Zi==null?void 0:Zi(rr,dr)}});function _r(){return new Promise(function(ur){Yi.current=ur})}A.useEffect(function(){!vi.motionName&&or==="motion"&&Ni()},[vi.motionName,or]),A.useImperativeHandle(Me,function(){return{forceAlign:Hi,getElement:function(){return gi.current}}});var Jr=Object(K.a)(Object(K.a)({},Wt),{},{zIndex:Se,opacity:or==="motion"||or==="stable"||!We?void 0:0,pointerEvents:or==="stable"?void 0:"none"},fe),jr=!0;(at==null?void 0:at.points)&&(or==="align"||or==="stable")&&(jr=!1);var Rr=le;return A.Children.count(le)>1&&(Rr=A.createElement("div",{className:"".concat(we,"-content")},le)),A.createElement(ne,Object(x.a)({visible:We,ref:gi,leavedClassName:"".concat(we,"-hidden")},vi,{onAppearPrepare:_r,onEnterPrepare:_r,removeOnLeave:$e,forceRender:Le}),function(ur,Zi){var rr=ur.className,dr=ur.style,Fr=H()(we,ie,dn,rr);return A.createElement(Vt.a,{target:zi(),key:"popup",ref:Ri,monitorWindowResize:!0,disabled:jr,align:at,onAlign:Bi},A.createElement("div",{ref:Zi,className:Fr,onMouseEnter:Gn,onMouseLeave:di,onMouseDownCapture:li,onTouchStartCapture:Ei,style:Object(K.a)(Object(K.a)({},dr),Jr)},Rr))})});lr.displayName="PopupInner";var ar=lr,Ki=A.forwardRef(function(ye,Me){var We=ye.prefixCls,we=ye.visible,ie=ye.zIndex,fe=ye.children,le=ye.mobile;le=le===void 0?{}:le;var Se=le.popupClassName,De=le.popupStyle,$e=le.popupMotion,Le=$e===void 0?{}:$e,at=le.popupRender,It=A.useRef();A.useImperativeHandle(Me,function(){return{forceAlign:function(){},getElement:function(){return It.current}}});var qt=Object(K.a)({zIndex:ie},De),un=fe;return A.Children.count(fe)>1&&(un=A.createElement("div",{className:"".concat(We,"-content")},fe)),at&&(un=at(un)),A.createElement(ne,Object(x.a)({visible:we,ref:It,removeOnLeave:!0},Le),function(Hn,Gn){var di=Hn.className,li=Hn.style,Ei=H()(We,Se,di);return A.createElement("div",{ref:Gn,className:Ei,style:Object(K.a)(Object(K.a)({},li),qt)},un)})});Ki.displayName="MobilePopupInner";var Pr=Ki,Vr=["visible","mobile"],Ai=A.forwardRef(function(ye,Me){var We=ye.visible,we=ye.mobile,ie=Object(N.a)(ye,Vr),fe=Object(A.useState)(We),le=Object(Y.a)(fe,2),Se=le[0],De=le[1],$e=Object(A.useState)(!1),Le=Object(Y.a)($e,2),at=Le[0],It=Le[1],qt=Object(K.a)(Object(K.a)({},ie),{},{visible:Se});Object(A.useEffect)(function(){De(We),We&&we&&It(Ae())},[We,we]);var un=at?A.createElement(Pr,Object(x.a)({},qt,{mobile:we,ref:Me})):A.createElement(ar,Object(x.a)({},qt,{ref:Me}));return A.createElement("div",null,A.createElement(ke,qt),un)});Ai.displayName="Popup";var wi=Ai,ir=A.createContext(null),Fi=ir;function Bn(){}function gn(){return""}function Tn(ye){return ye?ye.ownerDocument:window.document}var _n=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function si(ye){var Me=function(We){Object(y.a)(ie,We);var we=Object(h.a)(ie);function ie(fe){var le;Object(O.a)(this,ie),le=we.call(this,fe),le.popupRef=A.createRef(),le.triggerRef=A.createRef(),le.attachId=void 0,le.clickOutsideHandler=void 0,le.touchOutsideHandler=void 0,le.contextMenuOutsideHandler1=void 0,le.contextMenuOutsideHandler2=void 0,le.mouseDownTimeout=void 0,le.focusTime=void 0,le.preClickTime=void 0,le.preTouchTime=void 0,le.delayTimer=void 0,le.hasPopupMouseDown=void 0,le.onMouseEnter=function(De){var $e=le.props.mouseEnterDelay;le.fireEvents("onMouseEnter",De),le.delaySetPopupVisible(!0,$e,$e?null:De)},le.onMouseMove=function(De){le.fireEvents("onMouseMove",De),le.setPoint(De)},le.onMouseLeave=function(De){le.fireEvents("onMouseLeave",De),le.delaySetPopupVisible(!1,le.props.mouseLeaveDelay)},le.onPopupMouseEnter=function(){le.clearDelayTimer()},le.onPopupMouseLeave=function(De){var $e;if(De.relatedTarget&&!De.relatedTarget.setTimeout&&Object(fn.a)(($e=le.popupRef.current)===null||$e===void 0?void 0:$e.getElement(),De.relatedTarget))return;le.delaySetPopupVisible(!1,le.props.mouseLeaveDelay)},le.onFocus=function(De){le.fireEvents("onFocus",De),le.clearDelayTimer(),le.isFocusToShow()&&(le.focusTime=Date.now(),le.delaySetPopupVisible(!0,le.props.focusDelay))},le.onMouseDown=function(De){le.fireEvents("onMouseDown",De),le.preClickTime=Date.now()},le.onTouchStart=function(De){le.fireEvents("onTouchStart",De),le.preTouchTime=Date.now()},le.onBlur=function(De){le.fireEvents("onBlur",De),le.clearDelayTimer(),le.isBlurToHide()&&le.delaySetPopupVisible(!1,le.props.blurDelay)},le.onContextMenu=function(De){De.preventDefault(),le.fireEvents("onContextMenu",De),le.setPopupVisible(!0,De)},le.onContextMenuClose=function(){le.isContextMenuToShow()&&le.close()},le.onClick=function(De){if(le.fireEvents("onClick",De),le.focusTime){var $e;if(le.preClickTime&&le.preTouchTime?$e=Math.min(le.preClickTime,le.preTouchTime):le.preClickTime?$e=le.preClickTime:le.preTouchTime&&($e=le.preTouchTime),Math.abs($e-le.focusTime)<20)return;le.focusTime=0}le.preClickTime=0,le.preTouchTime=0,le.isClickToShow()&&(le.isClickToHide()||le.isBlurToHide())&&De&&De.preventDefault&&De.preventDefault();var Le=!le.state.popupVisible;(le.isClickToHide()&&!Le||Le&&le.isClickToShow())&&le.setPopupVisible(!le.state.popupVisible,De)},le.onPopupMouseDown=function(){if(le.hasPopupMouseDown=!0,clearTimeout(le.mouseDownTimeout),le.mouseDownTimeout=window.setTimeout(function(){le.hasPopupMouseDown=!1},0),le.context){var De;(De=le.context).onPopupMouseDown.apply(De,arguments)}},le.onDocumentClick=function(De){if(le.props.mask&&!le.props.maskClosable)return;var $e=De.target,Le=le.getRootDomNode(),at=le.getPopupDomNode();(!Object(fn.a)(Le,$e)||le.isContextMenuOnly())&&!Object(fn.a)(at,$e)&&!le.hasPopupMouseDown&&le.close()},le.getRootDomNode=function(){var De=le.props.getTriggerDOMNode;if(De)return De(le.triggerRef.current);try{var $e=Object(In.a)(le.triggerRef.current);if($e)return $e}catch(Le){}return pn.a.findDOMNode(Object(_.a)(le))},le.getPopupClassNameFromAlign=function(De){var $e=[],Le=le.props,at=Le.popupPlacement,It=Le.builtinPlacements,qt=Le.prefixCls,un=Le.alignPoint,Hn=Le.getPopupClassNameFromAlign;return at&&It&&$e.push(vt(It,qt,De,un)),Hn&&$e.push(Hn(De)),$e.join(" ")},le.getComponent=function(){var De=le.props,$e=De.prefixCls,Le=De.destroyPopupOnHide,at=De.popupClassName,It=De.onPopupAlign,qt=De.popupMotion,un=De.popupAnimation,Hn=De.popupTransitionName,Gn=De.popupStyle,di=De.mask,li=De.maskAnimation,Ei=De.maskTransitionName,Ri=De.maskMotion,gi=De.zIndex,xi=De.popup,Di=De.stretch,dn=De.alignPoint,Zt=De.mobile,yn=De.forceRender,Ht=le.state,Wt=Ht.popupVisible,pi=Ht.point,Pi=le.getPopupAlign(),ni={};return le.isMouseEnterToShow()&&(ni.onMouseEnter=le.onPopupMouseEnter),le.isMouseLeaveToHide()&&(ni.onMouseLeave=le.onPopupMouseLeave),ni.onMouseDown=le.onPopupMouseDown,ni.onTouchStart=le.onPopupMouseDown,A.createElement(wi,Object(x.a)({prefixCls:$e,destroyPopupOnHide:Le,visible:Wt,point:dn&&pi,className:at,align:Pi,onAlign:It,animation:un,getClassNameFromAlign:le.getPopupClassNameFromAlign},ni,{stretch:Di,getRootDomNode:le.getRootDomNode,style:Gn,mask:di,zIndex:gi,transitionName:Hn,maskAnimation:li,maskTransitionName:Ei,maskMotion:Ri,ref:le.popupRef,motion:qt,mobile:Zt,forceRender:yn}),typeof xi=="function"?xi():xi)},le.attachParent=function(De){tt.a.cancel(le.attachId);var $e=le.props,Le=$e.getPopupContainer,at=$e.getDocument,It=le.getRootDomNode(),qt;Le?(It||Le.length===0)&&(qt=Le(It)):qt=at(le.getRootDomNode()).body,qt?qt.appendChild(De):le.attachId=Object(tt.a)(function(){le.attachParent(De)})},le.getContainer=function(){var De=le.props.getDocument,$e=De(le.getRootDomNode()).createElement("div");return $e.style.position="absolute",$e.style.top="0",$e.style.left="0",$e.style.width="100%",le.attachParent($e),$e},le.setPoint=function(De){var $e=le.props.alignPoint;if(!$e||!De)return;le.setState({point:{pageX:De.pageX,pageY:De.pageY}})},le.handlePortalUpdate=function(){le.state.prevPopupVisible!==le.state.popupVisible&&le.props.afterPopupVisibleChange(le.state.popupVisible)},le.triggerContextValue={onPopupMouseDown:le.onPopupMouseDown};var Se;return"popupVisible"in fe?Se=!!fe.popupVisible:Se=!!fe.defaultPopupVisible,le.state={prevPopupVisible:Se,popupVisible:Se},_n.forEach(function(De){le["fire".concat(De)]=function($e){le.fireEvents(De,$e)}}),le}return Object(C.a)(ie,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var le=this.props,Se=this.state;if(Se.popupVisible){var De;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(De=le.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Ue.a)(De,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(De=De||le.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Ue.a)(De,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(De=De||le.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Ue.a)(De,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Ue.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),tt.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var le;return((le=this.popupRef.current)===null||le===void 0?void 0:le.getElement())||null}},{key:"getPopupAlign",value:function(){var le=this.props,Se=le.popupPlacement,De=le.popupAlign,$e=le.builtinPlacements;return Se&&$e?Ge($e,Se,De):De}},{key:"setPopupVisible",value:function(le,Se){var De=this.props.alignPoint,$e=this.state.popupVisible;this.clearDelayTimer(),$e!==le&&("popupVisible"in this.props||this.setState({popupVisible:le,prevPopupVisible:$e}),this.props.onPopupVisibleChange(le)),De&&Se&&le&&this.setPoint(Se)}},{key:"delaySetPopupVisible",value:function(le,Se,De){var $e=this,Le=Se*1e3;if(this.clearDelayTimer(),Le){var at=De?{pageX:De.pageX,pageY:De.pageY}:null;this.delayTimer=window.setTimeout(function(){$e.setPopupVisible(le,at),$e.clearDelayTimer()},Le)}else this.setPopupVisible(le,De)}},{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(le){var Se=this.props.children.props,De=this.props;return Se[le]&&De[le]?this["fire".concat(le)]:Se[le]||De[le]}},{key:"isClickToShow",value:function(){var le=this.props,Se=le.action,De=le.showAction;return Se.indexOf("click")!==-1||De.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var le=this.props.action;return le==="contextMenu"||le.length===1&&le[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var le=this.props,Se=le.action,De=le.showAction;return Se.indexOf("contextMenu")!==-1||De.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var le=this.props,Se=le.action,De=le.hideAction;return Se.indexOf("click")!==-1||De.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var le=this.props,Se=le.action,De=le.showAction;return Se.indexOf("hover")!==-1||De.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var le=this.props,Se=le.action,De=le.hideAction;return Se.indexOf("hover")!==-1||De.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var le=this.props,Se=le.action,De=le.showAction;return Se.indexOf("focus")!==-1||De.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var le=this.props,Se=le.action,De=le.hideAction;return Se.indexOf("focus")!==-1||De.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var le;(le=this.popupRef.current)===null||le===void 0||le.forceAlign()}}},{key:"fireEvents",value:function(le,Se){var De=this.props.children.props[le];De&&De(Se);var $e=this.props[le];$e&&$e(Se)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var le=this.state.popupVisible,Se=this.props,De=Se.children,$e=Se.forceRender,Le=Se.alignPoint,at=Se.className,It=Se.autoDestroy,qt=A.Children.only(De),un={key:"trigger"};this.isContextMenuToShow()?un.onContextMenu=this.onContextMenu:un.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(un.onClick=this.onClick,un.onMouseDown=this.onMouseDown,un.onTouchStart=this.onTouchStart):(un.onClick=this.createTwoChains("onClick"),un.onMouseDown=this.createTwoChains("onMouseDown"),un.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(un.onMouseEnter=this.onMouseEnter,Le&&(un.onMouseMove=this.onMouseMove)):un.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?un.onMouseLeave=this.onMouseLeave:un.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(un.onFocus=this.onFocus,un.onBlur=this.onBlur):(un.onFocus=this.createTwoChains("onFocus"),un.onBlur=this.createTwoChains("onBlur"));var Hn=H()(qt&&qt.props&&qt.props.className,at);Hn&&(un.className=Hn);var Gn=Object(K.a)({},un);Object(He.c)(qt)&&(Gn.ref=Object(He.a)(this.triggerRef,qt.ref));var di=A.cloneElement(qt,Gn),li;return(le||this.popupRef.current||$e)&&(li=A.createElement(ye,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!le&&It&&(li=null),A.createElement(Fi.Provider,{value:this.triggerContextValue},di,li)}}],[{key:"getDerivedStateFromProps",value:function(le,Se){var De=le.popupVisible,$e={};return De!==void 0&&Se.popupVisible!==De&&($e.popupVisible=De,$e.prevPopupVisible=Se.popupVisible),$e}}]),ie}(A.Component);return Me.contextType=Fi,Me.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:gn,getDocument:Tn,onPopupVisibleChange:Bn,afterPopupVisibleChange:Bn,onPopupAlign:Bn,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},Me}var ai=si(pt.a),J={adjustX:1,adjustY:1},ue={topLeft:{points:["bl","tl"],overflow:J,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:J,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:J,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:J,offset:[4,0]}},Ce={topLeft:{points:["bl","tl"],overflow:J,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:J,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:J,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:J,offset:[4,0]}},Te=ue,qe=0,Oe={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Ve=function(Me,We,we){var ie=ft(We),fe=Me.getState();Me.setState({defaultActiveFirst:Object(K.a)(Object(K.a)({},fe.defaultActiveFirst),{},Object(te.a)({},ie,we))})},et=function(ye){Object(y.a)(We,ye);var Me=Object(h.a)(We);function We(we){var ie;Object(O.a)(this,We),ie=Me.call(this,we),ie.onDestroy=function(Le){ie.props.onDestroy(Le)},ie.onKeyDown=function(Le){var at=Le.keyCode,It=ie.menuInstance,qt=ie.props.store,un=ie.getVisible();if(at===r.a.ENTER)return ie.onTitleClick(Le),Ve(qt,ie.props.eventKey,!0),!0;if(at===r.a.RIGHT)return un?It.onKeyDown(Le):(ie.triggerOpenChange(!0),Ve(qt,ie.props.eventKey,!0)),!0;if(at===r.a.LEFT){var Hn;if(un)Hn=It.onKeyDown(Le);else return;return Hn||(ie.triggerOpenChange(!1),Hn=!0),Hn}return un&&(at===r.a.UP||at===r.a.DOWN)?It.onKeyDown(Le):void 0},ie.onOpenChange=function(Le){ie.props.onOpenChange(Le)},ie.onPopupVisibleChange=function(Le){ie.triggerOpenChange(Le,Le?"mouseenter":"mouseleave")},ie.onMouseEnter=function(Le){var at=ie.props,It=at.eventKey,qt=at.onMouseEnter,un=at.store;Ve(un,ie.props.eventKey,!1),qt({key:It,domEvent:Le})},ie.onMouseLeave=function(Le){var at=ie.props,It=at.parentMenu,qt=at.eventKey,un=at.onMouseLeave;It.subMenuInstance=Object(_.a)(ie),un({key:qt,domEvent:Le})},ie.onTitleMouseEnter=function(Le){var at=ie.props,It=at.eventKey,qt=at.onItemHover,un=at.onTitleMouseEnter;qt({key:It,hover:!0}),un({key:It,domEvent:Le})},ie.onTitleMouseLeave=function(Le){var at=ie.props,It=at.parentMenu,qt=at.eventKey,un=at.onItemHover,Hn=at.onTitleMouseLeave;It.subMenuInstance=Object(_.a)(ie),un({key:qt,hover:!1}),Hn({key:qt,domEvent:Le})},ie.onTitleClick=function(Le){var at=Object(_.a)(ie),It=at.props;if(It.onTitleClick({key:It.eventKey,domEvent:Le}),It.triggerSubMenuAction==="hover")return;ie.triggerOpenChange(!ie.getVisible(),"click"),Ve(It.store,ie.props.eventKey,!1)},ie.onSubMenuClick=function(Le){typeof ie.props.onClick=="function"&&ie.props.onClick(ie.addKeyPath(Le))},ie.onSelect=function(Le){ie.props.onSelect(Le)},ie.onDeselect=function(Le){ie.props.onDeselect(Le)},ie.getPrefixCls=function(){return"".concat(ie.props.rootPrefixCls,"-submenu")},ie.getActiveClassName=function(){return"".concat(ie.getPrefixCls(),"-active")},ie.getDisabledClassName=function(){return"".concat(ie.getPrefixCls(),"-disabled")},ie.getSelectedClassName=function(){return"".concat(ie.getPrefixCls(),"-selected")},ie.getOpenClassName=function(){return"".concat(ie.props.rootPrefixCls,"-submenu-open")},ie.getVisible=function(){return ie.state.isOpen},ie.getMode=function(){return ie.state.mode},ie.saveMenuInstance=function(Le){ie.menuInstance=Le},ie.addKeyPath=function(Le){return Object(K.a)(Object(K.a)({},Le),{},{keyPath:(Le.keyPath||[]).concat(ie.props.eventKey)})},ie.triggerOpenChange=function(Le,at){var It=ie.props.eventKey,qt=function(){ie.onOpenChange({key:It,item:Object(_.a)(ie),trigger:at,open:Le})};at==="mouseenter"?ie.mouseenterTimeout=setTimeout(function(){qt()},0):qt()},ie.isChildrenSelected=function(){var Le={find:!1};return Nt(ie.props.children,ie.props.selectedKeys,Le),Le.find},ie.isInlineMode=function(){return ie.getMode()==="inline"},ie.adjustWidth=function(){if(!ie.subMenuTitle||!ie.menuInstance)return;var Le=mn.findDOMNode(ie.menuInstance);if(Le.offsetWidth>=ie.subMenuTitle.offsetWidth)return;Le.style.minWidth="".concat(ie.subMenuTitle.offsetWidth,"px")},ie.saveSubMenuTitle=function(Le){ie.subMenuTitle=Le},ie.getBaseProps=function(){var Le=Object(_.a)(ie),at=Le.props,It=ie.getMode();return{mode:It==="horizontal"?"vertical":It,visible:ie.getVisible(),level:at.level+1,inlineIndent:at.inlineIndent,focusable:!1,onClick:ie.onSubMenuClick,onSelect:ie.onSelect,onDeselect:ie.onDeselect,onDestroy:ie.onDestroy,selectedKeys:at.selectedKeys,eventKey:"".concat(at.eventKey,"-menu-"),openKeys:at.openKeys,motion:at.motion,onOpenChange:ie.onOpenChange,subMenuOpenDelay:at.subMenuOpenDelay,parentMenu:Object(_.a)(ie),subMenuCloseDelay:at.subMenuCloseDelay,forceSubMenuRender:at.forceSubMenuRender,triggerSubMenuAction:at.triggerSubMenuAction,builtinPlacements:at.builtinPlacements,defaultActiveFirst:at.store.getState().defaultActiveFirst[ft(at.eventKey)],multiple:at.multiple,prefixCls:at.rootPrefixCls,id:ie.internalMenuId,manualRef:ie.saveMenuInstance,itemIcon:at.itemIcon,expandIcon:at.expandIcon,direction:at.direction}},ie.getMotion=function(Le,at){var It=Object(_.a)(ie),qt=It.haveRendered,un=ie.props,Hn=un.motion,Gn=un.rootPrefixCls,di=Object(K.a)(Object(K.a)({},Hn),{},{leavedClassName:"".concat(Gn,"-hidden"),removeOnLeave:!1,motionAppear:qt||!at||Le!=="inline"});return di};var fe=we.store,le=we.eventKey,Se=fe.getState(),De=Se.defaultActiveFirst;ie.isRootMenu=!1;var $e=!1;return De&&($e=De[le]),Ve(fe,le,$e),ie.state={mode:we.mode,isOpen:we.isOpen},ie}return Object(C.a)(We,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ie=this,fe=this.props,le=fe.mode,Se=fe.parentMenu,De=fe.manualRef,$e=fe.isOpen,Le=function(){ie.setState({mode:le,isOpen:$e})},at=$e!==this.state.isOpen,It=le!==this.state.mode;if((It||at)&&(tt.a.cancel(this.updateStateRaf),It?this.updateStateRaf=Object(tt.a)(Le):Le()),De&&De(this),le!=="horizontal"||!(Se==null?void 0:Se.isRootMenu)||!$e)return;this.minWidthTimeout=setTimeout(function(){return ie.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var ie=this.props,fe=ie.onDestroy,le=ie.eventKey;fe&&fe(le),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),tt.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(ie,fe){var le=this.getBaseProps();return A.createElement(wn,Object(x.a)({},le,{id:this.internalMenuId,className:ie,style:fe}),this.props.children)}},{key:"renderChildren",value:function(){var ie=this,fe=this.getBaseProps(),le=fe.mode,Se=fe.visible,De=fe.forceSubMenuRender,$e=fe.direction,Le=this.getMotion(le,Se);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||Se||De,!this.haveOpened)return A.createElement("div",null);var at=H()("".concat(fe.prefixCls,"-sub"),Object(te.a)({},"".concat(fe.prefixCls,"-rtl"),$e==="rtl"));return this.isInlineMode()?A.createElement(ne,Object(x.a)({visible:fe.visible,forceRender:De},Le),function(It){var qt=It.className,un=It.style,Hn=H()(at,qt);return ie.renderPopupMenu(Hn,un)}):this.renderPopupMenu(at)}},{key:"render",value:function(){var ie,fe,le,Se=Object(K.a)({},this.props),De=this.getVisible(),$e=this.getPrefixCls(),Le=this.isInlineMode(),at=this.getMode(),It=H()($e,"".concat($e,"-").concat(at),(ie={},Object(te.a)(ie,Se.className,!!Se.className),Object(te.a)(ie,this.getOpenClassName(),De),Object(te.a)(ie,this.getActiveClassName(),Se.active||De&&!Le),Object(te.a)(ie,this.getDisabledClassName(),Se.disabled),Object(te.a)(ie,this.getSelectedClassName(),this.isChildrenSelected()),ie));this.internalMenuId||(Se.eventKey?this.internalMenuId="".concat(Se.eventKey,"$Menu"):(qe+=1,this.internalMenuId="$__$".concat(qe,"$Menu")));var qt={},un={},Hn={};Se.disabled||(qt={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},un={onClick:this.onTitleClick},Hn={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Gn={},di=Se.direction,li=di==="rtl";Le&&(li?Gn.paddingRight=Se.inlineIndent*Se.level:Gn.paddingLeft=Se.inlineIndent*Se.level);var Ei={};this.getVisible()&&(Ei={"aria-owns":this.internalMenuId});var Ri=null;at!=="horizontal"&&(Ri=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(Ri=A.createElement(this.props.expandIcon,Object(K.a)({},this.props))));var gi=A.createElement("div",Object(x.a)({ref:this.saveSubMenuTitle,style:Gn,className:"".concat($e,"-title"),role:"button"},Hn,un,{"aria-expanded":De},Ei,{"aria-haspopup":"true",title:typeof Se.title=="string"?Se.title:void 0}),Se.title,Ri||A.createElement("i",{className:"".concat($e,"-arrow")})),xi=this.renderChildren(),Di=((fe=Se.parentMenu)===null||fe===void 0?void 0:fe.isRootMenu)?Se.parentMenu.props.getPopupContainer:function(zi){return zi.parentNode},dn=Oe[at],Zt=Se.popupOffset?{offset:Se.popupOffset}:{},yn=H()((le={},Object(te.a)(le,Se.popupClassName,Se.popupClassName&&!Le),Object(te.a)(le,"".concat($e,"-rtl"),li),le)),Ht=Se.disabled,Wt=Se.triggerSubMenuAction,pi=Se.subMenuOpenDelay,Pi=Se.forceSubMenuRender,ni=Se.subMenuCloseDelay,Ii=Se.builtinPlacements;Ze.forEach(function(zi){return delete Se[zi]}),delete Se.onClick;var or=li?Object(K.a)(Object(K.a)({},Ce),Ii):Object(K.a)(Object(K.a)({},ue),Ii);delete Se.direction;var Ni=this.getBaseProps(),Yi=Le?null:this.getMotion(Ni.mode,Ni.visible);return A.createElement("li",Object(x.a)({},Se,qt,{className:It,role:"menuitem"}),A.createElement(ai,{prefixCls:$e,popupClassName:H()("".concat($e,"-popup"),yn),getPopupContainer:Di,builtinPlacements:or,popupPlacement:dn,popupVisible:Le?!1:De,popupAlign:Zt,popup:Le?null:xi,action:Ht||Le?[]:[Wt],mouseEnterDelay:pi,mouseLeaveDelay:ni,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:Pi,popupMotion:Yi},gi),Le?xi:null)}}]),We}(A.Component);et.defaultProps={onMouseEnter:wt,onMouseLeave:wt,onTitleMouseEnter:wt,onTitleMouseLeave:wt,onTitleClick:wt,manualRef:wt,mode:"vertical",title:""};var Ot=Object(c.b)(function(ye,Me){var We=ye.openKeys,we=ye.activeKey,ie=ye.selectedKeys,fe=Me.eventKey,le=Me.subMenuKey;return{isOpen:We.indexOf(fe)>-1,active:we[le]===fe,selectedKeys:ie}})(et);Ot.isSubMenu=!0;var Et=Ot,je="menuitem-overflowed",ht=.5,it=function(ye){Object(y.a)(We,ye);var Me=Object(h.a)(We);function We(){var we;return Object(O.a)(this,We),we=Me.apply(this,arguments),we.resizeObserver=null,we.mutationObserver=null,we.originalTotalWidth=0,we.overflowedItems=[],we.menuItemSizes=[],we.cancelFrameId=null,we.state={lastVisibleIndex:void 0},we.childRef=A.createRef(),we.getMenuItemNodes=function(){var ie=we.props.prefixCls,fe=we.childRef.current;return fe?[].slice.call(fe.children).filter(function(le){return le.className.split(" ").indexOf("".concat(ie,"-overflowed-submenu"))<0}):[]},we.getOverflowedSubMenuItem=function(ie,fe,le){var Se=we.props,De=Se.overflowedIndicator,$e=Se.level,Le=Se.mode,at=Se.prefixCls,It=Se.theme;if($e!==1||Le!=="horizontal")return null;var qt=we.props.children[0],un=qt.props,Hn=un.children,Gn=un.title,di=un.style,li=Object(N.a)(un,["children","title","style"]),Ei=Object(K.a)({},di),Ri="".concat(ie,"-overflowed-indicator"),gi="".concat(ie,"-overflowed-indicator");fe.length===0&&le!==!0?Ei=Object(K.a)(Object(K.a)({},Ei),{},{display:"none"}):le&&(Ei=Object(K.a)(Object(K.a)({},Ei),{},{visibility:"hidden",position:"absolute"}),Ri="".concat(Ri,"-placeholder"),gi="".concat(gi,"-placeholder"));var xi=It?"".concat(at,"-").concat(It):"",Di={};return Ze.forEach(function(dn){li[dn]!==void 0&&(Di[dn]=li[dn])}),A.createElement(Et,Object(x.a)({title:De,className:"".concat(at,"-overflowed-submenu"),popupClassName:xi},Di,{key:Ri,eventKey:gi,disabled:!1,style:Ei}),fe)},we.setChildrenWidthAndResize=function(){if(we.props.mode!=="horizontal")return;var ie=we.childRef.current;if(!ie)return;var fe=ie.children;if(!fe||fe.length===0)return;var le=ie.children[fe.length-1];Ut(le,"display","inline-block");var Se=we.getMenuItemNodes(),De=Se.filter(function($e){return $e.className.split(" ").indexOf(je)>=0});De.forEach(function($e){Ut($e,"display","inline-block")}),we.menuItemSizes=Se.map(function($e){return Bt($e,!0)}),De.forEach(function($e){Ut($e,"display","none")}),we.overflowedIndicatorWidth=Bt(ie.children[ie.children.length-1],!0),we.originalTotalWidth=we.menuItemSizes.reduce(function($e,Le){return $e+Le},0),we.handleResize(),Ut(le,"display","none")},we.handleResize=function(){if(we.props.mode!=="horizontal")return;var ie=we.childRef.current;if(!ie)return;var fe=Bt(ie);we.overflowedItems=[];var le=0,Se;we.originalTotalWidth>fe+ht&&(Se=-1,we.menuItemSizes.forEach(function(De){le+=De,le+we.overflowedIndicatorWidth<=fe&&(Se+=1)})),we.setState({lastVisibleIndex:Se})},we}return Object(C.a)(We,[{key:"componentDidMount",value:function(){var ie=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var fe=this.childRef.current;if(!fe)return;this.resizeObserver=new An.default(function(le){le.forEach(function(){var Se=ie.cancelFrameId;cancelAnimationFrame(Se),ie.cancelFrameId=requestAnimationFrame(ie.setChildrenWidthAndResize)})}),[].slice.call(fe.children).concat(fe).forEach(function(le){ie.resizeObserver.observe(le)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){ie.resizeObserver.disconnect(),[].slice.call(fe.children).concat(fe).forEach(function(le){ie.resizeObserver.observe(le)}),ie.setChildrenWidthAndResize()}),this.mutationObserver.observe(fe,{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(ie){var fe=this,le=this.state.lastVisibleIndex;return(ie||[]).reduce(function(Se,De,$e){var Le=De;if(fe.props.mode==="horizontal"){var at=fe.getOverflowedSubMenuItem(De.props.eventKey,[]);le!==void 0&&fe.props.className.indexOf("".concat(fe.props.prefixCls,"-root"))!==-1&&($e>le&&(Le=A.cloneElement(De,{style:{display:"none"},eventKey:"".concat(De.props.eventKey,"-hidden"),className:"".concat(je)})),$e===le+1&&(fe.overflowedItems=ie.slice(le+1).map(function(qt){return A.cloneElement(qt,{key:qt.props.eventKey,mode:"vertical-left"})}),at=fe.getOverflowedSubMenuItem(De.props.eventKey,fe.overflowedItems)));var It=[].concat(Object(D.a)(Se),[at,Le]);return $e===ie.length-1&&It.push(fe.getOverflowedSubMenuItem(De.props.eventKey,[],!0)),It}return[].concat(Object(D.a)(Se),[Le])},[])}},{key:"render",value:function(){var ie=this.props,fe=ie.visible,le=ie.prefixCls,Se=ie.overflowedIndicator,De=ie.mode,$e=ie.level,Le=ie.tag,at=ie.children,It=ie.theme,qt=Object(N.a)(ie,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),un=Le;return A.createElement(un,Object(x.a)({ref:this.childRef},qt),this.renderChildren(at))}}]),We}(A.Component);it.defaultProps={tag:"div",className:""};var st=it;function bt(ye){return ye.length?ye.every(function(Me){return!!Me.props.disabled}):!0}function Lt(ye,Me,We){var we=ye.getState();ye.setState({activeKey:Object(K.a)(Object(K.a)({},we.activeKey),{},Object(te.a)({},Me,We))})}function ct(ye){return ye.eventKey||"0-menu-"}function Gt(ye,Me){var We=Me,we=ye.children,ie=ye.eventKey;if(We){var fe;if(dt(we,function(le,Se){le&&le.props&&!le.props.disabled&&We===ze(le,ie,Se)&&(fe=!0)}),fe)return We}return We=null,ye.defaultActiveFirst&&dt(we,function(le,Se){!We&&le&&!le.props.disabled&&(We=ze(le,ie,Se))}),We}function on(ye){if(!ye)return;var Me=this.instanceArray.indexOf(ye);Me!==-1?this.instanceArray[Me]=ye:this.instanceArray.push(ye)}var Dn=function(ye){Object(y.a)(We,ye);var Me=Object(h.a)(We);function We(we){var ie;return Object(O.a)(this,We),ie=Me.call(this,we),ie.onKeyDown=function(fe,le){var Se=fe.keyCode,De;if(ie.getFlatInstanceArray().forEach(function(Le){Le&&Le.props.active&&Le.onKeyDown&&(De=Le.onKeyDown(fe))}),De)return 1;var $e=null;return(Se===r.a.UP||Se===r.a.DOWN)&&($e=ie.step(Se===r.a.UP?-1:1)),$e?(fe.preventDefault(),Lt(ie.props.store,ct(ie.props),$e.props.eventKey),typeof le=="function"&&le($e),1):void 0},ie.onItemHover=function(fe){var le=fe.key,Se=fe.hover;Lt(ie.props.store,ct(ie.props),Se?le:null)},ie.onDeselect=function(fe){ie.props.onDeselect(fe)},ie.onSelect=function(fe){ie.props.onSelect(fe)},ie.onClick=function(fe){ie.props.onClick(fe)},ie.onOpenChange=function(fe){ie.props.onOpenChange(fe)},ie.onDestroy=function(fe){ie.props.onDestroy(fe)},ie.getFlatInstanceArray=function(){return ie.instanceArray},ie.step=function(fe){var le=ie.getFlatInstanceArray(),Se=ie.props.store.getState().activeKey[ct(ie.props)],De=le.length;if(!De)return null;fe<0&&(le=le.concat().reverse());var $e=-1;if(le.every(function(qt,un){return qt&&qt.props.eventKey===Se?($e=un,!1):!0}),!ie.props.defaultActiveFirst&&$e!==-1&&bt(le.slice($e,De-1)))return;var Le=($e+1)%De,at=Le;do{var It=le[at];if(!It||It.props.disabled)at=(at+1)%De;else return It}while(at!==Le);return null},ie.renderCommonMenuItem=function(fe,le,Se){var De=ie.props.store.getState(),$e=Object(_.a)(ie),Le=$e.props,at=ze(fe,Le.eventKey,le),It=fe.props;if(!It||typeof fe.type=="string")return fe;var qt=at===De.activeKey,un=Object(K.a)(Object(K.a)({mode:It.mode||Le.mode,level:Le.level,inlineIndent:Le.inlineIndent,renderMenuItem:ie.renderMenuItem,rootPrefixCls:Le.prefixCls,index:le,parentMenu:Le.parentMenu,manualRef:It.disabled?void 0:Object(p.a)(fe.ref,on.bind(Object(_.a)(ie))),eventKey:at,active:!It.disabled&&qt,multiple:Le.multiple,onClick:function(Gn){(It.onClick||wt)(Gn),ie.onClick(Gn)},onItemHover:ie.onItemHover,motion:Le.motion,subMenuOpenDelay:Le.subMenuOpenDelay,subMenuCloseDelay:Le.subMenuCloseDelay,forceSubMenuRender:Le.forceSubMenuRender,onOpenChange:ie.onOpenChange,onDeselect:ie.onDeselect,onSelect:ie.onSelect,builtinPlacements:Le.builtinPlacements,itemIcon:It.itemIcon||ie.props.itemIcon,expandIcon:It.expandIcon||ie.props.expandIcon},Se),{},{direction:Le.direction});return(Le.mode==="inline"||Mt())&&(un.triggerSubMenuAction="click"),A.cloneElement(fe,Object(K.a)(Object(K.a)({},un),{},{key:at||le}))},ie.renderMenuItem=function(fe,le,Se){if(!fe)return null;var De=ie.props.store.getState(),$e={openKeys:De.openKeys,selectedKeys:De.selectedKeys,triggerSubMenuAction:ie.props.triggerSubMenuAction,subMenuKey:Se};return ie.renderCommonMenuItem(fe,le,$e)},we.store.setState({activeKey:Object(K.a)(Object(K.a)({},we.store.getState().activeKey),{},Object(te.a)({},we.eventKey,Gt(we,we.activeKey)))}),ie.instanceArray=[],ie}return Object(C.a)(We,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(ie){return this.props.visible||ie.visible||this.props.className!==ie.className||!U()(this.props.style,ie.style)}},{key:"componentDidUpdate",value:function(ie){var fe=this.props,le="activeKey"in fe?fe.activeKey:fe.store.getState().activeKey[ct(fe)],Se=Gt(fe,le);if(Se!==le)Lt(fe.store,ct(fe),Se);else if("activeKey"in ie){var De=Gt(ie,ie.activeKey);Se!==De&&Lt(fe.store,ct(fe),Se)}}},{key:"render",value:function(){var ie=this,fe=Object(x.a)({},this.props);this.instanceArray=[];var le=H()(fe.prefixCls,fe.className,"".concat(fe.prefixCls,"-").concat(fe.mode)),Se={className:le,role:fe.role||"menu"};fe.id&&(Se.id=fe.id),fe.focusable&&(Se.tabIndex=0,Se.onKeyDown=this.onKeyDown);var De=fe.prefixCls,$e=fe.eventKey,Le=fe.visible,at=fe.level,It=fe.mode,qt=fe.overflowedIndicator,un=fe.theme;return Ze.forEach(function(Hn){return delete fe[Hn]}),delete fe.onClick,A.createElement(st,Object(x.a)({},fe,{prefixCls:De,mode:It,tag:"ul",level:at,theme:un,visible:Le,overflowedIndicator:qt},Se),Object(P.a)(fe.children).map(function(Hn,Gn){return ie.renderMenuItem(Hn,Gn,$e||"0-menu-")}))}}]),We}(A.Component);Dn.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:wt};var Kn=Object(c.b)()(Dn),wn=Kn,Nn=I("Kwbf");function Pn(ye,Me,We){var we=ye.prefixCls,ie=ye.motion,fe=ye.defaultMotions,le=fe===void 0?{}:fe,Se=ye.openAnimation,De=ye.openTransitionName,$e=Me.switchingModeFromInline;if(ie)return ie;if(Object(F.a)(Se)==="object"&&Se)Object(Nn.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof Se=="string")return{motionName:"".concat(we,"-open-").concat(Se)};if(De)return{motionName:De};var Le=le[We];return Le||($e?null:le.other)}var Dt=function(ye){Object(y.a)(We,ye);var Me=Object(h.a)(We);function We(we){var ie;Object(O.a)(this,We),ie=Me.call(this,we),ie.onSelect=function(Se){var De=Object(_.a)(ie),$e=De.props;if($e.selectable){var Le=ie.store.getState(),at=Le.selectedKeys,It=Se.key;$e.multiple?at=at.concat([It]):at=[It],"selectedKeys"in $e||ie.store.setState({selectedKeys:at}),$e.onSelect(Object(K.a)(Object(K.a)({},Se),{},{selectedKeys:at}))}},ie.onClick=function(Se){var De=ie.getRealMenuMode(),$e=Object(_.a)(ie),Le=$e.store,at=$e.props.onOpenChange;De!=="inline"&&!("openKeys"in ie.props)&&(Le.setState({openKeys:[]}),at([])),ie.props.onClick(Se)},ie.onKeyDown=function(Se,De){ie.innerMenu.getWrappedInstance().onKeyDown(Se,De)},ie.onOpenChange=function(Se){var De=Object(_.a)(ie),$e=De.props,Le=ie.store.getState().openKeys.concat(),at=!1,It=function(un){var Hn=!1;if(un.open)Hn=Le.indexOf(un.key)===-1,Hn&&Le.push(un.key);else{var Gn=Le.indexOf(un.key);Hn=Gn!==-1,Hn&&Le.splice(Gn,1)}at=at||Hn};Array.isArray(Se)?Se.forEach(It):It(Se),at&&("openKeys"in ie.props||ie.store.setState({openKeys:Le}),$e.onOpenChange(Le))},ie.onDeselect=function(Se){var De=Object(_.a)(ie),$e=De.props;if($e.selectable){var Le=ie.store.getState().selectedKeys.concat(),at=Se.key,It=Le.indexOf(at);It!==-1&&Le.splice(It,1),"selectedKeys"in $e||ie.store.setState({selectedKeys:Le}),$e.onDeselect(Object(K.a)(Object(K.a)({},Se),{},{selectedKeys:Le}))}},ie.onMouseEnter=function(Se){ie.restoreModeVerticalFromInline();var De=ie.props.onMouseEnter;De&&De(Se)},ie.onTransitionEnd=function(Se){var De=Se.propertyName==="width"&&Se.target===Se.currentTarget,$e=Se.target.className,Le=Object.prototype.toString.call($e)==="[object SVGAnimatedString]"?$e.animVal:$e,at=Se.propertyName==="font-size"&&Le.indexOf("anticon")>=0;(De||at)&&ie.restoreModeVerticalFromInline()},ie.setInnerMenu=function(Se){ie.innerMenu=Se},ie.isRootMenu=!0;var fe=we.defaultSelectedKeys,le=we.defaultOpenKeys;return"selectedKeys"in we&&(fe=we.selectedKeys||[]),"openKeys"in we&&(le=we.openKeys||[]),ie.store=Object(c.c)({selectedKeys:fe,openKeys:le,activeKey:{"0-menu-":Gt(we,we.activeKey)}}),ie.state={switchingModeFromInline:!1,prevProps:we,inlineOpenKeys:[],store:ie.store},ie}return Object(C.a)(We,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(ie){var fe=this.props,le=fe.siderCollapsed,Se=fe.inlineCollapsed,De=fe.onOpenChange;(!ie.inlineCollapsed&&Se||!ie.siderCollapsed&&le)&&De([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var ie=this.props.collapsedWidth,fe=this.store,le=this.prevOpenKeys,Se=this.getInlineCollapsed()&&(ie===0||ie==="0"||ie==="0px");Se?(this.prevOpenKeys=fe.getState().openKeys.concat(),this.store.setState({openKeys:[]})):le&&(this.store.setState({openKeys:le}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var ie=this.props.mode,fe=this.state.switchingModeFromInline,le=this.getInlineCollapsed();return fe&&le?"inline":le?"vertical":ie}},{key:"getInlineCollapsed",value:function(){var ie=this.props,fe=ie.inlineCollapsed,le=ie.siderCollapsed;return le!==void 0?le:fe}},{key:"restoreModeVerticalFromInline",value:function(){var ie=this.state.switchingModeFromInline;ie&&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 ie=Object(K.a)({},Object(v.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),fe=this.getRealMenuMode();return ie.className+=" ".concat(ie.prefixCls,"-root"),ie.direction==="rtl"&&(ie.className+=" ".concat(ie.prefixCls,"-rtl")),ie=Object(K.a)(Object(K.a)({},ie),{},{mode:fe,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Pn(this.props,this.state,fe)}),delete ie.openAnimation,delete ie.openTransitionName,A.createElement(c.a,{store:this.store},A.createElement(wn,Object(x.a)({},ie,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(ie,fe){var le=fe.prevProps,Se=fe.store,De=Se.getState(),$e={},Le={prevProps:ie};return le.mode==="inline"&&ie.mode!=="inline"&&(Le.switchingModeFromInline=!0),"openKeys"in ie?$e.openKeys=ie.openKeys||[]:((ie.inlineCollapsed&&!le.inlineCollapsed||ie.siderCollapsed&&!le.siderCollapsed)&&(Le.switchingModeFromInline=!0,Le.inlineOpenKeys=De.openKeys,$e.openKeys=[]),(!ie.inlineCollapsed&&le.inlineCollapsed||!ie.siderCollapsed&&le.siderCollapsed)&&($e.openKeys=fe.inlineOpenKeys,Le.inlineOpenKeys=[])),Object.keys($e).length&&Se.setState($e),Le}}]),We}(A.Component);Dt.defaultProps={selectable:!0,onClick:wt,onSelect:wt,onOpenChange:wt,onDeselect:wt,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:A.createElement("span",null,"\xB7\xB7\xB7")};var sn=Dt,Ft=function(ye){Object(y.a)(We,ye);var Me=Object(h.a)(We);function We(){var we;return Object(O.a)(this,We),we=Me.apply(this,arguments),we.onKeyDown=function(ie){var fe=ie.keyCode;return fe===r.a.ENTER?(we.onClick(ie),!0):void 0},we.onMouseLeave=function(ie){var fe=we.props,le=fe.eventKey,Se=fe.onItemHover,De=fe.onMouseLeave;Se({key:le,hover:!1}),De({key:le,domEvent:ie})},we.onMouseEnter=function(ie){var fe=we.props,le=fe.eventKey,Se=fe.onItemHover,De=fe.onMouseEnter;Se({key:le,hover:!0}),De({key:le,domEvent:ie})},we.onClick=function(ie){var fe=we.props,le=fe.eventKey,Se=fe.multiple,De=fe.onClick,$e=fe.onSelect,Le=fe.onDeselect,at=fe.isSelected,It={key:le,keyPath:[le],item:Object(_.a)(we),domEvent:ie};De(It),Se?at?Le(It):$e(It):at||$e(It)},we.saveNode=function(ie){we.node=ie},we}return Object(C.a)(We,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var ie=this.props;ie.onDestroy&&ie.onDestroy(ie.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 ie,fe=Object(K.a)({},this.props),le=H()(this.getPrefixCls(),fe.className,(ie={},Object(te.a)(ie,this.getActiveClassName(),!fe.disabled&&fe.active),Object(te.a)(ie,this.getSelectedClassName(),fe.isSelected),Object(te.a)(ie,this.getDisabledClassName(),fe.disabled),ie)),Se=Object(K.a)(Object(K.a)({},fe.attribute),{},{title:typeof fe.title=="string"?fe.title:void 0,className:le,role:fe.role||"menuitem","aria-disabled":fe.disabled});fe.role==="option"?Se=Object(K.a)(Object(K.a)({},Se),{},{role:"option","aria-selected":fe.isSelected}):(fe.role===null||fe.role==="none")&&(Se.role="none");var De={onClick:fe.disabled?null:this.onClick,onMouseLeave:fe.disabled?null:this.onMouseLeave,onMouseEnter:fe.disabled?null:this.onMouseEnter},$e=Object(K.a)({},fe.style);fe.mode==="inline"&&(fe.direction==="rtl"?$e.paddingRight=fe.inlineIndent*fe.level:$e.paddingLeft=fe.inlineIndent*fe.level),Ze.forEach(function(at){return delete fe[at]}),delete fe.direction;var Le=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Le=A.createElement(this.props.itemIcon,this.props)),A.createElement("li",Object(x.a)({},Object(v.a)(fe,["onClick","onMouseEnter","onMouseLeave","onSelect"]),Se,De,{style:$e,ref:this.saveNode}),fe.children,Le)}}]),We}(A.Component);Ft.isMenuItem=!0,Ft.defaultProps={onSelect:wt,onMouseEnter:wt,onMouseLeave:wt,manualRef:wt};var St=Object(c.b)(function(ye,Me){var We=ye.activeKey,we=ye.selectedKeys,ie=Me.eventKey,fe=Me.subMenuKey;return{active:We[fe]===ie,isSelected:Array.isArray(we)?we.indexOf(ie)!==-1:we===ie}})(Ft),Un=St,Sn=function(ye){Object(y.a)(We,ye);var Me=Object(h.a)(We);function We(){var we;return Object(O.a)(this,We),we=Me.apply(this,arguments),we.renderInnerMenuItem=function(ie){var fe=we.props,le=fe.renderMenuItem,Se=fe.index;return le(ie,Se,we.props.subMenuKey)},we}return Object(C.a)(We,[{key:"render",value:function(){var ie=Object(x.a)({},this.props),fe=ie.className,le=fe===void 0?"":fe,Se=ie.rootPrefixCls,De="".concat(Se,"-item-group-title"),$e="".concat(Se,"-item-group-list"),Le=ie.title,at=ie.children;return Ze.forEach(function(It){return delete ie[It]}),delete ie.direction,A.createElement("li",Object(x.a)({},ie,{onClick:function(qt){return qt.stopPropagation()},className:"".concat(le," ").concat(Se,"-item-group")}),A.createElement("div",{className:De,title:typeof Le=="string"?Le:void 0},Le),A.createElement("ul",{className:$e},A.Children.map(at,this.renderInnerMenuItem)))}}]),We}(A.Component);Sn.isMenuItemGroup=!0,Sn.defaultProps={disabled:!0};var zt=Sn,lt=function(Me){var We=Me.className,we=Me.rootPrefixCls,ie=Me.style;return A.createElement("li",{className:"".concat(We," ").concat(we,"-item-divider"),style:ie})};lt.defaultProps={disabled:!0,className:"",style:{}};var jn=lt,ln=sn,Jn=I("eDIo");function $t(ye,Me){var We=ye.prefixCls,we=ye.editable,ie=ye.locale,fe=ye.style;return!we||we.showAdd===!1?null:A.createElement("button",{ref:Me,type:"button",className:"".concat(We,"-nav-add"),style:fe,"aria-label":(ie==null?void 0:ie.addAriaLabel)||"Add tab",onClick:function(Se){we.onEdit("add",{event:Se})}},we.addIcon||"+")}var On=A.forwardRef($t);function Fn(ye,Me){var We=ye.prefixCls,we=ye.id,ie=ye.tabs,fe=ye.locale,le=ye.mobile,Se=ye.moreIcon,De=Se===void 0?"More":Se,$e=ye.moreTransitionName,Le=ye.style,at=ye.className,It=ye.editable,qt=ye.tabBarGutter,un=ye.rtl,Hn=ye.onTabClick,Gn=Object(A.useState)(!1),di=Object(Y.a)(Gn,2),li=di[0],Ei=di[1],Ri=Object(A.useState)(null),gi=Object(Y.a)(Ri,2),xi=gi[0],Di=gi[1],dn="".concat(we,"-more-popup"),Zt="".concat(We,"-dropdown"),yn=xi!==null?"".concat(dn,"-").concat(xi):null,Ht=fe==null?void 0:fe.dropdownAriaLabel,Wt=A.createElement(ln,{onClick:function(Yi){var zi=Yi.key,Hi=Yi.domEvent;Hn(zi,Hi),Ei(!1)},id:dn,tabIndex:-1,role:"listbox","aria-activedescendant":yn,selectedKeys:[xi],"aria-label":Ht!==void 0?Ht:"expanded dropdown"},ie.map(function(Ni){return A.createElement(Un,{key:Ni.key,id:"".concat(dn,"-").concat(Ni.key),role:"option","aria-controls":we&&"".concat(we,"-panel-").concat(Ni.key),disabled:Ni.disabled},Ni.tab)}));function pi(Ni){for(var Yi=ie.filter(function(_r){return!_r.disabled}),zi=Yi.findIndex(function(_r){return _r.key===xi})||0,Hi=Yi.length,Bi=0;Bi<Hi;Bi+=1){zi=(zi+Ni+Hi)%Hi;var vi=Yi[zi];if(!vi.disabled){Di(vi.key);return}}}function Pi(Ni){var Yi=Ni.which;if(!li){[r.a.DOWN,r.a.SPACE,r.a.ENTER].includes(Yi)&&(Ei(!0),Ni.preventDefault());return}switch(Yi){case r.a.UP:pi(-1),Ni.preventDefault();break;case r.a.DOWN:pi(1),Ni.preventDefault();break;case r.a.ESC:Ei(!1);break;case r.a.SPACE:case r.a.ENTER:xi!==null&&Hn(xi,Ni);break}}Object(A.useEffect)(function(){var Ni=document.getElementById(yn);Ni&&Ni.scrollIntoView&&Ni.scrollIntoView(!1)},[xi]),Object(A.useEffect)(function(){li||Di(null)},[li]);var ni=Object(te.a)({},un?"marginLeft":"marginRight",qt);ie.length||(ni.visibility="hidden",ni.order=1);var Ii=H()(Object(te.a)({},"".concat(Zt,"-rtl"),un)),or=le?null:A.createElement(Jn.a,{prefixCls:Zt,overlay:Wt,trigger:["hover"],visible:li,transitionName:$e,onVisibleChange:Ei,overlayClassName:Ii,mouseEnterDelay:.1,mouseLeaveDelay:.1},A.createElement("button",{type:"button",className:"".concat(We,"-nav-more"),style:ni,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":dn,id:"".concat(we,"-more"),"aria-expanded":li,onKeyDown:Pi},De));return A.createElement("div",{className:H()("".concat(We,"-nav-operations"),at),style:Le,ref:Me},or,A.createElement(On,{prefixCls:We,locale:fe,editable:It}))}var hn=A.forwardRef(Fn),yi=Object(A.createContext)(null),Rn=.1,bn=.01,Rt=20,Xe=Math.pow(.995,Rt);function kt(){var ye=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(ye)||/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(ye.substr(0,4)))}function Pt(ye,Me){var We=Object(A.useState)(),we=Object(Y.a)(We,2),ie=we[0],fe=we[1],le=Object(A.useState)(0),Se=Object(Y.a)(le,2),De=Se[0],$e=Se[1],Le=Object(A.useState)(0),at=Object(Y.a)(Le,2),It=at[0],qt=at[1],un=Object(A.useState)(),Hn=Object(Y.a)(un,2),Gn=Hn[0],di=Hn[1],li=Object(A.useRef)();function Ei(Ht){var Wt=Ht.touches[0],pi=Wt.screenX,Pi=Wt.screenY;fe({x:pi,y:Pi}),window.clearInterval(li.current)}function Ri(Ht){if(!ie)return;Ht.preventDefault();var Wt=Ht.touches[0],pi=Wt.screenX,Pi=Wt.screenY;fe({x:pi,y:Pi});var ni=pi-ie.x,Ii=Pi-ie.y;Me(ni,Ii);var or=Date.now();$e(or),qt(or-De),di({x:ni,y:Ii})}function gi(){if(!ie)return;if(fe(null),di(null),Gn){var Ht=Gn.x/It,Wt=Gn.y/It,pi=Math.abs(Ht),Pi=Math.abs(Wt);if(Math.max(pi,Pi)<Rn)return;var ni=Ht,Ii=Wt;li.current=window.setInterval(function(){if(Math.abs(ni)<bn&&Math.abs(Ii)<bn){window.clearInterval(li.current);return}ni*=Xe,Ii*=Xe,Me(ni*Rt,Ii*Rt)},Rt)}}var xi=Object(A.useRef)(0),Di=Object(A.useRef)(!1),dn=Object(A.useRef)();function Zt(Ht){var Wt=Ht.deltaX,pi=Ht.deltaY,Pi=0,ni=Math.abs(Wt),Ii=Math.abs(pi);ni===Ii?Pi=dn.current==="x"?Wt:pi:ni>Ii?(Pi=Wt,dn.current="x"):(Pi=pi,dn.current="y");var or=Date.now();or-xi.current>100&&(Di.current=!1),(Me(-Pi,-Pi)||Di.current)&&(Ht.preventDefault(),Di.current=!0),xi.current=or}var yn=Object(A.useRef)(null);yn.current={onTouchStart:Ei,onTouchMove:Ri,onTouchEnd:gi,onWheel:Zt},A.useEffect(function(){function Ht(ni){yn.current.onTouchStart(ni)}function Wt(ni){yn.current.onTouchMove(ni)}function pi(ni){yn.current.onTouchEnd(ni)}function Pi(ni){yn.current.onWheel(ni)}return document.addEventListener("touchmove",Wt,{passive:!1}),document.addEventListener("touchend",pi,{passive:!1}),ye.current.addEventListener("touchstart",Ht,{passive:!1}),ye.current.addEventListener("wheel",Pi),function(){document.removeEventListener("touchmove",Wt),document.removeEventListener("touchend",pi)}},[])}function an(){var ye=Object(A.useRef)(new Map);function Me(we){return ye.current.has(we)||ye.current.set(we,A.createRef()),ye.current.get(we)}function We(we){ye.current.delete(we)}return[Me,We]}function zn(ye,Me){var We=A.useRef(ye),we=A.useState({}),ie=Object(Y.a)(we,2),fe=ie[1];function le(Se){var De=typeof Se=="function"?Se(We.current):Se;De!==We.current&&Me(De,We.current),We.current=De,fe({})}return[We.current,le]}var Ln=function(Me){var We=Me.position,we=Me.prefixCls,ie=Me.extra;if(!ie)return null;var fe,le=ie;return We==="right"&&(fe=le.right||!le.left&&le||null),We==="left"&&(fe=le.left||null),fe?A.createElement("div",{className:"".concat(we,"-extra-content")},fe):null};function oi(ye,Me){var We,we=A.useContext(yi),ie=we.prefixCls,fe=we.tabs,le=ye.className,Se=ye.style,De=ye.id,$e=ye.animated,Le=ye.activeKey,at=ye.rtl,It=ye.extra,qt=ye.editable,un=ye.locale,Hn=ye.tabPosition,Gn=ye.tabBarGutter,di=ye.children,li=ye.onTabClick,Ei=ye.onTabScroll,Ri=Object(A.useRef)(),gi=Object(A.useRef)(),xi=Object(A.useRef)(),Di=Object(A.useRef)(),dn=an(),Zt=Object(Y.a)(dn,2),yn=Zt[0],Ht=Zt[1],Wt=Hn==="top"||Hn==="bottom",pi=zn(0,function(Xi,ki){Wt&&Ei&&Ei({direction:Xi>ki?"left":"right"})}),Pi=Object(Y.a)(pi,2),ni=Pi[0],Ii=Pi[1],or=zn(0,function(Xi,ki){!Wt&&Ei&&Ei({direction:Xi>ki?"top":"bottom"})}),Ni=Object(Y.a)(or,2),Yi=Ni[0],zi=Ni[1],Hi=Object(A.useState)(0),Bi=Object(Y.a)(Hi,2),vi=Bi[0],_r=Bi[1],Jr=Object(A.useState)(0),jr=Object(Y.a)(Jr,2),Rr=jr[0],ur=jr[1],Zi=Object(A.useState)(0),rr=Object(Y.a)(Zi,2),dr=rr[0],Fr=rr[1],ha=Object(A.useState)(0),sa=Object(Y.a)(ha,2),qi=sa[0],Zr=sa[1],qr=Object(A.useState)(null),sr=Object(Y.a)(qr,2),Qi=sr[0],wr=sr[1],Ma=Object(A.useState)(null),no=Object(Y.a)(Ma,2),la=no[0],Ta=no[1],wa=Object(A.useState)(0),Sa=Object(Y.a)(wa,2),ka=Sa[0],co=Sa[1],Ro=Object(A.useState)(0),Ga=Object(Y.a)(Ro,2),Oa=Ga[0],Va=Ga[1],_a=s(new Map),Ra=Object(Y.a)(_a,2),ho=Ra[0],Ya=Ra[1],Aa=n(fe,ho,vi),Da="".concat(ie,"-nav-operations-hidden"),ya=0,Nr=0;Wt?at?(ya=0,Nr=Math.max(0,vi-Qi)):(ya=Math.min(0,Qi-vi),Nr=0):(ya=Math.min(0,la-Rr),Nr=0);function fa(Xi){return Xi<ya?[ya,!1]:Xi>Nr?[Nr,!1]:[Xi,!0]}var pa=Object(A.useRef)(),ba=Object(A.useState)(),ma=Object(Y.a)(ba,2),Xa=ma[0],$a=ma[1];function Qa(){$a(Date.now())}function Ia(){window.clearTimeout(pa.current)}Pt(Ri,function(Xi,ki){var mr=!1;function Br(Pa,da){Pa(function(ja){var ca=fa(ja+da),Sr=Object(Y.a)(ca,2),Fa=Sr[0],Ba=Sr[1];return mr=Ba,Fa})}if(Wt){if(Qi>=vi)return mr;Br(Ii,Xi)}else{if(la>=Rr)return mr;Br(zi,ki)}return Ia(),Qa(),mr}),Object(A.useEffect)(function(){return Ia(),Xa&&(pa.current=window.setTimeout(function(){$a(0)},100)),Ia},[Xa]);function ua(){var Xi=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Le,ki=Aa.get(Xi);if(!ki)return;if(Wt){var mr=ni;at?ki.right<ni?mr=ki.right:ki.right+ki.width>ni+Qi&&(mr=ki.right+ki.width-Qi):ki.left<-ni?mr=-ki.left:ki.left+ki.width>-ni+Qi&&(mr=-(ki.left+ki.width-Qi)),zi(0),Ii(fa(mr)[0])}else{var Br=Yi;ki.top<-Yi?Br=-ki.top:ki.top+ki.height>-Yi+la&&(Br=-(ki.top+ki.height-la)),Ii(0),zi(fa(Br)[0])}}var Ea=w(Aa,{width:Qi,height:la,left:ni,top:Yi},{width:dr,height:qi},{width:ka,height:Oa},Object(K.a)(Object(K.a)({},ye),{},{tabs:fe})),io=Object(Y.a)(Ea,2),Ao=io[0],Do=io[1],fo=fe.map(function(Xi){var ki=Xi.key;return A.createElement(o,{id:De,prefixCls:ie,key:ki,rtl:at,tab:Xi,closable:Xi.closable,editable:qt,active:ki===Le,tabPosition:Hn,tabBarGutter:Gn,renderWrapper:di,removeAriaLabel:un==null?void 0:un.removeAriaLabel,ref:yn(ki),onClick:function(Br){li(ki,Br)},onRemove:function(){Ht(ki)},onFocus:function(){ua(ki),Qa(),at||(Ri.current.scrollLeft=0),Ri.current.scrollTop=0}})}),ro=d(function(){var Xi,ki,mr,Br,Pa,da,ja,ca,Sr,Fa=((Xi=Ri.current)===null||Xi===void 0?void 0:Xi.offsetWidth)||0,Ba=((ki=Ri.current)===null||ki===void 0?void 0:ki.offsetHeight)||0,Ha=((mr=Di.current)===null||mr===void 0?void 0:mr.offsetWidth)||0,zr=((Br=Di.current)===null||Br===void 0?void 0:Br.offsetHeight)||0,Gi=((Pa=xi.current)===null||Pa===void 0?void 0:Pa.offsetWidth)||0,Si=((da=xi.current)===null||da===void 0?void 0:da.offsetHeight)||0;wr(Fa),Ta(Ba),co(Ha),Va(zr);var Xn=(((ja=gi.current)===null||ja===void 0?void 0:ja.offsetWidth)||0)-Ha,ui=(((ca=gi.current)===null||ca===void 0?void 0:ca.offsetHeight)||0)-zr;_r(Xn),ur(ui);var Mi=(Sr=xi.current)===null||Sr===void 0?void 0:Sr.className.includes(Da);Fr(Xn-(Mi?0:Gi)),Zr(ui-(Mi?0:Si)),Ya(function(){var hr=new Map;return fe.forEach(function(ga){var aa=ga.key,Mr=yn(aa).current;Mr&&hr.set(aa,{width:Mr.offsetWidth,height:Mr.offsetHeight,left:Mr.offsetLeft,top:Mr.offsetTop})}),hr})}),po=fe.slice(0,Ao),Kr=fe.slice(Do+1),br=[].concat(Object(D.a)(po),Object(D.a)(Kr)),Lr=Object(A.useState)(),Er=Object(Y.a)(Lr,2),Na=Er[0],mo=Er[1],ea=Aa.get(Le),ao=Object(A.useRef)();function oo(){m.a.cancel(ao.current)}Object(A.useEffect)(function(){var Xi={};return ea&&(Wt?(at?Xi.right=ea.right:Xi.left=ea.left,Xi.width=ea.width):(Xi.top=ea.top,Xi.height=ea.height)),oo(),ao.current=m()(function(){mo(Xi)}),oo},[ea,Wt,at]),Object(A.useEffect)(function(){ua()},[Le,ea,Aa,Wt]),Object(A.useEffect)(function(){ro()},[at,Gn,Le,fe.map(function(Xi){return Xi.key}).join("_")]);var so=!!br.length,xa="".concat(ie,"-nav-wrap"),Ja,Ua,go,Za;return Wt?at?(Ua=ni>0,Ja=ni+Qi<vi):(Ja=ni<0,Ua=-ni+Qi<vi):(go=Yi<0,Za=-Yi+la<Rr),A.createElement("div",{ref:Me,role:"tablist",className:H()("".concat(ie,"-nav"),le),style:Se,onKeyDown:function(){Qa()}},A.createElement(Ln,{position:"left",extra:It,prefixCls:ie}),A.createElement(f.a,{onResize:ro},A.createElement("div",{className:H()(xa,(We={},Object(te.a)(We,"".concat(xa,"-ping-left"),Ja),Object(te.a)(We,"".concat(xa,"-ping-right"),Ua),Object(te.a)(We,"".concat(xa,"-ping-top"),go),Object(te.a)(We,"".concat(xa,"-ping-bottom"),Za),We)),ref:Ri},A.createElement(f.a,{onResize:ro},A.createElement("div",{ref:gi,className:"".concat(ie,"-nav-list"),style:{transform:"translate(".concat(ni,"px, ").concat(Yi,"px)"),transition:Xa?"none":void 0}},fo,A.createElement(On,{ref:Di,prefixCls:ie,locale:un,editable:qt,style:{visibility:so?"hidden":null}}),A.createElement("div",{className:H()("".concat(ie,"-ink-bar"),Object(te.a)({},"".concat(ie,"-ink-bar-animated"),$e.inkBar)),style:Na}))))),A.createElement(hn,Object.assign({},ye,{ref:xi,prefixCls:ie,tabs:br,className:!so&&Da})),A.createElement(Ln,{position:"right",extra:It,prefixCls:ie}))}var ei=A.forwardRef(oi);function Oi(ye){var Me=ye.id,We=ye.activeKey,we=ye.animated,ie=ye.tabPosition,fe=ye.rtl,le=ye.destroyInactiveTabPane,Se=A.useContext(yi),De=Se.prefixCls,$e=Se.tabs,Le=we.tabPane,at=$e.findIndex(function(It){return It.key===We});return A.createElement("div",{className:H()("".concat(De,"-content-holder"))},A.createElement("div",{className:H()("".concat(De,"-content"),"".concat(De,"-content-").concat(ie),Object(te.a)({},"".concat(De,"-content-animated"),Le)),style:at&&Le?Object(te.a)({},fe?"marginRight":"marginLeft","-".concat(at,"00%")):null},$e.map(function(It){return A.cloneElement(It.node,{key:It.key,prefixCls:De,tabKey:It.key,id:Me,animated:Le,active:It.key===We,destroyInactiveTabPane:le})})))}function mi(ye){var Me=ye.prefixCls,We=ye.forceRender,we=ye.className,ie=ye.style,fe=ye.id,le=ye.active,Se=ye.animated,De=ye.destroyInactiveTabPane,$e=ye.tabKey,Le=ye.children,at=A.useState(We),It=Object(Y.a)(at,2),qt=It[0],un=It[1];A.useEffect(function(){le?un(!0):De&&un(!1)},[le,De]);var Hn={};return le||(Se?(Hn.visibility="hidden",Hn.height=0,Hn.overflowY="hidden"):Hn.display="none"),A.createElement("div",{id:fe&&"".concat(fe,"-panel-").concat($e),role:"tabpanel",tabIndex:le?0:-1,"aria-labelledby":fe&&"".concat(fe,"-tab-").concat($e),"aria-hidden":!le,style:Object(K.a)(Object(K.a)({},Hn),ie),className:H()("".concat(Me,"-tabpane"),le&&"".concat(Me,"-tabpane-active"),we)},(le||qt||We)&&Le)}var bi=0;function Ji(ye){return Object(P.a)(ye).map(function(Me){if(A.isValidElement(Me)){var We=Me.key!==void 0?String(Me.key):void 0;return Object(K.a)(Object(K.a)({key:We},Me.props),{},{node:Me})}return null}).filter(function(Me){return Me})}function Vi(ye,Me){var We,we=ye.id,ie=ye.prefixCls,fe=ie===void 0?"rc-tabs":ie,le=ye.className,Se=ye.children,De=ye.direction,$e=ye.activeKey,Le=ye.defaultActiveKey,at=ye.editable,It=ye.animated,qt=ye.tabPosition,un=qt===void 0?"top":qt,Hn=ye.tabBarGutter,Gn=ye.tabBarStyle,di=ye.tabBarExtraContent,li=ye.locale,Ei=ye.moreIcon,Ri=ye.moreTransitionName,gi=ye.destroyInactiveTabPane,xi=ye.renderTabBar,Di=ye.onChange,dn=ye.onTabClick,Zt=ye.onTabScroll,yn=Object(N.a)(ye,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),Ht=Ji(Se),Wt=De==="rtl",pi;It===!1?pi={inkBar:!1,tabPane:!1}:pi=Object(K.a)({inkBar:!0,tabPane:!1},It!==!0?It:null);var Pi=Object(A.useState)(!1),ni=Object(Y.a)(Pi,2),Ii=ni[0],or=ni[1];Object(A.useEffect)(function(){or(kt())},[]);var Ni=Object(k.a)(function(){var qi;return(qi=Ht[0])===null||qi===void 0?void 0:qi.key},{value:$e,defaultValue:Le}),Yi=Object(Y.a)(Ni,2),zi=Yi[0],Hi=Yi[1],Bi=Object(A.useState)(function(){return Ht.findIndex(function(qi){return qi.key===zi})}),vi=Object(Y.a)(Bi,2),_r=vi[0],Jr=vi[1];Object(A.useEffect)(function(){var qi=Ht.findIndex(function(qr){return qr.key===zi});if(qi===-1){var Zr;qi=Math.max(0,Math.min(_r,Ht.length-1)),Hi((Zr=Ht[qi])===null||Zr===void 0?void 0:Zr.key)}Jr(qi)},[Ht.map(function(qi){return qi.key}).join("_"),zi,_r]);var jr=Object(k.a)(null,{value:we}),Rr=Object(Y.a)(jr,2),ur=Rr[0],Zi=Rr[1],rr=un;Ii&&!["left","right"].includes(un)&&(rr="top"),Object(A.useEffect)(function(){we||(Zi("rc-tabs-".concat(bi)),bi+=1)},[]);function dr(qi,Zr){dn==null||dn(qi,Zr),Hi(qi),Di==null||Di(qi)}var Fr={id:ur,activeKey:zi,animated:pi,tabPosition:rr,rtl:Wt,mobile:Ii},ha,sa=Object(K.a)(Object(K.a)({},Fr),{},{editable:at,locale:li,moreIcon:Ei,moreTransitionName:Ri,tabBarGutter:Hn,onTabClick:dr,onTabScroll:Zt,extra:di,style:Gn,panes:Se});return xi?ha=xi(sa,ei):ha=A.createElement(ei,Object.assign({},sa)),A.createElement(yi.Provider,{value:{tabs:Ht,prefixCls:fe}},A.createElement("div",Object.assign({ref:Me,id:we,className:H()(fe,"".concat(fe,"-").concat(rr),(We={},Object(te.a)(We,"".concat(fe,"-mobile"),Ii),Object(te.a)(We,"".concat(fe,"-editable"),at),Object(te.a)(We,"".concat(fe,"-rtl"),Wt),We),le)},yn),ha,A.createElement(Oi,Object.assign({destroyInactiveTabPane:gi},Fr,{animated:pi}))))}var $i=A.forwardRef(Vi);$i.TabPane=mi;var gr=$i,vr=Qe.b=gr},kSUc:function(tn,Qe,I){},lZu9:function(tn,Qe,I){(function(te){te(I("VrN/"),I("1eCo"),I("8EBN"))})(function(te){"use strict";te.defineMode("markdown",function(Y,N){var K=te.getMode(Y,"text/html"),A=K.name=="null";function M(B){if(te.findModeByName){var T=te.findModeByName(B);T&&(B=T.mime||T.mimes[0])}var V=te.getMode(Y,B);return V.name=="null"?null:V}N.highlightFormatting===void 0&&(N.highlightFormatting=!1),N.maxBlockquoteDepth===void 0&&(N.maxBlockquoteDepth=0),N.taskLists===void 0&&(N.taskLists=!1),N.strikethrough===void 0&&(N.strikethrough=!1),N.emoji===void 0&&(N.emoji=!1),N.fencedCodeBlockHighlighting===void 0&&(N.fencedCodeBlockHighlighting=!0),N.fencedCodeBlockDefaultMode===void 0&&(N.fencedCodeBlockDefaultMode="text/plain"),N.xml===void 0&&(N.xml=!0),N.tokenTypeOverrides===void 0&&(N.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 P in H)H.hasOwnProperty(P)&&N.tokenTypeOverrides[P]&&(H[P]=N.tokenTypeOverrides[P]);var k=/^([*\-_])(?:\s*\1){2,}\s*$/,D=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,b=/^\[(x| )\](?=\s)/i,m=N.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,f=/^ {0,3}(?:\={1,}|-{2,})\s*$/,d=/^[^#!\[\]*_\\<>` "'(~:]+/,s=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,r=/^\s*\[[^\]]+?\]:.*$/,u=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,o=" ";function a(B,T,V){return T.f=T.inline=V,V(B,T)}function n(B,T,V){return T.f=T.block=V,V(B,T)}function R(B){return!B||!/\S/.test(B.string)}function w(B){if(B.linkTitle=!1,B.linkHref=!1,B.linkText=!1,B.em=!1,B.strong=!1,B.strikethrough=!1,B.quote=0,B.indentedCode=!1,B.f==O){var T=A;if(!T){var V=te.innerMode(K,B.htmlState);T=V.mode.name=="xml"&&V.state.tagStart===null&&!V.state.context&&V.state.tokenize.isInText}T&&(B.f=h,B.block=x,B.htmlState=null)}return B.trailingSpace=0,B.trailingSpaceNewLine=!1,B.prevLine=B.thisLine,B.thisLine={stream:null},null}function x(B,T){var V=B.column()===T.indentation,Z=R(T.prevLine.stream),oe=T.indentedCode,pe=T.prevLine.hr,Ye=T.list!==!1,xe=(T.listStack[T.listStack.length-1]||0)+3;T.indentedCode=!1;var Ie=T.indentation;if(T.indentationDiff===null&&(T.indentationDiff=T.indentation,Ye)){for(T.list=null;Ie<T.listStack[T.listStack.length-1];)T.listStack.pop(),T.listStack.length?T.indentation=T.listStack[T.listStack.length-1]:T.list=!1;T.list!==!1&&(T.indentationDiff=Ie-T.listStack[T.listStack.length-1])}var Je=!Z&&!pe&&!T.prevLine.header&&(!Ye||!oe)&&!T.prevLine.fencedCodeEnd,Ke=(T.list===!1||pe||Z)&&T.indentation<=xe&&B.match(k),be=null;if(T.indentationDiff>=4&&(oe||T.prevLine.fencedCodeEnd||T.prevLine.header||Z))return B.skipToEnd(),T.indentedCode=!0,H.code;if(B.eatSpace())return null;if(V&&T.indentation<=xe&&(be=B.match(m))&&be[1].length<=6)return T.quote=0,T.header=be[1].length,T.thisLine.header=!0,N.highlightFormatting&&(T.formatting="header"),T.f=T.inline,_(T);if(T.indentation<=xe&&B.eat(">"))return T.quote=V?1:T.quote+1,N.highlightFormatting&&(T.formatting="quote"),B.eatSpace(),_(T);if(!Ke&&!T.setext&&V&&T.indentation<=xe&&(be=B.match(D))){var de=be[1]?"ol":"ul";return T.indentation=Ie+B.current().length,T.list=!0,T.quote=0,T.listStack.push(T.indentation),T.em=!1,T.strong=!1,T.code=!1,T.strikethrough=!1,N.taskLists&&B.match(b,!1)&&(T.taskList=!0),T.f=T.inline,N.highlightFormatting&&(T.formatting=["list","list-"+de]),_(T)}else{if(V&&T.indentation<=xe&&(be=B.match(s,!0)))return T.quote=0,T.fencedEndRE=new RegExp(be[1]+"+ *$"),T.localMode=N.fencedCodeBlockHighlighting&&M(be[2]||N.fencedCodeBlockDefaultMode),T.localMode&&(T.localState=te.startState(T.localMode)),T.f=T.block=C,N.highlightFormatting&&(T.formatting="code-block"),T.code=-1,_(T);if(T.setext||(!Je||!Ye)&&!T.quote&&T.list===!1&&!T.code&&!Ke&&!r.test(B.string)&&(be=B.lookAhead(1))&&(be=be.match(f)))return T.setext?(T.header=T.setext,T.setext=0,B.skipToEnd(),N.highlightFormatting&&(T.formatting="header")):(T.header=be[0].charAt(0)=="="?1:2,T.setext=T.header),T.thisLine.header=!0,T.f=T.inline,_(T);if(Ke)return B.skipToEnd(),T.hr=!0,T.thisLine.hr=!0,H.hr;if(B.peek()==="[")return a(B,T,U)}return a(B,T,T.inline)}function O(B,T){var V=K.token(B,T.htmlState);if(!A){var Z=te.innerMode(K,T.htmlState);(Z.mode.name=="xml"&&Z.state.tagStart===null&&!Z.state.context&&Z.state.tokenize.isInText||T.md_inside&&B.current().indexOf(">")>-1)&&(T.f=h,T.block=x,T.htmlState=null)}return V}function C(B,T){var V=T.listStack[T.listStack.length-1]||0,Z=T.indentation<V,oe=V+3;if(T.fencedEndRE&&T.indentation<=oe&&(Z||B.match(T.fencedEndRE))){N.highlightFormatting&&(T.formatting="code-block");var pe;return Z||(pe=_(T)),T.localMode=T.localState=null,T.block=x,T.f=h,T.fencedEndRE=null,T.code=0,T.thisLine.fencedCodeEnd=!0,Z?n(B,T,T.block):pe}else return T.localMode?T.localMode.token(B,T.localState):(B.skipToEnd(),H.code)}function _(B){var T=[];if(B.formatting){T.push(H.formatting),typeof B.formatting=="string"&&(B.formatting=[B.formatting]);for(var V=0;V<B.formatting.length;V++)T.push(H.formatting+"-"+B.formatting[V]),B.formatting[V]==="header"&&T.push(H.formatting+"-"+B.formatting[V]+"-"+B.header),B.formatting[V]==="quote"&&(!N.maxBlockquoteDepth||N.maxBlockquoteDepth>=B.quote?T.push(H.formatting+"-"+B.formatting[V]+"-"+B.quote):T.push("error"))}if(B.taskOpen)return T.push("meta"),T.length?T.join(" "):null;if(B.taskClosed)return T.push("property"),T.length?T.join(" "):null;if(B.linkHref?T.push(H.linkHref,"url"):(B.strong&&T.push(H.strong),B.em&&T.push(H.em),B.strikethrough&&T.push(H.strikethrough),B.emoji&&T.push(H.emoji),B.linkText&&T.push(H.linkText),B.code&&T.push(H.code),B.image&&T.push(H.image),B.imageAltText&&T.push(H.imageAltText,"link"),B.imageMarker&&T.push(H.imageMarker)),B.header&&T.push(H.header,H.header+"-"+B.header),B.quote&&(T.push(H.quote),!N.maxBlockquoteDepth||N.maxBlockquoteDepth>=B.quote?T.push(H.quote+"-"+B.quote):T.push(H.quote+"-"+N.maxBlockquoteDepth)),B.list!==!1){var Z=(B.listStack.length-1)%3;Z?Z===1?T.push(H.list2):T.push(H.list3):T.push(H.list1)}return B.trailingSpaceNewLine?T.push("trailing-space-new-line"):B.trailingSpace&&T.push("trailing-space-"+(B.trailingSpace%2?"a":"b")),T.length?T.join(" "):null}function y(B,T){return B.match(d,!0)?_(T):void 0}function h(B,T){var V=T.text(B,T);if(typeof V!="undefined")return V;if(T.list)return T.list=null,_(T);if(T.taskList){var Z=B.match(b,!0)[1]===" ";return Z?T.taskOpen=!0:T.taskClosed=!0,N.highlightFormatting&&(T.formatting="task"),T.taskList=!1,_(T)}if(T.taskOpen=!1,T.taskClosed=!1,T.header&&B.match(/^#+$/,!0))return N.highlightFormatting&&(T.formatting="header"),_(T);var oe=B.next();if(T.linkTitle){T.linkTitle=!1;var pe=oe;oe==="("&&(pe=")"),pe=(pe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ye="^\\s*(?:[^"+pe+"\\\\]+|\\\\\\\\|\\\\.)"+pe;if(B.match(new RegExp(Ye),!0))return H.linkHref}if(oe==="`"){var xe=T.formatting;N.highlightFormatting&&(T.formatting="code"),B.eatWhile("`");var Ie=B.current().length;if(T.code==0&&(!T.quote||Ie==1))return T.code=Ie,_(T);if(Ie==T.code){var Je=_(T);return T.code=0,Je}else return T.formatting=xe,_(T)}else if(T.code)return _(T);if(oe==="\\"&&(B.next(),N.highlightFormatting)){var Ke=_(T),be=H.formatting+"-escape";return Ke?Ke+" "+be:be}if(oe==="!"&&B.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return T.imageMarker=!0,T.image=!0,N.highlightFormatting&&(T.formatting="image"),_(T);if(oe==="["&&T.imageMarker&&B.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return T.imageMarker=!1,T.imageAltText=!0,N.highlightFormatting&&(T.formatting="image"),_(T);if(oe==="]"&&T.imageAltText){N.highlightFormatting&&(T.formatting="image");var Ke=_(T);return T.imageAltText=!1,T.image=!1,T.inline=T.f=v,Ke}if(oe==="["&&!T.image)return T.linkText&&B.match(/^.*?\]/)||(T.linkText=!0,N.highlightFormatting&&(T.formatting="link")),_(T);if(oe==="]"&&T.linkText){N.highlightFormatting&&(T.formatting="link");var Ke=_(T);return T.linkText=!1,T.inline=T.f=B.match(/\(.*?\)| ?\[.*?\]/,!1)?v:h,Ke}if(oe==="<"&&B.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){T.f=T.inline=c,N.highlightFormatting&&(T.formatting="link");var Ke=_(T);return Ke?Ke+=" ":Ke="",Ke+H.linkInline}if(oe==="<"&&B.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){T.f=T.inline=c,N.highlightFormatting&&(T.formatting="link");var Ke=_(T);return Ke?Ke+=" ":Ke="",Ke+H.linkEmail}if(N.xml&&oe==="<"&&B.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var de=B.string.indexOf(">",B.pos);if(de!=-1){var nt=B.string.substring(B.start,de);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(nt)&&(T.md_inside=!0)}return B.backUp(1),T.htmlState=te.startState(K),n(B,T,O)}if(N.xml&&oe==="<"&&B.match(/^\/\w*?>/))return T.md_inside=!1,"tag";if(oe==="*"||oe==="_"){for(var Kt=1,jt=B.pos==1?" ":B.string.charAt(B.pos-2);Kt<3&&B.eat(oe);)Kt++;var wt=B.peek()||" ",ze=!/\s/.test(wt)&&(!u.test(wt)||/\s/.test(jt)||u.test(jt)),ft=!/\s/.test(jt)&&(!u.test(jt)||/\s/.test(wt)||u.test(wt)),dt=null,Nt=null;if(Kt%2&&(!T.em&&ze&&(oe==="*"||!ft||u.test(jt))?dt=!0:T.em==oe&&ft&&(oe==="*"||!ze||u.test(wt))&&(dt=!1)),Kt>1&&(!T.strong&&ze&&(oe==="*"||!ft||u.test(jt))?Nt=!0:T.strong==oe&&ft&&(oe==="*"||!ze||u.test(wt))&&(Nt=!1)),Nt!=null||dt!=null){N.highlightFormatting&&(T.formatting=dt==null?"strong":Nt==null?"em":"strong em"),dt===!0&&(T.em=oe),Nt===!0&&(T.strong=oe);var Je=_(T);return dt===!1&&(T.em=!1),Nt===!1&&(T.strong=!1),Je}}else if(oe===" "&&(B.eat("*")||B.eat("_"))){if(B.peek()===" ")return _(T);B.backUp(1)}if(N.strikethrough){if(oe==="~"&&B.eatWhile(oe)){if(T.strikethrough){N.highlightFormatting&&(T.formatting="strikethrough");var Je=_(T);return T.strikethrough=!1,Je}else if(B.match(/^[^\s]/,!1))return T.strikethrough=!0,N.highlightFormatting&&(T.formatting="strikethrough"),_(T)}else if(oe===" "&&B.match(/^~~/,!0)){if(B.peek()===" ")return _(T);B.backUp(2)}}if(N.emoji&&oe===":"&&B.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){T.emoji=!0,N.highlightFormatting&&(T.formatting="emoji");var Ze=_(T);return T.emoji=!1,Ze}return oe===" "&&(B.match(/^ +$/,!1)?T.trailingSpace++:T.trailingSpace&&(T.trailingSpaceNewLine=!0)),_(T)}function c(B,T){var V=B.next();if(V===">"){T.f=T.inline=h,N.highlightFormatting&&(T.formatting="link");var Z=_(T);return Z?Z+=" ":Z="",Z+H.linkInline}return B.match(/^[^>]+/,!0),H.linkInline}function v(B,T){if(B.eatSpace())return null;var V=B.next();return V==="("||V==="["?(T.f=T.inline=E(V==="("?")":"]"),N.highlightFormatting&&(T.formatting="link-string"),T.linkHref=!0,_(T)):"error"}var p={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function E(B){return function(T,V){var Z=T.next();if(Z===B){V.f=V.inline=h,N.highlightFormatting&&(V.formatting="link-string");var oe=_(V);return V.linkHref=!1,oe}return T.match(p[B]),V.linkHref=!0,_(V)}}function U(B,T){return B.match(/^([^\]\\]|\\.)*\]:/,!1)?(T.f=F,B.next(),N.highlightFormatting&&(T.formatting="link"),T.linkText=!0,_(T)):a(B,T,h)}function F(B,T){if(B.match(/^\]:/,!0)){T.f=T.inline=z,N.highlightFormatting&&(T.formatting="link");var V=_(T);return T.linkText=!1,V}return B.match(/^([^\]\\]|\\.)+/,!0),H.linkText}function z(B,T){return B.eatSpace()?null:(B.match(/^[^\s]+/,!0),B.peek()===void 0?T.linkTitle=!0:B.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),T.f=T.inline=h,H.linkHref+" url")}var G={startState:function(){return{f:x,prevLine:{stream:null},thisLine:{stream:null},block:x,htmlState:null,indentation:0,inline:h,text:y,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(B){return{f:B.f,prevLine:B.prevLine,thisLine:B.thisLine,block:B.block,htmlState:B.htmlState&&te.copyState(K,B.htmlState),indentation:B.indentation,localMode:B.localMode,localState:B.localMode?te.copyState(B.localMode,B.localState):null,inline:B.inline,text:B.text,formatting:!1,linkText:B.linkText,linkTitle:B.linkTitle,linkHref:B.linkHref,code:B.code,em:B.em,strong:B.strong,strikethrough:B.strikethrough,emoji:B.emoji,header:B.header,setext:B.setext,hr:B.hr,taskList:B.taskList,list:B.list,listStack:B.listStack.slice(0),quote:B.quote,indentedCode:B.indentedCode,trailingSpace:B.trailingSpace,trailingSpaceNewLine:B.trailingSpaceNewLine,md_inside:B.md_inside,fencedEndRE:B.fencedEndRE}},token:function(B,T){if(T.formatting=!1,B!=T.thisLine.stream){if(T.header=0,T.hr=!1,B.match(/^\s*$/,!0))return w(T),null;if(T.prevLine=T.thisLine,T.thisLine={stream:B},T.taskList=!1,T.trailingSpace=0,T.trailingSpaceNewLine=!1,!T.localState&&(T.f=T.block,T.f!=O)){var V=B.match(/^\s*/,!0)[0].replace(/\t/g,o).length;if(T.indentation=V,T.indentationDiff=null,V>0)return null}}return T.f(B,T)},innerMode:function(B){return B.block==O?{state:B.htmlState,mode:K}:B.localState?{state:B.localState,mode:B.localMode}:{state:B,mode:G}},indent:function(B,T,V){return B.block==O&&K.indent?K.indent(B.htmlState,T,V):B.localState&&B.localMode.indent?B.localMode.indent(B.localState,T,V):te.Pass},blankLine:w,getType:_,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return G},"xml"),te.defineMIME("text/markdown","markdown"),te.defineMIME("text/x-markdown","markdown")})},mgmH:function(tn,Qe,I){"use strict";I.d(Qe,"d",function(){return f}),I.d(Qe,"b",function(){return d}),I.d(Qe,"e",function(){return s}),I.d(Qe,"c",function(){return r}),I.d(Qe,"n",function(){return u}),I.d(Qe,"g",function(){return o}),I.d(Qe,"h",function(){return a}),I.d(Qe,"j",function(){return R}),I.d(Qe,"a",function(){return w}),I.d(Qe,"l",function(){return x}),I.d(Qe,"f",function(){return O}),I.d(Qe,"k",function(){return C}),I.d(Qe,"m",function(){return _}),I.d(Qe,"i",function(){return y}),I.d(Qe,"o",function(){return h}),I.d(Qe,"t",function(){return c}),I.d(Qe,"s",function(){return v}),I.d(Qe,"p",function(){return p}),I.d(Qe,"q",function(){return E}),I.d(Qe,"r",function(){return U}),I.d(Qe,"v",function(){return F}),I.d(Qe,"u",function(){return z});var te=I("miYZ"),Y=I("tsqr"),N=I("k1fw"),K=I("9og8"),A=I("WmNS"),M=I.n(A),H=I("oUNq"),P=I("9kvl"),k=I("1vsH"),D=I("m3rI"),b=function(){Object(P.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u751F\u6210\u6587\u4EF6\uFF0C\u8BF7\u7A0D\u540E..."}})},m=function(){Object(P.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}})},f=function(){var G=Object(K.a)(M.a.mark(function B(T){var V;return M.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return b(),oe.next=3,Object(H.t)(Object(N.a)({},T));case 3:if(V=oe.sent,!(V.status===0)){oe.next=7;break}return oe.next=7,Object(k.w)("",Object(k.Y)({url:D.a.API_SERVER+"/api/courses/".concat(T.coursesId,"/export_couser_info.json"),query:T}));case 7:m();case 8:case"end":return oe.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),d=function(){var G=Object(K.a)(M.a.mark(function B(T){var V;return M.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return oe.next=2,Object(H.r)(Object(N.a)({},T));case 2:if(V=oe.sent,!(V.status===0)){oe.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),P.d.push("/classrooms/".concat(T.coursesId,"/exportlist/course_member_act_score")),oe.next=13;break;case 8:if(!(V.status===-2)){oe.next=12;break}return oe.abrupt("return",V);case 12:V.status===-3&&(Object(P.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),P.d.push("/classrooms/".concat(T.coursesId,"/exportlist/course_member_act_score")));case 13:case"end":return oe.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),s=function(){var G=Object(K.a)(M.a.mark(function B(T){var V;return M.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return oe.next=2,Object(H.u)(Object(N.a)({},T));case 2:if(V=oe.sent,!(V.status===0)){oe.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),P.d.push("/classrooms/".concat(T.coursesId,"/exportlist/course_total_score")),oe.next=13;break;case 8:if(!(V.status===-2)){oe.next=12;break}return oe.abrupt("return",V);case 12:V.status===-3&&(Object(P.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),P.d.push("/classrooms/".concat(T.coursesId,"/exportlist/course_total_score")));case 13:case"end":return oe.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),r=function(){var G=Object(K.a)(M.a.mark(function B(T){var V;return M.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return oe.next=2,Object(H.s)(Object(N.a)({},T));case 2:if(V=oe.sent,!(V.status===0)){oe.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),P.d.push("/classrooms/".concat(T.coursesId,"/exportlist/course_total_exercise_and_other")),oe.next=13;break;case 8:if(!(V.status===-2)){oe.next=12;break}return oe.abrupt("return",V);case 12:V.status===-3&&(Object(P.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),P.d.push("/classrooms/".concat(T.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return oe.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),u=function(){var G=Object(K.a)(M.a.mark(function B(T){var V;return M.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return oe.next=2,Object(H.z)(Object(N.a)({},T));case 2:if(V=oe.sent,!(V.status===0)){oe.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),P.d.push("/classrooms/".concat(T.coursesId,"/exportlist/course_total_exercise_and_other")),oe.next=13;break;case 8:if(!(V.status===-2)){oe.next=12;break}return oe.abrupt("return",V);case 12:V.status===-3&&(Object(P.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),P.d.push("/classrooms/".concat(T.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return oe.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),o=function(){var G=Object(K.a)(M.a.mark(function B(T){var V;return M.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return oe.next=2,Object(H.v)(Object(N.a)({},T));case 2:if(V=oe.sent,!(V.status===0)){oe.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),P.d.push("/classrooms/".concat(T.coursesId,"/exportlist/course_total_homework")),oe.next=13;break;case 8:if(!(V.status===-2)){oe.next=12;break}return oe.abrupt("return",V);case 12:V.status===-3&&(Object(P.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),P.d.push("/classrooms/".concat(T.coursesId,"/exportlist/course_total_homework")));case 13:case"end":return oe.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),a=function(){var G=Object(K.a)(M.a.mark(function B(T,V){var Z;return M.a.wrap(function(pe){for(;;)switch(pe.prev=pe.next){case 0:return pe.next=2,Object(H.x)(Object(N.a)({},T));case 2:Z=pe.sent,Z.status===0?(Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),P.d.push("/classrooms/".concat(T.coursesId,"/exportlist/").concat(V))):Z.status===-3&&(Object(P.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),P.d.push("/classrooms/".concat(T.coursesId,"/exportlist/").concat(V)));case 4:case"end":return pe.stop()}},B)}));return function(T,V){return G.apply(this,arguments)}}(),n=function(){var G=Object(K.a)(M.a.mark(function B(T){var V;return M.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return b(),oe.next=3,Object(H.w)(Object(N.a)({},T));case 3:if(V=oe.sent,!(V.status===0)){oe.next=7;break}return oe.next=7,Object(k.w)("",Object(k.Y)({url:D.a.API_SERVER+"/api/homework_commons/".concat(T.categoryId,"/works_list.zip"),query:T}));case 7:m();case 8:case"end":return oe.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),R=function(){var G=Object(K.a)(M.a.mark(function B(T){var V;return M.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return b(),oe.next=3,Object(H.A)(Object(N.a)({},T));case 3:if(V=oe.sent,!(V.status===0)){oe.next=7;break}return oe.next=7,Object(k.w)("",Object(k.Y)({url:D.a.API_SERVER+"/api/polls/".concat(T.categoryId,"/commit_result.xlsx"),query:T}));case 7:m();case 8:case"end":return oe.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),w=function(){var G=Object(K.a)(M.a.mark(function B(T){return M.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(k.v)("",Object(k.Y)({url:D.a.API_SERVER+"/api/courses/".concat(T.coursesId,"/attendances/export_xlsx_data.xlsx"),query:T}));case 2:case"end":return Z.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),x=function(){var G=Object(K.a)(M.a.mark(function B(T){return M.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(k.v)("",Object(k.Y)({url:D.a.API_SERVER+"/api/courses/".concat(T.coursesId,"/video_study_statics.xlsx"),query:T}));case 2:case"end":return Z.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),O=function(){var G=Object(K.a)(M.a.mark(function B(T){return M.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(k.v)("",Object(k.Y)({url:D.a.API_SERVER+"/api/courses/".concat(T.coursesId,"/export_course_students_info.xlsx"),query:T}));case 2:case"end":return Z.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),C=function(){var G=Object(K.a)(M.a.mark(function B(T){return M.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(k.v)("",Object(k.Y)({url:D.a.API_SERVER+"/api/item_banks/export.xlsx",query:T}));case 2:case"end":return Z.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),_=function(){var G=Object(K.a)(M.a.mark(function B(T){return M.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(k.v)("",Object(k.Y)({url:D.a.API_SERVER+"/api/competitions/region_reports.xlsx",query:T}));case 2:case"end":return Z.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),y=function(){var G=Object(K.a)(M.a.mark(function B(T){var V;return M.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return oe.next=2,Object(H.y)(Object(N.a)({},T));case 2:V=oe.sent,V.status===0?(Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),P.d.push("/classrooms/".concat(T.coursesId,"/exportlist/exercise_score"))):V.status===-3&&(Object(P.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),P.d.push("/classrooms/".concat(T.coursesId,"/exportlist/exercise_score")));case 4:case"end":return oe.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),h=function(){var G=Object(K.a)(M.a.mark(function B(T){return M.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return console.log("----------","\u8C03\u7528\u4E0B\u8F7D"),Z.next=3,Object(k.v)("",Object(k.Y)({url:D.a.API_SERVER+"/api/export_records/".concat(T.id,".xlsx"),query:T}));case 3:case"end":return Z.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),c=function(){var G=Object(K.a)(M.a.mark(function B(T){return M.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(k.v)("",Object(k.Y)({url:D.a.API_SERVER+"/api/ec_major_schools/0/ec_years.xlsx",query:T}));case 2:case"end":return Z.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),v=function(){var G=Object(K.a)(M.a.mark(function B(T){return M.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(k.v)("",Object(k.Y)({url:D.a.API_SERVER+"/api/ec_years/".concat(T==null?void 0:T.ec_year_id,"/ec_training_objectives.xlsx"),query:T}));case 2:case"end":return Z.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),p=function(){var G=Object(K.a)(M.a.mark(function B(T){return M.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(k.v)(T==null?void 0:T.name,Object(k.Y)({url:D.a.API_SERVER+"/api/attachments/get_ecs_attachment.docx",query:T}));case 2:case"end":return Z.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),E=function(){var G=Object(K.a)(M.a.mark(function B(T){return M.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(k.v)("",Object(k.Y)({url:D.a.API_SERVER+"/api/ec_years/".concat(T==null?void 0:T.ec_year_id,"/ec_courses.xlsx"),query:T}));case 2:case"end":return Z.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),U=function(){var G=Object(K.a)(M.a.mark(function B(T){return M.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(k.v)("",Object(k.Y)({url:D.a.API_SERVER+"/api/ec_years/".concat(T==null?void 0:T.ec_year_id,"/ec_graduation_requirements.xlsx"),query:T}));case 2:case"end":return Z.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),F=function(){var G=Object(K.a)(M.a.mark(function B(T){return M.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(k.v)("",Object(k.Y)({url:D.a.API_SERVER+"/api/courses/rank_list.xlsx",query:T}));case 2:case"end":return Z.stop()}},B)}));return function(T){return G.apply(this,arguments)}}(),z=function(){var G=Object(K.a)(M.a.mark(function B(T){return M.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,Object(k.v)("",Object(k.Y)({url:D.a.API_SERVER+"/api/courses/question_rank_list.xlsx",query:T}));case 2:case"end":return Z.stop()}},B)}));return function(T){return G.apply(this,arguments)}}()},n6Qo:function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return P});var te=I("q1tI"),Y=I("biw7"),N=I("fyJ8");function K(k){var D=k.className,b=k.index,m=k.children,f=k.colSpan,d=k.rowSpan,s=te.useContext(Y.a),r=s.prefixCls,u=s.fixedInfoList,o=u[b];return te.createElement(N.a,Object.assign({className:D,index:b,component:"td",prefixCls:r,record:null,dataIndex:null,render:function(){return{children:m,props:{colSpan:f,rowSpan:d}}}},o))}function A(k){return te.createElement("tr",Object.assign({},k))}function M(k){var D=k.children,b=te.useContext(Y.a),m=b.prefixCls;return te.createElement("tfoot",{className:"".concat(m,"-summary")},D)}var H=Qe.b=M,P={Cell:K,Row:A}},nPLb:function(tn,Qe,I){"use strict";var te=I("2qtc"),Y=I("kLXV"),N=I("g9YV"),K=I("wCAj"),A=I("5NDa"),M=I("5rEg"),H=I("14J3"),P=I("BMrR"),k=I("iQDF"),D=I("+eQT"),b=I("miYZ"),m=I("tsqr"),f=I("jrin"),d=I("oBTY"),s=I("k1fw"),r=I("9og8"),u=I("y8nQ"),o=I("Vl3Y"),a=I("tJVT"),n=I("PpiC"),R=I("WmNS"),w=I.n(R),x=I("q1tI"),O=I.n(x),C=I("wd/R"),_=I.n(C),y=I("ErOA"),h=I("1vsH"),c=I("Ty5D"),v=I("9kvl"),p=I("oUNq"),E=I("xKgJ"),U=I("eozf"),F=function(G){var B=G.classroomList,T=G.dispatch,V=G.courseEndTime,Z=Object(n.a)(G,["classroomList","dispatch","courseEndTime"]),oe=Object(c.i)(),pe=o.a.useForm(),Ye=Object(a.a)(pe,1),xe=Ye[0],Ie=Object(x.useState)(1),Je=Object(a.a)(Ie,2),Ke=Je[0],be=Je[1],de=Object(x.useState)([]),nt=Object(a.a)(de,2),Kt=nt[0],jt=nt[1],wt=Object(x.useState)(0),ze=Object(a.a)(wt,2),ft=ze[0],dt=ze[1],Nt=Object(x.useState)(2e4),Ze=Object(a.a)(Nt,2),Bt=Ze[0],Ut=Ze[1],Mt=Object(x.useState)(!0),An=Object(a.a)(Mt,2),mn=An[0],pn=An[1],tt=Object(x.useState)(),fn=Object(a.a)(tt,2),In=fn[0],He=fn[1],Ue=Object(x.useState)([]),pt=Object(a.a)(Ue,2),Ct=pt[0],Ge=pt[1];oe.id=oe.coursesId,Object(x.useEffect)(function(){B.actionTabs.key==="\u7ACB\u5373\u622A\u6B62"?vt():(Ge([]),jt([]))},[B.actionTabs.key]);var vt=function(){var ae=Object(r.a)(w.a.mark(function re(he){var ve,me,Be;return w.a.wrap(function(Jt){for(;;)switch(Jt.prev=Jt.next){case 0:return pn(!0),Jt.next=3,Object(p.D)(Object(s.a)(Object(s.a)({},oe),{},{page:he||Ke,limit:Bt,homework_id:B.actionTabs.type===1?"":B.actionTabs.selectArrs[0],end_homework_action:!0}));case 3:ve=Jt.sent,ve==null||ve.course_groups.map(function(En){En.key=En.id}),ve&&(jt([].concat(Object(d.a)(Kt),Object(d.a)(ve==null?void 0:ve.course_groups))),dt(ve==null?void 0:ve.group_count),He(ve==null?void 0:ve.course_groups),pn(!1),he||xe.setFieldsValue((Be={},Object(f.a)(Be,"group_ids",ve==null||((me=ve.course_groups)===null||me===void 0)?void 0:me.map(function(En){return String(En.id)})),Object(f.a)(Be,"end_time",_()(_()(new Date).add(0,"days").format("YYYY-MM-DD HH:mm"))),Be)));case 6:case"end":return Jt.stop()}},re)}));return function(he){return ae.apply(this,arguments)}}(),Ae=function(){var ae=Object(r.a)(w.a.mark(function re(){var he,ve,me,Be;return w.a.wrap(function(Jt){for(;;)switch(Jt.prev=Jt.next){case 0:if(he=Object(s.a)({},xe.getFieldsValue()),console.log("----",he.group_ids),!(In!=null&&In.length&&!(Ct!=null&&Ct.length))){Jt.next=5;break}return m.b.warning("\u8BF7\u9009\u62E9\u9700\u8981\u64CD\u4F5C\u7684\u73ED\u7EA7"),Jt.abrupt("return");case 5:return Jt.next=7,Object(y.a)("/api/courses/".concat(oe.id,"/homework_commons/end_with_homework_list_position.json"),{method:"post",body:{homework_ids:Object(d.a)(B.actionTabs.selectArrs),group_ids:(Ct==null?void 0:Ct.length)>0?Ct:[],unified_setting:!(Kt!=null&&Kt.length),end_time:_()(he.end_time).format("YYYY-MM-DD HH:mm")}});case 7:ve=Jt.sent,ve.status===0&&(ge(),Object(h.cb)(["\u6559\u5B66\u8BFE\u5802","\u56FE\u6587\u4F5C\u4E1A","\u7ACB\u5373\u622A\u6B62"]),m.b.success("\u64CD\u4F5C\u6210\u529F"),T({type:"classroomList/setActionTabs",payload:{key:"\u6E05\u9664\u9009\u62E9\u6570\u636E"}}),Z.onCallback&&Z.onCallback(),Object(E.c)()?(T({type:"classroomList/setActionTabs",payload:{}}),(B==null||((me=B.actionTabs)===null||me===void 0||((Be=me.selectArrsAll)===null||Be===void 0))?void 0:Be.length)>0?T({type:"classroomList/getClassroomTeacherCommonList",payload:Object(s.a)(Object(s.a)({},B.actionTabs.params),{},{type:5})}):T({type:"shixunHomeworks/getWorkList",payload:Object(s.a)({},oe)})):T({type:"classroomList/getClassroomCommonList",payload:Object(s.a)({},B.actionTabs.params)}));case 9:case"end":return Jt.stop()}},re)}));return function(){return ae.apply(this,arguments)}}(),ge=function(){be(1),jt([])},Ee=B.detailCommonHomeworksList;return O.a.createElement(Y.a,{centered:!0,title:"\u622A\u6B62\u4F5C\u4E1A",visible:B.actionTabs.key==="\u7ACB\u5373\u622A\u6B62",okText:"\u622A\u6B62\u4F5C\u4E1A",cancelText:"\u6682\u4E0D\u622A\u6B62",onOk:Ae,onCancel:function(){ge(),T({type:"classroomList/setActionTabs",payload:{}})}},O.a.createElement("p",{className:"tc"},"\u5B66\u751F\u5C06\u4E0D\u80FD\u518D\u63D0\u4EA4\u4F5C\u4E1A",O.a.createElement("br",null),'\u672C\u64CD\u4F5C\u53EA\u5BF9"\u63D0\u4EA4\u4E2D" \u201C\u8865\u4EA4\u4E2D\u201D\u7684\u4F5C\u4E1A\u6709\u6548'),Kt&&O.a.createElement(o.a,{form:xe},O.a.createElement(P.a,null,O.a.createElement("span",{className:"mr5"},"\u622A\u6B62\u65F6\u95F4:"),O.a.createElement(o.a.Item,{name:"end_time"},O.a.createElement(D.a,{style:{width:170},getPopupContainer:function(re){return re.parentNode},disabledDate:function(re){return Object(U.b)(re,V)},disabledTime:function(re){return Object(U.c)(re)},placeholder:"\u8BF7\u9009\u62E9\u7ED3\u675F\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:_()(Object(h.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",allowClear:!1}))),(In==null?void 0:In.length)>0&&O.a.createElement(P.a,null,O.a.createElement("span",{className:"mr5"},"\u9009\u62E9\u73ED\u7EA7:"),O.a.createElement(M.a.Search,{style:{width:"300px"},onChange:function(re){jt(In.filter(function(he){return he.name.indexOf(re.target.value)>-1}))}})),(Kt==null?void 0:Kt.length)>0&&B.actionTabs.type===1&&O.a.createElement(K.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(re,he){Ge(re)}},rowKey:"id",pagination:!1,dataSource:Kt,columns:[{title:"\u73ED\u7EA7",dataIndex:"name",key:"name"}]}),(Kt==null?void 0:Kt.length)>0&&B.actionTabs.type===2&&O.a.createElement(K.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(re,he){Ge(re)}},rowKey:"id",pagination:!1,dataSource:Kt,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"}]})))};Qe.a=Object(v.a)(function(z){var G=z.classroomList;return{classroomList:G}})(F)},oOBs:function(tn,Qe,I){tn.exports={leftdiv:"leftdiv___1FhsT",listClass:"listClass___1Y2ac",spantitle:"spantitle___1pL39",rightdiv:"rightdiv___3ZICD"}},ogmK:function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return si});var te=I("1OyB"),Y=I("vuIU"),N=I("Ji7U"),K=I("LK+K"),A=I("rePB"),M=I("VTBJ"),H=I("ODXe"),P=I("q1tI"),k=I("TSYQ"),D=I.n(k),b=I("Kwbf"),m=I("6cGi"),f=I("U8pU"),d=I("4IlW"),s=P.createContext({}),r=s,u={visibility:"hidden"};function o(J){var ue=J.prefixCls,Ce=J.prevIcon,Te=Ce===void 0?"\u2039":Ce,qe=J.nextIcon,Oe=qe===void 0?"\u203A":qe,Ve=J.superPrevIcon,et=Ve===void 0?"\xAB":Ve,Ot=J.superNextIcon,Et=Ot===void 0?"\xBB":Ot,je=J.onSuperPrev,ht=J.onSuperNext,it=J.onPrev,st=J.onNext,bt=J.children,Lt=P.useContext(r),ct=Lt.hideNextBtn,Gt=Lt.hidePrevBtn;return P.createElement("div",{className:ue},je&&P.createElement("button",{type:"button",onClick:je,tabIndex:-1,className:"".concat(ue,"-super-prev-btn"),style:Gt?u:{}},et),it&&P.createElement("button",{type:"button",onClick:it,tabIndex:-1,className:"".concat(ue,"-prev-btn"),style:Gt?u:{}},Te),P.createElement("div",{className:"".concat(ue,"-view")},bt),st&&P.createElement("button",{type:"button",onClick:st,tabIndex:-1,className:"".concat(ue,"-next-btn"),style:ct?u:{}},Oe),ht&&P.createElement("button",{type:"button",onClick:ht,tabIndex:-1,className:"".concat(ue,"-super-next-btn"),style:ct?u:{}},Et))}var a=o;function n(J){var ue=P.useContext(r),Ce=ue.hideHeader;if(Ce)return null;var Te=J.prefixCls,qe=J.generateConfig,Oe=J.locale,Ve=J.value,et=J.format,Ot="".concat(Te,"-header");return P.createElement(a,{prefixCls:Ot},Ve?qe.locale.format(Oe.locale,Ve,et):"\xA0")}var R=n,w=I("YrtM"),x=I("KQm4"),O=new Map;function C(J,ue,Ce){if(O.get(J)&&cancelAnimationFrame(O.get(J)),Ce<=0){O.set(J,requestAnimationFrame(function(){J.scrollTop=ue}));return}var Te=ue-J.scrollTop,qe=Te/Ce*10;O.set(J,requestAnimationFrame(function(){J.scrollTop+=qe,J.scrollTop!==ue&&C(J,ue,Ce-10)}))}function _(J,ue){var Ce=ue.onLeftRight,Te=ue.onCtrlLeftRight,qe=ue.onUpDown,Oe=ue.onPageUpDown,Ve=ue.onEnter,et=J.which,Ot=J.ctrlKey,Et=J.metaKey;switch(et){case d.a.LEFT:if(Ot||Et){if(Te)return Te(-1),!0}else if(Ce)return Ce(-1),!0;break;case d.a.RIGHT:if(Ot||Et){if(Te)return Te(1),!0}else if(Ce)return Ce(1),!0;break;case d.a.UP:if(qe)return qe(-1),!0;break;case d.a.DOWN:if(qe)return qe(1),!0;break;case d.a.PAGE_UP:if(Oe)return Oe(-1),!0;break;case d.a.PAGE_DOWN:if(Oe)return Oe(1),!0;break;case d.a.ENTER:if(Ve)return Ve(),!0;break}return!1}function y(J,ue,Ce,Te){var qe=J;if(!qe)switch(ue){case"time":qe=Te?"hh:mm:ss a":"HH:mm:ss";break;case"week":qe="gggg-wo";break;case"month":qe="YYYY-MM";break;case"quarter":qe="YYYY-[Q]Q";break;case"year":qe="YYYY";break;default:qe=Ce?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD"}return qe}function h(J,ue){var Ce=J==="time"?8:10;return Math.max(Ce,ue.length)+2}var c=null,v=new Set;function p(J){return!c&&typeof window!="undefined"&&window.addEventListener&&(c=function(Ce){Object(x.a)(v).forEach(function(Te){Te(Ce)})},window.addEventListener("mousedown",c)),v.add(J),function(){v.delete(J),v.size===0&&(window.removeEventListener("mousedown",c),c=null)}}var E=function(ue){return ue==="month"||ue==="date"?"year":ue},U=function(ue){return ue==="date"?"month":ue},F=function(ue){return ue==="month"||ue==="date"?"quarter":ue},z=function(ue){return ue==="date"?"week":ue},G={year:E,month:U,quarter:F,week:z,time:null,date:null};function B(J,ue){return J.some(function(Ce){return Ce&&Ce.contains(ue)})}function T(J){var ue=J.prefixCls,Ce=J.units,Te=J.onSelect,qe=J.value,Oe=J.active,Ve=J.hideDisabledOptions,et="".concat(ue,"-cell"),Ot=P.useContext(r),Et=Ot.open,je=P.useRef(null),ht=P.useRef(new Map);return P.useLayoutEffect(function(){var it=ht.current.get(qe);it&&Et!==!1&&C(je.current,it.offsetTop,120)},[qe]),P.useLayoutEffect(function(){if(Et){var it=ht.current.get(qe);it&&C(je.current,it.offsetTop,0)}},[Et]),P.createElement("ul",{className:D()("".concat(ue,"-column"),Object(A.a)({},"".concat(ue,"-column-active"),Oe)),ref:je,style:{position:"relative"}},Ce.map(function(it){var st;return Ve&&it.disabled?null:P.createElement("li",{key:it.value,ref:function(Lt){ht.current.set(it.value,Lt)},className:D()(et,(st={},Object(A.a)(st,"".concat(et,"-disabled"),it.disabled),Object(A.a)(st,"".concat(et,"-selected"),qe===it.value),st)),onClick:function(){if(it.disabled)return;Te(it.value)}},P.createElement("div",{className:"".concat(et,"-inner")},it.label))}))}var V=T;function Z(J,ue){for(var Ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"0",Te=String(J);Te.length<ue;)Te="".concat(Ce).concat(J);return Te}var oe=function(){for(var ue=arguments.length,Ce=new Array(ue),Te=0;Te<ue;Te++)Ce[Te]=arguments[Te];return Ce};function pe(J){return J==null?[]:Array.isArray(J)?J:[J]}function Ye(J){var ue={};return Object.keys(J).forEach(function(Ce){(Ce.substr(0,5)==="data-"||Ce.substr(0,5)==="aria-"||Ce==="role"||Ce==="name")&&Ce.substr(0,7)!=="data-__"&&(ue[Ce]=J[Ce])}),ue}function xe(J,ue){return J?J[ue]:null}function Ie(J,ue,Ce){var Te=[xe(J,0),xe(J,1)];return Te[Ce]=typeof ue=="function"?ue(Te[Ce]):ue,!Te[0]&&!Te[1]?null:Te}function Je(J,ue,Ce,Te,qe){var Oe=J.setHour(ue,Ce);return Oe=J.setMinute(Oe,Te),Oe=J.setSecond(Oe,qe),Oe}function Ke(J,ue,Ce,Te,qe,Oe){var Ve=Math.floor(J/Te)*Te;if(Ve<J)return[Ve,60-qe,60-Oe];var et=Math.floor(ue/qe)*qe;if(et<ue)return[Ve,et,60-Oe];var Ot=Math.floor(Ce/Oe)*Oe;return[Ve,et,Ot]}function be(J,ue){if(J.length!==ue.length)return!0;for(var Ce=0;Ce<J.length;Ce+=1)if(J[Ce].disabled!==ue[Ce].disabled)return!0;return!1}function de(J,ue,Ce,Te){for(var qe=[],Oe=J;Oe<=ue;Oe+=Ce)qe.push({label:Z(Oe,2),value:Oe,disabled:(Te||[]).includes(Oe)});return qe}function nt(J){var ue=J.generateConfig,Ce=J.prefixCls,Te=J.operationRef,qe=J.activeColumnIndex,Oe=J.value,Ve=J.showHour,et=J.showMinute,Ot=J.showSecond,Et=J.use12Hours,je=J.hourStep,ht=je===void 0?1:je,it=J.minuteStep,st=it===void 0?1:it,bt=J.secondStep,Lt=bt===void 0?1:bt,ct=J.disabledHours,Gt=J.disabledMinutes,on=J.disabledSeconds,Dn=J.hideDisabledOptions,Kn=J.onSelect,wn=[],Nn="".concat(Ce,"-content"),Pn="".concat(Ce,"-time-panel"),Dt,sn=Oe?ue.getHour(Oe):-1,Ft=Oe?ue.getMinute(Oe):-1,St=Oe?ue.getSecond(Oe):-1,Un=function(bn,Rt,Xe,kt){var Pt=Oe||ue.getNow(),an=Math.max(0,Rt),zn=Math.max(0,Xe),Ln=Math.max(0,kt);return Pt=Je(ue,Pt,!Et||!bn?an:an+12,zn,Ln),Pt},Sn=de(0,23,ht,ct&&ct()),zt=Object(w.a)(function(){return Sn},Sn,be);Et&&(Dt=sn>=12,sn%=12);var lt=P.useMemo(function(){if(!Et)return[!1,!1];var Rn=[!0,!0];return zt.forEach(function(bn){var Rt=bn.disabled,Xe=bn.value;if(Rt)return;Xe>=12?Rn[1]=!1:Rn[0]=!1}),Rn},[Et,zt]),jn=Object(H.a)(lt,2),ln=jn[0],Jn=jn[1],$t=P.useMemo(function(){return Et?zt.filter(Dt?function(Rn){return Rn.value>=12}:function(Rn){return Rn.value<12}).map(function(Rn){var bn=Rn.value%12,Rt=bn===0?"12":Z(bn,2);return Object(M.a)(Object(M.a)({},Rn),{},{label:Rt,value:bn})}):zt},[Et,zt]),On=de(0,59,st,Gt&&Gt(sn)),Fn=de(0,59,Lt,on&&on(sn,Ft));Te.current={onUpDown:function(bn){var Rt=wn[qe];if(Rt)for(var Xe=Rt.units.findIndex(function(zn){return zn.value===Rt.value}),kt=Rt.units.length,Pt=1;Pt<kt;Pt+=1){var an=Rt.units[(Xe+bn*Pt+kt)%kt];if(an.disabled!==!0){Rt.onSelect(an.value);break}}}};function hn(Rn,bn,Rt,Xe,kt){Rn!==!1&&wn.push({node:P.cloneElement(bn,{prefixCls:Pn,value:Rt,active:qe===wn.length,onSelect:kt,units:Xe,hideDisabledOptions:Dn}),onSelect:kt,value:Rt,units:Xe})}hn(Ve,P.createElement(V,{key:"hour"}),sn,$t,function(Rn){Kn(Un(Dt,Rn,Ft,St),"mouse")}),hn(et,P.createElement(V,{key:"minute"}),Ft,On,function(Rn){Kn(Un(Dt,sn,Rn,St),"mouse")}),hn(Ot,P.createElement(V,{key:"second"}),St,Fn,function(Rn){Kn(Un(Dt,sn,Ft,Rn),"mouse")});var yi=-1;return typeof Dt=="boolean"&&(yi=Dt?1:0),hn(Et===!0,P.createElement(V,{key:"12hours"}),yi,[{label:"AM",value:0,disabled:ln},{label:"PM",value:1,disabled:Jn}],function(Rn){Kn(Un(!!Rn,sn,Ft,St),"mouse")}),P.createElement("div",{className:Nn},wn.map(function(Rn){var bn=Rn.node;return bn}))}var Kt=nt,jt=function(ue){return ue.filter(function(Ce){return Ce!==!1}).length};function wt(J){var ue=J.generateConfig,Ce=J.format,Te=Ce===void 0?"HH:mm:ss":Ce,qe=J.prefixCls,Oe=J.active,Ve=J.operationRef,et=J.showHour,Ot=J.showMinute,Et=J.showSecond,je=J.use12Hours,ht=je===void 0?!1:je,it=J.onSelect,st=J.value,bt="".concat(qe,"-time-panel"),Lt=P.useRef(),ct=P.useState(-1),Gt=Object(H.a)(ct,2),on=Gt[0],Dn=Gt[1],Kn=jt([et,Ot,Et,ht]);return Ve.current={onKeyDown:function(Nn){return _(Nn,{onLeftRight:function(Dt){Dn((on+Dt+Kn)%Kn)},onUpDown:function(Dt){on===-1?Dn(0):Lt.current&&Lt.current.onUpDown(Dt)},onEnter:function(){it(st||ue.getNow(),"key"),Dn(-1)}})},onBlur:function(){Dn(-1)}},P.createElement("div",{className:D()(bt,Object(A.a)({},"".concat(bt,"-active"),Oe))},P.createElement(R,Object.assign({},J,{format:Te,prefixCls:qe})),P.createElement(Kt,Object.assign({},J,{prefixCls:qe,activeColumnIndex:on,operationRef:Lt})))}var ze=wt,ft=7;function dt(J,ue){return!J&&!ue?!0:!J||!ue?!1:void 0}function Nt(J,ue,Ce){var Te=dt(ue,Ce);if(typeof Te=="boolean")return Te;var qe=Math.floor(J.getYear(ue)/10),Oe=Math.floor(J.getYear(Ce)/10);return qe===Oe}function Ze(J,ue,Ce){var Te=dt(ue,Ce);return typeof Te=="boolean"?Te:J.getYear(ue)===J.getYear(Ce)}function Bt(J,ue){var Ce=Math.floor(J.getMonth(ue)/3);return Ce+1}function Ut(J,ue,Ce){var Te=dt(ue,Ce);return typeof Te=="boolean"?Te:Ze(J,ue,Ce)&&Bt(J,ue)===Bt(J,Ce)}function Mt(J,ue,Ce){var Te=dt(ue,Ce);return typeof Te=="boolean"?Te:Ze(J,ue,Ce)&&J.getMonth(ue)===J.getMonth(Ce)}function An(J,ue,Ce){var Te=dt(ue,Ce);return typeof Te=="boolean"?Te:J.getYear(ue)===J.getYear(Ce)&&J.getMonth(ue)===J.getMonth(Ce)&&J.getDate(ue)===J.getDate(Ce)}function mn(J,ue,Ce){var Te=dt(ue,Ce);return typeof Te=="boolean"?Te:J.getHour(ue)===J.getHour(Ce)&&J.getMinute(ue)===J.getMinute(Ce)&&J.getSecond(ue)===J.getSecond(Ce)}function pn(J,ue,Ce,Te){var qe=dt(Ce,Te);return typeof qe=="boolean"?qe:J.locale.getWeek(ue,Ce)===J.locale.getWeek(ue,Te)}function tt(J,ue,Ce){return An(J,ue,Ce)&&mn(J,ue,Ce)}function fn(J,ue,Ce,Te){return!ue||!Ce||!Te?!1:!An(J,ue,Te)&&!An(J,Ce,Te)&&J.isAfter(Te,ue)&&J.isAfter(Ce,Te)}function In(J,ue,Ce){var Te=ue.locale.getWeekFirstDay(J),qe=ue.setDate(Ce,1),Oe=ue.getWeekDay(qe),Ve=ue.addDate(qe,Te-Oe);return ue.getMonth(Ve)===ue.getMonth(Ce)&&ue.getDate(Ve)>1&&(Ve=ue.addDate(Ve,-7)),Ve}function He(J,ue,Ce){var Te=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;switch(ue){case"year":return Ce.addYear(J,Te*10);case"quarter":case"month":return Ce.addYear(J,Te);default:return Ce.addMonth(J,Te)}}var Ue=P.createContext({}),pt=Ue;function Ct(J){var ue=J.cellPrefixCls,Ce=J.generateConfig,Te=J.rangedValue,qe=J.hoverRangedValue,Oe=J.isInView,Ve=J.isSameCell,et=J.offsetCell,Ot=J.today,Et=J.value;function je(ht){var it,st=et(ht,-1),bt=et(ht,1),Lt=xe(Te,0),ct=xe(Te,1),Gt=xe(qe,0),on=xe(qe,1),Dn=fn(Ce,Gt,on,ht);function Kn(Ft){return Ve(Lt,Ft)}function wn(Ft){return Ve(ct,Ft)}var Nn=Ve(Gt,ht),Pn=Ve(on,ht),Dt=(Dn||Pn)&&(!Oe(st)||wn(st)),sn=(Dn||Nn)&&(!Oe(bt)||Kn(bt));return it={},Object(A.a)(it,"".concat(ue,"-in-view"),Oe(ht)),Object(A.a)(it,"".concat(ue,"-in-range"),fn(Ce,Lt,ct,ht)),Object(A.a)(it,"".concat(ue,"-range-start"),Kn(ht)),Object(A.a)(it,"".concat(ue,"-range-end"),wn(ht)),Object(A.a)(it,"".concat(ue,"-range-start-single"),Kn(ht)&&!ct),Object(A.a)(it,"".concat(ue,"-range-end-single"),wn(ht)&&!Lt),Object(A.a)(it,"".concat(ue,"-range-start-near-hover"),Kn(ht)&&(Ve(st,Gt)||fn(Ce,Gt,on,st))),Object(A.a)(it,"".concat(ue,"-range-end-near-hover"),wn(ht)&&(Ve(bt,on)||fn(Ce,Gt,on,bt))),Object(A.a)(it,"".concat(ue,"-range-hover"),Dn),Object(A.a)(it,"".concat(ue,"-range-hover-start"),Nn),Object(A.a)(it,"".concat(ue,"-range-hover-end"),Pn),Object(A.a)(it,"".concat(ue,"-range-hover-edge-start"),Dt),Object(A.a)(it,"".concat(ue,"-range-hover-edge-end"),sn),Object(A.a)(it,"".concat(ue,"-range-hover-edge-start-near-range"),Dt&&Ve(st,ct)),Object(A.a)(it,"".concat(ue,"-range-hover-edge-end-near-range"),sn&&Ve(bt,Lt)),Object(A.a)(it,"".concat(ue,"-today"),Ve(Ot,ht)),Object(A.a)(it,"".concat(ue,"-selected"),Ve(Et,ht)),it}return je}function Ge(J){for(var ue=J.prefixCls,Ce=J.disabledDate,Te=J.onSelect,qe=J.rowNum,Oe=J.colNum,Ve=J.prefixColumn,et=J.rowClassName,Ot=J.baseDate,Et=J.getCellClassName,je=J.getCellText,ht=J.getCellNode,it=J.getCellDate,st=J.titleCell,bt=J.headerCells,Lt=P.useContext(r),ct=Lt.onDateMouseEnter,Gt=Lt.onDateMouseLeave,on="".concat(ue,"-cell"),Dn=[],Kn=0;Kn<qe;Kn+=1){for(var wn=[],Nn=void 0,Pn=function(Ft){var St=Kn*Oe+Ft,Un=it(Ot,St),Sn=Ce&&Ce(Un);Ft===0&&(Nn=Un,Ve&&wn.push(Ve(Nn))),wn.push(P.createElement("td",{key:Ft,title:st&&st(Un),className:D()(on,Object(M.a)(Object(A.a)({},"".concat(on,"-disabled"),Sn),Et(Un))),onClick:function(){Sn||Te(Un)},onMouseEnter:function(){!Sn&&ct&&ct(Un)},onMouseLeave:function(){!Sn&&Gt&&Gt(Un)}},ht?ht(Un):P.createElement("div",{className:"".concat(on,"-inner")},je(Un))))},Dt=0;Dt<Oe;Dt+=1)Pn(Dt);Dn.push(P.createElement("tr",{key:Kn,className:et&&et(Nn)},wn))}return P.createElement("div",{className:"".concat(ue,"-body")},P.createElement("table",{className:"".concat(ue,"-content")},bt&&P.createElement("thead",null,P.createElement("tr",null,bt)),P.createElement("tbody",null,Dn)))}function vt(J){var ue=J.prefixCls,Ce=J.generateConfig,Te=J.prefixColumn,qe=J.locale,Oe=J.rowCount,Ve=J.viewDate,et=J.value,Ot=J.dateRender,Et=P.useContext(pt),je=Et.rangedValue,ht=Et.hoverRangedValue,it=In(qe.locale,Ce,Ve),st="".concat(ue,"-cell"),bt=Ce.locale.getWeekFirstDay(qe.locale),Lt=Ce.getNow(),ct=[],Gt=qe.shortWeekDays||(Ce.locale.getShortWeekDays?Ce.locale.getShortWeekDays(qe.locale):[]);Te&&ct.push(P.createElement("th",{key:"empty","aria-label":"empty cell"}));for(var on=0;on<ft;on+=1)ct.push(P.createElement("th",{key:on},Gt[(on+bt)%ft]));var Dn=Ct({cellPrefixCls:st,today:Lt,value:et,generateConfig:Ce,rangedValue:Te?null:je,hoverRangedValue:Te?null:ht,isSameCell:function(Nn,Pn){return An(Ce,Nn,Pn)},isInView:function(Nn){return Mt(Ce,Nn,Ve)},offsetCell:function(Nn,Pn){return Ce.addDate(Nn,Pn)}}),Kn=Ot?function(wn){return Ot(wn,Lt)}:void 0;return P.createElement(Ge,Object.assign({},J,{rowNum:Oe,colNum:ft,baseDate:it,getCellNode:Kn,getCellText:Ce.getDate,getCellClassName:Dn,getCellDate:Ce.addDate,titleCell:function(Nn){return Ce.locale.format(qe.locale,Nn,"YYYY-MM-DD")},headerCells:ct}))}var Ae=vt;function ge(J){var ue=J.prefixCls,Ce=J.generateConfig,Te=J.locale,qe=J.viewDate,Oe=J.onNextMonth,Ve=J.onPrevMonth,et=J.onNextYear,Ot=J.onPrevYear,Et=J.onYearClick,je=J.onMonthClick,ht=P.useContext(r),it=ht.hideHeader;if(it)return null;var st="".concat(ue,"-header"),bt=Te.shortMonths||(Ce.locale.getShortMonths?Ce.locale.getShortMonths(Te.locale):[]),Lt=Ce.getMonth(qe),ct=P.createElement("button",{type:"button",key:"year",onClick:Et,tabIndex:-1,className:"".concat(ue,"-year-btn")},Ce.locale.format(Te.locale,qe,Te.yearFormat)),Gt=P.createElement("button",{type:"button",key:"month",onClick:je,tabIndex:-1,className:"".concat(ue,"-month-btn")},Te.monthFormat?Ce.locale.format(Te.locale,qe,Te.monthFormat):bt[Lt]),on=Te.monthBeforeYear?[Gt,ct]:[ct,Gt];return P.createElement(a,Object.assign({},J,{prefixCls:st,onSuperPrev:Ot,onPrev:Ve,onNext:Oe,onSuperNext:et}),on)}var Ee=ge,ae=6;function re(J){var ue=J.prefixCls,Ce=J.panelName,Te=Ce===void 0?"date":Ce,qe=J.keyboardConfig,Oe=J.active,Ve=J.operationRef,et=J.generateConfig,Ot=J.value,Et=J.viewDate,je=J.onViewDateChange,ht=J.onPanelChange,it=J.onSelect,st="".concat(ue,"-").concat(Te,"-panel");Ve.current={onKeyDown:function(Gt){return _(Gt,Object(M.a)({onLeftRight:function(Dn){it(et.addDate(Ot||Et,Dn),"key")},onCtrlLeftRight:function(Dn){it(et.addYear(Ot||Et,Dn),"key")},onUpDown:function(Dn){it(et.addDate(Ot||Et,Dn*ft),"key")},onPageUpDown:function(Dn){it(et.addMonth(Ot||Et,Dn),"key")}},qe))}};var bt=function(Gt){var on=et.addYear(Et,Gt);je(on),ht(null,on)},Lt=function(Gt){var on=et.addMonth(Et,Gt);je(on),ht(null,on)};return P.createElement("div",{className:D()(st,Object(A.a)({},"".concat(st,"-active"),Oe))},P.createElement(Ee,Object.assign({},J,{prefixCls:ue,value:Ot,viewDate:Et,onPrevYear:function(){bt(-1)},onNextYear:function(){bt(1)},onPrevMonth:function(){Lt(-1)},onNextMonth:function(){Lt(1)},onMonthClick:function(){ht("month",Et)},onYearClick:function(){ht("year",Et)}})),P.createElement(Ae,Object.assign({},J,{onSelect:function(Gt){return it(Gt,"mouse")},prefixCls:ue,value:Ot,viewDate:Et,rowCount:ae})))}var he=re;function ve(J,ue,Ce){if(!Ce)return ue;var Te=ue;return Te=J.setHour(Te,J.getHour(Ce)),Te=J.setMinute(Te,J.getMinute(Ce)),Te=J.setSecond(Te,J.getSecond(Ce)),Te}var me=oe("date","time");function Be(J){var ue=J.prefixCls,Ce=J.operationRef,Te=J.generateConfig,qe=J.value,Oe=J.defaultValue,Ve=J.disabledTime,et=J.showTime,Ot=J.onSelect,Et="".concat(ue,"-datetime-panel"),je=P.useState(null),ht=Object(H.a)(je,2),it=ht[0],st=ht[1],bt=P.useRef({}),Lt=P.useRef({}),ct=Object(f.a)(et)==="object"?Object(M.a)({},et):{};function Gt(wn){var Nn=me.indexOf(it)+wn,Pn=me[Nn]||null;return Pn}var on=function(Nn){Lt.current.onBlur&&Lt.current.onBlur(Nn),st(null)};Ce.current={onKeyDown:function(Nn){if(Nn.which===d.a.TAB){var Pn=Gt(Nn.shiftKey?-1:1);return st(Pn),Pn&&Nn.preventDefault(),!0}if(it){var Dt=it==="date"?bt:Lt;return Dt.current&&Dt.current.onKeyDown&&Dt.current.onKeyDown(Nn),!0}return[d.a.LEFT,d.a.RIGHT,d.a.UP,d.a.DOWN].includes(Nn.which)?(st("date"),!0):!1},onBlur:on,onClose:on};var Dn=function(Nn,Pn){var Dt=Nn;Pn==="date"&&!qe&&ct.defaultValue?(Dt=Te.setHour(Dt,Te.getHour(ct.defaultValue)),Dt=Te.setMinute(Dt,Te.getMinute(ct.defaultValue)),Dt=Te.setSecond(Dt,Te.getSecond(ct.defaultValue))):Pn==="time"&&!qe&&Oe&&(Dt=Te.setYear(Dt,Te.getYear(Oe)),Dt=Te.setMonth(Dt,Te.getMonth(Oe)),Dt=Te.setDate(Dt,Te.getDate(Oe))),Ot&&Ot(Dt,"mouse")},Kn=Ve?Ve(qe||null):{};return P.createElement("div",{className:D()(Et,Object(A.a)({},"".concat(Et,"-active"),it))},P.createElement(he,Object.assign({},J,{operationRef:bt,active:it==="date",onSelect:function(Nn){Dn(ve(Te,Nn,et&&Object(f.a)(et)==="object"?et.defaultValue:null),"date")}})),P.createElement(ze,Object.assign({},J,{format:void 0},ct,Kn,{defaultValue:void 0,operationRef:Lt,active:it==="time",onSelect:function(Nn){Dn(Nn,"time")}})))}var Tt=Be;function Jt(J){var ue=J.prefixCls,Ce=J.generateConfig,Te=J.locale,qe=J.value,Oe="".concat(ue,"-cell"),Ve=function(je){return P.createElement("td",{key:"week",className:D()(Oe,"".concat(Oe,"-week"))},Ce.locale.getWeek(Te.locale,je))},et="".concat(ue,"-week-panel-row"),Ot=function(je){return D()(et,Object(A.a)({},"".concat(et,"-selected"),pn(Ce,Te.locale,qe,je)))};return P.createElement(he,Object.assign({},J,{panelName:"week",prefixColumn:Ve,rowClassName:Ot,keyboardConfig:{onLeftRight:null}}))}var En=Jt;function mt(J){var ue=J.prefixCls,Ce=J.generateConfig,Te=J.locale,qe=J.viewDate,Oe=J.onNextYear,Ve=J.onPrevYear,et=J.onYearClick,Ot=P.useContext(r),Et=Ot.hideHeader;if(Et)return null;var je="".concat(ue,"-header");return P.createElement(a,Object.assign({},J,{prefixCls:je,onSuperPrev:Ve,onSuperNext:Oe}),P.createElement("button",{type:"button",onClick:et,className:"".concat(ue,"-year-btn")},Ce.locale.format(Te.locale,qe,Te.yearFormat)))}var Qt=mt,gt=3,yt=4;function rt(J){var ue=J.prefixCls,Ce=J.locale,Te=J.value,qe=J.viewDate,Oe=J.generateConfig,Ve=J.monthCellRender,et=P.useContext(pt),Ot=et.rangedValue,Et=et.hoverRangedValue,je="".concat(ue,"-cell"),ht=Ct({cellPrefixCls:je,value:Te,generateConfig:Oe,rangedValue:Ot,hoverRangedValue:Et,isSameCell:function(ct,Gt){return Mt(Oe,ct,Gt)},isInView:function(){return!0},offsetCell:function(ct,Gt){return Oe.addMonth(ct,Gt)}}),it=Ce.shortMonths||(Oe.locale.getShortMonths?Oe.locale.getShortMonths(Ce.locale):[]),st=Oe.setMonth(qe,0),bt=Ve?function(Lt){return Ve(Lt,Ce)}:void 0;return P.createElement(Ge,Object.assign({},J,{rowNum:yt,colNum:gt,baseDate:st,getCellNode:bt,getCellText:function(ct){return Ce.monthFormat?Oe.locale.format(Ce.locale,ct,Ce.monthFormat):it[Oe.getMonth(ct)]},getCellClassName:ht,getCellDate:Oe.addMonth,titleCell:function(ct){return Oe.locale.format(Ce.locale,ct,"YYYY-MM")}}))}var ce=rt;function Re(J){var ue=J.prefixCls,Ce=J.operationRef,Te=J.onViewDateChange,qe=J.generateConfig,Oe=J.value,Ve=J.viewDate,et=J.onPanelChange,Ot=J.onSelect,Et="".concat(ue,"-month-panel");Ce.current={onKeyDown:function(it){return _(it,{onLeftRight:function(bt){Ot(qe.addMonth(Oe||Ve,bt),"key")},onCtrlLeftRight:function(bt){Ot(qe.addYear(Oe||Ve,bt),"key")},onUpDown:function(bt){Ot(qe.addMonth(Oe||Ve,bt*gt),"key")},onEnter:function(){et("date",Oe||Ve)}})}};var je=function(it){var st=qe.addYear(Ve,it);Te(st),et(null,st)};return P.createElement("div",{className:Et},P.createElement(Qt,Object.assign({},J,{prefixCls:ue,onPrevYear:function(){je(-1)},onNextYear:function(){je(1)},onYearClick:function(){et("year",Ve)}})),P.createElement(ce,Object.assign({},J,{prefixCls:ue,onSelect:function(it){Ot(it,"mouse"),et("date",it)}})))}var At=Re;function ot(J){var ue=J.prefixCls,Ce=J.generateConfig,Te=J.locale,qe=J.viewDate,Oe=J.onNextYear,Ve=J.onPrevYear,et=J.onYearClick,Ot=P.useContext(r),Et=Ot.hideHeader;if(Et)return null;var je="".concat(ue,"-header");return P.createElement(a,Object.assign({},J,{prefixCls:je,onSuperPrev:Ve,onSuperNext:Oe}),P.createElement("button",{type:"button",onClick:et,className:"".concat(ue,"-year-btn")},Ce.locale.format(Te.locale,qe,Te.yearFormat)))}var Yt=ot,rn=4,_e=1;function Ne(J){var ue=J.prefixCls,Ce=J.locale,Te=J.value,qe=J.viewDate,Oe=J.generateConfig,Ve=P.useContext(pt),et=Ve.rangedValue,Ot=Ve.hoverRangedValue,Et="".concat(ue,"-cell"),je=Ct({cellPrefixCls:Et,value:Te,generateConfig:Oe,rangedValue:et,hoverRangedValue:Ot,isSameCell:function(st,bt){return Ut(Oe,st,bt)},isInView:function(){return!0},offsetCell:function(st,bt){return Oe.addMonth(st,bt*3)}}),ht=Oe.setDate(Oe.setMonth(qe,0),1);return P.createElement(Ge,Object.assign({},J,{rowNum:_e,colNum:rn,baseDate:ht,getCellText:function(st){return Oe.locale.format(Ce.locale,st,Ce.quarterFormat||"[Q]Q")},getCellClassName:je,getCellDate:function(st,bt){return Oe.addMonth(st,bt*3)},titleCell:function(st){return Oe.locale.format(Ce.locale,st,"YYYY-[Q]Q")}}))}var xt=Ne;function Xt(J){var ue=J.prefixCls,Ce=J.operationRef,Te=J.onViewDateChange,qe=J.generateConfig,Oe=J.value,Ve=J.viewDate,et=J.onPanelChange,Ot=J.onSelect,Et="".concat(ue,"-quarter-panel");Ce.current={onKeyDown:function(it){return _(it,{onLeftRight:function(bt){Ot(qe.addMonth(Oe||Ve,bt*3),"key")},onCtrlLeftRight:function(bt){Ot(qe.addYear(Oe||Ve,bt),"key")},onUpDown:function(bt){Ot(qe.addYear(Oe||Ve,bt),"key")}})}};var je=function(it){var st=qe.addYear(Ve,it);Te(st),et(null,st)};return P.createElement("div",{className:Et},P.createElement(Yt,Object.assign({},J,{prefixCls:ue,onPrevYear:function(){je(-1)},onNextYear:function(){je(1)},onYearClick:function(){et("year",Ve)}})),P.createElement(xt,Object.assign({},J,{prefixCls:ue,onSelect:function(it){Ot(it,"mouse")}})))}var vn=Xt;function Mn(J){var ue=J.prefixCls,Ce=J.generateConfig,Te=J.viewDate,qe=J.onPrevDecade,Oe=J.onNextDecade,Ve=J.onDecadeClick,et=P.useContext(r),Ot=et.hideHeader;if(Ot)return null;var Et="".concat(ue,"-header"),je=Ce.getYear(Te),ht=Math.floor(je/hi)*hi,it=ht+hi-1;return P.createElement(a,Object.assign({},J,{prefixCls:Et,onSuperPrev:qe,onSuperNext:Oe}),P.createElement("button",{type:"button",onClick:Ve,className:"".concat(ue,"-decade-btn")},ht,"-",it))}var ci=Mn,$n=3,Cn=4;function Ti(J){var ue=J.prefixCls,Ce=J.value,Te=J.viewDate,qe=J.locale,Oe=J.generateConfig,Ve=P.useContext(pt),et=Ve.rangedValue,Ot=Ve.hoverRangedValue,Et="".concat(ue,"-cell"),je=Oe.getYear(Te),ht=Math.floor(je/hi)*hi,it=ht+hi-1,st=Oe.setYear(Te,ht-Math.ceil(($n*Cn-hi)/2)),bt=function(Gt){var on=Oe.getYear(Gt);return ht<=on&&on<=it},Lt=Ct({cellPrefixCls:Et,value:Ce,generateConfig:Oe,rangedValue:et,hoverRangedValue:Ot,isSameCell:function(Gt,on){return Ze(Oe,Gt,on)},isInView:bt,offsetCell:function(Gt,on){return Oe.addYear(Gt,on)}});return P.createElement(Ge,Object.assign({},J,{rowNum:Cn,colNum:$n,baseDate:st,getCellText:Oe.getYear,getCellClassName:Lt,getCellDate:Oe.addYear,titleCell:function(Gt){return Oe.locale.format(qe.locale,Gt,"YYYY")}}))}var Wi=Ti,hi=10;function fi(J){var ue=J.prefixCls,Ce=J.operationRef,Te=J.onViewDateChange,qe=J.generateConfig,Oe=J.value,Ve=J.viewDate,et=J.sourceMode,Ot=J.onSelect,Et=J.onPanelChange,je="".concat(ue,"-year-panel");Ce.current={onKeyDown:function(st){return _(st,{onLeftRight:function(Lt){Ot(qe.addYear(Oe||Ve,Lt),"key")},onCtrlLeftRight:function(Lt){Ot(qe.addYear(Oe||Ve,Lt*hi),"key")},onUpDown:function(Lt){Ot(qe.addYear(Oe||Ve,Lt*$n),"key")},onEnter:function(){Et(et==="date"?"date":"month",Oe||Ve)}})}};var ht=function(st){var bt=qe.addYear(Ve,st*10);Te(bt),Et(null,bt)};return P.createElement("div",{className:je},P.createElement(ci,Object.assign({},J,{prefixCls:ue,onPrevDecade:function(){ht(-1)},onNextDecade:function(){ht(1)},onDecadeClick:function(){Et("decade",Ve)}})),P.createElement(Wi,Object.assign({},J,{prefixCls:ue,onSelect:function(st){Et(et==="date"?"date":"month",st),Ot(st,"mouse")}})))}var ji=fi;function er(J){var ue=J.prefixCls,Ce=J.generateConfig,Te=J.viewDate,qe=J.onPrevDecades,Oe=J.onNextDecades,Ve=P.useContext(r),et=Ve.hideHeader;if(et)return null;var Ot="".concat(ue,"-header"),Et=Ce.getYear(Te),je=Math.floor(Et/nr)*nr,ht=je+nr-1;return P.createElement(a,Object.assign({},J,{prefixCls:Ot,onSuperPrev:qe,onSuperNext:Oe}),je,"-",ht)}var yr=er,cn=3,ri=4;function pr(J){var ue=tr-1,Ce=J.prefixCls,Te=J.viewDate,qe=J.generateConfig,Oe=J.disabledDate,Ve="".concat(Ce,"-cell"),et=qe.getYear(Te),Ot=Math.floor(et/tr)*tr,Et=Math.floor(et/nr)*nr,je=Et+nr-1,ht=qe.setYear(Te,Et-Math.ceil((cn*ri*tr-nr)/2)),it=function(bt){var Lt,ct=Oe&&Oe(bt),Gt=qe.getYear(bt),on=Gt+ue;return Lt={},Object(A.a)(Lt,"".concat(Ve,"-disabled"),ct),Object(A.a)(Lt,"".concat(Ve,"-in-view"),Et<=Gt&&on<=je),Object(A.a)(Lt,"".concat(Ve,"-selected"),Gt===Ot),Lt};return P.createElement(Ge,Object.assign({},J,{rowNum:ri,colNum:cn,baseDate:ht,getCellText:function(bt){var Lt=qe.getYear(bt);return"".concat(Lt,"-").concat(Lt+ue)},getCellClassName:it,getCellDate:function(bt,Lt){return qe.addYear(bt,Lt*tr)}}))}var Cr=pr,tr=10,nr=tr*10;function X(J){var ue=J.prefixCls,Ce=J.onViewDateChange,Te=J.generateConfig,qe=J.viewDate,Oe=J.operationRef,Ve=J.onSelect,et=J.onPanelChange,Ot="".concat(ue,"-decade-panel");Oe.current={onKeyDown:function(it){return _(it,{onLeftRight:function(bt){Ve(Te.addYear(qe,bt*tr),"key")},onCtrlLeftRight:function(bt){Ve(Te.addYear(qe,bt*nr),"key")},onUpDown:function(bt){Ve(Te.addYear(qe,bt*tr*cn),"key")},onEnter:function(){et("year",qe)}})}};var Et=function(it){var st=Te.addYear(qe,it*nr);Ce(st),et(null,st)},je=function(it){Ve(it,"mouse"),et("year",it)};return P.createElement("div",{className:Ot},P.createElement(yr,Object.assign({},J,{prefixCls:ue,onPrevDecades:function(){Et(-1)},onNextDecades:function(){Et(1)}})),P.createElement(Cr,Object.assign({},J,{prefixCls:ue,onSelect:je})))}var S=X;function L(J,ue,Ce){return Ce?P.createElement("div",{className:"".concat(J,"-footer-extra")},Ce(ue)):null}function W(J){var ue=J.prefixCls,Ce=J.rangeList,Te=Ce===void 0?[]:Ce,qe=J.components,Oe=qe===void 0?{}:qe,Ve=J.needConfirmButton,et=J.onNow,Ot=J.onOk,Et=J.okDisabled,je=J.showNow,ht=J.locale,it,st;if(Te.length){var bt=Oe.rangeItem||"span";it=P.createElement(P.Fragment,null,Te.map(function(ct){var Gt=ct.label,on=ct.onClick,Dn=ct.onMouseEnter,Kn=ct.onMouseLeave;return P.createElement("li",{key:Gt,className:"".concat(ue,"-preset")},P.createElement(bt,{onClick:on,onMouseEnter:Dn,onMouseLeave:Kn},Gt))}))}if(Ve){var Lt=Oe.button||"button";et&&!it&&je!==!1&&(it=P.createElement("li",{className:"".concat(ue,"-now")},P.createElement("a",{className:"".concat(ue,"-now-btn"),onClick:et},ht.now))),st=Ve&&P.createElement("li",{className:"".concat(ue,"-ok")},P.createElement(Lt,{disabled:Et,onClick:Ot},ht.ok))}return!it&&!st?null:P.createElement("ul",{className:"".concat(ue,"-ranges")},it,st)}function ne(J){var ue,Ce=J.prefixCls,Te=Ce===void 0?"rc-picker":Ce,qe=J.className,Oe=J.style,Ve=J.locale,et=J.generateConfig,Ot=J.value,Et=J.defaultValue,je=J.pickerValue,ht=J.defaultPickerValue,it=J.disabledDate,st=J.mode,bt=J.picker,Lt=bt===void 0?"date":bt,ct=J.tabIndex,Gt=ct===void 0?0:ct,on=J.showNow,Dn=J.showTime,Kn=J.showToday,wn=J.renderExtraFooter,Nn=J.hideHeader,Pn=J.onSelect,Dt=J.onChange,sn=J.onPanelChange,Ft=J.onMouseDown,St=J.onPickerValueChange,Un=J.onOk,Sn=J.components,zt=J.direction,lt=J.hourStep,jn=lt===void 0?1:lt,ln=J.minuteStep,Jn=ln===void 0?1:ln,$t=J.secondStep,On=$t===void 0?1:$t,Fn=Lt==="date"&&!!Dn||Lt==="time",hn=24%jn===0,yi=60%Jn===0,Rn=60%On===0,bn=P.useContext(r),Rt=bn.operationRef,Xe=bn.panelRef,kt=bn.onSelect,Pt=bn.hideRanges,an=bn.defaultOpenValue,zn=P.useContext(pt),Ln=zn.inRange,oi=zn.panelPosition,ei=zn.rangedValue,Oi=zn.hoverRangedValue,mi=P.useRef({}),bi=P.useRef(!0),Ji=Object(m.a)(null,{value:Ot,defaultValue:Et,postState:function(Ht){return!Ht&&an&&Lt==="time"?an:Ht}}),Vi=Object(H.a)(Ji,2),$i=Vi[0],gr=Vi[1],vr=Object(m.a)(null,{value:je,defaultValue:ht||$i,postState:function(Ht){return Ht||et.getNow()}}),ye=Object(H.a)(vr,2),Me=ye[0],We=ye[1],we=function(Ht){We(Ht),St&&St(Ht)},ie=function(Ht){var Wt=G[Lt];return Wt?Wt(Ht):Ht},fe=Object(m.a)(function(){return Lt==="time"?"time":ie("date")},{value:st}),le=Object(H.a)(fe,2),Se=le[0],De=le[1];P.useEffect(function(){De(Lt)},[Lt]);var $e=P.useState(function(){return Se}),Le=Object(H.a)($e,2),at=Le[0],It=Le[1],qt=function(Ht,Wt){var pi=ie(Ht||Se);It(Se),De(pi),sn&&(Se!==pi||tt(et,Me,Me))&&sn(Wt,pi)},un=function(Ht,Wt){var pi=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;(Se===Lt||pi)&&(gr(Ht),Pn&&Pn(Ht),kt&&kt(Ht,Wt),Dt&&!tt(et,Ht,$i)&&Dt(Ht))},Hn=function(Ht){return mi.current&&mi.current.onKeyDown?([d.a.LEFT,d.a.RIGHT,d.a.UP,d.a.DOWN,d.a.PAGE_UP,d.a.PAGE_DOWN,d.a.ENTER].includes(Ht.which)&&Ht.preventDefault(),mi.current.onKeyDown(Ht)):(Object(b.a)(!1,"Panel not correct handle keyDown event. Please help to fire issue about this."),!1)},Gn=function(Ht){mi.current&&mi.current.onBlur&&mi.current.onBlur(Ht)};Rt&&oi!=="right"&&(Rt.current={onKeyDown:Hn,onClose:function(){mi.current&&mi.current.onClose&&mi.current.onClose()}}),P.useEffect(function(){Ot&&!bi.current&&We(Ot)},[Ot]),P.useEffect(function(){bi.current=!1},[]);var di,li=Object(M.a)(Object(M.a)({},J),{},{operationRef:mi,prefixCls:Te,viewDate:Me,value:$i,onViewDateChange:we,sourceMode:at,onPanelChange:qt,disabledDate:Se!=="decade"?it:void 0});delete li.onChange,delete li.onSelect;switch(Se){case"decade":di=P.createElement(S,Object.assign({},li,{onSelect:function(Ht,Wt){we(Ht),un(Ht,Wt)}}));break;case"year":di=P.createElement(ji,Object.assign({},li,{onSelect:function(Ht,Wt){we(Ht),un(Ht,Wt)}}));break;case"month":di=P.createElement(At,Object.assign({},li,{onSelect:function(Ht,Wt){we(Ht),un(Ht,Wt)}}));break;case"quarter":di=P.createElement(vn,Object.assign({},li,{onSelect:function(Ht,Wt){we(Ht),un(Ht,Wt)}}));break;case"week":di=P.createElement(En,Object.assign({},li,{onSelect:function(Ht,Wt){we(Ht),un(Ht,Wt)}}));break;case"time":delete li.showTime,di=P.createElement(ze,Object.assign({},li,Object(f.a)(Dn)==="object"?Dn:null,{onSelect:function(Ht,Wt){we(Ht),un(Ht,Wt)}}));break;default:Dn?di=P.createElement(Tt,Object.assign({},li,{onSelect:function(Ht,Wt){we(Ht),un(Ht,Wt)}})):di=P.createElement(he,Object.assign({},li,{onSelect:function(Ht,Wt){we(Ht),un(Ht,Wt)}}))}var Ei,Ri,gi=function(){var Ht=et.getNow(),Wt=Ke(et.getHour(Ht),et.getMinute(Ht),et.getSecond(Ht),hn?jn:1,yi?Jn:1,Rn?On:1),pi=Je(et,Ht,Wt[0],Wt[1],Wt[2]);un(pi,"submit")};Pt||(Ei=L(Te,Se,wn),Ri=W({prefixCls:Te,components:Sn,needConfirmButton:Fn,okDisabled:!$i||it&&it($i),locale:Ve,showNow:on,onNow:Fn&&gi,onOk:function(){$i&&(un($i,"submit",!0),Un&&Un($i))}}));var xi;if(Kn&&Se==="date"&&Lt==="date"&&!Dn){var Di=et.getNow(),dn="".concat(Te,"-today-btn"),Zt=it&&it(Di);xi=P.createElement("a",{className:D()(dn,Zt&&"".concat(dn,"-disabled")),"aria-disabled":Zt,onClick:function(){Zt||un(Di,"mouse",!0)}},Ve.today)}return P.createElement(r.Provider,{value:Object(M.a)(Object(M.a)({},bn),{},{hideHeader:"hideHeader"in J?Nn:bn.hideHeader,hidePrevBtn:Ln&&oi==="right",hideNextBtn:Ln&&oi==="left"})},P.createElement("div",{tabIndex:Gt,className:D()("".concat(Te,"-panel"),qe,(ue={},Object(A.a)(ue,"".concat(Te,"-panel-has-range"),ei&&ei[0]&&ei[1]),Object(A.a)(ue,"".concat(Te,"-panel-has-range-hover"),Oi&&Oi[0]&&Oi[1]),Object(A.a)(ue,"".concat(Te,"-panel-rtl"),zt==="rtl"),ue)),style:Oe,onKeyDown:Hn,onBlur:Gn,onMouseDown:Ft,ref:Xe},di,Ei||Ri||xi?P.createElement("div",{className:"".concat(Te,"-footer")},Ei,Ri,xi):null))}var Q=ne,ke=I("uciX"),Vt={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 kn(J){var ue,Ce=J.prefixCls,Te=J.popupElement,qe=J.popupStyle,Oe=J.visible,Ve=J.dropdownClassName,et=J.dropdownAlign,Ot=J.transitionName,Et=J.getPopupContainer,je=J.children,ht=J.range,it=J.popupPlacement,st=J.direction,bt="".concat(Ce,"-dropdown"),Lt=function(){return it!==void 0?it:st==="rtl"?"bottomRight":"bottomLeft"};return P.createElement(ke.a,{showAction:[],hideAction:[],popupPlacement:Lt(),builtinPlacements:Vt,prefixCls:bt,popupTransitionName:Ot,popup:Te,popupAlign:et,popupVisible:Oe,popupClassName:D()(Ve,(ue={},Object(A.a)(ue,"".concat(bt,"-range"),ht),Object(A.a)(ue,"".concat(bt,"-rtl"),st==="rtl"),ue)),popupStyle:qe,getPopupContainer:Et},je)}var Qn=kn;function nn(J){var ue=J.open,Ce=J.value,Te=J.isClickOutside,qe=J.triggerOpen,Oe=J.forwardKeyDown,Ve=J.blurToCancel,et=J.onSubmit,Ot=J.onCancel,Et=J.onFocus,je=J.onBlur,ht=Object(P.useState)(!1),it=Object(H.a)(ht,2),st=it[0],bt=it[1],Lt=Object(P.useState)(!1),ct=Object(H.a)(Lt,2),Gt=ct[0],on=ct[1],Dn=Object(P.useRef)(!1),Kn=Object(P.useRef)(!1),wn={onMouseDown:function(){bt(!0),qe(!0)},onKeyDown:function(Pn){switch(Pn.which){case d.a.ENTER:{ue?et()!==!1&&bt(!0):qe(!0),Pn.preventDefault();return}case d.a.TAB:{st&&ue&&!Pn.shiftKey?(bt(!1),Pn.preventDefault()):!st&&ue&&(!Oe(Pn)&&Pn.shiftKey&&(bt(!0),Pn.preventDefault()));return}case d.a.ESC:{bt(!0),Ot();return}}!ue&&![d.a.SHIFT].includes(Pn.which)?qe(!0):st||Oe(Pn)},onFocus:function(Pn){bt(!0),on(!0),Et&&Et(Pn)},onBlur:function(Pn){if(Dn.current||!Te(document.activeElement)){Dn.current=!1;return}Ve?setTimeout(function(){Te(document.activeElement)&&Ot()},0):ue&&(qe(!1),Kn.current&&et()),on(!1),je&&je(Pn)}};return Object(P.useEffect)(function(){Kn.current=!1},[ue]),Object(P.useEffect)(function(){Kn.current=!0},[Ce]),Object(P.useEffect)(function(){return p(function(Nn){var Pn=Nn.target;ue&&(Te(Pn)?Gt||qe(!1):(Dn.current=!0,requestAnimationFrame(function(){Dn.current=!1})))})}),[wn,{focused:Gt,typing:st}]}function ti(J){var ue=J.valueTexts,Ce=J.onTextChange,Te=P.useState(""),qe=Object(H.a)(Te,2),Oe=qe[0],Ve=qe[1],et=P.useRef([]);et.current=ue;function Ot(je){Ve(je),Ce(je)}function Et(){Ve(et.current[0])}return P.useEffect(function(){ue.every(function(je){return je!==Oe})&&Et()},[ue.join("||")]),[Oe,Ot,Et]}var qn=I("Gytx"),Li=I.n(qn);function lr(J,ue){var Ce=ue.formatList,Te=ue.generateConfig,qe=ue.locale;return Object(w.a)(function(){if(!J)return[[""],""];for(var Oe="",Ve=[],et=0;et<Ce.length;et+=1){var Ot=Ce[et],Et=Te.locale.format(qe.locale,J,Ot);Ve.push(Et),et===0&&(Oe=Et)}return[Ve,Oe]},[J,Ce],function(Oe,Ve){return Oe[0]!==Ve[0]||!Li()(Oe[1],Ve[1])})}function ar(J,ue){var Ce=ue.formatList,Te=ue.generateConfig,qe=ue.locale,Oe=Object(P.useState)(null),Ve=Object(H.a)(Oe,2),et=Ve[0],Ot=Ve[1],Et=Object(P.useRef)(null);function je(ct){var Gt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(cancelAnimationFrame(Et.current),Gt){Ot(ct);return}Et.current=requestAnimationFrame(function(){Ot(ct)})}var ht=lr(et,{formatList:Ce,generateConfig:Te,locale:qe}),it=Object(H.a)(ht,2),st=it[1];function bt(ct){je(ct)}function Lt(){var ct=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;je(null,ct)}return Object(P.useEffect)(function(){Lt(!0)},[J]),Object(P.useEffect)(function(){return function(){return cancelAnimationFrame(Et.current)}},[]),[st,bt,Lt]}function Ki(J){var ue,Ce=J.prefixCls,Te=Ce===void 0?"rc-picker":Ce,qe=J.id,Oe=J.tabIndex,Ve=J.style,et=J.className,Ot=J.dropdownClassName,Et=J.dropdownAlign,je=J.popupStyle,ht=J.transitionName,it=J.generateConfig,st=J.locale,bt=J.inputReadOnly,Lt=J.allowClear,ct=J.autoFocus,Gt=J.showTime,on=J.picker,Dn=on===void 0?"date":on,Kn=J.format,wn=J.use12Hours,Nn=J.value,Pn=J.defaultValue,Dt=J.open,sn=J.defaultOpen,Ft=J.defaultOpenValue,St=J.suffixIcon,Un=J.clearIcon,Sn=J.disabled,zt=J.disabledDate,lt=J.placeholder,jn=J.getPopupContainer,ln=J.pickerRef,Jn=J.panelRender,$t=J.onChange,On=J.onOpenChange,Fn=J.onFocus,hn=J.onBlur,yi=J.onMouseDown,Rn=J.onMouseUp,bn=J.onMouseEnter,Rt=J.onMouseLeave,Xe=J.onContextMenu,kt=J.onClick,Pt=J.direction,an=J.autoComplete,zn=an===void 0?"off":an,Ln=P.useRef(null),oi=Dn==="date"&&!!Gt||Dn==="time",ei=pe(y(Kn,Dn,Gt,wn)),Oi=P.useRef(null),mi=P.useRef(null),bi=Object(m.a)(null,{value:Nn,defaultValue:Pn}),Ji=Object(H.a)(bi,2),Vi=Ji[0],$i=Ji[1],gr=P.useState(Vi),vr=Object(H.a)(gr,2),ye=vr[0],Me=vr[1],We=P.useRef(null),we=Object(m.a)(!1,{value:Dt,defaultValue:sn,postState:function(vi){return Sn?!1:vi},onChange:function(vi){On&&On(vi),!vi&&We.current&&We.current.onClose&&We.current.onClose()}}),ie=Object(H.a)(we,2),fe=ie[0],le=ie[1],Se=lr(ye,{formatList:ei,generateConfig:it,locale:st}),De=Object(H.a)(Se,2),$e=De[0],Le=De[1],at=ti({valueTexts:$e,onTextChange:function(vi){var _r=it.locale.parse(st.locale,vi,ei);_r&&(!zt||!zt(_r))&&Me(_r)}}),It=Object(H.a)(at,3),qt=It[0],un=It[1],Hn=It[2],Gn=function(vi){Me(vi),$i(vi),$t&&!tt(it,Vi,vi)&&$t(vi,vi?it.locale.format(st.locale,vi,ei[0]):"")},di=function(vi){if(Sn&&vi)return;le(vi)},li=function(vi){return fe&&We.current&&We.current.onKeyDown?We.current.onKeyDown(vi):(Object(b.a)(!1,"Picker not correct forward KeyDown operation. Please help to fire issue about this."),!1)},Ei=function(){Rn&&Rn.apply(void 0,arguments),Ln.current&&(Ln.current.focus(),di(!0))},Ri=nn({blurToCancel:oi,open:fe,value:qt,triggerOpen:di,forwardKeyDown:li,isClickOutside:function(vi){return!B([Oi.current,mi.current],vi)},onSubmit:function(){return zt&&zt(ye)?!1:(Gn(ye),di(!1),Hn(),!0)},onCancel:function(){di(!1),Me(Vi),Hn()},onFocus:Fn,onBlur:hn}),gi=Object(H.a)(Ri,2),xi=gi[0],Di=gi[1],dn=Di.focused,Zt=Di.typing;P.useEffect(function(){fe||(Me(Vi),!$e.length||$e[0]===""?un(""):Le!==qt&&Hn())},[fe,$e]),P.useEffect(function(){fe||Hn()},[Dn]),P.useEffect(function(){Me(Vi)},[Vi]),ln&&(ln.current={focus:function(){Ln.current&&Ln.current.focus()},blur:function(){Ln.current&&Ln.current.blur()}});var yn=Object(M.a)(Object(M.a)({},J),{},{className:void 0,style:void 0,pickerValue:void 0,onPickerValueChange:void 0}),Ht=P.createElement(Q,Object.assign({},yn,{generateConfig:it,className:D()(Object(A.a)({},"".concat(Te,"-panel-focused"),!Zt)),value:ye,locale:st,tabIndex:-1,onChange:Me,direction:Pt}));Jn&&(Ht=Jn(Ht));var Wt=P.createElement("div",{className:"".concat(Te,"-panel-container"),onMouseDown:function(vi){vi.preventDefault()}},Ht),pi;St&&(pi=P.createElement("span",{className:"".concat(Te,"-suffix")},St));var Pi;Lt&&Vi&&!Sn&&(Pi=P.createElement("span",{onMouseDown:function(vi){vi.preventDefault(),vi.stopPropagation()},onMouseUp:function(vi){vi.preventDefault(),vi.stopPropagation(),Gn(null),di(!1)},className:"".concat(Te,"-clear")},Un||P.createElement("span",{className:"".concat(Te,"-clear-btn")})));var ni=function(vi,_r){(_r==="submit"||_r!=="key"&&!oi)&&(Gn(vi),di(!1))},Ii=Pt==="rtl"?"bottomRight":"bottomLeft",or=ar(qt,{formatList:ei,generateConfig:it,locale:st}),Ni=Object(H.a)(or,3),Yi=Ni[0],zi=Ni[1],Hi=Ni[2];return P.createElement(r.Provider,{value:{operationRef:We,hideHeader:Dn==="time",panelRef:Oi,onSelect:ni,open:fe,defaultOpenValue:Ft,onDateMouseEnter:zi,onDateMouseLeave:Hi}},P.createElement(Qn,{visible:fe,popupElement:Wt,popupStyle:je,prefixCls:Te,dropdownClassName:Ot,dropdownAlign:Et,getPopupContainer:jn,transitionName:ht,popupPlacement:Ii,direction:Pt},P.createElement("div",{className:D()(Te,et,(ue={},Object(A.a)(ue,"".concat(Te,"-disabled"),Sn),Object(A.a)(ue,"".concat(Te,"-focused"),dn),Object(A.a)(ue,"".concat(Te,"-rtl"),Pt==="rtl"),ue)),style:Ve,onMouseDown:yi,onMouseUp:Ei,onMouseEnter:bn,onMouseLeave:Rt,onContextMenu:Xe,onClick:kt},P.createElement("div",{className:D()("".concat(Te,"-input"),Object(A.a)({},"".concat(Te,"-input-placeholder"),!!Yi)),ref:mi},P.createElement("input",Object.assign({id:qe,tabIndex:Oe,disabled:Sn,readOnly:bt||!Zt,value:Yi||qt,onChange:function(vi){un(vi.target.value)},autoFocus:ct,placeholder:lt,ref:Ln,title:qt},xi,{size:h(Dn,ei[0])},Ye(J),{autoComplete:zn})),pi,Pi))))}var Pr=function(J){Object(N.a)(Ce,J);var ue=Object(K.a)(Ce);function Ce(){var Te;return Object(te.a)(this,Ce),Te=ue.apply(this,arguments),Te.pickerRef=P.createRef(),Te.focus=function(){Te.pickerRef.current&&Te.pickerRef.current.focus()},Te.blur=function(){Te.pickerRef.current&&Te.pickerRef.current.blur()},Te}return Object(Y.a)(Ce,[{key:"render",value:function(){return P.createElement(Ki,Object.assign({},this.props,{pickerRef:this.pickerRef}))}}]),Ce}(P.Component),Vr=Pr;function Ai(J,ue,Ce){var Te=J.picker,qe=J.locale,Oe=J.selectedValue,Ve=J.disabledDate,et=J.disabled,Ot=J.generateConfig,Et=xe(Oe,0),je=xe(Oe,1);function ht(ct){var Gt=Ot.getYear(ct),on=Ot.locale.getWeek(qe.locale,ct);return Gt*100+on}function it(ct){var Gt=Ot.getYear(ct),on=Ot.getMonth(ct);return Gt*100+on}function st(ct){var Gt=Ot.getYear(ct),on=Bt(Ot,ct);return Gt*10+on}var bt=P.useCallback(function(ct){if(Ve&&Ve(ct))return!0;if(et[1]&&je)return!An(Ot,ct,je)&&Ot.isAfter(ct,je);if(ue&&je)switch(Te){case"quarter":return st(ct)>st(je);case"month":return it(ct)>it(je);case"week":return ht(ct)>ht(je);default:return!An(Ot,ct,je)&&Ot.isAfter(ct,je)}return!1},[Ve,et[1],je,ue]),Lt=P.useCallback(function(ct){if(Ve&&Ve(ct))return!0;if(et[0]&&Et)return!An(Ot,ct,je)&&Ot.isAfter(Et,ct);if(Ce&&Et)switch(Te){case"quarter":return st(ct)<st(Et);case"month":return it(ct)<it(Et);case"week":return ht(ct)<ht(Et);default:return!An(Ot,ct,Et)&&Ot.isAfter(Et,ct)}return!1},[Ve,et[0],Et,Ce]);return[bt,Lt]}function wi(J,ue,Ce,Te){var qe=He(J,Ce,Te,1);function Oe(Ve){return Ve(J,ue)?"same":Ve(qe,ue)?"closing":"far"}switch(Ce){case"year":return Oe(function(Ve,et){return Nt(Te,Ve,et)});case"quarter":case"month":return Oe(function(Ve,et){return Ze(Te,Ve,et)});default:return Oe(function(Ve,et){return Mt(Te,Ve,et)})}}function ir(J,ue,Ce,Te){var qe=xe(J,0),Oe=xe(J,1);if(ue===0)return qe;if(qe&&Oe){var Ve=wi(qe,Oe,Ce,Te);switch(Ve){case"same":return qe;case"closing":return qe;default:return He(Oe,Ce,Te,-1)}}return qe}function Fi(J){var ue=J.values,Ce=J.picker,Te=J.defaultDates,qe=J.generateConfig,Oe=P.useState(function(){return[xe(Te,0),xe(Te,1)]}),Ve=Object(H.a)(Oe,2),et=Ve[0],Ot=Ve[1],Et=P.useState(null),je=Object(H.a)(Et,2),ht=je[0],it=je[1],st=xe(ue,0),bt=xe(ue,1);function Lt(Gt){return et[Gt]?et[Gt]:xe(ht,Gt)||ir(ue,Gt,Ce,qe)||st||bt||qe.getNow()}function ct(Gt,on){if(Gt){var Dn=Ie(ht,Gt,on);Ot(Ie(et,null,on)||[null,null]);var Kn=(on+1)%2;xe(ue,Kn)||(Dn=Ie(Dn,Gt,Kn)),it(Dn)}else(st||bt)&&it(null)}return[Lt,ct]}function Bn(J,ue){return J&&J[0]&&J[1]&&ue.isAfter(J[0],J[1])?[J[1],J[0]]:J}function gn(J,ue,Ce,Te){return J||Te&&Te[ue]?!0:!!Ce[(ue+1)%2]}function Tn(J){var ue,Ce,Te,qe=J.prefixCls,Oe=qe===void 0?"rc-picker":qe,Ve=J.id,et=J.style,Ot=J.className,Et=J.popupStyle,je=J.dropdownClassName,ht=J.transitionName,it=J.dropdownAlign,st=J.getPopupContainer,bt=J.generateConfig,Lt=J.locale,ct=J.placeholder,Gt=J.autoFocus,on=J.disabled,Dn=J.format,Kn=J.picker,wn=Kn===void 0?"date":Kn,Nn=J.showTime,Pn=J.use12Hours,Dt=J.separator,sn=Dt===void 0?"~":Dt,Ft=J.value,St=J.defaultValue,Un=J.defaultPickerValue,Sn=J.open,zt=J.defaultOpen,lt=J.disabledDate,jn=J.disabledTime,ln=J.dateRender,Jn=J.panelRender,$t=J.ranges,On=J.allowEmpty,Fn=J.allowClear,hn=J.suffixIcon,yi=J.clearIcon,Rn=J.pickerRef,bn=J.inputReadOnly,Rt=J.mode,Xe=J.renderExtraFooter,kt=J.onChange,Pt=J.onOpenChange,an=J.onPanelChange,zn=J.onCalendarChange,Ln=J.onFocus,oi=J.onBlur,ei=J.onOk,Oi=J.components,mi=J.order,bi=J.direction,Ji=J.activePickerIndex,Vi=J.autoComplete,$i=Vi===void 0?"off":Vi,gr=wn==="date"&&!!Nn||wn==="time",vr=Object(P.useRef)({}),ye=Object(P.useRef)(null),Me=Object(P.useRef)(null),We=Object(P.useRef)(null),we=Object(P.useRef)(null),ie=Object(P.useRef)(null),fe=Object(P.useRef)(null),le=Object(P.useRef)(null),Se=pe(y(Dn,wn,Nn,Pn)),De=Object(m.a)(0,{value:Ji}),$e=Object(H.a)(De,2),Le=$e[0],at=$e[1],It=Object(P.useRef)(null),qt=P.useMemo(function(){return Array.isArray(on)?on:[on||!1,on||!1]},[on]),un=Object(m.a)(null,{value:Ft,defaultValue:St,postState:function(Xn){return wn==="time"&&!mi?Xn:Bn(Xn,bt)}}),Hn=Object(H.a)(un,2),Gn=Hn[0],di=Hn[1],li=Fi({values:Gn,picker:wn,defaultDates:Un,generateConfig:bt}),Ei=Object(H.a)(li,2),Ri=Ei[0],gi=Ei[1],xi=Object(m.a)(Gn,{postState:function(Xn){var ui=Xn;if(qt[0]&&qt[1])return ui;for(var Mi=0;Mi<2;Mi+=1)qt[Mi]&&!xe(ui,Mi)&&!xe(On,Mi)&&(ui=Ie(ui,bt.getNow(),Mi));return ui}}),Di=Object(H.a)(xi,2),dn=Di[0],Zt=Di[1],yn=Object(m.a)([wn,wn],{value:Rt}),Ht=Object(H.a)(yn,2),Wt=Ht[0],pi=Ht[1];Object(P.useEffect)(function(){pi([wn,wn])},[wn]);var Pi=function(Xn,ui){pi(Xn),an&&an(ui,Xn)},ni=Ai({picker:wn,selectedValue:dn,locale:Lt,disabled:qt,disabledDate:lt,generateConfig:bt},vr.current[1],vr.current[0]),Ii=Object(H.a)(ni,2),or=Ii[0],Ni=Ii[1],Yi=Object(m.a)(!1,{value:Sn,defaultValue:zt,postState:function(Xn){return qt[Le]?!1:Xn},onChange:function(Xn){Pt&&Pt(Xn),!Xn&&It.current&&It.current.onClose&&It.current.onClose()}}),zi=Object(H.a)(Yi,2),Hi=zi[0],Bi=zi[1],vi=Hi&&Le===0,_r=Hi&&Le===1,Jr=Object(P.useState)(0),jr=Object(H.a)(Jr,2),Rr=jr[0],ur=jr[1];Object(P.useEffect)(function(){!Hi&&ye.current&&ur(ye.current.offsetWidth)},[Hi]);var Zi=P.useRef();function rr(Si,Xn){if(Si)clearTimeout(Zi.current),vr.current[Xn]=!0,at(Xn),Bi(Si),Hi||gi(null,Xn);else if(Le===Xn){Bi(Si);var ui=vr.current;Zi.current=setTimeout(function(){ui===vr.current&&(vr.current={})})}}function dr(Si){rr(!0,Si),setTimeout(function(){var Xn=[fe,le][Si];Xn.current&&Xn.current.focus()},0)}function Fr(Si,Xn){var ui=Si,Mi=xe(ui,0),hr=xe(ui,1);Mi&&hr&&bt.isAfter(Mi,hr)&&(wn==="week"&&!pn(bt,Lt.locale,Mi,hr)||wn==="quarter"&&!Ut(bt,Mi,hr)||wn!=="week"&&wn!=="quarter"&&wn!=="time"&&!An(bt,Mi,hr)?(Xn===0?(ui=[Mi,null],hr=null):(Mi=null,ui=[null,hr]),vr.current=Object(A.a)({},Xn,!0)):(wn!=="time"||mi!==!1)&&(ui=Bn(ui,bt))),Zt(ui);var ga=ui&&ui[0]?bt.locale.format(Lt.locale,ui[0],Se[0]):"",aa=ui&&ui[1]?bt.locale.format(Lt.locale,ui[1],Se[0]):"";if(zn){var Mr={range:Xn===0?"start":"end"};zn(ui,[ga,aa],Mr)}var $r=gn(Mi,0,qt,On),va=gn(hr,1,qt,On),Wa=ui===null||$r&&va;Wa&&(di(ui),kt&&(!tt(bt,xe(Gn,0),Mi)||!tt(bt,xe(Gn,1),hr))&&kt(ui,[ga,aa]));var Ar=null;Xn===0&&!qt[1]?Ar=1:Xn===1&&!qt[0]&&(Ar=0),Ar!==null&&Ar!==Le&&(!vr.current[Ar]||!xe(ui,Ar))&&xe(ui,Xn)?dr(Ar):rr(!1,Xn)}var ha=function(Xn){return Hi&&It.current&&It.current.onKeyDown?It.current.onKeyDown(Xn):(Object(b.a)(!1,"Picker not correct forward KeyDown operation. Please help to fire issue about this."),!1)},sa={formatList:Se,generateConfig:bt,locale:Lt},qi=lr(xe(dn,0),sa),Zr=Object(H.a)(qi,2),qr=Zr[0],sr=Zr[1],Qi=lr(xe(dn,1),sa),wr=Object(H.a)(Qi,2),Ma=wr[0],no=wr[1],la=function(Xn,ui){var Mi=bt.locale.parse(Lt.locale,Xn,Se),hr=ui===0?or:Ni;Mi&&!hr(Mi)&&(Zt(Ie(dn,Mi,ui)),gi(Mi,ui))},Ta=ti({valueTexts:qr,onTextChange:function(Xn){return la(Xn,0)}}),wa=Object(H.a)(Ta,3),Sa=wa[0],ka=wa[1],co=wa[2],Ro=ti({valueTexts:Ma,onTextChange:function(Xn){return la(Xn,1)}}),Ga=Object(H.a)(Ro,3),Oa=Ga[0],Va=Ga[1],_a=Ga[2],Ra=Object(P.useState)(null),ho=Object(H.a)(Ra,2),Ya=ho[0],Aa=ho[1],Da=Object(P.useState)(null),ya=Object(H.a)(Da,2),Nr=ya[0],fa=ya[1],pa=ar(Sa,{formatList:Se,generateConfig:bt,locale:Lt}),ba=Object(H.a)(pa,3),ma=ba[0],Xa=ba[1],$a=ba[2],Qa=ar(Oa,{formatList:Se,generateConfig:bt,locale:Lt}),Ia=Object(H.a)(Qa,3),ua=Ia[0],Ea=Ia[1],io=Ia[2],Ao=function(Xn){fa(Ie(dn,Xn,Le)),Le===0?Xa(Xn):Ea(Xn)},Do=function(){fa(Ie(dn,null,Le)),Le===0?$a():io()},fo=function(Xn,ui){return{blurToCancel:gr,forwardKeyDown:ha,onBlur:oi,isClickOutside:function(hr){return!B([Me.current,We.current,we.current],hr)},onFocus:function(hr){at(Xn),Ln&&Ln(hr)},triggerOpen:function(hr){rr(hr,Xn)},onSubmit:function(){Fr(dn,Xn),ui()},onCancel:function(){rr(!1,Xn),Zt(Gn),ui()}}},ro=nn(Object(M.a)(Object(M.a)({},fo(0,co)),{},{open:vi,value:Sa})),po=Object(H.a)(ro,2),Kr=po[0],br=po[1],Lr=br.focused,Er=br.typing,Na=nn(Object(M.a)(Object(M.a)({},fo(1,_a)),{},{open:_r,value:Oa})),mo=Object(H.a)(Na,2),ea=mo[0],ao=mo[1],oo=ao.focused,so=ao.typing,xa=function(Xn){!Hi&&!fe.current.contains(Xn.target)&&!le.current.contains(Xn.target)&&(qt[0]?qt[1]||dr(1):dr(0))},Ja=function(Xn){Hi&&(Lr||oo)&&!fe.current.contains(Xn.target)&&!le.current.contains(Xn.target)&&Xn.preventDefault()},Ua=Gn&&Gn[0]?bt.locale.format(Lt.locale,Gn[0],"YYYYMMDDHHmmss"):"",go=Gn&&Gn[1]?bt.locale.format(Lt.locale,Gn[1],"YYYYMMDDHHmmss"):"";Object(P.useEffect)(function(){Hi||(Zt(Gn),!qr.length||qr[0]===""?ka(""):sr!==Sa&&co(),!Ma.length||Ma[0]===""?Va(""):no!==Oa&&_a())},[Hi,qr,Ma]),Object(P.useEffect)(function(){Zt(Gn)},[Ua,go]),Rn&&(Rn.current={focus:function(){fe.current&&fe.current.focus()},blur:function(){fe.current&&fe.current.blur(),le.current&&le.current.blur()}});var Za=Object.keys($t||{}),Xi=Za.map(function(Si){var Xn=$t[Si],ui=typeof Xn=="function"?Xn():Xn;return{label:Si,onClick:function(){Fr(ui,null),rr(!1,Le)},onMouseEnter:function(){Aa(ui)},onMouseLeave:function(){Aa(null)}}});function ki(){var Si=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Xn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ui=null;Hi&&Nr&&Nr[0]&&Nr[1]&&bt.isAfter(Nr[1],Nr[0])&&(ui=Nr);var Mi=Nn;if(Nn&&Object(f.a)(Nn)==="object"&&Nn.defaultValue){var hr=Nn.defaultValue;Mi=Object(M.a)(Object(M.a)({},Nn),{},{defaultValue:xe(hr,Le)||void 0})}var ga=null;return ln&&(ga=function(Mr,$r){return ln(Mr,$r,{range:Le?"end":"start"})}),P.createElement(pt.Provider,{value:{inRange:!0,panelPosition:Si,rangedValue:Ya||dn,hoverRangedValue:ui}},P.createElement(Q,Object.assign({},J,Xn,{dateRender:ga,showTime:Mi,mode:Wt[Le],generateConfig:bt,style:void 0,direction:bi,disabledDate:Le===0?or:Ni,disabledTime:function(Mr){return jn?jn(Mr,Le===0?"start":"end"):!1},className:D()(Object(A.a)({},"".concat(Oe,"-panel-focused"),Le===0?!Er:!so)),value:xe(dn,Le),locale:Lt,tabIndex:-1,onPanelChange:function(Mr,$r){Pi(Ie(Wt,$r,Le),Ie(dn,Mr,Le));var va=Mr;Si==="right"&&Wt[Le]===$r&&(va=He(va,$r,bt,-1)),gi(va,Le)},onOk:null,onSelect:void 0,onChange:void 0,defaultValue:void 0,defaultPickerValue:void 0})))}var mr=0,Br=0;Le&&We.current&&ie.current&&Me.current&&(mr=We.current.offsetWidth+ie.current.offsetWidth,Me.current.offsetWidth&&mr>Me.current.offsetWidth&&(Br=mr));var Pa=bi==="rtl"?{right:mr}:{left:mr};function da(){var Si,Xn=L(Oe,Wt[Le],Xe),ui=W({prefixCls:Oe,components:Oi,needConfirmButton:gr,okDisabled:!xe(dn,Le)||lt&<(dn[Le]),locale:Lt,rangeList:Xi,onOk:function(){xe(dn,Le)&&(Fr(dn,Le),ei&&ei(dn))}});if(wn!=="time"&&!Nn){var Mi=Ri(Le),hr=He(Mi,wn,bt),ga=Wt[Le],aa=ga===wn,Mr=ki(aa?"left":!1,{pickerValue:Mi,onPickerValueChange:function(Ar){gi(Ar,Le)}}),$r=ki("right",{pickerValue:hr,onPickerValueChange:function(Ar){gi(He(Ar,wn,bt,-1),Le)}});bi==="rtl"?Si=P.createElement(P.Fragment,null,$r,aa&&Mr):Si=P.createElement(P.Fragment,null,Mr,aa&&$r)}else Si=ki();var va=P.createElement(P.Fragment,null,P.createElement("div",{className:"".concat(Oe,"-panels")},Si),(Xn||ui)&&P.createElement("div",{className:"".concat(Oe,"-footer")},Xn,ui));return Jn&&(va=Jn(va)),P.createElement("div",{className:"".concat(Oe,"-panel-container"),style:{marginLeft:Br},ref:Me,onMouseDown:function(Ar){Ar.preventDefault()}},va)}var ja=P.createElement("div",{className:D()("".concat(Oe,"-range-wrapper"),"".concat(Oe,"-").concat(wn,"-range-wrapper")),style:{minWidth:Rr}},P.createElement("div",{className:"".concat(Oe,"-range-arrow"),style:Pa}),da()),ca;hn&&(ca=P.createElement("span",{className:"".concat(Oe,"-suffix")},hn));var Sr;Fn&&(xe(Gn,0)&&!qt[0]||xe(Gn,1)&&!qt[1])&&(Sr=P.createElement("span",{onMouseDown:function(Xn){Xn.preventDefault(),Xn.stopPropagation()},onMouseUp:function(Xn){Xn.preventDefault(),Xn.stopPropagation();var ui=Gn;qt[0]||(ui=Ie(ui,null,0)),qt[1]||(ui=Ie(ui,null,1)),Fr(ui,null),rr(!1,Le)},className:"".concat(Oe,"-clear")},yi||P.createElement("span",{className:"".concat(Oe,"-clear-btn")})));var Fa={size:h(wn,Se[0])},Ba=0,Ha=0;We.current&&we.current&&ie.current&&(Le===0?Ha=We.current.offsetWidth:(Ba=mr,Ha=we.current.offsetWidth));var zr=bi==="rtl"?{right:Ba}:{left:Ba},Gi=function(Xn,ui){var Mi=Ie(dn,Xn,Le);ui==="submit"||ui!=="key"&&!gr?(Fr(Mi,Le),Le===0?$a():io()):Zt(Mi)};return P.createElement(r.Provider,{value:{operationRef:It,hideHeader:wn==="time",onDateMouseEnter:Ao,onDateMouseLeave:Do,hideRanges:!0,onSelect:Gi,open:Hi}},P.createElement(Qn,{visible:Hi,popupElement:ja,popupStyle:Et,prefixCls:Oe,dropdownClassName:je,dropdownAlign:it,getPopupContainer:st,transitionName:ht,range:!0,direction:bi},P.createElement("div",Object.assign({ref:ye,className:D()(Oe,"".concat(Oe,"-range"),Ot,(ue={},Object(A.a)(ue,"".concat(Oe,"-disabled"),qt[0]&&qt[1]),Object(A.a)(ue,"".concat(Oe,"-focused"),Le===0?Lr:oo),Object(A.a)(ue,"".concat(Oe,"-rtl"),bi==="rtl"),ue)),style:et,onClick:xa,onMouseDown:Ja},Ye(J)),P.createElement("div",{className:D()("".concat(Oe,"-input"),(Ce={},Object(A.a)(Ce,"".concat(Oe,"-input-active"),Le===0),Object(A.a)(Ce,"".concat(Oe,"-input-placeholder"),!!ma),Ce)),ref:We},P.createElement("input",Object.assign({id:Ve,disabled:qt[0],readOnly:bn||!Er,value:ma||Sa,onChange:function(Xn){ka(Xn.target.value)},autoFocus:Gt,placeholder:xe(ct,0)||"",ref:fe},Kr,Fa,{autoComplete:$i}))),P.createElement("div",{className:"".concat(Oe,"-range-separator"),ref:ie},sn),P.createElement("div",{className:D()("".concat(Oe,"-input"),(Te={},Object(A.a)(Te,"".concat(Oe,"-input-active"),Le===1),Object(A.a)(Te,"".concat(Oe,"-input-placeholder"),!!ua),Te)),ref:we},P.createElement("input",Object.assign({disabled:qt[1],readOnly:bn||!so,value:ua||Oa,onChange:function(Xn){Va(Xn.target.value)},placeholder:xe(ct,1)||"",ref:le},ea,Fa,{autoComplete:$i}))),P.createElement("div",{className:"".concat(Oe,"-active-bar"),style:Object(M.a)(Object(M.a)({},zr),{},{width:Ha,position:"absolute"})}),ca,Sr)))}var _n=function(J){Object(N.a)(Ce,J);var ue=Object(K.a)(Ce);function Ce(){var Te;return Object(te.a)(this,Ce),Te=ue.apply(this,arguments),Te.pickerRef=P.createRef(),Te.focus=function(){Te.pickerRef.current&&Te.pickerRef.current.focus()},Te.blur=function(){Te.pickerRef.current&&Te.pickerRef.current.blur()},Te}return Object(Y.a)(Ce,[{key:"render",value:function(){return P.createElement(Tn,Object.assign({},this.props,{pickerRef:this.pickerRef}))}}]),Ce}(P.Component),si=_n,ai=Qe.b=Vr},osHv:function(tn,Qe,I){(function(te){te(I("VrN/"))})(function(te){"use strict";var Y=te.Pos;function N(u,o){return u.line-o.line||u.ch-o.ch}var K="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",A=K+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",M=new RegExp("<(/?)(["+K+"]["+A+"]*)","g");function H(u,o,a,n){this.line=o,this.ch=a,this.cm=u,this.text=u.getLine(o),this.min=n?Math.max(n.from,u.firstLine()):u.firstLine(),this.max=n?Math.min(n.to-1,u.lastLine()):u.lastLine()}function P(u,o){var a=u.cm.getTokenTypeAt(Y(u.line,o));return a&&/\btag\b/.test(a)}function k(u){return u.line>=u.max?void 0:(u.ch=0,u.text=u.cm.getLine(++u.line),!0)}function D(u){return u.line<=u.min?void 0:(u.text=u.cm.getLine(--u.line),u.ch=u.text.length,!0)}function b(u){for(;;){var o=u.text.indexOf(">",u.ch);if(o==-1){if(k(u))continue;return}if(!P(u,o+1)){u.ch=o+1;continue}var a=u.text.lastIndexOf("/",o),n=a>-1&&!/\S/.test(u.text.slice(a+1,o));return u.ch=o+1,n?"selfClose":"regular"}}function m(u){for(;;){var o=u.ch?u.text.lastIndexOf("<",u.ch-1):-1;if(o==-1){if(D(u))continue;return}if(!P(u,o+1)){u.ch=o;continue}M.lastIndex=o,u.ch=o;var a=M.exec(u.text);if(a&&a.index==o)return a}}function f(u){for(;;){M.lastIndex=u.ch;var o=M.exec(u.text);if(!o){if(k(u))continue;return}if(!P(u,o.index+1)){u.ch=o.index+1;continue}return u.ch=o.index+o[0].length,o}}function d(u){for(;;){var o=u.ch?u.text.lastIndexOf(">",u.ch-1):-1;if(o==-1){if(D(u))continue;return}if(!P(u,o+1)){u.ch=o;continue}var a=u.text.lastIndexOf("/",o),n=a>-1&&!/\S/.test(u.text.slice(a+1,o));return u.ch=o+1,n?"selfClose":"regular"}}function s(u,o){for(var a=[];;){var n=f(u),R,w=u.line,x=u.ch-(n?n[0].length:0);if(!n||!(R=b(u)))return;if(R=="selfClose")continue;if(n[1]){for(var O=a.length-1;O>=0;--O)if(a[O]==n[2]){a.length=O;break}if(O<0&&(!o||o==n[2]))return{tag:n[2],from:Y(w,x),to:Y(u.line,u.ch)}}else a.push(n[2])}}function r(u,o){for(var a=[];;){var n=d(u);if(!n)return;if(n=="selfClose"){m(u);continue}var R=u.line,w=u.ch,x=m(u);if(!x)return;if(x[1])a.push(x[2]);else{for(var O=a.length-1;O>=0;--O)if(a[O]==x[2]){a.length=O;break}if(O<0&&(!o||o==x[2]))return{tag:x[2],from:Y(u.line,u.ch),to:Y(R,w)}}}}te.registerHelper("fold","xml",function(u,o){for(var a=new H(u,o.line,0);;){var n=f(a);if(!n||a.line!=o.line)return;var R=b(a);if(!R)return;if(!n[1]&&R!="selfClose"){var w=Y(a.line,a.ch),x=s(a,n[2]);return x&&N(x.from,w)>0?{from:w,to:x.from}:null}}}),te.findMatchingTag=function(u,o,a){var n=new H(u,o.line,o.ch,a);if(n.text.indexOf(">")==-1&&n.text.indexOf("<")==-1)return;var R=b(n),w=R&&Y(n.line,n.ch),x=R&&m(n);if(!R||!x||N(n,o)>0)return;var O={from:Y(n.line,n.ch),to:w,tag:x[2]};return R=="selfClose"?{open:O,close:null,at:"open"}:x[1]?{open:r(n,x[2]),close:O,at:"close"}:(n=new H(u,w.line,w.ch,a),{open:O,close:s(n,x[2]),at:"open"})},te.findEnclosingTag=function(u,o,a,n){for(var R=new H(u,o.line,o.ch,a);;){var w=r(R,n);if(!w)break;var x=new H(u,o.line,o.ch,a),O=s(x,w.tag);if(O)return{open:w,close:O}}},te.scanForClosingTag=function(u,o,a,n){var R=new H(u,o.line,o.ch,n?{from:0,to:n}:null);return s(R,a)}})},p5ED:function(tn,Qe,I){"use strict";var te=I("+L6B"),Y=I("2/Rp"),N=I("5Dmo"),K=I("3S7+"),A=I("k1fw"),M=I("tJVT"),H=I("q1tI"),P=I.n(H),k=I("vHTk"),D=I.n(k),b=I("yEEn"),m=I("ZW9T"),f=I("1vsH");Qe.a=function(d){var s=d.name,r=d.data,u=d.theme,o=d.type,a=d.filename,n=d.monacoEditor,R=d.className,w=d.style,x=d.close,O=d.onClose,C=d.hasMask,_=Object(H.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),y=Object(M.a)(_,2),h=y[0],c=y[1],v=Object(H.useState)(""),p=Object(M.a)(v,2),E=p[0],U=p[1],F,z=1024*1024,G=10*z,B=Object(H.useRef)();o==="office"&&(F=Object(f.T)(r).filesize,F>G&&(o="other")),a&&(n.filename=a),Object(H.useEffect)(function(){var Z,oe,pe=(Z=document.cookie)===null||Z===void 0||((oe=Z.replace(/\s/g,""))===null||oe===void 0)?void 0:oe.split(";");pe==null||pe.map(function(Ye){var xe=Ye.split("=");xe[0]==="_educoder_session"&&U(xe[1])})},[]);var T=function(){if(r.startsWith("http")||r.startsWith("/")){V();return}Object(f.z)(a||"educoder",r,a)},V=function(){Object(f.x)(a||s,r)};return console.log("data:",r,"fileanme:",a," name:",s),P.a.createElement("div",{style:Object(A.a)({},w||{}),className:"".concat(C&&D.a.bgBlack," ").concat(o?D.a.wrp:"hide")},x&&P.a.createElement("div",{className:D.a.close,ref:B},P.a.createElement(K.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return B.current}},P.a.createElement("span",{onClick:V},P.a.createElement("i",{className:"icon-quxiaozhiding"}))),P.a.createElement(K.a,{title:"\u5173\u95ED",getPopupContainer:function(){return B.current}},P.a.createElement("span",{className:"",onClick:O},P.a.createElement("i",{className:"icon-guanbi1"})))),P.a.createElement("div",{className:"".concat(D.a[R]," ").concat(R," ").concat(D.a.monaco," ").concat(o==="txt"?"show":"hide")},o==="txt"&&P.a.createElement(m.b,n)),o==="audio"&&P.a.createElement("audio",{src:"".concat(r!=null&&r.startsWith("/")||(r==null?void 0:r.indexOf("https://"))>-1?r:"data:audio/mp3;base64,").concat(r),autoPlay:!0}),o==="video"&&P.a.createElement(P.a.Fragment,null,r!=null&&r.startsWith("/")?P.a.createElement("video",{controls:!0,src:"".concat(r),autoPlay:!0}):P.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(r),autoPlay:!0})),o==="html"&&P.a.createElement("iframe",{src:r+"&disposition=inline"}),o==="pdf"&&P.a.createElement("embed",{className:D.a.embed,src:r}),o==="image"&&P.a.createElement(P.a.Fragment,null,P.a.createElement("img",{src:"".concat(r!=null&&r.startsWith("/")||(r==null?void 0:r.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(r)})),o==="other"&&P.a.createElement("div",null,P.a.createElement(Y.a,{type:"primary",size:"large",onClick:T},P.a.createElement(b.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(o==="download"||o==="office")&&P.a.createElement(Y.a,{type:"primary",size:"large",onClick:T},P.a.createElement(b.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(tn,Qe,I){},psGv:function(tn,Qe,I){var te,Y;(function(){var N;(function(){"use strict";var H=[,,function(b){function m(s){this.__parent=s,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 s=new m(this.__parent);return s.set_indent(this.__indent_count,this.__alignment_count),s},m.prototype.item=function(s){return s<0?this.__items[this.__items.length+s]:this.__items[s]},m.prototype.has_match=function(s){for(var r=this.__items.length-1;r>=0;r--)if(this.__items[r].match(s))return!0;return!1},m.prototype.set_indent=function(s,r){this.is_empty()&&(this.__indent_count=s||0,this.__alignment_count=r||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 s=this.__parent.current_line;return s.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),s.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),s.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,s.__items[0]===" "&&(s.__items.splice(0,1),s.__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(s){this.__items.push(s);var r=s.lastIndexOf(`
|
|
`);r!==-1?this.__character_count=s.length-r:this.__character_count+=s.length},m.prototype.pop=function(){var s=null;return this.is_empty()||(s=this.__items.pop(),this.__character_count-=s.length),s},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 s="";return this.is_empty()?this.__parent.indent_empty_lines&&(s=this.__parent.get_indent_string(this.__indent_count)):(s=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),s+=this.__items.join("")),s};function f(s,r){this.__cache=[""],this.__indent_size=s.indent_size,this.__indent_string=s.indent_char,s.indent_with_tabs||(this.__indent_string=new Array(s.indent_size+1).join(s.indent_char)),r=r||"",s.indent_level>0&&(r=new Array(s.indent_level+1).join(this.__indent_string)),this.__base_string=r,this.__base_string_length=r.length}f.prototype.get_indent_size=function(s,r){var u=this.__base_string_length;return r=r||0,s<0&&(u=0),u+=s*this.__indent_size,u+=r,u},f.prototype.get_indent_string=function(s,r){var u=this.__base_string;return r=r||0,s<0&&(s=0,u=""),r+=s*this.__indent_size,this.__ensure_cache(r),u+=this.__cache[r],u},f.prototype.__ensure_cache=function(s){for(;s>=this.__cache.length;)this.__add_column()},f.prototype.__add_column=function(){var s=this.__cache.length,r=0,u="";this.__indent_size&&s>=this.__indent_size&&(r=Math.floor(s/this.__indent_size),s-=r*this.__indent_size,u=new Array(r+1).join(this.__indent_string)),s&&(u+=new Array(s+1).join(" ")),this.__cache.push(u)};function d(s,r){this.__indent_cache=new f(s,r),this.raw=!1,this._end_with_newline=s.end_with_newline,this.indent_size=s.indent_size,this.wrap_line_length=s.wrap_line_length,this.indent_empty_lines=s.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()}d.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},d.prototype.get_line_number=function(){return this.__lines.length},d.prototype.get_indent_string=function(s,r){return this.__indent_cache.get_indent_string(s,r)},d.prototype.get_indent_size=function(s,r){return this.__indent_cache.get_indent_size(s,r)},d.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},d.prototype.add_new_line=function(s){return this.is_empty()||!s&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},d.prototype.get_code=function(s){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 u=this.__lines.join(`
|
|
`);return s!==`
|
|
`&&(u=u.replace(/[\n]/g,s)),u},d.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},d.prototype.set_indent=function(s,r){return s=s||0,r=r||0,this.next_line.set_indent(s,r),this.__lines.length>1?(this.current_line.set_indent(s,r),!0):(this.current_line.set_indent(),!1)},d.prototype.add_raw_token=function(s){for(var r=0;r<s.newlines;r++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(s.whitespace_before),this.current_line.push(s.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},d.prototype.add_token=function(s){this.__add_space_before_token(),this.current_line.push(s),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},d.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(" "))},d.prototype.remove_indent=function(s){for(var r=this.__lines.length;s<r;)this.__lines[s]._remove_indent(),s++;this.current_line._remove_wrap_indent()},d.prototype.trim=function(s){for(s=s===void 0?!1:s,this.current_line.trim();s&&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},d.prototype.just_added_newline=function(){return this.current_line.is_empty()},d.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},d.prototype.ensure_empty_line_above=function(s,r){for(var u=this.__lines.length-2;u>=0;){var o=this.__lines[u];if(o.is_empty())break;if(o.item(0).indexOf(s)!==0&&o.item(-1)!==r){this.__lines.splice(u+1,0,new m(this)),this.previous_line=this.__lines[this.__lines.length-2];break}u--}},b.exports.Output=d},function(b){function m(f,d,s,r){this.type=f,this.text=d,this.comments_before=null,this.newlines=s||0,this.whitespace_before=r||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}b.exports.Token=m},,,function(b){function m(s,r){this.raw_options=f(s,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"])}m.prototype._get_array=function(s,r){var u=this.raw_options[s],o=r||[];return typeof u=="object"?u!==null&&typeof u.concat=="function"&&(o=u.concat()):typeof u=="string"&&(o=u.split(/[^a-zA-Z0-9_\/\-]+/)),o},m.prototype._get_boolean=function(s,r){var u=this.raw_options[s],o=u===void 0?!!r:!!u;return o},m.prototype._get_characters=function(s,r){var u=this.raw_options[s],o=r||"";return typeof u=="string"&&(o=u.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),o},m.prototype._get_number=function(s,r){var u=this.raw_options[s];r=parseInt(r,10),isNaN(r)&&(r=0);var o=parseInt(u,10);return isNaN(o)&&(o=r),o},m.prototype._get_selection=function(s,r,u){var o=this._get_selection_list(s,r,u);if(o.length!==1)throw new Error("Invalid Option Value: The option '"+s+`' can only be one of the following values:
|
|
`+r+`
|
|
You passed in: '`+this.raw_options[s]+"'");return o[0]},m.prototype._get_selection_list=function(s,r,u){if(!r||r.length===0)throw new Error("Selection list cannot be empty.");if(u=u||[r[0]],!this._is_valid_selection(u,r))throw new Error("Invalid Default Value!");var o=this._get_array(s,u);if(!this._is_valid_selection(o,r))throw new Error("Invalid Option Value: The option '"+s+`' can contain only the following values:
|
|
`+r+`
|
|
You passed in: '`+this.raw_options[s]+"'");return o},m.prototype._is_valid_selection=function(s,r){return s.length&&r.length&&!s.some(function(u){return r.indexOf(u)===-1})};function f(s,r){var u={};s=d(s);var o;for(o in s)o!==r&&(u[o]=s[o]);if(r&&s[r])for(o in s[r])u[o]=s[r][o];return u}function d(s){var r={},u;for(u in s){var o=u.replace(/-/g,"_");r[o]=s[u]}return r}b.exports.Options=m,b.exports.normalizeOpts=d,b.exports.mergeOpts=f},,function(b){var m=RegExp.prototype.hasOwnProperty("sticky");function f(d){this.__input=d||"",this.__input_length=this.__input.length,this.__position=0}f.prototype.restart=function(){this.__position=0},f.prototype.back=function(){this.__position>0&&(this.__position-=1)},f.prototype.hasNext=function(){return this.__position<this.__input_length},f.prototype.next=function(){var d=null;return this.hasNext()&&(d=this.__input.charAt(this.__position),this.__position+=1),d},f.prototype.peek=function(d){var s=null;return d=d||0,d+=this.__position,d>=0&&d<this.__input_length&&(s=this.__input.charAt(d)),s},f.prototype.__match=function(d,s){d.lastIndex=s;var r=d.exec(this.__input);return r&&!(m&&d.sticky)&&(r.index!==s&&(r=null)),r},f.prototype.test=function(d,s){return s=s||0,s+=this.__position,s>=0&&s<this.__input_length?!!this.__match(d,s):!1},f.prototype.testChar=function(d,s){var r=this.peek(s);return d.lastIndex=0,r!==null&&d.test(r)},f.prototype.match=function(d){var s=this.__match(d,this.__position);return s?this.__position+=s[0].length:s=null,s},f.prototype.read=function(d,s,r){var u="",o;return d&&(o=this.match(d),o&&(u+=o[0])),s&&(o||!d)&&(u+=this.readUntil(s,r)),u},f.prototype.readUntil=function(d,s){var r="",u=this.__position;d.lastIndex=this.__position;var o=d.exec(this.__input);return o?(u=o.index,s&&(u+=o[0].length)):u=this.__input_length,r=this.__input.substring(this.__position,u),this.__position=u,r},f.prototype.readUntilAfter=function(d){return this.readUntil(d,!0)},f.prototype.get_regexp=function(d,s){var r=null,u="g";return s&&m&&(u="y"),typeof d=="string"&&d!==""?r=new RegExp(d,u):d&&(r=new RegExp(d.source,u)),r},f.prototype.get_literal_regexp=function(d){return RegExp(d.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},f.prototype.peekUntilAfter=function(d){var s=this.__position,r=this.readUntilAfter(d);return this.__position=s,r},f.prototype.lookBack=function(d){var s=this.__position-1;return s>=d.length&&this.__input.substring(s-d.length,s).toLowerCase()===d},b.exports.InputScanner=f},function(b,m,f){var d=f(8).InputScanner,s=f(3).Token,r=f(10).TokenStream,u=f(11).WhitespacePattern,o={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},a=function(n,R){this._input=new d(n),this._options=R||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new u(this._input)};a.prototype.tokenize=function(){this._input.restart(),this.__tokens=new r,this._reset();for(var n,R=new s(o.START,""),w=null,x=[],O=new r;R.type!==o.EOF;){for(n=this._get_next_token(R,w);this._is_comment(n);)O.add(n),n=this._get_next_token(R,w);O.isEmpty()||(n.comments_before=O,O=new r),n.parent=w,this._is_opening(n)?(x.push(w),w=n):w&&this._is_closing(n,w)&&(n.opened=w,w.closed=n,w=x.pop(),n.parent=w),n.previous=R,R.next=n,this.__tokens.add(n),R=n}return this.__tokens},a.prototype._is_first_token=function(){return this.__tokens.isEmpty()},a.prototype._reset=function(){},a.prototype._get_next_token=function(n,R){this._readWhitespace();var w=this._input.read(/.+/g);return w?this._create_token(o.RAW,w):this._create_token(o.EOF,"")},a.prototype._is_comment=function(n){return!1},a.prototype._is_opening=function(n){return!1},a.prototype._is_closing=function(n,R){return!1},a.prototype._create_token=function(n,R){var w=new s(n,R,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return w},a.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},b.exports.Tokenizer=a,b.exports.TOKEN=o},function(b){function m(f){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=f}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 f=null;return this.hasNext()&&(f=this.__tokens[this.__position],this.__position+=1),f},m.prototype.peek=function(f){var d=null;return f=f||0,f+=this.__position,f>=0&&f<this.__tokens_length&&(d=this.__tokens[f]),d},m.prototype.add=function(f){this.__parent_token&&(f.parent=this.__parent_token),this.__tokens.push(f),this.__tokens_length+=1},b.exports.TokenStream=m},function(b,m,f){var d=f(12).Pattern;function s(r,u){d.call(this,r,u),u?this._line_regexp=this._input.get_regexp(u._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}s.prototype=new d,s.prototype.__set_whitespace_patterns=function(r,u){r+="\\t ",u+="\\n\\r",this._match_pattern=this._input.get_regexp("["+r+u+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+u+"]")},s.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 u=this.__split(this._newline_regexp,r);this.newline_count=u.length-1,this.whitespace_before_token=u[this.newline_count]}return r},s.prototype.matching=function(r,u){var o=this._create();return o.__set_whitespace_patterns(r,u),o._update(),o},s.prototype._create=function(){return new s(this._input,this)},s.prototype.__split=function(r,u){r.lastIndex=0;for(var o=0,a=[],n=r.exec(u);n;)a.push(u.substring(o,n.index)),o=n.index+n[0].length,n=r.exec(u);return o<u.length?a.push(u.substring(o,u.length)):a.push(""),a},b.exports.WhitespacePattern=s},function(b){function m(f,d){this._input=f,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,d&&(this._starting_pattern=this._input.get_regexp(d._starting_pattern,!0),this._match_pattern=this._input.get_regexp(d._match_pattern,!0),this._until_pattern=this._input.get_regexp(d._until_pattern),this._until_after=d._until_after)}m.prototype.read=function(){var f=this._input.read(this._starting_pattern);return(!this._starting_pattern||f)&&(f+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),f},m.prototype.read_match=function(){return this._input.match(this._match_pattern)},m.prototype.until_after=function(f){var d=this._create();return d._until_after=!0,d._until_pattern=this._input.get_regexp(f),d._update(),d},m.prototype.until=function(f){var d=this._create();return d._until_after=!1,d._until_pattern=this._input.get_regexp(f),d._update(),d},m.prototype.starting_with=function(f){var d=this._create();return d._starting_pattern=this._input.get_regexp(f,!0),d._update(),d},m.prototype.matching=function(f){var d=this._create();return d._match_pattern=this._input.get_regexp(f,!0),d._update(),d},m.prototype._create=function(){return new m(this._input,this)},m.prototype._update=function(){},b.exports.Pattern=m},function(b){function m(f,d){f=typeof f=="string"?f:f.source,d=typeof d=="string"?d:d.source,this.__directives_block_pattern=new RegExp(f+/ beautify( \w+[:]\w+)+ /.source+d,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(f+/\sbeautify\signore:end\s/.source+d,"g")}m.prototype.get_directives=function(f){if(!f.match(this.__directives_block_pattern))return null;var d={};this.__directive_pattern.lastIndex=0;for(var s=this.__directive_pattern.exec(f);s;)d[s[1]]=s[2],s=this.__directive_pattern.exec(f);return d},m.prototype.readIgnored=function(f){return f.readUntilAfter(this.__directives_end_ignore_pattern)},b.exports.Directives=m},function(b,m,f){var d=f(12).Pattern,s={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function r(u,o){d.call(this,u,o),this.__template_pattern=null,this._disabled=Object.assign({},s),this._excluded=Object.assign({},s),o&&(this.__template_pattern=this._input.get_regexp(o.__template_pattern),this._excluded=Object.assign(this._excluded,o._excluded),this._disabled=Object.assign(this._disabled,o._disabled));var a=new d(u);this.__patterns={handlebars_comment:a.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:a.starting_with(/{{{/).until_after(/}}}/),handlebars:a.starting_with(/{{/).until_after(/}}/),php:a.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:a.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:a.starting_with(/{%/).until_after(/%}/),django_value:a.starting_with(/{{/).until_after(/}}/),django_comment:a.starting_with(/{#/).until_after(/#}/),smarty:a.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:a.starting_with(/{\*/).until_after(/\*}/),smarty_literal:a.starting_with(/{literal}/).until_after(/{\/literal}/)}}r.prototype=new d,r.prototype._create=function(){return new r(this._input,this)},r.prototype._update=function(){this.__set_templated_pattern()},r.prototype.disable=function(u){var o=this._create();return o._disabled[u]=!0,o._update(),o},r.prototype.read_options=function(u){var o=this._create();for(var a in s)o._disabled[a]=u.templating.indexOf(a)===-1;return o._update(),o},r.prototype.exclude=function(u){var o=this._create();return o._excluded[u]=!0,o._update(),o},r.prototype.read=function(){var u="";this._match_pattern?u=this._input.read(this._starting_pattern):u=this._input.read(this._starting_pattern,this.__template_pattern);for(var o=this._read_template();o;)this._match_pattern?o+=this._input.read(this._match_pattern):o+=this._input.readUntil(this.__template_pattern),u+=o,o=this._read_template();return this._until_after&&(u+=this._input.readUntilAfter(this._until_pattern)),u},r.prototype.__set_templated_pattern=function(){var u=[];this._disabled.php||u.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||u.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||u.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(u.push(this.__patterns.django._starting_pattern.source),u.push(this.__patterns.django_value._starting_pattern.source),u.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||u.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&u.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+u.join("|")+")")},r.prototype._read_template=function(){var u="",o=this._input.peek();if(o==="<"){var a=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&a==="?"&&(u=u||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&a==="%"&&(u=u||this.__patterns.erb.read())}else o==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(u=u||this.__patterns.handlebars_comment.read(),u=u||this.__patterns.handlebars_unescaped.read(),u=u||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(u=u||this.__patterns.django_value.read()),this._excluded.django||(u=u||this.__patterns.django_comment.read(),u=u||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(u=u||this.__patterns.smarty_comment.read(),u=u||this.__patterns.smarty_literal.read(),u=u||this.__patterns.smarty.read()));return u},b.exports.TemplatablePattern=r},,,,function(b,m,f){var d=f(19).Beautifier,s=f(20).Options;function r(u,o,a,n){var R=new d(u,o,a,n);return R.beautify()}b.exports=r,b.exports.defaultOptions=function(){return new s}},function(b,m,f){var d=f(20).Options,s=f(2).Output,r=f(21).Tokenizer,u=f(21).TOKEN,o=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,n=function(v,p){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=v.max_preserve_newlines,this.preserve_newlines=v.preserve_newlines,this._output=new s(v,p)};n.prototype.current_line_has_match=function(v){return this._output.current_line.has_match(v)},n.prototype.set_space_before_token=function(v,p){this._output.space_before_token=v,this._output.non_breaking_space=p},n.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},n.prototype.add_raw_token=function(v){this._output.add_raw_token(v)},n.prototype.print_preserved_newlines=function(v){var p=0;v.type!==u.TEXT&&v.previous.type!==u.TEXT&&(p=v.newlines?1:0),this.preserve_newlines&&(p=v.newlines<this.max_preserve_newlines+1?v.newlines:this.max_preserve_newlines+1);for(var E=0;E<p;E++)this.print_newline(E>0);return p!==0},n.prototype.traverse_whitespace=function(v){return v.whitespace_before||v.newlines?(this.print_preserved_newlines(v)||(this._output.space_before_token=!0),!0):!1},n.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},n.prototype.print_newline=function(v){this._output.add_new_line(v)},n.prototype.print_token=function(v){v.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(v.text))},n.prototype.indent=function(){this.indent_level++},n.prototype.get_full_indent=function(v){return v=this.indent_level+(v||0),v<1?"":this._output.get_indent_string(v)};var R=function(v){for(var p=null,E=v.next;E.type!==u.EOF&&v.closed!==E;){if(E.type===u.ATTRIBUTE&&E.text==="type"){E.next&&E.next.type===u.EQUALS&&E.next.next&&E.next.next.type===u.VALUE&&(p=E.next.next.text);break}E=E.next}return p},w=function(v,p){var E=null,U=null;return p.closed?(v==="script"?E="text/javascript":v==="style"&&(E="text/css"),E=R(p)||E,E.search("text/css")>-1?U="css":E.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?U="javascript":E.search(/(text|application|dojo)\/(x-)?(html)/)>-1?U="html":E.search(/test\/null/)>-1&&(U="null"),U):null};function x(v,p){return p.indexOf(v)!==-1}function O(v,p,E){this.parent=v||null,this.tag=p?p.tag_name:"",this.indent_level=E||0,this.parser_token=p||null}function C(v){this._printer=v,this._current_frame=null}C.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},C.prototype.record_tag=function(v){var p=new O(this._current_frame,v,this._printer.indent_level);this._current_frame=p},C.prototype._try_pop_frame=function(v){var p=null;return v&&(p=v.parser_token,this._printer.indent_level=v.indent_level,this._current_frame=v.parent),p},C.prototype._get_frame=function(v,p){for(var E=this._current_frame;E&&!(v.indexOf(E.tag)!==-1);){if(p&&p.indexOf(E.tag)!==-1){E=null;break}E=E.parent}return E},C.prototype.try_pop=function(v,p){var E=this._get_frame([v],p);return this._try_pop_frame(E)},C.prototype.indent_to_tag=function(v){var p=this._get_frame(v);p&&(this._printer.indent_level=p.indent_level)};function _(v,p,E,U){this._source_text=v||"",p=p||{},this._js_beautify=E,this._css_beautify=U,this._tag_stack=null;var F=new d(p,"html");this._options=F,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}_.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var v=this._source_text,p=this._options.eol;this._options.eol==="auto"&&(p=`
|
|
`,v&&o.test(v)&&(p=v.match(o)[0])),v=v.replace(a,`
|
|
`);var E=v.match(/^[\t ]*/)[0],U={text:"",type:""},F=new y,z=new n(this._options,E),G=new r(v,this._options).tokenize();this._tag_stack=new C(z);for(var B=null,T=G.next();T.type!==u.EOF;)T.type===u.TAG_OPEN||T.type===u.COMMENT?(B=this._handle_tag_open(z,T,F,U),F=B):T.type===u.ATTRIBUTE||T.type===u.EQUALS||T.type===u.VALUE||T.type===u.TEXT&&!F.tag_complete?B=this._handle_inside_tag(z,T,F,G):T.type===u.TAG_CLOSE?B=this._handle_tag_close(z,T,F):T.type===u.TEXT?B=this._handle_text(z,T,F):z.add_raw_token(T),U=B,T=G.next();var V=z._output.get_code(p);return V},_.prototype._handle_tag_close=function(v,p,E){var U={text:p.text,type:p.type};return v.alignment_size=0,E.tag_complete=!0,v.set_space_before_token(p.newlines||p.whitespace_before!=="",!0),E.is_unformatted?v.add_raw_token(p):(E.tag_start_char==="<"&&(v.set_space_before_token(p.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&E.has_wrapped_attrs&&v.print_newline(!1)),v.print_token(p)),E.indent_content&&!(E.is_unformatted||E.is_content_unformatted)&&(v.indent(),E.indent_content=!1),!E.is_inline_element&&!(E.is_unformatted||E.is_content_unformatted)&&v.set_wrap_point(),U},_.prototype._handle_inside_tag=function(v,p,E,U){var F=E.has_wrapped_attrs,z={text:p.text,type:p.type};if(v.set_space_before_token(p.newlines||p.whitespace_before!=="",!0),E.is_unformatted)v.add_raw_token(p);else if(E.tag_start_char==="{"&&p.type===u.TEXT)v.print_preserved_newlines(p)?(p.newlines=0,v.add_raw_token(p)):v.print_token(p);else{if(p.type===u.ATTRIBUTE?(v.set_space_before_token(!0),E.attr_count+=1):(p.type===u.EQUALS||p.type===u.VALUE&&p.previous.type===u.EQUALS)&&v.set_space_before_token(!1),p.type===u.ATTRIBUTE&&E.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(v.traverse_whitespace(p),F=F||p.newlines!==0),this._is_wrap_attributes_force)){var G=E.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&E.attr_count===1){var B=!0,T=0,V;do{if(V=U.peek(T),V.type===u.ATTRIBUTE){B=!1;break}T+=1}while(T<4&&V.type!==u.EOF&&V.type!==u.TAG_CLOSE);G=!B}G&&(v.print_newline(!1),F=!0)}v.print_token(p),F=F||v.previous_token_wrapped(),E.has_wrapped_attrs=F}return z},_.prototype._handle_text=function(v,p,E){var U={text:p.text,type:"TK_CONTENT"};return E.custom_beautifier_name?this._print_custom_beatifier_text(v,p,E):E.is_unformatted||E.is_content_unformatted?v.add_raw_token(p):(v.traverse_whitespace(p),v.print_token(p)),U},_.prototype._print_custom_beatifier_text=function(v,p,E){var U=this;if(p.text!==""){var F=p.text,z,G=1,B="",T="";E.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?z=this._js_beautify:E.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?z=this._css_beautify:E.custom_beautifier_name==="html"&&(z=function(xe,Ie){var Je=new _(xe,Ie,U._js_beautify,U._css_beautify);return Je.beautify()}),this._options.indent_scripts==="keep"?G=0:this._options.indent_scripts==="separate"&&(G=-v.indent_level);var V=v.get_full_indent(G);if(F=F.replace(/\n[ \t]*$/,""),E.custom_beautifier_name!=="html"&&F[0]==="<"&&F.match(/^(<!--|<!\[CDATA\[)/)){var Z=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(F);if(!Z){v.add_raw_token(p);return}B=V+Z[1]+`
|
|
`,F=Z[4],Z[5]&&(T=V+Z[5]),F=F.replace(/\n[ \t]*$/,""),(Z[2]||Z[3].indexOf(`
|
|
`)!==-1)&&(Z=Z[3].match(/[ \t]+$/),Z&&(p.whitespace_before=Z[0]))}if(F)if(z){var oe=function(){this.eol=`
|
|
`};oe.prototype=this._options.raw_options;var pe=new oe;F=z(V+F,pe)}else{var Ye=p.whitespace_before;Ye&&(F=F.replace(new RegExp(`
|
|
(`+Ye+")?","g"),`
|
|
`)),F=V+F.replace(/\n/g,`
|
|
`+V)}B&&(F?F=B+F+`
|
|
`+T:F=B+T),v.print_newline(!1),F&&(p.text=F,p.whitespace_before="",p.newlines=0,v.add_raw_token(p),v.print_newline(!0))}},_.prototype._handle_tag_open=function(v,p,E,U){var F=this._get_tag_open_token(p);return(E.is_unformatted||E.is_content_unformatted)&&!E.is_empty_element&&p.type===u.TAG_OPEN&&p.text.indexOf("</")===0?(v.add_raw_token(p),F.start_tag_token=this._tag_stack.try_pop(F.tag_name)):(v.traverse_whitespace(p),this._set_tag_position(v,p,F,E,U),F.is_inline_element||v.set_wrap_point(),v.print_token(p)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(F.alignment_size=p.text.length+1),!F.tag_complete&&!F.is_unformatted&&(v.alignment_size=F.alignment_size),F};var y=function(v,p){if(this.parent=v||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="",!p)this.tag_complete=!0;else{var E;this.tag_start_char=p.text[0],this.text=p.text,this.tag_start_char==="<"?(E=p.text.match(/^<([^\s>]*)/),this.tag_check=E?E[1]:""):(E=p.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=E?E[1]:"",(p.text.startsWith("{{#>")||p.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&p.next!==null?this.tag_check=p.next.text.split(" ")[0]:this.tag_check=p.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),p.type===u.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||p.closed&&p.closed.text==="/>";var U=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(U=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(U)))}};_.prototype._get_tag_open_token=function(v){var p=new y(this._tag_stack.get_parser_token(),v);return p.alignment_size=this._options.wrap_attributes_indent_size,p.is_end_tag=p.is_end_tag||x(p.tag_check,this._options.void_elements),p.is_empty_element=p.tag_complete||p.is_start_tag&&p.is_end_tag,p.is_unformatted=!p.tag_complete&&x(p.tag_check,this._options.unformatted),p.is_content_unformatted=!p.is_empty_element&&x(p.tag_check,this._options.content_unformatted),p.is_inline_element=x(p.tag_name,this._options.inline)||p.tag_name.includes("-")||p.tag_start_char==="{",p},_.prototype._set_tag_position=function(v,p,E,U,F){if(E.is_empty_element||(E.is_end_tag?E.start_tag_token=this._tag_stack.try_pop(E.tag_name):(this._do_optional_end_element(E)&&(E.is_inline_element||v.print_newline(!1)),this._tag_stack.record_tag(E),(E.tag_name==="script"||E.tag_name==="style")&&!(E.is_unformatted||E.is_content_unformatted)&&(E.custom_beautifier_name=w(E.tag_check,p)))),x(E.tag_check,this._options.extra_liners)&&(v.print_newline(!1),v._output.just_added_blankline()||v.print_newline(!0)),E.is_empty_element){if(E.tag_start_char==="{"&&E.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),E.indent_content=!0;var z=v.current_line_has_match(/{{#if/);z||v.print_newline(!1)}E.tag_name==="!--"&&F.type===u.TAG_CLOSE&&U.is_end_tag&&E.text.indexOf(`
|
|
`)===-1||(E.is_inline_element||E.is_unformatted||v.print_newline(!1),this._calcluate_parent_multiline(v,E))}else if(E.is_end_tag){var G=!1;G=E.start_tag_token&&E.start_tag_token.multiline_content,G=G||!E.is_inline_element&&!(U.is_inline_element||U.is_unformatted)&&!(F.type===u.TAG_CLOSE&&E.start_tag_token===U)&&F.type!=="TK_CONTENT",(E.is_content_unformatted||E.is_unformatted)&&(G=!1),G&&v.print_newline(!1)}else E.indent_content=!E.custom_beautifier_name,E.tag_start_char==="<"&&(E.tag_name==="html"?E.indent_content=this._options.indent_inner_html:E.tag_name==="head"?E.indent_content=this._options.indent_head_inner_html:E.tag_name==="body"&&(E.indent_content=this._options.indent_body_inner_html)),!(E.is_inline_element||E.is_unformatted)&&(F.type!=="TK_CONTENT"||E.is_content_unformatted)&&v.print_newline(!1),this._calcluate_parent_multiline(v,E)},_.prototype._calcluate_parent_multiline=function(v,p){p.parent&&v._output.just_added_newline()&&!((p.is_inline_element||p.is_unformatted)&&p.parent.is_inline_element)&&(p.parent.multiline_content=!0)};var h=["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"],c=["a","audio","del","ins","map","noscript","video"];_.prototype._do_optional_end_element=function(v){var p=null;if(v.is_empty_element||!v.is_start_tag||!v.parent)return;if(v.tag_name==="body")p=p||this._tag_stack.try_pop("head");else if(v.tag_name==="li")p=p||this._tag_stack.try_pop("li",["ol","ul"]);else if(v.tag_name==="dd"||v.tag_name==="dt")p=p||this._tag_stack.try_pop("dt",["dl"]),p=p||this._tag_stack.try_pop("dd",["dl"]);else if(v.parent.tag_name==="p"&&h.indexOf(v.tag_name)!==-1){var E=v.parent.parent;(!E||c.indexOf(E.tag_name)===-1)&&(p=p||this._tag_stack.try_pop("p"))}else v.tag_name==="rp"||v.tag_name==="rt"?(p=p||this._tag_stack.try_pop("rt",["ruby","rtc"]),p=p||this._tag_stack.try_pop("rp",["ruby","rtc"])):v.tag_name==="optgroup"?p=p||this._tag_stack.try_pop("optgroup",["select"]):v.tag_name==="option"?p=p||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):v.tag_name==="colgroup"?p=p||this._tag_stack.try_pop("caption",["table"]):v.tag_name==="thead"?(p=p||this._tag_stack.try_pop("caption",["table"]),p=p||this._tag_stack.try_pop("colgroup",["table"])):v.tag_name==="tbody"||v.tag_name==="tfoot"?(p=p||this._tag_stack.try_pop("caption",["table"]),p=p||this._tag_stack.try_pop("colgroup",["table"]),p=p||this._tag_stack.try_pop("thead",["table"]),p=p||this._tag_stack.try_pop("tbody",["table"])):v.tag_name==="tr"?(p=p||this._tag_stack.try_pop("caption",["table"]),p=p||this._tag_stack.try_pop("colgroup",["table"]),p=p||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(v.tag_name==="th"||v.tag_name==="td")&&(p=p||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),p=p||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return v.parent=this._tag_stack.get_parser_token(),p},b.exports.Beautifier=_},function(b,m,f){var d=f(6).Options;function s(r){d.call(this,r,"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"])}s.prototype=new d,b.exports.Options=s},function(b,m,f){var d=f(9).Tokenizer,s=f(9).TOKEN,r=f(13).Directives,u=f(14).TemplatablePattern,o=f(12).Pattern,a={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:s.START,RAW:s.RAW,EOF:s.EOF},n=new r(/<\!--/,/-->/),R=function(w,x){d.call(this,w,x),this._current_tag_name="";var O=new u(this._input).read_options(this._options),C=new o(this._input);if(this.__patterns={word:O.until(/[\n\r\t <]/),single_quote:O.until_after(/'/),double_quote:O.until_after(/"/),attribute:O.until(/[\n\r\t =>]|\/>/),element_name:O.until(/[\n\r\t >\/]/),handlebars_comment:C.starting_with(/{{!--/).until_after(/--}}/),handlebars:C.starting_with(/{{/).until_after(/}}/),handlebars_open:C.until(/[\n\r\t }]/),handlebars_raw_close:C.until(/}}/),comment:C.starting_with(/<!--/).until_after(/-->/),cdata:C.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:C.starting_with(/<!\[/).until_after(/]>/),processing:C.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var _=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=C.matching(_).until_after(_)}};R.prototype=new d,R.prototype._is_comment=function(w){return!1},R.prototype._is_opening=function(w){return w.type===a.TAG_OPEN},R.prototype._is_closing=function(w,x){return w.type===a.TAG_CLOSE&&x&&((w.text===">"||w.text==="/>")&&x.text[0]==="<"||w.text==="}}"&&x.text[0]==="{"&&x.text[1]==="{")},R.prototype._reset=function(){this._current_tag_name=""},R.prototype._get_next_token=function(w,x){var O=null;this._readWhitespace();var C=this._input.peek();return C===null?this._create_token(a.EOF,""):(O=O||this._read_open_handlebars(C,x),O=O||this._read_attribute(C,w,x),O=O||this._read_close(C,x),O=O||this._read_raw_content(C,w,x),O=O||this._read_content_word(C),O=O||this._read_comment_or_cdata(C),O=O||this._read_processing(C),O=O||this._read_open(C,x),O=O||this._create_token(a.UNKNOWN,this._input.next()),O)},R.prototype._read_comment_or_cdata=function(w){var x=null,O=null,C=null;if(w==="<"){var _=this._input.peek(1);_==="!"&&(O=this.__patterns.comment.read(),O?(C=n.get_directives(O),C&&C.ignore==="start"&&(O+=n.readIgnored(this._input))):O=this.__patterns.cdata.read()),O&&(x=this._create_token(a.COMMENT,O),x.directives=C)}return x},R.prototype._read_processing=function(w){var x=null,O=null,C=null;if(w==="<"){var _=this._input.peek(1);(_==="!"||_==="?")&&(O=this.__patterns.conditional_comment.read(),O=O||this.__patterns.processing.read()),O&&(x=this._create_token(a.COMMENT,O),x.directives=C)}return x},R.prototype._read_open=function(w,x){var O=null,C=null;return x||w==="<"&&(O=this._input.next(),this._input.peek()==="/"&&(O+=this._input.next()),O+=this.__patterns.element_name.read(),C=this._create_token(a.TAG_OPEN,O)),C},R.prototype._read_open_handlebars=function(w,x){var O=null,C=null;return x||this._options.indent_handlebars&&w==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(O=this.__patterns.handlebars_comment.read(),O=O||this.__patterns.handlebars.read(),C=this._create_token(a.COMMENT,O)):(O=this.__patterns.handlebars_open.read(),C=this._create_token(a.TAG_OPEN,O))),C},R.prototype._read_close=function(w,x){var O=null,C=null;return x&&(x.text[0]==="<"&&(w===">"||w==="/"&&this._input.peek(1)===">")?(O=this._input.next(),w==="/"&&(O+=this._input.next()),C=this._create_token(a.TAG_CLOSE,O)):x.text[0]==="{"&&w==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),C=this._create_token(a.TAG_CLOSE,"}}"))),C},R.prototype._read_attribute=function(w,x,O){var C=null,_="";if(O&&O.text[0]==="<")if(w==="=")C=this._create_token(a.EQUALS,this._input.next());else if(w==='"'||w==="'"){var y=this._input.next();w==='"'?y+=this.__patterns.double_quote.read():y+=this.__patterns.single_quote.read(),C=this._create_token(a.VALUE,y)}else _=this.__patterns.attribute.read(),_&&(x.type===a.EQUALS?C=this._create_token(a.VALUE,_):C=this._create_token(a.ATTRIBUTE,_));return C},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,x,O){var C="";if(O&&O.text[0]==="{")C=this.__patterns.handlebars_raw_close.read();else if(x.type===a.TAG_CLOSE&&x.opened.text[0]==="<"&&x.text[0]!=="/"){var _=x.opened.text.substr(1).toLowerCase();if(_==="script"||_==="style"){var y=this._read_comment_or_cdata(w);if(y)return y.type=a.TEXT,y;C=this._input.readUntil(new RegExp("</"+_+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(_)&&(C=this._input.readUntil(new RegExp("</"+_+"[\\n\\r\\t ]*?>","ig")))}return C?this._create_token(a.TEXT,C):null},R.prototype._read_content_word=function(w){var x="";if(this._options.unformatted_content_delimiter&&(w===this._options.unformatted_content_delimiter[0]&&(x=this.__patterns.unformatted_content_delimiter.read())),x||(x=this.__patterns.word.read()),x)return this._create_token(a.TEXT,x)},b.exports.Tokenizer=R,b.exports.TOKEN=a}],P={};function k(b){var m=P[b];if(m!==void 0)return m.exports;var f=P[b]={exports:{}};return H[b](f,f.exports,k),f.exports}var D=k(18);N=D})();var K=N;if(!0)!(te=[I,I("6UM0"),I("TXwP")],Y=function(H){var P=I("6UM0"),k=I("TXwP");return{html_beautify:function(D,b){return K(D,b,P.js_beautify,k.css_beautify)}}}.apply(Qe,te),Y!==void 0&&(tn.exports=Y));else var A,M})()},"rAM+":function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return Y});var te=I("Qw5x");function Y(N,K){var A;if(typeof Symbol=="undefined"||N[Symbol.iterator]==null){if(Array.isArray(N)||(A=Object(te.a)(N))||K&&N&&typeof N.length=="number"){A&&(N=A);var M=0,H=function(){};return{s:H,n:function(){return M>=N.length?{done:!0}:{done:!1,value:N[M++]}},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 P=!0,k=!1,D;return{s:function(){A=N[Symbol.iterator]()},n:function(){var m=A.next();return P=m.done,m},e:function(m){k=!0,D=m},f:function(){try{!P&&A.return!=null&&A.return()}finally{if(k)throw D}}}}},rUJ1:function(tn,Qe){const I=/[&<>"']/,te=/[&<>"']/g,Y=/[<>"']|&(?!#?\w+;)/,N=/[<>"']|&(?!#?\w+;)/g,K={"&":"&","<":"<",">":">",'"':""","'":"'"},A=C=>K[C];function M(C,_){if(_){if(I.test(C))return C.replace(te,A)}else if(Y.test(C))return C.replace(N,A);return C}const H=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function P(C){return C.replace(H,(_,y)=>(y=y.toLowerCase(),y==="colon"?":":y.charAt(0)==="#"?y.charAt(1)==="x"?String.fromCharCode(parseInt(y.substring(2),16)):String.fromCharCode(+y.substring(1)):""))}const k=/(^|[^\[])\^/g;function D(C,_){C=C.source||C,_=_||"";const y={replace:(h,c)=>(c=c.source||c,c=c.replace(k,"$1"),C=C.replace(h,c),y),getRegex:()=>new RegExp(C,_)};return y}const b=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function f(C,_,y){if(C){let h;try{h=decodeURIComponent(P(y)).replace(b,"").toLowerCase()}catch(c){return null}if(h.indexOf("javascript:")===0||h.indexOf("vbscript:")===0||h.indexOf("data:")===0)return null}_&&!m.test(y)&&(y=o(_,y));try{y=encodeURI(y).replace(/%25/g,"%")}catch(h){return null}return y}const d={},s=/^[^:]+:\/*[^/]*$/,r=/^([^:]+:)[\s\S]*$/,u=/^([^:]+:\/*[^/]*)[\s\S]*$/;function o(C,_){d[" "+C]||(s.test(C)?d[" "+C]=C+"/":d[" "+C]=w(C,"/",!0)),C=d[" "+C];const y=C.indexOf(":")===-1;return _.substring(0,2)==="//"?y?_:C.replace(r,"$1")+_:_.charAt(0)==="/"?y?_:C.replace(u,"$1")+_:C+_}const a={exec:function(){}};function n(C){let _=1,y,h;for(;_<arguments.length;_++){y=arguments[_];for(h in y)Object.prototype.hasOwnProperty.call(y,h)&&(C[h]=y[h])}return C}function R(C,_){const y=C.replace(/\|/g,(v,p,E)=>{let U=!1,F=p;for(;--F>=0&&E[F]==="\\";)U=!U;return U?"|":" |"}),h=y.split(/ \|/);let c=0;if(h.length>_)h.splice(_);else for(;h.length<_;)h.push("");for(;c<h.length;c++)h[c]=h[c].trim().replace(/\\\|/g,"|");return h}function w(C,_,y){const h=C.length;if(h===0)return"";let c=0;for(;c<h;){const v=C.charAt(h-c-1);if(v===_&&!y)c++;else if(v!==_&&y)c++;else break}return C.substr(0,h-c)}function x(C,_){if(C.indexOf(_[1])===-1)return-1;const y=C.length;let h=0,c=0;for(;c<y;c++)if(C[c]==="\\")c++;else if(C[c]===_[0])h++;else if(C[c]===_[1]&&(h--,h<0))return c;return-1}function O(C){C&&C.sanitize&&!C.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")}tn.exports={escape:M,unescape:P,edit:D,cleanUrl:f,resolveUrl:o,noopTest:a,merge:n,splitCells:R,rtrim:w,findClosingBracket:x,checkSanitizeDeprecation:O}},sR1s:function(tn,Qe,I){"use strict";I.d(Qe,"b",function(){return K}),I.d(Qe,"a",function(){return A}),I.d(Qe,"c",function(){return M}),I.d(Qe,"d",function(){return H});var te=I("U8pU"),Y="RC_TABLE_KEY";function N(P){return P==null?[]:Array.isArray(P)?P:[P]}function K(P,k){if(!k&&typeof k!="number")return P;for(var D=N(k),b=P,m=0;m<D.length;m+=1){if(!b)return null;var f=D[m];b=b[f]}return b}function A(P){var k=[],D={};return P.forEach(function(b){for(var m=b||{},f=m.key,d=m.dataIndex,s=f||N(d).join("-")||Y;D[s];)s="".concat(s,"_next");D[s]=!0,k.push(s)}),k}function M(){var P={};function k(f,d){d&&Object.keys(d).forEach(function(s){var r=d[s];r&&Object(te.a)(r)==="object"?(f[s]=f[s]||{},k(f[s],r)):f[s]=r})}for(var D=arguments.length,b=new Array(D),m=0;m<D;m++)b[m]=arguments[m];return b.forEach(function(f){k(P,f)}),P}function H(P){return P!=null}},sboe:function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return N});var te=I("q1tI"),Y=I.n(te),N=te.createContext(null)},t23M:function(tn,Qe,I){"use strict";var te=I("VTBJ"),Y=I("1OyB"),N=I("vuIU"),K=I("Ji7U"),A=I("LK+K"),M=I("q1tI"),H=I.n(M),P=I("m+aA"),k=I("Zm9Q"),D=I("Kwbf"),b=I("c+Xe"),m=I("bdgK"),f="rc-observer-key",d=function(s){Object(K.a)(u,s);var r=Object(A.a)(u);function u(){var o;return Object(Y.a)(this,u),o=r.apply(this,arguments),o.resizeObserver=null,o.childNode=null,o.currentElement=null,o.state={width:0,height:0,offsetHeight:0,offsetWidth:0},o.onResize=function(a){var n=o.props.onResize,R=a[0].target,w=R.getBoundingClientRect(),x=w.width,O=w.height,C=R.offsetWidth,_=R.offsetHeight,y=Math.floor(x),h=Math.floor(O);if(o.state.width!==y||o.state.height!==h||o.state.offsetWidth!==C||o.state.offsetHeight!==_){var c={width:y,height:h,offsetWidth:C,offsetHeight:_};o.setState(c),n&&Promise.resolve().then(function(){n(Object(te.a)(Object(te.a)({},c),{},{offsetWidth:C,offsetHeight:_}))})}},o.setChildNode=function(a){o.childNode=a},o}return Object(N.a)(u,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var a=this.props.disabled;if(a){this.destroyObserver();return}var n=Object(P.a)(this.childNode||this),R=n!==this.currentElement;R&&(this.destroyObserver(),this.currentElement=n),!this.resizeObserver&&n&&(this.resizeObserver=new m.default(this.onResize),this.resizeObserver.observe(n))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var a=this.props.children,n=Object(k.a)(a);if(n.length>1)Object(D.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(n.length===0)return Object(D.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var R=n[0];if(M.isValidElement(R)&&Object(b.c)(R)){var w=R.ref;n[0]=M.cloneElement(R,{ref:Object(b.a)(w,this.setChildNode)})}return n.length===1?n[0]:n.map(function(x,O){return!M.isValidElement(x)||"key"in x&&x.key!==null?x:M.cloneElement(x,{key:"".concat(f,"-").concat(O)})})}}]),u}(M.Component);d.displayName="ResizeObserver",Qe.a=d},ulZh:function(tn,Qe,I){typeof window!="undefined"&&function(Y,N){tn.exports=N()}(this,function(){return function(te){var Y={};function N(K){if(Y[K])return Y[K].exports;var A=Y[K]={i:K,l:!1,exports:{}};return te[K].call(A.exports,A,A.exports,N),A.l=!0,A.exports}return N.m=te,N.c=Y,N.d=function(K,A,M){N.o(K,A)||Object.defineProperty(K,A,{enumerable:!0,get:M})},N.r=function(K){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(K,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(K,"__esModule",{value:!0})},N.t=function(K,A){if(A&1&&(K=N(K)),A&8)return K;if(A&4&&typeof K=="object"&&K&&K.__esModule)return K;var M=Object.create(null);if(N.r(M),Object.defineProperty(M,"default",{enumerable:!0,value:K}),A&2&&typeof K!="string")for(var H in K)N.d(M,H,function(P){return K[P]}.bind(null,H));return M},N.n=function(K){var A=K&&K.__esModule?function(){return K.default}:function(){return K};return N.d(A,"a",A),A},N.o=function(K,A){return Object.prototype.hasOwnProperty.call(K,A)},N.p="/dist/",N(N.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(te,Y,N){"use strict";var K=Object.prototype.hasOwnProperty,A="~";function M(){}Object.create&&(M.prototype=Object.create(null),new M().__proto__||(A=!1));function H(b,m,f){this.fn=b,this.context=m,this.once=f||!1}function P(b,m,f,d,s){if(typeof f!="function")throw new TypeError("The listener must be a function");var r=new H(f,d||b,s),u=A?A+m:m;return b._events[u]?b._events[u].fn?b._events[u]=[b._events[u],r]:b._events[u].push(r):(b._events[u]=r,b._eventsCount++),b}function k(b,m){--b._eventsCount===0?b._events=new M:delete b._events[m]}function D(){this._events=new M,this._eventsCount=0}D.prototype.eventNames=function(){var m=[],f,d;if(this._eventsCount===0)return m;for(d in f=this._events)K.call(f,d)&&m.push(A?d.slice(1):d);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(f)):m},D.prototype.listeners=function(m){var f=A?A+m:m,d=this._events[f];if(!d)return[];if(d.fn)return[d.fn];for(var s=0,r=d.length,u=new Array(r);s<r;s++)u[s]=d[s].fn;return u},D.prototype.listenerCount=function(m){var f=A?A+m:m,d=this._events[f];return d?d.fn?1:d.length:0},D.prototype.emit=function(m,f,d,s,r,u){var o=A?A+m:m;if(!this._events[o])return!1;var a=this._events[o],n=arguments.length,R,w;if(a.fn){a.once&&this.removeListener(m,a.fn,void 0,!0);switch(n){case 1:return a.fn.call(a.context),!0;case 2:return a.fn.call(a.context,f),!0;case 3:return a.fn.call(a.context,f,d),!0;case 4:return a.fn.call(a.context,f,d,s),!0;case 5:return a.fn.call(a.context,f,d,s,r),!0;case 6:return a.fn.call(a.context,f,d,s,r,u),!0}for(w=1,R=new Array(n-1);w<n;w++)R[w-1]=arguments[w];a.fn.apply(a.context,R)}else{var x=a.length,O;for(w=0;w<x;w++){a[w].once&&this.removeListener(m,a[w].fn,void 0,!0);switch(n){case 1:a[w].fn.call(a[w].context);break;case 2:a[w].fn.call(a[w].context,f);break;case 3:a[w].fn.call(a[w].context,f,d);break;case 4:a[w].fn.call(a[w].context,f,d,s);break;default:if(!R)for(O=1,R=new Array(n-1);O<n;O++)R[O-1]=arguments[O];a[w].fn.apply(a[w].context,R)}}}return!0},D.prototype.on=function(m,f,d){return P(this,m,f,d,!1)},D.prototype.once=function(m,f,d){return P(this,m,f,d,!0)},D.prototype.removeListener=function(m,f,d,s){var r=A?A+m:m;if(!this._events[r])return this;if(!f)return k(this,r),this;var u=this._events[r];if(u.fn)u.fn===f&&(!s||u.once)&&(!d||u.context===d)&&k(this,r);else{for(var o=0,a=[],n=u.length;o<n;o++)(u[o].fn!==f||s&&!u[o].once||d&&u[o].context!==d)&&a.push(u[o]);a.length?this._events[r]=a.length===1?a[0]:a:k(this,r)}return this},D.prototype.removeAllListeners=function(m){var f;return m?(f=A?A+m:m,this._events[f]&&k(this,f)):(this._events=new M,this._eventsCount=0),this},D.prototype.off=D.prototype.removeListener,D.prototype.addListener=D.prototype.on,D.prefixed=A,D.EventEmitter=D,te.exports=D},"./node_modules/url-toolkit/src/url-toolkit.js":function(te,Y,N){(function(K){var A=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,M=/^([^\/?#]*)([^]*)$/,H=/(?:\/|^)\.(?=\/)/g,P=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,k={buildAbsoluteURL:function(D,b,m){if(m=m||{},D=D.trim(),b=b.trim(),!b){if(!m.alwaysNormalize)return D;var f=k.parseURL(D);if(!f)throw new Error("Error trying to parse base URL.");return f.path=k.normalizePath(f.path),k.buildURLFromParts(f)}var d=k.parseURL(b);if(!d)throw new Error("Error trying to parse relative URL.");if(d.scheme)return m.alwaysNormalize?(d.path=k.normalizePath(d.path),k.buildURLFromParts(d)):b;var s=k.parseURL(D);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&s.path[0]!=="/"){var r=M.exec(s.path);s.netLoc=r[1],s.path=r[2]}s.netLoc&&!s.path&&(s.path="/");var u={scheme:s.scheme,netLoc:d.netLoc,path:null,params:d.params,query:d.query,fragment:d.fragment};if(!d.netLoc&&(u.netLoc=s.netLoc,d.path[0]!=="/"))if(!d.path)u.path=s.path,d.params||(u.params=s.params,d.query||(u.query=s.query));else{var o=s.path,a=o.substring(0,o.lastIndexOf("/")+1)+d.path;u.path=k.normalizePath(a)}return u.path===null&&(u.path=m.alwaysNormalize?k.normalizePath(d.path):d.path),k.buildURLFromParts(u)},parseURL:function(D){var b=A.exec(D);return b?{scheme:b[1]||"",netLoc:b[2]||"",path:b[3]||"",params:b[4]||"",query:b[5]||"",fragment:b[6]||""}:null},normalizePath:function(D){for(D=D.split("").reverse().join("").replace(H,"");D.length!==(D=D.replace(P,"")).length;);return D.split("").reverse().join("")},buildURLFromParts:function(D){return D.scheme+D.netLoc+D.path+D.params+D.query+D.fragment}};te.exports=k})(this)},"./node_modules/webworkify-webpack/index.js":function(te,Y,N){function K(m){var f={};function d(r){if(f[r])return f[r].exports;var u=f[r]={i:r,l:!1,exports:{}};return m[r].call(u.exports,u,u.exports,d),u.l=!0,u.exports}d.m=m,d.c=f,d.i=function(r){return r},d.d=function(r,u,o){d.o(r,u)||Object.defineProperty(r,u,{configurable:!1,enumerable:!0,get:o})},d.r=function(r){Object.defineProperty(r,"__esModule",{value:!0})},d.n=function(r){var u=r&&r.__esModule?function(){return r.default}:function(){return r};return d.d(u,"a",u),u},d.o=function(r,u){return Object.prototype.hasOwnProperty.call(r,u)},d.p="/",d.oe=function(r){throw console.error(r),r};var s=d(d.s=ENTRY_MODULE);return s.default||s}var A="[\\.|\\-|\\+|\\w|/|@]+",M="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+A+").*?\\)";function H(m){return(m+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function P(m){return!isNaN(1*m)}function k(m,f,d){var s={};s[d]=[];var r=f.toString(),u=r.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!u)return s;for(var o=u[1],a=new RegExp("(\\\\n|\\W)"+H(o)+M,"g"),n;n=a.exec(r);){if(n[3]==="dll-reference")continue;s[d].push(n[3])}for(a=new RegExp("\\("+H(o)+'\\("(dll-reference\\s('+A+'))"\\)\\)'+M,"g");n=a.exec(r);)m[n[2]]||(s[d].push(n[1]),m[n[2]]=N(n[1]).m),s[n[2]]=s[n[2]]||[],s[n[2]].push(n[4]);for(var R=Object.keys(s),w=0;w<R.length;w++)for(var x=0;x<s[R[w]].length;x++)P(s[R[w]][x])&&(s[R[w]][x]=1*s[R[w]][x]);return s}function D(m){var f=Object.keys(m);return f.reduce(function(d,s){return d||m[s].length>0},!1)}function b(m,f){for(var d={main:[f]},s={main:[]},r={main:{}};D(d);)for(var u=Object.keys(d),o=0;o<u.length;o++){var a=u[o],n=d[a],R=n.pop();if(r[a]=r[a]||{},r[a][R]||!m[a][R])continue;r[a][R]=!0,s[a]=s[a]||[],s[a].push(R);for(var w=k(m,m[a][R],a),x=Object.keys(w),O=0;O<x.length;O++)d[x[O]]=d[x[O]]||[],d[x[O]]=d[x[O]].concat(w[x[O]])}return s}te.exports=function(m,f){f=f||{};var d={main:N.m},s=f.all?{main:Object.keys(d.main)}:b(d,m),r="";Object.keys(s).filter(function(R){return R!=="main"}).forEach(function(R){for(var w=0;s[R][w];)w++;s[R].push(w),d[R][w]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",r=r+"var "+R+" = ("+K.toString().replace("ENTRY_MODULE",JSON.stringify(w))+")({"+s[R].map(function(x){return""+JSON.stringify(x)+": "+d[R][x].toString()}).join(",")+`});
|
|
`}),r=r+"new (("+K.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+s.main.map(function(R){return""+JSON.stringify(R)+": "+d.main[R].toString()}).join(",")+"}))(self);";var u=new window.Blob([r],{type:"text/javascript"});if(f.bare)return u;var o=window.URL||window.webkitURL||window.mozURL||window.msURL,a=o.createObjectURL(u),n=new window.Worker(a);return n.objectURL=a,n}},"./src/config.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"hlsDefaultConfig",function(){return O}),N.d(Y,"mergeConfig",function(){return _}),N.d(Y,"enableStreamingMode",function(){return y});var K=N("./src/controller/abr-controller.ts"),A=N("./src/controller/audio-stream-controller.ts"),M=N("./src/controller/audio-track-controller.ts"),H=N("./src/controller/subtitle-stream-controller.ts"),P=N("./src/controller/subtitle-track-controller.ts"),k=N("./src/controller/buffer-controller.ts"),D=N("./src/controller/timeline-controller.ts"),b=N("./src/controller/cap-level-controller.ts"),m=N("./src/controller/fps-controller.ts"),f=N("./src/controller/eme-controller.ts"),d=N("./src/controller/cmcd-controller.ts"),s=N("./src/utils/xhr-loader.ts"),r=N("./src/utils/fetch-loader.ts"),u=N("./src/utils/cues.ts"),o=N("./src/utils/mediakeys-helper.ts"),a=N("./src/utils/logger.ts");function n(){return n=Object.assign||function(h){for(var c=1;c<arguments.length;c++){var v=arguments[c];for(var p in v)Object.prototype.hasOwnProperty.call(v,p)&&(h[p]=v[p])}return h},n.apply(this,arguments)}function R(h,c){var v=Object.keys(h);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(h);c&&(p=p.filter(function(E){return Object.getOwnPropertyDescriptor(h,E).enumerable})),v.push.apply(v,p)}return v}function w(h){for(var c=1;c<arguments.length;c++){var v=arguments[c]!=null?arguments[c]:{};c%2?R(Object(v),!0).forEach(function(p){x(h,p,v[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(v)):R(Object(v)).forEach(function(p){Object.defineProperty(h,p,Object.getOwnPropertyDescriptor(v,p))})}return h}function x(h,c,v){return c in h?Object.defineProperty(h,c,{value:v,enumerable:!0,configurable:!0,writable:!0}):h[c]=v,h}var O=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:s.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:K.default,bufferController:k.default,capLevelController:b.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:o.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},C()),{},{subtitleStreamController:H.SubtitleStreamController,subtitleTrackController:P.default,timelineController:D.TimelineController,audioStreamController:A.default,audioTrackController:M.default,emeController:f.default,cmcdController:d.default});function C(){return{cueHandler:u.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 _(h,c){if((c.liveSyncDurationCount||c.liveMaxLatencyDurationCount)&&(c.liveSyncDuration||c.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(c.liveMaxLatencyDurationCount!==void 0&&(c.liveSyncDurationCount===void 0||c.liveMaxLatencyDurationCount<=c.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(c.liveMaxLatencyDuration!==void 0&&(c.liveSyncDuration===void 0||c.liveMaxLatencyDuration<=c.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return n({},h,c)}function y(h){var c=h.loader;if(c!==r.default&&c!==s.default)a.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),h.progressive=!1;else{var v=Object(r.fetchSupported)();v&&(h.loader=r.default,h.progressive=!0,h.enableSoftwareAES=!0,a.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(te,Y,N){"use strict";N.r(Y);var K=N("./src/polyfills/number.ts"),A=N("./src/utils/ewma-bandwidth-estimator.ts"),M=N("./src/events.ts"),H=N("./src/utils/buffer-helper.ts"),P=N("./src/errors.ts"),k=N("./src/types/loader.ts"),D=N("./src/utils/logger.ts");function b(d,s){for(var r=0;r<s.length;r++){var u=s[r];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(d,u.key,u)}}function m(d,s,r){return s&&b(d.prototype,s),r&&b(d,r),d}var f=function(){function d(r){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=r;var u=r.config;this.bwEstimator=new A.default(u.abrEwmaSlowVoD,u.abrEwmaFastVoD,u.abrEwmaDefaultEstimate),this.registerListeners()}var s=d.prototype;return s.registerListeners=function(){var u=this.hls;u.on(M.Events.FRAG_LOADING,this.onFragLoading,this),u.on(M.Events.FRAG_LOADED,this.onFragLoaded,this),u.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.on(M.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var u=this.hls;u.off(M.Events.FRAG_LOADING,this.onFragLoading,this),u.off(M.Events.FRAG_LOADED,this.onFragLoaded,this),u.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.off(M.Events.ERROR,this.onError,this)},s.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},s.onFragLoading=function(u,o){var a=o.frag;if(a.type===k.PlaylistLevelType.MAIN&&!this.timer){var n;this.fragCurrent=a,this.partCurrent=(n=o.part)!=null?n:null,this.timer=self.setInterval(this.onCheck,100)}},s.onLevelLoaded=function(u,o){var a=this.hls.config;o.details.live?this.bwEstimator.update(a.abrEwmaSlowLive,a.abrEwmaFastLive):this.bwEstimator.update(a.abrEwmaSlowVoD,a.abrEwmaFastVoD)},s._abandonRulesCheck=function(){var u=this.fragCurrent,o=this.partCurrent,a=this.hls,n=a.autoLevelEnabled,R=a.config,w=a.media;if(!u||!w)return;var x=o?o.stats:u.stats,O=o?o.duration:u.duration;if(x.aborted){D.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!n||w.paused||!w.playbackRate||!w.readyState)return;var C=performance.now()-x.loading.start,_=Math.abs(w.playbackRate);if(C<=500*O/_)return;var y=a.levels,h=a.minAutoLevel,c=y[u.level],v=x.total||Math.max(x.loaded,Math.round(O*c.maxBitrate/8)),p=Math.max(1,x.bwEstimate?x.bwEstimate/8:x.loaded*1e3/C),E=(v-x.loaded)/p,U=w.currentTime,F=(H.BufferHelper.bufferInfo(w,U,R.maxBufferHole).end-U)/_;if(F>=2*O/_||E<=F)return;var z=Number.POSITIVE_INFINITY,G;for(G=u.level-1;G>h;G--){var B=y[G].maxBitrate;if(z=O*B/(8*.8*p),z<F)break}if(z>=E)return;var T=this.bwEstimator.getEstimate();D.logger.warn("Fragment "+u.sn+(o?" part "+o.index:"")+" of level "+u.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+G+`
|
|
Current BW estimate: `+(Object(K.isFiniteNumber)(T)?(T/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+E.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+z.toFixed(3)+` s
|
|
Time to underbuffer: `+F.toFixed(3)+" s"),a.nextLoadLevel=G,this.bwEstimator.sample(C,x.loaded),this.clearTimer(),u.loader&&(this.fragCurrent=this.partCurrent=null,u.loader.abort()),a.trigger(M.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:u,part:o,stats:x})},s.onFragLoaded=function(u,o){var a=o.frag,n=o.part;if(a.type===k.PlaylistLevelType.MAIN&&Object(K.isFiniteNumber)(a.sn)){var R=n?n.stats:a.stats,w=n?n.duration:a.duration;if(this.clearTimer(),this.lastLoadedFragLevel=a.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var x=this.hls.levels[a.level],O=(x.loaded?x.loaded.bytes:0)+R.loaded,C=(x.loaded?x.loaded.duration:0)+w;x.loaded={bytes:O,duration:C},x.realBitrate=Math.round(8*O/C)}if(a.bitrateTest){var _={stats:R,frag:a,part:n,id:a.type};this.onFragBuffered(M.Events.FRAG_BUFFERED,_),a.bitrateTest=!1}}},s.onFragBuffered=function(u,o){var a=o.frag,n=o.part,R=n?n.stats:a.stats;if(R.aborted)return;if(a.type!==k.PlaylistLevelType.MAIN||a.sn==="initSegment")return;var w=R.parsing.end-R.loading.start;this.bwEstimator.sample(w,R.loaded),R.bwEstimate=this.bwEstimator.getEstimate(),a.bitrateTest?this.bitrateTestDelay=w/1e3:this.bitrateTestDelay=0},s.onError=function(u,o){switch(o.details){case P.ErrorDetails.FRAG_LOAD_ERROR:case P.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},s.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},s.getNextABRAutoLevel=function(){var u=this.fragCurrent,o=this.partCurrent,a=this.hls,n=a.maxAutoLevel,R=a.config,w=a.minAutoLevel,x=a.media,O=o?o.duration:u?u.duration:0,C=x?x.currentTime:0,_=x&&x.playbackRate!==0?Math.abs(x.playbackRate):1,y=this.bwEstimator?this.bwEstimator.getEstimate():R.abrEwmaDefaultEstimate,h=(H.BufferHelper.bufferInfo(x,C,R.maxBufferHole).end-C)/_,c=this.findBestLevel(y,w,n,h,R.abrBandWidthFactor,R.abrBandWidthUpFactor);if(c>=0)return c;D.logger.trace((h?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var v=O?Math.min(O,R.maxStarvationDelay):R.maxStarvationDelay,p=R.abrBandWidthFactor,E=R.abrBandWidthUpFactor;if(!h){var U=this.bitrateTestDelay;if(U){var F=O?Math.min(O,R.maxLoadingDelay):R.maxLoadingDelay;v=F-U,D.logger.trace("bitrate test took "+Math.round(1e3*U)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*v)+" ms"),p=E=1}}return c=this.findBestLevel(y,w,n,h+v,p,E),Math.max(c,0)},s.findBestLevel=function(u,o,a,n,R,w){for(var x,O=this.fragCurrent,C=this.partCurrent,_=this.lastLoadedFragLevel,y=this.hls.levels,h=y[_],c=!!(h!=null&&(x=h.details)!==null&&x!==void 0&&x.live),v=h==null?void 0:h.codecSet,p=C?C.duration:O?O.duration:0,E=a;E>=o;E--){var U=y[E];if(!U||v&&U.codecSet!==v)continue;var F=U.details,z=(C?F==null?void 0:F.partTarget:F==null?void 0:F.averagetargetduration)||p,G=void 0;E<=_?G=R*u:G=w*u;var B=y[E].maxBitrate,T=B*z/G;if(D.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+E+"/"+Math.round(G)+"/"+B+"/"+z+"/"+n+"/"+T),G>B&&(!T||c&&!this.bitrateTestDelay||T<n))return E}return-1},m(d,[{key:"nextAutoLevel",get:function(){var u=this._nextAutoLevel,o=this.bwEstimator;if(u!==-1&&(!o||!o.canEstimate()))return u;var a=this.getNextABRAutoLevel();return u!==-1&&(a=Math.min(u,a)),a},set:function(u){this._nextAutoLevel=u}}]),d}();Y.default=f},"./src/controller/audio-stream-controller.ts":function(te,Y,N){"use strict";N.r(Y);var K=N("./src/polyfills/number.ts"),A=N("./src/controller/base-stream-controller.ts"),M=N("./src/events.ts"),H=N("./src/utils/buffer-helper.ts"),P=N("./src/controller/fragment-tracker.ts"),k=N("./src/types/level.ts"),D=N("./src/types/loader.ts"),b=N("./src/loader/fragment.ts"),m=N("./src/demux/chunk-cache.ts"),f=N("./src/demux/transmuxer-interface.ts"),d=N("./src/types/transmuxer.ts"),s=N("./src/controller/fragment-finders.ts"),r=N("./src/utils/discontinuities.ts"),u=N("./src/errors.ts"),o=N("./src/utils/logger.ts");function a(){return a=Object.assign||function(O){for(var C=1;C<arguments.length;C++){var _=arguments[C];for(var y in _)Object.prototype.hasOwnProperty.call(_,y)&&(O[y]=_[y])}return O},a.apply(this,arguments)}function n(O,C){O.prototype=Object.create(C.prototype),O.prototype.constructor=O,R(O,C)}function R(O,C){return R=Object.setPrototypeOf||function(y,h){return y.__proto__=h,y},R(O,C)}var w=100,x=function(O){n(C,O);function C(y,h){var c;return c=O.call(this,y,h,"[audio-stream-controller]")||this,c.videoBuffer=null,c.videoTrackCC=-1,c.waitingVideoCC=-1,c.audioSwitch=!1,c.trackId=-1,c.waitingData=null,c.mainDetails=null,c.bufferFlushed=!1,c._registerListeners(),c}var _=C.prototype;return _.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},_._registerListeners=function(){var h=this.hls;h.on(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.on(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),h.on(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.on(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),h.on(M.Events.ERROR,this.onError,this),h.on(M.Events.BUFFER_RESET,this.onBufferReset,this),h.on(M.Events.BUFFER_CREATED,this.onBufferCreated,this),h.on(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.on(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),h.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_._unregisterListeners=function(){var h=this.hls;h.off(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.off(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),h.off(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.off(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),h.off(M.Events.ERROR,this.onError,this),h.off(M.Events.BUFFER_RESET,this.onBufferReset,this),h.off(M.Events.BUFFER_CREATED,this.onBufferCreated,this),h.off(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.off(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),h.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_.onInitPtsFound=function(h,c){var v=c.frag,p=c.id,E=c.initPTS;if(p==="main"){var U=v.cc;this.initPTS[v.cc]=E,this.log("InitPTS for cc: "+U+" found from main: "+E),this.videoTrackCC=U,this.state===A.State.WAITING_INIT_PTS&&this.tick()}},_.startLoad=function(h){if(!this.levels){this.startPosition=h,this.state=A.State.STOPPED;return}var c=this.lastCurrentTime;this.stopLoad(),this.setInterval(w),this.fragLoadError=0,c>0&&h===-1?(this.log("Override startPosition with lastCurrentTime @"+c.toFixed(3)),this.state=A.State.IDLE):(this.loadedmetadata=!1,this.state=A.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=h,this.tick()},_.doTick=function(){switch(this.state){case A.State.IDLE:this.doTickIdle();break;case A.State.WAITING_TRACK:{var h,c=this.levels,v=this.trackId,p=c==null||((h=c[v])===null||h===void 0)?void 0:h.details;if(p){if(this.waitForCdnTuneIn(p))break;this.state=A.State.WAITING_INIT_PTS}break}case A.State.FRAG_LOADING_WAITING_RETRY:{var E,U=performance.now(),F=this.retryDate;(!F||U>=F||(E=this.media)!==null&&E!==void 0&&E.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=A.State.IDLE);break}case A.State.WAITING_INIT_PTS:{var z=this.waitingData;if(z){var G=z.frag,B=z.part,T=z.cache,V=z.complete;if(this.initPTS[G.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=A.State.FRAG_LOADING;var Z=T.flush(),oe={frag:G,part:B,payload:Z,networkDetails:null};this._handleFragmentLoadProgress(oe),V&&O.prototype._handleFragmentLoadComplete.call(this,oe)}else if(this.videoTrackCC!==this.waitingVideoCC)o.logger.log("Waiting fragment cc ("+G.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var pe=this.getLoadPosition(),Ye=H.BufferHelper.bufferInfo(this.mediaBuffer,pe,this.config.maxBufferHole),xe=Object(s.fragmentWithinToleranceTest)(Ye.end,this.config.maxFragLookUpTolerance,G);xe<0&&(o.logger.log("Waiting fragment cc ("+G.cc+") @ "+G.start+" cancelled because another fragment at "+Ye.end+" is needed"),this.clearWaitingFragment())}}else this.state=A.State.IDLE}}this.onTickEnd()},_.clearWaitingFragment=function(){var h=this.waitingData;h&&(this.fragmentTracker.removeFragment(h.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=A.State.IDLE)},_.onTickEnd=function(){var h=this.media;if(!h||!h.readyState)return;var c=this.mediaBuffer?this.mediaBuffer:h,v=c.buffered;!this.loadedmetadata&&v.length&&(this.loadedmetadata=!0),this.lastCurrentTime=h.currentTime},_.doTickIdle=function(){var h,c,v=this.hls,p=this.levels,E=this.media,U=this.trackId,F=v.config;if(!p||!p[U])return;if(!E&&(this.startFragRequested||!F.startFragPrefetch))return;var z=p[U],G=z.details;if(!G||G.live&&this.levelLastLoaded!==U||this.waitForCdnTuneIn(G)){this.state=A.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,b.ElementaryStreamTypes.AUDIO,D.PlaylistLevelType.AUDIO));var B=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,D.PlaylistLevelType.AUDIO);if(B===null)return;var T=B.len,V=this.getMaxBufferLength(),Z=this.audioSwitch;if(T>=V&&!Z)return;if(!Z&&this._streamEnded(B,G)){v.trigger(M.Events.BUFFER_EOS,{type:"audio"}),this.state=A.State.ENDED;return}var oe=G.fragments,pe=oe[0].start,Ye=B.end;if(Z){var xe=this.getLoadPosition();Ye=xe,G.PTSKnown&&xe<pe&&((B.end>pe||B.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),E.currentTime=pe+.05))}var Ie=this.getNextFragment(Ye,G);if(!Ie){this.bufferFlushed=!0;return}((h=Ie.decryptdata)===null||h===void 0?void 0:h.keyFormat)==="identity"&&!((c=Ie.decryptdata)!==null&&c!==void 0&&c.key)?this.loadKey(Ie,G):this.loadFragment(Ie,G,Ye)},_.getMaxBufferLength=function(){var h=O.prototype.getMaxBufferLength.call(this),c=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,D.PlaylistLevelType.MAIN);return c===null?h:Math.max(h,c.len)},_.onMediaDetaching=function(){this.videoBuffer=null,O.prototype.onMediaDetaching.call(this)},_.onAudioTracksUpdated=function(h,c){var v=c.audioTracks;this.resetTransmuxer(),this.levels=v.map(function(p){return new k.Level(p)})},_.onAudioTrackSwitching=function(h,c){var v=!!c.url;this.trackId=c.id;var p=this.fragCurrent;p!=null&&p.loader&&p.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),v?this.setInterval(w):this.resetTransmuxer(),v?(this.audioSwitch=!0,this.state=A.State.IDLE):this.state=A.State.STOPPED,this.tick()},_.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},_.onLevelLoaded=function(h,c){this.mainDetails=c.details},_.onAudioTrackLoaded=function(h,c){var v,p=this.levels,E=c.details,U=c.id;if(!p){this.warn("Audio tracks were reset while loading level "+U);return}this.log("Track "+U+" loaded ["+E.startSN+","+E.endSN+"],duration:"+E.totalduration);var F=p[U],z=0;if(E.live||(v=F.details)!==null&&v!==void 0&&v.live){var G=this.mainDetails;if(E.fragments[0]||(E.deltaUpdateFailed=!0),E.deltaUpdateFailed||!G)return;!F.details&&E.hasProgramDateTime&&G.hasProgramDateTime?(Object(r.alignMediaPlaylistByPDT)(E,G),z=E.fragments[0].start):z=this.alignPlaylists(E,F.details)}F.details=E,this.levelLastLoaded=U,!this.startFragRequested&&(this.mainDetails||!E.live)&&this.setStartPosition(F.details,z),this.state===A.State.WAITING_TRACK&&!this.waitForCdnTuneIn(E)&&(this.state=A.State.IDLE),this.tick()},_._handleFragmentLoadProgress=function(h){var c,v=h.frag,p=h.part,E=h.payload,U=this.config,F=this.trackId,z=this.levels;if(!z){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+v.sn+" of level "+v.level+" will not be buffered");return}var G=z[F];console.assert(G,"Audio track is defined on fragment load progress");var B=G.details;console.assert(B,"Audio track details are defined on fragment load progress");var T=U.defaultAudioCodec||G.audioCodec||"mp4a.40.2",V=this.transmuxer;V||(V=this.transmuxer=new f.default(this.hls,D.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var Z=this.initPTS[v.cc],oe=(c=v.initSegment)===null||c===void 0?void 0:c.data;if(Z!==void 0){var pe=!1,Ye=p?p.index:-1,xe=Ye!==-1,Ie=new d.ChunkMetadata(v.level,v.sn,v.stats.chunkCount,E.byteLength,Ye,xe);V.push(E,oe,T,"",v,p,B.totalduration,pe,Ie,Z)}else{o.logger.log("Unknown video PTS for cc "+v.cc+", waiting for video PTS before demuxing audio frag "+v.sn+" of ["+B.startSN+" ,"+B.endSN+"],track "+F);var Je=this.waitingData=this.waitingData||{frag:v,part:p,cache:new m.default,complete:!1},Ke=Je.cache;Ke.push(new Uint8Array(E)),this.waitingVideoCC=this.videoTrackCC,this.state=A.State.WAITING_INIT_PTS}},_._handleFragmentLoadComplete=function(h){if(this.waitingData){this.waitingData.complete=!0;return}O.prototype._handleFragmentLoadComplete.call(this,h)},_.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},_.onBufferCreated=function(h,c){var v=c.tracks.audio;v&&(this.mediaBuffer=v.buffer),c.tracks.video&&(this.videoBuffer=c.tracks.video.buffer)},_.onFragBuffered=function(h,c){var v=c.frag,p=c.part;if(v.type!==D.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(v)){this.warn("Fragment "+v.sn+(p?" p: "+p.index:"")+" of level "+v.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}v.sn!=="initSegment"&&(this.fragPrevious=v,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(v,p)},_.onError=function(h,c){switch(c.details){case u.ErrorDetails.FRAG_LOAD_ERROR:case u.ErrorDetails.FRAG_LOAD_TIMEOUT:case u.ErrorDetails.KEY_LOAD_ERROR:case u.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.AUDIO,c);break;case u.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case u.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==A.State.ERROR&&this.state!==A.State.STOPPED&&(this.state=c.fatal?A.State.ERROR:A.State.IDLE,this.warn(c.details+" while loading frag, switching to "+this.state+" state"));break;case u.ErrorDetails.BUFFER_FULL_ERROR:if(c.parent==="audio"&&(this.state===A.State.PARSING||this.state===A.State.PARSED)){var v=!0,p=this.getFwdBufferInfo(this.mediaBuffer,D.PlaylistLevelType.AUDIO);p&&p.len>.5&&(v=!this.reduceMaxBufferLength(p.len)),v&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,O.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},_.onBufferFlushed=function(h,c){var v=c.type;v===b.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},_._handleTransmuxComplete=function(h){var c,v="audio",p=this.hls,E=h.remuxResult,U=h.chunkMeta,F=this.getCurrentContext(U);if(!F){this.warn("The loading context changed while buffering fragment "+U.sn+" of level "+U.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(U.level);return}var z=F.frag,G=F.part,B=E.audio,T=E.text,V=E.id3,Z=E.initSegment;if(this.fragContextChanged(z))return;if(this.state=A.State.PARSING,this.audioSwitch&&B&&this.completeAudioSwitch(),Z!=null&&Z.tracks&&(this._bufferInitSegment(Z.tracks,z,U),p.trigger(M.Events.FRAG_PARSING_INIT_SEGMENT,{frag:z,id:v,tracks:Z.tracks})),B){var oe=B.startPTS,pe=B.endPTS,Ye=B.startDTS,xe=B.endDTS;G&&(G.elementaryStreams[b.ElementaryStreamTypes.AUDIO]={startPTS:oe,endPTS:pe,startDTS:Ye,endDTS:xe}),z.setElementaryStreamInfo(b.ElementaryStreamTypes.AUDIO,oe,pe,Ye,xe),this.bufferFragmentData(B,z,G,U)}if(V!=null&&(c=V.samples)!==null&&c!==void 0&&c.length){var Ie=a({frag:z,id:v},V);p.trigger(M.Events.FRAG_PARSING_METADATA,Ie)}if(T){var Je=a({frag:z,id:v},T);p.trigger(M.Events.FRAG_PARSING_USERDATA,Je)}},_._bufferInitSegment=function(h,c,v){if(this.state!==A.State.PARSING)return;h.video&&delete h.video;var p=h.audio;if(!p)return;p.levelCodec=p.codec,p.id="audio",this.log("Init audio buffer, container:"+p.container+", codecs[parsed]=["+p.codec+"]"),this.hls.trigger(M.Events.BUFFER_CODECS,h);var E=p.initSegment;if(E!=null&&E.byteLength){var U={type:"audio",frag:c,part:null,chunkMeta:v,parent:c.type,data:E};this.hls.trigger(M.Events.BUFFER_APPENDING,U)}this.tick()},_.loadFragment=function(h,c,v){var p=this.fragmentTracker.getState(h);this.fragCurrent=h,(this.audioSwitch||p===P.FragmentState.NOT_LOADED||p===P.FragmentState.PARTIAL)&&(h.sn==="initSegment"?this._loadInitSegment(h):c.live&&!Object(K.isFiniteNumber)(this.initPTS[h.cc])?(this.log("Waiting for video PTS in continuity counter "+h.cc+" of live stream before loading audio fragment "+h.sn+" of level "+this.trackId),this.state=A.State.WAITING_INIT_PTS):(this.startFragRequested=!0,O.prototype.loadFragment.call(this,h,c,v)))},_.completeAudioSwitch=function(){var h=this.hls,c=this.media,v=this.trackId;c&&(this.log("Switching audio track : flushing all audio"),O.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,h.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:v})},C}(A.default);Y.default=x},"./src/controller/audio-track-controller.ts":function(te,Y,N){"use strict";N.r(Y);var K=N("./src/events.ts"),A=N("./src/errors.ts"),M=N("./src/controller/base-playlist-controller.ts"),H=N("./src/types/loader.ts");function P(f,d){for(var s=0;s<d.length;s++){var r=d[s];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(f,r.key,r)}}function k(f,d,s){return d&&P(f.prototype,d),s&&P(f,s),f}function D(f,d){f.prototype=Object.create(d.prototype),f.prototype.constructor=f,b(f,d)}function b(f,d){return b=Object.setPrototypeOf||function(r,u){return r.__proto__=u,r},b(f,d)}var m=function(f){D(d,f);function d(r){var u;return u=f.call(this,r,"[audio-track-controller]")||this,u.tracks=[],u.groupId=null,u.tracksInGroup=[],u.trackId=-1,u.trackName="",u.selectDefaultTrack=!0,u.registerListeners(),u}var s=d.prototype;return s.registerListeners=function(){var u=this.hls;u.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(K.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.on(K.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.on(K.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var u=this.hls;u.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(K.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(K.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.off(K.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.off(K.Events.ERROR,this.onError,this)},s.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,f.prototype.destroy.call(this)},s.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},s.onManifestParsed=function(u,o){this.tracks=o.audioTracks||[]},s.onAudioTrackLoaded=function(u,o){var a=o.id,n=o.details,R=this.tracksInGroup[a];if(!R){this.warn("Invalid audio track id "+a);return}var w=R.details;R.details=o.details,this.log("audioTrack "+a+" loaded ["+n.startSN+"-"+n.endSN+"]"),a===this.trackId&&(this.retryCount=0,this.playlistLoaded(a,o,w))},s.onLevelLoading=function(u,o){this.switchLevel(o.level)},s.onLevelSwitching=function(u,o){this.switchLevel(o.level)},s.switchLevel=function(u){var o=this.hls.levels[u];if(!(o!=null&&o.audioGroupIds))return;var a=o.audioGroupIds[o.urlId];if(this.groupId!==a){this.groupId=a;var n=this.tracks.filter(function(w){return!a||w.groupId===a});this.selectDefaultTrack&&!n.some(function(w){return w.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=n;var R={audioTracks:n};this.log("Updating audio tracks, "+n.length+' track(s) found in "'+a+'" group-id'),this.hls.trigger(K.Events.AUDIO_TRACKS_UPDATED,R),this.selectInitialTrack()}},s.onError=function(u,o){if(f.prototype.onError.call(this,u,o),o.fatal||!o.context)return;o.context.type===H.PlaylistContextType.AUDIO_TRACK&&o.context.id===this.trackId&&o.context.groupId===this.groupId&&this.retryLoadingOrFail(o)},s.setAudioTrack=function(u){var o=this.tracksInGroup;if(u<0||u>=o.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var a=o[this.trackId];this.log("Now switching to audio-track index "+u);var n=o[u],R=n.id,w=n.groupId,x=w===void 0?"":w,O=n.name,C=n.type,_=n.url;if(this.trackId=u,this.trackName=O,this.selectDefaultTrack=!1,this.hls.trigger(K.Events.AUDIO_TRACK_SWITCHING,{id:R,groupId:x,name:O,type:C,url:_}),n.details&&!n.details.live)return;var y=this.switchParams(n.url,a==null?void 0:a.details);this.loadPlaylist(y)},s.selectInitialTrack=function(){var u=this.tracksInGroup;console.assert(u.length,"Initial audio track should be selected when tracks are known");var o=this.trackName,a=this.findTrackId(o)||this.findTrackId();a!==-1?this.setAudioTrack(a):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(K.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},s.findTrackId=function(u){for(var o=this.tracksInGroup,a=0;a<o.length;a++){var n=o[a];if((!this.selectDefaultTrack||n.default)&&(!u||u===n.name))return n.id}return-1},s.loadPlaylist=function(u){var o=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(o)){var a=o.id,n=o.groupId,R=o.url;if(u)try{R=u.addDirectives(R)}catch(w){this.warn("Could not construct new URL with HLS Delivery Directives: "+w)}this.log("loading audio-track playlist for id: "+a),this.clearTimer(),this.hls.trigger(K.Events.AUDIO_TRACK_LOADING,{url:R,id:a,groupId:n,deliveryDirectives:u||null})}},k(d,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(u){this.selectDefaultTrack=!1,this.setAudioTrack(u)}}]),d}(M.default);Y.default=m},"./src/controller/base-playlist-controller.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return k});var K=N("./src/polyfills/number.ts"),A=N("./src/types/level.ts"),M=N("./src/controller/level-helper.ts"),H=N("./src/utils/logger.ts"),P=N("./src/errors.ts"),k=function(){function D(m,f){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,f+":"),this.warn=H.logger.warn.bind(H.logger,f+":"),this.hls=m}var b=D.prototype;return b.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},b.onError=function(f,d){d.fatal&&d.type===P.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},b.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},b.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},b.stopLoad=function(){this.canLoad=!1,this.clearTimer()},b.switchParams=function(f,d){var s=d==null?void 0:d.renditionReports;if(s)for(var r=0;r<s.length;r++){var u=s[r],o=""+u.URI;if(o===f.substr(-o.length)){var a=parseInt(u["LAST-MSN"]),n=parseInt(u["LAST-PART"]);if(d&&this.hls.config.lowLatencyMode){var R=Math.min(d.age-d.partTarget,d.targetduration);n!==void 0&&R>d.partTarget&&(n+=1)}if(Object(K.isFiniteNumber)(a))return new A.HlsUrlParameters(a,Object(K.isFiniteNumber)(n)?n:void 0,A.HlsSkip.No)}}},b.loadPlaylist=function(f){},b.shouldLoadTrack=function(f){return this.canLoad&&f&&!!f.url&&(!f.details||f.details.live)},b.playlistLoaded=function(f,d,s){var r=this,u=d.details,o=d.stats,a=o.loading.end?Math.max(0,self.performance.now()-o.loading.end):0;if(u.advancedDateTime=Date.now()-a,u.live||s!=null&&s.live){if(u.reloaded(s),s&&this.log("live playlist "+f+" "+(u.advanced?"REFRESHED "+u.lastPartSn+"-"+u.lastPartIndex:"MISSED")),s&&u.fragments.length>0&&Object(M.mergeDetails)(s,u),!this.canLoad||!u.live)return;var n,R=void 0,w=void 0;if(u.canBlockReload&&u.endSN&&u.advanced){var x=this.hls.config.lowLatencyMode,O=u.lastPartSn,C=u.endSN,_=u.lastPartIndex,y=_!==-1,h=O===C,c=x?0:_;y?(R=h?C+1:O,w=h?c:_+1):R=C+1;var v=u.age,p=v+u.ageHeader,E=Math.min(p-u.partTarget,u.targetduration*1.5);if(E>0){if(s&&E>s.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+s.tuneInGoal+" to: "+E+" with playlist age: "+u.age),E=0;else{var U=Math.floor(E/u.targetduration);if(R+=U,w!==void 0){var F=Math.round(E%u.targetduration/u.partTarget);w+=F}this.log("CDN Tune-in age: "+u.ageHeader+"s last advanced "+v.toFixed(2)+"s goal: "+E+" skip sn "+U+" to part "+w)}u.tuneInGoal=E}if(n=this.getDeliveryDirectives(u,d.deliveryDirectives,R,w),x||!h){this.loadPlaylist(n);return}}else n=this.getDeliveryDirectives(u,d.deliveryDirectives,R,w);var z=Object(M.computeReloadInterval)(u,o);R!==void 0&&u.canBlockReload&&(z-=u.partTarget||1),this.log("reload live playlist "+f+" in "+Math.round(z)+" ms"),this.timer=self.setTimeout(function(){return r.loadPlaylist(n)},z)}else this.clearTimer()},b.getDeliveryDirectives=function(f,d,s,r){var u=Object(A.getSkipValue)(f,s);return d!=null&&d.skip&&f.deltaUpdateFailed&&(s=d.msn,r=d.part,u=A.HlsSkip.No),new A.HlsUrlParameters(s,r,u)},b.retryLoadingOrFail=function(f){var d=this,s=this.hls.config,r=this.retryCount<s.levelLoadingMaxRetry;if(r){var u;if(this.retryCount++,f.details.indexOf("LoadTimeOut")>-1&&(u=f.context)!==null&&u!==void 0&&u.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+f.details+'"'),this.loadPlaylist();else{var o=Math.min(Math.pow(2,this.retryCount)*s.levelLoadingRetryDelay,s.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return d.loadPlaylist()},o),this.warn("retry playlist loading #"+this.retryCount+" in "+o+' ms after "'+f.details+'"')}}else this.warn('cannot recover from error "'+f.details+'"'),this.clearTimer(),f.fatal=!0;return r},D}()},"./src/controller/base-stream-controller.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"State",function(){return C}),N.d(Y,"default",function(){return _});var K=N("./src/polyfills/number.ts"),A=N("./src/task-loop.ts"),M=N("./src/controller/fragment-tracker.ts"),H=N("./src/utils/buffer-helper.ts"),P=N("./src/utils/logger.ts"),k=N("./src/events.ts"),D=N("./src/errors.ts"),b=N("./src/types/transmuxer.ts"),m=N("./src/utils/mp4-tools.ts"),f=N("./src/utils/discontinuities.ts"),d=N("./src/controller/fragment-finders.ts"),s=N("./src/controller/level-helper.ts"),r=N("./src/loader/fragment-loader.ts"),u=N("./src/crypt/decrypter.ts"),o=N("./src/utils/time-ranges.ts"),a=N("./src/types/loader.ts");function n(y,h){for(var c=0;c<h.length;c++){var v=h[c];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(y,v.key,v)}}function R(y,h,c){return h&&n(y.prototype,h),c&&n(y,c),y}function w(y){if(y===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y}function x(y,h){y.prototype=Object.create(h.prototype),y.prototype.constructor=y,O(y,h)}function O(y,h){return O=Object.setPrototypeOf||function(v,p){return v.__proto__=p,v},O(y,h)}var C={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},_=function(y){x(h,y);function h(v,p,E){var U;return U=y.call(this)||this,U.hls=void 0,U.fragPrevious=null,U.fragCurrent=null,U.fragmentTracker=void 0,U.transmuxer=null,U._state=C.STOPPED,U.media=void 0,U.mediaBuffer=void 0,U.config=void 0,U.bitrateTest=!1,U.lastCurrentTime=0,U.nextLoadPosition=0,U.startPosition=0,U.loadedmetadata=!1,U.fragLoadError=0,U.retryDate=0,U.levels=null,U.fragmentLoader=void 0,U.levelLastLoaded=null,U.startFragRequested=!1,U.decrypter=void 0,U.initPTS=[],U.onvseeking=null,U.onvended=null,U.logPrefix="",U.log=void 0,U.warn=void 0,U.logPrefix=E,U.log=P.logger.log.bind(P.logger,E+":"),U.warn=P.logger.warn.bind(P.logger,E+":"),U.hls=v,U.fragmentLoader=new r.default(v.config),U.fragmentTracker=p,U.config=v.config,U.decrypter=new u.default(v,v.config),v.on(k.Events.KEY_LOADED,U.onKeyLoaded,w(U)),U}var c=h.prototype;return c.doTick=function(){this.onTickEnd()},c.onTickEnd=function(){},c.startLoad=function(p){},c.stopLoad=function(){this.fragmentLoader.abort();var p=this.fragCurrent;p&&this.fragmentTracker.removeFragment(p),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=C.STOPPED},c._streamEnded=function(p,E){var U=this.fragCurrent,F=this.fragmentTracker;if(!E.live&&U&&U.sn===E.endSN&&!p.nextStart){var z=F.getState(U);return z===M.FragmentState.PARTIAL||z===M.FragmentState.OK}return!1},c.onMediaAttached=function(p,E){var U=this.media=this.mediaBuffer=E.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),U.addEventListener("seeking",this.onvseeking),U.addEventListener("ended",this.onvended);var F=this.config;this.levels&&F.autoStartLoad&&this.state===C.STOPPED&&this.startLoad(F.startPosition)},c.onMediaDetaching=function(){var p=this.media;p!=null&&p.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),p&&(p.removeEventListener("seeking",this.onvseeking),p.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},c.onMediaSeeking=function(){var p=this.config,E=this.fragCurrent,U=this.media,F=this.mediaBuffer,z=this.state,G=U?U.currentTime:0,B=H.BufferHelper.bufferInfo(F||U,G,p.maxBufferHole);if(this.log("media seeking to "+(Object(K.isFiniteNumber)(G)?G.toFixed(3):G)+", state: "+z),z===C.ENDED)this.resetLoadingState();else if(E&&!B.len){var T=p.maxFragLookUpTolerance,V=E.start-T,Z=E.start+E.duration+T,oe=G>Z;(G<V||oe)&&(oe&&E.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),E.loader.abort()),this.resetLoadingState())}U&&(this.lastCurrentTime=G),!this.loadedmetadata&&!B.len&&(this.nextLoadPosition=this.startPosition=G),this.tickImmediate()},c.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},c.onKeyLoaded=function(p,E){if(this.state!==C.KEY_LOADING||E.frag!==this.fragCurrent||!this.levels)return;this.state=C.IDLE;var U=this.levels[E.frag.level].details;U&&this.loadFragment(E.frag,U,E.frag.start)},c.onHandlerDestroying=function(){this.stopLoad(),y.prototype.onHandlerDestroying.call(this)},c.onHandlerDestroyed=function(){this.state=C.STOPPED,this.hls.off(k.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,y.prototype.onHandlerDestroyed.call(this)},c.loadKey=function(p,E){this.log("Loading key for "+p.sn+" of ["+E.startSN+"-"+E.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+p.level),this.state=C.KEY_LOADING,this.fragCurrent=p,this.hls.trigger(k.Events.KEY_LOADING,{frag:p})},c.loadFragment=function(p,E,U){this._loadFragForPlayback(p,E,U)},c._loadFragForPlayback=function(p,E,U){var F=this,z=function(B){if(F.fragContextChanged(p)){F.warn("Fragment "+p.sn+(B.part?" p: "+B.part.index:"")+" of level "+p.level+" was dropped during download."),F.fragmentTracker.removeFragment(p);return}p.stats.chunkCount++,F._handleFragmentLoadProgress(B)};this._doFragLoad(p,E,U,z).then(function(G){if(!G)return;F.fragLoadError=0;var B=F.state;if(F.fragContextChanged(p)){(B===C.FRAG_LOADING||B===C.BACKTRACKING||!F.fragCurrent&&B===C.PARSING)&&(F.fragmentTracker.removeFragment(p),F.state=C.IDLE);return}if("payload"in G&&(F.log("Loaded fragment "+p.sn+" of level "+p.level),F.hls.trigger(k.Events.FRAG_LOADED,G),F.state===C.BACKTRACKING)){F.fragmentTracker.backtrack(p,G),F.resetFragmentLoading(p);return}F._handleFragmentLoadComplete(G)}).catch(function(G){F.warn(G),F.resetFragmentLoading(p)})},c.flushMainBuffer=function(p,E,U){if(U===void 0&&(U=null),!(p-E))return;var F={startOffset:p,endOffset:E,type:U};this.fragLoadError=0,this.hls.trigger(k.Events.BUFFER_FLUSHING,F)},c._loadInitSegment=function(p){var E=this;this._doFragLoad(p).then(function(U){if(!U||E.fragContextChanged(p)||!E.levels)throw new Error("init load aborted");return U}).then(function(U){var F=E.hls,z=U.payload,G=p.decryptdata;if(z&&z.byteLength>0&&G&&G.key&&G.iv&&G.method==="AES-128"){var B=self.performance.now();return E.decrypter.webCryptoDecrypt(new Uint8Array(z),G.key.buffer,G.iv.buffer).then(function(T){var V=self.performance.now();return F.trigger(k.Events.FRAG_DECRYPTED,{frag:p,payload:T,stats:{tstart:B,tdecrypt:V}}),U.payload=T,U})}return U}).then(function(U){var F=E.fragCurrent,z=E.hls,G=E.levels;if(!G)throw new Error("init load aborted, missing levels");var B=G[p.level].details;console.assert(B,"Level details are defined when init segment is loaded");var T=p.stats;E.state=C.IDLE,E.fragLoadError=0,p.data=new Uint8Array(U.payload),T.parsing.start=T.buffering.start=self.performance.now(),T.parsing.end=T.buffering.end=self.performance.now(),U.frag===F&&z.trigger(k.Events.FRAG_BUFFERED,{stats:T,frag:F,part:null,id:p.type}),E.tick()}).catch(function(U){E.warn(U),E.resetFragmentLoading(p)})},c.fragContextChanged=function(p){var E=this.fragCurrent;return!p||!E||p.level!==E.level||p.sn!==E.sn||p.urlId!==E.urlId},c.fragBufferedComplete=function(p,E){var U=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+p.type+" sn: "+p.sn+(E?" part: "+E.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+p.level+" "+o.default.toString(H.BufferHelper.getBuffered(U))),this.state=C.IDLE,this.tick()},c._handleFragmentLoadComplete=function(p){var E=this.transmuxer;if(!E)return;var U=p.frag,F=p.part,z=p.partsLoaded,G=!z||z.length===0||z.some(function(T){return!T}),B=new b.ChunkMetadata(U.level,U.sn,U.stats.chunkCount+1,0,F?F.index:-1,!G);E.flush(B)},c._handleFragmentLoadProgress=function(p){},c._doFragLoad=function(p,E,U,F){var z=this;if(U===void 0&&(U=null),!this.levels)throw new Error("frag load aborted, missing levels");if(U=Math.max(p.start,U||0),this.config.lowLatencyMode&&E){var G=E.partList;if(G&&F){U>p.end&&E.fragmentHint&&(p=E.fragmentHint);var B=this.getNextPart(G,p,U);if(B>-1){var T=G[B];return this.log("Loading part sn: "+p.sn+" p: "+T.index+" cc: "+p.cc+" of playlist ["+E.startSN+"-"+E.endSN+"] parts [0-"+B+"-"+(G.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+p.level+", target: "+parseFloat(U.toFixed(3))),this.nextLoadPosition=T.start+T.duration,this.state=C.FRAG_LOADING,this.hls.trigger(k.Events.FRAG_LOADING,{frag:p,part:G[B],targetBufferTime:U}),this.doFragPartsLoad(p,G,B,F).catch(function(V){return z.handleFragLoadError(V)})}else if(!p.url||this.loadedEndOfParts(G,U))return Promise.resolve(null)}}return this.log("Loading fragment "+p.sn+" cc: "+p.cc+" "+(E?"of ["+E.startSN+"-"+E.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+p.level+", target: "+parseFloat(U.toFixed(3))),Object(K.isFiniteNumber)(p.sn)&&!this.bitrateTest&&(this.nextLoadPosition=p.start+p.duration),this.state=C.FRAG_LOADING,this.hls.trigger(k.Events.FRAG_LOADING,{frag:p,targetBufferTime:U}),this.fragmentLoader.load(p,F).catch(function(V){return z.handleFragLoadError(V)})},c.doFragPartsLoad=function(p,E,U,F){var z=this;return new Promise(function(G,B){var T=[],V=function Z(oe){var pe=E[oe];z.fragmentLoader.loadPart(p,pe,F).then(function(Ye){T[pe.index]=Ye;var xe=Ye.part;z.hls.trigger(k.Events.FRAG_LOADED,Ye);var Ie=E[oe+1];if(Ie&&Ie.fragment===p)Z(oe+1);else return G({frag:p,part:xe,partsLoaded:T})}).catch(B)};V(U)})},c.handleFragLoadError=function(p){var E=p.data;return E&&E.details===D.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(E.frag,E.part):this.hls.trigger(k.Events.ERROR,E),null},c._handleTransmuxerFlush=function(p){var E=this.getCurrentContext(p);if(!E||this.state!==C.PARSING){this.fragCurrent||(this.state=C.IDLE);return}var U=E.frag,F=E.part,z=E.level,G=self.performance.now();U.stats.parsing.end=G,F&&(F.stats.parsing.end=G),this.updateLevelTiming(U,F,z,p.partial)},c.getCurrentContext=function(p){var E=this.levels,U=p.level,F=p.sn,z=p.part;if(!E||!E[U])return this.warn("Levels object was unset while buffering fragment "+F+" of level "+U+". The current chunk will not be buffered."),null;var G=E[U],B=z>-1?Object(s.getPartWith)(G,F,z):null,T=B?B.fragment:Object(s.getFragmentWithSN)(G,F,this.fragCurrent);return T?{frag:T,part:B,level:G}:null},c.bufferFragmentData=function(p,E,U,F){if(!p||this.state!==C.PARSING)return;var z=p.data1,G=p.data2,B=z;if(z&&G&&(B=Object(m.appendUint8Array)(z,G)),!B||!B.length)return;var T={type:p.type,frag:E,part:U,chunkMeta:F,parent:E.type,data:B};this.hls.trigger(k.Events.BUFFER_APPENDING,T),p.dropped&&p.independent&&!U&&this.flushBufferGap(E)},c.flushBufferGap=function(p){var E=this.media;if(!E)return;if(!H.BufferHelper.isBuffered(E,E.currentTime)){this.flushMainBuffer(0,p.start);return}var U=E.currentTime,F=H.BufferHelper.bufferInfo(E,U,0),z=p.duration,G=Math.min(this.config.maxFragLookUpTolerance*2,z*.25),B=Math.max(Math.min(p.start-G,F.end-G),U+G);p.start-B>G&&this.flushMainBuffer(B,p.start)},c.getFwdBufferInfo=function(p,E){var U=this.config,F=this.getLoadPosition();if(!Object(K.isFiniteNumber)(F))return null;var z=H.BufferHelper.bufferInfo(p,F,U.maxBufferHole);if(z.len===0&&z.nextStart!==void 0){var G=this.fragmentTracker.getBufferedFrag(F,E);if(G&&z.nextStart<G.end)return H.BufferHelper.bufferInfo(p,F,Math.max(z.nextStart,U.maxBufferHole))}return z},c.getMaxBufferLength=function(p){var E=this.config,U;return p?U=Math.max(8*E.maxBufferSize/p,E.maxBufferLength):U=E.maxBufferLength,Math.min(U,E.maxMaxBufferLength)},c.reduceMaxBufferLength=function(p){var E=this.config,U=p||E.maxBufferLength;return E.maxMaxBufferLength>=U?(E.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+E.maxMaxBufferLength+"s"),!0):!1},c.getNextFragment=function(p,E){var U,F,z=E.fragments,G=z.length;if(!G)return null;var B=this.config,T=z[0].start,V;if(E.live){var Z=B.initialLiveManifestSize;if(G<Z)return this.warn("Not enough fragments to start playback (have: "+G+", need: "+Z+")"),null;!E.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(V=this.getInitialLiveFragment(E,z),this.startPosition=V?this.hls.liveSyncPosition||V.start:p)}else p<=T&&(V=z[0]);if(!V){var oe=B.lowLatencyMode?E.partEnd:E.fragmentEnd;V=this.getFragmentAtPosition(p,oe,E)}return(U=V)!==null&&U!==void 0&&U.initSegment&&!((F=V)!==null&&F!==void 0&&F.initSegment.data)&&!this.bitrateTest&&(V=V.initSegment),V},c.getNextPart=function(p,E,U){for(var F=-1,z=!1,G=!0,B=0,T=p.length;B<T;B++){var V=p[B];if(G=G&&!V.independent,F>-1&&U<V.start)break;var Z=V.loaded;!Z&&(z||V.independent||G)&&V.fragment===E&&(F=B),z=Z}return F},c.loadedEndOfParts=function(p,E){var U=p[p.length-1];return U&&E>U.start&&U.loaded},c.getInitialLiveFragment=function(p,E){var U=this.fragPrevious,F=null;if(U){if(p.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+U.programDateTime),F=Object(d.findFragmentByPDT)(E,U.endProgramDateTime,this.config.maxFragLookUpTolerance)),!F){var z=U.sn+1;if(z>=p.startSN&&z<=p.endSN){var G=E[z-p.startSN];U.cc===G.cc&&(F=G,this.log("Live playlist, switching playlist, load frag with next SN: "+F.sn))}F||(F=Object(d.findFragWithCC)(E,U.cc),F&&this.log("Live playlist, switching playlist, load frag with same CC: "+F.sn))}}else{var B=this.hls.liveSyncPosition;B!==null&&(F=this.getFragmentAtPosition(B,this.bitrateTest?p.fragmentEnd:p.edge,p))}return F},c.getFragmentAtPosition=function(p,E,U){var F=this.config,z=this.fragPrevious,G=U.fragments,B=U.endSN,T=U.fragmentHint,V=F.maxFragLookUpTolerance,Z=!!(F.lowLatencyMode&&U.partList&&T);Z&&T&&!this.bitrateTest&&(G=G.concat(T),B=T.sn);var oe;if(p<E){var pe=p>E-V?0:V;oe=Object(d.findFragmentByPTS)(z,G,p,pe)}else oe=G[G.length-1];if(oe){var Ye=oe.sn-U.startSN,xe=z&&oe.level===z.level,Ie=G[Ye+1],Je=this.fragmentTracker.getState(oe);if(Je===M.FragmentState.BACKTRACKED){oe=null;for(var Ke=Ye;G[Ke]&&this.fragmentTracker.getState(G[Ke])===M.FragmentState.BACKTRACKED;)z?oe=G[Ke--]:oe=G[--Ke];oe||(oe=Ie)}else z&&oe.sn===z.sn&&!Z&&(xe&&(oe.sn<B&&this.fragmentTracker.getState(Ie)!==M.FragmentState.OK?(this.log("SN "+oe.sn+" just loaded, load next one: "+Ie.sn),oe=Ie):oe=null))}return oe},c.synchronizeToLiveEdge=function(p){var E=this.config,U=this.media;if(!U)return;var F=this.hls.liveSyncPosition,z=U.currentTime,G=p.fragments[0].start,B=p.edge,T=z>=G-E.maxFragLookUpTolerance&&z<=B;if(F!==null&&U.duration>F&&(z<F||!T)){var V=E.liveMaxLatencyDuration!==void 0?E.liveMaxLatencyDuration:E.liveMaxLatencyDurationCount*p.targetduration;(!T&&U.readyState<4||z<B-V)&&(this.loadedmetadata||(this.nextLoadPosition=F),U.readyState&&(this.warn("Playback: "+z.toFixed(3)+" is located too far from the end of live sliding playlist: "+B+", reset currentTime to : "+F.toFixed(3)),U.currentTime=F))}},c.alignPlaylists=function(p,E){var U=this.levels,F=this.levelLastLoaded,z=this.fragPrevious,G=F!==null?U[F]:null,B=p.fragments.length;if(!B)return this.warn("No fragments in live playlist"),0;var T=p.fragments[0].start,V=!E,Z=p.alignedSliding&&Object(K.isFiniteNumber)(T);if(V||!Z&&!T){Object(f.alignStream)(z,G,p);var oe=p.fragments[0].start;return this.log("Live playlist sliding: "+oe.toFixed(2)+" start-sn: "+(E?E.startSN:"na")+"->"+p.startSN+" prev-sn: "+(z?z.sn:"na")+" fragments: "+B),oe}return T},c.waitForCdnTuneIn=function(p){var E=3;return p.live&&p.canBlockReload&&p.tuneInGoal>Math.max(p.partHoldBack,p.partTarget*E)},c.setStartPosition=function(p,E){var U=this.startPosition;if(U<E&&(U=-1),U===-1||this.lastCurrentTime===-1){var F=p.startTimeOffset;Object(K.isFiniteNumber)(F)?(U=E+F,F<0&&(U+=p.totalduration),U=Math.min(Math.max(E,U),E+p.totalduration),this.log("Start time offset "+F+" found in playlist, adjust startPosition to "+U),this.startPosition=U):p.live?U=this.hls.liveSyncPosition||E:this.startPosition=U=0,this.lastCurrentTime=U}this.nextLoadPosition=U},c.getLoadPosition=function(){var p=this.media,E=0;return this.loadedmetadata&&p?E=p.currentTime:this.nextLoadPosition&&(E=this.nextLoadPosition),E},c.handleFragLoadAborted=function(p,E){this.transmuxer&&p.sn!=="initSegment"&&p.stats.aborted&&(this.warn("Fragment "+p.sn+(E?" part"+E.index:"")+" of level "+p.level+" was aborted"),this.resetFragmentLoading(p))},c.resetFragmentLoading=function(p){(!this.fragCurrent||!this.fragContextChanged(p))&&(this.state=C.IDLE)},c.onFragmentOrKeyLoadError=function(p,E){if(E.fatal)return;var U=E.frag;if(!U||U.type!==p)return;var F=this.fragCurrent;console.assert(F&&U.sn===F.sn&&U.level===F.level&&U.urlId===F.urlId,"Frag load error must match current frag to retry");var z=this.config;if(this.fragLoadError+1<=z.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(U.level))return;var G=Math.min(Math.pow(2,this.fragLoadError)*z.fragLoadingRetryDelay,z.fragLoadingMaxRetryTimeout);this.warn("Fragment "+U.sn+" of "+p+" "+U.level+" failed to load, retrying in "+G+"ms"),this.retryDate=self.performance.now()+G,this.fragLoadError++,this.state=C.FRAG_LOADING_WAITING_RETRY}else E.levelRetry?(p===a.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=C.IDLE):(P.logger.error(E.details+" reaches max retry, redispatch as fatal ..."),E.fatal=!0,this.hls.stopLoad(),this.state=C.ERROR)},c.afterBufferFlushed=function(p,E,U){if(!p)return;var F=H.BufferHelper.getBuffered(p);this.fragmentTracker.detectEvictedFragments(E,F,U),this.state===C.ENDED&&this.resetLoadingState()},c.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=C.IDLE},c.resetLiveStartWhenNotLoaded=function(p){if(!this.loadedmetadata){this.startFragRequested=!1;var E=this.levels?this.levels[p].details:null;if(E!=null&&E.live)return this.startPosition=-1,this.setStartPosition(E,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},c.updateLevelTiming=function(p,E,U,F){var z=this,G=U.details;console.assert(!!G,"level.details must be defined");var B=Object.keys(p.elementaryStreams).reduce(function(T,V){var Z=p.elementaryStreams[V];if(Z){var oe=Z.endPTS-Z.startPTS;if(oe<=0)return z.warn("Could not parse fragment "+p.sn+" "+V+" duration reliably ("+oe+") resetting transmuxer to fallback to playlist timing"),z.resetTransmuxer(),T||!1;var pe=F?0:Object(s.updateFragPTSDTS)(G,p,Z.startPTS,Z.endPTS,Z.startDTS,Z.endDTS);return z.hls.trigger(k.Events.LEVEL_PTS_UPDATED,{details:G,level:U,drift:pe,type:V,frag:p,start:Z.startPTS,end:Z.endPTS}),!0}return T},!1);B?(this.state=C.PARSED,this.hls.trigger(k.Events.FRAG_PARSED,{frag:p,part:E})):this.resetLoadingState()},c.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},R(h,[{key:"state",get:function(){return this._state},set:function(p){var E=this._state;E!==p&&(this._state=p,this.log(E+"->"+p))}}]),h}(A.default)},"./src/controller/buffer-controller.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return d});var K=N("./src/polyfills/number.ts"),A=N("./src/events.ts"),M=N("./src/utils/logger.ts"),H=N("./src/errors.ts"),P=N("./src/utils/buffer-helper.ts"),k=N("./src/utils/mediasource-helper.ts"),D=N("./src/loader/fragment.ts"),b=N("./src/controller/buffer-operation-queue.ts"),m=Object(k.getMediaSource)(),f=/([ha]vc.)(?:\.[^.,]+)+/,d=function(){function s(u){var o=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var a=o.hls,n=o.media,R=o.mediaSource;M.logger.log("[buffer-controller]: Media source opened"),n&&(o.updateMediaElementDuration(),a.trigger(A.Events.MEDIA_ATTACHED,{media:n})),R&&R.removeEventListener("sourceopen",o._onMediaSourceOpen),o.checkPendingTracks()},this._onMediaSourceClose=function(){M.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){M.logger.log("[buffer-controller]: Media source ended")},this.hls=u,this._initSourceBuffer(),this.registerListeners()}var r=s.prototype;return r.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},r.destroy=function(){this.unregisterListeners(),this.details=null},r.registerListeners=function(){var o=this.hls;o.on(A.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.on(A.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(A.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(A.Events.BUFFER_RESET,this.onBufferReset,this),o.on(A.Events.BUFFER_APPENDING,this.onBufferAppending,this),o.on(A.Events.BUFFER_CODECS,this.onBufferCodecs,this),o.on(A.Events.BUFFER_EOS,this.onBufferEos,this),o.on(A.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),o.on(A.Events.LEVEL_UPDATED,this.onLevelUpdated,this),o.on(A.Events.FRAG_PARSED,this.onFragParsed,this),o.on(A.Events.FRAG_CHANGED,this.onFragChanged,this)},r.unregisterListeners=function(){var o=this.hls;o.off(A.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.off(A.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(A.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(A.Events.BUFFER_RESET,this.onBufferReset,this),o.off(A.Events.BUFFER_APPENDING,this.onBufferAppending,this),o.off(A.Events.BUFFER_CODECS,this.onBufferCodecs,this),o.off(A.Events.BUFFER_EOS,this.onBufferEos,this),o.off(A.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),o.off(A.Events.LEVEL_UPDATED,this.onLevelUpdated,this),o.off(A.Events.FRAG_PARSED,this.onFragParsed,this),o.off(A.Events.FRAG_CHANGED,this.onFragChanged,this)},r._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new b.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},r.onManifestParsed=function(o,a){var n=2;(a.audio&&!a.video||!a.altAudio)&&(n=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=n,this.details=null,M.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},r.onMediaAttaching=function(o,a){var n=this.media=a.media;if(n&&m){var R=this.mediaSource=new m;R.addEventListener("sourceopen",this._onMediaSourceOpen),R.addEventListener("sourceended",this._onMediaSourceEnded),R.addEventListener("sourceclose",this._onMediaSourceClose),n.src=self.URL.createObjectURL(R),this._objectUrl=n.src}},r.onMediaDetaching=function(){var o=this.media,a=this.mediaSource,n=this._objectUrl;if(a){if(M.logger.log("[buffer-controller]: media source detaching"),a.readyState==="open")try{a.endOfStream()}catch(R){M.logger.warn("[buffer-controller]: onMediaDetaching: "+R.message+" while calling endOfStream")}this.onBufferReset(),a.removeEventListener("sourceopen",this._onMediaSourceOpen),a.removeEventListener("sourceended",this._onMediaSourceEnded),a.removeEventListener("sourceclose",this._onMediaSourceClose),o&&(n&&self.URL.revokeObjectURL(n),o.src===n?(o.removeAttribute("src"),o.load()):M.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(A.Events.MEDIA_DETACHED,void 0)},r.onBufferReset=function(){var o=this;this.getSourceBufferTypes().forEach(function(a){var n=o.sourceBuffer[a];try{n&&(o.removeBufferListeners(a),o.mediaSource&&o.mediaSource.removeSourceBuffer(n),o.sourceBuffer[a]=void 0)}catch(R){M.logger.warn("[buffer-controller]: Failed to reset the "+a+" buffer",R)}}),this._initSourceBuffer()},r.onBufferCodecs=function(o,a){var n=this,R=this.getSourceBufferTypes().length;if(Object.keys(a).forEach(function(w){if(R){var x=n.tracks[w];if(x&&typeof x.buffer.changeType=="function"){var O=a[w],C=O.codec,_=O.levelCodec,y=O.container,h=(x.levelCodec||x.codec).replace(f,"$1"),c=(_||C).replace(f,"$1");if(h!==c){var v=y+";codecs="+(_||C);n.appendChangeType(w,v)}}}else n.pendingTracks[w]=a[w]}),R)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},r.appendChangeType=function(o,a){var n=this,R=this.operationQueue,w={execute:function(){var O=n.sourceBuffer[o];O&&(M.logger.log("[buffer-controller]: changing "+o+" sourceBuffer type to "+a),O.changeType(a)),R.shiftAndExecuteNext(o)},onStart:function(){},onComplete:function(){},onError:function(O){M.logger.warn("[buffer-controller]: Failed to change "+o+" SourceBuffer type",O)}};R.append(w,o)},r.onBufferAppending=function(o,a){var n=this,R=this.hls,w=this.operationQueue,x=this.tracks,O=a.data,C=a.type,_=a.frag,y=a.part,h=a.chunkMeta,c=h.buffering[C],v=self.performance.now();c.start=v;var p=_.stats.buffering,E=y?y.stats.buffering:null;p.start===0&&(p.start=v),E&&E.start===0&&(E.start=v);var U=x.audio,F=C==="audio"&&h.id===1&&(U==null?void 0:U.container)==="audio/mpeg",z={execute:function(){if(c.executeStart=self.performance.now(),F){var B=n.sourceBuffer[C];if(B){var T=_.start-B.timestampOffset;Math.abs(T)>=.1&&(M.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+_.start+" (delta: "+T+") sn: "+_.sn+")"),B.timestampOffset=_.start)}}n.appendExecutor(O,C)},onStart:function(){},onComplete:function(){var B=self.performance.now();c.executeEnd=c.end=B,p.first===0&&(p.first=B),E&&E.first===0&&(E.first=B);var T=n.sourceBuffer,V={};for(var Z in T)V[Z]=P.BufferHelper.getBuffered(T[Z]);n.appendError=0,n.hls.trigger(A.Events.BUFFER_APPENDED,{type:C,frag:_,part:y,chunkMeta:h,parent:_.type,timeRanges:V})},onError:function(B){M.logger.error("[buffer-controller]: Error encountered while trying to append to the "+C+" SourceBuffer",B);var T={type:H.ErrorTypes.MEDIA_ERROR,parent:_.type,details:H.ErrorDetails.BUFFER_APPEND_ERROR,err:B,fatal:!1};B.code===DOMException.QUOTA_EXCEEDED_ERR?T.details=H.ErrorDetails.BUFFER_FULL_ERROR:(n.appendError++,T.details=H.ErrorDetails.BUFFER_APPEND_ERROR,n.appendError>R.config.appendErrorMaxRetry&&(M.logger.error("[buffer-controller]: Failed "+R.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),T.fatal=!0)),R.trigger(A.Events.ERROR,T)}};w.append(z,C)},r.onBufferFlushing=function(o,a){var n=this,R=this.operationQueue,w=function(O){return{execute:n.removeExecutor.bind(n,O,a.startOffset,a.endOffset),onStart:function(){},onComplete:function(){n.hls.trigger(A.Events.BUFFER_FLUSHED,{type:O})},onError:function(_){M.logger.warn("[buffer-controller]: Failed to remove from "+O+" SourceBuffer",_)}}};a.type?R.append(w(a.type),a.type):this.getSourceBufferTypes().forEach(function(x){R.append(w(x),x)})},r.onFragParsed=function(o,a){var n=this,R=a.frag,w=a.part,x=[],O=w?w.elementaryStreams:R.elementaryStreams;O[D.ElementaryStreamTypes.AUDIOVIDEO]?x.push("audiovideo"):(O[D.ElementaryStreamTypes.AUDIO]&&x.push("audio"),O[D.ElementaryStreamTypes.VIDEO]&&x.push("video"));var C=function(){var y=self.performance.now();R.stats.buffering.end=y,w&&(w.stats.buffering.end=y);var h=w?w.stats:R.stats;n.hls.trigger(A.Events.FRAG_BUFFERED,{frag:R,part:w,stats:h,id:R.type})};x.length===0&&M.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+R.type+" level: "+R.level+" sn: "+R.sn),this.blockBuffers(C,x)},r.onFragChanged=function(o,a){this.flushBackBuffer()},r.onBufferEos=function(o,a){var n=this,R=this.getSourceBufferTypes().reduce(function(w,x){var O=n.sourceBuffer[x];return(!a.type||a.type===x)&&(O&&!O.ended&&(O.ended=!0,M.logger.log("[buffer-controller]: "+x+" sourceBuffer now EOS"))),w&&!!(!O||O.ended)},!0);R&&this.blockBuffers(function(){var w=n.mediaSource;if(!w||w.readyState!=="open")return;w.endOfStream()})},r.onLevelUpdated=function(o,a){var n=a.details;if(!n.fragments.length)return;this.details=n,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},r.flushBackBuffer=function(){var o=this.hls,a=this.details,n=this.media,R=this.sourceBuffer;if(!n||a===null)return;var w=this.getSourceBufferTypes();if(!w.length)return;var x=a.live&&o.config.liveBackBufferLength!==null?o.config.liveBackBufferLength:o.config.backBufferLength;if(!Object(K.isFiniteNumber)(x)||x<0)return;var O=n.currentTime,C=a.levelTargetDuration,_=Math.max(x,C),y=Math.floor(O/C)*C-_;w.forEach(function(h){var c=R[h];if(c){var v=P.BufferHelper.getBuffered(c);v.length>0&&y>v.start(0)&&(o.trigger(A.Events.BACK_BUFFER_REACHED,{bufferEnd:y}),a.live&&o.trigger(A.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:y}),o.trigger(A.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:y,type:h}))}})},r.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var o=this.details,a=this.hls,n=this.media,R=this.mediaSource,w=o.fragments[0].start+o.totalduration,x=n.duration,O=Object(K.isFiniteNumber)(R.duration)?R.duration:0;o.live&&a.config.liveDurationInfinity?(M.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),R.duration=Infinity,this.updateSeekableRange(o)):(w>O&&w>x||!Object(K.isFiniteNumber)(x))&&(M.logger.log("[buffer-controller]: Updating Media Source duration to "+w.toFixed(3)),R.duration=w)},r.updateSeekableRange=function(o){var a=this.mediaSource,n=o.fragments,R=n.length;if(R&&o.live&&a!==null&&a!==void 0&&a.setLiveSeekableRange){var w=Math.max(0,n[0].start),x=Math.max(w,w+o.totalduration);a.setLiveSeekableRange(w,x)}},r.checkPendingTracks=function(){var o=this.bufferCodecEventsExpected,a=this.operationQueue,n=this.pendingTracks,R=Object.keys(n).length;if(R&&!o||R===2){this.createSourceBuffers(n),this.pendingTracks={};var w=this.getSourceBufferTypes();if(w.length===0){this.hls.trigger(A.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(x){a.executeNext(x)})}},r.createSourceBuffers=function(o){var a=this.sourceBuffer,n=this.mediaSource;if(!n)throw Error("createSourceBuffers called when mediaSource was null");var R=0;for(var w in o)if(!a[w]){var x=o[w];if(!x)throw Error("source buffer exists for track "+w+", however track does not");var O=x.levelCodec||x.codec,C=x.container+";codecs="+O;M.logger.log("[buffer-controller]: creating sourceBuffer("+C+")");try{var _=a[w]=n.addSourceBuffer(C),y=w;this.addBufferListener(y,"updatestart",this._onSBUpdateStart),this.addBufferListener(y,"updateend",this._onSBUpdateEnd),this.addBufferListener(y,"error",this._onSBUpdateError),this.tracks[w]={buffer:_,codec:O,container:x.container,levelCodec:x.levelCodec,id:x.id},R++}catch(h){M.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+h.message),this.hls.trigger(A.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:h,mimeType:C})}}R&&this.hls.trigger(A.Events.BUFFER_CREATED,{tracks:this.tracks})},r._onSBUpdateStart=function(o){var a=this.operationQueue,n=a.current(o);n.onStart()},r._onSBUpdateEnd=function(o){var a=this.operationQueue,n=a.current(o);n.onComplete(),a.shiftAndExecuteNext(o)},r._onSBUpdateError=function(o,a){M.logger.error("[buffer-controller]: "+o+" SourceBuffer error",a),this.hls.trigger(A.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var n=this.operationQueue.current(o);n&&n.onError(a)},r.removeExecutor=function(o,a,n){var R=this.media,w=this.mediaSource,x=this.operationQueue,O=this.sourceBuffer,C=O[o];if(!R||!w||!C){M.logger.warn("[buffer-controller]: Attempting to remove from the "+o+" SourceBuffer, but it does not exist"),x.shiftAndExecuteNext(o);return}var _=Object(K.isFiniteNumber)(R.duration)?R.duration:Infinity,y=Object(K.isFiniteNumber)(w.duration)?w.duration:Infinity,h=Math.max(0,a),c=Math.min(n,_,y);c>h?(M.logger.log("[buffer-controller]: Removing ["+h+","+c+"] from the "+o+" SourceBuffer"),console.assert(!C.updating,o+" sourceBuffer must not be updating"),C.remove(h,c)):x.shiftAndExecuteNext(o)},r.appendExecutor=function(o,a){var n=this.operationQueue,R=this.sourceBuffer,w=R[a];if(!w){M.logger.warn("[buffer-controller]: Attempting to append to the "+a+" SourceBuffer, but it does not exist"),n.shiftAndExecuteNext(a);return}w.ended=!1,console.assert(!w.updating,a+" sourceBuffer must not be updating"),w.appendBuffer(o)},r.blockBuffers=function(o,a){var n=this;if(a===void 0&&(a=this.getSourceBufferTypes()),!a.length){M.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(o);return}var R=this.operationQueue,w=a.map(function(x){return R.appendBlocker(x)});Promise.all(w).then(function(){o(),a.forEach(function(x){var O=n.sourceBuffer[x];(!O||!O.updating)&&R.shiftAndExecuteNext(x)})})},r.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},r.addBufferListener=function(o,a,n){var R=this.sourceBuffer[o];if(!R)return;var w=n.bind(this,o);this.listeners[o].push({event:a,listener:w}),R.addEventListener(a,w)},r.removeBufferListeners=function(o){var a=this.sourceBuffer[o];if(!a)return;this.listeners[o].forEach(function(n){a.removeEventListener(n.event,n.listener)})},s}()},"./src/controller/buffer-operation-queue.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return A});var K=N("./src/utils/logger.ts"),A=function(){function M(P){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=P}var H=M.prototype;return H.append=function(k,D){var b=this.queues[D];b.push(k),b.length===1&&this.buffers[D]&&this.executeNext(D)},H.insertAbort=function(k,D){var b=this.queues[D];b.unshift(k),this.executeNext(D)},H.appendBlocker=function(k){var D,b=new Promise(function(f){D=f}),m={execute:D,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(m,k),b},H.executeNext=function(k){var D=this.buffers,b=this.queues,m=D[k],f=b[k];if(f.length){var d=f[0];try{d.execute()}catch(s){K.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),d.onError(s),(!m||!m.updating)&&(f.shift(),this.executeNext(k))}}},H.shiftAndExecuteNext=function(k){this.queues[k].shift(),this.executeNext(k)},H.current=function(k){return this.queues[k][0]},M}()},"./src/controller/cap-level-controller.ts":function(te,Y,N){"use strict";N.r(Y);var K=N("./src/events.ts");function A(P,k){for(var D=0;D<k.length;D++){var b=k[D];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(P,b.key,b)}}function M(P,k,D){return k&&A(P.prototype,k),D&&A(P,D),P}var H=function(){function P(D){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=D,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var k=P.prototype;return k.setStreamController=function(b){this.streamController=b},k.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},k.registerListeners=function(){var b=this.hls;b.on(K.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),b.on(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),b.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.on(K.Events.BUFFER_CODECS,this.onBufferCodecs,this),b.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},k.unregisterListener=function(){var b=this.hls;b.off(K.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),b.off(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),b.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.off(K.Events.BUFFER_CODECS,this.onBufferCodecs,this),b.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},k.onFpsDropLevelCapping=function(b,m){P.isLevelAllowed(m.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(m.droppedLevel)},k.onMediaAttaching=function(b,m){this.media=m.media instanceof HTMLVideoElement?m.media:null},k.onManifestParsed=function(b,m){var f=this.hls;this.restrictedLevels=[],this.firstLevel=m.firstLevel,f.config.capLevelToPlayerSize&&m.video&&this.startCapping()},k.onBufferCodecs=function(b,m){var f=this.hls;f.config.capLevelToPlayerSize&&m.video&&this.startCapping()},k.onMediaDetaching=function(){this.stopCapping()},k.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var b=this.hls.levels;if(b.length){var m=this.hls;m.autoLevelCapping=this.getMaxLevel(b.length-1),m.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=m.autoLevelCapping}}},k.getMaxLevel=function(b){var m=this,f=this.hls.levels;if(!f.length)return-1;var d=f.filter(function(s,r){return P.isLevelAllowed(r,m.restrictedLevels)&&r<=b});return this.clientRect=null,P.getMaxLevelByMediaSize(d,this.mediaWidth,this.mediaHeight)},k.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()},k.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},k.getDimensions=function(){if(this.clientRect)return this.clientRect;var b=this.media,m={width:0,height:0};if(b){var f=b.getBoundingClientRect();m.width=f.width,m.height=f.height,!m.width&&!m.height&&(m.width=f.right-f.left||b.width||0,m.height=f.bottom-f.top||b.height||0)}return this.clientRect=m,m},P.isLevelAllowed=function(b,m){return m===void 0&&(m=[]),m.indexOf(b)===-1},P.getMaxLevelByMediaSize=function(b,m,f){if(!b||!b.length)return-1;for(var d=function(a,n){return n?a.width!==n.width||a.height!==n.height:!0},s=b.length-1,r=0;r<b.length;r+=1){var u=b[r];if((u.width>=m||u.height>=f)&&d(u,b[r+1])){s=r;break}}return s},M(P,[{key:"mediaWidth",get:function(){return this.getDimensions().width*P.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*P.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var b=1;try{b=self.devicePixelRatio}catch(m){}return b}}]),P}();Y.default=H},"./src/controller/cmcd-controller.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return d});var K=N("./src/events.ts"),A=N("./src/types/cmcd.ts"),M=N("./src/utils/buffer-helper.ts"),H=N("./src/utils/logger.ts");function P(s,r){for(var u=0;u<r.length;u++){var o=r[u];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(s,o.key,o)}}function k(s,r,u){return r&&P(s.prototype,r),u&&P(s,u),s}function D(s,r){var u=typeof Symbol!="undefined"&&s[Symbol.iterator]||s["@@iterator"];if(u)return(u=u.call(s)).next.bind(u);if(Array.isArray(s)||(u=b(s))||r&&s&&typeof s.length=="number"){u&&(s=u);var o=0;return function(){return o>=s.length?{done:!0}:{done:!1,value:s[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function b(s,r){if(!s)return;if(typeof s=="string")return m(s,r);var u=Object.prototype.toString.call(s).slice(8,-1);if(u==="Object"&&s.constructor&&(u=s.constructor.name),u==="Map"||u==="Set")return Array.from(s);if(u==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u))return m(s,r)}function m(s,r){(r==null||r>s.length)&&(r=s.length);for(var u=0,o=new Array(r);u<r;u++)o[u]=s[u];return o}function f(){return f=Object.assign||function(s){for(var r=1;r<arguments.length;r++){var u=arguments[r];for(var o in u)Object.prototype.hasOwnProperty.call(u,o)&&(s[o]=u[o])}return s},f.apply(this,arguments)}var d=function(){function s(u){var o=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(){o.initialized&&(o.starved=!0),o.buffering=!0},this.onPlaying=function(){o.initialized||(o.initialized=!0),o.buffering=!1},this.applyPlaylistData=function(R){try{o.apply(R,{ot:A.CMCDObjectType.MANIFEST,su:!o.initialized})}catch(w){H.logger.warn("Could not generate manifest CMCD data.",w)}},this.applyFragmentData=function(R){try{var w=R.frag,x=o.hls.levels[w.level],O=o.getObjectType(w),C={d:w.duration*1e3,ot:O};(O===A.CMCDObjectType.VIDEO||O===A.CMCDObjectType.AUDIO||O==A.CMCDObjectType.MUXED)&&(C.br=x.bitrate/1e3,C.tb=o.getTopBandwidth(O),C.bl=o.getBufferLength(O)),o.apply(R,C)}catch(_){H.logger.warn("Could not generate segment CMCD data.",_)}},this.hls=u;var a=this.config=u.config,n=a.cmcd;n!=null&&(a.pLoader=this.createPlaylistLoader(),a.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||s.uuid(),this.cid=n.contentId,this.useHeaders=n.useHeaders===!0,this.registerListeners())}var r=s.prototype;return r.registerListeners=function(){var o=this.hls;o.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.on(K.Events.MEDIA_DETACHED,this.onMediaDetached,this),o.on(K.Events.BUFFER_CREATED,this.onBufferCreated,this)},r.unregisterListeners=function(){var o=this.hls;o.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.off(K.Events.MEDIA_DETACHED,this.onMediaDetached,this),o.off(K.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},r.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},r.onMediaAttached=function(o,a){this.media=a.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},r.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},r.onBufferCreated=function(o,a){var n,R;this.audioBuffer=(n=a.tracks.audio)===null||n===void 0?void 0:n.buffer,this.videoBuffer=(R=a.tracks.video)===null||R===void 0?void 0:R.buffer},r.createData=function(){var o;return{v:A.CMCDVersion,sf:A.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(o=this.media)===null||o===void 0?void 0:o.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},r.apply=function(o,a){a===void 0&&(a={}),f(a,this.createData());var n=a.ot===A.CMCDObjectType.INIT||a.ot===A.CMCDObjectType.VIDEO||a.ot===A.CMCDObjectType.MUXED;if(this.starved&&n&&(a.bs=!0,a.su=!0,this.starved=!1),a.su==null&&(a.su=this.buffering),this.useHeaders){var R=s.toHeaders(a);if(!Object.keys(R).length)return;o.headers||(o.headers={}),f(o.headers,R)}else{var w=s.toQuery(a);if(!w)return;o.url=s.appendQueryToUri(o.url,w)}},r.getObjectType=function(o){var a=o.type;return a==="subtitle"?A.CMCDObjectType.TIMED_TEXT:o.sn==="initSegment"?A.CMCDObjectType.INIT:a==="audio"?A.CMCDObjectType.AUDIO:a==="main"?this.hls.audioTracks.length?A.CMCDObjectType.VIDEO:A.CMCDObjectType.MUXED:void 0},r.getTopBandwidth=function(o){for(var a=0,n=o===A.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,R=D(n),w;!(w=R()).done;){var x=w.value;x.bitrate>a&&(a=x.bitrate)}return a>0?a:NaN},r.getBufferLength=function(o){var a=this.hls.media,n=o===A.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!n||!a)return NaN;var R=M.BufferHelper.bufferInfo(n,a.currentTime,this.config.maxBufferHole);return R.len*1e3},r.createPlaylistLoader=function(){var o=this.config.pLoader,a=this.applyPlaylistData,n=o||this.config.loader;return function(){function R(x){this.loader=void 0,this.loader=new n(x)}var w=R.prototype;return w.destroy=function(){this.loader.destroy()},w.abort=function(){this.loader.abort()},w.load=function(O,C,_){a(O),this.loader.load(O,C,_)},k(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},r.createFragmentLoader=function(){var o=this.config.fLoader,a=this.applyFragmentData,n=o||this.config.loader;return function(){function R(x){this.loader=void 0,this.loader=new n(x)}var w=R.prototype;return w.destroy=function(){this.loader.destroy()},w.abort=function(){this.loader.abort()},w.load=function(O,C,_){a(O),this.loader.load(O,C,_)},k(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},s.uuid=function(){var o=URL.createObjectURL(new Blob),a=o.toString();return URL.revokeObjectURL(o),a.substr(a.lastIndexOf("/")+1)},s.serialize=function(o){for(var a=[],n=function(F){return!Number.isNaN(F)&&F!=null&&F!==""&&F!==!1},R=function(F){return Math.round(F)},w=function(F){return R(F/100)*100},x=function(F){return encodeURIComponent(F)},O={br:R,d:R,bl:w,dl:w,mtp:w,nor:x,rtp:w,tb:R},C=Object.keys(o||{}).sort(),_=D(C),y;!(y=_()).done;){var h=y.value,c=o[h];if(!n(c))continue;if(h==="v"&&c===1)continue;if(h=="pr"&&c===1)continue;var v=O[h];v&&(c=v(c));var p=typeof c,E=void 0;h==="ot"||h==="sf"||h==="st"?E=h+"="+c:p==="boolean"?E=h:p==="number"?E=h+"="+c:E=h+"="+JSON.stringify(c),a.push(E)}return a.join(",")},s.toHeaders=function(o){for(var a=Object.keys(o),n={},R=["Object","Request","Session","Status"],w=[{},{},{},{}],x={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},O=0,C=a;O<C.length;O++){var _=C[O],y=x[_]!=null?x[_]:1;w[y][_]=o[_]}for(var h=0;h<w.length;h++){var c=s.serialize(w[h]);c&&(n["CMCD-"+R[h]]=c)}return n},s.toQuery=function(o){return"CMCD="+encodeURIComponent(s.serialize(o))},s.appendQueryToUri=function(o,a){if(!a)return o;var n=o.includes("?")?"&":"?";return""+o+n+a},s}()},"./src/controller/eme-controller.ts":function(te,Y,N){"use strict";N.r(Y);var K=N("./src/events.ts"),A=N("./src/errors.ts"),M=N("./src/utils/logger.ts"),H=N("./src/utils/mediakeys-helper.ts");function P(d,s){for(var r=0;r<s.length;r++){var u=s[r];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(d,u.key,u)}}function k(d,s,r){return s&&P(d.prototype,s),r&&P(d,r),d}var D=3,b=function(s,r,u){var o={audioCapabilities:[],videoCapabilities:[]};return s.forEach(function(a){o.audioCapabilities.push({contentType:'audio/mp4; codecs="'+a+'"',robustness:u.audioRobustness||""})}),r.forEach(function(a){o.videoCapabilities.push({contentType:'video/mp4; codecs="'+a+'"',robustness:u.videoRobustness||""})}),[o]},m=function(s,r,u,o){switch(s){case H.KeySystems.WIDEVINE:return b(r,u,o);default:throw new Error("Unknown key-system: "+s)}},f=function(){function d(r){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=r,this._config=r.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 s=d.prototype;return s.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},s._registerListeners=function(){this.hls.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(K.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this)},s._unregisterListeners=function(){this.hls.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(K.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this)},s.getLicenseServerUrl=function(u){switch(u){case H.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+u+'"')},s._attemptKeySystemAccess=function(u,o,a){var n=this,R=m(u,o,a,this._drmSystemOptions);M.logger.log("Requesting encrypted media key-system access");var w=this.requestMediaKeySystemAccess(u,R);this.mediaKeysPromise=w.then(function(x){return n._onMediaKeySystemAccessObtained(u,x)}),w.catch(function(x){M.logger.error('Failed to obtain key-system "'+u+'" access:',x)})},s._onMediaKeySystemAccessObtained=function(u,o){var a=this;M.logger.log('Access for key-system "'+u+'" obtained');var n={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:o,mediaKeySystemDomain:u};this._mediaKeysList.push(n);var R=Promise.resolve().then(function(){return o.createMediaKeys()}).then(function(w){return n.mediaKeys=w,M.logger.log('Media-keys created for key-system "'+u+'"'),a._onMediaKeysCreated(),w});return R.catch(function(w){M.logger.error("Failed to create media-keys:",w)}),R},s._onMediaKeysCreated=function(){var u=this;this._mediaKeysList.forEach(function(o){o.mediaKeysSession||(o.mediaKeysSession=o.mediaKeys.createSession(),u._onNewMediaKeySession(o.mediaKeysSession))})},s._onNewMediaKeySession=function(u){var o=this;M.logger.log("New key-system session "+u.sessionId),u.addEventListener("message",function(a){o._onKeySessionMessage(u,a.message)},!1)},s._onKeySessionMessage=function(u,o){M.logger.log("Got EME message event, creating license request"),this._requestLicense(o,function(a){M.logger.log("Received license data (length: "+(a&&a.byteLength)+"), updating key-session"),u.update(a)})},s.onMediaEncrypted=function(u){var o=this;if(M.logger.log('Media is encrypted using "'+u.initDataType+'" init data type'),!this.mediaKeysPromise){M.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(K.Events.ERROR,{type:A.ErrorTypes.KEY_SYSTEM_ERROR,details:A.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var a=function(R){if(!o._media)return;o._attemptSetMediaKeys(R),o._generateRequestWithPreferredKeySession(u.initDataType,u.initData)};this.mediaKeysPromise.then(a).catch(a)},s._attemptSetMediaKeys=function(u){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var o=this._mediaKeysList[0];if(!o||!o.mediaKeys){M.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(K.Events.ERROR,{type:A.ErrorTypes.KEY_SYSTEM_ERROR,details:A.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}M.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(o.mediaKeys),this._hasSetMediaKeys=!0}},s._generateRequestWithPreferredKeySession=function(u,o){var a=this,n=this._mediaKeysList[0];if(!n){M.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(K.Events.ERROR,{type:A.ErrorTypes.KEY_SYSTEM_ERROR,details:A.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(n.mediaKeysSessionInitialized){M.logger.warn("Key-Session already initialized but requested again");return}var R=n.mediaKeysSession;if(!R){M.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(K.Events.ERROR,{type:A.ErrorTypes.KEY_SYSTEM_ERROR,details:A.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!o){M.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(K.Events.ERROR,{type:A.ErrorTypes.KEY_SYSTEM_ERROR,details:A.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}M.logger.log('Generating key-session request for "'+u+'" init data type'),n.mediaKeysSessionInitialized=!0,R.generateRequest(u,o).then(function(){M.logger.debug("Key-session generation succeeded")}).catch(function(w){M.logger.error("Error generating key-session request:",w),a.hls.trigger(K.Events.ERROR,{type:A.ErrorTypes.KEY_SYSTEM_ERROR,details:A.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},s._createLicenseXhr=function(u,o,a){var n=new XMLHttpRequest;n.responseType="arraybuffer",n.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,n,u,o,a);var R=this._licenseXhrSetup;if(R)try{R.call(this.hls,n,u),R=void 0}catch(w){M.logger.error(w)}try{n.readyState||n.open("POST",u,!0),R&&R.call(this.hls,n,u)}catch(w){throw new Error("issue setting up KeySystem license XHR "+w)}return n},s._onLicenseRequestReadyStageChange=function(u,o,a,n){switch(u.readyState){case 4:if(u.status===200){this._requestLicenseFailureCount=0,M.logger.log("License request succeeded");var R=u.response,w=this._licenseResponseCallback;if(w)try{R=w.call(this.hls,u,o)}catch(O){M.logger.error(O)}n(R)}else{if(M.logger.error("License Request XHR failed ("+o+"). Status: "+u.status+" ("+u.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>D){this.hls.trigger(K.Events.ERROR,{type:A.ErrorTypes.KEY_SYSTEM_ERROR,details:A.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var x=D-this._requestLicenseFailureCount+1;M.logger.warn("Retrying license request, "+x+" attempts left"),this._requestLicense(a,n)}break}},s._generateLicenseRequestChallenge=function(u,o){switch(u.mediaKeySystemDomain){case H.KeySystems.WIDEVINE:return o}throw new Error("unsupported key-system: "+u.mediaKeySystemDomain)},s._requestLicense=function(u,o){M.logger.log("Requesting content license for key-system");var a=this._mediaKeysList[0];if(!a){M.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(K.Events.ERROR,{type:A.ErrorTypes.KEY_SYSTEM_ERROR,details:A.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var n=this.getLicenseServerUrl(a.mediaKeySystemDomain),R=this._createLicenseXhr(n,u,o);M.logger.log("Sending license request to URL: "+n);var w=this._generateLicenseRequestChallenge(a,u);R.send(w)}catch(x){M.logger.error("Failure requesting DRM license: "+x),this.hls.trigger(K.Events.ERROR,{type:A.ErrorTypes.KEY_SYSTEM_ERROR,details:A.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},s.onMediaAttached=function(u,o){if(!this._emeEnabled)return;var a=o.media;this._media=a,a.addEventListener("encrypted",this._onMediaEncrypted)},s.onMediaDetached=function(){var u=this._media,o=this._mediaKeysList;if(!u)return;u.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(o.map(function(a){if(a.mediaKeysSession)return a.mediaKeysSession.close().catch(function(){})})).then(function(){return u.setMediaKeys(null)}).catch(function(){})},s.onManifestParsed=function(u,o){if(!this._emeEnabled)return;var a=o.levels.map(function(R){return R.audioCodec}).filter(function(R){return!!R}),n=o.levels.map(function(R){return R.videoCodec}).filter(function(R){return!!R});this._attemptKeySystemAccess(H.KeySystems.WIDEVINE,a,n)},k(d,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),d}();Y.default=f},"./src/controller/fps-controller.ts":function(te,Y,N){"use strict";N.r(Y);var K=N("./src/events.ts"),A=N("./src/utils/logger.ts"),M=function(){function H(k){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=k,this.registerListeners()}var P=H.prototype;return P.setStreamController=function(D){this.streamController=D},P.registerListeners=function(){this.hls.on(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},P.unregisterListeners=function(){this.hls.off(K.Events.MEDIA_ATTACHING,this.onMediaAttaching)},P.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},P.onMediaAttaching=function(D,b){var m=this.hls.config;if(m.capLevelOnFPSDrop){var f=b.media instanceof self.HTMLVideoElement?b.media:null;this.media=f,f&&typeof f.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),m.fpsDroppedMonitoringPeriod)}},P.checkFPS=function(D,b,m){var f=performance.now();if(b){if(this.lastTime){var d=f-this.lastTime,s=m-this.lastDroppedFrames,r=b-this.lastDecodedFrames,u=1e3*s/d,o=this.hls;if(o.trigger(K.Events.FPS_DROP,{currentDropped:s,currentDecoded:r,totalDroppedFrames:m}),u>0&&s>o.config.fpsDroppedMonitoringThreshold*r){var a=o.currentLevel;A.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+a),a>0&&(o.autoLevelCapping===-1||o.autoLevelCapping>=a)&&(a=a-1,o.trigger(K.Events.FPS_DROP_LEVEL_CAPPING,{level:a,droppedLevel:o.currentLevel}),o.autoLevelCapping=a,this.streamController.nextLevelSwitch())}}this.lastTime=f,this.lastDroppedFrames=m,this.lastDecodedFrames=b}},P.checkFPSInterval=function(){var D=this.media;if(D)if(this.isVideoPlaybackQualityAvailable){var b=D.getVideoPlaybackQuality();this.checkFPS(D,b.totalVideoFrames,b.droppedVideoFrames)}else this.checkFPS(D,D.webkitDecodedFrameCount,D.webkitDroppedFrameCount)},H}();Y.default=M},"./src/controller/fragment-finders.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"findFragmentByPDT",function(){return M}),N.d(Y,"findFragmentByPTS",function(){return H}),N.d(Y,"fragmentWithinToleranceTest",function(){return P}),N.d(Y,"pdtWithinToleranceTest",function(){return k}),N.d(Y,"findFragWithCC",function(){return D});var K=N("./src/polyfills/number.ts"),A=N("./src/utils/binary-search.ts");function M(b,m,f){if(m===null||!Array.isArray(b)||!b.length||!Object(K.isFiniteNumber)(m))return null;var d=b[0].programDateTime;if(m<(d||0))return null;var s=b[b.length-1].endProgramDateTime;if(m>=(s||0))return null;f=f||0;for(var r=0;r<b.length;++r){var u=b[r];if(k(m,f,u))return u}return null}function H(b,m,f,d){f===void 0&&(f=0),d===void 0&&(d=0);var s=null;if(b?s=m[b.sn-m[0].sn+1]||null:f===0&&m[0].start===0&&(s=m[0]),s&&P(f,d,s)===0)return s;var r=A.default.search(m,P.bind(null,f,d));return r||s}function P(b,m,f){b===void 0&&(b=0),m===void 0&&(m=0);var d=Math.min(m,f.duration+(f.deltaPTS?f.deltaPTS:0));return f.start+f.duration-d<=b?1:f.start-d>b&&f.start?-1:0}function k(b,m,f){var d=Math.min(m,f.duration+(f.deltaPTS?f.deltaPTS:0))*1e3,s=f.endProgramDateTime||0;return s-d>b}function D(b,m){return A.default.search(b,function(f){return f.cc<m?1:f.cc>m?-1:0})}},"./src/controller/fragment-tracker.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"FragmentState",function(){return M}),N.d(Y,"FragmentTracker",function(){return H});var K=N("./src/events.ts"),A=N("./src/types/loader.ts"),M;(function(D){D.NOT_LOADED="NOT_LOADED",D.BACKTRACKED="BACKTRACKED",D.APPENDING="APPENDING",D.PARTIAL="PARTIAL",D.OK="OK"})(M||(M={}));var H=function(){function D(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 b=D.prototype;return b._registerListeners=function(){var f=this.hls;f.on(K.Events.BUFFER_APPENDED,this.onBufferAppended,this),f.on(K.Events.FRAG_BUFFERED,this.onFragBuffered,this),f.on(K.Events.FRAG_LOADED,this.onFragLoaded,this)},b._unregisterListeners=function(){var f=this.hls;f.off(K.Events.BUFFER_APPENDED,this.onBufferAppended,this),f.off(K.Events.FRAG_BUFFERED,this.onFragBuffered,this),f.off(K.Events.FRAG_LOADED,this.onFragLoaded,this)},b.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},b.getAppendedFrag=function(f,d){if(d===A.PlaylistLevelType.MAIN){var s=this.activeFragment,r=this.activeParts;if(!s)return null;if(r)for(var u=r.length;u--;){var o=r[u],a=o?o.end:s.appendedPTS;if(o.start<=f&&a!==void 0&&f<=a)return u>9&&(this.activeParts=r.slice(u-9)),o}else if(s.start<=f&&s.appendedPTS!==void 0&&f<=s.appendedPTS)return s}return this.getBufferedFrag(f,d)},b.getBufferedFrag=function(f,d){for(var s=this.fragments,r=Object.keys(s),u=r.length;u--;){var o=s[r[u]];if((o==null?void 0:o.body.type)===d&&o.buffered){var a=o.body;if(a.start<=f&&f<=a.end)return a}}return null},b.detectEvictedFragments=function(f,d,s){var r=this;Object.keys(this.fragments).forEach(function(u){var o=r.fragments[u];if(!o)return;if(!o.buffered){o.body.type===s&&r.removeFragment(o.body);return}var a=o.range[f];if(!a)return;a.time.some(function(n){var R=!r.isTimeBuffered(n.startPTS,n.endPTS,d);return R&&r.removeFragment(o.body),R})})},b.detectPartialFragments=function(f){var d=this,s=this.timeRanges,r=f.frag,u=f.part;if(!s||r.sn==="initSegment")return;var o=k(r),a=this.fragments[o];if(!a)return;Object.keys(s).forEach(function(n){var R=r.elementaryStreams[n];if(!R)return;var w=s[n],x=u!==null||R.partial===!0;a.range[n]=d.getBufferedTimes(r,u,x,w)}),a.backtrack=a.loaded=null,Object.keys(a.range).length?a.buffered=!0:this.removeFragment(a.body)},b.fragBuffered=function(f){var d=k(f),s=this.fragments[d];s&&(s.backtrack=s.loaded=null,s.buffered=!0)},b.getBufferedTimes=function(f,d,s,r){for(var u={time:[],partial:s},o=d?d.start:f.start,a=d?d.end:f.end,n=f.minEndPTS||a,R=f.maxStartPTS||o,w=0;w<r.length;w++){var x=r.start(w)-this.bufferPadding,O=r.end(w)+this.bufferPadding;if(R>=x&&n<=O){u.time.push({startPTS:Math.max(o,r.start(w)),endPTS:Math.min(a,r.end(w))});break}else if(o<O&&a>x)u.partial=!0,u.time.push({startPTS:Math.max(o,r.start(w)),endPTS:Math.min(a,r.end(w))});else if(a<=x)break}return u},b.getPartialFragment=function(f){var d=null,s,r,u,o=0,a=this.bufferPadding,n=this.fragments;return Object.keys(n).forEach(function(R){var w=n[R];if(!w)return;P(w)&&(r=w.body.start-a,u=w.body.end+a,f>=r&&f<=u&&(s=Math.min(f-r,u-f),o<=s&&(d=w.body,o=s)))}),d},b.getState=function(f){var d=k(f),s=this.fragments[d];return s?s.buffered?P(s)?M.PARTIAL:M.OK:s.backtrack?M.BACKTRACKED:M.APPENDING:M.NOT_LOADED},b.backtrack=function(f,d){var s=k(f),r=this.fragments[s];if(!r||r.backtrack)return null;var u=r.backtrack=d||r.loaded;return r.loaded=null,u},b.getBacktrackData=function(f){var d=k(f),s=this.fragments[d];if(s){var r,u=s.backtrack;if(u!=null&&(r=u.payload)!==null&&r!==void 0&&r.byteLength)return u;this.removeFragment(f)}return null},b.isTimeBuffered=function(f,d,s){for(var r,u,o=0;o<s.length;o++){if(r=s.start(o)-this.bufferPadding,u=s.end(o)+this.bufferPadding,f>=r&&d<=u)return!0;if(d<=r)return!1}return!1},b.onFragLoaded=function(f,d){var s=d.frag,r=d.part;if(s.sn==="initSegment"||s.bitrateTest||r)return;var u=k(s);this.fragments[u]={body:s,loaded:d,backtrack:null,buffered:!1,range:Object.create(null)}},b.onBufferAppended=function(f,d){var s=this,r=d.frag,u=d.part,o=d.timeRanges;if(r.type===A.PlaylistLevelType.MAIN)if(this.activeFragment=r,u){var a=this.activeParts;a||(this.activeParts=a=[]),a.push(u)}else this.activeParts=null;this.timeRanges=o,Object.keys(o).forEach(function(n){var R=o[n];if(s.detectEvictedFragments(n,R),!u)for(var w=0;w<R.length;w++)r.appendedPTS=Math.max(R.end(w),r.appendedPTS||0)})},b.onFragBuffered=function(f,d){this.detectPartialFragments(d)},b.hasFragment=function(f){var d=k(f);return!!this.fragments[d]},b.removeFragmentsInRange=function(f,d,s){var r=this;Object.keys(this.fragments).forEach(function(u){var o=r.fragments[u];if(!o)return;if(o.buffered){var a=o.body;a.type===s&&a.start<d&&a.end>f&&r.removeFragment(a)}})},b.removeFragment=function(f){var d=k(f);f.stats.loaded=0,f.clearElementaryStreamInfo(),delete this.fragments[d]},b.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},D}();function P(D){var b,m;return D.buffered&&(((b=D.range.video)===null||b===void 0?void 0:b.partial)||((m=D.range.audio)===null||m===void 0?void 0:m.partial))}function k(D){return D.type+"_"+D.level+"_"+D.urlId+"_"+D.sn}},"./src/controller/gap-controller.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"STALL_MINIMUM_DURATION_MS",function(){return P}),N.d(Y,"MAX_START_GAP_JUMP",function(){return k}),N.d(Y,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return D}),N.d(Y,"SKIP_BUFFER_RANGE_START",function(){return b}),N.d(Y,"default",function(){return m});var K=N("./src/utils/buffer-helper.ts"),A=N("./src/errors.ts"),M=N("./src/events.ts"),H=N("./src/utils/logger.ts"),P=250,k=2,D=.1,b=.05,m=function(){function f(s,r,u,o){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=s,this.media=r,this.fragmentTracker=u,this.hls=o}var d=f.prototype;return d.destroy=function(){this.hls=this.fragmentTracker=this.media=null},d.poll=function(r){var u=this.config,o=this.media,a=this.stalled,n=o.currentTime,R=o.seeking,w=this.seeking&&!R,x=!this.seeking&&R;if(this.seeking=R,n!==r){if(this.moved=!0,a!==null){if(this.stallReported){var O=self.performance.now()-a;H.logger.warn("playback not stuck anymore @"+n+", after "+Math.round(O)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((x||w)&&(this.stalled=null),o.paused||o.ended||o.playbackRate===0||!K.BufferHelper.getBuffered(o).length)return;var C=K.BufferHelper.bufferInfo(o,n,0),_=C.len>0,y=C.nextStart||0;if(!_&&!y)return;if(R){var h=C.len>k,c=!y||y-n>k&&!this.fragmentTracker.getPartialFragment(n);if(h||c)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var v,p=Math.max(y,C.start||0)-n,E=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,U=E==null||((v=E.details)===null||v===void 0)?void 0:v.live,F=U?E.details.targetduration*2:k;if(p>0&&p<=F){this._trySkipBufferHole(null);return}}var z=self.performance.now();if(a===null){this.stalled=z;return}var G=z-a;!R&&G>=P&&this._reportStall(C.len);var B=K.BufferHelper.bufferInfo(o,n,u.maxBufferHole);this._tryFixBufferStall(B,G)},d._tryFixBufferStall=function(r,u){var o=this.config,a=this.fragmentTracker,n=this.media,R=n.currentTime,w=a.getPartialFragment(R);if(w){var x=this._trySkipBufferHole(w);if(x)return}r.len>o.maxBufferHole&&u>o.highBufferWatchdogPeriod*1e3&&(H.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},d._reportStall=function(r){var u=this.hls,o=this.media,a=this.stallReported;a||(this.stallReported=!0,H.logger.warn("Playback stalling at @"+o.currentTime+" due to low buffer (buffer="+r+")"),u.trigger(M.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:r}))},d._trySkipBufferHole=function(r){for(var u=this.config,o=this.hls,a=this.media,n=a.currentTime,R=0,w=K.BufferHelper.getBuffered(a),x=0;x<w.length;x++){var O=w.start(x);if(n+u.maxBufferHole>=R&&n<O){var C=Math.max(O+b,a.currentTime+D);return H.logger.warn("skipping hole, adjusting currentTime from "+n+" to "+C),this.moved=!0,this.stalled=null,a.currentTime=C,r&&o.trigger(M.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+n+" to "+C,frag:r}),C}R=w.end(x)}return 0},d._tryNudgeBuffer=function(){var r=this.config,u=this.hls,o=this.media,a=o.currentTime,n=(this.nudgeRetry||0)+1;if(this.nudgeRetry=n,n<r.nudgeMaxRetry){var R=a+n*r.nudgeOffset;H.logger.warn("Nudging 'currentTime' from "+a+" to "+R),o.currentTime=R,u.trigger(M.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else H.logger.error("Playhead still not moving while enough data buffered @"+a+" after "+r.nudgeMaxRetry+" nudges"),u.trigger(M.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},f}()},"./src/controller/id3-track-controller.ts":function(te,Y,N){"use strict";N.r(Y);var K=N("./src/events.ts"),A=N("./src/utils/texttrack-utils.ts"),M=N("./src/demux/id3.ts"),H=.25,P=function(){function k(b){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=b,this._registerListeners()}var D=k.prototype;return D.destroy=function(){this._unregisterListeners()},D._registerListeners=function(){var m=this.hls;m.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.on(K.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.on(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D._unregisterListeners=function(){var m=this.hls;m.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.off(K.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),m.off(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D.onMediaAttached=function(m,f){this.media=f.media},D.onMediaDetaching=function(){if(!this.id3Track)return;Object(A.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},D.getID3Track=function(m){if(!this.media)return;for(var f=0;f<m.length;f++){var d=m[f];if(d.kind==="metadata"&&d.label==="id3")return Object(A.sendAddTrackEvent)(d,this.media),d}return this.media.addTextTrack("metadata","id3")},D.onFragParsingMetadata=function(m,f){if(!this.media)return;var d=f.frag,s=f.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var r=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,u=0;u<s.length;u++){var o=M.getID3Frames(s[u].data);if(o){var a=s[u].pts,n=u<s.length-1?s[u+1].pts:d.end,R=n-a;R<=0&&(n=a+H);for(var w=0;w<o.length;w++){var x=o[w];if(!M.isTimeStampFrame(x)){var O=new r(a,n,"");O.value=x,this.id3Track.addCue(O)}}}}},D.onBufferFlushing=function(m,f){var d=f.startOffset,s=f.endOffset,r=f.type;if(!r||r==="audio"){var u=this.id3Track;u&&Object(A.removeCuesInRange)(u,d,s)}},k}();Y.default=P},"./src/controller/latency-controller.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return k});var K=N("./src/errors.ts"),A=N("./src/events.ts"),M=N("./src/utils/logger.ts");function H(D,b){for(var m=0;m<b.length;m++){var f=b[m];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(D,f.key,f)}}function P(D,b,m){return b&&H(D.prototype,b),m&&H(D,m),D}var k=function(){function D(m){var f=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 f.timeupdate()},this.hls=m,this.config=m.config,this.registerListeners()}var b=D.prototype;return b.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},b.registerListeners=function(){this.hls.on(A.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(A.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(A.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(A.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(A.Events.ERROR,this.onError,this)},b.unregisterListeners=function(){this.hls.off(A.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(A.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(A.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(A.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(A.Events.ERROR,this.onError)},b.onMediaAttached=function(f,d){this.media=d.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},b.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},b.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},b.onLevelUpdated=function(f,d){var s=d.details;this.levelDetails=s,s.advanced&&this.timeupdate(),!s.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},b.onError=function(f,d){if(d.details!==K.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,M.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},b.timeupdate=function(){var f=this.media,d=this.levelDetails;if(!f||!d)return;this.currentTime=f.currentTime;var s=this.computeLatency();if(s===null)return;this._latency=s;var r=this.config,u=r.lowLatencyMode,o=r.maxLiveSyncPlaybackRate;if(!u||o===1)return;var a=this.targetLatency;if(a===null)return;var n=s-a,R=Math.min(this.maxLatency,a+d.targetduration),w=n<R;if(d.live&&w&&n>.05&&this.forwardBufferLength>1){var x=Math.min(2,Math.max(1,o)),O=Math.round(2/(1+Math.exp(-.75*n-this.edgeStalled))*20)/20;f.playbackRate=Math.min(x,Math.max(1,O))}else f.playbackRate!==1&&f.playbackRate!==0&&(f.playbackRate=1)},b.estimateLiveEdge=function(){var f=this.levelDetails;return f===null?null:f.edge+f.age},b.computeLatency=function(){var f=this.estimateLiveEdge();return f===null?null:f-this.currentTime},P(D,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var f=this.config,d=this.levelDetails;return f.liveMaxLatencyDuration!==void 0?f.liveMaxLatencyDuration:d?f.liveMaxLatencyDurationCount*d.targetduration:0}},{key:"targetLatency",get:function(){var f=this.levelDetails;if(f===null)return null;var d=f.holdBack,s=f.partHoldBack,r=f.targetduration,u=this.config,o=u.liveSyncDuration,a=u.liveSyncDurationCount,n=u.lowLatencyMode,R=this.hls.userConfig,w=n&&s||d;(R.liveSyncDuration||R.liveSyncDurationCount||w===0)&&(w=o!==void 0?o:a*r);var x=r,O=1;return w+Math.min(this.stallCount*O,x)}},{key:"liveSyncPosition",get:function(){var f=this.estimateLiveEdge(),d=this.targetLatency,s=this.levelDetails;if(f===null||d===null||s===null)return null;var r=s.edge,u=f-d-this.edgeStalled,o=r-s.totalduration,a=r-(this.config.lowLatencyMode&&s.partTarget||s.targetduration);return Math.min(Math.max(o,u),a)}},{key:"drift",get:function(){var f=this.levelDetails;return f===null?1:f.drift}},{key:"edgeStalled",get:function(){var f=this.levelDetails;if(f===null)return 0;var d=(this.config.lowLatencyMode&&f.partTarget||f.targetduration)*3;return Math.max(f.age-d,0)}},{key:"forwardBufferLength",get:function(){var f=this.media,d=this.levelDetails;if(!f||!d)return 0;var s=f.buffered.length;return s?f.buffered.end(s-1):d.edge-this.currentTime}}]),D}()},"./src/controller/level-controller.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return u});var K=N("./src/types/level.ts"),A=N("./src/events.ts"),M=N("./src/errors.ts"),H=N("./src/utils/codecs.ts"),P=N("./src/controller/level-helper.ts"),k=N("./src/controller/base-playlist-controller.ts"),D=N("./src/types/loader.ts");function b(){return b=Object.assign||function(o){for(var a=1;a<arguments.length;a++){var n=arguments[a];for(var R in n)Object.prototype.hasOwnProperty.call(n,R)&&(o[R]=n[R])}return o},b.apply(this,arguments)}function m(o,a){for(var n=0;n<a.length;n++){var R=a[n];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(o,R.key,R)}}function f(o,a,n){return a&&m(o.prototype,a),n&&m(o,n),o}function d(o,a){o.prototype=Object.create(a.prototype),o.prototype.constructor=o,s(o,a)}function s(o,a){return s=Object.setPrototypeOf||function(R,w){return R.__proto__=w,R},s(o,a)}var r=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),u=function(o){d(a,o);function a(R){var w;return w=o.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 n=a.prototype;return n._registerListeners=function(){var w=this.hls;w.on(A.Events.MANIFEST_LOADED,this.onManifestLoaded,this),w.on(A.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.on(A.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),w.on(A.Events.FRAG_LOADED,this.onFragLoaded,this),w.on(A.Events.ERROR,this.onError,this)},n._unregisterListeners=function(){var w=this.hls;w.off(A.Events.MANIFEST_LOADED,this.onManifestLoaded,this),w.off(A.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.off(A.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),w.off(A.Events.FRAG_LOADED,this.onFragLoaded,this),w.off(A.Events.ERROR,this.onError,this)},n.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,o.prototype.destroy.call(this)},n.startLoad=function(){var w=this._levels;w.forEach(function(x){x.loadError=0}),o.prototype.startLoad.call(this)},n.onManifestLoaded=function(w,x){var O=[],C=[],_=[],y,h={},c,v=!1,p=!1,E=!1;if(x.levels.forEach(function(G){var B=G.attrs;v=v||!!(G.width&&G.height),p=p||!!G.videoCodec,E=E||!!G.audioCodec,r&&G.audioCodec&&G.audioCodec.indexOf("mp4a.40.34")!==-1&&(G.audioCodec=void 0);var T=G.bitrate+"-"+G.attrs.RESOLUTION+"-"+G.attrs.CODECS;c=h[T],c?c.url.push(G.url):(c=new K.Level(G),h[T]=c,O.push(c)),B&&(B.AUDIO&&Object(P.addGroupId)(c,"audio",B.AUDIO),B.SUBTITLES&&Object(P.addGroupId)(c,"text",B.SUBTITLES))}),(v||p)&&E&&(O=O.filter(function(G){var B=G.videoCodec,T=G.width,V=G.height;return!!B||!!(T&&V)})),O=O.filter(function(G){var B=G.audioCodec,T=G.videoCodec;return(!B||Object(H.isCodecSupportedInMp4)(B,"audio"))&&(!T||Object(H.isCodecSupportedInMp4)(T,"video"))}),x.audioTracks&&(C=x.audioTracks.filter(function(G){return!G.audioCodec||Object(H.isCodecSupportedInMp4)(G.audioCodec,"audio")}),Object(P.assignTrackIdsByGroup)(C)),x.subtitles&&(_=x.subtitles,Object(P.assignTrackIdsByGroup)(_)),O.length>0){y=O[0].bitrate,O.sort(function(G,B){return G.bitrate-B.bitrate}),this._levels=O;for(var U=0;U<O.length;U++)if(O[U].bitrate===y){this._firstLevel=U,this.log("manifest loaded, "+O.length+" level(s) found, first bitrate: "+y);break}var F=E&&!p,z={levels:O,audioTracks:C,subtitleTracks:_,firstLevel:this._firstLevel,stats:x.stats,audio:E,video:p,altAudio:!F&&C.some(function(G){return!!G.url})};this.hls.trigger(A.Events.MANIFEST_PARSED,z),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(A.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:x.url,reason:"no level with compatible codecs found in manifest"})},n.onError=function(w,x){if(o.prototype.onError.call(this,w,x),x.fatal)return;var O=x.context,C=this._levels[this.currentLevelIndex];if(O&&(O.type===D.PlaylistContextType.AUDIO_TRACK&&C.audioGroupIds&&O.groupId===C.audioGroupIds[C.urlId]||O.type===D.PlaylistContextType.SUBTITLE_TRACK&&C.textGroupIds&&O.groupId===C.textGroupIds[C.urlId])){this.redundantFailover(this.currentLevelIndex);return}var _=!1,y=!0,h;switch(x.details){case M.ErrorDetails.FRAG_LOAD_ERROR:case M.ErrorDetails.FRAG_LOAD_TIMEOUT:case M.ErrorDetails.KEY_LOAD_ERROR:case M.ErrorDetails.KEY_LOAD_TIMEOUT:if(x.frag){var c=this._levels[x.frag.level];c?(c.fragmentError++,c.fragmentError>this.hls.config.fragLoadingMaxRetry&&(h=x.frag.level)):h=x.frag.level}break;case M.ErrorDetails.LEVEL_LOAD_ERROR:case M.ErrorDetails.LEVEL_LOAD_TIMEOUT:O&&(O.deliveryDirectives&&(y=!1),h=O.level),_=!0;break;case M.ErrorDetails.REMUX_ALLOC_ERROR:h=x.level,_=!0;break}h!==void 0&&this.recoverLevel(x,h,_,y)},n.recoverLevel=function(w,x,O,C){var _=w.details,y=this._levels[x];if(y.loadError++,O){var h=this.retryLoadingOrFail(w);if(h)w.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(C){var c=y.url.length;if(c>1&&y.loadError<c)w.levelRetry=!0,this.redundantFailover(x);else if(this.manualLevelIndex===-1){var v=x===0?this._levels.length-1:x-1;this.currentLevelIndex!==v&&this._levels[v].loadError===0&&(this.warn(_+": switch to "+v),w.levelRetry=!0,this.hls.nextAutoLevel=v)}}},n.redundantFailover=function(w){var x=this._levels[w],O=x.url.length;if(O>1){var C=(x.urlId+1)%O;this.warn("Switching to redundant URL-id "+C),this._levels.forEach(function(_){_.urlId=C}),this.level=w}},n.onFragLoaded=function(w,x){var O=x.frag;if(O!==void 0&&O.type===D.PlaylistLevelType.MAIN){var C=this._levels[O.level];C!==void 0&&(C.fragmentError=0,C.loadError=0)}},n.onLevelLoaded=function(w,x){var O,C=x.level,_=x.details,y=this._levels[C];if(!y){var h;this.warn("Invalid level index "+C),(h=x.deliveryDirectives)!==null&&h!==void 0&&h.skip&&(_.deltaUpdateFailed=!0);return}C===this.currentLevelIndex?(y.fragmentError===0&&(y.loadError=0,this.retryCount=0),this.playlistLoaded(C,x,y.details)):(O=x.deliveryDirectives)!==null&&O!==void 0&&O.skip&&(_.deltaUpdateFailed=!0)},n.onAudioTrackSwitched=function(w,x){var O=this.hls.levels[this.currentLevelIndex];if(!O)return;if(O.audioGroupIds){for(var C=-1,_=this.hls.audioTracks[x.id].groupId,y=0;y<O.audioGroupIds.length;y++)if(O.audioGroupIds[y]===_){C=y;break}C!==O.urlId&&(O.urlId=C,this.startLoad())}},n.loadPlaylist=function(w){var x=this.currentLevelIndex,O=this._levels[x];if(this.canLoad&&O&&O.url.length>0){var C=O.urlId,_=O.url[C];if(w)try{_=w.addDirectives(_)}catch(y){this.warn("Could not construct new URL with HLS Delivery Directives: "+y)}this.log("Attempt loading level index "+x+(w?" at sn "+w.msn+" part "+w.part:"")+" with URL-id "+C+" "+_),this.clearTimer(),this.hls.trigger(A.Events.LEVEL_LOADING,{url:_,level:x,id:C,deliveryDirectives:w||null})}},n.removeLevel=function(w,x){var O=function(y,h){return h!==x},C=this._levels.filter(function(_,y){return y!==w?!0:_.url.length>1&&x!==void 0?(_.url=_.url.filter(O),_.audioGroupIds&&(_.audioGroupIds=_.audioGroupIds.filter(O)),_.textGroupIds&&(_.textGroupIds=_.textGroupIds.filter(O)),_.urlId=0,!0):!1}).map(function(_,y){var h=_.details;return h!=null&&h.fragments&&h.fragments.forEach(function(c){c.level=y}),_});this._levels=C,this.hls.trigger(A.Events.LEVELS_UPDATED,{levels:C})},f(a,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(w){var x,O=this._levels;if(O.length===0)return;if(this.currentLevelIndex===w&&(x=O[w])!==null&&x!==void 0&&x.details)return;if(w<0||w>=O.length){var C=w<0;if(this.hls.trigger(A.Events.ERROR,{type:M.ErrorTypes.OTHER_ERROR,details:M.ErrorDetails.LEVEL_SWITCH_ERROR,level:w,fatal:C,reason:"invalid level idx"}),C)return;w=Math.min(w,O.length-1)}this.clearTimer();var _=this.currentLevelIndex,y=O[_],h=O[w];this.log("switching to level "+w+" from "+_),this.currentLevelIndex=w;var c=b({},h,{level:w,maxBitrate:h.maxBitrate,uri:h.uri,urlId:h.urlId});delete c._urlId,this.hls.trigger(A.Events.LEVEL_SWITCHING,c);var v=h.details;if(!v||v.live){var p=this.switchParams(h.uri,y==null?void 0:y.details);this.loadPlaylist(p)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(w){this.manualLevelIndex=w,this._startLevel===void 0&&(this._startLevel=w),w!==-1&&(this.level=w)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(w){this._firstLevel=w}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var w=this.hls.config.startLevel;return w!==void 0?w:this._firstLevel}else return this._startLevel},set:function(w){this._startLevel=w}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(w){this.level=w,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=w)}}]),a}(k.default)},"./src/controller/level-helper.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"addGroupId",function(){return M}),N.d(Y,"assignTrackIdsByGroup",function(){return H}),N.d(Y,"updatePTS",function(){return P}),N.d(Y,"updateFragPTSDTS",function(){return D}),N.d(Y,"mergeDetails",function(){return b}),N.d(Y,"mapPartIntersection",function(){return m}),N.d(Y,"mapFragmentIntersection",function(){return f}),N.d(Y,"adjustSliding",function(){return d}),N.d(Y,"addSliding",function(){return s}),N.d(Y,"computeReloadInterval",function(){return r}),N.d(Y,"getFragmentWithSN",function(){return u}),N.d(Y,"getPartWith",function(){return o});var K=N("./src/polyfills/number.ts"),A=N("./src/utils/logger.ts");function M(a,n,R){switch(n){case"audio":a.audioGroupIds||(a.audioGroupIds=[]),a.audioGroupIds.push(R);break;case"text":a.textGroupIds||(a.textGroupIds=[]),a.textGroupIds.push(R);break}}function H(a){var n={};a.forEach(function(R){var w=R.groupId||"";R.id=n[w]=n[w]||0,n[w]++})}function P(a,n,R){var w=a[n],x=a[R];k(w,x)}function k(a,n){var R=n.startPTS;if(Object(K.isFiniteNumber)(R)){var w=0,x;n.sn>a.sn?(w=R-a.start,x=a):(w=a.start-R,x=n),x.duration!==w&&(x.duration=w)}else if(n.sn>a.sn){var O=a.cc===n.cc;O&&a.minEndPTS?n.start=a.start+(a.minEndPTS-a.start):n.start=a.start+a.duration}else n.start=Math.max(a.start-n.duration,0)}function D(a,n,R,w,x,O){var C=w-R;C<=0&&(A.logger.warn("Fragment should have a positive duration",n),w=R+n.duration,O=x+n.duration);var _=R,y=w,h=n.startPTS,c=n.endPTS;if(Object(K.isFiniteNumber)(h)){var v=Math.abs(h-R);Object(K.isFiniteNumber)(n.deltaPTS)?n.deltaPTS=Math.max(v,n.deltaPTS):n.deltaPTS=v,_=Math.max(R,h),R=Math.min(R,h),x=Math.min(x,n.startDTS),y=Math.min(w,c),w=Math.max(w,c),O=Math.max(O,n.endDTS)}n.duration=w-R;var p=R-n.start;n.appendedPTS=w,n.start=n.startPTS=R,n.maxStartPTS=_,n.startDTS=x,n.endPTS=w,n.minEndPTS=y,n.endDTS=O;var E=n.sn;if(!a||E<a.startSN||E>a.endSN)return 0;var U,F=E-a.startSN,z=a.fragments;for(z[F]=n,U=F;U>0;U--)k(z[U],z[U-1]);for(U=F;U<z.length-1;U++)k(z[U],z[U+1]);return a.fragmentHint&&k(z[z.length-1],a.fragmentHint),a.PTSKnown=a.alignedSliding=!0,p}function b(a,n){for(var R=null,w=a.fragments,x=w.length-1;x>=0;x--){var O=w[x].initSegment;if(O){R=O;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;var C=0,_;if(f(a,n,function(U,F){U.relurl&&(C=U.cc-F.cc),Object(K.isFiniteNumber)(U.startPTS)&&Object(K.isFiniteNumber)(U.endPTS)&&(F.start=F.startPTS=U.startPTS,F.startDTS=U.startDTS,F.appendedPTS=U.appendedPTS,F.maxStartPTS=U.maxStartPTS,F.endPTS=U.endPTS,F.endDTS=U.endDTS,F.minEndPTS=U.minEndPTS,F.duration=U.endPTS-U.startPTS,F.duration&&(_=F),n.PTSKnown=n.alignedSliding=!0),F.elementaryStreams=U.elementaryStreams,F.loader=U.loader,F.stats=U.stats,F.urlId=U.urlId,U.initSegment&&(F.initSegment=U.initSegment,R=U.initSegment)}),R){var y=n.fragmentHint?n.fragments.concat(n.fragmentHint):n.fragments;y.forEach(function(U){var F;(!U.initSegment||U.initSegment.relurl===((F=R)===null||F===void 0?void 0:F.relurl))&&(U.initSegment=R)})}if(n.skippedSegments&&(n.deltaUpdateFailed=n.fragments.some(function(U){return!U}),n.deltaUpdateFailed)){A.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var h=n.skippedSegments;h--;)n.fragments.shift();n.startSN=n.fragments[0].sn,n.startCC=n.fragments[0].cc}var c=n.fragments;if(C){A.logger.warn("discontinuity sliding from playlist, take drift into account");for(var v=0;v<c.length;v++)c[v].cc+=C}n.skippedSegments&&(n.startCC=n.fragments[0].cc),m(a.partList,n.partList,function(U,F){F.elementaryStreams=U.elementaryStreams,F.stats=U.stats}),_?D(n,_,_.startPTS,_.endPTS,_.startDTS,_.endDTS):d(a,n),c.length&&(n.totalduration=n.edge-c[0].start),n.driftStartTime=a.driftStartTime,n.driftStart=a.driftStart;var p=n.advancedDateTime;if(n.advanced&&p){var E=n.edge;n.driftStart||(n.driftStartTime=p,n.driftStart=E),n.driftEndTime=p,n.driftEnd=E}else n.driftEndTime=a.driftEndTime,n.driftEnd=a.driftEnd,n.advancedDateTime=a.advancedDateTime}function m(a,n,R){if(a&&n)for(var w=0,x=0,O=a.length;x<=O;x++){var C=a[x],_=n[x+w];C&&_&&C.index===_.index&&C.fragment.sn===_.fragment.sn?R(C,_):w--}}function f(a,n,R){for(var w=n.skippedSegments,x=Math.max(a.startSN,n.startSN)-n.startSN,O=(a.fragmentHint?1:0)+(w?n.endSN:Math.min(a.endSN,n.endSN))-n.startSN,C=n.startSN-a.startSN,_=n.fragmentHint?n.fragments.concat(n.fragmentHint):n.fragments,y=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments,h=x;h<=O;h++){var c=y[C+h],v=_[h];w&&!v&&h<w&&(v=n.fragments[h]=c),c&&v&&R(c,v)}}function d(a,n){var R=n.startSN+n.skippedSegments-a.startSN,w=a.fragments;if(R<0||R>=w.length)return;s(n,w[R].start)}function s(a,n){if(n){for(var R=a.fragments,w=a.skippedSegments;w<R.length;w++)R[w].start+=n;a.fragmentHint&&(a.fragmentHint.start+=n)}}function r(a,n){var R=1e3*a.levelTargetDuration,w=R/2,x=a.age,O=x>0&&x<R*3,C=n.loading.end-n.loading.start,_,y=a.availabilityDelay;if(a.updated===!1)if(O){var h=333*a.misses;_=Math.max(Math.min(w,C*2),h),a.availabilityDelay=(a.availabilityDelay||0)+_}else _=w;else O?(y=Math.min(y||R/2,x),a.availabilityDelay=y,_=y+R-x):_=R-C;return Math.round(_)}function u(a,n,R){if(!a||!a.details)return null;var w=a.details,x=w.fragments[n-w.startSN];return x||(x=w.fragmentHint,x&&x.sn===n?x:n<w.startSN&&R&&R.sn===n?R:null)}function o(a,n,R){if(!a||!a.details)return null;var w=a.details.partList;if(w)for(var x=w.length;x--;){var O=w[x];if(O.index===R&&O.fragment.sn===n)return O}return null}},"./src/controller/stream-controller.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return w});var K=N("./src/polyfills/number.ts"),A=N("./src/controller/base-stream-controller.ts"),M=N("./src/is-supported.ts"),H=N("./src/events.ts"),P=N("./src/utils/buffer-helper.ts"),k=N("./src/controller/fragment-tracker.ts"),D=N("./src/types/loader.ts"),b=N("./src/loader/fragment.ts"),m=N("./src/demux/transmuxer-interface.ts"),f=N("./src/types/transmuxer.ts"),d=N("./src/controller/gap-controller.ts"),s=N("./src/errors.ts"),r=N("./src/utils/logger.ts");function u(x,O){for(var C=0;C<O.length;C++){var _=O[C];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(x,_.key,_)}}function o(x,O,C){return O&&u(x.prototype,O),C&&u(x,C),x}function a(x,O){x.prototype=Object.create(O.prototype),x.prototype.constructor=x,n(x,O)}function n(x,O){return n=Object.setPrototypeOf||function(_,y){return _.__proto__=y,_},n(x,O)}var R=100,w=function(x){a(O,x);function O(_,y){var h;return h=x.call(this,_,y,"[stream-controller]")||this,h.audioCodecSwap=!1,h.gapController=null,h.level=-1,h._forceStartLoad=!1,h.altAudio=!1,h.audioOnly=!1,h.fragPlaying=null,h.onvplaying=null,h.onvseeked=null,h.fragLastKbps=0,h.stalled=!1,h.couldBacktrack=!1,h.audioCodecSwitch=!1,h.videoBuffer=null,h._registerListeners(),h}var C=O.prototype;return C._registerListeners=function(){var y=this.hls;y.on(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),y.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),y.on(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),y.on(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.on(H.Events.LEVEL_LOADING,this.onLevelLoading,this),y.on(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),y.on(H.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),y.on(H.Events.ERROR,this.onError,this),y.on(H.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),y.on(H.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),y.on(H.Events.BUFFER_CREATED,this.onBufferCreated,this),y.on(H.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),y.on(H.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),y.on(H.Events.FRAG_BUFFERED,this.onFragBuffered,this)},C._unregisterListeners=function(){var y=this.hls;y.off(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),y.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),y.off(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),y.off(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),y.off(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),y.off(H.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),y.off(H.Events.ERROR,this.onError,this),y.off(H.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),y.off(H.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),y.off(H.Events.BUFFER_CREATED,this.onBufferCreated,this),y.off(H.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),y.off(H.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),y.off(H.Events.FRAG_BUFFERED,this.onFragBuffered,this)},C.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},C.startLoad=function(y){if(this.levels){var h=this.lastCurrentTime,c=this.hls;if(this.stopLoad(),this.setInterval(R),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var v=c.startLevel;v===-1&&(c.config.testBandwidth?(v=0,this.bitrateTest=!0):v=c.nextAutoLevel),this.level=c.nextLoadLevel=v,this.loadedmetadata=!1}h>0&&y===-1&&(this.log("Override startPosition with lastCurrentTime @"+h.toFixed(3)),y=h),this.state=A.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=y,this.tick()}else this._forceStartLoad=!0,this.state=A.State.STOPPED},C.stopLoad=function(){this._forceStartLoad=!1,x.prototype.stopLoad.call(this)},C.doTick=function(){switch(this.state){case A.State.IDLE:this.doTickIdle();break;case A.State.WAITING_LEVEL:{var y,h=this.levels,c=this.level,v=h==null||((y=h[c])===null||y===void 0)?void 0:y.details;if(v&&(!v.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(v))break;this.state=A.State.IDLE;break}break}case A.State.FRAG_LOADING_WAITING_RETRY:{var p,E=self.performance.now(),U=this.retryDate;(!U||E>=U||(p=this.media)!==null&&p!==void 0&&p.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=A.State.IDLE)}break;default:break}this.onTickEnd()},C.onTickEnd=function(){x.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},C.doTickIdle=function(){var y,h,c=this.hls,v=this.levelLastLoaded,p=this.levels,E=this.media,U=c.config,F=c.nextLoadLevel;if(v===null||!E&&(this.startFragRequested||!U.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!p||!p[F])return;var z=p[F];this.level=c.nextLoadLevel=F;var G=z.details;if(!G||this.state===A.State.WAITING_LEVEL||G.live&&this.levelLastLoaded!==F){this.state=A.State.WAITING_LEVEL;return}var B=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:E,D.PlaylistLevelType.MAIN);if(B===null)return;var T=B.len,V=this.getMaxBufferLength(z.maxBitrate);if(T>=V)return;if(this._streamEnded(B,G)){var Z={};this.altAudio&&(Z.type="video"),this.hls.trigger(H.Events.BUFFER_EOS,Z),this.state=A.State.ENDED;return}var oe=B.end,pe=this.getNextFragment(oe,G);if(this.couldBacktrack&&!this.fragPrevious&&pe&&pe.sn!=="initSegment"){var Ye=pe.sn-G.startSN;Ye>1&&(pe=G.fragments[Ye-1],this.fragmentTracker.removeFragment(pe))}if(pe&&this.fragmentTracker.getState(pe)===k.FragmentState.OK&&this.nextLoadPosition>oe){var xe=this.audioOnly&&!this.altAudio?b.ElementaryStreamTypes.AUDIO:b.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(E,xe,D.PlaylistLevelType.MAIN),pe=this.getNextFragment(this.nextLoadPosition,G)}if(!pe)return;pe.initSegment&&!pe.initSegment.data&&!this.bitrateTest&&(pe=pe.initSegment),((y=pe.decryptdata)===null||y===void 0?void 0:y.keyFormat)==="identity"&&!((h=pe.decryptdata)!==null&&h!==void 0&&h.key)?this.loadKey(pe,G):this.loadFragment(pe,G,oe)},C.loadFragment=function(y,h,c){var v,p=this.fragmentTracker.getState(y);if(this.fragCurrent=y,p===k.FragmentState.BACKTRACKED){var E=this.fragmentTracker.getBacktrackData(y);if(E){this._handleFragmentLoadProgress(E),this._handleFragmentLoadComplete(E);return}else p=k.FragmentState.NOT_LOADED}p===k.FragmentState.NOT_LOADED||p===k.FragmentState.PARTIAL?y.sn==="initSegment"?this._loadInitSegment(y):this.bitrateTest?(y.bitrateTest=!0,this.log("Fragment "+y.sn+" of level "+y.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(y)):(this.startFragRequested=!0,x.prototype.loadFragment.call(this,y,h,c)):p===k.FragmentState.APPENDING?this.reduceMaxBufferLength(y.duration)&&this.fragmentTracker.removeFragment(y):((v=this.media)===null||v===void 0?void 0:v.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},C.getAppendedFrag=function(y){var h=this.fragmentTracker.getAppendedFrag(y,D.PlaylistLevelType.MAIN);return h&&"fragment"in h?h.fragment:h},C.getBufferedFrag=function(y){return this.fragmentTracker.getBufferedFrag(y,D.PlaylistLevelType.MAIN)},C.followingBufferedFrag=function(y){return y?this.getBufferedFrag(y.end+.5):null},C.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},C.nextLevelSwitch=function(){var y=this.levels,h=this.media;if(h!=null&&h.readyState){var c,v=this.getAppendedFrag(h.currentTime);if(v&&v.start>1&&this.flushMainBuffer(0,v.start-1),!h.paused&&y){var p=this.hls.nextLoadLevel,E=y[p],U=this.fragLastKbps;U&&this.fragCurrent?c=this.fragCurrent.duration*E.maxBitrate/(1e3*U)+1:c=0}else c=0;var F=this.getBufferedFrag(h.currentTime+c);if(F){var z=this.followingBufferedFrag(F);if(z){this.abortCurrentFrag();var G=z.maxStartPTS?z.maxStartPTS:z.start,B=z.duration,T=Math.max(F.end,G+Math.min(Math.max(B-this.config.maxFragLookUpTolerance,B*.5),B*.75));this.flushMainBuffer(T,Number.POSITIVE_INFINITY)}}}},C.abortCurrentFrag=function(){var y=this.fragCurrent;this.fragCurrent=null,y!=null&&y.loader&&y.loader.abort(),this.state===A.State.KEY_LOADING&&(this.state=A.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},C.flushMainBuffer=function(y,h){x.prototype.flushMainBuffer.call(this,y,h,this.altAudio?"video":null)},C.onMediaAttached=function(y,h){x.prototype.onMediaAttached.call(this,y,h);var c=h.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),c.addEventListener("playing",this.onvplaying),c.addEventListener("seeked",this.onvseeked),this.gapController=new d.default(this.config,c,this.fragmentTracker,this.hls)},C.onMediaDetaching=function(){var y=this.media;y&&(y.removeEventListener("playing",this.onvplaying),y.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),x.prototype.onMediaDetaching.call(this)},C.onMediaPlaying=function(){this.tick()},C.onMediaSeeked=function(){var y=this.media,h=y?y.currentTime:null;Object(K.isFiniteNumber)(h)&&this.log("Media seeked to "+h.toFixed(3)),this.tick()},C.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},C.onManifestParsed=function(y,h){var c=!1,v=!1,p;h.levels.forEach(function(E){p=E.audioCodec,p&&(p.indexOf("mp4a.40.2")!==-1&&(c=!0),p.indexOf("mp4a.40.5")!==-1&&(v=!0))}),this.audioCodecSwitch=c&&v&&!Object(M.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=h.levels,this.startFragRequested=!1},C.onLevelLoading=function(y,h){var c=this.levels;if(!c||this.state!==A.State.IDLE)return;var v=c[h.level];(!v.details||v.details.live&&this.levelLastLoaded!==h.level||this.waitForCdnTuneIn(v.details))&&(this.state=A.State.WAITING_LEVEL)},C.onLevelLoaded=function(y,h){var c,v=this.levels,p=h.level,E=h.details,U=E.totalduration;if(!v){this.warn("Levels were reset while loading level "+p);return}this.log("Level "+p+" loaded ["+E.startSN+","+E.endSN+"], cc ["+E.startCC+", "+E.endCC+"] duration:"+U);var F=this.fragCurrent;F&&(this.state===A.State.FRAG_LOADING||this.state===A.State.FRAG_LOADING_WAITING_RETRY)&&(F.level!==h.level&&F.loader&&(this.state=A.State.IDLE,F.loader.abort()));var z=v[p],G=0;if(E.live||(c=z.details)!==null&&c!==void 0&&c.live){if(E.fragments[0]||(E.deltaUpdateFailed=!0),E.deltaUpdateFailed)return;G=this.alignPlaylists(E,z.details)}if(z.details=E,this.levelLastLoaded=p,this.hls.trigger(H.Events.LEVEL_UPDATED,{details:E,level:p}),this.state===A.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(E))return;this.state=A.State.IDLE}this.startFragRequested?E.live&&this.synchronizeToLiveEdge(E):this.setStartPosition(E,G),this.tick()},C._handleFragmentLoadProgress=function(y){var h,c=y.frag,v=y.part,p=y.payload,E=this.levels;if(!E){this.warn("Levels were reset while fragment load was in progress. Fragment "+c.sn+" of level "+c.level+" will not be buffered");return}var U=E[c.level],F=U.details;if(!F){this.warn("Dropping fragment "+c.sn+" of level "+c.level+" after level details were reset");return}var z=U.videoCodec,G=F.PTSKnown||!F.live,B=(h=c.initSegment)===null||h===void 0?void 0:h.data,T=this._getAudioCodec(U),V=this.transmuxer=this.transmuxer||new m.default(this.hls,D.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),Z=v?v.index:-1,oe=Z!==-1,pe=new f.ChunkMetadata(c.level,c.sn,c.stats.chunkCount,p.byteLength,Z,oe),Ye=this.initPTS[c.cc];V.push(p,B,T,z,c,v,F.totalduration,G,pe,Ye)},C.onAudioTrackSwitching=function(y,h){var c=this.altAudio,v=!!h.url,p=h.id;if(!v){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var E=this.fragCurrent;E!=null&&E.loader&&(this.log("Switching to main audio track, cancel main fragment load"),E.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var U=this.hls;c&&U.trigger(H.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),U.trigger(H.Events.AUDIO_TRACK_SWITCHED,{id:p})}},C.onAudioTrackSwitched=function(y,h){var c=h.id,v=!!this.hls.audioTracks[c].url;if(v){var p=this.videoBuffer;p&&this.mediaBuffer!==p&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=p)}this.altAudio=v,this.tick()},C.onBufferCreated=function(y,h){var c=h.tracks,v,p,E=!1;for(var U in c){var F=c[U];if(F.id==="main"){if(p=U,v=F,U==="video"){var z=c[U];z&&(this.videoBuffer=z.buffer)}}else E=!0}E&&v?(this.log("Alternate track found, use "+p+".buffered to schedule main fragment loading"),this.mediaBuffer=v.buffer):this.mediaBuffer=this.media},C.onFragBuffered=function(y,h){var c=h.frag,v=h.part;if(c&&c.type!==D.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(c)){this.warn("Fragment "+c.sn+(v?" p: "+v.index:"")+" of level "+c.level+" finished buffering, but was aborted. state: "+this.state),this.state===A.State.PARSED&&(this.state=A.State.IDLE);return}var p=v?v.stats:c.stats;this.fragLastKbps=Math.round(8*p.total/(p.buffering.end-p.loading.first)),c.sn!=="initSegment"&&(this.fragPrevious=c),this.fragBufferedComplete(c,v)},C.onError=function(y,h){switch(h.details){case s.ErrorDetails.FRAG_LOAD_ERROR:case s.ErrorDetails.FRAG_LOAD_TIMEOUT:case s.ErrorDetails.KEY_LOAD_ERROR:case s.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.MAIN,h);break;case s.ErrorDetails.LEVEL_LOAD_ERROR:case s.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==A.State.ERROR&&(h.fatal?(this.warn(""+h.details),this.state=A.State.ERROR):!h.levelRetry&&this.state===A.State.WAITING_LEVEL&&(this.state=A.State.IDLE));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(h.parent==="main"&&(this.state===A.State.PARSING||this.state===A.State.PARSED)){var c=!0,v=this.getFwdBufferInfo(this.media,D.PlaylistLevelType.MAIN);v&&v.len>.5&&(c=!this.reduceMaxBufferLength(v.len)),c&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},C.checkBuffer=function(){var y=this.media,h=this.gapController;if(!y||!h||!y.readyState)return;var c=P.BufferHelper.getBuffered(y);!this.loadedmetadata&&c.length?(this.loadedmetadata=!0,this.seekToStartPos()):h.poll(this.lastCurrentTime),this.lastCurrentTime=y.currentTime},C.onFragLoadEmergencyAborted=function(){this.state=A.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},C.onBufferFlushed=function(y,h){var c=h.type;if(c!==b.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var v=(c===b.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(v,c,D.PlaylistLevelType.MAIN)}},C.onLevelsUpdated=function(y,h){this.levels=h.levels},C.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},C.seekToStartPos=function(){var y=this.media,h=y.currentTime,c=this.startPosition;if(c>=0&&h<c){if(y.seeking){r.logger.log("could not seek to "+c+", already seeking at "+h);return}var v=P.BufferHelper.getBuffered(y),p=v.length?v.start(0):0,E=p-c;E>0&&(E<this.config.maxBufferHole||E<this.config.maxFragLookUpTolerance)&&(r.logger.log("adjusting start position by "+E+" to match buffer start"),c+=E,this.startPosition=c),this.log("seek to target start position "+c+" from current time "+h),y.currentTime=c}},C._getAudioCodec=function(y){var h=this.config.defaultAudioCodec||y.audioCodec;return this.audioCodecSwap&&h&&(this.log("Swapping audio codec"),h.indexOf("mp4a.40.5")!==-1?h="mp4a.40.2":h="mp4a.40.5"),h},C._loadBitrateTestFrag=function(y){var h=this;this._doFragLoad(y).then(function(c){var v=h.hls;if(!c||v.nextLoadLevel||h.fragContextChanged(y))return;h.fragLoadError=0,h.state=A.State.IDLE,h.startFragRequested=!1,h.bitrateTest=!1;var p=y.stats;p.parsing.start=p.parsing.end=p.buffering.start=p.buffering.end=self.performance.now(),v.trigger(H.Events.FRAG_LOADED,c)})},C._handleTransmuxComplete=function(y){var h,c="main",v=this.hls,p=y.remuxResult,E=y.chunkMeta,U=this.getCurrentContext(E);if(!U){this.warn("The loading context changed while buffering fragment "+E.sn+" of level "+E.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(E.level);return}var F=U.frag,z=U.part,G=U.level,B=p.video,T=p.text,V=p.id3,Z=p.initSegment,oe=this.altAudio?void 0:p.audio;if(this.fragContextChanged(F))return;if(this.state=A.State.PARSING,Z){Z.tracks&&(this._bufferInitSegment(G,Z.tracks,F,E),v.trigger(H.Events.FRAG_PARSING_INIT_SEGMENT,{frag:F,id:c,tracks:Z.tracks}));var pe=Z.initPTS,Ye=Z.timescale;Object(K.isFiniteNumber)(pe)&&(this.initPTS[F.cc]=pe,v.trigger(H.Events.INIT_PTS_FOUND,{frag:F,id:c,initPTS:pe,timescale:Ye}))}if(B&&p.independent!==!1){if(G.details){var xe=B.startPTS,Ie=B.endPTS,Je=B.startDTS,Ke=B.endDTS;if(z)z.elementaryStreams[B.type]={startPTS:xe,endPTS:Ie,startDTS:Je,endDTS:Ke};else if(B.firstKeyFrame&&B.independent&&(this.couldBacktrack=!0),B.dropped&&B.independent){var be=this.getLoadPosition()+this.config.maxBufferHole;if(be<xe){this.backtrack(F);return}F.setElementaryStreamInfo(B.type,F.start,Ie,F.start,Ke,!0)}F.setElementaryStreamInfo(B.type,xe,Ie,Je,Ke),this.bufferFragmentData(B,F,z,E)}}else if(p.independent===!1){this.backtrack(F);return}if(oe){var de=oe.startPTS,nt=oe.endPTS,Kt=oe.startDTS,jt=oe.endDTS;z&&(z.elementaryStreams[b.ElementaryStreamTypes.AUDIO]={startPTS:de,endPTS:nt,startDTS:Kt,endDTS:jt}),F.setElementaryStreamInfo(b.ElementaryStreamTypes.AUDIO,de,nt,Kt,jt),this.bufferFragmentData(oe,F,z,E)}if(V!=null&&(h=V.samples)!==null&&h!==void 0&&h.length){var wt={frag:F,id:c,samples:V.samples};v.trigger(H.Events.FRAG_PARSING_METADATA,wt)}if(T){var ze={frag:F,id:c,samples:T.samples};v.trigger(H.Events.FRAG_PARSING_USERDATA,ze)}},C._bufferInitSegment=function(y,h,c,v){var p=this;if(this.state!==A.State.PARSING)return;this.audioOnly=!!h.audio&&!h.video,this.altAudio&&!this.audioOnly&&delete h.audio;var E=h.audio,U=h.video,F=h.audiovideo;if(E){var z=y.audioCodec,G=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(z&&(z.indexOf("mp4a.40.5")!==-1?z="mp4a.40.2":z="mp4a.40.5"),E.metadata.channelCount!==1&&G.indexOf("firefox")===-1&&(z="mp4a.40.5")),G.indexOf("android")!==-1&&E.container!=="audio/mpeg"&&(z="mp4a.40.2",this.log("Android: force audio codec to "+z)),y.audioCodec&&y.audioCodec!==z&&this.log('Swapping manifest audio codec "'+y.audioCodec+'" for "'+z+'"'),E.levelCodec=z,E.id="main",this.log("Init audio buffer, container:"+E.container+", codecs[selected/level/parsed]=["+(z||"")+"/"+(y.audioCodec||"")+"/"+E.codec+"]")}U&&(U.levelCodec=y.videoCodec,U.id="main",this.log("Init video buffer, container:"+U.container+", codecs[level/parsed]=["+(y.videoCodec||"")+"/"+U.codec+"]")),F&&this.log("Init audiovideo buffer, container:"+F.container+", codecs[level/parsed]=["+(y.attrs.CODECS||"")+"/"+F.codec+"]"),this.hls.trigger(H.Events.BUFFER_CODECS,h),Object.keys(h).forEach(function(B){var T=h[B],V=T.initSegment;V!=null&&V.byteLength&&p.hls.trigger(H.Events.BUFFER_APPENDING,{type:B,data:V,frag:c,part:null,chunkMeta:v,parent:c.type})}),this.tick()},C.backtrack=function(y){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(y);var h=this.fragmentTracker.backtrack(y);this.fragPrevious=null,this.nextLoadPosition=y.start,h?this.resetFragmentLoading(y):this.state=A.State.BACKTRACKING},C.checkFragmentChanged=function(){var y=this.media,h=null;if(y&&y.readyState>1&&y.seeking===!1){var c=y.currentTime;if(P.BufferHelper.isBuffered(y,c)?h=this.getAppendedFrag(c):P.BufferHelper.isBuffered(y,c+.1)&&(h=this.getAppendedFrag(c+.1)),h){var v=this.fragPlaying,p=h.level;(!v||h.sn!==v.sn||v.level!==p||h.urlId!==v.urlId)&&(this.hls.trigger(H.Events.FRAG_CHANGED,{frag:h}),(!v||v.level!==p)&&this.hls.trigger(H.Events.LEVEL_SWITCHED,{level:p}),this.fragPlaying=h)}}},o(O,[{key:"nextLevel",get:function(){var y=this.nextBufferedFrag;return y?y.level:-1}},{key:"currentLevel",get:function(){var y=this.media;if(y){var h=this.getAppendedFrag(y.currentTime);if(h)return h.level}return-1}},{key:"nextBufferedFrag",get:function(){var y=this.media;if(y){var h=this.getAppendedFrag(y.currentTime);return this.followingBufferedFrag(h)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),O}(A.default)},"./src/controller/subtitle-stream-controller.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"SubtitleStreamController",function(){return a});var K=N("./src/events.ts"),A=N("./src/utils/logger.ts"),M=N("./src/utils/buffer-helper.ts"),H=N("./src/controller/fragment-finders.ts"),P=N("./src/utils/discontinuities.ts"),k=N("./src/controller/level-helper.ts"),D=N("./src/controller/fragment-tracker.ts"),b=N("./src/controller/base-stream-controller.ts"),m=N("./src/types/loader.ts"),f=N("./src/types/level.ts");function d(n,R){for(var w=0;w<R.length;w++){var x=R[w];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(n,x.key,x)}}function s(n,R,w){return R&&d(n.prototype,R),w&&d(n,w),n}function r(n,R){n.prototype=Object.create(R.prototype),n.prototype.constructor=n,u(n,R)}function u(n,R){return u=Object.setPrototypeOf||function(x,O){return x.__proto__=O,x},u(n,R)}var o=500,a=function(n){r(R,n);function R(x,O){var C;return C=n.call(this,x,O,"[subtitle-stream-controller]")||this,C.levels=[],C.currentTrackId=-1,C.tracksBuffered=[],C.mainDetails=null,C._registerListeners(),C}var w=R.prototype;return w.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},w._registerListeners=function(){var O=this.hls;O.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),O.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),O.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),O.on(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),O.on(K.Events.ERROR,this.onError,this),O.on(K.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),O.on(K.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),O.on(K.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),O.on(K.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),O.on(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},w._unregisterListeners=function(){var O=this.hls;O.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),O.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),O.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),O.off(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),O.off(K.Events.ERROR,this.onError,this),O.off(K.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),O.off(K.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),O.off(K.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),O.off(K.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),O.off(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},w.startLoad=function(){this.stopLoad(),this.state=b.State.IDLE,this.setInterval(o),this.tick()},w.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},w.onLevelLoaded=function(O,C){this.mainDetails=C.details},w.onSubtitleFragProcessed=function(O,C){var _=C.frag,y=C.success;if(this.fragPrevious=_,this.state=b.State.IDLE,!y)return;var h=this.tracksBuffered[this.currentTrackId];if(!h)return;for(var c,v=_.start,p=0;p<h.length;p++)if(v>=h[p].start&&v<=h[p].end){c=h[p];break}var E=_.start+_.duration;c?c.end=E:(c={start:v,end:E},h.push(c)),this.fragmentTracker.fragBuffered(_)},w.onBufferFlushing=function(O,C){var _=C.startOffset,y=C.endOffset;if(_===0&&y!==Number.POSITIVE_INFINITY){var h=this.currentTrackId,c=this.levels;if(!c.length||!c[h]||!c[h].details)return;var v=c[h].details,p=v.targetduration,E=y-p;if(E<=0)return;C.endOffsetSubtitles=Math.max(0,E),this.tracksBuffered.forEach(function(U){for(var F=0;F<U.length;){if(U[F].end<=E){U.shift();continue}else if(U[F].start<E)U[F].start=E;else break;F++}}),this.fragmentTracker.removeFragmentsInRange(_,E,m.PlaylistLevelType.SUBTITLE)}},w.onError=function(O,C){var _,y=C.frag;if(!y||y.type!==m.PlaylistLevelType.SUBTITLE)return;(_=this.fragCurrent)!==null&&_!==void 0&&_.loader&&this.fragCurrent.loader.abort(),this.state=b.State.IDLE},w.onSubtitleTracksUpdated=function(O,C){var _=this,y=C.subtitleTracks;this.tracksBuffered=[],this.levels=y.map(function(h){return new f.Level(h)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(h){_.tracksBuffered[h.id]=[]}),this.mediaBuffer=null},w.onSubtitleTrackSwitch=function(O,C){if(this.currentTrackId=C.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var _=this.levels[this.currentTrackId];_!=null&&_.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,_&&this.setInterval(o)},w.onSubtitleTrackLoaded=function(O,C){var _,y=C.details,h=C.id,c=this.currentTrackId,v=this.levels;if(!v.length)return;var p=v[c];if(h>=v.length||h!==c||!p)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,y.live||(_=p.details)!==null&&_!==void 0&&_.live){var E=this.mainDetails;if(y.deltaUpdateFailed||!E)return;var U=E.fragments[0];if(!p.details)y.hasProgramDateTime&&E.hasProgramDateTime?Object(P.alignMediaPlaylistByPDT)(y,E):U&&Object(k.addSliding)(y,U.start);else{var F=this.alignPlaylists(y,p.details);F===0&&U&&Object(k.addSliding)(y,U.start)}}if(p.details=y,this.levelLastLoaded=h,this.tick(),y.live&&!this.fragCurrent&&this.media&&this.state===b.State.IDLE){var z=Object(H.findFragmentByPTS)(null,y.fragments,this.media.currentTime,0);z||(this.warn("Subtitle playlist not aligned with playback"),p.details=void 0)}},w._handleFragmentLoadComplete=function(O){var C=O.frag,_=O.payload,y=C.decryptdata,h=this.hls;if(this.fragContextChanged(C))return;if(_&&_.byteLength>0&&y&&y.key&&y.iv&&y.method==="AES-128"){var c=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(_),y.key.buffer,y.iv.buffer).then(function(v){var p=performance.now();h.trigger(K.Events.FRAG_DECRYPTED,{frag:C,payload:v,stats:{tstart:c,tdecrypt:p}})})}},w.doTick=function(){if(!this.media){this.state=b.State.IDLE;return}if(this.state===b.State.IDLE){var O,C=this.currentTrackId,_=this.levels;if(!_.length||!_[C]||!_[C].details)return;var y=_[C].details,h=y.targetduration,c=this.config,v=this.media,p=M.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,v.currentTime-h,c.maxBufferHole),E=p.end,U=p.len,F=this.getMaxBufferLength()+h;if(U>F)return;console.assert(y,"Subtitle track details are defined on idle subtitle stream controller tick");var z=y.fragments,G=z.length,B=y.edge,T,V=this.fragPrevious;if(E<B){var Z=c.maxFragLookUpTolerance;V&&y.hasProgramDateTime&&(T=Object(H.findFragmentByPDT)(z,V.endProgramDateTime,Z)),T||(T=Object(H.findFragmentByPTS)(V,z,E,Z),!T&&V&&V.start<z[0].start&&(T=z[0]))}else T=z[G-1];(O=T)!==null&&O!==void 0&&O.encrypted?(A.logger.log("Loading key for "+T.sn),this.state=b.State.KEY_LOADING,this.hls.trigger(K.Events.KEY_LOADING,{frag:T})):T&&this.fragmentTracker.getState(T)===D.FragmentState.NOT_LOADED&&this.loadFragment(T,y,E)}},w.loadFragment=function(O,C,_){this.fragCurrent=O,n.prototype.loadFragment.call(this,O,C,_)},s(R,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),R}(b.default)},"./src/controller/subtitle-track-controller.ts":function(te,Y,N){"use strict";N.r(Y);var K=N("./src/events.ts"),A=N("./src/utils/texttrack-utils.ts"),M=N("./src/controller/base-playlist-controller.ts"),H=N("./src/types/loader.ts");function P(d,s){for(var r=0;r<s.length;r++){var u=s[r];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(d,u.key,u)}}function k(d,s,r){return s&&P(d.prototype,s),r&&P(d,r),d}function D(d,s){d.prototype=Object.create(s.prototype),d.prototype.constructor=d,b(d,s)}function b(d,s){return b=Object.setPrototypeOf||function(u,o){return u.__proto__=o,u},b(d,s)}var m=function(d){D(s,d);function s(u){var o;return o=d.call(this,u,"[subtitle-track-controller]")||this,o.media=null,o.tracks=[],o.groupId=null,o.tracksInGroup=[],o.trackId=-1,o.selectDefaultTrack=!0,o.queuedDefaultTrack=-1,o.trackChangeListener=function(){return o.onTextTracksChanged()},o.asyncPollTrackChange=function(){return o.pollTrackChange(0)},o.useTextTrackPolling=!1,o.subtitlePollingInterval=-1,o.subtitleDisplay=!0,o.registerListeners(),o}var r=s.prototype;return r.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,d.prototype.destroy.call(this)},r.registerListeners=function(){var o=this.hls;o.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on(K.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.on(K.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),o.on(K.Events.ERROR,this.onError,this)},r.unregisterListeners=function(){var o=this.hls;o.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(K.Events.LEVEL_LOADING,this.onLevelLoading,this),o.off(K.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.off(K.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),o.off(K.Events.ERROR,this.onError,this)},r.onMediaAttached=function(o,a){if(this.media=a.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},r.pollTrackChange=function(o){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,o)},r.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var o=f(this.media.textTracks);o.forEach(function(a){Object(A.clearCurrentCues)(a)}),this.subtitleTrack=-1,this.media=null},r.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},r.onManifestParsed=function(o,a){this.tracks=a.subtitleTracks},r.onSubtitleTrackLoaded=function(o,a){var n=a.id,R=a.details,w=this.trackId,x=this.tracksInGroup[w];if(!x){this.warn("Invalid subtitle track id "+n);return}var O=x.details;x.details=a.details,this.log("subtitle track "+n+" loaded ["+R.startSN+"-"+R.endSN+"]"),n===this.trackId&&(this.retryCount=0,this.playlistLoaded(n,a,O))},r.onLevelLoading=function(o,a){this.switchLevel(a.level)},r.onLevelSwitching=function(o,a){this.switchLevel(a.level)},r.switchLevel=function(o){var a=this.hls.levels[o];if(!(a!=null&&a.textGroupIds))return;var n=a.textGroupIds[a.urlId];if(this.groupId!==n){var R=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,w=this.tracks.filter(function(C){return!n||C.groupId===n});this.tracksInGroup=w;var x=this.findTrackId(R==null?void 0:R.name)||this.findTrackId();this.groupId=n;var O={subtitleTracks:w};this.log("Updating subtitle tracks, "+w.length+' track(s) found in "'+n+'" group-id'),this.hls.trigger(K.Events.SUBTITLE_TRACKS_UPDATED,O),x!==-1&&this.setSubtitleTrack(x,R)}},r.findTrackId=function(o){for(var a=this.tracksInGroup,n=0;n<a.length;n++){var R=a[n];if((!this.selectDefaultTrack||R.default)&&(!o||o===R.name))return R.id}return-1},r.onError=function(o,a){if(d.prototype.onError.call(this,o,a),a.fatal||!a.context)return;a.context.type===H.PlaylistContextType.SUBTITLE_TRACK&&a.context.id===this.trackId&&a.context.groupId===this.groupId&&this.retryLoadingOrFail(a)},r.loadPlaylist=function(o){var a=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(a)){var n=a.id,R=a.groupId,w=a.url;if(o)try{w=o.addDirectives(w)}catch(x){this.warn("Could not construct new URL with HLS Delivery Directives: "+x)}this.log("Loading subtitle playlist for id "+n),this.hls.trigger(K.Events.SUBTITLE_TRACK_LOADING,{url:w,id:n,groupId:R,deliveryDirectives:o||null})}},r.toggleTrackModes=function(o){var a=this,n=this.media,R=this.subtitleDisplay,w=this.trackId;if(!n)return;var x=f(n.textTracks),O=x.filter(function(y){return y.groupId===a.groupId});if(o===-1)[].slice.call(x).forEach(function(y){y.mode="disabled"});else{var C=O[w];C&&(C.mode="disabled")}var _=O[o];_&&(_.mode=R?"showing":"hidden")},r.setSubtitleTrack=function(o,a){var n,R=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=o;return}if(this.trackId!==o&&this.toggleTrackModes(o),this.trackId===o&&(o===-1||(n=R[o])!==null&&n!==void 0&&n.details)||o<-1||o>=R.length)return;this.clearTimer();var w=R[o];if(this.log("Switching to subtitle track "+o),this.trackId=o,w){var x=w.id,O=w.groupId,C=O===void 0?"":O,_=w.name,y=w.type,h=w.url;this.hls.trigger(K.Events.SUBTITLE_TRACK_SWITCH,{id:x,groupId:C,name:_,type:y,url:h});var c=this.switchParams(w.url,a==null?void 0:a.details);this.loadPlaylist(c)}else this.hls.trigger(K.Events.SUBTITLE_TRACK_SWITCH,{id:o})},r.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var o=-1,a=f(this.media.textTracks),n=0;n<a.length;n++)if(a[n].mode==="hidden")o=n;else if(a[n].mode==="showing"){o=n;break}this.subtitleTrack!==o&&(this.subtitleTrack=o)},k(s,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(o){this.selectDefaultTrack=!1;var a=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(o,a)}}]),s}(M.default);function f(d){for(var s=[],r=0;r<d.length;r++){var u=d[r];u.kind==="subtitles"&&u.label&&s.push(d[r])}return s}Y.default=m},"./src/controller/timeline-controller.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"TimelineController",function(){return f});var K=N("./src/polyfills/number.ts"),A=N("./src/events.ts"),M=N("./src/utils/cea-608-parser.ts"),H=N("./src/utils/output-filter.ts"),P=N("./src/utils/webvtt-parser.ts"),k=N("./src/utils/texttrack-utils.ts"),D=N("./src/utils/imsc1-ttml-parser.ts"),b=N("./src/types/loader.ts"),m=N("./src/utils/logger.ts"),f=function(){function u(a){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=r(),this.captionsProperties=void 0,this.hls=a,this.config=a.config,this.Cues=a.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var n=new H.default(this,"textTrack1"),R=new H.default(this,"textTrack2"),w=new H.default(this,"textTrack3"),x=new H.default(this,"textTrack4");this.cea608Parser1=new M.default(1,n,R),this.cea608Parser2=new M.default(3,w,x)}a.on(A.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.on(A.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(A.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(A.Events.MANIFEST_LOADED,this.onManifestLoaded,this),a.on(A.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),a.on(A.Events.FRAG_LOADING,this.onFragLoading,this),a.on(A.Events.FRAG_LOADED,this.onFragLoaded,this),a.on(A.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),a.on(A.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),a.on(A.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),a.on(A.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),a.on(A.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var o=u.prototype;return o.destroy=function(){var n=this.hls;n.off(A.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.off(A.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(A.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(A.Events.MANIFEST_LOADED,this.onManifestLoaded,this),n.off(A.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),n.off(A.Events.FRAG_LOADING,this.onFragLoading,this),n.off(A.Events.FRAG_LOADED,this.onFragLoaded,this),n.off(A.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),n.off(A.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),n.off(A.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),n.off(A.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),n.off(A.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},o.addCues=function(n,R,w,x,O){for(var C=!1,_=O.length;_--;){var y=O[_],h=s(y[0],y[1],R,w);if(h>=0&&(y[0]=Math.min(y[0],R),y[1]=Math.max(y[1],w),C=!0,h/(w-R)>.5))return}if(C||O.push([R,w]),this.config.renderTextTracksNatively){var c=this.captionsTracks[n];this.Cues.newCue(c,R,w,x)}else{var v=this.Cues.newCue(null,R,w,x);this.hls.trigger(A.Events.CUES_PARSED,{type:"captions",cues:v,track:n})}},o.onInitPtsFound=function(n,R){var w=this,x=R.frag,O=R.id,C=R.initPTS,_=R.timescale,y=this.unparsedVttFrags;O==="main"&&(this.initPTS[x.cc]=C,this.timescale[x.cc]=_),y.length&&(this.unparsedVttFrags=[],y.forEach(function(h){w.onFragLoaded(A.Events.FRAG_LOADED,h)}))},o.getExistingTrack=function(n){var R=this.media;if(R)for(var w=0;w<R.textTracks.length;w++){var x=R.textTracks[w];if(x[n])return x}return null},o.createCaptionsTrack=function(n){this.config.renderTextTracksNatively?this.createNativeTrack(n):this.createNonNativeTrack(n)},o.createNativeTrack=function(n){if(this.captionsTracks[n])return;var R=this.captionsProperties,w=this.captionsTracks,x=this.media,O=R[n],C=O.label,_=O.languageCode,y=this.getExistingTrack(n);if(y)w[n]=y,Object(k.clearCurrentCues)(w[n]),Object(k.sendAddTrackEvent)(w[n],x);else{var h=this.createTextTrack("captions",C,_);h&&(h[n]=!0,w[n]=h)}},o.createNonNativeTrack=function(n){if(this.nonNativeCaptionsTracks[n])return;var R=this.captionsProperties[n];if(!R)return;var w=R.label,x={_id:n,label:w,kind:"captions",default:R.media?!!R.media.default:!1,closedCaptions:R.media};this.nonNativeCaptionsTracks[n]=x,this.hls.trigger(A.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[x]})},o.createTextTrack=function(n,R,w){var x=this.media;return x?x.addTextTrack(n,R,w):void 0},o.onMediaAttaching=function(n,R){this.media=R.media,this._cleanTracks()},o.onMediaDetaching=function(){var n=this.captionsTracks;Object.keys(n).forEach(function(R){Object(k.clearCurrentCues)(n[R]),delete n[R]}),this.nonNativeCaptionsTracks={}},o.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=r(),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())},o._cleanTracks=function(){var n=this.media;if(!n)return;var R=n.textTracks;if(R)for(var w=0;w<R.length;w++)Object(k.clearCurrentCues)(R[w])},o.onSubtitleTracksUpdated=function(n,R){var w=this;this.textTracks=[];var x=R.subtitleTracks||[],O=x.some(function(h){return h.textCodec===D.IMSC1_CODEC});if(this.config.enableWebVTT||O&&this.config.enableIMSC1){var C=this.tracks&&x&&this.tracks.length===x.length;if(this.tracks=x||[],this.config.renderTextTracksNatively){var _=this.media?this.media.textTracks:[];this.tracks.forEach(function(h,c){var v;if(c<_.length){for(var p=null,E=0;E<_.length;E++)if(d(_[E],h)){p=_[E];break}p&&(v=p)}v?Object(k.clearCurrentCues)(v):(v=w.createTextTrack("subtitles",h.name,h.lang),v&&(v.mode="disabled")),v&&(v.groupId=h.groupId,w.textTracks.push(v))})}else if(!C&&this.tracks&&this.tracks.length){var y=this.tracks.map(function(h){return{label:h.name,kind:h.type.toLowerCase(),default:h.default,subtitleTrack:h}});this.hls.trigger(A.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:y})}}},o.onManifestLoaded=function(n,R){var w=this;this.config.enableCEA708Captions&&R.captions&&R.captions.forEach(function(x){var O=/(?:CC|SERVICE)([1-4])/.exec(x.instreamId);if(!O)return;var C="textTrack"+O[1],_=w.captionsProperties[C];if(!_)return;_.label=x.name,x.lang&&(_.languageCode=x.lang),_.media=x})},o.onFragLoading=function(n,R){var w=this.cea608Parser1,x=this.cea608Parser2,O=this.lastSn,C=this.lastPartIndex;if(!this.enabled||!(w&&x))return;if(R.frag.type===b.PlaylistLevelType.MAIN){var _,y,h=R.frag.sn,c=(_=R==null||((y=R.part)===null||y===void 0)?void 0:y.index)!=null?_:-1;h===O+1||h===O&&c===C+1||(w.reset(),x.reset()),this.lastSn=h,this.lastPartIndex=c}},o.onFragLoaded=function(n,R){var w=R.frag,x=R.payload,O=this.initPTS,C=this.unparsedVttFrags;if(w.type===b.PlaylistLevelType.SUBTITLE)if(x.byteLength){if(!Object(K.isFiniteNumber)(O[w.cc])){C.push(R),O.length&&this.hls.trigger(A.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:w,error:new Error("Missing initial subtitle PTS")});return}var _=w.decryptdata;if(_==null||_.key==null||_.method!=="AES-128"){var y=this.tracks[w.level],h=this.vttCCs;h[w.cc]||(h[w.cc]={start:w.start,prevCC:this.prevCC,new:!0},this.prevCC=w.cc),y&&y.textCodec===D.IMSC1_CODEC?this._parseIMSC1(w,x):this._parseVTTs(w,x,h)}}else this.hls.trigger(A.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:w,error:new Error("Empty subtitle payload")})},o._parseIMSC1=function(n,R){var w=this,x=this.hls;Object(D.parseIMSC1)(R,this.initPTS[n.cc],this.timescale[n.cc],function(O){w._appendCues(O,n.level),x.trigger(A.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},function(O){m.logger.log("Failed to parse IMSC1: "+O),x.trigger(A.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:O})})},o._parseVTTs=function(n,R,w){var x=this,O=this.hls;Object(P.parseWebVTT)(R,this.initPTS[n.cc],this.timescale[n.cc],w,n.cc,n.start,function(C){x._appendCues(C,n.level),O.trigger(A.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},function(C){x._fallbackToIMSC1(n,R),m.logger.log("Failed to parse VTT cue: "+C),O.trigger(A.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:C})})},o._fallbackToIMSC1=function(n,R){var w=this,x=this.tracks[n.level];x.textCodec||Object(D.parseIMSC1)(R,this.initPTS[n.cc],this.timescale[n.cc],function(){x.textCodec=D.IMSC1_CODEC,w._parseIMSC1(n,R)},function(){x.textCodec="wvtt"})},o._appendCues=function(n,R){var w=this.hls;if(this.config.renderTextTracksNatively){var x=this.textTracks[R];if(x.mode==="disabled")return;n.forEach(function(_){return Object(k.addCueToTrack)(x,_)})}else{var O=this.tracks[R],C=O.default?"default":"subtitles"+R;w.trigger(A.Events.CUES_PARSED,{type:"subtitles",cues:n,track:C})}},o.onFragDecrypted=function(n,R){var w=R.frag;if(w.type===b.PlaylistLevelType.SUBTITLE){if(!Object(K.isFiniteNumber)(this.initPTS[w.cc])){this.unparsedVttFrags.push(R);return}this.onFragLoaded(A.Events.FRAG_LOADED,R)}},o.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},o.onFragParsingUserdata=function(n,R){var w=this.cea608Parser1,x=this.cea608Parser2;if(!this.enabled||!(w&&x))return;for(var O=0;O<R.samples.length;O++){var C=R.samples[O].bytes;if(C){var _=this.extractCea608Data(C);w.addData(R.samples[O].pts,_[0]),x.addData(R.samples[O].pts,_[1])}}},o.onBufferFlushing=function(n,R){var w=R.startOffset,x=R.endOffset,O=R.endOffsetSubtitles,C=R.type,_=this.media;if(!_||_.currentTime<x)return;if(!C||C==="video"){var y=this.captionsTracks;Object.keys(y).forEach(function(c){return Object(k.removeCuesInRange)(y[c],w,x)})}if(this.config.renderTextTracksNatively&&(w===0&&O!==void 0)){var h=this.textTracks;Object.keys(h).forEach(function(c){return Object(k.removeCuesInRange)(h[c],w,O)})}},o.extractCea608Data=function(n){for(var R=n[0]&31,w=2,x=[[],[]],O=0;O<R;O++){var C=n[w++],_=127&n[w++],y=127&n[w++],h=(4&C)!==0,c=3&C;if(_===0&&y===0)continue;h&&((c===0||c===1)&&(x[c].push(_),x[c].push(y)))}return x},u}();function d(u,o){return u&&u.label===o.name&&!(u.textTrack1||u.textTrack2)}function s(u,o,a,n){return Math.min(o,n)-Math.max(u,a)}function r(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return K});var K=function(){function A(H,P){this.subtle=void 0,this.aesIV=void 0,this.subtle=H,this.aesIV=P}var M=A.prototype;return M.decrypt=function(P,k){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},k,P)},A}()},"./src/crypt/aes-decryptor.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"removePadding",function(){return A}),N.d(Y,"default",function(){return M});var K=N("./src/utils/typed-array.ts");function A(H){var P=H.byteLength,k=P&&new DataView(H.buffer).getUint8(P-1);return k?Object(K.sliceUint8)(H,0,P-k):H}var M=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 P=H.prototype;return P.uint8ArrayToUint32Array_=function(D){for(var b=new DataView(D),m=new Uint32Array(4),f=0;f<4;f++)m[f]=b.getUint32(f*4);return m},P.initTable=function(){var D=this.sBox,b=this.invSBox,m=this.subMix,f=m[0],d=m[1],s=m[2],r=m[3],u=this.invSubMix,o=u[0],a=u[1],n=u[2],R=u[3],w=new Uint32Array(256),x=0,O=0,C=0;for(C=0;C<256;C++)C<128?w[C]=C<<1:w[C]=C<<1^283;for(C=0;C<256;C++){var _=O^O<<1^O<<2^O<<3^O<<4;_=_>>>8^_&255^99,D[x]=_,b[_]=x;var y=w[x],h=w[y],c=w[h],v=w[_]*257^_*16843008;f[x]=v<<24|v>>>8,d[x]=v<<16|v>>>16,s[x]=v<<8|v>>>24,r[x]=v,v=c*16843009^h*65537^y*257^x*16843008,o[_]=v<<24|v>>>8,a[_]=v<<16|v>>>16,n[_]=v<<8|v>>>24,R[_]=v,x?(x=y^w[w[w[c^y]]],O^=w[w[O]]):x=O=1}},P.expandKey=function(D){for(var b=this.uint8ArrayToUint32Array_(D),m=!0,f=0;f<b.length&&m;)m=b[f]===this.key[f],f++;if(m)return;this.key=b;var d=this.keySize=b.length;if(d!==4&&d!==6&&d!==8)throw new Error("Invalid aes key size="+d);var s=this.ksRows=(d+6+1)*4,r,u,o=this.keySchedule=new Uint32Array(s),a=this.invKeySchedule=new Uint32Array(s),n=this.sBox,R=this.rcon,w=this.invSubMix,x=w[0],O=w[1],C=w[2],_=w[3],y,h;for(r=0;r<s;r++){if(r<d){y=o[r]=b[r];continue}h=y,r%d===0?(h=h<<8|h>>>24,h=n[h>>>24]<<24|n[h>>>16&255]<<16|n[h>>>8&255]<<8|n[h&255],h^=R[r/d|0]<<24):d>6&&r%d===4&&(h=n[h>>>24]<<24|n[h>>>16&255]<<16|n[h>>>8&255]<<8|n[h&255]),o[r]=y=(o[r-d]^h)>>>0}for(u=0;u<s;u++)r=s-u,u&3?h=o[r]:h=o[r-4],u<4||r<=4?a[u]=h:a[u]=x[n[h>>>24]]^O[n[h>>>16&255]]^C[n[h>>>8&255]]^_[n[h&255]],a[u]=a[u]>>>0},P.networkToHostOrderSwap=function(D){return D<<24|(D&65280)<<8|(D&16711680)>>8|D>>>24},P.decrypt=function(D,b,m){for(var f=this.keySize+6,d=this.invKeySchedule,s=this.invSBox,r=this.invSubMix,u=r[0],o=r[1],a=r[2],n=r[3],R=this.uint8ArrayToUint32Array_(m),w=R[0],x=R[1],O=R[2],C=R[3],_=new Int32Array(D),y=new Int32Array(_.length),h,c,v,p,E,U,F,z,G,B,T,V,Z,oe,pe=this.networkToHostOrderSwap;b<_.length;){for(G=pe(_[b]),B=pe(_[b+1]),T=pe(_[b+2]),V=pe(_[b+3]),E=G^d[0],U=V^d[1],F=T^d[2],z=B^d[3],Z=4,oe=1;oe<f;oe++)h=u[E>>>24]^o[U>>16&255]^a[F>>8&255]^n[z&255]^d[Z],c=u[U>>>24]^o[F>>16&255]^a[z>>8&255]^n[E&255]^d[Z+1],v=u[F>>>24]^o[z>>16&255]^a[E>>8&255]^n[U&255]^d[Z+2],p=u[z>>>24]^o[E>>16&255]^a[U>>8&255]^n[F&255]^d[Z+3],E=h,U=c,F=v,z=p,Z=Z+4;h=s[E>>>24]<<24^s[U>>16&255]<<16^s[F>>8&255]<<8^s[z&255]^d[Z],c=s[U>>>24]<<24^s[F>>16&255]<<16^s[z>>8&255]<<8^s[E&255]^d[Z+1],v=s[F>>>24]<<24^s[z>>16&255]<<16^s[E>>8&255]<<8^s[U&255]^d[Z+2],p=s[z>>>24]<<24^s[E>>16&255]<<16^s[U>>8&255]<<8^s[F&255]^d[Z+3],y[b]=pe(h^w),y[b+1]=pe(p^x),y[b+2]=pe(v^O),y[b+3]=pe(c^C),w=G,x=B,O=T,C=V,b=b+4}return y.buffer},H}()},"./src/crypt/decrypter.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return b});var K=N("./src/crypt/aes-crypto.ts"),A=N("./src/crypt/fast-aes-key.ts"),M=N("./src/crypt/aes-decryptor.ts"),H=N("./src/utils/logger.ts"),P=N("./src/utils/mp4-tools.ts"),k=N("./src/utils/typed-array.ts"),D=16,b=function(){function m(d,s,r){var u=r===void 0?{}:r,o=u.removePKCS7Padding,a=o===void 0?!0:o;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=d,this.config=s,this.removePKCS7Padding=a,a)try{var n=self.crypto;n&&(this.subtle=n.subtle||n.webkitSubtle)}catch(R){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var f=m.prototype;return f.destroy=function(){this.observer=null},f.isSync=function(){return this.config.enableSoftwareAES},f.flush=function(){var s=this.currentResult;if(!s){this.reset();return}var r=new Uint8Array(s);return this.reset(),this.removePKCS7Padding?Object(M.removePadding)(r):r},f.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},f.decrypt=function(s,r,u,o){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(s),r,u);var a=this.flush();a&&o(a.buffer)}else this.webCryptoDecrypt(new Uint8Array(s),r,u).then(o)},f.softwareDecrypt=function(s,r,u){var o=this.currentIV,a=this.currentResult,n=this.remainderData;this.logOnce("JS AES decrypt"),n&&(s=Object(P.appendUint8Array)(n,s),this.remainderData=null);var R=this.getValidChunk(s);if(!R.length)return null;o&&(u=o);var w=this.softwareDecrypter;w||(w=this.softwareDecrypter=new M.default),w.expandKey(r);var x=a;return this.currentResult=w.decrypt(R.buffer,0,u),this.currentIV=Object(k.sliceUint8)(R,-16).buffer,x||null},f.webCryptoDecrypt=function(s,r,u){var o=this,a=this.subtle;return(this.key!==r||!this.fastAesKey)&&(this.key=r,this.fastAesKey=new A.default(a,r)),this.fastAesKey.expandKey().then(function(n){if(!a)return Promise.reject(new Error("web crypto not initialized"));var R=new K.default(a,u);return R.decrypt(s.buffer,n)}).catch(function(n){return o.onWebCryptoError(n,s,r,u)})},f.onWebCryptoError=function(s,r,u,o){return H.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",s),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(r,u,o)},f.getValidChunk=function(s){var r=s,u=s.length-s.length%D;return u!==s.length&&(r=Object(k.sliceUint8)(s,0,u),this.remainderData=Object(k.sliceUint8)(s,u)),r},f.logOnce=function(s){if(!this.logEnabled)return;H.logger.log("[decrypter.ts]: "+s),this.logEnabled=!1},m}()},"./src/crypt/fast-aes-key.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return K});var K=function(){function A(H,P){this.subtle=void 0,this.key=void 0,this.subtle=H,this.key=P}var M=A.prototype;return M.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},A}()},"./src/demux/aacdemuxer.ts":function(te,Y,N){"use strict";N.r(Y);var K=N("./src/demux/base-audio-demuxer.ts"),A=N("./src/demux/adts.ts"),M=N("./src/utils/logger.ts"),H=N("./src/demux/id3.ts");function P(b,m){b.prototype=Object.create(m.prototype),b.prototype.constructor=b,k(b,m)}function k(b,m){return k=Object.setPrototypeOf||function(d,s){return d.__proto__=s,d},k(b,m)}var D=function(b){P(m,b);function m(d,s){var r;return r=b.call(this)||this,r.observer=void 0,r.config=void 0,r.observer=d,r.config=s,r}var f=m.prototype;return f.resetInitSegment=function(s,r,u){b.prototype.resetInitSegment.call(this,s,r,u),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:s,duration:u,inputTimeScale:9e4,dropped:0}},m.probe=function(s){if(!s)return!1;for(var r=H.getID3Data(s,0)||[],u=r.length,o=s.length;u<o;u++)if(A.probe(s,u))return M.logger.log("ADTS sync word found !"),!0;return!1},f.canParse=function(s,r){return A.canParse(s,r)},f.appendFrame=function(s,r,u){A.initTrackConfig(s,this.observer,r,u,s.manifestCodec);var o=A.appendFrame(s,r,u,this.initPTS,this.frameIndex);if(o&&o.missing===0)return o},m}(K.default);D.minProbeByteLength=9,Y.default=D},"./src/demux/adts.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"getAudioConfig",function(){return H}),N.d(Y,"isHeaderPattern",function(){return P}),N.d(Y,"getHeaderLength",function(){return k}),N.d(Y,"getFullFrameLength",function(){return D}),N.d(Y,"canGetFrameLength",function(){return b}),N.d(Y,"isHeader",function(){return m}),N.d(Y,"canParse",function(){return f}),N.d(Y,"probe",function(){return d}),N.d(Y,"initTrackConfig",function(){return s}),N.d(Y,"getFrameDuration",function(){return r}),N.d(Y,"parseFrameHeader",function(){return u}),N.d(Y,"appendFrame",function(){return o});var K=N("./src/utils/logger.ts"),A=N("./src/errors.ts"),M=N("./src/events.ts");function H(a,n,R,w){var x,O,C,_,y=navigator.userAgent.toLowerCase(),h=w,c=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];x=((n[R+2]&192)>>>6)+1;var v=(n[R+2]&60)>>>2;if(v>c.length-1){a.trigger(M.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+v});return}return C=(n[R+2]&1)<<2,C|=(n[R+3]&192)>>>6,K.logger.log("manifest codec:"+w+", ADTS type:"+x+", samplingIndex:"+v),/firefox/i.test(y)?v>=6?(x=5,_=new Array(4),O=v-3):(x=2,_=new Array(2),O=v):y.indexOf("android")!==-1?(x=2,_=new Array(2),O=v):(x=5,_=new Array(4),w&&(w.indexOf("mp4a.40.29")!==-1||w.indexOf("mp4a.40.5")!==-1)||!w&&v>=6?O=v-3:((w&&w.indexOf("mp4a.40.2")!==-1&&(v>=6&&C===1||/vivaldi/i.test(y))||!w&&C===1)&&(x=2,_=new Array(2)),O=v)),_[0]=x<<3,_[0]|=(v&14)>>1,_[1]|=(v&1)<<7,_[1]|=C<<3,x===5&&(_[1]|=(O&14)>>1,_[2]=(O&1)<<7,_[2]|=2<<2,_[3]=0),{config:_,samplerate:c[v],channelCount:C,codec:"mp4a.40."+x,manifestCodec:h}}function P(a,n){return a[n]===255&&(a[n+1]&246)===240}function k(a,n){return a[n+1]&1?7:9}function D(a,n){return(a[n+3]&3)<<11|a[n+4]<<3|(a[n+5]&224)>>>5}function b(a,n){return n+5<a.length}function m(a,n){return n+1<a.length&&P(a,n)}function f(a,n){return b(a,n)&&P(a,n)&&D(a,n)<=a.length-n}function d(a,n){if(m(a,n)){var R=k(a,n);if(n+R>=a.length)return!1;var w=D(a,n);if(w<=R)return!1;var x=n+w;return x===a.length||m(a,x)}return!1}function s(a,n,R,w,x){if(!a.samplerate){var O=H(n,R,w,x);if(!O)return;a.config=O.config,a.samplerate=O.samplerate,a.channelCount=O.channelCount,a.codec=O.codec,a.manifestCodec=O.manifestCodec,K.logger.log("parsed codec:"+a.codec+", rate:"+O.samplerate+", channels:"+O.channelCount)}}function r(a){return 1024*9e4/a}function u(a,n,R,w,x){var O=k(a,n),C=D(a,n);if(C-=O,C>0){var _=R+w*x;return{headerLength:O,frameLength:C,stamp:_}}}function o(a,n,R,w,x){var O=r(a.samplerate),C=u(n,R,w,x,O);if(C){var _=C.frameLength,y=C.headerLength,h=C.stamp,c=y+_,v=Math.max(0,R+c-n.length),p;v?(p=new Uint8Array(c-y),p.set(n.subarray(R+y,n.length),0)):p=n.subarray(R+y,R+c);var E={unit:p,pts:h};return v||a.samples.push(E),{sample:E,length:c,missing:v}}}},"./src/demux/base-audio-demuxer.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"initPTSFn",function(){return D});var K=N("./src/polyfills/number.ts"),A=N("./src/demux/id3.ts"),M=N("./src/demux/dummy-demuxed-track.ts"),H=N("./src/utils/mp4-tools.ts"),P=N("./src/utils/typed-array.ts"),k=function(){function b(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var m=b.prototype;return m.resetInitSegment=function(d,s,r){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},m.resetTimeStamp=function(){},m.resetContiguity=function(){},m.canParse=function(d,s){return!1},m.appendFrame=function(d,s,r){},m.demux=function(d,s){this.cachedData&&(d=Object(H.appendUint8Array)(this.cachedData,d),this.cachedData=null);var r=A.getID3Data(d,0),u=r?r.length:0,o,a,n=this._audioTrack,R=this._id3Track,w=r?A.getTimeStamp(r):void 0,x=d.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=D(w,s)),r&&r.length>0&&R.samples.push({pts:this.initPTS,dts:this.initPTS,data:r}),a=this.initPTS;u<x;){if(this.canParse(d,u)){var O=this.appendFrame(n,d,u);O?(this.frameIndex++,a=O.sample.pts,u+=O.length,o=u):u=x}else A.canParse(d,u)?(r=A.getID3Data(d,u),R.samples.push({pts:a,dts:a,data:r}),u+=r.length,o=u):u++;if(u===x&&o!==x){var C=Object(P.sliceUint8)(d,o);this.cachedData?this.cachedData=Object(H.appendUint8Array)(this.cachedData,C):this.cachedData=C}}return{audioTrack:n,avcTrack:Object(M.dummyTrack)(),id3Track:R,textTrack:Object(M.dummyTrack)()}},m.demuxSampleAes=function(d,s,r){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},m.flush=function(d){var s=this.cachedData;return s&&(this.cachedData=null,this.demux(s,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(M.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(M.dummyTrack)()}},m.destroy=function(){},b}(),D=function(m,f){return Object(K.isFiniteNumber)(m)?m*90:f*9e4};Y.default=k},"./src/demux/chunk-cache.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return K});var K=function(){function M(){this.chunks=[],this.dataLength=0}var H=M.prototype;return H.push=function(k){this.chunks.push(k),this.dataLength+=k.length},H.flush=function(){var k=this.chunks,D=this.dataLength,b;if(k.length)k.length===1?b=k[0]:b=A(k,D);else return new Uint8Array(0);return this.reset(),b},H.reset=function(){this.chunks.length=0,this.dataLength=0},M}();function A(M,H){for(var P=new Uint8Array(H),k=0,D=0;D<M.length;D++){var b=M[D];P.set(b,k),k+=b.length}return P}},"./src/demux/dummy-demuxed-track.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"dummyTrack",function(){return K});function K(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(te,Y,N){"use strict";N.r(Y);var K=N("./src/utils/logger.ts"),A=function(){function M(P){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=P,this.bytesAvailable=P.byteLength,this.word=0,this.bitsAvailable=0}var H=M.prototype;return H.loadWord=function(){var k=this.data,D=this.bytesAvailable,b=k.byteLength-D,m=new Uint8Array(4),f=Math.min(4,D);if(f===0)throw new Error("no bytes available");m.set(k.subarray(b,b+f)),this.word=new DataView(m.buffer).getUint32(0),this.bitsAvailable=f*8,this.bytesAvailable-=f},H.skipBits=function(k){var D;this.bitsAvailable>k?(this.word<<=k,this.bitsAvailable-=k):(k-=this.bitsAvailable,D=k>>3,k-=D>>3,this.bytesAvailable-=D,this.loadWord(),this.word<<=k,this.bitsAvailable-=k)},H.readBits=function(k){var D=Math.min(this.bitsAvailable,k),b=this.word>>>32-D;return k>32&&K.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=D,this.bitsAvailable>0?this.word<<=D:this.bytesAvailable>0&&this.loadWord(),D=k-D,D>0&&this.bitsAvailable?b<<D|this.readBits(D):b},H.skipLZ=function(){var k;for(k=0;k<this.bitsAvailable;++k)if((this.word&2147483648>>>k)!==0)return this.word<<=k,this.bitsAvailable-=k,k;return this.loadWord(),k+this.skipLZ()},H.skipUEG=function(){this.skipBits(1+this.skipLZ())},H.skipEG=function(){this.skipBits(1+this.skipLZ())},H.readUEG=function(){var k=this.skipLZ();return this.readBits(k+1)-1},H.readEG=function(){var k=this.readUEG();return 1&k?1+k>>>1:-1*(k>>>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(k){for(var D=8,b=8,m,f=0;f<k;f++)b!==0&&(m=this.readEG(),b=(D+m+256)%256),D=b===0?D:b},H.readSPS=function(){var k=0,D=0,b=0,m=0,f,d,s,r=this.readUByte.bind(this),u=this.readBits.bind(this),o=this.readUEG.bind(this),a=this.readBoolean.bind(this),n=this.skipBits.bind(this),R=this.skipEG.bind(this),w=this.skipUEG.bind(this),x=this.skipScalingList.bind(this);r();var O=r();if(u(5),n(3),r(),w(),O===100||O===110||O===122||O===244||O===44||O===83||O===86||O===118||O===128){var C=o();if(C===3&&n(1),w(),w(),n(1),a())for(d=C!==3?8:12,s=0;s<d;s++)a()&&(s<6?x(16):x(64))}w();var _=o();if(_===0)o();else if(_===1)for(n(1),R(),R(),f=o(),s=0;s<f;s++)R();w(),n(1);var y=o(),h=o(),c=u(1);c===0&&n(1),n(1),a()&&(k=o(),D=o(),b=o(),m=o());var v=[1,1];if(a()&&a()){var p=r();switch(p){case 1:v=[1,1];break;case 2:v=[12,11];break;case 3:v=[10,11];break;case 4:v=[16,11];break;case 5:v=[40,33];break;case 6:v=[24,11];break;case 7:v=[20,11];break;case 8:v=[32,11];break;case 9:v=[80,33];break;case 10:v=[18,11];break;case 11:v=[15,11];break;case 12:v=[64,33];break;case 13:v=[160,99];break;case 14:v=[4,3];break;case 15:v=[3,2];break;case 16:v=[2,1];break;case 255:{v=[r()<<8|r(),r()<<8|r()];break}}}return{width:Math.ceil((y+1)*16-k*2-D*2),height:(2-c)*(h+1)*16-(c?2:4)*(b+m),pixelRatio:v}},H.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},M}();Y.default=A},"./src/demux/id3.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"isHeader",function(){return K}),N.d(Y,"isFooter",function(){return A}),N.d(Y,"getID3Data",function(){return M}),N.d(Y,"canParse",function(){return P}),N.d(Y,"getTimeStamp",function(){return k}),N.d(Y,"isTimeStampFrame",function(){return D}),N.d(Y,"getID3Frames",function(){return m}),N.d(Y,"decodeFrame",function(){return f}),N.d(Y,"utf8ArrayToStr",function(){return o}),N.d(Y,"testables",function(){return a});var K=function(x,O){return O+10<=x.length&&(x[O]===73&&x[O+1]===68&&x[O+2]===51&&(x[O+3]<255&&x[O+4]<255&&(x[O+6]<128&&x[O+7]<128&&x[O+8]<128&&x[O+9]<128)))},A=function(x,O){return O+10<=x.length&&(x[O]===51&&x[O+1]===68&&x[O+2]===73&&(x[O+3]<255&&x[O+4]<255&&(x[O+6]<128&&x[O+7]<128&&x[O+8]<128&&x[O+9]<128)))},M=function(x,O){for(var C=O,_=0;K(x,O);){_+=10;var y=H(x,O+6);_+=y,A(x,O+10)&&(_+=10),O+=_}return _>0?x.subarray(C,C+_):void 0},H=function(x,O){var C=0;return C=(x[O]&127)<<21,C|=(x[O+1]&127)<<14,C|=(x[O+2]&127)<<7,C|=x[O+3]&127,C},P=function(x,O){return K(x,O)&&H(x,O+6)+10<=x.length-O},k=function(x){for(var O=m(x),C=0;C<O.length;C++){var _=O[C];if(D(_))return u(_)}return},D=function(x){return x&&x.key==="PRIV"&&x.info==="com.apple.streaming.transportStreamTimestamp"},b=function(x){var O=String.fromCharCode(x[0],x[1],x[2],x[3]),C=H(x,4),_=10;return{type:O,size:C,data:x.subarray(_,_+C)}},m=function(x){for(var O=0,C=[];K(x,O);){var _=H(x,O+6);O+=10;for(var y=O+_;O+8<y;){var h=b(x.subarray(O)),c=f(h);c&&C.push(c),O+=h.size+10}A(x,O)&&(O+=10)}return C},f=function(x){return x.type==="PRIV"?d(x):x.type[0]==="W"?r(x):s(x)},d=function(x){if(x.size<2)return;var O=o(x.data,!0),C=new Uint8Array(x.data.subarray(O.length+1));return{key:x.type,info:O,data:C.buffer}},s=function(x){if(x.size<2)return;if(x.type==="TXXX"){var O=1,C=o(x.data.subarray(O),!0);O+=C.length+1;var _=o(x.data.subarray(O));return{key:x.type,info:C,data:_}}var y=o(x.data.subarray(1));return{key:x.type,data:y}},r=function(x){if(x.type==="WXXX"){if(x.size<2)return;var O=1,C=o(x.data.subarray(O),!0);O+=C.length+1;var _=o(x.data.subarray(O));return{key:x.type,info:C,data:_}}var y=o(x.data);return{key:x.type,data:y}},u=function(x){if(x.data.byteLength===8){var O=new Uint8Array(x.data),C=O[3]&1,_=(O[4]<<23)+(O[5]<<15)+(O[6]<<7)+O[7];return _/=45,C&&(_+=4772185884e-2),Math.round(_)}return},o=function(x,O){O===void 0&&(O=!1);var C=R();if(C){var _=C.decode(x);if(O){var y=_.indexOf("\0");return y!==-1?_.substring(0,y):_}return _.replace(/\0/g,"")}for(var h=x.length,c,v,p,E="",U=0;U<h;){if(c=x[U++],c===0&&O)return E;if(c===0||c===3)continue;switch(c>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:E+=String.fromCharCode(c);break;case 12:case 13:v=x[U++],E+=String.fromCharCode((c&31)<<6|v&63);break;case 14:v=x[U++],p=x[U++],E+=String.fromCharCode((c&15)<<12|(v&63)<<6|(p&63)<<0);break;default:}}return E},a={decodeTextFrame:s},n;function R(){return!n&&typeof self.TextDecoder!="undefined"&&(n=new self.TextDecoder("utf-8")),n}},"./src/demux/mp3demuxer.ts":function(te,Y,N){"use strict";N.r(Y);var K=N("./src/demux/base-audio-demuxer.ts"),A=N("./src/demux/id3.ts"),M=N("./src/utils/logger.ts"),H=N("./src/demux/mpegaudio.ts");function P(b,m){b.prototype=Object.create(m.prototype),b.prototype.constructor=b,k(b,m)}function k(b,m){return k=Object.setPrototypeOf||function(d,s){return d.__proto__=s,d},k(b,m)}var D=function(b){P(m,b);function m(){return b.apply(this,arguments)||this}var f=m.prototype;return f.resetInitSegment=function(s,r,u){b.prototype.resetInitSegment.call(this,s,r,u),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:s,duration:u,inputTimeScale:9e4,dropped:0}},m.probe=function(s){if(!s)return!1;for(var r=A.getID3Data(s,0)||[],u=r.length,o=s.length;u<o;u++)if(H.probe(s,u))return M.logger.log("MPEG Audio sync word found !"),!0;return!1},f.canParse=function(s,r){return H.canParse(s,r)},f.appendFrame=function(s,r,u){return this.initPTS===null?void 0:H.appendFrame(s,r,u,this.initPTS,this.frameIndex)},m}(K.default);D.minProbeByteLength=4,Y.default=D},"./src/demux/mp4demuxer.ts":function(te,Y,N){"use strict";N.r(Y);var K=N("./src/utils/mp4-tools.ts"),A=N("./src/demux/dummy-demuxed-track.ts"),M=function(){function H(k,D){this.remainderData=null,this.config=void 0,this.config=D}var P=H.prototype;return P.resetTimeStamp=function(){},P.resetInitSegment=function(){},P.resetContiguity=function(){},H.probe=function(D){return Object(K.findBox)({data:D,start:0,end:Math.min(D.length,16384)},["moof"]).length>0},P.demux=function(D){var b=D,m=Object(A.dummyTrack)();if(this.config.progressive){this.remainderData&&(b=Object(K.appendUint8Array)(this.remainderData,D));var f=Object(K.segmentValidRange)(b);this.remainderData=f.remainder,m.samples=f.valid||new Uint8Array}else m.samples=b;return{audioTrack:Object(A.dummyTrack)(),avcTrack:m,id3Track:Object(A.dummyTrack)(),textTrack:Object(A.dummyTrack)()}},P.flush=function(){var D=Object(A.dummyTrack)();return D.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(A.dummyTrack)(),avcTrack:D,id3Track:Object(A.dummyTrack)(),textTrack:Object(A.dummyTrack)()}},P.demuxSampleAes=function(D,b,m){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},P.destroy=function(){},H}();M.minProbeByteLength=1024,Y.default=M},"./src/demux/mpegaudio.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"appendFrame",function(){return k}),N.d(Y,"parseHeader",function(){return D}),N.d(Y,"isHeaderPattern",function(){return b}),N.d(Y,"isHeader",function(){return m}),N.d(Y,"canParse",function(){return f}),N.d(Y,"probe",function(){return d});var K=null,A=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],M=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],H=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],P=[0,1,1,4];function k(s,r,u,o,a){if(u+24>r.length)return;var n=D(r,u);if(n&&u+n.frameLength<=r.length){var R=n.samplesPerFrame*9e4/n.sampleRate,w=o+a*R,x={unit:r.subarray(u,u+n.frameLength),pts:w,dts:w};return s.config=[],s.channelCount=n.channelCount,s.samplerate=n.sampleRate,s.samples.push(x),{sample:x,length:n.frameLength,missing:0}}}function D(s,r){var u=s[r+1]>>3&3,o=s[r+1]>>1&3,a=s[r+2]>>4&15,n=s[r+2]>>2&3;if(u!==1&&a!==0&&a!==15&&n!==3){var R=s[r+2]>>1&1,w=s[r+3]>>6,x=u===3?3-o:o===3?3:4,O=A[x*14+a-1]*1e3,C=u===3?0:u===2?1:2,_=M[C*3+n],y=w===3?1:2,h=H[u][o],c=P[o],v=h*8*c,p=Math.floor(h*O/_+R)*c;if(K===null){var E=navigator.userAgent||"",U=E.match(/Chrome\/(\d+)/i);K=U?parseInt(U[1]):0}var F=!!K&&K<=87;return F&&o===2&&O>=224e3&&w===0&&(s[r+3]=s[r+3]|128),{sampleRate:_,channelCount:y,frameLength:p,samplesPerFrame:v}}}function b(s,r){return s[r]===255&&(s[r+1]&224)===224&&(s[r+1]&6)!==0}function m(s,r){return r+1<s.length&&b(s,r)}function f(s,r){var u=4;return b(s,r)&&u<=s.length-r}function d(s,r){if(r+1<s.length&&b(s,r)){var u=4,o=D(s,r),a=u;o!=null&&o.frameLength&&(a=o.frameLength);var n=r+a;return n===s.length||m(s,n)}return!1}},"./src/demux/sample-aes.ts":function(te,Y,N){"use strict";N.r(Y);var K=N("./src/crypt/decrypter.ts"),A=N("./src/demux/tsdemuxer.ts"),M=function(){function H(k,D,b){this.keyData=void 0,this.decrypter=void 0,this.keyData=b,this.decrypter=new K.default(k,D,{removePKCS7Padding:!1})}var P=H.prototype;return P.decryptBuffer=function(D,b){this.decrypter.decrypt(D,this.keyData.key.buffer,this.keyData.iv.buffer,b)},P.decryptAacSample=function(D,b,m,f){var d=D[b].unit,s=d.subarray(16,d.length-d.length%16),r=s.buffer.slice(s.byteOffset,s.byteOffset+s.length),u=this;this.decryptBuffer(r,function(o){var a=new Uint8Array(o);d.set(a,16),f||u.decryptAacSamples(D,b+1,m)})},P.decryptAacSamples=function(D,b,m){for(;;b++){if(b>=D.length){m();return}if(D[b].unit.length<32)continue;var f=this.decrypter.isSync();if(this.decryptAacSample(D,b,m,f),!f)return}},P.getAvcEncryptedData=function(D){for(var b=Math.floor((D.length-48)/160)*16+16,m=new Int8Array(b),f=0,d=32;d<=D.length-16;d+=160,f+=16)m.set(D.subarray(d,d+16),f);return m},P.getAvcDecryptedUnit=function(D,b){for(var m=new Uint8Array(b),f=0,d=32;d<=D.length-16;d+=160,f+=16)D.set(m.subarray(f,f+16),d);return D},P.decryptAvcSample=function(D,b,m,f,d,s){var r=Object(A.discardEPB)(d.data),u=this.getAvcEncryptedData(r),o=this;this.decryptBuffer(u.buffer,function(a){d.data=o.getAvcDecryptedUnit(r,a),s||o.decryptAvcSamples(D,b,m+1,f)})},P.decryptAvcSamples=function(D,b,m,f){if(D instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;b++,m=0){if(b>=D.length){f();return}for(var d=D[b].units;!(m>=d.length);m++){var s=d[m];if(s.data.length<=48||s.type!==1&&s.type!==5)continue;var r=this.decrypter.isSync();if(this.decryptAvcSample(D,b,m,f,s,r),!r)return}}},H}();Y.default=M},"./src/demux/transmuxer-interface.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return d});var K=N("./node_modules/webworkify-webpack/index.js"),A=N.n(K),M=N("./src/events.ts"),H=N("./src/demux/transmuxer.ts"),P=N("./src/utils/logger.ts"),k=N("./src/errors.ts"),D=N("./src/utils/mediasource-helper.ts"),b=N("./node_modules/eventemitter3/index.js"),m=N.n(b),f=Object(D.getMediaSource)()||{isTypeSupported:function(){return!1}},d=function(){function s(u,o,a,n){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=u,this.id=o,this.onTransmuxComplete=a,this.onFlush=n;var w=u.config,x=function(h,c){c=c||{},c.frag=R.frag,c.id=R.id,u.trigger(h,c)};this.observer=new b.EventEmitter,this.observer.on(M.Events.FRAG_DECRYPTED,x),this.observer.on(M.Events.ERROR,x);var O={mp4:f.isTypeSupported("video/mp4"),mpeg:f.isTypeSupported("audio/mpeg"),mp3:f.isTypeSupported('audio/mp4; codecs="mp3"')},C=navigator.vendor;if(w.enableWorker&&typeof Worker!="undefined"){P.logger.log("demuxing in webworker");var _;try{_=this.worker=K("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),_.addEventListener("message",this.onwmsg),_.onerror=function(y){u.trigger(M.Events.ERROR,{type:k.ErrorTypes.OTHER_ERROR,details:k.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(y.message+" ("+y.filename+":"+y.lineno+")")})},_.postMessage({cmd:"init",typeSupported:O,vendor:C,id:o,config:JSON.stringify(w)})}catch(y){P.logger.warn("Error in worker:",y),P.logger.error("Error while initializing DemuxerWorker, fallback to inline"),_&&self.URL.revokeObjectURL(_.objectURL),this.transmuxer=new H.default(this.observer,O,w,C,o),this.worker=null}}else this.transmuxer=new H.default(this.observer,O,w,C,o)}var r=s.prototype;return r.destroy=function(){var o=this.worker;if(o)o.removeEventListener("message",this.onwmsg),o.terminate(),this.worker=null;else{var a=this.transmuxer;a&&(a.destroy(),this.transmuxer=null)}var n=this.observer;n&&n.removeAllListeners(),this.observer=null},r.push=function(o,a,n,R,w,x,O,C,_,y){var h=this;_.transmuxing.start=self.performance.now();var c=this.transmuxer,v=this.worker,p=x?x.start:w.start,E=w.decryptdata,U=this.frag,F=!(U&&w.cc===U.cc),z=!(U&&_.level===U.level),G=U?_.sn-U.sn:-1,B=this.part?_.part-this.part.index:1,T=!z&&(G===1||G===0&&B===1),V=self.performance.now();(z||G||w.stats.parsing.start===0)&&(w.stats.parsing.start=V),x&&(B||!T)&&(x.stats.parsing.start=V);var Z=new H.TransmuxState(F,T,C,z,p);if(!T||F){P.logger.log("[transmuxer-interface, "+w.type+"]: Starting new transmux session for sn: "+_.sn+" p: "+_.part+" level: "+_.level+" id: "+_.id+`
|
|
discontinuity: `+F+`
|
|
trackSwitch: `+z+`
|
|
contiguous: `+T+`
|
|
accurateTimeOffset: `+C+`
|
|
timeOffset: `+p);var oe=new H.TransmuxConfig(n,R,a,O,y);this.configureTransmuxer(oe)}if(this.frag=w,this.part=x,v)v.postMessage({cmd:"demux",data:o,decryptdata:E,chunkMeta:_,state:Z},o instanceof ArrayBuffer?[o]:[]);else if(c){var pe=c.push(o,E,_,Z);Object(H.isPromise)(pe)?pe.then(function(Ye){h.handleTransmuxComplete(Ye)}):this.handleTransmuxComplete(pe)}},r.flush=function(o){var a=this;o.transmuxing.start=self.performance.now();var n=this.transmuxer,R=this.worker;if(R)R.postMessage({cmd:"flush",chunkMeta:o});else if(n){var w=n.flush(o);Object(H.isPromise)(w)?w.then(function(x){a.handleFlushResult(x,o)}):this.handleFlushResult(w,o)}},r.handleFlushResult=function(o,a){var n=this;o.forEach(function(R){n.handleTransmuxComplete(R)}),this.onFlush(a)},r.onWorkerMessage=function(o){var a=o.data,n=this.hls;switch(a.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(a.data);break}case"flush":{this.onFlush(a.data);break}default:{a.data=a.data||{},a.data.frag=this.frag,a.data.id=this.id,n.trigger(a.event,a.data);break}}},r.configureTransmuxer=function(o){var a=this.worker,n=this.transmuxer;a?a.postMessage({cmd:"configure",config:o}):n&&n.configure(o)},r.handleTransmuxComplete=function(o){o.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(o)},s}()},"./src/demux/transmuxer-worker.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return k});var K=N("./src/demux/transmuxer.ts"),A=N("./src/events.ts"),M=N("./src/utils/logger.ts"),H=N("./node_modules/eventemitter3/index.js"),P=N.n(H);function k(d){var s=new H.EventEmitter,r=function(o,a){d.postMessage({event:o,data:a})};s.on(A.Events.FRAG_DECRYPTED,r),s.on(A.Events.ERROR,r),d.addEventListener("message",function(u){var o=u.data;switch(o.cmd){case"init":{var a=JSON.parse(o.config);d.transmuxer=new K.default(s,o.typeSupported,a,o.vendor,o.id),Object(M.enableLogs)(a.debug),r("init",null);break}case"configure":{d.transmuxer.configure(o.config);break}case"demux":{var n=d.transmuxer.push(o.data,o.decryptdata,o.chunkMeta,o.state);Object(K.isPromise)(n)?n.then(function(x){D(d,x)}):D(d,n);break}case"flush":{var R=o.chunkMeta,w=d.transmuxer.flush(R);Object(K.isPromise)(w)?w.then(function(x){m(d,x,R)}):m(d,w,R);break}default:break}})}function D(d,s){if(f(s.remuxResult))return;var r=[],u=s.remuxResult,o=u.audio,a=u.video;o&&b(r,o),a&&b(r,a),d.postMessage({event:"transmuxComplete",data:s},r)}function b(d,s){s.data1&&d.push(s.data1.buffer),s.data2&&d.push(s.data2.buffer)}function m(d,s,r){s.forEach(function(u){D(d,u)}),d.postMessage({event:"flush",data:r})}function f(d){return!d.audio&&!d.video&&!d.text&&!d.id3&&!d.initSegment}},"./src/demux/transmuxer.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return a}),N.d(Y,"isPromise",function(){return w}),N.d(Y,"TransmuxConfig",function(){return x}),N.d(Y,"TransmuxState",function(){return O});var K=N("./src/events.ts"),A=N("./src/errors.ts"),M=N("./src/crypt/decrypter.ts"),H=N("./src/demux/aacdemuxer.ts"),P=N("./src/demux/mp4demuxer.ts"),k=N("./src/demux/tsdemuxer.ts"),D=N("./src/demux/mp3demuxer.ts"),b=N("./src/remux/mp4-remuxer.ts"),m=N("./src/remux/passthrough-remuxer.ts"),f=N("./src/demux/chunk-cache.ts"),d=N("./src/utils/mp4-tools.ts"),s=N("./src/utils/logger.ts"),r;try{r=self.performance.now.bind(self.performance)}catch(C){s.logger.debug("Unable to use Performance API on this environment"),r=self.Date.now}var u=[{demux:k.default,remux:b.default},{demux:P.default,remux:m.default},{demux:H.default,remux:b.default},{demux:D.default,remux:b.default}],o=1024;u.forEach(function(C){var _=C.demux;o=Math.max(o,_.minProbeByteLength)});var a=function(){function C(y,h,c,v,p){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 f.default,this.observer=y,this.typeSupported=h,this.config=c,this.vendor=v,this.id=p}var _=C.prototype;return _.configure=function(h){this.transmuxConfig=h,this.decrypter&&this.decrypter.reset()},_.push=function(h,c,v,p){var E=this,U=v.transmuxing;U.executeStart=r();var F=new Uint8Array(h),z=this.cache,G=this.config,B=this.currentTransmuxState,T=this.transmuxConfig;p&&(this.currentTransmuxState=p);var V=n(F,c);if(V&&V.method==="AES-128"){var Z=this.getDecrypter();if(G.enableSoftwareAES){var oe=Z.softwareDecrypt(F,V.key.buffer,V.iv.buffer);if(!oe)return U.executeEnd=r(),R(v);F=new Uint8Array(oe)}else return this.decryptionPromise=Z.webCryptoDecrypt(F,V.key.buffer,V.iv.buffer).then(function(dt){var Nt=E.push(dt,null,v);return E.decryptionPromise=null,Nt}),this.decryptionPromise}var pe=p||B,Ye=pe.contiguous,xe=pe.discontinuity,Ie=pe.trackSwitch,Je=pe.accurateTimeOffset,Ke=pe.timeOffset,be=T.audioCodec,de=T.videoCodec,nt=T.defaultInitPts,Kt=T.duration,jt=T.initSegmentData;if((xe||Ie)&&this.resetInitSegment(jt,be,de,Kt),xe&&this.resetInitialTimestamp(nt),Ye||this.resetContiguity(),this.needsProbing(F,xe,Ie)){if(z.dataLength){var wt=z.flush();F=Object(d.appendUint8Array)(wt,F)}this.configureTransmuxer(F,T)}var ze=this.transmux(F,V,Ke,Je,v),ft=this.currentTransmuxState;return ft.contiguous=!0,ft.discontinuity=!1,ft.trackSwitch=!1,U.executeEnd=r(),ze},_.flush=function(h){var c=this,v=h.transmuxing;v.executeStart=r();var p=this.decrypter,E=this.cache,U=this.currentTransmuxState,F=this.decryptionPromise;if(F)return F.then(function(){return c.flush(h)});var z=[],G=U.timeOffset;if(p){var B=p.flush();B&&z.push(this.push(B,null,h))}var T=E.dataLength;E.reset();var V=this.demuxer,Z=this.remuxer;if(!V||!Z)return T>=o&&this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:A.ErrorTypes.MEDIA_ERROR,details:A.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),v.executeEnd=r(),[R(h)];var oe=V.flush(G);return w(oe)?oe.then(function(pe){return c.flushRemux(z,pe,h),z}):(this.flushRemux(z,oe,h),z)},_.flushRemux=function(h,c,v){var p=c.audioTrack,E=c.avcTrack,U=c.id3Track,F=c.textTrack,z=this.currentTransmuxState,G=z.accurateTimeOffset,B=z.timeOffset;s.logger.log("[transmuxer.ts]: Flushed fragment "+v.sn+(v.part>-1?" p: "+v.part:"")+" of level "+v.level);var T=this.remuxer.remux(p,E,U,F,B,G,!0,this.id);h.push({remuxResult:T,chunkMeta:v}),v.transmuxing.executeEnd=r()},_.resetInitialTimestamp=function(h){var c=this.demuxer,v=this.remuxer;if(!c||!v)return;c.resetTimeStamp(h),v.resetTimeStamp(h)},_.resetContiguity=function(){var h=this.demuxer,c=this.remuxer;if(!h||!c)return;h.resetContiguity(),c.resetNextTimestamp()},_.resetInitSegment=function(h,c,v,p){var E=this.demuxer,U=this.remuxer;if(!E||!U)return;E.resetInitSegment(c,v,p),U.resetInitSegment(h,c,v)},_.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},_.transmux=function(h,c,v,p,E){var U;return c&&c.method==="SAMPLE-AES"?U=this.transmuxSampleAes(h,c,v,p,E):U=this.transmuxUnencrypted(h,v,p,E),U},_.transmuxUnencrypted=function(h,c,v,p){var E=this.demuxer.demux(h,c,!1,!this.config.progressive),U=E.audioTrack,F=E.avcTrack,z=E.id3Track,G=E.textTrack,B=this.remuxer.remux(U,F,z,G,c,v,!1,this.id);return{remuxResult:B,chunkMeta:p}},_.transmuxSampleAes=function(h,c,v,p,E){var U=this;return this.demuxer.demuxSampleAes(h,c,v).then(function(F){var z=U.remuxer.remux(F.audioTrack,F.avcTrack,F.id3Track,F.textTrack,v,p,!1,U.id);return{remuxResult:z,chunkMeta:E}})},_.configureTransmuxer=function(h,c){for(var v=this.config,p=this.observer,E=this.typeSupported,U=this.vendor,F=c.audioCodec,z=c.defaultInitPts,G=c.duration,B=c.initSegmentData,T=c.videoCodec,V,Z=0,oe=u.length;Z<oe;Z++)if(u[Z].demux.probe(h)){V=u[Z];break}V||(s.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),V={demux:P.default,remux:m.default});var pe=this.demuxer,Ye=this.remuxer,xe=V.remux,Ie=V.demux;(!Ye||!(Ye instanceof xe))&&(this.remuxer=new xe(p,v,E,U)),(!pe||!(pe instanceof Ie))&&(this.demuxer=new Ie(p,v,E),this.probe=Ie.probe),this.resetInitSegment(B,F,T,G),this.resetInitialTimestamp(z)},_.needsProbing=function(h,c,v){return!this.demuxer||!this.remuxer||c||v},_.getDecrypter=function(){var h=this.decrypter;return h||(h=this.decrypter=new M.default(this.observer,this.config)),h},C}();function n(C,_){var y=null;return C.byteLength>0&&_!=null&&_.key!=null&&_.iv!==null&&_.method!=null&&(y=_),y}var R=function(_){return{remuxResult:{},chunkMeta:_}};function w(C){return"then"in C&&C.then instanceof Function}var x=function(_,y,h,c,v){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=_,this.videoCodec=y,this.initSegmentData=h,this.duration=c,this.defaultInitPts=v},O=function(_,y,h,c,v){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=_,this.contiguous=y,this.accurateTimeOffset=h,this.trackSwitch=c,this.timeOffset=v}},"./src/demux/tsdemuxer.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"discardEPB",function(){return R});var K=N("./src/demux/adts.ts"),A=N("./src/demux/mpegaudio.ts"),M=N("./src/demux/exp-golomb.ts"),H=N("./src/demux/id3.ts"),P=N("./src/demux/sample-aes.ts"),k=N("./src/events.ts"),D=N("./src/utils/mp4-tools.ts"),b=N("./src/utils/logger.ts"),m=N("./src/errors.ts"),f={video:1,audio:2,id3:3,text:4},d=function(){function w(O,C,_){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=O,this.config=C,this.typeSupported=_}w.probe=function(C){var _=w.syncOffset(C);return _<0?!1:(_&&b.logger.warn("MPEG2-TS detected but first sync word found @ offset "+_+", junk ahead ?"),!0)},w.syncOffset=function(C){for(var _=Math.min(1e3,C.length-3*188),y=0;y<_;){if(C[y]===71&&C[y+188]===71&&C[y+2*188]===71)return y;y++}return-1},w.createTrack=function(C,_){return{container:C==="video"||C==="audio"?"video/mp2t":void 0,type:C,id:f[C],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:C==="audio"?_:void 0}};var x=w.prototype;return x.resetInitSegment=function(C,_,y){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=w.createTrack("video",y),this._audioTrack=w.createTrack("audio",y),this._id3Track=w.createTrack("id3",y),this._txtTrack=w.createTrack("text",y),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=C,this.videoCodec=_,this._duration=y},x.resetTimeStamp=function(){},x.resetContiguity=function(){var C=this._audioTrack,_=this._avcTrack,y=this._id3Track;C&&(C.pesData=null),_&&(_.pesData=null),y&&(y.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},x.demux=function(C,_,y,h){y===void 0&&(y=!1),h===void 0&&(h=!1),y||(this.sampleAes=null);var c,v=this._avcTrack,p=this._audioTrack,E=this._id3Track,U=v.pid,F=v.pesData,z=p.pid,G=E.pid,B=p.pesData,T=E.pesData,V=!1,Z=this.pmtParsed,oe=this._pmtId,pe=C.length;if(this.remainderData&&(C=Object(D.appendUint8Array)(this.remainderData,C),pe=C.length,this.remainderData=null),pe<188&&!h)return this.remainderData=C,{audioTrack:p,avcTrack:v,id3Track:E,textTrack:this._txtTrack};var Ye=Math.max(0,w.syncOffset(C));pe-=(pe+Ye)%188,pe<C.byteLength&&!h&&(this.remainderData=new Uint8Array(C.buffer,pe,C.buffer.byteLength-pe));for(var xe=Ye;xe<pe;xe+=188)if(C[xe]===71){var Ie=!!(C[xe+1]&64),Je=((C[xe+1]&31)<<8)+C[xe+2],Ke=(C[xe+3]&48)>>4,be=void 0;if(Ke>1){if(be=xe+5+C[xe+4],be===xe+188)continue}else be=xe+4;switch(Je){case U:Ie&&(F&&(c=o(F))&&this.parseAVCPES(c,!1),F={data:[],size:0}),F&&(F.data.push(C.subarray(be,xe+188)),F.size+=xe+188-be);break;case z:Ie&&(B&&(c=o(B))&&(p.isAAC?this.parseAACPES(c):this.parseMPEGPES(c)),B={data:[],size:0}),B&&(B.data.push(C.subarray(be,xe+188)),B.size+=xe+188-be);break;case G:Ie&&(T&&(c=o(T))&&this.parseID3PES(c),T={data:[],size:0}),T&&(T.data.push(C.subarray(be,xe+188)),T.size+=xe+188-be);break;case 0:Ie&&(be+=C[be]+1),oe=this._pmtId=r(C,be);break;case oe:{Ie&&(be+=C[be]+1);var de=u(C,be,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,y);U=de.avc,U>0&&(v.pid=U),z=de.audio,z>0&&(p.pid=z,p.isAAC=de.isAAC),G=de.id3,G>0&&(E.pid=G),V&&!Z&&(b.logger.log("reparse from beginning"),V=!1,xe=Ye-188),Z=this.pmtParsed=!0;break}case 17:case 8191:break;default:V=!0;break}}else this.observer.emit(k.Events.ERROR,k.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});v.pesData=F,p.pesData=B,E.pesData=T;var nt={audioTrack:p,avcTrack:v,id3Track:E,textTrack:this._txtTrack};return h&&this.extractRemainingSamples(nt),nt},x.flush=function(){var C=this.remainderData;this.remainderData=null;var _;return C?_=this.demux(C,-1,!1,!0):_={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(_),this.sampleAes?this.decrypt(_,this.sampleAes):_},x.extractRemainingSamples=function(C){var _=C.audioTrack,y=C.avcTrack,h=C.id3Track,c=y.pesData,v=_.pesData,p=h.pesData,E;c&&(E=o(c))?(this.parseAVCPES(E,!0),y.pesData=null):y.pesData=c,v&&(E=o(v))?(_.isAAC?this.parseAACPES(E):this.parseMPEGPES(E),_.pesData=null):(v!=null&&v.size&&b.logger.log("last AAC PES packet truncated,might overlap between fragments"),_.pesData=v),p&&(E=o(p))?(this.parseID3PES(E),h.pesData=null):h.pesData=p},x.demuxSampleAes=function(C,_,y){var h=this.demux(C,y,!0,!this.config.progressive),c=this.sampleAes=new P.default(this.observer,this.config,_);return this.decrypt(h,c)},x.decrypt=function(C,_){return new Promise(function(y){var h=C.audioTrack,c=C.avcTrack;h.samples&&h.isAAC?_.decryptAacSamples(h.samples,0,function(){c.samples?_.decryptAvcSamples(c.samples,0,0,function(){y(C)}):y(C)}):c.samples&&_.decryptAvcSamples(c.samples,0,0,function(){y(C)})})},x.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},x.parseAVCPES=function(C,_){var y=this,h=this._avcTrack,c=this.parseAVCNALu(C.data),v=!1,p=this.avcSample,E,U=!1;C.data=null,p&&c.length&&!h.audFound&&(a(p,h),p=this.avcSample=s(!1,C.pts,C.dts,"")),c.forEach(function(F){switch(F.type){case 1:{E=!0,p||(p=y.avcSample=s(!0,C.pts,C.dts,"")),v&&(p.debug+="NDR "),p.frame=!0;var z=F.data;if(U&&z.length>4){var G=new M.default(z).readSliceType();(G===2||G===4||G===7||G===9)&&(p.key=!0)}break}case 5:E=!0,p||(p=y.avcSample=s(!0,C.pts,C.dts,"")),v&&(p.debug+="IDR "),p.key=!0,p.frame=!0;break;case 6:{E=!0,v&&p&&(p.debug+="SEI ");var B=new M.default(R(F.data));B.readUByte();for(var T=0,V=0,Z=!1,oe=0;!Z&&B.bytesAvailable>1;){T=0;do oe=B.readUByte(),T+=oe;while(oe===255);V=0;do oe=B.readUByte(),V+=oe;while(oe===255);if(T===4&&B.bytesAvailable!==0){Z=!0;var pe=B.readUByte();if(pe===181){var Ye=B.readUShort();if(Ye===49){var xe=B.readUInt();if(xe===1195456820){var Ie=B.readUByte();if(Ie===3){for(var Je=B.readUByte(),Ke=B.readUByte(),be=31&Je,de=[Je,Ke],nt=0;nt<be;nt++)de.push(B.readUByte()),de.push(B.readUByte()),de.push(B.readUByte());n(y._txtTrack.samples,{type:3,pts:C.pts,bytes:de})}}}}}else if(T===5&&B.bytesAvailable!==0){if(Z=!0,V>16){for(var Kt=[],jt=0;jt<16;jt++)Kt.push(B.readUByte().toString(16)),(jt===3||jt===5||jt===7||jt===9)&&Kt.push("-");for(var wt=V-16,ze=new Uint8Array(wt),ft=0;ft<wt;ft++)ze[ft]=B.readUByte();n(y._txtTrack.samples,{pts:C.pts,payloadType:T,uuid:Kt.join(""),userData:Object(H.utf8ArrayToStr)(ze),userDataBytes:ze})}}else if(V<B.bytesAvailable)for(var dt=0;dt<V;dt++)B.readUByte()}break}case 7:if(E=!0,U=!0,v&&p&&(p.debug+="SPS "),!h.sps){var Nt=new M.default(F.data),Ze=Nt.readSPS();h.width=Ze.width,h.height=Ze.height,h.pixelRatio=Ze.pixelRatio,h.sps=[F.data],h.duration=y._duration;for(var Bt=F.data.subarray(1,4),Ut="avc1.",Mt=0;Mt<3;Mt++){var An=Bt[Mt].toString(16);An.length<2&&(An="0"+An),Ut+=An}h.codec=Ut}break;case 8:E=!0,v&&p&&(p.debug+="PPS "),h.pps||(h.pps=[F.data]);break;case 9:E=!1,h.audFound=!0,p&&a(p,h),p=y.avcSample=s(!1,C.pts,C.dts,v?"AUD ":"");break;case 12:E=!1;break;default:E=!1,p&&(p.debug+="unknown NAL "+F.type+" ");break}if(p&&E){var mn=p.units;mn.push(F)}}),_&&p&&(a(p,h),this.avcSample=null)},x.getLastNalUnit=function(){var C,_=this.avcSample,y;if(!_||_.units.length===0){var h=this._avcTrack.samples;_=h[h.length-1]}if((C=_)!==null&&C!==void 0&&C.units){var c=_.units;y=c[c.length-1]}return y},x.parseAVCNALu=function(C){var _=C.byteLength,y=this._avcTrack,h=y.naluState||0,c=h,v=[],p=0,E,U,F,z=-1,G=0;for(h===-1&&(z=0,G=C[0]&31,h=0,p=1);p<_;){if(E=C[p++],!h){h=E?0:1;continue}if(h===1){h=E?0:2;continue}if(!E)h=3;else if(E===1){if(z>=0){var B={data:C.subarray(z,p-h-1),type:G};v.push(B)}else{var T=this.getLastNalUnit();if(T&&(c&&p<=4-c&&(T.state&&(T.data=T.data.subarray(0,T.data.byteLength-c))),U=p-h-1,U>0)){var V=new Uint8Array(T.data.byteLength+U);V.set(T.data,0),V.set(C.subarray(0,U),T.data.byteLength),T.data=V,T.state=0}}p<_?(F=C[p]&31,z=p,G=F,h=0):h=-1}else h=0}if(z>=0&&h>=0){var Z={data:C.subarray(z,_),type:G,state:h};v.push(Z)}if(v.length===0){var oe=this.getLastNalUnit();if(oe){var pe=new Uint8Array(oe.data.byteLength+C.byteLength);pe.set(oe.data,0),pe.set(C,oe.data.byteLength),oe.data=pe}}return y.naluState=h,v},x.parseAACPES=function(C){var _=0,y=this._audioTrack,h=this.aacOverFlow,c=C.data;if(h){this.aacOverFlow=null;var v=h.sample.unit.byteLength,p=Math.min(h.missing,v),E=v-p;h.sample.unit.set(c.subarray(0,p),E),y.samples.push(h.sample),_=h.missing}var U,F;for(U=_,F=c.length;U<F-1&&!K.isHeader(c,U);U++);if(U!==_){var z,G;if(U<F-1?(z="AAC PES did not start with ADTS header,offset:"+U,G=!1):(z="no ADTS header found in AAC PES",G=!0),b.logger.warn("parsing error:"+z),this.observer.emit(k.Events.ERROR,k.Events.ERROR,{type:m.ErrorTypes.MEDIA_ERROR,details:m.ErrorDetails.FRAG_PARSING_ERROR,fatal:G,reason:z}),G)return}K.initTrackConfig(y,this.observer,c,U,this.audioCodec);var B;if(C.pts!==void 0)B=C.pts;else if(h){var T=K.getFrameDuration(y.samplerate);B=h.sample.pts+T}else{b.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var V=0;U<F;)if(K.isHeader(c,U)){if(U+5<F){var Z=K.appendFrame(y,c,U,B,V);if(Z)if(Z.missing)this.aacOverFlow=Z;else{U+=Z.length,V++;continue}}break}else U++},x.parseMPEGPES=function(C){var _=C.data,y=_.length,h=0,c=0,v=C.pts;if(v===void 0){b.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;c<y;)if(A.isHeader(_,c)){var p=A.appendFrame(this._audioTrack,_,c,v,h);if(p)c+=p.length,h++;else break}else c++},x.parseID3PES=function(C){if(C.pts===void 0){b.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(C)},w}();d.minProbeByteLength=188;function s(w,x,O,C){return{key:w,frame:!1,pts:x,dts:O,units:[],debug:C,length:0}}function r(w,x){return(w[x+10]&31)<<8|w[x+11]}function u(w,x,O,C){var _={audio:-1,avc:-1,id3:-1,isAAC:!0},y=(w[x+1]&15)<<8|w[x+2],h=x+3+y-4,c=(w[x+10]&15)<<8|w[x+11];for(x+=12+c;x<h;){var v=(w[x+1]&31)<<8|w[x+2];switch(w[x]){case 207:if(!C){b.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:_.audio===-1&&(_.audio=v);break;case 21:_.id3===-1&&(_.id3=v);break;case 219:if(!C){b.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:_.avc===-1&&(_.avc=v);break;case 3:case 4:O?_.audio===-1&&(_.audio=v,_.isAAC=!1):b.logger.log("MPEG audio found, not supported in this browser");break;case 36:b.logger.warn("Unsupported HEVC stream type found");break;default:break}x+=((w[x+3]&15)<<8|w[x+4])+5}return _}function o(w){var x=0,O,C,_,y,h,c=w.data;if(!w||w.size===0)return null;for(;c[0].length<19&&c.length>1;){var v=new Uint8Array(c[0].length+c[1].length);v.set(c[0]),v.set(c[1],c[0].length),c[0]=v,c.splice(1,1)}O=c[0];var p=(O[0]<<16)+(O[1]<<8)+O[2];if(p===1){if(C=(O[4]<<8)+O[5],C&&C>w.size-6)return null;var E=O[7];E&192&&(y=(O[9]&14)*536870912+(O[10]&255)*4194304+(O[11]&254)*16384+(O[12]&255)*128+(O[13]&254)/2,E&64?(h=(O[14]&14)*536870912+(O[15]&255)*4194304+(O[16]&254)*16384+(O[17]&255)*128+(O[18]&254)/2,y-h>60*9e4&&(b.logger.warn(Math.round((y-h)/9e4)+"s delta between PTS and DTS, align them"),y=h)):h=y),_=O[8];var U=_+9;if(w.size<=U)return null;w.size-=U;for(var F=new Uint8Array(w.size),z=0,G=c.length;z<G;z++){O=c[z];var B=O.byteLength;if(U)if(U>B){U-=B;continue}else O=O.subarray(U),B-=U,U=0;F.set(O,x),x+=B}return C&&(C-=_+3),{data:F,pts:y,dts:h,len:C}}return null}function a(w,x){if(w.units.length&&w.frame){if(w.pts===void 0){var O=x.samples,C=O.length;if(C){var _=O[C-1];w.pts=_.pts,w.dts=_.dts}else{x.dropped++;return}}x.samples.push(w)}w.debug.length&&b.logger.log(w.pts+"/"+w.dts+":"+w.debug)}function n(w,x){var O=w.length;if(O>0){if(x.pts>=w[O-1].pts)w.push(x);else for(var C=O-1;C>=0;C--)if(x.pts<w[C].pts){w.splice(C,0,x);break}}else w.push(x)}function R(w){for(var x=w.byteLength,O=[],C=1;C<x-2;)w[C]===0&&w[C+1]===0&&w[C+2]===3?(O.push(C+2),C+=2):C++;if(O.length===0)return w;var _=x-O.length,y=new Uint8Array(_),h=0;for(C=0;C<_;h++,C++)h===O[0]&&(h++,O.shift()),y[C]=w[h];return y}Y.default=d},"./src/errors.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"ErrorTypes",function(){return K}),N.d(Y,"ErrorDetails",function(){return A});var K;(function(M){M.NETWORK_ERROR="networkError",M.MEDIA_ERROR="mediaError",M.KEY_SYSTEM_ERROR="keySystemError",M.MUX_ERROR="muxError",M.OTHER_ERROR="otherError"})(K||(K={}));var A;(function(M){M.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",M.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",M.KEY_SYSTEM_NO_SESSION="keySystemNoSession",M.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",M.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",M.MANIFEST_LOAD_ERROR="manifestLoadError",M.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",M.MANIFEST_PARSING_ERROR="manifestParsingError",M.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",M.LEVEL_EMPTY_ERROR="levelEmptyError",M.LEVEL_LOAD_ERROR="levelLoadError",M.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",M.LEVEL_SWITCH_ERROR="levelSwitchError",M.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",M.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",M.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",M.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",M.FRAG_LOAD_ERROR="fragLoadError",M.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",M.FRAG_DECRYPT_ERROR="fragDecryptError",M.FRAG_PARSING_ERROR="fragParsingError",M.REMUX_ALLOC_ERROR="remuxAllocError",M.KEY_LOAD_ERROR="keyLoadError",M.KEY_LOAD_TIMEOUT="keyLoadTimeOut",M.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",M.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",M.BUFFER_APPEND_ERROR="bufferAppendError",M.BUFFER_APPENDING_ERROR="bufferAppendingError",M.BUFFER_STALLED_ERROR="bufferStalledError",M.BUFFER_FULL_ERROR="bufferFullError",M.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",M.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",M.INTERNAL_EXCEPTION="internalException",M.INTERNAL_ABORTED="aborted",M.UNKNOWN="unknown"})(A||(A={}))},"./src/events.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"Events",function(){return K});var K;(function(A){A.MEDIA_ATTACHING="hlsMediaAttaching",A.MEDIA_ATTACHED="hlsMediaAttached",A.MEDIA_DETACHING="hlsMediaDetaching",A.MEDIA_DETACHED="hlsMediaDetached",A.BUFFER_RESET="hlsBufferReset",A.BUFFER_CODECS="hlsBufferCodecs",A.BUFFER_CREATED="hlsBufferCreated",A.BUFFER_APPENDING="hlsBufferAppending",A.BUFFER_APPENDED="hlsBufferAppended",A.BUFFER_EOS="hlsBufferEos",A.BUFFER_FLUSHING="hlsBufferFlushing",A.BUFFER_FLUSHED="hlsBufferFlushed",A.MANIFEST_LOADING="hlsManifestLoading",A.MANIFEST_LOADED="hlsManifestLoaded",A.MANIFEST_PARSED="hlsManifestParsed",A.LEVEL_SWITCHING="hlsLevelSwitching",A.LEVEL_SWITCHED="hlsLevelSwitched",A.LEVEL_LOADING="hlsLevelLoading",A.LEVEL_LOADED="hlsLevelLoaded",A.LEVEL_UPDATED="hlsLevelUpdated",A.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",A.LEVELS_UPDATED="hlsLevelsUpdated",A.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",A.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",A.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",A.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",A.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",A.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",A.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",A.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",A.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",A.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",A.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",A.CUES_PARSED="hlsCuesParsed",A.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",A.INIT_PTS_FOUND="hlsInitPtsFound",A.FRAG_LOADING="hlsFragLoading",A.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",A.FRAG_LOADED="hlsFragLoaded",A.FRAG_DECRYPTED="hlsFragDecrypted",A.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",A.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",A.FRAG_PARSING_METADATA="hlsFragParsingMetadata",A.FRAG_PARSED="hlsFragParsed",A.FRAG_BUFFERED="hlsFragBuffered",A.FRAG_CHANGED="hlsFragChanged",A.FPS_DROP="hlsFpsDrop",A.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",A.ERROR="hlsError",A.DESTROYING="hlsDestroying",A.KEY_LOADING="hlsKeyLoading",A.KEY_LOADED="hlsKeyLoaded",A.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",A.BACK_BUFFER_REACHED="hlsBackBufferReached"})(K||(K={}))},"./src/hls.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return w});var K=N("./node_modules/url-toolkit/src/url-toolkit.js"),A=N.n(K),M=N("./src/loader/playlist-loader.ts"),H=N("./src/loader/key-loader.ts"),P=N("./src/controller/id3-track-controller.ts"),k=N("./src/controller/latency-controller.ts"),D=N("./src/controller/level-controller.ts"),b=N("./src/controller/fragment-tracker.ts"),m=N("./src/controller/stream-controller.ts"),f=N("./src/is-supported.ts"),d=N("./src/utils/logger.ts"),s=N("./src/config.ts"),r=N("./node_modules/eventemitter3/index.js"),u=N.n(r),o=N("./src/events.ts"),a=N("./src/errors.ts");function n(x,O){for(var C=0;C<O.length;C++){var _=O[C];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(x,_.key,_)}}function R(x,O,C){return O&&n(x.prototype,O),C&&n(x,C),x}var w=function(){x.isSupported=function(){return Object(f.isSupported)()};function x(C){C===void 0&&(C={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new r.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var _=this.config=Object(s.mergeConfig)(x.DefaultConfig,C);this.userConfig=C,Object(d.enableLogs)(_.debug),this._autoLevelCapping=-1,_.progressive&&Object(s.enableStreamingMode)(_);var y=_.abrController,h=_.bufferController,c=_.capLevelController,v=_.fpsController,p=this.abrController=new y(this),E=this.bufferController=new h(this),U=this.capLevelController=new c(this),F=new v(this),z=new M.default(this),G=new H.default(this),B=new P.default(this),T=this.levelController=new D.default(this),V=new b.FragmentTracker(this),Z=this.streamController=new m.default(this,V);U.setStreamController(Z),F.setStreamController(Z);var oe=[T,Z];this.networkControllers=oe;var pe=[z,G,p,E,U,F,B,V];this.audioTrackController=this.createController(_.audioTrackController,null,oe),this.createController(_.audioStreamController,V,oe),this.subtitleTrackController=this.createController(_.subtitleTrackController,null,oe),this.createController(_.subtitleStreamController,V,oe),this.createController(_.timelineController,null,pe),this.emeController=this.createController(_.emeController,null,pe),this.cmcdController=this.createController(_.cmcdController,null,pe),this.latencyController=this.createController(k.default,null,pe),this.coreComponents=pe}var O=x.prototype;return O.createController=function(_,y,h){if(_){var c=y?new _(this,y):new _(this);return h&&h.push(c),c}return null},O.on=function(_,y,h){h===void 0&&(h=this),this._emitter.on(_,y,h)},O.once=function(_,y,h){h===void 0&&(h=this),this._emitter.once(_,y,h)},O.removeAllListeners=function(_){this._emitter.removeAllListeners(_)},O.off=function(_,y,h,c){h===void 0&&(h=this),this._emitter.off(_,y,h,c)},O.listeners=function(_){return this._emitter.listeners(_)},O.emit=function(_,y,h){return this._emitter.emit(_,y,h)},O.trigger=function(_,y){if(this.config.debug)return this.emit(_,_,y);try{return this.emit(_,_,y)}catch(h){d.logger.error("An internal error happened while handling event "+_+'. Error message: "'+h.message+'". Here is a stacktrace:',h),this.trigger(o.Events.ERROR,{type:a.ErrorTypes.OTHER_ERROR,details:a.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:_,error:h})}return!1},O.listenerCount=function(_){return this._emitter.listenerCount(_)},O.destroy=function(){d.logger.log("destroy"),this.trigger(o.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(_){return _.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(_){return _.destroy()}),this.coreComponents.length=0},O.attachMedia=function(_){d.logger.log("attachMedia"),this._media=_,this.trigger(o.Events.MEDIA_ATTACHING,{media:_})},O.detachMedia=function(){d.logger.log("detachMedia"),this.trigger(o.Events.MEDIA_DETACHING,void 0),this._media=null},O.loadSource=function(_){this.stopLoad();var y=this.media,h=this.url,c=this.url=K.buildAbsoluteURL(self.location.href,_,{alwaysNormalize:!0});d.logger.log("loadSource:"+c),y&&h&&h!==c&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(y)),this.trigger(o.Events.MANIFEST_LOADING,{url:_})},O.startLoad=function(_){_===void 0&&(_=-1),d.logger.log("startLoad("+_+")"),this.networkControllers.forEach(function(y){y.startLoad(_)})},O.stopLoad=function(){d.logger.log("stopLoad"),this.networkControllers.forEach(function(_){_.stopLoad()})},O.swapAudioCodec=function(){d.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},O.recoverMediaError=function(){d.logger.log("recoverMediaError");var _=this._media;this.detachMedia(),_&&this.attachMedia(_)},O.removeLevel=function(_,y){y===void 0&&(y=0),this.levelController.removeLevel(_,y)},R(x,[{key:"levels",get:function(){var _=this.levelController.levels;return _||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(_){d.logger.log("set currentLevel:"+_),this.loadLevel=_,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(_){d.logger.log("set nextLevel:"+_),this.levelController.manualLevel=_,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(_){d.logger.log("set loadLevel:"+_),this.levelController.manualLevel=_}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(_){this.levelController.nextLoadLevel=_}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(_){d.logger.log("set firstLevel:"+_),this.levelController.firstLevel=_}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(_){d.logger.log("set startLevel:"+_),_!==-1&&(_=Math.max(_,this.minAutoLevel)),this.levelController.startLevel=_}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(_){var y=!!_;y!==this.config.capLevelToPlayerSize&&(y?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=y)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(_){this._autoLevelCapping!==_&&(d.logger.log("set autoLevelCapping:"+_),this._autoLevelCapping=_)}},{key:"bandwidthEstimate",get:function(){var _=this.abrController.bwEstimator;return _?_.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var _=this.levels,y=this.config.minAutoBitrate;if(!_)return 0;for(var h=_.length,c=0;c<h;c++)if(_[c].maxBitrate>y)return c;return 0}},{key:"maxAutoLevel",get:function(){var _=this.levels,y=this.autoLevelCapping,h;return y===-1&&_&&_.length?h=_.length-1:h=y,h}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(_){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,_)}},{key:"audioTracks",get:function(){var _=this.audioTrackController;return _?_.audioTracks:[]}},{key:"audioTrack",get:function(){var _=this.audioTrackController;return _?_.audioTrack:-1},set:function(_){var y=this.audioTrackController;y&&(y.audioTrack=_)}},{key:"subtitleTracks",get:function(){var _=this.subtitleTrackController;return _?_.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var _=this.subtitleTrackController;return _?_.subtitleTrack:-1},set:function(_){var y=this.subtitleTrackController;y&&(y.subtitleTrack=_)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var _=this.subtitleTrackController;return _?_.subtitleDisplay:!1},set:function(_){var y=this.subtitleTrackController;y&&(y.subtitleDisplay=_)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(_){this.config.lowLatencyMode=_}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return o.Events}},{key:"ErrorTypes",get:function(){return a.ErrorTypes}},{key:"ErrorDetails",get:function(){return a.ErrorDetails}},{key:"DefaultConfig",get:function(){return x.defaultConfig?x.defaultConfig:s.hlsDefaultConfig},set:function(_){x.defaultConfig=_}}]),x}();w.defaultConfig=void 0},"./src/is-supported.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"isSupported",function(){return M}),N.d(Y,"changeTypeSupported",function(){return H});var K=N("./src/utils/mediasource-helper.ts");function A(){return self.SourceBuffer||self.WebKitSourceBuffer}function M(){var P=Object(K.getMediaSource)();if(!P)return!1;var k=A(),D=P&&typeof P.isTypeSupported=="function"&&P.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),b=!k||k.prototype&&typeof k.prototype.appendBuffer=="function"&&typeof k.prototype.remove=="function";return!!D&&!!b}function H(){var P,k=A();return typeof(k==null||((P=k.prototype)===null||P===void 0)?void 0:P.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return d}),N.d(Y,"LoadError",function(){return r});var K=N("./src/polyfills/number.ts"),A=N("./src/errors.ts");function M(u,o){u.prototype=Object.create(o.prototype),u.prototype.constructor=u,b(u,o)}function H(u){var o=typeof Map=="function"?new Map:void 0;return H=function(n){if(n===null||!D(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof o!="undefined"){if(o.has(n))return o.get(n);o.set(n,R)}function R(){return P(n,arguments,m(this).constructor)}return R.prototype=Object.create(n.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),b(R,n)},H(u)}function P(u,o,a){return k()?P=Reflect.construct:P=function(R,w,x){var O=[null];O.push.apply(O,w);var C=Function.bind.apply(R,O),_=new C;return x&&b(_,x.prototype),_},P.apply(null,arguments)}function k(){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(u){return!1}}function D(u){return Function.toString.call(u).indexOf("[native code]")!==-1}function b(u,o){return b=Object.setPrototypeOf||function(n,R){return n.__proto__=R,n},b(u,o)}function m(u){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},m(u)}var f=Math.pow(2,17),d=function(){function u(a){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=a}var o=u.prototype;return o.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},o.abort=function(){this.loader&&this.loader.abort()},o.load=function(n,R){var w=this,x=n.url;if(!x)return Promise.reject(new r({type:A.ErrorTypes.NETWORK_ERROR,details:A.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:n,networkDetails:null},"Fragment does not have a "+(x?"part list":"url")));this.abort();var O=this.config,C=O.fLoader,_=O.loader;return new Promise(function(y,h){w.loader&&w.loader.destroy();var c=w.loader=n.loader=C?new C(O):new _(O),v=s(n),p={timeout:O.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:O.fragLoadingMaxRetryTimeout,highWaterMark:f};n.stats=c.stats,c.load(v,p,{onSuccess:function(U,F,z,G){w.resetLoader(n,c),y({frag:n,part:null,payload:U.data,networkDetails:G})},onError:function(U,F,z){w.resetLoader(n,c),h(new r({type:A.ErrorTypes.NETWORK_ERROR,details:A.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:n,response:U,networkDetails:z}))},onAbort:function(U,F,z){w.resetLoader(n,c),h(new r({type:A.ErrorTypes.NETWORK_ERROR,details:A.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:n,networkDetails:z}))},onTimeout:function(U,F,z){w.resetLoader(n,c),h(new r({type:A.ErrorTypes.NETWORK_ERROR,details:A.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:n,networkDetails:z}))},onProgress:function(U,F,z,G){R&&R({frag:n,part:null,payload:z,networkDetails:G})}})})},o.loadPart=function(n,R,w){var x=this;this.abort();var O=this.config,C=O.fLoader,_=O.loader;return new Promise(function(y,h){x.loader&&x.loader.destroy();var c=x.loader=n.loader=C?new C(O):new _(O),v=s(n,R),p={timeout:O.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:O.fragLoadingMaxRetryTimeout,highWaterMark:f};R.stats=c.stats,c.load(v,p,{onSuccess:function(U,F,z,G){x.resetLoader(n,c),x.updateStatsFromPart(n,R);var B={frag:n,part:R,payload:U.data,networkDetails:G};w(B),y(B)},onError:function(U,F,z){x.resetLoader(n,c),h(new r({type:A.ErrorTypes.NETWORK_ERROR,details:A.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:n,part:R,response:U,networkDetails:z}))},onAbort:function(U,F,z){n.stats.aborted=R.stats.aborted,x.resetLoader(n,c),h(new r({type:A.ErrorTypes.NETWORK_ERROR,details:A.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:n,part:R,networkDetails:z}))},onTimeout:function(U,F,z){x.resetLoader(n,c),h(new r({type:A.ErrorTypes.NETWORK_ERROR,details:A.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:n,part:R,networkDetails:z}))}})})},o.updateStatsFromPart=function(n,R){var w=n.stats,x=R.stats,O=x.total;if(w.loaded+=x.loaded,O){var C=Math.round(n.duration/R.duration),_=Math.min(Math.round(w.loaded/O),C),y=C-_,h=y*Math.round(w.loaded/_);w.total=w.loaded+h}else w.total=Math.max(w.loaded,w.total);var c=w.loading,v=x.loading;c.start?c.first+=v.first-v.start:(c.start=v.start,c.first=v.first),c.end=v.end},o.resetLoader=function(n,R){n.loader=null,this.loader===R&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),R.destroy()},u}();function s(u,o){o===void 0&&(o=null);var a=o||u,n={frag:u,part:o,responseType:"arraybuffer",url:a.url,headers:{},rangeStart:0,rangeEnd:0},R=a.byteRangeStartOffset,w=a.byteRangeEndOffset;return Object(K.isFiniteNumber)(R)&&Object(K.isFiniteNumber)(w)&&(n.rangeStart=R,n.rangeEnd=w),n}var r=function(u){M(o,u);function o(a){for(var n,R=arguments.length,w=new Array(R>1?R-1:0),x=1;x<R;x++)w[x-1]=arguments[x];return n=u.call.apply(u,[this].concat(w))||this,n.data=void 0,n.data=a,n}return o}(H(Error))},"./src/loader/fragment.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"ElementaryStreamTypes",function(){return d}),N.d(Y,"BaseSegment",function(){return s}),N.d(Y,"Fragment",function(){return r}),N.d(Y,"Part",function(){return u});var K=N("./src/polyfills/number.ts"),A=N("./node_modules/url-toolkit/src/url-toolkit.js"),M=N.n(A),H=N("./src/utils/logger.ts"),P=N("./src/loader/level-key.ts"),k=N("./src/loader/load-stats.ts");function D(o,a){o.prototype=Object.create(a.prototype),o.prototype.constructor=o,b(o,a)}function b(o,a){return b=Object.setPrototypeOf||function(R,w){return R.__proto__=w,R},b(o,a)}function m(o,a){for(var n=0;n<a.length;n++){var R=a[n];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(o,R.key,R)}}function f(o,a,n){return a&&m(o.prototype,a),n&&m(o,n),o}var d;(function(o){o.AUDIO="audio",o.VIDEO="video",o.AUDIOVIDEO="audiovideo"})(d||(d={}));var s=function(){function o(n){var R;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(R={},R[d.AUDIO]=null,R[d.VIDEO]=null,R[d.AUDIOVIDEO]=null,R),this.baseurl=n}var a=o.prototype;return a.setByteRange=function(R,w){var x=R.split("@",2),O=[];x.length===1?O[0]=w?w.byteRangeEndOffset:0:O[0]=parseInt(x[1]),O[1]=parseInt(x[0])+O[0],this._byteRange=O},f(o,[{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(A.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(R){this._url=R}}]),o}(),r=function(o){D(a,o);function a(R,w){var x;return x=o.call(this,w)||this,x._decryptdata=null,x.rawProgramDateTime=null,x.programDateTime=null,x.tagList=[],x.duration=0,x.sn=0,x.levelkey=void 0,x.type=void 0,x.loader=null,x.level=-1,x.cc=0,x.startPTS=void 0,x.endPTS=void 0,x.appendedPTS=void 0,x.startDTS=void 0,x.endDTS=void 0,x.start=0,x.deltaPTS=void 0,x.maxStartPTS=void 0,x.minEndPTS=void 0,x.stats=new k.LoadStats,x.urlId=0,x.data=void 0,x.bitrateTest=!1,x.title=null,x.initSegment=null,x.type=R,x}var n=a.prototype;return n.createInitializationVector=function(w){for(var x=new Uint8Array(16),O=12;O<16;O++)x[O]=w>>8*(15-O)&255;return x},n.setDecryptDataFromLevelKey=function(w,x){var O=w;return(w==null?void 0:w.method)==="AES-128"&&w.uri&&!w.iv&&(O=P.LevelKey.fromURI(w.uri),O.method=w.method,O.iv=this.createInitializationVector(x),O.keyFormat="identity"),O},n.setElementaryStreamInfo=function(w,x,O,C,_,y){y===void 0&&(y=!1);var h=this.elementaryStreams,c=h[w];if(!c){h[w]={startPTS:x,endPTS:O,startDTS:C,endDTS:_,partial:y};return}c.startPTS=Math.min(c.startPTS,x),c.endPTS=Math.max(c.endPTS,O),c.startDTS=Math.min(c.startDTS,C),c.endDTS=Math.max(c.endDTS,_)},n.clearElementaryStreamInfo=function(){var w=this.elementaryStreams;w[d.AUDIO]=null,w[d.VIDEO]=null,w[d.AUDIOVIDEO]=null},f(a,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var w=this.sn;typeof w!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&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(K.isFiniteNumber)(this.programDateTime))return null;var w=Object(K.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+w*1e3}},{key:"encrypted",get:function(){var w;return!!((w=this.decryptdata)!==null&&w!==void 0&&w.keyFormat&&this.decryptdata.uri)}}]),a}(s),u=function(o){D(a,o);function a(n,R,w,x,O){var C;C=o.call(this,w)||this,C.fragOffset=0,C.duration=0,C.gap=!1,C.independent=!1,C.relurl=void 0,C.fragment=void 0,C.index=void 0,C.stats=new k.LoadStats,C.duration=n.decimalFloatingPoint("DURATION"),C.gap=n.bool("GAP"),C.independent=n.bool("INDEPENDENT"),C.relurl=n.enumeratedString("URI"),C.fragment=R,C.index=x;var _=n.enumeratedString("BYTERANGE");return _&&C.setByteRange(_,O),O&&(C.fragOffset=O.fragOffset+O.duration),C}return f(a,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var R=this.elementaryStreams;return!!(R.audio||R.video||R.audiovideo)}}]),a}(s)},"./src/loader/key-loader.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return H});var K=N("./src/events.ts"),A=N("./src/errors.ts"),M=N("./src/utils/logger.ts"),H=function(){function P(D){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=D,this._registerListeners()}var k=P.prototype;return k._registerListeners=function(){this.hls.on(K.Events.KEY_LOADING,this.onKeyLoading,this)},k._unregisterListeners=function(){this.hls.off(K.Events.KEY_LOADING,this.onKeyLoading)},k.destroy=function(){this._unregisterListeners();for(var b in this.loaders){var m=this.loaders[b];m&&m.destroy()}this.loaders={}},k.onKeyLoading=function(b,m){var f=m.frag,d=f.type,s=this.loaders[d];if(!f.decryptdata){M.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var r=f.decryptdata.uri;if(r!==this.decrypturl||this.decryptkey===null){var u=this.hls.config;if(s&&(M.logger.warn("abort previous key loader for type:"+d),s.abort()),!r){M.logger.warn("key uri is falsy");return}var o=u.loader,a=f.loader=this.loaders[d]=new o(u);this.decrypturl=r,this.decryptkey=null;var n={url:r,frag:f,responseType:"arraybuffer"},R={timeout:u.fragLoadingTimeOut,maxRetry:0,retryDelay:u.fragLoadingRetryDelay,maxRetryDelay:u.fragLoadingMaxRetryTimeout,highWaterMark:0},w={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};a.load(n,R,w)}else this.decryptkey&&(f.decryptdata.key=this.decryptkey,this.hls.trigger(K.Events.KEY_LOADED,{frag:f}))},k.loadsuccess=function(b,m,f){var d=f.frag;if(!d.decryptdata){M.logger.error("after key load, decryptdata unset");return}this.decryptkey=d.decryptdata.key=new Uint8Array(b.data),d.loader=null,delete this.loaders[d.type],this.hls.trigger(K.Events.KEY_LOADED,{frag:d})},k.loaderror=function(b,m){var f=m.frag,d=f.loader;d&&d.abort(),delete this.loaders[f.type],this.hls.trigger(K.Events.ERROR,{type:A.ErrorTypes.NETWORK_ERROR,details:A.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:f,response:b})},k.loadtimeout=function(b,m){var f=m.frag,d=f.loader;d&&d.abort(),delete this.loaders[f.type],this.hls.trigger(K.Events.ERROR,{type:A.ErrorTypes.NETWORK_ERROR,details:A.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:f})},P}()},"./src/loader/level-details.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"LevelDetails",function(){return P});var K=N("./src/polyfills/number.ts");function A(k,D){for(var b=0;b<D.length;b++){var m=D[b];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(k,m.key,m)}}function M(k,D,b){return D&&A(k.prototype,D),b&&A(k,b),k}var H=10,P=function(){function k(b){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=b}var D=k.prototype;return D.reloaded=function(m){if(!m){this.advanced=!0,this.updated=!0;return}var f=this.lastPartSn-m.lastPartSn,d=this.lastPartIndex-m.lastPartIndex;this.updated=this.endSN!==m.endSN||!!d||!!f,this.advanced=this.endSN>m.endSN||f>0||f===0&&d>0,this.updated||this.advanced?this.misses=Math.floor(m.misses*.6):this.misses=m.misses+1,this.availabilityDelay=m.availabilityDelay},M(k,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(K.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 f=this.driftEnd-this.driftStart;return f*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}}]),k}()},"./src/loader/level-key.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"LevelKey",function(){return P});var K=N("./node_modules/url-toolkit/src/url-toolkit.js"),A=N.n(K);function M(k,D){for(var b=0;b<D.length;b++){var m=D[b];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(k,m.key,m)}}function H(k,D,b){return D&&M(k.prototype,D),b&&M(k,b),k}var P=function(){k.fromURL=function(b,m){return new k(b,m)},k.fromURI=function(b){return new k(b)};function k(D,b){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,b?this._uri=Object(K.buildAbsoluteURL)(D,b,{alwaysNormalize:!0}):this._uri=D}return H(k,[{key:"uri",get:function(){return this._uri}}]),k}()},"./src/loader/load-stats.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"LoadStats",function(){return K});var K=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(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return a});var K=N("./src/polyfills/number.ts"),A=N("./node_modules/url-toolkit/src/url-toolkit.js"),M=N.n(A),H=N("./src/loader/fragment.ts"),P=N("./src/loader/level-details.ts"),k=N("./src/loader/level-key.ts"),D=N("./src/utils/attr-list.ts"),b=N("./src/utils/logger.ts"),m=N("./src/utils/codecs.ts"),f=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,d=/#EXT-X-MEDIA:(.*)/g,s=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),r=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("|")),u=/\.(mp4|m4s|m4v|m4a)$/i;function o(O){var C,_;return u.test((C=(_=A.parseURL(O))===null||_===void 0?void 0:_.path)!=null?C:"")}var a=function(){function O(){}return O.findGroup=function(_,y){for(var h=0;h<_.length;h++){var c=_[h];if(c.id===y)return c}},O.convertAVC1ToAVCOTI=function(_){var y=_.split(".");if(y.length>2){var h=y.shift()+".";return h+=parseInt(y.shift()).toString(16),h+=("000"+parseInt(y.shift()).toString(16)).substr(-4),h}return _},O.resolve=function(_,y){return A.buildAbsoluteURL(y,_,{alwaysNormalize:!0})},O.parseMasterPlaylist=function(_,y){var h=[],c={},v=!1;f.lastIndex=0;for(var p;(p=f.exec(_))!=null;)if(p[1]){var E=new D.AttrList(p[1]),U={attrs:E,bitrate:E.decimalInteger("AVERAGE-BANDWIDTH")||E.decimalInteger("BANDWIDTH"),name:E.NAME,url:O.resolve(p[2],y)},F=E.decimalResolution("RESOLUTION");F&&(U.width=F.width,U.height=F.height),n((E.CODECS||"").split(/[ ,]+/).filter(function(G){return G}),U),U.videoCodec&&U.videoCodec.indexOf("avc1")!==-1&&(U.videoCodec=O.convertAVC1ToAVCOTI(U.videoCodec)),h.push(U)}else if(p[3]){var z=new D.AttrList(p[3]);z["DATA-ID"]&&(v=!0,c[z["DATA-ID"]]=z)}return{levels:h,sessionData:v?c:null}},O.parseMasterPlaylistMedia=function(_,y,h,c){c===void 0&&(c=[]);var v,p=[],E=0;for(d.lastIndex=0;(v=d.exec(_))!==null;){var U=new D.AttrList(v[1]);if(U.TYPE===h){var F={attrs:U,bitrate:0,id:E++,groupId:U["GROUP-ID"],instreamId:U["INSTREAM-ID"],name:U.NAME||U.LANGUAGE||"",type:h,default:U.bool("DEFAULT"),autoselect:U.bool("AUTOSELECT"),forced:U.bool("FORCED"),lang:U.LANGUAGE,url:U.URI?O.resolve(U.URI,y):""};if(c.length){var z=O.findGroup(c,F.groupId)||c[0];R(F,z,"audioCodec"),R(F,z,"textCodec")}p.push(F)}}return p},O.parseLevelPlaylist=function(_,y,h,c,v){var p=new P.LevelDetails(y),E=p.fragments,U=null,F=0,z=0,G=0,B=0,T=null,V=new H.Fragment(c,y),Z,oe,pe,Ye=-1,xe=!1;for(s.lastIndex=0,p.m3u8=_;(Z=s.exec(_))!==null;){xe&&(xe=!1,V=new H.Fragment(c,y),V.start=G,V.sn=F,V.cc=B,V.level=h,U&&(V.initSegment=U,V.rawProgramDateTime=U.rawProgramDateTime));var Ie=Z[1];if(Ie){V.duration=parseFloat(Ie);var Je=(" "+Z[2]).slice(1);V.title=Je||null,V.tagList.push(Je?["INF",Ie,Je]:["INF",Ie])}else if(Z[3])Object(K.isFiniteNumber)(V.duration)&&(V.start=G,pe&&(V.levelkey=pe),V.sn=F,V.level=h,V.cc=B,V.urlId=v,E.push(V),V.relurl=(" "+Z[3]).slice(1),x(V,T),T=V,G+=V.duration,F++,z=0,xe=!0);else if(Z[4]){var Ke=(" "+Z[4]).slice(1);T?V.setByteRange(Ke,T):V.setByteRange(Ke)}else if(Z[5])V.rawProgramDateTime=(" "+Z[5]).slice(1),V.tagList.push(["PROGRAM-DATE-TIME",V.rawProgramDateTime]),Ye===-1&&(Ye=E.length);else{if(Z=Z[0].match(r),!Z){b.logger.warn("No matches on slow regex match for level playlist!");continue}for(oe=1;oe<Z.length&&!(typeof Z[oe]!="undefined");oe++);var be=(" "+Z[oe]).slice(1),de=(" "+Z[oe+1]).slice(1),nt=Z[oe+2]?(" "+Z[oe+2]).slice(1):"";switch(be){case"PLAYLIST-TYPE":p.type=de.toUpperCase();break;case"MEDIA-SEQUENCE":F=p.startSN=parseInt(de);break;case"SKIP":{var Kt=new D.AttrList(de),jt=Kt.decimalInteger("SKIPPED-SEGMENTS");if(Object(K.isFiniteNumber)(jt)){p.skippedSegments=jt;for(var wt=jt;wt--;)E.unshift(null);F+=jt}var ze=Kt.enumeratedString("RECENTLY-REMOVED-DATERANGES");ze&&(p.recentlyRemovedDateranges=ze.split(" "));break}case"TARGETDURATION":p.targetduration=parseFloat(de);break;case"VERSION":p.version=parseInt(de);break;case"EXTM3U":break;case"ENDLIST":p.live=!1;break;case"#":(de||nt)&&V.tagList.push(nt?[de,nt]:[de]);break;case"DIS":B++;case"GAP":V.tagList.push([be]);break;case"BITRATE":V.tagList.push([be,de]);break;case"DISCONTINUITY-SEQ":B=parseInt(de);break;case"KEY":{var ft,dt=new D.AttrList(de),Nt=dt.enumeratedString("METHOD"),Ze=dt.URI,Bt=dt.hexadecimalInteger("IV"),Ut=dt.enumeratedString("KEYFORMATVERSIONS"),Mt=dt.enumeratedString("KEYID"),An=(ft=dt.enumeratedString("KEYFORMAT"))!=null?ft:"identity",mn=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(mn.indexOf(An)>-1){b.logger.warn("Keyformat "+An+" is not supported from the manifest");continue}else if(An!=="identity")continue;Nt&&(pe=k.LevelKey.fromURL(y,Ze),Ze&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Nt)>=0&&(pe.method=Nt,pe.keyFormat=An,Mt&&(pe.keyID=Mt),Ut&&(pe.keyFormatVersions=Ut),pe.iv=Bt));break}case"START":{var pn=new D.AttrList(de),tt=pn.decimalFloatingPoint("TIME-OFFSET");Object(K.isFiniteNumber)(tt)&&(p.startTimeOffset=tt);break}case"MAP":{var fn=new D.AttrList(de);V.relurl=fn.URI,fn.BYTERANGE&&V.setByteRange(fn.BYTERANGE),V.level=h,V.sn="initSegment",pe&&(V.levelkey=pe),V.initSegment=null,U=V,xe=!0;break}case"SERVER-CONTROL":{var In=new D.AttrList(de);p.canBlockReload=In.bool("CAN-BLOCK-RELOAD"),p.canSkipUntil=In.optionalFloat("CAN-SKIP-UNTIL",0),p.canSkipDateRanges=p.canSkipUntil>0&&In.bool("CAN-SKIP-DATERANGES"),p.partHoldBack=In.optionalFloat("PART-HOLD-BACK",0),p.holdBack=In.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var He=new D.AttrList(de);p.partTarget=He.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ue=p.partList;Ue||(Ue=p.partList=[]);var pt=z>0?Ue[Ue.length-1]:void 0,Ct=z++,Ge=new H.Part(new D.AttrList(de),V,y,Ct,pt);Ue.push(Ge),V.duration+=Ge.duration;break}case"PRELOAD-HINT":{var vt=new D.AttrList(de);p.preloadHint=vt;break}case"RENDITION-REPORT":{var Ae=new D.AttrList(de);p.renditionReports=p.renditionReports||[],p.renditionReports.push(Ae);break}default:b.logger.warn("line parsed but not handled: "+Z);break}}}T&&!T.relurl?(E.pop(),G-=T.duration,p.partList&&(p.fragmentHint=T)):p.partList&&(x(V,T),V.cc=B,p.fragmentHint=V);var ge=E.length,Ee=E[0],ae=E[ge-1];if(G+=p.skippedSegments*p.targetduration,G>0&&ge&&ae){p.averagetargetduration=G/ge;var re=ae.sn;p.endSN=re!=="initSegment"?re:0,Ee&&(p.startCC=Ee.cc,Ee.initSegment||p.fragments.every(function(he){return he.relurl&&o(he.relurl)})&&(b.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),V=new H.Fragment(c,y),V.relurl=ae.relurl,V.level=h,V.sn="initSegment",Ee.initSegment=V,p.needSidxRanges=!0))}else p.endSN=0,p.startCC=0;return p.fragmentHint&&(G+=p.fragmentHint.duration),p.totalduration=G,p.endCC=B,Ye>0&&w(E,Ye),p},O}();function n(O,C){["video","audio","text"].forEach(function(_){var y=O.filter(function(c){return Object(m.isCodecType)(c,_)});if(y.length){var h=y.filter(function(c){return c.lastIndexOf("avc1",0)===0||c.lastIndexOf("mp4a",0)===0});C[_+"Codec"]=h.length>0?h[0]:y[0],O=O.filter(function(c){return y.indexOf(c)===-1})}}),C.unknownCodecs=O}function R(O,C,_){var y=C[_];y&&(O[_]=y)}function w(O,C){for(var _=O[C],y=C;y--;){var h=O[y];if(!h)return;h.programDateTime=_.programDateTime-h.duration*1e3,_=h}}function x(O,C){O.rawProgramDateTime?O.programDateTime=Date.parse(O.rawProgramDateTime):C!=null&&C.programDateTime&&(O.programDateTime=C.endProgramDateTime),Object(K.isFiniteNumber)(O.programDateTime)||(O.programDateTime=null,O.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(te,Y,N){"use strict";N.r(Y);var K=N("./src/polyfills/number.ts"),A=N("./src/events.ts"),M=N("./src/errors.ts"),H=N("./src/utils/logger.ts"),P=N("./src/utils/mp4-tools.ts"),k=N("./src/loader/m3u8-parser.ts"),D=N("./src/types/loader.ts"),b=N("./src/utils/attr-list.ts");function m(s){var r=s.type;switch(r){case D.PlaylistContextType.AUDIO_TRACK:return D.PlaylistLevelType.AUDIO;case D.PlaylistContextType.SUBTITLE_TRACK:return D.PlaylistLevelType.SUBTITLE;default:return D.PlaylistLevelType.MAIN}}function f(s,r){var u=s.url;return(u===void 0||u.indexOf("data:")===0)&&(u=r.url),u}var d=function(){function s(u){this.hls=void 0,this.loaders=Object.create(null),this.hls=u,this.registerListeners()}var r=s.prototype;return r.registerListeners=function(){var o=this.hls;o.on(A.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(A.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on(A.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),o.on(A.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},r.unregisterListeners=function(){var o=this.hls;o.off(A.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(A.Events.LEVEL_LOADING,this.onLevelLoading,this),o.off(A.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),o.off(A.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},r.createInternalLoader=function(o){var a=this.hls.config,n=a.pLoader,R=a.loader,w=n||R,x=new w(a);return o.loader=x,this.loaders[o.type]=x,x},r.getInternalLoader=function(o){return this.loaders[o.type]},r.resetInternalLoader=function(o){this.loaders[o]&&delete this.loaders[o]},r.destroyInternalLoaders=function(){for(var o in this.loaders){var a=this.loaders[o];a&&a.destroy(),this.resetInternalLoader(o)}},r.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},r.onManifestLoading=function(o,a){var n=a.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:D.PlaylistContextType.MANIFEST,url:n,deliveryDirectives:null})},r.onLevelLoading=function(o,a){var n=a.id,R=a.level,w=a.url,x=a.deliveryDirectives;this.load({id:n,groupId:null,level:R,responseType:"text",type:D.PlaylistContextType.LEVEL,url:w,deliveryDirectives:x})},r.onAudioTrackLoading=function(o,a){var n=a.id,R=a.groupId,w=a.url,x=a.deliveryDirectives;this.load({id:n,groupId:R,level:null,responseType:"text",type:D.PlaylistContextType.AUDIO_TRACK,url:w,deliveryDirectives:x})},r.onSubtitleTrackLoading=function(o,a){var n=a.id,R=a.groupId,w=a.url,x=a.deliveryDirectives;this.load({id:n,groupId:R,level:null,responseType:"text",type:D.PlaylistContextType.SUBTITLE_TRACK,url:w,deliveryDirectives:x})},r.load=function(o){var a,n=this.hls.config,R=this.getInternalLoader(o);if(R){var w=R.context;if(w&&w.url===o.url){H.logger.trace("[playlist-loader]: playlist request ongoing");return}H.logger.log("[playlist-loader]: aborting previous loader for type: "+o.type),R.abort()}var x,O,C,_;switch(o.type){case D.PlaylistContextType.MANIFEST:x=n.manifestLoadingMaxRetry,O=n.manifestLoadingTimeOut,C=n.manifestLoadingRetryDelay,_=n.manifestLoadingMaxRetryTimeout;break;case D.PlaylistContextType.LEVEL:case D.PlaylistContextType.AUDIO_TRACK:case D.PlaylistContextType.SUBTITLE_TRACK:x=0,O=n.levelLoadingTimeOut;break;default:x=n.levelLoadingMaxRetry,O=n.levelLoadingTimeOut,C=n.levelLoadingRetryDelay,_=n.levelLoadingMaxRetryTimeout;break}if(R=this.createInternalLoader(o),(a=o.deliveryDirectives)!==null&&a!==void 0&&a.part){var y;if(o.type===D.PlaylistContextType.LEVEL&&o.level!==null?y=this.hls.levels[o.level].details:o.type===D.PlaylistContextType.AUDIO_TRACK&&o.id!==null?y=this.hls.audioTracks[o.id].details:o.type===D.PlaylistContextType.SUBTITLE_TRACK&&o.id!==null&&(y=this.hls.subtitleTracks[o.id].details),y){var h=y.partTarget,c=y.targetduration;h&&c&&(O=Math.min(Math.max(h*3,c*.8)*1e3,O))}}var v={timeout:O,maxRetry:x,retryDelay:C,maxRetryDelay:_,highWaterMark:0},p={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};R.load(o,v,p)},r.loadsuccess=function(o,a,n,R){if(R===void 0&&(R=null),n.isSidxRequest){this.handleSidxRequest(o,n),this.handlePlaylistLoaded(o,a,n,R);return}this.resetInternalLoader(n.type);var w=o.data;if(w.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(o,n,"no EXTM3U delimiter",R);return}a.parsing.start=performance.now(),w.indexOf("#EXTINF:")>0||w.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(o,a,n,R):this.handleMasterPlaylist(o,a,n,R)},r.loaderror=function(o,a,n){n===void 0&&(n=null),this.handleNetworkError(a,n,!1,o)},r.loadtimeout=function(o,a,n){n===void 0&&(n=null),this.handleNetworkError(a,n,!0)},r.handleMasterPlaylist=function(o,a,n,R){var w=this.hls,x=o.data,O=f(o,n),C=k.default.parseMasterPlaylist(x,O),_=C.levels,y=C.sessionData;if(!_.length){this.handleManifestParsingError(o,n,"no level found in manifest",R);return}var h=_.map(function(F){return{id:F.attrs.AUDIO,audioCodec:F.audioCodec}}),c=_.map(function(F){return{id:F.attrs.SUBTITLES,textCodec:F.textCodec}}),v=k.default.parseMasterPlaylistMedia(x,O,"AUDIO",h),p=k.default.parseMasterPlaylistMedia(x,O,"SUBTITLES",c),E=k.default.parseMasterPlaylistMedia(x,O,"CLOSED-CAPTIONS");if(v.length){var U=v.some(function(F){return!F.url});!U&&_[0].audioCodec&&!_[0].attrs.AUDIO&&(H.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),v.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new b.AttrList({}),bitrate:0,url:""}))}w.trigger(A.Events.MANIFEST_LOADED,{levels:_,audioTracks:v,subtitles:p,captions:E,url:O,stats:a,networkDetails:R,sessionData:y})},r.handleTrackOrLevelPlaylist=function(o,a,n,R){var w=this.hls,x=n.id,O=n.level,C=n.type,_=f(o,n),y=Object(K.isFiniteNumber)(x)?x:0,h=Object(K.isFiniteNumber)(O)?O:y,c=m(n),v=k.default.parseLevelPlaylist(o.data,_,h,c,y);if(!v.fragments.length){w.trigger(A.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:_,reason:"no fragments found in level",level:typeof n.level=="number"?n.level:void 0});return}if(C===D.PlaylistContextType.MANIFEST){var p={attrs:new b.AttrList({}),bitrate:0,details:v,name:"",url:_};w.trigger(A.Events.MANIFEST_LOADED,{levels:[p],audioTracks:[],url:_,stats:a,networkDetails:R,sessionData:null})}if(a.parsing.end=performance.now(),v.needSidxRanges){var E,U=(E=v.fragments[0].initSegment)===null||E===void 0?void 0:E.url;this.load({url:U,isSidxRequest:!0,type:C,level:O,levelDetails:v,id:x,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}n.levelDetails=v,this.handlePlaylistLoaded(o,a,n,R)},r.handleSidxRequest=function(o,a){var n=Object(P.parseSegmentIndex)(new Uint8Array(o.data));if(!n)return;var R=n.references,w=a.levelDetails;R.forEach(function(x,O){var C=x.info,_=w.fragments[O];_.byteRange.length===0&&_.setByteRange(String(1+C.end-C.start)+"@"+String(C.start)),_.initSegment&&_.initSegment.setByteRange(String(n.moovEndOffset)+"@0")})},r.handleManifestParsingError=function(o,a,n,R){this.hls.trigger(A.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:a.type===D.PlaylistContextType.MANIFEST,url:o.url,reason:n,response:o,context:a,networkDetails:R})},r.handleNetworkError=function(o,a,n,R){n===void 0&&(n=!1),H.logger.warn("[playlist-loader]: A network "+(n?"timeout":"error")+" occurred while loading "+o.type+" level: "+o.level+" id: "+o.id+' group-id: "'+o.groupId+'"');var w=M.ErrorDetails.UNKNOWN,x=!1,O=this.getInternalLoader(o);switch(o.type){case D.PlaylistContextType.MANIFEST:w=n?M.ErrorDetails.MANIFEST_LOAD_TIMEOUT:M.ErrorDetails.MANIFEST_LOAD_ERROR,x=!0;break;case D.PlaylistContextType.LEVEL:w=n?M.ErrorDetails.LEVEL_LOAD_TIMEOUT:M.ErrorDetails.LEVEL_LOAD_ERROR,x=!1;break;case D.PlaylistContextType.AUDIO_TRACK:w=n?M.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:M.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,x=!1;break;case D.PlaylistContextType.SUBTITLE_TRACK:w=n?M.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:M.ErrorDetails.SUBTITLE_LOAD_ERROR,x=!1;break}O&&this.resetInternalLoader(o.type);var C={type:M.ErrorTypes.NETWORK_ERROR,details:w,fatal:x,url:o.url,loader:O,context:o,networkDetails:a};R&&(C.response=R),this.hls.trigger(A.Events.ERROR,C)},r.handlePlaylistLoaded=function(o,a,n,R){var w=n.type,x=n.level,O=n.id,C=n.groupId,_=n.loader,y=n.levelDetails,h=n.deliveryDirectives;if(!(y!=null&&y.targetduration)){this.handleManifestParsingError(o,n,"invalid target duration",R);return}if(!_)return;y.live&&(_.getCacheAge&&(y.ageHeader=_.getCacheAge()||0),(!_.getCacheAge||isNaN(y.ageHeader))&&(y.ageHeader=0));switch(w){case D.PlaylistContextType.MANIFEST:case D.PlaylistContextType.LEVEL:this.hls.trigger(A.Events.LEVEL_LOADED,{details:y,level:x||0,id:O||0,stats:a,networkDetails:R,deliveryDirectives:h});break;case D.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(A.Events.AUDIO_TRACK_LOADED,{details:y,id:O||0,groupId:C||"",stats:a,networkDetails:R,deliveryDirectives:h});break;case D.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(A.Events.SUBTITLE_TRACK_LOADED,{details:y,id:O||0,groupId:C||"",stats:a,networkDetails:R,deliveryDirectives:h});break}},s}();Y.default=d},"./src/polyfills/number.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"isFiniteNumber",function(){return K}),N.d(Y,"MAX_SAFE_INTEGER",function(){return A});var K=Number.isFinite||function(M){return typeof M=="number"&&isFinite(M)},A=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(te,Y,N){"use strict";N.r(Y);var K=function(){function A(){}return A.getSilentFrame=function(H,P){switch(H){case"mp4a.40.2":if(P===1)return new Uint8Array([0,200,0,128,35,128]);if(P===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(P===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(P===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(P===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(P===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(P===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(P===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(P===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},A}();Y.default=K},"./src/remux/mp4-generator.ts":function(te,Y,N){"use strict";N.r(Y);var K=Math.pow(2,32)-1,A=function(){function M(){}return M.init=function(){M.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var P;for(P in M.types)M.types.hasOwnProperty(P)&&(M.types[P]=[P.charCodeAt(0),P.charCodeAt(1),P.charCodeAt(2),P.charCodeAt(3)]);var k=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]),D=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);M.HDLR_TYPES={video:k,audio:D};var b=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]);M.STTS=M.STSC=M.STCO=m,M.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),M.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),M.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),M.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var f=new Uint8Array([105,115,111,109]),d=new Uint8Array([97,118,99,49]),s=new Uint8Array([0,0,0,1]);M.FTYP=M.box(M.types.ftyp,f,s,f,d),M.DINF=M.box(M.types.dinf,M.box(M.types.dref,b))},M.box=function(P){for(var k=8,D=arguments.length,b=new Array(D>1?D-1:0),m=1;m<D;m++)b[m-1]=arguments[m];for(var f=b.length,d=f;f--;)k+=b[f].byteLength;var s=new Uint8Array(k);for(s[0]=k>>24&255,s[1]=k>>16&255,s[2]=k>>8&255,s[3]=k&255,s.set(P,4),f=0,k=8;f<d;f++)s.set(b[f],k),k+=b[f].byteLength;return s},M.hdlr=function(P){return M.box(M.types.hdlr,M.HDLR_TYPES[P])},M.mdat=function(P){return M.box(M.types.mdat,P)},M.mdhd=function(P,k){k*=P;var D=Math.floor(k/(K+1)),b=Math.floor(k%(K+1));return M.box(M.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,P>>24&255,P>>16&255,P>>8&255,P&255,D>>24,D>>16&255,D>>8&255,D&255,b>>24,b>>16&255,b>>8&255,b&255,85,196,0,0]))},M.mdia=function(P){return M.box(M.types.mdia,M.mdhd(P.timescale,P.duration),M.hdlr(P.type),M.minf(P))},M.mfhd=function(P){return M.box(M.types.mfhd,new Uint8Array([0,0,0,0,P>>24,P>>16&255,P>>8&255,P&255]))},M.minf=function(P){return P.type==="audio"?M.box(M.types.minf,M.box(M.types.smhd,M.SMHD),M.DINF,M.stbl(P)):M.box(M.types.minf,M.box(M.types.vmhd,M.VMHD),M.DINF,M.stbl(P))},M.moof=function(P,k,D){return M.box(M.types.moof,M.mfhd(P),M.traf(D,k))},M.moov=function(P){for(var k=P.length,D=[];k--;)D[k]=M.trak(P[k]);return M.box.apply(null,[M.types.moov,M.mvhd(P[0].timescale,P[0].duration)].concat(D).concat(M.mvex(P)))},M.mvex=function(P){for(var k=P.length,D=[];k--;)D[k]=M.trex(P[k]);return M.box.apply(null,[M.types.mvex].concat(D))},M.mvhd=function(P,k){k*=P;var D=Math.floor(k/(K+1)),b=Math.floor(k%(K+1)),m=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,P>>24&255,P>>16&255,P>>8&255,P&255,D>>24,D>>16&255,D>>8&255,D&255,b>>24,b>>16&255,b>>8&255,b&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return M.box(M.types.mvhd,m)},M.sdtp=function(P){var k=P.samples||[],D=new Uint8Array(4+k.length),b,m;for(b=0;b<k.length;b++)m=k[b].flags,D[b+4]=m.dependsOn<<4|m.isDependedOn<<2|m.hasRedundancy;return M.box(M.types.sdtp,D)},M.stbl=function(P){return M.box(M.types.stbl,M.stsd(P),M.box(M.types.stts,M.STTS),M.box(M.types.stsc,M.STSC),M.box(M.types.stsz,M.STSZ),M.box(M.types.stco,M.STCO))},M.avc1=function(P){var k=[],D=[],b,m,f;for(b=0;b<P.sps.length;b++)m=P.sps[b],f=m.byteLength,k.push(f>>>8&255),k.push(f&255),k=k.concat(Array.prototype.slice.call(m));for(b=0;b<P.pps.length;b++)m=P.pps[b],f=m.byteLength,D.push(f>>>8&255),D.push(f&255),D=D.concat(Array.prototype.slice.call(m));var d=M.box(M.types.avcC,new Uint8Array([1,k[3],k[4],k[5],252|3,224|P.sps.length].concat(k).concat([P.pps.length]).concat(D))),s=P.width,r=P.height,u=P.pixelRatio[0],o=P.pixelRatio[1];return M.box(M.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,s>>8&255,s&255,r>>8&255,r&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),d,M.box(M.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),M.box(M.types.pasp,new Uint8Array([u>>24,u>>16&255,u>>8&255,u&255,o>>24,o>>16&255,o>>8&255,o&255])))},M.esds=function(P){var k=P.config.length;return new Uint8Array([0,0,0,0,3,23+k,0,1,0,4,15+k,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([k]).concat(P.config).concat([6,1,2]))},M.mp4a=function(P){var k=P.samplerate;return M.box(M.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,P.channelCount,0,16,0,0,0,0,k>>8&255,k&255,0,0]),M.box(M.types.esds,M.esds(P)))},M.mp3=function(P){var k=P.samplerate;return M.box(M.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,P.channelCount,0,16,0,0,0,0,k>>8&255,k&255,0,0]))},M.stsd=function(P){return P.type==="audio"?!P.isAAC&&P.codec==="mp3"?M.box(M.types.stsd,M.STSD,M.mp3(P)):M.box(M.types.stsd,M.STSD,M.mp4a(P)):M.box(M.types.stsd,M.STSD,M.avc1(P))},M.tkhd=function(P){var k=P.id,D=P.duration*P.timescale,b=P.width,m=P.height,f=Math.floor(D/(K+1)),d=Math.floor(D%(K+1));return M.box(M.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,k>>24&255,k>>16&255,k>>8&255,k&255,0,0,0,0,f>>24,f>>16&255,f>>8&255,f&255,d>>24,d>>16&255,d>>8&255,d&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,b>>8&255,b&255,0,0,m>>8&255,m&255,0,0]))},M.traf=function(P,k){var D=M.sdtp(P),b=P.id,m=Math.floor(k/(K+1)),f=Math.floor(k%(K+1));return M.box(M.types.traf,M.box(M.types.tfhd,new Uint8Array([0,0,0,0,b>>24,b>>16&255,b>>8&255,b&255])),M.box(M.types.tfdt,new Uint8Array([1,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,f>>24,f>>16&255,f>>8&255,f&255])),M.trun(P,D.length+16+20+8+16+8+8),D)},M.trak=function(P){return P.duration=P.duration||4294967295,M.box(M.types.trak,M.tkhd(P),M.mdia(P))},M.trex=function(P){var k=P.id;return M.box(M.types.trex,new Uint8Array([0,0,0,0,k>>24,k>>16&255,k>>8&255,k&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},M.trun=function(P,k){var D=P.samples||[],b=D.length,m=12+16*b,f=new Uint8Array(m),d,s,r,u,o,a;for(k+=8+m,f.set([0,0,15,1,b>>>24&255,b>>>16&255,b>>>8&255,b&255,k>>>24&255,k>>>16&255,k>>>8&255,k&255],0),d=0;d<b;d++)s=D[d],r=s.duration,u=s.size,o=s.flags,a=s.cts,f.set([r>>>24&255,r>>>16&255,r>>>8&255,r&255,u>>>24&255,u>>>16&255,u>>>8&255,u&255,o.isLeading<<2|o.dependsOn,o.isDependedOn<<6|o.hasRedundancy<<4|o.paddingValue<<1|o.isNonSync,o.degradPrio&240<<8,o.degradPrio&15,a>>>24&255,a>>>16&255,a>>>8&255,a&255],12+16*d);return M.box(M.types.trun,f)},M.initSegment=function(P){M.types||M.init();var k=M.moov(P),D=new Uint8Array(M.FTYP.byteLength+k.byteLength);return D.set(M.FTYP),D.set(k,M.FTYP.byteLength),D},M}();A.types=void 0,A.HDLR_TYPES=void 0,A.STTS=void 0,A.STSC=void 0,A.STCO=void 0,A.STSZ=void 0,A.VMHD=void 0,A.SMHD=void 0,A.STSD=void 0,A.FTYP=void 0,A.DINF=void 0,Y.default=A},"./src/remux/mp4-remuxer.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return a}),N.d(Y,"normalizePts",function(){return n});var K=N("./src/polyfills/number.ts"),A=N("./src/remux/aac-helper.ts"),M=N("./src/remux/mp4-generator.ts"),H=N("./src/events.ts"),P=N("./src/errors.ts"),k=N("./src/utils/logger.ts"),D=N("./src/types/loader.ts"),b=N("./src/utils/timescale-conversion.ts");function m(){return m=Object.assign||function(O){for(var C=1;C<arguments.length;C++){var _=arguments[C];for(var y in _)Object.prototype.hasOwnProperty.call(_,y)&&(O[y]=_[y])}return O},m.apply(this,arguments)}var f=10*1e3,d=1024,s=1152,r=null,u=null,o=!1,a=function(){function O(_,y,h,c){if(c===void 0&&(c=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=_,this.config=y,this.typeSupported=h,this.ISGenerated=!1,r===null){var v=navigator.userAgent||"",p=v.match(/Chrome\/(\d+)/i);r=p?parseInt(p[1]):0}if(u===null){var E=navigator.userAgent.match(/Safari\/(\d+)/i);u=E?parseInt(E[1]):0}o=!!r&&r<75||!!u&&u<600}var C=O.prototype;return C.destroy=function(){},C.resetTimeStamp=function(y){k.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=y},C.resetNextTimestamp=function(){k.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},C.resetInitSegment=function(){k.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},C.getVideoStartPts=function(y){var h=!1,c=y.reduce(function(v,p){var E=p.pts-v;return E<-4294967296?(h=!0,n(v,p.pts)):E>0?v:p.pts},y[0].pts);return h&&k.logger.debug("PTS rollover detected"),c},C.remux=function(y,h,c,v,p,E,U,F){var z,G,B,T,V,Z,oe=p,pe=p,Ye=y.pid>-1,xe=h.pid>-1,Ie=h.samples.length,Je=y.samples.length>0,Ke=Ie>1,be=(!Ye||Je)&&(!xe||Ke)||this.ISGenerated||U;if(be){this.ISGenerated||(B=this.generateIS(y,h,p));var de=this.isVideoContiguous,nt=-1;if(Ke&&(nt=R(h.samples),!de&&this.config.forceKeyFrameOnDiscontinuity))if(Z=!0,nt>0){k.logger.warn("[mp4-remuxer]: Dropped "+nt+" out of "+Ie+" video samples due to a missing keyframe");var Kt=this.getVideoStartPts(h.samples);h.samples=h.samples.slice(nt),h.dropped+=nt,pe+=(h.samples[0].pts-Kt)/(h.timescale||9e4)}else nt===-1&&(k.logger.warn("[mp4-remuxer]: No keyframe found out of "+Ie+" video samples"),Z=!1);if(this.ISGenerated){if(Je&&Ke){var jt=this.getVideoStartPts(h.samples),wt=n(y.samples[0].pts,jt)-jt,ze=wt/h.inputTimeScale;oe+=Math.max(0,ze),pe+=Math.max(0,-ze)}if(Je){if(y.samplerate||(k.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),B=this.generateIS(y,h,p)),G=this.remuxAudio(y,oe,this.isAudioContiguous,E,xe||Ke||F===D.PlaylistLevelType.AUDIO?pe:void 0),Ke){var ft=G?G.endPTS-G.startPTS:0;h.inputTimeScale||(k.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),B=this.generateIS(y,h,p)),z=this.remuxVideo(h,pe,de,ft)}}else Ke&&(z=this.remuxVideo(h,pe,de,0));z&&(z.firstKeyFrame=nt,z.independent=nt!==-1)}}return this.ISGenerated&&(c.samples.length&&(V=this.remuxID3(c,p)),v.samples.length&&(T=this.remuxText(v,p))),{audio:G,video:z,initSegment:B,independent:Z,text:T,id3:V}},C.generateIS=function(y,h,c){var v=y.samples,p=h.samples,E=this.typeSupported,U={},F=!Object(K.isFiniteNumber)(this._initPTS),z="audio/mp4",G,B,T;if(F&&(G=B=Infinity),y.config&&v.length&&(y.timescale=y.samplerate,y.isAAC||(E.mpeg?(z="audio/mpeg",y.codec=""):E.mp3&&(y.codec="mp3")),U.audio={id:"audio",container:z,codec:y.codec,initSegment:!y.isAAC&&E.mpeg?new Uint8Array(0):M.default.initSegment([y]),metadata:{channelCount:y.channelCount}},F&&(T=y.inputTimeScale,G=B=v[0].pts-Math.round(T*c))),h.sps&&h.pps&&p.length&&(h.timescale=h.inputTimeScale,U.video={id:"main",container:"video/mp4",codec:h.codec,initSegment:M.default.initSegment([h]),metadata:{width:h.width,height:h.height}},F)){T=h.inputTimeScale;var V=this.getVideoStartPts(p),Z=Math.round(T*c);B=Math.min(B,n(p[0].dts,V)-Z),G=Math.min(G,V-Z)}if(Object.keys(U).length)return this.ISGenerated=!0,F&&(this._initPTS=G,this._initDTS=B),{tracks:U,initPTS:G,timescale:T}},C.remuxVideo=function(y,h,c,v){var p=y.inputTimeScale,E=y.samples,U=[],F=E.length,z=this._initPTS,G=this.nextAvcDts,B=8,T,V,Z,oe=Number.POSITIVE_INFINITY,pe=Number.NEGATIVE_INFINITY,Ye=0,xe=!1;if(!c||G===null){var Ie=h*p,Je=E[0].pts-n(E[0].dts,E[0].pts);G=Ie-Je}for(var Ke=0;Ke<F;Ke++){var be=E[Ke];if(be.pts=n(be.pts-z,G),be.dts=n(be.dts-z,G),be.dts>be.pts){var de=9e4*.2;Ye=Math.max(Math.min(Ye,be.pts-be.dts),-1*de)}be.dts<E[Ke>0?Ke-1:Ke].dts&&(xe=!0)}xe&&E.sort(function(Qt,gt){var yt=Qt.dts-gt.dts,rt=Qt.pts-gt.pts;return yt||rt}),V=E[0].dts,Z=E[E.length-1].dts;var nt=Math.round((Z-V)/(F-1));if(Ye<0){if(Ye<nt*-2){k.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(b.toMsFromMpegTsClock)(-nt,!0)+" ms");for(var Kt=Ye,jt=0;jt<F;jt++)E[jt].dts=Kt=Math.max(Kt,E[jt].pts-nt),E[jt].pts=Math.max(Kt,E[jt].pts)}else{k.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(b.toMsFromMpegTsClock)(Ye,!0)+" ms to overcome this issue");for(var wt=0;wt<F;wt++)E[wt].dts=E[wt].dts+Ye}V=E[0].dts}if(c){var ze=V-G,ft=ze>nt,dt=ze<-1;if(ft||dt){ft?k.logger.warn("AVC: "+Object(b.toMsFromMpegTsClock)(ze,!0)+" ms ("+ze+"dts) hole between fragments detected, filling it"):k.logger.warn("AVC: "+Object(b.toMsFromMpegTsClock)(-ze,!0)+" ms ("+ze+"dts) overlapping between fragments detected"),V=G;var Nt=E[0].pts-ze;E[0].dts=V,E[0].pts=Nt,k.logger.log("Video: First PTS/DTS adjusted: "+Object(b.toMsFromMpegTsClock)(Nt,!0)+"/"+Object(b.toMsFromMpegTsClock)(V,!0)+", delta: "+Object(b.toMsFromMpegTsClock)(ze,!0)+" ms")}}o&&(V=Math.max(0,V));for(var Ze=0,Bt=0,Ut=0;Ut<F;Ut++){for(var Mt=E[Ut],An=Mt.units,mn=An.length,pn=0,tt=0;tt<mn;tt++)pn+=An[tt].data.length;Bt+=pn,Ze+=mn,Mt.length=pn,Mt.dts=Math.max(Mt.dts,V),Mt.pts=Math.max(Mt.pts,Mt.dts,0),oe=Math.min(Mt.pts,oe),pe=Math.max(Mt.pts,pe)}Z=E[F-1].dts;var fn=Bt+4*Ze+8,In;try{In=new Uint8Array(fn)}catch(Qt){this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:P.ErrorTypes.MUX_ERROR,details:P.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:fn,reason:"fail allocating video mdat "+fn});return}var He=new DataView(In.buffer);He.setUint32(0,fn),In.set(M.default.types.mdat,4);for(var Ue=0;Ue<F;Ue++){for(var pt=E[Ue],Ct=pt.units,Ge=0,vt=0,Ae=Ct.length;vt<Ae;vt++){var ge=Ct[vt],Ee=ge.data,ae=ge.data.byteLength;He.setUint32(B,ae),B+=4,In.set(Ee,B),B+=ae,Ge+=4+ae}if(Ue<F-1)T=E[Ue+1].dts-pt.dts;else{var re=this.config,he=pt.dts-E[Ue>0?Ue-1:Ue].dts;if(re.stretchShortVideoTrack&&this.nextAudioPts!==null){var ve=Math.floor(re.maxBufferHole*p),me=(v?oe+v*p:this.nextAudioPts)-pt.pts;me>ve?(T=me-he,T<0&&(T=he),k.logger.log("[mp4-remuxer]: It is approximately "+me/90+" ms to the next segment; using duration "+T/90+" ms for the last video frame.")):T=he}else T=he}var Be=Math.round(pt.pts-pt.dts);U.push(new w(pt.key,T,Ge,Be))}if(U.length&&r&&r<70){var Tt=U[0].flags;Tt.dependsOn=2,Tt.isNonSync=0}console.assert(T!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=G=Z+T,this.isVideoContiguous=!0;var Jt=M.default.moof(y.sequenceNumber++,V,m({},y,{samples:U})),En="video",mt={data1:Jt,data2:In,startPTS:oe/p,endPTS:(pe+T)/p,startDTS:V/p,endDTS:G/p,type:En,hasAudio:!1,hasVideo:!0,nb:U.length,dropped:y.dropped};return y.samples=[],y.dropped=0,console.assert(In.length,"MDAT length must not be zero"),mt},C.remuxAudio=function(y,h,c,v,p){var E=y.inputTimeScale,U=y.samplerate?y.samplerate:E,F=E/U,z=y.isAAC?d:s,G=z*F,B=this._initPTS,T=!y.isAAC&&this.typeSupported.mpeg,V=[],Z=y.samples,oe=T?0:8,pe=this.nextAudioPts||-1,Ye=h*E;if(this.isAudioContiguous=c=c||Z.length&&pe>0&&(v&&Math.abs(Ye-pe)<9e3||Math.abs(n(Z[0].pts-B,Ye)-pe)<20*G),Z.forEach(function(Ee){Ee.pts=n(Ee.pts-B,Ye)}),!c||pe<0){if(Z=Z.filter(function(Ee){return Ee.pts>=0}),!Z.length)return;p===0?pe=0:v?pe=Math.max(0,Ye):pe=Z[0].pts}if(y.isAAC)for(var xe=p!==void 0,Ie=this.config.maxAudioFramesDrift,Je=0,Ke=pe;Je<Z.length;Je++){var be=Z[Je],de=be.pts,nt=de-Ke,Kt=Math.abs(1e3*nt/E);if(nt<=-Ie*G&&xe)Je===0&&(k.logger.warn("Audio frame @ "+(de/E).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*nt/E)+" ms."),this.nextAudioPts=pe=Ke=de);else if(nt>=Ie*G&&Kt<f&&xe){var jt=Math.round(nt/G);Ke=de-jt*G,Ke<0&&(jt--,Ke+=G),Je===0&&(this.nextAudioPts=pe=Ke),k.logger.warn("[mp4-remuxer]: Injecting "+jt+" audio frame @ "+(Ke/E).toFixed(3)+"s due to "+Math.round(1e3*nt/E)+" ms gap.");for(var wt=0;wt<jt;wt++){var ze=Math.max(Ke,0),ft=A.default.getSilentFrame(y.manifestCodec||y.codec,y.channelCount);ft||(k.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ft=be.unit.subarray()),Z.splice(Je,0,{unit:ft,pts:ze}),Ke+=G,Je++}}be.pts=Ke,Ke+=G}for(var dt=null,Nt=null,Ze,Bt=0,Ut=Z.length;Ut--;)Bt+=Z[Ut].unit.byteLength;for(var Mt=0,An=Z.length;Mt<An;Mt++){var mn=Z[Mt],pn=mn.unit,tt=mn.pts;if(Nt!==null){var fn=V[Mt-1];fn.duration=Math.round((tt-Nt)/F)}else if(c&&y.isAAC&&(tt=pe),dt=tt,Bt>0){Bt+=oe;try{Ze=new Uint8Array(Bt)}catch(Ee){this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:P.ErrorTypes.MUX_ERROR,details:P.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Bt,reason:"fail allocating audio mdat "+Bt});return}if(!T){var In=new DataView(Ze.buffer);In.setUint32(0,Bt),Ze.set(M.default.types.mdat,4)}}else return;Ze.set(pn,oe);var He=pn.byteLength;oe+=He,V.push(new w(!0,z,He,0)),Nt=tt}var Ue=V.length;if(!Ue)return;var pt=V[V.length-1];this.nextAudioPts=pe=Nt+F*pt.duration;var Ct=T?new Uint8Array(0):M.default.moof(y.sequenceNumber++,dt/F,m({},y,{samples:V}));y.samples=[];var Ge=dt/E,vt=pe/E,Ae="audio",ge={data1:Ct,data2:Ze,startPTS:Ge,endPTS:vt,startDTS:Ge,endDTS:vt,type:Ae,hasAudio:!0,hasVideo:!1,nb:Ue};return this.isAudioContiguous=!0,console.assert(Ze.length,"MDAT length must not be zero"),ge},C.remuxEmptyAudio=function(y,h,c,v){var p=y.inputTimeScale,E=y.samplerate?y.samplerate:p,U=p/E,F=this.nextAudioPts,z=(F!==null?F:v.startDTS*p)+this._initDTS,G=v.endDTS*p+this._initDTS,B=U*d,T=Math.ceil((G-z)/B),V=A.default.getSilentFrame(y.manifestCodec||y.codec,y.channelCount);if(k.logger.warn("[mp4-remuxer]: remux empty Audio"),!V){k.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var Z=[],oe=0;oe<T;oe++){var pe=z+oe*B;Z.push({unit:V,pts:pe,dts:pe})}return y.samples=Z,this.remuxAudio(y,h,c,!1)},C.remuxID3=function(y,h){var c=y.samples.length;if(!c)return;for(var v=y.inputTimeScale,p=this._initPTS,E=this._initDTS,U=0;U<c;U++){var F=y.samples[U];F.pts=n(F.pts-p,h*v)/v,F.dts=n(F.dts-E,h*v)/v}var z=y.samples;return y.samples=[],{samples:z}},C.remuxText=function(y,h){var c=y.samples.length;if(!c)return;for(var v=y.inputTimeScale,p=this._initPTS,E=0;E<c;E++){var U=y.samples[E];U.pts=n(U.pts-p,h*v)/v}y.samples.sort(function(z,G){return z.pts-G.pts});var F=y.samples;return y.samples=[],{samples:F}},O}();function n(O,C){var _;if(C===null)return O;for(C<O?_=-8589934592:_=8589934592;Math.abs(O-C)>4294967296;)O+=_;return O}function R(O){for(var C=0;C<O.length;C++)if(O[C].key)return C;return-1}var w=function(C,_,y,h){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=_,this.size=y,this.cts=h,this.flags=new x(C)},x=function(C){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=C?2:1,this.isNonSync=C?0:1}},"./src/remux/passthrough-remuxer.ts":function(te,Y,N){"use strict";N.r(Y);var K=N("./src/polyfills/number.ts"),A=N("./src/utils/mp4-tools.ts"),M=N("./src/loader/fragment.ts"),H=N("./src/utils/logger.ts"),P=function(){function b(){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=b.prototype;return m.destroy=function(){},m.resetTimeStamp=function(d){this.initPTS=d,this.lastEndDTS=null},m.resetNextTimestamp=function(){this.lastEndDTS=null},m.resetInitSegment=function(d,s,r){this.audioCodec=s,this.videoCodec=r,this.generateInitSegment(d),this.emitInitSegment=!0},m.generateInitSegment=function(d){var s=this.audioCodec,r=this.videoCodec;if(!d||!d.byteLength){this.initTracks=void 0,this.initData=void 0;return}var u=this.initData=Object(A.parseInitSegment)(d);s||(s=D(u.audio,M.ElementaryStreamTypes.AUDIO)),r||(r=D(u.video,M.ElementaryStreamTypes.VIDEO));var o={};u.audio&&u.video?o.audiovideo={container:"video/mp4",codec:s+","+r,initSegment:d,id:"main"}:u.audio?o.audio={container:"audio/mp4",codec:s,initSegment:d,id:"audio"}:u.video?o.video={container:"video/mp4",codec:r,initSegment:d,id:"main"}:H.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=o},m.remux=function(d,s,r,u,o){var a=this.initPTS,n=this.lastEndDTS,R={audio:void 0,video:void 0,text:u,id3:r,initSegment:void 0};Object(K.isFiniteNumber)(n)||(n=this.lastEndDTS=o||0);var w=s.samples;if(!w||!w.length)return R;var x={initPTS:void 0,timescale:1},O=this.initData;if((!O||!O.length)&&(this.generateInitSegment(w),O=this.initData),!O||!O.length)return H.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),R;this.emitInitSegment&&(x.tracks=this.initTracks,this.emitInitSegment=!1),Object(K.isFiniteNumber)(a)||(this.initPTS=x.initPTS=a=k(O,w,n));var C=Object(A.getDuration)(w,O),_=n,y=C+_;Object(A.offsetStartDTS)(O,w,a),C>0?this.lastEndDTS=y:(H.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var h=!!O.audio,c=!!O.video,v="";h&&(v+="audio"),c&&(v+="video");var p={data1:w,startPTS:_,startDTS:_,endPTS:y,endDTS:y,type:v,hasAudio:h,hasVideo:c,nb:1,dropped:0};return R.audio=p.type==="audio"?p:void 0,R.video=p.type!=="audio"?p:void 0,R.text=u,R.id3=r,R.initSegment=x,R},b}(),k=function(m,f,d){return Object(A.getStartDTS)(m,f)-d};function D(b,m){var f=b==null?void 0:b.codec;return f&&f.length>4?f:f==="hvc1"?"hvc1.1.c.L120.90":f==="av01"?"av01.0.04M.08":f==="avc1"||m===M.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}Y.default=P},"./src/task-loop.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return K});var K=function(){function A(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var M=A.prototype;return M.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},M.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},M.onHandlerDestroyed=function(){},M.hasInterval=function(){return!!this._tickInterval},M.hasNextTick=function(){return!!this._tickTimer},M.setInterval=function(P){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,P),!0)},M.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},M.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},M.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},M.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},M.doTick=function(){},A}()},"./src/types/cmcd.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"CMCDVersion",function(){return K}),N.d(Y,"CMCDObjectType",function(){return A}),N.d(Y,"CMCDStreamingFormat",function(){return M}),N.d(Y,"CMCDStreamType",function(){return H});var K=1,A;(function(P){P.MANIFEST="m",P.AUDIO="a",P.VIDEO="v",P.MUXED="av",P.INIT="i",P.CAPTION="c",P.TIMED_TEXT="tt",P.KEY="k",P.OTHER="o"})(A||(A={}));var M;(function(P){P.DASH="d",P.HLS="h",P.SMOOTH="s",P.OTHER="o"})(M||(M={}));var H;(function(P){P.VOD="v",P.LIVE="l"})(H||(H={}))},"./src/types/level.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"HlsSkip",function(){return M}),N.d(Y,"getSkipValue",function(){return H}),N.d(Y,"HlsUrlParameters",function(){return P}),N.d(Y,"Level",function(){return k});function K(D,b){for(var m=0;m<b.length;m++){var f=b[m];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(D,f.key,f)}}function A(D,b,m){return b&&K(D.prototype,b),m&&K(D,m),D}var M;(function(D){D.No="",D.Yes="YES",D.v2="v2"})(M||(M={}));function H(D,b){var m=D.canSkipUntil,f=D.canSkipDateRanges,d=D.endSN,s=b!==void 0?b-d:0;return m&&s<m?f?M.v2:M.Yes:M.No}var P=function(){function D(m,f,d){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=m,this.part=f,this.skip=d}var b=D.prototype;return b.addDirectives=function(f){var d=new self.URL(f);return this.msn!==void 0&&d.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&d.searchParams.set("_HLS_part",this.part.toString()),this.skip&&d.searchParams.set("_HLS_skip",this.skip),d.toString()},D}(),k=function(){function D(b){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=[b.url],this.attrs=b.attrs,this.bitrate=b.bitrate,b.details&&(this.details=b.details),this.id=b.id||0,this.name=b.name,this.width=b.width||0,this.height=b.height||0,this.audioCodec=b.audioCodec,this.videoCodec=b.videoCodec,this.unknownCodecs=b.unknownCodecs,this.codecSet=[b.videoCodec,b.audioCodec].filter(function(m){return m}).join(",").replace(/\.[^.,]+/g,"")}return A(D,[{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 f=m%this.url.length;this._urlId!==f&&(this.details=void 0,this._urlId=f)}}]),D}()},"./src/types/loader.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"PlaylistContextType",function(){return K}),N.d(Y,"PlaylistLevelType",function(){return A});var K;(function(M){M.MANIFEST="manifest",M.LEVEL="level",M.AUDIO_TRACK="audioTrack",M.SUBTITLE_TRACK="subtitleTrack"})(K||(K={}));var A;(function(M){M.MAIN="main",M.AUDIO="audio",M.SUBTITLE="subtitle"})(A||(A={}))},"./src/types/transmuxer.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"ChunkMetadata",function(){return K});var K=function(H,P,k,D,b,m){D===void 0&&(D=0),b===void 0&&(b=-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=A(),this.buffering={audio:A(),video:A(),audiovideo:A()},this.level=H,this.sn=P,this.id=k,this.size=D,this.part=b,this.partial=m};function A(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"AttrList",function(){return M});var K=/^(\d+)x(\d+)$/,A=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,M=function(){function H(k){typeof k=="string"&&(k=H.parseAttrList(k));for(var D in k)k.hasOwnProperty(D)&&(this[D]=k[D])}var P=H.prototype;return P.decimalInteger=function(D){var b=parseInt(this[D],10);return b>Number.MAX_SAFE_INTEGER?Infinity:b},P.hexadecimalInteger=function(D){if(this[D]){var b=(this[D]||"0x").slice(2);b=(b.length&1?"0":"")+b;for(var m=new Uint8Array(b.length/2),f=0;f<b.length/2;f++)m[f]=parseInt(b.slice(f*2,f*2+2),16);return m}else return null},P.hexadecimalIntegerAsNumber=function(D){var b=parseInt(this[D],16);return b>Number.MAX_SAFE_INTEGER?Infinity:b},P.decimalFloatingPoint=function(D){return parseFloat(this[D])},P.optionalFloat=function(D,b){var m=this[D];return m?parseFloat(m):b},P.enumeratedString=function(D){return this[D]},P.bool=function(D){return this[D]==="YES"},P.decimalResolution=function(D){var b=K.exec(this[D]);return b===null?void 0:{width:parseInt(b[1],10),height:parseInt(b[2],10)}},H.parseAttrList=function(D){var b,m={},f='"';for(A.lastIndex=0;(b=A.exec(D))!==null;){var d=b[2];d.indexOf(f)===0&&d.lastIndexOf(f)===d.length-1&&(d=d.slice(1,-1)),m[b[1]]=d}return m},H}()},"./src/utils/binary-search.ts":function(te,Y,N){"use strict";N.r(Y);var K={search:function(M,H){for(var P=0,k=M.length-1,D=null,b=null;P<=k;){D=(P+k)/2|0,b=M[D];var m=H(b);if(m>0)P=D+1;else if(m<0)k=D-1;else return b}return null}};Y.default=K},"./src/utils/buffer-helper.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"BufferHelper",function(){return M});var K=N("./src/utils/logger.ts"),A={length:0,start:function(){return 0},end:function(){return 0}},M=function(){function H(){}return H.isBuffered=function(k,D){try{if(k){for(var b=H.getBuffered(k),m=0;m<b.length;m++)if(D>=b.start(m)&&D<=b.end(m))return!0}}catch(f){}return!1},H.bufferInfo=function(k,D,b){try{if(k){var m=H.getBuffered(k),f=[],d;for(d=0;d<m.length;d++)f.push({start:m.start(d),end:m.end(d)});return this.bufferedInfo(f,D,b)}}catch(s){}return{len:0,start:D,end:D,nextStart:void 0}},H.bufferedInfo=function(k,D,b){D=Math.max(0,D),k.sort(function(x,O){var C=x.start-O.start;return C||O.end-x.end});var m=[];if(b)for(var f=0;f<k.length;f++){var d=m.length;if(d){var s=m[d-1].end;k[f].start-s<b?k[f].end>s&&(m[d-1].end=k[f].end):m.push(k[f])}else m.push(k[f])}else m=k;for(var r=0,u,o=D,a=D,n=0;n<m.length;n++){var R=m[n].start,w=m[n].end;if(D+b>=R&&D<w)o=R,a=w,r=a-D;else if(D+b<R){u=R;break}}return{len:r,start:o||0,end:a||0,nextStart:u}},H.getBuffered=function(k){try{return k.buffered}catch(D){return K.logger.log("failed to get media.buffered",D),A}},H}()},"./src/utils/cea-608-parser.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"Row",function(){return a}),N.d(Y,"CaptionScreen",function(){return n});var K=N("./src/utils/logger.ts"),A={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},M=function(y){var h=y;return A.hasOwnProperty(y)&&(h=A[y]),String.fromCharCode(h)},H=15,P=100,k={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},D={17:2,18:4,21:6,22:8,23:10,19:13,20:15},b={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},f=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],d;(function(_){_[_.ERROR=0]="ERROR",_[_.TEXT=1]="TEXT",_[_.WARNING=2]="WARNING",_[_.INFO=2]="INFO",_[_.DEBUG=3]="DEBUG",_[_.DATA=3]="DATA"})(d||(d={}));var s=function(){function _(){this.time=null,this.verboseLevel=d.ERROR}var y=_.prototype;return y.log=function(c,v){this.verboseLevel>=c&&K.logger.log(this.time+" ["+c+"] "+v)},_}(),r=function(y){for(var h=[],c=0;c<y.length;c++)h.push(y[c].toString(16));return h},u=function(){function _(h,c,v,p,E){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=h||"white",this.underline=c||!1,this.italics=v||!1,this.background=p||"black",this.flash=E||!1}var y=_.prototype;return y.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},y.setStyles=function(c){for(var v=["foreground","underline","italics","background","flash"],p=0;p<v.length;p++){var E=v[p];c.hasOwnProperty(E)&&(this[E]=c[E])}},y.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},y.equals=function(c){return this.foreground===c.foreground&&this.underline===c.underline&&this.italics===c.italics&&this.background===c.background&&this.flash===c.flash},y.copy=function(c){this.foreground=c.foreground,this.underline=c.underline,this.italics=c.italics,this.background=c.background,this.flash=c.flash},y.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},_}(),o=function(){function _(h,c,v,p,E,U){this.uchar=void 0,this.penState=void 0,this.uchar=h||" ",this.penState=new u(c,v,p,E,U)}var y=_.prototype;return y.reset=function(){this.uchar=" ",this.penState.reset()},y.setChar=function(c,v){this.uchar=c,this.penState.copy(v)},y.setPenState=function(c){this.penState.copy(c)},y.equals=function(c){return this.uchar===c.uchar&&this.penState.equals(c.penState)},y.copy=function(c){this.uchar=c.uchar,this.penState.copy(c.penState)},y.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},_}(),a=function(){function _(h){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var c=0;c<P;c++)this.chars.push(new o);this.logger=h,this.pos=0,this.currPenState=new u}var y=_.prototype;return y.equals=function(c){for(var v=!0,p=0;p<P;p++)if(!this.chars[p].equals(c.chars[p])){v=!1;break}return v},y.copy=function(c){for(var v=0;v<P;v++)this.chars[v].copy(c.chars[v])},y.isEmpty=function(){for(var c=!0,v=0;v<P;v++)if(!this.chars[v].isEmpty()){c=!1;break}return c},y.setCursor=function(c){this.pos!==c&&(this.pos=c),this.pos<0?(this.logger.log(d.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>P&&(this.logger.log(d.DEBUG,"Too large cursor position "+this.pos),this.pos=P)},y.moveCursor=function(c){var v=this.pos+c;if(c>1)for(var p=this.pos+1;p<v+1;p++)this.chars[p].setPenState(this.currPenState);this.setCursor(v)},y.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},y.insertChar=function(c){c>=144&&this.backSpace();var v=M(c);if(this.pos>=P){this.logger.log(d.ERROR,"Cannot insert "+c.toString(16)+" ("+v+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(v,this.currPenState),this.moveCursor(1)},y.clearFromPos=function(c){var v;for(v=c;v<P;v++)this.chars[v].reset()},y.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},y.clearToEndOfRow=function(){this.clearFromPos(this.pos)},y.getTextString=function(){for(var c=[],v=!0,p=0;p<P;p++){var E=this.chars[p].uchar;E!==" "&&(v=!1),c.push(E)}return v?"":c.join("")},y.setPenStyles=function(c){this.currPenState.setStyles(c);var v=this.chars[this.pos];v.setPenState(this.currPenState)},_}(),n=function(){function _(h){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var c=0;c<H;c++)this.rows.push(new a(h));this.logger=h,this.currRow=H-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var y=_.prototype;return y.reset=function(){for(var c=0;c<H;c++)this.rows[c].clear();this.currRow=H-1},y.equals=function(c){for(var v=!0,p=0;p<H;p++)if(!this.rows[p].equals(c.rows[p])){v=!1;break}return v},y.copy=function(c){for(var v=0;v<H;v++)this.rows[v].copy(c.rows[v])},y.isEmpty=function(){for(var c=!0,v=0;v<H;v++)if(!this.rows[v].isEmpty()){c=!1;break}return c},y.backSpace=function(){var c=this.rows[this.currRow];c.backSpace()},y.clearToEndOfRow=function(){var c=this.rows[this.currRow];c.clearToEndOfRow()},y.insertChar=function(c){var v=this.rows[this.currRow];v.insertChar(c)},y.setPen=function(c){var v=this.rows[this.currRow];v.setPenStyles(c)},y.moveCursor=function(c){var v=this.rows[this.currRow];v.moveCursor(c)},y.setCursor=function(c){this.logger.log(d.INFO,"setCursor: "+c);var v=this.rows[this.currRow];v.setCursor(c)},y.setPAC=function(c){this.logger.log(d.INFO,"pacData = "+JSON.stringify(c));var v=c.row-1;if(this.nrRollUpRows&&v<this.nrRollUpRows-1&&(v=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==v){for(var p=0;p<H;p++)this.rows[p].clear();var E=this.currRow+1-this.nrRollUpRows,U=this.lastOutputScreen;if(U){var F=U.rows[E].cueStartTime,z=this.logger.time;if(F&&z!==null&&F<z)for(var G=0;G<this.nrRollUpRows;G++)this.rows[v-this.nrRollUpRows+G+1].copy(U.rows[E+G])}}this.currRow=v;var B=this.rows[this.currRow];if(c.indent!==null){var T=c.indent,V=Math.max(T-1,0);B.setCursor(c.indent),c.color=B.chars[V].penState.foreground}var Z={foreground:c.color,underline:c.underline,italics:c.italics,background:"black",flash:!1};this.setPen(Z)},y.setBkgData=function(c){this.logger.log(d.INFO,"bkgData = "+JSON.stringify(c)),this.backSpace(),this.setPen(c),this.insertChar(32)},y.setRollUpRows=function(c){this.nrRollUpRows=c},y.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(d.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(d.TEXT,this.getDisplayText());var c=this.currRow+1-this.nrRollUpRows,v=this.rows.splice(c,1)[0];v.clear(),this.rows.splice(this.currRow,0,v),this.logger.log(d.INFO,"Rolling up")},y.getDisplayText=function(c){c=c||!1;for(var v=[],p="",E=-1,U=0;U<H;U++){var F=this.rows[U].getTextString();F&&(E=U+1,c?v.push("Row "+E+": '"+F+"'"):v.push(F.trim()))}return v.length>0&&(c?p="["+v.join(" | ")+"]":p=v.join(`
|
|
`)),p},y.getTextAndFormat=function(){return this.rows},_}(),R=function(){function _(h,c,v){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=h,this.outputFilter=c,this.mode=null,this.verbose=0,this.displayedMemory=new n(v),this.nonDisplayedMemory=new n(v),this.lastOutputScreen=new n(v),this.currRollUpRow=this.displayedMemory.rows[H-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=v}var y=_.prototype;return y.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},y.getHandler=function(){return this.outputFilter},y.setHandler=function(c){this.outputFilter=c},y.setPAC=function(c){this.writeScreen.setPAC(c)},y.setBkgData=function(c){this.writeScreen.setBkgData(c)},y.setMode=function(c){if(c===this.mode)return;this.mode=c,this.logger.log(d.INFO,"MODE="+c),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=c},y.insertChars=function(c){for(var v=0;v<c.length;v++)this.writeScreen.insertChar(c[v]);var p=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(d.INFO,p+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(d.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},y.ccRCL=function(){this.logger.log(d.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},y.ccBS=function(){if(this.logger.log(d.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},y.ccAOF=function(){},y.ccAON=function(){},y.ccDER=function(){this.logger.log(d.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},y.ccRU=function(c){this.logger.log(d.INFO,"RU("+c+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(c)},y.ccFON=function(){this.logger.log(d.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},y.ccRDC=function(){this.logger.log(d.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},y.ccTR=function(){this.logger.log(d.INFO,"TR"),this.setMode("MODE_TEXT")},y.ccRTD=function(){this.logger.log(d.INFO,"RTD"),this.setMode("MODE_TEXT")},y.ccEDM=function(){this.logger.log(d.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},y.ccCR=function(){this.logger.log(d.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},y.ccENM=function(){this.logger.log(d.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},y.ccEOC=function(){if(this.logger.log(d.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var c=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=c,this.writeScreen=this.nonDisplayedMemory,this.logger.log(d.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},y.ccTO=function(c){this.logger.log(d.INFO,"TO("+c+") - Tab Offset"),this.writeScreen.moveCursor(c)},y.ccMIDROW=function(c){var v={flash:!1};if(v.underline=c%2===1,v.italics=c>=46,v.italics)v.foreground="white";else{var p=Math.floor(c/2)-16,E=["white","green","blue","cyan","red","yellow","magenta"];v.foreground=E[p]}this.logger.log(d.INFO,"MIDROW: "+JSON.stringify(v)),this.writeScreen.setPen(v)},y.outputDataUpdate=function(c){c===void 0&&(c=!1);var v=this.logger.time;if(v===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=v:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,v,this.lastOutputScreen),c&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:v),this.lastOutputScreen.copy(this.displayedMemory))},y.cueSplitAtTime=function(c){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,c,this.displayedMemory),this.cueStartTime=c))},_}(),w=function(){function _(h,c,v){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var p=new s;this.channels=[null,new R(h,c,p),new R(h+1,v,p)],this.cmdHistory=C(),this.logger=p}var y=_.prototype;return y.getHandler=function(c){return this.channels[c].getHandler()},y.setHandler=function(c,v){this.channels[c].setHandler(v)},y.addData=function(c,v){var p,E,U,F=!1;this.logger.time=c;for(var z=0;z<v.length;z+=2){if(E=v[z]&127,U=v[z+1]&127,E===0&&U===0)continue;if(this.logger.log(d.DATA,"["+r([v[z],v[z+1]])+"] -> ("+r([E,U])+")"),p=this.parseCmd(E,U),p||(p=this.parseMidrow(E,U)),p||(p=this.parsePAC(E,U)),p||(p=this.parseBackgroundAttributes(E,U)),!p&&(F=this.parseChars(E,U),F)){var G=this.currentChannel;if(G&&G>0){var B=this.channels[G];B.insertChars(F)}else this.logger.log(d.WARNING,"No channel found yet. TEXT-MODE?")}!p&&!F&&this.logger.log(d.WARNING,"Couldn't parse cleaned data "+r([E,U])+" orig: "+r([v[z],v[z+1]]))}},y.parseCmd=function(c,v){var p=this.cmdHistory,E=(c===20||c===28||c===21||c===29)&&v>=32&&v<=47,U=(c===23||c===31)&&v>=33&&v<=35;if(!(E||U))return!1;if(O(c,v,p))return x(null,null,p),this.logger.log(d.DEBUG,"Repeated command ("+r([c,v])+") is dropped"),!0;var F=c===20||c===21||c===23?1:2,z=this.channels[F];return c===20||c===21||c===28||c===29?v===32?z.ccRCL():v===33?z.ccBS():v===34?z.ccAOF():v===35?z.ccAON():v===36?z.ccDER():v===37?z.ccRU(2):v===38?z.ccRU(3):v===39?z.ccRU(4):v===40?z.ccFON():v===41?z.ccRDC():v===42?z.ccTR():v===43?z.ccRTD():v===44?z.ccEDM():v===45?z.ccCR():v===46?z.ccENM():v===47&&z.ccEOC():z.ccTO(v-32),x(c,v,p),this.currentChannel=F,!0},y.parseMidrow=function(c,v){var p=0;if((c===17||c===25)&&v>=32&&v<=47){if(c===17?p=1:p=2,p!==this.currentChannel)return this.logger.log(d.ERROR,"Mismatch channel in midrow parsing"),!1;var E=this.channels[p];return E?(E.ccMIDROW(v),this.logger.log(d.DEBUG,"MIDROW ("+r([c,v])+")"),!0):!1}return!1},y.parsePAC=function(c,v){var p,E=this.cmdHistory,U=(c>=17&&c<=23||c>=25&&c<=31)&&v>=64&&v<=127,F=(c===16||c===24)&&v>=64&&v<=95;if(!(U||F))return!1;if(O(c,v,E))return x(null,null,E),!0;var z=c<=23?1:2;v>=64&&v<=95?p=z===1?k[c]:b[c]:p=z===1?D[c]:m[c];var G=this.channels[z];return G?(G.setPAC(this.interpretPAC(p,v)),x(c,v,E),this.currentChannel=z,!0):!1},y.interpretPAC=function(c,v){var p,E={color:null,italics:!1,indent:null,underline:!1,row:c};return v>95?p=v-96:p=v-64,E.underline=(p&1)===1,p<=13?E.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(p/2)]:p<=15?(E.italics=!0,E.color="white"):E.indent=Math.floor((p-16)/2)*4,E},y.parseChars=function(c,v){var p,E=null,U=null;if(c>=25?(p=2,U=c-8):(p=1,U=c),U>=17&&U<=19){var F;U===17?F=v+80:U===18?F=v+112:F=v+144,this.logger.log(d.INFO,"Special char '"+M(F)+"' in channel "+p),E=[F]}else c>=32&&c<=127&&(E=v===0?[c]:[c,v]);if(E){var z=r(E);this.logger.log(d.DEBUG,"Char codes = "+z.join(",")),x(c,v,this.cmdHistory)}return E},y.parseBackgroundAttributes=function(c,v){var p=(c===16||c===24)&&v>=32&&v<=47,E=(c===23||c===31)&&v>=45&&v<=47;if(!(p||E))return!1;var U,F={};c===16||c===24?(U=Math.floor((v-32)/2),F.background=f[U],v%2===1&&(F.background=F.background+"_semi")):v===45?F.background="transparent":(F.foreground="black",v===47&&(F.underline=!0));var z=c<=23?1:2,G=this.channels[z];return G.setBkgData(F),x(c,v,this.cmdHistory),!0},y.reset=function(){for(var c=0;c<Object.keys(this.channels).length;c++){var v=this.channels[c];v&&v.reset()}this.cmdHistory=C()},y.cueSplitAtTime=function(c){for(var v=0;v<this.channels.length;v++){var p=this.channels[v];p&&p.cueSplitAtTime(c)}},_}();function x(_,y,h){h.a=_,h.b=y}function O(_,y,h){return h.a===_&&h.b===y}function C(){return{a:null,b:null}}Y.default=w},"./src/utils/codecs.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"isCodecType",function(){return A}),N.d(Y,"isCodecSupportedInMp4",function(){return M});var K={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 A(H,P){var k=K[P];return!!k&&k[H.slice(0,4)]===!0}function M(H,P){return MediaSource.isTypeSupported((P||"video")+'/mp4;codecs="'+H+'"')}},"./src/utils/cues.ts":function(te,Y,N){"use strict";N.r(Y);var K=N("./src/utils/vttparser.ts"),A=N("./src/utils/webvtt-parser.ts"),M=N("./src/utils/texttrack-utils.ts"),H=/\s/,P={newCue:function(D,b,m,f){for(var d=[],s,r,u,o,a,n=self.VTTCue||self.TextTrackCue,R=0;R<f.rows.length;R++)if(s=f.rows[R],u=!0,o=0,a="",!s.isEmpty()){for(var w=0;w<s.chars.length;w++)H.test(s.chars[w].uchar)&&u?o++:(a+=s.chars[w].uchar,u=!1);s.cueStartTime=b,b===m&&(m+=1e-4),o>=16?o--:o++;var x=Object(K.fixLineBreaks)(a.trim()),O=Object(A.generateCueId)(b,m,x);(!D||!D.cues||!D.cues.getCueById(O))&&(r=new n(b,m,x),r.id=O,r.line=R+1,r.align="left",r.position=10+Math.min(80,Math.floor(o*8/32)*10),d.push(r))}return D&&d.length&&(d.sort(function(C,_){return C.line==="auto"||_.line==="auto"?0:C.line>8&&_.line>8?_.line-C.line:C.line-_.line}),d.forEach(function(C){return Object(M.addCueToTrack)(D,C)})),d}};Y.default=P},"./src/utils/discontinuities.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"findFirstFragWithCC",function(){return H}),N.d(Y,"shouldAlignOnDiscontinuities",function(){return P}),N.d(Y,"findDiscontinuousReferenceFrag",function(){return k}),N.d(Y,"adjustSlidingStart",function(){return b}),N.d(Y,"alignStream",function(){return m}),N.d(Y,"alignPDT",function(){return d}),N.d(Y,"alignFragmentByPDTDelta",function(){return s}),N.d(Y,"alignMediaPlaylistByPDT",function(){return r});var K=N("./src/polyfills/number.ts"),A=N("./src/utils/logger.ts"),M=N("./src/controller/level-helper.ts");function H(u,o){for(var a=null,n=0,R=u.length;n<R;n++){var w=u[n];if(w&&w.cc===o){a=w;break}}return a}function P(u,o,a){return!!(o.details&&(a.endCC>a.startCC||u&&u.cc<a.startCC))}function k(u,o){var a=u.fragments,n=o.fragments;if(!n.length||!a.length){A.logger.log("No fragments to align");return}var R=H(a,n[0].cc);if(!R||R&&!R.startPTS){A.logger.log("No frag in previous level to align on");return}return R}function D(u,o){if(u){var a=u.start+o;u.start=u.startPTS=a,u.endPTS=a+u.duration}}function b(u,o){for(var a=o.fragments,n=0,R=a.length;n<R;n++)D(a[n],u);o.fragmentHint&&D(o.fragmentHint,u),o.alignedSliding=!0}function m(u,o,a){if(!o)return;f(u,a,o),!a.alignedSliding&&o.details&&d(a,o.details),!a.alignedSliding&&o.details&&!a.skippedSegments&&Object(M.adjustSliding)(o.details,a)}function f(u,o,a){if(P(u,a,o)){var n=k(a.details,o);n&&Object(K.isFiniteNumber)(n.start)&&(A.logger.log("Adjusting PTS using last level due to CC increase within current level "+o.url),b(n.start,o))}}function d(u,o){if(!o.fragments.length||!u.hasProgramDateTime||!o.hasProgramDateTime)return;var a=o.fragments[0].programDateTime,n=u.fragments[0].programDateTime,R=(n-a)/1e3+o.fragments[0].start;R&&Object(K.isFiniteNumber)(R)&&(A.logger.log("Adjusting PTS using programDateTime delta "+(n-a)+"ms, sliding:"+R.toFixed(3)+" "+u.url+" "),b(R,u))}function s(u,o){var a=u.programDateTime;if(!a)return;var n=(a-o)/1e3;u.start=u.startPTS=n,u.endPTS=n+u.duration}function r(u,o){if(!o.fragments.length||!u.hasProgramDateTime||!o.hasProgramDateTime)return;var a=o.fragments[0].programDateTime,n=o.fragments[0].start,R=a-n*1e3;u.fragments.forEach(function(w){s(w,R)}),u.fragmentHint&&s(u.fragmentHint,R),u.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(te,Y,N){"use strict";N.r(Y);var K=N("./src/utils/ewma.ts"),A=function(){function M(P,k,D){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=D,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new K.default(P),this.fast_=new K.default(k)}var H=M.prototype;return H.update=function(k,D){var b=this.slow_,m=this.fast_;this.slow_.halfLife!==k&&(this.slow_=new K.default(k,b.getEstimate(),b.getTotalWeight())),this.fast_.halfLife!==D&&(this.fast_=new K.default(D,m.getEstimate(),m.getTotalWeight()))},H.sample=function(k,D){k=Math.max(k,this.minDelayMs_);var b=8*D,m=k/1e3,f=b/m;this.fast_.sample(m,f),this.slow_.sample(m,f)},H.canEstimate=function(){var k=this.fast_;return k&&k.getTotalWeight()>=this.minWeight_},H.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},H.destroy=function(){},M}();Y.default=A},"./src/utils/ewma.ts":function(te,Y,N){"use strict";N.r(Y);var K=function(){function A(H,P,k){P===void 0&&(P=0),k===void 0&&(k=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_=P,this.totalWeight_=k}var M=A.prototype;return M.sample=function(P,k){var D=Math.pow(this.alpha_,P);this.estimate_=k*(1-D)+D*this.estimate_,this.totalWeight_+=P},M.getTotalWeight=function(){return this.totalWeight_},M.getEstimate=function(){if(this.alpha_){var P=1-Math.pow(this.alpha_,this.totalWeight_);if(P)return this.estimate_/P}return this.estimate_},A}();Y.default=K},"./src/utils/fetch-loader.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"fetchSupported",function(){return s});var K=N("./src/polyfills/number.ts"),A=N("./src/loader/load-stats.ts"),M=N("./src/demux/chunk-cache.ts");function H(n,R){n.prototype=Object.create(R.prototype),n.prototype.constructor=n,m(n,R)}function P(n){var R=typeof Map=="function"?new Map:void 0;return P=function(x){if(x===null||!b(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof R!="undefined"){if(R.has(x))return R.get(x);R.set(x,O)}function O(){return k(x,arguments,f(this).constructor)}return O.prototype=Object.create(x.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),m(O,x)},P(n)}function k(n,R,w){return D()?k=Reflect.construct:k=function(O,C,_){var y=[null];y.push.apply(y,C);var h=Function.bind.apply(O,y),c=new h;return _&&m(c,_.prototype),c},k.apply(null,arguments)}function D(){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(n){return!1}}function b(n){return Function.toString.call(n).indexOf("[native code]")!==-1}function m(n,R){return m=Object.setPrototypeOf||function(x,O){return x.__proto__=O,x},m(n,R)}function f(n){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(w){return w.__proto__||Object.getPrototypeOf(w)},f(n)}function d(){return d=Object.assign||function(n){for(var R=1;R<arguments.length;R++){var w=arguments[R];for(var x in w)Object.prototype.hasOwnProperty.call(w,x)&&(n[x]=w[x])}return n},d.apply(this,arguments)}function s(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(n){}return!1}var r=function(){function n(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||o,this.controller=new self.AbortController,this.stats=new A.LoadStats}var R=n.prototype;return R.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},R.abortInternal=function(){var x=this.response;(!x||!x.ok)&&(this.stats.aborted=!0,this.controller.abort())},R.abort=function(){var x;this.abortInternal(),(x=this.callbacks)!==null&&x!==void 0&&x.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},R.load=function(x,O,C){var _=this,y=this.stats;if(y.loading.start)throw new Error("Loader can only be used once.");y.loading.start=self.performance.now();var h=u(x,this.controller.signal),c=C.onProgress,v=x.responseType==="arraybuffer",p=v?"byteLength":"length";this.context=x,this.config=O,this.callbacks=C,this.request=this.fetchSetup(x,h),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){_.abortInternal(),C.onTimeout(y,x,_.response)},O.timeout),self.fetch(this.request).then(function(E){if(_.response=_.loader=E,!E.ok){var U=E.status,F=E.statusText;throw new a(F||"fetch, bad network response",U,E)}return y.loading.first=Math.max(self.performance.now(),y.loading.start),y.total=parseInt(E.headers.get("Content-Length")||"0"),c&&Object(K.isFiniteNumber)(O.highWaterMark)?_.loadProgressively(E,y,x,O.highWaterMark,c):v?E.arrayBuffer():E.text()}).then(function(E){var U=_.response;self.clearTimeout(_.requestTimeout),y.loading.end=Math.max(self.performance.now(),y.loading.first),y.loaded=y.total=E[p];var F={url:U.url,data:E};c&&!Object(K.isFiniteNumber)(O.highWaterMark)&&c(y,x,E,U),C.onSuccess(F,y,x,U)}).catch(function(E){if(self.clearTimeout(_.requestTimeout),y.aborted)return;var U=E.code||0;C.onError({code:U,text:E.message},x,E.details)})},R.getCacheAge=function(){var x=null;if(this.response){var O=this.response.headers.get("age");x=O?parseFloat(O):null}return x},R.loadProgressively=function(x,O,C,_,y){_===void 0&&(_=0);var h=new M.default,c=x.body.getReader(),v=function p(){return c.read().then(function(E){if(E.done)return h.dataLength&&y(O,C,h.flush(),x),Promise.resolve(new ArrayBuffer(0));var U=E.value,F=U.length;return O.loaded+=F,F<_||h.dataLength?(h.push(U),h.dataLength>=_&&y(O,C,h.flush(),x)):y(O,C,U,x),p()}).catch(function(){return Promise.reject()})};return v()},n}();function u(n,R){var w={method:"GET",mode:"cors",credentials:"same-origin",signal:R,headers:new self.Headers(d({},n.headers))};return n.rangeEnd&&w.headers.set("Range","bytes="+n.rangeStart+"-"+String(n.rangeEnd-1)),w}function o(n,R){return new self.Request(n.url,R)}var a=function(n){H(R,n);function R(w,x,O){var C;return C=n.call(this,w)||this,C.code=void 0,C.details=void 0,C.code=x,C.details=O,C}return R}(P(Error));Y.default=r},"./src/utils/imsc1-ttml-parser.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"IMSC1_CODEC",function(){return b}),N.d(Y,"parseIMSC1",function(){return s});var K=N("./src/utils/mp4-tools.ts"),A=N("./src/utils/vttparser.ts"),M=N("./src/utils/vttcue.ts"),H=N("./src/demux/id3.ts"),P=N("./src/utils/timescale-conversion.ts"),k=N("./src/utils/webvtt-parser.ts");function D(){return D=Object.assign||function(_){for(var y=1;y<arguments.length;y++){var h=arguments[y];for(var c in h)Object.prototype.hasOwnProperty.call(h,c)&&(_[c]=h[c])}return _},D.apply(this,arguments)}var b="stpp.ttml.im1t",m=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,f=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,d={left:"start",center:"center",right:"end",start:"start",end:"end"};function s(_,y,h,c,v){var p=Object(K.findBox)(new Uint8Array(_),["mdat"]);if(p.length===0){v(new Error("Could not parse IMSC1 mdat"));return}var E=p[0],U=Object(H.utf8ArrayToStr)(new Uint8Array(_,E.start,E.end-E.start)),F=Object(P.toTimescaleFromScale)(y,1,h);try{c(r(U,F))}catch(z){v(z)}}function r(_,y){var h=new DOMParser,c=h.parseFromString(_,"text/xml"),v=c.getElementsByTagName("tt")[0];if(!v)throw new Error("Invalid ttml");var p={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},E=Object.keys(p).reduce(function(B,T){return B[T]=v.getAttribute("ttp:"+T)||p[T],B},{}),U=v.getAttribute("xml:space")!=="preserve",F=o(u(v,"styling","style")),z=o(u(v,"layout","region")),G=u(v,"body","[begin]");return[].map.call(G,function(B){var T=a(B,U);if(!T||!B.hasAttribute("begin"))return null;var V=x(B.getAttribute("begin"),E),Z=x(B.getAttribute("dur"),E),oe=x(B.getAttribute("end"),E);if(V===null)throw w(B);if(oe===null){if(Z===null)throw w(B);oe=V+Z}var pe=new M.default(V-y,oe-y,T);pe.id=Object(k.generateCueId)(pe.startTime,pe.endTime,pe.text);var Ye=z[B.getAttribute("region")],xe=F[B.getAttribute("style")];pe.position=10,pe.size=80;var Ie=n(Ye,xe),Je=Ie.textAlign;if(Je){var Ke=d[Je];Ke&&(pe.lineAlign=Ke),pe.align=Je}return D(pe,Ie),pe}).filter(function(B){return B!==null})}function u(_,y,h){var c=_.getElementsByTagName(y)[0];return c?[].slice.call(c.querySelectorAll(h)):[]}function o(_){return _.reduce(function(y,h){var c=h.getAttribute("xml:id");return c&&(y[c]=h),y},{})}function a(_,y){return[].slice.call(_.childNodes).reduce(function(h,c,v){var p;return c.nodeName==="br"&&v?h+`
|
|
`:(p=c.childNodes)!==null&&p!==void 0&&p.length?a(c,y):y?h+c.textContent.trim().replace(/\s+/g," "):h+c.textContent},"")}function n(_,y){var h="http://www.w3.org/ns/ttml#styling",c=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return c.reduce(function(v,p){var E=R(y,h,p)||R(_,h,p);return E&&(v[p]=E),v},{})}function R(_,y,h){return _.hasAttributeNS(y,h)?_.getAttributeNS(y,h):null}function w(_){return new Error("Could not parse ttml timestamp "+_)}function x(_,y){if(!_)return null;var h=Object(A.parseTimeStamp)(_);return h===null&&(m.test(_)?h=O(_,y):f.test(_)&&(h=C(_,y))),h}function O(_,y){var h=m.exec(_),c=(h[4]|0)+(h[5]|0)/y.subFrameRate;return(h[1]|0)*3600+(h[2]|0)*60+(h[3]|0)+c/y.frameRate}function C(_,y){var h=f.exec(_),c=Number(h[1]),v=h[2];switch(v){case"h":return c*3600;case"m":return c*60;case"ms":return c*1e3;case"f":return c/y.frameRate;case"t":return c/y.tickRate}return c}},"./src/utils/logger.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"enableLogs",function(){return k}),N.d(Y,"logger",function(){return D});var K=function(){},A={trace:K,debug:K,log:K,warn:K,info:K,error:K},M=A;function H(b){var m=self.console[b];return m?m.bind(self.console,"["+b+"] >"):K}function P(b){for(var m=arguments.length,f=new Array(m>1?m-1:0),d=1;d<m;d++)f[d-1]=arguments[d];f.forEach(function(s){M[s]=b[s]?b[s].bind(b):H(s)})}function k(b){if(self.console&&b===!0||typeof b=="object"){P(b,"debug","log","info","warn","error");try{M.log()}catch(m){M=A}}else M=A}var D=M},"./src/utils/mediakeys-helper.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"KeySystems",function(){return K}),N.d(Y,"requestMediaKeySystemAccess",function(){return A});var K;(function(M){M.WIDEVINE="com.widevine.alpha",M.PLAYREADY="com.microsoft.playready"})(K||(K={}));var A=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"getMediaSource",function(){return K});function K(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"bin2str",function(){return P}),N.d(Y,"readUint16",function(){return k}),N.d(Y,"readUint32",function(){return D}),N.d(Y,"writeUint32",function(){return b}),N.d(Y,"findBox",function(){return m}),N.d(Y,"parseSegmentIndex",function(){return f}),N.d(Y,"parseInitSegment",function(){return d}),N.d(Y,"getStartDTS",function(){return s}),N.d(Y,"getDuration",function(){return r}),N.d(Y,"computeRawDurationFromSamples",function(){return u}),N.d(Y,"offsetStartDTS",function(){return o}),N.d(Y,"segmentValidRange",function(){return a}),N.d(Y,"appendUint8Array",function(){return n});var K=N("./src/utils/typed-array.ts"),A=N("./src/loader/fragment.ts"),M=Math.pow(2,32)-1,H=[].push;function P(R){return String.fromCharCode.apply(null,R)}function k(R,w){"data"in R&&(w+=R.start,R=R.data);var x=R[w]<<8|R[w+1];return x<0?65536+x:x}function D(R,w){"data"in R&&(w+=R.start,R=R.data);var x=R[w]<<24|R[w+1]<<16|R[w+2]<<8|R[w+3];return x<0?4294967296+x:x}function b(R,w,x){"data"in R&&(w+=R.start,R=R.data),R[w]=x>>24,R[w+1]=x>>16&255,R[w+2]=x>>8&255,R[w+3]=x&255}function m(R,w){var x=[];if(!w.length)return x;var O,C,_;"data"in R?(O=R.data,C=R.start,_=R.end):(O=R,C=0,_=O.byteLength);for(var y=C;y<_;){var h=D(O,y),c=P(O.subarray(y+4,y+8)),v=h>1?y+h:_;if(c===w[0])if(w.length===1)x.push({data:O,start:y+8,end:v});else{var p=m({data:O,start:y+8,end:v},w.slice(1));p.length&&H.apply(x,p)}y=v}return x}function f(R){var w=m(R,["moov"]),x=w[0],O=x?x.end:null,C=m(R,["sidx"]);if(!C||!C[0])return null;var _=[],y=C[0],h=y.data[0],c=h===0?8:16,v=D(y,c);c+=4;var p=0,E=0;h===0?c+=8:c+=16,c+=2;var U=y.end+E,F=k(y,c);c+=2;for(var z=0;z<F;z++){var G=c,B=D(y,G);G+=4;var T=B&2147483647,V=(B&2147483648)>>>31;if(V===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Z=D(y,G);G+=4,_.push({referenceSize:T,subsegmentDuration:Z,info:{duration:Z/v,start:U,end:U+T-1}}),U+=T,G+=4,c=G}return{earliestPresentationTime:p,timescale:v,version:h,referencesCount:F,references:_,moovEndOffset:O}}function d(R){for(var w=[],x=m(R,["moov","trak"]),O=0;O<x.length;O++){var C=x[O],_=m(C,["tkhd"])[0];if(_){var y=_.data[_.start],h=y===0?12:20,c=D(_,h),v=m(C,["mdia","mdhd"])[0];if(v){y=v.data[v.start],h=y===0?12:20;var p=D(v,h),E=m(C,["mdia","hdlr"])[0];if(E){var U=P(E.data.subarray(E.start+8,E.start+12)),F={soun:A.ElementaryStreamTypes.AUDIO,vide:A.ElementaryStreamTypes.VIDEO}[U];if(F){var z=m(C,["mdia","minf","stbl","stsd"])[0],G=void 0;z&&(G=P(z.data.subarray(z.start+12,z.start+16))),w[c]={timescale:p,type:F},w[F]={timescale:p,id:c,codec:G}}}}}}var B=m(R,["moov","mvex","trex"]);return B.forEach(function(T){var V=D(T,4),Z=w[V];Z&&(Z.default={duration:D(T,12),flags:D(T,20)})}),w}function s(R,w){return m(w,["moof","traf"]).reduce(function(x,O){var C=m(O,["tfdt"])[0],_=C.data[C.start],y=m(O,["tfhd"]).reduce(function(h,c){var v=D(c,4),p=R[v];if(p){var E=D(C,4);_===1&&(E*=Math.pow(2,32),E+=D(C,8));var U=p.timescale||9e4,F=E/U;if(isFinite(F)&&(h===null||F<h))return F}return h},null);return y!==null&&isFinite(y)&&(x===null||y<x)?y:x},null)||0}function r(R,w){for(var x=0,O=0,C=0,_=m(R,["moof","traf"]),y=0;y<_.length;y++){var h=_[y],c=m(h,["tfhd"])[0],v=D(c,4),p=w[v];if(!p)continue;var E=p.default,U=D(c,0)|(E==null?void 0:E.flags),F=E==null?void 0:E.duration;U&8&&(U&2?F=D(c,12):F=D(c,8));for(var z=p.timescale||9e4,G=m(h,["trun"]),B=0;B<G.length;B++){if(F){var T=D(G[B],4);x=F*T}else x=u(G[B]);p.type===A.ElementaryStreamTypes.VIDEO?O+=x/z:p.type===A.ElementaryStreamTypes.AUDIO&&(C+=x/z)}}if(O===0&&C===0){var V=f(R);if(V!=null&&V.references)return V.references.reduce(function(Z,oe){return Z+oe.info.duration||0},0)}return O||C}function u(R){var w=D(R,0),x=8;w&1&&(x+=4),w&4&&(x+=4);for(var O=0,C=D(R,4),_=0;_<C;_++){if(w&256){var y=D(R,x);O+=y,x+=4}w&512&&(x+=4),w&1024&&(x+=4),w&2048&&(x+=4)}return O}function o(R,w,x){m(w,["moof","traf"]).forEach(function(O){m(O,["tfhd"]).forEach(function(C){var _=D(C,4),y=R[_];if(!y)return;var h=y.timescale||9e4;m(O,["tfdt"]).forEach(function(c){var v=c.data[c.start],p=D(c,4);if(v===0)b(c,4,p-x*h);else{p*=Math.pow(2,32),p+=D(c,8),p-=x*h,p=Math.max(p,0);var E=Math.floor(p/(M+1)),U=Math.floor(p%(M+1));b(c,4,E),b(c,8,U)}})})})}function a(R){var w={valid:null,remainder:null},x=m(R,["moof"]);if(x){if(x.length<2)return w.remainder=R,w}else return w;var O=x[x.length-1];return w.valid=Object(K.sliceUint8)(R,0,O.start-8),w.remainder=Object(K.sliceUint8)(R,O.start-8),w}function n(R,w){var x=new Uint8Array(R.length+w.length);return x.set(R),x.set(w,R.length),x}},"./src/utils/output-filter.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return K});var K=function(){function A(H,P){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=H,this.trackName=P}var M=A.prototype;return M.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},M.newCue=function(P,k,D){(this.startTime===null||this.startTime>P)&&(this.startTime=P),this.endTime=k,this.screen=D,this.timelineController.createCaptionsTrack(this.trackName)},M.reset=function(){this.cueRanges=[]},A}()},"./src/utils/texttrack-utils.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"sendAddTrackEvent",function(){return A}),N.d(Y,"addCueToTrack",function(){return M}),N.d(Y,"clearCurrentCues",function(){return H}),N.d(Y,"removeCuesInRange",function(){return P}),N.d(Y,"getCuesInRange",function(){return D});var K=N("./src/utils/logger.ts");function A(b,m){var f;try{f=new Event("addtrack")}catch(d){f=document.createEvent("Event"),f.initEvent("addtrack",!1,!1)}f.track=b,m.dispatchEvent(f)}function M(b,m){var f=b.mode;if(f==="disabled"&&(b.mode="hidden"),b.cues&&!b.cues.getCueById(m.id))try{if(b.addCue(m),!b.cues.getCueById(m.id))throw new Error("addCue is failed for: "+m)}catch(s){K.logger.debug("[texttrack-utils]: "+s);var d=new self.TextTrackCue(m.startTime,m.endTime,m.text);d.id=m.id,b.addCue(d)}f==="disabled"&&(b.mode=f)}function H(b){var m=b.mode;if(m==="disabled"&&(b.mode="hidden"),b.cues)for(var f=b.cues.length;f--;)b.removeCue(b.cues[f]);m==="disabled"&&(b.mode=m)}function P(b,m,f){var d=b.mode;if(d==="disabled"&&(b.mode="hidden"),b.cues&&b.cues.length>0)for(var s=D(b.cues,m,f),r=0;r<s.length;r++)b.removeCue(s[r]);d==="disabled"&&(b.mode=d)}function k(b,m){if(m<b[0].startTime)return 0;var f=b.length-1;if(m>b[f].endTime)return-1;for(var d=0,s=f;d<=s;){var r=Math.floor((s+d)/2);if(m<b[r].startTime)s=r-1;else if(m>b[r].startTime&&d<f)d=r+1;else return r}return b[d].startTime-m<m-b[s].startTime?d:s}function D(b,m,f){var d=[],s=k(b,m);if(s>-1)for(var r=s,u=b.length;r<u;r++){var o=b[r];if(o.startTime>=m&&o.endTime<=f)d.push(o);else if(o.startTime>f)return d}return d}},"./src/utils/time-ranges.ts":function(te,Y,N){"use strict";N.r(Y);var K={toString:function(M){for(var H="",P=M.length,k=0;k<P;k++)H+="["+M.start(k).toFixed(3)+","+M.end(k).toFixed(3)+"]";return H}};Y.default=K},"./src/utils/timescale-conversion.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"toTimescaleFromBase",function(){return A}),N.d(Y,"toTimescaleFromScale",function(){return M}),N.d(Y,"toMsFromMpegTsClock",function(){return H}),N.d(Y,"toMpegTsClockFromTimescale",function(){return P});var K=9e4;function A(k,D,b,m){b===void 0&&(b=1),m===void 0&&(m=!1);var f=k*D*b;return m?Math.round(f):f}function M(k,D,b,m){return b===void 0&&(b=1),m===void 0&&(m=!1),A(k,D,1/b,m)}function H(k,D){return D===void 0&&(D=!1),A(k,1e3,1/K,D)}function P(k,D){return D===void 0&&(D=1),A(k,K,1/D)}},"./src/utils/typed-array.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"sliceUint8",function(){return K});function K(A,M,H){return Uint8Array.prototype.slice?A.slice(M,H):new Uint8Array(Array.prototype.slice.call(A,M,H))}},"./src/utils/vttcue.ts":function(te,Y,N){"use strict";N.r(Y),Y.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var K=["","lr","rl"],A=["start","middle","end","left","right"];function M(b,m){if(typeof m!="string")return!1;if(!Array.isArray(b))return!1;var f=m.toLowerCase();return~b.indexOf(f)?f:!1}function H(b){return M(K,b)}function P(b){return M(A,b)}function k(b){for(var m=arguments.length,f=new Array(m>1?m-1:0),d=1;d<m;d++)f[d-1]=arguments[d];for(var s=1;s<arguments.length;s++){var r=arguments[s];for(var u in r)b[u]=r[u]}return b}function D(b,m,f){var d=this,s={enumerable:!0};d.hasBeenReset=!1;var r="",u=!1,o=b,a=m,n=f,R=null,w="",x=!0,O="auto",C="start",_=50,y="middle",h=50,c="middle";Object.defineProperty(d,"id",k({},s,{get:function(){return r},set:function(p){r=""+p}})),Object.defineProperty(d,"pauseOnExit",k({},s,{get:function(){return u},set:function(p){u=!!p}})),Object.defineProperty(d,"startTime",k({},s,{get:function(){return o},set:function(p){if(typeof p!="number")throw new TypeError("Start time must be set to a number.");o=p,this.hasBeenReset=!0}})),Object.defineProperty(d,"endTime",k({},s,{get:function(){return a},set:function(p){if(typeof p!="number")throw new TypeError("End time must be set to a number.");a=p,this.hasBeenReset=!0}})),Object.defineProperty(d,"text",k({},s,{get:function(){return n},set:function(p){n=""+p,this.hasBeenReset=!0}})),Object.defineProperty(d,"region",k({},s,{get:function(){return R},set:function(p){R=p,this.hasBeenReset=!0}})),Object.defineProperty(d,"vertical",k({},s,{get:function(){return w},set:function(p){var E=H(p);if(E===!1)throw new SyntaxError("An invalid or illegal string was specified.");w=E,this.hasBeenReset=!0}})),Object.defineProperty(d,"snapToLines",k({},s,{get:function(){return x},set:function(p){x=!!p,this.hasBeenReset=!0}})),Object.defineProperty(d,"line",k({},s,{get:function(){return O},set:function(p){if(typeof p!="number"&&p!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");O=p,this.hasBeenReset=!0}})),Object.defineProperty(d,"lineAlign",k({},s,{get:function(){return C},set:function(p){var E=P(p);if(!E)throw new SyntaxError("An invalid or illegal string was specified.");C=E,this.hasBeenReset=!0}})),Object.defineProperty(d,"position",k({},s,{get:function(){return _},set:function(p){if(p<0||p>100)throw new Error("Position must be between 0 and 100.");_=p,this.hasBeenReset=!0}})),Object.defineProperty(d,"positionAlign",k({},s,{get:function(){return y},set:function(p){var E=P(p);if(!E)throw new SyntaxError("An invalid or illegal string was specified.");y=E,this.hasBeenReset=!0}})),Object.defineProperty(d,"size",k({},s,{get:function(){return h},set:function(p){if(p<0||p>100)throw new Error("Size must be between 0 and 100.");h=p,this.hasBeenReset=!0}})),Object.defineProperty(d,"align",k({},s,{get:function(){return c},set:function(p){var E=P(p);if(!E)throw new SyntaxError("An invalid or illegal string was specified.");c=E,this.hasBeenReset=!0}})),d.displayState=void 0}return D.prototype.getCueAsHTML=function(){var b=self.WebVTT;return b.convertCueToDOMTree(self,this.text)},D}()},"./src/utils/vttparser.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"parseTimeStamp",function(){return M}),N.d(Y,"fixLineBreaks",function(){return m}),N.d(Y,"VTTParser",function(){return f});var K=N("./src/utils/vttcue.ts"),A=function(){function d(){}var s=d.prototype;return s.decode=function(u,o){if(!u)return"";if(typeof u!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(u))},d}();function M(d){function s(u,o,a,n){return(u|0)*3600+(o|0)*60+(a|0)+parseFloat(n||0)}var r=d.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return r?parseFloat(r[2])>59?s(r[2],r[3],0,r[4]):s(r[1],r[2],r[3],r[4]):null}var H=function(){function d(){this.values=Object.create(null)}var s=d.prototype;return s.set=function(u,o){!this.get(u)&&o!==""&&(this.values[u]=o)},s.get=function(u,o,a){return a?this.has(u)?this.values[u]:o[a]:this.has(u)?this.values[u]:o},s.has=function(u){return u in this.values},s.alt=function(u,o,a){for(var n=0;n<a.length;++n)if(o===a[n]){this.set(u,o);break}},s.integer=function(u,o){/^-?\d+$/.test(o)&&this.set(u,parseInt(o,10))},s.percent=function(u,o){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(o)){var a=parseFloat(o);if(a>=0&&a<=100)return this.set(u,a),!0}return!1},d}();function P(d,s,r,u){var o=u?d.split(u):[d];for(var a in o){if(typeof o[a]!="string")continue;var n=o[a].split(r);if(n.length!==2)continue;var R=n[0],w=n[1];s(R,w)}}var k=new K.default(0,0,""),D=k.align==="middle"?"middle":"center";function b(d,s,r){var u=d;function o(){var R=M(d);if(R===null)throw new Error("Malformed timestamp: "+u);return d=d.replace(/^[^\sa-zA-Z-]+/,""),R}function a(R,w){var x=new H;P(R,function(_,y){var h;switch(_){case"region":for(var c=r.length-1;c>=0;c--)if(r[c].id===y){x.set(_,r[c].region);break}break;case"vertical":x.alt(_,y,["rl","lr"]);break;case"line":h=y.split(","),x.integer(_,h[0]),x.percent(_,h[0])&&x.set("snapToLines",!1),x.alt(_,h[0],["auto"]),h.length===2&&x.alt("lineAlign",h[1],["start",D,"end"]);break;case"position":h=y.split(","),x.percent(_,h[0]),h.length===2&&x.alt("positionAlign",h[1],["start",D,"end","line-left","line-right","auto"]);break;case"size":x.percent(_,y);break;case"align":x.alt(_,y,["start",D,"end","left","right"]);break}},/:/,/\s/),w.region=x.get("region",null),w.vertical=x.get("vertical","");var O=x.get("line","auto");O==="auto"&&k.line===-1&&(O=-1),w.line=O,w.lineAlign=x.get("lineAlign","start"),w.snapToLines=x.get("snapToLines",!0),w.size=x.get("size",100),w.align=x.get("align",D);var C=x.get("position","auto");C==="auto"&&k.position===50&&(C=w.align==="start"||w.align==="left"?0:w.align==="end"||w.align==="right"?100:50),w.position=C}function n(){d=d.replace(/^\s+/,"")}if(n(),s.startTime=o(),n(),d.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+u);d=d.substr(3),n(),s.endTime=o(),n(),a(d,s)}function m(d){return d.replace(/<br(?: \/)?>/gi,`
|
|
`)}var f=function(){function d(){this.state="INITIAL",this.buffer="",this.decoder=new A,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var s=d.prototype;return s.parse=function(u){var o=this;u&&(o.buffer+=o.decoder.decode(u,{stream:!0}));function a(){var C=o.buffer,_=0;for(C=m(C);_<C.length&&C[_]!=="\r"&&C[_]!==`
|
|
`;)++_;var y=C.substr(0,_);return C[_]==="\r"&&++_,C[_]===`
|
|
`&&++_,o.buffer=C.substr(_),y}function n(C){P(C,function(_,y){},/:/)}try{var R="";if(o.state==="INITIAL"){if(!/\r\n|\n/.test(o.buffer))return this;R=a();var w=R.match(/^()?WEBVTT([ \t].*)?$/);if(!w||!w[0])throw new Error("Malformed WebVTT signature.");o.state="HEADER"}for(var x=!1;o.buffer;){if(!/\r\n|\n/.test(o.buffer))return this;x?x=!1:R=a();switch(o.state){case"HEADER":/:/.test(R)?n(R):R||(o.state="ID");continue;case"NOTE":R||(o.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(R)){o.state="NOTE";break}if(!R)continue;if(o.cue=new K.default(0,0,""),o.state="CUE",R.indexOf("-->")===-1){o.cue.id=R;continue}case"CUE":if(!o.cue){o.state="BADCUE";continue}try{b(R,o.cue,o.regionList)}catch(C){o.cue=null,o.state="BADCUE";continue}o.state="CUETEXT";continue;case"CUETEXT":{var O=R.indexOf("-->")!==-1;if(!R||O&&(x=!0)){o.oncue&&o.cue&&o.oncue(o.cue),o.cue=null,o.state="ID";continue}if(o.cue===null)continue;o.cue.text&&(o.cue.text+=`
|
|
`),o.cue.text+=R}continue;case"BADCUE":R||(o.state="ID")}}}catch(C){o.state==="CUETEXT"&&o.cue&&o.oncue&&o.oncue(o.cue),o.cue=null,o.state=o.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},s.flush=function(){var u=this;try{if((u.cue||u.state==="HEADER")&&(u.buffer+=`
|
|
|
|
`,u.parse()),u.state==="INITIAL"||u.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(o){u.onparsingerror&&u.onparsingerror(o)}return u.onflush&&u.onflush(),this},d}()},"./src/utils/webvtt-parser.ts":function(te,Y,N){"use strict";N.r(Y),N.d(Y,"generateCueId",function(){return f}),N.d(Y,"parseWebVTT",function(){return s});var K=N("./src/polyfills/number.ts"),A=N("./src/utils/vttparser.ts"),M=N("./src/demux/id3.ts"),H=N("./src/utils/timescale-conversion.ts"),P=N("./src/remux/mp4-remuxer.ts"),k=/\r\n|\n\r|\n|\r/g,D=function(u,o,a){return a===void 0&&(a=0),u.substr(a,o.length)===o},b=function(u){var o=parseInt(u.substr(-3)),a=parseInt(u.substr(-6,2)),n=parseInt(u.substr(-9,2)),R=u.length>9?parseInt(u.substr(0,u.indexOf(":"))):0;if(!Object(K.isFiniteNumber)(o)||!Object(K.isFiniteNumber)(a)||!Object(K.isFiniteNumber)(n)||!Object(K.isFiniteNumber)(R))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+u);return o+=1e3*a,o+=60*1e3*n,o+=60*60*1e3*R,o},m=function(u){for(var o=5381,a=u.length;a;)o=o*33^u.charCodeAt(--a);return(o>>>0).toString()};function f(r,u,o){return m(r.toString())+m(u.toString())+m(o)}var d=function(u,o,a){var n=u[o],R=u[n.prevCC];if(!R||!R.new&&n.new){u.ccOffset=u.presentationOffset=n.start,n.new=!1;return}for(;(w=R)!==null&&w!==void 0&&w.new;){var w;u.ccOffset+=n.start-R.start,n.new=!1,n=R,R=u[n.prevCC]}u.presentationOffset=a};function s(r,u,o,a,n,R,w,x){var O=new A.VTTParser,C=Object(M.utf8ArrayToStr)(new Uint8Array(r)).trim().replace(k,`
|
|
`).split(`
|
|
`),_=[],y=Object(H.toMpegTsClockFromTimescale)(u,o),h="00:00.000",c=0,v=0,p,E=!0,U=!1;O.oncue=function(F){var z=a[n],G=a.ccOffset,B=(c-y)/9e4;if(z!=null&&z.new&&(v!==void 0?G=a.ccOffset=z.start:d(a,n,B)),B&&(G=B-a.presentationOffset),U){var T=F.endTime-F.startTime,V=Object(P.normalizePts)((F.startTime+G-v)*9e4,R*9e4)/9e4;F.startTime=V,F.endTime=V+T}var Z=F.text.trim();F.text=decodeURIComponent(encodeURIComponent(Z)),F.id||(F.id=f(F.startTime,F.endTime,Z)),F.endTime>0&&_.push(F)},O.onparsingerror=function(F){p=F},O.onflush=function(){if(p){x(p);return}w(_)},C.forEach(function(F){if(E)if(D(F,"X-TIMESTAMP-MAP=")){E=!1,U=!0,F.substr(16).split(",").forEach(function(z){D(z,"LOCAL:")?h=z.substr(6):D(z,"MPEGTS:")&&(c=parseInt(z.substr(7)))});try{v=b(h)/1e3}catch(z){U=!1,p=z}return}else F===""&&(E=!1);O.parse(F+`
|
|
`)}),O.flush()}},"./src/utils/xhr-loader.ts":function(te,Y,N){"use strict";N.r(Y);var K=N("./src/utils/logger.ts"),A=N("./src/loader/load-stats.ts"),M=/^age:\s*[\d.]+\s*$/m,H=function(){function P(D){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=D?D.xhrSetup:null,this.stats=new A.LoadStats,this.retryDelay=0}var k=P.prototype;return k.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},k.abortInternal=function(){var b=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),b&&(b.onreadystatechange=null,b.onprogress=null,b.readyState!==4&&(this.stats.aborted=!0,b.abort()))},k.abort=function(){var b;this.abortInternal(),(b=this.callbacks)!==null&&b!==void 0&&b.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},k.load=function(b,m,f){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=b,this.config=m,this.callbacks=f,this.retryDelay=m.retryDelay,this.loadInternal()},k.loadInternal=function(){var b=this.config,m=this.context;if(!b)return;var f=this.loader=new self.XMLHttpRequest,d=this.stats;d.loading.first=0,d.loaded=0;var s=this.xhrSetup;try{if(s)try{s(f,m.url)}catch(o){f.open("GET",m.url,!0),s(f,m.url)}f.readyState||f.open("GET",m.url,!0);var r=this.context.headers;if(r)for(var u in r)f.setRequestHeader(u,r[u])}catch(o){this.callbacks.onError({code:f.status,text:o.message},m,f);return}m.rangeEnd&&f.setRequestHeader("Range","bytes="+m.rangeStart+"-"+(m.rangeEnd-1)),f.onreadystatechange=this.readystatechange.bind(this),f.onprogress=this.loadprogress.bind(this),f.responseType=m.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),b.timeout),f.send()},k.readystatechange=function(){var b=this.context,m=this.loader,f=this.stats;if(!b||!m)return;var d=m.readyState,s=this.config;if(f.aborted)return;if(d>=2)if(self.clearTimeout(this.requestTimeout),f.loading.first===0&&(f.loading.first=Math.max(self.performance.now(),f.loading.start)),d===4){m.onreadystatechange=null,m.onprogress=null;var r=m.status;if(r>=200&&r<300){f.loading.end=Math.max(self.performance.now(),f.loading.first);var u,o;if(b.responseType==="arraybuffer"?(u=m.response,o=u.byteLength):(u=m.responseText,o=u.length),f.loaded=f.total=o,!this.callbacks)return;var a=this.callbacks.onProgress;if(a&&a(f,b,u,m),!this.callbacks)return;var n={url:m.responseURL,data:u};this.callbacks.onSuccess(n,f,b,m)}else f.retry>=s.maxRetry||r>=400&&r<499?(K.logger.error(r+" while loading "+b.url),this.callbacks.onError({code:r,text:m.statusText},b,m)):(K.logger.warn(r+" while loading "+b.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,s.maxRetryDelay),f.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.timeout)},k.loadtimeout=function(){K.logger.warn("timeout while loading "+this.context.url);var b=this.callbacks;b&&(this.abortInternal(),b.onTimeout(this.stats,this.context,this.loader))},k.loadprogress=function(b){var m=this.stats;m.loaded=b.loaded,b.lengthComputable&&(m.total=b.total)},k.getCacheAge=function(){var b=null;if(this.loader&&M.test(this.loader.getAllResponseHeaders())){var m=this.loader.getResponseHeader("age");b=m?parseFloat(m):null}return b},P}();Y.default=H}}).default})},vHTk:function(tn,Qe,I){tn.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return pn});var te=I("rePB"),Y=I("VTBJ"),N=I("KQm4"),K=I("U8pU"),A=I("ODXe"),M=I("q1tI"),H=I("TSYQ"),P=I.n(H),k=I("Gytx"),D=I.n(k),b=I("Kwbf"),m=I("t23M"),f=I("qx4F"),d=I("6eGT"),s=I("IBYe"),r=I("Ff2n"),u=I("c+Xe"),o=I("fyJ8"),a=I("biw7");function n(He,Ue,pt,Ct,Ge){var vt=pt[He]||{},Ae=pt[Ue]||{},ge,Ee;vt.fixed==="left"?ge=Ct.left[He]:Ae.fixed==="right"&&(Ee=Ct.right[Ue]);var ae=!1,re=!1,he=!1,ve=!1,me=pt[Ue+1],Be=pt[He-1];if(Ge==="rtl"){if(ge!==void 0){var Tt=Be&&Be.fixed==="left";ve=!Tt}else if(Ee!==void 0){var Jt=me&&me.fixed==="right";he=!Jt}}else if(ge!==void 0){var En=me&&me.fixed==="left";ae=!En}else if(Ee!==void 0){var mt=Be&&Be.fixed==="right";re=!mt}return{fixLeft:ge,fixRight:Ee,lastFixLeft:ae,firstFixRight:re,lastFixRight:he,firstFixLeft:ve,isSticky:Ct.isSticky}}var R=I("sR1s");function w(He){var Ue=He.cells,pt=He.stickyOffsets,Ct=He.flattenColumns,Ge=He.rowComponent,vt=He.cellComponent,Ae=He.onHeaderRow,ge=He.index,Ee=M.useContext(a.a),ae=Ee.prefixCls,re=Ee.direction,he;Ae&&(he=Ae(Ue.map(function(me){return me.column}),ge));var ve=Object(R.a)(Ue.map(function(me){return me.column}));return M.createElement(Ge,Object.assign({},he),Ue.map(function(me,Be){var Tt=me.column,Jt=n(me.colStart,me.colEnd,Ct,pt,re),En;return Tt&&Tt.onHeaderCell&&(En=me.column.onHeaderCell(Tt)),M.createElement(o.a,Object.assign({},me,{ellipsis:Tt.ellipsis,align:Tt.align,component:vt,prefixCls:ae,key:ve[Be]},Jt,{additionalProps:En,rowType:"header"}))}))}w.displayName="HeaderRow";var x=w;function O(He){var Ue=[];function pt(Ae,ge){var Ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Ue[Ee]=Ue[Ee]||[];var ae=ge,re=Ae.filter(Boolean).map(function(he){var ve={key:he.key,className:he.className||"",children:he.title,column:he,colStart:ae},me=1,Be=he.children;return Be&&Be.length>0&&(me=pt(Be,ae,Ee+1).reduce(function(Tt,Jt){return Tt+Jt},0),ve.hasSubColumns=!0),"colSpan"in he&&(me=he.colSpan),"rowSpan"in he&&(ve.rowSpan=he.rowSpan),ve.colSpan=me,ve.colEnd=ve.colStart+me-1,Ue[Ee].push(ve),ae+=me,me});return re}pt(He,0);for(var Ct=Ue.length,Ge=function(ge){Ue[ge].forEach(function(Ee){!("rowSpan"in Ee)&&!Ee.hasSubColumns&&(Ee.rowSpan=Ct-ge)})},vt=0;vt<Ct;vt+=1)Ge(vt);return Ue}function C(He){var Ue=He.stickyOffsets,pt=He.columns,Ct=He.flattenColumns,Ge=He.onHeaderRow,vt=M.useContext(a.a),Ae=vt.prefixCls,ge=vt.getComponent,Ee=M.useMemo(function(){return O(pt)},[pt]),ae=ge(["header","wrapper"],"thead"),re=ge(["header","row"],"tr"),he=ge(["header","cell"],"th");return M.createElement(ae,{className:"".concat(Ae,"-thead")},Ee.map(function(ve,me){var Be=M.createElement(x,{key:me,flattenColumns:Ct,cells:ve,stickyOffsets:Ue,rowComponent:re,cellComponent:he,onHeaderRow:Ge,index:me});return Be}))}var _=C,y=I("hW8S");function h(He){for(var Ue=He.colWidths,pt=He.columns,Ct=He.columCount,Ge=[],vt=Ct||pt.length,Ae=!1,ge=vt-1;ge>=0;ge-=1){var Ee=Ue[ge],ae=pt&&pt[ge],re=ae&&ae[y.a];(Ee||re||Ae)&&(Ge.unshift(M.createElement("col",Object.assign({key:ge,style:{width:Ee,minWidth:Ee}},re))),Ae=!0)}return M.createElement("colgroup",null,Ge)}var c=h;function v(He,Ue){return Object(M.useMemo)(function(){for(var pt=[],Ct=0;Ct<Ue;Ct+=1){var Ge=He[Ct];if(Ge!==void 0)pt[Ct]=Ge;else return null}return pt},[He.join("_"),Ue])}var p=M.forwardRef(function(He,Ue){var pt=He.noData,Ct=He.columns,Ge=He.flattenColumns,vt=He.colWidths,Ae=He.columCount,ge=He.stickyOffsets,Ee=He.direction,ae=He.fixHeader,re=He.offsetHeader,he=He.stickyClassName,ve=He.onScroll,me=Object(r.a)(He,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),Be=M.useContext(a.a),Tt=Be.prefixCls,Jt=Be.scrollbarSize,En=Be.isSticky,mt=En&&!ae?0:Jt,Qt=M.useRef(null),gt=M.useCallback(function(Yt){Object(u.b)(Ue,Yt),Object(u.b)(Qt,Yt)},[]);M.useEffect(function(){var Yt;function rn(_e){var Ne=_e.currentTarget,xt=_e.deltaX;xt&&(ve({currentTarget:Ne,scrollLeft:Ne.scrollLeft+xt}),_e.preventDefault())}return(Yt=Qt.current)===null||Yt===void 0||Yt.addEventListener("wheel",rn),function(){var _e;(_e=Qt.current)===null||_e===void 0||_e.removeEventListener("wheel",rn)}},[]);var yt=Ge[Ge.length-1],rt={fixed:yt?yt.fixed:null,onHeaderCell:function(){return{className:"".concat(Tt,"-cell-scrollbar")}}},ce=Object(M.useMemo)(function(){return mt?[].concat(Object(N.a)(Ct),[rt]):Ct},[mt,Ct]),Re=Object(M.useMemo)(function(){return mt?[].concat(Object(N.a)(Ge),[rt]):Ge},[mt,Ge]),At=Object(M.useMemo)(function(){var Yt=ge.right,rn=ge.left;return Object(Y.a)(Object(Y.a)({},ge),{},{left:Ee==="rtl"?[].concat(Object(N.a)(rn.map(function(_e){return _e+mt})),[0]):rn,right:Ee==="rtl"?Yt:[].concat(Object(N.a)(Yt.map(function(_e){return _e+mt})),[0]),isSticky:En})},[mt,ge,En]),ot=v(vt,Ae);return M.createElement("div",{style:Object(Y.a)({overflow:"hidden"},En?{top:re}:{}),ref:gt,className:P()("".concat(Tt,"-header"),Object(te.a)({},he,!!he))},M.createElement("table",{style:{tableLayout:"fixed",visibility:pt||ot?null:"hidden"}},M.createElement(c,{colWidths:ot?[].concat(Object(N.a)(ot),[mt]):[],columCount:Ae+1,columns:Re}),M.createElement(_,Object.assign({},me,{stickyOffsets:At,columns:ce,flattenColumns:Re}))))});p.displayName="FixedHeader";var E=p,U=M.createContext(null),F=U;function z(He){var Ue=He.prefixCls,pt=He.children,Ct=He.component,Ge=He.cellComponent,vt=He.fixHeader,Ae=He.fixColumn,ge=He.horizonScroll,Ee=He.className,ae=He.expanded,re=He.componentWidth,he=He.colSpan,ve=M.useContext(a.a),me=ve.scrollbarSize;return M.useMemo(function(){var Be=pt;return Ae&&(Be=M.createElement("div",{style:{width:re-(vt?me:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Ue,"-expanded-row-fixed")},Be)),M.createElement(Ct,{className:Ee,style:{display:ae?null:"none"}},M.createElement(o.a,{component:Ge,prefixCls:Ue,colSpan:he},Be))},[pt,Ct,vt,ge,Ee,ae,re,he,me])}var G=z;function B(He){var Ue=He.className,pt=He.style,Ct=He.record,Ge=He.index,vt=He.rowKey,Ae=He.getRowKey,ge=He.rowExpandable,Ee=He.expandedKeys,ae=He.onRow,re=He.indent,he=re===void 0?0:re,ve=He.rowComponent,me=He.cellComponent,Be=He.childrenColumnName,Tt=M.useContext(a.a),Jt=Tt.prefixCls,En=Tt.fixedInfoList,mt=M.useContext(F),Qt=mt.fixHeader,gt=mt.fixColumn,yt=mt.horizonScroll,rt=mt.componentWidth,ce=mt.flattenColumns,Re=mt.expandableType,At=mt.expandRowByClick,ot=mt.onTriggerExpand,Yt=mt.rowClassName,rn=mt.expandedRowClassName,_e=mt.indentSize,Ne=mt.expandIcon,xt=mt.expandedRowRender,Xt=mt.expandIconColumnIndex,vn=M.useState(!1),Mn=Object(A.a)(vn,2),ci=Mn[0],$n=Mn[1],Cn=Ee&&Ee.has(He.recordKey);M.useEffect(function(){Cn&&$n(!0)},[Cn]);var Ti=Re==="row"&&(!ge||ge(Ct)),Wi=Re==="nest",hi=Be&&Ct&&Ct[Be],fi=Ti||Wi,ji;ae&&(ji=ae(Ct,Ge));var er=function(S){if(At&&fi&&ot(Ct,S),ji&&ji.onClick){for(var L,W=arguments.length,ne=new Array(W>1?W-1:0),Q=1;Q<W;Q++)ne[Q-1]=arguments[Q];(L=ji).onClick.apply(L,[S].concat(ne))}},yr;typeof Yt=="string"?yr=Yt:typeof Yt=="function"&&(yr=Yt(Ct,Ge,he));var cn=Object(R.a)(ce),ri=M.createElement(ve,Object.assign({},ji,{"data-row-key":vt,className:P()(Ue,"".concat(Jt,"-row"),"".concat(Jt,"-row-level-").concat(he),yr,ji&&ji.className),style:Object(Y.a)(Object(Y.a)({},pt),ji?ji.style:null),onClick:er}),ce.map(function(X,S){var L=X.render,W=X.dataIndex,ne=X.className,Q=cn[S],ke=En[S],Vt;S===(Xt||0)&&Wi&&(Vt=M.createElement(M.Fragment,null,M.createElement("span",{style:{paddingLeft:"".concat(_e*he,"px")},className:"".concat(Jt,"-row-indent indent-level-").concat(he)}),Ne({prefixCls:Jt,expanded:Cn,expandable:hi,record:Ct,onExpand:ot})));var kn;return X.onCell&&(kn=X.onCell(Ct,Ge)),M.createElement(o.a,Object.assign({className:ne,ellipsis:X.ellipsis,align:X.align,component:me,prefixCls:Jt,key:Q,record:Ct,index:Ge,dataIndex:W,render:L,shouldCellUpdate:X.shouldCellUpdate},ke,{appendNode:Vt,additionalProps:kn}))})),pr;if(Ti&&(ci||Cn)){var Cr=xt(Ct,Ge,he+1,Cn),tr=rn&&rn(Ct,Ge,he);pr=M.createElement(G,{expanded:Cn,className:P()("".concat(Jt,"-expanded-row"),"".concat(Jt,"-expanded-row-level-").concat(he+1),tr),prefixCls:Jt,fixHeader:Qt,fixColumn:gt,horizonScroll:yt,component:ve,componentWidth:rt,cellComponent:me,colSpan:ce.length},Cr)}var nr;return hi&&Cn&&(nr=(Ct[Be]||[]).map(function(X,S){var L=Ae(X,S);return M.createElement(B,Object.assign({},He,{key:L,rowKey:L,record:X,recordKey:L,index:S,indent:he+1}))})),M.createElement(M.Fragment,null,ri,pr,nr)}B.displayName="BodyRow";var T=B,V=M.createContext(null),Z=V;function oe(He){var Ue=He.columnKey,pt=He.onColumnResize,Ct=M.useRef();return M.useEffect(function(){Ct.current&&pt(Ue,Ct.current.offsetWidth)},[]),M.createElement(m.a,{onResize:function(vt){var Ae=vt.offsetWidth;pt(Ue,Ae)}},M.createElement("td",{ref:Ct,style:{padding:0,border:0,height:0}},M.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function pe(He){var Ue=He.data,pt=He.getRowKey,Ct=He.measureColumnWidth,Ge=He.expandedKeys,vt=He.onRow,Ae=He.rowExpandable,ge=He.emptyNode,Ee=He.childrenColumnName,ae=M.useContext(Z),re=ae.onColumnResize,he=M.useContext(a.a),ve=he.prefixCls,me=he.getComponent,Be=M.useContext(F),Tt=Be.fixHeader,Jt=Be.horizonScroll,En=Be.flattenColumns,mt=Be.componentWidth;return M.useMemo(function(){var Qt=me(["body","wrapper"],"tbody"),gt=me(["body","row"],"tr"),yt=me(["body","cell"],"td"),rt;Ue.length?rt=Ue.map(function(Re,At){var ot=pt(Re,At);return M.createElement(T,{key:ot,rowKey:ot,record:Re,recordKey:ot,index:At,rowComponent:gt,cellComponent:yt,expandedKeys:Ge,onRow:vt,getRowKey:pt,rowExpandable:Ae,childrenColumnName:Ee})}):rt=M.createElement(G,{expanded:!0,className:"".concat(ve,"-placeholder"),prefixCls:ve,fixHeader:Tt,fixColumn:Jt,horizonScroll:Jt,component:gt,componentWidth:mt,cellComponent:yt,colSpan:En.length},ge);var ce=Object(R.a)(En);return M.createElement(Qt,{className:"".concat(ve,"-tbody")},Ct&&M.createElement("tr",{"aria-hidden":"true",className:"".concat(ve,"-measure-row"),style:{height:0}},ce.map(function(Re){return M.createElement(oe,{key:Re,columnKey:Re,onColumnResize:re})})),rt)},[Ue,ve,vt,Ct,Ge,pt,me,mt,ge,En])}var Ye=M.memo(pe);Ye.displayName="Body";var xe=Ye,Ie=I("wRmb"),Je=I("xEkU"),Ke=I.n(Je);function be(He){var Ue=Object(M.useRef)(He),pt=Object(M.useState)({}),Ct=Object(A.a)(pt,2),Ge=Ct[1],vt=Object(M.useRef)(null),Ae=Object(M.useRef)([]);function ge(Ee){vt.current===null&&(Ae.current=[],vt.current=Ke()(function(){Ae.current.forEach(function(ae){Ue.current=ae(Ue.current)}),vt.current=null,Ge({})})),Ae.current.push(Ee)}return Object(M.useEffect)(function(){return function(){Ke.a.cancel(vt.current)}},[]),[Ue.current,ge]}function de(He){var Ue=Object(M.useRef)(He),pt=Object(M.useRef)(null);function Ct(){window.clearTimeout(pt.current)}function Ge(Ae){Ue.current=Ae,Ct(),pt.current=window.setTimeout(function(){Ue.current=null,pt.current=null},100)}function vt(){return Ue.current}return Object(M.useEffect)(function(){return Ct},[]),[Ge,vt]}function nt(He,Ue,pt){var Ct=Object(M.useMemo)(function(){for(var Ge=[],vt=[],Ae=0,ge=0,Ee=0;Ee<Ue;Ee+=1)if(pt==="rtl"){vt[Ee]=ge,ge+=He[Ee]||0;var ae=Ue-Ee-1;Ge[ae]=Ae,Ae+=He[ae]||0}else{Ge[Ee]=Ae,Ae+=He[Ee]||0;var re=Ue-Ee-1;vt[re]=ge,ge+=He[re]||0}return{left:Ge,right:vt}},[He,Ue,pt]);return Ct}var Kt=nt;function jt(He){var Ue=He.className,pt=He.children;return M.createElement("div",{className:Ue},pt)}var wt=jt,ze=I("n6Qo");function ft(He){var Ue,pt=He.prefixCls,Ct=He.record,Ge=He.onExpand,vt=He.expanded,Ae=He.expandable,ge="".concat(pt,"-row-expand-icon");if(!Ae)return M.createElement("span",{className:P()(ge,"".concat(pt,"-row-spaced"))});var Ee=function(re){Ge(Ct,re),re.stopPropagation()};return M.createElement("span",{className:P()(ge,(Ue={},Object(te.a)(Ue,"".concat(pt,"-row-expanded"),vt),Object(te.a)(Ue,"".concat(pt,"-row-collapsed"),!vt),Ue)),onClick:Ee})}function dt(He,Ue,pt){var Ct=[];function Ge(vt){(vt||[]).forEach(function(Ae,ge){Ct.push(Ue(Ae,ge)),Ge(Ae[pt])})}return Ge(He),Ct}var Nt=I("zT1h"),Ze=I("y0+3"),Bt=function(Ue,pt){var Ct,Ge,vt=Ue.scrollBodyRef,Ae=Ue.onScroll,ge=Ue.offsetScroll,Ee=M.useContext(a.a),ae=Ee.prefixCls,re=((Ct=vt.current)===null||Ct===void 0?void 0:Ct.scrollWidth)||0,he=((Ge=vt.current)===null||Ge===void 0?void 0:Ge.clientWidth)||0,ve=re&&he*(he/re),me=M.useRef(),Be=be({scrollLeft:0,isHiddenScrollBar:!1}),Tt=Object(A.a)(Be,2),Jt=Tt[0],En=Tt[1],mt=M.useRef({delta:0,x:0}),Qt=M.useState(!1),gt=Object(A.a)(Qt,2),yt=gt[0],rt=gt[1],ce=function(){rt(!1)},Re=function(_e){_e.persist(),mt.current.delta=_e.pageX-Jt.scrollLeft,mt.current.x=0,rt(!0),_e.preventDefault()},At=function(_e){var Ne,xt=_e||((Ne=window)===null||Ne===void 0?void 0:Ne.event),Xt=xt.buttons;if(!yt||Xt===0){yt&&rt(!1);return}var vn=mt.current.x+_e.pageX-mt.current.x-mt.current.delta;vn<=0&&(vn=0),vn+ve>=he&&(vn=he-ve),Ae({scrollLeft:vn/he*(re+2)}),mt.current.x=_e.pageX},ot=function(){var _e=Object(Ze.b)(vt.current).top,Ne=_e+vt.current.offsetHeight,xt=document.documentElement.scrollTop+window.innerHeight;Ne-Object(f.a)()<=xt||_e>=xt-ge?En(function(Xt){return Object(Y.a)(Object(Y.a)({},Xt),{},{isHiddenScrollBar:!0})}):En(function(Xt){return Object(Y.a)(Object(Y.a)({},Xt),{},{isHiddenScrollBar:!1})})},Yt=function(_e){En(function(Ne){return Object(Y.a)(Object(Y.a)({},Ne),{},{scrollLeft:_e/re*he||0})})};return M.useImperativeHandle(pt,function(){return{setScrollLeft:Yt}}),M.useEffect(function(){var rn=Object(Nt.a)(document.body,"mouseup",ce,!1),_e=Object(Nt.a)(document.body,"mousemove",At,!1);return ot(),function(){rn.remove(),_e.remove()}},[ve,yt]),M.useEffect(function(){var rn=Object(Nt.a)(window,"scroll",ot,!1),_e=Object(Nt.a)(window,"resize",ot,!1);return function(){rn.remove(),_e.remove()}},[]),M.useEffect(function(){Jt.isHiddenScrollBar||En(function(rn){var _e,Ne;return Object(Y.a)(Object(Y.a)({},rn),{},{scrollLeft:vt.current.scrollLeft/((_e=vt.current)===null||_e===void 0?void 0:_e.scrollWidth)*((Ne=vt.current)===null||Ne===void 0?void 0:Ne.clientWidth)})})},[Jt.isHiddenScrollBar]),re<=he||!ve||Jt.isHiddenScrollBar?null:M.createElement("div",{style:{height:Object(f.a)(),width:he,bottom:ge},className:"".concat(ae,"-sticky-scroll")},M.createElement("div",{onMouseDown:Re,ref:me,className:P()("".concat(ae,"-sticky-scroll-bar"),Object(te.a)({},"".concat(ae,"-sticky-scroll-bar-active"),yt)),style:{width:"".concat(ve,"px"),transform:"translate3d(".concat(Jt.scrollLeft,"px, 0, 0)")}}))},Ut=M.forwardRef(Bt);function Mt(He,Ue){return M.useMemo(function(){var pt=!!He;return{isSticky:pt,stickyClassName:pt?"".concat(Ue,"-sticky-header"):"",offsetHeader:Object(K.a)(He)==="object"&&He.offsetHeader||0,offsetScroll:Object(K.a)(He)==="object"&&He.offsetScroll||0}},[He,Ue])}var An=[],mn={},pn="rc-table-internal-hook",tt=M.memo(function(He){var Ue=He.children;return Ue},function(He,Ue){return D()(He.props,Ue.props)?He.pingLeft!==Ue.pingLeft||He.pingRight!==Ue.pingRight:!1});function fn(He){var Ue,pt=He.prefixCls,Ct=He.className,Ge=He.rowClassName,vt=He.style,Ae=He.data,ge=He.rowKey,Ee=He.scroll,ae=He.tableLayout,re=He.direction,he=He.title,ve=He.footer,me=He.summary,Be=He.id,Tt=He.showHeader,Jt=He.components,En=He.emptyText,mt=He.onRow,Qt=He.onHeaderRow,gt=He.internalHooks,yt=He.transformColumns,rt=He.internalRefs,ce=He.sticky,Re=Ae||An,At=!!Re.length,ot=M.useState(0),Yt=Object(A.a)(ot,2),rn=Yt[0],_e=Yt[1];M.useEffect(function(){_e(Object(f.a)())});var Ne=M.useMemo(function(){return Object(R.c)(Jt,{})},[Jt]),xt=M.useCallback(function(Rn,bn){return Object(R.b)(Ne,Rn)||bn},[Ne]),Xt=M.useMemo(function(){return typeof ge=="function"?ge:function(Rn){var bn=Rn&&Rn[ge];return bn}},[ge]),vn=Object(y.c)(He),Mn=vn.expandIcon,ci=vn.expandedRowKeys,$n=vn.defaultExpandedRowKeys,Cn=vn.defaultExpandAllRows,Ti=vn.expandedRowRender,Wi=vn.onExpand,hi=vn.onExpandedRowsChange,fi=vn.expandRowByClick,ji=vn.rowExpandable,er=vn.expandIconColumnIndex,yr=vn.expandedRowClassName,cn=vn.childrenColumnName,ri=vn.indentSize,pr=Mn||ft,Cr=cn||"children",tr=M.useMemo(function(){return Ti?"row":He.expandable&>===pn&&He.expandable.__PARENT_RENDER_ICON__||Re.some(function(Rn){return Rn&&Object(K.a)(Rn)==="object"&&Rn[Cr]})?"nest":!1},[!!Ti,Re]),nr=M.useState(function(){return $n||(Cn?dt(Re,Xt,Cr):[])}),X=Object(A.a)(nr,2),S=X[0],L=X[1],W=M.useMemo(function(){return new Set(ci||S||[])},[ci,S]),ne=M.useCallback(function(Rn){var bn=Xt(Rn,Re.indexOf(Rn)),Rt,Xe=W.has(bn);Xe?(W.delete(bn),Rt=Object(N.a)(W)):Rt=[].concat(Object(N.a)(W),[bn]),L(Rt),Wi&&Wi(!Xe,Rn),hi&&hi(Rt)},[Xt,W,Re,Wi,hi]),Q=M.useState(0),ke=Object(A.a)(Q,2),Vt=ke[0],kn=ke[1],Qn=Object(Ie.b)(Object(Y.a)(Object(Y.a)(Object(Y.a)({},He),vn),{},{expandable:!!Ti,expandedKeys:W,getRowKey:Xt,onTriggerExpand:ne,expandIcon:pr,expandIconColumnIndex:er,direction:re}),gt===pn?yt:null),nn=Object(A.a)(Qn,2),ti=nn[0],qn=nn[1],Li=M.useMemo(function(){return{columns:ti,flattenColumns:qn}},[ti,qn]),lr=M.useRef(),ar=M.useRef(),Ki=M.useRef(),Pr=M.useState(!1),Vr=Object(A.a)(Pr,2),Ai=Vr[0],wi=Vr[1],ir=M.useState(!1),Fi=Object(A.a)(ir,2),Bn=Fi[0],gn=Fi[1],Tn=be(new Map),_n=Object(A.a)(Tn,2),si=_n[0],ai=_n[1],J=Object(R.a)(qn),ue=J.map(function(Rn){return si.get(Rn)}),Ce=M.useMemo(function(){return ue},[ue.join("_")]),Te=Kt(Ce,qn.length,re),qe=Ee&&Object(R.d)(Ee.y),Oe=Ee&&Object(R.d)(Ee.x),Ve=Oe&&qn.some(function(Rn){var bn=Rn.fixed;return bn}),et=M.useRef(),Ot=Mt(ce,pt),Et=Ot.isSticky,je=Ot.offsetHeader,ht=Ot.offsetScroll,it=Ot.stickyClassName,st,bt,Lt;qe&&(bt={overflowY:"scroll",maxHeight:Ee.y}),Oe&&(st={overflowX:"auto"},qe||(bt={overflowY:"hidden"}),Lt={width:Ee.x===!0?"auto":Ee.x,minWidth:"100%"});var ct=M.useCallback(function(Rn,bn){ai(function(Rt){var Xe=new Map(Rt);return Xe.set(Rn,bn),Xe})},[]),Gt=de(null),on=Object(A.a)(Gt,2),Dn=on[0],Kn=on[1];function wn(Rn,bn){if(!bn)return;typeof bn=="function"?bn(Rn):bn.scrollLeft!==Rn&&(bn.scrollLeft=Rn)}var Nn=function(bn){var Rt=bn.currentTarget,Xe=bn.scrollLeft,kt=typeof Xe=="number"?Xe:Rt.scrollLeft,Pt=Rt||mn;if(!Kn()||Kn()===Pt){var an;Dn(Pt),wn(kt,ar.current),wn(kt,Ki.current),wn(kt,(an=et.current)===null||an===void 0?void 0:an.setScrollLeft)}if(Rt){var zn=Rt.scrollWidth,Ln=Rt.clientWidth;wi(kt>0),gn(kt<zn-Ln)}},Pn=function(){Ki.current&&Nn({currentTarget:Ki.current})},Dt=function(bn){var Rt=bn.width;Pn(),kn(lr.current?lr.current.offsetWidth:Rt)};M.useEffect(function(){return Pn},[]),M.useEffect(function(){Oe&&Pn()},[Oe]),M.useEffect(function(){gt===pn&&rt&&(rt.body.current=Ki.current)});var sn=xt(["table"],"table"),Ft=M.useMemo(function(){return ae||(Ve?Ee.x==="max-content"?"auto":"fixed":qe||qn.some(function(Rn){var bn=Rn.ellipsis;return bn})?"fixed":"auto")},[qe,Ve,qn,ae]),St,Un={colWidths:Ce,columCount:qn.length,stickyOffsets:Te,onHeaderRow:Qt,fixHeader:qe},Sn=M.useMemo(function(){return At?null:typeof En=="function"?En():En},[At,En]),zt=M.createElement(xe,{data:Re,measureColumnWidth:qe||Oe||Et,expandedKeys:W,rowExpandable:ji,getRowKey:Xt,onRow:mt,emptyNode:Sn,childrenColumnName:Cr}),lt=M.createElement(c,{colWidths:qn.map(function(Rn){var bn=Rn.width;return bn}),columns:qn}),jn=me&&M.createElement(ze.b,null,me(Re)),ln=xt(["body"]);if(qe||Et){var Jn;typeof ln=="function"?(Jn=ln(Re,{scrollbarSize:rn,ref:Ki,onScroll:Nn}),Un.colWidths=qn.map(function(Rn,bn){var Rt=Rn.width,Xe=bn===ti.length-1?Rt-rn:Rt;return typeof Xe=="number"&&!Number.isNaN(Xe)?Xe:(Object(b.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):Jn=M.createElement("div",{style:Object(Y.a)(Object(Y.a)({},st),bt),onScroll:Nn,ref:Ki,className:P()("".concat(pt,"-body"))},M.createElement(sn,{style:Object(Y.a)(Object(Y.a)({},Lt),{},{tableLayout:Ft})},lt,zt,jn),Et&&M.createElement(Ut,{ref:et,offsetScroll:ht,scrollBodyRef:Ki,onScroll:Nn})),St=M.createElement(M.Fragment,null,Tt!==!1&&M.createElement(E,Object.assign({noData:!Re.length},Un,Li,{direction:re,offsetHeader:je,stickyClassName:it,ref:ar,onScroll:Nn})),Jn)}else St=M.createElement("div",{style:Object(Y.a)(Object(Y.a)({},st),bt),className:P()("".concat(pt,"-content")),onScroll:Nn,ref:Ki},M.createElement(sn,{style:Object(Y.a)(Object(Y.a)({},Lt),{},{tableLayout:Ft})},lt,Tt!==!1&&M.createElement(_,Object.assign({},Un,Li)),zt,jn));var $t=Object(y.b)(He),On=M.createElement("div",Object.assign({className:P()(pt,Ct,(Ue={},Object(te.a)(Ue,"".concat(pt,"-rtl"),re==="rtl"),Object(te.a)(Ue,"".concat(pt,"-ping-left"),Ai),Object(te.a)(Ue,"".concat(pt,"-ping-right"),Bn),Object(te.a)(Ue,"".concat(pt,"-layout-fixed"),ae==="fixed"),Object(te.a)(Ue,"".concat(pt,"-fixed-header"),qe),Object(te.a)(Ue,"".concat(pt,"-fixed-column"),Ve),Object(te.a)(Ue,"".concat(pt,"-scroll-horizontal"),Oe),Object(te.a)(Ue,"".concat(pt,"-has-fix-left"),qn[0]&&qn[0].fixed),Object(te.a)(Ue,"".concat(pt,"-has-fix-right"),qn[qn.length-1]&&qn[qn.length-1].fixed==="right"),Ue)),style:vt,id:Be,ref:lr},$t),M.createElement(tt,{pingLeft:Ai,pingRight:Bn,props:Object(Y.a)(Object(Y.a)({},He),{},{stickyOffsets:Te,mergedExpandedKeys:W})},he&&M.createElement(wt,{className:"".concat(pt,"-title")},he(Re)),M.createElement("div",{className:"".concat(pt,"-container")},St),ve&&M.createElement(wt,{className:"".concat(pt,"-footer")},ve(Re))));Oe&&(On=M.createElement(m.a,{onResize:Dt},On));var Fn=M.useMemo(function(){return{prefixCls:pt,getComponent:xt,scrollbarSize:rn,direction:re,fixedInfoList:qn.map(function(Rn,bn){return n(bn,bn,qn,Te,re)}),isSticky:Et}},[pt,xt,rn,re,qn,Te,re,Et]),hn=M.useMemo(function(){return Object(Y.a)(Object(Y.a)({},Li),{},{tableLayout:Ft,rowClassName:Ge,expandedRowClassName:yr,componentWidth:Vt,fixHeader:qe,fixColumn:Ve,horizonScroll:Oe,expandIcon:pr,expandableType:tr,expandRowByClick:fi,expandedRowRender:Ti,onTriggerExpand:ne,expandIconColumnIndex:er,indentSize:ri})},[Li,Ft,Ge,yr,Vt,qe,Ve,Oe,pr,tr,fi,Ti,ne,er,ri]),yi=M.useMemo(function(){return{onColumnResize:ct}},[ct]);return M.createElement(a.a.Provider,{value:Fn},M.createElement(F.Provider,{value:hn},M.createElement(Z.Provider,{value:yi},On)))}fn.Column=s.a,fn.ColumnGroup=d.a,fn.Summary=ze.a,fn.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var In=Qe.b=fn},wRmb:function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return D});var te=I("rePB"),Y=I("KQm4"),N=I("VTBJ"),K=I("Ff2n"),A=I("q1tI"),M=I.n(A),H=I("Kwbf"),P=I("Zm9Q"),k=I("hW8S");function D(s){return Object(P.a)(s).filter(function(r){return A.isValidElement(r)}).map(function(r){var u=r.key,o=r.props,a=o.children,n=Object(K.a)(o,["children"]),R=Object(N.a)({key:u},n);return a&&(R.children=D(a)),R})}function b(s){return s.reduce(function(r,u){var o=u.fixed,a=o===!0?"left":o,n=u.children;return n&&n.length>0?[].concat(Object(Y.a)(r),Object(Y.a)(b(n).map(function(R){return Object(N.a)({fixed:a},R)}))):[].concat(Object(Y.a)(r),[Object(N.a)(Object(N.a)({},u),{},{fixed:a})])},[])}function m(s){for(var r=!0,u=0;u<s.length;u+=1){var o=s[u];if(r&&o.fixed!=="left")r=!1;else if(!r&&o.fixed==="left"){Object(H.a)(!1,"Index ".concat(u-1," of `columns` missing `fixed='left'` prop."));break}}for(var a=!0,n=s.length-1;n>=0;n-=1){var R=s[n];if(a&&R.fixed!=="right")a=!1;else if(!a&&R.fixed==="right"){Object(H.a)(!1,"Index ".concat(n+1," of `columns` missing `fixed='right'` prop."));break}}}function f(s){return s.map(function(r){var u=r.fixed,o=Object(K.a)(r,["fixed"]),a=u;return u==="left"?a="right":u==="right"&&(a="left"),Object(N.a)({fixed:a},o)})}function d(s,r){var u=s.prefixCls,o=s.columns,a=s.children,n=s.expandable,R=s.expandedKeys,w=s.getRowKey,x=s.onTriggerExpand,O=s.expandIcon,C=s.rowExpandable,_=s.expandIconColumnIndex,y=s.direction,h=s.expandRowByClick,c=A.useMemo(function(){return o||D(a)},[o,a]),v=A.useMemo(function(){if(n){var U,F=_||0,z=c[F],G=(U={},Object(te.a)(U,k.a,{className:"".concat(u,"-expand-icon-col")}),Object(te.a)(U,"title",""),Object(te.a)(U,"fixed",z?z.fixed:null),Object(te.a)(U,"className","".concat(u,"-row-expand-icon-cell")),Object(te.a)(U,"render",function(V,Z,oe){var pe=w(Z,oe),Ye=R.has(pe),xe=C?C(Z):!0,Ie=O({prefixCls:u,expanded:Ye,expandable:xe,record:Z,onExpand:x});return h?A.createElement("span",{onClick:function(Ke){return Ke.stopPropagation()}},Ie):Ie}),U),B=c.slice();return F>=0&&B.splice(F,0,G),B}return c},[n,c,w,R,O,y]),p=A.useMemo(function(){var U=v;return r&&(U=r(U)),U.length||(U=[{render:function(){return null}}]),U},[r,v,y]),E=A.useMemo(function(){return y==="rtl"?f(b(p)):b(p)},[p,y]);return[p,E]}Qe.b=d},wwSX:function(tn,Qe,I){tn.exports=I.p+"static/b2.2c844a2a.svg"},xOL1:function(tn,Qe){tn.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAbVJREFUOE+Nk79rFUEUhb+zE4OFwUD+CyGKKQQbSaMikQQ7C1tBBIsUQaJvl2Fn/cWDpAiIYJsi7YOIaCUWFoKKRhG0sbEzEImFGnev7G6yyXsxeU5159yZb87l3hG9q2WLiBO79FIwXpLp0s6cwITnQCMWrGDM43jdBckZQ0wTMdrong2R2Bxm0/98sZ8ozdcOEm5hjOC41u9Olc9ZQKySclOVkNhljCmCzjeAJM/4FbW5p+8k5tlggTtarfKxLSM6pHq4BTiL0SboaAOIi284jeP1nti+ApMEvdoEvEPMkOpJDZi1IwzwgqDh/wSsYZwk08ca4O0Qua3zW8OV5crmHg6u22EGbQ2nIbx+1IC6rrK+cYJW9gXEVrbxGUEj5bltQGJvgBapHu0LSGwCyEh1vBsQWwd4TNCDPg6uAOcImuoFlL1dJ9WNPg5uYwwRVM3MzhJmKIpjZK6e9bj4jNNpvL4QFx9wuoDXJ1r5IlH0llTtXgcXwa4SolObnYnwKnbFcfEcdJ+gpW6AtzFynuIop/Fn053u4CA5yzjO4FV9tu0Syl2S38WiSWBgD8AfoEPQ7Fb+LwIiyhxWwe2KAAAAAElFTkSuQmCC"},xb3X:function(tn,Qe,I){tn.exports={flex_box_center:"flex_box_center___2oNqn",flex_space_between:"flex_space_between___eTRhm",flex_box_vertical_center:"flex_box_vertical_center___1jD6_",flex_box_center_end:"flex_box_center_end___3s_Sd",flex_box_column:"flex_box_column___11Wn_",form:"form___34z-w",btns:"btns___3O6K5",hackList:"hackList___2L3co",title:"title___2fVFF",subtitle:"subtitle___Ydv-g",efficiency:"efficiency___1wrjh"}},"y0+3":function(tn,Qe,I){"use strict";I.d(Qe,"a",function(){return b}),I.d(Qe,"b",function(){return f});var te=/margin|padding|width|height|max|min|offset/,Y={left:!0,top:!0},N={cssFloat:1,styleFloat:1,float:1};function K(d){return d.nodeType===1?d.ownerDocument.defaultView.getComputedStyle(d,null):{}}function A(d,s,r){if(s=s.toLowerCase(),r==="auto"){if(s==="height")return d.offsetHeight;if(s==="width")return d.offsetWidth}return s in Y||(Y[s]=te.test(s)),Y[s]?parseFloat(r)||0:r}function M(d,s){var r=arguments.length,u=K(d);return s=N[s]?"cssFloat"in d.style?"cssFloat":"styleFloat":s,r===1?u:A(d,s,u[s]||d.style[s])}function H(d,s,r){var u=arguments.length;if(s=N[s]?"cssFloat"in d.style?"cssFloat":"styleFloat":s,u===3)return typeof r=="number"&&te.test(s)&&(r="".concat(r,"px")),d.style[s]=r,r;for(var o in s)s.hasOwnProperty(o)&&H(d,o,s[o]);return K(d)}function P(d){return d===document.body?document.documentElement.clientWidth:d.offsetWidth}function k(d){return d===document.body?window.innerHeight||document.documentElement.clientHeight:d.offsetHeight}function D(){var d=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),s=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:d,height:s}}function b(){var d=document.documentElement.clientWidth,s=window.innerHeight||document.documentElement.clientHeight;return{width:d,height:s}}function m(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function f(d){var s=d.getBoundingClientRect(),r=document.documentElement;return{left:s.left+(window.pageXOffset||r.scrollLeft)-(r.clientLeft||document.body.clientLeft||0),top:s.top+(window.pageYOffset||r.scrollTop)-(r.clientTop||document.body.clientTop||0)}}},"yTi+":function(tn,Qe,I){tn.exports=I.p+"static/AssistantCode3.fdd8db3c.jpeg"},zetH:function(tn,Qe,I){tn.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"}},zlzj:function(tn,Qe,I){tn.exports=I.p+"static/b3.30079151.svg"}}]);
|