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.
448 lines
1.6 MiB
448 lines
1.6 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[110,3,5,7,8,13],{"+NIl":function(Ye,re,I){(function(Y){Y(I("VrN/"))})(function(Y){"use strict";Y.defineMode("stex",function(H,P){"use strict";function F(r,a){r.cmdState.push(a)}function R(r){return r.cmdState.length>0?r.cmdState[r.cmdState.length-1]:null}function O(r){var a=r.cmdState.pop();a&&a.closeBracket()}function D(r){for(var a=r.cmdState,s=a.length-1;s>=0;s--){var o=a[s];if(o.name=="DEFAULT")continue;return o}return{styleIdentifier:function(){return null}}}function m(r,a,s){return function(){this.name=r,this.bracketNo=0,this.style=a,this.styles=s,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var T={};T.importmodule=m("importmodule","tag",["string","builtin"]),T.documentclass=m("documentclass","tag",["","atom"]),T.usepackage=m("usepackage","tag",["atom"]),T.begin=m("begin","tag",["atom"]),T.end=m("end","tag",["atom"]),T.label=m("label","tag",["atom"]),T.ref=m("ref","tag",["atom"]),T.eqref=m("eqref","tag",["atom"]),T.cite=m("cite","tag",["atom"]),T.bibitem=m("bibitem","tag",["atom"]),T.Bibitem=m("Bibitem","tag",["atom"]),T.RBibitem=m("RBibitem","tag",["atom"]),T.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function b(r,a){r.f=a}function i(r,a){var s;if(r.match(/^\\[a-zA-Z@]+/)){var o=r.current().slice(1);return s=T.hasOwnProperty(o)?T[o]:T.DEFAULT,s=new s,F(a,s),b(a,c),s.style}if(r.match(/^\\[$&%#{}_]/))return"tag";if(r.match(/^\\[,;!\/\\]/))return"tag";if(r.match("\\["))return b(a,function(h,g){return d(h,g,"\\]")}),"keyword";if(r.match("\\("))return b(a,function(h,g){return d(h,g,"\\)")}),"keyword";if(r.match("$$"))return b(a,function(h,g){return d(h,g,"$$")}),"keyword";if(r.match("$"))return b(a,function(h,g){return d(h,g,"$")}),"keyword";var t=r.next();if(t=="%")return r.skipToEnd(),"comment";if(t=="}"||t=="]"){if(s=R(a),s)s.closeBracket(t),b(a,c);else return"error";return"bracket"}else return t=="{"||t=="["?(s=T.DEFAULT,s=new s,F(a,s),"bracket"):/\d/.test(t)?(r.eatWhile(/[\w.%]/),"atom"):(r.eatWhile(/[\w\-_]/),s=D(a),s.name=="begin"&&(s.argument=r.current()),s.styleIdentifier())}function d(r,a,s){if(r.eatSpace())return null;if(s&&r.match(s))return b(a,i),"keyword";if(r.match(/^\\[a-zA-Z@]+/))return"tag";if(r.match(/^[a-zA-Z]+/))return"variable-2";if(r.match(/^\\[$&%#{}_]/))return"tag";if(r.match(/^\\[,;!\/]/))return"tag";if(r.match(/^[\^_&]/))return"tag";if(r.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(r.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var o=r.next();return o=="{"||o=="}"||o=="["||o=="]"||o=="("||o==")"?"bracket":o=="%"?(r.skipToEnd(),"comment"):"error"}function c(r,a){var s=r.peek(),o;return s=="{"||s=="["?(o=R(a),o.openBracket(s),r.eat(s),b(a,i),"bracket"):/[ \t\r]/.test(s)?(r.eat(s),null):(b(a,i),O(a),i(r,a))}return{startState:function(){var r=P.inMathMode?function(a,s){return d(a,s)}:i;return{cmdState:[],f:r}},copyState:function(r){return{cmdState:r.cmdState.slice(),f:r.f}},token:function(r,a){return a.f(r,a)},blankLine:function(r){r.f=i,r.cmdState.length=0},lineComment:"%"}}),Y.defineMIME("text/x-stex","stex"),Y.defineMIME("text/x-latex","stex")})},"+ua5":function(Ye,re,I){},"06Qe":function(Ye,re,I){var Y=I("ItGF"),H="urn:schemas-microsoft-com:vml",P=typeof window=="undefined"?null:window,F=!1,R=P&&P.document;function O(T){return D(T)}var D;if(R&&!Y.canvasSupported)try{!R.namespaces.zrvml&&R.namespaces.add("zrvml",H),D=function(T){return R.createElement("<zrvml:"+T+' class="zrvml">')}}catch(T){D=function(b){return R.createElement("<"+b+' xmlns="'+H+'" class="zrvml">')}}function m(){if(F||!R)return;F=!0;var T=R.styleSheets;T.length<31?R.createStyleSheet().addRule(".zrvml","behavior:url(#default#VML)"):T[0].addRule(".zrvml","behavior:url(#default#VML)")}re.doc=R,re.createNode=O,re.initVML=m},"0s+r":function(Ye,re,I){var Y=I("bYtY"),H=I("QBsz"),P=I("y23F"),F=I("H6uX"),R=I("YH21"),O=I("C0SR"),D="silent";function m(s,o,t){return{type:s,event:t,target:o.target,topTarget:o.topTarget,cancelBubble:!1,offsetX:t.zrX,offsetY:t.zrY,gestureEvent:t.gestureEvent,pinchX:t.pinchX,pinchY:t.pinchY,pinchScale:t.pinchScale,wheelDelta:t.zrDelta,zrByTouch:t.zrByTouch,which:t.which,stop:T}}function T(){R.stop(this.event)}function b(){}b.prototype.dispose=function(){};var i=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],d=function(s,o,t,h){F.call(this),this.storage=s,this.painter=o,this.painterRoot=h,t=t||new b,this.proxy=null,this._hovered={},this._lastTouchMoment,this._lastX,this._lastY,this._gestureMgr,P.call(this),this.setHandlerProxy(t)};d.prototype={constructor:d,setHandlerProxy:function(s){this.proxy&&this.proxy.dispose(),s&&(Y.each(i,function(o){s.on&&s.on(o,this[o],this)},this),s.handler=this),this.proxy=s},mousemove:function(s){var o=s.zrX,t=s.zrY,h=r(this,o,t),g=this._hovered,C=g.target;C&&!C.__zr&&(g=this.findHover(g.x,g.y),C=g.target);var A=this._hovered=h?{x:o,y:t}:this.findHover(o,t),w=A.target,M=this.proxy;M.setCursor&&M.setCursor(w?w.cursor:"default"),C&&w!==C&&this.dispatchToElement(g,"mouseout",s),this.dispatchToElement(A,"mousemove",s),w&&w!==C&&this.dispatchToElement(A,"mouseover",s)},mouseout:function(s){var o=s.zrEventControl,t=s.zrIsToLocalDOM;o!=="only_globalout"&&this.dispatchToElement(this._hovered,"mouseout",s),o!=="no_globalout"&&(!t&&this.trigger("globalout",{type:"globalout",event:s}))},resize:function(s){this._hovered={}},dispatch:function(s,o){var t=this[s];t&&t.call(this,o)},dispose:function(){this.proxy.dispose(),this.storage=this.proxy=this.painter=null},setCursorStyle:function(s){var o=this.proxy;o.setCursor&&o.setCursor(s)},dispatchToElement:function(s,o,t){s=s||{};var h=s.target;if(h&&h.silent)return;for(var g="on"+o,C=m(o,s,t);h&&!(h[g]&&(C.cancelBubble=h[g].call(h,C)),h.trigger(o,C),h=h.parent,C.cancelBubble););C.cancelBubble||(this.trigger(o,C),this.painter&&this.painter.eachOtherLayer(function(A){typeof A[g]=="function"&&A[g].call(A,C),A.trigger&&A.trigger(o,C)}))},findHover:function(s,o,t){for(var h=this.storage.getDisplayList(),g={x:s,y:o},C=h.length-1;C>=0;C--){var A;if(h[C]!==t&&!h[C].ignore&&(A=c(h[C],s,o))&&(!g.topTarget&&(g.topTarget=h[C]),A!==D)){g.target=h[C];break}}return g},processGesture:function(s,o){this._gestureMgr||(this._gestureMgr=new O);var t=this._gestureMgr;o==="start"&&t.clear();var h=t.recognize(s,this.findHover(s.zrX,s.zrY,null).target,this.proxy.dom);if(o==="end"&&t.clear(),h){var g=h.type;s.gestureEvent=g,this.dispatchToElement({target:h.target},g,h.event)}}},Y.each(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(s){d.prototype[s]=function(o){var t=o.zrX,h=o.zrY,g=r(this,t,h),C,A;if((s!=="mouseup"||!g)&&(C=this.findHover(t,h),A=C.target),s==="mousedown")this._downEl=A,this._downPoint=[o.zrX,o.zrY],this._upEl=A;else if(s==="mouseup")this._upEl=A;else if(s==="click"){if(this._downEl!==this._upEl||!this._downPoint||H.dist(this._downPoint,[o.zrX,o.zrY])>4)return;this._downPoint=null}this.dispatchToElement(C,s,o)}});function c(s,o,t){if(s[s.rectHover?"rectContain":"contain"](o,t)){for(var h=s,g;h;){if(h.clipPath&&!h.clipPath.contain(o,t))return!1;h.silent&&(g=!0),h=h.parent}return g?D:!0}return!1}function r(s,o,t){var h=s.painter;return o<0||o>h.getWidth()||t<0||t>h.getHeight()}Y.mixin(d,F),Y.mixin(d,P);var a=d;Ye.exports=a},"19Vz":function(Ye,re,I){(function(Y){Y(I("VrN/"))})(function(Y){Y.defineOption("placeholder","",function(m,T,b){var i=b&&b!=Y.Init;if(T&&!i)m.on("blur",R),m.on("change",O),m.on("swapDoc",O),Y.on(m.getInputField(),"compositionupdate",m.state.placeholderCompose=function(){F(m)}),O(m);else if(!T&&i){m.off("blur",R),m.off("change",O),m.off("swapDoc",O),Y.off(m.getInputField(),"compositionupdate",m.state.placeholderCompose),H(m);var d=m.getWrapperElement();d.className=d.className.replace(" CodeMirror-empty","")}T&&!m.hasFocus()&&R(m)});function H(m){m.state.placeholder&&(m.state.placeholder.parentNode.removeChild(m.state.placeholder),m.state.placeholder=null)}function P(m){H(m);var T=m.state.placeholder=document.createElement("pre");T.style.cssText="height: 0; overflow: visible",T.style.direction=m.getOption("direction"),T.className="CodeMirror-placeholder CodeMirror-line-like";var b=m.getOption("placeholder");typeof b=="string"&&(b=document.createTextNode(b)),T.appendChild(b),m.display.lineSpace.insertBefore(T,m.display.lineSpace.firstChild)}function F(m){setTimeout(function(){var T=!1,b=m.getInputField();b.nodeName=="TEXTAREA"?T=!b.value:m.lineCount()==1&&(T=!/[^\u200b]/.test(b.querySelector(".CodeMirror-line").textContent)),T?P(m):H(m)},20)}function R(m){D(m)&&P(m)}function O(m){var T=m.getWrapperElement(),b=D(m);T.className=T.className.replace(" CodeMirror-empty","")+(b?" CodeMirror-empty":""),b?P(m):H(m)}function D(m){return m.lineCount()===1&&m.getLine(0)===""}})},"1Jh7":function(Ye,re,I){var Y=I("y+Vt"),H=I("T6xi"),P=Y.extend({type:"polyline",shape:{points:null,smooth:!1,smoothConstraint:null},style:{stroke:"#000",fill:null},buildPath:function(F,R){H.buildPath(F,R,!1)}});Ye.exports=P},"1MYJ":function(Ye,re,I){var Y=I("y+Vt"),H=Y.extend({type:"compound",shape:{paths:null},_updatePathDirty:function(){for(var P=this.__dirtyPath,F=this.shape.paths,R=0;R<F.length;R++)P=P||F[R].__dirtyPath;this.__dirtyPath=P,this.__dirty=this.__dirty||P},beforeBrush:function(){this._updatePathDirty();for(var P=this.shape.paths||[],F=this.getGlobalScale(),R=0;R<P.length;R++)P[R].path||P[R].createPathProxy(),P[R].path.setScale(F[0],F[1],P[R].segmentIgnoreThreshold)},buildPath:function(P,F){for(var R=F.paths||[],O=0;O<R.length;O++)R[O].buildPath(P,R[O].shape,!0)},afterBrush:function(){for(var P=this.shape.paths||[],F=0;F<P.length;F++)P[F].__dirtyPath=!1},getBoundingRect:function(){return this._updatePathDirty(),Y.prototype.getBoundingRect.call(this)}});Ye.exports=H},"1RvN":function(Ye,re){var I=function(){this.head=null,this.tail=null,this._len=0},Y=I.prototype;Y.insert=function(O){var D=new H(O);return this.insertEntry(D),D},Y.insertEntry=function(O){this.head?(this.tail.next=O,O.prev=this.tail,O.next=null,this.tail=O):this.head=this.tail=O,this._len++},Y.remove=function(O){var D=O.prev,m=O.next;D?D.next=m:this.head=m,m?m.prev=D:this.tail=D,O.next=O.prev=null,this._len--},Y.len=function(){return this._len},Y.clear=function(){this.head=this.tail=null,this._len=0};var H=function(O){this.value=O,this.next,this.prev},P=function(O){this._list=new I,this._map={},this._maxSize=O||10,this._lastRemovedEntry=null},F=P.prototype;F.put=function(O,D){var m=this._list,T=this._map,b=null;if(T[O]==null){var i=m.len(),d=this._lastRemovedEntry;if(i>=this._maxSize&&i>0){var c=m.head;m.remove(c),delete T[c.key],b=c.value,this._lastRemovedEntry=c}d?d.value=D:d=new H(D),d.key=O,m.insertEntry(d),T[O]=d}return b},F.get=function(O){var D=this._map[O],m=this._list;if(D!=null)return D!==m.tail&&(m.remove(D),m.insertEntry(D)),D.value},F.clear=function(){this._list.clear(),this._map={}};var R=P;Ye.exports=R},"1ZF9":function(Ye,re,I){Ye.exports=I.p+"static/Authorize.cc9c212f.png"},"1bdT":function(Ye,re,I){var Y=I("3gBT"),H=I("H6uX"),P=I("DN4a"),F=I("vWvF"),R=I("bYtY"),O=function(m){P.call(this,m),H.call(this,m),F.call(this,m),this.id=m.id||Y()};O.prototype={type:"element",name:"",__zr:null,ignore:!1,clipPath:null,isGroup:!1,drift:function(m,T){switch(this.draggable){case"horizontal":T=0;break;case"vertical":m=0;break}var b=this.transform;b||(b=this.transform=[1,0,0,1,0,0]),b[4]+=m,b[5]+=T,this.decomposeTransform(),this.dirty(!1)},beforeUpdate:function(){},afterUpdate:function(){},update:function(){this.updateTransform()},traverse:function(m,T){},attrKV:function(m,T){if(m==="position"||m==="scale"||m==="origin"){if(T){var b=this[m];b||(b=this[m]=[]),b[0]=T[0],b[1]=T[1]}}else this[m]=T},hide:function(){this.ignore=!0,this.__zr&&this.__zr.refresh()},show:function(){this.ignore=!1,this.__zr&&this.__zr.refresh()},attr:function(m,T){if(typeof m=="string")this.attrKV(m,T);else if(R.isObject(m))for(var b in m)m.hasOwnProperty(b)&&this.attrKV(b,m[b]);return this.dirty(!1),this},setClipPath:function(m){var T=this.__zr;T&&m.addSelfToZr(T),this.clipPath&&this.clipPath!==m&&this.removeClipPath(),this.clipPath=m,m.__zr=T,m.__clipTarget=this,this.dirty(!1)},removeClipPath:function(){var m=this.clipPath;m&&(m.__zr&&m.removeSelfFromZr(m.__zr),m.__zr=null,m.__clipTarget=null,this.clipPath=null,this.dirty(!1))},addSelfToZr:function(m){this.__zr=m;var T=this.animators;if(T)for(var b=0;b<T.length;b++)m.animation.addAnimator(T[b]);this.clipPath&&this.clipPath.addSelfToZr(m)},removeSelfFromZr:function(m){this.__zr=null;var T=this.animators;if(T)for(var b=0;b<T.length;b++)m.animation.removeAnimator(T[b]);this.clipPath&&this.clipPath.removeSelfFromZr(m)}},R.mixin(O,F),R.mixin(O,P),R.mixin(O,H);var D=O;Ye.exports=D},"1eCo":function(Ye,re,I){(function(Y){Y(I("VrN/"))})(function(Y){"use strict";var H={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},P={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};Y.defineMode("xml",function(F,R){var O=F.indentUnit,D={},m=R.htmlMode?H:P;for(var T in m)D[T]=m[T];for(var T in R)D[T]=R[T];var b,i;function d(f,_){function y(j){return _.tokenize=j,j(f,_)}var v=f.next();if(v=="<")return f.eat("!")?f.eat("[")?f.match("CDATA[")?y(a("atom","]]>")):null:f.match("--")?y(a("comment","-->")):f.match("DOCTYPE",!0,!0)?(f.eatWhile(/[\w\._\-]/),y(s(1))):null:f.eat("?")?(f.eatWhile(/[\w\._\-]/),_.tokenize=a("meta","?>"),"meta"):(b=f.eat("/")?"closeTag":"openTag",_.tokenize=c,"tag bracket");if(v=="&"){var N;return f.eat("#")?f.eat("x")?N=f.eatWhile(/[a-fA-F\d]/)&&f.eat(";"):N=f.eatWhile(/[\d]/)&&f.eat(";"):N=f.eatWhile(/[\w\.\-:]/)&&f.eat(";"),N?"atom":"error"}else return f.eatWhile(/[^&<]/),null}d.isInText=!0;function c(f,_){var y=f.next();if(y==">"||y=="/"&&f.eat(">"))return _.tokenize=d,b=y==">"?"endTag":"selfcloseTag","tag bracket";if(y=="=")return b="equals",null;if(y=="<"){_.tokenize=d,_.state=g,_.tagName=_.tagStart=null;var v=_.tokenize(f,_);return v?v+" tag error":"tag error"}else return/[\'\"]/.test(y)?(_.tokenize=r(y),_.stringStartCol=f.column(),_.tokenize(f,_)):(f.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function r(f){var _=function(y,v){for(;!y.eol();)if(y.next()==f){v.tokenize=c;break}return"string"};return _.isInAttribute=!0,_}function a(f,_){return function(y,v){for(;!y.eol();){if(y.match(_)){v.tokenize=d;break}y.next()}return f}}function s(f){return function(_,y){for(var v;(v=_.next())!=null;){if(v=="<")return y.tokenize=s(f+1),y.tokenize(_,y);if(v==">")if(f==1){y.tokenize=d;break}else return y.tokenize=s(f-1),y.tokenize(_,y)}return"meta"}}function o(f,_,y){this.prev=f.context,this.tagName=_,this.indent=f.indented,this.startOfLine=y,(D.doNotIndent.hasOwnProperty(_)||f.context&&f.context.noIndent)&&(this.noIndent=!0)}function t(f){f.context&&(f.context=f.context.prev)}function h(f,_){for(var y;;){if(!f.context)return;if(y=f.context.tagName,!D.contextGrabbers.hasOwnProperty(y)||!D.contextGrabbers[y].hasOwnProperty(_))return;t(f)}}function g(f,_,y){return f=="openTag"?(y.tagStart=_.column(),C):f=="closeTag"?A:g}function C(f,_,y){return f=="word"?(y.tagName=_.current(),i="tag",E):D.allowMissingTagName&&f=="endTag"?(i="tag bracket",E(f,_,y)):(i="error",C)}function A(f,_,y){if(f=="word"){var v=_.current();return y.context&&y.context.tagName!=v&&D.implicitlyClosed.hasOwnProperty(y.context.tagName)&&t(y),y.context&&y.context.tagName==v||D.matchClosing===!1?(i="tag",w):(i="tag error",M)}else return D.allowMissingTagName&&f=="endTag"?(i="tag bracket",w(f,_,y)):(i="error",M)}function w(f,_,y){return f!="endTag"?(i="error",w):(t(y),g)}function M(f,_,y){return i="error",w(f,_,y)}function E(f,_,y){if(f=="word")return i="attribute",p;if(f=="endTag"||f=="selfcloseTag"){var v=y.tagName,N=y.tagStart;return y.tagName=y.tagStart=null,f=="selfcloseTag"||D.autoSelfClosers.hasOwnProperty(v)?h(y,v):(h(y,v),y.context=new o(y,v,N==y.indented)),g}return i="error",E}function p(f,_,y){return f=="equals"?l:(D.allowMissing||(i="error"),E(f,_,y))}function l(f,_,y){return f=="string"?u:f=="word"&&D.allowUnquoted?(i="string",E):(i="error",E(f,_,y))}function u(f,_,y){return f=="string"?u:E(f,_,y)}return{startState:function(f){var _={tokenize:d,state:g,indented:f||0,tagName:null,tagStart:null,context:null};return f!=null&&(_.baseIndent=f),_},token:function(f,_){if(!_.tagName&&f.sol()&&(_.indented=f.indentation()),f.eatSpace())return null;b=null;var y=_.tokenize(f,_);return(y||b)&&y!="comment"&&(i=null,_.state=_.state(b||y,f,_),i&&(y=i=="error"?y+" error":i)),y},indent:function(f,_,y){var v=f.context;if(f.tokenize.isInAttribute)return f.tagStart==f.indented?f.stringStartCol+1:f.indented+O;if(v&&v.noIndent)return Y.Pass;if(f.tokenize!=c&&f.tokenize!=d)return y?y.match(/^(\s*)/)[0].length:0;if(f.tagName)return D.multilineTagIndentPastTag!==!1?f.tagStart+f.tagName.length+2:f.tagStart+O*(D.multilineTagIndentFactor||1);if(D.alignCDATA&&/<!\[CDATA\[/.test(_))return 0;var N=_&&/^<(\/)?([\w_:\.-]*)/.exec(_);if(N&&N[1])for(;v;)if(v.tagName==N[2]){v=v.prev;break}else if(D.implicitlyClosed.hasOwnProperty(v.tagName))v=v.prev;else break;else if(N)for(;v;){var j=D.contextGrabbers[v.tagName];if(j&&j.hasOwnProperty(N[2]))v=v.prev;else break}for(;v&&v.prev&&!v.startOfLine;)v=v.prev;return v?v.indent+O:f.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:D.htmlMode?"html":"xml",helperType:D.htmlMode?"html":"xml",skipAttribute:function(f){f.state==l&&(f.state=E)},xmlCurrentTag:function(f){return f.tagName?{name:f.tagName,close:f.type=="closeTag"}:null},xmlCurrentContext:function(f){for(var _=[],y=f.context;y;y=y.prev)y.tagName&&_.push(y.tagName);return _.reverse()}}}),Y.defineMIME("text/xml","xml"),Y.defineMIME("application/xml","xml"),Y.mimeModes.hasOwnProperty("text/html")||Y.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(Ye,re,I){"use strict";I.d(re,"d",function(){return Rt}),I.d(re,"b",function(){return Ce}),I.d(re,"c",function(){return yt}),I.d(re,"a",function(){return an});var Y=I("VTBJ"),H=I("1OyB"),P=I("vuIU"),F=I("JX7q"),R=I("Ji7U"),O=I("LK+K"),D=I("q1tI"),m=I("I8Z2"),T=I("BGR+"),b=I("wx14"),i=I("rePB"),d=I("4IlW"),c=I("2GS6"),r=I("Gytx"),a=I.n(r),s=I("TSYQ"),o=I.n(s),t=I("U8pU"),h=I("ODXe"),g=/iPhone/i,C=/iPod/i,A=/iPad/i,w=/\bAndroid(?:.+)Mobile\b/i,M=/Android/i,E=/\bAndroid(?:.+)SD4930UR\b/i,p=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,l=/Windows Phone/i,u=/\bWindows(?:.+)ARM\b/i,f=/BlackBerry/i,_=/BB10/i,y=/Opera Mini/i,v=/\b(CriOS|Chrome)(?:.+)Mobile/i,N=/Mobile(?:.+)Firefox\b/i;function j(Yt,St){return Yt.test(St)}function U(Yt){var St=Yt||(typeof navigator!="undefined"?navigator.userAgent:""),Ot=St.split("[FBAN");if(typeof Ot[1]!="undefined"){var dt=Ot,_e=Object(h.a)(dt,1);St=_e[0]}if(Ot=St.split("Twitter"),typeof Ot[1]!="undefined"){var je=Ot,kt=Object(h.a)(je,1);St=kt[0]}var gt={apple:{phone:j(g,St)&&!j(l,St),ipod:j(C,St),tablet:!j(g,St)&&j(A,St)&&!j(l,St),device:(j(g,St)||j(C,St)||j(A,St))&&!j(l,St)},amazon:{phone:j(E,St),tablet:!j(E,St)&&j(p,St),device:j(E,St)||j(p,St)},android:{phone:!j(l,St)&&j(E,St)||!j(l,St)&&j(w,St),tablet:!j(l,St)&&!j(E,St)&&!j(w,St)&&(j(p,St)||j(M,St)),device:!j(l,St)&&(j(E,St)||j(p,St)||j(w,St)||j(M,St))||j(/\bokhttp\b/i,St)},windows:{phone:j(l,St),tablet:j(u,St),device:j(l,St)||j(u,St)},other:{blackberry:j(f,St),blackberry10:j(_,St),opera:j(y,St),firefox:j(N,St),chrome:j(v,St),device:j(f,St)||j(_,St)||j(y,St)||j(N,St)||j(v,St)},any:null,phone:null,tablet:null};return gt.any=gt.apple.device||gt.android.device||gt.windows.device||gt.other.device,gt.phone=gt.apple.phone||gt.android.phone||gt.windows.phone,gt.tablet=gt.apple.tablet||gt.android.tablet||gt.windows.tablet,gt}var G=Object(Y.a)(Object(Y.a)({},U()),{},{isMobile:U}),z=G;function L(){}function V(Yt,St,Ot){var dt=St||"";return Yt.key||"".concat(dt,"item_").concat(Ot)}function W(Yt){return"".concat(Yt,"-menu-")}function $(Yt,St){var Ot=-1;D.Children.forEach(Yt,function(dt){Ot+=1,dt&&dt.type&&dt.type.isMenuItemGroup?D.Children.forEach(dt.props.children,function(_e){Ot+=1,St(_e,Ot)}):St(dt,Ot)})}function q(Yt,St,Ot){if(!Yt||Ot.find)return;D.Children.forEach(Yt,function(dt){if(dt){var _e=dt.type;if(!_e||!(_e.isSubMenu||_e.isMenuItem||_e.isMenuItemGroup))return;St.indexOf(dt.key)!==-1?Ot.find=!0:dt.props.children&&q(dt.props.children,St,Ot)}})}var fe=["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"],se=function(St){var Ot=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,dt=St&&typeof St.getBoundingClientRect=="function"&&St.getBoundingClientRect().width;if(dt){if(Ot){var _e=getComputedStyle(St),je=_e.marginLeft,kt=_e.marginRight;dt+=+je.replace("px","")+ +kt.replace("px","")}dt=+dt.toFixed(6)}return dt||0},me=function(St,Ot,dt){St&&Object(t.a)(St.style)==="object"&&(St.style[Ot]=dt)},ve=function(){return z.any},Ae=I("KQm4"),ge=I("Ff2n"),ue=I("i8i4"),$e=I("bdgK"),Tt=I("uciX"),ye=I("8XRh"),Re={adjustX:1,adjustY:1},nt={topLeft:{points:["bl","tl"],overflow:Re,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Re,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:Re,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:Re,offset:[4,0]}},Ue={topLeft:{points:["bl","tl"],overflow:Re,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Re,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:Re,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:Re,offset:[4,0]}},ke=nt,lt=0,Fe={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Ze=function(St,Ot,dt){var _e=W(Ot),je=St.getState();St.setState({defaultActiveFirst:Object(Y.a)(Object(Y.a)({},je.defaultActiveFirst),{},Object(i.a)({},_e,dt))})},Xe=function(Yt){Object(R.a)(Ot,Yt);var St=Object(O.a)(Ot);function Ot(dt){var _e;Object(H.a)(this,Ot),_e=St.call(this,dt),_e.onDestroy=function(De){_e.props.onDestroy(De)},_e.onKeyDown=function(De){var qe=De.keyCode,jt=_e.menuInstance,Zt=_e.props,gn=Zt.isOpen,On=Zt.store;if(qe===d.a.ENTER)return _e.onTitleClick(De),Ze(On,_e.props.eventKey,!0),!0;if(qe===d.a.RIGHT)return gn?jt.onKeyDown(De):(_e.triggerOpenChange(!0),Ze(On,_e.props.eventKey,!0)),!0;if(qe===d.a.LEFT){var ur;if(gn)ur=jt.onKeyDown(De);else return;return ur||(_e.triggerOpenChange(!1),ur=!0),ur}return gn&&(qe===d.a.UP||qe===d.a.DOWN)?jt.onKeyDown(De):void 0},_e.onOpenChange=function(De){_e.props.onOpenChange(De)},_e.onPopupVisibleChange=function(De){_e.triggerOpenChange(De,De?"mouseenter":"mouseleave")},_e.onMouseEnter=function(De){var qe=_e.props,jt=qe.eventKey,Zt=qe.onMouseEnter,gn=qe.store;Ze(gn,_e.props.eventKey,!1),Zt({key:jt,domEvent:De})},_e.onMouseLeave=function(De){var qe=_e.props,jt=qe.parentMenu,Zt=qe.eventKey,gn=qe.onMouseLeave;jt.subMenuInstance=Object(F.a)(_e),gn({key:Zt,domEvent:De})},_e.onTitleMouseEnter=function(De){var qe=_e.props,jt=qe.eventKey,Zt=qe.onItemHover,gn=qe.onTitleMouseEnter;Zt({key:jt,hover:!0}),gn({key:jt,domEvent:De})},_e.onTitleMouseLeave=function(De){var qe=_e.props,jt=qe.parentMenu,Zt=qe.eventKey,gn=qe.onItemHover,On=qe.onTitleMouseLeave;jt.subMenuInstance=Object(F.a)(_e),gn({key:Zt,hover:!1}),On({key:Zt,domEvent:De})},_e.onTitleClick=function(De){var qe=Object(F.a)(_e),jt=qe.props;if(jt.onTitleClick({key:jt.eventKey,domEvent:De}),jt.triggerSubMenuAction==="hover")return;_e.triggerOpenChange(!jt.isOpen,"click"),Ze(jt.store,_e.props.eventKey,!1)},_e.onSubMenuClick=function(De){typeof _e.props.onClick=="function"&&_e.props.onClick(_e.addKeyPath(De))},_e.onSelect=function(De){_e.props.onSelect(De)},_e.onDeselect=function(De){_e.props.onDeselect(De)},_e.getPrefixCls=function(){return"".concat(_e.props.rootPrefixCls,"-submenu")},_e.getActiveClassName=function(){return"".concat(_e.getPrefixCls(),"-active")},_e.getDisabledClassName=function(){return"".concat(_e.getPrefixCls(),"-disabled")},_e.getSelectedClassName=function(){return"".concat(_e.getPrefixCls(),"-selected")},_e.getOpenClassName=function(){return"".concat(_e.props.rootPrefixCls,"-submenu-open")},_e.saveMenuInstance=function(De){_e.menuInstance=De},_e.addKeyPath=function(De){return Object(Y.a)(Object(Y.a)({},De),{},{keyPath:(De.keyPath||[]).concat(_e.props.eventKey)})},_e.triggerOpenChange=function(De,qe){var jt=_e.props.eventKey,Zt=function(){_e.onOpenChange({key:jt,item:Object(F.a)(_e),trigger:qe,open:De})};qe==="mouseenter"?_e.mouseenterTimeout=setTimeout(function(){Zt()},0):Zt()},_e.isChildrenSelected=function(){var De={find:!1};return q(_e.props.children,_e.props.selectedKeys,De),De.find},_e.isOpen=function(){return _e.props.openKeys.indexOf(_e.props.eventKey)!==-1},_e.adjustWidth=function(){if(!_e.subMenuTitle||!_e.menuInstance)return;var De=ue.findDOMNode(_e.menuInstance);if(De.offsetWidth>=_e.subMenuTitle.offsetWidth)return;De.style.minWidth="".concat(_e.subMenuTitle.offsetWidth,"px")},_e.saveSubMenuTitle=function(De){_e.subMenuTitle=De},_e.getBaseProps=function(){var De=Object(F.a)(_e),qe=De.props;return{mode:qe.mode==="horizontal"?"vertical":qe.mode,visible:_e.props.isOpen,level:qe.level+1,inlineIndent:qe.inlineIndent,focusable:!1,onClick:_e.onSubMenuClick,onSelect:_e.onSelect,onDeselect:_e.onDeselect,onDestroy:_e.onDestroy,selectedKeys:qe.selectedKeys,eventKey:"".concat(qe.eventKey,"-menu-"),openKeys:qe.openKeys,motion:qe.motion,onOpenChange:_e.onOpenChange,subMenuOpenDelay:qe.subMenuOpenDelay,parentMenu:Object(F.a)(_e),subMenuCloseDelay:qe.subMenuCloseDelay,forceSubMenuRender:qe.forceSubMenuRender,triggerSubMenuAction:qe.triggerSubMenuAction,builtinPlacements:qe.builtinPlacements,defaultActiveFirst:qe.store.getState().defaultActiveFirst[W(qe.eventKey)],multiple:qe.multiple,prefixCls:qe.rootPrefixCls,id:_e.internalMenuId,manualRef:_e.saveMenuInstance,itemIcon:qe.itemIcon,expandIcon:qe.expandIcon,direction:qe.direction}},_e.getMotion=function(De,qe){var jt=Object(F.a)(_e),Zt=jt.haveRendered,gn=_e.props,On=gn.motion,ur=gn.rootPrefixCls,Kn=Object(Y.a)(Object(Y.a)({},On),{},{leavedClassName:"".concat(ur,"-hidden"),removeOnLeave:!1,motionAppear:Zt||!qe||De!=="inline"});return Kn};var je=dt.store,kt=dt.eventKey,gt=je.getState(),zt=gt.defaultActiveFirst;_e.isRootMenu=!1;var $t=!1;return zt&&($t=zt[kt]),Ze(je,kt,$t),_e}return Object(P.a)(Ot,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var _e=this,je=this.props,kt=je.mode,gt=je.parentMenu,zt=je.manualRef;if(zt&&zt(this),kt!=="horizontal"||!gt.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return _e.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var _e=this.props,je=_e.onDestroy,kt=_e.eventKey;je&&je(kt),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(_e){var je=this,kt=this.getBaseProps(),gt=this.getMotion(kt.mode,kt.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||kt.visible||kt.forceSubMenuRender,!this.haveOpened)return D.createElement("div",null);var zt=kt.direction;return D.createElement(ye.default,Object.assign({visible:kt.visible},gt),function($t){var De=$t.className,qe=$t.style,jt=o()("".concat(kt.prefixCls,"-sub"),De,Object(i.a)({},"".concat(kt.prefixCls,"-rtl"),zt==="rtl"));return D.createElement(Pe,Object.assign({},kt,{id:je.internalMenuId,className:jt,style:qe}),_e)})}},{key:"render",value:function(){var _e,je=Object(Y.a)({},this.props),kt=je.isOpen,gt=this.getPrefixCls(),zt=je.mode==="inline",$t=o()(gt,"".concat(gt,"-").concat(je.mode),(_e={},Object(i.a)(_e,je.className,!!je.className),Object(i.a)(_e,this.getOpenClassName(),kt),Object(i.a)(_e,this.getActiveClassName(),je.active||kt&&!zt),Object(i.a)(_e,this.getDisabledClassName(),je.disabled),Object(i.a)(_e,this.getSelectedClassName(),this.isChildrenSelected()),_e));this.internalMenuId||(je.eventKey?this.internalMenuId="".concat(je.eventKey,"$Menu"):(lt+=1,this.internalMenuId="$__$".concat(lt,"$Menu")));var De={},qe={},jt={};je.disabled||(De={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},qe={onClick:this.onTitleClick},jt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Zt={},gn=je.direction;zt&&(gn==="rtl"?Zt.paddingRight=je.inlineIndent*je.level:Zt.paddingLeft=je.inlineIndent*je.level);var On={};this.props.isOpen&&(On={"aria-owns":this.internalMenuId});var ur=null;je.mode!=="horizontal"&&(ur=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(ur=D.createElement(this.props.expandIcon,Object(Y.a)({},this.props))));var Kn=D.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:Zt,className:"".concat(gt,"-title"),role:"button"},jt,qe,{"aria-expanded":kt},On,{"aria-haspopup":"true",title:typeof je.title=="string"?je.title:void 0}),je.title,ur||D.createElement("i",{className:"".concat(gt,"-arrow")})),wn=this.renderChildren(je.children),xr=je.parentMenu.isRootMenu?je.parentMenu.props.getPopupContainer:function(Qr){return Qr.parentNode},Fr=Fe[je.mode],hr=je.popupOffset?{offset:je.popupOffset}:{},dr=je.mode==="inline"?"":je.popupClassName;dr+=gn==="rtl"?" ".concat(gt,"-rtl"):"";var Nr=je.disabled,ti=je.triggerSubMenuAction,pi=je.subMenuOpenDelay,fn=je.forceSubMenuRender,ar=je.subMenuCloseDelay,oi=je.builtinPlacements;fe.forEach(function(Qr){return delete je[Qr]}),delete je.onClick;var _i=gn==="rtl"?Object.assign({},Ue,oi):Object.assign({},nt,oi);return delete je.direction,D.createElement("li",Object.assign({},je,De,{className:$t,role:"menuitem"}),zt&&Kn,zt&&wn,!zt&&D.createElement(Tt.a,{prefixCls:gt,popupClassName:o()("".concat(gt,"-popup"),dr),getPopupContainer:xr,builtinPlacements:_i,popupPlacement:Fr,popupVisible:kt,popupAlign:hr,popup:wn,action:Nr?[]:[ti],mouseEnterDelay:pi,mouseLeaveDelay:ar,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:fn},Kn))}}]),Ot}(D.Component);Xe.defaultProps={onMouseEnter:L,onMouseLeave:L,onTitleMouseEnter:L,onTitleMouseLeave:L,onTitleClick:L,manualRef:L,mode:"vertical",title:""};var ft=Object(m.b)(function(Yt,St){var Ot=Yt.openKeys,dt=Yt.activeKey,_e=Yt.selectedKeys,je=St.eventKey,kt=St.subMenuKey;return{isOpen:Ot.indexOf(je)>-1,active:dt[kt]===je,selectedKeys:_e}})(Xe);ft.isSubMenu=!0;var Rt=ft,Pt="menuitem-overflowed",Bt=.5,Ve=function(Yt){Object(R.a)(Ot,Yt);var St=Object(O.a)(Ot);function Ot(){var dt;return Object(H.a)(this,Ot),dt=St.apply(this,arguments),dt.resizeObserver=null,dt.mutationObserver=null,dt.originalTotalWidth=0,dt.overflowedItems=[],dt.menuItemSizes=[],dt.cancelFrameId=null,dt.state={lastVisibleIndex:void 0},dt.getMenuItemNodes=function(){var _e=dt.props.prefixCls,je=ue.findDOMNode(Object(F.a)(dt));return je?[].slice.call(je.children).filter(function(kt){return kt.className.split(" ").indexOf("".concat(_e,"-overflowed-submenu"))<0}):[]},dt.getOverflowedSubMenuItem=function(_e,je,kt){var gt=dt.props,zt=gt.overflowedIndicator,$t=gt.level,De=gt.mode,qe=gt.prefixCls,jt=gt.theme;if($t!==1||De!=="horizontal")return null;var Zt=dt.props.children[0],gn=Zt.props,On=gn.children,ur=gn.title,Kn=gn.style,wn=Object(ge.a)(gn,["children","title","style"]),xr=Object(Y.a)({},Kn),Fr="".concat(_e,"-overflowed-indicator"),hr="".concat(_e,"-overflowed-indicator");je.length===0&&kt!==!0?xr=Object(Y.a)(Object(Y.a)({},xr),{},{display:"none"}):kt&&(xr=Object(Y.a)(Object(Y.a)({},xr),{},{visibility:"hidden",position:"absolute"}),Fr="".concat(Fr,"-placeholder"),hr="".concat(hr,"-placeholder"));var dr=jt?"".concat(qe,"-").concat(jt):"",Nr={};return fe.forEach(function(ti){wn[ti]!==void 0&&(Nr[ti]=wn[ti])}),D.createElement(Rt,Object.assign({title:zt,className:"".concat(qe,"-overflowed-submenu"),popupClassName:dr},Nr,{key:Fr,eventKey:hr,disabled:!1,style:xr}),je)},dt.setChildrenWidthAndResize=function(){if(dt.props.mode!=="horizontal")return;var _e=ue.findDOMNode(Object(F.a)(dt));if(!_e)return;var je=_e.children;if(!je||je.length===0)return;var kt=_e.children[je.length-1];me(kt,"display","inline-block");var gt=dt.getMenuItemNodes(),zt=gt.filter(function($t){return $t.className.split(" ").indexOf(Pt)>=0});zt.forEach(function($t){me($t,"display","inline-block")}),dt.menuItemSizes=gt.map(function($t){return se($t,!0)}),zt.forEach(function($t){me($t,"display","none")}),dt.overflowedIndicatorWidth=se(_e.children[_e.children.length-1],!0),dt.originalTotalWidth=dt.menuItemSizes.reduce(function($t,De){return $t+De},0),dt.handleResize(),me(kt,"display","none")},dt.handleResize=function(){if(dt.props.mode!=="horizontal")return;var _e=ue.findDOMNode(Object(F.a)(dt));if(!_e)return;var je=se(_e);dt.overflowedItems=[];var kt=0,gt;dt.originalTotalWidth>je+Bt&&(gt=-1,dt.menuItemSizes.forEach(function(zt){kt+=zt,kt+dt.overflowedIndicatorWidth<=je&&(gt+=1)})),dt.setState({lastVisibleIndex:gt})},dt}return Object(P.a)(Ot,[{key:"componentDidMount",value:function(){var _e=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var je=ue.findDOMNode(this);if(!je)return;this.resizeObserver=new $e.default(function(kt){kt.forEach(function(){var gt=_e.cancelFrameId;cancelAnimationFrame(gt),_e.cancelFrameId=requestAnimationFrame(_e.setChildrenWidthAndResize)})}),[].slice.call(je.children).concat(je).forEach(function(kt){_e.resizeObserver.observe(kt)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){_e.resizeObserver.disconnect(),[].slice.call(je.children).concat(je).forEach(function(kt){_e.resizeObserver.observe(kt)}),_e.setChildrenWidthAndResize()}),this.mutationObserver.observe(je,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(_e){var je=this,kt=this.state.lastVisibleIndex;return(_e||[]).reduce(function(gt,zt,$t){var De=zt;if(je.props.mode==="horizontal"){var qe=je.getOverflowedSubMenuItem(zt.props.eventKey,[]);kt!==void 0&&je.props.className.indexOf("".concat(je.props.prefixCls,"-root"))!==-1&&($t>kt&&(De=D.cloneElement(zt,{style:{display:"none"},eventKey:"".concat(zt.props.eventKey,"-hidden"),className:"".concat(Pt)})),$t===kt+1&&(je.overflowedItems=_e.slice(kt+1).map(function(Zt){return D.cloneElement(Zt,{key:Zt.props.eventKey,mode:"vertical-left"})}),qe=je.getOverflowedSubMenuItem(zt.props.eventKey,je.overflowedItems)));var jt=[].concat(Object(Ae.a)(gt),[qe,De]);return $t===_e.length-1&&jt.push(je.getOverflowedSubMenuItem(zt.props.eventKey,[],!0)),jt}return[].concat(Object(Ae.a)(gt),[De])},[])}},{key:"render",value:function(){var _e=this.props,je=_e.visible,kt=_e.prefixCls,gt=_e.overflowedIndicator,zt=_e.mode,$t=_e.level,De=_e.tag,qe=_e.children,jt=_e.theme,Zt=Object(ge.a)(_e,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),gn=De;return D.createElement(gn,Object.assign({},Zt),this.renderChildren(qe))}}]),Ot}(D.Component);Ve.defaultProps={tag:"div",className:""};var Ft=Ve;function nn(Yt){return Yt.length?Yt.every(function(St){return!!St.props.disabled}):!0}function Le(Yt,St,Ot){var dt=Yt.getState();Yt.setState({activeKey:Object(Y.a)(Object(Y.a)({},dt.activeKey),{},Object(i.a)({},St,Ot))})}function Se(Yt){return Yt.eventKey||"0-menu-"}function ut(Yt,St){var Ot=St,dt=Yt.children,_e=Yt.eventKey;if(Ot){var je;if($(dt,function(kt,gt){kt&&kt.props&&!kt.props.disabled&&Ot===V(kt,_e,gt)&&(je=!0)}),je)return Ot}return Ot=null,Yt.defaultActiveFirst&&$(dt,function(kt,gt){!Ot&&kt&&!kt.props.disabled&&(Ot=V(kt,_e,gt))}),Ot}function mt(Yt){if(Yt){var St=this.instanceArray.indexOf(Yt);St!==-1?this.instanceArray[St]=Yt:this.instanceArray.push(Yt)}}var We=function(Yt){Object(R.a)(Ot,Yt);var St=Object(O.a)(Ot);function Ot(dt){var _e;return Object(H.a)(this,Ot),_e=St.call(this,dt),_e.onKeyDown=function(je,kt){var gt=je.keyCode,zt;if(_e.getFlatInstanceArray().forEach(function(De){De&&De.props.active&&De.onKeyDown&&(zt=De.onKeyDown(je))}),zt)return 1;var $t=null;return(gt===d.a.UP||gt===d.a.DOWN)&&($t=_e.step(gt===d.a.UP?-1:1)),$t?(je.preventDefault(),Le(_e.props.store,Se(_e.props),$t.props.eventKey),typeof kt=="function"&&kt($t),1):void 0},_e.onItemHover=function(je){var kt=je.key,gt=je.hover;Le(_e.props.store,Se(_e.props),gt?kt:null)},_e.onDeselect=function(je){_e.props.onDeselect(je)},_e.onSelect=function(je){_e.props.onSelect(je)},_e.onClick=function(je){_e.props.onClick(je)},_e.onOpenChange=function(je){_e.props.onOpenChange(je)},_e.onDestroy=function(je){_e.props.onDestroy(je)},_e.getFlatInstanceArray=function(){return _e.instanceArray},_e.step=function(je){var kt=_e.getFlatInstanceArray(),gt=_e.props.store.getState().activeKey[Se(_e.props)],zt=kt.length;if(!zt)return null;je<0&&(kt=kt.concat().reverse());var $t=-1;if(kt.every(function(Zt,gn){return Zt&&Zt.props.eventKey===gt?($t=gn,!1):!0}),!_e.props.defaultActiveFirst&&$t!==-1&&nn(kt.slice($t,zt-1)))return;var De=($t+1)%zt,qe=De;do{var jt=kt[qe];if(!jt||jt.props.disabled)qe=(qe+1)%zt;else return jt}while(qe!==De);return null},_e.renderCommonMenuItem=function(je,kt,gt){var zt=_e.props.store.getState(),$t=Object(F.a)(_e),De=$t.props,qe=V(je,De.eventKey,kt),jt=je.props;if(!jt||typeof je.type=="string")return je;var Zt=qe===zt.activeKey,gn=Object(Y.a)(Object(Y.a)({mode:jt.mode||De.mode,level:De.level,inlineIndent:De.inlineIndent,renderMenuItem:_e.renderMenuItem,rootPrefixCls:De.prefixCls,index:kt,parentMenu:De.parentMenu,manualRef:jt.disabled?void 0:Object(c.a)(je.ref,mt.bind(Object(F.a)(_e))),eventKey:qe,active:!jt.disabled&&Zt,multiple:De.multiple,onClick:function(ur){(jt.onClick||L)(ur),_e.onClick(ur)},onItemHover:_e.onItemHover,motion:De.motion,subMenuOpenDelay:De.subMenuOpenDelay,subMenuCloseDelay:De.subMenuCloseDelay,forceSubMenuRender:De.forceSubMenuRender,onOpenChange:_e.onOpenChange,onDeselect:_e.onDeselect,onSelect:_e.onSelect,builtinPlacements:De.builtinPlacements,itemIcon:jt.itemIcon||_e.props.itemIcon,expandIcon:jt.expandIcon||_e.props.expandIcon},gt),{},{direction:De.direction});return(De.mode==="inline"||ve())&&(gn.triggerSubMenuAction="click"),D.cloneElement(je,gn)},_e.renderMenuItem=function(je,kt,gt){if(!je)return null;var zt=_e.props.store.getState(),$t={openKeys:zt.openKeys,selectedKeys:zt.selectedKeys,triggerSubMenuAction:_e.props.triggerSubMenuAction,subMenuKey:gt};return _e.renderCommonMenuItem(je,kt,$t)},dt.store.setState({activeKey:Object(Y.a)(Object(Y.a)({},dt.store.getState().activeKey),{},Object(i.a)({},dt.eventKey,ut(dt,dt.activeKey)))}),_e.instanceArray=[],_e}return Object(P.a)(Ot,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(_e){return this.props.visible||_e.visible||this.props.className!==_e.className||!a()(this.props.style,_e.style)}},{key:"componentDidUpdate",value:function(_e){var je=this.props,kt="activeKey"in je?je.activeKey:je.store.getState().activeKey[Se(je)],gt=ut(je,kt);if(gt!==kt)Le(je.store,Se(je),gt);else if("activeKey"in _e){var zt=ut(_e,_e.activeKey);gt!==zt&&Le(je.store,Se(je),gt)}}},{key:"render",value:function(){var _e=this,je=Object(b.a)({},this.props);this.instanceArray=[];var kt=o()(je.prefixCls,je.className,"".concat(je.prefixCls,"-").concat(je.mode)),gt={className:kt,role:je.role||"menu"};je.id&&(gt.id=je.id),je.focusable&&(gt.tabIndex=0,gt.onKeyDown=this.onKeyDown);var zt=je.prefixCls,$t=je.eventKey,De=je.visible,qe=je.level,jt=je.mode,Zt=je.overflowedIndicator,gn=je.theme;return fe.forEach(function(On){return delete je[On]}),delete je.onClick,D.createElement(Ft,Object.assign({},je,{prefixCls:zt,mode:jt,tag:"ul",level:qe,theme:gn,visible:De,overflowedIndicator:Zt},gt),D.Children.map(je.children,function(On,ur){return _e.renderMenuItem(On,ur,$t||"0-menu-")}))}}]),Ot}(D.Component);We.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:L};var vt=Object(m.b)()(We),Pe=vt,xe=I("Kwbf");function we(Yt,St,Ot){var dt=Yt.prefixCls,_e=Yt.motion,je=Yt.defaultMotions,kt=je===void 0?{}:je,gt=Yt.openAnimation,zt=Yt.openTransitionName,$t=St.switchingModeFromInline;if(_e)return _e;if(Object(t.a)(gt)==="object"&>)Object(xe.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof gt=="string")return{motionName:"".concat(dt,"-open-").concat(gt)};if(zt)return{motionName:zt};var De=kt[Ot];return De||($t?null:kt.other)}var ie=function(Yt){Object(R.a)(Ot,Yt);var St=Object(O.a)(Ot);function Ot(dt){var _e;Object(H.a)(this,Ot),_e=St.call(this,dt),_e.inlineOpenKeys=[],_e.onSelect=function(gt){var zt=Object(F.a)(_e),$t=zt.props;if($t.selectable){var De=_e.store.getState(),qe=De.selectedKeys,jt=gt.key;$t.multiple?qe=qe.concat([jt]):qe=[jt],"selectedKeys"in $t||_e.store.setState({selectedKeys:qe}),$t.onSelect(Object(Y.a)(Object(Y.a)({},gt),{},{selectedKeys:qe}))}},_e.onClick=function(gt){var zt=_e.getRealMenuMode(),$t=Object(F.a)(_e),De=$t.store,qe=$t.props.onOpenChange;zt!=="inline"&&!("openKeys"in _e.props)&&(De.setState({openKeys:[]}),qe([])),_e.props.onClick(gt)},_e.onKeyDown=function(gt,zt){_e.innerMenu.getWrappedInstance().onKeyDown(gt,zt)},_e.onOpenChange=function(gt){var zt=Object(F.a)(_e),$t=zt.props,De=_e.store.getState().openKeys.concat(),qe=!1,jt=function(gn){var On=!1;if(gn.open)On=De.indexOf(gn.key)===-1,On&&De.push(gn.key);else{var ur=De.indexOf(gn.key);On=ur!==-1,On&&De.splice(ur,1)}qe=qe||On};Array.isArray(gt)?gt.forEach(jt):jt(gt),qe&&("openKeys"in _e.props||_e.store.setState({openKeys:De}),$t.onOpenChange(De))},_e.onDeselect=function(gt){var zt=Object(F.a)(_e),$t=zt.props;if($t.selectable){var De=_e.store.getState().selectedKeys.concat(),qe=gt.key,jt=De.indexOf(qe);jt!==-1&&De.splice(jt,1),"selectedKeys"in $t||_e.store.setState({selectedKeys:De}),$t.onDeselect(Object(Y.a)(Object(Y.a)({},gt),{},{selectedKeys:De}))}},_e.onMouseEnter=function(gt){_e.restoreModeVerticalFromInline();var zt=_e.props.onMouseEnter;zt&&zt(gt)},_e.onTransitionEnd=function(gt){var zt=gt.propertyName==="width"&>.target===gt.currentTarget,$t=gt.target.className,De=Object.prototype.toString.call($t)==="[object SVGAnimatedString]"?$t.animVal:$t,qe=gt.propertyName==="font-size"&&De.indexOf("anticon")>=0;(zt||qe)&&_e.restoreModeVerticalFromInline()},_e.setInnerMenu=function(gt){_e.innerMenu=gt},_e.isRootMenu=!0;var je=dt.defaultSelectedKeys,kt=dt.defaultOpenKeys;return"selectedKeys"in dt&&(je=dt.selectedKeys||[]),"openKeys"in dt&&(kt=dt.openKeys||[]),_e.store=Object(m.c)({selectedKeys:je,openKeys:kt,activeKey:{"0-menu-":ut(dt,dt.activeKey)}}),_e.state={switchingModeFromInline:!1},_e}return Object(P.a)(Ot,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(_e){this.updateOpentKeysWhenSwitchMode(_e),this.updateMiniStore();var je=this.props,kt=je.siderCollapsed,gt=je.inlineCollapsed,zt=je.onOpenChange;(!_e.inlineCollapsed&>||!_e.siderCollapsed&&kt)&&zt([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(_e){var je=this.props,kt=this.store,gt=this.inlineOpenKeys,zt=kt.getState(),$t={};_e.mode==="inline"&&je.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in je||((je.inlineCollapsed&&!_e.inlineCollapsed||je.siderCollapsed&&!_e.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=zt.openKeys.concat(),$t.openKeys=[]),(!je.inlineCollapsed&&_e.inlineCollapsed||!je.siderCollapsed&&_e.siderCollapsed)&&($t.openKeys=gt,this.inlineOpenKeys=[])),Object.keys($t).length&&kt.setState($t)}},{key:"updateMenuDisplay",value:function(){var _e=this.props.collapsedWidth,je=this.store,kt=this.prevOpenKeys,gt=this.getInlineCollapsed()&&(_e===0||_e==="0"||_e==="0px");gt?(this.prevOpenKeys=je.getState().openKeys.concat(),this.store.setState({openKeys:[]})):kt&&(this.store.setState({openKeys:kt}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var _e=this.props.mode,je=this.state.switchingModeFromInline,kt=this.getInlineCollapsed();return je&&kt?"inline":kt?"vertical":_e}},{key:"getInlineCollapsed",value:function(){var _e=this.props,je=_e.inlineCollapsed,kt=_e.siderCollapsed;return kt!==void 0?kt:je}},{key:"restoreModeVerticalFromInline",value:function(){var _e=this.state.switchingModeFromInline;_e&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var _e=Object(Y.a)({},Object(T.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),je=this.getRealMenuMode();return _e.className+=" ".concat(_e.prefixCls,"-root"),_e.direction==="rtl"&&(_e.className+=" ".concat(_e.prefixCls,"-rtl")),_e=Object(Y.a)(Object(Y.a)({},_e),{},{mode:je,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:we(this.props,this.state,je)}),delete _e.openAnimation,delete _e.openTransitionName,D.createElement(m.a,{store:this.store},D.createElement(Pe,Object.assign({},_e,{ref:this.setInnerMenu}),this.props.children))}}]),Ot}(D.Component);ie.defaultProps={selectable:!0,onClick:L,onSelect:L,onOpenChange:L,onDeselect:L,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:D.createElement("span",null,"\xB7\xB7\xB7")};var ae=ie,ce=function(Yt){Object(R.a)(Ot,Yt);var St=Object(O.a)(Ot);function Ot(){var dt;return Object(H.a)(this,Ot),dt=St.apply(this,arguments),dt.onKeyDown=function(_e){var je=_e.keyCode;return je===d.a.ENTER?(dt.onClick(_e),!0):void 0},dt.onMouseLeave=function(_e){var je=dt.props,kt=je.eventKey,gt=je.onItemHover,zt=je.onMouseLeave;gt({key:kt,hover:!1}),zt({key:kt,domEvent:_e})},dt.onMouseEnter=function(_e){var je=dt.props,kt=je.eventKey,gt=je.onItemHover,zt=je.onMouseEnter;gt({key:kt,hover:!0}),zt({key:kt,domEvent:_e})},dt.onClick=function(_e){var je=dt.props,kt=je.eventKey,gt=je.multiple,zt=je.onClick,$t=je.onSelect,De=je.onDeselect,qe=je.isSelected,jt={key:kt,keyPath:[kt],item:Object(F.a)(dt),domEvent:_e};zt(jt),gt?qe?De(jt):$t(jt):qe||$t(jt)},dt.saveNode=function(_e){dt.node=_e},dt}return Object(P.a)(Ot,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var _e=this.props;_e.onDestroy&&_e.onDestroy(_e.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var _e,je=Object(Y.a)({},this.props),kt=o()(this.getPrefixCls(),je.className,(_e={},Object(i.a)(_e,this.getActiveClassName(),!je.disabled&&je.active),Object(i.a)(_e,this.getSelectedClassName(),je.isSelected),Object(i.a)(_e,this.getDisabledClassName(),je.disabled),_e)),gt=Object(Y.a)(Object(Y.a)({},je.attribute),{},{title:typeof je.title=="string"?je.title:void 0,className:kt,role:je.role||"menuitem","aria-disabled":je.disabled});je.role==="option"?gt=Object(Y.a)(Object(Y.a)({},gt),{},{role:"option","aria-selected":je.isSelected}):(je.role===null||je.role==="none")&&(gt.role="none");var zt={onClick:je.disabled?null:this.onClick,onMouseLeave:je.disabled?null:this.onMouseLeave,onMouseEnter:je.disabled?null:this.onMouseEnter},$t=Object(Y.a)({},je.style);je.mode==="inline"&&(je.direction==="rtl"?$t.paddingRight=je.inlineIndent*je.level:$t.paddingLeft=je.inlineIndent*je.level),fe.forEach(function(qe){return delete je[qe]}),delete je.direction;var De=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(De=D.createElement(this.props.itemIcon,this.props)),D.createElement("li",Object.assign({},Object(T.default)(je,["onClick","onMouseEnter","onMouseLeave","onSelect"]),gt,zt,{style:$t,ref:this.saveNode}),je.children,De)}}]),Ot}(D.Component);ce.isMenuItem=!0,ce.defaultProps={onSelect:L,onMouseEnter:L,onMouseLeave:L,manualRef:L};var be=Object(m.b)(function(Yt,St){var Ot=Yt.activeKey,dt=Yt.selectedKeys,_e=St.eventKey,je=St.subMenuKey;return{active:Ot[je]===_e,isSelected:dt.indexOf(_e)!==-1}})(ce),Ce=be,Be=function(Yt){Object(R.a)(Ot,Yt);var St=Object(O.a)(Ot);function Ot(){var dt;return Object(H.a)(this,Ot),dt=St.apply(this,arguments),dt.renderInnerMenuItem=function(_e){var je=dt.props,kt=je.renderMenuItem,gt=je.index;return kt(_e,gt,dt.props.subMenuKey)},dt}return Object(P.a)(Ot,[{key:"render",value:function(){var _e=Object(b.a)({},this.props),je=_e.className,kt=je===void 0?"":je,gt=_e.rootPrefixCls,zt="".concat(gt,"-item-group-title"),$t="".concat(gt,"-item-group-list"),De=_e.title,qe=_e.children;return fe.forEach(function(jt){return delete _e[jt]}),delete _e.onClick,delete _e.direction,D.createElement("li",Object.assign({},_e,{className:"".concat(kt," ").concat(gt,"-item-group")}),D.createElement("div",{className:zt,title:typeof De=="string"?De:void 0},De),D.createElement("ul",{className:$t},D.Children.map(qe,this.renderInnerMenuItem)))}}]),Ot}(D.Component);Be.isMenuItemGroup=!0,Be.defaultProps={disabled:!0};var yt=Be,Xt=function(St){var Ot=St.className,dt=St.rootPrefixCls,_e=St.style;return D.createElement("li",{className:"".concat(Ot," ").concat(dt,"-item-divider"),style:_e})};Xt.defaultProps={disabled:!0,className:"",style:{}};var an=Xt,pt=re.e=ae},"24YM":function(Ye,re,I){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.SensorTabIndex=re.SensorClassName=re.SizeSensorId=void 0;var Y="size-sensor-id";re.SizeSensorId=Y;var H="size-sensor-object";re.SensorClassName=H;var P="-1";re.SensorTabIndex=P},"2DNl":function(Ye,re,I){var Y=I("IMiH"),H=I("loD1"),P=I("59Ip"),F=I("aKvl"),R=I("n1HI"),O=I("hX1E"),D=O.normalizeRadian,m=I("Sj9i"),T=I("hyiK"),b=Y.CMD,i=Math.PI*2,d=1e-4;function c(w,M){return Math.abs(w-M)<d}var r=[-1,-1,-1],a=[-1,-1];function s(){var w=a[0];a[0]=a[1],a[1]=w}function o(w,M,E,p,l,u,f,_,y,v){if(v>M&&v>p&&v>u&&v>_||v<M&&v<p&&v<u&&v<_)return 0;var N=m.cubicRootAt(M,p,u,_,v,r);if(N===0)return 0;for(var j=0,U=-1,G,z,L=0;L<N;L++){var V=r[L],W=V===0||V===1?.5:1,$=m.cubicAt(w,E,l,f,V);if($<y)continue;U<0&&(U=m.cubicExtrema(M,p,u,_,a),a[1]<a[0]&&U>1&&s(),G=m.cubicAt(M,p,u,_,a[0]),U>1&&(z=m.cubicAt(M,p,u,_,a[1]))),U===2?V<a[0]?j+=G<M?W:-W:V<a[1]?j+=z<G?W:-W:j+=_<z?W:-W:V<a[0]?j+=G<M?W:-W:j+=_<G?W:-W}return j}function t(w,M,E,p,l,u,f,_){if(_>M&&_>p&&_>u||_<M&&_<p&&_<u)return 0;var y=m.quadraticRootAt(M,p,u,_,r);if(y===0)return 0;var v=m.quadraticExtremum(M,p,u);if(v>=0&&v<=1){for(var N=0,j=m.quadraticAt(M,p,u,v),U=0;U<y;U++){var G=r[U]===0||r[U]===1?.5:1,z=m.quadraticAt(w,E,l,r[U]);if(z<f)continue;r[U]<v?N+=j<M?G:-G:N+=u<j?G:-G}return N}else{var G=r[0]===0||r[0]===1?.5:1,z=m.quadraticAt(w,E,l,r[0]);return z<f?0:u<M?G:-G}}function h(w,M,E,p,l,u,f,_){if(_-=M,_>E||_<-E)return 0;var y=Math.sqrt(E*E-_*_);r[0]=-y,r[1]=y;var v=Math.abs(p-l);if(v<1e-4)return 0;if(v%i<1e-4){p=0,l=i;var N=u?1:-1;return f>=r[0]+w&&f<=r[1]+w?N:0}if(u){var y=p;p=D(l),l=D(y)}else p=D(p),l=D(l);p>l&&(l+=i);for(var j=0,U=0;U<2;U++){var G=r[U];if(G+w>f){var z=Math.atan2(_,G),N=u?1:-1;z<0&&(z=i+z),(z>=p&&z<=l||z+i>=p&&z+i<=l)&&(z>Math.PI/2&&z<Math.PI*1.5&&(N=-N),j+=N)}}return j}function g(w,M,E,p,l){for(var u=0,f=0,_=0,y=0,v=0,N=0;N<w.length;){var j=w[N++];j===b.M&&N>1&&(E||(u+=T(f,_,y,v,p,l))),N===1&&(f=w[N],_=w[N+1],y=f,v=_);switch(j){case b.M:y=w[N++],v=w[N++],f=y,_=v;break;case b.L:if(E){if(H.containStroke(f,_,w[N],w[N+1],M,p,l))return!0}else u+=T(f,_,w[N],w[N+1],p,l)||0;f=w[N++],_=w[N++];break;case b.C:if(E){if(P.containStroke(f,_,w[N++],w[N++],w[N++],w[N++],w[N],w[N+1],M,p,l))return!0}else u+=o(f,_,w[N++],w[N++],w[N++],w[N++],w[N],w[N+1],p,l)||0;f=w[N++],_=w[N++];break;case b.Q:if(E){if(F.containStroke(f,_,w[N++],w[N++],w[N],w[N+1],M,p,l))return!0}else u+=t(f,_,w[N++],w[N++],w[N],w[N+1],p,l)||0;f=w[N++],_=w[N++];break;case b.A:var U=w[N++],G=w[N++],z=w[N++],L=w[N++],V=w[N++],W=w[N++];N+=1;var $=1-w[N++],q=Math.cos(V)*z+U,fe=Math.sin(V)*L+G;N>1?u+=T(f,_,q,fe,p,l):(y=q,v=fe);var se=(p-U)*L/z+U;if(E){if(R.containStroke(U,G,L,V,V+W,$,M,se,l))return!0}else u+=h(U,G,L,V,V+W,$,se,l);f=Math.cos(V+W)*z+U,_=Math.sin(V+W)*L+G;break;case b.R:y=f=w[N++],v=_=w[N++];var me=w[N++],ve=w[N++],q=y+me,fe=v+ve;if(E){if(H.containStroke(y,v,q,v,M,p,l)||H.containStroke(q,v,q,fe,M,p,l)||H.containStroke(q,fe,y,fe,M,p,l)||H.containStroke(y,fe,y,v,M,p,l))return!0}else u+=T(q,v,q,fe,p,l),u+=T(y,fe,y,v,p,l);break;case b.Z:if(E){if(H.containStroke(f,_,y,v,M,p,l))return!0}else u+=T(f,_,y,v,p,l);f=y,_=v;break}}return!E&&!c(_,v)&&(u+=T(f,_,y,v,p,l)||0),u!==0}function C(w,M,E){return g(w,0,!1,M,E)}function A(w,M,E,p){return g(w,M,!0,E,p)}re.contain=C,re.containStroke=A},"2fw6":function(Ye,re,I){var Y=I("y+Vt"),H=Y.extend({type:"circle",shape:{cx:0,cy:0,r:0},buildPath:function(P,F,R){R&&P.moveTo(F.cx+F.r,F.cy),P.arc(F.cx,F.cy,F.r,0,Math.PI*2,!0)}});Ye.exports=H},"3C/r":function(Ye,re){var I=function(H,P){this.image=H,this.repeat=P,this.type="pattern"};I.prototype.getCanvasPattern=function(H){return H.createPattern(this.image,this.repeat||"repeat")};var Y=I;Ye.exports=Y},"3CBa":function(Ye,re,I){var Y=I("hydK"),H=Y.createElement,P=I("bYtY"),F=I("SUKs"),R=I("y+Vt"),O=I("Dagg"),D=I("dqUG"),m=I("DBLp"),T=I("sW+o"),b=I("n6Mw"),i=I("vKoX"),d=I("P47w"),c=d.path,r=d.image,a=d.text;function s(l){return parseInt(l,10)}function o(l){return l instanceof R?c:l instanceof O?r:l instanceof D?a:c}function t(l,u){return u&&l&&u.parentNode!==l}function h(l,u,f){if(t(l,u)&&f){var _=f.nextSibling;_?l.insertBefore(u,_):l.appendChild(u)}}function g(l,u){if(t(l,u)){var f=l.firstChild;f?l.insertBefore(u,f):l.appendChild(u)}}function C(l,u){u&&l&&u.parentNode===l&&l.removeChild(u)}function A(l){return l.__textSvgEl}function w(l){return l.__svgEl}var M=function(l,u,f,_){this.root=l,this.storage=u,this._opts=f=P.extend({},f||{});var y=H("svg");y.setAttribute("xmlns","http://www.w3.org/2000/svg"),y.setAttribute("version","1.1"),y.setAttribute("baseProfile","full"),y.style.cssText="user-select:none;position:absolute;left:0;top:0;";var v=H("g");y.appendChild(v);var N=H("g");y.appendChild(N),this.gradientManager=new T(_,N),this.clipPathManager=new b(_,N),this.shadowManager=new i(_,N);var j=document.createElement("div");j.style.cssText="overflow:hidden;position:relative",this._svgDom=y,this._svgRoot=N,this._backgroundRoot=v,this._viewport=j,l.appendChild(j),j.appendChild(y),this.resize(f.width,f.height),this._visibleList=[]};M.prototype={constructor:M,getType:function(){return"svg"},getViewportRoot:function(){return this._viewport},getSvgDom:function(){return this._svgDom},getSvgRoot:function(){return this._svgRoot},getViewportRootOffset:function(){var l=this.getViewportRoot();if(l)return{offsetLeft:l.offsetLeft||0,offsetTop:l.offsetTop||0}},refresh:function(){var l=this.storage.getDisplayList(!0);this._paintList(l)},setBackgroundColor:function(l){this._backgroundRoot&&this._backgroundNode&&this._backgroundRoot.removeChild(this._backgroundNode);var u=H("rect");u.setAttribute("width",this.getWidth()),u.setAttribute("height",this.getHeight()),u.setAttribute("x",0),u.setAttribute("y",0),u.setAttribute("id",0),u.style.fill=l,this._backgroundRoot.appendChild(u),this._backgroundNode=u},_paintList:function(l){this.gradientManager.markAllUnused(),this.clipPathManager.markAllUnused(),this.shadowManager.markAllUnused();var u=this._svgRoot,f=this._visibleList,_=l.length,y=[],v;for(v=0;v<_;v++){var N=l[v],j=o(N),U=w(N)||A(N);N.invisible||(N.__dirty&&(j&&j.brush(N),this.clipPathManager.update(N),N.style&&(this.gradientManager.update(N.style.fill),this.gradientManager.update(N.style.stroke),this.shadowManager.update(U,N)),N.__dirty=!1),y.push(N))}var G=m(f,y),z;for(v=0;v<G.length;v++){var L=G[v];if(L.removed)for(var V=0;V<L.count;V++){var N=f[L.indices[V]],U=w(N),W=A(N);C(u,U),C(u,W)}}for(v=0;v<G.length;v++){var L=G[v];if(L.added)for(var V=0;V<L.count;V++){var N=y[L.indices[V]],U=w(N),W=A(N);z?h(u,U,z):g(u,U),U?h(u,W,U):z?h(u,W,z):g(u,W),h(u,W,U),z=W||U||z,this.gradientManager.addWithoutUpdate(U||W,N),this.shadowManager.addWithoutUpdate(U||W,N),this.clipPathManager.markUsed(N)}else if(!L.removed)for(var V=0;V<L.count;V++){var N=y[L.indices[V]],U=w(N),W=A(N),U=w(N),W=A(N);this.gradientManager.markUsed(N),this.gradientManager.addWithoutUpdate(U||W,N),this.shadowManager.markUsed(N),this.shadowManager.addWithoutUpdate(U||W,N),this.clipPathManager.markUsed(N),W&&h(u,W,U),z=U||W||z}}this.gradientManager.removeUnused(),this.clipPathManager.removeUnused(),this.shadowManager.removeUnused(),this._visibleList=y},_getDefs:function(l){var u=this._svgDom,f=u.getElementsByTagName("defs");if(f.length===0)if(l){var f=u.insertBefore(H("defs"),u.firstChild);return f.contains||(f.contains=function(y){var v=f.children;if(!v)return!1;for(var N=v.length-1;N>=0;--N)if(v[N]===y)return!0;return!1}),f}else return null;else return f[0]},resize:function(l,u){var f=this._viewport;f.style.display="none";var _=this._opts;if(l!=null&&(_.width=l),u!=null&&(_.height=u),l=this._getSize(0),u=this._getSize(1),f.style.display="",this._width!==l||this._height!==u){this._width=l,this._height=u;var y=f.style;y.width=l+"px",y.height=u+"px";var v=this._svgDom;v.setAttribute("width",l),v.setAttribute("height",u)}this._backgroundNode&&(this._backgroundNode.setAttribute("width",l),this._backgroundNode.setAttribute("height",u))},getWidth:function(){return this._width},getHeight:function(){return this._height},_getSize:function(l){var u=this._opts,f=["width","height"][l],_=["clientWidth","clientHeight"][l],y=["paddingLeft","paddingTop"][l],v=["paddingRight","paddingBottom"][l];if(u[f]!=null&&u[f]!=="auto")return parseFloat(u[f]);var N=this.root,j=document.defaultView.getComputedStyle(N);return(N[_]||s(j[f])||s(N.style[f]))-(s(j[y])||0)-(s(j[v])||0)|0},dispose:function(){this.root.innerHTML="",this._svgRoot=this._backgroundRoot=this._svgDom=this._backgroundNode=this._viewport=this.storage=null},clear:function(){this._viewport&&this.root.removeChild(this._viewport)},toDataURL:function(){this.refresh();var l=encodeURIComponent(this._svgDom.outerHTML.replace(/></g,`>
|
|
\r<`));return"data:image/svg+xml;charset=UTF-8,"+l}};function E(l){return function(){F('In SVG mode painter not support method "'+l+'"')}}P.each(["getLayer","insertLayer","eachLayer","eachBuiltinLayer","eachOtherLayer","getLayers","modLayer","delLayer","clearLayer","pathToImage"],function(l){M.prototype[l]=E(l)});var p=M;Ye.exports=p},"3e3G":function(Ye,re,I){var Y=I("bYtY"),H=I("QuXc"),P=function(R,O,D,m,T){this.x=R==null?.5:R,this.y=O==null?.5:O,this.r=D==null?.5:D,this.type="radial",this.global=T||!1,H.call(this,m)};P.prototype={constructor:P},Y.inherits(P,H);var F=P;Ye.exports=F},"3gBT":function(Ye,re){var I=2311;function Y(){return I++}Ye.exports=Y},"4fz+":function(Ye,re,I){var Y=I("bYtY"),H=I("1bdT"),P=I("mFDi"),F=function(O){O=O||{},H.call(this,O);for(var D in O)O.hasOwnProperty(D)&&(this[D]=O[D]);this._children=[],this.__storage=null,this.__dirty=!0};F.prototype={constructor:F,isGroup:!0,type:"group",silent:!1,children:function(){return this._children.slice()},childAt:function(O){return this._children[O]},childOfName:function(O){for(var D=this._children,m=0;m<D.length;m++)if(D[m].name===O)return D[m]},childCount:function(){return this._children.length},add:function(O){return O&&O!==this&&O.parent!==this&&(this._children.push(O),this._doAdd(O)),this},addBefore:function(O,D){if(O&&O!==this&&O.parent!==this&&D&&D.parent===this){var m=this._children,T=m.indexOf(D);T>=0&&(m.splice(T,0,O),this._doAdd(O))}return this},_doAdd:function(O){O.parent&&O.parent.remove(O),O.parent=this;var D=this.__storage,m=this.__zr;D&&D!==O.__storage&&(D.addToStorage(O),O instanceof F&&O.addChildrenToStorage(D)),m&&m.refresh()},remove:function(O){var D=this.__zr,m=this.__storage,T=this._children,b=Y.indexOf(T,O);return b<0?this:(T.splice(b,1),O.parent=null,m&&(m.delFromStorage(O),O instanceof F&&O.delChildrenFromStorage(m)),D&&D.refresh(),this)},removeAll:function(){var O=this._children,D=this.__storage,m,T;for(T=0;T<O.length;T++)m=O[T],D&&(D.delFromStorage(m),m instanceof F&&m.delChildrenFromStorage(D)),m.parent=null;return O.length=0,this},eachChild:function(O,D){for(var m=this._children,T=0;T<m.length;T++){var b=m[T];O.call(D,b,T)}return this},traverse:function(O,D){for(var m=0;m<this._children.length;m++){var T=this._children[m];O.call(D,T),T.type==="group"&&T.traverse(O,D)}return this},addChildrenToStorage:function(O){for(var D=0;D<this._children.length;D++){var m=this._children[D];O.addToStorage(m),m instanceof F&&m.addChildrenToStorage(O)}},delChildrenFromStorage:function(O){for(var D=0;D<this._children.length;D++){var m=this._children[D];O.delFromStorage(m),m instanceof F&&m.delChildrenFromStorage(O)}},dirty:function(){return this.__dirty=!0,this.__zr&&this.__zr.refresh(),this},getBoundingRect:function(O){for(var D=null,m=new P(0,0,0,0),T=O||this._children,b=[],i=0;i<T.length;i++){var d=T[i];if(d.ignore||d.invisible)continue;var c=d.getBoundingRect(),r=d.getLocalTransform(b);r?(m.copy(c),m.applyTransform(r),D=D||m.clone(),D.union(m)):(D=D||c.clone(),D.union(c))}return D||m}},Y.inherits(F,H);var R=F;Ye.exports=R},"4mN7":function(Ye,re,I){var Y=I("QBsz"),H=I("Sj9i"),P=Math.min,F=Math.max,R=Math.sin,O=Math.cos,D=Math.PI*2,m=Y.create(),T=Y.create(),b=Y.create();function i(t,h,g){if(t.length===0)return;var C=t[0],A=C[0],w=C[0],M=C[1],E=C[1],p;for(p=1;p<t.length;p++)C=t[p],A=P(A,C[0]),w=F(w,C[0]),M=P(M,C[1]),E=F(E,C[1]);h[0]=A,h[1]=M,g[0]=w,g[1]=E}function d(t,h,g,C,A,w){A[0]=P(t,g),A[1]=P(h,C),w[0]=F(t,g),w[1]=F(h,C)}var c=[],r=[];function a(t,h,g,C,A,w,M,E,p,l){var u=H.cubicExtrema,f=H.cubicAt,_,y=u(t,g,A,M,c);for(p[0]=Infinity,p[1]=Infinity,l[0]=-Infinity,l[1]=-Infinity,_=0;_<y;_++){var v=f(t,g,A,M,c[_]);p[0]=P(v,p[0]),l[0]=F(v,l[0])}for(y=u(h,C,w,E,r),_=0;_<y;_++){var N=f(h,C,w,E,r[_]);p[1]=P(N,p[1]),l[1]=F(N,l[1])}p[0]=P(t,p[0]),l[0]=F(t,l[0]),p[0]=P(M,p[0]),l[0]=F(M,l[0]),p[1]=P(h,p[1]),l[1]=F(h,l[1]),p[1]=P(E,p[1]),l[1]=F(E,l[1])}function s(t,h,g,C,A,w,M,E){var p=H.quadraticExtremum,l=H.quadraticAt,u=F(P(p(t,g,A),1),0),f=F(P(p(h,C,w),1),0),_=l(t,g,A,u),y=l(h,C,w,f);M[0]=P(t,A,_),M[1]=P(h,w,y),E[0]=F(t,A,_),E[1]=F(h,w,y)}function o(t,h,g,C,A,w,M,E,p){var l=Y.min,u=Y.max,f=Math.abs(A-w);if(f%D<1e-4&&f>1e-4){E[0]=t-g,E[1]=h-C,p[0]=t+g,p[1]=h+C;return}if(m[0]=O(A)*g+t,m[1]=R(A)*C+h,T[0]=O(w)*g+t,T[1]=R(w)*C+h,l(E,m,T),u(p,m,T),A=A%D,A<0&&(A=A+D),w=w%D,w<0&&(w=w+D),A>w&&!M?w+=D:A<w&&M&&(A+=D),M){var _=w;w=A,A=_}for(var y=0;y<w;y+=Math.PI/2)y>A&&(b[0]=O(y)*g+t,b[1]=R(y)*C+h,l(E,b,E),u(p,b,p))}re.fromPoints=i,re.fromLine=d,re.fromCubic=a,re.fromQuadratic=s,re.fromArc=o},"4wi7":function(Ye,re,I){"use strict";var Y=I("14J3"),H=I("BMrR"),P=I("sRBo"),F=I("kaz8"),R=I("5NDa"),O=I("5rEg"),D=I("9og8"),m=I("tJVT"),T=I("WmNS"),b=I.n(T),i=I("q1tI"),d=I.n(i),c=I("oOBs"),r=I.n(c),a=I("xOL1"),s=I.n(a),o=I("BdwD"),t=function(g){var C=g.data,A=g.value,w=A===void 0?[]:A,M=g.handleChangePage,E=g.setSelectedRowKeys,p=g.selectedRowKeys,l=g.onChange,u=l===void 0?function(){}:l,f=Object(i.useState)([]),_=Object(m.a)(f,2),y=_[0],v=_[1],N=Object(i.useState)([]),j=Object(m.a)(N,2),U=j[0],G=j[1],z=Object(i.useState)([]),L=Object(m.a)(z,2),V=L[0],W=L[1],$=Object(i.useState)(1),q=Object(m.a)($,2),fe=q[0],se=q[1],me=Object(i.useState)(),ve=Object(m.a)(me,2),Ae=ve[0],ge=ve[1];return Object(i.useEffect)(function(){v(C),G([]),W([])},[C]),Object(i.useEffect)(function(){E&&(G(p),W(p))},[p]),d.a.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},d.a.createElement("div",{className:r.a.leftdiv},d.a.createElement(O.a.Search,{size:"large",onChange:function(){var ue=Object(D.a)(b.a.mark(function $e(Tt){return b.a.wrap(function(Re){for(;;)switch(Re.prev=Re.next){case 0:v(C.filter(function(nt){var Ue;return nt==null||((Ue=nt.name)===null||Ue===void 0)?void 0:Ue.includes(Tt.target.value)}));case 1:case"end":return Re.stop()}},$e)}));return function($e){return ue.apply(this,arguments)}}(),placeholder:"\u53EF\u8F93\u5165\u73ED\u7EA7\u540D\u79F0\u67E5\u8BE2"}),y.length===0&&d.a.createElement(o.a,{styles:{margin:"70px auto"},customText:"\u6682\u65E0\u5206\u73ED"}),d.a.createElement("div",{style:{height:"85%",overflow:"auto",overflowX:"hidden"}},d.a.createElement(F.a.Group,{value:U.map(function(ue){return"".concat(ue.id)}),onChange:function($e){E(y.filter(function(Tt){return $e.includes("".concat(Tt.id))}))},style:{marginTop:"10px"}},y.map(function(ue,$e){return d.a.createElement(H.a,{key:ue.id,style:{marginTop:"10px",lineHeight:"24px",display:"flex",width:200}},d.a.createElement(F.a,{style:{display:"flex",height:"24px",alignItems:"center"},disabled:ue.is_published,value:"".concat(ue.id)},d.a.createElement("div",{className:r.a.listClass},d.a.createElement("span",{className:r.a.spantitle,style:{width:ue.is_published?"108px":"170px"}},ue.name),ue.is_published&&d.a.createElement("span",{style:{width:"52px",height:"24px",background:"#B8B8B8",borderRadius:"13px",color:"white",lineHeight:"24px",textAlign:"center",display:"inline-block"}},"\u5DF2\u53D1\u5E03"))))})))),d.a.createElement("div",{className:r.a.rightdiv},d.a.createElement(O.a.Search,{onChange:function($e){W(U.filter(function(Tt){return Tt.name.includes($e.target.value)}))},size:"large",placeholder:"\u53EF\u8F93\u5165\u73ED\u7EA7\u540D\u79F0\u67E5\u8BE2"}),V.length===0&&d.a.createElement(o.a,{styles:{margin:"70px auto"},customText:"\u6682\u672A\u9009\u62E9\u5206\u73ED"}),V.length>0&&d.a.createElement("div",{style:{marginTop:"10px",height:"85%",overflow:"hidden",position:"relative"}},d.a.createElement("div",{style:{overflowX:"hidden",overflowY:"scroll",position:"absolute",left:0,top:0,right:-17,bottom:0}},V.map(function(ue,$e){return d.a.createElement(H.a,{justify:"space-between",style:{marginTop:"10px"},key:ue.id},d.a.createElement("div",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",marginRight:"5px",marginLeft:"5px",width:"75%"}},ue.name),d.a.createElement("img",{src:s.a,style:{cursor:"pointer",height:"16px",marginRight:17},onClick:function(){E(U.filter(function(ye){return"".concat(ye.id)!="".concat(ue.id)}))}}))})))))};re.a=t},"55Ip":function(Ye,re,I){"use strict";I.d(re,"a",function(){return h});var Y=I("Ty5D"),H=I("dI71"),P=I("q1tI"),F=I.n(P),R=I("YS25"),O=I("17x9"),D=I.n(O),m=I("wx14"),T=I("zLVn"),b=I("9R94"),i=function(l){Object(H.a)(u,l);function u(){for(var _,y=arguments.length,v=new Array(y),N=0;N<y;N++)v[N]=arguments[N];return _=l.call.apply(l,[this].concat(v))||this,_.history=Object(R.a)(_.props),_}var f=u.prototype;return f.render=function(){return F.a.createElement(Y.c,{history:this.history,children:this.props.children})},u}(F.a.Component),d=function(l){Object(H.a)(u,l);function u(){for(var _,y=arguments.length,v=new Array(y),N=0;N<y;N++)v[N]=arguments[N];return _=l.call.apply(l,[this].concat(v))||this,_.history=Object(R.b)(_.props),_}var f=u.prototype;return f.render=function(){return F.a.createElement(Y.c,{history:this.history,children:this.props.children})},u}(F.a.Component),c=function(u,f){return typeof u=="function"?u(f):u},r=function(u,f){return typeof u=="string"?Object(R.c)(u,null,null,f):u},a=function(u){return u},s=F.a.forwardRef;typeof s=="undefined"&&(s=a);function o(l){return!!(l.metaKey||l.altKey||l.ctrlKey||l.shiftKey)}var t=s(function(l,u){var f=l.innerRef,_=l.navigate,y=l.onClick,v=Object(T.a)(l,["innerRef","navigate","onClick"]),N=v.target,j=Object(m.a)({},v,{onClick:function(G){try{y&&y(G)}catch(z){throw G.preventDefault(),z}!G.defaultPrevented&&G.button===0&&(!N||N==="_self")&&!o(G)&&(G.preventDefault(),_())}});return a!==s?j.ref=u||f:j.ref=f,F.a.createElement("a",j)}),h=s(function(l,u){var f=l.component,_=f===void 0?t:f,y=l.replace,v=l.to,N=l.innerRef,j=Object(T.a)(l,["component","replace","to","innerRef"]);return F.a.createElement(Y.e.Consumer,null,function(U){U||Object(b.a)(!1);var G=U.history,z=r(c(v,U.location),U.location),L=z?G.createHref(z):"",V=Object(m.a)({},j,{href:L,navigate:function(){var $=c(v,U.location),q=y?G.replace:G.push;q($)}});return a!==s?V.ref=u||N:V.innerRef=N,F.a.createElement(_,V)})});if(!1)var g,C;var A=function(u){return u},w=F.a.forwardRef;typeof w=="undefined"&&(w=A);function M(){for(var l=arguments.length,u=new Array(l),f=0;f<l;f++)u[f]=arguments[f];return u.filter(function(_){return _}).join(" ")}var E=w(function(l,u){var f=l["aria-current"],_=f===void 0?"page":f,y=l.activeClassName,v=y===void 0?"active":y,N=l.activeStyle,j=l.className,U=l.exact,G=l.isActive,z=l.location,L=l.sensitive,V=l.strict,W=l.style,$=l.to,q=l.innerRef,fe=Object(T.a)(l,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return F.a.createElement(Y.e.Consumer,null,function(se){se||Object(b.a)(!1);var me=z||se.location,ve=r(c($,me),me),Ae=ve.pathname,ge=Ae&&Ae.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ue=ge?Object(Y.f)(me.pathname,{path:ge,exact:U,sensitive:L,strict:V}):null,$e=!!(G?G(ue,me):ue),Tt=$e?M(j,v):j,ye=$e?Object(m.a)({},W,{},N):W,Re=Object(m.a)({"aria-current":$e&&_||null,className:Tt,style:ye,to:ve},fe);return A!==w?Re.ref=u||q:Re.innerRef=q,F.a.createElement(h,Re)})});if(!1)var p},"59Ip":function(Ye,re,I){var Y=I("Sj9i");function H(P,F,R,O,D,m,T,b,i,d,c){if(i===0)return!1;var r=i;if(c>F+r&&c>O+r&&c>m+r&&c>b+r||c<F-r&&c<O-r&&c<m-r&&c<b-r||d>P+r&&d>R+r&&d>D+r&&d>T+r||d<P-r&&d<R-r&&d<D-r&&d<T-r)return!1;var a=Y.cubicProjectPoint(P,F,R,O,D,m,T,b,d,c,null);return a<=r/2}re.containStroke=H},"5VLF":function(Ye,re,I){"use strict";var Y,H;function P(F,R,O){var D=function(m,T){return F.js_beautify(m,T)};return D.js=F.js_beautify,D.css=R.css_beautify,D.html=O.html_beautify,D.js_beautify=F.js_beautify,D.css_beautify=R.css_beautify,D.html_beautify=O.html_beautify,D}!(Y=[I("6UM0"),I("TXwP"),I("psGv")],H=function(F,R,O){return P(F,R,O)}.apply(re,Y),H!==void 0&&(Ye.exports=H))},"6+eU":function(Ye,re,I){"use strict";I.d(re,"a",function(){return w});var Y=I("wx14"),H=I("rePB"),P=I("VTBJ"),F=I("1OyB"),R=I("vuIU"),O=I("Ji7U"),D=I("LK+K"),m=I("q1tI"),T=I.n(m),b=I("TSYQ"),i=I.n(b),d=function(E){var p,l="".concat(E.rootPrefixCls,"-item"),u=i()(l,"".concat(l,"-").concat(E.page),(p={},Object(H.a)(p,"".concat(l,"-active"),E.active),Object(H.a)(p,E.className,!!E.className),Object(H.a)(p,"".concat(l,"-disabled"),!E.page),p)),f=function(){E.onClick(E.page)},_=function(v){E.onKeyPress(v,E.onClick,E.page)};return T.a.createElement("li",{title:E.showTitle?E.page:null,className:u,onClick:f,onKeyPress:_,tabIndex:"0"},E.itemRender(E.page,"page",T.a.createElement("a",{rel:"nofollow"},E.page)))},c=d,r={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},a=function(M){Object(O.a)(p,M);var E=Object(D.a)(p);function p(){var l;Object(F.a)(this,p);for(var u=arguments.length,f=new Array(u),_=0;_<u;_++)f[_]=arguments[_];return l=E.call.apply(E,[this].concat(f)),l.state={goInputText:""},l.buildOptionText=function(y){return"".concat(y," ").concat(l.props.locale.items_per_page)},l.changeSize=function(y){l.props.changeSize(Number(y))},l.handleChange=function(y){l.setState({goInputText:y.target.value})},l.handleBlur=function(y){var v=l.props,N=v.goButton,j=v.quickGo,U=v.rootPrefixCls,G=l.state.goInputText;if(N||G==="")return;if(y.relatedTarget&&(y.relatedTarget.className.indexOf("".concat(U,"-prev"))>=0||y.relatedTarget.className.indexOf("".concat(U,"-next"))>=0))return;l.setState({goInputText:""}),j(l.getValidValue())},l.go=function(y){var v=l.state.goInputText;if(v==="")return;(y.keyCode===r.ENTER||y.type==="click")&&(l.setState({goInputText:""}),l.props.quickGo(l.getValidValue()))},l}return Object(R.a)(p,[{key:"getValidValue",value:function(){var u=this.state,f=u.goInputText,_=u.current;return!f||isNaN(f)?_:Number(f)}},{key:"getPageSizeOptions",value:function(){var u=this.props,f=u.pageSize,_=u.pageSizeOptions;return _.some(function(y){return y.toString()===f.toString()})?_:_.concat([f.toString()]).sort(function(y,v){var N=isNaN(Number(y))?0:Number(y),j=isNaN(Number(v))?0:Number(v);return N-j})}},{key:"render",value:function(){var u=this,f=this.props,_=f.pageSize,y=f.locale,v=f.rootPrefixCls,N=f.changeSize,j=f.quickGo,U=f.goButton,G=f.selectComponentClass,z=f.buildOptionText,L=f.selectPrefixCls,V=f.disabled,W=this.state.goInputText,$="".concat(v,"-options"),q=G,fe=null,se=null,me=null;if(!N&&!j)return null;var ve=this.getPageSizeOptions();if(N&&q){var Ae=ve.map(function(ge,ue){return T.a.createElement(q.Option,{key:ue,value:ge.toString()},(z||u.buildOptionText)(ge))});fe=T.a.createElement(q,{disabled:V,prefixCls:L,showSearch:!1,className:"".concat($,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(_||ve[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ue){return ue.parentNode}},Ae)}return j&&(U&&(me=typeof U=="boolean"?T.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:V,className:"".concat($,"-quick-jumper-button")},y.jump_to_confirm):T.a.createElement("span",{onClick:this.go,onKeyUp:this.go},U)),se=T.a.createElement("div",{className:"".concat($,"-quick-jumper")},y.jump_to,T.a.createElement("input",{disabled:V,type:"text",value:W,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),y.page,me)),T.a.createElement("li",{className:"".concat($)},fe,se)}}]),p}(T.a.Component);a.defaultProps={pageSizeOptions:["10","20","50","100"]};var s=a,o=I("N2Kk");function t(){}function h(M){return typeof M=="number"&&isFinite(M)&&Math.floor(M)===M}function g(M,E,p){return p}function C(M,E,p){var l=typeof M=="undefined"?E.pageSize:M;return Math.floor((p.total-1)/l)+1}var A=function(M){Object(O.a)(p,M);var E=Object(D.a)(p);function p(l){var u;Object(F.a)(this,p),u=E.call(this,l),u.getJumpPrevPage=function(){return Math.max(1,u.state.current-(u.props.showLessItems?3:5))},u.getJumpNextPage=function(){return Math.min(C(void 0,u.state,u.props),u.state.current+(u.props.showLessItems?3:5))},u.getItemIcon=function(N,j){var U=u.props.prefixCls,G=N||T.a.createElement("button",{type:"button","aria-label":j,className:"".concat(U,"-item-link")});return typeof N=="function"&&(G=T.a.createElement(N,Object(P.a)({},u.props))),G},u.savePaginationNode=function(N){u.paginationNode=N},u.isValid=function(N){return h(N)&&N!==u.state.current},u.shouldDisplayQuickJumper=function(){var N=u.props,j=N.showQuickJumper,U=N.pageSize,G=N.total;return G<=U?!1:j},u.handleKeyDown=function(N){(N.keyCode===r.ARROW_UP||N.keyCode===r.ARROW_DOWN)&&N.preventDefault()},u.handleKeyUp=function(N){var j=u.getValidValue(N),U=u.state.currentInputValue;j!==U&&u.setState({currentInputValue:j}),N.keyCode===r.ENTER?u.handleChange(j):N.keyCode===r.ARROW_UP?u.handleChange(j-1):N.keyCode===r.ARROW_DOWN&&u.handleChange(j+1)},u.changePageSize=function(N){var j=u.state.current,U=C(N,u.state,u.props);j=j>U?U:j,U===0&&(j=u.state.current),typeof N=="number"&&("pageSize"in u.props||u.setState({pageSize:N}),"current"in u.props||u.setState({current:j,currentInputValue:j})),u.props.onShowSizeChange(j,N),"onChange"in u.props&&u.props.onChange&&u.props.onChange(j,N)},u.handleChange=function(N){var j=u.props.disabled,U=N;if(u.isValid(U)&&!j){var G=C(void 0,u.state,u.props);U>G?U=G:U<1&&(U=1),"current"in u.props||u.setState({current:U,currentInputValue:U});var z=u.state.pageSize;return u.props.onChange(U,z),U}return u.state.current},u.prev=function(){u.hasPrev()&&u.handleChange(u.state.current-1)},u.next=function(){u.hasNext()&&u.handleChange(u.state.current+1)},u.jumpPrev=function(){u.handleChange(u.getJumpPrevPage())},u.jumpNext=function(){u.handleChange(u.getJumpNextPage())},u.hasPrev=function(){return u.state.current>1},u.hasNext=function(){return u.state.current<C(void 0,u.state,u.props)},u.runIfEnter=function(N,j){if(N.key==="Enter"||N.charCode===13){for(var U=arguments.length,G=new Array(U>2?U-2:0),z=2;z<U;z++)G[z-2]=arguments[z];j.apply(void 0,G)}},u.runIfEnterPrev=function(N){u.runIfEnter(N,u.prev)},u.runIfEnterNext=function(N){u.runIfEnter(N,u.next)},u.runIfEnterJumpPrev=function(N){u.runIfEnter(N,u.jumpPrev)},u.runIfEnterJumpNext=function(N){u.runIfEnter(N,u.jumpNext)},u.handleGoTO=function(N){(N.keyCode===r.ENTER||N.type==="click")&&u.handleChange(u.state.currentInputValue)};var f=l.onChange!==t,_="current"in l;_&&!f&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var y=l.defaultCurrent;"current"in l&&(y=l.current);var v=l.defaultPageSize;return"pageSize"in l&&(v=l.pageSize),y=Math.min(y,C(v,void 0,l)),u.state={current:y,currentInputValue:y,pageSize:v},u}return Object(R.a)(p,[{key:"componentDidUpdate",value:function(u,f){var _=this.props.prefixCls;if(f.current!==this.state.current&&this.paginationNode){var y=this.paginationNode.querySelector(".".concat(_,"-item-").concat(f.current));y&&document.activeElement===y&&y.blur()}}},{key:"getValidValue",value:function(u){var f=u.target.value,_=C(void 0,this.state,this.props),y=this.state.currentInputValue,v;return f===""?v=f:isNaN(Number(f))?v=y:f>=_?v=_:v=Number(f),v}},{key:"getShowSizeChanger",value:function(){var u=this.props,f=u.showSizeChanger,_=u.total,y=u.totalBoundaryShowSizeChanger;return typeof f!="undefined"?f:_>y}},{key:"renderPrev",value:function(u){var f=this.props,_=f.prevIcon,y=f.itemRender,v=y(u,"prev",this.getItemIcon(_,"prev page")),N=!this.hasPrev();return Object(m.isValidElement)(v)?Object(m.cloneElement)(v,{disabled:N}):v}},{key:"renderNext",value:function(u){var f=this.props,_=f.nextIcon,y=f.itemRender,v=y(u,"next",this.getItemIcon(_,"next page")),N=!this.hasNext();return Object(m.isValidElement)(v)?Object(m.cloneElement)(v,{disabled:N}):v}},{key:"render",value:function(){var u=this,f=this.props,_=f.prefixCls,y=f.className,v=f.style,N=f.disabled,j=f.hideOnSinglePage,U=f.total,G=f.locale,z=f.showQuickJumper,L=f.showLessItems,V=f.showTitle,W=f.showTotal,$=f.simple,q=f.itemRender,fe=f.showPrevNextJumpers,se=f.jumpPrevIcon,me=f.jumpNextIcon,ve=f.selectComponentClass,Ae=f.selectPrefixCls,ge=f.pageSizeOptions,ue=this.state,$e=ue.current,Tt=ue.pageSize,ye=ue.currentInputValue;if(j===!0&&U<=Tt)return null;var Re=C(void 0,this.state,this.props),nt=[],Ue=null,ke=null,lt=null,Fe=null,Ze=null,Xe=z&&z.goButton,ft=L?1:2,Rt=$e-1>0?$e-1:0,Pt=$e+1<Re?$e+1:Re,Bt=Object.keys(this.props).reduce(function(ie,ae){return(ae.substr(0,5)==="data-"||ae.substr(0,5)==="aria-"||ae==="role")&&(ie[ae]=u.props[ae]),ie},{});if($)return Xe&&(typeof Xe=="boolean"?Ze=T.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},G.jump_to_confirm):Ze=T.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Xe),Ze=T.a.createElement("li",{title:V?"".concat(G.jump_to).concat($e,"/").concat(Re):null,className:"".concat(_,"-simple-pager")},Ze)),T.a.createElement("ul",Object(Y.a)({className:i()(_,"".concat(_,"-simple"),Object(H.a)({},"".concat(_,"-disabled"),N),y),style:v,ref:this.savePaginationNode},Bt),T.a.createElement("li",{title:V?G.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:i()("".concat(_,"-prev"),Object(H.a)({},"".concat(_,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(Rt)),T.a.createElement("li",{title:V?"".concat($e,"/").concat(Re):null,className:"".concat(_,"-simple-pager")},T.a.createElement("input",{type:"text",value:ye,disabled:N,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),T.a.createElement("span",{className:"".concat(_,"-slash")},"/"),Re),T.a.createElement("li",{title:V?G.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:i()("".concat(_,"-next"),Object(H.a)({},"".concat(_,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Pt)),Ze);if(Re<=3+ft*2){var Ve={locale:G,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:V,itemRender:q};Re||nt.push(T.a.createElement(c,Object(Y.a)({},Ve,{key:"noPager",page:Re,className:"".concat(_,"-disabled")})));for(var Ft=1;Ft<=Re;Ft+=1){var nn=$e===Ft;nt.push(T.a.createElement(c,Object(Y.a)({},Ve,{key:Ft,page:Ft,active:nn})))}}else{var Le=L?G.prev_3:G.prev_5,Se=L?G.next_3:G.next_5;fe&&(Ue=T.a.createElement("li",{title:V?Le:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:i()("".concat(_,"-jump-prev"),Object(H.a)({},"".concat(_,"-jump-prev-custom-icon"),!!se))},q(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(se,"prev page"))),ke=T.a.createElement("li",{title:V?Se:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:i()("".concat(_,"-jump-next"),Object(H.a)({},"".concat(_,"-jump-next-custom-icon"),!!me))},q(this.getJumpNextPage(),"jump-next",this.getItemIcon(me,"next page")))),Fe=T.a.createElement(c,{locale:G,last:!0,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Re,page:Re,active:!1,showTitle:V,itemRender:q}),lt=T.a.createElement(c,{locale:G,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:V,itemRender:q});var ut=Math.max(1,$e-ft),mt=Math.min($e+ft,Re);$e-1<=ft&&(mt=1+ft*2),Re-$e<=ft&&(ut=Re-ft*2);for(var We=ut;We<=mt;We+=1){var vt=$e===We;nt.push(T.a.createElement(c,{locale:G,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:We,page:We,active:vt,showTitle:V,itemRender:q}))}$e-1>=ft*2&&$e!==1+2&&(nt[0]=Object(m.cloneElement)(nt[0],{className:"".concat(_,"-item-after-jump-prev")}),nt.unshift(Ue)),Re-$e>=ft*2&&$e!==Re-2&&(nt[nt.length-1]=Object(m.cloneElement)(nt[nt.length-1],{className:"".concat(_,"-item-before-jump-next")}),nt.push(ke)),ut!==1&&nt.unshift(lt),mt!==Re&&nt.push(Fe)}var Pe=null;W&&(Pe=T.a.createElement("li",{className:"".concat(_,"-total-text")},W(U,[U===0?0:($e-1)*Tt+1,$e*Tt>U?U:$e*Tt])));var xe=!this.hasPrev()||!Re,we=!this.hasNext()||!Re;return T.a.createElement("ul",Object(Y.a)({className:i()(_,y,Object(H.a)({},"".concat(_,"-disabled"),N)),style:v,unselectable:"unselectable",ref:this.savePaginationNode},Bt),Pe,T.a.createElement("li",{title:V?G.prev_page:null,onClick:this.prev,tabIndex:xe?null:0,onKeyPress:this.runIfEnterPrev,className:i()("".concat(_,"-prev"),Object(H.a)({},"".concat(_,"-disabled"),xe)),"aria-disabled":xe},this.renderPrev(Rt)),nt,T.a.createElement("li",{title:V?G.next_page:null,onClick:this.next,tabIndex:we?null:0,onKeyPress:this.runIfEnterNext,className:i()("".concat(_,"-next"),Object(H.a)({},"".concat(_,"-disabled"),we)),"aria-disabled":we},this.renderNext(Pt)),T.a.createElement(s,{disabled:N,locale:G,rootPrefixCls:_,selectComponentClass:ve,selectPrefixCls:Ae,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:$e,pageSize:Tt,pageSizeOptions:ge,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Xe}))}}],[{key:"getDerivedStateFromProps",value:function(u,f){var _={};if("current"in u&&(_.current=u.current,u.current!==f.current&&(_.currentInputValue=_.current)),"pageSize"in u&&u.pageSize!==f.pageSize){var y=f.current,v=C(u.pageSize,f,u);y=y>v?v:y,"current"in u||(_.current=y,_.currentInputValue=y),_.pageSize=u.pageSize}return _}}]),p}(T.a.Component);A.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:t,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:t,locale:o.a,style:{},itemRender:g,totalBoundaryShowSizeChanger:50};var w=A},"6GrX":function(Ye,re,I){var Y=I("mFDi"),H=I("Xnb7"),P=I("bYtY"),F=P.getContext,R=P.extend,O=P.retrieve2,D=P.retrieve3,m=P.trim,T={},b=0,i=5e3,d=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g,c="12px sans-serif",r={};function a(j,U){r[j]=U}function s(j,U){U=U||c;var G=j+":"+U;if(T[G])return T[G];for(var z=(j+"").split(`
|
|
`),L=0,V=0,W=z.length;V<W;V++)L=Math.max(f(z[V],U).width,L);return b>i&&(b=0,T={}),b++,T[G]=L,L}function o(j,U,G,z,L,V,W,$){return W?h(j,U,G,z,L,V,W,$):t(j,U,G,z,L,V,$)}function t(j,U,G,z,L,V,W){var $=_(j,U,L,V,W),q=s(j,U);L&&(q+=L[1]+L[3]);var fe=$.outerHeight,se=g(0,q,G),me=C(0,fe,z),ve=new Y(se,me,q,fe);return ve.lineHeight=$.lineHeight,ve}function h(j,U,G,z,L,V,W,$){var q=y(j,{rich:W,truncate:$,font:U,textAlign:G,textPadding:L,textLineHeight:V}),fe=q.outerWidth,se=q.outerHeight,me=g(0,fe,G),ve=C(0,se,z);return new Y(me,ve,fe,se)}function g(j,U,G){return G==="right"?j-=U:G==="center"&&(j-=U/2),j}function C(j,U,G){return G==="middle"?j-=U/2:G==="bottom"&&(j-=U),j}function A(j,U,G){var z=U.textPosition,L=U.textDistance,V=G.x,W=G.y;L=L||0;var $=G.height,q=G.width,fe=$/2,se="left",me="top";switch(z){case"left":V-=L,W+=fe,se="right",me="middle";break;case"right":V+=L+q,W+=fe,me="middle";break;case"top":V+=q/2,W-=L,se="center",me="bottom";break;case"bottom":V+=q/2,W+=$+L,se="center";break;case"inside":V+=q/2,W+=fe,se="center",me="middle";break;case"insideLeft":V+=L,W+=fe,me="middle";break;case"insideRight":V+=q-L,W+=fe,se="right",me="middle";break;case"insideTop":V+=q/2,W+=L,se="center";break;case"insideBottom":V+=q/2,W+=$-L,se="center",me="bottom";break;case"insideTopLeft":V+=L,W+=L;break;case"insideTopRight":V+=q-L,W+=L,se="right";break;case"insideBottomLeft":V+=L,W+=$-L,me="bottom";break;case"insideBottomRight":V+=q-L,W+=$-L,se="right",me="bottom";break}return j=j||{},j.x=V,j.y=W,j.textAlign=se,j.textVerticalAlign=me,j}function w(j,U,G){var z={textPosition:j,textDistance:G};return A({},z,U)}function M(j,U,G,z,L){if(!U)return"";var V=(j+"").split(`
|
|
`);L=E(U,G,z,L);for(var W=0,$=V.length;W<$;W++)V[W]=p(V[W],L);return V.join(`
|
|
`)}function E(j,U,G,z){z=R({},z),z.font=U;var G=O(G,"...");z.maxIterations=O(z.maxIterations,2);var L=z.minChar=O(z.minChar,0);z.cnCharWidth=s("\u56FD",U);var V=z.ascCharWidth=s("a",U);z.placeholder=O(z.placeholder,"");for(var W=j=Math.max(0,j-1),$=0;$<L&&W>=V;$++)W-=V;var q=s(G,U);return q>W&&(G="",q=0),W=j-q,z.ellipsis=G,z.ellipsisWidth=q,z.contentWidth=W,z.containerWidth=j,z}function p(j,U){var G=U.containerWidth,z=U.font,L=U.contentWidth;if(!G)return"";var V=s(j,z);if(V<=G)return j;for(var W=0;;W++){if(V<=L||W>=U.maxIterations){j+=U.ellipsis;break}var $=W===0?l(j,L,U.ascCharWidth,U.cnCharWidth):V>0?Math.floor(j.length*L/V):0;j=j.substr(0,$),V=s(j,z)}return j===""&&(j=U.placeholder),j}function l(j,U,G,z){for(var L=0,V=0,W=j.length;V<W&&L<U;V++){var $=j.charCodeAt(V);L+=0<=$&&$<=127?G:z}return V}function u(j){return s("\u56FD",j)}function f(j,U){return r.measureText(j,U)}r.measureText=function(j,U){var G=F();return G.font=U||c,G.measureText(j)};function _(j,U,G,z,L){j!=null&&(j+="");var V=O(z,u(U)),W=j?j.split(`
|
|
`):[],$=W.length*V,q=$,fe=!0;if(G&&(q+=G[0]+G[2]),j&&L){fe=!1;var se=L.outerHeight,me=L.outerWidth;if(se!=null&&q>se)j="",W=[];else if(me!=null)for(var ve=E(me-(G?G[1]+G[3]:0),U,L.ellipsis,{minChar:L.minChar,placeholder:L.placeholder}),Ae=0,ge=W.length;Ae<ge;Ae++)W[Ae]=p(W[Ae],ve)}return{lines:W,height:$,outerHeight:q,lineHeight:V,canCacheByTextString:fe}}function y(j,U){var G={lines:[],width:0,height:0};if(j!=null&&(j+=""),!j)return G;for(var z=d.lastIndex=0,L;(L=d.exec(j))!=null;){var V=L.index;V>z&&v(G,j.substring(z,V)),v(G,L[2],L[1]),z=d.lastIndex}z<j.length&&v(G,j.substring(z,j.length));var W=G.lines,$=0,q=0,fe=[],se=U.textPadding,me=U.truncate,ve=me&&me.outerWidth,Ae=me&&me.outerHeight;se&&(ve!=null&&(ve-=se[1]+se[3]),Ae!=null&&(Ae-=se[0]+se[2]));for(var ge=0;ge<W.length;ge++){for(var ue=W[ge],$e=0,Tt=0,ye=0;ye<ue.tokens.length;ye++){var Re=ue.tokens[ye],nt=Re.styleName&&U.rich[Re.styleName]||{},Ue=Re.textPadding=nt.textPadding,ke=Re.font=nt.font||U.font,lt=Re.textHeight=O(nt.textHeight,u(ke));if(Ue&&(lt+=Ue[0]+Ue[2]),Re.height=lt,Re.lineHeight=D(nt.textLineHeight,U.textLineHeight,lt),Re.textAlign=nt&&nt.textAlign||U.textAlign,Re.textVerticalAlign=nt&&nt.textVerticalAlign||"middle",Ae!=null&&$+Re.lineHeight>Ae)return{lines:[],width:0,height:0};Re.textWidth=s(Re.text,ke);var Fe=nt.textWidth,Ze=Fe==null||Fe==="auto";if(typeof Fe=="string"&&Fe.charAt(Fe.length-1)==="%")Re.percentWidth=Fe,fe.push(Re),Fe=0;else{if(Ze){Fe=Re.textWidth;var Xe=nt.textBackgroundColor,ft=Xe&&Xe.image;ft&&(ft=H.findExistImage(ft),H.isImageReady(ft)&&(Fe=Math.max(Fe,ft.width*lt/ft.height)))}var Rt=Ue?Ue[1]+Ue[3]:0;Fe+=Rt;var Pt=ve!=null?ve-Tt:null;Pt!=null&&Pt<Fe&&(!Ze||Pt<Rt?(Re.text="",Re.textWidth=Fe=0):(Re.text=M(Re.text,Pt-Rt,ke,me.ellipsis,{minChar:me.minChar}),Re.textWidth=s(Re.text,ke),Fe=Re.textWidth+Rt))}Tt+=Re.width=Fe,nt&&($e=Math.max($e,Re.lineHeight))}ue.width=Tt,ue.lineHeight=$e,$+=$e,q=Math.max(q,Tt)}G.outerWidth=G.width=O(U.textWidth,q),G.outerHeight=G.height=O(U.textHeight,$),se&&(G.outerWidth+=se[1]+se[3],G.outerHeight+=se[0]+se[2]);for(var ge=0;ge<fe.length;ge++){var Re=fe[ge],Bt=Re.percentWidth;Re.width=parseInt(Bt,10)/100*q}return G}function v(j,U,G){for(var z=U==="",L=U.split(`
|
|
`),V=j.lines,W=0;W<L.length;W++){var $=L[W],q={styleName:G,text:$,isLineHolder:!$&&!z};if(W)V.push({tokens:[q]});else{var fe=(V[V.length-1]||(V[0]={tokens:[]})).tokens,se=fe.length;se===1&&fe[0].isLineHolder?fe[0]=q:($||!se||z)&&fe.push(q)}}}function N(j){var U=(j.fontSize||j.fontFamily)&&[j.fontStyle,j.fontWeight,(j.fontSize||12)+"px",j.fontFamily||"sans-serif"].join(" ");return U&&m(U)||j.textFont||j.font}re.DEFAULT_FONT=c,re.$override=a,re.getWidth=s,re.getBoundingRect=o,re.adjustTextX=g,re.adjustTextY=C,re.calculateTextPosition=A,re.adjustTextPositionOnRect=w,re.truncateText=M,re.getLineHeight=u,re.measureText=f,re.parsePlainText=_,re.parseRichText=y,re.makeFont=N},"6RRn":function(Ye,re,I){"use strict";var Y=I("wCXF"),H=I("n6Qo");I.d(re,"b",function(){return H.a});var P=I("IBYe"),F=I("6eGT"),R=I("hW8S");I.d(re,"a",function(){return R.a}),re.c=Y.b},"6UM0":function(Ye,re,I){var Y,H;(function(){var P;(function(){"use strict";var R=[function(T,b,i){var d=i(1).Beautifier,c=i(5).Options;function r(a,s){var o=new d(a,s);return o.beautify()}T.exports=r,T.exports.defaultOptions=function(){return new c}},function(T,b,i){var d=i(2).Output,c=i(3).Token,r=i(4),a=i(5).Options,s=i(7).Tokenizer,o=i(7).line_starters,t=i(7).positionable_operators,h=i(7).TOKEN;function g(L,V){return V.indexOf(L)!==-1}function C(L){return L.replace(/^\s+/g,"")}function A(L){for(var V={},W=0;W<L.length;W++)V[L[W].replace(/-/g,"_")]=L[W];return V}function w(L,V){return L&&L.type===h.RESERVED&&L.text===V}function M(L,V){return L&&L.type===h.RESERVED&&g(L.text,V)}var E=["case","return","do","if","throw","else","await","break","continue","async"],p=["before-newline","after-newline","preserve-newline"],l=A(p),u=[l.before_newline,l.preserve_newline],f={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function _(L,V){if(V.multiline_frame||V.mode===f.ForInitializer||V.mode===f.Conditional)return;L.remove_indent(V.start_line_index)}function y(L){L=L.replace(r.allLineBreaks,`
|
|
`);for(var V=[],W=L.indexOf(`
|
|
`);W!==-1;)V.push(L.substring(0,W)),L=L.substring(W+1),W=L.indexOf(`
|
|
`);return L.length&&V.push(L),V}function v(L){return L===f.ArrayLiteral}function N(L){return g(L,[f.Expression,f.ForInitializer,f.Conditional])}function j(L,V){for(var W=0;W<L.length;W++){var $=L[W].trim();if($.charAt(0)!==V)return!1}return!0}function U(L,V){for(var W=0,$=L.length,q;W<$;W++)if(q=L[W],q&&q.indexOf(V)!==0)return!1;return!0}function G(L,V){V=V||{},this._source_text=L||"",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 a(V)}G.prototype.create_flags=function(L,V){var W=0;L&&(W=L.indentation_level,!this._output.just_added_newline()&&L.line_indent_level>W&&(W=L.line_indent_level));var $={mode:V,parent:L,last_token:L?L.last_token:new c(h.START_BLOCK,""),last_word:L?L.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:W,alignment:0,line_indent_level:L?L.line_indent_level:W,start_line_index:this._output.get_line_number(),ternary_depth:0};return $},G.prototype._reset=function(L){var V=L.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new d(this._options,V),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(f.BlockStatement);var W=new s(L,this._options);return this._tokens=W.tokenize(),L},G.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var L,V=this._reset(this._source_text),W=this._options.eol;this._options.eol==="auto"&&(W=`
|
|
`,V&&r.lineBreak.test(V||"")&&(W=V.match(r.lineBreak)[0]));for(var $=this._tokens.next();$;)this.handle_token($),this._last_last_text=this._flags.last_token.text,this._flags.last_token=$,$=this._tokens.next();return L=this._output.get_code(W),L},G.prototype.handle_token=function(L,V){L.type===h.START_EXPR?this.handle_start_expr(L):L.type===h.END_EXPR?this.handle_end_expr(L):L.type===h.START_BLOCK?this.handle_start_block(L):L.type===h.END_BLOCK?this.handle_end_block(L):L.type===h.WORD?this.handle_word(L):L.type===h.RESERVED?this.handle_word(L):L.type===h.SEMICOLON?this.handle_semicolon(L):L.type===h.STRING?this.handle_string(L):L.type===h.EQUALS?this.handle_equals(L):L.type===h.OPERATOR?this.handle_operator(L):L.type===h.COMMA?this.handle_comma(L):L.type===h.BLOCK_COMMENT?this.handle_block_comment(L,V):L.type===h.COMMENT?this.handle_comment(L,V):L.type===h.DOT?this.handle_dot(L):L.type===h.EOF?this.handle_eof(L):L.type===h.UNKNOWN?this.handle_unknown(L,V):this.handle_unknown(L,V)},G.prototype.handle_whitespace_and_comments=function(L,V){var W=L.newlines,$=this._options.keep_array_indentation&&v(this._flags.mode);if(L.comments_before)for(var q=L.comments_before.next();q;)this.handle_whitespace_and_comments(q,V),this.handle_token(q,V),q=L.comments_before.next();if($)for(var fe=0;fe<W;fe+=1)this.print_newline(fe>0,V);else if(this._options.max_preserve_newlines&&W>this._options.max_preserve_newlines&&(W=this._options.max_preserve_newlines),this._options.preserve_newlines&&W>1){this.print_newline(!1,V);for(var se=1;se<W;se+=1)this.print_newline(!0,V)}};var z=["async","break","continue","return","throw","yield"];G.prototype.allow_wrap_or_preserved_newline=function(L,V){if(V=V===void 0?!1:V,this._output.just_added_newline())return;var W=this._options.preserve_newlines&&L.newlines||V,$=g(this._flags.last_token.text,t)||g(L.text,t);if($){var q=g(this._flags.last_token.text,t)&&g(this._options.operator_position,u)||g(L.text,t);W=W&&q}if(W)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(M(this._flags.last_token,z))return;this._output.set_wrap_point()}},G.prototype.print_newline=function(L,V){if(!V&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==h.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var W=this._tokens.peek();this._flags.mode===f.Statement&&!(this._flags.if_block&&w(W,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(L)&&(this._flags.multiline_frame=!0)},G.prototype.print_token_line_indentation=function(L){this._output.just_added_newline()&&(this._options.keep_array_indentation&&L.newlines&&(L.text==="["||v(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(L.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(L){if(this._output.raw){this._output.add_raw_token(L);return}if(this._options.comma_first&&L.previous&&L.previous.type===h.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(L),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(L),this._output.non_breaking_space=!0,this._output.add_token(L.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(L){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,L),this._flags=this.create_flags(this._previous_flags,L),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===f.Statement&&_(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===f.ObjectLiteral&&this._flags.mode===f.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||M(this._flags.last_token,["get","set"]))},G.prototype.start_of_statement=function(L){var V=!1;return V=V||M(this._flags.last_token,["var","let","const"])&&L.type===h.WORD,V=V||w(this._flags.last_token,"do"),V=V||!(this._flags.parent.mode===f.ObjectLiteral&&this._flags.mode===f.Statement)&&M(this._flags.last_token,z)&&!L.newlines,V=V||w(this._flags.last_token,"else")&&!(w(L,"if")&&!L.comments_before),V=V||this._flags.last_token.type===h.END_EXPR&&(this._previous_flags.mode===f.ForInitializer||this._previous_flags.mode===f.Conditional),V=V||this._flags.last_token.type===h.WORD&&this._flags.mode===f.BlockStatement&&!this._flags.in_case&&!(L.text==="--"||L.text==="++")&&this._last_last_text!=="function"&&L.type!==h.WORD&&L.type!==h.RESERVED,V=V||this._flags.mode===f.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||M(this._flags.last_token,["get","set"])),V?(this.set_mode(f.Statement),this.indent(),this.handle_whitespace_and_comments(L,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(L,M(L,["do","for","if","while"])),!0):!1},G.prototype.handle_start_expr=function(L){this.start_of_statement(L)||this.handle_whitespace_and_comments(L);var V=f.Expression;if(L.text==="["){if(this._flags.last_token.type===h.WORD||this._flags.last_token.text===")"){M(this._flags.last_token,o)&&(this._output.space_before_token=!0),this.print_token(L),this.set_mode(V),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}V=f.ArrayLiteral,v(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())),g(this._flags.last_token.type,[h.START_EXPR,h.END_EXPR,h.WORD,h.OPERATOR,h.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===h.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,V=f.ForInitializer):g(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,V=f.Conditional):g(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&L.whitespace_before===""?this._output.space_before_token=!1:(g(this._flags.last_token.text,o)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===h.EQUALS||this._flags.last_token.type===h.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(L);else if(this._flags.last_token.type===h.WORD){this._output.space_before_token=!1;var W=this._tokens.peek(-3);if(this._options.space_after_named_function&&W){var $=this._tokens.peek(-4);M(W,["async","function"])||W.text==="*"&&M($,["async","function"])?this._output.space_before_token=!0:this._flags.mode===f.ObjectLiteral?(W.text==="{"||W.text===","||W.text==="*"&&($.text==="{"||$.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(L);(this._flags.last_token.type===h.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(g(this._last_last_text,["function","yield"])||this._flags.mode===f.ObjectLiteral&&g(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===h.START_BLOCK?this.print_newline():(this._flags.last_token.type===h.END_EXPR||this._flags.last_token.type===h.START_EXPR||this._flags.last_token.type===h.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===h.COMMA)&&this.allow_wrap_or_preserved_newline(L,L.newlines),this.print_token(L),this.set_mode(V),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},G.prototype.handle_end_expr=function(L){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(L),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(L,L.text==="]"&&v(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===h.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(L),this.restore_mode(),_(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===f.Conditional&&(this._previous_flags.mode=f.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},G.prototype.handle_start_block=function(L){this.handle_whitespace_and_comments(L);var V=this._tokens.peek(),W=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===h.END_EXPR?(this.set_mode(f.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(f.BlockStatement):W&&(g(W.text,[":",","])&&g(V.type,[h.STRING,h.WORD,h.RESERVED])||g(V.text,["get","set","..."])&&g(W.type,[h.WORD,h.RESERVED]))?g(this._last_last_text,["class","interface"])&&!g(W.text,[":",","])?this.set_mode(f.BlockStatement):this.set_mode(f.ObjectLiteral):this._flags.last_token.type===h.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(f.BlockStatement):g(this._flags.last_token.type,[h.EQUALS,h.START_EXPR,h.COMMA,h.OPERATOR])||M(this._flags.last_token,["return","throw","import","default"])?this.set_mode(f.ObjectLiteral):this.set_mode(f.BlockStatement),this._flags.last_token&&(M(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var $=!V.comments_before&&V.text==="}",q=$&&this._flags.last_word==="function"&&this._flags.last_token.type===h.END_EXPR;if(this._options.brace_preserve_inline){var fe=0,se=null;this._flags.inline_frame=!0;do if(fe+=1,se=this._tokens.peek(fe-1),se.newlines){this._flags.inline_frame=!1;break}while(se.type!==h.EOF&&!(se.type===h.END_BLOCK&&se.opened===L))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&L.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==h.OPERATOR&&(q||this._flags.last_token.type===h.EQUALS||M(this._flags.last_token,E)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(v(this._previous_flags.mode)&&(this._flags.last_token.type===h.START_EXPR||this._flags.last_token.type===h.COMMA)&&((this._flags.last_token.type===h.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===h.COMMA||this._flags.last_token.type===h.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(L),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==h.OPERATOR&&this._flags.last_token.type!==h.START_EXPR&&(this._flags.last_token.type===h.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(L),this.indent(),!$&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},G.prototype.handle_end_block=function(L){for(this.handle_whitespace_and_comments(L);this._flags.mode===f.Statement;)this.restore_mode();var V=this._flags.last_token.type===h.START_BLOCK;this._flags.inline_frame&&!V?this._output.space_before_token=!0:this._options.brace_style==="expand"?V||this.print_newline():V||(v(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(L)},G.prototype.handle_word=function(L){if(L.type===h.RESERVED){if(g(L.text,["set","get"])&&this._flags.mode!==f.ObjectLiteral)L.type=h.WORD;else if(L.text==="import"&&g(this._tokens.peek().text,["(","."]))L.type=h.WORD;else if(g(L.text,["as","from"])&&!this._flags.import_block)L.type=h.WORD;else if(this._flags.mode===f.ObjectLiteral){var V=this._tokens.peek();V.text===":"&&(L.type=h.WORD)}}if(this.start_of_statement(L)?M(this._flags.last_token,["var","let","const"])&&L.type===h.WORD&&(this._flags.declaration_statement=!0):L.newlines&&!N(this._flags.mode)&&(this._flags.last_token.type!==h.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==h.EQUALS&&(this._options.preserve_newlines||!M(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(L),this.print_newline()):this.handle_whitespace_and_comments(L),this._flags.do_block&&!this._flags.do_while)if(w(L,"while")){this._output.space_before_token=!0,this.print_token(L),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&&w(L,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===f.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&M(L,["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(L),this._flags.in_case=!0;return}if((this._flags.last_token.type===h.COMMA||this._flags.last_token.type===h.START_EXPR||this._flags.last_token.type===h.EQUALS||this._flags.last_token.type===h.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(L)),w(L,"function")){(g(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(g(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===h.OPERATOR))&&(!this._output.just_added_blankline()&&!L.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===h.RESERVED||this._flags.last_token.type===h.WORD?M(this._flags.last_token,["get","set","new","export"])||M(this._flags.last_token,z)?this._output.space_before_token=!0:w(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===h.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(N(this._flags.mode)||v(this._flags.mode))||this.print_newline(),this.print_token(L),this._flags.last_word=L.text;return}var W="NONE";if(this._flags.last_token.type===h.END_BLOCK?this._previous_flags.inline_frame?W="SPACE":M(L,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&L.newlines?W="NEWLINE":(W="SPACE",this._output.space_before_token=!0):W="NEWLINE":this._flags.last_token.type===h.SEMICOLON&&this._flags.mode===f.BlockStatement?W="NEWLINE":this._flags.last_token.type===h.SEMICOLON&&N(this._flags.mode)?W="SPACE":this._flags.last_token.type===h.STRING?W="NEWLINE":this._flags.last_token.type===h.RESERVED||this._flags.last_token.type===h.WORD||this._flags.last_token.text==="*"&&(g(this._last_last_text,["function","yield"])||this._flags.mode===f.ObjectLiteral&&g(this._last_last_text,["{",","]))?W="SPACE":this._flags.last_token.type===h.START_BLOCK?this._flags.inline_frame?W="SPACE":W="NEWLINE":this._flags.last_token.type===h.END_EXPR&&(this._output.space_before_token=!0,W="NEWLINE"),M(L,o)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?W="SPACE":W="NEWLINE"),M(L,["else","catch","finally"]))if((!(this._flags.last_token.type===h.END_BLOCK&&this._previous_flags.mode===f.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&L.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var $=this._output.current_line;$.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else W==="NEWLINE"?M(this._flags.last_token,E)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&M(L,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==h.END_EXPR?(this._flags.last_token.type!==h.START_EXPR||!M(L,["var","let","const"]))&&this._flags.last_token.text!==":"&&(w(L,"if")&&w(L.previous,"else")?this._output.space_before_token=!0:this.print_newline()):M(L,o)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&v(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():W==="SPACE"&&(this._output.space_before_token=!0);L.previous&&(L.previous.type===h.WORD||L.previous.type===h.RESERVED)&&(this._output.space_before_token=!0),this.print_token(L),this._flags.last_word=L.text,L.type===h.RESERVED&&(L.text==="do"?this._flags.do_block=!0:L.text==="if"?this._flags.if_block=!0:L.text==="import"?this._flags.import_block=!0:this._flags.import_block&&w(L,"from")&&(this._flags.import_block=!1))},G.prototype.handle_semicolon=function(L){this.start_of_statement(L)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(L);for(var V=this._tokens.peek();this._flags.mode===f.Statement&&!(this._flags.if_block&&w(V,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(L)},G.prototype.handle_string=function(L){L.text.startsWith("`")&&L.newlines===0&&L.whitespace_before===""&&(L.previous.text===")"||this._flags.last_token.type===h.WORD)||(this.start_of_statement(L)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(L),this._flags.last_token.type===h.RESERVED||this._flags.last_token.type===h.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===h.COMMA||this._flags.last_token.type===h.START_EXPR||this._flags.last_token.type===h.EQUALS||this._flags.last_token.type===h.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(L):L.text.startsWith("`")&&this._flags.last_token.type===h.END_EXPR&&(L.previous.text==="]"||L.previous.text===")")&&L.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(L)},G.prototype.handle_equals=function(L){this.start_of_statement(L)||this.handle_whitespace_and_comments(L),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(L),this._output.space_before_token=!0},G.prototype.handle_comma=function(L){this.handle_whitespace_and_comments(L,!0),this.print_token(L),this._output.space_before_token=!0,this._flags.declaration_statement?(N(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(L)):this._flags.mode===f.ObjectLiteral||this._flags.mode===f.Statement&&this._flags.parent.mode===f.ObjectLiteral?(this._flags.mode===f.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(L)},G.prototype.handle_operator=function(L){var V=L.text==="*"&&(M(this._flags.last_token,["function","yield"])||g(this._flags.last_token.type,[h.START_BLOCK,h.COMMA,h.END_BLOCK,h.SEMICOLON])),W=g(L.text,["-","+"])&&(g(this._flags.last_token.type,[h.START_BLOCK,h.START_EXPR,h.EQUALS,h.OPERATOR])||g(this._flags.last_token.text,o)||this._flags.last_token.text===",");if(!this.start_of_statement(L)){var $=!V;this.handle_whitespace_and_comments(L,$)}if(L.text==="*"&&this._flags.last_token.type===h.DOT){this.print_token(L);return}if(L.text==="::"){this.print_token(L);return}if(this._flags.last_token.type===h.OPERATOR&&g(this._options.operator_position,u)&&this.allow_wrap_or_preserved_newline(L),L.text===":"&&this._flags.in_case){this.print_token(L),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==h.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 q=!0,fe=!0,se=!1;if(L.text===":"?this._flags.ternary_depth===0?q=!1:(this._flags.ternary_depth-=1,se=!0):L.text==="?"&&(this._flags.ternary_depth+=1),!W&&!V&&this._options.preserve_newlines&&g(L.text,t)){var me=L.text===":",ve=me&&se,Ae=me&&!se;switch(this._options.operator_position){case l.before_newline:this._output.space_before_token=!Ae,this.print_token(L),(!me||ve)&&this.allow_wrap_or_preserved_newline(L),this._output.space_before_token=!0;return;case l.after_newline:this._output.space_before_token=!0,!me||ve?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(L):this._output.space_before_token=!1,this.print_token(L),this._output.space_before_token=!0;return;case l.preserve_newline:Ae||this.allow_wrap_or_preserved_newline(L),q=!(this._output.just_added_newline()||Ae),this._output.space_before_token=q,this.print_token(L),this._output.space_before_token=!0;return}}if(V){this.allow_wrap_or_preserved_newline(L),q=!1;var ge=this._tokens.peek();fe=ge&&g(ge.type,[h.WORD,h.RESERVED])}else if(L.text==="...")this.allow_wrap_or_preserved_newline(L),q=this._flags.last_token.type===h.START_BLOCK,fe=!1;else if(g(L.text,["--","++","!","~"])||W){if((this._flags.last_token.type===h.COMMA||this._flags.last_token.type===h.START_EXPR)&&this.allow_wrap_or_preserved_newline(L),q=!1,fe=!1,L.newlines&&(L.text==="--"||L.text==="++"||L.text==="~")){var ue=M(this._flags.last_token,E)&&L.newlines;ue&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ue,!0)}this._flags.last_token.text===";"&&N(this._flags.mode)&&(q=!0),this._flags.last_token.type===h.RESERVED?q=!0:this._flags.last_token.type===h.END_EXPR?q=!(this._flags.last_token.text==="]"&&(L.text==="--"||L.text==="++")):this._flags.last_token.type===h.OPERATOR&&(q=g(L.text,["--","-","++","+"])&&g(this._flags.last_token.text,["--","-","++","+"]),g(L.text,["+","-"])&&g(this._flags.last_token.text,["--","++"])&&(fe=!0)),(this._flags.mode===f.BlockStatement&&!this._flags.inline_frame||this._flags.mode===f.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||q,this.print_token(L),this._output.space_before_token=fe},G.prototype.handle_block_comment=function(L,V){if(this._output.raw){this._output.add_raw_token(L),L.directives&&L.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(L.directives){this.print_newline(!1,V),this.print_token(L),L.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!r.newline.test(L.text)&&!L.newlines){this._output.space_before_token=!0,this.print_token(L),this._output.space_before_token=!0;return}else this.print_block_commment(L,V)},G.prototype.print_block_commment=function(L,V){var W=y(L.text),$,q=!1,fe=!1,se=L.whitespace_before,me=se.length;if(this.print_newline(!1,V),this.print_token_line_indentation(L),this._output.add_token(W[0]),this.print_newline(!1,V),W.length>1){for(W=W.slice(1),q=j(W,"*"),fe=U(W,se),q&&(this._flags.alignment=1),$=0;$<W.length;$++)q?(this.print_token_line_indentation(L),this._output.add_token(C(W[$]))):fe&&W[$]?(this.print_token_line_indentation(L),this._output.add_token(W[$].substring(me))):(this._output.current_line.set_indent(-1),this._output.add_token(W[$])),this.print_newline(!1,V);this._flags.alignment=0}},G.prototype.handle_comment=function(L,V){L.newlines?this.print_newline(!1,V):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(L),this.print_newline(!1,V)},G.prototype.handle_dot=function(L){this.start_of_statement(L)||this.handle_whitespace_and_comments(L,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),M(this._flags.last_token,E)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(L,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(L)},G.prototype.handle_unknown=function(L,V){this.print_token(L),L.text[L.text.length-1]===`
|
|
`&&this.print_newline(!1,V)},G.prototype.handle_eof=function(L){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(L)},T.exports.Beautifier=G},function(T){function b(c){this.__parent=c,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}b.prototype.clone_empty=function(){var c=new b(this.__parent);return c.set_indent(this.__indent_count,this.__alignment_count),c},b.prototype.item=function(c){return c<0?this.__items[this.__items.length+c]:this.__items[c]},b.prototype.has_match=function(c){for(var r=this.__items.length-1;r>=0;r--)if(this.__items[r].match(c))return!0;return!1},b.prototype.set_indent=function(c,r){this.is_empty()&&(this.__indent_count=c||0,this.__alignment_count=r||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},b.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)},b.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},b.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var c=this.__parent.current_line;return c.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),c.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),c.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,c.__items[0]===" "&&(c.__items.splice(0,1),c.__character_count-=1),!0}return!1},b.prototype.is_empty=function(){return this.__items.length===0},b.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},b.prototype.push=function(c){this.__items.push(c);var r=c.lastIndexOf(`
|
|
`);r!==-1?this.__character_count=c.length-r:this.__character_count+=c.length},b.prototype.pop=function(){var c=null;return this.is_empty()||(c=this.__items.pop(),this.__character_count-=c.length),c},b.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},b.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},b.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},b.prototype.toString=function(){var c="";return this.is_empty()?this.__parent.indent_empty_lines&&(c=this.__parent.get_indent_string(this.__indent_count)):(c=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),c+=this.__items.join("")),c};function i(c,r){this.__cache=[""],this.__indent_size=c.indent_size,this.__indent_string=c.indent_char,c.indent_with_tabs||(this.__indent_string=new Array(c.indent_size+1).join(c.indent_char)),r=r||"",c.indent_level>0&&(r=new Array(c.indent_level+1).join(this.__indent_string)),this.__base_string=r,this.__base_string_length=r.length}i.prototype.get_indent_size=function(c,r){var a=this.__base_string_length;return r=r||0,c<0&&(a=0),a+=c*this.__indent_size,a+=r,a},i.prototype.get_indent_string=function(c,r){var a=this.__base_string;return r=r||0,c<0&&(c=0,a=""),r+=c*this.__indent_size,this.__ensure_cache(r),a+=this.__cache[r],a},i.prototype.__ensure_cache=function(c){for(;c>=this.__cache.length;)this.__add_column()},i.prototype.__add_column=function(){var c=this.__cache.length,r=0,a="";this.__indent_size&&c>=this.__indent_size&&(r=Math.floor(c/this.__indent_size),c-=r*this.__indent_size,a=new Array(r+1).join(this.__indent_string)),c&&(a+=new Array(c+1).join(" ")),this.__cache.push(a)};function d(c,r){this.__indent_cache=new i(c,r),this.raw=!1,this._end_with_newline=c.end_with_newline,this.indent_size=c.indent_size,this.wrap_line_length=c.wrap_line_length,this.indent_empty_lines=c.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new b(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(c,r){return this.__indent_cache.get_indent_string(c,r)},d.prototype.get_indent_size=function(c,r){return this.__indent_cache.get_indent_size(c,r)},d.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},d.prototype.add_new_line=function(c){return this.is_empty()||!c&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},d.prototype.get_code=function(c){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 a=this.__lines.join(`
|
|
`);return c!==`
|
|
`&&(a=a.replace(/[\n]/g,c)),a},d.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},d.prototype.set_indent=function(c,r){return c=c||0,r=r||0,this.next_line.set_indent(c,r),this.__lines.length>1?(this.current_line.set_indent(c,r),!0):(this.current_line.set_indent(),!1)},d.prototype.add_raw_token=function(c){for(var r=0;r<c.newlines;r++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(c.whitespace_before),this.current_line.push(c.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},d.prototype.add_token=function(c){this.__add_space_before_token(),this.current_line.push(c),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},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(c){for(var r=this.__lines.length;c<r;)this.__lines[c]._remove_indent(),c++;this.current_line._remove_wrap_indent()},d.prototype.trim=function(c){for(c=c===void 0?!1:c,this.current_line.trim();c&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},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(c,r){for(var a=this.__lines.length-2;a>=0;){var s=this.__lines[a];if(s.is_empty())break;if(s.item(0).indexOf(c)!==0&&s.item(-1)!==r){this.__lines.splice(a+1,0,new b(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},T.exports.Output=d},function(T){function b(i,d,c,r){this.type=i,this.text=d,this.comments_before=null,this.newlines=c||0,this.whitespace_before=r||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}T.exports.Token=b},function(T,b){var i="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",d="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",c="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",r="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",a="(?:\\\\u[0-9a-fA-F]{4}|["+i+c+"])",s="(?:\\\\u[0-9a-fA-F]{4}|["+d+c+r+"])*";b.identifier=new RegExp(a+s,"g"),b.identifierStart=new RegExp(a),b.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+d+c+r+"])+");var o=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;b.newline=/[\n\r\u2028\u2029]/,b.lineBreak=new RegExp(`\r
|
|
|`+b.newline.source),b.allLineBreaks=new RegExp(b.lineBreak.source,"g")},function(T,b,i){var d=i(6).Options,c=["before-newline","after-newline","preserve-newline"];function r(a){d.call(this,a,"js");var s=this.raw_options.brace_style||null;s==="expand-strict"?this.raw_options.brace_style="expand":s==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var o=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var t=0;t<o.length;t++)o[t]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=o[t];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",c),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}r.prototype=new d,T.exports.Options=r},function(T){function b(c,r){this.raw_options=i(c,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"])}b.prototype._get_array=function(c,r){var a=this.raw_options[c],s=r||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(s=a.concat()):typeof a=="string"&&(s=a.split(/[^a-zA-Z0-9_\/\-]+/)),s},b.prototype._get_boolean=function(c,r){var a=this.raw_options[c],s=a===void 0?!!r:!!a;return s},b.prototype._get_characters=function(c,r){var a=this.raw_options[c],s=r||"";return typeof a=="string"&&(s=a.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),s},b.prototype._get_number=function(c,r){var a=this.raw_options[c];r=parseInt(r,10),isNaN(r)&&(r=0);var s=parseInt(a,10);return isNaN(s)&&(s=r),s},b.prototype._get_selection=function(c,r,a){var s=this._get_selection_list(c,r,a);if(s.length!==1)throw new Error("Invalid Option Value: The option '"+c+`' can only be one of the following values:
|
|
`+r+`
|
|
You passed in: '`+this.raw_options[c]+"'");return s[0]},b.prototype._get_selection_list=function(c,r,a){if(!r||r.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[r[0]],!this._is_valid_selection(a,r))throw new Error("Invalid Default Value!");var s=this._get_array(c,a);if(!this._is_valid_selection(s,r))throw new Error("Invalid Option Value: The option '"+c+`' can contain only the following values:
|
|
`+r+`
|
|
You passed in: '`+this.raw_options[c]+"'");return s},b.prototype._is_valid_selection=function(c,r){return c.length&&r.length&&!c.some(function(a){return r.indexOf(a)===-1})};function i(c,r){var a={};c=d(c);var s;for(s in c)s!==r&&(a[s]=c[s]);if(r&&c[r])for(s in c[r])a[s]=c[r][s];return a}function d(c){var r={},a;for(a in c){var s=a.replace(/-/g,"_");r[s]=c[a]}return r}T.exports.Options=b,T.exports.normalizeOpts=d,T.exports.mergeOpts=i},function(T,b,i){var d=i(8).InputScanner,c=i(9).Tokenizer,r=i(9).TOKEN,a=i(13).Directives,s=i(4),o=i(12).Pattern,t=i(14).TemplatablePattern;function h(j,U){return U.indexOf(j)!==-1}var g={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:r.START,RAW:r.RAW,EOF:r.EOF},C=new a(/\/\*/,/\*\//),A=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,w=/[0-9]/,M=/[^\d\.]/,E=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),p=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";p=p.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),p="\\?\\.(?!\\d) "+p,p=p.replace(/ /g,"|");var l=new RegExp(p),u="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),f=u.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),_=new RegExp("^(?:"+f.join("|")+")$"),y,v=function(j,U){c.call(this,j,U),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var G=new o(this._input),z=new t(this._input).read_options(this._options);this.__patterns={template:z,identifier:z.starting_with(s.identifier).matching(s.identifierMatch),number:G.matching(A),punct:G.matching(l),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(s.lineBreak),shebang:G.starting_with(/#!/).until_after(s.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:z.until(/['\\\n\r\u2028\u2029]/),double_quote:z.until(/["\\\n\r\u2028\u2029]/),template_text:z.until(/[`\\$]/),template_expression:z.until(/[`}\\]/)}};v.prototype=new c,v.prototype._is_comment=function(j){return j.type===g.COMMENT||j.type===g.BLOCK_COMMENT||j.type===g.UNKNOWN},v.prototype._is_opening=function(j){return j.type===g.START_BLOCK||j.type===g.START_EXPR},v.prototype._is_closing=function(j,U){return(j.type===g.END_BLOCK||j.type===g.END_EXPR)&&U&&(j.text==="]"&&U.text==="["||j.text===")"&&U.text==="("||j.text==="}"&&U.text==="{")},v.prototype._reset=function(){y=!1},v.prototype._get_next_token=function(j,U){var G=null;this._readWhitespace();var z=this._input.peek();return z===null?this._create_token(g.EOF,""):(G=G||this._read_non_javascript(z),G=G||this._read_string(z),G=G||this._read_word(j),G=G||this._read_singles(z),G=G||this._read_comment(z),G=G||this._read_regexp(z,j),G=G||this._read_xml(z,j),G=G||this._read_punctuation(),G=G||this._create_token(g.UNKNOWN,this._input.next()),G)},v.prototype._read_word=function(j){var U;if(U=this.__patterns.identifier.read(),U!=="")return U=U.replace(s.allLineBreaks,`
|
|
`),!(j.type===g.DOT||j.type===g.RESERVED&&(j.text==="set"||j.text==="get"))&&_.test(U)?(U==="in"||U==="of")&&(j.type===g.WORD||j.type===g.STRING)?this._create_token(g.OPERATOR,U):this._create_token(g.RESERVED,U):this._create_token(g.WORD,U);if(U=this.__patterns.number.read(),U!=="")return this._create_token(g.WORD,U)},v.prototype._read_singles=function(j){var U=null;return j==="("||j==="["?U=this._create_token(g.START_EXPR,j):j===")"||j==="]"?U=this._create_token(g.END_EXPR,j):j==="{"?U=this._create_token(g.START_BLOCK,j):j==="}"?U=this._create_token(g.END_BLOCK,j):j===";"?U=this._create_token(g.SEMICOLON,j):j==="."&&M.test(this._input.peek(1))?U=this._create_token(g.DOT,j):j===","&&(U=this._create_token(g.COMMA,j)),U&&this._input.next(),U},v.prototype._read_punctuation=function(){var j=this.__patterns.punct.read();if(j!=="")return j==="="?this._create_token(g.EQUALS,j):j==="?."?this._create_token(g.DOT,j):this._create_token(g.OPERATOR,j)},v.prototype._read_non_javascript=function(j){var U="";if(j==="#"){if(this._is_first_token()&&(U=this.__patterns.shebang.read(),U))return this._create_token(g.UNKNOWN,U.trim()+`
|
|
`);if(U=this.__patterns.include.read(),U)return this._create_token(g.UNKNOWN,U.trim()+`
|
|
`);j=this._input.next();var G="#";if(this._input.hasNext()&&this._input.testChar(w)){do j=this._input.next(),G+=j;while(this._input.hasNext()&&j!=="#"&&j!=="=");return j==="#"||(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(g.WORD,G)}this._input.back()}else if(j==="<"&&this._is_first_token()){if(U=this.__patterns.html_comment_start.read(),U){for(;this._input.hasNext()&&!this._input.testChar(s.newline);)U+=this._input.next();return y=!0,this._create_token(g.COMMENT,U)}}else if(y&&j==="-"&&(U=this.__patterns.html_comment_end.read(),U))return y=!1,this._create_token(g.COMMENT,U);return null},v.prototype._read_comment=function(j){var U=null;if(j==="/"){var G="";if(this._input.peek(1)==="*"){G=this.__patterns.block_comment.read();var z=C.get_directives(G);z&&z.ignore==="start"&&(G+=C.readIgnored(this._input)),G=G.replace(s.allLineBreaks,`
|
|
`),U=this._create_token(g.BLOCK_COMMENT,G),U.directives=z}else this._input.peek(1)==="/"&&(G=this.__patterns.comment.read(),U=this._create_token(g.COMMENT,G))}return U},v.prototype._read_string=function(j){if(j==="`"||j==="'"||j==='"'){var U=this._input.next();return this.has_char_escapes=!1,j==="`"?U+=this._read_string_recursive("`",!0,"${"):U+=this._read_string_recursive(j),this.has_char_escapes&&this._options.unescape_strings&&(U=N(U)),this._input.peek()===j&&(U+=this._input.next()),U=U.replace(s.allLineBreaks,`
|
|
`),this._create_token(g.STRING,U)}return null},v.prototype._allow_regexp_or_xml=function(j){return j.type===g.RESERVED&&h(j.text,["return","case","throw","else","do","typeof","yield"])||j.type===g.END_EXPR&&j.text===")"&&j.opened.previous.type===g.RESERVED&&h(j.opened.previous.text,["if","while","for"])||h(j.type,[g.COMMENT,g.START_EXPR,g.START_BLOCK,g.START,g.END_BLOCK,g.OPERATOR,g.EQUALS,g.EOF,g.SEMICOLON,g.COMMA])},v.prototype._read_regexp=function(j,U){if(j==="/"&&this._allow_regexp_or_xml(U)){for(var G=this._input.next(),z=!1,L=!1;this._input.hasNext()&&(z||L||this._input.peek()!==j)&&!this._input.testChar(s.newline);)G+=this._input.peek(),z?z=!1:(z=this._input.peek()==="\\",this._input.peek()==="["?L=!0:this._input.peek()==="]"&&(L=!1)),this._input.next();return this._input.peek()===j&&(G+=this._input.next(),G+=this._input.read(s.identifier)),this._create_token(g.STRING,G)}return null},v.prototype._read_xml=function(j,U){if(this._options.e4x&&j==="<"&&this._allow_regexp_or_xml(U)){var G="",z=this.__patterns.xml.read_match();if(z){for(var L=z[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),V=L.indexOf("{")===0,W=0;z;){var $=!!z[1],q=z[2],fe=!!z[z.length-1]||q.slice(0,8)==="![CDATA[";if(!fe&&(q===L||V&&q.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&($?--W:++W),G+=z[0],W<=0)break;z=this.__patterns.xml.read_match()}return z||(G+=this._input.match(/[\s\S]*/g)[0]),G=G.replace(s.allLineBreaks,`
|
|
`),this._create_token(g.STRING,G)}}return null};function N(j){for(var U="",G=0,z=new d(j),L=null;z.hasNext();)if(L=z.match(/([\s]|[^\\]|\\\\)+/g),L&&(U+=L[0]),z.peek()==="\\"){if(z.next(),z.peek()==="x")L=z.match(/x([0-9A-Fa-f]{2})/g);else if(z.peek()==="u")L=z.match(/u([0-9A-Fa-f]{4})/g);else{U+="\\",z.hasNext()&&(U+=z.next());continue}if(!L)return j;if(G=parseInt(L[1],16),G>126&&G<=255&&L[0].indexOf("x")===0)return j;if(G>=0&&G<32){U+="\\"+L[0];continue}else G===34||G===39||G===92?U+="\\"+String.fromCharCode(G):U+=String.fromCharCode(G)}return U}v.prototype._read_string_recursive=function(j,U,G){var z,L;j==="'"?L=this.__patterns.single_quote:j==='"'?L=this.__patterns.double_quote:j==="`"?L=this.__patterns.template_text:j==="}"&&(L=this.__patterns.template_expression);for(var V=L.read(),W="";this._input.hasNext();){if(W=this._input.next(),W===j||!U&&s.newline.test(W)){this._input.back();break}else W==="\\"&&this._input.hasNext()?(z=this._input.peek(),z==="x"||z==="u"?this.has_char_escapes=!0:z==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),W+=this._input.next()):G&&(G==="${"&&W==="$"&&this._input.peek()==="{"&&(W+=this._input.next()),G===W&&(j==="`"?W+=this._read_string_recursive("}",U,"`"):W+=this._read_string_recursive("`",U,"${"),this._input.hasNext()&&(W+=this._input.next())));W+=L.read(),V+=W}return V},T.exports.Tokenizer=v,T.exports.TOKEN=g,T.exports.positionable_operators=E.slice(),T.exports.line_starters=u.slice()},function(T){var b=RegExp.prototype.hasOwnProperty("sticky");function i(d){this.__input=d||"",this.__input_length=this.__input.length,this.__position=0}i.prototype.restart=function(){this.__position=0},i.prototype.back=function(){this.__position>0&&(this.__position-=1)},i.prototype.hasNext=function(){return this.__position<this.__input_length},i.prototype.next=function(){var d=null;return this.hasNext()&&(d=this.__input.charAt(this.__position),this.__position+=1),d},i.prototype.peek=function(d){var c=null;return d=d||0,d+=this.__position,d>=0&&d<this.__input_length&&(c=this.__input.charAt(d)),c},i.prototype.__match=function(d,c){d.lastIndex=c;var r=d.exec(this.__input);return r&&!(b&&d.sticky)&&(r.index!==c&&(r=null)),r},i.prototype.test=function(d,c){return c=c||0,c+=this.__position,c>=0&&c<this.__input_length?!!this.__match(d,c):!1},i.prototype.testChar=function(d,c){var r=this.peek(c);return d.lastIndex=0,r!==null&&d.test(r)},i.prototype.match=function(d){var c=this.__match(d,this.__position);return c?this.__position+=c[0].length:c=null,c},i.prototype.read=function(d,c,r){var a="",s;return d&&(s=this.match(d),s&&(a+=s[0])),c&&(s||!d)&&(a+=this.readUntil(c,r)),a},i.prototype.readUntil=function(d,c){var r="",a=this.__position;d.lastIndex=this.__position;var s=d.exec(this.__input);return s?(a=s.index,c&&(a+=s[0].length)):a=this.__input_length,r=this.__input.substring(this.__position,a),this.__position=a,r},i.prototype.readUntilAfter=function(d){return this.readUntil(d,!0)},i.prototype.get_regexp=function(d,c){var r=null,a="g";return c&&b&&(a="y"),typeof d=="string"&&d!==""?r=new RegExp(d,a):d&&(r=new RegExp(d.source,a)),r},i.prototype.get_literal_regexp=function(d){return RegExp(d.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},i.prototype.peekUntilAfter=function(d){var c=this.__position,r=this.readUntilAfter(d);return this.__position=c,r},i.prototype.lookBack=function(d){var c=this.__position-1;return c>=d.length&&this.__input.substring(c-d.length,c).toLowerCase()===d},T.exports.InputScanner=i},function(T,b,i){var d=i(8).InputScanner,c=i(3).Token,r=i(10).TokenStream,a=i(11).WhitespacePattern,s={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(t,h){this._input=new d(t),this._options=h||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new a(this._input)};o.prototype.tokenize=function(){this._input.restart(),this.__tokens=new r,this._reset();for(var t,h=new c(s.START,""),g=null,C=[],A=new r;h.type!==s.EOF;){for(t=this._get_next_token(h,g);this._is_comment(t);)A.add(t),t=this._get_next_token(h,g);A.isEmpty()||(t.comments_before=A,A=new r),t.parent=g,this._is_opening(t)?(C.push(g),g=t):g&&this._is_closing(t,g)&&(t.opened=g,g.closed=t,g=C.pop(),t.parent=g),t.previous=h,h.next=t,this.__tokens.add(t),h=t}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(t,h){this._readWhitespace();var g=this._input.read(/.+/g);return g?this._create_token(s.RAW,g):this._create_token(s.EOF,"")},o.prototype._is_comment=function(t){return!1},o.prototype._is_opening=function(t){return!1},o.prototype._is_closing=function(t,h){return!1},o.prototype._create_token=function(t,h){var g=new c(t,h,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return g},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},T.exports.Tokenizer=o,T.exports.TOKEN=s},function(T){function b(i){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=i}b.prototype.restart=function(){this.__position=0},b.prototype.isEmpty=function(){return this.__tokens_length===0},b.prototype.hasNext=function(){return this.__position<this.__tokens_length},b.prototype.next=function(){var i=null;return this.hasNext()&&(i=this.__tokens[this.__position],this.__position+=1),i},b.prototype.peek=function(i){var d=null;return i=i||0,i+=this.__position,i>=0&&i<this.__tokens_length&&(d=this.__tokens[i]),d},b.prototype.add=function(i){this.__parent_token&&(i.parent=this.__parent_token),this.__tokens.push(i),this.__tokens_length+=1},T.exports.TokenStream=b},function(T,b,i){var d=i(12).Pattern;function c(r,a){d.call(this,r,a),a?this._line_regexp=this._input.get_regexp(a._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}c.prototype=new d,c.prototype.__set_whitespace_patterns=function(r,a){r+="\\t ",a+="\\n\\r",this._match_pattern=this._input.get_regexp("["+r+a+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+a+"]")},c.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 a=this.__split(this._newline_regexp,r);this.newline_count=a.length-1,this.whitespace_before_token=a[this.newline_count]}return r},c.prototype.matching=function(r,a){var s=this._create();return s.__set_whitespace_patterns(r,a),s._update(),s},c.prototype._create=function(){return new c(this._input,this)},c.prototype.__split=function(r,a){r.lastIndex=0;for(var s=0,o=[],t=r.exec(a);t;)o.push(a.substring(s,t.index)),s=t.index+t[0].length,t=r.exec(a);return s<a.length?o.push(a.substring(s,a.length)):o.push(""),o},T.exports.WhitespacePattern=c},function(T){function b(i,d){this._input=i,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)}b.prototype.read=function(){var i=this._input.read(this._starting_pattern);return(!this._starting_pattern||i)&&(i+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),i},b.prototype.read_match=function(){return this._input.match(this._match_pattern)},b.prototype.until_after=function(i){var d=this._create();return d._until_after=!0,d._until_pattern=this._input.get_regexp(i),d._update(),d},b.prototype.until=function(i){var d=this._create();return d._until_after=!1,d._until_pattern=this._input.get_regexp(i),d._update(),d},b.prototype.starting_with=function(i){var d=this._create();return d._starting_pattern=this._input.get_regexp(i,!0),d._update(),d},b.prototype.matching=function(i){var d=this._create();return d._match_pattern=this._input.get_regexp(i,!0),d._update(),d},b.prototype._create=function(){return new b(this._input,this)},b.prototype._update=function(){},T.exports.Pattern=b},function(T){function b(i,d){i=typeof i=="string"?i:i.source,d=typeof d=="string"?d:d.source,this.__directives_block_pattern=new RegExp(i+/ beautify( \w+[:]\w+)+ /.source+d,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(i+/\sbeautify\signore:end\s/.source+d,"g")}b.prototype.get_directives=function(i){if(!i.match(this.__directives_block_pattern))return null;var d={};this.__directive_pattern.lastIndex=0;for(var c=this.__directive_pattern.exec(i);c;)d[c[1]]=c[2],c=this.__directive_pattern.exec(i);return d},b.prototype.readIgnored=function(i){return i.readUntilAfter(this.__directives_end_ignore_pattern)},T.exports.Directives=b},function(T,b,i){var d=i(12).Pattern,c={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function r(a,s){d.call(this,a,s),this.__template_pattern=null,this._disabled=Object.assign({},c),this._excluded=Object.assign({},c),s&&(this.__template_pattern=this._input.get_regexp(s.__template_pattern),this._excluded=Object.assign(this._excluded,s._excluded),this._disabled=Object.assign(this._disabled,s._disabled));var o=new d(a);this.__patterns={handlebars_comment:o.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:o.starting_with(/{{{/).until_after(/}}}/),handlebars:o.starting_with(/{{/).until_after(/}}/),php:o.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:o.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:o.starting_with(/{%/).until_after(/%}/),django_value:o.starting_with(/{{/).until_after(/}}/),django_comment:o.starting_with(/{#/).until_after(/#}/),smarty:o.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:o.starting_with(/{\*/).until_after(/\*}/),smarty_literal:o.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(a){var s=this._create();return s._disabled[a]=!0,s._update(),s},r.prototype.read_options=function(a){var s=this._create();for(var o in c)s._disabled[o]=a.templating.indexOf(o)===-1;return s._update(),s},r.prototype.exclude=function(a){var s=this._create();return s._excluded[a]=!0,s._update(),s},r.prototype.read=function(){var a="";this._match_pattern?a=this._input.read(this._starting_pattern):a=this._input.read(this._starting_pattern,this.__template_pattern);for(var s=this._read_template();s;)this._match_pattern?s+=this._input.read(this._match_pattern):s+=this._input.readUntil(this.__template_pattern),a+=s,s=this._read_template();return this._until_after&&(a+=this._input.readUntilAfter(this._until_pattern)),a},r.prototype.__set_templated_pattern=function(){var a=[];this._disabled.php||a.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||a.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||a.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(a.push(this.__patterns.django._starting_pattern.source),a.push(this.__patterns.django_value._starting_pattern.source),a.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||a.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&a.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+a.join("|")+")")},r.prototype._read_template=function(){var a="",s=this._input.peek();if(s==="<"){var o=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&o==="?"&&(a=a||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&o==="%"&&(a=a||this.__patterns.erb.read())}else s==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(a=a||this.__patterns.handlebars_comment.read(),a=a||this.__patterns.handlebars_unescaped.read(),a=a||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(a=a||this.__patterns.django_value.read()),this._excluded.django||(a=a||this.__patterns.django_comment.read(),a=a||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(a=a||this.__patterns.smarty_comment.read(),a=a||this.__patterns.smarty_literal.read(),a=a||this.__patterns.smarty.read()));return a},T.exports.TemplatablePattern=r}],O={};function D(T){var b=O[T];if(b!==void 0)return b.exports;var i=O[T]={exports:{}};return R[T](i,i.exports,D),i.exports}var m=D(0);P=m})();var F=P;!(Y=[],H=function(){return{js_beautify:F}}.apply(re,Y),H!==void 0&&(Ye.exports=H))})()},"6eGT":function(Ye,re,I){"use strict";function Y(H){return null}re.a=Y},"6fms":function(Ye,re,I){var Y=I("SUKs"),H=I("06Qe"),P=I("bYtY"),F=P.each;function R(T){return parseInt(T,10)}function O(T,b){H.initVML(),this.root=T,this.storage=b;var i=document.createElement("div"),d=document.createElement("div");i.style.cssText="display:inline-block;overflow:hidden;position:relative;width:300px;height:150px;",d.style.cssText="position:absolute;left:0;top:0;",T.appendChild(i),this._vmlRoot=d,this._vmlViewport=i,this.resize();var c=b.delFromStorage,r=b.addToStorage;b.delFromStorage=function(a){c.call(b,a),a&&(a.onRemove&&a.onRemove(d))},b.addToStorage=function(a){a.onAdd&&a.onAdd(d),r.call(b,a)},this._firstPaint=!0}O.prototype={constructor:O,getType:function(){return"vml"},getViewportRoot:function(){return this._vmlViewport},getViewportRootOffset:function(){var T=this.getViewportRoot();if(T)return{offsetLeft:T.offsetLeft||0,offsetTop:T.offsetTop||0}},refresh:function(){var T=this.storage.getDisplayList(!0,!0);this._paintList(T)},_paintList:function(T){for(var b=this._vmlRoot,i=0;i<T.length;i++){var d=T[i];d.invisible||d.ignore?(d.__alreadyNotVisible||d.onRemove(b),d.__alreadyNotVisible=!0):(d.__alreadyNotVisible&&d.onAdd(b),d.__alreadyNotVisible=!1,d.__dirty&&(d.beforeBrush&&d.beforeBrush(),(d.brushVML||d.brush).call(d,b),d.afterBrush&&d.afterBrush())),d.__dirty=!1}this._firstPaint&&(this._vmlViewport.appendChild(b),this._firstPaint=!1)},resize:function(T,b){var T=T==null?this._getWidth():T,b=b==null?this._getHeight():b;if(this._width!==T||this._height!==b){this._width=T,this._height=b;var i=this._vmlViewport.style;i.width=T+"px",i.height=b+"px"}},dispose:function(){this.root.innerHTML="",this._vmlRoot=this._vmlViewport=this.storage=null},getWidth:function(){return this._width},getHeight:function(){return this._height},clear:function(){this._vmlViewport&&this.root.removeChild(this._vmlViewport)},_getWidth:function(){var T=this.root,b=T.currentStyle;return(T.clientWidth||R(b.width))-R(b.paddingLeft)-R(b.paddingRight)|0},_getHeight:function(){var T=this.root,b=T.currentStyle;return(T.clientHeight||R(b.height))-R(b.paddingTop)-R(b.paddingBottom)|0}};function D(T){return function(){Y('In IE8.0 VML mode painter not support method "'+T+'"')}}F(["getLayer","insertLayer","eachLayer","eachBuiltinLayer","eachOtherLayer","getLayers","modLayer","delLayer","clearLayer","toDataURL","pathToImage"],function(T){O.prototype[T]=D(T)});var m=O;Ye.exports=m},"7Cbv":function(Ye,re,I){"use strict";var Y=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),H=new Uint8Array(16);function P(){if(!Y)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Y(H)}var F=/^(?:[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 R(c){return typeof c=="string"&&F.test(c)}for(var O=R,D=[],m=0;m<256;++m)D.push((m+256).toString(16).substr(1));function T(c){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=(D[c[r+0]]+D[c[r+1]]+D[c[r+2]]+D[c[r+3]]+"-"+D[c[r+4]]+D[c[r+5]]+"-"+D[c[r+6]]+D[c[r+7]]+"-"+D[c[r+8]]+D[c[r+9]]+"-"+D[c[r+10]]+D[c[r+11]]+D[c[r+12]]+D[c[r+13]]+D[c[r+14]]+D[c[r+15]]).toLowerCase();if(!O(a))throw TypeError("Stringified UUID is invalid");return a}var b=T;function i(c,r,a){c=c||{};var s=c.random||(c.rng||P)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,r){a=a||0;for(var o=0;o<16;++o)r[a+o]=s[o];return r}return b(s)}var d=re.a=i},"7SHv":function(Ye,re,I){var Y=I("LPTA"),H=Y.devicePixelRatio,P=I("bYtY"),F=I("SUKs"),R=I("mFDi"),O=I("BPZU"),D=I("Xmg4"),m=I("mLcG"),T=I("Dagg"),b=I("ItGF"),i=1e5,d=314159,c=.01,r=.001;function a(E){return parseInt(E,10)}function s(E){return E?E.__builtin__?!0:!(typeof E.resize!="function"||typeof E.refresh!="function"):!1}var o=new R(0,0,0,0),t=new R(0,0,0,0);function h(E,p,l){return o.copy(E.getBoundingRect()),E.transform&&o.applyTransform(E.transform),t.width=p,t.height=l,!o.intersect(t)}function g(E,p){if(E===p)return!1;if(!E||!p||E.length!==p.length)return!0;for(var l=0;l<E.length;l++)if(E[l]!==p[l])return!0;return!1}function C(E,p){for(var l=0;l<E.length;l++){var u=E[l];u.setTransform(p),p.beginPath(),u.buildPath(p,u.shape),p.clip(),u.restoreTransform(p)}}function A(E,p){var l=document.createElement("div");return l.style.cssText=["position:relative","width:"+E+"px","height:"+p+"px","padding:0","margin:0","border-width:0"].join(";")+";",l}var w=function(E,p,l){this.type="canvas";var u=!E.nodeName||E.nodeName.toUpperCase()==="CANVAS";this._opts=l=P.extend({},l||{}),this.dpr=l.devicePixelRatio||H,this._singleCanvas=u,this.root=E;var f=E.style;f&&(f["-webkit-tap-highlight-color"]="transparent",f["-webkit-user-select"]=f["user-select"]=f["-webkit-touch-callout"]="none",E.innerHTML=""),this.storage=p;var _=this._zlevelList=[],y=this._layers={};if(this._layerConfig={},this._needsManuallyCompositing=!1,u){var N=E.width,j=E.height;l.width!=null&&(N=l.width),l.height!=null&&(j=l.height),this.dpr=l.devicePixelRatio||1,E.width=N*this.dpr,E.height=j*this.dpr,this._width=N,this._height=j;var U=new D(E,this,this.dpr);U.__builtin__=!0,U.initContext(),y[d]=U,U.zlevel=d,_.push(d),this._domRoot=E}else{this._width=this._getSize(0),this._height=this._getSize(1);var v=this._domRoot=A(this._width,this._height);E.appendChild(v)}this._hoverlayer=null,this._hoverElements=[]};w.prototype={constructor:w,getType:function(){return"canvas"},isSingleCanvas:function(){return this._singleCanvas},getViewportRoot:function(){return this._domRoot},getViewportRootOffset:function(){var E=this.getViewportRoot();if(E)return{offsetLeft:E.offsetLeft||0,offsetTop:E.offsetTop||0}},refresh:function(E){var p=this.storage.getDisplayList(!0),l=this._zlevelList;this._redrawId=Math.random(),this._paintList(p,E,this._redrawId);for(var u=0;u<l.length;u++){var f=l[u],_=this._layers[f];if(!_.__builtin__&&_.refresh){var y=u===0?this._backgroundColor:null;_.refresh(y)}}return this.refreshHover(),this},addHover:function(E,p){if(E.__hoverMir)return;var l=new E.constructor({style:E.style,shape:E.shape,z:E.z,z2:E.z2,silent:E.silent});return l.__from=E,E.__hoverMir=l,p&&l.setStyle(p),this._hoverElements.push(l),l},removeHover:function(E){var p=E.__hoverMir,l=this._hoverElements,u=P.indexOf(l,p);u>=0&&l.splice(u,1),E.__hoverMir=null},clearHover:function(E){for(var p=this._hoverElements,l=0;l<p.length;l++){var u=p[l].__from;u&&(u.__hoverMir=null)}p.length=0},refreshHover:function(){var E=this._hoverElements,p=E.length,l=this._hoverlayer;if(l&&l.clear(),!p)return;O(E,this.storage.displayableSortFunc),l||(l=this._hoverlayer=this.getLayer(i));var u={};l.ctx.save();for(var f=0;f<p;){var _=E[f],y=_.__from;if(!(y&&y.__zr)){E.splice(f,1),y.__hoverMir=null,p--;continue}f++,y.invisible||(_.transform=y.transform,_.invTransform=y.invTransform,_.__clipPaths=y.__clipPaths,this._doPaintEl(_,l,!0,u))}l.ctx.restore()},getHoverLayer:function(){return this.getLayer(i)},_paintList:function(E,p,l){if(this._redrawId!==l)return;p=p||!1,this._updateLayerStatus(E);var u=this._doPaintList(E,p);if(this._needsManuallyCompositing&&this._compositeManually(),!u){var f=this;m(function(){f._paintList(E,p,l)})}},_compositeManually:function(){var E=this.getLayer(d).ctx,p=this._domRoot.width,l=this._domRoot.height;E.clearRect(0,0,p,l),this.eachBuiltinLayer(function(u){u.virtual&&E.drawImage(u.dom,0,0,p,l)})},_doPaintList:function(E,p){for(var l=[],u=0;u<this._zlevelList.length;u++){var f=this._zlevelList[u],_=this._layers[f];_.__builtin__&&_!==this._hoverlayer&&(_.__dirty||p)&&l.push(_)}for(var y=!0,v=0;v<l.length;v++){var _=l[v],N=_.ctx,j={};N.save();var U=p?_.__startIndex:_.__drawIndex,G=!p&&_.incremental&&Date.now,z=G&&Date.now(),L=_.zlevel===this._zlevelList[0]?this._backgroundColor:null;if(_.__startIndex===_.__endIndex)_.clear(!1,L);else if(U===_.__startIndex){var V=E[U];(!V.incremental||!V.notClear||p)&&_.clear(!1,L)}U===-1&&(console.error("For some unknown reason. drawIndex is -1"),U=_.__startIndex);for(var W=U;W<_.__endIndex;W++){var $=E[W];if(this._doPaintEl($,_,p,j),$.__dirty=$.__dirtyText=!1,G){var q=Date.now()-z;if(q>15)break}}_.__drawIndex=W,_.__drawIndex<_.__endIndex&&(y=!1),j.prevElClipPaths&&N.restore(),N.restore()}return b.wxa&&P.each(this._layers,function(fe){fe&&fe.ctx&&fe.ctx.draw&&fe.ctx.draw()}),y},_doPaintEl:function(E,p,l,u){var f=p.ctx,_=E.transform;if((p.__dirty||l)&&!E.invisible&&E.style.opacity!==0&&!(_&&!_[0]&&!_[3])&&!(E.culling&&h(E,this._width,this._height))){var y=E.__clipPaths,v=u.prevElClipPaths;(!v||g(y,v))&&(v&&(f.restore(),u.prevElClipPaths=null,u.prevEl=null),y&&(f.save(),C(y,f),u.prevElClipPaths=y)),E.beforeBrush&&E.beforeBrush(f),E.brush(f,u.prevEl||null),u.prevEl=E,E.afterBrush&&E.afterBrush(f)}},getLayer:function(E,p){this._singleCanvas&&!this._needsManuallyCompositing&&(E=d);var l=this._layers[E];return l||(l=new D("zr_"+E,this,this.dpr),l.zlevel=E,l.__builtin__=!0,this._layerConfig[E]?P.merge(l,this._layerConfig[E],!0):this._layerConfig[E-c]&&P.merge(l,this._layerConfig[E-c],!0),p&&(l.virtual=p),this.insertLayer(E,l),l.initContext()),l},insertLayer:function(E,p){var l=this._layers,u=this._zlevelList,f=u.length,_=null,y=-1,v=this._domRoot;if(l[E]){F("ZLevel "+E+" has been used already");return}if(!s(p)){F("Layer of zlevel "+E+" is not valid");return}if(f>0&&E>u[0]){for(y=0;y<f-1&&!(u[y]<E&&u[y+1]>E);y++);_=l[u[y]]}if(u.splice(y+1,0,E),l[E]=p,!p.virtual)if(_){var N=_.dom;N.nextSibling?v.insertBefore(p.dom,N.nextSibling):v.appendChild(p.dom)}else v.firstChild?v.insertBefore(p.dom,v.firstChild):v.appendChild(p.dom)},eachLayer:function(E,p){var l=this._zlevelList,u,f;for(f=0;f<l.length;f++)u=l[f],E.call(p,this._layers[u],u)},eachBuiltinLayer:function(E,p){var l=this._zlevelList,u,f,_;for(_=0;_<l.length;_++)f=l[_],u=this._layers[f],u.__builtin__&&E.call(p,u,f)},eachOtherLayer:function(E,p){var l=this._zlevelList,u,f,_;for(_=0;_<l.length;_++)f=l[_],u=this._layers[f],u.__builtin__||E.call(p,u,f)},getLayers:function(){return this._layers},_updateLayerStatus:function(E){this.eachBuiltinLayer(function(j,U){j.__dirty=j.__used=!1});function p(j){f&&(f.__endIndex!==j&&(f.__dirty=!0),f.__endIndex=j)}if(this._singleCanvas)for(var l=1;l<E.length;l++){var u=E[l];if(u.zlevel!==E[l-1].zlevel||u.incremental){this._needsManuallyCompositing=!0;break}}for(var f=null,_=0,y,l=0;l<E.length;l++){var u=E[l],v=u.zlevel,N;y!==v&&(y=v,_=0),u.incremental?(N=this.getLayer(v+r,this._needsManuallyCompositing),N.incremental=!0,_=1):N=this.getLayer(v+(_>0?c:0),this._needsManuallyCompositing),N.__builtin__||F("ZLevel "+v+" has been used by unkown layer "+N.id),N!==f&&(N.__used=!0,N.__startIndex!==l&&(N.__dirty=!0),N.__startIndex=l,N.incremental?N.__drawIndex=-1:N.__drawIndex=l,p(l),f=N),u.__dirty&&(N.__dirty=!0,N.incremental&&N.__drawIndex<0&&(N.__drawIndex=l))}p(l),this.eachBuiltinLayer(function(j,U){!j.__used&&j.getElementCount()>0&&(j.__dirty=!0,j.__startIndex=j.__endIndex=j.__drawIndex=0),j.__dirty&&j.__drawIndex<0&&(j.__drawIndex=j.__startIndex)})},clear:function(){return this.eachBuiltinLayer(this._clearLayer),this},_clearLayer:function(E){E.clear()},setBackgroundColor:function(E){this._backgroundColor=E},configLayer:function(E,p){if(p){var l=this._layerConfig;l[E]?P.merge(l[E],p,!0):l[E]=p;for(var u=0;u<this._zlevelList.length;u++){var f=this._zlevelList[u];if(f===E||f===E+c){var _=this._layers[f];P.merge(_,l[E],!0)}}}},delLayer:function(E){var p=this._layers,l=this._zlevelList,u=p[E];if(!u)return;u.dom.parentNode.removeChild(u.dom),delete p[E],l.splice(P.indexOf(l,E),1)},resize:function(E,p){if(this._domRoot.style){var l=this._domRoot;l.style.display="none";var u=this._opts;if(E!=null&&(u.width=E),p!=null&&(u.height=p),E=this._getSize(0),p=this._getSize(1),l.style.display="",this._width!==E||p!==this._height){l.style.width=E+"px",l.style.height=p+"px";for(var f in this._layers)this._layers.hasOwnProperty(f)&&this._layers[f].resize(E,p);P.each(this._progressiveLayers,function(_){_.resize(E,p)}),this.refresh(!0)}this._width=E,this._height=p}else{if(E==null||p==null)return;this._width=E,this._height=p,this.getLayer(d).resize(E,p)}return this},clearLayer:function(E){var p=this._layers[E];p&&p.clear()},dispose:function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},getRenderedCanvas:function(E){if(E=E||{},this._singleCanvas&&!this._compositeManually)return this._layers[d].dom;var p=new D("image",this,E.pixelRatio||this.dpr);if(p.initContext(),p.clear(!1,E.backgroundColor||this._backgroundColor),E.pixelRatio<=this.dpr){this.refresh();var l=p.dom.width,u=p.dom.height,f=p.ctx;this.eachLayer(function(j){j.__builtin__?f.drawImage(j.dom,0,0,l,u):j.renderToCanvas&&(p.ctx.save(),j.renderToCanvas(p.ctx),p.ctx.restore())})}else for(var _={},y=this.storage.getDisplayList(!0),v=0;v<y.length;v++){var N=y[v];this._doPaintEl(N,p,!0,_)}return p.dom},getWidth:function(){return this._width},getHeight:function(){return this._height},_getSize:function(E){var p=this._opts,l=["width","height"][E],u=["clientWidth","clientHeight"][E],f=["paddingLeft","paddingTop"][E],_=["paddingRight","paddingBottom"][E];if(p[l]!=null&&p[l]!=="auto")return parseFloat(p[l]);var y=this.root,v=document.defaultView.getComputedStyle(y);return(y[u]||a(v[l])||a(y.style[l]))-(a(v[f])||0)-(a(v[_])||0)|0},pathToImage:function(E,p){p=p||this.dpr;var l=document.createElement("canvas"),u=l.getContext("2d"),f=E.getBoundingRect(),_=E.style,y=_.shadowBlur*p,v=_.shadowOffsetX*p,N=_.shadowOffsetY*p,j=_.hasStroke()?_.lineWidth:0,U=Math.max(j/2,-v+y),G=Math.max(j/2,v+y),z=Math.max(j/2,-N+y),L=Math.max(j/2,N+y),V=f.width+U+G,W=f.height+z+L;l.width=V*p,l.height=W*p,u.scale(p,p),u.clearRect(0,0,V,W),u.dpr=p;var $={position:E.position,rotation:E.rotation,scale:E.scale};E.position=[U-f.x,z-f.y],E.rotation=0,E.scale=[1,1],E.updateTransform(),E&&E.brush(u);var q=T,fe=new q({style:{x:0,y:0,image:l}});return $.position!=null&&(fe.position=E.position=$.position),$.rotation!=null&&(fe.rotation=E.rotation=$.rotation),$.scale!=null&&(fe.scale=E.scale=$.scale),fe}};var M=w;Ye.exports=M},"7ahc":function(Ye,re,I){"use strict";I.d(re,"a",function(){return C});var Y=I("k1fw"),H=I("0Owb"),P=I("+L6B"),F=I("2/Rp"),R=I("y8nQ"),O=I("Vl3Y"),D=I("tJVT"),m=I("OaEy"),T=I("2fM7"),b=I("q1tI"),i=I.n(b),d=I("VrN/"),c=I.n(d),r=I("p77/"),a=I.n(r),s=I("c5Ni"),o=I.n(s),t=T.a.Option,h={labelCol:{span:4},wrapperCol:{span:20}},g={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"]};re.b=function(A){var w=A.callback,M=A.onCancel,E=Object(b.useState)("python"),p=Object(D.a)(E,2),l=p[0],u=p[1];function f(y){u(g[y][1])}function _(y){w(y)}return i.a.createElement(O.a,Object(H.a)({},h,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:_}),i.a.createElement(O.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},i.a.createElement(T.a,{onChange:f},Object.keys(g).map(function(y){return i.a.createElement(t,{key:y,value:y},g[y][0])}))),i.a.createElement(O.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},i.a.createElement(C,{mode:l})),i.a.createElement("div",{className:"flex-container flex-end"},i.a.createElement(F.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),i.a.createElement(F.a,{type:"ghost",onClick:M},"\u53D6\u6D88")))};function C(A){var w=A.value,M=A.onChange,E=A.mode,p=A.options,l=p===void 0?{}:p,u=Object(b.useRef)(),f=Object(b.useState)(),_=Object(D.a)(f,2),y=_[0],v=_[1];return Object(b.useEffect)(function(){if(y){function N(j){var U=j.getValue();M&&M(U)}return y.on("change",N),function(){y.off("change",N)}}},[y,M]),Object(b.useEffect)(function(){y&&y.setOption("mode",E)},[y,E]),Object(b.useEffect)(function(){y&&((w!==y.getValue()||w==="")&&setTimeout(function(){y.setValue(w||" ")},300))},[y,w]),Object(b.useEffect)(function(){if(u.current&&!y){var N=c.a.fromTextArea(u.current,Object(Y.a)({mode:E,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},l));v(N)}},[u.current,y]),i.a.createElement("div",{className:"my-codemirror-container"},i.a.createElement("textarea",{ref:u}))}},"7ixt":function(Ye,re,I){"use strict";I.d(re,"a",function(){return P});var Y={adjustX:1,adjustY:1},H=[0,0],P={left:{points:["cr","cl"],overflow:Y,offset:[-4,0],targetOffset:H},right:{points:["cl","cr"],overflow:Y,offset:[4,0],targetOffset:H},top:{points:["bc","tc"],overflow:Y,offset:[0,-4],targetOffset:H},bottom:{points:["tc","bc"],overflow:Y,offset:[0,4],targetOffset:H},topLeft:{points:["bl","tl"],overflow:Y,offset:[0,-4],targetOffset:H},leftTop:{points:["tr","tl"],overflow:Y,offset:[-4,0],targetOffset:H},topRight:{points:["br","tr"],overflow:Y,offset:[0,-4],targetOffset:H},rightTop:{points:["tl","tr"],overflow:Y,offset:[4,0],targetOffset:H},bottomRight:{points:["tr","br"],overflow:Y,offset:[0,4],targetOffset:H},rightBottom:{points:["bl","br"],overflow:Y,offset:[4,0],targetOffset:H},bottomLeft:{points:["tl","bl"],overflow:Y,offset:[0,4],targetOffset:H},leftBottom:{points:["br","bl"],overflow:Y,offset:[-4,0],targetOffset:H}},F=P},"7oTu":function(Ye,re,I){var Y=I("IMiH"),H=I("QBsz"),P=H.applyTransform,F=Y.CMD,R=[[],[],[]],O=Math.sqrt,D=Math.atan2;function m(T,b){var i=T.data,d,c,r,a,s,o,t=F.M,h=F.C,g=F.L,C=F.R,A=F.A,w=F.Q;for(r=0,a=0;r<i.length;){d=i[r++],a=r,c=0;switch(d){case t:c=1;break;case g:c=1;break;case h:c=3;break;case w:c=2;break;case A:var M=b[4],E=b[5],p=O(b[0]*b[0]+b[1]*b[1]),l=O(b[2]*b[2]+b[3]*b[3]),u=D(-b[1]/l,b[0]/p);i[r]*=p,i[r++]+=M,i[r]*=l,i[r++]+=E,i[r++]*=p,i[r++]*=l,i[r++]+=u,i[r++]+=u,r+=2,a=r;break;case C:o[0]=i[r++],o[1]=i[r++],P(o,o,b),i[a++]=o[0],i[a++]=o[1],o[0]+=i[r++],o[1]+=i[r++],P(o,o,b),i[a++]=o[0],i[a++]=o[1]}for(s=0;s<c;s++){var o=R[s];o[0]=i[r++],o[1]=i[r++],P(o,o,b),i[a++]=o[0],i[a++]=o[1]}}}Ye.exports=m},"815F":function(Ye,re,I){"use strict";I.d(re,"e",function(){return D}),I.d(re,"c",function(){return T}),I.d(re,"d",function(){return b}),I.d(re,"a",function(){return d}),I.d(re,"f",function(){return c}),I.d(re,"b",function(){return r});var Y=I("KQm4"),H=I("VTBJ"),P=I("Ff2n"),F=I("Zm9Q"),R=I("Kwbf"),O=I("OZM5");function D(a,s){return a!=null?a:s}function m(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],s=new Map;function o(t){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(t||[]).forEach(function(g){var C=g.key,A=g.children;Object(R.a)(C!=null,"Tree node must have a certain key: [".concat(h).concat(C,"]"));var w=String(C);Object(R.a)(!s.has(w)||C===null||C===void 0,"Same 'key' exist in the Tree: ".concat(w)),s.set(w,!0),o(A,"".concat(h).concat(w," > "))})}o(a)}function T(a){function s(o){var t=Object(F.a)(o);return t.map(function(h){if(!Object(O.i)(h))return Object(R.a)(!h,"Tree/TreeNode can only accept TreeNode as children."),null;var g=h.key,C=h.props,A=C.children,w=Object(P.a)(C,["children"]),M=Object(H.a)({key:g},w),E=s(A);return E.length&&(M.children=E),M}).filter(function(h){return h})}return s(a)}function b(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],o=new Set(s===!0?[]:s),t=[];function h(g){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return g.map(function(A,w){var M=Object(O.h)(C?C.pos:"0",w),E=D(A.key,M),p=Object(H.a)(Object(H.a)({},A),{},{parent:C,pos:M,children:null,data:A,isStart:[].concat(Object(Y.a)(C?C.isStart:[]),[w===0]),isEnd:[].concat(Object(Y.a)(C?C.isEnd:[]),[w===g.length-1])});return t.push(p),s===!0||o.has(E)?p.children=h(A.children||[],p):p.children=[],p})}return h(a),t}function i(a,s,o){var t;o?typeof o=="string"?t=function(C){return C[o]}:typeof o=="function"&&(t=function(C){return o(C)}):t=function(C,A){return D(C.key,A)};function h(g,C,A){var w=g?g.children:a,M=g?Object(O.h)(A.pos,C):"0";if(g){var E=t(g,M),p={node:g,index:C,pos:M,key:E,parentPos:A.node?A.pos:null,level:A.level+1};s(p)}w&&w.forEach(function(l,u){h(l,u,{node:g,pos:M,level:A?A.level+1:-1})})}h(null)}function d(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=s.initWrapper,t=s.processEntity,h=s.onProcessFinished,g=arguments.length>2?arguments[2]:void 0,C={},A={},w={posEntities:C,keyEntities:A};return o&&(w=o(w)||w),i(a,function(M){var E=M.node,p=M.index,l=M.pos,u=M.key,f=M.parentPos,_=M.level,y={node:E,index:p,key:u,pos:l,level:_},v=D(u,l);C[l]=y,A[v]=y,y.parent=C[f],y.parent&&(y.parent.children=y.parent.children||[],y.parent.children.push(y)),t&&t(y,w)},g),h&&h(w),w}function c(a,s){var o=s.expandedKeys,t=s.selectedKeys,h=s.loadedKeys,g=s.loadingKeys,C=s.checkedKeys,A=s.halfCheckedKeys,w=s.dragOverNodeKey,M=s.dropPosition,E=s.keyEntities,p=E[a],l={eventKey:a,expanded:o.indexOf(a)!==-1,selected:t.indexOf(a)!==-1,loaded:h.indexOf(a)!==-1,loading:g.indexOf(a)!==-1,checked:C.indexOf(a)!==-1,halfChecked:A.indexOf(a)!==-1,pos:String(p?p.pos:""),dragOver:w===a&&M===0,dragOverGapTop:w===a&&M===-1,dragOverGapBottom:w===a&&M===1};return l}function r(a){var s=a.data,o=a.expanded,t=a.selected,h=a.checked,g=a.loaded,C=a.loading,A=a.halfChecked,w=a.dragOver,M=a.dragOverGapTop,E=a.dragOverGapBottom,p=a.pos,l=a.active,u=Object(H.a)(Object(H.a)({},s),{},{expanded:o,selected:t,checked:h,loaded:g,loading:C,halfChecked:A,dragOver:w,dragOverGapTop:M,dragOverGapBottom:E,pos:p,active:l});return"props"in u||Object.defineProperty(u,"props",{get:function(){return Object(R.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),a}}),u}},"8EBN":function(Ye,re,I){(function(Y){Y(I("VrN/"))})(function(Y){"use strict";Y.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 H=0;H<Y.modeInfo.length;H++){var P=Y.modeInfo[H];P.mimes&&(P.mime=P.mimes[0])}Y.findModeByMIME=function(F){F=F.toLowerCase();for(var R=0;R<Y.modeInfo.length;R++){var O=Y.modeInfo[R];if(O.mime==F)return O;if(O.mimes){for(var D=0;D<O.mimes.length;D++)if(O.mimes[D]==F)return O}}if(/\+xml$/.test(F))return Y.findModeByMIME("application/xml");if(/\+json$/.test(F))return Y.findModeByMIME("application/json")},Y.findModeByExtension=function(F){F=F.toLowerCase();for(var R=0;R<Y.modeInfo.length;R++){var O=Y.modeInfo[R];if(O.ext){for(var D=0;D<O.ext.length;D++)if(O.ext[D]==F)return O}}},Y.findModeByFileName=function(F){for(var R=0;R<Y.modeInfo.length;R++){var O=Y.modeInfo[R];if(O.file&&O.file.test(F))return O}var D=F.lastIndexOf("."),m=D>-1&&F.substring(D+1,F.length);if(m)return Y.findModeByExtension(m)},Y.findModeByName=function(F){F=F.toLowerCase();for(var R=0;R<Y.modeInfo.length;R++){var O=Y.modeInfo[R];if(O.name.toLowerCase()==F)return O;if(O.alias){for(var D=0;D<O.alias.length;D++)if(O.alias[D].toLowerCase()==F)return O}}}})},"8XDt":function(Ye,re,I){I("qH13");var Y=I("aX58"),H=Y.registerPainter,P=I("6fms");H("vml",P)},"8hTe":function(Ye,re,I){Ye.exports={button:"button___1wy9m"}},"942q":function(Ye,re,I){Ye.exports={flex_box_center:"flex_box_center___6uNR7",flex_space_between:"flex_space_between___1vpXN",flex_box_vertical_center:"flex_box_vertical_center___1P9h2",flex_box_center_end:"flex_box_center_end___2guA4",flex_box_column:"flex_box_column___1w5Zf",top:"top___2UvUE",desc:"desc___2mFum",liked:"liked___12VnN",likedActive:"likedActive___3ixY7",reply:"reply___29ShJ",replyList:"replyList___1F2kY",comment:"comment___2ZnmY"}},"9Bee":function(Ye,re,I){"use strict";var Y=I("DYRE"),H=I("zeV3"),P=I("+L6B"),F=I("2/Rp"),R=I("k1fw"),O=I("9og8"),D=I("tJVT"),m=I("WmNS"),T=I.n(m),b=I("q1tI"),i=I.n(b),d=I("vg9a"),c=I("DlQD"),r=I.n(c),a=I("rUJ1");function s(ee,B){var K=ee.match(/^(\s+)(?:```)/);if(K===null)return B;var Q=K[1];return B.split(`
|
|
`).map(function(le){var Z=le.match(/^\s+/);if(Z===null)return le;var Qe=Object(D.a)(Z,1),qt=Qe[0];return qt.length>=Q.length?le.slice(Q.length):le}).join(`
|
|
`)}var o=[],t=["<ul>"],h=new r.a.Renderer,g=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function C(){o.length=0,t=["<ul>"]}var A={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function w(ee,B,K,Q){if(B>=ee.length||ee[B].level<=K)return B;var le=ee[B];Q.push("<li><a href='#"+le.anchor+"'>"+le.text+"</a>"),B++;var Z=[];return B=w(ee,B,le.level,Z),Z.length>0&&(Q.push("<ul>"),Z.forEach(function(Qe){Q.push(Qe)}),Q.push("</ul>")),Q.push("</li>"),B=w(ee,B,K,Q),B}function M(){return w(o,0,0,t),t.push("</ul>"),t.join("")}var E={heading:function(B){var K=g.exec(B);if(K)return{type:"heading",raw:K[0],depth:K[1].length,text:K[2]}},fences:function(B){var K=this.rules.block.fences.exec(B);if(K){var Q=K[0],le=s(Q,K[3]||""),Z=K[2]?K[2].trim():K[2];if(["latex","katex","math"].indexOf(Z)>=0){var Qe=u(),qt=le;le=Qe,f[Qe]={type:"block",expression:qt}}return{type:"code",raw:Q,lang:Z,text:le}}}},p=/(?:\${2})([^\n`]+?)(?:\${2})/gi,l=0,u=function(){return"__special_katext_id_".concat(l++,"__")},f={};function _(){return f}function y(){l=0,f={}}function v(ee){return ee=ee.replace(p,function(B,K){var Q=u();return f[Q]={type:"inline",expression:K},Q}),ee}var N=h.listitem;h.listitem=function(ee){return N(v(ee))};var j=h.paragraph;h.paragraph=function(ee){return j(v(ee))};var U=h.tablecell;h.tablecell=function(ee,B){return U(v(ee),B)},h.code=function(ee,B,K){var Q=(B||"").match(/\S*/)[0];return Q?["latex","katex","math"].indexOf(Q)>=0?"<p class='editormd-tex'>".concat(ee,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(B,'">').concat(K?ee:Object(a.escape)(ee,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(K?ee:Object(a.escape)(ee,!0))+"</code></pre>"},h.heading=function(ee,B,K){var Q=this.options.headerPrefix+K.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return o.push({anchor:Q,level:B,text:ee}),"<h"+B+' id="'+Q+'">'+ee+"</h"+B+">"},r.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),r.a.use({tokenizer:E,renderer:h});var G=r.a,z=I("SJMd"),L=I("ulZh"),V=I.n(L),W=I("m3rI"),$=I("Oy/b"),q=I("p5ED"),fe=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 se=function(ee,B){return(se=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(K,Q){K.__proto__=Q}||function(K,Q){for(var le in Q)Object.prototype.hasOwnProperty.call(Q,le)&&(K[le]=Q[le])})(ee,B)};function me(ee,B){function K(){this.constructor=ee}se(ee,B),ee.prototype=B===null?Object.create(B):(K.prototype=B.prototype,new K)}function ve(ee,B,K,Q){return new(K||(K=Promise))(function(le,Z){function Qe(Vn){try{An(Q.next(Vn))}catch(sn){Z(sn)}}function qt(Vn){try{An(Q.throw(Vn))}catch(sn){Z(sn)}}function An(Vn){var sn;Vn.done?le(Vn.value):(sn=Vn.value,sn instanceof K?sn:new K(function(tr){tr(sn)})).then(Qe,qt)}An((Q=Q.apply(ee,B||[])).next())})}function Ae(ee,B){var K,Q,le,Z,Qe={label:0,sent:function(){if(1&le[0])throw le[1];return le[1]},trys:[],ops:[]};return Z={next:qt(0),throw:qt(1),return:qt(2)},typeof Symbol=="function"&&(Z[Symbol.iterator]=function(){return this}),Z;function qt(An){return function(Vn){return function(sn){if(K)throw new TypeError("Generator is already executing.");for(;Qe;)try{if(K=1,Q&&(le=2&sn[0]?Q.return:sn[0]?Q.throw||((le=Q.return)&&le.call(Q),0):Q.next)&&!(le=le.call(Q,sn[1])).done)return le;switch(Q=0,le&&(sn=[2&sn[0],le.value]),sn[0]){case 0:case 1:le=sn;break;case 4:return Qe.label++,{value:sn[1],done:!1};case 5:Qe.label++,Q=sn[1],sn=[0];continue;case 7:sn=Qe.ops.pop(),Qe.trys.pop();continue;default:if(!(le=Qe.trys,(le=le.length>0&&le[le.length-1])||sn[0]!==6&&sn[0]!==2)){Qe=0;continue}if(sn[0]===3&&(!le||sn[1]>le[0]&&sn[1]<le[3])){Qe.label=sn[1];break}if(sn[0]===6&&Qe.label<le[1]){Qe.label=le[1],le=sn;break}if(le&&Qe.label<le[2]){Qe.label=le[2],Qe.ops.push(sn);break}le[2]&&Qe.ops.pop(),Qe.trys.pop();continue}sn=B.call(ee,Qe)}catch(tr){sn=[6,tr],Q=0}finally{K=le=0}if(5&sn[0])throw sn[1];return{value:sn[0]?sn[1]:void 0,done:!0}}([An,Vn])}}}function ge(){for(var ee=0,B=0,K=arguments.length;B<K;B++)ee+=arguments[B].length;var Q=Array(ee),le=0;for(B=0;B<K;B++)for(var Z=arguments[B],Qe=0,qt=Z.length;Qe<qt;Qe++,le++)Q[le]=Z[Qe];return Q}var ue=function(){function ee(){}return ee.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ee.setAttributes=function(B,K){for(var Q=0,le=K;Q<le.length;Q++){var Z=le[Q],Qe=Z[0],qt=Z[1];B.setAttribute(Qe,qt)}},ee.createRect=function(B,K,Q){var le=document.createElementNS("http://www.w3.org/2000/svg","rect");return le.setAttribute("width",B.toString()),le.setAttribute("height",K.toString()),Q&&ee.setAttributes(le,Q),le},ee.createLine=function(B,K,Q,le,Z){var Qe=document.createElementNS("http://www.w3.org/2000/svg","line");return Qe.setAttribute("x1",B.toString()),Qe.setAttribute("y1",K.toString()),Qe.setAttribute("x2",Q.toString()),Qe.setAttribute("y2",le.toString()),Z&&ee.setAttributes(Qe,Z),Qe},ee.createPolygon=function(B,K){var Q=document.createElementNS("http://www.w3.org/2000/svg","polygon");return Q.setAttribute("points",B),K&&ee.setAttributes(Q,K),Q},ee.createCircle=function(B,K){var Q=document.createElementNS("http://www.w3.org/2000/svg","circle");return Q.setAttribute("cx",(B/2).toString()),Q.setAttribute("cy",(B/2).toString()),Q.setAttribute("r",B.toString()),K&&ee.setAttributes(Q,K),Q},ee.createEllipse=function(B,K,Q){var le=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return le.setAttribute("cx",(B/2).toString()),le.setAttribute("cy",(K/2).toString()),le.setAttribute("rx",(B/2).toString()),le.setAttribute("ry",(K/2).toString()),Q&&ee.setAttributes(le,Q),le},ee.createGroup=function(B){var K=document.createElementNS("http://www.w3.org/2000/svg","g");return B&&ee.setAttributes(K,B),K},ee.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ee.createMarker=function(B,K,Q,le,Z,Qe,qt){var An=document.createElementNS("http://www.w3.org/2000/svg","marker");return ee.setAttributes(An,[["id",B],["orient",K],["markerWidth",Q.toString()],["markerHeight",le.toString()],["refX",Z.toString()],["refY",Qe.toString()]]),An.appendChild(qt),An},ee.createText=function(B){var K=document.createElementNS("http://www.w3.org/2000/svg","text");return K.setAttribute("x","0"),K.setAttribute("y","0"),B&&ee.setAttributes(K,B),K},ee.createTSpan=function(B,K){var Q=document.createElementNS("http://www.w3.org/2000/svg","tspan");return Q.textContent=B,K&&ee.setAttributes(Q,K),Q},ee.createImage=function(B){var K=document.createElementNS("http://www.w3.org/2000/svg","image");return B&&ee.setAttributes(K,B),K},ee.createPoint=function(B,K){var Q=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return Q.x=B,Q.y=K,Q},ee.createPath=function(B,K){var Q=document.createElementNS("http://www.w3.org/2000/svg","path");return Q.setAttribute("d",B),K&&ee.setAttributes(Q,K),Q},ee}(),$e=function(){function ee(){}return ee.addKey=function(B){ee.key=B},Object.defineProperty(ee,"isLicensed",{get:function(){return!!ee.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ee.key)},enumerable:!1,configurable:!0}),ee}(),Tt=function(){function ee(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return ee.prototype.rasterize=function(B,K,Q){var le=this;return new Promise(function(Z){var Qe=Q!==void 0?Q:document.createElement("canvas");B===null&&(le.markersOnly=!0,le.naturalSize=!1);var qt=document.createElementNS("http://www.w3.org/2000/svg","svg");qt.setAttribute("xmlns","http://www.w3.org/2000/svg"),qt.setAttribute("width",K.width.baseVal.valueAsString),qt.setAttribute("height",K.height.baseVal.valueAsString),qt.setAttribute("viewBox","0 0 "+K.viewBox.baseVal.width.toString()+" "+K.viewBox.baseVal.height.toString()),qt.innerHTML=K.innerHTML,le.naturalSize===!0?(qt.width.baseVal.value=B.naturalWidth,qt.height.baseVal.value=B.naturalHeight):le.width!==void 0&&le.height!==void 0&&(qt.width.baseVal.value=le.width,qt.height.baseVal.value=le.height),Qe.width=qt.width.baseVal.value,Qe.height=qt.height.baseVal.value;var An=qt.outerHTML,Vn=Qe.getContext("2d");le.markersOnly!==!0&&Vn.drawImage(B,0,0,Qe.width,Qe.height);var sn=window.URL,tr=new Image(Qe.width,Qe.height);tr.setAttribute("crossOrigin","anonymous");var vn=new Blob([An],{type:"image/svg+xml"}),ln=sn.createObjectURL(vn);tr.onload=function(){Vn.drawImage(tr,0,0),sn.revokeObjectURL(ln);var xn=Qe.toDataURL(le.imageType,le.imageQuality);Z(xn)},tr.src=ln})},ee}(),ye=function(){},Re=function(){function ee(B){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+B+"_"}return Object.defineProperty(ee.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),ee.prototype.addClass=function(B){return this.styleSheet===void 0&&this.addStyleSheet(),B.name=""+this.classNamePrefix+B.localName,this.classes.push(B),this.styleSheet.sheet.insertRule("."+B.name+" {"+B.style+"}",this.styleSheet.sheet.cssRules.length),B},ee.prototype.addRule=function(B){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(B),this.styleSheet.sheet.insertRule(B.selector+" {"+B.style+"}",this.styleSheet.sheet.cssRules.length)},ee.prototype.addStyleSheet=function(){var B;this.styleSheet=document.createElement("style"),((B=this.styleSheetRoot)!==null&&B!==void 0?B:document.head).appendChild(this.styleSheet),this.addRule(new nt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new nt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new nt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Ue("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Ue("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},ee.prototype.removeStyleSheet=function(){var B;this.styleSheet&&(((B=this.styleSheetRoot)!==null&&B!==void 0?B:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ee}(),nt=function(ee,B){this.selector=ee,this.style=B},Ue=function(ee,B){this.localName=ee,this.style=B},ke=function(){function ee(B,K,Q,le,Z){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=B,this.displayMode=K,this.markerItems=Q,this.uiStyleSettings=le,this.styles=Z,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return ee.prototype.show=function(B){var K=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=B,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var Q=document.createElement("div");Q.className=this.toolbarBlockStyleClass.name,Q.style.whiteSpace="nowrap",this.uiContainer.appendChild(Q),this.addActionButton(Q,'<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(Q,'<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(Q,'<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(Q,'<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(Q,'<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(Q,'<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(Q,'<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(Q,'<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(Z){var Qe=document.createElement("div");Qe.className=""+K.toolbarButtonStyleClass.name,Qe.setAttribute("data-type-name",Z.typeName),Qe.innerHTML=Z.icon,Qe.addEventListener("click",function(){K.markerToolbarButtonClicked(Qe,Z)}),K.buttons.push(Qe),K.markerButtons.push(Qe)}),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 le=document.createElement("div");le.className=this.toolbarBlockStyleClass.name,le.style.whiteSpace="nowrap",le.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(le),this.addActionButton(le,'<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(le,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},ee.prototype.addButtonClickListener=function(B){this.buttonClickListeners.push(B)},ee.prototype.removeButtonClickListener=function(B){this.buttonClickListeners.indexOf(B)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(B),1)},ee.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},ee.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var B=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var K=0;K<this.markerButtons.length;K++)K<B||K===B&&this.markerButtons.length-1===B?this.markerButtonBlock.appendChild(this.markerButtons[K]):(K===B&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[K]))}},ee.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},ee.prototype.resetButtonStyles=function(){var B=this;this.buttons.forEach(function(K){K.className=K.className.replace(B.uiStyleSettings.toolbarButtonStyleColorsClassName?B.uiStyleSettings.toolbarButtonStyleColorsClassName:B.toolbarButtonStyleColorsClass.name,"").trim(),K.className=K.className.replace(B.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?B.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:B.toolbarActiveButtonStyleColorsClass.name,"").trim(),K.className+=" "+(B.uiStyleSettings.toolbarButtonStyleColorsClassName?B.uiStyleSettings.toolbarButtonStyleColorsClassName:B.toolbarButtonStyleColorsClass.name)})},ee.prototype.addActionButton=function(B,K,Q){var le=this,Z=document.createElement("div");switch(Z.className=""+this.toolbarButtonStyleClass.name,Z.innerHTML=K,Z.setAttribute("data-action",Q),Z.addEventListener("click",function(){le.actionToolbarButtonClicked(Z,Q)}),Q){case"select":Z.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":Z.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":Z.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":Z.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":Z.style.fill=this.uiStyleSettings.closeButtonColor}B.appendChild(Z),this.buttons.push(Z)},ee.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ue("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 Ue("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ue("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Ue("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 Ue("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var B=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ue("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*B)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*B)+`px;
|
|
padding: `+B+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ue("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ue("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new nt("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new nt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},ee.prototype.markerToolbarButtonClicked=function(B,K){this.setActiveButton(B),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Q){return Q("marker",K)}),this.markerButtonOverflowBlock.style.display="none"},ee.prototype.actionToolbarButtonClicked=function(B,K){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Q){return Q("action",K)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},ee.prototype.setActiveButton=function(B){this.resetButtonStyles(),B.className=B.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),B.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},ee.prototype.setActiveMarkerButton=function(B){var K=this.markerButtons.find(function(Q){return Q.getAttribute("data-type-name")===B});K&&this.setActiveButton(K)},ee.prototype.setCurrentMarker=function(B){var K=this;this.currentMarker=B,this.buttons.filter(function(Q){return/delete|notes/.test(Q.getAttribute("data-action"))}).forEach(function(Q){K.currentMarker===void 0?(Q.style.fillOpacity="0.4",Q.style.pointerEvents="none"):(Q.style.fillOpacity="1",Q.style.pointerEvents="all")})},ee}(),lt=function(){function ee(B,K,Q,le){this.panels=[],this.panelButtons=[],this.markerjsContainer=B,this.displayMode=K,this.uiStyleSettings=Q,this.styles=le,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return ee.prototype.addStyles=function(){var B;this.toolboxStyleClass=this.styles.addClass(new Ue("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 Ue("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var K=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Ue("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Ue("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Ue("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 Ue("toolbox-panel-row_colors",`
|
|
background-color: `+((B=this.uiStyleSettings.toolboxBackgroundColor)!==null&&B!==void 0?B:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Ue("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*K)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*K)+`px;
|
|
padding: `+K+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Ue("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Ue("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new nt("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new nt("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},ee.prototype.show=function(B){var K;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=B,this.uiContainer.className=this.toolboxStyleClass.name+" "+((K=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&K!==void 0?K:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},ee.prototype.setPanelButtons=function(B){var K,Q,le=this;this.panels=B,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((K=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&K!==void 0?K:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((Q=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&Q!==void 0?Q:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Z){var Qe;Z.uiStyleSettings=le.uiStyleSettings;var qt=document.createElement("div");qt.className=le.toolboxButtonStyleClass.name+" "+((Qe=le.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Qe!==void 0?Qe:le.toolboxButtonStyleColorsClass.name),qt.innerHTML=Z.icon,qt.title=Z.title,qt.addEventListener("click",function(){le.panelButtonClick(Z)}),le.panelButtons.push(qt),le.buttonRow.appendChild(qt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},ee.prototype.panelButtonClick=function(B){var K=this,Q=-1;if(B!==this.activePanel){Q=this.panels.indexOf(B),this.panelRow.innerHTML="";var le=B.getUi();le.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(le),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=B}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){K.displayMode==="inline"?K.panelRow.style.display="none":K.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(Z,Qe){var qt,An;Z.className=K.toolboxButtonStyleClass.name+" "+(Qe===Q?""+((qt=K.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&qt!==void 0?qt:K.toolboxActiveButtonStyleColorsClass.name):""+((An=K.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&An!==void 0?An:K.toolboxButtonStyleColorsClass.name))})},ee}(),Fe=function(ee,B){this.title=ee,this.icon=B},Ze=function(ee){function B(K,Q,le,Z){var Qe=ee.call(this,K,Z||'<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 Qe.colors=[],Qe.addTransparent=!1,Qe.colorBoxes=[],Qe.colors=Q,Qe.currentColor=le,Qe.setCurrentColor=Qe.setCurrentColor.bind(Qe),Qe.getColorBox=Qe.getColorBox.bind(Qe),Qe}return me(B,ee),B.prototype.getUi=function(){var K=this,Q=document.createElement("div");return Q.style.overflow="hidden",Q.style.whiteSpace="nowrap",this.colors.forEach(function(le){var Z=K.getColorBox(le);Q.appendChild(Z),K.colorBoxes.push(Z)}),Q},B.prototype.getColorBox=function(K){var Q=this,le=this.uiStyleSettings.toolbarHeight/4,Z=this.uiStyleSettings.toolbarHeight-le,Qe=document.createElement("div");Qe.style.display="inline-block",Qe.style.boxSizing="content-box",Qe.style.width=Z-2+"px",Qe.style.height=Z-2+"px",Qe.style.padding="1px",Qe.style.marginRight="2px",Qe.style.marginBottom="2px",Qe.style.borderWidth="2px",Qe.style.borderStyle="solid",Qe.style.borderRadius=(Z+2)/2+"px",Qe.style.borderColor=K===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Qe.addEventListener("click",function(){Q.setCurrentColor(K,Qe)});var qt=document.createElement("div");return qt.style.display="inline-block",qt.style.width=Z-2+"px",qt.style.height=Z-2+"px",qt.style.backgroundColor=K,qt.style.borderRadius=Z/2+"px",K==="transparent"&&(qt.style.fill=this.uiStyleSettings.toolboxAccentColor,qt.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>`),Qe.appendChild(qt),Qe},B.prototype.setCurrentColor=function(K,Q){var le=this;this.currentColor=K,this.colorBoxes.forEach(function(Z){Z.style.borderColor=Z===Q?le.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(K)},B}(Fe),Xe=function(){function ee(B,K,Q){this._state="new",this._isSelected=!1,this._container=B,this._overlayContainer=K,this.globalSettings=Q,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(ee.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),ee.prototype.ownsTarget=function(B){return!1},Object.defineProperty(ee.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),ee.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},ee.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},ee.prototype.pointerDown=function(B,K){},ee.prototype.dblClick=function(B,K){},ee.prototype.manipulate=function(B){},ee.prototype.pointerUp=function(B){this.stateChanged()},ee.prototype.dispose=function(){},ee.prototype.addMarkerVisualToContainer=function(B){this.container.childNodes.length>0?this.container.insertBefore(B,this.container.childNodes[0]):this.container.appendChild(B)},ee.prototype.getState=function(){return{typeName:ee.typeName,state:this.state,notes:this.notes}},ee.prototype.restoreState=function(B){this._state=B.state,this.notes=B.notes},ee.prototype.scale=function(B,K){},ee.prototype.colorChanged=function(B){this.onColorChanged&&this.onColorChanged(B),this.stateChanged()},ee.prototype.fillColorChanged=function(B){this.onFillColorChanged&&this.onFillColorChanged(B),this.stateChanged()},ee.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var B=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),B.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(B)&&this.onStateChanged(this)}},ee.typeName="MarkerBase",ee}(),ft=function(){function ee(){this.findGripByVisual=this.findGripByVisual.bind(this)}return ee.prototype.findGripByVisual=function(B){return this.topLeft.ownsTarget(B)?this.topLeft:this.topCenter.ownsTarget(B)?this.topCenter:this.topRight.ownsTarget(B)?this.topRight:this.centerLeft.ownsTarget(B)?this.centerLeft:this.centerRight.ownsTarget(B)?this.centerRight:this.bottomLeft.ownsTarget(B)?this.bottomLeft:this.bottomCenter.ownsTarget(B)?this.bottomCenter:this.bottomRight.ownsTarget(B)?this.bottomRight:void 0},ee}(),Rt=function(){function ee(){this.GRIP_SIZE=10,this.visual=ue.createGroup(),this.visual.appendChild(ue.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ue.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ee.prototype.ownsTarget=function(B){return B===this.visual||B===this.visual.childNodes[0]||B===this.visual.childNodes[1]},ee}(),Pt=function(){function ee(){}return ee.toITransformMatrix=function(B){return{a:B.a,b:B.b,c:B.c,d:B.d,e:B.e,f:B.f}},ee.toSVGMatrix=function(B,K){return B.a=K.a,B.b=K.b,B.c=K.c,B.d=K.d,B.e=K.e,B.f=K.f,B},ee}(),Bt=function(ee){function B(K,Q,le){var Z=ee.call(this,K,Q,le)||this;return Z.left=0,Z.top=0,Z.width=0,Z.height=0,Z.defaultSize={x:50,y:20},Z.offsetX=0,Z.offsetY=0,Z.rotationAngle=0,Z.CB_DISTANCE=10,Z._suppressMarkerCreateEvent=!1,Z.container.transform.baseVal.appendItem(ue.createTransform()),Z.setupControlBox(),Z}return me(B,ee),Object.defineProperty(B.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"visual",{get:function(){return this._visual},set:function(K){this._visual=K;var Q=ue.createTransform();this._visual.transform.baseVal.appendItem(Q)},enumerable:!1,configurable:!0}),B.prototype.ownsTarget=function(K){return!!ee.prototype.ownsTarget.call(this,K)||!!(this.controlGrips.findGripByVisual(K)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(K))},B.prototype.pointerDown=function(K,Q){ee.prototype.pointerDown.call(this,K,Q),this.state==="new"&&(this.left=K.x,this.top=K.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var le=this.unrotatePoint(K);if(this.manipulationStartX=le.x,this.manipulationStartY=le.y,this.offsetX=le.x-this.left,this.offsetY=le.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(Q),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(Q)){this.activeGrip=this.rotatorGrip;var Z=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=Z.x-this.width/2,this.top=Z.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Qe=this.container.transform.baseVal.getItem(0);Qe.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Qe,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},B.prototype.pointerUp=function(K){var Q=this.state;ee.prototype.pointerUp.call(this,K),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(K),this._state="select",Q==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},B.prototype.moveVisual=function(K){this.visual.style.transform="translate("+K.x+"px, "+K.y+"px)"},B.prototype.manipulate=function(K){var Q=this.unrotatePoint(K);this.state==="creating"?this.resize(K):this.state==="move"?(this.left=this.manipulationStartLeft+(Q.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(Q.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(Q):this.state==="rotate"&&this.rotate(K)},B.prototype.resize=function(K){var Q=this.manipulationStartLeft,le=this.manipulationStartWidth,Z=this.manipulationStartTop,Qe=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:Q=this.manipulationStartLeft+K.x-this.manipulationStartX,le=this.manipulationStartWidth+this.manipulationStartLeft-Q;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:le=this.manipulationStartWidth+K.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Z=this.manipulationStartTop+K.y-this.manipulationStartY,Qe=this.manipulationStartHeight+this.manipulationStartTop-Z;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Qe=this.manipulationStartHeight+K.y-this.manipulationStartY}le>=0?(this.left=Q,this.width=le):(this.left=Q+le,this.width=-le),Qe>=0?(this.top=Z,this.height=Qe):(this.top=Z+Qe,this.height=-Qe),this.setSize()},B.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},B.prototype.rotate=function(K){if(Math.abs(K.x-this.centerX)>.1){var Q=Math.sign(K.x-this.centerX);this.rotationAngle=180*Math.atan((K.y-this.centerY)/(K.x-this.centerX))/Math.PI+90*Q,this.applyRotation()}},B.prototype.applyRotation=function(){var K=this.container.transform.baseVal.getItem(0);K.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(K,0)},B.prototype.rotatePoint=function(K){if(this.rotationAngle===0)return K;var Q=this.container.getCTM(),le=ue.createPoint(K.x,K.y);return{x:(le=le.matrixTransform(Q)).x,y:le.y}},B.prototype.unrotatePoint=function(K){if(this.rotationAngle===0)return K;var Q=this.container.getCTM();Q=Q.inverse();var le=ue.createPoint(K.x,K.y);return{x:(le=le.matrixTransform(Q)).x,y:le.y}},B.prototype.select=function(){ee.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},B.prototype.deselect=function(){ee.prototype.deselect.call(this),this.controlBox.style.display="none"},B.prototype.setupControlBox=function(){this.controlBox=ue.createGroup();var K=ue.createTransform();K.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(K),this.container.appendChild(this.controlBox),this.controlRect=ue.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=ue.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new ft,this.addControlGrips(),this.controlBox.style.display="none"},B.prototype.adjustControlBox=function(){var K=this.controlBox.transform.baseVal.getItem(0);K.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(K,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()},B.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()},B.prototype.createGrip=function(){var K=new Rt;return K.visual.transform.baseVal.appendItem(ue.createTransform()),this.controlBox.appendChild(K.visual),K},B.prototype.positionGrips=function(){var K=this.controlGrips.topLeft.GRIP_SIZE,Q=-K/2,le=Q,Z=(this.width+this.CB_DISTANCE)/2-K/2,Qe=(this.height+this.CB_DISTANCE)/2-K/2,qt=this.height+this.CB_DISTANCE-K/2,An=this.width+this.CB_DISTANCE-K/2;this.positionGrip(this.controlGrips.topLeft.visual,Q,le),this.positionGrip(this.controlGrips.topCenter.visual,Z,le),this.positionGrip(this.controlGrips.topRight.visual,An,le),this.positionGrip(this.controlGrips.centerLeft.visual,Q,Qe),this.positionGrip(this.controlGrips.centerRight.visual,An,Qe),this.positionGrip(this.controlGrips.bottomLeft.visual,Q,qt),this.positionGrip(this.controlGrips.bottomCenter.visual,Z,qt),this.positionGrip(this.controlGrips.bottomRight.visual,An,qt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Z,le-3*this.CB_DISTANCE)},B.prototype.positionGrip=function(K,Q,le){var Z=K.transform.baseVal.getItem(0);Z.setTranslate(Q,le),K.transform.baseVal.replaceItem(Z,0)},B.prototype.hideControlBox=function(){this.controlBox.style.display="none"},B.prototype.showControlBox=function(){this.controlBox.style.display=""},B.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Pt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Pt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},ee.prototype.getState.call(this))},B.prototype.restoreState=function(K){ee.prototype.restoreState.call(this,K);var Q=K;this.left=Q.left,this.top=Q.top,this.width=Q.width,this.height=Q.height,this.rotationAngle=Q.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Pt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,Q.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Pt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,Q.containerTransformMatrix))},B.prototype.scale=function(K,Q){ee.prototype.scale.call(this,K,Q);var le=this.rotatePoint({x:this.left,y:this.top}),Z=this.unrotatePoint({x:le.x*K,y:le.y*Q});this.left=Z.x,this.top=Z.y,this.width=this.width*K,this.height=this.height*Q,this.adjustControlBox()},B}(Xe),Ve=function(ee){function B(K,Q,le){var Z=ee.call(this,K,Q,le)||this;return Z.fillColor="transparent",Z.strokeColor="transparent",Z.strokeWidth=0,Z.strokeDasharray="",Z.opacity=1,Z.setStrokeColor=Z.setStrokeColor.bind(Z),Z.setFillColor=Z.setFillColor.bind(Z),Z.setStrokeWidth=Z.setStrokeWidth.bind(Z),Z.setStrokeDasharray=Z.setStrokeDasharray.bind(Z),Z.createVisual=Z.createVisual.bind(Z),Z}return me(B,ee),B.prototype.ownsTarget=function(K){return!(!ee.prototype.ownsTarget.call(this,K)&&K!==this.visual)},B.prototype.createVisual=function(){this.visual=ue.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},B.prototype.pointerDown=function(K,Q){ee.prototype.pointerDown.call(this,K,Q),this.state==="new"&&(this.createVisual(),this.moveVisual(K),this._state="creating")},B.prototype.manipulate=function(K){ee.prototype.manipulate.call(this,K)},B.prototype.resize=function(K){ee.prototype.resize.call(this,K),this.setSize()},B.prototype.setSize=function(){ee.prototype.setSize.call(this),ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},B.prototype.pointerUp=function(K){ee.prototype.pointerUp.call(this,K),this.setSize()},B.prototype.setStrokeColor=function(K){this.strokeColor=K,this.visual&&ue.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(K),this.stateChanged()},B.prototype.setFillColor=function(K){this.fillColor=K,this.visual&&ue.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},B.prototype.setStrokeWidth=function(K){this.strokeWidth=K,this.visual&&ue.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},B.prototype.setStrokeDasharray=function(K){this.strokeDasharray=K,this.visual&&ue.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},B.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ee.prototype.getState.call(this))},B.prototype.restoreState=function(K){var Q=K;this.fillColor=Q.fillColor,this.strokeColor=Q.strokeColor,this.strokeWidth=Q.strokeWidth,this.strokeDasharray=Q.strokeDasharray,this.opacity=Q.opacity,this.createVisual(),ee.prototype.restoreState.call(this,K),this.setSize()},B.prototype.scale=function(K,Q){ee.prototype.scale.call(this,K,Q),this.setSize()},B.title="Rectangle marker",B}(Bt),Ft=function(ee){function B(K,Q,le,Z){var Qe=ee.call(this,K,Z||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Qe.widths=[],Qe.widthBoxes=[],Qe.widths=Q,Qe.currentWidth=le,Qe.setCurrentWidth=Qe.setCurrentWidth.bind(Qe),Qe}return me(B,ee),B.prototype.getUi=function(){var K=this,Q=document.createElement("div");return Q.style.display="flex",Q.style.overflow="hidden",Q.style.flexGrow="2",this.widths.forEach(function(le){var Z=document.createElement("div");Z.style.display="flex",Z.style.flexGrow="2",Z.style.alignItems="center",Z.style.justifyContent="space-between",Z.style.padding="5px",Z.style.borderWidth="2px",Z.style.borderStyle="solid",Z.style.borderColor=le===K.currentWidth?K.uiStyleSettings.toolboxAccentColor:"transparent",Z.addEventListener("click",function(){K.setCurrentWidth(le,Z)}),Q.appendChild(Z);var Qe=document.createElement("div");Qe.innerText=le.toString(),Qe.style.marginRight="5px",Z.appendChild(Qe);var qt=document.createElement("div");qt.style.minHeight="20px",qt.style.flexGrow="2",qt.style.display="flex",qt.style.alignItems="center";var An=document.createElement("hr");An.style.minWidth="20px",An.style.border="0px",An.style.borderTop=le+"px solid "+K.uiStyleSettings.toolboxColor,An.style.flexGrow="2",qt.appendChild(An),Z.appendChild(qt),K.widthBoxes.push(Z)}),Q},B.prototype.setCurrentWidth=function(K,Q){var le=this;this.currentWidth=K,this.widthBoxes.forEach(function(Z){Z.style.borderColor=Z===Q?le.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},B}(Fe),nn=function(ee){function B(K,Q,le,Z){var Qe=ee.call(this,K,Z||'<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 Qe.styles=[],Qe.styleBoxes=[],Qe.styles=Q,Qe.currentStyle=le,Qe.setCurrentStyle=Qe.setCurrentStyle.bind(Qe),Qe}return me(B,ee),B.prototype.getUi=function(){var K=this,Q=document.createElement("div");return Q.style.display="flex",Q.style.overflow="hidden",Q.style.flexGrow="2",this.styles.forEach(function(le){var Z=document.createElement("div");Z.style.display="flex",Z.style.alignItems="center",Z.style.justifyContent="space-between",Z.style.padding="5px",Z.style.borderWidth="2px",Z.style.borderStyle="solid",Z.style.overflow="hidden",Z.style.maxWidth=100/K.styles.length-5+"%",Z.style.borderColor=le===K.currentStyle?K.uiStyleSettings.toolboxAccentColor:"transparent",Z.addEventListener("click",function(){K.setCurrentStyle(le,Z)}),Q.appendChild(Z);var Qe=document.createElement("div");Qe.style.minHeight="20px",Qe.style.flexGrow="2",Qe.style.overflow="hidden";var qt=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+K.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(le!==""?'stroke-dasharray="'+le+'"':"")+` />
|
|
</svg>`;Qe.innerHTML=qt,Z.appendChild(Qe),K.styleBoxes.push(Z)}),Q},B.prototype.setCurrentStyle=function(K,Q){var le=this;this.currentStyle=K,this.styleBoxes.forEach(function(Z){Z.style.borderColor=Z===Q?le.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},B}(Fe),Le=function(ee){function B(K,Q,le){var Z=ee.call(this,K,Q,le)||this;return Z.strokeColor=le.defaultColor,Z.strokeWidth=le.defaultStrokeWidth,Z.strokeDasharray=le.defaultStrokeDasharray,Z.strokePanel=new Ze("Line color",le.defaultColorSet,le.defaultColor),Z.strokePanel.onColorChanged=Z.setStrokeColor,Z.strokeWidthPanel=new Ft("Line width",le.defaultStrokeWidths,le.defaultStrokeWidth),Z.strokeWidthPanel.onWidthChanged=Z.setStrokeWidth,Z.strokeStylePanel=new nn("Line style",le.defaultStrokeDasharrays,le.defaultStrokeDasharray),Z.strokeStylePanel.onStyleChanged=Z.setStrokeDasharray,Z}return me(B,ee),Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var K=ee.prototype.getState.call(this);return K.typeName=B.typeName,K},B.typeName="FrameMarker",B.title="Frame marker",B.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',B}(Ve),Se=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},ut=function(ee){function B(K,Q,le){var Z=ee.call(this,K,Q,le)||this;return Z.x1=0,Z.y1=0,Z.x2=0,Z.y2=0,Z.defaultLength=50,Z.manipulationStartX=0,Z.manipulationStartY=0,Z.manipulationStartX1=0,Z.manipulationStartY1=0,Z.manipulationStartX2=0,Z.manipulationStartY2=0,Z.setupControlBox(),Z}return me(B,ee),B.prototype.ownsTarget=function(K){return!!ee.prototype.ownsTarget.call(this,K)||!(!this.grip1.ownsTarget(K)&&!this.grip2.ownsTarget(K))},B.prototype.pointerDown=function(K,Q){ee.prototype.pointerDown.call(this,K,Q),this.manipulationStartX=K.x,this.manipulationStartY=K.y,this.state==="new"&&(this.x1=K.x,this.y1=K.y,this.x2=K.x,this.y2=K.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(Q)?this.activeGrip=this.grip1:this.grip2.ownsTarget(Q)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},B.prototype.pointerUp=function(K){var Q=this.state;ee.prototype.pointerUp.call(this,K),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(K),this._state="select",Q==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},B.prototype.adjustVisual=function(){},B.prototype.manipulate=function(K){this.state==="creating"?this.resize(K):this.state==="move"?(this.x1=this.manipulationStartX1+K.x-this.manipulationStartX,this.y1=this.manipulationStartY1+K.y-this.manipulationStartY,this.x2=this.manipulationStartX2+K.x-this.manipulationStartX,this.y2=this.manipulationStartY2+K.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(K)},B.prototype.resize=function(K){switch(this.activeGrip){case this.grip1:this.x1=K.x,this.y1=K.y;break;case this.grip2:case void 0:this.x2=K.x,this.y2=K.y}this.adjustVisual(),this.adjustControlBox()},B.prototype.select=function(){ee.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},B.prototype.deselect=function(){ee.prototype.deselect.call(this),this.controlBox.style.display="none"},B.prototype.setupControlBox=function(){this.controlBox=ue.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},B.prototype.adjustControlBox=function(){this.positionGrips()},B.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},B.prototype.createGrip=function(){var K=new Rt;return K.visual.transform.baseVal.appendItem(ue.createTransform()),this.controlBox.appendChild(K.visual),K},B.prototype.positionGrips=function(){var K=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-K/2,this.y1-K/2),this.positionGrip(this.grip2.visual,this.x2-K/2,this.y2-K/2)},B.prototype.positionGrip=function(K,Q,le){var Z=K.transform.baseVal.getItem(0);Z.setTranslate(Q,le),K.transform.baseVal.replaceItem(Z,0)},B.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},ee.prototype.getState.call(this))},B.prototype.restoreState=function(K){ee.prototype.restoreState.call(this,K);var Q=K;this.x1=Q.x1,this.y1=Q.y1,this.x2=Q.x2,this.y2=Q.y2},B.prototype.scale=function(K,Q){ee.prototype.scale.call(this,K,Q),this.x1=this.x1*K,this.y1=this.y1*Q,this.x2=this.x2*K,this.y2=this.y2*Q,this.adjustVisual(),this.adjustControlBox()},B}(Xe),mt=function(ee){function B(K,Q,le){var Z=ee.call(this,K,Q,le)||this;return Z.strokeColor="transparent",Z.strokeWidth=0,Z.strokeDasharray="",Z.setStrokeColor=Z.setStrokeColor.bind(Z),Z.setStrokeWidth=Z.setStrokeWidth.bind(Z),Z.setStrokeDasharray=Z.setStrokeDasharray.bind(Z),Z.strokeColor=le.defaultColor,Z.strokeWidth=le.defaultStrokeWidth,Z.strokeDasharray=le.defaultStrokeDasharray,Z.strokePanel=new Ze("Line color",le.defaultColorSet,le.defaultColor),Z.strokePanel.onColorChanged=Z.setStrokeColor,Z.strokeWidthPanel=new Ft("Line width",le.defaultStrokeWidths,le.defaultStrokeWidth),Z.strokeWidthPanel.onWidthChanged=Z.setStrokeWidth,Z.strokeStylePanel=new nn("Line style",le.defaultStrokeDasharrays,le.defaultStrokeDasharray),Z.strokeStylePanel.onStyleChanged=Z.setStrokeDasharray,Z}return me(B,ee),B.prototype.ownsTarget=function(K){return!(!ee.prototype.ownsTarget.call(this,K)&&K!==this.visual&&K!==this.selectorLine&&K!==this.visibleLine)},B.prototype.createVisual=function(){this.visual=ue.createGroup(),this.selectorLine=ue.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ue.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},B.prototype.pointerDown=function(K,Q){ee.prototype.pointerDown.call(this,K,Q),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},B.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),ue.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ue.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ue.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},B.prototype.setStrokeColor=function(K){this.strokeColor=K,this.adjustVisual(),this.colorChanged(K)},B.prototype.setStrokeWidth=function(K){this.strokeWidth=K,this.adjustVisual()},B.prototype.setStrokeDasharray=function(K){this.strokeDasharray=K,this.adjustVisual(),this.stateChanged()},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var K=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},ee.prototype.getState.call(this));return K.typeName=B.typeName,K},B.prototype.restoreState=function(K){ee.prototype.restoreState.call(this,K);var Q=K;this.strokeColor=Q.strokeColor,this.strokeWidth=Q.strokeWidth,this.strokeDasharray=Q.strokeDasharray,this.createVisual(),this.adjustVisual()},B.typeName="LineMarker",B.title="Line marker",B.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',B}(ut),We=function(ee){function B(K,Q,le,Z){var Qe=ee.call(this,K,Z||'<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 Qe.fonts=[],Qe.fontBoxes=[],Qe.fonts=Q,Qe.currentFont=le,Qe.setCurrentFont=Qe.setCurrentFont.bind(Qe),Qe}return me(B,ee),B.prototype.getUi=function(){var K=this,Q=document.createElement("div");return Q.style.overflow="hidden",Q.style.flexGrow="2",this.fonts.forEach(function(le){var Z=document.createElement("div");Z.style.display="inline-block",Z.style.alignItems="center",Z.style.justifyContent="space-between",Z.style.padding="5px",Z.style.borderWidth="2px",Z.style.borderStyle="solid",Z.style.overflow="hidden",Z.style.maxWidth=100/K.fonts.length-5+"%",Z.style.borderColor=le===K.currentFont?K.uiStyleSettings.toolboxAccentColor:"transparent",Z.addEventListener("click",function(){K.setCurrentFont(le,Z)}),Q.appendChild(Z);var Qe=document.createElement("div");Qe.style.display="flex",Qe.style.minHeight="20px",Qe.style.flexGrow="2",Qe.style.fontFamily=le,Qe.style.overflow="hidden";var qt=document.createElement("div");qt.style.whiteSpace="nowrap",qt.style.overflow="hidden",qt.style.textOverflow="ellipsis",qt.innerHTML="The quick brown fox jumps over the lazy dog",Qe.appendChild(qt),Z.appendChild(Qe),K.fontBoxes.push(Z)}),Q},B.prototype.setCurrentFont=function(K,Q){var le=this;this.currentFont=K,this.fontBoxes.forEach(function(Z){Z.style.borderColor=Z===Q?le.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},B}(Fe),vt=function(ee){function B(K,Q,le){var Z=ee.call(this,K,Q,le)||this;return Z.color="transparent",Z.padding=5,Z.DEFAULT_TEXT="your text here",Z.text=Z.DEFAULT_TEXT,Z.isMoved=!1,Z.color=le.defaultColor,Z.fontFamily=le.defaultFontFamily,Z.defaultSize={x:100,y:30},Z.setColor=Z.setColor.bind(Z),Z.setFont=Z.setFont.bind(Z),Z.renderText=Z.renderText.bind(Z),Z.sizeText=Z.sizeText.bind(Z),Z.textEditDivClicked=Z.textEditDivClicked.bind(Z),Z.showTextEditor=Z.showTextEditor.bind(Z),Z.setSize=Z.setSize.bind(Z),Z.positionTextEditor=Z.positionTextEditor.bind(Z),Z.colorPanel=new Ze("Color",le.defaultColorSet,le.defaultColor),Z.colorPanel.onColorChanged=Z.setColor,Z.fontFamilyPanel=new We("Font",le.defaultFontFamilies,le.defaultFontFamily),Z.fontFamilyPanel.onFontChanged=Z.setFont,Z}return me(B,ee),B.prototype.ownsTarget=function(K){if(ee.prototype.ownsTarget.call(this,K)||K===this.visual||K===this.textElement||K===this.bgRectangle)return!0;var Q=!1;return this.textElement.childNodes.forEach(function(le){le===K&&(Q=!0)}),Q},B.prototype.createVisual=function(){this.visual=ue.createGroup(),this.bgRectangle=ue.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ue.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ue.createTransform()),this.textElement.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},B.prototype.pointerDown=function(K,Q){ee.prototype.pointerDown.call(this,K,Q),this.isMoved=!1,this.pointerDownPoint=K,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(K),this._state="creating")},B.prototype.renderText=function(){var K=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(Q){K.textElement.appendChild(ue.createTSpan(Q.trim()===""?" ":Q.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},B.prototype.getTextScale=function(){var K=this.textElement.getBBox(),Q=1;if(K.width>0&&K.height>0){var le=(1*this.width-this.width*this.padding*2/100)/K.width,Z=(1*this.height-this.height*this.padding*2/100)/K.height;Q=Math.min(le,Z)}return Q},B.prototype.getTextPosition=function(K){var Q=this.textElement.getBBox(),le=0,Z=0;return Q.width>0&&Q.height>0&&(le=(this.width-Q.width*K)/2,Z=this.height/2-Q.height*K/2),{x:le,y:Z}},B.prototype.sizeText=function(){var K=this.textElement.getBBox(),Q=this.getTextScale(),le=this.getTextPosition(Q);le.y-=K.y*Q,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+le.x+"px, "+le.y+"px) scale("+Q+", "+Q+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(le.x,le.y),this.textElement.transform.baseVal.getItem(1).setScale(Q,Q))},B.prototype.manipulate=function(K){ee.prototype.manipulate.call(this,K),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(K.x-this.pointerDownPoint.x)>5||Math.abs(K.y-this.pointerDownPoint.y)>5)},B.prototype.resize=function(K){ee.prototype.resize.call(this,K),this.isMoved=!0,this.setSize(),this.sizeText()},B.prototype.setSize=function(){ee.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},B.prototype.pointerUp=function(K){var Q=this.state;Q==="creating"&&(this._suppressMarkerCreateEvent=!0),ee.prototype.pointerUp.call(this,K),this.setSize(),(Q==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},B.prototype.showTextEditor=function(){var K=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(Q){Q.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var Q=Number.parseFloat(K.textEditor.style.fontSize);K.textEditor.clientWidth>=Number.parseInt(K.textEditor.style.maxWidth)&&Q>.9;)Q-=.1,K.textEditor.style.fontSize=Math.max(Q,.9)+"em"}),this.textEditor.addEventListener("keyup",function(Q){Q.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(Q){if(Q.clipboardData){var le=Q.clipboardData.getData("text"),Z=window.getSelection();if(!Z.rangeCount)return!1;Z.deleteFromDocument(),Z.getRangeAt(0).insertNode(document.createTextNode(le)),Q.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){K.textEditDivClicked(K.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},B.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var K=this.getTextScale(),Q=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),le=this.textElement.getBBox(),Z={x:le.width*K,y:le.height*K};Q.x-=Z.x/2,Q.y-=Z.y/2,this.textEditor.style.top=Q.y+"px",this.textEditor.style.left=Q.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-Q.x+"px",this.textEditor.style.fontSize=Math.max(16*K,12)+"px",this.textElement.style.display="none"}},B.prototype.textEditDivClicked=function(K){this.text=K.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},B.prototype.select=function(){ee.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},B.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),ee.prototype.deselect.call(this)},B.prototype.dblClick=function(K,Q){ee.prototype.dblClick.call(this,K,Q),this.showTextEditor()},B.prototype.setColor=function(K){this.textElement&&ue.setAttributes(this.textElement,[["fill",K]]),this.color=K,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(K)},B.prototype.setFont=function(K){this.textElement&&ue.setAttributes(this.textElement,[["font-family",K]]),this.fontFamily=K,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},B.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},B.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var K=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},ee.prototype.getState.call(this));return K.typeName=B.typeName,K},B.prototype.restoreState=function(K){var Q=K;this.color=Q.color,this.fontFamily=Q.fontFamily,this.padding=Q.padding,this.text=Q.text,this.createVisual(),ee.prototype.restoreState.call(this,K),this.setSize()},B.prototype.scale=function(K,Q){ee.prototype.scale.call(this,K,Q),this.setSize(),this.sizeText(),this.positionTextEditor()},B.typeName="TextMarker",B.title="Text marker",B.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>',B}(Bt),Pe=function(ee){function B(K,Q,le){var Z=ee.call(this,K,Q,le)||this;return Z.color="transparent",Z.lineWidth=3,Z.drawing=!1,Z.pixelRatio=1,Z.color=le.defaultColor,Z.lineWidth=le.defaultStrokeWidth,Z.pixelRatio=le.freehandPixelRatio,Z.setColor=Z.setColor.bind(Z),Z.addCanvas=Z.addCanvas.bind(Z),Z.finishCreation=Z.finishCreation.bind(Z),Z.setLineWidth=Z.setLineWidth.bind(Z),Z.colorPanel=new Ze("Color",le.defaultColorSet,le.defaultColor),Z.colorPanel.onColorChanged=Z.setColor,Z.lineWidthPanel=new Ft("Line width",le.defaultStrokeWidths,le.defaultStrokeWidth),Z.lineWidthPanel.onWidthChanged=Z.setLineWidth,Z}return me(B,ee),B.prototype.ownsTarget=function(K){return!(!ee.prototype.ownsTarget.call(this,K)&&K!==this.visual&&K!==this.drawingImage)},B.prototype.createVisual=function(){this.visual=ue.createGroup(),this.drawingImage=ue.createImage(),this.visual.appendChild(this.drawingImage);var K=ue.createTransform();this.visual.transform.baseVal.appendItem(K),this.addMarkerVisualToContainer(this.visual)},B.prototype.pointerDown=function(K,Q){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(K.x,K.y),this.drawing=!0):ee.prototype.pointerDown.call(this,K,Q)},B.prototype.manipulate=function(K){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(K.x,K.y),this.canvasContext.stroke()):ee.prototype.manipulate.call(this,K)},B.prototype.resize=function(K){ee.prototype.resize.call(this,K),ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},B.prototype.pointerUp=function(K){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):ee.prototype.pointerUp.call(this,K)},B.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)},B.prototype.select=function(){this.state==="creating"&&this.finishCreation(),ee.prototype.select.call(this)},B.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),ee.prototype.deselect.call(this)},B.prototype.finishCreation=function(){for(var K=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),Q=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],le=Q[0],Z=Q[1],Qe=Q[2],qt=Q[3],An=!1,Vn=0;Vn<this.canvasElement.height;Vn++)for(var sn=0;sn<this.canvasElement.width;sn++)K.data[Vn*this.canvasElement.width*4+4*sn+3]>0&&(An=!0,Vn<Z&&(Z=Vn),sn<le&&(le=sn),Vn>qt&&(qt=Vn),sn>Qe&&(Qe=sn));if(An){this.left=le/this.pixelRatio,this.top=Z/this.pixelRatio,this.width=(Qe-le)/this.pixelRatio,this.height=(qt-Z)/this.pixelRatio;var tr=document.createElement("canvas");tr.width=Qe-le,tr.height=qt-Z,tr.getContext("2d").putImageData(this.canvasContext.getImageData(le,Z,Qe-le,qt-Z),0,0),this.drawingImgUrl=tr.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},B.prototype.setDrawingImage=function(){ue.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},B.prototype.setColor=function(K){this.color=K,this.colorChanged(K)},B.prototype.setLineWidth=function(K){this.lineWidth=K},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var K=Object.assign({drawingImgUrl:this.drawingImgUrl},ee.prototype.getState.call(this));return K.typeName=B.typeName,K},B.prototype.restoreState=function(K){this.createVisual(),ee.prototype.restoreState.call(this,K),this.drawingImgUrl=K.drawingImgUrl,this.setDrawingImage()},B.prototype.scale=function(K,Q){ee.prototype.scale.call(this,K,Q),this.setDrawingImage()},B.typeName="FreehandMarker",B.title="Freehand marker",B.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>',B}(Bt),xe=function(ee){function B(K,Q,le){var Z=ee.call(this,K,le||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return Z.typeBoxes=[],Z.currentType=Q,Z.setCurrentType=Z.setCurrentType.bind(Z),Z}return me(B,ee),B.prototype.getUi=function(){var K=this,Q=document.createElement("div");Q.style.display="flex",Q.style.overflow="hidden",Q.style.flexGrow="2";for(var le=function(qt){var An="both";switch(qt){case 0:An="both";break;case 1:An="start";break;case 2:An="end";break;case 3:An="none"}var Vn=document.createElement("div");if(Vn.style.display="flex",Vn.style.flexGrow="2",Vn.style.alignItems="center",Vn.style.justifyContent="space-between",Vn.style.padding="5px",Vn.style.borderWidth="2px",Vn.style.borderStyle="solid",Vn.style.borderColor=An===Z.currentType?Z.uiStyleSettings.toolboxAccentColor:"transparent",Vn.addEventListener("click",function(){K.setCurrentType(An,Vn)}),Q.appendChild(Vn),An==="both"||An==="start"){var sn=document.createElement("div");sn.style.display="flex",sn.style.alignItems="center",sn.style.minHeight="20px",sn.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="`+(Z.uiStyleSettings!==void 0?Z.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,sn.style.marginLeft="5px",Vn.appendChild(sn)}var tr=document.createElement("div");tr.style.display="flex",tr.style.alignItems="center",tr.style.minHeight="20px",tr.style.flexGrow="2";var vn=document.createElement("hr");if(vn.style.minWidth="20px",vn.style.border="0px",vn.style.borderTop="3px solid "+(Z.uiStyleSettings!==void 0?Z.uiStyleSettings.toolboxColor:"#eeeeee"),vn.style.flexGrow="2",tr.appendChild(vn),Vn.appendChild(tr),An==="both"||An==="end"){var ln=document.createElement("div");ln.style.display="flex",ln.style.alignItems="center",ln.style.minHeight="20px",ln.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="`+(Z.uiStyleSettings!==void 0?Z.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,ln.style.marginRight="5px",Vn.appendChild(ln)}Z.typeBoxes.push(Vn)},Z=this,Qe=0;Qe<4;Qe++)le(Qe);return Q},B.prototype.setCurrentType=function(K,Q){var le=this;this.currentType=K,this.typeBoxes.forEach(function(Z){Z.style.borderColor=Z===Q?le.uiStyleSettings!==void 0?le.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},B}(Fe),we=function(ee){function B(K,Q,le){var Z=ee.call(this,K,Q,le)||this;return Z.arrowType="end",Z.arrowBaseHeight=10,Z.arrowBaseWidth=10,Z.getArrowPoints=Z.getArrowPoints.bind(Z),Z.setArrowType=Z.setArrowType.bind(Z),Z.arrowTypePanel=new xe("Arrow type","end"),Z.arrowTypePanel.onArrowTypeChanged=Z.setArrowType,Z}return me(B,ee),B.prototype.ownsTarget=function(K){return!(!ee.prototype.ownsTarget.call(this,K)&&K!==this.arrow1&&K!==this.arrow2)},B.prototype.getArrowPoints=function(K,Q){var le=this.arrowBaseWidth+2*this.strokeWidth,Z=this.arrowBaseHeight+2*this.strokeWidth;return K-le/2+","+(Q+Z/2)+" "+K+","+(Q-Z/2)+" "+(K+le/2)+","+(Q+Z/2)},B.prototype.createTips=function(){this.arrow1=ue.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ue.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.arrow2)},B.prototype.pointerDown=function(K,Q){ee.prototype.pointerDown.call(this,K,Q),this.state==="creating"&&this.createTips()},B.prototype.adjustVisual=function(){if(ee.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",ue.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ue.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var K=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),Q=this.arrow1.transform.baseVal.getItem(0);Q.setRotate(K,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(Q,0);var le=this.arrow2.transform.baseVal.getItem(0);le.setRotate(K+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(le,0)}},B.prototype.setArrowType=function(K){this.arrowType=K,this.adjustVisual(),this.stateChanged()},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var K=Object.assign({arrowType:this.arrowType},ee.prototype.getState.call(this));return K.typeName=B.typeName,K},B.prototype.restoreState=function(K){ee.prototype.restoreState.call(this,K);var Q=K;this.arrowType=Q.arrowType,this.createTips(),this.adjustVisual()},B.typeName="ArrowMarker",B.title="Arrow marker",B.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',B}(mt),ie=function(ee){function B(K,Q,le){var Z=ee.call(this,K,Q,le)||this;return Z.fillColor=le.defaultFillColor,Z.strokeWidth=0,Z.fillPanel=new Ze("Color",le.defaultColorSet,le.defaultFillColor),Z.fillPanel.onColorChanged=Z.setFillColor,Z}return me(B,ee),Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var K=ee.prototype.getState.call(this);return K.typeName=B.typeName,K},B.typeName="CoverMarker",B.title="Cover marker",B.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',B}(Ve),ae=function(ee){function B(K,Q,le,Z){var Qe=ee.call(this,K,Z||'<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 Qe.opacities=[],Qe.opacityBoxes=[],Qe.opacities=Q,Qe.currentOpacity=le,Qe.setCurrentOpacity=Qe.setCurrentOpacity.bind(Qe),Qe}return me(B,ee),B.prototype.getUi=function(){var K=this,Q=document.createElement("div");return Q.style.display="flex",Q.style.overflow="hidden",Q.style.flexGrow="2",Q.style.justifyContent="space-between",this.opacities.forEach(function(le){var Z=document.createElement("div");Z.style.display="flex",Z.style.alignItems="center",Z.style.justifyContent="center",Z.style.padding="5px",Z.style.borderWidth="2px",Z.style.borderStyle="solid",Z.style.borderColor=le===K.currentOpacity?K.uiStyleSettings.toolboxAccentColor:"transparent",Z.addEventListener("click",function(){K.setCurrentOpacity(le,Z)}),Q.appendChild(Z);var Qe=document.createElement("div");Qe.innerText=100*le+"%",Z.appendChild(Qe),K.opacityBoxes.push(Z)}),Q},B.prototype.setCurrentOpacity=function(K,Q){var le=this;this.currentOpacity=K,this.opacityBoxes.forEach(function(Z){Z.style.borderColor=Z===Q?le.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},B}(Fe),ce=function(ee){function B(K,Q,le){var Z=ee.call(this,K,Q,le)||this;return Z.setOpacity=Z.setOpacity.bind(Z),Z.fillColor=le.defaultHighlightColor,Z.strokeWidth=0,Z.opacity=le.defaultHighlightOpacity,Z.fillPanel=new Ze("Color",le.defaultColorSet,Z.fillColor),Z.fillPanel.onColorChanged=Z.setFillColor,Z.opacityPanel=new ae("Opacity",le.defaultOpacitySteps,Z.opacity),Z.opacityPanel.onOpacityChanged=Z.setOpacity,Z}return me(B,ee),B.prototype.setOpacity=function(K){this.opacity=K,this.visual&&ue.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var K=ee.prototype.getState.call(this);return K.typeName=B.typeName,K},B.typeName="HighlightMarker",B.title="Highlight marker",B.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>',B}(ie),be='<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>',Ce=function(ee){function B(K,Q,le){var Z=ee.call(this,K,Q,le)||this;return Z.bgColor="transparent",Z.tipPosition={x:0,y:0},Z.tipBase1Position={x:0,y:0},Z.tipBase2Position={x:0,y:0},Z.tipMoving=!1,Z.color=le.defaultStrokeColor,Z.bgColor=le.defaultFillColor,Z.fontFamily=le.defaultFontFamily,Z.defaultSize={x:100,y:30},Z.setBgColor=Z.setBgColor.bind(Z),Z.getTipPoints=Z.getTipPoints.bind(Z),Z.positionTip=Z.positionTip.bind(Z),Z.setTipPoints=Z.setTipPoints.bind(Z),Z.colorPanel=new Ze("Text color",le.defaultColorSet,Z.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>'),Z.colorPanel.onColorChanged=Z.setColor,Z.bgColorPanel=new Ze("Fill color",le.defaultColorSet,Z.bgColor,be),Z.bgColorPanel.onColorChanged=Z.setBgColor,Z.fontFamilyPanel=new We("Font",le.defaultFontFamilies,le.defaultFontFamily),Z.fontFamilyPanel.onFontChanged=Z.setFont,Z.tipGrip=new Rt,Z.tipGrip.visual.transform.baseVal.appendItem(ue.createTransform()),Z.controlBox.appendChild(Z.tipGrip.visual),Z}return me(B,ee),B.prototype.ownsTarget=function(K){return ee.prototype.ownsTarget.call(this,K)||this.tipGrip.ownsTarget(K)||this.tip===K},B.prototype.createTip=function(){ue.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ue.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},B.prototype.pointerDown=function(K,Q){this.state==="new"&&ee.prototype.pointerDown.call(this,K,Q),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(Q)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):ee.prototype.pointerDown.call(this,K,Q)},B.prototype.pointerUp=function(K){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,ee.prototype.pointerUp.call(this,K);else{var Q=this.state==="creating";ee.prototype.pointerUp.call(this,K),this.setTipPoints(Q),this.positionTip()}},B.prototype.manipulate=function(K){if(this.tipMoving){var Q=this.unrotatePoint(K);this.tipPosition={x:Q.x-this.manipulationStartLeft,y:Q.y-this.manipulationStartTop},this.positionTip()}else ee.prototype.manipulate.call(this,K)},B.prototype.setBgColor=function(K){this.bgRectangle&&this.tip&&(ue.setAttributes(this.bgRectangle,[["fill",K]]),ue.setAttributes(this.tip,[["fill",K]])),this.bgColor=K,this.fillColorChanged(K)},B.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},B.prototype.setTipPoints=function(K){K===void 0&&(K=!1);var Q=Math.min(this.height/2,15),le=this.height/5;K&&(this.tipPosition={x:Q+le/2,y:this.height+20});var Z=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?Z<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(le=this.width/5,Q=Math.min(this.width/2,15),this.tipBase1Position={x:Q,y:0},this.tipBase2Position={x:Q+le,y:0}):(this.tipBase1Position={x:0,y:Q},this.tipBase2Position={x:0,y:Q+le}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?Z<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(le=this.width/5,Q=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-Q-le,y:0},this.tipBase2Position={x:this.width-Q,y:0}):(this.tipBase1Position={x:this.width,y:Q},this.tipBase2Position={x:this.width,y:Q+le}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?Z<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(le=this.width/5,Q=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-Q-le,y:this.height},this.tipBase2Position={x:this.width-Q,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-Q-le},this.tipBase2Position={x:this.width,y:this.height-Q}):Z<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(le=this.width/5,Q=Math.min(this.width/2,15),this.tipBase1Position={x:Q,y:this.height},this.tipBase2Position={x:Q+le,y:this.height}):(this.tipBase1Position={x:0,y:this.height-Q},this.tipBase2Position={x:0,y:this.height-Q-le})},B.prototype.resize=function(K){ee.prototype.resize.call(this,K),this.positionTip()},B.prototype.positionTip=function(){ue.setAttributes(this.tip,[["points",this.getTipPoints()]]);var K=this.tipGrip.visual.transform.baseVal.getItem(0);K.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(K,0)},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),B.prototype.select=function(){this.positionTip(),ee.prototype.select.call(this)},B.prototype.getState=function(){var K=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},ee.prototype.getState.call(this));return K.typeName=B.typeName,K},B.prototype.restoreState=function(K){var Q=K;this.bgColor=Q.bgColor,this.tipPosition=Q.tipPosition,ee.prototype.restoreState.call(this,K),this.createTip(),this.setTipPoints()},B.prototype.scale=function(K,Q){ee.prototype.scale.call(this,K,Q),this.tipPosition={x:this.tipPosition.x*K,y:this.tipPosition.y*Q},this.positionTip()},B.typeName="CalloutMarker",B.title="Callout marker",B.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>',B}(vt),Be=function(ee){function B(K,Q,le){var Z=ee.call(this,K,Q,le)||this;return Z.fillColor="transparent",Z.strokeColor="transparent",Z.strokeWidth=0,Z.strokeDasharray="",Z.opacity=1,Z.strokeColor=le.defaultColor,Z.strokeWidth=le.defaultStrokeWidth,Z.strokeDasharray=le.defaultStrokeDasharray,Z.fillColor=le.defaultFillColor,Z.setStrokeColor=Z.setStrokeColor.bind(Z),Z.setFillColor=Z.setFillColor.bind(Z),Z.setStrokeWidth=Z.setStrokeWidth.bind(Z),Z.setStrokeDasharray=Z.setStrokeDasharray.bind(Z),Z.setOpacity=Z.setOpacity.bind(Z),Z.createVisual=Z.createVisual.bind(Z),Z.strokePanel=new Ze("Line color",ge(le.defaultColorSet,["transparent"]),le.defaultColor),Z.strokePanel.onColorChanged=Z.setStrokeColor,Z.fillPanel=new Ze("Fill color",ge(le.defaultColorSet,["transparent"]),Z.fillColor,be),Z.fillPanel.onColorChanged=Z.setFillColor,Z.strokeWidthPanel=new Ft("Line width",le.defaultStrokeWidths,le.defaultStrokeWidth),Z.strokeWidthPanel.onWidthChanged=Z.setStrokeWidth,Z.strokeStylePanel=new nn("Line style",le.defaultStrokeDasharrays,le.defaultStrokeDasharray),Z.strokeStylePanel.onStyleChanged=Z.setStrokeDasharray,Z.opacityPanel=new ae("Opacity",le.defaultOpacitySteps,Z.opacity),Z.opacityPanel.onOpacityChanged=Z.setOpacity,Z}return me(B,ee),B.prototype.ownsTarget=function(K){return!(!ee.prototype.ownsTarget.call(this,K)&&K!==this.visual)},B.prototype.createVisual=function(){this.visual=ue.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},B.prototype.pointerDown=function(K,Q){ee.prototype.pointerDown.call(this,K,Q),this.state==="new"&&(this.createVisual(),this.moveVisual(K),this._state="creating")},B.prototype.manipulate=function(K){ee.prototype.manipulate.call(this,K)},B.prototype.resize=function(K){ee.prototype.resize.call(this,K),this.setSize()},B.prototype.setSize=function(){ee.prototype.setSize.call(this),ue.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},B.prototype.pointerUp=function(K){ee.prototype.pointerUp.call(this,K),this.setSize()},B.prototype.setStrokeColor=function(K){this.strokeColor=K,this.visual&&ue.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(K),this.stateChanged()},B.prototype.setFillColor=function(K){this.fillColor=K,this.visual&&ue.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(K),this.stateChanged()},B.prototype.setStrokeWidth=function(K){this.strokeWidth=K,this.visual&&ue.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},B.prototype.setStrokeDasharray=function(K){this.strokeDasharray=K,this.visual&&ue.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},B.prototype.setOpacity=function(K){this.opacity=K,this.visual&&ue.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var K=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ee.prototype.getState.call(this));return K.typeName=B.typeName,K},B.prototype.restoreState=function(K){var Q=K;this.fillColor=Q.fillColor,this.strokeColor=Q.strokeColor,this.strokeWidth=Q.strokeWidth,this.strokeDasharray=Q.strokeDasharray,this.opacity=Q.opacity,this.createVisual(),ee.prototype.restoreState.call(this,K),this.setSize()},B.prototype.scale=function(K,Q){ee.prototype.scale.call(this,K,Q),this.setSize()},B.typeName="EllipseMarker",B.title="Ellipse marker",B.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>',B}(Bt),yt=function(ee){function B(K,Q,le){return ee.call(this,K,Q,le)||this}return me(B,ee),Object.defineProperty(B.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),B.prototype.ownsTarget=function(K){return!(!ee.prototype.ownsTarget.call(this,K)&&K!==this.tip1&&K!==this.tip2)},B.prototype.createTips=function(){this.tip1=ue.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ue.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.tip2)},B.prototype.pointerDown=function(K,Q){ee.prototype.pointerDown.call(this,K,Q),this.state==="creating"&&this.createTips()},B.prototype.adjustVisual=function(){if(ee.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ue.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),ue.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var K=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),Q=this.tip1.transform.baseVal.getItem(0);Q.setRotate(K,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(Q,0);var le=this.tip2.transform.baseVal.getItem(0);le.setRotate(K+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(le,0)}},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var K=ee.prototype.getState.call(this);return K.typeName=B.typeName,K},B.prototype.restoreState=function(K){ee.prototype.restoreState.call(this,K),this.createTips(),this.adjustVisual()},B.typeName="MeasurementMarker",B.title="Measurement marker",B.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>',B}(mt),Xt=function(ee){function B(K,Q,le){var Z=ee.call(this,K,Q,le)||this;return Z.strokePanel.colors=le.defaultColorSet,Z.fillColor="transparent",Z}return me(B,ee),Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var K=ee.prototype.getState.call(this);return K.typeName=B.typeName,K},B.typeName="EllipseFrameMarker",B.title="Ellipse frame marker",B.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>',B}(Be),an=function(){function ee(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(ee.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),ee.prototype.addUndoStep=function(B){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(B)||(this.undoStack.push(B),JSON.stringify(this.lastRedoStep)!==JSON.stringify(B)&&this.redoStack.splice(0,this.redoStack.length))},ee.prototype.replaceLastUndoStep=function(B){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=B)},ee.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},ee.prototype.undo=function(){if(this.undoStack.length>1){var B=this.undoStack.pop();return B!==void 0&&this.redoStack.push(B),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},ee.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},ee}(),pt=function(ee){function B(K,Q,le){var Z=ee.call(this,K,Q,le)||this;return Z.strokeColor="transparent",Z.strokeWidth=0,Z.strokeDasharray="",Z.curveX=0,Z.curveY=0,Z.manipulationStartCurveX=0,Z.manipulationStartCurveY=0,Z.setStrokeColor=Z.setStrokeColor.bind(Z),Z.setStrokeWidth=Z.setStrokeWidth.bind(Z),Z.setStrokeDasharray=Z.setStrokeDasharray.bind(Z),Z.positionGrips=Z.positionGrips.bind(Z),Z.addControlGrips=Z.addControlGrips.bind(Z),Z.adjustVisual=Z.adjustVisual.bind(Z),Z.setupControlBox=Z.setupControlBox.bind(Z),Z.resize=Z.resize.bind(Z),Z.strokeColor=le.defaultColor,Z.strokeWidth=le.defaultStrokeWidth,Z.strokeDasharray=le.defaultStrokeDasharray,Z.strokePanel=new Ze("Line color",le.defaultColorSet,le.defaultColor),Z.strokePanel.onColorChanged=Z.setStrokeColor,Z.strokeWidthPanel=new Ft("Line width",le.defaultStrokeWidths,le.defaultStrokeWidth),Z.strokeWidthPanel.onWidthChanged=Z.setStrokeWidth,Z.strokeStylePanel=new nn("Line style",le.defaultStrokeDasharrays,le.defaultStrokeDasharray),Z.strokeStylePanel.onStyleChanged=Z.setStrokeDasharray,Z}return me(B,ee),B.prototype.ownsTarget=function(K){return!(!ee.prototype.ownsTarget.call(this,K)&&K!==this.visual&&K!==this.selectorCurve&&K!==this.visibleCurve&&!this.curveGrip.ownsTarget(K))},B.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},B.prototype.createVisual=function(){this.visual=ue.createGroup(),this.selectorCurve=ue.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ue.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},B.prototype.pointerDown=function(K,Q){ee.prototype.pointerDown.call(this,K,Q),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=K.x,this.curveY=K.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(Q)&&(this.activeGrip=this.curveGrip,this._state="resize")},B.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ue.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ue.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ue.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},B.prototype.setupControlBox=function(){ee.prototype.setupControlBox.call(this),this.curveControlLine1=ue.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ue.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},B.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,ee.prototype.addControlGrips.call(this)},B.prototype.positionGrips=function(){ee.prototype.positionGrips.call(this);var K=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-K/2,this.curveY-K/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()))},B.prototype.manipulate=function(K){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+K.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+K.y-this.manipulationStartY),ee.prototype.manipulate.call(this,K)},B.prototype.resize=function(K){this.activeGrip===this.curveGrip&&(this.curveX=K.x,this.curveY=K.y),ee.prototype.resize.call(this,K),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},B.prototype.setStrokeColor=function(K){this.strokeColor=K,this.adjustVisual(),this.colorChanged(K)},B.prototype.setStrokeWidth=function(K){this.strokeWidth=K,this.adjustVisual()},B.prototype.setStrokeDasharray=function(K){this.strokeDasharray=K,this.adjustVisual()},B.prototype.scale=function(K,Q){this.curveX=this.curveX*K,this.curveY=this.curveY*Q,ee.prototype.scale.call(this,K,Q)},Object.defineProperty(B.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),B.prototype.getState=function(){var K=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},ee.prototype.getState.call(this));return K.typeName=B.typeName,K},B.prototype.restoreState=function(K){ee.prototype.restoreState.call(this,K);var Q=K;this.strokeColor=Q.strokeColor,this.strokeWidth=Q.strokeWidth,this.strokeDasharray=Q.strokeDasharray,this.curveX=Q.curveX,this.curveY=Q.curveY,this.createVisual(),this.adjustVisual()},B.typeName="CurveMarker",B.title="Curve marker",B.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>',B}(ut),Yt=function(){function ee(B,K){K===void 0&&(K=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=B,this.cancelable=K}return Object.defineProperty(ee.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),ee.prototype.preventDefault=function(){this._defaultPrevented=!0},ee}(),St=function(ee){function B(K,Q,le){var Z=ee.call(this,K,!1)||this;return Z.dataUrl=Q,Z.state=le,Z}return me(B,ee),B}(Yt),Ot=function(ee){function B(K,Q,le){le===void 0&&(le=!1);var Z=ee.call(this,K,le)||this;return Z.marker=Q,Z}return me(B,ee),B}(Yt),dt=function(){function ee(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return ee.prototype.addEventListener=function(B,K){this[B].push(K)},ee.prototype.removeEventListener=function(B,K){var Q=this[B].indexOf(K);Q>-1&&this[B].splice(Q,1)},ee}(),_e=function(){function ee(B){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Se,this._isOpen=!1,this.undoRedoManager=new an,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new dt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=ee.instanceCounter++,this.styles=new Re(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=B,this.targetRoot=document.body,this.width=B.clientWidth,this.height=B.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(ee.prototype,"ALL_MARKER_TYPES",{get:function(){return[Le,Pe,we,vt,Xt,Be,ce,Ce,yt,ie,mt,pt]},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Le,Pe,we,vt,Be,ce,Ce]},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Le,Pe,we,vt,ce]},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(B){var K=this;this._availableMarkerTypes.splice(0),B.forEach(function(Q){if(typeof Q=="string"){var le=K.ALL_MARKER_TYPES.find(function(Z){return Z.typeName===Q});le!==void 0&&K._availableMarkerTypes.push(le)}else K._availableMarkerTypes.push(Q)})},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(B){this._zoomLevel=B,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),ee.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),$e.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},ee.prototype.show=function(){var B=this;this.styles.styleSheetRoot===void 0&&ye.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ye.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(K){return K(new Yt(B))})},ee.prototype.render=function(){return ve(this,void 0,void 0,function(){var B;return Ae(this,function(K){switch(K.label){case 0:return this.setCurrentMarker(),(B=new Tt).naturalSize=this.renderAtNaturalSize,B.imageType=this.renderImageType,B.imageQuality=this.renderImageQuality,B.markersOnly=this.renderMarkersOnly,B.width=this.renderWidth,B.height=this.renderHeight,[4,B.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return K.sent(),[4,B.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,K.sent()]}})})},ee.prototype.close=function(B){var K=this;if(B===void 0&&(B=!1),this.isOpen){var Q=!1;B||this.eventListeners.beforeclose.forEach(function(le){var Z=new Yt(K,!0);le(Z),Z.defaultPrevented&&(Q=!0)}),Q||(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(le){return le(new Yt(K))}),this.detachEvents(),this._isOpen=!1)}},ee.prototype.addMarkersToToolbar=function(){for(var B,K=[],Q=0;Q<arguments.length;Q++)K[Q]=arguments[Q];(B=this._availableMarkerTypes).push.apply(B,K)},ee.prototype.addRenderEventListener=function(B){this.addEventListener("render",function(K){B(K.dataUrl,K.state)})},ee.prototype.removeRenderEventListener=function(B){},ee.prototype.addCloseEventListener=function(B){this.addEventListener("close",function(){B()})},ee.prototype.removeCloseEventListener=function(B){},ee.prototype.setupResizeObserver=function(){var B=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){B.resize(B.target.clientWidth,B.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return B.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},ee.prototype.onPopupTargetResize=function(){var B=1*this.target.clientWidth/this.target.clientHeight,K=this.editorCanvas.clientWidth/B>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*B:this.editorCanvas.clientWidth,Q=K<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/B;this.resize(K,Q)},ee.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ee.prototype.resize=function(B,K){this._isResizing=!0;var Q=B/this.imageWidth,le=K/this.imageHeight;this.imageWidth=Math.round(B),this.imageHeight=Math.round(K),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(Q,le),this._isResizing=!1},ee.prototype.scaleMarkers=function(B,K){var Q,le=this;this._currentMarker&&this._currentMarker instanceof vt?this._currentMarker.scale(B,K):(Q=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(Z){Z!==le._currentMarker&&Z.scale(B,K)}),Q!==void 0&&this.setCurrentMarker(Q)},ee.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},ee.prototype.setTopLeft=function(){var B=this.editingTarget.getBoundingClientRect(),K=this.editorCanvas.getBoundingClientRect();this.left=B.left-K.left,this.top=B.top-K.top},ee.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},ee.prototype.addDefs=function(){for(var B,K=[],Q=0;Q<arguments.length;Q++)K[Q]=arguments[Q];this.defs=ue.createDefs(),this.addDefsToImage(),(B=this.defs).append.apply(B,K)},ee.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},ee.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},ee.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},ee.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},ee.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},ee.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},ee.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},ee.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var B=document.createElement("a");B.href="https://markerjs.com/",B.target="_blank",B.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>',B.title="Powered by marker.js",B.style.display="grid",B.style.alignItems="center",B.style.justifyItems="center",B.style.padding="3px",B.style.width="20px",B.style.height="20px",this.logoUI.appendChild(B),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},ee.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},ee.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},ee.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ee.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var B=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=B+"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 ke(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 lt(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},ee.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ee.prototype.removeMarker=function(B){this.markerImage.removeChild(B.container),this.markers.indexOf(B)>-1&&this.markers.splice(this.markers.indexOf(B),1),B.dispose()},ee.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},ee.prototype.toolbarButtonClicked=function(B,K){if(B==="marker"&&K!==void 0)this.createNewMarker(K);else if(B==="action")switch(K){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},ee.prototype.deleteSelectedMarker=function(){var B=this;if(this._currentMarker!==void 0){var K=!1;if(this.eventListeners.markerbeforedelete.forEach(function(le){var Z=new Ot(B,B._currentMarker,!0);le(Z),Z.defaultPrevented&&(K=!0)}),!K){var Q=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(le){return le(new Ot(B,Q))})}}},ee.prototype.clear=function(){var B=this,K=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Qe){var qt=new Ot(B,void 0,!0);Qe(qt),qt.defaultPrevented&&(K=!0)}),!K)){this.setCurrentMarker();for(var Q=function(Qe){var qt=le.markers[Qe];le.setCurrentMarker(le.markers[Qe]),le._currentMarker.dispose(),le.markerImage.removeChild(le._currentMarker.container),le.markers.splice(le.markers.indexOf(le._currentMarker),1),le.eventListeners.markerdelete.forEach(function(An){return An(new Ot(B,qt))})},le=this,Z=this.markers.length-1;Z>=0;Z--)Q(Z);this.addUndoStep()}},Object.defineProperty(ee.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),ee.prototype.showNotesEditor=function(){var B;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=(B=this._currentMarker.notes)!==null&&B!==void 0?B:"",this.overlayContainer.appendChild(this.notesArea))},ee.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},ee.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},ee.prototype.addUndoStep=function(){var B=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var K=this.getState(),Q=this.undoRedoManager.getLastUndoStep();if(!Q||Q.width===K.width&&Q.height===K.height){var le=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(K),le<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(Z){return Z(new Yt(B))})}else this.undoRedoManager.replaceLastUndoStep(K),this.eventListeners.statechange.forEach(function(Z){return Z(new Yt(B))})}},ee.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},ee.prototype.undoStep=function(){var B=this,K=this.undoRedoManager.undo();K!==void 0&&(this.restoreState(K),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Q){return Q(new Yt(B))}))},ee.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},ee.prototype.redoStep=function(){var B=this,K=this.undoRedoManager.redo();K!==void 0&&(this.restoreState(K),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Q){return Q(new Yt(B))}))},ee.prototype.stepZoom=function(){var B=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=B<this.zoomSteps.length-1?this.zoomSteps[B+1]:this.zoomSteps[0]},ee.prototype.panTo=function(B){this.contentDiv.scrollBy({left:this.prevPanPoint.x-B.x,top:this.prevPanPoint.y-B.y}),this.prevPanPoint=B},ee.prototype.startRenderAndClose=function(){return ve(this,void 0,void 0,function(){var B,K,Q=this;return Ae(this,function(le){switch(le.label){case 0:return[4,this.render()];case 1:return B=le.sent(),K=this.getState(),this.eventListeners.render.forEach(function(Z){return Z(new St(Q,B,K))}),this.close(!0),[2]}})})},ee.prototype.getState=function(B){B===!0&&this.setCurrentMarker();var K={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(Q){return K.markers.push(Q.getState())}),K},ee.prototype.restoreState=function(B){var K=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);B.markers.forEach(function(Q){var le=K._availableMarkerTypes.find(function(Qe){return Qe.typeName===Q.typeName});if(le!==void 0){var Z=K.addNewMarker(le);Z.restoreState(Q),K.markers.push(Z)}}),B.width&&B.height&&(B.width!==this.imageWidth||B.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/B.width,this.imageHeight/B.height),this.eventListeners.restorestate.forEach(function(Q){return Q(new Yt(K))})},ee.prototype.addNewMarker=function(B){var K=ue.createGroup();return this.markerImage.appendChild(K),new B(K,this.overlayContainer,this.settings)},ee.prototype.createNewMarker=function(B){var K,Q=this;(K=typeof B=="string"?this._availableMarkerTypes.find(function(le){return le.typeName===B}):B)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(K),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(K.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(le){return le(new Ot(Q,Q._currentMarker))}))},ee.prototype.markerCreated=function(B){var K=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(B),this.setCurrentMarker(B),B instanceof Pe&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Pe):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(Q){return Q(new Ot(K,K._currentMarker))})},ee.prototype.colorChanged=function(B){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=B,this.settings.defaultStrokeColor=B)},ee.prototype.fillColorChanged=function(B){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=B)},ee.prototype.markerStateChanged=function(B){var K=this;this.eventListeners.markerchange.forEach(function(Q){return Q(new Ot(K,B))})},ee.prototype.setCurrentMarker=function(B){var K=this;this._currentMarker!==B&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(Q){return Q(new Ot(K,K._currentMarker))})),this._currentMarker=B,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(Q){return Q(new Ot(K,K._currentMarker))}))},ee.prototype.onPointerDown=function(B){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||B.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var K=this.markers.find(function(Q){return Q.ownsTarget(B.target)});K!==void 0?(this.setCurrentMarker(K),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(B.clientX,B.clientY),B.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:B.clientX,y:B.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(B.clientX,B.clientY))},ee.prototype.onDblClick=function(B){if(this._isFocused||this.focus(),this.mode==="select"){var K=this.markers.find(function(Q){return Q.ownsTarget(B.target)});K!==void 0&&K!==this._currentMarker&&this.setCurrentMarker(K),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(B.clientX,B.clientY),B.target):this.setCurrentMarker()}},ee.prototype.onPointerMove=function(B){this.touchPoints!==1&&B.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||B.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(B.clientX,B.clientY)):this.zoomLevel>1&&this.panTo({x:B.clientX,y:B.clientY}))},ee.prototype.onPointerUp=function(B){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(B.clientX,B.clientY)),this.isDragging=!1,this.addUndoStep()},ee.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},ee.prototype.onKeyUp=function(B){this._currentMarker===void 0||this.notesArea!==void 0||B.key!=="Delete"&&B.key!=="Backspace"||this.deleteSelectedMarker()},ee.prototype.clientToLocalCoordinates=function(B,K){var Q=this.markerImage.getBoundingClientRect();return{x:(B-Q.left)/this.zoomLevel,y:(K-Q.top)/this.zoomLevel}},ee.prototype.onWindowResize=function(){this.positionUI()},ee.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var B=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=B+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},ee.prototype.addLicenseKey=function(B){$e.addKey(B)},ee.prototype.addEventListener=function(B,K){this.eventListeners.addEventListener(B,K)},ee.prototype.removeEventListener=function(B,K){this.eventListeners.removeEventListener(B,K)},ee.prototype.renderState=function(B){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(B),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(ee.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),ee.prototype.focus=function(){var B=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(K){return K(new Yt(B))}))},ee.prototype.blur=function(){var B=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(K){return K(new Yt(B))}))},ee.instanceCounter=0,ee}();/* **********************************
|
|
cropro version 1.2.0
|
|
@license SEE LICENSE IN LICENSE
|
|
|
|
copyright Alan Mendelevich
|
|
see README and LICENSE for details
|
|
********************************** *//*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var je=function(ee,B){return(je=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(K,Q){K.__proto__=Q}||function(K,Q){for(var le in Q)Object.prototype.hasOwnProperty.call(Q,le)&&(K[le]=Q[le])})(ee,B)};function kt(ee,B){if(typeof B!="function"&&B!==null)throw new TypeError("Class extends value "+String(B)+" is not a constructor or null");function K(){this.constructor=ee}je(ee,B),ee.prototype=B===null?Object.create(B):(K.prototype=B.prototype,new K)}function gt(ee,B,K,Q){return new(K||(K=Promise))(function(le,Z){function Qe(Vn){try{An(Q.next(Vn))}catch(sn){Z(sn)}}function qt(Vn){try{An(Q.throw(Vn))}catch(sn){Z(sn)}}function An(Vn){var sn;Vn.done?le(Vn.value):(sn=Vn.value,sn instanceof K?sn:new K(function(tr){tr(sn)})).then(Qe,qt)}An((Q=Q.apply(ee,B||[])).next())})}function zt(ee,B){var K,Q,le,Z,Qe={label:0,sent:function(){if(1&le[0])throw le[1];return le[1]},trys:[],ops:[]};return Z={next:qt(0),throw:qt(1),return:qt(2)},typeof Symbol=="function"&&(Z[Symbol.iterator]=function(){return this}),Z;function qt(An){return function(Vn){return function(sn){if(K)throw new TypeError("Generator is already executing.");for(;Qe;)try{if(K=1,Q&&(le=2&sn[0]?Q.return:sn[0]?Q.throw||((le=Q.return)&&le.call(Q),0):Q.next)&&!(le=le.call(Q,sn[1])).done)return le;switch(Q=0,le&&(sn=[2&sn[0],le.value]),sn[0]){case 0:case 1:le=sn;break;case 4:return Qe.label++,{value:sn[1],done:!1};case 5:Qe.label++,Q=sn[1],sn=[0];continue;case 7:sn=Qe.ops.pop(),Qe.trys.pop();continue;default:if(!(le=Qe.trys,(le=le.length>0&&le[le.length-1])||sn[0]!==6&&sn[0]!==2)){Qe=0;continue}if(sn[0]===3&&(!le||sn[1]>le[0]&&sn[1]<le[3])){Qe.label=sn[1];break}if(sn[0]===6&&Qe.label<le[1]){Qe.label=le[1],le=sn;break}if(le&&Qe.label<le[2]){Qe.label=le[2],Qe.ops.push(sn);break}le[2]&&Qe.ops.pop(),Qe.trys.pop();continue}sn=B.call(ee,Qe)}catch(tr){sn=[6,tr],Q=0}finally{K=le=0}if(5&sn[0])throw sn[1];return{value:sn[0]?sn[1]:void 0,done:!0}}([An,Vn])}}}var $t=function(){function ee(){}return ee.addKey=function(B){ee.key=B},Object.defineProperty(ee,"isLicensed",{get:function(){return!!ee.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ee.key)},enumerable:!1,configurable:!0}),ee}(),De=function(){function ee(){}return ee.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ee.setAttributes=function(B,K){for(var Q=0,le=K;Q<le.length;Q++){var Z=le[Q],Qe=Z[0],qt=Z[1];B.setAttribute(Qe,qt)}},ee.createRect=function(B,K,Q){var le=document.createElementNS("http://www.w3.org/2000/svg","rect");return le.setAttribute("width",B.toString()),le.setAttribute("height",K.toString()),Q&&ee.setAttributes(le,Q),le},ee.createLine=function(B,K,Q,le,Z){var Qe=document.createElementNS("http://www.w3.org/2000/svg","line");return Qe.setAttribute("x1",B.toString()),Qe.setAttribute("y1",K.toString()),Qe.setAttribute("x2",Q.toString()),Qe.setAttribute("y2",le.toString()),Z&&ee.setAttributes(Qe,Z),Qe},ee.createPolygon=function(B,K){var Q=document.createElementNS("http://www.w3.org/2000/svg","polygon");return Q.setAttribute("points",B),K&&ee.setAttributes(Q,K),Q},ee.createCircle=function(B,K){var Q=document.createElementNS("http://www.w3.org/2000/svg","circle");return Q.setAttribute("cx",(B/2).toString()),Q.setAttribute("cy",(B/2).toString()),Q.setAttribute("r",B.toString()),K&&ee.setAttributes(Q,K),Q},ee.createEllipse=function(B,K,Q){var le=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return le.setAttribute("cx",(B/2).toString()),le.setAttribute("cy",(K/2).toString()),le.setAttribute("rx",(B/2).toString()),le.setAttribute("ry",(K/2).toString()),Q&&ee.setAttributes(le,Q),le},ee.createGroup=function(B){var K=document.createElementNS("http://www.w3.org/2000/svg","g");return B&&ee.setAttributes(K,B),K},ee.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ee.createMarker=function(B,K,Q,le,Z,Qe,qt){var An=document.createElementNS("http://www.w3.org/2000/svg","marker");return ee.setAttributes(An,[["id",B],["orient",K],["markerWidth",Q.toString()],["markerHeight",le.toString()],["refX",Z.toString()],["refY",Qe.toString()]]),An.appendChild(qt),An},ee.createText=function(B){var K=document.createElementNS("http://www.w3.org/2000/svg","text");return K.setAttribute("x","0"),K.setAttribute("y","0"),B&&ee.setAttributes(K,B),K},ee.createTSpan=function(B,K){var Q=document.createElementNS("http://www.w3.org/2000/svg","tspan");return Q.textContent=B,K&&ee.setAttributes(Q,K),Q},ee.createImage=function(B){var K=document.createElementNS("http://www.w3.org/2000/svg","image");return B&&ee.setAttributes(K,B),K},ee.createPoint=function(B,K){var Q=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return Q.x=B,Q.y=K,Q},ee.createPath=function(B,K){var Q=document.createElementNS("http://www.w3.org/2000/svg","path");return Q.setAttribute("d",B),K&&ee.setAttributes(Q,K),Q},ee.createElement=function(B,K){var Q=document.createElementNS("http://www.w3.org/2000/svg",B);return K&&ee.setAttributes(Q,K),Q},ee.getHollowRectanglePath=function(B,K,Q,le,Z,Qe,qt,An){return"M"+B+","+K+"V"+(K+le)+"H"+(B+Q)+"V"+K+"H"+Z+"V"+Qe+"H"+(Z+qt)+"V"+(Qe+An)+"H"+Z+"V"+K+"Z"},ee}(),qe=function(){function ee(B){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+B+"_"}return Object.defineProperty(ee.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),ee.prototype.addClass=function(B){return this.styleSheet===void 0&&this.addStyleSheet(),B.name=""+this.classNamePrefix+B.localName,this.classes.push(B),this.styleSheet.sheet.insertRule("."+B.name+" {"+B.style+"}",this.styleSheet.sheet.cssRules.length),B},ee.prototype.addRule=function(B){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(B),this.styleSheet.sheet.insertRule(B.selector+" {"+B.style+"}",this.styleSheet.sheet.cssRules.length)},ee.prototype.addStyleSheet=function(){var B;this.styleSheet=document.createElement("style"),((B=this.styleSheetRoot)!==null&&B!==void 0?B:document.head).appendChild(this.styleSheet),this.addRule(new jt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new jt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new jt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Zt("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Zt("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},ee.prototype.removeStyleSheet=function(){var B;this.styleSheet&&(((B=this.styleSheetRoot)!==null&&B!==void 0?B:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ee}(),jt=function(ee,B){this.selector=ee,this.style=B},Zt=function(ee,B){this.localName=ee,this.style=B},gn=function(){function ee(){this.blocks=[],this.display=""}return ee.prototype.addButtonBlock=function(B){B.className=this.blockClassName,B.buttonClassName=this.buttonClassName,B.buttonColorsClassName=this.buttonColorsClassName,B.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(B)},ee.prototype.addElementBlock=function(B){B.className===void 0&&(B.className=this.blockClassName),this.blocks.push(B)},ee.prototype.getUI=function(){var B=document.createElement("div");return B.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,B.style.display=this.display,this.blocks.forEach(function(K){return B.appendChild(K.getUI())}),B},ee}(),On=function(){function ee(){}return ee.prototype.getUI=function(){var B=document.createElement("div");if(B.className=this.className,this.minWidth!==void 0&&(B.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":B.style.justifyContent="flex-start";break;case"center":B.style.justifyContent="center";break;case"end":B.style.justifyContent="flex-end"}return B.style.whiteSpace="nowrap",B},ee}(),ur=function(ee){function B(){var K=ee!==null&&ee.apply(this,arguments)||this;return K.buttons=[],K}return kt(B,ee),B.prototype.addButton=function(K){K.className=this.buttonClassName,K.colorsClassName=this.buttonColorsClassName,K.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(K)},B.prototype.getUI=function(){var K=ee.prototype.getUI.call(this);return this.buttons.forEach(function(Q){return K.appendChild(Q.getUI())}),K},B}(On),Kn=function(){function ee(B,K){this._isActive=!1,this._isHidden=!1,this._icon=B,this.title=K,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(ee.prototype,"icon",{get:function(){return this._icon},set:function(B){this._icon=B,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"isActive",{get:function(){return this._isActive},set:function(B){this._isActive=B,this.adjustClassName()},enumerable:!1,configurable:!0}),ee.prototype.getUI=function(){var B=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 B.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},ee.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},ee.prototype.hide=function(){this._isHidden=!0},ee}(),wn=function(ee){function B(){var K=ee!==null&&ee.apply(this,arguments)||this;return K.elements=[],K}return kt(B,ee),B.prototype.addElement=function(K){this.elements.push(K)},B.prototype.getUI=function(){var K=ee.prototype.getUI.call(this);return this.elements.forEach(function(Q){return K.appendChild(Q)}),K},B}(On),xr=function(){function ee(B,K){this.horizontal=B,this.vertical=K}return Object.defineProperty(ee.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),ee.prototype.getVerticalLength=function(B){return B/this.ratio},ee.prototype.getHorizontalLength=function(B){return B*this.ratio},ee}(),Fr=function(){function ee(){}return ee.getIcon=function(B,K){if(B>0&&K>0){var Q=new xr(B,K),le=Q.ratio>=1?20:Q.getHorizontalLength(20),Z=Q.ratio<1?20:Q.getVerticalLength(20),Qe=document.createElementNS("http://www.w3.org/2000/svg","svg");Qe.setAttribute("xmlns","http://www.w3.org/2000/svg"),Qe.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Qe);var qt=De.createDefs();Qe.appendChild(qt);var An=De.createElement("clipPath",[["id","text-bg-clip"]]);qt.appendChild(An);var Vn=De.createPath(De.getHollowRectanglePath((24-le)/2,(24-Z)/2,le,Z,(24-le)/2+2,(24-Z)/2+2,le-4,Z-4));Qe.appendChild(Vn);var sn=De.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);sn.appendChild(De.createTSpan(B+":"+K)),Qe.appendChild(sn);var tr=sn.getBBox();De.setAttributes(sn,[["x",((24-tr.width)/2).toString()],["y",((24-tr.height)/2-tr.y).toString()]]);var vn=De.createPath(De.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(tr.width))/2,(24-Math.ceil(tr.height))/2,Math.ceil(tr.width),Math.ceil(tr.height)));return An.appendChild(vn),De.setAttributes(Vn,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Qe),Qe.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},ee}(),hr=function(ee){function B(K,Q,le){var Z=ee.call(this,K,Q)||this;return Z.isDropdownOpen=!1,Z.onClick=Z.dropdownButtonClicked,Z.dropdownButtons=le,Z}return kt(B,ee),B.prototype.setupDropdown=function(){var K=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(Q){Q.className=K.className,Q.colorsClassName=K.colorsClassName,K.dropdownBlock.appendChild(Q.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},B.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},B.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},B.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},B.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},B.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},B}(Kn),dr=function(){function ee(B,K){this.GRIP_SIZE=10,this.color=B,this.fillColor=K,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",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ee.prototype.ownsTarget=function(B){return B===this.visual||B===this.visual.childNodes[0]||B===this.visual.childNodes[1]},ee.prototype.setCenter=function(B,K){this.visual.childNodes.forEach(function(Q){return De.setAttributes(Q,[["cx",B.toString()],["cy",K.toString()]])})},ee}(),Nr=function(){function ee(B,K,Q,le){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=B,this.canvasHeight=K,this.margin=Q,this.container=le,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(ee.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(B){this._aspectRatio=B,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(B){this._isGridVisible=B,this.gridContainer&&De.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(B){this._zoomFactor=B,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),ee.prototype.open=function(){var B=this;this.cropShadeElement=De.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=De.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var K=0;K<this.numberOfGridLines;K++)this.horizontalGridLines.push(De.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(De.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(Q){return B.gridContainer.appendChild(Q)}),this.verticalGridLines.forEach(function(Q){return B.gridContainer.appendChild(Q)}),this.cropRectElement=De.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new dr(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new dr(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new dr(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new dr(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},ee.prototype.setCropRectangle=function(B){this.cropRect=B;var K=Object.assign({},this.cropRect);this.zoomFactor!==1&&(K.width=this.cropRect.width*this.zoomFactor,K.height=this.cropRect.height*this.zoomFactor,K.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-K.width/2,K.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-K.height/2),De.setAttributes(this.cropRectElement,[["x",K.x.toString()],["y",K.y.toString()],["width",K.width.toString()],["height",K.height.toString()]]);var Q=K.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(Z,Qe){var qt=K.y+Q*(Qe+1);De.setAttributes(Z,[["x1",""+K.x],["y1",""+qt],["x2",""+(K.x+K.width)],["y2",""+qt]])});var le=K.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(Z,Qe){var qt=K.x+le*(Qe+1);De.setAttributes(Z,[["x1",""+qt],["y1",""+K.y],["x2",""+qt],["y2",""+(K.y+K.height)]])}),De.setAttributes(this.cropShadeElement,[["d",De.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,K.x,K.y,K.width,K.height)]]),this.topLeftGrip.setCenter(K.x,K.y),this.topRightGrip.setCenter(K.x+K.width,K.y),this.bottomLeftGrip.setCenter(K.x,K.y+K.height),this.bottomRightGrip.setCenter(K.x+K.width,K.y+K.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},ee.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},ee.prototype.clientToLocalCoordinates=function(B,K){var Q=this.container.getBoundingClientRect();return{x:B-Q.left+this.margin,y:K-Q.top+this.margin}},ee.prototype.onPointerDown=function(B){this.container.setPointerCapture(B.pointerId),this.previousPoint=this.clientToLocalCoordinates(B.clientX,B.clientY),this.cropRectElement===B.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(B.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(B.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(B.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(B.target)&&(this.activeGrip=this.bottomRightGrip)},ee.prototype.onPointerMove=function(B){if(this.isMoving)this.move(this.clientToLocalCoordinates(B.clientX,B.clientY));else if(this.activeGrip){var K=this.clientToLocalCoordinates(B.clientX,B.clientY);this.resize(K)}B.preventDefault()},ee.prototype.onPointerUp=function(B){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(B.pointerId)},ee.prototype.move=function(B){var K=B.x-this.previousPoint.x,Q=B.y-this.previousPoint.y;this.zoomFactor!==1&&(K=-K/this.zoomFactor,Q=-Q/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+K),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+Q),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=B},ee.prototype.resize=function(B){var K=Object.assign({},this.cropRect),Q=B.x-this.previousPoint.x,le=B.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:K.x+Q<this.margin&&(Q=this.margin-K.x),K.x+=Q,K.width=this.cropRect.x+this.cropRect.width-K.x;break;case this.bottomRightGrip:case this.topRightGrip:K.width+Q>this.canvasWidth*this.zoomFactor&&(Q=this.canvasWidth*this.zoomFactor-K.width),K.width+=Q}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(K.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(Q),K.height=this.aspectRatio.getVerticalLength(K.width)):(K.y+=le,K.height=this.cropRect.y+this.cropRect.height-K.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?K.height=this.aspectRatio.getVerticalLength(K.width):K.height+=le}K.width<10&&(K.x=this.cropRect.x,K.width=10),K.height<10&&(K.y=this.cropRect.y,K.height=10),this.previousPoint=B,K.x>=this.margin&&K.y>=this.margin&&K.x-this.margin+K.width<=this.canvasWidth&&K.y-this.margin+K.height<=this.canvasHeight&&(this.cropRect=K,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},ee.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var B=this.cropRect.x+this.cropRect.width/2,K=this.cropRect.y+this.cropRect.height/2,Q=this.aspectRatio.getHorizontalLength(this.cropRect.height),le=this.aspectRatio.getVerticalLength(this.cropRect.width);Q/this.canvasWidth<le/this.canvasHeight?this.cropRect.width=Q:this.cropRect.height=le,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=B-this.cropRect.width/2,this.cropRect.y=K-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},ee.prototype.getRescaledRect=function(B,K,Q,le,Z,Qe){var qt=Q/B,An=le/K;return{x:(Z.x-Qe)*qt+Qe,y:(Z.y-Qe)*An+Qe,width:Z.width*qt,height:Z.height*An}},ee.prototype.scaleCanvas=function(B,K){var Q=this.getRescaledRect(this.canvasWidth,this.canvasHeight,B,K,this.cropRect,this.margin);this.canvasWidth=B,this.canvasHeight=K,this.onCropChange&&this.onCropChange(Q),this.setCropRectangle(Q)},ee}(),ti=function(){function ee(B){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=B,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(ee.prototype,"angle",{get:function(){return this._angle},set:function(B){this._angle=B,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),ee.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},ee.prototype.onPointerDown=function(B){this.controlContainer.setPointerCapture(B.pointerId),this.isDragging=!0,this.previousPoint={x:B.clientX,y:B.clientY}},ee.prototype.onPointerMove=function(B){this.isDragging&&(this.onAngleChange&&this.onAngleChange((B.clientX-this.previousPoint.x)/5),this.previousPoint.x=B.clientX)},ee.prototype.onPointerUp=function(B){this.isDragging&&this.onAngleChange&&this.onAngleChange((B.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(B.pointerId)},ee.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var B=this.angleLabelText.getBBox();De.setAttributes(this.angleLabelElement,[["x",((this.width-B.width)/2).toString()],["y",(this.height/2).toString()]])}},ee.prototype.positionScaleShape=function(){if(this.scaleShape){var B=this.scaleShape.transform.baseVal.getItem(0);B.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(B,0)}},ee.prototype.getVisual=function(){var B=document.createElementNS("http://www.w3.org/2000/svg","svg");B.setAttribute("xmlns","http://www.w3.org/2000/svg"),B.setAttribute("width",this.width+"px"),B.setAttribute("height",this.height+"px"),B.setAttribute("viewBox","0 0 "+this.width+" "+this.height),B.style.flexShrink="0",document.body.appendChild(B);for(var K="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,Q=1;Q<=this.width/5+10;Q++){var le=Q%5==0?this.height/3:this.height/6;K+="h4v"+-le+"h1v"+le}K+="v1H0Z",this.scaleShape=De.createPath(K);var Z=De.createTransform();this.scaleShape.transform.baseVal.appendItem(Z),B.appendChild(this.scaleShape),this.angleLabelElement=De.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=De.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Qe=De.createTSpan("");return Qe.innerHTML="°",this.angleLabelElement.appendChild(Qe),B.appendChild(this.angleLabelElement),document.body.removeChild(B),B},ee}(),pi=function(){function ee(){this.naturalSize=!1,this.imageType="image/png"}return ee.prototype.rasterize=function(B,K,Q,le,Z,Qe,qt){var An=this;return new Promise(function(Vn){var sn=document.createElement("canvas");sn.width=B.width.baseVal.value-2*le,sn.height=B.height.baseVal.value-2*le;var tr=1,vn=1;An.naturalSize===!0?(tr=K.naturalWidth/(B.width.baseVal.value-2*le)/Qe,vn=K.naturalHeight/(B.height.baseVal.value-2*le)/qt,sn.width=K.naturalWidth/Qe,sn.height=K.naturalHeight/qt):An.width!==void 0&&An.height!==void 0&&(tr=An.width/Q.width,vn=An.height/Q.height,sn.width*=tr,sn.height*=vn);var ln=sn.getContext("2d");ln.translate(sn.width/2,sn.height/2),ln.rotate(Z*Math.PI/180),ln.scale(Qe,qt),ln.translate(-sn.width/2,-sn.height/2),ln.drawImage(K,0,0,sn.width,sn.height);var xn=document.createElement("canvas");xn.width=Q.width*tr,xn.height=Q.height*vn,xn.getContext("2d").putImageData(ln.getImageData((Q.x-le)*tr,(Q.y-le)*vn,Q.width*tr,Q.height*vn),0,0),Vn(xn.toDataURL(An.imageType,An.imageQuality))})},ee}(),fn=function(){function ee(B){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=ee.instanceCounter++,this.styles=new qe(this.instanceNo),this.target=B,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(ee.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(B){this._zoomToCropEnabled=B,B?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(B){this._isGridVisible=B,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"gridLines",{get:function(){return this._gridLines},set:function(B){this._gridLines=B,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(B){this._rotationAngle=B,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ee.prototype,"aspectRatio",{get:function(){var B;return(B=this._aspectRatio)!==null&&B!==void 0?B:this.aspectRatios[0]},set:function(B){this._aspectRatio=B},enumerable:!1,configurable:!0}),ee.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},ee.prototype.show=function(){this.showUI(),this.open()},ee.prototype.close=function(B){B===void 0&&(B=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),B||this.closeEventListeners.forEach(function(K){return K()}),this._isOpen=!1)},ee.prototype.addRenderEventListener=function(B){this.renderEventListeners.push(B)},ee.prototype.removeRenderEventListener=function(B){this.renderEventListeners.indexOf(B)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(B),1)},ee.prototype.addCloseEventListener=function(B){this.closeEventListeners.push(B)},ee.prototype.removeCloseEventListener=function(B){this.closeEventListeners.indexOf(B)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(B),1)},ee.prototype.setupResizeObserver=function(){var B=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){B.resize(B.target.clientWidth,B.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},ee.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var B=1*this.target.clientWidth/this.target.clientHeight,K=this.contentDiv.clientWidth/B>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*B:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,Q=K+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/B;this.resize(K,Q)}},ee.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ee.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",De.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},ee.prototype.resize=function(B,K){this.imageWidth=Math.round(B),this.imageHeight=Math.round(K),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},ee.prototype.setEditingTarget=function(){var B=document.createElement("canvas");B.width=this.target.naturalWidth,B.height=this.target.naturalHeight,B.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var K=B.toDataURL();De.setAttributes(this.editingTarget,[["href",K]]),this.setEditingTargetSize()},ee.prototype.setTopLeft=function(){var B=this.target.getBoundingClientRect(),K=this.editorCanvas.getBoundingClientRect();this.left=B.left-K.left-this.CANVAS_MARGIN,this.top=B.top-K.top-this.CANVAS_MARGIN},ee.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=De.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=De.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=De.createGroup(),this.editingTargetRotationScaleContainer=De.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var B=De.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(B);var K=De.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(K),this.editingTargetContainer=De.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},ee.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},ee.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=De.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Nr(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},ee.prototype.zoomToCrop=function(){if(this.cropRect){var B=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,K=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=B+"px "+K+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-B+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-K+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},ee.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},ee.prototype.cropRectChanged=function(B){this.cropRect=B,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},ee.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},ee.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},ee.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ee.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var B=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,K=this.target.offsetTop>B+this.CANVAS_MARGIN?this.target.offsetTop-(B+this.CANVAS_MARGIN):0;this.coverDiv.style.top=K+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},ee.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},ee.prototype.addTopToolbar=function(){var B=this;this.topToolbar=new gn,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 K=new ur;K.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(K);var Q=[];this.aspectRatios.forEach(function(vn){var ln=new Kn(Fr.getIcon(vn.horizontal,vn.vertical),vn.horizontal===0&&vn.vertical===0?"FREE":vn.horizontal+":"+vn.vertical);ln.onClick=function(){return B.ratioButtonClicked(vn)},Q.push(ln)}),this.aspectRatioButton=new hr(Fr.getIcon(0,0),"Aspect ratio",Q),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,K.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var le=new Kn('<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");le.isActive=this.isGridVisible,le.onClick=function(){B.isGridVisible=!B.isGridVisible,le.isActive=B.isGridVisible},K.addButton(le);var Z=new Kn('<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(Z.isActive=this.zoomToCropEnabled,Z.onClick=function(){B.zoomToCropEnabled=!B.zoomToCropEnabled,Z.isActive=B.zoomToCropEnabled},K.addButton(Z),!$t.isLicensed){var Qe=new wn;this.topToolbar.addElementBlock(Qe);var qt=document.createElement("div");qt.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var An=document.createElement("a");An.style.color="currentColor",An.href="https://markerjs.com/products/cropro",An.target="_blank",An.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>',qt.appendChild(An),Qe.addElement(qt)}var Vn=new ur;Vn.minWidth=3*this.toolbarHeight+"px",Vn.contentAlign="end",this.topToolbar.addButtonBlock(Vn);var sn=new Kn('<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");sn.onClick=this.startRenderAndClose,Vn.addButton(sn),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(sn.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var tr=new Kn('<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");tr.onClick=this.close,Vn.addButton(tr),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(tr.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},ee.prototype.addBottomToolbar=function(){var B=this;this.bottomToolbar=new gn,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 K=new ur;K.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(K);var Q=new Kn('<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");Q.onClick=this.rotateLeftButtonClicked,K.addButton(Q);var le=new Kn('<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");le.onClick=this.rotateRightButtonClicked,K.addButton(le);var Z=new wn;Z.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(Z),this.straightener=new ti("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(Vn){B.rotateBy(Vn),B.straightener.angle=B.rotationAngle},Z.addElement(this.straightener.getUI());var Qe=new ur;Qe.minWidth=2*this.toolbarHeight+"px",Qe.contentAlign="end",this.bottomToolbar.addButtonBlock(Qe);var qt=new Kn('<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");qt.onClick=this.flipHorizontallyButtonClicked,Qe.addButton(qt);var An=new Kn('<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");An.onClick=this.flipVerticallyButtonClicked,Qe.addButton(An)},ee.prototype.ratioButtonClicked=function(B){this.aspectRatio=B,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},ee.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Fr.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},ee.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new xr(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},ee.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ee.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},ee.prototype.restoreState=function(B){if(B){var K=this.cropLayer.getRescaledRect(B.width,B.height,this.imageWidth,this.imageHeight,B.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(K),this.cropRectChanged(K),this.flippedHorizontally=B.flippedHorizontally,this.flippedVertically=B.flippedVertically,this.applyFlip(),this.rotationAngle=B.rotationAngle,this.applyRotation()}},ee.prototype.clientToLocalCoordinates=function(B,K){var Q=this.cropImage.getBoundingClientRect();return{x:B-Q.left,y:K-Q.top}},ee.prototype.onWindowResize=function(){this.positionUI()},ee.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var B=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=B+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},ee.prototype.rotateLeftButtonClicked=function(){var B=this.rotationAngle-90;this.rotationAngle%90!=0&&(B+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(B)},ee.prototype.rotateRightButtonClicked=function(){var B=this.rotationAngle+90;this.rotationAngle%90!=0&&(B-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(B)},ee.prototype.rotateTo=function(B){B=(B=B>180?B-360:B)<=-180?B+360:B,this.rotationAngle=B,this.applyRotation()},ee.prototype.rotateBy=function(B){this.rotateTo((this.rotationAngle+B)%360)},ee.prototype.applyRotation=function(){var B=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var K=this.editingTargetRotationContainer.transform.baseVal.getItem(0);K.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(K,0);var Q=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/Q.width,this.imageHeight/Q.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=B},ee.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},ee.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},ee.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},ee.prototype.startRenderAndClose=function(){return gt(this,void 0,void 0,function(){var B,K;return zt(this,function(Q){switch(Q.label){case 0:return[4,this.render()];case 1:return B=Q.sent(),K=this.getState(),this.renderEventListeners.forEach(function(le){return le(B,K)}),this.close(!0),[2]}})})},ee.prototype.render=function(){return gt(this,void 0,void 0,function(){var B;return zt(this,function(K){switch(K.label){case 0:return(B=new pi).naturalSize=this.renderAtNaturalSize,B.imageType=this.renderImageType,B.imageQuality=this.renderImageQuality,B.width=this.renderWidth,B.height=this.renderHeight,this.unzoomFromCrop(),De.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,B.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 K.sent(),[4,B.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,K.sent()]}})})},ee.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Zt("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 Zt("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Zt("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var B=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Zt("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*B)+`px;
|
|
height: `+(this.toolbarHeight-2*B)+`px;
|
|
padding: `+B+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Zt("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Zt("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new jt("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new jt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Zt("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 Zt("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Zt("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 Zt("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*B)+`px;
|
|
padding: `+B+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Zt("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},ee.instanceCounter=0,ee}(),ar=I("8hTe"),oi=I.n(ar),_i=/<pre[^>]*>/g;function Qr(ee){var B=document.createElement("div");return B.innerHTML=ee,B.childNodes.length===0?"":B.childNodes[0].nodeValue}var ni=re.a=function(ee){var B=ee.value,K=B===void 0?"":B,Q=ee.edit,le=Q===void 0?!1:Q,Z=ee.className,Qe=ee.showTextOnly,qt=ee.showLines,An=ee.replaces,Vn=ee.zoomImg,sn=ee.hasMask,tr=ee.style,vn=tr===void 0?{}:tr,ln=ee.stylesPrev,xn=ln===void 0?{}:ln,In=String(K),sr=Object(b.useRef)(),$n=Object(b.useRef)(),Zn=Object(b.useState)(""),kn=Object(D.a)(Zn,2),mr=kn[0],Fn=kn[1],nr=Object(b.useState)("office"),Gn=Object(D.a)(nr,2),Hn=Gn[0],Sr=Gn[1],wr=function(){var Je=new fn($n.current);Je.displayMode="popup",Je.addRenderEventListener(function(){var ct=Object(O.a)(T.a.mark(function ht(at){var Mt;return T.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:return sr.current.style.display="none",Vt.next=3,Object(fe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:at}});case 3:Mt=Vt.sent,Mt!=null&&Mt.id&&An($n.current.getAttribute("src").replace(W.a.API_SERVER,""),"/api/attachments/".concat(Mt==null?void 0:Mt.id,"?type=").concat(Mt.content_type));case 5:case"end":return Vt.stop()}},ht)}));return function(ht){return ct.apply(this,arguments)}}()),Je.show()},br=function(){var Je=new _e($n.current);Je.settings.displayMode="popup",Je.addEventListener("render",function(){var ct=Object(O.a)(T.a.mark(function ht(at){var Mt;return T.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:if(sr.current.style.display="none",!$n.current){Vt.next=6;break}return Vt.next=4,Object(fe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:at.dataUrl}});case 4:Mt=Vt.sent,Mt!=null&&Mt.id&&An($n.current.getAttribute("src").replace(W.a.API_SERVER,""),"/api/attachments/".concat(Mt==null?void 0:Mt.id,"?type=").concat(Mt.content_type));case 6:case"end":return Vt.stop()}},ht)}));return function(ht){return ct.apply(this,arguments)}}()),Je.show(),window.markerArea=Je},Er=Object(b.useMemo)(function(){sr.current&&(sr.current.style.zIndex=-1);try{var st=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Je=/\"\/api\/attachments\/|\"\/attachments\/download\//g,ct=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;In=In.replace(st,"("+W.a.API_SERVER+"/api/attachments/").replace(Je,'"'+W.a.API_SERVER+"/api/attachments/").replace(ct,'"'+W.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(Gt){}var ht=G(In),at=_();if(In.match(/\[TOC\]/)&&(ht=ht.replace("<p>[TOC]</p>",M()),C()),ht=ht.replace(/(__special_katext_id_\d+__)/g,function(Gt,Vt){var wt=at[Vt],Nt=wt.type,it=wt.expression;return Object($.renderToString)(Qr(it)||"",{displayMode:Nt==="block",throwOnError:!1,output:"html"})}),ht=ht.replace(/▁/g,"\u2581\u2581\u2581"),y(),Qe){var Mt=document.createElement("div");return Mt.innerHTML=ht,Mt.innerText}return setTimeout(function(){return Ge()},500),ht},[In]),te=Object(b.useRef)();A.WebkitLineClamp=qt,qt&&(vn=Object(R.a)(Object(R.a)({},vn),A));function Te(st){var Je=st.target;if(Je.tagName.toUpperCase()==="IMG"){if(Vn){var ct=Je.getAttribute("src");Fn(ct),Sr("image")}}else if(Je.tagName.toUpperCase()==="A"){var ht=Je.getAttribute("href");if(ht.indexOf("office")>-1)st.preventDefault(),Fn(ht),Sr("office");else if(ht.indexOf("application/pdf")>-1)st.preventDefault(),Fn(ht),Sr("pdf");else if(ht.indexOf("text/html")>-1)st.preventDefault(),Fn(ht),Sr("html");else if(ht.startsWith("#")){st.preventDefault();var at=document.getElementById(ht.replace("#",""));at&&at.scrollIntoView(!0)}}}var Ge=function(){var Je,ct=(Je=te.current)===null||Je===void 0?void 0:Je.querySelectorAll("video");ct==null||ct.forEach(function(ht){if(ht.oncontextmenu=function(){return!1},ht.src.indexOf(".m3u8")>-1&&!ht.canPlayType("application/vnd.apple.mpegurl")){if(V.a.isSupported()){var at=new V.a;at.loadSource(ht.src),at.attachMedia(ht)}}})};Object(b.useEffect)(function(){if(te.current&&Er&&(Er.match(_i)&&window.PR.prettyPrint()),te.current)return te.current.addEventListener("click",Te),function(){te.current.removeEventListener("click",Te),y(),C()}},[Er,te.current,Te]);var Me=function(Je){if(!le)return;Je.target.nodeName==="IMG"?(sr.current.style.zIndex=1,sr.current.style.display="flex",sr.current.style.width=Je.target.clientWidth+"px",sr.current.style.height=Je.target.clientHeight+"px",sr.current.style.top=Je.target.offsetTop+"px",sr.current.style.left=Je.target.offsetLeft+"px",$n.current.src=Je.target.getAttribute("src")):sr.current.style.display="none"};return i.a.createElement("div",{style:{position:"relative"}},i.a.createElement("div",{ref:te,style:Object(R.a)({},vn),className:"".concat(Z||""," markdown-body ").concat(oi.a.mdBody),onMouseOver:Me,dangerouslySetInnerHTML:{__html:Er}}),i.a.createElement("div",{ref:sr,className:oi.a.button},i.a.createElement(H.a,null,i.a.createElement(F.a,{onClick:function(){return wr()}},"\u88C1\u526A"),i.a.createElement(F.a,{onClick:function(){return br()}},"\u7F16\u8F91"))),i.a.createElement("img",{ref:$n,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),i.a.createElement(q.a,{close:!0,data:mr,type:mr!=null&&mr.length?Hn:"",style:Object(R.a)({},xn),onClose:function(){return Fn("")}}))}},"9VGf":function(Ye,re,I){"use strict";I.d(re,"a",function(){return P});var Y=I("q1tI"),H=I.n(Y);function P(F,R){var O=Object(Y.useRef)();Object(Y.useEffect)(function(){O.current=F}),Object(Y.useEffect)(function(){function D(){O.current()}if(R!==null){var m=setInterval(D,R);return function(){return clearInterval(m)}}},[R])}},AHFd:function(Ye,re,I){"use strict";I.d(re,"a",function(){return m});var Y=I("giR+"),H=I("fyUT"),P=I("OaEy"),F=I("2fM7"),R=I("tJVT"),O=I("q1tI"),D=I.n(O),m;(function(b){b[b.Number=1]="Number",b[b.Percent=2]="Percent"})(m||(m={}));var T=function(i){var d=i.value,c=i.onChange,r=i.disabled,a=i.hidePercentOption,s=a===void 0?!1:a,o=Object(O.useMemo)(function(){return s?m.Number:m.Percent},[s]),t=Object(O.useState)(o),h=Object(R.a)(t,2),g=h[0],C=h[1],A=Object(O.useCallback)(function(M){return g===m.Number?"".concat(M,"\u5206"):"".concat(M,"%")},[g]),w=Object(O.useCallback)(function(M){if(g===m.Number){var E=M.replace("\u5206","");return isNaN(parseInt(E,10))?0:E}else{var p=M.replace("%","");return p}},[g]);return Object(O.useEffect)(function(){C(d.type)},[d]),D.a.createElement("div",{style:{display:"inline-block"}},D.a.createElement(F.a,{onChange:function(E){C(E),c({type:E,inputValue:E===m.Number?5:20})},value:g||o,style:{width:100},options:s?[{label:"\u5206\u503C",value:m.Number}]:[{label:"\u767E\u5206\u6BD4",value:m.Percent},{label:"\u5206\u503C",value:m.Number}],disabled:r}),D.a.createElement(H.a,{disabled:r,value:d.inputValue,formatter:A,parser:w,max:g===m.Percent?100:Number.MAX_SAFE_INTEGER,min:0,precision:0,onChange:function(E){c({type:g,inputValue:E})}}))};re.b=T},Aocz:function(Ye,re,I){Ye.exports={flex_box_center:"flex_box_center___7n5J9",flex_space_between:"flex_space_between___1vC-V",flex_box_vertical_center:"flex_box_vertical_center___3gkLb",flex_box_center_end:"flex_box_center_end___26SUk",flex_box_column:"flex_box_column___2iv36",title:"title___ooa1w",menuTabs:"menuTabs___3mPq2",rightMenu:"rightMenu___2Vjbz",shixunDetail:"shixunDetail___2EXcB"}},BPZU:function(Ye,re){var I=32,Y=7,H=256;function P(i){for(var d=0;i>=I;)d|=i&1,i>>=1;return i+d}function F(i,d,c,r){var a=d+1;if(a===c)return 1;if(r(i[a++],i[d])<0){for(;a<c&&r(i[a],i[a-1])<0;)a++;R(i,d,a)}else for(;a<c&&r(i[a],i[a-1])>=0;)a++;return a-d}function R(i,d,c){for(c--;d<c;){var r=i[d];i[d++]=i[c],i[c--]=r}}function O(i,d,c,r,a){for(r===d&&r++;r<c;r++){for(var s=i[r],o=d,t=r,h;o<t;)h=o+t>>>1,a(s,i[h])<0?t=h:o=h+1;var g=r-o;switch(g){case 3:i[o+3]=i[o+2];case 2:i[o+2]=i[o+1];case 1:i[o+1]=i[o];break;default:for(;g>0;)i[o+g]=i[o+g-1],g--}i[o]=s}}function D(i,d,c,r,a,s){var o=0,t=0,h=1;if(s(i,d[c+a])>0){for(t=r-a;h<t&&s(i,d[c+a+h])>0;)o=h,h=(h<<1)+1,h<=0&&(h=t);h>t&&(h=t),o+=a,h+=a}else{for(t=a+1;h<t&&s(i,d[c+a-h])<=0;)o=h,h=(h<<1)+1,h<=0&&(h=t);h>t&&(h=t);var g=o;o=a-h,h=a-g}for(o++;o<h;){var C=o+(h-o>>>1);s(i,d[c+C])>0?o=C+1:h=C}return h}function m(i,d,c,r,a,s){var o=0,t=0,h=1;if(s(i,d[c+a])<0){for(t=a+1;h<t&&s(i,d[c+a-h])<0;)o=h,h=(h<<1)+1,h<=0&&(h=t);h>t&&(h=t);var g=o;o=a-h,h=a-g}else{for(t=r-a;h<t&&s(i,d[c+a+h])>=0;)o=h,h=(h<<1)+1,h<=0&&(h=t);h>t&&(h=t),o+=a,h+=a}for(o++;o<h;){var C=o+(h-o>>>1);s(i,d[c+C])<0?h=C:o=C+1}return h}function T(i,d){var c=Y,r=0,a=H,s=0,o,t,h=0;r=i.length,r<2*H&&(a=r>>>1);var g=[];s=r<120?5:r<1542?10:r<119151?19:40,o=[],t=[];function C(l,u){o[h]=l,t[h]=u,h+=1}function A(){for(;h>1;){var l=h-2;if(l>=1&&t[l-1]<=t[l]+t[l+1]||l>=2&&t[l-2]<=t[l]+t[l-1])t[l-1]<t[l+1]&&l--;else if(t[l]>t[l+1])break;M(l)}}function w(){for(;h>1;){var l=h-2;l>0&&t[l-1]<t[l+1]&&l--,M(l)}}function M(l){var u=o[l],f=t[l],_=o[l+1],y=t[l+1];t[l]=f+y,l===h-3&&(o[l+1]=o[l+2],t[l+1]=t[l+2]),h--;var v=m(i[_],i,u,f,0,d);if(u+=v,f-=v,f===0)return;if(y=D(i[u+f-1],i,_,y,y-1,d),y===0)return;f<=y?E(u,f,_,y):p(u,f,_,y)}function E(l,u,f,_){var y=0;for(y=0;y<u;y++)g[y]=i[l+y];var v=0,N=f,j=l;if(i[j++]=i[N++],--_===0){for(y=0;y<u;y++)i[j+y]=g[v+y];return}if(u===1){for(y=0;y<_;y++)i[j+y]=i[N+y];i[j+_]=g[v];return}for(var U=c,G,z,L;;){G=0,z=0,L=!1;do if(d(i[N],g[v])<0){if(i[j++]=i[N++],z++,G=0,--_===0){L=!0;break}}else if(i[j++]=g[v++],G++,z=0,--u===1){L=!0;break}while((G|z)<U);if(L)break;do{if(G=m(i[N],g,v,u,0,d),G!==0){for(y=0;y<G;y++)i[j+y]=g[v+y];if(j+=G,v+=G,u-=G,u<=1){L=!0;break}}if(i[j++]=i[N++],--_===0){L=!0;break}if(z=D(g[v],i,N,_,0,d),z!==0){for(y=0;y<z;y++)i[j+y]=i[N+y];if(j+=z,N+=z,_-=z,_===0){L=!0;break}}if(i[j++]=g[v++],--u===1){L=!0;break}U--}while(G>=Y||z>=Y);if(L)break;U<0&&(U=0),U+=2}if(c=U,c<1&&(c=1),u===1){for(y=0;y<_;y++)i[j+y]=i[N+y];i[j+_]=g[v]}else{if(u===0)throw new Error;for(y=0;y<u;y++)i[j+y]=g[v+y]}}function p(l,u,f,_){var y=0;for(y=0;y<_;y++)g[y]=i[f+y];var v=l+u-1,N=_-1,j=f+_-1,U=0,G=0;if(i[j--]=i[v--],--u===0){for(U=j-(_-1),y=0;y<_;y++)i[U+y]=g[y];return}if(_===1){for(j-=u,v-=u,G=j+1,U=v+1,y=u-1;y>=0;y--)i[G+y]=i[U+y];i[j]=g[N];return}for(var z=c;;){var L=0,V=0,W=!1;do if(d(g[N],i[v])<0){if(i[j--]=i[v--],L++,V=0,--u===0){W=!0;break}}else if(i[j--]=g[N--],V++,L=0,--_===1){W=!0;break}while((L|V)<z);if(W)break;do{if(L=u-m(g[N],i,l,u,u-1,d),L!==0){for(j-=L,v-=L,u-=L,G=j+1,U=v+1,y=L-1;y>=0;y--)i[G+y]=i[U+y];if(u===0){W=!0;break}}if(i[j--]=g[N--],--_===1){W=!0;break}if(V=_-D(i[v],g,0,_,_-1,d),V!==0){for(j-=V,N-=V,_-=V,G=j+1,U=N+1,y=0;y<V;y++)i[G+y]=g[U+y];if(_<=1){W=!0;break}}if(i[j--]=i[v--],--u===0){W=!0;break}z--}while(L>=Y||V>=Y);if(W)break;z<0&&(z=0),z+=2}if(c=z,c<1&&(c=1),_===1){for(j-=u,v-=u,G=j+1,U=v+1,y=u-1;y>=0;y--)i[G+y]=i[U+y];i[j]=g[N]}else{if(_===0)throw new Error;for(U=j-(_-1),y=0;y<_;y++)i[U+y]=g[y]}}this.mergeRuns=A,this.forceMergeRuns=w,this.pushRun=C}function b(i,d,c,r){c||(c=0),r||(r=i.length);var a=r-c;if(a<2)return;var s=0;if(a<I){s=F(i,c,r,d),O(i,c,r,c+s,d);return}var o=new T(i,d),t=P(a);do{if(s=F(i,c,r,d),s<t){var h=a;h>t&&(h=t),O(i,c,c+h,c+s,d),s=h}o.pushRun(c,s),o.mergeRuns(),a-=s,c+=s}while(a!==0);o.forceMergeRuns()}Ye.exports=b},BU3w:function(Ye,re,I){"use strict";I.d(re,"a",function(){return O});var Y=I("MNnm"),H="rc-util-key";function P(D){if(D.attachTo)return D.attachTo;var m=document.querySelector("head");return m||document.body}function F(D){var m,T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(Y.a)())return null;var b=document.createElement("style");if((m=T.csp)===null||m===void 0?void 0:m.nonce){var i;b.nonce=(i=T.csp)===null||i===void 0?void 0:i.nonce}b.innerHTML=D;var d=P(T),c=d.firstChild;return T.prepend&&d.prepend?d.prepend(b):T.prepend&&c?d.insertBefore(b,c):d.appendChild(b),b}var R=new Map;function O(D,m){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},b=P(T);if(!R.has(b)){var i=F("",T),d=i.parentNode;R.set(b,d),d.removeChild(i)}var c=Array.from(R.get(b).children).find(function(t){return t.tagName==="STYLE"&&t[H]===m});if(c){var r,a;if(((r=T.csp)===null||r===void 0?void 0:r.nonce)&&c.nonce!==((a=T.csp)===null||a===void 0?void 0:a.nonce)){var s;c.nonce=(s=T.csp)===null||s===void 0?void 0:s.nonce}return c.innerHTML!==D&&(c.innerHTML=D),c}var o=F(D,T);return o[H]=m,o}},Bd2K:function(Ye,re,I){(function(Y){Y(I("VrN/"),I("osHv"))})(function(Y){Y.defineOption("autoCloseTags",!1,function(T,b,i){if(i!=Y.Init&&i&&T.removeKeyMap("autoCloseTags"),!b)return;var d={name:"autoCloseTags"};(typeof b!="object"||b.whenClosing!==!1)&&(d["'/'"]=function(c){return O(c)}),(typeof b!="object"||b.whenOpening!==!1)&&(d["'>'"]=function(c){return F(c)}),T.addKeyMap(d)});var H=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],P=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function F(T){if(T.getOption("disableInput"))return Y.Pass;for(var b=T.listSelections(),i=[],d=T.getOption("autoCloseTags"),c=0;c<b.length;c++){if(!b[c].empty())return Y.Pass;var r=b[c].head,a=T.getTokenAt(r),s=Y.innerMode(T.getMode(),a.state),o=s.state,t=s.mode.xmlCurrentTag&&s.mode.xmlCurrentTag(o),h=t&&t.name;if(!h)return Y.Pass;var g=s.mode.configuration=="html",C=typeof d=="object"&&d.dontCloseTags||g&&H,A=typeof d=="object"&&d.indentTags||g&&P;a.end>r.ch&&(h=h.slice(0,h.length-a.end+r.ch));var w=h.toLowerCase();if(!h||a.type=="string"&&(a.end!=r.ch||!/[\"\']/.test(a.string.charAt(a.string.length-1))||a.string.length==1)||a.type=="tag"&&t.close||a.string.indexOf("/")==r.ch-a.start-1||C&&D(C,w)>-1||m(T,s.mode.xmlCurrentContext&&s.mode.xmlCurrentContext(o)||[],h,r,!0))return Y.Pass;var M=typeof d=="object"&&d.emptyTags;if(M&&D(M,h)>-1){i[c]={text:"/>",newPos:Y.Pos(r.line,r.ch+2)};continue}var E=A&&D(A,w)>-1;i[c]={indent:E,text:">"+(E?`
|
|
|
|
`:"")+"</"+h+">",newPos:E?Y.Pos(r.line+1,0):Y.Pos(r.line,r.ch+1)}}for(var p=typeof d=="object"&&d.dontIndentOnAutoClose,c=b.length-1;c>=0;c--){var l=i[c];T.replaceRange(l.text,b[c].head,b[c].anchor,"+insert");var u=T.listSelections().slice(0);u[c]={head:l.newPos,anchor:l.newPos},T.setSelections(u),!p&&l.indent&&(T.indentLine(l.newPos.line,null,!0),T.indentLine(l.newPos.line+1,null,!0))}}function R(T,b){for(var i=T.listSelections(),d=[],c=b?"/":"</",r=T.getOption("autoCloseTags"),a=typeof r=="object"&&r.dontIndentOnSlash,s=0;s<i.length;s++){if(!i[s].empty())return Y.Pass;var o=i[s].head,t=T.getTokenAt(o),h=Y.innerMode(T.getMode(),t.state),g=h.state;if(b&&(t.type=="string"||t.string.charAt(0)!="<"||t.start!=o.ch-1))return Y.Pass;var C,A=h.mode.name!="xml"&&T.getMode().name=="htmlmixed";if(A&&h.mode.name=="javascript")C=c+"script";else if(A&&h.mode.name=="css")C=c+"style";else{var w=h.mode.xmlCurrentContext&&h.mode.xmlCurrentContext(g);if(!w||w.length&&m(T,w,w[w.length-1],o))return Y.Pass;C=c+w[w.length-1]}T.getLine(o.line).charAt(t.end)!=">"&&(C+=">"),d[s]=C}if(T.replaceSelections(d),i=T.listSelections(),!a)for(var s=0;s<i.length;s++)(s==i.length-1||i[s].head.line<i[s+1].head.line)&&T.indentLine(i[s].head.line)}function O(T){return T.getOption("disableInput")?Y.Pass:R(T,!0)}Y.commands.closeTag=function(T){return R(T)};function D(T,b){if(T.indexOf)return T.indexOf(b);for(var i=0,d=T.length;i<d;++i)if(T[i]==b)return i;return-1}function m(T,b,i,d,c){if(!Y.scanForClosingTag)return!1;var r=Math.min(T.lastLine()+1,d.line+500),a=Y.scanForClosingTag(T,d,null,r);if(!a||a.tag!=i)return!1;for(var s=c?1:0,o=b.length-1;o>=0&&b[o]==i;o--)++s;d=a.to;for(var o=1;o<s;o++){var t=Y.scanForClosingTag(T,d,null,r);if(!t||t.tag!=i)return!1;d=t.to}return!0}})},BdwD:function(Ye,re,I){"use strict";var Y=I("+L6B"),H=I("2/Rp"),P=I("0Owb"),F=I("k1fw"),R=I("q1tI"),O=I.n(R),D=I("FOrL"),m=I.n(D),T=function(i){var d=i.buttonProps,c=d===void 0?{}:d,r=i.styles,a=r===void 0?{}:r,s=i.customText,o=i.ButtonText,t=i.ButtonClick,h=i.Buttonclass,g=i.ButtonTwo;return O.a.createElement("section",{className:"tc animated fadeIn",style:Object(F.a)(Object(F.a)({},{color:"#999",margin:"200px auto"}),a)},O.a.createElement("img",{src:m.a}),O.a.createElement("p",{className:"mt20 font14"},s||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),o&&O.a.createElement(H.a,Object(P.a)({className:h,onClick:t},c),o),g&&g)};re.a=T},BjJ7:function(Ye,re,I){"use strict";I.d(re,"d",function(){return H}),I.d(re,"c",function(){return P}),I.d(re,"e",function(){return F}),I.d(re,"b",function(){return R}),I.d(re,"a",function(){return D});var Y=I("m3rI");function H(m){var T=!0;if(m.length>0){for(var b=0;b<m.length;b++)if(m[b].compile_success==0||!m[b].compile_success){T=!1;break}}else T=!1;return T}function P(m){for(var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",b=[],i=0;i<m.length;i++){var d=m[i],c=T?"".concat(T,"/").concat(d.name):"".concat(d.name);b.push({title:d.name,isLeaf:!(d.type==="tree"),key:c})}return b}function F(m,T,b){for(var i=0;i<m.length;i++){var d=m[i];if(d.key===T){d.children=b;break}d.children&&F(d.children,T,b)}return m}function R(m,T,b){var i;return function(){var d=this,c=arguments,r=function(){i=null,b||m.apply(d,c)},a=b&&!i;clearTimeout(i),i=setTimeout(r,T),a&&m.apply(d,c)}}var O=!0,D=Y.a.API_SERVER},BlVb:function(Ye,re,I){var Y=I("hyiK"),H=1e-8;function P(R,O){return Math.abs(R-O)<H}function F(R,O,D){var m=0,T=R[0];if(!T)return!1;for(var b=1;b<R.length;b++){var i=R[b];m+=Y(T[0],T[1],i[0],i[1],O,D),T=i}var d=R[0];return(!P(T[0],d[0])||!P(T[1],d[1]))&&(m+=Y(T[0],T[1],d[0],d[1],O,D)),m!==0}re.contain=F},BoW6:function(Ye,re,I){Ye.exports={wrap:"wrap___1GPjg",maxWidth70:"maxWidth70___1Dk6g",maxWidth80:"maxWidth80___3b9PP",maxWidth100:"maxWidth100___3VHJ2",maxWidth110:"maxWidth110___35RUD",maxWidth120:"maxWidth120___1rOLr",reviewStatusTooltip:"reviewStatusTooltip___3i2cP",color32C:"color32C___2YC8o",MdEditor:"MdEditor___241c9",tr1:"tr1___3HOPl"}},Bq2U:function(Ye,re,I){var Y=I("RDYZ"),H=I("Qe9p"),P=I("bYtY"),F=P.isArrayLike,R=Array.prototype.slice;function O(C,A){return C[A]}function D(C,A,w){C[A]=w}function m(C,A,w){return(A-C)*w+C}function T(C,A,w){return w>.5?A:C}function b(C,A,w,M,E){var p=C.length;if(E===1)for(var l=0;l<p;l++)M[l]=m(C[l],A[l],w);else for(var u=p&&C[0].length,l=0;l<p;l++)for(var f=0;f<u;f++)M[l][f]=m(C[l][f],A[l][f],w)}function i(C,A,w){var M=C.length,E=A.length;if(M!==E){var p=M>E;if(p)C.length=E;else for(var l=M;l<E;l++)C.push(w===1?A[l]:R.call(A[l]))}for(var u=C[0]&&C[0].length,l=0;l<C.length;l++)if(w===1)isNaN(C[l])&&(C[l]=A[l]);else for(var f=0;f<u;f++)isNaN(C[l][f])&&(C[l][f]=A[l][f])}function d(C,A,w){if(C===A)return!0;var M=C.length;if(M!==A.length)return!1;if(w===1){for(var E=0;E<M;E++)if(C[E]!==A[E])return!1}else for(var p=C[0].length,E=0;E<M;E++)for(var l=0;l<p;l++)if(C[E][l]!==A[E][l])return!1;return!0}function c(C,A,w,M,E,p,l,u,f){var _=C.length;if(f===1)for(var y=0;y<_;y++)u[y]=r(C[y],A[y],w[y],M[y],E,p,l);else for(var v=C[0].length,y=0;y<_;y++)for(var N=0;N<v;N++)u[y][N]=r(C[y][N],A[y][N],w[y][N],M[y][N],E,p,l)}function r(C,A,w,M,E,p,l){var u=(w-C)*.5,f=(M-A)*.5;return(2*(A-w)+u+f)*l+(-3*(A-w)-2*u-f)*p+u*E+A}function a(C){if(F(C)){var A=C.length;if(F(C[0])){for(var w=[],M=0;M<A;M++)w.push(R.call(C[M]));return w}return R.call(C)}return C}function s(C){return C[0]=Math.floor(C[0]),C[1]=Math.floor(C[1]),C[2]=Math.floor(C[2]),"rgba("+C.join(",")+")"}function o(C){var A=C[C.length-1].value;return F(A&&A[0])?2:1}function t(C,A,w,M,E,p){var l=C._getter,u=C._setter,f=A==="spline",_=M.length;if(!_)return;var y=M[0].value,v=F(y),N=!1,j=!1,U=v?o(M):0,G;M.sort(function(ke,lt){return ke.time-lt.time}),G=M[_-1].time;for(var z=[],L=[],V=M[0].value,W=!0,$=0;$<_;$++){z.push(M[$].time/G);var q=M[$].value;if(v&&d(q,V,U)||!v&&q===V||(W=!1),V=q,typeof q=="string"){var fe=H.parse(q);fe?(q=fe,N=!0):j=!0}L.push(q)}if(!p&&W)return;for(var se=L[_-1],$=0;$<_-1;$++)v?i(L[$],se,U):isNaN(L[$])&&!isNaN(se)&&!j&&!N&&(L[$]=se);v&&i(l(C._target,E),se,U);var me=0,ve=0,Ae,ge,ue,$e,Tt,ye;if(N)var Re=[0,0,0,0];var nt=function(ke,lt){var Fe;if(lt<0)Fe=0;else if(lt<ve){for(Ae=Math.min(me+1,_-1),Fe=Ae;Fe>=0&&!(z[Fe]<=lt);Fe--);Fe=Math.min(Fe,_-2)}else{for(Fe=me;Fe<_&&!(z[Fe]>lt);Fe++);Fe=Math.min(Fe-1,_-2)}me=Fe,ve=lt;var Ze=z[Fe+1]-z[Fe];if(Ze===0)return;if(ge=(lt-z[Fe])/Ze,f)if($e=L[Fe],ue=L[Fe===0?Fe:Fe-1],Tt=L[Fe>_-2?_-1:Fe+1],ye=L[Fe>_-3?_-1:Fe+2],v)c(ue,$e,Tt,ye,ge,ge*ge,ge*ge*ge,l(ke,E),U);else{var Xe;if(N)Xe=c(ue,$e,Tt,ye,ge,ge*ge,ge*ge*ge,Re,1),Xe=s(Re);else{if(j)return T($e,Tt,ge);Xe=r(ue,$e,Tt,ye,ge,ge*ge,ge*ge*ge)}u(ke,E,Xe)}else if(v)b(L[Fe],L[Fe+1],ge,l(ke,E),U);else{var Xe;if(N)b(L[Fe],L[Fe+1],ge,Re,1),Xe=s(Re);else{if(j)return T(L[Fe],L[Fe+1],ge);Xe=m(L[Fe],L[Fe+1],ge)}u(ke,E,Xe)}},Ue=new Y({target:C._target,life:G,loop:C._loop,delay:C._delay,onframe:nt,ondestroy:w});return A&&A!=="spline"&&(Ue.easing=A),Ue}var h=function(C,A,w,M){this._tracks={},this._target=C,this._loop=A||!1,this._getter=w||O,this._setter=M||D,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};h.prototype={when:function(C,A){var w=this._tracks;for(var M in A){if(!A.hasOwnProperty(M))continue;if(!w[M]){w[M]=[];var E=this._getter(this._target,M);if(E==null)continue;C!==0&&w[M].push({time:0,value:a(E)})}w[M].push({time:C,value:A[M]})}return this},during:function(C){return this._onframeList.push(C),this},pause:function(){for(var C=0;C<this._clipList.length;C++)this._clipList[C].pause();this._paused=!0},resume:function(){for(var C=0;C<this._clipList.length;C++)this._clipList[C].resume();this._paused=!1},isPaused:function(){return!!this._paused},_doneCallback:function(){this._tracks={},this._clipList.length=0;for(var C=this._doneList,A=C.length,w=0;w<A;w++)C[w].call(this)},start:function(C,A){var w=this,M=0,E=function(){M--,M||w._doneCallback()},p;for(var l in this._tracks){if(!this._tracks.hasOwnProperty(l))continue;var u=t(this,C,E,this._tracks[l],l,A);u&&(this._clipList.push(u),M++,this.animation&&this.animation.addClip(u),p=u)}if(p){var f=p.onframe;p.onframe=function(_,y){f(_,y);for(var v=0;v<w._onframeList.length;v++)w._onframeList[v](_,y)}}return M||this._doneCallback(),this},stop:function(C){for(var A=this._clipList,w=this.animation,M=0;M<A.length;M++){var E=A[M];C&&E.onframe(this._target,1),w&&w.removeClip(E)}A.length=0},delay:function(C){return this._delay=C,this},done:function(C){return C&&this._doneList.push(C),this},getClips:function(){return this._clipList}};var g=h;Ye.exports=g},"C+DQ":function(Ye,re,I){},C0SR:function(Ye,re,I){var Y=I("YH21"),H=function(){this._track=[]};H.prototype={constructor:H,recognize:function(D,m,T){return this._doTrack(D,m,T),this._recognize(D)},clear:function(){return this._track.length=0,this},_doTrack:function(D,m,T){var b=D.touches;if(!b)return;for(var i={points:[],touches:[],target:m,event:D},d=0,c=b.length;d<c;d++){var r=b[d],a=Y.clientToLocal(T,r,{});i.points.push([a.zrX,a.zrY]),i.touches.push(r)}this._track.push(i)},_recognize:function(D){for(var m in R)if(R.hasOwnProperty(m)){var T=R[m](this._track,D);if(T)return T}}};function P(D){var m=D[1][0]-D[0][0],T=D[1][1]-D[0][1];return Math.sqrt(m*m+T*T)}function F(D){return[(D[0][0]+D[1][0])/2,(D[0][1]+D[1][1])/2]}var R={pinch:function(D,m){var T=D.length;if(!T)return;var b=(D[T-1]||{}).points,i=(D[T-2]||{}).points||b;if(i&&i.length>1&&b&&b.length>1){var d=P(b)/P(i);!isFinite(d)&&(d=1),m.pinchScale=d;var c=F(b);return m.pinchX=c[0],m.pinchY=c[1],{type:"pinch",target:D[0].target,event:m}}}},O=H;Ye.exports=O},DBLp:function(Ye,re){function I(){}I.prototype={diff:function(R,O,D){D||(D=function(h,g){return h===g}),this.equals=D;var m=this;R=R.slice(),O=O.slice();var T=O.length,b=R.length,i=1,d=T+b,c=[{newPos:-1,components:[]}],r=this.extractCommon(c[0],O,R,0);if(c[0].newPos+1>=T&&r+1>=b){for(var a=[],s=0;s<O.length;s++)a.push(s);return[{indices:a,count:O.length}]}function o(){for(var h=-1*i;h<=i;h+=2){var g,C=c[h-1],A=c[h+1],w=(A?A.newPos:0)-h;C&&(c[h-1]=void 0);var M=C&&C.newPos+1<T,E=A&&0<=w&&w<b;if(!M&&!E){c[h]=void 0;continue}if(!M||E&&C.newPos<A.newPos?(g=H(A),m.pushComponent(g.components,void 0,!0)):(g=C,g.newPos++,m.pushComponent(g.components,!0,void 0)),w=m.extractCommon(g,O,R,h),g.newPos+1>=T&&w+1>=b)return Y(m,g.components,O,R);c[h]=g}i++}for(;i<=d;){var t=o();if(t)return t}},pushComponent:function(R,O,D){var m=R[R.length-1];m&&m.added===O&&m.removed===D?R[R.length-1]={count:m.count+1,added:O,removed:D}:R.push({count:1,added:O,removed:D})},extractCommon:function(R,O,D,m){for(var T=O.length,b=D.length,i=R.newPos,d=i-m,c=0;i+1<T&&d+1<b&&this.equals(O[i+1],D[d+1]);)i++,d++,c++;return c&&R.components.push({count:c}),R.newPos=i,d},tokenize:function(R){return R.slice()},join:function(R){return R.slice()}};function Y(R,O,D,m){for(var T=0,b=O.length,i=0,d=0;T<b;T++){var c=O[T];if(c.removed){for(var r=[],a=d;a<d+c.count;a++)r.push(a);c.indices=r,d+=c.count}else{for(var r=[],a=i;a<i+c.count;a++)r.push(a);c.indices=r,i+=c.count,c.added||(d+=c.count)}}return O}function H(R){return{newPos:R.newPos,components:R.components.slice(0)}}var P=new I;function F(R,O,D){return P.diff(R,O,D)}Ye.exports=F},DN4a:function(Ye,re,I){var Y=I("Fofx"),H=I("QBsz"),P=Y.identity,F=5e-5;function R(d){return d>F||d<-F}var O=function(d){d=d||{},d.position||(this.position=[0,0]),d.rotation==null&&(this.rotation=0),d.scale||(this.scale=[1,1]),this.origin=this.origin||null},D=O.prototype;D.transform=null,D.needLocalTransform=function(){return R(this.rotation)||R(this.position[0])||R(this.position[1])||R(this.scale[0]-1)||R(this.scale[1]-1)};var m=[];D.updateTransform=function(){var d=this.parent,c=d&&d.transform,r=this.needLocalTransform(),a=this.transform;if(!(r||c)){a&&P(a);return}a=a||Y.create(),r?this.getLocalTransform(a):P(a),c&&(r?Y.mul(a,d.transform,a):Y.copy(a,d.transform)),this.transform=a;var s=this.globalScaleRatio;if(s!=null&&s!==1){this.getGlobalScale(m);var o=m[0]<0?-1:1,t=m[1]<0?-1:1,h=((m[0]-o)*s+o)/m[0]||0,g=((m[1]-t)*s+t)/m[1]||0;a[0]*=h,a[1]*=h,a[2]*=g,a[3]*=g}this.invTransform=this.invTransform||Y.create(),Y.invert(this.invTransform,a)},D.getLocalTransform=function(d){return O.getLocalTransform(this,d)},D.setTransform=function(d){var c=this.transform,r=d.dpr||1;c?d.setTransform(r*c[0],r*c[1],r*c[2],r*c[3],r*c[4],r*c[5]):d.setTransform(r,0,0,r,0,0)},D.restoreTransform=function(d){var c=d.dpr||1;d.setTransform(c,0,0,c,0,0)};var T=[],b=Y.create();D.setLocalTransform=function(d){if(!d)return;var c=d[0]*d[0]+d[1]*d[1],r=d[2]*d[2]+d[3]*d[3],a=this.position,s=this.scale;R(c-1)&&(c=Math.sqrt(c)),R(r-1)&&(r=Math.sqrt(r)),d[0]<0&&(c=-c),d[3]<0&&(r=-r),a[0]=d[4],a[1]=d[5],s[0]=c,s[1]=r,this.rotation=Math.atan2(-d[1]/r,d[0]/c)},D.decomposeTransform=function(){if(!this.transform)return;var d=this.parent,c=this.transform;d&&d.transform&&(Y.mul(T,d.invTransform,c),c=T);var r=this.origin;r&&(r[0]||r[1])&&(b[4]=r[0],b[5]=r[1],Y.mul(T,c,b),T[4]-=r[0],T[5]-=r[1],c=T),this.setLocalTransform(c)},D.getGlobalScale=function(d){var c=this.transform;return d=d||[],c?(d[0]=Math.sqrt(c[0]*c[0]+c[1]*c[1]),d[1]=Math.sqrt(c[2]*c[2]+c[3]*c[3]),c[0]<0&&(d[0]=-d[0]),c[3]<0&&(d[1]=-d[1]),d):(d[0]=1,d[1]=1,d)},D.transformCoordToLocal=function(d,c){var r=[d,c],a=this.invTransform;return a&&H.applyTransform(r,r,a),r},D.transformCoordToGlobal=function(d,c){var r=[d,c],a=this.transform;return a&&H.applyTransform(r,r,a),r},O.getLocalTransform=function(d,c){c=c||[],P(c);var r=d.origin,a=d.scale||[1,1],s=d.rotation||0,o=d.position||[0,0];return r&&(c[4]-=r[0],c[5]-=r[1]),Y.scale(c,c,a),s&&Y.rotate(c,c,s),r&&(c[4]+=r[0],c[5]+=r[1]),c[4]+=o[0],c[5]+=o[1],c};var i=O;Ye.exports=i},Dagg:function(Ye,re,I){var Y=I("Gev7"),H=I("mFDi"),P=I("bYtY"),F=I("Xnb7");function R(D){Y.call(this,D)}R.prototype={constructor:R,type:"image",brush:function(D,m){var T=this.style,b=T.image;T.bind(D,this,m);var i=this._image=F.createOrUpdateImage(b,this._image,this,this.onload);if(!i||!F.isImageReady(i))return;var d=T.x||0,c=T.y||0,r=T.width,a=T.height,s=i.width/i.height;if(r==null&&a!=null?r=a*s:a==null&&r!=null?a=r/s:r==null&&a==null&&(r=i.width,a=i.height),this.setTransform(D),T.sWidth&&T.sHeight){var o=T.sx||0,t=T.sy||0;D.drawImage(i,o,t,T.sWidth,T.sHeight,d,c,r,a)}else if(T.sx&&T.sy){var o=T.sx,t=T.sy,h=r-o,g=a-t;D.drawImage(i,o,t,h,g,d,c,r,a)}else D.drawImage(i,d,c,r,a);T.text!=null&&(this.restoreTransform(D),this.drawRectText(D,this.getBoundingRect()))},getBoundingRect:function(){var D=this.style;return this._rect||(this._rect=new H(D.x||0,D.y||0,D.width||0,D.height||0)),this._rect}},P.inherits(R,Y);var O=R;Ye.exports=O},DlQD:function(Ye,re,I){(function(Y,H){Ye.exports=H()})(this,function(){"use strict";function Y(Pe,xe){for(var we=0;we<xe.length;we++){var ie=xe[we];ie.enumerable=ie.enumerable||!1,ie.configurable=!0,"value"in ie&&(ie.writable=!0),Object.defineProperty(Pe,ie.key,ie)}}function H(Pe,xe,we){return xe&&Y(Pe.prototype,xe),we&&Y(Pe,we),Pe}function P(Pe,xe){if(!Pe)return;if(typeof Pe=="string")return F(Pe,xe);var we=Object.prototype.toString.call(Pe).slice(8,-1);if(we==="Object"&&Pe.constructor&&(we=Pe.constructor.name),we==="Map"||we==="Set")return Array.from(Pe);if(we==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(we))return F(Pe,xe)}function F(Pe,xe){(xe==null||xe>Pe.length)&&(xe=Pe.length);for(var we=0,ie=new Array(xe);we<xe;we++)ie[we]=Pe[we];return ie}function R(Pe,xe){var we;if(typeof Symbol=="undefined"||Pe[Symbol.iterator]==null){if(Array.isArray(Pe)||(we=P(Pe))||xe&&Pe&&typeof Pe.length=="number"){we&&(Pe=we);var ie=0;return function(){return ie>=Pe.length?{done:!0}:{done:!1,value:Pe[ie++]}}}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 we=Pe[Symbol.iterator](),we.next.bind(we)}function O(Pe,xe){return xe={exports:{}},Pe(xe,xe.exports),xe.exports}var D=O(function(Pe){function xe(){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 we(ie){Pe.exports.defaults=ie}Pe.exports={defaults:xe(),getDefaults:xe,changeDefaults:we}}),m=D.defaults,T=D.getDefaults,b=D.changeDefaults,i=/[&<>"']/,d=/[&<>"']/g,c=/[<>"']|&(?!#?\w+;)/,r=/[<>"']|&(?!#?\w+;)/g,a={"&":"&","<":"<",">":">",'"':""","'":"'"},s=function(xe){return a[xe]};function o(Pe,xe){if(xe){if(i.test(Pe))return Pe.replace(d,s)}else if(c.test(Pe))return Pe.replace(r,s);return Pe}var t=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function h(Pe){return Pe.replace(t,function(xe,we){return we=we.toLowerCase(),we==="colon"?":":we.charAt(0)==="#"?we.charAt(1)==="x"?String.fromCharCode(parseInt(we.substring(2),16)):String.fromCharCode(+we.substring(1)):""})}var g=/(^|[^\[])\^/g;function C(Pe,xe){Pe=Pe.source||Pe,xe=xe||"";var we={replace:function(ae,ce){return ce=ce.source||ce,ce=ce.replace(g,"$1"),Pe=Pe.replace(ae,ce),we},getRegex:function(){return new RegExp(Pe,xe)}};return we}var A=/[^\w:]/g,w=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function M(Pe,xe,we){if(Pe){var ie;try{ie=decodeURIComponent(h(we)).replace(A,"").toLowerCase()}catch(ae){return null}if(ie.indexOf("javascript:")===0||ie.indexOf("vbscript:")===0||ie.indexOf("data:")===0)return null}xe&&!w.test(we)&&(we=f(xe,we));try{we=encodeURI(we).replace(/%25/g,"%")}catch(ae){return null}return we}var E={},p=/^[^:]+:\/*[^/]*$/,l=/^([^:]+:)[\s\S]*$/,u=/^([^:]+:\/*[^/]*)[\s\S]*$/;function f(Pe,xe){E[" "+Pe]||(p.test(Pe)?E[" "+Pe]=Pe+"/":E[" "+Pe]=N(Pe,"/",!0)),Pe=E[" "+Pe];var we=Pe.indexOf(":")===-1;return xe.substring(0,2)==="//"?we?xe:Pe.replace(l,"$1")+xe:xe.charAt(0)==="/"?we?xe:Pe.replace(u,"$1")+xe:Pe+xe}var _={exec:function(){}};function y(Pe){for(var xe=1,we,ie;xe<arguments.length;xe++){we=arguments[xe];for(ie in we)Object.prototype.hasOwnProperty.call(we,ie)&&(Pe[ie]=we[ie])}return Pe}function v(Pe,xe){var we=Pe.replace(/\|/g,function(ce,be,Ce){for(var Be=!1,yt=be;--yt>=0&&Ce[yt]==="\\";)Be=!Be;return Be?"|":" |"}),ie=we.split(/ \|/),ae=0;if(ie.length>xe)ie.splice(xe);else for(;ie.length<xe;)ie.push("");for(;ae<ie.length;ae++)ie[ae]=ie[ae].trim().replace(/\\\|/g,"|");return ie}function N(Pe,xe,we){var ie=Pe.length;if(ie===0)return"";for(var ae=0;ae<ie;){var ce=Pe.charAt(ie-ae-1);if(ce===xe&&!we)ae++;else if(ce!==xe&&we)ae++;else break}return Pe.substr(0,ie-ae)}function j(Pe,xe){if(Pe.indexOf(xe[1])===-1)return-1;for(var we=Pe.length,ie=0,ae=0;ae<we;ae++)if(Pe[ae]==="\\")ae++;else if(Pe[ae]===xe[0])ie++;else if(Pe[ae]===xe[1]&&(ie--,ie<0))return ae;return-1}function U(Pe){Pe&&Pe.sanitize&&!Pe.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:o,unescape:h,edit:C,cleanUrl:M,resolveUrl:f,noopTest:_,merge:y,splitCells:v,rtrim:N,findClosingBracket:j,checkSanitizeDeprecation:U},z=D.defaults,L=G.rtrim,V=G.splitCells,W=G.escape,$=G.findClosingBracket;function q(Pe,xe,we){var ie=xe.href,ae=xe.title?W(xe.title):null,ce=Pe[1].replace(/\\([\[\]])/g,"$1");return Pe[0].charAt(0)!=="!"?{type:"link",raw:we,href:ie,title:ae,text:ce}:{type:"image",raw:we,href:ie,title:ae,text:W(ce)}}function fe(Pe,xe){var we=Pe.match(/^(\s+)(?:```)/);if(we===null)return xe;var ie=we[1];return xe.split(`
|
|
`).map(function(ae){var ce=ae.match(/^\s+/);if(ce===null)return ae;var be=ce[0];return be.length>=ie.length?ae.slice(ie.length):ae}).join(`
|
|
`)}var se=function(){function Pe(we){this.options=we||z}var xe=Pe.prototype;return xe.space=function(ie){var ae=this.rules.block.newline.exec(ie);if(ae)return ae[0].length>1?{type:"space",raw:ae[0]}:{raw:`
|
|
`}},xe.code=function(ie,ae){var ce=this.rules.block.code.exec(ie);if(ce){var be=ae[ae.length-1];if(be&&be.type==="paragraph")return{raw:ce[0],text:ce[0].trimRight()};var Ce=ce[0].replace(/^ {4}/gm,"");return{type:"code",raw:ce[0],codeBlockStyle:"indented",text:this.options.pedantic?Ce:L(Ce,`
|
|
`)}}},xe.fences=function(ie){var ae=this.rules.block.fences.exec(ie);if(ae){var ce=ae[0],be=fe(ce,ae[3]||"");return{type:"code",raw:ce,lang:ae[2]?ae[2].trim():ae[2],text:be}}},xe.heading=function(ie){var ae=this.rules.block.heading.exec(ie);if(ae)return{type:"heading",raw:ae[0],depth:ae[1].length,text:ae[2]}},xe.nptable=function(ie){var ae=this.rules.block.nptable.exec(ie);if(ae){var ce={type:"table",header:V(ae[1].replace(/^ *| *\| *$/g,"")),align:ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ae[3]?ae[3].replace(/\n$/,"").split(`
|
|
`):[],raw:ae[0]};if(ce.header.length===ce.align.length){var be=ce.align.length,Ce;for(Ce=0;Ce<be;Ce++)/^ *-+: *$/.test(ce.align[Ce])?ce.align[Ce]="right":/^ *:-+: *$/.test(ce.align[Ce])?ce.align[Ce]="center":/^ *:-+ *$/.test(ce.align[Ce])?ce.align[Ce]="left":ce.align[Ce]=null;for(be=ce.cells.length,Ce=0;Ce<be;Ce++)ce.cells[Ce]=V(ce.cells[Ce],ce.header.length);return ce}}},xe.hr=function(ie){var ae=this.rules.block.hr.exec(ie);if(ae)return{type:"hr",raw:ae[0]}},xe.blockquote=function(ie){var ae=this.rules.block.blockquote.exec(ie);if(ae){var ce=ae[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ae[0],text:ce}}},xe.list=function(ie){var ae=this.rules.block.list.exec(ie);if(ae){for(var ce=ae[0],be=ae[2],Ce=be.length>1,Be=be[be.length-1]===")",yt={type:"list",raw:ce,ordered:Ce,start:Ce?+be.slice(0,-1):"",loose:!1,items:[]},Xt=ae[0].match(this.rules.block.item),an=!1,pt,Yt,St,Ot,dt,_e,je,kt=Xt.length,gt=0;gt<kt;gt++)pt=Xt[gt],ce=pt,Yt=pt.length,pt=pt.replace(/^ *([*+-]|\d+[.)]) */,""),~pt.indexOf(`
|
|
`)&&(Yt-=pt.length,pt=this.options.pedantic?pt.replace(/^ {1,4}/gm,""):pt.replace(new RegExp("^ {1,"+Yt+"}","gm"),"")),gt!==kt-1&&(St=this.rules.block.bullet.exec(Xt[gt+1])[0],(Ce?St.length===1||!Be&&St[St.length-1]===")":St.length>1||this.options.smartLists&&St!==be)&&(Ot=Xt.slice(gt+1).join(`
|
|
`),yt.raw=yt.raw.substring(0,yt.raw.length-Ot.length),gt=kt-1)),dt=an||/\n\n(?!\s*$)/.test(pt),gt!==kt-1&&(an=pt.charAt(pt.length-1)===`
|
|
`,dt||(dt=an)),dt&&(yt.loose=!0),_e=/^\[[ xX]\] /.test(pt),je=void 0,_e&&(je=pt[1]!==" ",pt=pt.replace(/^\[[ xX]\] +/,"")),yt.items.push({type:"list_item",raw:ce,task:_e,checked:je,loose:dt,text:pt});return yt}},xe.html=function(ie){var ae=this.rules.block.html.exec(ie);if(ae)return{type:this.options.sanitize?"paragraph":"html",raw:ae[0],pre:!this.options.sanitizer&&(ae[1]==="pre"||ae[1]==="script"||ae[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ae[0]):W(ae[0]):ae[0]}},xe.def=function(ie){var ae=this.rules.block.def.exec(ie);if(ae){ae[3]&&(ae[3]=ae[3].substring(1,ae[3].length-1));var ce=ae[1].toLowerCase().replace(/\s+/g," ");return{tag:ce,raw:ae[0],href:ae[2],title:ae[3]}}},xe.table=function(ie){var ae=this.rules.block.table.exec(ie);if(ae){var ce={type:"table",header:V(ae[1].replace(/^ *| *\| *$/g,"")),align:ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ae[3]?ae[3].replace(/\n$/,"").split(`
|
|
`):[]};if(ce.header.length===ce.align.length){ce.raw=ae[0];var be=ce.align.length,Ce;for(Ce=0;Ce<be;Ce++)/^ *-+: *$/.test(ce.align[Ce])?ce.align[Ce]="right":/^ *:-+: *$/.test(ce.align[Ce])?ce.align[Ce]="center":/^ *:-+ *$/.test(ce.align[Ce])?ce.align[Ce]="left":ce.align[Ce]=null;for(be=ce.cells.length,Ce=0;Ce<be;Ce++)ce.cells[Ce]=V(ce.cells[Ce].replace(/^ *\| *| *\| *$/g,""),ce.header.length);return ce}}},xe.lheading=function(ie){var ae=this.rules.block.lheading.exec(ie);if(ae)return{type:"heading",raw:ae[0],depth:ae[2].charAt(0)==="="?1:2,text:ae[1]}},xe.paragraph=function(ie){var ae=this.rules.block.paragraph.exec(ie);if(ae)return{type:"paragraph",raw:ae[0],text:ae[1].charAt(ae[1].length-1)===`
|
|
`?ae[1].slice(0,-1):ae[1]}},xe.text=function(ie,ae){var ce=this.rules.block.text.exec(ie);if(ce){var be=ae[ae.length-1];return be&&be.type==="text"?{raw:ce[0],text:ce[0]}:{type:"text",raw:ce[0],text:ce[0]}}},xe.escape=function(ie){var ae=this.rules.inline.escape.exec(ie);if(ae)return{type:"escape",raw:ae[0],text:W(ae[1])}},xe.tag=function(ie,ae,ce){var be=this.rules.inline.tag.exec(ie);if(be)return!ae&&/^<a /i.test(be[0])?ae=!0:ae&&/^<\/a>/i.test(be[0])&&(ae=!1),!ce&&/^<(pre|code|kbd|script)(\s|>)/i.test(be[0])?ce=!0:ce&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(be[0])&&(ce=!1),{type:this.options.sanitize?"text":"html",raw:be[0],inLink:ae,inRawBlock:ce,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(be[0]):W(be[0]):be[0]}},xe.link=function(ie){var ae=this.rules.inline.link.exec(ie);if(ae){var ce=$(ae[2],"()");if(ce>-1){var be=ae[0].indexOf("!")===0?5:4,Ce=be+ae[1].length+ce;ae[2]=ae[2].substring(0,ce),ae[0]=ae[0].substring(0,Ce).trim(),ae[3]=""}var Be=ae[2],yt="";if(this.options.pedantic){var Xt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Be);Xt?(Be=Xt[1],yt=Xt[3]):yt=""}else yt=ae[3]?ae[3].slice(1,-1):"";Be=Be.trim().replace(/^<([\s\S]*)>$/,"$1");var an=q(ae,{href:Be&&Be.replace(this.rules.inline._escapes,"$1"),title:yt&&yt.replace(this.rules.inline._escapes,"$1")},ae[0]);return an}},xe.reflink=function(ie,ae){var ce;if((ce=this.rules.inline.reflink.exec(ie))||(ce=this.rules.inline.nolink.exec(ie))){var be=(ce[2]||ce[1]).replace(/\s+/g," ");if(be=ae[be.toLowerCase()],!be||!be.href){var Ce=ce[0].charAt(0);return{type:"text",raw:Ce,text:Ce}}var Be=q(ce,be,ce[0]);return Be}},xe.strong=function(ie,ae,ce){ce===void 0&&(ce="");var be=this.rules.inline.strong.start.exec(ie);if(be&&(!be[1]||be[1]&&(ce===""||this.rules.inline.punctuation.exec(ce)))){ae=ae.slice(-1*ie.length);var Ce=be[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Ce.lastIndex=0;for(var Be;(be=Ce.exec(ae))!=null;)if(Be=this.rules.inline.strong.middle.exec(ae.slice(0,be.index+3)),Be)return{type:"strong",raw:ie.slice(0,Be[0].length),text:ie.slice(2,Be[0].length-2)}}},xe.em=function(ie,ae,ce){ce===void 0&&(ce="");var be=this.rules.inline.em.start.exec(ie);if(be&&(!be[1]||be[1]&&(ce===""||this.rules.inline.punctuation.exec(ce)))){ae=ae.slice(-1*ie.length);var Ce=be[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Ce.lastIndex=0;for(var Be;(be=Ce.exec(ae))!=null;)if(Be=this.rules.inline.em.middle.exec(ae.slice(0,be.index+2)),Be)return{type:"em",raw:ie.slice(0,Be[0].length),text:ie.slice(1,Be[0].length-1)}}},xe.codespan=function(ie){var ae=this.rules.inline.code.exec(ie);if(ae){var ce=ae[2].replace(/\n/g," "),be=/[^ ]/.test(ce),Ce=ce.startsWith(" ")&&ce.endsWith(" ");return be&&Ce&&(ce=ce.substring(1,ce.length-1)),ce=W(ce,!0),{type:"codespan",raw:ae[0],text:ce}}},xe.br=function(ie){var ae=this.rules.inline.br.exec(ie);if(ae)return{type:"br",raw:ae[0]}},xe.del=function(ie){var ae=this.rules.inline.del.exec(ie);if(ae)return{type:"del",raw:ae[0],text:ae[1]}},xe.autolink=function(ie,ae){var ce=this.rules.inline.autolink.exec(ie);if(ce){var be,Ce;return ce[2]==="@"?(be=W(this.options.mangle?ae(ce[1]):ce[1]),Ce="mailto:"+be):(be=W(ce[1]),Ce=be),{type:"link",raw:ce[0],text:be,href:Ce,tokens:[{type:"text",raw:be,text:be}]}}},xe.url=function(ie,ae){var ce;if(ce=this.rules.inline.url.exec(ie)){var be,Ce;if(ce[2]==="@")be=W(this.options.mangle?ae(ce[0]):ce[0]),Ce="mailto:"+be;else{var Be;do Be=ce[0],ce[0]=this.rules.inline._backpedal.exec(ce[0])[0];while(Be!==ce[0]);be=W(ce[0]),ce[1]==="www."?Ce="http://"+be:Ce=be}return{type:"link",raw:ce[0],text:be,href:Ce,tokens:[{type:"text",raw:be,text:be}]}}},xe.inlineText=function(ie,ae,ce){var be=this.rules.inline.text.exec(ie);if(be){var Ce;return ae?Ce=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(be[0]):W(be[0]):be[0]:Ce=W(this.options.smartypants?ce(be[0]):be[0]),{type:"text",raw:be[0],text:Ce}}},Pe}(),me=G.noopTest,ve=G.edit,Ae=G.merge,ge={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:me,table:me,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ge._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ge._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ge.def=ve(ge.def).replace("label",ge._label).replace("title",ge._title).getRegex(),ge.bullet=/(?:[*+-]|\d{1,9}[.)])/,ge.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ge.item=ve(ge.item,"gm").replace(/bull/g,ge.bullet).getRegex(),ge.list=ve(ge.list).replace(/bull/g,ge.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ge.def.source+")").getRegex(),ge._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",ge._comment=/<!--(?!-?>)[\s\S]*?-->/,ge.html=ve(ge.html,"i").replace("comment",ge._comment).replace("tag",ge._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ge.paragraph=ve(ge._paragraph).replace("hr",ge.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",ge._tag).getRegex(),ge.blockquote=ve(ge.blockquote).replace("paragraph",ge.paragraph).getRegex(),ge.normal=Ae({},ge),ge.gfm=Ae({},ge.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*|$)"}),ge.gfm.nptable=ve(ge.gfm.nptable).replace("hr",ge.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",ge._tag).getRegex(),ge.gfm.table=ve(ge.gfm.table).replace("hr",ge.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",ge._tag).getRegex(),ge.pedantic=Ae({},ge.normal,{html:ve(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ge._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:me,paragraph:ve(ge.normal._paragraph).replace("hr",ge.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",ge.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ue={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:me,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:me,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ue._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ue.punctuation=ve(ue.punctuation).replace(/punctuation/g,ue._punctuation).getRegex(),ue._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ue._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ue.em.start=ve(ue.em.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.middle=ve(ue.em.middle).replace(/punctuation/g,ue._punctuation).replace(/overlapSkip/g,ue._overlapSkip).getRegex(),ue.em.endAst=ve(ue.em.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.endUnd=ve(ue.em.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.start=ve(ue.strong.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.middle=ve(ue.strong.middle).replace(/punctuation/g,ue._punctuation).replace(/blockSkip/g,ue._blockSkip).getRegex(),ue.strong.endAst=ve(ue.strong.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.endUnd=ve(ue.strong.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.blockSkip=ve(ue._blockSkip,"g").getRegex(),ue.overlapSkip=ve(ue._overlapSkip,"g").getRegex(),ue._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ue._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ue._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,ue.autolink=ve(ue.autolink).replace("scheme",ue._scheme).replace("email",ue._email).getRegex(),ue._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ue.tag=ve(ue.tag).replace("comment",ge._comment).replace("attribute",ue._attribute).getRegex(),ue._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ue._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ue._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ue.link=ve(ue.link).replace("label",ue._label).replace("href",ue._href).replace("title",ue._title).getRegex(),ue.reflink=ve(ue.reflink).replace("label",ue._label).getRegex(),ue.reflinkSearch=ve(ue.reflinkSearch,"g").replace("reflink",ue.reflink).replace("nolink",ue.nolink).getRegex(),ue.normal=Ae({},ue),ue.pedantic=Ae({},ue.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:ve(/^!?\[(label)\]\((.*?)\)/).replace("label",ue._label).getRegex(),reflink:ve(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ue._label).getRegex()}),ue.gfm=Ae({},ue.normal,{escape:ve(ue.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),ue.gfm.url=ve(ue.gfm.url,"i").replace("email",ue.gfm._extended_email).getRegex(),ue.breaks=Ae({},ue.gfm,{br:ve(ue.br).replace("{2,}","*").getRegex(),text:ve(ue.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var $e={block:ge,inline:ue},Tt=D.defaults,ye=$e.block,Re=$e.inline;function nt(Pe){return Pe.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 Ue(Pe){var xe="",we,ie,ae=Pe.length;for(we=0;we<ae;we++)ie=Pe.charCodeAt(we),Math.random()>.5&&(ie="x"+ie.toString(16)),xe+="&#"+ie+";";return xe}var ke=function(){function Pe(we){this.tokens=[],this.tokens.links=Object.create(null),this.options=we||Tt,this.options.tokenizer=this.options.tokenizer||new se,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ie={block:ye.normal,inline:Re.normal};this.options.pedantic?(ie.block=ye.pedantic,ie.inline=Re.pedantic):this.options.gfm&&(ie.block=ye.gfm,this.options.breaks?ie.inline=Re.breaks:ie.inline=Re.gfm),this.tokenizer.rules=ie}Pe.lex=function(ie,ae){var ce=new Pe(ae);return ce.lex(ie)};var xe=Pe.prototype;return xe.lex=function(ie){return ie=ie.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(ie,this.tokens,!0),this.inline(this.tokens),this.tokens},xe.blockTokens=function(ie,ae,ce){ae===void 0&&(ae=[]),ce===void 0&&(ce=!0),ie=ie.replace(/^ +$/gm,"");for(var be,Ce,Be,yt;ie;){if(be=this.tokenizer.space(ie)){ie=ie.substring(be.raw.length),be.type&&ae.push(be);continue}if(be=this.tokenizer.code(ie,ae)){ie=ie.substring(be.raw.length),be.type?ae.push(be):(yt=ae[ae.length-1],yt.raw+=`
|
|
`+be.raw,yt.text+=`
|
|
`+be.text);continue}if(be=this.tokenizer.fences(ie)){ie=ie.substring(be.raw.length),ae.push(be);continue}if(be=this.tokenizer.heading(ie)){ie=ie.substring(be.raw.length),ae.push(be);continue}if(be=this.tokenizer.nptable(ie)){ie=ie.substring(be.raw.length),ae.push(be);continue}if(be=this.tokenizer.hr(ie)){ie=ie.substring(be.raw.length),ae.push(be);continue}if(be=this.tokenizer.blockquote(ie)){ie=ie.substring(be.raw.length),be.tokens=this.blockTokens(be.text,[],ce),ae.push(be);continue}if(be=this.tokenizer.list(ie)){for(ie=ie.substring(be.raw.length),Be=be.items.length,Ce=0;Ce<Be;Ce++)be.items[Ce].tokens=this.blockTokens(be.items[Ce].text,[],!1);ae.push(be);continue}if(be=this.tokenizer.html(ie)){ie=ie.substring(be.raw.length),ae.push(be);continue}if(ce&&(be=this.tokenizer.def(ie))){ie=ie.substring(be.raw.length),this.tokens.links[be.tag]||(this.tokens.links[be.tag]={href:be.href,title:be.title});continue}if(be=this.tokenizer.table(ie)){ie=ie.substring(be.raw.length),ae.push(be);continue}if(be=this.tokenizer.lheading(ie)){ie=ie.substring(be.raw.length),ae.push(be);continue}if(ce&&(be=this.tokenizer.paragraph(ie))){ie=ie.substring(be.raw.length),ae.push(be);continue}if(be=this.tokenizer.text(ie,ae)){ie=ie.substring(be.raw.length),be.type?ae.push(be):(yt=ae[ae.length-1],yt.raw+=`
|
|
`+be.raw,yt.text+=`
|
|
`+be.text);continue}if(ie){var Xt="Infinite loop on byte: "+ie.charCodeAt(0);if(this.options.silent){console.error(Xt);break}else throw new Error(Xt)}}return ae},xe.inline=function(ie){var ae,ce,be,Ce,Be,yt,Xt=ie.length;for(ae=0;ae<Xt;ae++){yt=ie[ae];switch(yt.type){case"paragraph":case"text":case"heading":{yt.tokens=[],this.inlineTokens(yt.text,yt.tokens);break}case"table":{for(yt.tokens={header:[],cells:[]},Ce=yt.header.length,ce=0;ce<Ce;ce++)yt.tokens.header[ce]=[],this.inlineTokens(yt.header[ce],yt.tokens.header[ce]);for(Ce=yt.cells.length,ce=0;ce<Ce;ce++)for(Be=yt.cells[ce],yt.tokens.cells[ce]=[],be=0;be<Be.length;be++)yt.tokens.cells[ce][be]=[],this.inlineTokens(Be[be],yt.tokens.cells[ce][be]);break}case"blockquote":{this.inline(yt.tokens);break}case"list":{for(Ce=yt.items.length,ce=0;ce<Ce;ce++)this.inline(yt.items[ce].tokens);break}}}return ie},xe.inlineTokens=function(ie,ae,ce,be,Ce){ae===void 0&&(ae=[]),ce===void 0&&(ce=!1),be===void 0&&(be=!1),Ce===void 0&&(Ce="");var Be,yt=ie,Xt;if(this.tokens.links){var an=Object.keys(this.tokens.links);if(an.length>0)for(;(Xt=this.tokenizer.rules.inline.reflinkSearch.exec(yt))!=null;)an.includes(Xt[0].slice(Xt[0].lastIndexOf("[")+1,-1))&&(yt=yt.slice(0,Xt.index)+"["+"a".repeat(Xt[0].length-2)+"]"+yt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Xt=this.tokenizer.rules.inline.blockSkip.exec(yt))!=null;)yt=yt.slice(0,Xt.index)+"["+"a".repeat(Xt[0].length-2)+"]"+yt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ie;){if(Be=this.tokenizer.escape(ie)){ie=ie.substring(Be.raw.length),ae.push(Be);continue}if(Be=this.tokenizer.tag(ie,ce,be)){ie=ie.substring(Be.raw.length),ce=Be.inLink,be=Be.inRawBlock,ae.push(Be);continue}if(Be=this.tokenizer.link(ie)){ie=ie.substring(Be.raw.length),Be.type==="link"&&(Be.tokens=this.inlineTokens(Be.text,[],!0,be)),ae.push(Be);continue}if(Be=this.tokenizer.reflink(ie,this.tokens.links)){ie=ie.substring(Be.raw.length),Be.type==="link"&&(Be.tokens=this.inlineTokens(Be.text,[],!0,be)),ae.push(Be);continue}if(Be=this.tokenizer.strong(ie,yt,Ce)){ie=ie.substring(Be.raw.length),Be.tokens=this.inlineTokens(Be.text,[],ce,be),ae.push(Be);continue}if(Be=this.tokenizer.em(ie,yt,Ce)){ie=ie.substring(Be.raw.length),Be.tokens=this.inlineTokens(Be.text,[],ce,be),ae.push(Be);continue}if(Be=this.tokenizer.codespan(ie)){ie=ie.substring(Be.raw.length),ae.push(Be);continue}if(Be=this.tokenizer.br(ie)){ie=ie.substring(Be.raw.length),ae.push(Be);continue}if(Be=this.tokenizer.del(ie)){ie=ie.substring(Be.raw.length),Be.tokens=this.inlineTokens(Be.text,[],ce,be),ae.push(Be);continue}if(Be=this.tokenizer.autolink(ie,Ue)){ie=ie.substring(Be.raw.length),ae.push(Be);continue}if(!ce&&(Be=this.tokenizer.url(ie,Ue))){ie=ie.substring(Be.raw.length),ae.push(Be);continue}if(Be=this.tokenizer.inlineText(ie,be,nt)){ie=ie.substring(Be.raw.length),Ce=Be.raw.slice(-1),ae.push(Be);continue}if(ie){var pt="Infinite loop on byte: "+ie.charCodeAt(0);if(this.options.silent){console.error(pt);break}else throw new Error(pt)}}return ae},H(Pe,null,[{key:"rules",get:function(){return{block:ye,inline:Re}}}]),Pe}(),lt=D.defaults,Fe=G.cleanUrl,Ze=G.escape,Xe=function(){function Pe(we){this.options=we||lt}var xe=Pe.prototype;return xe.code=function(ie,ae,ce){var be=(ae||"").match(/\S*/)[0];if(this.options.highlight){var Ce=this.options.highlight(ie,be);Ce!=null&&Ce!==ie&&(ce=!0,ie=Ce)}return be?'<pre><code class="'+this.options.langPrefix+Ze(be,!0)+'">'+(ce?ie:Ze(ie,!0))+`</code></pre>
|
|
`:"<pre><code>"+(ce?ie:Ze(ie,!0))+`</code></pre>
|
|
`},xe.blockquote=function(ie){return`<blockquote>
|
|
`+ie+`</blockquote>
|
|
`},xe.html=function(ie){return ie},xe.heading=function(ie,ae,ce,be){return this.options.headerIds?"<h"+ae+' id="'+this.options.headerPrefix+be.slug(ce)+'">'+ie+"</h"+ae+`>
|
|
`:"<h"+ae+">"+ie+"</h"+ae+`>
|
|
`},xe.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},xe.list=function(ie,ae,ce){var be=ae?"ol":"ul",Ce=ae&&ce!==1?' start="'+ce+'"':"";return"<"+be+Ce+`>
|
|
`+ie+"</"+be+`>
|
|
`},xe.listitem=function(ie){return"<li>"+ie+`</li>
|
|
`},xe.checkbox=function(ie){return"<input "+(ie?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},xe.paragraph=function(ie){return"<p>"+ie+`</p>
|
|
`},xe.table=function(ie,ae){return ae&&(ae="<tbody>"+ae+"</tbody>"),`<table>
|
|
<thead>
|
|
`+ie+`</thead>
|
|
`+ae+`</table>
|
|
`},xe.tablerow=function(ie){return`<tr>
|
|
`+ie+`</tr>
|
|
`},xe.tablecell=function(ie,ae){var ce=ae.header?"th":"td",be=ae.align?"<"+ce+' align="'+ae.align+'">':"<"+ce+">";return be+ie+"</"+ce+`>
|
|
`},xe.strong=function(ie){return"<strong>"+ie+"</strong>"},xe.em=function(ie){return"<em>"+ie+"</em>"},xe.codespan=function(ie){return"<code>"+ie+"</code>"},xe.br=function(){return this.options.xhtml?"<br/>":"<br>"},xe.del=function(ie){return"<del>"+ie+"</del>"},xe.link=function(ie,ae,ce){if(ie=Fe(this.options.sanitize,this.options.baseUrl,ie),ie===null)return ce;var be='<a href="'+Ze(ie)+'"';return ae&&(be+=' title="'+ae+'"'),be+=">"+ce+"</a>",be},xe.image=function(ie,ae,ce){if(ie=Fe(this.options.sanitize,this.options.baseUrl,ie),ie===null)return ce;var be='<img src="'+ie+'" alt="'+ce+'"';return ae&&(be+=' title="'+ae+'"'),be+=this.options.xhtml?"/>":">",be},xe.text=function(ie){return ie},Pe}(),ft=function(){function Pe(){}var xe=Pe.prototype;return xe.strong=function(ie){return ie},xe.em=function(ie){return ie},xe.codespan=function(ie){return ie},xe.del=function(ie){return ie},xe.html=function(ie){return ie},xe.text=function(ie){return ie},xe.link=function(ie,ae,ce){return""+ce},xe.image=function(ie,ae,ce){return""+ce},xe.br=function(){return""},Pe}(),Rt=function(){function Pe(){this.seen={}}var xe=Pe.prototype;return xe.slug=function(ie){var ae=ie.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ae)){var ce=ae;do this.seen[ce]++,ae=ce+"-"+this.seen[ce];while(this.seen.hasOwnProperty(ae))}return this.seen[ae]=0,ae},Pe}(),Pt=D.defaults,Bt=G.unescape,Ve=function(){function Pe(we){this.options=we||Pt,this.options.renderer=this.options.renderer||new Xe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ft,this.slugger=new Rt}Pe.parse=function(ie,ae){var ce=new Pe(ae);return ce.parse(ie)};var xe=Pe.prototype;return xe.parse=function(ie,ae){ae===void 0&&(ae=!0);var ce="",be,Ce,Be,yt,Xt,an,pt,Yt,St,Ot,dt,_e,je,kt,gt,zt,$t,De,qe=ie.length;for(be=0;be<qe;be++){Ot=ie[be];switch(Ot.type){case"space":continue;case"hr":{ce+=this.renderer.hr();continue}case"heading":{ce+=this.renderer.heading(this.parseInline(Ot.tokens),Ot.depth,Bt(this.parseInline(Ot.tokens,this.textRenderer)),this.slugger);continue}case"code":{ce+=this.renderer.code(Ot.text,Ot.lang,Ot.escaped);continue}case"table":{for(Yt="",pt="",yt=Ot.header.length,Ce=0;Ce<yt;Ce++)pt+=this.renderer.tablecell(this.parseInline(Ot.tokens.header[Ce]),{header:!0,align:Ot.align[Ce]});for(Yt+=this.renderer.tablerow(pt),St="",yt=Ot.cells.length,Ce=0;Ce<yt;Ce++){for(an=Ot.tokens.cells[Ce],pt="",Xt=an.length,Be=0;Be<Xt;Be++)pt+=this.renderer.tablecell(this.parseInline(an[Be]),{header:!1,align:Ot.align[Be]});St+=this.renderer.tablerow(pt)}ce+=this.renderer.table(Yt,St);continue}case"blockquote":{St=this.parse(Ot.tokens),ce+=this.renderer.blockquote(St);continue}case"list":{for(dt=Ot.ordered,_e=Ot.start,je=Ot.loose,yt=Ot.items.length,St="",Ce=0;Ce<yt;Ce++)gt=Ot.items[Ce],zt=gt.checked,$t=gt.task,kt="",gt.task&&(De=this.renderer.checkbox(zt),je?gt.tokens.length>0&>.tokens[0].type==="text"?(gt.tokens[0].text=De+" "+gt.tokens[0].text,gt.tokens[0].tokens&>.tokens[0].tokens.length>0&>.tokens[0].tokens[0].type==="text"&&(gt.tokens[0].tokens[0].text=De+" "+gt.tokens[0].tokens[0].text)):gt.tokens.unshift({type:"text",text:De}):kt+=De),kt+=this.parse(gt.tokens,je),St+=this.renderer.listitem(kt,$t,zt);ce+=this.renderer.list(St,dt,_e);continue}case"html":{ce+=this.renderer.html(Ot.text);continue}case"paragraph":{ce+=this.renderer.paragraph(this.parseInline(Ot.tokens));continue}case"text":{for(St=Ot.tokens?this.parseInline(Ot.tokens):Ot.text;be+1<qe&&ie[be+1].type==="text";)Ot=ie[++be],St+=`
|
|
`+(Ot.tokens?this.parseInline(Ot.tokens):Ot.text);ce+=ae?this.renderer.paragraph(St):St;continue}default:{var jt='Token with "'+Ot.type+'" type was not found.';if(this.options.silent){console.error(jt);return}else throw new Error(jt)}}}return ce},xe.parseInline=function(ie,ae){ae=ae||this.renderer;var ce="",be,Ce,Be=ie.length;for(be=0;be<Be;be++){Ce=ie[be];switch(Ce.type){case"escape":{ce+=ae.text(Ce.text);break}case"html":{ce+=ae.html(Ce.text);break}case"link":{ce+=ae.link(Ce.href,Ce.title,this.parseInline(Ce.tokens,ae));break}case"image":{ce+=ae.image(Ce.href,Ce.title,Ce.text);break}case"strong":{ce+=ae.strong(this.parseInline(Ce.tokens,ae));break}case"em":{ce+=ae.em(this.parseInline(Ce.tokens,ae));break}case"codespan":{ce+=ae.codespan(Ce.text);break}case"br":{ce+=ae.br();break}case"del":{ce+=ae.del(this.parseInline(Ce.tokens,ae));break}case"text":{ce+=ae.text(Ce.text);break}default:{var yt='Token with "'+Ce.type+'" type was not found.';if(this.options.silent){console.error(yt);return}else throw new Error(yt)}}}return ce},Pe}(),Ft=G.merge,nn=G.checkSanitizeDeprecation,Le=G.escape,Se=D.getDefaults,ut=D.changeDefaults,mt=D.defaults;function We(Pe,xe,we){if(typeof Pe=="undefined"||Pe===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Pe!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Pe)+", string expected");if(typeof xe=="function"&&(we=xe,xe=null),xe=Ft({},We.defaults,xe||{}),nn(xe),we){var ie=xe.highlight,ae;try{ae=ke.lex(Pe,xe)}catch(Be){return we(Be)}var ce=function(yt){var Xt;if(!yt)try{Xt=Ve.parse(ae,xe)}catch(an){yt=an}return xe.highlight=ie,yt?we(yt):we(null,Xt)};if(!ie||ie.length<3)return ce();if(delete xe.highlight,!ae.length)return ce();var be=0;We.walkTokens(ae,function(Be){Be.type==="code"&&(be++,setTimeout(function(){ie(Be.text,Be.lang,function(yt,Xt){if(yt)return ce(yt);Xt!=null&&Xt!==Be.text&&(Be.text=Xt,Be.escaped=!0),be--,be===0&&ce()})},0))}),be===0&&ce();return}try{var Ce=ke.lex(Pe,xe);return xe.walkTokens&&We.walkTokens(Ce,xe.walkTokens),Ve.parse(Ce,xe)}catch(Be){if(Be.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,xe.silent)return"<p>An error occurred:</p><pre>"+Le(Be.message+"",!0)+"</pre>";throw Be}}We.options=We.setOptions=function(Pe){return Ft(We.defaults,Pe),ut(We.defaults),We},We.getDefaults=Se,We.defaults=mt,We.use=function(Pe){var xe=Ft({},Pe);if(Pe.renderer&&function(){var ie=We.defaults.renderer||new Xe,ae=function(Ce){var Be=ie[Ce];ie[Ce]=function(){for(var yt=arguments.length,Xt=new Array(yt),an=0;an<yt;an++)Xt[an]=arguments[an];var pt=Pe.renderer[Ce].apply(ie,Xt);return pt===!1&&(pt=Be.apply(ie,Xt)),pt}};for(var ce in Pe.renderer)ae(ce);xe.renderer=ie}(),Pe.tokenizer&&function(){var ie=We.defaults.tokenizer||new se,ae=function(Ce){var Be=ie[Ce];ie[Ce]=function(){for(var yt=arguments.length,Xt=new Array(yt),an=0;an<yt;an++)Xt[an]=arguments[an];var pt=Pe.tokenizer[Ce].apply(ie,Xt);return pt===!1&&(pt=Be.apply(ie,Xt)),pt}};for(var ce in Pe.tokenizer)ae(ce);xe.tokenizer=ie}(),Pe.walkTokens){var we=We.defaults.walkTokens;xe.walkTokens=function(ie){Pe.walkTokens(ie),we&&we(ie)}}We.setOptions(xe)},We.walkTokens=function(Pe,xe){for(var we=R(Pe),ie;!(ie=we()).done;){var ae=ie.value;xe(ae);switch(ae.type){case"table":{for(var ce=R(ae.tokens.header),be;!(be=ce()).done;){var Ce=be.value;We.walkTokens(Ce,xe)}for(var Be=R(ae.tokens.cells),yt;!(yt=Be()).done;)for(var Xt=yt.value,an=R(Xt),pt;!(pt=an()).done;){var Yt=pt.value;We.walkTokens(Yt,xe)}break}case"list":{We.walkTokens(ae.items,xe);break}default:ae.tokens&&We.walkTokens(ae.tokens,xe)}}},We.Parser=Ve,We.parser=Ve.parse,We.Renderer=Xe,We.TextRenderer=ft,We.Lexer=ke,We.lexer=ke.lex,We.Tokenizer=se,We.Slugger=Rt,We.parse=We;var vt=We;return vt})},ELLl:function(Ye,re,I){(function(Y){Y(I("VrN/"))})(function(Y){var H={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},P=Y.Pos;Y.defineOption("autoCloseBrackets",!1,function(a,s,o){o&&o!=Y.Init&&(a.removeKeyMap(R),a.state.closeBrackets=null),s&&(O(F(s,"pairs")),a.state.closeBrackets=s,a.addKeyMap(R))});function F(a,s){return s=="pairs"&&typeof a=="string"?a:typeof a=="object"&&a[s]!=null?a[s]:H[s]}var R={Backspace:T,Enter:b};function O(a){for(var s=0;s<a.length;s++){var o=a.charAt(s),t="'"+o+"'";R[t]||(R[t]=D(o))}}O(H.pairs+"`");function D(a){return function(s){return d(s,a)}}function m(a){var s=a.state.closeBrackets;if(!s||s.override)return s;var o=a.getModeAt(a.getCursor());return o.closeBrackets||s}function T(a){var s=m(a);if(!s||a.getOption("disableInput"))return Y.Pass;for(var o=F(s,"pairs"),t=a.listSelections(),h=0;h<t.length;h++){if(!t[h].empty())return Y.Pass;var g=c(a,t[h].head);if(!g||o.indexOf(g)%2!=0)return Y.Pass}for(var h=t.length-1;h>=0;h--){var C=t[h].head;a.replaceRange("",P(C.line,C.ch-1),P(C.line,C.ch+1),"+delete")}}function b(a){var s=m(a),o=s&&F(s,"explode");if(!o||a.getOption("disableInput"))return Y.Pass;for(var t=a.listSelections(),h=0;h<t.length;h++){if(!t[h].empty())return Y.Pass;var g=c(a,t[h].head);if(!g||o.indexOf(g)%2!=0)return Y.Pass}a.operation(function(){var C=a.lineSeparator()||`
|
|
`;a.replaceSelection(C+C,null),a.execCommand("goCharLeft"),t=a.listSelections();for(var A=0;A<t.length;A++){var w=t[A].head.line;a.indentLine(w,null,!0),a.indentLine(w+1,null,!0)}})}function i(a){var s=Y.cmpPos(a.anchor,a.head)>0;return{anchor:new P(a.anchor.line,a.anchor.ch+(s?-1:1)),head:new P(a.head.line,a.head.ch+(s?1:-1))}}function d(a,s){var o=m(a);if(!o||a.getOption("disableInput"))return Y.Pass;var t=F(o,"pairs"),h=t.indexOf(s);if(h==-1)return Y.Pass;for(var g=F(o,"closeBefore"),C=F(o,"triples"),A=t.charAt(h+1)==s,w=a.listSelections(),M=h%2==0,E,p=0;p<w.length;p++){var l=w[p],u=l.head,f,_=a.getRange(u,P(u.line,u.ch+1));if(M&&!l.empty())f="surround";else if((A||!M)&&_==s)A&&r(a,u)?f="both":C.indexOf(s)>=0&&a.getRange(u,P(u.line,u.ch+3))==s+s+s?f="skipThree":f="skip";else if(A&&u.ch>1&&C.indexOf(s)>=0&&a.getRange(P(u.line,u.ch-2),u)==s+s){if(u.ch>2&&/\bstring/.test(a.getTokenTypeAt(P(u.line,u.ch-2))))return Y.Pass;f="addFour"}else if(A){var y=u.ch==0?" ":a.getRange(P(u.line,u.ch-1),u);if(!Y.isWordChar(_)&&y!=s&&!Y.isWordChar(y))f="both";else return Y.Pass}else if(M&&(_.length===0||/\s/.test(_)||g.indexOf(_)>-1))f="both";else return Y.Pass;if(!E)E=f;else if(E!=f)return Y.Pass}var v=h%2?t.charAt(h-1):s,N=h%2?s:t.charAt(h+1);a.operation(function(){if(E=="skip")a.execCommand("goCharRight");else if(E=="skipThree")for(var j=0;j<3;j++)a.execCommand("goCharRight");else if(E=="surround"){for(var U=a.getSelections(),j=0;j<U.length;j++)U[j]=v+U[j]+N;a.replaceSelections(U,"around"),U=a.listSelections().slice();for(var j=0;j<U.length;j++)U[j]=i(U[j]);a.setSelections(U)}else E=="both"?(a.replaceSelection(v+N,null),a.triggerElectric(v+N),a.execCommand("goCharLeft")):E=="addFour"&&(a.replaceSelection(v+v+v+v,"before"),a.execCommand("goCharRight"))})}function c(a,s){var o=a.getRange(P(s.line,s.ch-1),P(s.line,s.ch+1));return o.length==2?o:null}function r(a,s){var o=a.getTokenAt(P(s.line,s.ch+1));return/\bstring/.test(o.type)&&o.start==s.ch&&(s.ch==0||!/\bstring/.test(a.getTokenTypeAt(s)))}})},FOrL:function(Ye,re,I){Ye.exports=I.p+"static/nodata.a6b3f948.png"},Fofx:function(Ye,re){var I=typeof Float32Array=="undefined"?Array:Float32Array;function Y(){var b=new I(6);return H(b),b}function H(b){return b[0]=1,b[1]=0,b[2]=0,b[3]=1,b[4]=0,b[5]=0,b}function P(b,i){return b[0]=i[0],b[1]=i[1],b[2]=i[2],b[3]=i[3],b[4]=i[4],b[5]=i[5],b}function F(b,i,d){var c=i[0]*d[0]+i[2]*d[1],r=i[1]*d[0]+i[3]*d[1],a=i[0]*d[2]+i[2]*d[3],s=i[1]*d[2]+i[3]*d[3],o=i[0]*d[4]+i[2]*d[5]+i[4],t=i[1]*d[4]+i[3]*d[5]+i[5];return b[0]=c,b[1]=r,b[2]=a,b[3]=s,b[4]=o,b[5]=t,b}function R(b,i,d){return b[0]=i[0],b[1]=i[1],b[2]=i[2],b[3]=i[3],b[4]=i[4]+d[0],b[5]=i[5]+d[1],b}function O(b,i,d){var c=i[0],r=i[2],a=i[4],s=i[1],o=i[3],t=i[5],h=Math.sin(d),g=Math.cos(d);return b[0]=c*g+s*h,b[1]=-c*h+s*g,b[2]=r*g+o*h,b[3]=-r*h+g*o,b[4]=g*a+h*t,b[5]=g*t-h*a,b}function D(b,i,d){var c=d[0],r=d[1];return b[0]=i[0]*c,b[1]=i[1]*r,b[2]=i[2]*c,b[3]=i[3]*r,b[4]=i[4]*c,b[5]=i[5]*r,b}function m(b,i){var d=i[0],c=i[2],r=i[4],a=i[1],s=i[3],o=i[5],t=d*s-a*c;return t?(t=1/t,b[0]=s*t,b[1]=-a*t,b[2]=-c*t,b[3]=d*t,b[4]=(c*o-s*r)*t,b[5]=(a*r-d*o)*t,b):null}function T(b){var i=Y();return P(i,b),i}re.create=Y,re.identity=H,re.copy=P,re.mul=F,re.translate=R,re.rotate=O,re.scale=D,re.invert=m,re.clone=T},FxDU:function(Ye,re,I){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.createSensor=void 0;var Y=I("QO+J"),H=I("j5sG"),P=typeof ResizeObserver!="undefined"?H.createSensor:Y.createSensor;re.createSensor=P},Gev7:function(Ye,re,I){var Y=I("bYtY"),H=I("K2GJ"),P=I("1bdT"),F=I("ni6a");function R(D){D=D||{},P.call(this,D);for(var m in D)D.hasOwnProperty(m)&&m!=="style"&&(this[m]=D[m]);this.style=new H(D.style,this),this._rect=null,this.__clipPaths=null}R.prototype={constructor:R,type:"displayable",__dirty:!0,invisible:!1,z:0,z2:0,zlevel:0,draggable:!1,dragging:!1,silent:!1,culling:!1,cursor:"pointer",rectHover:!1,progressive:!1,incremental:!1,globalScaleRatio:1,beforeBrush:function(D){},afterBrush:function(D){},brush:function(D,m){},getBoundingRect:function(){},contain:function(D,m){return this.rectContain(D,m)},traverse:function(D,m){D.call(m,this)},rectContain:function(D,m){var T=this.transformCoordToLocal(D,m),b=this.getBoundingRect();return b.contain(T[0],T[1])},dirty:function(){this.__dirty=this.__dirtyText=!0,this._rect=null,this.__zr&&this.__zr.refresh()},animateStyle:function(D){return this.animate("style",D)},attrKV:function(D,m){D!=="style"?P.prototype.attrKV.call(this,D,m):this.style.set(m)},setStyle:function(D,m){return this.style.set(D,m),this.dirty(!1),this},useStyle:function(D){return this.style=new H(D,this),this.dirty(!1),this},calculateTextPosition:null},Y.inherits(R,P),Y.mixin(R,F);var O=R;Ye.exports=O},Gytx:function(Ye,re){Ye.exports=function(Y,H,P,F){var R=P?P.call(F,Y,H):void 0;if(R!==void 0)return!!R;if(Y===H)return!0;if(typeof Y!="object"||!Y||typeof H!="object"||!H)return!1;var O=Object.keys(Y),D=Object.keys(H);if(O.length!==D.length)return!1;for(var m=Object.prototype.hasOwnProperty.bind(H),T=0;T<O.length;T++){var b=O[T];if(!m(b))return!1;var i=Y[b],d=H[b];if(R=P?P.call(F,i,d,b):void 0,R===!1||R===void 0&&i!==d)return!1}return!0}},H6uX:function(Ye,re){var I=Array.prototype.slice,Y=function(R){this._$handlers={},this._$eventProcessor=R};Y.prototype={constructor:Y,one:function(R,O,D,m){return P(this,R,O,D,m,!0)},on:function(R,O,D,m){return P(this,R,O,D,m,!1)},isSilent:function(R){var O=this._$handlers;return!O[R]||!O[R].length},off:function(R,O){var D=this._$handlers;if(!R)return this._$handlers={},this;if(O){if(D[R]){for(var m=[],T=0,b=D[R].length;T<b;T++)D[R][T].h!==O&&m.push(D[R][T]);D[R]=m}D[R]&&D[R].length===0&&delete D[R]}else delete D[R];return this},trigger:function(R){var O=this._$handlers[R],D=this._$eventProcessor;if(O){var m=arguments,T=m.length;T>3&&(m=I.call(m,1));for(var b=O.length,i=0;i<b;){var d=O[i];if(D&&D.filter&&d.query!=null&&!D.filter(R,d.query)){i++;continue}switch(T){case 1:d.h.call(d.ctx);break;case 2:d.h.call(d.ctx,m[1]);break;case 3:d.h.call(d.ctx,m[1],m[2]);break;default:d.h.apply(d.ctx,m);break}d.one?(O.splice(i,1),b--):i++}}return D&&D.afterTrigger&&D.afterTrigger(R),this},triggerWithContext:function(R){var O=this._$handlers[R],D=this._$eventProcessor;if(O){var m=arguments,T=m.length;T>4&&(m=I.call(m,1,m.length-1));for(var b=m[m.length-1],i=O.length,d=0;d<i;){var c=O[d];if(D&&D.filter&&c.query!=null&&!D.filter(R,c.query)){d++;continue}switch(T){case 1:c.h.call(b);break;case 2:c.h.call(b,m[1]);break;case 3:c.h.call(b,m[1],m[2]);break;default:c.h.apply(b,m);break}c.one?(O.splice(d,1),i--):d++}}return D&&D.afterTrigger&&D.afterTrigger(R),this}};function H(R,O){var D=R._$eventProcessor;return O!=null&&D&&D.normalizeQuery&&(O=D.normalizeQuery(O)),O}function P(R,O,D,m,T,b){var i=R._$handlers;if(typeof D=="function"&&(T=m,m=D,D=null),!m||!O)return R;D=H(R,D),i[O]||(i[O]=[]);for(var d=0;d<i[O].length;d++)if(i[O][d].h===m)return R;var c={h:m,one:b,query:D,ctx:T||R,callAtLast:m.zrEventfulCallAtLast},r=i[O].length-1,a=i[O][r];return a&&a.callAtLast?i[O].splice(r,0,c):i[O].push(c),R}var F=Y;Ye.exports=F},HmJG:function(Ye,re,I){},I8Z2:function(Ye,re,I){"use strict";I.d(re,"a",function(){return F}),I.d(re,"b",function(){return c}),I.d(re,"c",function(){return a});var Y=I("q1tI"),H=function(){var s=function(o,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,g){h.__proto__=g}||function(h,g){for(var C in g)g.hasOwnProperty(C)&&(h[C]=g[C])},s(o,t)};return function(o,t){s(o,t);function h(){this.constructor=o}o.prototype=t===null?Object.create(t):(h.prototype=t.prototype,new h)}}(),P=Y.createContext(null),F=function(s){H(o,s);function o(){return s!==null&&s.apply(this,arguments)||this}return o.prototype.render=function(){return Y.createElement(P.Provider,{value:this.props.store},this.props.children)},o}(Y.Component),R=I("Gytx"),O=I.n(R),D=I("2mql"),m=I.n(D),T=function(){var s=function(o,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,g){h.__proto__=g}||function(h,g){for(var C in g)g.hasOwnProperty(C)&&(h[C]=g[C])},s(o,t)};return function(o,t){s(o,t);function h(){this.constructor=o}o.prototype=t===null?Object.create(t):(h.prototype=t.prototype,new h)}}(),b=function(){return b=Object.assign||function(s){for(var o,t=1,h=arguments.length;t<h;t++){o=arguments[t];for(var g in o)Object.prototype.hasOwnProperty.call(o,g)&&(s[g]=o[g])}return s},b.apply(this,arguments)};function i(s){return s.displayName||s.name||"Component"}var d=function(){return{}};function c(s,o){o===void 0&&(o={});var t=!!s,h=s||d;return function(C){var A=function(M){T(E,M);function E(p,l){var u=M.call(this,p,l)||this;return u.unsubscribe=null,u.handleChange=function(){if(!u.unsubscribe)return;var f=h(u.store.getState(),u.props);u.setState({subscribed:f})},u.store=u.context,u.state={subscribed:h(u.store.getState(),p),store:u.store,props:p},u}return E.getDerivedStateFromProps=function(p,l){return s&&s.length===2&&p!==l.props?{subscribed:h(l.store.getState(),p),props:p}:{props:p}},E.prototype.componentDidMount=function(){this.trySubscribe()},E.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},E.prototype.shouldComponentUpdate=function(p,l){return!O()(this.props,p)||!O()(this.state.subscribed,l.subscribed)},E.prototype.trySubscribe=function(){t&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},E.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},E.prototype.render=function(){var p=b(b(b({},this.props),this.state.subscribed),{store:this.store});return Y.createElement(C,b({},p,{ref:this.props.miniStoreForwardedRef}))},E.displayName="Connect("+i(C)+")",E.contextType=P,E}(Y.Component);if(o.forwardRef){var w=Y.forwardRef(function(M,E){return Y.createElement(A,b({},M,{miniStoreForwardedRef:E}))});return m()(w,C)}return m()(A,C)}}var r=function(){return r=Object.assign||function(s){for(var o,t=1,h=arguments.length;t<h;t++){o=arguments[t];for(var g in o)Object.prototype.hasOwnProperty.call(o,g)&&(s[g]=o[g])}return s},r.apply(this,arguments)};function a(s){var o=s,t=[];function h(A){o=r(r({},o),A);for(var w=0;w<t.length;w++)t[w]()}function g(){return o}function C(A){return t.push(A),function(){var M=t.indexOf(A);t.splice(M,1)}}return{setState:h,getState:g,subscribe:C}}},IBYe:function(Ye,re,I){"use strict";function Y(H){return null}re.a=Y},IMiH:function(Ye,re,I){var Y=I("Sj9i"),H=I("QBsz"),P=I("4mN7"),F=I("mFDi"),R=I("LPTA"),O=R.devicePixelRatio,D={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},m=[],T=[],b=[],i=[],d=Math.min,c=Math.max,r=Math.cos,a=Math.sin,s=Math.sqrt,o=Math.abs,t=typeof Float32Array!="undefined",h=function(C){this._saveData=!(C||!1),this._saveData&&(this.data=[]),this._ctx=null};h.prototype={constructor:h,_xi:0,_yi:0,_x0:0,_y0:0,_ux:0,_uy:0,_len:0,_lineDash:null,_dashOffset:0,_dashIdx:0,_dashSum:0,setScale:function(C,A,w){w=w||0,this._ux=o(w/O/C)||0,this._uy=o(w/O/A)||0},getContext:function(){return this._ctx},beginPath:function(C){return this._ctx=C,C&&C.beginPath(),C&&(this.dpr=C.dpr),this._saveData&&(this._len=0),this._lineDash&&(this._lineDash=null,this._dashOffset=0),this},moveTo:function(C,A){return this.addData(D.M,C,A),this._ctx&&this._ctx.moveTo(C,A),this._x0=C,this._y0=A,this._xi=C,this._yi=A,this},lineTo:function(C,A){var w=o(C-this._xi)>this._ux||o(A-this._yi)>this._uy||this._len<5;return this.addData(D.L,C,A),this._ctx&&w&&(this._needsDash()?this._dashedLineTo(C,A):this._ctx.lineTo(C,A)),w&&(this._xi=C,this._yi=A),this},bezierCurveTo:function(C,A,w,M,E,p){return this.addData(D.C,C,A,w,M,E,p),this._ctx&&(this._needsDash()?this._dashedBezierTo(C,A,w,M,E,p):this._ctx.bezierCurveTo(C,A,w,M,E,p)),this._xi=E,this._yi=p,this},quadraticCurveTo:function(C,A,w,M){return this.addData(D.Q,C,A,w,M),this._ctx&&(this._needsDash()?this._dashedQuadraticTo(C,A,w,M):this._ctx.quadraticCurveTo(C,A,w,M)),this._xi=w,this._yi=M,this},arc:function(C,A,w,M,E,p){return this.addData(D.A,C,A,w,w,M,E-M,0,p?0:1),this._ctx&&this._ctx.arc(C,A,w,M,E,p),this._xi=r(E)*w+C,this._yi=a(E)*w+A,this},arcTo:function(C,A,w,M,E){return this._ctx&&this._ctx.arcTo(C,A,w,M,E),this},rect:function(C,A,w,M){return this._ctx&&this._ctx.rect(C,A,w,M),this.addData(D.R,C,A,w,M),this},closePath:function(){this.addData(D.Z);var C=this._ctx,A=this._x0,w=this._y0;return C&&(this._needsDash()&&this._dashedLineTo(A,w),C.closePath()),this._xi=A,this._yi=w,this},fill:function(C){C&&C.fill(),this.toStatic()},stroke:function(C){C&&C.stroke(),this.toStatic()},setLineDash:function(C){if(C instanceof Array){this._lineDash=C,this._dashIdx=0;for(var A=0,w=0;w<C.length;w++)A+=C[w];this._dashSum=A}return this},setLineDashOffset:function(C){return this._dashOffset=C,this},len:function(){return this._len},setData:function(C){var A=C.length;!(this.data&&this.data.length===A)&&t&&(this.data=new Float32Array(A));for(var w=0;w<A;w++)this.data[w]=C[w];this._len=A},appendPath:function(C){C instanceof Array||(C=[C]);for(var A=C.length,w=0,M=this._len,E=0;E<A;E++)w+=C[E].len();t&&this.data instanceof Float32Array&&(this.data=new Float32Array(M+w));for(var E=0;E<A;E++)for(var p=C[E].data,l=0;l<p.length;l++)this.data[M++]=p[l];this._len=M},addData:function(C){if(!this._saveData)return;var A=this.data;this._len+arguments.length>A.length&&(this._expandData(),A=this.data);for(var w=0;w<arguments.length;w++)A[this._len++]=arguments[w];this._prevCmd=C},_expandData:function(){if(!(this.data instanceof Array)){for(var C=[],A=0;A<this._len;A++)C[A]=this.data[A];this.data=C}},_needsDash:function(){return this._lineDash},_dashedLineTo:function(C,A){var w=this._dashSum,M=this._dashOffset,E=this._lineDash,p=this._ctx,l=this._xi,u=this._yi,f=C-l,_=A-u,y=s(f*f+_*_),v=l,N=u,j,U=E.length,G;for(f/=y,_/=y,M<0&&(M=w+M),M%=w,v-=M*f,N-=M*_;f>0&&v<=C||f<0&&v>=C||f===0&&(_>0&&N<=A||_<0&&N>=A);){if(G=this._dashIdx,j=E[G],v+=f*j,N+=_*j,this._dashIdx=(G+1)%U,f>0&&v<l||f<0&&v>l||_>0&&N<u||_<0&&N>u)continue;p[G%2?"moveTo":"lineTo"](f>=0?d(v,C):c(v,C),_>=0?d(N,A):c(N,A))}f=v-C,_=N-A,this._dashOffset=-s(f*f+_*_)},_dashedBezierTo:function(C,A,w,M,E,p){var l=this._dashSum,u=this._dashOffset,f=this._lineDash,_=this._ctx,y=this._xi,v=this._yi,N,j,U,G=Y.cubicAt,z=0,L=this._dashIdx,V=f.length,W,$,q=0;for(u<0&&(u=l+u),u%=l,N=0;N<1;N+=.1)j=G(y,C,w,E,N+.1)-G(y,C,w,E,N),U=G(v,A,M,p,N+.1)-G(v,A,M,p,N),z+=s(j*j+U*U);for(;L<V&&!(q+=f[L],q>u);L++);for(N=(q-u)/z;N<=1;)W=G(y,C,w,E,N),$=G(v,A,M,p,N),L%2?_.moveTo(W,$):_.lineTo(W,$),N+=f[L]/z,L=(L+1)%V;L%2!==0&&_.lineTo(E,p),j=E-W,U=p-$,this._dashOffset=-s(j*j+U*U)},_dashedQuadraticTo:function(C,A,w,M){var E=w,p=M;w=(w+2*C)/3,M=(M+2*A)/3,C=(this._xi+2*C)/3,A=(this._yi+2*A)/3,this._dashedBezierTo(C,A,w,M,E,p)},toStatic:function(){var C=this.data;C instanceof Array&&(C.length=this._len,t&&(this.data=new Float32Array(C)))},getBoundingRect:function(){m[0]=m[1]=b[0]=b[1]=Number.MAX_VALUE,T[0]=T[1]=i[0]=i[1]=-Number.MAX_VALUE;for(var C=this.data,A=0,w=0,M=0,E=0,p=0;p<C.length;){var l=C[p++];p===1&&(A=C[p],w=C[p+1],M=A,E=w);switch(l){case D.M:M=C[p++],E=C[p++],A=M,w=E,b[0]=M,b[1]=E,i[0]=M,i[1]=E;break;case D.L:P.fromLine(A,w,C[p],C[p+1],b,i),A=C[p++],w=C[p++];break;case D.C:P.fromCubic(A,w,C[p++],C[p++],C[p++],C[p++],C[p],C[p+1],b,i),A=C[p++],w=C[p++];break;case D.Q:P.fromQuadratic(A,w,C[p++],C[p++],C[p],C[p+1],b,i),A=C[p++],w=C[p++];break;case D.A:var u=C[p++],f=C[p++],_=C[p++],y=C[p++],v=C[p++],N=C[p++]+v;p+=1;var j=1-C[p++];p===1&&(M=r(v)*_+u,E=a(v)*y+f),P.fromArc(u,f,_,y,v,N,j,b,i),A=r(N)*_+u,w=a(N)*y+f;break;case D.R:M=A=C[p++],E=w=C[p++];var U=C[p++],G=C[p++];P.fromLine(M,E,M+U,E+G,b,i);break;case D.Z:A=M,w=E;break}H.min(m,m,b),H.max(T,T,i)}return p===0&&(m[0]=m[1]=T[0]=T[1]=0),new F(m[0],m[1],T[0]-m[0],T[1]-m[1])},rebuildPath:function(C){for(var A=this.data,w,M,E,p,l,u,f=this._ux,_=this._uy,y=this._len,v=0;v<y;){var N=A[v++];v===1&&(E=A[v],p=A[v+1],w=E,M=p);switch(N){case D.M:w=E=A[v++],M=p=A[v++],C.moveTo(E,p);break;case D.L:l=A[v++],u=A[v++],(o(l-E)>f||o(u-p)>_||v===y-1)&&(C.lineTo(l,u),E=l,p=u);break;case D.C:C.bezierCurveTo(A[v++],A[v++],A[v++],A[v++],A[v++],A[v++]),E=A[v-2],p=A[v-1];break;case D.Q:C.quadraticCurveTo(A[v++],A[v++],A[v++],A[v++]),E=A[v-2],p=A[v-1];break;case D.A:var j=A[v++],U=A[v++],G=A[v++],z=A[v++],L=A[v++],V=A[v++],W=A[v++],$=A[v++],q=G>z?G:z,fe=G>z?1:G/z,se=G>z?z/G:1,me=Math.abs(G-z)>.001,ve=L+V;me?(C.translate(j,U),C.rotate(W),C.scale(fe,se),C.arc(0,0,q,L,ve,1-$),C.scale(1/fe,1/se),C.rotate(-W),C.translate(-j,-U)):C.arc(j,U,q,L,ve,1-$),v===1&&(w=r(L)*G+j,M=a(L)*z+U),E=r(ve)*G+j,p=a(ve)*z+U;break;case D.R:w=E=A[v],M=p=A[v+1],C.rect(A[v++],A[v++],A[v++],A[v++]);break;case D.Z:C.closePath(),E=w,p=M}}}},h.CMD=D;var g=h;Ye.exports=g},ItGF:function(Ye,re){var I={};typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?I={browser:{},os:{},node:!1,wxa:!0,canvasSupported:!0,svgSupported:!1,touchEventsSupported:!0,domSupported:!1}:typeof document=="undefined"&&typeof self!="undefined"?I={browser:{},os:{},node:!1,worker:!0,canvasSupported:!0,domSupported:!1}:typeof navigator=="undefined"?I={browser:{},os:{},node:!0,worker:!1,canvasSupported:!0,svgSupported:!0,domSupported:!1}:I=H(navigator.userAgent);var Y=I;function H(P){var F={},R={},O=P.match(/Firefox\/([\d.]+)/),D=P.match(/MSIE\s([\d.]+)/)||P.match(/Trident\/.+?rv:(([\d.]+))/),m=P.match(/Edge\/([\d.]+)/),T=/micromessenger/i.test(P);return O&&(R.firefox=!0,R.version=O[1]),D&&(R.ie=!0,R.version=D[1]),m&&(R.edge=!0,R.version=m[1]),T&&(R.weChat=!0),{browser:R,os:F,node:!1,canvasSupported:!!document.createElement("canvas").getContext,svgSupported:typeof SVGRect!="undefined",touchEventsSupported:"ontouchstart"in window&&!R.ie&&!R.edge,pointerEventsSupported:"onpointerdown"in window&&(R.edge||R.ie&&R.version>=11),domSupported:typeof document!="undefined"}}Ye.exports=Y},K2GJ:function(Ye,re,I){var Y=I("fW2E"),H=I("gut8"),P=H.ContextCachedBy,F=[["shadowBlur",0],["shadowOffsetX",0],["shadowOffsetY",0],["shadowColor","#000"],["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]],R=function(d){this.extendFrom(d,!1)};function O(d,c,r){var a=c.x==null?0:c.x,s=c.x2==null?1:c.x2,o=c.y==null?0:c.y,t=c.y2==null?0:c.y2;c.global||(a=a*r.width+r.x,s=s*r.width+r.x,o=o*r.height+r.y,t=t*r.height+r.y),a=isNaN(a)?0:a,s=isNaN(s)?1:s,o=isNaN(o)?0:o,t=isNaN(t)?0:t;var h=d.createLinearGradient(a,o,s,t);return h}function D(d,c,r){var a=r.width,s=r.height,o=Math.min(a,s),t=c.x==null?.5:c.x,h=c.y==null?.5:c.y,g=c.r==null?.5:c.r;c.global||(t=t*a+r.x,h=h*s+r.y,g=g*o);var C=d.createRadialGradient(t,h,0,t,h,g);return C}R.prototype={constructor:R,fill:"#000",stroke:null,opacity:1,fillOpacity:null,strokeOpacity:null,lineDash:null,lineDashOffset:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,lineWidth:1,strokeNoScale:!1,text:null,font:null,textFont:null,fontStyle:null,fontWeight:null,fontSize:null,fontFamily:null,textTag:null,textFill:"#000",textStroke:null,textWidth:null,textHeight:null,textStrokeWidth:0,textLineHeight:null,textPosition:"inside",textRect:null,textOffset:null,textAlign:null,textVerticalAlign:null,textDistance:5,textShadowColor:"transparent",textShadowBlur:0,textShadowOffsetX:0,textShadowOffsetY:0,textBoxShadowColor:"transparent",textBoxShadowBlur:0,textBoxShadowOffsetX:0,textBoxShadowOffsetY:0,transformText:!1,textRotation:0,textOrigin:null,textBackgroundColor:null,textBorderColor:null,textBorderWidth:0,textBorderRadius:0,textPadding:null,rich:null,truncate:null,blend:null,bind:function(d,c,r){var a=this,s=r&&r.style,o=!s||d.__attrCachedBy!==P.STYLE_BIND;d.__attrCachedBy=P.STYLE_BIND;for(var t=0;t<F.length;t++){var h=F[t],g=h[0];(o||a[g]!==s[g])&&(d[g]=Y(d,g,a[g]||h[1]))}if((o||a.fill!==s.fill)&&(d.fillStyle=a.fill),(o||a.stroke!==s.stroke)&&(d.strokeStyle=a.stroke),(o||a.opacity!==s.opacity)&&(d.globalAlpha=a.opacity==null?1:a.opacity),(o||a.blend!==s.blend)&&(d.globalCompositeOperation=a.blend||"source-over"),this.hasStroke()){var C=a.lineWidth;d.lineWidth=C/(this.strokeNoScale&&c&&c.getLineScale?c.getLineScale():1)}},hasFill:function(){var d=this.fill;return d!=null&&d!=="none"},hasStroke:function(){var d=this.stroke;return d!=null&&d!=="none"&&this.lineWidth>0},extendFrom:function(d,c){if(d)for(var r in d)d.hasOwnProperty(r)&&(c===!0||(c===!1?!this.hasOwnProperty(r):d[r]!=null))&&(this[r]=d[r])},set:function(d,c){typeof d=="string"?this[d]=c:this.extendFrom(d,!0)},clone:function(){var d=new this.constructor;return d.extendFrom(this,!0),d},getGradient:function(d,c,r){for(var a=c.type==="radial"?D:O,s=a(d,c,r),o=c.colorStops,t=0;t<o.length;t++)s.addColorStop(o[t].offset,o[t].color);return s}};for(var m=R.prototype,T=0;T<F.length;T++){var b=F[T];b[0]in m||(m[b[0]]=b[1])}R.getGradient=m.getGradient;var i=R;Ye.exports=i},LPTA:function(Ye,re){var I=1;typeof window!="undefined"&&(I=Math.max(window.devicePixelRatio||1,1));var Y=0,H=I;re.debugMode=Y,re.devicePixelRatio=H},LSTS:function(Ye,re,I){"use strict";Object.defineProperty(re,"__esModule",{value:!0});var Y=function(){function d(c,r){for(var a=0;a<r.length;a++){var s=r[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(c,s.key,s)}}return function(c,r,a){return r&&d(c.prototype,r),a&&d(c,a),c}}(),H=I("q1tI"),P=O(H),F=I("17x9"),R=O(F);function O(d){return d&&d.__esModule?d:{default:d}}function D(d,c){var r={};for(var a in d){if(c.indexOf(a)>=0)continue;if(!Object.prototype.hasOwnProperty.call(d,a))continue;r[a]=d[a]}return r}function m(d,c){if(!(d instanceof c))throw new TypeError("Cannot call a class as a function")}function T(d,c){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c&&(typeof c=="object"||typeof c=="function")?c:d}function b(d,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);d.prototype=Object.create(c&&c.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(d,c):d.__proto__=c)}var i=function(d){b(c,d);function c(r){m(this,c);var a=T(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,r));return a.scrollListener=a.scrollListener.bind(a),a.eventListenerOptions=a.eventListenerOptions.bind(a),a.mousewheelListener=a.mousewheelListener.bind(a),a}return Y(c,[{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 a=this.getParentElement(this.scrollComponent);a.scrollTop=a.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var a=!1,s={get passive(){a=!0}};try{document.addEventListener("test",null,s),document.removeEventListener("test",null,s)}catch(o){}return a}},{key:"eventListenerOptions",value:function(){var a=this.props.useCapture;return this.isPassiveSupported()&&(a={useCapture:this.props.useCapture,passive:!0}),a}},{key:"setDefaultLoader",value:function(a){this.defaultLoader=a}},{key:"detachMousewheelListener",value:function(){var a=window;this.props.useWindow===!1&&(a=this.scrollComponent.parentNode),a.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var a=window;this.props.useWindow===!1&&(a=this.getParentElement(this.scrollComponent)),a.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),a.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(a){var s=this.props.getScrollParent&&this.props.getScrollParent();return s!=null?s:a&&a.parentNode}},{key:"filterProps",value:function(a){return a}},{key:"attachScrollListener",value:function(){var a=this.getParentElement(this.scrollComponent);if(!this.props.hasMore||!a)return;var s=window;this.props.useWindow===!1&&(s=a),s.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),s.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),s.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}},{key:"mousewheelListener",value:function(a){a.deltaY===1&&!this.isPassiveSupported()&&a.preventDefault()}},{key:"scrollListener",value:function(){var a=this.scrollComponent,s=window,o=this.getParentElement(a),t=void 0;if(this.props.useWindow){var h=document.documentElement||document.body.parentNode||document.body,g=s.pageYOffset!==void 0?s.pageYOffset:h.scrollTop;this.props.isReverse?t=g:t=this.calculateOffset(a,g)}else this.props.isReverse?t=o.scrollTop:t=a.scrollHeight-o.scrollTop-o.clientHeight;t<Number(this.props.threshold)&&a&&a.offsetParent!==null&&(this.detachScrollListener(),this.beforeScrollHeight=o.scrollHeight,this.beforeScrollTop=o.scrollTop,typeof this.props.loadMore=="function"&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}},{key:"calculateOffset",value:function(a,s){return a?this.calculateTopPosition(a)+(a.offsetHeight-s-window.innerHeight):0}},{key:"calculateTopPosition",value:function(a){return a?a.offsetTop+this.calculateTopPosition(a.offsetParent):0}},{key:"render",value:function(){var a=this,s=this.filterProps(this.props),o=s.children,t=s.element,h=s.hasMore,g=s.initialLoad,C=s.isReverse,A=s.loader,w=s.loadMore,M=s.pageStart,E=s.ref,p=s.threshold,l=s.useCapture,u=s.useWindow,f=s.getScrollParent,_=D(s,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]);_.ref=function(v){a.scrollComponent=v,E&&E(v)};var y=[o];return h&&(A?C?y.unshift(A):y.push(A):this.defaultLoader&&(C?y.unshift(this.defaultLoader):y.push(this.defaultLoader))),P.default.createElement(t,_,y)}}]),c}(H.Component);i.propTypes={children:R.default.node.isRequired,element:R.default.node,hasMore:R.default.bool,initialLoad:R.default.bool,isReverse:R.default.bool,loader:R.default.node,loadMore:R.default.func.isRequired,pageStart:R.default.number,ref:R.default.func,getScrollParent:R.default.func,threshold:R.default.number,useCapture:R.default.bool,useWindow:R.default.bool},i.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},re.default=i,Ye.exports=re.default},LdHM:function(Ye,re,I){"use strict";I.d(re,"b",function(){return g}),I.d(re,"a",function(){return A});var Y=I("1OyB"),H=I("vuIU"),P=I("Ji7U"),F=I("LK+K"),R=I("q1tI"),O=I("rePB"),D=I("Ff2n"),m=I("ODXe"),T=I("4IlW"),b=I("bX4T"),i=I("YrtM"),d=I("TSYQ"),c=I.n(d),r=I("+nKL"),a=I("8OUc"),s=function(V,W){var $=V.prefixCls,q=V.id,fe=V.flattenOptions,se=V.childrenAsData,me=V.values,ve=V.searchValue,Ae=V.multiple,ge=V.defaultActiveFirstOption,ue=V.height,$e=V.itemHeight,Tt=V.notFoundContent,ye=V.open,Re=V.menuItemSelectedIcon,nt=V.virtual,Ue=V.onSelect,ke=V.onToggleOpen,lt=V.onActiveValue,Fe=V.onScroll,Ze=V.onMouseEnter,Xe="".concat($,"-item"),ft=Object(i.a)(function(){return fe},[ye,fe],function(vt,Pe){return Pe[0]&&vt[1]!==Pe[1]}),Rt=R.useRef(null),Pt=function(Pe){Pe.preventDefault()},Bt=function(Pe){Rt.current&&Rt.current.scrollTo({index:Pe})},Ve=function(Pe){for(var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,we=ft.length,ie=0;ie<we;ie+=1){var ae=(Pe+ie*xe+we)%we,ce=ft[ae],be=ce.group,Ce=ce.data;if(!be&&!Ce.disabled)return ae}return-1},Ft=R.useState(function(){return Ve(0)}),nn=Object(m.a)(Ft,2),Le=nn[0],Se=nn[1],ut=function(Pe){Se(Pe);var xe=ft[Pe];if(!xe){lt(null,-1);return}lt(xe.data.value,Pe)};R.useEffect(function(){ut(ge!==!1?Ve(0):-1)},[ft.length,ve]),R.useEffect(function(){var vt=setTimeout(function(){if(!Ae&&ye&&me.size===1){var Pe=Array.from(me)[0],xe=ft.findIndex(function(we){var ie=we.data;return ie.value===Pe});ut(xe),Bt(xe)}});return function(){return clearTimeout(vt)}},[ye]);var mt=function(Pe){Pe!==void 0&&Ue(Pe,{selected:!me.has(Pe)}),Ae||ke(!1)};if(R.useImperativeHandle(W,function(){return{onKeyDown:function(Pe){var xe=Pe.which;switch(xe){case T.a.UP:case T.a.DOWN:{var we=0;if(xe===T.a.UP?we=-1:xe===T.a.DOWN&&(we=1),we!==0){var ie=Ve(Le+we,we);Bt(ie),ut(ie)}break}case T.a.ENTER:{var ae=ft[Le];ae&&!ae.data.disabled?mt(ae.data.value):mt(void 0),ye&&Pe.preventDefault();break}case T.a.ESC:ke(!1)}},onKeyUp:function(){},scrollTo:function(Pe){Bt(Pe)}}}),ft.length===0)return R.createElement("div",{role:"listbox",id:"".concat(q,"_list"),className:"".concat(Xe,"-empty"),onMouseDown:Pt},Tt);function We(vt){var Pe=ft[vt];if(!Pe)return null;var xe=Pe.data||{},we=xe.value,ie=xe.label,ae=xe.children,ce=Object(b.a)(xe,!0),be=se?ae:ie;return Pe?R.createElement("div",Object.assign({"aria-label":typeof be=="string"?be:null},ce,{key:vt,role:"option",id:"".concat(q,"_list_").concat(vt),"aria-selected":me.has(we)}),we):null}return R.createElement(R.Fragment,null,R.createElement("div",{role:"listbox",id:"".concat(q,"_list"),style:{height:0,width:0,overflow:"hidden"}},We(Le-1),We(Le),We(Le+1)),R.createElement(r.a,{itemKey:"key",ref:Rt,data:ft,height:ue,itemHeight:$e,fullHeight:!1,onMouseDown:Pt,onScroll:Fe,virtual:nt,onMouseEnter:Ze},function(vt,Pe){var xe,we=vt.group,ie=vt.groupOption,ae=vt.data,ce=ae.label,be=ae.key;if(we)return R.createElement("div",{className:c()(Xe,"".concat(Xe,"-group"))},ce!==void 0?ce:be);var Ce=ae.disabled,Be=ae.value,yt=ae.title,Xt=ae.children,an=ae.style,pt=ae.className,Yt=Object(D.a)(ae,["disabled","value","title","children","style","className"]),St=me.has(Be),Ot="".concat(Xe,"-option"),dt=c()(Xe,Ot,pt,(xe={},Object(O.a)(xe,"".concat(Ot,"-grouped"),ie),Object(O.a)(xe,"".concat(Ot,"-active"),Le===Pe&&!Ce),Object(O.a)(xe,"".concat(Ot,"-disabled"),Ce),Object(O.a)(xe,"".concat(Ot,"-selected"),St),xe)),_e=se?Xt:ce,je=!Re||typeof Re=="function"||St;return R.createElement("div",Object.assign({},Yt,{"aria-selected":St,className:dt,title:yt,onMouseMove:function(){if(Le===Pe||Ce)return;ut(Pe)},onClick:function(){Ce||mt(Be)},style:an}),R.createElement("div",{className:"".concat(Ot,"-content")},_e||Be),R.isValidElement(Re)||St,je&&R.createElement(a.a,{className:"".concat(Xe,"-option-state"),customizeIcon:Re,customizeIconProps:{isSelected:St}},St?"\u2713":null))}))},o=R.forwardRef(s);o.displayName="OptionList";var t=o,h=function(){return null};h.isSelectOption=!0;var g=h,C=function(){return null};C.isSelectOptGroup=!0;var A=C,w=I("VTBJ"),M=I("Zm9Q");function E(L){var V=L.key,W=L.props,$=W.children,q=W.value,fe=Object(D.a)(W,["children","value"]);return Object(w.a)({key:V,value:q!==void 0?q:V,children:$},fe)}function p(L){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(M.a)(L).map(function(W,$){if(!R.isValidElement(W)||!W.type)return null;var q=W.type.isSelectOptGroup,fe=W.key,se=W.props,me=se.children,ve=Object(D.a)(se,["children"]);return V||!q?E(W):Object(w.a)(Object(w.a)({key:"__RC_SELECT_GRP__".concat(fe===null?$:fe,"__"),label:fe},ve),{},{options:p(me)})}).filter(function(W){return W})}var l=I("2Qr1"),u=I("qNPg"),f=I("U8pU"),_=I("Kwbf"),y=I("WKfj");function v(L){var V=L.mode,W=L.options,$=L.children,q=L.backfill,fe=L.allowClear,se=L.placeholder,me=L.getInputElement,ve=L.showSearch,Ae=L.onSearch,ge=L.defaultOpen,ue=L.autoFocus,$e=L.labelInValue,Tt=L.value,ye=L.inputValue,Re=L.optionLabelProp,nt=V==="multiple"||V==="tags",Ue=ve!==void 0?ve:nt||V==="combobox",ke=W||p($);if(Object(_.a)(V!=="tags"||ke.every(function(Xe){return!Xe.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),V==="tags"||V==="combobox"){var lt=ke.some(function(Xe){return Xe.options?Xe.options.some(function(ft){return typeof("value"in ft?ft.value:ft.key)=="number"}):typeof("value"in Xe?Xe.value:Xe.key)=="number"});Object(_.a)(!lt,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(_.a)(V!=="combobox"||!Re,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(_.a)(V==="combobox"||!q,"`backfill` only works with `combobox` mode."),Object(_.a)(V==="combobox"||!me,"`getInputElement` only work with `combobox` mode."),Object(_.b)(V!=="combobox"||!me||!fe||!se,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ae&&!Ue&&V!=="combobox"&&V!=="tags"&&Object(_.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(_.b)(!ge||ue,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Tt!=null){var Fe=Object(y.d)(Tt);Object(_.a)(!$e||Fe.every(function(Xe){return Object(f.a)(Xe)==="object"&&("key"in Xe||"value"in Xe)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(_.a)(!nt||Array.isArray(Tt),"`value` should be array when `mode` is `multiple` or `tags`")}if($){var Ze=null;Object(M.a)($).some(function(Xe){if(!R.isValidElement(Xe)||!Xe.type)return!1;var ft=Xe.type;if(ft.isSelectOption)return!1;if(ft.isSelectOptGroup){var Rt=Object(M.a)(Xe.props.children).every(function(Pt){return!R.isValidElement(Pt)||!Xe.type||Pt.type.isSelectOption?!0:(Ze=Pt.type,!1)});return!Rt}return Ze=ft,!0}),Ze&&Object(_.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ze.displayName||Ze.name||Ze,"`.")),Object(_.a)(ye===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var N=v,j=Object(u.a)({prefixCls:"rc-select",components:{optionList:t},convertChildrenToData:p,flattenOptions:l.d,getLabeledValue:l.e,filterOptions:l.b,isValueDisabled:l.g,findValueOption:l.c,warningProps:N,fillOptionsWithMissingValue:l.a}),U=function(L){Object(P.a)(W,L);var V=Object(F.a)(W);function W(){var $;return Object(Y.a)(this,W),$=V.apply(this,arguments),$.selectRef=R.createRef(),$.focus=function(){$.selectRef.current.focus()},$.blur=function(){$.selectRef.current.blur()},$}return Object(H.a)(W,[{key:"render",value:function(){return R.createElement(j,Object.assign({ref:this.selectRef},this.props))}}]),W}(R.Component);U.Option=g,U.OptGroup=A;var G=U,z=re.c=G},M8RZ:function(Ye,re,I){"use strict";I.d(re,"a",function(){return T});var Y=I("fWQN"),H=I("mtLc"),P=I("yKVA"),F=I("879j"),R=I("q1tI"),O=I.n(R),D=I("i8i4"),m=I.n(D),T=function(b){Object(P.a)(d,b);var i=Object(F.a)(d);function d(c){var r;Object(Y.a)(this,d),r=i.call(this,c);var a=window.document;return r.node=a.createElement("div"),a.body.appendChild(r.node),r}return Object(H.a)(d,[{key:"render",value:function(){var r=this.props.children;return Object(D.createPortal)(r,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),d}(O.a.Component)},MEGo:function(Ye,re,I){var Y=I("4fz+"),H=I("Dagg"),P=I("dqUG"),F=I("2fw6"),R=I("x6Kt"),O=I("rmlV"),D=I("yxFR"),m=I("y+Vt"),T=I("h7HQ"),b=I("1Jh7"),i=I("SKnc"),d=I("K2GJ"),c=I("Fofx"),r=I("NC18"),a=r.createFromString,s=I("bYtY"),o=s.isString,t=s.extend,h=s.defaults,g=s.trim,C=s.each,A=/[\s,]+/;function w(W){if(o(W)){var $=new DOMParser;W=$.parseFromString(W,"text/xml")}for(W.nodeType===9&&(W=W.firstChild);W.nodeName.toLowerCase()!=="svg"||W.nodeType!==1;)W=W.nextSibling;return W}function M(){this._defs={},this._root=null,this._isDefine=!1,this._isText=!1}M.prototype.parse=function(W,$){$=$||{};var q=w(W);if(!q)throw new Error("Illegal svg");var fe=new Y;this._root=fe;var se=q.getAttribute("viewBox")||"",me=parseFloat(q.getAttribute("width")||$.width),ve=parseFloat(q.getAttribute("height")||$.height);isNaN(me)&&(me=null),isNaN(ve)&&(ve=null),y(q,fe,null,!0);for(var Ae=q.firstChild;Ae;)this._parseNode(Ae,fe),Ae=Ae.nextSibling;var ge,ue;if(se){var $e=g(se).split(A);$e.length>=4&&(ge={x:parseFloat($e[0]||0),y:parseFloat($e[1]||0),width:parseFloat($e[2]),height:parseFloat($e[3])})}if(ge&&me!=null&&ve!=null&&(ue=L(ge,me,ve),!$.ignoreViewBox)){var Tt=fe;fe=new Y,fe.add(Tt),Tt.scale=ue.scale.slice(),Tt.position=ue.position.slice()}return!$.ignoreRootClip&&me!=null&&ve!=null&&fe.setClipPath(new R({shape:{x:0,y:0,width:me,height:ve}})),{root:fe,width:me,height:ve,viewBoxRect:ge,viewBoxTransform:ue}},M.prototype._parseNode=function(W,$){var q=W.nodeName.toLowerCase();q==="defs"?this._isDefine=!0:q==="text"&&(this._isText=!0);var fe;if(this._isDefine){var se=p[q];if(se){var me=se.call(this,W),ve=W.getAttribute("id");ve&&(this._defs[ve]=me)}}else{var se=E[q];se&&(fe=se.call(this,W,$),$.add(fe))}for(var Ae=W.firstChild;Ae;)Ae.nodeType===1&&this._parseNode(Ae,fe),Ae.nodeType===3&&this._isText&&this._parseText(Ae,fe),Ae=Ae.nextSibling;q==="defs"?this._isDefine=!1:q==="text"&&(this._isText=!1)},M.prototype._parseText=function(W,$){if(W.nodeType===1){var q=W.getAttribute("dx")||0,fe=W.getAttribute("dy")||0;this._textX+=parseFloat(q),this._textY+=parseFloat(fe)}var se=new P({style:{text:W.textContent,transformText:!0},position:[this._textX||0,this._textY||0]});u($,se),y(W,se,this._defs);var me=se.style.fontSize;me&&me<9&&(se.style.fontSize=9,se.scale=se.scale||[1,1],se.scale[0]*=me/9,se.scale[1]*=me/9);var ve=se.getBoundingRect();return this._textX+=ve.width,$.add(se),se};var E={g:function(W,$){var q=new Y;return u($,q),y(W,q,this._defs),q},rect:function(W,$){var q=new R;return u($,q),y(W,q,this._defs),q.setShape({x:parseFloat(W.getAttribute("x")||0),y:parseFloat(W.getAttribute("y")||0),width:parseFloat(W.getAttribute("width")||0),height:parseFloat(W.getAttribute("height")||0)}),q},circle:function(W,$){var q=new F;return u($,q),y(W,q,this._defs),q.setShape({cx:parseFloat(W.getAttribute("cx")||0),cy:parseFloat(W.getAttribute("cy")||0),r:parseFloat(W.getAttribute("r")||0)}),q},line:function(W,$){var q=new D;return u($,q),y(W,q,this._defs),q.setShape({x1:parseFloat(W.getAttribute("x1")||0),y1:parseFloat(W.getAttribute("y1")||0),x2:parseFloat(W.getAttribute("x2")||0),y2:parseFloat(W.getAttribute("y2")||0)}),q},ellipse:function(W,$){var q=new O;return u($,q),y(W,q,this._defs),q.setShape({cx:parseFloat(W.getAttribute("cx")||0),cy:parseFloat(W.getAttribute("cy")||0),rx:parseFloat(W.getAttribute("rx")||0),ry:parseFloat(W.getAttribute("ry")||0)}),q},polygon:function(W,$){var q=W.getAttribute("points");q&&(q=f(q));var fe=new T({shape:{points:q||[]}});return u($,fe),y(W,fe,this._defs),fe},polyline:function(W,$){var q=new m;u($,q),y(W,q,this._defs);var fe=W.getAttribute("points");fe&&(fe=f(fe));var se=new b({shape:{points:fe||[]}});return se},image:function(W,$){var q=new H;return u($,q),y(W,q,this._defs),q.setStyle({image:W.getAttribute("xlink:href"),x:W.getAttribute("x"),y:W.getAttribute("y"),width:W.getAttribute("width"),height:W.getAttribute("height")}),q},text:function(W,$){var q=W.getAttribute("x")||0,fe=W.getAttribute("y")||0,se=W.getAttribute("dx")||0,me=W.getAttribute("dy")||0;this._textX=parseFloat(q)+parseFloat(se),this._textY=parseFloat(fe)+parseFloat(me);var ve=new Y;return u($,ve),y(W,ve,this._defs),ve},tspan:function(W,$){var q=W.getAttribute("x"),fe=W.getAttribute("y");q!=null&&(this._textX=parseFloat(q)),fe!=null&&(this._textY=parseFloat(fe));var se=W.getAttribute("dx")||0,me=W.getAttribute("dy")||0,ve=new Y;return u($,ve),y(W,ve,this._defs),this._textX+=se,this._textY+=me,ve},path:function(W,$){var q=W.getAttribute("d")||"",fe=a(q);return u($,fe),y(W,fe,this._defs),fe}},p={lineargradient:function(W){var $=parseInt(W.getAttribute("x1")||0,10),q=parseInt(W.getAttribute("y1")||0,10),fe=parseInt(W.getAttribute("x2")||10,10),se=parseInt(W.getAttribute("y2")||0,10),me=new i($,q,fe,se);return l(W,me),me},radialgradient:function(W){}};function l(W,$){for(var q=W.firstChild;q;){if(q.nodeType===1){var fe=q.getAttribute("offset");fe.indexOf("%")>0?fe=parseInt(fe,10)/100:fe?fe=parseFloat(fe):fe=0;var se=q.getAttribute("stop-color")||"#000000";$.addColorStop(fe,se)}q=q.nextSibling}}function u(W,$){W&&W.__inheritedStyle&&($.__inheritedStyle||($.__inheritedStyle={}),h($.__inheritedStyle,W.__inheritedStyle))}function f(W){for(var $=g(W).split(A),q=[],fe=0;fe<$.length;fe+=2){var se=parseFloat($[fe]),me=parseFloat($[fe+1]);q.push([se,me])}return q}var _={fill:"fill",stroke:"stroke","stroke-width":"lineWidth",opacity:"opacity","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-miterlimit":"miterLimit","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","text-align":"textAlign","alignment-baseline":"textBaseline"};function y(W,$,q,fe){var se=$.__inheritedStyle||{},me=$.type==="text";if(W.nodeType===1&&(U(W,$),t(se,z(W)),!fe)){for(var ve in _)if(_.hasOwnProperty(ve)){var Ae=W.getAttribute(ve);Ae!=null&&(se[_[ve]]=Ae)}}var ge=me?"textFill":"fill",ue=me?"textStroke":"stroke";$.style=$.style||new d;var $e=$.style;se.fill!=null&&$e.set(ge,N(se.fill,q)),se.stroke!=null&&$e.set(ue,N(se.stroke,q)),C(["lineWidth","opacity","fillOpacity","strokeOpacity","miterLimit","fontSize"],function(Tt){var ye=Tt==="lineWidth"&&me?"textStrokeWidth":Tt;se[Tt]!=null&&$e.set(ye,parseFloat(se[Tt]))}),(!se.textBaseline||se.textBaseline==="auto")&&(se.textBaseline="alphabetic"),se.textBaseline==="alphabetic"&&(se.textBaseline="bottom"),se.textAlign==="start"&&(se.textAlign="left"),se.textAlign==="end"&&(se.textAlign="right"),C(["lineDashOffset","lineCap","lineJoin","fontWeight","fontFamily","fontStyle","textAlign","textBaseline"],function(Tt){se[Tt]!=null&&$e.set(Tt,se[Tt])}),se.lineDash&&($.style.lineDash=g(se.lineDash).split(A)),$e[ue]&&$e[ue]!=="none"&&($[ue]=!0),$.__inheritedStyle=se}var v=/url\(\s*#(.*?)\)/;function N(W,$){var q=$&&W&&W.match(v);if(q){var fe=g(q[1]),se=$[fe];return se}return W}var j=/(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.e,]*)\)/g;function U(W,$){var q=W.getAttribute("transform");if(q){q=q.replace(/,/g," ");var fe=null,se=[];q.replace(j,function(ge,ue,$e){se.push(ue,$e)});for(var me=se.length-1;me>0;me-=2){var ve=se[me],Ae=se[me-1];fe=fe||c.create();switch(Ae){case"translate":ve=g(ve).split(A),c.translate(fe,fe,[parseFloat(ve[0]),parseFloat(ve[1]||0)]);break;case"scale":ve=g(ve).split(A),c.scale(fe,fe,[parseFloat(ve[0]),parseFloat(ve[1]||ve[0])]);break;case"rotate":ve=g(ve).split(A),c.rotate(fe,fe,parseFloat(ve[0]));break;case"skew":ve=g(ve).split(A),console.warn("Skew transform is not supported yet");break;case"matrix":var ve=g(ve).split(A);fe[0]=parseFloat(ve[0]),fe[1]=parseFloat(ve[1]),fe[2]=parseFloat(ve[2]),fe[3]=parseFloat(ve[3]),fe[4]=parseFloat(ve[4]),fe[5]=parseFloat(ve[5]);break}}$.setLocalTransform(fe)}}var G=/([^\s:;]+)\s*:\s*([^:;]+)/g;function z(W){var $=W.getAttribute("style"),q={};if(!$)return q;var fe={};G.lastIndex=0;for(var se;(se=G.exec($))!=null;)fe[se[1]]=se[2];for(var me in _)_.hasOwnProperty(me)&&fe[me]!=null&&(q[_[me]]=fe[me]);return q}function L(W,$,q){var fe=$/W.width,se=q/W.height,me=Math.min(fe,se),ve=[me,me],Ae=[-(W.x+W.width/2)*me+$/2,-(W.y+W.height/2)*me+q/2];return{scale:ve,position:Ae}}function V(W,$){var q=new M;return q.parse(W,$)}re.parseXML=w,re.makeViewBoxTransform=L,re.parseSVG=V},MKOG:function(Ye,re,I){var Y=I("bYtY"),H=I("YH21"),P=H.Dispatcher,F=I("mLcG"),R=I("Bq2U"),O=function(m){m=m||{},this.stage=m.stage||{},this.onframe=m.onframe||function(){},this._clips=[],this._running=!1,this._time,this._pausedTime,this._pauseStart,this._paused=!1,P.call(this)};O.prototype={constructor:O,addClip:function(m){this._clips.push(m)},addAnimator:function(m){m.animation=this;for(var T=m.getClips(),b=0;b<T.length;b++)this.addClip(T[b])},removeClip:function(m){var T=Y.indexOf(this._clips,m);T>=0&&this._clips.splice(T,1)},removeAnimator:function(m){for(var T=m.getClips(),b=0;b<T.length;b++)this.removeClip(T[b]);m.animation=null},_update:function(){for(var m=new Date().getTime()-this._pausedTime,T=m-this._time,b=this._clips,i=b.length,d=[],c=[],r=0;r<i;r++){var a=b[r],s=a.step(m,T);s&&(d.push(s),c.push(a))}for(var r=0;r<i;)b[r]._needsRemove?(b[r]=b[i-1],b.pop(),i--):r++;i=d.length;for(var r=0;r<i;r++)c[r].fire(d[r]);this._time=m,this.onframe(T),this.trigger("frame",T),this.stage.update&&this.stage.update()},_startLoop:function(){var m=this;this._running=!0;function T(){m._running&&(F(T),!m._paused&&m._update())}F(T)},start:function(){this._time=new Date().getTime(),this._pausedTime=0,this._startLoop()},stop:function(){this._running=!1},pause:function(){this._paused||(this._pauseStart=new Date().getTime(),this._paused=!0)},resume:function(){this._paused&&(this._pausedTime+=new Date().getTime()-this._pauseStart,this._paused=!1)},clear:function(){this._clips=[]},isFinished:function(){return!this._clips.length},animate:function(m,T){T=T||{};var b=new R(m,T.loop,T.getter,T.setter);return this.addAnimator(b),b}},Y.mixin(O,P);var D=O;Ye.exports=D},NC18:function(Ye,re,I){var Y=I("y+Vt"),H=I("IMiH"),P=I("7oTu"),F=Math.sqrt,R=Math.sin,O=Math.cos,D=Math.PI,m=function(h){return Math.sqrt(h[0]*h[0]+h[1]*h[1])},T=function(h,g){return(h[0]*g[0]+h[1]*g[1])/(m(h)*m(g))},b=function(h,g){return(h[0]*g[1]<h[1]*g[0]?-1:1)*Math.acos(T(h,g))};function i(h,g,C,A,w,M,E,p,l,u,f){var _=l*(D/180),y=O(_)*(h-C)/2+R(_)*(g-A)/2,v=-1*R(_)*(h-C)/2+O(_)*(g-A)/2,N=y*y/(E*E)+v*v/(p*p);N>1&&(E*=F(N),p*=F(N));var j=(w===M?-1:1)*F((E*E*(p*p)-E*E*(v*v)-p*p*(y*y))/(E*E*(v*v)+p*p*(y*y)))||0,U=j*E*v/p,G=j*-p*y/E,z=(h+C)/2+O(_)*U-R(_)*G,L=(g+A)/2+R(_)*U+O(_)*G,V=b([1,0],[(y-U)/E,(v-G)/p]),W=[(y-U)/E,(v-G)/p],$=[(-1*y-U)/E,(-1*v-G)/p],q=b(W,$);T(W,$)<=-1&&(q=D),T(W,$)>=1&&(q=0),M===0&&q>0&&(q=q-2*D),M===1&&q<0&&(q=q+2*D),f.addData(u,z,L,E,p,V,q,_,M)}var d=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,c=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function r(h){if(!h)return new H;for(var g=0,C=0,A=g,w=C,M,E=new H,p=H.CMD,l=h.match(d),u=0;u<l.length;u++){for(var f=l[u],_=f.charAt(0),y,v=f.match(c)||[],N=v.length,j=0;j<N;j++)v[j]=parseFloat(v[j]);for(var U=0;U<N;){var G,z,L,V,W,$,q,fe=g,se=C;switch(_){case"l":g+=v[U++],C+=v[U++],y=p.L,E.addData(y,g,C);break;case"L":g=v[U++],C=v[U++],y=p.L,E.addData(y,g,C);break;case"m":g+=v[U++],C+=v[U++],y=p.M,E.addData(y,g,C),A=g,w=C,_="l";break;case"M":g=v[U++],C=v[U++],y=p.M,E.addData(y,g,C),A=g,w=C,_="L";break;case"h":g+=v[U++],y=p.L,E.addData(y,g,C);break;case"H":g=v[U++],y=p.L,E.addData(y,g,C);break;case"v":C+=v[U++],y=p.L,E.addData(y,g,C);break;case"V":C=v[U++],y=p.L,E.addData(y,g,C);break;case"C":y=p.C,E.addData(y,v[U++],v[U++],v[U++],v[U++],v[U++],v[U++]),g=v[U-2],C=v[U-1];break;case"c":y=p.C,E.addData(y,v[U++]+g,v[U++]+C,v[U++]+g,v[U++]+C,v[U++]+g,v[U++]+C),g+=v[U-2],C+=v[U-1];break;case"S":G=g,z=C;var me=E.len(),ve=E.data;M===p.C&&(G+=g-ve[me-4],z+=C-ve[me-3]),y=p.C,fe=v[U++],se=v[U++],g=v[U++],C=v[U++],E.addData(y,G,z,fe,se,g,C);break;case"s":G=g,z=C;var me=E.len(),ve=E.data;M===p.C&&(G+=g-ve[me-4],z+=C-ve[me-3]),y=p.C,fe=g+v[U++],se=C+v[U++],g+=v[U++],C+=v[U++],E.addData(y,G,z,fe,se,g,C);break;case"Q":fe=v[U++],se=v[U++],g=v[U++],C=v[U++],y=p.Q,E.addData(y,fe,se,g,C);break;case"q":fe=v[U++]+g,se=v[U++]+C,g+=v[U++],C+=v[U++],y=p.Q,E.addData(y,fe,se,g,C);break;case"T":G=g,z=C;var me=E.len(),ve=E.data;M===p.Q&&(G+=g-ve[me-4],z+=C-ve[me-3]),g=v[U++],C=v[U++],y=p.Q,E.addData(y,G,z,g,C);break;case"t":G=g,z=C;var me=E.len(),ve=E.data;M===p.Q&&(G+=g-ve[me-4],z+=C-ve[me-3]),g+=v[U++],C+=v[U++],y=p.Q,E.addData(y,G,z,g,C);break;case"A":L=v[U++],V=v[U++],W=v[U++],$=v[U++],q=v[U++],fe=g,se=C,g=v[U++],C=v[U++],y=p.A,i(fe,se,g,C,$,q,L,V,W,y,E);break;case"a":L=v[U++],V=v[U++],W=v[U++],$=v[U++],q=v[U++],fe=g,se=C,g+=v[U++],C+=v[U++],y=p.A,i(fe,se,g,C,$,q,L,V,W,y,E);break}}(_==="z"||_==="Z")&&(y=p.Z,E.addData(y),g=A,C=w),M=y}return E.toStatic(),E}function a(h,g){var C=r(h);return g=g||{},g.buildPath=function(A){if(A.setData){A.setData(C.data);var w=A.getContext();w&&A.rebuildPath(w)}else{var w=A;C.rebuildPath(w)}},g.applyTransform=function(A){P(C,A),this.dirty(!0)},g}function s(h,g){return new Y(a(h,g))}function o(h,g){return Y.extend(a(h,g))}function t(h,g){for(var C=[],A=h.length,w=0;w<A;w++){var M=h[w];M.path||M.createPathProxy(),M.__dirtyPath&&M.buildPath(M.path,M.shape,!0),C.push(M.path)}var E=new Y(g);return E.createPathProxy(),E.buildPath=function(p){p.appendPath(C);var l=p.getContext();l&&p.rebuildPath(l)},E}re.createFromString=s,re.extendFromString=o,re.mergePath=t},NLgs:function(Ye,re,I){"use strict";I.d(re,"e",function(){return g}),I.d(re,"f",function(){return C}),I.d(re,"d",function(){return w}),I.d(re,"c",function(){return M}),I.d(re,"a",function(){return E}),I.d(re,"b",function(){return p});var Y=I("miYZ"),H=I("tsqr"),P=I("9og8"),F=I("2qtc"),R=I("kLXV"),O=I("WmNS"),D=I.n(O),m=I("q1tI"),T=I.n(m),b=I("9kvl"),i=I("xKgJ"),d=I("1vsH"),c=I("RCxd"),r=I("yTi+"),a=I.n(r),s=I("1ZF9"),o=I.n(s),t=I("NoGO"),h=I.n(t),g=function(u){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(C(u)&&A(f))},C=function(u){return Object(i.p)()?!0:(u({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},A=function(){var u,f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,_=Object(b.c)()._store.getState(),y=_.user;return(u=y.userInfo)!==null&&u!==void 0&&u.profile_completed?!0:(R.a.confirm({title:"\u63D0\u793A",width:530,centered:!0,content:f?"\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(){b.d.push("/account/profile/edit")}}),!1)},w=function(){var u,f=Object(b.c)()._store.getState(),_=f.user;return(u=_.userInfo)!==null&&u!==void 0&&u.professional_certification?!0:(R.a.confirm({title:"\u63D0\u793A",centered:!0,content:T.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(d.S)("/account/certification")}}),!1)},M=function(){return Object(i.a)()?!0:(R.a.warning({centered:!0,width:530,title:"\u63D0\u793A",content:T.a.createElement("div",{className:"tc",style:{marginLeft:-38}},T.a.createElement("p",null,"\u626B\u7801\u52A0\u5934\u6B4C\u52A9\u6559\uFF0C\u7533\u8BF7\u64CD\u4F5C\u6743\u9650"),T.a.createElement("img",{src:h.a,width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1)},E=function(u,f){return u?!0:(R.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:T.a.createElement("div",null,T.a.createElement("p",null,f||"\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"),T.a.createElement("div",{style:{marginLeft:"110px"}},T.a.createElement("img",{src:o.a,width:200}),T.a.createElement("div",{style:{marginLeft:"35px"}},"\u7FA4\u53F7\uFF1A","714336072"))),okText:"\u7ACB\u5373\u8054\u7CFB",cancelText:"\u53D6\u6D88",onOk:function(){Object(d.S)("https://qm.qq.com/cgi-bin/qm/qr?k=tIyDPXUtE0yEk-MOJxhH55lTUJS-nYAM&jump_from=webapi")}}),!1)},p=function(u){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",_=Object(b.c)()._store.getState(),y=_.shixunsDetail.detail;return(y==null?void 0:y.public)===2||(y==null?void 0:y.public)===1||(y==null?void 0:y.shixun_status)===3?(R.a.info({centered:!0,icon:T.a.createElement(c.a,{style:{color:"#faad14"}}),width:460,title:"\u63D0\u793A",content:T.a.createElement("div",{className:"tc",style:{marginLeft:-38}},T.a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",paddingLeft:38,margin:"12px 0"}},T.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u72B6\u6001\u4E3A",(y==null?void 0:y.public)===2?"\u5DF2\u516C\u5F00":(y==null?void 0:y.public)===1?"\u5F85\u5BA1\u6838":"\u5DF2\u5173\u95ED","\uFF0C",f,"\u3002"),T.a.createElement("p",null,"\u5982\u6709\u9700\u8981\uFF0C\u8BF7\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u8FDB\u884C\u6280\u672F\u652F\u6301\u3002")),T.a.createElement("img",{style:{border:"4px solid #0152d9",borderRadius:"4px"},src:a.a,alt:"\u4E8C\u7EF4\u7801",width:160})),okText:"\u6211\u77E5\u9053\u4E86"}),!0):(y==null?void 0:y.shixun_status)===2?(R.a.confirm({centered:!0,icon:T.a.createElement(c.a,null),title:"\u63D0\u793A",content:T.a.createElement("div",null,T.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5DF2\u53D1\u5E03\uFF0C",f,"\u3002"),T.a.createElement("br",null),T.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(){R.a.confirm({width:440,centered:!0,icon:T.a.createElement(c.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 N=Object(P.a)(D.a.mark(function U(){var G;return D.a.wrap(function(L){for(;;)switch(L.prev=L.next){case 0:return L.next=2,u({type:"shixunsDetail/cancelRelease",payload:{id:y==null?void 0:y.identifier}});case 2:G=L.sent,G.status!==401&&(H.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F\u3002\u5B9E\u8BAD\u56DE\u5230\u672A\u53D1\u5E03\u7684\u72B6\u6001\u3002"),u({type:"shixunsDetail/getShixunsDetail",payload:{id:y==null?void 0:y.identifier}}),u({type:"practiceSetting/getCommonData",payload:{id:y==null?void 0:y.identifier}}));case 4:case"end":return L.stop()}},U)}));function j(){return N.apply(this,arguments)}return j}()})}}),!0):!1}},NoGO:function(Ye,re,I){Ye.exports=I.p+"static/newqrcode.d852fdfc.png"},NohK:function(Ye,re,I){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;var Y=function(P){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:60,R=null;return function(){for(var O=this,D=arguments.length,m=new Array(D),T=0;T<D;T++)m[T]=arguments[T];clearTimeout(R),R=setTimeout(function(){P.apply(O,m)},F)}};re.default=Y},NvD2:function(Ye,re,I){"use strict";I.d(re,"a",function(){return O});var Y=I("Kwbf");function H(D,m){var T=new Set;return D.forEach(function(b){m.has(b)||T.add(b)}),T}function P(D){var m=D||{},T=m.disabled,b=m.disableCheckbox,i=m.checkable;return!!(T||b)||i===!1}function F(D,m,T,b){for(var i=new Set(D),d=new Set,c=0;c<=T;c+=1){var r=m.get(c)||new Set;r.forEach(function(t){var h=t.key,g=t.node,C=t.children,A=C===void 0?[]:C;i.has(h)&&!b(g)&&A.filter(function(w){return!b(w.node)}).forEach(function(w){i.add(w.key)})})}for(var a=new Set,s=T;s>=0;s-=1){var o=m.get(s)||new Set;o.forEach(function(t){var h=t.parent,g=t.node;if(b(g)||!t.parent||a.has(t.parent.key))return;if(b(t.parent.node)){a.add(h.key);return}var C=!0,A=!1;(h.children||[]).filter(function(w){return!b(w.node)}).forEach(function(w){var M=w.key,E=i.has(M);C&&!E&&(C=!1),!A&&(E||d.has(M))&&(A=!0)}),C&&i.add(h.key),A&&d.add(h.key),a.add(h.key)})}return{checkedKeys:Array.from(i),halfCheckedKeys:Array.from(H(d,i))}}function R(D,m,T,b,i){for(var d=new Set(D),c=new Set(m),r=0;r<=b;r+=1){var a=T.get(r)||new Set;a.forEach(function(h){var g=h.key,C=h.node,A=h.children,w=A===void 0?[]:A;!d.has(g)&&!c.has(g)&&!i(C)&&w.filter(function(M){return!i(M.node)}).forEach(function(M){d.delete(M.key)})})}c=new Set;for(var s=new Set,o=b;o>=0;o-=1){var t=T.get(o)||new Set;t.forEach(function(h){var g=h.parent,C=h.node;if(i(C)||!h.parent||s.has(h.parent.key))return;if(i(h.parent.node)){s.add(g.key);return}var A=!0,w=!1;(g.children||[]).filter(function(M){return!i(M.node)}).forEach(function(M){var E=M.key,p=d.has(E);A&&!p&&(A=!1),!w&&(p||c.has(E))&&(w=!0)}),A||d.delete(g.key),w&&c.add(g.key),s.add(g.key)})}return{checkedKeys:Array.from(d),halfCheckedKeys:Array.from(H(c,d))}}function O(D,m,T,b){var i=[],d;b?d=b:d=P;var c=new Set(D.filter(function(o){var t=!!T[o];return t||i.push(o),t})),r=new Map,a=0;Object.keys(T).forEach(function(o){var t=T[o],h=t.level,g=r.get(h);g||(g=new Set,r.set(h,g)),g.add(t),a=Math.max(a,h)}),Object(Y.a)(!i.length,"Tree missing follow keys: ".concat(i.slice(0,100).map(function(o){return"'".concat(o,"'")}).join(", ")));var s;return m===!0?s=F(c,r,a,d):s=R(c,m.halfCheckedKeys,r,a,d),s}},OLES:function(Ye,re,I){"use strict";var Y=I("U8pU"),H=I("VTBJ"),P=I("Ff2n"),F=I("q1tI"),R=I("uciX"),O=I("7ixt"),D=function(c){var r=c.overlay,a=c.prefixCls,s=c.id,o=c.overlayInnerStyle;return F.createElement("div",{className:"".concat(a,"-inner"),id:s,role:"tooltip",style:o},typeof r=="function"?r():r)},m=D,T=function(c,r){var a=c.overlayClassName,s=c.trigger,o=s===void 0?["hover"]:s,t=c.mouseEnterDelay,h=t===void 0?0:t,g=c.mouseLeaveDelay,C=g===void 0?.1:g,A=c.overlayStyle,w=c.prefixCls,M=w===void 0?"rc-tooltip":w,E=c.children,p=c.onVisibleChange,l=c.afterVisibleChange,u=c.transitionName,f=c.animation,_=c.placement,y=_===void 0?"right":_,v=c.align,N=v===void 0?{}:v,j=c.destroyTooltipOnHide,U=j===void 0?!1:j,G=c.defaultVisible,z=c.getTooltipContainer,L=c.overlayInnerStyle,V=Object(P.a)(c,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),W=Object(F.useRef)(null);Object(F.useImperativeHandle)(r,function(){return W.current});var $=Object(H.a)({},V);"visible"in c&&($.popupVisible=c.visible);var q=function(){var Ae=c.arrowContent,ge=Ae===void 0?null:Ae,ue=c.overlay,$e=c.id;return[F.createElement("div",{className:"".concat(M,"-arrow"),key:"arrow"},ge),F.createElement(m,{key:"content",prefixCls:M,id:$e,overlay:ue,overlayInnerStyle:L})]},fe=!1,se=!1;if(typeof U=="boolean")fe=U;else if(U&&Object(Y.a)(U)==="object"){var me=U.keepParent;fe=me===!0,se=me===!1}return F.createElement(R.a,Object.assign({popupClassName:a,prefixCls:M,popup:q,action:o,builtinPlacements:O.a,popupPlacement:y,ref:W,popupAlign:N,getPopupContainer:z,onPopupVisibleChange:p,afterPopupVisibleChange:l,popupTransitionName:u,popupAnimation:f,defaultPopupVisible:G,destroyPopupOnHide:fe,autoDestroy:se,mouseLeaveDelay:C,popupStyle:A,mouseEnterDelay:h},$),E)},b=Object(F.forwardRef)(T),i=re.a=b},OS9S:function(Ye,re,I){var Y=I("bYtY"),H=Y.inherits,P=I("Gev7"),F=I("mFDi");function R(m){P.call(this,m),this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.notClear=!0}R.prototype.incremental=!0,R.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.dirty(),this.notClear=!1},R.prototype.addDisplayable=function(m,T){T?this._temporaryDisplayables.push(m):this._displayables.push(m),this.dirty()},R.prototype.addDisplayables=function(m,T){T=T||!1;for(var b=0;b<m.length;b++)this.addDisplayable(m[b],T)},R.prototype.eachPendingDisplayable=function(m){for(var T=this._cursor;T<this._displayables.length;T++)m&&m(this._displayables[T]);for(var T=0;T<this._temporaryDisplayables.length;T++)m&&m(this._temporaryDisplayables[T])},R.prototype.update=function(){this.updateTransform();for(var m=this._cursor;m<this._displayables.length;m++){var T=this._displayables[m];T.parent=this,T.update(),T.parent=null}for(var m=0;m<this._temporaryDisplayables.length;m++){var T=this._temporaryDisplayables[m];T.parent=this,T.update(),T.parent=null}},R.prototype.brush=function(m,T){for(var b=this._cursor;b<this._displayables.length;b++){var i=this._displayables[b];i.beforeBrush&&i.beforeBrush(m),i.brush(m,b===this._cursor?null:this._displayables[b-1]),i.afterBrush&&i.afterBrush(m)}this._cursor=b;for(var b=0;b<this._temporaryDisplayables.length;b++){var i=this._temporaryDisplayables[b];i.beforeBrush&&i.beforeBrush(m),i.brush(m,b===0?null:this._temporaryDisplayables[b-1]),i.afterBrush&&i.afterBrush(m)}this._temporaryDisplayables=[],this.notClear=!0};var O=[];R.prototype.getBoundingRect=function(){if(!this._rect){for(var m=new F(Infinity,Infinity,-Infinity,-Infinity),T=0;T<this._displayables.length;T++){var b=this._displayables[T],i=b.getBoundingRect().clone();b.needLocalTransform()&&i.applyTransform(b.getLocalTransform(O)),m.union(i)}this._rect=m}return this._rect},R.prototype.contain=function(m,T){var b=this.transformCoordToLocal(m,T),i=this.getBoundingRect();if(i.contain(b[0],b[1]))for(var d=0;d<this._displayables.length;d++){var c=this._displayables[d];if(c.contain(m,T))return!0}return!1},H(R,P);var D=R;Ye.exports=D},OZM5:function(Ye,re,I){"use strict";I.d(re,"b",function(){return b}),I.d(re,"a",function(){return i}),I.d(re,"k",function(){return d}),I.d(re,"h",function(){return c}),I.d(re,"i",function(){return r}),I.d(re,"g",function(){return a}),I.d(re,"c",function(){return s}),I.d(re,"d",function(){return o}),I.d(re,"j",function(){return g}),I.d(re,"e",function(){return C}),I.d(re,"f",function(){return A});var Y=I("KQm4"),H=I("U8pU"),P=I("Ff2n"),F=I("q1tI"),R=I.n(F),O=I("Kwbf"),D=I("WaYH"),m=.25,T=2;function b(w,M){var E=w.slice(),p=E.indexOf(M);return p>=0&&E.splice(p,1),E}function i(w,M){var E=w.slice();return E.indexOf(M)===-1&&E.push(M),E}function d(w){return w.split("-")}function c(w,M){return"".concat(w,"-").concat(M)}function r(w){return w&&w.type&&w.type.isTreeNode}function a(w,M){var E=[w],p=M[w];function l(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];u.forEach(function(f){var _=f.key,y=f.children;E.push(_),l(y)})}return l(p.children),E}function s(w,M){var E=w.clientY,p=M.selectHandle.getBoundingClientRect(),l=p.top,u=p.bottom,f=p.height,_=Math.max(f*m,T);return E<=l+_?-1:E>=u-_?1:0}function o(w,M){if(!w)return;var E=M.multiple;return E?w.slice():w.length?[w[0]]:w}var t=function(M){return M};function h(w,M){if(!w)return[];var E=M||{},p=E.processProps,l=p===void 0?t:p,u=Array.isArray(w)?w:[w];return u.map(function(f){var _=f.children,y=Object(P.a)(f,["children"]),v=h(_,M);return R.a.createElement(D.a,Object.assign({},l(y)),v)})}function g(w){if(!w)return null;var M;if(Array.isArray(w))M={checkedKeys:w,halfCheckedKeys:void 0};else if(Object(H.a)(w)==="object")M={checkedKeys:w.checked||void 0,halfCheckedKeys:w.halfChecked||void 0};else return Object(O.a)(!1,"`checkedKeys` is not an array or an object"),null;return M}function C(w,M){var E=new Set;function p(l){if(E.has(l))return;var u=M[l];if(!u)return;E.add(l);var f=u.parent,_=u.node;if(_.disabled)return;f&&p(f.key)}return(w||[]).forEach(function(l){p(l)}),Object(Y.a)(E)}function A(w){var M={};return Object.keys(w).forEach(function(E){(E.startsWith("data-")||E.startsWith("aria-"))&&(M[E]=w[E])}),M}},Ot1p:function(Ye,re,I){"use strict";var Y=I("2qtc"),H=I("kLXV"),P=I("rAM+"),F=I("miYZ"),R=I("tsqr"),O=I("9og8"),D=I("tJVT"),m=I("jrin"),T=I("WmNS"),b=I.n(T),i=I("q1tI"),d=I.n(i),c=I("VrN/"),r=I.n(c),a=I("bdgK"),s=I("p77/"),o=I("Bd2K"),t=I("ELLl"),h=I("19Vz"),g=I("lZu9"),C=I("+NIl"),A=I("kSUc"),w=I("9Bee"),M=function(Ce){var Be=Ce.value,yt=Be===void 0?"":Be,Xt=Ce.className,an=Ce.showTextOnly,pt=Ce.showLines,Yt=Ce.style,St=Yt===void 0?{}:Yt,Ot=Object(i.useMemo)(function(){return""},[yt]);return d.a.createElement(d.a.Fragment,null,d.a.createElement("div",{dangerouslySetInnerHTML:{__html:Ot}}))},E=I("0Owb"),p=I("dejd"),l=I("C+DQ"),u=I("1vsH"),f=I("m3rI"),_=[{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 y(Ce){var Be=Ce.onActionCallback,yt=Ce.title,Xt=Ce.icon,an=Ce.actionName,pt=Ce.className,Yt=pt===void 0?"":pt,St=Ce.children;function Ot(){Be(an)}return d.a.createElement("a",{title:yt,className:Yt,onClick:Ot},d.a.createElement("i",{className:"md-iconfont ".concat(Xt)}),St)}var v=function(Ce){var Be=Ce.watch,yt=Ce.showNullButton,Xt=Ce.onActionCallback,an=Ce.fullScreen,pt=Ce.insertTemp,Yt=Ce.hidetoolBar,St=Ce.uuid,Ot=Ce.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(u.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(u.F)("_educoder_session"),"&key=").concat(St,"&api=").concat(encodeURIComponent(f.a.PROXY_SERVER)));var dt=[].concat(_,[{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 d.a.createElement("ul",{className:"markdown-toolbar-container"},!Yt&&dt.map(function(_e,je){return d.a.createElement("li",{key:je},_e.actionName?d.a.createElement(y,Object(E.a)({},_e,{onActionCallback:Xt})):d.a.createElement("span",{className:"v-line"}))}),yt?d.a.createElement("li",null,d.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Xt},d.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,pt&&d.a.createElement("li",null,d.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(pt),onActionCallback:Xt},d.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),d.a.createElement("li",{className:"btn-full-screen"},d.a.createElement(y,{icon:"".concat(an?"icon-shrink":"icon-enlarge"),title:an?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Xt})))},N=I("M8RZ"),j=I("+L6B"),U=I("2/Rp"),G=I("y8nQ"),z=I("Vl3Y"),L=I("5NDa"),V=I("5rEg"),W={labelCol:{span:4},wrapperCol:{span:20}},$=function(Ce){var Be=Ce.callback,yt=Ce.onCancel;function Xt(an){Be(an)}return d.a.createElement(z.a,Object(E.a)({},W,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Xt}),d.a.createElement(z.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},d.a.createElement(V.a,null)),d.a.createElement(z.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},d.a.createElement(V.a,null)),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement(U.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),d.a.createElement(U.a,{type:"ghost",onClick:yt},"\u53D6\u6D88")))},q=I("7ahc"),fe=I("HmJG"),se=I("BjJ7"),me=z.a.useForm,ve={width:280,marginRight:10},Ae={labelCol:{span:5},wrapperCol:{span:19}},ge=function(Ce){var Be=Ce.callback,yt=Ce.onCancel,Xt=me(),an=Object(D.a)(Xt,1),pt=an[0];function Yt(dt){Be(dt)}function St(dt,_e){if(dt.status===-1){R.b.error(dt.message);return}pt.setFieldsValue({src:"/api/attachments/".concat(dt.id),type:_e.type})}function Ot(dt){var _e=dt.target.files[0];$e(_e,St)}return d.a.createElement(z.a,Object(E.a)({form:pt},Ae,{className:"upload-image-panel",onFinish:Yt}),d.a.createElement(z.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},d.a.createElement("div",{className:"flex-container"},d.a.createElement(z.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},d.a.createElement(V.a,{style:ve})),d.a.createElement(ue,{onFileChange:Ot}))),d.a.createElement(z.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},d.a.createElement(V.a,{style:{width:264}})),d.a.createElement(z.a.Item,{style:{textAlign:"right"}},d.a.createElement(U.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),d.a.createElement(U.a,{type:"ghost",onClick:yt},"\u53D6\u6D88")))};function ue(Ce){var Be=Ce.onFileChange;return d.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",d.a.createElement("input",{type:"file",onChange:Be}))}function $e(Ce,Be){if(!Ce)throw new String("\u6CA1\u6709\u6587\u4EF6");var yt=new FormData;yt.append("editormd-image-file",Ce),yt.append("file_param_name","editormd-image-file"),yt.append("byxhr","true");var Xt=new window.XMLHttpRequest;Xt.withCredentials=!0,Xt.addEventListener("load",function(an){Be(JSON.parse(an.target.responseText),Ce)},!1),Xt.addEventListener("error",function(an){console.error(an)},!1),Xt.open("POST","".concat(se.a,"/api/attachments.json")),Xt.send(yt)}var Tt=I("giR+"),ye=I("fyUT"),Re=I("7Kak"),nt=I("9yH6"),Ue=nt.a.Group,ke={margin:"0 8px"},lt=function(Ce){var Be=Ce.callback,yt=Ce.onCancel;function Xt(an){Be(an)}return d.a.createElement(z.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Xt},d.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},d.a.createElement("span",{style:ke},"\u5355\u5143\u683C\u6570\uFF1A"),d.a.createElement("span",{style:ke},"\u884C\u6570"),d.a.createElement(z.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},d.a.createElement(ye.a,null)),d.a.createElement("span",{style:ke},"\u5217\u6570"),d.a.createElement(z.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},d.a.createElement(ye.a,null))),d.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},d.a.createElement("span",{style:ke},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),d.a.createElement(z.a.Item,{name:"align"},d.a.createElement(Ue,null,d.a.createElement(nt.a,{value:"default"},d.a.createElement("i",{className:"fa fa-align-justify"})),d.a.createElement(nt.a,{value:"left"},d.a.createElement("i",{className:"fa fa-align-left"})),d.a.createElement(nt.a,{value:"center"},d.a.createElement("i",{className:"fa fa-align-center"})),d.a.createElement(nt.a,{value:"right"},d.a.createElement("i",{className:"fa fa-align-right"}))))),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement(U.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),d.a.createElement(U.a,{type:"ghost",onClick:yt},"\u53D6\u6D88")))},Fe=I("ErOA"),Ze=I("7Cbv"),Xe="link",ft="upload-image",Rt="code-block",Pt="add-table",Bt="------------",Ve={default:Bt,left:":".concat(Bt),center:":".concat(Bt,":"),right:"".concat(Bt,":")},Ft=I("9VGf"),nn,Le;function Se(){}var ut=0,mt=1e4,We="\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 Pe(Ce){return/^\d+$/.test(Ce)?"".concat(Ce,"px"):Ce}var xe=navigator.platform.toUpperCase().indexOf("MAC")>=0,we=xe?"Cmd":"Ctrl",ie=["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"],ae=(nn={},Object(m.a)(nn,we+"-B","bold"),Object(m.a)(nn,we+"-I","italic"),nn),ce=(Le={},Object(m.a)(Le,Xe,"\u6DFB\u52A0\u94FE\u63A5"),Object(m.a)(Le,Rt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(m.a)(Le,ft,"\u6DFB\u52A0\u6587\u4EF6"),Object(m.a)(Le,Pt,"\u6DFB\u52A0\u8868\u683C"),Le),be=re.a=function(Ce){var Be=Ce.defaultValue,yt=Be===void 0?"":Be,Xt=Ce.onChange,an=Ce.width,pt=an===void 0?"100%":an,Yt=Ce.height,St=Yt===void 0?400:Yt,Ot=Ce.miniToolbar,dt=Ot===void 0?!1:Ot,_e=Ce.isFocus,je=_e===void 0?!1:_e,kt=Ce.watch,gt=Ce.insertTemp,zt=Ce.mode,$t=zt===void 0?"markdown":zt,De=Ce.id,qe=De===void 0?"markdown-editor-id":De,jt=Ce.showResizeBar,Zt=jt===void 0?!1:jt,gn=Ce.noStorage,On=gn===void 0?!1:gn,ur=Ce.showNullButton,Kn=ur===void 0?!1:ur,wn=Ce.hidetoolBar,xr=wn===void 0?!1:wn,Fr=Ce.fullScreen,hr=Fr===void 0?!1:Fr,dr=Ce.onBlur,Nr=Ce.onCMBeforeChange,ti=Ce.onFullScreen,pi=Ce.className,fn=pi===void 0?"":pi,ar=Ce.disablePaste,oi=ar===void 0?!1:ar,_i=Ce.placeholder,Qr=_i===void 0?"":_i,ni=Ce.values,ee=ni===void 0?"":ni,B=Object(i.useState)(null),K=Object(D.a)(B,2),Q=K[0],le=K[1],Z=Object(i.useState)(yt),Qe=Object(D.a)(Z,2),qt=Qe[0],An=Qe[1],Vn=Object(i.useState)(kt),sn=Object(D.a)(Vn,2),tr=sn[0],vn=sn[1],ln=Object(i.useState)(hr),xn=Object(D.a)(ln,2),In=xn[0],sr=xn[1],$n=Object(i.useState)(""),Zn=Object(D.a)($n,2),kn=Zn[0],mr=Zn[1],Fn=Object(i.useState)(0),nr=Object(D.a)(Fn,2),Gn=nr[0],Hn=nr[1],Sr=Object(i.useState)(St),wr=Object(D.a)(Sr,2),br=wr[0],Er=wr[1],te=Object(i.useState)(!1),Te=Object(D.a)(te,2),Ge=Te[0],Me=Te[1],st=Object(i.useRef)(Object(Ze.a)()),Je=Object(i.useRef)(!1),ct=Object(i.useRef)(),ht=Object(i.useRef)(),at=Object(i.useRef)(),Mt=Object(i.useRef)(),Gt=Object(i.useRef)(),Vt=function(){var xt=Object(O.a)(b.a.mark(function bt(){var Lt,At;return b.a.wrap(function(mn){for(;;)switch(mn.prev=mn.next){case 0:return mn.next=2,Object(Fe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:st.current}});case 2:At=mn.sent,At!=null&&(Lt=At.attachments)!==null&&Lt!==void 0&&Lt.length&&(console.log("cm:",Q,ht),At.attachments.map(function(cn){cn.content_type.indexOf("image")>-1?Q.replaceSelection(".concat(cn.content_type,")")):cn.content_type.indexOf("video")>-1?Q.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):cn.content_type.indexOf("pdf")>-1?Q.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(cn.id,"?type=").concat(cn.content_type,'&disposition=inline" target="_blank">').concat(cn.name,"</a>")):Q.replaceSelection("[".concat(cn.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(cn.id,"?type=").concat(cn.content_type,")"))}));case 4:case"end":return mn.stop()}},bt)}));return function(){return xt.apply(this,arguments)}}();Object(i.useEffect)(function(){An(ee),Q==null||Q.setValue(ee)},[ee]),Object(i.useEffect)(function(){ti==null||ti(In)},[In]),Object(i.useEffect)(function(){if(ht.current){var xt=r.a.fromTextArea(ht.current,{mode:$t,lineNumbers:!dt,lineWrapping:!0,value:yt,autoCloseTags:!0,autoCloseBrackets:!0});je&&xt.focus();function bt(Lt,At){if(oi){At.preventDefault();return}var Et=At.clipboardData;if(Et){var mn=Et.types.toString(),cn=Et.items;if(mn==="Files"||Et.types.indexOf("Files")>-1){if(At.preventDefault(),$t=="stex")return;try{var _n,un=cn[1];((_n=cn[0])===null||_n===void 0?void 0:_n.kind)==="file"&&(un=cn[0]);var rn=un.getAsFile(),Cn=rn.name.split(".").pop();$e(rn,function(rr){if(rr.id){var cr,zn,Dr;(rn==null||((cr=rn.type)===null||cr===void 0)?void 0:cr.indexOf("image"))>-1?xt.replaceSelection(".concat(rr.content_type,")")):(rn==null||((zn=rn.type)===null||zn===void 0)?void 0:zn.indexOf("video"))>-1?xt.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(rr.id,'"></video>')):(rn==null||((Dr=rn.type)===null||Dr===void 0)?void 0:Dr.indexOf("pdf"))>-1?xt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(rr.id,"?type=").concat(rn.type,'&disposition=inline" target="_blank">').concat(rn.name,"</a>")):ie.includes(Cn)?xt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(rr.id,'?type=office&disposition=inline" target="_blank">').concat(rn.name,"</a>")):xt.replaceSelection("[".concat(rn.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(rr.id,"?type=").concat(rr.content_type,")"))}else(rr==null?void 0:rr.status)===401&&(document.location.href="/user/login")})}catch(rr){R.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return xt.on("paste",bt),xt.on("dragleave",function(Lt,At){at.current.classList.remove("mouse-hover-md")}),xt.on("dragover",function(Lt,At){at.current.classList.add("mouse-hover-md")}),xt.on("drop",function(Lt,At){at.current.classList.add("mouse-hover-md");var Et;if(Et=At.dataTransfer.files,Et.length>0){At.preventDefault(),At.stopPropagation();for(var mn=function(un){var rn=Et[un],Cn=rn.name.split(".").pop();$e(rn,function(rr){if(rr.id){var cr,zn,Dr;(rn==null||((cr=rn.type)===null||cr===void 0)?void 0:cr.indexOf("image"))>-1?xt.replaceSelection(".concat(rr.content_type,")")):(rn==null||((zn=rn.type)===null||zn===void 0)?void 0:zn.indexOf("video"))>-1?xt.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(rr.id,'"></video>')):(rn==null||((Dr=rn.type)===null||Dr===void 0)?void 0:Dr.indexOf("pdf"))>-1?xt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(rr.id,"?type=").concat(rn.type,'&disposition=inline" target="_blank">').concat(rn.name,"</a>")):ie.includes(Cn)?xt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(rr.id,'?type=office&disposition=inline" target="_blank">').concat(rn.name,"</a>")):xt.replaceSelection("[".concat(rn.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(rr.id,"?type=").concat(rr.content_type,")"))}else(rr==null?void 0:rr.status)===401&&(document.location.href="/user/login")})},cn=0;cn<Et.length;cn++)mn(cn)}}),le(xt),function(){xt.off("paste",bt)}}},[]);var wt=Object(i.useCallback)(function(){if(at.current)try{}catch(xt){console.log(xt,"---- to set md editor body height")}},[br,at,In]);Object(i.useEffect)(function(){function xt(){var Lt=new a.default(function(At){var Et=Object(P.a)(At),mn;try{for(Et.s();!(mn=Et.n()).done;){var cn=mn.value;(cn.target.offsetHeight>0||cn.target.offsetWidth>0)&&(wt(),Q.setSize("100%","100%"),Q.refresh())}}catch(_n){Et.e(_n)}finally{Et.f()}});return Lt.observe(ht.current.parentElement),Lt}if(Q){var bt=xt();return function(){bt.unobserve(ht.current.parentElement)}}},[Q,wt]),Object(i.useEffect)(function(){if(Q){for(var xt=[],bt=function(){var cn=At[Lt];Et=Object(D.a)(cn,2);var _n=Et[0],un=Et[1],rn=Object(m.a)({},_n,function(){Nt(un)});xt.push(rn),Q.addKeyMap(rn)},Lt=0,At=Object.entries(ae);Lt<At.length;Lt++){var Et;bt()}return ct.current=setInterval(function(){Je.current&&Vt()},4e3),function(){clearInterval(ct.current);var mn=Object(P.a)(xt),cn;try{for(mn.s();!(cn=mn.n()).done;){var _n=cn.value;Q.removeKeyMap(_n)}}catch(un){mn.e(un)}finally{mn.f()}}}},[Q]),Object(i.useEffect)(function(){hr!==In&&sr(hr)},[hr]),Object(Ft.a)(function(){if(!On&&Gn>0){var xt=new Date().getTime(),bt=window.sessionStorage.getItem(qe);xt>=Gn+mt&&(!bt||bt!==qt)&&(window.sessionStorage.setItem(qe,qt),Me(!0))}},mt),Object(i.useEffect)(function(){vn(kt)},[Q,kt]),Object(i.useEffect)(function(){Q&&(je&&Q.focus())},[Q,je]),Object(i.useEffect)(function(){if(tr&&Q){var xt=Q.getScrollerElement();function bt(Lt){var At=Lt.target;if(Gt.current){var Et=At.scrollTop/At.scrollHeight;Gt.current.scrollTop=Gt.current.scrollHeight*Et}}return xt.addEventListener("scroll",bt),function(){xt.removeEventListener("scroll",bt)}}},[Q,tr]),Object(i.useEffect)(function(){if(Q&&Nr){function xt(bt,Lt){Nr(bt,Lt)}return Q.on("beforeChange",xt),function(){Q.off("beforeChange",xt)}}},[Q,Nr]),Object(i.useEffect)(function(){if(Q&&dr){function xt(){dr(Q.getValue())}return Q.on("blur",xt),function(){Q.off("blur",xt)}}},[Q,dr]),Object(i.useEffect)(function(){if(Q){function xt(bt){var Lt=bt.getValue();An(Lt),Hn(new Date().getTime()),bt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Xt&&Xt(Lt)}return Q.on("change",xt),function(){Q.off("change",xt)}}},[Q,Xt]),Object(i.useEffect)(function(){Q&&(yt==null?(Q.setValue(""),An("")):yt!==Q.getValue()&&(Q.setValue(yt),An(yt),Q.setCursor(Q.lineCount(),0)))},[Q,yt]);var Nt=Object(i.useCallback)(function(xt){var bt=Q.getCursor(),Lt=Q.getSelection(),At=Lt.split(`
|
|
`);switch(xt){case"bold":return Q.replaceSelection("**"+Lt+"**"),Lt===""&&Q.setCursor(bt.line,bt.ch+2),Q.focus();case"italic":return Q.replaceSelection("*"+Lt+"*"),Lt===""&&Q.setCursor(bt.line,bt.ch+1),Q.focus();case"code":return Q.replaceSelection("`"+Lt+"`"),Lt===""&&Q.setCursor(bt.line,bt.ch+1),Q.focus();case"inline-latex":return Q.replaceSelection("`$$"+Lt+"$$`"),Lt===""&&Q.setCursor(bt.line,bt.ch+3),Q.focus();case"latex":return Q.replaceSelection("```latex\n"+Lt+"\n```"),Q.setCursor(bt.line+1,Lt.length+1),Q.focus();case"line-break":return Q.replaceSelection(`<br/>
|
|
`),Q.focus();case"list-ul":return Lt===""?Q.replaceSelection("- "+Lt):Q.replaceSelection(At.map(function(Et){return Et===""?"":"- ".concat(Et)}).join(`
|
|
`)),Q.focus();case"list-ol":return Lt===""?Q.replaceSelection("1. "+Lt):Q.replaceSelection(At.map(function(Et,mn){return Et===""?"":"".concat(mn+1,". ").concat(Et)}).join(`
|
|
`)),Q.focus();case"add-null-ch":return Lt===""&&Q.setCursor(bt.line,bt.ch+1),Q.replaceSelection(We),Q.focus();case"inster-template-1":return Lt===""&&Q.setCursor(bt.line,bt.ch),Q.replaceSelection(vt),Q.focus();case"eraser":return Q.setValue(""),Q.focus();case"trigger-watch":return vn(!tr),Q.focus();case"trigger-full-screen":return sr(!In),Q.focus();case Xe:mr(Xe);return;case Rt:mr(Rt);return;case ft:mr(ft);return;case Pt:mr(Pt);return;default:throw new Error}},[Q,tr,In]),it=Object(i.useCallback)(function(xt){mr("");switch(kn){case Xe:var bt=xt.title,Lt=xt.link;return Q.replaceSelection("[".concat(bt,"](").concat(Lt,")")),Q.focus();case Rt:var At=xt.language,Et=xt.content;return Q.replaceSelection(["```"+At,Et,"```"].join(`
|
|
`)),Q.focus();case ft:var mn=xt.src,cn=xt.alt;return cn?Q.replaceSelection(".concat(mn,' "').concat(cn,'" )')):Q.replaceSelection("")),Q.focus();case Pt:for(var _n=xt.row,un=xt.col,rn=xt.align,Cn=`
|
|
`,rr=0;rr<_n;rr++){for(var cr=[],zn=[],Dr=0;Dr<un;Dr++)rr===1&&zn.push(Ve[rn]),cr.push(" ");rr===1&&(Cn+="| ".concat(zn.join(" | "),` |
|
|
`)),Cn+="| ".concat(cr.join(un===1?"":" | "),` |
|
|
`)}return Q.replaceSelection(Cn+`
|
|
`),Q.focus();default:throw new Error}},[Q,kn]),Qt=Object(i.useMemo)(function(){switch(kn){case Xe:return d.a.createElement($,{callback:it,onCancel:Wt});case Rt:return d.a.createElement(q.b,{callback:it,onCancel:Wt});case ft:return d.a.createElement(ge,{callback:it,onCancel:Wt});case Pt:return d.a.createElement(lt,{callback:it,onCancel:Wt});default:return null}},[kn]);function Wt(){mr("")}Object(i.useEffect)(function(){if(Mt.current){var xt=Mt.current,bt=!1,Lt=0;function At(cn){bt=!0,Lt=cn.pageY}function Et(){bt=!1}function mn(cn){if(bt){var _n=cn.pageY-Lt;_n<0&&(_n=0),_n>300&&(_n=300);var un=St+_n+"px";Er(un)}}return xt.addEventListener("mousedown",At),document.addEventListener("mousemove",mn),document.addEventListener("mouseup",Et),function(){xt.removeEventListener("mousedown",At),document.removeEventListener("mousemove",mn),document.removeEventListener("mouseup",Et)}}},[Q,Mt]),Object(i.useEffect)(function(){Er(St)},[St]);var yn=Pe(pt),Dn=635,Kt={width:yn,height:Dn},dn=Object(i.useMemo)(function(){if(Gn){var xt=new Date(Gn),bt=xt.getHours(),Lt=xt.getMinutes(),At=xt.getSeconds();return bt=bt<10?"0"+bt:bt,Lt=Lt<10?"0"+Lt:Lt,At=At<10?"0"+At:At,"".concat(bt,":").concat(Lt,":").concat(At)}return 0},[Gn]);function Ht(){window.sessionStorage.removeItem(qe),Me(!1),Hn(0)}function Sn(){Me(!1),Hn(0),Q.setValue(window.sessionStorage.getItem(qe))}function Tn(xt,bt){var Lt=Q.getValue();Lt=Lt.replace(xt,bt),An(Lt),Q==null||Q.setValue(Lt)}return d.a.createElement(i.Fragment,null,d.a.createElement("div",{className:"markdown-editor-wrapper",ref:at},d.a.createElement("div",{className:"markdown-editor-container ".concat(fn," ").concat(tr?"on-preview":""," ").concat(dt?"mini":""," ").concat(In?"full-screen":""),style:Kt},d.a.createElement(v,{insertTemp:gt,watch:tr,fullScreen:In,showNullButton:Kn,onActionCallback:Nt,hidetoolBar:xr,uuid:st.current,setOpenPhones:function(){Je.current=!0}}),d.a.createElement("div",{className:"markdown-editor-body"},d.a.createElement("div",{className:"codemirror-container"},d.a.createElement("textarea",{ref:ht,placeholder:Qr})),tr?d.a.createElement("div",{ref:Gt,className:"preview-container"},$t==="stex"&&d.a.createElement(M,{value:qt}),$t!=="stex"&&d.a.createElement(w.a,{edit:!0,value:qt,replaces:Tn})):null))),Zt?d.a.createElement("a",{ref:Mt,className:"editor-resize"}):null,d.a.createElement(N.a,null,ce[kn]?d.a.createElement(H.a,{centered:!0,title:ce[kn],visible:!0,onCancel:Wt,footer:null,className:"markdown-popup-form"},Qt):null))}},P47w:function(Ye,re,I){var Y=I("hydK"),H=Y.createElement,P=I("IMiH"),F=I("mFDi"),R=I("Fofx"),O=I("6GrX"),D=I("pzxd"),m=I("dqUG"),T=P.CMD,b=Array.prototype.join,i="none",d=Math.round,c=Math.sin,r=Math.cos,a=Math.PI,s=Math.PI*2,o=180/a,t=1e-4;function h(W){return d(W*1e4)/1e4}function g(W){return W<t&&W>-t}function C(W,$){var q=$?W.textFill:W.fill;return q!=null&&q!==i}function A(W,$){var q=$?W.textStroke:W.stroke;return q!=null&&q!==i}function w(W,$){$&&M(W,"transform","matrix("+b.call($,",")+")")}function M(W,$,q){(!q||q.type!=="linear"&&q.type!=="radial")&&W.setAttribute($,q)}function E(W,$,q){W.setAttributeNS("http://www.w3.org/1999/xlink",$,q)}function p(W,$,q,fe){if(C($,q)){var se=q?$.textFill:$.fill;se=se==="transparent"?i:se,M(W,"fill",se),M(W,"fill-opacity",$.fillOpacity!=null?$.fillOpacity*$.opacity:$.opacity)}else M(W,"fill",i);if(A($,q)){var me=q?$.textStroke:$.stroke;me=me==="transparent"?i:me,M(W,"stroke",me);var ve=q?$.textStrokeWidth:$.lineWidth,Ae=!q&&$.strokeNoScale?fe.getLineScale():1;M(W,"stroke-width",ve/Ae),M(W,"paint-order",q?"stroke":"fill"),M(W,"stroke-opacity",$.strokeOpacity!=null?$.strokeOpacity:$.opacity);var ge=$.lineDash;ge?(M(W,"stroke-dasharray",$.lineDash.join(",")),M(W,"stroke-dashoffset",d($.lineDashOffset||0))):M(W,"stroke-dasharray",""),$.lineCap&&M(W,"stroke-linecap",$.lineCap),$.lineJoin&&M(W,"stroke-linejoin",$.lineJoin),$.miterLimit&&M(W,"stroke-miterlimit",$.miterLimit)}else M(W,"stroke",i)}function l(W){for(var $=[],q=W.data,fe=W.len(),se=0;se<fe;){var me=q[se++],ve="",Ae=0;switch(me){case T.M:ve="M",Ae=2;break;case T.L:ve="L",Ae=2;break;case T.Q:ve="Q",Ae=4;break;case T.C:ve="C",Ae=6;break;case T.A:var ge=q[se++],ue=q[se++],$e=q[se++],Tt=q[se++],ye=q[se++],Re=q[se++],nt=q[se++],Ue=q[se++],ke=Math.abs(Re),lt=g(ke-s)||(Ue?Re>=s:-Re>=s),Fe=Re>0?Re%s:Re%s+s,Ze=!1;lt?Ze=!0:g(ke)?Ze=!1:Ze=Fe>=a===!!Ue;var Xe=h(ge+$e*r(ye)),ft=h(ue+Tt*c(ye));lt&&(Ue?Re=s-1e-4:Re=-s+1e-4,Ze=!0,se===9&&$.push("M",Xe,ft));var Rt=h(ge+$e*r(ye+Re)),Pt=h(ue+Tt*c(ye+Re));$.push("A",h($e),h(Tt),d(nt*o),+Ze,+Ue,Rt,Pt);break;case T.Z:ve="Z";break;case T.R:var Rt=h(q[se++]),Pt=h(q[se++]),Bt=h(q[se++]),Ve=h(q[se++]);$.push("M",Rt,Pt,"L",Rt+Bt,Pt,"L",Rt+Bt,Pt+Ve,"L",Rt,Pt+Ve,"L",Rt,Pt);break}ve&&$.push(ve);for(var Ft=0;Ft<Ae;Ft++)$.push(h(q[se++]))}return $.join(" ")}var u={};u.brush=function(W){var $=W.style,q=W.__svgEl;q||(q=H("path"),W.__svgEl=q),W.path||W.createPathProxy();var fe=W.path;if(W.__dirtyPath){fe.beginPath(),fe.subPixelOptimize=!1,W.buildPath(fe,W.shape),W.__dirtyPath=!1;var se=l(fe);se.indexOf("NaN")<0&&M(q,"d",se)}p(q,$,!1,W),w(q,W.transform),$.text!=null?U(W,W.getBoundingRect()):V(W)};var f={};f.brush=function(W){var $=W.style,q=$.image;if(q instanceof HTMLImageElement){var fe=q.src;q=fe}if(!q)return;var se=$.x||0,me=$.y||0,ve=$.width,Ae=$.height,ge=W.__svgEl;ge||(ge=H("image"),W.__svgEl=ge),q!==W.__imageSrc&&(E(ge,"href",q),W.__imageSrc=q),M(ge,"width",ve),M(ge,"height",Ae),M(ge,"x",se),M(ge,"y",me),w(ge,W.transform),$.text!=null?U(W,W.getBoundingRect()):V(W)};var _={},y=new F,v={},N=[],j={left:"start",right:"end",center:"middle",middle:"middle"},U=function(W,$){var q=W.style,fe=W.transform,se=W instanceof m||q.transformText;W.__dirty&&D.normalizeTextStyle(q,!0);var me=q.text;if(me!=null&&(me+=""),!D.needDrawText(me,q))return;me==null&&(me=""),!se&&fe&&(y.copy($),y.applyTransform(fe),$=y);var ve=W.__textSvgEl;ve||(ve=H("text"),W.__textSvgEl=ve);var Ae=ve.style,ge=q.font||O.DEFAULT_FONT,ue=ve.__computedFont;ge!==ve.__styleFont&&(Ae.font=ve.__styleFont=ge,ue=ve.__computedFont=Ae.font);var $e=q.textPadding,Tt=q.textLineHeight,ye=W.__textCotentBlock;(!ye||W.__dirtyText)&&(ye=W.__textCotentBlock=O.parsePlainText(me,ue,$e,Tt,q.truncate));var Re=ye.outerHeight,nt=ye.lineHeight;D.getBoxPosition(v,W,q,$);var Ue=v.baseX,ke=v.baseY,lt=v.textAlign||"left",Fe=v.textVerticalAlign;G(ve,se,fe,q,$,Ue,ke);var Ze=O.adjustTextY(ke,Re,Fe),Xe=Ue,ft=Ze;$e&&(Xe=z(Ue,lt,$e),ft+=$e[0]),ft+=nt/2,p(ve,q,!0,W);var Rt=ye.canCacheByTextString,Pt=W.__tspanList||(W.__tspanList=[]),Bt=Pt.length;if(Rt&&W.__canCacheByTextString&&W.__text===me){if(W.__dirtyText&&Bt)for(var Ve=0;Ve<Bt;++Ve)L(Pt[Ve],lt,Xe,ft+Ve*nt)}else{W.__text=me,W.__canCacheByTextString=Rt;for(var Ft=ye.lines,nn=Ft.length,Ve=0;Ve<nn;Ve++){var Le=Pt[Ve],Se=Ft[Ve];Le?Le.__zrText!==Se&&(Le.innerHTML="",Le.appendChild(document.createTextNode(Se))):(Le=Pt[Ve]=H("tspan"),ve.appendChild(Le),Le.appendChild(document.createTextNode(Se))),L(Le,lt,Xe,ft+Ve*nt)}if(Bt>nn){for(;Ve<Bt;Ve++)ve.removeChild(Pt[Ve]);Pt.length=nn}}};function G(W,$,q,fe,se,me,ve){R.identity(N),$&&q&&R.copy(N,q);var Ae=fe.textRotation;if(se&&Ae){var ge=fe.textOrigin;ge==="center"?(me=se.width/2+se.x,ve=se.height/2+se.y):ge&&(me=ge[0]+se.x,ve=ge[1]+se.y),N[4]-=me,N[5]-=ve,R.rotate(N,N,Ae),N[4]+=me,N[5]+=ve}w(W,N)}function z(W,$,q){return $==="right"?W-q[1]:$==="center"?W+q[3]/2-q[1]/2:W+q[3]}function L(W,$,q,fe){M(W,"dominant-baseline","middle"),M(W,"text-anchor",j[$]),M(W,"x",q),M(W,"y",fe)}function V(W){W&&W.__textSvgEl&&(W.__textSvgEl.parentNode&&W.__textSvgEl.parentNode.removeChild(W.__textSvgEl),W.__textSvgEl=null,W.__tspanList=[],W.__text=null)}_.drawRectText=U,_.brush=function(W){var $=W.style;$.text!=null?U(W,!1):V(W)},re.path=u,re.image=f,re.text=_},P4Qj:function(Ye,re,I){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.removeSensor=re.getSensor=void 0;var Y=F(I("chpo")),H=I("FxDU"),P=I("24YM");function F(m){return m&&m.__esModule?m:{default:m}}var R={},O=function(T){var b=T.getAttribute(P.SizeSensorId);if(b&&R[b])return R[b];var i=(0,Y.default)();T.setAttribute(P.SizeSensorId,i);var d=(0,H.createSensor)(T);return R[i]=d,d};re.getSensor=O;var D=function(T){var b=T.element.getAttribute(P.SizeSensorId);T.element.removeAttribute(P.SizeSensorId),T.destroy(),b&&R[b]&&delete R[b]};re.removeSensor=D},QBsz:function(Ye,re){var I=typeof Float32Array=="undefined"?Array:Float32Array;function Y(p,l){var u=new I(2);return p==null&&(p=0),l==null&&(l=0),u[0]=p,u[1]=l,u}function H(p,l){return p[0]=l[0],p[1]=l[1],p}function P(p){var l=new I(2);return l[0]=p[0],l[1]=p[1],l}function F(p,l,u){return p[0]=l,p[1]=u,p}function R(p,l,u){return p[0]=l[0]+u[0],p[1]=l[1]+u[1],p}function O(p,l,u,f){return p[0]=l[0]+u[0]*f,p[1]=l[1]+u[1]*f,p}function D(p,l,u){return p[0]=l[0]-u[0],p[1]=l[1]-u[1],p}function m(p){return Math.sqrt(b(p))}var T=m;function b(p){return p[0]*p[0]+p[1]*p[1]}var i=b;function d(p,l,u){return p[0]=l[0]*u[0],p[1]=l[1]*u[1],p}function c(p,l,u){return p[0]=l[0]/u[0],p[1]=l[1]/u[1],p}function r(p,l){return p[0]*l[0]+p[1]*l[1]}function a(p,l,u){return p[0]=l[0]*u,p[1]=l[1]*u,p}function s(p,l){var u=m(l);return u===0?(p[0]=0,p[1]=0):(p[0]=l[0]/u,p[1]=l[1]/u),p}function o(p,l){return Math.sqrt((p[0]-l[0])*(p[0]-l[0])+(p[1]-l[1])*(p[1]-l[1]))}var t=o;function h(p,l){return(p[0]-l[0])*(p[0]-l[0])+(p[1]-l[1])*(p[1]-l[1])}var g=h;function C(p,l){return p[0]=-l[0],p[1]=-l[1],p}function A(p,l,u,f){return p[0]=l[0]+f*(u[0]-l[0]),p[1]=l[1]+f*(u[1]-l[1]),p}function w(p,l,u){var f=l[0],_=l[1];return p[0]=u[0]*f+u[2]*_+u[4],p[1]=u[1]*f+u[3]*_+u[5],p}function M(p,l,u){return p[0]=Math.min(l[0],u[0]),p[1]=Math.min(l[1],u[1]),p}function E(p,l,u){return p[0]=Math.max(l[0],u[0]),p[1]=Math.max(l[1],u[1]),p}re.create=Y,re.copy=H,re.clone=P,re.set=F,re.add=R,re.scaleAndAdd=O,re.sub=D,re.len=m,re.length=T,re.lenSquare=b,re.lengthSquare=i,re.mul=d,re.div=c,re.dot=r,re.scale=a,re.normalize=s,re.distance=o,re.dist=t,re.distanceSquare=h,re.distSquare=g,re.negate=C,re.lerp=A,re.applyTransform=w,re.min=M,re.max=E},"QO+J":function(Ye,re,I){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.createSensor=void 0;var Y=P(I("NohK")),H=I("24YM");function P(R){return R&&R.__esModule?R:{default:R}}var F=function(O){var D=void 0,m=[],T=function(){getComputedStyle(O).position==="static"&&(O.style.position="relative");var a=document.createElement("object");return a.onload=function(){a.contentDocument.defaultView.addEventListener("resize",b),b()},a.style.display="block",a.style.position="absolute",a.style.top="0",a.style.left="0",a.style.height="100%",a.style.width="100%",a.style.overflow="hidden",a.style.pointerEvents="none",a.style.zIndex="-1",a.style.opacity="0",a.setAttribute("class",H.SensorClassName),a.setAttribute("tabindex",H.SensorTabIndex),a.type="text/html",O.appendChild(a),a.data="about:blank",a},b=(0,Y.default)(function(){m.forEach(function(r){r(O)})}),i=function(a){D||(D=T()),m.indexOf(a)===-1&&m.push(a)},d=function(){D&&D.parentNode&&(D.contentDocument&&D.contentDocument.defaultView.removeEventListener("resize",b),D.parentNode.removeChild(D),D=void 0,m=[])},c=function(a){var s=m.indexOf(a);s!==-1&&m.splice(s,1),m.length===0&&D&&d()};return{element:O,bind:i,destroy:d,unbind:c}};re.createSensor=F},Qe9p:function(Ye,re,I){var Y=I("1RvN"),H={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function P(l){return l=Math.round(l),l<0?0:l>255?255:l}function F(l){return l=Math.round(l),l<0?0:l>360?360:l}function R(l){return l<0?0:l>1?1:l}function O(l){return l.length&&l.charAt(l.length-1)==="%"?P(parseFloat(l)/100*255):P(parseInt(l,10))}function D(l){return l.length&&l.charAt(l.length-1)==="%"?R(parseFloat(l)/100):R(parseFloat(l))}function m(l,u,f){return f<0?f+=1:f>1&&(f-=1),f*6<1?l+(u-l)*f*6:f*2<1?u:f*3<2?l+(u-l)*(2/3-f)*6:l}function T(l,u,f){return l+(u-l)*f}function b(l,u,f,_,y){return l[0]=u,l[1]=f,l[2]=_,l[3]=y,l}function i(l,u){return l[0]=u[0],l[1]=u[1],l[2]=u[2],l[3]=u[3],l}var d=new Y(20),c=null;function r(l,u){c&&i(c,u),c=d.put(l,c||u.slice())}function a(l,u){if(!l)return;u=u||[];var f=d.get(l);if(f)return i(u,f);l=l+"";var _=l.replace(/ /g,"").toLowerCase();if(_ in H)return i(u,H[_]),r(l,u),u;if(_.charAt(0)==="#"){if(_.length===4){var y=parseInt(_.substr(1),16);if(!(y>=0&&y<=4095)){b(u,0,0,0,1);return}return b(u,(y&3840)>>4|(y&3840)>>8,y&240|(y&240)>>4,y&15|(y&15)<<4,1),r(l,u),u}else if(_.length===7){var y=parseInt(_.substr(1),16);if(!(y>=0&&y<=16777215)){b(u,0,0,0,1);return}return b(u,(y&16711680)>>16,(y&65280)>>8,y&255,1),r(l,u),u}return}var v=_.indexOf("("),N=_.indexOf(")");if(v!==-1&&N+1===_.length){var j=_.substr(0,v),U=_.substr(v+1,N-(v+1)).split(","),G=1;switch(j){case"rgba":if(U.length!==4){b(u,0,0,0,1);return}G=D(U.pop());case"rgb":if(U.length!==3){b(u,0,0,0,1);return}return b(u,O(U[0]),O(U[1]),O(U[2]),G),r(l,u),u;case"hsla":if(U.length!==4){b(u,0,0,0,1);return}return U[3]=D(U[3]),s(U,u),r(l,u),u;case"hsl":if(U.length!==3){b(u,0,0,0,1);return}return s(U,u),r(l,u),u;default:return}}b(u,0,0,0,1);return}function s(l,u){var f=(parseFloat(l[0])%360+360)%360/360,_=D(l[1]),y=D(l[2]),v=y<=.5?y*(_+1):y+_-y*_,N=y*2-v;return u=u||[],b(u,P(m(N,v,f+1/3)*255),P(m(N,v,f)*255),P(m(N,v,f-1/3)*255),1),l.length===4&&(u[3]=l[3]),u}function o(l){if(!l)return;var u=l[0]/255,f=l[1]/255,_=l[2]/255,y=Math.min(u,f,_),v=Math.max(u,f,_),N=v-y,j=(v+y)/2,U,G;if(N===0)U=0,G=0;else{j<.5?G=N/(v+y):G=N/(2-v-y);var z=((v-u)/6+N/2)/N,L=((v-f)/6+N/2)/N,V=((v-_)/6+N/2)/N;u===v?U=V-L:f===v?U=1/3+z-V:_===v&&(U=2/3+L-z),U<0&&(U+=1),U>1&&(U-=1)}var W=[U*360,G,j];return l[3]!=null&&W.push(l[3]),W}function t(l,u){var f=a(l);if(f){for(var _=0;_<3;_++)u<0?f[_]=f[_]*(1-u)|0:f[_]=(255-f[_])*u+f[_]|0,f[_]>255?f[_]=255:l[_]<0&&(f[_]=0);return p(f,f.length===4?"rgba":"rgb")}}function h(l){var u=a(l);if(u)return((1<<24)+(u[0]<<16)+(u[1]<<8)+ +u[2]).toString(16).slice(1)}function g(l,u,f){if(!(u&&u.length)||!(l>=0&&l<=1))return;f=f||[];var _=l*(u.length-1),y=Math.floor(_),v=Math.ceil(_),N=u[y],j=u[v],U=_-y;return f[0]=P(T(N[0],j[0],U)),f[1]=P(T(N[1],j[1],U)),f[2]=P(T(N[2],j[2],U)),f[3]=R(T(N[3],j[3],U)),f}var C=g;function A(l,u,f){if(!(u&&u.length)||!(l>=0&&l<=1))return;var _=l*(u.length-1),y=Math.floor(_),v=Math.ceil(_),N=a(u[y]),j=a(u[v]),U=_-y,G=p([P(T(N[0],j[0],U)),P(T(N[1],j[1],U)),P(T(N[2],j[2],U)),R(T(N[3],j[3],U))],"rgba");return f?{color:G,leftIndex:y,rightIndex:v,value:_}:G}var w=A;function M(l,u,f,_){if(l=a(l),l)return l=o(l),u!=null&&(l[0]=F(u)),f!=null&&(l[1]=D(f)),_!=null&&(l[2]=D(_)),p(s(l),"rgba")}function E(l,u){if(l=a(l),l&&u!=null)return l[3]=R(u),p(l,"rgba")}function p(l,u){if(!l||!l.length)return;var f=l[0]+","+l[1]+","+l[2];return(u==="rgba"||u==="hsva"||u==="hsla")&&(f+=","+l[3]),u+"("+f+")"}re.parse=a,re.lift=t,re.toHex=h,re.fastLerp=g,re.fastMapToColor=C,re.lerp=A,re.mapToColor=w,re.modifyHSL=M,re.modifyAlpha=E,re.stringify=p},QuXc:function(Ye,re){var I=function(H){this.colorStops=H||[]};I.prototype={constructor:I,addColorStop:function(H,P){this.colorStops.push({offset:H,color:P})}};var Y=I;Ye.exports=Y},R5GN:function(Ye,re,I){"use strict";var Y=I("2qtc"),H=I("kLXV"),P=I("g9YV"),F=I("wCAj"),R=I("5NDa"),O=I("5rEg"),D=I("14J3"),m=I("BMrR"),T=I("iQDF"),b=I("+eQT"),i=I("miYZ"),d=I("tsqr"),c=I("jrin"),r=I("oBTY"),a=I("k1fw"),s=I("9og8"),o=I("y8nQ"),t=I("Vl3Y"),h=I("tJVT"),g=I("WmNS"),C=I.n(g),A=I("q1tI"),w=I.n(A),M=I("wd/R"),E=I.n(M),p=I("ErOA"),l=I("1vsH"),u=I("Ty5D"),f=I("9kvl"),_=I("eozf"),y=I("oUNq"),v=I("xKgJ"),N=function(U){var G=U.classroomList,z=U.dispatch,L=U.courseEndTime,V=Object(u.i)(),W=t.a.useForm(),$=Object(h.a)(W,1),q=$[0],fe=Object(A.useState)(1),se=Object(h.a)(fe,2),me=se[0],ve=se[1],Ae=Object(A.useState)([]),ge=Object(h.a)(Ae,2),ue=ge[0],$e=ge[1],Tt=Object(A.useState)(0),ye=Object(h.a)(Tt,2),Re=ye[0],nt=ye[1],Ue=Object(A.useState)(2e4),ke=Object(h.a)(Ue,2),lt=ke[0],Fe=ke[1],Ze=Object(A.useState)(!0),Xe=Object(h.a)(Ze,2),ft=Xe[0],Rt=Xe[1],Pt=Object(A.useState)([]),Bt=Object(h.a)(Pt,2),Ve=Bt[0],Ft=Bt[1],nn=Object(A.useState)(),Le=Object(h.a)(nn,2),Se=Le[0],ut=Le[1];Object(A.useEffect)(function(){G.actionTabs.key==="\u7ACB\u5373\u622A\u6B62"?mt():(Ft([]),$e([]))},[G.actionTabs.key]);var mt=function(){var ie=Object(s.a)(C.a.mark(function ae(ce){var be,Ce,Be;return C.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:return Rt(!0),Xt.next=3,Object(y.D)(Object(a.a)(Object(a.a)({},V),{},{page:ce||me,limit:lt,homework_id:G.actionTabs.type===1?"":G.actionTabs.selectArrs[0],end_homework_action:!0}));case 3:be=Xt.sent,be==null||be.course_groups.map(function(an,pt){an.key=an.id}),be&&($e([].concat(Object(r.a)(ue),Object(r.a)(be==null?void 0:be.course_groups))),nt(be==null?void 0:be.course_groups_count),ut(be==null?void 0:be.course_groups),Rt(!1),ce||q.setFieldsValue((Be={},Object(c.a)(Be,"group_ids",be==null||((Ce=be.course_groups)===null||Ce===void 0)?void 0:Ce.map(function(an){return String(an.id)})),Object(c.a)(Be,"end_time",E()(E()(new Date).add(0,"days").format("YYYY-MM-DD HH:mm"))),Be)));case 6:case"end":return Xt.stop()}},ae)}));return function(ce){return ie.apply(this,arguments)}}(),We=function(ae){ve(ae),mt(ae)},vt=function(){var ie=Object(s.a)(C.a.mark(function ae(){var ce,be;return C.a.wrap(function(Be){for(;;)switch(Be.prev=Be.next){case 0:if(ce=Object(a.a)({},q.getFieldsValue()),!(Se!=null&&Se.length&&!(Ve!=null&&Ve.length))){Be.next=4;break}return d.b.warning("\u8BF7\u9009\u62E9\u9700\u8981\u64CD\u4F5C\u7684\u73ED\u7EA7"),Be.abrupt("return");case 4:return Be.next=6,Object(p.a)("/api/courses/".concat(V.coursesId,"/homework_commons/end_with_homework_list_position.json"),{method:"post",body:{homework_ids:Object(r.a)(G.actionTabs.selectArrs),group_ids:(Ve==null?void 0:Ve.length)>0?Ve:[],unified_setting:!(ue!=null&&ue.length),end_time:E()(ce.end_time).format("YYYY-MM-DD HH:mm")}});case 6:be=Be.sent,be.status===0&&(Pe(),Object(l.cb)(["\u6559\u5B66\u8BFE\u5802","\u8BFE\u7A0B\u5B9E\u9A8C","\u7ACB\u5373\u622A\u6B62"]),d.b.success("\u64CD\u4F5C\u6210\u529F"),z({type:"classroomList/setActionTabs",payload:{key:"\u6E05\u9664\u9009\u62E9\u6570\u636E"}}),Object(v.c)()?G.actionTabs.detail?(z({type:"classroomList/setActionTabs",payload:{}}),z({type:"shixunHomeworks/getWorkList",payload:Object(a.a)({},V)}),z({type:"shixunHomeworks/getWorkSetting",payload:Object(a.a)({},V)})):z({type:"classroomList/getClassroomTeacherShixunsList",payload:Object(a.a)(Object(a.a)({},G.actionTabs.params),{},{type:4})}):z({type:"classroomList/getClassroomShixunsList",payload:Object(a.a)({},G.actionTabs.params)}));case 8:case"end":return Be.stop()}},ae)}));return function(){return ie.apply(this,arguments)}}(),Pe=function(){ve(1),$e([])},xe=Re>me*lt,we=G.detailShixunsList;return w.a.createElement(H.a,{centered:!0,title:"\u622A\u6B62\u4F5C\u4E1A",visible:G.actionTabs.key==="\u7ACB\u5373\u622A\u6B62",okText:"\u622A\u6B62\u4F5C\u4E1A",cancelText:"\u6682\u4E0D\u622A\u6B62",onOk:vt,onCancel:function(){Pe(),z({type:"classroomList/setActionTabs",payload:{}})}},w.a.createElement("p",{className:"tc"},"\u5B66\u751F\u5C06\u4E0D\u80FD\u518D\u63D0\u4EA4\u4F5C\u4E1A",w.a.createElement("br",null),'\u672C\u64CD\u4F5C\u53EA\u5BF9"\u63D0\u4EA4\u4E2D" \u201C\u8865\u4EA4\u4E2D\u201D\u7684\u4F5C\u4E1A\u6709\u6548'),ue&&w.a.createElement(t.a,{form:q},w.a.createElement(m.a,null,w.a.createElement("span",{className:"mr5"},"\u622A\u6B62\u65F6\u95F4:"),w.a.createElement(t.a.Item,{name:"end_time"},w.a.createElement(b.a,{style:{width:170},getPopupContainer:function(ae){return ae.parentNode},disabledDate:function(ae){return Object(_.b)(ae,L)},disabledTime:function(ae){return Object(_.c)(ae)},placeholder:"\u8BF7\u9009\u62E9\u7ED3\u675F\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:E()(Object(l.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",allowClear:!1}))),(Se==null?void 0:Se.length)>0&&w.a.createElement(m.a,null,w.a.createElement("span",{className:"mr5"},"\u9009\u62E9\u73ED\u7EA7:"),w.a.createElement(O.a.Search,{style:{width:"300px"},onChange:function(ae){$e(Se.filter(function(ce){return ce.name.indexOf(ae.target.value)>-1}))}})),(ue==null?void 0:ue.length)>0&&G.actionTabs.type===1&&w.a.createElement(F.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(ae,ce){Ft(ae)}},pagination:!1,dataSource:ue,columns:[{title:"\u73ED\u7EA7",dataIndex:"name",key:"name"}]}),(ue==null?void 0:ue.length)>0&&G.actionTabs.type===2&&w.a.createElement(F.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(ae,ce){Ft(ae)}},pagination:!1,dataSource:ue,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"}]})))};re.a=Object(f.a)(function(j){var U=j.classroomList;return{classroomList:U}})(N)},RDYZ:function(Ye,re,I){var Y=I("dMvE");function H(F){this._target=F.target,this._life=F.life||1e3,this._delay=F.delay||0,this._initialized=!1,this.loop=F.loop==null?!1:F.loop,this.gap=F.gap||0,this.easing=F.easing||"Linear",this.onframe=F.onframe,this.ondestroy=F.ondestroy,this.onrestart=F.onrestart,this._pausedTime=0,this._paused=!1}H.prototype={constructor:H,step:function(F,R){if(this._initialized||(this._startTime=F+this._delay,this._initialized=!0),this._paused){this._pausedTime+=R;return}var O=(F-this._startTime-this._pausedTime)/this._life;if(O<0)return;O=Math.min(O,1);var D=this.easing,m=typeof D=="string"?Y[D]:D,T=typeof m=="function"?m(O):O;return this.fire("frame",T),O===1?this.loop?(this.restart(F),"restart"):(this._needsRemove=!0,"destroy"):null},restart:function(F){var R=(F-this._startTime-this._pausedTime)%this._life;this._startTime=F-R+this.gap,this._pausedTime=0,this._needsRemove=!1},fire:function(F,R){F="on"+F,this[F]&&this[F](this._target,R)},pause:function(){this._paused=!0},resume:function(){this._paused=!1}};var P=H;Ye.exports=P},RXMa:function(Ye,re,I){var Y=I("y+Vt"),H=Y.extend({type:"ring",shape:{cx:0,cy:0,r:0,r0:0},buildPath:function(P,F){var R=F.cx,O=F.cy,D=Math.PI*2;P.moveTo(R+F.r,O),P.arc(R,O,F.r,0,D,!1),P.moveTo(R+F.r0,O),P.arc(R,O,F.r0,0,D,!0)}});Ye.exports=H},RotF:function(Ye,re,I){Ye.exports=I("LSTS")},"SA+Z":function(Ye,re,I){var Y=I("wTVA"),H=I("EbDI"),P=I("ZhPi"),F=I("wkBT");function R(O){return Y(O)||H(O)||P(O)||F()}Ye.exports=R,Ye.exports.__esModule=!0,Ye.exports.default=Ye.exports},SJMd:function(Ye,re){/**
|
|
* @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,Y,H,P=!1,F,R;window.PR_SHOULD_USE_CONTINUATION=!0;var O,D;(function(){var m=window,T=["break,continue,do,else,for,if,return,while"],b=[T,"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"],i=[b,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],d=[i,"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"],c=[i,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],r=[i,"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"],a="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",s=[i,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],o="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",t=[T,"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"],h=[T,"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"],g=[T,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],C=[d,r,c,s,o,t,h,g],A=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,w="str",M="kwd",E="com",p="typ",l="lit",u="pun",f="pln",_="tag",y="dec",v="src",N="atn",j="atv",U="nocode",G="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function z(Ue){for(var ke=0,lt=!1,Fe=!1,Ze=0,Xe=Ue.length;Ze<Xe;++Ze){var ft=Ue[Ze];if(ft.ignoreCase)Fe=!0;else if(/[a-z]/i.test(ft.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){lt=!0,Fe=!1;break}}var Rt={b:8,t:9,n:10,v:11,f:12,r:13};function Pt(Le){var Se=Le.charCodeAt(0);if(Se!==92)return Se;var ut=Le.charAt(1);return Se=Rt[ut],Se||("0"<=ut&&ut<="7"?parseInt(Le.substring(1),8):ut==="u"||ut==="x"?parseInt(Le.substring(2),16):Le.charCodeAt(1))}function Bt(Le){if(Le<32)return(Le<16?"\\x0":"\\x")+Le.toString(16);var Se=String.fromCharCode(Le);return Se==="\\"||Se==="-"||Se==="]"||Se==="^"?"\\"+Se:Se}function Ve(Le){var Se=Le.substring(1,Le.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")),ut=[],mt=Se[0]==="^",We=["["];mt&&We.push("^");for(var vt=mt?1:0,Pe=Se.length;vt<Pe;++vt){var xe=Se[vt];if(/\\[bdsw]/i.test(xe))We.push(xe);else{var we=Pt(xe),ie;vt+2<Pe&&Se[vt+1]==="-"?(ie=Pt(Se[vt+2]),vt+=2):ie=we,ut.push([we,ie]),ie<65||we>122||(ie<65||we>90||ut.push([Math.max(65,we)|32,Math.min(ie,90)|32]),ie<97||we>122||ut.push([Math.max(97,we)&~32,Math.min(ie,122)&~32]))}}ut.sort(function(Ce,Be){return Ce[0]-Be[0]||Be[1]-Ce[1]});for(var ae=[],ce=[],vt=0;vt<ut.length;++vt){var be=ut[vt];be[0]<=ce[1]+1?ce[1]=Math.max(ce[1],be[1]):ae.push(ce=be)}for(var vt=0;vt<ae.length;++vt){var be=ae[vt];We.push(Bt(be[0])),be[1]>be[0]&&(be[1]+1>be[0]&&We.push("-"),We.push(Bt(be[1])))}return We.push("]"),We.join("")}function Ft(Le){for(var Se=Le.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")),ut=Se.length,mt=[],We=0,vt=0;We<ut;++We){var Pe=Se[We];if(Pe==="(")++vt;else if(Pe.charAt(0)==="\\"){var xe=+Pe.substring(1);xe&&(xe<=vt?mt[xe]=-1:Se[We]=Bt(xe))}}for(var We=1;We<mt.length;++We)mt[We]===-1&&(mt[We]=++ke);for(var We=0,vt=0;We<ut;++We){var Pe=Se[We];if(Pe==="(")++vt,mt[vt]||(Se[We]="(?:");else if(Pe.charAt(0)==="\\"){var xe=+Pe.substring(1);xe&&xe<=vt&&(Se[We]="\\"+mt[xe])}}for(var We=0;We<ut;++We)Se[We]==="^"&&Se[We+1]!=="^"&&(Se[We]="");if(Le.ignoreCase&<)for(var We=0;We<ut;++We){var Pe=Se[We],we=Pe.charAt(0);Pe.length>=2&&we==="["?Se[We]=Ve(Pe):we!=="\\"&&(Se[We]=Pe.replace(/[a-zA-Z]/g,function(ce){var be=ce.charCodeAt(0);return"["+String.fromCharCode(be&~32,be|32)+"]"}))}return Se.join("")}for(var nn=[],Ze=0,Xe=Ue.length;Ze<Xe;++Ze){var ft=Ue[Ze];if(ft.global||ft.multiline)throw new Error(""+ft);nn.push("(?:"+Ft(ft)+")")}return new RegExp(nn.join("|"),Fe?"gi":"g")}function L(Ue,ke){var lt=/(?:^|\s)nocode(?:\s|$)/,Fe=[],Ze=0,Xe=[],ft=0;function Rt(Pt){var Bt=Pt.nodeType;if(Bt==1){if(lt.test(Pt.className))return;for(var Ve=Pt.firstChild;Ve;Ve=Ve.nextSibling)Rt(Ve);var Ft=Pt.nodeName.toLowerCase();(Ft==="br"||Ft==="li")&&(Fe[ft]=`
|
|
`,Xe[ft<<1]=Ze++,Xe[ft++<<1|1]=Pt)}else if(Bt==3||Bt==4){var nn=Pt.nodeValue;nn.length&&(ke?nn=nn.replace(/\r\n?/g,`
|
|
`):nn=nn.replace(/[ \t\r\n]+/g," "),Fe[ft]=nn,Xe[ft<<1]=Ze,Ze+=nn.length,Xe[ft++<<1|1]=Pt)}}return Rt(Ue),{sourceCode:Fe.join("").replace(/\n$/,""),spans:Xe}}function V(Ue,ke,lt,Fe,Ze){if(!lt)return;var Xe={sourceNode:Ue,pre:1,langExtension:null,numberLines:null,sourceCode:lt,spans:null,basePos:ke,decorations:null};Fe(Xe),Ze.push.apply(Ze,Xe.decorations)}var W=/\S/;function $(Ue){for(var ke=void 0,lt=Ue.firstChild;lt;lt=lt.nextSibling){var Fe=lt.nodeType;ke=Fe===1?ke?Ue:lt:Fe===3&&W.test(lt.nodeValue)?Ue:ke}return ke===Ue?void 0:ke}function q(Ue,ke){var lt={},Fe;(function(){for(var ft=Ue.concat(ke),Rt=[],Pt={},Bt=0,Ve=ft.length;Bt<Ve;++Bt){var Ft=ft[Bt],nn=Ft[3];if(nn)for(var Le=nn.length;--Le>=0;)lt[nn.charAt(Le)]=Ft;var Se=Ft[1],ut=""+Se;Pt.hasOwnProperty(ut)||(Rt.push(Se),Pt[ut]=null)}Rt.push(/[\0-\uffff]/),Fe=z(Rt)})();var Ze=ke.length,Xe=function(ft){for(var Rt=ft.sourceCode,Pt=ft.basePos,Bt=ft.sourceNode,Ve=[Pt,f],Ft=0,nn=Rt.match(Fe)||[],Le={},Se=0,ut=nn.length;Se<ut;++Se){var mt=nn[Se],We=Le[mt],vt=void 0,Pe;if(typeof We=="string")Pe=!1;else{var xe=lt[mt.charAt(0)];if(xe)vt=mt.match(xe[1]),We=xe[0];else{for(var we=0;we<Ze;++we)if(xe=ke[we],vt=mt.match(xe[1]),vt){We=xe[0];break}vt||(We=f)}Pe=We.length>=5&&We.substring(0,5)==="lang-",Pe&&!(vt&&typeof vt[1]=="string")&&(Pe=!1,We=v),Pe||(Le[mt]=We)}var ie=Ft;if(Ft+=mt.length,!Pe)Ve.push(Pt+ie,We);else{var ae=vt[1],ce=mt.indexOf(ae),be=ce+ae.length;vt[2]&&(be=mt.length-vt[2].length,ce=be-ae.length);var Ce=We.substring(5);V(Bt,Pt+ie,mt.substring(0,ce),Xe,Ve),V(Bt,Pt+ie+ce,ae,ue(Ce,ae),Ve),V(Bt,Pt+ie+be,mt.substring(be),Xe,Ve)}}ft.decorations=Ve};return Xe}function fe(Ue){var ke=[],lt=[];Ue.tripleQuotedStrings?ke.push([w,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ue.multiLineStrings?ke.push([w,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):ke.push([w,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ue.verbatimStrings&<.push([w,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Fe=Ue.hashComments;Fe&&(Ue.cStyleComments?(Fe>1?ke.push([E,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):ke.push([E,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),lt.push([w,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):ke.push([E,/^#[^\r\n]*/,null,"#"])),Ue.cStyleComments&&(lt.push([E,/^\/\/[^\r\n]*/,null]),lt.push([E,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ze=Ue.regexLiterals;if(Ze){var Xe=Ze>1?"":`
|
|
\r`,ft=Xe?".":"[\\S\\s]",Rt="/(?=[^/*"+Xe+"])(?:[^/\\x5B\\x5C"+Xe+"]|\\x5C"+ft+"|\\x5B(?:[^\\x5C\\x5D"+Xe+"]|\\x5C"+ft+")*(?:\\x5D|$))+/";lt.push(["lang-regex",RegExp("^"+G+"("+Rt+")")])}var Pt=Ue.types;Pt&<.push([p,Pt]);var Bt=(""+Ue.keywords).replace(/^ | $/g,"");Bt.length&<.push([M,new RegExp("^(?:"+Bt.replace(/[\s,]+/g,"|")+")\\b"),null]),ke.push([f,/^\s+/,null,` \r
|
|
\xA0`]);var Ve="^.[^\\s\\w.$@'\"`/\\\\]*";return Ue.regexLiterals&&(Ve+="(?!s*/)"),lt.push([l,/^@[a-z_$][a-z_$@0-9]*/i,null],[p,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[f,/^[a-z_$][a-z_$@0-9]*/i,null],[l,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[f,/^\\[\s\S]?/,null],[u,new RegExp(Ve),null]),q(ke,lt)}var se=fe({keywords:C,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function me(Ue,ke,lt){for(var Fe=/(?:^|\s)nocode(?:\s|$)/,Ze=/\r\n?|\n/,Xe=Ue.ownerDocument,ft=Xe.createElement("li");Ue.firstChild;)ft.appendChild(Ue.firstChild);var Rt=[ft];function Pt(Se){var ut=Se.nodeType;if(ut==1&&!Fe.test(Se.className))if(Se.nodeName==="br")Bt(Se),Se.parentNode&&Se.parentNode.removeChild(Se);else for(var mt=Se.firstChild;mt;mt=mt.nextSibling)Pt(mt);else if((ut==3||ut==4)&<){var We=Se.nodeValue,vt=We.match(Ze);if(vt){var Pe=We.substring(0,vt.index);Se.nodeValue=Pe;var xe=We.substring(vt.index+vt[0].length);if(xe){var we=Se.parentNode;we.insertBefore(Xe.createTextNode(xe),Se.nextSibling)}Bt(Se),Pe||Se.parentNode.removeChild(Se)}}}function Bt(Se){for(;!Se.nextSibling;)if(Se=Se.parentNode,!Se)return;function ut(vt,Pe){var xe=Pe?vt.cloneNode(!1):vt,we=vt.parentNode;if(we){var ie=ut(we,1),ae=vt.nextSibling;ie.appendChild(xe);for(var ce=ae;ce;ce=ae)ae=ce.nextSibling,ie.appendChild(ce)}return xe}for(var mt=ut(Se.nextSibling,0),We;(We=mt.parentNode)&&We.nodeType===1;)mt=We;Rt.push(mt)}for(var Ve=0;Ve<Rt.length;++Ve)Pt(Rt[Ve]);ke===(ke|0)&&Rt[0].setAttribute("value",ke);var Ft=Xe.createElement("ol");Ft.className="linenums";for(var nn=Math.max(0,ke-1|0)||0,Ve=0,Le=Rt.length;Ve<Le;++Ve)ft=Rt[Ve],ft.className="L"+(Ve+nn)%10,ft.firstChild||ft.appendChild(Xe.createTextNode("\xA0")),Ft.appendChild(ft);Ue.appendChild(Ft)}function ve(Ue){var ke=/\bMSIE\s(\d+)/.exec(navigator.userAgent);ke=ke&&+ke[1]<=8;var lt=/\n/g,Fe=Ue.sourceCode,Ze=Fe.length,Xe=0,ft=Ue.spans,Rt=ft.length,Pt=0,Bt=Ue.decorations,Ve=Bt.length,Ft=0;Bt[Ve]=Ze;var nn,Le;for(Le=nn=0;Le<Ve;)Bt[Le]!==Bt[Le+2]?(Bt[nn++]=Bt[Le++],Bt[nn++]=Bt[Le++]):Le+=2;for(Ve=nn,Le=nn=0;Le<Ve;){for(var Se=Bt[Le],ut=Bt[Le+1],mt=Le+2;mt+2<=Ve&&Bt[mt+1]===ut;)mt+=2;Bt[nn++]=Se,Bt[nn++]=ut,Le=mt}Ve=Bt.length=nn;var We=Ue.sourceNode,vt="";We&&(vt=We.style.display,We.style.display="none");try{for(var Pe=null;Pt<Rt;){var xe=ft[Pt],we=ft[Pt+2]||Ze,ie=Bt[Ft+2]||Ze,mt=Math.min(we,ie),ae=ft[Pt+1],ce;if(ae.nodeType!==1&&(ce=Fe.substring(Xe,mt))){ke&&(ce=ce.replace(lt,"\r")),ae.nodeValue=ce;var be=ae.ownerDocument,Ce=be.createElement("span");Ce.className=Bt[Ft+1];var Be=ae.parentNode;Be.replaceChild(Ce,ae),Ce.appendChild(ae),Xe<we&&(ft[Pt+1]=ae=be.createTextNode(Fe.substring(mt,we)),Be.insertBefore(ae,Ce.nextSibling))}Xe=mt,Xe>=we&&(Pt+=2),Xe>=ie&&(Ft+=2)}}finally{We&&(We.style.display=vt)}}var Ae={};function ge(Ue,ke){for(var lt=ke.length;--lt>=0;){var Fe=ke[lt];Ae.hasOwnProperty(Fe)?m.console&&console.warn("cannot override language handler %s",Fe):Ae[Fe]=Ue}}function ue(Ue,ke){return Ue&&Ae.hasOwnProperty(Ue)||(Ue=/^\s*</.test(ke)?"default-markup":"default-code"),Ae[Ue]}ge(se,["default-code"]),ge(q([],[[f,/^[^<?]+/],[y,/^<!\w[^>]*(?:>|$)/],[E,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[u,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),ge(q([[f,/^[\s]+/,null,` \r
|
|
`],[j,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[_,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[N,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[u,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),ge(q([],[[j,/^[\s\S]+/]]),["uq.val"]),ge(fe({keywords:d,hashComments:!0,cStyleComments:!0,types:A}),["c","cc","cpp","cxx","cyc","m"]),ge(fe({keywords:"null,true,false"}),["json"]),ge(fe({keywords:r,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:A}),["cs"]),ge(fe({keywords:c,cStyleComments:!0}),["java"]),ge(fe({keywords:g,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ge(fe({keywords:t,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ge(fe({keywords:o,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ge(fe({keywords:h,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ge(fe({keywords:s,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ge(fe({keywords:a,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ge(q([],[[w,/^[\s\S]+/]]),["regex"]);function $e(Ue){var ke=Ue.langExtension;try{var lt=L(Ue.sourceNode,Ue.pre),Fe=lt.sourceCode;Ue.sourceCode=Fe,Ue.spans=lt.spans,Ue.basePos=0,ue(ke,Fe)(Ue),ve(Ue)}catch(Ze){m.console&&console.log(Ze&&Ze.stack||Ze)}}function Tt(Ue,ke,lt){var Fe=lt||!1,Ze=ke||null,Xe=document.createElement("div");Xe.innerHTML="<pre>"+Ue+"</pre>",Xe=Xe.firstChild,Fe&&me(Xe,Fe,!0);var ft={langExtension:Ze,numberLines:Fe,sourceNode:Xe,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return $e(ft),Xe.innerHTML}function ye(Ue,ke){var lt=ke||document.body,Fe=lt.ownerDocument||document;function Ze(xe){return lt.getElementsByTagName(xe)}for(var Xe=[Ze("pre"),Ze("code"),Ze("xmp")],ft=[],Rt=0;Rt<Xe.length;++Rt)for(var Pt=0,Bt=Xe[Rt].length;Pt<Bt;++Pt)ft.push(Xe[Rt][Pt]);Xe=null;var Ve=Date;Ve.now||(Ve={now:function(){return+new Date}});var Ft=0,nn=/\blang(?:uage)?-([\w.]+)(?!\S)/,Le=/\bprettyprint\b/,Se=/\bprettyprinted\b/,ut=/pre|xmp/i,mt=/^code$/i,We=/^(?:pre|code|xmp)$/i,vt={};function Pe(){for(var xe=m.PR_SHOULD_USE_CONTINUATION?Ve.now()+250:Infinity;Ft<ft.length&&Ve.now()<xe;Ft++){for(var we=ft[Ft],ie=vt,ae=we;ae=ae.previousSibling;){var ce=ae.nodeType,be=(ce===7||ce===8)&&ae.nodeValue;if(be?!/^\??prettify\b/.test(be):ce!==3||/\S/.test(ae.nodeValue))break;if(be){ie={},be.replace(/\b(\w+)=([\w:.%+-]+)/g,function(kt,gt,zt){ie[gt]=zt});break}}var Ce=we.className;if((ie!==vt||Le.test(Ce))&&!Se.test(Ce)){for(var Be=!1,yt=we.parentNode;yt;yt=yt.parentNode){var Xt=yt.tagName;if(We.test(Xt)&&yt.className&&Le.test(yt.className)){Be=!0;break}}if(!Be){we.className+=" prettyprinted";var an=ie.lang;if(!an){an=Ce.match(nn);var pt;!an&&(pt=$(we))&&mt.test(pt.tagName)&&(an=pt.className.match(nn)),an&&(an=an[1])}var Yt;if(ut.test(we.tagName))Yt=1;else{var St=we.currentStyle,Ot=Fe.defaultView,dt=St?St.whiteSpace:Ot&&Ot.getComputedStyle?Ot.getComputedStyle(we,null).getPropertyValue("white-space"):0;Yt=dt&&dt.substring(0,3)==="pre"}var _e=ie.linenums;(_e=_e==="true"||+_e)||(_e=Ce.match(/\blinenums\b(?::(\d+))?/),_e=_e?_e[1]&&_e[1].length?+_e[1]:!0:!1),_e&&me(we,_e,Yt);var je={langExtension:an,sourceNode:we,numberLines:_e,pre:Yt,sourceCode:null,basePos:null,spans:null,decorations:null};$e(je)}}}Ft<ft.length?m.setTimeout(Pe,250):typeof Ue=="function"&&Ue()}Pe()}var Re=m.PR={createSimpleLexer:q,registerLangHandler:ge,sourceDecorator:fe,PR_ATTRIB_NAME:N,PR_ATTRIB_VALUE:j,PR_COMMENT:E,PR_DECLARATION:y,PR_KEYWORD:M,PR_LITERAL:l,PR_NOCODE:U,PR_PLAIN:f,PR_PUNCTUATION:u,PR_SOURCE:v,PR_STRING:w,PR_TAG:_,PR_TYPE:p,prettyPrintOne:P?m.prettyPrintOne=Tt:O=Tt,prettyPrint:D=P?m.prettyPrint=ye:D=ye},nt=m.define;typeof nt=="function"&&nt.amd&&nt("google-code-prettify",[],function(){return Re})})()},SKnc:function(Ye,re,I){var Y=I("bYtY"),H=I("QuXc"),P=function(R,O,D,m,T,b){this.x=R==null?0:R,this.y=O==null?0:O,this.x2=D==null?1:D,this.y2=m==null?0:m,this.type="linear",this.global=b||!1,H.call(this,T)};P.prototype={constructor:P},Y.inherits(P,H);var F=P;Ye.exports=F},SUKs:function(Ye,re,I){var Y=I("LPTA"),H=Y.debugMode,P=function(){};H===1&&(P=console.error);var F=P;Ye.exports=F},Sj9i:function(Ye,re,I){var Y=I("QBsz"),H=Y.create,P=Y.distSquare,F=Math.pow,R=Math.sqrt,O=1e-8,D=1e-4,m=R(3),T=1/3,b=H(),i=H(),d=H();function c(l){return l>-O&&l<O}function r(l){return l>O||l<-O}function a(l,u,f,_,y){var v=1-y;return v*v*(v*l+3*y*u)+y*y*(y*_+3*v*f)}function s(l,u,f,_,y){var v=1-y;return 3*(((u-l)*v+2*(f-u)*y)*v+(_-f)*y*y)}function o(l,u,f,_,y,v){var N=_+3*(u-f)-l,j=3*(f-u*2+l),U=3*(u-l),G=l-y,z=j*j-3*N*U,L=j*U-9*N*G,V=U*U-3*j*G,W=0;if(c(z)&&c(L))if(c(j))v[0]=0;else{var $=-U/j;$>=0&&$<=1&&(v[W++]=$)}else{var q=L*L-4*z*V;if(c(q)){var fe=L/z,$=-j/N+fe,se=-fe/2;$>=0&&$<=1&&(v[W++]=$),se>=0&&se<=1&&(v[W++]=se)}else if(q>0){var me=R(q),ve=z*j+1.5*N*(-L+me),Ae=z*j+1.5*N*(-L-me);ve<0?ve=-F(-ve,T):ve=F(ve,T),Ae<0?Ae=-F(-Ae,T):Ae=F(Ae,T);var $=(-j-(ve+Ae))/(3*N);$>=0&&$<=1&&(v[W++]=$)}else{var ge=(2*z*j-3*N*L)/(2*R(z*z*z)),ue=Math.acos(ge)/3,$e=R(z),Tt=Math.cos(ue),$=(-j-2*$e*Tt)/(3*N),se=(-j+$e*(Tt+m*Math.sin(ue)))/(3*N),ye=(-j+$e*(Tt-m*Math.sin(ue)))/(3*N);$>=0&&$<=1&&(v[W++]=$),se>=0&&se<=1&&(v[W++]=se),ye>=0&&ye<=1&&(v[W++]=ye)}}return W}function t(l,u,f,_,y){var v=6*f-12*u+6*l,N=9*u+3*_-3*l-9*f,j=3*u-3*l,U=0;if(c(N)){if(r(v)){var G=-j/v;G>=0&&G<=1&&(y[U++]=G)}}else{var z=v*v-4*N*j;if(c(z))y[0]=-v/(2*N);else if(z>0){var L=R(z),G=(-v+L)/(2*N),V=(-v-L)/(2*N);G>=0&&G<=1&&(y[U++]=G),V>=0&&V<=1&&(y[U++]=V)}}return U}function h(l,u,f,_,y,v){var N=(u-l)*y+l,j=(f-u)*y+u,U=(_-f)*y+f,G=(j-N)*y+N,z=(U-j)*y+j,L=(z-G)*y+G;v[0]=l,v[1]=N,v[2]=G,v[3]=L,v[4]=L,v[5]=z,v[6]=U,v[7]=_}function g(l,u,f,_,y,v,N,j,U,G,z){var L,V=.005,W=Infinity,$,q,fe,se;b[0]=U,b[1]=G;for(var me=0;me<1;me+=.05)i[0]=a(l,f,y,N,me),i[1]=a(u,_,v,j,me),fe=P(b,i),fe<W&&(L=me,W=fe);W=Infinity;for(var ve=0;ve<32&&!(V<D);ve++)$=L-V,q=L+V,i[0]=a(l,f,y,N,$),i[1]=a(u,_,v,j,$),fe=P(i,b),$>=0&&fe<W?(L=$,W=fe):(d[0]=a(l,f,y,N,q),d[1]=a(u,_,v,j,q),se=P(d,b),q<=1&&se<W?(L=q,W=se):V*=.5);return z&&(z[0]=a(l,f,y,N,L),z[1]=a(u,_,v,j,L)),R(W)}function C(l,u,f,_){var y=1-_;return y*(y*l+2*_*u)+_*_*f}function A(l,u,f,_){return 2*((1-_)*(u-l)+_*(f-u))}function w(l,u,f,_,y){var v=l-2*u+f,N=2*(u-l),j=l-_,U=0;if(c(v)){if(r(N)){var G=-j/N;G>=0&&G<=1&&(y[U++]=G)}}else{var z=N*N-4*v*j;if(c(z)){var G=-N/(2*v);G>=0&&G<=1&&(y[U++]=G)}else if(z>0){var L=R(z),G=(-N+L)/(2*v),V=(-N-L)/(2*v);G>=0&&G<=1&&(y[U++]=G),V>=0&&V<=1&&(y[U++]=V)}}return U}function M(l,u,f){var _=l+f-2*u;return _===0?.5:(l-u)/_}function E(l,u,f,_,y){var v=(u-l)*_+l,N=(f-u)*_+u,j=(N-v)*_+v;y[0]=l,y[1]=v,y[2]=j,y[3]=j,y[4]=N,y[5]=f}function p(l,u,f,_,y,v,N,j,U){var G,z=.005,L=Infinity;b[0]=N,b[1]=j;for(var V=0;V<1;V+=.05){i[0]=C(l,f,y,V),i[1]=C(u,_,v,V);var W=P(b,i);W<L&&(G=V,L=W)}L=Infinity;for(var $=0;$<32&&!(z<D);$++){var q=G-z,fe=G+z;i[0]=C(l,f,y,q),i[1]=C(u,_,v,q);var W=P(i,b);if(q>=0&&W<L)G=q,L=W;else{d[0]=C(l,f,y,fe),d[1]=C(u,_,v,fe);var se=P(d,b);fe<=1&&se<L?(G=fe,L=se):z*=.5}}return U&&(U[0]=C(l,f,y,G),U[1]=C(u,_,v,G)),R(L)}re.cubicAt=a,re.cubicDerivativeAt=s,re.cubicRootAt=o,re.cubicExtrema=t,re.cubicSubdivide=h,re.cubicProjectPoint=g,re.quadraticAt=C,re.quadraticDerivativeAt=A,re.quadraticRootAt=w,re.quadraticExtremum=M,re.quadraticSubdivide=E,re.quadraticProjectPoint=p},SqI9:function(Ye,re,I){var Y=I("y+Vt"),H=I("iXp4"),P=Y.extend({type:"sector",shape:{cx:0,cy:0,r0:0,r:0,startAngle:0,endAngle:Math.PI*2,clockwise:!0},brush:H(Y.prototype.brush),buildPath:function(F,R){var O=R.cx,D=R.cy,m=Math.max(R.r0||0,0),T=Math.max(R.r,0),b=R.startAngle,i=R.endAngle,d=R.clockwise,c=Math.cos(b),r=Math.sin(b);F.moveTo(c*m+O,r*m+D),F.lineTo(c*T+O,r*T+D),F.arc(O,D,T,b,i,!d),F.lineTo(Math.cos(i)*m+O,Math.sin(i)*m+D),m!==0&&F.arc(O,D,m,i,b,d),F.closePath()}});Ye.exports=P},SrGk:function(Ye,re,I){var Y=I("hydK"),H=Y.createElement,P=I("bYtY"),F=I("y+Vt"),R=I("Dagg"),O=I("dqUG"),D=I("P47w"),m=D.path,T=D.image,b=D.text,i="0",d="1";function c(a,s,o,t,h){this._zrId=a,this._svgRoot=s,this._tagNames=typeof o=="string"?[o]:o,this._markLabel=t,this._domName=h||"_dom",this.nextId=0}c.prototype.createElement=H,c.prototype.getDefs=function(a){var s=this._svgRoot,o=this._svgRoot.getElementsByTagName("defs");return o.length===0?a?(o=s.insertBefore(this.createElement("defs"),s.firstChild),o.contains||(o.contains=function(t){var h=o.children;if(!h)return!1;for(var g=h.length-1;g>=0;--g)if(h[g]===t)return!0;return!1}),o):null:o[0]},c.prototype.update=function(a,s){if(!a)return;var o=this.getDefs(!1);if(a[this._domName]&&o.contains(a[this._domName]))typeof s=="function"&&s(a);else{var t=this.add(a);t&&(a[this._domName]=t)}},c.prototype.addDom=function(a){var s=this.getDefs(!0);s.appendChild(a)},c.prototype.removeDom=function(a){var s=this.getDefs(!1);s&&a[this._domName]&&(s.removeChild(a[this._domName]),a[this._domName]=null)},c.prototype.getDoms=function(){var a=this.getDefs(!1);if(!a)return[];var s=[];return P.each(this._tagNames,function(o){var t=a.getElementsByTagName(o);s=s.concat([].slice.call(t))}),s},c.prototype.markAllUnused=function(){var a=this.getDoms(),s=this;P.each(a,function(o){o[s._markLabel]=i})},c.prototype.markUsed=function(a){a&&(a[this._markLabel]=d)},c.prototype.removeUnused=function(){var a=this.getDefs(!1);if(!a)return;var s=this.getDoms(),o=this;P.each(s,function(t){t[o._markLabel]!==d&&a.removeChild(t)})},c.prototype.getSvgProxy=function(a){return a instanceof F?m:a instanceof R?T:a instanceof O?b:m},c.prototype.getTextSvgElement=function(a){return a.__textSvgEl},c.prototype.getSvgElement=function(a){return a.__svgEl};var r=c;Ye.exports=r},T6xi:function(Ye,re,I){var Y=I("YgsL"),H=I("nCxF");function P(F,R,O){var D=R.points,m=R.smooth;if(D&&D.length>=2){if(m&&m!=="spline"){var T=H(D,m,O,R.smoothConstraint);F.moveTo(D[0][0],D[0][1]);for(var b=D.length,i=0;i<(O?b:b-1);i++){var d=T[i*2],c=T[i*2+1],r=D[(i+1)%b];F.bezierCurveTo(d[0],d[1],c[0],c[1],r[0],r[1])}}else{m==="spline"&&(D=Y(D,O)),F.moveTo(D[0][0],D[0][1]);for(var i=1,a=D.length;i<a;i++)F.lineTo(D[i][0],D[i][1])}O&&F.closePath()}}re.buildPath=P},"TS7/":function(Ye,re,I){"use strict";I.r(re);var Y=I("g9YV"),H=I("wCAj"),P=I("Znn+"),F=I("ZTPi"),R=I("5Dmo"),O=I("3S7+"),D=I("sPJy"),m=I("bE4q"),T=I("miYZ"),b=I("tsqr"),i=I("9og8"),d=I("2qtc"),c=I("kLXV"),r=I("tJVT"),a=I("WmNS"),s=I.n(a),o=I("q1tI"),t=I.n(o),h=I("Ty5D"),g=I("55Ip"),C=I("9kvl"),A=I("jhfD"),w=I("1vsH"),M=I("DjyN"),E=I("NUBc"),p=I("oBTY"),l=I("5NDa"),u=I("5rEg"),f=I("14J3"),_=I("BMrR"),y=I("jCWc"),v=I("kPKH"),N=I("+L6B"),j=I("2/Rp"),U=I("k1fw"),G=I("ErOA"),z=I("Ot1p"),L=I("m3rI"),V=I("9Bee"),W=function(ln){var xn=ln.shixunHomeworks,In=ln.dispatch,sr=Object(h.i)();return t.a.createElement(c.a,{centered:!0,title:"\u63D0\u793A",visible:xn.actionTabs.key==="\u5220\u9664",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(i.a)(s.a.mark(function $n(){var Zn;return s.a.wrap(function(mr){for(;;)switch(mr.prev=mr.next){case 0:return mr.next=2,In({type:"shixunHomeworks/deleteReply",payload:{object_id:xn.actionTabs.selectArr.id,object_type:"journals_for_message"}});case 2:Zn=mr.sent,Zn.status===0&&(b.b.success("\u5220\u9664\u6210\u529F"),In({type:"shixunHomeworks/setActionTabs",payload:{}}),In({type:"shixunHomeworks/getReplyList",payload:Object(U.a)({},xn.actionTabs.params)}));case 4:case"end":return mr.stop()}},$n)})),onCancel:function(){In({type:"shixunHomeworks/setActionTabs",payload:{}})}},t.a.createElement("p",null,"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417\uFF1F"))},$=Object(C.a)(function(vn){var ln=vn.shixunHomeworks;return{shixunHomeworks:ln}})(W),q=I("XYT7"),fe=I("wd/R"),se=I.n(fe),me=I("/MfK"),ve=I("BtR2"),Ae=I("942q"),ge=I.n(Ae),ue=I("xKgJ"),$e=I("gMzb");se.a.lang("ZH-cn");var Tt=function(ln){var xn=ln.shixunHomeworks,In=ln.classroomList,sr=ln.globalSetting,$n=ln.user,Zn=ln.loading,kn=ln.dispatch,mr=Object(o.useState)(Object(U.a)(Object(U.a)({},Object(h.i)()),{},{limit:10})),Fn=Object(r.a)(mr,2),nr=Fn[0],Gn=Fn[1],Hn=Object(o.useState)(!1),Sr=Object(r.a)(Hn,2),wr=Sr[0],br=Sr[1],Er=Object(o.useState)(-1),te=Object(r.a)(Er,2),Te=te[0],Ge=te[1],Me=Object(o.useState)(""),st=Object(r.a)(Me,2),Je=st[0],ct=st[1],ht=Object(o.useState)(""),at=Object(r.a)(ht,2),Mt=at[0],Gt=at[1],Vt=In.detailLeftMenus,wt=Object(o.useState)({}),Nt=Object(r.a)(wt,2),it=Nt[0],Qt=Nt[1],Wt=xn.workDetail,yn=xn.workList,Dn=Object(o.useState)({}),Kt=Object(r.a)(Dn,2),dn=Kt[0],Ht=Kt[1];nr.page_size=10,Object(o.useEffect)(function(){kn({type:"shixunHomeworks/getReplyList",payload:Object(U.a)({},nr)}),kn({type:"shixunHomeworks/getWorkDetail",payload:Object(U.a)({},nr)}),Vt.course_modules||kn({type:"classroomList/getClassroomLeftMenus",payload:Object(U.a)({},nr)})},[nr.categoryId]),Object(o.useEffect)(function(){xn!=null&&xn.replyList&&Qt(xn.replyList)},[xn]);function Sn(xt){return Tn.apply(this,arguments)}function Tn(){return Tn=Object(i.a)(s.a.mark(function xt(bt){var Lt;return s.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:if(dn!=null&&dn.ec_point_ids){Et.next=2;break}return Et.abrupt("return");case 2:return Et.next=4,Object(G.a)("/api/ec_courses/".concat(dn==null?void 0:dn.ec_course_id,"/ec_points/set_work_points.json"),{method:"post",body:Object(U.a)({homework_common_id:bt},dn)});case 4:Lt=Et.sent;case 5:case"end":return Et.stop()}},xt)})),Tn.apply(this,arguments)}return t.a.createElement("section",{className:ge.a.bg},t.a.createElement("section",{className:" edu-container"},t.a.createElement("aside",{className:[ge.a.desc,"c-black","font14","bg-white"].join(" ")},xn.actionTabs.key!=="\u7F16\u8F91\u4F5C\u4E1A"&&t.a.createElement(V.a,{value:(Wt==null?void 0:Wt.explanation)||"\u6682\u65E0\uFF5E"}),xn.actionTabs.key==="\u7F16\u8F91\u4F5C\u4E1A"&&t.a.createElement("aside",{className:["bg-white"].join(" ")},t.a.createElement(z.a,{onChange:function(bt){ct(bt)},defaultValue:(Wt==null?void 0:Wt.explanation)||"",height:200,isFocus:!0,watch:!0}),t.a.createElement($e.a,{setitem:function(bt){return Ht(Object(U.a)({},bt))},homework_common_id:nr.categoryId}),t.a.createElement(_.a,null,t.a.createElement(v.a,{span:24,className:"tr"},t.a.createElement(j.a,{type:"default",size:"large",onClick:Object(i.a)(s.a.mark(function xt(){return s.a.wrap(function(Lt){for(;;)switch(Lt.prev=Lt.next){case 0:kn({type:"shixunHomeworks/setActionTabs",payload:{key:""}});case 1:case"end":return Lt.stop()}},xt)}))},"\u53D6\u6D88"),t.a.createElement(j.a,{type:"primary",size:"large",className:"ml20",onClick:Object(i.a)(s.a.mark(function xt(){var bt;return s.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:if(!(Je==="")){At.next=4;break}b.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),At.next=9;break;case 4:return At.next=6,kn({type:"shixunHomeworks/updateWork",payload:{explanation:Je,categoryId:nr.categoryId}});case 6:bt=At.sent,Sn(nr.categoryId),bt.status===0&&(b.b.success("\u64CD\u4F5C\u6210\u529F"),kn({type:"shixunHomeworks/setActionTabs",payload:{key:""}}),kn({type:"shixunHomeworks/getWorkDetail",payload:Object(U.a)({},nr)}));case 9:case"end":return At.stop()}},xt)}))},"\u4FDD\u5B58"))))),t.a.createElement("aside",{className:[ge.a.reply,"bg-white","mt20"].join(" ")},wr&&t.a.createElement(z.a,{onChange:function(bt){ct(bt)},height:200,isFocus:!0,watch:!0}),t.a.createElement(_.a,{onClick:function(){br(!0)}},t.a.createElement(v.a,{flex:"1"},!wr&&t.a.createElement(u.a,{size:"large",className:"current",placeholder:"\u8BF4\u70B9\u4EC0\u4E48",disabled:!0})),t.a.createElement(v.a,null,t.a.createElement(j.a,{type:"primary",size:"large",onClick:Object(i.a)(s.a.mark(function xt(){var bt;return s.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:if(!(Je==="")){At.next=4;break}b.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),At.next=8;break;case 4:return At.next=6,kn({type:"shixunHomeworks/createReply",payload:{journals_for_message:{jour_id:nr.categoryId,jour_type:"HomeworkCommon",reply_id:1,notes:Je}}});case 6:bt=At.sent,bt.status===0&&(b.b.success("\u53D1\u5E03\u6210\u529F"),kn({type:"shixunHomeworks/getReplyList",payload:Object(U.a)({},nr)}),br(!1),ct(""));case 8:case"end":return At.stop()}},xt)}))},"\u53D1\u8868")))),(it==null?void 0:it.comments)&&it.comments!=""&&t.a.createElement("aside",{className:[ge.a.replyList,"bg-white"].join(" ")},it==null?void 0:it.comments.map(function(xt,bt){var Lt,At,Et,mn;return t.a.createElement(_.a,{gutter:[12,12],key:bt},t.a.createElement(v.a,{flex:"40px"},t.a.createElement("img",{width:"40",src:"".concat(L.a.IMG_SERVER,"/images/").concat(xt==null||((Lt=xt.author)===null||Lt===void 0)?void 0:Lt.image_url)})),t.a.createElement(v.a,{flex:"1"},t.a.createElement(_.a,{align:"middle"},t.a.createElement(v.a,{span:20},t.a.createElement("span",{className:"c-light-black"},xt==null||((At=xt.author)===null||At===void 0)?void 0:At.name),t.a.createElement("span",{className:"c-light-black ml10"},xt.time," \u53D1\u5E03")),t.a.createElement(v.a,{span:4},t.a.createElement("div",{className:"tr"},(Object(ue.c)()||($n==null||((Et=$n.userInfo)===null||Et===void 0)?void 0:Et.login)===(xt==null||((mn=xt.author)===null||mn===void 0)?void 0:mn.login))&&t.a.createElement(me.a,{className:"current",onClick:function(){kn({type:"shixunHomeworks/setActionTabs",payload:{key:"\u5220\u9664",params:nr,selectArr:xt,object_type:"message"}})}}))),t.a.createElement(v.a,{span:24},t.a.createElement(V.a,{value:xt.content})),xt.children&&t.a.createElement("aside",{className:ge.a.comment},xt.children.map(function(cn,_n){var un,rn;return t.a.createElement(_.a,{key:_n},t.a.createElement(v.a,{span:24},t.a.createElement(_.a,null,t.a.createElement(v.a,{flex:"1"},cn.author.name,t.a.createElement("span",{className:"c-light-black ml10"},se()(cn==null?void 0:cn.created_on).fromNow())),t.a.createElement(v.a,null,(Object(ue.c)()||($n==null||((un=$n.userInfo)===null||un===void 0)?void 0:un.login)===(cn==null||((rn=cn.author)===null||rn===void 0)?void 0:rn.login))&&t.a.createElement(O.a,{title:"\u5220\u9664"},t.a.createElement(me.a,{className:"current",onClick:function(){kn({type:"shixunHomeworks/setActionTabs",payload:{key:"\u5220\u9664",params:nr,selectArr:cn}})}}))))),t.a.createElement(v.a,null,t.a.createElement(V.a,{value:cn.content})))})),t.a.createElement("div",{className:"tc w100 mt10"},t.a.createElement(E.a,{defaultCurrent:1,total:xt==null?void 0:xt.child_message_count,hideOnSinglePage:!0,pageSize:5,current:xt.page||1,onChange:function(){var cn=Object(i.a)(s.a.mark(function _n(un){var rn,Cn;return s.a.wrap(function(cr){for(;;)switch(cr.prev=cr.next){case 0:return cr.next=2,Object(q.H)(Object(U.a)(Object(U.a)({},nr),{},{parent_id:xt.id,page:un,limit:5}));case 2:Cn=cr.sent,Cn!=null&&(rn=Cn.comments)!==null&&rn!==void 0&&rn.length&&(it.comments[bt].page=un,it.comments[bt].children=Object(p.a)(Cn==null?void 0:Cn.comments),Qt(Object(U.a)({},it)));case 4:case"end":return cr.stop()}},_n)}));return function(_n){return cn.apply(this,arguments)}}()})),t.a.createElement(v.a,{span:24,className:"mt5 c-light-black"},Te===bt&&t.a.createElement("aside",null,t.a.createElement(z.a,{onChange:function(_n){Gt(_n)},height:150,isFocus:!0}),t.a.createElement(_.a,null,t.a.createElement(v.a,{span:24,className:"tr"},t.a.createElement(j.a,{type:"primary",size:"large",onClick:Object(i.a)(s.a.mark(function cn(){var _n,un;return s.a.wrap(function(Cn){for(;;)switch(Cn.prev=Cn.next){case 0:if(!(Mt==="")){Cn.next=4;break}b.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),Cn.next=12;break;case 4:return Cn.next=6,kn({type:"shixunHomeworks/createReply",payload:{journals_for_message:{jour_id:nr.categoryId,jour_type:"HomeworkCommon",m_parent_id:xt.id,reply_id:1,notes:Mt}}});case 6:return Cn.next=8,Object(q.H)(Object(U.a)(Object(U.a)({},nr),{},{parent_id:xt.id,limit:5}));case 8:un=Cn.sent,un!=null&&(_n=un.comments)!==null&&_n!==void 0&&_n.length&&(++it.comments[bt].child_message_count,it.comments[bt].children=Object(p.a)(un==null?void 0:un.comments),it.comments[bt].page=1,Qt(it)),b.b.success("\u53D1\u5E03\u6210\u529F"),Ge(-1);case 12:case"end":return Cn.stop()}},cn)}))},"\u53D1\u8868")))),Te!==bt&&t.a.createElement("div",{className:"tr"},t.a.createElement("span",{className:"iconfont icon-huifu1 mr5 ml30",onClick:function(){return Ge(bt)}}),xt.child_message_count||0,!!(xt!=null&&xt.user_praise)&&t.a.createElement("span",{className:"c-orange"},t.a.createElement(ve.a,{className:"mr5 ml30",onClick:Object(i.a)(s.a.mark(function cn(){return s.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:return un.next=2,kn({type:"shixunHomeworks/replyUnLike",payload:{object_id:xt.id,object_type:"journals_for_message"}});case 2:kn({type:"shixunHomeworks/getReplyList",payload:Object(U.a)({},nr)});case 3:case"end":return un.stop()}},cn)}))}),xt==null?void 0:xt.praise_count),!xt.user_praise&&t.a.createElement("span",null,t.a.createElement(ve.a,{className:"mr5 ml30",onClick:Object(i.a)(s.a.mark(function cn(){return s.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:return un.next=2,kn({type:"shixunHomeworks/replyLike",payload:{object_id:xt.id,object_type:"journals_for_message"}});case 2:kn({type:"shixunHomeworks/getReplyList",payload:Object(U.a)({},nr)});case 3:case"end":return un.stop()}},cn)}))}),xt.praise_count))))))}))),t.a.createElement("aside",{className:"tc mt30 pb30"},t.a.createElement(E.a,{defaultCurrent:1,total:it==null?void 0:it.parent_messages_count,hideOnSinglePage:!0,current:nr.page||1,pageSize:10,onChange:function(bt){nr.page=bt,kn({type:"shixunHomeworks/getReplyList",payload:Object(U.a)({},nr)})}})),t.a.createElement($,null))},ye=Object(C.a)(function(vn){var ln=vn.shixunHomeworks,xn=vn.classroomList,In=vn.loading,sr=vn.user,$n=vn.globalSetting;return{shixunHomeworks:ln,globalSetting:$n,classroomList:xn,user:sr,loading:In.effects}})(Tt),Re=I("giR+"),nt=I("fyUT"),Ue=I("7Kak"),ke=I("9yH6"),lt=I("qVdP"),Fe=I("jsC+"),Ze=I("sRBo"),Xe=I("kaz8"),ft=I("lUTK"),Rt=I("BvKs"),Pt=I("jrin"),Bt=I("y8nQ"),Ve=I("Vl3Y"),Ft=I("8Skl"),nn=I("y3Kf"),Le=I("CTES"),Se=I("Llu2"),ut=I("0NbB"),mt=I("BdwD"),We=I("Xm8N"),vt=I("PpiC"),Pe=I("IMoZ"),xe=function(ln){var xn=ln.shixunHomeworks,In=ln.dispatch,sr=Object(vt.a)(ln,["shixunHomeworks","dispatch"]),$n=Object(h.i)(),Zn=Object(o.useState)(!0),kn=Object(r.a)(Zn,2),mr=kn[0],Fn=kn[1],nr=Object(o.useState)(!1),Gn=Object(r.a)(nr,2),Hn=Gn[0],Sr=Gn[1],wr=Ve.a.useForm(),br=Object(r.a)(wr,1),Er=br[0],te=function(){var Te=Object(i.a)(s.a.mark(function Ge(){var Me,st;return s.a.wrap(function(ct){for(;;)switch(ct.prev=ct.next){case 0:return Me=Er.getFieldValue(),ct.next=3,Object(G.a)("/api/homework_commons/".concat($n.categoryId,"/batch_comment.json"),{method:"post",body:{student_work_ids:Object(p.a)(xn.actionTabs.selectArrs),cover_all:mr,hidden_comment:Me.hidden_comment,comment:Me.comment}});case 3:st=ct.sent,st.status===0&&(b.b.success("\u8BC4\u9605\u6210\u529F"),Er.resetFields(),In({type:"shixunHomeworks/setActionTabs",payload:{}}),In({type:"shixunHomeworks/getWorkList",payload:Object(U.a)({},xn.actionTabs.params)}));case 5:case"end":return ct.stop()}},Ge)}));return function(){return Te.apply(this,arguments)}}();return t.a.createElement(t.a.Fragment,null,t.a.createElement(c.a,{centered:!0,title:"\u4E00\u952E\u70B9\u8BC4",visible:xn.actionTabs.key==="\u4E00\u952E\u70B9\u8BC4",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(i.a)(s.a.mark(function Te(){var Ge;return s.a.wrap(function(st){for(;;)switch(st.prev=st.next){case 0:Ge=Er.getFieldValue(),JSON.stringify(Ge)==="{}"||Ge.hidden_comment===""&&Ge.comment===""?Sr(!0):xn.workList.partial_comment?In({type:"shixunHomeworks/setActionTabs",payload:{key:"\u4E00\u952E\u70B9\u8BC4\u786E\u8BA4",selectArrs:xn.actionTabs.selectArrs,params:xn.actionTabs.params}}):te();case 2:case"end":return st.stop()}},Te)})),onCancel:function(){In({type:"shixunHomeworks/setActionTabs",payload:{}})}},t.a.createElement(Ve.a,{form:Er,onChange:function(){Hn&&Sr(!1)}},t.a.createElement("p",null,"\u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),t.a.createElement(Ve.a.Item,{name:"comment"},t.a.createElement(u.a.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:8})),t.a.createElement("p",null,"\u4EC5\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),t.a.createElement(Ve.a.Item,{name:"hidden_comment"},t.a.createElement(u.a.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:8}))),Hn&&t.a.createElement("p",{className:"c-red"},"\u8BC4\u9605\u5185\u5BB9\u81F3\u5C11\u6709\u4E00\u4E2A\u4E0D\u4E3A\u7A7A")),t.a.createElement(c.a,{centered:!0,title:t.a.createElement("span",null,t.a.createElement(Pe.a,{className:"c-orange mr20"}),"\u63D0\u793A"),visible:xn.actionTabs.key==="\u4E00\u952E\u70B9\u8BC4\u786E\u8BA4",okText:"\u786E\u5B9A\u70B9\u8BC4",cancelText:"\u653E\u5F03\u70B9\u8BC4",onOk:function(){te()},onCancel:function(){In({type:"shixunHomeworks/setActionTabs",payload:{}})},width:400},t.a.createElement("div",{className:"tc"},t.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"),t.a.createElement("p",null,t.a.createElement(ke.a.Group,{onChange:function(Ge){Fn(Ge.target.value)},value:mr},t.a.createElement(ke.a,{value:!0},"\u8986\u76D6\u5DF2\u6709\u70B9\u8BC4"),t.a.createElement(ke.a,{value:!1},"\u8DF3\u8FC7\u5DF2\u6709\u70B9\u8BC4"))))))},we=Object(C.a)(function(vn){var ln=vn.shixunHomeworks;return{shixunHomeworks:ln}})(xe),ie=I("BoW6"),ae=I.n(ie),ce=function(ln){var xn,In,sr,$n,Zn=ln.shixunHomeworks,kn=ln.dispatch,mr=Object(vt.a)(ln,["shixunHomeworks","dispatch"]),Fn=Object(h.i)(),nr=Object(o.useState)(!1),Gn=Object(r.a)(nr,2),Hn=Gn[0],Sr=Gn[1],wr=Object(o.useState)((xn=Zn.actionTabs.selectArrs)===null||xn===void 0||((In=xn.data)===null||In===void 0)?void 0:In.name),br=Object(r.a)(wr,2),Er=br[0],te=br[1],Te=Ve.a.useForm(),Ge=Object(r.a)(Te,1),Me=Ge[0];Object(o.useEffect)(function(){var Je,ct,ht,at,Mt,Gt;Zn.actionTabs.key==="\u66F4\u6539\u70B9\u8BC4"&&Me.setFieldsValue({comment:(Je=Zn.actionTabs.selectArrs)===null||Je===void 0||((ct=Je.data)===null||ct===void 0)?void 0:ct.work_comment,hidden_comment:(ht=Zn.actionTabs.selectArrs)===null||ht===void 0||((at=ht.data)===null||at===void 0)?void 0:at.work_comment_hidden}),te((Mt=Zn.actionTabs.selectArrs)===null||Mt===void 0||((Gt=Mt.data)===null||Gt===void 0)?void 0:Gt.name)},[Zn.actionTabs.key]);var st=function(){var Je=Object(i.a)(s.a.mark(function ct(){var ht,at,Mt,Gt;return s.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return Mt=Me.getFieldValue(),wt.next=3,Object(G.a)("/api/student_works/".concat((ht=Zn.actionTabs.selectArrs)===null||ht===void 0||((at=ht.data)===null||at===void 0)?void 0:at.homeworkId,"/shixun_work_comment.json"),{method:"post",body:{hidden_comment:Mt.hidden_comment,comment:Mt.comment}});case 3:if(Gt=wt.sent,!(Gt.status===0)){wt.next=9;break}return b.b.success("\u8BC4\u9605\u6210\u529F"),Me.resetFields(),kn({type:"shixunHomeworks/setActionTabs",payload:{}}),wt.abrupt("return",kn({type:"shixunHomeworks/getWorkList",payload:Fn}));case 9:case"end":return wt.stop()}},ct)}));return function(){return Je.apply(this,arguments)}}();return t.a.createElement(t.a.Fragment,null,t.a.createElement(c.a,{centered:!0,title:(sr=Zn.actionTabs.selectArrs)!==null&&sr!==void 0&&($n=sr.data)!==null&&$n!==void 0&&$n.work_comment_hidden?"\u66F4\u6539"+Er+"\u70B9\u8BC4":Er+"\u70B9\u8BC4",visible:Zn.actionTabs.key==="\u66F4\u6539\u70B9\u8BC4",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(i.a)(s.a.mark(function Je(){var ct;return s.a.wrap(function(at){for(;;)switch(at.prev=at.next){case 0:ct=Me.getFieldValue(),JSON.stringify(ct)==="{}"||ct.hidden_comment===""&&ct.comment===""?Sr(!0):st();case 2:case"end":return at.stop()}},Je)})),onCancel:function(){kn({type:"shixunHomeworks/setActionTabs",payload:{}})}},t.a.createElement(Ve.a,{form:Me,onChange:function(){Hn&&Sr(!1)}},t.a.createElement("p",null,"\u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),t.a.createElement(Ve.a.Item,{name:"comment"},t.a.createElement(u.a.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:8})),t.a.createElement("p",null,"\u4EC5\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),t.a.createElement(Ve.a.Item,{name:"hidden_comment"},t.a.createElement(u.a.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:8}))),Hn&&t.a.createElement("p",{className:"c-red"},"\u8BC4\u9605\u5185\u5BB9\u81F3\u5C11\u6709\u4E00\u4E2A\u4E0D\u4E3A\u7A7A")))},be=Object(C.a)(function(vn){var ln=vn.shixunHomeworks;return{shixunHomeworks:ln}})(ce),Ce=function(ln){var xn=ln.shixunHomeworks,In=ln.dispatch,sr=Object(vt.a)(ln,["shixunHomeworks","dispatch"]),$n=Object(h.i)(),Zn=Object(o.useState)([]),kn=Object(r.a)(Zn,2),mr=kn[0],Fn=kn[1],nr=Object(o.useState)([]),Gn=Object(r.a)(nr,2),Hn=Gn[0],Sr=Gn[1];Object(o.useEffect)(function(){xn.actionTabs.key==="\u8D28\u91CF\u68C0\u6D4B"&&wr()},[xn.actionTabs.key]);function wr(){return br.apply(this,arguments)}function br(){return br=Object(i.a)(s.a.mark(function te(){var Te;return s.a.wrap(function(Me){for(;;)switch(Me.prev=Me.next){case 0:return Me.next=2,Object(G.a)("/api/homework_commons/".concat($n.categoryId,"/code_quality_analyses/group_list.json"),{method:"GET",params:{page:1,limit:200}});case 2:Te=Me.sent,Fn(Te);case 4:case"end":return Me.stop()}},te)})),br.apply(this,arguments)}var Er=[{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 t.a.createElement(t.a.Fragment,null,t.a.createElement(c.a,{centered:!0,title:"\u4EE3\u7801\u8D28\u91CF\u8BC4\u5206",visible:xn.actionTabs.key==="\u8D28\u91CF\u68C0\u6D4B",width:700,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(i.a)(s.a.mark(function te(){var Te;return s.a.wrap(function(Me){for(;;)switch(Me.prev=Me.next){case 0:return Me.next=2,Object(G.a)("/api/homework_commons/".concat($n.categoryId,"/code_quality_analyses.json"),{method:"POST",body:{group_ids:Hn}});case 2:Te=Me.sent,(Te==null?void 0:Te.status)===0&&(C.d.replace("/classrooms/".concat($n.coursesId,"/shixun_homework/").concat($n.categoryId,"/detail?tabs=4")),window.location.reload(),In({type:"shixunHomeworks/setActionTabs",payload:{}}),Sr([]));case 4:case"end":return Me.stop()}},te)})),onCancel:function(){Sr([]),In({type:"shixunHomeworks/setActionTabs",payload:{}})}},t.a.createElement(H.a,{rowSelection:{type:"checkbox",onChange:function(Te,Ge){Sr(Object(p.a)(Te))},selectedRowKeys:Hn,getCheckboxProps:function(Te){return{disabled:Te.status==="\u8FDB\u884C\u4E2D"||Te.works_count===0}}},rowKey:function(Te){return Te.key||Te.id},scroll:{y:300},pagination:!1,columns:Er,dataSource:mr==null?void 0:mr.group_list})))},Be=Object(C.a)(function(vn){var ln=vn.shixunHomeworks;return{shixunHomeworks:ln}})(Ce),yt=I("mgmH"),Xt=function(ln){var xn,In,sr,$n,Zn,kn,mr,Fn,nr,Gn,Hn,Sr,wr,br,Er,te=ln.shixunHomeworks,Te=ln.loading,Ge=ln.dispatch,Me=ln.setExportParams,st=ln.user,Je=Object(h.i)(),ct=Object(o.useState)(Object(U.a)(Object(U.a)({},{page:1,limit:20,order:"work_score",b_order:"desc"}),Je)),ht=Object(r.a)(ct,2),at=ht[0],Mt=ht[1],Gt=Ve.a.useForm(),Vt=Object(r.a)(Gt,1),wt=Vt[0],Nt=Object(o.useState)(),it=Object(r.a)(Nt,2),Qt=it[0],Wt=it[1],yn=Object(o.useState)({}),Dn=Object(r.a)(yn,2),Kt=Dn[0],dn=Dn[1],Ht=Object(o.useState)([]),Sn=Object(r.a)(Ht,2),Tn=Sn[0],xt=Sn[1],bt=Object(o.useState)(!1),Lt=Object(r.a)(bt,2),At=Lt[0],Et=Lt[1],mn=Object(o.useState)([]),cn=Object(r.a)(mn,2),_n=cn[0],un=cn[1],rn=Object(o.useState)(!1),Cn=Object(r.a)(rn,2),rr=Cn[0],cr=Cn[1],zn=Object(o.useState)(),Dr=Object(r.a)(zn,2),Kr=Dr[0],Bn=Dr[1],Xn=Object(o.useState)(1),Qn=Object(r.a)(Xn,2),Cr=Qn[0],Wr=Qn[1],Jr=Object(o.useState)(),li=Object(r.a)(Jr,2),xi=li[0],mi=li[1],Xi=Object(o.useState)(),Oi=Object(r.a)(Xi,2),Pi=Oi[0],vi=Oi[1],Ni=Object(o.useState)(),ia=Object(r.a)(Ni,2),ui=ia[0],di=ia[1],Ri=Object(o.useState)(),Ci=Object(r.a)(Ri,2),Oe=Ci[0],et=Ci[1],rt=Object(o.useState)(),Ie=Object(r.a)(rt,2),de=Ie[0],Ee=Ie[1],pe=Object(o.useState)(!1),Ne=Object(r.a)(pe,2),Ke=Ne[0],ot=Ne[1];Object(o.useEffect)(function(){return He(!0),function(){dn([]),xt([])}},[at.coursesId]),Object(o.useEffect)(function(){var on,It=JSON.parse(JSON.stringify(te.workList));!(It!=null&&(on=It.student_works)!==null&&on!==void 0&&on.length)&&It!==null&&It!==void 0&&It.id?(It.student_works=[Object(U.a)({},It)],dn(It)):(It!=null&&It.id&&xt([Object(U.a)(Object(U.a)({},It),{number:"\u6211"})]),dn(Object(U.a)({},It)))},[te.workList]);var He=function(It){Me(Object(U.a)({},at));var Jt=Ge({type:"shixunHomeworks/getWorkList",payload:at});return It&&Jt.then(function(Pn){var En,vr,qn;(Pn!=null&&(En=Pn.homework_status)!==null&&En!==void 0&&En.includes("\u8FDB\u884C\u4E2D")||Pn!=null&&(vr=Pn.homework_status)!==null&&vr!==void 0&&vr.includes("\u8865\u4EA4\u4E2D")||Pn!=null&&(qn=Pn.homework_status)!==null&&qn!==void 0&&qn.includes("\u63D0\u4EA4\u4E2D"))&&!Object(ue.s)()&&Ut()}),Jt};Object(o.useEffect)(function(){_t()},[]);var _t=function(){var on=Object(i.a)(s.a.mark(function It(){var Jt;return s.a.wrap(function(En){for(;;)switch(En.prev=En.next){case 0:return En.next=2,Object(q.I)({categoryId:Je.categoryId});case 2:Jt=En.sent,Wt(Jt==null?void 0:Jt.update_score);case 4:case"end":return En.stop()}},It)}));return function(){return on.apply(this,arguments)}}(),Ut=function(){var on=Object(i.a)(s.a.mark(function It(){var Jt;return s.a.wrap(function(En){for(;;)switch(En.prev=En.next){case 0:return Ge({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6210\u7EE9\u8BA1\u7B97\u4E2D\uFF0C\u8BF7\u7A0D\u5019..."}}),En.next=3,Object(q.Z)({categoryId:Je.categoryId});case 3:Jt=En.sent,Ge({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}}),(Jt==null?void 0:Jt.status)===0&&(b.b.success(Jt==null?void 0:Jt.message),He());case 6:case"end":return En.stop()}},It)}));return function(){return on.apply(this,arguments)}}(),en=function(){at.page=1;var It=Object.assign({},wt.getFieldValue());delete at.course_group,delete at.teacher_comment,Object.keys(It).map(function(Jt){switch(Jt){case"task_status":It[Jt].includes("all")||!It[Jt].length?(delete at.work_status,wt.setFieldsValue(Object(Pt.a)({},"task_status","all"))):(at.work_status=It[Jt],wt.setFieldsValue(Object(Pt.a)({},"task_status",at.work_status)));break;case"course_group_info":It[Jt].includes("all")||!It[Jt].length?(delete at.course_group,wt.setFieldsValue(Object(Pt.a)({},"course_group_info","all"))):(at.course_group=It[Jt],wt.setFieldsValue(Object(Pt.a)({},"course_group_info",at.course_group)));break;case"teacher_comment":if(It[Jt].includes("all")||!It[Jt].length)delete at.teacher_comment,wt.setFieldsValue(Object(Pt.a)({},"teacher_comment","all"));else{var Pn;at.teacher_comment=((Pn=It[Jt])===null||Pn===void 0?void 0:Pn.length)===1?Number(It[Jt][0]):"",wt.setFieldsValue(Object(Pt.a)({},"teacher_comment",It[Jt]))}break}}),He()};Object(o.useEffect)(function(){if(document.getElementById("divhe")){var on=document.getElementById("divhe").scrollHeight;on>47&&(Ee(47),ot(!0))}},[document.getElementById("divhe")]);var hn=function(It,Jt){at.page=It,at.limit=20,He()};function Rn(){Wr(1),mi(""),vi(""),di(""),et(""),un([])}var Wn=[{title:"\u5E8F\u53F7",dataIndex:"number",align:"center",width:50,fixed:"left",ellipsis:{showTitle:!1},render:function(It,Jt,Pn){return at.limit*(at.page-1)+Pn+1}},{title:"\u59D3\u540D",dataIndex:"user_name",align:"center",width:110,fixed:"left",ellipsis:{showTitle:!1},render:function(It){return t.a.createElement(O.a,{placement:"bottomLeft",title:It},t.a.createElement("span",{className:"current"},It))}},!(Kt!=null&&Kt.is_excellent)&&!Object(ue.r)()&&{title:"\u5B66\u53F7",dataIndex:"student_id",align:"center",sorter:!0,width:110,showSorterTooltip:!1,ellipsis:{showTitle:!1},sortOrder:at.order==="student_id"?at.b_order==="desc"?"descend":"ascend":null,render:function(It){return t.a.createElement(O.a,{placement:"bottomLeft",title:It||"--"},t.a.createElement("span",{className:"current"},It||"--"))}},{title:"\u5206\u73ED",dataIndex:"group_name",align:"center",width:180,ellipsis:{showTitle:!1},render:function(It,Jt){return It?t.a.createElement(O.a,{placement:"bottom",title:It},t.a.createElement("span",{className:"current"},It)):"--"}},{title:"\u4F5C\u4E1A\u72B6\u6001",dataIndex:"work_status",align:"center",width:80,sorter:!0,ellipsis:{showTitle:!1},showSorterTooltip:!1,sortOrder:at.order==="work_status"?at.b_order==="desc"?"descend":"ascend":null,render:function(It){return t.a.createElement(w.h,{status:It})}},{title:t.a.createElement("span",null,"\u5B8C\u6210\u65F6\u95F4"),dataIndex:"finished_time",align:"center",width:130,ellipsis:{showTitle:!1},showSorterTooltip:!1,sorter:!0,sortOrder:at.order==="finished_time"?at.b_order==="desc"?"descend":"ascend":null,render:function(It,Jt){return It?t.a.createElement(O.a,{placement:"bottomLeft",title:It},It):"--"}},{title:t.a.createElement("span",null,"\u5B9E\u8BAD\u603B\u8017\u65F6"),dataIndex:"cost_time",align:"center",width:130,ellipsis:{showTitle:!1},showSorterTooltip:!1,sorter:!0,sortOrder:at.order==="cost_time"?at.b_order==="desc"?"descend":"ascend":null,render:function(It,Jt){return It?t.a.createElement(O.a,{placement:"bottomLeft",title:It},It):"--"}},{title:"\u901A\u5173\u60C5\u51B5",align:"center",dataIndex:"complete_count",ellipsis:{showTitle:!1},render:function(It,Jt){return t.a.createElement("span",null,It||0,"/",Kt.challenges_count)}},{title:"\u8BC4\u6D4B\u6B21\u6570",dataIndex:"sum_evaluate_count",align:"center",ellipsis:{showTitle:!1},sorter:!0,sortOrder:at.order==="sum_evaluate_count"?at.b_order==="desc"?"descend":"ascend":null,render:function(It,Jt){return It&&It!="--"?t.a.createElement(O.a,{placement:"bottom",title:It},t.a.createElement("span",{className:"current"},It)):"--"}},!Object(ue.r)()&&{title:t.a.createElement("span",null,"\u6700\u7EC8\u6210\u7EE9",t.a.createElement(O.a,{placement:"top",title:t.a.createElement("pre",null,"\u9F20\u6807\u505C\u7559\u5177\u4F53\u5206\u503C\u4E0A\u53EF\u67E5",t.a.createElement("br",null),"\u770B\u5F97\u5206\u660E\u7EC6",t.a.createElement("br",null))},t.a.createElement("img",{src:"".concat(L.a.IMG_SERVER,"/images/educoder/problem.png"),className:"ml2 current"}))),dataIndex:"work_score",sorter:!0,align:"center",showSorterTooltip:!1,sortOrder:at.order==="work_score"?at.b_order==="desc"?"descend":"ascend":null,ellipsis:{showTitle:!1},render:function(It,Jt){var Pn,En;return It>=0&&It<=60?En=t.a.createElement("span",{className:"c-red"},It):It===100?En=t.a.createElement("span",{className:"c-green"},It):It>60?En=t.a.createElement("span",{className:"c-orange"},It):En="--",t.a.createElement(O.a,{placement:"bottom",title:Jt.ultimate_score?t.a.createElement("div",null,En==="--"?"\u6700\u7EC8\u8C03\u6574\u6210\u7EE9\uFF1A0\u5206":"\u6700\u7EC8\u8C03\u6574\u6210\u7EE9\uFF1A".concat(Jt.work_score,"\u5206")):t.a.createElement("div",null,t.a.createElement("div",null,Jt.final_score?"\u5173\u5361\u5F97\u5206\uFF1A".concat(Jt.final_score,"\u5206"):"\u5173\u5361\u5F97\u5206\uFF1A0\u5206"),t.a.createElement("div",null,Jt.eff_score?"\u6548\u7387\u8BC4\u5206\uFF1A".concat(Jt.eff_score,"\u5206"):"\u6548\u7387\u8BC4\u5206\uFF1A0\u5206"),t.a.createElement("div",null,Jt.late_penalty?"\u8FDF\u4EA4\u6263\u5206\uFF1A".concat(Jt.late_penalty,"\u5206"):"\u8FDF\u4EA4\u6263\u5206\uFF1A0\u5206"),!((Pn=te.workList)!==null&&Pn!==void 0&&Pn.answer_open_evaluation)&&t.a.createElement("div",null,"\u67E5\u770B\u53C2\u8003\u7B54\u6848\uFF1A",Jt.view_answer_count,"\u5173"),t.a.createElement("div",null,Jt.work_score?"\u6700\u7EC8\u6210\u7EE9\uFF1A".concat(Jt.work_score,"\u5206"):"\u6700\u7EC8\u6210\u7EE9\uFF1A0\u5206"))},En)}},{title:"\u6253\u56DE\u6B21\u6570",dataIndex:"redo_count",align:"center",render:function(It){return It||"- -"}},{title:t.a.createElement("span",null,"\u8BC4\u9605\u72B6\u6001",t.a.createElement(O.a,{overlayClassName:ae.a.reviewStatusTooltip,placement:"top",title:t.a.createElement("pre",null,"\u4EE5\u4E0B\u60C5\u5F62\u51FA\u73B0\u4E00\u79CD\uFF0C\u8BC4\u9605\u72B6\u6001\u81EA\u52A8\u53D8\u4E3A\u5DF2\u8BC4\u9605\uFF1A",t.a.createElement("br",null),"1.\u5B66\u751F\u5F00\u542F\u4F5C\u4E1A\uFF0C\u7CFB\u7EDF\u5BF9\u5B66\u751F\u8FDB\u884C\u4E86\u81EA\u52A8\u6253\u5206\uFF1B",t.a.createElement("br",null),"2.\u8001\u5E08\u5BF9\u5B66\u751F\u4F5C\u4E1A\u8FDB\u884C\u5173\u5361\u8C03\u5206\u6216\u8005\u8FFD\u52A0\u70B9\u8BC4\uFF1B",t.a.createElement("br",null),"3.\u6574\u4E2A\u4F5C\u4E1A\u622A\u6B62/\u8865\u4EA4\u7ED3\u675F\u540E\uFF0C\u6240\u6709\u5B66\u751F\u4F5C\u4E1A\u72B6\u6001\u5C06\u81EA\u52A8\u53D8\u4E3A\u5DF2\u8BC4\u9605\u3002",t.a.createElement("br",null))},t.a.createElement("img",{src:"".concat(L.a.IMG_SERVER,"/images/educoder/problem.png"),className:"ml2 current"}))),align:"center",dataIndex:"has_comment",width:90,ellipsis:!0,render:function(It){return It?"\u5DF2\u8BC4\u9605":"\u672A\u8BC4\u9605"}},{title:"\u64CD\u4F5C",dataInex:"action",align:"center",width:70,fixed:"right",ellipsis:!0,className:"workListTable",render:function(It,Jt){var Pn,En,vr;return Object(ue.s)()?t.a.createElement("div",null,Object(w.B)(Jt==null?void 0:Jt.work_status)==="\u672A\u5F00\u542F"?t.a.createElement("span",null,"--"):t.a.createElement(g.a,{target:"_blank",onClick:function(Tr){Tr.stopPropagation()},to:"/classrooms/".concat(at.coursesId,"/shixun_homework/").concat(at.categoryId,"/").concat(Jt.id,"/comment")},"\u67E5\u770B")):t.a.createElement("div",null,t.a.createElement("span",{style:{color:"#0152d9"},onClick:function(Tr){Tr.stopPropagation(),Ge({type:"shixunHomeworks/setActionTabs",payload:{key:"\u66F4\u6539\u70B9\u8BC4",selectArrs:{myshixun_identifier:"",data:{name:Jt==null?void 0:Jt.user_name,homeworkId:Jt==null?void 0:Jt.id,work_comment:Jt==null?void 0:Jt.work_comment,work_comment_hidden:Jt==null?void 0:Jt.work_comment_hidden}}}})}},Jt.has_shixun_work_comment?"\u66F4\u6539\u70B9\u8BC4":"\u8FFD\u52A0\u70B9\u8BC4"),(Jt==null||((Pn=Jt.shixun_detail)===null||Pn===void 0||((En=Pn[0])===null||En===void 0))?void 0:En.game_identifier)&&[1,2,3,4].includes(Jt==null?void 0:Jt.work_status)&&[t.a.createElement("br",null),t.a.createElement("a",{target:"_blank",onClick:function(Tr){var ir;if(Tr.stopPropagation(),(ir=st.userInfo)!==null&&ir!==void 0&&ir.professional_certification){var pn,Mn;Object(w.S)("/tasks/".concat(Jt==null||((pn=Jt.shixun_detail)===null||pn===void 0||((Mn=pn[0])===null||Mn===void 0))?void 0:Mn.game_identifier,"?homework_common_id=").concat(Je.categoryId))}else return c.a.confirm({title:"\u63D0\u793A",centered:!0,content:t.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(w.S)("/account/certification")}}),!1}},"\u67E5\u770B\u5B9E\u8BAD")],(Kt==null||((vr=Kt.homework_status)===null||vr===void 0)?void 0:vr[0])!=="\u5DF2\u622A\u6B62"&&!!Jt.myshixun_id&&[t.a.createElement("br",null),t.a.createElement("span",{className:ae.a.color32C,onClick:function(Tr){Tr.stopPropagation(),Ge({type:"shixunHomeworks/setActionTabs",payload:{key:"\u6253\u56DE\u91CD\u505A",selectArrs:Jt,params:at}})}},"\u6253\u56DE\u91CD\u505A")])}}].filter(function(on){return!!on}),lr=function(){var It,Jt;return t.a.createElement(Rt.a,null,t.a.createElement(Rt.a.Item,{onClick:function(){Object(yt.h)(JSON.parse(sessionStorage.all_student_works_params),"shixun_work_list")},key:"1"},"\u5B66\u751F\u6210\u7EE9"),Object(ue.c)()&&(Kt==null?void 0:Kt.student_works.length)>0&&t.a.createElement(Rt.a.Item,{key:"3"},t.a.createElement(g.a,{onClick:function(En){Ge({type:"shixunHomeworks/setActionTabs",payload:{key:"\u5BFC\u51FA\u5B9E\u8BAD\u62A5\u544A",type:2}})},to:"/classrooms/".concat(at.coursesId,"/shixun_homework/").concat(at.categoryId,"/").concat(Kt==null||((It=Kt.student_works)===null||It===void 0||((Jt=It[0])===null||Jt===void 0))?void 0:Jt.id,"/comment")},"\u5B9E\u8BAD\u62A5\u544A")),t.a.createElement(Rt.a.Item,{key:"2"},t.a.createElement(g.a,{to:"/classrooms/".concat(at.coursesId,"/exportlist/shixun_work_list")},"\u5386\u53F2\u5BFC\u51FA")))};return t.a.createElement(t.a.Fragment,null,t.a.createElement("section",{className:"".concat(ae.a.wrap," minH500 bg-white pl30 pr30 pt30")},((xn=Kt.homework_status)===null||xn===void 0?void 0:xn.includes("\u672A\u53D1\u5E03"))&&t.a.createElement(mt.a,null),!!Tn.length&&t.a.createElement(H.a,{className:"mb10",dataSource:Tn,columns:Wn,pagination:!1,showHeader:!1,loading:!1}),!((In=Kt.homework_status)!==null&&In!==void 0&&In.includes("\u672A\u53D1\u5E03"))&&t.a.createElement("aside",null,!Object(ue.c)()&&t.a.createElement("div",{className:"c-light-black font12"},t.a.createElement("span",null,"\u5DF2\u5F00\u59CB\u505A\u9898 ",(Kt==null?void 0:Kt.commit_count)||0," \u4EBA"),t.a.createElement("span",{className:"ml5"},"\u672A\u5F00\u59CB\u505A\u9898 ",(Kt==null?void 0:Kt.uncommit_count)||0," \u4EBA"),(Kt==null?void 0:Kt.left_time)&&t.a.createElement(t.a.Fragment,null,t.a.createElement("span",{className:"ml20 c-black"},Kt==null||((sr=Kt.left_time)===null||sr===void 0)?void 0:sr.status),t.a.createElement("span",{className:"ml20 c-orange-ff9"},Kt==null||(($n=Kt.left_time)===null||$n===void 0)?void 0:$n.time))),Object(ue.c)()&&t.a.createElement(t.a.Fragment,null,t.a.createElement(Ve.a,{form:wt,onChange:en,initialValues:(Zn={},Object(Pt.a)(Zn,"task_status","all"),Object(Pt.a)(Zn,"course_group_info","all"),Object(Pt.a)(Zn,"teacher_comment","all"),Zn)},((kn=Kt.task_status)===null||kn===void 0?void 0:kn.length)>0&&t.a.createElement(Ve.a.Item,{name:"task_status"},t.a.createElement(Xe.a.Group,{value:[],style:{width:"100%"}},t.a.createElement(_.a,null,t.a.createElement(v.a,{className:"font14",flex:"80px"},"\u4F5C\u4E1A\u72B6\u6001:"),t.a.createElement(v.a,{flex:"80px"},t.a.createElement(Xe.a,{value:"all"},"\u5168\u90E8")),t.a.createElement(v.a,{flex:"1"},Kt.task_status&&Kt.task_status.map(function(on,It){return t.a.createElement(Xe.a,{name:"task_status",value:on.id},on.name,"(",on.count,")",on.name==="\u622A\u6B62\u540E\u901A\u5173"?t.a.createElement(O.a,{title:"\u5728\u89C4\u5B9A\u65F6\u95F4\u5916\u5B8C\u6210\u7684\u4F5C\u4E1A"},t.a.createElement("i",{className:"font13 ml5 iconfont icon-tishixiaowenhao"})):null)}))))),((mr=Kt.course_group_info)===null||mr===void 0?void 0:mr.length)>0&&t.a.createElement(Ve.a.Item,{name:"course_group_info"},t.a.createElement(Xe.a.Group,{style:{width:"100%"}},t.a.createElement(_.a,null,t.a.createElement(v.a,{className:"font14",flex:"80px"},"\u5206\u73ED\u60C5\u51B5:"),t.a.createElement(v.a,{flex:"80px"},t.a.createElement(Xe.a,{value:"all"},"\u5168\u90E8")),t.a.createElement(v.a,{flex:"1",id:"divhe",style:{height:de+"px",overflow:"hidden"}},(Fn=Kt.course_group_info)===null||Fn===void 0?void 0:Fn.map(function(on,It){return t.a.createElement(Xe.a,{value:on.course_group_id},on.group_group_name,"(",on.count,")")})),Ke&&t.a.createElement("span",{onClick:function(){var It=document.getElementById("divhe").scrollHeight;de>47?Ee(47):Ee(It)},style:{color:"rgb(76, 172, 255)",cursor:"pointer",alignItems:"flex-end",display:"flex"}},de===47?"\u5C55\u5F00":"\u6536\u8D77",de===47?t.a.createElement(Ft.a,{style:{marginBottom:"3px",marginLeft:"2px"}}):t.a.createElement(nn.a,{style:{marginBottom:"3px",marginLeft:"2px"}}))))),((nr=Kt.teacher_comment)===null||nr===void 0?void 0:nr.length)>0&&t.a.createElement(Ve.a.Item,{name:"teacher_comment"},t.a.createElement(Xe.a.Group,{style:{width:"100%"}},t.a.createElement(_.a,null,t.a.createElement(v.a,{className:"font14",flex:"80px"},"\u8FFD\u52A0\u70B9\u8BC4:"),t.a.createElement(v.a,{flex:"80px"},t.a.createElement(Xe.a,{value:"all"},"\u5168\u90E8")),t.a.createElement(v.a,{flex:"1"},Kt.teacher_comment&&Kt.teacher_comment.map(function(on,It){return t.a.createElement(Xe.a,{value:String(on.id)},on.name,"(",on.count,")")})))))),t.a.createElement(_.a,{align:"middle"},t.a.createElement(v.a,{flex:"1"},t.a.createElement(_.a,{align:"middle"},t.a.createElement(v.a,null,t.a.createElement(u.a.Search,{allowClear:!0,placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D\u6216\u8005\u5B66\u53F7\u641C\u7D22",onSearch:function(It){at.search=It,at.page=1,He()},style:{width:240}})),t.a.createElement(v.a,null,t.a.createElement("span",{className:"ml5"},t.a.createElement("span",{className:"c-red"},Kt.work_count),"\u4E2A\u68C0\u7D22\u7ED3\u679C\uFF08",Kt.work_count,"\u4E2A\u5B66\u751F\uFF09")))),t.a.createElement(v.a,null,Object(ue.c)()&&Kt.code_review&&t.a.createElement(j.a,{className:"ml10",onClick:function(){Ge({type:"shixunHomeworks/setActionTabs",payload:{key:"\u4EE3\u7801\u67E5\u91CD",selectArrs:Kt.student_works.map(function(It){return It.id}),params:at}})}},t.a.createElement("span",{className:"".concat(ae.a.tr1," iconfont icon-daimachazhong")}),"\u4EE3\u7801\u67E5\u91CD"),Object(ue.c)()&&Qt&&t.a.createElement(j.a,{className:"ml10",onClick:Ut},t.a.createElement("i",{className:"iconfont icon-gengxinchengji font14 pr5"}),"\u66F4\u65B0\u6210\u7EE9"),(Kt==null||((Gn=Kt.homework_status)===null||Gn===void 0)?void 0:Gn.includes("\u5DF2\u622A\u6B62"))&&Object(ue.c)()&&t.a.createElement(j.a,{className:"ml10",onClick:function(){Ge({type:"shixunHomeworks/setActionTabs",payload:{key:"\u8D28\u91CF\u68C0\u6D4B",selectArrs:Kt.student_works.map(function(It){return It.id}),params:at}})}},t.a.createElement("i",{className:"iconfont icon-a-08zhiliang-xianxing font14 pr5"}),"\u8D28\u91CF\u8BC4\u5206"),t.a.createElement(j.a,{className:"ml10",onClick:function(){Ge({type:"shixunHomeworks/setActionTabs",payload:{key:"\u4E00\u952E\u70B9\u8BC4",selectArrs:Kt.student_works.map(function(It){return It.id}),params:at}})}},t.a.createElement(Le.a,{className:"mr5"}),"\u4E00\u952E\u70B9\u8BC4"),((Kt==null||((Hn=Kt.homework_status)===null||Hn===void 0)?void 0:Hn.includes("\u63D0\u4EA4\u4E2D"))||(Kt==null||((Sr=Kt.homework_status)===null||Sr===void 0)?void 0:Sr.includes("\u8865\u4EA4\u4E2D"))||(Kt==null||((wr=Kt.homework_status)===null||wr===void 0)?void 0:wr.includes("\u8FDB\u884C\u4E2D")))&&t.a.createElement(j.a,{className:"ml10",onClick:function(){Et(!0)}},"\u4E00\u952E\u6253\u56DE"),Object(ue.c)()&&t.a.createElement(Fe.a,{overlay:lr,className:"ml10"},t.a.createElement(j.a,null,t.a.createElement(Se.a,null),"\u5BFC\u51FA",t.a.createElement(ut.a,null)))))),t.a.createElement(_.a,{style:{justifyContent:"end",marginTop:"5px"}},Object(ue.c)()&&Qt&&t.a.createElement("span",null,t.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")),t.a.createElement(H.a,{className:"mt30",loading:Te["shixunHomeworks/getWorkList"],pagination:!1,style:{cursor:"pointer"},onRow:function(It){return{onClick:function(Pn){window.open("/classrooms/".concat(at.coursesId,"/shixun_homework/").concat(at.categoryId,"/").concat(It.id,"/comment"),"_blank")}}},scroll:{x:1500},dataSource:Kt.student_works,columns:Wn,onChange:function(It,Jt,Pn){Pn.field&&(at.order=Pn.field),Pn.order||(at.b_order="asc"),Pn.order==="ascend"&&(at.b_order="asc"),Pn.order==="descend"&&(at.b_order="desc"),Pn.order||(at.b_order="asc"),He()}}),t.a.createElement(we,null),t.a.createElement(be,null),t.a.createElement(We.a,null)),t.a.createElement(c.a,{title:"\u4E00\u952E\u6253\u56DE\u91CD\u505A",visible:At,centered:!0,destroyOnClose:!0,forceRender:!0,width:700,onOk:Object(i.a)(s.a.mark(function on(){var It,Jt;return s.a.wrap(function(En){for(;;)switch(En.prev=En.next){case 0:if(!(Cr===2)){En.next=13;break}if(!(_n.length<=0)){En.next=4;break}return b.b.info("\u8BF7\u9009\u62E9\u4F5C\u4E1A\u72B6\u6001"),En.abrupt("return");case 4:if(Oe){En.next=7;break}return b.b.info("\u8BC4\u8BED\u4E0D\u80FD\u4E3A\u7A7A"),En.abrupt("return");case 7:return En.next=9,Object(G.a)("/api/homework_commons/".concat(at.categoryId,"/confirm_redo_modal.json"),{method:"post",body:{id:at.categoryId,comment:Oe,status:_n}});case 9:It=En.sent,It.status===0&&(Bn(It),Et(!1),cr(!0)),En.next=32;break;case 13:if(!(ui===0||Pi===0)){En.next=16;break}En.next=22;break;case 16:if(ui){En.next=19;break}return b.b.info("\u6700\u4F4E\u5206\u4E0D\u80FD\u4E3A\u7A7A"),En.abrupt("return");case 19:if(Pi){En.next=22;break}return b.b.info("\u6700\u9AD8\u5206\u4E0D\u80FD\u4E3A\u7A7A"),En.abrupt("return");case 22:if(!(ui>Pi)){En.next=25;break}return b.b.info("\u6700\u9AD8\u5206\u4E0D\u80FD\u5927\u4E8E\u6700\u4F4E\u5206"),En.abrupt("return");case 25:if(Oe){En.next=28;break}return b.b.info("\u8BC4\u8BED\u4E0D\u80FD\u4E3A\u7A7A"),En.abrupt("return");case 28:return En.next=30,Object(G.a)("/api/homework_commons/".concat(at.categoryId,"/confirm_redo_modal.json"),{method:"post",body:{id:at.categoryId,comment:Oe,min_score:ui,max_score:Pi}});case 30:Jt=En.sent,Jt.status===0&&(Bn(Jt),Et(!1),cr(!0));case 32:case"end":return En.stop()}},on)})),onCancel:function(){Et(!1),Rn()}},t.a.createElement("div",{style:{padding:"32px"}},t.a.createElement("div",null,t.a.createElement("div",null,t.a.createElement("span",{style:{width:"80px"}},"\u6253\u56DE\u65B9\u5F0F\uFF1A"),t.a.createElement(ke.a.Group,{value:Cr,onChange:function(It){Wr(It.target.value)}},t.a.createElement(ke.a,{value:1},"\u6309\u6210\u7EE9\u6253\u56DE"),t.a.createElement(ke.a,{value:2},"\u6309\u4F5C\u4E1A\u72B6\u6001\u6253\u56DE"))),Cr===1&&t.a.createElement("div",{style:{display:"flex",marginTop:"20px"}},t.a.createElement("span",{style:{width:"70px",textAlign:"end"}},t.a.createElement("span",{style:{color:"red"}},"*"),"\u6700\u4F4E\u5206\uFF1A"),t.a.createElement(nt.a,{min:0,max:100,value:ui,onChange:function(It){return di(It)},style:{width:"100px"}}),t.a.createElement("span",{style:{width:"80px",textAlign:"end"}},t.a.createElement("span",{style:{color:"red"}},"*"),"\u6700\u9AD8\u5206\uFF1A"),t.a.createElement(nt.a,{min:0,max:100,value:Pi,onChange:function(It){return vi(It)},style:{width:"100px"}})),Cr===2&&t.a.createElement("div",{style:{display:"flex",marginTop:"20px"}},t.a.createElement("span",{style:{width:"80px"}},"\u4F5C\u4E1A\u72B6\u6001\uFF1A"),t.a.createElement(Xe.a.Group,{onChange:function(It){un(Object(p.a)(It))},style:{width:"100%"}},(br=Kt.task_status)===null||br===void 0?void 0:br.map(function(on,It){return t.a.createElement(Xe.a,{name:"task_status",value:on.id},on.name,"(",on.count,")")}))),t.a.createElement("div",{style:{display:"flex",marginTop:"20px"}},t.a.createElement("span",{style:{width:"70px",textAlign:"end"}},t.a.createElement("span",{style:{color:"red"}},"*")," \u8BC4\u8BED\uFF1A"),t.a.createElement(z.a,{className:ae.a.MdEditor,onChange:function(It){return et(It)},placeholder:"\u8BF7\u586B\u5199\u8BC4\u8BED"}))))),t.a.createElement(c.a,{visible:rr,title:"\u6253\u56DE\u786E\u8BA4",onOk:Object(i.a)(s.a.mark(function on(){var It,Jt;return s.a.wrap(function(En){for(;;)switch(En.prev=En.next){case 0:if(!(Cr===2)){En.next=7;break}return En.next=3,Object(G.a)("/api/homework_commons/".concat(at.categoryId,"/batch_redo_modal.json"),{method:"post",body:{id:at.categoryId,comment:Oe,status:_n}});case 3:It=En.sent,It.status===0&&(b.b.info("\u6253\u56DE\u6210\u529F"),Rn(),He(),cr(!1)),En.next=11;break;case 7:return En.next=9,Object(G.a)("/api/homework_commons/".concat(at.categoryId,"/batch_redo_modal.json"),{method:"post",body:{id:at.categoryId,comment:Oe,min_score:ui,max_score:Pi}});case 9:Jt=En.sent,Jt.status===0&&(b.b.info("\u6253\u56DE\u6210\u529F"),Rn(),He(),cr(!1));case 11:case"end":return En.stop()}},on)})),onCancel:function(){Rn(),cr(!1)}},t.a.createElement("div",{style:{padding:"32px"}},Cr===1&&t.a.createElement("span",null,"\u786E\u8BA4\u5C06\u6210\u7EE9\u5728",ui,"-",Pi,"\u7684\u5B66\u751F\u8FDB\u884C\u6253\u56DE\u91CD\u505A\u5417\uFF1F"),Cr===2&&t.a.createElement("span",null,"\u786E\u8BA4\u5C06\u4F5C\u4E1A\u72B6\u6001\u4E3A",((Er=Kt.task_status)===null||Er===void 0?void 0:Er.filter(function(on){return _n==null?void 0:_n.includes(on.id)}).map(function(on){return on.name}).toString())+",","\u7684\u5B66\u751F\u8FDB\u884C\u4F5C\u4E1A\u6253\u56DE\u91CD\u505A\u5417\uFF1F"),t.a.createElement("br",null),t.a.createElement("span",null,"\u8BE5\u6761\u4EF6\u4E0B\u5171\u6709",Kr==null?void 0:Kr.count,"\u540D\u5B66\u751F")))),t.a.createElement(Be,null),t.a.createElement("aside",{className:"tc mb50 mt30"},t.a.createElement(E.a,{showQuickJumper:!0,hideOnSinglePage:!0,showSizeChanger:!1,onChange:hn,current:at.page||1,defaultPageSize:20,total:Kt.work_count})))},an=Object(C.a)(function(vn){var ln=vn.shixunHomeworks,xn=vn.loading,In=vn.user;return{shixunHomeworks:ln,loading:xn.effects,user:In}})(Xt),pt=I("fOrg"),Yt=I("+KLJ"),St=function(ln){var xn,In=ln.shixunHomeworks,sr=ln.loading,$n=ln.dispatch,Zn=Object(h.i)(),kn=Object(o.useState)(Object(U.a)(Object(U.a)({},{page:1,limit:20,group_ids:[]}),Zn)),mr=Object(r.a)(kn,2),Fn=mr[0],nr=mr[1],Gn=Object(h.h)(),Hn=In.codeReview,Sr=Object(o.useState)({}),wr=Object(r.a)(Sr,2),br=wr[0],Er=wr[1],te=Ve.a.useForm(),Te=Object(r.a)(te,1),Ge=Te[0];Fn.order="code_rate",Fn.sort="desc",Fn.category=Fn.categoryId,Object(o.useEffect)(function(){Me(),console.log("params",Fn)},[Fn]),Object(o.useEffect)(function(){In.actionTabs.key==="\u6267\u884C\u4EE3\u7801\u67E5\u91CD"&&Me()},[In.actionTabs.key]);var Me=function(){var ht=Object(i.a)(s.a.mark(function at(){var Mt;return s.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:return Vt.next=2,$n({type:"shixunHomeworks/getCodeReview",payload:Object(U.a)({},Fn)});case 2:Mt=Vt.sent,Mt.status===-2&&setTimeout(function(){return Me()},1500);case 4:case"end":return Vt.stop()}},at)}));return function(){return ht.apply(this,arguments)}}(),st=function(){},Je=function(at,Mt){Fn.page=at,Fn.limit=20,$n({type:"shixunHomeworks/getCodeReview",payload:Object(U.a)({},Fn)})},ct=[{title:"\u5E8F\u53F7",dataIndex:"number",render:function(at,Mt,Gt){return Fn.limit*(Fn.page-1)+Gt+1}},{title:"\u59D3\u540D",dataIndex:"username"},{title:"\u5B66\u53F7",dataIndex:"student_id"},{title:"\u76F8\u4F3C\u5EA6",dataIndex:"code_rate",render:function(at){return t.a.createElement("span",{className:"c-orange"},at)}},{title:"\u64CD\u4F5C",dataInex:"action",render:function(at,Mt){return t.a.createElement("div",null,t.a.createElement(g.a,{target:"_blank",to:"/classrooms/".concat(Fn.coursesId,"/shixun_homework/").concat(Fn.categoryId,"/review_detail/").concat(Mt.user_id)},"\u67E5\u770B"),t.a.createElement("br",null))}}];return t.a.createElement("section",{className:"minH500 bg-white pl30 pr30 pt10"},(Hn==null?void 0:Hn.status)===-2&&t.a.createElement(Yt.a,{message:"\u67E5\u91CD\u8FDB\u884C\u4E2D\uFF0C\u8BF7\u7A0D\u5019\u2026\u2026",className:"mb10 font14",type:"error"}),t.a.createElement(_.a,null,t.a.createElement(v.a,{flex:"1"},t.a.createElement("p",{className:"mt10"},"\u67E5\u91CD\u65F6\u95F4\uFF1A",Hn.last_review_time,t.a.createElement(j.a,{ghost:!0,danger:!0,style:{color:"#29BD8B",borderColor:"#29BD8B",marginLeft:10},onClick:function(){$n({type:"shixunHomeworks/setActionTabs",payload:{key:"\u4EE3\u7801\u67E5\u91CD",params:Fn}})}},"\u4EE3\u7801\u67E5\u91CD"))),t.a.createElement(v.a,null,t.a.createElement(u.a.Search,{allowClear:!0,placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D\u6216\u8005\u5B66\u53F7\u641C\u7D22",onSearch:function(at){Fn.search=at,$n({type:"shixunHomeworks/getCodeReview",payload:Fn})},style:{width:200}}),t.a.createElement("span",{className:"ml5 c-red"}))),((xn=Hn.group_info)===null||xn===void 0?void 0:xn.length)>0&&t.a.createElement(t.a.Fragment,null,t.a.createElement(_.a,null,t.a.createElement(v.a,{flex:"80px",className:"font14"},"\u5206\u73ED\u60C5\u51B5:"),t.a.createElement(v.a,{flex:"80px"},t.a.createElement(Xe.a,{checked:Fn.group_ids=="",value:"all",onChange:function(at){delete Fn.group_ids,Fn.group_ids=[],Fn.page=1,nr(Object(U.a)({},Fn))}},"\u5168\u90E8")),t.a.createElement(v.a,{flex:"1"},Hn.group_info&&Hn.group_info.map(function(ht,at){return t.a.createElement(Xe.a,{value:ht.id,checked:Fn.group_ids.includes(ht.id),onChange:function(Gt){Gt.target.checked?Fn.group_ids.push(ht.id):Fn.group_ids.splice(Fn.group_ids.indexOf(ht.id),1),Fn.page=1,nr(Object(U.a)({},Fn))}},ht.name,"(",ht.members_count,")")}))),t.a.createElement(_.a,{className:"font14 c-red mt5"},t.a.createElement(v.a,null,"\u672C\u9875\u4EC5\u663E\u793A\u5168\u90E8\u5DF2\u67E5\u91CD\u5206\u73ED"))),t.a.createElement("p",{className:"mt10"},t.a.createElement("span",{className:"c-red"},Hn.copy_reviews_count),"\u4E2A\u7591\u4F3C\u6284\u88AD\u4F5C\u54C1\uFF08",Hn.all_reviews_count,"\u4F5C\u54C1\uFF09"),t.a.createElement(H.a,{className:"mt30",loading:sr["shixunHomeworks/getCodeReview"],pagination:!1,dataSource:Hn.users_reviews,columns:ct,onChange:function(at,Mt,Gt){Gt.order==="ascend"&&(Fn.b_order="asc"),Gt.order==="descend"&&(Fn.b_order="desc"),Gt.order||delete Fn.b_order,$n({type:"shixunHomeworks/getCodeReview",payload:Object(U.a)({},Fn)})}}),t.a.createElement("aside",{className:"tc mb50 mt30"},t.a.createElement(E.a,{showSizeChanger:!1,onChange:Je,defaultCurrent:Fn.page||1,current:Fn.page||1,defaultPageSize:20,hideOnSinglePage:!0,total:Hn.copy_reviews_count})))},Ot=Object(C.a)(function(vn){var ln=vn.shixunHomeworks,xn=vn.loading;return{shixunHomeworks:ln,loading:xn.effects}})(St),dt=I("OaEy"),_e=I("2fM7"),je=I("iQDF"),kt=I("+eQT"),gt=I("zetH"),zt=I.n(gt),$t=I("eozf"),De=I("LvDl"),qe=kt.a.RangePicker,jt=_e.a.Option,Zt=function(ln){var xn=ln.shixunHomeworks,In=ln.loading,sr=ln.dispatch,$n=Object(h.i)(),Zn=Object(h.h)(),kn=xn.workSetting,mr=xn.workList,Fn=xn.changeData,nr=Object(o.useState)(!0),Gn=Object(r.a)(nr,2),Hn=Gn[0],Sr=Gn[1],wr=Object(o.useState)({}),br=Object(r.a)(wr,2),Er=br[0],te=br[1],Te=Object(o.useState)(!1),Ge=Object(r.a)(Te,2),Me=Ge[0],st=Ge[1],Je=Ve.a.useForm(),ct=Object(r.a)(Je,1),ht=ct[0],at=Object(o.useState)([]),Mt=Object(r.a)(at,2),Gt=Mt[0],Vt=Mt[1],wt=Object(o.useState)([]),Nt=Object(r.a)(wt,2),it=Nt[0],Qt=Nt[1],Wt=Object(o.useState)(!1),yn=Object(r.a)(Wt,2),Dn=yn[0],Kt=yn[1],dn=Object(o.useState)([]),Ht=Object(r.a)(dn,2),Sn=Ht[0],Tn=Ht[1],xt=Object(o.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,forbid_copy_answers:!1,public_after_abort:!1,public_after_over:!1}),bt=Object(r.a)(xt,2),Lt=bt[0],At=bt[1];Object(o.useEffect)(function(){return Et(),function(){Vt([].concat())}},[]);var Et=function(){sr({type:"shixunHomeworks/getWorkSetting",payload:Object(U.a)({},$n)})};Object(o.useEffect)(function(){if(!(kn!=null&&kn.course_id))return;Object.keys(Lt).map(function(un){Lt[un]=kn[un]}),(!Lt.allow_late||!Lt.unified_late)&&(Lt.late_penalty=5),Gt=JSON.parse(JSON.stringify(kn.group_settings.map(function(un){return Object(U.a)(Object(U.a)({},un),{},{group_name:[un.group_name]})}).filter(function(un){return un.publish_time!==null}))),it=JSON.parse(JSON.stringify(kn.allow_late_settings.map(function(un){return Object(U.a)(Object(U.a)({},un),{},{group_name:[un.group_name]})}).filter(function(un){return un.late_time!==null}))),At(Object(U.a)({},Lt)),Vt(Object(p.a)(Gt)),Qt(Object(p.a)(it))},[kn]);var mn=function(){var rn,Cn,rr=JSON.parse(JSON.stringify(Lt));if(rr.challenge_settings.filter(function(zn){return!zn.hide}),rr.categoryId=$n.categoryId,(rn=rr.challenge_settings)!==null&&rn!==void 0&&rn.every(function(zn){return!zn.checked})){b.b.warn("\u5173\u5361\u4E0D\u80FD\u5168\u90E8\u8BBE\u7F6E\u4E3A\u53EF\u4E0D\u505A");return}if(Lt.unified_setting||(Gt=(Cn=Gt)===null||Cn===void 0?void 0:Cn.map(function(zn){var Dr;if(!zn.publish_time||!zn.end_time)throw b.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(!zn.group_name)throw b.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return zn.group_name=typeof(zn==null?void 0:zn.group_name)=="string"?[zn==null?void 0:zn.group_name]:zn==null?void 0:zn.group_name,zn.group_id=(Dr=kn.group_settings)===null||Dr===void 0?void 0:Dr.filter(function(Kr){var Bn;return zn==null||((Bn=zn.group_name)===null||Bn===void 0)?void 0:Bn.includes(Kr.group_name)}).map(function(Kr){return Kr.group_id||Kr.id}).toString().split(","),zn})),rr.group_settings=Gt,Lt.allow_late)if(Lt.unified_late){if(Lt.late_penalty===null||Lt.late_penalty===void 0||Lt.late_penalty<0||Lt.late_penalty>100)throw b.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 b.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 cr;it=(cr=it)===null||cr===void 0?void 0:cr.map(function(zn){var Dr,Kr;if(zn.late_penalty===null||zn.late_penalty===void 0||zn.late_penalty<0||zn.late_penalty>100)throw b.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(!zn.late_time)throw b.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(!zn.group_name)throw b.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return zn.group_name=typeof(zn==null?void 0:zn.group_name)=="string"?[zn==null?void 0:zn.group_name]:zn==null?void 0:zn.group_name,zn.group_id=zn==null||((Dr=zn.group_name)===null||Dr===void 0||((Kr=Dr.map(function(Bn){var Xn,Qn,Cr=(Xn=kn.group_settings)===null||Xn===void 0||((Qn=Xn.filter(function(Wr){return(Wr==null?void 0:Wr.group_name)===Bn}))===null||Qn===void 0)?void 0:Qn[0];return Cr==null?void 0:Cr.group_id}))===null||Kr===void 0))?void 0:Kr.toString().split(","),zn}),rr.allow_late_settings=it}cn(rr)},cn=function(rn){var Cn,rr;if(console.log(rn.total_score,rn.eff_score),rn.total_score===null){b.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}if(rn!=null&&rn.work_efficiency&&rn.eff_score===null){b.b.warn("\u6548\u7387\u5206\u4E0D\u80FD\u4E3A\u7A7A");return}var cr=rn.challenge_settings.reduce(function(Kr,Bn){return Kr+Number(Bn.challenge_score)},0);if((cr==null?void 0:cr.toFixed(10))!==((Cn=rn.total_score-rn.eff_score)===null||Cn===void 0?void 0:Cn.toFixed(10))){b.b.warn("\u6548\u7387\u5206\u52A0\u5173\u5361\u4EFB\u52A1\u603B\u5206\u5FC5\u987B\u7B49\u4E8E\u603B\u5206\u503C\uFF1A".concat(rn.total_score,"\u5206"));return}var zn={shixun_evaluation:rn.shixun_evaluation,challenge_settings:rn.challenge_settings},Dr=function(){var Kr=Object(i.a)(s.a.mark(function Bn(){var Xn;return s.a.wrap(function(Cr){for(;;)switch(Cr.prev=Cr.next){case 0:return st(!0),Cr.next=3,Object(G.a)("/api/homework_commons/".concat($n.categoryId,"/public_setting.json"),{method:"post",body:Object(U.a)({},rn)});case 3:Xn=Cr.sent,Xn.status===0&&(b.b.success("\u66F4\u65B0\u6210\u529F"),Sr(!0),Et(),sr({type:"shixunHomeworks/getWorkList",payload:Object(U.a)({},$n)})),st(!1);case 6:case"end":return Cr.stop()}},Bn)}));return function(){return Kr.apply(this,arguments)}}();!Object(De.isEqual)(Fn,zn)&&!(mr!=null&&(rr=mr.homework_status)!==null&&rr!==void 0&&rr.includes("\u672A\u53D1\u5E03"))?c.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:Dr}):Dr()},_n=Object(o.useMemo)(function(){return Lt.public_after_abort?"public_after_abort":Lt.public_after_over?"public_after_over":"immediately"},[Lt]);return t.a.createElement("section",{className:[zt.a.form," bg-white pl30 pr30 pt10"].join(" ")},t.a.createElement(_.a,null,t.a.createElement(v.a,{flex:"1"},t.a.createElement("span",{style:{fontSize:"16px"}},"\u516C\u5F00\u8BBE\u7F6E")),t.a.createElement(v.a,null,(kn==null?void 0:kn.can_edit)&&t.a.createElement(j.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return Sr(!1)}},"\u7F16\u8F91\u8BBE\u7F6E")),t.a.createElement(v.a,{span:24,className:"mt15 pl30"},t.a.createElement(Xe.a,{checked:Lt.score_open,disabled:Hn,onChange:function(rn){Lt.score_open=rn.target.checked,At(Object.assign({},Lt))}},t.a.createElement("strong",null,"\u516C\u5F00\u6210\u7EE9")),t.a.createElement("span",{className:"c-grey-c font12"},"(\u9009\u4E2D\uFF0C\u5219\u5728\u4F5C\u4E1A\u622A\u6B62/\u8865\u4EA4\u7ED3\u675F\u65F6\u95F4\u4E4B\u540E\uFF0C\u5DF2\u63D0\u4EA4\u4F5C\u54C1\u7684\u5B66\u751F\u53EF\u4EE5\u67E5\u770B\u5176\u5B83\u5B66\u751F\u7684\u6210\u7EE9\uFF0C\u5426\u5219\u53EA\u80FD\u67E5\u770B\u81EA\u5DF1\u7684\u6210\u7EE9)")),t.a.createElement(v.a,{span:24,className:"mt15 pl30"},t.a.createElement(Xe.a,{checked:Lt.answer_public,disabled:Hn,onChange:function(rn){rn.target.checked?At(function(Cn){return Object(U.a)(Object(U.a)({},Cn),{},{answer_public:rn.target.checked})}):At(function(Cn){return Object(U.a)(Object(U.a)({},Cn),{},{answer_public:rn.target.checked,public_after_abort:!1,public_after_over:!1})})}},t.a.createElement("strong",null,"\u516C\u5F00\u7B54\u6848")),t.a.createElement("span",{className:"c-grey-c font12"},"(\u9009\u4E2D\uFF0C\u5219\u5B66\u751F\u53EF\u4EE5\u67E5\u770B\u5B9E\u8BAD\u53C2\u8003\u7B54\u6848\uFF0C\u5426\u5219\u7981\u6B62\u67E5\u770B\u7B54\u6848)")),Lt.answer_public&&t.a.createElement(v.a,{span:24,className:"mt10 pl30"},t.a.createElement(ke.a.Group,{style:{marginLeft:22},onChange:function(rn){rn.target.value==="public_after_abort"?At(function(Cn){return Object(U.a)(Object(U.a)({},Cn),{},{public_after_abort:!0,public_after_over:!1})}):rn.target.value==="public_after_over"?At(function(Cn){return Object(U.a)(Object(U.a)({},Cn),{},{public_after_abort:!1,public_after_over:!0})}):At(function(Cn){return Object(U.a)(Object(U.a)({},Cn),{},{public_after_abort:!1,public_after_over:!1})})},value:_n,disabled:Hn},t.a.createElement(ke.a,{value:"immediately"},"\u7ACB\u5373\u516C\u5F00"),t.a.createElement(ke.a,{value:"public_after_abort"},"\u4F5C\u4E1A\u622A\u6B62\u540E\u516C\u5F00"),t.a.createElement(ke.a,{value:"public_after_over"},"\u8BFE\u5802\u7ED3\u675F\u540E\u516C\u5F00"))),t.a.createElement(v.a,{span:24,className:"mt15 pl30"},t.a.createElement(Xe.a,{checked:Lt.forbid_copy_answers,disabled:Hn,onChange:function(rn){Lt.forbid_copy_answers=rn.target.checked,At(Object.assign({},Lt))}},t.a.createElement("strong",null,"\u7981\u6B62\u590D\u5236\u53C2\u8003\u7B54\u6848")),t.a.createElement("span",{className:"c-grey-c font12"},"(\u9009\u4E2D\uFF0C\u5219\u7981\u6B62\u5B66\u751F\u590D\u5236\u53C2\u8003\u7B54\u6848\uFF0C\u5426\u5219\u5B66\u751F\u53EF\u4EE5\u590D\u5236\u53C2\u8003\u7B54\u6848)")),t.a.createElement(v.a,{span:24,className:"mt15 pl30 pb40"},t.a.createElement(Xe.a,{checked:Lt.comment_public,disabled:Hn,onChange:function(rn){Lt.comment_public=rn.target.checked,At(Object.assign({},Lt))}},t.a.createElement("strong",null,"\u516C\u5F00\u8BC4\u8BBA")),t.a.createElement("span",{className:"c-grey-c font12"},"(\u9009\u4E2D\uFF0C\u5219\u5B66\u751F\u53EF\u4EE5\u67E5\u770B\u8BFE\u7A0B\u5B9E\u9A8C\u7684\u8BC4\u8BBA\uFF0C\u5426\u5219\u7981\u6B62\u67E5\u770B)")),!Hn&&t.a.createElement(v.a,{className:"mb50"},t.a.createElement(j.a,{type:"primary",size:"large",loading:Me,onClick:function(){return mn()}},"\u63D0\u4EA4"),t.a.createElement(j.a,{type:"primary",size:"large",ghost:!0,className:"ml20",onClick:function(){Sr(!0),Et()}},"\u53D6\u6D88"))),t.a.createElement(c.a,{title:"\u6DFB\u52A0\u534F\u4F5C\u8005",visible:Dn,onCancel:function(){return Kt(!1)}},t.a.createElement("div",null,t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("label",{style:{width:"50px"}},"\u59D3\u540D\uFF1A")," ",t.a.createElement(u.a.Search,{onChange:function(rn){}})),t.a.createElement(H.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(rn,Cn){Tn(rn)}},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"}]}))))},gn=Object(C.a)(function(vn){var ln=vn.shixunHomeworks,xn=vn.loading;return{shixunHomeworks:ln,loading:xn.effects}})(Zt),On=function(ln){var xn=ln.shixunHomeworks,In=ln.loading,sr=ln.dispatch,$n=Object(h.i)(),Zn=xn.workSetting,kn=xn.workList,mr=xn.changeData,Fn=Object(o.useState)(!0),nr=Object(r.a)(Fn,2),Gn=nr[0],Hn=nr[1],Sr=Object(o.useState)(!1),wr=Object(r.a)(Sr,2),br=wr[0],Er=wr[1],te=Object(o.useState)(!1),Te=Object(r.a)(te,2),Ge=Te[0],Me=Te[1],st=Object(o.useState)([]),Je=Object(r.a)(st,2),ct=Je[0],ht=Je[1],at=Object(o.useState)([]),Mt=Object(r.a)(at,2),Gt=Mt[0],Vt=Mt[1],wt=Object(o.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,difficulty_level_sort:"asc"}),Nt=Object(r.a)(wt,2),it=Nt[0],Qt=Nt[1];Object(o.useEffect)(function(){return Wt(),function(){ht([].concat())}},[]);var Wt=function(){sr({type:"shixunHomeworks/getWorkSetting",payload:Object(U.a)({},$n)})};Object(o.useEffect)(function(){if(!(Zn!=null&&Zn.course_id))return;Object.keys(it).map(function(dn){it[dn]=Zn[dn]}),(!it.allow_late||!it.unified_late)&&(it.late_penalty=5),ct=JSON.parse(JSON.stringify(Zn.group_settings.map(function(dn){return Object(U.a)(Object(U.a)({},dn),{},{group_name:[dn.group_name]})}).filter(function(dn){return dn.publish_time!==null}))),Gt=JSON.parse(JSON.stringify(Zn.allow_late_settings.map(function(dn){return Object(U.a)(Object(U.a)({},dn),{},{group_name:[dn.group_name]})}).filter(function(dn){return dn.late_time!==null}))),Qt(Object(U.a)(Object(U.a)({},it),{},{difficulty_level_sort:it.difficulty_level_sort||"asc"})),ht(Object(p.a)(ct)),Vt(Object(p.a)(Gt))},[Zn]);var yn=function(){var Ht,Sn,Tn=JSON.parse(JSON.stringify(it));if(Tn.challenge_settings.filter(function(bt){return!bt.hide}),Tn.categoryId=$n.categoryId,(Ht=Tn.challenge_settings)!==null&&Ht!==void 0&&Ht.every(function(bt){return!bt.checked})){b.b.warn("\u5173\u5361\u4E0D\u80FD\u5168\u90E8\u8BBE\u7F6E\u4E3A\u53EF\u4E0D\u505A");return}if(it.unified_setting||(ct=(Sn=ct)===null||Sn===void 0?void 0:Sn.map(function(bt){var Lt;if(!bt.publish_time||!bt.end_time)throw b.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(!bt.group_name)throw b.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return bt.group_name=typeof(bt==null?void 0:bt.group_name)=="string"?[bt==null?void 0:bt.group_name]:bt==null?void 0:bt.group_name,bt.group_id=(Lt=Zn.group_settings)===null||Lt===void 0?void 0:Lt.filter(function(At){var Et;return bt==null||((Et=bt.group_name)===null||Et===void 0)?void 0:Et.includes(At.group_name)}).map(function(At){return At.group_id||At.id}).toString().split(","),bt})),Tn.group_settings=ct,it.allow_late)if(it.unified_late){if(it.late_penalty===null||it.late_penalty===void 0||it.late_penalty<0||it.late_penalty>100)throw b.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(!it.late_time)throw b.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 xt;Gt=(xt=Gt)===null||xt===void 0?void 0:xt.map(function(bt){var Lt,At;if(bt.late_penalty===null||bt.late_penalty===void 0||bt.late_penalty<0||bt.late_penalty>100)throw b.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(!bt.late_time)throw b.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(!bt.group_name)throw b.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return bt.group_name=typeof(bt==null?void 0:bt.group_name)=="string"?[bt==null?void 0:bt.group_name]:bt==null?void 0:bt.group_name,bt.group_id=bt==null||((Lt=bt.group_name)===null||Lt===void 0||((At=Lt.map(function(Et){var mn,cn,_n=(mn=Zn.group_settings)===null||mn===void 0||((cn=mn.filter(function(un){return(un==null?void 0:un.group_name)===Et}))===null||cn===void 0)?void 0:cn[0];return _n==null?void 0:_n.group_id}))===null||At===void 0))?void 0:At.toString().split(","),bt}),Tn.allow_late_settings=Gt}Dn(Tn)},Dn=function(Ht){var Sn,Tn;if(Ht.total_score===null){b.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}if(Ht!=null&&Ht.work_efficiency&&Ht.eff_score===null){b.b.warn("\u6548\u7387\u5206\u4E0D\u80FD\u4E3A\u7A7A");return}var xt=Ht.challenge_settings.reduce(function(At,Et){return At+Number(Et.challenge_score)},0);if((xt==null?void 0:xt.toFixed(10))!==((Sn=Ht.total_score-Ht.eff_score)===null||Sn===void 0?void 0:Sn.toFixed(10))){b.b.warn("\u6548\u7387\u5206\u52A0\u5173\u5361\u4EFB\u52A1\u603B\u5206\u5FC5\u987B\u7B49\u4E8E\u603B\u5206\u503C\uFF1A".concat(Ht.total_score,"\u5206"));return}var bt={shixun_evaluation:Ht.shixun_evaluation,challenge_settings:Ht.challenge_settings},Lt=function(){var At=Object(i.a)(s.a.mark(function Et(){var mn;return s.a.wrap(function(_n){for(;;)switch(_n.prev=_n.next){case 0:return Er(!0),_n.next=3,Object(G.a)("/api/homework_commons/".concat($n.categoryId,"/score_setting.json"),{method:"post",body:Object(U.a)({},Ht)});case 3:mn=_n.sent,mn.status===0&&(b.b.success("\u66F4\u65B0\u6210\u529F"),Hn(!0),Wt(),sr({type:"shixunHomeworks/getWorkList",payload:Object(U.a)({},$n)})),Er(!1);case 6:case"end":return _n.stop()}},Et)}));return function(){return At.apply(this,arguments)}}();!Object(De.isEqual)(mr,bt)&&!(kn!=null&&(Tn=kn.homework_status)!==null&&Tn!==void 0&&Tn.includes("\u672A\u53D1\u5E03"))?c.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:Lt}):Lt()},Kt=function(){var Ht,Sn=it.eff_score,Tn=it.total_score,xt=it.difficulty_level_sort,bt=Tn-Sn,Lt=(Ht=it.challenge_settings)===null||Ht===void 0?void 0:Ht.filter(function(Cn){return Cn.checked}).length;if(!Lt){it.challenge_settings.map(function(Cn,rr){Cn.challenge_score=0});return}var At=it.challenge_settings.filter(function(Cn){return Cn.checked}).map(function(Cn){return xt==="desc"?Cn.challenge_exp_desc:Cn.challenge_exp}).reduce(function(Cn,rr){return Cn+rr}),Et=bt/At,mn=0,cn=0,_n;switch(it.shixun_evaluation){case 0:var un=parseFloat((bt/Lt).toFixed(1));it.challenge_settings.map(function(Cn,rr){Cn.checked?(mn=rr,Cn.challenge_score=un>0?un:0):Cn.challenge_score=0}),_n=(bt-un*(Lt-1)).toFixed(1),it.challenge_settings[mn].challenge_score=_n>0?_n:0;break;case 1:it.challenge_settings.map(function(Cn,rr){Cn.checked?(mn=rr,cn+=Number((Math.round((xt==="desc"?Cn.challenge_exp_desc:Cn.challenge_exp)*Et*10)/10).toFixed(1)),Cn.challenge_score=(Math.round((xt==="desc"?Cn.challenge_exp_desc:Cn.challenge_exp)*Et*10)/10).toFixed(1)):Cn.challenge_score=0});var rn=it.challenge_settings[mn].challenge_score;_n=(bt-cn+Number(rn)).toFixed(1),it.challenge_settings[mn].challenge_score=_n>0?_n:0;break}};return t.a.createElement("section",{className:[zt.a.form," bg-white pl30 pr30 pt10 mb20 pb10"].join(" ")},t.a.createElement(_.a,{className:"mt25"},t.a.createElement(v.a,{flex:"1"}),t.a.createElement(v.a,null,(Zn==null?void 0:Zn.can_edit)&&t.a.createElement(j.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return Hn(!1)}},"\u7F16\u8F91\u8BBE\u7F6E")),t.a.createElement(v.a,{span:24,className:"pl30 mt10"},t.a.createElement("strong",null,"\u603B\u5206\u503C\uFF1A"),t.a.createElement(nt.a,{min:0,value:it.total_score,disabled:Gn,onChange:function(Ht){it.total_score=Ht,Qt(Object.assign({},it)),Kt()}}),"\xA0\u5206"),t.a.createElement(v.a,{span:24,style:{paddingLeft:60,marginTop:20}},t.a.createElement("strong",null,"\u5173\u5361\u4EFB\u52A1\u7684\u9009\u62E9\u548C\u5206\u503C\u8BBE\u7F6E"),t.a.createElement("span",{className:"c-orange"},"\xA0(\u603B\u5206\u503C = \u6548\u7387\u5206+ \u5173\u5361\u4EFB\u52A1\u603B\u5206)"))),t.a.createElement(_.a,{style:{paddingLeft:85,marginTop:30}},t.a.createElement(v.a,{flex:"1"},t.a.createElement(Xe.a,{disabled:Gn,checked:it.work_efficiency,onChange:function(Ht){it.work_efficiency=Ht.target.checked,it.work_efficiency?it.eff_score=20:it.eff_score=0,Qt(Object.assign({},it)),Kt()}},t.a.createElement("strong",null,"\u6548\u7387\u5206")),t.a.createElement("span",{className:"c-orange font12",style:{marginLeft:-4}},"(\u9009\u4E2D\uFF0C\u5219\u5B66\u751F\u6700\u7EC8\u6210\u7EE9\u5305\u542B\u6548\u7387\u5206\u3002\u6548\u7387\u5206\u5728\u4F5C\u4E1A\u622A\u6B62\u6216\u8005\u8865\u4EA4\u7ED3\u675F\u540E\u7531\u7CFB\u7EDF\u81EA\u52A8\u751F\u6210)")),t.a.createElement(v.a,{className:zt.a.efficiency},"\uFF08\u5B66\u751F\u5B66\u4E60\u6548\u7387= log(\u5B9E\u8BAD\u603B\u5F97\u5206/\u5B9E\u8BAD\u603B\u8017\u65F6)",t.a.createElement("br",null),"\uFF08\u5B66\u751F\u6548\u7387\u5206 = \u5B66\u751F\u5B66\u4E60\u6548\u7387 / \u8BFE\u5802\u5B66\u751F\u6700\u9AD8\u5B66\u4E60\u6548\u7387 * \u5206\u503C\uFF09",t.a.createElement("br",null),t.a.createElement("span",{style:{marginLeft:10}},"\u53E6\uFF1A\u5F53\u5B66\u751F\u672A\u901A\u5173\u65F6\uFF0C\u5B66\u751F\u6548\u7387\u5206\u8BB0 0 \u5206"))),t.a.createElement(_.a,{align:"middle",style:{paddingLeft:105}},t.a.createElement(v.a,null,t.a.createElement("span",{className:"mr5"},"\u6548\u7387\u5206"),t.a.createElement(nt.a,{min:0,disabled:Gn||!it.work_efficiency,value:it.eff_score,step:.1,onChange:function(Ht){it.eff_score=Ht,Qt(Object.assign({},it)),Kt()}}),t.a.createElement("span",null,"\xA0\u5206"))),t.a.createElement(_.a,{align:"middle",style:{paddingLeft:105,marginTop:"20px"}},t.a.createElement(v.a,null,t.a.createElement("span",{className:"mr5"},"\u5B9E\u8BAD\u8017\u65F6\u89C4\u5219\uFF1A"),t.a.createElement(ke.a.Group,{disabled:Gn,value:it.training_time_rules,onChange:function(Ht){it.training_time_rules=Ht.target.value,Qt(Object.assign({},it)),Kt()}},t.a.createElement(ke.a,{value:1},"\u9875\u9762\u505C\u7559\u65F6\u957F"),t.a.createElement(ke.a,{value:2},"\u5173\u5361\u603B\u8017\u65F6"),t.a.createElement(ke.a,{value:3},"\u4F5C\u4E1A\u901A\u5173\u65F6\u957F",t.a.createElement("i",{onClick:function(Ht){Ht.stopPropagation(),Ht.preventDefault(),Me(!0)},style:{marginLeft:10,color:"#145DFF",fontSize:16,cursor:"pointer"},className:"iconfont icon-tishixiaowenhao"}))))),t.a.createElement(_.a,{align:"middle",style:{paddingLeft:85,marginTop:35}},t.a.createElement(v.a,null,t.a.createElement("strong",null,"\u5173\u5361\u4EFB\u52A1\u5206\u503C\u8BBE\u7F6E\u89C4\u5219")),t.a.createElement(v.a,{flex:"1"},t.a.createElement("div",{className:"ml5"},t.a.createElement(ke.a.Group,{disabled:Gn,value:it.shixun_evaluation,onChange:function(Ht){it.shixun_evaluation=Ht.target.value,Ht.target.value!==1&&(it.difficulty_level_sort="asc"),Qt(Object.assign({},it)),Kt()}},t.a.createElement(ke.a,{value:0},"\u5747\u5206\u6BD4\u4F8B"),t.a.createElement(ke.a,{value:1},"\u96BE\u6613\u5EA6"),t.a.createElement(ke.a,{value:2},"\u81EA\u5B9A\u4E49\u5206\u503C"))))),t.a.createElement(_.a,{style:{paddingLeft:343,marginTop:5,display:it.shixun_evaluation===1?"flex":"none"}},t.a.createElement(ke.a.Group,{disabled:Gn,value:it.difficulty_level_sort||"asc",onChange:function(Ht){it.difficulty_level_sort=Ht.target.value,Qt(Object.assign({},it)),Kt()}},t.a.createElement(ke.a,{value:"asc"},"\u6B63\u5E8F\u8D4B\u5206"),t.a.createElement(ke.a,{value:"desc"},"\u53CD\u5E8F\u8D4B\u5206"))),t.a.createElement(_.a,null,t.a.createElement(v.a,{style:{marginLeft:145,marginTop:15}},t.a.createElement("span",{className:"font16"},"\u5173\u5361\u540D\u79F0"),t.a.createElement("span",{className:"font14 ml5 c-orange"},Zn!=null&&Zn.task_pass?"(\u8BF7\u9009\u4E2D\u9700\u8981\u5B66\u751F\u5B8C\u6210\u7684\u5173\u5361\uFF0C\u8BE5\u5B9E\u8BAD\u652F\u6301\u8DF3\u5173\u5B66\u4E60)":"(\u8BE5\u5B9E\u8BAD\u4E0D\u652F\u6301\u8DF3\u5173\u5B66\u4E60)"))),it.challenge_settings&&it.challenge_settings.map(function(dn,Ht){return t.a.createElement(_.a,{key:Ht,align:"middle",style:{paddingLeft:275,marginTop:20}},t.a.createElement(v.a,{flex:"1"},t.a.createElement(Xe.a,{disabled:Gn||!(Zn!=null&&Zn.task_pass),checked:dn.checked,onChange:function(Tn){var xt=Object(De.cloneDeep)(it.challenge_settings);if(xt[Ht].checked=Tn.target.checked,xt!=null&&xt.every(function(bt){return!bt.checked})){b.b.warn("\u5173\u5361\u4E0D\u80FD\u5168\u90E8\u8BBE\u7F6E\u4E3A\u53EF\u4E0D\u505A");return}it.challenge_settings[Ht].checked=Tn.target.checked,it.challenge_settings[Ht].hide=Tn.target.checked,it.shixun_evaluation===2&&!Tn.target.checked&&(it.challenge_settings[Ht].challenge_score=0),Qt(Object(U.a)({},it)),Kt()}},t.a.createElement("strong",null,dn.challenge_name))),t.a.createElement(v.a,null,!dn.checked&&t.a.createElement("span",{className:"tag-style-border-small bg-orange border-raduis-50 c-white mr10"},"\u53EF\u4E0D\u505A")),t.a.createElement(v.a,{flex:"150px"},t.a.createElement(nt.a,{min:0,step:.1,value:dn.challenge_score,disabled:Gn||it.shixun_evaluation!==2||!dn.checked,onChange:function(Tn){it.challenge_settings[Ht].challenge_score=Tn,Qt(Object(U.a)({},it))}}),t.a.createElement("span",{className:"ml10"},"\u5206")),t.a.createElement(v.a,{flex:"300px"},t.a.createElement("span",{className:"tag-style-border-small bg-green c-white mr10"},dn.difficulty),"\u91D1\u5E01\u5956\u52B1\u6570\uFF1A ",dn.challenge_exp))}),t.a.createElement(_.a,{className:"mt30",style:{paddingLeft:65}},t.a.createElement(v.a,null,t.a.createElement("span",{className:"font16 c-black"},"\u67E5\u770B\u53C2\u8003\u7B54\u6848\u624D\u901A\u8FC7\u8BC4\u6D4B\u7684\u5173\u5361\u6263\u5206\u89C4\u5219"),t.a.createElement("span",{className:"font12 c-grey-c"},"\xA0(\u5B66\u751F\u901A\u8FC7\u8BC4\u6D4B\u540E\u518D\u67E5\u770B\u53C2\u8003\u7B54\u6848\uFF0C\u4E0D\u5BF9\u6210\u7EE9\u4EA7\u751F\u5F71\u54CD)"))),t.a.createElement(_.a,{style:{paddingLeft:65}},t.a.createElement(ke.a.Group,{disabled:Gn,value:it.answer_open_evaluation,onChange:function(Ht){it.answer_open_evaluation=Ht.target.value,Qt(Object(U.a)({},it))}},t.a.createElement(ke.a,{value:!1,style:{marginTop:15}},t.a.createElement("strong",null,"\u6309\u67E5\u770B\u7B54\u6848\u7EA7\u522B\u6263\u5206"),t.a.createElement("span",{className:"c-grey-c"},"(\u6839\u636E\u5B66\u5458\u9009\u62E9\u67E5\u770B\u7684\u5B9E\u8BAD\u7B54\u6848\u7EA7\u522B(\u89E3\u9898\u601D\u8DEF\u3001\u5B8C\u6574\u7B54\u6848)\uFF0C\u6263\u51CF\u76F8\u5E94\u7684\u5206\u503C)")),t.a.createElement("br",null),t.a.createElement(ke.a,{value:!0,style:{marginTop:15}},t.a.createElement("strong",null,"\u4E0D\u6263\u5206")))),!Gn&&t.a.createElement(v.a,{className:"mb50",style:{marginTop:"10px"}},t.a.createElement(j.a,{type:"primary",size:"large",loading:br,onClick:function(){return yn()}},"\u63D0\u4EA4"),t.a.createElement(j.a,{type:"primary",size:"large",ghost:!0,className:"ml20",onClick:function(){Hn(!0),Wt()}},"\u53D6\u6D88")),t.a.createElement(c.a,{visible:Ge,width:860,onCancel:function(){Me(!1)},title:"\u8BA1\u65F6\u89C4\u5219\u8BF4\u660E",footer:null},t.a.createElement("div",{style:{color:"#333333",fontWeight:400}},t.a.createElement("span",{style:{fontWeight:500}},"1\u3001\u9875\u9762\u505C\u7559\u65F6\u957F"),t.a.createElement("br",null),t.a.createElement("span",null,"\u5B66\u751F\u8FDB\u5165\u5173\u5361\u7684\u7B54\u9898\u9875\u9762\u5F00\u59CB\u8BA1\u65F6\uFF0C\u76F4\u81F3\u5B66\u751F\u5173\u5361\u8BC4\u6D4B\u901A\u8FC7\uFF0C\u5219\u8BA1\u65F6\u7ED3\u675F\uFF1B"),t.a.createElement("br",null),t.a.createElement("span",null," ","\u5B66\u751F\u8FDB\u5165\u5173\u5361\u7684\u7B54\u9898\u9875\u9762\u5F00\u59CB\u8BA1\u65F6\uFF0C\u82E5\u5B66\u751F\u5173\u95ED/\u9000\u51FA\u7B54\u9898\u9875\u9762\uFF0C\u5219\u8BA1\u65F6\u6682\u505C\uFF0C\u518D\u6B21\u8FDB\u5165\u7B54\u9898\u9875\u9762\u65F6\u5F00\u59CB\u7D2F\u8BA1\u8BA1\u65F6\u76F4\u81F3\u8BC4\u6D4B\u901A\u8FC7\uFF0C\u5219\u8BA1\u65F6\u7ED3\u675F\uFF1B"),t.a.createElement("span",{style:{color:"#FA6400",display:"flex",height:34,alignItems:"center"}}," ","\u53EF\u80FD\u4F1A\u9020\u6210\u65F6\u957F\u8BC4\u4F30\u4E0E\u5B9E\u9645\u505A\u9898\u80FD\u529B\u4E0D\u7B26\u7684\u60C5\u51B5"," "),t.a.createElement("span",null,"a\u3001\u5B66\u751F\u8FDB\u5165\u5173\u5361\u770B\u5B8C\u9898\u540E\uFF0C\u9000\u51FA\u7B54\u9898\u9875\u9762\u5B8C\u6210\u4EE3\u7801\u8BBE\u8BA1\uFF0C\u518D\u590D\u5236\u8FDB\u5E73\u53F0\u7B54\u9898\u9875\u9762\u8FDB\u884C\u8BC4\u6D4B\uFF0C\u65E0\u6CD5\u8BC4\u4F30\u5B66\u751F\u7684\u5B66\u4E60\u548C\u601D\u8003\u65F6\u95F4\u3002")),t.a.createElement("div",{style:{color:"#333333",marginTop:20,fontWeight:400}},t.a.createElement("span",{style:{fontWeight:500}},"2\u3001\u5173\u5361\u603B\u8017\u65F6"),t.a.createElement("br",null),t.a.createElement("span",{style:{}},"\u5B66\u751F\u7B2C\u4E00\u6B21\u8FDB\u5165\u5173\u5361\u7B54\u9898\u9875\u9762\u5F00\u59CB\u8BA1\u65F6\uFF0C\u76F4\u81F3\u8BE5\u5173\u5361\u8BC4\u6D4B\u901A\u8FC7\uFF0C\u5219\u8BA1\u65F6\u7ED3\u675F\u3002"," "),t.a.createElement("br",null),t.a.createElement("span",null," ","\u53E6\uFF0C\u5373\u4F7F\u5173\u5361\u95EF\u5173\u8FC7\u7A0B\u4E2D\uFF0C\u5B66\u751F\u9000\u51FA/\u5173\u95ED\u7B54\u9898\u9875\u9762\uFF0C\u4E5F\u5C06\u6301\u7EED\u8BA1\u65F6\uFF0C\u76F4\u81F3\u8BE5\u5173\u5361\u901A\u8FC7\u3002"),t.a.createElement("span",{style:{color:"#FA6400",display:"flex",height:44,paddingTop:10}}," ","\u53EF\u80FD\u4F1A\u9020\u6210\u65F6\u957F\u8BC4\u4F30\u4E0E\u5B9E\u9645\u505A\u9898\u80FD\u529B\u4E0D\u7B26\u7684\u60C5\u51B5"," "),t.a.createElement("span",null,"a\u3001\u5B66\u751F\u4ECE\u5176\u4ED6\u540C\u5B66\u5904\u770B\u5230\u9898\u76EE\u540E\uFF0C\u5B8C\u6210\u4EE3\u7801\u8BBE\u8BA1\uFF0C\u518D\u8FDB\u5165\u5173\u5361\u7B54\u9898\u9875\u9762\uFF0C\u5C06\u5DF2\u5B8C\u6210\u7684\u4EE3\u7801\u590D\u5236\u81F3\u5E73\u53F0\u8FDB\u884C\u8BC4\u6D4B\uFF1B"),t.a.createElement("br",null),t.a.createElement("span",null,"b\u3001\u5B66\u751F\u7B2C\u4E00\u6B21\u6253\u5F00\u5173\u5361\u540E\uFF0C\u56E0\u4E3A\u67D0\u79CD\u539F\u56E0\u79BB\u5F00\u9875\u9762\uFF0C\u65F6\u9694\u591A\u65E5\u624D\u518D\u6B21\u8FDB\u5165\u5E73\u53F0\u95EF\u5173\uFF0C\u5C31\u4F1A\u5BFC\u81F4\u5B66\u751F\u5173\u5361\u603B\u8017\u65F6\u8FC7\u957F\uFF1B")),t.a.createElement("div",{style:{color:"#333333",marginTop:20,fontWeight:400}},t.a.createElement("span",{style:{fontWeight:500}},"3\u3001\u4F5C\u4E1A\u901A\u5173\u65F6\u957F"),t.a.createElement("br",null),t.a.createElement("span",{style:{}},"\u4ECE\u8001\u5E08\u53D1\u5E03\u7684\u5B9E\u8BAD\u4F5C\u4E1A\u5F00\u59CB\u65F6\u95F4\uFF0C\u5F00\u59CB\u8BA1\u65F6\uFF0C\u76F4\u81F3\u5B66\u751F\u5B9E\u8BAD\u901A\u5173\uFF08\u5305\u62EC\u8FDF\u4EA4\u901A\u5173\uFF09\uFF0C\u7ED3\u675F\u8BA1\u65F6\u3002\u5982\u679C\u5B66\u751F\u672A\u901A\u5173\uFF0C\u5219\u8BE5\u751F\u7684\u95EF\u5173\u8017\u65F6\u4E3A\u8001\u5E08\u8BBE\u7F6E\u7684\u5B9E\u8BAD\u5F00\u59CB\u65F6\u95F4\u81F3\u5B9E\u8BAD\u622A\u6B62\u65F6\u95F4\uFF0C\u5982\u679C\u8001\u5E08\u5F00\u542F\u4E86\u8865\u4EA4\uFF0C\u5219\u8BE5\u751F\u7684\u95EF\u5173\u8017\u65F6\u4E3A\u5B9E\u8BAD\u5F00\u59CB\u65F6\u95F4\u81F3\u5B9E\u8BAD\u8865\u4EA4\u622A\u6B62\u65F6\u95F4\u3002")),t.a.createElement("div",{style:{color:"#333333",marginTop:20,fontWeight:400}},t.a.createElement("span",{style:{fontWeight:500}},"\u89C4\u5219\u76EE\u7684"),t.a.createElement("br",null),t.a.createElement("span",{style:{}},"\u9F13\u52B1\u5B66\u751F\u5728\u5B9E\u8BAD\u4F5C\u4E1A\u53D1\u5E03\u7684\u7B2C\u4E00\u65F6\u95F4\uFF0C\u7ACB\u5373\u767B\u5F55\u5E73\u53F0\u5B8C\u6210\u5B9E\u8BAD\u4F5C\u4E1A\u7684\u901A\u5173\u3002"))))},ur=Object(C.a)(function(vn){var ln=vn.shixunHomeworks,xn=vn.loading;return{shixunHomeworks:ln,loading:xn.effects}})(On),Kn=function(ln){var xn,In,sr=ln.shixunHomeworks,$n=ln.loading,Zn=ln.dispatch,kn=Object(o.useState)(!0),mr=Object(r.a)(kn,2),Fn=mr[0],nr=mr[1],Gn=Object(o.useState)(!1),Hn=Object(r.a)(Gn,2),Sr=Hn[0],wr=Hn[1],br=Object(o.useState)([]),Er=Object(r.a)(br,2),te=Er[0],Te=Er[1],Ge=Object(o.useState)([]),Me=Object(r.a)(Ge,2),st=Me[0],Je=Me[1],ct=Object(o.useState)([]),ht=Object(r.a)(ct,2),at=ht[0],Mt=ht[1],Gt=Object(o.useState)([]),Vt=Object(r.a)(Gt,2),wt=Vt[0],Nt=Vt[1],it=Object(h.i)();function Qt(){return Wt.apply(this,arguments)}function Wt(){return Wt=Object(i.a)(s.a.mark(function dn(){var Ht;return s.a.wrap(function(Tn){for(;;)switch(Tn.prev=Tn.next){case 0:return Tn.next=2,Object(G.a)("/api/homework_commons/".concat(it.categoryId,"/homework_common_collaborators.json"),{method:"get"});case 2:Ht=Tn.sent,Je(Ht);case 4:case"end":return Tn.stop()}},dn)})),Wt.apply(this,arguments)}function yn(){return Dn.apply(this,arguments)}function Dn(){return Dn=Object(i.a)(s.a.mark(function dn(){var Ht;return s.a.wrap(function(Tn){for(;;)switch(Tn.prev=Tn.next){case 0:return Tn.next=2,Object(G.a)("/api/courses/".concat(it==null?void 0:it.coursesId,"/teachers"),{method:"get",params:{homework_id:it.categoryId}});case 2:Ht=Tn.sent,Ht==null||Ht.teacher_list.map(function(xt){xt.key=xt.user_id}),Mt(Ht==null?void 0:Ht.teacher_list),Nt(Ht==null?void 0:Ht.teacher_list);case 6:case"end":return Tn.stop()}},dn)})),Dn.apply(this,arguments)}Object(o.useEffect)(function(){Qt(),yn()},[it]);var Kt=function(){};return t.a.createElement("section",{className:[zt.a.form," bg-white pl30 pr30 pt10"].join(" ")},t.a.createElement(_.a,null,t.a.createElement(v.a,{flex:"1"},t.a.createElement("span",{style:{fontSize:"16px"}},"\u534F\u4F5C\u8BBE\u7F6E"),(st==null?void 0:st.can_edit)&&t.a.createElement("span",{style:{cursor:"pointer",color:"#0152d9",marginLeft:"10px"},onClick:function(){wr(!0)}},"+\u6DFB\u52A0\u534F\u4F5C\u8005"))),t.a.createElement(_.a,{style:{marginTop:"20px",marginBottom:"20px"}},(st==null||((xn=st.data)===null||xn===void 0)?void 0:xn.length)<=0&&t.a.createElement(mt.a,{customText:"\u8BE5\u4F5C\u4E1A\u6682\u65E0\u534F\u4F5C\u8005"}),st==null||((In=st.data)===null||In===void 0)?void 0:In.map(function(dn){return t.a.createElement("span",{style:{display:"inline-flex",height:"40px",borderRadius:"4px",border:"1px solid #44D7B6",padding:"7px 20px",color:"#44D7B6",marginRight:"40px"}},t.a.createElement("span",{style:{flex:"1"}},dn==null?void 0:dn.real_name),(st==null?void 0:st.can_edit)&&t.a.createElement("span",{style:{cursor:"pointer",marginLeft:"10px"},onClick:Object(i.a)(s.a.mark(function Ht(){var Sn;return s.a.wrap(function(xt){for(;;)switch(xt.prev=xt.next){case 0:return xt.next=2,Object(G.a)("/api/homework_commons/".concat(it.categoryId,"/homework_common_collaborators/delete.json"),{method:"delete",body:{user_id:dn.id}});case 2:Sn=xt.sent,Sn.status===0&&(b.b.info("\u5220\u9664\u6210\u529F"),Qt(),yn());case 4:case"end":return xt.stop()}},Ht)}))},"X"))})),t.a.createElement(_.a,null,!Fn&&t.a.createElement(v.a,{className:"mb50"},t.a.createElement(j.a,{type:"primary",size:"large",onClick:function(){return Kt()}},"\u63D0\u4EA4"),t.a.createElement(j.a,{type:"primary",size:"large",ghost:!0,className:"ml20",onClick:function(){nr(!0)}},"\u53D6\u6D88"))),t.a.createElement(c.a,{title:"\u6DFB\u52A0\u534F\u4F5C\u8005",visible:Sr,onCancel:function(){return wr(!1)},onOk:Object(i.a)(s.a.mark(function dn(){var Ht;return s.a.wrap(function(Tn){for(;;)switch(Tn.prev=Tn.next){case 0:if(!(te.length===0)){Tn.next=3;break}return b.b.info("\u8BF7\u9009\u62E9\u534F\u4F5C\u8001\u5E08"),Tn.abrupt("return");case 3:return Tn.next=5,Object(G.a)("/api/homework_commons/".concat(it.categoryId,"/homework_common_collaborators.json"),{method:"post",body:{user_ids:te}});case 5:Ht=Tn.sent,Ht.status===0&&(b.b.info("\u6DFB\u52A0\u6210\u529F"),Te([]),Qt(),yn(),wr(!1));case 7:case"end":return Tn.stop()}},dn)}))},t.a.createElement("div",null,t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("label",{style:{width:"50px"}},"\u59D3\u540D\uFF1A")," ",t.a.createElement(u.a.Search,{onChange:function(Ht){Mt(wt.filter(function(Sn){return Sn.name.indexOf(Ht.target.value)>-1}))}})),t.a.createElement(H.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(Ht,Sn){Te(Ht)},selectedRowKeys:te,getCheckboxProps:function(Ht){return{disabled:Ht.is_collaborator}}},pagination:!1,dataSource:at,columns:[{title:"\u59D3\u540D",dataIndex:"name",key:"name"},{title:"\u89D2\u8272",dataIndex:"role",key:"role"}]}))))},wn=Object(C.a)(function(vn){var ln=vn.shixunHomeworks,xn=vn.loading;return{shixunHomeworks:ln,loading:xn.effects}})(Kn),xr=kt.a.RangePicker,Fr=_e.a.Option,hr=function(ln){var xn=ln.shixunHomeworks,In=ln.loading,sr=ln.dispatch;return t.a.createElement("section",{className:[zt.a.form," bg-white pl30 pt10"].join(" ")},t.a.createElement(F.a,null,t.a.createElement(F.a.TabPane,{tab:"\u53D1\u5E03\u8BBE\u7F6E",key:1},t.a.createElement($t.a,null)),t.a.createElement(F.a.TabPane,{tab:"\u8BC4\u5206\u8BBE\u7F6E",key:2},t.a.createElement(ur,null)),t.a.createElement(F.a.TabPane,{tab:"\u516C\u5F00\u8BBE\u7F6E",key:3},t.a.createElement(gn,null)),t.a.createElement(F.a.TabPane,{tab:"\u534F\u4F5C\u8BBE\u7F6E",key:4},t.a.createElement(wn,null))))},dr=Object(C.a)(function(vn){var ln=vn.shixunHomeworks,xn=vn.loading;return{shixunHomeworks:ln,loading:xn.effects}})(hr),Nr=I("lO7E"),ti=I.n(Nr),pi=I("cVA7"),fn=I.n(pi),ar=function(){var ln=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],xn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],In=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return console.log("---",ln,xn,In),{tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},legend:{},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:[{type:"category",data:["\u7B49\u7EA7A","\u7B49\u7EA7B","\u7B49\u7EA7C","\u7B49\u7EA7D","\u7B49\u7EA7E"]}],yAxis:[{type:"value"}],series:[{name:"\u7F3A\u9677",type:"bar",stack:"Ad",color:["#5c9ef7"],emphasis:{focus:"series"},data:In},{name:"\u6F0F\u6D1E",type:"bar",stack:"Ad",color:["#75c87c"],emphasis:{focus:"series"},data:xn},{name:"\u4EE3\u7801\u89C4\u8303\u6027",type:"bar",stack:"Ad",color:["#f3d460"],emphasis:{focus:"series"},data:ln}]}},oi=function(){var ln=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return{dataset:[{source:ln}],tooltip:{show:!0,formatter:function(In){return In.value[2]+":"+In.value[1]+"\u5206"}},xAxis:{splitLine:{lineStyle:{type:"dashed"}},show:!1},yAxis:{splitLine:{lineStyle:{type:"dashed"}}},series:[{name:"scatter",type:"scatter",datasetIndex:0},{name:"line",type:"line",smooth:!0,datasetIndex:1,symbolSize:.1,symbol:"circle",label:{show:!0,fontSize:16},labelLayout:{dx:-20},encode:{label:2,tooltip:1}}]}},_i=function(ln){var xn,In,sr,$n,Zn=ln.shixunHomeworks,kn=ln.loading,mr=ln.dispatch,Fn=Object(h.i)(),nr=Object(o.useState)(Object(U.a)(Object(U.a)({},{sort_by:"student_id",sort_direction:"desc"}),Fn)),Gn=Object(r.a)(nr,2),Hn=Gn[0],Sr=Gn[1],wr=Object(o.useState)(),br=Object(r.a)(wr,2),Er=br[0],te=br[1],Te=Object(o.useState)([]),Ge=Object(r.a)(Te,2),Me=Ge[0],st=Ge[1],Je=Object(o.useRef)(),ct=Object(o.useState)(1),ht=Object(r.a)(ct,2),at=ht[0],Mt=ht[1],Gt=Object(o.useState)(!1),Vt=Object(r.a)(Gt,2),wt=Vt[0],Nt=Vt[1],it=Object(o.useState)(10),Qt=Object(r.a)(it,2),Wt=Qt[0],yn=Qt[1],Dn=Object(o.useState)([]),Kt=Object(r.a)(Dn,2),dn=Kt[0],Ht=Kt[1];Object(o.useEffect)(function(){Tn()},[]);var Sn=[{title:"\u5B66\u53F7",dataIndex:"student_number",sorter:!0,showSorterTooltip:!1,sortOrder:Hn.sort_by==="student_number"?Hn.sort_direction==="desc"?"descend":"ascend":null},{title:"\u5206\u73ED",dataIndex:"group_course_name"},{title:"\u59D3\u540D",dataIndex:"user_name"},{title:"\u7F3A\u9677",children:[{title:"\u963B\u65AD",dataIndex:"bug",render:function(Et){return t.a.createElement("span",{className:"current"},Et==null?void 0:Et.blocker)}},{title:"\u4E25\u91CD",dataIndex:"bug",render:function(Et){return t.a.createElement("span",{className:"current"},Et==null?void 0:Et.critical)}},{title:"\u4E3B\u8981",dataIndex:"bug",render:function(Et){return t.a.createElement("span",{className:"current"},Et==null?void 0:Et.major)}},{title:"\u6B21\u8981",dataIndex:"bug",render:function(Et){return t.a.createElement("span",{className:"current"},Et==null?void 0:Et.minor)}},{title:"\u7B49\u7EA7",dataIndex:"bug",sorter:!1,showSorterTooltip:!1,sortOrder:Hn.sort_by==="bug"?Hn.sort_direction==="desc"?"descend":"ascend":null,render:function(Et){return t.a.createElement("span",{className:"current"},Et==null?void 0:Et.grade)}}]},{title:"\u6F0F\u6D1E",children:[{title:"\u963B\u65AD",dataIndex:"vulnerability",render:function(Et){return t.a.createElement("span",{className:"current"},Et==null?void 0:Et.blocker)}},{title:"\u4E25\u91CD",dataIndex:"vulnerability",render:function(Et){return t.a.createElement("span",{className:"current"},Et==null?void 0:Et.critical)}},{title:"\u4E3B\u8981",dataIndex:"vulnerability",render:function(Et){return t.a.createElement("span",{className:"current"},Et==null?void 0:Et.major)}},{title:"\u6B21\u8981",dataIndex:"vulnerability",render:function(Et){return t.a.createElement("span",{className:"current"},Et==null?void 0:Et.minor)}},{title:"\u7B49\u7EA7",dataIndex:"vulnerability",sorter:!1,showSorterTooltip:!1,sortOrder:Hn.sort_by==="vulnerability"?Hn.sort_direction==="desc"?"descend":"ascend":null,render:function(Et){return t.a.createElement("span",{className:"current"},Et==null?void 0:Et.grade)}}]},{title:"\u4EE3\u7801\u89C4\u8303\u6027",children:[{title:"\u963B\u65AD",dataIndex:"specification",render:function(Et){return t.a.createElement("span",{className:"current"},Et==null?void 0:Et.blocker)}},{title:"\u4E25\u91CD",dataIndex:"specification",render:function(Et){return t.a.createElement("span",{className:"current"},Et==null?void 0:Et.critical)}},{title:"\u4E3B\u8981",dataIndex:"specification",render:function(Et){return t.a.createElement("span",{className:"current"},Et==null?void 0:Et.major)}},{title:"\u6B21\u8981",dataIndex:"specification",render:function(Et){return t.a.createElement("span",{className:"current"},Et==null?void 0:Et.minor)}},{title:"\u7B49\u7EA7",dataIndex:"specification",sorter:!1,showSorterTooltip:!1,sortOrder:Hn.sort_by==="specification"?Hn.sort_direction==="desc"?"descend":"ascend":null,render:function(Et){return t.a.createElement("span",{className:"current"},Et==null?void 0:Et.grade)}}]},{title:"\u590D\u6742\u4EE3\u7801",dataIndex:"complexity",sorter:!0,showSorterTooltip:!1,sortOrder:Hn.sort_by==="complexity"?Hn.sort_direction==="desc"?"descend":"ascend":null},{title:"\u4EE3\u7801\u884C\u6570",dataIndex:"total_row_number",sorter:!0,showSorterTooltip:!1,sortOrder:Hn.sort_by==="total_row_number"?Hn.sort_direction==="desc"?"descend":"ascend":null},{title:"\u8D28\u91CF\u8BC4\u5206",dataIndex:"quality_score",sorter:!0,showSorterTooltip:!1,sortOrder:Hn.sort_by==="quality_score"?Hn.sort_direction==="desc"?"descend":"ascend":null},{title:"\u64CD\u4F5C",dataIndex:"action",align:"center",render:function(Et,mn){return t.a.createElement("a",{target:"_blank",href:"/classrooms/".concat(Fn.coursesId,"/shixun_homework/").concat(Fn.categoryId,"/analysis/").concat(mn.id),className:"current c-light-primary"},"\u8BE6\u7EC6\u5206\u6790")}}];Object(o.useEffect)(function(){return Er===2&&(Je.current=setInterval(function(){Tn()},6e4)),function(){clearTimeout(Je.current)}},[Er]);function Tn(){return xt.apply(this,arguments)}function xt(){return xt=Object(i.a)(s.a.mark(function At(){var Et;return s.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:return cn.next=2,Object(G.a)("/api/homework_commons/".concat(Hn.categoryId,"/code_quality_analyses/check_status.json"),{method:"GET"});case 2:Et=cn.sent,te(Et.status),Et.status!=2&&Et.status!=-1&&(bt({page:1,limit:10}),clearTimeout(Je.current));case 5:case"end":return cn.stop()}},At)})),xt.apply(this,arguments)}function bt(At){return Lt.apply(this,arguments)}function Lt(){return Lt=Object(i.a)(s.a.mark(function At(Et){var mn;return s.a.wrap(function(_n){for(;;)switch(_n.prev=_n.next){case 0:return Mt(Et==null?void 0:Et.page),yn(Et==null?void 0:Et.limit),_n.next=4,Object(G.a)("/api/homework_commons/".concat(Hn.categoryId,"/code_quality_analyses.json"),{method:"GET",params:Object(U.a)({},Et)});case 4:mn=_n.sent,st(mn);case 6:case"end":return _n.stop()}},At)})),Lt.apply(this,arguments)}return console.log("-------",Er),t.a.createElement("section",{style:{paddingBottom:"10px"},className:"minH500 bg-white pl30 pr30 pt10"},(Er===0||Er===1)&&t.a.createElement("div",null,t.a.createElement("p",{style:{display:"flex"}},t.a.createElement("span",{style:{flex:"1"}},t.a.createElement("label",null,"\u68C0\u6D4B\u65F6\u95F4\uFF1A",Me==null?void 0:Me.created_at)),t.a.createElement(j.a,{onClick:function(){mr({type:"shixunHomeworks/setActionTabs",payload:{key:"\u8D28\u91CF\u68C0\u6D4B"}})}},"\u91CD\u65B0\u68C0\u6D4B")),t.a.createElement("p",{style:{display:"flex"}},t.a.createElement(_.a,{style:{width:"100%"}},t.a.createElement(v.a,{flex:"80px"},t.a.createElement("label",null,"\u5206\u73ED\u60C5\u51B5:")),t.a.createElement(v.a,{flex:"80px"},t.a.createElement(Xe.a,{checked:(dn==null?void 0:dn.length)===0,onChange:function(Et){Et.target.checked&&(Ht([]),bt({page:at,limit:Wt}))},style:{fontSize:"14px"},value:"all"},"\u5168\u90E8")),t.a.createElement(v.a,{flex:"1"},t.a.createElement(Xe.a.Group,{value:dn,onChange:function(){var At=Object(i.a)(s.a.mark(function Et(mn){return s.a.wrap(function(_n){for(;;)switch(_n.prev=_n.next){case 0:Ht(Object(p.a)(mn)),bt({page:at,limit:Wt,group_course_ids:mn});case 2:case"end":return _n.stop()}},Et)}));return function(Et){return At.apply(this,arguments)}}(),style:{width:"100%",fontSize:"14px"}},Me==null||((xn=Me.course_groups)===null||xn===void 0)?void 0:xn.map(function(At,Et){return t.a.createElement(Xe.a,{style:{fontSize:"14px"},value:At==null?void 0:At.id},At==null?void 0:At.name,"(",At==null?void 0:At.count,")")}))))),t.a.createElement("p",{style:{display:"flex"}},t.a.createElement("span",null,t.a.createElement("label",{style:{color:"red"}},"\u6CE8\u610F\uFF1A")),"\u672C\u9875\u4EC5\u663E\u793A\u5168\u90E8\u5DF2\u5B8C\u6210\u68C0\u6D4B\u7684\u5206\u73ED"),t.a.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},t.a.createElement("div",null,t.a.createElement("p",{style:{marginLeft:"20px",fontSize:"20px",fontWeight:500}},"\u4EE3\u7801\u7B49\u7EA7\u5206\u6790"),(Me==null?void 0:Me.grade_statistics)&&t.a.createElement(fn.a,{option:ar(Me==null||((In=Me.grade_statistics)===null||In===void 0)?void 0:In.map(function(At){return At.specification_count}),Me==null||((sr=Me.grade_statistics)===null||sr===void 0)?void 0:sr.map(function(At){return At.vulnerability_count}),Me==null||(($n=Me.grade_statistics)===null||$n===void 0)?void 0:$n.map(function(At){return At.bug_count})),style:{height:400,width:600},opts:{renderer:"svg"}})),t.a.createElement("div",null,t.a.createElement("p",{style:{marginLeft:"20px",fontSize:"20px",fontWeight:500}},"\u4EE3\u7801\u8D28\u91CF\u5206\u5E03"),(Me==null?void 0:Me.quality_scores)&&t.a.createElement(fn.a,{option:oi(Me==null?void 0:Me.quality_scores.map(function(At,Et){return[Et+1,At==null?void 0:At.quality_score,At==null?void 0:At.user_name]})),style:{height:400,width:600},opts:{renderer:"svg"}}))),t.a.createElement("div",null,t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("p",{style:{marginLeft:"20px",fontSize:"20px",fontWeight:500,flex:"1"}},"\u8BE6\u7EC6\u5217\u8868"),t.a.createElement(u.a.Search,{size:"large",onSearch:function(Et){bt({page:1,limit:Wt,search:Et})},style:{width:"300px"},enterButton:"\u641C\u7D22"})),t.a.createElement(H.a,{columns:Sn,dataSource:Me==null?void 0:Me.analysis,bordered:!0,scroll:{x:"calc(800px + 50%)"},pagination:!1,onChange:function(Et,mn,cn){cn.field&&(Hn.sort_by=cn.field),cn.order||(Hn.sort_direction="asc"),cn.order==="ascend"&&(Hn.sort_direction="asc"),cn.order==="descend"&&(Hn.sort_direction="desc"),cn.order||(Hn.sort_direction="asc"),bt(Object(U.a)({page:1,limit:Wt},Hn))}}),t.a.createElement(E.a,{current:at,total:Me==null?void 0:Me.total_count,pageSizeOptions:["10","20","50","100","200"],pageSize:Wt,style:{textAlign:"center",marginTop:"20px",marginBottom:"20px"},onChange:function(Et,mn){Mt(Et),yn(mn),bt({page:Et,limit:mn,group_course_ids:dn})}}))),Er===2&&t.a.createElement("div",{style:{textAlign:"center",margin:"100px 0px",paddingBottom:"100px"}},t.a.createElement("img",{src:ti.a}),t.a.createElement("br",null),t.a.createElement(j.a,{type:"primary",style:{width:"120px",height:"40px"},onClick:function(){Tn()}},"\u5237\u65B0\u9875\u9762")),t.a.createElement(Be,null),t.a.createElement(c.a,{centered:!0,width:1200,title:"\u8BE6\u7EC6\u5206\u6790",destroyOnClose:!0,visible:!!wt,footer:null,onCancel:function(){return Nt(!1)}},t.a.createElement("div",{style:{height:500,overflow:"hidden"}},!!wt&&t.a.createElement("iframe",{style:{height:"100%",width:"100%"},src:"https://sonar.educoder.net/project/issues?id=".concat(Fn==null?void 0:Fn.categoryId,"-").concat(wt==null?void 0:wt.student_number,"&resolved=false"),frameBorder:"0"}))))},Qr=Object(C.a)(function(vn){var ln=vn.shixunHomeworks,xn=vn.loading;return{shixunHomeworks:ln,loading:xn.effects}})(_i),ni=I("RotF"),ee=I.n(ni),B=function(ln){var xn,In=ln.shixunHomeworks,sr=ln.loading,$n=ln.dispatch,Zn=Object(h.i)(),kn=Object(h.h)(),mr=Object(o.useState)([]),Fn=Object(r.a)(mr,2),nr=Fn[0],Gn=Fn[1],Hn=Object(o.useState)([]),Sr=Object(r.a)(Hn,2),wr=Sr[0],br=Sr[1],Er=Object(o.useState)(!0),te=Object(r.a)(Er,2),Te=te[0],Ge=te[1],Me=Object(o.useState)(!1),st=Object(r.a)(Me,2),Je=st[0],ct=st[1],ht=Object(o.useState)(1),at=Object(r.a)(ht,2),Mt=at[0],Gt=at[1],Vt=Object(o.useState)([]),wt=Object(r.a)(Vt,2),Nt=wt[0],it=wt[1],Qt=Object(o.useState)(!1),Wt=Object(r.a)(Qt,2),yn=Wt[0],Dn=Wt[1],Kt=Object(o.useState)(!1),dn=Object(r.a)(Kt,2),Ht=dn[0],Sn=dn[1];Object(o.useEffect)(function(){In.actionTabs.key==="\u4EE3\u7801\u67E5\u91CD"?(bt.resetFields(),Gn([]),Dn(!0),At()):Dn(!1)},[In.actionTabs.key]);var Tn=Ve.a.useForm(),xt=Object(r.a)(Tn,1),bt=xt[0],Lt=[],At=function(){var cn=Object(i.a)(s.a.mark(function _n(){var un,rn,Cn;return s.a.wrap(function(cr){for(;;)switch(cr.prev=cr.next){case 0:if(!(Te&&!Je)){cr.next=11;break}return ct(!0),Gt(Mt+1),cr.next=5,Object(q.x)(Object(U.a)(Object(U.a)({},Zn),{},{page:Mt}));case 5:rn=cr.sent,Cn=Object(p.a)(rn.group_list),rn!=null&&rn.ungroup_list&&Cn.push({id:rn==null?void 0:rn.ungroup_list.id,name:rn==null?void 0:rn.ungroup_list.name,works_count:rn==null?void 0:rn.ungroup_list.work_count,last_review_time:rn==null?void 0:rn.ungroup_list.last_review_time}),Gn([].concat(Object(p.a)(nr),Object(p.a)(Cn))),ct(!1),((un=rn.group_list)===null||un===void 0?void 0:un.length)<10&&Ge(!1);case 11:case"end":return cr.stop()}},_n)}));return function(){return cn.apply(this,arguments)}}(),Et=function(){$n({type:"shixunHomeworks/setActionTabs",payload:{}}),Sn(!1),Ge(!0),ct(!1),Gt(1),Gn([]),bt.resetFields()},mn=[{title:"",dataIndex:"id",width:280,render:function(_n,un){return t.a.createElement(Xe.a,{disabled:!(un.works_count>1),value:String(un.id)},un.name)}},{title:"\u6709\u6548\u4F5C\u54C1\u6570",dataIndex:"works_count"},{title:"\u4E0A\u6B21\u67E5\u91CD\u65F6\u95F4",dataIndex:"last_review_time",width:130}];return t.a.createElement(c.a,{centered:!0,title:"\u4EE3\u7801\u67E5\u91CD",keyboard:!1,maskClosable:!1,visible:yn,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",width:820,bodyStyle:{minHeight:200},onOk:Object(i.a)(s.a.mark(function cn(){var _n,un;return s.a.wrap(function(Cn){for(;;)switch(Cn.prev=Cn.next){case 0:return _n=bt.getFieldValue(),Cn.next=3,Object(G.a)("/api/homework_commons/".concat(Zn.categoryId,"/homework_code_repeat.json"),{method:"post",body:{group_ids:Object(p.a)(_n.group_ids)}});case 3:if(un=Cn.sent,!(un.status===0)){Cn.next=11;break}return Et(),b.b.success("\u64CD\u4F5C\u6210\u529F"),Cn.next=9,$n({type:"shixunHomeworks/getWorkList",payload:In.actionTabs.params});case 9:C.d.push("/classrooms/".concat(Zn.coursesId,"/shixun_homework/").concat(Zn.categoryId,"/detail?tabs=2")),$n({type:"shixunHomeworks/setActionTabs",payload:{key:"\u6267\u884C\u4EE3\u7801\u67E5\u91CD"}});case 11:case"end":return Cn.stop()}},cn)})),onCancel:Et},In.codeReviewCourse&&t.a.createElement(Ve.a,{form:bt,onChange:function(_n){it(Object(U.a)({},bt.getFieldValue()))},initialValues:(xn={},Object(Pt.a)(xn,"group_ids",Lt),Object(Pt.a)(xn,"end_time",se()(se()().add(7,"days").format("YYYY-MM-DD HH:mm"))),xn)},t.a.createElement("div",{className:"flexd-table-header mt20"},t.a.createElement(H.a,{pagination:!1,dataSource:[],columns:mn})),t.a.createElement(Ve.a.Item,{name:"group_ids"},t.a.createElement(Xe.a.Group,{className:"w100"},t.a.createElement("div",{style:{width:"100%",maxHeight:260,overflow:"auto"}},t.a.createElement(ee.a,{initialLoad:!1,pageStart:1,threshold:20,loadMore:function(_n){At()},hasMore:Te,useWindow:!1},t.a.createElement(H.a,{loading:sr.effects["shixunHomeworks/getCodeReviewCourse"],showHeader:!1,columns:mn,dataSource:nr,pagination:!1})))))),t.a.createElement(_.a,null,t.a.createElement(v.a,{className:"ml10"},t.a.createElement(Xe.a,{checked:Ht,onChange:function(_n){Sn(_n.target.checked);var un=[];_n.target.checked&&(un=nr.filter(function(rn){return rn.works_count>1}).map(function(rn){return rn.id+""})),bt.setFieldsValue(Object(Pt.a)({},"group_ids",un))}},"\u5168\u9009"))))},K=Object(C.a)(function(vn){var ln=vn.shixunHomeworks,xn=vn.loading;return{shixunHomeworks:ln,loading:xn}})(B),Q=I("R5GN"),le=I("rhHp"),Z=I("Aocz"),Qe=I.n(Z),qt=I("HBuW"),An=I("NLgs"),Vn=[{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\u963B\u65AD\u9519\u8BEF",ld:"\u81F3\u5C111\u4E2A\u963B\u65AD\u6F0F\u6D1E",gf:"\u8D85\u8FC750%"}],sn=function(ln){var xn,In,sr,$n,Zn,kn,mr,Fn,nr,Gn=ln.shixunHomeworks,Hn=ln.globalSetting,Sr=ln.loading,wr=ln.dispatch,br=Object(h.i)(),Er=Object(h.h)(),te=Object(h.g)(),Te=Object(o.useState)([]),Ge=Object(r.a)(Te,2),Me=Ge[0],st=Ge[1],Je=Object(o.useState)(Er.query.tabs||"0"),ct=Object(r.a)(Je,2),ht=ct[0],at=ct[1],Mt=Object(o.useState)({}),Gt=Object(r.a)(Mt,2),Vt=Gt[0],wt=Gt[1],Nt=Gn.workList,it=Object(o.useState)(!1),Qt=Object(r.a)(it,2),Wt=Qt[0],yn=Qt[1],Dn;br.category=Er.query.category_id,br.order="work_score",br.b_order="desc";var Kt=function(Lt){at(Lt),Lt==="0"&&wr({type:"shixunHomeworks/getWorkList",payload:Vt})},dn=function(){c.a.confirm({centered:!0,width:530,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:t.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",t.a.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u91CD\u505A\uFF1F"),onOk:function(){var Lt=Object(i.a)(s.a.mark(function Et(){var mn,cn,_n;return s.a.wrap(function(rn){for(;;)switch(rn.prev=rn.next){case 0:return cn=(mn=Gn.workList)===null||mn===void 0?void 0:mn.myshixun_identifier,rn.next=3,Object(q.X)({id:cn});case 3:_n=rn.sent,_n&&(b.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`),wr({type:"shixunHomeworks/getWorkList",payload:Vt}));case 5:case"end":return rn.stop()}},Et)}));function At(){return Lt.apply(this,arguments)}return At}()})},Ht=function bt(Lt){var At;Lt=(At=Lt)!==null&&At!==void 0&&At.includes(".json")?Lt:"".concat(Lt,".json"),c.a.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:t.a.createElement("div",{className:"tc font16"},"\u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!"),onOk:function(){var Et=Object(i.a)(s.a.mark(function cn(){var _n,un;return s.a.wrap(function(Cn){for(;;)switch(Cn.prev=Cn.next){case 0:return Cn.next=2,Object(qt.Bb)({url:Lt});case 2:if(_n=Cn.sent,_n){Cn.next=5;break}return Cn.abrupt("return");case 5:return b.b.success("\u91CD\u7F6E\u6210\u529F\uFF0C\u6B63\u5728\u8FDB\u5165\u5B9E\u8BAD\uFF01"),Cn.next=8,Object(qt.E)({id:_n.shixun_identifier});case 8:if(un=Cn.sent,!(un!=null&&un.game_identifier)){Cn.next=12;break}return Object(w.S)("/tasks/".concat(un.game_identifier,"?coursesId=").concat(br.coursesId)),Cn.abrupt("return");case 12:(un==null?void 0:un.status)===2?bt(un==null?void 0:un.message):(un==null?void 0:un.status)===3&&Sn(un==null?void 0:un.message);case 13:case"end":return Cn.stop()}},cn)}));function mn(){return Et.apply(this,arguments)}return mn}()})},Sn=function(Lt){c.a.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:t.a.createElement("div",{className:"tc font16"},"\u76EE\u524D\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5C1A\u5728\u5185\u6D4B\u4E2D\uFF0C\u5C06\u4E8E",Lt,"\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01")})},Tn=function(){var bt=Object(i.a)(s.a.mark(function Lt(At){var Et,mn;return s.a.wrap(function(_n){for(;;)switch(_n.prev=_n.next){case 0:return At=(Et=At)!==null&&Et!==void 0&&Et.includes(".json")?At:"".concat(At,".json"),_n.next=3,Object(qt.Bb)({url:At});case 3:if(mn=_n.sent,console.log(mn,"execRes"),!(mn!=null&&mn.game_identifier)){_n.next=8;break}return Object(w.S)("/tasks/".concat(mn.game_identifier,"?coursesId=").concat(br.coursesId)),_n.abrupt("return");case 8:(mn==null?void 0:mn.status)===-3?Object(w.q)():(mn==null?void 0:mn.status)===2?Ht(mn==null?void 0:mn.message):(mn==null?void 0:mn.status)===3&&Sn(mn==null?void 0:mn.message);case 9:case"end":return _n.stop()}},Lt)}));return function(At){return bt.apply(this,arguments)}}(),xt=[{name:"\u4F5C\u4E1A\u5217\u8868",id:"0",compontent:t.a.createElement(an,{setExportParams:wt}),forceRender:!0},{name:"\u4F5C\u4E1A\u63CF\u8FF0",id:"1",compontent:t.a.createElement(ye,null)},{name:"\u4EE3\u7801\u67E5\u91CD",id:"2",compontent:t.a.createElement(Ot,null)},{name:"\u8D28\u91CF\u68C0\u6D4B",id:"4",compontent:t.a.createElement(Qr,null)},{name:Object(ue.c)()?"\u8BBE\u7F6E":"\u5F97\u5206\u89C4\u5219",id:"3",compontent:t.a.createElement(dr,null)}].filter(function(bt){var Lt;if(Object(ue.s)())return bt.name!=="\u4EE3\u7801\u67E5\u91CD";if(Object(ue.s)()||(Nt==null||((Lt=Nt.homework_status)===null||Lt===void 0)?void 0:Lt[0])!=="\u5DF2\u622A\u6B62")return bt.name!=="\u8D28\u91CF\u68C0\u6D4B";var At;return!Nt.code_review&&(Nt==null||((At=Nt.homework_status)===null||At===void 0)?void 0:At[0])!=="\u672A\u53D1\u5E03"?!0:bt.name!=="\u4EE3\u7801\u67E5\u91CD"}).filter(function(bt){return Nt.open_code_quality_analysis?!0:bt.name!=="\u8D28\u91CF\u68C0\u6D4B"});return t.a.createElement("section",null,t.a.createElement("div",{className:"edu-container"},Nt.homework_name&&t.a.createElement("section",{className:"animated fadeIn"},t.a.createElement("aside",{className:"mt10"},Nt.category&&t.a.createElement(m.a,{separator:">"},t.a.createElement(m.a.Item,null,t.a.createElement(g.a,{to:"/classrooms/".concat(Nt.course_id,"/shixun_homework")},Nt.course_name)),t.a.createElement(m.a.Item,null,t.a.createElement(g.a,{to:"/classrooms/".concat(Nt.course_id,"/shixun_homework/").concat(Nt.category.main?"":Nt.category.category_id)},Nt.category.category_name)),t.a.createElement(m.a.Item,null,"\u4F5C\u4E1A\u8BE6\u60C5"))),t.a.createElement("aside",{className:[Qe.a.title,"mt20"].join(" ")},t.a.createElement(g.a,{to:"/classrooms/".concat(Nt.course_id,"/shixun_homework/").concat(Nt.category.main?"":Nt.category.category_id)},t.a.createElement(A.a,{className:"font16 c-black"})),t.a.createElement(O.a,{title:Nt.homework_name,placement:"bottom"},t.a.createElement("strong",{className:"font20 ml5"},Nt.homework_name)),t.a.createElement(w.m,{temporary:!0,status:Nt.homework_status}),ht==="4"&&t.a.createElement("span",{className:"iconfont icon-a-wenhaobeifen2",onClick:function(){yn(!0)},style:{fontWeight:800,color:"#0152d9",textAlign:"end",flex:1,cursor:"pointer"}},"\u89C4\u5219\u8BF4\u660E"))),t.a.createElement("aside",{className:"mt30 relative"},t.a.createElement("aside",{className:Qe.a.rightMenu},Object(ue.s)()&&((xn=Gn.workList)===null||xn===void 0?void 0:xn.redo_work)&&t.a.createElement("p",{onClick:dn},t.a.createElement("span",{className:"iconfont icon-dahuizhongzuo3x"}),"\u91CD\u505A"),((In=Gn.workList)===null||In===void 0?void 0:In.shixun_status)>1&&((sr=Gn.workList)===null||sr===void 0?void 0:sr.time_status)<5&&Object(ue.s)()&&t.a.createElement("p",{onClick:function(){var Lt,At,Et,mn,cn,_n,un;if(!Object(An.e)(wr,!0))return;(Lt=Gn.workList)!==null&&Lt!==void 0&&(At=Lt.task_operation)!==null&&At!==void 0&&(Et=At[1])!==null&&Et!==void 0&&Et.includes("/")?Tn((mn=Gn.workList)===null||mn===void 0||((cn=mn.task_operation)===null||cn===void 0)?void 0:cn[1]):Object(w.S)("/tasks/".concat((_n=Gn.workList)===null||_n===void 0||((un=_n.task_operation)===null||un===void 0)?void 0:un[1]))}},t.a.createElement("span",{className:"iconfont icon-kaiqizhong"}),($n=Gn.workList)===null||$n===void 0||((Zn=$n.task_operation)===null||Zn===void 0)?void 0:Zn[0]),((kn=Gn.workList)===null||kn===void 0?void 0:kn.commit_des)&&t.a.createElement("p",{onClick:function(){var Lt;Object(w.S)("/classrooms/".concat(br.coursesId,"/shixun_homework/").concat(br.categoryId,"/").concat((Lt=Gn.workList)===null||Lt===void 0?void 0:Lt.id,"/commitsummary"))}},t.a.createElement("span",{className:"iconfont icon-tijiaozongjie"}),(mr=Gn.workList)===null||mr===void 0?void 0:mr.commit_des),ht=="1"&&Object(ue.c)()&&t.a.createElement("p",{onClick:function(){wr({type:"shixunHomeworks/setActionTabs",payload:{key:"\u7F16\u8F91\u4F5C\u4E1A"}})}},t.a.createElement("span",{className:"iconfont icon-bianjishijuan3x translateY1"}),"\u7F16\u8F91\u4F5C\u4E1A"),Object(ue.c)()&&Nt.publish_immediately&&t.a.createElement("p",{onClick:function(){wr({type:"classroomList/setActionTabs",payload:{key:"\u7ACB\u5373\u53D1\u5E03",selectArrs:[br.categoryId],selectArrsAll:[Nt],params:br,detail:!0,type:2}})}},t.a.createElement("span",{className:"iconfont icon-yishezhifabushijian1 translateY1"}),"\u7ACB\u5373\u53D1\u5E03"),((Fn=Gn.workList)===null||Fn===void 0?void 0:Fn.show_analysis_detail)&&t.a.createElement("p",{onClick:function(){var Lt;Object(w.S)("/classrooms/".concat(br.coursesId,"/shixun_homework/").concat(br.categoryId,"/analysis/").concat((Lt=Gn.workList)===null||Lt===void 0?void 0:Lt.analysis_id))}},t.a.createElement("span",{className:"iconfont icon-a-08zhiliang-xianxing font14 pr5"}),"\u8D28\u91CF\u8BC4\u5206"),((nr=Gn.workList)===null||nr===void 0?void 0:nr.is_enter_shixun)&&t.a.createElement("p",{onClick:function(){Object(w.S)("/shixuns/".concat(Nt.shixun_identifier,"/challenges"))}},t.a.createElement("span",{className:"iconfont icon-shixun3 translateY1"}),"\u8FDB\u5165\u5B9E\u8BAD"),Object(ue.c)()&&Nt.end_immediately&&t.a.createElement("p",{style:{background:"#0152d9",color:"#fff"},onClick:function(){wr({type:"classroomList/setActionTabs",payload:{key:"\u7ACB\u5373\u622A\u6B62",params:br,type:2,detail:!0,selectArrs:[br.categoryId]}})}},t.a.createElement("span",{style:{color:"#fff"},className:"iconfont icon-jiezhishiyan"}),"\u7ACB\u5373\u622A\u6B62")),t.a.createElement(F.a,{defaultActiveKey:ht,activeKey:ht,onChange:Kt,className:Qe.a.menuTabs},xt.map(function(bt,Lt){return t.a.createElement(F.a.TabPane,{tab:bt.name,key:bt.id,forceRender:bt.forceRender},bt.compontent)})))),t.a.createElement(K,null),t.a.createElement(Q.a,{courseEndTime:Nt==null?void 0:Nt.course_end_date}),t.a.createElement(le.a,{courseEndTime:Nt==null?void 0:Nt.course_end_date}),t.a.createElement(c.a,{visible:Wt,title:"\u89C4\u5219\u8BF4\u660E",width:800,footer:null,onCancel:function(){yn(!1)}},t.a.createElement("p",null,"\u4E00\u3001\u7B49\u7EA7\u89C4\u5219"),t.a.createElement("p",{style:{marginLeft:"10px"}},"1. \u7F3A\u9677\u7B49\u7EA7"),t.a.createElement("p",{style:{marginLeft:"10px"}},t.a.createElement(H.a,{dataSource:Vn,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})),t.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"),t.a.createElement("p",{style:{marginLeft:"20px"}},"Technical Debt Ratio = \u6280\u672F\u503A\u52A1\u65F6\u95F4 / \u5F00\u53D1\u65F6\u95F4"),t.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"),t.a.createElement("p",null,"\u4E8C\u3001\u590D\u6742\u5EA6\u89C4\u5219"),t.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"),t.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"),t.a.createElement("p",null,"\u4E09\u3001\u4EE3\u7801\u8D28\u91CF\u5206\u89C4\u5219"),t.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"),t.a.createElement("p",{style:{marginLeft:"10px"}},"\u5176\u4E2D\uFF1A"),t.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*\u963B\u65AD\u6570 + 5*\u4E25\u91CD\u6570 + 3*\u4E3B\u8981\u6570 + 1*\u6B21\u6570\uFF09/ \u4EE3\u7801\u884C\u6570\uFF09"),t.a.createElement("p",{style:{marginLeft:"10px"}},"\u6CE8\uFF1A\u5206\u6570\u4E3A\u7A7A\u7684\u4EE3\u8868\u4E0D\u652F\u6301\u7684\u6587\u4EF6\u683C\u5F0F\u3002")))},tr=re.default=Object(C.a)(function(vn){var ln=vn.shixunHomeworks,xn=vn.loading,In=vn.globalSetting;return{shixunHomeworks:ln,globalSetting:In,loading:xn.effects}})(sn)},TXwP:function(Ye,re,I){var Y,H;(function(){var P;(function(){"use strict";var R=[,,function(T){function b(c){this.__parent=c,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}b.prototype.clone_empty=function(){var c=new b(this.__parent);return c.set_indent(this.__indent_count,this.__alignment_count),c},b.prototype.item=function(c){return c<0?this.__items[this.__items.length+c]:this.__items[c]},b.prototype.has_match=function(c){for(var r=this.__items.length-1;r>=0;r--)if(this.__items[r].match(c))return!0;return!1},b.prototype.set_indent=function(c,r){this.is_empty()&&(this.__indent_count=c||0,this.__alignment_count=r||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},b.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)},b.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},b.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var c=this.__parent.current_line;return c.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),c.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),c.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,c.__items[0]===" "&&(c.__items.splice(0,1),c.__character_count-=1),!0}return!1},b.prototype.is_empty=function(){return this.__items.length===0},b.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},b.prototype.push=function(c){this.__items.push(c);var r=c.lastIndexOf(`
|
|
`);r!==-1?this.__character_count=c.length-r:this.__character_count+=c.length},b.prototype.pop=function(){var c=null;return this.is_empty()||(c=this.__items.pop(),this.__character_count-=c.length),c},b.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},b.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},b.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},b.prototype.toString=function(){var c="";return this.is_empty()?this.__parent.indent_empty_lines&&(c=this.__parent.get_indent_string(this.__indent_count)):(c=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),c+=this.__items.join("")),c};function i(c,r){this.__cache=[""],this.__indent_size=c.indent_size,this.__indent_string=c.indent_char,c.indent_with_tabs||(this.__indent_string=new Array(c.indent_size+1).join(c.indent_char)),r=r||"",c.indent_level>0&&(r=new Array(c.indent_level+1).join(this.__indent_string)),this.__base_string=r,this.__base_string_length=r.length}i.prototype.get_indent_size=function(c,r){var a=this.__base_string_length;return r=r||0,c<0&&(a=0),a+=c*this.__indent_size,a+=r,a},i.prototype.get_indent_string=function(c,r){var a=this.__base_string;return r=r||0,c<0&&(c=0,a=""),r+=c*this.__indent_size,this.__ensure_cache(r),a+=this.__cache[r],a},i.prototype.__ensure_cache=function(c){for(;c>=this.__cache.length;)this.__add_column()},i.prototype.__add_column=function(){var c=this.__cache.length,r=0,a="";this.__indent_size&&c>=this.__indent_size&&(r=Math.floor(c/this.__indent_size),c-=r*this.__indent_size,a=new Array(r+1).join(this.__indent_string)),c&&(a+=new Array(c+1).join(" ")),this.__cache.push(a)};function d(c,r){this.__indent_cache=new i(c,r),this.raw=!1,this._end_with_newline=c.end_with_newline,this.indent_size=c.indent_size,this.wrap_line_length=c.wrap_line_length,this.indent_empty_lines=c.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new b(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(c,r){return this.__indent_cache.get_indent_string(c,r)},d.prototype.get_indent_size=function(c,r){return this.__indent_cache.get_indent_size(c,r)},d.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},d.prototype.add_new_line=function(c){return this.is_empty()||!c&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},d.prototype.get_code=function(c){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 a=this.__lines.join(`
|
|
`);return c!==`
|
|
`&&(a=a.replace(/[\n]/g,c)),a},d.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},d.prototype.set_indent=function(c,r){return c=c||0,r=r||0,this.next_line.set_indent(c,r),this.__lines.length>1?(this.current_line.set_indent(c,r),!0):(this.current_line.set_indent(),!1)},d.prototype.add_raw_token=function(c){for(var r=0;r<c.newlines;r++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(c.whitespace_before),this.current_line.push(c.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},d.prototype.add_token=function(c){this.__add_space_before_token(),this.current_line.push(c),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},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(c){for(var r=this.__lines.length;c<r;)this.__lines[c]._remove_indent(),c++;this.current_line._remove_wrap_indent()},d.prototype.trim=function(c){for(c=c===void 0?!1:c,this.current_line.trim();c&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},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(c,r){for(var a=this.__lines.length-2;a>=0;){var s=this.__lines[a];if(s.is_empty())break;if(s.item(0).indexOf(c)!==0&&s.item(-1)!==r){this.__lines.splice(a+1,0,new b(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},T.exports.Output=d},,,,function(T){function b(c,r){this.raw_options=i(c,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"])}b.prototype._get_array=function(c,r){var a=this.raw_options[c],s=r||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(s=a.concat()):typeof a=="string"&&(s=a.split(/[^a-zA-Z0-9_\/\-]+/)),s},b.prototype._get_boolean=function(c,r){var a=this.raw_options[c],s=a===void 0?!!r:!!a;return s},b.prototype._get_characters=function(c,r){var a=this.raw_options[c],s=r||"";return typeof a=="string"&&(s=a.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),s},b.prototype._get_number=function(c,r){var a=this.raw_options[c];r=parseInt(r,10),isNaN(r)&&(r=0);var s=parseInt(a,10);return isNaN(s)&&(s=r),s},b.prototype._get_selection=function(c,r,a){var s=this._get_selection_list(c,r,a);if(s.length!==1)throw new Error("Invalid Option Value: The option '"+c+`' can only be one of the following values:
|
|
`+r+`
|
|
You passed in: '`+this.raw_options[c]+"'");return s[0]},b.prototype._get_selection_list=function(c,r,a){if(!r||r.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[r[0]],!this._is_valid_selection(a,r))throw new Error("Invalid Default Value!");var s=this._get_array(c,a);if(!this._is_valid_selection(s,r))throw new Error("Invalid Option Value: The option '"+c+`' can contain only the following values:
|
|
`+r+`
|
|
You passed in: '`+this.raw_options[c]+"'");return s},b.prototype._is_valid_selection=function(c,r){return c.length&&r.length&&!c.some(function(a){return r.indexOf(a)===-1})};function i(c,r){var a={};c=d(c);var s;for(s in c)s!==r&&(a[s]=c[s]);if(r&&c[r])for(s in c[r])a[s]=c[r][s];return a}function d(c){var r={},a;for(a in c){var s=a.replace(/-/g,"_");r[s]=c[a]}return r}T.exports.Options=b,T.exports.normalizeOpts=d,T.exports.mergeOpts=i},,function(T){var b=RegExp.prototype.hasOwnProperty("sticky");function i(d){this.__input=d||"",this.__input_length=this.__input.length,this.__position=0}i.prototype.restart=function(){this.__position=0},i.prototype.back=function(){this.__position>0&&(this.__position-=1)},i.prototype.hasNext=function(){return this.__position<this.__input_length},i.prototype.next=function(){var d=null;return this.hasNext()&&(d=this.__input.charAt(this.__position),this.__position+=1),d},i.prototype.peek=function(d){var c=null;return d=d||0,d+=this.__position,d>=0&&d<this.__input_length&&(c=this.__input.charAt(d)),c},i.prototype.__match=function(d,c){d.lastIndex=c;var r=d.exec(this.__input);return r&&!(b&&d.sticky)&&(r.index!==c&&(r=null)),r},i.prototype.test=function(d,c){return c=c||0,c+=this.__position,c>=0&&c<this.__input_length?!!this.__match(d,c):!1},i.prototype.testChar=function(d,c){var r=this.peek(c);return d.lastIndex=0,r!==null&&d.test(r)},i.prototype.match=function(d){var c=this.__match(d,this.__position);return c?this.__position+=c[0].length:c=null,c},i.prototype.read=function(d,c,r){var a="",s;return d&&(s=this.match(d),s&&(a+=s[0])),c&&(s||!d)&&(a+=this.readUntil(c,r)),a},i.prototype.readUntil=function(d,c){var r="",a=this.__position;d.lastIndex=this.__position;var s=d.exec(this.__input);return s?(a=s.index,c&&(a+=s[0].length)):a=this.__input_length,r=this.__input.substring(this.__position,a),this.__position=a,r},i.prototype.readUntilAfter=function(d){return this.readUntil(d,!0)},i.prototype.get_regexp=function(d,c){var r=null,a="g";return c&&b&&(a="y"),typeof d=="string"&&d!==""?r=new RegExp(d,a):d&&(r=new RegExp(d.source,a)),r},i.prototype.get_literal_regexp=function(d){return RegExp(d.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},i.prototype.peekUntilAfter=function(d){var c=this.__position,r=this.readUntilAfter(d);return this.__position=c,r},i.prototype.lookBack=function(d){var c=this.__position-1;return c>=d.length&&this.__input.substring(c-d.length,c).toLowerCase()===d},T.exports.InputScanner=i},,,,,function(T){function b(i,d){i=typeof i=="string"?i:i.source,d=typeof d=="string"?d:d.source,this.__directives_block_pattern=new RegExp(i+/ beautify( \w+[:]\w+)+ /.source+d,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(i+/\sbeautify\signore:end\s/.source+d,"g")}b.prototype.get_directives=function(i){if(!i.match(this.__directives_block_pattern))return null;var d={};this.__directive_pattern.lastIndex=0;for(var c=this.__directive_pattern.exec(i);c;)d[c[1]]=c[2],c=this.__directive_pattern.exec(i);return d},b.prototype.readIgnored=function(i){return i.readUntilAfter(this.__directives_end_ignore_pattern)},T.exports.Directives=b},,function(T,b,i){var d=i(16).Beautifier,c=i(17).Options;function r(a,s){var o=new d(a,s);return o.beautify()}T.exports=r,T.exports.defaultOptions=function(){return new c}},function(T,b,i){var d=i(17).Options,c=i(2).Output,r=i(8).InputScanner,a=i(13).Directives,s=new a(/\/\*/,/\*\//),o=/\r\n|[\r\n]/,t=/\r\n|[\r\n]/g,h=/\s/,g=/(?:\s|\n)+/g,C=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,A=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function w(M,E){this._source_text=M||"",this._options=new d(E),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"]}w.prototype.eatString=function(M){var E="";for(this._ch=this._input.next();this._ch;){if(E+=this._ch,this._ch==="\\")E+=this._input.next();else if(M.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return E},w.prototype.eatWhitespace=function(M){for(var E=h.test(this._input.peek()),p=0;h.test(this._input.peek());)this._ch=this._input.next(),M&&this._ch===`
|
|
`&&((p===0||p<this._options.max_preserve_newlines)&&(p++,this._output.add_new_line(!0)));return E},w.prototype.foundNestedPseudoClass=function(){for(var M=0,E=1,p=this._input.peek(E);p;){if(p==="{")return!0;if(p==="(")M+=1;else if(p===")"){if(M===0)return!1;M-=1}else if(p===";"||p==="}")return!1;E++,p=this._input.peek(E)}return!1},w.prototype.print_string=function(M){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(M)},w.prototype.preserveSingleSpace=function(M){M&&(this._output.space_before_token=!0)},w.prototype.indent=function(){this._indentLevel++},w.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},w.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var M=this._source_text,E=this._options.eol;E==="auto"&&(E=`
|
|
`,M&&o.test(M||"")&&(E=M.match(o)[0])),M=M.replace(t,`
|
|
`);var p=M.match(/^[\t ]*/)[0];this._output=new c(this._options,p),this._input=new r(M),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var l=0,u=!1,f=!1,_=!1,y=!1,v=!1,N=!1,j=this._ch,U=!1,G,z,L;G=this._input.read(g),z=G!=="",L=j,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),j=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var V=this._input.read(C),W=s.get_directives(V);W&&W.ignore==="start"&&(V+=s.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(A)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(z),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var $=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);$.match(/[ :]$/)&&($=this.eatString(": ").replace(/\s$/,""),this.print_string($),this._output.space_before_token=!0),$=$.replace(/\s$/,""),$==="extend"?y=!0:$==="import"&&(v=!0),$ in this.NESTED_AT_RULE?(this._nestedLevel+=1,$ in this.CONDITIONAL_GROUP_RULE&&(_=!0)):!u&&l===0&&$.indexOf(":")!==-1&&(f=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(z),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")f&&(f=!1,this.outdent()),_?(_=!1,u=this._indentLevel>=this._nestedLevel):u=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&u&&(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)):(L==="("?this._output.space_before_token=!1:L!==","&&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(),L==="{"&&this._output.trim(!0),v=!1,y=!1,f&&(this.outdent(),f=!1),this.print_string(this._ch),u=!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 q=0;q<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;q++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[q])){U=!0;break}(u||_)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!y&&l===0?(this.print_string(":"),f||(f=!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 fe=L==='"'||L==="'";this.preserveSingleSpace(fe||z),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")U=!1,l===0?(f&&(this.outdent(),f=!1),y=!1,v=!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(),l++,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(")")),l&&(l--,this.outdent()));else{var se=!1;this._input.lookBack("with")&&(se=!0),this.preserveSingleSpace(z||se),this.print_string(this._ch),f&&L==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),N=!0):(this.eatWhitespace(),l++,this.indent())}else if(this._ch===")")l&&(l--,this.outdent()),N&&this._input.peek()===";"&&this._options.selector_separator_newline&&(N=!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&&(!f||N)&&l===0&&!v&&!y?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!f&&l===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&&h.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(z),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),h.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 me=L==='"'||L==="'";this.preserveSingleSpace(me||z),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&U&&this._output.add_new_line()}var ve=this._output.get_code(E);return ve},T.exports.Beautifier=w},function(T,b,i){var d=i(6).Options;function c(r){d.call(this,r,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var a=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||a;var s=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var o=0;o<s.length;o++)s[o]!=="expand"?this.brace_style="collapse":this.brace_style=s[o]}c.prototype=new d,T.exports.Options=c}],O={};function D(T){var b=O[T];if(b!==void 0)return b.exports;var i=O[T]={exports:{}};return R[T](i,i.exports,D),i.exports}var m=D(15);P=m})();var F=P;!(Y=[],H=function(){return{css_beautify:F}}.apply(re,Y),H!==void 0&&(Ye.exports=H))})()},VpOo:function(Ye,re){function I(Y,H){var P=H.x,F=H.y,R=H.width,O=H.height,D=H.r,m,T,b,i;R<0&&(P=P+R,R=-R),O<0&&(F=F+O,O=-O),typeof D=="number"?m=T=b=i=D:D instanceof Array?D.length===1?m=T=b=i=D[0]:D.length===2?(m=b=D[0],T=i=D[1]):D.length===3?(m=D[0],T=i=D[1],b=D[2]):(m=D[0],T=D[1],b=D[2],i=D[3]):m=T=b=i=0;var d;m+T>R&&(d=m+T,m*=R/d,T*=R/d),b+i>R&&(d=b+i,b*=R/d,i*=R/d),T+b>O&&(d=T+b,T*=O/d,b*=O/d),m+i>O&&(d=m+i,m*=O/d,i*=O/d),Y.moveTo(P+m,F),Y.lineTo(P+R-T,F),T!==0&&Y.arc(P+R-T,F+T,T,-Math.PI/2,0),Y.lineTo(P+R,F+O-b),b!==0&&Y.arc(P+R-b,F+O-b,b,0,Math.PI/2),Y.lineTo(P+i,F+O),i!==0&&Y.arc(P+i,F+O-i,i,Math.PI/2,Math.PI),Y.lineTo(P,F+m),m!==0&&Y.arc(P+m,F+m,m,Math.PI,Math.PI*1.5)}re.buildPath=I},"VrN/":function(Ye,re,I){(function(Y,H){Ye.exports=H()})(this,function(){"use strict";var Y=navigator.userAgent,H=navigator.platform,P=/gecko\/\d/i.test(Y),F=/MSIE \d/.test(Y),R=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Y),O=/Edge\/(\d+)/.exec(Y),D=F||R||O,m=D&&(F?document.documentMode||6:+(O||R)[1]),T=!O&&/WebKit\//.test(Y),b=T&&/Qt\/\d+\.\d+/.test(Y),i=!O&&/Chrome\//.test(Y),d=/Opera\//.test(Y),c=/Apple Computer/.test(navigator.vendor),r=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Y),a=/PhantomJS/.test(Y),s=!O&&/AppleWebKit/.test(Y)&&/Mobile\/\w+/.test(Y),o=/Android/.test(Y),t=s||o||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Y),h=s||/Mac/.test(H),g=/\bCrOS\b/.test(Y),C=/win/i.test(H),A=d&&Y.match(/Version\/(\d*\.\d*)/);A&&(A=Number(A[1])),A&&A>=15&&(d=!1,T=!0);var w=h&&(b||d&&(A==null||A<12.11)),M=P||D&&m>=9;function E(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var p=function(e,n){var S=e.className,x=E(n).exec(S);if(x){var k=S.slice(x.index+x[0].length);e.className=S.slice(0,x.index)+(k?x[1]+k:"")}};function l(e){for(var n=e.childNodes.length;n>0;--n)e.removeChild(e.firstChild);return e}function u(e,n){return l(e).appendChild(n)}function f(e,n,S,x){var k=document.createElement(e);if(S&&(k.className=S),x&&(k.style.cssText=x),typeof n=="string")k.appendChild(document.createTextNode(n));else if(n)for(var X=0;X<n.length;++X)k.appendChild(n[X]);return k}function _(e,n,S,x){var k=f(e,n,S,x);return k.setAttribute("role","presentation"),k}var y;document.createRange?y=function(e,n,S,x){var k=document.createRange();return k.setEnd(x||e,S),k.setStart(e,n),k}:y=function(e,n,S){var x=document.body.createTextRange();try{x.moveToElementText(e.parentNode)}catch(k){return x}return x.collapse(!0),x.moveEnd("character",S),x.moveStart("character",n),x};function v(e,n){if(n.nodeType==3&&(n=n.parentNode),e.contains)return e.contains(n);do if(n.nodeType==11&&(n=n.host),n==e)return!0;while(n=n.parentNode)}function N(){var e;try{e=document.activeElement}catch(n){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function j(e,n){var S=e.className;E(n).test(S)||(e.className+=(S?" ":"")+n)}function U(e,n){for(var S=e.split(" "),x=0;x<S.length;x++)S[x]&&!E(S[x]).test(n)&&(n+=" "+S[x]);return n}var G=function(e){e.select()};s?G=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:D&&(G=function(e){try{e.select()}catch(n){}});function z(e){var n=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,n)}}function L(e,n,S){n||(n={});for(var x in e)e.hasOwnProperty(x)&&(S!==!1||!n.hasOwnProperty(x))&&(n[x]=e[x]);return n}function V(e,n,S,x,k){n==null&&(n=e.search(/[^\s\u00a0]/),n==-1&&(n=e.length));for(var X=x||0,J=k||0;;){var ne=e.indexOf(" ",X);if(ne<0||ne>=n)return J+(n-X);J+=ne-X,J+=S-J%S,X=ne+1}}var W=function(){this.id=null,this.f=null,this.time=0,this.handler=z(this.onTimeout,this)};W.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},W.prototype.set=function(e,n){this.f=n;var S=+new Date+e;(!this.id||S<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=S)};function $(e,n){for(var S=0;S<e.length;++S)if(e[S]==n)return S;return-1}var q=50,fe={toString:function(){return"CodeMirror.Pass"}},se={scroll:!1},me={origin:"*mouse"},ve={origin:"+move"};function Ae(e,n,S){for(var x=0,k=0;;){var X=e.indexOf(" ",x);X==-1&&(X=e.length);var J=X-x;if(X==e.length||k+J>=n)return x+Math.min(J,n-k);if(k+=X-x,k+=S-k%S,x=X+1,k>=n)return x}}var ge=[""];function ue(e){for(;ge.length<=e;)ge.push($e(ge)+" ");return ge[e]}function $e(e){return e[e.length-1]}function Tt(e,n){for(var S=[],x=0;x<e.length;x++)S[x]=n(e[x],x);return S}function ye(e,n,S){for(var x=0,k=S(n);x<e.length&&S(e[x])<=k;)x++;e.splice(x,0,n)}function Re(){}function nt(e,n){var S;return Object.create?S=Object.create(e):(Re.prototype=e,S=new Re),n&&L(n,S),S}var Ue=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ke(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Ue.test(e))}function lt(e,n){return n?n.source.indexOf("\\w")>-1&&ke(e)?!0:n.test(e):ke(e)}function Fe(e){for(var n in e)if(e.hasOwnProperty(n)&&e[n])return!1;return!0}var Ze=/[\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 Xe(e){return e.charCodeAt(0)>=768&&Ze.test(e)}function ft(e,n,S){for(;(S<0?n>0:n<e.length)&&Xe(e.charAt(n));)n+=S;return n}function Rt(e,n,S){for(var x=n>S?-1:1;;){if(n==S)return n;var k=(n+S)/2,X=x<0?Math.ceil(k):Math.floor(k);if(X==n)return e(X)?n:S;e(X)?S=X:n=X+x}}function Pt(e,n,S,x){if(!e)return x(n,S,"ltr",0);for(var k=!1,X=0;X<e.length;++X){var J=e[X];(J.from<S&&J.to>n||n==S&&J.to==n)&&(x(Math.max(J.from,n),Math.min(J.to,S),J.level==1?"rtl":"ltr",X),k=!0)}k||x(n,S,"ltr")}var Bt=null;function Ve(e,n,S){var x;Bt=null;for(var k=0;k<e.length;++k){var X=e[k];if(X.from<n&&X.to>n)return k;X.to==n&&(X.from!=X.to&&S=="before"?x=k:Bt=k),X.from==n&&(X.from!=X.to&&S!="before"?x=k:Bt=k)}return x!=null?x:Bt}var Ft=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function S(he){return he<=247?e.charAt(he):1424<=he&&he<=1524?"R":1536<=he&&he<=1785?n.charAt(he-1536):1774<=he&&he<=2220?"r":8192<=he&&he<=8203?"w":he==8204?"b":"L"}var x=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,k=/[stwN]/,X=/[LRr]/,J=/[Lb1n]/,ne=/[1n]/;function oe(he,ze,tt){this.level=he,this.from=ze,this.to=tt}return function(he,ze){var tt=ze=="ltr"?"L":"R";if(he.length==0||ze=="ltr"&&!x.test(he))return!1;for(var Dt=he.length,Ct=[],tn=0;tn<Dt;++tn)Ct.push(S(he.charCodeAt(tn)));for(var bn=0,Ln=tt;bn<Dt;++bn){var Nn=Ct[bn];Nn=="m"?Ct[bn]=Ln:Ln=Nn}for(var Yn=0,jn=tt;Yn<Dt;++Yn){var er=Ct[Yn];er=="1"&&jn=="r"?Ct[Yn]="n":X.test(er)&&(jn=er,er=="r"&&(Ct[Yn]="R"))}for(var _r=1,pr=Ct[0];_r<Dt-1;++_r){var Pr=Ct[_r];Pr=="+"&&pr=="1"&&Ct[_r+1]=="1"?Ct[_r]="1":Pr==","&&pr==Ct[_r+1]&&(pr=="1"||pr=="n")&&(Ct[_r]=pr),pr=Pr}for(var ii=0;ii<Dt;++ii){var Bi=Ct[ii];if(Bi==",")Ct[ii]="N";else if(Bi=="%"){var gi=void 0;for(gi=ii+1;gi<Dt&&Ct[gi]=="%";++gi);for(var oa=ii&&Ct[ii-1]=="!"||gi<Dt&&Ct[gi]=="1"?"1":"N",ta=ii;ta<gi;++ta)Ct[ta]=oa;ii=gi-1}}for(var Mi=0,na=tt;Mi<Dt;++Mi){var Ki=Ct[Mi];na=="L"&&Ki=="1"?Ct[Mi]="L":X.test(Ki)&&(na=Ki)}for(var Ii=0;Ii<Dt;++Ii)if(k.test(Ct[Ii])){var Li=void 0;for(Li=Ii+1;Li<Dt&&k.test(Ct[Li]);++Li);for(var Ei=(Ii?Ct[Ii-1]:tt)=="L",ra=(Li<Dt?Ct[Li]:tt)=="L",So=Ei==ra?Ei?"L":"R":tt,to=Ii;to<Li;++to)Ct[to]=So;Ii=Li-1}for(var Vi=[],La,Hi=0;Hi<Dt;)if(J.test(Ct[Hi])){var ms=Hi;for(++Hi;Hi<Dt&&J.test(Ct[Hi]);++Hi);Vi.push(new oe(0,ms,Hi))}else{var Ka=Hi,lo=Vi.length,uo=ze=="rtl"?1:0;for(++Hi;Hi<Dt&&Ct[Hi]!="L";++Hi);for(var $i=Ka;$i<Hi;)if(ne.test(Ct[$i])){Ka<$i&&(Vi.splice(lo,0,new oe(1,Ka,$i)),lo+=uo);var Oo=$i;for(++$i;$i<Hi&&ne.test(Ct[$i]);++$i);Vi.splice(lo,0,new oe(2,Oo,$i)),lo+=uo,Ka=$i}else++$i;Ka<Hi&&Vi.splice(lo,0,new oe(1,Ka,Hi))}return ze=="ltr"&&(Vi[0].level==1&&(La=he.match(/^\s+/))&&(Vi[0].from=La[0].length,Vi.unshift(new oe(0,0,La[0].length))),$e(Vi).level==1&&(La=he.match(/\s+$/))&&($e(Vi).to-=La[0].length,Vi.push(new oe(0,Dt-La[0].length,Dt)))),ze=="rtl"?Vi.reverse():Vi}}();function nn(e,n){var S=e.order;return S==null&&(S=e.order=Ft(e.text,n)),S}var Le=[],Se=function(e,n,S){if(e.addEventListener)e.addEventListener(n,S,!1);else if(e.attachEvent)e.attachEvent("on"+n,S);else{var x=e._handlers||(e._handlers={});x[n]=(x[n]||Le).concat(S)}};function ut(e,n){return e._handlers&&e._handlers[n]||Le}function mt(e,n,S){if(e.removeEventListener)e.removeEventListener(n,S,!1);else if(e.detachEvent)e.detachEvent("on"+n,S);else{var x=e._handlers,k=x&&x[n];if(k){var X=$(k,S);X>-1&&(x[n]=k.slice(0,X).concat(k.slice(X+1)))}}}function We(e,n){var S=ut(e,n);if(!S.length)return;for(var x=Array.prototype.slice.call(arguments,2),k=0;k<S.length;++k)S[k].apply(null,x)}function vt(e,n,S){return typeof n=="string"&&(n={type:n,preventDefault:function(){this.defaultPrevented=!0}}),We(e,S||n.type,e,n),ce(n)||n.codemirrorIgnore}function Pe(e){var n=e._handlers&&e._handlers.cursorActivity;if(!n)return;for(var S=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),x=0;x<n.length;++x)$(S,n[x])==-1&&S.push(n[x])}function xe(e,n){return ut(e,n).length>0}function we(e){e.prototype.on=function(n,S){Se(this,n,S)},e.prototype.off=function(n,S){mt(this,n,S)}}function ie(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ae(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ce(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function be(e){ie(e),ae(e)}function Ce(e){return e.target||e.srcElement}function Be(e){var n=e.which;return n==null&&(e.button&1?n=1:e.button&2?n=3:e.button&4&&(n=2)),h&&e.ctrlKey&&n==1&&(n=3),n}var yt=function(){if(D&&m<9)return!1;var e=f("div");return"draggable"in e||"dragDrop"in e}(),Xt;function an(e){if(Xt==null){var n=f("span","\u200B");u(e,f("span",[n,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Xt=n.offsetWidth<=1&&n.offsetHeight>2&&!(D&&m<8))}var S=Xt?f("span","\u200B"):f("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return S.setAttribute("cm-text",""),S}var pt;function Yt(e){if(pt!=null)return pt;var n=u(e,document.createTextNode("A\u062EA")),S=y(n,0,1).getBoundingClientRect(),x=y(n,1,2).getBoundingClientRect();return l(e),!S||S.left==S.right?!1:pt=x.right-S.right<3}var St=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var n=0,S=[],x=e.length;n<=x;){var k=e.indexOf(`
|
|
`,n);k==-1&&(k=e.length);var X=e.slice(n,e.charAt(k-1)=="\r"?k-1:k),J=X.indexOf("\r");J!=-1?(S.push(X.slice(0,J)),n+=J+1):(S.push(X),n=k+1)}return S}:function(e){return e.split(/\r\n?|\n/)},Ot=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(n){return!1}}:function(e){var n;try{n=e.ownerDocument.selection.createRange()}catch(S){}return!n||n.parentElement()!=e?!1:n.compareEndPoints("StartToEnd",n)!=0},dt=function(){var e=f("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),_e=null;function je(e){if(_e!=null)return _e;var n=u(e,f("span","x")),S=n.getBoundingClientRect(),x=y(n,0,1).getBoundingClientRect();return _e=Math.abs(S.left-x.left)>1}var kt={},gt={};function zt(e,n){arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),kt[e]=n}function $t(e,n){gt[e]=n}function De(e){if(typeof e=="string"&>.hasOwnProperty(e))e=gt[e];else if(e&&typeof e.name=="string"&>.hasOwnProperty(e.name)){var n=gt[e.name];typeof n=="string"&&(n={name:n}),e=nt(n,e),e.name=n.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return De("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return De("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function qe(e,n){n=De(n);var S=kt[n.name];if(!S)return qe(e,"text/plain");var x=S(e,n);if(jt.hasOwnProperty(n.name)){var k=jt[n.name];for(var X in k){if(!k.hasOwnProperty(X))continue;x.hasOwnProperty(X)&&(x["_"+X]=x[X]),x[X]=k[X]}}if(x.name=n.name,n.helperType&&(x.helperType=n.helperType),n.modeProps)for(var J in n.modeProps)x[J]=n.modeProps[J];return x}var jt={};function Zt(e,n){var S=jt.hasOwnProperty(e)?jt[e]:jt[e]={};L(n,S)}function gn(e,n){if(n===!0)return n;if(e.copyState)return e.copyState(n);var S={};for(var x in n){var k=n[x];k instanceof Array&&(k=k.concat([])),S[x]=k}return S}function On(e,n){for(var S;e.innerMode&&!(S=e.innerMode(n),!S||S.mode==e);)n=S.state,e=S.mode;return S||{mode:e,state:n}}function ur(e,n,S){return e.startState?e.startState(n,S):!0}var Kn=function(e,n,S){this.pos=this.start=0,this.string=e,this.tabSize=n||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=S};Kn.prototype.eol=function(){return this.pos>=this.string.length},Kn.prototype.sol=function(){return this.pos==this.lineStart},Kn.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Kn.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Kn.prototype.eat=function(e){var n=this.string.charAt(this.pos),S;if(typeof e=="string"?S=n==e:S=n&&(e.test?e.test(n):e(n)),S)return++this.pos,n},Kn.prototype.eatWhile=function(e){for(var n=this.pos;this.eat(e););return this.pos>n},Kn.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Kn.prototype.skipToEnd=function(){this.pos=this.string.length},Kn.prototype.skipTo=function(e){var n=this.string.indexOf(e,this.pos);if(n>-1)return this.pos=n,!0},Kn.prototype.backUp=function(e){this.pos-=e},Kn.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)},Kn.prototype.indentation=function(){return V(this.string,null,this.tabSize)-(this.lineStart?V(this.string,this.lineStart,this.tabSize):0)},Kn.prototype.match=function(e,n,S){if(typeof e=="string"){var x=function(J){return S?J.toLowerCase():J},k=this.string.substr(this.pos,e.length);if(x(k)==x(e))return n!==!1&&(this.pos+=e.length),!0}else{var X=this.string.slice(this.pos).match(e);return X&&X.index>0?null:(X&&n!==!1&&(this.pos+=X[0].length),X)}},Kn.prototype.current=function(){return this.string.slice(this.start,this.pos)},Kn.prototype.hideFirstChars=function(e,n){this.lineStart+=e;try{return n()}finally{this.lineStart-=e}},Kn.prototype.lookAhead=function(e){var n=this.lineOracle;return n&&n.lookAhead(e)},Kn.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function wn(e,n){if(n-=e.first,n<0||n>=e.size)throw new Error("There is no line "+(n+e.first)+" in the document.");for(var S=e;!S.lines;)for(var x=0;;++x){var k=S.children[x],X=k.chunkSize();if(n<X){S=k;break}n-=X}return S.lines[n]}function xr(e,n,S){var x=[],k=n.line;return e.iter(n.line,S.line+1,function(X){var J=X.text;k==S.line&&(J=J.slice(0,S.ch)),k==n.line&&(J=J.slice(n.ch)),x.push(J),++k}),x}function Fr(e,n,S){var x=[];return e.iter(n,S,function(k){x.push(k.text)}),x}function hr(e,n){var S=n-e.height;if(S)for(var x=e;x;x=x.parent)x.height+=S}function dr(e){if(e.parent==null)return null;for(var n=e.parent,S=$(n.lines,e),x=n.parent;x;n=x,x=x.parent)for(var k=0;!(x.children[k]==n);++k)S+=x.children[k].chunkSize();return S+n.first}function Nr(e,n){var S=e.first;e:do{for(var x=0;x<e.children.length;++x){var k=e.children[x],X=k.height;if(n<X){e=k;continue e}n-=X,S+=k.chunkSize()}return S}while(!e.lines);for(var J=0;J<e.lines.length;++J){var ne=e.lines[J],oe=ne.height;if(n<oe)break;n-=oe}return S+J}function ti(e,n){return n>=e.first&&n<e.first+e.size}function pi(e,n){return String(e.lineNumberFormatter(n+e.firstLineNumber))}function fn(e,n,S){if(S===void 0&&(S=null),!(this instanceof fn))return new fn(e,n,S);this.line=e,this.ch=n,this.sticky=S}function ar(e,n){return e.line-n.line||e.ch-n.ch}function oi(e,n){return e.sticky==n.sticky&&ar(e,n)==0}function _i(e){return fn(e.line,e.ch)}function Qr(e,n){return ar(e,n)<0?n:e}function ni(e,n){return ar(e,n)<0?e:n}function ee(e,n){return Math.max(e.first,Math.min(n,e.first+e.size-1))}function B(e,n){if(n.line<e.first)return fn(e.first,0);var S=e.first+e.size-1;return n.line>S?fn(S,wn(e,S).text.length):K(n,wn(e,n.line).text.length)}function K(e,n){var S=e.ch;return S==null||S>n?fn(e.line,n):S<0?fn(e.line,0):e}function Q(e,n){for(var S=[],x=0;x<n.length;x++)S[x]=B(e,n[x]);return S}var le=function(e,n){this.state=e,this.lookAhead=n},Z=function(e,n,S,x){this.state=n,this.doc=e,this.line=S,this.maxLookAhead=x||0,this.baseTokens=null,this.baseTokenPos=1};Z.prototype.lookAhead=function(e){var n=this.doc.getLine(this.line+e);return n!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),n},Z.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var n=this.baseTokens[this.baseTokenPos+1];return{type:n&&n.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Z.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Z.fromSaved=function(e,n,S){return n instanceof le?new Z(e,gn(e.mode,n.state),S,n.lookAhead):new Z(e,gn(e.mode,n),S)},Z.prototype.save=function(e){var n=e!==!1?gn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new le(n,this.maxLookAhead):n};function Qe(e,n,S,x){var k=[e.state.modeGen],X={};In(e,n.text,e.doc.mode,S,function(he,ze){return k.push(he,ze)},X,x);for(var J=S.state,ne=function(he){S.baseTokens=k;var ze=e.state.overlays[he],tt=1,Dt=0;S.state=!0,In(e,n.text,ze.mode,S,function(Ct,tn){for(var bn=tt;Dt<Ct;){var Ln=k[tt];Ln>Ct&&k.splice(tt,1,Ct,k[tt+1],Ln),tt+=2,Dt=Math.min(Ct,Ln)}if(!tn)return;if(ze.opaque)k.splice(bn,tt-bn,Ct,"overlay "+tn),tt=bn+2;else for(;bn<tt;bn+=2){var Nn=k[bn+1];k[bn+1]=(Nn?Nn+" ":"")+"overlay "+tn}},X),S.state=J,S.baseTokens=null,S.baseTokenPos=1},oe=0;oe<e.state.overlays.length;++oe)ne(oe);return{styles:k,classes:X.bgClass||X.textClass?X:null}}function qt(e,n,S){if(!n.styles||n.styles[0]!=e.state.modeGen){var x=An(e,dr(n)),k=n.text.length>e.options.maxHighlightLength&&gn(e.doc.mode,x.state),X=Qe(e,n,x);k&&(x.state=k),n.stateAfter=x.save(!k),n.styles=X.styles,X.classes?n.styleClasses=X.classes:n.styleClasses&&(n.styleClasses=null),S===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return n.styles}function An(e,n,S){var x=e.doc,k=e.display;if(!x.mode.startState)return new Z(x,!0,n);var X=sr(e,n,S),J=X>x.first&&wn(x,X-1).stateAfter,ne=J?Z.fromSaved(x,J,X):new Z(x,ur(x.mode),X);return x.iter(X,n,function(oe){Vn(e,oe.text,ne);var he=ne.line;oe.stateAfter=he==n-1||he%5==0||he>=k.viewFrom&&he<k.viewTo?ne.save():null,ne.nextLine()}),S&&(x.modeFrontier=ne.line),ne}function Vn(e,n,S,x){var k=e.doc.mode,X=new Kn(n,e.options.tabSize,S);for(X.start=X.pos=x||0,n==""&&sn(k,S.state);!X.eol();)tr(k,X,S.state),X.start=X.pos}function sn(e,n){if(e.blankLine)return e.blankLine(n);if(!e.innerMode)return;var S=On(e,n);if(S.mode.blankLine)return S.mode.blankLine(S.state)}function tr(e,n,S,x){for(var k=0;k<10;k++){x&&(x[0]=On(e,S).mode);var X=e.token(n,S);if(n.pos>n.start)return X}throw new Error("Mode "+e.name+" failed to advance stream.")}var vn=function(e,n,S){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=n||null,this.state=S};function ln(e,n,S,x){var k=e.doc,X=k.mode,J;n=B(k,n);var ne=wn(k,n.line),oe=An(e,n.line,S),he=new Kn(ne.text,e.options.tabSize,oe),ze;for(x&&(ze=[]);(x||he.pos<n.ch)&&!he.eol();)he.start=he.pos,J=tr(X,he,oe.state),x&&ze.push(new vn(he,J,gn(k.mode,oe.state)));return x?ze:new vn(he,J,oe.state)}function xn(e,n){if(e)for(;;){var S=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!S)break;e=e.slice(0,S.index)+e.slice(S.index+S[0].length);var x=S[1]?"bgClass":"textClass";n[x]==null?n[x]=S[2]:new RegExp("(?:^|\\s)"+S[2]+"(?:$|\\s)").test(n[x])||(n[x]+=" "+S[2])}return e}function In(e,n,S,x,k,X,J){var ne=S.flattenSpans;ne==null&&(ne=e.options.flattenSpans);var oe=0,he=null,ze=new Kn(n,e.options.tabSize,x),tt,Dt=e.options.addModeClass&&[null];for(n==""&&xn(sn(S,x.state),X);!ze.eol();){if(ze.pos>e.options.maxHighlightLength?(ne=!1,J&&Vn(e,n,x,ze.pos),ze.pos=n.length,tt=null):tt=xn(tr(S,ze,x.state,Dt),X),Dt){var Ct=Dt[0].name;Ct&&(tt="m-"+(tt?Ct+" "+tt:Ct))}if(!ne||he!=tt){for(;oe<ze.start;)oe=Math.min(ze.start,oe+5e3),k(oe,he);he=tt}ze.start=ze.pos}for(;oe<ze.pos;){var tn=Math.min(ze.pos,oe+5e3);k(tn,he),oe=tn}}function sr(e,n,S){for(var x,k,X=e.doc,J=S?-1:n-(e.doc.mode.innerMode?1e3:100),ne=n;ne>J;--ne){if(ne<=X.first)return X.first;var oe=wn(X,ne-1),he=oe.stateAfter;if(he&&(!S||ne+(he instanceof le?he.lookAhead:0)<=X.modeFrontier))return ne;var ze=V(oe.text,null,e.options.tabSize);(k==null||x>ze)&&(k=ne-1,x=ze)}return k}function $n(e,n){if(e.modeFrontier=Math.min(e.modeFrontier,n),e.highlightFrontier<n-10)return;for(var S=e.first,x=n-1;x>S;x--){var k=wn(e,x).stateAfter;if(k&&(!(k instanceof le)||x+k.lookAhead<n)){S=x+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,S)}var Zn=!1,kn=!1;function mr(){Zn=!0}function Fn(){kn=!0}function nr(e,n,S){this.marker=e,this.from=n,this.to=S}function Gn(e,n){if(e)for(var S=0;S<e.length;++S){var x=e[S];if(x.marker==n)return x}}function Hn(e,n){for(var S,x=0;x<e.length;++x)e[x]!=n&&(S||(S=[])).push(e[x]);return S}function Sr(e,n){e.markedSpans=e.markedSpans?e.markedSpans.concat([n]):[n],n.marker.attachLine(e)}function wr(e,n,S){var x;if(e)for(var k=0;k<e.length;++k){var X=e[k],J=X.marker,ne=X.from==null||(J.inclusiveLeft?X.from<=n:X.from<n);if(ne||X.from==n&&J.type=="bookmark"&&(!S||!X.marker.insertLeft)){var oe=X.to==null||(J.inclusiveRight?X.to>=n:X.to>n);(x||(x=[])).push(new nr(J,X.from,oe?null:X.to))}}return x}function br(e,n,S){var x;if(e)for(var k=0;k<e.length;++k){var X=e[k],J=X.marker,ne=X.to==null||(J.inclusiveRight?X.to>=n:X.to>n);if(ne||X.from==n&&J.type=="bookmark"&&(!S||X.marker.insertLeft)){var oe=X.from==null||(J.inclusiveLeft?X.from<=n:X.from<n);(x||(x=[])).push(new nr(J,oe?null:X.from-n,X.to==null?null:X.to-n))}}return x}function Er(e,n){if(n.full)return null;var S=ti(e,n.from.line)&&wn(e,n.from.line).markedSpans,x=ti(e,n.to.line)&&wn(e,n.to.line).markedSpans;if(!S&&!x)return null;var k=n.from.ch,X=n.to.ch,J=ar(n.from,n.to)==0,ne=wr(S,k,J),oe=br(x,X,J),he=n.text.length==1,ze=$e(n.text).length+(he?k:0);if(ne)for(var tt=0;tt<ne.length;++tt){var Dt=ne[tt];if(Dt.to==null){var Ct=Gn(oe,Dt.marker);Ct?he&&(Dt.to=Ct.to==null?null:Ct.to+ze):Dt.to=k}}if(oe)for(var tn=0;tn<oe.length;++tn){var bn=oe[tn];if(bn.to!=null&&(bn.to+=ze),bn.from==null){var Ln=Gn(ne,bn.marker);Ln||(bn.from=ze,he&&(ne||(ne=[])).push(bn))}else bn.from+=ze,he&&(ne||(ne=[])).push(bn)}ne&&(ne=te(ne)),oe&&oe!=ne&&(oe=te(oe));var Nn=[ne];if(!he){var Yn=n.text.length-2,jn;if(Yn>0&&ne)for(var er=0;er<ne.length;++er)ne[er].to==null&&(jn||(jn=[])).push(new nr(ne[er].marker,null,null));for(var _r=0;_r<Yn;++_r)Nn.push(jn);Nn.push(oe)}return Nn}function te(e){for(var n=0;n<e.length;++n){var S=e[n];S.from!=null&&S.from==S.to&&S.marker.clearWhenEmpty!==!1&&e.splice(n--,1)}return e.length?e:null}function Te(e,n,S){var x=null;if(e.iter(n.line,S.line+1,function(Ct){if(Ct.markedSpans)for(var tn=0;tn<Ct.markedSpans.length;++tn){var bn=Ct.markedSpans[tn].marker;bn.readOnly&&(!x||$(x,bn)==-1)&&(x||(x=[])).push(bn)}}),!x)return null;for(var k=[{from:n,to:S}],X=0;X<x.length;++X)for(var J=x[X],ne=J.find(0),oe=0;oe<k.length;++oe){var he=k[oe];if(ar(he.to,ne.from)<0||ar(he.from,ne.to)>0)continue;var ze=[oe,1],tt=ar(he.from,ne.from),Dt=ar(he.to,ne.to);(tt<0||!J.inclusiveLeft&&!tt)&&ze.push({from:he.from,to:ne.from}),(Dt>0||!J.inclusiveRight&&!Dt)&&ze.push({from:ne.to,to:he.to}),k.splice.apply(k,ze),oe+=ze.length-3}return k}function Ge(e){var n=e.markedSpans;if(!n)return;for(var S=0;S<n.length;++S)n[S].marker.detachLine(e);e.markedSpans=null}function Me(e,n){if(!n)return;for(var S=0;S<n.length;++S)n[S].marker.attachLine(e);e.markedSpans=n}function st(e){return e.inclusiveLeft?-1:0}function Je(e){return e.inclusiveRight?1:0}function ct(e,n){var S=e.lines.length-n.lines.length;if(S!=0)return S;var x=e.find(),k=n.find(),X=ar(x.from,k.from)||st(e)-st(n);if(X)return-X;var J=ar(x.to,k.to)||Je(e)-Je(n);return J||n.id-e.id}function ht(e,n){var S=kn&&e.markedSpans,x;if(S)for(var k=void 0,X=0;X<S.length;++X)k=S[X],k.marker.collapsed&&(n?k.from:k.to)==null&&(!x||ct(x,k.marker)<0)&&(x=k.marker);return x}function at(e){return ht(e,!0)}function Mt(e){return ht(e,!1)}function Gt(e,n){var S=kn&&e.markedSpans,x;if(S)for(var k=0;k<S.length;++k){var X=S[k];X.marker.collapsed&&(X.from==null||X.from<n)&&(X.to==null||X.to>n)&&(!x||ct(x,X.marker)<0)&&(x=X.marker)}return x}function Vt(e,n,S,x,k){var X=wn(e,n),J=kn&&X.markedSpans;if(J)for(var ne=0;ne<J.length;++ne){var oe=J[ne];if(!oe.marker.collapsed)continue;var he=oe.marker.find(0),ze=ar(he.from,S)||st(oe.marker)-st(k),tt=ar(he.to,x)||Je(oe.marker)-Je(k);if(ze>=0&&tt<=0||ze<=0&&tt>=0)continue;if(ze<=0&&(oe.marker.inclusiveRight&&k.inclusiveLeft?ar(he.to,S)>=0:ar(he.to,S)>0)||ze>=0&&(oe.marker.inclusiveRight&&k.inclusiveLeft?ar(he.from,x)<=0:ar(he.from,x)<0))return!0}}function wt(e){for(var n;n=at(e);)e=n.find(-1,!0).line;return e}function Nt(e){for(var n;n=Mt(e);)e=n.find(1,!0).line;return e}function it(e){for(var n,S;n=Mt(e);)e=n.find(1,!0).line,(S||(S=[])).push(e);return S}function Qt(e,n){var S=wn(e,n),x=wt(S);return S==x?n:dr(x)}function Wt(e,n){if(n>e.lastLine())return n;var S=wn(e,n),x;if(!yn(e,S))return n;for(;x=Mt(S);)S=x.find(1,!0).line;return dr(S)+1}function yn(e,n){var S=kn&&n.markedSpans;if(S)for(var x=void 0,k=0;k<S.length;++k){if(x=S[k],!x.marker.collapsed)continue;if(x.from==null)return!0;if(x.marker.widgetNode)continue;if(x.from==0&&x.marker.inclusiveLeft&&Dn(e,n,x))return!0}}function Dn(e,n,S){if(S.to==null){var x=S.marker.find(1,!0);return Dn(e,x.line,Gn(x.line.markedSpans,S.marker))}if(S.marker.inclusiveRight&&S.to==n.text.length)return!0;for(var k=void 0,X=0;X<n.markedSpans.length;++X)if(k=n.markedSpans[X],k.marker.collapsed&&!k.marker.widgetNode&&k.from==S.to&&(k.to==null||k.to!=S.from)&&(k.marker.inclusiveLeft||S.marker.inclusiveRight)&&Dn(e,n,k))return!0}function Kt(e){e=wt(e);for(var n=0,S=e.parent,x=0;x<S.lines.length;++x){var k=S.lines[x];if(k==e)break;n+=k.height}for(var X=S.parent;X;S=X,X=S.parent)for(var J=0;J<X.children.length;++J){var ne=X.children[J];if(ne==S)break;n+=ne.height}return n}function dn(e){if(e.height==0)return 0;for(var n=e.text.length,S,x=e;S=at(x);){var k=S.find(0,!0);x=k.from.line,n+=k.from.ch-k.to.ch}for(x=e;S=Mt(x);){var X=S.find(0,!0);n-=x.text.length-X.from.ch,x=X.to.line,n+=x.text.length-X.to.ch}return n}function Ht(e){var n=e.display,S=e.doc;n.maxLine=wn(S,S.first),n.maxLineLength=dn(n.maxLine),n.maxLineChanged=!0,S.iter(function(x){var k=dn(x);k>n.maxLineLength&&(n.maxLineLength=k,n.maxLine=x)})}var Sn=function(e,n,S){this.text=e,Me(this,n),this.height=S?S(this):1};Sn.prototype.lineNo=function(){return dr(this)},we(Sn);function Tn(e,n,S,x){e.text=n,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Ge(e),Me(e,S);var k=x?x(e):1;k!=e.height&&hr(e,k)}function xt(e){e.parent=null,Ge(e)}var bt={},Lt={};function At(e,n){if(!e||/^\s*$/.test(e))return null;var S=n.addModeClass?Lt:bt;return S[e]||(S[e]=e.replace(/\S+/g,"cm-$&"))}function Et(e,n){var S=_("span",null,null,T?"padding-right: .1px":null),x={pre:_("pre",[S],"CodeMirror-line"),content:S,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};n.measure={};for(var k=0;k<=(n.rest?n.rest.length:0);k++){var X=k?n.rest[k-1]:n.line,J=void 0;x.pos=0,x.addToken=cn,Yt(e.display.measure)&&(J=nn(X,e.doc.direction))&&(x.addToken=un(x.addToken,J)),x.map=[];var ne=n!=e.display.externalMeasured&&dr(X);Cn(X,x,qt(e,X,ne)),X.styleClasses&&(X.styleClasses.bgClass&&(x.bgClass=U(X.styleClasses.bgClass,x.bgClass||"")),X.styleClasses.textClass&&(x.textClass=U(X.styleClasses.textClass,x.textClass||""))),x.map.length==0&&x.map.push(0,0,x.content.appendChild(an(e.display.measure))),k==0?(n.measure.map=x.map,n.measure.cache={}):((n.measure.maps||(n.measure.maps=[])).push(x.map),(n.measure.caches||(n.measure.caches=[])).push({}))}if(T){var oe=x.content.lastChild;(/\bcm-tab\b/.test(oe.className)||oe.querySelector&&oe.querySelector(".cm-tab"))&&(x.content.className="cm-tab-wrap-hack")}return We(e,"renderLine",e,n.line,x.pre),x.pre.className&&(x.textClass=U(x.pre.className,x.textClass||"")),x}function mn(e){var n=f("span","\u2022","cm-invalidchar");return n.title="\\u"+e.charCodeAt(0).toString(16),n.setAttribute("aria-label",n.title),n}function cn(e,n,S,x,k,X,J){if(!n)return;var ne=e.splitSpaces?_n(n,e.trailingSpace):n,oe=e.cm.state.specialChars,he=!1,ze;if(!oe.test(n))e.col+=n.length,ze=document.createTextNode(ne),e.map.push(e.pos,e.pos+n.length,ze),D&&m<9&&(he=!0),e.pos+=n.length;else{ze=document.createDocumentFragment();for(var tt=0;;){oe.lastIndex=tt;var Dt=oe.exec(n),Ct=Dt?Dt.index-tt:n.length-tt;if(Ct){var tn=document.createTextNode(ne.slice(tt,tt+Ct));D&&m<9?ze.appendChild(f("span",[tn])):ze.appendChild(tn),e.map.push(e.pos,e.pos+Ct,tn),e.col+=Ct,e.pos+=Ct}if(!Dt)break;tt+=Ct+1;var bn=void 0;if(Dt[0]==" "){var Ln=e.cm.options.tabSize,Nn=Ln-e.col%Ln;bn=ze.appendChild(f("span",ue(Nn),"cm-tab")),bn.setAttribute("role","presentation"),bn.setAttribute("cm-text"," "),e.col+=Nn}else Dt[0]=="\r"||Dt[0]==`
|
|
`?(bn=ze.appendChild(f("span",Dt[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),bn.setAttribute("cm-text",Dt[0]),e.col+=1):(bn=e.cm.options.specialCharPlaceholder(Dt[0]),bn.setAttribute("cm-text",Dt[0]),D&&m<9?ze.appendChild(f("span",[bn])):ze.appendChild(bn),e.col+=1);e.map.push(e.pos,e.pos+1,bn),e.pos++}}if(e.trailingSpace=ne.charCodeAt(n.length-1)==32,S||x||k||he||X||J){var Yn=S||"";x&&(Yn+=x),k&&(Yn+=k);var jn=f("span",[ze],Yn,X);if(J)for(var er in J)J.hasOwnProperty(er)&&er!="style"&&er!="class"&&jn.setAttribute(er,J[er]);return e.content.appendChild(jn)}e.content.appendChild(ze)}function _n(e,n){if(e.length>1&&!/ /.test(e))return e;for(var S=n,x="",k=0;k<e.length;k++){var X=e.charAt(k);X==" "&&S&&(k==e.length-1||e.charCodeAt(k+1)==32)&&(X="\xA0"),x+=X,S=X==" "}return x}function un(e,n){return function(S,x,k,X,J,ne,oe){k=k?k+" cm-force-border":"cm-force-border";for(var he=S.pos,ze=he+x.length;;){for(var tt=void 0,Dt=0;Dt<n.length&&!(tt=n[Dt],tt.to>he&&tt.from<=he);Dt++);if(tt.to>=ze)return e(S,x,k,X,J,ne,oe);e(S,x.slice(0,tt.to-he),k,X,null,ne,oe),X=null,x=x.slice(tt.to-he),he=tt.to}}}function rn(e,n,S,x){var k=!x&&S.widgetNode;k&&e.map.push(e.pos,e.pos+n,k),!x&&e.cm.display.input.needsContentAttribute&&(k||(k=e.content.appendChild(document.createElement("span"))),k.setAttribute("cm-marker",S.id)),k&&(e.cm.display.input.setUneditable(k),e.content.appendChild(k)),e.pos+=n,e.trailingSpace=!1}function Cn(e,n,S){var x=e.markedSpans,k=e.text,X=0;if(!x){for(var J=1;J<S.length;J+=2)n.addToken(n,k.slice(X,X=S[J]),At(S[J+1],n.cm.options));return}for(var ne=k.length,oe=0,he=1,ze="",tt,Dt,Ct=0,tn,bn,Ln,Nn,Yn;;){if(Ct==oe){tn=bn=Ln=Dt="",Yn=null,Nn=null,Ct=Infinity;for(var jn=[],er=void 0,_r=0;_r<x.length;++_r){var pr=x[_r],Pr=pr.marker;if(Pr.type=="bookmark"&&pr.from==oe&&Pr.widgetNode)jn.push(Pr);else if(pr.from<=oe&&(pr.to==null||pr.to>oe||Pr.collapsed&&pr.to==oe&&pr.from==oe)){if(pr.to!=null&&pr.to!=oe&&Ct>pr.to&&(Ct=pr.to,bn=""),Pr.className&&(tn+=" "+Pr.className),Pr.css&&(Dt=(Dt?Dt+";":"")+Pr.css),Pr.startStyle&&pr.from==oe&&(Ln+=" "+Pr.startStyle),Pr.endStyle&&pr.to==Ct&&(er||(er=[])).push(Pr.endStyle,pr.to),Pr.title&&((Yn||(Yn={})).title=Pr.title),Pr.attributes)for(var ii in Pr.attributes)(Yn||(Yn={}))[ii]=Pr.attributes[ii];Pr.collapsed&&(!Nn||ct(Nn.marker,Pr)<0)&&(Nn=pr)}else pr.from>oe&&Ct>pr.from&&(Ct=pr.from)}if(er)for(var Bi=0;Bi<er.length;Bi+=2)er[Bi+1]==Ct&&(bn+=" "+er[Bi]);if(!Nn||Nn.from==oe)for(var gi=0;gi<jn.length;++gi)rn(n,0,jn[gi]);if(Nn&&(Nn.from||0)==oe){if(rn(n,(Nn.to==null?ne+1:Nn.to)-oe,Nn.marker,Nn.from==null),Nn.to==null)return;Nn.to==oe&&(Nn=!1)}}if(oe>=ne)break;for(var oa=Math.min(ne,Ct);;){if(ze){var ta=oe+ze.length;if(!Nn){var Mi=ta>oa?ze.slice(0,oa-oe):ze;n.addToken(n,Mi,tt?tt+tn:tn,Ln,oe+Mi.length==Ct?bn:"",Dt,Yn)}if(ta>=oa){ze=ze.slice(oa-oe),oe=oa;break}oe=ta,Ln=""}ze=k.slice(X,X=S[he++]),tt=At(S[he++],n.cm.options)}}}function rr(e,n,S){this.line=n,this.rest=it(n),this.size=this.rest?dr($e(this.rest))-S+1:1,this.node=this.text=null,this.hidden=yn(e,n)}function cr(e,n,S){for(var x=[],k,X=n;X<S;X=k){var J=new rr(e.doc,wn(e.doc,X),X);k=X+J.size,x.push(J)}return x}var zn=null;function Dr(e){zn?zn.ops.push(e):e.ownsGroup=zn={ops:[e],delayedCallbacks:[]}}function Kr(e){var n=e.delayedCallbacks,S=0;do{for(;S<n.length;S++)n[S].call(null);for(var x=0;x<e.ops.length;x++){var k=e.ops[x];if(k.cursorActivityHandlers)for(;k.cursorActivityCalled<k.cursorActivityHandlers.length;)k.cursorActivityHandlers[k.cursorActivityCalled++].call(null,k.cm)}}while(S<n.length)}function Bn(e,n){var S=e.ownsGroup;if(!S)return;try{Kr(S)}finally{zn=null,n(S)}}var Xn=null;function Qn(e,n){var S=ut(e,n);if(!S.length)return;var x=Array.prototype.slice.call(arguments,2),k;zn?k=zn.delayedCallbacks:Xn?k=Xn:(k=Xn=[],setTimeout(Cr,0));for(var X=function(ne){k.push(function(){return S[ne].apply(null,x)})},J=0;J<S.length;++J)X(J)}function Cr(){var e=Xn;Xn=null;for(var n=0;n<e.length;++n)e[n]()}function Wr(e,n,S,x){for(var k=0;k<n.changes.length;k++){var X=n.changes[k];X=="text"?mi(e,n):X=="gutter"?Oi(e,n,S,x):X=="class"?Xi(e,n):X=="widget"&&Pi(e,n,x)}n.changes=null}function Jr(e){return e.node==e.text&&(e.node=f("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),D&&m<8&&(e.node.style.zIndex=2)),e.node}function li(e,n){var S=n.bgClass?n.bgClass+" "+(n.line.bgClass||""):n.line.bgClass;if(S&&(S+=" CodeMirror-linebackground"),n.background)S?n.background.className=S:(n.background.parentNode.removeChild(n.background),n.background=null);else if(S){var x=Jr(n);n.background=x.insertBefore(f("div",null,S),x.firstChild),e.display.input.setUneditable(n.background)}}function xi(e,n){var S=e.display.externalMeasured;return S&&S.line==n.line?(e.display.externalMeasured=null,n.measure=S.measure,S.built):Et(e,n)}function mi(e,n){var S=n.text.className,x=xi(e,n);n.text==n.node&&(n.node=x.pre),n.text.parentNode.replaceChild(x.pre,n.text),n.text=x.pre,x.bgClass!=n.bgClass||x.textClass!=n.textClass?(n.bgClass=x.bgClass,n.textClass=x.textClass,Xi(e,n)):S&&(n.text.className=S)}function Xi(e,n){li(e,n),n.line.wrapClass?Jr(n).className=n.line.wrapClass:n.node!=n.text&&(n.node.className="");var S=n.textClass?n.textClass+" "+(n.line.textClass||""):n.line.textClass;n.text.className=S||""}function Oi(e,n,S,x){if(n.gutter&&(n.node.removeChild(n.gutter),n.gutter=null),n.gutterBackground&&(n.node.removeChild(n.gutterBackground),n.gutterBackground=null),n.line.gutterClass){var k=Jr(n);n.gutterBackground=f("div",null,"CodeMirror-gutter-background "+n.line.gutterClass,"left: "+(e.options.fixedGutter?x.fixedPos:-x.gutterTotalWidth)+"px; width: "+x.gutterTotalWidth+"px"),e.display.input.setUneditable(n.gutterBackground),k.insertBefore(n.gutterBackground,n.text)}var X=n.line.gutterMarkers;if(e.options.lineNumbers||X){var J=Jr(n),ne=n.gutter=f("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?x.fixedPos:-x.gutterTotalWidth)+"px");if(e.display.input.setUneditable(ne),J.insertBefore(ne,n.text),n.line.gutterClass&&(ne.className+=" "+n.line.gutterClass),e.options.lineNumbers&&(!X||!X["CodeMirror-linenumbers"])&&(n.lineNumber=ne.appendChild(f("div",pi(e.options,S),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+x.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),X)for(var oe=0;oe<e.display.gutterSpecs.length;++oe){var he=e.display.gutterSpecs[oe].className,ze=X.hasOwnProperty(he)&&X[he];ze&&ne.appendChild(f("div",[ze],"CodeMirror-gutter-elt","left: "+x.gutterLeft[he]+"px; width: "+x.gutterWidth[he]+"px"))}}}function Pi(e,n,S){n.alignable&&(n.alignable=null);for(var x=E("CodeMirror-linewidget"),k=n.node.firstChild,X=void 0;k;k=X)X=k.nextSibling,x.test(k.className)&&n.node.removeChild(k);Ni(e,n,S)}function vi(e,n,S,x){var k=xi(e,n);return n.text=n.node=k.pre,k.bgClass&&(n.bgClass=k.bgClass),k.textClass&&(n.textClass=k.textClass),Xi(e,n),Oi(e,n,S,x),Ni(e,n,x),n.node}function Ni(e,n,S){if(ia(e,n.line,n,S,!0),n.rest)for(var x=0;x<n.rest.length;x++)ia(e,n.rest[x],n,S,!1)}function ia(e,n,S,x,k){if(!n.widgets)return;for(var X=Jr(S),J=0,ne=n.widgets;J<ne.length;++J){var oe=ne[J],he=f("div",[oe.node],"CodeMirror-linewidget"+(oe.className?" "+oe.className:""));oe.handleMouseEvents||he.setAttribute("cm-ignore-events","true"),ui(oe,he,S,x),e.display.input.setUneditable(he),k&&oe.above?X.insertBefore(he,S.gutter||S.text):X.appendChild(he),Qn(oe,"redraw")}}function ui(e,n,S,x){if(e.noHScroll){(S.alignable||(S.alignable=[])).push(n);var k=x.wrapperWidth;n.style.left=x.fixedPos+"px",e.coverGutter||(k-=x.gutterTotalWidth,n.style.paddingLeft=x.gutterTotalWidth+"px"),n.style.width=k+"px"}e.coverGutter&&(n.style.zIndex=5,n.style.position="relative",e.noHScroll||(n.style.marginLeft=-x.gutterTotalWidth+"px"))}function di(e){if(e.height!=null)return e.height;var n=e.doc.cm;if(!n)return 0;if(!v(document.body,e.node)){var S="position: relative;";e.coverGutter&&(S+="margin-left: -"+n.display.gutters.offsetWidth+"px;"),e.noHScroll&&(S+="width: "+n.display.wrapper.clientWidth+"px;"),u(n.display.measure,f("div",[e.node],null,S))}return e.height=e.node.parentNode.offsetHeight}function Ri(e,n){for(var S=Ce(n);S!=e.wrapper;S=S.parentNode)if(!S||S.nodeType==1&&S.getAttribute("cm-ignore-events")=="true"||S.parentNode==e.sizer&&S!=e.mover)return!0}function Ci(e){return e.lineSpace.offsetTop}function Oe(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function et(e){if(e.cachedPaddingH)return e.cachedPaddingH;var n=u(e.measure,f("pre","x","CodeMirror-line-like")),S=window.getComputedStyle?window.getComputedStyle(n):n.currentStyle,x={left:parseInt(S.paddingLeft),right:parseInt(S.paddingRight)};return!isNaN(x.left)&&!isNaN(x.right)&&(e.cachedPaddingH=x),x}function rt(e){return q-e.display.nativeBarWidth}function Ie(e){return e.display.scroller.clientWidth-rt(e)-e.display.barWidth}function de(e){return e.display.scroller.clientHeight-rt(e)-e.display.barHeight}function Ee(e,n,S){var x=e.options.lineWrapping,k=x&&Ie(e);if(!n.measure.heights||x&&n.measure.width!=k){var X=n.measure.heights=[];if(x){n.measure.width=k;for(var J=n.text.firstChild.getClientRects(),ne=0;ne<J.length-1;ne++){var oe=J[ne],he=J[ne+1];Math.abs(oe.bottom-he.bottom)>2&&X.push((oe.bottom+he.top)/2-S.top)}}X.push(S.bottom-S.top)}}function pe(e,n,S){if(e.line==n)return{map:e.measure.map,cache:e.measure.cache};for(var x=0;x<e.rest.length;x++)if(e.rest[x]==n)return{map:e.measure.maps[x],cache:e.measure.caches[x]};for(var k=0;k<e.rest.length;k++)if(dr(e.rest[k])>S)return{map:e.measure.maps[k],cache:e.measure.caches[k],before:!0}}function Ne(e,n){n=wt(n);var S=dr(n),x=e.display.externalMeasured=new rr(e.doc,n,S);x.lineN=S;var k=x.built=Et(e,x);return x.text=k.pre,u(e.display.lineMeasure,k.pre),x}function Ke(e,n,S,x){return _t(e,He(e,n),S,x)}function ot(e,n){if(n>=e.display.viewFrom&&n<e.display.viewTo)return e.display.view[Zr(e,n)];var S=e.display.externalMeasured;if(S&&n>=S.lineN&&n<S.lineN+S.size)return S}function He(e,n){var S=dr(n),x=ot(e,S);x&&!x.text?x=null:x&&x.changes&&(Wr(e,x,S,fr(e)),e.curOp.forceUpdate=!0),x||(x=Ne(e,n));var k=pe(x,n,S);return{line:n,view:x,rect:null,map:k.map,cache:k.cache,before:k.before,hasHeights:!1}}function _t(e,n,S,x,k){n.before&&(S=-1);var X=S+(x||""),J;return n.cache.hasOwnProperty(X)?J=n.cache[X]:(n.rect||(n.rect=n.view.text.getBoundingClientRect()),n.hasHeights||(Ee(e,n.view,n.rect),n.hasHeights=!0),J=Rn(e,n,S,x),J.bogus||(n.cache[X]=J)),{left:J.left,right:J.right,top:k?J.rtop:J.top,bottom:k?J.rbottom:J.bottom}}var Ut={left:0,right:0,top:0,bottom:0};function en(e,n,S){for(var x,k,X,J,ne,oe,he=0;he<e.length;he+=3)if(ne=e[he],oe=e[he+1],n<ne?(k=0,X=1,J="left"):n<oe?(k=n-ne,X=k+1):(he==e.length-3||n==oe&&e[he+3]>n)&&(X=oe-ne,k=X-1,n>=oe&&(J="right")),k!=null){if(x=e[he+2],ne==oe&&S==(x.insertLeft?"left":"right")&&(J=S),S=="left"&&k==0)for(;he&&e[he-2]==e[he-3]&&e[he-1].insertLeft;)x=e[(he-=3)+2],J="left";if(S=="right"&&k==oe-ne)for(;he<e.length-3&&e[he+3]==e[he+4]&&!e[he+5].insertLeft;)x=e[(he+=3)+2],J="right";break}return{node:x,start:k,end:X,collapse:J,coverStart:ne,coverEnd:oe}}function hn(e,n){var S=Ut;if(n=="left")for(var x=0;x<e.length&&!((S=e[x]).left!=S.right);x++);else for(var k=e.length-1;k>=0&&!((S=e[k]).left!=S.right);k--);return S}function Rn(e,n,S,x){var k=en(n.map,S,x),X=k.node,J=k.start,ne=k.end,oe=k.collapse,he;if(X.nodeType==3){for(var ze=0;ze<4;ze++){for(;J&&Xe(n.line.text.charAt(k.coverStart+J));)--J;for(;k.coverStart+ne<k.coverEnd&&Xe(n.line.text.charAt(k.coverStart+ne));)++ne;if(D&&m<9&&J==0&&ne==k.coverEnd-k.coverStart?he=X.parentNode.getBoundingClientRect():he=hn(y(X,J,ne).getClientRects(),x),he.left||he.right||J==0)break;ne=J,J=J-1,oe="right"}D&&m<11&&(he=Wn(e.display.measure,he))}else{J>0&&(oe=x="right");var tt;e.options.lineWrapping&&(tt=X.getClientRects()).length>1?he=tt[x=="right"?tt.length-1:0]:he=X.getBoundingClientRect()}if(D&&m<9&&!J&&(!he||!he.left&&!he.right)){var Dt=X.parentNode.getClientRects()[0];Dt?he={left:Dt.left,right:Dt.left+kr(e.display),top:Dt.top,bottom:Dt.bottom}:he=Ut}for(var Ct=he.top-n.rect.top,tn=he.bottom-n.rect.top,bn=(Ct+tn)/2,Ln=n.view.measure.heights,Nn=0;Nn<Ln.length-1&&!(bn<Ln[Nn]);Nn++);var Yn=Nn?Ln[Nn-1]:0,jn=Ln[Nn],er={left:(oe=="right"?he.right:he.left)-n.rect.left,right:(oe=="left"?he.left:he.right)-n.rect.left,top:Yn,bottom:jn};return!he.left&&!he.right&&(er.bogus=!0),e.options.singleCursorHeightPerLine||(er.rtop=Ct,er.rbottom=tn),er}function Wn(e,n){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!je(e))return n;var S=screen.logicalXDPI/screen.deviceXDPI,x=screen.logicalYDPI/screen.deviceYDPI;return{left:n.left*S,right:n.right*S,top:n.top*x,bottom:n.bottom*x}}function lr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var n=0;n<e.rest.length;n++)e.measure.caches[n]={}}function on(e){e.display.externalMeasure=null,l(e.display.lineMeasure);for(var n=0;n<e.display.view.length;n++)lr(e.display.view[n])}function It(e){on(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Jt(){return i&&o?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Pn(){return i&&o?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function En(e){var n=0;if(e.widgets)for(var S=0;S<e.widgets.length;++S)e.widgets[S].above&&(n+=di(e.widgets[S]));return n}function vr(e,n,S,x,k){if(!k){var X=En(n);S.top+=X,S.bottom+=X}if(x=="line")return S;x||(x="local");var J=Kt(n);if(x=="local"?J+=Ci(e.display):J-=e.display.viewOffset,x=="page"||x=="window"){var ne=e.display.lineSpace.getBoundingClientRect();J+=ne.top+(x=="window"?0:Pn());var oe=ne.left+(x=="window"?0:Jt());S.left+=oe,S.right+=oe}return S.top+=J,S.bottom+=J,S}function qn(e,n,S){if(S=="div")return n;var x=n.left,k=n.top;if(S=="page")x-=Jt(),k-=Pn();else if(S=="local"||!S){var X=e.display.sizer.getBoundingClientRect();x+=X.left,k+=X.top}var J=e.display.lineSpace.getBoundingClientRect();return{left:x-J.left,top:k-J.top}}function Tr(e,n,S,x,k){return x||(x=wn(e.doc,n.line)),vr(e,x,Ke(e,x,n.ch,k),S)}function ir(e,n,S,x,k,X){x=x||wn(e.doc,n.line),k||(k=He(e,x));function J(tn,bn){var Ln=_t(e,k,tn,bn?"right":"left",X);return bn?Ln.left=Ln.right:Ln.right=Ln.left,vr(e,x,Ln,S)}var ne=nn(x,e.doc.direction),oe=n.ch,he=n.sticky;if(oe>=x.text.length?(oe=x.text.length,he="before"):oe<=0&&(oe=0,he="after"),!ne)return J(he=="before"?oe-1:oe,he=="before");function ze(tn,bn,Ln){var Nn=ne[bn],Yn=Nn.level==1;return J(Ln?tn-1:tn,Yn!=Ln)}var tt=Ve(ne,oe,he),Dt=Bt,Ct=ze(oe,tt,he=="before");return Dt!=null&&(Ct.other=ze(oe,Dt,he!="before")),Ct}function pn(e,n){var S=0;n=B(e.doc,n),e.options.lineWrapping||(S=kr(e.display)*n.ch);var x=wn(e.doc,n.line),k=Kt(x)+Ci(e.display);return{left:S,right:S,top:k,bottom:k+x.height}}function Mn(e,n,S,x,k){var X=fn(e,n,S);return X.xRel=k,x&&(X.outside=x),X}function gr(e,n,S){var x=e.doc;if(S+=e.display.viewOffset,S<0)return Mn(x.first,0,null,-1,-1);var k=Nr(x,S),X=x.first+x.size-1;if(k>X)return Mn(x.first+x.size-1,wn(x,X).text.length,null,1,1);n<0&&(n=0);for(var J=wn(x,k);;){var ne=Yr(e,J,k,n,S),oe=Gt(J,ne.ch+(ne.xRel>0||ne.outside>0?1:0));if(!oe)return ne;var he=oe.find(1);if(he.line==k)return he;J=wn(x,k=he.line)}}function Rr(e,n,S,x){x-=En(n);var k=n.text.length,X=Rt(function(J){return _t(e,S,J-1).bottom<=x},k,0);return k=Rt(function(J){return _t(e,S,J).top>x},X,k),{begin:X,end:k}}function Jn(e,n,S,x){S||(S=He(e,n));var k=vr(e,n,_t(e,S,x),"line").top;return Rr(e,n,S,k)}function Mr(e,n,S,x){return e.bottom<=S?!1:e.top>S?!0:(x?e.left:e.right)>n}function Yr(e,n,S,x,k){k-=Kt(n);var X=He(e,n),J=En(n),ne=0,oe=n.text.length,he=!0,ze=nn(n,e.doc.direction);if(ze){var tt=(e.options.lineWrapping?Br:Lr)(e,n,S,X,ze,x,k);he=tt.level!=1,ne=he?tt.from:tt.to-1,oe=he?tt.to:tt.from-1}var Dt=null,Ct=null,tn=Rt(function(_r){var pr=_t(e,X,_r);return pr.top+=J,pr.bottom+=J,Mr(pr,x,k,!1)?(pr.top<=k&&pr.left<=x&&(Dt=_r,Ct=pr),!0):!1},ne,oe),bn,Ln,Nn=!1;if(Ct){var Yn=x-Ct.left<Ct.right-x,jn=Yn==he;tn=Dt+(jn?0:1),Ln=jn?"after":"before",bn=Yn?Ct.left:Ct.right}else{!he&&(tn==oe||tn==ne)&&tn++,Ln=tn==0?"after":tn==n.text.length?"before":_t(e,X,tn-(he?1:0)).bottom+J<=k==he?"after":"before";var er=ir(e,fn(S,tn,Ln),"line",n,X);bn=er.left,Nn=k<er.top?-1:k>=er.bottom?1:0}return tn=ft(n.text,tn,1),Mn(S,tn,Ln,Nn,x-bn)}function Lr(e,n,S,x,k,X,J){var ne=Rt(function(tt){var Dt=k[tt],Ct=Dt.level!=1;return Mr(ir(e,fn(S,Ct?Dt.to:Dt.from,Ct?"before":"after"),"line",n,x),X,J,!0)},0,k.length-1),oe=k[ne];if(ne>0){var he=oe.level!=1,ze=ir(e,fn(S,he?oe.from:oe.to,he?"after":"before"),"line",n,x);Mr(ze,X,J,!0)&&ze.top>J&&(oe=k[ne-1])}return oe}function Br(e,n,S,x,k,X,J){var ne=Rr(e,n,x,J),oe=ne.begin,he=ne.end;/\s/.test(n.text.charAt(he-1))&&he--;for(var ze=null,tt=null,Dt=0;Dt<k.length;Dt++){var Ct=k[Dt];if(Ct.from>=he||Ct.to<=oe)continue;var tn=Ct.level!=1,bn=_t(e,x,tn?Math.min(he,Ct.to)-1:Math.max(oe,Ct.from)).right,Ln=bn<X?X-bn+1e9:bn-X;(!ze||tt>Ln)&&(ze=Ct,tt=Ln)}return ze||(ze=k[k.length-1]),ze.from<oe&&(ze={from:oe,to:ze.to,level:ze.level}),ze.to>he&&(ze={from:ze.from,to:he,level:ze.level}),ze}var jr;function Ir(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(jr==null){jr=f("pre",null,"CodeMirror-line-like");for(var n=0;n<49;++n)jr.appendChild(document.createTextNode("x")),jr.appendChild(f("br"));jr.appendChild(document.createTextNode("x"))}u(e.measure,jr);var S=jr.offsetHeight/50;return S>3&&(e.cachedTextHeight=S),l(e.measure),S||1}function kr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var n=f("span","xxxxxxxxxx"),S=f("pre",[n],"CodeMirror-line-like");u(e.measure,S);var x=n.getBoundingClientRect(),k=(x.right-x.left)/10;return k>2&&(e.cachedCharWidth=k),k||10}function fr(e){for(var n=e.display,S={},x={},k=n.gutters.clientLeft,X=n.gutters.firstChild,J=0;X;X=X.nextSibling,++J){var ne=e.display.gutterSpecs[J].className;S[ne]=X.offsetLeft+X.clientLeft+k,x[ne]=X.clientWidth}return{fixedPos:si(n),gutterTotalWidth:n.gutters.offsetWidth,gutterLeft:S,gutterWidth:x,wrapperWidth:n.wrapper.clientWidth}}function si(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Qi(e){var n=Ir(e.display),S=e.options.lineWrapping,x=S&&Math.max(5,e.display.scroller.clientWidth/kr(e.display)-3);return function(k){if(yn(e.doc,k))return 0;var X=0;if(k.widgets)for(var J=0;J<k.widgets.length;J++)k.widgets[J].height&&(X+=k.widgets[J].height);return S?X+(Math.ceil(k.text.length/x)||1)*n:X+n}}function ji(e){var n=e.doc,S=Qi(e);n.iter(function(x){var k=S(x);k!=x.height&&hr(x,k)})}function wi(e,n,S,x){var k=e.display;if(!S&&Ce(n).getAttribute("cm-not-content")=="true")return null;var X,J,ne=k.lineSpace.getBoundingClientRect();try{X=n.clientX-ne.left,J=n.clientY-ne.top}catch(tt){return null}var oe=gr(e,X,J),he;if(x&&oe.xRel>0&&(he=wn(e.doc,oe.line).text).length==oe.ch){var ze=V(he,he.length,e.options.tabSize)-he.length;oe=fn(oe.line,Math.max(0,Math.round((X-et(e.display).left)/kr(e.display))-ze))}return oe}function Zr(e,n){if(n>=e.display.viewTo)return null;if(n-=e.display.viewFrom,n<0)return null;for(var S=e.display.view,x=0;x<S.length;x++)if(n-=S[x].size,n<0)return x}function Gr(e,n,S,x){n==null&&(n=e.doc.first),S==null&&(S=e.doc.first+e.doc.size),x||(x=0);var k=e.display;if(x&&S<k.viewTo&&(k.updateLineNumbers==null||k.updateLineNumbers>n)&&(k.updateLineNumbers=n),e.curOp.viewChanged=!0,n>=k.viewTo)kn&&Qt(e.doc,n)<k.viewTo&&qr(e);else if(S<=k.viewFrom)kn&&Wt(e.doc,S+x)>k.viewFrom?qr(e):(k.viewFrom+=x,k.viewTo+=x);else if(n<=k.viewFrom&&S>=k.viewTo)qr(e);else if(n<=k.viewFrom){var X=Ui(e,S,S+x,1);X?(k.view=k.view.slice(X.index),k.viewFrom=X.lineN,k.viewTo+=x):qr(e)}else if(S>=k.viewTo){var J=Ui(e,n,n,-1);J?(k.view=k.view.slice(0,J.index),k.viewTo=J.lineN):qr(e)}else{var ne=Ui(e,n,n,-1),oe=Ui(e,S,S+x,1);ne&&oe?(k.view=k.view.slice(0,ne.index).concat(cr(e,ne.lineN,oe.lineN)).concat(k.view.slice(oe.index)),k.viewTo+=x):qr(e)}var he=k.externalMeasured;he&&(S<he.lineN?he.lineN+=x:n<he.lineN+he.size&&(k.externalMeasured=null))}function Xr(e,n,S){e.curOp.viewChanged=!0;var x=e.display,k=e.display.externalMeasured;if(k&&n>=k.lineN&&n<k.lineN+k.size&&(x.externalMeasured=null),n<x.viewFrom||n>=x.viewTo)return;var X=x.view[Zr(e,n)];if(X.node==null)return;var J=X.changes||(X.changes=[]);$(J,S)==-1&&J.push(S)}function qr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ui(e,n,S,x){var k=Zr(e,n),X,J=e.display.view;if(!kn||S==e.doc.first+e.doc.size)return{index:k,lineN:S};for(var ne=e.display.viewFrom,oe=0;oe<k;oe++)ne+=J[oe].size;if(ne!=n){if(x>0){if(k==J.length-1)return null;X=ne+J[k].size-n,k++}else X=ne-n;n+=X,S+=X}for(;Qt(e.doc,S)!=S;){if(k==(x<0?0:J.length-1))return null;S+=x*J[k-(x<0?1:0)].size,k+=x}return{index:k,lineN:S}}function ha(e,n,S){var x=e.display,k=x.view;k.length==0||n>=x.viewTo||S<=x.viewFrom?(x.view=cr(e,n,S),x.viewFrom=n):(x.viewFrom>n?x.view=cr(e,n,x.viewFrom).concat(x.view):x.viewFrom<n&&(x.view=x.view.slice(Zr(e,n))),x.viewFrom=n,x.viewTo<S?x.view=x.view.concat(cr(e,x.viewTo,S)):x.viewTo>S&&(x.view=x.view.slice(0,Zr(e,S)))),x.viewTo=S}function sa(e){for(var n=e.display.view,S=0,x=0;x<n.length;x++){var k=n[x];!k.hidden&&(!k.node||k.changes)&&++S}return S}function Vr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Ji(e,n){n===void 0&&(n=!0);for(var S=e.doc,x={},k=x.cursors=document.createDocumentFragment(),X=x.selection=document.createDocumentFragment(),J=0;J<S.sel.ranges.length;J++){if(!n&&J==S.sel.primIndex)continue;var ne=S.sel.ranges[J];if(ne.from().line>=e.display.viewTo||ne.to().line<e.display.viewFrom)continue;var oe=ne.empty();(oe||e.options.showCursorWhenSelecting)&&Zi(e,ne.head,k),oe||zr(e,ne,X)}return x}function Zi(e,n,S){var x=ir(e,n,"div",null,null,!e.options.singleCursorHeightPerLine),k=S.appendChild(f("div","\xA0","CodeMirror-cursor"));if(k.style.left=x.left+"px",k.style.top=x.top+"px",k.style.height=Math.max(0,x.bottom-x.top)*e.options.cursorHeight+"px",x.other){var X=S.appendChild(f("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));X.style.display="",X.style.left=x.other.left+"px",X.style.top=x.other.top+"px",X.style.height=(x.other.bottom-x.other.top)*.85+"px"}}function $r(e,n){return e.top-n.top||e.left-n.left}function zr(e,n,S){var x=e.display,k=e.doc,X=document.createDocumentFragment(),J=et(e.display),ne=J.left,oe=Math.max(x.sizerWidth,Ie(e)-x.sizer.offsetLeft)-J.right,he=k.direction=="ltr";function ze(jn,er,_r,pr){er<0&&(er=0),er=Math.round(er),pr=Math.round(pr),X.appendChild(f("div",null,"CodeMirror-selected","position: absolute; left: "+jn+`px;
|
|
top: `+er+"px; width: "+(_r==null?oe-jn:_r)+`px;
|
|
height: `+(pr-er)+"px"))}function tt(jn,er,_r){var pr=wn(k,jn),Pr=pr.text.length,ii,Bi;function gi(Mi,na){return Tr(e,fn(jn,Mi),"div",pr,na)}function oa(Mi,na,Ki){var Ii=Jn(e,pr,null,Mi),Li=na=="ltr"==(Ki=="after")?"left":"right",Ei=Ki=="after"?Ii.begin:Ii.end-(/\s/.test(pr.text.charAt(Ii.end-1))?2:1);return gi(Ei,Li)[Li]}var ta=nn(pr,k.direction);return Pt(ta,er||0,_r==null?Pr:_r,function(Mi,na,Ki,Ii){var Li=Ki=="ltr",Ei=gi(Mi,Li?"left":"right"),ra=gi(na-1,Li?"right":"left"),So=er==null&&Mi==0,to=_r==null&&na==Pr,Vi=Ii==0,La=!ta||Ii==ta.length-1;if(ra.top-Ei.top<=3){var Hi=(he?So:to)&&Vi,ms=(he?to:So)&&La,Ka=Hi?ne:(Li?Ei:ra).left,lo=ms?oe:(Li?ra:Ei).right;ze(Ka,Ei.top,lo-Ka,Ei.bottom)}else{var uo,$i,Oo,vs;Li?(uo=he&&So&&Vi?ne:Ei.left,$i=he?oe:oa(Mi,Ki,"before"),Oo=he?ne:oa(na,Ki,"after"),vs=he&&to&&La?oe:ra.right):(uo=he?oa(Mi,Ki,"before"):ne,$i=!he&&So&&Vi?oe:Ei.right,Oo=!he&&to&&La?ne:ra.left,vs=he?oa(na,Ki,"after"):oe),ze(uo,Ei.top,$i-uo,Ei.bottom),Ei.bottom<ra.top&&ze(ne,Ei.bottom,null,ra.top),ze(Oo,ra.top,vs-Oo,ra.bottom)}(!ii||$r(Ei,ii)<0)&&(ii=Ei),$r(ra,ii)<0&&(ii=ra),(!Bi||$r(Ei,Bi)<0)&&(Bi=Ei),$r(ra,Bi)<0&&(Bi=ra)}),{start:ii,end:Bi}}var Dt=n.from(),Ct=n.to();if(Dt.line==Ct.line)tt(Dt.line,Dt.ch,Ct.ch);else{var tn=wn(k,Dt.line),bn=wn(k,Ct.line),Ln=wt(tn)==wt(bn),Nn=tt(Dt.line,Dt.ch,Ln?tn.text.length+1:null).end,Yn=tt(Ct.line,Ln?0:null,Ct.ch).start;Ln&&(Nn.top<Yn.top-2?(ze(Nn.right,Nn.top,null,Nn.bottom),ze(ne,Yn.top,Yn.left,Yn.bottom)):ze(Nn.right,Nn.top,Yn.left-Nn.right,Nn.bottom)),Nn.bottom<Yn.top&&ze(ne,Nn.bottom,null,Yn.top)}S.appendChild(X)}function yi(e){if(!e.state.focused)return;var n=e.display;clearInterval(n.blinker);var S=!0;n.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?n.blinker=setInterval(function(){e.hasFocus()||wa(e),n.cursorDiv.style.visibility=(S=!S)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(n.cursorDiv.style.visibility="hidden")}function Pa(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,wa(e))},100)}function la(e,n){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(We(e,"focus",e,n),e.state.focused=!0,j(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),T&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),yi(e)}function wa(e,n){if(e.state.delayingBlurEvent)return;e.state.focused&&(We(e,"blur",e,n),e.state.focused=!1,p(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Ta(e){for(var n=e.display,S=n.lineDiv.offsetTop,x=0;x<n.view.length;x++){var k=n.view[x],X=e.options.lineWrapping,J=void 0,ne=0;if(k.hidden)continue;if(D&&m<8){var oe=k.node.offsetTop+k.node.offsetHeight;J=oe-S,S=oe}else{var he=k.node.getBoundingClientRect();J=he.bottom-he.top,!X&&k.text.firstChild&&(ne=k.text.firstChild.getBoundingClientRect().right-he.left-1)}var ze=k.line.height-J;if((ze>.005||ze<-.005)&&(hr(k.line,J),Sa(k.line),k.rest))for(var tt=0;tt<k.rest.length;tt++)Sa(k.rest[tt]);if(ne>e.display.sizerWidth){var Dt=Math.ceil(ne/kr(e.display));Dt>e.display.maxLineLength&&(e.display.maxLineLength=Dt,e.display.maxLine=k.line,e.display.maxLineChanged=!0)}}}function Sa(e){if(e.widgets)for(var n=0;n<e.widgets.length;++n){var S=e.widgets[n],x=S.node.parentNode;x&&(S.height=x.offsetHeight)}}function ka(e,n,S){var x=S&&S.top!=null?Math.max(0,S.top):e.scroller.scrollTop;x=Math.floor(x-Ci(e));var k=S&&S.bottom!=null?S.bottom:x+e.wrapper.clientHeight,X=Nr(n,x),J=Nr(n,k);if(S&&S.ensure){var ne=S.ensure.from.line,oe=S.ensure.to.line;ne<X?(X=ne,J=Nr(n,Kt(wn(n,ne))+e.wrapper.clientHeight)):Math.min(oe,n.lastLine())>=J&&(X=Nr(n,Kt(wn(n,oe))-e.wrapper.clientHeight),J=oe)}return{from:X,to:Math.max(J,X+1)}}function co(e,n){if(vt(e,"scrollCursorIntoView"))return;var S=e.display,x=S.sizer.getBoundingClientRect(),k=null;if(n.top+x.top<0?k=!0:n.bottom+x.top>(window.innerHeight||document.documentElement.clientHeight)&&(k=!1),k!=null&&!a){var X=f("div","\u200B",null,`position: absolute;
|
|
top: `+(n.top-S.viewOffset-Ci(e.display))+`px;
|
|
height: `+(n.bottom-n.top+rt(e)+S.barHeight)+`px;
|
|
left: `+n.left+"px; width: "+Math.max(2,n.right-n.left)+"px;");e.display.lineSpace.appendChild(X),X.scrollIntoView(k),e.display.lineSpace.removeChild(X)}}function Ro(e,n,S,x){x==null&&(x=0);var k;!e.options.lineWrapping&&n==S&&(n=n.ch?fn(n.line,n.sticky=="before"?n.ch-1:n.ch,"after"):n,S=n.sticky=="before"?fn(n.line,n.ch+1,"before"):n);for(var X=0;X<5;X++){var J=!1,ne=ir(e,n),oe=!S||S==n?ne:ir(e,S);k={left:Math.min(ne.left,oe.left),top:Math.min(ne.top,oe.top)-x,right:Math.max(ne.left,oe.left),bottom:Math.max(ne.bottom,oe.bottom)+x};var he=Oa(e,k),ze=e.doc.scrollTop,tt=e.doc.scrollLeft;if(he.scrollTop!=null&&(Da(e,he.scrollTop),Math.abs(e.doc.scrollTop-ze)>1&&(J=!0)),he.scrollLeft!=null&&(ki(e,he.scrollLeft),Math.abs(e.doc.scrollLeft-tt)>1&&(J=!0)),!J)break}return k}function Ga(e,n){var S=Oa(e,n);S.scrollTop!=null&&Da(e,S.scrollTop),S.scrollLeft!=null&&ki(e,S.scrollLeft)}function Oa(e,n){var S=e.display,x=Ir(e.display);n.top<0&&(n.top=0);var k=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:S.scroller.scrollTop,X=de(e),J={};n.bottom-n.top>X&&(n.bottom=n.top+X);var ne=e.doc.height+Oe(S),oe=n.top<x,he=n.bottom>ne-x;if(n.top<k)J.scrollTop=oe?0:n.top;else if(n.bottom>k+X){var ze=Math.min(n.top,(he?ne:n.bottom)-X);ze!=k&&(J.scrollTop=ze)}var tt=e.options.fixedGutter?0:S.gutters.offsetWidth,Dt=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:S.scroller.scrollLeft-tt,Ct=Ie(e)-S.gutters.offsetWidth,tn=n.right-n.left>Ct;return tn&&(n.right=n.left+Ct),n.left<10?J.scrollLeft=0:n.left<Dt?J.scrollLeft=Math.max(0,n.left+tt-(tn?0:10)):n.right>Ct+Dt-3&&(J.scrollLeft=n.right+(tn?0:10)-Ct),J}function Va(e,n){if(n==null)return;Xa(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+n}function _a(e){Xa(e);var n=e.getCursor();e.curOp.scrollToPos={from:n,to:n,margin:e.options.cursorScrollMargin}}function Ra(e,n,S){(n!=null||S!=null)&&Xa(e),n!=null&&(e.curOp.scrollLeft=n),S!=null&&(e.curOp.scrollTop=S)}function ho(e,n){Xa(e),e.curOp.scrollToPos=n}function Xa(e){var n=e.curOp.scrollToPos;if(n){e.curOp.scrollToPos=null;var S=pn(e,n.from),x=pn(e,n.to);Aa(e,S,x,n.margin)}}function Aa(e,n,S,x){var k=Oa(e,{left:Math.min(n.left,S.left),top:Math.min(n.top,S.top)-x,right:Math.max(n.right,S.right),bottom:Math.max(n.bottom,S.bottom)+x});Ra(e,k.scrollLeft,k.scrollTop)}function Da(e,n){if(Math.abs(e.doc.scrollTop-n)<2)return;P||ja(e,{top:n}),ya(e,n,!0),P&&ja(e),Na(e,100)}function ya(e,n,S){if(n=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,n)),e.display.scroller.scrollTop==n&&!S)return;e.doc.scrollTop=n,e.display.scrollbars.setScrollTop(n),e.display.scroller.scrollTop!=n&&(e.display.scroller.scrollTop=n)}function ki(e,n,S,x){if(n=Math.max(0,Math.min(n,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(S?n==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-n)<2)&&!x)return;e.doc.scrollLeft=n,Ar(e),e.display.scroller.scrollLeft!=n&&(e.display.scroller.scrollLeft=n),e.display.scrollbars.setScrollLeft(n)}function fa(e){var n=e.display,S=n.gutters.offsetWidth,x=Math.round(e.doc.height+Oe(e.display));return{clientHeight:n.scroller.clientHeight,viewHeight:n.wrapper.clientHeight,scrollWidth:n.scroller.scrollWidth,clientWidth:n.scroller.clientWidth,viewWidth:n.wrapper.clientWidth,barLeft:e.options.fixedGutter?S:0,docHeight:x,scrollHeight:x+rt(e)+n.barHeight,nativeBarWidth:n.nativeBarWidth,gutterWidth:S}}var pa=function(e,n,S){this.cm=S;var x=this.vert=f("div",[f("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),k=this.horiz=f("div",[f("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");x.tabIndex=k.tabIndex=-1,e(x),e(k),Se(x,"scroll",function(){x.clientHeight&&n(x.scrollTop,"vertical")}),Se(k,"scroll",function(){k.clientWidth&&n(k.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,D&&m<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};pa.prototype.update=function(e){var n=e.scrollWidth>e.clientWidth+1,S=e.scrollHeight>e.clientHeight+1,x=e.nativeBarWidth;if(S){this.vert.style.display="block",this.vert.style.bottom=n?x+"px":"0";var k=e.viewHeight-(n?x:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+k)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(n){this.horiz.style.display="block",this.horiz.style.right=S?x+"px":"0",this.horiz.style.left=e.barLeft+"px";var X=e.viewWidth-e.barLeft-(S?x:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+X)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(x==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:S?x:0,bottom:n?x: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=h&&!r?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new W,this.disableVert=new W},pa.prototype.enableZeroWidthBar=function(e,n,S){e.style.pointerEvents="auto";function x(){var k=e.getBoundingClientRect(),X=S=="vert"?document.elementFromPoint(k.right-1,(k.top+k.bottom)/2):document.elementFromPoint((k.right+k.left)/2,k.bottom-1);X!=e?e.style.pointerEvents="none":n.set(1e3,x)}n.set(1e3,x)},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,n){n||(n=fa(e));var S=e.display.barWidth,x=e.display.barHeight;Ya(e,n);for(var k=0;k<4&&S!=e.display.barWidth||x!=e.display.barHeight;k++)S!=e.display.barWidth&&e.options.lineWrapping&&Ta(e),Ya(e,fa(e)),S=e.display.barWidth,x=e.display.barHeight}function Ya(e,n){var S=e.display,x=S.scrollbars.update(n);S.sizer.style.paddingRight=(S.barWidth=x.right)+"px",S.sizer.style.paddingBottom=(S.barHeight=x.bottom)+"px",S.heightForcer.style.borderBottom=x.bottom+"px solid transparent",x.right&&x.bottom?(S.scrollbarFiller.style.display="block",S.scrollbarFiller.style.height=x.bottom+"px",S.scrollbarFiller.style.width=x.right+"px"):S.scrollbarFiller.style.display="",x.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(S.gutterFiller.style.display="block",S.gutterFiller.style.height=x.bottom+"px",S.gutterFiller.style.width=n.gutterWidth+"px"):S.gutterFiller.style.display=""}var $a={native:pa,null:ba};function Qa(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&p(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new $a[e.options.scrollbarStyle](function(n){e.display.wrapper.insertBefore(n,e.display.scrollbarFiller),Se(n,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),n.setAttribute("cm-not-content","true")},function(n,S){S=="horizontal"?ki(e,n):Da(e,n)},e),e.display.scrollbars.addClass&&j(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},Dr(e.curOp)}function Ea(e){var n=e.curOp;n&&Bn(n,function(S){for(var x=0;x<S.ops.length;x++)S.ops[x].cm.curOp=null;ro(S)})}function ro(e){for(var n=e.ops,S=0;S<n.length;S++)Ao(n[S]);for(var x=0;x<n.length;x++)Do(n[x]);for(var k=0;k<n.length;k++)fo(n[k]);for(var X=0;X<n.length;X++)io(n[X]);for(var J=0;J<n.length;J++)po(n[J])}function Ao(e){var n=e.cm,S=n.display;ao(n),e.updateMaxLine&&Ht(n),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<S.viewFrom||e.scrollToPos.to.line>=S.viewTo)||S.maxLineChanged&&n.options.lineWrapping,e.update=e.mustUpdate&&new qi(n,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 n=e.cm,S=n.display;e.updatedDisplay&&Ta(n),e.barMeasure=fa(n),S.maxLineChanged&&!n.options.lineWrapping&&(e.adjustWidthTo=Ke(n,S.maxLine,S.maxLine.text.length).left+3,n.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(S.scroller.clientWidth,S.sizer.offsetLeft+e.adjustWidthTo+rt(n)+n.display.barWidth),e.maxScrollLeft=Math.max(0,S.sizer.offsetLeft+e.adjustWidthTo-Ie(n))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=S.input.prepareSelection())}function io(e){var n=e.cm;e.adjustWidthTo!=null&&(n.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<n.doc.scrollLeft&&ki(n,Math.min(n.display.scroller.scrollLeft,e.maxScrollLeft),!0),n.display.maxLineChanged=!1);var S=e.focus&&e.focus==N();e.preparedSelection&&n.display.input.showSelection(e.preparedSelection,S),(e.updatedDisplay||e.startHeight!=n.doc.height)&&ma(n,e.barMeasure),e.updatedDisplay&&Hr(n,e.barMeasure),e.selectionChanged&&yi(n),n.state.focused&&e.updateInput&&n.display.input.reset(e.typing),S&&Pa(e.cm)}function po(e){var n=e.cm,S=n.display,x=n.doc;if(e.updatedDisplay&&Ja(n,e.update),S.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(S.wheelStartX=S.wheelStartY=null),e.scrollTop!=null&&ya(n,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&ki(n,e.scrollLeft,!0,!0),e.scrollToPos){var k=Ro(n,B(x,e.scrollToPos.from),B(x,e.scrollToPos.to),e.scrollToPos.margin);co(n,k)}var X=e.maybeHiddenMarkers,J=e.maybeUnhiddenMarkers;if(X)for(var ne=0;ne<X.length;++ne)X[ne].lines.length||We(X[ne],"hide");if(J)for(var oe=0;oe<J.length;++oe)J[oe].lines.length&&We(J[oe],"unhide");S.wrapper.offsetHeight&&(x.scrollTop=n.display.scroller.scrollTop),e.changeObjs&&We(n,"changes",n,e.changeObjs),e.update&&e.update.finish()}function Wi(e,n){if(e.curOp)return n();ua(e);try{return n()}finally{Ea(e)}}function ci(e,n){return function(){if(e.curOp)return n.apply(e,arguments);ua(e);try{return n.apply(e,arguments)}finally{Ea(e)}}}function Ai(e){return function(){if(this.curOp)return e.apply(this,arguments);ua(this);try{return e.apply(this,arguments)}finally{Ea(this)}}}function hi(e){return function(){var n=this.cm;if(!n||n.curOp)return e.apply(this,arguments);ua(n);try{return e.apply(this,arguments)}finally{Ea(n)}}}function Na(e,n){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(n,z(mo,e))}function mo(e){var n=e.doc;if(n.highlightFrontier>=e.display.viewTo)return;var S=+new Date+e.options.workTime,x=An(e,n.highlightFrontier),k=[];n.iter(x.line,Math.min(n.first+n.size,e.display.viewTo+500),function(X){if(x.line>=e.display.viewFrom){var J=X.styles,ne=X.text.length>e.options.maxHighlightLength?gn(n.mode,x.state):null,oe=Qe(e,X,x,!0);ne&&(x.state=ne),X.styles=oe.styles;var he=X.styleClasses,ze=oe.classes;ze?X.styleClasses=ze:he&&(X.styleClasses=null);for(var tt=!J||J.length!=X.styles.length||he!=ze&&(!he||!ze||he.bgClass!=ze.bgClass||he.textClass!=ze.textClass),Dt=0;!tt&&Dt<J.length;++Dt)tt=J[Dt]!=X.styles[Dt];tt&&k.push(x.line),X.stateAfter=x.save(),x.nextLine()}else X.text.length<=e.options.maxHighlightLength&&Vn(e,X.text,x),X.stateAfter=x.line%5==0?x.save():null,x.nextLine();if(+new Date>S)return Na(e,e.options.workDelay),!0}),n.highlightFrontier=x.line,n.modeFrontier=Math.max(n.modeFrontier,x.line),k.length&&Wi(e,function(){for(var X=0;X<k.length;X++)Xr(e,k[X],"text")})}var qi=function(e,n,S){var x=e.display;this.viewport=n,this.visible=ka(x,e.doc,n),this.editorIsHidden=!x.wrapper.offsetWidth,this.wrapperHeight=x.wrapper.clientHeight,this.wrapperWidth=x.wrapper.clientWidth,this.oldDisplayWidth=Ie(e),this.force=S,this.dims=fr(e),this.events=[]};qi.prototype.signal=function(e,n){xe(e,n)&&this.events.push(arguments)},qi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)We.apply(null,this.events[e])};function ao(e){var n=e.display;!n.scrollbarsClipped&&n.scroller.offsetWidth&&(n.nativeBarWidth=n.scroller.offsetWidth-n.scroller.clientWidth,n.heightForcer.style.height=rt(e)+"px",n.sizer.style.marginBottom=-n.nativeBarWidth+"px",n.sizer.style.borderRightWidth=rt(e)+"px",n.scrollbarsClipped=!0)}function oo(e){if(e.hasFocus())return null;var n=N();if(!n||!v(e.display.lineDiv,n))return null;var S={activeElt:n};if(window.getSelection){var x=window.getSelection();x.anchorNode&&x.extend&&v(e.display.lineDiv,x.anchorNode)&&(S.anchorNode=x.anchorNode,S.anchorOffset=x.anchorOffset,S.focusNode=x.focusNode,S.focusOffset=x.focusOffset)}return S}function so(e){if(!e||!e.activeElt||e.activeElt==N())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&v(document.body,e.anchorNode)&&v(document.body,e.focusNode)){var n=window.getSelection(),S=document.createRange();S.setEnd(e.anchorNode,e.anchorOffset),S.collapse(!1),n.removeAllRanges(),n.addRange(S),n.extend(e.focusNode,e.focusOffset)}}function xa(e,n){var S=e.display,x=e.doc;if(n.editorIsHidden)return qr(e),!1;if(!n.force&&n.visible.from>=S.viewFrom&&n.visible.to<=S.viewTo&&(S.updateLineNumbers==null||S.updateLineNumbers>=S.viewTo)&&S.renderedView==S.view&&sa(e)==0)return!1;ai(e)&&(qr(e),n.dims=fr(e));var k=x.first+x.size,X=Math.max(n.visible.from-e.options.viewportMargin,x.first),J=Math.min(k,n.visible.to+e.options.viewportMargin);S.viewFrom<X&&X-S.viewFrom<20&&(X=Math.max(x.first,S.viewFrom)),S.viewTo>J&&S.viewTo-J<20&&(J=Math.min(k,S.viewTo)),kn&&(X=Qt(e.doc,X),J=Wt(e.doc,J));var ne=X!=S.viewFrom||J!=S.viewTo||S.lastWrapHeight!=n.wrapperHeight||S.lastWrapWidth!=n.wrapperWidth;ha(e,X,J),S.viewOffset=Kt(wn(e.doc,S.viewFrom)),e.display.mover.style.top=S.viewOffset+"px";var oe=sa(e);if(!ne&&oe==0&&!n.force&&S.renderedView==S.view&&(S.updateLineNumbers==null||S.updateLineNumbers>=S.viewTo))return!1;var he=oo(e);return oe>4&&(S.lineDiv.style.display="none"),vo(e,S.updateLineNumbers,n.dims),oe>4&&(S.lineDiv.style.display=""),S.renderedView=S.view,so(he),l(S.cursorDiv),l(S.selectionDiv),S.gutters.style.height=S.sizer.style.minHeight=0,ne&&(S.lastWrapHeight=n.wrapperHeight,S.lastWrapWidth=n.wrapperWidth,Na(e,400)),S.updateLineNumbers=null,!0}function Ja(e,n){for(var S=n.viewport,x=!0;;x=!1){if(!x||!e.options.lineWrapping||n.oldDisplayWidth==Ie(e)){if(S&&S.top!=null&&(S={top:Math.min(e.doc.height+Oe(e.display)-de(e),S.top)}),n.visible=ka(e.display,e.doc,S),n.visible.from>=e.display.viewFrom&&n.visible.to<=e.display.viewTo)break}else x&&(n.visible=ka(e.display,e.doc,S));if(!xa(e,n))break;Ta(e);var k=fa(e);Vr(e),ma(e,k),Hr(e,k),n.force=!1}n.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(n.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function ja(e,n){var S=new qi(e,n);if(xa(e,S)){Ta(e),Ja(e,S);var x=fa(e);Vr(e),ma(e,x),Hr(e,x),S.finish()}}function vo(e,n,S){var x=e.display,k=e.options.lineNumbers,X=x.lineDiv,J=X.firstChild;function ne(tn){var bn=tn.nextSibling;return T&&h&&e.display.currentWheelTarget==tn?tn.style.display="none":tn.parentNode.removeChild(tn),bn}for(var oe=x.view,he=x.viewFrom,ze=0;ze<oe.length;ze++){var tt=oe[ze];if(!tt.hidden)if(!tt.node||tt.node.parentNode!=X){var Dt=vi(e,tt,he,S);X.insertBefore(Dt,J)}else{for(;J!=tt.node;)J=ne(J);var Ct=k&&n!=null&&n<=he&&tt.lineNumber;tt.changes&&($(tt.changes,"gutter")>-1&&(Ct=!1),Wr(e,tt,he,S)),Ct&&(l(tt.lineNumber),tt.lineNumber.appendChild(document.createTextNode(pi(e.options,he)))),J=tt.node.nextSibling}he+=tt.size}for(;J;)J=ne(J)}function Za(e){var n=e.gutters.offsetWidth;e.sizer.style.marginLeft=n+"px"}function Hr(e,n){e.display.sizer.style.minHeight=n.docHeight+"px",e.display.heightForcer.style.top=n.docHeight+"px",e.display.gutters.style.height=n.docHeight+e.display.barHeight+rt(e)+"px"}function Ar(e){var n=e.display,S=n.view;if(!n.alignWidgets&&(!n.gutters.firstChild||!e.options.fixedGutter))return;for(var x=si(n)-n.scroller.scrollLeft+e.doc.scrollLeft,k=n.gutters.offsetWidth,X=x+"px",J=0;J<S.length;J++)if(!S[J].hidden){e.options.fixedGutter&&(S[J].gutter&&(S[J].gutter.style.left=X),S[J].gutterBackground&&(S[J].gutterBackground.style.left=X));var ne=S[J].alignable;if(ne)for(var oe=0;oe<ne.length;oe++)ne[oe].style.left=X}e.options.fixedGutter&&(n.gutters.style.left=x+k+"px")}function ai(e){if(!e.options.lineNumbers)return!1;var n=e.doc,S=pi(e.options,n.first+n.size-1),x=e.display;if(S.length!=x.lineNumChars){var k=x.measure.appendChild(f("div",[f("div",S)],"CodeMirror-linenumber CodeMirror-gutter-elt")),X=k.firstChild.offsetWidth,J=k.offsetWidth-X;return x.lineGutter.style.width="",x.lineNumInnerWidth=Math.max(X,x.lineGutter.offsetWidth-J)+1,x.lineNumWidth=x.lineNumInnerWidth+J,x.lineNumChars=x.lineNumInnerWidth?S.length:-1,x.lineGutter.style.width=x.lineNumWidth+"px",Za(e.display),!0}return!1}function Fi(e,n){for(var S=[],x=!1,k=0;k<e.length;k++){var X=e[k],J=null;if(typeof X!="string"&&(J=X.style,X=X.className),X=="CodeMirror-linenumbers")if(n)x=!0;else continue;S.push({className:X,style:J})}return n&&!x&&S.push({className:"CodeMirror-linenumbers",style:null}),S}function Ma(e){var n=e.gutters,S=e.gutterSpecs;l(n),e.lineGutter=null;for(var x=0;x<S.length;++x){var k=S[x],X=k.className,J=k.style,ne=n.appendChild(f("div",null,"CodeMirror-gutter "+X));J&&(ne.style.cssText=J),X=="CodeMirror-linenumbers"&&(e.lineGutter=ne,ne.style.width=(e.lineNumWidth||1)+"px")}n.style.display=S.length?"":"none",Za(e)}function da(e){Ma(e.display),Gr(e),Ar(e)}function Ua(e,n,S,x){var k=this;this.input=S,k.scrollbarFiller=f("div",null,"CodeMirror-scrollbar-filler"),k.scrollbarFiller.setAttribute("cm-not-content","true"),k.gutterFiller=f("div",null,"CodeMirror-gutter-filler"),k.gutterFiller.setAttribute("cm-not-content","true"),k.lineDiv=_("div",null,"CodeMirror-code"),k.selectionDiv=f("div",null,null,"position: relative; z-index: 1"),k.cursorDiv=f("div",null,"CodeMirror-cursors"),k.measure=f("div",null,"CodeMirror-measure"),k.lineMeasure=f("div",null,"CodeMirror-measure"),k.lineSpace=_("div",[k.measure,k.lineMeasure,k.selectionDiv,k.cursorDiv,k.lineDiv],null,"position: relative; outline: none");var X=_("div",[k.lineSpace],"CodeMirror-lines");k.mover=f("div",[X],null,"position: relative"),k.sizer=f("div",[k.mover],"CodeMirror-sizer"),k.sizerWidth=null,k.heightForcer=f("div",null,null,"position: absolute; height: "+q+"px; width: 1px;"),k.gutters=f("div",null,"CodeMirror-gutters"),k.lineGutter=null,k.scroller=f("div",[k.sizer,k.heightForcer,k.gutters],"CodeMirror-scroll"),k.scroller.setAttribute("tabIndex","-1"),k.wrapper=f("div",[k.scrollbarFiller,k.gutterFiller,k.scroller],"CodeMirror"),D&&m<8&&(k.gutters.style.zIndex=-1,k.scroller.style.paddingRight=0),!T&&!(P&&t)&&(k.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(k.wrapper):e(k.wrapper)),k.viewFrom=k.viewTo=n.first,k.reportedViewFrom=k.reportedViewTo=n.first,k.view=[],k.renderedView=null,k.externalMeasured=null,k.viewOffset=0,k.lastWrapHeight=k.lastWrapWidth=0,k.updateLineNumbers=null,k.nativeBarWidth=k.barHeight=k.barWidth=0,k.scrollbarsClipped=!1,k.lineNumWidth=k.lineNumInnerWidth=k.lineNumChars=null,k.alignWidgets=!1,k.cachedCharWidth=k.cachedTextHeight=k.cachedPaddingH=null,k.maxLine=null,k.maxLineLength=0,k.maxLineChanged=!1,k.wheelDX=k.wheelDY=k.wheelStartX=k.wheelStartY=null,k.shift=!1,k.selForContextMenu=null,k.activeTouch=null,k.gutterSpecs=Fi(x.gutters,x.lineNumbers),Ma(k),S.init(k)}var ca=0,bi=null;D?bi=-.53:P?bi=15:i?bi=-.7:c&&(bi=-1/3);function Fa(e){var n=e.wheelDeltaX,S=e.wheelDeltaY;return n==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(n=e.detail),S==null&&e.detail&&e.axis==e.VERTICAL_AXIS?S=e.detail:S==null&&(S=e.wheelDelta),{x:n,y:S}}function Ba(e){var n=Fa(e);return n.x*=bi,n.y*=bi,n}function Ha(e,n){var S=Fa(n),x=S.x,k=S.y,X=e.display,J=X.scroller,ne=J.scrollWidth>J.clientWidth,oe=J.scrollHeight>J.clientHeight;if(!(x&&ne||k&&oe))return;if(k&&h&&T){e:for(var he=n.target,ze=X.view;he!=J;he=he.parentNode)for(var tt=0;tt<ze.length;tt++)if(ze[tt].node==he){e.display.currentWheelTarget=he;break e}}if(x&&!P&&!d&&bi!=null){k&&oe&&Da(e,Math.max(0,J.scrollTop+k*bi)),ki(e,Math.max(0,J.scrollLeft+x*bi)),(!k||k&&oe)&&ie(n),X.wheelStartX=null;return}if(k&&bi!=null){var Dt=k*bi,Ct=e.doc.scrollTop,tn=Ct+X.wrapper.clientHeight;Dt<0?Ct=Math.max(0,Ct+Dt-50):tn=Math.min(e.doc.height,tn+Dt+50),ja(e,{top:Ct,bottom:tn})}ca<20&&(X.wheelStartX==null?(X.wheelStartX=J.scrollLeft,X.wheelStartY=J.scrollTop,X.wheelDX=x,X.wheelDY=k,setTimeout(function(){if(X.wheelStartX==null)return;var bn=J.scrollLeft-X.wheelStartX,Ln=J.scrollTop-X.wheelStartY,Nn=Ln&&X.wheelDY&&Ln/X.wheelDY||bn&&X.wheelDX&&bn/X.wheelDX;if(X.wheelStartX=X.wheelStartY=null,!Nn)return;bi=(bi*ca+Nn)/(ca+1),++ca},200)):(X.wheelDX+=x,X.wheelDY+=k))}var zi=function(e,n){this.ranges=e,this.primIndex=n};zi.prototype.primary=function(){return this.ranges[this.primIndex]},zi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var n=0;n<this.ranges.length;n++){var S=this.ranges[n],x=e.ranges[n];if(!oi(S.anchor,x.anchor)||!oi(S.head,x.head))return!1}return!0},zi.prototype.deepCopy=function(){for(var e=[],n=0;n<this.ranges.length;n++)e[n]=new Ur(_i(this.ranges[n].anchor),_i(this.ranges[n].head));return new zi(e,this.primIndex)},zi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},zi.prototype.contains=function(e,n){n||(n=e);for(var S=0;S<this.ranges.length;S++){var x=this.ranges[S];if(ar(n,x.from())>=0&&ar(e,x.to())<=0)return S}return-1};var Ur=function(e,n){this.anchor=e,this.head=n};Ur.prototype.from=function(){return ni(this.anchor,this.head)},Ur.prototype.to=function(){return Qr(this.anchor,this.head)},Ur.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function yr(e,n,S){var x=e&&e.options.selectionsMayTouch,k=n[S];n.sort(function(Dt,Ct){return ar(Dt.from(),Ct.from())}),S=$(n,k);for(var X=1;X<n.length;X++){var J=n[X],ne=n[X-1],oe=ar(ne.to(),J.from());if(x&&!J.empty()?oe>0:oe>=0){var he=ni(ne.from(),J.from()),ze=Qr(ne.to(),J.to()),tt=ne.empty()?J.from()==J.head:ne.from()==ne.head;X<=S&&--S,n.splice(--X,2,new Ur(tt?ze:he,tt?he:ze))}}return new zi(n,S)}function Un(e,n){return new zi([new Ur(e,n||e)],0)}function or(e){return e.text?fn(e.from.line+e.text.length-1,$e(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Or(e,n){if(ar(e,n.from)<0)return e;if(ar(e,n.to)<=0)return or(n);var S=e.line+n.text.length-(n.to.line-n.from.line)-1,x=e.ch;return e.line==n.to.line&&(x+=or(n).ch-n.to.ch),fn(S,x)}function ri(e,n){for(var S=[],x=0;x<e.sel.ranges.length;x++){var k=e.sel.ranges[x];S.push(new Ur(Or(k.anchor,n),Or(k.head,n)))}return yr(e.cm,S,e.sel.primIndex)}function va(e,n,S){return e.line==n.line?fn(S.line,e.ch-n.ch+S.ch):fn(S.line+(e.line-n.line),e.ch)}function aa(e,n,S){for(var x=[],k=fn(e.first,0),X=k,J=0;J<n.length;J++){var ne=n[J],oe=va(ne.from,k,X),he=va(or(ne),k,X);if(k=ne.to,X=he,S=="around"){var ze=e.sel.ranges[J],tt=ar(ze.head,ze.anchor)<0;x[J]=new Ur(tt?he:oe,tt?oe:he)}else x[J]=new Ur(oe,oe)}return new zi(x,e.sel.primIndex)}function Di(e){e.doc.mode=qe(e.options,e.doc.modeOption),Yi(e)}function Yi(e){e.doc.iter(function(n){n.stateAfter&&(n.stateAfter=null),n.styles&&(n.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Na(e,100),e.state.modeGen++,e.curOp&&Gr(e)}function ga(e,n){return n.from.ch==0&&n.to.ch==0&&$e(n.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Wa(e,n,S,x){function k(Yn){return S?S[Yn]:null}function X(Yn,jn,er){Tn(Yn,jn,er,x),Qn(Yn,"change",Yn,n)}function J(Yn,jn){for(var er=[],_r=Yn;_r<jn;++_r)er.push(new Sn(he[_r],k(_r),x));return er}var ne=n.from,oe=n.to,he=n.text,ze=wn(e,ne.line),tt=wn(e,oe.line),Dt=$e(he),Ct=k(he.length-1),tn=oe.line-ne.line;if(n.full)e.insert(0,J(0,he.length)),e.remove(he.length,e.size-he.length);else if(ga(e,n)){var bn=J(0,he.length-1);X(tt,tt.text,Ct),tn&&e.remove(ne.line,tn),bn.length&&e.insert(ne.line,bn)}else if(ze==tt)if(he.length==1)X(ze,ze.text.slice(0,ne.ch)+Dt+ze.text.slice(oe.ch),Ct);else{var Ln=J(1,he.length-1);Ln.push(new Sn(Dt+ze.text.slice(oe.ch),Ct,x)),X(ze,ze.text.slice(0,ne.ch)+he[0],k(0)),e.insert(ne.line+1,Ln)}else if(he.length==1)X(ze,ze.text.slice(0,ne.ch)+he[0]+tt.text.slice(oe.ch),k(0)),e.remove(ne.line+1,tn);else{X(ze,ze.text.slice(0,ne.ch)+he[0],k(0)),X(tt,Dt+tt.text.slice(oe.ch),Ct);var Nn=J(1,he.length-1);tn>1&&e.remove(ne.line+1,tn-1),e.insert(ne.line+1,Nn)}Qn(e,"change",e,n)}function Ti(e,n,S){function x(k,X,J){if(k.linked)for(var ne=0;ne<k.linked.length;++ne){var oe=k.linked[ne];if(oe.doc==X)continue;var he=J&&oe.sharedHist;if(S&&!he)continue;n(oe.doc,he),x(oe.doc,k,he)}}x(e,null,!0)}function gs(e,n){if(n.cm)throw new Error("This document is already in use.");e.doc=n,n.cm=e,ji(e),Di(e),_s(e),e.options.lineWrapping||Ht(e),e.options.mode=n.modeOption,Gr(e)}function _s(e){(e.doc.direction=="rtl"?j:p)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Wi(e,function(){_s(e),Gr(e)})}function Ko(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function rs(e,n){var S={from:_i(n.from),to:or(n),text:xr(e,n.from,n.to)};return Es(e,S,n.from.line,n.to.line+1),Ti(e,function(x){return Es(x,S,n.from.line,n.to.line+1)},!0),S}function ys(e){for(;e.length;){var n=$e(e);if(n.ranges)e.pop();else break}}function pl(e,n){if(n)return ys(e.done),$e(e.done);if(e.done.length&&!$e(e.done).ranges)return $e(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),$e(e.done)}function bs(e,n,S,x){var k=e.history;k.undone.length=0;var X=+new Date,J,ne;if((k.lastOp==x||k.lastOrigin==n.origin&&n.origin&&(n.origin.charAt(0)=="+"&&k.lastModTime>X-(e.cm?e.cm.options.historyEventDelay:500)||n.origin.charAt(0)=="*"))&&(J=pl(k,k.lastOp==x)))ne=$e(J.changes),ar(n.from,n.to)==0&&ar(n.from,ne.to)==0?ne.to=or(n):J.changes.push(rs(e,n));else{var oe=$e(k.done);for((!oe||!oe.ranges)&&Go(e.sel,k.done),J={changes:[rs(e,n)],generation:k.generation},k.done.push(J);k.done.length>k.undoDepth;)k.done.shift(),k.done[0].ranges||k.done.shift()}k.done.push(S),k.generation=++k.maxGeneration,k.lastModTime=k.lastSelTime=X,k.lastOp=k.lastSelOp=x,k.lastOrigin=k.lastSelOrigin=n.origin,ne||We(e,"historyAdded")}function ml(e,n,S,x){var k=n.charAt(0);return k=="*"||k=="+"&&S.ranges.length==x.ranges.length&&S.somethingSelected()==x.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function vl(e,n,S,x){var k=e.history,X=x&&x.origin;S==k.lastSelOp||X&&k.lastSelOrigin==X&&(k.lastModTime==k.lastSelTime&&k.lastOrigin==X||ml(e,X,$e(k.done),n))?k.done[k.done.length-1]=n:Go(n,k.done),k.lastSelTime=+new Date,k.lastSelOrigin=X,k.lastSelOp=S,x&&x.clearRedo!==!1&&ys(k.undone)}function Go(e,n){var S=$e(n);S&&S.ranges&&S.equals(e)||n.push(e)}function Es(e,n,S,x){var k=n["spans_"+e.id],X=0;e.iter(Math.max(e.first,S),Math.min(e.first+e.size,x),function(J){J.markedSpans&&((k||(k=n["spans_"+e.id]={}))[X]=J.markedSpans),++X})}function gl(e){if(!e)return null;for(var n,S=0;S<e.length;++S)e[S].marker.explicitlyCleared?n||(n=e.slice(0,S)):n&&n.push(e[S]);return n?n.length?n:null:e}function _l(e,n){var S=n["spans_"+e.id];if(!S)return null;for(var x=[],k=0;k<n.text.length;++k)x.push(gl(S[k]));return x}function xs(e,n){var S=_l(e,n),x=Er(e,n);if(!S)return x;if(!x)return S;for(var k=0;k<S.length;++k){var X=S[k],J=x[k];if(X&&J){e:for(var ne=0;ne<J.length;++ne){for(var oe=J[ne],he=0;he<X.length;++he)if(X[he].marker==oe.marker)continue e;X.push(oe)}}else J&&(S[k]=J)}return S}function go(e,n,S){for(var x=[],k=0;k<e.length;++k){var X=e[k];if(X.ranges){x.push(S?zi.prototype.deepCopy.call(X):X);continue}var J=X.changes,ne=[];x.push({changes:ne});for(var oe=0;oe<J.length;++oe){var he=J[oe],ze=void 0;if(ne.push({from:he.from,to:he.to,text:he.text}),n)for(var tt in he)(ze=tt.match(/^spans_(\d+)$/))&&($(n,Number(ze[1]))>-1&&($e(ne)[tt]=he[tt],delete he[tt]))}}return x}function is(e,n,S,x){if(x){var k=e.anchor;if(S){var X=ar(n,k)<0;X!=ar(S,k)<0?(k=n,n=S):X!=ar(n,S)<0&&(n=S)}return new Ur(k,n)}else return new Ur(S||n,n)}function Vo(e,n,S,x,k){k==null&&(k=e.cm&&(e.cm.display.shift||e.extend)),Gi(e,new zi([is(e.sel.primary(),n,S,k)],0),x)}function Cs(e,n,S){for(var x=[],k=e.cm&&(e.cm.display.shift||e.extend),X=0;X<e.sel.ranges.length;X++)x[X]=is(e.sel.ranges[X],n[X],null,k);var J=yr(e.cm,x,e.sel.primIndex);Gi(e,J,S)}function as(e,n,S,x){var k=e.sel.ranges.slice(0);k[n]=S,Gi(e,yr(e.cm,k,e.sel.primIndex),x)}function ws(e,n,S,x){Gi(e,Un(n,S),x)}function yl(e,n,S){var x={ranges:n.ranges,update:function(k){this.ranges=[];for(var X=0;X<k.length;X++)this.ranges[X]=new Ur(B(e,k[X].anchor),B(e,k[X].head))},origin:S&&S.origin};return We(e,"beforeSelectionChange",e,x),e.cm&&We(e.cm,"beforeSelectionChange",e.cm,x),x.ranges!=n.ranges?yr(e.cm,x.ranges,x.ranges.length-1):n}function Ts(e,n,S){var x=e.history.done,k=$e(x);k&&k.ranges?(x[x.length-1]=n,Xo(e,n,S)):Gi(e,n,S)}function Gi(e,n,S){Xo(e,n,S),vl(e,e.sel,e.cm?e.cm.curOp.id:NaN,S)}function Xo(e,n,S){(xe(e,"beforeSelectionChange")||e.cm&&xe(e.cm,"beforeSelectionChange"))&&(n=yl(e,n,S));var x=S&&S.bias||(ar(n.primary().head,e.sel.primary().head)<0?-1:1);Ss(e,Rs(e,n,x,!0)),!(S&&S.scroll===!1)&&e.cm&&_a(e.cm)}function Ss(e,n){if(n.equals(e.sel))return;e.sel=n,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Pe(e.cm)),Qn(e,"cursorActivity",e)}function Os(e){Ss(e,Rs(e,e.sel,null,!1))}function Rs(e,n,S,x){for(var k,X=0;X<n.ranges.length;X++){var J=n.ranges[X],ne=n.ranges.length==e.sel.ranges.length&&e.sel.ranges[X],oe=Yo(e,J.anchor,ne&&ne.anchor,S,x),he=Yo(e,J.head,ne&&ne.head,S,x);(k||oe!=J.anchor||he!=J.head)&&(k||(k=n.ranges.slice(0,X)),k[X]=new Ur(oe,he))}return k?yr(e.cm,k,n.primIndex):n}function _o(e,n,S,x,k){var X=wn(e,n.line);if(X.markedSpans)for(var J=0;J<X.markedSpans.length;++J){var ne=X.markedSpans[J],oe=ne.marker,he="selectLeft"in oe?!oe.selectLeft:oe.inclusiveLeft,ze="selectRight"in oe?!oe.selectRight:oe.inclusiveRight;if((ne.from==null||(he?ne.from<=n.ch:ne.from<n.ch))&&(ne.to==null||(ze?ne.to>=n.ch:ne.to>n.ch))){if(k&&(We(oe,"beforeCursorEnter"),oe.explicitlyCleared))if(X.markedSpans){--J;continue}else break;if(!oe.atomic)continue;if(S){var tt=oe.find(x<0?1:-1),Dt=void 0;if((x<0?ze:he)&&(tt=As(e,tt,-x,tt&&tt.line==n.line?X:null)),tt&&tt.line==n.line&&(Dt=ar(tt,S))&&(x<0?Dt<0:Dt>0))return _o(e,tt,n,x,k)}var Ct=oe.find(x<0?-1:1);return(x<0?he:ze)&&(Ct=As(e,Ct,x,Ct.line==n.line?X:null)),Ct?_o(e,Ct,n,x,k):null}}return n}function Yo(e,n,S,x,k){var X=x||1,J=_o(e,n,S,X,k)||!k&&_o(e,n,S,X,!0)||_o(e,n,S,-X,k)||!k&&_o(e,n,S,-X,!0);return J||(e.cantEdit=!0,fn(e.first,0))}function As(e,n,S,x){return S<0&&n.ch==0?n.line>e.first?B(e,fn(n.line-1)):null:S>0&&n.ch==(x||wn(e,n.line)).text.length?n.line<e.first+e.size-1?fn(n.line+1,0):null:new fn(n.line,n.ch+S)}function Ds(e){e.setSelection(fn(e.firstLine(),0),fn(e.lastLine()),se)}function Ms(e,n,S){var x={canceled:!1,from:n.from,to:n.to,text:n.text,origin:n.origin,cancel:function(){return x.canceled=!0}};return S&&(x.update=function(k,X,J,ne){k&&(x.from=B(e,k)),X&&(x.to=B(e,X)),J&&(x.text=J),ne!==void 0&&(x.origin=ne)}),We(e,"beforeChange",e,x),e.cm&&We(e.cm,"beforeChange",e.cm,x),x.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:x.from,to:x.to,text:x.text,origin:x.origin}}function yo(e,n,S){if(e.cm){if(!e.cm.curOp)return ci(e.cm,yo)(e,n,S);if(e.cm.state.suppressEdits)return}if((xe(e,"beforeChange")||e.cm&&xe(e.cm,"beforeChange"))&&(n=Ms(e,n,!0),!n))return;var x=Zn&&!S&&Te(e,n.from,n.to);if(x)for(var k=x.length-1;k>=0;--k)Ls(e,{from:x[k].from,to:x[k].to,text:k?[""]:n.text,origin:n.origin});else Ls(e,n)}function Ls(e,n){if(n.text.length==1&&n.text[0]==""&&ar(n.from,n.to)==0)return;var S=ri(e,n);bs(e,n,S,e.cm?e.cm.curOp.id:NaN),Mo(e,n,S,Er(e,n));var x=[];Ti(e,function(k,X){!X&&$(x,k.history)==-1&&(Ns(k.history,n),x.push(k.history)),Mo(k,n,null,Er(k,n))})}function $o(e,n,S){var x=e.cm&&e.cm.state.suppressEdits;if(x&&!S)return;for(var k=e.history,X,J=e.sel,ne=n=="undo"?k.done:k.undone,oe=n=="undo"?k.undone:k.done,he=0;he<ne.length&&!(X=ne[he],S?X.ranges&&!X.equals(e.sel):!X.ranges);he++);if(he==ne.length)return;for(k.lastOrigin=k.lastSelOrigin=null;;)if(X=ne.pop(),X.ranges){if(Go(X,oe),S&&!X.equals(e.sel)){Gi(e,X,{clearRedo:!1});return}J=X}else if(x){ne.push(X);return}else break;var ze=[];Go(J,oe),oe.push({changes:ze,generation:k.generation}),k.generation=X.generation||++k.maxGeneration;for(var tt=xe(e,"beforeChange")||e.cm&&xe(e.cm,"beforeChange"),Dt=function(bn){var Ln=X.changes[bn];if(Ln.origin=n,tt&&!Ms(e,Ln,!1))return ne.length=0,{};ze.push(rs(e,Ln));var Nn=bn?ri(e,Ln):$e(ne);Mo(e,Ln,Nn,xs(e,Ln)),!bn&&e.cm&&e.cm.scrollIntoView({from:Ln.from,to:or(Ln)});var Yn=[];Ti(e,function(jn,er){!er&&$(Yn,jn.history)==-1&&(Ns(jn.history,Ln),Yn.push(jn.history)),Mo(jn,Ln,null,xs(jn,Ln))})},Ct=X.changes.length-1;Ct>=0;--Ct){var tn=Dt(Ct);if(tn)return tn.v}}function Ps(e,n){if(n==0)return;if(e.first+=n,e.sel=new zi(Tt(e.sel.ranges,function(k){return new Ur(fn(k.anchor.line+n,k.anchor.ch),fn(k.head.line+n,k.head.ch))}),e.sel.primIndex),e.cm){Gr(e.cm,e.first,e.first-n,n);for(var S=e.cm.display,x=S.viewFrom;x<S.viewTo;x++)Xr(e.cm,x,"gutter")}}function Mo(e,n,S,x){if(e.cm&&!e.cm.curOp)return ci(e.cm,Mo)(e,n,S,x);if(n.to.line<e.first){Ps(e,n.text.length-1-(n.to.line-n.from.line));return}if(n.from.line>e.lastLine())return;if(n.from.line<e.first){var k=n.text.length-1-(e.first-n.from.line);Ps(e,k),n={from:fn(e.first,0),to:fn(n.to.line+k,n.to.ch),text:[$e(n.text)],origin:n.origin}}var X=e.lastLine();n.to.line>X&&(n={from:n.from,to:fn(X,wn(e,X).text.length),text:[n.text[0]],origin:n.origin}),n.removed=xr(e,n.from,n.to),S||(S=ri(e,n)),e.cm?bl(e.cm,n,x):Wa(e,n,x),Xo(e,S,se),e.cantEdit&&Yo(e,fn(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,n,S){var x=e.doc,k=e.display,X=n.from,J=n.to,ne=!1,oe=X.line;e.options.lineWrapping||(oe=dr(wt(wn(x,X.line))),x.iter(oe,J.line+1,function(Ct){if(Ct==k.maxLine)return ne=!0,!0})),x.sel.contains(n.from,n.to)>-1&&Pe(e),Wa(x,n,S,Qi(e)),e.options.lineWrapping||(x.iter(oe,X.line+n.text.length,function(Ct){var tn=dn(Ct);tn>k.maxLineLength&&(k.maxLine=Ct,k.maxLineLength=tn,k.maxLineChanged=!0,ne=!1)}),ne&&(e.curOp.updateMaxLine=!0)),$n(x,X.line),Na(e,400);var he=n.text.length-(J.line-X.line)-1;n.full?Gr(e):X.line==J.line&&n.text.length==1&&!ga(e.doc,n)?Xr(e,X.line,"text"):Gr(e,X.line,J.line+1,he);var ze=xe(e,"changes"),tt=xe(e,"change");if(tt||ze){var Dt={from:X,to:J,text:n.text,removed:n.removed,origin:n.origin};tt&&Qn(e,"change",e,Dt),ze&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Dt)}e.display.selForContextMenu=null}function bo(e,n,S,x,k){var X;x||(x=S),ar(x,S)<0&&(X=[x,S],S=X[0],x=X[1]),typeof n=="string"&&(n=e.splitLines(n)),yo(e,{from:S,to:x,text:n,origin:k})}function ks(e,n,S,x){S<e.line?e.line+=x:n<e.line&&(e.line=n,e.ch=0)}function Is(e,n,S,x){for(var k=0;k<e.length;++k){var X=e[k],J=!0;if(X.ranges){X.copied||(X=e[k]=X.deepCopy(),X.copied=!0);for(var ne=0;ne<X.ranges.length;ne++)ks(X.ranges[ne].anchor,n,S,x),ks(X.ranges[ne].head,n,S,x);continue}for(var oe=0;oe<X.changes.length;++oe){var he=X.changes[oe];if(S<he.from.line)he.from=fn(he.from.line+x,he.from.ch),he.to=fn(he.to.line+x,he.to.ch);else if(n<=he.to.line){J=!1;break}}J||(e.splice(0,k+1),k=0)}}function Ns(e,n){var S=n.from.line,x=n.to.line,k=n.text.length-(x-S)-1;Is(e.done,S,x,k),Is(e.undone,S,x,k)}function Lo(e,n,S,x){var k=n,X=n;return typeof n=="number"?X=wn(e,ee(e,n)):k=dr(n),k==null?null:(x(X,k)&&e.cm&&Xr(e.cm,k,S),X)}function Po(e){this.lines=e,this.parent=null;for(var n=0,S=0;S<e.length;++S)e[S].parent=this,n+=e[S].height;this.height=n}Po.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,n){for(var S=e,x=e+n;S<x;++S){var k=this.lines[S];this.height-=k.height,xt(k),Qn(k,"delete")}this.lines.splice(e,n)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,n,S){this.height+=S,this.lines=this.lines.slice(0,e).concat(n).concat(this.lines.slice(e));for(var x=0;x<n.length;++x)n[x].parent=this},iterN:function(e,n,S){for(var x=e+n;e<x;++e)if(S(this.lines[e]))return!0}};function ko(e){this.children=e;for(var n=0,S=0,x=0;x<e.length;++x){var k=e[x];n+=k.chunkSize(),S+=k.height,k.parent=this}this.size=n,this.height=S,this.parent=null}ko.prototype={chunkSize:function(){return this.size},removeInner:function(e,n){this.size-=n;for(var S=0;S<this.children.length;++S){var x=this.children[S],k=x.chunkSize();if(e<k){var X=Math.min(n,k-e),J=x.height;if(x.removeInner(e,X),this.height-=J-x.height,k==X&&(this.children.splice(S--,1),x.parent=null),(n-=X)==0)break;e=0}else e-=k}if(this.size-n<25&&(this.children.length>1||!(this.children[0]instanceof Po))){var ne=[];this.collapse(ne),this.children=[new Po(ne)],this.children[0].parent=this}},collapse:function(e){for(var n=0;n<this.children.length;++n)this.children[n].collapse(e)},insertInner:function(e,n,S){this.size+=n.length,this.height+=S;for(var x=0;x<this.children.length;++x){var k=this.children[x],X=k.chunkSize();if(e<=X){if(k.insertInner(e,n,S),k.lines&&k.lines.length>50){for(var J=k.lines.length%25+25,ne=J;ne<k.lines.length;){var oe=new Po(k.lines.slice(ne,ne+=25));k.height-=oe.height,this.children.splice(++x,0,oe),oe.parent=this}k.lines=k.lines.slice(0,J),this.maybeSpill()}break}e-=X}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var n=e.children.splice(e.children.length-5,5),S=new ko(n);if(e.parent){e.size-=S.size,e.height-=S.height;var k=$(e.parent.children,e);e.parent.children.splice(k+1,0,S)}else{var x=new ko(e.children);x.parent=e,e.children=[x,S],e=x}S.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,n,S){for(var x=0;x<this.children.length;++x){var k=this.children[x],X=k.chunkSize();if(e<X){var J=Math.min(n,X-e);if(k.iterN(e,J,S))return!0;if((n-=J)==0)break;e=0}else e-=X}}};var Io=function(e,n,S){if(S)for(var x in S)S.hasOwnProperty(x)&&(this[x]=S[x]);this.doc=e,this.node=n};Io.prototype.clear=function(){var e=this.doc.cm,n=this.line.widgets,S=this.line,x=dr(S);if(x==null||!n)return;for(var k=0;k<n.length;++k)n[k]==this&&n.splice(k--,1);n.length||(S.widgets=null);var X=di(this);hr(S,Math.max(0,S.height-X)),e&&(Wi(e,function(){js(e,S,-X),Xr(e,x,"widget")}),Qn(e,"lineWidgetCleared",e,this,x))},Io.prototype.changed=function(){var e=this,n=this.height,S=this.doc.cm,x=this.line;this.height=null;var k=di(this)-n;if(!k)return;yn(this.doc,x)||hr(x,x.height+k),S&&Wi(S,function(){S.curOp.forceUpdate=!0,js(S,x,k),Qn(S,"lineWidgetChanged",S,e,dr(x))})},we(Io);function js(e,n,S){Kt(n)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Va(e,S)}function El(e,n,S,x){var k=new Io(e,S,x),X=e.cm;return X&&k.noHScroll&&(X.display.alignWidgets=!0),Lo(e,n,"widget",function(J){var ne=J.widgets||(J.widgets=[]);if(k.insertAt==null?ne.push(k):ne.splice(Math.min(ne.length-1,Math.max(0,k.insertAt)),0,k),k.line=J,X&&!yn(e,J)){var oe=Kt(J)<e.scrollTop;hr(J,J.height+di(k)),oe&&Va(X,k.height),X.curOp.forceUpdate=!0}return!0}),X&&Qn(X,"lineWidgetAdded",X,k,typeof n=="number"?n:dr(n)),k}var Us=0,qa=function(e,n){this.lines=[],this.type=n,this.doc=e,this.id=++Us};qa.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,n=e&&!e.curOp;if(n&&ua(e),xe(this,"clear")){var S=this.find();S&&Qn(this,"clear",S.from,S.to)}for(var x=null,k=null,X=0;X<this.lines.length;++X){var J=this.lines[X],ne=Gn(J.markedSpans,this);e&&!this.collapsed?Xr(e,dr(J),"text"):e&&(ne.to!=null&&(k=dr(J)),ne.from!=null&&(x=dr(J))),J.markedSpans=Hn(J.markedSpans,ne),ne.from==null&&this.collapsed&&!yn(this.doc,J)&&e&&hr(J,Ir(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var oe=0;oe<this.lines.length;++oe){var he=wt(this.lines[oe]),ze=dn(he);ze>e.display.maxLineLength&&(e.display.maxLine=he,e.display.maxLineLength=ze,e.display.maxLineChanged=!0)}x!=null&&e&&this.collapsed&&Gr(e,x,k+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Os(e.doc)),e&&Qn(e,"markerCleared",e,this,x,k),n&&Ea(e),this.parent&&this.parent.clear()},qa.prototype.find=function(e,n){e==null&&this.type=="bookmark"&&(e=1);for(var S,x,k=0;k<this.lines.length;++k){var X=this.lines[k],J=Gn(X.markedSpans,this);if(J.from!=null&&(S=fn(n?X:dr(X),J.from),e==-1))return S;if(J.to!=null&&(x=fn(n?X:dr(X),J.to),e==1))return x}return S&&{from:S,to:x}},qa.prototype.changed=function(){var e=this,n=this.find(-1,!0),S=this,x=this.doc.cm;if(!n||!x)return;Wi(x,function(){var k=n.line,X=dr(n.line),J=ot(x,X);if(J&&(lr(J),x.curOp.selectionChanged=x.curOp.forceUpdate=!0),x.curOp.updateMaxLine=!0,!yn(S.doc,k)&&S.height!=null){var ne=S.height;S.height=null;var oe=di(S)-ne;oe&&hr(k,k.height+oe)}Qn(x,"markerChanged",x,e)})},qa.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(!n.maybeHiddenMarkers||$(n.maybeHiddenMarkers,this)==-1)&&(n.maybeUnhiddenMarkers||(n.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},qa.prototype.detachLine=function(e){if(this.lines.splice($(this.lines,e),1),!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(n.maybeHiddenMarkers||(n.maybeHiddenMarkers=[])).push(this)}},we(qa);function Eo(e,n,S,x,k){if(x&&x.shared)return xl(e,n,S,x,k);if(e.cm&&!e.cm.curOp)return ci(e.cm,Eo)(e,n,S,x,k);var X=new qa(e,k),J=ar(n,S);if(x&&L(x,X,!1),J>0||J==0&&X.clearWhenEmpty!==!1)return X;if(X.replacedWith&&(X.collapsed=!0,X.widgetNode=_("span",[X.replacedWith],"CodeMirror-widget"),x.handleMouseEvents||X.widgetNode.setAttribute("cm-ignore-events","true"),x.insertLeft&&(X.widgetNode.insertLeft=!0)),X.collapsed){if(Vt(e,n.line,n,S,X)||n.line!=S.line&&Vt(e,S.line,n,S,X))throw new Error("Inserting collapsed marker partially overlapping an existing one");Fn()}X.addToHistory&&bs(e,{from:n,to:S,origin:"markText"},e.sel,NaN);var ne=n.line,oe=e.cm,he;if(e.iter(ne,S.line+1,function(tt){oe&&X.collapsed&&!oe.options.lineWrapping&&wt(tt)==oe.display.maxLine&&(he=!0),X.collapsed&&ne!=n.line&&hr(tt,0),Sr(tt,new nr(X,ne==n.line?n.ch:null,ne==S.line?S.ch:null)),++ne}),X.collapsed&&e.iter(n.line,S.line+1,function(tt){yn(e,tt)&&hr(tt,0)}),X.clearOnEnter&&Se(X,"beforeCursorEnter",function(){return X.clear()}),X.readOnly&&(mr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),X.collapsed&&(X.id=++Us,X.atomic=!0),oe){if(he&&(oe.curOp.updateMaxLine=!0),X.collapsed)Gr(oe,n.line,S.line+1);else if(X.className||X.startStyle||X.endStyle||X.css||X.attributes||X.title)for(var ze=n.line;ze<=S.line;ze++)Xr(oe,ze,"text");X.atomic&&Os(oe.doc),Qn(oe,"markerAdded",oe,X)}return X}var No=function(e,n){this.markers=e,this.primary=n;for(var S=0;S<e.length;++S)e[S].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();Qn(this,"clear")},No.prototype.find=function(e,n){return this.primary.find(e,n)},we(No);function xl(e,n,S,x,k){x=L(x),x.shared=!1;var X=[Eo(e,n,S,x,k)],J=X[0],ne=x.widgetNode;return Ti(e,function(oe){ne&&(x.widgetNode=ne.cloneNode(!0)),X.push(Eo(oe,B(oe,n),B(oe,S),x,k));for(var he=0;he<oe.linked.length;++he)if(oe.linked[he].isParent)return;J=$e(X)}),new No(X,J)}function Fs(e){return e.findMarks(fn(e.first,0),e.clipPos(fn(e.lastLine())),function(n){return n.parent})}function Cl(e,n){for(var S=0;S<n.length;S++){var x=n[S],k=x.find(),X=e.clipPos(k.from),J=e.clipPos(k.to);if(ar(X,J)){var ne=Eo(e,X,J,x.primary,x.primary.type);x.markers.push(ne),ne.parent=x}}}function wl(e){for(var n=function(x){var k=e[x],X=[k.primary.doc];Ti(k.primary.doc,function(oe){return X.push(oe)});for(var J=0;J<k.markers.length;J++){var ne=k.markers[J];$(X,ne.doc)==-1&&(ne.parent=null,k.markers.splice(J--,1))}},S=0;S<e.length;S++)n(S)}var Tl=0,ea=function(e,n,S,x,k){if(!(this instanceof ea))return new ea(e,n,S,x,k);S==null&&(S=0),ko.call(this,[new Po([new Sn("",null)])]),this.first=S,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=S;var X=fn(S,0);this.sel=Un(X),this.history=new Ko(null),this.id=++Tl,this.modeOption=n,this.lineSep=x,this.direction=k=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Wa(this,{from:X,to:X,text:e}),Gi(this,Un(X),se)};ea.prototype=nt(ko.prototype,{constructor:ea,iter:function(e,n,S){S?this.iterN(e-this.first,n-e,S):this.iterN(this.first,this.first+this.size,e)},insert:function(e,n){for(var S=0,x=0;x<n.length;++x)S+=n[x].height;this.insertInner(e-this.first,n,S)},remove:function(e,n){this.removeInner(e-this.first,n)},getValue:function(e){var n=Fr(this,this.first,this.first+this.size);return e===!1?n:n.join(e||this.lineSeparator())},setValue:hi(function(e){var n=fn(this.first,0),S=this.first+this.size-1;yo(this,{from:n,to:fn(S,wn(this,S).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Ra(this.cm,0,0),Gi(this,Un(n),se)}),replaceRange:function(e,n,S,x){n=B(this,n),S=S?B(this,S):n,bo(this,e,n,S,x)},getRange:function(e,n,S){var x=xr(this,B(this,e),B(this,n));return S===!1?x:x.join(S||this.lineSeparator())},getLine:function(e){var n=this.getLineHandle(e);return n&&n.text},getLineHandle:function(e){if(ti(this,e))return wn(this,e)},getLineNumber:function(e){return dr(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=wn(this,e)),wt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return B(this,e)},getCursor:function(e){var n=this.sel.primary(),S;return e==null||e=="head"?S=n.head:e=="anchor"?S=n.anchor:e=="end"||e=="to"||e===!1?S=n.to():S=n.from(),S},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:hi(function(e,n,S){ws(this,B(this,typeof e=="number"?fn(e,n||0):e),null,S)}),setSelection:hi(function(e,n,S){ws(this,B(this,e),B(this,n||e),S)}),extendSelection:hi(function(e,n,S){Vo(this,B(this,e),n&&B(this,n),S)}),extendSelections:hi(function(e,n){Cs(this,Q(this,e),n)}),extendSelectionsBy:hi(function(e,n){var S=Tt(this.sel.ranges,e);Cs(this,Q(this,S),n)}),setSelections:hi(function(e,n,S){if(!e.length)return;for(var x=[],k=0;k<e.length;k++)x[k]=new Ur(B(this,e[k].anchor),B(this,e[k].head));n==null&&(n=Math.min(e.length-1,this.sel.primIndex)),Gi(this,yr(this.cm,x,n),S)}),addSelection:hi(function(e,n,S){var x=this.sel.ranges.slice(0);x.push(new Ur(B(this,e),B(this,n||e))),Gi(this,yr(this.cm,x,x.length-1),S)}),getSelection:function(e){for(var n=this.sel.ranges,S,x=0;x<n.length;x++){var k=xr(this,n[x].from(),n[x].to());S=S?S.concat(k):k}return e===!1?S:S.join(e||this.lineSeparator())},getSelections:function(e){for(var n=[],S=this.sel.ranges,x=0;x<S.length;x++){var k=xr(this,S[x].from(),S[x].to());e!==!1&&(k=k.join(e||this.lineSeparator())),n[x]=k}return n},replaceSelection:function(e,n,S){for(var x=[],k=0;k<this.sel.ranges.length;k++)x[k]=e;this.replaceSelections(x,n,S||"+input")},replaceSelections:hi(function(e,n,S){for(var x=[],k=this.sel,X=0;X<k.ranges.length;X++){var J=k.ranges[X];x[X]={from:J.from(),to:J.to(),text:this.splitLines(e[X]),origin:S}}for(var ne=n&&n!="end"&&aa(this,x,n),oe=x.length-1;oe>=0;oe--)yo(this,x[oe]);ne?Ts(this,ne):this.cm&&_a(this.cm)}),undo:hi(function(){$o(this,"undo")}),redo:hi(function(){$o(this,"redo")}),undoSelection:hi(function(){$o(this,"undo",!0)}),redoSelection:hi(function(){$o(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,n=0,S=0,x=0;x<e.done.length;x++)e.done[x].ranges||++n;for(var k=0;k<e.undone.length;k++)e.undone[k].ranges||++S;return{undo:n,redo:S}},clearHistory:function(){var e=this;this.history=new Ko(this.history.maxGeneration),Ti(this,function(n){return n.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:go(this.history.done),undone:go(this.history.undone)}},setHistory:function(e){var n=this.history=new Ko(this.history.maxGeneration);n.done=go(e.done.slice(0),null,!0),n.undone=go(e.undone.slice(0),null,!0)},setGutterMarker:hi(function(e,n,S){return Lo(this,e,"gutter",function(x){var k=x.gutterMarkers||(x.gutterMarkers={});return k[n]=S,!S&&Fe(k)&&(x.gutterMarkers=null),!0})}),clearGutter:hi(function(e){var n=this;this.iter(function(S){S.gutterMarkers&&S.gutterMarkers[e]&&Lo(n,S,"gutter",function(){return S.gutterMarkers[e]=null,Fe(S.gutterMarkers)&&(S.gutterMarkers=null),!0})})}),lineInfo:function(e){var n;if(typeof e=="number"){if(!ti(this,e))return null;if(n=e,e=wn(this,e),!e)return null}else if(n=dr(e),n==null)return null;return{line:n,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:hi(function(e,n,S){return Lo(this,e,n=="gutter"?"gutter":"class",function(x){var k=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass";if(!x[k])x[k]=S;else{if(E(S).test(x[k]))return!1;x[k]+=" "+S}return!0})}),removeLineClass:hi(function(e,n,S){return Lo(this,e,n=="gutter"?"gutter":"class",function(x){var k=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass",X=x[k];if(X)if(S==null)x[k]=null;else{var J=X.match(E(S));if(!J)return!1;var ne=J.index+J[0].length;x[k]=X.slice(0,J.index)+(!J.index||ne==X.length?"":" ")+X.slice(ne)||null}else return!1;return!0})}),addLineWidget:hi(function(e,n,S){return El(this,e,n,S)}),removeLineWidget:function(e){e.clear()},markText:function(e,n,S){return Eo(this,B(this,e),B(this,n),S,S&&S.type||"range")},setBookmark:function(e,n){var S={replacedWith:n&&(n.nodeType==null?n.widget:n),insertLeft:n&&n.insertLeft,clearWhenEmpty:!1,shared:n&&n.shared,handleMouseEvents:n&&n.handleMouseEvents};return e=B(this,e),Eo(this,e,e,S,"bookmark")},findMarksAt:function(e){e=B(this,e);var n=[],S=wn(this,e.line).markedSpans;if(S)for(var x=0;x<S.length;++x){var k=S[x];(k.from==null||k.from<=e.ch)&&(k.to==null||k.to>=e.ch)&&n.push(k.marker.parent||k.marker)}return n},findMarks:function(e,n,S){e=B(this,e),n=B(this,n);var x=[],k=e.line;return this.iter(e.line,n.line+1,function(X){var J=X.markedSpans;if(J)for(var ne=0;ne<J.length;ne++){var oe=J[ne];!(oe.to!=null&&k==e.line&&e.ch>=oe.to||oe.from==null&&k!=e.line||oe.from!=null&&k==n.line&&oe.from>=n.ch)&&(!S||S(oe.marker))&&x.push(oe.marker.parent||oe.marker)}++k}),x},getAllMarks:function(){var e=[];return this.iter(function(n){var S=n.markedSpans;if(S)for(var x=0;x<S.length;++x)S[x].from!=null&&e.push(S[x].marker)}),e},posFromIndex:function(e){var n,S=this.first,x=this.lineSeparator().length;return this.iter(function(k){var X=k.text.length+x;if(X>e)return n=e,!0;e-=X,++S}),B(this,fn(S,n))},indexFromPos:function(e){e=B(this,e);var n=e.ch;if(e.line<this.first||e.ch<0)return 0;var S=this.lineSeparator().length;return this.iter(this.first,e.line,function(x){n+=x.text.length+S}),n},copy:function(e){var n=new ea(Fr(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return n.scrollTop=this.scrollTop,n.scrollLeft=this.scrollLeft,n.sel=this.sel,n.extend=!1,e&&(n.history.undoDepth=this.history.undoDepth,n.setHistory(this.getHistory())),n},linkedDoc:function(e){e||(e={});var n=this.first,S=this.first+this.size;e.from!=null&&e.from>n&&(n=e.from),e.to!=null&&e.to<S&&(S=e.to);var x=new ea(Fr(this,n,S),e.mode||this.modeOption,n,this.lineSep,this.direction);return e.sharedHist&&(x.history=this.history),(this.linked||(this.linked=[])).push({doc:x,sharedHist:e.sharedHist}),x.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Cl(x,Fs(this)),x},unlinkDoc:function(e){if(e instanceof fi&&(e=e.doc),this.linked)for(var n=0;n<this.linked.length;++n){var S=this.linked[n];if(S.doc!=e)continue;this.linked.splice(n,1),e.unlinkDoc(this),wl(Fs(this));break}if(e.history==this.history){var x=[e.id];Ti(e,function(k){return x.push(k.id)},!0),e.history=new Ko(null),e.history.done=go(this.history.done,x),e.history.undone=go(this.history.undone,x)}},iterLinkedDocs:function(e){Ti(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):St(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:hi(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(n){return n.order=null}),this.cm&&fl(this.cm)})}),ea.prototype.eachLine=ea.prototype.iter;var Bs=0;function Sl(e){var n=this;if(Hs(n),vt(n,e)||Ri(n.display,e))return;ie(e),D&&(Bs=+new Date);var S=wi(n,e,!0),x=e.dataTransfer.files;if(!S||n.isReadOnly())return;if(x&&x.length&&window.FileReader&&window.File)for(var k=x.length,X=Array(k),J=0,ne=function(){++J==k&&ci(n,function(){S=B(n.doc,S);var Ct={from:S,to:S,text:n.doc.splitLines(X.filter(function(tn){return tn!=null}).join(n.doc.lineSeparator())),origin:"paste"};yo(n.doc,Ct),Ts(n.doc,Un(B(n.doc,S),B(n.doc,or(Ct))))})()},oe=function(Ct,tn){if(n.options.allowDropFileTypes&&$(n.options.allowDropFileTypes,Ct.type)==-1){ne();return}var bn=new FileReader;bn.onerror=function(){return ne()},bn.onload=function(){var Ln=bn.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Ln)){ne();return}X[tn]=Ln,ne()},bn.readAsText(Ct)},he=0;he<x.length;he++)oe(x[he],he);else{if(n.state.draggingText&&n.doc.sel.contains(S)>-1){n.state.draggingText(e),setTimeout(function(){return n.display.input.focus()},20);return}try{var ze=e.dataTransfer.getData("Text");if(ze){var tt;if(n.state.draggingText&&!n.state.draggingText.copy&&(tt=n.listSelections()),Xo(n.doc,Un(S,S)),tt)for(var Dt=0;Dt<tt.length;++Dt)bo(n.doc,"",tt[Dt].anchor,tt[Dt].head,"drag");n.replaceSelection(ze,"around","paste"),n.display.input.focus()}}catch(Ct){}}}function Ol(e,n){if(D&&(!e.state.draggingText||+new Date-Bs<100)){be(n);return}if(vt(e,n)||Ri(e.display,n))return;if(n.dataTransfer.setData("Text",e.getSelection()),n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setDragImage&&!c){var S=f("img",null,null,"position: fixed; left: 0; top: 0;");S.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(S.width=S.height=1,e.display.wrapper.appendChild(S),S._top=S.offsetTop),n.dataTransfer.setDragImage(S,0,0),d&&S.parentNode.removeChild(S)}}function Rl(e,n){var S=wi(e,n);if(!S)return;var x=document.createDocumentFragment();Zi(e,S,x),e.display.dragCursor||(e.display.dragCursor=f("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),u(e.display.dragCursor,x)}function Hs(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ws(e){if(!document.getElementsByClassName)return;for(var n=document.getElementsByClassName("CodeMirror"),S=[],x=0;x<n.length;x++){var k=n[x].CodeMirror;k&&S.push(k)}S.length&&S[0].operation(function(){for(var X=0;X<S.length;X++)e(S[X])})}var zs=!1;function Al(){if(zs)return;Dl(),zs=!0}function Dl(){var e;Se(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ws(Ml)},100))}),Se(window,"blur",function(){return Ws(wa)})}function Ml(e){var n=e.display;n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.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"},jo=0;jo<10;jo++)eo[jo+48]=eo[jo+96]=String(jo);for(var Qo=65;Qo<=90;Qo++)eo[Qo]=String.fromCharCode(Qo);for(var Uo=1;Uo<=12;Uo++)eo[Uo+111]=eo[Uo+63235]="F"+Uo;var za={};za.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"},za.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"},za.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"},za.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"]},za.default=h?za.macDefault:za.pcDefault;function Ll(e){var n=e.split(/-(?!$)/);e=n[n.length-1];for(var S,x,k,X,J=0;J<n.length-1;J++){var ne=n[J];if(/^(cmd|meta|m)$/i.test(ne))X=!0;else if(/^a(lt)?$/i.test(ne))S=!0;else if(/^(c|ctrl|control)$/i.test(ne))x=!0;else if(/^s(hift)?$/i.test(ne))k=!0;else throw new Error("Unrecognized modifier name: "+ne)}return S&&(e="Alt-"+e),x&&(e="Ctrl-"+e),X&&(e="Cmd-"+e),k&&(e="Shift-"+e),e}function Pl(e){var n={};for(var S in e)if(e.hasOwnProperty(S)){var x=e[S];if(/^(name|fallthrough|(de|at)tach)$/.test(S))continue;if(x=="..."){delete e[S];continue}for(var k=Tt(S.split(" "),Ll),X=0;X<k.length;X++){var J=void 0,ne=void 0;X==k.length-1?(ne=k.join(" "),J=x):(ne=k.slice(0,X+1).join(" "),J="...");var oe=n[ne];if(!oe)n[ne]=J;else if(oe!=J)throw new Error("Inconsistent bindings for "+ne)}delete e[S]}for(var he in n)e[he]=n[he];return e}function xo(e,n,S,x){n=Jo(n);var k=n.call?n.call(e,x):n[e];if(k===!1)return"nothing";if(k==="...")return"multi";if(k!=null&&S(k))return"handled";if(n.fallthrough){if(Object.prototype.toString.call(n.fallthrough)!="[object Array]")return xo(e,n.fallthrough,S,x);for(var X=0;X<n.fallthrough.length;X++){var J=xo(e,n.fallthrough[X],S,x);if(J)return J}}}function Ks(e){var n=typeof e=="string"?e:eo[e.keyCode];return n=="Ctrl"||n=="Alt"||n=="Shift"||n=="Mod"}function Gs(e,n,S){var x=e;return n.altKey&&x!="Alt"&&(e="Alt-"+e),(w?n.metaKey:n.ctrlKey)&&x!="Ctrl"&&(e="Ctrl-"+e),(w?n.ctrlKey:n.metaKey)&&x!="Mod"&&(e="Cmd-"+e),!S&&n.shiftKey&&x!="Shift"&&(e="Shift-"+e),e}function Vs(e,n){if(d&&e.keyCode==34&&e.char)return!1;var S=eo[e.keyCode];return S==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(S=e.code),Gs(S,e,n))}function Jo(e){return typeof e=="string"?za[e]:e}function Co(e,n){for(var S=e.doc.sel.ranges,x=[],k=0;k<S.length;k++){for(var X=n(S[k]);x.length&&ar(X.from,$e(x).to)<=0;){var J=x.pop();if(ar(J.from,X.from)<0){X.from=J.from;break}}x.push(X)}Wi(e,function(){for(var ne=x.length-1;ne>=0;ne--)bo(e.doc,"",x[ne].from,x[ne].to,"+delete");_a(e)})}function os(e,n,S){var x=ft(e.text,n+S,S);return x<0||x>e.text.length?null:x}function ss(e,n,S){var x=os(e,n.ch,S);return x==null?null:new fn(n.line,x,S<0?"after":"before")}function ls(e,n,S,x,k){if(e){n.doc.direction=="rtl"&&(k=-k);var X=nn(S,n.doc.direction);if(X){var J=k<0?$e(X):X[0],ne=k<0==(J.level==1),oe=ne?"after":"before",he;if(J.level>0||n.doc.direction=="rtl"){var ze=He(n,S);he=k<0?S.text.length-1:0;var tt=_t(n,ze,he).top;he=Rt(function(Dt){return _t(n,ze,Dt).top==tt},k<0==(J.level==1)?J.from:J.to-1,he),oe=="before"&&(he=os(S,he,1))}else he=k<0?J.to:J.from;return new fn(x,he,oe)}}return new fn(x,k<0?S.text.length:0,k<0?"before":"after")}function kl(e,n,S,x){var k=nn(n,e.doc.direction);if(!k)return ss(n,S,x);S.ch>=n.text.length?(S.ch=n.text.length,S.sticky="before"):S.ch<=0&&(S.ch=0,S.sticky="after");var X=Ve(k,S.ch,S.sticky),J=k[X];if(e.doc.direction=="ltr"&&J.level%2==0&&(x>0?J.to>S.ch:J.from<S.ch))return ss(n,S,x);var ne=function(Nn,Yn){return os(n,Nn instanceof fn?Nn.ch:Nn,Yn)},oe,he=function(Nn){return e.options.lineWrapping?(oe=oe||He(e,n),Jn(e,n,oe,Nn)):{begin:0,end:n.text.length}},ze=he(S.sticky=="before"?ne(S,-1):S.ch);if(e.doc.direction=="rtl"||J.level==1){var tt=J.level==1==x<0,Dt=ne(S,tt?1:-1);if(Dt!=null&&(tt?Dt<=J.to&&Dt<=ze.end:Dt>=J.from&&Dt>=ze.begin)){var Ct=tt?"before":"after";return new fn(S.line,Dt,Ct)}}var tn=function(Nn,Yn,jn){for(var er=function(ii,Bi){return Bi?new fn(S.line,ne(ii,1),"before"):new fn(S.line,ii,"after")};Nn>=0&&Nn<k.length;Nn+=Yn){var _r=k[Nn],pr=Yn>0==(_r.level!=1),Pr=pr?jn.begin:ne(jn.end,-1);if(_r.from<=Pr&&Pr<_r.to)return er(Pr,pr);if(Pr=pr?_r.from:ne(_r.to,-1),jn.begin<=Pr&&Pr<jn.end)return er(Pr,pr)}},bn=tn(X+x,x,ze);if(bn)return bn;var Ln=x>0?ze.end:ne(ze.begin,-1);return Ln!=null&&!(x>0&&Ln==n.text.length)&&(bn=tn(x>0?0:k.length-1,x,he(Ln)),bn)?bn:null}var Fo={selectAll:Ds,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),se)},killLine:function(e){return Co(e,function(n){if(n.empty()){var S=wn(e.doc,n.head.line).text.length;return n.head.ch==S&&n.head.line<e.lastLine()?{from:n.head,to:fn(n.head.line+1,0)}:{from:n.head,to:fn(n.head.line,S)}}else return{from:n.from(),to:n.to()}})},deleteLine:function(e){return Co(e,function(n){return{from:fn(n.from().line,0),to:B(e.doc,fn(n.to().line+1,0))}})},delLineLeft:function(e){return Co(e,function(n){return{from:fn(n.from().line,0),to:n.from()}})},delWrappedLineLeft:function(e){return Co(e,function(n){var S=e.charCoords(n.head,"div").top+5,x=e.coordsChar({left:0,top:S},"div");return{from:x,to:n.from()}})},delWrappedLineRight:function(e){return Co(e,function(n){var S=e.charCoords(n.head,"div").top+5,x=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:S},"div");return{from:n.from(),to:x}})},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(fn(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(fn(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(n){return Xs(e,n.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(n){return Ys(e,n.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(n){return Il(e,n.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(n){var S=e.cursorCoords(n.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:S},"div")},ve)},goLineLeft:function(e){return e.extendSelectionsBy(function(n){var S=e.cursorCoords(n.head,"div").top+5;return e.coordsChar({left:0,top:S},"div")},ve)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(n){var S=e.cursorCoords(n.head,"div").top+5,x=e.coordsChar({left:0,top:S},"div");return x.ch<e.getLine(x.line).search(/\S/)?Ys(e,n.head):x},ve)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var n=[],S=e.listSelections(),x=e.options.tabSize,k=0;k<S.length;k++){var X=S[k].from(),J=V(e.getLine(X.line),X.ch,x);n.push(ue(x-J%x))}e.replaceSelections(n)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Wi(e,function(){for(var n=e.listSelections(),S=[],x=0;x<n.length;x++){if(!n[x].empty())continue;var k=n[x].head,X=wn(e.doc,k.line).text;if(X){if(k.ch==X.length&&(k=new fn(k.line,k.ch-1)),k.ch>0)k=new fn(k.line,k.ch+1),e.replaceRange(X.charAt(k.ch-1)+X.charAt(k.ch-2),fn(k.line,k.ch-2),k,"+transpose");else if(k.line>e.doc.first){var J=wn(e.doc,k.line-1).text;J&&(k=new fn(k.line,1),e.replaceRange(X.charAt(0)+e.doc.lineSeparator()+J.charAt(J.length-1),fn(k.line-1,J.length-1),k,"+transpose"))}}S.push(new Ur(k,k))}e.setSelections(S)})},newlineAndIndent:function(e){return Wi(e,function(){for(var n=e.listSelections(),S=n.length-1;S>=0;S--)e.replaceRange(e.doc.lineSeparator(),n[S].anchor,n[S].head,"+input");n=e.listSelections();for(var x=0;x<n.length;x++)e.indentLine(n[x].from().line,null,!0);_a(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Xs(e,n){var S=wn(e.doc,n),x=wt(S);return x!=S&&(n=dr(x)),ls(!0,e,x,n,1)}function Il(e,n){var S=wn(e.doc,n),x=Nt(S);return x!=S&&(n=dr(x)),ls(!0,e,S,n,-1)}function Ys(e,n){var S=Xs(e,n.line),x=wn(e.doc,S.line),k=nn(x,e.doc.direction);if(!k||k[0].level==0){var X=Math.max(S.ch,x.text.search(/\S/)),J=n.line==S.line&&n.ch<=X&&n.ch;return fn(S.line,J?0:X,S.sticky)}return S}function Zo(e,n,S){if(typeof n=="string"&&(n=Fo[n],!n))return!1;e.display.input.ensurePolled();var x=e.display.shift,k=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),S&&(e.display.shift=!1),k=n(e)!=fe}finally{e.display.shift=x,e.state.suppressEdits=!1}return k}function Nl(e,n,S){for(var x=0;x<e.state.keyMaps.length;x++){var k=xo(n,e.state.keyMaps[x],S,e);if(k)return k}return e.options.extraKeys&&xo(n,e.options.extraKeys,S,e)||xo(n,e.options.keyMap,S,e)}var jl=new W;function Bo(e,n,S,x){var k=e.state.keySeq;if(k){if(Ks(n))return"handled";if(/\'$/.test(n)?e.state.keySeq=null:jl.set(50,function(){e.state.keySeq==k&&(e.state.keySeq=null,e.display.input.reset())}),$s(e,k+" "+n,S,x))return!0}return $s(e,n,S,x)}function $s(e,n,S,x){var k=Nl(e,n,x);return k=="multi"&&(e.state.keySeq=n),k=="handled"&&Qn(e,"keyHandled",e,n,S),(k=="handled"||k=="multi")&&(ie(S),yi(e)),!!k}function Qs(e,n){var S=Vs(n,!0);return S?n.shiftKey&&!e.state.keySeq?Bo(e,"Shift-"+S,n,function(x){return Zo(e,x,!0)})||Bo(e,S,n,function(x){if(typeof x=="string"?/^go[A-Z]/.test(x):x.motion)return Zo(e,x)}):Bo(e,S,n,function(x){return Zo(e,x)}):!1}function Ul(e,n,S){return Bo(e,"'"+S+"'",n,function(x){return Zo(e,x,!0)})}var us=null;function Js(e){var n=this;if(e.target&&e.target!=n.display.input.getField())return;if(n.curOp.focus=N(),vt(n,e))return;D&&m<11&&e.keyCode==27&&(e.returnValue=!1);var S=e.keyCode;n.display.shift=S==16||e.shiftKey;var x=Qs(n,e);d&&(us=x?S:null,!x&&S==88&&!dt&&(h?e.metaKey:e.ctrlKey)&&n.replaceSelection("",null,"cut")),P&&!h&&!x&&S==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),S==18&&!/\bCodeMirror-crosshair\b/.test(n.display.lineDiv.className)&&Fl(n)}function Fl(e){var n=e.display.lineDiv;j(n,"CodeMirror-crosshair");function S(x){(x.keyCode==18||!x.altKey)&&(p(n,"CodeMirror-crosshair"),mt(document,"keyup",S),mt(document,"mouseover",S))}Se(document,"keyup",S),Se(document,"mouseover",S)}function Zs(e){e.keyCode==16&&(this.doc.sel.shift=!1),vt(this,e)}function qs(e){var n=this;if(e.target&&e.target!=n.display.input.getField())return;if(Ri(n.display,e)||vt(n,e)||e.ctrlKey&&!e.altKey||h&&e.metaKey)return;var S=e.keyCode,x=e.charCode;if(d&&S==us){us=null,ie(e);return}if(d&&(!e.which||e.which<10)&&Qs(n,e))return;var k=String.fromCharCode(x==null?S:x);if(k=="\b")return;if(Ul(n,e,k))return;n.display.input.onKeyPress(e)}var Bl=400,ds=function(e,n,S){this.time=e,this.pos=n,this.button=S};ds.prototype.compare=function(e,n,S){return this.time+Bl>e&&ar(n,this.pos)==0&&S==this.button};var Ho,Wo;function Hl(e,n){var S=+new Date;return Wo&&Wo.compare(S,e,n)?(Ho=Wo=null,"triple"):Ho&&Ho.compare(S,e,n)?(Wo=new ds(S,e,n),Ho=null,"double"):(Ho=new ds(S,e,n),Wo=null,"single")}function el(e){var n=this,S=n.display;if(vt(n,e)||S.activeTouch&&S.input.supportsTouch())return;if(S.input.ensurePolled(),S.shift=e.shiftKey,Ri(S,e)){T||(S.scroller.draggable=!1,setTimeout(function(){return S.scroller.draggable=!0},100));return}if(cs(n,e))return;var x=wi(n,e),k=Be(e),X=x?Hl(x,k):"single";if(window.focus(),k==1&&n.state.selectingText&&n.state.selectingText(e),x&&Wl(n,k,x,X,e))return;k==1?x?Kl(n,x,X,e):Ce(e)==S.scroller&&ie(e):k==2?(x&&Vo(n.doc,x),setTimeout(function(){return S.input.focus()},20)):k==3&&(M?n.display.input.onContextMenu(e):no(n))}function Wl(e,n,S,x,k){var X="Click";return x=="double"?X="Double"+X:x=="triple"&&(X="Triple"+X),X=(n==1?"Left":n==2?"Middle":"Right")+X,Bo(e,Gs(X,k),k,function(J){if(typeof J=="string"&&(J=Fo[J]),!J)return!1;var ne=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),ne=J(e,S)!=fe}finally{e.state.suppressEdits=!1}return ne})}function zl(e,n,S){var x=e.getOption("configureMouse"),k=x?x(e,n,S):{};if(k.unit==null){var X=g?S.shiftKey&&S.metaKey:S.altKey;k.unit=X?"rectangle":n=="single"?"char":n=="double"?"word":"line"}return(k.extend==null||e.doc.extend)&&(k.extend=e.doc.extend||S.shiftKey),k.addNew==null&&(k.addNew=h?S.metaKey:S.ctrlKey),k.moveOnDrag==null&&(k.moveOnDrag=!(h?S.altKey:S.ctrlKey)),k}function Kl(e,n,S,x){D?setTimeout(z(Pa,e),0):e.curOp.focus=N();var k=zl(e,S,x),X=e.doc.sel,J;e.options.dragDrop&&yt&&!e.isReadOnly()&&S=="single"&&(J=X.contains(n))>-1&&(ar((J=X.ranges[J]).from(),n)<0||n.xRel>0)&&(ar(J.to(),n)>0||n.xRel<0)?Gl(e,x,n,k):Vl(e,x,n,k)}function Gl(e,n,S,x){var k=e.display,X=!1,J=ci(e,function(he){T&&(k.scroller.draggable=!1),e.state.draggingText=!1,mt(k.wrapper.ownerDocument,"mouseup",J),mt(k.wrapper.ownerDocument,"mousemove",ne),mt(k.scroller,"dragstart",oe),mt(k.scroller,"drop",J),X||(ie(he),x.addNew||Vo(e.doc,S,null,null,x.extend),T&&!c||D&&m==9?setTimeout(function(){k.wrapper.ownerDocument.body.focus({preventScroll:!0}),k.input.focus()},20):k.input.focus())}),ne=function(he){X=X||Math.abs(n.clientX-he.clientX)+Math.abs(n.clientY-he.clientY)>=10},oe=function(){return X=!0};T&&(k.scroller.draggable=!0),e.state.draggingText=J,J.copy=!x.moveOnDrag,k.scroller.dragDrop&&k.scroller.dragDrop(),Se(k.wrapper.ownerDocument,"mouseup",J),Se(k.wrapper.ownerDocument,"mousemove",ne),Se(k.scroller,"dragstart",oe),Se(k.scroller,"drop",J),no(e),setTimeout(function(){return k.input.focus()},20)}function tl(e,n,S){if(S=="char")return new Ur(n,n);if(S=="word")return e.findWordAt(n);if(S=="line")return new Ur(fn(n.line,0),B(e.doc,fn(n.line+1,0)));var x=S(e,n);return new Ur(x.from,x.to)}function Vl(e,n,S,x){var k=e.display,X=e.doc;ie(n);var J,ne,oe=X.sel,he=oe.ranges;if(x.addNew&&!x.extend?(ne=X.sel.contains(S),ne>-1?J=he[ne]:J=new Ur(S,S)):(J=X.sel.primary(),ne=X.sel.primIndex),x.unit=="rectangle")x.addNew||(J=new Ur(S,S)),S=wi(e,n,!0,!0),ne=-1;else{var ze=tl(e,S,x.unit);x.extend?J=is(J,ze.anchor,ze.head,x.extend):J=ze}x.addNew?ne==-1?(ne=he.length,Gi(X,yr(e,he.concat([J]),ne),{scroll:!1,origin:"*mouse"})):he.length>1&&he[ne].empty()&&x.unit=="char"&&!x.extend?(Gi(X,yr(e,he.slice(0,ne).concat(he.slice(ne+1)),0),{scroll:!1,origin:"*mouse"}),oe=X.sel):as(X,ne,J,me):(ne=0,Gi(X,new zi([J],0),me),oe=X.sel);var tt=S;function Dt(jn){if(ar(tt,jn)==0)return;if(tt=jn,x.unit=="rectangle"){for(var er=[],_r=e.options.tabSize,pr=V(wn(X,S.line).text,S.ch,_r),Pr=V(wn(X,jn.line).text,jn.ch,_r),ii=Math.min(pr,Pr),Bi=Math.max(pr,Pr),gi=Math.min(S.line,jn.line),oa=Math.min(e.lastLine(),Math.max(S.line,jn.line));gi<=oa;gi++){var ta=wn(X,gi).text,Mi=Ae(ta,ii,_r);ii==Bi?er.push(new Ur(fn(gi,Mi),fn(gi,Mi))):ta.length>Mi&&er.push(new Ur(fn(gi,Mi),fn(gi,Ae(ta,Bi,_r))))}er.length||er.push(new Ur(S,S)),Gi(X,yr(e,oe.ranges.slice(0,ne).concat(er),ne),{origin:"*mouse",scroll:!1}),e.scrollIntoView(jn)}else{var na=J,Ki=tl(e,jn,x.unit),Ii=na.anchor,Li;ar(Ki.anchor,Ii)>0?(Li=Ki.head,Ii=ni(na.from(),Ki.anchor)):(Li=Ki.anchor,Ii=Qr(na.to(),Ki.head));var Ei=oe.ranges.slice(0);Ei[ne]=Xl(e,new Ur(B(X,Ii),Li)),Gi(X,yr(e,Ei,ne),me)}}var Ct=k.wrapper.getBoundingClientRect(),tn=0;function bn(jn){var er=++tn,_r=wi(e,jn,!0,x.unit=="rectangle");if(!_r)return;if(ar(_r,tt)!=0){e.curOp.focus=N(),Dt(_r);var pr=ka(k,X);(_r.line>=pr.to||_r.line<pr.from)&&setTimeout(ci(e,function(){tn==er&&bn(jn)}),150)}else{var Pr=jn.clientY<Ct.top?-20:jn.clientY>Ct.bottom?20:0;Pr&&setTimeout(ci(e,function(){if(tn!=er)return;k.scroller.scrollTop+=Pr,bn(jn)}),50)}}function Ln(jn){e.state.selectingText=!1,tn=Infinity,jn&&(ie(jn),k.input.focus()),mt(k.wrapper.ownerDocument,"mousemove",Nn),mt(k.wrapper.ownerDocument,"mouseup",Yn),X.history.lastSelOrigin=null}var Nn=ci(e,function(jn){jn.buttons===0||!Be(jn)?Ln(jn):bn(jn)}),Yn=ci(e,Ln);e.state.selectingText=Yn,Se(k.wrapper.ownerDocument,"mousemove",Nn),Se(k.wrapper.ownerDocument,"mouseup",Yn)}function Xl(e,n){var S=n.anchor,x=n.head,k=wn(e.doc,S.line);if(ar(S,x)==0&&S.sticky==x.sticky)return n;var X=nn(k);if(!X)return n;var J=Ve(X,S.ch,S.sticky),ne=X[J];if(ne.from!=S.ch&&ne.to!=S.ch)return n;var oe=J+(ne.from==S.ch==(ne.level!=1)?0:1);if(oe==0||oe==X.length)return n;var he;if(x.line!=S.line)he=(x.line-S.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var ze=Ve(X,x.ch,x.sticky),tt=ze-J||(x.ch-S.ch)*(ne.level==1?-1:1);ze==oe-1||ze==oe?he=tt<0:he=tt>0}var Dt=X[oe+(he?-1:0)],Ct=he==(Dt.level==1),tn=Ct?Dt.from:Dt.to,bn=Ct?"after":"before";return S.ch==tn&&S.sticky==bn?n:new Ur(new fn(S.line,tn,bn),x)}function nl(e,n,S,x){var k,X;if(n.touches)k=n.touches[0].clientX,X=n.touches[0].clientY;else try{k=n.clientX,X=n.clientY}catch(Dt){return!1}if(k>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;x&&ie(n);var J=e.display,ne=J.lineDiv.getBoundingClientRect();if(X>ne.bottom||!xe(e,S))return ce(n);X-=ne.top-J.viewOffset;for(var oe=0;oe<e.display.gutterSpecs.length;++oe){var he=J.gutters.childNodes[oe];if(he&&he.getBoundingClientRect().right>=k){var ze=Nr(e.doc,X),tt=e.display.gutterSpecs[oe];return We(e,S,e,ze,tt.className,n),ce(n)}}}function cs(e,n){return nl(e,n,"gutterClick",!0)}function rl(e,n){if(Ri(e.display,n)||Yl(e,n))return;if(vt(e,n,"contextmenu"))return;M||e.display.input.onContextMenu(n)}function Yl(e,n){return xe(e,"gutterContextMenu")?nl(e,n,"gutterContextMenu",!1):!1}function il(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),It(e)}var wo={toString:function(){return"CodeMirror.Init"}},al={},qo={};function $l(e){var n=e.optionHandlers;function S(x,k,X,J){e.defaults[x]=k,X&&(n[x]=J?function(ne,oe,he){he!=wo&&X(ne,oe,he)}:X)}e.defineOption=S,e.Init=wo,S("value","",function(x,k){return x.setValue(k)},!0),S("mode",null,function(x,k){x.doc.modeOption=k,Di(x)},!0),S("indentUnit",2,Di,!0),S("indentWithTabs",!1),S("smartIndent",!0),S("tabSize",4,function(x){Yi(x),It(x),Gr(x)},!0),S("lineSeparator",null,function(x,k){if(x.doc.lineSep=k,!k)return;var X=[],J=x.doc.first;x.doc.iter(function(oe){for(var he=0;;){var ze=oe.text.indexOf(k,he);if(ze==-1)break;he=ze+k.length,X.push(fn(J,ze))}J++});for(var ne=X.length-1;ne>=0;ne--)bo(x.doc,k,X[ne],fn(X[ne].line,X[ne].ch+k.length))}),S("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(x,k,X){x.state.specialChars=new RegExp(k.source+(k.test(" ")?"":"| "),"g"),X!=wo&&x.refresh()}),S("specialCharPlaceholder",mn,function(x){return x.refresh()},!0),S("electricChars",!0),S("inputStyle",t?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),S("spellcheck",!1,function(x,k){return x.getInputField().spellcheck=k},!0),S("autocorrect",!1,function(x,k){return x.getInputField().autocorrect=k},!0),S("autocapitalize",!1,function(x,k){return x.getInputField().autocapitalize=k},!0),S("rtlMoveVisually",!C),S("wholeLineUpdateBefore",!0),S("theme","default",function(x){il(x),da(x)},!0),S("keyMap","default",function(x,k,X){var J=Jo(k),ne=X!=wo&&Jo(X);ne&&ne.detach&&ne.detach(x,J),J.attach&&J.attach(x,ne||null)}),S("extraKeys",null),S("configureMouse",null),S("lineWrapping",!1,Jl,!0),S("gutters",[],function(x,k){x.display.gutterSpecs=Fi(k,x.options.lineNumbers),da(x)},!0),S("fixedGutter",!0,function(x,k){x.display.gutters.style.left=k?si(x.display)+"px":"0",x.refresh()},!0),S("coverGutterNextToScrollbar",!1,function(x){return ma(x)},!0),S("scrollbarStyle","native",function(x){Qa(x),ma(x),x.display.scrollbars.setScrollTop(x.doc.scrollTop),x.display.scrollbars.setScrollLeft(x.doc.scrollLeft)},!0),S("lineNumbers",!1,function(x,k){x.display.gutterSpecs=Fi(x.options.gutters,k),da(x)},!0),S("firstLineNumber",1,da,!0),S("lineNumberFormatter",function(x){return x},da,!0),S("showCursorWhenSelecting",!1,Vr,!0),S("resetSelectionOnContextMenu",!0),S("lineWiseCopyCut",!0),S("pasteLinesPerSelection",!0),S("selectionsMayTouch",!1),S("readOnly",!1,function(x,k){k=="nocursor"&&(wa(x),x.display.input.blur()),x.display.input.readOnlyChanged(k)}),S("screenReaderLabel",null,function(x,k){k=k===""?null:k,x.display.input.screenReaderLabelChanged(k)}),S("disableInput",!1,function(x,k){k||x.display.input.reset()},!0),S("dragDrop",!0,Ql),S("allowDropFileTypes",null),S("cursorBlinkRate",530),S("cursorScrollMargin",0),S("cursorHeight",1,Vr,!0),S("singleCursorHeightPerLine",!0,Vr,!0),S("workTime",100),S("workDelay",100),S("flattenSpans",!0,Yi,!0),S("addModeClass",!1,Yi,!0),S("pollInterval",100),S("undoDepth",200,function(x,k){return x.doc.history.undoDepth=k}),S("historyEventDelay",1250),S("viewportMargin",10,function(x){return x.refresh()},!0),S("maxHighlightLength",1e4,Yi,!0),S("moveInputWithCursor",!0,function(x,k){k||x.display.input.resetPosition()}),S("tabindex",null,function(x,k){return x.display.input.getField().tabIndex=k||""}),S("autofocus",null),S("direction","ltr",function(x,k){return x.doc.setDirection(k)},!0),S("phrases",null)}function Ql(e,n,S){var x=S&&S!=wo;if(!n!=!x){var k=e.display.dragFunctions,X=n?Se:mt;X(e.display.scroller,"dragstart",k.start),X(e.display.scroller,"dragenter",k.enter),X(e.display.scroller,"dragover",k.over),X(e.display.scroller,"dragleave",k.leave),X(e.display.scroller,"drop",k.drop)}}function Jl(e){e.options.lineWrapping?(j(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(p(e.display.wrapper,"CodeMirror-wrap"),Ht(e)),ji(e),Gr(e),It(e),setTimeout(function(){return ma(e)},100)}function fi(e,n){var S=this;if(!(this instanceof fi))return new fi(e,n);this.options=n=n?L(n):{},L(al,n,!1);var x=n.value;typeof x=="string"?x=new ea(x,n.mode,null,n.lineSeparator,n.direction):n.mode&&(x.modeOption=n.mode),this.doc=x;var k=new fi.inputStyles[n.inputStyle](this),X=this.display=new Ua(e,x,k,n);X.wrapper.CodeMirror=this,il(this),n.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 W,keySeq:null,specialChars:null},n.autofocus&&!t&&X.input.focus(),D&&m<11&&setTimeout(function(){return S.display.input.reset(!0)},20),Zl(this),Al(),ua(this),this.curOp.forceUpdate=!0,gs(this,x),n.autofocus&&!t||this.hasFocus()?setTimeout(function(){S.hasFocus()&&!S.state.focused&&la(S)},20):wa(this);for(var J in qo)qo.hasOwnProperty(J)&&qo[J](this,n[J],wo);ai(this),n.finishInit&&n.finishInit(this);for(var ne=0;ne<hs.length;++ne)hs[ne](this);Ea(this),T&&n.lineWrapping&&getComputedStyle(X.lineDiv).textRendering=="optimizelegibility"&&(X.lineDiv.style.textRendering="auto")}fi.defaults=al,fi.optionHandlers=qo;function Zl(e){var n=e.display;Se(n.scroller,"mousedown",ci(e,el)),D&&m<11?Se(n.scroller,"dblclick",ci(e,function(oe){if(vt(e,oe))return;var he=wi(e,oe);if(!he||cs(e,oe)||Ri(e.display,oe))return;ie(oe);var ze=e.findWordAt(he);Vo(e.doc,ze.anchor,ze.head)})):Se(n.scroller,"dblclick",function(oe){return vt(e,oe)||ie(oe)}),Se(n.scroller,"contextmenu",function(oe){return rl(e,oe)}),Se(n.input.getField(),"contextmenu",function(oe){n.scroller.contains(oe.target)||rl(e,oe)});var S,x={end:0};function k(){n.activeTouch&&(S=setTimeout(function(){return n.activeTouch=null},1e3),x=n.activeTouch,x.end=+new Date)}function X(oe){if(oe.touches.length!=1)return!1;var he=oe.touches[0];return he.radiusX<=1&&he.radiusY<=1}function J(oe,he){if(he.left==null)return!0;var ze=he.left-oe.left,tt=he.top-oe.top;return ze*ze+tt*tt>20*20}Se(n.scroller,"touchstart",function(oe){if(!vt(e,oe)&&!X(oe)&&!cs(e,oe)){n.input.ensurePolled(),clearTimeout(S);var he=+new Date;n.activeTouch={start:he,moved:!1,prev:he-x.end<=300?x:null},oe.touches.length==1&&(n.activeTouch.left=oe.touches[0].pageX,n.activeTouch.top=oe.touches[0].pageY)}}),Se(n.scroller,"touchmove",function(){n.activeTouch&&(n.activeTouch.moved=!0)}),Se(n.scroller,"touchend",function(oe){var he=n.activeTouch;if(he&&!Ri(n,oe)&&he.left!=null&&!he.moved&&new Date-he.start<300){var ze=e.coordsChar(n.activeTouch,"page"),tt;!he.prev||J(he,he.prev)?tt=new Ur(ze,ze):!he.prev.prev||J(he,he.prev.prev)?tt=e.findWordAt(ze):tt=new Ur(fn(ze.line,0),B(e.doc,fn(ze.line+1,0))),e.setSelection(tt.anchor,tt.head),e.focus(),ie(oe)}k()}),Se(n.scroller,"touchcancel",k),Se(n.scroller,"scroll",function(){n.scroller.clientHeight&&(Da(e,n.scroller.scrollTop),ki(e,n.scroller.scrollLeft,!0),We(e,"scroll",e))}),Se(n.scroller,"mousewheel",function(oe){return Ha(e,oe)}),Se(n.scroller,"DOMMouseScroll",function(oe){return Ha(e,oe)}),Se(n.wrapper,"scroll",function(){return n.wrapper.scrollTop=n.wrapper.scrollLeft=0}),n.dragFunctions={enter:function(oe){vt(e,oe)||be(oe)},over:function(oe){vt(e,oe)||(Rl(e,oe),be(oe))},start:function(oe){return Ol(e,oe)},drop:ci(e,Sl),leave:function(oe){vt(e,oe)||Hs(e)}};var ne=n.input.getField();Se(ne,"keyup",function(oe){return Zs.call(e,oe)}),Se(ne,"keydown",ci(e,Js)),Se(ne,"keypress",ci(e,qs)),Se(ne,"focus",function(oe){return la(e,oe)}),Se(ne,"blur",function(oe){return wa(e,oe)})}var hs=[];fi.defineInitHook=function(e){return hs.push(e)};function zo(e,n,S,x){var k=e.doc,X;S==null&&(S="add"),S=="smart"&&(k.mode.indent?X=An(e,n).state:S="prev");var J=e.options.tabSize,ne=wn(k,n),oe=V(ne.text,null,J);ne.stateAfter&&(ne.stateAfter=null);var he=ne.text.match(/^\s*/)[0],ze;if(!x&&!/\S/.test(ne.text))ze=0,S="not";else if(S=="smart"&&(ze=k.mode.indent(X,ne.text.slice(he.length),ne.text),ze==fe||ze>150)){if(!x)return;S="prev"}S=="prev"?n>k.first?ze=V(wn(k,n-1).text,null,J):ze=0:S=="add"?ze=oe+e.options.indentUnit:S=="subtract"?ze=oe-e.options.indentUnit:typeof S=="number"&&(ze=oe+S),ze=Math.max(0,ze);var tt="",Dt=0;if(e.options.indentWithTabs)for(var Ct=Math.floor(ze/J);Ct;--Ct)Dt+=J,tt+=" ";if(Dt<ze&&(tt+=ue(ze-Dt)),tt!=he)return bo(k,tt,fn(n,0),fn(n,he.length),"+input"),ne.stateAfter=null,!0;for(var tn=0;tn<k.sel.ranges.length;tn++){var bn=k.sel.ranges[tn];if(bn.head.line==n&&bn.head.ch<he.length){var Ln=fn(n,he.length);as(k,tn,new Ur(Ln,Ln));break}}}var Ca=null;function es(e){Ca=e}function fs(e,n,S,x,k){var X=e.doc;e.display.shift=!1,x||(x=X.sel);var J=+new Date-200,ne=k=="paste"||e.state.pasteIncoming>J,oe=St(n),he=null;if(ne&&x.ranges.length>1)if(Ca&&Ca.text.join(`
|
|
`)==n){if(x.ranges.length%Ca.text.length==0){he=[];for(var ze=0;ze<Ca.text.length;ze++)he.push(X.splitLines(Ca.text[ze]))}}else oe.length==x.ranges.length&&e.options.pasteLinesPerSelection&&(he=Tt(oe,function(Nn){return[Nn]}));for(var tt=e.curOp.updateInput,Dt=x.ranges.length-1;Dt>=0;Dt--){var Ct=x.ranges[Dt],tn=Ct.from(),bn=Ct.to();Ct.empty()&&(S&&S>0?tn=fn(tn.line,tn.ch-S):e.state.overwrite&&!ne?bn=fn(bn.line,Math.min(wn(X,bn.line).text.length,bn.ch+$e(oe).length)):ne&&Ca&&Ca.lineWise&&Ca.text.join(`
|
|
`)==oe.join(`
|
|
`)&&(tn=bn=fn(tn.line,0)));var Ln={from:tn,to:bn,text:he?he[Dt%he.length]:oe,origin:k||(ne?"paste":e.state.cutIncoming>J?"cut":"+input")};yo(e.doc,Ln),Qn(e,"inputRead",e,Ln)}n&&!ne&&sl(e,n),_a(e),e.curOp.updateInput<2&&(e.curOp.updateInput=tt),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ol(e,n){var S=e.clipboardData&&e.clipboardData.getData("Text");if(S)return e.preventDefault(),!n.isReadOnly()&&!n.options.disableInput&&Wi(n,function(){return fs(n,S,0,null,"paste")}),!0}function sl(e,n){if(!e.options.electricChars||!e.options.smartIndent)return;for(var S=e.doc.sel,x=S.ranges.length-1;x>=0;x--){var k=S.ranges[x];if(k.head.ch>100||x&&S.ranges[x-1].head.line==k.head.line)continue;var X=e.getModeAt(k.head),J=!1;if(X.electricChars){for(var ne=0;ne<X.electricChars.length;ne++)if(n.indexOf(X.electricChars.charAt(ne))>-1){J=zo(e,k.head.line,"smart");break}}else X.electricInput&&(X.electricInput.test(wn(e.doc,k.head.line).text.slice(0,k.head.ch))&&(J=zo(e,k.head.line,"smart")));J&&Qn(e,"electricInput",e,k.head.line)}}function ll(e){for(var n=[],S=[],x=0;x<e.doc.sel.ranges.length;x++){var k=e.doc.sel.ranges[x].head.line,X={anchor:fn(k,0),head:fn(k+1,0)};S.push(X),n.push(e.getRange(X.anchor,X.head))}return{text:n,ranges:S}}function ul(e,n,S,x){e.setAttribute("autocorrect",S?"":"off"),e.setAttribute("autocapitalize",x?"":"off"),e.setAttribute("spellcheck",!!n)}function dl(){var e=f("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),n=f("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return T?e.style.width="1000px":e.setAttribute("wrap","off"),s&&(e.style.border="1px solid black"),ul(e),n}function ql(e){var n=e.optionHandlers,S=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(x,k){var X=this.options,J=X[x];if(X[x]==k&&x!="mode")return;X[x]=k,n.hasOwnProperty(x)&&ci(this,n[x])(this,k,J),We(this,"optionChange",this,x)},getOption:function(x){return this.options[x]},getDoc:function(){return this.doc},addKeyMap:function(x,k){this.state.keyMaps[k?"push":"unshift"](Jo(x))},removeKeyMap:function(x){for(var k=this.state.keyMaps,X=0;X<k.length;++X)if(k[X]==x||k[X].name==x)return k.splice(X,1),!0},addOverlay:Ai(function(x,k){var X=x.token?x:e.getMode(this.options,x);if(X.startState)throw new Error("Overlays may not be stateful.");ye(this.state.overlays,{mode:X,modeSpec:x,opaque:k&&k.opaque,priority:k&&k.priority||0},function(J){return J.priority}),this.state.modeGen++,Gr(this)}),removeOverlay:Ai(function(x){for(var k=this.state.overlays,X=0;X<k.length;++X){var J=k[X].modeSpec;if(J==x||typeof x=="string"&&J.name==x){k.splice(X,1),this.state.modeGen++,Gr(this);return}}}),indentLine:Ai(function(x,k,X){typeof k!="string"&&typeof k!="number"&&(k==null?k=this.options.smartIndent?"smart":"prev":k=k?"add":"subtract"),ti(this.doc,x)&&zo(this,x,k,X)}),indentSelection:Ai(function(x){for(var k=this.doc.sel.ranges,X=-1,J=0;J<k.length;J++){var ne=k[J];if(ne.empty())ne.head.line>X&&(zo(this,ne.head.line,x,!0),X=ne.head.line,J==this.doc.sel.primIndex&&_a(this));else{var oe=ne.from(),he=ne.to(),ze=Math.max(X,oe.line);X=Math.min(this.lastLine(),he.line-(he.ch?0:1))+1;for(var tt=ze;tt<X;++tt)zo(this,tt,x);var Dt=this.doc.sel.ranges;oe.ch==0&&k.length==Dt.length&&Dt[J].from().ch>0&&as(this.doc,J,new Ur(oe,Dt[J].to()),se)}}}),getTokenAt:function(x,k){return ln(this,x,k)},getLineTokens:function(x,k){return ln(this,fn(x),k,!0)},getTokenTypeAt:function(x){x=B(this.doc,x);var k=qt(this,wn(this.doc,x.line)),X=0,J=(k.length-1)/2,ne=x.ch,oe;if(ne==0)oe=k[2];else for(;;){var he=X+J>>1;if((he?k[he*2-1]:0)>=ne)J=he;else if(k[he*2+1]<ne)X=he+1;else{oe=k[he*2+2];break}}var ze=oe?oe.indexOf("overlay "):-1;return ze<0?oe:ze==0?null:oe.slice(0,ze-1)},getModeAt:function(x){var k=this.doc.mode;return k.innerMode?e.innerMode(k,this.getTokenAt(x).state).mode:k},getHelper:function(x,k){return this.getHelpers(x,k)[0]},getHelpers:function(x,k){var X=[];if(!S.hasOwnProperty(k))return X;var J=S[k],ne=this.getModeAt(x);if(typeof ne[k]=="string")J[ne[k]]&&X.push(J[ne[k]]);else if(ne[k])for(var oe=0;oe<ne[k].length;oe++){var he=J[ne[k][oe]];he&&X.push(he)}else ne.helperType&&J[ne.helperType]?X.push(J[ne.helperType]):J[ne.name]&&X.push(J[ne.name]);for(var ze=0;ze<J._global.length;ze++){var tt=J._global[ze];tt.pred(ne,this)&&$(X,tt.val)==-1&&X.push(tt.val)}return X},getStateAfter:function(x,k){var X=this.doc;return x=ee(X,x==null?X.first+X.size-1:x),An(this,x+1,k).state},cursorCoords:function(x,k){var X,J=this.doc.sel.primary();return x==null?X=J.head:typeof x=="object"?X=B(this.doc,x):X=x?J.from():J.to(),ir(this,X,k||"page")},charCoords:function(x,k){return Tr(this,B(this.doc,x),k||"page")},coordsChar:function(x,k){return x=qn(this,x,k||"page"),gr(this,x.left,x.top)},lineAtHeight:function(x,k){return x=qn(this,{top:x,left:0},k||"page").top,Nr(this.doc,x+this.display.viewOffset)},heightAtLine:function(x,k,X){var J=!1,ne;if(typeof x=="number"){var oe=this.doc.first+this.doc.size-1;x<this.doc.first?x=this.doc.first:x>oe&&(x=oe,J=!0),ne=wn(this.doc,x)}else ne=x;return vr(this,ne,{top:0,left:0},k||"page",X||J).top+(J?this.doc.height-Kt(ne):0)},defaultTextHeight:function(){return Ir(this.display)},defaultCharWidth:function(){return kr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(x,k,X,J,ne){var oe=this.display;x=ir(this,B(this.doc,x));var he=x.bottom,ze=x.left;if(k.style.position="absolute",k.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(k),oe.sizer.appendChild(k),J=="over")he=x.top;else if(J=="above"||J=="near"){var tt=Math.max(oe.wrapper.clientHeight,this.doc.height),Dt=Math.max(oe.sizer.clientWidth,oe.lineSpace.clientWidth);(J=="above"||x.bottom+k.offsetHeight>tt)&&x.top>k.offsetHeight?he=x.top-k.offsetHeight:x.bottom+k.offsetHeight<=tt&&(he=x.bottom),ze+k.offsetWidth>Dt&&(ze=Dt-k.offsetWidth)}k.style.top=he+"px",k.style.left=k.style.right="",ne=="right"?(ze=oe.sizer.clientWidth-k.offsetWidth,k.style.right="0px"):(ne=="left"?ze=0:ne=="middle"&&(ze=(oe.sizer.clientWidth-k.offsetWidth)/2),k.style.left=ze+"px"),X&&Ga(this,{left:ze,top:he,right:ze+k.offsetWidth,bottom:he+k.offsetHeight})},triggerOnKeyDown:Ai(Js),triggerOnKeyPress:Ai(qs),triggerOnKeyUp:Zs,triggerOnMouseDown:Ai(el),execCommand:function(x){if(Fo.hasOwnProperty(x))return Fo[x].call(null,this)},triggerElectric:Ai(function(x){sl(this,x)}),findPosH:function(x,k,X,J){var ne=1;k<0&&(ne=-1,k=-k);for(var oe=B(this.doc,x),he=0;he<k&&!(oe=ps(this.doc,oe,ne,X,J),oe.hitSide);++he);return oe},moveH:Ai(function(x,k){var X=this;this.extendSelectionsBy(function(J){return X.display.shift||X.doc.extend||J.empty()?ps(X.doc,J.head,x,k,X.options.rtlMoveVisually):x<0?J.from():J.to()},ve)}),deleteH:Ai(function(x,k){var X=this.doc.sel,J=this.doc;X.somethingSelected()?J.replaceSelection("",null,"+delete"):Co(this,function(ne){var oe=ps(J,ne.head,x,k,!1);return x<0?{from:oe,to:ne.head}:{from:ne.head,to:oe}})}),findPosV:function(x,k,X,J){var ne=1,oe=J;k<0&&(ne=-1,k=-k);for(var he=B(this.doc,x),ze=0;ze<k;++ze){var tt=ir(this,he,"div");if(oe==null?oe=tt.left:tt.left=oe,he=cl(this,tt,ne,X),he.hitSide)break}return he},moveV:Ai(function(x,k){var X=this,J=this.doc,ne=[],oe=!this.display.shift&&!J.extend&&J.sel.somethingSelected();if(J.extendSelectionsBy(function(ze){if(oe)return x<0?ze.from():ze.to();var tt=ir(X,ze.head,"div");ze.goalColumn!=null&&(tt.left=ze.goalColumn),ne.push(tt.left);var Dt=cl(X,tt,x,k);return k=="page"&&ze==J.sel.primary()&&Va(X,Tr(X,Dt,"div").top-tt.top),Dt},ve),ne.length)for(var he=0;he<J.sel.ranges.length;he++)J.sel.ranges[he].goalColumn=ne[he]}),findWordAt:function(x){var k=this.doc,X=wn(k,x.line).text,J=x.ch,ne=x.ch;if(X){var oe=this.getHelper(x,"wordChars");(x.sticky=="before"||ne==X.length)&&J?--J:++ne;for(var he=X.charAt(J),ze=lt(he,oe)?function(tt){return lt(tt,oe)}:/\s/.test(he)?function(tt){return/\s/.test(tt)}:function(tt){return!/\s/.test(tt)&&!lt(tt)};J>0&&ze(X.charAt(J-1));)--J;for(;ne<X.length&&ze(X.charAt(ne));)++ne}return new Ur(fn(x.line,J),fn(x.line,ne))},toggleOverwrite:function(x){if(x!=null&&x==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?j(this.display.cursorDiv,"CodeMirror-overwrite"):p(this.display.cursorDiv,"CodeMirror-overwrite"),We(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==N()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Ai(function(x,k){Ra(this,x,k)}),getScrollInfo:function(){var x=this.display.scroller;return{left:x.scrollLeft,top:x.scrollTop,height:x.scrollHeight-rt(this)-this.display.barHeight,width:x.scrollWidth-rt(this)-this.display.barWidth,clientHeight:de(this),clientWidth:Ie(this)}},scrollIntoView:Ai(function(x,k){x==null?(x={from:this.doc.sel.primary().head,to:null},k==null&&(k=this.options.cursorScrollMargin)):typeof x=="number"?x={from:fn(x,0),to:null}:x.from==null&&(x={from:x,to:null}),x.to||(x.to=x.from),x.margin=k||0,x.from.line!=null?ho(this,x):Aa(this,x.from,x.to,x.margin)}),setSize:Ai(function(x,k){var X=this,J=function(oe){return typeof oe=="number"||/^\d+$/.test(String(oe))?oe+"px":oe};x!=null&&(this.display.wrapper.style.width=J(x)),k!=null&&(this.display.wrapper.style.height=J(k)),this.options.lineWrapping&&on(this);var ne=this.display.viewFrom;this.doc.iter(ne,this.display.viewTo,function(oe){if(oe.widgets){for(var he=0;he<oe.widgets.length;he++)if(oe.widgets[he].noHScroll){Xr(X,ne,"widget");break}}++ne}),this.curOp.forceUpdate=!0,We(this,"refresh",this)}),operation:function(x){return Wi(this,x)},startOperation:function(){return ua(this)},endOperation:function(){return Ea(this)},refresh:Ai(function(){var x=this.display.cachedTextHeight;Gr(this),this.curOp.forceUpdate=!0,It(this),Ra(this,this.doc.scrollLeft,this.doc.scrollTop),Za(this.display),(x==null||Math.abs(x-Ir(this.display))>.5||this.options.lineWrapping)&&ji(this),We(this,"refresh",this)}),swapDoc:Ai(function(x){var k=this.doc;return k.cm=null,this.state.selectingText&&this.state.selectingText(),gs(this,x),It(this),this.display.input.reset(),Ra(this,x.scrollLeft,x.scrollTop),this.curOp.forceScroll=!0,Qn(this,"swapDoc",this,k),k}),phrase:function(x){var k=this.options.phrases;return k&&Object.prototype.hasOwnProperty.call(k,x)?k[x]:x},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}},we(e),e.registerHelper=function(x,k,X){S.hasOwnProperty(x)||(S[x]=e[x]={_global:[]}),S[x][k]=X},e.registerGlobalHelper=function(x,k,X,J){e.registerHelper(x,k,J),S[x]._global.push({pred:X,val:J})}}function ps(e,n,S,x,k){var X=n,J=S,ne=wn(e,n.line),oe=k&&e.direction=="rtl"?-S:S;function he(){var Yn=n.line+oe;return Yn<e.first||Yn>=e.first+e.size?!1:(n=new fn(Yn,n.ch,n.sticky),ne=wn(e,Yn))}function ze(Yn){var jn;if(x=="codepoint"){var er=ne.text.charCodeAt(n.ch+(x>0?0:-1));isNaN(er)?jn=null:jn=new fn(n.line,Math.max(0,Math.min(ne.text.length,n.ch+S*(er>=55296&&er<56320?2:1))),-S)}else k?jn=kl(e.cm,ne,n,S):jn=ss(ne,n,S);if(jn==null)if(!Yn&&he())n=ls(k,e.cm,ne,n.line,oe);else return!1;else n=jn;return!0}if(x=="char"||x=="codepoint")ze();else if(x=="column")ze(!0);else if(x=="word"||x=="group")for(var tt=null,Dt=x=="group",Ct=e.cm&&e.cm.getHelper(n,"wordChars"),tn=!0;!(S<0&&!ze(!tn));tn=!1){var bn=ne.text.charAt(n.ch)||`
|
|
`,Ln=lt(bn,Ct)?"w":Dt&&bn==`
|
|
`?"n":!Dt||/\s/.test(bn)?null:"p";if(Dt&&!tn&&!Ln&&(Ln="s"),tt&&tt!=Ln){S<0&&(S=1,ze(),n.sticky="after");break}if(Ln&&(tt=Ln),S>0&&!ze(!tn))break}var Nn=Yo(e,n,X,J,!0);return oi(X,Nn)&&(Nn.hitSide=!0),Nn}function cl(e,n,S,x){var k=e.doc,X=n.left,J;if(x=="page"){var ne=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),oe=Math.max(ne-.5*Ir(e.display),3);J=(S>0?n.bottom:n.top)+S*oe}else x=="line"&&(J=S>0?n.bottom+3:n.top-3);for(var he;!(he=gr(e,X,J),!he.outside);){if(S<0?J<=0:J>=k.height){he.hitSide=!0;break}J+=S*5}return he}var ei=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new W,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};ei.prototype.init=function(e){var n=this,S=this,x=S.cm,k=S.div=e.lineDiv;ul(k,x.options.spellcheck,x.options.autocorrect,x.options.autocapitalize);function X(ne){for(var oe=ne.target;oe;oe=oe.parentNode){if(oe==k)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(oe.className))break}return!1}Se(k,"paste",function(ne){if(!X(ne)||vt(x,ne)||ol(ne,x))return;m<=11&&setTimeout(ci(x,function(){return n.updateFromDOM()}),20)}),Se(k,"compositionstart",function(ne){n.composing={data:ne.data,done:!1}}),Se(k,"compositionupdate",function(ne){n.composing||(n.composing={data:ne.data,done:!1})}),Se(k,"compositionend",function(ne){n.composing&&(ne.data!=n.composing.data&&n.readFromDOMSoon(),n.composing.done=!0)}),Se(k,"touchstart",function(){return S.forceCompositionEnd()}),Se(k,"input",function(){n.composing||n.readFromDOMSoon()});function J(ne){if(!X(ne)||vt(x,ne))return;if(x.somethingSelected())es({lineWise:!1,text:x.getSelections()}),ne.type=="cut"&&x.replaceSelection("",null,"cut");else if(x.options.lineWiseCopyCut){var oe=ll(x);es({lineWise:!0,text:oe.text}),ne.type=="cut"&&x.operation(function(){x.setSelections(oe.ranges,0,se),x.replaceSelection("",null,"cut")})}else return;if(ne.clipboardData){ne.clipboardData.clearData();var he=Ca.text.join(`
|
|
`);if(ne.clipboardData.setData("Text",he),ne.clipboardData.getData("Text")==he){ne.preventDefault();return}}var ze=dl(),tt=ze.firstChild;x.display.lineSpace.insertBefore(ze,x.display.lineSpace.firstChild),tt.value=Ca.text.join(`
|
|
`);var Dt=document.activeElement;G(tt),setTimeout(function(){x.display.lineSpace.removeChild(ze),Dt.focus(),Dt==k&&S.showPrimarySelection()},50)}Se(k,"copy",J),Se(k,"cut",J)},ei.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},ei.prototype.prepareSelection=function(){var e=Ji(this.cm,!1);return e.focus=document.activeElement==this.div,e},ei.prototype.showSelection=function(e,n){if(!e||!this.cm.display.view.length)return;(e.focus||n)&&this.showPrimarySelection(),this.showMultipleSelections(e)},ei.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},ei.prototype.showPrimarySelection=function(){var e=this.getSelection(),n=this.cm,S=n.doc.sel.primary(),x=S.from(),k=S.to();if(n.display.viewTo==n.display.viewFrom||x.line>=n.display.viewTo||k.line<n.display.viewFrom){e.removeAllRanges();return}var X=ts(n,e.anchorNode,e.anchorOffset),J=ts(n,e.focusNode,e.focusOffset);if(X&&!X.bad&&J&&!J.bad&&ar(ni(X,J),x)==0&&ar(Qr(X,J),k)==0)return;var ne=n.display.view,oe=x.line>=n.display.viewFrom&&hl(n,x)||{node:ne[0].measure.map[2],offset:0},he=k.line<n.display.viewTo&&hl(n,k);if(!he){var ze=ne[ne.length-1].measure,tt=ze.maps?ze.maps[ze.maps.length-1]:ze.map;he={node:tt[tt.length-1],offset:tt[tt.length-2]-tt[tt.length-3]}}if(!oe||!he){e.removeAllRanges();return}var Dt=e.rangeCount&&e.getRangeAt(0),Ct;try{Ct=y(oe.node,oe.offset,he.offset,he.node)}catch(tn){}Ct&&(!P&&n.state.focused?(e.collapse(oe.node,oe.offset),Ct.collapsed||(e.removeAllRanges(),e.addRange(Ct))):(e.removeAllRanges(),e.addRange(Ct)),Dt&&e.anchorNode==null?e.addRange(Dt):P&&this.startGracePeriod()),this.rememberSelection()},ei.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)},ei.prototype.showMultipleSelections=function(e){u(this.cm.display.cursorDiv,e.cursors),u(this.cm.display.selectionDiv,e.selection)},ei.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},ei.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var n=e.getRangeAt(0).commonAncestorContainer;return v(this.div,n)},ei.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},ei.prototype.blur=function(){this.div.blur()},ei.prototype.getField=function(){return this.div},ei.prototype.supportsTouch=function(){return!0},ei.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Wi(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function n(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,n))}this.polling.set(this.cm.options.pollInterval,n)},ei.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},ei.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),n=this.cm;if(o&&i&&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 S=ts(n,e.anchorNode,e.anchorOffset),x=ts(n,e.focusNode,e.focusOffset);S&&x&&Wi(n,function(){Gi(n.doc,Un(S,x),se),(S.bad||x.bad)&&(n.curOp.selectionChanged=!0)})},ei.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,n=e.display,S=e.doc.sel.primary(),x=S.from(),k=S.to();if(x.ch==0&&x.line>e.firstLine()&&(x=fn(x.line-1,wn(e.doc,x.line-1).length)),k.ch==wn(e.doc,k.line).text.length&&k.line<e.lastLine()&&(k=fn(k.line+1,0)),x.line<n.viewFrom||k.line>n.viewTo-1)return!1;var X,J,ne;x.line==n.viewFrom||(X=Zr(e,x.line))==0?(J=dr(n.view[0].line),ne=n.view[0].node):(J=dr(n.view[X].line),ne=n.view[X-1].node.nextSibling);var oe=Zr(e,k.line),he,ze;if(oe==n.view.length-1?(he=n.viewTo-1,ze=n.lineDiv.lastChild):(he=dr(n.view[oe+1].line)-1,ze=n.view[oe+1].node.previousSibling),!ne)return!1;for(var tt=e.doc.splitLines(tu(e,ne,ze,J,he)),Dt=xr(e.doc,fn(J,0),fn(he,wn(e.doc,he).text.length));tt.length>1&&Dt.length>1;)if($e(tt)==$e(Dt))tt.pop(),Dt.pop(),he--;else if(tt[0]==Dt[0])tt.shift(),Dt.shift(),J++;else break;for(var Ct=0,tn=0,bn=tt[0],Ln=Dt[0],Nn=Math.min(bn.length,Ln.length);Ct<Nn&&bn.charCodeAt(Ct)==Ln.charCodeAt(Ct);)++Ct;for(var Yn=$e(tt),jn=$e(Dt),er=Math.min(Yn.length-(tt.length==1?Ct:0),jn.length-(Dt.length==1?Ct:0));tn<er&&Yn.charCodeAt(Yn.length-tn-1)==jn.charCodeAt(jn.length-tn-1);)++tn;if(tt.length==1&&Dt.length==1&&J==x.line)for(;Ct&&Ct>x.ch&&Yn.charCodeAt(Yn.length-tn-1)==jn.charCodeAt(jn.length-tn-1);)Ct--,tn++;tt[tt.length-1]=Yn.slice(0,Yn.length-tn).replace(/^\u200b+/,""),tt[0]=tt[0].slice(Ct).replace(/\u200b+$/,"");var _r=fn(J,Ct),pr=fn(he,Dt.length?$e(Dt).length-tn:0);if(tt.length>1||tt[0]||ar(_r,pr))return bo(e.doc,tt,_r,pr,"+input"),!0},ei.prototype.ensurePolled=function(){this.forceCompositionEnd()},ei.prototype.reset=function(){this.forceCompositionEnd()},ei.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},ei.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)},ei.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Wi(this.cm,function(){return Gr(e.cm)})},ei.prototype.setUneditable=function(e){e.contentEditable="false"},ei.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||ci(this.cm,fs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},ei.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},ei.prototype.onContextMenu=function(){},ei.prototype.resetPosition=function(){},ei.prototype.needsContentAttribute=!0;function hl(e,n){var S=ot(e,n.line);if(!S||S.hidden)return null;var x=wn(e.doc,n.line),k=pe(S,x,n.line),X=nn(x,e.doc.direction),J="left";if(X){var ne=Ve(X,n.ch);J=ne%2?"right":"left"}var oe=en(k.map,n.ch,J);return oe.offset=oe.collapse=="right"?oe.end:oe.start,oe}function eu(e){for(var n=e;n;n=n.parentNode)if(/CodeMirror-gutter-wrapper/.test(n.className))return!0;return!1}function To(e,n){return n&&(e.bad=!0),e}function tu(e,n,S,x,k){var X="",J=!1,ne=e.doc.lineSeparator(),oe=!1;function he(Ct){return function(tn){return tn.id==Ct}}function ze(){J&&(X+=ne,oe&&(X+=ne),J=oe=!1)}function tt(Ct){Ct&&(ze(),X+=Ct)}function Dt(Ct){if(Ct.nodeType==1){var tn=Ct.getAttribute("cm-text");if(tn){tt(tn);return}var bn=Ct.getAttribute("cm-marker"),Ln;if(bn){var Nn=e.findMarks(fn(x,0),fn(k+1,0),he(+bn));Nn.length&&(Ln=Nn[0].find(0))&&tt(xr(e.doc,Ln.from,Ln.to).join(ne));return}if(Ct.getAttribute("contenteditable")=="false")return;var Yn=/^(pre|div|p|li|table|br)$/i.test(Ct.nodeName);if(!/^br$/i.test(Ct.nodeName)&&Ct.textContent.length==0)return;Yn&&ze();for(var jn=0;jn<Ct.childNodes.length;jn++)Dt(Ct.childNodes[jn]);/^(pre|p)$/i.test(Ct.nodeName)&&(oe=!0),Yn&&(J=!0)}else Ct.nodeType==3&&tt(Ct.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Dt(n),n==S);)n=n.nextSibling,oe=!1;return X}function ts(e,n,S){var x;if(n==e.display.lineDiv){if(x=e.display.lineDiv.childNodes[S],!x)return To(e.clipPos(fn(e.display.viewTo-1)),!0);n=null,S=0}else for(x=n;;x=x.parentNode){if(!x||x==e.display.lineDiv)return null;if(x.parentNode&&x.parentNode==e.display.lineDiv)break}for(var k=0;k<e.display.view.length;k++){var X=e.display.view[k];if(X.node==x)return nu(X,n,S)}}function nu(e,n,S){var x=e.text.firstChild,k=!1;if(!n||!v(x,n))return To(fn(dr(e.line),0),!0);if(n==x&&(k=!0,n=x.childNodes[S],S=0,!n)){var X=e.rest?$e(e.rest):e.line;return To(fn(dr(X),X.text.length),k)}var J=n.nodeType==3?n:null,ne=n;for(!J&&n.childNodes.length==1&&n.firstChild.nodeType==3&&(J=n.firstChild,S&&(S=J.nodeValue.length));ne.parentNode!=x;)ne=ne.parentNode;var oe=e.measure,he=oe.maps;function ze(Ln,Nn,Yn){for(var jn=-1;jn<(he?he.length:0);jn++)for(var er=jn<0?oe.map:he[jn],_r=0;_r<er.length;_r+=3){var pr=er[_r+2];if(pr==Ln||pr==Nn){var Pr=dr(jn<0?e.line:e.rest[jn]),ii=er[_r]+Yn;return(Yn<0||pr!=Ln)&&(ii=er[_r+(Yn?1:0)]),fn(Pr,ii)}}}var tt=ze(J,ne,S);if(tt)return To(tt,k);for(var Dt=ne.nextSibling,Ct=J?J.nodeValue.length-S:0;Dt;Dt=Dt.nextSibling){if(tt=ze(Dt,Dt.firstChild,0),tt)return To(fn(tt.line,tt.ch-Ct),k);Ct+=Dt.textContent.length}for(var tn=ne.previousSibling,bn=S;tn;tn=tn.previousSibling){if(tt=ze(tn,tn.firstChild,-1),tt)return To(fn(tt.line,tt.ch+bn),k);bn+=tn.textContent.length}}var Si=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new W,this.hasSelection=!1,this.composing=null};Si.prototype.init=function(e){var n=this,S=this,x=this.cm;this.createField(e);var k=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),s&&(k.style.width="0px"),Se(k,"input",function(){D&&m>=9&&n.hasSelection&&(n.hasSelection=null),S.poll()}),Se(k,"paste",function(J){if(vt(x,J)||ol(J,x))return;x.state.pasteIncoming=+new Date,S.fastPoll()});function X(J){if(vt(x,J))return;if(x.somethingSelected())es({lineWise:!1,text:x.getSelections()});else if(x.options.lineWiseCopyCut){var ne=ll(x);es({lineWise:!0,text:ne.text}),J.type=="cut"?x.setSelections(ne.ranges,null,se):(S.prevInput="",k.value=ne.text.join(`
|
|
`),G(k))}else return;J.type=="cut"&&(x.state.cutIncoming=+new Date)}Se(k,"cut",X),Se(k,"copy",X),Se(e.scroller,"paste",function(J){if(Ri(e,J)||vt(x,J))return;if(!k.dispatchEvent){x.state.pasteIncoming=+new Date,S.focus();return}var ne=new Event("paste");ne.clipboardData=J.clipboardData,k.dispatchEvent(ne)}),Se(e.lineSpace,"selectstart",function(J){Ri(e,J)||ie(J)}),Se(k,"compositionstart",function(){var J=x.getCursor("from");S.composing&&S.composing.range.clear(),S.composing={start:J,range:x.markText(J,x.getCursor("to"),{className:"CodeMirror-composing"})}}),Se(k,"compositionend",function(){S.composing&&(S.poll(),S.composing.range.clear(),S.composing=null)})},Si.prototype.createField=function(e){this.wrapper=dl(),this.textarea=this.wrapper.firstChild},Si.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Si.prototype.prepareSelection=function(){var e=this.cm,n=e.display,S=e.doc,x=Ji(e);if(e.options.moveInputWithCursor){var k=ir(e,S.sel.primary().head,"div"),X=n.wrapper.getBoundingClientRect(),J=n.lineDiv.getBoundingClientRect();x.teTop=Math.max(0,Math.min(n.wrapper.clientHeight-10,k.top+J.top-X.top)),x.teLeft=Math.max(0,Math.min(n.wrapper.clientWidth-10,k.left+J.left-X.left))}return x},Si.prototype.showSelection=function(e){var n=this.cm,S=n.display;u(S.cursorDiv,e.cursors),u(S.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Si.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var n=this.cm;if(n.somethingSelected()){this.prevInput="";var S=n.getSelection();this.textarea.value=S,n.state.focused&&G(this.textarea),D&&m>=9&&(this.hasSelection=S)}else e||(this.prevInput=this.textarea.value="",D&&m>=9&&(this.hasSelection=null))},Si.prototype.getField=function(){return this.textarea},Si.prototype.supportsTouch=function(){return!1},Si.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!t||N()!=this.textarea))try{this.textarea.focus()}catch(e){}},Si.prototype.blur=function(){this.textarea.blur()},Si.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Si.prototype.receivedFocus=function(){this.slowPoll()},Si.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Si.prototype.fastPoll=function(){var e=!1,n=this;n.pollingFast=!0;function S(){var x=n.poll();!x&&!e?(e=!0,n.polling.set(60,S)):(n.pollingFast=!1,n.slowPoll())}n.polling.set(20,S)},Si.prototype.poll=function(){var e=this,n=this.cm,S=this.textarea,x=this.prevInput;if(this.contextMenuPending||!n.state.focused||Ot(S)&&!x&&!this.composing||n.isReadOnly()||n.options.disableInput||n.state.keySeq)return!1;var k=S.value;if(k==x&&!n.somethingSelected())return!1;if(D&&m>=9&&this.hasSelection===k||h&&/[\uf700-\uf7ff]/.test(k))return n.display.input.reset(),!1;if(n.doc.sel==n.display.selForContextMenu){var X=k.charCodeAt(0);if(X==8203&&!x&&(x="\u200B"),X==8666)return this.reset(),this.cm.execCommand("undo")}for(var J=0,ne=Math.min(x.length,k.length);J<ne&&x.charCodeAt(J)==k.charCodeAt(J);)++J;return Wi(n,function(){fs(n,k.slice(J),x.length-J,null,e.composing?"*compose":null),k.length>1e3||k.indexOf(`
|
|
`)>-1?S.value=e.prevInput="":e.prevInput=k,e.composing&&(e.composing.range.clear(),e.composing.range=n.markText(e.composing.start,n.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Si.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Si.prototype.onKeyPress=function(){D&&m>=9&&(this.hasSelection=null),this.fastPoll()},Si.prototype.onContextMenu=function(e){var n=this,S=n.cm,x=S.display,k=n.textarea;n.contextMenuPending&&n.contextMenuPending();var X=wi(S,e),J=x.scroller.scrollTop;if(!X||d)return;var ne=S.options.resetSelectionOnContextMenu;ne&&S.doc.sel.contains(X)==-1&&ci(S,Gi)(S.doc,Un(X),se);var oe=k.style.cssText,he=n.wrapper.style.cssText,ze=n.wrapper.offsetParent.getBoundingClientRect();n.wrapper.style.cssText="position: static",k.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-ze.top-5)+"px; left: "+(e.clientX-ze.left-5)+`px;
|
|
z-index: 1000; background: `+(D?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var tt;T&&(tt=window.scrollY),x.input.focus(),T&&window.scrollTo(null,tt),x.input.reset(),S.somethingSelected()||(k.value=n.prevInput=" "),n.contextMenuPending=Ct,x.selForContextMenu=S.doc.sel,clearTimeout(x.detectingSelectAll);function Dt(){if(k.selectionStart!=null){var bn=S.somethingSelected(),Ln="\u200B"+(bn?k.value:"");k.value="\u21DA",k.value=Ln,n.prevInput=bn?"":"\u200B",k.selectionStart=1,k.selectionEnd=Ln.length,x.selForContextMenu=S.doc.sel}}function Ct(){if(n.contextMenuPending!=Ct)return;if(n.contextMenuPending=!1,n.wrapper.style.cssText=he,k.style.cssText=oe,D&&m<9&&x.scrollbars.setScrollTop(x.scroller.scrollTop=J),k.selectionStart!=null){(!D||D&&m<9)&&Dt();var bn=0,Ln=function(){x.selForContextMenu==S.doc.sel&&k.selectionStart==0&&k.selectionEnd>0&&n.prevInput=="\u200B"?ci(S,Ds)(S):bn++<10?x.detectingSelectAll=setTimeout(Ln,500):(x.selForContextMenu=null,x.input.reset())};x.detectingSelectAll=setTimeout(Ln,200)}}if(D&&m>=9&&Dt(),M){be(e);var tn=function(){mt(window,"mouseup",tn),setTimeout(Ct,20)};Se(window,"mouseup",tn)}else setTimeout(Ct,50)},Si.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Si.prototype.setUneditable=function(){},Si.prototype.needsContentAttribute=!1;function ru(e,n){if(n=n?L(n):{},n.value=e.value,!n.tabindex&&e.tabIndex&&(n.tabindex=e.tabIndex),!n.placeholder&&e.placeholder&&(n.placeholder=e.placeholder),n.autofocus==null){var S=N();n.autofocus=S==e||e.getAttribute("autofocus")!=null&&S==document.body}function x(){e.value=ne.getValue()}var k;if(e.form&&(Se(e.form,"submit",x),!n.leaveSubmitMethodAlone)){var X=e.form;k=X.submit;try{var J=X.submit=function(){x(),X.submit=k,X.submit(),X.submit=J}}catch(oe){}}n.finishInit=function(oe){oe.save=x,oe.getTextArea=function(){return e},oe.toTextArea=function(){oe.toTextArea=isNaN,x(),e.parentNode.removeChild(oe.getWrapperElement()),e.style.display="",e.form&&(mt(e.form,"submit",x),!n.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=k))}},e.style.display="none";var ne=fi(function(oe){return e.parentNode.insertBefore(oe,e.nextSibling)},n);return ne}function iu(e){e.off=mt,e.on=Se,e.wheelEventPixels=Ba,e.Doc=ea,e.splitLines=St,e.countColumn=V,e.findColumn=Ae,e.isWordChar=ke,e.Pass=fe,e.signal=We,e.Line=Sn,e.changeEnd=or,e.scrollbarModel=$a,e.Pos=fn,e.cmpPos=ar,e.modes=kt,e.mimeModes=gt,e.resolveMode=De,e.getMode=qe,e.modeExtensions=jt,e.extendMode=Zt,e.copyState=gn,e.startState=ur,e.innerMode=On,e.commands=Fo,e.keyMap=za,e.keyName=Vs,e.isModifierKey=Ks,e.lookupKey=xo,e.normalizeKeyMap=Pl,e.StringStream=Kn,e.SharedTextMarker=No,e.TextMarker=qa,e.LineWidget=Io,e.e_preventDefault=ie,e.e_stopPropagation=ae,e.e_stop=be,e.addClass=j,e.contains=v,e.rmClass=p,e.keyNames=eo}$l(fi),ql(fi);var au="iter insert remove copy getEditor constructor".split(" ");for(var ns in ea.prototype)ea.prototype.hasOwnProperty(ns)&&$(au,ns)<0&&(fi.prototype[ns]=function(e){return function(){return e.apply(this.doc,arguments)}}(ea.prototype[ns]));return we(ea),fi.inputStyles={textarea:Si,contenteditable:ei},fi.defineMode=function(e){!fi.defaults.mode&&e!="null"&&(fi.defaults.mode=e),zt.apply(this,arguments)},fi.defineMIME=$t,fi.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),fi.defineMIME("text/plain","null"),fi.defineExtension=function(e,n){fi.prototype[e]=n},fi.defineDocExtension=function(e,n){ea.prototype[e]=n},fi.fromTextArea=ru,iu(fi),fi.version="5.58.2",fi})},WaYH:function(Ye,re,I){"use strict";var Y=I("rePB"),H=I("Ff2n"),P=I("VTBJ"),F=I("1OyB"),R=I("vuIU"),O=I("JX7q"),D=I("Ji7U"),m=I("LK+K"),T=I("q1tI"),b=I("TSYQ"),i=I.n(b),d=I("sboe"),c=I("OZM5"),r=function(M){var E=M.prefixCls,p=M.level,l=M.isStart,u=M.isEnd;if(!p)return null;for(var f="".concat(E,"-indent-unit"),_=[],y=0;y<p;y+=1){var v;_.push(T.createElement("span",{key:y,className:i()(f,(v={},Object(Y.a)(v,"".concat(f,"-start"),l[y+1]),Object(Y.a)(v,"".concat(f,"-end"),u[y+1]),Object(Y.a)(v,"".concat(f,"-end-first-level"),!y&&u[0]),v))}))}return T.createElement("span",{"aria-hidden":"true",className:"".concat(E,"-indent")},_)},a=r,s=I("815F"),o="open",t="close",h="---",g=function(w){Object(D.a)(E,w);var M=Object(m.a)(E);function E(){var p;return Object(F.a)(this,E),p=M.apply(this,arguments),p.state={dragNodeHighlight:!1},p.onSelectorClick=function(l){var u=p.props.context.onNodeClick;u(l,Object(s.b)(p.props)),p.isSelectable()?p.onSelect(l):p.onCheck(l)},p.onSelectorDoubleClick=function(l){var u=p.props.context.onNodeDoubleClick;u(l,Object(s.b)(p.props))},p.onSelect=function(l){if(p.isDisabled())return;var u=p.props.context.onNodeSelect;l.preventDefault(),u(l,Object(s.b)(p.props))},p.onCheck=function(l){if(p.isDisabled())return;var u=p.props,f=u.disableCheckbox,_=u.checked,y=p.props.context.onNodeCheck;if(!p.isCheckable()||f)return;l.preventDefault();var v=!_;y(l,Object(s.b)(p.props),v)},p.onMouseEnter=function(l){var u=p.props.context.onNodeMouseEnter;u(l,Object(s.b)(p.props))},p.onMouseLeave=function(l){var u=p.props.context.onNodeMouseLeave;u(l,Object(s.b)(p.props))},p.onContextMenu=function(l){var u=p.props.context.onNodeContextMenu;u(l,Object(s.b)(p.props))},p.onDragStart=function(l){var u=p.props.context.onNodeDragStart;l.stopPropagation(),p.setState({dragNodeHighlight:!0}),u(l,Object(O.a)(p));try{l.dataTransfer.setData("text/plain","")}catch(f){}},p.onDragEnter=function(l){var u=p.props.context.onNodeDragEnter;l.preventDefault(),l.stopPropagation(),u(l,Object(O.a)(p))},p.onDragOver=function(l){var u=p.props.context.onNodeDragOver;l.preventDefault(),l.stopPropagation(),u(l,Object(O.a)(p))},p.onDragLeave=function(l){var u=p.props.context.onNodeDragLeave;l.stopPropagation(),u(l,Object(O.a)(p))},p.onDragEnd=function(l){var u=p.props.context.onNodeDragEnd;l.stopPropagation(),p.setState({dragNodeHighlight:!1}),u(l,Object(O.a)(p))},p.onDrop=function(l){var u=p.props.context.onNodeDrop;l.preventDefault(),l.stopPropagation(),p.setState({dragNodeHighlight:!1}),u(l,Object(O.a)(p))},p.onExpand=function(l){var u=p.props.context.onNodeExpand;u(l,Object(s.b)(p.props))},p.setSelectHandle=function(l){p.selectHandle=l},p.getNodeState=function(){var l=p.props.expanded;return p.isLeaf()?null:l?o:t},p.hasChildren=function(){var l=p.props.eventKey,u=p.props.context.keyEntities,f=u[l]||{},_=f.children;return!!(_||[]).length},p.isLeaf=function(){var l=p.props,u=l.isLeaf,f=l.loaded,_=p.props.context.loadData,y=p.hasChildren();return u===!1?!1:u||!_&&!y||_&&f&&!y},p.isDisabled=function(){var l=p.props.disabled,u=p.props.context.disabled;return!!(u||l)},p.isCheckable=function(){var l=p.props.checkable,u=p.props.context.checkable;return!u||l===!1?!1:u},p.syncLoadData=function(l){var u=l.expanded,f=l.loading,_=l.loaded,y=p.props.context,v=y.loadData,N=y.onNodeLoad;if(f)return;v&&u&&!p.isLeaf()&&(!p.hasChildren()&&!_&&N(Object(s.b)(p.props)))},p.renderSwitcher=function(){var l=p.props,u=l.expanded,f=l.switcherIcon,_=p.props.context,y=_.prefixCls,v=_.switcherIcon,N=f||v;if(p.isLeaf())return T.createElement("span",{className:i()("".concat(y,"-switcher"),"".concat(y,"-switcher-noop"))},typeof N=="function"?N(Object(P.a)(Object(P.a)({},p.props),{},{isLeaf:!0})):N);var j=i()("".concat(y,"-switcher"),"".concat(y,"-switcher_").concat(u?o:t));return T.createElement("span",{onClick:p.onExpand,className:j},typeof N=="function"?N(Object(P.a)(Object(P.a)({},p.props),{},{isLeaf:!1})):N)},p.renderCheckbox=function(){var l=p.props,u=l.checked,f=l.halfChecked,_=l.disableCheckbox,y=p.props.context.prefixCls,v=p.isDisabled(),N=p.isCheckable();if(!N)return null;var j=typeof N!="boolean"?N:null;return T.createElement("span",{className:i()("".concat(y,"-checkbox"),u&&"".concat(y,"-checkbox-checked"),!u&&f&&"".concat(y,"-checkbox-indeterminate"),(v||_)&&"".concat(y,"-checkbox-disabled")),onClick:p.onCheck},j)},p.renderIcon=function(){var l=p.props.loading,u=p.props.context.prefixCls;return T.createElement("span",{className:i()("".concat(u,"-iconEle"),"".concat(u,"-icon__").concat(p.getNodeState()||"docu"),l&&"".concat(u,"-icon_loading"))})},p.renderSelector=function(){var l=p.state.dragNodeHighlight,u=p.props,f=u.title,_=u.selected,y=u.icon,v=u.loading,N=u.data,j=p.props.context,U=j.prefixCls,G=j.showIcon,z=j.icon,L=j.draggable,V=j.loadData,W=j.titleRender,$=p.isDisabled(),q="".concat(U,"-node-content-wrapper"),fe;if(G){var se=y||z;fe=se?T.createElement("span",{className:i()("".concat(U,"-iconEle"),"".concat(U,"-icon__customize"))},typeof se=="function"?se(p.props):se):p.renderIcon()}else V&&v&&(fe=p.renderIcon());var me;typeof f=="function"?me=f(N):W?me=W(N):me=f;var ve=T.createElement("span",{className:"".concat(U,"-title")},me);return T.createElement("span",{ref:p.setSelectHandle,title:typeof f=="string"?f:"",className:i()("".concat(q),"".concat(q,"-").concat(p.getNodeState()||"normal"),!$&&(_||l)&&"".concat(U,"-node-selected"),!$&&L&&"draggable"),draggable:!$&&L||void 0,"aria-grabbed":!$&&L||void 0,onMouseEnter:p.onMouseEnter,onMouseLeave:p.onMouseLeave,onContextMenu:p.onContextMenu,onClick:p.onSelectorClick,onDoubleClick:p.onSelectorDoubleClick,onDragStart:L?p.onDragStart:void 0},fe,ve)},p}return Object(R.a)(E,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var l=this.props.selectable,u=this.props.context.selectable;return typeof l=="boolean"?l:u}},{key:"render",value:function(){var l,u=this.props,f=u.eventKey,_=u.className,y=u.style,v=u.dragOver,N=u.dragOverGapTop,j=u.dragOverGapBottom,U=u.isLeaf,G=u.isStart,z=u.isEnd,L=u.expanded,V=u.selected,W=u.checked,$=u.halfChecked,q=u.loading,fe=u.domRef,se=u.active,me=u.onMouseMove,ve=Object(H.a)(u,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Ae=this.props.context,ge=Ae.prefixCls,ue=Ae.filterTreeNode,$e=Ae.draggable,Tt=Ae.keyEntities,ye=this.isDisabled(),Re=Object(c.f)(ve),nt=Tt[f]||{},Ue=nt.level,ke=z[z.length-1];return T.createElement("div",Object.assign({ref:fe,className:i()(_,"".concat(ge,"-treenode"),(l={},Object(Y.a)(l,"".concat(ge,"-treenode-disabled"),ye),Object(Y.a)(l,"".concat(ge,"-treenode-switcher-").concat(L?"open":"close"),!U),Object(Y.a)(l,"".concat(ge,"-treenode-checkbox-checked"),W),Object(Y.a)(l,"".concat(ge,"-treenode-checkbox-indeterminate"),$),Object(Y.a)(l,"".concat(ge,"-treenode-selected"),V),Object(Y.a)(l,"".concat(ge,"-treenode-loading"),q),Object(Y.a)(l,"".concat(ge,"-treenode-active"),se),Object(Y.a)(l,"".concat(ge,"-treenode-leaf-last"),ke),Object(Y.a)(l,"drag-over",!ye&&v),Object(Y.a)(l,"drag-over-gap-top",!ye&&N),Object(Y.a)(l,"drag-over-gap-bottom",!ye&&j),Object(Y.a)(l,"filter-node",ue&&ue(Object(s.b)(this.props))),l)),style:y,onDragEnter:$e?this.onDragEnter:void 0,onDragOver:$e?this.onDragOver:void 0,onDragLeave:$e?this.onDragLeave:void 0,onDrop:$e?this.onDrop:void 0,onDragEnd:$e?this.onDragEnd:void 0,onMouseMove:me},Re),T.createElement(a,{prefixCls:ge,level:Ue,isStart:G,isEnd:z}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),E}(T.Component),C=function(M){return T.createElement(d.a.Consumer,null,function(E){return T.createElement(g,Object.assign({},M,{context:E}))})};C.displayName="TreeNode",C.defaultProps={title:h},C.isTreeNode=1;var A=re.a=C},Xm8N:function(Ye,re,I){"use strict";var Y=I("2qtc"),H=I("kLXV"),P=I("miYZ"),F=I("tsqr"),R=I("9og8"),O=I("WmNS"),D=I.n(O),m=I("q1tI"),T=I.n(m),b=I("ErOA"),i=I("Ty5D"),d=I("9kvl"),c=function(a){var s=a.shixunHomeworks,o=a.dispatch,t=Object(i.i)();return T.a.createElement(H.a,{centered:!0,title:"\u63D0\u793A",visible:s.actionTabs.key==="\u6253\u56DE\u91CD\u505A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(R.a)(D.a.mark(function h(){var g,C,A,w;return D.a.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return E.next=2,Object(b.a)("/api/myshixuns/".concat(s.actionTabs.selectArrs.myshixun_identifier,"/reset_my_game.json"),{method:"GET",params:{course_id:t.coursesId}});case 2:g=E.sent,g.shixun_identifier&&(F.b.success("\u64CD\u4F5C\u6210\u529F"),o({type:"shixunHomeworks/setActionTabs",payload:{}}),w=g==null||((C=g.new_works)===null||C===void 0||((A=C.find(function(p){return"".concat(p.homework_common_id)===t.categoryId}))===null||A===void 0))?void 0:A.id,d.d.replace("/classrooms/".concat(t.coursesId,"/shixun_homework/").concat(t.categoryId,"/").concat(w,"/comment")));case 4:case"end":return E.stop()}},h)})),onCancel:function(){o({type:"shixunHomeworks/setActionTabs",payload:{}})}},T.a.createElement("p",null,"\u8BE5\u4F5C\u4E1A\u5C06\u88AB\u6253\u56DE\u91CD\u505A\uFF0C\u5B66\u751F\u5B9E\u8BAD\u8BB0\u5F55\u5C06\u88AB\u6E05\u7A7A!"),T.a.createElement("p",null,"\u786E\u5B9A\u6253\u56DE?"))};re.a=Object(d.a)(function(r){var a=r.shixunHomeworks;return{shixunHomeworks:a}})(c)},Xmg4:function(Ye,re,I){var Y=I("bYtY"),H=I("LPTA"),P=H.devicePixelRatio,F=I("K2GJ"),R=I("3C/r");function O(){return!1}function D(b,i,d){var c=Y.createCanvas(),r=i.getWidth(),a=i.getHeight(),s=c.style;return s&&(s.position="absolute",s.left=0,s.top=0,s.width=r+"px",s.height=a+"px",c.setAttribute("data-zr-dom-id",b)),c.width=r*d,c.height=a*d,c}var m=function(b,i,d){var c;d=d||P,typeof b=="string"?c=D(b,i,d):Y.isObject(b)&&(c=b,b=c.id),this.id=b,this.dom=c;var r=c.style;r&&(c.onselectstart=O,r["-webkit-user-select"]="none",r["user-select"]="none",r["-webkit-touch-callout"]="none",r["-webkit-tap-highlight-color"]="rgba(0,0,0,0)",r.padding=0,r.margin=0,r["border-width"]=0),this.domBack=null,this.ctxBack=null,this.painter=i,this.config=null,this.clearColor=0,this.motionBlur=!1,this.lastFrameAlpha=.7,this.dpr=d};m.prototype={constructor:m,__dirty:!0,__used:!1,__drawIndex:0,__startIndex:0,__endIndex:0,incremental:!1,getElementCount:function(){return this.__endIndex-this.__startIndex},initContext:function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},createBackBuffer:function(){var b=this.dpr;this.domBack=D("back-"+this.id,this.painter,b),this.ctxBack=this.domBack.getContext("2d"),b!==1&&this.ctxBack.scale(b,b)},resize:function(b,i){var d=this.dpr,c=this.dom,r=c.style,a=this.domBack;r&&(r.width=b+"px",r.height=i+"px"),c.width=b*d,c.height=i*d,a&&(a.width=b*d,a.height=i*d,d!==1&&this.ctxBack.scale(d,d))},clear:function(b,i){var d=this.dom,c=this.ctx,r=d.width,a=d.height,i=i||this.clearColor,s=this.motionBlur&&!b,o=this.lastFrameAlpha,t=this.dpr;if(s&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(d,0,0,r/t,a/t)),c.clearRect(0,0,r,a),i&&i!=="transparent"){var h;i.colorStops?(h=i.__canvasGradient||F.getGradient(c,i,{x:0,y:0,width:r,height:a}),i.__canvasGradient=h):i.image&&(h=R.prototype.getCanvasPattern.call(i,c)),c.save(),c.fillStyle=h||i,c.fillRect(0,0,r,a),c.restore()}if(s){var g=this.domBack;c.save(),c.globalAlpha=o,c.drawImage(g,0,0,r,a),c.restore()}}};var T=m;Ye.exports=T},Xnb7:function(Ye,re,I){var Y=I("1RvN"),H=new Y(50);function P(D){if(typeof D=="string"){var m=H.get(D);return m&&m.image}else return D}function F(D,m,T,b,i){if(D)if(typeof D=="string"){if(m&&m.__zrImageSrc===D||!T)return m;var d=H.get(D),c={hostEl:T,cb:b,cbPayload:i};return d?(m=d.image,!O(m)&&d.pending.push(c)):(m=new Image,m.onload=m.onerror=R,H.put(D,m.__cachedImgObj={image:m,pending:[c]}),m.src=m.__zrImageSrc=D),m}else return D;else return m}function R(){var D=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var m=0;m<D.pending.length;m++){var T=D.pending[m],b=T.cb;b&&b(this,T.cbPayload),T.hostEl.dirty()}D.pending.length=0}function O(D){return D&&D.width&&D.height}re.findExistImage=P,re.createOrUpdateImage=F,re.isImageReady=O},Y1PL:function(Ye,re,I){"use strict";I.r(re),I.d(re,"ResizableTextArea",function(){return $});var Y=I("wx14"),H=I("1OyB"),P=I("vuIU"),F=I("Ji7U"),R=I("LK+K"),O=I("q1tI"),D=I("VTBJ"),m=I("rePB"),T=I("Zm9Q"),b=I("Kwbf"),i=I("c+Xe"),d=I("m+aA"),c=I("bdgK"),r=new Map;function a(se){se.forEach(function(me){var ve,Ae=me.target;(ve=r.get(Ae))===null||ve===void 0||ve.forEach(function(ge){return ge(Ae)})})}var s=new c.default(a),o=null,t=null;function h(se,me){r.has(se)||(r.set(se,new Set),s.observe(se)),r.get(se).add(me)}function g(se,me){r.has(se)&&(r.get(se).delete(me),r.get(se).size||(s.unobserve(se),r.delete(se)))}var C=function(se){Object(F.a)(ve,se);var me=Object(R.a)(ve);function ve(){return Object(H.a)(this,ve),me.apply(this,arguments)}return Object(P.a)(ve,[{key:"render",value:function(){return this.props.children}}]),ve}(O.Component),A=O.createContext(null);function w(se){var me=se.children,ve=se.onBatchResize,Ae=O.useRef(0),ge=O.useRef([]),ue=O.useContext(A),$e=O.useCallback(function(Tt,ye,Re){Ae.current+=1;var nt=Ae.current;ge.current.push({size:Tt,element:ye,data:Re}),Promise.resolve().then(function(){nt===Ae.current&&(ve==null||ve(ge.current),ge.current=[])}),ue==null||ue(Tt,ye,Re)},[ve,ue]);return O.createElement(A.Provider,{value:$e},me)}function M(se){var me=se.children,ve=se.disabled,Ae=O.useRef(null),ge=O.useRef(null),ue=O.useContext(A),$e=O.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Tt=O.isValidElement(me)&&Object(i.c)(me),ye=Tt?me.ref:null,Re=O.useMemo(function(){return Object(i.a)(ye,Ae)},[ye,Ae]),nt=O.useRef(se);nt.current=se;var Ue=O.useCallback(function(ke){var lt=nt.current,Fe=lt.onResize,Ze=lt.data,Xe=ke.getBoundingClientRect(),ft=Xe.width,Rt=Xe.height,Pt=ke.offsetWidth,Bt=ke.offsetHeight,Ve=Math.floor(ft),Ft=Math.floor(Rt);if($e.current.width!==Ve||$e.current.height!==Ft||$e.current.offsetWidth!==Pt||$e.current.offsetHeight!==Bt){var nn={width:Ve,height:Ft,offsetWidth:Pt,offsetHeight:Bt};$e.current=nn;var Le=Pt===Math.round(ft)?ft:Pt,Se=Bt===Math.round(Rt)?Rt:Bt,ut=Object(D.a)(Object(D.a)({},nn),{},{offsetWidth:Le,offsetHeight:Se});ue==null||ue(ut,ke,Ze),Fe&&Promise.resolve().then(function(){Fe(ut,ke)})}},[]);return O.useEffect(function(){var ke=Object(d.a)(Ae.current)||Object(d.a)(ge.current);return ke&&!ve&&h(ke,Ue),function(){return g(ke,Ue)}},[Ae.current,ve]),O.createElement(C,{ref:ge},Tt?O.cloneElement(me,{ref:Re}):me)}var E="rc-observer-key";function p(se){var me=se.children,ve=Object(T.a)(me);return ve.map(function(Ae,ge){var ue=(Ae==null?void 0:Ae.key)||"".concat(E,"-").concat(ge);return O.createElement(M,Object(Y.a)({},se,{key:ue}),Ae)})}p.Collection=w;var l=p,u=I("bT9E"),f=I("TSYQ"),_=I.n(f),y=`
|
|
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
|
|
`,v=["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"],N={},j;function U(se){var me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ve=se.getAttribute("id")||se.getAttribute("data-reactid")||se.getAttribute("name");if(me&&N[ve])return N[ve];var Ae=window.getComputedStyle(se),ge=Ae.getPropertyValue("box-sizing")||Ae.getPropertyValue("-moz-box-sizing")||Ae.getPropertyValue("-webkit-box-sizing"),ue=parseFloat(Ae.getPropertyValue("padding-bottom"))+parseFloat(Ae.getPropertyValue("padding-top")),$e=parseFloat(Ae.getPropertyValue("border-bottom-width"))+parseFloat(Ae.getPropertyValue("border-top-width")),Tt=v.map(function(Re){return"".concat(Re,":").concat(Ae.getPropertyValue(Re))}).join(";"),ye={sizingStyle:Tt,paddingSize:ue,borderSize:$e,boxSizing:ge};return me&&ve&&(N[ve]=ye),ye}function G(se){var me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Ae=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;j||(j=document.createElement("textarea"),j.setAttribute("tab-index","-1"),j.setAttribute("aria-hidden","true"),document.body.appendChild(j)),se.getAttribute("wrap")?j.setAttribute("wrap",se.getAttribute("wrap")):j.removeAttribute("wrap");var ge=U(se,me),ue=ge.paddingSize,$e=ge.borderSize,Tt=ge.boxSizing,ye=ge.sizingStyle;j.setAttribute("style","".concat(ye,";").concat(y)),j.value=se.value||se.placeholder||"";var Re=Number.MIN_SAFE_INTEGER,nt=Number.MAX_SAFE_INTEGER,Ue=j.scrollHeight,ke;if(Tt==="border-box"?Ue+=$e:Tt==="content-box"&&(Ue-=ue),ve!==null||Ae!==null){j.value=" ";var lt=j.scrollHeight-ue;ve!==null&&(Re=lt*ve,Tt==="border-box"&&(Re=Re+ue+$e),Ue=Math.max(Re,Ue)),Ae!==null&&(nt=lt*Ae,Tt==="border-box"&&(nt=nt+ue+$e),ke=Ue>nt?"":"hidden",Ue=Math.min(nt,Ue))}return{height:Ue,minHeight:Re,maxHeight:nt,overflowY:ke,resize:"none"}}var z=I("Gytx"),L=I.n(z),V;(function(se){se[se.NONE=0]="NONE",se[se.RESIZING=1]="RESIZING",se[se.RESIZED=2]="RESIZED"})(V||(V={}));var W=function(se){Object(F.a)(ve,se);var me=Object(R.a)(ve);function ve(Ae){var ge;return Object(H.a)(this,ve),ge=me.call(this,Ae),ge.nextFrameActionId=void 0,ge.resizeFrameId=void 0,ge.textArea=void 0,ge.saveTextArea=function(ue){ge.textArea=ue},ge.handleResize=function(ue){var $e=ge.state.resizeStatus,Tt=ge.props,ye=Tt.autoSize,Re=Tt.onResize;if($e!==V.NONE)return;typeof Re=="function"&&Re(ue),ye&&ge.resizeOnNextFrame()},ge.resizeOnNextFrame=function(){cancelAnimationFrame(ge.nextFrameActionId),ge.nextFrameActionId=requestAnimationFrame(ge.resizeTextarea)},ge.resizeTextarea=function(){var ue=ge.props.autoSize;if(!ue||!ge.textArea)return;var $e=ue.minRows,Tt=ue.maxRows,ye=G(ge.textArea,!1,$e,Tt);ge.setState({textareaStyles:ye,resizeStatus:V.RESIZING},function(){cancelAnimationFrame(ge.resizeFrameId),ge.resizeFrameId=requestAnimationFrame(function(){ge.setState({resizeStatus:V.RESIZED},function(){ge.resizeFrameId=requestAnimationFrame(function(){ge.setState({resizeStatus:V.NONE}),ge.fixFirefoxAutoScroll()})})})})},ge.renderTextArea=function(){var ue=ge.props,$e=ue.prefixCls,Tt=$e===void 0?"rc-textarea":$e,ye=ue.autoSize,Re=ue.onResize,nt=ue.className,Ue=ue.disabled,ke=ge.state,lt=ke.textareaStyles,Fe=ke.resizeStatus,Ze=Object(u.a)(ge.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Xe=_()(Tt,nt,Object(m.a)({},"".concat(Tt,"-disabled"),Ue));"value"in Ze&&(Ze.value=Ze.value||"");var ft=Object(D.a)(Object(D.a)(Object(D.a)({},ge.props.style),lt),Fe===V.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return O.createElement(l,{onResize:ge.handleResize,disabled:!(ye||Re)},O.createElement("textarea",Object(Y.a)({},Ze,{className:Xe,style:ft,ref:ge.saveTextArea})))},ge.state={textareaStyles:{},resizeStatus:V.NONE},ge}return Object(P.a)(ve,[{key:"componentDidUpdate",value:function(ge){(ge.value!==this.props.value||!L()(ge.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 ge=this.textArea.selectionStart,ue=this.textArea.selectionEnd;this.textArea.setSelectionRange(ge,ue)}}catch($e){}}},{key:"render",value:function(){return this.renderTextArea()}}]),ve}(O.Component),$=W,q=function(se){Object(F.a)(ve,se);var me=Object(R.a)(ve);function ve(Ae){var ge;Object(H.a)(this,ve),ge=me.call(this,Ae),ge.resizableTextArea=void 0,ge.focus=function(){ge.resizableTextArea.textArea.focus()},ge.saveTextArea=function($e){ge.resizableTextArea=$e},ge.handleChange=function($e){var Tt=ge.props.onChange;ge.setValue($e.target.value,function(){ge.resizableTextArea.resizeTextarea()}),Tt&&Tt($e)},ge.handleKeyDown=function($e){var Tt=ge.props,ye=Tt.onPressEnter,Re=Tt.onKeyDown;$e.keyCode===13&&ye&&ye($e),Re&&Re($e)};var ue=typeof Ae.value=="undefined"||Ae.value===null?Ae.defaultValue:Ae.value;return ge.state={value:ue},ge}return Object(P.a)(ve,[{key:"setValue",value:function(ge,ue){"value"in this.props||this.setState({value:ge},ue)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return O.createElement($,Object(Y.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ge){return"value"in ge?{value:ge.value}:null}}]),ve}(O.Component),fe=re.default=q},YH21:function(Ye,re,I){var Y=I("H6uX");re.Dispatcher=Y;var H=I("ItGF"),P=I("Ze12"),F=P.isCanvasEl,R=P.transformCoordWithViewport,O=typeof window!="undefined"&&!!window.addEventListener,D=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,m=[];function T(t,h,g,C){return g=g||{},C||!H.canvasSupported?b(t,h,g):H.browser.firefox&&h.layerX!=null&&h.layerX!==h.offsetX?(g.zrX=h.layerX,g.zrY=h.layerY):h.offsetX!=null?(g.zrX=h.offsetX,g.zrY=h.offsetY):b(t,h,g),g}function b(t,h,g){if(H.domSupported&&t.getBoundingClientRect){var C=h.clientX,A=h.clientY;if(F(t)){var w=t.getBoundingClientRect();g.zrX=C-w.left,g.zrY=A-w.top;return}else if(R(m,t,C,A)){g.zrX=m[0],g.zrY=m[1];return}}g.zrX=g.zrY=0}function i(t){return t||window.event}function d(t,h,g){if(h=i(h),h.zrX!=null)return h;var C=h.type,A=C&&C.indexOf("touch")>=0;if(!A)T(t,h,h,g),h.zrDelta=h.wheelDelta?h.wheelDelta/120:-(h.detail||0)/3;else{var w=C!=="touchend"?h.targetTouches[0]:h.changedTouches[0];w&&T(t,w,h,g)}var M=h.button;return h.which==null&&M!==void 0&&D.test(h.type)&&(h.which=M&1?1:M&2?3:M&4?2:0),h}function c(t,h,g,C){O?t.addEventListener(h,g,C):t.attachEvent("on"+h,g)}function r(t,h,g,C){O?t.removeEventListener(h,g,C):t.detachEvent("on"+h,g)}var a=O?function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0}:function(t){t.returnValue=!1,t.cancelBubble=!0};function s(t){return t.which===2||t.which===3}function o(t){return t.which>1}re.clientToLocal=T,re.getNativeEvent=i,re.normalizeEvent=d,re.addEventListener=c,re.removeEventListener=r,re.stop=a,re.isMiddleOrRightButtonOnMouseUpDown=s,re.notLeftMouse=o},YgsL:function(Ye,re,I){var Y=I("QBsz"),H=Y.distance;function P(R,O,D,m,T,b,i){var d=(D-R)*.5,c=(m-O)*.5;return(2*(O-D)+d+c)*i+(-3*(O-D)-2*d-c)*b+d*T+O}function F(R,O){for(var D=R.length,m=[],T=0,b=1;b<D;b++)T+=H(R[b-1],R[b]);var i=T/2;i=i<D?D:i;for(var b=0;b<i;b++){var d=b/(i-1)*(O?D:D-1),c=Math.floor(d),r=d-c,a,s=R[c%D],o,t;O?(a=R[(c-1+D)%D],o=R[(c+1)%D],t=R[(c+2)%D]):(a=R[c===0?c:c-1],o=R[c>D-2?D-1:c+1],t=R[c>D-3?D-1:c+2]);var h=r*r,g=r*h;m.push([P(a[0],s[0],o[0],t[0],r,h,g),P(a[1],s[1],o[1],t[1],r,h,g)])}return m}Ye.exports=F},ZW9T:function(Ye,re,I){"use strict";I.d(re,"a",function(){return G});var Y=I("k1fw"),H=I("miYZ"),P=I("tsqr"),F=I("rAM+"),R=I("tJVT"),O=I("PpiC"),D=I("q1tI"),m=I.n(D),T=I("bdgK"),b=I("oBTY"),i=I("9og8"),d=I("WmNS"),c=I.n(d),r={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},a={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
|
|
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
|
|
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},s={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","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(`
|
|
`)}]},o={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
|
|
`)}]},t=I("5VLF"),h=I.n(t),g={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"]}},C=function(L,V){return V.map(function(W){return{label:W,kind:L.languages.CompletionItemKind.Keyword,insertText:W}})},A=function(L){return Object.keys(g.tables).map(function(V){return{label:V,kind:L.languages.CompletionItemKind.Variable,insertText:V}})},w=function(L,V){var W=g.tables[L];return W?W.map(function($){return{label:$,kind:V.languages.CompletionItemKind.Field,insertText:$}}):[]};function M(z,L,V,W,$){var q=L.getWordUntilPosition(V),fe={startLineNumber:V.lineNumber,endLineNumber:V.lineNumber,startColumn:q.startColumn,endColumn:q.endColumn},se=W.map(function(me){return{label:me,kind:z.languages.CompletionItemKind.Keyword,insertText:me,insertTextRules:z.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:fe}});return $.map(function(me){se.push(Object(Y.a)(Object(Y.a)({},me),{},{range:fe}))}),se}var E=function(z){g.languages.map(function($){return z.languages.registerDocumentFormattingEditProvider($,{provideDocumentFormattingEdits:function(fe,se,me){return Object(i.a)(c.a.mark(function ve(){var Ae;return c.a.wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:return Ae=h()(fe.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),ue.abrupt("return",[{range:fe.getFullModelRange(),text:Ae}]);case 2:case"end":return ue.stop()}},ve)}))()}}),$});var L=s.quickKey.map(function($){return{label:$.label,kind:z.languages.CompletionItemKind.Method,insertText:$.content,insertTextRules:z.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),V=o.quickKey.map(function($){return{label:$.label,kind:z.languages.CompletionItemKind.Method,insertText:$.content,insertTextRules:z.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),W=a.quickKey.map(function($){return{label:$.label,kind:z.languages.CompletionItemKind.Method,insertText:$.content,insertTextRules:z.languages.CompletionItemInsertTextRule.InsertAsSnippet}});z.languages.registerCompletionItemProvider("cpp",{triggerCharacters:["."," ","#"].concat(Object(b.a)(s.keywords),Object(b.a)(s.quickKey.map(function($){return $.label}))),provideCompletionItems:function(q,fe){var se=q.getValueInRange({startLineNumber:fe.lineNumber,startColumn:1,endLineNumber:fe.lineNumber,endColumn:fe.column}),me=se.match(/cu/gim);console.log("match:",me,fe,se,q);var ve=[],Ae=fe.lineNumber,ge=fe.column,ue=q.getValueInRange({startLineNumber:Ae,startColumn:0,endLineNumber:Ae,endColumn:ge}),$e=ue.trim().split(/\s+/),Tt=$e[$e.length-1];if(Tt.endsWith(".")){var ye=Tt.slice(0,Tt.length-1);Object.keys(g.tables).includes(ye)&&(ve=Object(b.a)(w(ye,z)))}else Tt==="."?ve=[]:ve=[].concat(Object(b.a)(A(z)),Object(b.a)(C(z,s.keywords)),Object(b.a)(L));return{suggestions:ve}}}),z.languages.registerCompletionItemProvider("c",{triggerCharacters:["."," ","#"].concat(Object(b.a)(r.keywords)),provideCompletionItems:function(q,fe){var se=q.getValueInRange({startLineNumber:fe.lineNumber,startColumn:1,endLineNumber:fe.lineNumber,endColumn:fe.column}),me=se.match(/cu/gim);console.log("match:",me,fe,se,q);var ve=[],Ae=fe.lineNumber,ge=fe.column,ue=q.getValueInRange({startLineNumber:Ae,startColumn:0,endLineNumber:Ae,endColumn:ge}),$e=ue.trim().split(/\s+/),Tt=$e[$e.length-1];if(Tt.endsWith(".")){var ye=Tt.slice(0,Tt.length-1);Object.keys(g.tables).includes(ye)&&(ve=Object(b.a)(w(ye,z)))}else Tt==="."?ve=[]:ve=[].concat(Object(b.a)(A(z)),Object(b.a)(C(z,r.keywords)));return{suggestions:ve}}}),z.languages.registerCompletionItemProvider("java",{triggerCharacters:["."," "].concat(Object(b.a)(a.keywords)),provideCompletionItems:function(q,fe){var se=[],me=fe.lineNumber,ve=fe.column,Ae=q.getValueInRange({startLineNumber:me,startColumn:0,endLineNumber:me,endColumn:ve}),ge=Ae.trim().split(/\s+/),ue=ge[ge.length-1];if(ue.endsWith(".")){var $e=ue.slice(0,ue.length-1);Object.keys(g.tables).includes($e)&&(se=Object(b.a)(w($e,z)))}else ue==="."?se=[]:se=[].concat(Object(b.a)(A(z)),Object(b.a)(C(z,a.keywords)),Object(b.a)(W));return{suggestions:se}}}),z.languages.registerCompletionItemProvider("python",{triggerCharacters:["."," "].concat(Object(b.a)(o.keywords)),provideCompletionItems:function(q,fe){var se=[],me=fe.lineNumber,ve=fe.column,Ae=q.getValueInRange({startLineNumber:me,startColumn:0,endLineNumber:me,endColumn:ve}),ge=Ae.trim().split(/\s+/),ue=ge[ge.length-1];if(ue.endsWith(".")){var $e=ue.slice(0,ue.length-1);Object.keys(g.tables).includes($e)&&(se=Object(b.a)(w($e,z)))}else ue==="."?se=[]:se=[].concat(Object(b.a)(A(z)),Object(b.a)(C(z,o.keywords)),Object(b.a)(V));return{suggestions:se}}})},p="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",l=I("LvDl"),u=I("+ua5");function f(z){return/^\d+$/.test(z)?"".concat(z,"px"):z}function _(){}var y=!1,v={"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 N(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],L=z;if(Array.isArray(z)){for(var V=0;V<z.length;V++){var W=v[z[V]];if(W)return W}return L[0]}return v[L]||L}var j=null,U=re.b=function(z){var L=z.width,V=L===void 0?"100%":L,W=z.height,$=W===void 0?"100%":W,q=z.value,fe=z.language,se=fe===void 0?"javascript":fe,me=z.style,ve=me===void 0?{}:me,Ae=z.options,ge=Ae===void 0?{}:Ae,ue=z.overrideServices,$e=ue===void 0?{}:ue,Tt=z.theme,ye=Tt===void 0?"vs-dark":Tt,Re=z.onEditBlur,nt=z.onSave,Ue=z.autoHeight,ke=Ue===void 0?!1:Ue,lt=z.forbidCopy,Fe=lt===void 0?!1:lt,Ze=z.onChange,Xe=Ze===void 0?_:Ze,ft=z.editorDidMount,Rt=ft===void 0?_:ft,Pt=z.onFocus,Bt=Pt===void 0?_:Pt,Ve=z.filename,Ft=Ve===void 0?"educoder.txt":Ve,nn=z.errorLine,Le=z.errorContent,Se=Le===void 0?"":Le,ut=Object(O.a)(z,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),mt=Object(D.useRef)(),We=Object(D.useRef)({}),vt=Object(D.useRef)(),Pe=Object(D.useRef)(!1),xe=Object(D.useRef)(),we=Object(D.useState)(!1),ie=Object(R.a)(we,2),ae=ie[0],ce=ie[1];function be(){var De;return mt.current&&(De=new T.default(function(qe){var jt=Object(F.a)(qe),Zt;try{for(jt.s();!(Zt=jt.n()).done;){var gn=Zt.value;(gn.target.offsetHeight>0||gn.target.offsetWidth>0)&&We.current.instance.layout()}}catch(On){jt.e(On)}finally{jt.f()}}),De.observe(mt.current)),De}function Ce(){P.b.warn(decodeURIComponent(p))}var Be=function(){var qe=We.current.instance;if(q!=null&&qe&&ae){var jt=qe.getModel();jt&&q!==jt.getValue()&&(y=!0,jt.setValue(q),qe.layout(),y=!1)}};Object(D.useEffect)(function(){vt.current&&clearTimeout(vt.current),vt.current=setTimeout(function(){Be()},500)},[q,ae,We.current]),Object(D.useEffect)(function(){if(nn&&We.current&&We.current.instance){var De=We.current.instance;De.changeViewZones(function(jt){var Zt=document.createElement("div");Zt.style.padding="10px 20px",Zt.style.width="calc(100% - 20px)",Zt.className="my-error-line-wrp",Zt.innerHTML=Se,jt.addZone({afterLineNumber:nn||11,heightInLines:3,domNode:Zt})});var qe={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}};De.addOverlayWidget(qe),De.revealPositionInCenter({lineNumber:20,column:1})}},[nn,We.current,ae]);function yt(){var De=We.current.instance;if(De){var qe=De.getSelection(),jt=We.current.pastePos||{},Zt=new j.Range(jt.startLineNumber||qe.endLineNumber,jt.startColumn||qe.endColumn,jt.endLineNumber||qe.endLineNumber,jt.endColumn||qe.endColumn);setTimeout(function(){De.executeEdits("",[{range:Zt,text:""}])},300)}}function Xt(De){(window.navigator.platform.match("Mac")?De.metaKey:De.ctrlKey)&&De.keyCode==83&&(De.preventDefault(),nt())}var an=function(){if(ke&&We.current.instance){var qe=We.current.instance.getContentHeight();zt(qe<$?$:qe)}else zt($)};function pt(De){var qe=document.createEvent("MouseEvents");qe.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),De.dispatchEvent(qe)}function Yt(De,qe){var jt=window.URL||window.webkitURL||window,Zt=new Blob([qe]),gn=document.createElementNS("http://www.w3.org/1999/xhtml","a");gn.href=jt.createObjectURL(Zt),gn.download=De,pt(gn)}Object(D.useEffect)(function(){an()},[an]),Object(D.useEffect)(function(){mt.current&&!ae&&I.e(27).then(I.t.bind(null,"M/lh",7)).then(function(De){try{j=De,We.current.instance=j.editor.create(mt.current,{value:q,language:N(se),theme:ye,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},$e);var qe=We.current.instance;if(Rt(qe,j),setTimeout(function(){an(),We.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Yt(Ft||"educoder.txt",qe.getValue())}})},500),We.current.subscription=qe.onDidChangeModelContent(function(Zt){Pe.current?clearTimeout(xe.current):(an(),Xe(qe.getValue(),Zt)),xe.current=setTimeout(function(){Pe.current=!1},500)}),window.Monaco||E(j),Fe&&(qe.addCommand(j.KeyMod.CtrlCmd|j.KeyMod.Shift|j.KeyCode.KEY_V,function(){return Ce(),null}),qe.addCommand(j.KeyMod.CtrlCmd|j.KeyCode.KEY_C,function(){return Ce(),null})),window.Monaco=j,Re&&qe.onDidBlurEditorWidget(function(){Re(qe.getValue())}),Bt&&qe.onDidFocusEditorText(function(){Bt(qe.getValue())}),Fe){qe.addCommand(j.KeyMod.CtrlCmd|j.KeyCode.KEY_V,function(){return Ce(),null}),qe.onDidPaste(function(Zt){We.current.pastePos=Zt});try{window.addEventListener("paste",yt)}catch(Zt){}}var jt=be();return ce(!0),function(){var Zt=We.current.instance;Zt.dispose();var gn=Zt.getModel();gn&&gn.dispose(),We.current.subscription&&We.current.subscription.dispose(),Fe&&window.removeEventListener("paste",yt),jt.unobserve(mt.current)}}catch(Zt){}})},[]),Object(D.useEffect)(function(){var De=We.current.instance;if(De&&ae)return document.addEventListener("keydown",Xt,!1),function(){document.removeEventListener("keydown",Xt)}},[nt,ae]),Object(D.useEffect)(function(){var De=We.current.instance;if(De&&ae){var qe=N(se);j.editor.setModelLanguage(De.getModel(),qe),console.log("language:",se,De.getModel(),qe)}},[se,ae]),Object(D.useEffect)(function(){var De=We.current.instance;De&&ae&&j.editor.setTheme(ye)},[ye,ae]),Object(D.useEffect)(function(){var De=We.current.instance;De&&ae&&(De.updateOptions(Object(Y.a)({},ge)),setTimeout(function(){De.getModel().updateOptions(Object(Y.a)({},ge))},200))},[JSON.stringify(ge),ae]),Object(D.useEffect)(function(){var De=We.current.instance;De&&ae&&De.layout()},[V,$,ae]);var St=Object(D.useState)(f(V)),Ot=Object(R.a)(St,2),dt=Ot[0],_e=Ot[1],je=Object(D.useState)(f($)),kt=Object(R.a)(je,2),gt=kt[0],zt=kt[1],$t=Object(Y.a)(Object(Y.a)({},ve),{},{width:dt,height:gt});return m.a.createElement("div",{className:"my-monaco-editor",ref:mt,style:$t})};function G(z){var L=z.width,V=L===void 0?"100%":L,W=z.height,$=W===void 0?"100%":W,q=z.original,fe=z.modified,se=z.language,me=z.options,ve=me===void 0?{}:me,Ae=Object(D.useRef)(),ge=Object(D.useState)(null),ue=Object(R.a)(ge,2),$e=ue[0],Tt=ue[1];function ye(ke){var lt;return Ae.current&&(lt=new T.default(function(Fe){var Ze=Object(F.a)(Fe),Xe;try{for(Ze.s();!(Xe=Ze.n()).done;){var ft=Xe.value;(ft.target.offsetHeight>0||ft.target.offsetWidth>0)&&ke.layout()}}catch(Rt){Ze.e(Rt)}finally{Ze.f()}}),lt.observe(Ae.current)),lt}Object(D.useEffect)(function(){Ae.current&&I.e(27).then(I.t.bind(null,"M/lh",7)).then(function(ke){j=ke;var lt=j.editor.createDiffEditor(Ae.current,Object(Y.a)(Object(Y.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},ve),{},{wordWrap:!0}));Tt(lt);var Fe=ye(lt);return function(){lt.dispose();var Ze=lt.getModel();Ze&&Ze.dispose(),Fe.unobserve(Ae.current)}})},[]),Object(D.useEffect)(function(){$e&&$e.setModel({original:j.editor.createModel(q,se),modified:j.editor.createModel(fe,se)})},[q,fe,se,$e]);var Re=f(V),nt=f($),Ue={width:Re,height:nt};return m.a.createElement("div",{className:"my-diff-editor",ref:Ae,style:Ue})}},Ze12:function(Ye,re,I){var Y=I("ItGF"),H=I("hOwI"),P=H.buildTransformer,F="___zrEVENTSAVED",R=[];function O(i,d,c,r,a){return D(R,d,r,a,!0)&&D(i,c,R[0],R[1])}function D(i,d,c,r,a){if(d.getBoundingClientRect&&Y.domSupported&&!b(d)){var s=d[F]||(d[F]={}),o=m(d,s),t=T(o,s,a);if(t)return t(i,c,r),!0}return!1}function m(i,d){var c=d.markers;if(c)return c;c=d.markers=[];for(var r=["left","right"],a=["top","bottom"],s=0;s<4;s++){var o=document.createElement("div"),t=o.style,h=s%2,g=(s>>1)%2;t.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",r[h]+":0",a[g]+":0",r[1-h]+":auto",a[1-g]+":auto",""].join("!important;"),i.appendChild(o),c.push(o)}return c}function T(i,d,c){for(var r=c?"invTrans":"trans",a=d[r],s=d.srcCoords,o=!0,t=[],h=[],g=0;g<4;g++){var C=i[g].getBoundingClientRect(),A=2*g,w=C.left,M=C.top;t.push(w,M),o=o&&s&&w===s[A]&&M===s[A+1],h.push(i[g].offsetLeft,i[g].offsetTop)}return o&&a?a:(d.srcCoords=t,d[r]=c?P(h,t):P(t,h))}function b(i){return i.nodeName.toUpperCase()==="CANVAS"}re.transformLocalCoord=O,re.transformCoordWithViewport=D,re.isCanvasEl=b},ZpRC:function(Ye,re,I){"use strict";function Y(i){return typeof i=="object"&&i!=null&&i.nodeType===1}function H(i,d){return(!d||i!=="hidden")&&i!=="visible"&&i!=="clip"}function P(i,d){if(i.clientHeight<i.scrollHeight||i.clientWidth<i.scrollWidth){var c=getComputedStyle(i,null);return H(c.overflowY,d)||H(c.overflowX,d)||function(r){var a=function(s){if(!s.ownerDocument||!s.ownerDocument.defaultView)return null;try{return s.ownerDocument.defaultView.frameElement}catch(o){return null}}(r);return!!a&&(a.clientHeight<r.scrollHeight||a.clientWidth<r.scrollWidth)}(i)}return!1}function F(i,d,c,r,a,s,o,t){return s<i&&o>d||s>i&&o<d?0:s<=i&&t<=c||o>=d&&t>=c?s-i-r:o>d&&t<c||s<i&&t>c?o-d+a:0}var R=function(i,d){var c=window,r=d.scrollMode,a=d.block,s=d.inline,o=d.boundary,t=d.skipOverflowHiddenElements,h=typeof o=="function"?o:function(lt){return lt!==o};if(!Y(i))throw new TypeError("Invalid target");for(var g=document.scrollingElement||document.documentElement,C=[],A=i;Y(A)&&h(A);){if((A=A.parentElement)===g){C.push(A);break}A!=null&&A===document.body&&P(A)&&!P(document.documentElement)||A!=null&&P(A,t)&&C.push(A)}for(var w=c.visualViewport?c.visualViewport.width:innerWidth,M=c.visualViewport?c.visualViewport.height:innerHeight,E=window.scrollX||pageXOffset,p=window.scrollY||pageYOffset,l=i.getBoundingClientRect(),u=l.height,f=l.width,_=l.top,y=l.right,v=l.bottom,N=l.left,j=a==="start"||a==="nearest"?_:a==="end"?v:_+u/2,U=s==="center"?N+f/2:s==="end"?y:N,G=[],z=0;z<C.length;z++){var L=C[z],V=L.getBoundingClientRect(),W=V.height,$=V.width,q=V.top,fe=V.right,se=V.bottom,me=V.left;if(r==="if-needed"&&_>=0&&N>=0&&v<=M&&y<=w&&_>=q&&v<=se&&N>=me&&y<=fe)return G;var ve=getComputedStyle(L),Ae=parseInt(ve.borderLeftWidth,10),ge=parseInt(ve.borderTopWidth,10),ue=parseInt(ve.borderRightWidth,10),$e=parseInt(ve.borderBottomWidth,10),Tt=0,ye=0,Re="offsetWidth"in L?L.offsetWidth-L.clientWidth-Ae-ue:0,nt="offsetHeight"in L?L.offsetHeight-L.clientHeight-ge-$e:0;if(g===L)Tt=a==="start"?j:a==="end"?j-M:a==="nearest"?F(p,p+M,M,ge,$e,p+j,p+j+u,u):j-M/2,ye=s==="start"?U:s==="center"?U-w/2:s==="end"?U-w:F(E,E+w,w,Ae,ue,E+U,E+U+f,f),Tt=Math.max(0,Tt+p),ye=Math.max(0,ye+E);else{Tt=a==="start"?j-q-ge:a==="end"?j-se+$e+nt:a==="nearest"?F(q,se,W,ge,$e+nt,j,j+u,u):j-(q+W/2)+nt/2,ye=s==="start"?U-me-Ae:s==="center"?U-(me+$/2)+Re/2:s==="end"?U-fe+ue+Re:F(me,fe,$,Ae,ue+Re,U,U+f,f);var Ue=L.scrollLeft,ke=L.scrollTop;j+=ke-(Tt=Math.max(0,Math.min(ke+Tt,L.scrollHeight-W+nt))),U+=Ue-(ye=Math.max(0,Math.min(Ue+ye,L.scrollWidth-$+Re)))}G.push({el:L,top:Tt,left:ye})}return G};function O(i){return i===Object(i)&&Object.keys(i).length!==0}function D(i,d){d===void 0&&(d="auto");var c="scrollBehavior"in document.body.style;i.forEach(function(r){var a=r.el,s=r.top,o=r.left;a.scroll&&c?a.scroll({top:s,left:o,behavior:d}):(a.scrollTop=s,a.scrollLeft=o)})}function m(i){return i===!1?{block:"end",inline:"nearest"}:O(i)?i:{block:"start",inline:"nearest"}}function T(i,d){var c=!i.ownerDocument.documentElement.contains(i);if(O(d)&&typeof d.behavior=="function")return d.behavior(c?[]:R(i,d));if(c)return;var r=m(d);return D(R(i,r),r.behavior)}var b=re.a=T},aKvl:function(Ye,re,I){var Y=I("Sj9i"),H=Y.quadraticProjectPoint;function P(F,R,O,D,m,T,b,i,d){if(b===0)return!1;var c=b;if(d>R+c&&d>D+c&&d>T+c||d<R-c&&d<D-c&&d<T-c||i>F+c&&i>O+c&&i>m+c||i<F-c&&i<O-c&&i<m-c)return!1;var r=H(F,R,O,D,m,T,i,d,null);return r<=c/2}re.containStroke=P},aX58:function(Ye,re,I){var Y=I("3gBT"),H=I("ItGF"),P=I("bYtY"),F=I("0s+r"),R=I("r6Bn"),O=I("7SHv"),D=I("MKOG"),m=I("zarK");/*!
|
|
* ZRender, a high performance 2d drawing library.
|
|
*
|
|
* Copyright (c) 2013, Baidu Inc.
|
|
* All rights reserved.
|
|
*
|
|
* LICENSE
|
|
* https://github.com/ecomfe/zrender/blob/master/LICENSE.txt
|
|
*/var T=!H.canvasSupported,b={canvas:O},i={},d="4.3.1";function c(h,g){var C=new t(Y(),h,g);return i[C.id]=C,C}function r(h){if(h)h.dispose();else{for(var g in i)i.hasOwnProperty(g)&&i[g].dispose();i={}}return this}function a(h){return i[h]}function s(h,g){b[h]=g}function o(h){delete i[h]}var t=function(h,g,C){C=C||{},this.dom=g,this.id=h;var A=this,w=new R,M=C.renderer;if(T){if(!b.vml)throw new Error("You need to require 'zrender/vml/vml' to support IE8");M="vml"}else(!M||!b[M])&&(M="canvas");var E=new b[M](g,w,C,h);this.storage=w,this.painter=E;var p=!H.node&&!H.worker?new m(E.getViewportRoot(),E.root):null;this.handler=new F(w,E,p,E.root),this.animation=new D({stage:{update:P.bind(this.flush,this)}}),this.animation.start(),this._needsRefresh;var l=w.delFromStorage,u=w.addToStorage;w.delFromStorage=function(f){l.call(w,f),f&&f.removeSelfFromZr(A)},w.addToStorage=function(f){u.call(w,f),f.addSelfToZr(A)}};t.prototype={constructor:t,getId:function(){return this.id},add:function(h){this.storage.addRoot(h),this._needsRefresh=!0},remove:function(h){this.storage.delRoot(h),this._needsRefresh=!0},configLayer:function(h,g){this.painter.configLayer&&this.painter.configLayer(h,g),this._needsRefresh=!0},setBackgroundColor:function(h){this.painter.setBackgroundColor&&this.painter.setBackgroundColor(h),this._needsRefresh=!0},refreshImmediately:function(){this._needsRefresh=this._needsRefreshHover=!1,this.painter.refresh(),this._needsRefresh=this._needsRefreshHover=!1},refresh:function(){this._needsRefresh=!0},flush:function(){var h;this._needsRefresh&&(h=!0,this.refreshImmediately()),this._needsRefreshHover&&(h=!0,this.refreshHoverImmediately()),h&&this.trigger("rendered")},addHover:function(h,g){if(this.painter.addHover){var C=this.painter.addHover(h,g);return this.refreshHover(),C}},removeHover:function(h){this.painter.removeHover&&(this.painter.removeHover(h),this.refreshHover())},clearHover:function(){this.painter.clearHover&&(this.painter.clearHover(),this.refreshHover())},refreshHover:function(){this._needsRefreshHover=!0},refreshHoverImmediately:function(){this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.refreshHover()},resize:function(h){h=h||{},this.painter.resize(h.width,h.height),this.handler.resize()},clearAnimation:function(){this.animation.clear()},getWidth:function(){return this.painter.getWidth()},getHeight:function(){return this.painter.getHeight()},pathToImage:function(h,g){return this.painter.pathToImage(h,g)},setCursorStyle:function(h){this.handler.setCursorStyle(h)},findHover:function(h,g){return this.handler.findHover(h,g)},on:function(h,g,C){this.handler.on(h,g,C)},off:function(h,g){this.handler.off(h,g)},trigger:function(h,g){this.handler.trigger(h,g)},clear:function(){this.storage.delRoot(),this.painter.clear()},dispose:function(){this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,o(this.id)}},re.version=d,re.init=c,re.dispose=r,re.getInstance=a,re.registerPainter=s},bT9E:function(Ye,re,I){"use strict";I.d(re,"a",function(){return H});var Y=I("VTBJ");function H(P,F){var R=Object(Y.a)({},P);return Array.isArray(F)&&F.forEach(function(O){delete R[O]}),R}},bYtY:function(Ye,re){var I={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},Y={"[object Int8Array]":1,"[object Uint8Array]":1,"[object Uint8ClampedArray]":1,"[object Int16Array]":1,"[object Uint16Array]":1,"[object Int32Array]":1,"[object Uint32Array]":1,"[object Float32Array]":1,"[object Float64Array]":1},H=Object.prototype.toString,P=Array.prototype,F=P.forEach,R=P.filter,O=P.slice,D=P.map,m=P.reduce,T={};function b(ye,Re){ye==="createCanvas"&&(o=null),T[ye]=Re}function i(ye){if(ye==null||typeof ye!="object")return ye;var Re=ye,nt=H.call(ye);if(nt==="[object Array]"){if(!Ae(ye)){Re=[];for(var Ue=0,ke=ye.length;Ue<ke;Ue++)Re[Ue]=i(ye[Ue])}}else if(Y[nt]){if(!Ae(ye)){var lt=ye.constructor;if(ye.constructor.from)Re=lt.from(ye);else{Re=new lt(ye.length);for(var Ue=0,ke=ye.length;Ue<ke;Ue++)Re[Ue]=i(ye[Ue])}}}else if(!I[nt]&&!Ae(ye)&&!G(ye)){Re={};for(var Fe in ye)ye.hasOwnProperty(Fe)&&(Re[Fe]=i(ye[Fe]))}return Re}function d(ye,Re,nt){if(!N(Re)||!N(ye))return nt?i(Re):ye;for(var Ue in Re)if(Re.hasOwnProperty(Ue)){var ke=ye[Ue],lt=Re[Ue];N(lt)&&N(ke)&&!_(lt)&&!_(ke)&&!G(lt)&&!G(ke)&&!j(lt)&&!j(ke)&&!Ae(lt)&&!Ae(ke)?d(ke,lt,nt):(nt||!(Ue in ye))&&(ye[Ue]=i(Re[Ue],!0))}return ye}function c(ye,Re){for(var nt=ye[0],Ue=1,ke=ye.length;Ue<ke;Ue++)nt=d(nt,ye[Ue],Re);return nt}function r(ye,Re){for(var nt in Re)Re.hasOwnProperty(nt)&&(ye[nt]=Re[nt]);return ye}function a(ye,Re,nt){for(var Ue in Re)Re.hasOwnProperty(Ue)&&(nt?Re[Ue]!=null:ye[Ue]==null)&&(ye[Ue]=Re[Ue]);return ye}var s=function(){return T.createCanvas()};T.createCanvas=function(){return document.createElement("canvas")};var o;function t(){return o||(o=s().getContext("2d")),o}function h(ye,Re){if(ye){if(ye.indexOf)return ye.indexOf(Re);for(var nt=0,Ue=ye.length;nt<Ue;nt++)if(ye[nt]===Re)return nt}return-1}function g(ye,Re){var nt=ye.prototype;function Ue(){}Ue.prototype=Re.prototype,ye.prototype=new Ue;for(var ke in nt)nt.hasOwnProperty(ke)&&(ye.prototype[ke]=nt[ke]);ye.prototype.constructor=ye,ye.superClass=Re}function C(ye,Re,nt){ye="prototype"in ye?ye.prototype:ye,Re="prototype"in Re?Re.prototype:Re,a(ye,Re,nt)}function A(ye){return ye?typeof ye=="string"?!1:typeof ye.length=="number":void 0}function w(ye,Re,nt){if(!(ye&&Re))return;if(ye.forEach&&ye.forEach===F)ye.forEach(Re,nt);else if(ye.length===+ye.length)for(var Ue=0,ke=ye.length;Ue<ke;Ue++)Re.call(nt,ye[Ue],Ue,ye);else for(var lt in ye)ye.hasOwnProperty(lt)&&Re.call(nt,ye[lt],lt,ye)}function M(ye,Re,nt){if(!(ye&&Re))return;if(ye.map&&ye.map===D)return ye.map(Re,nt);for(var Ue=[],ke=0,lt=ye.length;ke<lt;ke++)Ue.push(Re.call(nt,ye[ke],ke,ye));return Ue}function E(ye,Re,nt,Ue){if(!(ye&&Re))return;if(ye.reduce&&ye.reduce===m)return ye.reduce(Re,nt,Ue);for(var ke=0,lt=ye.length;ke<lt;ke++)nt=Re.call(Ue,nt,ye[ke],ke,ye);return nt}function p(ye,Re,nt){if(!(ye&&Re))return;if(ye.filter&&ye.filter===R)return ye.filter(Re,nt);for(var Ue=[],ke=0,lt=ye.length;ke<lt;ke++)Re.call(nt,ye[ke],ke,ye)&&Ue.push(ye[ke]);return Ue}function l(ye,Re,nt){if(!(ye&&Re))return;for(var Ue=0,ke=ye.length;Ue<ke;Ue++)if(Re.call(nt,ye[Ue],Ue,ye))return ye[Ue]}function u(ye,Re){var nt=O.call(arguments,2);return function(){return ye.apply(Re,nt.concat(O.call(arguments)))}}function f(ye){var Re=O.call(arguments,1);return function(){return ye.apply(this,Re.concat(O.call(arguments)))}}function _(ye){return H.call(ye)==="[object Array]"}function y(ye){return typeof ye=="function"}function v(ye){return H.call(ye)==="[object String]"}function N(ye){var Re=typeof ye;return Re==="function"||!!ye&&Re==="object"}function j(ye){return!!I[H.call(ye)]}function U(ye){return!!Y[H.call(ye)]}function G(ye){return typeof ye=="object"&&typeof ye.nodeType=="number"&&typeof ye.ownerDocument=="object"}function z(ye){return ye!==ye}function L(ye){for(var Re=0,nt=arguments.length;Re<nt;Re++)if(arguments[Re]!=null)return arguments[Re]}function V(ye,Re){return ye!=null?ye:Re}function W(ye,Re,nt){return ye!=null?ye:Re!=null?Re:nt}function $(){return Function.call.apply(O,arguments)}function q(ye){if(typeof ye=="number")return[ye,ye,ye,ye];var Re=ye.length;return Re===2?[ye[0],ye[1],ye[0],ye[1]]:Re===3?[ye[0],ye[1],ye[2],ye[1]]:ye}function fe(ye,Re){if(!ye)throw new Error(Re)}function se(ye){return ye==null?null:typeof ye.trim=="function"?ye.trim():ye.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var me="__ec_primitive__";function ve(ye){ye[me]=!0}function Ae(ye){return ye[me]}function ge(ye){var Re=_(ye);this.data={};var nt=this;ye instanceof ge?ye.each(Ue):ye&&w(ye,Ue);function Ue(ke,lt){Re?nt.set(ke,lt):nt.set(lt,ke)}}ge.prototype={constructor:ge,get:function(ye){return this.data.hasOwnProperty(ye)?this.data[ye]:null},set:function(ye,Re){return this.data[ye]=Re},each:function(ye,Re){Re!==void 0&&(ye=u(ye,Re));for(var nt in this.data)this.data.hasOwnProperty(nt)&&ye(this.data[nt],nt)},removeKey:function(ye){delete this.data[ye]}};function ue(ye){return new ge(ye)}function $e(ye,Re){for(var nt=new ye.constructor(ye.length+Re.length),Ue=0;Ue<ye.length;Ue++)nt[Ue]=ye[Ue];var ke=ye.length;for(Ue=0;Ue<Re.length;Ue++)nt[Ue+ke]=Re[Ue];return nt}function Tt(){}re.$override=b,re.clone=i,re.merge=d,re.mergeAll=c,re.extend=r,re.defaults=a,re.createCanvas=s,re.getContext=t,re.indexOf=h,re.inherits=g,re.mixin=C,re.isArrayLike=A,re.each=w,re.map=M,re.reduce=E,re.filter=p,re.find=l,re.bind=u,re.curry=f,re.isArray=_,re.isFunction=y,re.isString=v,re.isObject=N,re.isBuiltInObject=j,re.isTypedArray=U,re.isDom=G,re.eqNaN=z,re.retrieve=L,re.retrieve2=V,re.retrieve3=W,re.slice=$,re.normalizeCssArray=q,re.assert=fe,re.trim=se,re.setAsPrimitive=ve,re.isPrimitive=Ae,re.createHashMap=ue,re.concatArray=$e,re.noop=Tt},biw7:function(Ye,re,I){"use strict";var Y=I("q1tI"),H=I.n(Y),P=Y.createContext(null);re.a=P},c5Ni:function(Ye,re,I){},chpo:function(Ye,re,I){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.default=void 0;var Y=1,H=function(){return"".concat(Y++)};re.default=H},dMvE:function(Ye,re){var I={linear:function(H){return H},quadraticIn:function(H){return H*H},quadraticOut:function(H){return H*(2-H)},quadraticInOut:function(H){return(H*=2)<1?.5*H*H:-.5*(--H*(H-2)-1)},cubicIn:function(H){return H*H*H},cubicOut:function(H){return--H*H*H+1},cubicInOut:function(H){return(H*=2)<1?.5*H*H*H:.5*((H-=2)*H*H+2)},quarticIn:function(H){return H*H*H*H},quarticOut:function(H){return 1- --H*H*H*H},quarticInOut:function(H){return(H*=2)<1?.5*H*H*H*H:-.5*((H-=2)*H*H*H-2)},quinticIn:function(H){return H*H*H*H*H},quinticOut:function(H){return--H*H*H*H*H+1},quinticInOut:function(H){return(H*=2)<1?.5*H*H*H*H*H:.5*((H-=2)*H*H*H*H+2)},sinusoidalIn:function(H){return 1-Math.cos(H*Math.PI/2)},sinusoidalOut:function(H){return Math.sin(H*Math.PI/2)},sinusoidalInOut:function(H){return .5*(1-Math.cos(Math.PI*H))},exponentialIn:function(H){return H===0?0:Math.pow(1024,H-1)},exponentialOut:function(H){return H===1?1:1-Math.pow(2,-10*H)},exponentialInOut:function(H){return H===0?0:H===1?1:(H*=2)<1?.5*Math.pow(1024,H-1):.5*(-Math.pow(2,-10*(H-1))+2)},circularIn:function(H){return 1-Math.sqrt(1-H*H)},circularOut:function(H){return Math.sqrt(1- --H*H)},circularInOut:function(H){return(H*=2)<1?-.5*(Math.sqrt(1-H*H)-1):.5*(Math.sqrt(1-(H-=2)*H)+1)},elasticIn:function(H){var P,F=.1,R=.4;return H===0?0:H===1?1:(!F||F<1?(F=1,P=R/4):P=R*Math.asin(1/F)/(2*Math.PI),-(F*Math.pow(2,10*(H-=1))*Math.sin((H-P)*(2*Math.PI)/R)))},elasticOut:function(H){var P,F=.1,R=.4;return H===0?0:H===1?1:(!F||F<1?(F=1,P=R/4):P=R*Math.asin(1/F)/(2*Math.PI),F*Math.pow(2,-10*H)*Math.sin((H-P)*(2*Math.PI)/R)+1)},elasticInOut:function(H){var P,F=.1,R=.4;return H===0?0:H===1?1:(!F||F<1?(F=1,P=R/4):P=R*Math.asin(1/F)/(2*Math.PI),(H*=2)<1?-.5*(F*Math.pow(2,10*(H-=1))*Math.sin((H-P)*(2*Math.PI)/R)):F*Math.pow(2,-10*(H-=1))*Math.sin((H-P)*(2*Math.PI)/R)*.5+1)},backIn:function(H){var P=1.70158;return H*H*((P+1)*H-P)},backOut:function(H){var P=1.70158;return--H*H*((P+1)*H+P)+1},backInOut:function(H){var P=1.70158*1.525;return(H*=2)<1?.5*(H*H*((P+1)*H-P)):.5*((H-=2)*H*((P+1)*H+P)+2)},bounceIn:function(H){return 1-I.bounceOut(1-H)},bounceOut:function(H){return H<1/2.75?7.5625*H*H:H<2/2.75?7.5625*(H-=1.5/2.75)*H+.75:H<2.5/2.75?7.5625*(H-=2.25/2.75)*H+.9375:7.5625*(H-=2.625/2.75)*H+.984375},bounceInOut:function(H){return H<.5?I.bounceIn(H*2)*.5:I.bounceOut(H*2-1)*.5+.5}},Y=I;Ye.exports=Y},dejd:function(Ye,re,I){},dmUQ:function(Ye,re,I){"use strict";var Y=I("Ff2n"),H=I("rePB"),P=I("1OyB"),F=I("vuIU"),R=I("Ji7U"),O=I("md7G"),D=I("foSv"),m=I("q1tI"),T=I.n(m),b=I("TSYQ"),i=I.n(b),d=I("4IlW");function c(u,f){var _=Object.keys(u);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(u);f&&(y=y.filter(function(v){return Object.getOwnPropertyDescriptor(u,v).enumerable})),_.push.apply(_,y)}return _}function r(u){for(var f=1;f<arguments.length;f++){var _=arguments[f]!=null?arguments[f]:{};f%2?c(Object(_),!0).forEach(function(y){Object(H.a)(u,y,_[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(_)):c(Object(_)).forEach(function(y){Object.defineProperty(u,y,Object.getOwnPropertyDescriptor(_,y))})}return u}function a(u){var f=s();return function(){var y=Object(D.a)(u),v;if(f){var N=Object(D.a)(this).constructor;v=Reflect.construct(y,arguments,N)}else v=y.apply(this,arguments);return Object(O.a)(this,v)}}function s(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(u){return!1}}function o(){}function t(u){u.preventDefault()}var h=function(f){return f.replace(/[^\w.-]+/g,"")},g=200,C=600,A=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,w=function(f){return f!=null},M=function(f,_){return _===f||typeof _=="number"&&typeof f=="number"&&isNaN(_)&&isNaN(f)},E=function(u){Object(R.a)(_,u);var f=a(_);function _(y){var v;Object(P.a)(this,_),v=f.call(this,y),v.onKeyDown=function(U){var G=v.props,z=G.onKeyDown,L=G.onPressEnter;if(U.keyCode===d.a.UP){var V=v.getRatio(U);v.up(U,V,null),v.stop()}else if(U.keyCode===d.a.DOWN){var W=v.getRatio(U);v.down(U,W,null),v.stop()}else U.keyCode===d.a.ENTER&&L&&L(U);if(v.recordCursorPosition(),v.lastKeyCode=U.keyCode,z){for(var $=arguments.length,q=new Array($>1?$-1:0),fe=1;fe<$;fe++)q[fe-1]=arguments[fe];z.apply(void 0,[U].concat(q))}},v.onKeyUp=function(U){var G=v.props.onKeyUp;if(v.stop(),v.recordCursorPosition(),G){for(var z=arguments.length,L=new Array(z>1?z-1:0),V=1;V<z;V++)L[V-1]=arguments[V];G.apply(void 0,[U].concat(L))}},v.onChange=function(U){var G=v.props.onChange;v.state.focused&&(v.inputting=!0),v.rawInput=v.props.parser(v.getValueFromEvent(U)),v.setState({inputValue:v.rawInput}),G(v.toNumber(v.rawInput))},v.onMouseUp=function(){var U=v.props.onMouseUp;v.recordCursorPosition(),U&&U.apply(void 0,arguments)},v.onFocus=function(){var U;v.setState({focused:!0}),(U=v.props).onFocus.apply(U,arguments)},v.onBlur=function(){var U=v.props.onBlur;v.inputting=!1,v.setState({focused:!1});var G=v.getCurrentValidValue(v.state.inputValue),z=v.setValue(G,o);if(U){var L=v.input.value,V=v.getInputDisplayValue({focus:!1,value:z});v.input.value=V&&Number(V),U.apply(void 0,arguments),v.input.value=L}},v.getRatio=function(U){var G=1;return U.metaKey||U.ctrlKey?G=.1:U.shiftKey&&(G=10),G},v.getFullNum=function(U){return isNaN(U)?U:/e/i.test(String(U))?Number(U).toFixed(18).replace(/\.?0+$/,""):U},v.getPrecision=function(U){if(w(v.props.precision))return v.props.precision;var G=String(U);if(G.indexOf("e-")>=0)return parseInt(G.slice(G.indexOf("e-")+2),10);var z=0;return G.indexOf(".")>=0&&(z=G.length-G.indexOf(".")-1),z},v.getInputDisplayValue=function(U){var G=U||v.state,z=G.focused,L=G.inputValue,V=G.value,W;z?W=L:W=v.toPrecisionAsStep(V),W==null&&(W="");var $=v.formatWrapper(W);return w(v.props.decimalSeparator)&&($=$.toString().replace(".",v.props.decimalSeparator)),$},v.recordCursorPosition=function(){try{v.cursorStart=v.input.selectionStart,v.cursorEnd=v.input.selectionEnd,v.currentValue=v.input.value,v.cursorBefore=v.input.value.substring(0,v.cursorStart),v.cursorAfter=v.input.value.substring(v.cursorEnd)}catch(U){}},v.restoreByAfter=function(U){if(U===void 0)return!1;var G=v.input.value,z=G.lastIndexOf(U);if(z===-1)return!1;var L=v.cursorBefore.length;return v.lastKeyCode===d.a.DELETE&&v.cursorBefore.charAt(L-1)===U[0]?(v.fixCaret(L,L),!0):z+U.length===G.length?(v.fixCaret(z,z),!0):!1},v.partRestoreByAfter=function(U){return U===void 0?!1:Array.prototype.some.call(U,function(G,z){var L=U.substring(z);return v.restoreByAfter(L)})},v.isNotCompleteNumber=function(U){return isNaN(U)||U===""||U===null||U&&U.toString().indexOf(".")===U.toString().length-1},v.stop=function(){v.autoStepTimer&&clearTimeout(v.autoStepTimer)},v.down=function(U,G,z){v.pressingUpOrDown=!0,v.step("down",U,G,z)},v.up=function(U,G,z){v.pressingUpOrDown=!0,v.step("up",U,G,z)},v.saveInput=function(U){v.input=U};var N=y.value;N===void 0&&(N=y.defaultValue),v.state={focused:y.autoFocus};var j=v.getValidValue(v.toNumber(N));return v.state=r(r({},v.state),{},{inputValue:v.toPrecisionAsStep(j),value:j}),v}return Object(F.a)(_,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(v){var N=this.props,j=N.value,U=N.onChange,G=N.max,z=N.min,L=this.state.focused;if(v){if(!M(v.value,j)||!M(v.max,G)||!M(v.min,z)){var V=L?j:this.getValidValue(j),W;this.pressingUpOrDown?W=V:this.inputting?W=this.rawInput:W=this.toPrecisionAsStep(V),this.setState({value:V,inputValue:W})}var $="value"in this.props?j:this.state.value;"max"in this.props&&v.max!==G&&typeof $=="number"&&$>G&&U&&U(G),"min"in this.props&&v.min!==z&&typeof $=="number"&&$<z&&U&&U(z)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var q=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===d.a.BACKSPACE?q=this.cursorStart-1:this.lastKeyCode===d.a.DELETE&&(q=this.cursorStart):q=this.input.value.length,this.fixCaret(q,q)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case d.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case d.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(fe){}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(v){var N=v;return N===""?N="":this.isNotCompleteNumber(parseFloat(N))?N=this.state.value:N=this.getValidValue(N),this.toNumber(N)}},{key:"getValueFromEvent",value:function(v){var N=v.target.value.trim().replace(/。/g,".");return w(this.props.decimalSeparator)&&(N=N.replace(this.props.decimalSeparator,".")),N}},{key:"getValidValue",value:function(v){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,U=parseFloat(v);return isNaN(U)?v:(U<N&&(U=N),U>j&&(U=j),U)}},{key:"setValue",value:function(v,N){var j=this.props.precision,U=this.isNotCompleteNumber(parseFloat(v))?null:parseFloat(v),G=this.state.value,z=G===void 0?null:G,L=this.state.inputValue,V=L===void 0?null:L,W=typeof U=="number"?U.toFixed(j):"".concat(U),$=U!==z||W!=="".concat(V);return"value"in this.props?(V=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:V},N)):this.setState({value:U,inputValue:this.toPrecisionAsStep(v)},N),$&&this.props.onChange(U),U}},{key:"getMaxPrecision",value:function(v){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,j=this.props,U=j.precision,G=j.step;if(w(U))return U;var z=this.getPrecision(N),L=this.getPrecision(G),V=this.getPrecision(v);return v?Math.max(V,z+L):z+L}},{key:"getPrecisionFactor",value:function(v){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,j=this.getMaxPrecision(v,N);return Math.pow(10,j)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(v){return this.props.formatter?this.props.formatter(v):v}},{key:"toPrecisionAsStep",value:function(v){if(this.isNotCompleteNumber(v)||v==="")return v;var N=Math.abs(this.getMaxPrecision(v));return isNaN(N)?v.toString():Number(v).toFixed(N)}},{key:"toNumber",value:function(v){var N=this.props.precision,j=this.state.focused,U=v&&v.length>16&&j;return this.isNotCompleteNumber(v)||U?v:w(N)?Math.round(v*Math.pow(10,N))/Math.pow(10,N):Number(v)}},{key:"upStep",value:function(v,N){var j=this.props.step,U=this.getPrecisionFactor(v,N),G=Math.abs(this.getMaxPrecision(v,N)),z=((U*v+U*j*N)/U).toFixed(G);return this.toNumber(z)}},{key:"downStep",value:function(v,N){var j=this.props.step,U=this.getPrecisionFactor(v,N),G=Math.abs(this.getMaxPrecision(v,N)),z=((U*v-U*j*N)/U).toFixed(G);return this.toNumber(z)}},{key:"step",value:function(v,N){var j=this,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,G=arguments.length>3?arguments[3]:void 0;this.stop(),N&&(N.persist(),N.preventDefault());var z=this.props;if(z.disabled)return;var L=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(L))return;var V=this["".concat(v,"Step")](L,U),W=V>z.max||V<z.min;if(V>z.max?V=z.max:V<z.min&&(V=z.min),this.setValue(V,null),this.setState({focused:!0},function(){j.pressingUpOrDown=!1}),W)return;this.autoStepTimer=setTimeout(function(){j[v](N,U,!0)},G?g:C)}},{key:"fixCaret",value:function(v,N){if(v===void 0||N===void 0||!this.input||!this.input.value)return;try{var j=this.input.selectionStart,U=this.input.selectionEnd;(v!==j||N!==U)&&this.input.setSelectionRange(v,N)}catch(G){}}},{key:"render",value:function(){var v,N=this.props,j=N.prefixCls,U=N.disabled,G=N.readOnly,z=N.useTouch,L=N.autoComplete,V=N.upHandler,W=N.downHandler,$=N.className,q=N.max,fe=N.min,se=N.style,me=N.title,ve=N.onMouseEnter,Ae=N.onMouseLeave,ge=N.onMouseOver,ue=N.onMouseOut,$e=N.required,Tt=N.onClick,ye=N.tabIndex,Re=N.type,nt=N.placeholder,Ue=N.id,ke=N.inputMode,lt=N.pattern,Fe=N.step,Ze=N.maxLength,Xe=N.autoFocus,ft=N.name,Rt=N.onPaste,Pt=N.onInput,Bt=Object(Y.a)(N,["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"]),Ve=this.state,Ft=Ve.value,nn=Ve.focused,Le=i()(j,(v={},Object(H.a)(v,$,!!$),Object(H.a)(v,"".concat(j,"-disabled"),U),Object(H.a)(v,"".concat(j,"-focused"),nn),v)),Se={};Object.keys(Bt).forEach(function(be){(be.substr(0,5)==="data-"||be.substr(0,5)==="aria-"||be==="role")&&(Se[be]=Bt[be])});var ut=!G&&!U,mt=this.getInputDisplayValue(null),We=(Ft||Ft===0)&&(isNaN(Ft)||Number(Ft)>=q),vt=(Ft||Ft===0)&&(isNaN(Ft)||Number(Ft)<=fe),Pe=We||U||G,xe=vt||U||G,we=i()("".concat(j,"-handler"),"".concat(j,"-handler-up"),Object(H.a)({},"".concat(j,"-handler-up-disabled"),Pe)),ie=i()("".concat(j,"-handler"),"".concat(j,"-handler-down"),Object(H.a)({},"".concat(j,"-handler-down-disabled"),xe)),ae=z?{onTouchStart:Pe?o:this.up,onTouchEnd:this.stop}:{onMouseDown:Pe?o:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},ce=z?{onTouchStart:xe?o:this.down,onTouchEnd:this.stop}:{onMouseDown:xe?o:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return T.a.createElement("div",{className:Le,style:se,title:me,onMouseEnter:ve,onMouseLeave:Ae,onMouseOver:ge,onMouseOut:ue,onFocus:function(){return null},onBlur:function(){return null}},T.a.createElement("div",{className:"".concat(j,"-handler-wrap")},T.a.createElement("span",Object.assign({unselectable:"on"},ae,{role:"button","aria-label":"Increase Value","aria-disabled":Pe,className:we}),V||T.a.createElement("span",{unselectable:"on",className:"".concat(j,"-handler-up-inner"),onClick:t})),T.a.createElement("span",Object.assign({unselectable:"on"},ce,{role:"button","aria-label":"Decrease Value","aria-disabled":xe,className:ie}),W||T.a.createElement("span",{unselectable:"on",className:"".concat(j,"-handler-down-inner"),onClick:t}))),T.a.createElement("div",{className:"".concat(j,"-input-wrap")},T.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":fe,"aria-valuemax":q,"aria-valuenow":Ft,required:$e,type:Re,placeholder:nt,onPaste:Rt,onClick:Tt,onMouseUp:this.onMouseUp,className:"".concat(j,"-input"),tabIndex:ye,autoComplete:L,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:ut?this.onKeyDown:o,onKeyUp:ut?this.onKeyUp:o,autoFocus:Xe,maxLength:Ze,readOnly:G,disabled:U,max:q,min:fe,step:Fe,name:ft,title:me,id:Ue,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(mt),pattern:lt,inputMode:ke,onInput:Pt},Se))))}}]),_}(T.a.Component);E.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:A,min:-A,step:1,style:{},onChange:o,onKeyDown:o,onPressEnter:o,onFocus:o,onBlur:o,parser:h,required:!1,autoComplete:"off"};var p=E,l=re.a=p},dqUG:function(Ye,re,I){var Y=I("Gev7"),H=I("bYtY"),P=I("6GrX"),F=I("pzxd"),R=I("gut8"),O=R.ContextCachedBy,D=function(T){Y.call(this,T)};D.prototype={constructor:D,type:"text",brush:function(T,b){var i=this.style;this.__dirty&&F.normalizeTextStyle(i,!0),i.fill=i.stroke=i.shadowBlur=i.shadowColor=i.shadowOffsetX=i.shadowOffsetY=null;var d=i.text;if(d!=null&&(d+=""),!F.needDrawText(d,i)){T.__attrCachedBy=O.NONE;return}this.setTransform(T),F.renderText(this,T,d,i,null,b),this.restoreTransform(T)},getBoundingRect:function(){var T=this.style;if(this.__dirty&&F.normalizeTextStyle(T,!0),!this._rect){var b=T.text;b!=null?b+="":b="";var i=P.getBoundingRect(T.text+"",T.font,T.textAlign,T.textVerticalAlign,T.textPadding,T.textLineHeight,T.rich);if(i.x+=T.x||0,i.y+=T.y||0,F.getStroke(T.textStroke,T.textStrokeWidth)){var d=T.textStrokeWidth;i.x-=d/2,i.y-=d/2,i.width+=d,i.height+=d}this._rect=i}return this._rect}},H.inherits(D,Y);var m=D;Ye.exports=m},eozf:function(Ye,re,I){"use strict";I.d(re,"b",function(){return Ae}),I.d(re,"c",function(){return ge});var Y=I("sRBo"),H=I("kaz8"),P=I("5Dmo"),F=I("3S7+"),R=I("/zsF"),O=I("PArb"),D=I("7Kak"),m=I("9yH6"),T=I("14J3"),b=I("BMrR"),i=I("+L6B"),d=I("2/Rp"),c=I("jCWc"),r=I("kPKH"),a=I("2qtc"),s=I("kLXV"),o=I("9og8"),t=I("miYZ"),h=I("tsqr"),g=I("oBTY"),C=I("k1fw"),A=I("tJVT"),w=I("OaEy"),M=I("2fM7"),E=I("iQDF"),p=I("+eQT"),l=I("WmNS"),u=I.n(l),f=I("q1tI"),_=I.n(f),y=I("/MfK"),v=I("w5pM"),N=I("Lyp1"),j=I("wd/R"),U=I.n(j),G=I("xKgJ"),z=I("ErOA"),L=I("LvDl"),V=I.n(L),W=I("1vsH"),$=I("zetH"),q=I.n($),fe=I("Ty5D"),se=I("9kvl"),me=I("AHFd");function ve(ye,Re){for(var nt=[],Ue=ye;Ue<Re;Ue++)nt.push(Ue);return nt}var Ae=function(Re,nt,Ue){var ke=Re<U()().startOf("day"),lt=Re>U()(nt).endOf("day"),Fe=Re<U()(Ue).startOf("day");return nt?Ue?U()()<=U()(Ue)?Fe||lt:ke||lt:Re&&ke||lt:Ue&&U()()<=U()(Ue)?Fe:ke},ge=function(Re,nt){var Ue=parseInt(U()(Re).format("HH")),ke=parseInt(U()().format("HH")),lt=parseInt(U()().format("mm"));if(!Re)return{disabledHours:function(){return ve(0,ke)},disabledMinutes:function(){return ve(0,lt)}};if(nt){var Fe=parseInt(U()(nt).format("HH")),Ze=parseInt(U()(nt).format("mm"));return U()(Re).isSame(U()(nt),"day")?{disabledHours:function(){return ve(0,Fe)},disabledMinutes:function(){return Ue<=Fe?ve(0,Ze):[]}}:void 0}return U()(Re).isSame(U()(),"day")?{disabledHours:function(){return ve(0,ke)},disabledMinutes:function(){return U()(Re).isSame(U()(),"hour")&&Ue<=ke?ve(0,lt):[]}}:void 0},ue=p.a.RangePicker,$e=M.a.Option,Tt=function(Re){var nt,Ue,ke,lt,Fe,Ze,Xe,ft=Re.shixunHomeworks,Rt=Re.loading,Pt=Re.dispatch,Bt=Object(fe.i)(),Ve=ft.workSetting,Ft=ft.workList,nn=ft.changeData,Le=Object(f.useState)(!0),Se=Object(A.a)(Le,2),ut=Se[0],mt=Se[1],We=Object(f.useState)(!1),vt=Object(A.a)(We,2),Pe=vt[0],xe=vt[1],we=Object(f.useState)([]),ie=Object(A.a)(we,2),ae=ie[0],ce=ie[1],be=Object(f.useState)([]),Ce=Object(A.a)(be,2),Be=Ce[0],yt=Ce[1],Xt=Object(f.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_penalty:0,penalty_type:me.a.Percent,challenge_settings:[],work_efficiency:!1,shixun_evaluation:"",answer_open_evaluation:!1,answer_public:!1,score_open:!1,comment_public:!0,total_score:"",eff_score:0}),an=Object(A.a)(Xt,2),pt=an[0],Yt=an[1];Object(f.useEffect)(function(){return St(),function(){ce([].concat())}},[]);var St=function(){Pt({type:"shixunHomeworks/getWorkSetting",payload:Object(C.a)({},Bt)})};Object(f.useEffect)(function(){var De;if(!(Ve!=null&&Ve.course_id))return;Object.keys(pt).map(function(qe){pt[qe]=Ve[qe]}),(!pt.allow_late||!pt.unified_late)&&(pt.late_penalty=20,pt.penalty_type=me.a.Percent),pt.unified_setting||(pt.unified_late=!1,pt.unified_anonymous_comment=!1,pt.unified_anonymous_appeal=!1),ae=JSON.parse(JSON.stringify(Ve.group_settings.map(function(qe){return Object(C.a)(Object(C.a)({},qe),{},{group_name:[qe.group_name]})}).filter(function(qe){return qe.publish_time!==null}))),Be=JSON.parse(JSON.stringify(Ve.allow_late_settings.map(function(qe){return Object(C.a)(Object(C.a)({},qe),{},{group_name:[qe.group_name]})}).filter(function(qe){return qe.late_time!==null}))),Yt(Object(C.a)({},pt)),ce(Object(g.a)(ae)),((De=Be)===null||De===void 0?void 0:De.length)<=0?yt([{penalty_type:me.a.Percent,late_penalty:20}]):yt(Object(g.a)(Be))},[Ve]);var Ot=function(){var qe,jt,Zt=JSON.parse(JSON.stringify(pt));if(Zt.challenge_settings.filter(function(On){return!On.hide}),Zt.categoryId=Bt.categoryId,(qe=Zt.challenge_settings)!==null&&qe!==void 0&&qe.every(function(On){return!On.checked})){h.b.warn("\u5173\u5361\u4E0D\u80FD\u5168\u90E8\u8BBE\u7F6E\u4E3A\u53EF\u4E0D\u505A");return}if(pt.unified_setting||(ae=(jt=ae)===null||jt===void 0?void 0:jt.map(function(On){var ur;if(!On.publish_time||!On.end_time)throw h.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(!On.group_name)throw h.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return On.group_name=typeof(On==null?void 0:On.group_name)=="string"?[On==null?void 0:On.group_name]:On==null?void 0:On.group_name,On.group_id=(ur=Ve.group_settings)===null||ur===void 0?void 0:ur.filter(function(Kn){var wn;return On==null||((wn=On.group_name)===null||wn===void 0)?void 0:wn.includes(Kn.group_name)}).map(function(Kn){return Kn.group_id||Kn.id}).toString().split(","),On})),Zt.group_settings=ae,pt.allow_late)if(pt.unified_late){if(pt.late_penalty===null||pt.late_penalty===void 0||pt.late_penalty<0||pt.late_penalty>100)throw h.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(!pt.late_time)throw h.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 gn;Be=(gn=Be)===null||gn===void 0?void 0:gn.map(function(On){var ur,Kn;if(On.late_penalty===null||On.late_penalty===void 0||On.late_penalty<0||On.late_penalty>100)throw h.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(!On.late_time)throw h.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(!On.group_name)throw h.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return On.group_name=typeof(On==null?void 0:On.group_name)=="string"?[On==null?void 0:On.group_name]:On==null?void 0:On.group_name,On.group_id=On==null||((ur=On.group_name)===null||ur===void 0||((Kn=ur.map(function(wn){var xr,Fr,hr=(xr=Ve.group_settings)===null||xr===void 0||((Fr=xr.filter(function(dr){return(dr==null?void 0:dr.group_name)===wn}))===null||Fr===void 0)?void 0:Fr[0];return hr==null?void 0:hr.group_id}))===null||Kn===void 0))?void 0:Kn.toString().split(","),On}),Zt.allow_late_settings=Be}dt(Zt)},dt=function(qe){var jt,Zt;if(qe.total_score===null){h.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}if(qe!=null&&qe.work_efficiency&&qe.eff_score===null){h.b.warn("\u6548\u7387\u5206\u4E0D\u80FD\u4E3A\u7A7A");return}var gn=qe.challenge_settings.reduce(function(Kn,wn){return Kn+Number(wn.challenge_score)},0);if((gn==null?void 0:gn.toFixed(10))!==((jt=qe.total_score-qe.eff_score)===null||jt===void 0?void 0:jt.toFixed(10))){h.b.warn("\u6548\u7387\u5206\u52A0\u5173\u5361\u4EFB\u52A1\u603B\u5206\u5FC5\u987B\u7B49\u4E8E\u603B\u5206\u503C\uFF1A".concat(qe.total_score,"\u5206"));return}var On={shixun_evaluation:qe.shixun_evaluation,challenge_settings:qe.challenge_settings},ur=function(){var Kn=Object(o.a)(u.a.mark(function wn(){var xr;return u.a.wrap(function(hr){for(;;)switch(hr.prev=hr.next){case 0:return xe(!0),hr.next=3,Object(z.a)("/api/homework_commons/".concat(Bt.categoryId,"/publish_setting.json"),{method:"post",body:Object(C.a)({},qe)});case 3:xr=hr.sent,xr.status===0&&(h.b.success("\u66F4\u65B0\u6210\u529F"),mt(!0),St(),Pt({type:"shixunHomeworks/getWorkList",payload:Object(C.a)({},Bt)})),xe(!1);case 6:case"end":return hr.stop()}},wn)}));return function(){return Kn.apply(this,arguments)}}();!Object(L.isEqual)(nn,On)&&!(Ft!=null&&(Zt=Ft.homework_status)!==null&&Zt!==void 0&&Zt.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:ur}):ur()},_e=function(qe,jt){var Zt,gn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"group_id";return jt?jt.find(function(On){return On[gn]===qe}):Ve==null||((Zt=Ve.group_settings)===null||Zt===void 0)?void 0:Zt.find(function(On){return On.group_id[0]===qe})},je=(Ve==null?void 0:Ve.allow_late)||(Ve==null?void 0:Ve.anonymous_comment),kt=function(qe){var jt=_e(qe,Ve==null?void 0:Ve.allow_late_settings,"id"),Zt=_e(qe,Ve==null?void 0:Ve.anonymous_comment_settings);return(Ve==null?void 0:Ve.allow_late)&&jt&&(jt==null?void 0:jt.late_time)!==null||(Ve==null?void 0:Ve.anonymous_comment)&&Zt&&(Zt==null?void 0:Zt.evaluation_start)!==null},gt=Object(f.useMemo)(function(){var De;if(Ve!=null&&Ve.unified_setting){var qe;return!(Ft!=null&&(qe=Ft.homework_status)!==null&&qe!==void 0&&qe.includes("\u5DF2\u622A\u6B62"))||(Ve==null?void 0:Ve.allow_late)||(Ve==null?void 0:Ve.anonymous_comment)}var jt=Ve==null||((De=Ve.group_settings)===null||De===void 0)?void 0:De.some(function(Zt){return U()(Zt.end_time)<=U()()});return!jt||(Ve==null?void 0:Ve.allow_late)||(Ve==null?void 0:Ve.all_group_late)},[Ve,Ft]),zt=Ve==null?void 0:Ve.anonymous_comment,$t=function(qe){if(!qe)return!1;var jt=_e(qe,Ve==null?void 0:Ve.anonymous_comment_settings);return(Ve==null?void 0:Ve.anonymous_comment)&&jt&&(jt==null?void 0:jt.evaluation_start)!==null};return _.a.createElement("section",{className:[q.a.form," bg-white pl30 pr30 pt10"].join(" ")},_.a.createElement(b.a,null,_.a.createElement(r.a,{span:24},_.a.createElement(b.a,{align:"middle"},_.a.createElement(r.a,{flex:"1"}),_.a.createElement(r.a,null,Object(G.c)()&&ut&&_.a.createElement(d.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return mt(!1)}},"\u7F16\u8F91\u8BBE\u7F6E")))),_.a.createElement("div",null,_.a.createElement("label",null,"\u53D1\u5E03\u65B9\u5F0F\uFF1A")," ",_.a.createElement(m.a.Group,{disabled:ut||!(Ft!=null&&(nt=Ft.homework_status)!==null&&nt!==void 0&&nt.includes("\u672A\u53D1\u5E03")),value:pt.unified_setting,onChange:function(qe){var jt;if(!(Ft!=null&&(jt=Ft.homework_status)!==null&&jt!==void 0&&jt.includes("\u672A\u53D1\u5E03"))){h.b.error("\u5DF2\u53D1\u5E03\uFF0C\u4E0D\u80FD\u518D\u4FEE\u6539\u7EDF\u4E00\u8BBE\u7F6E");return}if(pt.unified_setting=!pt.unified_setting,pt.unified_setting||(pt.unified_late=!1),Yt(Object.assign({},pt)),pt.unified_setting===!1&&ae==""){ce(ae.concat({}));return}pt.unified_setting&&(ce([]),yt([{late_penalty:5}]))}},_.a.createElement(m.a,{value:!0},"\u7EDF\u4E00\u53D1\u5E03"),_.a.createElement(m.a,{disabled:(Ve==null||((Ue=Ve.group_settings)===null||Ue===void 0)?void 0:Ue.length)===0,value:!1},"\u5206\u73ED\u53D1\u5E03")),(Ve==null||((ke=Ve.group_settings)===null||ke===void 0)?void 0:ke.length)===0&&_.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"))),pt.unified_setting&&_.a.createElement("div",null,_.a.createElement(b.a,{align:"middle",className:"mt25 pl30"},_.a.createElement(r.a,null,"\u53D1\u5E03\u65F6\u95F4:"),_.a.createElement(r.a,{className:"ml5"},_.a.createElement(p.a,{disabled:ut||!(Ft!=null&&(lt=Ft.homework_status)!==null&<!==void 0&<.includes("\u672A\u53D1\u5E03")||Ft!=null&&(Fe=Ft.homework_status)!==null&&Fe!==void 0&&Fe.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(qe){return Ae(qe,Ve==null?void 0:Ve.course_end_date)},disabledTime:function(qe){return ge(qe)},value:pt.publish_time?U()(pt.publish_time):"",onChange:function(qe,jt){pt.publish_time=jt,(pt.end_time==""||!pt.end_time)&&pt.unified_setting&&(pt.end_time=U()(qe).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),Yt(Object.assign({},pt))}})),_.a.createElement(r.a,null,_.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u7684\u65F6\u95F4)"))),_.a.createElement(b.a,{align:"middle",className:"mt25 pl30"},_.a.createElement(r.a,null,"\u622A\u6B62\u65F6\u95F4:"),_.a.createElement(r.a,{className:"ml5"},_.a.createElement(p.a,{style:{width:170},allowClear:!1,placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:U()(Object(W.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:ut||je,disabledDate:function(qe){return Ae(qe,Ve==null?void 0:Ve.course_end_date,pt.publish_time)},disabledTime:function(qe){return ge(qe,pt.publish_time)},value:pt.end_time?U()(pt.end_time):"",onChange:function(qe,jt){pt.end_time=jt,Yt(Object.assign({},pt))}})),_.a.createElement(r.a,null,_.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)")))),!pt.unified_setting&&((Ze=ae)===null||Ze===void 0?void 0:Ze.length)>0&&_.a.createElement(b.a,{style:{marginTop:30,paddingTop:40,marginLeft:40,borderTop:"1px solid #eee"}},_.a.createElement(r.a,{span:24},_.a.createElement(b.a,null,_.a.createElement(r.a,{span:10}),_.a.createElement(r.a,{span:10},_.a.createElement(b.a,{className:"c-grey-c ml30"},_.a.createElement(r.a,{flex:"1"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u65F6\u95F4)"),_.a.createElement(r.a,{flex:"1"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u65F6\u95F4\u622A\u70B9)"))),_.a.createElement(r.a,{span:4}))),ae&&ae.map(function(De,qe){var jt,Zt,gn,On,ur;return _.a.createElement(r.a,{span:24,key:qe},_.a.createElement(b.a,{gutter:[8,16]},_.a.createElement(r.a,{span:10},_.a.createElement(b.a,{gutter:[8,16]},_.a.createElement(r.a,null,"\u53D1\u5E03\u89C4\u5219 ",qe+1),_.a.createElement(r.a,{flex:"1",style:{maxWidth:300}},_.a.createElement(M.a,{disabled:ut||!(Ft!=null&&(jt=Ft.homework_status)!==null&&jt!==void 0&&jt.includes("\u672A\u53D1\u5E03"))&&De.id,className:"ml20",mode:"multiple",style:{width:"100%"},value:De.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(wn){ae[qe].group_name=wn,ae[qe].group_id=De.group_id;var xr=Object(L.flattenDeep)(ae.map(function(hr){return hr.group_name})),Fr=Be.map(function(hr){var dr=(hr==null?void 0:hr.group_name)||[];return Object(C.a)(Object(C.a)({},hr),{},{group_name:Object(L.remove)(dr,function(Nr){return xr.includes(Nr)})})});yt(Fr),ce(ae.slice())}},Ve.group_settings&&Ve.group_settings.map(function(Kn){var wn=ae.map(function(xr){return xr.group_name}).flat();if(!wn.includes(Kn.group_name))return _.a.createElement($e,{value:Kn.group_name,key:Kn.id},Kn.group_name)}))))),_.a.createElement(r.a,{span:10},_.a.createElement("div",{className:"ml30"},_.a.createElement(ue,{ranges:{\u6B64\u523B:[De.publish_time?U()(De.publish_time):U()(),U()()]},allowClear:!1,disabled:ut||(U()()<=U()((Zt=_e((gn=De.group_id)===null||gn===void 0?void 0:gn[0]))===null||Zt===void 0?void 0:Zt.publish_time)?!1:[!0,kt((On=De.group_id)===null||On===void 0?void 0:On[0])]),style:{width:400},placeholder:["\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4","\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4"],disabledDate:function(wn){return Ae(wn,Ve==null?void 0:Ve.course_end_date)},disabledTime:function(wn){return ge(wn)},showTime:{showNow:!0,format:"HH:mm",defaultValue:[U()(Object(W.d)(),"HH:mm"),U()(Object(W.d)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:De.publish_time&&[U()(De.publish_time),De.end_time?U()(De.end_time):void 0],onChange:function(wn,xr){ae[qe].publish_time=xr[0],ae[qe].end_time=xr[1],ce(Object(g.a)(ae))}}))),!ut&&_.a.createElement(r.a,{span:4},qe>0&&!De.id&&_.a.createElement(y.a,{onClick:function(){ae=ae.filter(function(wn,xr){return qe!==xr}),ce(ae.slice()),setTimeout(function(){return ce(ae.slice())},10)}}),ae.length<(Ve==null||((ur=Ve.group_settings)===null||ur===void 0)?void 0:ur.length)&&_.a.createElement(v.a,{className:"c-green ml20",onClick:function(){ce(ae.concat({}))}}))))})),_.a.createElement(O.a,null),_.a.createElement(b.a,null,_.a.createElement(r.a,null,_.a.createElement("strong",null,"\u8865\u4EA4\u8BBE\u7F6E"),_.a.createElement(F.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"},_.a.createElement(N.a,{style:{marginLeft:4,cursor:"pointer"}}))),_.a.createElement(r.a,{span:24,className:"mt15 pl30"},_.a.createElement(H.a,{checked:pt.allow_late,disabled:ut||gt,onChange:function(){pt.allow_late=!pt.allow_late,Be==""&&yt([{late_penalty:5}]),Yt(Object.assign({},pt))}},_.a.createElement("strong",null,"\u5F00\u542F\u8865\u4EA4")),_.a.createElement(F.a,{overlayStyle:{width:380,maxWidth:380},title:_.a.createElement("div",{style:{display:"flex",flexFlow:"column"}},_.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219\u8BF4\u660E"),_.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"),_.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"))},_.a.createElement(N.a,null)))),(pt==null?void 0:pt.allow_late)&&_.a.createElement("div",{style:{marginLeft:22}},_.a.createElement("div",{className:"ml30 mt20"},_.a.createElement("span",null,"\u8865\u4EA4\u65B9\u5F0F\uFF1A"),_.a.createElement(m.a.Group,{disabled:ut||(Ve==null?void 0:Ve.anonymous_comment)||(Ve==null?void 0:Ve.allow_late),value:pt.unified_late,onChange:function(qe){pt.unified_late=qe.target.value,Be==""&&!qe.target.value&&yt([{penalty_type:me.a.Percent,late_penalty:20}]),Yt(Object(C.a)({},pt))}},(pt==null?void 0:pt.unified_setting)&&_.a.createElement(m.a,{value:!0}," \u7EDF\u4E00\u8865\u4EA4 "),(Ve==null||((Xe=Ve.group_settings)===null||Xe===void 0)?void 0:Xe.length)>0&&_.a.createElement(m.a,{value:!1}," \u5206\u73ED\u8865\u4EA4 "))),pt!=null&&pt.unified_late?_.a.createElement(_.a.Fragment,null,_.a.createElement(b.a,{align:"middle",className:"mt25 pl30"},_.a.createElement(r.a,null,"\u8865\u4EA4\u6263\u5206:"),_.a.createElement(r.a,{className:"ml5"},_.a.createElement(me.b,{disabled:ut||zt,value:{type:pt.penalty_type,inputValue:pt.late_penalty},onChange:function(qe){Yt(Object(C.a)(Object(C.a)({},pt),{},{late_penalty:qe.inputValue,penalty_type:qe.type}))}})),_.a.createElement(r.a,{flex:"1",className:"ml5"},_.a.createElement("span",{className:"c-grey-c ml10"},pt.penalty_type===me.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)"))),_.a.createElement(b.a,{align:"middle",className:"mt25 pl30"},_.a.createElement(r.a,null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4:"),_.a.createElement(r.a,{className:"ml5"},_.a.createElement(p.a,{allowClear:!1,style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:U()(Object(W.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:ut||zt,value:pt.late_time?U()(pt.late_time):"",disabledDate:function(qe){return Ae(qe,Ve==null?void 0:Ve.course_end_date)},onChange:function(qe,jt){pt.late_time=jt,Yt(Object.assign({},pt))}})),_.a.createElement(r.a,null,_.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(De,qe){var jt;return _.a.createElement(r.a,{span:24,key:qe},_.a.createElement(b.a,{className:"mt25"},_.a.createElement(r.a,{style:{marginLeft:30}},_.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219",qe+1,"\uFF1A"),_.a.createElement(M.a,{disabled:ut||!(Ft!=null&&(jt=Ft.homework_status)!==null&&jt!==void 0&&jt.includes("\u672A\u53D1\u5E03"))&&De.id||(Ve==null?void 0:Ve.anonymous_comment),mode:"multiple",style:{width:306},value:typeof De.group_name=="string"?[De.group_name]:De.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(gn){Be[qe].group_name=gn,Be[qe].group_id=De.group_id,yt(Be.slice())}},Ve.group_settings&&Ve.group_settings.map(function(Zt){var gn=Be.map(function(ur){return ur.group_name}).flat(),On=ae.map(function(ur){return ur.group_name}).flat();if(pt!=null&&pt.unified_setting){if(!gn.includes(Zt.group_name))return _.a.createElement($e,{value:Zt.group_name,key:Zt.id},Zt.group_name)}else if(On.includes(Zt.group_name)&&(!gn.includes(Zt.group_name)&&U()(Zt.end_time)<=U()()))return _.a.createElement($e,{value:Zt.group_name,key:Zt.id},Zt.group_name)}))),_.a.createElement(r.a,{className:"ml20"},_.a.createElement("span",null,"\u8865\u4EA4\u6263\u5206\uFF1A"),_.a.createElement(me.b,{disabled:ut||$t(De.id),value:{type:De.penalty_type,inputValue:De.late_penalty},onChange:function(gn){Be[qe].late_penalty=gn.inputValue,Be[qe].penalty_type=gn.type,yt(Object(g.a)(Be))}})),_.a.createElement(r.a,{className:"ml20"},_.a.createElement("span",null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4\uFF1A"),_.a.createElement(p.a,{disabled:ut||$t(De.id),style:{width:200},showTime:{format:"HH:mm",defaultValue:U()(Object(W.d)(),"HH:mm")},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",disabledDate:function(gn){return Ae(gn,Ve==null?void 0:Ve.course_end_date)},format:"YYYY-MM-DD HH:mm",value:De!=null&&De.late_time?U()(De.late_time):void 0,onChange:function(gn,On){Be[qe].late_time=On,yt(Object(g.a)(Be))}})),!ut&&_.a.createElement(r.a,{className:"ml20"},qe>0&&!De.id&&_.a.createElement(y.a,{onClick:function(){Be=Be.filter(function(gn,On){return qe!==On}),yt(Be.slice()),setTimeout(function(){return yt(Be.slice())},10)}}),_.a.createElement(v.a,{className:"c-green ml20",onClick:function(){yt(Be.concat({penalty_type:me.a.Percent,late_minus_score:20}))}}))))})),_.a.createElement(O.a,null),!ut&&_.a.createElement(r.a,{className:"mb50"},_.a.createElement(d.a,{type:"primary",size:"large",style:{marginTop:"40px"},loading:Pe,onClick:function(){return Ot()}},"\u63D0\u4EA4"),_.a.createElement(d.a,{type:"primary",size:"large",ghost:!0,className:"ml20",onClick:function(){mt(!0),St()}},"\u53D6\u6D88")))};re.a=Object(se.a)(function(ye){var Re=ye.shixunHomeworks,nt=ye.loading;return{shixunHomeworks:Re,loading:nt.effects}})(Tt)},fW2E:function(Ye,re){var I={shadowBlur:1,shadowOffsetX:1,shadowOffsetY:1,textShadowBlur:1,textShadowOffsetX:1,textShadowOffsetY:1,textBoxShadowBlur:1,textBoxShadowOffsetX:1,textBoxShadowOffsetY:1};function Y(H,P,F){return I.hasOwnProperty(P)?F*=H.dpr:F}Ye.exports=Y},fyJ8:function(Ye,re,I){"use strict";var Y=I("rePB"),H=I("VTBJ"),P=I("Ff2n"),F=I("U8pU"),R=I("q1tI"),O=I.n(R),D=I("TSYQ"),m=I.n(D),T=I("c+Xe"),b=I("sR1s");function i(s){return s&&Object(F.a)(s)==="object"&&!Array.isArray(s)&&!R.isValidElement(s)}function d(s){return typeof s=="string"?!0:Object(T.c)(s)}function c(s,o){var t,h=s.prefixCls,g=s.className,C=s.record,A=s.index,w=s.dataIndex,M=s.render,E=s.children,p=s.component,l=p===void 0?"td":p,u=s.colSpan,f=s.rowSpan,_=s.fixLeft,y=s.fixRight,v=s.firstFixLeft,N=s.lastFixLeft,j=s.firstFixRight,U=s.lastFixRight,G=s.appendNode,z=s.additionalProps,L=z===void 0?{}:z,V=s.ellipsis,W=s.align,$=s.rowType,q=s.isSticky,fe="".concat(h,"-cell"),se,me;if(E)me=E;else{var ve=Object(b.b)(C,w);if(me=ve,M){var Ae=M(ve,C,A);i(Ae)?(me=Ae.children,se=Ae.props):me=Ae}}Object(F.a)(me)==="object"&&!Array.isArray(me)&&!R.isValidElement(me)&&(me=null),V&&(N||j)&&(me=R.createElement("span",{className:"".concat(fe,"-content")},me));var ge=se||{},ue=ge.colSpan,$e=ge.rowSpan,Tt=ge.style,ye=ge.className,Re=Object(P.a)(ge,["colSpan","rowSpan","style","className"]),nt=ue!==void 0?ue:u,Ue=$e!==void 0?$e:f;if(nt===0||Ue===0)return null;var ke={},lt=typeof _=="number",Fe=typeof y=="number";lt&&(ke.position="sticky",ke.left=_),Fe&&(ke.position="sticky",ke.right=y);var Ze={};W&&(Ze.textAlign=W);var Xe,ft=V===!0?{showTitle:!0}:V;ft&&(ft.showTitle||$==="header")&&(typeof me=="string"||typeof me=="number"?Xe=me.toString():R.isValidElement(me)&&typeof me.props.children=="string"&&(Xe=me.props.children));var Rt=Object(H.a)(Object(H.a)(Object(H.a)({title:Xe},Re),L),{},{colSpan:nt&&nt!==1?nt:null,rowSpan:Ue&&Ue!==1?Ue:null,className:m()(fe,g,(t={},Object(Y.a)(t,"".concat(fe,"-fix-left"),lt),Object(Y.a)(t,"".concat(fe,"-fix-left-first"),v),Object(Y.a)(t,"".concat(fe,"-fix-left-last"),N),Object(Y.a)(t,"".concat(fe,"-fix-right"),Fe),Object(Y.a)(t,"".concat(fe,"-fix-right-first"),j),Object(Y.a)(t,"".concat(fe,"-fix-right-last"),U),Object(Y.a)(t,"".concat(fe,"-ellipsis"),V),Object(Y.a)(t,"".concat(fe,"-with-append"),G),Object(Y.a)(t,"".concat(fe,"-fix-sticky"),(lt||Fe)&&q),t),L.className,ye),style:Object(H.a)(Object(H.a)(Object(H.a)(Object(H.a)({},L.style),Ze),ke),Tt),ref:d(l)?o:null});return R.createElement(l,Object.assign({},Rt),G,me)}var r=R.forwardRef(c);r.displayName="Cell";var a=R.memo(r,function(s,o){return o.shouldCellUpdate?!o.shouldCellUpdate(o.record,s.record):!1});re.a=a},gMzb:function(Ye,re,I){"use strict";var Y=I("k1fw"),H=I("oBTY"),P=I("9og8"),F=I("tJVT"),R=I("sRBo"),O=I("kaz8"),D=I("WmNS"),m=I.n(D),T=I("q1tI"),b=I.n(T),i=I("9kvl"),d=I("wlus"),c=I("w5pM"),r=I("ErOA"),a=I("OaEy"),s=I("2fM7"),o=I("y8nQ"),t=I("Vl3Y"),h=I("Ty5D"),g=I("yQHh"),C=I.n(g),A=O.a.Group,w=function(f){var _,y,v,N,j,U,G,z,L=f.classroomList,V=f.loading,W=f.user,$=f.exercise_id,q=$===void 0?null:$,fe=f.homework_common_id,se=fe===void 0?null:fe,me=f.setitem,ve=f.item,Ae=f.type,ge=f.rz,ue=f.dispatch,$e=Object(T.useState)([]),Tt=Object(F.a)($e,2),ye=Tt[0],Re=Tt[1],nt=Object(T.useState)({zydatas:[],jbdatas:[],kcdatas:[],zsdatas:[],page:1,per_page:20}),Ue=Object(F.a)(nt,2),ke=Ue[0],lt=Ue[1],Fe=Object(h.i)(),Ze=Object(T.useState)(!1),Xe=Object(F.a)(Ze,2),ft=Xe[0],Rt=Xe[1],Pt=Object(T.useState)(!1),Bt=Object(F.a)(Pt,2),Ve=Bt[0],Ft=Bt[1],nn=t.a.useForm(),Le=Object(F.a)(nn,1),Se=Le[0];Object(T.useEffect)(function(){ge&&(ke.zydatas=ge,lt(Object(Y.a)({},ke)),ve!=null&&ve.ec_course_id&&ut())},[ve,ge]);function ut(){return mt.apply(this,arguments)}function mt(){return mt=Object(P.a)(m.a.mark(function ie(){return m.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return console.log("----",ve),ce.next=3,We(ve==null?void 0:ve.ec_major_school_id);case 3:return ce.next=5,Pe(ve==null?void 0:ve.ec_year_id);case 5:return ce.next=7,we(ve==null?void 0:ve.ec_course_id);case 7:Se.setFieldsValue({ec_course_id:ve==null?void 0:ve.ec_course_id,ec_major_school_id:ve==null?void 0:ve.ec_major_school_id,ec_point_ids:ve==null?void 0:ve.ec_point_ids,ec_year_id:ve==null?void 0:ve.ec_year_id});case 8:case"end":return ce.stop()}},ie)})),mt.apply(this,arguments)}function We(ie){return vt.apply(this,arguments)}function vt(){return vt=Object(P.a)(m.a.mark(function ie(ae){var ce;return m.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return Ce.next=2,Object(r.a)("/api/ec_major_schools/".concat(ae,"/ec_years/get_year_list.json"),{method:"get"});case 2:ce=Ce.sent,ke.jbdatas=ce==null?void 0:ce.data,lt(Object(Y.a)({},ke)),Se.setFieldsValue({ec_year_id:"",ec_course_id:"",ec_point_ids:[]});case 6:case"end":return Ce.stop()}},ie)})),vt.apply(this,arguments)}function Pe(ie){return xe.apply(this,arguments)}function xe(){return xe=Object(P.a)(m.a.mark(function ie(ae){var ce;return m.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return Ce.next=2,Object(r.a)("/api/ec_years/".concat(ae,"/ec_courses/get_courses.json"),{method:"get"});case 2:ce=Ce.sent,ke.kcdatas=ce==null?void 0:ce.data,lt(Object(Y.a)({},ke)),Se.setFieldsValue({ec_course_id:"",ec_point_ids:[]});case 6:case"end":return Ce.stop()}},ie)})),xe.apply(this,arguments)}var we=function(){var ie=Object(P.a)(m.a.mark(function ae(ce){var be;return m.a.wrap(function(Be){for(;;)switch(Be.prev=Be.next){case 0:return Be.next=2,Object(r.a)("/api/ec_courses/".concat(ce,"/ec_points.json"),{method:"get",params:{ec_course_id:ce}});case 2:be=Be.sent,ke.zsdatas=be==null?void 0:be.data,lt(Object(Y.a)({},ke));case 5:case"end":return Be.stop()}},ae)}));return function(ce){return ie.apply(this,arguments)}}();return b.a.createElement("div",{className:C.a.from},b.a.createElement(t.a,{form:Se,layout:"inline",onValuesChange:function(ae){console.log("----",ae),ae.ec_major_school_id&&(ke.jbdatas=[],ke.kcdatas=[],ke.zsdatas=[],lt(Object(Y.a)({},ke)),We(ae.ec_major_school_id)),ae.ec_year_id&&(ke.kcdatas=[],ke.zsdatas=[],lt(Object(Y.a)({},ke)),Pe(ae.ec_year_id)),ae.ec_course_id&&(ke.zsdatas=[],lt(Object(Y.a)({},ke)),we(ae.ec_course_id))},onFinish:function(){var ie=Object(P.a)(m.a.mark(function ae(ce){return m.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:me(ce);case 1:case"end":return Ce.stop()}},ae)}));return function(ae){return ie.apply(this,arguments)}}()},b.a.createElement(t.a.Item,{label:"\u8BA4\u8BC1\u4E13\u4E1A",name:"ec_major_school_id"},b.a.createElement(s.a,{style:{width:150},disabled:((_=ke.zydatas)===null||_===void 0?void 0:_.length)<=0,placeholder:"\u8BF7\u9009\u62E9\u8BA4\u8BC1\u4E13\u4E1A"},ke==null||((y=ke.zydatas)===null||y===void 0)?void 0:y.map(function(ie,ae){return b.a.createElement(s.a.Option,{key:ae,value:ie==null?void 0:ie.ec_major_school_id},ie==null?void 0:ie.name)}))),b.a.createElement(t.a.Item,{label:"\u8BA4\u8BC1\u5C4A\u522B",name:"ec_year_id"},b.a.createElement(s.a,{style:{width:150},disabled:((v=ke.jbdatas)===null||v===void 0?void 0:v.length)<=0,placeholder:"\u8BF7\u9009\u62E9\u8BA4\u8BC1\u5C4A\u522B"},ke==null||((N=ke.jbdatas)===null||N===void 0)?void 0:N.map(function(ie,ae){return b.a.createElement(s.a.Option,{key:ae,value:ie==null?void 0:ie.ec_year_id},ie==null?void 0:ie.year)}))),b.a.createElement(t.a.Item,{label:"\u8BFE\u7A0B",name:"ec_course_id"},b.a.createElement(s.a,{style:{width:150},disabled:((j=ke.kcdatas)===null||j===void 0?void 0:j.length)<=0,placeholder:"\u8BF7\u9009\u62E9\u8BFE\u7A0B"},ke==null||((U=ke.kcdatas)===null||U===void 0)?void 0:U.map(function(ie,ae){return b.a.createElement(s.a.Option,{key:ae,value:ie==null?void 0:ie.id},ie==null?void 0:ie.name)}))),b.a.createElement(t.a.Item,{label:"\u77E5\u8BC6\u70B9",name:"ec_point_ids"},b.a.createElement(s.a,{onChange:function(){Se.submit()},style:{width:150},mode:"multiple",disabled:((G=ke.zsdatas)===null||G===void 0?void 0:G.length)<=0,placeholder:"\u8BF7\u9009\u62E9\u77E5\u8BC6\u70B9"},ke==null||((z=ke.zsdatas)===null||z===void 0)?void 0:z.map(function(ie,ae){return b.a.createElement(s.a.Option,{key:ae,value:ie==null?void 0:ie.id},ie==null?void 0:ie.name)})))))},M=Object(i.a)(function(u){var f=u.classroomList,_=u.loading,y=u.globalSetting,v=u.user;return{classroomList:f,globalSetting:y,loading:_.effects,user:v}})(w),E=O.a.Group,p=function(f){var _,y,v,N=f.classroomList,j=f.loading,U=f.user,G=f.exercise_id,z=G===void 0?null:G,L=f.homework_common_id,V=L===void 0?null:L,W=f.setitem,$=f.type,q=f.dispatch,fe=Object(T.useState)([{}]),se=Object(F.a)(fe,2),me=se[0],ve=se[1],Ae=Object(T.useState)([]),ge=Object(F.a)(Ae,2),ue=ge[0],$e=ge[1];function Tt(){return ye.apply(this,arguments)}function ye(){return ye=Object(P.a)(m.a.mark(function Ue(){var ke,lt,Fe,Ze,Xe;return m.a.wrap(function(Rt){for(;;)switch(Rt.prev=Rt.next){case 0:return Rt.next=2,Object(r.a)("/api/ec_courses/".concat(0,"/ec_points/get_work_points.json"),{method:"get",params:{exercise_id:z,homework_common_id:V}});case 2:lt=Rt.sent,(lt==null||((ke=lt.data)===null||ke===void 0)?void 0:ke.length)>0&&(Xe=[],lt==null||((Fe=lt.data)===null||Fe===void 0)||Fe.map(function(Pt){var Bt;Pt==null||((Bt=Pt.ec_point_ids)===null||Bt===void 0)||Bt.map(function(Ve){Xe.push(Ve)})}),W(Object(Y.a)(Object(Y.a)({},lt==null||((Ze=lt.data)===null||Ze===void 0)?void 0:Ze[0]),{},{ec_point_ids:Xe})),ve(lt==null?void 0:lt.data));case 4:case"end":return Rt.stop()}},Ue)})),ye.apply(this,arguments)}Object(T.useEffect)(function(){var Ue,ke;U!=null&&(Ue=U.userInfo)!==null&&Ue!==void 0&&(ke=Ue.course)!==null&&ke!==void 0&&ke.course_school_id&&Re()},[U==null||((_=U.userInfo)===null||_===void 0||((y=_.course)===null||y===void 0))?void 0:y.course_school_id]);function Re(){return nt.apply(this,arguments)}function nt(){return nt=Object(P.a)(m.a.mark(function Ue(){var ke,lt,Fe;return m.a.wrap(function(Xe){for(;;)switch(Xe.prev=Xe.next){case 0:return Xe.next=2,Object(r.a)("/api/schools/".concat(U==null||((ke=U.userInfo)===null||ke===void 0||((lt=ke.course)===null||lt===void 0))?void 0:lt.course_school_id,"/ec_majors/get_major_list.json"),{method:"get"});case 2:Fe=Xe.sent,$e(Fe==null?void 0:Fe.data),(V||z)&&Tt();case 5:case"end":return Xe.stop()}},Ue)})),nt.apply(this,arguments)}return console.log(me),b.a.createElement("div",{style:{display:(v=U.userInfo.course)!==null&&v!==void 0&&v.is_openengineering?"":"none"}},b.a.createElement("p",{style:{fontSize:"16px",fontWeight:400}},"\u5DE5\u7A0B\u8BA4\u8BC1\u8003\u6838\u77E5\u8BC6\u70B9"),me==null?void 0:me.map(function(Ue,ke){return b.a.createElement("div",{style:{display:"flex",alignItems:"center",marginBottom:"10px"}},b.a.createElement(M,{rz:ue,item:Ue,type:ke,setitem:function(Fe){me.splice(ke,1,Fe),ve(Object(H.a)(me));var Ze=[];me==null||me.map(function(Xe){var ft;Xe==null||((ft=Xe.ec_point_ids)===null||ft===void 0)||ft.map(function(Rt){Ze.push(Rt)})}),W(Object(Y.a)(Object(Y.a)({},Fe),{},{ec_point_ids:Ze}))}}),ke!=0&&b.a.createElement(d.a,{onClick:function(){me.splice(ke,1),ve(Object(H.a)(me))},style:{marginLeft:10,fontSize:"20px"}}),b.a.createElement(c.a,{onClick:function(){me.push({}),ve(Object(H.a)(me))},style:{marginLeft:10,fontSize:"20px"}}))}))},l=re.a=Object(i.a)(function(u){var f=u.classroomList,_=u.loading,y=u.globalSetting,v=u.user;return{classroomList:f,globalSetting:y,loading:_.effects,user:v}})(p)},gut8:function(Ye,re){var I={NONE:0,STYLE_BIND:1,PLAIN_TEXT:2},Y=9;re.ContextCachedBy=I,re.WILL_BE_RESTORED=Y},h7HQ:function(Ye,re,I){var Y=I("y+Vt"),H=I("T6xi"),P=Y.extend({type:"polygon",shape:{points:null,smooth:!1,smoothConstraint:null},buildPath:function(F,R){H.buildPath(F,R,!0)}});Ye.exports=P},hOwI:function(Ye,re){var I=Math.log(2);function Y(P,F,R,O,D,m){var T=O+"-"+D,b=P.length;if(m.hasOwnProperty(T))return m[T];if(F===1){var i=Math.round(Math.log((1<<b)-1&~D)/I);return P[R][i]}for(var d=O|1<<R,c=R+1;O&1<<c;)c++;for(var r=0,a=0,s=0;a<b;a++){var o=1<<a;o&D||(r+=(s%2?-1:1)*P[R][a]*Y(P,F-1,c,d,D|o,m),s++)}return m[T]=r,r}function H(P,F){var R=[[P[0],P[1],1,0,0,0,-F[0]*P[0],-F[0]*P[1]],[0,0,0,P[0],P[1],1,-F[1]*P[0],-F[1]*P[1]],[P[2],P[3],1,0,0,0,-F[2]*P[2],-F[2]*P[3]],[0,0,0,P[2],P[3],1,-F[3]*P[2],-F[3]*P[3]],[P[4],P[5],1,0,0,0,-F[4]*P[4],-F[4]*P[5]],[0,0,0,P[4],P[5],1,-F[5]*P[4],-F[5]*P[5]],[P[6],P[7],1,0,0,0,-F[6]*P[6],-F[6]*P[7]],[0,0,0,P[6],P[7],1,-F[7]*P[6],-F[7]*P[7]]],O={},D=Y(R,8,0,0,0,O);if(D===0)return;for(var m=[],T=0;T<8;T++)for(var b=0;b<8;b++)m[b]==null&&(m[b]=0),m[b]+=((T+b)%2?-1:1)*Y(R,7,T===0?1:0,1<<T,1<<b,O)/D*F[T];return function(i,d,c){var r=d*m[6]+c*m[7]+1;i[0]=(d*m[0]+c*m[1]+m[2])/r,i[1]=(d*m[3]+c*m[4]+m[5])/r}}re.buildTransformer=H},hW8S:function(Ye,re,I){"use strict";I.d(re,"a",function(){return F}),I.d(re,"c",function(){return R}),I.d(re,"b",function(){return O});var Y=I("VTBJ"),H=I("Ff2n"),P=I("Kwbf"),F="RC_TABLE_INTERNAL_COL_DEFINE";function R(D){var m=D.expandable,T=Object(H.a)(D,["expandable"]);return"expandable"in D?Object(Y.a)(Object(Y.a)({},T),m):T}function O(D){return Object.keys(D).reduce(function(m,T){return(T.substr(0,5)==="data-"||T.substr(0,5)==="aria-")&&(m[T]=D[T]),m},{})}},hX1E:function(Ye,re){var I=Math.PI*2;function Y(H){return H%=I,H<0&&(H+=I),H}re.normalizeRadian=Y},hydK:function(Ye,re){var I="http://www.w3.org/2000/svg";function Y(H){return document.createElementNS(I,H)}re.createElement=Y},hyiK:function(Ye,re){function I(Y,H,P,F,R,O){if(O>H&&O>F||O<H&&O<F)return 0;if(F===H)return 0;var D=F<H?1:-1,m=(O-H)/(F-H);(m===1||m===0)&&(D=F<H?.5:-.5);var T=m*(P-Y)+Y;return T===R?Infinity:T>R?D:0}Ye.exports=I},iXp4:function(Ye,re,I){var Y=I("ItGF"),H=[["shadowBlur",0],["shadowColor","#000"],["shadowOffsetX",0],["shadowOffsetY",0]];function P(F){return Y.browser.ie&&Y.browser.version>=11?function(){var R=this.__clipPaths,O=this.style,D;if(R)for(var m=0;m<R.length;m++){var T=R[m],b=T&&T.shape,i=T&&T.type;if(b&&(i==="sector"&&b.startAngle===b.endAngle||i==="rect"&&(!b.width||!b.height))){for(var d=0;d<H.length;d++)H[d][2]=O[H[d][0]],O[H[d][0]]=H[d][1];D=!0;break}}if(F.apply(this,arguments),D)for(var d=0;d<H.length;d++)O[H[d][0]]=H[d][2]}:F}Ye.exports=P},j5sG:function(Ye,re,I){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.createSensor=void 0;var Y=H(I("NohK"));function H(F){return F&&F.__esModule?F:{default:F}}var P=function(R){var O=void 0,D=[],m=(0,Y.default)(function(){D.forEach(function(c){c(R)})}),T=function(){var r=new ResizeObserver(m);return r.observe(R),m(),r},b=function(r){O||(O=T()),D.indexOf(r)===-1&&D.push(r)},i=function(){O.disconnect(),D=[],O=void 0},d=function(r){var a=D.indexOf(r);a!==-1&&D.splice(a,1),D.length===0&&O&&i()};return{element:R,bind:b,destroy:i,unbind:d}};re.createSensor=P},jTL6:function(Ye,re,I){var Y=I("y+Vt"),H=Y.extend({type:"arc",shape:{cx:0,cy:0,r:0,startAngle:0,endAngle:Math.PI*2,clockwise:!0},style:{stroke:"#000",fill:null},buildPath:function(P,F){var R=F.cx,O=F.cy,D=Math.max(F.r,0),m=F.startAngle,T=F.endAngle,b=F.clockwise,i=Math.cos(m),d=Math.sin(m);P.moveTo(i*D+R,d*D+O),P.arc(R,O,D,m,T,!b)}});Ye.exports=H},juDX:function(Ye,re,I){I("P47w");var Y=I("aX58"),H=Y.registerPainter,P=I("3CBa");H("svg",P)},k3GJ:function(Ye,re,I){"use strict";I.d(re,"a",function(){return vi});var Y=I("rePB"),H=I("ODXe"),P=I("Ff2n"),F=I("VTBJ"),R=I("q1tI"),O=I("TSYQ"),D=I.n(O),m=I("Zm9Q"),T=I("6cGi"),b=I("KQm4"),i=I("xEkU"),d=I.n(i),c=I("t23M");function r(Oe){var et=Object(R.useRef)(),rt=Object(R.useRef)(!1);function Ie(){for(var de=arguments.length,Ee=new Array(de),pe=0;pe<de;pe++)Ee[pe]=arguments[pe];rt.current||(d.a.cancel(et.current),et.current=d()(function(){Oe.apply(void 0,Ee)}))}return Object(R.useEffect)(function(){return function(){rt.current=!0,d.a.cancel(et.current)}},[]),Ie}function a(Oe){var et=Object(R.useRef)([]),rt=Object(R.useState)({}),Ie=Object(H.a)(rt,2),de=Ie[1],Ee=Object(R.useRef)(typeof Oe=="function"?Oe():Oe),pe=r(function(){var Ke=Ee.current;et.current.forEach(function(ot){Ke=ot(Ke)}),et.current=[],Ee.current=Ke,de({})});function Ne(Ke){et.current.push(Ke),pe()}return[Ee.current,Ne]}var s=I("4IlW");function o(Oe,et){var rt,Ie=Oe.prefixCls,de=Oe.id,Ee=Oe.active,pe=Oe.rtl,Ne=Oe.tab,Ke=Ne.key,ot=Ne.tab,He=Ne.disabled,_t=Ne.closeIcon,Ut=Oe.tabBarGutter,en=Oe.tabPosition,hn=Oe.closable,Rn=Oe.renderWrapper,Wn=Oe.removeAriaLabel,lr=Oe.editable,on=Oe.onClick,It=Oe.onRemove,Jt=Oe.onFocus,Pn="".concat(Ie,"-tab");R.useEffect(function(){return It},[]);var En={};en==="top"||en==="bottom"?En[pe?"marginLeft":"marginRight"]=Ut:En.marginBottom=Ut;var vr=lr&&hn!==!1&&!He;function qn(pn){if(He)return;on(pn)}function Tr(pn){pn.preventDefault(),pn.stopPropagation(),lr.onEdit("remove",{key:Ke,event:pn})}var ir=R.createElement("div",{key:Ke,ref:et,className:D()(Pn,(rt={},Object(Y.a)(rt,"".concat(Pn,"-with-remove"),vr),Object(Y.a)(rt,"".concat(Pn,"-active"),Ee),Object(Y.a)(rt,"".concat(Pn,"-disabled"),He),rt)),style:En,onClick:qn},R.createElement("div",{role:"tab","aria-selected":Ee,id:de&&"".concat(de,"-tab-").concat(Ke),className:"".concat(Pn,"-btn"),"aria-controls":de&&"".concat(de,"-panel-").concat(Ke),"aria-disabled":He,tabIndex:He?null:0,onClick:function(Mn){Mn.stopPropagation(),qn(Mn)},onKeyDown:function(Mn){[s.a.SPACE,s.a.ENTER].includes(Mn.which)&&(Mn.preventDefault(),qn(Mn))},onFocus:Jt},ot),vr&&R.createElement("button",{type:"button","aria-label":Wn||"remove",tabIndex:0,className:"".concat(Pn,"-remove"),onClick:function(Mn){Mn.stopPropagation(),Tr(Mn)}},_t||lr.removeIcon||"\xD7"));return Rn&&(ir=Rn(ir)),ir}var t=R.forwardRef(o),h={width:0,height:0,left:0,top:0};function g(Oe,et,rt){return Object(R.useMemo)(function(){for(var Ie,de=new Map,Ee=et.get((Ie=Oe[0])===null||Ie===void 0?void 0:Ie.key)||h,pe=Ee.left+Ee.width,Ne=0;Ne<Oe.length;Ne+=1){var Ke=Oe[Ne].key,ot=et.get(Ke);if(!ot){var He;ot=et.get((He=Oe[Ne-1])===null||He===void 0?void 0:He.key)||h}var _t=de.get(Ke)||Object(F.a)({},ot);_t.right=pe-_t.left-_t.width,de.set(Ke,_t)}return de},[Oe.map(function(Ie){return Ie.key}).join("_"),et,rt])}var C={width:0,height:0,left:0,top:0,right:0};function A(Oe,et,rt,Ie,de){var Ee=de.tabs,pe=de.tabPosition,Ne=de.rtl,Ke,ot,He;["top","bottom"].includes(pe)?(Ke="width",ot=Ne?"right":"left",He=Math.abs(et.left)):(Ke="height",ot="top",He=-et.top);var _t=et[Ke],Ut=rt[Ke],en=Ie[Ke],hn=_t;return Ut+en>_t&&(hn=_t-en),Object(R.useMemo)(function(){if(!Ee.length)return[0,0];for(var Rn=Ee.length,Wn=Rn,lr=0;lr<Rn;lr+=1){var on=Oe.get(Ee[lr].key)||C;if(on[ot]+on[Ke]>He+hn){Wn=lr-1;break}}for(var It=0,Jt=Rn-1;Jt>=0;Jt-=1){var Pn=Oe.get(Ee[Jt].key)||C;if(Pn[ot]<He){It=Jt+1;break}}return[It,Wn]},[Oe,He,hn,pe,Ee.map(function(Rn){return Rn.key}).join("_"),Ne])}var w=I("wx14"),M=I("1OyB"),E=I("vuIU"),p=I("JX7q"),l=I("Ji7U"),u=I("LK+K"),f=I("I8Z2"),_=I("bT9E"),y=I("2GS6"),v=I("Gytx"),N=I.n(v),j=I("U8pU"),U=/iPhone/i,G=/iPod/i,z=/iPad/i,L=/\bAndroid(?:.+)Mobile\b/i,V=/Android/i,W=/\bAndroid(?:.+)SD4930UR\b/i,$=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,q=/Windows Phone/i,fe=/\bWindows(?:.+)ARM\b/i,se=/BlackBerry/i,me=/BB10/i,ve=/Opera Mini/i,Ae=/\b(CriOS|Chrome)(?:.+)Mobile/i,ge=/Mobile(?:.+)Firefox\b/i;function ue(Oe,et){return Oe.test(et)}function $e(Oe){var et=Oe||(typeof navigator!="undefined"?navigator.userAgent:""),rt=(et||"").split("[FBAN");if(typeof rt[1]!="undefined"){var Ie=rt,de=Object(H.a)(Ie,1);et=de[0]}if(rt=et.split("Twitter"),typeof rt[1]!="undefined"){var Ee=rt,pe=Object(H.a)(Ee,1);et=pe[0]}var Ne={apple:{phone:ue(U,et)&&!ue(q,et),ipod:ue(G,et),tablet:!ue(U,et)&&ue(z,et)&&!ue(q,et),device:(ue(U,et)||ue(G,et)||ue(z,et))&&!ue(q,et)},amazon:{phone:ue(W,et),tablet:!ue(W,et)&&ue($,et),device:ue(W,et)||ue($,et)},android:{phone:!ue(q,et)&&ue(W,et)||!ue(q,et)&&ue(L,et),tablet:!ue(q,et)&&!ue(W,et)&&!ue(L,et)&&(ue($,et)||ue(V,et)),device:!ue(q,et)&&(ue(W,et)||ue($,et)||ue(L,et)||ue(V,et))||ue(/\bokhttp\b/i,et)},windows:{phone:ue(q,et),tablet:ue(fe,et),device:ue(q,et)||ue(fe,et)},other:{blackberry:ue(se,et),blackberry10:ue(me,et),opera:ue(ve,et),firefox:ue(ge,et),chrome:ue(Ae,et),device:ue(se,et)||ue(me,et)||ue(ve,et)||ue(ge,et)||ue(Ae,et)},any:null,phone:null,tablet:null};return Ne.any=Ne.apple.device||Ne.android.device||Ne.windows.device||Ne.other.device,Ne.phone=Ne.apple.phone||Ne.android.phone||Ne.windows.phone,Ne.tablet=Ne.apple.tablet||Ne.android.tablet||Ne.windows.tablet,Ne}var Tt=Object(F.a)(Object(F.a)({},$e()),{},{isMobile:$e}),ye=Tt;function Re(){}function nt(Oe,et,rt){var Ie=et||"";return Oe.key||"".concat(Ie,"item_").concat(rt)}function Ue(Oe){return"".concat(Oe,"-menu-")}function ke(Oe,et){var rt=-1;R.Children.forEach(Oe,function(Ie){rt+=1,Ie&&Ie.type&&Ie.type.isMenuItemGroup?R.Children.forEach(Ie.props.children,function(de){rt+=1,et(de,rt)}):et(Ie,rt)})}function lt(Oe,et,rt){if(!Oe||rt.find)return;R.Children.forEach(Oe,function(Ie){if(Ie){var de=Ie.type;if(!de||!(de.isSubMenu||de.isMenuItem||de.isMenuItemGroup))return;et.indexOf(Ie.key)!==-1?rt.find=!0:Ie.props.children&<(Ie.props.children,et,rt)}})}var Fe=["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"],Ze=function(et){var rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ie=et&&typeof et.getBoundingClientRect=="function"&&et.getBoundingClientRect().width;if(Ie){if(rt){var de=getComputedStyle(et),Ee=de.marginLeft,pe=de.marginRight;Ie+=+Ee.replace("px","")+ +pe.replace("px","")}Ie=+Ie.toFixed(6)}return Ie||0},Xe=function(et,rt,Ie){et&&Object(j.a)(et.style)==="object"&&(et.style[rt]=Ie)},ft=function(){return ye.any},Rt=I("bdgK"),Pt=I("i8i4"),Bt=I.n(Pt),Ve=I("wgJM"),Ft=I("l4aY"),nn=I("m+aA"),Le=I("c+Xe"),Se=I("zT1h"),ut=I("QC+M");function mt(Oe,et,rt){return rt?Oe[0]===et[0]:Oe[0]===et[0]&&Oe[1]===et[1]}function We(Oe,et,rt){var Ie=Oe[et]||{};return Object(F.a)(Object(F.a)({},Ie),rt)}function vt(Oe,et,rt,Ie){for(var de=rt.points,Ee=Object.keys(Oe),pe=0;pe<Ee.length;pe+=1){var Ne=Ee[pe];if(mt(Oe[Ne].points,de,Ie))return"".concat(et,"-placement-").concat(Ne)}return""}var Pe=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Oe=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(Oe)||/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(Oe==null?void 0:Oe.substr(0,4)))},xe=I("MNnm");function we(Oe,et){var rt={};return rt[Oe.toLowerCase()]=et.toLowerCase(),rt["Webkit".concat(Oe)]="webkit".concat(et),rt["Moz".concat(Oe)]="moz".concat(et),rt["ms".concat(Oe)]="MS".concat(et),rt["O".concat(Oe)]="o".concat(et.toLowerCase()),rt}function ie(Oe,et){var rt={animationend:we("Animation","AnimationEnd"),transitionend:we("Transition","TransitionEnd")};return Oe&&("AnimationEvent"in et||delete rt.animationend.animation,"TransitionEvent"in et||delete rt.transitionend.transition),rt}var ae=ie(Object(xe.a)(),typeof window!="undefined"?window:{}),ce={};if(Object(xe.a)()){var be=document.createElement("div");ce=be.style}var Ce={};function Be(Oe){if(Ce[Oe])return Ce[Oe];var et=ae[Oe];if(et)for(var rt=Object.keys(et),Ie=rt.length,de=0;de<Ie;de+=1){var Ee=rt[de];if(Object.prototype.hasOwnProperty.call(et,Ee)&&Ee in ce)return Ce[Oe]=et[Ee],Ce[Oe]}return""}var yt=Be("animationend"),Xt=Be("transitionend"),an=!!(yt&&Xt),pt=yt||"animationend",Yt=Xt||"transitionend";function St(Oe,et){if(!Oe)return null;if(Object(j.a)(Oe)==="object"){var rt=et.replace(/-\w/g,function(Ie){return Ie[1].toUpperCase()});return Oe[rt]}return"".concat(Oe,"-").concat(et)}var Ot="none",dt="appear",_e="enter",je="leave",kt="none",gt="prepare",zt="start",$t="active",De="end";function qe(Oe){var et=Object(R.useRef)(!1),rt=Object(R.useState)(Oe),Ie=Object(H.a)(rt,2),de=Ie[0],Ee=Ie[1];function pe(Ne){et.current||Ee(Ne)}return Object(R.useEffect)(function(){return function(){et.current=!0}},[]),[de,pe]}var jt=Object(xe.a)()?R.useLayoutEffect:R.useEffect,Zt=jt,gn=function(){var Oe=R.useRef(null);function et(){Ve.a.cancel(Oe.current)}function rt(Ie){var de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;et();var Ee=Object(Ve.a)(function(){de<=1?Ie({isCanceled:function(){return Ee!==Oe.current}}):rt(Ie,de-1)});Oe.current=Ee}return R.useEffect(function(){return function(){et()}},[]),[rt,et]},On=[gt,zt,$t,De],ur=!1,Kn=!0;function wn(Oe){return Oe===$t||Oe===De}var xr=function(Oe,et){var rt=R.useState(kt),Ie=Object(H.a)(rt,2),de=Ie[0],Ee=Ie[1],pe=gn(),Ne=Object(H.a)(pe,2),Ke=Ne[0],ot=Ne[1];function He(){Ee(gt)}return Zt(function(){if(de!==kt&&de!==De){var _t=On.indexOf(de),Ut=On[_t+1],en=et(de);en===ur?Ee(Ut):Ke(function(hn){function Rn(){if(hn.isCanceled())return;Ee(Ut)}en===!0?Rn():Promise.resolve(en).then(Rn)})}},[Oe,de]),R.useEffect(function(){return function(){ot()}},[]),[He,de]},Fr=function(Oe){var et=Object(R.useRef)(),rt=Object(R.useRef)(Oe);rt.current=Oe;var Ie=R.useCallback(function(pe){rt.current(pe)},[]);function de(pe){pe&&(pe.removeEventListener(Yt,Ie),pe.removeEventListener(pt,Ie))}function Ee(pe){et.current&&et.current!==pe&&de(et.current),pe&&pe!==et.current&&(pe.addEventListener(Yt,Ie),pe.addEventListener(pt,Ie),et.current=pe)}return R.useEffect(function(){return function(){de(et.current)}},[]),[Ee,de]};function hr(Oe,et,rt,Ie){var de=Ie.motionEnter,Ee=de===void 0?!0:de,pe=Ie.motionAppear,Ne=pe===void 0?!0:pe,Ke=Ie.motionLeave,ot=Ke===void 0?!0:Ke,He=Ie.motionDeadline,_t=Ie.motionLeaveImmediately,Ut=Ie.onAppearPrepare,en=Ie.onEnterPrepare,hn=Ie.onLeavePrepare,Rn=Ie.onAppearStart,Wn=Ie.onEnterStart,lr=Ie.onLeaveStart,on=Ie.onAppearActive,It=Ie.onEnterActive,Jt=Ie.onLeaveActive,Pn=Ie.onAppearEnd,En=Ie.onEnterEnd,vr=Ie.onLeaveEnd,qn=Ie.onVisibleChanged,Tr=qe(),ir=Object(H.a)(Tr,2),pn=ir[0],Mn=ir[1],gr=qe(Ot),Rr=Object(H.a)(gr,2),Jn=Rr[0],Mr=Rr[1],Yr=qe(null),Lr=Object(H.a)(Yr,2),Br=Lr[0],jr=Lr[1],Ir=Object(R.useRef)(!1),kr=Object(R.useRef)(null),fr=Object(R.useRef)(!1),si=Object(R.useRef)(null);function Qi(){var $r=rt();return $r||si.current}var ji=Object(R.useRef)(!1);function wi($r){var zr=Qi();if($r&&!$r.deadline&&$r.target!==zr)return;var yi;Jn===dt&&ji.current?yi=Pn==null?void 0:Pn(zr,$r):Jn===_e&&ji.current?yi=En==null?void 0:En(zr,$r):Jn===je&&ji.current&&(yi=vr==null?void 0:vr(zr,$r)),yi!==!1&&!fr.current&&(Mr(Ot),jr(null))}var Zr=Fr(wi),Gr=Object(H.a)(Zr,1),Xr=Gr[0],qr=R.useMemo(function(){var $r,zr,yi;switch(Jn){case"appear":return $r={},Object(Y.a)($r,gt,Ut),Object(Y.a)($r,zt,Rn),Object(Y.a)($r,$t,on),$r;case"enter":return zr={},Object(Y.a)(zr,gt,en),Object(Y.a)(zr,zt,Wn),Object(Y.a)(zr,$t,It),zr;case"leave":return yi={},Object(Y.a)(yi,gt,hn),Object(Y.a)(yi,zt,lr),Object(Y.a)(yi,$t,Jt),yi;default:return{}}},[Jn]),Ui=xr(Jn,function($r){if($r===gt){var zr=qr[gt];return zr?zr(Qi()):ur}if(Vr in qr){var yi;jr(((yi=qr[Vr])===null||yi===void 0?void 0:yi.call(qr,Qi(),null))||null)}return Vr===$t&&(Xr(Qi()),He>0&&(clearTimeout(kr.current),kr.current=setTimeout(function(){wi({deadline:!0})},He))),Kn}),ha=Object(H.a)(Ui,2),sa=ha[0],Vr=ha[1],Ji=wn(Vr);ji.current=Ji,Zt(function(){Mn(et);var $r=Ir.current;if(Ir.current=!0,!Oe)return;var zr;!$r&&et&&Ne&&(zr=dt),$r&&et&&Ee&&(zr=_e),($r&&!et&&ot||!$r&&_t&&!et&&ot)&&(zr=je),zr&&(Mr(zr),sa())},[et]),Object(R.useEffect)(function(){(Jn===dt&&!Ne||Jn===_e&&!Ee||Jn===je&&!ot)&&Mr(Ot)},[Ne,Ee,ot]),Object(R.useEffect)(function(){return function(){clearTimeout(kr.current),fr.current=!0}},[]),Object(R.useEffect)(function(){pn!==void 0&&Jn===Ot&&(qn==null||qn(pn))},[pn,Jn]);var Zi=Br;return qr[gt]&&Vr===zt&&(Zi=Object(F.a)({transition:"none"},Zi)),[Jn,Vr,Zi,pn!=null?pn:et]}var dr=function(Oe){Object(l.a)(rt,Oe);var et=Object(u.a)(rt);function rt(){return Object(M.a)(this,rt),et.apply(this,arguments)}return Object(E.a)(rt,[{key:"render",value:function(){return this.props.children}}]),rt}(R.Component),Nr=dr;function ti(Oe){var et=Oe;Object(j.a)(Oe)==="object"&&(et=Oe.transitionSupport);function rt(de){return!!(de.motionName&&et)}var Ie=R.forwardRef(function(de,Ee){var pe=de.visible,Ne=pe===void 0?!0:pe,Ke=de.removeOnLeave,ot=Ke===void 0?!0:Ke,He=de.forceRender,_t=de.children,Ut=de.motionName,en=de.leavedClassName,hn=de.eventProps,Rn=rt(de),Wn=Object(R.useRef)(),lr=Object(R.useRef)();function on(){try{return Object(nn.a)(Wn.current||lr.current)}catch(Mr){return null}}var It=hr(Rn,Ne,on,de),Jt=Object(H.a)(It,4),Pn=Jt[0],En=Jt[1],vr=Jt[2],qn=Jt[3],Tr=R.useRef(qn);qn&&(Tr.current=!0);var ir=Object(R.useRef)(Ee);ir.current=Ee;var pn=R.useCallback(function(Mr){Wn.current=Mr,Object(Le.b)(ir.current,Mr)},[]),Mn,gr=Object(F.a)(Object(F.a)({},hn),{},{visible:Ne});if(!_t)Mn=null;else if(Pn===Ot||!rt(de))qn?Mn=_t(Object(F.a)({},gr),pn):!ot&&Tr.current?Mn=_t(Object(F.a)(Object(F.a)({},gr),{},{className:en}),pn):He?Mn=_t(Object(F.a)(Object(F.a)({},gr),{},{style:{display:"none"}}),pn):Mn=null;else{var Rr,Jn;En===gt?Jn="prepare":wn(En)?Jn="active":En===zt&&(Jn="start"),Mn=_t(Object(F.a)(Object(F.a)({},gr),{},{className:D()(St(Ut,Pn),(Rr={},Object(Y.a)(Rr,St(Ut,"".concat(Pn,"-").concat(Jn)),Jn),Object(Y.a)(Rr,Ut,typeof Ut=="string"),Rr)),style:vr}),pn)}return R.createElement(Nr,{ref:lr},Mn)});return Ie.displayName="CSSMotion",Ie}var pi=ti(an),fn="add",ar="keep",oi="remove",_i="removed";function Qr(Oe){var et;return Oe&&Object(j.a)(Oe)==="object"&&"key"in Oe?et=Oe:et={key:Oe},Object(F.a)(Object(F.a)({},et),{},{key:String(et.key)})}function ni(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Oe.map(Qr)}function ee(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],rt=[],Ie=0,de=et.length,Ee=ni(Oe),pe=ni(et);Ee.forEach(function(ot){for(var He=!1,_t=Ie;_t<de;_t+=1){var Ut=pe[_t];if(Ut.key===ot.key){Ie<_t&&(rt=rt.concat(pe.slice(Ie,_t).map(function(en){return Object(F.a)(Object(F.a)({},en),{},{status:fn})})),Ie=_t),rt.push(Object(F.a)(Object(F.a)({},Ut),{},{status:ar})),Ie+=1,He=!0;break}}He||rt.push(Object(F.a)(Object(F.a)({},ot),{},{status:oi}))}),Ie<de&&(rt=rt.concat(pe.slice(Ie).map(function(ot){return Object(F.a)(Object(F.a)({},ot),{},{status:fn})})));var Ne={};rt.forEach(function(ot){var He=ot.key;Ne[He]=(Ne[He]||0)+1});var Ke=Object.keys(Ne).filter(function(ot){return Ne[ot]>1});return Ke.forEach(function(ot){rt=rt.filter(function(He){var _t=He.key,Ut=He.status;return _t!==ot||Ut!==oi}),rt.forEach(function(He){He.key===ot&&(He.status=ar)})}),rt}var B=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function K(Oe){var et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:pi,rt=function(Ie){Object(l.a)(Ee,Ie);var de=Object(u.a)(Ee);function Ee(){var pe;return Object(M.a)(this,Ee),pe=de.apply(this,arguments),pe.state={keyEntities:[]},pe.removeKey=function(Ne){pe.setState(function(Ke){var ot=Ke.keyEntities;return{keyEntities:ot.map(function(He){return He.key!==Ne?He:Object(F.a)(Object(F.a)({},He),{},{status:_i})})}})},pe}return Object(E.a)(Ee,[{key:"render",value:function(){var Ne=this,Ke=this.state.keyEntities,ot=this.props,He=ot.component,_t=ot.children,Ut=ot.onVisibleChanged,en=Object(P.a)(ot,["component","children","onVisibleChanged"]),hn=He||R.Fragment,Rn={};return B.forEach(function(Wn){Rn[Wn]=en[Wn],delete en[Wn]}),delete en.keys,R.createElement(hn,en,Ke.map(function(Wn){var lr=Wn.status,on=Object(P.a)(Wn,["status"]),It=lr===fn||lr===ar;return R.createElement(et,Object(w.a)({},Rn,{key:on.key,visible:It,eventProps:on,onVisibleChanged:function(Pn){Ut==null||Ut(Pn,{key:on.key}),Pn||Ne.removeKey(on.key)}}),_t)}))}}],[{key:"getDerivedStateFromProps",value:function(Ne,Ke){var ot=Ne.keys,He=Ke.keyEntities,_t=ni(ot),Ut=ee(He,_t);return{keyEntities:Ut.filter(function(en){var hn=He.find(function(Rn){var Wn=Rn.key;return en.key===Wn});return!(hn&&hn.status===_i&&en.status===oi)})}}}]),Ee}(R.Component);return rt.defaultProps={component:"div"},rt}var Q=K(an),le=pi;function Z(Oe){var et=Oe.prefixCls,rt=Oe.motion,Ie=Oe.animation,de=Oe.transitionName;return rt||(Ie?{motionName:"".concat(et,"-").concat(Ie)}:de?{motionName:de}:null)}function Qe(Oe){var et=Oe.prefixCls,rt=Oe.visible,Ie=Oe.zIndex,de=Oe.mask,Ee=Oe.maskMotion,pe=Oe.maskAnimation,Ne=Oe.maskTransitionName;if(!de)return null;var Ke={};return(Ee||Ne||pe)&&(Ke=Object(F.a)({motionAppear:!0},Z({motion:Ee,prefixCls:et,transitionName:Ne,animation:pe}))),R.createElement(le,Object(w.a)({},Ke,{visible:rt,removeOnLeave:!0}),function(ot){var He=ot.className;return R.createElement("div",{style:{zIndex:Ie},className:D()("".concat(et,"-mask"),He)})})}var qt=I("9mu1"),An=I("o0o1"),Vn=I.n(An),sn=I("HaE+"),tr=["measure","align",null,"motion"],vn=function(Oe,et){var rt=Object(R.useState)(null),Ie=Object(H.a)(rt,2),de=Ie[0],Ee=Ie[1],pe=Object(R.useRef)(),Ne=Object(R.useRef)(!1);function Ke(_t){Ne.current||Ee(_t)}function ot(){Ve.a.cancel(pe.current)}function He(_t){ot(),pe.current=Object(Ve.a)(function(){Ke(function(Ut){switch(de){case"align":return"motion";case"motion":return"stable";default:}return Ut}),_t==null||_t()})}return Object(R.useEffect)(function(){Ke("measure")},[Oe]),Object(R.useEffect)(function(){switch(de){case"measure":et();break;default:}de&&(pe.current=Object(Ve.a)(Object(sn.a)(Vn.a.mark(function _t(){var Ut,en;return Vn.a.wrap(function(Rn){for(;;)switch(Rn.prev=Rn.next){case 0:Ut=tr.indexOf(de),en=tr[Ut+1],en&&Ut!==-1&&Ke(en);case 3:case"end":return Rn.stop()}},_t)}))))},[de]),Object(R.useEffect)(function(){return function(){Ne.current=!0,ot()}},[]),[de,He]},ln=function(Oe){var et=R.useState({width:0,height:0}),rt=Object(H.a)(et,2),Ie=rt[0],de=rt[1];function Ee(Ne){de({width:Ne.offsetWidth,height:Ne.offsetHeight})}var pe=R.useMemo(function(){var Ne={};if(Oe){var Ke=Ie.width,ot=Ie.height;Oe.indexOf("height")!==-1&&ot?Ne.height=ot:Oe.indexOf("minHeight")!==-1&&ot&&(Ne.minHeight=ot),Oe.indexOf("width")!==-1&&Ke?Ne.width=Ke:Oe.indexOf("minWidth")!==-1&&Ke&&(Ne.minWidth=Ke)}return Ne},[Oe,Ie]);return[pe,Ee]},xn=R.forwardRef(function(Oe,et){var rt=Oe.visible,Ie=Oe.prefixCls,de=Oe.className,Ee=Oe.style,pe=Oe.children,Ne=Oe.zIndex,Ke=Oe.stretch,ot=Oe.destroyPopupOnHide,He=Oe.forceRender,_t=Oe.align,Ut=Oe.point,en=Oe.getRootDomNode,hn=Oe.getClassNameFromAlign,Rn=Oe.onAlign,Wn=Oe.onMouseEnter,lr=Oe.onMouseLeave,on=Oe.onMouseDown,It=Oe.onTouchStart,Jt=Object(R.useRef)(),Pn=Object(R.useRef)(),En=Object(R.useState)(),vr=Object(H.a)(En,2),qn=vr[0],Tr=vr[1],ir=ln(Ke),pn=Object(H.a)(ir,2),Mn=pn[0],gr=pn[1];function Rr(){Ke&&gr(en())}var Jn=vn(rt,Rr),Mr=Object(H.a)(Jn,2),Yr=Mr[0],Lr=Mr[1],Br=Object(R.useRef)();function jr(){return Ut||en}function Ir(){var Zr;(Zr=Jt.current)===null||Zr===void 0||Zr.forceAlign()}function kr(Zr,Gr){var Xr=hn(Gr);qn!==Xr&&Tr(Xr),Yr==="align"&&(qn!==Xr?Promise.resolve().then(function(){Ir()}):Lr(function(){var qr;(qr=Br.current)===null||qr===void 0||qr.call(Br)}),Rn==null||Rn(Zr,Gr))}var fr=Object(F.a)({},Z(Oe));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(Zr){var Gr=fr[Zr];fr[Zr]=function(Xr,qr){return Lr(),Gr==null?void 0:Gr(Xr,qr)}});function si(){return new Promise(function(Zr){Br.current=Zr})}R.useEffect(function(){!fr.motionName&&Yr==="motion"&&Lr()},[fr.motionName,Yr]),R.useImperativeHandle(et,function(){return{forceAlign:Ir,getElement:function(){return Pn.current}}});var Qi=Object(F.a)(Object(F.a)({},Mn),{},{zIndex:Ne,opacity:Yr==="motion"||Yr==="stable"||!rt?void 0:0,pointerEvents:Yr==="stable"?void 0:"none"},Ee),ji=!0;(_t==null?void 0:_t.points)&&(Yr==="align"||Yr==="stable")&&(ji=!1);var wi=pe;return R.Children.count(pe)>1&&(wi=R.createElement("div",{className:"".concat(Ie,"-content")},pe)),R.createElement(le,Object(w.a)({visible:rt,ref:Pn,leavedClassName:"".concat(Ie,"-hidden")},fr,{onAppearPrepare:si,onEnterPrepare:si,removeOnLeave:ot,forceRender:He}),function(Zr,Gr){var Xr=Zr.className,qr=Zr.style,Ui=D()(Ie,de,qn,Xr);return R.createElement(qt.a,{target:jr(),key:"popup",ref:Jt,monitorWindowResize:!0,disabled:ji,align:_t,onAlign:kr},R.createElement("div",{ref:Gr,className:Ui,onMouseEnter:Wn,onMouseLeave:lr,onMouseDownCapture:on,onTouchStartCapture:It,style:Object(F.a)(Object(F.a)({},qr),Qi)},wi))})});xn.displayName="PopupInner";var In=xn,sr=R.forwardRef(function(Oe,et){var rt=Oe.prefixCls,Ie=Oe.visible,de=Oe.zIndex,Ee=Oe.children,pe=Oe.mobile;pe=pe===void 0?{}:pe;var Ne=pe.popupClassName,Ke=pe.popupStyle,ot=pe.popupMotion,He=ot===void 0?{}:ot,_t=pe.popupRender,Ut=R.useRef();R.useImperativeHandle(et,function(){return{forceAlign:function(){},getElement:function(){return Ut.current}}});var en=Object(F.a)({zIndex:de},Ke),hn=Ee;return R.Children.count(Ee)>1&&(hn=R.createElement("div",{className:"".concat(rt,"-content")},Ee)),_t&&(hn=_t(hn)),R.createElement(le,Object(w.a)({visible:Ie,ref:Ut,removeOnLeave:!0},He),function(Rn,Wn){var lr=Rn.className,on=Rn.style,It=D()(rt,Ne,lr);return R.createElement("div",{ref:Wn,className:It,style:Object(F.a)(Object(F.a)({},on),en)},hn)})});sr.displayName="MobilePopupInner";var $n=sr,Zn=["visible","mobile"],kn=R.forwardRef(function(Oe,et){var rt=Oe.visible,Ie=Oe.mobile,de=Object(P.a)(Oe,Zn),Ee=Object(R.useState)(rt),pe=Object(H.a)(Ee,2),Ne=pe[0],Ke=pe[1],ot=Object(R.useState)(!1),He=Object(H.a)(ot,2),_t=He[0],Ut=He[1],en=Object(F.a)(Object(F.a)({},de),{},{visible:Ne});Object(R.useEffect)(function(){Ke(rt),rt&&Ie&&Ut(Pe())},[rt,Ie]);var hn=_t?R.createElement($n,Object(w.a)({},en,{mobile:Ie,ref:et})):R.createElement(In,Object(w.a)({},en,{ref:et}));return R.createElement("div",null,R.createElement(Qe,en),hn)});kn.displayName="Popup";var mr=kn,Fn=R.createContext(null),nr=Fn;function Gn(){}function Hn(){return""}function Sr(Oe){return Oe?Oe.ownerDocument:window.document}var wr=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function br(Oe){var et=function(rt){Object(l.a)(de,rt);var Ie=Object(u.a)(de);function de(Ee){var pe;Object(M.a)(this,de),pe=Ie.call(this,Ee),pe.popupRef=R.createRef(),pe.triggerRef=R.createRef(),pe.attachId=void 0,pe.clickOutsideHandler=void 0,pe.touchOutsideHandler=void 0,pe.contextMenuOutsideHandler1=void 0,pe.contextMenuOutsideHandler2=void 0,pe.mouseDownTimeout=void 0,pe.focusTime=void 0,pe.preClickTime=void 0,pe.preTouchTime=void 0,pe.delayTimer=void 0,pe.hasPopupMouseDown=void 0,pe.onMouseEnter=function(Ke){var ot=pe.props.mouseEnterDelay;pe.fireEvents("onMouseEnter",Ke),pe.delaySetPopupVisible(!0,ot,ot?null:Ke)},pe.onMouseMove=function(Ke){pe.fireEvents("onMouseMove",Ke),pe.setPoint(Ke)},pe.onMouseLeave=function(Ke){pe.fireEvents("onMouseLeave",Ke),pe.delaySetPopupVisible(!1,pe.props.mouseLeaveDelay)},pe.onPopupMouseEnter=function(){pe.clearDelayTimer()},pe.onPopupMouseLeave=function(Ke){var ot;if(Ke.relatedTarget&&!Ke.relatedTarget.setTimeout&&Object(Ft.a)((ot=pe.popupRef.current)===null||ot===void 0?void 0:ot.getElement(),Ke.relatedTarget))return;pe.delaySetPopupVisible(!1,pe.props.mouseLeaveDelay)},pe.onFocus=function(Ke){pe.fireEvents("onFocus",Ke),pe.clearDelayTimer(),pe.isFocusToShow()&&(pe.focusTime=Date.now(),pe.delaySetPopupVisible(!0,pe.props.focusDelay))},pe.onMouseDown=function(Ke){pe.fireEvents("onMouseDown",Ke),pe.preClickTime=Date.now()},pe.onTouchStart=function(Ke){pe.fireEvents("onTouchStart",Ke),pe.preTouchTime=Date.now()},pe.onBlur=function(Ke){pe.fireEvents("onBlur",Ke),pe.clearDelayTimer(),pe.isBlurToHide()&&pe.delaySetPopupVisible(!1,pe.props.blurDelay)},pe.onContextMenu=function(Ke){Ke.preventDefault(),pe.fireEvents("onContextMenu",Ke),pe.setPopupVisible(!0,Ke)},pe.onContextMenuClose=function(){pe.isContextMenuToShow()&&pe.close()},pe.onClick=function(Ke){if(pe.fireEvents("onClick",Ke),pe.focusTime){var ot;if(pe.preClickTime&&pe.preTouchTime?ot=Math.min(pe.preClickTime,pe.preTouchTime):pe.preClickTime?ot=pe.preClickTime:pe.preTouchTime&&(ot=pe.preTouchTime),Math.abs(ot-pe.focusTime)<20)return;pe.focusTime=0}pe.preClickTime=0,pe.preTouchTime=0,pe.isClickToShow()&&(pe.isClickToHide()||pe.isBlurToHide())&&Ke&&Ke.preventDefault&&Ke.preventDefault();var He=!pe.state.popupVisible;(pe.isClickToHide()&&!He||He&&pe.isClickToShow())&&pe.setPopupVisible(!pe.state.popupVisible,Ke)},pe.onPopupMouseDown=function(){if(pe.hasPopupMouseDown=!0,clearTimeout(pe.mouseDownTimeout),pe.mouseDownTimeout=window.setTimeout(function(){pe.hasPopupMouseDown=!1},0),pe.context){var Ke;(Ke=pe.context).onPopupMouseDown.apply(Ke,arguments)}},pe.onDocumentClick=function(Ke){if(pe.props.mask&&!pe.props.maskClosable)return;var ot=Ke.target,He=pe.getRootDomNode(),_t=pe.getPopupDomNode();(!Object(Ft.a)(He,ot)||pe.isContextMenuOnly())&&!Object(Ft.a)(_t,ot)&&!pe.hasPopupMouseDown&&pe.close()},pe.getRootDomNode=function(){var Ke=pe.props.getTriggerDOMNode;if(Ke)return Ke(pe.triggerRef.current);try{var ot=Object(nn.a)(pe.triggerRef.current);if(ot)return ot}catch(He){}return Bt.a.findDOMNode(Object(p.a)(pe))},pe.getPopupClassNameFromAlign=function(Ke){var ot=[],He=pe.props,_t=He.popupPlacement,Ut=He.builtinPlacements,en=He.prefixCls,hn=He.alignPoint,Rn=He.getPopupClassNameFromAlign;return _t&&Ut&&ot.push(vt(Ut,en,Ke,hn)),Rn&&ot.push(Rn(Ke)),ot.join(" ")},pe.getComponent=function(){var Ke=pe.props,ot=Ke.prefixCls,He=Ke.destroyPopupOnHide,_t=Ke.popupClassName,Ut=Ke.onPopupAlign,en=Ke.popupMotion,hn=Ke.popupAnimation,Rn=Ke.popupTransitionName,Wn=Ke.popupStyle,lr=Ke.mask,on=Ke.maskAnimation,It=Ke.maskTransitionName,Jt=Ke.maskMotion,Pn=Ke.zIndex,En=Ke.popup,vr=Ke.stretch,qn=Ke.alignPoint,Tr=Ke.mobile,ir=Ke.forceRender,pn=pe.state,Mn=pn.popupVisible,gr=pn.point,Rr=pe.getPopupAlign(),Jn={};return pe.isMouseEnterToShow()&&(Jn.onMouseEnter=pe.onPopupMouseEnter),pe.isMouseLeaveToHide()&&(Jn.onMouseLeave=pe.onPopupMouseLeave),Jn.onMouseDown=pe.onPopupMouseDown,Jn.onTouchStart=pe.onPopupMouseDown,R.createElement(mr,Object(w.a)({prefixCls:ot,destroyPopupOnHide:He,visible:Mn,point:qn&&gr,className:_t,align:Rr,onAlign:Ut,animation:hn,getClassNameFromAlign:pe.getPopupClassNameFromAlign},Jn,{stretch:vr,getRootDomNode:pe.getRootDomNode,style:Wn,mask:lr,zIndex:Pn,transitionName:Rn,maskAnimation:on,maskTransitionName:It,maskMotion:Jt,ref:pe.popupRef,motion:en,mobile:Tr,forceRender:ir}),typeof En=="function"?En():En)},pe.attachParent=function(Ke){Ve.a.cancel(pe.attachId);var ot=pe.props,He=ot.getPopupContainer,_t=ot.getDocument,Ut=pe.getRootDomNode(),en;He?(Ut||He.length===0)&&(en=He(Ut)):en=_t(pe.getRootDomNode()).body,en?en.appendChild(Ke):pe.attachId=Object(Ve.a)(function(){pe.attachParent(Ke)})},pe.getContainer=function(){var Ke=pe.props.getDocument,ot=Ke(pe.getRootDomNode()).createElement("div");return ot.style.position="absolute",ot.style.top="0",ot.style.left="0",ot.style.width="100%",pe.attachParent(ot),ot},pe.setPoint=function(Ke){var ot=pe.props.alignPoint;if(!ot||!Ke)return;pe.setState({point:{pageX:Ke.pageX,pageY:Ke.pageY}})},pe.handlePortalUpdate=function(){pe.state.prevPopupVisible!==pe.state.popupVisible&&pe.props.afterPopupVisibleChange(pe.state.popupVisible)},pe.triggerContextValue={onPopupMouseDown:pe.onPopupMouseDown};var Ne;return"popupVisible"in Ee?Ne=!!Ee.popupVisible:Ne=!!Ee.defaultPopupVisible,pe.state={prevPopupVisible:Ne,popupVisible:Ne},wr.forEach(function(Ke){pe["fire".concat(Ke)]=function(ot){pe.fireEvents(Ke,ot)}}),pe}return Object(E.a)(de,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var pe=this.props,Ne=this.state;if(Ne.popupVisible){var Ke;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(Ke=pe.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Se.a)(Ke,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(Ke=Ke||pe.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Se.a)(Ke,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(Ke=Ke||pe.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Se.a)(Ke,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Se.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),Ve.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var pe;return((pe=this.popupRef.current)===null||pe===void 0?void 0:pe.getElement())||null}},{key:"getPopupAlign",value:function(){var pe=this.props,Ne=pe.popupPlacement,Ke=pe.popupAlign,ot=pe.builtinPlacements;return Ne&&ot?We(ot,Ne,Ke):Ke}},{key:"setPopupVisible",value:function(pe,Ne){var Ke=this.props.alignPoint,ot=this.state.popupVisible;this.clearDelayTimer(),ot!==pe&&("popupVisible"in this.props||this.setState({popupVisible:pe,prevPopupVisible:ot}),this.props.onPopupVisibleChange(pe)),Ke&&Ne&&pe&&this.setPoint(Ne)}},{key:"delaySetPopupVisible",value:function(pe,Ne,Ke){var ot=this,He=Ne*1e3;if(this.clearDelayTimer(),He){var _t=Ke?{pageX:Ke.pageX,pageY:Ke.pageY}:null;this.delayTimer=window.setTimeout(function(){ot.setPopupVisible(pe,_t),ot.clearDelayTimer()},He)}else this.setPopupVisible(pe,Ke)}},{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(pe){var Ne=this.props.children.props,Ke=this.props;return Ne[pe]&&Ke[pe]?this["fire".concat(pe)]:Ne[pe]||Ke[pe]}},{key:"isClickToShow",value:function(){var pe=this.props,Ne=pe.action,Ke=pe.showAction;return Ne.indexOf("click")!==-1||Ke.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var pe=this.props.action;return pe==="contextMenu"||pe.length===1&&pe[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var pe=this.props,Ne=pe.action,Ke=pe.showAction;return Ne.indexOf("contextMenu")!==-1||Ke.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var pe=this.props,Ne=pe.action,Ke=pe.hideAction;return Ne.indexOf("click")!==-1||Ke.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var pe=this.props,Ne=pe.action,Ke=pe.showAction;return Ne.indexOf("hover")!==-1||Ke.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var pe=this.props,Ne=pe.action,Ke=pe.hideAction;return Ne.indexOf("hover")!==-1||Ke.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var pe=this.props,Ne=pe.action,Ke=pe.showAction;return Ne.indexOf("focus")!==-1||Ke.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var pe=this.props,Ne=pe.action,Ke=pe.hideAction;return Ne.indexOf("focus")!==-1||Ke.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var pe;(pe=this.popupRef.current)===null||pe===void 0||pe.forceAlign()}}},{key:"fireEvents",value:function(pe,Ne){var Ke=this.props.children.props[pe];Ke&&Ke(Ne);var ot=this.props[pe];ot&&ot(Ne)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var pe=this.state.popupVisible,Ne=this.props,Ke=Ne.children,ot=Ne.forceRender,He=Ne.alignPoint,_t=Ne.className,Ut=Ne.autoDestroy,en=R.Children.only(Ke),hn={key:"trigger"};this.isContextMenuToShow()?hn.onContextMenu=this.onContextMenu:hn.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(hn.onClick=this.onClick,hn.onMouseDown=this.onMouseDown,hn.onTouchStart=this.onTouchStart):(hn.onClick=this.createTwoChains("onClick"),hn.onMouseDown=this.createTwoChains("onMouseDown"),hn.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(hn.onMouseEnter=this.onMouseEnter,He&&(hn.onMouseMove=this.onMouseMove)):hn.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?hn.onMouseLeave=this.onMouseLeave:hn.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(hn.onFocus=this.onFocus,hn.onBlur=this.onBlur):(hn.onFocus=this.createTwoChains("onFocus"),hn.onBlur=this.createTwoChains("onBlur"));var Rn=D()(en&&en.props&&en.props.className,_t);Rn&&(hn.className=Rn);var Wn=Object(F.a)({},hn);Object(Le.c)(en)&&(Wn.ref=Object(Le.a)(this.triggerRef,en.ref));var lr=R.cloneElement(en,Wn),on;return(pe||this.popupRef.current||ot)&&(on=R.createElement(Oe,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!pe&&Ut&&(on=null),R.createElement(nr.Provider,{value:this.triggerContextValue},lr,on)}}],[{key:"getDerivedStateFromProps",value:function(pe,Ne){var Ke=pe.popupVisible,ot={};return Ke!==void 0&&Ne.popupVisible!==Ke&&(ot.popupVisible=Ke,ot.prevPopupVisible=Ne.popupVisible),ot}}]),de}(R.Component);return et.contextType=nr,et.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:Hn,getDocument:Sr,onPopupVisibleChange:Gn,afterPopupVisibleChange:Gn,onPopupAlign:Gn,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},et}var Er=br(ut.a),te={adjustX:1,adjustY:1},Te={topLeft:{points:["bl","tl"],overflow:te,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:te,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:te,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:te,offset:[4,0]}},Ge={topLeft:{points:["bl","tl"],overflow:te,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:te,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:te,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:te,offset:[4,0]}},Me=Te,st=0,Je={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},ct=function(et,rt,Ie){var de=Ue(rt),Ee=et.getState();et.setState({defaultActiveFirst:Object(F.a)(Object(F.a)({},Ee.defaultActiveFirst),{},Object(Y.a)({},de,Ie))})},ht=function(Oe){Object(l.a)(rt,Oe);var et=Object(u.a)(rt);function rt(Ie){var de;Object(M.a)(this,rt),de=et.call(this,Ie),de.onDestroy=function(He){de.props.onDestroy(He)},de.onKeyDown=function(He){var _t=He.keyCode,Ut=de.menuInstance,en=de.props.store,hn=de.getVisible();if(_t===s.a.ENTER)return de.onTitleClick(He),ct(en,de.props.eventKey,!0),!0;if(_t===s.a.RIGHT)return hn?Ut.onKeyDown(He):(de.triggerOpenChange(!0),ct(en,de.props.eventKey,!0)),!0;if(_t===s.a.LEFT){var Rn;if(hn)Rn=Ut.onKeyDown(He);else return;return Rn||(de.triggerOpenChange(!1),Rn=!0),Rn}return hn&&(_t===s.a.UP||_t===s.a.DOWN)?Ut.onKeyDown(He):void 0},de.onOpenChange=function(He){de.props.onOpenChange(He)},de.onPopupVisibleChange=function(He){de.triggerOpenChange(He,He?"mouseenter":"mouseleave")},de.onMouseEnter=function(He){var _t=de.props,Ut=_t.eventKey,en=_t.onMouseEnter,hn=_t.store;ct(hn,de.props.eventKey,!1),en({key:Ut,domEvent:He})},de.onMouseLeave=function(He){var _t=de.props,Ut=_t.parentMenu,en=_t.eventKey,hn=_t.onMouseLeave;Ut.subMenuInstance=Object(p.a)(de),hn({key:en,domEvent:He})},de.onTitleMouseEnter=function(He){var _t=de.props,Ut=_t.eventKey,en=_t.onItemHover,hn=_t.onTitleMouseEnter;en({key:Ut,hover:!0}),hn({key:Ut,domEvent:He})},de.onTitleMouseLeave=function(He){var _t=de.props,Ut=_t.parentMenu,en=_t.eventKey,hn=_t.onItemHover,Rn=_t.onTitleMouseLeave;Ut.subMenuInstance=Object(p.a)(de),hn({key:en,hover:!1}),Rn({key:en,domEvent:He})},de.onTitleClick=function(He){var _t=Object(p.a)(de),Ut=_t.props;if(Ut.onTitleClick({key:Ut.eventKey,domEvent:He}),Ut.triggerSubMenuAction==="hover")return;de.triggerOpenChange(!de.getVisible(),"click"),ct(Ut.store,de.props.eventKey,!1)},de.onSubMenuClick=function(He){typeof de.props.onClick=="function"&&de.props.onClick(de.addKeyPath(He))},de.onSelect=function(He){de.props.onSelect(He)},de.onDeselect=function(He){de.props.onDeselect(He)},de.getPrefixCls=function(){return"".concat(de.props.rootPrefixCls,"-submenu")},de.getActiveClassName=function(){return"".concat(de.getPrefixCls(),"-active")},de.getDisabledClassName=function(){return"".concat(de.getPrefixCls(),"-disabled")},de.getSelectedClassName=function(){return"".concat(de.getPrefixCls(),"-selected")},de.getOpenClassName=function(){return"".concat(de.props.rootPrefixCls,"-submenu-open")},de.getVisible=function(){return de.state.isOpen},de.getMode=function(){return de.state.mode},de.saveMenuInstance=function(He){de.menuInstance=He},de.addKeyPath=function(He){return Object(F.a)(Object(F.a)({},He),{},{keyPath:(He.keyPath||[]).concat(de.props.eventKey)})},de.triggerOpenChange=function(He,_t){var Ut=de.props.eventKey,en=function(){de.onOpenChange({key:Ut,item:Object(p.a)(de),trigger:_t,open:He})};_t==="mouseenter"?de.mouseenterTimeout=setTimeout(function(){en()},0):en()},de.isChildrenSelected=function(){var He={find:!1};return lt(de.props.children,de.props.selectedKeys,He),He.find},de.isInlineMode=function(){return de.getMode()==="inline"},de.adjustWidth=function(){if(!de.subMenuTitle||!de.menuInstance)return;var He=Pt.findDOMNode(de.menuInstance);if(He.offsetWidth>=de.subMenuTitle.offsetWidth)return;He.style.minWidth="".concat(de.subMenuTitle.offsetWidth,"px")},de.saveSubMenuTitle=function(He){de.subMenuTitle=He},de.getBaseProps=function(){var He=Object(p.a)(de),_t=He.props,Ut=de.getMode();return{mode:Ut==="horizontal"?"vertical":Ut,visible:de.getVisible(),level:_t.level+1,inlineIndent:_t.inlineIndent,focusable:!1,onClick:de.onSubMenuClick,onSelect:de.onSelect,onDeselect:de.onDeselect,onDestroy:de.onDestroy,selectedKeys:_t.selectedKeys,eventKey:"".concat(_t.eventKey,"-menu-"),openKeys:_t.openKeys,motion:_t.motion,onOpenChange:de.onOpenChange,subMenuOpenDelay:_t.subMenuOpenDelay,parentMenu:Object(p.a)(de),subMenuCloseDelay:_t.subMenuCloseDelay,forceSubMenuRender:_t.forceSubMenuRender,triggerSubMenuAction:_t.triggerSubMenuAction,builtinPlacements:_t.builtinPlacements,defaultActiveFirst:_t.store.getState().defaultActiveFirst[Ue(_t.eventKey)],multiple:_t.multiple,prefixCls:_t.rootPrefixCls,id:de.internalMenuId,manualRef:de.saveMenuInstance,itemIcon:_t.itemIcon,expandIcon:_t.expandIcon,direction:_t.direction}},de.getMotion=function(He,_t){var Ut=Object(p.a)(de),en=Ut.haveRendered,hn=de.props,Rn=hn.motion,Wn=hn.rootPrefixCls,lr=Object(F.a)(Object(F.a)({},Rn),{},{leavedClassName:"".concat(Wn,"-hidden"),removeOnLeave:!1,motionAppear:en||!_t||He!=="inline"});return lr};var Ee=Ie.store,pe=Ie.eventKey,Ne=Ee.getState(),Ke=Ne.defaultActiveFirst;de.isRootMenu=!1;var ot=!1;return Ke&&(ot=Ke[pe]),ct(Ee,pe,ot),de.state={mode:Ie.mode,isOpen:Ie.isOpen},de}return Object(E.a)(rt,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var de=this,Ee=this.props,pe=Ee.mode,Ne=Ee.parentMenu,Ke=Ee.manualRef,ot=Ee.isOpen,He=function(){de.setState({mode:pe,isOpen:ot})},_t=ot!==this.state.isOpen,Ut=pe!==this.state.mode;if((Ut||_t)&&(Ve.a.cancel(this.updateStateRaf),Ut?this.updateStateRaf=Object(Ve.a)(He):He()),Ke&&Ke(this),pe!=="horizontal"||!(Ne==null?void 0:Ne.isRootMenu)||!ot)return;this.minWidthTimeout=setTimeout(function(){return de.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var de=this.props,Ee=de.onDestroy,pe=de.eventKey;Ee&&Ee(pe),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),Ve.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(de,Ee){var pe=this.getBaseProps();return R.createElement(Ht,Object(w.a)({},pe,{id:this.internalMenuId,className:de,style:Ee}),this.props.children)}},{key:"renderChildren",value:function(){var de=this,Ee=this.getBaseProps(),pe=Ee.mode,Ne=Ee.visible,Ke=Ee.forceSubMenuRender,ot=Ee.direction,He=this.getMotion(pe,Ne);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||Ne||Ke,!this.haveOpened)return R.createElement("div",null);var _t=D()("".concat(Ee.prefixCls,"-sub"),Object(Y.a)({},"".concat(Ee.prefixCls,"-rtl"),ot==="rtl"));return this.isInlineMode()?R.createElement(le,Object(w.a)({visible:Ee.visible,forceRender:Ke},He),function(Ut){var en=Ut.className,hn=Ut.style,Rn=D()(_t,en);return de.renderPopupMenu(Rn,hn)}):this.renderPopupMenu(_t)}},{key:"render",value:function(){var de,Ee,pe,Ne=Object(F.a)({},this.props),Ke=this.getVisible(),ot=this.getPrefixCls(),He=this.isInlineMode(),_t=this.getMode(),Ut=D()(ot,"".concat(ot,"-").concat(_t),(de={},Object(Y.a)(de,Ne.className,!!Ne.className),Object(Y.a)(de,this.getOpenClassName(),Ke),Object(Y.a)(de,this.getActiveClassName(),Ne.active||Ke&&!He),Object(Y.a)(de,this.getDisabledClassName(),Ne.disabled),Object(Y.a)(de,this.getSelectedClassName(),this.isChildrenSelected()),de));this.internalMenuId||(Ne.eventKey?this.internalMenuId="".concat(Ne.eventKey,"$Menu"):(st+=1,this.internalMenuId="$__$".concat(st,"$Menu")));var en={},hn={},Rn={};Ne.disabled||(en={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},hn={onClick:this.onTitleClick},Rn={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Wn={},lr=Ne.direction,on=lr==="rtl";He&&(on?Wn.paddingRight=Ne.inlineIndent*Ne.level:Wn.paddingLeft=Ne.inlineIndent*Ne.level);var It={};this.getVisible()&&(It={"aria-owns":this.internalMenuId});var Jt=null;_t!=="horizontal"&&(Jt=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(Jt=R.createElement(this.props.expandIcon,Object(F.a)({},this.props))));var Pn=R.createElement("div",Object(w.a)({ref:this.saveSubMenuTitle,style:Wn,className:"".concat(ot,"-title"),role:"button"},Rn,hn,{"aria-expanded":Ke},It,{"aria-haspopup":"true",title:typeof Ne.title=="string"?Ne.title:void 0}),Ne.title,Jt||R.createElement("i",{className:"".concat(ot,"-arrow")})),En=this.renderChildren(),vr=((Ee=Ne.parentMenu)===null||Ee===void 0?void 0:Ee.isRootMenu)?Ne.parentMenu.props.getPopupContainer:function(jr){return jr.parentNode},qn=Je[_t],Tr=Ne.popupOffset?{offset:Ne.popupOffset}:{},ir=D()((pe={},Object(Y.a)(pe,Ne.popupClassName,Ne.popupClassName&&!He),Object(Y.a)(pe,"".concat(ot,"-rtl"),on),pe)),pn=Ne.disabled,Mn=Ne.triggerSubMenuAction,gr=Ne.subMenuOpenDelay,Rr=Ne.forceSubMenuRender,Jn=Ne.subMenuCloseDelay,Mr=Ne.builtinPlacements;Fe.forEach(function(jr){return delete Ne[jr]}),delete Ne.onClick;var Yr=on?Object(F.a)(Object(F.a)({},Ge),Mr):Object(F.a)(Object(F.a)({},Te),Mr);delete Ne.direction;var Lr=this.getBaseProps(),Br=He?null:this.getMotion(Lr.mode,Lr.visible);return R.createElement("li",Object(w.a)({},Ne,en,{className:Ut,role:"menuitem"}),R.createElement(Er,{prefixCls:ot,popupClassName:D()("".concat(ot,"-popup"),ir),getPopupContainer:vr,builtinPlacements:Yr,popupPlacement:qn,popupVisible:He?!1:Ke,popupAlign:Tr,popup:He?null:En,action:pn||He?[]:[Mn],mouseEnterDelay:gr,mouseLeaveDelay:Jn,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:Rr,popupMotion:Br},Pn),He?En:null)}}]),rt}(R.Component);ht.defaultProps={onMouseEnter:Re,onMouseLeave:Re,onTitleMouseEnter:Re,onTitleMouseLeave:Re,onTitleClick:Re,manualRef:Re,mode:"vertical",title:""};var at=Object(f.b)(function(Oe,et){var rt=Oe.openKeys,Ie=Oe.activeKey,de=Oe.selectedKeys,Ee=et.eventKey,pe=et.subMenuKey;return{isOpen:rt.indexOf(Ee)>-1,active:Ie[pe]===Ee,selectedKeys:de}})(ht);at.isSubMenu=!0;var Mt=at,Gt="menuitem-overflowed",Vt=.5,wt=function(Oe){Object(l.a)(rt,Oe);var et=Object(u.a)(rt);function rt(){var Ie;return Object(M.a)(this,rt),Ie=et.apply(this,arguments),Ie.resizeObserver=null,Ie.mutationObserver=null,Ie.originalTotalWidth=0,Ie.overflowedItems=[],Ie.menuItemSizes=[],Ie.cancelFrameId=null,Ie.state={lastVisibleIndex:void 0},Ie.childRef=R.createRef(),Ie.getMenuItemNodes=function(){var de=Ie.props.prefixCls,Ee=Ie.childRef.current;return Ee?[].slice.call(Ee.children).filter(function(pe){return pe.className.split(" ").indexOf("".concat(de,"-overflowed-submenu"))<0}):[]},Ie.getOverflowedSubMenuItem=function(de,Ee,pe){var Ne=Ie.props,Ke=Ne.overflowedIndicator,ot=Ne.level,He=Ne.mode,_t=Ne.prefixCls,Ut=Ne.theme;if(ot!==1||He!=="horizontal")return null;var en=Ie.props.children[0],hn=en.props,Rn=hn.children,Wn=hn.title,lr=hn.style,on=Object(P.a)(hn,["children","title","style"]),It=Object(F.a)({},lr),Jt="".concat(de,"-overflowed-indicator"),Pn="".concat(de,"-overflowed-indicator");Ee.length===0&&pe!==!0?It=Object(F.a)(Object(F.a)({},It),{},{display:"none"}):pe&&(It=Object(F.a)(Object(F.a)({},It),{},{visibility:"hidden",position:"absolute"}),Jt="".concat(Jt,"-placeholder"),Pn="".concat(Pn,"-placeholder"));var En=Ut?"".concat(_t,"-").concat(Ut):"",vr={};return Fe.forEach(function(qn){on[qn]!==void 0&&(vr[qn]=on[qn])}),R.createElement(Mt,Object(w.a)({title:Ke,className:"".concat(_t,"-overflowed-submenu"),popupClassName:En},vr,{key:Jt,eventKey:Pn,disabled:!1,style:It}),Ee)},Ie.setChildrenWidthAndResize=function(){if(Ie.props.mode!=="horizontal")return;var de=Ie.childRef.current;if(!de)return;var Ee=de.children;if(!Ee||Ee.length===0)return;var pe=de.children[Ee.length-1];Xe(pe,"display","inline-block");var Ne=Ie.getMenuItemNodes(),Ke=Ne.filter(function(ot){return ot.className.split(" ").indexOf(Gt)>=0});Ke.forEach(function(ot){Xe(ot,"display","inline-block")}),Ie.menuItemSizes=Ne.map(function(ot){return Ze(ot,!0)}),Ke.forEach(function(ot){Xe(ot,"display","none")}),Ie.overflowedIndicatorWidth=Ze(de.children[de.children.length-1],!0),Ie.originalTotalWidth=Ie.menuItemSizes.reduce(function(ot,He){return ot+He},0),Ie.handleResize(),Xe(pe,"display","none")},Ie.handleResize=function(){if(Ie.props.mode!=="horizontal")return;var de=Ie.childRef.current;if(!de)return;var Ee=Ze(de);Ie.overflowedItems=[];var pe=0,Ne;Ie.originalTotalWidth>Ee+Vt&&(Ne=-1,Ie.menuItemSizes.forEach(function(Ke){pe+=Ke,pe+Ie.overflowedIndicatorWidth<=Ee&&(Ne+=1)})),Ie.setState({lastVisibleIndex:Ne})},Ie}return Object(E.a)(rt,[{key:"componentDidMount",value:function(){var de=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var Ee=this.childRef.current;if(!Ee)return;this.resizeObserver=new Rt.default(function(pe){pe.forEach(function(){var Ne=de.cancelFrameId;cancelAnimationFrame(Ne),de.cancelFrameId=requestAnimationFrame(de.setChildrenWidthAndResize)})}),[].slice.call(Ee.children).concat(Ee).forEach(function(pe){de.resizeObserver.observe(pe)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){de.resizeObserver.disconnect(),[].slice.call(Ee.children).concat(Ee).forEach(function(pe){de.resizeObserver.observe(pe)}),de.setChildrenWidthAndResize()}),this.mutationObserver.observe(Ee,{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(de){var Ee=this,pe=this.state.lastVisibleIndex;return(de||[]).reduce(function(Ne,Ke,ot){var He=Ke;if(Ee.props.mode==="horizontal"){var _t=Ee.getOverflowedSubMenuItem(Ke.props.eventKey,[]);pe!==void 0&&Ee.props.className.indexOf("".concat(Ee.props.prefixCls,"-root"))!==-1&&(ot>pe&&(He=R.cloneElement(Ke,{style:{display:"none"},eventKey:"".concat(Ke.props.eventKey,"-hidden"),className:"".concat(Gt)})),ot===pe+1&&(Ee.overflowedItems=de.slice(pe+1).map(function(en){return R.cloneElement(en,{key:en.props.eventKey,mode:"vertical-left"})}),_t=Ee.getOverflowedSubMenuItem(Ke.props.eventKey,Ee.overflowedItems)));var Ut=[].concat(Object(b.a)(Ne),[_t,He]);return ot===de.length-1&&Ut.push(Ee.getOverflowedSubMenuItem(Ke.props.eventKey,[],!0)),Ut}return[].concat(Object(b.a)(Ne),[He])},[])}},{key:"render",value:function(){var de=this.props,Ee=de.visible,pe=de.prefixCls,Ne=de.overflowedIndicator,Ke=de.mode,ot=de.level,He=de.tag,_t=de.children,Ut=de.theme,en=Object(P.a)(de,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),hn=He;return R.createElement(hn,Object(w.a)({ref:this.childRef},en),this.renderChildren(_t))}}]),rt}(R.Component);wt.defaultProps={tag:"div",className:""};var Nt=wt;function it(Oe){return Oe.length?Oe.every(function(et){return!!et.props.disabled}):!0}function Qt(Oe,et,rt){var Ie=Oe.getState();Oe.setState({activeKey:Object(F.a)(Object(F.a)({},Ie.activeKey),{},Object(Y.a)({},et,rt))})}function Wt(Oe){return Oe.eventKey||"0-menu-"}function yn(Oe,et){var rt=et,Ie=Oe.children,de=Oe.eventKey;if(rt){var Ee;if(ke(Ie,function(pe,Ne){pe&&pe.props&&!pe.props.disabled&&rt===nt(pe,de,Ne)&&(Ee=!0)}),Ee)return rt}return rt=null,Oe.defaultActiveFirst&&ke(Ie,function(pe,Ne){!rt&&pe&&!pe.props.disabled&&(rt=nt(pe,de,Ne))}),rt}function Dn(Oe){if(!Oe)return;var et=this.instanceArray.indexOf(Oe);et!==-1?this.instanceArray[et]=Oe:this.instanceArray.push(Oe)}var Kt=function(Oe){Object(l.a)(rt,Oe);var et=Object(u.a)(rt);function rt(Ie){var de;return Object(M.a)(this,rt),de=et.call(this,Ie),de.onKeyDown=function(Ee,pe){var Ne=Ee.keyCode,Ke;if(de.getFlatInstanceArray().forEach(function(He){He&&He.props.active&&He.onKeyDown&&(Ke=He.onKeyDown(Ee))}),Ke)return 1;var ot=null;return(Ne===s.a.UP||Ne===s.a.DOWN)&&(ot=de.step(Ne===s.a.UP?-1:1)),ot?(Ee.preventDefault(),Qt(de.props.store,Wt(de.props),ot.props.eventKey),typeof pe=="function"&&pe(ot),1):void 0},de.onItemHover=function(Ee){var pe=Ee.key,Ne=Ee.hover;Qt(de.props.store,Wt(de.props),Ne?pe:null)},de.onDeselect=function(Ee){de.props.onDeselect(Ee)},de.onSelect=function(Ee){de.props.onSelect(Ee)},de.onClick=function(Ee){de.props.onClick(Ee)},de.onOpenChange=function(Ee){de.props.onOpenChange(Ee)},de.onDestroy=function(Ee){de.props.onDestroy(Ee)},de.getFlatInstanceArray=function(){return de.instanceArray},de.step=function(Ee){var pe=de.getFlatInstanceArray(),Ne=de.props.store.getState().activeKey[Wt(de.props)],Ke=pe.length;if(!Ke)return null;Ee<0&&(pe=pe.concat().reverse());var ot=-1;if(pe.every(function(en,hn){return en&&en.props.eventKey===Ne?(ot=hn,!1):!0}),!de.props.defaultActiveFirst&&ot!==-1&&it(pe.slice(ot,Ke-1)))return;var He=(ot+1)%Ke,_t=He;do{var Ut=pe[_t];if(!Ut||Ut.props.disabled)_t=(_t+1)%Ke;else return Ut}while(_t!==He);return null},de.renderCommonMenuItem=function(Ee,pe,Ne){var Ke=de.props.store.getState(),ot=Object(p.a)(de),He=ot.props,_t=nt(Ee,He.eventKey,pe),Ut=Ee.props;if(!Ut||typeof Ee.type=="string")return Ee;var en=_t===Ke.activeKey,hn=Object(F.a)(Object(F.a)({mode:Ut.mode||He.mode,level:He.level,inlineIndent:He.inlineIndent,renderMenuItem:de.renderMenuItem,rootPrefixCls:He.prefixCls,index:pe,parentMenu:He.parentMenu,manualRef:Ut.disabled?void 0:Object(y.a)(Ee.ref,Dn.bind(Object(p.a)(de))),eventKey:_t,active:!Ut.disabled&&en,multiple:He.multiple,onClick:function(Wn){(Ut.onClick||Re)(Wn),de.onClick(Wn)},onItemHover:de.onItemHover,motion:He.motion,subMenuOpenDelay:He.subMenuOpenDelay,subMenuCloseDelay:He.subMenuCloseDelay,forceSubMenuRender:He.forceSubMenuRender,onOpenChange:de.onOpenChange,onDeselect:de.onDeselect,onSelect:de.onSelect,builtinPlacements:He.builtinPlacements,itemIcon:Ut.itemIcon||de.props.itemIcon,expandIcon:Ut.expandIcon||de.props.expandIcon},Ne),{},{direction:He.direction});return(He.mode==="inline"||ft())&&(hn.triggerSubMenuAction="click"),R.cloneElement(Ee,Object(F.a)(Object(F.a)({},hn),{},{key:_t||pe}))},de.renderMenuItem=function(Ee,pe,Ne){if(!Ee)return null;var Ke=de.props.store.getState(),ot={openKeys:Ke.openKeys,selectedKeys:Ke.selectedKeys,triggerSubMenuAction:de.props.triggerSubMenuAction,subMenuKey:Ne};return de.renderCommonMenuItem(Ee,pe,ot)},Ie.store.setState({activeKey:Object(F.a)(Object(F.a)({},Ie.store.getState().activeKey),{},Object(Y.a)({},Ie.eventKey,yn(Ie,Ie.activeKey)))}),de.instanceArray=[],de}return Object(E.a)(rt,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(de){return this.props.visible||de.visible||this.props.className!==de.className||!N()(this.props.style,de.style)}},{key:"componentDidUpdate",value:function(de){var Ee=this.props,pe="activeKey"in Ee?Ee.activeKey:Ee.store.getState().activeKey[Wt(Ee)],Ne=yn(Ee,pe);if(Ne!==pe)Qt(Ee.store,Wt(Ee),Ne);else if("activeKey"in de){var Ke=yn(de,de.activeKey);Ne!==Ke&&Qt(Ee.store,Wt(Ee),Ne)}}},{key:"render",value:function(){var de=this,Ee=Object(w.a)({},this.props);this.instanceArray=[];var pe=D()(Ee.prefixCls,Ee.className,"".concat(Ee.prefixCls,"-").concat(Ee.mode)),Ne={className:pe,role:Ee.role||"menu"};Ee.id&&(Ne.id=Ee.id),Ee.focusable&&(Ne.tabIndex=0,Ne.onKeyDown=this.onKeyDown);var Ke=Ee.prefixCls,ot=Ee.eventKey,He=Ee.visible,_t=Ee.level,Ut=Ee.mode,en=Ee.overflowedIndicator,hn=Ee.theme;return Fe.forEach(function(Rn){return delete Ee[Rn]}),delete Ee.onClick,R.createElement(Nt,Object(w.a)({},Ee,{prefixCls:Ke,mode:Ut,tag:"ul",level:_t,theme:hn,visible:He,overflowedIndicator:en},Ne),Object(m.a)(Ee.children).map(function(Rn,Wn){return de.renderMenuItem(Rn,Wn,ot||"0-menu-")}))}}]),rt}(R.Component);Kt.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:Re};var dn=Object(f.b)()(Kt),Ht=dn,Sn=I("Kwbf");function Tn(Oe,et,rt){var Ie=Oe.prefixCls,de=Oe.motion,Ee=Oe.defaultMotions,pe=Ee===void 0?{}:Ee,Ne=Oe.openAnimation,Ke=Oe.openTransitionName,ot=et.switchingModeFromInline;if(de)return de;if(Object(j.a)(Ne)==="object"&&Ne)Object(Sn.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof Ne=="string")return{motionName:"".concat(Ie,"-open-").concat(Ne)};if(Ke)return{motionName:Ke};var He=pe[rt];return He||(ot?null:pe.other)}var xt=function(Oe){Object(l.a)(rt,Oe);var et=Object(u.a)(rt);function rt(Ie){var de;Object(M.a)(this,rt),de=et.call(this,Ie),de.onSelect=function(Ne){var Ke=Object(p.a)(de),ot=Ke.props;if(ot.selectable){var He=de.store.getState(),_t=He.selectedKeys,Ut=Ne.key;ot.multiple?_t=_t.concat([Ut]):_t=[Ut],"selectedKeys"in ot||de.store.setState({selectedKeys:_t}),ot.onSelect(Object(F.a)(Object(F.a)({},Ne),{},{selectedKeys:_t}))}},de.onClick=function(Ne){var Ke=de.getRealMenuMode(),ot=Object(p.a)(de),He=ot.store,_t=ot.props.onOpenChange;Ke!=="inline"&&!("openKeys"in de.props)&&(He.setState({openKeys:[]}),_t([])),de.props.onClick(Ne)},de.onKeyDown=function(Ne,Ke){de.innerMenu.getWrappedInstance().onKeyDown(Ne,Ke)},de.onOpenChange=function(Ne){var Ke=Object(p.a)(de),ot=Ke.props,He=de.store.getState().openKeys.concat(),_t=!1,Ut=function(hn){var Rn=!1;if(hn.open)Rn=He.indexOf(hn.key)===-1,Rn&&He.push(hn.key);else{var Wn=He.indexOf(hn.key);Rn=Wn!==-1,Rn&&He.splice(Wn,1)}_t=_t||Rn};Array.isArray(Ne)?Ne.forEach(Ut):Ut(Ne),_t&&("openKeys"in de.props||de.store.setState({openKeys:He}),ot.onOpenChange(He))},de.onDeselect=function(Ne){var Ke=Object(p.a)(de),ot=Ke.props;if(ot.selectable){var He=de.store.getState().selectedKeys.concat(),_t=Ne.key,Ut=He.indexOf(_t);Ut!==-1&&He.splice(Ut,1),"selectedKeys"in ot||de.store.setState({selectedKeys:He}),ot.onDeselect(Object(F.a)(Object(F.a)({},Ne),{},{selectedKeys:He}))}},de.onMouseEnter=function(Ne){de.restoreModeVerticalFromInline();var Ke=de.props.onMouseEnter;Ke&&Ke(Ne)},de.onTransitionEnd=function(Ne){var Ke=Ne.propertyName==="width"&&Ne.target===Ne.currentTarget,ot=Ne.target.className,He=Object.prototype.toString.call(ot)==="[object SVGAnimatedString]"?ot.animVal:ot,_t=Ne.propertyName==="font-size"&&He.indexOf("anticon")>=0;(Ke||_t)&&de.restoreModeVerticalFromInline()},de.setInnerMenu=function(Ne){de.innerMenu=Ne},de.isRootMenu=!0;var Ee=Ie.defaultSelectedKeys,pe=Ie.defaultOpenKeys;return"selectedKeys"in Ie&&(Ee=Ie.selectedKeys||[]),"openKeys"in Ie&&(pe=Ie.openKeys||[]),de.store=Object(f.c)({selectedKeys:Ee,openKeys:pe,activeKey:{"0-menu-":yn(Ie,Ie.activeKey)}}),de.state={switchingModeFromInline:!1,prevProps:Ie,inlineOpenKeys:[],store:de.store},de}return Object(E.a)(rt,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(de){var Ee=this.props,pe=Ee.siderCollapsed,Ne=Ee.inlineCollapsed,Ke=Ee.onOpenChange;(!de.inlineCollapsed&&Ne||!de.siderCollapsed&&pe)&&Ke([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var de=this.props.collapsedWidth,Ee=this.store,pe=this.prevOpenKeys,Ne=this.getInlineCollapsed()&&(de===0||de==="0"||de==="0px");Ne?(this.prevOpenKeys=Ee.getState().openKeys.concat(),this.store.setState({openKeys:[]})):pe&&(this.store.setState({openKeys:pe}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var de=this.props.mode,Ee=this.state.switchingModeFromInline,pe=this.getInlineCollapsed();return Ee&&pe?"inline":pe?"vertical":de}},{key:"getInlineCollapsed",value:function(){var de=this.props,Ee=de.inlineCollapsed,pe=de.siderCollapsed;return pe!==void 0?pe:Ee}},{key:"restoreModeVerticalFromInline",value:function(){var de=this.state.switchingModeFromInline;de&&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 de=Object(F.a)({},Object(_.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),Ee=this.getRealMenuMode();return de.className+=" ".concat(de.prefixCls,"-root"),de.direction==="rtl"&&(de.className+=" ".concat(de.prefixCls,"-rtl")),de=Object(F.a)(Object(F.a)({},de),{},{mode:Ee,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Tn(this.props,this.state,Ee)}),delete de.openAnimation,delete de.openTransitionName,R.createElement(f.a,{store:this.store},R.createElement(Ht,Object(w.a)({},de,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(de,Ee){var pe=Ee.prevProps,Ne=Ee.store,Ke=Ne.getState(),ot={},He={prevProps:de};return pe.mode==="inline"&&de.mode!=="inline"&&(He.switchingModeFromInline=!0),"openKeys"in de?ot.openKeys=de.openKeys||[]:((de.inlineCollapsed&&!pe.inlineCollapsed||de.siderCollapsed&&!pe.siderCollapsed)&&(He.switchingModeFromInline=!0,He.inlineOpenKeys=Ke.openKeys,ot.openKeys=[]),(!de.inlineCollapsed&&pe.inlineCollapsed||!de.siderCollapsed&&pe.siderCollapsed)&&(ot.openKeys=Ee.inlineOpenKeys,He.inlineOpenKeys=[])),Object.keys(ot).length&&Ne.setState(ot),He}}]),rt}(R.Component);xt.defaultProps={selectable:!0,onClick:Re,onSelect:Re,onOpenChange:Re,onDeselect:Re,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:R.createElement("span",null,"\xB7\xB7\xB7")};var bt=xt,Lt=function(Oe){Object(l.a)(rt,Oe);var et=Object(u.a)(rt);function rt(){var Ie;return Object(M.a)(this,rt),Ie=et.apply(this,arguments),Ie.onKeyDown=function(de){var Ee=de.keyCode;return Ee===s.a.ENTER?(Ie.onClick(de),!0):void 0},Ie.onMouseLeave=function(de){var Ee=Ie.props,pe=Ee.eventKey,Ne=Ee.onItemHover,Ke=Ee.onMouseLeave;Ne({key:pe,hover:!1}),Ke({key:pe,domEvent:de})},Ie.onMouseEnter=function(de){var Ee=Ie.props,pe=Ee.eventKey,Ne=Ee.onItemHover,Ke=Ee.onMouseEnter;Ne({key:pe,hover:!0}),Ke({key:pe,domEvent:de})},Ie.onClick=function(de){var Ee=Ie.props,pe=Ee.eventKey,Ne=Ee.multiple,Ke=Ee.onClick,ot=Ee.onSelect,He=Ee.onDeselect,_t=Ee.isSelected,Ut={key:pe,keyPath:[pe],item:Object(p.a)(Ie),domEvent:de};Ke(Ut),Ne?_t?He(Ut):ot(Ut):_t||ot(Ut)},Ie.saveNode=function(de){Ie.node=de},Ie}return Object(E.a)(rt,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var de=this.props;de.onDestroy&&de.onDestroy(de.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 de,Ee=Object(F.a)({},this.props),pe=D()(this.getPrefixCls(),Ee.className,(de={},Object(Y.a)(de,this.getActiveClassName(),!Ee.disabled&&Ee.active),Object(Y.a)(de,this.getSelectedClassName(),Ee.isSelected),Object(Y.a)(de,this.getDisabledClassName(),Ee.disabled),de)),Ne=Object(F.a)(Object(F.a)({},Ee.attribute),{},{title:typeof Ee.title=="string"?Ee.title:void 0,className:pe,role:Ee.role||"menuitem","aria-disabled":Ee.disabled});Ee.role==="option"?Ne=Object(F.a)(Object(F.a)({},Ne),{},{role:"option","aria-selected":Ee.isSelected}):(Ee.role===null||Ee.role==="none")&&(Ne.role="none");var Ke={onClick:Ee.disabled?null:this.onClick,onMouseLeave:Ee.disabled?null:this.onMouseLeave,onMouseEnter:Ee.disabled?null:this.onMouseEnter},ot=Object(F.a)({},Ee.style);Ee.mode==="inline"&&(Ee.direction==="rtl"?ot.paddingRight=Ee.inlineIndent*Ee.level:ot.paddingLeft=Ee.inlineIndent*Ee.level),Fe.forEach(function(_t){return delete Ee[_t]}),delete Ee.direction;var He=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(He=R.createElement(this.props.itemIcon,this.props)),R.createElement("li",Object(w.a)({},Object(_.a)(Ee,["onClick","onMouseEnter","onMouseLeave","onSelect"]),Ne,Ke,{style:ot,ref:this.saveNode}),Ee.children,He)}}]),rt}(R.Component);Lt.isMenuItem=!0,Lt.defaultProps={onSelect:Re,onMouseEnter:Re,onMouseLeave:Re,manualRef:Re};var At=Object(f.b)(function(Oe,et){var rt=Oe.activeKey,Ie=Oe.selectedKeys,de=et.eventKey,Ee=et.subMenuKey;return{active:rt[Ee]===de,isSelected:Array.isArray(Ie)?Ie.indexOf(de)!==-1:Ie===de}})(Lt),Et=At,mn=function(Oe){Object(l.a)(rt,Oe);var et=Object(u.a)(rt);function rt(){var Ie;return Object(M.a)(this,rt),Ie=et.apply(this,arguments),Ie.renderInnerMenuItem=function(de){var Ee=Ie.props,pe=Ee.renderMenuItem,Ne=Ee.index;return pe(de,Ne,Ie.props.subMenuKey)},Ie}return Object(E.a)(rt,[{key:"render",value:function(){var de=Object(w.a)({},this.props),Ee=de.className,pe=Ee===void 0?"":Ee,Ne=de.rootPrefixCls,Ke="".concat(Ne,"-item-group-title"),ot="".concat(Ne,"-item-group-list"),He=de.title,_t=de.children;return Fe.forEach(function(Ut){return delete de[Ut]}),delete de.direction,R.createElement("li",Object(w.a)({},de,{onClick:function(en){return en.stopPropagation()},className:"".concat(pe," ").concat(Ne,"-item-group")}),R.createElement("div",{className:Ke,title:typeof He=="string"?He:void 0},He),R.createElement("ul",{className:ot},R.Children.map(_t,this.renderInnerMenuItem)))}}]),rt}(R.Component);mn.isMenuItemGroup=!0,mn.defaultProps={disabled:!0};var cn=mn,_n=function(et){var rt=et.className,Ie=et.rootPrefixCls,de=et.style;return R.createElement("li",{className:"".concat(rt," ").concat(Ie,"-item-divider"),style:de})};_n.defaultProps={disabled:!0,className:"",style:{}};var un=_n,rn=bt,Cn=I("eDIo");function rr(Oe,et){var rt=Oe.prefixCls,Ie=Oe.editable,de=Oe.locale,Ee=Oe.style;return!Ie||Ie.showAdd===!1?null:R.createElement("button",{ref:et,type:"button",className:"".concat(rt,"-nav-add"),style:Ee,"aria-label":(de==null?void 0:de.addAriaLabel)||"Add tab",onClick:function(Ne){Ie.onEdit("add",{event:Ne})}},Ie.addIcon||"+")}var cr=R.forwardRef(rr);function zn(Oe,et){var rt=Oe.prefixCls,Ie=Oe.id,de=Oe.tabs,Ee=Oe.locale,pe=Oe.mobile,Ne=Oe.moreIcon,Ke=Ne===void 0?"More":Ne,ot=Oe.moreTransitionName,He=Oe.style,_t=Oe.className,Ut=Oe.editable,en=Oe.tabBarGutter,hn=Oe.rtl,Rn=Oe.onTabClick,Wn=Object(R.useState)(!1),lr=Object(H.a)(Wn,2),on=lr[0],It=lr[1],Jt=Object(R.useState)(null),Pn=Object(H.a)(Jt,2),En=Pn[0],vr=Pn[1],qn="".concat(Ie,"-more-popup"),Tr="".concat(rt,"-dropdown"),ir=En!==null?"".concat(qn,"-").concat(En):null,pn=Ee==null?void 0:Ee.dropdownAriaLabel,Mn=R.createElement(rn,{onClick:function(Br){var jr=Br.key,Ir=Br.domEvent;Rn(jr,Ir),It(!1)},id:qn,tabIndex:-1,role:"listbox","aria-activedescendant":ir,selectedKeys:[En],"aria-label":pn!==void 0?pn:"expanded dropdown"},de.map(function(Lr){return R.createElement(Et,{key:Lr.key,id:"".concat(qn,"-").concat(Lr.key),role:"option","aria-controls":Ie&&"".concat(Ie,"-panel-").concat(Lr.key),disabled:Lr.disabled},Lr.tab)}));function gr(Lr){for(var Br=de.filter(function(si){return!si.disabled}),jr=Br.findIndex(function(si){return si.key===En})||0,Ir=Br.length,kr=0;kr<Ir;kr+=1){jr=(jr+Lr+Ir)%Ir;var fr=Br[jr];if(!fr.disabled){vr(fr.key);return}}}function Rr(Lr){var Br=Lr.which;if(!on){[s.a.DOWN,s.a.SPACE,s.a.ENTER].includes(Br)&&(It(!0),Lr.preventDefault());return}switch(Br){case s.a.UP:gr(-1),Lr.preventDefault();break;case s.a.DOWN:gr(1),Lr.preventDefault();break;case s.a.ESC:It(!1);break;case s.a.SPACE:case s.a.ENTER:En!==null&&Rn(En,Lr);break}}Object(R.useEffect)(function(){var Lr=document.getElementById(ir);Lr&&Lr.scrollIntoView&&Lr.scrollIntoView(!1)},[En]),Object(R.useEffect)(function(){on||vr(null)},[on]);var Jn=Object(Y.a)({},hn?"marginLeft":"marginRight",en);de.length||(Jn.visibility="hidden",Jn.order=1);var Mr=D()(Object(Y.a)({},"".concat(Tr,"-rtl"),hn)),Yr=pe?null:R.createElement(Cn.a,{prefixCls:Tr,overlay:Mn,trigger:["hover"],visible:on,transitionName:ot,onVisibleChange:It,overlayClassName:Mr,mouseEnterDelay:.1,mouseLeaveDelay:.1},R.createElement("button",{type:"button",className:"".concat(rt,"-nav-more"),style:Jn,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":qn,id:"".concat(Ie,"-more"),"aria-expanded":on,onKeyDown:Rr},Ke));return R.createElement("div",{className:D()("".concat(rt,"-nav-operations"),_t),style:He,ref:et},Yr,R.createElement(cr,{prefixCls:rt,locale:Ee,editable:Ut}))}var Dr=R.forwardRef(zn),Kr=Object(R.createContext)(null),Bn=.1,Xn=.01,Qn=20,Cr=Math.pow(.995,Qn);function Wr(){var Oe=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(Oe)||/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(Oe.substr(0,4)))}function Jr(Oe,et){var rt=Object(R.useState)(),Ie=Object(H.a)(rt,2),de=Ie[0],Ee=Ie[1],pe=Object(R.useState)(0),Ne=Object(H.a)(pe,2),Ke=Ne[0],ot=Ne[1],He=Object(R.useState)(0),_t=Object(H.a)(He,2),Ut=_t[0],en=_t[1],hn=Object(R.useState)(),Rn=Object(H.a)(hn,2),Wn=Rn[0],lr=Rn[1],on=Object(R.useRef)();function It(pn){var Mn=pn.touches[0],gr=Mn.screenX,Rr=Mn.screenY;Ee({x:gr,y:Rr}),window.clearInterval(on.current)}function Jt(pn){if(!de)return;pn.preventDefault();var Mn=pn.touches[0],gr=Mn.screenX,Rr=Mn.screenY;Ee({x:gr,y:Rr});var Jn=gr-de.x,Mr=Rr-de.y;et(Jn,Mr);var Yr=Date.now();ot(Yr),en(Yr-Ke),lr({x:Jn,y:Mr})}function Pn(){if(!de)return;if(Ee(null),lr(null),Wn){var pn=Wn.x/Ut,Mn=Wn.y/Ut,gr=Math.abs(pn),Rr=Math.abs(Mn);if(Math.max(gr,Rr)<Bn)return;var Jn=pn,Mr=Mn;on.current=window.setInterval(function(){if(Math.abs(Jn)<Xn&&Math.abs(Mr)<Xn){window.clearInterval(on.current);return}Jn*=Cr,Mr*=Cr,et(Jn*Qn,Mr*Qn)},Qn)}}var En=Object(R.useRef)(0),vr=Object(R.useRef)(!1),qn=Object(R.useRef)();function Tr(pn){var Mn=pn.deltaX,gr=pn.deltaY,Rr=0,Jn=Math.abs(Mn),Mr=Math.abs(gr);Jn===Mr?Rr=qn.current==="x"?Mn:gr:Jn>Mr?(Rr=Mn,qn.current="x"):(Rr=gr,qn.current="y");var Yr=Date.now();Yr-En.current>100&&(vr.current=!1),(et(-Rr,-Rr)||vr.current)&&(pn.preventDefault(),vr.current=!0),En.current=Yr}var ir=Object(R.useRef)(null);ir.current={onTouchStart:It,onTouchMove:Jt,onTouchEnd:Pn,onWheel:Tr},R.useEffect(function(){function pn(Jn){ir.current.onTouchStart(Jn)}function Mn(Jn){ir.current.onTouchMove(Jn)}function gr(Jn){ir.current.onTouchEnd(Jn)}function Rr(Jn){ir.current.onWheel(Jn)}return document.addEventListener("touchmove",Mn,{passive:!1}),document.addEventListener("touchend",gr,{passive:!1}),Oe.current.addEventListener("touchstart",pn,{passive:!1}),Oe.current.addEventListener("wheel",Rr),function(){document.removeEventListener("touchmove",Mn),document.removeEventListener("touchend",gr)}},[])}function li(){var Oe=Object(R.useRef)(new Map);function et(Ie){return Oe.current.has(Ie)||Oe.current.set(Ie,R.createRef()),Oe.current.get(Ie)}function rt(Ie){Oe.current.delete(Ie)}return[et,rt]}function xi(Oe,et){var rt=R.useRef(Oe),Ie=R.useState({}),de=Object(H.a)(Ie,2),Ee=de[1];function pe(Ne){var Ke=typeof Ne=="function"?Ne(rt.current):Ne;Ke!==rt.current&&et(Ke,rt.current),rt.current=Ke,Ee({})}return[rt.current,pe]}var mi=function(et){var rt=et.position,Ie=et.prefixCls,de=et.extra;if(!de)return null;var Ee,pe=de;return rt==="right"&&(Ee=pe.right||!pe.left&&pe||null),rt==="left"&&(Ee=pe.left||null),Ee?R.createElement("div",{className:"".concat(Ie,"-extra-content")},Ee):null};function Xi(Oe,et){var rt,Ie=R.useContext(Kr),de=Ie.prefixCls,Ee=Ie.tabs,pe=Oe.className,Ne=Oe.style,Ke=Oe.id,ot=Oe.animated,He=Oe.activeKey,_t=Oe.rtl,Ut=Oe.extra,en=Oe.editable,hn=Oe.locale,Rn=Oe.tabPosition,Wn=Oe.tabBarGutter,lr=Oe.children,on=Oe.onTabClick,It=Oe.onTabScroll,Jt=Object(R.useRef)(),Pn=Object(R.useRef)(),En=Object(R.useRef)(),vr=Object(R.useRef)(),qn=li(),Tr=Object(H.a)(qn,2),ir=Tr[0],pn=Tr[1],Mn=Rn==="top"||Rn==="bottom",gr=xi(0,function(Hr,Ar){Mn&&It&&It({direction:Hr>Ar?"left":"right"})}),Rr=Object(H.a)(gr,2),Jn=Rr[0],Mr=Rr[1],Yr=xi(0,function(Hr,Ar){!Mn&&It&&It({direction:Hr>Ar?"top":"bottom"})}),Lr=Object(H.a)(Yr,2),Br=Lr[0],jr=Lr[1],Ir=Object(R.useState)(0),kr=Object(H.a)(Ir,2),fr=kr[0],si=kr[1],Qi=Object(R.useState)(0),ji=Object(H.a)(Qi,2),wi=ji[0],Zr=ji[1],Gr=Object(R.useState)(0),Xr=Object(H.a)(Gr,2),qr=Xr[0],Ui=Xr[1],ha=Object(R.useState)(0),sa=Object(H.a)(ha,2),Vr=sa[0],Ji=sa[1],Zi=Object(R.useState)(null),$r=Object(H.a)(Zi,2),zr=$r[0],yi=$r[1],Pa=Object(R.useState)(null),no=Object(H.a)(Pa,2),la=no[0],wa=no[1],Ta=Object(R.useState)(0),Sa=Object(H.a)(Ta,2),ka=Sa[0],co=Sa[1],Ro=Object(R.useState)(0),Ga=Object(H.a)(Ro,2),Oa=Ga[0],Va=Ga[1],_a=a(new Map),Ra=Object(H.a)(_a,2),ho=Ra[0],Xa=Ra[1],Aa=g(Ee,ho,fr),Da="".concat(de,"-nav-operations-hidden"),ya=0,ki=0;Mn?_t?(ya=0,ki=Math.max(0,fr-zr)):(ya=Math.min(0,zr-fr),ki=0):(ya=Math.min(0,la-wi),ki=0);function fa(Hr){return Hr<ya?[ya,!1]:Hr>ki?[ki,!1]:[Hr,!0]}var pa=Object(R.useRef)(),ba=Object(R.useState)(),ma=Object(H.a)(ba,2),Ya=ma[0],$a=ma[1];function Qa(){$a(Date.now())}function Ia(){window.clearTimeout(pa.current)}Jr(Jt,function(Hr,Ar){var ai=!1;function Fi(Ma,da){Ma(function(Ua){var ca=fa(Ua+da),bi=Object(H.a)(ca,2),Fa=bi[0],Ba=bi[1];return ai=Ba,Fa})}if(Mn){if(zr>=fr)return ai;Fi(Mr,Hr)}else{if(la>=wi)return ai;Fi(jr,Ar)}return Ia(),Qa(),ai}),Object(R.useEffect)(function(){return Ia(),Ya&&(pa.current=window.setTimeout(function(){$a(0)},100)),Ia},[Ya]);function ua(){var Hr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:He,Ar=Aa.get(Hr);if(!Ar)return;if(Mn){var ai=Jn;_t?Ar.right<Jn?ai=Ar.right:Ar.right+Ar.width>Jn+zr&&(ai=Ar.right+Ar.width-zr):Ar.left<-Jn?ai=-Ar.left:Ar.left+Ar.width>-Jn+zr&&(ai=-(Ar.left+Ar.width-zr)),jr(0),Mr(fa(ai)[0])}else{var Fi=Br;Ar.top<-Br?Fi=-Ar.top:Ar.top+Ar.height>-Br+la&&(Fi=-(Ar.top+Ar.height-la)),Mr(0),jr(fa(Fi)[0])}}var Ea=A(Aa,{width:zr,height:la,left:Jn,top:Br},{width:qr,height:Vr},{width:ka,height:Oa},Object(F.a)(Object(F.a)({},Oe),{},{tabs:Ee})),ro=Object(H.a)(Ea,2),Ao=ro[0],Do=ro[1],fo=Ee.map(function(Hr){var Ar=Hr.key;return R.createElement(t,{id:Ke,prefixCls:de,key:Ar,rtl:_t,tab:Hr,closable:Hr.closable,editable:en,active:Ar===He,tabPosition:Rn,tabBarGutter:Wn,renderWrapper:lr,removeAriaLabel:hn==null?void 0:hn.removeAriaLabel,ref:ir(Ar),onClick:function(Fi){on(Ar,Fi)},onRemove:function(){pn(Ar)},onFocus:function(){ua(Ar),Qa(),_t||(Jt.current.scrollLeft=0),Jt.current.scrollTop=0}})}),io=r(function(){var Hr,Ar,ai,Fi,Ma,da,Ua,ca,bi,Fa=((Hr=Jt.current)===null||Hr===void 0?void 0:Hr.offsetWidth)||0,Ba=((Ar=Jt.current)===null||Ar===void 0?void 0:Ar.offsetHeight)||0,Ha=((ai=vr.current)===null||ai===void 0?void 0:ai.offsetWidth)||0,zi=((Fi=vr.current)===null||Fi===void 0?void 0:Fi.offsetHeight)||0,Ur=((Ma=En.current)===null||Ma===void 0?void 0:Ma.offsetWidth)||0,yr=((da=En.current)===null||da===void 0?void 0:da.offsetHeight)||0;yi(Fa),wa(Ba),co(Ha),Va(zi);var Un=(((Ua=Pn.current)===null||Ua===void 0?void 0:Ua.offsetWidth)||0)-Ha,or=(((ca=Pn.current)===null||ca===void 0?void 0:ca.offsetHeight)||0)-zi;si(Un),Zr(or);var Or=(bi=En.current)===null||bi===void 0?void 0:bi.className.includes(Da);Ui(Un-(Or?0:Ur)),Ji(or-(Or?0:yr)),Xa(function(){var ri=new Map;return Ee.forEach(function(va){var aa=va.key,Di=ir(aa).current;Di&&ri.set(aa,{width:Di.offsetWidth,height:Di.offsetHeight,left:Di.offsetLeft,top:Di.offsetTop})}),ri})}),po=Ee.slice(0,Ao),Wi=Ee.slice(Do+1),ci=[].concat(Object(b.a)(po),Object(b.a)(Wi)),Ai=Object(R.useState)(),hi=Object(H.a)(Ai,2),Na=hi[0],mo=hi[1],qi=Aa.get(He),ao=Object(R.useRef)();function oo(){d.a.cancel(ao.current)}Object(R.useEffect)(function(){var Hr={};return qi&&(Mn?(_t?Hr.right=qi.right:Hr.left=qi.left,Hr.width=qi.width):(Hr.top=qi.top,Hr.height=qi.height)),oo(),ao.current=d()(function(){mo(Hr)}),oo},[qi,Mn,_t]),Object(R.useEffect)(function(){ua()},[He,qi,Aa,Mn]),Object(R.useEffect)(function(){io()},[_t,Wn,He,Ee.map(function(Hr){return Hr.key}).join("_")]);var so=!!ci.length,xa="".concat(de,"-nav-wrap"),Ja,ja,vo,Za;return Mn?_t?(ja=Jn>0,Ja=Jn+zr<fr):(Ja=Jn<0,ja=-Jn+zr<fr):(vo=Br<0,Za=-Br+la<wi),R.createElement("div",{ref:et,role:"tablist",className:D()("".concat(de,"-nav"),pe),style:Ne,onKeyDown:function(){Qa()}},R.createElement(mi,{position:"left",extra:Ut,prefixCls:de}),R.createElement(c.a,{onResize:io},R.createElement("div",{className:D()(xa,(rt={},Object(Y.a)(rt,"".concat(xa,"-ping-left"),Ja),Object(Y.a)(rt,"".concat(xa,"-ping-right"),ja),Object(Y.a)(rt,"".concat(xa,"-ping-top"),vo),Object(Y.a)(rt,"".concat(xa,"-ping-bottom"),Za),rt)),ref:Jt},R.createElement(c.a,{onResize:io},R.createElement("div",{ref:Pn,className:"".concat(de,"-nav-list"),style:{transform:"translate(".concat(Jn,"px, ").concat(Br,"px)"),transition:Ya?"none":void 0}},fo,R.createElement(cr,{ref:vr,prefixCls:de,locale:hn,editable:en,style:{visibility:so?"hidden":null}}),R.createElement("div",{className:D()("".concat(de,"-ink-bar"),Object(Y.a)({},"".concat(de,"-ink-bar-animated"),ot.inkBar)),style:Na}))))),R.createElement(Dr,Object.assign({},Oe,{ref:En,prefixCls:de,tabs:ci,className:!so&&Da})),R.createElement(mi,{position:"right",extra:Ut,prefixCls:de}))}var Oi=R.forwardRef(Xi);function Pi(Oe){var et=Oe.id,rt=Oe.activeKey,Ie=Oe.animated,de=Oe.tabPosition,Ee=Oe.rtl,pe=Oe.destroyInactiveTabPane,Ne=R.useContext(Kr),Ke=Ne.prefixCls,ot=Ne.tabs,He=Ie.tabPane,_t=ot.findIndex(function(Ut){return Ut.key===rt});return R.createElement("div",{className:D()("".concat(Ke,"-content-holder"))},R.createElement("div",{className:D()("".concat(Ke,"-content"),"".concat(Ke,"-content-").concat(de),Object(Y.a)({},"".concat(Ke,"-content-animated"),He)),style:_t&&He?Object(Y.a)({},Ee?"marginRight":"marginLeft","-".concat(_t,"00%")):null},ot.map(function(Ut){return R.cloneElement(Ut.node,{key:Ut.key,prefixCls:Ke,tabKey:Ut.key,id:et,animated:He,active:Ut.key===rt,destroyInactiveTabPane:pe})})))}function vi(Oe){var et=Oe.prefixCls,rt=Oe.forceRender,Ie=Oe.className,de=Oe.style,Ee=Oe.id,pe=Oe.active,Ne=Oe.animated,Ke=Oe.destroyInactiveTabPane,ot=Oe.tabKey,He=Oe.children,_t=R.useState(rt),Ut=Object(H.a)(_t,2),en=Ut[0],hn=Ut[1];R.useEffect(function(){pe?hn(!0):Ke&&hn(!1)},[pe,Ke]);var Rn={};return pe||(Ne?(Rn.visibility="hidden",Rn.height=0,Rn.overflowY="hidden"):Rn.display="none"),R.createElement("div",{id:Ee&&"".concat(Ee,"-panel-").concat(ot),role:"tabpanel",tabIndex:pe?0:-1,"aria-labelledby":Ee&&"".concat(Ee,"-tab-").concat(ot),"aria-hidden":!pe,style:Object(F.a)(Object(F.a)({},Rn),de),className:D()("".concat(et,"-tabpane"),pe&&"".concat(et,"-tabpane-active"),Ie)},(pe||en||rt)&&He)}var Ni=0;function ia(Oe){return Object(m.a)(Oe).map(function(et){if(R.isValidElement(et)){var rt=et.key!==void 0?String(et.key):void 0;return Object(F.a)(Object(F.a)({key:rt},et.props),{},{node:et})}return null}).filter(function(et){return et})}function ui(Oe,et){var rt,Ie=Oe.id,de=Oe.prefixCls,Ee=de===void 0?"rc-tabs":de,pe=Oe.className,Ne=Oe.children,Ke=Oe.direction,ot=Oe.activeKey,He=Oe.defaultActiveKey,_t=Oe.editable,Ut=Oe.animated,en=Oe.tabPosition,hn=en===void 0?"top":en,Rn=Oe.tabBarGutter,Wn=Oe.tabBarStyle,lr=Oe.tabBarExtraContent,on=Oe.locale,It=Oe.moreIcon,Jt=Oe.moreTransitionName,Pn=Oe.destroyInactiveTabPane,En=Oe.renderTabBar,vr=Oe.onChange,qn=Oe.onTabClick,Tr=Oe.onTabScroll,ir=Object(P.a)(Oe,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),pn=ia(Ne),Mn=Ke==="rtl",gr;Ut===!1?gr={inkBar:!1,tabPane:!1}:gr=Object(F.a)({inkBar:!0,tabPane:!1},Ut!==!0?Ut:null);var Rr=Object(R.useState)(!1),Jn=Object(H.a)(Rr,2),Mr=Jn[0],Yr=Jn[1];Object(R.useEffect)(function(){Yr(Wr())},[]);var Lr=Object(T.a)(function(){var Vr;return(Vr=pn[0])===null||Vr===void 0?void 0:Vr.key},{value:ot,defaultValue:He}),Br=Object(H.a)(Lr,2),jr=Br[0],Ir=Br[1],kr=Object(R.useState)(function(){return pn.findIndex(function(Vr){return Vr.key===jr})}),fr=Object(H.a)(kr,2),si=fr[0],Qi=fr[1];Object(R.useEffect)(function(){var Vr=pn.findIndex(function(Zi){return Zi.key===jr});if(Vr===-1){var Ji;Vr=Math.max(0,Math.min(si,pn.length-1)),Ir((Ji=pn[Vr])===null||Ji===void 0?void 0:Ji.key)}Qi(Vr)},[pn.map(function(Vr){return Vr.key}).join("_"),jr,si]);var ji=Object(T.a)(null,{value:Ie}),wi=Object(H.a)(ji,2),Zr=wi[0],Gr=wi[1],Xr=hn;Mr&&!["left","right"].includes(hn)&&(Xr="top"),Object(R.useEffect)(function(){Ie||(Gr("rc-tabs-".concat(Ni)),Ni+=1)},[]);function qr(Vr,Ji){qn==null||qn(Vr,Ji),Ir(Vr),vr==null||vr(Vr)}var Ui={id:Zr,activeKey:jr,animated:gr,tabPosition:Xr,rtl:Mn,mobile:Mr},ha,sa=Object(F.a)(Object(F.a)({},Ui),{},{editable:_t,locale:on,moreIcon:It,moreTransitionName:Jt,tabBarGutter:Rn,onTabClick:qr,onTabScroll:Tr,extra:lr,style:Wn,panes:Ne});return En?ha=En(sa,Oi):ha=R.createElement(Oi,Object.assign({},sa)),R.createElement(Kr.Provider,{value:{tabs:pn,prefixCls:Ee}},R.createElement("div",Object.assign({ref:et,id:Ie,className:D()(Ee,"".concat(Ee,"-").concat(Xr),(rt={},Object(Y.a)(rt,"".concat(Ee,"-mobile"),Mr),Object(Y.a)(rt,"".concat(Ee,"-editable"),_t),Object(Y.a)(rt,"".concat(Ee,"-rtl"),Mn),rt),pe)},ir),ha,R.createElement(Pi,Object.assign({destroyInactiveTabPane:Pn},Ui,{animated:gr}))))}var di=R.forwardRef(ui);di.TabPane=vi;var Ri=di,Ci=re.b=Ri},kSUc:function(Ye,re,I){},lO7E:function(Ye,re,I){Ye.exports=I.p+"static/zwt.3af2a320.png"},lZu9:function(Ye,re,I){(function(Y){Y(I("VrN/"),I("1eCo"),I("8EBN"))})(function(Y){"use strict";Y.defineMode("markdown",function(H,P){var F=Y.getMode(H,"text/html"),R=F.name=="null";function O(z){if(Y.findModeByName){var L=Y.findModeByName(z);L&&(z=L.mime||L.mimes[0])}var V=Y.getMode(H,z);return V.name=="null"?null:V}P.highlightFormatting===void 0&&(P.highlightFormatting=!1),P.maxBlockquoteDepth===void 0&&(P.maxBlockquoteDepth=0),P.taskLists===void 0&&(P.taskLists=!1),P.strikethrough===void 0&&(P.strikethrough=!1),P.emoji===void 0&&(P.emoji=!1),P.fencedCodeBlockHighlighting===void 0&&(P.fencedCodeBlockHighlighting=!0),P.fencedCodeBlockDefaultMode===void 0&&(P.fencedCodeBlockDefaultMode="text/plain"),P.xml===void 0&&(P.xml=!0),P.tokenTypeOverrides===void 0&&(P.tokenTypeOverrides={});var D={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 m in D)D.hasOwnProperty(m)&&P.tokenTypeOverrides[m]&&(D[m]=P.tokenTypeOverrides[m]);var T=/^([*\-_])(?:\s*\1){2,}\s*$/,b=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,i=/^\[(x| )\](?=\s)/i,d=P.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,c=/^ {0,3}(?:\={1,}|-{2,})\s*$/,r=/^[^#!\[\]*_\\<>` "'(~:]+/,a=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,s=/^\s*\[[^\]]+?\]:.*$/,o=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,t=" ";function h(z,L,V){return L.f=L.inline=V,V(z,L)}function g(z,L,V){return L.f=L.block=V,V(z,L)}function C(z){return!z||!/\S/.test(z.string)}function A(z){if(z.linkTitle=!1,z.linkHref=!1,z.linkText=!1,z.em=!1,z.strong=!1,z.strikethrough=!1,z.quote=0,z.indentedCode=!1,z.f==M){var L=R;if(!L){var V=Y.innerMode(F,z.htmlState);L=V.mode.name=="xml"&&V.state.tagStart===null&&!V.state.context&&V.state.tokenize.isInText}L&&(z.f=u,z.block=w,z.htmlState=null)}return z.trailingSpace=0,z.trailingSpaceNewLine=!1,z.prevLine=z.thisLine,z.thisLine={stream:null},null}function w(z,L){var V=z.column()===L.indentation,W=C(L.prevLine.stream),$=L.indentedCode,q=L.prevLine.hr,fe=L.list!==!1,se=(L.listStack[L.listStack.length-1]||0)+3;L.indentedCode=!1;var me=L.indentation;if(L.indentationDiff===null&&(L.indentationDiff=L.indentation,fe)){for(L.list=null;me<L.listStack[L.listStack.length-1];)L.listStack.pop(),L.listStack.length?L.indentation=L.listStack[L.listStack.length-1]:L.list=!1;L.list!==!1&&(L.indentationDiff=me-L.listStack[L.listStack.length-1])}var ve=!W&&!q&&!L.prevLine.header&&(!fe||!$)&&!L.prevLine.fencedCodeEnd,Ae=(L.list===!1||q||W)&&L.indentation<=se&&z.match(T),ge=null;if(L.indentationDiff>=4&&($||L.prevLine.fencedCodeEnd||L.prevLine.header||W))return z.skipToEnd(),L.indentedCode=!0,D.code;if(z.eatSpace())return null;if(V&&L.indentation<=se&&(ge=z.match(d))&&ge[1].length<=6)return L.quote=0,L.header=ge[1].length,L.thisLine.header=!0,P.highlightFormatting&&(L.formatting="header"),L.f=L.inline,p(L);if(L.indentation<=se&&z.eat(">"))return L.quote=V?1:L.quote+1,P.highlightFormatting&&(L.formatting="quote"),z.eatSpace(),p(L);if(!Ae&&!L.setext&&V&&L.indentation<=se&&(ge=z.match(b))){var ue=ge[1]?"ol":"ul";return L.indentation=me+z.current().length,L.list=!0,L.quote=0,L.listStack.push(L.indentation),L.em=!1,L.strong=!1,L.code=!1,L.strikethrough=!1,P.taskLists&&z.match(i,!1)&&(L.taskList=!0),L.f=L.inline,P.highlightFormatting&&(L.formatting=["list","list-"+ue]),p(L)}else{if(V&&L.indentation<=se&&(ge=z.match(a,!0)))return L.quote=0,L.fencedEndRE=new RegExp(ge[1]+"+ *$"),L.localMode=P.fencedCodeBlockHighlighting&&O(ge[2]||P.fencedCodeBlockDefaultMode),L.localMode&&(L.localState=Y.startState(L.localMode)),L.f=L.block=E,P.highlightFormatting&&(L.formatting="code-block"),L.code=-1,p(L);if(L.setext||(!ve||!fe)&&!L.quote&&L.list===!1&&!L.code&&!Ae&&!s.test(z.string)&&(ge=z.lookAhead(1))&&(ge=ge.match(c)))return L.setext?(L.header=L.setext,L.setext=0,z.skipToEnd(),P.highlightFormatting&&(L.formatting="header")):(L.header=ge[0].charAt(0)=="="?1:2,L.setext=L.header),L.thisLine.header=!0,L.f=L.inline,p(L);if(Ae)return z.skipToEnd(),L.hr=!0,L.thisLine.hr=!0,D.hr;if(z.peek()==="[")return h(z,L,N)}return h(z,L,L.inline)}function M(z,L){var V=F.token(z,L.htmlState);if(!R){var W=Y.innerMode(F,L.htmlState);(W.mode.name=="xml"&&W.state.tagStart===null&&!W.state.context&&W.state.tokenize.isInText||L.md_inside&&z.current().indexOf(">")>-1)&&(L.f=u,L.block=w,L.htmlState=null)}return V}function E(z,L){var V=L.listStack[L.listStack.length-1]||0,W=L.indentation<V,$=V+3;if(L.fencedEndRE&&L.indentation<=$&&(W||z.match(L.fencedEndRE))){P.highlightFormatting&&(L.formatting="code-block");var q;return W||(q=p(L)),L.localMode=L.localState=null,L.block=w,L.f=u,L.fencedEndRE=null,L.code=0,L.thisLine.fencedCodeEnd=!0,W?g(z,L,L.block):q}else return L.localMode?L.localMode.token(z,L.localState):(z.skipToEnd(),D.code)}function p(z){var L=[];if(z.formatting){L.push(D.formatting),typeof z.formatting=="string"&&(z.formatting=[z.formatting]);for(var V=0;V<z.formatting.length;V++)L.push(D.formatting+"-"+z.formatting[V]),z.formatting[V]==="header"&&L.push(D.formatting+"-"+z.formatting[V]+"-"+z.header),z.formatting[V]==="quote"&&(!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=z.quote?L.push(D.formatting+"-"+z.formatting[V]+"-"+z.quote):L.push("error"))}if(z.taskOpen)return L.push("meta"),L.length?L.join(" "):null;if(z.taskClosed)return L.push("property"),L.length?L.join(" "):null;if(z.linkHref?L.push(D.linkHref,"url"):(z.strong&&L.push(D.strong),z.em&&L.push(D.em),z.strikethrough&&L.push(D.strikethrough),z.emoji&&L.push(D.emoji),z.linkText&&L.push(D.linkText),z.code&&L.push(D.code),z.image&&L.push(D.image),z.imageAltText&&L.push(D.imageAltText,"link"),z.imageMarker&&L.push(D.imageMarker)),z.header&&L.push(D.header,D.header+"-"+z.header),z.quote&&(L.push(D.quote),!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=z.quote?L.push(D.quote+"-"+z.quote):L.push(D.quote+"-"+P.maxBlockquoteDepth)),z.list!==!1){var W=(z.listStack.length-1)%3;W?W===1?L.push(D.list2):L.push(D.list3):L.push(D.list1)}return z.trailingSpaceNewLine?L.push("trailing-space-new-line"):z.trailingSpace&&L.push("trailing-space-"+(z.trailingSpace%2?"a":"b")),L.length?L.join(" "):null}function l(z,L){return z.match(r,!0)?p(L):void 0}function u(z,L){var V=L.text(z,L);if(typeof V!="undefined")return V;if(L.list)return L.list=null,p(L);if(L.taskList){var W=z.match(i,!0)[1]===" ";return W?L.taskOpen=!0:L.taskClosed=!0,P.highlightFormatting&&(L.formatting="task"),L.taskList=!1,p(L)}if(L.taskOpen=!1,L.taskClosed=!1,L.header&&z.match(/^#+$/,!0))return P.highlightFormatting&&(L.formatting="header"),p(L);var $=z.next();if(L.linkTitle){L.linkTitle=!1;var q=$;$==="("&&(q=")"),q=(q+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var fe="^\\s*(?:[^"+q+"\\\\]+|\\\\\\\\|\\\\.)"+q;if(z.match(new RegExp(fe),!0))return D.linkHref}if($==="`"){var se=L.formatting;P.highlightFormatting&&(L.formatting="code"),z.eatWhile("`");var me=z.current().length;if(L.code==0&&(!L.quote||me==1))return L.code=me,p(L);if(me==L.code){var ve=p(L);return L.code=0,ve}else return L.formatting=se,p(L)}else if(L.code)return p(L);if($==="\\"&&(z.next(),P.highlightFormatting)){var Ae=p(L),ge=D.formatting+"-escape";return Ae?Ae+" "+ge:ge}if($==="!"&&z.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return L.imageMarker=!0,L.image=!0,P.highlightFormatting&&(L.formatting="image"),p(L);if($==="["&&L.imageMarker&&z.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return L.imageMarker=!1,L.imageAltText=!0,P.highlightFormatting&&(L.formatting="image"),p(L);if($==="]"&&L.imageAltText){P.highlightFormatting&&(L.formatting="image");var Ae=p(L);return L.imageAltText=!1,L.image=!1,L.inline=L.f=_,Ae}if($==="["&&!L.image)return L.linkText&&z.match(/^.*?\]/)||(L.linkText=!0,P.highlightFormatting&&(L.formatting="link")),p(L);if($==="]"&&L.linkText){P.highlightFormatting&&(L.formatting="link");var Ae=p(L);return L.linkText=!1,L.inline=L.f=z.match(/\(.*?\)| ?\[.*?\]/,!1)?_:u,Ae}if($==="<"&&z.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){L.f=L.inline=f,P.highlightFormatting&&(L.formatting="link");var Ae=p(L);return Ae?Ae+=" ":Ae="",Ae+D.linkInline}if($==="<"&&z.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){L.f=L.inline=f,P.highlightFormatting&&(L.formatting="link");var Ae=p(L);return Ae?Ae+=" ":Ae="",Ae+D.linkEmail}if(P.xml&&$==="<"&&z.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ue=z.string.indexOf(">",z.pos);if(ue!=-1){var $e=z.string.substring(z.start,ue);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test($e)&&(L.md_inside=!0)}return z.backUp(1),L.htmlState=Y.startState(F),g(z,L,M)}if(P.xml&&$==="<"&&z.match(/^\/\w*?>/))return L.md_inside=!1,"tag";if($==="*"||$==="_"){for(var Tt=1,ye=z.pos==1?" ":z.string.charAt(z.pos-2);Tt<3&&z.eat($);)Tt++;var Re=z.peek()||" ",nt=!/\s/.test(Re)&&(!o.test(Re)||/\s/.test(ye)||o.test(ye)),Ue=!/\s/.test(ye)&&(!o.test(ye)||/\s/.test(Re)||o.test(Re)),ke=null,lt=null;if(Tt%2&&(!L.em&&nt&&($==="*"||!Ue||o.test(ye))?ke=!0:L.em==$&&Ue&&($==="*"||!nt||o.test(Re))&&(ke=!1)),Tt>1&&(!L.strong&&nt&&($==="*"||!Ue||o.test(ye))?lt=!0:L.strong==$&&Ue&&($==="*"||!nt||o.test(Re))&&(lt=!1)),lt!=null||ke!=null){P.highlightFormatting&&(L.formatting=ke==null?"strong":lt==null?"em":"strong em"),ke===!0&&(L.em=$),lt===!0&&(L.strong=$);var ve=p(L);return ke===!1&&(L.em=!1),lt===!1&&(L.strong=!1),ve}}else if($===" "&&(z.eat("*")||z.eat("_"))){if(z.peek()===" ")return p(L);z.backUp(1)}if(P.strikethrough){if($==="~"&&z.eatWhile($)){if(L.strikethrough){P.highlightFormatting&&(L.formatting="strikethrough");var ve=p(L);return L.strikethrough=!1,ve}else if(z.match(/^[^\s]/,!1))return L.strikethrough=!0,P.highlightFormatting&&(L.formatting="strikethrough"),p(L)}else if($===" "&&z.match(/^~~/,!0)){if(z.peek()===" ")return p(L);z.backUp(2)}}if(P.emoji&&$===":"&&z.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){L.emoji=!0,P.highlightFormatting&&(L.formatting="emoji");var Fe=p(L);return L.emoji=!1,Fe}return $===" "&&(z.match(/^ +$/,!1)?L.trailingSpace++:L.trailingSpace&&(L.trailingSpaceNewLine=!0)),p(L)}function f(z,L){var V=z.next();if(V===">"){L.f=L.inline=u,P.highlightFormatting&&(L.formatting="link");var W=p(L);return W?W+=" ":W="",W+D.linkInline}return z.match(/^[^>]+/,!0),D.linkInline}function _(z,L){if(z.eatSpace())return null;var V=z.next();return V==="("||V==="["?(L.f=L.inline=v(V==="("?")":"]"),P.highlightFormatting&&(L.formatting="link-string"),L.linkHref=!0,p(L)):"error"}var y={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function v(z){return function(L,V){var W=L.next();if(W===z){V.f=V.inline=u,P.highlightFormatting&&(V.formatting="link-string");var $=p(V);return V.linkHref=!1,$}return L.match(y[z]),V.linkHref=!0,p(V)}}function N(z,L){return z.match(/^([^\]\\]|\\.)*\]:/,!1)?(L.f=j,z.next(),P.highlightFormatting&&(L.formatting="link"),L.linkText=!0,p(L)):h(z,L,u)}function j(z,L){if(z.match(/^\]:/,!0)){L.f=L.inline=U,P.highlightFormatting&&(L.formatting="link");var V=p(L);return L.linkText=!1,V}return z.match(/^([^\]\\]|\\.)+/,!0),D.linkText}function U(z,L){return z.eatSpace()?null:(z.match(/^[^\s]+/,!0),z.peek()===void 0?L.linkTitle=!0:z.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),L.f=L.inline=u,D.linkHref+" url")}var G={startState:function(){return{f:w,prevLine:{stream:null},thisLine:{stream:null},block:w,htmlState:null,indentation:0,inline:u,text:l,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(z){return{f:z.f,prevLine:z.prevLine,thisLine:z.thisLine,block:z.block,htmlState:z.htmlState&&Y.copyState(F,z.htmlState),indentation:z.indentation,localMode:z.localMode,localState:z.localMode?Y.copyState(z.localMode,z.localState):null,inline:z.inline,text:z.text,formatting:!1,linkText:z.linkText,linkTitle:z.linkTitle,linkHref:z.linkHref,code:z.code,em:z.em,strong:z.strong,strikethrough:z.strikethrough,emoji:z.emoji,header:z.header,setext:z.setext,hr:z.hr,taskList:z.taskList,list:z.list,listStack:z.listStack.slice(0),quote:z.quote,indentedCode:z.indentedCode,trailingSpace:z.trailingSpace,trailingSpaceNewLine:z.trailingSpaceNewLine,md_inside:z.md_inside,fencedEndRE:z.fencedEndRE}},token:function(z,L){if(L.formatting=!1,z!=L.thisLine.stream){if(L.header=0,L.hr=!1,z.match(/^\s*$/,!0))return A(L),null;if(L.prevLine=L.thisLine,L.thisLine={stream:z},L.taskList=!1,L.trailingSpace=0,L.trailingSpaceNewLine=!1,!L.localState&&(L.f=L.block,L.f!=M)){var V=z.match(/^\s*/,!0)[0].replace(/\t/g,t).length;if(L.indentation=V,L.indentationDiff=null,V>0)return null}}return L.f(z,L)},innerMode:function(z){return z.block==M?{state:z.htmlState,mode:F}:z.localState?{state:z.localState,mode:z.localMode}:{state:z,mode:G}},indent:function(z,L,V){return z.block==M&&F.indent?F.indent(z.htmlState,L,V):z.localState&&z.localMode.indent?z.localMode.indent(z.localState,L,V):Y.Pass},blankLine:A,getType:p,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return G},"xml"),Y.defineMIME("text/markdown","markdown"),Y.defineMIME("text/x-markdown","markdown")})},loD1:function(Ye,re){function I(Y,H,P,F,R,O,D){if(R===0)return!1;var m=R,T=0,b=Y;if(D>H+m&&D>F+m||D<H-m&&D<F-m||O>Y+m&&O>P+m||O<Y-m&&O<P-m)return!1;if(Y!==P)T=(H-F)/(Y-P),b=(Y*F-P*H)/(Y-P);else return Math.abs(O-Y)<=m/2;var i=T*O-D+b,d=i*i/(T*T+1);return d<=m/2*m/2}re.containStroke=I},mFDi:function(Ye,re,I){var Y=I("QBsz"),H=I("Fofx"),P=Y.applyTransform,F=Math.min,R=Math.max;function O(m,T,b,i){b<0&&(m=m+b,b=-b),i<0&&(T=T+i,i=-i),this.x=m,this.y=T,this.width=b,this.height=i}O.prototype={constructor:O,union:function(m){var T=F(m.x,this.x),b=F(m.y,this.y);this.width=R(m.x+m.width,this.x+this.width)-T,this.height=R(m.y+m.height,this.y+this.height)-b,this.x=T,this.y=b},applyTransform:function(){var m=[],T=[],b=[],i=[];return function(d){if(!d)return;m[0]=b[0]=this.x,m[1]=i[1]=this.y,T[0]=i[0]=this.x+this.width,T[1]=b[1]=this.y+this.height,P(m,m,d),P(T,T,d),P(b,b,d),P(i,i,d),this.x=F(m[0],T[0],b[0],i[0]),this.y=F(m[1],T[1],b[1],i[1]);var c=R(m[0],T[0],b[0],i[0]),r=R(m[1],T[1],b[1],i[1]);this.width=c-this.x,this.height=r-this.y}}(),calculateTransform:function(m){var T=this,b=m.width/T.width,i=m.height/T.height,d=H.create();return H.translate(d,d,[-T.x,-T.y]),H.scale(d,d,[b,i]),H.translate(d,d,[m.x,m.y]),d},intersect:function(m){if(!m)return!1;m instanceof O||(m=O.create(m));var T=this,b=T.x,i=T.x+T.width,d=T.y,c=T.y+T.height,r=m.x,a=m.x+m.width,s=m.y,o=m.y+m.height;return!(i<r||a<b||c<s||o<d)},contain:function(m,T){var b=this;return m>=b.x&&m<=b.x+b.width&&T>=b.y&&T<=b.y+b.height},clone:function(){return new O(this.x,this.y,this.width,this.height)},copy:function(m){this.x=m.x,this.y=m.y,this.width=m.width,this.height=m.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},O.create=function(m){return new O(m.x,m.y,m.width,m.height)};var D=O;Ye.exports=D},mLcG:function(Ye,re){var I=typeof window!="undefined"&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(Y){setTimeout(Y,16)};Ye.exports=I},mgmH:function(Ye,re,I){"use strict";I.d(re,"d",function(){return c}),I.d(re,"b",function(){return r}),I.d(re,"e",function(){return a}),I.d(re,"c",function(){return s}),I.d(re,"n",function(){return o}),I.d(re,"g",function(){return t}),I.d(re,"h",function(){return h}),I.d(re,"j",function(){return C}),I.d(re,"a",function(){return A}),I.d(re,"l",function(){return w}),I.d(re,"f",function(){return M}),I.d(re,"k",function(){return E}),I.d(re,"m",function(){return p}),I.d(re,"i",function(){return l}),I.d(re,"o",function(){return u}),I.d(re,"t",function(){return f}),I.d(re,"s",function(){return _}),I.d(re,"p",function(){return y}),I.d(re,"q",function(){return v}),I.d(re,"r",function(){return N}),I.d(re,"v",function(){return j}),I.d(re,"u",function(){return U});var Y=I("miYZ"),H=I("tsqr"),P=I("k1fw"),F=I("9og8"),R=I("WmNS"),O=I.n(R),D=I("oUNq"),m=I("9kvl"),T=I("1vsH"),b=I("m3rI"),i=function(){Object(m.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u751F\u6210\u6587\u4EF6\uFF0C\u8BF7\u7A0D\u540E..."}})},d=function(){Object(m.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}})},c=function(){var G=Object(F.a)(O.a.mark(function z(L){var V;return O.a.wrap(function($){for(;;)switch($.prev=$.next){case 0:return i(),$.next=3,Object(D.t)(Object(P.a)({},L));case 3:if(V=$.sent,!(V.status===0)){$.next=7;break}return $.next=7,Object(T.w)("",Object(T.Y)({url:b.a.API_SERVER+"/api/courses/".concat(L.coursesId,"/export_couser_info.json"),query:L}));case 7:d();case 8:case"end":return $.stop()}},z)}));return function(L){return G.apply(this,arguments)}}(),r=function(){var G=Object(F.a)(O.a.mark(function z(L){var V;return O.a.wrap(function($){for(;;)switch($.prev=$.next){case 0:return $.next=2,Object(D.r)(Object(P.a)({},L));case 2:if(V=$.sent,!(V.status===0)){$.next=8;break}H.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),m.d.push("/classrooms/".concat(L.coursesId,"/exportlist/course_member_act_score")),$.next=13;break;case 8:if(!(V.status===-2)){$.next=12;break}return $.abrupt("return",V);case 12:V.status===-3&&(Object(m.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),m.d.push("/classrooms/".concat(L.coursesId,"/exportlist/course_member_act_score")));case 13:case"end":return $.stop()}},z)}));return function(L){return G.apply(this,arguments)}}(),a=function(){var G=Object(F.a)(O.a.mark(function z(L){var V;return O.a.wrap(function($){for(;;)switch($.prev=$.next){case 0:return $.next=2,Object(D.u)(Object(P.a)({},L));case 2:if(V=$.sent,!(V.status===0)){$.next=8;break}H.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),m.d.push("/classrooms/".concat(L.coursesId,"/exportlist/course_total_score")),$.next=13;break;case 8:if(!(V.status===-2)){$.next=12;break}return $.abrupt("return",V);case 12:V.status===-3&&(Object(m.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),m.d.push("/classrooms/".concat(L.coursesId,"/exportlist/course_total_score")));case 13:case"end":return $.stop()}},z)}));return function(L){return G.apply(this,arguments)}}(),s=function(){var G=Object(F.a)(O.a.mark(function z(L){var V;return O.a.wrap(function($){for(;;)switch($.prev=$.next){case 0:return $.next=2,Object(D.s)(Object(P.a)({},L));case 2:if(V=$.sent,!(V.status===0)){$.next=8;break}H.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),m.d.push("/classrooms/".concat(L.coursesId,"/exportlist/course_total_exercise_and_other")),$.next=13;break;case 8:if(!(V.status===-2)){$.next=12;break}return $.abrupt("return",V);case 12:V.status===-3&&(Object(m.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),m.d.push("/classrooms/".concat(L.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return $.stop()}},z)}));return function(L){return G.apply(this,arguments)}}(),o=function(){var G=Object(F.a)(O.a.mark(function z(L){var V;return O.a.wrap(function($){for(;;)switch($.prev=$.next){case 0:return $.next=2,Object(D.z)(Object(P.a)({},L));case 2:if(V=$.sent,!(V.status===0)){$.next=8;break}H.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),m.d.push("/classrooms/".concat(L.coursesId,"/exportlist/course_total_exercise_and_other")),$.next=13;break;case 8:if(!(V.status===-2)){$.next=12;break}return $.abrupt("return",V);case 12:V.status===-3&&(Object(m.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),m.d.push("/classrooms/".concat(L.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return $.stop()}},z)}));return function(L){return G.apply(this,arguments)}}(),t=function(){var G=Object(F.a)(O.a.mark(function z(L){var V;return O.a.wrap(function($){for(;;)switch($.prev=$.next){case 0:return $.next=2,Object(D.v)(Object(P.a)({},L));case 2:if(V=$.sent,!(V.status===0)){$.next=8;break}H.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),m.d.push("/classrooms/".concat(L.coursesId,"/exportlist/course_total_homework")),$.next=13;break;case 8:if(!(V.status===-2)){$.next=12;break}return $.abrupt("return",V);case 12:V.status===-3&&(Object(m.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),m.d.push("/classrooms/".concat(L.coursesId,"/exportlist/course_total_homework")));case 13:case"end":return $.stop()}},z)}));return function(L){return G.apply(this,arguments)}}(),h=function(){var G=Object(F.a)(O.a.mark(function z(L,V){var W;return O.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(D.x)(Object(P.a)({},L));case 2:W=q.sent,W.status===0?(H.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),m.d.push("/classrooms/".concat(L.coursesId,"/exportlist/").concat(V))):W.status===-3&&(Object(m.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),m.d.push("/classrooms/".concat(L.coursesId,"/exportlist/").concat(V)));case 4:case"end":return q.stop()}},z)}));return function(L,V){return G.apply(this,arguments)}}(),g=function(){var G=Object(F.a)(O.a.mark(function z(L){var V;return O.a.wrap(function($){for(;;)switch($.prev=$.next){case 0:return i(),$.next=3,Object(D.w)(Object(P.a)({},L));case 3:if(V=$.sent,!(V.status===0)){$.next=7;break}return $.next=7,Object(T.w)("",Object(T.Y)({url:b.a.API_SERVER+"/api/homework_commons/".concat(L.categoryId,"/works_list.zip"),query:L}));case 7:d();case 8:case"end":return $.stop()}},z)}));return function(L){return G.apply(this,arguments)}}(),C=function(){var G=Object(F.a)(O.a.mark(function z(L){var V;return O.a.wrap(function($){for(;;)switch($.prev=$.next){case 0:return i(),$.next=3,Object(D.A)(Object(P.a)({},L));case 3:if(V=$.sent,!(V.status===0)){$.next=7;break}return $.next=7,Object(T.w)("",Object(T.Y)({url:b.a.API_SERVER+"/api/polls/".concat(L.categoryId,"/commit_result.xlsx"),query:L}));case 7:d();case 8:case"end":return $.stop()}},z)}));return function(L){return G.apply(this,arguments)}}(),A=function(){var G=Object(F.a)(O.a.mark(function z(L){return O.a.wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return W.next=2,Object(T.v)("",Object(T.Y)({url:b.a.API_SERVER+"/api/courses/".concat(L.coursesId,"/attendances/export_xlsx_data.xlsx"),query:L}));case 2:case"end":return W.stop()}},z)}));return function(L){return G.apply(this,arguments)}}(),w=function(){var G=Object(F.a)(O.a.mark(function z(L){return O.a.wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return W.next=2,Object(T.v)("",Object(T.Y)({url:b.a.API_SERVER+"/api/courses/".concat(L.coursesId,"/video_study_statics.xlsx"),query:L}));case 2:case"end":return W.stop()}},z)}));return function(L){return G.apply(this,arguments)}}(),M=function(){var G=Object(F.a)(O.a.mark(function z(L){return O.a.wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return W.next=2,Object(T.v)("",Object(T.Y)({url:b.a.API_SERVER+"/api/courses/".concat(L.coursesId,"/export_course_students_info.xlsx"),query:L}));case 2:case"end":return W.stop()}},z)}));return function(L){return G.apply(this,arguments)}}(),E=function(){var G=Object(F.a)(O.a.mark(function z(L){return O.a.wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return W.next=2,Object(T.v)("",Object(T.Y)({url:b.a.API_SERVER+"/api/item_banks/export.xlsx",query:L}));case 2:case"end":return W.stop()}},z)}));return function(L){return G.apply(this,arguments)}}(),p=function(){var G=Object(F.a)(O.a.mark(function z(L){return O.a.wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return W.next=2,Object(T.v)("",Object(T.Y)({url:b.a.API_SERVER+"/api/competitions/region_reports.xlsx",query:L}));case 2:case"end":return W.stop()}},z)}));return function(L){return G.apply(this,arguments)}}(),l=function(){var G=Object(F.a)(O.a.mark(function z(L){var V;return O.a.wrap(function($){for(;;)switch($.prev=$.next){case 0:return $.next=2,Object(D.y)(Object(P.a)({},L));case 2:V=$.sent,V.status===0?(H.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),m.d.push("/classrooms/".concat(L.coursesId,"/exportlist/exercise_score"))):V.status===-3&&(Object(m.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),m.d.push("/classrooms/".concat(L.coursesId,"/exportlist/exercise_score")));case 4:case"end":return $.stop()}},z)}));return function(L){return G.apply(this,arguments)}}(),u=function(){var G=Object(F.a)(O.a.mark(function z(L){return O.a.wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return console.log("----------","\u8C03\u7528\u4E0B\u8F7D"),W.next=3,Object(T.v)("",Object(T.Y)({url:b.a.API_SERVER+"/api/export_records/".concat(L.id,".xlsx"),query:L}));case 3:case"end":return W.stop()}},z)}));return function(L){return G.apply(this,arguments)}}(),f=function(){var G=Object(F.a)(O.a.mark(function z(L){return O.a.wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return W.next=2,Object(T.v)("",Object(T.Y)({url:b.a.API_SERVER+"/api/ec_major_schools/0/ec_years.xlsx",query:L}));case 2:case"end":return W.stop()}},z)}));return function(L){return G.apply(this,arguments)}}(),_=function(){var G=Object(F.a)(O.a.mark(function z(L){return O.a.wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return W.next=2,Object(T.v)("",Object(T.Y)({url:b.a.API_SERVER+"/api/ec_years/".concat(L==null?void 0:L.ec_year_id,"/ec_training_objectives.xlsx"),query:L}));case 2:case"end":return W.stop()}},z)}));return function(L){return G.apply(this,arguments)}}(),y=function(){var G=Object(F.a)(O.a.mark(function z(L){return O.a.wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return W.next=2,Object(T.v)(L==null?void 0:L.name,Object(T.Y)({url:b.a.API_SERVER+"/api/attachments/get_ecs_attachment.docx",query:L}));case 2:case"end":return W.stop()}},z)}));return function(L){return G.apply(this,arguments)}}(),v=function(){var G=Object(F.a)(O.a.mark(function z(L){return O.a.wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return W.next=2,Object(T.v)("",Object(T.Y)({url:b.a.API_SERVER+"/api/ec_years/".concat(L==null?void 0:L.ec_year_id,"/ec_courses.xlsx"),query:L}));case 2:case"end":return W.stop()}},z)}));return function(L){return G.apply(this,arguments)}}(),N=function(){var G=Object(F.a)(O.a.mark(function z(L){return O.a.wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return W.next=2,Object(T.v)("",Object(T.Y)({url:b.a.API_SERVER+"/api/ec_years/".concat(L==null?void 0:L.ec_year_id,"/ec_graduation_requirements.xlsx"),query:L}));case 2:case"end":return W.stop()}},z)}));return function(L){return G.apply(this,arguments)}}(),j=function(){var G=Object(F.a)(O.a.mark(function z(L){return O.a.wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return W.next=2,Object(T.v)("",Object(T.Y)({url:b.a.API_SERVER+"/api/courses/rank_list.xlsx",query:L}));case 2:case"end":return W.stop()}},z)}));return function(L){return G.apply(this,arguments)}}(),U=function(){var G=Object(F.a)(O.a.mark(function z(L){return O.a.wrap(function(W){for(;;)switch(W.prev=W.next){case 0:return W.next=2,Object(T.v)("",Object(T.Y)({url:b.a.API_SERVER+"/api/courses/question_rank_list.xlsx",query:L}));case 2:case"end":return W.stop()}},z)}));return function(L){return G.apply(this,arguments)}}()},n1HI:function(Ye,re,I){var Y=I("hX1E"),H=Y.normalizeRadian,P=Math.PI*2;function F(R,O,D,m,T,b,i,d,c){if(i===0)return!1;var r=i;d-=R,c-=O;var a=Math.sqrt(d*d+c*c);if(a-r>D||a+r<D)return!1;if(Math.abs(m-T)%P<1e-4)return!0;if(b){var s=m;m=H(T),T=H(s)}else m=H(m),T=H(T);m>T&&(T+=P);var o=Math.atan2(c,d);return o<0&&(o+=P),o>=m&&o<=T||o+P>=m&&o+P<=T}re.containStroke=F},n6Mw:function(Ye,re,I){var Y=I("SrGk"),H=I("bYtY"),P=I("Fofx");function F(O,D){Y.call(this,O,D,"clipPath","__clippath_in_use__")}H.inherits(F,Y),F.prototype.update=function(O){var D=this.getSvgElement(O);D&&this.updateDom(D,O.__clipPaths,!1);var m=this.getTextSvgElement(O);m&&this.updateDom(m,O.__clipPaths,!0),this.markUsed(O)},F.prototype.updateDom=function(O,D,m){if(D&&D.length>0){var T=this.getDefs(!0),b=D[0],i,d,c=m?"_textDom":"_dom";b[c]?(d=b[c].getAttribute("id"),i=b[c],T.contains(i)||T.appendChild(i)):(d="zr"+this._zrId+"-clip-"+this.nextId,++this.nextId,i=this.createElement("clipPath"),i.setAttribute("id",d),T.appendChild(i),b[c]=i);var r=this.getSvgProxy(b);if(b.transform&&b.parent.invTransform&&!m){var a=Array.prototype.slice.call(b.transform);P.mul(b.transform,b.parent.invTransform,b.transform),r.brush(b),b.transform=a}else r.brush(b);var s=this.getSvgElement(b);i.innerHTML="",i.appendChild(s.cloneNode()),O.setAttribute("clip-path","url(#"+d+")"),D.length>1&&this.updateDom(i,D.slice(1),m)}else O&&O.setAttribute("clip-path","none")},F.prototype.markUsed=function(O){var D=this;O.__clipPaths&&H.each(O.__clipPaths,function(m){m._dom&&Y.prototype.markUsed.call(D,m._dom),m._textDom&&Y.prototype.markUsed.call(D,m._textDom)})};var R=F;Ye.exports=R},n6Qo:function(Ye,re,I){"use strict";I.d(re,"a",function(){return m});var Y=I("q1tI"),H=I("biw7"),P=I("fyJ8");function F(T){var b=T.className,i=T.index,d=T.children,c=T.colSpan,r=T.rowSpan,a=Y.useContext(H.a),s=a.prefixCls,o=a.fixedInfoList,t=o[i];return Y.createElement(P.a,Object.assign({className:b,index:i,component:"td",prefixCls:s,record:null,dataIndex:null,render:function(){return{children:d,props:{colSpan:c,rowSpan:r}}}},t))}function R(T){return Y.createElement("tr",Object.assign({},T))}function O(T){var b=T.children,i=Y.useContext(H.a),d=i.prefixCls;return Y.createElement("tfoot",{className:"".concat(d,"-summary")},b)}var D=re.b=O,m={Cell:F,Row:R}},nCxF:function(Ye,re,I){var Y=I("QBsz"),H=Y.min,P=Y.max,F=Y.scale,R=Y.distance,O=Y.add,D=Y.clone,m=Y.sub;function T(b,i,d,c){var r=[],a=[],s=[],o=[],t,h,g,C;if(c){g=[Infinity,Infinity],C=[-Infinity,-Infinity];for(var A=0,w=b.length;A<w;A++)H(g,g,b[A]),P(C,C,b[A]);H(g,g,c[0]),P(C,C,c[1])}for(var A=0,w=b.length;A<w;A++){var M=b[A];if(d)t=b[A?A-1:w-1],h=b[(A+1)%w];else if(A===0||A===w-1){r.push(D(b[A]));continue}else t=b[A-1],h=b[A+1];m(a,h,t),F(a,a,i);var E=R(M,t),p=R(M,h),l=E+p;l!==0&&(E/=l,p/=l),F(s,a,-E),F(o,a,p);var u=O([],M,s),f=O([],M,o);c&&(P(u,u,g),H(u,u,C),P(f,f,g),H(f,f,C)),r.push(u),r.push(f)}return d&&r.push(r.shift()),r}Ye.exports=T},nPnh:function(Ye,re){var I=Math.round;function Y(F,R,O){if(!R)return;var D=R.x1,m=R.x2,T=R.y1,b=R.y2;F.x1=D,F.x2=m,F.y1=T,F.y2=b;var i=O&&O.lineWidth;if(!i)return;I(D*2)===I(m*2)&&(F.x1=F.x2=P(D,i,!0)),I(T*2)===I(b*2)&&(F.y1=F.y2=P(T,i,!0))}function H(F,R,O){if(!R)return;var D=R.x,m=R.y,T=R.width,b=R.height;F.x=D,F.y=m,F.width=T,F.height=b;var i=O&&O.lineWidth;if(!i)return;F.x=P(D,i,!0),F.y=P(m,i,!0),F.width=Math.max(P(D+T,i,!1)-F.x,T===0?0:1),F.height=Math.max(P(m+b,i,!1)-F.y,b===0?0:1)}function P(F,R,O){if(!R)return F;var D=I(F*2);return(D+I(R))%2===0?D/2:(D+(O?1:-1))/2}re.subPixelOptimizeLine=Y,re.subPixelOptimizeRect=H,re.subPixelOptimize=P},ni6a:function(Ye,re,I){var Y=I("pzxd"),H=I("mFDi"),P=I("gut8"),F=P.WILL_BE_RESTORED,R=new H,O=function(){};O.prototype={constructor:O,drawRectText:function(m,T){var b=this.style;T=b.textRect||T,this.__dirty&&Y.normalizeTextStyle(b,!0);var i=b.text;if(i!=null&&(i+=""),!Y.needDrawText(i,b))return;m.save();var d=this.transform;b.transformText?this.setTransform(m):d&&(R.copy(T),R.applyTransform(d),T=R),Y.renderText(this,m,i,b,T,F),m.restore()}};var D=O;Ye.exports=D},oOBs:function(Ye,re,I){Ye.exports={leftdiv:"leftdiv___1FhsT",listClass:"listClass___1Y2ac",spantitle:"spantitle___1pL39",rightdiv:"rightdiv___3ZICD"}},ogmK:function(Ye,re,I){"use strict";I.d(re,"a",function(){return br});var Y=I("1OyB"),H=I("vuIU"),P=I("Ji7U"),F=I("LK+K"),R=I("rePB"),O=I("VTBJ"),D=I("ODXe"),m=I("q1tI"),T=I("TSYQ"),b=I.n(T),i=I("Kwbf"),d=I("6cGi"),c=I("U8pU"),r=I("4IlW"),a=m.createContext({}),s=a,o={visibility:"hidden"};function t(te){var Te=te.prefixCls,Ge=te.prevIcon,Me=Ge===void 0?"\u2039":Ge,st=te.nextIcon,Je=st===void 0?"\u203A":st,ct=te.superPrevIcon,ht=ct===void 0?"\xAB":ct,at=te.superNextIcon,Mt=at===void 0?"\xBB":at,Gt=te.onSuperPrev,Vt=te.onSuperNext,wt=te.onPrev,Nt=te.onNext,it=te.children,Qt=m.useContext(s),Wt=Qt.hideNextBtn,yn=Qt.hidePrevBtn;return m.createElement("div",{className:Te},Gt&&m.createElement("button",{type:"button",onClick:Gt,tabIndex:-1,className:"".concat(Te,"-super-prev-btn"),style:yn?o:{}},ht),wt&&m.createElement("button",{type:"button",onClick:wt,tabIndex:-1,className:"".concat(Te,"-prev-btn"),style:yn?o:{}},Me),m.createElement("div",{className:"".concat(Te,"-view")},it),Nt&&m.createElement("button",{type:"button",onClick:Nt,tabIndex:-1,className:"".concat(Te,"-next-btn"),style:Wt?o:{}},Je),Vt&&m.createElement("button",{type:"button",onClick:Vt,tabIndex:-1,className:"".concat(Te,"-super-next-btn"),style:Wt?o:{}},Mt))}var h=t;function g(te){var Te=m.useContext(s),Ge=Te.hideHeader;if(Ge)return null;var Me=te.prefixCls,st=te.generateConfig,Je=te.locale,ct=te.value,ht=te.format,at="".concat(Me,"-header");return m.createElement(h,{prefixCls:at},ct?st.locale.format(Je.locale,ct,ht):"\xA0")}var C=g,A=I("YrtM"),w=I("KQm4"),M=new Map;function E(te,Te,Ge){if(M.get(te)&&cancelAnimationFrame(M.get(te)),Ge<=0){M.set(te,requestAnimationFrame(function(){te.scrollTop=Te}));return}var Me=Te-te.scrollTop,st=Me/Ge*10;M.set(te,requestAnimationFrame(function(){te.scrollTop+=st,te.scrollTop!==Te&&E(te,Te,Ge-10)}))}function p(te,Te){var Ge=Te.onLeftRight,Me=Te.onCtrlLeftRight,st=Te.onUpDown,Je=Te.onPageUpDown,ct=Te.onEnter,ht=te.which,at=te.ctrlKey,Mt=te.metaKey;switch(ht){case r.a.LEFT:if(at||Mt){if(Me)return Me(-1),!0}else if(Ge)return Ge(-1),!0;break;case r.a.RIGHT:if(at||Mt){if(Me)return Me(1),!0}else if(Ge)return Ge(1),!0;break;case r.a.UP:if(st)return st(-1),!0;break;case r.a.DOWN:if(st)return st(1),!0;break;case r.a.PAGE_UP:if(Je)return Je(-1),!0;break;case r.a.PAGE_DOWN:if(Je)return Je(1),!0;break;case r.a.ENTER:if(ct)return ct(),!0;break}return!1}function l(te,Te,Ge,Me){var st=te;if(!st)switch(Te){case"time":st=Me?"hh:mm:ss a":"HH:mm:ss";break;case"week":st="gggg-wo";break;case"month":st="YYYY-MM";break;case"quarter":st="YYYY-[Q]Q";break;case"year":st="YYYY";break;default:st=Ge?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD"}return st}function u(te,Te){var Ge=te==="time"?8:10;return Math.max(Ge,Te.length)+2}var f=null,_=new Set;function y(te){return!f&&typeof window!="undefined"&&window.addEventListener&&(f=function(Ge){Object(w.a)(_).forEach(function(Me){Me(Ge)})},window.addEventListener("mousedown",f)),_.add(te),function(){_.delete(te),_.size===0&&(window.removeEventListener("mousedown",f),f=null)}}var v=function(Te){return Te==="month"||Te==="date"?"year":Te},N=function(Te){return Te==="date"?"month":Te},j=function(Te){return Te==="month"||Te==="date"?"quarter":Te},U=function(Te){return Te==="date"?"week":Te},G={year:v,month:N,quarter:j,week:U,time:null,date:null};function z(te,Te){return te.some(function(Ge){return Ge&&Ge.contains(Te)})}function L(te){var Te=te.prefixCls,Ge=te.units,Me=te.onSelect,st=te.value,Je=te.active,ct=te.hideDisabledOptions,ht="".concat(Te,"-cell"),at=m.useContext(s),Mt=at.open,Gt=m.useRef(null),Vt=m.useRef(new Map);return m.useLayoutEffect(function(){var wt=Vt.current.get(st);wt&&Mt!==!1&&E(Gt.current,wt.offsetTop,120)},[st]),m.useLayoutEffect(function(){if(Mt){var wt=Vt.current.get(st);wt&&E(Gt.current,wt.offsetTop,0)}},[Mt]),m.createElement("ul",{className:b()("".concat(Te,"-column"),Object(R.a)({},"".concat(Te,"-column-active"),Je)),ref:Gt,style:{position:"relative"}},Ge.map(function(wt){var Nt;return ct&&wt.disabled?null:m.createElement("li",{key:wt.value,ref:function(Qt){Vt.current.set(wt.value,Qt)},className:b()(ht,(Nt={},Object(R.a)(Nt,"".concat(ht,"-disabled"),wt.disabled),Object(R.a)(Nt,"".concat(ht,"-selected"),st===wt.value),Nt)),onClick:function(){if(wt.disabled)return;Me(wt.value)}},m.createElement("div",{className:"".concat(ht,"-inner")},wt.label))}))}var V=L;function W(te,Te){for(var Ge=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"0",Me=String(te);Me.length<Te;)Me="".concat(Ge).concat(te);return Me}var $=function(){for(var Te=arguments.length,Ge=new Array(Te),Me=0;Me<Te;Me++)Ge[Me]=arguments[Me];return Ge};function q(te){return te==null?[]:Array.isArray(te)?te:[te]}function fe(te){var Te={};return Object.keys(te).forEach(function(Ge){(Ge.substr(0,5)==="data-"||Ge.substr(0,5)==="aria-"||Ge==="role"||Ge==="name")&&Ge.substr(0,7)!=="data-__"&&(Te[Ge]=te[Ge])}),Te}function se(te,Te){return te?te[Te]:null}function me(te,Te,Ge){var Me=[se(te,0),se(te,1)];return Me[Ge]=typeof Te=="function"?Te(Me[Ge]):Te,!Me[0]&&!Me[1]?null:Me}function ve(te,Te,Ge,Me,st){var Je=te.setHour(Te,Ge);return Je=te.setMinute(Je,Me),Je=te.setSecond(Je,st),Je}function Ae(te,Te,Ge,Me,st,Je){var ct=Math.floor(te/Me)*Me;if(ct<te)return[ct,60-st,60-Je];var ht=Math.floor(Te/st)*st;if(ht<Te)return[ct,ht,60-Je];var at=Math.floor(Ge/Je)*Je;return[ct,ht,at]}function ge(te,Te){if(te.length!==Te.length)return!0;for(var Ge=0;Ge<te.length;Ge+=1)if(te[Ge].disabled!==Te[Ge].disabled)return!0;return!1}function ue(te,Te,Ge,Me){for(var st=[],Je=te;Je<=Te;Je+=Ge)st.push({label:W(Je,2),value:Je,disabled:(Me||[]).includes(Je)});return st}function $e(te){var Te=te.generateConfig,Ge=te.prefixCls,Me=te.operationRef,st=te.activeColumnIndex,Je=te.value,ct=te.showHour,ht=te.showMinute,at=te.showSecond,Mt=te.use12Hours,Gt=te.hourStep,Vt=Gt===void 0?1:Gt,wt=te.minuteStep,Nt=wt===void 0?1:wt,it=te.secondStep,Qt=it===void 0?1:it,Wt=te.disabledHours,yn=te.disabledMinutes,Dn=te.disabledSeconds,Kt=te.hideDisabledOptions,dn=te.onSelect,Ht=[],Sn="".concat(Ge,"-content"),Tn="".concat(Ge,"-time-panel"),xt,bt=Je?Te.getHour(Je):-1,Lt=Je?Te.getMinute(Je):-1,At=Je?Te.getSecond(Je):-1,Et=function(Xn,Qn,Cr,Wr){var Jr=Je||Te.getNow(),li=Math.max(0,Qn),xi=Math.max(0,Cr),mi=Math.max(0,Wr);return Jr=ve(Te,Jr,!Mt||!Xn?li:li+12,xi,mi),Jr},mn=ue(0,23,Vt,Wt&&Wt()),cn=Object(A.a)(function(){return mn},mn,ge);Mt&&(xt=bt>=12,bt%=12);var _n=m.useMemo(function(){if(!Mt)return[!1,!1];var Bn=[!0,!0];return cn.forEach(function(Xn){var Qn=Xn.disabled,Cr=Xn.value;if(Qn)return;Cr>=12?Bn[1]=!1:Bn[0]=!1}),Bn},[Mt,cn]),un=Object(D.a)(_n,2),rn=un[0],Cn=un[1],rr=m.useMemo(function(){return Mt?cn.filter(xt?function(Bn){return Bn.value>=12}:function(Bn){return Bn.value<12}).map(function(Bn){var Xn=Bn.value%12,Qn=Xn===0?"12":W(Xn,2);return Object(O.a)(Object(O.a)({},Bn),{},{label:Qn,value:Xn})}):cn},[Mt,cn]),cr=ue(0,59,Nt,yn&&yn(bt)),zn=ue(0,59,Qt,Dn&&Dn(bt,Lt));Me.current={onUpDown:function(Xn){var Qn=Ht[st];if(Qn)for(var Cr=Qn.units.findIndex(function(xi){return xi.value===Qn.value}),Wr=Qn.units.length,Jr=1;Jr<Wr;Jr+=1){var li=Qn.units[(Cr+Xn*Jr+Wr)%Wr];if(li.disabled!==!0){Qn.onSelect(li.value);break}}}};function Dr(Bn,Xn,Qn,Cr,Wr){Bn!==!1&&Ht.push({node:m.cloneElement(Xn,{prefixCls:Tn,value:Qn,active:st===Ht.length,onSelect:Wr,units:Cr,hideDisabledOptions:Kt}),onSelect:Wr,value:Qn,units:Cr})}Dr(ct,m.createElement(V,{key:"hour"}),bt,rr,function(Bn){dn(Et(xt,Bn,Lt,At),"mouse")}),Dr(ht,m.createElement(V,{key:"minute"}),Lt,cr,function(Bn){dn(Et(xt,bt,Bn,At),"mouse")}),Dr(at,m.createElement(V,{key:"second"}),At,zn,function(Bn){dn(Et(xt,bt,Lt,Bn),"mouse")});var Kr=-1;return typeof xt=="boolean"&&(Kr=xt?1:0),Dr(Mt===!0,m.createElement(V,{key:"12hours"}),Kr,[{label:"AM",value:0,disabled:rn},{label:"PM",value:1,disabled:Cn}],function(Bn){dn(Et(!!Bn,bt,Lt,At),"mouse")}),m.createElement("div",{className:Sn},Ht.map(function(Bn){var Xn=Bn.node;return Xn}))}var Tt=$e,ye=function(Te){return Te.filter(function(Ge){return Ge!==!1}).length};function Re(te){var Te=te.generateConfig,Ge=te.format,Me=Ge===void 0?"HH:mm:ss":Ge,st=te.prefixCls,Je=te.active,ct=te.operationRef,ht=te.showHour,at=te.showMinute,Mt=te.showSecond,Gt=te.use12Hours,Vt=Gt===void 0?!1:Gt,wt=te.onSelect,Nt=te.value,it="".concat(st,"-time-panel"),Qt=m.useRef(),Wt=m.useState(-1),yn=Object(D.a)(Wt,2),Dn=yn[0],Kt=yn[1],dn=ye([ht,at,Mt,Vt]);return ct.current={onKeyDown:function(Sn){return p(Sn,{onLeftRight:function(xt){Kt((Dn+xt+dn)%dn)},onUpDown:function(xt){Dn===-1?Kt(0):Qt.current&&Qt.current.onUpDown(xt)},onEnter:function(){wt(Nt||Te.getNow(),"key"),Kt(-1)}})},onBlur:function(){Kt(-1)}},m.createElement("div",{className:b()(it,Object(R.a)({},"".concat(it,"-active"),Je))},m.createElement(C,Object.assign({},te,{format:Me,prefixCls:st})),m.createElement(Tt,Object.assign({},te,{prefixCls:st,activeColumnIndex:Dn,operationRef:Qt})))}var nt=Re,Ue=7;function ke(te,Te){return!te&&!Te?!0:!te||!Te?!1:void 0}function lt(te,Te,Ge){var Me=ke(Te,Ge);if(typeof Me=="boolean")return Me;var st=Math.floor(te.getYear(Te)/10),Je=Math.floor(te.getYear(Ge)/10);return st===Je}function Fe(te,Te,Ge){var Me=ke(Te,Ge);return typeof Me=="boolean"?Me:te.getYear(Te)===te.getYear(Ge)}function Ze(te,Te){var Ge=Math.floor(te.getMonth(Te)/3);return Ge+1}function Xe(te,Te,Ge){var Me=ke(Te,Ge);return typeof Me=="boolean"?Me:Fe(te,Te,Ge)&&Ze(te,Te)===Ze(te,Ge)}function ft(te,Te,Ge){var Me=ke(Te,Ge);return typeof Me=="boolean"?Me:Fe(te,Te,Ge)&&te.getMonth(Te)===te.getMonth(Ge)}function Rt(te,Te,Ge){var Me=ke(Te,Ge);return typeof Me=="boolean"?Me:te.getYear(Te)===te.getYear(Ge)&&te.getMonth(Te)===te.getMonth(Ge)&&te.getDate(Te)===te.getDate(Ge)}function Pt(te,Te,Ge){var Me=ke(Te,Ge);return typeof Me=="boolean"?Me:te.getHour(Te)===te.getHour(Ge)&&te.getMinute(Te)===te.getMinute(Ge)&&te.getSecond(Te)===te.getSecond(Ge)}function Bt(te,Te,Ge,Me){var st=ke(Ge,Me);return typeof st=="boolean"?st:te.locale.getWeek(Te,Ge)===te.locale.getWeek(Te,Me)}function Ve(te,Te,Ge){return Rt(te,Te,Ge)&&Pt(te,Te,Ge)}function Ft(te,Te,Ge,Me){return!Te||!Ge||!Me?!1:!Rt(te,Te,Me)&&!Rt(te,Ge,Me)&&te.isAfter(Me,Te)&&te.isAfter(Ge,Me)}function nn(te,Te,Ge){var Me=Te.locale.getWeekFirstDay(te),st=Te.setDate(Ge,1),Je=Te.getWeekDay(st),ct=Te.addDate(st,Me-Je);return Te.getMonth(ct)===Te.getMonth(Ge)&&Te.getDate(ct)>1&&(ct=Te.addDate(ct,-7)),ct}function Le(te,Te,Ge){var Me=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;switch(Te){case"year":return Ge.addYear(te,Me*10);case"quarter":case"month":return Ge.addYear(te,Me);default:return Ge.addMonth(te,Me)}}var Se=m.createContext({}),ut=Se;function mt(te){var Te=te.cellPrefixCls,Ge=te.generateConfig,Me=te.rangedValue,st=te.hoverRangedValue,Je=te.isInView,ct=te.isSameCell,ht=te.offsetCell,at=te.today,Mt=te.value;function Gt(Vt){var wt,Nt=ht(Vt,-1),it=ht(Vt,1),Qt=se(Me,0),Wt=se(Me,1),yn=se(st,0),Dn=se(st,1),Kt=Ft(Ge,yn,Dn,Vt);function dn(Lt){return ct(Qt,Lt)}function Ht(Lt){return ct(Wt,Lt)}var Sn=ct(yn,Vt),Tn=ct(Dn,Vt),xt=(Kt||Tn)&&(!Je(Nt)||Ht(Nt)),bt=(Kt||Sn)&&(!Je(it)||dn(it));return wt={},Object(R.a)(wt,"".concat(Te,"-in-view"),Je(Vt)),Object(R.a)(wt,"".concat(Te,"-in-range"),Ft(Ge,Qt,Wt,Vt)),Object(R.a)(wt,"".concat(Te,"-range-start"),dn(Vt)),Object(R.a)(wt,"".concat(Te,"-range-end"),Ht(Vt)),Object(R.a)(wt,"".concat(Te,"-range-start-single"),dn(Vt)&&!Wt),Object(R.a)(wt,"".concat(Te,"-range-end-single"),Ht(Vt)&&!Qt),Object(R.a)(wt,"".concat(Te,"-range-start-near-hover"),dn(Vt)&&(ct(Nt,yn)||Ft(Ge,yn,Dn,Nt))),Object(R.a)(wt,"".concat(Te,"-range-end-near-hover"),Ht(Vt)&&(ct(it,Dn)||Ft(Ge,yn,Dn,it))),Object(R.a)(wt,"".concat(Te,"-range-hover"),Kt),Object(R.a)(wt,"".concat(Te,"-range-hover-start"),Sn),Object(R.a)(wt,"".concat(Te,"-range-hover-end"),Tn),Object(R.a)(wt,"".concat(Te,"-range-hover-edge-start"),xt),Object(R.a)(wt,"".concat(Te,"-range-hover-edge-end"),bt),Object(R.a)(wt,"".concat(Te,"-range-hover-edge-start-near-range"),xt&&ct(Nt,Wt)),Object(R.a)(wt,"".concat(Te,"-range-hover-edge-end-near-range"),bt&&ct(it,Qt)),Object(R.a)(wt,"".concat(Te,"-today"),ct(at,Vt)),Object(R.a)(wt,"".concat(Te,"-selected"),ct(Mt,Vt)),wt}return Gt}function We(te){for(var Te=te.prefixCls,Ge=te.disabledDate,Me=te.onSelect,st=te.rowNum,Je=te.colNum,ct=te.prefixColumn,ht=te.rowClassName,at=te.baseDate,Mt=te.getCellClassName,Gt=te.getCellText,Vt=te.getCellNode,wt=te.getCellDate,Nt=te.titleCell,it=te.headerCells,Qt=m.useContext(s),Wt=Qt.onDateMouseEnter,yn=Qt.onDateMouseLeave,Dn="".concat(Te,"-cell"),Kt=[],dn=0;dn<st;dn+=1){for(var Ht=[],Sn=void 0,Tn=function(Lt){var At=dn*Je+Lt,Et=wt(at,At),mn=Ge&&Ge(Et);Lt===0&&(Sn=Et,ct&&Ht.push(ct(Sn))),Ht.push(m.createElement("td",{key:Lt,title:Nt&&Nt(Et),className:b()(Dn,Object(O.a)(Object(R.a)({},"".concat(Dn,"-disabled"),mn),Mt(Et))),onClick:function(){mn||Me(Et)},onMouseEnter:function(){!mn&&Wt&&Wt(Et)},onMouseLeave:function(){!mn&&yn&&yn(Et)}},Vt?Vt(Et):m.createElement("div",{className:"".concat(Dn,"-inner")},Gt(Et))))},xt=0;xt<Je;xt+=1)Tn(xt);Kt.push(m.createElement("tr",{key:dn,className:ht&&ht(Sn)},Ht))}return m.createElement("div",{className:"".concat(Te,"-body")},m.createElement("table",{className:"".concat(Te,"-content")},it&&m.createElement("thead",null,m.createElement("tr",null,it)),m.createElement("tbody",null,Kt)))}function vt(te){var Te=te.prefixCls,Ge=te.generateConfig,Me=te.prefixColumn,st=te.locale,Je=te.rowCount,ct=te.viewDate,ht=te.value,at=te.dateRender,Mt=m.useContext(ut),Gt=Mt.rangedValue,Vt=Mt.hoverRangedValue,wt=nn(st.locale,Ge,ct),Nt="".concat(Te,"-cell"),it=Ge.locale.getWeekFirstDay(st.locale),Qt=Ge.getNow(),Wt=[],yn=st.shortWeekDays||(Ge.locale.getShortWeekDays?Ge.locale.getShortWeekDays(st.locale):[]);Me&&Wt.push(m.createElement("th",{key:"empty","aria-label":"empty cell"}));for(var Dn=0;Dn<Ue;Dn+=1)Wt.push(m.createElement("th",{key:Dn},yn[(Dn+it)%Ue]));var Kt=mt({cellPrefixCls:Nt,today:Qt,value:ht,generateConfig:Ge,rangedValue:Me?null:Gt,hoverRangedValue:Me?null:Vt,isSameCell:function(Sn,Tn){return Rt(Ge,Sn,Tn)},isInView:function(Sn){return ft(Ge,Sn,ct)},offsetCell:function(Sn,Tn){return Ge.addDate(Sn,Tn)}}),dn=at?function(Ht){return at(Ht,Qt)}:void 0;return m.createElement(We,Object.assign({},te,{rowNum:Je,colNum:Ue,baseDate:wt,getCellNode:dn,getCellText:Ge.getDate,getCellClassName:Kt,getCellDate:Ge.addDate,titleCell:function(Sn){return Ge.locale.format(st.locale,Sn,"YYYY-MM-DD")},headerCells:Wt}))}var Pe=vt;function xe(te){var Te=te.prefixCls,Ge=te.generateConfig,Me=te.locale,st=te.viewDate,Je=te.onNextMonth,ct=te.onPrevMonth,ht=te.onNextYear,at=te.onPrevYear,Mt=te.onYearClick,Gt=te.onMonthClick,Vt=m.useContext(s),wt=Vt.hideHeader;if(wt)return null;var Nt="".concat(Te,"-header"),it=Me.shortMonths||(Ge.locale.getShortMonths?Ge.locale.getShortMonths(Me.locale):[]),Qt=Ge.getMonth(st),Wt=m.createElement("button",{type:"button",key:"year",onClick:Mt,tabIndex:-1,className:"".concat(Te,"-year-btn")},Ge.locale.format(Me.locale,st,Me.yearFormat)),yn=m.createElement("button",{type:"button",key:"month",onClick:Gt,tabIndex:-1,className:"".concat(Te,"-month-btn")},Me.monthFormat?Ge.locale.format(Me.locale,st,Me.monthFormat):it[Qt]),Dn=Me.monthBeforeYear?[yn,Wt]:[Wt,yn];return m.createElement(h,Object.assign({},te,{prefixCls:Nt,onSuperPrev:at,onPrev:ct,onNext:Je,onSuperNext:ht}),Dn)}var we=xe,ie=6;function ae(te){var Te=te.prefixCls,Ge=te.panelName,Me=Ge===void 0?"date":Ge,st=te.keyboardConfig,Je=te.active,ct=te.operationRef,ht=te.generateConfig,at=te.value,Mt=te.viewDate,Gt=te.onViewDateChange,Vt=te.onPanelChange,wt=te.onSelect,Nt="".concat(Te,"-").concat(Me,"-panel");ct.current={onKeyDown:function(yn){return p(yn,Object(O.a)({onLeftRight:function(Kt){wt(ht.addDate(at||Mt,Kt),"key")},onCtrlLeftRight:function(Kt){wt(ht.addYear(at||Mt,Kt),"key")},onUpDown:function(Kt){wt(ht.addDate(at||Mt,Kt*Ue),"key")},onPageUpDown:function(Kt){wt(ht.addMonth(at||Mt,Kt),"key")}},st))}};var it=function(yn){var Dn=ht.addYear(Mt,yn);Gt(Dn),Vt(null,Dn)},Qt=function(yn){var Dn=ht.addMonth(Mt,yn);Gt(Dn),Vt(null,Dn)};return m.createElement("div",{className:b()(Nt,Object(R.a)({},"".concat(Nt,"-active"),Je))},m.createElement(we,Object.assign({},te,{prefixCls:Te,value:at,viewDate:Mt,onPrevYear:function(){it(-1)},onNextYear:function(){it(1)},onPrevMonth:function(){Qt(-1)},onNextMonth:function(){Qt(1)},onMonthClick:function(){Vt("month",Mt)},onYearClick:function(){Vt("year",Mt)}})),m.createElement(Pe,Object.assign({},te,{onSelect:function(yn){return wt(yn,"mouse")},prefixCls:Te,value:at,viewDate:Mt,rowCount:ie})))}var ce=ae;function be(te,Te,Ge){if(!Ge)return Te;var Me=Te;return Me=te.setHour(Me,te.getHour(Ge)),Me=te.setMinute(Me,te.getMinute(Ge)),Me=te.setSecond(Me,te.getSecond(Ge)),Me}var Ce=$("date","time");function Be(te){var Te=te.prefixCls,Ge=te.operationRef,Me=te.generateConfig,st=te.value,Je=te.defaultValue,ct=te.disabledTime,ht=te.showTime,at=te.onSelect,Mt="".concat(Te,"-datetime-panel"),Gt=m.useState(null),Vt=Object(D.a)(Gt,2),wt=Vt[0],Nt=Vt[1],it=m.useRef({}),Qt=m.useRef({}),Wt=Object(c.a)(ht)==="object"?Object(O.a)({},ht):{};function yn(Ht){var Sn=Ce.indexOf(wt)+Ht,Tn=Ce[Sn]||null;return Tn}var Dn=function(Sn){Qt.current.onBlur&&Qt.current.onBlur(Sn),Nt(null)};Ge.current={onKeyDown:function(Sn){if(Sn.which===r.a.TAB){var Tn=yn(Sn.shiftKey?-1:1);return Nt(Tn),Tn&&Sn.preventDefault(),!0}if(wt){var xt=wt==="date"?it:Qt;return xt.current&&xt.current.onKeyDown&&xt.current.onKeyDown(Sn),!0}return[r.a.LEFT,r.a.RIGHT,r.a.UP,r.a.DOWN].includes(Sn.which)?(Nt("date"),!0):!1},onBlur:Dn,onClose:Dn};var Kt=function(Sn,Tn){var xt=Sn;Tn==="date"&&!st&&Wt.defaultValue?(xt=Me.setHour(xt,Me.getHour(Wt.defaultValue)),xt=Me.setMinute(xt,Me.getMinute(Wt.defaultValue)),xt=Me.setSecond(xt,Me.getSecond(Wt.defaultValue))):Tn==="time"&&!st&&Je&&(xt=Me.setYear(xt,Me.getYear(Je)),xt=Me.setMonth(xt,Me.getMonth(Je)),xt=Me.setDate(xt,Me.getDate(Je))),at&&at(xt,"mouse")},dn=ct?ct(st||null):{};return m.createElement("div",{className:b()(Mt,Object(R.a)({},"".concat(Mt,"-active"),wt))},m.createElement(ce,Object.assign({},te,{operationRef:it,active:wt==="date",onSelect:function(Sn){Kt(be(Me,Sn,ht&&Object(c.a)(ht)==="object"?ht.defaultValue:null),"date")}})),m.createElement(nt,Object.assign({},te,{format:void 0},Wt,dn,{defaultValue:void 0,operationRef:Qt,active:wt==="time",onSelect:function(Sn){Kt(Sn,"time")}})))}var yt=Be;function Xt(te){var Te=te.prefixCls,Ge=te.generateConfig,Me=te.locale,st=te.value,Je="".concat(Te,"-cell"),ct=function(Gt){return m.createElement("td",{key:"week",className:b()(Je,"".concat(Je,"-week"))},Ge.locale.getWeek(Me.locale,Gt))},ht="".concat(Te,"-week-panel-row"),at=function(Gt){return b()(ht,Object(R.a)({},"".concat(ht,"-selected"),Bt(Ge,Me.locale,st,Gt)))};return m.createElement(ce,Object.assign({},te,{panelName:"week",prefixColumn:ct,rowClassName:at,keyboardConfig:{onLeftRight:null}}))}var an=Xt;function pt(te){var Te=te.prefixCls,Ge=te.generateConfig,Me=te.locale,st=te.viewDate,Je=te.onNextYear,ct=te.onPrevYear,ht=te.onYearClick,at=m.useContext(s),Mt=at.hideHeader;if(Mt)return null;var Gt="".concat(Te,"-header");return m.createElement(h,Object.assign({},te,{prefixCls:Gt,onSuperPrev:ct,onSuperNext:Je}),m.createElement("button",{type:"button",onClick:ht,className:"".concat(Te,"-year-btn")},Ge.locale.format(Me.locale,st,Me.yearFormat)))}var Yt=pt,St=3,Ot=4;function dt(te){var Te=te.prefixCls,Ge=te.locale,Me=te.value,st=te.viewDate,Je=te.generateConfig,ct=te.monthCellRender,ht=m.useContext(ut),at=ht.rangedValue,Mt=ht.hoverRangedValue,Gt="".concat(Te,"-cell"),Vt=mt({cellPrefixCls:Gt,value:Me,generateConfig:Je,rangedValue:at,hoverRangedValue:Mt,isSameCell:function(Wt,yn){return ft(Je,Wt,yn)},isInView:function(){return!0},offsetCell:function(Wt,yn){return Je.addMonth(Wt,yn)}}),wt=Ge.shortMonths||(Je.locale.getShortMonths?Je.locale.getShortMonths(Ge.locale):[]),Nt=Je.setMonth(st,0),it=ct?function(Qt){return ct(Qt,Ge)}:void 0;return m.createElement(We,Object.assign({},te,{rowNum:Ot,colNum:St,baseDate:Nt,getCellNode:it,getCellText:function(Wt){return Ge.monthFormat?Je.locale.format(Ge.locale,Wt,Ge.monthFormat):wt[Je.getMonth(Wt)]},getCellClassName:Vt,getCellDate:Je.addMonth,titleCell:function(Wt){return Je.locale.format(Ge.locale,Wt,"YYYY-MM")}}))}var _e=dt;function je(te){var Te=te.prefixCls,Ge=te.operationRef,Me=te.onViewDateChange,st=te.generateConfig,Je=te.value,ct=te.viewDate,ht=te.onPanelChange,at=te.onSelect,Mt="".concat(Te,"-month-panel");Ge.current={onKeyDown:function(wt){return p(wt,{onLeftRight:function(it){at(st.addMonth(Je||ct,it),"key")},onCtrlLeftRight:function(it){at(st.addYear(Je||ct,it),"key")},onUpDown:function(it){at(st.addMonth(Je||ct,it*St),"key")},onEnter:function(){ht("date",Je||ct)}})}};var Gt=function(wt){var Nt=st.addYear(ct,wt);Me(Nt),ht(null,Nt)};return m.createElement("div",{className:Mt},m.createElement(Yt,Object.assign({},te,{prefixCls:Te,onPrevYear:function(){Gt(-1)},onNextYear:function(){Gt(1)},onYearClick:function(){ht("year",ct)}})),m.createElement(_e,Object.assign({},te,{prefixCls:Te,onSelect:function(wt){at(wt,"mouse"),ht("date",wt)}})))}var kt=je;function gt(te){var Te=te.prefixCls,Ge=te.generateConfig,Me=te.locale,st=te.viewDate,Je=te.onNextYear,ct=te.onPrevYear,ht=te.onYearClick,at=m.useContext(s),Mt=at.hideHeader;if(Mt)return null;var Gt="".concat(Te,"-header");return m.createElement(h,Object.assign({},te,{prefixCls:Gt,onSuperPrev:ct,onSuperNext:Je}),m.createElement("button",{type:"button",onClick:ht,className:"".concat(Te,"-year-btn")},Ge.locale.format(Me.locale,st,Me.yearFormat)))}var zt=gt,$t=4,De=1;function qe(te){var Te=te.prefixCls,Ge=te.locale,Me=te.value,st=te.viewDate,Je=te.generateConfig,ct=m.useContext(ut),ht=ct.rangedValue,at=ct.hoverRangedValue,Mt="".concat(Te,"-cell"),Gt=mt({cellPrefixCls:Mt,value:Me,generateConfig:Je,rangedValue:ht,hoverRangedValue:at,isSameCell:function(Nt,it){return Xe(Je,Nt,it)},isInView:function(){return!0},offsetCell:function(Nt,it){return Je.addMonth(Nt,it*3)}}),Vt=Je.setDate(Je.setMonth(st,0),1);return m.createElement(We,Object.assign({},te,{rowNum:De,colNum:$t,baseDate:Vt,getCellText:function(Nt){return Je.locale.format(Ge.locale,Nt,Ge.quarterFormat||"[Q]Q")},getCellClassName:Gt,getCellDate:function(Nt,it){return Je.addMonth(Nt,it*3)},titleCell:function(Nt){return Je.locale.format(Ge.locale,Nt,"YYYY-[Q]Q")}}))}var jt=qe;function Zt(te){var Te=te.prefixCls,Ge=te.operationRef,Me=te.onViewDateChange,st=te.generateConfig,Je=te.value,ct=te.viewDate,ht=te.onPanelChange,at=te.onSelect,Mt="".concat(Te,"-quarter-panel");Ge.current={onKeyDown:function(wt){return p(wt,{onLeftRight:function(it){at(st.addMonth(Je||ct,it*3),"key")},onCtrlLeftRight:function(it){at(st.addYear(Je||ct,it),"key")},onUpDown:function(it){at(st.addYear(Je||ct,it),"key")}})}};var Gt=function(wt){var Nt=st.addYear(ct,wt);Me(Nt),ht(null,Nt)};return m.createElement("div",{className:Mt},m.createElement(zt,Object.assign({},te,{prefixCls:Te,onPrevYear:function(){Gt(-1)},onNextYear:function(){Gt(1)},onYearClick:function(){ht("year",ct)}})),m.createElement(jt,Object.assign({},te,{prefixCls:Te,onSelect:function(wt){at(wt,"mouse")}})))}var gn=Zt;function On(te){var Te=te.prefixCls,Ge=te.generateConfig,Me=te.viewDate,st=te.onPrevDecade,Je=te.onNextDecade,ct=te.onDecadeClick,ht=m.useContext(s),at=ht.hideHeader;if(at)return null;var Mt="".concat(Te,"-header"),Gt=Ge.getYear(Me),Vt=Math.floor(Gt/hr)*hr,wt=Vt+hr-1;return m.createElement(h,Object.assign({},te,{prefixCls:Mt,onSuperPrev:st,onSuperNext:Je}),m.createElement("button",{type:"button",onClick:ct,className:"".concat(Te,"-decade-btn")},Vt,"-",wt))}var ur=On,Kn=3,wn=4;function xr(te){var Te=te.prefixCls,Ge=te.value,Me=te.viewDate,st=te.locale,Je=te.generateConfig,ct=m.useContext(ut),ht=ct.rangedValue,at=ct.hoverRangedValue,Mt="".concat(Te,"-cell"),Gt=Je.getYear(Me),Vt=Math.floor(Gt/hr)*hr,wt=Vt+hr-1,Nt=Je.setYear(Me,Vt-Math.ceil((Kn*wn-hr)/2)),it=function(yn){var Dn=Je.getYear(yn);return Vt<=Dn&&Dn<=wt},Qt=mt({cellPrefixCls:Mt,value:Ge,generateConfig:Je,rangedValue:ht,hoverRangedValue:at,isSameCell:function(yn,Dn){return Fe(Je,yn,Dn)},isInView:it,offsetCell:function(yn,Dn){return Je.addYear(yn,Dn)}});return m.createElement(We,Object.assign({},te,{rowNum:wn,colNum:Kn,baseDate:Nt,getCellText:Je.getYear,getCellClassName:Qt,getCellDate:Je.addYear,titleCell:function(yn){return Je.locale.format(st.locale,yn,"YYYY")}}))}var Fr=xr,hr=10;function dr(te){var Te=te.prefixCls,Ge=te.operationRef,Me=te.onViewDateChange,st=te.generateConfig,Je=te.value,ct=te.viewDate,ht=te.sourceMode,at=te.onSelect,Mt=te.onPanelChange,Gt="".concat(Te,"-year-panel");Ge.current={onKeyDown:function(Nt){return p(Nt,{onLeftRight:function(Qt){at(st.addYear(Je||ct,Qt),"key")},onCtrlLeftRight:function(Qt){at(st.addYear(Je||ct,Qt*hr),"key")},onUpDown:function(Qt){at(st.addYear(Je||ct,Qt*Kn),"key")},onEnter:function(){Mt(ht==="date"?"date":"month",Je||ct)}})}};var Vt=function(Nt){var it=st.addYear(ct,Nt*10);Me(it),Mt(null,it)};return m.createElement("div",{className:Gt},m.createElement(ur,Object.assign({},te,{prefixCls:Te,onPrevDecade:function(){Vt(-1)},onNextDecade:function(){Vt(1)},onDecadeClick:function(){Mt("decade",ct)}})),m.createElement(Fr,Object.assign({},te,{prefixCls:Te,onSelect:function(Nt){Mt(ht==="date"?"date":"month",Nt),at(Nt,"mouse")}})))}var Nr=dr;function ti(te){var Te=te.prefixCls,Ge=te.generateConfig,Me=te.viewDate,st=te.onPrevDecades,Je=te.onNextDecades,ct=m.useContext(s),ht=ct.hideHeader;if(ht)return null;var at="".concat(Te,"-header"),Mt=Ge.getYear(Me),Gt=Math.floor(Mt/ni)*ni,Vt=Gt+ni-1;return m.createElement(h,Object.assign({},te,{prefixCls:at,onSuperPrev:st,onSuperNext:Je}),Gt,"-",Vt)}var pi=ti,fn=3,ar=4;function oi(te){var Te=Qr-1,Ge=te.prefixCls,Me=te.viewDate,st=te.generateConfig,Je=te.disabledDate,ct="".concat(Ge,"-cell"),ht=st.getYear(Me),at=Math.floor(ht/Qr)*Qr,Mt=Math.floor(ht/ni)*ni,Gt=Mt+ni-1,Vt=st.setYear(Me,Mt-Math.ceil((fn*ar*Qr-ni)/2)),wt=function(it){var Qt,Wt=Je&&Je(it),yn=st.getYear(it),Dn=yn+Te;return Qt={},Object(R.a)(Qt,"".concat(ct,"-disabled"),Wt),Object(R.a)(Qt,"".concat(ct,"-in-view"),Mt<=yn&&Dn<=Gt),Object(R.a)(Qt,"".concat(ct,"-selected"),yn===at),Qt};return m.createElement(We,Object.assign({},te,{rowNum:ar,colNum:fn,baseDate:Vt,getCellText:function(it){var Qt=st.getYear(it);return"".concat(Qt,"-").concat(Qt+Te)},getCellClassName:wt,getCellDate:function(it,Qt){return st.addYear(it,Qt*Qr)}}))}var _i=oi,Qr=10,ni=Qr*10;function ee(te){var Te=te.prefixCls,Ge=te.onViewDateChange,Me=te.generateConfig,st=te.viewDate,Je=te.operationRef,ct=te.onSelect,ht=te.onPanelChange,at="".concat(Te,"-decade-panel");Je.current={onKeyDown:function(wt){return p(wt,{onLeftRight:function(it){ct(Me.addYear(st,it*Qr),"key")},onCtrlLeftRight:function(it){ct(Me.addYear(st,it*ni),"key")},onUpDown:function(it){ct(Me.addYear(st,it*Qr*fn),"key")},onEnter:function(){ht("year",st)}})}};var Mt=function(wt){var Nt=Me.addYear(st,wt*ni);Ge(Nt),ht(null,Nt)},Gt=function(wt){ct(wt,"mouse"),ht("year",wt)};return m.createElement("div",{className:at},m.createElement(pi,Object.assign({},te,{prefixCls:Te,onPrevDecades:function(){Mt(-1)},onNextDecades:function(){Mt(1)}})),m.createElement(_i,Object.assign({},te,{prefixCls:Te,onSelect:Gt})))}var B=ee;function K(te,Te,Ge){return Ge?m.createElement("div",{className:"".concat(te,"-footer-extra")},Ge(Te)):null}function Q(te){var Te=te.prefixCls,Ge=te.rangeList,Me=Ge===void 0?[]:Ge,st=te.components,Je=st===void 0?{}:st,ct=te.needConfirmButton,ht=te.onNow,at=te.onOk,Mt=te.okDisabled,Gt=te.showNow,Vt=te.locale,wt,Nt;if(Me.length){var it=Je.rangeItem||"span";wt=m.createElement(m.Fragment,null,Me.map(function(Wt){var yn=Wt.label,Dn=Wt.onClick,Kt=Wt.onMouseEnter,dn=Wt.onMouseLeave;return m.createElement("li",{key:yn,className:"".concat(Te,"-preset")},m.createElement(it,{onClick:Dn,onMouseEnter:Kt,onMouseLeave:dn},yn))}))}if(ct){var Qt=Je.button||"button";ht&&!wt&&Gt!==!1&&(wt=m.createElement("li",{className:"".concat(Te,"-now")},m.createElement("a",{className:"".concat(Te,"-now-btn"),onClick:ht},Vt.now))),Nt=ct&&m.createElement("li",{className:"".concat(Te,"-ok")},m.createElement(Qt,{disabled:Mt,onClick:at},Vt.ok))}return!wt&&!Nt?null:m.createElement("ul",{className:"".concat(Te,"-ranges")},wt,Nt)}function le(te){var Te,Ge=te.prefixCls,Me=Ge===void 0?"rc-picker":Ge,st=te.className,Je=te.style,ct=te.locale,ht=te.generateConfig,at=te.value,Mt=te.defaultValue,Gt=te.pickerValue,Vt=te.defaultPickerValue,wt=te.disabledDate,Nt=te.mode,it=te.picker,Qt=it===void 0?"date":it,Wt=te.tabIndex,yn=Wt===void 0?0:Wt,Dn=te.showNow,Kt=te.showTime,dn=te.showToday,Ht=te.renderExtraFooter,Sn=te.hideHeader,Tn=te.onSelect,xt=te.onChange,bt=te.onPanelChange,Lt=te.onMouseDown,At=te.onPickerValueChange,Et=te.onOk,mn=te.components,cn=te.direction,_n=te.hourStep,un=_n===void 0?1:_n,rn=te.minuteStep,Cn=rn===void 0?1:rn,rr=te.secondStep,cr=rr===void 0?1:rr,zn=Qt==="date"&&!!Kt||Qt==="time",Dr=24%un===0,Kr=60%Cn===0,Bn=60%cr===0,Xn=m.useContext(s),Qn=Xn.operationRef,Cr=Xn.panelRef,Wr=Xn.onSelect,Jr=Xn.hideRanges,li=Xn.defaultOpenValue,xi=m.useContext(ut),mi=xi.inRange,Xi=xi.panelPosition,Oi=xi.rangedValue,Pi=xi.hoverRangedValue,vi=m.useRef({}),Ni=m.useRef(!0),ia=Object(d.a)(null,{value:at,defaultValue:Mt,postState:function(pn){return!pn&&li&&Qt==="time"?li:pn}}),ui=Object(D.a)(ia,2),di=ui[0],Ri=ui[1],Ci=Object(d.a)(null,{value:Gt,defaultValue:Vt||di,postState:function(pn){return pn||ht.getNow()}}),Oe=Object(D.a)(Ci,2),et=Oe[0],rt=Oe[1],Ie=function(pn){rt(pn),At&&At(pn)},de=function(pn){var Mn=G[Qt];return Mn?Mn(pn):pn},Ee=Object(d.a)(function(){return Qt==="time"?"time":de("date")},{value:Nt}),pe=Object(D.a)(Ee,2),Ne=pe[0],Ke=pe[1];m.useEffect(function(){Ke(Qt)},[Qt]);var ot=m.useState(function(){return Ne}),He=Object(D.a)(ot,2),_t=He[0],Ut=He[1],en=function(pn,Mn){var gr=de(pn||Ne);Ut(Ne),Ke(gr),bt&&(Ne!==gr||Ve(ht,et,et))&&bt(Mn,gr)},hn=function(pn,Mn){var gr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;(Ne===Qt||gr)&&(Ri(pn),Tn&&Tn(pn),Wr&&Wr(pn,Mn),xt&&!Ve(ht,pn,di)&&xt(pn))},Rn=function(pn){return vi.current&&vi.current.onKeyDown?([r.a.LEFT,r.a.RIGHT,r.a.UP,r.a.DOWN,r.a.PAGE_UP,r.a.PAGE_DOWN,r.a.ENTER].includes(pn.which)&&pn.preventDefault(),vi.current.onKeyDown(pn)):(Object(i.a)(!1,"Panel not correct handle keyDown event. Please help to fire issue about this."),!1)},Wn=function(pn){vi.current&&vi.current.onBlur&&vi.current.onBlur(pn)};Qn&&Xi!=="right"&&(Qn.current={onKeyDown:Rn,onClose:function(){vi.current&&vi.current.onClose&&vi.current.onClose()}}),m.useEffect(function(){at&&!Ni.current&&rt(at)},[at]),m.useEffect(function(){Ni.current=!1},[]);var lr,on=Object(O.a)(Object(O.a)({},te),{},{operationRef:vi,prefixCls:Me,viewDate:et,value:di,onViewDateChange:Ie,sourceMode:_t,onPanelChange:en,disabledDate:Ne!=="decade"?wt:void 0});delete on.onChange,delete on.onSelect;switch(Ne){case"decade":lr=m.createElement(B,Object.assign({},on,{onSelect:function(pn,Mn){Ie(pn),hn(pn,Mn)}}));break;case"year":lr=m.createElement(Nr,Object.assign({},on,{onSelect:function(pn,Mn){Ie(pn),hn(pn,Mn)}}));break;case"month":lr=m.createElement(kt,Object.assign({},on,{onSelect:function(pn,Mn){Ie(pn),hn(pn,Mn)}}));break;case"quarter":lr=m.createElement(gn,Object.assign({},on,{onSelect:function(pn,Mn){Ie(pn),hn(pn,Mn)}}));break;case"week":lr=m.createElement(an,Object.assign({},on,{onSelect:function(pn,Mn){Ie(pn),hn(pn,Mn)}}));break;case"time":delete on.showTime,lr=m.createElement(nt,Object.assign({},on,Object(c.a)(Kt)==="object"?Kt:null,{onSelect:function(pn,Mn){Ie(pn),hn(pn,Mn)}}));break;default:Kt?lr=m.createElement(yt,Object.assign({},on,{onSelect:function(pn,Mn){Ie(pn),hn(pn,Mn)}})):lr=m.createElement(ce,Object.assign({},on,{onSelect:function(pn,Mn){Ie(pn),hn(pn,Mn)}}))}var It,Jt,Pn=function(){var pn=ht.getNow(),Mn=Ae(ht.getHour(pn),ht.getMinute(pn),ht.getSecond(pn),Dr?un:1,Kr?Cn:1,Bn?cr:1),gr=ve(ht,pn,Mn[0],Mn[1],Mn[2]);hn(gr,"submit")};Jr||(It=K(Me,Ne,Ht),Jt=Q({prefixCls:Me,components:mn,needConfirmButton:zn,okDisabled:!di||wt&&wt(di),locale:ct,showNow:Dn,onNow:zn&&Pn,onOk:function(){di&&(hn(di,"submit",!0),Et&&Et(di))}}));var En;if(dn&&Ne==="date"&&Qt==="date"&&!Kt){var vr=ht.getNow(),qn="".concat(Me,"-today-btn"),Tr=wt&&wt(vr);En=m.createElement("a",{className:b()(qn,Tr&&"".concat(qn,"-disabled")),"aria-disabled":Tr,onClick:function(){Tr||hn(vr,"mouse",!0)}},ct.today)}return m.createElement(s.Provider,{value:Object(O.a)(Object(O.a)({},Xn),{},{hideHeader:"hideHeader"in te?Sn:Xn.hideHeader,hidePrevBtn:mi&&Xi==="right",hideNextBtn:mi&&Xi==="left"})},m.createElement("div",{tabIndex:yn,className:b()("".concat(Me,"-panel"),st,(Te={},Object(R.a)(Te,"".concat(Me,"-panel-has-range"),Oi&&Oi[0]&&Oi[1]),Object(R.a)(Te,"".concat(Me,"-panel-has-range-hover"),Pi&&Pi[0]&&Pi[1]),Object(R.a)(Te,"".concat(Me,"-panel-rtl"),cn==="rtl"),Te)),style:Je,onKeyDown:Rn,onBlur:Wn,onMouseDown:Lt,ref:Cr},lr,It||Jt||En?m.createElement("div",{className:"".concat(Me,"-footer")},It,Jt,En):null))}var Z=le,Qe=I("uciX"),qt={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 An(te){var Te,Ge=te.prefixCls,Me=te.popupElement,st=te.popupStyle,Je=te.visible,ct=te.dropdownClassName,ht=te.dropdownAlign,at=te.transitionName,Mt=te.getPopupContainer,Gt=te.children,Vt=te.range,wt=te.popupPlacement,Nt=te.direction,it="".concat(Ge,"-dropdown"),Qt=function(){return wt!==void 0?wt:Nt==="rtl"?"bottomRight":"bottomLeft"};return m.createElement(Qe.a,{showAction:[],hideAction:[],popupPlacement:Qt(),builtinPlacements:qt,prefixCls:it,popupTransitionName:at,popup:Me,popupAlign:ht,popupVisible:Je,popupClassName:b()(ct,(Te={},Object(R.a)(Te,"".concat(it,"-range"),Vt),Object(R.a)(Te,"".concat(it,"-rtl"),Nt==="rtl"),Te)),popupStyle:st,getPopupContainer:Mt},Gt)}var Vn=An;function sn(te){var Te=te.open,Ge=te.value,Me=te.isClickOutside,st=te.triggerOpen,Je=te.forwardKeyDown,ct=te.blurToCancel,ht=te.onSubmit,at=te.onCancel,Mt=te.onFocus,Gt=te.onBlur,Vt=Object(m.useState)(!1),wt=Object(D.a)(Vt,2),Nt=wt[0],it=wt[1],Qt=Object(m.useState)(!1),Wt=Object(D.a)(Qt,2),yn=Wt[0],Dn=Wt[1],Kt=Object(m.useRef)(!1),dn=Object(m.useRef)(!1),Ht={onMouseDown:function(){it(!0),st(!0)},onKeyDown:function(Tn){switch(Tn.which){case r.a.ENTER:{Te?ht()!==!1&&it(!0):st(!0),Tn.preventDefault();return}case r.a.TAB:{Nt&&Te&&!Tn.shiftKey?(it(!1),Tn.preventDefault()):!Nt&&Te&&(!Je(Tn)&&Tn.shiftKey&&(it(!0),Tn.preventDefault()));return}case r.a.ESC:{it(!0),at();return}}!Te&&![r.a.SHIFT].includes(Tn.which)?st(!0):Nt||Je(Tn)},onFocus:function(Tn){it(!0),Dn(!0),Mt&&Mt(Tn)},onBlur:function(Tn){if(Kt.current||!Me(document.activeElement)){Kt.current=!1;return}ct?setTimeout(function(){Me(document.activeElement)&&at()},0):Te&&(st(!1),dn.current&&ht()),Dn(!1),Gt&&Gt(Tn)}};return Object(m.useEffect)(function(){dn.current=!1},[Te]),Object(m.useEffect)(function(){dn.current=!0},[Ge]),Object(m.useEffect)(function(){return y(function(Sn){var Tn=Sn.target;Te&&(Me(Tn)?yn||st(!1):(Kt.current=!0,requestAnimationFrame(function(){Kt.current=!1})))})}),[Ht,{focused:yn,typing:Nt}]}function tr(te){var Te=te.valueTexts,Ge=te.onTextChange,Me=m.useState(""),st=Object(D.a)(Me,2),Je=st[0],ct=st[1],ht=m.useRef([]);ht.current=Te;function at(Gt){ct(Gt),Ge(Gt)}function Mt(){ct(ht.current[0])}return m.useEffect(function(){Te.every(function(Gt){return Gt!==Je})&&Mt()},[Te.join("||")]),[Je,at,Mt]}var vn=I("Gytx"),ln=I.n(vn);function xn(te,Te){var Ge=Te.formatList,Me=Te.generateConfig,st=Te.locale;return Object(A.a)(function(){if(!te)return[[""],""];for(var Je="",ct=[],ht=0;ht<Ge.length;ht+=1){var at=Ge[ht],Mt=Me.locale.format(st.locale,te,at);ct.push(Mt),ht===0&&(Je=Mt)}return[ct,Je]},[te,Ge],function(Je,ct){return Je[0]!==ct[0]||!ln()(Je[1],ct[1])})}function In(te,Te){var Ge=Te.formatList,Me=Te.generateConfig,st=Te.locale,Je=Object(m.useState)(null),ct=Object(D.a)(Je,2),ht=ct[0],at=ct[1],Mt=Object(m.useRef)(null);function Gt(Wt){var yn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(cancelAnimationFrame(Mt.current),yn){at(Wt);return}Mt.current=requestAnimationFrame(function(){at(Wt)})}var Vt=xn(ht,{formatList:Ge,generateConfig:Me,locale:st}),wt=Object(D.a)(Vt,2),Nt=wt[1];function it(Wt){Gt(Wt)}function Qt(){var Wt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;Gt(null,Wt)}return Object(m.useEffect)(function(){Qt(!0)},[te]),Object(m.useEffect)(function(){return function(){return cancelAnimationFrame(Mt.current)}},[]),[Nt,it,Qt]}function sr(te){var Te,Ge=te.prefixCls,Me=Ge===void 0?"rc-picker":Ge,st=te.id,Je=te.tabIndex,ct=te.style,ht=te.className,at=te.dropdownClassName,Mt=te.dropdownAlign,Gt=te.popupStyle,Vt=te.transitionName,wt=te.generateConfig,Nt=te.locale,it=te.inputReadOnly,Qt=te.allowClear,Wt=te.autoFocus,yn=te.showTime,Dn=te.picker,Kt=Dn===void 0?"date":Dn,dn=te.format,Ht=te.use12Hours,Sn=te.value,Tn=te.defaultValue,xt=te.open,bt=te.defaultOpen,Lt=te.defaultOpenValue,At=te.suffixIcon,Et=te.clearIcon,mn=te.disabled,cn=te.disabledDate,_n=te.placeholder,un=te.getPopupContainer,rn=te.pickerRef,Cn=te.panelRender,rr=te.onChange,cr=te.onOpenChange,zn=te.onFocus,Dr=te.onBlur,Kr=te.onMouseDown,Bn=te.onMouseUp,Xn=te.onMouseEnter,Qn=te.onMouseLeave,Cr=te.onContextMenu,Wr=te.onClick,Jr=te.direction,li=te.autoComplete,xi=li===void 0?"off":li,mi=m.useRef(null),Xi=Kt==="date"&&!!yn||Kt==="time",Oi=q(l(dn,Kt,yn,Ht)),Pi=m.useRef(null),vi=m.useRef(null),Ni=Object(d.a)(null,{value:Sn,defaultValue:Tn}),ia=Object(D.a)(Ni,2),ui=ia[0],di=ia[1],Ri=m.useState(ui),Ci=Object(D.a)(Ri,2),Oe=Ci[0],et=Ci[1],rt=m.useRef(null),Ie=Object(d.a)(!1,{value:xt,defaultValue:bt,postState:function(fr){return mn?!1:fr},onChange:function(fr){cr&&cr(fr),!fr&&rt.current&&rt.current.onClose&&rt.current.onClose()}}),de=Object(D.a)(Ie,2),Ee=de[0],pe=de[1],Ne=xn(Oe,{formatList:Oi,generateConfig:wt,locale:Nt}),Ke=Object(D.a)(Ne,2),ot=Ke[0],He=Ke[1],_t=tr({valueTexts:ot,onTextChange:function(fr){var si=wt.locale.parse(Nt.locale,fr,Oi);si&&(!cn||!cn(si))&&et(si)}}),Ut=Object(D.a)(_t,3),en=Ut[0],hn=Ut[1],Rn=Ut[2],Wn=function(fr){et(fr),di(fr),rr&&!Ve(wt,ui,fr)&&rr(fr,fr?wt.locale.format(Nt.locale,fr,Oi[0]):"")},lr=function(fr){if(mn&&fr)return;pe(fr)},on=function(fr){return Ee&&rt.current&&rt.current.onKeyDown?rt.current.onKeyDown(fr):(Object(i.a)(!1,"Picker not correct forward KeyDown operation. Please help to fire issue about this."),!1)},It=function(){Bn&&Bn.apply(void 0,arguments),mi.current&&(mi.current.focus(),lr(!0))},Jt=sn({blurToCancel:Xi,open:Ee,value:en,triggerOpen:lr,forwardKeyDown:on,isClickOutside:function(fr){return!z([Pi.current,vi.current],fr)},onSubmit:function(){return cn&&cn(Oe)?!1:(Wn(Oe),lr(!1),Rn(),!0)},onCancel:function(){lr(!1),et(ui),Rn()},onFocus:zn,onBlur:Dr}),Pn=Object(D.a)(Jt,2),En=Pn[0],vr=Pn[1],qn=vr.focused,Tr=vr.typing;m.useEffect(function(){Ee||(et(ui),!ot.length||ot[0]===""?hn(""):He!==en&&Rn())},[Ee,ot]),m.useEffect(function(){Ee||Rn()},[Kt]),m.useEffect(function(){et(ui)},[ui]),rn&&(rn.current={focus:function(){mi.current&&mi.current.focus()},blur:function(){mi.current&&mi.current.blur()}});var ir=Object(O.a)(Object(O.a)({},te),{},{className:void 0,style:void 0,pickerValue:void 0,onPickerValueChange:void 0}),pn=m.createElement(Z,Object.assign({},ir,{generateConfig:wt,className:b()(Object(R.a)({},"".concat(Me,"-panel-focused"),!Tr)),value:Oe,locale:Nt,tabIndex:-1,onChange:et,direction:Jr}));Cn&&(pn=Cn(pn));var Mn=m.createElement("div",{className:"".concat(Me,"-panel-container"),onMouseDown:function(fr){fr.preventDefault()}},pn),gr;At&&(gr=m.createElement("span",{className:"".concat(Me,"-suffix")},At));var Rr;Qt&&ui&&!mn&&(Rr=m.createElement("span",{onMouseDown:function(fr){fr.preventDefault(),fr.stopPropagation()},onMouseUp:function(fr){fr.preventDefault(),fr.stopPropagation(),Wn(null),lr(!1)},className:"".concat(Me,"-clear")},Et||m.createElement("span",{className:"".concat(Me,"-clear-btn")})));var Jn=function(fr,si){(si==="submit"||si!=="key"&&!Xi)&&(Wn(fr),lr(!1))},Mr=Jr==="rtl"?"bottomRight":"bottomLeft",Yr=In(en,{formatList:Oi,generateConfig:wt,locale:Nt}),Lr=Object(D.a)(Yr,3),Br=Lr[0],jr=Lr[1],Ir=Lr[2];return m.createElement(s.Provider,{value:{operationRef:rt,hideHeader:Kt==="time",panelRef:Pi,onSelect:Jn,open:Ee,defaultOpenValue:Lt,onDateMouseEnter:jr,onDateMouseLeave:Ir}},m.createElement(Vn,{visible:Ee,popupElement:Mn,popupStyle:Gt,prefixCls:Me,dropdownClassName:at,dropdownAlign:Mt,getPopupContainer:un,transitionName:Vt,popupPlacement:Mr,direction:Jr},m.createElement("div",{className:b()(Me,ht,(Te={},Object(R.a)(Te,"".concat(Me,"-disabled"),mn),Object(R.a)(Te,"".concat(Me,"-focused"),qn),Object(R.a)(Te,"".concat(Me,"-rtl"),Jr==="rtl"),Te)),style:ct,onMouseDown:Kr,onMouseUp:It,onMouseEnter:Xn,onMouseLeave:Qn,onContextMenu:Cr,onClick:Wr},m.createElement("div",{className:b()("".concat(Me,"-input"),Object(R.a)({},"".concat(Me,"-input-placeholder"),!!Br)),ref:vi},m.createElement("input",Object.assign({id:st,tabIndex:Je,disabled:mn,readOnly:it||!Tr,value:Br||en,onChange:function(fr){hn(fr.target.value)},autoFocus:Wt,placeholder:_n,ref:mi,title:en},En,{size:u(Kt,Oi[0])},fe(te),{autoComplete:xi})),gr,Rr))))}var $n=function(te){Object(P.a)(Ge,te);var Te=Object(F.a)(Ge);function Ge(){var Me;return Object(Y.a)(this,Ge),Me=Te.apply(this,arguments),Me.pickerRef=m.createRef(),Me.focus=function(){Me.pickerRef.current&&Me.pickerRef.current.focus()},Me.blur=function(){Me.pickerRef.current&&Me.pickerRef.current.blur()},Me}return Object(H.a)(Ge,[{key:"render",value:function(){return m.createElement(sr,Object.assign({},this.props,{pickerRef:this.pickerRef}))}}]),Ge}(m.Component),Zn=$n;function kn(te,Te,Ge){var Me=te.picker,st=te.locale,Je=te.selectedValue,ct=te.disabledDate,ht=te.disabled,at=te.generateConfig,Mt=se(Je,0),Gt=se(Je,1);function Vt(Wt){var yn=at.getYear(Wt),Dn=at.locale.getWeek(st.locale,Wt);return yn*100+Dn}function wt(Wt){var yn=at.getYear(Wt),Dn=at.getMonth(Wt);return yn*100+Dn}function Nt(Wt){var yn=at.getYear(Wt),Dn=Ze(at,Wt);return yn*10+Dn}var it=m.useCallback(function(Wt){if(ct&&ct(Wt))return!0;if(ht[1]&&Gt)return!Rt(at,Wt,Gt)&&at.isAfter(Wt,Gt);if(Te&&Gt)switch(Me){case"quarter":return Nt(Wt)>Nt(Gt);case"month":return wt(Wt)>wt(Gt);case"week":return Vt(Wt)>Vt(Gt);default:return!Rt(at,Wt,Gt)&&at.isAfter(Wt,Gt)}return!1},[ct,ht[1],Gt,Te]),Qt=m.useCallback(function(Wt){if(ct&&ct(Wt))return!0;if(ht[0]&&Mt)return!Rt(at,Wt,Gt)&&at.isAfter(Mt,Wt);if(Ge&&Mt)switch(Me){case"quarter":return Nt(Wt)<Nt(Mt);case"month":return wt(Wt)<wt(Mt);case"week":return Vt(Wt)<Vt(Mt);default:return!Rt(at,Wt,Mt)&&at.isAfter(Mt,Wt)}return!1},[ct,ht[0],Mt,Ge]);return[it,Qt]}function mr(te,Te,Ge,Me){var st=Le(te,Ge,Me,1);function Je(ct){return ct(te,Te)?"same":ct(st,Te)?"closing":"far"}switch(Ge){case"year":return Je(function(ct,ht){return lt(Me,ct,ht)});case"quarter":case"month":return Je(function(ct,ht){return Fe(Me,ct,ht)});default:return Je(function(ct,ht){return ft(Me,ct,ht)})}}function Fn(te,Te,Ge,Me){var st=se(te,0),Je=se(te,1);if(Te===0)return st;if(st&&Je){var ct=mr(st,Je,Ge,Me);switch(ct){case"same":return st;case"closing":return st;default:return Le(Je,Ge,Me,-1)}}return st}function nr(te){var Te=te.values,Ge=te.picker,Me=te.defaultDates,st=te.generateConfig,Je=m.useState(function(){return[se(Me,0),se(Me,1)]}),ct=Object(D.a)(Je,2),ht=ct[0],at=ct[1],Mt=m.useState(null),Gt=Object(D.a)(Mt,2),Vt=Gt[0],wt=Gt[1],Nt=se(Te,0),it=se(Te,1);function Qt(yn){return ht[yn]?ht[yn]:se(Vt,yn)||Fn(Te,yn,Ge,st)||Nt||it||st.getNow()}function Wt(yn,Dn){if(yn){var Kt=me(Vt,yn,Dn);at(me(ht,null,Dn)||[null,null]);var dn=(Dn+1)%2;se(Te,dn)||(Kt=me(Kt,yn,dn)),wt(Kt)}else(Nt||it)&&wt(null)}return[Qt,Wt]}function Gn(te,Te){return te&&te[0]&&te[1]&&Te.isAfter(te[0],te[1])?[te[1],te[0]]:te}function Hn(te,Te,Ge,Me){return te||Me&&Me[Te]?!0:!!Ge[(Te+1)%2]}function Sr(te){var Te,Ge,Me,st=te.prefixCls,Je=st===void 0?"rc-picker":st,ct=te.id,ht=te.style,at=te.className,Mt=te.popupStyle,Gt=te.dropdownClassName,Vt=te.transitionName,wt=te.dropdownAlign,Nt=te.getPopupContainer,it=te.generateConfig,Qt=te.locale,Wt=te.placeholder,yn=te.autoFocus,Dn=te.disabled,Kt=te.format,dn=te.picker,Ht=dn===void 0?"date":dn,Sn=te.showTime,Tn=te.use12Hours,xt=te.separator,bt=xt===void 0?"~":xt,Lt=te.value,At=te.defaultValue,Et=te.defaultPickerValue,mn=te.open,cn=te.defaultOpen,_n=te.disabledDate,un=te.disabledTime,rn=te.dateRender,Cn=te.panelRender,rr=te.ranges,cr=te.allowEmpty,zn=te.allowClear,Dr=te.suffixIcon,Kr=te.clearIcon,Bn=te.pickerRef,Xn=te.inputReadOnly,Qn=te.mode,Cr=te.renderExtraFooter,Wr=te.onChange,Jr=te.onOpenChange,li=te.onPanelChange,xi=te.onCalendarChange,mi=te.onFocus,Xi=te.onBlur,Oi=te.onOk,Pi=te.components,vi=te.order,Ni=te.direction,ia=te.activePickerIndex,ui=te.autoComplete,di=ui===void 0?"off":ui,Ri=Ht==="date"&&!!Sn||Ht==="time",Ci=Object(m.useRef)({}),Oe=Object(m.useRef)(null),et=Object(m.useRef)(null),rt=Object(m.useRef)(null),Ie=Object(m.useRef)(null),de=Object(m.useRef)(null),Ee=Object(m.useRef)(null),pe=Object(m.useRef)(null),Ne=q(l(Kt,Ht,Sn,Tn)),Ke=Object(d.a)(0,{value:ia}),ot=Object(D.a)(Ke,2),He=ot[0],_t=ot[1],Ut=Object(m.useRef)(null),en=m.useMemo(function(){return Array.isArray(Dn)?Dn:[Dn||!1,Dn||!1]},[Dn]),hn=Object(d.a)(null,{value:Lt,defaultValue:At,postState:function(Un){return Ht==="time"&&!vi?Un:Gn(Un,it)}}),Rn=Object(D.a)(hn,2),Wn=Rn[0],lr=Rn[1],on=nr({values:Wn,picker:Ht,defaultDates:Et,generateConfig:it}),It=Object(D.a)(on,2),Jt=It[0],Pn=It[1],En=Object(d.a)(Wn,{postState:function(Un){var or=Un;if(en[0]&&en[1])return or;for(var Or=0;Or<2;Or+=1)en[Or]&&!se(or,Or)&&!se(cr,Or)&&(or=me(or,it.getNow(),Or));return or}}),vr=Object(D.a)(En,2),qn=vr[0],Tr=vr[1],ir=Object(d.a)([Ht,Ht],{value:Qn}),pn=Object(D.a)(ir,2),Mn=pn[0],gr=pn[1];Object(m.useEffect)(function(){gr([Ht,Ht])},[Ht]);var Rr=function(Un,or){gr(Un),li&&li(or,Un)},Jn=kn({picker:Ht,selectedValue:qn,locale:Qt,disabled:en,disabledDate:_n,generateConfig:it},Ci.current[1],Ci.current[0]),Mr=Object(D.a)(Jn,2),Yr=Mr[0],Lr=Mr[1],Br=Object(d.a)(!1,{value:mn,defaultValue:cn,postState:function(Un){return en[He]?!1:Un},onChange:function(Un){Jr&&Jr(Un),!Un&&Ut.current&&Ut.current.onClose&&Ut.current.onClose()}}),jr=Object(D.a)(Br,2),Ir=jr[0],kr=jr[1],fr=Ir&&He===0,si=Ir&&He===1,Qi=Object(m.useState)(0),ji=Object(D.a)(Qi,2),wi=ji[0],Zr=ji[1];Object(m.useEffect)(function(){!Ir&&Oe.current&&Zr(Oe.current.offsetWidth)},[Ir]);var Gr=m.useRef();function Xr(yr,Un){if(yr)clearTimeout(Gr.current),Ci.current[Un]=!0,_t(Un),kr(yr),Ir||Pn(null,Un);else if(He===Un){kr(yr);var or=Ci.current;Gr.current=setTimeout(function(){or===Ci.current&&(Ci.current={})})}}function qr(yr){Xr(!0,yr),setTimeout(function(){var Un=[Ee,pe][yr];Un.current&&Un.current.focus()},0)}function Ui(yr,Un){var or=yr,Or=se(or,0),ri=se(or,1);Or&&ri&&it.isAfter(Or,ri)&&(Ht==="week"&&!Bt(it,Qt.locale,Or,ri)||Ht==="quarter"&&!Xe(it,Or,ri)||Ht!=="week"&&Ht!=="quarter"&&Ht!=="time"&&!Rt(it,Or,ri)?(Un===0?(or=[Or,null],ri=null):(Or=null,or=[null,ri]),Ci.current=Object(R.a)({},Un,!0)):(Ht!=="time"||vi!==!1)&&(or=Gn(or,it))),Tr(or);var va=or&&or[0]?it.locale.format(Qt.locale,or[0],Ne[0]):"",aa=or&&or[1]?it.locale.format(Qt.locale,or[1],Ne[0]):"";if(xi){var Di={range:Un===0?"start":"end"};xi(or,[va,aa],Di)}var Yi=Hn(Or,0,en,cr),ga=Hn(ri,1,en,cr),Wa=or===null||Yi&&ga;Wa&&(lr(or),Wr&&(!Ve(it,se(Wn,0),Or)||!Ve(it,se(Wn,1),ri))&&Wr(or,[va,aa]));var Ti=null;Un===0&&!en[1]?Ti=1:Un===1&&!en[0]&&(Ti=0),Ti!==null&&Ti!==He&&(!Ci.current[Ti]||!se(or,Ti))&&se(or,Un)?qr(Ti):Xr(!1,Un)}var ha=function(Un){return Ir&&Ut.current&&Ut.current.onKeyDown?Ut.current.onKeyDown(Un):(Object(i.a)(!1,"Picker not correct forward KeyDown operation. Please help to fire issue about this."),!1)},sa={formatList:Ne,generateConfig:it,locale:Qt},Vr=xn(se(qn,0),sa),Ji=Object(D.a)(Vr,2),Zi=Ji[0],$r=Ji[1],zr=xn(se(qn,1),sa),yi=Object(D.a)(zr,2),Pa=yi[0],no=yi[1],la=function(Un,or){var Or=it.locale.parse(Qt.locale,Un,Ne),ri=or===0?Yr:Lr;Or&&!ri(Or)&&(Tr(me(qn,Or,or)),Pn(Or,or))},wa=tr({valueTexts:Zi,onTextChange:function(Un){return la(Un,0)}}),Ta=Object(D.a)(wa,3),Sa=Ta[0],ka=Ta[1],co=Ta[2],Ro=tr({valueTexts:Pa,onTextChange:function(Un){return la(Un,1)}}),Ga=Object(D.a)(Ro,3),Oa=Ga[0],Va=Ga[1],_a=Ga[2],Ra=Object(m.useState)(null),ho=Object(D.a)(Ra,2),Xa=ho[0],Aa=ho[1],Da=Object(m.useState)(null),ya=Object(D.a)(Da,2),ki=ya[0],fa=ya[1],pa=In(Sa,{formatList:Ne,generateConfig:it,locale:Qt}),ba=Object(D.a)(pa,3),ma=ba[0],Ya=ba[1],$a=ba[2],Qa=In(Oa,{formatList:Ne,generateConfig:it,locale:Qt}),Ia=Object(D.a)(Qa,3),ua=Ia[0],Ea=Ia[1],ro=Ia[2],Ao=function(Un){fa(me(qn,Un,He)),He===0?Ya(Un):Ea(Un)},Do=function(){fa(me(qn,null,He)),He===0?$a():ro()},fo=function(Un,or){return{blurToCancel:Ri,forwardKeyDown:ha,onBlur:Xi,isClickOutside:function(ri){return!z([et.current,rt.current,Ie.current],ri)},onFocus:function(ri){_t(Un),mi&&mi(ri)},triggerOpen:function(ri){Xr(ri,Un)},onSubmit:function(){Ui(qn,Un),or()},onCancel:function(){Xr(!1,Un),Tr(Wn),or()}}},io=sn(Object(O.a)(Object(O.a)({},fo(0,co)),{},{open:fr,value:Sa})),po=Object(D.a)(io,2),Wi=po[0],ci=po[1],Ai=ci.focused,hi=ci.typing,Na=sn(Object(O.a)(Object(O.a)({},fo(1,_a)),{},{open:si,value:Oa})),mo=Object(D.a)(Na,2),qi=mo[0],ao=mo[1],oo=ao.focused,so=ao.typing,xa=function(Un){!Ir&&!Ee.current.contains(Un.target)&&!pe.current.contains(Un.target)&&(en[0]?en[1]||qr(1):qr(0))},Ja=function(Un){Ir&&(Ai||oo)&&!Ee.current.contains(Un.target)&&!pe.current.contains(Un.target)&&Un.preventDefault()},ja=Wn&&Wn[0]?it.locale.format(Qt.locale,Wn[0],"YYYYMMDDHHmmss"):"",vo=Wn&&Wn[1]?it.locale.format(Qt.locale,Wn[1],"YYYYMMDDHHmmss"):"";Object(m.useEffect)(function(){Ir||(Tr(Wn),!Zi.length||Zi[0]===""?ka(""):$r!==Sa&&co(),!Pa.length||Pa[0]===""?Va(""):no!==Oa&&_a())},[Ir,Zi,Pa]),Object(m.useEffect)(function(){Tr(Wn)},[ja,vo]),Bn&&(Bn.current={focus:function(){Ee.current&&Ee.current.focus()},blur:function(){Ee.current&&Ee.current.blur(),pe.current&&pe.current.blur()}});var Za=Object.keys(rr||{}),Hr=Za.map(function(yr){var Un=rr[yr],or=typeof Un=="function"?Un():Un;return{label:yr,onClick:function(){Ui(or,null),Xr(!1,He)},onMouseEnter:function(){Aa(or)},onMouseLeave:function(){Aa(null)}}});function Ar(){var yr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Un=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},or=null;Ir&&ki&&ki[0]&&ki[1]&&it.isAfter(ki[1],ki[0])&&(or=ki);var Or=Sn;if(Sn&&Object(c.a)(Sn)==="object"&&Sn.defaultValue){var ri=Sn.defaultValue;Or=Object(O.a)(Object(O.a)({},Sn),{},{defaultValue:se(ri,He)||void 0})}var va=null;return rn&&(va=function(Di,Yi){return rn(Di,Yi,{range:He?"end":"start"})}),m.createElement(ut.Provider,{value:{inRange:!0,panelPosition:yr,rangedValue:Xa||qn,hoverRangedValue:or}},m.createElement(Z,Object.assign({},te,Un,{dateRender:va,showTime:Or,mode:Mn[He],generateConfig:it,style:void 0,direction:Ni,disabledDate:He===0?Yr:Lr,disabledTime:function(Di){return un?un(Di,He===0?"start":"end"):!1},className:b()(Object(R.a)({},"".concat(Je,"-panel-focused"),He===0?!hi:!so)),value:se(qn,He),locale:Qt,tabIndex:-1,onPanelChange:function(Di,Yi){Rr(me(Mn,Yi,He),me(qn,Di,He));var ga=Di;yr==="right"&&Mn[He]===Yi&&(ga=Le(ga,Yi,it,-1)),Pn(ga,He)},onOk:null,onSelect:void 0,onChange:void 0,defaultValue:void 0,defaultPickerValue:void 0})))}var ai=0,Fi=0;He&&rt.current&&de.current&&et.current&&(ai=rt.current.offsetWidth+de.current.offsetWidth,et.current.offsetWidth&&ai>et.current.offsetWidth&&(Fi=ai));var Ma=Ni==="rtl"?{right:ai}:{left:ai};function da(){var yr,Un=K(Je,Mn[He],Cr),or=Q({prefixCls:Je,components:Pi,needConfirmButton:Ri,okDisabled:!se(qn,He)||_n&&_n(qn[He]),locale:Qt,rangeList:Hr,onOk:function(){se(qn,He)&&(Ui(qn,He),Oi&&Oi(qn))}});if(Ht!=="time"&&!Sn){var Or=Jt(He),ri=Le(Or,Ht,it),va=Mn[He],aa=va===Ht,Di=Ar(aa?"left":!1,{pickerValue:Or,onPickerValueChange:function(Ti){Pn(Ti,He)}}),Yi=Ar("right",{pickerValue:ri,onPickerValueChange:function(Ti){Pn(Le(Ti,Ht,it,-1),He)}});Ni==="rtl"?yr=m.createElement(m.Fragment,null,Yi,aa&&Di):yr=m.createElement(m.Fragment,null,Di,aa&&Yi)}else yr=Ar();var ga=m.createElement(m.Fragment,null,m.createElement("div",{className:"".concat(Je,"-panels")},yr),(Un||or)&&m.createElement("div",{className:"".concat(Je,"-footer")},Un,or));return Cn&&(ga=Cn(ga)),m.createElement("div",{className:"".concat(Je,"-panel-container"),style:{marginLeft:Fi},ref:et,onMouseDown:function(Ti){Ti.preventDefault()}},ga)}var Ua=m.createElement("div",{className:b()("".concat(Je,"-range-wrapper"),"".concat(Je,"-").concat(Ht,"-range-wrapper")),style:{minWidth:wi}},m.createElement("div",{className:"".concat(Je,"-range-arrow"),style:Ma}),da()),ca;Dr&&(ca=m.createElement("span",{className:"".concat(Je,"-suffix")},Dr));var bi;zn&&(se(Wn,0)&&!en[0]||se(Wn,1)&&!en[1])&&(bi=m.createElement("span",{onMouseDown:function(Un){Un.preventDefault(),Un.stopPropagation()},onMouseUp:function(Un){Un.preventDefault(),Un.stopPropagation();var or=Wn;en[0]||(or=me(or,null,0)),en[1]||(or=me(or,null,1)),Ui(or,null),Xr(!1,He)},className:"".concat(Je,"-clear")},Kr||m.createElement("span",{className:"".concat(Je,"-clear-btn")})));var Fa={size:u(Ht,Ne[0])},Ba=0,Ha=0;rt.current&&Ie.current&&de.current&&(He===0?Ha=rt.current.offsetWidth:(Ba=ai,Ha=Ie.current.offsetWidth));var zi=Ni==="rtl"?{right:Ba}:{left:Ba},Ur=function(Un,or){var Or=me(qn,Un,He);or==="submit"||or!=="key"&&!Ri?(Ui(Or,He),He===0?$a():ro()):Tr(Or)};return m.createElement(s.Provider,{value:{operationRef:Ut,hideHeader:Ht==="time",onDateMouseEnter:Ao,onDateMouseLeave:Do,hideRanges:!0,onSelect:Ur,open:Ir}},m.createElement(Vn,{visible:Ir,popupElement:Ua,popupStyle:Mt,prefixCls:Je,dropdownClassName:Gt,dropdownAlign:wt,getPopupContainer:Nt,transitionName:Vt,range:!0,direction:Ni},m.createElement("div",Object.assign({ref:Oe,className:b()(Je,"".concat(Je,"-range"),at,(Te={},Object(R.a)(Te,"".concat(Je,"-disabled"),en[0]&&en[1]),Object(R.a)(Te,"".concat(Je,"-focused"),He===0?Ai:oo),Object(R.a)(Te,"".concat(Je,"-rtl"),Ni==="rtl"),Te)),style:ht,onClick:xa,onMouseDown:Ja},fe(te)),m.createElement("div",{className:b()("".concat(Je,"-input"),(Ge={},Object(R.a)(Ge,"".concat(Je,"-input-active"),He===0),Object(R.a)(Ge,"".concat(Je,"-input-placeholder"),!!ma),Ge)),ref:rt},m.createElement("input",Object.assign({id:ct,disabled:en[0],readOnly:Xn||!hi,value:ma||Sa,onChange:function(Un){ka(Un.target.value)},autoFocus:yn,placeholder:se(Wt,0)||"",ref:Ee},Wi,Fa,{autoComplete:di}))),m.createElement("div",{className:"".concat(Je,"-range-separator"),ref:de},bt),m.createElement("div",{className:b()("".concat(Je,"-input"),(Me={},Object(R.a)(Me,"".concat(Je,"-input-active"),He===1),Object(R.a)(Me,"".concat(Je,"-input-placeholder"),!!ua),Me)),ref:Ie},m.createElement("input",Object.assign({disabled:en[1],readOnly:Xn||!so,value:ua||Oa,onChange:function(Un){Va(Un.target.value)},placeholder:se(Wt,1)||"",ref:pe},qi,Fa,{autoComplete:di}))),m.createElement("div",{className:"".concat(Je,"-active-bar"),style:Object(O.a)(Object(O.a)({},zi),{},{width:Ha,position:"absolute"})}),ca,bi)))}var wr=function(te){Object(P.a)(Ge,te);var Te=Object(F.a)(Ge);function Ge(){var Me;return Object(Y.a)(this,Ge),Me=Te.apply(this,arguments),Me.pickerRef=m.createRef(),Me.focus=function(){Me.pickerRef.current&&Me.pickerRef.current.focus()},Me.blur=function(){Me.pickerRef.current&&Me.pickerRef.current.blur()},Me}return Object(H.a)(Ge,[{key:"render",value:function(){return m.createElement(Sr,Object.assign({},this.props,{pickerRef:this.pickerRef}))}}]),Ge}(m.Component),br=wr,Er=re.b=Zn},osHv:function(Ye,re,I){(function(Y){Y(I("VrN/"))})(function(Y){"use strict";var H=Y.Pos;function P(o,t){return o.line-t.line||o.ch-t.ch}var F="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",R=F+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",O=new RegExp("<(/?)(["+F+"]["+R+"]*)","g");function D(o,t,h,g){this.line=t,this.ch=h,this.cm=o,this.text=o.getLine(t),this.min=g?Math.max(g.from,o.firstLine()):o.firstLine(),this.max=g?Math.min(g.to-1,o.lastLine()):o.lastLine()}function m(o,t){var h=o.cm.getTokenTypeAt(H(o.line,t));return h&&/\btag\b/.test(h)}function T(o){return o.line>=o.max?void 0:(o.ch=0,o.text=o.cm.getLine(++o.line),!0)}function b(o){return o.line<=o.min?void 0:(o.text=o.cm.getLine(--o.line),o.ch=o.text.length,!0)}function i(o){for(;;){var t=o.text.indexOf(">",o.ch);if(t==-1){if(T(o))continue;return}if(!m(o,t+1)){o.ch=t+1;continue}var h=o.text.lastIndexOf("/",t),g=h>-1&&!/\S/.test(o.text.slice(h+1,t));return o.ch=t+1,g?"selfClose":"regular"}}function d(o){for(;;){var t=o.ch?o.text.lastIndexOf("<",o.ch-1):-1;if(t==-1){if(b(o))continue;return}if(!m(o,t+1)){o.ch=t;continue}O.lastIndex=t,o.ch=t;var h=O.exec(o.text);if(h&&h.index==t)return h}}function c(o){for(;;){O.lastIndex=o.ch;var t=O.exec(o.text);if(!t){if(T(o))continue;return}if(!m(o,t.index+1)){o.ch=t.index+1;continue}return o.ch=t.index+t[0].length,t}}function r(o){for(;;){var t=o.ch?o.text.lastIndexOf(">",o.ch-1):-1;if(t==-1){if(b(o))continue;return}if(!m(o,t+1)){o.ch=t;continue}var h=o.text.lastIndexOf("/",t),g=h>-1&&!/\S/.test(o.text.slice(h+1,t));return o.ch=t+1,g?"selfClose":"regular"}}function a(o,t){for(var h=[];;){var g=c(o),C,A=o.line,w=o.ch-(g?g[0].length:0);if(!g||!(C=i(o)))return;if(C=="selfClose")continue;if(g[1]){for(var M=h.length-1;M>=0;--M)if(h[M]==g[2]){h.length=M;break}if(M<0&&(!t||t==g[2]))return{tag:g[2],from:H(A,w),to:H(o.line,o.ch)}}else h.push(g[2])}}function s(o,t){for(var h=[];;){var g=r(o);if(!g)return;if(g=="selfClose"){d(o);continue}var C=o.line,A=o.ch,w=d(o);if(!w)return;if(w[1])h.push(w[2]);else{for(var M=h.length-1;M>=0;--M)if(h[M]==w[2]){h.length=M;break}if(M<0&&(!t||t==w[2]))return{tag:w[2],from:H(o.line,o.ch),to:H(C,A)}}}}Y.registerHelper("fold","xml",function(o,t){for(var h=new D(o,t.line,0);;){var g=c(h);if(!g||h.line!=t.line)return;var C=i(h);if(!C)return;if(!g[1]&&C!="selfClose"){var A=H(h.line,h.ch),w=a(h,g[2]);return w&&P(w.from,A)>0?{from:A,to:w.from}:null}}}),Y.findMatchingTag=function(o,t,h){var g=new D(o,t.line,t.ch,h);if(g.text.indexOf(">")==-1&&g.text.indexOf("<")==-1)return;var C=i(g),A=C&&H(g.line,g.ch),w=C&&d(g);if(!C||!w||P(g,t)>0)return;var M={from:H(g.line,g.ch),to:A,tag:w[2]};return C=="selfClose"?{open:M,close:null,at:"open"}:w[1]?{open:s(g,w[2]),close:M,at:"close"}:(g=new D(o,A.line,A.ch,h),{open:M,close:a(g,w[2]),at:"open"})},Y.findEnclosingTag=function(o,t,h,g){for(var C=new D(o,t.line,t.ch,h);;){var A=s(C,g);if(!A)break;var w=new D(o,t.line,t.ch,h),M=a(w,A.tag);if(M)return{open:A,close:M}}},Y.scanForClosingTag=function(o,t,h,g){var C=new D(o,t.line,t.ch,g?{from:0,to:g}:null);return a(C,h)}})},p5ED:function(Ye,re,I){"use strict";var Y=I("+L6B"),H=I("2/Rp"),P=I("5Dmo"),F=I("3S7+"),R=I("k1fw"),O=I("tJVT"),D=I("q1tI"),m=I.n(D),T=I("vHTk"),b=I.n(T),i=I("yEEn"),d=I("ZW9T"),c=I("1vsH");re.a=function(r){var a=r.name,s=r.data,o=r.theme,t=r.type,h=r.filename,g=r.monacoEditor,C=r.className,A=r.style,w=r.close,M=r.onClose,E=r.hasMask,p=Object(D.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),l=Object(O.a)(p,2),u=l[0],f=l[1],_=Object(D.useState)(""),y=Object(O.a)(_,2),v=y[0],N=y[1],j,U=1024*1024,G=10*U,z=Object(D.useRef)();t==="office"&&(j=Object(c.T)(s).filesize,j>G&&(t="other")),h&&(g.filename=h),Object(D.useEffect)(function(){var W,$,q=(W=document.cookie)===null||W===void 0||(($=W.replace(/\s/g,""))===null||$===void 0)?void 0:$.split(";");q==null||q.map(function(fe){var se=fe.split("=");se[0]==="_educoder_session"&&N(se[1])})},[]);var L=function(){if(s.startsWith("http")||s.startsWith("/")){V();return}Object(c.z)(h||"educoder",s,h)},V=function(){Object(c.x)(h||a,s)};return console.log("data:",s,"fileanme:",h," name:",a),m.a.createElement("div",{style:Object(R.a)({},A||{}),className:"".concat(E&&b.a.bgBlack," ").concat(t?b.a.wrp:"hide")},w&&m.a.createElement("div",{className:b.a.close,ref:z},m.a.createElement(F.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return z.current}},m.a.createElement("span",{onClick:V},m.a.createElement("i",{className:"icon-quxiaozhiding"}))),m.a.createElement(F.a,{title:"\u5173\u95ED",getPopupContainer:function(){return z.current}},m.a.createElement("span",{className:"",onClick:M},m.a.createElement("i",{className:"icon-guanbi1"})))),m.a.createElement("div",{className:"".concat(b.a[C]," ").concat(C," ").concat(b.a.monaco," ").concat(t==="txt"?"show":"hide")},t==="txt"&&m.a.createElement(d.b,g)),t==="audio"&&m.a.createElement("audio",{src:"".concat(s!=null&&s.startsWith("/")||(s==null?void 0:s.indexOf("https://"))>-1?s:"data:audio/mp3;base64,").concat(s),autoPlay:!0}),t==="video"&&m.a.createElement(m.a.Fragment,null,s!=null&&s.startsWith("/")?m.a.createElement("video",{controls:!0,src:"".concat(s),autoPlay:!0}):m.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(s),autoPlay:!0})),t==="html"&&m.a.createElement("iframe",{src:s+"&disposition=inline"}),t==="pdf"&&m.a.createElement("embed",{className:b.a.embed,src:s}),t==="image"&&m.a.createElement(m.a.Fragment,null,m.a.createElement("img",{src:"".concat(s!=null&&s.startsWith("/")||(s==null?void 0:s.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(s)})),t==="other"&&m.a.createElement("div",null,m.a.createElement(H.a,{type:"primary",size:"large",onClick:L},m.a.createElement(i.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(t==="download"||t==="office")&&m.a.createElement(H.a,{type:"primary",size:"large",onClick:L},m.a.createElement(i.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Ye,re,I){},psGv:function(Ye,re,I){var Y,H;(function(){var P;(function(){"use strict";var D=[,,function(i){function d(a){this.__parent=a,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 a=new d(this.__parent);return a.set_indent(this.__indent_count,this.__alignment_count),a},d.prototype.item=function(a){return a<0?this.__items[this.__items.length+a]:this.__items[a]},d.prototype.has_match=function(a){for(var s=this.__items.length-1;s>=0;s--)if(this.__items[s].match(a))return!0;return!1},d.prototype.set_indent=function(a,s){this.is_empty()&&(this.__indent_count=a||0,this.__alignment_count=s||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 a=this.__parent.current_line;return a.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),a.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),a.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,a.__items[0]===" "&&(a.__items.splice(0,1),a.__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(a){this.__items.push(a);var s=a.lastIndexOf(`
|
|
`);s!==-1?this.__character_count=a.length-s:this.__character_count+=a.length},d.prototype.pop=function(){var a=null;return this.is_empty()||(a=this.__items.pop(),this.__character_count-=a.length),a},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 a="";return this.is_empty()?this.__parent.indent_empty_lines&&(a=this.__parent.get_indent_string(this.__indent_count)):(a=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),a+=this.__items.join("")),a};function c(a,s){this.__cache=[""],this.__indent_size=a.indent_size,this.__indent_string=a.indent_char,a.indent_with_tabs||(this.__indent_string=new Array(a.indent_size+1).join(a.indent_char)),s=s||"",a.indent_level>0&&(s=new Array(a.indent_level+1).join(this.__indent_string)),this.__base_string=s,this.__base_string_length=s.length}c.prototype.get_indent_size=function(a,s){var o=this.__base_string_length;return s=s||0,a<0&&(o=0),o+=a*this.__indent_size,o+=s,o},c.prototype.get_indent_string=function(a,s){var o=this.__base_string;return s=s||0,a<0&&(a=0,o=""),s+=a*this.__indent_size,this.__ensure_cache(s),o+=this.__cache[s],o},c.prototype.__ensure_cache=function(a){for(;a>=this.__cache.length;)this.__add_column()},c.prototype.__add_column=function(){var a=this.__cache.length,s=0,o="";this.__indent_size&&a>=this.__indent_size&&(s=Math.floor(a/this.__indent_size),a-=s*this.__indent_size,o=new Array(s+1).join(this.__indent_string)),a&&(o+=new Array(a+1).join(" ")),this.__cache.push(o)};function r(a,s){this.__indent_cache=new c(a,s),this.raw=!1,this._end_with_newline=a.end_with_newline,this.indent_size=a.indent_size,this.wrap_line_length=a.wrap_line_length,this.indent_empty_lines=a.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()}r.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},r.prototype.get_line_number=function(){return this.__lines.length},r.prototype.get_indent_string=function(a,s){return this.__indent_cache.get_indent_string(a,s)},r.prototype.get_indent_size=function(a,s){return this.__indent_cache.get_indent_size(a,s)},r.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},r.prototype.add_new_line=function(a){return this.is_empty()||!a&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},r.prototype.get_code=function(a){this.trim(!0);var s=this.current_line.pop();s&&(s[s.length-1]===`
|
|
`&&(s=s.replace(/\n+$/g,"")),this.current_line.push(s)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
|
|
`);return a!==`
|
|
`&&(o=o.replace(/[\n]/g,a)),o},r.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},r.prototype.set_indent=function(a,s){return a=a||0,s=s||0,this.next_line.set_indent(a,s),this.__lines.length>1?(this.current_line.set_indent(a,s),!0):(this.current_line.set_indent(),!1)},r.prototype.add_raw_token=function(a){for(var s=0;s<a.newlines;s++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(a.whitespace_before),this.current_line.push(a.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},r.prototype.add_token=function(a){this.__add_space_before_token(),this.current_line.push(a),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},r.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},r.prototype.remove_indent=function(a){for(var s=this.__lines.length;a<s;)this.__lines[a]._remove_indent(),a++;this.current_line._remove_wrap_indent()},r.prototype.trim=function(a){for(a=a===void 0?!1:a,this.current_line.trim();a&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},r.prototype.just_added_newline=function(){return this.current_line.is_empty()},r.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},r.prototype.ensure_empty_line_above=function(a,s){for(var o=this.__lines.length-2;o>=0;){var t=this.__lines[o];if(t.is_empty())break;if(t.item(0).indexOf(a)!==0&&t.item(-1)!==s){this.__lines.splice(o+1,0,new d(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},i.exports.Output=r},function(i){function d(c,r,a,s){this.type=c,this.text=r,this.comments_before=null,this.newlines=a||0,this.whitespace_before=s||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}i.exports.Token=d},,,function(i){function d(a,s){this.raw_options=c(a,s),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}d.prototype._get_array=function(a,s){var o=this.raw_options[a],t=s||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(t=o.concat()):typeof o=="string"&&(t=o.split(/[^a-zA-Z0-9_\/\-]+/)),t},d.prototype._get_boolean=function(a,s){var o=this.raw_options[a],t=o===void 0?!!s:!!o;return t},d.prototype._get_characters=function(a,s){var o=this.raw_options[a],t=s||"";return typeof o=="string"&&(t=o.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),t},d.prototype._get_number=function(a,s){var o=this.raw_options[a];s=parseInt(s,10),isNaN(s)&&(s=0);var t=parseInt(o,10);return isNaN(t)&&(t=s),t},d.prototype._get_selection=function(a,s,o){var t=this._get_selection_list(a,s,o);if(t.length!==1)throw new Error("Invalid Option Value: The option '"+a+`' can only be one of the following values:
|
|
`+s+`
|
|
You passed in: '`+this.raw_options[a]+"'");return t[0]},d.prototype._get_selection_list=function(a,s,o){if(!s||s.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[s[0]],!this._is_valid_selection(o,s))throw new Error("Invalid Default Value!");var t=this._get_array(a,o);if(!this._is_valid_selection(t,s))throw new Error("Invalid Option Value: The option '"+a+`' can contain only the following values:
|
|
`+s+`
|
|
You passed in: '`+this.raw_options[a]+"'");return t},d.prototype._is_valid_selection=function(a,s){return a.length&&s.length&&!a.some(function(o){return s.indexOf(o)===-1})};function c(a,s){var o={};a=r(a);var t;for(t in a)t!==s&&(o[t]=a[t]);if(s&&a[s])for(t in a[s])o[t]=a[s][t];return o}function r(a){var s={},o;for(o in a){var t=o.replace(/-/g,"_");s[t]=a[o]}return s}i.exports.Options=d,i.exports.normalizeOpts=r,i.exports.mergeOpts=c},,function(i){var d=RegExp.prototype.hasOwnProperty("sticky");function c(r){this.__input=r||"",this.__input_length=this.__input.length,this.__position=0}c.prototype.restart=function(){this.__position=0},c.prototype.back=function(){this.__position>0&&(this.__position-=1)},c.prototype.hasNext=function(){return this.__position<this.__input_length},c.prototype.next=function(){var r=null;return this.hasNext()&&(r=this.__input.charAt(this.__position),this.__position+=1),r},c.prototype.peek=function(r){var a=null;return r=r||0,r+=this.__position,r>=0&&r<this.__input_length&&(a=this.__input.charAt(r)),a},c.prototype.__match=function(r,a){r.lastIndex=a;var s=r.exec(this.__input);return s&&!(d&&r.sticky)&&(s.index!==a&&(s=null)),s},c.prototype.test=function(r,a){return a=a||0,a+=this.__position,a>=0&&a<this.__input_length?!!this.__match(r,a):!1},c.prototype.testChar=function(r,a){var s=this.peek(a);return r.lastIndex=0,s!==null&&r.test(s)},c.prototype.match=function(r){var a=this.__match(r,this.__position);return a?this.__position+=a[0].length:a=null,a},c.prototype.read=function(r,a,s){var o="",t;return r&&(t=this.match(r),t&&(o+=t[0])),a&&(t||!r)&&(o+=this.readUntil(a,s)),o},c.prototype.readUntil=function(r,a){var s="",o=this.__position;r.lastIndex=this.__position;var t=r.exec(this.__input);return t?(o=t.index,a&&(o+=t[0].length)):o=this.__input_length,s=this.__input.substring(this.__position,o),this.__position=o,s},c.prototype.readUntilAfter=function(r){return this.readUntil(r,!0)},c.prototype.get_regexp=function(r,a){var s=null,o="g";return a&&d&&(o="y"),typeof r=="string"&&r!==""?s=new RegExp(r,o):r&&(s=new RegExp(r.source,o)),s},c.prototype.get_literal_regexp=function(r){return RegExp(r.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},c.prototype.peekUntilAfter=function(r){var a=this.__position,s=this.readUntilAfter(r);return this.__position=a,s},c.prototype.lookBack=function(r){var a=this.__position-1;return a>=r.length&&this.__input.substring(a-r.length,a).toLowerCase()===r},i.exports.InputScanner=c},function(i,d,c){var r=c(8).InputScanner,a=c(3).Token,s=c(10).TokenStream,o=c(11).WhitespacePattern,t={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},h=function(g,C){this._input=new r(g),this._options=C||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};h.prototype.tokenize=function(){this._input.restart(),this.__tokens=new s,this._reset();for(var g,C=new a(t.START,""),A=null,w=[],M=new s;C.type!==t.EOF;){for(g=this._get_next_token(C,A);this._is_comment(g);)M.add(g),g=this._get_next_token(C,A);M.isEmpty()||(g.comments_before=M,M=new s),g.parent=A,this._is_opening(g)?(w.push(A),A=g):A&&this._is_closing(g,A)&&(g.opened=A,A.closed=g,A=w.pop(),g.parent=A),g.previous=C,C.next=g,this.__tokens.add(g),C=g}return this.__tokens},h.prototype._is_first_token=function(){return this.__tokens.isEmpty()},h.prototype._reset=function(){},h.prototype._get_next_token=function(g,C){this._readWhitespace();var A=this._input.read(/.+/g);return A?this._create_token(t.RAW,A):this._create_token(t.EOF,"")},h.prototype._is_comment=function(g){return!1},h.prototype._is_opening=function(g){return!1},h.prototype._is_closing=function(g,C){return!1},h.prototype._create_token=function(g,C){var A=new a(g,C,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return A},h.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},i.exports.Tokenizer=h,i.exports.TOKEN=t},function(i){function d(c){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=c}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 c=null;return this.hasNext()&&(c=this.__tokens[this.__position],this.__position+=1),c},d.prototype.peek=function(c){var r=null;return c=c||0,c+=this.__position,c>=0&&c<this.__tokens_length&&(r=this.__tokens[c]),r},d.prototype.add=function(c){this.__parent_token&&(c.parent=this.__parent_token),this.__tokens.push(c),this.__tokens_length+=1},i.exports.TokenStream=d},function(i,d,c){var r=c(12).Pattern;function a(s,o){r.call(this,s,o),o?this._line_regexp=this._input.get_regexp(o._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}a.prototype=new r,a.prototype.__set_whitespace_patterns=function(s,o){s+="\\t ",o+="\\n\\r",this._match_pattern=this._input.get_regexp("["+s+o+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+o+"]")},a.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var s=this._input.read(this._match_pattern);if(s===" ")this.whitespace_before_token=" ";else if(s){var o=this.__split(this._newline_regexp,s);this.newline_count=o.length-1,this.whitespace_before_token=o[this.newline_count]}return s},a.prototype.matching=function(s,o){var t=this._create();return t.__set_whitespace_patterns(s,o),t._update(),t},a.prototype._create=function(){return new a(this._input,this)},a.prototype.__split=function(s,o){s.lastIndex=0;for(var t=0,h=[],g=s.exec(o);g;)h.push(o.substring(t,g.index)),t=g.index+g[0].length,g=s.exec(o);return t<o.length?h.push(o.substring(t,o.length)):h.push(""),h},i.exports.WhitespacePattern=a},function(i){function d(c,r){this._input=c,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,r&&(this._starting_pattern=this._input.get_regexp(r._starting_pattern,!0),this._match_pattern=this._input.get_regexp(r._match_pattern,!0),this._until_pattern=this._input.get_regexp(r._until_pattern),this._until_after=r._until_after)}d.prototype.read=function(){var c=this._input.read(this._starting_pattern);return(!this._starting_pattern||c)&&(c+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),c},d.prototype.read_match=function(){return this._input.match(this._match_pattern)},d.prototype.until_after=function(c){var r=this._create();return r._until_after=!0,r._until_pattern=this._input.get_regexp(c),r._update(),r},d.prototype.until=function(c){var r=this._create();return r._until_after=!1,r._until_pattern=this._input.get_regexp(c),r._update(),r},d.prototype.starting_with=function(c){var r=this._create();return r._starting_pattern=this._input.get_regexp(c,!0),r._update(),r},d.prototype.matching=function(c){var r=this._create();return r._match_pattern=this._input.get_regexp(c,!0),r._update(),r},d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){},i.exports.Pattern=d},function(i){function d(c,r){c=typeof c=="string"?c:c.source,r=typeof r=="string"?r:r.source,this.__directives_block_pattern=new RegExp(c+/ beautify( \w+[:]\w+)+ /.source+r,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(c+/\sbeautify\signore:end\s/.source+r,"g")}d.prototype.get_directives=function(c){if(!c.match(this.__directives_block_pattern))return null;var r={};this.__directive_pattern.lastIndex=0;for(var a=this.__directive_pattern.exec(c);a;)r[a[1]]=a[2],a=this.__directive_pattern.exec(c);return r},d.prototype.readIgnored=function(c){return c.readUntilAfter(this.__directives_end_ignore_pattern)},i.exports.Directives=d},function(i,d,c){var r=c(12).Pattern,a={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function s(o,t){r.call(this,o,t),this.__template_pattern=null,this._disabled=Object.assign({},a),this._excluded=Object.assign({},a),t&&(this.__template_pattern=this._input.get_regexp(t.__template_pattern),this._excluded=Object.assign(this._excluded,t._excluded),this._disabled=Object.assign(this._disabled,t._disabled));var h=new r(o);this.__patterns={handlebars_comment:h.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:h.starting_with(/{{{/).until_after(/}}}/),handlebars:h.starting_with(/{{/).until_after(/}}/),php:h.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:h.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:h.starting_with(/{%/).until_after(/%}/),django_value:h.starting_with(/{{/).until_after(/}}/),django_comment:h.starting_with(/{#/).until_after(/#}/),smarty:h.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:h.starting_with(/{\*/).until_after(/\*}/),smarty_literal:h.starting_with(/{literal}/).until_after(/{\/literal}/)}}s.prototype=new r,s.prototype._create=function(){return new s(this._input,this)},s.prototype._update=function(){this.__set_templated_pattern()},s.prototype.disable=function(o){var t=this._create();return t._disabled[o]=!0,t._update(),t},s.prototype.read_options=function(o){var t=this._create();for(var h in a)t._disabled[h]=o.templating.indexOf(h)===-1;return t._update(),t},s.prototype.exclude=function(o){var t=this._create();return t._excluded[o]=!0,t._update(),t},s.prototype.read=function(){var o="";this._match_pattern?o=this._input.read(this._starting_pattern):o=this._input.read(this._starting_pattern,this.__template_pattern);for(var t=this._read_template();t;)this._match_pattern?t+=this._input.read(this._match_pattern):t+=this._input.readUntil(this.__template_pattern),o+=t,t=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},s.prototype.__set_templated_pattern=function(){var o=[];this._disabled.php||o.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||o.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||o.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(o.push(this.__patterns.django._starting_pattern.source),o.push(this.__patterns.django_value._starting_pattern.source),o.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||o.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&o.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+o.join("|")+")")},s.prototype._read_template=function(){var o="",t=this._input.peek();if(t==="<"){var h=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&h==="?"&&(o=o||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&h==="%"&&(o=o||this.__patterns.erb.read())}else t==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(o=o||this.__patterns.handlebars_comment.read(),o=o||this.__patterns.handlebars_unescaped.read(),o=o||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(o=o||this.__patterns.django_value.read()),this._excluded.django||(o=o||this.__patterns.django_comment.read(),o=o||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(o=o||this.__patterns.smarty_comment.read(),o=o||this.__patterns.smarty_literal.read(),o=o||this.__patterns.smarty.read()));return o},i.exports.TemplatablePattern=s},,,,function(i,d,c){var r=c(19).Beautifier,a=c(20).Options;function s(o,t,h,g){var C=new r(o,t,h,g);return C.beautify()}i.exports=s,i.exports.defaultOptions=function(){return new a}},function(i,d,c){var r=c(20).Options,a=c(2).Output,s=c(21).Tokenizer,o=c(21).TOKEN,t=/\r\n|[\r\n]/,h=/\r\n|[\r\n]/g,g=function(_,y){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=_.max_preserve_newlines,this.preserve_newlines=_.preserve_newlines,this._output=new a(_,y)};g.prototype.current_line_has_match=function(_){return this._output.current_line.has_match(_)},g.prototype.set_space_before_token=function(_,y){this._output.space_before_token=_,this._output.non_breaking_space=y},g.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},g.prototype.add_raw_token=function(_){this._output.add_raw_token(_)},g.prototype.print_preserved_newlines=function(_){var y=0;_.type!==o.TEXT&&_.previous.type!==o.TEXT&&(y=_.newlines?1:0),this.preserve_newlines&&(y=_.newlines<this.max_preserve_newlines+1?_.newlines:this.max_preserve_newlines+1);for(var v=0;v<y;v++)this.print_newline(v>0);return y!==0},g.prototype.traverse_whitespace=function(_){return _.whitespace_before||_.newlines?(this.print_preserved_newlines(_)||(this._output.space_before_token=!0),!0):!1},g.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},g.prototype.print_newline=function(_){this._output.add_new_line(_)},g.prototype.print_token=function(_){_.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(_.text))},g.prototype.indent=function(){this.indent_level++},g.prototype.get_full_indent=function(_){return _=this.indent_level+(_||0),_<1?"":this._output.get_indent_string(_)};var C=function(_){for(var y=null,v=_.next;v.type!==o.EOF&&_.closed!==v;){if(v.type===o.ATTRIBUTE&&v.text==="type"){v.next&&v.next.type===o.EQUALS&&v.next.next&&v.next.next.type===o.VALUE&&(y=v.next.next.text);break}v=v.next}return y},A=function(_,y){var v=null,N=null;return y.closed?(_==="script"?v="text/javascript":_==="style"&&(v="text/css"),v=C(y)||v,v.search("text/css")>-1?N="css":v.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?N="javascript":v.search(/(text|application|dojo)\/(x-)?(html)/)>-1?N="html":v.search(/test\/null/)>-1&&(N="null"),N):null};function w(_,y){return y.indexOf(_)!==-1}function M(_,y,v){this.parent=_||null,this.tag=y?y.tag_name:"",this.indent_level=v||0,this.parser_token=y||null}function E(_){this._printer=_,this._current_frame=null}E.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},E.prototype.record_tag=function(_){var y=new M(this._current_frame,_,this._printer.indent_level);this._current_frame=y},E.prototype._try_pop_frame=function(_){var y=null;return _&&(y=_.parser_token,this._printer.indent_level=_.indent_level,this._current_frame=_.parent),y},E.prototype._get_frame=function(_,y){for(var v=this._current_frame;v&&!(_.indexOf(v.tag)!==-1);){if(y&&y.indexOf(v.tag)!==-1){v=null;break}v=v.parent}return v},E.prototype.try_pop=function(_,y){var v=this._get_frame([_],y);return this._try_pop_frame(v)},E.prototype.indent_to_tag=function(_){var y=this._get_frame(_);y&&(this._printer.indent_level=y.indent_level)};function p(_,y,v,N){this._source_text=_||"",y=y||{},this._js_beautify=v,this._css_beautify=N,this._tag_stack=null;var j=new r(y,"html");this._options=j,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}p.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var _=this._source_text,y=this._options.eol;this._options.eol==="auto"&&(y=`
|
|
`,_&&t.test(_)&&(y=_.match(t)[0])),_=_.replace(h,`
|
|
`);var v=_.match(/^[\t ]*/)[0],N={text:"",type:""},j=new l,U=new g(this._options,v),G=new s(_,this._options).tokenize();this._tag_stack=new E(U);for(var z=null,L=G.next();L.type!==o.EOF;)L.type===o.TAG_OPEN||L.type===o.COMMENT?(z=this._handle_tag_open(U,L,j,N),j=z):L.type===o.ATTRIBUTE||L.type===o.EQUALS||L.type===o.VALUE||L.type===o.TEXT&&!j.tag_complete?z=this._handle_inside_tag(U,L,j,G):L.type===o.TAG_CLOSE?z=this._handle_tag_close(U,L,j):L.type===o.TEXT?z=this._handle_text(U,L,j):U.add_raw_token(L),N=z,L=G.next();var V=U._output.get_code(y);return V},p.prototype._handle_tag_close=function(_,y,v){var N={text:y.text,type:y.type};return _.alignment_size=0,v.tag_complete=!0,_.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),v.is_unformatted?_.add_raw_token(y):(v.tag_start_char==="<"&&(_.set_space_before_token(y.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&v.has_wrapped_attrs&&_.print_newline(!1)),_.print_token(y)),v.indent_content&&!(v.is_unformatted||v.is_content_unformatted)&&(_.indent(),v.indent_content=!1),!v.is_inline_element&&!(v.is_unformatted||v.is_content_unformatted)&&_.set_wrap_point(),N},p.prototype._handle_inside_tag=function(_,y,v,N){var j=v.has_wrapped_attrs,U={text:y.text,type:y.type};if(_.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),v.is_unformatted)_.add_raw_token(y);else if(v.tag_start_char==="{"&&y.type===o.TEXT)_.print_preserved_newlines(y)?(y.newlines=0,_.add_raw_token(y)):_.print_token(y);else{if(y.type===o.ATTRIBUTE?(_.set_space_before_token(!0),v.attr_count+=1):(y.type===o.EQUALS||y.type===o.VALUE&&y.previous.type===o.EQUALS)&&_.set_space_before_token(!1),y.type===o.ATTRIBUTE&&v.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(_.traverse_whitespace(y),j=j||y.newlines!==0),this._is_wrap_attributes_force)){var G=v.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&v.attr_count===1){var z=!0,L=0,V;do{if(V=N.peek(L),V.type===o.ATTRIBUTE){z=!1;break}L+=1}while(L<4&&V.type!==o.EOF&&V.type!==o.TAG_CLOSE);G=!z}G&&(_.print_newline(!1),j=!0)}_.print_token(y),j=j||_.previous_token_wrapped(),v.has_wrapped_attrs=j}return U},p.prototype._handle_text=function(_,y,v){var N={text:y.text,type:"TK_CONTENT"};return v.custom_beautifier_name?this._print_custom_beatifier_text(_,y,v):v.is_unformatted||v.is_content_unformatted?_.add_raw_token(y):(_.traverse_whitespace(y),_.print_token(y)),N},p.prototype._print_custom_beatifier_text=function(_,y,v){var N=this;if(y.text!==""){var j=y.text,U,G=1,z="",L="";v.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?U=this._js_beautify:v.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?U=this._css_beautify:v.custom_beautifier_name==="html"&&(U=function(se,me){var ve=new p(se,me,N._js_beautify,N._css_beautify);return ve.beautify()}),this._options.indent_scripts==="keep"?G=0:this._options.indent_scripts==="separate"&&(G=-_.indent_level);var V=_.get_full_indent(G);if(j=j.replace(/\n[ \t]*$/,""),v.custom_beautifier_name!=="html"&&j[0]==="<"&&j.match(/^(<!--|<!\[CDATA\[)/)){var W=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(j);if(!W){_.add_raw_token(y);return}z=V+W[1]+`
|
|
`,j=W[4],W[5]&&(L=V+W[5]),j=j.replace(/\n[ \t]*$/,""),(W[2]||W[3].indexOf(`
|
|
`)!==-1)&&(W=W[3].match(/[ \t]+$/),W&&(y.whitespace_before=W[0]))}if(j)if(U){var $=function(){this.eol=`
|
|
`};$.prototype=this._options.raw_options;var q=new $;j=U(V+j,q)}else{var fe=y.whitespace_before;fe&&(j=j.replace(new RegExp(`
|
|
(`+fe+")?","g"),`
|
|
`)),j=V+j.replace(/\n/g,`
|
|
`+V)}z&&(j?j=z+j+`
|
|
`+L:j=z+L),_.print_newline(!1),j&&(y.text=j,y.whitespace_before="",y.newlines=0,_.add_raw_token(y),_.print_newline(!0))}},p.prototype._handle_tag_open=function(_,y,v,N){var j=this._get_tag_open_token(y);return(v.is_unformatted||v.is_content_unformatted)&&!v.is_empty_element&&y.type===o.TAG_OPEN&&y.text.indexOf("</")===0?(_.add_raw_token(y),j.start_tag_token=this._tag_stack.try_pop(j.tag_name)):(_.traverse_whitespace(y),this._set_tag_position(_,y,j,v,N),j.is_inline_element||_.set_wrap_point(),_.print_token(y)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(j.alignment_size=y.text.length+1),!j.tag_complete&&!j.is_unformatted&&(_.alignment_size=j.alignment_size),j};var l=function(_,y){if(this.parent=_||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="",!y)this.tag_complete=!0;else{var v;this.tag_start_char=y.text[0],this.text=y.text,this.tag_start_char==="<"?(v=y.text.match(/^<([^\s>]*)/),this.tag_check=v?v[1]:""):(v=y.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=v?v[1]:"",(y.text.startsWith("{{#>")||y.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&y.next!==null?this.tag_check=y.next.text.split(" ")[0]:this.tag_check=y.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),y.type===o.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||y.closed&&y.closed.text==="/>";var N=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(N=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(N)))}};p.prototype._get_tag_open_token=function(_){var y=new l(this._tag_stack.get_parser_token(),_);return y.alignment_size=this._options.wrap_attributes_indent_size,y.is_end_tag=y.is_end_tag||w(y.tag_check,this._options.void_elements),y.is_empty_element=y.tag_complete||y.is_start_tag&&y.is_end_tag,y.is_unformatted=!y.tag_complete&&w(y.tag_check,this._options.unformatted),y.is_content_unformatted=!y.is_empty_element&&w(y.tag_check,this._options.content_unformatted),y.is_inline_element=w(y.tag_name,this._options.inline)||y.tag_name.includes("-")||y.tag_start_char==="{",y},p.prototype._set_tag_position=function(_,y,v,N,j){if(v.is_empty_element||(v.is_end_tag?v.start_tag_token=this._tag_stack.try_pop(v.tag_name):(this._do_optional_end_element(v)&&(v.is_inline_element||_.print_newline(!1)),this._tag_stack.record_tag(v),(v.tag_name==="script"||v.tag_name==="style")&&!(v.is_unformatted||v.is_content_unformatted)&&(v.custom_beautifier_name=A(v.tag_check,y)))),w(v.tag_check,this._options.extra_liners)&&(_.print_newline(!1),_._output.just_added_blankline()||_.print_newline(!0)),v.is_empty_element){if(v.tag_start_char==="{"&&v.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),v.indent_content=!0;var U=_.current_line_has_match(/{{#if/);U||_.print_newline(!1)}v.tag_name==="!--"&&j.type===o.TAG_CLOSE&&N.is_end_tag&&v.text.indexOf(`
|
|
`)===-1||(v.is_inline_element||v.is_unformatted||_.print_newline(!1),this._calcluate_parent_multiline(_,v))}else if(v.is_end_tag){var G=!1;G=v.start_tag_token&&v.start_tag_token.multiline_content,G=G||!v.is_inline_element&&!(N.is_inline_element||N.is_unformatted)&&!(j.type===o.TAG_CLOSE&&v.start_tag_token===N)&&j.type!=="TK_CONTENT",(v.is_content_unformatted||v.is_unformatted)&&(G=!1),G&&_.print_newline(!1)}else v.indent_content=!v.custom_beautifier_name,v.tag_start_char==="<"&&(v.tag_name==="html"?v.indent_content=this._options.indent_inner_html:v.tag_name==="head"?v.indent_content=this._options.indent_head_inner_html:v.tag_name==="body"&&(v.indent_content=this._options.indent_body_inner_html)),!(v.is_inline_element||v.is_unformatted)&&(j.type!=="TK_CONTENT"||v.is_content_unformatted)&&_.print_newline(!1),this._calcluate_parent_multiline(_,v)},p.prototype._calcluate_parent_multiline=function(_,y){y.parent&&_._output.just_added_newline()&&!((y.is_inline_element||y.is_unformatted)&&y.parent.is_inline_element)&&(y.parent.multiline_content=!0)};var u=["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"],f=["a","audio","del","ins","map","noscript","video"];p.prototype._do_optional_end_element=function(_){var y=null;if(_.is_empty_element||!_.is_start_tag||!_.parent)return;if(_.tag_name==="body")y=y||this._tag_stack.try_pop("head");else if(_.tag_name==="li")y=y||this._tag_stack.try_pop("li",["ol","ul"]);else if(_.tag_name==="dd"||_.tag_name==="dt")y=y||this._tag_stack.try_pop("dt",["dl"]),y=y||this._tag_stack.try_pop("dd",["dl"]);else if(_.parent.tag_name==="p"&&u.indexOf(_.tag_name)!==-1){var v=_.parent.parent;(!v||f.indexOf(v.tag_name)===-1)&&(y=y||this._tag_stack.try_pop("p"))}else _.tag_name==="rp"||_.tag_name==="rt"?(y=y||this._tag_stack.try_pop("rt",["ruby","rtc"]),y=y||this._tag_stack.try_pop("rp",["ruby","rtc"])):_.tag_name==="optgroup"?y=y||this._tag_stack.try_pop("optgroup",["select"]):_.tag_name==="option"?y=y||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):_.tag_name==="colgroup"?y=y||this._tag_stack.try_pop("caption",["table"]):_.tag_name==="thead"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"])):_.tag_name==="tbody"||_.tag_name==="tfoot"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"]),y=y||this._tag_stack.try_pop("thead",["table"]),y=y||this._tag_stack.try_pop("tbody",["table"])):_.tag_name==="tr"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"]),y=y||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(_.tag_name==="th"||_.tag_name==="td")&&(y=y||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),y=y||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return _.parent=this._tag_stack.get_parser_token(),y},i.exports.Beautifier=p},function(i,d,c){var r=c(6).Options;function a(s){r.call(this,s,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}a.prototype=new r,i.exports.Options=a},function(i,d,c){var r=c(9).Tokenizer,a=c(9).TOKEN,s=c(13).Directives,o=c(14).TemplatablePattern,t=c(12).Pattern,h={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:a.START,RAW:a.RAW,EOF:a.EOF},g=new s(/<\!--/,/-->/),C=function(A,w){r.call(this,A,w),this._current_tag_name="";var M=new o(this._input).read_options(this._options),E=new t(this._input);if(this.__patterns={word:M.until(/[\n\r\t <]/),single_quote:M.until_after(/'/),double_quote:M.until_after(/"/),attribute:M.until(/[\n\r\t =>]|\/>/),element_name:M.until(/[\n\r\t >\/]/),handlebars_comment:E.starting_with(/{{!--/).until_after(/--}}/),handlebars:E.starting_with(/{{/).until_after(/}}/),handlebars_open:E.until(/[\n\r\t }]/),handlebars_raw_close:E.until(/}}/),comment:E.starting_with(/<!--/).until_after(/-->/),cdata:E.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:E.starting_with(/<!\[/).until_after(/]>/),processing:E.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 p=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=E.matching(p).until_after(p)}};C.prototype=new r,C.prototype._is_comment=function(A){return!1},C.prototype._is_opening=function(A){return A.type===h.TAG_OPEN},C.prototype._is_closing=function(A,w){return A.type===h.TAG_CLOSE&&w&&((A.text===">"||A.text==="/>")&&w.text[0]==="<"||A.text==="}}"&&w.text[0]==="{"&&w.text[1]==="{")},C.prototype._reset=function(){this._current_tag_name=""},C.prototype._get_next_token=function(A,w){var M=null;this._readWhitespace();var E=this._input.peek();return E===null?this._create_token(h.EOF,""):(M=M||this._read_open_handlebars(E,w),M=M||this._read_attribute(E,A,w),M=M||this._read_close(E,w),M=M||this._read_raw_content(E,A,w),M=M||this._read_content_word(E),M=M||this._read_comment_or_cdata(E),M=M||this._read_processing(E),M=M||this._read_open(E,w),M=M||this._create_token(h.UNKNOWN,this._input.next()),M)},C.prototype._read_comment_or_cdata=function(A){var w=null,M=null,E=null;if(A==="<"){var p=this._input.peek(1);p==="!"&&(M=this.__patterns.comment.read(),M?(E=g.get_directives(M),E&&E.ignore==="start"&&(M+=g.readIgnored(this._input))):M=this.__patterns.cdata.read()),M&&(w=this._create_token(h.COMMENT,M),w.directives=E)}return w},C.prototype._read_processing=function(A){var w=null,M=null,E=null;if(A==="<"){var p=this._input.peek(1);(p==="!"||p==="?")&&(M=this.__patterns.conditional_comment.read(),M=M||this.__patterns.processing.read()),M&&(w=this._create_token(h.COMMENT,M),w.directives=E)}return w},C.prototype._read_open=function(A,w){var M=null,E=null;return w||A==="<"&&(M=this._input.next(),this._input.peek()==="/"&&(M+=this._input.next()),M+=this.__patterns.element_name.read(),E=this._create_token(h.TAG_OPEN,M)),E},C.prototype._read_open_handlebars=function(A,w){var M=null,E=null;return w||this._options.indent_handlebars&&A==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(M=this.__patterns.handlebars_comment.read(),M=M||this.__patterns.handlebars.read(),E=this._create_token(h.COMMENT,M)):(M=this.__patterns.handlebars_open.read(),E=this._create_token(h.TAG_OPEN,M))),E},C.prototype._read_close=function(A,w){var M=null,E=null;return w&&(w.text[0]==="<"&&(A===">"||A==="/"&&this._input.peek(1)===">")?(M=this._input.next(),A==="/"&&(M+=this._input.next()),E=this._create_token(h.TAG_CLOSE,M)):w.text[0]==="{"&&A==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),E=this._create_token(h.TAG_CLOSE,"}}"))),E},C.prototype._read_attribute=function(A,w,M){var E=null,p="";if(M&&M.text[0]==="<")if(A==="=")E=this._create_token(h.EQUALS,this._input.next());else if(A==='"'||A==="'"){var l=this._input.next();A==='"'?l+=this.__patterns.double_quote.read():l+=this.__patterns.single_quote.read(),E=this._create_token(h.VALUE,l)}else p=this.__patterns.attribute.read(),p&&(w.type===h.EQUALS?E=this._create_token(h.VALUE,p):E=this._create_token(h.ATTRIBUTE,p));return E},C.prototype._is_content_unformatted=function(A){return this._options.void_elements.indexOf(A)===-1&&(this._options.content_unformatted.indexOf(A)!==-1||this._options.unformatted.indexOf(A)!==-1)},C.prototype._read_raw_content=function(A,w,M){var E="";if(M&&M.text[0]==="{")E=this.__patterns.handlebars_raw_close.read();else if(w.type===h.TAG_CLOSE&&w.opened.text[0]==="<"&&w.text[0]!=="/"){var p=w.opened.text.substr(1).toLowerCase();if(p==="script"||p==="style"){var l=this._read_comment_or_cdata(A);if(l)return l.type=h.TEXT,l;E=this._input.readUntil(new RegExp("</"+p+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(p)&&(E=this._input.readUntil(new RegExp("</"+p+"[\\n\\r\\t ]*?>","ig")))}return E?this._create_token(h.TEXT,E):null},C.prototype._read_content_word=function(A){var w="";if(this._options.unformatted_content_delimiter&&(A===this._options.unformatted_content_delimiter[0]&&(w=this.__patterns.unformatted_content_delimiter.read())),w||(w=this.__patterns.word.read()),w)return this._create_token(h.TEXT,w)},i.exports.Tokenizer=C,i.exports.TOKEN=h}],m={};function T(i){var d=m[i];if(d!==void 0)return d.exports;var c=m[i]={exports:{}};return D[i](c,c.exports,T),c.exports}var b=T(18);P=b})();var F=P;if(!0)!(Y=[I,I("6UM0"),I("TXwP")],H=function(D){var m=I("6UM0"),T=I("TXwP");return{html_beautify:function(b,i){return F(b,i,m.js_beautify,T.css_beautify)}}}.apply(re,Y),H!==void 0&&(Ye.exports=H));else var R,O})()},pzxd:function(Ye,re,I){var Y=I("bYtY"),H=Y.retrieve2,P=Y.retrieve3,F=Y.each,R=Y.normalizeCssArray,O=Y.isString,D=Y.isObject,m=I("6GrX"),T=I("VpOo"),b=I("Xnb7"),i=I("fW2E"),d=I("gut8"),c=d.ContextCachedBy,r=d.WILL_BE_RESTORED,a=m.DEFAULT_FONT,s={left:1,right:1,center:1},o={top:1,bottom:1,middle:1},t=[["textShadowBlur","shadowBlur",0],["textShadowOffsetX","shadowOffsetX",0],["textShadowOffsetY","shadowOffsetY",0],["textShadowColor","shadowColor","transparent"]],h={},g={};function C(V){return A(V),F(V.rich,A),V}function A(V){if(V){V.font=m.makeFont(V);var W=V.textAlign;W==="middle"&&(W="center"),V.textAlign=W==null||s[W]?W:"left";var $=V.textVerticalAlign||V.textBaseline;$==="center"&&($="middle"),V.textVerticalAlign=$==null||o[$]?$:"top";var q=V.textPadding;q&&(V.textPadding=R(V.textPadding))}}function w(V,W,$,q,fe,se){q.rich?E(V,W,$,q,fe,se):M(V,W,$,q,fe,se)}function M(V,W,$,q,fe,se){"use strict";var me=f(q),ve,Ae=!1,ge=W.__attrCachedBy===c.PLAIN_TEXT;se!==r?(se&&(ve=se.style,Ae=!me&&ge&&ve),W.__attrCachedBy=me?c.NONE:c.PLAIN_TEXT):ge&&(W.__attrCachedBy=c.NONE);var ue=q.font||a;(!Ae||ue!==(ve.font||a))&&(W.font=ue);var $e=V.__computedFont;V.__styleFont!==ue&&(V.__styleFont=ue,$e=V.__computedFont=W.font);var Tt=q.textPadding,ye=q.textLineHeight,Re=V.__textCotentBlock;(!Re||V.__dirtyText)&&(Re=V.__textCotentBlock=m.parsePlainText($,$e,Tt,ye,q.truncate));var nt=Re.outerHeight,Ue=Re.lines,ke=Re.lineHeight,lt=v(g,V,q,fe),Fe=lt.baseX,Ze=lt.baseY,Xe=lt.textAlign||"left",ft=lt.textVerticalAlign;l(W,q,fe,Fe,Ze);var Rt=m.adjustTextY(Ze,nt,ft),Pt=Fe,Bt=Rt;if(me||Tt){var Ve=m.getWidth($,$e),Ft=Ve;Tt&&(Ft+=Tt[1]+Tt[3]);var nn=m.adjustTextX(Fe,Ft,Xe);me&&_(V,W,q,nn,Rt,Ft,nt),Tt&&(Pt=z(Fe,Xe,Tt),Bt+=Tt[0])}W.textAlign=Xe,W.textBaseline="middle",W.globalAlpha=q.opacity||1;for(var Le=0;Le<t.length;Le++){var Se=t[Le],ut=Se[0],mt=Se[1],We=q[ut];(!Ae||We!==ve[ut])&&(W[mt]=i(W,mt,We||Se[2]))}Bt+=ke/2;var vt=q.textStrokeWidth,Pe=Ae?ve.textStrokeWidth:null,xe=!Ae||vt!==Pe,we=!Ae||xe||q.textStroke!==ve.textStroke,ie=j(q.textStroke,vt),ae=U(q.textFill);if(ie&&(xe&&(W.lineWidth=vt),we&&(W.strokeStyle=ie)),ae&&((!Ae||q.textFill!==ve.textFill)&&(W.fillStyle=ae)),Ue.length===1)ie&&W.strokeText(Ue[0],Pt,Bt),ae&&W.fillText(Ue[0],Pt,Bt);else for(var Le=0;Le<Ue.length;Le++)ie&&W.strokeText(Ue[Le],Pt,Bt),ae&&W.fillText(Ue[Le],Pt,Bt),Bt+=ke}function E(V,W,$,q,fe,se){se!==r&&(W.__attrCachedBy=c.NONE);var me=V.__textCotentBlock;(!me||V.__dirtyText)&&(me=V.__textCotentBlock=m.parseRichText($,q)),p(V,W,me,q,fe)}function p(V,W,$,q,fe){var se=$.width,me=$.outerWidth,ve=$.outerHeight,Ae=q.textPadding,ge=v(g,V,q,fe),ue=ge.baseX,$e=ge.baseY,Tt=ge.textAlign,ye=ge.textVerticalAlign;l(W,q,fe,ue,$e);var Re=m.adjustTextX(ue,me,Tt),nt=m.adjustTextY($e,ve,ye),Ue=Re,ke=nt;Ae&&(Ue+=Ae[3],ke+=Ae[0]);var lt=Ue+se;f(q)&&_(V,W,q,Re,nt,me,ve);for(var Fe=0;Fe<$.lines.length;Fe++){for(var Ze=$.lines[Fe],Xe=Ze.tokens,ft=Xe.length,Rt=Ze.lineHeight,Pt=Ze.width,Bt=0,Ve=Ue,Ft=lt,nn=ft-1,Le;Bt<ft&&(Le=Xe[Bt],!Le.textAlign||Le.textAlign==="left");)u(V,W,Le,q,Rt,ke,Ve,"left"),Pt-=Le.width,Ve+=Le.width,Bt++;for(;nn>=0&&(Le=Xe[nn],Le.textAlign==="right");)u(V,W,Le,q,Rt,ke,Ft,"right"),Pt-=Le.width,Ft-=Le.width,nn--;for(Ve+=(se-(Ve-Ue)-(lt-Ft)-Pt)/2;Bt<=nn;)Le=Xe[Bt],u(V,W,Le,q,Rt,ke,Ve+Le.width/2,"center"),Ve+=Le.width,Bt++;ke+=Rt}}function l(V,W,$,q,fe){if($&&W.textRotation){var se=W.textOrigin;se==="center"?(q=$.width/2+$.x,fe=$.height/2+$.y):se&&(q=se[0]+$.x,fe=se[1]+$.y),V.translate(q,fe),V.rotate(-W.textRotation),V.translate(-q,-fe)}}function u(V,W,$,q,fe,se,me,ve){var Ae=q.rich[$.styleName]||{};Ae.text=$.text;var ge=$.textVerticalAlign,ue=se+fe/2;ge==="top"?ue=se+$.height/2:ge==="bottom"&&(ue=se+fe-$.height/2),!$.isLineHolder&&f(Ae)&&_(V,W,Ae,ve==="right"?me-$.width:ve==="center"?me-$.width/2:me,ue-$.height/2,$.width,$.height);var $e=$.textPadding;$e&&(me=z(me,ve,$e),ue-=$.height/2-$e[2]-$.textHeight/2),N(W,"shadowBlur",P(Ae.textShadowBlur,q.textShadowBlur,0)),N(W,"shadowColor",Ae.textShadowColor||q.textShadowColor||"transparent"),N(W,"shadowOffsetX",P(Ae.textShadowOffsetX,q.textShadowOffsetX,0)),N(W,"shadowOffsetY",P(Ae.textShadowOffsetY,q.textShadowOffsetY,0)),N(W,"textAlign",ve),N(W,"textBaseline","middle"),N(W,"font",$.font||a);var Tt=j(Ae.textStroke||q.textStroke,Re),ye=U(Ae.textFill||q.textFill),Re=H(Ae.textStrokeWidth,q.textStrokeWidth);Tt&&(N(W,"lineWidth",Re),N(W,"strokeStyle",Tt),W.strokeText($.text,me,ue)),ye&&(N(W,"fillStyle",ye),W.fillText($.text,me,ue))}function f(V){return!!(V.textBackgroundColor||V.textBorderWidth&&V.textBorderColor)}function _(V,W,$,q,fe,se,me){var ve=$.textBackgroundColor,Ae=$.textBorderWidth,ge=$.textBorderColor,ue=O(ve);if(N(W,"shadowBlur",$.textBoxShadowBlur||0),N(W,"shadowColor",$.textBoxShadowColor||"transparent"),N(W,"shadowOffsetX",$.textBoxShadowOffsetX||0),N(W,"shadowOffsetY",$.textBoxShadowOffsetY||0),ue||Ae&&ge){W.beginPath();var $e=$.textBorderRadius;$e?T.buildPath(W,{x:q,y:fe,width:se,height:me,r:$e}):W.rect(q,fe,se,me),W.closePath()}if(ue)if(N(W,"fillStyle",ve),$.fillOpacity!=null){var Tt=W.globalAlpha;W.globalAlpha=$.fillOpacity*$.opacity,W.fill(),W.globalAlpha=Tt}else W.fill();else if(D(ve)){var ye=ve.image;ye=b.createOrUpdateImage(ye,null,V,y,ve),ye&&b.isImageReady(ye)&&W.drawImage(ye,q,fe,se,me)}if(Ae&&ge)if(N(W,"lineWidth",Ae),N(W,"strokeStyle",ge),$.strokeOpacity!=null){var Tt=W.globalAlpha;W.globalAlpha=$.strokeOpacity*$.opacity,W.stroke(),W.globalAlpha=Tt}else W.stroke()}function y(V,W){W.image=V}function v(V,W,$,q){var fe=$.x||0,se=$.y||0,me=$.textAlign,ve=$.textVerticalAlign;if(q){var Ae=$.textPosition;if(Ae instanceof Array)fe=q.x+G(Ae[0],q.width),se=q.y+G(Ae[1],q.height);else{var ge=W&&W.calculateTextPosition?W.calculateTextPosition(h,$,q):m.calculateTextPosition(h,$,q);fe=ge.x,se=ge.y,me=me||ge.textAlign,ve=ve||ge.textVerticalAlign}var ue=$.textOffset;ue&&(fe+=ue[0],se+=ue[1])}return V=V||{},V.baseX=fe,V.baseY=se,V.textAlign=me,V.textVerticalAlign=ve,V}function N(V,W,$){return V[W]=i(V,W,$),V[W]}function j(V,W){return V==null||W<=0||V==="transparent"||V==="none"?null:V.image||V.colorStops?"#000":V}function U(V){return V==null||V==="none"?null:V.image||V.colorStops?"#000":V}function G(V,W){return typeof V=="string"?V.lastIndexOf("%")>=0?parseFloat(V)/100*W:parseFloat(V):V}function z(V,W,$){return W==="right"?V-$[1]:W==="center"?V+$[3]/2-$[1]/2:V+$[3]}function L(V,W){return V!=null&&(V||W.textBackgroundColor||W.textBorderWidth&&W.textBorderColor||W.textPadding)}re.normalizeTextStyle=C,re.renderText=w,re.getBoxPosition=v,re.getStroke=j,re.getFill=U,re.parsePercent=G,re.needDrawText=L},qH13:function(Ye,re,I){var Y=I("ItGF"),H=I("QBsz"),P=H.applyTransform,F=I("mFDi"),R=I("Qe9p"),O=I("6GrX"),D=I("pzxd"),m=I("ni6a"),T=I("Gev7"),b=I("Dagg"),i=I("dqUG"),d=I("y+Vt"),c=I("IMiH"),r=I("QuXc"),a=I("06Qe"),s=c.CMD,o=Math.round,t=Math.sqrt,h=Math.abs,g=Math.cos,C=Math.sin,A=Math.max;if(!Y.canvasSupported){var w=",",M="progid:DXImageTransform.Microsoft",E=21600,p=E/2,l=1e5,u=1e3,f=function(Fe){Fe.style.cssText="position:absolute;left:0;top:0;width:1px;height:1px;",Fe.coordsize=E+","+E,Fe.coordorigin="0,0"},_=function(Fe){return String(Fe).replace(/&/g,"&").replace(/"/g,""")},y=function(Fe,Ze,Xe){return"rgb("+[Fe,Ze,Xe].join(",")+")"},v=function(Fe,Ze){Ze&&Fe&&Ze.parentNode!==Fe&&Fe.appendChild(Ze)},N=function(Fe,Ze){Ze&&Fe&&Ze.parentNode===Fe&&Fe.removeChild(Ze)},j=function(Fe,Ze,Xe){return(parseFloat(Fe)||0)*l+(parseFloat(Ze)||0)*u+Xe},U=D.parsePercent,G=function(Fe,Ze,Xe){var ft=R.parse(Ze);Xe=+Xe,isNaN(Xe)&&(Xe=1),ft&&(Fe.color=y(ft[0],ft[1],ft[2]),Fe.opacity=Xe*ft[3])},z=function(Fe){var Ze=R.parse(Fe);return[y(Ze[0],Ze[1],Ze[2]),Ze[3]]},L=function(Fe,Ze,Xe){var ft=Ze.fill;if(ft!=null)if(ft instanceof r){var Rt,Pt=0,Bt=[0,0],Ve=0,Ft=1,nn=Xe.getBoundingRect(),Le=nn.width,Se=nn.height;if(ft.type==="linear"){Rt="gradient";var ut=Xe.transform,mt=[ft.x*Le,ft.y*Se],We=[ft.x2*Le,ft.y2*Se];ut&&(P(mt,mt,ut),P(We,We,ut));var vt=We[0]-mt[0],Pe=We[1]-mt[1];Pt=Math.atan2(vt,Pe)*180/Math.PI,Pt<0&&(Pt+=360),Pt<1e-6&&(Pt=0)}else{Rt="gradientradial";var mt=[ft.x*Le,ft.y*Se],ut=Xe.transform,xe=Xe.scale,we=Le,ie=Se;Bt=[(mt[0]-nn.x)/we,(mt[1]-nn.y)/ie],ut&&P(mt,mt,ut),we/=xe[0]*E,ie/=xe[1]*E;var ae=A(we,ie);Ve=2*0/ae,Ft=2*ft.r/ae-Ve}var ce=ft.colorStops.slice();ce.sort(function(dt,_e){return dt.offset-_e.offset});for(var be=ce.length,Ce=[],Be=[],yt=0;yt<be;yt++){var Xt=ce[yt],an=z(Xt.color);Be.push(Xt.offset*Ft+Ve+" "+an[0]),(yt===0||yt===be-1)&&Ce.push(an)}if(be>=2){var pt=Ce[0][0],Yt=Ce[1][0],St=Ce[0][1]*Ze.opacity,Ot=Ce[1][1]*Ze.opacity;Fe.type=Rt,Fe.method="none",Fe.focus="100%",Fe.angle=Pt,Fe.color=pt,Fe.color2=Yt,Fe.colors=Be.join(","),Fe.opacity=Ot,Fe.opacity2=St}Rt==="radial"&&(Fe.focusposition=Bt.join(","))}else G(Fe,ft,Ze.opacity)},V=function(Fe,Ze){Ze.lineDash&&(Fe.dashstyle=Ze.lineDash.join(" ")),Ze.stroke!=null&&!(Ze.stroke instanceof r)&&G(Fe,Ze.stroke,Ze.opacity)},W=function(Fe,Ze,Xe,ft){var Rt=Ze==="fill",Pt=Fe.getElementsByTagName(Ze)[0];Xe[Ze]!=null&&Xe[Ze]!=="none"&&(Rt||!Rt&&Xe.lineWidth)?(Fe[Rt?"filled":"stroked"]="true",Xe[Ze]instanceof r&&N(Fe,Pt),Pt||(Pt=a.createNode(Ze)),Rt?L(Pt,Xe,ft):V(Pt,Xe),v(Fe,Pt)):(Fe[Rt?"filled":"stroked"]="false",N(Fe,Pt))},$=[[],[],[]],q=function(Fe,Ze){var Xe=s.M,ft=s.C,Rt=s.L,Pt=s.A,Bt=s.Q,Ve=[],Ft,nn,Le,Se,ut,mt,We=Fe.data,vt=Fe.len();for(Se=0;Se<vt;){Le=We[Se++],nn="",Ft=0;switch(Le){case Xe:nn=" m ",Ft=1,ut=We[Se++],mt=We[Se++],$[0][0]=ut,$[0][1]=mt;break;case Rt:nn=" l ",Ft=1,ut=We[Se++],mt=We[Se++],$[0][0]=ut,$[0][1]=mt;break;case Bt:case ft:nn=" c ",Ft=3;var Pe=We[Se++],xe=We[Se++],we=We[Se++],ie=We[Se++],ae,ce;Le===Bt?(ae=we,ce=ie,we=(we+2*Pe)/3,ie=(ie+2*xe)/3,Pe=(ut+2*Pe)/3,xe=(mt+2*xe)/3):(ae=We[Se++],ce=We[Se++]),$[0][0]=Pe,$[0][1]=xe,$[1][0]=we,$[1][1]=ie,$[2][0]=ae,$[2][1]=ce,ut=ae,mt=ce;break;case Pt:var be=0,Ce=0,Be=1,yt=1,Xt=0;Ze&&(be=Ze[4],Ce=Ze[5],Be=t(Ze[0]*Ze[0]+Ze[1]*Ze[1]),yt=t(Ze[2]*Ze[2]+Ze[3]*Ze[3]),Xt=Math.atan2(-Ze[1]/yt,Ze[0]/Be));var an=We[Se++],pt=We[Se++],Yt=We[Se++],St=We[Se++],Ot=We[Se++]+Xt,dt=We[Se++]+Ot+Xt;Se++;var _e=We[Se++],je=an+g(Ot)*Yt,kt=pt+C(Ot)*St,Pe=an+g(dt)*Yt,xe=pt+C(dt)*St,gt=_e?" wa ":" at ";Math.abs(je-Pe)<1e-4&&(Math.abs(dt-Ot)>.01?_e&&(je+=270/E):Math.abs(kt-pt)<1e-4?_e&&je<an||!_e&&je>an?xe-=270/E:xe+=270/E:_e&&kt<pt||!_e&&kt>pt?Pe+=270/E:Pe-=270/E),Ve.push(gt,o(((an-Yt)*Be+be)*E-p),w,o(((pt-St)*yt+Ce)*E-p),w,o(((an+Yt)*Be+be)*E-p),w,o(((pt+St)*yt+Ce)*E-p),w,o((je*Be+be)*E-p),w,o((kt*yt+Ce)*E-p),w,o((Pe*Be+be)*E-p),w,o((xe*yt+Ce)*E-p)),ut=Pe,mt=xe;break;case s.R:var zt=$[0],$t=$[1];zt[0]=We[Se++],zt[1]=We[Se++],$t[0]=zt[0]+We[Se++],$t[1]=zt[1]+We[Se++],Ze&&(P(zt,zt,Ze),P($t,$t,Ze)),zt[0]=o(zt[0]*E-p),$t[0]=o($t[0]*E-p),zt[1]=o(zt[1]*E-p),$t[1]=o($t[1]*E-p),Ve.push(" m ",zt[0],w,zt[1]," l ",$t[0],w,zt[1]," l ",$t[0],w,$t[1]," l ",zt[0],w,$t[1]);break;case s.Z:Ve.push(" x ")}if(Ft>0){Ve.push(nn);for(var De=0;De<Ft;De++){var qe=$[De];Ze&&P(qe,qe,Ze),Ve.push(o(qe[0]*E-p),w,o(qe[1]*E-p),De<Ft-1?w:"")}}}return Ve.join("")};d.prototype.brushVML=function(Fe){var Ze=this.style,Xe=this._vmlEl;Xe||(Xe=a.createNode("shape"),f(Xe),this._vmlEl=Xe),W(Xe,"fill",Ze,this),W(Xe,"stroke",Ze,this);var ft=this.transform,Rt=ft!=null,Pt=Xe.getElementsByTagName("stroke")[0];if(Pt){var Bt=Ze.lineWidth;if(Rt&&!Ze.strokeNoScale){var Ve=ft[0]*ft[3]-ft[1]*ft[2];Bt*=t(h(Ve))}Pt.weight=Bt+"px"}var Ft=this.path||(this.path=new c);this.__dirtyPath&&(Ft.beginPath(),Ft.subPixelOptimize=!1,this.buildPath(Ft,this.shape),Ft.toStatic(),this.__dirtyPath=!1),Xe.path=q(Ft,this.transform),Xe.style.zIndex=j(this.zlevel,this.z,this.z2),v(Fe,Xe),Ze.text!=null?this.drawRectText(Fe,this.getBoundingRect()):this.removeRectText(Fe)},d.prototype.onRemove=function(Fe){N(Fe,this._vmlEl),this.removeRectText(Fe)},d.prototype.onAdd=function(Fe){v(Fe,this._vmlEl),this.appendRectText(Fe)};var fe=function(Fe){return typeof Fe=="object"&&Fe.tagName&&Fe.tagName.toUpperCase()==="IMG"};b.prototype.brushVML=function(Fe){var Ze=this.style,Xe=Ze.image,ft,Rt;if(fe(Xe)){var Pt=Xe.src;if(Pt===this._imageSrc)ft=this._imageWidth,Rt=this._imageHeight;else{var Bt=Xe.runtimeStyle,Ve=Bt.width,Ft=Bt.height;Bt.width="auto",Bt.height="auto",ft=Xe.width,Rt=Xe.height,Bt.width=Ve,Bt.height=Ft,this._imageSrc=Pt,this._imageWidth=ft,this._imageHeight=Rt}Xe=Pt}else Xe===this._imageSrc&&(ft=this._imageWidth,Rt=this._imageHeight);if(!Xe)return;var nn=Ze.x||0,Le=Ze.y||0,Se=Ze.width,ut=Ze.height,mt=Ze.sWidth,We=Ze.sHeight,vt=Ze.sx||0,Pe=Ze.sy||0,xe=mt&&We,we=this._vmlEl;we||(we=a.doc.createElement("div"),f(we),this._vmlEl=we);var ie=we.style,ae=!1,ce,be=1,Ce=1;if(this.transform&&(ce=this.transform,be=t(ce[0]*ce[0]+ce[1]*ce[1]),Ce=t(ce[2]*ce[2]+ce[3]*ce[3]),ae=ce[1]||ce[2]),ae){var Be=[nn,Le],yt=[nn+Se,Le],Xt=[nn,Le+ut],an=[nn+Se,Le+ut];P(Be,Be,ce),P(yt,yt,ce),P(Xt,Xt,ce),P(an,an,ce);var pt=A(Be[0],yt[0],Xt[0],an[0]),Yt=A(Be[1],yt[1],Xt[1],an[1]),St=[];St.push("M11=",ce[0]/be,w,"M12=",ce[2]/Ce,w,"M21=",ce[1]/be,w,"M22=",ce[3]/Ce,w,"Dx=",o(nn*be+ce[4]),w,"Dy=",o(Le*Ce+ce[5])),ie.padding="0 "+o(pt)+"px "+o(Yt)+"px 0",ie.filter=M+".Matrix("+St.join("")+", SizingMethod=clip)"}else ce&&(nn=nn*be+ce[4],Le=Le*Ce+ce[5]),ie.filter="",ie.left=o(nn)+"px",ie.top=o(Le)+"px";var Ot=this._imageEl,dt=this._cropEl;Ot||(Ot=a.doc.createElement("div"),this._imageEl=Ot);var _e=Ot.style;if(xe){if(ft&&Rt)_e.width=o(be*ft*Se/mt)+"px",_e.height=o(Ce*Rt*ut/We)+"px";else{var je=new Image,kt=this;je.onload=function(){je.onload=null,ft=je.width,Rt=je.height,_e.width=o(be*ft*Se/mt)+"px",_e.height=o(Ce*Rt*ut/We)+"px",kt._imageWidth=ft,kt._imageHeight=Rt,kt._imageSrc=Xe},je.src=Xe}dt||(dt=a.doc.createElement("div"),dt.style.overflow="hidden",this._cropEl=dt);var gt=dt.style;gt.width=o((Se+vt*Se/mt)*be),gt.height=o((ut+Pe*ut/We)*Ce),gt.filter=M+".Matrix(Dx="+-vt*Se/mt*be+",Dy="+-Pe*ut/We*Ce+")",dt.parentNode||we.appendChild(dt),Ot.parentNode!==dt&&dt.appendChild(Ot)}else _e.width=o(be*Se)+"px",_e.height=o(Ce*ut)+"px",we.appendChild(Ot),dt&&dt.parentNode&&(we.removeChild(dt),this._cropEl=null);var zt="",$t=Ze.opacity;$t<1&&(zt+=".Alpha(opacity="+o($t*100)+") "),zt+=M+".AlphaImageLoader(src="+Xe+", SizingMethod=scale)",_e.filter=zt,we.style.zIndex=j(this.zlevel,this.z,this.z2),v(Fe,we),Ze.text!=null&&this.drawRectText(Fe,this.getBoundingRect())},b.prototype.onRemove=function(Fe){N(Fe,this._vmlEl),this._vmlEl=null,this._cropEl=null,this._imageEl=null,this.removeRectText(Fe)},b.prototype.onAdd=function(Fe){v(Fe,this._vmlEl),this.appendRectText(Fe)};var se="normal",me={},ve=0,Ae=100,ge=document.createElement("div"),ue=function(Fe){var Ze=me[Fe];if(!Ze){ve>Ae&&(ve=0,me={});var Xe=ge.style,ft;try{Xe.font=Fe,ft=Xe.fontFamily.split(",")[0]}catch(Rt){}Ze={style:Xe.fontStyle||se,variant:Xe.fontVariant||se,weight:Xe.fontWeight||se,size:parseFloat(Xe.fontSize||12)|0,family:ft||"Microsoft YaHei"},me[Fe]=Ze,ve++}return Ze},$e;O.$override("measureText",function(Fe,Ze){var Xe=a.doc;$e||($e=Xe.createElement("div"),$e.style.cssText="position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;",a.doc.body.appendChild($e));try{$e.style.font=Ze}catch(ft){}return $e.innerHTML="",$e.appendChild(Xe.createTextNode(Fe)),{width:$e.offsetWidth}});for(var Tt=new F,ye=function(Fe,Ze,Xe,ft){var Rt=this.style;this.__dirty&&D.normalizeTextStyle(Rt,!0);var Pt=Rt.text;if(Pt!=null&&(Pt+=""),!Pt)return;if(Rt.rich){var Bt=O.parseRichText(Pt,Rt);Pt=[];for(var Ve=0;Ve<Bt.lines.length;Ve++){for(var Ft=Bt.lines[Ve].tokens,nn=[],Le=0;Le<Ft.length;Le++)nn.push(Ft[Le].text);Pt.push(nn.join(""))}Pt=Pt.join(`
|
|
`)}var Se,ut,mt=Rt.textAlign,We=Rt.textVerticalAlign,vt=ue(Rt.font),Pe=vt.style+" "+vt.variant+" "+vt.weight+" "+vt.size+'px "'+vt.family+'"';Xe=Xe||O.getBoundingRect(Pt,Pe,mt,We,Rt.textPadding,Rt.textLineHeight);var xe=this.transform;if(xe&&!ft&&(Tt.copy(Ze),Tt.applyTransform(xe),Ze=Tt),ft)Se=Ze.x,ut=Ze.y;else{var we=Rt.textPosition;if(we instanceof Array)Se=Ze.x+U(we[0],Ze.width),ut=Ze.y+U(we[1],Ze.height),mt=mt||"left";else{var ie=this.calculateTextPosition?this.calculateTextPosition({},Rt,Ze):O.calculateTextPosition({},Rt,Ze);Se=ie.x,ut=ie.y,mt=mt||ie.textAlign,We=We||ie.textVerticalAlign}}Se=O.adjustTextX(Se,Xe.width,mt),ut=O.adjustTextY(ut,Xe.height,We),ut+=Xe.height/2;var ae=a.createNode,ce=this._textVmlEl,be,Ce,Be;ce?(Be=ce.firstChild,be=Be.nextSibling,Ce=be.nextSibling):(ce=ae("line"),be=ae("path"),Ce=ae("textpath"),Be=ae("skew"),Ce.style["v-text-align"]="left",f(ce),be.textpathok=!0,Ce.on=!0,ce.from="0 0",ce.to="1000 0.05",v(ce,Be),v(ce,be),v(ce,Ce),this._textVmlEl=ce);var yt=[Se,ut],Xt=ce.style;xe&&ft?(P(yt,yt,xe),Be.on=!0,Be.matrix=xe[0].toFixed(3)+w+xe[2].toFixed(3)+w+xe[1].toFixed(3)+w+xe[3].toFixed(3)+",0,0",Be.offset=(o(yt[0])||0)+","+(o(yt[1])||0),Be.origin="0 0",Xt.left="0px",Xt.top="0px"):(Be.on=!1,Xt.left=o(Se)+"px",Xt.top=o(ut)+"px"),Ce.string=_(Pt);try{Ce.style.font=Pe}catch(an){}W(ce,"fill",{fill:Rt.textFill,opacity:Rt.opacity},this),W(ce,"stroke",{stroke:Rt.textStroke,opacity:Rt.opacity,lineDash:Rt.lineDash||null},this),ce.style.zIndex=j(this.zlevel,this.z,this.z2),v(Fe,ce)},Re=function(Fe){N(Fe,this._textVmlEl),this._textVmlEl=null},nt=function(Fe){v(Fe,this._textVmlEl)},Ue=[m,T,b,d,i],ke=0;ke<Ue.length;ke++){var lt=Ue[ke].prototype;lt.drawRectText=ye,lt.removeRectText=Re,lt.appendRectText=nt}i.prototype.brushVML=function(Fe){var Ze=this.style;Ze.text!=null?this.drawRectText(Fe,{x:Ze.x||0,y:Ze.y||0,width:0,height:0},this.getBoundingRect(),!0):this.removeRectText(Fe)},i.prototype.onRemove=function(Fe){this.removeRectText(Fe)},i.prototype.onAdd=function(Fe){this.appendRectText(Fe)}}},r6Bn:function(Ye,re,I){var Y=I("bYtY"),H=I("ItGF"),P=I("4fz+"),F=I("BPZU");function R(m,T){return m.zlevel===T.zlevel?m.z===T.z?m.z2-T.z2:m.z-T.z:m.zlevel-T.zlevel}var O=function(){this._roots=[],this._displayList=[],this._displayListLen=0};O.prototype={constructor:O,traverse:function(m,T){for(var b=0;b<this._roots.length;b++)this._roots[b].traverse(m,T)},getDisplayList:function(m,T){return T=T||!1,m&&this.updateDisplayList(T),this._displayList},updateDisplayList:function(m){this._displayListLen=0;for(var T=this._roots,b=this._displayList,i=0,d=T.length;i<d;i++)this._updateAndAddDisplayable(T[i],null,m);b.length=this._displayListLen,H.canvasSupported&&F(b,R)},_updateAndAddDisplayable:function(m,T,b){if(m.ignore&&!b)return;m.beforeUpdate(),m.__dirty&&m.update(),m.afterUpdate();var i=m.clipPath;if(i){T?T=T.slice():T=[];for(var d=i,c=m;d;)d.parent=c,d.updateTransform(),T.push(d),c=d,d=d.clipPath}if(m.isGroup){for(var r=m._children,a=0;a<r.length;a++){var s=r[a];m.__dirty&&(s.__dirty=!0),this._updateAndAddDisplayable(s,T,b)}m.__dirty=!1}else m.__clipPaths=T,this._displayList[this._displayListLen++]=m},addRoot:function(m){if(m.__storage===this)return;m instanceof P&&m.addChildrenToStorage(this),this.addToStorage(m),this._roots.push(m)},delRoot:function(m){if(m==null){for(var T=0;T<this._roots.length;T++){var b=this._roots[T];b instanceof P&&b.delChildrenFromStorage(this)}this._roots=[],this._displayList=[],this._displayListLen=0;return}if(m instanceof Array){for(var T=0,i=m.length;T<i;T++)this.delRoot(m[T]);return}var d=Y.indexOf(this._roots,m);d>=0&&(this.delFromStorage(m),this._roots.splice(d,1),m instanceof P&&m.delChildrenFromStorage(this))},addToStorage:function(m){return m&&(m.__storage=this,m.dirty(!1)),this},delFromStorage:function(m){return m&&(m.__storage=null),this},dispose:function(){this._renderList=this._roots=null},displayableSortFunc:R};var D=O;Ye.exports=D},rA99:function(Ye,re,I){var Y=I("y+Vt"),H=I("QBsz"),P=I("Sj9i"),F=P.quadraticSubdivide,R=P.cubicSubdivide,O=P.quadraticAt,D=P.cubicAt,m=P.quadraticDerivativeAt,T=P.cubicDerivativeAt,b=[];function i(c,r,a){var s=c.cpx2,o=c.cpy2;return s===null||o===null?[(a?T:D)(c.x1,c.cpx1,c.cpx2,c.x2,r),(a?T:D)(c.y1,c.cpy1,c.cpy2,c.y2,r)]:[(a?m:O)(c.x1,c.cpx1,c.x2,r),(a?m:O)(c.y1,c.cpy1,c.y2,r)]}var d=Y.extend({type:"bezier-curve",shape:{x1:0,y1:0,x2:0,y2:0,cpx1:0,cpy1:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(c,r){var a=r.x1,s=r.y1,o=r.x2,t=r.y2,h=r.cpx1,g=r.cpy1,C=r.cpx2,A=r.cpy2,w=r.percent;if(w===0)return;c.moveTo(a,s),C==null||A==null?(w<1&&(F(a,h,o,w,b),h=b[1],o=b[2],F(s,g,t,w,b),g=b[1],t=b[2]),c.quadraticCurveTo(h,g,o,t)):(w<1&&(R(a,h,C,o,w,b),h=b[1],C=b[2],o=b[3],R(s,g,A,t,w,b),g=b[1],A=b[2],t=b[3]),c.bezierCurveTo(h,g,C,A,o,t))},pointAt:function(c){return i(this.shape,c,!1)},tangentAt:function(c){var r=i(this.shape,c,!0);return H.normalize(r,r)}});Ye.exports=d},"rAM+":function(Ye,re,I){"use strict";I.d(re,"a",function(){return H});var Y=I("Qw5x");function H(P,F){var R;if(typeof Symbol=="undefined"||P[Symbol.iterator]==null){if(Array.isArray(P)||(R=Object(Y.a)(P))||F&&P&&typeof P.length=="number"){R&&(P=R);var O=0,D=function(){};return{s:D,n:function(){return O>=P.length?{done:!0}:{done:!1,value:P[O++]}},e:function(d){throw d},f:D}}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 m=!0,T=!1,b;return{s:function(){R=P[Symbol.iterator]()},n:function(){var d=R.next();return m=d.done,d},e:function(d){T=!0,b=d},f:function(){try{!m&&R.return!=null&&R.return()}finally{if(T)throw b}}}}},rUJ1:function(Ye,re){const I=/[&<>"']/,Y=/[&<>"']/g,H=/[<>"']|&(?!#?\w+;)/,P=/[<>"']|&(?!#?\w+;)/g,F={"&":"&","<":"<",">":">",'"':""","'":"'"},R=E=>F[E];function O(E,p){if(p){if(I.test(E))return E.replace(Y,R)}else if(H.test(E))return E.replace(P,R);return E}const D=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function m(E){return E.replace(D,(p,l)=>(l=l.toLowerCase(),l==="colon"?":":l.charAt(0)==="#"?l.charAt(1)==="x"?String.fromCharCode(parseInt(l.substring(2),16)):String.fromCharCode(+l.substring(1)):""))}const T=/(^|[^\[])\^/g;function b(E,p){E=E.source||E,p=p||"";const l={replace:(u,f)=>(f=f.source||f,f=f.replace(T,"$1"),E=E.replace(u,f),l),getRegex:()=>new RegExp(E,p)};return l}const i=/[^\w:]/g,d=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function c(E,p,l){if(E){let u;try{u=decodeURIComponent(m(l)).replace(i,"").toLowerCase()}catch(f){return null}if(u.indexOf("javascript:")===0||u.indexOf("vbscript:")===0||u.indexOf("data:")===0)return null}p&&!d.test(l)&&(l=t(p,l));try{l=encodeURI(l).replace(/%25/g,"%")}catch(u){return null}return l}const r={},a=/^[^:]+:\/*[^/]*$/,s=/^([^:]+:)[\s\S]*$/,o=/^([^:]+:\/*[^/]*)[\s\S]*$/;function t(E,p){r[" "+E]||(a.test(E)?r[" "+E]=E+"/":r[" "+E]=A(E,"/",!0)),E=r[" "+E];const l=E.indexOf(":")===-1;return p.substring(0,2)==="//"?l?p:E.replace(s,"$1")+p:p.charAt(0)==="/"?l?p:E.replace(o,"$1")+p:E+p}const h={exec:function(){}};function g(E){let p=1,l,u;for(;p<arguments.length;p++){l=arguments[p];for(u in l)Object.prototype.hasOwnProperty.call(l,u)&&(E[u]=l[u])}return E}function C(E,p){const l=E.replace(/\|/g,(_,y,v)=>{let N=!1,j=y;for(;--j>=0&&v[j]==="\\";)N=!N;return N?"|":" |"}),u=l.split(/ \|/);let f=0;if(u.length>p)u.splice(p);else for(;u.length<p;)u.push("");for(;f<u.length;f++)u[f]=u[f].trim().replace(/\\\|/g,"|");return u}function A(E,p,l){const u=E.length;if(u===0)return"";let f=0;for(;f<u;){const _=E.charAt(u-f-1);if(_===p&&!l)f++;else if(_!==p&&l)f++;else break}return E.substr(0,u-f)}function w(E,p){if(E.indexOf(p[1])===-1)return-1;const l=E.length;let u=0,f=0;for(;f<l;f++)if(E[f]==="\\")f++;else if(E[f]===p[0])u++;else if(E[f]===p[1]&&(u--,u<0))return f;return-1}function M(E){E&&E.sanitize&&!E.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")}Ye.exports={escape:O,unescape:m,edit:b,cleanUrl:c,resolveUrl:t,noopTest:h,merge:g,splitCells:C,rtrim:A,findClosingBracket:w,checkSanitizeDeprecation:M}},rhHp:function(Ye,re,I){"use strict";var Y=I("2qtc"),H=I("kLXV"),P=I("sRBo"),F=I("kaz8"),R=I("7Kak"),O=I("9yH6"),D=I("14J3"),m=I("BMrR"),T=I("jCWc"),b=I("kPKH"),i=I("iQDF"),d=I("+eQT"),c=I("miYZ"),r=I("tsqr"),a=I("jrin"),s=I("oBTY"),o=I("k1fw"),t=I("9og8"),h=I("y8nQ"),g=I("Vl3Y"),C=I("tJVT"),A=I("WmNS"),w=I.n(A),M=I("q1tI"),E=I.n(M),p=I("wd/R"),l=I.n(p),u=I("ErOA"),f=I("1vsH"),_=I("Ty5D"),y=I("9kvl"),v=I("xKgJ"),N=I("oUNq"),j=I("4wi7"),U=I("eozf"),G=function(L){var V=L.classroomList,W=L.dispatch,$=L.courseEndTime,q=Object(_.i)(),fe=g.a.useForm(),se=Object(C.a)(fe,1),me=se[0],ve=Object(M.useState)(1),Ae=Object(C.a)(ve,2),ge=Ae[0],ue=Ae[1],$e=Object(M.useState)([]),Tt=Object(C.a)($e,2),ye=Tt[0],Re=Tt[1],nt=Object(M.useState)(0),Ue=Object(C.a)(nt,2),ke=Ue[0],lt=Ue[1],Fe=Object(M.useState)(20),Ze=Object(C.a)(Fe,2),Xe=Ze[0],ft=Ze[1],Rt=Object(M.useState)(!0),Pt=Object(C.a)(Rt,2),Bt=Pt[0],Ve=Pt[1],Ft=Object(M.useState)([]),nn=Object(C.a)(Ft,2),Le=nn[0],Se=nn[1],ut=Object(M.useState)(!0),mt=Object(C.a)(ut,2),We=mt[0],vt=mt[1];Object(M.useEffect)(function(){if(V.actionTabs.key==="\u7ACB\u5373\u53D1\u5E03"&&(Pe(),V.actionTabs.type===2)){var ce=V.actionTabs.selectArrsAll[0];vt(ce.unified_setting)}},[V.actionTabs]);var Pe=function(){var ce=Object(t.a)(w.a.mark(function be(Ce){var Be,yt;return w.a.wrap(function(an){for(;;)switch(an.prev=an.next){case 0:return Ve(!0),an.next=3,Object(N.D)(Object(o.a)(Object(o.a)({},q),{},{page:Ce||ge,limit:2e4,homework_id:V.actionTabs.type===1?"":V.actionTabs.selectArrs[0]}));case 3:Be=an.sent,Be==null||Be.course_groups.map(function(pt,Yt){pt.key=pt.id,pt.title=pt.name,pt.disabled=pt.is_published}),Be&&(Re(Object(s.a)(Be==null?void 0:Be.course_groups)),lt(Be==null?void 0:Be.course_groups_count),Ve(!1),Ce||me.setFieldsValue((yt={},Object(a.a)(yt,"publish_time",l()(l()(new Date).add(0,"days").format("YYYY-MM-DD HH:mm"))),Object(a.a)(yt,"end_time",l()(l()(new Date(Object(f.b)("/"))).add(7,"days").format("YYYY-MM-DD HH:mm"))),yt)));case 6:case"end":return an.stop()}},be)}));return function(Ce){return ce.apply(this,arguments)}}(),xe=function(){var ce=Object(t.a)(w.a.mark(function be(){var Ce,Be,yt,Xt;return w.a.wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:if(Be=Object(o.a)({},me.getFieldsValue()),!(Be.end_time<=Be.publish_time)){pt.next=4;break}return r.b.info("\u622A\u6B62\u65F6\u95F4\u4E0D\u80FD\u5927\u4E8E\u6216\u7B49\u4E8E\u53D1\u5E03\u65F6\u95F4"),pt.abrupt("return");case 4:if(!((Le==null?void 0:Le.length)<=0&&!We&&ye.length>0)){pt.next=7;break}return r.b.info("\u53D1\u5E03\u73ED\u7EA7\u4E0D\u80FD\u4E3A\u7A7A"),pt.abrupt("return");case 7:return yt={homework_ids:Object(s.a)(V.actionTabs.selectArrs),group_ids:Le.length>0?Le.map(function(Yt){return Yt.id}):(Ce=V.detailShixunsList)===null||Ce===void 0?void 0:Ce.course_groups,end_time:l()(Be.end_time).format("YYYY-MM-DD HH:mm"),publish_time:l()(Be.publish_time).format("YYYY-MM-DD HH:mm"),unified_setting:!Le.length},pt.next=10,Object(u.a)("/api/courses/".concat(q.coursesId,"/homework_commons/publish_with_homework_list_position.json"),{method:"post",body:Object(o.a)({},yt)});case 10:Xt=pt.sent,Xt.status===0&&(we(),Object(f.cb)(["\u6559\u5B66\u8BFE\u5802","\u8BFE\u7A0B\u5B9E\u9A8C","\u7ACB\u5373\u53D1\u5E03"]),r.b.success("\u53D1\u5E03\u6210\u529F"),W({type:"classroomList/setActionTabs",payload:{key:"\u6E05\u9664\u9009\u62E9\u6570\u636E"}}),Object(v.c)()?V.actionTabs.detail?(W({type:"shixunHomeworks/setActionTabs",payload:{}}),W({type:"shixunHomeworks/getWorkList",payload:Object(o.a)({},q)}),W({type:"shixunHomeworks/getWorkSetting",payload:Object(o.a)({},q)})):W({type:"classroomList/getClassroomTeacherShixunsList",payload:Object(o.a)(Object(o.a)({},V.actionTabs.params),{},{type:4})}):W({type:"classroomList/getClassroomShixunsList",payload:Object(o.a)({},V.actionTabs.params)}),localStorage.getItem("Noviceguide")==="0"||W({type:"shixunHomeworks/setActionTabs",payload:{key:"\u5E95\u90E8\u5F39\u7A97",type:13,text:E.a.createElement("div",null,"\u6700\u540E\uFF0C\u54B1\u4EEC\u7ED9\u6559\u5B66\u8BFE\u5802\u6DFB\u52A0\u4E00\u540D\u5B66\u751F~\u70B9\u51FB\u201C\u6DFB\u52A0\u5B66\u751F\u201D\uFF0C\u5728\u5F39\u7A97\u9875\u9762\u4E2D\u8F93\u5165\u5E76\u641C\u7D22\u5B66\u751F\u59D3\u540D\uFF0C\u70B9\u51FB\u201C\u786E\u5B9A\u201D\u5C31\u53EF\u4EE5\u4E3A\u60A8\u7684\u8BFE\u5802\u6DFB\u52A0\u7B2C\u4E00\u4F4D\u5B66\u751F\u5566~")}}));case 12:case"end":return pt.stop()}},be)}));return function(){return ce.apply(this,arguments)}}(),we=function(){ue(1),Re([]),Se([])},ie=ke>ge*Xe,ae=V.detailShixunsList;return E.a.createElement(H.a,{width:600,centered:!0,title:"\u53D1\u5E03\u4F5C\u4E1A",visible:V.actionTabs.key==="\u7ACB\u5373\u53D1\u5E03",okText:"\u53D1\u5E03\u4F5C\u4E1A",cancelText:"\u6682\u4E0D\u53D1\u5E03",onOk:xe,onCancel:function(){we(),W({type:"classroomList/setActionTabs",payload:{}})}},E.a.createElement("p",{className:"tc"},"\u5B66\u751F\u5C06\u7ACB\u5373\u6536\u5230\u4F5C\u4E1A",E.a.createElement("br",null),'\u672C\u64CD\u4F5C\u53EA\u5BF9"\u672A\u53D1\u5E03"\u7684\u4F5C\u4E1A\u6709\u6548'),E.a.createElement(g.a,{form:me},E.a.createElement("div",{style:{paddingLeft:0}},E.a.createElement(m.a,{className:"mt30",align:"middle"},E.a.createElement(b.a,null,E.a.createElement(g.a.Item,{name:"publish_time",label:"\u53D1\u5E03\u65F6\u95F4"},E.a.createElement(d.a,{style:{width:155,marginRight:"25px"},getPopupContainer:function(be){return be.parentNode},disabledDate:function(be){return Object(U.b)(be,$)},disabledTime:function(be){return Object(U.c)(be)},placeholder:"\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:l()(Object(f.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",allowClear:!1}))),E.a.createElement(b.a,{className:"ml20"},E.a.createElement(g.a.Item,{name:"end_time",label:"\u622A\u6B62\u65F6\u95F4:"},E.a.createElement(d.a,{style:{width:170},getPopupContainer:function(be){return be.parentNode},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:l()(Object(f.d)(),"HH:mm")},disabledDate:function(be){return Object(U.b)(be,$,me.getFieldValue("publish_time"))},disabledTime:function(be){return Object(U.c)(be,me.getFieldValue("publish_time"))},format:"YYYY-MM-DD HH:mm",allowClear:!1})))),V.actionTabs.type===2&&E.a.createElement(m.a,{style:{marginBottom:"10px"}},E.a.createElement("span",{className:"mr5"},"\u53D1\u5E03\u8BBE\u7F6E:"),E.a.createElement(O.a.Group,{value:We,onChange:function(be){vt(be.target.value),Se([])}},E.a.createElement(O.a,{value:!0},"\u7EDF\u4E00\u53D1\u5E03"),E.a.createElement(O.a,{className:"ml20",disabled:ye.length<=0,value:!1},"\u5206\u73ED\u53D1\u5E03"))),ye.length<=0&&V.actionTabs.type===2&&E.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"')),(V.actionTabs.type===1||!We)&&ye.length>0&&E.a.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"10px"}},E.a.createElement("span",{style:{flex:1}},E.a.createElement(F.a,{checked:Le.length===ye.length,onChange:function(be){Le.length===ye.length?Se([]):Se(ye)}},"\u5168\u9009")),E.a.createElement("span",{style:{width:16}}),E.a.createElement("span",{style:{flex:1}},"\u5DF2\u9009\u62E9",Le.length||0,"\u4E2A\u5206\u73ED")),(V.actionTabs.type===1||!We)&&ye.length>0&&E.a.createElement(j.a,{data:ye,selectedRowKeys:Le,setSelectedRowKeys:Se})))};re.a=Object(y.a)(function(z){var L=z.classroomList;return{classroomList:L}})(G)},rmlV:function(Ye,re,I){var Y=I("y+Vt"),H=Y.extend({type:"ellipse",shape:{cx:0,cy:0,rx:0,ry:0},buildPath:function(P,F){var R=.5522848,O=F.cx,D=F.cy,m=F.rx,T=F.ry,b=m*R,i=T*R;P.moveTo(O-m,D),P.bezierCurveTo(O-m,D-i,O-b,D-T,O,D-T),P.bezierCurveTo(O+b,D-T,O+m,D-i,O+m,D),P.bezierCurveTo(O+m,D+i,O+b,D+T,O,D+T),P.bezierCurveTo(O-b,D+T,O-m,D+i,O-m,D),P.closePath()}});Ye.exports=H},sR1s:function(Ye,re,I){"use strict";I.d(re,"b",function(){return F}),I.d(re,"a",function(){return R}),I.d(re,"c",function(){return O}),I.d(re,"d",function(){return D});var Y=I("U8pU"),H="RC_TABLE_KEY";function P(m){return m==null?[]:Array.isArray(m)?m:[m]}function F(m,T){if(!T&&typeof T!="number")return m;for(var b=P(T),i=m,d=0;d<b.length;d+=1){if(!i)return null;var c=b[d];i=i[c]}return i}function R(m){var T=[],b={};return m.forEach(function(i){for(var d=i||{},c=d.key,r=d.dataIndex,a=c||P(r).join("-")||H;b[a];)a="".concat(a,"_next");b[a]=!0,T.push(a)}),T}function O(){var m={};function T(c,r){r&&Object.keys(r).forEach(function(a){var s=r[a];s&&Object(Y.a)(s)==="object"?(c[a]=c[a]||{},T(c[a],s)):c[a]=s})}for(var b=arguments.length,i=new Array(b),d=0;d<b;d++)i[d]=arguments[d];return i.forEach(function(c){T(m,c)}),m}function D(m){return m!=null}},"sW+o":function(Ye,re,I){var Y=I("SrGk"),H=I("bYtY"),P=I("SUKs"),F=I("Qe9p");function R(D,m){Y.call(this,D,m,["linearGradient","radialGradient"],"__gradient_in_use__")}H.inherits(R,Y),R.prototype.addWithoutUpdate=function(D,m){if(m&&m.style){var T=this;H.each(["fill","stroke"],function(b){if(m.style[b]&&(m.style[b].type==="linear"||m.style[b].type==="radial")){var i=m.style[b],d=T.getDefs(!0),c;i._dom?(c=i._dom,d.contains(i._dom)||T.addDom(c)):c=T.add(i),T.markUsed(m);var r=c.getAttribute("id");D.setAttribute(b,"url(#"+r+")")}})}},R.prototype.add=function(D){var m;if(D.type==="linear")m=this.createElement("linearGradient");else if(D.type==="radial")m=this.createElement("radialGradient");else return P("Illegal gradient type."),null;return D.id=D.id||this.nextId++,m.setAttribute("id","zr"+this._zrId+"-gradient-"+D.id),this.updateDom(D,m),this.addDom(m),m},R.prototype.update=function(D){var m=this;Y.prototype.update.call(this,D,function(){var T=D.type,b=D._dom.tagName;T==="linear"&&b==="linearGradient"||T==="radial"&&b==="radialGradient"?m.updateDom(D,D._dom):(m.removeDom(D),m.add(D))})},R.prototype.updateDom=function(D,m){if(D.type==="linear")m.setAttribute("x1",D.x),m.setAttribute("y1",D.y),m.setAttribute("x2",D.x2),m.setAttribute("y2",D.y2);else if(D.type==="radial")m.setAttribute("cx",D.x),m.setAttribute("cy",D.y),m.setAttribute("r",D.r);else{P("Illegal gradient type.");return}D.global?m.setAttribute("gradientUnits","userSpaceOnUse"):m.setAttribute("gradientUnits","objectBoundingBox"),m.innerHTML="";for(var T=D.colorStops,b=0,i=T.length;b<i;++b){var d=this.createElement("stop");d.setAttribute("offset",T[b].offset*100+"%");var c=T[b].color;if(c.indexOf("rgba">-1)){var r=F.parse(c)[3],a=F.toHex(c);d.setAttribute("stop-color","#"+a),d.setAttribute("stop-opacity",r)}else d.setAttribute("stop-color",T[b].color);m.appendChild(d)}D._dom=m},R.prototype.markUsed=function(D){if(D.style){var m=D.style.fill;m&&m._dom&&Y.prototype.markUsed.call(this,m._dom),m=D.style.stroke,m&&m._dom&&Y.prototype.markUsed.call(this,m._dom)}};var O=R;Ye.exports=O},sboe:function(Ye,re,I){"use strict";I.d(re,"a",function(){return P});var Y=I("q1tI"),H=I.n(Y),P=Y.createContext(null)},t23M:function(Ye,re,I){"use strict";var Y=I("VTBJ"),H=I("1OyB"),P=I("vuIU"),F=I("Ji7U"),R=I("LK+K"),O=I("q1tI"),D=I.n(O),m=I("m+aA"),T=I("Zm9Q"),b=I("Kwbf"),i=I("c+Xe"),d=I("bdgK"),c="rc-observer-key",r=function(a){Object(F.a)(o,a);var s=Object(R.a)(o);function o(){var t;return Object(H.a)(this,o),t=s.apply(this,arguments),t.resizeObserver=null,t.childNode=null,t.currentElement=null,t.state={width:0,height:0,offsetHeight:0,offsetWidth:0},t.onResize=function(h){var g=t.props.onResize,C=h[0].target,A=C.getBoundingClientRect(),w=A.width,M=A.height,E=C.offsetWidth,p=C.offsetHeight,l=Math.floor(w),u=Math.floor(M);if(t.state.width!==l||t.state.height!==u||t.state.offsetWidth!==E||t.state.offsetHeight!==p){var f={width:l,height:u,offsetWidth:E,offsetHeight:p};t.setState(f),g&&Promise.resolve().then(function(){g(Object(Y.a)(Object(Y.a)({},f),{},{offsetWidth:E,offsetHeight:p}))})}},t.setChildNode=function(h){t.childNode=h},t}return Object(P.a)(o,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var h=this.props.disabled;if(h){this.destroyObserver();return}var g=Object(m.a)(this.childNode||this),C=g!==this.currentElement;C&&(this.destroyObserver(),this.currentElement=g),!this.resizeObserver&&g&&(this.resizeObserver=new d.default(this.onResize),this.resizeObserver.observe(g))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var h=this.props.children,g=Object(T.a)(h);if(g.length>1)Object(b.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(g.length===0)return Object(b.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var C=g[0];if(O.isValidElement(C)&&Object(i.c)(C)){var A=C.ref;g[0]=O.cloneElement(C,{ref:Object(i.a)(A,this.setChildNode)})}return g.length===1?g[0]:g.map(function(w,M){return!O.isValidElement(w)||"key"in w&&w.key!==null?w:O.cloneElement(w,{key:"".concat(c,"-").concat(M)})})}}]),o}(O.Component);r.displayName="ResizeObserver",re.a=r},u3os:function(Ye,re,I){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.ver=re.clear=re.bind=void 0;var Y=I("P4Qj"),H=function(O,D){var m=(0,Y.getSensor)(O);return m.bind(D),function(){m.unbind(D)}};re.bind=H;var P=function(O){var D=(0,Y.getSensor)(O);(0,Y.removeSensor)(D)};re.clear=P;var F="1.0.1";re.ver=F},ulZh:function(Ye,re,I){typeof window!="undefined"&&function(H,P){Ye.exports=P()}(this,function(){return function(Y){var H={};function P(F){if(H[F])return H[F].exports;var R=H[F]={i:F,l:!1,exports:{}};return Y[F].call(R.exports,R,R.exports,P),R.l=!0,R.exports}return P.m=Y,P.c=H,P.d=function(F,R,O){P.o(F,R)||Object.defineProperty(F,R,{enumerable:!0,get:O})},P.r=function(F){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(F,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(F,"__esModule",{value:!0})},P.t=function(F,R){if(R&1&&(F=P(F)),R&8)return F;if(R&4&&typeof F=="object"&&F&&F.__esModule)return F;var O=Object.create(null);if(P.r(O),Object.defineProperty(O,"default",{enumerable:!0,value:F}),R&2&&typeof F!="string")for(var D in F)P.d(O,D,function(m){return F[m]}.bind(null,D));return O},P.n=function(F){var R=F&&F.__esModule?function(){return F.default}:function(){return F};return P.d(R,"a",R),R},P.o=function(F,R){return Object.prototype.hasOwnProperty.call(F,R)},P.p="/dist/",P(P.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(Y,H,P){"use strict";var F=Object.prototype.hasOwnProperty,R="~";function O(){}Object.create&&(O.prototype=Object.create(null),new O().__proto__||(R=!1));function D(i,d,c){this.fn=i,this.context=d,this.once=c||!1}function m(i,d,c,r,a){if(typeof c!="function")throw new TypeError("The listener must be a function");var s=new D(c,r||i,a),o=R?R+d:d;return i._events[o]?i._events[o].fn?i._events[o]=[i._events[o],s]:i._events[o].push(s):(i._events[o]=s,i._eventsCount++),i}function T(i,d){--i._eventsCount===0?i._events=new O:delete i._events[d]}function b(){this._events=new O,this._eventsCount=0}b.prototype.eventNames=function(){var d=[],c,r;if(this._eventsCount===0)return d;for(r in c=this._events)F.call(c,r)&&d.push(R?r.slice(1):r);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(c)):d},b.prototype.listeners=function(d){var c=R?R+d:d,r=this._events[c];if(!r)return[];if(r.fn)return[r.fn];for(var a=0,s=r.length,o=new Array(s);a<s;a++)o[a]=r[a].fn;return o},b.prototype.listenerCount=function(d){var c=R?R+d:d,r=this._events[c];return r?r.fn?1:r.length:0},b.prototype.emit=function(d,c,r,a,s,o){var t=R?R+d:d;if(!this._events[t])return!1;var h=this._events[t],g=arguments.length,C,A;if(h.fn){h.once&&this.removeListener(d,h.fn,void 0,!0);switch(g){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,c),!0;case 3:return h.fn.call(h.context,c,r),!0;case 4:return h.fn.call(h.context,c,r,a),!0;case 5:return h.fn.call(h.context,c,r,a,s),!0;case 6:return h.fn.call(h.context,c,r,a,s,o),!0}for(A=1,C=new Array(g-1);A<g;A++)C[A-1]=arguments[A];h.fn.apply(h.context,C)}else{var w=h.length,M;for(A=0;A<w;A++){h[A].once&&this.removeListener(d,h[A].fn,void 0,!0);switch(g){case 1:h[A].fn.call(h[A].context);break;case 2:h[A].fn.call(h[A].context,c);break;case 3:h[A].fn.call(h[A].context,c,r);break;case 4:h[A].fn.call(h[A].context,c,r,a);break;default:if(!C)for(M=1,C=new Array(g-1);M<g;M++)C[M-1]=arguments[M];h[A].fn.apply(h[A].context,C)}}}return!0},b.prototype.on=function(d,c,r){return m(this,d,c,r,!1)},b.prototype.once=function(d,c,r){return m(this,d,c,r,!0)},b.prototype.removeListener=function(d,c,r,a){var s=R?R+d:d;if(!this._events[s])return this;if(!c)return T(this,s),this;var o=this._events[s];if(o.fn)o.fn===c&&(!a||o.once)&&(!r||o.context===r)&&T(this,s);else{for(var t=0,h=[],g=o.length;t<g;t++)(o[t].fn!==c||a&&!o[t].once||r&&o[t].context!==r)&&h.push(o[t]);h.length?this._events[s]=h.length===1?h[0]:h:T(this,s)}return this},b.prototype.removeAllListeners=function(d){var c;return d?(c=R?R+d:d,this._events[c]&&T(this,c)):(this._events=new O,this._eventsCount=0),this},b.prototype.off=b.prototype.removeListener,b.prototype.addListener=b.prototype.on,b.prefixed=R,b.EventEmitter=b,Y.exports=b},"./node_modules/url-toolkit/src/url-toolkit.js":function(Y,H,P){(function(F){var R=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,O=/^([^\/?#]*)([^]*)$/,D=/(?:\/|^)\.(?=\/)/g,m=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,T={buildAbsoluteURL:function(b,i,d){if(d=d||{},b=b.trim(),i=i.trim(),!i){if(!d.alwaysNormalize)return b;var c=T.parseURL(b);if(!c)throw new Error("Error trying to parse base URL.");return c.path=T.normalizePath(c.path),T.buildURLFromParts(c)}var r=T.parseURL(i);if(!r)throw new Error("Error trying to parse relative URL.");if(r.scheme)return d.alwaysNormalize?(r.path=T.normalizePath(r.path),T.buildURLFromParts(r)):i;var a=T.parseURL(b);if(!a)throw new Error("Error trying to parse base URL.");if(!a.netLoc&&a.path&&a.path[0]!=="/"){var s=O.exec(a.path);a.netLoc=s[1],a.path=s[2]}a.netLoc&&!a.path&&(a.path="/");var o={scheme:a.scheme,netLoc:r.netLoc,path:null,params:r.params,query:r.query,fragment:r.fragment};if(!r.netLoc&&(o.netLoc=a.netLoc,r.path[0]!=="/"))if(!r.path)o.path=a.path,r.params||(o.params=a.params,r.query||(o.query=a.query));else{var t=a.path,h=t.substring(0,t.lastIndexOf("/")+1)+r.path;o.path=T.normalizePath(h)}return o.path===null&&(o.path=d.alwaysNormalize?T.normalizePath(r.path):r.path),T.buildURLFromParts(o)},parseURL:function(b){var i=R.exec(b);return i?{scheme:i[1]||"",netLoc:i[2]||"",path:i[3]||"",params:i[4]||"",query:i[5]||"",fragment:i[6]||""}:null},normalizePath:function(b){for(b=b.split("").reverse().join("").replace(D,"");b.length!==(b=b.replace(m,"")).length;);return b.split("").reverse().join("")},buildURLFromParts:function(b){return b.scheme+b.netLoc+b.path+b.params+b.query+b.fragment}};Y.exports=T})(this)},"./node_modules/webworkify-webpack/index.js":function(Y,H,P){function F(d){var c={};function r(s){if(c[s])return c[s].exports;var o=c[s]={i:s,l:!1,exports:{}};return d[s].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=d,r.c=c,r.i=function(s){return s},r.d=function(s,o,t){r.o(s,o)||Object.defineProperty(s,o,{configurable:!1,enumerable:!0,get:t})},r.r=function(s){Object.defineProperty(s,"__esModule",{value:!0})},r.n=function(s){var o=s&&s.__esModule?function(){return s.default}:function(){return s};return r.d(o,"a",o),o},r.o=function(s,o){return Object.prototype.hasOwnProperty.call(s,o)},r.p="/",r.oe=function(s){throw console.error(s),s};var a=r(r.s=ENTRY_MODULE);return a.default||a}var R="[\\.|\\-|\\+|\\w|/|@]+",O="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+R+").*?\\)";function D(d){return(d+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function m(d){return!isNaN(1*d)}function T(d,c,r){var a={};a[r]=[];var s=c.toString(),o=s.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!o)return a;for(var t=o[1],h=new RegExp("(\\\\n|\\W)"+D(t)+O,"g"),g;g=h.exec(s);){if(g[3]==="dll-reference")continue;a[r].push(g[3])}for(h=new RegExp("\\("+D(t)+'\\("(dll-reference\\s('+R+'))"\\)\\)'+O,"g");g=h.exec(s);)d[g[2]]||(a[r].push(g[1]),d[g[2]]=P(g[1]).m),a[g[2]]=a[g[2]]||[],a[g[2]].push(g[4]);for(var C=Object.keys(a),A=0;A<C.length;A++)for(var w=0;w<a[C[A]].length;w++)m(a[C[A]][w])&&(a[C[A]][w]=1*a[C[A]][w]);return a}function b(d){var c=Object.keys(d);return c.reduce(function(r,a){return r||d[a].length>0},!1)}function i(d,c){for(var r={main:[c]},a={main:[]},s={main:{}};b(r);)for(var o=Object.keys(r),t=0;t<o.length;t++){var h=o[t],g=r[h],C=g.pop();if(s[h]=s[h]||{},s[h][C]||!d[h][C])continue;s[h][C]=!0,a[h]=a[h]||[],a[h].push(C);for(var A=T(d,d[h][C],h),w=Object.keys(A),M=0;M<w.length;M++)r[w[M]]=r[w[M]]||[],r[w[M]]=r[w[M]].concat(A[w[M]])}return a}Y.exports=function(d,c){c=c||{};var r={main:P.m},a=c.all?{main:Object.keys(r.main)}:i(r,d),s="";Object.keys(a).filter(function(C){return C!=="main"}).forEach(function(C){for(var A=0;a[C][A];)A++;a[C].push(A),r[C][A]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",s=s+"var "+C+" = ("+F.toString().replace("ENTRY_MODULE",JSON.stringify(A))+")({"+a[C].map(function(w){return""+JSON.stringify(w)+": "+r[C][w].toString()}).join(",")+`});
|
|
`}),s=s+"new (("+F.toString().replace("ENTRY_MODULE",JSON.stringify(d))+")({"+a.main.map(function(C){return""+JSON.stringify(C)+": "+r.main[C].toString()}).join(",")+"}))(self);";var o=new window.Blob([s],{type:"text/javascript"});if(c.bare)return o;var t=window.URL||window.webkitURL||window.mozURL||window.msURL,h=t.createObjectURL(o),g=new window.Worker(h);return g.objectURL=h,g}},"./src/config.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"hlsDefaultConfig",function(){return M}),P.d(H,"mergeConfig",function(){return p}),P.d(H,"enableStreamingMode",function(){return l});var F=P("./src/controller/abr-controller.ts"),R=P("./src/controller/audio-stream-controller.ts"),O=P("./src/controller/audio-track-controller.ts"),D=P("./src/controller/subtitle-stream-controller.ts"),m=P("./src/controller/subtitle-track-controller.ts"),T=P("./src/controller/buffer-controller.ts"),b=P("./src/controller/timeline-controller.ts"),i=P("./src/controller/cap-level-controller.ts"),d=P("./src/controller/fps-controller.ts"),c=P("./src/controller/eme-controller.ts"),r=P("./src/controller/cmcd-controller.ts"),a=P("./src/utils/xhr-loader.ts"),s=P("./src/utils/fetch-loader.ts"),o=P("./src/utils/cues.ts"),t=P("./src/utils/mediakeys-helper.ts"),h=P("./src/utils/logger.ts");function g(){return g=Object.assign||function(u){for(var f=1;f<arguments.length;f++){var _=arguments[f];for(var y in _)Object.prototype.hasOwnProperty.call(_,y)&&(u[y]=_[y])}return u},g.apply(this,arguments)}function C(u,f){var _=Object.keys(u);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(u);f&&(y=y.filter(function(v){return Object.getOwnPropertyDescriptor(u,v).enumerable})),_.push.apply(_,y)}return _}function A(u){for(var f=1;f<arguments.length;f++){var _=arguments[f]!=null?arguments[f]:{};f%2?C(Object(_),!0).forEach(function(y){w(u,y,_[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(_)):C(Object(_)).forEach(function(y){Object.defineProperty(u,y,Object.getOwnPropertyDescriptor(_,y))})}return u}function w(u,f,_){return f in u?Object.defineProperty(u,f,{value:_,enumerable:!0,configurable:!0,writable:!0}):u[f]=_,u}var M=A(A({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:a.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:F.default,bufferController:T.default,capLevelController:i.default,fpsController:d.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:t.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},E()),{},{subtitleStreamController:D.SubtitleStreamController,subtitleTrackController:m.default,timelineController:b.TimelineController,audioStreamController:R.default,audioTrackController:O.default,emeController:c.default,cmcdController:r.default});function E(){return{cueHandler:o.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 p(u,f){if((f.liveSyncDurationCount||f.liveMaxLatencyDurationCount)&&(f.liveSyncDuration||f.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(f.liveMaxLatencyDurationCount!==void 0&&(f.liveSyncDurationCount===void 0||f.liveMaxLatencyDurationCount<=f.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(f.liveMaxLatencyDuration!==void 0&&(f.liveSyncDuration===void 0||f.liveMaxLatencyDuration<=f.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return g({},u,f)}function l(u){var f=u.loader;if(f!==s.default&&f!==a.default)h.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),u.progressive=!1;else{var _=Object(s.fetchSupported)();_&&(u.loader=s.default,u.progressive=!0,u.enableSoftwareAES=!0,h.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(Y,H,P){"use strict";P.r(H);var F=P("./src/polyfills/number.ts"),R=P("./src/utils/ewma-bandwidth-estimator.ts"),O=P("./src/events.ts"),D=P("./src/utils/buffer-helper.ts"),m=P("./src/errors.ts"),T=P("./src/types/loader.ts"),b=P("./src/utils/logger.ts");function i(r,a){for(var s=0;s<a.length;s++){var o=a[s];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(r,o.key,o)}}function d(r,a,s){return a&&i(r.prototype,a),s&&i(r,s),r}var c=function(){function r(s){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=s;var o=s.config;this.bwEstimator=new R.default(o.abrEwmaSlowVoD,o.abrEwmaFastVoD,o.abrEwmaDefaultEstimate),this.registerListeners()}var a=r.prototype;return a.registerListeners=function(){var o=this.hls;o.on(O.Events.FRAG_LOADING,this.onFragLoading,this),o.on(O.Events.FRAG_LOADED,this.onFragLoaded,this),o.on(O.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.on(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.on(O.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var o=this.hls;o.off(O.Events.FRAG_LOADING,this.onFragLoading,this),o.off(O.Events.FRAG_LOADED,this.onFragLoaded,this),o.off(O.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.off(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.off(O.Events.ERROR,this.onError,this)},a.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},a.onFragLoading=function(o,t){var h=t.frag;if(h.type===T.PlaylistLevelType.MAIN&&!this.timer){var g;this.fragCurrent=h,this.partCurrent=(g=t.part)!=null?g:null,this.timer=self.setInterval(this.onCheck,100)}},a.onLevelLoaded=function(o,t){var h=this.hls.config;t.details.live?this.bwEstimator.update(h.abrEwmaSlowLive,h.abrEwmaFastLive):this.bwEstimator.update(h.abrEwmaSlowVoD,h.abrEwmaFastVoD)},a._abandonRulesCheck=function(){var o=this.fragCurrent,t=this.partCurrent,h=this.hls,g=h.autoLevelEnabled,C=h.config,A=h.media;if(!o||!A)return;var w=t?t.stats:o.stats,M=t?t.duration:o.duration;if(w.aborted){b.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!g||A.paused||!A.playbackRate||!A.readyState)return;var E=performance.now()-w.loading.start,p=Math.abs(A.playbackRate);if(E<=500*M/p)return;var l=h.levels,u=h.minAutoLevel,f=l[o.level],_=w.total||Math.max(w.loaded,Math.round(M*f.maxBitrate/8)),y=Math.max(1,w.bwEstimate?w.bwEstimate/8:w.loaded*1e3/E),v=(_-w.loaded)/y,N=A.currentTime,j=(D.BufferHelper.bufferInfo(A,N,C.maxBufferHole).end-N)/p;if(j>=2*M/p||v<=j)return;var U=Number.POSITIVE_INFINITY,G;for(G=o.level-1;G>u;G--){var z=l[G].maxBitrate;if(U=M*z/(8*.8*y),U<j)break}if(U>=v)return;var L=this.bwEstimator.getEstimate();b.logger.warn("Fragment "+o.sn+(t?" part "+t.index:"")+" of level "+o.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+G+`
|
|
Current BW estimate: `+(Object(F.isFiniteNumber)(L)?(L/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+v.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+U.toFixed(3)+` s
|
|
Time to underbuffer: `+j.toFixed(3)+" s"),h.nextLoadLevel=G,this.bwEstimator.sample(E,w.loaded),this.clearTimer(),o.loader&&(this.fragCurrent=this.partCurrent=null,o.loader.abort()),h.trigger(O.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:o,part:t,stats:w})},a.onFragLoaded=function(o,t){var h=t.frag,g=t.part;if(h.type===T.PlaylistLevelType.MAIN&&Object(F.isFiniteNumber)(h.sn)){var C=g?g.stats:h.stats,A=g?g.duration:h.duration;if(this.clearTimer(),this.lastLoadedFragLevel=h.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var w=this.hls.levels[h.level],M=(w.loaded?w.loaded.bytes:0)+C.loaded,E=(w.loaded?w.loaded.duration:0)+A;w.loaded={bytes:M,duration:E},w.realBitrate=Math.round(8*M/E)}if(h.bitrateTest){var p={stats:C,frag:h,part:g,id:h.type};this.onFragBuffered(O.Events.FRAG_BUFFERED,p),h.bitrateTest=!1}}},a.onFragBuffered=function(o,t){var h=t.frag,g=t.part,C=g?g.stats:h.stats;if(C.aborted)return;if(h.type!==T.PlaylistLevelType.MAIN||h.sn==="initSegment")return;var A=C.parsing.end-C.loading.start;this.bwEstimator.sample(A,C.loaded),C.bwEstimate=this.bwEstimator.getEstimate(),h.bitrateTest?this.bitrateTestDelay=A/1e3:this.bitrateTestDelay=0},a.onError=function(o,t){switch(t.details){case m.ErrorDetails.FRAG_LOAD_ERROR:case m.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},a.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},a.getNextABRAutoLevel=function(){var o=this.fragCurrent,t=this.partCurrent,h=this.hls,g=h.maxAutoLevel,C=h.config,A=h.minAutoLevel,w=h.media,M=t?t.duration:o?o.duration:0,E=w?w.currentTime:0,p=w&&w.playbackRate!==0?Math.abs(w.playbackRate):1,l=this.bwEstimator?this.bwEstimator.getEstimate():C.abrEwmaDefaultEstimate,u=(D.BufferHelper.bufferInfo(w,E,C.maxBufferHole).end-E)/p,f=this.findBestLevel(l,A,g,u,C.abrBandWidthFactor,C.abrBandWidthUpFactor);if(f>=0)return f;b.logger.trace((u?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var _=M?Math.min(M,C.maxStarvationDelay):C.maxStarvationDelay,y=C.abrBandWidthFactor,v=C.abrBandWidthUpFactor;if(!u){var N=this.bitrateTestDelay;if(N){var j=M?Math.min(M,C.maxLoadingDelay):C.maxLoadingDelay;_=j-N,b.logger.trace("bitrate test took "+Math.round(1e3*N)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*_)+" ms"),y=v=1}}return f=this.findBestLevel(l,A,g,u+_,y,v),Math.max(f,0)},a.findBestLevel=function(o,t,h,g,C,A){for(var w,M=this.fragCurrent,E=this.partCurrent,p=this.lastLoadedFragLevel,l=this.hls.levels,u=l[p],f=!!(u!=null&&(w=u.details)!==null&&w!==void 0&&w.live),_=u==null?void 0:u.codecSet,y=E?E.duration:M?M.duration:0,v=h;v>=t;v--){var N=l[v];if(!N||_&&N.codecSet!==_)continue;var j=N.details,U=(E?j==null?void 0:j.partTarget:j==null?void 0:j.averagetargetduration)||y,G=void 0;v<=p?G=C*o:G=A*o;var z=l[v].maxBitrate,L=z*U/G;if(b.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+v+"/"+Math.round(G)+"/"+z+"/"+U+"/"+g+"/"+L),G>z&&(!L||f&&!this.bitrateTestDelay||L<g))return v}return-1},d(r,[{key:"nextAutoLevel",get:function(){var o=this._nextAutoLevel,t=this.bwEstimator;if(o!==-1&&(!t||!t.canEstimate()))return o;var h=this.getNextABRAutoLevel();return o!==-1&&(h=Math.min(o,h)),h},set:function(o){this._nextAutoLevel=o}}]),r}();H.default=c},"./src/controller/audio-stream-controller.ts":function(Y,H,P){"use strict";P.r(H);var F=P("./src/polyfills/number.ts"),R=P("./src/controller/base-stream-controller.ts"),O=P("./src/events.ts"),D=P("./src/utils/buffer-helper.ts"),m=P("./src/controller/fragment-tracker.ts"),T=P("./src/types/level.ts"),b=P("./src/types/loader.ts"),i=P("./src/loader/fragment.ts"),d=P("./src/demux/chunk-cache.ts"),c=P("./src/demux/transmuxer-interface.ts"),r=P("./src/types/transmuxer.ts"),a=P("./src/controller/fragment-finders.ts"),s=P("./src/utils/discontinuities.ts"),o=P("./src/errors.ts"),t=P("./src/utils/logger.ts");function h(){return h=Object.assign||function(M){for(var E=1;E<arguments.length;E++){var p=arguments[E];for(var l in p)Object.prototype.hasOwnProperty.call(p,l)&&(M[l]=p[l])}return M},h.apply(this,arguments)}function g(M,E){M.prototype=Object.create(E.prototype),M.prototype.constructor=M,C(M,E)}function C(M,E){return C=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},C(M,E)}var A=100,w=function(M){g(E,M);function E(l,u){var f;return f=M.call(this,l,u,"[audio-stream-controller]")||this,f.videoBuffer=null,f.videoTrackCC=-1,f.waitingVideoCC=-1,f.audioSwitch=!1,f.trackId=-1,f.waitingData=null,f.mainDetails=null,f.bufferFlushed=!1,f._registerListeners(),f}var p=E.prototype;return p.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},p._registerListeners=function(){var u=this.hls;u.on(O.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.on(O.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),u.on(O.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),u.on(O.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.on(O.Events.ERROR,this.onError,this),u.on(O.Events.BUFFER_RESET,this.onBufferReset,this),u.on(O.Events.BUFFER_CREATED,this.onBufferCreated,this),u.on(O.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),u.on(O.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.on(O.Events.FRAG_BUFFERED,this.onFragBuffered,this)},p._unregisterListeners=function(){var u=this.hls;u.off(O.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.off(O.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),u.off(O.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),u.off(O.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.off(O.Events.ERROR,this.onError,this),u.off(O.Events.BUFFER_RESET,this.onBufferReset,this),u.off(O.Events.BUFFER_CREATED,this.onBufferCreated,this),u.off(O.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),u.off(O.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.off(O.Events.FRAG_BUFFERED,this.onFragBuffered,this)},p.onInitPtsFound=function(u,f){var _=f.frag,y=f.id,v=f.initPTS;if(y==="main"){var N=_.cc;this.initPTS[_.cc]=v,this.log("InitPTS for cc: "+N+" found from main: "+v),this.videoTrackCC=N,this.state===R.State.WAITING_INIT_PTS&&this.tick()}},p.startLoad=function(u){if(!this.levels){this.startPosition=u,this.state=R.State.STOPPED;return}var f=this.lastCurrentTime;this.stopLoad(),this.setInterval(A),this.fragLoadError=0,f>0&&u===-1?(this.log("Override startPosition with lastCurrentTime @"+f.toFixed(3)),this.state=R.State.IDLE):(this.loadedmetadata=!1,this.state=R.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=u,this.tick()},p.doTick=function(){switch(this.state){case R.State.IDLE:this.doTickIdle();break;case R.State.WAITING_TRACK:{var u,f=this.levels,_=this.trackId,y=f==null||((u=f[_])===null||u===void 0)?void 0:u.details;if(y){if(this.waitForCdnTuneIn(y))break;this.state=R.State.WAITING_INIT_PTS}break}case R.State.FRAG_LOADING_WAITING_RETRY:{var v,N=performance.now(),j=this.retryDate;(!j||N>=j||(v=this.media)!==null&&v!==void 0&&v.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=R.State.IDLE);break}case R.State.WAITING_INIT_PTS:{var U=this.waitingData;if(U){var G=U.frag,z=U.part,L=U.cache,V=U.complete;if(this.initPTS[G.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=R.State.FRAG_LOADING;var W=L.flush(),$={frag:G,part:z,payload:W,networkDetails:null};this._handleFragmentLoadProgress($),V&&M.prototype._handleFragmentLoadComplete.call(this,$)}else if(this.videoTrackCC!==this.waitingVideoCC)t.logger.log("Waiting fragment cc ("+G.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var q=this.getLoadPosition(),fe=D.BufferHelper.bufferInfo(this.mediaBuffer,q,this.config.maxBufferHole),se=Object(a.fragmentWithinToleranceTest)(fe.end,this.config.maxFragLookUpTolerance,G);se<0&&(t.logger.log("Waiting fragment cc ("+G.cc+") @ "+G.start+" cancelled because another fragment at "+fe.end+" is needed"),this.clearWaitingFragment())}}else this.state=R.State.IDLE}}this.onTickEnd()},p.clearWaitingFragment=function(){var u=this.waitingData;u&&(this.fragmentTracker.removeFragment(u.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=R.State.IDLE)},p.onTickEnd=function(){var u=this.media;if(!u||!u.readyState)return;var f=this.mediaBuffer?this.mediaBuffer:u,_=f.buffered;!this.loadedmetadata&&_.length&&(this.loadedmetadata=!0),this.lastCurrentTime=u.currentTime},p.doTickIdle=function(){var u,f,_=this.hls,y=this.levels,v=this.media,N=this.trackId,j=_.config;if(!y||!y[N])return;if(!v&&(this.startFragRequested||!j.startFragPrefetch))return;var U=y[N],G=U.details;if(!G||G.live&&this.levelLastLoaded!==N||this.waitForCdnTuneIn(G)){this.state=R.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,i.ElementaryStreamTypes.AUDIO,b.PlaylistLevelType.AUDIO));var z=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,b.PlaylistLevelType.AUDIO);if(z===null)return;var L=z.len,V=this.getMaxBufferLength(),W=this.audioSwitch;if(L>=V&&!W)return;if(!W&&this._streamEnded(z,G)){_.trigger(O.Events.BUFFER_EOS,{type:"audio"}),this.state=R.State.ENDED;return}var $=G.fragments,q=$[0].start,fe=z.end;if(W){var se=this.getLoadPosition();fe=se,G.PTSKnown&&se<q&&((z.end>q||z.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),v.currentTime=q+.05))}var me=this.getNextFragment(fe,G);if(!me){this.bufferFlushed=!0;return}((u=me.decryptdata)===null||u===void 0?void 0:u.keyFormat)==="identity"&&!((f=me.decryptdata)!==null&&f!==void 0&&f.key)?this.loadKey(me,G):this.loadFragment(me,G,fe)},p.getMaxBufferLength=function(){var u=M.prototype.getMaxBufferLength.call(this),f=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,b.PlaylistLevelType.MAIN);return f===null?u:Math.max(u,f.len)},p.onMediaDetaching=function(){this.videoBuffer=null,M.prototype.onMediaDetaching.call(this)},p.onAudioTracksUpdated=function(u,f){var _=f.audioTracks;this.resetTransmuxer(),this.levels=_.map(function(y){return new T.Level(y)})},p.onAudioTrackSwitching=function(u,f){var _=!!f.url;this.trackId=f.id;var y=this.fragCurrent;y!=null&&y.loader&&y.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),_?this.setInterval(A):this.resetTransmuxer(),_?(this.audioSwitch=!0,this.state=R.State.IDLE):this.state=R.State.STOPPED,this.tick()},p.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},p.onLevelLoaded=function(u,f){this.mainDetails=f.details},p.onAudioTrackLoaded=function(u,f){var _,y=this.levels,v=f.details,N=f.id;if(!y){this.warn("Audio tracks were reset while loading level "+N);return}this.log("Track "+N+" loaded ["+v.startSN+","+v.endSN+"],duration:"+v.totalduration);var j=y[N],U=0;if(v.live||(_=j.details)!==null&&_!==void 0&&_.live){var G=this.mainDetails;if(v.fragments[0]||(v.deltaUpdateFailed=!0),v.deltaUpdateFailed||!G)return;!j.details&&v.hasProgramDateTime&&G.hasProgramDateTime?(Object(s.alignMediaPlaylistByPDT)(v,G),U=v.fragments[0].start):U=this.alignPlaylists(v,j.details)}j.details=v,this.levelLastLoaded=N,!this.startFragRequested&&(this.mainDetails||!v.live)&&this.setStartPosition(j.details,U),this.state===R.State.WAITING_TRACK&&!this.waitForCdnTuneIn(v)&&(this.state=R.State.IDLE),this.tick()},p._handleFragmentLoadProgress=function(u){var f,_=u.frag,y=u.part,v=u.payload,N=this.config,j=this.trackId,U=this.levels;if(!U){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+_.sn+" of level "+_.level+" will not be buffered");return}var G=U[j];console.assert(G,"Audio track is defined on fragment load progress");var z=G.details;console.assert(z,"Audio track details are defined on fragment load progress");var L=N.defaultAudioCodec||G.audioCodec||"mp4a.40.2",V=this.transmuxer;V||(V=this.transmuxer=new c.default(this.hls,b.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var W=this.initPTS[_.cc],$=(f=_.initSegment)===null||f===void 0?void 0:f.data;if(W!==void 0){var q=!1,fe=y?y.index:-1,se=fe!==-1,me=new r.ChunkMetadata(_.level,_.sn,_.stats.chunkCount,v.byteLength,fe,se);V.push(v,$,L,"",_,y,z.totalduration,q,me,W)}else{t.logger.log("Unknown video PTS for cc "+_.cc+", waiting for video PTS before demuxing audio frag "+_.sn+" of ["+z.startSN+" ,"+z.endSN+"],track "+j);var ve=this.waitingData=this.waitingData||{frag:_,part:y,cache:new d.default,complete:!1},Ae=ve.cache;Ae.push(new Uint8Array(v)),this.waitingVideoCC=this.videoTrackCC,this.state=R.State.WAITING_INIT_PTS}},p._handleFragmentLoadComplete=function(u){if(this.waitingData){this.waitingData.complete=!0;return}M.prototype._handleFragmentLoadComplete.call(this,u)},p.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},p.onBufferCreated=function(u,f){var _=f.tracks.audio;_&&(this.mediaBuffer=_.buffer),f.tracks.video&&(this.videoBuffer=f.tracks.video.buffer)},p.onFragBuffered=function(u,f){var _=f.frag,y=f.part;if(_.type!==b.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(_)){this.warn("Fragment "+_.sn+(y?" p: "+y.index:"")+" of level "+_.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}_.sn!=="initSegment"&&(this.fragPrevious=_,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(O.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(_,y)},p.onError=function(u,f){switch(f.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:case o.ErrorDetails.KEY_LOAD_ERROR:case o.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(b.PlaylistLevelType.AUDIO,f);break;case o.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case o.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==R.State.ERROR&&this.state!==R.State.STOPPED&&(this.state=f.fatal?R.State.ERROR:R.State.IDLE,this.warn(f.details+" while loading frag, switching to "+this.state+" state"));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(f.parent==="audio"&&(this.state===R.State.PARSING||this.state===R.State.PARSED)){var _=!0,y=this.getFwdBufferInfo(this.mediaBuffer,b.PlaylistLevelType.AUDIO);y&&y.len>.5&&(_=!this.reduceMaxBufferLength(y.len)),_&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,M.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},p.onBufferFlushed=function(u,f){var _=f.type;_===i.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},p._handleTransmuxComplete=function(u){var f,_="audio",y=this.hls,v=u.remuxResult,N=u.chunkMeta,j=this.getCurrentContext(N);if(!j){this.warn("The loading context changed while buffering fragment "+N.sn+" of level "+N.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(N.level);return}var U=j.frag,G=j.part,z=v.audio,L=v.text,V=v.id3,W=v.initSegment;if(this.fragContextChanged(U))return;if(this.state=R.State.PARSING,this.audioSwitch&&z&&this.completeAudioSwitch(),W!=null&&W.tracks&&(this._bufferInitSegment(W.tracks,U,N),y.trigger(O.Events.FRAG_PARSING_INIT_SEGMENT,{frag:U,id:_,tracks:W.tracks})),z){var $=z.startPTS,q=z.endPTS,fe=z.startDTS,se=z.endDTS;G&&(G.elementaryStreams[i.ElementaryStreamTypes.AUDIO]={startPTS:$,endPTS:q,startDTS:fe,endDTS:se}),U.setElementaryStreamInfo(i.ElementaryStreamTypes.AUDIO,$,q,fe,se),this.bufferFragmentData(z,U,G,N)}if(V!=null&&(f=V.samples)!==null&&f!==void 0&&f.length){var me=h({frag:U,id:_},V);y.trigger(O.Events.FRAG_PARSING_METADATA,me)}if(L){var ve=h({frag:U,id:_},L);y.trigger(O.Events.FRAG_PARSING_USERDATA,ve)}},p._bufferInitSegment=function(u,f,_){if(this.state!==R.State.PARSING)return;u.video&&delete u.video;var y=u.audio;if(!y)return;y.levelCodec=y.codec,y.id="audio",this.log("Init audio buffer, container:"+y.container+", codecs[parsed]=["+y.codec+"]"),this.hls.trigger(O.Events.BUFFER_CODECS,u);var v=y.initSegment;if(v!=null&&v.byteLength){var N={type:"audio",frag:f,part:null,chunkMeta:_,parent:f.type,data:v};this.hls.trigger(O.Events.BUFFER_APPENDING,N)}this.tick()},p.loadFragment=function(u,f,_){var y=this.fragmentTracker.getState(u);this.fragCurrent=u,(this.audioSwitch||y===m.FragmentState.NOT_LOADED||y===m.FragmentState.PARTIAL)&&(u.sn==="initSegment"?this._loadInitSegment(u):f.live&&!Object(F.isFiniteNumber)(this.initPTS[u.cc])?(this.log("Waiting for video PTS in continuity counter "+u.cc+" of live stream before loading audio fragment "+u.sn+" of level "+this.trackId),this.state=R.State.WAITING_INIT_PTS):(this.startFragRequested=!0,M.prototype.loadFragment.call(this,u,f,_)))},p.completeAudioSwitch=function(){var u=this.hls,f=this.media,_=this.trackId;f&&(this.log("Switching audio track : flushing all audio"),M.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,u.trigger(O.Events.AUDIO_TRACK_SWITCHED,{id:_})},E}(R.default);H.default=w},"./src/controller/audio-track-controller.ts":function(Y,H,P){"use strict";P.r(H);var F=P("./src/events.ts"),R=P("./src/errors.ts"),O=P("./src/controller/base-playlist-controller.ts"),D=P("./src/types/loader.ts");function m(c,r){for(var a=0;a<r.length;a++){var s=r[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(c,s.key,s)}}function T(c,r,a){return r&&m(c.prototype,r),a&&m(c,a),c}function b(c,r){c.prototype=Object.create(r.prototype),c.prototype.constructor=c,i(c,r)}function i(c,r){return i=Object.setPrototypeOf||function(s,o){return s.__proto__=o,s},i(c,r)}var d=function(c){b(r,c);function r(s){var o;return o=c.call(this,s,"[audio-track-controller]")||this,o.tracks=[],o.groupId=null,o.tracksInGroup=[],o.trackId=-1,o.trackName="",o.selectDefaultTrack=!0,o.registerListeners(),o}var a=r.prototype;return a.registerListeners=function(){var o=this.hls;o.on(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(F.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on(F.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.on(F.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.on(F.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var o=this.hls;o.off(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(F.Events.LEVEL_LOADING,this.onLevelLoading,this),o.off(F.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.off(F.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.off(F.Events.ERROR,this.onError,this)},a.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,c.prototype.destroy.call(this)},a.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},a.onManifestParsed=function(o,t){this.tracks=t.audioTracks||[]},a.onAudioTrackLoaded=function(o,t){var h=t.id,g=t.details,C=this.tracksInGroup[h];if(!C){this.warn("Invalid audio track id "+h);return}var A=C.details;C.details=t.details,this.log("audioTrack "+h+" loaded ["+g.startSN+"-"+g.endSN+"]"),h===this.trackId&&(this.retryCount=0,this.playlistLoaded(h,t,A))},a.onLevelLoading=function(o,t){this.switchLevel(t.level)},a.onLevelSwitching=function(o,t){this.switchLevel(t.level)},a.switchLevel=function(o){var t=this.hls.levels[o];if(!(t!=null&&t.audioGroupIds))return;var h=t.audioGroupIds[t.urlId];if(this.groupId!==h){this.groupId=h;var g=this.tracks.filter(function(A){return!h||A.groupId===h});this.selectDefaultTrack&&!g.some(function(A){return A.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=g;var C={audioTracks:g};this.log("Updating audio tracks, "+g.length+' track(s) found in "'+h+'" group-id'),this.hls.trigger(F.Events.AUDIO_TRACKS_UPDATED,C),this.selectInitialTrack()}},a.onError=function(o,t){if(c.prototype.onError.call(this,o,t),t.fatal||!t.context)return;t.context.type===D.PlaylistContextType.AUDIO_TRACK&&t.context.id===this.trackId&&t.context.groupId===this.groupId&&this.retryLoadingOrFail(t)},a.setAudioTrack=function(o){var t=this.tracksInGroup;if(o<0||o>=t.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var h=t[this.trackId];this.log("Now switching to audio-track index "+o);var g=t[o],C=g.id,A=g.groupId,w=A===void 0?"":A,M=g.name,E=g.type,p=g.url;if(this.trackId=o,this.trackName=M,this.selectDefaultTrack=!1,this.hls.trigger(F.Events.AUDIO_TRACK_SWITCHING,{id:C,groupId:w,name:M,type:E,url:p}),g.details&&!g.details.live)return;var l=this.switchParams(g.url,h==null?void 0:h.details);this.loadPlaylist(l)},a.selectInitialTrack=function(){var o=this.tracksInGroup;console.assert(o.length,"Initial audio track should be selected when tracks are known");var t=this.trackName,h=this.findTrackId(t)||this.findTrackId();h!==-1?this.setAudioTrack(h):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(F.Events.ERROR,{type:R.ErrorTypes.MEDIA_ERROR,details:R.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},a.findTrackId=function(o){for(var t=this.tracksInGroup,h=0;h<t.length;h++){var g=t[h];if((!this.selectDefaultTrack||g.default)&&(!o||o===g.name))return g.id}return-1},a.loadPlaylist=function(o){var t=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(t)){var h=t.id,g=t.groupId,C=t.url;if(o)try{C=o.addDirectives(C)}catch(A){this.warn("Could not construct new URL with HLS Delivery Directives: "+A)}this.log("loading audio-track playlist for id: "+h),this.clearTimer(),this.hls.trigger(F.Events.AUDIO_TRACK_LOADING,{url:C,id:h,groupId:g,deliveryDirectives:o||null})}},T(r,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(o){this.selectDefaultTrack=!1,this.setAudioTrack(o)}}]),r}(O.default);H.default=d},"./src/controller/base-playlist-controller.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"default",function(){return T});var F=P("./src/polyfills/number.ts"),R=P("./src/types/level.ts"),O=P("./src/controller/level-helper.ts"),D=P("./src/utils/logger.ts"),m=P("./src/errors.ts"),T=function(){function b(d,c){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=D.logger.log.bind(D.logger,c+":"),this.warn=D.logger.warn.bind(D.logger,c+":"),this.hls=d}var i=b.prototype;return i.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},i.onError=function(c,r){r.fatal&&r.type===m.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},i.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},i.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},i.stopLoad=function(){this.canLoad=!1,this.clearTimer()},i.switchParams=function(c,r){var a=r==null?void 0:r.renditionReports;if(a)for(var s=0;s<a.length;s++){var o=a[s],t=""+o.URI;if(t===c.substr(-t.length)){var h=parseInt(o["LAST-MSN"]),g=parseInt(o["LAST-PART"]);if(r&&this.hls.config.lowLatencyMode){var C=Math.min(r.age-r.partTarget,r.targetduration);g!==void 0&&C>r.partTarget&&(g+=1)}if(Object(F.isFiniteNumber)(h))return new R.HlsUrlParameters(h,Object(F.isFiniteNumber)(g)?g:void 0,R.HlsSkip.No)}}},i.loadPlaylist=function(c){},i.shouldLoadTrack=function(c){return this.canLoad&&c&&!!c.url&&(!c.details||c.details.live)},i.playlistLoaded=function(c,r,a){var s=this,o=r.details,t=r.stats,h=t.loading.end?Math.max(0,self.performance.now()-t.loading.end):0;if(o.advancedDateTime=Date.now()-h,o.live||a!=null&&a.live){if(o.reloaded(a),a&&this.log("live playlist "+c+" "+(o.advanced?"REFRESHED "+o.lastPartSn+"-"+o.lastPartIndex:"MISSED")),a&&o.fragments.length>0&&Object(O.mergeDetails)(a,o),!this.canLoad||!o.live)return;var g,C=void 0,A=void 0;if(o.canBlockReload&&o.endSN&&o.advanced){var w=this.hls.config.lowLatencyMode,M=o.lastPartSn,E=o.endSN,p=o.lastPartIndex,l=p!==-1,u=M===E,f=w?0:p;l?(C=u?E+1:M,A=u?f:p+1):C=E+1;var _=o.age,y=_+o.ageHeader,v=Math.min(y-o.partTarget,o.targetduration*1.5);if(v>0){if(a&&v>a.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+a.tuneInGoal+" to: "+v+" with playlist age: "+o.age),v=0;else{var N=Math.floor(v/o.targetduration);if(C+=N,A!==void 0){var j=Math.round(v%o.targetduration/o.partTarget);A+=j}this.log("CDN Tune-in age: "+o.ageHeader+"s last advanced "+_.toFixed(2)+"s goal: "+v+" skip sn "+N+" to part "+A)}o.tuneInGoal=v}if(g=this.getDeliveryDirectives(o,r.deliveryDirectives,C,A),w||!u){this.loadPlaylist(g);return}}else g=this.getDeliveryDirectives(o,r.deliveryDirectives,C,A);var U=Object(O.computeReloadInterval)(o,t);C!==void 0&&o.canBlockReload&&(U-=o.partTarget||1),this.log("reload live playlist "+c+" in "+Math.round(U)+" ms"),this.timer=self.setTimeout(function(){return s.loadPlaylist(g)},U)}else this.clearTimer()},i.getDeliveryDirectives=function(c,r,a,s){var o=Object(R.getSkipValue)(c,a);return r!=null&&r.skip&&c.deltaUpdateFailed&&(a=r.msn,s=r.part,o=R.HlsSkip.No),new R.HlsUrlParameters(a,s,o)},i.retryLoadingOrFail=function(c){var r=this,a=this.hls.config,s=this.retryCount<a.levelLoadingMaxRetry;if(s){var o;if(this.retryCount++,c.details.indexOf("LoadTimeOut")>-1&&(o=c.context)!==null&&o!==void 0&&o.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+c.details+'"'),this.loadPlaylist();else{var t=Math.min(Math.pow(2,this.retryCount)*a.levelLoadingRetryDelay,a.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return r.loadPlaylist()},t),this.warn("retry playlist loading #"+this.retryCount+" in "+t+' ms after "'+c.details+'"')}}else this.warn('cannot recover from error "'+c.details+'"'),this.clearTimer(),c.fatal=!0;return s},b}()},"./src/controller/base-stream-controller.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"State",function(){return E}),P.d(H,"default",function(){return p});var F=P("./src/polyfills/number.ts"),R=P("./src/task-loop.ts"),O=P("./src/controller/fragment-tracker.ts"),D=P("./src/utils/buffer-helper.ts"),m=P("./src/utils/logger.ts"),T=P("./src/events.ts"),b=P("./src/errors.ts"),i=P("./src/types/transmuxer.ts"),d=P("./src/utils/mp4-tools.ts"),c=P("./src/utils/discontinuities.ts"),r=P("./src/controller/fragment-finders.ts"),a=P("./src/controller/level-helper.ts"),s=P("./src/loader/fragment-loader.ts"),o=P("./src/crypt/decrypter.ts"),t=P("./src/utils/time-ranges.ts"),h=P("./src/types/loader.ts");function g(l,u){for(var f=0;f<u.length;f++){var _=u[f];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(l,_.key,_)}}function C(l,u,f){return u&&g(l.prototype,u),f&&g(l,f),l}function A(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l}function w(l,u){l.prototype=Object.create(u.prototype),l.prototype.constructor=l,M(l,u)}function M(l,u){return M=Object.setPrototypeOf||function(_,y){return _.__proto__=y,_},M(l,u)}var E={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"},p=function(l){w(u,l);function u(_,y,v){var N;return N=l.call(this)||this,N.hls=void 0,N.fragPrevious=null,N.fragCurrent=null,N.fragmentTracker=void 0,N.transmuxer=null,N._state=E.STOPPED,N.media=void 0,N.mediaBuffer=void 0,N.config=void 0,N.bitrateTest=!1,N.lastCurrentTime=0,N.nextLoadPosition=0,N.startPosition=0,N.loadedmetadata=!1,N.fragLoadError=0,N.retryDate=0,N.levels=null,N.fragmentLoader=void 0,N.levelLastLoaded=null,N.startFragRequested=!1,N.decrypter=void 0,N.initPTS=[],N.onvseeking=null,N.onvended=null,N.logPrefix="",N.log=void 0,N.warn=void 0,N.logPrefix=v,N.log=m.logger.log.bind(m.logger,v+":"),N.warn=m.logger.warn.bind(m.logger,v+":"),N.hls=_,N.fragmentLoader=new s.default(_.config),N.fragmentTracker=y,N.config=_.config,N.decrypter=new o.default(_,_.config),_.on(T.Events.KEY_LOADED,N.onKeyLoaded,A(N)),N}var f=u.prototype;return f.doTick=function(){this.onTickEnd()},f.onTickEnd=function(){},f.startLoad=function(y){},f.stopLoad=function(){this.fragmentLoader.abort();var y=this.fragCurrent;y&&this.fragmentTracker.removeFragment(y),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=E.STOPPED},f._streamEnded=function(y,v){var N=this.fragCurrent,j=this.fragmentTracker;if(!v.live&&N&&N.sn===v.endSN&&!y.nextStart){var U=j.getState(N);return U===O.FragmentState.PARTIAL||U===O.FragmentState.OK}return!1},f.onMediaAttached=function(y,v){var N=this.media=this.mediaBuffer=v.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),N.addEventListener("seeking",this.onvseeking),N.addEventListener("ended",this.onvended);var j=this.config;this.levels&&j.autoStartLoad&&this.state===E.STOPPED&&this.startLoad(j.startPosition)},f.onMediaDetaching=function(){var y=this.media;y!=null&&y.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),y&&(y.removeEventListener("seeking",this.onvseeking),y.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},f.onMediaSeeking=function(){var y=this.config,v=this.fragCurrent,N=this.media,j=this.mediaBuffer,U=this.state,G=N?N.currentTime:0,z=D.BufferHelper.bufferInfo(j||N,G,y.maxBufferHole);if(this.log("media seeking to "+(Object(F.isFiniteNumber)(G)?G.toFixed(3):G)+", state: "+U),U===E.ENDED)this.resetLoadingState();else if(v&&!z.len){var L=y.maxFragLookUpTolerance,V=v.start-L,W=v.start+v.duration+L,$=G>W;(G<V||$)&&($&&v.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),v.loader.abort()),this.resetLoadingState())}N&&(this.lastCurrentTime=G),!this.loadedmetadata&&!z.len&&(this.nextLoadPosition=this.startPosition=G),this.tickImmediate()},f.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},f.onKeyLoaded=function(y,v){if(this.state!==E.KEY_LOADING||v.frag!==this.fragCurrent||!this.levels)return;this.state=E.IDLE;var N=this.levels[v.frag.level].details;N&&this.loadFragment(v.frag,N,v.frag.start)},f.onHandlerDestroying=function(){this.stopLoad(),l.prototype.onHandlerDestroying.call(this)},f.onHandlerDestroyed=function(){this.state=E.STOPPED,this.hls.off(T.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,l.prototype.onHandlerDestroyed.call(this)},f.loadKey=function(y,v){this.log("Loading key for "+y.sn+" of ["+v.startSN+"-"+v.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level),this.state=E.KEY_LOADING,this.fragCurrent=y,this.hls.trigger(T.Events.KEY_LOADING,{frag:y})},f.loadFragment=function(y,v,N){this._loadFragForPlayback(y,v,N)},f._loadFragForPlayback=function(y,v,N){var j=this,U=function(z){if(j.fragContextChanged(y)){j.warn("Fragment "+y.sn+(z.part?" p: "+z.part.index:"")+" of level "+y.level+" was dropped during download."),j.fragmentTracker.removeFragment(y);return}y.stats.chunkCount++,j._handleFragmentLoadProgress(z)};this._doFragLoad(y,v,N,U).then(function(G){if(!G)return;j.fragLoadError=0;var z=j.state;if(j.fragContextChanged(y)){(z===E.FRAG_LOADING||z===E.BACKTRACKING||!j.fragCurrent&&z===E.PARSING)&&(j.fragmentTracker.removeFragment(y),j.state=E.IDLE);return}if("payload"in G&&(j.log("Loaded fragment "+y.sn+" of level "+y.level),j.hls.trigger(T.Events.FRAG_LOADED,G),j.state===E.BACKTRACKING)){j.fragmentTracker.backtrack(y,G),j.resetFragmentLoading(y);return}j._handleFragmentLoadComplete(G)}).catch(function(G){j.warn(G),j.resetFragmentLoading(y)})},f.flushMainBuffer=function(y,v,N){if(N===void 0&&(N=null),!(y-v))return;var j={startOffset:y,endOffset:v,type:N};this.fragLoadError=0,this.hls.trigger(T.Events.BUFFER_FLUSHING,j)},f._loadInitSegment=function(y){var v=this;this._doFragLoad(y).then(function(N){if(!N||v.fragContextChanged(y)||!v.levels)throw new Error("init load aborted");return N}).then(function(N){var j=v.hls,U=N.payload,G=y.decryptdata;if(U&&U.byteLength>0&&G&&G.key&&G.iv&&G.method==="AES-128"){var z=self.performance.now();return v.decrypter.webCryptoDecrypt(new Uint8Array(U),G.key.buffer,G.iv.buffer).then(function(L){var V=self.performance.now();return j.trigger(T.Events.FRAG_DECRYPTED,{frag:y,payload:L,stats:{tstart:z,tdecrypt:V}}),N.payload=L,N})}return N}).then(function(N){var j=v.fragCurrent,U=v.hls,G=v.levels;if(!G)throw new Error("init load aborted, missing levels");var z=G[y.level].details;console.assert(z,"Level details are defined when init segment is loaded");var L=y.stats;v.state=E.IDLE,v.fragLoadError=0,y.data=new Uint8Array(N.payload),L.parsing.start=L.buffering.start=self.performance.now(),L.parsing.end=L.buffering.end=self.performance.now(),N.frag===j&&U.trigger(T.Events.FRAG_BUFFERED,{stats:L,frag:j,part:null,id:y.type}),v.tick()}).catch(function(N){v.warn(N),v.resetFragmentLoading(y)})},f.fragContextChanged=function(y){var v=this.fragCurrent;return!y||!v||y.level!==v.level||y.sn!==v.sn||y.urlId!==v.urlId},f.fragBufferedComplete=function(y,v){var N=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+y.type+" sn: "+y.sn+(v?" part: "+v.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level+" "+t.default.toString(D.BufferHelper.getBuffered(N))),this.state=E.IDLE,this.tick()},f._handleFragmentLoadComplete=function(y){var v=this.transmuxer;if(!v)return;var N=y.frag,j=y.part,U=y.partsLoaded,G=!U||U.length===0||U.some(function(L){return!L}),z=new i.ChunkMetadata(N.level,N.sn,N.stats.chunkCount+1,0,j?j.index:-1,!G);v.flush(z)},f._handleFragmentLoadProgress=function(y){},f._doFragLoad=function(y,v,N,j){var U=this;if(N===void 0&&(N=null),!this.levels)throw new Error("frag load aborted, missing levels");if(N=Math.max(y.start,N||0),this.config.lowLatencyMode&&v){var G=v.partList;if(G&&j){N>y.end&&v.fragmentHint&&(y=v.fragmentHint);var z=this.getNextPart(G,y,N);if(z>-1){var L=G[z];return this.log("Loading part sn: "+y.sn+" p: "+L.index+" cc: "+y.cc+" of playlist ["+v.startSN+"-"+v.endSN+"] parts [0-"+z+"-"+(G.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(N.toFixed(3))),this.nextLoadPosition=L.start+L.duration,this.state=E.FRAG_LOADING,this.hls.trigger(T.Events.FRAG_LOADING,{frag:y,part:G[z],targetBufferTime:N}),this.doFragPartsLoad(y,G,z,j).catch(function(V){return U.handleFragLoadError(V)})}else if(!y.url||this.loadedEndOfParts(G,N))return Promise.resolve(null)}}return this.log("Loading fragment "+y.sn+" cc: "+y.cc+" "+(v?"of ["+v.startSN+"-"+v.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(N.toFixed(3))),Object(F.isFiniteNumber)(y.sn)&&!this.bitrateTest&&(this.nextLoadPosition=y.start+y.duration),this.state=E.FRAG_LOADING,this.hls.trigger(T.Events.FRAG_LOADING,{frag:y,targetBufferTime:N}),this.fragmentLoader.load(y,j).catch(function(V){return U.handleFragLoadError(V)})},f.doFragPartsLoad=function(y,v,N,j){var U=this;return new Promise(function(G,z){var L=[],V=function W($){var q=v[$];U.fragmentLoader.loadPart(y,q,j).then(function(fe){L[q.index]=fe;var se=fe.part;U.hls.trigger(T.Events.FRAG_LOADED,fe);var me=v[$+1];if(me&&me.fragment===y)W($+1);else return G({frag:y,part:se,partsLoaded:L})}).catch(z)};V(N)})},f.handleFragLoadError=function(y){var v=y.data;return v&&v.details===b.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(v.frag,v.part):this.hls.trigger(T.Events.ERROR,v),null},f._handleTransmuxerFlush=function(y){var v=this.getCurrentContext(y);if(!v||this.state!==E.PARSING){this.fragCurrent||(this.state=E.IDLE);return}var N=v.frag,j=v.part,U=v.level,G=self.performance.now();N.stats.parsing.end=G,j&&(j.stats.parsing.end=G),this.updateLevelTiming(N,j,U,y.partial)},f.getCurrentContext=function(y){var v=this.levels,N=y.level,j=y.sn,U=y.part;if(!v||!v[N])return this.warn("Levels object was unset while buffering fragment "+j+" of level "+N+". The current chunk will not be buffered."),null;var G=v[N],z=U>-1?Object(a.getPartWith)(G,j,U):null,L=z?z.fragment:Object(a.getFragmentWithSN)(G,j,this.fragCurrent);return L?{frag:L,part:z,level:G}:null},f.bufferFragmentData=function(y,v,N,j){if(!y||this.state!==E.PARSING)return;var U=y.data1,G=y.data2,z=U;if(U&&G&&(z=Object(d.appendUint8Array)(U,G)),!z||!z.length)return;var L={type:y.type,frag:v,part:N,chunkMeta:j,parent:v.type,data:z};this.hls.trigger(T.Events.BUFFER_APPENDING,L),y.dropped&&y.independent&&!N&&this.flushBufferGap(v)},f.flushBufferGap=function(y){var v=this.media;if(!v)return;if(!D.BufferHelper.isBuffered(v,v.currentTime)){this.flushMainBuffer(0,y.start);return}var N=v.currentTime,j=D.BufferHelper.bufferInfo(v,N,0),U=y.duration,G=Math.min(this.config.maxFragLookUpTolerance*2,U*.25),z=Math.max(Math.min(y.start-G,j.end-G),N+G);y.start-z>G&&this.flushMainBuffer(z,y.start)},f.getFwdBufferInfo=function(y,v){var N=this.config,j=this.getLoadPosition();if(!Object(F.isFiniteNumber)(j))return null;var U=D.BufferHelper.bufferInfo(y,j,N.maxBufferHole);if(U.len===0&&U.nextStart!==void 0){var G=this.fragmentTracker.getBufferedFrag(j,v);if(G&&U.nextStart<G.end)return D.BufferHelper.bufferInfo(y,j,Math.max(U.nextStart,N.maxBufferHole))}return U},f.getMaxBufferLength=function(y){var v=this.config,N;return y?N=Math.max(8*v.maxBufferSize/y,v.maxBufferLength):N=v.maxBufferLength,Math.min(N,v.maxMaxBufferLength)},f.reduceMaxBufferLength=function(y){var v=this.config,N=y||v.maxBufferLength;return v.maxMaxBufferLength>=N?(v.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+v.maxMaxBufferLength+"s"),!0):!1},f.getNextFragment=function(y,v){var N,j,U=v.fragments,G=U.length;if(!G)return null;var z=this.config,L=U[0].start,V;if(v.live){var W=z.initialLiveManifestSize;if(G<W)return this.warn("Not enough fragments to start playback (have: "+G+", need: "+W+")"),null;!v.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(V=this.getInitialLiveFragment(v,U),this.startPosition=V?this.hls.liveSyncPosition||V.start:y)}else y<=L&&(V=U[0]);if(!V){var $=z.lowLatencyMode?v.partEnd:v.fragmentEnd;V=this.getFragmentAtPosition(y,$,v)}return(N=V)!==null&&N!==void 0&&N.initSegment&&!((j=V)!==null&&j!==void 0&&j.initSegment.data)&&!this.bitrateTest&&(V=V.initSegment),V},f.getNextPart=function(y,v,N){for(var j=-1,U=!1,G=!0,z=0,L=y.length;z<L;z++){var V=y[z];if(G=G&&!V.independent,j>-1&&N<V.start)break;var W=V.loaded;!W&&(U||V.independent||G)&&V.fragment===v&&(j=z),U=W}return j},f.loadedEndOfParts=function(y,v){var N=y[y.length-1];return N&&v>N.start&&N.loaded},f.getInitialLiveFragment=function(y,v){var N=this.fragPrevious,j=null;if(N){if(y.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+N.programDateTime),j=Object(r.findFragmentByPDT)(v,N.endProgramDateTime,this.config.maxFragLookUpTolerance)),!j){var U=N.sn+1;if(U>=y.startSN&&U<=y.endSN){var G=v[U-y.startSN];N.cc===G.cc&&(j=G,this.log("Live playlist, switching playlist, load frag with next SN: "+j.sn))}j||(j=Object(r.findFragWithCC)(v,N.cc),j&&this.log("Live playlist, switching playlist, load frag with same CC: "+j.sn))}}else{var z=this.hls.liveSyncPosition;z!==null&&(j=this.getFragmentAtPosition(z,this.bitrateTest?y.fragmentEnd:y.edge,y))}return j},f.getFragmentAtPosition=function(y,v,N){var j=this.config,U=this.fragPrevious,G=N.fragments,z=N.endSN,L=N.fragmentHint,V=j.maxFragLookUpTolerance,W=!!(j.lowLatencyMode&&N.partList&&L);W&&L&&!this.bitrateTest&&(G=G.concat(L),z=L.sn);var $;if(y<v){var q=y>v-V?0:V;$=Object(r.findFragmentByPTS)(U,G,y,q)}else $=G[G.length-1];if($){var fe=$.sn-N.startSN,se=U&&$.level===U.level,me=G[fe+1],ve=this.fragmentTracker.getState($);if(ve===O.FragmentState.BACKTRACKED){$=null;for(var Ae=fe;G[Ae]&&this.fragmentTracker.getState(G[Ae])===O.FragmentState.BACKTRACKED;)U?$=G[Ae--]:$=G[--Ae];$||($=me)}else U&&$.sn===U.sn&&!W&&(se&&($.sn<z&&this.fragmentTracker.getState(me)!==O.FragmentState.OK?(this.log("SN "+$.sn+" just loaded, load next one: "+me.sn),$=me):$=null))}return $},f.synchronizeToLiveEdge=function(y){var v=this.config,N=this.media;if(!N)return;var j=this.hls.liveSyncPosition,U=N.currentTime,G=y.fragments[0].start,z=y.edge,L=U>=G-v.maxFragLookUpTolerance&&U<=z;if(j!==null&&N.duration>j&&(U<j||!L)){var V=v.liveMaxLatencyDuration!==void 0?v.liveMaxLatencyDuration:v.liveMaxLatencyDurationCount*y.targetduration;(!L&&N.readyState<4||U<z-V)&&(this.loadedmetadata||(this.nextLoadPosition=j),N.readyState&&(this.warn("Playback: "+U.toFixed(3)+" is located too far from the end of live sliding playlist: "+z+", reset currentTime to : "+j.toFixed(3)),N.currentTime=j))}},f.alignPlaylists=function(y,v){var N=this.levels,j=this.levelLastLoaded,U=this.fragPrevious,G=j!==null?N[j]:null,z=y.fragments.length;if(!z)return this.warn("No fragments in live playlist"),0;var L=y.fragments[0].start,V=!v,W=y.alignedSliding&&Object(F.isFiniteNumber)(L);if(V||!W&&!L){Object(c.alignStream)(U,G,y);var $=y.fragments[0].start;return this.log("Live playlist sliding: "+$.toFixed(2)+" start-sn: "+(v?v.startSN:"na")+"->"+y.startSN+" prev-sn: "+(U?U.sn:"na")+" fragments: "+z),$}return L},f.waitForCdnTuneIn=function(y){var v=3;return y.live&&y.canBlockReload&&y.tuneInGoal>Math.max(y.partHoldBack,y.partTarget*v)},f.setStartPosition=function(y,v){var N=this.startPosition;if(N<v&&(N=-1),N===-1||this.lastCurrentTime===-1){var j=y.startTimeOffset;Object(F.isFiniteNumber)(j)?(N=v+j,j<0&&(N+=y.totalduration),N=Math.min(Math.max(v,N),v+y.totalduration),this.log("Start time offset "+j+" found in playlist, adjust startPosition to "+N),this.startPosition=N):y.live?N=this.hls.liveSyncPosition||v:this.startPosition=N=0,this.lastCurrentTime=N}this.nextLoadPosition=N},f.getLoadPosition=function(){var y=this.media,v=0;return this.loadedmetadata&&y?v=y.currentTime:this.nextLoadPosition&&(v=this.nextLoadPosition),v},f.handleFragLoadAborted=function(y,v){this.transmuxer&&y.sn!=="initSegment"&&y.stats.aborted&&(this.warn("Fragment "+y.sn+(v?" part"+v.index:"")+" of level "+y.level+" was aborted"),this.resetFragmentLoading(y))},f.resetFragmentLoading=function(y){(!this.fragCurrent||!this.fragContextChanged(y))&&(this.state=E.IDLE)},f.onFragmentOrKeyLoadError=function(y,v){if(v.fatal)return;var N=v.frag;if(!N||N.type!==y)return;var j=this.fragCurrent;console.assert(j&&N.sn===j.sn&&N.level===j.level&&N.urlId===j.urlId,"Frag load error must match current frag to retry");var U=this.config;if(this.fragLoadError+1<=U.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(N.level))return;var G=Math.min(Math.pow(2,this.fragLoadError)*U.fragLoadingRetryDelay,U.fragLoadingMaxRetryTimeout);this.warn("Fragment "+N.sn+" of "+y+" "+N.level+" failed to load, retrying in "+G+"ms"),this.retryDate=self.performance.now()+G,this.fragLoadError++,this.state=E.FRAG_LOADING_WAITING_RETRY}else v.levelRetry?(y===h.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=E.IDLE):(m.logger.error(v.details+" reaches max retry, redispatch as fatal ..."),v.fatal=!0,this.hls.stopLoad(),this.state=E.ERROR)},f.afterBufferFlushed=function(y,v,N){if(!y)return;var j=D.BufferHelper.getBuffered(y);this.fragmentTracker.detectEvictedFragments(v,j,N),this.state===E.ENDED&&this.resetLoadingState()},f.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=E.IDLE},f.resetLiveStartWhenNotLoaded=function(y){if(!this.loadedmetadata){this.startFragRequested=!1;var v=this.levels?this.levels[y].details:null;if(v!=null&&v.live)return this.startPosition=-1,this.setStartPosition(v,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},f.updateLevelTiming=function(y,v,N,j){var U=this,G=N.details;console.assert(!!G,"level.details must be defined");var z=Object.keys(y.elementaryStreams).reduce(function(L,V){var W=y.elementaryStreams[V];if(W){var $=W.endPTS-W.startPTS;if($<=0)return U.warn("Could not parse fragment "+y.sn+" "+V+" duration reliably ("+$+") resetting transmuxer to fallback to playlist timing"),U.resetTransmuxer(),L||!1;var q=j?0:Object(a.updateFragPTSDTS)(G,y,W.startPTS,W.endPTS,W.startDTS,W.endDTS);return U.hls.trigger(T.Events.LEVEL_PTS_UPDATED,{details:G,level:N,drift:q,type:V,frag:y,start:W.startPTS,end:W.endPTS}),!0}return L},!1);z?(this.state=E.PARSED,this.hls.trigger(T.Events.FRAG_PARSED,{frag:y,part:v})):this.resetLoadingState()},f.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},C(u,[{key:"state",get:function(){return this._state},set:function(y){var v=this._state;v!==y&&(this._state=y,this.log(v+"->"+y))}}]),u}(R.default)},"./src/controller/buffer-controller.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"default",function(){return r});var F=P("./src/polyfills/number.ts"),R=P("./src/events.ts"),O=P("./src/utils/logger.ts"),D=P("./src/errors.ts"),m=P("./src/utils/buffer-helper.ts"),T=P("./src/utils/mediasource-helper.ts"),b=P("./src/loader/fragment.ts"),i=P("./src/controller/buffer-operation-queue.ts"),d=Object(T.getMediaSource)(),c=/([ha]vc.)(?:\.[^.,]+)+/,r=function(){function a(o){var t=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var h=t.hls,g=t.media,C=t.mediaSource;O.logger.log("[buffer-controller]: Media source opened"),g&&(t.updateMediaElementDuration(),h.trigger(R.Events.MEDIA_ATTACHED,{media:g})),C&&C.removeEventListener("sourceopen",t._onMediaSourceOpen),t.checkPendingTracks()},this._onMediaSourceClose=function(){O.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){O.logger.log("[buffer-controller]: Media source ended")},this.hls=o,this._initSourceBuffer(),this.registerListeners()}var s=a.prototype;return s.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},s.destroy=function(){this.unregisterListeners(),this.details=null},s.registerListeners=function(){var t=this.hls;t.on(R.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(R.Events.BUFFER_RESET,this.onBufferReset,this),t.on(R.Events.BUFFER_APPENDING,this.onBufferAppending,this),t.on(R.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.on(R.Events.BUFFER_EOS,this.onBufferEos,this),t.on(R.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(R.Events.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(R.Events.FRAG_PARSED,this.onFragParsed,this),t.on(R.Events.FRAG_CHANGED,this.onFragChanged,this)},s.unregisterListeners=function(){var t=this.hls;t.off(R.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(R.Events.BUFFER_RESET,this.onBufferReset,this),t.off(R.Events.BUFFER_APPENDING,this.onBufferAppending,this),t.off(R.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.off(R.Events.BUFFER_EOS,this.onBufferEos,this),t.off(R.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(R.Events.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(R.Events.FRAG_PARSED,this.onFragParsed,this),t.off(R.Events.FRAG_CHANGED,this.onFragChanged,this)},s._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new i.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},s.onManifestParsed=function(t,h){var g=2;(h.audio&&!h.video||!h.altAudio)&&(g=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=g,this.details=null,O.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},s.onMediaAttaching=function(t,h){var g=this.media=h.media;if(g&&d){var C=this.mediaSource=new d;C.addEventListener("sourceopen",this._onMediaSourceOpen),C.addEventListener("sourceended",this._onMediaSourceEnded),C.addEventListener("sourceclose",this._onMediaSourceClose),g.src=self.URL.createObjectURL(C),this._objectUrl=g.src}},s.onMediaDetaching=function(){var t=this.media,h=this.mediaSource,g=this._objectUrl;if(h){if(O.logger.log("[buffer-controller]: media source detaching"),h.readyState==="open")try{h.endOfStream()}catch(C){O.logger.warn("[buffer-controller]: onMediaDetaching: "+C.message+" while calling endOfStream")}this.onBufferReset(),h.removeEventListener("sourceopen",this._onMediaSourceOpen),h.removeEventListener("sourceended",this._onMediaSourceEnded),h.removeEventListener("sourceclose",this._onMediaSourceClose),t&&(g&&self.URL.revokeObjectURL(g),t.src===g?(t.removeAttribute("src"),t.load()):O.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(R.Events.MEDIA_DETACHED,void 0)},s.onBufferReset=function(){var t=this;this.getSourceBufferTypes().forEach(function(h){var g=t.sourceBuffer[h];try{g&&(t.removeBufferListeners(h),t.mediaSource&&t.mediaSource.removeSourceBuffer(g),t.sourceBuffer[h]=void 0)}catch(C){O.logger.warn("[buffer-controller]: Failed to reset the "+h+" buffer",C)}}),this._initSourceBuffer()},s.onBufferCodecs=function(t,h){var g=this,C=this.getSourceBufferTypes().length;if(Object.keys(h).forEach(function(A){if(C){var w=g.tracks[A];if(w&&typeof w.buffer.changeType=="function"){var M=h[A],E=M.codec,p=M.levelCodec,l=M.container,u=(w.levelCodec||w.codec).replace(c,"$1"),f=(p||E).replace(c,"$1");if(u!==f){var _=l+";codecs="+(p||E);g.appendChangeType(A,_)}}}else g.pendingTracks[A]=h[A]}),C)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},s.appendChangeType=function(t,h){var g=this,C=this.operationQueue,A={execute:function(){var M=g.sourceBuffer[t];M&&(O.logger.log("[buffer-controller]: changing "+t+" sourceBuffer type to "+h),M.changeType(h)),C.shiftAndExecuteNext(t)},onStart:function(){},onComplete:function(){},onError:function(M){O.logger.warn("[buffer-controller]: Failed to change "+t+" SourceBuffer type",M)}};C.append(A,t)},s.onBufferAppending=function(t,h){var g=this,C=this.hls,A=this.operationQueue,w=this.tracks,M=h.data,E=h.type,p=h.frag,l=h.part,u=h.chunkMeta,f=u.buffering[E],_=self.performance.now();f.start=_;var y=p.stats.buffering,v=l?l.stats.buffering:null;y.start===0&&(y.start=_),v&&v.start===0&&(v.start=_);var N=w.audio,j=E==="audio"&&u.id===1&&(N==null?void 0:N.container)==="audio/mpeg",U={execute:function(){if(f.executeStart=self.performance.now(),j){var z=g.sourceBuffer[E];if(z){var L=p.start-z.timestampOffset;Math.abs(L)>=.1&&(O.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+p.start+" (delta: "+L+") sn: "+p.sn+")"),z.timestampOffset=p.start)}}g.appendExecutor(M,E)},onStart:function(){},onComplete:function(){var z=self.performance.now();f.executeEnd=f.end=z,y.first===0&&(y.first=z),v&&v.first===0&&(v.first=z);var L=g.sourceBuffer,V={};for(var W in L)V[W]=m.BufferHelper.getBuffered(L[W]);g.appendError=0,g.hls.trigger(R.Events.BUFFER_APPENDED,{type:E,frag:p,part:l,chunkMeta:u,parent:p.type,timeRanges:V})},onError:function(z){O.logger.error("[buffer-controller]: Error encountered while trying to append to the "+E+" SourceBuffer",z);var L={type:D.ErrorTypes.MEDIA_ERROR,parent:p.type,details:D.ErrorDetails.BUFFER_APPEND_ERROR,err:z,fatal:!1};z.code===DOMException.QUOTA_EXCEEDED_ERR?L.details=D.ErrorDetails.BUFFER_FULL_ERROR:(g.appendError++,L.details=D.ErrorDetails.BUFFER_APPEND_ERROR,g.appendError>C.config.appendErrorMaxRetry&&(O.logger.error("[buffer-controller]: Failed "+C.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),L.fatal=!0)),C.trigger(R.Events.ERROR,L)}};A.append(U,E)},s.onBufferFlushing=function(t,h){var g=this,C=this.operationQueue,A=function(M){return{execute:g.removeExecutor.bind(g,M,h.startOffset,h.endOffset),onStart:function(){},onComplete:function(){g.hls.trigger(R.Events.BUFFER_FLUSHED,{type:M})},onError:function(p){O.logger.warn("[buffer-controller]: Failed to remove from "+M+" SourceBuffer",p)}}};h.type?C.append(A(h.type),h.type):this.getSourceBufferTypes().forEach(function(w){C.append(A(w),w)})},s.onFragParsed=function(t,h){var g=this,C=h.frag,A=h.part,w=[],M=A?A.elementaryStreams:C.elementaryStreams;M[b.ElementaryStreamTypes.AUDIOVIDEO]?w.push("audiovideo"):(M[b.ElementaryStreamTypes.AUDIO]&&w.push("audio"),M[b.ElementaryStreamTypes.VIDEO]&&w.push("video"));var E=function(){var l=self.performance.now();C.stats.buffering.end=l,A&&(A.stats.buffering.end=l);var u=A?A.stats:C.stats;g.hls.trigger(R.Events.FRAG_BUFFERED,{frag:C,part:A,stats:u,id:C.type})};w.length===0&&O.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+C.type+" level: "+C.level+" sn: "+C.sn),this.blockBuffers(E,w)},s.onFragChanged=function(t,h){this.flushBackBuffer()},s.onBufferEos=function(t,h){var g=this,C=this.getSourceBufferTypes().reduce(function(A,w){var M=g.sourceBuffer[w];return(!h.type||h.type===w)&&(M&&!M.ended&&(M.ended=!0,O.logger.log("[buffer-controller]: "+w+" sourceBuffer now EOS"))),A&&!!(!M||M.ended)},!0);C&&this.blockBuffers(function(){var A=g.mediaSource;if(!A||A.readyState!=="open")return;A.endOfStream()})},s.onLevelUpdated=function(t,h){var g=h.details;if(!g.fragments.length)return;this.details=g,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},s.flushBackBuffer=function(){var t=this.hls,h=this.details,g=this.media,C=this.sourceBuffer;if(!g||h===null)return;var A=this.getSourceBufferTypes();if(!A.length)return;var w=h.live&&t.config.liveBackBufferLength!==null?t.config.liveBackBufferLength:t.config.backBufferLength;if(!Object(F.isFiniteNumber)(w)||w<0)return;var M=g.currentTime,E=h.levelTargetDuration,p=Math.max(w,E),l=Math.floor(M/E)*E-p;A.forEach(function(u){var f=C[u];if(f){var _=m.BufferHelper.getBuffered(f);_.length>0&&l>_.start(0)&&(t.trigger(R.Events.BACK_BUFFER_REACHED,{bufferEnd:l}),h.live&&t.trigger(R.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:l}),t.trigger(R.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:l,type:u}))}})},s.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var t=this.details,h=this.hls,g=this.media,C=this.mediaSource,A=t.fragments[0].start+t.totalduration,w=g.duration,M=Object(F.isFiniteNumber)(C.duration)?C.duration:0;t.live&&h.config.liveDurationInfinity?(O.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),C.duration=Infinity,this.updateSeekableRange(t)):(A>M&&A>w||!Object(F.isFiniteNumber)(w))&&(O.logger.log("[buffer-controller]: Updating Media Source duration to "+A.toFixed(3)),C.duration=A)},s.updateSeekableRange=function(t){var h=this.mediaSource,g=t.fragments,C=g.length;if(C&&t.live&&h!==null&&h!==void 0&&h.setLiveSeekableRange){var A=Math.max(0,g[0].start),w=Math.max(A,A+t.totalduration);h.setLiveSeekableRange(A,w)}},s.checkPendingTracks=function(){var t=this.bufferCodecEventsExpected,h=this.operationQueue,g=this.pendingTracks,C=Object.keys(g).length;if(C&&!t||C===2){this.createSourceBuffers(g),this.pendingTracks={};var A=this.getSourceBufferTypes();if(A.length===0){this.hls.trigger(R.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}A.forEach(function(w){h.executeNext(w)})}},s.createSourceBuffers=function(t){var h=this.sourceBuffer,g=this.mediaSource;if(!g)throw Error("createSourceBuffers called when mediaSource was null");var C=0;for(var A in t)if(!h[A]){var w=t[A];if(!w)throw Error("source buffer exists for track "+A+", however track does not");var M=w.levelCodec||w.codec,E=w.container+";codecs="+M;O.logger.log("[buffer-controller]: creating sourceBuffer("+E+")");try{var p=h[A]=g.addSourceBuffer(E),l=A;this.addBufferListener(l,"updatestart",this._onSBUpdateStart),this.addBufferListener(l,"updateend",this._onSBUpdateEnd),this.addBufferListener(l,"error",this._onSBUpdateError),this.tracks[A]={buffer:p,codec:M,container:w.container,levelCodec:w.levelCodec,id:w.id},C++}catch(u){O.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+u.message),this.hls.trigger(R.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:u,mimeType:E})}}C&&this.hls.trigger(R.Events.BUFFER_CREATED,{tracks:this.tracks})},s._onSBUpdateStart=function(t){var h=this.operationQueue,g=h.current(t);g.onStart()},s._onSBUpdateEnd=function(t){var h=this.operationQueue,g=h.current(t);g.onComplete(),h.shiftAndExecuteNext(t)},s._onSBUpdateError=function(t,h){O.logger.error("[buffer-controller]: "+t+" SourceBuffer error",h),this.hls.trigger(R.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var g=this.operationQueue.current(t);g&&g.onError(h)},s.removeExecutor=function(t,h,g){var C=this.media,A=this.mediaSource,w=this.operationQueue,M=this.sourceBuffer,E=M[t];if(!C||!A||!E){O.logger.warn("[buffer-controller]: Attempting to remove from the "+t+" SourceBuffer, but it does not exist"),w.shiftAndExecuteNext(t);return}var p=Object(F.isFiniteNumber)(C.duration)?C.duration:Infinity,l=Object(F.isFiniteNumber)(A.duration)?A.duration:Infinity,u=Math.max(0,h),f=Math.min(g,p,l);f>u?(O.logger.log("[buffer-controller]: Removing ["+u+","+f+"] from the "+t+" SourceBuffer"),console.assert(!E.updating,t+" sourceBuffer must not be updating"),E.remove(u,f)):w.shiftAndExecuteNext(t)},s.appendExecutor=function(t,h){var g=this.operationQueue,C=this.sourceBuffer,A=C[h];if(!A){O.logger.warn("[buffer-controller]: Attempting to append to the "+h+" SourceBuffer, but it does not exist"),g.shiftAndExecuteNext(h);return}A.ended=!1,console.assert(!A.updating,h+" sourceBuffer must not be updating"),A.appendBuffer(t)},s.blockBuffers=function(t,h){var g=this;if(h===void 0&&(h=this.getSourceBufferTypes()),!h.length){O.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(t);return}var C=this.operationQueue,A=h.map(function(w){return C.appendBlocker(w)});Promise.all(A).then(function(){t(),h.forEach(function(w){var M=g.sourceBuffer[w];(!M||!M.updating)&&C.shiftAndExecuteNext(w)})})},s.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},s.addBufferListener=function(t,h,g){var C=this.sourceBuffer[t];if(!C)return;var A=g.bind(this,t);this.listeners[t].push({event:h,listener:A}),C.addEventListener(h,A)},s.removeBufferListeners=function(t){var h=this.sourceBuffer[t];if(!h)return;this.listeners[t].forEach(function(g){h.removeEventListener(g.event,g.listener)})},a}()},"./src/controller/buffer-operation-queue.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"default",function(){return R});var F=P("./src/utils/logger.ts"),R=function(){function O(m){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=m}var D=O.prototype;return D.append=function(T,b){var i=this.queues[b];i.push(T),i.length===1&&this.buffers[b]&&this.executeNext(b)},D.insertAbort=function(T,b){var i=this.queues[b];i.unshift(T),this.executeNext(b)},D.appendBlocker=function(T){var b,i=new Promise(function(c){b=c}),d={execute:b,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(d,T),i},D.executeNext=function(T){var b=this.buffers,i=this.queues,d=b[T],c=i[T];if(c.length){var r=c[0];try{r.execute()}catch(a){F.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),r.onError(a),(!d||!d.updating)&&(c.shift(),this.executeNext(T))}}},D.shiftAndExecuteNext=function(T){this.queues[T].shift(),this.executeNext(T)},D.current=function(T){return this.queues[T][0]},O}()},"./src/controller/cap-level-controller.ts":function(Y,H,P){"use strict";P.r(H);var F=P("./src/events.ts");function R(m,T){for(var b=0;b<T.length;b++){var i=T[b];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(m,i.key,i)}}function O(m,T,b){return T&&R(m.prototype,T),b&&R(m,b),m}var D=function(){function m(b){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=b,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var T=m.prototype;return T.setStreamController=function(i){this.streamController=i},T.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},T.registerListeners=function(){var i=this.hls;i.on(F.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),i.on(F.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.on(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(F.Events.BUFFER_CODECS,this.onBufferCodecs,this),i.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},T.unregisterListener=function(){var i=this.hls;i.off(F.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),i.off(F.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.off(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(F.Events.BUFFER_CODECS,this.onBufferCodecs,this),i.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},T.onFpsDropLevelCapping=function(i,d){m.isLevelAllowed(d.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(d.droppedLevel)},T.onMediaAttaching=function(i,d){this.media=d.media instanceof HTMLVideoElement?d.media:null},T.onManifestParsed=function(i,d){var c=this.hls;this.restrictedLevels=[],this.firstLevel=d.firstLevel,c.config.capLevelToPlayerSize&&d.video&&this.startCapping()},T.onBufferCodecs=function(i,d){var c=this.hls;c.config.capLevelToPlayerSize&&d.video&&this.startCapping()},T.onMediaDetaching=function(){this.stopCapping()},T.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var i=this.hls.levels;if(i.length){var d=this.hls;d.autoLevelCapping=this.getMaxLevel(i.length-1),d.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=d.autoLevelCapping}}},T.getMaxLevel=function(i){var d=this,c=this.hls.levels;if(!c.length)return-1;var r=c.filter(function(a,s){return m.isLevelAllowed(s,d.restrictedLevels)&&s<=i});return this.clientRect=null,m.getMaxLevelByMediaSize(r,this.mediaWidth,this.mediaHeight)},T.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()},T.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},T.getDimensions=function(){if(this.clientRect)return this.clientRect;var i=this.media,d={width:0,height:0};if(i){var c=i.getBoundingClientRect();d.width=c.width,d.height=c.height,!d.width&&!d.height&&(d.width=c.right-c.left||i.width||0,d.height=c.bottom-c.top||i.height||0)}return this.clientRect=d,d},m.isLevelAllowed=function(i,d){return d===void 0&&(d=[]),d.indexOf(i)===-1},m.getMaxLevelByMediaSize=function(i,d,c){if(!i||!i.length)return-1;for(var r=function(h,g){return g?h.width!==g.width||h.height!==g.height:!0},a=i.length-1,s=0;s<i.length;s+=1){var o=i[s];if((o.width>=d||o.height>=c)&&r(o,i[s+1])){a=s;break}}return a},O(m,[{key:"mediaWidth",get:function(){return this.getDimensions().width*m.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*m.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var i=1;try{i=self.devicePixelRatio}catch(d){}return i}}]),m}();H.default=D},"./src/controller/cmcd-controller.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"default",function(){return r});var F=P("./src/events.ts"),R=P("./src/types/cmcd.ts"),O=P("./src/utils/buffer-helper.ts"),D=P("./src/utils/logger.ts");function m(a,s){for(var o=0;o<s.length;o++){var t=s[o];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(a,t.key,t)}}function T(a,s,o){return s&&m(a.prototype,s),o&&m(a,o),a}function b(a,s){var o=typeof Symbol!="undefined"&&a[Symbol.iterator]||a["@@iterator"];if(o)return(o=o.call(a)).next.bind(o);if(Array.isArray(a)||(o=i(a))||s&&a&&typeof a.length=="number"){o&&(a=o);var t=0;return function(){return t>=a.length?{done:!0}:{done:!1,value:a[t++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i(a,s){if(!a)return;if(typeof a=="string")return d(a,s);var o=Object.prototype.toString.call(a).slice(8,-1);if(o==="Object"&&a.constructor&&(o=a.constructor.name),o==="Map"||o==="Set")return Array.from(a);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return d(a,s)}function d(a,s){(s==null||s>a.length)&&(s=a.length);for(var o=0,t=new Array(s);o<s;o++)t[o]=a[o];return t}function c(){return c=Object.assign||function(a){for(var s=1;s<arguments.length;s++){var o=arguments[s];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(a[t]=o[t])}return a},c.apply(this,arguments)}var r=function(){function a(o){var t=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){t.initialized&&(t.starved=!0),t.buffering=!0},this.onPlaying=function(){t.initialized||(t.initialized=!0),t.buffering=!1},this.applyPlaylistData=function(C){try{t.apply(C,{ot:R.CMCDObjectType.MANIFEST,su:!t.initialized})}catch(A){D.logger.warn("Could not generate manifest CMCD data.",A)}},this.applyFragmentData=function(C){try{var A=C.frag,w=t.hls.levels[A.level],M=t.getObjectType(A),E={d:A.duration*1e3,ot:M};(M===R.CMCDObjectType.VIDEO||M===R.CMCDObjectType.AUDIO||M==R.CMCDObjectType.MUXED)&&(E.br=w.bitrate/1e3,E.tb=t.getTopBandwidth(M),E.bl=t.getBufferLength(M)),t.apply(C,E)}catch(p){D.logger.warn("Could not generate segment CMCD data.",p)}},this.hls=o;var h=this.config=o.config,g=h.cmcd;g!=null&&(h.pLoader=this.createPlaylistLoader(),h.fLoader=this.createFragmentLoader(),this.sid=g.sessionId||a.uuid(),this.cid=g.contentId,this.useHeaders=g.useHeaders===!0,this.registerListeners())}var s=a.prototype;return s.registerListeners=function(){var t=this.hls;t.on(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(F.Events.MEDIA_DETACHED,this.onMediaDetached,this),t.on(F.Events.BUFFER_CREATED,this.onBufferCreated,this)},s.unregisterListeners=function(){var t=this.hls;t.off(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(F.Events.MEDIA_DETACHED,this.onMediaDetached,this),t.off(F.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},s.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},s.onMediaAttached=function(t,h){this.media=h.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},s.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},s.onBufferCreated=function(t,h){var g,C;this.audioBuffer=(g=h.tracks.audio)===null||g===void 0?void 0:g.buffer,this.videoBuffer=(C=h.tracks.video)===null||C===void 0?void 0:C.buffer},s.createData=function(){var t;return{v:R.CMCDVersion,sf:R.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(t=this.media)===null||t===void 0?void 0:t.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},s.apply=function(t,h){h===void 0&&(h={}),c(h,this.createData());var g=h.ot===R.CMCDObjectType.INIT||h.ot===R.CMCDObjectType.VIDEO||h.ot===R.CMCDObjectType.MUXED;if(this.starved&&g&&(h.bs=!0,h.su=!0,this.starved=!1),h.su==null&&(h.su=this.buffering),this.useHeaders){var C=a.toHeaders(h);if(!Object.keys(C).length)return;t.headers||(t.headers={}),c(t.headers,C)}else{var A=a.toQuery(h);if(!A)return;t.url=a.appendQueryToUri(t.url,A)}},s.getObjectType=function(t){var h=t.type;return h==="subtitle"?R.CMCDObjectType.TIMED_TEXT:t.sn==="initSegment"?R.CMCDObjectType.INIT:h==="audio"?R.CMCDObjectType.AUDIO:h==="main"?this.hls.audioTracks.length?R.CMCDObjectType.VIDEO:R.CMCDObjectType.MUXED:void 0},s.getTopBandwidth=function(t){for(var h=0,g=t===R.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,C=b(g),A;!(A=C()).done;){var w=A.value;w.bitrate>h&&(h=w.bitrate)}return h>0?h:NaN},s.getBufferLength=function(t){var h=this.hls.media,g=t===R.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!g||!h)return NaN;var C=O.BufferHelper.bufferInfo(g,h.currentTime,this.config.maxBufferHole);return C.len*1e3},s.createPlaylistLoader=function(){var t=this.config.pLoader,h=this.applyPlaylistData,g=t||this.config.loader;return function(){function C(w){this.loader=void 0,this.loader=new g(w)}var A=C.prototype;return A.destroy=function(){this.loader.destroy()},A.abort=function(){this.loader.abort()},A.load=function(M,E,p){h(M),this.loader.load(M,E,p)},T(C,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),C}()},s.createFragmentLoader=function(){var t=this.config.fLoader,h=this.applyFragmentData,g=t||this.config.loader;return function(){function C(w){this.loader=void 0,this.loader=new g(w)}var A=C.prototype;return A.destroy=function(){this.loader.destroy()},A.abort=function(){this.loader.abort()},A.load=function(M,E,p){h(M),this.loader.load(M,E,p)},T(C,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),C}()},a.uuid=function(){var t=URL.createObjectURL(new Blob),h=t.toString();return URL.revokeObjectURL(t),h.substr(h.lastIndexOf("/")+1)},a.serialize=function(t){for(var h=[],g=function(j){return!Number.isNaN(j)&&j!=null&&j!==""&&j!==!1},C=function(j){return Math.round(j)},A=function(j){return C(j/100)*100},w=function(j){return encodeURIComponent(j)},M={br:C,d:C,bl:A,dl:A,mtp:A,nor:w,rtp:A,tb:C},E=Object.keys(t||{}).sort(),p=b(E),l;!(l=p()).done;){var u=l.value,f=t[u];if(!g(f))continue;if(u==="v"&&f===1)continue;if(u=="pr"&&f===1)continue;var _=M[u];_&&(f=_(f));var y=typeof f,v=void 0;u==="ot"||u==="sf"||u==="st"?v=u+"="+f:y==="boolean"?v=u:y==="number"?v=u+"="+f:v=u+"="+JSON.stringify(f),h.push(v)}return h.join(",")},a.toHeaders=function(t){for(var h=Object.keys(t),g={},C=["Object","Request","Session","Status"],A=[{},{},{},{}],w={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},M=0,E=h;M<E.length;M++){var p=E[M],l=w[p]!=null?w[p]:1;A[l][p]=t[p]}for(var u=0;u<A.length;u++){var f=a.serialize(A[u]);f&&(g["CMCD-"+C[u]]=f)}return g},a.toQuery=function(t){return"CMCD="+encodeURIComponent(a.serialize(t))},a.appendQueryToUri=function(t,h){if(!h)return t;var g=t.includes("?")?"&":"?";return""+t+g+h},a}()},"./src/controller/eme-controller.ts":function(Y,H,P){"use strict";P.r(H);var F=P("./src/events.ts"),R=P("./src/errors.ts"),O=P("./src/utils/logger.ts"),D=P("./src/utils/mediakeys-helper.ts");function m(r,a){for(var s=0;s<a.length;s++){var o=a[s];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(r,o.key,o)}}function T(r,a,s){return a&&m(r.prototype,a),s&&m(r,s),r}var b=3,i=function(a,s,o){var t={audioCapabilities:[],videoCapabilities:[]};return a.forEach(function(h){t.audioCapabilities.push({contentType:'audio/mp4; codecs="'+h+'"',robustness:o.audioRobustness||""})}),s.forEach(function(h){t.videoCapabilities.push({contentType:'video/mp4; codecs="'+h+'"',robustness:o.videoRobustness||""})}),[t]},d=function(a,s,o,t){switch(a){case D.KeySystems.WIDEVINE:return i(s,o,t);default:throw new Error("Unknown key-system: "+a)}},c=function(){function r(s){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=s,this._config=s.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var a=r.prototype;return a.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},a._registerListeners=function(){this.hls.on(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(F.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(F.Events.MANIFEST_PARSED,this.onManifestParsed,this)},a._unregisterListeners=function(){this.hls.off(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(F.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(F.Events.MANIFEST_PARSED,this.onManifestParsed,this)},a.getLicenseServerUrl=function(o){switch(o){case D.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+o+'"')},a._attemptKeySystemAccess=function(o,t,h){var g=this,C=d(o,t,h,this._drmSystemOptions);O.logger.log("Requesting encrypted media key-system access");var A=this.requestMediaKeySystemAccess(o,C);this.mediaKeysPromise=A.then(function(w){return g._onMediaKeySystemAccessObtained(o,w)}),A.catch(function(w){O.logger.error('Failed to obtain key-system "'+o+'" access:',w)})},a._onMediaKeySystemAccessObtained=function(o,t){var h=this;O.logger.log('Access for key-system "'+o+'" obtained');var g={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:t,mediaKeySystemDomain:o};this._mediaKeysList.push(g);var C=Promise.resolve().then(function(){return t.createMediaKeys()}).then(function(A){return g.mediaKeys=A,O.logger.log('Media-keys created for key-system "'+o+'"'),h._onMediaKeysCreated(),A});return C.catch(function(A){O.logger.error("Failed to create media-keys:",A)}),C},a._onMediaKeysCreated=function(){var o=this;this._mediaKeysList.forEach(function(t){t.mediaKeysSession||(t.mediaKeysSession=t.mediaKeys.createSession(),o._onNewMediaKeySession(t.mediaKeysSession))})},a._onNewMediaKeySession=function(o){var t=this;O.logger.log("New key-system session "+o.sessionId),o.addEventListener("message",function(h){t._onKeySessionMessage(o,h.message)},!1)},a._onKeySessionMessage=function(o,t){O.logger.log("Got EME message event, creating license request"),this._requestLicense(t,function(h){O.logger.log("Received license data (length: "+(h&&h.byteLength)+"), updating key-session"),o.update(h)})},a.onMediaEncrypted=function(o){var t=this;if(O.logger.log('Media is encrypted using "'+o.initDataType+'" init data type'),!this.mediaKeysPromise){O.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(F.Events.ERROR,{type:R.ErrorTypes.KEY_SYSTEM_ERROR,details:R.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var h=function(C){if(!t._media)return;t._attemptSetMediaKeys(C),t._generateRequestWithPreferredKeySession(o.initDataType,o.initData)};this.mediaKeysPromise.then(h).catch(h)},a._attemptSetMediaKeys=function(o){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var t=this._mediaKeysList[0];if(!t||!t.mediaKeys){O.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(F.Events.ERROR,{type:R.ErrorTypes.KEY_SYSTEM_ERROR,details:R.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}O.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(t.mediaKeys),this._hasSetMediaKeys=!0}},a._generateRequestWithPreferredKeySession=function(o,t){var h=this,g=this._mediaKeysList[0];if(!g){O.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(F.Events.ERROR,{type:R.ErrorTypes.KEY_SYSTEM_ERROR,details:R.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(g.mediaKeysSessionInitialized){O.logger.warn("Key-Session already initialized but requested again");return}var C=g.mediaKeysSession;if(!C){O.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(F.Events.ERROR,{type:R.ErrorTypes.KEY_SYSTEM_ERROR,details:R.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!t){O.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(F.Events.ERROR,{type:R.ErrorTypes.KEY_SYSTEM_ERROR,details:R.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}O.logger.log('Generating key-session request for "'+o+'" init data type'),g.mediaKeysSessionInitialized=!0,C.generateRequest(o,t).then(function(){O.logger.debug("Key-session generation succeeded")}).catch(function(A){O.logger.error("Error generating key-session request:",A),h.hls.trigger(F.Events.ERROR,{type:R.ErrorTypes.KEY_SYSTEM_ERROR,details:R.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},a._createLicenseXhr=function(o,t,h){var g=new XMLHttpRequest;g.responseType="arraybuffer",g.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,g,o,t,h);var C=this._licenseXhrSetup;if(C)try{C.call(this.hls,g,o),C=void 0}catch(A){O.logger.error(A)}try{g.readyState||g.open("POST",o,!0),C&&C.call(this.hls,g,o)}catch(A){throw new Error("issue setting up KeySystem license XHR "+A)}return g},a._onLicenseRequestReadyStageChange=function(o,t,h,g){switch(o.readyState){case 4:if(o.status===200){this._requestLicenseFailureCount=0,O.logger.log("License request succeeded");var C=o.response,A=this._licenseResponseCallback;if(A)try{C=A.call(this.hls,o,t)}catch(M){O.logger.error(M)}g(C)}else{if(O.logger.error("License Request XHR failed ("+t+"). Status: "+o.status+" ("+o.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>b){this.hls.trigger(F.Events.ERROR,{type:R.ErrorTypes.KEY_SYSTEM_ERROR,details:R.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var w=b-this._requestLicenseFailureCount+1;O.logger.warn("Retrying license request, "+w+" attempts left"),this._requestLicense(h,g)}break}},a._generateLicenseRequestChallenge=function(o,t){switch(o.mediaKeySystemDomain){case D.KeySystems.WIDEVINE:return t}throw new Error("unsupported key-system: "+o.mediaKeySystemDomain)},a._requestLicense=function(o,t){O.logger.log("Requesting content license for key-system");var h=this._mediaKeysList[0];if(!h){O.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(F.Events.ERROR,{type:R.ErrorTypes.KEY_SYSTEM_ERROR,details:R.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var g=this.getLicenseServerUrl(h.mediaKeySystemDomain),C=this._createLicenseXhr(g,o,t);O.logger.log("Sending license request to URL: "+g);var A=this._generateLicenseRequestChallenge(h,o);C.send(A)}catch(w){O.logger.error("Failure requesting DRM license: "+w),this.hls.trigger(F.Events.ERROR,{type:R.ErrorTypes.KEY_SYSTEM_ERROR,details:R.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},a.onMediaAttached=function(o,t){if(!this._emeEnabled)return;var h=t.media;this._media=h,h.addEventListener("encrypted",this._onMediaEncrypted)},a.onMediaDetached=function(){var o=this._media,t=this._mediaKeysList;if(!o)return;o.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(t.map(function(h){if(h.mediaKeysSession)return h.mediaKeysSession.close().catch(function(){})})).then(function(){return o.setMediaKeys(null)}).catch(function(){})},a.onManifestParsed=function(o,t){if(!this._emeEnabled)return;var h=t.levels.map(function(C){return C.audioCodec}).filter(function(C){return!!C}),g=t.levels.map(function(C){return C.videoCodec}).filter(function(C){return!!C});this._attemptKeySystemAccess(D.KeySystems.WIDEVINE,h,g)},T(r,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),r}();H.default=c},"./src/controller/fps-controller.ts":function(Y,H,P){"use strict";P.r(H);var F=P("./src/events.ts"),R=P("./src/utils/logger.ts"),O=function(){function D(T){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=T,this.registerListeners()}var m=D.prototype;return m.setStreamController=function(b){this.streamController=b},m.registerListeners=function(){this.hls.on(F.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},m.unregisterListeners=function(){this.hls.off(F.Events.MEDIA_ATTACHING,this.onMediaAttaching)},m.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},m.onMediaAttaching=function(b,i){var d=this.hls.config;if(d.capLevelOnFPSDrop){var c=i.media instanceof self.HTMLVideoElement?i.media:null;this.media=c,c&&typeof c.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),d.fpsDroppedMonitoringPeriod)}},m.checkFPS=function(b,i,d){var c=performance.now();if(i){if(this.lastTime){var r=c-this.lastTime,a=d-this.lastDroppedFrames,s=i-this.lastDecodedFrames,o=1e3*a/r,t=this.hls;if(t.trigger(F.Events.FPS_DROP,{currentDropped:a,currentDecoded:s,totalDroppedFrames:d}),o>0&&a>t.config.fpsDroppedMonitoringThreshold*s){var h=t.currentLevel;R.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+h),h>0&&(t.autoLevelCapping===-1||t.autoLevelCapping>=h)&&(h=h-1,t.trigger(F.Events.FPS_DROP_LEVEL_CAPPING,{level:h,droppedLevel:t.currentLevel}),t.autoLevelCapping=h,this.streamController.nextLevelSwitch())}}this.lastTime=c,this.lastDroppedFrames=d,this.lastDecodedFrames=i}},m.checkFPSInterval=function(){var b=this.media;if(b)if(this.isVideoPlaybackQualityAvailable){var i=b.getVideoPlaybackQuality();this.checkFPS(b,i.totalVideoFrames,i.droppedVideoFrames)}else this.checkFPS(b,b.webkitDecodedFrameCount,b.webkitDroppedFrameCount)},D}();H.default=O},"./src/controller/fragment-finders.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"findFragmentByPDT",function(){return O}),P.d(H,"findFragmentByPTS",function(){return D}),P.d(H,"fragmentWithinToleranceTest",function(){return m}),P.d(H,"pdtWithinToleranceTest",function(){return T}),P.d(H,"findFragWithCC",function(){return b});var F=P("./src/polyfills/number.ts"),R=P("./src/utils/binary-search.ts");function O(i,d,c){if(d===null||!Array.isArray(i)||!i.length||!Object(F.isFiniteNumber)(d))return null;var r=i[0].programDateTime;if(d<(r||0))return null;var a=i[i.length-1].endProgramDateTime;if(d>=(a||0))return null;c=c||0;for(var s=0;s<i.length;++s){var o=i[s];if(T(d,c,o))return o}return null}function D(i,d,c,r){c===void 0&&(c=0),r===void 0&&(r=0);var a=null;if(i?a=d[i.sn-d[0].sn+1]||null:c===0&&d[0].start===0&&(a=d[0]),a&&m(c,r,a)===0)return a;var s=R.default.search(d,m.bind(null,c,r));return s||a}function m(i,d,c){i===void 0&&(i=0),d===void 0&&(d=0);var r=Math.min(d,c.duration+(c.deltaPTS?c.deltaPTS:0));return c.start+c.duration-r<=i?1:c.start-r>i&&c.start?-1:0}function T(i,d,c){var r=Math.min(d,c.duration+(c.deltaPTS?c.deltaPTS:0))*1e3,a=c.endProgramDateTime||0;return a-r>i}function b(i,d){return R.default.search(i,function(c){return c.cc<d?1:c.cc>d?-1:0})}},"./src/controller/fragment-tracker.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"FragmentState",function(){return O}),P.d(H,"FragmentTracker",function(){return D});var F=P("./src/events.ts"),R=P("./src/types/loader.ts"),O;(function(b){b.NOT_LOADED="NOT_LOADED",b.BACKTRACKED="BACKTRACKED",b.APPENDING="APPENDING",b.PARTIAL="PARTIAL",b.OK="OK"})(O||(O={}));var D=function(){function b(d){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=d,this._registerListeners()}var i=b.prototype;return i._registerListeners=function(){var c=this.hls;c.on(F.Events.BUFFER_APPENDED,this.onBufferAppended,this),c.on(F.Events.FRAG_BUFFERED,this.onFragBuffered,this),c.on(F.Events.FRAG_LOADED,this.onFragLoaded,this)},i._unregisterListeners=function(){var c=this.hls;c.off(F.Events.BUFFER_APPENDED,this.onBufferAppended,this),c.off(F.Events.FRAG_BUFFERED,this.onFragBuffered,this),c.off(F.Events.FRAG_LOADED,this.onFragLoaded,this)},i.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},i.getAppendedFrag=function(c,r){if(r===R.PlaylistLevelType.MAIN){var a=this.activeFragment,s=this.activeParts;if(!a)return null;if(s)for(var o=s.length;o--;){var t=s[o],h=t?t.end:a.appendedPTS;if(t.start<=c&&h!==void 0&&c<=h)return o>9&&(this.activeParts=s.slice(o-9)),t}else if(a.start<=c&&a.appendedPTS!==void 0&&c<=a.appendedPTS)return a}return this.getBufferedFrag(c,r)},i.getBufferedFrag=function(c,r){for(var a=this.fragments,s=Object.keys(a),o=s.length;o--;){var t=a[s[o]];if((t==null?void 0:t.body.type)===r&&t.buffered){var h=t.body;if(h.start<=c&&c<=h.end)return h}}return null},i.detectEvictedFragments=function(c,r,a){var s=this;Object.keys(this.fragments).forEach(function(o){var t=s.fragments[o];if(!t)return;if(!t.buffered){t.body.type===a&&s.removeFragment(t.body);return}var h=t.range[c];if(!h)return;h.time.some(function(g){var C=!s.isTimeBuffered(g.startPTS,g.endPTS,r);return C&&s.removeFragment(t.body),C})})},i.detectPartialFragments=function(c){var r=this,a=this.timeRanges,s=c.frag,o=c.part;if(!a||s.sn==="initSegment")return;var t=T(s),h=this.fragments[t];if(!h)return;Object.keys(a).forEach(function(g){var C=s.elementaryStreams[g];if(!C)return;var A=a[g],w=o!==null||C.partial===!0;h.range[g]=r.getBufferedTimes(s,o,w,A)}),h.backtrack=h.loaded=null,Object.keys(h.range).length?h.buffered=!0:this.removeFragment(h.body)},i.fragBuffered=function(c){var r=T(c),a=this.fragments[r];a&&(a.backtrack=a.loaded=null,a.buffered=!0)},i.getBufferedTimes=function(c,r,a,s){for(var o={time:[],partial:a},t=r?r.start:c.start,h=r?r.end:c.end,g=c.minEndPTS||h,C=c.maxStartPTS||t,A=0;A<s.length;A++){var w=s.start(A)-this.bufferPadding,M=s.end(A)+this.bufferPadding;if(C>=w&&g<=M){o.time.push({startPTS:Math.max(t,s.start(A)),endPTS:Math.min(h,s.end(A))});break}else if(t<M&&h>w)o.partial=!0,o.time.push({startPTS:Math.max(t,s.start(A)),endPTS:Math.min(h,s.end(A))});else if(h<=w)break}return o},i.getPartialFragment=function(c){var r=null,a,s,o,t=0,h=this.bufferPadding,g=this.fragments;return Object.keys(g).forEach(function(C){var A=g[C];if(!A)return;m(A)&&(s=A.body.start-h,o=A.body.end+h,c>=s&&c<=o&&(a=Math.min(c-s,o-c),t<=a&&(r=A.body,t=a)))}),r},i.getState=function(c){var r=T(c),a=this.fragments[r];return a?a.buffered?m(a)?O.PARTIAL:O.OK:a.backtrack?O.BACKTRACKED:O.APPENDING:O.NOT_LOADED},i.backtrack=function(c,r){var a=T(c),s=this.fragments[a];if(!s||s.backtrack)return null;var o=s.backtrack=r||s.loaded;return s.loaded=null,o},i.getBacktrackData=function(c){var r=T(c),a=this.fragments[r];if(a){var s,o=a.backtrack;if(o!=null&&(s=o.payload)!==null&&s!==void 0&&s.byteLength)return o;this.removeFragment(c)}return null},i.isTimeBuffered=function(c,r,a){for(var s,o,t=0;t<a.length;t++){if(s=a.start(t)-this.bufferPadding,o=a.end(t)+this.bufferPadding,c>=s&&r<=o)return!0;if(r<=s)return!1}return!1},i.onFragLoaded=function(c,r){var a=r.frag,s=r.part;if(a.sn==="initSegment"||a.bitrateTest||s)return;var o=T(a);this.fragments[o]={body:a,loaded:r,backtrack:null,buffered:!1,range:Object.create(null)}},i.onBufferAppended=function(c,r){var a=this,s=r.frag,o=r.part,t=r.timeRanges;if(s.type===R.PlaylistLevelType.MAIN)if(this.activeFragment=s,o){var h=this.activeParts;h||(this.activeParts=h=[]),h.push(o)}else this.activeParts=null;this.timeRanges=t,Object.keys(t).forEach(function(g){var C=t[g];if(a.detectEvictedFragments(g,C),!o)for(var A=0;A<C.length;A++)s.appendedPTS=Math.max(C.end(A),s.appendedPTS||0)})},i.onFragBuffered=function(c,r){this.detectPartialFragments(r)},i.hasFragment=function(c){var r=T(c);return!!this.fragments[r]},i.removeFragmentsInRange=function(c,r,a){var s=this;Object.keys(this.fragments).forEach(function(o){var t=s.fragments[o];if(!t)return;if(t.buffered){var h=t.body;h.type===a&&h.start<r&&h.end>c&&s.removeFragment(h)}})},i.removeFragment=function(c){var r=T(c);c.stats.loaded=0,c.clearElementaryStreamInfo(),delete this.fragments[r]},i.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},b}();function m(b){var i,d;return b.buffered&&(((i=b.range.video)===null||i===void 0?void 0:i.partial)||((d=b.range.audio)===null||d===void 0?void 0:d.partial))}function T(b){return b.type+"_"+b.level+"_"+b.urlId+"_"+b.sn}},"./src/controller/gap-controller.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"STALL_MINIMUM_DURATION_MS",function(){return m}),P.d(H,"MAX_START_GAP_JUMP",function(){return T}),P.d(H,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return b}),P.d(H,"SKIP_BUFFER_RANGE_START",function(){return i}),P.d(H,"default",function(){return d});var F=P("./src/utils/buffer-helper.ts"),R=P("./src/errors.ts"),O=P("./src/events.ts"),D=P("./src/utils/logger.ts"),m=250,T=2,b=.1,i=.05,d=function(){function c(a,s,o,t){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=a,this.media=s,this.fragmentTracker=o,this.hls=t}var r=c.prototype;return r.destroy=function(){this.hls=this.fragmentTracker=this.media=null},r.poll=function(s){var o=this.config,t=this.media,h=this.stalled,g=t.currentTime,C=t.seeking,A=this.seeking&&!C,w=!this.seeking&&C;if(this.seeking=C,g!==s){if(this.moved=!0,h!==null){if(this.stallReported){var M=self.performance.now()-h;D.logger.warn("playback not stuck anymore @"+g+", after "+Math.round(M)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((w||A)&&(this.stalled=null),t.paused||t.ended||t.playbackRate===0||!F.BufferHelper.getBuffered(t).length)return;var E=F.BufferHelper.bufferInfo(t,g,0),p=E.len>0,l=E.nextStart||0;if(!p&&!l)return;if(C){var u=E.len>T,f=!l||l-g>T&&!this.fragmentTracker.getPartialFragment(g);if(u||f)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var _,y=Math.max(l,E.start||0)-g,v=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,N=v==null||((_=v.details)===null||_===void 0)?void 0:_.live,j=N?v.details.targetduration*2:T;if(y>0&&y<=j){this._trySkipBufferHole(null);return}}var U=self.performance.now();if(h===null){this.stalled=U;return}var G=U-h;!C&&G>=m&&this._reportStall(E.len);var z=F.BufferHelper.bufferInfo(t,g,o.maxBufferHole);this._tryFixBufferStall(z,G)},r._tryFixBufferStall=function(s,o){var t=this.config,h=this.fragmentTracker,g=this.media,C=g.currentTime,A=h.getPartialFragment(C);if(A){var w=this._trySkipBufferHole(A);if(w)return}s.len>t.maxBufferHole&&o>t.highBufferWatchdogPeriod*1e3&&(D.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},r._reportStall=function(s){var o=this.hls,t=this.media,h=this.stallReported;h||(this.stallReported=!0,D.logger.warn("Playback stalling at @"+t.currentTime+" due to low buffer (buffer="+s+")"),o.trigger(O.Events.ERROR,{type:R.ErrorTypes.MEDIA_ERROR,details:R.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:s}))},r._trySkipBufferHole=function(s){for(var o=this.config,t=this.hls,h=this.media,g=h.currentTime,C=0,A=F.BufferHelper.getBuffered(h),w=0;w<A.length;w++){var M=A.start(w);if(g+o.maxBufferHole>=C&&g<M){var E=Math.max(M+i,h.currentTime+b);return D.logger.warn("skipping hole, adjusting currentTime from "+g+" to "+E),this.moved=!0,this.stalled=null,h.currentTime=E,s&&t.trigger(O.Events.ERROR,{type:R.ErrorTypes.MEDIA_ERROR,details:R.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+g+" to "+E,frag:s}),E}C=A.end(w)}return 0},r._tryNudgeBuffer=function(){var s=this.config,o=this.hls,t=this.media,h=t.currentTime,g=(this.nudgeRetry||0)+1;if(this.nudgeRetry=g,g<s.nudgeMaxRetry){var C=h+g*s.nudgeOffset;D.logger.warn("Nudging 'currentTime' from "+h+" to "+C),t.currentTime=C,o.trigger(O.Events.ERROR,{type:R.ErrorTypes.MEDIA_ERROR,details:R.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else D.logger.error("Playhead still not moving while enough data buffered @"+h+" after "+s.nudgeMaxRetry+" nudges"),o.trigger(O.Events.ERROR,{type:R.ErrorTypes.MEDIA_ERROR,details:R.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},c}()},"./src/controller/id3-track-controller.ts":function(Y,H,P){"use strict";P.r(H);var F=P("./src/events.ts"),R=P("./src/utils/texttrack-utils.ts"),O=P("./src/demux/id3.ts"),D=.25,m=function(){function T(i){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=i,this._registerListeners()}var b=T.prototype;return b.destroy=function(){this._unregisterListeners()},b._registerListeners=function(){var d=this.hls;d.on(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.on(F.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),d.on(F.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},b._unregisterListeners=function(){var d=this.hls;d.off(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(F.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),d.off(F.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},b.onMediaAttached=function(d,c){this.media=c.media},b.onMediaDetaching=function(){if(!this.id3Track)return;Object(R.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},b.getID3Track=function(d){if(!this.media)return;for(var c=0;c<d.length;c++){var r=d[c];if(r.kind==="metadata"&&r.label==="id3")return Object(R.sendAddTrackEvent)(r,this.media),r}return this.media.addTextTrack("metadata","id3")},b.onFragParsingMetadata=function(d,c){if(!this.media)return;var r=c.frag,a=c.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var s=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,o=0;o<a.length;o++){var t=O.getID3Frames(a[o].data);if(t){var h=a[o].pts,g=o<a.length-1?a[o+1].pts:r.end,C=g-h;C<=0&&(g=h+D);for(var A=0;A<t.length;A++){var w=t[A];if(!O.isTimeStampFrame(w)){var M=new s(h,g,"");M.value=w,this.id3Track.addCue(M)}}}}},b.onBufferFlushing=function(d,c){var r=c.startOffset,a=c.endOffset,s=c.type;if(!s||s==="audio"){var o=this.id3Track;o&&Object(R.removeCuesInRange)(o,r,a)}},T}();H.default=m},"./src/controller/latency-controller.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"default",function(){return T});var F=P("./src/errors.ts"),R=P("./src/events.ts"),O=P("./src/utils/logger.ts");function D(b,i){for(var d=0;d<i.length;d++){var c=i[d];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(b,c.key,c)}}function m(b,i,d){return i&&D(b.prototype,i),d&&D(b,d),b}var T=function(){function b(d){var c=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 c.timeupdate()},this.hls=d,this.config=d.config,this.registerListeners()}var i=b.prototype;return i.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},i.registerListeners=function(){this.hls.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(R.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(R.Events.ERROR,this.onError,this)},i.unregisterListeners=function(){this.hls.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(R.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(R.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(R.Events.ERROR,this.onError)},i.onMediaAttached=function(c,r){this.media=r.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},i.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},i.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},i.onLevelUpdated=function(c,r){var a=r.details;this.levelDetails=a,a.advanced&&this.timeupdate(),!a.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},i.onError=function(c,r){if(r.details!==F.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,O.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},i.timeupdate=function(){var c=this.media,r=this.levelDetails;if(!c||!r)return;this.currentTime=c.currentTime;var a=this.computeLatency();if(a===null)return;this._latency=a;var s=this.config,o=s.lowLatencyMode,t=s.maxLiveSyncPlaybackRate;if(!o||t===1)return;var h=this.targetLatency;if(h===null)return;var g=a-h,C=Math.min(this.maxLatency,h+r.targetduration),A=g<C;if(r.live&&A&&g>.05&&this.forwardBufferLength>1){var w=Math.min(2,Math.max(1,t)),M=Math.round(2/(1+Math.exp(-.75*g-this.edgeStalled))*20)/20;c.playbackRate=Math.min(w,Math.max(1,M))}else c.playbackRate!==1&&c.playbackRate!==0&&(c.playbackRate=1)},i.estimateLiveEdge=function(){var c=this.levelDetails;return c===null?null:c.edge+c.age},i.computeLatency=function(){var c=this.estimateLiveEdge();return c===null?null:c-this.currentTime},m(b,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var c=this.config,r=this.levelDetails;return c.liveMaxLatencyDuration!==void 0?c.liveMaxLatencyDuration:r?c.liveMaxLatencyDurationCount*r.targetduration:0}},{key:"targetLatency",get:function(){var c=this.levelDetails;if(c===null)return null;var r=c.holdBack,a=c.partHoldBack,s=c.targetduration,o=this.config,t=o.liveSyncDuration,h=o.liveSyncDurationCount,g=o.lowLatencyMode,C=this.hls.userConfig,A=g&&a||r;(C.liveSyncDuration||C.liveSyncDurationCount||A===0)&&(A=t!==void 0?t:h*s);var w=s,M=1;return A+Math.min(this.stallCount*M,w)}},{key:"liveSyncPosition",get:function(){var c=this.estimateLiveEdge(),r=this.targetLatency,a=this.levelDetails;if(c===null||r===null||a===null)return null;var s=a.edge,o=c-r-this.edgeStalled,t=s-a.totalduration,h=s-(this.config.lowLatencyMode&&a.partTarget||a.targetduration);return Math.min(Math.max(t,o),h)}},{key:"drift",get:function(){var c=this.levelDetails;return c===null?1:c.drift}},{key:"edgeStalled",get:function(){var c=this.levelDetails;if(c===null)return 0;var r=(this.config.lowLatencyMode&&c.partTarget||c.targetduration)*3;return Math.max(c.age-r,0)}},{key:"forwardBufferLength",get:function(){var c=this.media,r=this.levelDetails;if(!c||!r)return 0;var a=c.buffered.length;return a?c.buffered.end(a-1):r.edge-this.currentTime}}]),b}()},"./src/controller/level-controller.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"default",function(){return o});var F=P("./src/types/level.ts"),R=P("./src/events.ts"),O=P("./src/errors.ts"),D=P("./src/utils/codecs.ts"),m=P("./src/controller/level-helper.ts"),T=P("./src/controller/base-playlist-controller.ts"),b=P("./src/types/loader.ts");function i(){return i=Object.assign||function(t){for(var h=1;h<arguments.length;h++){var g=arguments[h];for(var C in g)Object.prototype.hasOwnProperty.call(g,C)&&(t[C]=g[C])}return t},i.apply(this,arguments)}function d(t,h){for(var g=0;g<h.length;g++){var C=h[g];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(t,C.key,C)}}function c(t,h,g){return h&&d(t.prototype,h),g&&d(t,g),t}function r(t,h){t.prototype=Object.create(h.prototype),t.prototype.constructor=t,a(t,h)}function a(t,h){return a=Object.setPrototypeOf||function(C,A){return C.__proto__=A,C},a(t,h)}var s=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),o=function(t){r(h,t);function h(C){var A;return A=t.call(this,C,"[level-controller]")||this,A._levels=[],A._firstLevel=-1,A._startLevel=void 0,A.currentLevelIndex=-1,A.manualLevelIndex=-1,A.onParsedComplete=void 0,A._registerListeners(),A}var g=h.prototype;return g._registerListeners=function(){var A=this.hls;A.on(R.Events.MANIFEST_LOADED,this.onManifestLoaded,this),A.on(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.on(R.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),A.on(R.Events.FRAG_LOADED,this.onFragLoaded,this),A.on(R.Events.ERROR,this.onError,this)},g._unregisterListeners=function(){var A=this.hls;A.off(R.Events.MANIFEST_LOADED,this.onManifestLoaded,this),A.off(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.off(R.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),A.off(R.Events.FRAG_LOADED,this.onFragLoaded,this),A.off(R.Events.ERROR,this.onError,this)},g.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,t.prototype.destroy.call(this)},g.startLoad=function(){var A=this._levels;A.forEach(function(w){w.loadError=0}),t.prototype.startLoad.call(this)},g.onManifestLoaded=function(A,w){var M=[],E=[],p=[],l,u={},f,_=!1,y=!1,v=!1;if(w.levels.forEach(function(G){var z=G.attrs;_=_||!!(G.width&&G.height),y=y||!!G.videoCodec,v=v||!!G.audioCodec,s&&G.audioCodec&&G.audioCodec.indexOf("mp4a.40.34")!==-1&&(G.audioCodec=void 0);var L=G.bitrate+"-"+G.attrs.RESOLUTION+"-"+G.attrs.CODECS;f=u[L],f?f.url.push(G.url):(f=new F.Level(G),u[L]=f,M.push(f)),z&&(z.AUDIO&&Object(m.addGroupId)(f,"audio",z.AUDIO),z.SUBTITLES&&Object(m.addGroupId)(f,"text",z.SUBTITLES))}),(_||y)&&v&&(M=M.filter(function(G){var z=G.videoCodec,L=G.width,V=G.height;return!!z||!!(L&&V)})),M=M.filter(function(G){var z=G.audioCodec,L=G.videoCodec;return(!z||Object(D.isCodecSupportedInMp4)(z,"audio"))&&(!L||Object(D.isCodecSupportedInMp4)(L,"video"))}),w.audioTracks&&(E=w.audioTracks.filter(function(G){return!G.audioCodec||Object(D.isCodecSupportedInMp4)(G.audioCodec,"audio")}),Object(m.assignTrackIdsByGroup)(E)),w.subtitles&&(p=w.subtitles,Object(m.assignTrackIdsByGroup)(p)),M.length>0){l=M[0].bitrate,M.sort(function(G,z){return G.bitrate-z.bitrate}),this._levels=M;for(var N=0;N<M.length;N++)if(M[N].bitrate===l){this._firstLevel=N,this.log("manifest loaded, "+M.length+" level(s) found, first bitrate: "+l);break}var j=v&&!y,U={levels:M,audioTracks:E,subtitleTracks:p,firstLevel:this._firstLevel,stats:w.stats,audio:v,video:y,altAudio:!j&&E.some(function(G){return!!G.url})};this.hls.trigger(R.Events.MANIFEST_PARSED,U),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(R.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:w.url,reason:"no level with compatible codecs found in manifest"})},g.onError=function(A,w){if(t.prototype.onError.call(this,A,w),w.fatal)return;var M=w.context,E=this._levels[this.currentLevelIndex];if(M&&(M.type===b.PlaylistContextType.AUDIO_TRACK&&E.audioGroupIds&&M.groupId===E.audioGroupIds[E.urlId]||M.type===b.PlaylistContextType.SUBTITLE_TRACK&&E.textGroupIds&&M.groupId===E.textGroupIds[E.urlId])){this.redundantFailover(this.currentLevelIndex);return}var p=!1,l=!0,u;switch(w.details){case O.ErrorDetails.FRAG_LOAD_ERROR:case O.ErrorDetails.FRAG_LOAD_TIMEOUT:case O.ErrorDetails.KEY_LOAD_ERROR:case O.ErrorDetails.KEY_LOAD_TIMEOUT:if(w.frag){var f=this._levels[w.frag.level];f?(f.fragmentError++,f.fragmentError>this.hls.config.fragLoadingMaxRetry&&(u=w.frag.level)):u=w.frag.level}break;case O.ErrorDetails.LEVEL_LOAD_ERROR:case O.ErrorDetails.LEVEL_LOAD_TIMEOUT:M&&(M.deliveryDirectives&&(l=!1),u=M.level),p=!0;break;case O.ErrorDetails.REMUX_ALLOC_ERROR:u=w.level,p=!0;break}u!==void 0&&this.recoverLevel(w,u,p,l)},g.recoverLevel=function(A,w,M,E){var p=A.details,l=this._levels[w];if(l.loadError++,M){var u=this.retryLoadingOrFail(A);if(u)A.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(E){var f=l.url.length;if(f>1&&l.loadError<f)A.levelRetry=!0,this.redundantFailover(w);else if(this.manualLevelIndex===-1){var _=w===0?this._levels.length-1:w-1;this.currentLevelIndex!==_&&this._levels[_].loadError===0&&(this.warn(p+": switch to "+_),A.levelRetry=!0,this.hls.nextAutoLevel=_)}}},g.redundantFailover=function(A){var w=this._levels[A],M=w.url.length;if(M>1){var E=(w.urlId+1)%M;this.warn("Switching to redundant URL-id "+E),this._levels.forEach(function(p){p.urlId=E}),this.level=A}},g.onFragLoaded=function(A,w){var M=w.frag;if(M!==void 0&&M.type===b.PlaylistLevelType.MAIN){var E=this._levels[M.level];E!==void 0&&(E.fragmentError=0,E.loadError=0)}},g.onLevelLoaded=function(A,w){var M,E=w.level,p=w.details,l=this._levels[E];if(!l){var u;this.warn("Invalid level index "+E),(u=w.deliveryDirectives)!==null&&u!==void 0&&u.skip&&(p.deltaUpdateFailed=!0);return}E===this.currentLevelIndex?(l.fragmentError===0&&(l.loadError=0,this.retryCount=0),this.playlistLoaded(E,w,l.details)):(M=w.deliveryDirectives)!==null&&M!==void 0&&M.skip&&(p.deltaUpdateFailed=!0)},g.onAudioTrackSwitched=function(A,w){var M=this.hls.levels[this.currentLevelIndex];if(!M)return;if(M.audioGroupIds){for(var E=-1,p=this.hls.audioTracks[w.id].groupId,l=0;l<M.audioGroupIds.length;l++)if(M.audioGroupIds[l]===p){E=l;break}E!==M.urlId&&(M.urlId=E,this.startLoad())}},g.loadPlaylist=function(A){var w=this.currentLevelIndex,M=this._levels[w];if(this.canLoad&&M&&M.url.length>0){var E=M.urlId,p=M.url[E];if(A)try{p=A.addDirectives(p)}catch(l){this.warn("Could not construct new URL with HLS Delivery Directives: "+l)}this.log("Attempt loading level index "+w+(A?" at sn "+A.msn+" part "+A.part:"")+" with URL-id "+E+" "+p),this.clearTimer(),this.hls.trigger(R.Events.LEVEL_LOADING,{url:p,level:w,id:E,deliveryDirectives:A||null})}},g.removeLevel=function(A,w){var M=function(l,u){return u!==w},E=this._levels.filter(function(p,l){return l!==A?!0:p.url.length>1&&w!==void 0?(p.url=p.url.filter(M),p.audioGroupIds&&(p.audioGroupIds=p.audioGroupIds.filter(M)),p.textGroupIds&&(p.textGroupIds=p.textGroupIds.filter(M)),p.urlId=0,!0):!1}).map(function(p,l){var u=p.details;return u!=null&&u.fragments&&u.fragments.forEach(function(f){f.level=l}),p});this._levels=E,this.hls.trigger(R.Events.LEVELS_UPDATED,{levels:E})},c(h,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(A){var w,M=this._levels;if(M.length===0)return;if(this.currentLevelIndex===A&&(w=M[A])!==null&&w!==void 0&&w.details)return;if(A<0||A>=M.length){var E=A<0;if(this.hls.trigger(R.Events.ERROR,{type:O.ErrorTypes.OTHER_ERROR,details:O.ErrorDetails.LEVEL_SWITCH_ERROR,level:A,fatal:E,reason:"invalid level idx"}),E)return;A=Math.min(A,M.length-1)}this.clearTimer();var p=this.currentLevelIndex,l=M[p],u=M[A];this.log("switching to level "+A+" from "+p),this.currentLevelIndex=A;var f=i({},u,{level:A,maxBitrate:u.maxBitrate,uri:u.uri,urlId:u.urlId});delete f._urlId,this.hls.trigger(R.Events.LEVEL_SWITCHING,f);var _=u.details;if(!_||_.live){var y=this.switchParams(u.uri,l==null?void 0:l.details);this.loadPlaylist(y)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(A){this.manualLevelIndex=A,this._startLevel===void 0&&(this._startLevel=A),A!==-1&&(this.level=A)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(A){this._firstLevel=A}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var A=this.hls.config.startLevel;return A!==void 0?A:this._firstLevel}else return this._startLevel},set:function(A){this._startLevel=A}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(A){this.level=A,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=A)}}]),h}(T.default)},"./src/controller/level-helper.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"addGroupId",function(){return O}),P.d(H,"assignTrackIdsByGroup",function(){return D}),P.d(H,"updatePTS",function(){return m}),P.d(H,"updateFragPTSDTS",function(){return b}),P.d(H,"mergeDetails",function(){return i}),P.d(H,"mapPartIntersection",function(){return d}),P.d(H,"mapFragmentIntersection",function(){return c}),P.d(H,"adjustSliding",function(){return r}),P.d(H,"addSliding",function(){return a}),P.d(H,"computeReloadInterval",function(){return s}),P.d(H,"getFragmentWithSN",function(){return o}),P.d(H,"getPartWith",function(){return t});var F=P("./src/polyfills/number.ts"),R=P("./src/utils/logger.ts");function O(h,g,C){switch(g){case"audio":h.audioGroupIds||(h.audioGroupIds=[]),h.audioGroupIds.push(C);break;case"text":h.textGroupIds||(h.textGroupIds=[]),h.textGroupIds.push(C);break}}function D(h){var g={};h.forEach(function(C){var A=C.groupId||"";C.id=g[A]=g[A]||0,g[A]++})}function m(h,g,C){var A=h[g],w=h[C];T(A,w)}function T(h,g){var C=g.startPTS;if(Object(F.isFiniteNumber)(C)){var A=0,w;g.sn>h.sn?(A=C-h.start,w=h):(A=h.start-C,w=g),w.duration!==A&&(w.duration=A)}else if(g.sn>h.sn){var M=h.cc===g.cc;M&&h.minEndPTS?g.start=h.start+(h.minEndPTS-h.start):g.start=h.start+h.duration}else g.start=Math.max(h.start-g.duration,0)}function b(h,g,C,A,w,M){var E=A-C;E<=0&&(R.logger.warn("Fragment should have a positive duration",g),A=C+g.duration,M=w+g.duration);var p=C,l=A,u=g.startPTS,f=g.endPTS;if(Object(F.isFiniteNumber)(u)){var _=Math.abs(u-C);Object(F.isFiniteNumber)(g.deltaPTS)?g.deltaPTS=Math.max(_,g.deltaPTS):g.deltaPTS=_,p=Math.max(C,u),C=Math.min(C,u),w=Math.min(w,g.startDTS),l=Math.min(A,f),A=Math.max(A,f),M=Math.max(M,g.endDTS)}g.duration=A-C;var y=C-g.start;g.appendedPTS=A,g.start=g.startPTS=C,g.maxStartPTS=p,g.startDTS=w,g.endPTS=A,g.minEndPTS=l,g.endDTS=M;var v=g.sn;if(!h||v<h.startSN||v>h.endSN)return 0;var N,j=v-h.startSN,U=h.fragments;for(U[j]=g,N=j;N>0;N--)T(U[N],U[N-1]);for(N=j;N<U.length-1;N++)T(U[N],U[N+1]);return h.fragmentHint&&T(U[U.length-1],h.fragmentHint),h.PTSKnown=h.alignedSliding=!0,y}function i(h,g){for(var C=null,A=h.fragments,w=A.length-1;w>=0;w--){var M=A[w].initSegment;if(M){C=M;break}}h.fragmentHint&&delete h.fragmentHint.endPTS;var E=0,p;if(c(h,g,function(N,j){N.relurl&&(E=N.cc-j.cc),Object(F.isFiniteNumber)(N.startPTS)&&Object(F.isFiniteNumber)(N.endPTS)&&(j.start=j.startPTS=N.startPTS,j.startDTS=N.startDTS,j.appendedPTS=N.appendedPTS,j.maxStartPTS=N.maxStartPTS,j.endPTS=N.endPTS,j.endDTS=N.endDTS,j.minEndPTS=N.minEndPTS,j.duration=N.endPTS-N.startPTS,j.duration&&(p=j),g.PTSKnown=g.alignedSliding=!0),j.elementaryStreams=N.elementaryStreams,j.loader=N.loader,j.stats=N.stats,j.urlId=N.urlId,N.initSegment&&(j.initSegment=N.initSegment,C=N.initSegment)}),C){var l=g.fragmentHint?g.fragments.concat(g.fragmentHint):g.fragments;l.forEach(function(N){var j;(!N.initSegment||N.initSegment.relurl===((j=C)===null||j===void 0?void 0:j.relurl))&&(N.initSegment=C)})}if(g.skippedSegments&&(g.deltaUpdateFailed=g.fragments.some(function(N){return!N}),g.deltaUpdateFailed)){R.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var u=g.skippedSegments;u--;)g.fragments.shift();g.startSN=g.fragments[0].sn,g.startCC=g.fragments[0].cc}var f=g.fragments;if(E){R.logger.warn("discontinuity sliding from playlist, take drift into account");for(var _=0;_<f.length;_++)f[_].cc+=E}g.skippedSegments&&(g.startCC=g.fragments[0].cc),d(h.partList,g.partList,function(N,j){j.elementaryStreams=N.elementaryStreams,j.stats=N.stats}),p?b(g,p,p.startPTS,p.endPTS,p.startDTS,p.endDTS):r(h,g),f.length&&(g.totalduration=g.edge-f[0].start),g.driftStartTime=h.driftStartTime,g.driftStart=h.driftStart;var y=g.advancedDateTime;if(g.advanced&&y){var v=g.edge;g.driftStart||(g.driftStartTime=y,g.driftStart=v),g.driftEndTime=y,g.driftEnd=v}else g.driftEndTime=h.driftEndTime,g.driftEnd=h.driftEnd,g.advancedDateTime=h.advancedDateTime}function d(h,g,C){if(h&&g)for(var A=0,w=0,M=h.length;w<=M;w++){var E=h[w],p=g[w+A];E&&p&&E.index===p.index&&E.fragment.sn===p.fragment.sn?C(E,p):A--}}function c(h,g,C){for(var A=g.skippedSegments,w=Math.max(h.startSN,g.startSN)-g.startSN,M=(h.fragmentHint?1:0)+(A?g.endSN:Math.min(h.endSN,g.endSN))-g.startSN,E=g.startSN-h.startSN,p=g.fragmentHint?g.fragments.concat(g.fragmentHint):g.fragments,l=h.fragmentHint?h.fragments.concat(h.fragmentHint):h.fragments,u=w;u<=M;u++){var f=l[E+u],_=p[u];A&&!_&&u<A&&(_=g.fragments[u]=f),f&&_&&C(f,_)}}function r(h,g){var C=g.startSN+g.skippedSegments-h.startSN,A=h.fragments;if(C<0||C>=A.length)return;a(g,A[C].start)}function a(h,g){if(g){for(var C=h.fragments,A=h.skippedSegments;A<C.length;A++)C[A].start+=g;h.fragmentHint&&(h.fragmentHint.start+=g)}}function s(h,g){var C=1e3*h.levelTargetDuration,A=C/2,w=h.age,M=w>0&&w<C*3,E=g.loading.end-g.loading.start,p,l=h.availabilityDelay;if(h.updated===!1)if(M){var u=333*h.misses;p=Math.max(Math.min(A,E*2),u),h.availabilityDelay=(h.availabilityDelay||0)+p}else p=A;else M?(l=Math.min(l||C/2,w),h.availabilityDelay=l,p=l+C-w):p=C-E;return Math.round(p)}function o(h,g,C){if(!h||!h.details)return null;var A=h.details,w=A.fragments[g-A.startSN];return w||(w=A.fragmentHint,w&&w.sn===g?w:g<A.startSN&&C&&C.sn===g?C:null)}function t(h,g,C){if(!h||!h.details)return null;var A=h.details.partList;if(A)for(var w=A.length;w--;){var M=A[w];if(M.index===C&&M.fragment.sn===g)return M}return null}},"./src/controller/stream-controller.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"default",function(){return A});var F=P("./src/polyfills/number.ts"),R=P("./src/controller/base-stream-controller.ts"),O=P("./src/is-supported.ts"),D=P("./src/events.ts"),m=P("./src/utils/buffer-helper.ts"),T=P("./src/controller/fragment-tracker.ts"),b=P("./src/types/loader.ts"),i=P("./src/loader/fragment.ts"),d=P("./src/demux/transmuxer-interface.ts"),c=P("./src/types/transmuxer.ts"),r=P("./src/controller/gap-controller.ts"),a=P("./src/errors.ts"),s=P("./src/utils/logger.ts");function o(w,M){for(var E=0;E<M.length;E++){var p=M[E];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(w,p.key,p)}}function t(w,M,E){return M&&o(w.prototype,M),E&&o(w,E),w}function h(w,M){w.prototype=Object.create(M.prototype),w.prototype.constructor=w,g(w,M)}function g(w,M){return g=Object.setPrototypeOf||function(p,l){return p.__proto__=l,p},g(w,M)}var C=100,A=function(w){h(M,w);function M(p,l){var u;return u=w.call(this,p,l,"[stream-controller]")||this,u.audioCodecSwap=!1,u.gapController=null,u.level=-1,u._forceStartLoad=!1,u.altAudio=!1,u.audioOnly=!1,u.fragPlaying=null,u.onvplaying=null,u.onvseeked=null,u.fragLastKbps=0,u.stalled=!1,u.couldBacktrack=!1,u.audioCodecSwitch=!1,u.videoBuffer=null,u._registerListeners(),u}var E=M.prototype;return E._registerListeners=function(){var l=this.hls;l.on(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on(D.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.on(D.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),l.on(D.Events.ERROR,this.onError,this),l.on(D.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),l.on(D.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),l.on(D.Events.BUFFER_CREATED,this.onBufferCreated,this),l.on(D.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),l.on(D.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),l.on(D.Events.FRAG_BUFFERED,this.onFragBuffered,this)},E._unregisterListeners=function(){var l=this.hls;l.off(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.off(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(D.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.off(D.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),l.off(D.Events.ERROR,this.onError,this),l.off(D.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),l.off(D.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),l.off(D.Events.BUFFER_CREATED,this.onBufferCreated,this),l.off(D.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),l.off(D.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),l.off(D.Events.FRAG_BUFFERED,this.onFragBuffered,this)},E.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},E.startLoad=function(l){if(this.levels){var u=this.lastCurrentTime,f=this.hls;if(this.stopLoad(),this.setInterval(C),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var _=f.startLevel;_===-1&&(f.config.testBandwidth?(_=0,this.bitrateTest=!0):_=f.nextAutoLevel),this.level=f.nextLoadLevel=_,this.loadedmetadata=!1}u>0&&l===-1&&(this.log("Override startPosition with lastCurrentTime @"+u.toFixed(3)),l=u),this.state=R.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=l,this.tick()}else this._forceStartLoad=!0,this.state=R.State.STOPPED},E.stopLoad=function(){this._forceStartLoad=!1,w.prototype.stopLoad.call(this)},E.doTick=function(){switch(this.state){case R.State.IDLE:this.doTickIdle();break;case R.State.WAITING_LEVEL:{var l,u=this.levels,f=this.level,_=u==null||((l=u[f])===null||l===void 0)?void 0:l.details;if(_&&(!_.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(_))break;this.state=R.State.IDLE;break}break}case R.State.FRAG_LOADING_WAITING_RETRY:{var y,v=self.performance.now(),N=this.retryDate;(!N||v>=N||(y=this.media)!==null&&y!==void 0&&y.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=R.State.IDLE)}break;default:break}this.onTickEnd()},E.onTickEnd=function(){w.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},E.doTickIdle=function(){var l,u,f=this.hls,_=this.levelLastLoaded,y=this.levels,v=this.media,N=f.config,j=f.nextLoadLevel;if(_===null||!v&&(this.startFragRequested||!N.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!y||!y[j])return;var U=y[j];this.level=f.nextLoadLevel=j;var G=U.details;if(!G||this.state===R.State.WAITING_LEVEL||G.live&&this.levelLastLoaded!==j){this.state=R.State.WAITING_LEVEL;return}var z=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:v,b.PlaylistLevelType.MAIN);if(z===null)return;var L=z.len,V=this.getMaxBufferLength(U.maxBitrate);if(L>=V)return;if(this._streamEnded(z,G)){var W={};this.altAudio&&(W.type="video"),this.hls.trigger(D.Events.BUFFER_EOS,W),this.state=R.State.ENDED;return}var $=z.end,q=this.getNextFragment($,G);if(this.couldBacktrack&&!this.fragPrevious&&q&&q.sn!=="initSegment"){var fe=q.sn-G.startSN;fe>1&&(q=G.fragments[fe-1],this.fragmentTracker.removeFragment(q))}if(q&&this.fragmentTracker.getState(q)===T.FragmentState.OK&&this.nextLoadPosition>$){var se=this.audioOnly&&!this.altAudio?i.ElementaryStreamTypes.AUDIO:i.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(v,se,b.PlaylistLevelType.MAIN),q=this.getNextFragment(this.nextLoadPosition,G)}if(!q)return;q.initSegment&&!q.initSegment.data&&!this.bitrateTest&&(q=q.initSegment),((l=q.decryptdata)===null||l===void 0?void 0:l.keyFormat)==="identity"&&!((u=q.decryptdata)!==null&&u!==void 0&&u.key)?this.loadKey(q,G):this.loadFragment(q,G,$)},E.loadFragment=function(l,u,f){var _,y=this.fragmentTracker.getState(l);if(this.fragCurrent=l,y===T.FragmentState.BACKTRACKED){var v=this.fragmentTracker.getBacktrackData(l);if(v){this._handleFragmentLoadProgress(v),this._handleFragmentLoadComplete(v);return}else y=T.FragmentState.NOT_LOADED}y===T.FragmentState.NOT_LOADED||y===T.FragmentState.PARTIAL?l.sn==="initSegment"?this._loadInitSegment(l):this.bitrateTest?(l.bitrateTest=!0,this.log("Fragment "+l.sn+" of level "+l.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(l)):(this.startFragRequested=!0,w.prototype.loadFragment.call(this,l,u,f)):y===T.FragmentState.APPENDING?this.reduceMaxBufferLength(l.duration)&&this.fragmentTracker.removeFragment(l):((_=this.media)===null||_===void 0?void 0:_.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},E.getAppendedFrag=function(l){var u=this.fragmentTracker.getAppendedFrag(l,b.PlaylistLevelType.MAIN);return u&&"fragment"in u?u.fragment:u},E.getBufferedFrag=function(l){return this.fragmentTracker.getBufferedFrag(l,b.PlaylistLevelType.MAIN)},E.followingBufferedFrag=function(l){return l?this.getBufferedFrag(l.end+.5):null},E.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},E.nextLevelSwitch=function(){var l=this.levels,u=this.media;if(u!=null&&u.readyState){var f,_=this.getAppendedFrag(u.currentTime);if(_&&_.start>1&&this.flushMainBuffer(0,_.start-1),!u.paused&&l){var y=this.hls.nextLoadLevel,v=l[y],N=this.fragLastKbps;N&&this.fragCurrent?f=this.fragCurrent.duration*v.maxBitrate/(1e3*N)+1:f=0}else f=0;var j=this.getBufferedFrag(u.currentTime+f);if(j){var U=this.followingBufferedFrag(j);if(U){this.abortCurrentFrag();var G=U.maxStartPTS?U.maxStartPTS:U.start,z=U.duration,L=Math.max(j.end,G+Math.min(Math.max(z-this.config.maxFragLookUpTolerance,z*.5),z*.75));this.flushMainBuffer(L,Number.POSITIVE_INFINITY)}}}},E.abortCurrentFrag=function(){var l=this.fragCurrent;this.fragCurrent=null,l!=null&&l.loader&&l.loader.abort(),this.state===R.State.KEY_LOADING&&(this.state=R.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},E.flushMainBuffer=function(l,u){w.prototype.flushMainBuffer.call(this,l,u,this.altAudio?"video":null)},E.onMediaAttached=function(l,u){w.prototype.onMediaAttached.call(this,l,u);var f=u.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),f.addEventListener("playing",this.onvplaying),f.addEventListener("seeked",this.onvseeked),this.gapController=new r.default(this.config,f,this.fragmentTracker,this.hls)},E.onMediaDetaching=function(){var l=this.media;l&&(l.removeEventListener("playing",this.onvplaying),l.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),w.prototype.onMediaDetaching.call(this)},E.onMediaPlaying=function(){this.tick()},E.onMediaSeeked=function(){var l=this.media,u=l?l.currentTime:null;Object(F.isFiniteNumber)(u)&&this.log("Media seeked to "+u.toFixed(3)),this.tick()},E.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(D.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},E.onManifestParsed=function(l,u){var f=!1,_=!1,y;u.levels.forEach(function(v){y=v.audioCodec,y&&(y.indexOf("mp4a.40.2")!==-1&&(f=!0),y.indexOf("mp4a.40.5")!==-1&&(_=!0))}),this.audioCodecSwitch=f&&_&&!Object(O.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=u.levels,this.startFragRequested=!1},E.onLevelLoading=function(l,u){var f=this.levels;if(!f||this.state!==R.State.IDLE)return;var _=f[u.level];(!_.details||_.details.live&&this.levelLastLoaded!==u.level||this.waitForCdnTuneIn(_.details))&&(this.state=R.State.WAITING_LEVEL)},E.onLevelLoaded=function(l,u){var f,_=this.levels,y=u.level,v=u.details,N=v.totalduration;if(!_){this.warn("Levels were reset while loading level "+y);return}this.log("Level "+y+" loaded ["+v.startSN+","+v.endSN+"], cc ["+v.startCC+", "+v.endCC+"] duration:"+N);var j=this.fragCurrent;j&&(this.state===R.State.FRAG_LOADING||this.state===R.State.FRAG_LOADING_WAITING_RETRY)&&(j.level!==u.level&&j.loader&&(this.state=R.State.IDLE,j.loader.abort()));var U=_[y],G=0;if(v.live||(f=U.details)!==null&&f!==void 0&&f.live){if(v.fragments[0]||(v.deltaUpdateFailed=!0),v.deltaUpdateFailed)return;G=this.alignPlaylists(v,U.details)}if(U.details=v,this.levelLastLoaded=y,this.hls.trigger(D.Events.LEVEL_UPDATED,{details:v,level:y}),this.state===R.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(v))return;this.state=R.State.IDLE}this.startFragRequested?v.live&&this.synchronizeToLiveEdge(v):this.setStartPosition(v,G),this.tick()},E._handleFragmentLoadProgress=function(l){var u,f=l.frag,_=l.part,y=l.payload,v=this.levels;if(!v){this.warn("Levels were reset while fragment load was in progress. Fragment "+f.sn+" of level "+f.level+" will not be buffered");return}var N=v[f.level],j=N.details;if(!j){this.warn("Dropping fragment "+f.sn+" of level "+f.level+" after level details were reset");return}var U=N.videoCodec,G=j.PTSKnown||!j.live,z=(u=f.initSegment)===null||u===void 0?void 0:u.data,L=this._getAudioCodec(N),V=this.transmuxer=this.transmuxer||new d.default(this.hls,b.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),W=_?_.index:-1,$=W!==-1,q=new c.ChunkMetadata(f.level,f.sn,f.stats.chunkCount,y.byteLength,W,$),fe=this.initPTS[f.cc];V.push(y,z,L,U,f,_,j.totalduration,G,q,fe)},E.onAudioTrackSwitching=function(l,u){var f=this.altAudio,_=!!u.url,y=u.id;if(!_){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var v=this.fragCurrent;v!=null&&v.loader&&(this.log("Switching to main audio track, cancel main fragment load"),v.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var N=this.hls;f&&N.trigger(D.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),N.trigger(D.Events.AUDIO_TRACK_SWITCHED,{id:y})}},E.onAudioTrackSwitched=function(l,u){var f=u.id,_=!!this.hls.audioTracks[f].url;if(_){var y=this.videoBuffer;y&&this.mediaBuffer!==y&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=y)}this.altAudio=_,this.tick()},E.onBufferCreated=function(l,u){var f=u.tracks,_,y,v=!1;for(var N in f){var j=f[N];if(j.id==="main"){if(y=N,_=j,N==="video"){var U=f[N];U&&(this.videoBuffer=U.buffer)}}else v=!0}v&&_?(this.log("Alternate track found, use "+y+".buffered to schedule main fragment loading"),this.mediaBuffer=_.buffer):this.mediaBuffer=this.media},E.onFragBuffered=function(l,u){var f=u.frag,_=u.part;if(f&&f.type!==b.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(f)){this.warn("Fragment "+f.sn+(_?" p: "+_.index:"")+" of level "+f.level+" finished buffering, but was aborted. state: "+this.state),this.state===R.State.PARSED&&(this.state=R.State.IDLE);return}var y=_?_.stats:f.stats;this.fragLastKbps=Math.round(8*y.total/(y.buffering.end-y.loading.first)),f.sn!=="initSegment"&&(this.fragPrevious=f),this.fragBufferedComplete(f,_)},E.onError=function(l,u){switch(u.details){case a.ErrorDetails.FRAG_LOAD_ERROR:case a.ErrorDetails.FRAG_LOAD_TIMEOUT:case a.ErrorDetails.KEY_LOAD_ERROR:case a.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(b.PlaylistLevelType.MAIN,u);break;case a.ErrorDetails.LEVEL_LOAD_ERROR:case a.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==R.State.ERROR&&(u.fatal?(this.warn(""+u.details),this.state=R.State.ERROR):!u.levelRetry&&this.state===R.State.WAITING_LEVEL&&(this.state=R.State.IDLE));break;case a.ErrorDetails.BUFFER_FULL_ERROR:if(u.parent==="main"&&(this.state===R.State.PARSING||this.state===R.State.PARSED)){var f=!0,_=this.getFwdBufferInfo(this.media,b.PlaylistLevelType.MAIN);_&&_.len>.5&&(f=!this.reduceMaxBufferLength(_.len)),f&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},E.checkBuffer=function(){var l=this.media,u=this.gapController;if(!l||!u||!l.readyState)return;var f=m.BufferHelper.getBuffered(l);!this.loadedmetadata&&f.length?(this.loadedmetadata=!0,this.seekToStartPos()):u.poll(this.lastCurrentTime),this.lastCurrentTime=l.currentTime},E.onFragLoadEmergencyAborted=function(){this.state=R.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},E.onBufferFlushed=function(l,u){var f=u.type;if(f!==i.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var _=(f===i.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(_,f,b.PlaylistLevelType.MAIN)}},E.onLevelsUpdated=function(l,u){this.levels=u.levels},E.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},E.seekToStartPos=function(){var l=this.media,u=l.currentTime,f=this.startPosition;if(f>=0&&u<f){if(l.seeking){s.logger.log("could not seek to "+f+", already seeking at "+u);return}var _=m.BufferHelper.getBuffered(l),y=_.length?_.start(0):0,v=y-f;v>0&&(v<this.config.maxBufferHole||v<this.config.maxFragLookUpTolerance)&&(s.logger.log("adjusting start position by "+v+" to match buffer start"),f+=v,this.startPosition=f),this.log("seek to target start position "+f+" from current time "+u),l.currentTime=f}},E._getAudioCodec=function(l){var u=this.config.defaultAudioCodec||l.audioCodec;return this.audioCodecSwap&&u&&(this.log("Swapping audio codec"),u.indexOf("mp4a.40.5")!==-1?u="mp4a.40.2":u="mp4a.40.5"),u},E._loadBitrateTestFrag=function(l){var u=this;this._doFragLoad(l).then(function(f){var _=u.hls;if(!f||_.nextLoadLevel||u.fragContextChanged(l))return;u.fragLoadError=0,u.state=R.State.IDLE,u.startFragRequested=!1,u.bitrateTest=!1;var y=l.stats;y.parsing.start=y.parsing.end=y.buffering.start=y.buffering.end=self.performance.now(),_.trigger(D.Events.FRAG_LOADED,f)})},E._handleTransmuxComplete=function(l){var u,f="main",_=this.hls,y=l.remuxResult,v=l.chunkMeta,N=this.getCurrentContext(v);if(!N){this.warn("The loading context changed while buffering fragment "+v.sn+" of level "+v.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(v.level);return}var j=N.frag,U=N.part,G=N.level,z=y.video,L=y.text,V=y.id3,W=y.initSegment,$=this.altAudio?void 0:y.audio;if(this.fragContextChanged(j))return;if(this.state=R.State.PARSING,W){W.tracks&&(this._bufferInitSegment(G,W.tracks,j,v),_.trigger(D.Events.FRAG_PARSING_INIT_SEGMENT,{frag:j,id:f,tracks:W.tracks}));var q=W.initPTS,fe=W.timescale;Object(F.isFiniteNumber)(q)&&(this.initPTS[j.cc]=q,_.trigger(D.Events.INIT_PTS_FOUND,{frag:j,id:f,initPTS:q,timescale:fe}))}if(z&&y.independent!==!1){if(G.details){var se=z.startPTS,me=z.endPTS,ve=z.startDTS,Ae=z.endDTS;if(U)U.elementaryStreams[z.type]={startPTS:se,endPTS:me,startDTS:ve,endDTS:Ae};else if(z.firstKeyFrame&&z.independent&&(this.couldBacktrack=!0),z.dropped&&z.independent){var ge=this.getLoadPosition()+this.config.maxBufferHole;if(ge<se){this.backtrack(j);return}j.setElementaryStreamInfo(z.type,j.start,me,j.start,Ae,!0)}j.setElementaryStreamInfo(z.type,se,me,ve,Ae),this.bufferFragmentData(z,j,U,v)}}else if(y.independent===!1){this.backtrack(j);return}if($){var ue=$.startPTS,$e=$.endPTS,Tt=$.startDTS,ye=$.endDTS;U&&(U.elementaryStreams[i.ElementaryStreamTypes.AUDIO]={startPTS:ue,endPTS:$e,startDTS:Tt,endDTS:ye}),j.setElementaryStreamInfo(i.ElementaryStreamTypes.AUDIO,ue,$e,Tt,ye),this.bufferFragmentData($,j,U,v)}if(V!=null&&(u=V.samples)!==null&&u!==void 0&&u.length){var Re={frag:j,id:f,samples:V.samples};_.trigger(D.Events.FRAG_PARSING_METADATA,Re)}if(L){var nt={frag:j,id:f,samples:L.samples};_.trigger(D.Events.FRAG_PARSING_USERDATA,nt)}},E._bufferInitSegment=function(l,u,f,_){var y=this;if(this.state!==R.State.PARSING)return;this.audioOnly=!!u.audio&&!u.video,this.altAudio&&!this.audioOnly&&delete u.audio;var v=u.audio,N=u.video,j=u.audiovideo;if(v){var U=l.audioCodec,G=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(U&&(U.indexOf("mp4a.40.5")!==-1?U="mp4a.40.2":U="mp4a.40.5"),v.metadata.channelCount!==1&&G.indexOf("firefox")===-1&&(U="mp4a.40.5")),G.indexOf("android")!==-1&&v.container!=="audio/mpeg"&&(U="mp4a.40.2",this.log("Android: force audio codec to "+U)),l.audioCodec&&l.audioCodec!==U&&this.log('Swapping manifest audio codec "'+l.audioCodec+'" for "'+U+'"'),v.levelCodec=U,v.id="main",this.log("Init audio buffer, container:"+v.container+", codecs[selected/level/parsed]=["+(U||"")+"/"+(l.audioCodec||"")+"/"+v.codec+"]")}N&&(N.levelCodec=l.videoCodec,N.id="main",this.log("Init video buffer, container:"+N.container+", codecs[level/parsed]=["+(l.videoCodec||"")+"/"+N.codec+"]")),j&&this.log("Init audiovideo buffer, container:"+j.container+", codecs[level/parsed]=["+(l.attrs.CODECS||"")+"/"+j.codec+"]"),this.hls.trigger(D.Events.BUFFER_CODECS,u),Object.keys(u).forEach(function(z){var L=u[z],V=L.initSegment;V!=null&&V.byteLength&&y.hls.trigger(D.Events.BUFFER_APPENDING,{type:z,data:V,frag:f,part:null,chunkMeta:_,parent:f.type})}),this.tick()},E.backtrack=function(l){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(l);var u=this.fragmentTracker.backtrack(l);this.fragPrevious=null,this.nextLoadPosition=l.start,u?this.resetFragmentLoading(l):this.state=R.State.BACKTRACKING},E.checkFragmentChanged=function(){var l=this.media,u=null;if(l&&l.readyState>1&&l.seeking===!1){var f=l.currentTime;if(m.BufferHelper.isBuffered(l,f)?u=this.getAppendedFrag(f):m.BufferHelper.isBuffered(l,f+.1)&&(u=this.getAppendedFrag(f+.1)),u){var _=this.fragPlaying,y=u.level;(!_||u.sn!==_.sn||_.level!==y||u.urlId!==_.urlId)&&(this.hls.trigger(D.Events.FRAG_CHANGED,{frag:u}),(!_||_.level!==y)&&this.hls.trigger(D.Events.LEVEL_SWITCHED,{level:y}),this.fragPlaying=u)}}},t(M,[{key:"nextLevel",get:function(){var l=this.nextBufferedFrag;return l?l.level:-1}},{key:"currentLevel",get:function(){var l=this.media;if(l){var u=this.getAppendedFrag(l.currentTime);if(u)return u.level}return-1}},{key:"nextBufferedFrag",get:function(){var l=this.media;if(l){var u=this.getAppendedFrag(l.currentTime);return this.followingBufferedFrag(u)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),M}(R.default)},"./src/controller/subtitle-stream-controller.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"SubtitleStreamController",function(){return h});var F=P("./src/events.ts"),R=P("./src/utils/logger.ts"),O=P("./src/utils/buffer-helper.ts"),D=P("./src/controller/fragment-finders.ts"),m=P("./src/utils/discontinuities.ts"),T=P("./src/controller/level-helper.ts"),b=P("./src/controller/fragment-tracker.ts"),i=P("./src/controller/base-stream-controller.ts"),d=P("./src/types/loader.ts"),c=P("./src/types/level.ts");function r(g,C){for(var A=0;A<C.length;A++){var w=C[A];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(g,w.key,w)}}function a(g,C,A){return C&&r(g.prototype,C),A&&r(g,A),g}function s(g,C){g.prototype=Object.create(C.prototype),g.prototype.constructor=g,o(g,C)}function o(g,C){return o=Object.setPrototypeOf||function(w,M){return w.__proto__=M,w},o(g,C)}var t=500,h=function(g){s(C,g);function C(w,M){var E;return E=g.call(this,w,M,"[subtitle-stream-controller]")||this,E.levels=[],E.currentTrackId=-1,E.tracksBuffered=[],E.mainDetails=null,E._registerListeners(),E}var A=C.prototype;return A.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},A._registerListeners=function(){var M=this.hls;M.on(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),M.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),M.on(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),M.on(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),M.on(F.Events.ERROR,this.onError,this),M.on(F.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),M.on(F.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),M.on(F.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),M.on(F.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),M.on(F.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},A._unregisterListeners=function(){var M=this.hls;M.off(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),M.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),M.off(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),M.off(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),M.off(F.Events.ERROR,this.onError,this),M.off(F.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),M.off(F.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),M.off(F.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),M.off(F.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),M.off(F.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},A.startLoad=function(){this.stopLoad(),this.state=i.State.IDLE,this.setInterval(t),this.tick()},A.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},A.onLevelLoaded=function(M,E){this.mainDetails=E.details},A.onSubtitleFragProcessed=function(M,E){var p=E.frag,l=E.success;if(this.fragPrevious=p,this.state=i.State.IDLE,!l)return;var u=this.tracksBuffered[this.currentTrackId];if(!u)return;for(var f,_=p.start,y=0;y<u.length;y++)if(_>=u[y].start&&_<=u[y].end){f=u[y];break}var v=p.start+p.duration;f?f.end=v:(f={start:_,end:v},u.push(f)),this.fragmentTracker.fragBuffered(p)},A.onBufferFlushing=function(M,E){var p=E.startOffset,l=E.endOffset;if(p===0&&l!==Number.POSITIVE_INFINITY){var u=this.currentTrackId,f=this.levels;if(!f.length||!f[u]||!f[u].details)return;var _=f[u].details,y=_.targetduration,v=l-y;if(v<=0)return;E.endOffsetSubtitles=Math.max(0,v),this.tracksBuffered.forEach(function(N){for(var j=0;j<N.length;){if(N[j].end<=v){N.shift();continue}else if(N[j].start<v)N[j].start=v;else break;j++}}),this.fragmentTracker.removeFragmentsInRange(p,v,d.PlaylistLevelType.SUBTITLE)}},A.onError=function(M,E){var p,l=E.frag;if(!l||l.type!==d.PlaylistLevelType.SUBTITLE)return;(p=this.fragCurrent)!==null&&p!==void 0&&p.loader&&this.fragCurrent.loader.abort(),this.state=i.State.IDLE},A.onSubtitleTracksUpdated=function(M,E){var p=this,l=E.subtitleTracks;this.tracksBuffered=[],this.levels=l.map(function(u){return new c.Level(u)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(u){p.tracksBuffered[u.id]=[]}),this.mediaBuffer=null},A.onSubtitleTrackSwitch=function(M,E){if(this.currentTrackId=E.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var p=this.levels[this.currentTrackId];p!=null&&p.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,p&&this.setInterval(t)},A.onSubtitleTrackLoaded=function(M,E){var p,l=E.details,u=E.id,f=this.currentTrackId,_=this.levels;if(!_.length)return;var y=_[f];if(u>=_.length||u!==f||!y)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,l.live||(p=y.details)!==null&&p!==void 0&&p.live){var v=this.mainDetails;if(l.deltaUpdateFailed||!v)return;var N=v.fragments[0];if(!y.details)l.hasProgramDateTime&&v.hasProgramDateTime?Object(m.alignMediaPlaylistByPDT)(l,v):N&&Object(T.addSliding)(l,N.start);else{var j=this.alignPlaylists(l,y.details);j===0&&N&&Object(T.addSliding)(l,N.start)}}if(y.details=l,this.levelLastLoaded=u,this.tick(),l.live&&!this.fragCurrent&&this.media&&this.state===i.State.IDLE){var U=Object(D.findFragmentByPTS)(null,l.fragments,this.media.currentTime,0);U||(this.warn("Subtitle playlist not aligned with playback"),y.details=void 0)}},A._handleFragmentLoadComplete=function(M){var E=M.frag,p=M.payload,l=E.decryptdata,u=this.hls;if(this.fragContextChanged(E))return;if(p&&p.byteLength>0&&l&&l.key&&l.iv&&l.method==="AES-128"){var f=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(p),l.key.buffer,l.iv.buffer).then(function(_){var y=performance.now();u.trigger(F.Events.FRAG_DECRYPTED,{frag:E,payload:_,stats:{tstart:f,tdecrypt:y}})})}},A.doTick=function(){if(!this.media){this.state=i.State.IDLE;return}if(this.state===i.State.IDLE){var M,E=this.currentTrackId,p=this.levels;if(!p.length||!p[E]||!p[E].details)return;var l=p[E].details,u=l.targetduration,f=this.config,_=this.media,y=O.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,_.currentTime-u,f.maxBufferHole),v=y.end,N=y.len,j=this.getMaxBufferLength()+u;if(N>j)return;console.assert(l,"Subtitle track details are defined on idle subtitle stream controller tick");var U=l.fragments,G=U.length,z=l.edge,L,V=this.fragPrevious;if(v<z){var W=f.maxFragLookUpTolerance;V&&l.hasProgramDateTime&&(L=Object(D.findFragmentByPDT)(U,V.endProgramDateTime,W)),L||(L=Object(D.findFragmentByPTS)(V,U,v,W),!L&&V&&V.start<U[0].start&&(L=U[0]))}else L=U[G-1];(M=L)!==null&&M!==void 0&&M.encrypted?(R.logger.log("Loading key for "+L.sn),this.state=i.State.KEY_LOADING,this.hls.trigger(F.Events.KEY_LOADING,{frag:L})):L&&this.fragmentTracker.getState(L)===b.FragmentState.NOT_LOADED&&this.loadFragment(L,l,v)}},A.loadFragment=function(M,E,p){this.fragCurrent=M,g.prototype.loadFragment.call(this,M,E,p)},a(C,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),C}(i.default)},"./src/controller/subtitle-track-controller.ts":function(Y,H,P){"use strict";P.r(H);var F=P("./src/events.ts"),R=P("./src/utils/texttrack-utils.ts"),O=P("./src/controller/base-playlist-controller.ts"),D=P("./src/types/loader.ts");function m(r,a){for(var s=0;s<a.length;s++){var o=a[s];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(r,o.key,o)}}function T(r,a,s){return a&&m(r.prototype,a),s&&m(r,s),r}function b(r,a){r.prototype=Object.create(a.prototype),r.prototype.constructor=r,i(r,a)}function i(r,a){return i=Object.setPrototypeOf||function(o,t){return o.__proto__=t,o},i(r,a)}var d=function(r){b(a,r);function a(o){var t;return t=r.call(this,o,"[subtitle-track-controller]")||this,t.media=null,t.tracks=[],t.groupId=null,t.tracksInGroup=[],t.trackId=-1,t.selectDefaultTrack=!0,t.queuedDefaultTrack=-1,t.trackChangeListener=function(){return t.onTextTracksChanged()},t.asyncPollTrackChange=function(){return t.pollTrackChange(0)},t.useTextTrackPolling=!1,t.subtitlePollingInterval=-1,t.subtitleDisplay=!0,t.registerListeners(),t}var s=a.prototype;return s.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,r.prototype.destroy.call(this)},s.registerListeners=function(){var t=this.hls;t.on(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(F.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(F.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(F.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(F.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var t=this.hls;t.off(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(F.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(F.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(F.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(F.Events.ERROR,this.onError,this)},s.onMediaAttached=function(t,h){if(this.media=h.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},s.pollTrackChange=function(t){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,t)},s.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var t=c(this.media.textTracks);t.forEach(function(h){Object(R.clearCurrentCues)(h)}),this.subtitleTrack=-1,this.media=null},s.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},s.onManifestParsed=function(t,h){this.tracks=h.subtitleTracks},s.onSubtitleTrackLoaded=function(t,h){var g=h.id,C=h.details,A=this.trackId,w=this.tracksInGroup[A];if(!w){this.warn("Invalid subtitle track id "+g);return}var M=w.details;w.details=h.details,this.log("subtitle track "+g+" loaded ["+C.startSN+"-"+C.endSN+"]"),g===this.trackId&&(this.retryCount=0,this.playlistLoaded(g,h,M))},s.onLevelLoading=function(t,h){this.switchLevel(h.level)},s.onLevelSwitching=function(t,h){this.switchLevel(h.level)},s.switchLevel=function(t){var h=this.hls.levels[t];if(!(h!=null&&h.textGroupIds))return;var g=h.textGroupIds[h.urlId];if(this.groupId!==g){var C=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,A=this.tracks.filter(function(E){return!g||E.groupId===g});this.tracksInGroup=A;var w=this.findTrackId(C==null?void 0:C.name)||this.findTrackId();this.groupId=g;var M={subtitleTracks:A};this.log("Updating subtitle tracks, "+A.length+' track(s) found in "'+g+'" group-id'),this.hls.trigger(F.Events.SUBTITLE_TRACKS_UPDATED,M),w!==-1&&this.setSubtitleTrack(w,C)}},s.findTrackId=function(t){for(var h=this.tracksInGroup,g=0;g<h.length;g++){var C=h[g];if((!this.selectDefaultTrack||C.default)&&(!t||t===C.name))return C.id}return-1},s.onError=function(t,h){if(r.prototype.onError.call(this,t,h),h.fatal||!h.context)return;h.context.type===D.PlaylistContextType.SUBTITLE_TRACK&&h.context.id===this.trackId&&h.context.groupId===this.groupId&&this.retryLoadingOrFail(h)},s.loadPlaylist=function(t){var h=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(h)){var g=h.id,C=h.groupId,A=h.url;if(t)try{A=t.addDirectives(A)}catch(w){this.warn("Could not construct new URL with HLS Delivery Directives: "+w)}this.log("Loading subtitle playlist for id "+g),this.hls.trigger(F.Events.SUBTITLE_TRACK_LOADING,{url:A,id:g,groupId:C,deliveryDirectives:t||null})}},s.toggleTrackModes=function(t){var h=this,g=this.media,C=this.subtitleDisplay,A=this.trackId;if(!g)return;var w=c(g.textTracks),M=w.filter(function(l){return l.groupId===h.groupId});if(t===-1)[].slice.call(w).forEach(function(l){l.mode="disabled"});else{var E=M[A];E&&(E.mode="disabled")}var p=M[t];p&&(p.mode=C?"showing":"hidden")},s.setSubtitleTrack=function(t,h){var g,C=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=t;return}if(this.trackId!==t&&this.toggleTrackModes(t),this.trackId===t&&(t===-1||(g=C[t])!==null&&g!==void 0&&g.details)||t<-1||t>=C.length)return;this.clearTimer();var A=C[t];if(this.log("Switching to subtitle track "+t),this.trackId=t,A){var w=A.id,M=A.groupId,E=M===void 0?"":M,p=A.name,l=A.type,u=A.url;this.hls.trigger(F.Events.SUBTITLE_TRACK_SWITCH,{id:w,groupId:E,name:p,type:l,url:u});var f=this.switchParams(A.url,h==null?void 0:h.details);this.loadPlaylist(f)}else this.hls.trigger(F.Events.SUBTITLE_TRACK_SWITCH,{id:t})},s.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var t=-1,h=c(this.media.textTracks),g=0;g<h.length;g++)if(h[g].mode==="hidden")t=g;else if(h[g].mode==="showing"){t=g;break}this.subtitleTrack!==t&&(this.subtitleTrack=t)},T(a,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(t){this.selectDefaultTrack=!1;var h=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(t,h)}}]),a}(O.default);function c(r){for(var a=[],s=0;s<r.length;s++){var o=r[s];o.kind==="subtitles"&&o.label&&a.push(r[s])}return a}H.default=d},"./src/controller/timeline-controller.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"TimelineController",function(){return c});var F=P("./src/polyfills/number.ts"),R=P("./src/events.ts"),O=P("./src/utils/cea-608-parser.ts"),D=P("./src/utils/output-filter.ts"),m=P("./src/utils/webvtt-parser.ts"),T=P("./src/utils/texttrack-utils.ts"),b=P("./src/utils/imsc1-ttml-parser.ts"),i=P("./src/types/loader.ts"),d=P("./src/utils/logger.ts"),c=function(){function o(h){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=s(),this.captionsProperties=void 0,this.hls=h,this.config=h.config,this.Cues=h.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 g=new D.default(this,"textTrack1"),C=new D.default(this,"textTrack2"),A=new D.default(this,"textTrack3"),w=new D.default(this,"textTrack4");this.cea608Parser1=new O.default(1,g,C),this.cea608Parser2=new O.default(3,A,w)}h.on(R.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),h.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(R.Events.MANIFEST_LOADED,this.onManifestLoaded,this),h.on(R.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),h.on(R.Events.FRAG_LOADING,this.onFragLoading,this),h.on(R.Events.FRAG_LOADED,this.onFragLoaded,this),h.on(R.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),h.on(R.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),h.on(R.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),h.on(R.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),h.on(R.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var t=o.prototype;return t.destroy=function(){var g=this.hls;g.off(R.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.off(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),g.off(R.Events.MANIFEST_LOADED,this.onManifestLoaded,this),g.off(R.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),g.off(R.Events.FRAG_LOADING,this.onFragLoading,this),g.off(R.Events.FRAG_LOADED,this.onFragLoaded,this),g.off(R.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),g.off(R.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),g.off(R.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),g.off(R.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),g.off(R.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},t.addCues=function(g,C,A,w,M){for(var E=!1,p=M.length;p--;){var l=M[p],u=a(l[0],l[1],C,A);if(u>=0&&(l[0]=Math.min(l[0],C),l[1]=Math.max(l[1],A),E=!0,u/(A-C)>.5))return}if(E||M.push([C,A]),this.config.renderTextTracksNatively){var f=this.captionsTracks[g];this.Cues.newCue(f,C,A,w)}else{var _=this.Cues.newCue(null,C,A,w);this.hls.trigger(R.Events.CUES_PARSED,{type:"captions",cues:_,track:g})}},t.onInitPtsFound=function(g,C){var A=this,w=C.frag,M=C.id,E=C.initPTS,p=C.timescale,l=this.unparsedVttFrags;M==="main"&&(this.initPTS[w.cc]=E,this.timescale[w.cc]=p),l.length&&(this.unparsedVttFrags=[],l.forEach(function(u){A.onFragLoaded(R.Events.FRAG_LOADED,u)}))},t.getExistingTrack=function(g){var C=this.media;if(C)for(var A=0;A<C.textTracks.length;A++){var w=C.textTracks[A];if(w[g])return w}return null},t.createCaptionsTrack=function(g){this.config.renderTextTracksNatively?this.createNativeTrack(g):this.createNonNativeTrack(g)},t.createNativeTrack=function(g){if(this.captionsTracks[g])return;var C=this.captionsProperties,A=this.captionsTracks,w=this.media,M=C[g],E=M.label,p=M.languageCode,l=this.getExistingTrack(g);if(l)A[g]=l,Object(T.clearCurrentCues)(A[g]),Object(T.sendAddTrackEvent)(A[g],w);else{var u=this.createTextTrack("captions",E,p);u&&(u[g]=!0,A[g]=u)}},t.createNonNativeTrack=function(g){if(this.nonNativeCaptionsTracks[g])return;var C=this.captionsProperties[g];if(!C)return;var A=C.label,w={_id:g,label:A,kind:"captions",default:C.media?!!C.media.default:!1,closedCaptions:C.media};this.nonNativeCaptionsTracks[g]=w,this.hls.trigger(R.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[w]})},t.createTextTrack=function(g,C,A){var w=this.media;return w?w.addTextTrack(g,C,A):void 0},t.onMediaAttaching=function(g,C){this.media=C.media,this._cleanTracks()},t.onMediaDetaching=function(){var g=this.captionsTracks;Object.keys(g).forEach(function(C){Object(T.clearCurrentCues)(g[C]),delete g[C]}),this.nonNativeCaptionsTracks={}},t.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=s(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},t._cleanTracks=function(){var g=this.media;if(!g)return;var C=g.textTracks;if(C)for(var A=0;A<C.length;A++)Object(T.clearCurrentCues)(C[A])},t.onSubtitleTracksUpdated=function(g,C){var A=this;this.textTracks=[];var w=C.subtitleTracks||[],M=w.some(function(u){return u.textCodec===b.IMSC1_CODEC});if(this.config.enableWebVTT||M&&this.config.enableIMSC1){var E=this.tracks&&w&&this.tracks.length===w.length;if(this.tracks=w||[],this.config.renderTextTracksNatively){var p=this.media?this.media.textTracks:[];this.tracks.forEach(function(u,f){var _;if(f<p.length){for(var y=null,v=0;v<p.length;v++)if(r(p[v],u)){y=p[v];break}y&&(_=y)}_?Object(T.clearCurrentCues)(_):(_=A.createTextTrack("subtitles",u.name,u.lang),_&&(_.mode="disabled")),_&&(_.groupId=u.groupId,A.textTracks.push(_))})}else if(!E&&this.tracks&&this.tracks.length){var l=this.tracks.map(function(u){return{label:u.name,kind:u.type.toLowerCase(),default:u.default,subtitleTrack:u}});this.hls.trigger(R.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:l})}}},t.onManifestLoaded=function(g,C){var A=this;this.config.enableCEA708Captions&&C.captions&&C.captions.forEach(function(w){var M=/(?:CC|SERVICE)([1-4])/.exec(w.instreamId);if(!M)return;var E="textTrack"+M[1],p=A.captionsProperties[E];if(!p)return;p.label=w.name,w.lang&&(p.languageCode=w.lang),p.media=w})},t.onFragLoading=function(g,C){var A=this.cea608Parser1,w=this.cea608Parser2,M=this.lastSn,E=this.lastPartIndex;if(!this.enabled||!(A&&w))return;if(C.frag.type===i.PlaylistLevelType.MAIN){var p,l,u=C.frag.sn,f=(p=C==null||((l=C.part)===null||l===void 0)?void 0:l.index)!=null?p:-1;u===M+1||u===M&&f===E+1||(A.reset(),w.reset()),this.lastSn=u,this.lastPartIndex=f}},t.onFragLoaded=function(g,C){var A=C.frag,w=C.payload,M=this.initPTS,E=this.unparsedVttFrags;if(A.type===i.PlaylistLevelType.SUBTITLE)if(w.byteLength){if(!Object(F.isFiniteNumber)(M[A.cc])){E.push(C),M.length&&this.hls.trigger(R.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:A,error:new Error("Missing initial subtitle PTS")});return}var p=A.decryptdata;if(p==null||p.key==null||p.method!=="AES-128"){var l=this.tracks[A.level],u=this.vttCCs;u[A.cc]||(u[A.cc]={start:A.start,prevCC:this.prevCC,new:!0},this.prevCC=A.cc),l&&l.textCodec===b.IMSC1_CODEC?this._parseIMSC1(A,w):this._parseVTTs(A,w,u)}}else this.hls.trigger(R.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:A,error:new Error("Empty subtitle payload")})},t._parseIMSC1=function(g,C){var A=this,w=this.hls;Object(b.parseIMSC1)(C,this.initPTS[g.cc],this.timescale[g.cc],function(M){A._appendCues(M,g.level),w.trigger(R.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:g})},function(M){d.logger.log("Failed to parse IMSC1: "+M),w.trigger(R.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:g,error:M})})},t._parseVTTs=function(g,C,A){var w=this,M=this.hls;Object(m.parseWebVTT)(C,this.initPTS[g.cc],this.timescale[g.cc],A,g.cc,g.start,function(E){w._appendCues(E,g.level),M.trigger(R.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:g})},function(E){w._fallbackToIMSC1(g,C),d.logger.log("Failed to parse VTT cue: "+E),M.trigger(R.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:g,error:E})})},t._fallbackToIMSC1=function(g,C){var A=this,w=this.tracks[g.level];w.textCodec||Object(b.parseIMSC1)(C,this.initPTS[g.cc],this.timescale[g.cc],function(){w.textCodec=b.IMSC1_CODEC,A._parseIMSC1(g,C)},function(){w.textCodec="wvtt"})},t._appendCues=function(g,C){var A=this.hls;if(this.config.renderTextTracksNatively){var w=this.textTracks[C];if(w.mode==="disabled")return;g.forEach(function(p){return Object(T.addCueToTrack)(w,p)})}else{var M=this.tracks[C],E=M.default?"default":"subtitles"+C;A.trigger(R.Events.CUES_PARSED,{type:"subtitles",cues:g,track:E})}},t.onFragDecrypted=function(g,C){var A=C.frag;if(A.type===i.PlaylistLevelType.SUBTITLE){if(!Object(F.isFiniteNumber)(this.initPTS[A.cc])){this.unparsedVttFrags.push(C);return}this.onFragLoaded(R.Events.FRAG_LOADED,C)}},t.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},t.onFragParsingUserdata=function(g,C){var A=this.cea608Parser1,w=this.cea608Parser2;if(!this.enabled||!(A&&w))return;for(var M=0;M<C.samples.length;M++){var E=C.samples[M].bytes;if(E){var p=this.extractCea608Data(E);A.addData(C.samples[M].pts,p[0]),w.addData(C.samples[M].pts,p[1])}}},t.onBufferFlushing=function(g,C){var A=C.startOffset,w=C.endOffset,M=C.endOffsetSubtitles,E=C.type,p=this.media;if(!p||p.currentTime<w)return;if(!E||E==="video"){var l=this.captionsTracks;Object.keys(l).forEach(function(f){return Object(T.removeCuesInRange)(l[f],A,w)})}if(this.config.renderTextTracksNatively&&(A===0&&M!==void 0)){var u=this.textTracks;Object.keys(u).forEach(function(f){return Object(T.removeCuesInRange)(u[f],A,M)})}},t.extractCea608Data=function(g){for(var C=g[0]&31,A=2,w=[[],[]],M=0;M<C;M++){var E=g[A++],p=127&g[A++],l=127&g[A++],u=(4&E)!==0,f=3&E;if(p===0&&l===0)continue;u&&((f===0||f===1)&&(w[f].push(p),w[f].push(l)))}return w},o}();function r(o,t){return o&&o.label===t.name&&!(o.textTrack1||o.textTrack2)}function a(o,t,h,g){return Math.min(t,g)-Math.max(o,h)}function s(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"default",function(){return F});var F=function(){function R(D,m){this.subtle=void 0,this.aesIV=void 0,this.subtle=D,this.aesIV=m}var O=R.prototype;return O.decrypt=function(m,T){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},T,m)},R}()},"./src/crypt/aes-decryptor.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"removePadding",function(){return R}),P.d(H,"default",function(){return O});var F=P("./src/utils/typed-array.ts");function R(D){var m=D.byteLength,T=m&&new DataView(D.buffer).getUint8(m-1);return T?Object(F.sliceUint8)(D,0,m-T):D}var O=function(){function D(){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 m=D.prototype;return m.uint8ArrayToUint32Array_=function(b){for(var i=new DataView(b),d=new Uint32Array(4),c=0;c<4;c++)d[c]=i.getUint32(c*4);return d},m.initTable=function(){var b=this.sBox,i=this.invSBox,d=this.subMix,c=d[0],r=d[1],a=d[2],s=d[3],o=this.invSubMix,t=o[0],h=o[1],g=o[2],C=o[3],A=new Uint32Array(256),w=0,M=0,E=0;for(E=0;E<256;E++)E<128?A[E]=E<<1:A[E]=E<<1^283;for(E=0;E<256;E++){var p=M^M<<1^M<<2^M<<3^M<<4;p=p>>>8^p&255^99,b[w]=p,i[p]=w;var l=A[w],u=A[l],f=A[u],_=A[p]*257^p*16843008;c[w]=_<<24|_>>>8,r[w]=_<<16|_>>>16,a[w]=_<<8|_>>>24,s[w]=_,_=f*16843009^u*65537^l*257^w*16843008,t[p]=_<<24|_>>>8,h[p]=_<<16|_>>>16,g[p]=_<<8|_>>>24,C[p]=_,w?(w=l^A[A[A[f^l]]],M^=A[A[M]]):w=M=1}},m.expandKey=function(b){for(var i=this.uint8ArrayToUint32Array_(b),d=!0,c=0;c<i.length&&d;)d=i[c]===this.key[c],c++;if(d)return;this.key=i;var r=this.keySize=i.length;if(r!==4&&r!==6&&r!==8)throw new Error("Invalid aes key size="+r);var a=this.ksRows=(r+6+1)*4,s,o,t=this.keySchedule=new Uint32Array(a),h=this.invKeySchedule=new Uint32Array(a),g=this.sBox,C=this.rcon,A=this.invSubMix,w=A[0],M=A[1],E=A[2],p=A[3],l,u;for(s=0;s<a;s++){if(s<r){l=t[s]=i[s];continue}u=l,s%r===0?(u=u<<8|u>>>24,u=g[u>>>24]<<24|g[u>>>16&255]<<16|g[u>>>8&255]<<8|g[u&255],u^=C[s/r|0]<<24):r>6&&s%r===4&&(u=g[u>>>24]<<24|g[u>>>16&255]<<16|g[u>>>8&255]<<8|g[u&255]),t[s]=l=(t[s-r]^u)>>>0}for(o=0;o<a;o++)s=a-o,o&3?u=t[s]:u=t[s-4],o<4||s<=4?h[o]=u:h[o]=w[g[u>>>24]]^M[g[u>>>16&255]]^E[g[u>>>8&255]]^p[g[u&255]],h[o]=h[o]>>>0},m.networkToHostOrderSwap=function(b){return b<<24|(b&65280)<<8|(b&16711680)>>8|b>>>24},m.decrypt=function(b,i,d){for(var c=this.keySize+6,r=this.invKeySchedule,a=this.invSBox,s=this.invSubMix,o=s[0],t=s[1],h=s[2],g=s[3],C=this.uint8ArrayToUint32Array_(d),A=C[0],w=C[1],M=C[2],E=C[3],p=new Int32Array(b),l=new Int32Array(p.length),u,f,_,y,v,N,j,U,G,z,L,V,W,$,q=this.networkToHostOrderSwap;i<p.length;){for(G=q(p[i]),z=q(p[i+1]),L=q(p[i+2]),V=q(p[i+3]),v=G^r[0],N=V^r[1],j=L^r[2],U=z^r[3],W=4,$=1;$<c;$++)u=o[v>>>24]^t[N>>16&255]^h[j>>8&255]^g[U&255]^r[W],f=o[N>>>24]^t[j>>16&255]^h[U>>8&255]^g[v&255]^r[W+1],_=o[j>>>24]^t[U>>16&255]^h[v>>8&255]^g[N&255]^r[W+2],y=o[U>>>24]^t[v>>16&255]^h[N>>8&255]^g[j&255]^r[W+3],v=u,N=f,j=_,U=y,W=W+4;u=a[v>>>24]<<24^a[N>>16&255]<<16^a[j>>8&255]<<8^a[U&255]^r[W],f=a[N>>>24]<<24^a[j>>16&255]<<16^a[U>>8&255]<<8^a[v&255]^r[W+1],_=a[j>>>24]<<24^a[U>>16&255]<<16^a[v>>8&255]<<8^a[N&255]^r[W+2],y=a[U>>>24]<<24^a[v>>16&255]<<16^a[N>>8&255]<<8^a[j&255]^r[W+3],l[i]=q(u^A),l[i+1]=q(y^w),l[i+2]=q(_^M),l[i+3]=q(f^E),A=G,w=z,M=L,E=V,i=i+4}return l.buffer},D}()},"./src/crypt/decrypter.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"default",function(){return i});var F=P("./src/crypt/aes-crypto.ts"),R=P("./src/crypt/fast-aes-key.ts"),O=P("./src/crypt/aes-decryptor.ts"),D=P("./src/utils/logger.ts"),m=P("./src/utils/mp4-tools.ts"),T=P("./src/utils/typed-array.ts"),b=16,i=function(){function d(r,a,s){var o=s===void 0?{}:s,t=o.removePKCS7Padding,h=t===void 0?!0:t;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=r,this.config=a,this.removePKCS7Padding=h,h)try{var g=self.crypto;g&&(this.subtle=g.subtle||g.webkitSubtle)}catch(C){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var c=d.prototype;return c.destroy=function(){this.observer=null},c.isSync=function(){return this.config.enableSoftwareAES},c.flush=function(){var a=this.currentResult;if(!a){this.reset();return}var s=new Uint8Array(a);return this.reset(),this.removePKCS7Padding?Object(O.removePadding)(s):s},c.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},c.decrypt=function(a,s,o,t){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(a),s,o);var h=this.flush();h&&t(h.buffer)}else this.webCryptoDecrypt(new Uint8Array(a),s,o).then(t)},c.softwareDecrypt=function(a,s,o){var t=this.currentIV,h=this.currentResult,g=this.remainderData;this.logOnce("JS AES decrypt"),g&&(a=Object(m.appendUint8Array)(g,a),this.remainderData=null);var C=this.getValidChunk(a);if(!C.length)return null;t&&(o=t);var A=this.softwareDecrypter;A||(A=this.softwareDecrypter=new O.default),A.expandKey(s);var w=h;return this.currentResult=A.decrypt(C.buffer,0,o),this.currentIV=Object(T.sliceUint8)(C,-16).buffer,w||null},c.webCryptoDecrypt=function(a,s,o){var t=this,h=this.subtle;return(this.key!==s||!this.fastAesKey)&&(this.key=s,this.fastAesKey=new R.default(h,s)),this.fastAesKey.expandKey().then(function(g){if(!h)return Promise.reject(new Error("web crypto not initialized"));var C=new F.default(h,o);return C.decrypt(a.buffer,g)}).catch(function(g){return t.onWebCryptoError(g,a,s,o)})},c.onWebCryptoError=function(a,s,o,t){return D.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",a),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(s,o,t)},c.getValidChunk=function(a){var s=a,o=a.length-a.length%b;return o!==a.length&&(s=Object(T.sliceUint8)(a,0,o),this.remainderData=Object(T.sliceUint8)(a,o)),s},c.logOnce=function(a){if(!this.logEnabled)return;D.logger.log("[decrypter.ts]: "+a),this.logEnabled=!1},d}()},"./src/crypt/fast-aes-key.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"default",function(){return F});var F=function(){function R(D,m){this.subtle=void 0,this.key=void 0,this.subtle=D,this.key=m}var O=R.prototype;return O.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},R}()},"./src/demux/aacdemuxer.ts":function(Y,H,P){"use strict";P.r(H);var F=P("./src/demux/base-audio-demuxer.ts"),R=P("./src/demux/adts.ts"),O=P("./src/utils/logger.ts"),D=P("./src/demux/id3.ts");function m(i,d){i.prototype=Object.create(d.prototype),i.prototype.constructor=i,T(i,d)}function T(i,d){return T=Object.setPrototypeOf||function(r,a){return r.__proto__=a,r},T(i,d)}var b=function(i){m(d,i);function d(r,a){var s;return s=i.call(this)||this,s.observer=void 0,s.config=void 0,s.observer=r,s.config=a,s}var c=d.prototype;return c.resetInitSegment=function(a,s,o){i.prototype.resetInitSegment.call(this,a,s,o),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:a,duration:o,inputTimeScale:9e4,dropped:0}},d.probe=function(a){if(!a)return!1;for(var s=D.getID3Data(a,0)||[],o=s.length,t=a.length;o<t;o++)if(R.probe(a,o))return O.logger.log("ADTS sync word found !"),!0;return!1},c.canParse=function(a,s){return R.canParse(a,s)},c.appendFrame=function(a,s,o){R.initTrackConfig(a,this.observer,s,o,a.manifestCodec);var t=R.appendFrame(a,s,o,this.initPTS,this.frameIndex);if(t&&t.missing===0)return t},d}(F.default);b.minProbeByteLength=9,H.default=b},"./src/demux/adts.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"getAudioConfig",function(){return D}),P.d(H,"isHeaderPattern",function(){return m}),P.d(H,"getHeaderLength",function(){return T}),P.d(H,"getFullFrameLength",function(){return b}),P.d(H,"canGetFrameLength",function(){return i}),P.d(H,"isHeader",function(){return d}),P.d(H,"canParse",function(){return c}),P.d(H,"probe",function(){return r}),P.d(H,"initTrackConfig",function(){return a}),P.d(H,"getFrameDuration",function(){return s}),P.d(H,"parseFrameHeader",function(){return o}),P.d(H,"appendFrame",function(){return t});var F=P("./src/utils/logger.ts"),R=P("./src/errors.ts"),O=P("./src/events.ts");function D(h,g,C,A){var w,M,E,p,l=navigator.userAgent.toLowerCase(),u=A,f=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];w=((g[C+2]&192)>>>6)+1;var _=(g[C+2]&60)>>>2;if(_>f.length-1){h.trigger(O.Events.ERROR,{type:R.ErrorTypes.MEDIA_ERROR,details:R.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+_});return}return E=(g[C+2]&1)<<2,E|=(g[C+3]&192)>>>6,F.logger.log("manifest codec:"+A+", ADTS type:"+w+", samplingIndex:"+_),/firefox/i.test(l)?_>=6?(w=5,p=new Array(4),M=_-3):(w=2,p=new Array(2),M=_):l.indexOf("android")!==-1?(w=2,p=new Array(2),M=_):(w=5,p=new Array(4),A&&(A.indexOf("mp4a.40.29")!==-1||A.indexOf("mp4a.40.5")!==-1)||!A&&_>=6?M=_-3:((A&&A.indexOf("mp4a.40.2")!==-1&&(_>=6&&E===1||/vivaldi/i.test(l))||!A&&E===1)&&(w=2,p=new Array(2)),M=_)),p[0]=w<<3,p[0]|=(_&14)>>1,p[1]|=(_&1)<<7,p[1]|=E<<3,w===5&&(p[1]|=(M&14)>>1,p[2]=(M&1)<<7,p[2]|=2<<2,p[3]=0),{config:p,samplerate:f[_],channelCount:E,codec:"mp4a.40."+w,manifestCodec:u}}function m(h,g){return h[g]===255&&(h[g+1]&246)===240}function T(h,g){return h[g+1]&1?7:9}function b(h,g){return(h[g+3]&3)<<11|h[g+4]<<3|(h[g+5]&224)>>>5}function i(h,g){return g+5<h.length}function d(h,g){return g+1<h.length&&m(h,g)}function c(h,g){return i(h,g)&&m(h,g)&&b(h,g)<=h.length-g}function r(h,g){if(d(h,g)){var C=T(h,g);if(g+C>=h.length)return!1;var A=b(h,g);if(A<=C)return!1;var w=g+A;return w===h.length||d(h,w)}return!1}function a(h,g,C,A,w){if(!h.samplerate){var M=D(g,C,A,w);if(!M)return;h.config=M.config,h.samplerate=M.samplerate,h.channelCount=M.channelCount,h.codec=M.codec,h.manifestCodec=M.manifestCodec,F.logger.log("parsed codec:"+h.codec+", rate:"+M.samplerate+", channels:"+M.channelCount)}}function s(h){return 1024*9e4/h}function o(h,g,C,A,w){var M=T(h,g),E=b(h,g);if(E-=M,E>0){var p=C+A*w;return{headerLength:M,frameLength:E,stamp:p}}}function t(h,g,C,A,w){var M=s(h.samplerate),E=o(g,C,A,w,M);if(E){var p=E.frameLength,l=E.headerLength,u=E.stamp,f=l+p,_=Math.max(0,C+f-g.length),y;_?(y=new Uint8Array(f-l),y.set(g.subarray(C+l,g.length),0)):y=g.subarray(C+l,C+f);var v={unit:y,pts:u};return _||h.samples.push(v),{sample:v,length:f,missing:_}}}},"./src/demux/base-audio-demuxer.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"initPTSFn",function(){return b});var F=P("./src/polyfills/number.ts"),R=P("./src/demux/id3.ts"),O=P("./src/demux/dummy-demuxed-track.ts"),D=P("./src/utils/mp4-tools.ts"),m=P("./src/utils/typed-array.ts"),T=function(){function i(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var d=i.prototype;return d.resetInitSegment=function(r,a,s){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},d.resetTimeStamp=function(){},d.resetContiguity=function(){},d.canParse=function(r,a){return!1},d.appendFrame=function(r,a,s){},d.demux=function(r,a){this.cachedData&&(r=Object(D.appendUint8Array)(this.cachedData,r),this.cachedData=null);var s=R.getID3Data(r,0),o=s?s.length:0,t,h,g=this._audioTrack,C=this._id3Track,A=s?R.getTimeStamp(s):void 0,w=r.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=b(A,a)),s&&s.length>0&&C.samples.push({pts:this.initPTS,dts:this.initPTS,data:s}),h=this.initPTS;o<w;){if(this.canParse(r,o)){var M=this.appendFrame(g,r,o);M?(this.frameIndex++,h=M.sample.pts,o+=M.length,t=o):o=w}else R.canParse(r,o)?(s=R.getID3Data(r,o),C.samples.push({pts:h,dts:h,data:s}),o+=s.length,t=o):o++;if(o===w&&t!==w){var E=Object(m.sliceUint8)(r,t);this.cachedData?this.cachedData=Object(D.appendUint8Array)(this.cachedData,E):this.cachedData=E}}return{audioTrack:g,avcTrack:Object(O.dummyTrack)(),id3Track:C,textTrack:Object(O.dummyTrack)()}},d.demuxSampleAes=function(r,a,s){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},d.flush=function(r){var a=this.cachedData;return a&&(this.cachedData=null,this.demux(a,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(O.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(O.dummyTrack)()}},d.destroy=function(){},i}(),b=function(d,c){return Object(F.isFiniteNumber)(d)?d*90:c*9e4};H.default=T},"./src/demux/chunk-cache.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"default",function(){return F});var F=function(){function O(){this.chunks=[],this.dataLength=0}var D=O.prototype;return D.push=function(T){this.chunks.push(T),this.dataLength+=T.length},D.flush=function(){var T=this.chunks,b=this.dataLength,i;if(T.length)T.length===1?i=T[0]:i=R(T,b);else return new Uint8Array(0);return this.reset(),i},D.reset=function(){this.chunks.length=0,this.dataLength=0},O}();function R(O,D){for(var m=new Uint8Array(D),T=0,b=0;b<O.length;b++){var i=O[b];m.set(i,T),T+=i.length}return m}},"./src/demux/dummy-demuxed-track.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"dummyTrack",function(){return F});function F(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(Y,H,P){"use strict";P.r(H);var F=P("./src/utils/logger.ts"),R=function(){function O(m){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=m,this.bytesAvailable=m.byteLength,this.word=0,this.bitsAvailable=0}var D=O.prototype;return D.loadWord=function(){var T=this.data,b=this.bytesAvailable,i=T.byteLength-b,d=new Uint8Array(4),c=Math.min(4,b);if(c===0)throw new Error("no bytes available");d.set(T.subarray(i,i+c)),this.word=new DataView(d.buffer).getUint32(0),this.bitsAvailable=c*8,this.bytesAvailable-=c},D.skipBits=function(T){var b;this.bitsAvailable>T?(this.word<<=T,this.bitsAvailable-=T):(T-=this.bitsAvailable,b=T>>3,T-=b>>3,this.bytesAvailable-=b,this.loadWord(),this.word<<=T,this.bitsAvailable-=T)},D.readBits=function(T){var b=Math.min(this.bitsAvailable,T),i=this.word>>>32-b;return T>32&&F.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=b,this.bitsAvailable>0?this.word<<=b:this.bytesAvailable>0&&this.loadWord(),b=T-b,b>0&&this.bitsAvailable?i<<b|this.readBits(b):i},D.skipLZ=function(){var T;for(T=0;T<this.bitsAvailable;++T)if((this.word&2147483648>>>T)!==0)return this.word<<=T,this.bitsAvailable-=T,T;return this.loadWord(),T+this.skipLZ()},D.skipUEG=function(){this.skipBits(1+this.skipLZ())},D.skipEG=function(){this.skipBits(1+this.skipLZ())},D.readUEG=function(){var T=this.skipLZ();return this.readBits(T+1)-1},D.readEG=function(){var T=this.readUEG();return 1&T?1+T>>>1:-1*(T>>>1)},D.readBoolean=function(){return this.readBits(1)===1},D.readUByte=function(){return this.readBits(8)},D.readUShort=function(){return this.readBits(16)},D.readUInt=function(){return this.readBits(32)},D.skipScalingList=function(T){for(var b=8,i=8,d,c=0;c<T;c++)i!==0&&(d=this.readEG(),i=(b+d+256)%256),b=i===0?b:i},D.readSPS=function(){var T=0,b=0,i=0,d=0,c,r,a,s=this.readUByte.bind(this),o=this.readBits.bind(this),t=this.readUEG.bind(this),h=this.readBoolean.bind(this),g=this.skipBits.bind(this),C=this.skipEG.bind(this),A=this.skipUEG.bind(this),w=this.skipScalingList.bind(this);s();var M=s();if(o(5),g(3),s(),A(),M===100||M===110||M===122||M===244||M===44||M===83||M===86||M===118||M===128){var E=t();if(E===3&&g(1),A(),A(),g(1),h())for(r=E!==3?8:12,a=0;a<r;a++)h()&&(a<6?w(16):w(64))}A();var p=t();if(p===0)t();else if(p===1)for(g(1),C(),C(),c=t(),a=0;a<c;a++)C();A(),g(1);var l=t(),u=t(),f=o(1);f===0&&g(1),g(1),h()&&(T=t(),b=t(),i=t(),d=t());var _=[1,1];if(h()&&h()){var y=s();switch(y){case 1:_=[1,1];break;case 2:_=[12,11];break;case 3:_=[10,11];break;case 4:_=[16,11];break;case 5:_=[40,33];break;case 6:_=[24,11];break;case 7:_=[20,11];break;case 8:_=[32,11];break;case 9:_=[80,33];break;case 10:_=[18,11];break;case 11:_=[15,11];break;case 12:_=[64,33];break;case 13:_=[160,99];break;case 14:_=[4,3];break;case 15:_=[3,2];break;case 16:_=[2,1];break;case 255:{_=[s()<<8|s(),s()<<8|s()];break}}}return{width:Math.ceil((l+1)*16-T*2-b*2),height:(2-f)*(u+1)*16-(f?2:4)*(i+d),pixelRatio:_}},D.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},O}();H.default=R},"./src/demux/id3.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"isHeader",function(){return F}),P.d(H,"isFooter",function(){return R}),P.d(H,"getID3Data",function(){return O}),P.d(H,"canParse",function(){return m}),P.d(H,"getTimeStamp",function(){return T}),P.d(H,"isTimeStampFrame",function(){return b}),P.d(H,"getID3Frames",function(){return d}),P.d(H,"decodeFrame",function(){return c}),P.d(H,"utf8ArrayToStr",function(){return t}),P.d(H,"testables",function(){return h});var F=function(w,M){return M+10<=w.length&&(w[M]===73&&w[M+1]===68&&w[M+2]===51&&(w[M+3]<255&&w[M+4]<255&&(w[M+6]<128&&w[M+7]<128&&w[M+8]<128&&w[M+9]<128)))},R=function(w,M){return M+10<=w.length&&(w[M]===51&&w[M+1]===68&&w[M+2]===73&&(w[M+3]<255&&w[M+4]<255&&(w[M+6]<128&&w[M+7]<128&&w[M+8]<128&&w[M+9]<128)))},O=function(w,M){for(var E=M,p=0;F(w,M);){p+=10;var l=D(w,M+6);p+=l,R(w,M+10)&&(p+=10),M+=p}return p>0?w.subarray(E,E+p):void 0},D=function(w,M){var E=0;return E=(w[M]&127)<<21,E|=(w[M+1]&127)<<14,E|=(w[M+2]&127)<<7,E|=w[M+3]&127,E},m=function(w,M){return F(w,M)&&D(w,M+6)+10<=w.length-M},T=function(w){for(var M=d(w),E=0;E<M.length;E++){var p=M[E];if(b(p))return o(p)}return},b=function(w){return w&&w.key==="PRIV"&&w.info==="com.apple.streaming.transportStreamTimestamp"},i=function(w){var M=String.fromCharCode(w[0],w[1],w[2],w[3]),E=D(w,4),p=10;return{type:M,size:E,data:w.subarray(p,p+E)}},d=function(w){for(var M=0,E=[];F(w,M);){var p=D(w,M+6);M+=10;for(var l=M+p;M+8<l;){var u=i(w.subarray(M)),f=c(u);f&&E.push(f),M+=u.size+10}R(w,M)&&(M+=10)}return E},c=function(w){return w.type==="PRIV"?r(w):w.type[0]==="W"?s(w):a(w)},r=function(w){if(w.size<2)return;var M=t(w.data,!0),E=new Uint8Array(w.data.subarray(M.length+1));return{key:w.type,info:M,data:E.buffer}},a=function(w){if(w.size<2)return;if(w.type==="TXXX"){var M=1,E=t(w.data.subarray(M),!0);M+=E.length+1;var p=t(w.data.subarray(M));return{key:w.type,info:E,data:p}}var l=t(w.data.subarray(1));return{key:w.type,data:l}},s=function(w){if(w.type==="WXXX"){if(w.size<2)return;var M=1,E=t(w.data.subarray(M),!0);M+=E.length+1;var p=t(w.data.subarray(M));return{key:w.type,info:E,data:p}}var l=t(w.data);return{key:w.type,data:l}},o=function(w){if(w.data.byteLength===8){var M=new Uint8Array(w.data),E=M[3]&1,p=(M[4]<<23)+(M[5]<<15)+(M[6]<<7)+M[7];return p/=45,E&&(p+=4772185884e-2),Math.round(p)}return},t=function(w,M){M===void 0&&(M=!1);var E=C();if(E){var p=E.decode(w);if(M){var l=p.indexOf("\0");return l!==-1?p.substring(0,l):p}return p.replace(/\0/g,"")}for(var u=w.length,f,_,y,v="",N=0;N<u;){if(f=w[N++],f===0&&M)return v;if(f===0||f===3)continue;switch(f>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:v+=String.fromCharCode(f);break;case 12:case 13:_=w[N++],v+=String.fromCharCode((f&31)<<6|_&63);break;case 14:_=w[N++],y=w[N++],v+=String.fromCharCode((f&15)<<12|(_&63)<<6|(y&63)<<0);break;default:}}return v},h={decodeTextFrame:a},g;function C(){return!g&&typeof self.TextDecoder!="undefined"&&(g=new self.TextDecoder("utf-8")),g}},"./src/demux/mp3demuxer.ts":function(Y,H,P){"use strict";P.r(H);var F=P("./src/demux/base-audio-demuxer.ts"),R=P("./src/demux/id3.ts"),O=P("./src/utils/logger.ts"),D=P("./src/demux/mpegaudio.ts");function m(i,d){i.prototype=Object.create(d.prototype),i.prototype.constructor=i,T(i,d)}function T(i,d){return T=Object.setPrototypeOf||function(r,a){return r.__proto__=a,r},T(i,d)}var b=function(i){m(d,i);function d(){return i.apply(this,arguments)||this}var c=d.prototype;return c.resetInitSegment=function(a,s,o){i.prototype.resetInitSegment.call(this,a,s,o),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:a,duration:o,inputTimeScale:9e4,dropped:0}},d.probe=function(a){if(!a)return!1;for(var s=R.getID3Data(a,0)||[],o=s.length,t=a.length;o<t;o++)if(D.probe(a,o))return O.logger.log("MPEG Audio sync word found !"),!0;return!1},c.canParse=function(a,s){return D.canParse(a,s)},c.appendFrame=function(a,s,o){return this.initPTS===null?void 0:D.appendFrame(a,s,o,this.initPTS,this.frameIndex)},d}(F.default);b.minProbeByteLength=4,H.default=b},"./src/demux/mp4demuxer.ts":function(Y,H,P){"use strict";P.r(H);var F=P("./src/utils/mp4-tools.ts"),R=P("./src/demux/dummy-demuxed-track.ts"),O=function(){function D(T,b){this.remainderData=null,this.config=void 0,this.config=b}var m=D.prototype;return m.resetTimeStamp=function(){},m.resetInitSegment=function(){},m.resetContiguity=function(){},D.probe=function(b){return Object(F.findBox)({data:b,start:0,end:Math.min(b.length,16384)},["moof"]).length>0},m.demux=function(b){var i=b,d=Object(R.dummyTrack)();if(this.config.progressive){this.remainderData&&(i=Object(F.appendUint8Array)(this.remainderData,b));var c=Object(F.segmentValidRange)(i);this.remainderData=c.remainder,d.samples=c.valid||new Uint8Array}else d.samples=i;return{audioTrack:Object(R.dummyTrack)(),avcTrack:d,id3Track:Object(R.dummyTrack)(),textTrack:Object(R.dummyTrack)()}},m.flush=function(){var b=Object(R.dummyTrack)();return b.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(R.dummyTrack)(),avcTrack:b,id3Track:Object(R.dummyTrack)(),textTrack:Object(R.dummyTrack)()}},m.demuxSampleAes=function(b,i,d){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},m.destroy=function(){},D}();O.minProbeByteLength=1024,H.default=O},"./src/demux/mpegaudio.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"appendFrame",function(){return T}),P.d(H,"parseHeader",function(){return b}),P.d(H,"isHeaderPattern",function(){return i}),P.d(H,"isHeader",function(){return d}),P.d(H,"canParse",function(){return c}),P.d(H,"probe",function(){return r});var F=null,R=[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],O=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],D=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],m=[0,1,1,4];function T(a,s,o,t,h){if(o+24>s.length)return;var g=b(s,o);if(g&&o+g.frameLength<=s.length){var C=g.samplesPerFrame*9e4/g.sampleRate,A=t+h*C,w={unit:s.subarray(o,o+g.frameLength),pts:A,dts:A};return a.config=[],a.channelCount=g.channelCount,a.samplerate=g.sampleRate,a.samples.push(w),{sample:w,length:g.frameLength,missing:0}}}function b(a,s){var o=a[s+1]>>3&3,t=a[s+1]>>1&3,h=a[s+2]>>4&15,g=a[s+2]>>2&3;if(o!==1&&h!==0&&h!==15&&g!==3){var C=a[s+2]>>1&1,A=a[s+3]>>6,w=o===3?3-t:t===3?3:4,M=R[w*14+h-1]*1e3,E=o===3?0:o===2?1:2,p=O[E*3+g],l=A===3?1:2,u=D[o][t],f=m[t],_=u*8*f,y=Math.floor(u*M/p+C)*f;if(F===null){var v=navigator.userAgent||"",N=v.match(/Chrome\/(\d+)/i);F=N?parseInt(N[1]):0}var j=!!F&&F<=87;return j&&t===2&&M>=224e3&&A===0&&(a[s+3]=a[s+3]|128),{sampleRate:p,channelCount:l,frameLength:y,samplesPerFrame:_}}}function i(a,s){return a[s]===255&&(a[s+1]&224)===224&&(a[s+1]&6)!==0}function d(a,s){return s+1<a.length&&i(a,s)}function c(a,s){var o=4;return i(a,s)&&o<=a.length-s}function r(a,s){if(s+1<a.length&&i(a,s)){var o=4,t=b(a,s),h=o;t!=null&&t.frameLength&&(h=t.frameLength);var g=s+h;return g===a.length||d(a,g)}return!1}},"./src/demux/sample-aes.ts":function(Y,H,P){"use strict";P.r(H);var F=P("./src/crypt/decrypter.ts"),R=P("./src/demux/tsdemuxer.ts"),O=function(){function D(T,b,i){this.keyData=void 0,this.decrypter=void 0,this.keyData=i,this.decrypter=new F.default(T,b,{removePKCS7Padding:!1})}var m=D.prototype;return m.decryptBuffer=function(b,i){this.decrypter.decrypt(b,this.keyData.key.buffer,this.keyData.iv.buffer,i)},m.decryptAacSample=function(b,i,d,c){var r=b[i].unit,a=r.subarray(16,r.length-r.length%16),s=a.buffer.slice(a.byteOffset,a.byteOffset+a.length),o=this;this.decryptBuffer(s,function(t){var h=new Uint8Array(t);r.set(h,16),c||o.decryptAacSamples(b,i+1,d)})},m.decryptAacSamples=function(b,i,d){for(;;i++){if(i>=b.length){d();return}if(b[i].unit.length<32)continue;var c=this.decrypter.isSync();if(this.decryptAacSample(b,i,d,c),!c)return}},m.getAvcEncryptedData=function(b){for(var i=Math.floor((b.length-48)/160)*16+16,d=new Int8Array(i),c=0,r=32;r<=b.length-16;r+=160,c+=16)d.set(b.subarray(r,r+16),c);return d},m.getAvcDecryptedUnit=function(b,i){for(var d=new Uint8Array(i),c=0,r=32;r<=b.length-16;r+=160,c+=16)b.set(d.subarray(c,c+16),r);return b},m.decryptAvcSample=function(b,i,d,c,r,a){var s=Object(R.discardEPB)(r.data),o=this.getAvcEncryptedData(s),t=this;this.decryptBuffer(o.buffer,function(h){r.data=t.getAvcDecryptedUnit(s,h),a||t.decryptAvcSamples(b,i,d+1,c)})},m.decryptAvcSamples=function(b,i,d,c){if(b instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;i++,d=0){if(i>=b.length){c();return}for(var r=b[i].units;!(d>=r.length);d++){var a=r[d];if(a.data.length<=48||a.type!==1&&a.type!==5)continue;var s=this.decrypter.isSync();if(this.decryptAvcSample(b,i,d,c,a,s),!s)return}}},D}();H.default=O},"./src/demux/transmuxer-interface.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"default",function(){return r});var F=P("./node_modules/webworkify-webpack/index.js"),R=P.n(F),O=P("./src/events.ts"),D=P("./src/demux/transmuxer.ts"),m=P("./src/utils/logger.ts"),T=P("./src/errors.ts"),b=P("./src/utils/mediasource-helper.ts"),i=P("./node_modules/eventemitter3/index.js"),d=P.n(i),c=Object(b.getMediaSource)()||{isTypeSupported:function(){return!1}},r=function(){function a(o,t,h,g){var C=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=o,this.id=t,this.onTransmuxComplete=h,this.onFlush=g;var A=o.config,w=function(u,f){f=f||{},f.frag=C.frag,f.id=C.id,o.trigger(u,f)};this.observer=new i.EventEmitter,this.observer.on(O.Events.FRAG_DECRYPTED,w),this.observer.on(O.Events.ERROR,w);var M={mp4:c.isTypeSupported("video/mp4"),mpeg:c.isTypeSupported("audio/mpeg"),mp3:c.isTypeSupported('audio/mp4; codecs="mp3"')},E=navigator.vendor;if(A.enableWorker&&typeof Worker!="undefined"){m.logger.log("demuxing in webworker");var p;try{p=this.worker=F("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),p.addEventListener("message",this.onwmsg),p.onerror=function(l){o.trigger(O.Events.ERROR,{type:T.ErrorTypes.OTHER_ERROR,details:T.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(l.message+" ("+l.filename+":"+l.lineno+")")})},p.postMessage({cmd:"init",typeSupported:M,vendor:E,id:t,config:JSON.stringify(A)})}catch(l){m.logger.warn("Error in worker:",l),m.logger.error("Error while initializing DemuxerWorker, fallback to inline"),p&&self.URL.revokeObjectURL(p.objectURL),this.transmuxer=new D.default(this.observer,M,A,E,t),this.worker=null}}else this.transmuxer=new D.default(this.observer,M,A,E,t)}var s=a.prototype;return s.destroy=function(){var t=this.worker;if(t)t.removeEventListener("message",this.onwmsg),t.terminate(),this.worker=null;else{var h=this.transmuxer;h&&(h.destroy(),this.transmuxer=null)}var g=this.observer;g&&g.removeAllListeners(),this.observer=null},s.push=function(t,h,g,C,A,w,M,E,p,l){var u=this;p.transmuxing.start=self.performance.now();var f=this.transmuxer,_=this.worker,y=w?w.start:A.start,v=A.decryptdata,N=this.frag,j=!(N&&A.cc===N.cc),U=!(N&&p.level===N.level),G=N?p.sn-N.sn:-1,z=this.part?p.part-this.part.index:1,L=!U&&(G===1||G===0&&z===1),V=self.performance.now();(U||G||A.stats.parsing.start===0)&&(A.stats.parsing.start=V),w&&(z||!L)&&(w.stats.parsing.start=V);var W=new D.TransmuxState(j,L,E,U,y);if(!L||j){m.logger.log("[transmuxer-interface, "+A.type+"]: Starting new transmux session for sn: "+p.sn+" p: "+p.part+" level: "+p.level+" id: "+p.id+`
|
|
discontinuity: `+j+`
|
|
trackSwitch: `+U+`
|
|
contiguous: `+L+`
|
|
accurateTimeOffset: `+E+`
|
|
timeOffset: `+y);var $=new D.TransmuxConfig(g,C,h,M,l);this.configureTransmuxer($)}if(this.frag=A,this.part=w,_)_.postMessage({cmd:"demux",data:t,decryptdata:v,chunkMeta:p,state:W},t instanceof ArrayBuffer?[t]:[]);else if(f){var q=f.push(t,v,p,W);Object(D.isPromise)(q)?q.then(function(fe){u.handleTransmuxComplete(fe)}):this.handleTransmuxComplete(q)}},s.flush=function(t){var h=this;t.transmuxing.start=self.performance.now();var g=this.transmuxer,C=this.worker;if(C)C.postMessage({cmd:"flush",chunkMeta:t});else if(g){var A=g.flush(t);Object(D.isPromise)(A)?A.then(function(w){h.handleFlushResult(w,t)}):this.handleFlushResult(A,t)}},s.handleFlushResult=function(t,h){var g=this;t.forEach(function(C){g.handleTransmuxComplete(C)}),this.onFlush(h)},s.onWorkerMessage=function(t){var h=t.data,g=this.hls;switch(h.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(h.data);break}case"flush":{this.onFlush(h.data);break}default:{h.data=h.data||{},h.data.frag=this.frag,h.data.id=this.id,g.trigger(h.event,h.data);break}}},s.configureTransmuxer=function(t){var h=this.worker,g=this.transmuxer;h?h.postMessage({cmd:"configure",config:t}):g&&g.configure(t)},s.handleTransmuxComplete=function(t){t.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(t)},a}()},"./src/demux/transmuxer-worker.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"default",function(){return T});var F=P("./src/demux/transmuxer.ts"),R=P("./src/events.ts"),O=P("./src/utils/logger.ts"),D=P("./node_modules/eventemitter3/index.js"),m=P.n(D);function T(r){var a=new D.EventEmitter,s=function(t,h){r.postMessage({event:t,data:h})};a.on(R.Events.FRAG_DECRYPTED,s),a.on(R.Events.ERROR,s),r.addEventListener("message",function(o){var t=o.data;switch(t.cmd){case"init":{var h=JSON.parse(t.config);r.transmuxer=new F.default(a,t.typeSupported,h,t.vendor,t.id),Object(O.enableLogs)(h.debug),s("init",null);break}case"configure":{r.transmuxer.configure(t.config);break}case"demux":{var g=r.transmuxer.push(t.data,t.decryptdata,t.chunkMeta,t.state);Object(F.isPromise)(g)?g.then(function(w){b(r,w)}):b(r,g);break}case"flush":{var C=t.chunkMeta,A=r.transmuxer.flush(C);Object(F.isPromise)(A)?A.then(function(w){d(r,w,C)}):d(r,A,C);break}default:break}})}function b(r,a){if(c(a.remuxResult))return;var s=[],o=a.remuxResult,t=o.audio,h=o.video;t&&i(s,t),h&&i(s,h),r.postMessage({event:"transmuxComplete",data:a},s)}function i(r,a){a.data1&&r.push(a.data1.buffer),a.data2&&r.push(a.data2.buffer)}function d(r,a,s){a.forEach(function(o){b(r,o)}),r.postMessage({event:"flush",data:s})}function c(r){return!r.audio&&!r.video&&!r.text&&!r.id3&&!r.initSegment}},"./src/demux/transmuxer.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"default",function(){return h}),P.d(H,"isPromise",function(){return A}),P.d(H,"TransmuxConfig",function(){return w}),P.d(H,"TransmuxState",function(){return M});var F=P("./src/events.ts"),R=P("./src/errors.ts"),O=P("./src/crypt/decrypter.ts"),D=P("./src/demux/aacdemuxer.ts"),m=P("./src/demux/mp4demuxer.ts"),T=P("./src/demux/tsdemuxer.ts"),b=P("./src/demux/mp3demuxer.ts"),i=P("./src/remux/mp4-remuxer.ts"),d=P("./src/remux/passthrough-remuxer.ts"),c=P("./src/demux/chunk-cache.ts"),r=P("./src/utils/mp4-tools.ts"),a=P("./src/utils/logger.ts"),s;try{s=self.performance.now.bind(self.performance)}catch(E){a.logger.debug("Unable to use Performance API on this environment"),s=self.Date.now}var o=[{demux:T.default,remux:i.default},{demux:m.default,remux:d.default},{demux:D.default,remux:i.default},{demux:b.default,remux:i.default}],t=1024;o.forEach(function(E){var p=E.demux;t=Math.max(t,p.minProbeByteLength)});var h=function(){function E(l,u,f,_,y){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 c.default,this.observer=l,this.typeSupported=u,this.config=f,this.vendor=_,this.id=y}var p=E.prototype;return p.configure=function(u){this.transmuxConfig=u,this.decrypter&&this.decrypter.reset()},p.push=function(u,f,_,y){var v=this,N=_.transmuxing;N.executeStart=s();var j=new Uint8Array(u),U=this.cache,G=this.config,z=this.currentTransmuxState,L=this.transmuxConfig;y&&(this.currentTransmuxState=y);var V=g(j,f);if(V&&V.method==="AES-128"){var W=this.getDecrypter();if(G.enableSoftwareAES){var $=W.softwareDecrypt(j,V.key.buffer,V.iv.buffer);if(!$)return N.executeEnd=s(),C(_);j=new Uint8Array($)}else return this.decryptionPromise=W.webCryptoDecrypt(j,V.key.buffer,V.iv.buffer).then(function(ke){var lt=v.push(ke,null,_);return v.decryptionPromise=null,lt}),this.decryptionPromise}var q=y||z,fe=q.contiguous,se=q.discontinuity,me=q.trackSwitch,ve=q.accurateTimeOffset,Ae=q.timeOffset,ge=L.audioCodec,ue=L.videoCodec,$e=L.defaultInitPts,Tt=L.duration,ye=L.initSegmentData;if((se||me)&&this.resetInitSegment(ye,ge,ue,Tt),se&&this.resetInitialTimestamp($e),fe||this.resetContiguity(),this.needsProbing(j,se,me)){if(U.dataLength){var Re=U.flush();j=Object(r.appendUint8Array)(Re,j)}this.configureTransmuxer(j,L)}var nt=this.transmux(j,V,Ae,ve,_),Ue=this.currentTransmuxState;return Ue.contiguous=!0,Ue.discontinuity=!1,Ue.trackSwitch=!1,N.executeEnd=s(),nt},p.flush=function(u){var f=this,_=u.transmuxing;_.executeStart=s();var y=this.decrypter,v=this.cache,N=this.currentTransmuxState,j=this.decryptionPromise;if(j)return j.then(function(){return f.flush(u)});var U=[],G=N.timeOffset;if(y){var z=y.flush();z&&U.push(this.push(z,null,u))}var L=v.dataLength;v.reset();var V=this.demuxer,W=this.remuxer;if(!V||!W)return L>=t&&this.observer.emit(F.Events.ERROR,F.Events.ERROR,{type:R.ErrorTypes.MEDIA_ERROR,details:R.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),_.executeEnd=s(),[C(u)];var $=V.flush(G);return A($)?$.then(function(q){return f.flushRemux(U,q,u),U}):(this.flushRemux(U,$,u),U)},p.flushRemux=function(u,f,_){var y=f.audioTrack,v=f.avcTrack,N=f.id3Track,j=f.textTrack,U=this.currentTransmuxState,G=U.accurateTimeOffset,z=U.timeOffset;a.logger.log("[transmuxer.ts]: Flushed fragment "+_.sn+(_.part>-1?" p: "+_.part:"")+" of level "+_.level);var L=this.remuxer.remux(y,v,N,j,z,G,!0,this.id);u.push({remuxResult:L,chunkMeta:_}),_.transmuxing.executeEnd=s()},p.resetInitialTimestamp=function(u){var f=this.demuxer,_=this.remuxer;if(!f||!_)return;f.resetTimeStamp(u),_.resetTimeStamp(u)},p.resetContiguity=function(){var u=this.demuxer,f=this.remuxer;if(!u||!f)return;u.resetContiguity(),f.resetNextTimestamp()},p.resetInitSegment=function(u,f,_,y){var v=this.demuxer,N=this.remuxer;if(!v||!N)return;v.resetInitSegment(f,_,y),N.resetInitSegment(u,f,_)},p.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},p.transmux=function(u,f,_,y,v){var N;return f&&f.method==="SAMPLE-AES"?N=this.transmuxSampleAes(u,f,_,y,v):N=this.transmuxUnencrypted(u,_,y,v),N},p.transmuxUnencrypted=function(u,f,_,y){var v=this.demuxer.demux(u,f,!1,!this.config.progressive),N=v.audioTrack,j=v.avcTrack,U=v.id3Track,G=v.textTrack,z=this.remuxer.remux(N,j,U,G,f,_,!1,this.id);return{remuxResult:z,chunkMeta:y}},p.transmuxSampleAes=function(u,f,_,y,v){var N=this;return this.demuxer.demuxSampleAes(u,f,_).then(function(j){var U=N.remuxer.remux(j.audioTrack,j.avcTrack,j.id3Track,j.textTrack,_,y,!1,N.id);return{remuxResult:U,chunkMeta:v}})},p.configureTransmuxer=function(u,f){for(var _=this.config,y=this.observer,v=this.typeSupported,N=this.vendor,j=f.audioCodec,U=f.defaultInitPts,G=f.duration,z=f.initSegmentData,L=f.videoCodec,V,W=0,$=o.length;W<$;W++)if(o[W].demux.probe(u)){V=o[W];break}V||(a.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),V={demux:m.default,remux:d.default});var q=this.demuxer,fe=this.remuxer,se=V.remux,me=V.demux;(!fe||!(fe instanceof se))&&(this.remuxer=new se(y,_,v,N)),(!q||!(q instanceof me))&&(this.demuxer=new me(y,_,v),this.probe=me.probe),this.resetInitSegment(z,j,L,G),this.resetInitialTimestamp(U)},p.needsProbing=function(u,f,_){return!this.demuxer||!this.remuxer||f||_},p.getDecrypter=function(){var u=this.decrypter;return u||(u=this.decrypter=new O.default(this.observer,this.config)),u},E}();function g(E,p){var l=null;return E.byteLength>0&&p!=null&&p.key!=null&&p.iv!==null&&p.method!=null&&(l=p),l}var C=function(p){return{remuxResult:{},chunkMeta:p}};function A(E){return"then"in E&&E.then instanceof Function}var w=function(p,l,u,f,_){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=p,this.videoCodec=l,this.initSegmentData=u,this.duration=f,this.defaultInitPts=_},M=function(p,l,u,f,_){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=p,this.contiguous=l,this.accurateTimeOffset=u,this.trackSwitch=f,this.timeOffset=_}},"./src/demux/tsdemuxer.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"discardEPB",function(){return C});var F=P("./src/demux/adts.ts"),R=P("./src/demux/mpegaudio.ts"),O=P("./src/demux/exp-golomb.ts"),D=P("./src/demux/id3.ts"),m=P("./src/demux/sample-aes.ts"),T=P("./src/events.ts"),b=P("./src/utils/mp4-tools.ts"),i=P("./src/utils/logger.ts"),d=P("./src/errors.ts"),c={video:1,audio:2,id3:3,text:4},r=function(){function A(M,E,p){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=M,this.config=E,this.typeSupported=p}A.probe=function(E){var p=A.syncOffset(E);return p<0?!1:(p&&i.logger.warn("MPEG2-TS detected but first sync word found @ offset "+p+", junk ahead ?"),!0)},A.syncOffset=function(E){for(var p=Math.min(1e3,E.length-3*188),l=0;l<p;){if(E[l]===71&&E[l+188]===71&&E[l+2*188]===71)return l;l++}return-1},A.createTrack=function(E,p){return{container:E==="video"||E==="audio"?"video/mp2t":void 0,type:E,id:c[E],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:E==="audio"?p:void 0}};var w=A.prototype;return w.resetInitSegment=function(E,p,l){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=A.createTrack("video",l),this._audioTrack=A.createTrack("audio",l),this._id3Track=A.createTrack("id3",l),this._txtTrack=A.createTrack("text",l),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=E,this.videoCodec=p,this._duration=l},w.resetTimeStamp=function(){},w.resetContiguity=function(){var E=this._audioTrack,p=this._avcTrack,l=this._id3Track;E&&(E.pesData=null),p&&(p.pesData=null),l&&(l.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},w.demux=function(E,p,l,u){l===void 0&&(l=!1),u===void 0&&(u=!1),l||(this.sampleAes=null);var f,_=this._avcTrack,y=this._audioTrack,v=this._id3Track,N=_.pid,j=_.pesData,U=y.pid,G=v.pid,z=y.pesData,L=v.pesData,V=!1,W=this.pmtParsed,$=this._pmtId,q=E.length;if(this.remainderData&&(E=Object(b.appendUint8Array)(this.remainderData,E),q=E.length,this.remainderData=null),q<188&&!u)return this.remainderData=E,{audioTrack:y,avcTrack:_,id3Track:v,textTrack:this._txtTrack};var fe=Math.max(0,A.syncOffset(E));q-=(q+fe)%188,q<E.byteLength&&!u&&(this.remainderData=new Uint8Array(E.buffer,q,E.buffer.byteLength-q));for(var se=fe;se<q;se+=188)if(E[se]===71){var me=!!(E[se+1]&64),ve=((E[se+1]&31)<<8)+E[se+2],Ae=(E[se+3]&48)>>4,ge=void 0;if(Ae>1){if(ge=se+5+E[se+4],ge===se+188)continue}else ge=se+4;switch(ve){case N:me&&(j&&(f=t(j))&&this.parseAVCPES(f,!1),j={data:[],size:0}),j&&(j.data.push(E.subarray(ge,se+188)),j.size+=se+188-ge);break;case U:me&&(z&&(f=t(z))&&(y.isAAC?this.parseAACPES(f):this.parseMPEGPES(f)),z={data:[],size:0}),z&&(z.data.push(E.subarray(ge,se+188)),z.size+=se+188-ge);break;case G:me&&(L&&(f=t(L))&&this.parseID3PES(f),L={data:[],size:0}),L&&(L.data.push(E.subarray(ge,se+188)),L.size+=se+188-ge);break;case 0:me&&(ge+=E[ge]+1),$=this._pmtId=s(E,ge);break;case $:{me&&(ge+=E[ge]+1);var ue=o(E,ge,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,l);N=ue.avc,N>0&&(_.pid=N),U=ue.audio,U>0&&(y.pid=U,y.isAAC=ue.isAAC),G=ue.id3,G>0&&(v.pid=G),V&&!W&&(i.logger.log("reparse from beginning"),V=!1,se=fe-188),W=this.pmtParsed=!0;break}case 17:case 8191:break;default:V=!0;break}}else this.observer.emit(T.Events.ERROR,T.Events.ERROR,{type:d.ErrorTypes.MEDIA_ERROR,details:d.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});_.pesData=j,y.pesData=z,v.pesData=L;var $e={audioTrack:y,avcTrack:_,id3Track:v,textTrack:this._txtTrack};return u&&this.extractRemainingSamples($e),$e},w.flush=function(){var E=this.remainderData;this.remainderData=null;var p;return E?p=this.demux(E,-1,!1,!0):p={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(p),this.sampleAes?this.decrypt(p,this.sampleAes):p},w.extractRemainingSamples=function(E){var p=E.audioTrack,l=E.avcTrack,u=E.id3Track,f=l.pesData,_=p.pesData,y=u.pesData,v;f&&(v=t(f))?(this.parseAVCPES(v,!0),l.pesData=null):l.pesData=f,_&&(v=t(_))?(p.isAAC?this.parseAACPES(v):this.parseMPEGPES(v),p.pesData=null):(_!=null&&_.size&&i.logger.log("last AAC PES packet truncated,might overlap between fragments"),p.pesData=_),y&&(v=t(y))?(this.parseID3PES(v),u.pesData=null):u.pesData=y},w.demuxSampleAes=function(E,p,l){var u=this.demux(E,l,!0,!this.config.progressive),f=this.sampleAes=new m.default(this.observer,this.config,p);return this.decrypt(u,f)},w.decrypt=function(E,p){return new Promise(function(l){var u=E.audioTrack,f=E.avcTrack;u.samples&&u.isAAC?p.decryptAacSamples(u.samples,0,function(){f.samples?p.decryptAvcSamples(f.samples,0,0,function(){l(E)}):l(E)}):f.samples&&p.decryptAvcSamples(f.samples,0,0,function(){l(E)})})},w.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},w.parseAVCPES=function(E,p){var l=this,u=this._avcTrack,f=this.parseAVCNALu(E.data),_=!1,y=this.avcSample,v,N=!1;E.data=null,y&&f.length&&!u.audFound&&(h(y,u),y=this.avcSample=a(!1,E.pts,E.dts,"")),f.forEach(function(j){switch(j.type){case 1:{v=!0,y||(y=l.avcSample=a(!0,E.pts,E.dts,"")),_&&(y.debug+="NDR "),y.frame=!0;var U=j.data;if(N&&U.length>4){var G=new O.default(U).readSliceType();(G===2||G===4||G===7||G===9)&&(y.key=!0)}break}case 5:v=!0,y||(y=l.avcSample=a(!0,E.pts,E.dts,"")),_&&(y.debug+="IDR "),y.key=!0,y.frame=!0;break;case 6:{v=!0,_&&y&&(y.debug+="SEI ");var z=new O.default(C(j.data));z.readUByte();for(var L=0,V=0,W=!1,$=0;!W&&z.bytesAvailable>1;){L=0;do $=z.readUByte(),L+=$;while($===255);V=0;do $=z.readUByte(),V+=$;while($===255);if(L===4&&z.bytesAvailable!==0){W=!0;var q=z.readUByte();if(q===181){var fe=z.readUShort();if(fe===49){var se=z.readUInt();if(se===1195456820){var me=z.readUByte();if(me===3){for(var ve=z.readUByte(),Ae=z.readUByte(),ge=31&ve,ue=[ve,Ae],$e=0;$e<ge;$e++)ue.push(z.readUByte()),ue.push(z.readUByte()),ue.push(z.readUByte());g(l._txtTrack.samples,{type:3,pts:E.pts,bytes:ue})}}}}}else if(L===5&&z.bytesAvailable!==0){if(W=!0,V>16){for(var Tt=[],ye=0;ye<16;ye++)Tt.push(z.readUByte().toString(16)),(ye===3||ye===5||ye===7||ye===9)&&Tt.push("-");for(var Re=V-16,nt=new Uint8Array(Re),Ue=0;Ue<Re;Ue++)nt[Ue]=z.readUByte();g(l._txtTrack.samples,{pts:E.pts,payloadType:L,uuid:Tt.join(""),userData:Object(D.utf8ArrayToStr)(nt),userDataBytes:nt})}}else if(V<z.bytesAvailable)for(var ke=0;ke<V;ke++)z.readUByte()}break}case 7:if(v=!0,N=!0,_&&y&&(y.debug+="SPS "),!u.sps){var lt=new O.default(j.data),Fe=lt.readSPS();u.width=Fe.width,u.height=Fe.height,u.pixelRatio=Fe.pixelRatio,u.sps=[j.data],u.duration=l._duration;for(var Ze=j.data.subarray(1,4),Xe="avc1.",ft=0;ft<3;ft++){var Rt=Ze[ft].toString(16);Rt.length<2&&(Rt="0"+Rt),Xe+=Rt}u.codec=Xe}break;case 8:v=!0,_&&y&&(y.debug+="PPS "),u.pps||(u.pps=[j.data]);break;case 9:v=!1,u.audFound=!0,y&&h(y,u),y=l.avcSample=a(!1,E.pts,E.dts,_?"AUD ":"");break;case 12:v=!1;break;default:v=!1,y&&(y.debug+="unknown NAL "+j.type+" ");break}if(y&&v){var Pt=y.units;Pt.push(j)}}),p&&y&&(h(y,u),this.avcSample=null)},w.getLastNalUnit=function(){var E,p=this.avcSample,l;if(!p||p.units.length===0){var u=this._avcTrack.samples;p=u[u.length-1]}if((E=p)!==null&&E!==void 0&&E.units){var f=p.units;l=f[f.length-1]}return l},w.parseAVCNALu=function(E){var p=E.byteLength,l=this._avcTrack,u=l.naluState||0,f=u,_=[],y=0,v,N,j,U=-1,G=0;for(u===-1&&(U=0,G=E[0]&31,u=0,y=1);y<p;){if(v=E[y++],!u){u=v?0:1;continue}if(u===1){u=v?0:2;continue}if(!v)u=3;else if(v===1){if(U>=0){var z={data:E.subarray(U,y-u-1),type:G};_.push(z)}else{var L=this.getLastNalUnit();if(L&&(f&&y<=4-f&&(L.state&&(L.data=L.data.subarray(0,L.data.byteLength-f))),N=y-u-1,N>0)){var V=new Uint8Array(L.data.byteLength+N);V.set(L.data,0),V.set(E.subarray(0,N),L.data.byteLength),L.data=V,L.state=0}}y<p?(j=E[y]&31,U=y,G=j,u=0):u=-1}else u=0}if(U>=0&&u>=0){var W={data:E.subarray(U,p),type:G,state:u};_.push(W)}if(_.length===0){var $=this.getLastNalUnit();if($){var q=new Uint8Array($.data.byteLength+E.byteLength);q.set($.data,0),q.set(E,$.data.byteLength),$.data=q}}return l.naluState=u,_},w.parseAACPES=function(E){var p=0,l=this._audioTrack,u=this.aacOverFlow,f=E.data;if(u){this.aacOverFlow=null;var _=u.sample.unit.byteLength,y=Math.min(u.missing,_),v=_-y;u.sample.unit.set(f.subarray(0,y),v),l.samples.push(u.sample),p=u.missing}var N,j;for(N=p,j=f.length;N<j-1&&!F.isHeader(f,N);N++);if(N!==p){var U,G;if(N<j-1?(U="AAC PES did not start with ADTS header,offset:"+N,G=!1):(U="no ADTS header found in AAC PES",G=!0),i.logger.warn("parsing error:"+U),this.observer.emit(T.Events.ERROR,T.Events.ERROR,{type:d.ErrorTypes.MEDIA_ERROR,details:d.ErrorDetails.FRAG_PARSING_ERROR,fatal:G,reason:U}),G)return}F.initTrackConfig(l,this.observer,f,N,this.audioCodec);var z;if(E.pts!==void 0)z=E.pts;else if(u){var L=F.getFrameDuration(l.samplerate);z=u.sample.pts+L}else{i.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var V=0;N<j;)if(F.isHeader(f,N)){if(N+5<j){var W=F.appendFrame(l,f,N,z,V);if(W)if(W.missing)this.aacOverFlow=W;else{N+=W.length,V++;continue}}break}else N++},w.parseMPEGPES=function(E){var p=E.data,l=p.length,u=0,f=0,_=E.pts;if(_===void 0){i.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;f<l;)if(R.isHeader(p,f)){var y=R.appendFrame(this._audioTrack,p,f,_,u);if(y)f+=y.length,u++;else break}else f++},w.parseID3PES=function(E){if(E.pts===void 0){i.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(E)},A}();r.minProbeByteLength=188;function a(A,w,M,E){return{key:A,frame:!1,pts:w,dts:M,units:[],debug:E,length:0}}function s(A,w){return(A[w+10]&31)<<8|A[w+11]}function o(A,w,M,E){var p={audio:-1,avc:-1,id3:-1,isAAC:!0},l=(A[w+1]&15)<<8|A[w+2],u=w+3+l-4,f=(A[w+10]&15)<<8|A[w+11];for(w+=12+f;w<u;){var _=(A[w+1]&31)<<8|A[w+2];switch(A[w]){case 207:if(!E){i.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:p.audio===-1&&(p.audio=_);break;case 21:p.id3===-1&&(p.id3=_);break;case 219:if(!E){i.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:p.avc===-1&&(p.avc=_);break;case 3:case 4:M?p.audio===-1&&(p.audio=_,p.isAAC=!1):i.logger.log("MPEG audio found, not supported in this browser");break;case 36:i.logger.warn("Unsupported HEVC stream type found");break;default:break}w+=((A[w+3]&15)<<8|A[w+4])+5}return p}function t(A){var w=0,M,E,p,l,u,f=A.data;if(!A||A.size===0)return null;for(;f[0].length<19&&f.length>1;){var _=new Uint8Array(f[0].length+f[1].length);_.set(f[0]),_.set(f[1],f[0].length),f[0]=_,f.splice(1,1)}M=f[0];var y=(M[0]<<16)+(M[1]<<8)+M[2];if(y===1){if(E=(M[4]<<8)+M[5],E&&E>A.size-6)return null;var v=M[7];v&192&&(l=(M[9]&14)*536870912+(M[10]&255)*4194304+(M[11]&254)*16384+(M[12]&255)*128+(M[13]&254)/2,v&64?(u=(M[14]&14)*536870912+(M[15]&255)*4194304+(M[16]&254)*16384+(M[17]&255)*128+(M[18]&254)/2,l-u>60*9e4&&(i.logger.warn(Math.round((l-u)/9e4)+"s delta between PTS and DTS, align them"),l=u)):u=l),p=M[8];var N=p+9;if(A.size<=N)return null;A.size-=N;for(var j=new Uint8Array(A.size),U=0,G=f.length;U<G;U++){M=f[U];var z=M.byteLength;if(N)if(N>z){N-=z;continue}else M=M.subarray(N),z-=N,N=0;j.set(M,w),w+=z}return E&&(E-=p+3),{data:j,pts:l,dts:u,len:E}}return null}function h(A,w){if(A.units.length&&A.frame){if(A.pts===void 0){var M=w.samples,E=M.length;if(E){var p=M[E-1];A.pts=p.pts,A.dts=p.dts}else{w.dropped++;return}}w.samples.push(A)}A.debug.length&&i.logger.log(A.pts+"/"+A.dts+":"+A.debug)}function g(A,w){var M=A.length;if(M>0){if(w.pts>=A[M-1].pts)A.push(w);else for(var E=M-1;E>=0;E--)if(w.pts<A[E].pts){A.splice(E,0,w);break}}else A.push(w)}function C(A){for(var w=A.byteLength,M=[],E=1;E<w-2;)A[E]===0&&A[E+1]===0&&A[E+2]===3?(M.push(E+2),E+=2):E++;if(M.length===0)return A;var p=w-M.length,l=new Uint8Array(p),u=0;for(E=0;E<p;u++,E++)u===M[0]&&(u++,M.shift()),l[E]=A[u];return l}H.default=r},"./src/errors.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"ErrorTypes",function(){return F}),P.d(H,"ErrorDetails",function(){return R});var F;(function(O){O.NETWORK_ERROR="networkError",O.MEDIA_ERROR="mediaError",O.KEY_SYSTEM_ERROR="keySystemError",O.MUX_ERROR="muxError",O.OTHER_ERROR="otherError"})(F||(F={}));var R;(function(O){O.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",O.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",O.KEY_SYSTEM_NO_SESSION="keySystemNoSession",O.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",O.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",O.MANIFEST_LOAD_ERROR="manifestLoadError",O.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",O.MANIFEST_PARSING_ERROR="manifestParsingError",O.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",O.LEVEL_EMPTY_ERROR="levelEmptyError",O.LEVEL_LOAD_ERROR="levelLoadError",O.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",O.LEVEL_SWITCH_ERROR="levelSwitchError",O.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",O.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",O.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",O.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",O.FRAG_LOAD_ERROR="fragLoadError",O.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",O.FRAG_DECRYPT_ERROR="fragDecryptError",O.FRAG_PARSING_ERROR="fragParsingError",O.REMUX_ALLOC_ERROR="remuxAllocError",O.KEY_LOAD_ERROR="keyLoadError",O.KEY_LOAD_TIMEOUT="keyLoadTimeOut",O.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",O.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",O.BUFFER_APPEND_ERROR="bufferAppendError",O.BUFFER_APPENDING_ERROR="bufferAppendingError",O.BUFFER_STALLED_ERROR="bufferStalledError",O.BUFFER_FULL_ERROR="bufferFullError",O.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",O.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",O.INTERNAL_EXCEPTION="internalException",O.INTERNAL_ABORTED="aborted",O.UNKNOWN="unknown"})(R||(R={}))},"./src/events.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"Events",function(){return F});var F;(function(R){R.MEDIA_ATTACHING="hlsMediaAttaching",R.MEDIA_ATTACHED="hlsMediaAttached",R.MEDIA_DETACHING="hlsMediaDetaching",R.MEDIA_DETACHED="hlsMediaDetached",R.BUFFER_RESET="hlsBufferReset",R.BUFFER_CODECS="hlsBufferCodecs",R.BUFFER_CREATED="hlsBufferCreated",R.BUFFER_APPENDING="hlsBufferAppending",R.BUFFER_APPENDED="hlsBufferAppended",R.BUFFER_EOS="hlsBufferEos",R.BUFFER_FLUSHING="hlsBufferFlushing",R.BUFFER_FLUSHED="hlsBufferFlushed",R.MANIFEST_LOADING="hlsManifestLoading",R.MANIFEST_LOADED="hlsManifestLoaded",R.MANIFEST_PARSED="hlsManifestParsed",R.LEVEL_SWITCHING="hlsLevelSwitching",R.LEVEL_SWITCHED="hlsLevelSwitched",R.LEVEL_LOADING="hlsLevelLoading",R.LEVEL_LOADED="hlsLevelLoaded",R.LEVEL_UPDATED="hlsLevelUpdated",R.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",R.LEVELS_UPDATED="hlsLevelsUpdated",R.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",R.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",R.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",R.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",R.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",R.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",R.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",R.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",R.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",R.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",R.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",R.CUES_PARSED="hlsCuesParsed",R.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",R.INIT_PTS_FOUND="hlsInitPtsFound",R.FRAG_LOADING="hlsFragLoading",R.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",R.FRAG_LOADED="hlsFragLoaded",R.FRAG_DECRYPTED="hlsFragDecrypted",R.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",R.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",R.FRAG_PARSING_METADATA="hlsFragParsingMetadata",R.FRAG_PARSED="hlsFragParsed",R.FRAG_BUFFERED="hlsFragBuffered",R.FRAG_CHANGED="hlsFragChanged",R.FPS_DROP="hlsFpsDrop",R.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",R.ERROR="hlsError",R.DESTROYING="hlsDestroying",R.KEY_LOADING="hlsKeyLoading",R.KEY_LOADED="hlsKeyLoaded",R.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",R.BACK_BUFFER_REACHED="hlsBackBufferReached"})(F||(F={}))},"./src/hls.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"default",function(){return A});var F=P("./node_modules/url-toolkit/src/url-toolkit.js"),R=P.n(F),O=P("./src/loader/playlist-loader.ts"),D=P("./src/loader/key-loader.ts"),m=P("./src/controller/id3-track-controller.ts"),T=P("./src/controller/latency-controller.ts"),b=P("./src/controller/level-controller.ts"),i=P("./src/controller/fragment-tracker.ts"),d=P("./src/controller/stream-controller.ts"),c=P("./src/is-supported.ts"),r=P("./src/utils/logger.ts"),a=P("./src/config.ts"),s=P("./node_modules/eventemitter3/index.js"),o=P.n(s),t=P("./src/events.ts"),h=P("./src/errors.ts");function g(w,M){for(var E=0;E<M.length;E++){var p=M[E];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(w,p.key,p)}}function C(w,M,E){return M&&g(w.prototype,M),E&&g(w,E),w}var A=function(){w.isSupported=function(){return Object(c.isSupported)()};function w(E){E===void 0&&(E={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new s.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var p=this.config=Object(a.mergeConfig)(w.DefaultConfig,E);this.userConfig=E,Object(r.enableLogs)(p.debug),this._autoLevelCapping=-1,p.progressive&&Object(a.enableStreamingMode)(p);var l=p.abrController,u=p.bufferController,f=p.capLevelController,_=p.fpsController,y=this.abrController=new l(this),v=this.bufferController=new u(this),N=this.capLevelController=new f(this),j=new _(this),U=new O.default(this),G=new D.default(this),z=new m.default(this),L=this.levelController=new b.default(this),V=new i.FragmentTracker(this),W=this.streamController=new d.default(this,V);N.setStreamController(W),j.setStreamController(W);var $=[L,W];this.networkControllers=$;var q=[U,G,y,v,N,j,z,V];this.audioTrackController=this.createController(p.audioTrackController,null,$),this.createController(p.audioStreamController,V,$),this.subtitleTrackController=this.createController(p.subtitleTrackController,null,$),this.createController(p.subtitleStreamController,V,$),this.createController(p.timelineController,null,q),this.emeController=this.createController(p.emeController,null,q),this.cmcdController=this.createController(p.cmcdController,null,q),this.latencyController=this.createController(T.default,null,q),this.coreComponents=q}var M=w.prototype;return M.createController=function(p,l,u){if(p){var f=l?new p(this,l):new p(this);return u&&u.push(f),f}return null},M.on=function(p,l,u){u===void 0&&(u=this),this._emitter.on(p,l,u)},M.once=function(p,l,u){u===void 0&&(u=this),this._emitter.once(p,l,u)},M.removeAllListeners=function(p){this._emitter.removeAllListeners(p)},M.off=function(p,l,u,f){u===void 0&&(u=this),this._emitter.off(p,l,u,f)},M.listeners=function(p){return this._emitter.listeners(p)},M.emit=function(p,l,u){return this._emitter.emit(p,l,u)},M.trigger=function(p,l){if(this.config.debug)return this.emit(p,p,l);try{return this.emit(p,p,l)}catch(u){r.logger.error("An internal error happened while handling event "+p+'. Error message: "'+u.message+'". Here is a stacktrace:',u),this.trigger(t.Events.ERROR,{type:h.ErrorTypes.OTHER_ERROR,details:h.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:p,error:u})}return!1},M.listenerCount=function(p){return this._emitter.listenerCount(p)},M.destroy=function(){r.logger.log("destroy"),this.trigger(t.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(p){return p.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(p){return p.destroy()}),this.coreComponents.length=0},M.attachMedia=function(p){r.logger.log("attachMedia"),this._media=p,this.trigger(t.Events.MEDIA_ATTACHING,{media:p})},M.detachMedia=function(){r.logger.log("detachMedia"),this.trigger(t.Events.MEDIA_DETACHING,void 0),this._media=null},M.loadSource=function(p){this.stopLoad();var l=this.media,u=this.url,f=this.url=F.buildAbsoluteURL(self.location.href,p,{alwaysNormalize:!0});r.logger.log("loadSource:"+f),l&&u&&u!==f&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(l)),this.trigger(t.Events.MANIFEST_LOADING,{url:p})},M.startLoad=function(p){p===void 0&&(p=-1),r.logger.log("startLoad("+p+")"),this.networkControllers.forEach(function(l){l.startLoad(p)})},M.stopLoad=function(){r.logger.log("stopLoad"),this.networkControllers.forEach(function(p){p.stopLoad()})},M.swapAudioCodec=function(){r.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},M.recoverMediaError=function(){r.logger.log("recoverMediaError");var p=this._media;this.detachMedia(),p&&this.attachMedia(p)},M.removeLevel=function(p,l){l===void 0&&(l=0),this.levelController.removeLevel(p,l)},C(w,[{key:"levels",get:function(){var p=this.levelController.levels;return p||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(p){r.logger.log("set currentLevel:"+p),this.loadLevel=p,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(p){r.logger.log("set nextLevel:"+p),this.levelController.manualLevel=p,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(p){r.logger.log("set loadLevel:"+p),this.levelController.manualLevel=p}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(p){this.levelController.nextLoadLevel=p}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(p){r.logger.log("set firstLevel:"+p),this.levelController.firstLevel=p}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(p){r.logger.log("set startLevel:"+p),p!==-1&&(p=Math.max(p,this.minAutoLevel)),this.levelController.startLevel=p}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(p){var l=!!p;l!==this.config.capLevelToPlayerSize&&(l?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=l)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(p){this._autoLevelCapping!==p&&(r.logger.log("set autoLevelCapping:"+p),this._autoLevelCapping=p)}},{key:"bandwidthEstimate",get:function(){var p=this.abrController.bwEstimator;return p?p.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var p=this.levels,l=this.config.minAutoBitrate;if(!p)return 0;for(var u=p.length,f=0;f<u;f++)if(p[f].maxBitrate>l)return f;return 0}},{key:"maxAutoLevel",get:function(){var p=this.levels,l=this.autoLevelCapping,u;return l===-1&&p&&p.length?u=p.length-1:u=l,u}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(p){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,p)}},{key:"audioTracks",get:function(){var p=this.audioTrackController;return p?p.audioTracks:[]}},{key:"audioTrack",get:function(){var p=this.audioTrackController;return p?p.audioTrack:-1},set:function(p){var l=this.audioTrackController;l&&(l.audioTrack=p)}},{key:"subtitleTracks",get:function(){var p=this.subtitleTrackController;return p?p.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var p=this.subtitleTrackController;return p?p.subtitleTrack:-1},set:function(p){var l=this.subtitleTrackController;l&&(l.subtitleTrack=p)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var p=this.subtitleTrackController;return p?p.subtitleDisplay:!1},set:function(p){var l=this.subtitleTrackController;l&&(l.subtitleDisplay=p)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(p){this.config.lowLatencyMode=p}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return t.Events}},{key:"ErrorTypes",get:function(){return h.ErrorTypes}},{key:"ErrorDetails",get:function(){return h.ErrorDetails}},{key:"DefaultConfig",get:function(){return w.defaultConfig?w.defaultConfig:a.hlsDefaultConfig},set:function(p){w.defaultConfig=p}}]),w}();A.defaultConfig=void 0},"./src/is-supported.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"isSupported",function(){return O}),P.d(H,"changeTypeSupported",function(){return D});var F=P("./src/utils/mediasource-helper.ts");function R(){return self.SourceBuffer||self.WebKitSourceBuffer}function O(){var m=Object(F.getMediaSource)();if(!m)return!1;var T=R(),b=m&&typeof m.isTypeSupported=="function"&&m.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),i=!T||T.prototype&&typeof T.prototype.appendBuffer=="function"&&typeof T.prototype.remove=="function";return!!b&&!!i}function D(){var m,T=R();return typeof(T==null||((m=T.prototype)===null||m===void 0)?void 0:m.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"default",function(){return r}),P.d(H,"LoadError",function(){return s});var F=P("./src/polyfills/number.ts"),R=P("./src/errors.ts");function O(o,t){o.prototype=Object.create(t.prototype),o.prototype.constructor=o,i(o,t)}function D(o){var t=typeof Map=="function"?new Map:void 0;return D=function(g){if(g===null||!b(g))return g;if(typeof g!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t!="undefined"){if(t.has(g))return t.get(g);t.set(g,C)}function C(){return m(g,arguments,d(this).constructor)}return C.prototype=Object.create(g.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),i(C,g)},D(o)}function m(o,t,h){return T()?m=Reflect.construct:m=function(C,A,w){var M=[null];M.push.apply(M,A);var E=Function.bind.apply(C,M),p=new E;return w&&i(p,w.prototype),p},m.apply(null,arguments)}function T(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(o){return!1}}function b(o){return Function.toString.call(o).indexOf("[native code]")!==-1}function i(o,t){return i=Object.setPrototypeOf||function(g,C){return g.__proto__=C,g},i(o,t)}function d(o){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(h){return h.__proto__||Object.getPrototypeOf(h)},d(o)}var c=Math.pow(2,17),r=function(){function o(h){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=h}var t=o.prototype;return t.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},t.abort=function(){this.loader&&this.loader.abort()},t.load=function(g,C){var A=this,w=g.url;if(!w)return Promise.reject(new s({type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:g,networkDetails:null},"Fragment does not have a "+(w?"part list":"url")));this.abort();var M=this.config,E=M.fLoader,p=M.loader;return new Promise(function(l,u){A.loader&&A.loader.destroy();var f=A.loader=g.loader=E?new E(M):new p(M),_=a(g),y={timeout:M.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:M.fragLoadingMaxRetryTimeout,highWaterMark:c};g.stats=f.stats,f.load(_,y,{onSuccess:function(N,j,U,G){A.resetLoader(g,f),l({frag:g,part:null,payload:N.data,networkDetails:G})},onError:function(N,j,U){A.resetLoader(g,f),u(new s({type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:g,response:N,networkDetails:U}))},onAbort:function(N,j,U){A.resetLoader(g,f),u(new s({type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:g,networkDetails:U}))},onTimeout:function(N,j,U){A.resetLoader(g,f),u(new s({type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:g,networkDetails:U}))},onProgress:function(N,j,U,G){C&&C({frag:g,part:null,payload:U,networkDetails:G})}})})},t.loadPart=function(g,C,A){var w=this;this.abort();var M=this.config,E=M.fLoader,p=M.loader;return new Promise(function(l,u){w.loader&&w.loader.destroy();var f=w.loader=g.loader=E?new E(M):new p(M),_=a(g,C),y={timeout:M.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:M.fragLoadingMaxRetryTimeout,highWaterMark:c};C.stats=f.stats,f.load(_,y,{onSuccess:function(N,j,U,G){w.resetLoader(g,f),w.updateStatsFromPart(g,C);var z={frag:g,part:C,payload:N.data,networkDetails:G};A(z),l(z)},onError:function(N,j,U){w.resetLoader(g,f),u(new s({type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:g,part:C,response:N,networkDetails:U}))},onAbort:function(N,j,U){g.stats.aborted=C.stats.aborted,w.resetLoader(g,f),u(new s({type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:g,part:C,networkDetails:U}))},onTimeout:function(N,j,U){w.resetLoader(g,f),u(new s({type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:g,part:C,networkDetails:U}))}})})},t.updateStatsFromPart=function(g,C){var A=g.stats,w=C.stats,M=w.total;if(A.loaded+=w.loaded,M){var E=Math.round(g.duration/C.duration),p=Math.min(Math.round(A.loaded/M),E),l=E-p,u=l*Math.round(A.loaded/p);A.total=A.loaded+u}else A.total=Math.max(A.loaded,A.total);var f=A.loading,_=w.loading;f.start?f.first+=_.first-_.start:(f.start=_.start,f.first=_.first),f.end=_.end},t.resetLoader=function(g,C){g.loader=null,this.loader===C&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),C.destroy()},o}();function a(o,t){t===void 0&&(t=null);var h=t||o,g={frag:o,part:t,responseType:"arraybuffer",url:h.url,headers:{},rangeStart:0,rangeEnd:0},C=h.byteRangeStartOffset,A=h.byteRangeEndOffset;return Object(F.isFiniteNumber)(C)&&Object(F.isFiniteNumber)(A)&&(g.rangeStart=C,g.rangeEnd=A),g}var s=function(o){O(t,o);function t(h){for(var g,C=arguments.length,A=new Array(C>1?C-1:0),w=1;w<C;w++)A[w-1]=arguments[w];return g=o.call.apply(o,[this].concat(A))||this,g.data=void 0,g.data=h,g}return t}(D(Error))},"./src/loader/fragment.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"ElementaryStreamTypes",function(){return r}),P.d(H,"BaseSegment",function(){return a}),P.d(H,"Fragment",function(){return s}),P.d(H,"Part",function(){return o});var F=P("./src/polyfills/number.ts"),R=P("./node_modules/url-toolkit/src/url-toolkit.js"),O=P.n(R),D=P("./src/utils/logger.ts"),m=P("./src/loader/level-key.ts"),T=P("./src/loader/load-stats.ts");function b(t,h){t.prototype=Object.create(h.prototype),t.prototype.constructor=t,i(t,h)}function i(t,h){return i=Object.setPrototypeOf||function(C,A){return C.__proto__=A,C},i(t,h)}function d(t,h){for(var g=0;g<h.length;g++){var C=h[g];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(t,C.key,C)}}function c(t,h,g){return h&&d(t.prototype,h),g&&d(t,g),t}var r;(function(t){t.AUDIO="audio",t.VIDEO="video",t.AUDIOVIDEO="audiovideo"})(r||(r={}));var a=function(){function t(g){var C;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(C={},C[r.AUDIO]=null,C[r.VIDEO]=null,C[r.AUDIOVIDEO]=null,C),this.baseurl=g}var h=t.prototype;return h.setByteRange=function(C,A){var w=C.split("@",2),M=[];w.length===1?M[0]=A?A.byteRangeEndOffset:0:M[0]=parseInt(w[1]),M[1]=parseInt(w[0])+M[0],this._byteRange=M},c(t,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(R.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(C){this._url=C}}]),t}(),s=function(t){b(h,t);function h(C,A){var w;return w=t.call(this,A)||this,w._decryptdata=null,w.rawProgramDateTime=null,w.programDateTime=null,w.tagList=[],w.duration=0,w.sn=0,w.levelkey=void 0,w.type=void 0,w.loader=null,w.level=-1,w.cc=0,w.startPTS=void 0,w.endPTS=void 0,w.appendedPTS=void 0,w.startDTS=void 0,w.endDTS=void 0,w.start=0,w.deltaPTS=void 0,w.maxStartPTS=void 0,w.minEndPTS=void 0,w.stats=new T.LoadStats,w.urlId=0,w.data=void 0,w.bitrateTest=!1,w.title=null,w.initSegment=null,w.type=C,w}var g=h.prototype;return g.createInitializationVector=function(A){for(var w=new Uint8Array(16),M=12;M<16;M++)w[M]=A>>8*(15-M)&255;return w},g.setDecryptDataFromLevelKey=function(A,w){var M=A;return(A==null?void 0:A.method)==="AES-128"&&A.uri&&!A.iv&&(M=m.LevelKey.fromURI(A.uri),M.method=A.method,M.iv=this.createInitializationVector(w),M.keyFormat="identity"),M},g.setElementaryStreamInfo=function(A,w,M,E,p,l){l===void 0&&(l=!1);var u=this.elementaryStreams,f=u[A];if(!f){u[A]={startPTS:w,endPTS:M,startDTS:E,endDTS:p,partial:l};return}f.startPTS=Math.min(f.startPTS,w),f.endPTS=Math.max(f.endPTS,M),f.startDTS=Math.min(f.startDTS,E),f.endDTS=Math.max(f.endDTS,p)},g.clearElementaryStreamInfo=function(){var A=this.elementaryStreams;A[r.AUDIO]=null,A[r.VIDEO]=null,A[r.AUDIOVIDEO]=null},c(h,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var A=this.sn;typeof A!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&D.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),A=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,A)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(F.isFiniteNumber)(this.programDateTime))return null;var A=Object(F.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+A*1e3}},{key:"encrypted",get:function(){var A;return!!((A=this.decryptdata)!==null&&A!==void 0&&A.keyFormat&&this.decryptdata.uri)}}]),h}(a),o=function(t){b(h,t);function h(g,C,A,w,M){var E;E=t.call(this,A)||this,E.fragOffset=0,E.duration=0,E.gap=!1,E.independent=!1,E.relurl=void 0,E.fragment=void 0,E.index=void 0,E.stats=new T.LoadStats,E.duration=g.decimalFloatingPoint("DURATION"),E.gap=g.bool("GAP"),E.independent=g.bool("INDEPENDENT"),E.relurl=g.enumeratedString("URI"),E.fragment=C,E.index=w;var p=g.enumeratedString("BYTERANGE");return p&&E.setByteRange(p,M),M&&(E.fragOffset=M.fragOffset+M.duration),E}return c(h,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var C=this.elementaryStreams;return!!(C.audio||C.video||C.audiovideo)}}]),h}(a)},"./src/loader/key-loader.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"default",function(){return D});var F=P("./src/events.ts"),R=P("./src/errors.ts"),O=P("./src/utils/logger.ts"),D=function(){function m(b){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=b,this._registerListeners()}var T=m.prototype;return T._registerListeners=function(){this.hls.on(F.Events.KEY_LOADING,this.onKeyLoading,this)},T._unregisterListeners=function(){this.hls.off(F.Events.KEY_LOADING,this.onKeyLoading)},T.destroy=function(){this._unregisterListeners();for(var i in this.loaders){var d=this.loaders[i];d&&d.destroy()}this.loaders={}},T.onKeyLoading=function(i,d){var c=d.frag,r=c.type,a=this.loaders[r];if(!c.decryptdata){O.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var s=c.decryptdata.uri;if(s!==this.decrypturl||this.decryptkey===null){var o=this.hls.config;if(a&&(O.logger.warn("abort previous key loader for type:"+r),a.abort()),!s){O.logger.warn("key uri is falsy");return}var t=o.loader,h=c.loader=this.loaders[r]=new t(o);this.decrypturl=s,this.decryptkey=null;var g={url:s,frag:c,responseType:"arraybuffer"},C={timeout:o.fragLoadingTimeOut,maxRetry:0,retryDelay:o.fragLoadingRetryDelay,maxRetryDelay:o.fragLoadingMaxRetryTimeout,highWaterMark:0},A={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};h.load(g,C,A)}else this.decryptkey&&(c.decryptdata.key=this.decryptkey,this.hls.trigger(F.Events.KEY_LOADED,{frag:c}))},T.loadsuccess=function(i,d,c){var r=c.frag;if(!r.decryptdata){O.logger.error("after key load, decryptdata unset");return}this.decryptkey=r.decryptdata.key=new Uint8Array(i.data),r.loader=null,delete this.loaders[r.type],this.hls.trigger(F.Events.KEY_LOADED,{frag:r})},T.loaderror=function(i,d){var c=d.frag,r=c.loader;r&&r.abort(),delete this.loaders[c.type],this.hls.trigger(F.Events.ERROR,{type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:c,response:i})},T.loadtimeout=function(i,d){var c=d.frag,r=c.loader;r&&r.abort(),delete this.loaders[c.type],this.hls.trigger(F.Events.ERROR,{type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:c})},m}()},"./src/loader/level-details.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"LevelDetails",function(){return m});var F=P("./src/polyfills/number.ts");function R(T,b){for(var i=0;i<b.length;i++){var d=b[i];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(T,d.key,d)}}function O(T,b,i){return b&&R(T.prototype,b),i&&R(T,i),T}var D=10,m=function(){function T(i){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=i}var b=T.prototype;return b.reloaded=function(d){if(!d){this.advanced=!0,this.updated=!0;return}var c=this.lastPartSn-d.lastPartSn,r=this.lastPartIndex-d.lastPartIndex;this.updated=this.endSN!==d.endSN||!!r||!!c,this.advanced=this.endSN>d.endSN||c>0||c===0&&r>0,this.updated||this.advanced?this.misses=Math.floor(d.misses*.6):this.misses=d.misses+1,this.availabilityDelay=d.availabilityDelay},O(T,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(F.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||D}},{key:"drift",get:function(){var d=this.driftEndTime-this.driftStartTime;if(d>0){var c=this.driftEnd-this.driftStart;return c*1e3/d}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var d;return(d=this.partList)!==null&&d!==void 0&&d.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var d;return(d=this.fragments)!==null&&d!==void 0&&d.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 d;return(d=this.partList)!==null&&d!==void 0&&d.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var d;return(d=this.partList)!==null&&d!==void 0&&d.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),T}()},"./src/loader/level-key.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"LevelKey",function(){return m});var F=P("./node_modules/url-toolkit/src/url-toolkit.js"),R=P.n(F);function O(T,b){for(var i=0;i<b.length;i++){var d=b[i];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(T,d.key,d)}}function D(T,b,i){return b&&O(T.prototype,b),i&&O(T,i),T}var m=function(){T.fromURL=function(i,d){return new T(i,d)},T.fromURI=function(i){return new T(i)};function T(b,i){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,i?this._uri=Object(F.buildAbsoluteURL)(b,i,{alwaysNormalize:!0}):this._uri=b}return D(T,[{key:"uri",get:function(){return this._uri}}]),T}()},"./src/loader/load-stats.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"LoadStats",function(){return F});var F=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(Y,H,P){"use strict";P.r(H),P.d(H,"default",function(){return h});var F=P("./src/polyfills/number.ts"),R=P("./node_modules/url-toolkit/src/url-toolkit.js"),O=P.n(R),D=P("./src/loader/fragment.ts"),m=P("./src/loader/level-details.ts"),T=P("./src/loader/level-key.ts"),b=P("./src/utils/attr-list.ts"),i=P("./src/utils/logger.ts"),d=P("./src/utils/codecs.ts"),c=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,r=/#EXT-X-MEDIA:(.*)/g,a=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),s=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),o=/\.(mp4|m4s|m4v|m4a)$/i;function t(M){var E,p;return o.test((E=(p=R.parseURL(M))===null||p===void 0?void 0:p.path)!=null?E:"")}var h=function(){function M(){}return M.findGroup=function(p,l){for(var u=0;u<p.length;u++){var f=p[u];if(f.id===l)return f}},M.convertAVC1ToAVCOTI=function(p){var l=p.split(".");if(l.length>2){var u=l.shift()+".";return u+=parseInt(l.shift()).toString(16),u+=("000"+parseInt(l.shift()).toString(16)).substr(-4),u}return p},M.resolve=function(p,l){return R.buildAbsoluteURL(l,p,{alwaysNormalize:!0})},M.parseMasterPlaylist=function(p,l){var u=[],f={},_=!1;c.lastIndex=0;for(var y;(y=c.exec(p))!=null;)if(y[1]){var v=new b.AttrList(y[1]),N={attrs:v,bitrate:v.decimalInteger("AVERAGE-BANDWIDTH")||v.decimalInteger("BANDWIDTH"),name:v.NAME,url:M.resolve(y[2],l)},j=v.decimalResolution("RESOLUTION");j&&(N.width=j.width,N.height=j.height),g((v.CODECS||"").split(/[ ,]+/).filter(function(G){return G}),N),N.videoCodec&&N.videoCodec.indexOf("avc1")!==-1&&(N.videoCodec=M.convertAVC1ToAVCOTI(N.videoCodec)),u.push(N)}else if(y[3]){var U=new b.AttrList(y[3]);U["DATA-ID"]&&(_=!0,f[U["DATA-ID"]]=U)}return{levels:u,sessionData:_?f:null}},M.parseMasterPlaylistMedia=function(p,l,u,f){f===void 0&&(f=[]);var _,y=[],v=0;for(r.lastIndex=0;(_=r.exec(p))!==null;){var N=new b.AttrList(_[1]);if(N.TYPE===u){var j={attrs:N,bitrate:0,id:v++,groupId:N["GROUP-ID"],instreamId:N["INSTREAM-ID"],name:N.NAME||N.LANGUAGE||"",type:u,default:N.bool("DEFAULT"),autoselect:N.bool("AUTOSELECT"),forced:N.bool("FORCED"),lang:N.LANGUAGE,url:N.URI?M.resolve(N.URI,l):""};if(f.length){var U=M.findGroup(f,j.groupId)||f[0];C(j,U,"audioCodec"),C(j,U,"textCodec")}y.push(j)}}return y},M.parseLevelPlaylist=function(p,l,u,f,_){var y=new m.LevelDetails(l),v=y.fragments,N=null,j=0,U=0,G=0,z=0,L=null,V=new D.Fragment(f,l),W,$,q,fe=-1,se=!1;for(a.lastIndex=0,y.m3u8=p;(W=a.exec(p))!==null;){se&&(se=!1,V=new D.Fragment(f,l),V.start=G,V.sn=j,V.cc=z,V.level=u,N&&(V.initSegment=N,V.rawProgramDateTime=N.rawProgramDateTime));var me=W[1];if(me){V.duration=parseFloat(me);var ve=(" "+W[2]).slice(1);V.title=ve||null,V.tagList.push(ve?["INF",me,ve]:["INF",me])}else if(W[3])Object(F.isFiniteNumber)(V.duration)&&(V.start=G,q&&(V.levelkey=q),V.sn=j,V.level=u,V.cc=z,V.urlId=_,v.push(V),V.relurl=(" "+W[3]).slice(1),w(V,L),L=V,G+=V.duration,j++,U=0,se=!0);else if(W[4]){var Ae=(" "+W[4]).slice(1);L?V.setByteRange(Ae,L):V.setByteRange(Ae)}else if(W[5])V.rawProgramDateTime=(" "+W[5]).slice(1),V.tagList.push(["PROGRAM-DATE-TIME",V.rawProgramDateTime]),fe===-1&&(fe=v.length);else{if(W=W[0].match(s),!W){i.logger.warn("No matches on slow regex match for level playlist!");continue}for($=1;$<W.length&&!(typeof W[$]!="undefined");$++);var ge=(" "+W[$]).slice(1),ue=(" "+W[$+1]).slice(1),$e=W[$+2]?(" "+W[$+2]).slice(1):"";switch(ge){case"PLAYLIST-TYPE":y.type=ue.toUpperCase();break;case"MEDIA-SEQUENCE":j=y.startSN=parseInt(ue);break;case"SKIP":{var Tt=new b.AttrList(ue),ye=Tt.decimalInteger("SKIPPED-SEGMENTS");if(Object(F.isFiniteNumber)(ye)){y.skippedSegments=ye;for(var Re=ye;Re--;)v.unshift(null);j+=ye}var nt=Tt.enumeratedString("RECENTLY-REMOVED-DATERANGES");nt&&(y.recentlyRemovedDateranges=nt.split(" "));break}case"TARGETDURATION":y.targetduration=parseFloat(ue);break;case"VERSION":y.version=parseInt(ue);break;case"EXTM3U":break;case"ENDLIST":y.live=!1;break;case"#":(ue||$e)&&V.tagList.push($e?[ue,$e]:[ue]);break;case"DIS":z++;case"GAP":V.tagList.push([ge]);break;case"BITRATE":V.tagList.push([ge,ue]);break;case"DISCONTINUITY-SEQ":z=parseInt(ue);break;case"KEY":{var Ue,ke=new b.AttrList(ue),lt=ke.enumeratedString("METHOD"),Fe=ke.URI,Ze=ke.hexadecimalInteger("IV"),Xe=ke.enumeratedString("KEYFORMATVERSIONS"),ft=ke.enumeratedString("KEYID"),Rt=(Ue=ke.enumeratedString("KEYFORMAT"))!=null?Ue:"identity",Pt=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Pt.indexOf(Rt)>-1){i.logger.warn("Keyformat "+Rt+" is not supported from the manifest");continue}else if(Rt!=="identity")continue;lt&&(q=T.LevelKey.fromURL(l,Fe),Fe&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(lt)>=0&&(q.method=lt,q.keyFormat=Rt,ft&&(q.keyID=ft),Xe&&(q.keyFormatVersions=Xe),q.iv=Ze));break}case"START":{var Bt=new b.AttrList(ue),Ve=Bt.decimalFloatingPoint("TIME-OFFSET");Object(F.isFiniteNumber)(Ve)&&(y.startTimeOffset=Ve);break}case"MAP":{var Ft=new b.AttrList(ue);V.relurl=Ft.URI,Ft.BYTERANGE&&V.setByteRange(Ft.BYTERANGE),V.level=u,V.sn="initSegment",q&&(V.levelkey=q),V.initSegment=null,N=V,se=!0;break}case"SERVER-CONTROL":{var nn=new b.AttrList(ue);y.canBlockReload=nn.bool("CAN-BLOCK-RELOAD"),y.canSkipUntil=nn.optionalFloat("CAN-SKIP-UNTIL",0),y.canSkipDateRanges=y.canSkipUntil>0&&nn.bool("CAN-SKIP-DATERANGES"),y.partHoldBack=nn.optionalFloat("PART-HOLD-BACK",0),y.holdBack=nn.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Le=new b.AttrList(ue);y.partTarget=Le.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Se=y.partList;Se||(Se=y.partList=[]);var ut=U>0?Se[Se.length-1]:void 0,mt=U++,We=new D.Part(new b.AttrList(ue),V,l,mt,ut);Se.push(We),V.duration+=We.duration;break}case"PRELOAD-HINT":{var vt=new b.AttrList(ue);y.preloadHint=vt;break}case"RENDITION-REPORT":{var Pe=new b.AttrList(ue);y.renditionReports=y.renditionReports||[],y.renditionReports.push(Pe);break}default:i.logger.warn("line parsed but not handled: "+W);break}}}L&&!L.relurl?(v.pop(),G-=L.duration,y.partList&&(y.fragmentHint=L)):y.partList&&(w(V,L),V.cc=z,y.fragmentHint=V);var xe=v.length,we=v[0],ie=v[xe-1];if(G+=y.skippedSegments*y.targetduration,G>0&&xe&&ie){y.averagetargetduration=G/xe;var ae=ie.sn;y.endSN=ae!=="initSegment"?ae:0,we&&(y.startCC=we.cc,we.initSegment||y.fragments.every(function(ce){return ce.relurl&&t(ce.relurl)})&&(i.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),V=new D.Fragment(f,l),V.relurl=ie.relurl,V.level=u,V.sn="initSegment",we.initSegment=V,y.needSidxRanges=!0))}else y.endSN=0,y.startCC=0;return y.fragmentHint&&(G+=y.fragmentHint.duration),y.totalduration=G,y.endCC=z,fe>0&&A(v,fe),y},M}();function g(M,E){["video","audio","text"].forEach(function(p){var l=M.filter(function(f){return Object(d.isCodecType)(f,p)});if(l.length){var u=l.filter(function(f){return f.lastIndexOf("avc1",0)===0||f.lastIndexOf("mp4a",0)===0});E[p+"Codec"]=u.length>0?u[0]:l[0],M=M.filter(function(f){return l.indexOf(f)===-1})}}),E.unknownCodecs=M}function C(M,E,p){var l=E[p];l&&(M[p]=l)}function A(M,E){for(var p=M[E],l=E;l--;){var u=M[l];if(!u)return;u.programDateTime=p.programDateTime-u.duration*1e3,p=u}}function w(M,E){M.rawProgramDateTime?M.programDateTime=Date.parse(M.rawProgramDateTime):E!=null&&E.programDateTime&&(M.programDateTime=E.endProgramDateTime),Object(F.isFiniteNumber)(M.programDateTime)||(M.programDateTime=null,M.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(Y,H,P){"use strict";P.r(H);var F=P("./src/polyfills/number.ts"),R=P("./src/events.ts"),O=P("./src/errors.ts"),D=P("./src/utils/logger.ts"),m=P("./src/utils/mp4-tools.ts"),T=P("./src/loader/m3u8-parser.ts"),b=P("./src/types/loader.ts"),i=P("./src/utils/attr-list.ts");function d(a){var s=a.type;switch(s){case b.PlaylistContextType.AUDIO_TRACK:return b.PlaylistLevelType.AUDIO;case b.PlaylistContextType.SUBTITLE_TRACK:return b.PlaylistLevelType.SUBTITLE;default:return b.PlaylistLevelType.MAIN}}function c(a,s){var o=a.url;return(o===void 0||o.indexOf("data:")===0)&&(o=s.url),o}var r=function(){function a(o){this.hls=void 0,this.loaders=Object.create(null),this.hls=o,this.registerListeners()}var s=a.prototype;return s.registerListeners=function(){var t=this.hls;t.on(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(R.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(R.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.on(R.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},s.unregisterListeners=function(){var t=this.hls;t.off(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(R.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(R.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.off(R.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},s.createInternalLoader=function(t){var h=this.hls.config,g=h.pLoader,C=h.loader,A=g||C,w=new A(h);return t.loader=w,this.loaders[t.type]=w,w},s.getInternalLoader=function(t){return this.loaders[t.type]},s.resetInternalLoader=function(t){this.loaders[t]&&delete this.loaders[t]},s.destroyInternalLoaders=function(){for(var t in this.loaders){var h=this.loaders[t];h&&h.destroy(),this.resetInternalLoader(t)}},s.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},s.onManifestLoading=function(t,h){var g=h.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:b.PlaylistContextType.MANIFEST,url:g,deliveryDirectives:null})},s.onLevelLoading=function(t,h){var g=h.id,C=h.level,A=h.url,w=h.deliveryDirectives;this.load({id:g,groupId:null,level:C,responseType:"text",type:b.PlaylistContextType.LEVEL,url:A,deliveryDirectives:w})},s.onAudioTrackLoading=function(t,h){var g=h.id,C=h.groupId,A=h.url,w=h.deliveryDirectives;this.load({id:g,groupId:C,level:null,responseType:"text",type:b.PlaylistContextType.AUDIO_TRACK,url:A,deliveryDirectives:w})},s.onSubtitleTrackLoading=function(t,h){var g=h.id,C=h.groupId,A=h.url,w=h.deliveryDirectives;this.load({id:g,groupId:C,level:null,responseType:"text",type:b.PlaylistContextType.SUBTITLE_TRACK,url:A,deliveryDirectives:w})},s.load=function(t){var h,g=this.hls.config,C=this.getInternalLoader(t);if(C){var A=C.context;if(A&&A.url===t.url){D.logger.trace("[playlist-loader]: playlist request ongoing");return}D.logger.log("[playlist-loader]: aborting previous loader for type: "+t.type),C.abort()}var w,M,E,p;switch(t.type){case b.PlaylistContextType.MANIFEST:w=g.manifestLoadingMaxRetry,M=g.manifestLoadingTimeOut,E=g.manifestLoadingRetryDelay,p=g.manifestLoadingMaxRetryTimeout;break;case b.PlaylistContextType.LEVEL:case b.PlaylistContextType.AUDIO_TRACK:case b.PlaylistContextType.SUBTITLE_TRACK:w=0,M=g.levelLoadingTimeOut;break;default:w=g.levelLoadingMaxRetry,M=g.levelLoadingTimeOut,E=g.levelLoadingRetryDelay,p=g.levelLoadingMaxRetryTimeout;break}if(C=this.createInternalLoader(t),(h=t.deliveryDirectives)!==null&&h!==void 0&&h.part){var l;if(t.type===b.PlaylistContextType.LEVEL&&t.level!==null?l=this.hls.levels[t.level].details:t.type===b.PlaylistContextType.AUDIO_TRACK&&t.id!==null?l=this.hls.audioTracks[t.id].details:t.type===b.PlaylistContextType.SUBTITLE_TRACK&&t.id!==null&&(l=this.hls.subtitleTracks[t.id].details),l){var u=l.partTarget,f=l.targetduration;u&&f&&(M=Math.min(Math.max(u*3,f*.8)*1e3,M))}}var _={timeout:M,maxRetry:w,retryDelay:E,maxRetryDelay:p,highWaterMark:0},y={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};C.load(t,_,y)},s.loadsuccess=function(t,h,g,C){if(C===void 0&&(C=null),g.isSidxRequest){this.handleSidxRequest(t,g),this.handlePlaylistLoaded(t,h,g,C);return}this.resetInternalLoader(g.type);var A=t.data;if(A.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(t,g,"no EXTM3U delimiter",C);return}h.parsing.start=performance.now(),A.indexOf("#EXTINF:")>0||A.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(t,h,g,C):this.handleMasterPlaylist(t,h,g,C)},s.loaderror=function(t,h,g){g===void 0&&(g=null),this.handleNetworkError(h,g,!1,t)},s.loadtimeout=function(t,h,g){g===void 0&&(g=null),this.handleNetworkError(h,g,!0)},s.handleMasterPlaylist=function(t,h,g,C){var A=this.hls,w=t.data,M=c(t,g),E=T.default.parseMasterPlaylist(w,M),p=E.levels,l=E.sessionData;if(!p.length){this.handleManifestParsingError(t,g,"no level found in manifest",C);return}var u=p.map(function(j){return{id:j.attrs.AUDIO,audioCodec:j.audioCodec}}),f=p.map(function(j){return{id:j.attrs.SUBTITLES,textCodec:j.textCodec}}),_=T.default.parseMasterPlaylistMedia(w,M,"AUDIO",u),y=T.default.parseMasterPlaylistMedia(w,M,"SUBTITLES",f),v=T.default.parseMasterPlaylistMedia(w,M,"CLOSED-CAPTIONS");if(_.length){var N=_.some(function(j){return!j.url});!N&&p[0].audioCodec&&!p[0].attrs.AUDIO&&(D.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),_.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new i.AttrList({}),bitrate:0,url:""}))}A.trigger(R.Events.MANIFEST_LOADED,{levels:p,audioTracks:_,subtitles:y,captions:v,url:M,stats:h,networkDetails:C,sessionData:l})},s.handleTrackOrLevelPlaylist=function(t,h,g,C){var A=this.hls,w=g.id,M=g.level,E=g.type,p=c(t,g),l=Object(F.isFiniteNumber)(w)?w:0,u=Object(F.isFiniteNumber)(M)?M:l,f=d(g),_=T.default.parseLevelPlaylist(t.data,p,u,f,l);if(!_.fragments.length){A.trigger(R.Events.ERROR,{type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:p,reason:"no fragments found in level",level:typeof g.level=="number"?g.level:void 0});return}if(E===b.PlaylistContextType.MANIFEST){var y={attrs:new i.AttrList({}),bitrate:0,details:_,name:"",url:p};A.trigger(R.Events.MANIFEST_LOADED,{levels:[y],audioTracks:[],url:p,stats:h,networkDetails:C,sessionData:null})}if(h.parsing.end=performance.now(),_.needSidxRanges){var v,N=(v=_.fragments[0].initSegment)===null||v===void 0?void 0:v.url;this.load({url:N,isSidxRequest:!0,type:E,level:M,levelDetails:_,id:w,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}g.levelDetails=_,this.handlePlaylistLoaded(t,h,g,C)},s.handleSidxRequest=function(t,h){var g=Object(m.parseSegmentIndex)(new Uint8Array(t.data));if(!g)return;var C=g.references,A=h.levelDetails;C.forEach(function(w,M){var E=w.info,p=A.fragments[M];p.byteRange.length===0&&p.setByteRange(String(1+E.end-E.start)+"@"+String(E.start)),p.initSegment&&p.initSegment.setByteRange(String(g.moovEndOffset)+"@0")})},s.handleManifestParsingError=function(t,h,g,C){this.hls.trigger(R.Events.ERROR,{type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:h.type===b.PlaylistContextType.MANIFEST,url:t.url,reason:g,response:t,context:h,networkDetails:C})},s.handleNetworkError=function(t,h,g,C){g===void 0&&(g=!1),D.logger.warn("[playlist-loader]: A network "+(g?"timeout":"error")+" occurred while loading "+t.type+" level: "+t.level+" id: "+t.id+' group-id: "'+t.groupId+'"');var A=O.ErrorDetails.UNKNOWN,w=!1,M=this.getInternalLoader(t);switch(t.type){case b.PlaylistContextType.MANIFEST:A=g?O.ErrorDetails.MANIFEST_LOAD_TIMEOUT:O.ErrorDetails.MANIFEST_LOAD_ERROR,w=!0;break;case b.PlaylistContextType.LEVEL:A=g?O.ErrorDetails.LEVEL_LOAD_TIMEOUT:O.ErrorDetails.LEVEL_LOAD_ERROR,w=!1;break;case b.PlaylistContextType.AUDIO_TRACK:A=g?O.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:O.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,w=!1;break;case b.PlaylistContextType.SUBTITLE_TRACK:A=g?O.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:O.ErrorDetails.SUBTITLE_LOAD_ERROR,w=!1;break}M&&this.resetInternalLoader(t.type);var E={type:O.ErrorTypes.NETWORK_ERROR,details:A,fatal:w,url:t.url,loader:M,context:t,networkDetails:h};C&&(E.response=C),this.hls.trigger(R.Events.ERROR,E)},s.handlePlaylistLoaded=function(t,h,g,C){var A=g.type,w=g.level,M=g.id,E=g.groupId,p=g.loader,l=g.levelDetails,u=g.deliveryDirectives;if(!(l!=null&&l.targetduration)){this.handleManifestParsingError(t,g,"invalid target duration",C);return}if(!p)return;l.live&&(p.getCacheAge&&(l.ageHeader=p.getCacheAge()||0),(!p.getCacheAge||isNaN(l.ageHeader))&&(l.ageHeader=0));switch(A){case b.PlaylistContextType.MANIFEST:case b.PlaylistContextType.LEVEL:this.hls.trigger(R.Events.LEVEL_LOADED,{details:l,level:w||0,id:M||0,stats:h,networkDetails:C,deliveryDirectives:u});break;case b.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(R.Events.AUDIO_TRACK_LOADED,{details:l,id:M||0,groupId:E||"",stats:h,networkDetails:C,deliveryDirectives:u});break;case b.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(R.Events.SUBTITLE_TRACK_LOADED,{details:l,id:M||0,groupId:E||"",stats:h,networkDetails:C,deliveryDirectives:u});break}},a}();H.default=r},"./src/polyfills/number.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"isFiniteNumber",function(){return F}),P.d(H,"MAX_SAFE_INTEGER",function(){return R});var F=Number.isFinite||function(O){return typeof O=="number"&&isFinite(O)},R=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(Y,H,P){"use strict";P.r(H);var F=function(){function R(){}return R.getSilentFrame=function(D,m){switch(D){case"mp4a.40.2":if(m===1)return new Uint8Array([0,200,0,128,35,128]);if(m===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(m===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(m===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(m===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(m===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(m===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(m===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(m===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},R}();H.default=F},"./src/remux/mp4-generator.ts":function(Y,H,P){"use strict";P.r(H);var F=Math.pow(2,32)-1,R=function(){function O(){}return O.init=function(){O.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 m;for(m in O.types)O.types.hasOwnProperty(m)&&(O.types[m]=[m.charCodeAt(0),m.charCodeAt(1),m.charCodeAt(2),m.charCodeAt(3)]);var T=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]),b=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]);O.HDLR_TYPES={video:T,audio:b};var i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),d=new Uint8Array([0,0,0,0,0,0,0,0]);O.STTS=O.STSC=O.STCO=d,O.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),O.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),O.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),O.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var c=new Uint8Array([105,115,111,109]),r=new Uint8Array([97,118,99,49]),a=new Uint8Array([0,0,0,1]);O.FTYP=O.box(O.types.ftyp,c,a,c,r),O.DINF=O.box(O.types.dinf,O.box(O.types.dref,i))},O.box=function(m){for(var T=8,b=arguments.length,i=new Array(b>1?b-1:0),d=1;d<b;d++)i[d-1]=arguments[d];for(var c=i.length,r=c;c--;)T+=i[c].byteLength;var a=new Uint8Array(T);for(a[0]=T>>24&255,a[1]=T>>16&255,a[2]=T>>8&255,a[3]=T&255,a.set(m,4),c=0,T=8;c<r;c++)a.set(i[c],T),T+=i[c].byteLength;return a},O.hdlr=function(m){return O.box(O.types.hdlr,O.HDLR_TYPES[m])},O.mdat=function(m){return O.box(O.types.mdat,m)},O.mdhd=function(m,T){T*=m;var b=Math.floor(T/(F+1)),i=Math.floor(T%(F+1));return O.box(O.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,m>>24&255,m>>16&255,m>>8&255,m&255,b>>24,b>>16&255,b>>8&255,b&255,i>>24,i>>16&255,i>>8&255,i&255,85,196,0,0]))},O.mdia=function(m){return O.box(O.types.mdia,O.mdhd(m.timescale,m.duration),O.hdlr(m.type),O.minf(m))},O.mfhd=function(m){return O.box(O.types.mfhd,new Uint8Array([0,0,0,0,m>>24,m>>16&255,m>>8&255,m&255]))},O.minf=function(m){return m.type==="audio"?O.box(O.types.minf,O.box(O.types.smhd,O.SMHD),O.DINF,O.stbl(m)):O.box(O.types.minf,O.box(O.types.vmhd,O.VMHD),O.DINF,O.stbl(m))},O.moof=function(m,T,b){return O.box(O.types.moof,O.mfhd(m),O.traf(b,T))},O.moov=function(m){for(var T=m.length,b=[];T--;)b[T]=O.trak(m[T]);return O.box.apply(null,[O.types.moov,O.mvhd(m[0].timescale,m[0].duration)].concat(b).concat(O.mvex(m)))},O.mvex=function(m){for(var T=m.length,b=[];T--;)b[T]=O.trex(m[T]);return O.box.apply(null,[O.types.mvex].concat(b))},O.mvhd=function(m,T){T*=m;var b=Math.floor(T/(F+1)),i=Math.floor(T%(F+1)),d=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,m>>24&255,m>>16&255,m>>8&255,m&255,b>>24,b>>16&255,b>>8&255,b&255,i>>24,i>>16&255,i>>8&255,i&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 O.box(O.types.mvhd,d)},O.sdtp=function(m){var T=m.samples||[],b=new Uint8Array(4+T.length),i,d;for(i=0;i<T.length;i++)d=T[i].flags,b[i+4]=d.dependsOn<<4|d.isDependedOn<<2|d.hasRedundancy;return O.box(O.types.sdtp,b)},O.stbl=function(m){return O.box(O.types.stbl,O.stsd(m),O.box(O.types.stts,O.STTS),O.box(O.types.stsc,O.STSC),O.box(O.types.stsz,O.STSZ),O.box(O.types.stco,O.STCO))},O.avc1=function(m){var T=[],b=[],i,d,c;for(i=0;i<m.sps.length;i++)d=m.sps[i],c=d.byteLength,T.push(c>>>8&255),T.push(c&255),T=T.concat(Array.prototype.slice.call(d));for(i=0;i<m.pps.length;i++)d=m.pps[i],c=d.byteLength,b.push(c>>>8&255),b.push(c&255),b=b.concat(Array.prototype.slice.call(d));var r=O.box(O.types.avcC,new Uint8Array([1,T[3],T[4],T[5],252|3,224|m.sps.length].concat(T).concat([m.pps.length]).concat(b))),a=m.width,s=m.height,o=m.pixelRatio[0],t=m.pixelRatio[1];return O.box(O.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,a>>8&255,a&255,s>>8&255,s&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),r,O.box(O.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),O.box(O.types.pasp,new Uint8Array([o>>24,o>>16&255,o>>8&255,o&255,t>>24,t>>16&255,t>>8&255,t&255])))},O.esds=function(m){var T=m.config.length;return new Uint8Array([0,0,0,0,3,23+T,0,1,0,4,15+T,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([T]).concat(m.config).concat([6,1,2]))},O.mp4a=function(m){var T=m.samplerate;return O.box(O.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,m.channelCount,0,16,0,0,0,0,T>>8&255,T&255,0,0]),O.box(O.types.esds,O.esds(m)))},O.mp3=function(m){var T=m.samplerate;return O.box(O.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,m.channelCount,0,16,0,0,0,0,T>>8&255,T&255,0,0]))},O.stsd=function(m){return m.type==="audio"?!m.isAAC&&m.codec==="mp3"?O.box(O.types.stsd,O.STSD,O.mp3(m)):O.box(O.types.stsd,O.STSD,O.mp4a(m)):O.box(O.types.stsd,O.STSD,O.avc1(m))},O.tkhd=function(m){var T=m.id,b=m.duration*m.timescale,i=m.width,d=m.height,c=Math.floor(b/(F+1)),r=Math.floor(b%(F+1));return O.box(O.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,T>>24&255,T>>16&255,T>>8&255,T&255,0,0,0,0,c>>24,c>>16&255,c>>8&255,c&255,r>>24,r>>16&255,r>>8&255,r&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>8&255,i&255,0,0,d>>8&255,d&255,0,0]))},O.traf=function(m,T){var b=O.sdtp(m),i=m.id,d=Math.floor(T/(F+1)),c=Math.floor(T%(F+1));return O.box(O.types.traf,O.box(O.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255])),O.box(O.types.tfdt,new Uint8Array([1,0,0,0,d>>24,d>>16&255,d>>8&255,d&255,c>>24,c>>16&255,c>>8&255,c&255])),O.trun(m,b.length+16+20+8+16+8+8),b)},O.trak=function(m){return m.duration=m.duration||4294967295,O.box(O.types.trak,O.tkhd(m),O.mdia(m))},O.trex=function(m){var T=m.id;return O.box(O.types.trex,new Uint8Array([0,0,0,0,T>>24,T>>16&255,T>>8&255,T&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},O.trun=function(m,T){var b=m.samples||[],i=b.length,d=12+16*i,c=new Uint8Array(d),r,a,s,o,t,h;for(T+=8+d,c.set([0,0,15,1,i>>>24&255,i>>>16&255,i>>>8&255,i&255,T>>>24&255,T>>>16&255,T>>>8&255,T&255],0),r=0;r<i;r++)a=b[r],s=a.duration,o=a.size,t=a.flags,h=a.cts,c.set([s>>>24&255,s>>>16&255,s>>>8&255,s&255,o>>>24&255,o>>>16&255,o>>>8&255,o&255,t.isLeading<<2|t.dependsOn,t.isDependedOn<<6|t.hasRedundancy<<4|t.paddingValue<<1|t.isNonSync,t.degradPrio&240<<8,t.degradPrio&15,h>>>24&255,h>>>16&255,h>>>8&255,h&255],12+16*r);return O.box(O.types.trun,c)},O.initSegment=function(m){O.types||O.init();var T=O.moov(m),b=new Uint8Array(O.FTYP.byteLength+T.byteLength);return b.set(O.FTYP),b.set(T,O.FTYP.byteLength),b},O}();R.types=void 0,R.HDLR_TYPES=void 0,R.STTS=void 0,R.STSC=void 0,R.STCO=void 0,R.STSZ=void 0,R.VMHD=void 0,R.SMHD=void 0,R.STSD=void 0,R.FTYP=void 0,R.DINF=void 0,H.default=R},"./src/remux/mp4-remuxer.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"default",function(){return h}),P.d(H,"normalizePts",function(){return g});var F=P("./src/polyfills/number.ts"),R=P("./src/remux/aac-helper.ts"),O=P("./src/remux/mp4-generator.ts"),D=P("./src/events.ts"),m=P("./src/errors.ts"),T=P("./src/utils/logger.ts"),b=P("./src/types/loader.ts"),i=P("./src/utils/timescale-conversion.ts");function d(){return d=Object.assign||function(M){for(var E=1;E<arguments.length;E++){var p=arguments[E];for(var l in p)Object.prototype.hasOwnProperty.call(p,l)&&(M[l]=p[l])}return M},d.apply(this,arguments)}var c=10*1e3,r=1024,a=1152,s=null,o=null,t=!1,h=function(){function M(p,l,u,f){if(f===void 0&&(f=""),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=p,this.config=l,this.typeSupported=u,this.ISGenerated=!1,s===null){var _=navigator.userAgent||"",y=_.match(/Chrome\/(\d+)/i);s=y?parseInt(y[1]):0}if(o===null){var v=navigator.userAgent.match(/Safari\/(\d+)/i);o=v?parseInt(v[1]):0}t=!!s&&s<75||!!o&&o<600}var E=M.prototype;return E.destroy=function(){},E.resetTimeStamp=function(l){T.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=l},E.resetNextTimestamp=function(){T.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},E.resetInitSegment=function(){T.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},E.getVideoStartPts=function(l){var u=!1,f=l.reduce(function(_,y){var v=y.pts-_;return v<-4294967296?(u=!0,g(_,y.pts)):v>0?_:y.pts},l[0].pts);return u&&T.logger.debug("PTS rollover detected"),f},E.remux=function(l,u,f,_,y,v,N,j){var U,G,z,L,V,W,$=y,q=y,fe=l.pid>-1,se=u.pid>-1,me=u.samples.length,ve=l.samples.length>0,Ae=me>1,ge=(!fe||ve)&&(!se||Ae)||this.ISGenerated||N;if(ge){this.ISGenerated||(z=this.generateIS(l,u,y));var ue=this.isVideoContiguous,$e=-1;if(Ae&&($e=C(u.samples),!ue&&this.config.forceKeyFrameOnDiscontinuity))if(W=!0,$e>0){T.logger.warn("[mp4-remuxer]: Dropped "+$e+" out of "+me+" video samples due to a missing keyframe");var Tt=this.getVideoStartPts(u.samples);u.samples=u.samples.slice($e),u.dropped+=$e,q+=(u.samples[0].pts-Tt)/(u.timescale||9e4)}else $e===-1&&(T.logger.warn("[mp4-remuxer]: No keyframe found out of "+me+" video samples"),W=!1);if(this.ISGenerated){if(ve&&Ae){var ye=this.getVideoStartPts(u.samples),Re=g(l.samples[0].pts,ye)-ye,nt=Re/u.inputTimeScale;$+=Math.max(0,nt),q+=Math.max(0,-nt)}if(ve){if(l.samplerate||(T.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),z=this.generateIS(l,u,y)),G=this.remuxAudio(l,$,this.isAudioContiguous,v,se||Ae||j===b.PlaylistLevelType.AUDIO?q:void 0),Ae){var Ue=G?G.endPTS-G.startPTS:0;u.inputTimeScale||(T.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),z=this.generateIS(l,u,y)),U=this.remuxVideo(u,q,ue,Ue)}}else Ae&&(U=this.remuxVideo(u,q,ue,0));U&&(U.firstKeyFrame=$e,U.independent=$e!==-1)}}return this.ISGenerated&&(f.samples.length&&(V=this.remuxID3(f,y)),_.samples.length&&(L=this.remuxText(_,y))),{audio:G,video:U,initSegment:z,independent:W,text:L,id3:V}},E.generateIS=function(l,u,f){var _=l.samples,y=u.samples,v=this.typeSupported,N={},j=!Object(F.isFiniteNumber)(this._initPTS),U="audio/mp4",G,z,L;if(j&&(G=z=Infinity),l.config&&_.length&&(l.timescale=l.samplerate,l.isAAC||(v.mpeg?(U="audio/mpeg",l.codec=""):v.mp3&&(l.codec="mp3")),N.audio={id:"audio",container:U,codec:l.codec,initSegment:!l.isAAC&&v.mpeg?new Uint8Array(0):O.default.initSegment([l]),metadata:{channelCount:l.channelCount}},j&&(L=l.inputTimeScale,G=z=_[0].pts-Math.round(L*f))),u.sps&&u.pps&&y.length&&(u.timescale=u.inputTimeScale,N.video={id:"main",container:"video/mp4",codec:u.codec,initSegment:O.default.initSegment([u]),metadata:{width:u.width,height:u.height}},j)){L=u.inputTimeScale;var V=this.getVideoStartPts(y),W=Math.round(L*f);z=Math.min(z,g(y[0].dts,V)-W),G=Math.min(G,V-W)}if(Object.keys(N).length)return this.ISGenerated=!0,j&&(this._initPTS=G,this._initDTS=z),{tracks:N,initPTS:G,timescale:L}},E.remuxVideo=function(l,u,f,_){var y=l.inputTimeScale,v=l.samples,N=[],j=v.length,U=this._initPTS,G=this.nextAvcDts,z=8,L,V,W,$=Number.POSITIVE_INFINITY,q=Number.NEGATIVE_INFINITY,fe=0,se=!1;if(!f||G===null){var me=u*y,ve=v[0].pts-g(v[0].dts,v[0].pts);G=me-ve}for(var Ae=0;Ae<j;Ae++){var ge=v[Ae];if(ge.pts=g(ge.pts-U,G),ge.dts=g(ge.dts-U,G),ge.dts>ge.pts){var ue=9e4*.2;fe=Math.max(Math.min(fe,ge.pts-ge.dts),-1*ue)}ge.dts<v[Ae>0?Ae-1:Ae].dts&&(se=!0)}se&&v.sort(function(Yt,St){var Ot=Yt.dts-St.dts,dt=Yt.pts-St.pts;return Ot||dt}),V=v[0].dts,W=v[v.length-1].dts;var $e=Math.round((W-V)/(j-1));if(fe<0){if(fe<$e*-2){T.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(i.toMsFromMpegTsClock)(-$e,!0)+" ms");for(var Tt=fe,ye=0;ye<j;ye++)v[ye].dts=Tt=Math.max(Tt,v[ye].pts-$e),v[ye].pts=Math.max(Tt,v[ye].pts)}else{T.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(i.toMsFromMpegTsClock)(fe,!0)+" ms to overcome this issue");for(var Re=0;Re<j;Re++)v[Re].dts=v[Re].dts+fe}V=v[0].dts}if(f){var nt=V-G,Ue=nt>$e,ke=nt<-1;if(Ue||ke){Ue?T.logger.warn("AVC: "+Object(i.toMsFromMpegTsClock)(nt,!0)+" ms ("+nt+"dts) hole between fragments detected, filling it"):T.logger.warn("AVC: "+Object(i.toMsFromMpegTsClock)(-nt,!0)+" ms ("+nt+"dts) overlapping between fragments detected"),V=G;var lt=v[0].pts-nt;v[0].dts=V,v[0].pts=lt,T.logger.log("Video: First PTS/DTS adjusted: "+Object(i.toMsFromMpegTsClock)(lt,!0)+"/"+Object(i.toMsFromMpegTsClock)(V,!0)+", delta: "+Object(i.toMsFromMpegTsClock)(nt,!0)+" ms")}}t&&(V=Math.max(0,V));for(var Fe=0,Ze=0,Xe=0;Xe<j;Xe++){for(var ft=v[Xe],Rt=ft.units,Pt=Rt.length,Bt=0,Ve=0;Ve<Pt;Ve++)Bt+=Rt[Ve].data.length;Ze+=Bt,Fe+=Pt,ft.length=Bt,ft.dts=Math.max(ft.dts,V),ft.pts=Math.max(ft.pts,ft.dts,0),$=Math.min(ft.pts,$),q=Math.max(ft.pts,q)}W=v[j-1].dts;var Ft=Ze+4*Fe+8,nn;try{nn=new Uint8Array(Ft)}catch(Yt){this.observer.emit(D.Events.ERROR,D.Events.ERROR,{type:m.ErrorTypes.MUX_ERROR,details:m.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ft,reason:"fail allocating video mdat "+Ft});return}var Le=new DataView(nn.buffer);Le.setUint32(0,Ft),nn.set(O.default.types.mdat,4);for(var Se=0;Se<j;Se++){for(var ut=v[Se],mt=ut.units,We=0,vt=0,Pe=mt.length;vt<Pe;vt++){var xe=mt[vt],we=xe.data,ie=xe.data.byteLength;Le.setUint32(z,ie),z+=4,nn.set(we,z),z+=ie,We+=4+ie}if(Se<j-1)L=v[Se+1].dts-ut.dts;else{var ae=this.config,ce=ut.dts-v[Se>0?Se-1:Se].dts;if(ae.stretchShortVideoTrack&&this.nextAudioPts!==null){var be=Math.floor(ae.maxBufferHole*y),Ce=(_?$+_*y:this.nextAudioPts)-ut.pts;Ce>be?(L=Ce-ce,L<0&&(L=ce),T.logger.log("[mp4-remuxer]: It is approximately "+Ce/90+" ms to the next segment; using duration "+L/90+" ms for the last video frame.")):L=ce}else L=ce}var Be=Math.round(ut.pts-ut.dts);N.push(new A(ut.key,L,We,Be))}if(N.length&&s&&s<70){var yt=N[0].flags;yt.dependsOn=2,yt.isNonSync=0}console.assert(L!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=G=W+L,this.isVideoContiguous=!0;var Xt=O.default.moof(l.sequenceNumber++,V,d({},l,{samples:N})),an="video",pt={data1:Xt,data2:nn,startPTS:$/y,endPTS:(q+L)/y,startDTS:V/y,endDTS:G/y,type:an,hasAudio:!1,hasVideo:!0,nb:N.length,dropped:l.dropped};return l.samples=[],l.dropped=0,console.assert(nn.length,"MDAT length must not be zero"),pt},E.remuxAudio=function(l,u,f,_,y){var v=l.inputTimeScale,N=l.samplerate?l.samplerate:v,j=v/N,U=l.isAAC?r:a,G=U*j,z=this._initPTS,L=!l.isAAC&&this.typeSupported.mpeg,V=[],W=l.samples,$=L?0:8,q=this.nextAudioPts||-1,fe=u*v;if(this.isAudioContiguous=f=f||W.length&&q>0&&(_&&Math.abs(fe-q)<9e3||Math.abs(g(W[0].pts-z,fe)-q)<20*G),W.forEach(function(we){we.pts=g(we.pts-z,fe)}),!f||q<0){if(W=W.filter(function(we){return we.pts>=0}),!W.length)return;y===0?q=0:_?q=Math.max(0,fe):q=W[0].pts}if(l.isAAC)for(var se=y!==void 0,me=this.config.maxAudioFramesDrift,ve=0,Ae=q;ve<W.length;ve++){var ge=W[ve],ue=ge.pts,$e=ue-Ae,Tt=Math.abs(1e3*$e/v);if($e<=-me*G&&se)ve===0&&(T.logger.warn("Audio frame @ "+(ue/v).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*$e/v)+" ms."),this.nextAudioPts=q=Ae=ue);else if($e>=me*G&&Tt<c&&se){var ye=Math.round($e/G);Ae=ue-ye*G,Ae<0&&(ye--,Ae+=G),ve===0&&(this.nextAudioPts=q=Ae),T.logger.warn("[mp4-remuxer]: Injecting "+ye+" audio frame @ "+(Ae/v).toFixed(3)+"s due to "+Math.round(1e3*$e/v)+" ms gap.");for(var Re=0;Re<ye;Re++){var nt=Math.max(Ae,0),Ue=R.default.getSilentFrame(l.manifestCodec||l.codec,l.channelCount);Ue||(T.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Ue=ge.unit.subarray()),W.splice(ve,0,{unit:Ue,pts:nt}),Ae+=G,ve++}}ge.pts=Ae,Ae+=G}for(var ke=null,lt=null,Fe,Ze=0,Xe=W.length;Xe--;)Ze+=W[Xe].unit.byteLength;for(var ft=0,Rt=W.length;ft<Rt;ft++){var Pt=W[ft],Bt=Pt.unit,Ve=Pt.pts;if(lt!==null){var Ft=V[ft-1];Ft.duration=Math.round((Ve-lt)/j)}else if(f&&l.isAAC&&(Ve=q),ke=Ve,Ze>0){Ze+=$;try{Fe=new Uint8Array(Ze)}catch(we){this.observer.emit(D.Events.ERROR,D.Events.ERROR,{type:m.ErrorTypes.MUX_ERROR,details:m.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ze,reason:"fail allocating audio mdat "+Ze});return}if(!L){var nn=new DataView(Fe.buffer);nn.setUint32(0,Ze),Fe.set(O.default.types.mdat,4)}}else return;Fe.set(Bt,$);var Le=Bt.byteLength;$+=Le,V.push(new A(!0,U,Le,0)),lt=Ve}var Se=V.length;if(!Se)return;var ut=V[V.length-1];this.nextAudioPts=q=lt+j*ut.duration;var mt=L?new Uint8Array(0):O.default.moof(l.sequenceNumber++,ke/j,d({},l,{samples:V}));l.samples=[];var We=ke/v,vt=q/v,Pe="audio",xe={data1:mt,data2:Fe,startPTS:We,endPTS:vt,startDTS:We,endDTS:vt,type:Pe,hasAudio:!0,hasVideo:!1,nb:Se};return this.isAudioContiguous=!0,console.assert(Fe.length,"MDAT length must not be zero"),xe},E.remuxEmptyAudio=function(l,u,f,_){var y=l.inputTimeScale,v=l.samplerate?l.samplerate:y,N=y/v,j=this.nextAudioPts,U=(j!==null?j:_.startDTS*y)+this._initDTS,G=_.endDTS*y+this._initDTS,z=N*r,L=Math.ceil((G-U)/z),V=R.default.getSilentFrame(l.manifestCodec||l.codec,l.channelCount);if(T.logger.warn("[mp4-remuxer]: remux empty Audio"),!V){T.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var W=[],$=0;$<L;$++){var q=U+$*z;W.push({unit:V,pts:q,dts:q})}return l.samples=W,this.remuxAudio(l,u,f,!1)},E.remuxID3=function(l,u){var f=l.samples.length;if(!f)return;for(var _=l.inputTimeScale,y=this._initPTS,v=this._initDTS,N=0;N<f;N++){var j=l.samples[N];j.pts=g(j.pts-y,u*_)/_,j.dts=g(j.dts-v,u*_)/_}var U=l.samples;return l.samples=[],{samples:U}},E.remuxText=function(l,u){var f=l.samples.length;if(!f)return;for(var _=l.inputTimeScale,y=this._initPTS,v=0;v<f;v++){var N=l.samples[v];N.pts=g(N.pts-y,u*_)/_}l.samples.sort(function(U,G){return U.pts-G.pts});var j=l.samples;return l.samples=[],{samples:j}},M}();function g(M,E){var p;if(E===null)return M;for(E<M?p=-8589934592:p=8589934592;Math.abs(M-E)>4294967296;)M+=p;return M}function C(M){for(var E=0;E<M.length;E++)if(M[E].key)return E;return-1}var A=function(E,p,l,u){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=p,this.size=l,this.cts=u,this.flags=new w(E)},w=function(E){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=E?2:1,this.isNonSync=E?0:1}},"./src/remux/passthrough-remuxer.ts":function(Y,H,P){"use strict";P.r(H);var F=P("./src/polyfills/number.ts"),R=P("./src/utils/mp4-tools.ts"),O=P("./src/loader/fragment.ts"),D=P("./src/utils/logger.ts"),m=function(){function i(){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 d=i.prototype;return d.destroy=function(){},d.resetTimeStamp=function(r){this.initPTS=r,this.lastEndDTS=null},d.resetNextTimestamp=function(){this.lastEndDTS=null},d.resetInitSegment=function(r,a,s){this.audioCodec=a,this.videoCodec=s,this.generateInitSegment(r),this.emitInitSegment=!0},d.generateInitSegment=function(r){var a=this.audioCodec,s=this.videoCodec;if(!r||!r.byteLength){this.initTracks=void 0,this.initData=void 0;return}var o=this.initData=Object(R.parseInitSegment)(r);a||(a=b(o.audio,O.ElementaryStreamTypes.AUDIO)),s||(s=b(o.video,O.ElementaryStreamTypes.VIDEO));var t={};o.audio&&o.video?t.audiovideo={container:"video/mp4",codec:a+","+s,initSegment:r,id:"main"}:o.audio?t.audio={container:"audio/mp4",codec:a,initSegment:r,id:"audio"}:o.video?t.video={container:"video/mp4",codec:s,initSegment:r,id:"main"}:D.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=t},d.remux=function(r,a,s,o,t){var h=this.initPTS,g=this.lastEndDTS,C={audio:void 0,video:void 0,text:o,id3:s,initSegment:void 0};Object(F.isFiniteNumber)(g)||(g=this.lastEndDTS=t||0);var A=a.samples;if(!A||!A.length)return C;var w={initPTS:void 0,timescale:1},M=this.initData;if((!M||!M.length)&&(this.generateInitSegment(A),M=this.initData),!M||!M.length)return D.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),C;this.emitInitSegment&&(w.tracks=this.initTracks,this.emitInitSegment=!1),Object(F.isFiniteNumber)(h)||(this.initPTS=w.initPTS=h=T(M,A,g));var E=Object(R.getDuration)(A,M),p=g,l=E+p;Object(R.offsetStartDTS)(M,A,h),E>0?this.lastEndDTS=l:(D.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var u=!!M.audio,f=!!M.video,_="";u&&(_+="audio"),f&&(_+="video");var y={data1:A,startPTS:p,startDTS:p,endPTS:l,endDTS:l,type:_,hasAudio:u,hasVideo:f,nb:1,dropped:0};return C.audio=y.type==="audio"?y:void 0,C.video=y.type!=="audio"?y:void 0,C.text=o,C.id3=s,C.initSegment=w,C},i}(),T=function(d,c,r){return Object(R.getStartDTS)(d,c)-r};function b(i,d){var c=i==null?void 0:i.codec;return c&&c.length>4?c:c==="hvc1"?"hvc1.1.c.L120.90":c==="av01"?"av01.0.04M.08":c==="avc1"||d===O.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}H.default=m},"./src/task-loop.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"default",function(){return F});var F=function(){function R(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var O=R.prototype;return O.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},O.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},O.onHandlerDestroyed=function(){},O.hasInterval=function(){return!!this._tickInterval},O.hasNextTick=function(){return!!this._tickTimer},O.setInterval=function(m){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,m),!0)},O.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},O.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},O.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},O.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},O.doTick=function(){},R}()},"./src/types/cmcd.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"CMCDVersion",function(){return F}),P.d(H,"CMCDObjectType",function(){return R}),P.d(H,"CMCDStreamingFormat",function(){return O}),P.d(H,"CMCDStreamType",function(){return D});var F=1,R;(function(m){m.MANIFEST="m",m.AUDIO="a",m.VIDEO="v",m.MUXED="av",m.INIT="i",m.CAPTION="c",m.TIMED_TEXT="tt",m.KEY="k",m.OTHER="o"})(R||(R={}));var O;(function(m){m.DASH="d",m.HLS="h",m.SMOOTH="s",m.OTHER="o"})(O||(O={}));var D;(function(m){m.VOD="v",m.LIVE="l"})(D||(D={}))},"./src/types/level.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"HlsSkip",function(){return O}),P.d(H,"getSkipValue",function(){return D}),P.d(H,"HlsUrlParameters",function(){return m}),P.d(H,"Level",function(){return T});function F(b,i){for(var d=0;d<i.length;d++){var c=i[d];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(b,c.key,c)}}function R(b,i,d){return i&&F(b.prototype,i),d&&F(b,d),b}var O;(function(b){b.No="",b.Yes="YES",b.v2="v2"})(O||(O={}));function D(b,i){var d=b.canSkipUntil,c=b.canSkipDateRanges,r=b.endSN,a=i!==void 0?i-r:0;return d&&a<d?c?O.v2:O.Yes:O.No}var m=function(){function b(d,c,r){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=d,this.part=c,this.skip=r}var i=b.prototype;return i.addDirectives=function(c){var r=new self.URL(c);return this.msn!==void 0&&r.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&r.searchParams.set("_HLS_part",this.part.toString()),this.skip&&r.searchParams.set("_HLS_skip",this.skip),r.toString()},b}(),T=function(){function b(i){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=[i.url],this.attrs=i.attrs,this.bitrate=i.bitrate,i.details&&(this.details=i.details),this.id=i.id||0,this.name=i.name,this.width=i.width||0,this.height=i.height||0,this.audioCodec=i.audioCodec,this.videoCodec=i.videoCodec,this.unknownCodecs=i.unknownCodecs,this.codecSet=[i.videoCodec,i.audioCodec].filter(function(d){return d}).join(",").replace(/\.[^.,]+/g,"")}return R(b,[{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(d){var c=d%this.url.length;this._urlId!==c&&(this.details=void 0,this._urlId=c)}}]),b}()},"./src/types/loader.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"PlaylistContextType",function(){return F}),P.d(H,"PlaylistLevelType",function(){return R});var F;(function(O){O.MANIFEST="manifest",O.LEVEL="level",O.AUDIO_TRACK="audioTrack",O.SUBTITLE_TRACK="subtitleTrack"})(F||(F={}));var R;(function(O){O.MAIN="main",O.AUDIO="audio",O.SUBTITLE="subtitle"})(R||(R={}))},"./src/types/transmuxer.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"ChunkMetadata",function(){return F});var F=function(D,m,T,b,i,d){b===void 0&&(b=0),i===void 0&&(i=-1),d===void 0&&(d=!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=R(),this.buffering={audio:R(),video:R(),audiovideo:R()},this.level=D,this.sn=m,this.id=T,this.size=b,this.part=i,this.partial=d};function R(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"AttrList",function(){return O});var F=/^(\d+)x(\d+)$/,R=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,O=function(){function D(T){typeof T=="string"&&(T=D.parseAttrList(T));for(var b in T)T.hasOwnProperty(b)&&(this[b]=T[b])}var m=D.prototype;return m.decimalInteger=function(b){var i=parseInt(this[b],10);return i>Number.MAX_SAFE_INTEGER?Infinity:i},m.hexadecimalInteger=function(b){if(this[b]){var i=(this[b]||"0x").slice(2);i=(i.length&1?"0":"")+i;for(var d=new Uint8Array(i.length/2),c=0;c<i.length/2;c++)d[c]=parseInt(i.slice(c*2,c*2+2),16);return d}else return null},m.hexadecimalIntegerAsNumber=function(b){var i=parseInt(this[b],16);return i>Number.MAX_SAFE_INTEGER?Infinity:i},m.decimalFloatingPoint=function(b){return parseFloat(this[b])},m.optionalFloat=function(b,i){var d=this[b];return d?parseFloat(d):i},m.enumeratedString=function(b){return this[b]},m.bool=function(b){return this[b]==="YES"},m.decimalResolution=function(b){var i=F.exec(this[b]);return i===null?void 0:{width:parseInt(i[1],10),height:parseInt(i[2],10)}},D.parseAttrList=function(b){var i,d={},c='"';for(R.lastIndex=0;(i=R.exec(b))!==null;){var r=i[2];r.indexOf(c)===0&&r.lastIndexOf(c)===r.length-1&&(r=r.slice(1,-1)),d[i[1]]=r}return d},D}()},"./src/utils/binary-search.ts":function(Y,H,P){"use strict";P.r(H);var F={search:function(O,D){for(var m=0,T=O.length-1,b=null,i=null;m<=T;){b=(m+T)/2|0,i=O[b];var d=D(i);if(d>0)m=b+1;else if(d<0)T=b-1;else return i}return null}};H.default=F},"./src/utils/buffer-helper.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"BufferHelper",function(){return O});var F=P("./src/utils/logger.ts"),R={length:0,start:function(){return 0},end:function(){return 0}},O=function(){function D(){}return D.isBuffered=function(T,b){try{if(T){for(var i=D.getBuffered(T),d=0;d<i.length;d++)if(b>=i.start(d)&&b<=i.end(d))return!0}}catch(c){}return!1},D.bufferInfo=function(T,b,i){try{if(T){var d=D.getBuffered(T),c=[],r;for(r=0;r<d.length;r++)c.push({start:d.start(r),end:d.end(r)});return this.bufferedInfo(c,b,i)}}catch(a){}return{len:0,start:b,end:b,nextStart:void 0}},D.bufferedInfo=function(T,b,i){b=Math.max(0,b),T.sort(function(w,M){var E=w.start-M.start;return E||M.end-w.end});var d=[];if(i)for(var c=0;c<T.length;c++){var r=d.length;if(r){var a=d[r-1].end;T[c].start-a<i?T[c].end>a&&(d[r-1].end=T[c].end):d.push(T[c])}else d.push(T[c])}else d=T;for(var s=0,o,t=b,h=b,g=0;g<d.length;g++){var C=d[g].start,A=d[g].end;if(b+i>=C&&b<A)t=C,h=A,s=h-b;else if(b+i<C){o=C;break}}return{len:s,start:t||0,end:h||0,nextStart:o}},D.getBuffered=function(T){try{return T.buffered}catch(b){return F.logger.log("failed to get media.buffered",b),R}},D}()},"./src/utils/cea-608-parser.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"Row",function(){return h}),P.d(H,"CaptionScreen",function(){return g});var F=P("./src/utils/logger.ts"),R={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},O=function(l){var u=l;return R.hasOwnProperty(l)&&(u=R[l]),String.fromCharCode(u)},D=15,m=100,T={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},b={17:2,18:4,21:6,22:8,23:10,19:13,20:15},i={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},d={25:2,26:4,29:6,30:8,31:10,27:13,28:15},c=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],r;(function(p){p[p.ERROR=0]="ERROR",p[p.TEXT=1]="TEXT",p[p.WARNING=2]="WARNING",p[p.INFO=2]="INFO",p[p.DEBUG=3]="DEBUG",p[p.DATA=3]="DATA"})(r||(r={}));var a=function(){function p(){this.time=null,this.verboseLevel=r.ERROR}var l=p.prototype;return l.log=function(f,_){this.verboseLevel>=f&&F.logger.log(this.time+" ["+f+"] "+_)},p}(),s=function(l){for(var u=[],f=0;f<l.length;f++)u.push(l[f].toString(16));return u},o=function(){function p(u,f,_,y,v){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=u||"white",this.underline=f||!1,this.italics=_||!1,this.background=y||"black",this.flash=v||!1}var l=p.prototype;return l.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},l.setStyles=function(f){for(var _=["foreground","underline","italics","background","flash"],y=0;y<_.length;y++){var v=_[y];f.hasOwnProperty(v)&&(this[v]=f[v])}},l.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},l.equals=function(f){return this.foreground===f.foreground&&this.underline===f.underline&&this.italics===f.italics&&this.background===f.background&&this.flash===f.flash},l.copy=function(f){this.foreground=f.foreground,this.underline=f.underline,this.italics=f.italics,this.background=f.background,this.flash=f.flash},l.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},p}(),t=function(){function p(u,f,_,y,v,N){this.uchar=void 0,this.penState=void 0,this.uchar=u||" ",this.penState=new o(f,_,y,v,N)}var l=p.prototype;return l.reset=function(){this.uchar=" ",this.penState.reset()},l.setChar=function(f,_){this.uchar=f,this.penState.copy(_)},l.setPenState=function(f){this.penState.copy(f)},l.equals=function(f){return this.uchar===f.uchar&&this.penState.equals(f.penState)},l.copy=function(f){this.uchar=f.uchar,this.penState.copy(f.penState)},l.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},p}(),h=function(){function p(u){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var f=0;f<m;f++)this.chars.push(new t);this.logger=u,this.pos=0,this.currPenState=new o}var l=p.prototype;return l.equals=function(f){for(var _=!0,y=0;y<m;y++)if(!this.chars[y].equals(f.chars[y])){_=!1;break}return _},l.copy=function(f){for(var _=0;_<m;_++)this.chars[_].copy(f.chars[_])},l.isEmpty=function(){for(var f=!0,_=0;_<m;_++)if(!this.chars[_].isEmpty()){f=!1;break}return f},l.setCursor=function(f){this.pos!==f&&(this.pos=f),this.pos<0?(this.logger.log(r.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>m&&(this.logger.log(r.DEBUG,"Too large cursor position "+this.pos),this.pos=m)},l.moveCursor=function(f){var _=this.pos+f;if(f>1)for(var y=this.pos+1;y<_+1;y++)this.chars[y].setPenState(this.currPenState);this.setCursor(_)},l.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},l.insertChar=function(f){f>=144&&this.backSpace();var _=O(f);if(this.pos>=m){this.logger.log(r.ERROR,"Cannot insert "+f.toString(16)+" ("+_+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(_,this.currPenState),this.moveCursor(1)},l.clearFromPos=function(f){var _;for(_=f;_<m;_++)this.chars[_].reset()},l.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},l.clearToEndOfRow=function(){this.clearFromPos(this.pos)},l.getTextString=function(){for(var f=[],_=!0,y=0;y<m;y++){var v=this.chars[y].uchar;v!==" "&&(_=!1),f.push(v)}return _?"":f.join("")},l.setPenStyles=function(f){this.currPenState.setStyles(f);var _=this.chars[this.pos];_.setPenState(this.currPenState)},p}(),g=function(){function p(u){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var f=0;f<D;f++)this.rows.push(new h(u));this.logger=u,this.currRow=D-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var l=p.prototype;return l.reset=function(){for(var f=0;f<D;f++)this.rows[f].clear();this.currRow=D-1},l.equals=function(f){for(var _=!0,y=0;y<D;y++)if(!this.rows[y].equals(f.rows[y])){_=!1;break}return _},l.copy=function(f){for(var _=0;_<D;_++)this.rows[_].copy(f.rows[_])},l.isEmpty=function(){for(var f=!0,_=0;_<D;_++)if(!this.rows[_].isEmpty()){f=!1;break}return f},l.backSpace=function(){var f=this.rows[this.currRow];f.backSpace()},l.clearToEndOfRow=function(){var f=this.rows[this.currRow];f.clearToEndOfRow()},l.insertChar=function(f){var _=this.rows[this.currRow];_.insertChar(f)},l.setPen=function(f){var _=this.rows[this.currRow];_.setPenStyles(f)},l.moveCursor=function(f){var _=this.rows[this.currRow];_.moveCursor(f)},l.setCursor=function(f){this.logger.log(r.INFO,"setCursor: "+f);var _=this.rows[this.currRow];_.setCursor(f)},l.setPAC=function(f){this.logger.log(r.INFO,"pacData = "+JSON.stringify(f));var _=f.row-1;if(this.nrRollUpRows&&_<this.nrRollUpRows-1&&(_=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==_){for(var y=0;y<D;y++)this.rows[y].clear();var v=this.currRow+1-this.nrRollUpRows,N=this.lastOutputScreen;if(N){var j=N.rows[v].cueStartTime,U=this.logger.time;if(j&&U!==null&&j<U)for(var G=0;G<this.nrRollUpRows;G++)this.rows[_-this.nrRollUpRows+G+1].copy(N.rows[v+G])}}this.currRow=_;var z=this.rows[this.currRow];if(f.indent!==null){var L=f.indent,V=Math.max(L-1,0);z.setCursor(f.indent),f.color=z.chars[V].penState.foreground}var W={foreground:f.color,underline:f.underline,italics:f.italics,background:"black",flash:!1};this.setPen(W)},l.setBkgData=function(f){this.logger.log(r.INFO,"bkgData = "+JSON.stringify(f)),this.backSpace(),this.setPen(f),this.insertChar(32)},l.setRollUpRows=function(f){this.nrRollUpRows=f},l.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(r.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(r.TEXT,this.getDisplayText());var f=this.currRow+1-this.nrRollUpRows,_=this.rows.splice(f,1)[0];_.clear(),this.rows.splice(this.currRow,0,_),this.logger.log(r.INFO,"Rolling up")},l.getDisplayText=function(f){f=f||!1;for(var _=[],y="",v=-1,N=0;N<D;N++){var j=this.rows[N].getTextString();j&&(v=N+1,f?_.push("Row "+v+": '"+j+"'"):_.push(j.trim()))}return _.length>0&&(f?y="["+_.join(" | ")+"]":y=_.join(`
|
|
`)),y},l.getTextAndFormat=function(){return this.rows},p}(),C=function(){function p(u,f,_){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=u,this.outputFilter=f,this.mode=null,this.verbose=0,this.displayedMemory=new g(_),this.nonDisplayedMemory=new g(_),this.lastOutputScreen=new g(_),this.currRollUpRow=this.displayedMemory.rows[D-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=_}var l=p.prototype;return l.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[D-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},l.getHandler=function(){return this.outputFilter},l.setHandler=function(f){this.outputFilter=f},l.setPAC=function(f){this.writeScreen.setPAC(f)},l.setBkgData=function(f){this.writeScreen.setBkgData(f)},l.setMode=function(f){if(f===this.mode)return;this.mode=f,this.logger.log(r.INFO,"MODE="+f),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=f},l.insertChars=function(f){for(var _=0;_<f.length;_++)this.writeScreen.insertChar(f[_]);var y=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(r.INFO,y+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(r.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},l.ccRCL=function(){this.logger.log(r.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},l.ccBS=function(){if(this.logger.log(r.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},l.ccAOF=function(){},l.ccAON=function(){},l.ccDER=function(){this.logger.log(r.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},l.ccRU=function(f){this.logger.log(r.INFO,"RU("+f+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(f)},l.ccFON=function(){this.logger.log(r.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},l.ccRDC=function(){this.logger.log(r.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},l.ccTR=function(){this.logger.log(r.INFO,"TR"),this.setMode("MODE_TEXT")},l.ccRTD=function(){this.logger.log(r.INFO,"RTD"),this.setMode("MODE_TEXT")},l.ccEDM=function(){this.logger.log(r.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},l.ccCR=function(){this.logger.log(r.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},l.ccENM=function(){this.logger.log(r.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},l.ccEOC=function(){if(this.logger.log(r.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var f=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=f,this.writeScreen=this.nonDisplayedMemory,this.logger.log(r.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},l.ccTO=function(f){this.logger.log(r.INFO,"TO("+f+") - Tab Offset"),this.writeScreen.moveCursor(f)},l.ccMIDROW=function(f){var _={flash:!1};if(_.underline=f%2===1,_.italics=f>=46,_.italics)_.foreground="white";else{var y=Math.floor(f/2)-16,v=["white","green","blue","cyan","red","yellow","magenta"];_.foreground=v[y]}this.logger.log(r.INFO,"MIDROW: "+JSON.stringify(_)),this.writeScreen.setPen(_)},l.outputDataUpdate=function(f){f===void 0&&(f=!1);var _=this.logger.time;if(_===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=_:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,_,this.lastOutputScreen),f&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:_),this.lastOutputScreen.copy(this.displayedMemory))},l.cueSplitAtTime=function(f){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,f,this.displayedMemory),this.cueStartTime=f))},p}(),A=function(){function p(u,f,_){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var y=new a;this.channels=[null,new C(u,f,y),new C(u+1,_,y)],this.cmdHistory=E(),this.logger=y}var l=p.prototype;return l.getHandler=function(f){return this.channels[f].getHandler()},l.setHandler=function(f,_){this.channels[f].setHandler(_)},l.addData=function(f,_){var y,v,N,j=!1;this.logger.time=f;for(var U=0;U<_.length;U+=2){if(v=_[U]&127,N=_[U+1]&127,v===0&&N===0)continue;if(this.logger.log(r.DATA,"["+s([_[U],_[U+1]])+"] -> ("+s([v,N])+")"),y=this.parseCmd(v,N),y||(y=this.parseMidrow(v,N)),y||(y=this.parsePAC(v,N)),y||(y=this.parseBackgroundAttributes(v,N)),!y&&(j=this.parseChars(v,N),j)){var G=this.currentChannel;if(G&&G>0){var z=this.channels[G];z.insertChars(j)}else this.logger.log(r.WARNING,"No channel found yet. TEXT-MODE?")}!y&&!j&&this.logger.log(r.WARNING,"Couldn't parse cleaned data "+s([v,N])+" orig: "+s([_[U],_[U+1]]))}},l.parseCmd=function(f,_){var y=this.cmdHistory,v=(f===20||f===28||f===21||f===29)&&_>=32&&_<=47,N=(f===23||f===31)&&_>=33&&_<=35;if(!(v||N))return!1;if(M(f,_,y))return w(null,null,y),this.logger.log(r.DEBUG,"Repeated command ("+s([f,_])+") is dropped"),!0;var j=f===20||f===21||f===23?1:2,U=this.channels[j];return f===20||f===21||f===28||f===29?_===32?U.ccRCL():_===33?U.ccBS():_===34?U.ccAOF():_===35?U.ccAON():_===36?U.ccDER():_===37?U.ccRU(2):_===38?U.ccRU(3):_===39?U.ccRU(4):_===40?U.ccFON():_===41?U.ccRDC():_===42?U.ccTR():_===43?U.ccRTD():_===44?U.ccEDM():_===45?U.ccCR():_===46?U.ccENM():_===47&&U.ccEOC():U.ccTO(_-32),w(f,_,y),this.currentChannel=j,!0},l.parseMidrow=function(f,_){var y=0;if((f===17||f===25)&&_>=32&&_<=47){if(f===17?y=1:y=2,y!==this.currentChannel)return this.logger.log(r.ERROR,"Mismatch channel in midrow parsing"),!1;var v=this.channels[y];return v?(v.ccMIDROW(_),this.logger.log(r.DEBUG,"MIDROW ("+s([f,_])+")"),!0):!1}return!1},l.parsePAC=function(f,_){var y,v=this.cmdHistory,N=(f>=17&&f<=23||f>=25&&f<=31)&&_>=64&&_<=127,j=(f===16||f===24)&&_>=64&&_<=95;if(!(N||j))return!1;if(M(f,_,v))return w(null,null,v),!0;var U=f<=23?1:2;_>=64&&_<=95?y=U===1?T[f]:i[f]:y=U===1?b[f]:d[f];var G=this.channels[U];return G?(G.setPAC(this.interpretPAC(y,_)),w(f,_,v),this.currentChannel=U,!0):!1},l.interpretPAC=function(f,_){var y,v={color:null,italics:!1,indent:null,underline:!1,row:f};return _>95?y=_-96:y=_-64,v.underline=(y&1)===1,y<=13?v.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(y/2)]:y<=15?(v.italics=!0,v.color="white"):v.indent=Math.floor((y-16)/2)*4,v},l.parseChars=function(f,_){var y,v=null,N=null;if(f>=25?(y=2,N=f-8):(y=1,N=f),N>=17&&N<=19){var j;N===17?j=_+80:N===18?j=_+112:j=_+144,this.logger.log(r.INFO,"Special char '"+O(j)+"' in channel "+y),v=[j]}else f>=32&&f<=127&&(v=_===0?[f]:[f,_]);if(v){var U=s(v);this.logger.log(r.DEBUG,"Char codes = "+U.join(",")),w(f,_,this.cmdHistory)}return v},l.parseBackgroundAttributes=function(f,_){var y=(f===16||f===24)&&_>=32&&_<=47,v=(f===23||f===31)&&_>=45&&_<=47;if(!(y||v))return!1;var N,j={};f===16||f===24?(N=Math.floor((_-32)/2),j.background=c[N],_%2===1&&(j.background=j.background+"_semi")):_===45?j.background="transparent":(j.foreground="black",_===47&&(j.underline=!0));var U=f<=23?1:2,G=this.channels[U];return G.setBkgData(j),w(f,_,this.cmdHistory),!0},l.reset=function(){for(var f=0;f<Object.keys(this.channels).length;f++){var _=this.channels[f];_&&_.reset()}this.cmdHistory=E()},l.cueSplitAtTime=function(f){for(var _=0;_<this.channels.length;_++){var y=this.channels[_];y&&y.cueSplitAtTime(f)}},p}();function w(p,l,u){u.a=p,u.b=l}function M(p,l,u){return u.a===p&&u.b===l}function E(){return{a:null,b:null}}H.default=A},"./src/utils/codecs.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"isCodecType",function(){return R}),P.d(H,"isCodecSupportedInMp4",function(){return O});var F={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 R(D,m){var T=F[m];return!!T&&T[D.slice(0,4)]===!0}function O(D,m){return MediaSource.isTypeSupported((m||"video")+'/mp4;codecs="'+D+'"')}},"./src/utils/cues.ts":function(Y,H,P){"use strict";P.r(H);var F=P("./src/utils/vttparser.ts"),R=P("./src/utils/webvtt-parser.ts"),O=P("./src/utils/texttrack-utils.ts"),D=/\s/,m={newCue:function(b,i,d,c){for(var r=[],a,s,o,t,h,g=self.VTTCue||self.TextTrackCue,C=0;C<c.rows.length;C++)if(a=c.rows[C],o=!0,t=0,h="",!a.isEmpty()){for(var A=0;A<a.chars.length;A++)D.test(a.chars[A].uchar)&&o?t++:(h+=a.chars[A].uchar,o=!1);a.cueStartTime=i,i===d&&(d+=1e-4),t>=16?t--:t++;var w=Object(F.fixLineBreaks)(h.trim()),M=Object(R.generateCueId)(i,d,w);(!b||!b.cues||!b.cues.getCueById(M))&&(s=new g(i,d,w),s.id=M,s.line=C+1,s.align="left",s.position=10+Math.min(80,Math.floor(t*8/32)*10),r.push(s))}return b&&r.length&&(r.sort(function(E,p){return E.line==="auto"||p.line==="auto"?0:E.line>8&&p.line>8?p.line-E.line:E.line-p.line}),r.forEach(function(E){return Object(O.addCueToTrack)(b,E)})),r}};H.default=m},"./src/utils/discontinuities.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"findFirstFragWithCC",function(){return D}),P.d(H,"shouldAlignOnDiscontinuities",function(){return m}),P.d(H,"findDiscontinuousReferenceFrag",function(){return T}),P.d(H,"adjustSlidingStart",function(){return i}),P.d(H,"alignStream",function(){return d}),P.d(H,"alignPDT",function(){return r}),P.d(H,"alignFragmentByPDTDelta",function(){return a}),P.d(H,"alignMediaPlaylistByPDT",function(){return s});var F=P("./src/polyfills/number.ts"),R=P("./src/utils/logger.ts"),O=P("./src/controller/level-helper.ts");function D(o,t){for(var h=null,g=0,C=o.length;g<C;g++){var A=o[g];if(A&&A.cc===t){h=A;break}}return h}function m(o,t,h){return!!(t.details&&(h.endCC>h.startCC||o&&o.cc<h.startCC))}function T(o,t){var h=o.fragments,g=t.fragments;if(!g.length||!h.length){R.logger.log("No fragments to align");return}var C=D(h,g[0].cc);if(!C||C&&!C.startPTS){R.logger.log("No frag in previous level to align on");return}return C}function b(o,t){if(o){var h=o.start+t;o.start=o.startPTS=h,o.endPTS=h+o.duration}}function i(o,t){for(var h=t.fragments,g=0,C=h.length;g<C;g++)b(h[g],o);t.fragmentHint&&b(t.fragmentHint,o),t.alignedSliding=!0}function d(o,t,h){if(!t)return;c(o,h,t),!h.alignedSliding&&t.details&&r(h,t.details),!h.alignedSliding&&t.details&&!h.skippedSegments&&Object(O.adjustSliding)(t.details,h)}function c(o,t,h){if(m(o,h,t)){var g=T(h.details,t);g&&Object(F.isFiniteNumber)(g.start)&&(R.logger.log("Adjusting PTS using last level due to CC increase within current level "+t.url),i(g.start,t))}}function r(o,t){if(!t.fragments.length||!o.hasProgramDateTime||!t.hasProgramDateTime)return;var h=t.fragments[0].programDateTime,g=o.fragments[0].programDateTime,C=(g-h)/1e3+t.fragments[0].start;C&&Object(F.isFiniteNumber)(C)&&(R.logger.log("Adjusting PTS using programDateTime delta "+(g-h)+"ms, sliding:"+C.toFixed(3)+" "+o.url+" "),i(C,o))}function a(o,t){var h=o.programDateTime;if(!h)return;var g=(h-t)/1e3;o.start=o.startPTS=g,o.endPTS=g+o.duration}function s(o,t){if(!t.fragments.length||!o.hasProgramDateTime||!t.hasProgramDateTime)return;var h=t.fragments[0].programDateTime,g=t.fragments[0].start,C=h-g*1e3;o.fragments.forEach(function(A){a(A,C)}),o.fragmentHint&&a(o.fragmentHint,C),o.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(Y,H,P){"use strict";P.r(H);var F=P("./src/utils/ewma.ts"),R=function(){function O(m,T,b){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=b,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new F.default(m),this.fast_=new F.default(T)}var D=O.prototype;return D.update=function(T,b){var i=this.slow_,d=this.fast_;this.slow_.halfLife!==T&&(this.slow_=new F.default(T,i.getEstimate(),i.getTotalWeight())),this.fast_.halfLife!==b&&(this.fast_=new F.default(b,d.getEstimate(),d.getTotalWeight()))},D.sample=function(T,b){T=Math.max(T,this.minDelayMs_);var i=8*b,d=T/1e3,c=i/d;this.fast_.sample(d,c),this.slow_.sample(d,c)},D.canEstimate=function(){var T=this.fast_;return T&&T.getTotalWeight()>=this.minWeight_},D.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},D.destroy=function(){},O}();H.default=R},"./src/utils/ewma.ts":function(Y,H,P){"use strict";P.r(H);var F=function(){function R(D,m,T){m===void 0&&(m=0),T===void 0&&(T=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=D,this.alpha_=D?Math.exp(Math.log(.5)/D):0,this.estimate_=m,this.totalWeight_=T}var O=R.prototype;return O.sample=function(m,T){var b=Math.pow(this.alpha_,m);this.estimate_=T*(1-b)+b*this.estimate_,this.totalWeight_+=m},O.getTotalWeight=function(){return this.totalWeight_},O.getEstimate=function(){if(this.alpha_){var m=1-Math.pow(this.alpha_,this.totalWeight_);if(m)return this.estimate_/m}return this.estimate_},R}();H.default=F},"./src/utils/fetch-loader.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"fetchSupported",function(){return a});var F=P("./src/polyfills/number.ts"),R=P("./src/loader/load-stats.ts"),O=P("./src/demux/chunk-cache.ts");function D(g,C){g.prototype=Object.create(C.prototype),g.prototype.constructor=g,d(g,C)}function m(g){var C=typeof Map=="function"?new Map:void 0;return m=function(w){if(w===null||!i(w))return w;if(typeof w!="function")throw new TypeError("Super expression must either be null or a function");if(typeof C!="undefined"){if(C.has(w))return C.get(w);C.set(w,M)}function M(){return T(w,arguments,c(this).constructor)}return M.prototype=Object.create(w.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),d(M,w)},m(g)}function T(g,C,A){return b()?T=Reflect.construct:T=function(M,E,p){var l=[null];l.push.apply(l,E);var u=Function.bind.apply(M,l),f=new u;return p&&d(f,p.prototype),f},T.apply(null,arguments)}function b(){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(g){return!1}}function i(g){return Function.toString.call(g).indexOf("[native code]")!==-1}function d(g,C){return d=Object.setPrototypeOf||function(w,M){return w.__proto__=M,w},d(g,C)}function c(g){return c=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)},c(g)}function r(){return r=Object.assign||function(g){for(var C=1;C<arguments.length;C++){var A=arguments[C];for(var w in A)Object.prototype.hasOwnProperty.call(A,w)&&(g[w]=A[w])}return g},r.apply(this,arguments)}function a(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(g){}return!1}var s=function(){function g(A){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=A.fetchSetup||t,this.controller=new self.AbortController,this.stats=new R.LoadStats}var C=g.prototype;return C.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},C.abortInternal=function(){var w=this.response;(!w||!w.ok)&&(this.stats.aborted=!0,this.controller.abort())},C.abort=function(){var w;this.abortInternal(),(w=this.callbacks)!==null&&w!==void 0&&w.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},C.load=function(w,M,E){var p=this,l=this.stats;if(l.loading.start)throw new Error("Loader can only be used once.");l.loading.start=self.performance.now();var u=o(w,this.controller.signal),f=E.onProgress,_=w.responseType==="arraybuffer",y=_?"byteLength":"length";this.context=w,this.config=M,this.callbacks=E,this.request=this.fetchSetup(w,u),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){p.abortInternal(),E.onTimeout(l,w,p.response)},M.timeout),self.fetch(this.request).then(function(v){if(p.response=p.loader=v,!v.ok){var N=v.status,j=v.statusText;throw new h(j||"fetch, bad network response",N,v)}return l.loading.first=Math.max(self.performance.now(),l.loading.start),l.total=parseInt(v.headers.get("Content-Length")||"0"),f&&Object(F.isFiniteNumber)(M.highWaterMark)?p.loadProgressively(v,l,w,M.highWaterMark,f):_?v.arrayBuffer():v.text()}).then(function(v){var N=p.response;self.clearTimeout(p.requestTimeout),l.loading.end=Math.max(self.performance.now(),l.loading.first),l.loaded=l.total=v[y];var j={url:N.url,data:v};f&&!Object(F.isFiniteNumber)(M.highWaterMark)&&f(l,w,v,N),E.onSuccess(j,l,w,N)}).catch(function(v){if(self.clearTimeout(p.requestTimeout),l.aborted)return;var N=v.code||0;E.onError({code:N,text:v.message},w,v.details)})},C.getCacheAge=function(){var w=null;if(this.response){var M=this.response.headers.get("age");w=M?parseFloat(M):null}return w},C.loadProgressively=function(w,M,E,p,l){p===void 0&&(p=0);var u=new O.default,f=w.body.getReader(),_=function y(){return f.read().then(function(v){if(v.done)return u.dataLength&&l(M,E,u.flush(),w),Promise.resolve(new ArrayBuffer(0));var N=v.value,j=N.length;return M.loaded+=j,j<p||u.dataLength?(u.push(N),u.dataLength>=p&&l(M,E,u.flush(),w)):l(M,E,N,w),y()}).catch(function(){return Promise.reject()})};return _()},g}();function o(g,C){var A={method:"GET",mode:"cors",credentials:"same-origin",signal:C,headers:new self.Headers(r({},g.headers))};return g.rangeEnd&&A.headers.set("Range","bytes="+g.rangeStart+"-"+String(g.rangeEnd-1)),A}function t(g,C){return new self.Request(g.url,C)}var h=function(g){D(C,g);function C(A,w,M){var E;return E=g.call(this,A)||this,E.code=void 0,E.details=void 0,E.code=w,E.details=M,E}return C}(m(Error));H.default=s},"./src/utils/imsc1-ttml-parser.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"IMSC1_CODEC",function(){return i}),P.d(H,"parseIMSC1",function(){return a});var F=P("./src/utils/mp4-tools.ts"),R=P("./src/utils/vttparser.ts"),O=P("./src/utils/vttcue.ts"),D=P("./src/demux/id3.ts"),m=P("./src/utils/timescale-conversion.ts"),T=P("./src/utils/webvtt-parser.ts");function b(){return b=Object.assign||function(p){for(var l=1;l<arguments.length;l++){var u=arguments[l];for(var f in u)Object.prototype.hasOwnProperty.call(u,f)&&(p[f]=u[f])}return p},b.apply(this,arguments)}var i="stpp.ttml.im1t",d=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,c=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,r={left:"start",center:"center",right:"end",start:"start",end:"end"};function a(p,l,u,f,_){var y=Object(F.findBox)(new Uint8Array(p),["mdat"]);if(y.length===0){_(new Error("Could not parse IMSC1 mdat"));return}var v=y[0],N=Object(D.utf8ArrayToStr)(new Uint8Array(p,v.start,v.end-v.start)),j=Object(m.toTimescaleFromScale)(l,1,u);try{f(s(N,j))}catch(U){_(U)}}function s(p,l){var u=new DOMParser,f=u.parseFromString(p,"text/xml"),_=f.getElementsByTagName("tt")[0];if(!_)throw new Error("Invalid ttml");var y={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},v=Object.keys(y).reduce(function(z,L){return z[L]=_.getAttribute("ttp:"+L)||y[L],z},{}),N=_.getAttribute("xml:space")!=="preserve",j=t(o(_,"styling","style")),U=t(o(_,"layout","region")),G=o(_,"body","[begin]");return[].map.call(G,function(z){var L=h(z,N);if(!L||!z.hasAttribute("begin"))return null;var V=w(z.getAttribute("begin"),v),W=w(z.getAttribute("dur"),v),$=w(z.getAttribute("end"),v);if(V===null)throw A(z);if($===null){if(W===null)throw A(z);$=V+W}var q=new O.default(V-l,$-l,L);q.id=Object(T.generateCueId)(q.startTime,q.endTime,q.text);var fe=U[z.getAttribute("region")],se=j[z.getAttribute("style")];q.position=10,q.size=80;var me=g(fe,se),ve=me.textAlign;if(ve){var Ae=r[ve];Ae&&(q.lineAlign=Ae),q.align=ve}return b(q,me),q}).filter(function(z){return z!==null})}function o(p,l,u){var f=p.getElementsByTagName(l)[0];return f?[].slice.call(f.querySelectorAll(u)):[]}function t(p){return p.reduce(function(l,u){var f=u.getAttribute("xml:id");return f&&(l[f]=u),l},{})}function h(p,l){return[].slice.call(p.childNodes).reduce(function(u,f,_){var y;return f.nodeName==="br"&&_?u+`
|
|
`:(y=f.childNodes)!==null&&y!==void 0&&y.length?h(f,l):l?u+f.textContent.trim().replace(/\s+/g," "):u+f.textContent},"")}function g(p,l){var u="http://www.w3.org/ns/ttml#styling",f=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return f.reduce(function(_,y){var v=C(l,u,y)||C(p,u,y);return v&&(_[y]=v),_},{})}function C(p,l,u){return p.hasAttributeNS(l,u)?p.getAttributeNS(l,u):null}function A(p){return new Error("Could not parse ttml timestamp "+p)}function w(p,l){if(!p)return null;var u=Object(R.parseTimeStamp)(p);return u===null&&(d.test(p)?u=M(p,l):c.test(p)&&(u=E(p,l))),u}function M(p,l){var u=d.exec(p),f=(u[4]|0)+(u[5]|0)/l.subFrameRate;return(u[1]|0)*3600+(u[2]|0)*60+(u[3]|0)+f/l.frameRate}function E(p,l){var u=c.exec(p),f=Number(u[1]),_=u[2];switch(_){case"h":return f*3600;case"m":return f*60;case"ms":return f*1e3;case"f":return f/l.frameRate;case"t":return f/l.tickRate}return f}},"./src/utils/logger.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"enableLogs",function(){return T}),P.d(H,"logger",function(){return b});var F=function(){},R={trace:F,debug:F,log:F,warn:F,info:F,error:F},O=R;function D(i){var d=self.console[i];return d?d.bind(self.console,"["+i+"] >"):F}function m(i){for(var d=arguments.length,c=new Array(d>1?d-1:0),r=1;r<d;r++)c[r-1]=arguments[r];c.forEach(function(a){O[a]=i[a]?i[a].bind(i):D(a)})}function T(i){if(self.console&&i===!0||typeof i=="object"){m(i,"debug","log","info","warn","error");try{O.log()}catch(d){O=R}}else O=R}var b=O},"./src/utils/mediakeys-helper.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"KeySystems",function(){return F}),P.d(H,"requestMediaKeySystemAccess",function(){return R});var F;(function(O){O.WIDEVINE="com.widevine.alpha",O.PLAYREADY="com.microsoft.playready"})(F||(F={}));var R=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"getMediaSource",function(){return F});function F(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"bin2str",function(){return m}),P.d(H,"readUint16",function(){return T}),P.d(H,"readUint32",function(){return b}),P.d(H,"writeUint32",function(){return i}),P.d(H,"findBox",function(){return d}),P.d(H,"parseSegmentIndex",function(){return c}),P.d(H,"parseInitSegment",function(){return r}),P.d(H,"getStartDTS",function(){return a}),P.d(H,"getDuration",function(){return s}),P.d(H,"computeRawDurationFromSamples",function(){return o}),P.d(H,"offsetStartDTS",function(){return t}),P.d(H,"segmentValidRange",function(){return h}),P.d(H,"appendUint8Array",function(){return g});var F=P("./src/utils/typed-array.ts"),R=P("./src/loader/fragment.ts"),O=Math.pow(2,32)-1,D=[].push;function m(C){return String.fromCharCode.apply(null,C)}function T(C,A){"data"in C&&(A+=C.start,C=C.data);var w=C[A]<<8|C[A+1];return w<0?65536+w:w}function b(C,A){"data"in C&&(A+=C.start,C=C.data);var w=C[A]<<24|C[A+1]<<16|C[A+2]<<8|C[A+3];return w<0?4294967296+w:w}function i(C,A,w){"data"in C&&(A+=C.start,C=C.data),C[A]=w>>24,C[A+1]=w>>16&255,C[A+2]=w>>8&255,C[A+3]=w&255}function d(C,A){var w=[];if(!A.length)return w;var M,E,p;"data"in C?(M=C.data,E=C.start,p=C.end):(M=C,E=0,p=M.byteLength);for(var l=E;l<p;){var u=b(M,l),f=m(M.subarray(l+4,l+8)),_=u>1?l+u:p;if(f===A[0])if(A.length===1)w.push({data:M,start:l+8,end:_});else{var y=d({data:M,start:l+8,end:_},A.slice(1));y.length&&D.apply(w,y)}l=_}return w}function c(C){var A=d(C,["moov"]),w=A[0],M=w?w.end:null,E=d(C,["sidx"]);if(!E||!E[0])return null;var p=[],l=E[0],u=l.data[0],f=u===0?8:16,_=b(l,f);f+=4;var y=0,v=0;u===0?f+=8:f+=16,f+=2;var N=l.end+v,j=T(l,f);f+=2;for(var U=0;U<j;U++){var G=f,z=b(l,G);G+=4;var L=z&2147483647,V=(z&2147483648)>>>31;if(V===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var W=b(l,G);G+=4,p.push({referenceSize:L,subsegmentDuration:W,info:{duration:W/_,start:N,end:N+L-1}}),N+=L,G+=4,f=G}return{earliestPresentationTime:y,timescale:_,version:u,referencesCount:j,references:p,moovEndOffset:M}}function r(C){for(var A=[],w=d(C,["moov","trak"]),M=0;M<w.length;M++){var E=w[M],p=d(E,["tkhd"])[0];if(p){var l=p.data[p.start],u=l===0?12:20,f=b(p,u),_=d(E,["mdia","mdhd"])[0];if(_){l=_.data[_.start],u=l===0?12:20;var y=b(_,u),v=d(E,["mdia","hdlr"])[0];if(v){var N=m(v.data.subarray(v.start+8,v.start+12)),j={soun:R.ElementaryStreamTypes.AUDIO,vide:R.ElementaryStreamTypes.VIDEO}[N];if(j){var U=d(E,["mdia","minf","stbl","stsd"])[0],G=void 0;U&&(G=m(U.data.subarray(U.start+12,U.start+16))),A[f]={timescale:y,type:j},A[j]={timescale:y,id:f,codec:G}}}}}}var z=d(C,["moov","mvex","trex"]);return z.forEach(function(L){var V=b(L,4),W=A[V];W&&(W.default={duration:b(L,12),flags:b(L,20)})}),A}function a(C,A){return d(A,["moof","traf"]).reduce(function(w,M){var E=d(M,["tfdt"])[0],p=E.data[E.start],l=d(M,["tfhd"]).reduce(function(u,f){var _=b(f,4),y=C[_];if(y){var v=b(E,4);p===1&&(v*=Math.pow(2,32),v+=b(E,8));var N=y.timescale||9e4,j=v/N;if(isFinite(j)&&(u===null||j<u))return j}return u},null);return l!==null&&isFinite(l)&&(w===null||l<w)?l:w},null)||0}function s(C,A){for(var w=0,M=0,E=0,p=d(C,["moof","traf"]),l=0;l<p.length;l++){var u=p[l],f=d(u,["tfhd"])[0],_=b(f,4),y=A[_];if(!y)continue;var v=y.default,N=b(f,0)|(v==null?void 0:v.flags),j=v==null?void 0:v.duration;N&8&&(N&2?j=b(f,12):j=b(f,8));for(var U=y.timescale||9e4,G=d(u,["trun"]),z=0;z<G.length;z++){if(j){var L=b(G[z],4);w=j*L}else w=o(G[z]);y.type===R.ElementaryStreamTypes.VIDEO?M+=w/U:y.type===R.ElementaryStreamTypes.AUDIO&&(E+=w/U)}}if(M===0&&E===0){var V=c(C);if(V!=null&&V.references)return V.references.reduce(function(W,$){return W+$.info.duration||0},0)}return M||E}function o(C){var A=b(C,0),w=8;A&1&&(w+=4),A&4&&(w+=4);for(var M=0,E=b(C,4),p=0;p<E;p++){if(A&256){var l=b(C,w);M+=l,w+=4}A&512&&(w+=4),A&1024&&(w+=4),A&2048&&(w+=4)}return M}function t(C,A,w){d(A,["moof","traf"]).forEach(function(M){d(M,["tfhd"]).forEach(function(E){var p=b(E,4),l=C[p];if(!l)return;var u=l.timescale||9e4;d(M,["tfdt"]).forEach(function(f){var _=f.data[f.start],y=b(f,4);if(_===0)i(f,4,y-w*u);else{y*=Math.pow(2,32),y+=b(f,8),y-=w*u,y=Math.max(y,0);var v=Math.floor(y/(O+1)),N=Math.floor(y%(O+1));i(f,4,v),i(f,8,N)}})})})}function h(C){var A={valid:null,remainder:null},w=d(C,["moof"]);if(w){if(w.length<2)return A.remainder=C,A}else return A;var M=w[w.length-1];return A.valid=Object(F.sliceUint8)(C,0,M.start-8),A.remainder=Object(F.sliceUint8)(C,M.start-8),A}function g(C,A){var w=new Uint8Array(C.length+A.length);return w.set(C),w.set(A,C.length),w}},"./src/utils/output-filter.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"default",function(){return F});var F=function(){function R(D,m){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=D,this.trackName=m}var O=R.prototype;return O.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},O.newCue=function(m,T,b){(this.startTime===null||this.startTime>m)&&(this.startTime=m),this.endTime=T,this.screen=b,this.timelineController.createCaptionsTrack(this.trackName)},O.reset=function(){this.cueRanges=[]},R}()},"./src/utils/texttrack-utils.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"sendAddTrackEvent",function(){return R}),P.d(H,"addCueToTrack",function(){return O}),P.d(H,"clearCurrentCues",function(){return D}),P.d(H,"removeCuesInRange",function(){return m}),P.d(H,"getCuesInRange",function(){return b});var F=P("./src/utils/logger.ts");function R(i,d){var c;try{c=new Event("addtrack")}catch(r){c=document.createEvent("Event"),c.initEvent("addtrack",!1,!1)}c.track=i,d.dispatchEvent(c)}function O(i,d){var c=i.mode;if(c==="disabled"&&(i.mode="hidden"),i.cues&&!i.cues.getCueById(d.id))try{if(i.addCue(d),!i.cues.getCueById(d.id))throw new Error("addCue is failed for: "+d)}catch(a){F.logger.debug("[texttrack-utils]: "+a);var r=new self.TextTrackCue(d.startTime,d.endTime,d.text);r.id=d.id,i.addCue(r)}c==="disabled"&&(i.mode=c)}function D(i){var d=i.mode;if(d==="disabled"&&(i.mode="hidden"),i.cues)for(var c=i.cues.length;c--;)i.removeCue(i.cues[c]);d==="disabled"&&(i.mode=d)}function m(i,d,c){var r=i.mode;if(r==="disabled"&&(i.mode="hidden"),i.cues&&i.cues.length>0)for(var a=b(i.cues,d,c),s=0;s<a.length;s++)i.removeCue(a[s]);r==="disabled"&&(i.mode=r)}function T(i,d){if(d<i[0].startTime)return 0;var c=i.length-1;if(d>i[c].endTime)return-1;for(var r=0,a=c;r<=a;){var s=Math.floor((a+r)/2);if(d<i[s].startTime)a=s-1;else if(d>i[s].startTime&&r<c)r=s+1;else return s}return i[r].startTime-d<d-i[a].startTime?r:a}function b(i,d,c){var r=[],a=T(i,d);if(a>-1)for(var s=a,o=i.length;s<o;s++){var t=i[s];if(t.startTime>=d&&t.endTime<=c)r.push(t);else if(t.startTime>c)return r}return r}},"./src/utils/time-ranges.ts":function(Y,H,P){"use strict";P.r(H);var F={toString:function(O){for(var D="",m=O.length,T=0;T<m;T++)D+="["+O.start(T).toFixed(3)+","+O.end(T).toFixed(3)+"]";return D}};H.default=F},"./src/utils/timescale-conversion.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"toTimescaleFromBase",function(){return R}),P.d(H,"toTimescaleFromScale",function(){return O}),P.d(H,"toMsFromMpegTsClock",function(){return D}),P.d(H,"toMpegTsClockFromTimescale",function(){return m});var F=9e4;function R(T,b,i,d){i===void 0&&(i=1),d===void 0&&(d=!1);var c=T*b*i;return d?Math.round(c):c}function O(T,b,i,d){return i===void 0&&(i=1),d===void 0&&(d=!1),R(T,b,1/i,d)}function D(T,b){return b===void 0&&(b=!1),R(T,1e3,1/F,b)}function m(T,b){return b===void 0&&(b=1),R(T,F,1/b)}},"./src/utils/typed-array.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"sliceUint8",function(){return F});function F(R,O,D){return Uint8Array.prototype.slice?R.slice(O,D):new Uint8Array(Array.prototype.slice.call(R,O,D))}},"./src/utils/vttcue.ts":function(Y,H,P){"use strict";P.r(H),H.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var F=["","lr","rl"],R=["start","middle","end","left","right"];function O(i,d){if(typeof d!="string")return!1;if(!Array.isArray(i))return!1;var c=d.toLowerCase();return~i.indexOf(c)?c:!1}function D(i){return O(F,i)}function m(i){return O(R,i)}function T(i){for(var d=arguments.length,c=new Array(d>1?d-1:0),r=1;r<d;r++)c[r-1]=arguments[r];for(var a=1;a<arguments.length;a++){var s=arguments[a];for(var o in s)i[o]=s[o]}return i}function b(i,d,c){var r=this,a={enumerable:!0};r.hasBeenReset=!1;var s="",o=!1,t=i,h=d,g=c,C=null,A="",w=!0,M="auto",E="start",p=50,l="middle",u=50,f="middle";Object.defineProperty(r,"id",T({},a,{get:function(){return s},set:function(y){s=""+y}})),Object.defineProperty(r,"pauseOnExit",T({},a,{get:function(){return o},set:function(y){o=!!y}})),Object.defineProperty(r,"startTime",T({},a,{get:function(){return t},set:function(y){if(typeof y!="number")throw new TypeError("Start time must be set to a number.");t=y,this.hasBeenReset=!0}})),Object.defineProperty(r,"endTime",T({},a,{get:function(){return h},set:function(y){if(typeof y!="number")throw new TypeError("End time must be set to a number.");h=y,this.hasBeenReset=!0}})),Object.defineProperty(r,"text",T({},a,{get:function(){return g},set:function(y){g=""+y,this.hasBeenReset=!0}})),Object.defineProperty(r,"region",T({},a,{get:function(){return C},set:function(y){C=y,this.hasBeenReset=!0}})),Object.defineProperty(r,"vertical",T({},a,{get:function(){return A},set:function(y){var v=D(y);if(v===!1)throw new SyntaxError("An invalid or illegal string was specified.");A=v,this.hasBeenReset=!0}})),Object.defineProperty(r,"snapToLines",T({},a,{get:function(){return w},set:function(y){w=!!y,this.hasBeenReset=!0}})),Object.defineProperty(r,"line",T({},a,{get:function(){return M},set:function(y){if(typeof y!="number"&&y!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");M=y,this.hasBeenReset=!0}})),Object.defineProperty(r,"lineAlign",T({},a,{get:function(){return E},set:function(y){var v=m(y);if(!v)throw new SyntaxError("An invalid or illegal string was specified.");E=v,this.hasBeenReset=!0}})),Object.defineProperty(r,"position",T({},a,{get:function(){return p},set:function(y){if(y<0||y>100)throw new Error("Position must be between 0 and 100.");p=y,this.hasBeenReset=!0}})),Object.defineProperty(r,"positionAlign",T({},a,{get:function(){return l},set:function(y){var v=m(y);if(!v)throw new SyntaxError("An invalid or illegal string was specified.");l=v,this.hasBeenReset=!0}})),Object.defineProperty(r,"size",T({},a,{get:function(){return u},set:function(y){if(y<0||y>100)throw new Error("Size must be between 0 and 100.");u=y,this.hasBeenReset=!0}})),Object.defineProperty(r,"align",T({},a,{get:function(){return f},set:function(y){var v=m(y);if(!v)throw new SyntaxError("An invalid or illegal string was specified.");f=v,this.hasBeenReset=!0}})),r.displayState=void 0}return b.prototype.getCueAsHTML=function(){var i=self.WebVTT;return i.convertCueToDOMTree(self,this.text)},b}()},"./src/utils/vttparser.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"parseTimeStamp",function(){return O}),P.d(H,"fixLineBreaks",function(){return d}),P.d(H,"VTTParser",function(){return c});var F=P("./src/utils/vttcue.ts"),R=function(){function r(){}var a=r.prototype;return a.decode=function(o,t){if(!o)return"";if(typeof o!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(o))},r}();function O(r){function a(o,t,h,g){return(o|0)*3600+(t|0)*60+(h|0)+parseFloat(g||0)}var s=r.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return s?parseFloat(s[2])>59?a(s[2],s[3],0,s[4]):a(s[1],s[2],s[3],s[4]):null}var D=function(){function r(){this.values=Object.create(null)}var a=r.prototype;return a.set=function(o,t){!this.get(o)&&t!==""&&(this.values[o]=t)},a.get=function(o,t,h){return h?this.has(o)?this.values[o]:t[h]:this.has(o)?this.values[o]:t},a.has=function(o){return o in this.values},a.alt=function(o,t,h){for(var g=0;g<h.length;++g)if(t===h[g]){this.set(o,t);break}},a.integer=function(o,t){/^-?\d+$/.test(t)&&this.set(o,parseInt(t,10))},a.percent=function(o,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){var h=parseFloat(t);if(h>=0&&h<=100)return this.set(o,h),!0}return!1},r}();function m(r,a,s,o){var t=o?r.split(o):[r];for(var h in t){if(typeof t[h]!="string")continue;var g=t[h].split(s);if(g.length!==2)continue;var C=g[0],A=g[1];a(C,A)}}var T=new F.default(0,0,""),b=T.align==="middle"?"middle":"center";function i(r,a,s){var o=r;function t(){var C=O(r);if(C===null)throw new Error("Malformed timestamp: "+o);return r=r.replace(/^[^\sa-zA-Z-]+/,""),C}function h(C,A){var w=new D;m(C,function(p,l){var u;switch(p){case"region":for(var f=s.length-1;f>=0;f--)if(s[f].id===l){w.set(p,s[f].region);break}break;case"vertical":w.alt(p,l,["rl","lr"]);break;case"line":u=l.split(","),w.integer(p,u[0]),w.percent(p,u[0])&&w.set("snapToLines",!1),w.alt(p,u[0],["auto"]),u.length===2&&w.alt("lineAlign",u[1],["start",b,"end"]);break;case"position":u=l.split(","),w.percent(p,u[0]),u.length===2&&w.alt("positionAlign",u[1],["start",b,"end","line-left","line-right","auto"]);break;case"size":w.percent(p,l);break;case"align":w.alt(p,l,["start",b,"end","left","right"]);break}},/:/,/\s/),A.region=w.get("region",null),A.vertical=w.get("vertical","");var M=w.get("line","auto");M==="auto"&&T.line===-1&&(M=-1),A.line=M,A.lineAlign=w.get("lineAlign","start"),A.snapToLines=w.get("snapToLines",!0),A.size=w.get("size",100),A.align=w.get("align",b);var E=w.get("position","auto");E==="auto"&&T.position===50&&(E=A.align==="start"||A.align==="left"?0:A.align==="end"||A.align==="right"?100:50),A.position=E}function g(){r=r.replace(/^\s+/,"")}if(g(),a.startTime=t(),g(),r.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+o);r=r.substr(3),g(),a.endTime=t(),g(),h(r,a)}function d(r){return r.replace(/<br(?: \/)?>/gi,`
|
|
`)}var c=function(){function r(){this.state="INITIAL",this.buffer="",this.decoder=new R,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var a=r.prototype;return a.parse=function(o){var t=this;o&&(t.buffer+=t.decoder.decode(o,{stream:!0}));function h(){var E=t.buffer,p=0;for(E=d(E);p<E.length&&E[p]!=="\r"&&E[p]!==`
|
|
`;)++p;var l=E.substr(0,p);return E[p]==="\r"&&++p,E[p]===`
|
|
`&&++p,t.buffer=E.substr(p),l}function g(E){m(E,function(p,l){},/:/)}try{var C="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;C=h();var A=C.match(/^()?WEBVTT([ \t].*)?$/);if(!A||!A[0])throw new Error("Malformed WebVTT signature.");t.state="HEADER"}for(var w=!1;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;w?w=!1:C=h();switch(t.state){case"HEADER":/:/.test(C)?g(C):C||(t.state="ID");continue;case"NOTE":C||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(C)){t.state="NOTE";break}if(!C)continue;if(t.cue=new F.default(0,0,""),t.state="CUE",C.indexOf("-->")===-1){t.cue.id=C;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{i(C,t.cue,t.regionList)}catch(E){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{var M=C.indexOf("-->")!==-1;if(!C||M&&(w=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=`
|
|
`),t.cue.text+=C}continue;case"BADCUE":C||(t.state="ID")}}}catch(E){t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},a.flush=function(){var o=this;try{if((o.cue||o.state==="HEADER")&&(o.buffer+=`
|
|
|
|
`,o.parse()),o.state==="INITIAL"||o.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){o.onparsingerror&&o.onparsingerror(t)}return o.onflush&&o.onflush(),this},r}()},"./src/utils/webvtt-parser.ts":function(Y,H,P){"use strict";P.r(H),P.d(H,"generateCueId",function(){return c}),P.d(H,"parseWebVTT",function(){return a});var F=P("./src/polyfills/number.ts"),R=P("./src/utils/vttparser.ts"),O=P("./src/demux/id3.ts"),D=P("./src/utils/timescale-conversion.ts"),m=P("./src/remux/mp4-remuxer.ts"),T=/\r\n|\n\r|\n|\r/g,b=function(o,t,h){return h===void 0&&(h=0),o.substr(h,t.length)===t},i=function(o){var t=parseInt(o.substr(-3)),h=parseInt(o.substr(-6,2)),g=parseInt(o.substr(-9,2)),C=o.length>9?parseInt(o.substr(0,o.indexOf(":"))):0;if(!Object(F.isFiniteNumber)(t)||!Object(F.isFiniteNumber)(h)||!Object(F.isFiniteNumber)(g)||!Object(F.isFiniteNumber)(C))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+o);return t+=1e3*h,t+=60*1e3*g,t+=60*60*1e3*C,t},d=function(o){for(var t=5381,h=o.length;h;)t=t*33^o.charCodeAt(--h);return(t>>>0).toString()};function c(s,o,t){return d(s.toString())+d(o.toString())+d(t)}var r=function(o,t,h){var g=o[t],C=o[g.prevCC];if(!C||!C.new&&g.new){o.ccOffset=o.presentationOffset=g.start,g.new=!1;return}for(;(A=C)!==null&&A!==void 0&&A.new;){var A;o.ccOffset+=g.start-C.start,g.new=!1,g=C,C=o[g.prevCC]}o.presentationOffset=h};function a(s,o,t,h,g,C,A,w){var M=new R.VTTParser,E=Object(O.utf8ArrayToStr)(new Uint8Array(s)).trim().replace(T,`
|
|
`).split(`
|
|
`),p=[],l=Object(D.toMpegTsClockFromTimescale)(o,t),u="00:00.000",f=0,_=0,y,v=!0,N=!1;M.oncue=function(j){var U=h[g],G=h.ccOffset,z=(f-l)/9e4;if(U!=null&&U.new&&(_!==void 0?G=h.ccOffset=U.start:r(h,g,z)),z&&(G=z-h.presentationOffset),N){var L=j.endTime-j.startTime,V=Object(m.normalizePts)((j.startTime+G-_)*9e4,C*9e4)/9e4;j.startTime=V,j.endTime=V+L}var W=j.text.trim();j.text=decodeURIComponent(encodeURIComponent(W)),j.id||(j.id=c(j.startTime,j.endTime,W)),j.endTime>0&&p.push(j)},M.onparsingerror=function(j){y=j},M.onflush=function(){if(y){w(y);return}A(p)},E.forEach(function(j){if(v)if(b(j,"X-TIMESTAMP-MAP=")){v=!1,N=!0,j.substr(16).split(",").forEach(function(U){b(U,"LOCAL:")?u=U.substr(6):b(U,"MPEGTS:")&&(f=parseInt(U.substr(7)))});try{_=i(u)/1e3}catch(U){N=!1,y=U}return}else j===""&&(v=!1);M.parse(j+`
|
|
`)}),M.flush()}},"./src/utils/xhr-loader.ts":function(Y,H,P){"use strict";P.r(H);var F=P("./src/utils/logger.ts"),R=P("./src/loader/load-stats.ts"),O=/^age:\s*[\d.]+\s*$/m,D=function(){function m(b){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=b?b.xhrSetup:null,this.stats=new R.LoadStats,this.retryDelay=0}var T=m.prototype;return T.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},T.abortInternal=function(){var i=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),i&&(i.onreadystatechange=null,i.onprogress=null,i.readyState!==4&&(this.stats.aborted=!0,i.abort()))},T.abort=function(){var i;this.abortInternal(),(i=this.callbacks)!==null&&i!==void 0&&i.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},T.load=function(i,d,c){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=i,this.config=d,this.callbacks=c,this.retryDelay=d.retryDelay,this.loadInternal()},T.loadInternal=function(){var i=this.config,d=this.context;if(!i)return;var c=this.loader=new self.XMLHttpRequest,r=this.stats;r.loading.first=0,r.loaded=0;var a=this.xhrSetup;try{if(a)try{a(c,d.url)}catch(t){c.open("GET",d.url,!0),a(c,d.url)}c.readyState||c.open("GET",d.url,!0);var s=this.context.headers;if(s)for(var o in s)c.setRequestHeader(o,s[o])}catch(t){this.callbacks.onError({code:c.status,text:t.message},d,c);return}d.rangeEnd&&c.setRequestHeader("Range","bytes="+d.rangeStart+"-"+(d.rangeEnd-1)),c.onreadystatechange=this.readystatechange.bind(this),c.onprogress=this.loadprogress.bind(this),c.responseType=d.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.timeout),c.send()},T.readystatechange=function(){var i=this.context,d=this.loader,c=this.stats;if(!i||!d)return;var r=d.readyState,a=this.config;if(c.aborted)return;if(r>=2)if(self.clearTimeout(this.requestTimeout),c.loading.first===0&&(c.loading.first=Math.max(self.performance.now(),c.loading.start)),r===4){d.onreadystatechange=null,d.onprogress=null;var s=d.status;if(s>=200&&s<300){c.loading.end=Math.max(self.performance.now(),c.loading.first);var o,t;if(i.responseType==="arraybuffer"?(o=d.response,t=o.byteLength):(o=d.responseText,t=o.length),c.loaded=c.total=t,!this.callbacks)return;var h=this.callbacks.onProgress;if(h&&h(c,i,o,d),!this.callbacks)return;var g={url:d.responseURL,data:o};this.callbacks.onSuccess(g,c,i,d)}else c.retry>=a.maxRetry||s>=400&&s<499?(F.logger.error(s+" while loading "+i.url),this.callbacks.onError({code:s,text:d.statusText},i,d)):(F.logger.warn(s+" while loading "+i.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,a.maxRetryDelay),c.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),a.timeout)},T.loadtimeout=function(){F.logger.warn("timeout while loading "+this.context.url);var i=this.callbacks;i&&(this.abortInternal(),i.onTimeout(this.stats,this.context,this.loader))},T.loadprogress=function(i){var d=this.stats;d.loaded=i.loaded,i.lengthComputable&&(d.total=i.total)},T.getCacheAge=function(){var i=null;if(this.loader&&O.test(this.loader.getAllResponseHeaders())){var d=this.loader.getResponseHeader("age");i=d?parseFloat(d):null}return i},m}();H.default=D}}).default})},vHTk:function(Ye,re,I){Ye.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},vKoX:function(Ye,re,I){var Y=I("SrGk"),H=I("bYtY");function P(O,D){Y.call(this,O,D,["filter"],"__filter_in_use__","_shadowDom")}H.inherits(P,Y),P.prototype.addWithoutUpdate=function(O,D){if(D&&F(D.style)){var m;if(D._shadowDom){m=D._shadowDom;var T=this.getDefs(!0);T.contains(D._shadowDom)||this.addDom(m)}else m=this.add(D);this.markUsed(D);var b=m.getAttribute("id");O.style.filter="url(#"+b+")"}},P.prototype.add=function(O){var D=this.createElement("filter");return O._shadowDomId=O._shadowDomId||this.nextId++,D.setAttribute("id","zr"+this._zrId+"-shadow-"+O._shadowDomId),this.updateDom(O,D),this.addDom(D),D},P.prototype.update=function(O,D){var m=D.style;if(F(m)){var T=this;Y.prototype.update.call(this,D,function(){T.updateDom(D,D._shadowDom)})}else this.remove(O,D)},P.prototype.remove=function(O,D){D._shadowDomId!=null&&(this.removeDom(O),O.style.filter="")},P.prototype.updateDom=function(O,D){var m=D.getElementsByTagName("feDropShadow");m.length===0?m=this.createElement("feDropShadow"):m=m[0];var T=O.style,b=O.scale&&O.scale[0]||1,i=O.scale&&O.scale[1]||1,d,c,r,a;if(T.shadowBlur||T.shadowOffsetX||T.shadowOffsetY)d=T.shadowOffsetX||0,c=T.shadowOffsetY||0,r=T.shadowBlur,a=T.shadowColor;else if(T.textShadowBlur)d=T.textShadowOffsetX||0,c=T.textShadowOffsetY||0,r=T.textShadowBlur,a=T.textShadowColor;else{this.removeDom(D,T);return}m.setAttribute("dx",d/b),m.setAttribute("dy",c/i),m.setAttribute("flood-color",a);var s=r/2/b,o=r/2/i,t=s+" "+o;m.setAttribute("stdDeviation",t),D.setAttribute("x","-100%"),D.setAttribute("y","-100%"),D.setAttribute("width",Math.ceil(r/2*200)+"%"),D.setAttribute("height",Math.ceil(r/2*200)+"%"),D.appendChild(m),O._shadowDom=D},P.prototype.markUsed=function(O){O._shadowDom&&Y.prototype.markUsed.call(this,O._shadowDom)};function F(O){return O&&(O.shadowBlur||O.shadowOffsetX||O.shadowOffsetY||O.textShadowBlur||O.textShadowOffsetX||O.textShadowOffsetY)}var R=P;Ye.exports=R},vWvF:function(Ye,re,I){var Y=I("Bq2U"),H=I("SUKs"),P=I("bYtY"),F=P.isString,R=P.isFunction,O=P.isObject,D=P.isArrayLike,m=P.indexOf,T=function(){this.animators=[]};T.prototype={constructor:T,animate:function(r,a){var s,o=!1,t=this,h=this.__zr;if(r){var g=r.split("."),C=t;o=g[0]==="shape";for(var A=0,w=g.length;A<w;A++){if(!C)continue;C=C[g[A]]}C&&(s=C)}else s=t;if(!s){H('Property "'+r+'" is not existed in element '+t.id);return}var M=t.animators,E=new Y(s,a);return E.during(function(p){t.dirty(o)}).done(function(){M.splice(m(M,E),1)}),M.push(E),h&&h.animation.addAnimator(E),E},stopAnimation:function(r){for(var a=this.animators,s=a.length,o=0;o<s;o++)a[o].stop(r);return a.length=0,this},animateTo:function(r,a,s,o,t,h){b(this,r,a,s,o,t,h)},animateFrom:function(r,a,s,o,t,h){b(this,r,a,s,o,t,h,!0)}};function b(r,a,s,o,t,h,g,C){F(o)?(h=t,t=o,o=0):R(t)?(h=t,t="linear",o=0):R(o)?(h=o,o=0):R(s)?(h=s,s=500):s||(s=500),r.stopAnimation(),i(r,"",r,a,s,o,C);var A=r.animators.slice(),w=A.length;function M(){w--,w||h&&h()}w||h&&h();for(var E=0;E<A.length;E++)A[E].done(M).start(t,g)}function i(r,a,s,o,t,h,g){var C={},A=0;for(var w in o){if(!o.hasOwnProperty(w))continue;s[w]!=null?O(o[w])&&!D(o[w])?i(r,a?a+"."+w:w,s[w],o[w],t,h,g):(g?(C[w]=s[w],d(r,a,w,o[w])):C[w]=o[w],A++):o[w]!=null&&!g&&d(r,a,w,o[w])}A>0&&r.animate(a,!1).when(t==null?500:t,C).delay(h||0)}function d(r,a,s,o){if(!a)r.attr(s,o);else{var t={};t[a]={},t[a][s]=o,r.attr(t)}}var c=T;Ye.exports=c},wCXF:function(Ye,re,I){"use strict";I.d(re,"a",function(){return Bt});var Y=I("rePB"),H=I("VTBJ"),P=I("KQm4"),F=I("U8pU"),R=I("ODXe"),O=I("q1tI"),D=I("TSYQ"),m=I.n(D),T=I("Gytx"),b=I.n(T),i=I("Kwbf"),d=I("t23M"),c=I("qx4F"),r=I("6eGT"),a=I("IBYe"),s=I("Ff2n"),o=I("c+Xe"),t=I("fyJ8"),h=I("biw7");function g(Le,Se,ut,mt,We){var vt=ut[Le]||{},Pe=ut[Se]||{},xe,we;vt.fixed==="left"?xe=mt.left[Le]:Pe.fixed==="right"&&(we=mt.right[Se]);var ie=!1,ae=!1,ce=!1,be=!1,Ce=ut[Se+1],Be=ut[Le-1];if(We==="rtl"){if(xe!==void 0){var yt=Be&&Be.fixed==="left";be=!yt}else if(we!==void 0){var Xt=Ce&&Ce.fixed==="right";ce=!Xt}}else if(xe!==void 0){var an=Ce&&Ce.fixed==="left";ie=!an}else if(we!==void 0){var pt=Be&&Be.fixed==="right";ae=!pt}return{fixLeft:xe,fixRight:we,lastFixLeft:ie,firstFixRight:ae,lastFixRight:ce,firstFixLeft:be,isSticky:mt.isSticky}}var C=I("sR1s");function A(Le){var Se=Le.cells,ut=Le.stickyOffsets,mt=Le.flattenColumns,We=Le.rowComponent,vt=Le.cellComponent,Pe=Le.onHeaderRow,xe=Le.index,we=O.useContext(h.a),ie=we.prefixCls,ae=we.direction,ce;Pe&&(ce=Pe(Se.map(function(Ce){return Ce.column}),xe));var be=Object(C.a)(Se.map(function(Ce){return Ce.column}));return O.createElement(We,Object.assign({},ce),Se.map(function(Ce,Be){var yt=Ce.column,Xt=g(Ce.colStart,Ce.colEnd,mt,ut,ae),an;return yt&&yt.onHeaderCell&&(an=Ce.column.onHeaderCell(yt)),O.createElement(t.a,Object.assign({},Ce,{ellipsis:yt.ellipsis,align:yt.align,component:vt,prefixCls:ie,key:be[Be]},Xt,{additionalProps:an,rowType:"header"}))}))}A.displayName="HeaderRow";var w=A;function M(Le){var Se=[];function ut(Pe,xe){var we=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Se[we]=Se[we]||[];var ie=xe,ae=Pe.filter(Boolean).map(function(ce){var be={key:ce.key,className:ce.className||"",children:ce.title,column:ce,colStart:ie},Ce=1,Be=ce.children;return Be&&Be.length>0&&(Ce=ut(Be,ie,we+1).reduce(function(yt,Xt){return yt+Xt},0),be.hasSubColumns=!0),"colSpan"in ce&&(Ce=ce.colSpan),"rowSpan"in ce&&(be.rowSpan=ce.rowSpan),be.colSpan=Ce,be.colEnd=be.colStart+Ce-1,Se[we].push(be),ie+=Ce,Ce});return ae}ut(Le,0);for(var mt=Se.length,We=function(xe){Se[xe].forEach(function(we){!("rowSpan"in we)&&!we.hasSubColumns&&(we.rowSpan=mt-xe)})},vt=0;vt<mt;vt+=1)We(vt);return Se}function E(Le){var Se=Le.stickyOffsets,ut=Le.columns,mt=Le.flattenColumns,We=Le.onHeaderRow,vt=O.useContext(h.a),Pe=vt.prefixCls,xe=vt.getComponent,we=O.useMemo(function(){return M(ut)},[ut]),ie=xe(["header","wrapper"],"thead"),ae=xe(["header","row"],"tr"),ce=xe(["header","cell"],"th");return O.createElement(ie,{className:"".concat(Pe,"-thead")},we.map(function(be,Ce){var Be=O.createElement(w,{key:Ce,flattenColumns:mt,cells:be,stickyOffsets:Se,rowComponent:ae,cellComponent:ce,onHeaderRow:We,index:Ce});return Be}))}var p=E,l=I("hW8S");function u(Le){for(var Se=Le.colWidths,ut=Le.columns,mt=Le.columCount,We=[],vt=mt||ut.length,Pe=!1,xe=vt-1;xe>=0;xe-=1){var we=Se[xe],ie=ut&&ut[xe],ae=ie&&ie[l.a];(we||ae||Pe)&&(We.unshift(O.createElement("col",Object.assign({key:xe,style:{width:we,minWidth:we}},ae))),Pe=!0)}return O.createElement("colgroup",null,We)}var f=u;function _(Le,Se){return Object(O.useMemo)(function(){for(var ut=[],mt=0;mt<Se;mt+=1){var We=Le[mt];if(We!==void 0)ut[mt]=We;else return null}return ut},[Le.join("_"),Se])}var y=O.forwardRef(function(Le,Se){var ut=Le.noData,mt=Le.columns,We=Le.flattenColumns,vt=Le.colWidths,Pe=Le.columCount,xe=Le.stickyOffsets,we=Le.direction,ie=Le.fixHeader,ae=Le.offsetHeader,ce=Le.stickyClassName,be=Le.onScroll,Ce=Object(s.a)(Le,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),Be=O.useContext(h.a),yt=Be.prefixCls,Xt=Be.scrollbarSize,an=Be.isSticky,pt=an&&!ie?0:Xt,Yt=O.useRef(null),St=O.useCallback(function(zt){Object(o.b)(Se,zt),Object(o.b)(Yt,zt)},[]);O.useEffect(function(){var zt;function $t(De){var qe=De.currentTarget,jt=De.deltaX;jt&&(be({currentTarget:qe,scrollLeft:qe.scrollLeft+jt}),De.preventDefault())}return(zt=Yt.current)===null||zt===void 0||zt.addEventListener("wheel",$t),function(){var De;(De=Yt.current)===null||De===void 0||De.removeEventListener("wheel",$t)}},[]);var Ot=We[We.length-1],dt={fixed:Ot?Ot.fixed:null,onHeaderCell:function(){return{className:"".concat(yt,"-cell-scrollbar")}}},_e=Object(O.useMemo)(function(){return pt?[].concat(Object(P.a)(mt),[dt]):mt},[pt,mt]),je=Object(O.useMemo)(function(){return pt?[].concat(Object(P.a)(We),[dt]):We},[pt,We]),kt=Object(O.useMemo)(function(){var zt=xe.right,$t=xe.left;return Object(H.a)(Object(H.a)({},xe),{},{left:we==="rtl"?[].concat(Object(P.a)($t.map(function(De){return De+pt})),[0]):$t,right:we==="rtl"?zt:[].concat(Object(P.a)(zt.map(function(De){return De+pt})),[0]),isSticky:an})},[pt,xe,an]),gt=_(vt,Pe);return O.createElement("div",{style:Object(H.a)({overflow:"hidden"},an?{top:ae}:{}),ref:St,className:m()("".concat(yt,"-header"),Object(Y.a)({},ce,!!ce))},O.createElement("table",{style:{tableLayout:"fixed",visibility:ut||gt?null:"hidden"}},O.createElement(f,{colWidths:gt?[].concat(Object(P.a)(gt),[pt]):[],columCount:Pe+1,columns:je}),O.createElement(p,Object.assign({},Ce,{stickyOffsets:kt,columns:_e,flattenColumns:je}))))});y.displayName="FixedHeader";var v=y,N=O.createContext(null),j=N;function U(Le){var Se=Le.prefixCls,ut=Le.children,mt=Le.component,We=Le.cellComponent,vt=Le.fixHeader,Pe=Le.fixColumn,xe=Le.horizonScroll,we=Le.className,ie=Le.expanded,ae=Le.componentWidth,ce=Le.colSpan,be=O.useContext(h.a),Ce=be.scrollbarSize;return O.useMemo(function(){var Be=ut;return Pe&&(Be=O.createElement("div",{style:{width:ae-(vt?Ce:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Se,"-expanded-row-fixed")},Be)),O.createElement(mt,{className:we,style:{display:ie?null:"none"}},O.createElement(t.a,{component:We,prefixCls:Se,colSpan:ce},Be))},[ut,mt,vt,xe,we,ie,ae,ce,Ce])}var G=U;function z(Le){var Se=Le.className,ut=Le.style,mt=Le.record,We=Le.index,vt=Le.rowKey,Pe=Le.getRowKey,xe=Le.rowExpandable,we=Le.expandedKeys,ie=Le.onRow,ae=Le.indent,ce=ae===void 0?0:ae,be=Le.rowComponent,Ce=Le.cellComponent,Be=Le.childrenColumnName,yt=O.useContext(h.a),Xt=yt.prefixCls,an=yt.fixedInfoList,pt=O.useContext(j),Yt=pt.fixHeader,St=pt.fixColumn,Ot=pt.horizonScroll,dt=pt.componentWidth,_e=pt.flattenColumns,je=pt.expandableType,kt=pt.expandRowByClick,gt=pt.onTriggerExpand,zt=pt.rowClassName,$t=pt.expandedRowClassName,De=pt.indentSize,qe=pt.expandIcon,jt=pt.expandedRowRender,Zt=pt.expandIconColumnIndex,gn=O.useState(!1),On=Object(R.a)(gn,2),ur=On[0],Kn=On[1],wn=we&&we.has(Le.recordKey);O.useEffect(function(){wn&&Kn(!0)},[wn]);var xr=je==="row"&&(!xe||xe(mt)),Fr=je==="nest",hr=Be&&mt&&mt[Be],dr=xr||Fr,Nr;ie&&(Nr=ie(mt,We));var ti=function(B){if(kt&&dr&>(mt,B),Nr&&Nr.onClick){for(var K,Q=arguments.length,le=new Array(Q>1?Q-1:0),Z=1;Z<Q;Z++)le[Z-1]=arguments[Z];(K=Nr).onClick.apply(K,[B].concat(le))}},pi;typeof zt=="string"?pi=zt:typeof zt=="function"&&(pi=zt(mt,We,ce));var fn=Object(C.a)(_e),ar=O.createElement(be,Object.assign({},Nr,{"data-row-key":vt,className:m()(Se,"".concat(Xt,"-row"),"".concat(Xt,"-row-level-").concat(ce),pi,Nr&&Nr.className),style:Object(H.a)(Object(H.a)({},ut),Nr?Nr.style:null),onClick:ti}),_e.map(function(ee,B){var K=ee.render,Q=ee.dataIndex,le=ee.className,Z=fn[B],Qe=an[B],qt;B===(Zt||0)&&Fr&&(qt=O.createElement(O.Fragment,null,O.createElement("span",{style:{paddingLeft:"".concat(De*ce,"px")},className:"".concat(Xt,"-row-indent indent-level-").concat(ce)}),qe({prefixCls:Xt,expanded:wn,expandable:hr,record:mt,onExpand:gt})));var An;return ee.onCell&&(An=ee.onCell(mt,We)),O.createElement(t.a,Object.assign({className:le,ellipsis:ee.ellipsis,align:ee.align,component:Ce,prefixCls:Xt,key:Z,record:mt,index:We,dataIndex:Q,render:K,shouldCellUpdate:ee.shouldCellUpdate},Qe,{appendNode:qt,additionalProps:An}))})),oi;if(xr&&(ur||wn)){var _i=jt(mt,We,ce+1,wn),Qr=$t&&$t(mt,We,ce);oi=O.createElement(G,{expanded:wn,className:m()("".concat(Xt,"-expanded-row"),"".concat(Xt,"-expanded-row-level-").concat(ce+1),Qr),prefixCls:Xt,fixHeader:Yt,fixColumn:St,horizonScroll:Ot,component:be,componentWidth:dt,cellComponent:Ce,colSpan:_e.length},_i)}var ni;return hr&&wn&&(ni=(mt[Be]||[]).map(function(ee,B){var K=Pe(ee,B);return O.createElement(z,Object.assign({},Le,{key:K,rowKey:K,record:ee,recordKey:K,index:B,indent:ce+1}))})),O.createElement(O.Fragment,null,ar,oi,ni)}z.displayName="BodyRow";var L=z,V=O.createContext(null),W=V;function $(Le){var Se=Le.columnKey,ut=Le.onColumnResize,mt=O.useRef();return O.useEffect(function(){mt.current&&ut(Se,mt.current.offsetWidth)},[]),O.createElement(d.a,{onResize:function(vt){var Pe=vt.offsetWidth;ut(Se,Pe)}},O.createElement("td",{ref:mt,style:{padding:0,border:0,height:0}},O.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function q(Le){var Se=Le.data,ut=Le.getRowKey,mt=Le.measureColumnWidth,We=Le.expandedKeys,vt=Le.onRow,Pe=Le.rowExpandable,xe=Le.emptyNode,we=Le.childrenColumnName,ie=O.useContext(W),ae=ie.onColumnResize,ce=O.useContext(h.a),be=ce.prefixCls,Ce=ce.getComponent,Be=O.useContext(j),yt=Be.fixHeader,Xt=Be.horizonScroll,an=Be.flattenColumns,pt=Be.componentWidth;return O.useMemo(function(){var Yt=Ce(["body","wrapper"],"tbody"),St=Ce(["body","row"],"tr"),Ot=Ce(["body","cell"],"td"),dt;Se.length?dt=Se.map(function(je,kt){var gt=ut(je,kt);return O.createElement(L,{key:gt,rowKey:gt,record:je,recordKey:gt,index:kt,rowComponent:St,cellComponent:Ot,expandedKeys:We,onRow:vt,getRowKey:ut,rowExpandable:Pe,childrenColumnName:we})}):dt=O.createElement(G,{expanded:!0,className:"".concat(be,"-placeholder"),prefixCls:be,fixHeader:yt,fixColumn:Xt,horizonScroll:Xt,component:St,componentWidth:pt,cellComponent:Ot,colSpan:an.length},xe);var _e=Object(C.a)(an);return O.createElement(Yt,{className:"".concat(be,"-tbody")},mt&&O.createElement("tr",{"aria-hidden":"true",className:"".concat(be,"-measure-row"),style:{height:0}},_e.map(function(je){return O.createElement($,{key:je,columnKey:je,onColumnResize:ae})})),dt)},[Se,be,vt,mt,We,ut,Ce,pt,xe,an])}var fe=O.memo(q);fe.displayName="Body";var se=fe,me=I("wRmb"),ve=I("xEkU"),Ae=I.n(ve);function ge(Le){var Se=Object(O.useRef)(Le),ut=Object(O.useState)({}),mt=Object(R.a)(ut,2),We=mt[1],vt=Object(O.useRef)(null),Pe=Object(O.useRef)([]);function xe(we){vt.current===null&&(Pe.current=[],vt.current=Ae()(function(){Pe.current.forEach(function(ie){Se.current=ie(Se.current)}),vt.current=null,We({})})),Pe.current.push(we)}return Object(O.useEffect)(function(){return function(){Ae.a.cancel(vt.current)}},[]),[Se.current,xe]}function ue(Le){var Se=Object(O.useRef)(Le),ut=Object(O.useRef)(null);function mt(){window.clearTimeout(ut.current)}function We(Pe){Se.current=Pe,mt(),ut.current=window.setTimeout(function(){Se.current=null,ut.current=null},100)}function vt(){return Se.current}return Object(O.useEffect)(function(){return mt},[]),[We,vt]}function $e(Le,Se,ut){var mt=Object(O.useMemo)(function(){for(var We=[],vt=[],Pe=0,xe=0,we=0;we<Se;we+=1)if(ut==="rtl"){vt[we]=xe,xe+=Le[we]||0;var ie=Se-we-1;We[ie]=Pe,Pe+=Le[ie]||0}else{We[we]=Pe,Pe+=Le[we]||0;var ae=Se-we-1;vt[ae]=xe,xe+=Le[ae]||0}return{left:We,right:vt}},[Le,Se,ut]);return mt}var Tt=$e;function ye(Le){var Se=Le.className,ut=Le.children;return O.createElement("div",{className:Se},ut)}var Re=ye,nt=I("n6Qo");function Ue(Le){var Se,ut=Le.prefixCls,mt=Le.record,We=Le.onExpand,vt=Le.expanded,Pe=Le.expandable,xe="".concat(ut,"-row-expand-icon");if(!Pe)return O.createElement("span",{className:m()(xe,"".concat(ut,"-row-spaced"))});var we=function(ae){We(mt,ae),ae.stopPropagation()};return O.createElement("span",{className:m()(xe,(Se={},Object(Y.a)(Se,"".concat(ut,"-row-expanded"),vt),Object(Y.a)(Se,"".concat(ut,"-row-collapsed"),!vt),Se)),onClick:we})}function ke(Le,Se,ut){var mt=[];function We(vt){(vt||[]).forEach(function(Pe,xe){mt.push(Se(Pe,xe)),We(Pe[ut])})}return We(Le),mt}var lt=I("zT1h"),Fe=I("y0+3"),Ze=function(Se,ut){var mt,We,vt=Se.scrollBodyRef,Pe=Se.onScroll,xe=Se.offsetScroll,we=O.useContext(h.a),ie=we.prefixCls,ae=((mt=vt.current)===null||mt===void 0?void 0:mt.scrollWidth)||0,ce=((We=vt.current)===null||We===void 0?void 0:We.clientWidth)||0,be=ae&&ce*(ce/ae),Ce=O.useRef(),Be=ge({scrollLeft:0,isHiddenScrollBar:!1}),yt=Object(R.a)(Be,2),Xt=yt[0],an=yt[1],pt=O.useRef({delta:0,x:0}),Yt=O.useState(!1),St=Object(R.a)(Yt,2),Ot=St[0],dt=St[1],_e=function(){dt(!1)},je=function(De){De.persist(),pt.current.delta=De.pageX-Xt.scrollLeft,pt.current.x=0,dt(!0),De.preventDefault()},kt=function(De){var qe,jt=De||((qe=window)===null||qe===void 0?void 0:qe.event),Zt=jt.buttons;if(!Ot||Zt===0){Ot&&dt(!1);return}var gn=pt.current.x+De.pageX-pt.current.x-pt.current.delta;gn<=0&&(gn=0),gn+be>=ce&&(gn=ce-be),Pe({scrollLeft:gn/ce*(ae+2)}),pt.current.x=De.pageX},gt=function(){var De=Object(Fe.b)(vt.current).top,qe=De+vt.current.offsetHeight,jt=document.documentElement.scrollTop+window.innerHeight;qe-Object(c.a)()<=jt||De>=jt-xe?an(function(Zt){return Object(H.a)(Object(H.a)({},Zt),{},{isHiddenScrollBar:!0})}):an(function(Zt){return Object(H.a)(Object(H.a)({},Zt),{},{isHiddenScrollBar:!1})})},zt=function(De){an(function(qe){return Object(H.a)(Object(H.a)({},qe),{},{scrollLeft:De/ae*ce||0})})};return O.useImperativeHandle(ut,function(){return{setScrollLeft:zt}}),O.useEffect(function(){var $t=Object(lt.a)(document.body,"mouseup",_e,!1),De=Object(lt.a)(document.body,"mousemove",kt,!1);return gt(),function(){$t.remove(),De.remove()}},[be,Ot]),O.useEffect(function(){var $t=Object(lt.a)(window,"scroll",gt,!1),De=Object(lt.a)(window,"resize",gt,!1);return function(){$t.remove(),De.remove()}},[]),O.useEffect(function(){Xt.isHiddenScrollBar||an(function($t){var De,qe;return Object(H.a)(Object(H.a)({},$t),{},{scrollLeft:vt.current.scrollLeft/((De=vt.current)===null||De===void 0?void 0:De.scrollWidth)*((qe=vt.current)===null||qe===void 0?void 0:qe.clientWidth)})})},[Xt.isHiddenScrollBar]),ae<=ce||!be||Xt.isHiddenScrollBar?null:O.createElement("div",{style:{height:Object(c.a)(),width:ce,bottom:xe},className:"".concat(ie,"-sticky-scroll")},O.createElement("div",{onMouseDown:je,ref:Ce,className:m()("".concat(ie,"-sticky-scroll-bar"),Object(Y.a)({},"".concat(ie,"-sticky-scroll-bar-active"),Ot)),style:{width:"".concat(be,"px"),transform:"translate3d(".concat(Xt.scrollLeft,"px, 0, 0)")}}))},Xe=O.forwardRef(Ze);function ft(Le,Se){return O.useMemo(function(){var ut=!!Le;return{isSticky:ut,stickyClassName:ut?"".concat(Se,"-sticky-header"):"",offsetHeader:Object(F.a)(Le)==="object"&&Le.offsetHeader||0,offsetScroll:Object(F.a)(Le)==="object"&&Le.offsetScroll||0}},[Le,Se])}var Rt=[],Pt={},Bt="rc-table-internal-hook",Ve=O.memo(function(Le){var Se=Le.children;return Se},function(Le,Se){return b()(Le.props,Se.props)?Le.pingLeft!==Se.pingLeft||Le.pingRight!==Se.pingRight:!1});function Ft(Le){var Se,ut=Le.prefixCls,mt=Le.className,We=Le.rowClassName,vt=Le.style,Pe=Le.data,xe=Le.rowKey,we=Le.scroll,ie=Le.tableLayout,ae=Le.direction,ce=Le.title,be=Le.footer,Ce=Le.summary,Be=Le.id,yt=Le.showHeader,Xt=Le.components,an=Le.emptyText,pt=Le.onRow,Yt=Le.onHeaderRow,St=Le.internalHooks,Ot=Le.transformColumns,dt=Le.internalRefs,_e=Le.sticky,je=Pe||Rt,kt=!!je.length,gt=O.useState(0),zt=Object(R.a)(gt,2),$t=zt[0],De=zt[1];O.useEffect(function(){De(Object(c.a)())});var qe=O.useMemo(function(){return Object(C.c)(Xt,{})},[Xt]),jt=O.useCallback(function(Bn,Xn){return Object(C.b)(qe,Bn)||Xn},[qe]),Zt=O.useMemo(function(){return typeof xe=="function"?xe:function(Bn){var Xn=Bn&&Bn[xe];return Xn}},[xe]),gn=Object(l.c)(Le),On=gn.expandIcon,ur=gn.expandedRowKeys,Kn=gn.defaultExpandedRowKeys,wn=gn.defaultExpandAllRows,xr=gn.expandedRowRender,Fr=gn.onExpand,hr=gn.onExpandedRowsChange,dr=gn.expandRowByClick,Nr=gn.rowExpandable,ti=gn.expandIconColumnIndex,pi=gn.expandedRowClassName,fn=gn.childrenColumnName,ar=gn.indentSize,oi=On||Ue,_i=fn||"children",Qr=O.useMemo(function(){return xr?"row":Le.expandable&&St===Bt&&Le.expandable.__PARENT_RENDER_ICON__||je.some(function(Bn){return Bn&&Object(F.a)(Bn)==="object"&&Bn[_i]})?"nest":!1},[!!xr,je]),ni=O.useState(function(){return Kn||(wn?ke(je,Zt,_i):[])}),ee=Object(R.a)(ni,2),B=ee[0],K=ee[1],Q=O.useMemo(function(){return new Set(ur||B||[])},[ur,B]),le=O.useCallback(function(Bn){var Xn=Zt(Bn,je.indexOf(Bn)),Qn,Cr=Q.has(Xn);Cr?(Q.delete(Xn),Qn=Object(P.a)(Q)):Qn=[].concat(Object(P.a)(Q),[Xn]),K(Qn),Fr&&Fr(!Cr,Bn),hr&&hr(Qn)},[Zt,Q,je,Fr,hr]),Z=O.useState(0),Qe=Object(R.a)(Z,2),qt=Qe[0],An=Qe[1],Vn=Object(me.b)(Object(H.a)(Object(H.a)(Object(H.a)({},Le),gn),{},{expandable:!!xr,expandedKeys:Q,getRowKey:Zt,onTriggerExpand:le,expandIcon:oi,expandIconColumnIndex:ti,direction:ae}),St===Bt?Ot:null),sn=Object(R.a)(Vn,2),tr=sn[0],vn=sn[1],ln=O.useMemo(function(){return{columns:tr,flattenColumns:vn}},[tr,vn]),xn=O.useRef(),In=O.useRef(),sr=O.useRef(),$n=O.useState(!1),Zn=Object(R.a)($n,2),kn=Zn[0],mr=Zn[1],Fn=O.useState(!1),nr=Object(R.a)(Fn,2),Gn=nr[0],Hn=nr[1],Sr=ge(new Map),wr=Object(R.a)(Sr,2),br=wr[0],Er=wr[1],te=Object(C.a)(vn),Te=te.map(function(Bn){return br.get(Bn)}),Ge=O.useMemo(function(){return Te},[Te.join("_")]),Me=Tt(Ge,vn.length,ae),st=we&&Object(C.d)(we.y),Je=we&&Object(C.d)(we.x),ct=Je&&vn.some(function(Bn){var Xn=Bn.fixed;return Xn}),ht=O.useRef(),at=ft(_e,ut),Mt=at.isSticky,Gt=at.offsetHeader,Vt=at.offsetScroll,wt=at.stickyClassName,Nt,it,Qt;st&&(it={overflowY:"scroll",maxHeight:we.y}),Je&&(Nt={overflowX:"auto"},st||(it={overflowY:"hidden"}),Qt={width:we.x===!0?"auto":we.x,minWidth:"100%"});var Wt=O.useCallback(function(Bn,Xn){Er(function(Qn){var Cr=new Map(Qn);return Cr.set(Bn,Xn),Cr})},[]),yn=ue(null),Dn=Object(R.a)(yn,2),Kt=Dn[0],dn=Dn[1];function Ht(Bn,Xn){if(!Xn)return;typeof Xn=="function"?Xn(Bn):Xn.scrollLeft!==Bn&&(Xn.scrollLeft=Bn)}var Sn=function(Xn){var Qn=Xn.currentTarget,Cr=Xn.scrollLeft,Wr=typeof Cr=="number"?Cr:Qn.scrollLeft,Jr=Qn||Pt;if(!dn()||dn()===Jr){var li;Kt(Jr),Ht(Wr,In.current),Ht(Wr,sr.current),Ht(Wr,(li=ht.current)===null||li===void 0?void 0:li.setScrollLeft)}if(Qn){var xi=Qn.scrollWidth,mi=Qn.clientWidth;mr(Wr>0),Hn(Wr<xi-mi)}},Tn=function(){sr.current&&Sn({currentTarget:sr.current})},xt=function(Xn){var Qn=Xn.width;Tn(),An(xn.current?xn.current.offsetWidth:Qn)};O.useEffect(function(){return Tn},[]),O.useEffect(function(){Je&&Tn()},[Je]),O.useEffect(function(){St===Bt&&dt&&(dt.body.current=sr.current)});var bt=jt(["table"],"table"),Lt=O.useMemo(function(){return ie||(ct?we.x==="max-content"?"auto":"fixed":st||vn.some(function(Bn){var Xn=Bn.ellipsis;return Xn})?"fixed":"auto")},[st,ct,vn,ie]),At,Et={colWidths:Ge,columCount:vn.length,stickyOffsets:Me,onHeaderRow:Yt,fixHeader:st},mn=O.useMemo(function(){return kt?null:typeof an=="function"?an():an},[kt,an]),cn=O.createElement(se,{data:je,measureColumnWidth:st||Je||Mt,expandedKeys:Q,rowExpandable:Nr,getRowKey:Zt,onRow:pt,emptyNode:mn,childrenColumnName:_i}),_n=O.createElement(f,{colWidths:vn.map(function(Bn){var Xn=Bn.width;return Xn}),columns:vn}),un=Ce&&O.createElement(nt.b,null,Ce(je)),rn=jt(["body"]);if(st||Mt){var Cn;typeof rn=="function"?(Cn=rn(je,{scrollbarSize:$t,ref:sr,onScroll:Sn}),Et.colWidths=vn.map(function(Bn,Xn){var Qn=Bn.width,Cr=Xn===tr.length-1?Qn-$t:Qn;return typeof Cr=="number"&&!Number.isNaN(Cr)?Cr:(Object(i.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):Cn=O.createElement("div",{style:Object(H.a)(Object(H.a)({},Nt),it),onScroll:Sn,ref:sr,className:m()("".concat(ut,"-body"))},O.createElement(bt,{style:Object(H.a)(Object(H.a)({},Qt),{},{tableLayout:Lt})},_n,cn,un),Mt&&O.createElement(Xe,{ref:ht,offsetScroll:Vt,scrollBodyRef:sr,onScroll:Sn})),At=O.createElement(O.Fragment,null,yt!==!1&&O.createElement(v,Object.assign({noData:!je.length},Et,ln,{direction:ae,offsetHeader:Gt,stickyClassName:wt,ref:In,onScroll:Sn})),Cn)}else At=O.createElement("div",{style:Object(H.a)(Object(H.a)({},Nt),it),className:m()("".concat(ut,"-content")),onScroll:Sn,ref:sr},O.createElement(bt,{style:Object(H.a)(Object(H.a)({},Qt),{},{tableLayout:Lt})},_n,yt!==!1&&O.createElement(p,Object.assign({},Et,ln)),cn,un));var rr=Object(l.b)(Le),cr=O.createElement("div",Object.assign({className:m()(ut,mt,(Se={},Object(Y.a)(Se,"".concat(ut,"-rtl"),ae==="rtl"),Object(Y.a)(Se,"".concat(ut,"-ping-left"),kn),Object(Y.a)(Se,"".concat(ut,"-ping-right"),Gn),Object(Y.a)(Se,"".concat(ut,"-layout-fixed"),ie==="fixed"),Object(Y.a)(Se,"".concat(ut,"-fixed-header"),st),Object(Y.a)(Se,"".concat(ut,"-fixed-column"),ct),Object(Y.a)(Se,"".concat(ut,"-scroll-horizontal"),Je),Object(Y.a)(Se,"".concat(ut,"-has-fix-left"),vn[0]&&vn[0].fixed),Object(Y.a)(Se,"".concat(ut,"-has-fix-right"),vn[vn.length-1]&&vn[vn.length-1].fixed==="right"),Se)),style:vt,id:Be,ref:xn},rr),O.createElement(Ve,{pingLeft:kn,pingRight:Gn,props:Object(H.a)(Object(H.a)({},Le),{},{stickyOffsets:Me,mergedExpandedKeys:Q})},ce&&O.createElement(Re,{className:"".concat(ut,"-title")},ce(je)),O.createElement("div",{className:"".concat(ut,"-container")},At),be&&O.createElement(Re,{className:"".concat(ut,"-footer")},be(je))));Je&&(cr=O.createElement(d.a,{onResize:xt},cr));var zn=O.useMemo(function(){return{prefixCls:ut,getComponent:jt,scrollbarSize:$t,direction:ae,fixedInfoList:vn.map(function(Bn,Xn){return g(Xn,Xn,vn,Me,ae)}),isSticky:Mt}},[ut,jt,$t,ae,vn,Me,ae,Mt]),Dr=O.useMemo(function(){return Object(H.a)(Object(H.a)({},ln),{},{tableLayout:Lt,rowClassName:We,expandedRowClassName:pi,componentWidth:qt,fixHeader:st,fixColumn:ct,horizonScroll:Je,expandIcon:oi,expandableType:Qr,expandRowByClick:dr,expandedRowRender:xr,onTriggerExpand:le,expandIconColumnIndex:ti,indentSize:ar})},[ln,Lt,We,pi,qt,st,ct,Je,oi,Qr,dr,xr,le,ti,ar]),Kr=O.useMemo(function(){return{onColumnResize:Wt}},[Wt]);return O.createElement(h.a.Provider,{value:zn},O.createElement(j.Provider,{value:Dr},O.createElement(W.Provider,{value:Kr},cr)))}Ft.Column=a.a,Ft.ColumnGroup=r.a,Ft.Summary=nt.a,Ft.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var nn=re.b=Ft},wRmb:function(Ye,re,I){"use strict";I.d(re,"a",function(){return b});var Y=I("rePB"),H=I("KQm4"),P=I("VTBJ"),F=I("Ff2n"),R=I("q1tI"),O=I.n(R),D=I("Kwbf"),m=I("Zm9Q"),T=I("hW8S");function b(a){return Object(m.a)(a).filter(function(s){return R.isValidElement(s)}).map(function(s){var o=s.key,t=s.props,h=t.children,g=Object(F.a)(t,["children"]),C=Object(P.a)({key:o},g);return h&&(C.children=b(h)),C})}function i(a){return a.reduce(function(s,o){var t=o.fixed,h=t===!0?"left":t,g=o.children;return g&&g.length>0?[].concat(Object(H.a)(s),Object(H.a)(i(g).map(function(C){return Object(P.a)({fixed:h},C)}))):[].concat(Object(H.a)(s),[Object(P.a)(Object(P.a)({},o),{},{fixed:h})])},[])}function d(a){for(var s=!0,o=0;o<a.length;o+=1){var t=a[o];if(s&&t.fixed!=="left")s=!1;else if(!s&&t.fixed==="left"){Object(D.a)(!1,"Index ".concat(o-1," of `columns` missing `fixed='left'` prop."));break}}for(var h=!0,g=a.length-1;g>=0;g-=1){var C=a[g];if(h&&C.fixed!=="right")h=!1;else if(!h&&C.fixed==="right"){Object(D.a)(!1,"Index ".concat(g+1," of `columns` missing `fixed='right'` prop."));break}}}function c(a){return a.map(function(s){var o=s.fixed,t=Object(F.a)(s,["fixed"]),h=o;return o==="left"?h="right":o==="right"&&(h="left"),Object(P.a)({fixed:h},t)})}function r(a,s){var o=a.prefixCls,t=a.columns,h=a.children,g=a.expandable,C=a.expandedKeys,A=a.getRowKey,w=a.onTriggerExpand,M=a.expandIcon,E=a.rowExpandable,p=a.expandIconColumnIndex,l=a.direction,u=a.expandRowByClick,f=R.useMemo(function(){return t||b(h)},[t,h]),_=R.useMemo(function(){if(g){var N,j=p||0,U=f[j],G=(N={},Object(Y.a)(N,T.a,{className:"".concat(o,"-expand-icon-col")}),Object(Y.a)(N,"title",""),Object(Y.a)(N,"fixed",U?U.fixed:null),Object(Y.a)(N,"className","".concat(o,"-row-expand-icon-cell")),Object(Y.a)(N,"render",function(V,W,$){var q=A(W,$),fe=C.has(q),se=E?E(W):!0,me=M({prefixCls:o,expanded:fe,expandable:se,record:W,onExpand:w});return u?R.createElement("span",{onClick:function(Ae){return Ae.stopPropagation()}},me):me}),N),z=f.slice();return j>=0&&z.splice(j,0,G),z}return f},[g,f,A,C,M,l]),y=R.useMemo(function(){var N=_;return s&&(N=s(N)),N.length||(N=[{render:function(){return null}}]),N},[s,_,l]),v=R.useMemo(function(){return l==="rtl"?c(i(y)):i(y)},[y,l]);return[y,v]}re.b=r},x6Kt:function(Ye,re,I){var Y=I("y+Vt"),H=I("VpOo"),P=I("nPnh"),F=P.subPixelOptimizeRect,R={},O=Y.extend({type:"rect",shape:{r:0,x:0,y:0,width:0,height:0},buildPath:function(D,m){var T,b,i,d;this.subPixelOptimize?(F(R,m,this.style),T=R.x,b=R.y,i=R.width,d=R.height,R.r=m.r,m=R):(T=m.x,b=m.y,i=m.width,d=m.height),m.r?H.buildPath(D,m):D.rect(T,b,i,d),D.closePath();return}});Ye.exports=O},xOL1:function(Ye,re){Ye.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAbVJREFUOE+Nk79rFUEUhb+zE4OFwUD+CyGKKQQbSaMikQQ7C1tBBIsUQaJvl2Fn/cWDpAiIYJsi7YOIaCUWFoKKRhG0sbEzEImFGnev7G6yyXsxeU5159yZb87l3hG9q2WLiBO79FIwXpLp0s6cwITnQCMWrGDM43jdBckZQ0wTMdrong2R2Bxm0/98sZ8ozdcOEm5hjOC41u9Olc9ZQKySclOVkNhljCmCzjeAJM/4FbW5p+8k5tlggTtarfKxLSM6pHq4BTiL0SboaAOIi284jeP1nti+ApMEvdoEvEPMkOpJDZi1IwzwgqDh/wSsYZwk08ca4O0Qua3zW8OV5crmHg6u22EGbQ2nIbx+1IC6rrK+cYJW9gXEVrbxGUEj5bltQGJvgBapHu0LSGwCyEh1vBsQWwd4TNCDPg6uAOcImuoFlL1dJ9WNPg5uYwwRVM3MzhJmKIpjZK6e9bj4jNNpvL4QFx9wuoDXJ1r5IlH0llTtXgcXwa4SolObnYnwKnbFcfEcdJ+gpW6AtzFynuIop/Fn053u4CA5yzjO4FV9tu0Syl2S38WiSWBgD8AfoEPQ7Fb+LwIiyhxWwe2KAAAAAElFTkSuQmCC"},"y+Vt":function(Ye,re,I){var Y=I("Gev7"),H=I("bYtY"),P=I("IMiH"),F=I("2DNl"),R=I("3C/r"),O=R.prototype.getCanvasPattern,D=Math.abs,m=new P(!0);function T(i){Y.call(this,i),this.path=null}T.prototype={constructor:T,type:"path",__dirtyPath:!0,strokeContainThreshold:5,segmentIgnoreThreshold:0,subPixelOptimize:!1,brush:function(i,d){var c=this.style,r=this.path||m,a=c.hasStroke(),s=c.hasFill(),o=c.fill,t=c.stroke,h=s&&!!o.colorStops,g=a&&!!t.colorStops,C=s&&!!o.image,A=a&&!!t.image;if(c.bind(i,this,d),this.setTransform(i),this.__dirty){var w;h&&(w=w||this.getBoundingRect(),this._fillGradient=c.getGradient(i,o,w)),g&&(w=w||this.getBoundingRect(),this._strokeGradient=c.getGradient(i,t,w))}h?i.fillStyle=this._fillGradient:C&&(i.fillStyle=O.call(o,i)),g?i.strokeStyle=this._strokeGradient:A&&(i.strokeStyle=O.call(t,i));var M=c.lineDash,E=c.lineDashOffset,p=!!i.setLineDash,l=this.getGlobalScale();if(r.setScale(l[0],l[1],this.segmentIgnoreThreshold),this.__dirtyPath||M&&!p&&a?(r.beginPath(i),M&&!p&&(r.setLineDash(M),r.setLineDashOffset(E)),this.buildPath(r,this.shape,!1),this.path&&(this.__dirtyPath=!1)):(i.beginPath(),this.path.rebuildPath(i)),s)if(c.fillOpacity!=null){var u=i.globalAlpha;i.globalAlpha=c.fillOpacity*c.opacity,r.fill(i),i.globalAlpha=u}else r.fill(i);if(M&&p&&(i.setLineDash(M),i.lineDashOffset=E),a)if(c.strokeOpacity!=null){var u=i.globalAlpha;i.globalAlpha=c.strokeOpacity*c.opacity,r.stroke(i),i.globalAlpha=u}else r.stroke(i);M&&p&&i.setLineDash([]),c.text!=null&&(this.restoreTransform(i),this.drawRectText(i,this.getBoundingRect()))},buildPath:function(i,d,c){},createPathProxy:function(){this.path=new P},getBoundingRect:function(){var i=this._rect,d=this.style,c=!i;if(c){var r=this.path;r||(r=this.path=new P),this.__dirtyPath&&(r.beginPath(),this.buildPath(r,this.shape,!1)),i=r.getBoundingRect()}if(this._rect=i,d.hasStroke()){var a=this._rectWithStroke||(this._rectWithStroke=i.clone());if(this.__dirty||c){a.copy(i);var s=d.lineWidth,o=d.strokeNoScale?this.getLineScale():1;d.hasFill()||(s=Math.max(s,this.strokeContainThreshold||4)),o>1e-10&&(a.width+=s/o,a.height+=s/o,a.x-=s/o/2,a.y-=s/o/2)}return a}return i},contain:function(i,d){var c=this.transformCoordToLocal(i,d),r=this.getBoundingRect(),a=this.style;if(i=c[0],d=c[1],r.contain(i,d)){var s=this.path.data;if(a.hasStroke()){var o=a.lineWidth,t=a.strokeNoScale?this.getLineScale():1;if(t>1e-10&&(a.hasFill()||(o=Math.max(o,this.strokeContainThreshold)),F.containStroke(s,o/t,i,d)))return!0}if(a.hasFill())return F.contain(s,i,d)}return!1},dirty:function(i){i==null&&(i=!0),i&&(this.__dirtyPath=i,this._rect=null),this.__dirty=this.__dirtyText=!0,this.__zr&&this.__zr.refresh(),this.__clipTarget&&this.__clipTarget.dirty()},animateShape:function(i){return this.animate("shape",i)},attrKV:function(i,d){i==="shape"?(this.setShape(d),this.__dirtyPath=!0,this._rect=null):Y.prototype.attrKV.call(this,i,d)},setShape:function(i,d){var c=this.shape;if(c){if(H.isObject(i))for(var r in i)i.hasOwnProperty(r)&&(c[r]=i[r]);else c[i]=d;this.dirty(!0)}return this},getLineScale:function(){var i=this.transform;return i&&D(i[0]-1)>1e-10&&D(i[3]-1)>1e-10?Math.sqrt(D(i[0]*i[3]-i[2]*i[1])):1}},T.extend=function(i){var d=function(r){T.call(this,r),i.style&&this.style.extendFrom(i.style,!1);var a=i.shape;if(a){this.shape=this.shape||{};var s=this.shape;for(var o in a)!s.hasOwnProperty(o)&&a.hasOwnProperty(o)&&(s[o]=a[o])}i.init&&i.init.call(this,r)};H.inherits(d,T);for(var c in i)c!=="style"&&c!=="shape"&&(d.prototype[c]=i[c]);return d},H.inherits(T,Y);var b=T;Ye.exports=b},"y0+3":function(Ye,re,I){"use strict";I.d(re,"a",function(){return i}),I.d(re,"b",function(){return c});var Y=/margin|padding|width|height|max|min|offset/,H={left:!0,top:!0},P={cssFloat:1,styleFloat:1,float:1};function F(r){return r.nodeType===1?r.ownerDocument.defaultView.getComputedStyle(r,null):{}}function R(r,a,s){if(a=a.toLowerCase(),s==="auto"){if(a==="height")return r.offsetHeight;if(a==="width")return r.offsetWidth}return a in H||(H[a]=Y.test(a)),H[a]?parseFloat(s)||0:s}function O(r,a){var s=arguments.length,o=F(r);return a=P[a]?"cssFloat"in r.style?"cssFloat":"styleFloat":a,s===1?o:R(r,a,o[a]||r.style[a])}function D(r,a,s){var o=arguments.length;if(a=P[a]?"cssFloat"in r.style?"cssFloat":"styleFloat":a,o===3)return typeof s=="number"&&Y.test(a)&&(s="".concat(s,"px")),r.style[a]=s,s;for(var t in a)a.hasOwnProperty(t)&&D(r,t,a[t]);return F(r)}function m(r){return r===document.body?document.documentElement.clientWidth:r.offsetWidth}function T(r){return r===document.body?window.innerHeight||document.documentElement.clientHeight:r.offsetHeight}function b(){var r=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:r,height:a}}function i(){var r=document.documentElement.clientWidth,a=window.innerHeight||document.documentElement.clientHeight;return{width:r,height:a}}function d(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function c(r){var a=r.getBoundingClientRect(),s=document.documentElement;return{left:a.left+(window.pageXOffset||s.scrollLeft)-(s.clientLeft||document.body.clientLeft||0),top:a.top+(window.pageYOffset||s.scrollTop)-(s.clientTop||document.body.clientTop||0)}}},y23F:function(Ye,re){function I(){this.on("mousedown",this._dragStart,this),this.on("mousemove",this._drag,this),this.on("mouseup",this._dragEnd,this)}I.prototype={constructor:I,_dragStart:function(P){for(var F=P.target;F&&!F.draggable;)F=F.parent;F&&(this._draggingTarget=F,F.dragging=!0,this._x=P.offsetX,this._y=P.offsetY,this.dispatchToElement(Y(F,P),"dragstart",P.event))},_drag:function(P){var F=this._draggingTarget;if(F){var R=P.offsetX,O=P.offsetY,D=R-this._x,m=O-this._y;this._x=R,this._y=O,F.drift(D,m,P),this.dispatchToElement(Y(F,P),"drag",P.event);var T=this.findHover(R,O,F).target,b=this._dropTarget;this._dropTarget=T,F!==T&&(b&&T!==b&&this.dispatchToElement(Y(b,P),"dragleave",P.event),T&&T!==b&&this.dispatchToElement(Y(T,P),"dragenter",P.event))}},_dragEnd:function(P){var F=this._draggingTarget;F&&(F.dragging=!1),this.dispatchToElement(Y(F,P),"dragend",P.event),this._dropTarget&&this.dispatchToElement(Y(this._dropTarget,P),"drop",P.event),this._draggingTarget=null,this._dropTarget=null}};function Y(P,F){return{target:P,topTarget:F&&F.topTarget}}var H=I;Ye.exports=H},yQHh:function(Ye,re,I){},"yTi+":function(Ye,re,I){Ye.exports=I.p+"static/AssistantCode3.fdd8db3c.jpeg"},yxFR:function(Ye,re,I){var Y=I("y+Vt"),H=I("nPnh"),P=H.subPixelOptimizeLine,F={},R=Y.extend({type:"line",shape:{x1:0,y1:0,x2:0,y2:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(O,D){var m,T,b,i;this.subPixelOptimize?(P(F,D,this.style),m=F.x1,T=F.y1,b=F.x2,i=F.y2):(m=D.x1,T=D.y1,b=D.x2,i=D.y2);var d=D.percent;if(d===0)return;O.moveTo(m,T),d<1&&(b=m*(1-d)+b*d,i=T*(1-d)+i*d),O.lineTo(b,i)},pointAt:function(O){var D=this.shape;return[D.x1*(1-O)+D.x2*O,D.y1*(1-O)+D.y2*O]}});Ye.exports=R},zarK:function(Ye,re,I){var Y=I("YH21"),H=Y.addEventListener,P=Y.removeEventListener,F=Y.normalizeEvent,R=Y.getNativeEvent,O=I("bYtY"),D=I("H6uX"),m=I("ItGF"),T=300,b=m.domSupported,i=function(){var v=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],N=["touchstart","touchend","touchmove"],j={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},U=O.map(v,function(G){var z=G.replace("mouse","pointer");return j.hasOwnProperty(z)?z:G});return{mouse:v,touch:N,pointer:U}}(),d={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]};function c(v){return v==="mousewheel"&&m.browser.firefox?"DOMMouseScroll":v}function r(v){var N=v.pointerType;return N==="pen"||N==="touch"}function a(v){v.touching=!0,v.touchTimer!=null&&(clearTimeout(v.touchTimer),v.touchTimer=null),v.touchTimer=setTimeout(function(){v.touching=!1,v.touchTimer=null},700)}function s(v){v&&(v.zrByTouch=!0)}function o(v,N){return F(v.dom,new h(v,N),!0)}function t(v,N){for(var j=N,U=!1;j&&j.nodeType!==9&&!(U=j.domBelongToZr||j!==N&&j===v.painterRoot);)j=j.parentNode;return U}function h(v,N){this.type=N.type,this.target=this.currentTarget=v.dom,this.pointerType=N.pointerType,this.clientX=N.clientX,this.clientY=N.clientY}var g=h.prototype;g.stopPropagation=g.stopImmediatePropagation=g.preventDefault=O.noop;var C={mousedown:function(v){v=F(this.dom,v),this._mayPointerCapture=[v.zrX,v.zrY],this.trigger("mousedown",v)},mousemove:function(v){v=F(this.dom,v);var N=this._mayPointerCapture;N&&(v.zrX!==N[0]||v.zrY!==N[1])&&l(this,!0),this.trigger("mousemove",v)},mouseup:function(v){v=F(this.dom,v),l(this,!1),this.trigger("mouseup",v)},mouseout:function(v){v=F(this.dom,v),this._pointerCapturing&&(v.zrEventControl="no_globalout");var N=v.toElement||v.relatedTarget;v.zrIsToLocalDOM=t(this,N),this.trigger("mouseout",v)},touchstart:function(v){v=F(this.dom,v),s(v),this._lastTouchMoment=new Date,this.handler.processGesture(v,"start"),C.mousemove.call(this,v),C.mousedown.call(this,v)},touchmove:function(v){v=F(this.dom,v),s(v),this.handler.processGesture(v,"change"),C.mousemove.call(this,v)},touchend:function(v){v=F(this.dom,v),s(v),this.handler.processGesture(v,"end"),C.mouseup.call(this,v),+new Date-this._lastTouchMoment<T&&C.click.call(this,v)},pointerdown:function(v){C.mousedown.call(this,v)},pointermove:function(v){r(v)||C.mousemove.call(this,v)},pointerup:function(v){C.mouseup.call(this,v)},pointerout:function(v){r(v)||C.mouseout.call(this,v)}};O.each(["click","mousewheel","dblclick","contextmenu"],function(v){C[v]=function(N){N=F(this.dom,N),this.trigger(v,N)}});var A={pointermove:function(v){r(v)||A.mousemove.call(this,v)},pointerup:function(v){A.mouseup.call(this,v)},mousemove:function(v){this.trigger("mousemove",v)},mouseup:function(v){var N=this._pointerCapturing;l(this,!1),this.trigger("mouseup",v),N&&(v.zrEventControl="only_globalout",this.trigger("mouseout",v))}};function w(v,N){var j=N.domHandlers;m.pointerEventsSupported?O.each(i.pointer,function(U){E(N,U,function(G){j[U].call(v,G)})}):(m.touchEventsSupported&&O.each(i.touch,function(U){E(N,U,function(G){j[U].call(v,G),a(N)})}),O.each(i.mouse,function(U){E(N,U,function(G){G=R(G),N.touching||j[U].call(v,G)})}))}function M(v,N){m.pointerEventsSupported?O.each(d.pointer,j):m.touchEventsSupported||O.each(d.mouse,j);function j(U){function G(z){z=R(z),t(v,z.target)||(z=o(v,z),N.domHandlers[U].call(v,z))}E(N,U,G,{capture:!0})}}function E(v,N,j,U){v.mounted[N]=j,v.listenerOpts[N]=U,H(v.domTarget,c(N),j,U)}function p(v){var N=v.mounted;for(var j in N)N.hasOwnProperty(j)&&P(v.domTarget,c(j),N[j],v.listenerOpts[j]);v.mounted={}}function l(v,N){if(v._mayPointerCapture=null,b&&v._pointerCapturing^N){v._pointerCapturing=N;var j=v._globalHandlerScope;N?M(v,j):p(j)}}function u(v,N){this.domTarget=v,this.domHandlers=N,this.mounted={},this.listenerOpts={},this.touchTimer=null,this.touching=!1}function f(v,N){D.call(this),this.dom=v,this.painterRoot=N,this._localHandlerScope=new u(v,C),b&&(this._globalHandlerScope=new u(document,A)),this._pointerCapturing=!1,this._mayPointerCapture=null,w(this,this._localHandlerScope)}var _=f.prototype;_.dispose=function(){p(this._localHandlerScope),b&&p(this._globalHandlerScope)},_.setCursor=function(v){this.dom.style&&(this.dom.style.cursor=v||"default")},O.mixin(f,D);var y=f;Ye.exports=y},zetH:function(Ye,re,I){Ye.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"}}}]);
|