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.
38 lines
297 KiB
38 lines
297 KiB
(self.webpackChunk=self.webpackChunk||[]).push([[7046],{65352:function(yn,ot,b){"use strict";b.d(ot,{Z:function(){return D}});var B=b(89490),q=b(11036),U=b(39224),be=b(43403),R=b(92310),te=b.n(R),ae=b(29301),Je=b(76846),ee=b(96452),h=b(6089),We=b(80402),x=b(34280),Pe=b(49658),T=b(59301),ht=b(71409),Mt=b(77900),lt=b(8654);function Lt(p){var C=p.prefixCls,m=p.align,w=p.arrow,I=p.arrowPos,A=w||{},H=A.className,oe=A.content,$=I.x,ce=$===void 0?0:$,ie=I.y,ne=ie===void 0?0:ie,pe=T.useRef();if(!m||!m.points)return null;var k={position:"absolute"};if(m.autoArrow!==!1){var de=m.points[0],K=m.points[1],Ue=de[0],ge=de[1],De=K[0],Le=K[1];Ue===De||!["t","b"].includes(Ue)?k.top=ne:Ue==="t"?k.top=0:k.bottom=0,ge===Le||!["l","r"].includes(ge)?k.left=ce:ge==="l"?k.left=0:k.right=0}return T.createElement("div",{ref:pe,className:te()("".concat(C,"-arrow"),H),style:k},oe)}function st(p){var C=p.prefixCls,m=p.open,w=p.zIndex,I=p.mask,A=p.motion;return I?T.createElement(Mt.default,(0,ht.Z)({},A,{motionAppear:!0,visible:m,removeOnLeave:!0}),function(H){var oe=H.className;return T.createElement("div",{style:{zIndex:w},className:te()("".concat(C,"-mask"),oe)})}):null}var he=T.memo(function(p){var C=p.children;return C},function(p,C){return C.cache}),W=he,pt=T.forwardRef(function(p,C){var m=p.popup,w=p.className,I=p.prefixCls,A=p.style,H=p.target,oe=p.onVisibleChanged,$=p.open,ce=p.keepDom,ie=p.fresh,ne=p.onClick,pe=p.mask,k=p.arrow,de=p.arrowPos,K=p.align,Ue=p.motion,ge=p.maskMotion,De=p.forceRender,Le=p.getPopupContainer,ct=p.autoDestroy,Xe=p.portal,Se=p.zIndex,$e=p.onMouseEnter,ur=p.onMouseLeave,Sr=p.onPointerEnter,er=p.onPointerDownCapture,Rr=p.ready,et=p.offsetX,nt=p.offsetY,It=p.offsetR,_t=p.offsetB,Ht=p.onAlign,Xt=p.onPrepare,wt=p.stretch,Jt=p.targetWidth,dt=p.targetHeight,Br=typeof m=="function"?m():m,Zt=$||ce,nr=(Le==null?void 0:Le.length)>0,Dt=T.useState(!Le||!nr),Fr=(0,q.Z)(Dt,2),un=Fr[0],Wr=Fr[1];if((0,x.Z)(function(){!un&&nr&&H&&Wr(!0)},[un,nr,H]),!un)return null;var Bt="auto",ir={left:"-1000vw",top:"-1000vh",right:Bt,bottom:Bt};if(Rr||!$){var fr,jt=K.points,kt=K.dynamicInset||((fr=K._experimental)===null||fr===void 0?void 0:fr.dynamicInset),Er=kt&&jt[0][1]==="r",Pt=kt&&jt[0][0]==="b";Er?(ir.right=It,ir.left=Bt):(ir.left=et,ir.right=Bt),Pt?(ir.bottom=_t,ir.top=Bt):(ir.top=nt,ir.bottom=Bt)}var Y={};return wt&&(wt.includes("height")&&dt?Y.height=dt:wt.includes("minHeight")&&dt&&(Y.minHeight=dt),wt.includes("width")&&Jt?Y.width=Jt:wt.includes("minWidth")&&Jt&&(Y.minWidth=Jt)),$||(Y.pointerEvents="none"),T.createElement(Xe,{open:De||Zt,getContainer:Le&&function(){return Le(H)},autoDestroy:ct},T.createElement(st,{prefixCls:I,open:$,zIndex:Se,mask:pe,motion:ge}),T.createElement(ae.Z,{onResize:Ht,disabled:!$},function(yt){return T.createElement(Mt.default,(0,ht.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:De,leavedClassName:"".concat(I,"-hidden")},Ue,{onAppearPrepare:Xt,onEnterPrepare:Xt,visible:$,onVisibleChanged:function(cr){var d;Ue==null||(d=Ue.onVisibleChanged)===null||d===void 0||d.call(Ue,cr),oe(cr)}}),function(Mr,cr){var d=Mr.className,v=Mr.style,F=te()(I,d,w);return T.createElement("div",{ref:(0,lt.sQ)(yt,C,cr),className:F,style:(0,B.Z)((0,B.Z)((0,B.Z)((0,B.Z)({"--arrow-x":"".concat(de.x||0,"px"),"--arrow-y":"".concat(de.y||0,"px")},ir),Y),v),{},{boxSizing:"border-box",zIndex:Se},A),onMouseEnter:$e,onMouseLeave:ur,onPointerEnter:Sr,onClick:ne,onPointerDownCapture:er},k&&T.createElement(Lt,{prefixCls:I,arrow:k,arrowPos:de,align:K}),T.createElement(W,{cache:!$&&!ie},Br))})}))}),ze=pt,re=T.forwardRef(function(p,C){var m=p.children,w=p.getTriggerDOMNode,I=(0,lt.Yr)(m),A=T.useCallback(function(oe){(0,lt.mH)(C,w?w(oe):oe)},[w]),H=(0,lt.x1)(A,(0,lt.C4)(m));return I?T.cloneElement(m,{ref:H}):m}),mt=re,Ge=T.createContext(null),Q=Ge;function at(p){return p?Array.isArray(p)?p:[p]:[]}function Rt(p,C,m,w){return T.useMemo(function(){var I=at(m!=null?m:C),A=at(w!=null?w:C),H=new Set(I),oe=new Set(A);return p&&(H.has("hover")&&(H.delete("hover"),H.add("click")),oe.has("hover")&&(oe.delete("hover"),oe.add("click"))),[H,oe]},[p,C,m,w])}var O=b(29194);function E(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],m=arguments.length>2?arguments[2]:void 0;return m?p[0]===C[0]:p[0]===C[0]&&p[1]===C[1]}function Z(p,C,m,w){for(var I=m.points,A=Object.keys(p),H=0;H<A.length;H+=1){var oe,$=A[H];if(E((oe=p[$])===null||oe===void 0?void 0:oe.points,I,w))return"".concat(C,"-placement-").concat($)}return""}function j(p,C,m,w){return C||(m?{motionName:"".concat(p,"-").concat(m)}:w?{motionName:w}:null)}function z(p){return p.ownerDocument.defaultView}function Ie(p){for(var C=[],m=p==null?void 0:p.parentElement,w=["hidden","scroll","clip","auto"];m;){var I=z(m).getComputedStyle(m),A=I.overflowX,H=I.overflowY,oe=I.overflow;[A,H,oe].some(function($){return w.includes($)})&&C.push(m),m=m.parentElement}return C}function M(p){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(p)?C:p}function ue(p){return M(parseFloat(p),0)}function Ne(p,C){var m=(0,B.Z)({},p);return(C||[]).forEach(function(w){if(!(w instanceof HTMLBodyElement||w instanceof HTMLHtmlElement)){var I=z(w).getComputedStyle(w),A=I.overflow,H=I.overflowClipMargin,oe=I.borderTopWidth,$=I.borderBottomWidth,ce=I.borderLeftWidth,ie=I.borderRightWidth,ne=w.getBoundingClientRect(),pe=w.offsetHeight,k=w.clientHeight,de=w.offsetWidth,K=w.clientWidth,Ue=ue(oe),ge=ue($),De=ue(ce),Le=ue(ie),ct=M(Math.round(ne.width/de*1e3)/1e3),Xe=M(Math.round(ne.height/pe*1e3)/1e3),Se=(de-K-De-Le)*ct,$e=(pe-k-Ue-ge)*Xe,ur=Ue*Xe,Sr=ge*Xe,er=De*ct,Rr=Le*ct,et=0,nt=0;if(A==="clip"){var It=ue(H);et=It*ct,nt=It*Xe}var _t=ne.x+er-et,Ht=ne.y+ur-nt,Xt=_t+ne.width+2*et-er-Rr-Se,wt=Ht+ne.height+2*nt-ur-Sr-$e;m.left=Math.max(m.left,_t),m.top=Math.max(m.top,Ht),m.right=Math.min(m.right,Xt),m.bottom=Math.min(m.bottom,wt)}}),m}function fe(p){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,m="".concat(C),w=m.match(/^(.*)\%$/);return w?p*(parseFloat(w[1])/100):parseFloat(m)}function _e(p,C){var m=C||[],w=(0,q.Z)(m,2),I=w[0],A=w[1];return[fe(p.width,I),fe(p.height,A)]}function Ve(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[p[0],p[1]]}function Ee(p,C){var m=C[0],w=C[1],I,A;return m==="t"?A=p.y:m==="b"?A=p.y+p.height:A=p.y+p.height/2,w==="l"?I=p.x:w==="r"?I=p.x+p.width:I=p.x+p.width/2,{x:I,y:A}}function Ke(p,C){var m={t:"b",b:"t",l:"r",r:"l"};return p.map(function(w,I){return I===C?m[w]||"c":w}).join("")}function Fe(p,C,m,w,I,A,H){var oe=T.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:I[w]||{}}),$=(0,q.Z)(oe,2),ce=$[0],ie=$[1],ne=T.useRef(0),pe=T.useMemo(function(){return C?Ie(C):[]},[C]),k=T.useRef({}),de=function(){k.current={}};p||de();var K=(0,h.Z)(function(){if(C&&m&&p){let Jr=function(Kn,Mn){var je=arguments.length>2&&arguments[2]!==void 0?arguments[2]:P,gt=Dt.x+Kn,it=Dt.y+Mn,vt=gt+Er,sr=it+kt,Pr=Math.max(gt,je.left),Ae=Math.max(it,je.top),Ye=Math.min(vt,je.right),zt=Math.min(sr,je.bottom);return Math.max(0,(Ye-Pr)*(zt-Ae))},Gr=function(){mr=Dt.y+St,jr=mr+kt,Kr=Dt.x+tt,Tr=Kr+Er};var De,Le,ct,Xe,Se=C,$e=Se.ownerDocument,ur=z(Se),Sr=ur.getComputedStyle(Se),er=Sr.width,Rr=Sr.height,et=Sr.position,nt=Se.style.left,It=Se.style.top,_t=Se.style.right,Ht=Se.style.bottom,Xt=Se.style.overflow,wt=(0,B.Z)((0,B.Z)({},I[w]),A),Jt=$e.createElement("div");(De=Se.parentElement)===null||De===void 0||De.appendChild(Jt),Jt.style.left="".concat(Se.offsetLeft,"px"),Jt.style.top="".concat(Se.offsetTop,"px"),Jt.style.position=et,Jt.style.height="".concat(Se.offsetHeight,"px"),Jt.style.width="".concat(Se.offsetWidth,"px"),Se.style.left="0",Se.style.top="0",Se.style.right="auto",Se.style.bottom="auto",Se.style.overflow="hidden";var dt;if(Array.isArray(m))dt={x:m[0],y:m[1],width:0,height:0};else{var Br,Zt,nr=m.getBoundingClientRect();nr.x=(Br=nr.x)!==null&&Br!==void 0?Br:nr.left,nr.y=(Zt=nr.y)!==null&&Zt!==void 0?Zt:nr.top,dt={x:nr.x,y:nr.y,width:nr.width,height:nr.height}}var Dt=Se.getBoundingClientRect();Dt.x=(Le=Dt.x)!==null&&Le!==void 0?Le:Dt.left,Dt.y=(ct=Dt.y)!==null&&ct!==void 0?ct:Dt.top;var Fr=$e.documentElement,un=Fr.clientWidth,Wr=Fr.clientHeight,Bt=Fr.scrollWidth,ir=Fr.scrollHeight,fr=Fr.scrollTop,jt=Fr.scrollLeft,kt=Dt.height,Er=Dt.width,Pt=dt.height,Y=dt.width,yt={left:0,top:0,right:un,bottom:Wr},Mr={left:-jt,top:-fr,right:Bt-jt,bottom:ir-fr},cr=wt.htmlRegion,d="visible",v="visibleFirst";cr!=="scroll"&&cr!==v&&(cr=d);var F=cr===v,N=Ne(Mr,pe),g=Ne(yt,pe),P=cr===d?g:N,le=F?g:P;Se.style.left="auto",Se.style.top="auto",Se.style.right="0",Se.style.bottom="0";var ve=Se.getBoundingClientRect();Se.style.left=nt,Se.style.top=It,Se.style.right=_t,Se.style.bottom=Ht,Se.style.overflow=Xt,(Xe=Se.parentElement)===null||Xe===void 0||Xe.removeChild(Jt);var Re=M(Math.round(Er/parseFloat(er)*1e3)/1e3),Ce=M(Math.round(kt/parseFloat(Rr)*1e3)/1e3);if(Re===0||Ce===0||(0,Je.Sh)(m)&&!(0,O.Z)(m))return;var He=wt.offset,J=wt.targetOffset,Me=_e(Dt,He),X=(0,q.Z)(Me,2),Te=X[0],ye=X[1],Qe=_e(dt,J),Et=(0,q.Z)(Qe,2),Ft=Et[0],Qt=Et[1];dt.x-=Ft,dt.y-=Qt;var Wt=wt.points||[],hr=(0,q.Z)(Wt,2),xt=hr[0],Cr=hr[1],wr=Ve(Cr),Nt=Ve(xt),gr=Ee(dt,wr),Kt=Ee(Dt,Nt),ar=(0,B.Z)({},wt),tt=gr.x-Kt.x+Te,St=gr.y-Kt.y+ye,Ut=Jr(tt,St),or=Jr(tt,St,g),Lr=Ee(dt,["t","l"]),lr=Ee(Dt,["t","l"]),xr=Ee(dt,["b","r"]),Yt=Ee(Dt,["b","r"]),Tt=wt.overflow||{},Or=Tt.adjustX,Xr=Tt.adjustY,Vr=Tt.shiftX,pr=Tt.shiftY,tn=function(Mn){return typeof Mn=="boolean"?Mn:Mn>=0},mr,jr,Kr,Tr;Gr();var ut=tn(Xr),G=Nt[0]===wr[0];if(ut&&Nt[0]==="t"&&(jr>le.bottom||k.current.bt)){var V=St;G?V-=kt-Pt:V=Lr.y-Yt.y-ye;var Ze=Jr(tt,V),me=Jr(tt,V,g);Ze>Ut||Ze===Ut&&(!F||me>=or)?(k.current.bt=!0,St=V,ye=-ye,ar.points=[Ke(Nt,0),Ke(wr,0)]):k.current.bt=!1}if(ut&&Nt[0]==="b"&&(mr<le.top||k.current.tb)){var qe=St;G?qe+=kt-Pt:qe=xr.y-lr.y-ye;var $t=Jr(tt,qe),tr=Jr(tt,qe,g);$t>Ut||$t===Ut&&(!F||tr>=or)?(k.current.tb=!0,St=qe,ye=-ye,ar.points=[Ke(Nt,0),Ke(wr,0)]):k.current.tb=!1}var qt=tn(Or),Dr=Nt[1]===wr[1];if(qt&&Nt[1]==="l"&&(Tr>le.right||k.current.rl)){var Ur=tt;Dr?Ur-=Er-Y:Ur=Lr.x-Yt.x-Te;var Ar=Jr(Ur,St),on=Jr(Ur,St,g);Ar>Ut||Ar===Ut&&(!F||on>=or)?(k.current.rl=!0,tt=Ur,Te=-Te,ar.points=[Ke(Nt,1),Ke(wr,1)]):k.current.rl=!1}if(qt&&Nt[1]==="r"&&(Kr<le.left||k.current.lr)){var yr=tt;Dr?yr+=Er-Y:yr=xr.x-lr.x-Te;var bn=Jr(yr,St),zn=Jr(yr,St,g);bn>Ut||bn===Ut&&(!F||zn>=or)?(k.current.lr=!0,tt=yr,Te=-Te,ar.points=[Ke(Nt,1),Ke(wr,1)]):k.current.lr=!1}Gr();var Yr=Vr===!0?0:Vr;typeof Yr=="number"&&(Kr<g.left&&(tt-=Kr-g.left-Te,dt.x+Y<g.left+Yr&&(tt+=dt.x-g.left+Y-Yr)),Tr>g.right&&(tt-=Tr-g.right-Te,dt.x>g.right-Yr&&(tt+=dt.x-g.right+Yr)));var kr=pr===!0?0:pr;typeof kr=="number"&&(mr<g.top&&(St-=mr-g.top-ye,dt.y+Pt<g.top+kr&&(St+=dt.y-g.top+Pt-kr)),jr>g.bottom&&(St-=jr-g.bottom-ye,dt.y>g.bottom-kr&&(St+=dt.y-g.bottom+kr)));var rn=Dt.x+tt,zr=rn+Er,$r=Dt.y+St,jn=$r+kt,Nn=dt.x,xn=Nn+Y,fn=dt.y,$n=fn+Pt,En=Math.max(rn,Nn),ri=Math.min(zr,xn),qr=(En+ri)/2,Hn=qr-rn,ui=Math.max($r,fn),ni=Math.min(jn,$n),di=(ui+ni)/2,Bn=di-$r;H==null||H(C,ar);var Zr=ve.right-Dt.x-(tt+Dt.width),cn=ve.bottom-Dt.y-(St+Dt.height);Re===1&&(tt=Math.round(tt),Zr=Math.round(Zr)),Ce===1&&(St=Math.round(St),cn=Math.round(cn));var qn={ready:!0,offsetX:tt/Re,offsetY:St/Ce,offsetR:Zr/Re,offsetB:cn/Ce,arrowX:Hn/Re,arrowY:Bn/Ce,scaleX:Re,scaleY:Ce,align:ar};ie(qn)}}),Ue=function(){ne.current+=1;var Le=ne.current;Promise.resolve().then(function(){ne.current===Le&&K()})},ge=function(){ie(function(Le){return(0,B.Z)((0,B.Z)({},Le),{},{ready:!1})})};return(0,x.Z)(ge,[w]),(0,x.Z)(function(){p||ge()},[p]),[ce.ready,ce.offsetX,ce.offsetY,ce.offsetR,ce.offsetB,ce.arrowX,ce.arrowY,ce.scaleX,ce.scaleY,ce.align,Ue]}var Ot=b(62730);function Ct(p,C,m,w,I){(0,x.Z)(function(){if(p&&C&&m){let ne=function(){w(),I()};var A=C,H=m,oe=Ie(A),$=Ie(H),ce=z(H),ie=new Set([ce].concat((0,Ot.Z)(oe),(0,Ot.Z)($)));return ie.forEach(function(pe){pe.addEventListener("scroll",ne,{passive:!0})}),ce.addEventListener("resize",ne,{passive:!0}),w(),function(){ie.forEach(function(pe){pe.removeEventListener("scroll",ne),ce.removeEventListener("resize",ne)})}}},[p,C,m])}var bt=b(48736);function Oe(p,C,m,w,I,A,H,oe){var $=T.useRef(p);$.current=p;var ce=T.useRef(!1);T.useEffect(function(){if(C&&w&&(!I||A)){var ne=function(){ce.current=!1},pe=function(ct){var Xe;$.current&&!H(((Xe=ct.composedPath)===null||Xe===void 0||(Xe=Xe.call(ct))===null||Xe===void 0?void 0:Xe[0])||ct.target)&&!ce.current&&oe(!1)},k=z(w);k.addEventListener("pointerdown",ne,!0),k.addEventListener("mousedown",pe,!0),k.addEventListener("contextmenu",pe,!0);var de=(0,ee.A)(m);if(de&&(de.addEventListener("mousedown",pe,!0),de.addEventListener("contextmenu",pe,!0)),0)var K,Ue,ge,De;return function(){k.removeEventListener("pointerdown",ne,!0),k.removeEventListener("mousedown",pe,!0),k.removeEventListener("contextmenu",pe,!0),de&&(de.removeEventListener("mousedown",pe,!0),de.removeEventListener("contextmenu",pe,!0))}}},[C,m,w,I,A]);function ie(){ce.current=!0}return ie}var vr=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function rr(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:be.Z,C=T.forwardRef(function(m,w){var I=m.prefixCls,A=I===void 0?"rc-trigger-popup":I,H=m.children,oe=m.action,$=oe===void 0?"hover":oe,ce=m.showAction,ie=m.hideAction,ne=m.popupVisible,pe=m.defaultPopupVisible,k=m.onPopupVisibleChange,de=m.afterPopupVisibleChange,K=m.mouseEnterDelay,Ue=m.mouseLeaveDelay,ge=Ue===void 0?.1:Ue,De=m.focusDelay,Le=m.blurDelay,ct=m.mask,Xe=m.maskClosable,Se=Xe===void 0?!0:Xe,$e=m.getPopupContainer,ur=m.forceRender,Sr=m.autoDestroy,er=m.destroyPopupOnHide,Rr=m.popup,et=m.popupClassName,nt=m.popupStyle,It=m.popupPlacement,_t=m.builtinPlacements,Ht=_t===void 0?{}:_t,Xt=m.popupAlign,wt=m.zIndex,Jt=m.stretch,dt=m.getPopupClassNameFromAlign,Br=m.fresh,Zt=m.alignPoint,nr=m.onPopupClick,Dt=m.onPopupAlign,Fr=m.arrow,un=m.popupMotion,Wr=m.maskMotion,Bt=m.popupTransitionName,ir=m.popupAnimation,fr=m.maskTransitionName,jt=m.maskAnimation,kt=m.className,Er=m.getTriggerDOMNode,Pt=(0,U.Z)(m,vr),Y=Sr||er||!1,yt=T.useState(!1),Mr=(0,q.Z)(yt,2),cr=Mr[0],d=Mr[1];(0,x.Z)(function(){d((0,Pe.Z)())},[]);var v=T.useRef({}),F=T.useContext(Q),N=T.useMemo(function(){return{registerSubPopup:function(Ye,zt){v.current[Ye]=zt,F==null||F.registerSubPopup(Ye,zt)}}},[F]),g=(0,We.Z)(),P=T.useState(null),le=(0,q.Z)(P,2),ve=le[0],Re=le[1],Ce=T.useRef(null),He=(0,h.Z)(function(Ae){Ce.current=Ae,(0,Je.Sh)(Ae)&&ve!==Ae&&Re(Ae),F==null||F.registerSubPopup(g,Ae)}),J=T.useState(null),Me=(0,q.Z)(J,2),X=Me[0],Te=Me[1],ye=T.useRef(null),Qe=(0,h.Z)(function(Ae){(0,Je.Sh)(Ae)&&X!==Ae&&(Te(Ae),ye.current=Ae)}),Et=T.Children.only(H),Ft=(Et==null?void 0:Et.props)||{},Qt={},Wt=(0,h.Z)(function(Ae){var Ye,zt,Gt=X;return(Gt==null?void 0:Gt.contains(Ae))||((Ye=(0,ee.A)(Gt))===null||Ye===void 0?void 0:Ye.host)===Ae||Ae===Gt||(ve==null?void 0:ve.contains(Ae))||((zt=(0,ee.A)(ve))===null||zt===void 0?void 0:zt.host)===Ae||Ae===ve||Object.values(v.current).some(function(br){return(br==null?void 0:br.contains(Ae))||Ae===br})}),hr=j(A,un,ir,Bt),xt=j(A,Wr,jt,fr),Cr=T.useState(pe||!1),wr=(0,q.Z)(Cr,2),Nt=wr[0],gr=wr[1],Kt=ne!=null?ne:Nt,ar=(0,h.Z)(function(Ae){ne===void 0&&gr(Ae)});(0,x.Z)(function(){gr(ne||!1)},[ne]);var tt=T.useRef(Kt);tt.current=Kt;var St=T.useRef([]);St.current=[];var Ut=(0,h.Z)(function(Ae){var Ye;ar(Ae),((Ye=St.current[St.current.length-1])!==null&&Ye!==void 0?Ye:Kt)!==Ae&&(St.current.push(Ae),k==null||k(Ae))}),or=T.useRef(),Lr=function(){clearTimeout(or.current)},lr=function(Ye){var zt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;Lr(),zt===0?Ut(Ye):or.current=setTimeout(function(){Ut(Ye)},zt*1e3)};T.useEffect(function(){return Lr},[]);var xr=T.useState(!1),Yt=(0,q.Z)(xr,2),Tt=Yt[0],Or=Yt[1];(0,x.Z)(function(Ae){(!Ae||Kt)&&Or(!0)},[Kt]);var Xr=T.useState(null),Vr=(0,q.Z)(Xr,2),pr=Vr[0],tn=Vr[1],mr=T.useState(null),jr=(0,q.Z)(mr,2),Kr=jr[0],Tr=jr[1],ut=function(Ye){Tr([Ye.clientX,Ye.clientY])},G=Fe(Kt,ve,Zt&&Kr!==null?Kr:X,It,Ht,Xt,Dt),V=(0,q.Z)(G,11),Ze=V[0],me=V[1],qe=V[2],$t=V[3],tr=V[4],qt=V[5],Dr=V[6],Ur=V[7],Ar=V[8],on=V[9],yr=V[10],bn=Rt(cr,$,ce,ie),zn=(0,q.Z)(bn,2),Yr=zn[0],kr=zn[1],rn=Yr.has("click"),zr=kr.has("click")||kr.has("contextMenu"),$r=(0,h.Z)(function(){Tt||yr()}),jn=function(){tt.current&&Zt&&zr&&lr(!1)};Ct(Kt,X,ve,$r,jn),(0,x.Z)(function(){$r()},[Kr,It]),(0,x.Z)(function(){Kt&&!(Ht!=null&&Ht[It])&&$r()},[JSON.stringify(Xt)]);var Nn=T.useMemo(function(){var Ae=Z(Ht,A,on,Zt);return te()(Ae,dt==null?void 0:dt(on))},[on,dt,Ht,A,Zt]);T.useImperativeHandle(w,function(){return{nativeElement:ye.current,popupElement:Ce.current,forceAlign:$r}});var xn=T.useState(0),fn=(0,q.Z)(xn,2),$n=fn[0],En=fn[1],ri=T.useState(0),qr=(0,q.Z)(ri,2),Hn=qr[0],ui=qr[1],ni=function(){if(Jt&&X){var Ye=X.getBoundingClientRect();En(Ye.width),ui(Ye.height)}},di=function(){ni(),$r()},Bn=function(Ye){Or(!1),yr(),de==null||de(Ye)},Zr=function(){return new Promise(function(Ye){ni(),tn(function(){return Ye})})};(0,x.Z)(function(){pr&&(yr(),pr(),tn(null))},[pr]);function cn(Ae,Ye,zt,Gt){Qt[Ae]=function(br){var On;Gt==null||Gt(br),lr(Ye,zt);for(var Sn=arguments.length,Yn=new Array(Sn>1?Sn-1:0),Un=1;Un<Sn;Un++)Yn[Un-1]=arguments[Un];(On=Ft[Ae])===null||On===void 0||On.call.apply(On,[Ft,br].concat(Yn))}}(rn||zr)&&(Qt.onClick=function(Ae){var Ye;tt.current&&zr?lr(!1):!tt.current&&rn&&(ut(Ae),lr(!0));for(var zt=arguments.length,Gt=new Array(zt>1?zt-1:0),br=1;br<zt;br++)Gt[br-1]=arguments[br];(Ye=Ft.onClick)===null||Ye===void 0||Ye.call.apply(Ye,[Ft,Ae].concat(Gt))});var qn=Oe(Kt,zr,X,ve,ct,Se,Wt,lr),Jr=Yr.has("hover"),Gr=kr.has("hover"),Kn,Mn;Jr&&(cn("onMouseEnter",!0,K,function(Ae){ut(Ae)}),cn("onPointerEnter",!0,K,function(Ae){ut(Ae)}),Kn=function(Ye){(Kt||Tt)&&ve!==null&&ve!==void 0&&ve.contains(Ye.target)&&lr(!0,K)},Zt&&(Qt.onMouseMove=function(Ae){var Ye;(Ye=Ft.onMouseMove)===null||Ye===void 0||Ye.call(Ft,Ae)})),Gr&&(cn("onMouseLeave",!1,ge),cn("onPointerLeave",!1,ge),Mn=function(){lr(!1,ge)}),Yr.has("focus")&&cn("onFocus",!0,De),kr.has("focus")&&cn("onBlur",!1,Le),Yr.has("contextMenu")&&(Qt.onContextMenu=function(Ae){var Ye;tt.current&&kr.has("contextMenu")?lr(!1):(ut(Ae),lr(!0)),Ae.preventDefault();for(var zt=arguments.length,Gt=new Array(zt>1?zt-1:0),br=1;br<zt;br++)Gt[br-1]=arguments[br];(Ye=Ft.onContextMenu)===null||Ye===void 0||Ye.call.apply(Ye,[Ft,Ae].concat(Gt))}),kt&&(Qt.className=te()(Ft.className,kt));var je=(0,B.Z)((0,B.Z)({},Ft),Qt),gt={},it=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];it.forEach(function(Ae){Pt[Ae]&&(gt[Ae]=function(){for(var Ye,zt=arguments.length,Gt=new Array(zt),br=0;br<zt;br++)Gt[br]=arguments[br];(Ye=je[Ae])===null||Ye===void 0||Ye.call.apply(Ye,[je].concat(Gt)),Pt[Ae].apply(Pt,Gt)})});var vt=T.cloneElement(Et,(0,B.Z)((0,B.Z)({},je),gt)),sr={x:qt,y:Dr},Pr=Fr?(0,B.Z)({},Fr!==!0?Fr:{}):null;return T.createElement(T.Fragment,null,T.createElement(ae.Z,{disabled:!Kt,ref:Qe,onResize:di},T.createElement(mt,{getTriggerDOMNode:Er},vt)),T.createElement(Q.Provider,{value:N},T.createElement(ze,{portal:p,ref:He,prefixCls:A,popup:Rr,className:te()(et,Nn),style:nt,target:X,onMouseEnter:Kn,onMouseLeave:Mn,onPointerEnter:Kn,zIndex:wt,open:Kt,keepDom:Tt,fresh:Br,onClick:nr,onPointerDownCapture:qn,mask:ct,motion:hr,maskMotion:xt,onVisibleChanged:Bn,onPrepare:Zr,forceRender:ur,autoDestroy:Y,getPopupContainer:$e,align:on,arrow:Pr,arrowPos:sr,ready:Ze,offsetX:me,offsetY:qe,offsetR:$t,offsetB:tr,onAlign:$r,stretch:Jt,targetWidth:$n/Ur,targetHeight:Hn/Ar})))});return C}var D=rr(be.Z)},8336:function(){"use strict"},12469:function(){"use strict"},81705:function(yn,ot,b){"use strict";b.d(ot,{t:function(){return x}});var B=b(59301),q=b(99571),U={buttonFixed:"buttonFixed___vyq30",button:"button___hxmYv",buttonWrap:"buttonWrap___uK8dl"},be=b(92310),R=b.n(be),te=Object.defineProperty,ae=Object.getOwnPropertySymbols,Je=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable,h=(Pe,T,ht)=>T in Pe?te(Pe,T,{enumerable:!0,configurable:!0,writable:!0,value:ht}):Pe[T]=ht,We=(Pe,T)=>{for(var ht in T||(T={}))Je.call(T,ht)&&h(Pe,ht,T[ht]);if(ae)for(var ht of ae(T))ee.call(T,ht)&&h(Pe,ht,T[ht]);return Pe};const x=({cancelText:Pe="\u53D6\u6D88",okText:T="\u786E\u5B9A",loading:ht=!1,hasOkBtn:Mt=!0,hasCancelBtn:lt=!0,okButtonProps:Lt={},onCancel:st=()=>{},onOk:he=()=>{},className:W=""})=>B.createElement("div",{className:R()(U.buttonFixed,W)},B.createElement("div",{className:U.buttonWrap},lt&&B.createElement(q.ZP,{size:"middle",className:`${U.button} mr20`,onClick:st},Pe),Mt&&B.createElement(q.ZP,We({size:"middle",type:"primary",className:`${U.button} mr20`,loading:ht,onClick:he},Lt),T)))},69720:function(yn,ot,b){"use strict";b.d(ot,{h:function(){return W}});var B=b(59301),q=b(82326),U=b(28284),be=b(99571),R=b(89780),te=b.n(R),ae=b(8336),Je=b(12469),ee=Object.defineProperty,h=Object.defineProperties,We=Object.getOwnPropertyDescriptors,x=Object.getOwnPropertySymbols,Pe=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable,ht=(pt,ze,re)=>ze in pt?ee(pt,ze,{enumerable:!0,configurable:!0,writable:!0,value:re}):pt[ze]=re,Mt=(pt,ze)=>{for(var re in ze||(ze={}))Pe.call(ze,re)&&ht(pt,re,ze[re]);if(x)for(var re of x(ze))T.call(ze,re)&&ht(pt,re,ze[re]);return pt},lt=(pt,ze)=>h(pt,We(ze));const Lt=q.default.Option,st={labelCol:{span:4},wrapperCol:{span:20}},he={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"]};ot.Z=({callback:pt,onCancel:ze})=>{const[re,mt]=(0,B.useState)("python");function Ge(at){mt(he[at][1])}function Q(at){pt(at)}return B.createElement(U.default,lt(Mt({},st),{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:Q,style:{width:500}}),B.createElement(U.default.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},B.createElement(q.default,{getPopupContainer:at=>at.parentNode,onChange:Ge},Object.keys(he).map(at=>B.createElement(Lt,{key:at,value:at},he[at][0])))),B.createElement(U.default.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},B.createElement(W,{mode:re})),B.createElement("div",{className:"flex-container flex-end"},B.createElement(be.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),B.createElement(be.ZP,{type:"ghost",onClick:ze},"\u53D6\u6D88")))};function W({value:pt,onChange:ze,mode:re,options:mt={}}){const Ge=(0,B.useRef)(),[Q,at]=(0,B.useState)();return(0,B.useEffect)(()=>{if(Q){let Rt=function(O){const E=O.getValue();ze&&ze(E)};return Q.on("change",Rt),()=>{Q.off("change",Rt)}}},[Q,ze]),(0,B.useEffect)(()=>{Q&&Q.setOption("mode",re)},[Q,re]),(0,B.useEffect)(()=>{Q&&(pt!==Q.getValue()||pt==="")&&setTimeout(()=>{Q.setValue(pt||"")},300)},[Q,pt]),(0,B.useEffect)(()=>{if(Ge.current&&!Q){const Rt=te().fromTextArea(Ge.current,Mt({mode:re,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},mt));at(Rt)}},[Ge.current,Q]),B.createElement("div",{className:"my-codemirror-container"},B.createElement("textarea",{ref:Ge}))}},83283:function(yn,ot,b){"use strict";b.r(ot),b.d(ot,{default:function(){return lt}});var B=b(59301),q=b(25690),U=b(28284),be=b(37568),R=b(69720),te=b(81705),ae={bg:"bg___YV4bB",wrap:"wrap___kzW1f",title:"title___qum64",path:"path___G15kO",colorBlue:"colorBlue___LDjoN",width240:"width240___QOLSj"},Je=Object.defineProperty,ee=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable,x=(Lt,st,he)=>st in Lt?Je(Lt,st,{enumerable:!0,configurable:!0,writable:!0,value:he}):Lt[st]=he,Pe=(Lt,st)=>{for(var he in st||(st={}))h.call(st,he)&&x(Lt,he,st[he]);if(ee)for(var he of ee(st))We.call(st,he)&&x(Lt,he,st[he]);return Lt},T=(Lt,st)=>{var he={};for(var W in Lt)h.call(Lt,W)&&st.indexOf(W)<0&&(he[W]=Lt[W]);if(Lt!=null&&ee)for(var W of ee(Lt))st.indexOf(W)<0&&We.call(Lt,W)&&(he[W]=Lt[W]);return he},ht=(Lt,st,he)=>new Promise((W,pt)=>{var ze=Ge=>{try{mt(he.next(Ge))}catch(Q){pt(Q)}},re=Ge=>{try{mt(he.throw(Ge))}catch(Q){pt(Q)}},mt=Ge=>Ge.done?W(Ge.value):Promise.resolve(Ge.value).then(ze,re);mt((he=he.apply(Lt,st)).next())});const Mt=Lt=>{var st=Lt,{shixunsDetail:he,globalSetting:W,loading:pt,user:ze,dispatch:re}=st,mt=T(st,["shixunsDetail","globalSetting","loading","user","dispatch"]);const Ge=(0,q.useLocation)(),[Q,at]=(0,B.useState)({}),Rt=(0,B.useRef)(),O=(0,B.useRef)(),[E]=U.default.useForm(),[Z,j]=(0,B.useState)("");(0,B.useEffect)(()=>(re({type:"globalSetting/footerToggle",payload:!1}),()=>{re({type:"globalSetting/footerToggle",payload:!0})}),[]),(0,B.useEffect)(()=>{const M=sessionStorage.getItem("pathArray");if(M){const ue=M.split(",").join("/"),Ne=ue.indexOf("/")===0?ue.substr(1):ue;j(Ne)}},[]),(0,B.useEffect)(()=>{var M,ue,Ne,fe;O.current=(ue=(M=Ge.pathname)==null?void 0:M.split("/"))==null?void 0:ue[2],Rt.current=((fe=(Ne=Ge.pathname)==null?void 0:Ne.split("/"))==null?void 0:fe[3])==="repository"},[]);const z=(...M)=>ht(void 0,[...M],function*(ue={}){if(yield re({type:"shixunsDetail/addRepositoryFile",payload:{id:O.current,message:ue.commitMessage,content:ue.codeMirror,path:`${Z?`${Z}/`:""}${ue.path||""}`,secret_repository:Rt.current?void 0:!0}})){const fe=Rt.current?`/shixuns/${O.current}/repository${Z?`/master/shixun_show/${Z}`:""}`:`/shixuns/${O.current}/secret_repository`;q.history.replace(fe)}}),Ie=()=>{var M,ue;q.history.push(`/shixuns/${O.current}/${(ue=(M=Ge.pathname)==null?void 0:M.split("/"))==null?void 0:ue[3]}${Z?`/master/shixun_show/${Z}`:""}`)};return B.createElement("section",{className:ae.bg},B.createElement("div",{className:ae.wrap},B.createElement("div",{className:ae.title},"\u65B0\u5EFA\u6587\u4EF6"),B.createElement(U.default,{className:"mt10",form:E,scrollToFirstError:!0,layout:"vertical",onFinish:z,onValuesChange:()=>at(Pe({},E.getFieldsValue()))},B.createElement(U.default.Item,{label:"\u6587\u4EF6\u540D\u79F0\u6216\u6587\u4EF6\u8DEF\u5F84\uFF1A"},B.createElement(U.default.Item,{name:"path",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u540D\u79F0\u6216\u6587\u4EF6\u8DEF\u5F84"},{whitespace:!0,message:"\u8BF7\u52FF\u8F93\u5165\u7A7A\u683C"}],noStyle:!0},B.createElement("span",null,B.createElement("span",{className:"mr5"},Z?`${Z}/`:""),B.createElement(be.default,{className:ae.width240,placeholder:"\u8BF7\u8F93\u5165\u6587\u4EF6\u540D\u79F0\u6216\u6587\u4EF6\u8DEF\u5F84"}))),B.createElement("span",{className:"ml5"},"\u63D0\u793A\uFF1A1.\u8F93\u5165\u6587\u4EF6\u540D\u53EF\u4EE5\u521B\u5EFA\u4E00\u4E2A\u65B0\u6587\u4EF6\uFF1B2.\u8F93\u5165\u65B0\u6587\u4EF6\u5939\u540D/\u65B0\u6587\u4EF6\u540D\u53EF\u4EE5\u521B\u5EFA\u65B0\u6587\u4EF6\u5939\u548C\u65B0\u6587\u4EF6\u3002\uFF08\u5982\uFF1Astep1/HelloWorld.java\uFF09")),B.createElement(U.default.Item,{label:"\u63D0\u4EA4\u4FE1\u606F\uFF1A",name:"commitMessage",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u63D0\u4EA4\u4FE1\u606F"},{whitespace:!0,message:"\u8BF7\u52FF\u8F93\u5165\u7A7A\u683C"}]},B.createElement(be.default,{placeholder:"\u8BF7\u8F93\u5165\u672C\u6B21\u63D0\u4EA4\u7684\u4E3B\u8981\u4FE1\u606F\uFF0C\u5408\u7406\u7684\u63CF\u8FF0\u4FE1\u606F\u6709\u5229\u4E8E\u4EE3\u7801\u5386\u53F2\u8BB0\u5F55\u7684\u7BA1\u7406"})),B.createElement("div",{className:"mt10 mb20"},B.createElement(U.default.Item,{name:"codeMirror",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5185\u5BB9"}]},B.createElement(R.h,{options:{modal:"javascript",lineNumbers:!0,theme:"railscasts",indentUnit:4,matchBrackets:!0,autoRefresh:!0,smartIndent:!0,extraKeys:{"Alt-/":"autocomplete"},autofocus:!0,styleActiveLine:!0,lint:!0,linkurl:"",gutters:["CodeMirror-linenumbers","breakpoints","CodeMirror-lint-markers"]}}))),B.createElement(U.default.Item,{noStyle:!0},B.createElement(te.t,{okButtonProps:{htmlType:"submit"},onCancel:Ie})))))};var lt=(0,q.connect)(({shixunsDetail:Lt,loading:st,globalSetting:he,user:W})=>({shixunsDetail:Lt,globalSetting:he,user:W,loading:st.models.index}))(Mt)},89780:function(yn){(function(ot,b){yn.exports=b()})(this,function(){"use strict";var ot=navigator.userAgent,b=navigator.platform,B=/gecko\/\d/i.test(ot),q=/MSIE \d/.test(ot),U=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ot),be=/Edge\/(\d+)/.exec(ot),R=q||U||be,te=R&&(q?document.documentMode||6:+(be||U)[1]),ae=!be&&/WebKit\//.test(ot),Je=ae&&/Qt\/\d+\.\d+/.test(ot),ee=!be&&/Chrome\//.test(ot),h=/Opera\//.test(ot),We=/Apple Computer/.test(navigator.vendor),x=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ot),Pe=/PhantomJS/.test(ot),T=!be&&/AppleWebKit/.test(ot)&&/Mobile\/\w+/.test(ot),ht=/Android/.test(ot),Mt=T||ht||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ot),lt=T||/Mac/.test(b),Lt=/\bCrOS\b/.test(ot),st=/win/i.test(b),he=h&&ot.match(/Version\/(\d*\.\d*)/);he&&(he=Number(he[1])),he&&he>=15&&(h=!1,ae=!0);var W=lt&&(Je||h&&(he==null||he<12.11)),pt=B||R&&te>=9;function ze(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var re=function(e,t){var n=e.className,r=ze(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function mt(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function Ge(e,t){return mt(e).appendChild(t)}function Q(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var a=0;a<t.length;++a)i.appendChild(t[a]);return i}function at(e,t,n,r){var i=Q(e,t,n,r);return i.setAttribute("role","presentation"),i}var Rt;document.createRange?Rt=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:Rt=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function O(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function E(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function Z(e,t){var n=e.className;ze(t).test(n)||(e.className+=(n?" ":"")+t)}function j(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!ze(n[r]).test(t)&&(t+=" "+n[r]);return t}var z=function(e){e.select()};T?z=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:R&&(z=function(e){try{e.select()}catch(t){}});function Ie(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function M(e,t,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function ue(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var a=r||0,o=i||0;;){var l=e.indexOf(" ",a);if(l<0||l>=t)return o+(t-a);o+=l-a,o+=n-o%n,a=l+1}}var Ne=function(){this.id=null,this.f=null,this.time=0,this.handler=Ie(this.onTimeout,this)};Ne.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Ne.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function fe(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var _e=50,Ve={toString:function(){return"CodeMirror.Pass"}},Ee={scroll:!1},Ke={origin:"*mouse"},Fe={origin:"+move"};function Ot(e,t,n){for(var r=0,i=0;;){var a=e.indexOf(" ",r);a==-1&&(a=e.length);var o=a-r;if(a==e.length||i+o>=t)return r+Math.min(o,t-i);if(i+=a-r,i+=n-i%n,r=a+1,i>=t)return r}}var Ct=[""];function bt(e){for(;Ct.length<=e;)Ct.push(Oe(Ct)+" ");return Ct[e]}function Oe(e){return e[e.length-1]}function vr(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function rr(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function D(){}function p(e,t){var n;return Object.create?n=Object.create(e):(D.prototype=e,n=new D),t&&M(t,n),n}var C=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function m(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||C.test(e))}function w(e,t){return t?t.source.indexOf("\\w")>-1&&m(e)?!0:t.test(e):m(e)}function I(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var A=/[\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 H(e){return e.charCodeAt(0)>=768&&A.test(e)}function oe(e,t,n){for(;(n<0?t>0:t<e.length)&&H(e.charAt(t));)t+=n;return t}function $(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,a=r<0?Math.ceil(i):Math.floor(i);if(a==t)return e(a)?t:n;e(a)?n=a:t=a+r}}function ce(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,a=0;a<e.length;++a){var o=e[a];(o.from<n&&o.to>t||t==n&&o.to==t)&&(r(Math.max(o.from,t),Math.min(o.to,n),o.level==1?"rtl":"ltr",a),i=!0)}i||r(t,n,"ltr")}var ie=null;function ne(e,t,n){var r;ie=null;for(var i=0;i<e.length;++i){var a=e[i];if(a.from<t&&a.to>t)return i;a.to==t&&(a.from!=a.to&&n=="before"?r=i:ie=i),a.from==t&&(a.from!=a.to&&n!="before"?r=i:ie=i)}return r!=null?r:ie}var pe=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,a=/[LRr]/,o=/[Lb1n]/,l=/[1n]/;function s(u,f,c){this.level=u,this.from=f,this.to=c}return function(u,f){var c=f=="ltr"?"L":"R";if(u.length==0||f=="ltr"&&!r.test(u))return!1;for(var S=u.length,y=[],L=0;L<S;++L)y.push(n(u.charCodeAt(L)));for(var _=0,se=c;_<S;++_){var we=y[_];we=="m"?y[_]=se:se=we}for(var ke=0,xe=c;ke<S;++ke){var Be=y[ke];Be=="1"&&xe=="r"?y[ke]="n":a.test(Be)&&(xe=Be,Be=="r"&&(y[ke]="R"))}for(var ft=1,rt=y[0];ft<S-1;++ft){var Vt=y[ft];Vt=="+"&&rt=="1"&&y[ft+1]=="1"?y[ft]="1":Vt==","&&rt==y[ft+1]&&(rt=="1"||rt=="n")&&(y[ft]=rt),rt=Vt}for(var Hr=0;Hr<S;++Hr){var pn=y[Hr];if(pn==",")y[Hr]="N";else if(pn=="%"){var Qr=void 0;for(Qr=Hr+1;Qr<S&&y[Qr]=="%";++Qr);for(var Xn=Hr&&y[Hr-1]=="!"||Qr<S&&y[Qr]=="1"?"1":"N",Zn=Hr;Zn<Qr;++Zn)y[Zn]=Xn;Hr=Qr-1}}for(var ln=0,Fn=c;ln<S;++ln){var wn=y[ln];Fn=="L"&&wn=="1"?y[ln]="L":a.test(wn)&&(Fn=wn)}for(var vn=0;vn<S;++vn)if(i.test(y[vn])){var sn=void 0;for(sn=vn+1;sn<S&&i.test(y[sn]);++sn);for(var en=(vn?y[vn-1]:c)=="L",Wn=(sn<S?y[sn]:c)=="L",Ji=en==Wn?en?"L":"R":c,Mi=vn;Mi<sn;++Mi)y[Mi]=Ji;vn=sn-1}for(var Tn=[],ci,mn=0;mn<S;)if(o.test(y[mn])){var Mo=mn;for(++mn;mn<S&&o.test(y[mn]);++mn);Tn.push(new s(0,Mo,mn))}else{var gi=mn,Ii=Tn.length,Ai=f=="rtl"?1:0;for(++mn;mn<S&&y[mn]!="L";++mn);for(var Pn=gi;Pn<mn;)if(l.test(y[Pn])){gi<Pn&&(Tn.splice(Ii,0,new s(1,gi,Pn)),Ii+=Ai);var Qi=Pn;for(++Pn;Pn<mn&&l.test(y[Pn]);++Pn);Tn.splice(Ii,0,new s(2,Qi,Pn)),Ii+=Ai,gi=Pn}else++Pn;gi<mn&&Tn.splice(Ii,0,new s(1,gi,mn))}return f=="ltr"&&(Tn[0].level==1&&(ci=u.match(/^\s+/))&&(Tn[0].from=ci[0].length,Tn.unshift(new s(0,0,ci[0].length))),Oe(Tn).level==1&&(ci=u.match(/\s+$/))&&(Oe(Tn).to-=ci[0].length,Tn.push(new s(0,S-ci[0].length,S)))),f=="rtl"?Tn.reverse():Tn}}();function k(e,t){var n=e.order;return n==null&&(n=e.order=pe(e.text,t)),n}var de=[],K=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||de).concat(n)}};function Ue(e,t){return e._handlers&&e._handlers[t]||de}function ge(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var a=fe(i,n);a>-1&&(r[t]=i.slice(0,a).concat(i.slice(a+1)))}}}function De(e,t){var n=Ue(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function Le(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),De(e,n||t.type,e,t),Sr(t)||t.codemirrorIgnore}function ct(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)fe(n,t[r])==-1&&n.push(t[r])}function Xe(e,t){return Ue(e,t).length>0}function Se(e){e.prototype.on=function(t,n){K(this,t,n)},e.prototype.off=function(t,n){ge(this,t,n)}}function $e(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ur(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Sr(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function er(e){$e(e),ur(e)}function Rr(e){return e.target||e.srcElement}function et(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),lt&&e.ctrlKey&&t==1&&(t=3),t}var nt=function(){if(R&&te<9)return!1;var e=Q("div");return"draggable"in e||"dragDrop"in e}(),It;function _t(e){if(It==null){var t=Q("span","\u200B");Ge(e,Q("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(It=t.offsetWidth<=1&&t.offsetHeight>2&&!(R&&te<8))}var n=It?Q("span","\u200B"):Q("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var Ht;function Xt(e){if(Ht!=null)return Ht;var t=Ge(e,document.createTextNode("A\u062EA")),n=Rt(t,0,1).getBoundingClientRect(),r=Rt(t,1,2).getBoundingClientRect();return mt(e),!n||n.left==n.right?!1:Ht=r.right-n.right<3}var wt=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(`
|
|
`,t);i==-1&&(i=e.length);var a=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),o=a.indexOf("\r");o!=-1?(n.push(a.slice(0,o)),t+=o+1):(n.push(a),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Jt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},dt=function(){var e=Q("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Br=null;function Zt(e){if(Br!=null)return Br;var t=Ge(e,Q("span","x")),n=t.getBoundingClientRect(),r=Rt(t,0,1).getBoundingClientRect();return Br=Math.abs(n.left-r.left)>1}var nr={},Dt={};function Fr(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),nr[e]=t}function un(e,t){Dt[e]=t}function Wr(e){if(typeof e=="string"&&Dt.hasOwnProperty(e))e=Dt[e];else if(e&&typeof e.name=="string"&&Dt.hasOwnProperty(e.name)){var t=Dt[e.name];typeof t=="string"&&(t={name:t}),e=p(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Wr("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Wr("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Bt(e,t){t=Wr(t);var n=nr[t.name];if(!n)return Bt(e,"text/plain");var r=n(e,t);if(ir.hasOwnProperty(t.name)){var i=ir[t.name];for(var a in i)i.hasOwnProperty(a)&&(r.hasOwnProperty(a)&&(r["_"+a]=r[a]),r[a]=i[a])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var o in t.modeProps)r[o]=t.modeProps[o];return r}var ir={};function fr(e,t){var n=ir.hasOwnProperty(e)?ir[e]:ir[e]={};M(t,n)}function jt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function kt(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),!(!n||n.mode==e));)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Er(e,t,n){return e.startState?e.startState(t,n):!0}var Pt=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};Pt.prototype.eol=function(){return this.pos>=this.string.length},Pt.prototype.sol=function(){return this.pos==this.lineStart},Pt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Pt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Pt.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},Pt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Pt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Pt.prototype.skipToEnd=function(){this.pos=this.string.length},Pt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Pt.prototype.backUp=function(e){this.pos-=e},Pt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=ue(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?ue(this.string,this.lineStart,this.tabSize):0)},Pt.prototype.indentation=function(){return ue(this.string,null,this.tabSize)-(this.lineStart?ue(this.string,this.lineStart,this.tabSize):0)},Pt.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(o){return n?o.toLowerCase():o},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var a=this.string.slice(this.pos).match(e);return a&&a.index>0?null:(a&&t!==!1&&(this.pos+=a[0].length),a)}},Pt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Pt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Pt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Pt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Y(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],a=i.chunkSize();if(t<a){n=i;break}t-=a}return n.lines[t]}function yt(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(a){var o=a.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i}),r}function Mr(e,t,n){var r=[];return e.iter(t,n,function(i){r.push(i.text)}),r}function cr(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function d(e){if(e.parent==null)return null;for(var t=e.parent,n=fe(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function v(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],a=i.height;if(t<a){e=i;continue e}t-=a,n+=i.chunkSize()}return n}while(!e.lines);for(var o=0;o<e.lines.length;++o){var l=e.lines[o],s=l.height;if(t<s)break;t-=s}return n+o}function F(e,t){return t>=e.first&&t<e.first+e.size}function N(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function g(e,t,n){if(n===void 0&&(n=null),!(this instanceof g))return new g(e,t,n);this.line=e,this.ch=t,this.sticky=n}function P(e,t){return e.line-t.line||e.ch-t.ch}function le(e,t){return e.sticky==t.sticky&&P(e,t)==0}function ve(e){return g(e.line,e.ch)}function Re(e,t){return P(e,t)<0?t:e}function Ce(e,t){return P(e,t)<0?e:t}function He(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function J(e,t){if(t.line<e.first)return g(e.first,0);var n=e.first+e.size-1;return t.line>n?g(n,Y(e,n).text.length):Me(t,Y(e,t.line).text.length)}function Me(e,t){var n=e.ch;return n==null||n>t?g(e.line,t):n<0?g(e.line,0):e}function X(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=J(e,t[r]);return n}var Te=function(e,t){this.state=e,this.lookAhead=t},ye=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};ye.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ye.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},ye.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ye.fromSaved=function(e,t,n){return t instanceof Te?new ye(e,jt(e.mode,t.state),n,t.lookAhead):new ye(e,jt(e.mode,t),n)},ye.prototype.save=function(e){var t=e!==!1?jt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Te(t,this.maxLookAhead):t};function Qe(e,t,n,r){var i=[e.state.modeGen],a={};Nt(e,t.text,e.doc.mode,n,function(u,f){return i.push(u,f)},a,r);for(var o=n.state,l=function(u){n.baseTokens=i;var f=e.state.overlays[u],c=1,S=0;n.state=!0,Nt(e,t.text,f.mode,n,function(y,L){for(var _=c;S<y;){var se=i[c];se>y&&i.splice(c,1,y,i[c+1],se),c+=2,S=Math.min(y,se)}if(L)if(f.opaque)i.splice(_,c-_,y,"overlay "+L),c=_+2;else for(;_<c;_+=2){var we=i[_+1];i[_+1]=(we?we+" ":"")+"overlay "+L}},a),n.state=o,n.baseTokens=null,n.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)l(s);return{styles:i,classes:a.bgClass||a.textClass?a:null}}function Et(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Ft(e,d(t)),i=t.text.length>e.options.maxHighlightLength&&jt(e.doc.mode,r.state),a=Qe(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=a.styles,a.classes?t.styleClasses=a.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Ft(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new ye(r,!0,t);var a=gr(e,t,n),o=a>r.first&&Y(r,a-1).stateAfter,l=o?ye.fromSaved(r,o,a):new ye(r,Er(r.mode),a);return r.iter(a,t,function(s){Qt(e,s.text,l);var u=l.line;s.stateAfter=u==t-1||u%5==0||u>=i.viewFrom&&u<i.viewTo?l.save():null,l.nextLine()}),n&&(r.modeFrontier=l.line),l}function Qt(e,t,n,r){var i=e.doc.mode,a=new Pt(t,e.options.tabSize,n);for(a.start=a.pos=r||0,t==""&&Wt(i,n.state);!a.eol();)hr(i,a,n.state),a.start=a.pos}function Wt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=kt(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}}function hr(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=kt(e,n).mode);var a=e.token(t,n);if(t.pos>t.start)return a}throw new Error("Mode "+e.name+" failed to advance stream.")}var xt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function Cr(e,t,n,r){var i=e.doc,a=i.mode,o;t=J(i,t);var l=Y(i,t.line),s=Ft(e,t.line,n),u=new Pt(l.text,e.options.tabSize,s),f;for(r&&(f=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,o=hr(a,u,s.state),r&&f.push(new xt(u,o,jt(i.mode,s.state)));return r?f:new xt(u,o,s.state)}function wr(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";t[r]==null?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function Nt(e,t,n,r,i,a,o){var l=n.flattenSpans;l==null&&(l=e.options.flattenSpans);var s=0,u=null,f=new Pt(t,e.options.tabSize,r),c,S=e.options.addModeClass&&[null];for(t==""&&wr(Wt(n,r.state),a);!f.eol();){if(f.pos>e.options.maxHighlightLength?(l=!1,o&&Qt(e,t,r,f.pos),f.pos=t.length,c=null):c=wr(hr(n,f,r.state,S),a),S){var y=S[0].name;y&&(c="m-"+(c?y+" "+c:y))}if(!l||u!=c){for(;s<f.start;)s=Math.min(f.start,s+5e3),i(s,u);u=c}f.start=f.pos}for(;s<f.pos;){var L=Math.min(f.pos,s+5e3);i(L,u),s=L}}function gr(e,t,n){for(var r,i,a=e.doc,o=n?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>o;--l){if(l<=a.first)return a.first;var s=Y(a,l-1),u=s.stateAfter;if(u&&(!n||l+(u instanceof Te?u.lookAhead:0)<=a.modeFrontier))return l;var f=ue(s.text,null,e.options.tabSize);(i==null||r>f)&&(i=l-1,r=f)}return i}function Kt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=Y(e,r).stateAfter;if(i&&(!(i instanceof Te)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var ar=!1,tt=!1;function St(){ar=!0}function Ut(){tt=!0}function or(e,t,n){this.marker=e,this.from=t,this.to=n}function Lr(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function lr(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function xr(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Yt(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var a=e[i],o=a.marker,l=a.from==null||(o.inclusiveLeft?a.from<=t:a.from<t);if(l||a.from==t&&o.type=="bookmark"&&(!n||!a.marker.insertLeft)){var s=a.to==null||(o.inclusiveRight?a.to>=t:a.to>t);(r||(r=[])).push(new or(o,a.from,s?null:a.to))}}return r}function Tt(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var a=e[i],o=a.marker,l=a.to==null||(o.inclusiveRight?a.to>=t:a.to>t);if(l||a.from==t&&o.type=="bookmark"&&(!n||a.marker.insertLeft)){var s=a.from==null||(o.inclusiveLeft?a.from<=t:a.from<t);(r||(r=[])).push(new or(o,s?null:a.from-t,a.to==null?null:a.to-t))}}return r}function Or(e,t){if(t.full)return null;var n=F(e,t.from.line)&&Y(e,t.from.line).markedSpans,r=F(e,t.to.line)&&Y(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,a=t.to.ch,o=P(t.from,t.to)==0,l=Yt(n,i,o),s=Tt(r,a,o),u=t.text.length==1,f=Oe(t.text).length+(u?i:0);if(l)for(var c=0;c<l.length;++c){var S=l[c];if(S.to==null){var y=Lr(s,S.marker);y?u&&(S.to=y.to==null?null:y.to+f):S.to=i}}if(s)for(var L=0;L<s.length;++L){var _=s[L];if(_.to!=null&&(_.to+=f),_.from==null){var se=Lr(l,_.marker);se||(_.from=f,u&&(l||(l=[])).push(_))}else _.from+=f,u&&(l||(l=[])).push(_)}l&&(l=Xr(l)),s&&s!=l&&(s=Xr(s));var we=[l];if(!u){var ke=t.text.length-2,xe;if(ke>0&&l)for(var Be=0;Be<l.length;++Be)l[Be].to==null&&(xe||(xe=[])).push(new or(l[Be].marker,null,null));for(var ft=0;ft<ke;++ft)we.push(xe);we.push(s)}return we}function Xr(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Vr(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(y){if(y.markedSpans)for(var L=0;L<y.markedSpans.length;++L){var _=y.markedSpans[L].marker;_.readOnly&&(!r||fe(r,_)==-1)&&(r||(r=[])).push(_)}}),!r)return null;for(var i=[{from:t,to:n}],a=0;a<r.length;++a)for(var o=r[a],l=o.find(0),s=0;s<i.length;++s){var u=i[s];if(!(P(u.to,l.from)<0||P(u.from,l.to)>0)){var f=[s,1],c=P(u.from,l.from),S=P(u.to,l.to);(c<0||!o.inclusiveLeft&&!c)&&f.push({from:u.from,to:l.from}),(S>0||!o.inclusiveRight&&!S)&&f.push({from:l.to,to:u.to}),i.splice.apply(i,f),s+=f.length-3}}return i}function pr(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function tn(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function mr(e){return e.inclusiveLeft?-1:0}function jr(e){return e.inclusiveRight?1:0}function Kr(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),a=P(r.from,i.from)||mr(e)-mr(t);if(a)return-a;var o=P(r.to,i.to)||jr(e)-jr(t);return o||t.id-e.id}function Tr(e,t){var n=tt&&e.markedSpans,r;if(n)for(var i=void 0,a=0;a<n.length;++a)i=n[a],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||Kr(r,i.marker)<0)&&(r=i.marker);return r}function ut(e){return Tr(e,!0)}function G(e){return Tr(e,!1)}function V(e,t){var n=tt&&e.markedSpans,r;if(n)for(var i=0;i<n.length;++i){var a=n[i];a.marker.collapsed&&(a.from==null||a.from<t)&&(a.to==null||a.to>t)&&(!r||Kr(r,a.marker)<0)&&(r=a.marker)}return r}function Ze(e,t,n,r,i){var a=Y(e,t),o=tt&&a.markedSpans;if(o)for(var l=0;l<o.length;++l){var s=o[l];if(s.marker.collapsed){var u=s.marker.find(0),f=P(u.from,n)||mr(s.marker)-mr(i),c=P(u.to,r)||jr(s.marker)-jr(i);if(!(f>=0&&c<=0||f<=0&&c>=0)&&(f<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?P(u.to,n)>=0:P(u.to,n)>0)||f>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?P(u.from,r)<=0:P(u.from,r)<0)))return!0}}}function me(e){for(var t;t=ut(e);)e=t.find(-1,!0).line;return e}function qe(e){for(var t;t=G(e);)e=t.find(1,!0).line;return e}function $t(e){for(var t,n;t=G(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function tr(e,t){var n=Y(e,t),r=me(n);return n==r?t:d(r)}function qt(e,t){if(t>e.lastLine())return t;var n=Y(e,t),r;if(!Dr(e,n))return t;for(;r=G(n);)n=r.find(1,!0).line;return d(n)+1}function Dr(e,t){var n=tt&&t.markedSpans;if(n){for(var r=void 0,i=0;i<n.length;++i)if(r=n[i],!!r.marker.collapsed){if(r.from==null)return!0;if(!r.marker.widgetNode&&r.from==0&&r.marker.inclusiveLeft&&Ur(e,t,r))return!0}}}function Ur(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return Ur(e,r.line,Lr(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,a=0;a<t.markedSpans.length;++a)if(i=t.markedSpans[a],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&Ur(e,t,i))return!0}function Ar(e){e=me(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var a=n.parent;a;n=a,a=n.parent)for(var o=0;o<a.children.length;++o){var l=a.children[o];if(l==n)break;t+=l.height}return t}function on(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=ut(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=G(r);){var a=n.find(0,!0);t-=r.text.length-a.from.ch,r=a.to.line,t+=r.text.length-a.to.ch}return t}function yr(e){var t=e.display,n=e.doc;t.maxLine=Y(n,n.first),t.maxLineLength=on(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var i=on(r);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var bn=function(e,t,n){this.text=e,tn(this,t),this.height=n?n(this):1};bn.prototype.lineNo=function(){return d(this)},Se(bn);function zn(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),pr(e),tn(e,n);var i=r?r(e):1;i!=e.height&&cr(e,i)}function Yr(e){e.parent=null,pr(e)}var kr={},rn={};function zr(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?rn:kr;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function $r(e,t){var n=at("span",null,null,ae?"padding-right: .1px":null),r={pre:at("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var a=i?t.rest[i-1]:t.line,o=void 0;r.pos=0,r.addToken=Nn,Xt(e.display.measure)&&(o=k(a,e.doc.direction))&&(r.addToken=fn(r.addToken,o)),r.map=[];var l=t!=e.display.externalMeasured&&d(a);En(a,r,Et(e,a,l)),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=j(a.styleClasses.bgClass,r.bgClass||"")),a.styleClasses.textClass&&(r.textClass=j(a.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(_t(e.display.measure))),i==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(ae){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return De(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=j(r.pre.className,r.textClass||"")),r}function jn(e){var t=Q("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Nn(e,t,n,r,i,a,o){if(t){var l=e.splitSpaces?xn(t,e.trailingSpace):t,s=e.cm.state.specialChars,u=!1,f;if(!s.test(t))e.col+=t.length,f=document.createTextNode(l),e.map.push(e.pos,e.pos+t.length,f),R&&te<9&&(u=!0),e.pos+=t.length;else{f=document.createDocumentFragment();for(var c=0;;){s.lastIndex=c;var S=s.exec(t),y=S?S.index-c:t.length-c;if(y){var L=document.createTextNode(l.slice(c,c+y));R&&te<9?f.appendChild(Q("span",[L])):f.appendChild(L),e.map.push(e.pos,e.pos+y,L),e.col+=y,e.pos+=y}if(!S)break;c+=y+1;var _=void 0;if(S[0]==" "){var se=e.cm.options.tabSize,we=se-e.col%se;_=f.appendChild(Q("span",bt(we),"cm-tab")),_.setAttribute("role","presentation"),_.setAttribute("cm-text"," "),e.col+=we}else S[0]=="\r"||S[0]==`
|
|
`?(_=f.appendChild(Q("span",S[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),_.setAttribute("cm-text",S[0]),e.col+=1):(_=e.cm.options.specialCharPlaceholder(S[0]),_.setAttribute("cm-text",S[0]),R&&te<9?f.appendChild(Q("span",[_])):f.appendChild(_),e.col+=1);e.map.push(e.pos,e.pos+1,_),e.pos++}}if(e.trailingSpace=l.charCodeAt(t.length-1)==32,n||r||i||u||a||o){var ke=n||"";r&&(ke+=r),i&&(ke+=i);var xe=Q("span",[f],ke,a);if(o)for(var Be in o)o.hasOwnProperty(Be)&&Be!="style"&&Be!="class"&&xe.setAttribute(Be,o[Be]);return e.content.appendChild(xe)}e.content.appendChild(f)}}function xn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var a=e.charAt(i);a==" "&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(a="\xA0"),r+=a,n=a==" "}return r}function fn(e,t){return function(n,r,i,a,o,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var u=n.pos,f=u+r.length;;){for(var c=void 0,S=0;S<t.length&&(c=t[S],!(c.to>u&&c.from<=u));S++);if(c.to>=f)return e(n,r,i,a,o,l,s);e(n,r.slice(0,c.to-u),i,a,null,l,s),a=null,r=r.slice(c.to-u),u=c.to}}}function $n(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function En(e,t,n){var r=e.markedSpans,i=e.text,a=0;if(!r){for(var o=1;o<n.length;o+=2)t.addToken(t,i.slice(a,a=n[o]),zr(n[o+1],t.cm.options));return}for(var l=i.length,s=0,u=1,f="",c,S,y=0,L,_,se,we,ke;;){if(y==s){L=_=se=S="",ke=null,we=null,y=1/0;for(var xe=[],Be=void 0,ft=0;ft<r.length;++ft){var rt=r[ft],Vt=rt.marker;if(Vt.type=="bookmark"&&rt.from==s&&Vt.widgetNode)xe.push(Vt);else if(rt.from<=s&&(rt.to==null||rt.to>s||Vt.collapsed&&rt.to==s&&rt.from==s)){if(rt.to!=null&&rt.to!=s&&y>rt.to&&(y=rt.to,_=""),Vt.className&&(L+=" "+Vt.className),Vt.css&&(S=(S?S+";":"")+Vt.css),Vt.startStyle&&rt.from==s&&(se+=" "+Vt.startStyle),Vt.endStyle&&rt.to==y&&(Be||(Be=[])).push(Vt.endStyle,rt.to),Vt.title&&((ke||(ke={})).title=Vt.title),Vt.attributes)for(var Hr in Vt.attributes)(ke||(ke={}))[Hr]=Vt.attributes[Hr];Vt.collapsed&&(!we||Kr(we.marker,Vt)<0)&&(we=rt)}else rt.from>s&&y>rt.from&&(y=rt.from)}if(Be)for(var pn=0;pn<Be.length;pn+=2)Be[pn+1]==y&&(_+=" "+Be[pn]);if(!we||we.from==s)for(var Qr=0;Qr<xe.length;++Qr)$n(t,0,xe[Qr]);if(we&&(we.from||0)==s){if($n(t,(we.to==null?l+1:we.to)-s,we.marker,we.from==null),we.to==null)return;we.to==s&&(we=!1)}}if(s>=l)break;for(var Xn=Math.min(l,y);;){if(f){var Zn=s+f.length;if(!we){var ln=Zn>Xn?f.slice(0,Xn-s):f;t.addToken(t,ln,c?c+L:L,se,s+ln.length==y?_:"",S,ke)}if(Zn>=Xn){f=f.slice(Xn-s),s=Xn;break}s=Zn,se=""}f=i.slice(a,a=n[u++]),c=zr(n[u++],t.cm.options)}}}function ri(e,t,n){this.line=t,this.rest=$t(t),this.size=this.rest?d(Oe(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Dr(e,t)}function qr(e,t,n){for(var r=[],i,a=t;a<n;a=i){var o=new ri(e.doc,Y(e.doc,a),a);i=a+o.size,r.push(o)}return r}var Hn=null;function ui(e){Hn?Hn.ops.push(e):e.ownsGroup=Hn={ops:[e],delayedCallbacks:[]}}function ni(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function di(e,t){var n=e.ownsGroup;if(n)try{ni(n)}finally{Hn=null,t(n)}}var Bn=null;function Zr(e,t){var n=Ue(e,t);if(n.length){var r=Array.prototype.slice.call(arguments,2),i;Hn?i=Hn.delayedCallbacks:Bn?i=Bn:(i=Bn=[],setTimeout(cn,0));for(var a=function(l){i.push(function(){return n[l].apply(null,r)})},o=0;o<n.length;++o)a(o)}}function cn(){var e=Bn;Bn=null;for(var t=0;t<e.length;++t)e[t]()}function qn(e,t,n,r){for(var i=0;i<t.changes.length;i++){var a=t.changes[i];a=="text"?Mn(e,t):a=="gutter"?gt(e,t,n,r):a=="class"?je(e,t):a=="widget"&&it(e,t,r)}t.changes=null}function Jr(e){return e.node==e.text&&(e.node=Q("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),R&&te<8&&(e.node.style.zIndex=2)),e.node}function Gr(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=Jr(t);t.background=r.insertBefore(Q("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function Kn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):$r(e,t)}function Mn(e,t){var n=t.text.className,r=Kn(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,je(e,t)):n&&(t.text.className=n)}function je(e,t){Gr(e,t),t.line.wrapClass?Jr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function gt(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=Jr(t);t.gutterBackground=Q("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var a=t.line.gutterMarkers;if(e.options.lineNumbers||a){var o=Jr(t),l=t.gutter=Q("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(l),o.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!a||!a["CodeMirror-linenumbers"])&&(t.lineNumber=l.appendChild(Q("div",N(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),a)for(var s=0;s<e.display.gutterSpecs.length;++s){var u=e.display.gutterSpecs[s].className,f=a.hasOwnProperty(u)&&a[u];f&&l.appendChild(Q("div",[f],"CodeMirror-gutter-elt","left: "+r.gutterLeft[u]+"px; width: "+r.gutterWidth[u]+"px"))}}}function it(e,t,n){t.alignable&&(t.alignable=null);for(var r=ze("CodeMirror-linewidget"),i=t.node.firstChild,a=void 0;i;i=a)a=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);sr(e,t,n)}function vt(e,t,n,r){var i=Kn(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),je(e,t),gt(e,t,n,r),sr(e,t,r),t.node}function sr(e,t,n){if(Pr(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)Pr(e,t.rest[r],t,n,!1)}function Pr(e,t,n,r,i){if(t.widgets)for(var a=Jr(n),o=0,l=t.widgets;o<l.length;++o){var s=l[o],u=Q("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),Ae(s,u,n,r),e.display.input.setUneditable(u),i&&s.above?a.insertBefore(u,n.gutter||n.text):a.appendChild(u),Zr(s,"redraw")}}function Ae(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function Ye(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!O(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),Ge(t.display.measure,Q("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function zt(e,t){for(var n=Rr(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==e.sizer&&n!=e.mover)return!0}function Gt(e){return e.lineSpace.offsetTop}function br(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function On(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=Ge(e.measure,Q("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function Sn(e){return _e-e.display.nativeBarWidth}function Yn(e){return e.display.scroller.clientWidth-Sn(e)-e.display.barWidth}function Un(e){return e.display.scroller.clientHeight-Sn(e)-e.display.barHeight}function ii(e,t,n){var r=e.options.lineWrapping,i=r&&Yn(e);if(!t.measure.heights||r&&t.measure.width!=i){var a=t.measure.heights=[];if(r){t.measure.width=i;for(var o=t.text.firstChild.getClientRects(),l=0;l<o.length-1;l++){var s=o[l],u=o[l+1];Math.abs(s.bottom-u.bottom)>2&&a.push((s.bottom+u.top)/2-n.top)}}a.push(n.bottom-n.top)}}function ki(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(d(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Ya(e,t){t=me(t);var n=d(t),r=e.display.externalMeasured=new ri(e.doc,t,n);r.lineN=n;var i=r.built=$r(e,r);return r.text=i.pre,Ge(e.display.lineMeasure,i.pre),r}function xa(e,t,n,r){return ei(e,pi(e,t),n,r)}function fi(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Ti(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function pi(e,t){var n=d(t),r=fi(e,n);r&&!r.text?r=null:r&&r.changes&&(qn(e,r,n,mi(e)),e.curOp.forceUpdate=!0),r||(r=Ya(e,t));var i=ki(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function ei(e,t,n,r,i){t.before&&(n=-1);var a=n+(r||""),o;return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(ii(e,t.view,t.rect),t.hasHeights=!0),o=La(e,t,n,r),o.bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var Ea={left:0,right:0,top:0,bottom:0};function Ma(e,t,n){for(var r,i,a,o,l,s,u=0;u<e.length;u+=3)if(l=e[u],s=e[u+1],t<l?(i=0,a=1,o="left"):t<s?(i=t-l,a=i+1):(u==e.length-3||t==s&&e[u+3]>t)&&(a=s-l,i=a-1,t>=s&&(o="right")),i!=null){if(r=e[u+2],l==s&&n==(r.insertLeft?"left":"right")&&(o=n),n=="left"&&i==0)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[(u-=3)+2],o="left";if(n=="right"&&i==s-l)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)r=e[(u+=3)+2],o="right";break}return{node:r,start:i,end:a,collapse:o,coverStart:l,coverEnd:s}}function Ja(e,t){var n=Ea;if(t=="left")for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function La(e,t,n,r){var i=Ma(t.map,n,r),a=i.node,o=i.start,l=i.end,s=i.collapse,u;if(a.nodeType==3){for(var f=0;f<4;f++){for(;o&&H(t.line.text.charAt(i.coverStart+o));)--o;for(;i.coverStart+l<i.coverEnd&&H(t.line.text.charAt(i.coverStart+l));)++l;if(R&&te<9&&o==0&&l==i.coverEnd-i.coverStart?u=a.parentNode.getBoundingClientRect():u=Ja(Rt(a,o,l).getClientRects(),r),u.left||u.right||o==0)break;l=o,o=o-1,s="right"}R&&te<11&&(u=Qa(e.display.measure,u))}else{o>0&&(s=r="right");var c;e.options.lineWrapping&&(c=a.getClientRects()).length>1?u=c[r=="right"?c.length-1:0]:u=a.getBoundingClientRect()}if(R&&te<9&&!o&&(!u||!u.left&&!u.right)){var S=a.parentNode.getClientRects()[0];S?u={left:S.left,right:S.left+oi(e.display),top:S.top,bottom:S.bottom}:u=Ea}for(var y=u.top-t.rect.top,L=u.bottom-t.rect.top,_=(y+L)/2,se=t.view.measure.heights,we=0;we<se.length-1&&!(_<se[we]);we++);var ke=we?se[we-1]:0,xe=se[we],Be={left:(s=="right"?u.right:u.left)-t.rect.left,right:(s=="left"?u.left:u.right)-t.rect.left,top:ke,bottom:xe};return!u.left&&!u.right&&(Be.bogus=!0),e.options.singleCursorHeightPerLine||(Be.rtop=y,Be.rbottom=L),Be}function Qa(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Zt(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function $i(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function qi(e){e.display.externalMeasure=null,mt(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)$i(e.display.view[t])}function Li(e){qi(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ea(){return ee&&ht?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Ra(){return ee&&ht?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function ta(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=Ye(e.widgets[n]));return t}function Zi(e,t,n,r,i){if(!i){var a=ta(t);n.top+=a,n.bottom+=a}if(r=="line")return n;r||(r="local");var o=Ar(t);if(r=="local"?o+=Gt(e.display):o-=e.display.viewOffset,r=="page"||r=="window"){var l=e.display.lineSpace.getBoundingClientRect();o+=l.top+(r=="window"?0:Ra());var s=l.left+(r=="window"?0:ea());n.left+=s,n.right+=s}return n.top+=o,n.bottom+=o,n}function Ta(e,t,n){if(n=="div")return t;var r=t.left,i=t.top;if(n=="page")r-=ea(),i-=Ra();else if(n=="local"||!n){var a=e.display.sizer.getBoundingClientRect();r+=a.left,i+=a.top}var o=e.display.lineSpace.getBoundingClientRect();return{left:r-o.left,top:i-o.top}}function Fi(e,t,n,r,i){return r||(r=Y(e.doc,t.line)),Zi(e,r,xa(e,r,t.ch,i),n)}function In(e,t,n,r,i,a){r=r||Y(e.doc,t.line),i||(i=pi(e,r));function o(L,_){var se=ei(e,i,L,_?"right":"left",a);return _?se.left=se.right:se.right=se.left,Zi(e,r,se,n)}var l=k(r,e.doc.direction),s=t.ch,u=t.sticky;if(s>=r.text.length?(s=r.text.length,u="before"):s<=0&&(s=0,u="after"),!l)return o(u=="before"?s-1:s,u=="before");function f(L,_,se){var we=l[_],ke=we.level==1;return o(se?L-1:L,ke!=se)}var c=ne(l,s,u),S=ie,y=f(s,c,u=="before");return S!=null&&(y.other=f(s,S,u!="before")),y}function dr(e,t){var n=0;t=J(e.doc,t),e.options.lineWrapping||(n=oi(e.display)*t.ch);var r=Y(e.doc,t.line),i=Ar(r)+Gt(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function At(e,t,n,r,i){var a=g(e,t,n);return a.xRel=i,r&&(a.outside=r),a}function Cn(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return At(r.first,0,null,-1,-1);var i=v(r,n),a=r.first+r.size-1;if(i>a)return At(r.first+r.size-1,Y(r,a).text.length,null,1,1);t<0&&(t=0);for(var o=Y(r,i);;){var l=ai(e,o,i,t,n),s=V(o,l.ch+(l.xRel>0||l.outside>0?1:0));if(!s)return l;var u=s.find(1);if(u.line==i)return u;o=Y(r,i=u.line)}}function Ln(e,t,n,r){r-=ta(t);var i=t.text.length,a=$(function(o){return ei(e,n,o-1).bottom<=r},i,0);return i=$(function(o){return ei(e,n,o).top>r},a,i),{begin:a,end:i}}function nn(e,t,n,r){n||(n=pi(e,t));var i=Zi(e,t,ei(e,n,r),"line").top;return Ln(e,t,n,i)}function dn(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function ai(e,t,n,r,i){i-=Ar(t);var a=pi(e,t),o=ta(t),l=0,s=t.text.length,u=!0,f=k(t,e.doc.direction);if(f){var c=(e.options.lineWrapping?vi:ti)(e,t,n,a,f,r,i);u=c.level!=1,l=u?c.from:c.to-1,s=u?c.to:c.from-1}var S=null,y=null,L=$(function(ft){var rt=ei(e,a,ft);return rt.top+=o,rt.bottom+=o,dn(rt,r,i,!1)?(rt.top<=i&&rt.left<=r&&(S=ft,y=rt),!0):!1},l,s),_,se,we=!1;if(y){var ke=r-y.left<y.right-r,xe=ke==u;L=S+(xe?0:1),se=xe?"after":"before",_=ke?y.left:y.right}else{!u&&(L==s||L==l)&&L++,se=L==0?"after":L==t.text.length?"before":ei(e,a,L-(u?1:0)).bottom+o<=i==u?"after":"before";var Be=In(e,g(n,L,se),"line",t,a);_=Be.left,we=i<Be.top?-1:i>=Be.bottom?1:0}return L=oe(t.text,L,1),At(n,L,se,we,r-_)}function ti(e,t,n,r,i,a,o){var l=$(function(c){var S=i[c],y=S.level!=1;return dn(In(e,g(n,y?S.to:S.from,y?"before":"after"),"line",t,r),a,o,!0)},0,i.length-1),s=i[l];if(l>0){var u=s.level!=1,f=In(e,g(n,u?s.from:s.to,u?"after":"before"),"line",t,r);dn(f,a,o,!0)&&f.top>o&&(s=i[l-1])}return s}function vi(e,t,n,r,i,a,o){var l=Ln(e,t,r,o),s=l.begin,u=l.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var f=null,c=null,S=0;S<i.length;S++){var y=i[S];if(!(y.from>=u||y.to<=s)){var L=y.level!=1,_=ei(e,r,L?Math.min(u,y.to)-1:Math.max(s,y.from)).right,se=_<a?a-_+1e9:_-a;(!f||c>se)&&(f=y,c=se)}}return f||(f=i[i.length-1]),f.from<s&&(f={from:s,to:f.to,level:f.level}),f.to>u&&(f={from:f.from,to:u,level:f.level}),f}var Gn;function Vn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Gn==null){Gn=Q("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Gn.appendChild(document.createTextNode("x")),Gn.appendChild(Q("br"));Gn.appendChild(document.createTextNode("x"))}Ge(e.measure,Gn);var n=Gn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),mt(e.measure),n||1}function oi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=Q("span","xxxxxxxxxx"),n=Q("pre",[t],"CodeMirror-line-like");Ge(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function mi(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,a=t.gutters.firstChild,o=0;a;a=a.nextSibling,++o){var l=e.display.gutterSpecs[o].className;n[l]=a.offsetLeft+a.clientLeft+i,r[l]=a.clientWidth}return{fixedPos:$a(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function $a(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Ro(e){var t=Vn(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/oi(e.display)-3);return function(i){if(Dr(e.doc,i))return 0;var a=0;if(i.widgets)for(var o=0;o<i.widgets.length;o++)i.widgets[o].height&&(a+=i.widgets[o].height);return n?a+(Math.ceil(i.text.length/r)||1)*t:a+t}}function qa(e){var t=e.doc,n=Ro(e);t.iter(function(r){var i=n(r);i!=r.height&&cr(r,i)})}function Ri(e,t,n,r){var i=e.display;if(!n&&Rr(t).getAttribute("cm-not-content")=="true")return null;var a,o,l=i.lineSpace.getBoundingClientRect();try{a=t.clientX-l.left,o=t.clientY-l.top}catch(c){return null}var s=Cn(e,a,o),u;if(r&&s.xRel>0&&(u=Y(e.doc,s.line).text).length==s.ch){var f=ue(u,u.length,e.options.tabSize)-u.length;s=g(s.line,Math.max(0,Math.round((a-On(e.display).left)/oi(e.display))-f))}return s}function Ti(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,t<0)return r}function An(e,t,n,r){t==null&&(t=e.doc.first),n==null&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)tt&&tr(e.doc,t)<i.viewTo&&bi(e);else if(n<=i.viewFrom)tt&&qt(e.doc,n+r)>i.viewFrom?bi(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)bi(e);else if(t<=i.viewFrom){var a=Da(e,n,n+r,1);a?(i.view=i.view.slice(a.index),i.viewFrom=a.lineN,i.viewTo+=r):bi(e)}else if(n>=i.viewTo){var o=Da(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):bi(e)}else{var l=Da(e,t,t,-1),s=Da(e,n,n+r,1);l&&s?(i.view=i.view.slice(0,l.index).concat(qr(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):bi(e)}var u=i.externalMeasured;u&&(n<u.lineN?u.lineN+=r:t<u.lineN+u.size&&(i.externalMeasured=null))}function yi(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var a=r.view[Ti(e,t)];if(a.node!=null){var o=a.changes||(a.changes=[]);fe(o,n)==-1&&o.push(n)}}}function bi(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Da(e,t,n,r){var i=Ti(e,t),a,o=e.display.view;if(!tt||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var l=e.display.viewFrom,s=0;s<i;s++)l+=o[s].size;if(l!=t){if(r>0){if(i==o.length-1)return null;a=l+o[i].size-t,i++}else a=l-t;t+=a,n+=a}for(;tr(e.doc,n)!=n;){if(i==(r<0?0:o.length-1))return null;n+=r*o[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function Gl(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=qr(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=qr(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Ti(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(qr(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Ti(e,n)))),r.viewTo=n}function To(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];!i.hidden&&(!i.node||i.changes)&&++n}return n}function ra(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Do(e,t){t===void 0&&(t=!0);for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),a=r.selection=document.createDocumentFragment(),o=0;o<n.sel.ranges.length;o++)if(!(!t&&o==n.sel.primIndex)){var l=n.sel.ranges[o];if(!(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom)){var s=l.empty();(s||e.options.showCursorWhenSelecting)&&Po(e,l.head,i),s||Vl(e,l,a)}}return r}function Po(e,t,n){var r=In(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(Q("div","\xA0","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var a=n.appendChild(Q("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=r.other.left+"px",a.style.top=r.other.top+"px",a.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Pa(e,t){return e.top-t.top||e.left-t.left}function Vl(e,t,n){var r=e.display,i=e.doc,a=document.createDocumentFragment(),o=On(e.display),l=o.left,s=Math.max(r.sizerWidth,Yn(e)-r.sizer.offsetLeft)-o.right,u=i.direction=="ltr";function f(xe,Be,ft,rt){Be<0&&(Be=0),Be=Math.round(Be),rt=Math.round(rt),a.appendChild(Q("div",null,"CodeMirror-selected","position: absolute; left: "+xe+`px;
|
|
top: `+Be+"px; width: "+(ft==null?s-xe:ft)+`px;
|
|
height: `+(rt-Be)+"px"))}function c(xe,Be,ft){var rt=Y(i,xe),Vt=rt.text.length,Hr,pn;function Qr(ln,Fn){return Fi(e,g(xe,ln),"div",rt,Fn)}function Xn(ln,Fn,wn){var vn=nn(e,rt,null,ln),sn=Fn=="ltr"==(wn=="after")?"left":"right",en=wn=="after"?vn.begin:vn.end-(/\s/.test(rt.text.charAt(vn.end-1))?2:1);return Qr(en,sn)[sn]}var Zn=k(rt,i.direction);return ce(Zn,Be||0,ft==null?Vt:ft,function(ln,Fn,wn,vn){var sn=wn=="ltr",en=Qr(ln,sn?"left":"right"),Wn=Qr(Fn-1,sn?"right":"left"),Ji=Be==null&&ln==0,Mi=ft==null&&Fn==Vt,Tn=vn==0,ci=!Zn||vn==Zn.length-1;if(Wn.top-en.top<=3){var mn=(u?Ji:Mi)&&Tn,Mo=(u?Mi:Ji)&&ci,gi=mn?l:(sn?en:Wn).left,Ii=Mo?s:(sn?Wn:en).right;f(gi,en.top,Ii-gi,en.bottom)}else{var Ai,Pn,Qi,Lo;sn?(Ai=u&&Ji&&Tn?l:en.left,Pn=u?s:Xn(ln,wn,"before"),Qi=u?l:Xn(Fn,wn,"after"),Lo=u&&Mi&&ci?s:Wn.right):(Ai=u?Xn(ln,wn,"before"):l,Pn=!u&&Ji&&Tn?s:en.right,Qi=!u&&Mi&&ci?l:Wn.left,Lo=u?Xn(Fn,wn,"after"):s),f(Ai,en.top,Pn-Ai,en.bottom),en.bottom<Wn.top&&f(l,en.bottom,null,Wn.top),f(Qi,Wn.top,Lo-Qi,Wn.bottom)}(!Hr||Pa(en,Hr)<0)&&(Hr=en),Pa(Wn,Hr)<0&&(Hr=Wn),(!pn||Pa(en,pn)<0)&&(pn=en),Pa(Wn,pn)<0&&(pn=Wn)}),{start:Hr,end:pn}}var S=t.from(),y=t.to();if(S.line==y.line)c(S.line,S.ch,y.ch);else{var L=Y(i,S.line),_=Y(i,y.line),se=me(L)==me(_),we=c(S.line,S.ch,se?L.text.length+1:null).end,ke=c(y.line,se?0:null,y.ch).start;se&&(we.top<ke.top-2?(f(we.right,we.top,null,we.bottom),f(l,ke.top,ke.left,ke.bottom)):f(we.right,we.top,ke.left-we.right,we.bottom)),we.bottom<ke.top&&f(l,we.bottom,null,ke.top)}n.appendChild(a)}function eo(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Wi(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function No(e){e.state.focused||(e.display.input.focus(),to(e))}function Oo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Wi(e))},100)}function to(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(De(e,"focus",e,t),e.state.focused=!0,Z(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),ae&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),eo(e))}function Wi(e,t){e.state.delayingBlurEvent||(e.state.focused&&(De(e,"blur",e,t),e.state.focused=!1,re(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Na(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i=t.view[r],a=e.options.lineWrapping,o=void 0,l=0;if(!i.hidden){if(R&&te<8){var s=i.node.offsetTop+i.node.offsetHeight;o=s-n,n=s}else{var u=i.node.getBoundingClientRect();o=u.bottom-u.top,!a&&i.text.firstChild&&(l=i.text.firstChild.getBoundingClientRect().right-u.left-1)}var f=i.line.height-o;if((f>.005||f<-.005)&&(cr(i.line,o),Io(i.line),i.rest))for(var c=0;c<i.rest.length;c++)Io(i.rest[c]);if(l>e.display.sizerWidth){var S=Math.ceil(l/oi(e.display));S>e.display.maxLineLength&&(e.display.maxLineLength=S,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function Io(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Oa(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Gt(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,a=v(t,r),o=v(t,i);if(n&&n.ensure){var l=n.ensure.from.line,s=n.ensure.to.line;l<a?(a=l,o=v(t,Ar(Y(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=o&&(a=v(t,Ar(Y(t,s))-e.wrapper.clientHeight),o=s)}return{from:a,to:Math.max(o,a+1)}}function _l(e,t){if(!Le(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),i!=null&&!Pe){var a=Q("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-n.viewOffset-Gt(e.display))+`px;
|
|
height: `+(t.bottom-t.top+Sn(e)+n.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(i),e.display.lineSpace.removeChild(a)}}}function Xl(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(t=t.ch?g(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,n=t.sticky=="before"?g(t.line,t.ch+1,"before"):t);for(var a=0;a<5;a++){var o=!1,l=In(e,t),s=!n||n==t?l:In(e,n);i={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-r,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+r};var u=ro(e,i),f=e.doc.scrollTop,c=e.doc.scrollLeft;if(u.scrollTop!=null&&(ia(e,u.scrollTop),Math.abs(e.doc.scrollTop-f)>1&&(o=!0)),u.scrollLeft!=null&&(Di(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-c)>1&&(o=!0)),!o)break}return i}function jl(e,t){var n=ro(e,t);n.scrollTop!=null&&ia(e,n.scrollTop),n.scrollLeft!=null&&Di(e,n.scrollLeft)}function ro(e,t){var n=e.display,r=Vn(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,a=Un(e),o={};t.bottom-t.top>a&&(t.bottom=t.top+a);var l=e.doc.height+br(n),s=t.top<r,u=t.bottom>l-r;if(t.top<i)o.scrollTop=s?0:t.top;else if(t.bottom>i+a){var f=Math.min(t.top,(u?l:t.bottom)-a);f!=i&&(o.scrollTop=f)}var c=e.options.fixedGutter?0:n.gutters.offsetWidth,S=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-c,y=Yn(e)-n.gutters.offsetWidth,L=t.right-t.left>y;return L&&(t.right=t.left+y),t.left<10?o.scrollLeft=0:t.left<S?o.scrollLeft=Math.max(0,t.left+c-(L?0:10)):t.right>y+S-3&&(o.scrollLeft=t.right+(L?0:10)-y),o}function no(e,t){t!=null&&(Ia(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function zi(e){Ia(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function na(e,t,n){(t!=null||n!=null)&&Ia(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function Yl(e,t){Ia(e),e.curOp.scrollToPos=t}function Ia(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=dr(e,t.from),r=dr(e,t.to);Ao(e,n,r,t.margin)}}function Ao(e,t,n,r){var i=ro(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});na(e,i.scrollLeft,i.scrollTop)}function ia(e,t){Math.abs(e.doc.scrollTop-t)<2||(B||ao(e,{top:t}),ko(e,t,!0),B&&ao(e),la(e,100))}function ko(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Di(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,Ho(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function aa(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+br(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Sn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Pi=function(e,t,n){this.cm=n;var r=this.vert=Q("div",[Q("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=Q("div",[Q("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),K(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),K(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,R&&te<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Pi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var a=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+a)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Pi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Pi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Pi.prototype.zeroWidthHack=function(){var e=lt&&!x?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Ne,this.disableVert=new Ne},Pi.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto";function r(){var i=e.getBoundingClientRect(),a=n=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);a!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},Pi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var oa=function(){};oa.prototype.update=function(){return{bottom:0,right:0}},oa.prototype.setScrollLeft=function(){},oa.prototype.setScrollTop=function(){},oa.prototype.clear=function(){};function Hi(e,t){t||(t=aa(e));var n=e.display.barWidth,r=e.display.barHeight;Zo(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Na(e),Zo(e,aa(e)),n=e.display.barWidth,r=e.display.barHeight}function Zo(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var Fo={native:Pi,null:oa};function Wo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&re(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Fo[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),K(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?Di(e,t):ia(e,t)},e),e.display.scrollbars.addClass&&Z(e.display.wrapper,e.display.scrollbars.addClass)}var Jl=0;function Ni(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:++Jl},ui(e.curOp)}function Oi(e){var t=e.curOp;t&&di(t,function(n){for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;Ql(n)})}function Ql(e){for(var t=e.ops,n=0;n<t.length;n++)$l(t[n]);for(var r=0;r<t.length;r++)ql(t[r]);for(var i=0;i<t.length;i++)es(t[i]);for(var a=0;a<t.length;a++)ts(t[a]);for(var o=0;o<t.length;o++)rs(t[o])}function $l(e){var t=e.cm,n=t.display;is(t),e.updateMaxLine&&yr(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Aa(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function ql(e){e.updatedDisplay=e.mustUpdate&&io(e.cm,e.update)}function es(e){var t=e.cm,n=t.display;e.updatedDisplay&&Na(t),e.barMeasure=aa(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=xa(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Sn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Yn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function ts(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Di(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==E();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Hi(t,e.barMeasure),e.updatedDisplay&&lo(t,e.barMeasure),e.selectionChanged&&eo(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&No(e.cm)}function rs(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&zo(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&ko(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Di(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=Xl(t,J(r,e.scrollToPos.from),J(r,e.scrollToPos.to),e.scrollToPos.margin);_l(t,i)}var a=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(a)for(var l=0;l<a.length;++l)a[l].lines.length||De(a[l],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&De(o[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&De(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function _n(e,t){if(e.curOp)return t();Ni(e);try{return t()}finally{Oi(e)}}function hn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Ni(e);try{return t.apply(e,arguments)}finally{Oi(e)}}}function Dn(e){return function(){if(this.curOp)return e.apply(this,arguments);Ni(this);try{return e.apply(this,arguments)}finally{Oi(this)}}}function gn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Ni(t);try{return e.apply(this,arguments)}finally{Oi(t)}}}function la(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,Ie(ns,e))}function ns(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=Ft(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(a){if(r.line>=e.display.viewFrom){var o=a.styles,l=a.text.length>e.options.maxHighlightLength?jt(t.mode,r.state):null,s=Qe(e,a,r,!0);l&&(r.state=l),a.styles=s.styles;var u=a.styleClasses,f=s.classes;f?a.styleClasses=f:u&&(a.styleClasses=null);for(var c=!o||o.length!=a.styles.length||u!=f&&(!u||!f||u.bgClass!=f.bgClass||u.textClass!=f.textClass),S=0;!c&&S<o.length;++S)c=o[S]!=a.styles[S];c&&i.push(r.line),a.stateAfter=r.save(),r.nextLine()}else a.text.length<=e.options.maxHighlightLength&&Qt(e,a.text,r),a.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return la(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&_n(e,function(){for(var a=0;a<i.length;a++)yi(e,i[a],"text")})}}var Aa=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Oa(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Yn(e),this.force=n,this.dims=mi(e),this.events=[]};Aa.prototype.signal=function(e,t){Xe(e,t)&&this.events.push(arguments)},Aa.prototype.finish=function(){for(var e=0;e<this.events.length;e++)De.apply(null,this.events[e])};function is(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Sn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Sn(e)+"px",t.scrollbarsClipped=!0)}function as(e){if(e.hasFocus())return null;var t=E();if(!t||!O(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&O(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function os(e){if(!(!e||!e.activeElt||e.activeElt==E())&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&O(document.body,e.anchorNode)&&O(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}function io(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return bi(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&To(e)==0)return!1;Bo(e)&&(bi(e),t.dims=mi(e));var i=r.first+r.size,a=Math.max(t.visible.from-e.options.viewportMargin,r.first),o=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<a&&a-n.viewFrom<20&&(a=Math.max(r.first,n.viewFrom)),n.viewTo>o&&n.viewTo-o<20&&(o=Math.min(i,n.viewTo)),tt&&(a=tr(e.doc,a),o=qt(e.doc,o));var l=a!=n.viewFrom||o!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Gl(e,a,o),n.viewOffset=Ar(Y(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=To(e);if(!l&&s==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var u=as(e);return s>4&&(n.lineDiv.style.display="none"),ls(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,os(u),mt(n.cursorDiv),mt(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,la(e,400)),n.updateLineNumbers=null,!0}function zo(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==Yn(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+br(e.display)-Un(e),n.top)}),t.visible=Oa(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Oa(e.display,e.doc,n));if(!io(e,t))break;Na(e);var i=aa(e);ra(e),Hi(e,i),lo(e,i),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function ao(e,t){var n=new Aa(e,t);if(io(e,n)){Na(e),zo(e,n);var r=aa(e);ra(e),Hi(e,r),lo(e,r),n.finish()}}function ls(e,t,n){var r=e.display,i=e.options.lineNumbers,a=r.lineDiv,o=a.firstChild;function l(L){var _=L.nextSibling;return ae&<&&e.display.currentWheelTarget==L?L.style.display="none":L.parentNode.removeChild(L),_}for(var s=r.view,u=r.viewFrom,f=0;f<s.length;f++){var c=s[f];if(!c.hidden)if(!c.node||c.node.parentNode!=a){var S=vt(e,c,u,n);a.insertBefore(S,o)}else{for(;o!=c.node;)o=l(o);var y=i&&t!=null&&t<=u&&c.lineNumber;c.changes&&(fe(c.changes,"gutter")>-1&&(y=!1),qn(e,c,u,n)),y&&(mt(c.lineNumber),c.lineNumber.appendChild(document.createTextNode(N(e.options,u)))),o=c.node.nextSibling}u+=c.size}for(;o;)o=l(o)}function oo(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function lo(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Sn(e)+"px"}function Ho(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=$a(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,a=r+"px",o=0;o<n.length;o++)if(!n[o].hidden){e.options.fixedGutter&&(n[o].gutter&&(n[o].gutter.style.left=a),n[o].gutterBackground&&(n[o].gutterBackground.style.left=a));var l=n[o].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=a}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function Bo(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=N(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(Q("div",[Q("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),a=i.firstChild.offsetWidth,o=i.offsetWidth-a;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(a,r.lineGutter.offsetWidth-o)+1,r.lineNumWidth=r.lineNumInnerWidth+o,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",oo(e.display),!0}return!1}function so(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var a=e[i],o=null;if(typeof a!="string"&&(o=a.style,a=a.className),a=="CodeMirror-linenumbers")if(t)r=!0;else continue;n.push({className:a,style:o})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function Ko(e){var t=e.gutters,n=e.gutterSpecs;mt(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],a=i.className,o=i.style,l=t.appendChild(Q("div",null,"CodeMirror-gutter "+a));o&&(l.style.cssText=o),a=="CodeMirror-linenumbers"&&(e.lineGutter=l,l.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",oo(e)}function sa(e){Ko(e.display),An(e),Ho(e)}function ss(e,t,n,r){var i=this;this.input=n,i.scrollbarFiller=Q("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=Q("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=at("div",null,"CodeMirror-code"),i.selectionDiv=Q("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=Q("div",null,"CodeMirror-cursors"),i.measure=Q("div",null,"CodeMirror-measure"),i.lineMeasure=Q("div",null,"CodeMirror-measure"),i.lineSpace=at("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var a=at("div",[i.lineSpace],"CodeMirror-lines");i.mover=Q("div",[a],null,"position: relative"),i.sizer=Q("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=Q("div",null,null,"position: absolute; height: "+_e+"px; width: 1px;"),i.gutters=Q("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=Q("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=Q("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),R&&te<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!ae&&!(B&&Mt)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=so(r.gutters,r.lineNumbers),Ko(i),n.init(i)}var ka=0,Jn=null;R?Jn=-.53:B?Jn=15:ee?Jn=-.7:We&&(Jn=-1/3);function Uo(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function us(e){var t=Uo(e);return t.x*=Jn,t.y*=Jn,t}function Go(e,t){var n=Uo(t),r=n.x,i=n.y,a=e.display,o=a.scroller,l=o.scrollWidth>o.clientWidth,s=o.scrollHeight>o.clientHeight;if(r&&l||i&&s){if(i&<&&ae){e:for(var u=t.target,f=a.view;u!=o;u=u.parentNode)for(var c=0;c<f.length;c++)if(f[c].node==u){e.display.currentWheelTarget=u;break e}}if(r&&!B&&!h&&Jn!=null){i&&s&&ia(e,Math.max(0,o.scrollTop+i*Jn)),Di(e,Math.max(0,o.scrollLeft+r*Jn)),(!i||i&&s)&&$e(t),a.wheelStartX=null;return}if(i&&Jn!=null){var S=i*Jn,y=e.doc.scrollTop,L=y+a.wrapper.clientHeight;S<0?y=Math.max(0,y+S-50):L=Math.min(e.doc.height,L+S+50),ao(e,{top:y,bottom:L})}ka<20&&(a.wheelStartX==null?(a.wheelStartX=o.scrollLeft,a.wheelStartY=o.scrollTop,a.wheelDX=r,a.wheelDY=i,setTimeout(function(){if(a.wheelStartX!=null){var _=o.scrollLeft-a.wheelStartX,se=o.scrollTop-a.wheelStartY,we=se&&a.wheelDY&&se/a.wheelDY||_&&a.wheelDX&&_/a.wheelDX;a.wheelStartX=a.wheelStartY=null,we&&(Jn=(Jn*ka+we)/(ka+1),++ka)}},200)):(a.wheelDX+=r,a.wheelDY+=i))}}var Qn=function(e,t){this.ranges=e,this.primIndex=t};Qn.prototype.primary=function(){return this.ranges[this.primIndex]},Qn.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!le(n.anchor,r.anchor)||!le(n.head,r.head))return!1}return!0},Qn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Nr(ve(this.ranges[t].anchor),ve(this.ranges[t].head));return new Qn(e,this.primIndex)},Qn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Qn.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(P(t,r.from())>=0&&P(e,r.to())<=0)return n}return-1};var Nr=function(e,t){this.anchor=e,this.head=t};Nr.prototype.from=function(){return Ce(this.anchor,this.head)},Nr.prototype.to=function(){return Re(this.anchor,this.head)},Nr.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function li(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(S,y){return P(S.from(),y.from())}),n=fe(t,i);for(var a=1;a<t.length;a++){var o=t[a],l=t[a-1],s=P(l.to(),o.from());if(r&&!o.empty()?s>0:s>=0){var u=Ce(l.from(),o.from()),f=Re(l.to(),o.to()),c=l.empty()?o.from()==o.head:l.from()==l.head;a<=n&&--n,t.splice(--a,2,new Nr(c?f:u,c?u:f))}}return new Qn(t,n)}function Si(e,t){return new Qn([new Nr(e,t||e)],0)}function Ci(e){return e.text?g(e.from.line+e.text.length-1,Oe(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Vo(e,t){if(P(e,t.from)<0)return e;if(P(e,t.to)<=0)return Ci(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Ci(t).ch-t.to.ch),g(n,r)}function uo(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new Nr(Vo(i.anchor,t),Vo(i.head,t)))}return li(e.cm,n,e.sel.primIndex)}function _o(e,t,n){return e.line==t.line?g(n.line,e.ch-t.ch+n.ch):g(n.line+(e.line-t.line),e.ch)}function fs(e,t,n){for(var r=[],i=g(e.first,0),a=i,o=0;o<t.length;o++){var l=t[o],s=_o(l.from,i,a),u=_o(Ci(l),i,a);if(i=l.to,a=u,n=="around"){var f=e.sel.ranges[o],c=P(f.head,f.anchor)<0;r[o]=new Nr(c?u:s,c?s:u)}else r[o]=new Nr(s,s)}return new Qn(r,e.sel.primIndex)}function fo(e){e.doc.mode=Bt(e.options,e.doc.modeOption),ua(e)}function ua(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,la(e,100),e.state.modeGen++,e.curOp&&An(e)}function Xo(e,t){return t.from.ch==0&&t.to.ch==0&&Oe(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function co(e,t,n,r){function i(ke){return n?n[ke]:null}function a(ke,xe,Be){zn(ke,xe,Be,r),Zr(ke,"change",ke,t)}function o(ke,xe){for(var Be=[],ft=ke;ft<xe;++ft)Be.push(new bn(u[ft],i(ft),r));return Be}var l=t.from,s=t.to,u=t.text,f=Y(e,l.line),c=Y(e,s.line),S=Oe(u),y=i(u.length-1),L=s.line-l.line;if(t.full)e.insert(0,o(0,u.length)),e.remove(u.length,e.size-u.length);else if(Xo(e,t)){var _=o(0,u.length-1);a(c,c.text,y),L&&e.remove(l.line,L),_.length&&e.insert(l.line,_)}else if(f==c)if(u.length==1)a(f,f.text.slice(0,l.ch)+S+f.text.slice(s.ch),y);else{var se=o(1,u.length-1);se.push(new bn(S+f.text.slice(s.ch),y,r)),a(f,f.text.slice(0,l.ch)+u[0],i(0)),e.insert(l.line+1,se)}else if(u.length==1)a(f,f.text.slice(0,l.ch)+u[0]+c.text.slice(s.ch),i(0)),e.remove(l.line+1,L);else{a(f,f.text.slice(0,l.ch)+u[0],i(0)),a(c,S+c.text.slice(s.ch),y);var we=o(1,u.length-1);L>1&&e.remove(l.line+1,L-1),e.insert(l.line+1,we)}Zr(e,"change",e,t)}function wi(e,t,n){function r(i,a,o){if(i.linked)for(var l=0;l<i.linked.length;++l){var s=i.linked[l];if(s.doc!=a){var u=o&&s.sharedHist;n&&!u||(t(s.doc,u),r(s.doc,i,u))}}}r(e,null,!0)}function jo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,qa(e),fo(e),Yo(e),e.options.lineWrapping||yr(e),e.options.mode=t.modeOption,An(e)}function Yo(e){(e.doc.direction=="rtl"?Z:re)(e.display.lineDiv,"CodeMirror-rtl")}function cs(e){_n(e,function(){Yo(e),An(e)})}function Za(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function vo(e,t){var n={from:ve(t.from),to:Ci(t),text:yt(e,t.from,t.to)};return $o(e,n,t.from.line,t.to.line+1),wi(e,function(r){return $o(r,n,t.from.line,t.to.line+1)},!0),n}function Jo(e){for(;e.length;){var t=Oe(e);if(t.ranges)e.pop();else break}}function ds(e,t){if(t)return Jo(e.done),Oe(e.done);if(e.done.length&&!Oe(e.done).ranges)return Oe(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Oe(e.done)}function Qo(e,t,n,r){var i=e.history;i.undone.length=0;var a=+new Date,o,l;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(o=ds(i,i.lastOp==r)))l=Oe(o.changes),P(t.from,t.to)==0&&P(t.from,l.to)==0?l.to=Ci(t):o.changes.push(vo(e,t));else{var s=Oe(i.done);for((!s||!s.ranges)&&Fa(e.sel,i.done),o={changes:[vo(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,l||De(e,"historyAdded")}function vs(e,t,n,r){var i=t.charAt(0);return i=="*"||i=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function hs(e,t,n,r){var i=e.history,a=r&&r.origin;n==i.lastSelOp||a&&i.lastSelOrigin==a&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==a||vs(e,a,Oe(i.done),t))?i.done[i.done.length-1]=t:Fa(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=a,i.lastSelOp=n,r&&r.clearRedo!==!1&&Jo(i.undone)}function Fa(e,t){var n=Oe(t);n&&n.ranges&&n.equals(e)||t.push(e)}function $o(e,t,n,r){var i=t["spans_"+e.id],a=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(o){o.markedSpans&&((i||(i=t["spans_"+e.id]={}))[a]=o.markedSpans),++a})}function gs(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function ps(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(gs(n[i]));return r}function qo(e,t){var n=ps(e,t),r=Or(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var a=n[i],o=r[i];if(a&&o)e:for(var l=0;l<o.length;++l){for(var s=o[l],u=0;u<a.length;++u)if(a[u].marker==s.marker)continue e;a.push(s)}else o&&(n[i]=o)}return n}function Bi(e,t,n){for(var r=[],i=0;i<e.length;++i){var a=e[i];if(a.ranges){r.push(n?Qn.prototype.deepCopy.call(a):a);continue}var o=a.changes,l=[];r.push({changes:l});for(var s=0;s<o.length;++s){var u=o[s],f=void 0;if(l.push({from:u.from,to:u.to,text:u.text}),t)for(var c in u)(f=c.match(/^spans_(\d+)$/))&&fe(t,Number(f[1]))>-1&&(Oe(l)[c]=u[c],delete u[c])}}return r}function ho(e,t,n,r){if(r){var i=e.anchor;if(n){var a=P(t,i)<0;a!=P(n,i)<0?(i=t,t=n):a!=P(t,n)<0&&(t=n)}return new Nr(i,t)}else return new Nr(n||t,t)}function Wa(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),Rn(e,new Qn([ho(e.sel.primary(),t,n,i)],0),r)}function el(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),a=0;a<e.sel.ranges.length;a++)r[a]=ho(e.sel.ranges[a],t[a],null,i);var o=li(e.cm,r,e.sel.primIndex);Rn(e,o,n)}function go(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Rn(e,li(e.cm,i,e.sel.primIndex),r)}function tl(e,t,n,r){Rn(e,Si(t,n),r)}function ms(e,t,n){var r={ranges:t.ranges,update:function(i){this.ranges=[];for(var a=0;a<i.length;a++)this.ranges[a]=new Nr(J(e,i[a].anchor),J(e,i[a].head))},origin:n&&n.origin};return De(e,"beforeSelectionChange",e,r),e.cm&&De(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?li(e.cm,r.ranges,r.ranges.length-1):t}function rl(e,t,n){var r=e.history.done,i=Oe(r);i&&i.ranges?(r[r.length-1]=t,za(e,t,n)):Rn(e,t,n)}function Rn(e,t,n){za(e,t,n),hs(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function za(e,t,n){(Xe(e,"beforeSelectionChange")||e.cm&&Xe(e.cm,"beforeSelectionChange"))&&(t=ms(e,t,n));var r=n&&n.bias||(P(t.primary().head,e.sel.primary().head)<0?-1:1);nl(e,al(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&zi(e.cm)}function nl(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ct(e.cm)),Zr(e,"cursorActivity",e))}function il(e){nl(e,al(e,e.sel,null,!1))}function al(e,t,n,r){for(var i,a=0;a<t.ranges.length;a++){var o=t.ranges[a],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[a],s=Ha(e,o.anchor,l&&l.anchor,n,r),u=Ha(e,o.head,l&&l.head,n,r);(i||s!=o.anchor||u!=o.head)&&(i||(i=t.ranges.slice(0,a)),i[a]=new Nr(s,u))}return i?li(e.cm,i,t.primIndex):t}function Ki(e,t,n,r,i){var a=Y(e,t.line);if(a.markedSpans)for(var o=0;o<a.markedSpans.length;++o){var l=a.markedSpans[o],s=l.marker,u="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,f="selectRight"in s?!s.selectRight:s.inclusiveRight;if((l.from==null||(u?l.from<=t.ch:l.from<t.ch))&&(l.to==null||(f?l.to>=t.ch:l.to>t.ch))){if(i&&(De(s,"beforeCursorEnter"),s.explicitlyCleared))if(a.markedSpans){--o;continue}else break;if(!s.atomic)continue;if(n){var c=s.find(r<0?1:-1),S=void 0;if((r<0?f:u)&&(c=ol(e,c,-r,c&&c.line==t.line?a:null)),c&&c.line==t.line&&(S=P(c,n))&&(r<0?S<0:S>0))return Ki(e,c,t,r,i)}var y=s.find(r<0?-1:1);return(r<0?u:f)&&(y=ol(e,y,r,y.line==t.line?a:null)),y?Ki(e,y,t,r,i):null}}return t}function Ha(e,t,n,r,i){var a=r||1,o=Ki(e,t,n,a,i)||!i&&Ki(e,t,n,a,!0)||Ki(e,t,n,-a,i)||!i&&Ki(e,t,n,-a,!0);return o||(e.cantEdit=!0,g(e.first,0))}function ol(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?J(e,g(t.line-1)):null:n>0&&t.ch==(r||Y(e,t.line)).text.length?t.line<e.first+e.size-1?g(t.line+1,0):null:new g(t.line,t.ch+n)}function ll(e){e.setSelection(g(e.firstLine(),0),g(e.lastLine()),Ee)}function sl(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(i,a,o,l){i&&(r.from=J(e,i)),a&&(r.to=J(e,a)),o&&(r.text=o),l!==void 0&&(r.origin=l)}),De(e,"beforeChange",e,r),e.cm&&De(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Ui(e,t,n){if(e.cm){if(!e.cm.curOp)return hn(e.cm,Ui)(e,t,n);if(e.cm.state.suppressEdits)return}if(!((Xe(e,"beforeChange")||e.cm&&Xe(e.cm,"beforeChange"))&&(t=sl(e,t,!0),!t))){var r=ar&&!n&&Vr(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)ul(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else ul(e,t)}}function ul(e,t){if(!(t.text.length==1&&t.text[0]==""&&P(t.from,t.to)==0)){var n=uo(e,t);Qo(e,t,n,e.cm?e.cm.curOp.id:NaN),fa(e,t,n,Or(e,t));var r=[];wi(e,function(i,a){!a&&fe(r,i.history)==-1&&(vl(i.history,t),r.push(i.history)),fa(i,t,null,Or(i,t))})}}function Ba(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!n)){for(var i=e.history,a,o=e.sel,l=t=="undo"?i.done:i.undone,s=t=="undo"?i.undone:i.done,u=0;u<l.length&&(a=l[u],!(n?a.ranges&&!a.equals(e.sel):!a.ranges));u++);if(u!=l.length){for(i.lastOrigin=i.lastSelOrigin=null;;)if(a=l.pop(),a.ranges){if(Fa(a,s),n&&!a.equals(e.sel)){Rn(e,a,{clearRedo:!1});return}o=a}else if(r){l.push(a);return}else break;var f=[];Fa(o,s),s.push({changes:f,generation:i.generation}),i.generation=a.generation||++i.maxGeneration;for(var c=Xe(e,"beforeChange")||e.cm&&Xe(e.cm,"beforeChange"),S=function(_){var se=a.changes[_];if(se.origin=t,c&&!sl(e,se,!1))return l.length=0,{};f.push(vo(e,se));var we=_?uo(e,se):Oe(l);fa(e,se,we,qo(e,se)),!_&&e.cm&&e.cm.scrollIntoView({from:se.from,to:Ci(se)});var ke=[];wi(e,function(xe,Be){!Be&&fe(ke,xe.history)==-1&&(vl(xe.history,se),ke.push(xe.history)),fa(xe,se,null,qo(xe,se))})},y=a.changes.length-1;y>=0;--y){var L=S(y);if(L)return L.v}}}}function fl(e,t){if(t!=0&&(e.first+=t,e.sel=new Qn(vr(e.sel.ranges,function(i){return new Nr(g(i.anchor.line+t,i.anchor.ch),g(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){An(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)yi(e.cm,r,"gutter")}}function fa(e,t,n,r){if(e.cm&&!e.cm.curOp)return hn(e.cm,fa)(e,t,n,r);if(t.to.line<e.first){fl(e,t.text.length-1-(t.to.line-t.from.line));return}if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);fl(e,i),t={from:g(e.first,0),to:g(t.to.line+i,t.to.ch),text:[Oe(t.text)],origin:t.origin}}var a=e.lastLine();t.to.line>a&&(t={from:t.from,to:g(a,Y(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=yt(e,t.from,t.to),n||(n=uo(e,t)),e.cm?ys(e.cm,t,r):co(e,t,r),za(e,n,Ee),e.cantEdit&&Ha(e,g(e.firstLine(),0))&&(e.cantEdit=!1)}}function ys(e,t,n){var r=e.doc,i=e.display,a=t.from,o=t.to,l=!1,s=a.line;e.options.lineWrapping||(s=d(me(Y(r,a.line))),r.iter(s,o.line+1,function(y){if(y==i.maxLine)return l=!0,!0})),r.sel.contains(t.from,t.to)>-1&&ct(e),co(r,t,n,Ro(e)),e.options.lineWrapping||(r.iter(s,a.line+t.text.length,function(y){var L=on(y);L>i.maxLineLength&&(i.maxLine=y,i.maxLineLength=L,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),Kt(r,a.line),la(e,400);var u=t.text.length-(o.line-a.line)-1;t.full?An(e):a.line==o.line&&t.text.length==1&&!Xo(e.doc,t)?yi(e,a.line,"text"):An(e,a.line,o.line+1,u);var f=Xe(e,"changes"),c=Xe(e,"change");if(c||f){var S={from:a,to:o,text:t.text,removed:t.removed,origin:t.origin};c&&Zr(e,"change",e,S),f&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(S)}e.display.selForContextMenu=null}function Gi(e,t,n,r,i){var a;r||(r=n),P(r,n)<0&&(a=[r,n],n=a[0],r=a[1]),typeof t=="string"&&(t=e.splitLines(t)),Ui(e,{from:n,to:r,text:t,origin:i})}function cl(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function dl(e,t,n,r){for(var i=0;i<e.length;++i){var a=e[i],o=!0;if(a.ranges){a.copied||(a=e[i]=a.deepCopy(),a.copied=!0);for(var l=0;l<a.ranges.length;l++)cl(a.ranges[l].anchor,t,n,r),cl(a.ranges[l].head,t,n,r);continue}for(var s=0;s<a.changes.length;++s){var u=a.changes[s];if(n<u.from.line)u.from=g(u.from.line+r,u.from.ch),u.to=g(u.to.line+r,u.to.ch);else if(t<=u.to.line){o=!1;break}}o||(e.splice(0,i+1),i=0)}}function vl(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;dl(e.done,n,r,i),dl(e.undone,n,r,i)}function ca(e,t,n,r){var i=t,a=t;return typeof t=="number"?a=Y(e,He(e,t)):i=d(t),i==null?null:(r(a,i)&&e.cm&&yi(e.cm,i,n),a)}function da(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}da.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,Yr(i),Zr(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}};function va(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}va.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var a=Math.min(t,i-e),o=r.height;if(r.removeInner(e,a),this.height-=o-r.height,i==a&&(this.children.splice(n--,1),r.parent=null),(t-=a)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof da))){var l=[];this.collapse(l),this.children=[new da(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],a=i.chunkSize();if(e<=a){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var o=i.lines.length%25+25,l=o;l<i.lines.length;){var s=new da(i.lines.slice(l,l+=25));i.height-=s.height,this.children.splice(++r,0,s),s.parent=this}i.lines=i.lines.slice(0,o),this.maybeSpill()}break}e-=a}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new va(t);if(e.parent){e.size-=n.size,e.height-=n.height;var i=fe(e.parent.children,e);e.parent.children.splice(i+1,0,n)}else{var r=new va(e.children);r.parent=e,e.children=[r,n],e=r}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],a=i.chunkSize();if(e<a){var o=Math.min(t,a-e);if(i.iterN(e,o,n))return!0;if((t-=o)==0)break;e=0}else e-=a}}};var ha=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};ha.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=d(n);if(!(r==null||!t)){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var a=Ye(this);cr(n,Math.max(0,n.height-a)),e&&(_n(e,function(){hl(e,n,-a),yi(e,r,"widget")}),Zr(e,"lineWidgetCleared",e,this,r))}},ha.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=Ye(this)-t;i&&(Dr(this.doc,r)||cr(r,r.height+i),n&&_n(n,function(){n.curOp.forceUpdate=!0,hl(n,r,i),Zr(n,"lineWidgetChanged",n,e,d(r))}))},Se(ha);function hl(e,t,n){Ar(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&no(e,n)}function bs(e,t,n,r){var i=new ha(e,n,r),a=e.cm;return a&&i.noHScroll&&(a.display.alignWidgets=!0),ca(e,t,"widget",function(o){var l=o.widgets||(o.widgets=[]);if(i.insertAt==null?l.push(i):l.splice(Math.min(l.length-1,Math.max(0,i.insertAt)),0,i),i.line=o,a&&!Dr(e,o)){var s=Ar(o)<e.scrollTop;cr(o,o.height+Ye(i)),s&&no(a,i.height),a.curOp.forceUpdate=!0}return!0}),a&&Zr(a,"lineWidgetAdded",a,i,typeof t=="number"?t:d(t)),i}var gl=0,xi=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++gl};xi.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Ni(e),Xe(this,"clear")){var n=this.find();n&&Zr(this,"clear",n.from,n.to)}for(var r=null,i=null,a=0;a<this.lines.length;++a){var o=this.lines[a],l=Lr(o.markedSpans,this);e&&!this.collapsed?yi(e,d(o),"text"):e&&(l.to!=null&&(i=d(o)),l.from!=null&&(r=d(o))),o.markedSpans=lr(o.markedSpans,l),l.from==null&&this.collapsed&&!Dr(this.doc,o)&&e&&cr(o,Vn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var u=me(this.lines[s]),f=on(u);f>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=f,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&An(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&il(e.doc)),e&&Zr(e,"markerCleared",e,this,r,i),t&&Oi(e),this.parent&&this.parent.clear()}},xi.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var a=this.lines[i],o=Lr(a.markedSpans,this);if(o.from!=null&&(n=g(t?a:d(a),o.from),e==-1))return n;if(o.to!=null&&(r=g(t?a:d(a),o.to),e==1))return r}return n&&{from:n,to:r}},xi.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;!t||!r||_n(r,function(){var i=t.line,a=d(t.line),o=fi(r,a);if(o&&($i(o),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Dr(n.doc,i)&&n.height!=null){var l=n.height;n.height=null;var s=Ye(n)-l;s&&cr(i,i.height+s)}Zr(r,"markerChanged",r,e)})},xi.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||fe(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},xi.prototype.detachLine=function(e){if(this.lines.splice(fe(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Se(xi);function Vi(e,t,n,r,i){if(r&&r.shared)return Ss(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return hn(e.cm,Vi)(e,t,n,r,i);var a=new xi(e,i),o=P(t,n);if(r&&M(r,a,!1),o>0||o==0&&a.clearWhenEmpty!==!1)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=at("span",[a.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(Ze(e,t.line,t,n,a)||t.line!=n.line&&Ze(e,n.line,t,n,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ut()}a.addToHistory&&Qo(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var l=t.line,s=e.cm,u;if(e.iter(l,n.line+1,function(c){s&&a.collapsed&&!s.options.lineWrapping&&me(c)==s.display.maxLine&&(u=!0),a.collapsed&&l!=t.line&&cr(c,0),xr(c,new or(a,l==t.line?t.ch:null,l==n.line?n.ch:null)),++l}),a.collapsed&&e.iter(t.line,n.line+1,function(c){Dr(e,c)&&cr(c,0)}),a.clearOnEnter&&K(a,"beforeCursorEnter",function(){return a.clear()}),a.readOnly&&(St(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++gl,a.atomic=!0),s){if(u&&(s.curOp.updateMaxLine=!0),a.collapsed)An(s,t.line,n.line+1);else if(a.className||a.startStyle||a.endStyle||a.css||a.attributes||a.title)for(var f=t.line;f<=n.line;f++)yi(s,f,"text");a.atomic&&il(s.doc),Zr(s,"markerAdded",s,a)}return a}var ga=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};ga.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Zr(this,"clear")}},ga.prototype.find=function(e,t){return this.primary.find(e,t)},Se(ga);function Ss(e,t,n,r,i){r=M(r),r.shared=!1;var a=[Vi(e,t,n,r,i)],o=a[0],l=r.widgetNode;return wi(e,function(s){l&&(r.widgetNode=l.cloneNode(!0)),a.push(Vi(s,J(s,t),J(s,n),r,i));for(var u=0;u<s.linked.length;++u)if(s.linked[u].isParent)return;o=Oe(a)}),new ga(a,o)}function pl(e){return e.findMarks(g(e.first,0),e.clipPos(g(e.lastLine())),function(t){return t.parent})}function Cs(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),a=e.clipPos(i.from),o=e.clipPos(i.to);if(P(a,o)){var l=Vi(e,a,o,r.primary,r.primary.type);r.markers.push(l),l.parent=r}}}function ws(e){for(var t=function(r){var i=e[r],a=[i.primary.doc];wi(i.primary.doc,function(s){return a.push(s)});for(var o=0;o<i.markers.length;o++){var l=i.markers[o];fe(a,l.doc)==-1&&(l.parent=null,i.markers.splice(o--,1))}},n=0;n<e.length;n++)t(n)}var xs=0,kn=function(e,t,n,r,i){if(!(this instanceof kn))return new kn(e,t,n,r,i);n==null&&(n=0),va.call(this,[new da([new bn("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var a=g(n,0);this.sel=Si(a),this.history=new Za(null),this.id=++xs,this.modeOption=t,this.lineSep=r,this.direction=i=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),co(this,{from:a,to:a,text:e}),Rn(this,Si(a),Ee)};kn.prototype=p(va.prototype,{constructor:kn,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Mr(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:gn(function(e){var t=g(this.first,0),n=this.first+this.size-1;Ui(this,{from:t,to:g(n,Y(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&na(this.cm,0,0),Rn(this,Si(t),Ee)}),replaceRange:function(e,t,n,r){t=J(this,t),n=n?J(this,n):t,Gi(this,e,t,n,r)},getRange:function(e,t,n){var r=yt(this,J(this,e),J(this,t));return n===!1?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(F(this,e))return Y(this,e)},getLineNumber:function(e){return d(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Y(this,e)),me(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return J(this,e)},getCursor:function(e){var t=this.sel.primary(),n;return e==null||e=="head"?n=t.head:e=="anchor"?n=t.anchor:e=="end"||e=="to"||e===!1?n=t.to():n=t.from(),n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:gn(function(e,t,n){tl(this,J(this,typeof e=="number"?g(e,t||0):e),null,n)}),setSelection:gn(function(e,t,n){tl(this,J(this,e),J(this,t||e),n)}),extendSelection:gn(function(e,t,n){Wa(this,J(this,e),t&&J(this,t),n)}),extendSelections:gn(function(e,t){el(this,X(this,e),t)}),extendSelectionsBy:gn(function(e,t){var n=vr(this.sel.ranges,e);el(this,X(this,n),t)}),setSelections:gn(function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new Nr(J(this,e[i].anchor),J(this,e[i].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Rn(this,li(this.cm,r,t),n)}}),addSelection:gn(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Nr(J(this,e),J(this,t||e))),Rn(this,li(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,r=0;r<t.length;r++){var i=yt(this,t[r].from(),t[r].to());n=n?n.concat(i):i}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=yt(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:gn(function(e,t,n){for(var r=[],i=this.sel,a=0;a<i.ranges.length;a++){var o=i.ranges[a];r[a]={from:o.from(),to:o.to(),text:this.splitLines(e[a]),origin:n}}for(var l=t&&t!="end"&&fs(this,r,t),s=r.length-1;s>=0;s--)Ui(this,r[s]);l?rl(this,l):this.cm&&zi(this.cm)}),undo:gn(function(){Ba(this,"undo")}),redo:gn(function(){Ba(this,"redo")}),undoSelection:gn(function(){Ba(this,"undo",!0)}),redoSelection:gn(function(){Ba(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Za(this.history.maxGeneration),wi(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Bi(this.history.done),undone:Bi(this.history.undone)}},setHistory:function(e){var t=this.history=new Za(this.history.maxGeneration);t.done=Bi(e.done.slice(0),null,!0),t.undone=Bi(e.undone.slice(0),null,!0)},setGutterMarker:gn(function(e,t,n){return ca(this,e,"gutter",function(r){var i=r.gutterMarkers||(r.gutterMarkers={});return i[t]=n,!n&&I(i)&&(r.gutterMarkers=null),!0})}),clearGutter:gn(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&ca(t,n,"gutter",function(){return n.gutterMarkers[e]=null,I(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!F(this,e)||(t=e,e=Y(this,e),!e))return null}else if(t=d(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:gn(function(e,t,n){return ca(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[i])r[i]=n;else{if(ze(n).test(r[i]))return!1;r[i]+=" "+n}return!0})}),removeLineClass:gn(function(e,t,n){return ca(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",a=r[i];if(a)if(n==null)r[i]=null;else{var o=a.match(ze(n));if(!o)return!1;var l=o.index+o[0].length;r[i]=a.slice(0,o.index)+(!o.index||l==a.length?"":" ")+a.slice(l)||null}else return!1;return!0})}),addLineWidget:gn(function(e,t,n){return bs(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Vi(this,J(this,e),J(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=J(this,e),Vi(this,e,e,n,"bookmark")},findMarksAt:function(e){e=J(this,e);var t=[],n=Y(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=J(this,e),t=J(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(a){var o=a.markedSpans;if(o)for(var l=0;l<o.length;l++){var s=o[l];!(s.to!=null&&i==e.line&&e.ch>=s.to||s.from==null&&i!=e.line||s.from!=null&&i==t.line&&s.from>=t.ch)&&(!n||n(s.marker))&&r.push(s.marker.parent||s.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var a=i.text.length+r;if(a>e)return t=e,!0;e-=a,++n}),J(this,g(n,t))},indexFromPos:function(e){e=J(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+n}),t},copy:function(e){var t=new kn(Mr(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new kn(Mr(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Cs(r,pl(this)),r},unlinkDoc:function(e){if(e instanceof _r&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),ws(pl(this));break}}if(e.history==this.history){var r=[e.id];wi(e,function(i){return r.push(i.id)},!0),e.history=new Za(null),e.history.done=Bi(this.history.done,r),e.history.undone=Bi(this.history.undone,r)}},iterLinkedDocs:function(e){wi(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):wt(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:gn(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&cs(this.cm))})}),kn.prototype.eachLine=kn.prototype.iter;var ml=0;function Es(e){var t=this;if(yl(t),!(Le(t,e)||zt(t.display,e))){$e(e),R&&(ml=+new Date);var n=Ri(t,e,!0),r=e.dataTransfer.files;if(!(!n||t.isReadOnly()))if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,a=Array(i),o=0,l=function(){++o==i&&hn(t,function(){n=J(t.doc,n);var y={from:n,to:n,text:t.doc.splitLines(a.filter(function(L){return L!=null}).join(t.doc.lineSeparator())),origin:"paste"};Ui(t.doc,y),rl(t.doc,Si(J(t.doc,n),J(t.doc,Ci(y))))})()},s=function(y,L){if(t.options.allowDropFileTypes&&fe(t.options.allowDropFileTypes,y.type)==-1){l();return}var _=new FileReader;_.onerror=function(){return l()},_.onload=function(){var se=_.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(se)){l();return}a[L]=se,l()},_.readAsText(y)},u=0;u<r.length;u++)s(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var f=e.dataTransfer.getData("Text");if(f){var c;if(t.state.draggingText&&!t.state.draggingText.copy&&(c=t.listSelections()),za(t.doc,Si(n,n)),c)for(var S=0;S<c.length;++S)Gi(t.doc,"",c[S].anchor,c[S].head,"drag");t.replaceSelection(f,"around","paste"),t.display.input.focus()}}catch(y){}}}}function Ms(e,t){if(R&&(!e.state.draggingText||+new Date-ml<100)){er(t);return}if(!(Le(e,t)||zt(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!We)){var n=Q("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),h&&n.parentNode.removeChild(n)}}function Ls(e,t){var n=Ri(e,t);if(n){var r=document.createDocumentFragment();Po(e,n,r),e.display.dragCursor||(e.display.dragCursor=Q("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),Ge(e.display.dragCursor,r)}}function yl(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function bl(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var a=0;a<n.length;a++)e(n[a])})}}var Sl=!1;function Rs(){Sl||(Ts(),Sl=!0)}function Ts(){var e;K(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,bl(Ds)},100))}),K(window,"blur",function(){return bl(Wi)})}function Ds(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Ei={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"},pa=0;pa<10;pa++)Ei[pa+48]=Ei[pa+96]=String(pa);for(var Ka=65;Ka<=90;Ka++)Ei[Ka]=String.fromCharCode(Ka);for(var ma=1;ma<=12;ma++)Ei[ma+111]=Ei[ma+63235]="F"+ma;var hi={};hi.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"},hi.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"},hi.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"},hi.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"]},hi.default=lt?hi.macDefault:hi.pcDefault;function Ps(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,i,a,o=0;o<t.length-1;o++){var l=t[o];if(/^(cmd|meta|m)$/i.test(l))a=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else if(/^s(hift)?$/i.test(l))i=!0;else throw new Error("Unrecognized modifier name: "+l)}return n&&(e="Alt-"+e),r&&(e="Ctrl-"+e),a&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Ns(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(r=="..."){delete e[n];continue}for(var i=vr(n.split(" "),Ps),a=0;a<i.length;a++){var o=void 0,l=void 0;a==i.length-1?(l=i.join(" "),o=r):(l=i.slice(0,a+1).join(" "),o="...");var s=t[l];if(!s)t[l]=o;else if(s!=o)throw new Error("Inconsistent bindings for "+l)}delete e[n]}for(var u in t)e[u]=t[u];return e}function _i(e,t,n,r){t=Ua(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return"nothing";if(i==="...")return"multi";if(i!=null&&n(i))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return _i(e,t.fallthrough,n,r);for(var a=0;a<t.fallthrough.length;a++){var o=_i(e,t.fallthrough[a],n,r);if(o)return o}}}function Cl(e){var t=typeof e=="string"?e:Ei[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function wl(e,t,n){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(W?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(W?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!n&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function xl(e,t){if(h&&e.keyCode==34&&e.char)return!1;var n=Ei[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),wl(n,e,t))}function Ua(e){return typeof e=="string"?hi[e]:e}function Xi(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var a=t(n[i]);r.length&&P(a.from,Oe(r).to)<=0;){var o=r.pop();if(P(o.from,a.from)<0){a.from=o.from;break}}r.push(a)}_n(e,function(){for(var l=r.length-1;l>=0;l--)Gi(e.doc,"",r[l].from,r[l].to,"+delete");zi(e)})}function po(e,t,n){var r=oe(e.text,t+n,n);return r<0||r>e.text.length?null:r}function mo(e,t,n){var r=po(e,t.ch,n);return r==null?null:new g(t.line,r,n<0?"after":"before")}function yo(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var a=k(n,t.doc.direction);if(a){var o=i<0?Oe(a):a[0],l=i<0==(o.level==1),s=l?"after":"before",u;if(o.level>0||t.doc.direction=="rtl"){var f=pi(t,n);u=i<0?n.text.length-1:0;var c=ei(t,f,u).top;u=$(function(S){return ei(t,f,S).top==c},i<0==(o.level==1)?o.from:o.to-1,u),s=="before"&&(u=po(n,u,1))}else u=i<0?o.to:o.from;return new g(r,u,s)}}return new g(r,i<0?n.text.length:0,i<0?"before":"after")}function Os(e,t,n,r){var i=k(t,e.doc.direction);if(!i)return mo(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var a=ne(i,n.ch,n.sticky),o=i[a];if(e.doc.direction=="ltr"&&o.level%2==0&&(r>0?o.to>n.ch:o.from<n.ch))return mo(t,n,r);var l=function(we,ke){return po(t,we instanceof g?we.ch:we,ke)},s,u=function(we){return e.options.lineWrapping?(s=s||pi(e,t),nn(e,t,s,we)):{begin:0,end:t.text.length}},f=u(n.sticky=="before"?l(n,-1):n.ch);if(e.doc.direction=="rtl"||o.level==1){var c=o.level==1==r<0,S=l(n,c?1:-1);if(S!=null&&(c?S<=o.to&&S<=f.end:S>=o.from&&S>=f.begin)){var y=c?"before":"after";return new g(n.line,S,y)}}var L=function(we,ke,xe){for(var Be=function(Hr,pn){return pn?new g(n.line,l(Hr,1),"before"):new g(n.line,Hr,"after")};we>=0&&we<i.length;we+=ke){var ft=i[we],rt=ke>0==(ft.level!=1),Vt=rt?xe.begin:l(xe.end,-1);if(ft.from<=Vt&&Vt<ft.to||(Vt=rt?ft.from:l(ft.to,-1),xe.begin<=Vt&&Vt<xe.end))return Be(Vt,rt)}},_=L(a+r,r,f);if(_)return _;var se=r>0?f.end:l(f.begin,-1);return se!=null&&!(r>0&&se==t.text.length)&&(_=L(r>0?0:i.length-1,r,u(se)),_)?_:null}var ya={selectAll:ll,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ee)},killLine:function(e){return Xi(e,function(t){if(t.empty()){var n=Y(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:g(t.head.line+1,0)}:{from:t.head,to:g(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Xi(e,function(t){return{from:g(t.from().line,0),to:J(e.doc,g(t.to().line+1,0))}})},delLineLeft:function(e){return Xi(e,function(t){return{from:g(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Xi(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return Xi(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},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(g(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(g(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return El(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Ml(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Is(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},Fe)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},Fe)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?Ml(e,t.head):r},Fe)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var a=n[i].from(),o=ue(e.getLine(a.line),a.ch,r);t.push(bt(r-o%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return _n(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,a=Y(e.doc,i.line).text;if(a){if(i.ch==a.length&&(i=new g(i.line,i.ch-1)),i.ch>0)i=new g(i.line,i.ch+1),e.replaceRange(a.charAt(i.ch-1)+a.charAt(i.ch-2),g(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var o=Y(e.doc,i.line-1).text;o&&(i=new g(i.line,1),e.replaceRange(a.charAt(0)+e.doc.lineSeparator()+o.charAt(o.length-1),g(i.line-1,o.length-1),i,"+transpose"))}}n.push(new Nr(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return _n(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);zi(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function El(e,t){var n=Y(e.doc,t),r=me(n);return r!=n&&(t=d(r)),yo(!0,e,r,t,1)}function Is(e,t){var n=Y(e.doc,t),r=qe(n);return r!=n&&(t=d(r)),yo(!0,e,n,t,-1)}function Ml(e,t){var n=El(e,t.line),r=Y(e.doc,n.line),i=k(r,e.doc.direction);if(!i||i[0].level==0){var a=Math.max(n.ch,r.text.search(/\S/)),o=t.line==n.line&&t.ch<=a&&t.ch;return g(n.line,o?0:a,n.sticky)}return n}function Ga(e,t,n){if(typeof t=="string"&&(t=ya[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=Ve}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function As(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=_i(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&_i(t,e.options.extraKeys,n,e)||_i(t,e.options.keyMap,n,e)}var ks=new Ne;function ba(e,t,n,r){var i=e.state.keySeq;if(i){if(Cl(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:ks.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),Ll(e,i+" "+t,n,r))return!0}return Ll(e,t,n,r)}function Ll(e,t,n,r){var i=As(e,t,r);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&Zr(e,"keyHandled",e,t,n),(i=="handled"||i=="multi")&&($e(n),eo(e)),!!i}function Rl(e,t){var n=xl(t,!0);return n?t.shiftKey&&!e.state.keySeq?ba(e,"Shift-"+n,t,function(r){return Ga(e,r,!0)})||ba(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return Ga(e,r)}):ba(e,n,t,function(r){return Ga(e,r)}):!1}function Zs(e,t,n){return ba(e,"'"+n+"'",t,function(r){return Ga(e,r,!0)})}var bo=null;function Tl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=E(),!Le(t,e))){R&&te<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=Rl(t,e);h&&(bo=r?n:null,!r&&n==88&&!dt&&(lt?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),B&&!lt&&!r&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fs(t)}}function Fs(e){var t=e.display.lineDiv;Z(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(re(t,"CodeMirror-crosshair"),ge(document,"keyup",n),ge(document,"mouseover",n))}K(document,"keyup",n),K(document,"mouseover",n)}function Dl(e){e.keyCode==16&&(this.doc.sel.shift=!1),Le(this,e)}function Pl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(zt(t.display,e)||Le(t,e)||e.ctrlKey&&!e.altKey||lt&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(h&&n==bo){bo=null,$e(e);return}if(!(h&&(!e.which||e.which<10)&&Rl(t,e))){var i=String.fromCharCode(r==null?n:r);i!="\b"&&(Zs(t,e,i)||t.display.input.onKeyPress(e))}}}var Ws=400,So=function(e,t,n){this.time=e,this.pos=t,this.button=n};So.prototype.compare=function(e,t,n){return this.time+Ws>e&&P(t,this.pos)==0&&n==this.button};var Sa,Ca;function zs(e,t){var n=+new Date;return Ca&&Ca.compare(n,e,t)?(Sa=Ca=null,"triple"):Sa&&Sa.compare(n,e,t)?(Ca=new So(n,e,t),Sa=null,"double"):(Sa=new So(n,e,t),Ca=null,"single")}function Nl(e){var t=this,n=t.display;if(!(Le(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,zt(n,e)){ae||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!Co(t,e)){var r=Ri(t,e),i=et(e),a=r?zs(r,i):"single";window.focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&Hs(t,i,r,a,e))&&(i==1?r?Ks(t,r,a,e):Rr(e)==n.scroller&&$e(e):i==2?(r&&Wa(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(pt?t.display.input.onContextMenu(e):Oo(t)))}}}function Hs(e,t,n,r,i){var a="Click";return r=="double"?a="Double"+a:r=="triple"&&(a="Triple"+a),a=(t==1?"Left":t==2?"Middle":"Right")+a,ba(e,wl(a,i),i,function(o){if(typeof o=="string"&&(o=ya[o]),!o)return!1;var l=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),l=o(e,n)!=Ve}finally{e.state.suppressEdits=!1}return l})}function Bs(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var a=Lt?n.shiftKey&&n.metaKey:n.altKey;i.unit=a?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew==null&&(i.addNew=lt?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(lt?n.altKey:n.ctrlKey)),i}function Ks(e,t,n,r){R?setTimeout(Ie(No,e),0):e.curOp.focus=E();var i=Bs(e,n,r),a=e.doc.sel,o;e.options.dragDrop&&nt&&!e.isReadOnly()&&n=="single"&&(o=a.contains(t))>-1&&(P((o=a.ranges[o]).from(),t)<0||t.xRel>0)&&(P(o.to(),t)>0||t.xRel<0)?Us(e,r,t,i):Gs(e,r,t,i)}function Us(e,t,n,r){var i=e.display,a=!1,o=hn(e,function(u){ae&&(i.scroller.draggable=!1),e.state.draggingText=!1,ge(i.wrapper.ownerDocument,"mouseup",o),ge(i.wrapper.ownerDocument,"mousemove",l),ge(i.scroller,"dragstart",s),ge(i.scroller,"drop",o),a||($e(u),r.addNew||Wa(e.doc,n,null,null,r.extend),ae&&!We||R&&te==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),l=function(u){a=a||Math.abs(t.clientX-u.clientX)+Math.abs(t.clientY-u.clientY)>=10},s=function(){return a=!0};ae&&(i.scroller.draggable=!0),e.state.draggingText=o,o.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),K(i.wrapper.ownerDocument,"mouseup",o),K(i.wrapper.ownerDocument,"mousemove",l),K(i.scroller,"dragstart",s),K(i.scroller,"drop",o),Oo(e),setTimeout(function(){return i.input.focus()},20)}function Ol(e,t,n){if(n=="char")return new Nr(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Nr(g(t.line,0),J(e.doc,g(t.line+1,0)));var r=n(e,t);return new Nr(r.from,r.to)}function Gs(e,t,n,r){var i=e.display,a=e.doc;$e(t);var o,l,s=a.sel,u=s.ranges;if(r.addNew&&!r.extend?(l=a.sel.contains(n),l>-1?o=u[l]:o=new Nr(n,n)):(o=a.sel.primary(),l=a.sel.primIndex),r.unit=="rectangle")r.addNew||(o=new Nr(n,n)),n=Ri(e,t,!0,!0),l=-1;else{var f=Ol(e,n,r.unit);r.extend?o=ho(o,f.anchor,f.head,r.extend):o=f}r.addNew?l==-1?(l=u.length,Rn(a,li(e,u.concat([o]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&r.unit=="char"&&!r.extend?(Rn(a,li(e,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),s=a.sel):go(a,l,o,Ke):(l=0,Rn(a,new Qn([o],0),Ke),s=a.sel);var c=n;function S(xe){if(P(c,xe)!=0)if(c=xe,r.unit=="rectangle"){for(var Be=[],ft=e.options.tabSize,rt=ue(Y(a,n.line).text,n.ch,ft),Vt=ue(Y(a,xe.line).text,xe.ch,ft),Hr=Math.min(rt,Vt),pn=Math.max(rt,Vt),Qr=Math.min(n.line,xe.line),Xn=Math.min(e.lastLine(),Math.max(n.line,xe.line));Qr<=Xn;Qr++){var Zn=Y(a,Qr).text,ln=Ot(Zn,Hr,ft);Hr==pn?Be.push(new Nr(g(Qr,ln),g(Qr,ln))):Zn.length>ln&&Be.push(new Nr(g(Qr,ln),g(Qr,Ot(Zn,pn,ft))))}Be.length||Be.push(new Nr(n,n)),Rn(a,li(e,s.ranges.slice(0,l).concat(Be),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(xe)}else{var Fn=o,wn=Ol(e,xe,r.unit),vn=Fn.anchor,sn;P(wn.anchor,vn)>0?(sn=wn.head,vn=Ce(Fn.from(),wn.anchor)):(sn=wn.anchor,vn=Re(Fn.to(),wn.head));var en=s.ranges.slice(0);en[l]=Vs(e,new Nr(J(a,vn),sn)),Rn(a,li(e,en,l),Ke)}}var y=i.wrapper.getBoundingClientRect(),L=0;function _(xe){var Be=++L,ft=Ri(e,xe,!0,r.unit=="rectangle");if(ft)if(P(ft,c)!=0){e.curOp.focus=E(),S(ft);var rt=Oa(i,a);(ft.line>=rt.to||ft.line<rt.from)&&setTimeout(hn(e,function(){L==Be&&_(xe)}),150)}else{var Vt=xe.clientY<y.top?-20:xe.clientY>y.bottom?20:0;Vt&&setTimeout(hn(e,function(){L==Be&&(i.scroller.scrollTop+=Vt,_(xe))}),50)}}function se(xe){e.state.selectingText=!1,L=1/0,xe&&($e(xe),i.input.focus()),ge(i.wrapper.ownerDocument,"mousemove",we),ge(i.wrapper.ownerDocument,"mouseup",ke),a.history.lastSelOrigin=null}var we=hn(e,function(xe){xe.buttons===0||!et(xe)?se(xe):_(xe)}),ke=hn(e,se);e.state.selectingText=ke,K(i.wrapper.ownerDocument,"mousemove",we),K(i.wrapper.ownerDocument,"mouseup",ke)}function Vs(e,t){var n=t.anchor,r=t.head,i=Y(e.doc,n.line);if(P(n,r)==0&&n.sticky==r.sticky)return t;var a=k(i);if(!a)return t;var o=ne(a,n.ch,n.sticky),l=a[o];if(l.from!=n.ch&&l.to!=n.ch)return t;var s=o+(l.from==n.ch==(l.level!=1)?0:1);if(s==0||s==a.length)return t;var u;if(r.line!=n.line)u=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var f=ne(a,r.ch,r.sticky),c=f-o||(r.ch-n.ch)*(l.level==1?-1:1);f==s-1||f==s?u=c<0:u=c>0}var S=a[s+(u?-1:0)],y=u==(S.level==1),L=y?S.from:S.to,_=y?"after":"before";return n.ch==L&&n.sticky==_?t:new Nr(new g(n.line,L,_),r)}function Il(e,t,n,r){var i,a;if(t.touches)i=t.touches[0].clientX,a=t.touches[0].clientY;else try{i=t.clientX,a=t.clientY}catch(S){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&$e(t);var o=e.display,l=o.lineDiv.getBoundingClientRect();if(a>l.bottom||!Xe(e,n))return Sr(t);a-=l.top-o.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var u=o.gutters.childNodes[s];if(u&&u.getBoundingClientRect().right>=i){var f=v(e.doc,a),c=e.display.gutterSpecs[s];return De(e,n,e,f,c.className,t),Sr(t)}}}function Co(e,t){return Il(e,t,"gutterClick",!0)}function Al(e,t){zt(e.display,t)||_s(e,t)||Le(e,t,"contextmenu")||pt||e.display.input.onContextMenu(t)}function _s(e,t){return Xe(e,"gutterContextMenu")?Il(e,t,"gutterContextMenu",!1):!1}function kl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Li(e)}var ji={toString:function(){return"CodeMirror.Init"}},Zl={},Va={};function Xs(e){var t=e.optionHandlers;function n(r,i,a,o){e.defaults[r]=i,a&&(t[r]=o?function(l,s,u){u!=ji&&a(l,s,u)}:a)}e.defineOption=n,e.Init=ji,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,fo(r)},!0),n("indentUnit",2,fo,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){ua(r),Li(r),An(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!!i){var a=[],o=r.doc.first;r.doc.iter(function(s){for(var u=0;;){var f=s.text.indexOf(i,u);if(f==-1)break;u=f+i.length,a.push(g(o,f))}o++});for(var l=a.length-1;l>=0;l--)Gi(r.doc,i,a[l],g(a[l].line,a[l].ch+i.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,i,a){r.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),a!=ji&&r.refresh()}),n("specialCharPlaceholder",jn,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",Mt?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,i){return r.getInputField().spellcheck=i},!0),n("autocorrect",!1,function(r,i){return r.getInputField().autocorrect=i},!0),n("autocapitalize",!1,function(r,i){return r.getInputField().autocapitalize=i},!0),n("rtlMoveVisually",!st),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){kl(r),sa(r)},!0),n("keyMap","default",function(r,i,a){var o=Ua(i),l=a!=ji&&Ua(a);l&&l.detach&&l.detach(r,o),o.attach&&o.attach(r,l||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ys,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=so(i,r.options.lineNumbers),sa(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?$a(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return Hi(r)},!0),n("scrollbarStyle","native",function(r){Wo(r),Hi(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,i){r.display.gutterSpecs=so(r.options.gutters,i),sa(r)},!0),n("firstLineNumber",1,sa,!0),n("lineNumberFormatter",function(r){return r},sa,!0),n("showCursorWhenSelecting",!1,ra,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(Wi(r),r.display.input.blur()),r.display.input.readOnlyChanged(i)}),n("screenReaderLabel",null,function(r,i){i=i===""?null:i,r.display.input.screenReaderLabelChanged(i)}),n("disableInput",!1,function(r,i){i||r.display.input.reset()},!0),n("dragDrop",!0,js),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,ra,!0),n("singleCursorHeightPerLine",!0,ra,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,ua,!0),n("addModeClass",!1,ua,!0),n("pollInterval",100),n("undoDepth",200,function(r,i){return r.doc.history.undoDepth=i}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,ua,!0),n("moveInputWithCursor",!0,function(r,i){i||r.display.input.resetPosition()}),n("tabindex",null,function(r,i){return r.display.input.getField().tabIndex=i||""}),n("autofocus",null),n("direction","ltr",function(r,i){return r.doc.setDirection(i)},!0),n("phrases",null)}function js(e,t,n){var r=n&&n!=ji;if(!t!=!r){var i=e.display.dragFunctions,a=t?K:ge;a(e.display.scroller,"dragstart",i.start),a(e.display.scroller,"dragenter",i.enter),a(e.display.scroller,"dragover",i.over),a(e.display.scroller,"dragleave",i.leave),a(e.display.scroller,"drop",i.drop)}}function Ys(e){e.options.lineWrapping?(Z(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(re(e.display.wrapper,"CodeMirror-wrap"),yr(e)),qa(e),An(e),Li(e),setTimeout(function(){return Hi(e)},100)}function _r(e,t){var n=this;if(!(this instanceof _r))return new _r(e,t);this.options=t=t?M(t):{},M(Zl,t,!1);var r=t.value;typeof r=="string"?r=new kn(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new _r.inputStyles[t.inputStyle](this),a=this.display=new ss(e,r,i,t);a.wrapper.CodeMirror=this,kl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Wo(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 Ne,keySeq:null,specialChars:null},t.autofocus&&!Mt&&a.input.focus(),R&&te<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Js(this),Rs(),Ni(this),this.curOp.forceUpdate=!0,jo(this,r),t.autofocus&&!Mt||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&to(n)},20):Wi(this);for(var o in Va)Va.hasOwnProperty(o)&&Va[o](this,t[o],ji);Bo(this),t.finishInit&&t.finishInit(this);for(var l=0;l<wo.length;++l)wo[l](this);Oi(this),ae&&t.lineWrapping&&getComputedStyle(a.lineDiv).textRendering=="optimizelegibility"&&(a.lineDiv.style.textRendering="auto")}_r.defaults=Zl,_r.optionHandlers=Va;function Js(e){var t=e.display;K(t.scroller,"mousedown",hn(e,Nl)),R&&te<11?K(t.scroller,"dblclick",hn(e,function(s){if(!Le(e,s)){var u=Ri(e,s);if(!(!u||Co(e,s)||zt(e.display,s))){$e(s);var f=e.findWordAt(u);Wa(e.doc,f.anchor,f.head)}}})):K(t.scroller,"dblclick",function(s){return Le(e,s)||$e(s)}),K(t.scroller,"contextmenu",function(s){return Al(e,s)}),K(t.input.getField(),"contextmenu",function(s){t.scroller.contains(s.target)||Al(e,s)});var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function a(s){if(s.touches.length!=1)return!1;var u=s.touches[0];return u.radiusX<=1&&u.radiusY<=1}function o(s,u){if(u.left==null)return!0;var f=u.left-s.left,c=u.top-s.top;return f*f+c*c>20*20}K(t.scroller,"touchstart",function(s){if(!Le(e,s)&&!a(s)&&!Co(e,s)){t.input.ensurePolled(),clearTimeout(n);var u=+new Date;t.activeTouch={start:u,moved:!1,prev:u-r.end<=300?r:null},s.touches.length==1&&(t.activeTouch.left=s.touches[0].pageX,t.activeTouch.top=s.touches[0].pageY)}}),K(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),K(t.scroller,"touchend",function(s){var u=t.activeTouch;if(u&&!zt(t,s)&&u.left!=null&&!u.moved&&new Date-u.start<300){var f=e.coordsChar(t.activeTouch,"page"),c;!u.prev||o(u,u.prev)?c=new Nr(f,f):!u.prev.prev||o(u,u.prev.prev)?c=e.findWordAt(f):c=new Nr(g(f.line,0),J(e.doc,g(f.line+1,0))),e.setSelection(c.anchor,c.head),e.focus(),$e(s)}i()}),K(t.scroller,"touchcancel",i),K(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ia(e,t.scroller.scrollTop),Di(e,t.scroller.scrollLeft,!0),De(e,"scroll",e))}),K(t.scroller,"mousewheel",function(s){return Go(e,s)}),K(t.scroller,"DOMMouseScroll",function(s){return Go(e,s)}),K(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(s){Le(e,s)||er(s)},over:function(s){Le(e,s)||(Ls(e,s),er(s))},start:function(s){return Ms(e,s)},drop:hn(e,Es),leave:function(s){Le(e,s)||yl(e)}};var l=t.input.getField();K(l,"keyup",function(s){return Dl.call(e,s)}),K(l,"keydown",hn(e,Tl)),K(l,"keypress",hn(e,Pl)),K(l,"focus",function(s){return to(e,s)}),K(l,"blur",function(s){return Wi(e,s)})}var wo=[];_r.defineInitHook=function(e){return wo.push(e)};function wa(e,t,n,r){var i=e.doc,a;n==null&&(n="add"),n=="smart"&&(i.mode.indent?a=Ft(e,t).state:n="prev");var o=e.options.tabSize,l=Y(i,t),s=ue(l.text,null,o);l.stateAfter&&(l.stateAfter=null);var u=l.text.match(/^\s*/)[0],f;if(!r&&!/\S/.test(l.text))f=0,n="not";else if(n=="smart"&&(f=i.mode.indent(a,l.text.slice(u.length),l.text),f==Ve||f>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?f=ue(Y(i,t-1).text,null,o):f=0:n=="add"?f=s+e.options.indentUnit:n=="subtract"?f=s-e.options.indentUnit:typeof n=="number"&&(f=s+n),f=Math.max(0,f);var c="",S=0;if(e.options.indentWithTabs)for(var y=Math.floor(f/o);y;--y)S+=o,c+=" ";if(S<f&&(c+=bt(f-S)),c!=u)return Gi(i,c,g(t,0),g(t,u.length),"+input"),l.stateAfter=null,!0;for(var L=0;L<i.sel.ranges.length;L++){var _=i.sel.ranges[L];if(_.head.line==t&&_.head.ch<u.length){var se=g(t,u.length);go(i,L,new Nr(se,se));break}}}var si=null;function _a(e){si=e}function xo(e,t,n,r,i){var a=e.doc;e.display.shift=!1,r||(r=a.sel);var o=+new Date-200,l=i=="paste"||e.state.pasteIncoming>o,s=wt(t),u=null;if(l&&r.ranges.length>1)if(si&&si.text.join(`
|
|
`)==t){if(r.ranges.length%si.text.length==0){u=[];for(var f=0;f<si.text.length;f++)u.push(a.splitLines(si.text[f]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(u=vr(s,function(we){return[we]}));for(var c=e.curOp.updateInput,S=r.ranges.length-1;S>=0;S--){var y=r.ranges[S],L=y.from(),_=y.to();y.empty()&&(n&&n>0?L=g(L.line,L.ch-n):e.state.overwrite&&!l?_=g(_.line,Math.min(Y(a,_.line).text.length,_.ch+Oe(s).length)):l&&si&&si.lineWise&&si.text.join(`
|
|
`)==s.join(`
|
|
`)&&(L=_=g(L.line,0)));var se={from:L,to:_,text:u?u[S%u.length]:s,origin:i||(l?"paste":e.state.cutIncoming>o?"cut":"+input")};Ui(e.doc,se),Zr(e,"inputRead",e,se)}t&&!l&&Wl(e,t),zi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=c),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Fl(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&_n(t,function(){return xo(t,n,0,null,"paste")}),!0}function Wl(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var a=e.getModeAt(i.head),o=!1;if(a.electricChars){for(var l=0;l<a.electricChars.length;l++)if(t.indexOf(a.electricChars.charAt(l))>-1){o=wa(e,i.head.line,"smart");break}}else a.electricInput&&a.electricInput.test(Y(e.doc,i.head.line).text.slice(0,i.head.ch))&&(o=wa(e,i.head.line,"smart"));o&&Zr(e,"electricInput",e,i.head.line)}}}function zl(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,a={anchor:g(i,0),head:g(i+1,0)};n.push(a),t.push(e.getRange(a.anchor,a.head))}return{text:t,ranges:n}}function Hl(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Bl(){var e=Q("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=Q("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return ae?e.style.width="1000px":e.setAttribute("wrap","off"),T&&(e.style.border="1px solid black"),Hl(e),t}function Qs(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(r,i){var a=this.options,o=a[r];a[r]==i&&r!="mode"||(a[r]=i,t.hasOwnProperty(r)&&hn(this,t[r])(this,i,o),De(this,"optionChange",this,r))},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,i){this.state.keyMaps[i?"push":"unshift"](Ua(r))},removeKeyMap:function(r){for(var i=this.state.keyMaps,a=0;a<i.length;++a)if(i[a]==r||i[a].name==r)return i.splice(a,1),!0},addOverlay:Dn(function(r,i){var a=r.token?r:e.getMode(this.options,r);if(a.startState)throw new Error("Overlays may not be stateful.");rr(this.state.overlays,{mode:a,modeSpec:r,opaque:i&&i.opaque,priority:i&&i.priority||0},function(o){return o.priority}),this.state.modeGen++,An(this)}),removeOverlay:Dn(function(r){for(var i=this.state.overlays,a=0;a<i.length;++a){var o=i[a].modeSpec;if(o==r||typeof r=="string"&&o.name==r){i.splice(a,1),this.state.modeGen++,An(this);return}}}),indentLine:Dn(function(r,i,a){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),F(this.doc,r)&&wa(this,r,i,a)}),indentSelection:Dn(function(r){for(var i=this.doc.sel.ranges,a=-1,o=0;o<i.length;o++){var l=i[o];if(l.empty())l.head.line>a&&(wa(this,l.head.line,r,!0),a=l.head.line,o==this.doc.sel.primIndex&&zi(this));else{var s=l.from(),u=l.to(),f=Math.max(a,s.line);a=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var c=f;c<a;++c)wa(this,c,r);var S=this.doc.sel.ranges;s.ch==0&&i.length==S.length&&S[o].from().ch>0&&go(this.doc,o,new Nr(s,S[o].to()),Ee)}}}),getTokenAt:function(r,i){return Cr(this,r,i)},getLineTokens:function(r,i){return Cr(this,g(r),i,!0)},getTokenTypeAt:function(r){r=J(this.doc,r);var i=Et(this,Y(this.doc,r.line)),a=0,o=(i.length-1)/2,l=r.ch,s;if(l==0)s=i[2];else for(;;){var u=a+o>>1;if((u?i[u*2-1]:0)>=l)o=u;else if(i[u*2+1]<l)a=u+1;else{s=i[u*2+2];break}}var f=s?s.indexOf("overlay "):-1;return f<0?s:f==0?null:s.slice(0,f-1)},getModeAt:function(r){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(r).state).mode:i},getHelper:function(r,i){return this.getHelpers(r,i)[0]},getHelpers:function(r,i){var a=[];if(!n.hasOwnProperty(i))return a;var o=n[i],l=this.getModeAt(r);if(typeof l[i]=="string")o[l[i]]&&a.push(o[l[i]]);else if(l[i])for(var s=0;s<l[i].length;s++){var u=o[l[i][s]];u&&a.push(u)}else l.helperType&&o[l.helperType]?a.push(o[l.helperType]):o[l.name]&&a.push(o[l.name]);for(var f=0;f<o._global.length;f++){var c=o._global[f];c.pred(l,this)&&fe(a,c.val)==-1&&a.push(c.val)}return a},getStateAfter:function(r,i){var a=this.doc;return r=He(a,r==null?a.first+a.size-1:r),Ft(this,r+1,i).state},cursorCoords:function(r,i){var a,o=this.doc.sel.primary();return r==null?a=o.head:typeof r=="object"?a=J(this.doc,r):a=r?o.from():o.to(),In(this,a,i||"page")},charCoords:function(r,i){return Fi(this,J(this.doc,r),i||"page")},coordsChar:function(r,i){return r=Ta(this,r,i||"page"),Cn(this,r.left,r.top)},lineAtHeight:function(r,i){return r=Ta(this,{top:r,left:0},i||"page").top,v(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,i,a){var o=!1,l;if(typeof r=="number"){var s=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>s&&(r=s,o=!0),l=Y(this.doc,r)}else l=r;return Zi(this,l,{top:0,left:0},i||"page",a||o).top+(o?this.doc.height-Ar(l):0)},defaultTextHeight:function(){return Vn(this.display)},defaultCharWidth:function(){return oi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,a,o,l){var s=this.display;r=In(this,J(this.doc,r));var u=r.bottom,f=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),s.sizer.appendChild(i),o=="over")u=r.top;else if(o=="above"||o=="near"){var c=Math.max(s.wrapper.clientHeight,this.doc.height),S=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);(o=="above"||r.bottom+i.offsetHeight>c)&&r.top>i.offsetHeight?u=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=c&&(u=r.bottom),f+i.offsetWidth>S&&(f=S-i.offsetWidth)}i.style.top=u+"px",i.style.left=i.style.right="",l=="right"?(f=s.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(l=="left"?f=0:l=="middle"&&(f=(s.sizer.clientWidth-i.offsetWidth)/2),i.style.left=f+"px"),a&&jl(this,{left:f,top:u,right:f+i.offsetWidth,bottom:u+i.offsetHeight})},triggerOnKeyDown:Dn(Tl),triggerOnKeyPress:Dn(Pl),triggerOnKeyUp:Dl,triggerOnMouseDown:Dn(Nl),execCommand:function(r){if(ya.hasOwnProperty(r))return ya[r].call(null,this)},triggerElectric:Dn(function(r){Wl(this,r)}),findPosH:function(r,i,a,o){var l=1;i<0&&(l=-1,i=-i);for(var s=J(this.doc,r),u=0;u<i&&(s=Eo(this.doc,s,l,a,o),!s.hitSide);++u);return s},moveH:Dn(function(r,i){var a=this;this.extendSelectionsBy(function(o){return a.display.shift||a.doc.extend||o.empty()?Eo(a.doc,o.head,r,i,a.options.rtlMoveVisually):r<0?o.from():o.to()},Fe)}),deleteH:Dn(function(r,i){var a=this.doc.sel,o=this.doc;a.somethingSelected()?o.replaceSelection("",null,"+delete"):Xi(this,function(l){var s=Eo(o,l.head,r,i,!1);return r<0?{from:s,to:l.head}:{from:l.head,to:s}})}),findPosV:function(r,i,a,o){var l=1,s=o;i<0&&(l=-1,i=-i);for(var u=J(this.doc,r),f=0;f<i;++f){var c=In(this,u,"div");if(s==null?s=c.left:c.left=s,u=Kl(this,c,l,a),u.hitSide)break}return u},moveV:Dn(function(r,i){var a=this,o=this.doc,l=[],s=!this.display.shift&&!o.extend&&o.sel.somethingSelected();if(o.extendSelectionsBy(function(f){if(s)return r<0?f.from():f.to();var c=In(a,f.head,"div");f.goalColumn!=null&&(c.left=f.goalColumn),l.push(c.left);var S=Kl(a,c,r,i);return i=="page"&&f==o.sel.primary()&&no(a,Fi(a,S,"div").top-c.top),S},Fe),l.length)for(var u=0;u<o.sel.ranges.length;u++)o.sel.ranges[u].goalColumn=l[u]}),findWordAt:function(r){var i=this.doc,a=Y(i,r.line).text,o=r.ch,l=r.ch;if(a){var s=this.getHelper(r,"wordChars");(r.sticky=="before"||l==a.length)&&o?--o:++l;for(var u=a.charAt(o),f=w(u,s)?function(c){return w(c,s)}:/\s/.test(u)?function(c){return/\s/.test(c)}:function(c){return!/\s/.test(c)&&!w(c)};o>0&&f(a.charAt(o-1));)--o;for(;l<a.length&&f(a.charAt(l));)++l}return new Nr(g(r.line,o),g(r.line,l))},toggleOverwrite:function(r){r!=null&&r==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Z(this.display.cursorDiv,"CodeMirror-overwrite"):re(this.display.cursorDiv,"CodeMirror-overwrite"),De(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==E()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Dn(function(r,i){na(this,r,i)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Sn(this)-this.display.barHeight,width:r.scrollWidth-Sn(this)-this.display.barWidth,clientHeight:Un(this),clientWidth:Yn(this)}},scrollIntoView:Dn(function(r,i){r==null?(r={from:this.doc.sel.primary().head,to:null},i==null&&(i=this.options.cursorScrollMargin)):typeof r=="number"?r={from:g(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=i||0,r.from.line!=null?Yl(this,r):Ao(this,r.from,r.to,r.margin)}),setSize:Dn(function(r,i){var a=this,o=function(s){return typeof s=="number"||/^\d+$/.test(String(s))?s+"px":s};r!=null&&(this.display.wrapper.style.width=o(r)),i!=null&&(this.display.wrapper.style.height=o(i)),this.options.lineWrapping&&qi(this);var l=this.display.viewFrom;this.doc.iter(l,this.display.viewTo,function(s){if(s.widgets){for(var u=0;u<s.widgets.length;u++)if(s.widgets[u].noHScroll){yi(a,l,"widget");break}}++l}),this.curOp.forceUpdate=!0,De(this,"refresh",this)}),operation:function(r){return _n(this,r)},startOperation:function(){return Ni(this)},endOperation:function(){return Oi(this)},refresh:Dn(function(){var r=this.display.cachedTextHeight;An(this),this.curOp.forceUpdate=!0,Li(this),na(this,this.doc.scrollLeft,this.doc.scrollTop),oo(this.display),(r==null||Math.abs(r-Vn(this.display))>.5||this.options.lineWrapping)&&qa(this),De(this,"refresh",this)}),swapDoc:Dn(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),jo(this,r),Li(this),this.display.input.reset(),na(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,Zr(this,"swapDoc",this,i),i}),phrase:function(r){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,r)?i[r]:r},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}},Se(e),e.registerHelper=function(r,i,a){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=a},e.registerGlobalHelper=function(r,i,a,o){e.registerHelper(r,i,o),n[r]._global.push({pred:a,val:o})}}function Eo(e,t,n,r,i){var a=t,o=n,l=Y(e,t.line),s=i&&e.direction=="rtl"?-n:n;function u(){var ke=t.line+s;return ke<e.first||ke>=e.first+e.size?!1:(t=new g(ke,t.ch,t.sticky),l=Y(e,ke))}function f(ke){var xe;if(r=="codepoint"){var Be=l.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(Be)?xe=null:xe=new g(t.line,Math.max(0,Math.min(l.text.length,t.ch+n*(Be>=55296&&Be<56320?2:1))),-n)}else i?xe=Os(e.cm,l,t,n):xe=mo(l,t,n);if(xe==null)if(!ke&&u())t=yo(i,e.cm,l,t.line,s);else return!1;else t=xe;return!0}if(r=="char"||r=="codepoint")f();else if(r=="column")f(!0);else if(r=="word"||r=="group")for(var c=null,S=r=="group",y=e.cm&&e.cm.getHelper(t,"wordChars"),L=!0;!(n<0&&!f(!L));L=!1){var _=l.text.charAt(t.ch)||`
|
|
`,se=w(_,y)?"w":S&&_==`
|
|
`?"n":!S||/\s/.test(_)?null:"p";if(S&&!L&&!se&&(se="s"),c&&c!=se){n<0&&(n=1,f(),t.sticky="after");break}if(se&&(c=se),n>0&&!f(!L))break}var we=Ha(e,t,a,o,!0);return le(a,we)&&(we.hitSide=!0),we}function Kl(e,t,n,r){var i=e.doc,a=t.left,o;if(r=="page"){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),s=Math.max(l-.5*Vn(e.display),3);o=(n>0?t.bottom:t.top)+n*s}else r=="line"&&(o=n>0?t.bottom+3:t.top-3);for(var u;u=Cn(e,a,o),!!u.outside;){if(n<0?o<=0:o>=i.height){u.hitSide=!0;break}o+=n*5}return u}var Ir=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ne,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Ir.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;Hl(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function a(l){for(var s=l.target;s;s=s.parentNode){if(s==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(s.className))break}return!1}K(i,"paste",function(l){!a(l)||Le(r,l)||Fl(l,r)||te<=11&&setTimeout(hn(r,function(){return t.updateFromDOM()}),20)}),K(i,"compositionstart",function(l){t.composing={data:l.data,done:!1}}),K(i,"compositionupdate",function(l){t.composing||(t.composing={data:l.data,done:!1})}),K(i,"compositionend",function(l){t.composing&&(l.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),K(i,"touchstart",function(){return n.forceCompositionEnd()}),K(i,"input",function(){t.composing||t.readFromDOMSoon()});function o(l){if(!(!a(l)||Le(r,l))){if(r.somethingSelected())_a({lineWise:!1,text:r.getSelections()}),l.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var s=zl(r);_a({lineWise:!0,text:s.text}),l.type=="cut"&&r.operation(function(){r.setSelections(s.ranges,0,Ee),r.replaceSelection("",null,"cut")})}else return;if(l.clipboardData){l.clipboardData.clearData();var u=si.text.join(`
|
|
`);if(l.clipboardData.setData("Text",u),l.clipboardData.getData("Text")==u){l.preventDefault();return}}var f=Bl(),c=f.firstChild;r.display.lineSpace.insertBefore(f,r.display.lineSpace.firstChild),c.value=si.text.join(`
|
|
`);var S=document.activeElement;z(c),setTimeout(function(){r.display.lineSpace.removeChild(f),S.focus(),S==i&&n.showPrimarySelection()},50)}}K(i,"copy",o),K(i,"cut",o)},Ir.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ir.prototype.prepareSelection=function(){var e=Do(this.cm,!1);return e.focus=document.activeElement==this.div,e},Ir.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Ir.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ir.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line<t.display.viewFrom){e.removeAllRanges();return}var a=Xa(t,e.anchorNode,e.anchorOffset),o=Xa(t,e.focusNode,e.focusOffset);if(!(a&&!a.bad&&o&&!o.bad&&P(Ce(a,o),r)==0&&P(Re(a,o),i)==0)){var l=t.display.view,s=r.line>=t.display.viewFrom&&Ul(t,r)||{node:l[0].measure.map[2],offset:0},u=i.line<t.display.viewTo&&Ul(t,i);if(!u){var f=l[l.length-1].measure,c=f.maps?f.maps[f.maps.length-1]:f.map;u={node:c[c.length-1],offset:c[c.length-2]-c[c.length-3]}}if(!s||!u){e.removeAllRanges();return}var S=e.rangeCount&&e.getRangeAt(0),y;try{y=Rt(s.node,s.offset,u.offset,u.node)}catch(L){}y&&(!B&&t.state.focused?(e.collapse(s.node,s.offset),y.collapsed||(e.removeAllRanges(),e.addRange(y))):(e.removeAllRanges(),e.addRange(y)),S&&e.anchorNode==null?e.addRange(S):B&&this.startGracePeriod()),this.rememberSelection()}},Ir.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)},Ir.prototype.showMultipleSelections=function(e){Ge(this.cm.display.cursorDiv,e.cursors),Ge(this.cm.display.selectionDiv,e.selection)},Ir.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ir.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return O(this.div,t)},Ir.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ir.prototype.blur=function(){this.div.blur()},Ir.prototype.getField=function(){return this.div},Ir.prototype.supportsTouch=function(){return!0},Ir.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():_n(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},Ir.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ir.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(ht&&ee&&this.cm.display.gutterSpecs.length&&$s(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var n=Xa(t,e.anchorNode,e.anchorOffset),r=Xa(t,e.focusNode,e.focusOffset);n&&r&&_n(t,function(){Rn(t.doc,Si(n,r),Ee),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},Ir.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.ch==0&&r.line>e.firstLine()&&(r=g(r.line-1,Y(e.doc,r.line-1).length)),i.ch==Y(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=g(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var a,o,l;r.line==t.viewFrom||(a=Ti(e,r.line))==0?(o=d(t.view[0].line),l=t.view[0].node):(o=d(t.view[a].line),l=t.view[a-1].node.nextSibling);var s=Ti(e,i.line),u,f;if(s==t.view.length-1?(u=t.viewTo-1,f=t.lineDiv.lastChild):(u=d(t.view[s+1].line)-1,f=t.view[s+1].node.previousSibling),!l)return!1;for(var c=e.doc.splitLines(qs(e,l,f,o,u)),S=yt(e.doc,g(o,0),g(u,Y(e.doc,u).text.length));c.length>1&&S.length>1;)if(Oe(c)==Oe(S))c.pop(),S.pop(),u--;else if(c[0]==S[0])c.shift(),S.shift(),o++;else break;for(var y=0,L=0,_=c[0],se=S[0],we=Math.min(_.length,se.length);y<we&&_.charCodeAt(y)==se.charCodeAt(y);)++y;for(var ke=Oe(c),xe=Oe(S),Be=Math.min(ke.length-(c.length==1?y:0),xe.length-(S.length==1?y:0));L<Be&&ke.charCodeAt(ke.length-L-1)==xe.charCodeAt(xe.length-L-1);)++L;if(c.length==1&&S.length==1&&o==r.line)for(;y&&y>r.ch&&ke.charCodeAt(ke.length-L-1)==xe.charCodeAt(xe.length-L-1);)y--,L++;c[c.length-1]=ke.slice(0,ke.length-L).replace(/^\u200b+/,""),c[0]=c[0].slice(y).replace(/\u200b+$/,"");var ft=g(o,y),rt=g(u,S.length?Oe(S).length-L:0);if(c.length>1||c[0]||P(ft,rt))return Gi(e.doc,c,ft,rt,"+input"),!0},Ir.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ir.prototype.reset=function(){this.forceCompositionEnd()},Ir.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ir.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},Ir.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&_n(this.cm,function(){return An(e.cm)})},Ir.prototype.setUneditable=function(e){e.contentEditable="false"},Ir.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||hn(this.cm,xo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},Ir.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Ir.prototype.onContextMenu=function(){},Ir.prototype.resetPosition=function(){},Ir.prototype.needsContentAttribute=!0;function Ul(e,t){var n=fi(e,t.line);if(!n||n.hidden)return null;var r=Y(e.doc,t.line),i=ki(n,r,t.line),a=k(r,e.doc.direction),o="left";if(a){var l=ne(a,t.ch);o=l%2?"right":"left"}var s=Ma(i.map,t.ch,o);return s.offset=s.collapse=="right"?s.end:s.start,s}function $s(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Yi(e,t){return t&&(e.bad=!0),e}function qs(e,t,n,r,i){var a="",o=!1,l=e.doc.lineSeparator(),s=!1;function u(y){return function(L){return L.id==y}}function f(){o&&(a+=l,s&&(a+=l),o=s=!1)}function c(y){y&&(f(),a+=y)}function S(y){if(y.nodeType==1){var L=y.getAttribute("cm-text");if(L){c(L);return}var _=y.getAttribute("cm-marker"),se;if(_){var we=e.findMarks(g(r,0),g(i+1,0),u(+_));we.length&&(se=we[0].find(0))&&c(yt(e.doc,se.from,se.to).join(l));return}if(y.getAttribute("contenteditable")=="false")return;var ke=/^(pre|div|p|li|table|br)$/i.test(y.nodeName);if(!/^br$/i.test(y.nodeName)&&y.textContent.length==0)return;ke&&f();for(var xe=0;xe<y.childNodes.length;xe++)S(y.childNodes[xe]);/^(pre|p)$/i.test(y.nodeName)&&(s=!0),ke&&(o=!0)}else y.nodeType==3&&c(y.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;S(t),t!=n;)t=t.nextSibling,s=!1;return a}function Xa(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return Yi(e.clipPos(g(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var a=e.display.view[i];if(a.node==r)return eu(a,t,n)}}function eu(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!O(r,t))return Yi(g(d(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var a=e.rest?Oe(e.rest):e.line;return Yi(g(d(a),a.text.length),i)}var o=t.nodeType==3?t:null,l=t;for(!o&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(o=t.firstChild,n&&(n=o.nodeValue.length));l.parentNode!=r;)l=l.parentNode;var s=e.measure,u=s.maps;function f(se,we,ke){for(var xe=-1;xe<(u?u.length:0);xe++)for(var Be=xe<0?s.map:u[xe],ft=0;ft<Be.length;ft+=3){var rt=Be[ft+2];if(rt==se||rt==we){var Vt=d(xe<0?e.line:e.rest[xe]),Hr=Be[ft]+ke;return(ke<0||rt!=se)&&(Hr=Be[ft+(ke?1:0)]),g(Vt,Hr)}}}var c=f(o,l,n);if(c)return Yi(c,i);for(var S=l.nextSibling,y=o?o.nodeValue.length-n:0;S;S=S.nextSibling){if(c=f(S,S.firstChild,0),c)return Yi(g(c.line,c.ch-y),i);y+=S.textContent.length}for(var L=l.previousSibling,_=n;L;L=L.previousSibling){if(c=f(L,L.firstChild,-1),c)return Yi(g(c.line,c.ch+_),i);_+=L.textContent.length}}var an=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Ne,this.hasSelection=!1,this.composing=null};an.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),T&&(i.style.width="0px"),K(i,"input",function(){R&&te>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),K(i,"paste",function(o){Le(r,o)||Fl(o,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())});function a(o){if(!Le(r,o)){if(r.somethingSelected())_a({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var l=zl(r);_a({lineWise:!0,text:l.text}),o.type=="cut"?r.setSelections(l.ranges,null,Ee):(n.prevInput="",i.value=l.text.join(`
|
|
`),z(i))}else return;o.type=="cut"&&(r.state.cutIncoming=+new Date)}}K(i,"cut",a),K(i,"copy",a),K(e.scroller,"paste",function(o){if(!(zt(e,o)||Le(r,o))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var l=new Event("paste");l.clipboardData=o.clipboardData,i.dispatchEvent(l)}}),K(e.lineSpace,"selectstart",function(o){zt(e,o)||$e(o)}),K(i,"compositionstart",function(){var o=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:o,range:r.markText(o,r.getCursor("to"),{className:"CodeMirror-composing"})}}),K(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},an.prototype.createField=function(e){this.wrapper=Bl(),this.textarea=this.wrapper.firstChild},an.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},an.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Do(e);if(e.options.moveInputWithCursor){var i=In(e,n.sel.primary().head,"div"),a=t.wrapper.getBoundingClientRect(),o=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+o.top-a.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+o.left-a.left))}return r},an.prototype.showSelection=function(e){var t=this.cm,n=t.display;Ge(n.cursorDiv,e.cursors),Ge(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},an.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing)){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&z(this.textarea),R&&te>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",R&&te>=9&&(this.hasSelection=null))}},an.prototype.getField=function(){return this.textarea},an.prototype.supportsTouch=function(){return!1},an.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!Mt||E()!=this.textarea))try{this.textarea.focus()}catch(e){}},an.prototype.blur=function(){this.textarea.blur()},an.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},an.prototype.receivedFocus=function(){this.slowPoll()},an.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},an.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},an.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Jt(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(R&&te>=9&&this.hasSelection===i||lt&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var a=i.charCodeAt(0);if(a==8203&&!r&&(r="\u200B"),a==8666)return this.reset(),this.cm.execCommand("undo")}for(var o=0,l=Math.min(r.length,i.length);o<l&&r.charCodeAt(o)==i.charCodeAt(o);)++o;return _n(t,function(){xo(t,i.slice(o),r.length-o,null,e.composing?"*compose":null),i.length>1e3||i.indexOf(`
|
|
`)>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},an.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},an.prototype.onKeyPress=function(){R&&te>=9&&(this.hasSelection=null),this.fastPoll()},an.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var a=Ri(n,e),o=r.scroller.scrollTop;if(!a||h)return;var l=n.options.resetSelectionOnContextMenu;l&&n.doc.sel.contains(a)==-1&&hn(n,Rn)(n.doc,Si(a),Ee);var s=i.style.cssText,u=t.wrapper.style.cssText,f=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+`px;
|
|
z-index: 1000; background: `+(R?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var c;ae&&(c=window.scrollY),r.input.focus(),ae&&window.scrollTo(null,c),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=y,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function S(){if(i.selectionStart!=null){var _=n.somethingSelected(),se="\u200B"+(_?i.value:"");i.value="\u21DA",i.value=se,t.prevInput=_?"":"\u200B",i.selectionStart=1,i.selectionEnd=se.length,r.selForContextMenu=n.doc.sel}}function y(){if(t.contextMenuPending==y&&(t.contextMenuPending=!1,t.wrapper.style.cssText=u,i.style.cssText=s,R&&te<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=o),i.selectionStart!=null)){(!R||R&&te<9)&&S();var _=0,se=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?hn(n,ll)(n):_++<10?r.detectingSelectAll=setTimeout(se,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(se,200)}}if(R&&te>=9&&S(),pt){er(e);var L=function(){ge(window,"mouseup",L),setTimeout(y,20)};K(window,"mouseup",L)}else setTimeout(y,50)},an.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},an.prototype.setUneditable=function(){},an.prototype.needsContentAttribute=!1;function tu(e,t){if(t=t?M(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var n=E();t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=l.getValue()}var i;if(e.form&&(K(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var a=e.form;i=a.submit;try{var o=a.submit=function(){r(),a.submit=i,a.submit(),a.submit=o}}catch(s){}}t.finishInit=function(s){s.save=r,s.getTextArea=function(){return e},s.toTextArea=function(){s.toTextArea=isNaN,r(),e.parentNode.removeChild(s.getWrapperElement()),e.style.display="",e.form&&(ge(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var l=_r(function(s){return e.parentNode.insertBefore(s,e.nextSibling)},t);return l}function ru(e){e.off=ge,e.on=K,e.wheelEventPixels=us,e.Doc=kn,e.splitLines=wt,e.countColumn=ue,e.findColumn=Ot,e.isWordChar=m,e.Pass=Ve,e.signal=De,e.Line=bn,e.changeEnd=Ci,e.scrollbarModel=Fo,e.Pos=g,e.cmpPos=P,e.modes=nr,e.mimeModes=Dt,e.resolveMode=Wr,e.getMode=Bt,e.modeExtensions=ir,e.extendMode=fr,e.copyState=jt,e.startState=Er,e.innerMode=kt,e.commands=ya,e.keyMap=hi,e.keyName=xl,e.isModifierKey=Cl,e.lookupKey=_i,e.normalizeKeyMap=Ns,e.StringStream=Pt,e.SharedTextMarker=ga,e.TextMarker=xi,e.LineWidget=ha,e.e_preventDefault=$e,e.e_stopPropagation=ur,e.e_stop=er,e.addClass=Z,e.contains=O,e.rmClass=re,e.keyNames=Ei}Xs(_r),Qs(_r);var nu="iter insert remove copy getEditor constructor".split(" ");for(var ja in kn.prototype)kn.prototype.hasOwnProperty(ja)&&fe(nu,ja)<0&&(_r.prototype[ja]=function(e){return function(){return e.apply(this.doc,arguments)}}(kn.prototype[ja]));return Se(kn),_r.inputStyles={textarea:an,contenteditable:Ir},_r.defineMode=function(e){!_r.defaults.mode&&e!="null"&&(_r.defaults.mode=e),Fr.apply(this,arguments)},_r.defineMIME=un,_r.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),_r.defineMIME("text/plain","null"),_r.defineExtension=function(e,t){_r.prototype[e]=t},_r.defineDocExtension=function(e,t){kn.prototype[e]=t},_r.fromTextArea=tu,ru(_r),_r.version="5.58.2",_r})},66003:function(yn,ot,b){"use strict";b.d(ot,{Z:function(){return ae}});var B=b(39224),q=b(89490),U=b(28788),be=b(59301),R=["show"];function te(Je,ee){if(!ee.max)return!0;var h=ee.strategy(Je);return h<=ee.max}function ae(Je,ee){return be.useMemo(function(){var h={};ee&&(h.show=(0,U.Z)(ee)==="object"&&ee.formatter?ee.formatter:!!ee),h=(0,q.Z)((0,q.Z)({},h),Je);var We=h,x=We.show,Pe=(0,B.Z)(We,R);return(0,q.Z)((0,q.Z)({},Pe),{},{show:!!x,showFormatter:typeof x=="function"?x:void 0,strategy:Pe.strategy||function(T){return T.length}})},[Je,ee])}},36901:function(yn,ot,b){"use strict";b.r(ot),b.d(ot,{BaseInput:function(){return h},default:function(){return he}});var B=b(89490),q=b(71409),U=b(87075),be=b(28788),R=b(92310),te=b.n(R),ae=b(59301),Je=b(30292),ee=ae.forwardRef(function(W,pt){var ze,re,mt,Ge=W.inputElement,Q=W.children,at=W.prefixCls,Rt=W.prefix,O=W.suffix,E=W.addonBefore,Z=W.addonAfter,j=W.className,z=W.style,Ie=W.disabled,M=W.readOnly,ue=W.focused,Ne=W.triggerFocus,fe=W.allowClear,_e=W.value,Ve=W.handleReset,Ee=W.hidden,Ke=W.classes,Fe=W.classNames,Ot=W.dataAttrs,Ct=W.styles,bt=W.components,Oe=W.onClear,vr=Q!=null?Q:Ge,rr=(bt==null?void 0:bt.affixWrapper)||"span",D=(bt==null?void 0:bt.groupWrapper)||"span",p=(bt==null?void 0:bt.wrapper)||"span",C=(bt==null?void 0:bt.groupAddon)||"span",m=(0,ae.useRef)(null),w=function(ct){var Xe;(Xe=m.current)!==null&&Xe!==void 0&&Xe.contains(ct.target)&&(Ne==null||Ne())},I=(0,Je.X3)(W),A=(0,ae.cloneElement)(vr,{value:_e,className:te()((ze=vr.props)===null||ze===void 0?void 0:ze.className,!I&&(Fe==null?void 0:Fe.variant))||null}),H=(0,ae.useRef)(null);if(ae.useImperativeHandle(pt,function(){return{nativeElement:H.current||m.current}}),I){var oe=null;if(fe){var $=!Ie&&!M&&_e,ce="".concat(at,"-clear-icon"),ie=(0,be.Z)(fe)==="object"&&fe!==null&&fe!==void 0&&fe.clearIcon?fe.clearIcon:"\u2716";oe=ae.createElement("button",{type:"button",tabIndex:-1,onClick:function(ct){Ve==null||Ve(ct),Oe==null||Oe()},onMouseDown:function(ct){return ct.preventDefault()},className:te()(ce,(0,U.Z)((0,U.Z)({},"".concat(ce,"-hidden"),!$),"".concat(ce,"-has-suffix"),!!O))},ie)}var ne="".concat(at,"-affix-wrapper"),pe=te()(ne,(0,U.Z)((0,U.Z)((0,U.Z)((0,U.Z)((0,U.Z)({},"".concat(at,"-disabled"),Ie),"".concat(ne,"-disabled"),Ie),"".concat(ne,"-focused"),ue),"".concat(ne,"-readonly"),M),"".concat(ne,"-input-with-clear-btn"),O&&fe&&_e),Ke==null?void 0:Ke.affixWrapper,Fe==null?void 0:Fe.affixWrapper,Fe==null?void 0:Fe.variant),k=(O||fe)&&ae.createElement("span",{className:te()("".concat(at,"-suffix"),Fe==null?void 0:Fe.suffix),style:Ct==null?void 0:Ct.suffix},oe,O);A=ae.createElement(rr,(0,q.Z)({className:pe,style:Ct==null?void 0:Ct.affixWrapper,onClick:w},Ot==null?void 0:Ot.affixWrapper,{ref:m}),Rt&&ae.createElement("span",{className:te()("".concat(at,"-prefix"),Fe==null?void 0:Fe.prefix),style:Ct==null?void 0:Ct.prefix},Rt),A,k)}if((0,Je.He)(W)){var de="".concat(at,"-group"),K="".concat(de,"-addon"),Ue="".concat(de,"-wrapper"),ge=te()("".concat(at,"-wrapper"),de,Ke==null?void 0:Ke.wrapper,Fe==null?void 0:Fe.wrapper),De=te()(Ue,(0,U.Z)({},"".concat(Ue,"-disabled"),Ie),Ke==null?void 0:Ke.group,Fe==null?void 0:Fe.groupWrapper);A=ae.createElement(D,{className:De,ref:H},ae.createElement(p,{className:ge},E&&ae.createElement(C,{className:K},E),A,Z&&ae.createElement(C,{className:K},Z)))}return ae.cloneElement(A,{className:te()((re=A.props)===null||re===void 0?void 0:re.className,j)||null,style:(0,B.Z)((0,B.Z)({},(mt=A.props)===null||mt===void 0?void 0:mt.style),z),hidden:Ee})}),h=ee,We=b(62730),x=b(11036),Pe=b(39224),T=b(18929),ht=b(2738),Mt=b(66003),lt=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","onKeyUp","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],Lt=(0,ae.forwardRef)(function(W,pt){var ze=W.autoComplete,re=W.onChange,mt=W.onFocus,Ge=W.onBlur,Q=W.onPressEnter,at=W.onKeyDown,Rt=W.onKeyUp,O=W.prefixCls,E=O===void 0?"rc-input":O,Z=W.disabled,j=W.htmlSize,z=W.className,Ie=W.maxLength,M=W.suffix,ue=W.showCount,Ne=W.count,fe=W.type,_e=fe===void 0?"text":fe,Ve=W.classes,Ee=W.classNames,Ke=W.styles,Fe=W.onCompositionStart,Ot=W.onCompositionEnd,Ct=(0,Pe.Z)(W,lt),bt=(0,ae.useState)(!1),Oe=(0,x.Z)(bt,2),vr=Oe[0],rr=Oe[1],D=(0,ae.useRef)(!1),p=(0,ae.useRef)(!1),C=(0,ae.useRef)(null),m=(0,ae.useRef)(null),w=function(nt){C.current&&(0,Je.nH)(C.current,nt)},I=(0,T.Z)(W.defaultValue,{value:W.value}),A=(0,x.Z)(I,2),H=A[0],oe=A[1],$=H==null?"":String(H),ce=(0,ae.useState)(null),ie=(0,x.Z)(ce,2),ne=ie[0],pe=ie[1],k=(0,Mt.Z)(Ne,ue),de=k.max||Ie,K=k.strategy($),Ue=!!de&&K>de;(0,ae.useImperativeHandle)(pt,function(){var et;return{focus:w,blur:function(){var It;(It=C.current)===null||It===void 0||It.blur()},setSelectionRange:function(It,_t,Ht){var Xt;(Xt=C.current)===null||Xt===void 0||Xt.setSelectionRange(It,_t,Ht)},select:function(){var It;(It=C.current)===null||It===void 0||It.select()},input:C.current,nativeElement:((et=m.current)===null||et===void 0?void 0:et.nativeElement)||C.current}}),(0,ae.useEffect)(function(){p.current&&(p.current=!1),rr(function(et){return et&&Z?!1:et})},[Z]);var ge=function(nt,It,_t){var Ht=It;if(!D.current&&k.exceedFormatter&&k.max&&k.strategy(It)>k.max){if(Ht=k.exceedFormatter(It,{max:k.max}),It!==Ht){var Xt,wt;pe([((Xt=C.current)===null||Xt===void 0?void 0:Xt.selectionStart)||0,((wt=C.current)===null||wt===void 0?void 0:wt.selectionEnd)||0])}}else if(_t.source==="compositionEnd")return;oe(Ht),C.current&&(0,Je.rJ)(C.current,nt,re,Ht)};(0,ae.useEffect)(function(){if(ne){var et;(et=C.current)===null||et===void 0||et.setSelectionRange.apply(et,(0,We.Z)(ne))}},[ne]);var De=function(nt){ge(nt,nt.target.value,{source:"change"})},Le=function(nt){D.current=!1,ge(nt,nt.currentTarget.value,{source:"compositionEnd"}),Ot==null||Ot(nt)},ct=function(nt){Q&&nt.key==="Enter"&&!p.current&&(p.current=!0,Q(nt)),at==null||at(nt)},Xe=function(nt){nt.key==="Enter"&&(p.current=!1),Rt==null||Rt(nt)},Se=function(nt){rr(!0),mt==null||mt(nt)},$e=function(nt){p.current&&(p.current=!1),rr(!1),Ge==null||Ge(nt)},ur=function(nt){oe(""),w(),C.current&&(0,Je.rJ)(C.current,nt,re)},Sr=Ue&&"".concat(E,"-out-of-range"),er=function(){var nt=(0,ht.Z)(W,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames","onClear"]);return ae.createElement("input",(0,q.Z)({autoComplete:ze},nt,{onChange:De,onFocus:Se,onBlur:$e,onKeyDown:ct,onKeyUp:Xe,className:te()(E,(0,U.Z)({},"".concat(E,"-disabled"),Z),Ee==null?void 0:Ee.input),style:Ke==null?void 0:Ke.input,ref:C,size:j,type:_e,onCompositionStart:function(_t){D.current=!0,Fe==null||Fe(_t)},onCompositionEnd:Le}))},Rr=function(){var nt=Number(de)>0;if(M||k.show){var It=k.showFormatter?k.showFormatter({value:$,count:K,maxLength:de}):"".concat(K).concat(nt?" / ".concat(de):"");return ae.createElement(ae.Fragment,null,k.show&&ae.createElement("span",{className:te()("".concat(E,"-show-count-suffix"),(0,U.Z)({},"".concat(E,"-show-count-has-suffix"),!!M),Ee==null?void 0:Ee.count),style:(0,B.Z)({},Ke==null?void 0:Ke.count)},It),M)}return null};return ae.createElement(h,(0,q.Z)({},Ct,{prefixCls:E,className:te()(z,Sr),handleReset:ur,value:$,focused:vr,triggerFocus:w,suffix:Rr(),disabled:Z,classes:Ve,classNames:Ee,styles:Ke}),er())}),st=Lt,he=st},30292:function(yn,ot,b){"use strict";b.d(ot,{He:function(){return B},X3:function(){return q},nH:function(){return R},rJ:function(){return be}});function B(te){return!!(te.addonBefore||te.addonAfter)}function q(te){return!!(te.prefix||te.suffix||te.allowClear)}function U(te,ae,Je){var ee=ae.cloneNode(!0),h=Object.create(te,{target:{value:ee},currentTarget:{value:ee}});return ee.value=Je,typeof ae.selectionStart=="number"&&typeof ae.selectionEnd=="number"&&(ee.selectionStart=ae.selectionStart,ee.selectionEnd=ae.selectionEnd),ee.setSelectionRange=function(){ae.setSelectionRange.apply(ae,arguments)},h}function be(te,ae,Je,ee){if(Je){var h=ae;if(ae.type==="click"){h=U(ae,te,""),Je(h);return}if(te.type!=="file"&&ee!==void 0){h=U(ae,te,ee),Je(h);return}Je(h)}}function R(te,ae){if(te){te.focus(ae);var Je=ae||{},ee=Je.cursor;if(ee){var h=te.value.length;switch(ee){case"start":te.setSelectionRange(0,0);break;case"end":te.setSelectionRange(h,h);break;default:te.setSelectionRange(0,h)}}}}},11780:function(yn,ot,b){"use strict";b.d(ot,{Z:function(){return Ie}});var B=b(71409),q=b(89490),U=b(11036),be=b(39224),R=b(59301),te=b(92310),ae=b.n(te),Je=b(29301),ee=b(34280),h=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],We=void 0;function x(M,ue){var Ne=M.prefixCls,fe=M.invalidate,_e=M.item,Ve=M.renderItem,Ee=M.responsive,Ke=M.responsiveDisabled,Fe=M.registerSize,Ot=M.itemKey,Ct=M.className,bt=M.style,Oe=M.children,vr=M.display,rr=M.order,D=M.component,p=D===void 0?"div":D,C=(0,be.Z)(M,h),m=Ee&&!vr;function w($){Fe(Ot,$)}R.useEffect(function(){return function(){w(null)}},[]);var I=Ve&&_e!==We?Ve(_e,{index:rr}):Oe,A;fe||(A={opacity:m?0:1,height:m?0:We,overflowY:m?"hidden":We,order:Ee?rr:We,pointerEvents:m?"none":We,position:m?"absolute":We});var H={};m&&(H["aria-hidden"]=!0);var oe=R.createElement(p,(0,B.Z)({className:ae()(!fe&&Ne,Ct),style:(0,q.Z)((0,q.Z)({},A),bt)},H,C,{ref:ue}),I);return Ee&&(oe=R.createElement(Je.Z,{onResize:function(ce){var ie=ce.offsetWidth;w(ie)},disabled:Ke},oe)),oe}var Pe=R.forwardRef(x);Pe.displayName="Item";var T=Pe,ht=b(6089),Mt=b(4676),lt=b(16089);function Lt(M){if(typeof MessageChannel=="undefined")(0,lt.Z)(M);else{var ue=new MessageChannel;ue.port1.onmessage=function(){return M()},ue.port2.postMessage(void 0)}}function st(){var M=R.useRef(null),ue=function(fe){M.current||(M.current=[],Lt(function(){(0,Mt.unstable_batchedUpdates)(function(){M.current.forEach(function(_e){_e()}),M.current=null})})),M.current.push(fe)};return ue}function he(M,ue){var Ne=R.useState(ue),fe=(0,U.Z)(Ne,2),_e=fe[0],Ve=fe[1],Ee=(0,ht.Z)(function(Ke){M(function(){Ve(Ke)})});return[_e,Ee]}var W=R.createContext(null),pt=["component"],ze=["className"],re=["className"],mt=function(ue,Ne){var fe=R.useContext(W);if(!fe){var _e=ue.component,Ve=_e===void 0?"div":_e,Ee=(0,be.Z)(ue,pt);return R.createElement(Ve,(0,B.Z)({},Ee,{ref:Ne}))}var Ke=fe.className,Fe=(0,be.Z)(fe,ze),Ot=ue.className,Ct=(0,be.Z)(ue,re);return R.createElement(W.Provider,{value:null},R.createElement(T,(0,B.Z)({ref:Ne,className:ae()(Ke,Ot)},Fe,Ct)))},Ge=R.forwardRef(mt);Ge.displayName="RawItem";var Q=Ge,at=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],Rt="responsive",O="invalidate";function E(M){return"+ ".concat(M.length," ...")}function Z(M,ue){var Ne=M.prefixCls,fe=Ne===void 0?"rc-overflow":Ne,_e=M.data,Ve=_e===void 0?[]:_e,Ee=M.renderItem,Ke=M.renderRawItem,Fe=M.itemKey,Ot=M.itemWidth,Ct=Ot===void 0?10:Ot,bt=M.ssr,Oe=M.style,vr=M.className,rr=M.maxCount,D=M.renderRest,p=M.renderRawRest,C=M.suffix,m=M.component,w=m===void 0?"div":m,I=M.itemComponent,A=M.onVisibleChange,H=(0,be.Z)(M,at),oe=bt==="full",$=st(),ce=he($,null),ie=(0,U.Z)(ce,2),ne=ie[0],pe=ie[1],k=ne||0,de=he($,new Map),K=(0,U.Z)(de,2),Ue=K[0],ge=K[1],De=he($,0),Le=(0,U.Z)(De,2),ct=Le[0],Xe=Le[1],Se=he($,0),$e=(0,U.Z)(Se,2),ur=$e[0],Sr=$e[1],er=he($,0),Rr=(0,U.Z)(er,2),et=Rr[0],nt=Rr[1],It=(0,R.useState)(null),_t=(0,U.Z)(It,2),Ht=_t[0],Xt=_t[1],wt=(0,R.useState)(null),Jt=(0,U.Z)(wt,2),dt=Jt[0],Br=Jt[1],Zt=R.useMemo(function(){return dt===null&&oe?Number.MAX_SAFE_INTEGER:dt||0},[dt,ne]),nr=(0,R.useState)(!1),Dt=(0,U.Z)(nr,2),Fr=Dt[0],un=Dt[1],Wr="".concat(fe,"-item"),Bt=Math.max(ct,ur),ir=rr===Rt,fr=Ve.length&&ir,jt=rr===O,kt=fr||typeof rr=="number"&&Ve.length>rr,Er=(0,R.useMemo)(function(){var Me=Ve;return fr?ne===null&&oe?Me=Ve:Me=Ve.slice(0,Math.min(Ve.length,k/Ct)):typeof rr=="number"&&(Me=Ve.slice(0,rr)),Me},[Ve,Ct,ne,rr,fr]),Pt=(0,R.useMemo)(function(){return fr?Ve.slice(Zt+1):Ve.slice(Er.length)},[Ve,Er,fr,Zt]),Y=(0,R.useCallback)(function(Me,X){var Te;return typeof Fe=="function"?Fe(Me):(Te=Fe&&(Me==null?void 0:Me[Fe]))!==null&&Te!==void 0?Te:X},[Fe]),yt=(0,R.useCallback)(Ee||function(Me){return Me},[Ee]);function Mr(Me,X,Te){dt===Me&&(X===void 0||X===Ht)||(Br(Me),Te||(un(Me<Ve.length-1),A==null||A(Me)),X!==void 0&&Xt(X))}function cr(Me,X){pe(X.clientWidth)}function d(Me,X){ge(function(Te){var ye=new Map(Te);return X===null?ye.delete(Me):ye.set(Me,X),ye})}function v(Me,X){Sr(X),Xe(ur)}function F(Me,X){nt(X)}function N(Me){return Ue.get(Y(Er[Me],Me))}(0,ee.Z)(function(){if(k&&typeof Bt=="number"&&Er){var Me=et,X=Er.length,Te=X-1;if(!X){Mr(0,null);return}for(var ye=0;ye<X;ye+=1){var Qe=N(ye);if(oe&&(Qe=Qe||0),Qe===void 0){Mr(ye-1,void 0,!0);break}if(Me+=Qe,Te===0&&Me<=k||ye===Te-1&&Me+N(Te)<=k){Mr(Te,null);break}else if(Me+Bt>k){Mr(ye-1,Me-Qe-et+ur);break}}C&&N(0)+et>k&&Xt(null)}},[k,Ue,ur,et,Y,Er]);var g=Fr&&!!Pt.length,P={};Ht!==null&&fr&&(P={position:"absolute",left:Ht,top:0});var le={prefixCls:Wr,responsive:fr,component:I,invalidate:jt},ve=Ke?function(Me,X){var Te=Y(Me,X);return R.createElement(W.Provider,{key:Te,value:(0,q.Z)((0,q.Z)({},le),{},{order:X,item:Me,itemKey:Te,registerSize:d,display:X<=Zt})},Ke(Me,X))}:function(Me,X){var Te=Y(Me,X);return R.createElement(T,(0,B.Z)({},le,{order:X,key:Te,item:Me,renderItem:yt,itemKey:Te,registerSize:d,display:X<=Zt}))},Re={order:g?Zt:Number.MAX_SAFE_INTEGER,className:"".concat(Wr,"-rest"),registerSize:v,display:g},Ce=D||E,He=p?R.createElement(W.Provider,{value:(0,q.Z)((0,q.Z)({},le),Re)},p(Pt)):R.createElement(T,(0,B.Z)({},le,Re),typeof Ce=="function"?Ce(Pt):Ce),J=R.createElement(w,(0,B.Z)({className:ae()(!jt&&fe,vr),style:Oe,ref:ue},H),Er.map(ve),kt?He:null,C&&R.createElement(T,(0,B.Z)({},le,{responsive:ir,responsiveDisabled:!fr,order:Zt,className:"".concat(Wr,"-suffix"),registerSize:F,display:!0,style:P}),C));return ir?R.createElement(Je.Z,{onResize:cr,disabled:!fr},J):J}var j=R.forwardRef(Z);j.displayName="Overflow",j.Item=Q,j.RESPONSIVE=Rt,j.INVALIDATE=O;var z=j,Ie=z},29301:function(yn,ot,b){"use strict";b.d(ot,{Z:function(){return O}});var B=b(71409),q=b(59301),U=b(11592),be=b(48736),R=b(89490),te=b(28788),ae=b(76846),Je=b(8654),ee=q.createContext(null);function h(E){var Z=E.children,j=E.onBatchResize,z=q.useRef(0),Ie=q.useRef([]),M=q.useContext(ee),ue=q.useCallback(function(Ne,fe,_e){z.current+=1;var Ve=z.current;Ie.current.push({size:Ne,element:fe,data:_e}),Promise.resolve().then(function(){Ve===z.current&&(j==null||j(Ie.current),Ie.current=[])}),M==null||M(Ne,fe,_e)},[j,M]);return q.createElement(ee.Provider,{value:ue},Z)}var We=b(76374),x=new Map;function Pe(E){E.forEach(function(Z){var j,z=Z.target;(j=x.get(z))===null||j===void 0||j.forEach(function(Ie){return Ie(z)})})}var T=new We.Z(Pe),ht=null,Mt=null;function lt(E,Z){x.has(E)||(x.set(E,new Set),T.observe(E)),x.get(E).add(Z)}function Lt(E,Z){x.has(E)&&(x.get(E).delete(Z),x.get(E).size||(T.unobserve(E),x.delete(E)))}var st=b(16552),he=b(19210),W=b(46654),pt=b(37205),ze=function(E){(0,W.Z)(j,E);var Z=(0,pt.Z)(j);function j(){return(0,st.Z)(this,j),Z.apply(this,arguments)}return(0,he.Z)(j,[{key:"render",value:function(){return this.props.children}}]),j}(q.Component);function re(E,Z){var j=E.children,z=E.disabled,Ie=q.useRef(null),M=q.useRef(null),ue=q.useContext(ee),Ne=typeof j=="function",fe=Ne?j(Ie):j,_e=q.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Ve=!Ne&&q.isValidElement(fe)&&(0,Je.Yr)(fe),Ee=Ve?(0,Je.C4)(fe):null,Ke=(0,Je.x1)(Ee,Ie),Fe=function(){var Oe;return(0,ae.ZP)(Ie.current)||(Ie.current&&(0,te.Z)(Ie.current)==="object"?(0,ae.ZP)((Oe=Ie.current)===null||Oe===void 0?void 0:Oe.nativeElement):null)||(0,ae.ZP)(M.current)};q.useImperativeHandle(Z,function(){return Fe()});var Ot=q.useRef(E);Ot.current=E;var Ct=q.useCallback(function(bt){var Oe=Ot.current,vr=Oe.onResize,rr=Oe.data,D=bt.getBoundingClientRect(),p=D.width,C=D.height,m=bt.offsetWidth,w=bt.offsetHeight,I=Math.floor(p),A=Math.floor(C);if(_e.current.width!==I||_e.current.height!==A||_e.current.offsetWidth!==m||_e.current.offsetHeight!==w){var H={width:I,height:A,offsetWidth:m,offsetHeight:w};_e.current=H;var oe=m===Math.round(p)?p:m,$=w===Math.round(C)?C:w,ce=(0,R.Z)((0,R.Z)({},H),{},{offsetWidth:oe,offsetHeight:$});ue==null||ue(ce,bt,rr),vr&&Promise.resolve().then(function(){vr(ce,bt)})}},[]);return q.useEffect(function(){var bt=Fe();return bt&&!z&<(bt,Ct),function(){return Lt(bt,Ct)}},[Ie.current,z]),q.createElement(ze,{ref:M},Ve?q.cloneElement(fe,{ref:Ke}):fe)}var mt=q.forwardRef(re),Ge=mt,Q="rc-observer-key";function at(E,Z){var j=E.children,z=typeof j=="function"?[j]:(0,U.Z)(j);return z.map(function(Ie,M){var ue=(Ie==null?void 0:Ie.key)||"".concat(Q,"-").concat(M);return q.createElement(Ge,(0,B.Z)({},E,{key:ue,ref:M===0?Z:void 0}),Ie)})}var Rt=q.forwardRef(at);Rt.Collection=h;var O=Rt},6551:function(yn,ot,b){"use strict";b.d(ot,{ZP:function(){return ae}});var B=b(11036),q=b(59301),U=b(47273),be=0,R=(0,U.Z)();function te(){var Je;return R?(Je=be,be+=1):Je="TEST_OR_SSR",Je}function ae(Je){var ee=q.useState(),h=(0,B.Z)(ee,2),We=h[0],x=h[1];return q.useEffect(function(){x("rc_select_".concat(te()))},[]),Je||We}},37463:function(yn,ot,b){"use strict";b.d(ot,{Ac:function(){return Le},Xo:function(){return Xe},Wx:function(){return $e},ZP:function(){return cr},lk:function(){return he}});var B=b(71409),q=b(62730),U=b(87075),be=b(89490),R=b(11036),te=b(39224),ae=b(28788),Je=b(18929),ee=b(48736),h=b(59301),We=b(92310),x=b.n(We),Pe=b(34280),T=b(49658),ht=b(8654),Mt=function(v){var F=v.className,N=v.customizeIcon,g=v.customizeIconProps,P=v.children,le=v.onMouseDown,ve=v.onClick,Re=typeof N=="function"?N(g):N;return h.createElement("span",{className:F,onMouseDown:function(He){He.preventDefault(),le==null||le(He)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:ve,"aria-hidden":!0},Re!==void 0?Re:h.createElement("span",{className:x()(F.split(/\s+/).map(function(Ce){return"".concat(Ce,"-icon")}))},P))},lt=Mt,Lt=function(v,F,N,g,P){var le=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,ve=arguments.length>6?arguments[6]:void 0,Re=arguments.length>7?arguments[7]:void 0,Ce=h.useMemo(function(){if((0,ae.Z)(g)==="object")return g.clearIcon;if(P)return P},[g,P]),He=h.useMemo(function(){return!!(!le&&g&&(N.length||ve)&&!(Re==="combobox"&&ve===""))},[g,le,N.length,ve,Re]);return{allowClear:He,clearIcon:h.createElement(lt,{className:"".concat(v,"-clear"),onMouseDown:F,customizeIcon:Ce},"\xD7")}},st=h.createContext(null);function he(){return h.useContext(st)}function W(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,v=h.useState(!1),F=(0,R.Z)(v,2),N=F[0],g=F[1],P=h.useRef(null),le=function(){window.clearTimeout(P.current)};h.useEffect(function(){return le},[]);var ve=function(Ce,He){le(),P.current=window.setTimeout(function(){g(Ce),He&&He()},d)};return[N,ve,le]}function pt(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,v=h.useRef(null),F=h.useRef(null);h.useEffect(function(){return function(){window.clearTimeout(F.current)}},[]);function N(g){(g||v.current===null)&&(v.current=g),window.clearTimeout(F.current),F.current=window.setTimeout(function(){v.current=null},d)}return[function(){return v.current},N]}function ze(d,v,F,N){var g=h.useRef(null);g.current={open:v,triggerOpen:F,customizedTrigger:N},h.useEffect(function(){function P(le){var ve;if(!((ve=g.current)!==null&&ve!==void 0&&ve.customizedTrigger)){var Re=le.target;Re.shadowRoot&&le.composed&&(Re=le.composedPath()[0]||Re),g.current.open&&d().filter(function(Ce){return Ce}).every(function(Ce){return!Ce.contains(Re)&&Ce!==Re})&&g.current.triggerOpen(!1)}}return window.addEventListener("mousedown",P),function(){return window.removeEventListener("mousedown",P)}},[])}var re=b(10228);function mt(d){return d&&![re.Z.ESC,re.Z.SHIFT,re.Z.BACKSPACE,re.Z.TAB,re.Z.WIN_KEY,re.Z.ALT,re.Z.META,re.Z.WIN_KEY_RIGHT,re.Z.CTRL,re.Z.SEMICOLON,re.Z.EQUALS,re.Z.CAPS_LOCK,re.Z.CONTEXT_MENU,re.Z.F1,re.Z.F2,re.Z.F3,re.Z.F4,re.Z.F5,re.Z.F6,re.Z.F7,re.Z.F8,re.Z.F9,re.Z.F10,re.Z.F11,re.Z.F12].includes(d)}var Ge=b(26112),Q=b(11780);function at(d,v,F){var N=(0,be.Z)((0,be.Z)({},d),F?v:{});return Object.keys(v).forEach(function(g){var P=v[g];typeof P=="function"&&(N[g]=function(){for(var le,ve=arguments.length,Re=new Array(ve),Ce=0;Ce<ve;Ce++)Re[Ce]=arguments[Ce];return P.apply(void 0,Re),(le=d[g])===null||le===void 0?void 0:le.call.apply(le,[d].concat(Re))})}),N}var Rt=at,O=["prefixCls","id","inputElement","autoFocus","autoComplete","editable","activeDescendantId","value","open","attrs"],E=function(v,F){var N=v.prefixCls,g=v.id,P=v.inputElement,le=v.autoFocus,ve=v.autoComplete,Re=v.editable,Ce=v.activeDescendantId,He=v.value,J=v.open,Me=v.attrs,X=(0,te.Z)(v,O),Te=P||h.createElement("input",null),ye=Te,Qe=ye.ref,Et=ye.props;return(0,ee.Kp)(!("maxLength"in Te.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),Te=h.cloneElement(Te,(0,be.Z)((0,be.Z)((0,be.Z)({type:"search"},Rt(X,Et,!0)),{},{id:g,ref:(0,ht.sQ)(F,Qe),autoComplete:ve||"off",autoFocus:le,className:x()("".concat(N,"-selection-search-input"),Et==null?void 0:Et.className),role:"combobox","aria-expanded":J||!1,"aria-haspopup":"listbox","aria-owns":"".concat(g,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(g,"_list"),"aria-activedescendant":J?Ce:void 0},Me),{},{value:Re?He:"",readOnly:!Re,unselectable:Re?null:"on",style:(0,be.Z)((0,be.Z)({},Et.style),{},{opacity:Re?null:0})})),Te},Z=h.forwardRef(E),j=Z;function z(d){return Array.isArray(d)?d:d!==void 0?[d]:[]}var Ie=typeof window!="undefined"&&window.document&&window.document.documentElement,M=Ie;function ue(d){return d!=null}function Ne(d){return!d&&d!==0}function fe(d){return["string","number"].includes((0,ae.Z)(d))}function _e(d){var v=void 0;return d&&(fe(d.title)?v=d.title.toString():fe(d.label)&&(v=d.label.toString())),v}function Ve(d,v){M?h.useLayoutEffect(d,v):h.useEffect(d,v)}function Ee(d){var v;return(v=d.key)!==null&&v!==void 0?v:d.value}var Ke=function(v){v.preventDefault(),v.stopPropagation()},Fe=function(v){var F=v.id,N=v.prefixCls,g=v.values,P=v.open,le=v.searchValue,ve=v.autoClearSearchValue,Re=v.inputRef,Ce=v.placeholder,He=v.disabled,J=v.mode,Me=v.showSearch,X=v.autoFocus,Te=v.autoComplete,ye=v.activeDescendantId,Qe=v.tabIndex,Et=v.removeIcon,Ft=v.maxTagCount,Qt=v.maxTagTextLength,Wt=v.maxTagPlaceholder,hr=Wt===void 0?function(Ze){return"+ ".concat(Ze.length," ...")}:Wt,xt=v.tagRender,Cr=v.onToggleOpen,wr=v.onRemove,Nt=v.onInputChange,gr=v.onInputPaste,Kt=v.onInputKeyDown,ar=v.onInputMouseDown,tt=v.onInputCompositionStart,St=v.onInputCompositionEnd,Ut=v.onInputBlur,or=h.useRef(null),Lr=(0,h.useState)(0),lr=(0,R.Z)(Lr,2),xr=lr[0],Yt=lr[1],Tt=(0,h.useState)(!1),Or=(0,R.Z)(Tt,2),Xr=Or[0],Vr=Or[1],pr="".concat(N,"-selection"),tn=P||J==="multiple"&&ve===!1||J==="tags"?le:"",mr=J==="tags"||J==="multiple"&&ve===!1||Me&&(P||Xr);Ve(function(){Yt(or.current.scrollWidth)},[tn]);var jr=function(me,qe,$t,tr,qt){return h.createElement("span",{title:_e(me),className:x()("".concat(pr,"-item"),(0,U.Z)({},"".concat(pr,"-item-disabled"),$t))},h.createElement("span",{className:"".concat(pr,"-item-content")},qe),tr&&h.createElement(lt,{className:"".concat(pr,"-item-remove"),onMouseDown:Ke,onClick:qt,customizeIcon:Et},"\xD7"))},Kr=function(me,qe,$t,tr,qt,Dr){var Ur=function(on){Ke(on),Cr(!P)};return h.createElement("span",{onMouseDown:Ur},xt({label:qe,value:me,disabled:$t,closable:tr,onClose:qt,isMaxTag:!!Dr}))},Tr=function(me){var qe=me.disabled,$t=me.label,tr=me.value,qt=!He&&!qe,Dr=$t;if(typeof Qt=="number"&&(typeof $t=="string"||typeof $t=="number")){var Ur=String(Dr);Ur.length>Qt&&(Dr="".concat(Ur.slice(0,Qt),"..."))}var Ar=function(yr){yr&&yr.stopPropagation(),wr(me)};return typeof xt=="function"?Kr(tr,Dr,qe,qt,Ar):jr(me,Dr,qe,qt,Ar)},ut=function(me){if(!g.length)return null;var qe=typeof hr=="function"?hr(me):hr;return typeof xt=="function"?Kr(void 0,qe,!1,!1,void 0,!0):jr({title:qe},qe,!1)},G=h.createElement("div",{className:"".concat(pr,"-search"),style:{width:xr},onFocus:function(){Vr(!0)},onBlur:function(){Vr(!1)}},h.createElement(j,{ref:Re,open:P,prefixCls:N,id:F,inputElement:null,disabled:He,autoFocus:X,autoComplete:Te,editable:mr,activeDescendantId:ye,value:tn,onKeyDown:Kt,onMouseDown:ar,onChange:Nt,onPaste:gr,onCompositionStart:tt,onCompositionEnd:St,onBlur:Ut,tabIndex:Qe,attrs:(0,Ge.Z)(v,!0)}),h.createElement("span",{ref:or,className:"".concat(pr,"-search-mirror"),"aria-hidden":!0},tn,"\xA0")),V=h.createElement(Q.Z,{prefixCls:"".concat(pr,"-overflow"),data:g,renderItem:Tr,renderRest:ut,suffix:G,itemKey:Ee,maxCount:Ft});return h.createElement("span",{className:"".concat(pr,"-wrap")},V,!g.length&&!tn&&h.createElement("span",{className:"".concat(pr,"-placeholder")},Ce))},Ot=Fe,Ct=function(v){var F=v.inputElement,N=v.prefixCls,g=v.id,P=v.inputRef,le=v.disabled,ve=v.autoFocus,Re=v.autoComplete,Ce=v.activeDescendantId,He=v.mode,J=v.open,Me=v.values,X=v.placeholder,Te=v.tabIndex,ye=v.showSearch,Qe=v.searchValue,Et=v.activeValue,Ft=v.maxLength,Qt=v.onInputKeyDown,Wt=v.onInputMouseDown,hr=v.onInputChange,xt=v.onInputPaste,Cr=v.onInputCompositionStart,wr=v.onInputCompositionEnd,Nt=v.onInputBlur,gr=v.title,Kt=h.useState(!1),ar=(0,R.Z)(Kt,2),tt=ar[0],St=ar[1],Ut=He==="combobox",or=Ut||ye,Lr=Me[0],lr=Qe||"";Ut&&Et&&!tt&&(lr=Et),h.useEffect(function(){Ut&&St(!1)},[Ut,Et]);var xr=He!=="combobox"&&!J&&!ye?!1:!!lr,Yt=gr===void 0?_e(Lr):gr,Tt=h.useMemo(function(){return Lr?null:h.createElement("span",{className:"".concat(N,"-selection-placeholder"),style:xr?{visibility:"hidden"}:void 0},X)},[Lr,xr,X,N]);return h.createElement("span",{className:"".concat(N,"-selection-wrap")},h.createElement("span",{className:"".concat(N,"-selection-search")},h.createElement(j,{ref:P,prefixCls:N,id:g,open:J,inputElement:F,disabled:le,autoFocus:ve,autoComplete:Re,editable:or,activeDescendantId:Ce,value:lr,onKeyDown:Qt,onMouseDown:Wt,onChange:function(Xr){St(!0),hr(Xr)},onPaste:xt,onCompositionStart:Cr,onCompositionEnd:wr,onBlur:Nt,tabIndex:Te,attrs:(0,Ge.Z)(v,!0),maxLength:Ut?Ft:void 0})),!Ut&&Lr?h.createElement("span",{className:"".concat(N,"-selection-item"),title:Yt,style:xr?{visibility:"hidden"}:void 0},Lr.label):null,Tt)},bt=Ct,Oe=function(v,F){var N=(0,h.useRef)(null),g=(0,h.useRef)(!1),P=v.prefixCls,le=v.open,ve=v.mode,Re=v.showSearch,Ce=v.tokenWithEnter,He=v.disabled,J=v.prefix,Me=v.autoClearSearchValue,X=v.onSearch,Te=v.onSearchSubmit,ye=v.onToggleOpen,Qe=v.onInputKeyDown,Et=v.onInputBlur,Ft=v.domRef;h.useImperativeHandle(F,function(){return{focus:function(Yt){N.current.focus(Yt)},blur:function(){N.current.blur()}}});var Qt=pt(0),Wt=(0,R.Z)(Qt,2),hr=Wt[0],xt=Wt[1],Cr=function(Yt){var Tt=Yt.which,Or=N.current instanceof HTMLTextAreaElement;!Or&&le&&(Tt===re.Z.UP||Tt===re.Z.DOWN)&&Yt.preventDefault(),Qe&&Qe(Yt),Tt===re.Z.ENTER&&ve==="tags"&&!g.current&&!le&&(Te==null||Te(Yt.target.value)),!(Or&&!le&&~[re.Z.UP,re.Z.DOWN,re.Z.LEFT,re.Z.RIGHT].indexOf(Tt))&&mt(Tt)&&ye(!0)},wr=function(){xt(!0)},Nt=(0,h.useRef)(null),gr=function(Yt){X(Yt,!0,g.current)!==!1&&ye(!0)},Kt=function(){g.current=!0},ar=function(Yt){g.current=!1,ve!=="combobox"&&gr(Yt.target.value)},tt=function(Yt){var Tt=Yt.target.value;if(Ce&&Nt.current&&/[\r\n]/.test(Nt.current)){var Or=Nt.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");Tt=Tt.replace(Or,Nt.current)}Nt.current=null,gr(Tt)},St=function(Yt){var Tt=Yt.clipboardData,Or=Tt==null?void 0:Tt.getData("text");Nt.current=Or||""},Ut=function(Yt){var Tt=Yt.target;if(Tt!==N.current){var Or=document.body.style.msTouchAction!==void 0;Or?setTimeout(function(){N.current.focus()}):N.current.focus()}},or=function(Yt){var Tt=hr();Yt.target!==N.current&&!Tt&&!(ve==="combobox"&&He)&&Yt.preventDefault(),(ve!=="combobox"&&(!Re||!Tt)||!le)&&(le&&Me!==!1&&X("",!0,!1),ye())},Lr={inputRef:N,onInputKeyDown:Cr,onInputMouseDown:wr,onInputChange:tt,onInputPaste:St,onInputCompositionStart:Kt,onInputCompositionEnd:ar,onInputBlur:Et},lr=ve==="multiple"||ve==="tags"?h.createElement(Ot,(0,B.Z)({},v,Lr)):h.createElement(bt,(0,B.Z)({},v,Lr));return h.createElement("div",{ref:Ft,className:"".concat(P,"-selector"),onClick:Ut,onMouseDown:or},J&&h.createElement("div",{className:"".concat(P,"-prefix")},J),lr)},vr=h.forwardRef(Oe),rr=vr,D=b(65352),p=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],C=function(v){var F=v===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:F,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:F,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:F,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:F,adjustY:1},htmlRegion:"scroll"}}},m=function(v,F){var N=v.prefixCls,g=v.disabled,P=v.visible,le=v.children,ve=v.popupElement,Re=v.animation,Ce=v.transitionName,He=v.dropdownStyle,J=v.dropdownClassName,Me=v.direction,X=Me===void 0?"ltr":Me,Te=v.placement,ye=v.builtinPlacements,Qe=v.dropdownMatchSelectWidth,Et=v.dropdownRender,Ft=v.dropdownAlign,Qt=v.getPopupContainer,Wt=v.empty,hr=v.getTriggerDOMNode,xt=v.onPopupVisibleChange,Cr=v.onPopupMouseEnter,wr=(0,te.Z)(v,p),Nt="".concat(N,"-dropdown"),gr=ve;Et&&(gr=Et(ve));var Kt=h.useMemo(function(){return ye||C(Qe)},[ye,Qe]),ar=Re?"".concat(Nt,"-").concat(Re):Ce,tt=typeof Qe=="number",St=h.useMemo(function(){return tt?null:Qe===!1?"minWidth":"width"},[Qe,tt]),Ut=He;tt&&(Ut=(0,be.Z)((0,be.Z)({},Ut),{},{width:Qe}));var or=h.useRef(null);return h.useImperativeHandle(F,function(){return{getPopupElement:function(){var lr;return(lr=or.current)===null||lr===void 0?void 0:lr.popupElement}}}),h.createElement(D.Z,(0,B.Z)({},wr,{showAction:xt?["click"]:[],hideAction:xt?["click"]:[],popupPlacement:Te||(X==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:Kt,prefixCls:Nt,popupTransitionName:ar,popup:h.createElement("div",{onMouseEnter:Cr},gr),ref:or,stretch:St,popupAlign:Ft,popupVisible:P,getPopupContainer:Qt,popupClassName:x()(J,(0,U.Z)({},"".concat(Nt,"-empty"),Wt)),popupStyle:Ut,getTriggerDOMNode:hr,onPopupVisibleChange:xt}),le)},w=h.forwardRef(m),I=w,A=b(67900);function H(d,v){var F=d.key,N;return"value"in d&&(N=d.value),F!=null?F:N!==void 0?N:"rc-index-key-".concat(v)}function oe(d){return typeof d!="undefined"&&!Number.isNaN(d)}function $(d,v){var F=d||{},N=F.label,g=F.value,P=F.options,le=F.groupLabel,ve=N||(v?"children":"label");return{label:ve,value:g||"value",options:P||"options",groupLabel:le||ve}}function ce(d){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},F=v.fieldNames,N=v.childrenAsData,g=[],P=$(F,!1),le=P.label,ve=P.value,Re=P.options,Ce=P.groupLabel;function He(J,Me){Array.isArray(J)&&J.forEach(function(X){if(Me||!(Re in X)){var Te=X[ve];g.push({key:H(X,g.length),groupOption:Me,data:X,label:X[le],value:Te})}else{var ye=X[Ce];ye===void 0&&N&&(ye=X.label),g.push({key:H(X,g.length),group:!0,data:X,label:ye}),He(X[Re],!0)}})}return He(d,!1),g}function ie(d){var v=(0,be.Z)({},d);return"props"in v||Object.defineProperty(v,"props",{get:function(){return(0,ee.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),v}}),v}var ne=function(v,F,N){if(!F||!F.length)return null;var g=!1,P=function ve(Re,Ce){var He=(0,A.Z)(Ce),J=He[0],Me=He.slice(1);if(!J)return[Re];var X=Re.split(J);return g=g||X.length>1,X.reduce(function(Te,ye){return[].concat((0,q.Z)(Te),(0,q.Z)(ve(ye,Me)))},[]).filter(Boolean)},le=P(v,F);return g?typeof N!="undefined"?le.slice(0,N):le:null},pe=h.createContext(null),k=pe;function de(d){var v=d.visible,F=d.values;if(!v)return null;var N=50;return h.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(F.slice(0,N).map(function(g){var P=g.label,le=g.value;return["number","string"].includes((0,ae.Z)(P))?P:le}).join(", ")),F.length>N?", ...":null)}var K=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","prefix","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],Ue=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],ge=function(v){return v==="tags"||v==="multiple"},De=h.forwardRef(function(d,v){var F,N=d.id,g=d.prefixCls,P=d.className,le=d.showSearch,ve=d.tagRender,Re=d.direction,Ce=d.omitDomProps,He=d.displayValues,J=d.onDisplayValuesChange,Me=d.emptyOptions,X=d.notFoundContent,Te=X===void 0?"Not Found":X,ye=d.onClear,Qe=d.mode,Et=d.disabled,Ft=d.loading,Qt=d.getInputElement,Wt=d.getRawInputElement,hr=d.open,xt=d.defaultOpen,Cr=d.onDropdownVisibleChange,wr=d.activeValue,Nt=d.onActiveValueChange,gr=d.activeDescendantId,Kt=d.searchValue,ar=d.autoClearSearchValue,tt=d.onSearch,St=d.onSearchSplit,Ut=d.tokenSeparators,or=d.allowClear,Lr=d.prefix,lr=d.suffixIcon,xr=d.clearIcon,Yt=d.OptionList,Tt=d.animation,Or=d.transitionName,Xr=d.dropdownStyle,Vr=d.dropdownClassName,pr=d.dropdownMatchSelectWidth,tn=d.dropdownRender,mr=d.dropdownAlign,jr=d.placement,Kr=d.builtinPlacements,Tr=d.getPopupContainer,ut=d.showAction,G=ut===void 0?[]:ut,V=d.onFocus,Ze=d.onBlur,me=d.onKeyUp,qe=d.onKeyDown,$t=d.onMouseDown,tr=(0,te.Z)(d,K),qt=ge(Qe),Dr=(le!==void 0?le:qt)||Qe==="combobox",Ur=(0,be.Z)({},tr);Ue.forEach(function(dr){delete Ur[dr]}),Ce==null||Ce.forEach(function(dr){delete Ur[dr]});var Ar=h.useState(!1),on=(0,R.Z)(Ar,2),yr=on[0],bn=on[1];h.useEffect(function(){bn((0,T.Z)())},[]);var zn=h.useRef(null),Yr=h.useRef(null),kr=h.useRef(null),rn=h.useRef(null),zr=h.useRef(null),$r=h.useRef(!1),jn=W(),Nn=(0,R.Z)(jn,3),xn=Nn[0],fn=Nn[1],$n=Nn[2];h.useImperativeHandle(v,function(){var dr,At;return{focus:(dr=rn.current)===null||dr===void 0?void 0:dr.focus,blur:(At=rn.current)===null||At===void 0?void 0:At.blur,scrollTo:function(Ln){var nn;return(nn=zr.current)===null||nn===void 0?void 0:nn.scrollTo(Ln)},nativeElement:zn.current||Yr.current}});var En=h.useMemo(function(){var dr;if(Qe!=="combobox")return Kt;var At=(dr=He[0])===null||dr===void 0?void 0:dr.value;return typeof At=="string"||typeof At=="number"?String(At):""},[Kt,Qe,He]),ri=Qe==="combobox"&&typeof Qt=="function"&&Qt()||null,qr=typeof Wt=="function"&&Wt(),Hn=(0,ht.x1)(Yr,qr==null||(F=qr.props)===null||F===void 0?void 0:F.ref),ui=h.useState(!1),ni=(0,R.Z)(ui,2),di=ni[0],Bn=ni[1];(0,Pe.Z)(function(){Bn(!0)},[]);var Zr=(0,Je.Z)(!1,{defaultValue:xt,value:hr}),cn=(0,R.Z)(Zr,2),qn=cn[0],Jr=cn[1],Gr=di?qn:!1,Kn=!Te&&Me;(Et||Kn&&Gr&&Qe==="combobox")&&(Gr=!1);var Mn=Kn?!1:Gr,je=h.useCallback(function(dr){var At=dr!==void 0?dr:!Gr;Et||(Jr(At),Gr!==At&&(Cr==null||Cr(At)))},[Et,Gr,Jr,Cr]),gt=h.useMemo(function(){return(Ut||[]).some(function(dr){return[`
|
|
`,`\r
|
|
`].includes(dr)})},[Ut]),it=h.useContext(k)||{},vt=it.maxCount,sr=it.rawValues,Pr=function(At,Cn,Ln){if(!(qt&&oe(vt)&&(sr==null?void 0:sr.size)>=vt)){var nn=!0,dn=At;Nt==null||Nt(null);var ai=ne(At,Ut,oe(vt)?vt-sr.size:void 0),ti=Ln?null:ai;return Qe!=="combobox"&&ti&&(dn="",St==null||St(ti),je(!1),nn=!1),tt&&En!==dn&&tt(dn,{source:Cn?"typing":"effect"}),nn}},Ae=function(At){!At||!At.trim()||tt(At,{source:"submit"})};h.useEffect(function(){!Gr&&!qt&&Qe!=="combobox"&&Pr("",!1,!1)},[Gr]),h.useEffect(function(){qn&&Et&&Jr(!1),Et&&!$r.current&&fn(!1)},[Et]);var Ye=pt(),zt=(0,R.Z)(Ye,2),Gt=zt[0],br=zt[1],On=h.useRef(!1),Sn=function(At){var Cn=Gt(),Ln=At.key,nn=Ln==="Enter";if(nn&&(Qe!=="combobox"&&At.preventDefault(),Gr||je(!0)),br(!!En),Ln==="Backspace"&&!Cn&&qt&&!En&&He.length){for(var dn=(0,q.Z)(He),ai=null,ti=dn.length-1;ti>=0;ti-=1){var vi=dn[ti];if(!vi.disabled){dn.splice(ti,1),ai=vi;break}}ai&&J(dn,{type:"remove",values:[ai]})}for(var Gn=arguments.length,Vn=new Array(Gn>1?Gn-1:0),oi=1;oi<Gn;oi++)Vn[oi-1]=arguments[oi];if(Gr&&(!nn||!On.current)){var mi;nn&&(On.current=!0),(mi=zr.current)===null||mi===void 0||mi.onKeyDown.apply(mi,[At].concat(Vn))}qe==null||qe.apply(void 0,[At].concat(Vn))},Yn=function(At){for(var Cn=arguments.length,Ln=new Array(Cn>1?Cn-1:0),nn=1;nn<Cn;nn++)Ln[nn-1]=arguments[nn];if(Gr){var dn;(dn=zr.current)===null||dn===void 0||dn.onKeyUp.apply(dn,[At].concat(Ln))}At.key==="Enter"&&(On.current=!1),me==null||me.apply(void 0,[At].concat(Ln))},Un=function(At){var Cn=He.filter(function(Ln){return Ln!==At});J(Cn,{type:"remove",values:[At]})},ii=function(){On.current=!1},ki=h.useRef(!1),Ya=function(){fn(!0),Et||(V&&!ki.current&&V.apply(void 0,arguments),G.includes("focus")&&je(!0)),ki.current=!0},xa=function(){$r.current=!0,fn(!1,function(){ki.current=!1,$r.current=!1,je(!1)}),!Et&&(En&&(Qe==="tags"?tt(En,{source:"submit"}):Qe==="multiple"&&tt("",{source:"blur"})),Ze&&Ze.apply(void 0,arguments))},fi=[];h.useEffect(function(){return function(){fi.forEach(function(dr){return clearTimeout(dr)}),fi.splice(0,fi.length)}},[]);var pi=function(At){var Cn,Ln=At.target,nn=(Cn=kr.current)===null||Cn===void 0?void 0:Cn.getPopupElement();if(nn&&nn.contains(Ln)){var dn=setTimeout(function(){var Gn=fi.indexOf(dn);if(Gn!==-1&&fi.splice(Gn,1),$n(),!yr&&!nn.contains(document.activeElement)){var Vn;(Vn=rn.current)===null||Vn===void 0||Vn.focus()}});fi.push(dn)}for(var ai=arguments.length,ti=new Array(ai>1?ai-1:0),vi=1;vi<ai;vi++)ti[vi-1]=arguments[vi];$t==null||$t.apply(void 0,[At].concat(ti))},ei=h.useState({}),Ea=(0,R.Z)(ei,2),Ma=Ea[1];function Ja(){Ma({})}var La;qr&&(La=function(At){je(At)}),ze(function(){var dr;return[zn.current,(dr=kr.current)===null||dr===void 0?void 0:dr.getPopupElement()]},Mn,je,!!qr);var Qa=h.useMemo(function(){return(0,be.Z)((0,be.Z)({},d),{},{notFoundContent:Te,open:Gr,triggerOpen:Mn,id:N,showSearch:Dr,multiple:qt,toggleOpen:je})},[d,Te,Mn,Gr,N,Dr,qt,je]),$i=!!lr||Ft,qi;$i&&(qi=h.createElement(lt,{className:x()("".concat(g,"-arrow"),(0,U.Z)({},"".concat(g,"-arrow-loading"),Ft)),customizeIcon:lr,customizeIconProps:{loading:Ft,searchValue:En,open:Gr,focused:xn,showSearch:Dr}}));var Li=function(){var At;ye==null||ye(),(At=rn.current)===null||At===void 0||At.focus(),J([],{type:"clear",values:He}),Pr("",!1,!1)},ea=Lt(g,Li,He,or,xr,Et,En,Qe),Ra=ea.allowClear,ta=ea.clearIcon,Zi=h.createElement(Yt,{ref:zr}),Ta=x()(g,P,(0,U.Z)((0,U.Z)((0,U.Z)((0,U.Z)((0,U.Z)((0,U.Z)((0,U.Z)((0,U.Z)((0,U.Z)((0,U.Z)({},"".concat(g,"-focused"),xn),"".concat(g,"-multiple"),qt),"".concat(g,"-single"),!qt),"".concat(g,"-allow-clear"),or),"".concat(g,"-show-arrow"),$i),"".concat(g,"-disabled"),Et),"".concat(g,"-loading"),Ft),"".concat(g,"-open"),Gr),"".concat(g,"-customize-input"),ri),"".concat(g,"-show-search"),Dr)),Fi=h.createElement(I,{ref:kr,disabled:Et,prefixCls:g,visible:Mn,popupElement:Zi,animation:Tt,transitionName:Or,dropdownStyle:Xr,dropdownClassName:Vr,direction:Re,dropdownMatchSelectWidth:pr,dropdownRender:tn,dropdownAlign:mr,placement:jr,builtinPlacements:Kr,getPopupContainer:Tr,empty:Me,getTriggerDOMNode:function(At){return Yr.current||At},onPopupVisibleChange:La,onPopupMouseEnter:Ja},qr?h.cloneElement(qr,{ref:Hn}):h.createElement(rr,(0,B.Z)({},d,{domRef:Yr,prefixCls:g,inputElement:ri,ref:rn,id:N,prefix:Lr,showSearch:Dr,autoClearSearchValue:ar,mode:Qe,activeDescendantId:gr,tagRender:ve,values:He,open:Gr,onToggleOpen:je,activeValue:wr,searchValue:En,onSearch:Pr,onSearchSubmit:Ae,onRemove:Un,tokenWithEnter:gt,onInputBlur:ii}))),In;return qr?In=Fi:In=h.createElement("div",(0,B.Z)({className:Ta},Ur,{ref:zn,onMouseDown:pi,onKeyDown:Sn,onKeyUp:Yn,onFocus:Ya,onBlur:xa}),h.createElement(de,{visible:xn&&!Gr,values:He}),Fi,qi,Ra&&ta),h.createElement(st.Provider,{value:Qa},In)}),Le=De,ct=function(){return null};ct.isSelectOptGroup=!0;var Xe=ct,Se=function(){return null};Se.isSelectOption=!0;var $e=Se,ur=b(80547),Sr=b(2738),er=b(65283);function Rr(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var et=["disabled","title","children","style","className"];function nt(d){return typeof d=="string"||typeof d=="number"}var It=function(v,F){var N=he(),g=N.prefixCls,P=N.id,le=N.open,ve=N.multiple,Re=N.mode,Ce=N.searchValue,He=N.toggleOpen,J=N.notFoundContent,Me=N.onPopupScroll,X=h.useContext(k),Te=X.maxCount,ye=X.flattenOptions,Qe=X.onActiveValue,Et=X.defaultActiveFirstOption,Ft=X.onSelect,Qt=X.menuItemSelectedIcon,Wt=X.rawValues,hr=X.fieldNames,xt=X.virtual,Cr=X.direction,wr=X.listHeight,Nt=X.listItemHeight,gr=X.optionRender,Kt="".concat(g,"-item"),ar=(0,ur.Z)(function(){return ye},[le,ye],function(ut,G){return G[0]&&ut[1]!==G[1]}),tt=h.useRef(null),St=h.useMemo(function(){return ve&&oe(Te)&&(Wt==null?void 0:Wt.size)>=Te},[ve,Te,Wt==null?void 0:Wt.size]),Ut=function(G){G.preventDefault()},or=function(G){var V;(V=tt.current)===null||V===void 0||V.scrollTo(typeof G=="number"?{index:G}:G)},Lr=h.useCallback(function(ut){return Re==="combobox"?!1:Wt.has(ut)},[Re,(0,q.Z)(Wt).toString(),Wt.size]),lr=function(G){for(var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ze=ar.length,me=0;me<Ze;me+=1){var qe=(G+me*V+Ze)%Ze,$t=ar[qe]||{},tr=$t.group,qt=$t.data;if(!tr&&!(qt!=null&&qt.disabled)&&(Lr(qt.value)||!St))return qe}return-1},xr=h.useState(function(){return lr(0)}),Yt=(0,R.Z)(xr,2),Tt=Yt[0],Or=Yt[1],Xr=function(G){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;Or(G);var Ze={source:V?"keyboard":"mouse"},me=ar[G];if(!me){Qe(null,-1,Ze);return}Qe(me.value,G,Ze)};(0,h.useEffect)(function(){Xr(Et!==!1?lr(0):-1)},[ar.length,Ce]);var Vr=h.useCallback(function(ut){return Re==="combobox"?String(ut).toLowerCase()===Ce.toLowerCase():Wt.has(ut)},[Re,Ce,(0,q.Z)(Wt).toString(),Wt.size]);(0,h.useEffect)(function(){var ut=setTimeout(function(){if(!ve&&le&&Wt.size===1){var V=Array.from(Wt)[0],Ze=ar.findIndex(function(me){var qe=me.data;return Ce?String(qe.value).startsWith(Ce):qe.value===V});Ze!==-1&&(Xr(Ze),or(Ze))}});if(le){var G;(G=tt.current)===null||G===void 0||G.scrollTo(void 0)}return function(){return clearTimeout(ut)}},[le,Ce]);var pr=function(G){G!==void 0&&Ft(G,{selected:!Wt.has(G)}),ve||He(!1)};if(h.useImperativeHandle(F,function(){return{onKeyDown:function(G){var V=G.which,Ze=G.ctrlKey;switch(V){case re.Z.N:case re.Z.P:case re.Z.UP:case re.Z.DOWN:{var me=0;if(V===re.Z.UP?me=-1:V===re.Z.DOWN?me=1:Rr()&&Ze&&(V===re.Z.N?me=1:V===re.Z.P&&(me=-1)),me!==0){var qe=lr(Tt+me,me);or(qe),Xr(qe,!0)}break}case re.Z.TAB:case re.Z.ENTER:{var $t,tr=ar[Tt];tr&&!(tr!=null&&($t=tr.data)!==null&&$t!==void 0&&$t.disabled)&&!St?pr(tr.value):pr(void 0),le&&G.preventDefault();break}case re.Z.ESC:He(!1),le&&G.stopPropagation()}},onKeyUp:function(){},scrollTo:function(G){or(G)}}}),ar.length===0)return h.createElement("div",{role:"listbox",id:"".concat(P,"_list"),className:"".concat(Kt,"-empty"),onMouseDown:Ut},J);var tn=Object.keys(hr).map(function(ut){return hr[ut]}),mr=function(G){return G.label};function jr(ut,G){var V=ut.group;return{role:V?"presentation":"option",id:"".concat(P,"_list_").concat(G)}}var Kr=function(G){var V=ar[G];if(!V)return null;var Ze=V.data||{},me=Ze.value,qe=V.group,$t=(0,Ge.Z)(Ze,!0),tr=mr(V);return V?h.createElement("div",(0,B.Z)({"aria-label":typeof tr=="string"&&!qe?tr:null},$t,{key:G},jr(V,G),{"aria-selected":Vr(me)}),me):null},Tr={role:"listbox",id:"".concat(P,"_list")};return h.createElement(h.Fragment,null,xt&&h.createElement("div",(0,B.Z)({},Tr,{style:{height:0,width:0,overflow:"hidden"}}),Kr(Tt-1),Kr(Tt),Kr(Tt+1)),h.createElement(er.Z,{itemKey:"key",ref:tt,data:ar,height:wr,itemHeight:Nt,fullHeight:!1,onMouseDown:Ut,onScroll:Me,virtual:xt,direction:Cr,innerProps:xt?null:Tr},function(ut,G){var V=ut.group,Ze=ut.groupOption,me=ut.data,qe=ut.label,$t=ut.value,tr=me.key;if(V){var qt,Dr=(qt=me.title)!==null&&qt!==void 0?qt:nt(qe)?qe.toString():void 0;return h.createElement("div",{className:x()(Kt,"".concat(Kt,"-group"),me.className),title:Dr},qe!==void 0?qe:tr)}var Ur=me.disabled,Ar=me.title,on=me.children,yr=me.style,bn=me.className,zn=(0,te.Z)(me,et),Yr=(0,Sr.Z)(zn,tn),kr=Lr($t),rn=Ur||!kr&&St,zr="".concat(Kt,"-option"),$r=x()(Kt,zr,bn,(0,U.Z)((0,U.Z)((0,U.Z)((0,U.Z)({},"".concat(zr,"-grouped"),Ze),"".concat(zr,"-active"),Tt===G&&!rn),"".concat(zr,"-disabled"),rn),"".concat(zr,"-selected"),kr)),jn=mr(ut),Nn=!Qt||typeof Qt=="function"||kr,xn=typeof jn=="number"?jn:jn||$t,fn=nt(xn)?xn.toString():void 0;return Ar!==void 0&&(fn=Ar),h.createElement("div",(0,B.Z)({},(0,Ge.Z)(Yr),xt?{}:jr(ut,G),{"aria-selected":Vr($t),className:$r,title:fn,onMouseMove:function(){Tt===G||rn||Xr(G)},onClick:function(){rn||pr($t)},style:yr}),h.createElement("div",{className:"".concat(zr,"-content")},typeof gr=="function"?gr(ut,{index:G}):xn),h.isValidElement(Qt)||kr,Nn&&h.createElement(lt,{className:"".concat(Kt,"-option-state"),customizeIcon:Qt,customizeIconProps:{value:$t,disabled:rn,isSelected:kr}},kr?"\u2713":null))}))},_t=h.forwardRef(It),Ht=_t,Xt=function(d,v){var F=h.useRef({values:new Map,options:new Map}),N=h.useMemo(function(){var P=F.current,le=P.values,ve=P.options,Re=d.map(function(J){if(J.label===void 0){var Me;return(0,be.Z)((0,be.Z)({},J),{},{label:(Me=le.get(J.value))===null||Me===void 0?void 0:Me.label})}return J}),Ce=new Map,He=new Map;return Re.forEach(function(J){Ce.set(J.value,J),He.set(J.value,v.get(J.value)||ve.get(J.value))}),F.current.values=Ce,F.current.options=He,Re},[d,v]),g=h.useCallback(function(P){return v.get(P)||F.current.options.get(P)},[v]);return[N,g]};function wt(d,v){return z(d).join("").toUpperCase().includes(v)}var Jt=function(d,v,F,N,g){return h.useMemo(function(){if(!F||N===!1)return d;var P=v.options,le=v.label,ve=v.value,Re=[],Ce=typeof N=="function",He=F.toUpperCase(),J=Ce?N:function(X,Te){return g?wt(Te[g],He):Te[P]?wt(Te[le!=="children"?le:"label"],He):wt(Te[ve],He)},Me=Ce?function(X){return ie(X)}:function(X){return X};return d.forEach(function(X){if(X[P]){var Te=J(F,Me(X));if(Te)Re.push(X);else{var ye=X[P].filter(function(Qe){return J(F,Me(Qe))});ye.length&&Re.push((0,be.Z)((0,be.Z)({},X),{},(0,U.Z)({},P,ye)))}return}J(F,Me(X))&&Re.push(X)}),Re},[d,N,g,F,v])},dt=b(6551),Br=b(11592),Zt=["children","value"],nr=["children"];function Dt(d){var v=d,F=v.key,N=v.props,g=N.children,P=N.value,le=(0,te.Z)(N,Zt);return(0,be.Z)({key:F,value:P!==void 0?P:F,children:g},le)}function Fr(d){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(0,Br.Z)(d).map(function(F,N){if(!h.isValidElement(F)||!F.type)return null;var g=F,P=g.type.isSelectOptGroup,le=g.key,ve=g.props,Re=ve.children,Ce=(0,te.Z)(ve,nr);return v||!P?Dt(F):(0,be.Z)((0,be.Z)({key:"__RC_SELECT_GRP__".concat(le===null?N:le,"__"),label:le},Ce),{},{options:Fr(Re)})}).filter(function(F){return F})}var un=function(v,F,N,g,P){return h.useMemo(function(){var le=v,ve=!v;ve&&(le=Fr(F));var Re=new Map,Ce=new Map,He=function(X,Te,ye){ye&&typeof ye=="string"&&X.set(Te[ye],Te)},J=function Me(X){for(var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ye=0;ye<X.length;ye+=1){var Qe=X[ye];!Qe[N.options]||Te?(Re.set(Qe[N.value],Qe),He(Ce,Qe,N.label),He(Ce,Qe,g),He(Ce,Qe,P)):Me(Qe[N.options],!0)}};return J(le),{options:le,valueOptions:Re,labelOptions:Ce}},[v,F,N,g,P])},Wr=un;function Bt(d){var v=h.useRef();v.current=d;var F=h.useCallback(function(){return v.current.apply(v,arguments)},[]);return F}function ir(d){var v=d.mode,F=d.options,N=d.children,g=d.backfill,P=d.allowClear,le=d.placeholder,ve=d.getInputElement,Re=d.showSearch,Ce=d.onSearch,He=d.defaultOpen,J=d.autoFocus,Me=d.labelInValue,X=d.value,Te=d.inputValue,ye=d.optionLabelProp,Qe=isMultiple(v),Et=Re!==void 0?Re:Qe||v==="combobox",Ft=F||convertChildrenToData(N);if(warning(v!=="tags"||Ft.every(function(xt){return!xt.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),v==="tags"||v==="combobox"){var Qt=Ft.some(function(xt){return xt.options?xt.options.some(function(Cr){return typeof("value"in Cr?Cr.value:Cr.key)=="number"}):typeof("value"in xt?xt.value:xt.key)=="number"});warning(!Qt,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(v!=="combobox"||!ye,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(v==="combobox"||!g,"`backfill` only works with `combobox` mode."),warning(v==="combobox"||!ve,"`getInputElement` only work with `combobox` mode."),noteOnce(v!=="combobox"||!ve||!P||!le,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ce&&!Et&&v!=="combobox"&&v!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!He||J,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),X!=null){var Wt=toArray(X);warning(!Me||Wt.every(function(xt){return _typeof(xt)==="object"&&("key"in xt||"value"in xt)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!Qe||Array.isArray(X),"`value` should be array when `mode` is `multiple` or `tags`")}if(N){var hr=null;toNodeArray(N).some(function(xt){if(!React.isValidElement(xt)||!xt.type)return!1;var Cr=xt,wr=Cr.type;if(wr.isSelectOption)return!1;if(wr.isSelectOptGroup){var Nt=toNodeArray(xt.props.children).every(function(gr){return!React.isValidElement(gr)||!xt.type||gr.type.isSelectOption?!0:(hr=gr.type,!1)});return!Nt}return hr=wr,!0}),hr&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(hr.displayName||hr.name||hr,"`.")),warning(Te===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function fr(d,v){if(d){var F=function N(g){for(var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,le=0;le<g.length;le++){var ve=g[le];if(ve[v==null?void 0:v.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!P&&Array.isArray(ve[v==null?void 0:v.options])&&N(ve[v==null?void 0:v.options],!0))break}};F(d)}}var jt=null,kt=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","optionRender","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","labelRender","value","defaultValue","labelInValue","onChange","maxCount"],Er=["inputValue"];function Pt(d){return!d||(0,ae.Z)(d)!=="object"}var Y=h.forwardRef(function(d,v){var F=d.id,N=d.mode,g=d.prefixCls,P=g===void 0?"rc-select":g,le=d.backfill,ve=d.fieldNames,Re=d.inputValue,Ce=d.searchValue,He=d.onSearch,J=d.autoClearSearchValue,Me=J===void 0?!0:J,X=d.onSelect,Te=d.onDeselect,ye=d.dropdownMatchSelectWidth,Qe=ye===void 0?!0:ye,Et=d.filterOption,Ft=d.filterSort,Qt=d.optionFilterProp,Wt=d.optionLabelProp,hr=d.options,xt=d.optionRender,Cr=d.children,wr=d.defaultActiveFirstOption,Nt=d.menuItemSelectedIcon,gr=d.virtual,Kt=d.direction,ar=d.listHeight,tt=ar===void 0?200:ar,St=d.listItemHeight,Ut=St===void 0?20:St,or=d.labelRender,Lr=d.value,lr=d.defaultValue,xr=d.labelInValue,Yt=d.onChange,Tt=d.maxCount,Or=(0,te.Z)(d,kt),Xr=(0,dt.ZP)(F),Vr=ge(N),pr=!!(!hr&&Cr),tn=h.useMemo(function(){return Et===void 0&&N==="combobox"?!1:Et},[Et,N]),mr=h.useMemo(function(){return $(ve,pr)},[JSON.stringify(ve),pr]),jr=(0,Je.Z)("",{value:Ce!==void 0?Ce:Re,postState:function(gt){return gt||""}}),Kr=(0,R.Z)(jr,2),Tr=Kr[0],ut=Kr[1],G=Wr(hr,Cr,mr,Qt,Wt),V=G.valueOptions,Ze=G.labelOptions,me=G.options,qe=h.useCallback(function(je){var gt=z(je);return gt.map(function(it){var vt,sr,Pr,Ae,Ye;if(Pt(it))vt=it;else{var zt;Pr=it.key,sr=it.label,vt=(zt=it.value)!==null&&zt!==void 0?zt:Pr}var Gt=V.get(vt);if(Gt){var br;if(sr===void 0&&(sr=Gt==null?void 0:Gt[Wt||mr.label]),Pr===void 0&&(Pr=(br=Gt==null?void 0:Gt.key)!==null&&br!==void 0?br:vt),Ae=Gt==null?void 0:Gt.disabled,Ye=Gt==null?void 0:Gt.title,0)var On}return{label:sr,value:vt,key:Pr,disabled:Ae,title:Ye}})},[mr,Wt,V]),$t=(0,Je.Z)(lr,{value:Lr}),tr=(0,R.Z)($t,2),qt=tr[0],Dr=tr[1],Ur=h.useMemo(function(){var je,gt=Vr&&qt===null?[]:qt,it=qe(gt);return N==="combobox"&&Ne((je=it[0])===null||je===void 0?void 0:je.value)?[]:it},[qt,qe,N,Vr]),Ar=Xt(Ur,V),on=(0,R.Z)(Ar,2),yr=on[0],bn=on[1],zn=h.useMemo(function(){if(!N&&yr.length===1){var je=yr[0];if(je.value===null&&(je.label===null||je.label===void 0))return[]}return yr.map(function(gt){var it;return(0,be.Z)((0,be.Z)({},gt),{},{label:(it=typeof or=="function"?or(gt):gt.label)!==null&&it!==void 0?it:gt.value})})},[N,yr,or]),Yr=h.useMemo(function(){return new Set(yr.map(function(je){return je.value}))},[yr]);h.useEffect(function(){if(N==="combobox"){var je,gt=(je=yr[0])===null||je===void 0?void 0:je.value;ut(ue(gt)?String(gt):"")}},[yr]);var kr=Bt(function(je,gt){var it=gt!=null?gt:je;return(0,U.Z)((0,U.Z)({},mr.value,je),mr.label,it)}),rn=h.useMemo(function(){if(N!=="tags")return me;var je=(0,q.Z)(me),gt=function(vt){return V.has(vt)};return(0,q.Z)(yr).sort(function(it,vt){return it.value<vt.value?-1:1}).forEach(function(it){var vt=it.value;gt(vt)||je.push(kr(vt,it.label))}),je},[kr,me,V,yr,N]),zr=Jt(rn,mr,Tr,tn,Qt),$r=h.useMemo(function(){return N!=="tags"||!Tr||zr.some(function(je){return je[Qt||"value"]===Tr})||zr.some(function(je){return je[mr.value]===Tr})?zr:[kr(Tr)].concat((0,q.Z)(zr))},[kr,Qt,N,zr,Tr,mr]),jn=function je(gt){var it=(0,q.Z)(gt).sort(function(vt,sr){return Ft(vt,sr,{searchValue:Tr})});return it.map(function(vt){return Array.isArray(vt.options)?(0,be.Z)((0,be.Z)({},vt),{},{options:vt.options.length>0?je(vt.options):vt.options}):vt})},Nn=h.useMemo(function(){return Ft?jn($r):$r},[$r,Ft,Tr]),xn=h.useMemo(function(){return ce(Nn,{fieldNames:mr,childrenAsData:pr})},[Nn,mr,pr]),fn=function(gt){var it=qe(gt);if(Dr(it),Yt&&(it.length!==yr.length||it.some(function(Pr,Ae){var Ye;return((Ye=yr[Ae])===null||Ye===void 0?void 0:Ye.value)!==(Pr==null?void 0:Pr.value)}))){var vt=xr?it:it.map(function(Pr){return Pr.value}),sr=it.map(function(Pr){return ie(bn(Pr.value))});Yt(Vr?vt:vt[0],Vr?sr:sr[0])}},$n=h.useState(null),En=(0,R.Z)($n,2),ri=En[0],qr=En[1],Hn=h.useState(0),ui=(0,R.Z)(Hn,2),ni=ui[0],di=ui[1],Bn=wr!==void 0?wr:N!=="combobox",Zr=h.useCallback(function(je,gt){var it=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},vt=it.source,sr=vt===void 0?"keyboard":vt;di(gt),le&&N==="combobox"&&je!==null&&sr==="keyboard"&&qr(String(je))},[le,N]),cn=function(gt,it,vt){var sr=function(){var Un,ii=bn(gt);return[xr?{label:ii==null?void 0:ii[mr.label],value:gt,key:(Un=ii==null?void 0:ii.key)!==null&&Un!==void 0?Un:gt}:gt,ie(ii)]};if(it&&X){var Pr=sr(),Ae=(0,R.Z)(Pr,2),Ye=Ae[0],zt=Ae[1];X(Ye,zt)}else if(!it&&Te&&vt!=="clear"){var Gt=sr(),br=(0,R.Z)(Gt,2),On=br[0],Sn=br[1];Te(On,Sn)}},qn=Bt(function(je,gt){var it,vt=Vr?gt.selected:!0;vt?it=Vr?[].concat((0,q.Z)(yr),[je]):[je]:it=yr.filter(function(sr){return sr.value!==je}),fn(it),cn(je,vt),N==="combobox"?qr(""):(!ge||Me)&&(ut(""),qr(""))}),Jr=function(gt,it){fn(gt);var vt=it.type,sr=it.values;(vt==="remove"||vt==="clear")&&sr.forEach(function(Pr){cn(Pr.value,!1,vt)})},Gr=function(gt,it){if(ut(gt),qr(null),it.source==="submit"){var vt=(gt||"").trim();if(vt){var sr=Array.from(new Set([].concat((0,q.Z)(Yr),[vt])));fn(sr),cn(vt,!0),ut("")}return}it.source!=="blur"&&(N==="combobox"&&fn(gt),He==null||He(gt))},Kn=function(gt){var it=gt;N!=="tags"&&(it=gt.map(function(sr){var Pr=Ze.get(sr);return Pr==null?void 0:Pr.value}).filter(function(sr){return sr!==void 0}));var vt=Array.from(new Set([].concat((0,q.Z)(Yr),(0,q.Z)(it))));fn(vt),vt.forEach(function(sr){cn(sr,!0)})},Mn=h.useMemo(function(){var je=gr!==!1&&Qe!==!1;return(0,be.Z)((0,be.Z)({},G),{},{flattenOptions:xn,onActiveValue:Zr,defaultActiveFirstOption:Bn,onSelect:qn,menuItemSelectedIcon:Nt,rawValues:Yr,fieldNames:mr,virtual:je,direction:Kt,listHeight:tt,listItemHeight:Ut,childrenAsData:pr,maxCount:Tt,optionRender:xt})},[Tt,G,xn,Zr,Bn,qn,Nt,Yr,mr,gr,Qe,Kt,tt,Ut,pr,xt]);return h.createElement(k.Provider,{value:Mn},h.createElement(Le,(0,B.Z)({},Or,{id:Xr,prefixCls:P,ref:v,omitDomProps:Er,mode:N,displayValues:zn,onDisplayValuesChange:Jr,direction:Kt,searchValue:Tr,onSearch:Gr,autoClearSearchValue:Me,onSearchSplit:Kn,dropdownMatchSelectWidth:Qe,OptionList:Ht,emptyOptions:!xn.length,activeValue:ri,activeDescendantId:"".concat(Xr,"_list_").concat(ni)})))}),yt=Y;yt.Option=$e,yt.OptGroup=Xe;var Mr=yt,cr=Mr},22711:function(yn,ot,b){"use strict";b.r(ot),b.d(ot,{ResizableTextArea:function(){return Rt},default:function(){return j}});var B=b(71409),q=b(87075),U=b(89490),be=b(62730),R=b(11036),te=b(39224),ae=b(92310),Je=b.n(ae),ee=b(36901),h=b(66003),We=b(30292),x=b(18929),Pe=b(59301),T=b(28788),ht=b(29301),Mt=b(34280),lt=b(16089),Lt=`
|
|
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;
|
|
pointer-events: none !important;
|
|
`,st=["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","white-space"],he={},W;function pt(z){var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,M=z.getAttribute("id")||z.getAttribute("data-reactid")||z.getAttribute("name");if(Ie&&he[M])return he[M];var ue=window.getComputedStyle(z),Ne=ue.getPropertyValue("box-sizing")||ue.getPropertyValue("-moz-box-sizing")||ue.getPropertyValue("-webkit-box-sizing"),fe=parseFloat(ue.getPropertyValue("padding-bottom"))+parseFloat(ue.getPropertyValue("padding-top")),_e=parseFloat(ue.getPropertyValue("border-bottom-width"))+parseFloat(ue.getPropertyValue("border-top-width")),Ve=st.map(function(Ke){return"".concat(Ke,":").concat(ue.getPropertyValue(Ke))}).join(";"),Ee={sizingStyle:Ve,paddingSize:fe,borderSize:_e,boxSizing:Ne};return Ie&&M&&(he[M]=Ee),Ee}function ze(z){var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,ue=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;W||(W=document.createElement("textarea"),W.setAttribute("tab-index","-1"),W.setAttribute("aria-hidden","true"),W.setAttribute("name","hiddenTextarea"),document.body.appendChild(W)),z.getAttribute("wrap")?W.setAttribute("wrap",z.getAttribute("wrap")):W.removeAttribute("wrap");var Ne=pt(z,Ie),fe=Ne.paddingSize,_e=Ne.borderSize,Ve=Ne.boxSizing,Ee=Ne.sizingStyle;W.setAttribute("style","".concat(Ee,";").concat(Lt)),W.value=z.value||z.placeholder||"";var Ke=void 0,Fe=void 0,Ot,Ct=W.scrollHeight;if(Ve==="border-box"?Ct+=_e:Ve==="content-box"&&(Ct-=fe),M!==null||ue!==null){W.value=" ";var bt=W.scrollHeight-fe;M!==null&&(Ke=bt*M,Ve==="border-box"&&(Ke=Ke+fe+_e),Ct=Math.max(Ke,Ct)),ue!==null&&(Fe=bt*ue,Ve==="border-box"&&(Fe=Fe+fe+_e),Ot=Ct>Fe?"":"hidden",Ct=Math.min(Fe,Ct))}var Oe={height:Ct,overflowY:Ot,resize:"none"};return Ke&&(Oe.minHeight=Ke),Fe&&(Oe.maxHeight=Fe),Oe}var re=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],mt=0,Ge=1,Q=2,at=Pe.forwardRef(function(z,Ie){var M=z,ue=M.prefixCls,Ne=M.defaultValue,fe=M.value,_e=M.autoSize,Ve=M.onResize,Ee=M.className,Ke=M.style,Fe=M.disabled,Ot=M.onChange,Ct=M.onInternalAutoSize,bt=(0,te.Z)(M,re),Oe=(0,x.Z)(Ne,{value:fe,postState:function($e){return $e!=null?$e:""}}),vr=(0,R.Z)(Oe,2),rr=vr[0],D=vr[1],p=function($e){D($e.target.value),Ot==null||Ot($e)},C=Pe.useRef();Pe.useImperativeHandle(Ie,function(){return{textArea:C.current}});var m=Pe.useMemo(function(){return _e&&(0,T.Z)(_e)==="object"?[_e.minRows,_e.maxRows]:[]},[_e]),w=(0,R.Z)(m,2),I=w[0],A=w[1],H=!!_e,oe=function(){try{if(document.activeElement===C.current){var $e=C.current,ur=$e.selectionStart,Sr=$e.selectionEnd,er=$e.scrollTop;C.current.setSelectionRange(ur,Sr),C.current.scrollTop=er}}catch(Rr){}},$=Pe.useState(Q),ce=(0,R.Z)($,2),ie=ce[0],ne=ce[1],pe=Pe.useState(),k=(0,R.Z)(pe,2),de=k[0],K=k[1],Ue=function(){ne(mt)};(0,Mt.Z)(function(){H&&Ue()},[fe,I,A,H]),(0,Mt.Z)(function(){if(ie===mt)ne(Ge);else if(ie===Ge){var Se=ze(C.current,!1,I,A);ne(Q),K(Se)}else oe()},[ie]);var ge=Pe.useRef(),De=function(){lt.Z.cancel(ge.current)},Le=function($e){ie===Q&&(Ve==null||Ve($e),_e&&(De(),ge.current=(0,lt.Z)(function(){Ue()})))};Pe.useEffect(function(){return De},[]);var ct=H?de:null,Xe=(0,U.Z)((0,U.Z)({},Ke),ct);return(ie===mt||ie===Ge)&&(Xe.overflowY="hidden",Xe.overflowX="hidden"),Pe.createElement(ht.Z,{onResize:Le,disabled:!(_e||Ve)},Pe.createElement("textarea",(0,B.Z)({},bt,{ref:C,style:Xe,className:Je()(ue,Ee,(0,q.Z)({},"".concat(ue,"-disabled"),Fe)),disabled:Fe,value:rr,onChange:p})))}),Rt=at,O=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize","onClear","onPressEnter","readOnly","autoSize","onKeyDown"],E=Pe.forwardRef(function(z,Ie){var M,ue=z.defaultValue,Ne=z.value,fe=z.onFocus,_e=z.onBlur,Ve=z.onChange,Ee=z.allowClear,Ke=z.maxLength,Fe=z.onCompositionStart,Ot=z.onCompositionEnd,Ct=z.suffix,bt=z.prefixCls,Oe=bt===void 0?"rc-textarea":bt,vr=z.showCount,rr=z.count,D=z.className,p=z.style,C=z.disabled,m=z.hidden,w=z.classNames,I=z.styles,A=z.onResize,H=z.onClear,oe=z.onPressEnter,$=z.readOnly,ce=z.autoSize,ie=z.onKeyDown,ne=(0,te.Z)(z,O),pe=(0,x.Z)(ue,{value:Ne,defaultValue:ue}),k=(0,R.Z)(pe,2),de=k[0],K=k[1],Ue=de==null?"":String(de),ge=Pe.useState(!1),De=(0,R.Z)(ge,2),Le=De[0],ct=De[1],Xe=Pe.useRef(!1),Se=Pe.useState(null),$e=(0,R.Z)(Se,2),ur=$e[0],Sr=$e[1],er=(0,Pe.useRef)(null),Rr=(0,Pe.useRef)(null),et=function(){var yt;return(yt=Rr.current)===null||yt===void 0?void 0:yt.textArea},nt=function(){et().focus()};(0,Pe.useImperativeHandle)(Ie,function(){var Y;return{resizableTextArea:Rr.current,focus:nt,blur:function(){et().blur()},nativeElement:((Y=er.current)===null||Y===void 0?void 0:Y.nativeElement)||et()}}),(0,Pe.useEffect)(function(){ct(function(Y){return!C&&Y})},[C]);var It=Pe.useState(null),_t=(0,R.Z)(It,2),Ht=_t[0],Xt=_t[1];Pe.useEffect(function(){if(Ht){var Y;(Y=et()).setSelectionRange.apply(Y,(0,be.Z)(Ht))}},[Ht]);var wt=(0,h.Z)(rr,vr),Jt=(M=wt.max)!==null&&M!==void 0?M:Ke,dt=Number(Jt)>0,Br=wt.strategy(Ue),Zt=!!Jt&&Br>Jt,nr=function(yt,Mr){var cr=Mr;!Xe.current&&wt.exceedFormatter&&wt.max&&wt.strategy(Mr)>wt.max&&(cr=wt.exceedFormatter(Mr,{max:wt.max}),Mr!==cr&&Xt([et().selectionStart||0,et().selectionEnd||0])),K(cr),(0,We.rJ)(yt.currentTarget,yt,Ve,cr)},Dt=function(yt){Xe.current=!0,Fe==null||Fe(yt)},Fr=function(yt){Xe.current=!1,nr(yt,yt.currentTarget.value),Ot==null||Ot(yt)},un=function(yt){nr(yt,yt.target.value)},Wr=function(yt){yt.key==="Enter"&&oe&&oe(yt),ie==null||ie(yt)},Bt=function(yt){ct(!0),fe==null||fe(yt)},ir=function(yt){ct(!1),_e==null||_e(yt)},fr=function(yt){K(""),nt(),(0,We.rJ)(et(),yt,Ve)},jt=Ct,kt;wt.show&&(wt.showFormatter?kt=wt.showFormatter({value:Ue,count:Br,maxLength:Jt}):kt="".concat(Br).concat(dt?" / ".concat(Jt):""),jt=Pe.createElement(Pe.Fragment,null,jt,Pe.createElement("span",{className:Je()("".concat(Oe,"-data-count"),w==null?void 0:w.count),style:I==null?void 0:I.count},kt)));var Er=function(yt){var Mr;A==null||A(yt),(Mr=et())!==null&&Mr!==void 0&&Mr.style.height&&Sr(!0)},Pt=!ce&&!vr&&!Ee;return Pe.createElement(ee.BaseInput,{ref:er,value:Ue,allowClear:Ee,handleReset:fr,suffix:jt,prefixCls:Oe,classNames:(0,U.Z)((0,U.Z)({},w),{},{affixWrapper:Je()(w==null?void 0:w.affixWrapper,(0,q.Z)((0,q.Z)({},"".concat(Oe,"-show-count"),vr),"".concat(Oe,"-textarea-allow-clear"),Ee))}),disabled:C,focused:Le,className:Je()(D,Zt&&"".concat(Oe,"-out-of-range")),style:(0,U.Z)((0,U.Z)({},p),ur&&!Pt?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof kt=="string"?kt:void 0}},hidden:m,readOnly:$,onClear:H},Pe.createElement(Rt,(0,B.Z)({},ne,{autoSize:ce,maxLength:Ke,onKeyDown:Wr,onChange:un,onFocus:Bt,onBlur:ir,onCompositionStart:Dt,onCompositionEnd:Fr,className:Je()(w==null?void 0:w.textarea),style:(0,U.Z)((0,U.Z)({},I==null?void 0:I.textarea),{},{resize:p==null?void 0:p.resize}),disabled:C,prefixCls:Oe,onResize:Er,ref:Rr,readOnly:$})))}),Z=E,j=Z},29125:function(yn,ot,b){"use strict";b.d(ot,{G:function(){return be},Z:function(){return Lt}});var B=b(92310),q=b.n(B),U=b(59301);function be(st){var he=st.children,W=st.prefixCls,pt=st.id,ze=st.overlayInnerStyle,re=st.bodyClassName,mt=st.className,Ge=st.style;return U.createElement("div",{className:q()("".concat(W,"-content"),mt),style:Ge},U.createElement("div",{className:q()("".concat(W,"-inner"),re),id:pt,role:"tooltip",style:ze},typeof he=="function"?he():he))}var R=b(71409),te=b(89490),ae=b(39224),Je=b(65352),ee={shiftX:64,adjustY:1},h={adjustX:1,shiftY:!0},We=[0,0],x={left:{points:["cr","cl"],overflow:h,offset:[-4,0],targetOffset:We},right:{points:["cl","cr"],overflow:h,offset:[4,0],targetOffset:We},top:{points:["bc","tc"],overflow:ee,offset:[0,-4],targetOffset:We},bottom:{points:["tc","bc"],overflow:ee,offset:[0,4],targetOffset:We},topLeft:{points:["bl","tl"],overflow:ee,offset:[0,-4],targetOffset:We},leftTop:{points:["tr","tl"],overflow:h,offset:[-4,0],targetOffset:We},topRight:{points:["br","tr"],overflow:ee,offset:[0,-4],targetOffset:We},rightTop:{points:["tl","tr"],overflow:h,offset:[4,0],targetOffset:We},bottomRight:{points:["tr","br"],overflow:ee,offset:[0,4],targetOffset:We},rightBottom:{points:["bl","br"],overflow:h,offset:[4,0],targetOffset:We},bottomLeft:{points:["tl","bl"],overflow:ee,offset:[0,4],targetOffset:We},leftBottom:{points:["br","bl"],overflow:h,offset:[-4,0],targetOffset:We}},Pe=null,T=b(80402),ht=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],Mt=function(he,W){var pt=he.overlayClassName,ze=he.trigger,re=ze===void 0?["hover"]:ze,mt=he.mouseEnterDelay,Ge=mt===void 0?0:mt,Q=he.mouseLeaveDelay,at=Q===void 0?.1:Q,Rt=he.overlayStyle,O=he.prefixCls,E=O===void 0?"rc-tooltip":O,Z=he.children,j=he.onVisibleChange,z=he.afterVisibleChange,Ie=he.transitionName,M=he.animation,ue=he.motion,Ne=he.placement,fe=Ne===void 0?"right":Ne,_e=he.align,Ve=_e===void 0?{}:_e,Ee=he.destroyTooltipOnHide,Ke=Ee===void 0?!1:Ee,Fe=he.defaultVisible,Ot=he.getTooltipContainer,Ct=he.overlayInnerStyle,bt=he.arrowContent,Oe=he.overlay,vr=he.id,rr=he.showArrow,D=rr===void 0?!0:rr,p=he.classNames,C=he.styles,m=(0,ae.Z)(he,ht),w=(0,T.Z)(vr),I=(0,U.useRef)(null);(0,U.useImperativeHandle)(W,function(){return I.current});var A=(0,te.Z)({},m);"visible"in he&&(A.popupVisible=he.visible);var H=function(){return U.createElement(be,{key:"content",prefixCls:E,id:w,bodyClassName:p==null?void 0:p.body,overlayInnerStyle:(0,te.Z)((0,te.Z)({},Ct),C==null?void 0:C.body)},Oe)},oe=function(){var ce=U.Children.only(Z),ie=(ce==null?void 0:ce.props)||{},ne=(0,te.Z)((0,te.Z)({},ie),{},{"aria-describedby":Oe?w:null});return U.cloneElement(Z,ne)};return U.createElement(Je.Z,(0,R.Z)({popupClassName:q()(pt,p==null?void 0:p.root),prefixCls:E,popup:H,action:re,builtinPlacements:x,popupPlacement:fe,ref:I,popupAlign:Ve,getPopupContainer:Ot,onPopupVisibleChange:j,afterPopupVisibleChange:z,popupTransitionName:Ie,popupAnimation:M,popupMotion:ue,defaultPopupVisible:Fe,autoDestroy:Ke,mouseLeaveDelay:at,popupStyle:(0,te.Z)((0,te.Z)({},Rt),C==null?void 0:C.root),mouseEnterDelay:Ge,arrow:D},A),oe())},lt=(0,U.forwardRef)(Mt),Lt=lt},49658:function(yn,ot){"use strict";ot.Z=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var b=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(b)||/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(b==null?void 0:b.substr(0,4))}},65283:function(yn,ot,b){"use strict";b.d(ot,{Z:function(){return rr}});var B=b(71409),q=b(28788),U=b(89490),be=b(87075),R=b(11036),te=b(39224),ae=b(92310),Je=b.n(ae),ee=b(29301),h=b(70425),We=b(34280),x=b(59301),Pe=b(4676),T=x.forwardRef(function(D,p){var C=D.height,m=D.offsetY,w=D.offsetX,I=D.children,A=D.prefixCls,H=D.onInnerResize,oe=D.innerProps,$=D.rtl,ce=D.extra,ie={},ne={display:"flex",flexDirection:"column"};return m!==void 0&&(ie={height:C,position:"relative",overflow:"hidden"},ne=(0,U.Z)((0,U.Z)({},ne),{},(0,be.Z)((0,be.Z)((0,be.Z)((0,be.Z)((0,be.Z)({transform:"translateY(".concat(m,"px)")},$?"marginRight":"marginLeft",-w),"position","absolute"),"left",0),"right",0),"top",0))),x.createElement("div",{style:ie},x.createElement(ee.Z,{onResize:function(k){var de=k.offsetHeight;de&&H&&H()}},x.createElement("div",(0,B.Z)({style:ne,className:Je()((0,be.Z)({},"".concat(A,"-holder-inner"),A)),ref:p},oe),I,ce)))});T.displayName="Filler";var ht=T;function Mt(D){var p=D.children,C=D.setRef,m=x.useCallback(function(w){C(w)},[]);return x.cloneElement(p,{ref:m})}function lt(D,p,C,m,w,I,A,H){var oe=H.getKey;return D.slice(p,C+1).map(function($,ce){var ie=p+ce,ne=A($,ie,{style:{width:m},offsetX:w}),pe=oe($);return x.createElement(Mt,{key:pe,setRef:function(de){return I($,de)}},ne)})}function Lt(D,p,C,m){var w=C-D,I=p-C,A=Math.min(w,I)*2;if(m<=A){var H=Math.floor(m/2);return m%2?C+H+1:C-H}return w>I?C-(m-I):C+(m-w)}function st(D,p,C){var m=D.length,w=p.length,I,A;if(m===0&&w===0)return null;m<w?(I=D,A=p):(I=p,A=D);var H={__EMPTY_ITEM__:!0};function oe(k){return k!==void 0?C(k):H}for(var $=null,ce=Math.abs(m-w)!==1,ie=0;ie<A.length;ie+=1){var ne=oe(I[ie]),pe=oe(A[ie]);if(ne!==pe){$=ie,ce=ce||ne!==oe(A[ie+1]);break}}return $===null?null:{index:$,multiple:ce}}function he(D,p,C){var m=x.useState(D),w=(0,R.Z)(m,2),I=w[0],A=w[1],H=x.useState(null),oe=(0,R.Z)(H,2),$=oe[0],ce=oe[1];return x.useEffect(function(){var ie=st(I||[],D||[],p);(ie==null?void 0:ie.index)!==void 0&&(C==null||C(ie.index),ce(D[ie.index])),A(D)},[D]),[$]}var W=b(16089),pt=(typeof navigator=="undefined"?"undefined":(0,q.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),ze=pt,re=function(D,p,C,m){var w=(0,x.useRef)(!1),I=(0,x.useRef)(null);function A(){clearTimeout(I.current),w.current=!0,I.current=setTimeout(function(){w.current=!1},50)}var H=(0,x.useRef)({top:D,bottom:p,left:C,right:m});return H.current.top=D,H.current.bottom=p,H.current.left=C,H.current.right=m,function(oe,$){var ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,ie=oe?$<0&&H.current.left||$>0&&H.current.right:$<0&&H.current.top||$>0&&H.current.bottom;return ce&&ie?(clearTimeout(I.current),w.current=!1):(!ie||w.current)&&A(),!w.current&&ie}};function mt(D,p,C,m,w,I,A){var H=(0,x.useRef)(0),oe=(0,x.useRef)(null),$=(0,x.useRef)(null),ce=(0,x.useRef)(!1),ie=re(p,C,m,w);function ne(ge,De){if(W.Z.cancel(oe.current),!ie(!1,De)){var Le=ge;if(!Le._virtualHandled)Le._virtualHandled=!0;else return;H.current+=De,$.current=De,ze||Le.preventDefault(),oe.current=(0,W.Z)(function(){var ct=ce.current?10:1;A(H.current*ct,!1),H.current=0})}}function pe(ge,De){A(De,!0),ze||ge.preventDefault()}var k=(0,x.useRef)(null),de=(0,x.useRef)(null);function K(ge){if(D){W.Z.cancel(de.current),de.current=(0,W.Z)(function(){k.current=null},2);var De=ge.deltaX,Le=ge.deltaY,ct=ge.shiftKey,Xe=De,Se=Le;(k.current==="sx"||!k.current&&ct&&Le&&!De)&&(Xe=Le,Se=0,k.current="sx");var $e=Math.abs(Xe),ur=Math.abs(Se);k.current===null&&(k.current=I&&$e>ur?"x":"y"),k.current==="y"?ne(ge,Se):pe(ge,Xe)}}function Ue(ge){D&&(ce.current=ge.detail===$.current)}return[K,Ue]}function Ge(D,p,C,m){var w=x.useMemo(function(){return[new Map,[]]},[D,C.id,m]),I=(0,R.Z)(w,2),A=I[0],H=I[1],oe=function(ce){var ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ce,ne=A.get(ce),pe=A.get(ie);if(ne===void 0||pe===void 0)for(var k=D.length,de=H.length;de<k;de+=1){var K,Ue=D[de],ge=p(Ue);A.set(ge,de);var De=(K=C.get(ge))!==null&&K!==void 0?K:m;if(H[de]=(H[de-1]||0)+De,ge===ce&&(ne=de),ge===ie&&(pe=de),ne!==void 0&&pe!==void 0)break}return{top:H[ne-1]||0,bottom:H[pe]}};return oe}var Q=b(16552),at=b(19210),Rt=function(){function D(){(0,Q.Z)(this,D),(0,be.Z)(this,"maps",void 0),(0,be.Z)(this,"id",0),(0,be.Z)(this,"diffRecords",new Map),this.maps=Object.create(null)}return(0,at.Z)(D,[{key:"set",value:function(C,m){this.diffRecords.set(C,this.maps[C]),this.maps[C]=m,this.id+=1}},{key:"get",value:function(C){return this.maps[C]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),D}(),O=Rt;function E(D){var p=parseFloat(D);return isNaN(p)?0:p}function Z(D,p,C){var m=x.useState(0),w=(0,R.Z)(m,2),I=w[0],A=w[1],H=(0,x.useRef)(new Map),oe=(0,x.useRef)(new O),$=(0,x.useRef)(0);function ce(){$.current+=1}function ie(){var pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;ce();var k=function(){var Ue=!1;H.current.forEach(function(ge,De){if(ge&&ge.offsetParent){var Le=ge.offsetHeight,ct=getComputedStyle(ge),Xe=ct.marginTop,Se=ct.marginBottom,$e=E(Xe),ur=E(Se),Sr=Le+$e+ur;oe.current.get(De)!==Sr&&(oe.current.set(De,Sr),Ue=!0)}}),Ue&&A(function(ge){return ge+1})};if(pe)k();else{$.current+=1;var de=$.current;Promise.resolve().then(function(){de===$.current&&k()})}}function ne(pe,k){var de=D(pe),K=H.current.get(de);k?(H.current.set(de,k),ie()):H.current.delete(de),!K!=!k&&(k?p==null||p(pe):C==null||C(pe))}return(0,x.useEffect)(function(){return ce},[]),[ne,ie,oe.current,I]}var j=14/15;function z(D,p,C){var m=(0,x.useRef)(!1),w=(0,x.useRef)(0),I=(0,x.useRef)(0),A=(0,x.useRef)(null),H=(0,x.useRef)(null),oe,$=function(pe){if(m.current){var k=Math.ceil(pe.touches[0].pageX),de=Math.ceil(pe.touches[0].pageY),K=w.current-k,Ue=I.current-de,ge=Math.abs(K)>Math.abs(Ue);ge?w.current=k:I.current=de;var De=C(ge,ge?K:Ue,!1,pe);De&&pe.preventDefault(),clearInterval(H.current),De&&(H.current=setInterval(function(){ge?K*=j:Ue*=j;var Le=Math.floor(ge?K:Ue);(!C(ge,Le,!0)||Math.abs(Le)<=.1)&&clearInterval(H.current)},16))}},ce=function(){m.current=!1,oe()},ie=function(pe){oe(),pe.touches.length===1&&!m.current&&(m.current=!0,w.current=Math.ceil(pe.touches[0].pageX),I.current=Math.ceil(pe.touches[0].pageY),A.current=pe.target,A.current.addEventListener("touchmove",$,{passive:!1}),A.current.addEventListener("touchend",ce,{passive:!0}))};oe=function(){A.current&&(A.current.removeEventListener("touchmove",$),A.current.removeEventListener("touchend",ce))},(0,We.Z)(function(){return D&&p.current.addEventListener("touchstart",ie,{passive:!0}),function(){var ne;(ne=p.current)===null||ne===void 0||ne.removeEventListener("touchstart",ie),oe(),clearInterval(H.current)}},[D])}function Ie(D){return Math.floor(Math.pow(D,.5))}function M(D,p){var C="touches"in D?D.touches[0]:D;return C[p?"pageX":"pageY"]-window[p?"scrollX":"scrollY"]}function ue(D,p,C){x.useEffect(function(){var m=p.current;if(D&&m){var w=!1,I,A,H=function(){W.Z.cancel(I)},oe=function ne(){H(),I=(0,W.Z)(function(){C(A),ne()})},$=function(pe){if(!(pe.target.draggable||pe.button!==0)){var k=pe;k._virtualHandled||(k._virtualHandled=!0,w=!0)}},ce=function(){w=!1,H()},ie=function(pe){if(w){var k=M(pe,!1),de=m.getBoundingClientRect(),K=de.top,Ue=de.bottom;if(k<=K){var ge=K-k;A=-Ie(ge),oe()}else if(k>=Ue){var De=k-Ue;A=Ie(De),oe()}else H()}};return m.addEventListener("mousedown",$),m.ownerDocument.addEventListener("mouseup",ce),m.ownerDocument.addEventListener("mousemove",ie),function(){m.removeEventListener("mousedown",$),m.ownerDocument.removeEventListener("mouseup",ce),m.ownerDocument.removeEventListener("mousemove",ie),H()}}},[D])}var Ne=10;function fe(D,p,C,m,w,I,A,H){var oe=x.useRef(),$=x.useState(null),ce=(0,R.Z)($,2),ie=ce[0],ne=ce[1];return(0,We.Z)(function(){if(ie&&ie.times<Ne){if(!D.current){ne(function(wt){return(0,U.Z)({},wt)});return}I();var pe=ie.targetAlign,k=ie.originAlign,de=ie.index,K=ie.offset,Ue=D.current.clientHeight,ge=!1,De=pe,Le=null;if(Ue){for(var ct=pe||k,Xe=0,Se=0,$e=0,ur=Math.min(p.length-1,de),Sr=0;Sr<=ur;Sr+=1){var er=w(p[Sr]);Se=Xe;var Rr=C.get(er);$e=Se+(Rr===void 0?m:Rr),Xe=$e}for(var et=ct==="top"?K:Ue-K,nt=ur;nt>=0;nt-=1){var It=w(p[nt]),_t=C.get(It);if(_t===void 0){ge=!0;break}if(et-=_t,et<=0)break}switch(ct){case"top":Le=Se-K;break;case"bottom":Le=$e-Ue+K;break;default:{var Ht=D.current.scrollTop,Xt=Ht+Ue;Se<Ht?De="top":$e>Xt&&(De="bottom")}}Le!==null&&A(Le),Le!==ie.lastTop&&(ge=!0)}ge&&ne((0,U.Z)((0,U.Z)({},ie),{},{times:ie.times+1,targetAlign:De,lastTop:Le}))}},[ie,D.current]),function(pe){if(pe==null){H();return}if(W.Z.cancel(oe.current),typeof pe=="number")A(pe);else if(pe&&(0,q.Z)(pe)==="object"){var k,de=pe.align;"index"in pe?k=pe.index:k=p.findIndex(function(ge){return w(ge)===pe.key});var K=pe.offset,Ue=K===void 0?0:K;ne({times:0,index:k,offset:Ue,originAlign:de})}}}var _e=x.forwardRef(function(D,p){var C=D.prefixCls,m=D.rtl,w=D.scrollOffset,I=D.scrollRange,A=D.onStartMove,H=D.onStopMove,oe=D.onScroll,$=D.horizontal,ce=D.spinSize,ie=D.containerSize,ne=D.style,pe=D.thumbStyle,k=D.showScrollBar,de=x.useState(!1),K=(0,R.Z)(de,2),Ue=K[0],ge=K[1],De=x.useState(null),Le=(0,R.Z)(De,2),ct=Le[0],Xe=Le[1],Se=x.useState(null),$e=(0,R.Z)(Se,2),ur=$e[0],Sr=$e[1],er=!m,Rr=x.useRef(),et=x.useRef(),nt=x.useState(k),It=(0,R.Z)(nt,2),_t=It[0],Ht=It[1],Xt=x.useRef(),wt=function(){k===!0||k===!1||(clearTimeout(Xt.current),Ht(!0),Xt.current=setTimeout(function(){Ht(!1)},3e3))},Jt=I-ie||0,dt=ie-ce||0,Br=x.useMemo(function(){if(w===0||Jt===0)return 0;var fr=w/Jt;return fr*dt},[w,Jt,dt]),Zt=function(jt){jt.stopPropagation(),jt.preventDefault()},nr=x.useRef({top:Br,dragging:Ue,pageY:ct,startTop:ur});nr.current={top:Br,dragging:Ue,pageY:ct,startTop:ur};var Dt=function(jt){ge(!0),Xe(M(jt,$)),Sr(nr.current.top),A(),jt.stopPropagation(),jt.preventDefault()};x.useEffect(function(){var fr=function(Pt){Pt.preventDefault()},jt=Rr.current,kt=et.current;return jt.addEventListener("touchstart",fr,{passive:!1}),kt.addEventListener("touchstart",Dt,{passive:!1}),function(){jt.removeEventListener("touchstart",fr),kt.removeEventListener("touchstart",Dt)}},[]);var Fr=x.useRef();Fr.current=Jt;var un=x.useRef();un.current=dt,x.useEffect(function(){if(Ue){var fr,jt=function(Pt){var Y=nr.current,yt=Y.dragging,Mr=Y.pageY,cr=Y.startTop;W.Z.cancel(fr);var d=Rr.current.getBoundingClientRect(),v=ie/($?d.width:d.height);if(yt){var F=(M(Pt,$)-Mr)*v,N=cr;!er&&$?N-=F:N+=F;var g=Fr.current,P=un.current,le=P?N/P:0,ve=Math.ceil(le*g);ve=Math.max(ve,0),ve=Math.min(ve,g),fr=(0,W.Z)(function(){oe(ve,$)})}},kt=function(){ge(!1),H()};return window.addEventListener("mousemove",jt,{passive:!0}),window.addEventListener("touchmove",jt,{passive:!0}),window.addEventListener("mouseup",kt,{passive:!0}),window.addEventListener("touchend",kt,{passive:!0}),function(){window.removeEventListener("mousemove",jt),window.removeEventListener("touchmove",jt),window.removeEventListener("mouseup",kt),window.removeEventListener("touchend",kt),W.Z.cancel(fr)}}},[Ue]),x.useEffect(function(){return wt(),function(){clearTimeout(Xt.current)}},[w]),x.useImperativeHandle(p,function(){return{delayHidden:wt}});var Wr="".concat(C,"-scrollbar"),Bt={position:"absolute",visibility:_t?null:"hidden"},ir={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return $?(Bt.height=8,Bt.left=0,Bt.right=0,Bt.bottom=0,ir.height="100%",ir.width=ce,er?ir.left=Br:ir.right=Br):(Bt.width=8,Bt.top=0,Bt.bottom=0,er?Bt.right=0:Bt.left=0,ir.width="100%",ir.height=ce,ir.top=Br),x.createElement("div",{ref:Rr,className:Je()(Wr,(0,be.Z)((0,be.Z)((0,be.Z)({},"".concat(Wr,"-horizontal"),$),"".concat(Wr,"-vertical"),!$),"".concat(Wr,"-visible"),_t)),style:(0,U.Z)((0,U.Z)({},Bt),ne),onMouseDown:Zt,onMouseMove:wt},x.createElement("div",{ref:et,className:Je()("".concat(Wr,"-thumb"),(0,be.Z)({},"".concat(Wr,"-thumb-moving"),Ue)),style:(0,U.Z)((0,U.Z)({},ir),pe),onMouseDown:Dt}))}),Ve=_e,Ee=20;function Ke(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,C=D/p*D;return isNaN(C)&&(C=0),C=Math.max(C,Ee),Math.floor(C)}var Fe=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],Ot=[],Ct={overflowY:"auto",overflowAnchor:"none"};function bt(D,p){var C=D.prefixCls,m=C===void 0?"rc-virtual-list":C,w=D.className,I=D.height,A=D.itemHeight,H=D.fullHeight,oe=H===void 0?!0:H,$=D.style,ce=D.data,ie=D.children,ne=D.itemKey,pe=D.virtual,k=D.direction,de=D.scrollWidth,K=D.component,Ue=K===void 0?"div":K,ge=D.onScroll,De=D.onVirtualScroll,Le=D.onVisibleChange,ct=D.innerProps,Xe=D.extraRender,Se=D.styles,$e=D.showScrollBar,ur=$e===void 0?"optional":$e,Sr=(0,te.Z)(D,Fe),er=x.useCallback(function(G){return typeof ne=="function"?ne(G):G==null?void 0:G[ne]},[ne]),Rr=Z(er,null,null),et=(0,R.Z)(Rr,4),nt=et[0],It=et[1],_t=et[2],Ht=et[3],Xt=!!(pe!==!1&&I&&A),wt=x.useMemo(function(){return Object.values(_t.maps).reduce(function(G,V){return G+V},0)},[_t.id,_t.maps]),Jt=Xt&&ce&&(Math.max(A*ce.length,wt)>I||!!de),dt=k==="rtl",Br=Je()(m,(0,be.Z)({},"".concat(m,"-rtl"),dt),w),Zt=ce||Ot,nr=(0,x.useRef)(),Dt=(0,x.useRef)(),Fr=(0,x.useRef)(),un=(0,x.useState)(0),Wr=(0,R.Z)(un,2),Bt=Wr[0],ir=Wr[1],fr=(0,x.useState)(0),jt=(0,R.Z)(fr,2),kt=jt[0],Er=jt[1],Pt=(0,x.useState)(!1),Y=(0,R.Z)(Pt,2),yt=Y[0],Mr=Y[1],cr=function(){Mr(!0)},d=function(){Mr(!1)},v={getKey:er};function F(G){ir(function(V){var Ze;typeof G=="function"?Ze=G(V):Ze=G;var me=wr(Ze);return nr.current.scrollTop=me,me})}var N=(0,x.useRef)({start:0,end:Zt.length}),g=(0,x.useRef)(),P=he(Zt,er),le=(0,R.Z)(P,1),ve=le[0];g.current=ve;var Re=x.useMemo(function(){if(!Xt)return{scrollHeight:void 0,start:0,end:Zt.length-1,offset:void 0};if(!Jt){var G;return{scrollHeight:((G=Dt.current)===null||G===void 0?void 0:G.offsetHeight)||0,start:0,end:Zt.length-1,offset:void 0}}for(var V=0,Ze,me,qe,$t=Zt.length,tr=0;tr<$t;tr+=1){var qt=Zt[tr],Dr=er(qt),Ur=_t.get(Dr),Ar=V+(Ur===void 0?A:Ur);Ar>=Bt&&Ze===void 0&&(Ze=tr,me=V),Ar>Bt+I&&qe===void 0&&(qe=tr),V=Ar}return Ze===void 0&&(Ze=0,me=0,qe=Math.ceil(I/A)),qe===void 0&&(qe=Zt.length-1),qe=Math.min(qe+1,Zt.length-1),{scrollHeight:V,start:Ze,end:qe,offset:me}},[Jt,Xt,Bt,Zt,Ht,I]),Ce=Re.scrollHeight,He=Re.start,J=Re.end,Me=Re.offset;N.current.start=He,N.current.end=J,x.useLayoutEffect(function(){var G=_t.getRecord();if(G.size===1){var V=Array.from(G.keys())[0],Ze=G.get(V),me=Zt[He];if(me&&Ze===void 0){var qe=er(me);if(qe===V){var $t=_t.get(V),tr=$t-A;F(function(qt){return qt+tr})}}}_t.resetRecord()},[Ce]);var X=x.useState({width:0,height:I}),Te=(0,R.Z)(X,2),ye=Te[0],Qe=Te[1],Et=function(V){Qe({width:V.offsetWidth,height:V.offsetHeight})},Ft=(0,x.useRef)(),Qt=(0,x.useRef)(),Wt=x.useMemo(function(){return Ke(ye.width,de)},[ye.width,de]),hr=x.useMemo(function(){return Ke(ye.height,Ce)},[ye.height,Ce]),xt=Ce-I,Cr=(0,x.useRef)(xt);Cr.current=xt;function wr(G){var V=G;return Number.isNaN(Cr.current)||(V=Math.min(V,Cr.current)),V=Math.max(V,0),V}var Nt=Bt<=0,gr=Bt>=xt,Kt=kt<=0,ar=kt>=de,tt=re(Nt,gr,Kt,ar),St=function(){return{x:dt?-kt:kt,y:Bt}},Ut=(0,x.useRef)(St()),or=(0,h.zX)(function(G){if(De){var V=(0,U.Z)((0,U.Z)({},St()),G);(Ut.current.x!==V.x||Ut.current.y!==V.y)&&(De(V),Ut.current=V)}});function Lr(G,V){var Ze=G;V?((0,Pe.flushSync)(function(){Er(Ze)}),or()):F(Ze)}function lr(G){var V=G.currentTarget.scrollTop;V!==Bt&&F(V),ge==null||ge(G),or()}var xr=function(V){var Ze=V,me=de?de-ye.width:0;return Ze=Math.max(Ze,0),Ze=Math.min(Ze,me),Ze},Yt=(0,h.zX)(function(G,V){V?((0,Pe.flushSync)(function(){Er(function(Ze){var me=Ze+(dt?-G:G);return xr(me)})}),or()):F(function(Ze){var me=Ze+G;return me})}),Tt=mt(Xt,Nt,gr,Kt,ar,!!de,Yt),Or=(0,R.Z)(Tt,2),Xr=Or[0],Vr=Or[1];z(Xt,nr,function(G,V,Ze,me){var qe=me;return tt(G,V,Ze)?!1:!qe||!qe._virtualHandled?(qe&&(qe._virtualHandled=!0),Xr({preventDefault:function(){},deltaX:G?V:0,deltaY:G?0:V}),!0):!1}),ue(Jt,nr,function(G){F(function(V){return V+G})}),(0,We.Z)(function(){function G(Ze){var me=Nt&&Ze.detail<0,qe=gr&&Ze.detail>0;Xt&&!me&&!qe&&Ze.preventDefault()}var V=nr.current;return V.addEventListener("wheel",Xr,{passive:!1}),V.addEventListener("DOMMouseScroll",Vr,{passive:!0}),V.addEventListener("MozMousePixelScroll",G,{passive:!1}),function(){V.removeEventListener("wheel",Xr),V.removeEventListener("DOMMouseScroll",Vr),V.removeEventListener("MozMousePixelScroll",G)}},[Xt,Nt,gr]),(0,We.Z)(function(){if(de){var G=xr(kt);Er(G),or({x:G})}},[ye.width,de]);var pr=function(){var V,Ze;(V=Ft.current)===null||V===void 0||V.delayHidden(),(Ze=Qt.current)===null||Ze===void 0||Ze.delayHidden()},tn=fe(nr,Zt,_t,A,er,function(){return It(!0)},F,pr);x.useImperativeHandle(p,function(){return{nativeElement:Fr.current,getScrollInfo:St,scrollTo:function(V){function Ze(me){return me&&(0,q.Z)(me)==="object"&&("left"in me||"top"in me)}Ze(V)?(V.left!==void 0&&Er(xr(V.left)),tn(V.top)):tn(V)}}}),(0,We.Z)(function(){if(Le){var G=Zt.slice(He,J+1);Le(G,Zt)}},[He,J,Zt]);var mr=Ge(Zt,er,_t,A),jr=Xe==null?void 0:Xe({start:He,end:J,virtual:Jt,offsetX:kt,offsetY:Me,rtl:dt,getSize:mr}),Kr=lt(Zt,He,J,de,kt,nt,ie,v),Tr=null;I&&(Tr=(0,U.Z)((0,be.Z)({},oe?"height":"maxHeight",I),Ct),Xt&&(Tr.overflowY="hidden",de&&(Tr.overflowX="hidden"),yt&&(Tr.pointerEvents="none")));var ut={};return dt&&(ut.dir="rtl"),x.createElement("div",(0,B.Z)({ref:Fr,style:(0,U.Z)((0,U.Z)({},$),{},{position:"relative"}),className:Br},ut,Sr),x.createElement(ee.Z,{onResize:Et},x.createElement(Ue,{className:"".concat(m,"-holder"),style:Tr,ref:nr,onScroll:lr,onMouseEnter:pr},x.createElement(ht,{prefixCls:m,height:Ce,offsetX:kt,offsetY:Me,scrollWidth:de,onInnerResize:It,ref:Dt,innerProps:ct,rtl:dt,extra:jr},Kr))),Jt&&Ce>I&&x.createElement(Ve,{ref:Ft,prefixCls:m,scrollOffset:Bt,scrollRange:Ce,rtl:dt,onScroll:Lr,onStartMove:cr,onStopMove:d,spinSize:hr,containerSize:ye.height,style:Se==null?void 0:Se.verticalScrollBar,thumbStyle:Se==null?void 0:Se.verticalScrollBarThumb,showScrollBar:ur}),Jt&&de>ye.width&&x.createElement(Ve,{ref:Qt,prefixCls:m,scrollOffset:kt,scrollRange:de,rtl:dt,onScroll:Lr,onStartMove:cr,onStopMove:d,spinSize:Wt,containerSize:ye.width,horizontal:!0,style:Se==null?void 0:Se.horizontalScrollBar,thumbStyle:Se==null?void 0:Se.horizontalScrollBarThumb,showScrollBar:ur}))}var Oe=x.forwardRef(bt);Oe.displayName="List";var vr=Oe,rr=vr},76374:function(yn,ot,b){"use strict";var B=function(){if(typeof Map!="undefined")return Map;function O(E,Z){var j=-1;return E.some(function(z,Ie){return z[0]===Z?(j=Ie,!0):!1}),j}return function(){function E(){this.__entries__=[]}return Object.defineProperty(E.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),E.prototype.get=function(Z){var j=O(this.__entries__,Z),z=this.__entries__[j];return z&&z[1]},E.prototype.set=function(Z,j){var z=O(this.__entries__,Z);~z?this.__entries__[z][1]=j:this.__entries__.push([Z,j])},E.prototype.delete=function(Z){var j=this.__entries__,z=O(j,Z);~z&&j.splice(z,1)},E.prototype.has=function(Z){return!!~O(this.__entries__,Z)},E.prototype.clear=function(){this.__entries__.splice(0)},E.prototype.forEach=function(Z,j){j===void 0&&(j=null);for(var z=0,Ie=this.__entries__;z<Ie.length;z++){var M=Ie[z];Z.call(j,M[1],M[0])}},E}()}(),q=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,U=function(){return typeof b.g!="undefined"&&b.g.Math===Math?b.g:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),be=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(U):function(O){return setTimeout(function(){return O(Date.now())},1e3/60)}}(),R=2;function te(O,E){var Z=!1,j=!1,z=0;function Ie(){Z&&(Z=!1,O()),j&&ue()}function M(){be(Ie)}function ue(){var Ne=Date.now();if(Z){if(Ne-z<R)return;j=!0}else Z=!0,j=!1,setTimeout(M,E);z=Ne}return ue}var ae=20,Je=["top","right","bottom","left","width","height","size","weight"],ee=typeof MutationObserver!="undefined",h=function(){function O(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=te(this.refresh.bind(this),ae)}return O.prototype.addObserver=function(E){~this.observers_.indexOf(E)||this.observers_.push(E),this.connected_||this.connect_()},O.prototype.removeObserver=function(E){var Z=this.observers_,j=Z.indexOf(E);~j&&Z.splice(j,1),!Z.length&&this.connected_&&this.disconnect_()},O.prototype.refresh=function(){var E=this.updateObservers_();E&&this.refresh()},O.prototype.updateObservers_=function(){var E=this.observers_.filter(function(Z){return Z.gatherActive(),Z.hasActive()});return E.forEach(function(Z){return Z.broadcastActive()}),E.length>0},O.prototype.connect_=function(){!q||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),ee?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},O.prototype.disconnect_=function(){!q||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},O.prototype.onTransitionEnd_=function(E){var Z=E.propertyName,j=Z===void 0?"":Z,z=Je.some(function(Ie){return!!~j.indexOf(Ie)});z&&this.refresh()},O.getInstance=function(){return this.instance_||(this.instance_=new O),this.instance_},O.instance_=null,O}(),We=function(O,E){for(var Z=0,j=Object.keys(E);Z<j.length;Z++){var z=j[Z];Object.defineProperty(O,z,{value:E[z],enumerable:!1,writable:!1,configurable:!0})}return O},x=function(O){var E=O&&O.ownerDocument&&O.ownerDocument.defaultView;return E||U},Pe=ze(0,0,0,0);function T(O){return parseFloat(O)||0}function ht(O){for(var E=[],Z=1;Z<arguments.length;Z++)E[Z-1]=arguments[Z];return E.reduce(function(j,z){var Ie=O["border-"+z+"-width"];return j+T(Ie)},0)}function Mt(O){for(var E=["top","right","bottom","left"],Z={},j=0,z=E;j<z.length;j++){var Ie=z[j],M=O["padding-"+Ie];Z[Ie]=T(M)}return Z}function lt(O){var E=O.getBBox();return ze(0,0,E.width,E.height)}function Lt(O){var E=O.clientWidth,Z=O.clientHeight;if(!E&&!Z)return Pe;var j=x(O).getComputedStyle(O),z=Mt(j),Ie=z.left+z.right,M=z.top+z.bottom,ue=T(j.width),Ne=T(j.height);if(j.boxSizing==="border-box"&&(Math.round(ue+Ie)!==E&&(ue-=ht(j,"left","right")+Ie),Math.round(Ne+M)!==Z&&(Ne-=ht(j,"top","bottom")+M)),!he(O)){var fe=Math.round(ue+Ie)-E,_e=Math.round(Ne+M)-Z;Math.abs(fe)!==1&&(ue-=fe),Math.abs(_e)!==1&&(Ne-=_e)}return ze(z.left,z.top,ue,Ne)}var st=function(){return typeof SVGGraphicsElement!="undefined"?function(O){return O instanceof x(O).SVGGraphicsElement}:function(O){return O instanceof x(O).SVGElement&&typeof O.getBBox=="function"}}();function he(O){return O===x(O).document.documentElement}function W(O){return q?st(O)?lt(O):Lt(O):Pe}function pt(O){var E=O.x,Z=O.y,j=O.width,z=O.height,Ie=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,M=Object.create(Ie.prototype);return We(M,{x:E,y:Z,width:j,height:z,top:Z,right:E+j,bottom:z+Z,left:E}),M}function ze(O,E,Z,j){return{x:O,y:E,width:Z,height:j}}var re=function(){function O(E){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=ze(0,0,0,0),this.target=E}return O.prototype.isActive=function(){var E=W(this.target);return this.contentRect_=E,E.width!==this.broadcastWidth||E.height!==this.broadcastHeight},O.prototype.broadcastRect=function(){var E=this.contentRect_;return this.broadcastWidth=E.width,this.broadcastHeight=E.height,E},O}(),mt=function(){function O(E,Z){var j=pt(Z);We(this,{target:E,contentRect:j})}return O}(),Ge=function(){function O(E,Z,j){if(this.activeObservations_=[],this.observations_=new B,typeof E!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=E,this.controller_=Z,this.callbackCtx_=j}return O.prototype.observe=function(E){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(E instanceof x(E).Element))throw new TypeError('parameter 1 is not of type "Element".');var Z=this.observations_;Z.has(E)||(Z.set(E,new re(E)),this.controller_.addObserver(this),this.controller_.refresh())}},O.prototype.unobserve=function(E){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(E instanceof x(E).Element))throw new TypeError('parameter 1 is not of type "Element".');var Z=this.observations_;Z.has(E)&&(Z.delete(E),Z.size||this.controller_.removeObserver(this))}},O.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},O.prototype.gatherActive=function(){var E=this;this.clearActive(),this.observations_.forEach(function(Z){Z.isActive()&&E.activeObservations_.push(Z)})},O.prototype.broadcastActive=function(){if(this.hasActive()){var E=this.callbackCtx_,Z=this.activeObservations_.map(function(j){return new mt(j.target,j.broadcastRect())});this.callback_.call(E,Z,E),this.clearActive()}},O.prototype.clearActive=function(){this.activeObservations_.splice(0)},O.prototype.hasActive=function(){return this.activeObservations_.length>0},O}(),Q=typeof WeakMap!="undefined"?new WeakMap:new B,at=function(){function O(E){if(!(this instanceof O))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var Z=h.getInstance(),j=new Ge(E,Z,this);Q.set(this,j)}return O}();["observe","unobserve","disconnect"].forEach(function(O){at.prototype[O]=function(){var E;return(E=Q.get(this))[O].apply(E,arguments)}});var Rt=function(){return typeof U.ResizeObserver!="undefined"?U.ResizeObserver:at}();ot.Z=Rt},16722:function(yn,ot,b){"use strict";b.d(ot,{Z:function(){return Je}});const B=ee=>typeof ee=="object"&&ee!=null&&ee.nodeType===1,q=(ee,h)=>(!h||ee!=="hidden")&&ee!=="visible"&&ee!=="clip",U=(ee,h)=>{if(ee.clientHeight<ee.scrollHeight||ee.clientWidth<ee.scrollWidth){const We=getComputedStyle(ee,null);return q(We.overflowY,h)||q(We.overflowX,h)||(x=>{const Pe=(T=>{if(!T.ownerDocument||!T.ownerDocument.defaultView)return null;try{return T.ownerDocument.defaultView.frameElement}catch(ht){return null}})(x);return!!Pe&&(Pe.clientHeight<x.scrollHeight||Pe.clientWidth<x.scrollWidth)})(ee)}return!1},be=(ee,h,We,x,Pe,T,ht,Mt)=>T<ee&&ht>h||T>ee&&ht<h?0:T<=ee&&Mt<=We||ht>=h&&Mt>=We?T-ee-x:ht>h&&Mt<We||T<ee&&Mt>We?ht-h+Pe:0,R=ee=>{const h=ee.parentElement;return h==null?ee.getRootNode().host||null:h},te=(ee,h)=>{var We,x,Pe,T;if(typeof document=="undefined")return[];const{scrollMode:ht,block:Mt,inline:lt,boundary:Lt,skipOverflowHiddenElements:st}=h,he=typeof Lt=="function"?Lt:Ve=>Ve!==Lt;if(!B(ee))throw new TypeError("Invalid target");const W=document.scrollingElement||document.documentElement,pt=[];let ze=ee;for(;B(ze)&&he(ze);){if(ze=R(ze),ze===W){pt.push(ze);break}ze!=null&&ze===document.body&&U(ze)&&!U(document.documentElement)||ze!=null&&U(ze,st)&&pt.push(ze)}const re=(x=(We=window.visualViewport)==null?void 0:We.width)!=null?x:innerWidth,mt=(T=(Pe=window.visualViewport)==null?void 0:Pe.height)!=null?T:innerHeight,{scrollX:Ge,scrollY:Q}=window,{height:at,width:Rt,top:O,right:E,bottom:Z,left:j}=ee.getBoundingClientRect(),{top:z,right:Ie,bottom:M,left:ue}=(Ve=>{const Ee=window.getComputedStyle(Ve);return{top:parseFloat(Ee.scrollMarginTop)||0,right:parseFloat(Ee.scrollMarginRight)||0,bottom:parseFloat(Ee.scrollMarginBottom)||0,left:parseFloat(Ee.scrollMarginLeft)||0}})(ee);let Ne=Mt==="start"||Mt==="nearest"?O-z:Mt==="end"?Z+M:O+at/2-z+M,fe=lt==="center"?j+Rt/2-ue+Ie:lt==="end"?E+Ie:j-ue;const _e=[];for(let Ve=0;Ve<pt.length;Ve++){const Ee=pt[Ve],{height:Ke,width:Fe,top:Ot,right:Ct,bottom:bt,left:Oe}=Ee.getBoundingClientRect();if(ht==="if-needed"&&O>=0&&j>=0&&Z<=mt&&E<=re&&(Ee===W&&!U(Ee)||O>=Ot&&Z<=bt&&j>=Oe&&E<=Ct))return _e;const vr=getComputedStyle(Ee),rr=parseInt(vr.borderLeftWidth,10),D=parseInt(vr.borderTopWidth,10),p=parseInt(vr.borderRightWidth,10),C=parseInt(vr.borderBottomWidth,10);let m=0,w=0;const I="offsetWidth"in Ee?Ee.offsetWidth-Ee.clientWidth-rr-p:0,A="offsetHeight"in Ee?Ee.offsetHeight-Ee.clientHeight-D-C:0,H="offsetWidth"in Ee?Ee.offsetWidth===0?0:Fe/Ee.offsetWidth:0,oe="offsetHeight"in Ee?Ee.offsetHeight===0?0:Ke/Ee.offsetHeight:0;if(W===Ee)m=Mt==="start"?Ne:Mt==="end"?Ne-mt:Mt==="nearest"?be(Q,Q+mt,mt,D,C,Q+Ne,Q+Ne+at,at):Ne-mt/2,w=lt==="start"?fe:lt==="center"?fe-re/2:lt==="end"?fe-re:be(Ge,Ge+re,re,rr,p,Ge+fe,Ge+fe+Rt,Rt),m=Math.max(0,m+Q),w=Math.max(0,w+Ge);else{m=Mt==="start"?Ne-Ot-D:Mt==="end"?Ne-bt+C+A:Mt==="nearest"?be(Ot,bt,Ke,D,C+A,Ne,Ne+at,at):Ne-(Ot+Ke/2)+A/2,w=lt==="start"?fe-Oe-rr:lt==="center"?fe-(Oe+Fe/2)+I/2:lt==="end"?fe-Ct+p+I:be(Oe,Ct,Fe,rr,p+I,fe,fe+Rt,Rt);const{scrollLeft:$,scrollTop:ce}=Ee;m=oe===0?0:Math.max(0,Math.min(ce+m/oe,Ee.scrollHeight-Ke/oe+A)),w=H===0?0:Math.max(0,Math.min($+w/H,Ee.scrollWidth-Fe/H+I)),Ne+=ce-m,fe+=$-w}_e.push({el:Ee,top:m,left:w})}return _e},ae=ee=>ee===!1?{block:"end",inline:"nearest"}:(h=>h===Object(h)&&Object.keys(h).length!==0)(ee)?ee:{block:"start",inline:"nearest"};function Je(ee,h){if(!ee.isConnected||!(Pe=>{let T=Pe;for(;T&&T.parentNode;){if(T.parentNode===document)return!0;T=T.parentNode instanceof ShadowRoot?T.parentNode.host:T.parentNode}return!1})(ee))return;const We=(Pe=>{const T=window.getComputedStyle(Pe);return{top:parseFloat(T.scrollMarginTop)||0,right:parseFloat(T.scrollMarginRight)||0,bottom:parseFloat(T.scrollMarginBottom)||0,left:parseFloat(T.scrollMarginLeft)||0}})(ee);if((Pe=>typeof Pe=="object"&&typeof Pe.behavior=="function")(h))return h.behavior(te(ee,h));const x=typeof h=="boolean"||h==null?void 0:h.behavior;for(const{el:Pe,top:T,left:ht}of te(ee,ae(h))){const Mt=T-We.top+We.bottom,lt=ht-We.left+We.right;Pe.scroll({top:Mt,left:lt,behavior:x})}}}}]);
|