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
298 KiB
38 lines
298 KiB
(self.webpackChunk=self.webpackChunk||[]).push([[7046],{65030:function(bn,yt,b){"use strict";b.d(yt,{Z:function(){return P}});var H=b(33885),$=b(42978),K=b(75931),me=b(43403),N=b(92310),ee=b.n(N),re=b(29301),Qe=b(76846),q=b(96452),h=b(6089),Fe=b(80402),M=b(34280),De=b(49658),R=b(59301),St=b(54476),Ot=b(77900),ht=b(8654);function Nt(p){var C=p.prefixCls,g=p.align,w=p.arrow,I=p.arrowPos,k=w||{},Z=k.className,le=k.content,Q=I.x,ae=Q===void 0?0:Q,ne=I.y,ie=ne===void 0?0:ne,de=R.useRef();if(!g||!g.points)return null;var W={position:"absolute"};if(g.autoArrow!==!1){var oe=g.points[0],U=g.points[1],Ue=oe[0],ve=oe[1],Le=U[0],Me=U[1];Ue===Le||!["t","b"].includes(Ue)?W.top=ie:Ue==="t"?W.top=0:W.bottom=0,ve===Me||!["l","r"].includes(ve)?W.left=ae:ve==="l"?W.left=0:W.right=0}return R.createElement("div",{ref:de,className:ee()("".concat(C,"-arrow"),Z),style:W},le)}function st(p){var C=p.prefixCls,g=p.open,w=p.zIndex,I=p.mask,k=p.motion;return I?R.createElement(Ot.default,(0,St.Z)({},k,{motionAppear:!0,visible:g,removeOnLeave:!0}),function(Z){var le=Z.className;return R.createElement("div",{style:{zIndex:w},className:ee()("".concat(C,"-mask"),le)})}):null}var he=R.memo(function(p){var C=p.children;return C},function(p,C){return C.cache}),F=he,wt=R.forwardRef(function(p,C){var g=p.popup,w=p.className,I=p.prefixCls,k=p.style,Z=p.target,le=p.onVisibleChanged,Q=p.open,ae=p.keepDom,ne=p.fresh,ie=p.onClick,de=p.mask,W=p.arrow,oe=p.arrowPos,U=p.align,Ue=p.motion,ve=p.maskMotion,Le=p.forceRender,Me=p.getPopupContainer,gt=p.autoDestroy,Xe=p.portal,ye=p.zIndex,qe=p.onMouseEnter,ir=p.onMouseLeave,lr=p.onPointerEnter,$t=p.onPointerDownCapture,Tr=p.ready,tt=p.offsetX,it=p.offsetY,Ft=p.offsetR,Yt=p.offsetB,Wt=p.onAlign,Tt=p.onPrepare,$e=p.stretch,sr=p.targetWidth,ur=p.targetHeight,fr=typeof g=="function"?g():g,ot=Q||ae,Pr=(Me==null?void 0:Me.length)>0,Br=R.useState(!Me||!Pr),Kr=(0,$.Z)(Br,2),Gr=Kr[0],Dr=Kr[1];if((0,M.Z)(function(){!Gr&&Pr&&Z&&Dr(!0)},[Gr,Pr,Z]),!Gr)return null;var vr="auto",Cr={left:"-1000vw",top:"-1000vh",right:vr,bottom:vr};if(Tr||!Q){var Zr,Jt=U.points,Kt=U.dynamicInset||((Zr=U._experimental)===null||Zr===void 0?void 0:Zr.dynamicInset),Fr=Kt&&Jt[0][1]==="r",Dt=Kt&&Jt[0][0]==="b";Fr?(Cr.right=Ft,Cr.left=vr):(Cr.left=tt,Cr.right=vr),Dt?(Cr.bottom=Yt,Cr.top=vr):(Cr.top=it,Cr.bottom=vr)}var G={};return $e&&($e.includes("height")&&ur?G.height=ur:$e.includes("minHeight")&&ur&&(G.minHeight=ur),$e.includes("width")&&sr?G.width=sr:$e.includes("minWidth")&&sr&&(G.minWidth=sr)),Q||(G.pointerEvents="none"),R.createElement(Xe,{open:Le||ot,getContainer:Me&&function(){return Me(Z)},autoDestroy:gt},R.createElement(st,{prefixCls:I,open:Q,zIndex:ye,mask:de,motion:ve}),R.createElement(re.Z,{onResize:Wt,disabled:!Q},function(ut){return R.createElement(Ot.default,(0,St.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:Le,leavedClassName:"".concat(I,"-hidden")},Ue,{onAppearPrepare:Tt,onEnterPrepare:Tt,visible:Q,onVisibleChanged:function(qt){var d;Ue==null||(d=Ue.onVisibleChanged)===null||d===void 0||d.call(Ue,qt),le(qt)}}),function(Or,qt){var d=Or.className,v=Or.style,B=ee()(I,d,w);return R.createElement("div",{ref:(0,ht.sQ)(ut,C,qt),className:B,style:(0,H.Z)((0,H.Z)((0,H.Z)((0,H.Z)({"--arrow-x":"".concat(oe.x||0,"px"),"--arrow-y":"".concat(oe.y||0,"px")},Cr),G),v),{},{boxSizing:"border-box",zIndex:ye},k),onMouseEnter:qe,onMouseLeave:ir,onPointerEnter:lr,onClick:ie,onPointerDownCapture:$t},W&&R.createElement(Nt,{prefixCls:I,arrow:W,arrowPos:oe,align:U}),R.createElement(F,{cache:!Q&&!ne},fr))})}))}),ze=wt,te=R.forwardRef(function(p,C){var g=p.children,w=p.getTriggerDOMNode,I=(0,ht.Yr)(g),k=R.useCallback(function(le){(0,ht.mH)(C,w?w(le):le)},[w]),Z=(0,ht.x1)(k,(0,ht.C4)(g));return I?R.cloneElement(g,{ref:Z}):g}),xt=te,Ge=R.createContext(null),J=Ge;function dt(p){return p?Array.isArray(p)?p:[p]:[]}function Pt(p,C,g,w){return R.useMemo(function(){var I=dt(g!=null?g:C),k=dt(w!=null?w:C),Z=new Set(I),le=new Set(k);return p&&(Z.has("hover")&&(Z.delete("hover"),Z.add("click")),le.has("hover")&&(le.delete("hover"),le.add("click"))),[Z,le]},[p,C,g,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]:[],g=arguments.length>2?arguments[2]:void 0;return g?p[0]===C[0]:p[0]===C[0]&&p[1]===C[1]}function A(p,C,g,w){for(var I=g.points,k=Object.keys(p),Z=0;Z<k.length;Z+=1){var le,Q=k[Z];if(E((le=p[Q])===null||le===void 0?void 0:le.points,I,w))return"".concat(C,"-placement-").concat(Q)}return""}function X(p,C,g,w){return C||(g?{motionName:"".concat(p,"-").concat(g)}:w?{motionName:w}:null)}function z(p){return p.ownerDocument.defaultView}function ke(p){for(var C=[],g=p==null?void 0:p.parentElement,w=["hidden","scroll","clip","auto"];g;){var I=z(g).getComputedStyle(g),k=I.overflowX,Z=I.overflowY,le=I.overflow;[k,Z,le].some(function(Q){return w.includes(Q)})&&C.push(g),g=g.parentElement}return C}function L(p){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(p)?C:p}function ue(p){return L(parseFloat(p),0)}function Ne(p,C){var g=(0,H.Z)({},p);return(C||[]).forEach(function(w){if(!(w instanceof HTMLBodyElement||w instanceof HTMLHtmlElement)){var I=z(w).getComputedStyle(w),k=I.overflow,Z=I.overflowClipMargin,le=I.borderTopWidth,Q=I.borderBottomWidth,ae=I.borderLeftWidth,ne=I.borderRightWidth,ie=w.getBoundingClientRect(),de=w.offsetHeight,W=w.clientHeight,oe=w.offsetWidth,U=w.clientWidth,Ue=ue(le),ve=ue(Q),Le=ue(ae),Me=ue(ne),gt=L(Math.round(ie.width/oe*1e3)/1e3),Xe=L(Math.round(ie.height/de*1e3)/1e3),ye=(oe-U-Le-Me)*gt,qe=(de-W-Ue-ve)*Xe,ir=Ue*Xe,lr=ve*Xe,$t=Le*gt,Tr=Me*gt,tt=0,it=0;if(k==="clip"){var Ft=ue(Z);tt=Ft*gt,it=Ft*Xe}var Yt=ie.x+$t-tt,Wt=ie.y+ir-it,Tt=Yt+ie.width+2*tt-$t-Tr-ye,$e=Wt+ie.height+2*it-ir-lr-qe;g.left=Math.max(g.left,Yt),g.top=Math.max(g.top,Wt),g.right=Math.min(g.right,Tt),g.bottom=Math.min(g.bottom,$e)}}),g}function fe(p){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,g="".concat(C),w=g.match(/^(.*)\%$/);return w?p*(parseFloat(w[1])/100):parseFloat(g)}function je(p,C){var g=C||[],w=(0,$.Z)(g,2),I=w[0],k=w[1];return[fe(p.width,I),fe(p.height,k)]}function Ve(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[p[0],p[1]]}function xe(p,C){var g=C[0],w=C[1],I,k;return g==="t"?k=p.y:g==="b"?k=p.y+p.height:k=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:k}}function Ke(p,C){var g={t:"b",b:"t",l:"r",r:"l"};return p.map(function(w,I){return I===C?g[w]||"c":w}).join("")}function We(p,C,g,w,I,k,Z){var le=R.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:I[w]||{}}),Q=(0,$.Z)(le,2),ae=Q[0],ne=Q[1],ie=R.useRef(0),de=R.useMemo(function(){return C?ke(C):[]},[C]),W=R.useRef({}),oe=function(){W.current={}};p||oe();var U=(0,h.Z)(function(){if(C&&g&&p){let mr=function(Vn,Ye){var vt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ge,lt=ot.x+Vn,pt=ot.y+Ye,nr=lt+Dt,Mr=pt+Fr,In=Math.max(lt,vt.left),Te=Math.max(pt,vt.top),Je=Math.min(nr,vt.right),kt=Math.min(Mr,vt.bottom);return Math.max(0,(Je-In)*(kt-Te))},Gn=function(){Vr=ot.y+bt,Ur=Vr+Fr,br=ot.x+Lt,ct=br+Dt};var Le,Me,gt,Xe,ye=C,qe=ye.ownerDocument,ir=z(ye),lr=ir.getComputedStyle(ye),$t=lr.position,Tr=ye.style.left,tt=ye.style.top,it=ye.style.right,Ft=ye.style.bottom,Yt=ye.style.overflow,Wt=(0,H.Z)((0,H.Z)({},I[w]),k),Tt=qe.createElement("div");(Le=ye.parentElement)===null||Le===void 0||Le.appendChild(Tt),Tt.style.left="".concat(ye.offsetLeft,"px"),Tt.style.top="".concat(ye.offsetTop,"px"),Tt.style.position=$t,Tt.style.height="".concat(ye.offsetHeight,"px"),Tt.style.width="".concat(ye.offsetWidth,"px"),ye.style.left="0",ye.style.top="0",ye.style.right="auto",ye.style.bottom="auto",ye.style.overflow="hidden";var $e;if(Array.isArray(g))$e={x:g[0],y:g[1],width:0,height:0};else{var sr,ur,fr=g.getBoundingClientRect();fr.x=(sr=fr.x)!==null&&sr!==void 0?sr:fr.left,fr.y=(ur=fr.y)!==null&&ur!==void 0?ur:fr.top,$e={x:fr.x,y:fr.y,width:fr.width,height:fr.height}}var ot=ye.getBoundingClientRect(),Pr=ir.getComputedStyle(ye),Br=Pr.height,Kr=Pr.width;ot.x=(Me=ot.x)!==null&&Me!==void 0?Me:ot.left,ot.y=(gt=ot.y)!==null&>!==void 0?gt:ot.top;var Gr=qe.documentElement,Dr=Gr.clientWidth,vr=Gr.clientHeight,Cr=Gr.scrollWidth,Zr=Gr.scrollHeight,Jt=Gr.scrollTop,Kt=Gr.scrollLeft,Fr=ot.height,Dt=ot.width,G=$e.height,ut=$e.width,Or={left:0,top:0,right:Dr,bottom:vr},qt={left:-Kt,top:-Jt,right:Cr-Kt,bottom:Zr-Jt},d=Wt.htmlRegion,v="visible",B="visibleFirst";d!=="scroll"&&d!==B&&(d=v);var D=d===B,m=Ne(qt,de),x=Ne(Or,de),ge=d===v?x:m,ce=D?x:ge;ye.style.left="auto",ye.style.top="auto",ye.style.right="0",ye.style.bottom="0";var Pe=ye.getBoundingClientRect();ye.style.left=Tr,ye.style.top=tt,ye.style.right=it,ye.style.bottom=Ft,ye.style.overflow=Yt,(Xe=ye.parentElement)===null||Xe===void 0||Xe.removeChild(Tt);var be=L(Math.round(Dt/parseFloat(Kr)*1e3)/1e3),Ae=L(Math.round(Fr/parseFloat(Br)*1e3)/1e3);if(be===0||Ae===0||(0,Qe.Sh)(g)&&!(0,O.Z)(g))return;var Y=Wt.offset,Ct=Wt.targetOffset,Se=je(ot,Y),rt=(0,$.Z)(Se,2),Re=rt[0],_e=rt[1],Mt=je($e,Ct),Ee=(0,$.Z)(Mt,2),He=Ee[0],et=Ee[1];$e.x-=He,$e.y-=et;var zt=Wt.points||[],ft=(0,$.Z)(zt,2),hr=ft[0],Wr=ft[1],Ut=Ve(Wr),Bt=Ve(hr),Gt=xe($e,Ut),gr=xe(ot,Bt),It=(0,H.Z)({},Wt),Lt=Gt.x-gr.x+Re,bt=Gt.y-gr.y+_e,_t=mr(Lt,bt),cr=mr(Lt,bt,x),rr=xe($e,["t","l"]),pr=xe(ot,["t","l"]),Xt=xe($e,["b","r"]),At=xe(ot,["b","r"]),yr=Wt.overflow||{},jr=yr.adjustX,Xr=yr.adjustY,dr=yr.shiftX,en=yr.shiftY,wr=function(Ye){return typeof Ye=="boolean"?Ye:Ye>=0},Vr,Ur,br,ct;Gn();var V=wr(Xr),j=Bt[0]===Ut[0];if(V&&Bt[0]==="t"&&(Ur>ce.bottom||W.current.bt)){var Oe=bt;j?Oe-=Fr-G:Oe=rr.y-At.y-_e;var pe=mr(Lt,Oe),at=mr(Lt,Oe,x);pe>_t||pe===_t&&(!D||at>=cr)?(W.current.bt=!0,bt=Oe,_e=-_e,It.points=[Ke(Bt,0),Ke(Ut,0)]):W.current.bt=!1}if(V&&Bt[0]==="b"&&(Vr<ce.top||W.current.tb)){var Vt=bt;j?Vt+=Fr-G:Vt=Xt.y-pr.y-_e;var Qt=mr(Lt,Vt),er=mr(Lt,Vt,x);Qt>_t||Qt===_t&&(!D||er>=cr)?(W.current.tb=!0,bt=Vt,_e=-_e,It.points=[Ke(Bt,0),Ke(Ut,0)]):W.current.tb=!1}var xr=wr(jr),Yr=Bt[1]===Ut[1];if(xr&&Bt[1]==="l"&&(ct>ce.right||W.current.rl)){var Er=Lt;Yr?Er-=Dt-ut:Er=rr.x-At.x-Re;var tn=mr(Er,bt),Nr=mr(Er,bt,x);tn>_t||tn===_t&&(!D||Nr>=cr)?(W.current.rl=!0,Lt=Er,Re=-Re,It.points=[Ke(Bt,1),Ke(Ut,1)]):W.current.rl=!1}if(xr&&Bt[1]==="r"&&(br<ce.left||W.current.lr)){var an=Lt;Yr?an+=Dt-ut:an=Xt.x-pr.x-Re;var Nn=mr(an,bt),un=mr(an,bt,x);Nn>_t||Nn===_t&&(!D||un>=cr)?(W.current.lr=!0,Lt=an,Re=-Re,It.points=[Ke(Bt,1),Ke(Ut,1)]):W.current.lr=!1}Gn();var kr=dr===!0?0:dr;typeof kr=="number"&&(br<x.left&&(Lt-=br-x.left-Re,$e.x+ut<x.left+kr&&(Lt+=$e.x-x.left+ut-kr)),ct>x.right&&(Lt-=ct-x.right-Re,$e.x>x.right-kr&&(Lt+=$e.x-x.right+kr)));var Jr=en===!0?0:en;typeof Jr=="number"&&(Vr<x.top&&(bt-=Vr-x.top-_e,$e.y+G<x.top+Jr&&(bt+=$e.y-x.top+G-Jr)),Ur>x.bottom&&(bt-=Ur-x.bottom-_e,$e.y>x.bottom-Jr&&(bt+=$e.y-x.bottom+Jr)));var Ir=ot.x+Lt,on=Ir+Dt,Pn=ot.y+bt,Hn=Pn+Fr,Sn=$e.x,vn=Sn+ut,Qn=$e.y,xn=Qn+G,ni=Math.max(Ir,Sn),$r=Math.min(on,vn),Bn=(ni+$r)/2,ui=Bn-Ir,ii=Math.max(Pn,Qn),di=Math.min(Hn,xn),Kn=(ii+di)/2,Hr=Kn-Pn;Z==null||Z(C,It);var fn=Pe.right-ot.x-(Lt+ot.width),Un=Pe.bottom-ot.y-(bt+ot.height);be===1&&(Lt=Math.round(Lt),fn=Math.round(fn)),Ae===1&&(bt=Math.round(bt),Un=Math.round(Un));var On={ready:!0,offsetX:Lt/be,offsetY:bt/Ae,offsetR:fn/be,offsetB:Un/Ae,arrowX:ui/be,arrowY:Hr/Ae,scaleX:be,scaleY:Ae,align:It};ne(On)}}),Ue=function(){ie.current+=1;var Me=ie.current;Promise.resolve().then(function(){ie.current===Me&&U()})},ve=function(){ne(function(Me){return(0,H.Z)((0,H.Z)({},Me),{},{ready:!1})})};return(0,M.Z)(ve,[w]),(0,M.Z)(function(){p||ve()},[p]),[ae.ready,ae.offsetX,ae.offsetY,ae.offsetR,ae.offsetB,ae.arrowX,ae.arrowY,ae.scaleX,ae.scaleY,ae.align,Ue]}var Zt=b(94480);function Rt(p,C,g,w,I){(0,M.Z)(function(){if(p&&C&&g){let ie=function(){w(),I()};var k=C,Z=g,le=ke(k),Q=ke(Z),ae=z(Z),ne=new Set([ae].concat((0,Zt.Z)(le),(0,Zt.Z)(Q)));return ne.forEach(function(de){de.addEventListener("scroll",ie,{passive:!0})}),ae.addEventListener("resize",ie,{passive:!0}),w(),function(){ne.forEach(function(de){de.removeEventListener("scroll",ie),ae.removeEventListener("resize",ie)})}}},[p,C,g])}var Et=b(48736);function Ie(p,C,g,w,I,k,Z,le){var Q=R.useRef(p);Q.current=p;var ae=R.useRef(!1);R.useEffect(function(){if(C&&w&&(!I||k)){var ie=function(){ae.current=!1},de=function(gt){var Xe;Q.current&&!Z(((Xe=gt.composedPath)===null||Xe===void 0||(Xe=Xe.call(gt))===null||Xe===void 0?void 0:Xe[0])||gt.target)&&!ae.current&&le(!1)},W=z(w);W.addEventListener("pointerdown",ie,!0),W.addEventListener("mousedown",de,!0),W.addEventListener("contextmenu",de,!0);var oe=(0,q.A)(g);if(oe&&(oe.addEventListener("mousedown",de,!0),oe.addEventListener("contextmenu",de,!0)),0)var U,Ue,ve,Le;return function(){W.removeEventListener("pointerdown",ie,!0),W.removeEventListener("mousedown",de,!0),W.removeEventListener("contextmenu",de,!0),oe&&(oe.removeEventListener("mousedown",de,!0),oe.removeEventListener("contextmenu",de,!0))}}},[C,g,w,I,k]);function ne(){ae.current=!0}return ne}var or=["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 tr(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:me.Z,C=R.forwardRef(function(g,w){var I=g.prefixCls,k=I===void 0?"rc-trigger-popup":I,Z=g.children,le=g.action,Q=le===void 0?"hover":le,ae=g.showAction,ne=g.hideAction,ie=g.popupVisible,de=g.defaultPopupVisible,W=g.onPopupVisibleChange,oe=g.afterPopupVisibleChange,U=g.mouseEnterDelay,Ue=g.mouseLeaveDelay,ve=Ue===void 0?.1:Ue,Le=g.focusDelay,Me=g.blurDelay,gt=g.mask,Xe=g.maskClosable,ye=Xe===void 0?!0:Xe,qe=g.getPopupContainer,ir=g.forceRender,lr=g.autoDestroy,$t=g.destroyPopupOnHide,Tr=g.popup,tt=g.popupClassName,it=g.popupStyle,Ft=g.popupPlacement,Yt=g.builtinPlacements,Wt=Yt===void 0?{}:Yt,Tt=g.popupAlign,$e=g.zIndex,sr=g.stretch,ur=g.getPopupClassNameFromAlign,fr=g.fresh,ot=g.alignPoint,Pr=g.onPopupClick,Br=g.onPopupAlign,Kr=g.arrow,Gr=g.popupMotion,Dr=g.maskMotion,vr=g.popupTransitionName,Cr=g.popupAnimation,Zr=g.maskTransitionName,Jt=g.maskAnimation,Kt=g.className,Fr=g.getTriggerDOMNode,Dt=(0,K.Z)(g,or),G=lr||$t||!1,ut=R.useState(!1),Or=(0,$.Z)(ut,2),qt=Or[0],d=Or[1];(0,M.Z)(function(){d((0,De.Z)())},[]);var v=R.useRef({}),B=R.useContext(J),D=R.useMemo(function(){return{registerSubPopup:function(Je,kt){v.current[Je]=kt,B==null||B.registerSubPopup(Je,kt)}}},[B]),m=(0,Fe.Z)(),x=R.useState(null),ge=(0,$.Z)(x,2),ce=ge[0],Pe=ge[1],be=R.useRef(null),Ae=(0,h.Z)(function(Te){be.current=Te,(0,Qe.Sh)(Te)&&ce!==Te&&Pe(Te),B==null||B.registerSubPopup(m,Te)}),Y=R.useState(null),Ct=(0,$.Z)(Y,2),Se=Ct[0],rt=Ct[1],Re=R.useRef(null),_e=(0,h.Z)(function(Te){(0,Qe.Sh)(Te)&&Se!==Te&&(rt(Te),Re.current=Te)}),Mt=R.Children.only(Z),Ee=(Mt==null?void 0:Mt.props)||{},He={},et=(0,h.Z)(function(Te){var Je,kt,Lr=Se;return(Lr==null?void 0:Lr.contains(Te))||((Je=(0,q.A)(Lr))===null||Je===void 0?void 0:Je.host)===Te||Te===Lr||(ce==null?void 0:ce.contains(Te))||((kt=(0,q.A)(ce))===null||kt===void 0?void 0:kt.host)===Te||Te===ce||Object.values(v.current).some(function(Sr){return(Sr==null?void 0:Sr.contains(Te))||Te===Sr})}),zt=X(k,Gr,Cr,vr),ft=X(k,Dr,Jt,Zr),hr=R.useState(de||!1),Wr=(0,$.Z)(hr,2),Ut=Wr[0],Bt=Wr[1],Gt=ie!=null?ie:Ut,gr=(0,h.Z)(function(Te){ie===void 0&&Bt(Te)});(0,M.Z)(function(){Bt(ie||!1)},[ie]);var It=R.useRef(Gt);It.current=Gt;var Lt=R.useRef([]);Lt.current=[];var bt=(0,h.Z)(function(Te){var Je;gr(Te),((Je=Lt.current[Lt.current.length-1])!==null&&Je!==void 0?Je:Gt)!==Te&&(Lt.current.push(Te),W==null||W(Te))}),_t=R.useRef(),cr=function(){clearTimeout(_t.current)},rr=function(Je){var kt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;cr(),kt===0?bt(Je):_t.current=setTimeout(function(){bt(Je)},kt*1e3)};R.useEffect(function(){return cr},[]);var pr=R.useState(!1),Xt=(0,$.Z)(pr,2),At=Xt[0],yr=Xt[1];(0,M.Z)(function(Te){(!Te||Gt)&&yr(!0)},[Gt]);var jr=R.useState(null),Xr=(0,$.Z)(jr,2),dr=Xr[0],en=Xr[1],wr=R.useState(null),Vr=(0,$.Z)(wr,2),Ur=Vr[0],br=Vr[1],ct=function(Je){br([Je.clientX,Je.clientY])},V=We(Gt,ce,ot&&Ur!==null?Ur:Se,Ft,Wt,Tt,Br),j=(0,$.Z)(V,11),Oe=j[0],pe=j[1],at=j[2],Vt=j[3],Qt=j[4],er=j[5],xr=j[6],Yr=j[7],Er=j[8],tn=j[9],Nr=j[10],an=Pt(qt,Q,ae,ne),Nn=(0,$.Z)(an,2),un=Nn[0],kr=Nn[1],Jr=un.has("click"),Ir=kr.has("click")||kr.has("contextMenu"),on=(0,h.Z)(function(){At||Nr()}),Pn=function(){It.current&&ot&&Ir&&rr(!1)};Rt(Gt,Se,ce,on,Pn),(0,M.Z)(function(){on()},[Ur,Ft]),(0,M.Z)(function(){Gt&&!(Wt!=null&&Wt[Ft])&&on()},[JSON.stringify(Tt)]);var Hn=R.useMemo(function(){var Te=A(Wt,k,tn,ot);return ee()(Te,ur==null?void 0:ur(tn))},[tn,ur,Wt,k,ot]);R.useImperativeHandle(w,function(){return{nativeElement:Re.current,popupElement:be.current,forceAlign:on}});var Sn=R.useState(0),vn=(0,$.Z)(Sn,2),Qn=vn[0],xn=vn[1],ni=R.useState(0),$r=(0,$.Z)(ni,2),Bn=$r[0],ui=$r[1],ii=function(){if(sr&&Se){var Je=Se.getBoundingClientRect();xn(Je.width),ui(Je.height)}},di=function(){ii(),on()},Kn=function(Je){yr(!1),Nr(),oe==null||oe(Je)},Hr=function(){return new Promise(function(Je){ii(),en(function(){return Je})})};(0,M.Z)(function(){dr&&(Nr(),dr(),en(null))},[dr]);function fn(Te,Je,kt,Lr){He[Te]=function(Sr){var hn;Lr==null||Lr(Sr),rr(Je,kt);for(var _n=arguments.length,ei=new Array(_n>1?_n-1:0),Rn=1;Rn<_n;Rn++)ei[Rn-1]=arguments[Rn];(hn=Ee[Te])===null||hn===void 0||hn.call.apply(hn,[Ee,Sr].concat(ei))}}(Jr||Ir)&&(He.onClick=function(Te){var Je;It.current&&Ir?rr(!1):!It.current&&Jr&&(ct(Te),rr(!0));for(var kt=arguments.length,Lr=new Array(kt>1?kt-1:0),Sr=1;Sr<kt;Sr++)Lr[Sr-1]=arguments[Sr];(Je=Ee.onClick)===null||Je===void 0||Je.call.apply(Je,[Ee,Te].concat(Lr))});var Un=Ie(Gt,Ir,Se,ce,gt,ye,et,rr),On=un.has("hover"),mr=kr.has("hover"),Gn,Vn;On&&(fn("onMouseEnter",!0,U,function(Te){ct(Te)}),fn("onPointerEnter",!0,U,function(Te){ct(Te)}),Gn=function(Je){(Gt||At)&&ce!==null&&ce!==void 0&&ce.contains(Je.target)&&rr(!0,U)},ot&&(He.onMouseMove=function(Te){var Je;(Je=Ee.onMouseMove)===null||Je===void 0||Je.call(Ee,Te)})),mr&&(fn("onMouseLeave",!1,ve),fn("onPointerLeave",!1,ve),Vn=function(){rr(!1,ve)}),un.has("focus")&&fn("onFocus",!0,Le),kr.has("focus")&&fn("onBlur",!1,Me),un.has("contextMenu")&&(He.onContextMenu=function(Te){var Je;It.current&&kr.has("contextMenu")?rr(!1):(ct(Te),rr(!0)),Te.preventDefault();for(var kt=arguments.length,Lr=new Array(kt>1?kt-1:0),Sr=1;Sr<kt;Sr++)Lr[Sr-1]=arguments[Sr];(Je=Ee.onContextMenu)===null||Je===void 0||Je.call.apply(Je,[Ee,Te].concat(Lr))}),Kt&&(He.className=ee()(Ee.className,Kt));var Ye=R.useRef(!1);Ye.current||(Ye.current=ir||Gt||At);var vt=(0,H.Z)((0,H.Z)({},Ee),He),lt={},pt=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];pt.forEach(function(Te){Dt[Te]&&(lt[Te]=function(){for(var Je,kt=arguments.length,Lr=new Array(kt),Sr=0;Sr<kt;Sr++)Lr[Sr]=arguments[Sr];(Je=vt[Te])===null||Je===void 0||Je.call.apply(Je,[vt].concat(Lr)),Dt[Te].apply(Dt,Lr)})});var nr=R.cloneElement(Mt,(0,H.Z)((0,H.Z)({},vt),lt)),Mr={x:er,y:xr},In=Kr?(0,H.Z)({},Kr!==!0?Kr:{}):null;return R.createElement(R.Fragment,null,R.createElement(re.Z,{disabled:!Gt,ref:_e,onResize:di},R.createElement(xt,{getTriggerDOMNode:Fr},nr)),Ye.current&&R.createElement(J.Provider,{value:D},R.createElement(ze,{portal:p,ref:Ae,prefixCls:k,popup:Tr,className:ee()(tt,Hn),style:it,target:Se,onMouseEnter:Gn,onMouseLeave:Vn,onPointerEnter:Gn,zIndex:$e,open:Gt,keepDom:At,fresh:fr,onClick:Pr,onPointerDownCapture:Un,mask:gt,motion:zt,maskMotion:ft,onVisibleChanged:Kn,onPrepare:Hr,forceRender:ir,autoDestroy:G,getPopupContainer:qe,align:tn,arrow:In,arrowPos:Mr,ready:Oe,offsetX:pe,offsetY:at,offsetR:Vt,offsetB:Qt,onAlign:on,stretch:sr,targetWidth:Qn/Yr,targetHeight:Bn/Er})))});return C}var P=tr(me.Z)},45559:function(){"use strict"},67671:function(bn,yt,b){"use strict";b.d(yt,{t:function(){return M}});var H=b(59301),$=b(7939),K={buttonFixed:"buttonFixed___vyq30",button:"button___hxmYv",buttonWrap:"buttonWrap___uK8dl"},me=b(92310),N=b.n(me),ee=Object.defineProperty,re=Object.getOwnPropertySymbols,Qe=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable,h=(De,R,St)=>R in De?ee(De,R,{enumerable:!0,configurable:!0,writable:!0,value:St}):De[R]=St,Fe=(De,R)=>{for(var St in R||(R={}))Qe.call(R,St)&&h(De,St,R[St]);if(re)for(var St of re(R))q.call(R,St)&&h(De,St,R[St]);return De};const M=({cancelText:De="\u53D6\u6D88",okText:R="\u786E\u5B9A",loading:St=!1,hasOkBtn:Ot=!0,hasCancelBtn:ht=!0,okButtonProps:Nt={},onCancel:st=()=>{},onOk:he=()=>{},className:F=""})=>H.createElement("div",{className:N()(K.buttonFixed,F)},H.createElement("div",{className:K.buttonWrap},ht&&H.createElement($.ZP,{size:"middle",className:`${K.button} mr20`,onClick:st},De),Ot&&H.createElement($.ZP,Fe({size:"middle",type:"primary",className:`${K.button} mr20`,loading:St,onClick:he},Nt),R)))},60537:function(bn,yt,b){"use strict";b.d(yt,{h:function(){return F},Z:function(){return he}});var H=b(59301),$=b(82326),K=b(28284),me=b(7939),N=b(89780),ee=b.n(N),re=b(45559),Qe=Object.defineProperty,q=Object.defineProperties,h=Object.getOwnPropertyDescriptors,Fe=Object.getOwnPropertySymbols,M=Object.prototype.hasOwnProperty,De=Object.prototype.propertyIsEnumerable,R=(wt,ze,te)=>ze in wt?Qe(wt,ze,{enumerable:!0,configurable:!0,writable:!0,value:te}):wt[ze]=te,St=(wt,ze)=>{for(var te in ze||(ze={}))M.call(ze,te)&&R(wt,te,ze[te]);if(Fe)for(var te of Fe(ze))De.call(ze,te)&&R(wt,te,ze[te]);return wt},Ot=(wt,ze)=>q(wt,h(ze));const ht=$.default.Option,Nt={labelCol:{span:4},wrapperCol:{span:20}},st={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"]};var he=({callback:wt,onCancel:ze})=>{const[te,xt]=(0,H.useState)("python");function Ge(dt){xt(st[dt][1])}function J(dt){wt(dt)}return H.createElement(K.default,Ot(St({},Nt),{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:J,style:{width:500}}),H.createElement(K.default.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},H.createElement($.default,{getPopupContainer:dt=>dt.parentNode,onChange:Ge},Object.keys(st).map(dt=>H.createElement(ht,{key:dt,value:dt},st[dt][0])))),H.createElement(K.default.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},H.createElement(F,{mode:te})),H.createElement("div",{className:"flex-container flex-end"},H.createElement(me.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),H.createElement(me.ZP,{type:"ghost",onClick:ze},"\u53D6\u6D88")))};function F({value:wt,onChange:ze,mode:te,options:xt={}}){const Ge=(0,H.useRef)(),[J,dt]=(0,H.useState)();return(0,H.useEffect)(()=>{if(J){let Pt=function(O){const E=O.getValue();ze&&ze(E)};return J.on("change",Pt),()=>{J.off("change",Pt)}}},[J,ze]),(0,H.useEffect)(()=>{J&&J.setOption("mode",te)},[J,te]),(0,H.useEffect)(()=>{J&&(wt!==J.getValue()||wt==="")&&setTimeout(()=>{J.setValue(wt||"")},300)},[J,wt]),(0,H.useEffect)(()=>{if(Ge.current&&!J){const Pt=ee().fromTextArea(Ge.current,St({mode:te,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},xt));dt(Pt)}},[Ge.current,J]),H.createElement("div",{className:"my-codemirror-container"},H.createElement("textarea",{ref:Ge}))}},36599:function(bn,yt,b){"use strict";b.r(yt),b.d(yt,{default:function(){return ht}});var H=b(59301),$=b(65582),K=b(28284),me=b(37568),N=b(60537),ee=b(67671),re={bg:"bg___YV4bB",wrap:"wrap___kzW1f",title:"title___qum64",path:"path___G15kO",colorBlue:"colorBlue___LDjoN",width240:"width240___QOLSj"},Qe=Object.defineProperty,q=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,Fe=Object.prototype.propertyIsEnumerable,M=(Nt,st,he)=>st in Nt?Qe(Nt,st,{enumerable:!0,configurable:!0,writable:!0,value:he}):Nt[st]=he,De=(Nt,st)=>{for(var he in st||(st={}))h.call(st,he)&&M(Nt,he,st[he]);if(q)for(var he of q(st))Fe.call(st,he)&&M(Nt,he,st[he]);return Nt},R=(Nt,st)=>{var he={};for(var F in Nt)h.call(Nt,F)&&st.indexOf(F)<0&&(he[F]=Nt[F]);if(Nt!=null&&q)for(var F of q(Nt))st.indexOf(F)<0&&Fe.call(Nt,F)&&(he[F]=Nt[F]);return he},St=(Nt,st,he)=>new Promise((F,wt)=>{var ze=Ge=>{try{xt(he.next(Ge))}catch(J){wt(J)}},te=Ge=>{try{xt(he.throw(Ge))}catch(J){wt(J)}},xt=Ge=>Ge.done?F(Ge.value):Promise.resolve(Ge.value).then(ze,te);xt((he=he.apply(Nt,st)).next())});const Ot=Nt=>{var st=Nt,{shixunsDetail:he,globalSetting:F,loading:wt,user:ze,dispatch:te}=st,xt=R(st,["shixunsDetail","globalSetting","loading","user","dispatch"]);const Ge=(0,$.useLocation)(),[J,dt]=(0,H.useState)({}),Pt=(0,H.useRef)(),O=(0,H.useRef)(),[E]=K.default.useForm(),[A,X]=(0,H.useState)("");(0,H.useEffect)(()=>(te({type:"globalSetting/footerToggle",payload:!1}),()=>{te({type:"globalSetting/footerToggle",payload:!0})}),[]),(0,H.useEffect)(()=>{const L=sessionStorage.getItem("pathArray");if(L){const ue=L.split(",").join("/"),Ne=ue.indexOf("/")===0?ue.substr(1):ue;X(Ne)}},[]),(0,H.useEffect)(()=>{var L,ue,Ne,fe;O.current=(ue=(L=Ge.pathname)==null?void 0:L.split("/"))==null?void 0:ue[2],Pt.current=((fe=(Ne=Ge.pathname)==null?void 0:Ne.split("/"))==null?void 0:fe[3])==="repository"},[]);const z=(...L)=>St(void 0,[...L],function*(ue={}){if(yield te({type:"shixunsDetail/addRepositoryFile",payload:{id:O.current,message:ue.commitMessage,content:ue.codeMirror,path:`${A?`${A}/`:""}${ue.path||""}`,secret_repository:Pt.current?void 0:!0}})){const fe=Pt.current?`/shixuns/${O.current}/repository${A?`/master/shixun_show/${A}`:""}`:`/shixuns/${O.current}/secret_repository`;$.history.replace(fe)}}),ke=()=>{var L,ue;$.history.push(`/shixuns/${O.current}/${(ue=(L=Ge.pathname)==null?void 0:L.split("/"))==null?void 0:ue[3]}${A?`/master/shixun_show/${A}`:""}`)};return H.createElement("section",{className:re.bg},H.createElement("div",{className:re.wrap},H.createElement("div",{className:re.title},"\u65B0\u5EFA\u6587\u4EF6"),H.createElement(K.default,{className:"mt10",form:E,scrollToFirstError:!0,layout:"vertical",onFinish:z,onValuesChange:()=>dt(De({},E.getFieldsValue()))},H.createElement(K.default.Item,{label:"\u6587\u4EF6\u540D\u79F0\u6216\u6587\u4EF6\u8DEF\u5F84\uFF1A"},H.createElement(K.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},H.createElement("span",null,H.createElement("span",{className:"mr5"},A?`${A}/`:""),H.createElement(me.default,{className:re.width240,placeholder:"\u8BF7\u8F93\u5165\u6587\u4EF6\u540D\u79F0\u6216\u6587\u4EF6\u8DEF\u5F84"}))),H.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")),H.createElement(K.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"}]},H.createElement(me.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"})),H.createElement("div",{className:"mt10 mb20"},H.createElement(K.default.Item,{name:"codeMirror",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5185\u5BB9"}]},H.createElement(N.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"]}}))),H.createElement(K.default.Item,{noStyle:!0},H.createElement(ee.t,{okButtonProps:{htmlType:"submit"},onCancel:ke})))))};var ht=(0,$.connect)(({shixunsDetail:Nt,loading:st,globalSetting:he,user:F})=>({shixunsDetail:Nt,globalSetting:he,user:F,loading:st.models.index}))(Ot)},89780:function(bn){(function(yt,b){bn.exports=b()})(this,function(){"use strict";var yt=navigator.userAgent,b=navigator.platform,H=/gecko\/\d/i.test(yt),$=/MSIE \d/.test(yt),K=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(yt),me=/Edge\/(\d+)/.exec(yt),N=$||K||me,ee=N&&($?document.documentMode||6:+(me||K)[1]),re=!me&&/WebKit\//.test(yt),Qe=re&&/Qt\/\d+\.\d+/.test(yt),q=!me&&/Chrome\//.test(yt),h=/Opera\//.test(yt),Fe=/Apple Computer/.test(navigator.vendor),M=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(yt),De=/PhantomJS/.test(yt),R=!me&&/AppleWebKit/.test(yt)&&/Mobile\/\w+/.test(yt),St=/Android/.test(yt),Ot=R||St||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(yt),ht=R||/Mac/.test(b),Nt=/\bCrOS\b/.test(yt),st=/win/i.test(b),he=h&&yt.match(/Version\/(\d*\.\d*)/);he&&(he=Number(he[1])),he&&he>=15&&(h=!1,re=!0);var F=ht&&(Qe||h&&(he==null||he<12.11)),wt=H||N&&ee>=9;function ze(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var te=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 xt(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function Ge(e,t){return xt(e).appendChild(t)}function J(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 dt(e,t,n,r){var i=J(e,t,n,r);return i.setAttribute("role","presentation"),i}var Pt;document.createRange?Pt=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:Pt=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 A(e,t){var n=e.className;ze(t).test(n)||(e.className+=(n?" ":"")+t)}function X(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()};R?z=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:N&&(z=function(e){try{e.select()}catch(t){}});function ke(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function L(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=ke(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 je=50,Ve={toString:function(){return"CodeMirror.Pass"}},xe={scroll:!1},Ke={origin:"*mouse"},We={origin:"+move"};function Zt(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 Rt=[""];function Et(e){for(;Rt.length<=e;)Rt.push(Ie(Rt)+" ");return Rt[e]}function Ie(e){return e[e.length-1]}function or(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function tr(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function P(){}function p(e,t){var n;return Object.create?n=Object.create(e):(P.prototype=e,n=new P),t&&L(t,n),n}var C=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function g(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&&g(e)?!0:t.test(e):g(e)}function I(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var k=/[\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 Z(e){return e.charCodeAt(0)>=768&&k.test(e)}function le(e,t,n){for(;(n<0?t>0:t<e.length)&&Z(e.charAt(t));)t+=n;return t}function Q(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 ae(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 ne=null;function ie(e,t,n){var r;ne=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:ne=i),a.from==t&&(a.from!=a.to&&n!="before"?r=i:ne=i)}return r!=null?r:ne}var de=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=[],T=0;T<S;++T)y.push(n(u.charCodeAt(T)));for(var _=0,se=c;_<S;++_){var Ce=y[_];Ce=="m"?y[_]=se:se=Ce}for(var Ze=0,we=c;Ze<S;++Ze){var Be=y[Ze];Be=="1"&&we=="r"?y[Ze]="n":a.test(Be)&&(we=Be,Be=="r"&&(y[Ze]="R"))}for(var mt=1,nt=y[0];mt<S-1;++mt){var jt=y[mt];jt=="+"&&nt=="1"&&y[mt+1]=="1"?y[mt]="1":jt==","&&nt==y[mt+1]&&(nt=="1"||nt=="n")&&(y[mt]=nt),nt=jt}for(var zr=0;zr<S;++zr){var mn=y[zr];if(mn==",")y[zr]="N";else if(mn=="%"){var Qr=void 0;for(Qr=zr+1;Qr<S&&y[Qr]=="%";++Qr);for(var Jn=zr&&y[zr-1]=="!"||Qr<S&&y[Qr]=="1"?"1":"N",Fn=zr;Fn<Qr;++Fn)y[Fn]=Jn;zr=Qr-1}}for(var ln=0,Wn=c;ln<S;++ln){var wn=y[ln];Wn=="L"&&wn=="1"?y[ln]="L":a.test(wn)&&(Wn=wn)}for(var dn=0;dn<S;++dn)if(i.test(y[dn])){var sn=void 0;for(sn=dn+1;sn<S&&i.test(y[sn]);++sn);for(var qr=(dn?y[dn-1]:c)=="L",zn=(sn<S?y[sn]:c)=="L",Ji=qr==zn?qr?"L":"R":c,Mi=dn;Mi<sn;++Mi)y[Mi]=Ji;dn=sn-1}for(var Ln=[],ci,yn=0;yn<S;)if(o.test(y[yn])){var Mo=yn;for(++yn;yn<S&&o.test(y[yn]);++yn);Ln.push(new s(0,Mo,yn))}else{var gi=yn,Ii=Ln.length,Ai=f=="rtl"?1:0;for(++yn;yn<S&&y[yn]!="L";++yn);for(var Dn=gi;Dn<yn;)if(l.test(y[Dn])){gi<Dn&&(Ln.splice(Ii,0,new s(1,gi,Dn)),Ii+=Ai);var Qi=Dn;for(++Dn;Dn<yn&&l.test(y[Dn]);++Dn);Ln.splice(Ii,0,new s(2,Qi,Dn)),Ii+=Ai,gi=Dn}else++Dn;gi<yn&&Ln.splice(Ii,0,new s(1,gi,yn))}return f=="ltr"&&(Ln[0].level==1&&(ci=u.match(/^\s+/))&&(Ln[0].from=ci[0].length,Ln.unshift(new s(0,0,ci[0].length))),Ie(Ln).level==1&&(ci=u.match(/\s+$/))&&(Ie(Ln).to-=ci[0].length,Ln.push(new s(0,S-ci[0].length,S)))),f=="rtl"?Ln.reverse():Ln}}();function W(e,t){var n=e.order;return n==null&&(n=e.order=de(e.text,t)),n}var oe=[],U=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]||oe).concat(n)}};function Ue(e,t){return e._handlers&&e._handlers[t]||oe}function ve(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 Le(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 Me(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Le(e,n||t.type,e,t),lr(t)||t.codemirrorIgnore}function gt(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 ye(e){e.prototype.on=function(t,n){U(this,t,n)},e.prototype.off=function(t,n){ve(this,t,n)}}function qe(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ir(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function lr(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function $t(e){qe(e),ir(e)}function Tr(e){return e.target||e.srcElement}function tt(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),ht&&e.ctrlKey&&t==1&&(t=3),t}var it=function(){if(N&&ee<9)return!1;var e=J("div");return"draggable"in e||"dragDrop"in e}(),Ft;function Yt(e){if(Ft==null){var t=J("span","\u200B");Ge(e,J("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Ft=t.offsetWidth<=1&&t.offsetHeight>2&&!(N&&ee<8))}var n=Ft?J("span","\u200B"):J("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var Wt;function Tt(e){if(Wt!=null)return Wt;var t=Ge(e,document.createTextNode("A\u062EA")),n=Pt(t,0,1).getBoundingClientRect(),r=Pt(t,1,2).getBoundingClientRect();return xt(e),!n||n.left==n.right?!1:Wt=r.right-n.right<3}var $e=`
|
|
|
|
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/)},sr=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},ur=function(){var e=J("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),fr=null;function ot(e){if(fr!=null)return fr;var t=Ge(e,J("span","x")),n=t.getBoundingClientRect(),r=Pt(t,0,1).getBoundingClientRect();return fr=Math.abs(n.left-r.left)>1}var Pr={},Br={};function Kr(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Pr[e]=t}function Gr(e,t){Br[e]=t}function Dr(e){if(typeof e=="string"&&Br.hasOwnProperty(e))e=Br[e];else if(e&&typeof e.name=="string"&&Br.hasOwnProperty(e.name)){var t=Br[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 Dr("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Dr("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function vr(e,t){t=Dr(t);var n=Pr[t.name];if(!n)return vr(e,"text/plain");var r=n(e,t);if(Cr.hasOwnProperty(t.name)){var i=Cr[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 Cr={};function Zr(e,t){var n=Cr.hasOwnProperty(e)?Cr[e]:Cr[e]={};L(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 Fr(e,t,n){return e.startState?e.startState(t,n):!0}var Dt=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};Dt.prototype.eol=function(){return this.pos>=this.string.length},Dt.prototype.sol=function(){return this.pos==this.lineStart},Dt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Dt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Dt.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},Dt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Dt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Dt.prototype.skipToEnd=function(){this.pos=this.string.length},Dt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Dt.prototype.backUp=function(e){this.pos-=e},Dt.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)},Dt.prototype.indentation=function(){return ue(this.string,null,this.tabSize)-(this.lineStart?ue(this.string,this.lineStart,this.tabSize):0)},Dt.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)}},Dt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Dt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Dt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Dt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function G(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 ut(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 Or(e,t,n){var r=[];return e.iter(t,n,function(i){r.push(i.text)}),r}function qt(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 B(e,t){return t>=e.first&&t<e.first+e.size}function D(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function m(e,t,n){if(n===void 0&&(n=null),!(this instanceof m))return new m(e,t,n);this.line=e,this.ch=t,this.sticky=n}function x(e,t){return e.line-t.line||e.ch-t.ch}function ge(e,t){return e.sticky==t.sticky&&x(e,t)==0}function ce(e){return m(e.line,e.ch)}function Pe(e,t){return x(e,t)<0?t:e}function be(e,t){return x(e,t)<0?e:t}function Ae(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Y(e,t){if(t.line<e.first)return m(e.first,0);var n=e.first+e.size-1;return t.line>n?m(n,G(e,n).text.length):Ct(t,G(e,t.line).text.length)}function Ct(e,t){var n=e.ch;return n==null||n>t?m(e.line,t):n<0?m(e.line,0):e}function Se(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=Y(e,t[r]);return n}var rt=function(e,t){this.state=e,this.lookAhead=t},Re=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Re.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Re.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}},Re.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Re.fromSaved=function(e,t,n){return t instanceof rt?new Re(e,Jt(e.mode,t.state),n,t.lookAhead):new Re(e,Jt(e.mode,t),n)},Re.prototype.save=function(e){var t=e!==!1?Jt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new rt(t,this.maxLookAhead):t};function _e(e,t,n,r){var i=[e.state.modeGen],a={};Ut(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,Ut(e,t.text,f.mode,n,function(y,T){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(T)if(f.opaque)i.splice(_,c-_,y,"overlay "+T),c=_+2;else for(;_<c;_+=2){var Ce=i[_+1];i[_+1]=(Ce?Ce+" ":"")+"overlay "+T}},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 Mt(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Ee(e,d(t)),i=t.text.length>e.options.maxHighlightLength&&Jt(e.doc.mode,r.state),a=_e(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 Ee(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Re(r,!0,t);var a=Bt(e,t,n),o=a>r.first&&G(r,a-1).stateAfter,l=o?Re.fromSaved(r,o,a):new Re(r,Fr(r.mode),a);return r.iter(a,t,function(s){He(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 He(e,t,n,r){var i=e.doc.mode,a=new Dt(t,e.options.tabSize,n);for(a.start=a.pos=r||0,t==""&&et(i,n.state);!a.eol();)zt(i,a,n.state),a.start=a.pos}function et(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 zt(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 ft=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function hr(e,t,n,r){var i=e.doc,a=i.mode,o;t=Y(i,t);var l=G(i,t.line),s=Ee(e,t.line,n),u=new Dt(l.text,e.options.tabSize,s),f;for(r&&(f=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,o=zt(a,u,s.state),r&&f.push(new ft(u,o,Jt(i.mode,s.state)));return r?f:new ft(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 Ut(e,t,n,r,i,a,o){var l=n.flattenSpans;l==null&&(l=e.options.flattenSpans);var s=0,u=null,f=new Dt(t,e.options.tabSize,r),c,S=e.options.addModeClass&&[null];for(t==""&&Wr(et(n,r.state),a);!f.eol();){if(f.pos>e.options.maxHighlightLength?(l=!1,o&&He(e,t,r,f.pos),f.pos=t.length,c=null):c=Wr(zt(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 T=Math.min(f.pos,s+5e3);i(T,u),s=T}}function Bt(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=G(a,l-1),u=s.stateAfter;if(u&&(!n||l+(u instanceof rt?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 Gt(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=G(e,r).stateAfter;if(i&&(!(i instanceof rt)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var gr=!1,It=!1;function Lt(){gr=!0}function bt(){It=!0}function _t(e,t,n){this.marker=e,this.from=t,this.to=n}function cr(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function rr(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function pr(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Xt(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 _t(o,a.from,s?null:a.to))}}return r}function At(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 _t(o,s?null:a.from-t,a.to==null?null:a.to-t))}}return r}function yr(e,t){if(t.full)return null;var n=B(e,t.from.line)&&G(e,t.from.line).markedSpans,r=B(e,t.to.line)&&G(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,a=t.to.ch,o=x(t.from,t.to)==0,l=Xt(n,i,o),s=At(r,a,o),u=t.text.length==1,f=Ie(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=cr(s,S.marker);y?u&&(S.to=y.to==null?null:y.to+f):S.to=i}}if(s)for(var T=0;T<s.length;++T){var _=s[T];if(_.to!=null&&(_.to+=f),_.from==null){var se=cr(l,_.marker);se||(_.from=f,u&&(l||(l=[])).push(_))}else _.from+=f,u&&(l||(l=[])).push(_)}l&&(l=jr(l)),s&&s!=l&&(s=jr(s));var Ce=[l];if(!u){var Ze=t.text.length-2,we;if(Ze>0&&l)for(var Be=0;Be<l.length;++Be)l[Be].to==null&&(we||(we=[])).push(new _t(l[Be].marker,null,null));for(var mt=0;mt<Ze;++mt)Ce.push(we);Ce.push(s)}return Ce}function jr(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 Xr(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(y){if(y.markedSpans)for(var T=0;T<y.markedSpans.length;++T){var _=y.markedSpans[T].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(!(x(u.to,l.from)<0||x(u.from,l.to)>0)){var f=[s,1],c=x(u.from,l.from),S=x(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 dr(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function en(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function wr(e){return e.inclusiveLeft?-1:0}function Vr(e){return e.inclusiveRight?1:0}function Ur(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),a=x(r.from,i.from)||wr(e)-wr(t);if(a)return-a;var o=x(r.to,i.to)||Vr(e)-Vr(t);return o||t.id-e.id}function br(e,t){var n=It&&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||Ur(r,i.marker)<0)&&(r=i.marker);return r}function ct(e){return br(e,!0)}function V(e){return br(e,!1)}function j(e,t){var n=It&&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||Ur(r,a.marker)<0)&&(r=a.marker)}return r}function Oe(e,t,n,r,i){var a=G(e,t),o=It&&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=x(u.from,n)||wr(s.marker)-wr(i),c=x(u.to,r)||Vr(s.marker)-Vr(i);if(!(f>=0&&c<=0||f<=0&&c>=0)&&(f<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?x(u.to,n)>=0:x(u.to,n)>0)||f>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?x(u.from,r)<=0:x(u.from,r)<0)))return!0}}}function pe(e){for(var t;t=ct(e);)e=t.find(-1,!0).line;return e}function at(e){for(var t;t=V(e);)e=t.find(1,!0).line;return e}function Vt(e){for(var t,n;t=V(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Qt(e,t){var n=G(e,t),r=pe(n);return n==r?t:d(r)}function er(e,t){if(t>e.lastLine())return t;var n=G(e,t),r;if(!xr(e,n))return t;for(;r=V(n);)n=r.find(1,!0).line;return d(n)+1}function xr(e,t){var n=It&&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&&Yr(e,t,r))return!0}}}function Yr(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return Yr(e,r.line,cr(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)&&Yr(e,t,i))return!0}function Er(e){e=pe(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 tn(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=ct(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=V(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 Nr(e){var t=e.display,n=e.doc;t.maxLine=G(n,n.first),t.maxLineLength=tn(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var i=tn(r);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var an=function(e,t,n){this.text=e,en(this,t),this.height=n?n(this):1};an.prototype.lineNo=function(){return d(this)},ye(an);function Nn(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),dr(e),en(e,n);var i=r?r(e):1;i!=e.height&&qt(e,i)}function un(e){e.parent=null,dr(e)}var kr={},Jr={};function Ir(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Jr:kr;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function on(e,t){var n=dt("span",null,null,re?"padding-right: .1px":null),r={pre:dt("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=Hn,Tt(e.display.measure)&&(o=W(a,e.doc.direction))&&(r.addToken=vn(r.addToken,o)),r.map=[];var l=t!=e.display.externalMeasured&&d(a);xn(a,r,Mt(e,a,l)),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=X(a.styleClasses.bgClass,r.bgClass||"")),a.styleClasses.textClass&&(r.textClass=X(a.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Yt(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(re){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 Le(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=X(r.pre.className,r.textClass||"")),r}function Pn(e){var t=J("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Hn(e,t,n,r,i,a,o){if(t){var l=e.splitSpaces?Sn(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),N&&ee<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 T=document.createTextNode(l.slice(c,c+y));N&&ee<9?f.appendChild(J("span",[T])):f.appendChild(T),e.map.push(e.pos,e.pos+y,T),e.col+=y,e.pos+=y}if(!S)break;c+=y+1;var _=void 0;if(S[0]==" "){var se=e.cm.options.tabSize,Ce=se-e.col%se;_=f.appendChild(J("span",Et(Ce),"cm-tab")),_.setAttribute("role","presentation"),_.setAttribute("cm-text"," "),e.col+=Ce}else S[0]=="\r"||S[0]==`
|
|
`?(_=f.appendChild(J("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]),N&&ee<9?f.appendChild(J("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 Ze=n||"";r&&(Ze+=r),i&&(Ze+=i);var we=J("span",[f],Ze,a);if(o)for(var Be in o)o.hasOwnProperty(Be)&&Be!="style"&&Be!="class"&&we.setAttribute(Be,o[Be]);return e.content.appendChild(we)}e.content.appendChild(f)}}function Sn(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 vn(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 Qn(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 xn(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]),Ir(n[o+1],t.cm.options));return}for(var l=i.length,s=0,u=1,f="",c,S,y=0,T,_,se,Ce,Ze;;){if(y==s){T=_=se=S="",Ze=null,Ce=null,y=1/0;for(var we=[],Be=void 0,mt=0;mt<r.length;++mt){var nt=r[mt],jt=nt.marker;if(jt.type=="bookmark"&&nt.from==s&&jt.widgetNode)we.push(jt);else if(nt.from<=s&&(nt.to==null||nt.to>s||jt.collapsed&&nt.to==s&&nt.from==s)){if(nt.to!=null&&nt.to!=s&&y>nt.to&&(y=nt.to,_=""),jt.className&&(T+=" "+jt.className),jt.css&&(S=(S?S+";":"")+jt.css),jt.startStyle&&nt.from==s&&(se+=" "+jt.startStyle),jt.endStyle&&nt.to==y&&(Be||(Be=[])).push(jt.endStyle,nt.to),jt.title&&((Ze||(Ze={})).title=jt.title),jt.attributes)for(var zr in jt.attributes)(Ze||(Ze={}))[zr]=jt.attributes[zr];jt.collapsed&&(!Ce||Ur(Ce.marker,jt)<0)&&(Ce=nt)}else nt.from>s&&y>nt.from&&(y=nt.from)}if(Be)for(var mn=0;mn<Be.length;mn+=2)Be[mn+1]==y&&(_+=" "+Be[mn]);if(!Ce||Ce.from==s)for(var Qr=0;Qr<we.length;++Qr)Qn(t,0,we[Qr]);if(Ce&&(Ce.from||0)==s){if(Qn(t,(Ce.to==null?l+1:Ce.to)-s,Ce.marker,Ce.from==null),Ce.to==null)return;Ce.to==s&&(Ce=!1)}}if(s>=l)break;for(var Jn=Math.min(l,y);;){if(f){var Fn=s+f.length;if(!Ce){var ln=Fn>Jn?f.slice(0,Jn-s):f;t.addToken(t,ln,c?c+T:T,se,s+ln.length==y?_:"",S,Ze)}if(Fn>=Jn){f=f.slice(Jn-s),s=Jn;break}s=Fn,se=""}f=i.slice(a,a=n[u++]),c=Ir(n[u++],t.cm.options)}}}function ni(e,t,n){this.line=t,this.rest=Vt(t),this.size=this.rest?d(Ie(this.rest))-n+1:1,this.node=this.text=null,this.hidden=xr(e,t)}function $r(e,t,n){for(var r=[],i,a=t;a<n;a=i){var o=new ni(e.doc,G(e.doc,a),a);i=a+o.size,r.push(o)}return r}var Bn=null;function ui(e){Bn?Bn.ops.push(e):e.ownsGroup=Bn={ops:[e],delayedCallbacks:[]}}function ii(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{ii(n)}finally{Bn=null,t(n)}}var Kn=null;function Hr(e,t){var n=Ue(e,t);if(n.length){var r=Array.prototype.slice.call(arguments,2),i;Bn?i=Bn.delayedCallbacks:Kn?i=Kn:(i=Kn=[],setTimeout(fn,0));for(var a=function(l){i.push(function(){return n[l].apply(null,r)})},o=0;o<n.length;++o)a(o)}}function fn(){var e=Kn;Kn=null;for(var t=0;t<e.length;++t)e[t]()}function Un(e,t,n,r){for(var i=0;i<t.changes.length;i++){var a=t.changes[i];a=="text"?Vn(e,t):a=="gutter"?vt(e,t,n,r):a=="class"?Ye(e,t):a=="widget"&<(e,t,r)}t.changes=null}function On(e){return e.node==e.text&&(e.node=J("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),N&&ee<8&&(e.node.style.zIndex=2)),e.node}function mr(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=On(t);t.background=r.insertBefore(J("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function Gn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):on(e,t)}function Vn(e,t){var n=t.text.className,r=Gn(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,Ye(e,t)):n&&(t.text.className=n)}function Ye(e,t){mr(e,t),t.line.wrapClass?On(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 vt(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=On(t);t.gutterBackground=J("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=On(t),l=t.gutter=J("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(J("div",D(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(J("div",[f],"CodeMirror-gutter-elt","left: "+r.gutterLeft[u]+"px; width: "+r.gutterWidth[u]+"px"))}}}function lt(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);nr(e,t,n)}function pt(e,t,n,r){var i=Gn(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Ye(e,t),vt(e,t,n,r),nr(e,t,r),t.node}function nr(e,t,n){if(Mr(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)Mr(e,t.rest[r],t,n,!1)}function Mr(e,t,n,r,i){if(t.widgets)for(var a=On(n),o=0,l=t.widgets;o<l.length;++o){var s=l[o],u=J("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),In(s,u,n,r),e.display.input.setUneditable(u),i&&s.above?a.insertBefore(u,n.gutter||n.text):a.appendChild(u),Hr(s,"redraw")}}function In(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 Te(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,J("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Je(e,t){for(var n=Tr(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 kt(e){return e.lineSpace.offsetTop}function Lr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Sr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=Ge(e.measure,J("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 hn(e){return je-e.display.nativeBarWidth}function _n(e){return e.display.scroller.clientWidth-hn(e)-e.display.barWidth}function ei(e){return e.display.scroller.clientHeight-hn(e)-e.display.barHeight}function Rn(e,t,n){var r=e.options.lineWrapping,i=r&&_n(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=pe(t);var n=d(t),r=e.display.externalMeasured=new ni(e.doc,t,n);r.lineN=n;var i=r.built=on(e,r);return r.text=i.pre,Ge(e.display.lineMeasure,i.pre),r}function xa(e,t,n,r){return ti(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&&(Un(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 ti(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||(Rn(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&&Z(t.line.text.charAt(i.coverStart+o));)--o;for(;i.coverStart+l<i.coverEnd&&Z(t.line.text.charAt(i.coverStart+l));)++l;if(N&&ee<9&&o==0&&l==i.coverEnd-i.coverStart?u=a.parentNode.getBoundingClientRect():u=Ja(Pt(a,o,l).getClientRects(),r),u.left||u.right||o==0)break;l=o,o=o-1,s="right"}N&&ee<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(N&&ee<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,T=u.bottom-t.rect.top,_=(y+T)/2,se=t.view.measure.heights,Ce=0;Ce<se.length-1&&!(_<se[Ce]);Ce++);var Ze=Ce?se[Ce-1]:0,we=se[Ce],Be={left:(s=="right"?u.right:u.left)-t.rect.left,right:(s=="left"?u.left:u.right)-t.rect.left,top:Ze,bottom:we};return!u.left&&!u.right&&(Be.bogus=!0),e.options.singleCursorHeightPerLine||(Be.rtop=y,Be.rbottom=T),Be}function Qa(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!ot(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,xt(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 q&&St?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Ra(){return q&&St?-(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+=Te(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=Er(t);if(r=="local"?o+=kt(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=G(e.doc,t.line)),Zi(e,r,xa(e,r,t.ch,i),n)}function An(e,t,n,r,i,a){r=r||G(e.doc,t.line),i||(i=pi(e,r));function o(T,_){var se=ti(e,i,T,_?"right":"left",a);return _?se.left=se.right:se.right=se.left,Zi(e,r,se,n)}var l=W(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(T,_,se){var Ce=l[_],Ze=Ce.level==1;return o(se?T-1:T,Ze!=se)}var c=ie(l,s,u),S=ne,y=f(s,c,u=="before");return S!=null&&(y.other=f(s,S,u!="before")),y}function ar(e,t){var n=0;t=Y(e.doc,t),e.options.lineWrapping||(n=oi(e.display)*t.ch);var r=G(e.doc,t.line),i=Er(r)+kt(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Ht(e,t,n,r,i){var a=m(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 Ht(r.first,0,null,-1,-1);var i=v(r,n),a=r.first+r.size-1;if(i>a)return Ht(r.first+r.size-1,G(r,a).text.length,null,1,1);t<0&&(t=0);for(var o=G(r,i);;){var l=ai(e,o,i,t,n),s=j(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=G(r,i=u.line)}}function En(e,t,n,r){r-=ta(t);var i=t.text.length,a=Q(function(o){return ti(e,n,o-1).bottom<=r},i,0);return i=Q(function(o){return ti(e,n,o).top>r},a,i),{begin:a,end:i}}function rn(e,t,n,r){n||(n=pi(e,t));var i=Zi(e,t,ti(e,n,r),"line").top;return En(e,t,n,i)}function cn(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-=Er(t);var a=pi(e,t),o=ta(t),l=0,s=t.text.length,u=!0,f=W(t,e.doc.direction);if(f){var c=(e.options.lineWrapping?vi:ri)(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,T=Q(function(mt){var nt=ti(e,a,mt);return nt.top+=o,nt.bottom+=o,cn(nt,r,i,!1)?(nt.top<=i&&nt.left<=r&&(S=mt,y=nt),!0):!1},l,s),_,se,Ce=!1;if(y){var Ze=r-y.left<y.right-r,we=Ze==u;T=S+(we?0:1),se=we?"after":"before",_=Ze?y.left:y.right}else{!u&&(T==s||T==l)&&T++,se=T==0?"after":T==t.text.length?"before":ti(e,a,T-(u?1:0)).bottom+o<=i==u?"after":"before";var Be=An(e,m(n,T,se),"line",t,a);_=Be.left,Ce=i<Be.top?-1:i>=Be.bottom?1:0}return T=le(t.text,T,1),Ht(n,T,se,Ce,r-_)}function ri(e,t,n,r,i,a,o){var l=Q(function(c){var S=i[c],y=S.level!=1;return cn(An(e,m(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=An(e,m(n,u?s.from:s.to,u?"after":"before"),"line",t,r);cn(f,a,o,!0)&&f.top>o&&(s=i[l-1])}return s}function vi(e,t,n,r,i,a,o){var l=En(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 T=y.level!=1,_=ti(e,r,T?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 jn;function Xn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(jn==null){jn=J("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)jn.appendChild(document.createTextNode("x")),jn.appendChild(J("br"));jn.appendChild(document.createTextNode("x"))}Ge(e.measure,jn);var n=jn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),xt(e.measure),n||1}function oi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=J("span","xxxxxxxxxx"),n=J("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=Xn(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/oi(e.display)-3);return function(i){if(xr(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&&qt(r,i)})}function Ri(e,t,n,r){var i=e.display;if(!n&&Tr(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=G(e.doc,s.line).text).length==s.ch){var f=ue(u,u.length,e.options.tabSize)-u.length;s=m(s.line,Math.max(0,Math.round((a-Sr(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 kn(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)It&&Qt(e.doc,t)<i.viewTo&&bi(e);else if(n<=i.viewFrom)It&&er(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($r(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(!It||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(;Qt(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=$r(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=$r(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($r(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)&&No(e,l.head,i),s||Vl(e,l,a)}}return r}function No(e,t,n){var r=An(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(J("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(J("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 Na(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=Sr(e.display),l=o.left,s=Math.max(r.sizerWidth,_n(e)-r.sizer.offsetLeft)-o.right,u=i.direction=="ltr";function f(we,Be,mt,nt){Be<0&&(Be=0),Be=Math.round(Be),nt=Math.round(nt),a.appendChild(J("div",null,"CodeMirror-selected","position: absolute; left: "+we+`px;
|
|
top: `+Be+"px; width: "+(mt==null?s-we:mt)+`px;
|
|
height: `+(nt-Be)+"px"))}function c(we,Be,mt){var nt=G(i,we),jt=nt.text.length,zr,mn;function Qr(ln,Wn){return Fi(e,m(we,ln),"div",nt,Wn)}function Jn(ln,Wn,wn){var dn=rn(e,nt,null,ln),sn=Wn=="ltr"==(wn=="after")?"left":"right",qr=wn=="after"?dn.begin:dn.end-(/\s/.test(nt.text.charAt(dn.end-1))?2:1);return Qr(qr,sn)[sn]}var Fn=W(nt,i.direction);return ae(Fn,Be||0,mt==null?jt:mt,function(ln,Wn,wn,dn){var sn=wn=="ltr",qr=Qr(ln,sn?"left":"right"),zn=Qr(Wn-1,sn?"right":"left"),Ji=Be==null&&ln==0,Mi=mt==null&&Wn==jt,Ln=dn==0,ci=!Fn||dn==Fn.length-1;if(zn.top-qr.top<=3){var yn=(u?Ji:Mi)&&Ln,Mo=(u?Mi:Ji)&&ci,gi=yn?l:(sn?qr:zn).left,Ii=Mo?s:(sn?zn:qr).right;f(gi,qr.top,Ii-gi,qr.bottom)}else{var Ai,Dn,Qi,Lo;sn?(Ai=u&&Ji&&Ln?l:qr.left,Dn=u?s:Jn(ln,wn,"before"),Qi=u?l:Jn(Wn,wn,"after"),Lo=u&&Mi&&ci?s:zn.right):(Ai=u?Jn(ln,wn,"before"):l,Dn=!u&&Ji&&Ln?s:qr.right,Qi=!u&&Mi&&ci?l:zn.left,Lo=u?Jn(Wn,wn,"after"):s),f(Ai,qr.top,Dn-Ai,qr.bottom),qr.bottom<zn.top&&f(l,qr.bottom,null,zn.top),f(Qi,zn.top,Lo-Qi,zn.bottom)}(!zr||Na(qr,zr)<0)&&(zr=qr),Na(zn,zr)<0&&(zr=zn),(!mn||Na(qr,mn)<0)&&(mn=qr),Na(zn,mn)<0&&(mn=zn)}),{start:zr,end:mn}}var S=t.from(),y=t.to();if(S.line==y.line)c(S.line,S.ch,y.ch);else{var T=G(i,S.line),_=G(i,y.line),se=pe(T)==pe(_),Ce=c(S.line,S.ch,se?T.text.length+1:null).end,Ze=c(y.line,se?0:null,y.ch).start;se&&(Ce.top<Ze.top-2?(f(Ce.right,Ce.top,null,Ce.bottom),f(l,Ze.top,Ze.left,Ze.bottom)):f(Ce.right,Ce.top,Ze.left-Ce.right,Ce.bottom)),Ce.bottom<Ze.top&&f(l,Ce.bottom,null,Ze.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 Po(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||(Le(e,"focus",e,t),e.state.focused=!0,A(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),re&&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&&(Le(e,"blur",e,t),e.state.focused=!1,te(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Pa(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(N&&ee<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)&&(qt(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-kt(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,Er(G(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=o&&(a=v(t,Er(G(t,s))-e.wrapper.clientHeight),o=s)}return{from:a,to:Math.max(o,a+1)}}function _l(e,t){if(!Me(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&&!De){var a=J("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-n.viewOffset-kt(e.display))+`px;
|
|
height: `+(t.bottom-t.top+hn(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 jl(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(t=t.ch?m(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,n=t.sticky=="before"?m(t.line,t.ch+1,"before"):t);for(var a=0;a<5;a++){var o=!1,l=An(e,t),s=!n||n==t?l:An(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 Xl(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=Xn(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,a=ei(e),o={};t.bottom-t.top>a&&(t.bottom=t.top+a);var l=e.doc.height+Lr(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=_n(e)-n.gutters.offsetWidth,T=t.right-t.left>y;return T&&(t.right=t.left+y),t.left<10?o.scrollLeft=0:t.left<S?o.scrollLeft=Math.max(0,t.left+c-(T?0:10)):t.right>y+S-3&&(o.scrollLeft=t.right+(T?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=ar(e,t.from),r=ar(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||(H||ao(e,{top:t}),ko(e,t,!0),H&&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+Lr(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+hn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Ni=function(e,t,n){this.cm=n;var r=this.vert=J("div",[J("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=J("div",[J("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),U(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),U(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,N&&ee<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Ni.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}},Ni.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Ni.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Ni.prototype.zeroWidthHack=function(){var e=ht&&!M?"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},Ni.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)},Ni.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&&Pa(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:Ni,null:oa};function Wo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&te(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),U(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&&A(e.display.wrapper,e.display.scrollbars.addClass)}var Jl=0;function Pi(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&&Nr(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&&Pa(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+hn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-_n(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&&Po(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=jl(t,Y(r,e.scrollToPos.from),Y(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||Le(a[l],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&Le(o[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Le(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Yn(e,t){if(e.curOp)return t();Pi(e);try{return t()}finally{Oi(e)}}function gn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Pi(e);try{return t.apply(e,arguments)}finally{Oi(e)}}}function Tn(e){return function(){if(this.curOp)return e.apply(this,arguments);Pi(this);try{return e.apply(this,arguments)}finally{Oi(this)}}}function pn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Pi(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,ke(ns,e))}function ns(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=Ee(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=_e(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&&He(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&&Yn(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=_n(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++)Le.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=hn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=hn(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)),It&&(a=Qt(e.doc,a),o=er(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=Er(G(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),xt(n.cursorDiv),xt(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==_n(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+Lr(e.display)-ei(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;Pa(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)){Pa(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(T){var _=T.nextSibling;return re&&ht&&e.display.currentWheelTarget==T?T.style.display="none":T.parentNode.removeChild(T),_}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=pt(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),Un(e,c,u,n)),y&&(xt(c.lineNumber),c.lineNumber.appendChild(document.createTextNode(D(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+hn(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=D(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(J("div",[J("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;xt(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(J("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),kn(e),Ho(e)}function ss(e,t,n,r){var i=this;this.input=n,i.scrollbarFiller=J("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=J("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=dt("div",null,"CodeMirror-code"),i.selectionDiv=J("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=J("div",null,"CodeMirror-cursors"),i.measure=J("div",null,"CodeMirror-measure"),i.lineMeasure=J("div",null,"CodeMirror-measure"),i.lineSpace=dt("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var a=dt("div",[i.lineSpace],"CodeMirror-lines");i.mover=J("div",[a],null,"position: relative"),i.sizer=J("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=J("div",null,null,"position: absolute; height: "+je+"px; width: 1px;"),i.gutters=J("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=J("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=J("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),N&&ee<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!re&&!(H&&Ot)&&(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,$n=null;N?$n=-.53:H?$n=15:q?$n=-.7:Fe&&($n=-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*=$n,t.y*=$n,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&&ht&&re){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&&!H&&!h&&$n!=null){i&&s&&ia(e,Math.max(0,o.scrollTop+i*$n)),Di(e,Math.max(0,o.scrollLeft+r*$n)),(!i||i&&s)&&qe(t),a.wheelStartX=null;return}if(i&&$n!=null){var S=i*$n,y=e.doc.scrollTop,T=y+a.wrapper.clientHeight;S<0?y=Math.max(0,y+S-50):T=Math.min(e.doc.height,T+S+50),ao(e,{top:y,bottom:T})}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,Ce=se&&a.wheelDY&&se/a.wheelDY||_&&a.wheelDX&&_/a.wheelDX;a.wheelStartX=a.wheelStartY=null,Ce&&($n=($n*ka+Ce)/(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(!ge(n.anchor,r.anchor)||!ge(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 Rr(ce(this.ranges[t].anchor),ce(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(x(t,r.from())>=0&&x(e,r.to())<=0)return n}return-1};var Rr=function(e,t){this.anchor=e,this.head=t};Rr.prototype.from=function(){return be(this.anchor,this.head)},Rr.prototype.to=function(){return Pe(this.anchor,this.head)},Rr.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 x(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=x(l.to(),o.from());if(r&&!o.empty()?s>0:s>=0){var u=be(l.from(),o.from()),f=Pe(l.to(),o.to()),c=l.empty()?o.from()==o.head:l.from()==l.head;a<=n&&--n,t.splice(--a,2,new Rr(c?f:u,c?u:f))}}return new qn(t,n)}function Si(e,t){return new qn([new Rr(e,t||e)],0)}function Ci(e){return e.text?m(e.from.line+e.text.length-1,Ie(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Vo(e,t){if(x(e,t.from)<0)return e;if(x(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),m(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 Rr(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?m(n.line,e.ch-t.ch+n.ch):m(n.line+(e.line-t.line),e.ch)}function fs(e,t,n){for(var r=[],i=m(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=x(f.head,f.anchor)<0;r[o]=new Rr(c?u:s,c?s:u)}else r[o]=new Rr(s,s)}return new qn(r,e.sel.primIndex)}function fo(e){e.doc.mode=vr(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&&kn(e)}function jo(e,t){return t.from.ch==0&&t.to.ch==0&&Ie(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function co(e,t,n,r){function i(Ze){return n?n[Ze]:null}function a(Ze,we,Be){Nn(Ze,we,Be,r),Hr(Ze,"change",Ze,t)}function o(Ze,we){for(var Be=[],mt=Ze;mt<we;++mt)Be.push(new an(u[mt],i(mt),r));return Be}var l=t.from,s=t.to,u=t.text,f=G(e,l.line),c=G(e,s.line),S=Ie(u),y=i(u.length-1),T=s.line-l.line;if(t.full)e.insert(0,o(0,u.length)),e.remove(u.length,e.size-u.length);else if(jo(e,t)){var _=o(0,u.length-1);a(c,c.text,y),T&&e.remove(l.line,T),_.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 an(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,T);else{a(f,f.text.slice(0,l.ch)+u[0],i(0)),a(c,S+c.text.slice(s.ch),y);var Ce=o(1,u.length-1);T>1&&e.remove(l.line+1,T-1),e.insert(l.line+1,Ce)}Hr(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 Xo(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||Nr(e),e.options.mode=t.modeOption,kn(e)}function Yo(e){(e.doc.direction=="rtl"?A:te)(e.display.lineDiv,"CodeMirror-rtl")}function cs(e){Yn(e,function(){Yo(e),kn(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:ce(t.from),to:Ci(t),text:ut(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=Ie(e);if(t.ranges)e.pop();else break}}function ds(e,t){if(t)return Jo(e.done),Ie(e.done);if(e.done.length&&!Ie(e.done).ranges)return Ie(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Ie(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=Ie(o.changes),x(t.from,t.to)==0&&x(t.from,l.to)==0?l.to=Ci(t):o.changes.push(vo(e,t));else{var s=Ie(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||Le(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,Ie(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=Ie(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=yr(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&&(Ie(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=x(t,i)<0;a!=x(n,i)<0?(i=t,t=n):a!=x(t,n)<0&&(t=n)}return new Rr(i,t)}else return new Rr(n||t,t)}function Wa(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),Mn(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);Mn(e,o,n)}function go(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Mn(e,li(e.cm,i,e.sel.primIndex),r)}function tl(e,t,n,r){Mn(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 Rr(Y(e,i[a].anchor),Y(e,i[a].head))},origin:n&&n.origin};return Le(e,"beforeSelectionChange",e,r),e.cm&&Le(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=Ie(r);i&&i.ranges?(r[r.length-1]=t,za(e,t,n)):Mn(e,t,n)}function Mn(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||(x(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,gt(e.cm)),Hr(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 Rr(s,u))}return i?li(e.cm,i,t.primIndex):t}function Ki(e,t,n,r,i){var a=G(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&&(Le(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=x(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,m(e.first,0))}function ol(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?Y(e,m(t.line-1)):null:n>0&&t.ch==(r||G(e,t.line)).text.length?t.line<e.first+e.size-1?m(t.line+1,0):null:new m(t.line,t.ch+n)}function ll(e){e.setSelection(m(e.firstLine(),0),m(e.lastLine()),xe)}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=Y(e,i)),a&&(r.to=Y(e,a)),o&&(r.text=o),l!==void 0&&(r.origin=l)}),Le(e,"beforeChange",e,r),e.cm&&Le(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 gn(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=gr&&!n&&Xr(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]==""&&x(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,yr(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,yr(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)){Mn(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 Ce=_?uo(e,se):Ie(l);fa(e,se,Ce,qo(e,se)),!_&&e.cm&&e.cm.scrollIntoView({from:se.from,to:Ci(se)});var Ze=[];wi(e,function(we,Be){!Be&&fe(Ze,we.history)==-1&&(vl(we.history,se),Ze.push(we.history)),fa(we,se,null,qo(we,se))})},y=a.changes.length-1;y>=0;--y){var T=S(y);if(T)return T.v}}}}function fl(e,t){if(t!=0&&(e.first+=t,e.sel=new qn(or(e.sel.ranges,function(i){return new Rr(m(i.anchor.line+t,i.anchor.ch),m(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){kn(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 gn(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:m(e.first,0),to:m(t.to.line+i,t.to.ch),text:[Ie(t.text)],origin:t.origin}}var a=e.lastLine();t.to.line>a&&(t={from:t.from,to:m(a,G(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ut(e,t.from,t.to),n||(n=uo(e,t)),e.cm?ys(e.cm,t,r):co(e,t,r),za(e,n,xe),e.cantEdit&&Ha(e,m(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(pe(G(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&>(e),co(r,t,n,Ro(e)),e.options.lineWrapping||(r.iter(s,a.line+t.text.length,function(y){var T=tn(y);T>i.maxLineLength&&(i.maxLine=y,i.maxLineLength=T,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),Gt(r,a.line),la(e,400);var u=t.text.length-(o.line-a.line)-1;t.full?kn(e):a.line==o.line&&t.text.length==1&&!jo(e.doc,t)?yi(e,a.line,"text"):kn(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&&Hr(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),x(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=m(u.from.line+r,u.from.ch),u.to=m(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=G(e,Ae(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,un(i),Hr(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=Te(this);qt(n,Math.max(0,n.height-a)),e&&(Yn(e,function(){hl(e,n,-a),yi(e,r,"widget")}),Hr(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=Te(this)-t;i&&(xr(this.doc,r)||qt(r,r.height+i),n&&Yn(n,function(){n.curOp.forceUpdate=!0,hl(n,r,i),Hr(n,"lineWidgetChanged",n,e,d(r))}))},ye(ha);function hl(e,t,n){Er(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&&!xr(e,o)){var s=Er(o)<e.scrollTop;qt(o,o.height+Te(i)),s&&no(a,i.height),a.curOp.forceUpdate=!0}return!0}),a&&Hr(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&&Pi(e),Xe(this,"clear")){var n=this.find();n&&Hr(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=cr(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=rr(o.markedSpans,l),l.from==null&&this.collapsed&&!xr(this.doc,o)&&e&&qt(o,Xn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var u=pe(this.lines[s]),f=tn(u);f>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=f,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&kn(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&&Hr(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=cr(a.markedSpans,this);if(o.from!=null&&(n=m(t?a:d(a),o.from),e==-1))return n;if(o.to!=null&&(r=m(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||Yn(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,!xr(n.doc,i)&&n.height!=null){var l=n.height;n.height=null;var s=Te(n)-l;s&&qt(i,i.height+s)}Hr(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)}},ye(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 gn(e.cm,Vi)(e,t,n,r,i);var a=new xi(e,i),o=x(t,n);if(r&&L(r,a,!1),o>0||o==0&&a.clearWhenEmpty!==!1)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=dt("span",[a.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(Oe(e,t.line,t,n,a)||t.line!=n.line&&Oe(e,n.line,t,n,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");bt()}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&&pe(c)==s.display.maxLine&&(u=!0),a.collapsed&&l!=t.line&&qt(c,0),pr(c,new _t(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){xr(e,c)&&qt(c,0)}),a.clearOnEnter&&U(a,"beforeCursorEnter",function(){return a.clear()}),a.readOnly&&(Lt(),(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)kn(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),Hr(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();Hr(this,"clear")}},ga.prototype.find=function(e,t){return this.primary.find(e,t)},ye(ga);function Ss(e,t,n,r,i){r=L(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,Y(s,t),Y(s,n),r,i));for(var u=0;u<s.linked.length;++u)if(s.linked[u].isParent)return;o=Ie(a)}),new ga(a,o)}function pl(e){return e.findMarks(m(e.first,0),e.clipPos(m(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(x(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,Zn=function(e,t,n,r,i){if(!(this instanceof Zn))return new Zn(e,t,n,r,i);n==null&&(n=0),va.call(this,[new da([new an("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var a=m(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}),Mn(this,Si(a),xe)};Zn.prototype=p(va.prototype,{constructor:Zn,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=Or(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:pn(function(e){var t=m(this.first,0),n=this.first+this.size-1;Ui(this,{from:t,to:m(n,G(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&na(this.cm,0,0),Mn(this,Si(t),xe)}),replaceRange:function(e,t,n,r){t=Y(this,t),n=n?Y(this,n):t,Gi(this,e,t,n,r)},getRange:function(e,t,n){var r=ut(this,Y(this,e),Y(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(B(this,e))return G(this,e)},getLineNumber:function(e){return d(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=G(this,e)),pe(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Y(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:pn(function(e,t,n){tl(this,Y(this,typeof e=="number"?m(e,t||0):e),null,n)}),setSelection:pn(function(e,t,n){tl(this,Y(this,e),Y(this,t||e),n)}),extendSelection:pn(function(e,t,n){Wa(this,Y(this,e),t&&Y(this,t),n)}),extendSelections:pn(function(e,t){el(this,Se(this,e),t)}),extendSelectionsBy:pn(function(e,t){var n=or(this.sel.ranges,e);el(this,Se(this,n),t)}),setSelections:pn(function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new Rr(Y(this,e[i].anchor),Y(this,e[i].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Mn(this,li(this.cm,r,t),n)}}),addSelection:pn(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Rr(Y(this,e),Y(this,t||e))),Mn(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=ut(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=ut(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:pn(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:pn(function(){Ba(this,"undo")}),redo:pn(function(){Ba(this,"redo")}),undoSelection:pn(function(){Ba(this,"undo",!0)}),redoSelection:pn(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:pn(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:pn(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(!B(this,e)||(t=e,e=G(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:pn(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:pn(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:pn(function(e,t,n){return bs(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Vi(this,Y(this,e),Y(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=Y(this,e),Vi(this,e,e,n,"bookmark")},findMarksAt:function(e){e=Y(this,e);var t=[],n=G(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=Y(this,e),t=Y(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}),Y(this,m(n,t))},indexFromPos:function(e){e=Y(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 Zn(Or(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 Zn(Or(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):$e(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:pn(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))})}),Zn.prototype.eachLine=Zn.prototype.iter;var ml=0;function Es(e){var t=this;if(yl(t),!(Me(t,e)||Je(t.display,e))){qe(e),N&&(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&&gn(t,function(){n=Y(t.doc,n);var y={from:n,to:n,text:t.doc.splitLines(a.filter(function(T){return T!=null}).join(t.doc.lineSeparator())),origin:"paste"};Ui(t.doc,y),rl(t.doc,Si(Y(t.doc,n),Y(t.doc,Ci(y))))})()},s=function(y,T){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[T]=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(N&&(!e.state.draggingText||+new Date-ml<100)){$t(t);return}if(!(Me(e,t)||Je(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!Fe)){var n=J("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();No(e,n,r),e.display.dragCursor||(e.display.dragCursor=J("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;U(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,bl(Ds)},100))}),U(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=ht?hi.macDefault:hi.pcDefault;function Ns(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 Ps(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=or(n.split(" "),Ns),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),(F?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(F?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 ji(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var a=t(n[i]);r.length&&x(a.from,Ie(r).to)<=0;){var o=r.pop();if(x(o.from,a.from)<0){a.from=o.from;break}}r.push(a)}Yn(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=le(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 m(t.line,r,n<0?"after":"before")}function yo(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var a=W(n,t.doc.direction);if(a){var o=i<0?Ie(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=ti(t,f,u).top;u=Q(function(S){return ti(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 m(r,u,s)}}return new m(r,i<0?n.text.length:0,i<0?"before":"after")}function Os(e,t,n,r){var i=W(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=ie(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(Ce,Ze){return po(t,Ce instanceof m?Ce.ch:Ce,Ze)},s,u=function(Ce){return e.options.lineWrapping?(s=s||pi(e,t),rn(e,t,s,Ce)):{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 m(n.line,S,y)}}var T=function(Ce,Ze,we){for(var Be=function(zr,mn){return mn?new m(n.line,l(zr,1),"before"):new m(n.line,zr,"after")};Ce>=0&&Ce<i.length;Ce+=Ze){var mt=i[Ce],nt=Ze>0==(mt.level!=1),jt=nt?we.begin:l(we.end,-1);if(mt.from<=jt&&jt<mt.to||(jt=nt?mt.from:l(mt.to,-1),we.begin<=jt&&jt<we.end))return Be(jt,nt)}},_=T(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)&&(_=T(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"),xe)},killLine:function(e){return ji(e,function(t){if(t.empty()){var n=G(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:m(t.head.line+1,0)}:{from:t.head,to:m(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return ji(e,function(t){return{from:m(t.from().line,0),to:Y(e.doc,m(t.to().line+1,0))}})},delLineLeft:function(e){return ji(e,function(t){return{from:m(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return ji(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 ji(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(m(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(m(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")},We)},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")},We)},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},We)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],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(Et(r-o%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Yn(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,a=G(e.doc,i.line).text;if(a){if(i.ch==a.length&&(i=new m(i.line,i.ch-1)),i.ch>0)i=new m(i.line,i.ch+1),e.replaceRange(a.charAt(i.ch-1)+a.charAt(i.ch-2),m(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var o=G(e.doc,i.line-1).text;o&&(i=new m(i.line,1),e.replaceRange(a.charAt(0)+e.doc.lineSeparator()+o.charAt(o.length-1),m(i.line-1,o.length-1),i,"+transpose"))}}n.push(new Rr(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return Yn(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=G(e.doc,t),r=pe(n);return r!=n&&(t=d(r)),yo(!0,e,r,t,1)}function Is(e,t){var n=G(e.doc,t),r=at(n);return r!=n&&(t=d(r)),yo(!0,e,n,t,-1)}function Ml(e,t){var n=El(e,t.line),r=G(e.doc,n.line),i=W(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 m(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"&&Hr(e,"keyHandled",e,t,n),(i=="handled"||i=="multi")&&(qe(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(),!Me(t,e))){N&&ee<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&&!ur&&(ht?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),H&&!ht&&!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;A(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(te(t,"CodeMirror-crosshair"),ve(document,"keyup",n),ve(document,"mouseover",n))}U(document,"keyup",n),U(document,"mouseover",n)}function Dl(e){e.keyCode==16&&(this.doc.sel.shift=!1),Me(this,e)}function Nl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(Je(t.display,e)||Me(t,e)||e.ctrlKey&&!e.altKey||ht&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(h&&n==bo){bo=null,qe(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&&x(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 Pl(e){var t=this,n=t.display;if(!(Me(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,Je(n,e)){re||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!Co(t,e)){var r=Ri(t,e),i=tt(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):Tr(e)==n.scroller&&qe(e):i==2?(r&&Wa(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(wt?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=Nt?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=ht?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(ht?n.altKey:n.ctrlKey)),i}function Ks(e,t,n,r){N?setTimeout(ke(Po,e),0):e.curOp.focus=E();var i=Bs(e,n,r),a=e.doc.sel,o;e.options.dragDrop&&it&&!e.isReadOnly()&&n=="single"&&(o=a.contains(t))>-1&&(x((o=a.ranges[o]).from(),t)<0||t.xRel>0)&&(x(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=gn(e,function(u){re&&(i.scroller.draggable=!1),e.state.draggingText=!1,ve(i.wrapper.ownerDocument,"mouseup",o),ve(i.wrapper.ownerDocument,"mousemove",l),ve(i.scroller,"dragstart",s),ve(i.scroller,"drop",o),a||(qe(u),r.addNew||Wa(e.doc,n,null,null,r.extend),re&&!Fe||N&&ee==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};re&&(i.scroller.draggable=!0),e.state.draggingText=o,o.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),U(i.wrapper.ownerDocument,"mouseup",o),U(i.wrapper.ownerDocument,"mousemove",l),U(i.scroller,"dragstart",s),U(i.scroller,"drop",o),Oo(e),setTimeout(function(){return i.input.focus()},20)}function Ol(e,t,n){if(n=="char")return new Rr(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Rr(m(t.line,0),Y(e.doc,m(t.line+1,0)));var r=n(e,t);return new Rr(r.from,r.to)}function Gs(e,t,n,r){var i=e.display,a=e.doc;qe(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 Rr(n,n)):(o=a.sel.primary(),l=a.sel.primIndex),r.unit=="rectangle")r.addNew||(o=new Rr(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,Mn(a,li(e,u.concat([o]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&r.unit=="char"&&!r.extend?(Mn(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,Mn(a,new qn([o],0),Ke),s=a.sel);var c=n;function S(we){if(x(c,we)!=0)if(c=we,r.unit=="rectangle"){for(var Be=[],mt=e.options.tabSize,nt=ue(G(a,n.line).text,n.ch,mt),jt=ue(G(a,we.line).text,we.ch,mt),zr=Math.min(nt,jt),mn=Math.max(nt,jt),Qr=Math.min(n.line,we.line),Jn=Math.min(e.lastLine(),Math.max(n.line,we.line));Qr<=Jn;Qr++){var Fn=G(a,Qr).text,ln=Zt(Fn,zr,mt);zr==mn?Be.push(new Rr(m(Qr,ln),m(Qr,ln))):Fn.length>ln&&Be.push(new Rr(m(Qr,ln),m(Qr,Zt(Fn,mn,mt))))}Be.length||Be.push(new Rr(n,n)),Mn(a,li(e,s.ranges.slice(0,l).concat(Be),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(we)}else{var Wn=o,wn=Ol(e,we,r.unit),dn=Wn.anchor,sn;x(wn.anchor,dn)>0?(sn=wn.head,dn=be(Wn.from(),wn.anchor)):(sn=wn.anchor,dn=Pe(Wn.to(),wn.head));var qr=s.ranges.slice(0);qr[l]=Vs(e,new Rr(Y(a,dn),sn)),Mn(a,li(e,qr,l),Ke)}}var y=i.wrapper.getBoundingClientRect(),T=0;function _(we){var Be=++T,mt=Ri(e,we,!0,r.unit=="rectangle");if(mt)if(x(mt,c)!=0){e.curOp.focus=E(),S(mt);var nt=Oa(i,a);(mt.line>=nt.to||mt.line<nt.from)&&setTimeout(gn(e,function(){T==Be&&_(we)}),150)}else{var jt=we.clientY<y.top?-20:we.clientY>y.bottom?20:0;jt&&setTimeout(gn(e,function(){T==Be&&(i.scroller.scrollTop+=jt,_(we))}),50)}}function se(we){e.state.selectingText=!1,T=1/0,we&&(qe(we),i.input.focus()),ve(i.wrapper.ownerDocument,"mousemove",Ce),ve(i.wrapper.ownerDocument,"mouseup",Ze),a.history.lastSelOrigin=null}var Ce=gn(e,function(we){we.buttons===0||!tt(we)?se(we):_(we)}),Ze=gn(e,se);e.state.selectingText=Ze,U(i.wrapper.ownerDocument,"mousemove",Ce),U(i.wrapper.ownerDocument,"mouseup",Ze)}function Vs(e,t){var n=t.anchor,r=t.head,i=G(e.doc,n.line);if(x(n,r)==0&&n.sticky==r.sticky)return t;var a=W(i);if(!a)return t;var o=ie(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=ie(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),T=y?S.from:S.to,_=y?"after":"before";return n.ch==T&&n.sticky==_?t:new Rr(new m(n.line,T,_),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&&qe(t);var o=e.display,l=o.lineDiv.getBoundingClientRect();if(a>l.bottom||!Xe(e,n))return lr(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 Le(e,n,e,f,c.className,t),lr(t)}}}function Co(e,t){return Il(e,t,"gutterClick",!0)}function Al(e,t){Je(e.display,t)||_s(e,t)||Me(e,t,"contextmenu")||wt||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 Xi={toString:function(){return"CodeMirror.Init"}},Zl={},Va={};function js(e){var t=e.optionHandlers;function n(r,i,a,o){e.defaults[r]=i,a&&(t[r]=o?function(l,s,u){u!=Xi&&a(l,s,u)}:a)}e.defineOption=n,e.Init=Xi,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),kn(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(m(o,f))}o++});for(var l=a.length-1;l>=0;l--)Gi(r.doc,i,a[l],m(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!=Xi&&r.refresh()}),n("specialCharPlaceholder",Pn,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",Ot?"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!=Xi&&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,Xs),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 Xs(e,t,n){var r=n&&n!=Xi;if(!t!=!r){var i=e.display.dragFunctions,a=t?U:ve;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?(A(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(te(e.display.wrapper,"CodeMirror-wrap"),Nr(e)),qa(e),kn(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?L(t):{},L(Zl,t,!1);var r=t.value;typeof r=="string"?r=new Zn(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&&!Ot&&a.input.focus(),N&&ee<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Js(this),Rs(),Pi(this),this.curOp.forceUpdate=!0,Xo(this,r),t.autofocus&&!Ot||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],Xi);Bo(this),t.finishInit&&t.finishInit(this);for(var l=0;l<wo.length;++l)wo[l](this);Oi(this),re&&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;U(t.scroller,"mousedown",gn(e,Pl)),N&&ee<11?U(t.scroller,"dblclick",gn(e,function(s){if(!Me(e,s)){var u=Ri(e,s);if(!(!u||Co(e,s)||Je(e.display,s))){qe(s);var f=e.findWordAt(u);Wa(e.doc,f.anchor,f.head)}}})):U(t.scroller,"dblclick",function(s){return Me(e,s)||qe(s)}),U(t.scroller,"contextmenu",function(s){return Al(e,s)}),U(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}U(t.scroller,"touchstart",function(s){if(!Me(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)}}),U(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),U(t.scroller,"touchend",function(s){var u=t.activeTouch;if(u&&!Je(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 Rr(f,f):!u.prev.prev||o(u,u.prev.prev)?c=e.findWordAt(f):c=new Rr(m(f.line,0),Y(e.doc,m(f.line+1,0))),e.setSelection(c.anchor,c.head),e.focus(),qe(s)}i()}),U(t.scroller,"touchcancel",i),U(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ia(e,t.scroller.scrollTop),Di(e,t.scroller.scrollLeft,!0),Le(e,"scroll",e))}),U(t.scroller,"mousewheel",function(s){return Go(e,s)}),U(t.scroller,"DOMMouseScroll",function(s){return Go(e,s)}),U(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(s){Me(e,s)||$t(s)},over:function(s){Me(e,s)||(Ls(e,s),$t(s))},start:function(s){return Ms(e,s)},drop:gn(e,Es),leave:function(s){Me(e,s)||yl(e)}};var l=t.input.getField();U(l,"keyup",function(s){return Dl.call(e,s)}),U(l,"keydown",gn(e,Tl)),U(l,"keypress",gn(e,Nl)),U(l,"focus",function(s){return to(e,s)}),U(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=Ee(e,t).state:n="prev");var o=e.options.tabSize,l=G(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(G(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+=Et(f-S)),c!=u)return Gi(i,c,m(t,0),m(t,u.length),"+input"),l.stateAfter=null,!0;for(var T=0;T<i.sel.ranges.length;T++){var _=i.sel.ranges[T];if(_.head.line==t&&_.head.ch<u.length){var se=m(t,u.length);go(i,T,new Rr(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=$e(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=or(s,function(Ce){return[Ce]}));for(var c=e.curOp.updateInput,S=r.ranges.length-1;S>=0;S--){var y=r.ranges[S],T=y.from(),_=y.to();y.empty()&&(n&&n>0?T=m(T.line,T.ch-n):e.state.overwrite&&!l?_=m(_.line,Math.min(G(a,_.line).text.length,_.ch+Ie(s).length)):l&&si&&si.lineWise&&si.text.join(`
|
|
`)==s.join(`
|
|
`)&&(T=_=m(T.line,0)));var se={from:T,to:_,text:u?u[S%u.length]:s,origin:i||(l?"paste":e.state.cutIncoming>o?"cut":"+input")};Ui(e.doc,se),Hr(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&&Yn(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(G(e.doc,i.head.line).text.slice(0,i.head.ch))&&(o=wa(e,i.head.line,"smart"));o&&Hr(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:m(i,0),head:m(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=J("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=J("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return re?e.style.width="1000px":e.setAttribute("wrap","off"),R&&(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)&&gn(this,t[r])(this,i,o),Le(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:Tn(function(r,i){var a=r.token?r:e.getMode(this.options,r);if(a.startState)throw new Error("Overlays may not be stateful.");tr(this.state.overlays,{mode:a,modeSpec:r,opaque:i&&i.opaque,priority:i&&i.priority||0},function(o){return o.priority}),this.state.modeGen++,kn(this)}),removeOverlay:Tn(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++,kn(this);return}}}),indentLine:Tn(function(r,i,a){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),B(this.doc,r)&&wa(this,r,i,a)}),indentSelection:Tn(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 Rr(s,S[o].to()),xe)}}}),getTokenAt:function(r,i){return hr(this,r,i)},getLineTokens:function(r,i){return hr(this,m(r),i,!0)},getTokenTypeAt:function(r){r=Y(this.doc,r);var i=Mt(this,G(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=Ae(a,r==null?a.first+a.size-1:r),Ee(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=Y(this.doc,r):a=r?o.from():o.to(),An(this,a,i||"page")},charCoords:function(r,i){return Fi(this,Y(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=G(this.doc,r)}else l=r;return Zi(this,l,{top:0,left:0},i||"page",a||o).top+(o?this.doc.height-Er(l):0)},defaultTextHeight:function(){return Xn(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=An(this,Y(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&&Xl(this,{left:f,top:u,right:f+i.offsetWidth,bottom:u+i.offsetHeight})},triggerOnKeyDown:Tn(Tl),triggerOnKeyPress:Tn(Nl),triggerOnKeyUp:Dl,triggerOnMouseDown:Tn(Pl),execCommand:function(r){if(ya.hasOwnProperty(r))return ya[r].call(null,this)},triggerElectric:Tn(function(r){Wl(this,r)}),findPosH:function(r,i,a,o){var l=1;i<0&&(l=-1,i=-i);for(var s=Y(this.doc,r),u=0;u<i&&(s=Eo(this.doc,s,l,a,o),!s.hitSide);++u);return s},moveH:Tn(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()},We)}),deleteH:Tn(function(r,i){var a=this.doc.sel,o=this.doc;a.somethingSelected()?o.replaceSelection("",null,"+delete"):ji(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=Y(this.doc,r),f=0;f<i;++f){var c=An(this,u,"div");if(s==null?s=c.left:c.left=s,u=Kl(this,c,l,a),u.hitSide)break}return u},moveV:Tn(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=An(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},We),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=G(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 Rr(m(r.line,o),m(r.line,l))},toggleOverwrite:function(r){r!=null&&r==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?A(this.display.cursorDiv,"CodeMirror-overwrite"):te(this.display.cursorDiv,"CodeMirror-overwrite"),Le(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==E()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Tn(function(r,i){na(this,r,i)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-hn(this)-this.display.barHeight,width:r.scrollWidth-hn(this)-this.display.barWidth,clientHeight:ei(this),clientWidth:_n(this)}},scrollIntoView:Tn(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:m(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:Tn(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,Le(this,"refresh",this)}),operation:function(r){return Yn(this,r)},startOperation:function(){return Pi(this)},endOperation:function(){return Oi(this)},refresh:Tn(function(){var r=this.display.cachedTextHeight;kn(this),this.curOp.forceUpdate=!0,Li(this),na(this,this.doc.scrollLeft,this.doc.scrollTop),oo(this.display),(r==null||Math.abs(r-Xn(this.display))>.5||this.options.lineWrapping)&&qa(this),Le(this,"refresh",this)}),swapDoc:Tn(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),Xo(this,r),Li(this),this.display.input.reset(),na(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,Hr(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}},ye(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=G(e,t.line),s=i&&e.direction=="rtl"?-n:n;function u(){var Ze=t.line+s;return Ze<e.first||Ze>=e.first+e.size?!1:(t=new m(Ze,t.ch,t.sticky),l=G(e,Ze))}function f(Ze){var we;if(r=="codepoint"){var Be=l.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(Be)?we=null:we=new m(t.line,Math.max(0,Math.min(l.text.length,t.ch+n*(Be>=55296&&Be<56320?2:1))),-n)}else i?we=Os(e.cm,l,t,n):we=mo(l,t,n);if(we==null)if(!Ze&&u())t=yo(i,e.cm,l,t.line,s);else return!1;else t=we;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"),T=!0;!(n<0&&!f(!T));T=!1){var _=l.text.charAt(t.ch)||`
|
|
`,se=w(_,y)?"w":S&&_==`
|
|
`?"n":!S||/\s/.test(_)?null:"p";if(S&&!T&&!se&&(se="s"),c&&c!=se){n<0&&(n=1,f(),t.sticky="after");break}if(se&&(c=se),n>0&&!f(!T))break}var Ce=Ha(e,t,a,o,!0);return ge(a,Ce)&&(Ce.hitSide=!0),Ce}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*Xn(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 Ar=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};Ar.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}U(i,"paste",function(l){!a(l)||Me(r,l)||Fl(l,r)||ee<=11&&setTimeout(gn(r,function(){return t.updateFromDOM()}),20)}),U(i,"compositionstart",function(l){t.composing={data:l.data,done:!1}}),U(i,"compositionupdate",function(l){t.composing||(t.composing={data:l.data,done:!1})}),U(i,"compositionend",function(l){t.composing&&(l.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),U(i,"touchstart",function(){return n.forceCompositionEnd()}),U(i,"input",function(){t.composing||t.readFromDOMSoon()});function o(l){if(!(!a(l)||Me(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,xe),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)}}U(i,"copy",o),U(i,"cut",o)},Ar.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ar.prototype.prepareSelection=function(){var e=Do(this.cm,!1);return e.focus=document.activeElement==this.div,e},Ar.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Ar.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ar.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=ja(t,e.anchorNode,e.anchorOffset),o=ja(t,e.focusNode,e.focusOffset);if(!(a&&!a.bad&&o&&!o.bad&&x(be(a,o),r)==0&&x(Pe(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=Pt(s.node,s.offset,u.offset,u.node)}catch(T){}y&&(!H&&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):H&&this.startGracePeriod()),this.rememberSelection()}},Ar.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)},Ar.prototype.showMultipleSelections=function(e){Ge(this.cm.display.cursorDiv,e.cursors),Ge(this.cm.display.selectionDiv,e.selection)},Ar.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ar.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return O(this.div,t)},Ar.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ar.prototype.blur=function(){this.div.blur()},Ar.prototype.getField=function(){return this.div},Ar.prototype.supportsTouch=function(){return!0},Ar.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Yn(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)},Ar.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ar.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(St&&q&&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=ja(t,e.anchorNode,e.anchorOffset),r=ja(t,e.focusNode,e.focusOffset);n&&r&&Yn(t,function(){Mn(t.doc,Si(n,r),xe),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},Ar.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=m(r.line-1,G(e.doc,r.line-1).length)),i.ch==G(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=m(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=ut(e.doc,m(o,0),m(u,G(e.doc,u).text.length));c.length>1&&S.length>1;)if(Ie(c)==Ie(S))c.pop(),S.pop(),u--;else if(c[0]==S[0])c.shift(),S.shift(),o++;else break;for(var y=0,T=0,_=c[0],se=S[0],Ce=Math.min(_.length,se.length);y<Ce&&_.charCodeAt(y)==se.charCodeAt(y);)++y;for(var Ze=Ie(c),we=Ie(S),Be=Math.min(Ze.length-(c.length==1?y:0),we.length-(S.length==1?y:0));T<Be&&Ze.charCodeAt(Ze.length-T-1)==we.charCodeAt(we.length-T-1);)++T;if(c.length==1&&S.length==1&&o==r.line)for(;y&&y>r.ch&&Ze.charCodeAt(Ze.length-T-1)==we.charCodeAt(we.length-T-1);)y--,T++;c[c.length-1]=Ze.slice(0,Ze.length-T).replace(/^\u200b+/,""),c[0]=c[0].slice(y).replace(/\u200b+$/,"");var mt=m(o,y),nt=m(u,S.length?Ie(S).length-T:0);if(c.length>1||c[0]||x(mt,nt))return Gi(e.doc,c,mt,nt,"+input"),!0},Ar.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ar.prototype.reset=function(){this.forceCompositionEnd()},Ar.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ar.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))},Ar.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Yn(this.cm,function(){return kn(e.cm)})},Ar.prototype.setUneditable=function(e){e.contentEditable="false"},Ar.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||gn(this.cm,xo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},Ar.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Ar.prototype.onContextMenu=function(){},Ar.prototype.resetPosition=function(){},Ar.prototype.needsContentAttribute=!0;function Ul(e,t){var n=fi(e,t.line);if(!n||n.hidden)return null;var r=G(e.doc,t.line),i=ki(n,r,t.line),a=W(r,e.doc.direction),o="left";if(a){var l=ie(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(T){return T.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 T=y.getAttribute("cm-text");if(T){c(T);return}var _=y.getAttribute("cm-marker"),se;if(_){var Ce=e.findMarks(m(r,0),m(i+1,0),u(+_));Ce.length&&(se=Ce[0].find(0))&&c(ut(e.doc,se.from,se.to).join(l));return}if(y.getAttribute("contenteditable")=="false")return;var Ze=/^(pre|div|p|li|table|br)$/i.test(y.nodeName);if(!/^br$/i.test(y.nodeName)&&y.textContent.length==0)return;Ze&&f();for(var we=0;we<y.childNodes.length;we++)S(y.childNodes[we]);/^(pre|p)$/i.test(y.nodeName)&&(s=!0),Ze&&(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 ja(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return Yi(e.clipPos(m(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(m(d(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var a=e.rest?Ie(e.rest):e.line;return Yi(m(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,Ce,Ze){for(var we=-1;we<(u?u.length:0);we++)for(var Be=we<0?s.map:u[we],mt=0;mt<Be.length;mt+=3){var nt=Be[mt+2];if(nt==se||nt==Ce){var jt=d(we<0?e.line:e.rest[we]),zr=Be[mt]+Ze;return(Ze<0||nt!=se)&&(zr=Be[mt+(Ze?1:0)]),m(jt,zr)}}}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(m(c.line,c.ch-y),i);y+=S.textContent.length}for(var T=l.previousSibling,_=n;T;T=T.previousSibling){if(c=f(T,T.firstChild,-1),c)return Yi(m(c.line,c.ch+_),i);_+=T.textContent.length}}var nn=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Ne,this.hasSelection=!1,this.composing=null};nn.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),R&&(i.style.width="0px"),U(i,"input",function(){N&&ee>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),U(i,"paste",function(o){Me(r,o)||Fl(o,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())});function a(o){if(!Me(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,xe):(n.prevInput="",i.value=l.text.join(`
|
|
`),z(i))}else return;o.type=="cut"&&(r.state.cutIncoming=+new Date)}}U(i,"cut",a),U(i,"copy",a),U(e.scroller,"paste",function(o){if(!(Je(e,o)||Me(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)}}),U(e.lineSpace,"selectstart",function(o){Je(e,o)||qe(o)}),U(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"})}}),U(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},nn.prototype.createField=function(e){this.wrapper=Bl(),this.textarea=this.wrapper.firstChild},nn.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},nn.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Do(e);if(e.options.moveInputWithCursor){var i=An(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},nn.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")},nn.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),N&&ee>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",N&&ee>=9&&(this.hasSelection=null))}},nn.prototype.getField=function(){return this.textarea},nn.prototype.supportsTouch=function(){return!1},nn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!Ot||E()!=this.textarea))try{this.textarea.focus()}catch(e){}},nn.prototype.blur=function(){this.textarea.blur()},nn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},nn.prototype.receivedFocus=function(){this.slowPoll()},nn.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},nn.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)},nn.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||sr(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(N&&ee>=9&&this.hasSelection===i||ht&&/[\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 Yn(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},nn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},nn.prototype.onKeyPress=function(){N&&ee>=9&&(this.hasSelection=null),this.fastPoll()},nn.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&&gn(n,Mn)(n.doc,Si(a),xe);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: `+(N?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var c;re&&(c=window.scrollY),r.input.focus(),re&&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,N&&ee<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=o),i.selectionStart!=null)){(!N||N&&ee<9)&&S();var _=0,se=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?gn(n,ll)(n):_++<10?r.detectingSelectAll=setTimeout(se,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(se,200)}}if(N&&ee>=9&&S(),wt){$t(e);var T=function(){ve(window,"mouseup",T),setTimeout(y,20)};U(window,"mouseup",T)}else setTimeout(y,50)},nn.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},nn.prototype.setUneditable=function(){},nn.prototype.needsContentAttribute=!1;function tu(e,t){if(t=t?L(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&&(U(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&&(ve(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=ve,e.on=U,e.wheelEventPixels=us,e.Doc=Zn,e.splitLines=$e,e.countColumn=ue,e.findColumn=Zt,e.isWordChar=g,e.Pass=Ve,e.signal=Le,e.Line=an,e.changeEnd=Ci,e.scrollbarModel=Fo,e.Pos=m,e.cmpPos=x,e.modes=Pr,e.mimeModes=Br,e.resolveMode=Dr,e.getMode=vr,e.modeExtensions=Cr,e.extendMode=Zr,e.copyState=Jt,e.startState=Fr,e.innerMode=Kt,e.commands=ya,e.keyMap=hi,e.keyName=xl,e.isModifierKey=Cl,e.lookupKey=_i,e.normalizeKeyMap=Ps,e.StringStream=Dt,e.SharedTextMarker=ga,e.TextMarker=xi,e.LineWidget=ha,e.e_preventDefault=qe,e.e_stopPropagation=ir,e.e_stop=$t,e.addClass=A,e.contains=O,e.rmClass=te,e.keyNames=Ei}js(_r),Qs(_r);var nu="iter insert remove copy getEditor constructor".split(" ");for(var Xa in Zn.prototype)Zn.prototype.hasOwnProperty(Xa)&&fe(nu,Xa)<0&&(_r.prototype[Xa]=function(e){return function(){return e.apply(this.doc,arguments)}}(Zn.prototype[Xa]));return ye(Zn),_r.inputStyles={textarea:nn,contenteditable:Ar},_r.defineMode=function(e){!_r.defaults.mode&&e!="null"&&(_r.defaults.mode=e),Kr.apply(this,arguments)},_r.defineMIME=Gr,_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){Zn.prototype[e]=t},_r.fromTextArea=tu,ru(_r),_r.version="5.58.2",_r})},66003:function(bn,yt,b){"use strict";b.d(yt,{Z:function(){return re}});var H=b(75931),$=b(33885),K=b(76190),me=b(59301),N=["show"];function ee(Qe,q){if(!q.max)return!0;var h=q.strategy(Qe);return h<=q.max}function re(Qe,q){return me.useMemo(function(){var h={};q&&(h.show=(0,K.Z)(q)==="object"&&q.formatter?q.formatter:!!q),h=(0,$.Z)((0,$.Z)({},h),Qe);var Fe=h,M=Fe.show,De=(0,H.Z)(Fe,N);return(0,$.Z)((0,$.Z)({},De),{},{show:!!M,showFormatter:typeof M=="function"?M:void 0,strategy:De.strategy||function(R){return R.length}})},[Qe,q])}},36901:function(bn,yt,b){"use strict";b.r(yt),b.d(yt,{BaseInput:function(){return h},default:function(){return he}});var H=b(33885),$=b(54476),K=b(20068),me=b(76190),N=b(92310),ee=b.n(N),re=b(59301),Qe=b(30292),q=re.forwardRef(function(F,wt){var ze,te,xt,Ge=F.inputElement,J=F.children,dt=F.prefixCls,Pt=F.prefix,O=F.suffix,E=F.addonBefore,A=F.addonAfter,X=F.className,z=F.style,ke=F.disabled,L=F.readOnly,ue=F.focused,Ne=F.triggerFocus,fe=F.allowClear,je=F.value,Ve=F.handleReset,xe=F.hidden,Ke=F.classes,We=F.classNames,Zt=F.dataAttrs,Rt=F.styles,Et=F.components,Ie=F.onClear,or=J!=null?J:Ge,tr=(Et==null?void 0:Et.affixWrapper)||"span",P=(Et==null?void 0:Et.groupWrapper)||"span",p=(Et==null?void 0:Et.wrapper)||"span",C=(Et==null?void 0:Et.groupAddon)||"span",g=(0,re.useRef)(null),w=function(gt){var Xe;(Xe=g.current)!==null&&Xe!==void 0&&Xe.contains(gt.target)&&(Ne==null||Ne())},I=(0,Qe.X3)(F),k=(0,re.cloneElement)(or,{value:je,className:ee()((ze=or.props)===null||ze===void 0?void 0:ze.className,!I&&(We==null?void 0:We.variant))||null}),Z=(0,re.useRef)(null);if(re.useImperativeHandle(wt,function(){return{nativeElement:Z.current||g.current}}),I){var le=null;if(fe){var Q=!ke&&!L&&je,ae="".concat(dt,"-clear-icon"),ne=(0,me.Z)(fe)==="object"&&fe!==null&&fe!==void 0&&fe.clearIcon?fe.clearIcon:"\u2716";le=re.createElement("button",{type:"button",tabIndex:-1,onClick:function(gt){Ve==null||Ve(gt),Ie==null||Ie()},onMouseDown:function(gt){return gt.preventDefault()},className:ee()(ae,(0,K.Z)((0,K.Z)({},"".concat(ae,"-hidden"),!Q),"".concat(ae,"-has-suffix"),!!O))},ne)}var ie="".concat(dt,"-affix-wrapper"),de=ee()(ie,(0,K.Z)((0,K.Z)((0,K.Z)((0,K.Z)((0,K.Z)({},"".concat(dt,"-disabled"),ke),"".concat(ie,"-disabled"),ke),"".concat(ie,"-focused"),ue),"".concat(ie,"-readonly"),L),"".concat(ie,"-input-with-clear-btn"),O&&fe&&je),Ke==null?void 0:Ke.affixWrapper,We==null?void 0:We.affixWrapper,We==null?void 0:We.variant),W=(O||fe)&&re.createElement("span",{className:ee()("".concat(dt,"-suffix"),We==null?void 0:We.suffix),style:Rt==null?void 0:Rt.suffix},le,O);k=re.createElement(tr,(0,$.Z)({className:de,style:Rt==null?void 0:Rt.affixWrapper,onClick:w},Zt==null?void 0:Zt.affixWrapper,{ref:g}),Pt&&re.createElement("span",{className:ee()("".concat(dt,"-prefix"),We==null?void 0:We.prefix),style:Rt==null?void 0:Rt.prefix},Pt),k,W)}if((0,Qe.He)(F)){var oe="".concat(dt,"-group"),U="".concat(oe,"-addon"),Ue="".concat(oe,"-wrapper"),ve=ee()("".concat(dt,"-wrapper"),oe,Ke==null?void 0:Ke.wrapper,We==null?void 0:We.wrapper),Le=ee()(Ue,(0,K.Z)({},"".concat(Ue,"-disabled"),ke),Ke==null?void 0:Ke.group,We==null?void 0:We.groupWrapper);k=re.createElement(P,{className:Le,ref:Z},re.createElement(p,{className:ve},E&&re.createElement(C,{className:U},E),k,A&&re.createElement(C,{className:U},A)))}return re.cloneElement(k,{className:ee()((te=k.props)===null||te===void 0?void 0:te.className,X)||null,style:(0,H.Z)((0,H.Z)({},(xt=k.props)===null||xt===void 0?void 0:xt.style),z),hidden:xe})}),h=q,Fe=b(94480),M=b(42978),De=b(75931),R=b(18929),St=b(2738),Ot=b(66003),ht=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","onKeyUp","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],Nt=(0,re.forwardRef)(function(F,wt){var ze=F.autoComplete,te=F.onChange,xt=F.onFocus,Ge=F.onBlur,J=F.onPressEnter,dt=F.onKeyDown,Pt=F.onKeyUp,O=F.prefixCls,E=O===void 0?"rc-input":O,A=F.disabled,X=F.htmlSize,z=F.className,ke=F.maxLength,L=F.suffix,ue=F.showCount,Ne=F.count,fe=F.type,je=fe===void 0?"text":fe,Ve=F.classes,xe=F.classNames,Ke=F.styles,We=F.onCompositionStart,Zt=F.onCompositionEnd,Rt=(0,De.Z)(F,ht),Et=(0,re.useState)(!1),Ie=(0,M.Z)(Et,2),or=Ie[0],tr=Ie[1],P=(0,re.useRef)(!1),p=(0,re.useRef)(!1),C=(0,re.useRef)(null),g=(0,re.useRef)(null),w=function(it){C.current&&(0,Qe.nH)(C.current,it)},I=(0,R.Z)(F.defaultValue,{value:F.value}),k=(0,M.Z)(I,2),Z=k[0],le=k[1],Q=Z==null?"":String(Z),ae=(0,re.useState)(null),ne=(0,M.Z)(ae,2),ie=ne[0],de=ne[1],W=(0,Ot.Z)(Ne,ue),oe=W.max||ke,U=W.strategy(Q),Ue=!!oe&&U>oe;(0,re.useImperativeHandle)(wt,function(){var tt;return{focus:w,blur:function(){var Ft;(Ft=C.current)===null||Ft===void 0||Ft.blur()},setSelectionRange:function(Ft,Yt,Wt){var Tt;(Tt=C.current)===null||Tt===void 0||Tt.setSelectionRange(Ft,Yt,Wt)},select:function(){var Ft;(Ft=C.current)===null||Ft===void 0||Ft.select()},input:C.current,nativeElement:((tt=g.current)===null||tt===void 0?void 0:tt.nativeElement)||C.current}}),(0,re.useEffect)(function(){p.current&&(p.current=!1),tr(function(tt){return tt&&A?!1:tt})},[A]);var ve=function(it,Ft,Yt){var Wt=Ft;if(!P.current&&W.exceedFormatter&&W.max&&W.strategy(Ft)>W.max){if(Wt=W.exceedFormatter(Ft,{max:W.max}),Ft!==Wt){var Tt,$e;de([((Tt=C.current)===null||Tt===void 0?void 0:Tt.selectionStart)||0,(($e=C.current)===null||$e===void 0?void 0:$e.selectionEnd)||0])}}else if(Yt.source==="compositionEnd")return;le(Wt),C.current&&(0,Qe.rJ)(C.current,it,te,Wt)};(0,re.useEffect)(function(){if(ie){var tt;(tt=C.current)===null||tt===void 0||tt.setSelectionRange.apply(tt,(0,Fe.Z)(ie))}},[ie]);var Le=function(it){ve(it,it.target.value,{source:"change"})},Me=function(it){P.current=!1,ve(it,it.currentTarget.value,{source:"compositionEnd"}),Zt==null||Zt(it)},gt=function(it){J&&it.key==="Enter"&&!p.current&&(p.current=!0,J(it)),dt==null||dt(it)},Xe=function(it){it.key==="Enter"&&(p.current=!1),Pt==null||Pt(it)},ye=function(it){tr(!0),xt==null||xt(it)},qe=function(it){p.current&&(p.current=!1),tr(!1),Ge==null||Ge(it)},ir=function(it){le(""),w(),C.current&&(0,Qe.rJ)(C.current,it,te)},lr=Ue&&"".concat(E,"-out-of-range"),$t=function(){var it=(0,St.Z)(F,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames","onClear"]);return re.createElement("input",(0,$.Z)({autoComplete:ze},it,{onChange:Le,onFocus:ye,onBlur:qe,onKeyDown:gt,onKeyUp:Xe,className:ee()(E,(0,K.Z)({},"".concat(E,"-disabled"),A),xe==null?void 0:xe.input),style:Ke==null?void 0:Ke.input,ref:C,size:X,type:je,onCompositionStart:function(Yt){P.current=!0,We==null||We(Yt)},onCompositionEnd:Me}))},Tr=function(){var it=Number(oe)>0;if(L||W.show){var Ft=W.showFormatter?W.showFormatter({value:Q,count:U,maxLength:oe}):"".concat(U).concat(it?" / ".concat(oe):"");return re.createElement(re.Fragment,null,W.show&&re.createElement("span",{className:ee()("".concat(E,"-show-count-suffix"),(0,K.Z)({},"".concat(E,"-show-count-has-suffix"),!!L),xe==null?void 0:xe.count),style:(0,H.Z)({},Ke==null?void 0:Ke.count)},Ft),L)}return null};return re.createElement(h,(0,$.Z)({},Rt,{prefixCls:E,className:ee()(z,lr),handleReset:ir,value:Q,focused:or,triggerFocus:w,suffix:Tr(),disabled:A,classes:Ve,classNames:xe,styles:Ke}),$t())}),st=Nt,he=st},30292:function(bn,yt,b){"use strict";b.d(yt,{He:function(){return H},X3:function(){return $},nH:function(){return N},rJ:function(){return me}});function H(ee){return!!(ee.addonBefore||ee.addonAfter)}function $(ee){return!!(ee.prefix||ee.suffix||ee.allowClear)}function K(ee,re,Qe){var q=re.cloneNode(!0),h=Object.create(ee,{target:{value:q},currentTarget:{value:q}});return q.value=Qe,typeof re.selectionStart=="number"&&typeof re.selectionEnd=="number"&&(q.selectionStart=re.selectionStart,q.selectionEnd=re.selectionEnd),q.setSelectionRange=function(){re.setSelectionRange.apply(re,arguments)},h}function me(ee,re,Qe,q){if(Qe){var h=re;if(re.type==="click"){h=K(re,ee,""),Qe(h);return}if(ee.type!=="file"&&q!==void 0){h=K(re,ee,q),Qe(h);return}Qe(h)}}function N(ee,re){if(ee){ee.focus(re);var Qe=re||{},q=Qe.cursor;if(q){var h=ee.value.length;switch(q){case"start":ee.setSelectionRange(0,0);break;case"end":ee.setSelectionRange(h,h);break;default:ee.setSelectionRange(0,h)}}}}},83836:function(bn,yt,b){"use strict";b.d(yt,{Z:function(){return ke}});var H=b(54476),$=b(33885),K=b(42978),me=b(75931),N=b(59301),ee=b(92310),re=b.n(ee),Qe=b(29301),q=b(34280),h=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],Fe=void 0;function M(L,ue){var Ne=L.prefixCls,fe=L.invalidate,je=L.item,Ve=L.renderItem,xe=L.responsive,Ke=L.responsiveDisabled,We=L.registerSize,Zt=L.itemKey,Rt=L.className,Et=L.style,Ie=L.children,or=L.display,tr=L.order,P=L.component,p=P===void 0?"div":P,C=(0,me.Z)(L,h),g=xe&&!or;function w(Q){We(Zt,Q)}N.useEffect(function(){return function(){w(null)}},[]);var I=Ve&&je!==Fe?Ve(je,{index:tr}):Ie,k;fe||(k={opacity:g?0:1,height:g?0:Fe,overflowY:g?"hidden":Fe,order:xe?tr:Fe,pointerEvents:g?"none":Fe,position:g?"absolute":Fe});var Z={};g&&(Z["aria-hidden"]=!0);var le=N.createElement(p,(0,H.Z)({className:re()(!fe&&Ne,Rt),style:(0,$.Z)((0,$.Z)({},k),Et)},Z,C,{ref:ue}),I);return xe&&(le=N.createElement(Qe.Z,{onResize:function(ae){var ne=ae.offsetWidth;w(ne)},disabled:Ke},le)),le}var De=N.forwardRef(M);De.displayName="Item";var R=De,St=b(6089),Ot=b(4676),ht=b(16089);function Nt(L){if(typeof MessageChannel=="undefined")(0,ht.Z)(L);else{var ue=new MessageChannel;ue.port1.onmessage=function(){return L()},ue.port2.postMessage(void 0)}}function st(){var L=N.useRef(null),ue=function(fe){L.current||(L.current=[],Nt(function(){(0,Ot.unstable_batchedUpdates)(function(){L.current.forEach(function(je){je()}),L.current=null})})),L.current.push(fe)};return ue}function he(L,ue){var Ne=N.useState(ue),fe=(0,K.Z)(Ne,2),je=fe[0],Ve=fe[1],xe=(0,St.Z)(function(Ke){L(function(){Ve(Ke)})});return[je,xe]}var F=N.createContext(null),wt=["component"],ze=["className"],te=["className"],xt=function(ue,Ne){var fe=N.useContext(F);if(!fe){var je=ue.component,Ve=je===void 0?"div":je,xe=(0,me.Z)(ue,wt);return N.createElement(Ve,(0,H.Z)({},xe,{ref:Ne}))}var Ke=fe.className,We=(0,me.Z)(fe,ze),Zt=ue.className,Rt=(0,me.Z)(ue,te);return N.createElement(F.Provider,{value:null},N.createElement(R,(0,H.Z)({ref:Ne,className:re()(Ke,Zt)},We,Rt)))},Ge=N.forwardRef(xt);Ge.displayName="RawItem";var J=Ge,dt=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","prefix","suffix","component","itemComponent","onVisibleChange"],Pt="responsive",O="invalidate";function E(L){return"+ ".concat(L.length," ...")}function A(L,ue){var Ne=L.prefixCls,fe=Ne===void 0?"rc-overflow":Ne,je=L.data,Ve=je===void 0?[]:je,xe=L.renderItem,Ke=L.renderRawItem,We=L.itemKey,Zt=L.itemWidth,Rt=Zt===void 0?10:Zt,Et=L.ssr,Ie=L.style,or=L.className,tr=L.maxCount,P=L.renderRest,p=L.renderRawRest,C=L.prefix,g=L.suffix,w=L.component,I=w===void 0?"div":w,k=L.itemComponent,Z=L.onVisibleChange,le=(0,me.Z)(L,dt),Q=Et==="full",ae=st(),ne=he(ae,null),ie=(0,K.Z)(ne,2),de=ie[0],W=ie[1],oe=de||0,U=he(ae,new Map),Ue=(0,K.Z)(U,2),ve=Ue[0],Le=Ue[1],Me=he(ae,0),gt=(0,K.Z)(Me,2),Xe=gt[0],ye=gt[1],qe=he(ae,0),ir=(0,K.Z)(qe,2),lr=ir[0],$t=ir[1],Tr=he(ae,0),tt=(0,K.Z)(Tr,2),it=tt[0],Ft=tt[1],Yt=he(ae,0),Wt=(0,K.Z)(Yt,2),Tt=Wt[0],$e=Wt[1],sr=(0,N.useState)(null),ur=(0,K.Z)(sr,2),fr=ur[0],ot=ur[1],Pr=(0,N.useState)(null),Br=(0,K.Z)(Pr,2),Kr=Br[0],Gr=Br[1],Dr=N.useMemo(function(){return Kr===null&&Q?Number.MAX_SAFE_INTEGER:Kr||0},[Kr,de]),vr=(0,N.useState)(!1),Cr=(0,K.Z)(vr,2),Zr=Cr[0],Jt=Cr[1],Kt="".concat(fe,"-item"),Fr=Math.max(Xe,lr),Dt=tr===Pt,G=Ve.length&&Dt,ut=tr===O,Or=G||typeof tr=="number"&&Ve.length>tr,qt=(0,N.useMemo)(function(){var Ee=Ve;return G?de===null&&Q?Ee=Ve:Ee=Ve.slice(0,Math.min(Ve.length,oe/Rt)):typeof tr=="number"&&(Ee=Ve.slice(0,tr)),Ee},[Ve,Rt,de,tr,G]),d=(0,N.useMemo)(function(){return G?Ve.slice(Dr+1):Ve.slice(qt.length)},[Ve,qt,G,Dr]),v=(0,N.useCallback)(function(Ee,He){var et;return typeof We=="function"?We(Ee):(et=We&&(Ee==null?void 0:Ee[We]))!==null&&et!==void 0?et:He},[We]),B=(0,N.useCallback)(xe||function(Ee){return Ee},[xe]);function D(Ee,He,et){Kr===Ee&&(He===void 0||He===fr)||(Gr(Ee),et||(Jt(Ee<Ve.length-1),Z==null||Z(Ee)),He!==void 0&&ot(He))}function m(Ee,He){W(He.clientWidth)}function x(Ee,He){Le(function(et){var zt=new Map(et);return He===null?zt.delete(Ee):zt.set(Ee,He),zt})}function ge(Ee,He){$t(He),ye(lr)}function ce(Ee,He){Ft(He)}function Pe(Ee,He){$e(He)}function be(Ee){return ve.get(v(qt[Ee],Ee))}(0,q.Z)(function(){if(oe&&typeof Fr=="number"&&qt){var Ee=it+Tt,He=qt.length,et=He-1;if(!He){D(0,null);return}for(var zt=0;zt<He;zt+=1){var ft=be(zt);if(Q&&(ft=ft||0),ft===void 0){D(zt-1,void 0,!0);break}if(Ee+=ft,et===0&&Ee<=oe||zt===et-1&&Ee+be(et)<=oe){D(et,null);break}else if(Ee+Fr>oe){D(zt-1,Ee-ft-Tt+lr);break}}g&&be(0)+Tt>oe&&ot(null)}},[oe,ve,lr,it,Tt,v,qt]);var Ae=Zr&&!!d.length,Y={};fr!==null&&G&&(Y={position:"absolute",left:fr,top:0});var Ct={prefixCls:Kt,responsive:G,component:k,invalidate:ut},Se=Ke?function(Ee,He){var et=v(Ee,He);return N.createElement(F.Provider,{key:et,value:(0,$.Z)((0,$.Z)({},Ct),{},{order:He,item:Ee,itemKey:et,registerSize:x,display:He<=Dr})},Ke(Ee,He))}:function(Ee,He){var et=v(Ee,He);return N.createElement(R,(0,H.Z)({},Ct,{order:He,key:et,item:Ee,renderItem:B,itemKey:et,registerSize:x,display:He<=Dr}))},rt={order:Ae?Dr:Number.MAX_SAFE_INTEGER,className:"".concat(Kt,"-rest"),registerSize:ge,display:Ae},Re=P||E,_e=p?N.createElement(F.Provider,{value:(0,$.Z)((0,$.Z)({},Ct),rt)},p(d)):N.createElement(R,(0,H.Z)({},Ct,rt),typeof Re=="function"?Re(d):Re),Mt=N.createElement(I,(0,H.Z)({className:re()(!ut&&fe,or),style:Ie,ref:ue},le),C&&N.createElement(R,(0,H.Z)({},Ct,{responsive:Dt,responsiveDisabled:!G,order:-1,className:"".concat(Kt,"-prefix"),registerSize:ce,display:!0}),C),qt.map(Se),Or?_e:null,g&&N.createElement(R,(0,H.Z)({},Ct,{responsive:Dt,responsiveDisabled:!G,order:Dr,className:"".concat(Kt,"-suffix"),registerSize:Pe,display:!0,style:Y}),g));return Dt?N.createElement(Qe.Z,{onResize:m,disabled:!G},Mt):Mt}var X=N.forwardRef(A);X.displayName="Overflow",X.Item=J,X.RESPONSIVE=Pt,X.INVALIDATE=O;var z=X,ke=z},29301:function(bn,yt,b){"use strict";b.d(yt,{Z:function(){return O}});var H=b(54476),$=b(59301),K=b(11592),me=b(48736),N=b(33885),ee=b(76190),re=b(76846),Qe=b(8654),q=$.createContext(null);function h(E){var A=E.children,X=E.onBatchResize,z=$.useRef(0),ke=$.useRef([]),L=$.useContext(q),ue=$.useCallback(function(Ne,fe,je){z.current+=1;var Ve=z.current;ke.current.push({size:Ne,element:fe,data:je}),Promise.resolve().then(function(){Ve===z.current&&(X==null||X(ke.current),ke.current=[])}),L==null||L(Ne,fe,je)},[X,L]);return $.createElement(q.Provider,{value:ue},A)}var Fe=b(76374),M=new Map;function De(E){E.forEach(function(A){var X,z=A.target;(X=M.get(z))===null||X===void 0||X.forEach(function(ke){return ke(z)})})}var R=new Fe.Z(De),St=null,Ot=null;function ht(E,A){M.has(E)||(M.set(E,new Set),R.observe(E)),M.get(E).add(A)}function Nt(E,A){M.has(E)&&(M.get(E).delete(A),M.get(E).size||(R.unobserve(E),M.delete(E)))}var st=b(67732),he=b(83652),F=b(42403),wt=b(158),ze=function(E){(0,F.Z)(X,E);var A=(0,wt.Z)(X);function X(){return(0,st.Z)(this,X),A.apply(this,arguments)}return(0,he.Z)(X,[{key:"render",value:function(){return this.props.children}}]),X}($.Component);function te(E,A){var X=E.children,z=E.disabled,ke=$.useRef(null),L=$.useRef(null),ue=$.useContext(q),Ne=typeof X=="function",fe=Ne?X(ke):X,je=$.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Ve=!Ne&&$.isValidElement(fe)&&(0,Qe.Yr)(fe),xe=Ve?(0,Qe.C4)(fe):null,Ke=(0,Qe.x1)(xe,ke),We=function(){var Ie;return(0,re.ZP)(ke.current)||(ke.current&&(0,ee.Z)(ke.current)==="object"?(0,re.ZP)((Ie=ke.current)===null||Ie===void 0?void 0:Ie.nativeElement):null)||(0,re.ZP)(L.current)};$.useImperativeHandle(A,function(){return We()});var Zt=$.useRef(E);Zt.current=E;var Rt=$.useCallback(function(Et){var Ie=Zt.current,or=Ie.onResize,tr=Ie.data,P=Et.getBoundingClientRect(),p=P.width,C=P.height,g=Et.offsetWidth,w=Et.offsetHeight,I=Math.floor(p),k=Math.floor(C);if(je.current.width!==I||je.current.height!==k||je.current.offsetWidth!==g||je.current.offsetHeight!==w){var Z={width:I,height:k,offsetWidth:g,offsetHeight:w};je.current=Z;var le=g===Math.round(p)?p:g,Q=w===Math.round(C)?C:w,ae=(0,N.Z)((0,N.Z)({},Z),{},{offsetWidth:le,offsetHeight:Q});ue==null||ue(ae,Et,tr),or&&Promise.resolve().then(function(){or(ae,Et)})}},[]);return $.useEffect(function(){var Et=We();return Et&&!z&&ht(Et,Rt),function(){return Nt(Et,Rt)}},[ke.current,z]),$.createElement(ze,{ref:L},Ve?$.cloneElement(fe,{ref:Ke}):fe)}var xt=$.forwardRef(te),Ge=xt,J="rc-observer-key";function dt(E,A){var X=E.children,z=typeof X=="function"?[X]:(0,K.Z)(X);return z.map(function(ke,L){var ue=(ke==null?void 0:ke.key)||"".concat(J,"-").concat(L);return $.createElement(Ge,(0,H.Z)({},E,{key:ue,ref:L===0?A:void 0}),ke)})}var Pt=$.forwardRef(dt);Pt.Collection=h;var O=Pt},6551:function(bn,yt,b){"use strict";b.d(yt,{ZP:function(){return re}});var H=b(42978),$=b(59301),K=b(47273),me=0,N=(0,K.Z)();function ee(){var Qe;return N?(Qe=me,me+=1):Qe="TEST_OR_SSR",Qe}function re(Qe){var q=$.useState(),h=(0,H.Z)(q,2),Fe=h[0],M=h[1];return $.useEffect(function(){M("rc_select_".concat(ee()))},[]),Qe||Fe}},37463:function(bn,yt,b){"use strict";b.d(yt,{Ac:function(){return Me},Xo:function(){return Xe},Wx:function(){return qe},ZP:function(){return qt},lk:function(){return he}});var H=b(54476),$=b(94480),K=b(20068),me=b(33885),N=b(42978),ee=b(75931),re=b(76190),Qe=b(18929),q=b(48736),h=b(59301),Fe=b(92310),M=b.n(Fe),De=b(34280),R=b(49658),St=b(8654),Ot=function(v){var B=v.className,D=v.customizeIcon,m=v.customizeIconProps,x=v.children,ge=v.onMouseDown,ce=v.onClick,Pe=typeof D=="function"?D(m):D;return h.createElement("span",{className:B,onMouseDown:function(Ae){Ae.preventDefault(),ge==null||ge(Ae)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:ce,"aria-hidden":!0},Pe!==void 0?Pe:h.createElement("span",{className:M()(B.split(/\s+/).map(function(be){return"".concat(be,"-icon")}))},x))},ht=Ot,Nt=function(v,B,D,m,x){var ge=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,ce=arguments.length>6?arguments[6]:void 0,Pe=arguments.length>7?arguments[7]:void 0,be=h.useMemo(function(){if((0,re.Z)(m)==="object")return m.clearIcon;if(x)return x},[m,x]),Ae=h.useMemo(function(){return!!(!ge&&m&&(D.length||ce)&&!(Pe==="combobox"&&ce===""))},[m,ge,D.length,ce,Pe]);return{allowClear:Ae,clearIcon:h.createElement(ht,{className:"".concat(v,"-clear"),onMouseDown:B,customizeIcon:be},"\xD7")}},st=h.createContext(null);function he(){return h.useContext(st)}function F(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,v=h.useState(!1),B=(0,N.Z)(v,2),D=B[0],m=B[1],x=h.useRef(null),ge=function(){window.clearTimeout(x.current)};h.useEffect(function(){return ge},[]);var ce=function(be,Ae){ge(),x.current=window.setTimeout(function(){m(be),Ae&&Ae()},d)};return[D,ce,ge]}function wt(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,v=h.useRef(null),B=h.useRef(null);h.useEffect(function(){return function(){window.clearTimeout(B.current)}},[]);function D(m){(m||v.current===null)&&(v.current=m),window.clearTimeout(B.current),B.current=window.setTimeout(function(){v.current=null},d)}return[function(){return v.current},D]}function ze(d,v,B,D){var m=h.useRef(null);m.current={open:v,triggerOpen:B,customizedTrigger:D},h.useEffect(function(){function x(ge){var ce;if(!((ce=m.current)!==null&&ce!==void 0&&ce.customizedTrigger)){var Pe=ge.target;Pe.shadowRoot&&ge.composed&&(Pe=ge.composedPath()[0]||Pe),m.current.open&&d().filter(function(be){return be}).every(function(be){return!be.contains(Pe)&&be!==Pe})&&m.current.triggerOpen(!1)}}return window.addEventListener("mousedown",x),function(){return window.removeEventListener("mousedown",x)}},[])}var te=b(10228);function xt(d){return d&&![te.Z.ESC,te.Z.SHIFT,te.Z.BACKSPACE,te.Z.TAB,te.Z.WIN_KEY,te.Z.ALT,te.Z.META,te.Z.WIN_KEY_RIGHT,te.Z.CTRL,te.Z.SEMICOLON,te.Z.EQUALS,te.Z.CAPS_LOCK,te.Z.CONTEXT_MENU,te.Z.F1,te.Z.F2,te.Z.F3,te.Z.F4,te.Z.F5,te.Z.F6,te.Z.F7,te.Z.F8,te.Z.F9,te.Z.F10,te.Z.F11,te.Z.F12].includes(d)}var Ge=b(26112),J=b(83836);function dt(d,v,B){var D=(0,me.Z)((0,me.Z)({},d),B?v:{});return Object.keys(v).forEach(function(m){var x=v[m];typeof x=="function"&&(D[m]=function(){for(var ge,ce=arguments.length,Pe=new Array(ce),be=0;be<ce;be++)Pe[be]=arguments[be];return x.apply(void 0,Pe),(ge=d[m])===null||ge===void 0?void 0:ge.call.apply(ge,[d].concat(Pe))})}),D}var Pt=dt,O=["prefixCls","id","inputElement","autoFocus","autoComplete","editable","activeDescendantId","value","open","attrs"],E=function(v,B){var D=v.prefixCls,m=v.id,x=v.inputElement,ge=v.autoFocus,ce=v.autoComplete,Pe=v.editable,be=v.activeDescendantId,Ae=v.value,Y=v.open,Ct=v.attrs,Se=(0,ee.Z)(v,O),rt=x||h.createElement("input",null),Re=rt,_e=Re.ref,Mt=Re.props;return(0,q.Kp)(!("maxLength"in rt.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),rt=h.cloneElement(rt,(0,me.Z)((0,me.Z)((0,me.Z)({type:"search"},Pt(Se,Mt,!0)),{},{id:m,ref:(0,St.sQ)(B,_e),autoComplete:ce||"off",autoFocus:ge,className:M()("".concat(D,"-selection-search-input"),Mt==null?void 0:Mt.className),role:"combobox","aria-expanded":Y||!1,"aria-haspopup":"listbox","aria-owns":"".concat(m,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(m,"_list"),"aria-activedescendant":Y?be:void 0},Ct),{},{value:Pe?Ae:"",readOnly:!Pe,unselectable:Pe?null:"on",style:(0,me.Z)((0,me.Z)({},Mt.style),{},{opacity:Pe?null:0})})),rt},A=h.forwardRef(E),X=A;function z(d){return Array.isArray(d)?d:d!==void 0?[d]:[]}var ke=typeof window!="undefined"&&window.document&&window.document.documentElement,L=ke;function ue(d){return d!=null}function Ne(d){return!d&&d!==0}function fe(d){return["string","number"].includes((0,re.Z)(d))}function je(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){L?h.useLayoutEffect(d,v):h.useEffect(d,v)}function xe(d){var v;return(v=d.key)!==null&&v!==void 0?v:d.value}var Ke=function(v){v.preventDefault(),v.stopPropagation()},We=function(v){var B=v.id,D=v.prefixCls,m=v.values,x=v.open,ge=v.searchValue,ce=v.autoClearSearchValue,Pe=v.inputRef,be=v.placeholder,Ae=v.disabled,Y=v.mode,Ct=v.showSearch,Se=v.autoFocus,rt=v.autoComplete,Re=v.activeDescendantId,_e=v.tabIndex,Mt=v.removeIcon,Ee=v.maxTagCount,He=v.maxTagTextLength,et=v.maxTagPlaceholder,zt=et===void 0?function(Oe){return"+ ".concat(Oe.length," ...")}:et,ft=v.tagRender,hr=v.onToggleOpen,Wr=v.onRemove,Ut=v.onInputChange,Bt=v.onInputPaste,Gt=v.onInputKeyDown,gr=v.onInputMouseDown,It=v.onInputCompositionStart,Lt=v.onInputCompositionEnd,bt=v.onInputBlur,_t=h.useRef(null),cr=(0,h.useState)(0),rr=(0,N.Z)(cr,2),pr=rr[0],Xt=rr[1],At=(0,h.useState)(!1),yr=(0,N.Z)(At,2),jr=yr[0],Xr=yr[1],dr="".concat(D,"-selection"),en=x||Y==="multiple"&&ce===!1||Y==="tags"?ge:"",wr=Y==="tags"||Y==="multiple"&&ce===!1||Ct&&(x||jr);Ve(function(){Xt(_t.current.scrollWidth)},[en]);var Vr=function(pe,at,Vt,Qt,er){return h.createElement("span",{title:je(pe),className:M()("".concat(dr,"-item"),(0,K.Z)({},"".concat(dr,"-item-disabled"),Vt))},h.createElement("span",{className:"".concat(dr,"-item-content")},at),Qt&&h.createElement(ht,{className:"".concat(dr,"-item-remove"),onMouseDown:Ke,onClick:er,customizeIcon:Mt},"\xD7"))},Ur=function(pe,at,Vt,Qt,er,xr){var Yr=function(tn){Ke(tn),hr(!x)};return h.createElement("span",{onMouseDown:Yr},ft({label:at,value:pe,disabled:Vt,closable:Qt,onClose:er,isMaxTag:!!xr}))},br=function(pe){var at=pe.disabled,Vt=pe.label,Qt=pe.value,er=!Ae&&!at,xr=Vt;if(typeof He=="number"&&(typeof Vt=="string"||typeof Vt=="number")){var Yr=String(xr);Yr.length>He&&(xr="".concat(Yr.slice(0,He),"..."))}var Er=function(Nr){Nr&&Nr.stopPropagation(),Wr(pe)};return typeof ft=="function"?Ur(Qt,xr,at,er,Er):Vr(pe,xr,at,er,Er)},ct=function(pe){if(!m.length)return null;var at=typeof zt=="function"?zt(pe):zt;return typeof ft=="function"?Ur(void 0,at,!1,!1,void 0,!0):Vr({title:at},at,!1)},V=h.createElement("div",{className:"".concat(dr,"-search"),style:{width:pr},onFocus:function(){Xr(!0)},onBlur:function(){Xr(!1)}},h.createElement(X,{ref:Pe,open:x,prefixCls:D,id:B,inputElement:null,disabled:Ae,autoFocus:Se,autoComplete:rt,editable:wr,activeDescendantId:Re,value:en,onKeyDown:Gt,onMouseDown:gr,onChange:Ut,onPaste:Bt,onCompositionStart:It,onCompositionEnd:Lt,onBlur:bt,tabIndex:_e,attrs:(0,Ge.Z)(v,!0)}),h.createElement("span",{ref:_t,className:"".concat(dr,"-search-mirror"),"aria-hidden":!0},en,"\xA0")),j=h.createElement(J.Z,{prefixCls:"".concat(dr,"-overflow"),data:m,renderItem:br,renderRest:ct,suffix:V,itemKey:xe,maxCount:Ee});return h.createElement("span",{className:"".concat(dr,"-wrap")},j,!m.length&&!en&&h.createElement("span",{className:"".concat(dr,"-placeholder")},be))},Zt=We,Rt=function(v){var B=v.inputElement,D=v.prefixCls,m=v.id,x=v.inputRef,ge=v.disabled,ce=v.autoFocus,Pe=v.autoComplete,be=v.activeDescendantId,Ae=v.mode,Y=v.open,Ct=v.values,Se=v.placeholder,rt=v.tabIndex,Re=v.showSearch,_e=v.searchValue,Mt=v.activeValue,Ee=v.maxLength,He=v.onInputKeyDown,et=v.onInputMouseDown,zt=v.onInputChange,ft=v.onInputPaste,hr=v.onInputCompositionStart,Wr=v.onInputCompositionEnd,Ut=v.onInputBlur,Bt=v.title,Gt=h.useState(!1),gr=(0,N.Z)(Gt,2),It=gr[0],Lt=gr[1],bt=Ae==="combobox",_t=bt||Re,cr=Ct[0],rr=_e||"";bt&&Mt&&!It&&(rr=Mt),h.useEffect(function(){bt&&Lt(!1)},[bt,Mt]);var pr=Ae!=="combobox"&&!Y&&!Re?!1:!!rr,Xt=Bt===void 0?je(cr):Bt,At=h.useMemo(function(){return cr?null:h.createElement("span",{className:"".concat(D,"-selection-placeholder"),style:pr?{visibility:"hidden"}:void 0},Se)},[cr,pr,Se,D]);return h.createElement("span",{className:"".concat(D,"-selection-wrap")},h.createElement("span",{className:"".concat(D,"-selection-search")},h.createElement(X,{ref:x,prefixCls:D,id:m,open:Y,inputElement:B,disabled:ge,autoFocus:ce,autoComplete:Pe,editable:_t,activeDescendantId:be,value:rr,onKeyDown:He,onMouseDown:et,onChange:function(jr){Lt(!0),zt(jr)},onPaste:ft,onCompositionStart:hr,onCompositionEnd:Wr,onBlur:Ut,tabIndex:rt,attrs:(0,Ge.Z)(v,!0),maxLength:bt?Ee:void 0})),!bt&&cr?h.createElement("span",{className:"".concat(D,"-selection-item"),title:Xt,style:pr?{visibility:"hidden"}:void 0},cr.label):null,At)},Et=Rt,Ie=function(v,B){var D=(0,h.useRef)(null),m=(0,h.useRef)(!1),x=v.prefixCls,ge=v.open,ce=v.mode,Pe=v.showSearch,be=v.tokenWithEnter,Ae=v.disabled,Y=v.prefix,Ct=v.autoClearSearchValue,Se=v.onSearch,rt=v.onSearchSubmit,Re=v.onToggleOpen,_e=v.onInputKeyDown,Mt=v.onInputBlur,Ee=v.domRef;h.useImperativeHandle(B,function(){return{focus:function(Xt){D.current.focus(Xt)},blur:function(){D.current.blur()}}});var He=wt(0),et=(0,N.Z)(He,2),zt=et[0],ft=et[1],hr=function(Xt){var At=Xt.which,yr=D.current instanceof HTMLTextAreaElement;!yr&&ge&&(At===te.Z.UP||At===te.Z.DOWN)&&Xt.preventDefault(),_e&&_e(Xt),At===te.Z.ENTER&&ce==="tags"&&!m.current&&!ge&&(rt==null||rt(Xt.target.value)),!(yr&&!ge&&~[te.Z.UP,te.Z.DOWN,te.Z.LEFT,te.Z.RIGHT].indexOf(At))&&xt(At)&&Re(!0)},Wr=function(){ft(!0)},Ut=(0,h.useRef)(null),Bt=function(Xt){Se(Xt,!0,m.current)!==!1&&Re(!0)},Gt=function(){m.current=!0},gr=function(Xt){m.current=!1,ce!=="combobox"&&Bt(Xt.target.value)},It=function(Xt){var At=Xt.target.value;if(be&&Ut.current&&/[\r\n]/.test(Ut.current)){var yr=Ut.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");At=At.replace(yr,Ut.current)}Ut.current=null,Bt(At)},Lt=function(Xt){var At=Xt.clipboardData,yr=At==null?void 0:At.getData("text");Ut.current=yr||""},bt=function(Xt){var At=Xt.target;if(At!==D.current){var yr=document.body.style.msTouchAction!==void 0;yr?setTimeout(function(){D.current.focus()}):D.current.focus()}},_t=function(Xt){var At=zt();Xt.target!==D.current&&!At&&!(ce==="combobox"&&Ae)&&Xt.preventDefault(),(ce!=="combobox"&&(!Pe||!At)||!ge)&&(ge&&Ct!==!1&&Se("",!0,!1),Re())},cr={inputRef:D,onInputKeyDown:hr,onInputMouseDown:Wr,onInputChange:It,onInputPaste:Lt,onInputCompositionStart:Gt,onInputCompositionEnd:gr,onInputBlur:Mt},rr=ce==="multiple"||ce==="tags"?h.createElement(Zt,(0,H.Z)({},v,cr)):h.createElement(Et,(0,H.Z)({},v,cr));return h.createElement("div",{ref:Ee,className:"".concat(x,"-selector"),onClick:bt,onMouseDown:_t},Y&&h.createElement("div",{className:"".concat(x,"-prefix")},Y),rr)},or=h.forwardRef(Ie),tr=or,P=b(65030),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 B=v===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:B,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:B,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:B,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:B,adjustY:1},htmlRegion:"scroll"}}},g=function(v,B){var D=v.prefixCls,m=v.disabled,x=v.visible,ge=v.children,ce=v.popupElement,Pe=v.animation,be=v.transitionName,Ae=v.dropdownStyle,Y=v.dropdownClassName,Ct=v.direction,Se=Ct===void 0?"ltr":Ct,rt=v.placement,Re=v.builtinPlacements,_e=v.dropdownMatchSelectWidth,Mt=v.dropdownRender,Ee=v.dropdownAlign,He=v.getPopupContainer,et=v.empty,zt=v.getTriggerDOMNode,ft=v.onPopupVisibleChange,hr=v.onPopupMouseEnter,Wr=(0,ee.Z)(v,p),Ut="".concat(D,"-dropdown"),Bt=ce;Mt&&(Bt=Mt(ce));var Gt=h.useMemo(function(){return Re||C(_e)},[Re,_e]),gr=Pe?"".concat(Ut,"-").concat(Pe):be,It=typeof _e=="number",Lt=h.useMemo(function(){return It?null:_e===!1?"minWidth":"width"},[_e,It]),bt=Ae;It&&(bt=(0,me.Z)((0,me.Z)({},bt),{},{width:_e}));var _t=h.useRef(null);return h.useImperativeHandle(B,function(){return{getPopupElement:function(){var rr;return(rr=_t.current)===null||rr===void 0?void 0:rr.popupElement}}}),h.createElement(P.Z,(0,H.Z)({},Wr,{showAction:ft?["click"]:[],hideAction:ft?["click"]:[],popupPlacement:rt||(Se==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:Gt,prefixCls:Ut,popupTransitionName:gr,popup:h.createElement("div",{onMouseEnter:hr},Bt),ref:_t,stretch:Lt,popupAlign:Ee,popupVisible:x,getPopupContainer:He,popupClassName:M()(Y,(0,K.Z)({},"".concat(Ut,"-empty"),et)),popupStyle:bt,getTriggerDOMNode:zt,onPopupVisibleChange:ft}),ge)},w=h.forwardRef(g),I=w,k=b(66712);function Z(d,v){var B=d.key,D;return"value"in d&&(D=d.value),B!=null?B:D!==void 0?D:"rc-index-key-".concat(v)}function le(d){return typeof d!="undefined"&&!Number.isNaN(d)}function Q(d,v){var B=d||{},D=B.label,m=B.value,x=B.options,ge=B.groupLabel,ce=D||(v?"children":"label");return{label:ce,value:m||"value",options:x||"options",groupLabel:ge||ce}}function ae(d){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},B=v.fieldNames,D=v.childrenAsData,m=[],x=Q(B,!1),ge=x.label,ce=x.value,Pe=x.options,be=x.groupLabel;function Ae(Y,Ct){Array.isArray(Y)&&Y.forEach(function(Se){if(Ct||!(Pe in Se)){var rt=Se[ce];m.push({key:Z(Se,m.length),groupOption:Ct,data:Se,label:Se[ge],value:rt})}else{var Re=Se[be];Re===void 0&&D&&(Re=Se.label),m.push({key:Z(Se,m.length),group:!0,data:Se,label:Re}),Ae(Se[Pe],!0)}})}return Ae(d,!1),m}function ne(d){var v=(0,me.Z)({},d);return"props"in v||Object.defineProperty(v,"props",{get:function(){return(0,q.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),v}}),v}var ie=function(v,B,D){if(!B||!B.length)return null;var m=!1,x=function ce(Pe,be){var Ae=(0,k.Z)(be),Y=Ae[0],Ct=Ae.slice(1);if(!Y)return[Pe];var Se=Pe.split(Y);return m=m||Se.length>1,Se.reduce(function(rt,Re){return[].concat((0,$.Z)(rt),(0,$.Z)(ce(Re,Ct)))},[]).filter(Boolean)},ge=x(v,B);return m?typeof D!="undefined"?ge.slice(0,D):ge:null},de=h.createContext(null),W=de;function oe(d){var v=d.visible,B=d.values;if(!v)return null;var D=50;return h.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(B.slice(0,D).map(function(m){var x=m.label,ge=m.value;return["number","string"].includes((0,re.Z)(x))?x:ge}).join(", ")),B.length>D?", ...":null)}var U=["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"],ve=function(v){return v==="tags"||v==="multiple"},Le=h.forwardRef(function(d,v){var B,D=d.id,m=d.prefixCls,x=d.className,ge=d.showSearch,ce=d.tagRender,Pe=d.direction,be=d.omitDomProps,Ae=d.displayValues,Y=d.onDisplayValuesChange,Ct=d.emptyOptions,Se=d.notFoundContent,rt=Se===void 0?"Not Found":Se,Re=d.onClear,_e=d.mode,Mt=d.disabled,Ee=d.loading,He=d.getInputElement,et=d.getRawInputElement,zt=d.open,ft=d.defaultOpen,hr=d.onDropdownVisibleChange,Wr=d.activeValue,Ut=d.onActiveValueChange,Bt=d.activeDescendantId,Gt=d.searchValue,gr=d.autoClearSearchValue,It=d.onSearch,Lt=d.onSearchSplit,bt=d.tokenSeparators,_t=d.allowClear,cr=d.prefix,rr=d.suffixIcon,pr=d.clearIcon,Xt=d.OptionList,At=d.animation,yr=d.transitionName,jr=d.dropdownStyle,Xr=d.dropdownClassName,dr=d.dropdownMatchSelectWidth,en=d.dropdownRender,wr=d.dropdownAlign,Vr=d.placement,Ur=d.builtinPlacements,br=d.getPopupContainer,ct=d.showAction,V=ct===void 0?[]:ct,j=d.onFocus,Oe=d.onBlur,pe=d.onKeyUp,at=d.onKeyDown,Vt=d.onMouseDown,Qt=(0,ee.Z)(d,U),er=ve(_e),xr=(ge!==void 0?ge:er)||_e==="combobox",Yr=(0,me.Z)({},Qt);Ue.forEach(function(ar){delete Yr[ar]}),be==null||be.forEach(function(ar){delete Yr[ar]});var Er=h.useState(!1),tn=(0,N.Z)(Er,2),Nr=tn[0],an=tn[1];h.useEffect(function(){an((0,R.Z)())},[]);var Nn=h.useRef(null),un=h.useRef(null),kr=h.useRef(null),Jr=h.useRef(null),Ir=h.useRef(null),on=h.useRef(!1),Pn=F(),Hn=(0,N.Z)(Pn,3),Sn=Hn[0],vn=Hn[1],Qn=Hn[2];h.useImperativeHandle(v,function(){var ar,Ht;return{focus:(ar=Jr.current)===null||ar===void 0?void 0:ar.focus,blur:(Ht=Jr.current)===null||Ht===void 0?void 0:Ht.blur,scrollTo:function(En){var rn;return(rn=Ir.current)===null||rn===void 0?void 0:rn.scrollTo(En)},nativeElement:Nn.current||un.current}});var xn=h.useMemo(function(){var ar;if(_e!=="combobox")return Gt;var Ht=(ar=Ae[0])===null||ar===void 0?void 0:ar.value;return typeof Ht=="string"||typeof Ht=="number"?String(Ht):""},[Gt,_e,Ae]),ni=_e==="combobox"&&typeof He=="function"&&He()||null,$r=typeof et=="function"&&et(),Bn=(0,St.x1)(un,$r==null||(B=$r.props)===null||B===void 0?void 0:B.ref),ui=h.useState(!1),ii=(0,N.Z)(ui,2),di=ii[0],Kn=ii[1];(0,De.Z)(function(){Kn(!0)},[]);var Hr=(0,Qe.Z)(!1,{defaultValue:ft,value:zt}),fn=(0,N.Z)(Hr,2),Un=fn[0],On=fn[1],mr=di?Un:!1,Gn=!rt&&Ct;(Mt||Gn&&mr&&_e==="combobox")&&(mr=!1);var Vn=Gn?!1:mr,Ye=h.useCallback(function(ar){var Ht=ar!==void 0?ar:!mr;Mt||(On(Ht),mr!==Ht&&(hr==null||hr(Ht)))},[Mt,mr,On,hr]),vt=h.useMemo(function(){return(bt||[]).some(function(ar){return[`
|
|
`,`\r
|
|
`].includes(ar)})},[bt]),lt=h.useContext(W)||{},pt=lt.maxCount,nr=lt.rawValues,Mr=function(Ht,Cn,En){if(!(er&&le(pt)&&(nr==null?void 0:nr.size)>=pt)){var rn=!0,cn=Ht;Ut==null||Ut(null);var ai=ie(Ht,bt,le(pt)?pt-nr.size:void 0),ri=En?null:ai;return _e!=="combobox"&&ri&&(cn="",Lt==null||Lt(ri),Ye(!1),rn=!1),It&&xn!==cn&&It(cn,{source:Cn?"typing":"effect"}),rn}},In=function(Ht){!Ht||!Ht.trim()||It(Ht,{source:"submit"})};h.useEffect(function(){!mr&&!er&&_e!=="combobox"&&Mr("",!1,!1)},[mr]),h.useEffect(function(){Un&&Mt&&On(!1),Mt&&!on.current&&vn(!1)},[Mt]);var Te=wt(),Je=(0,N.Z)(Te,2),kt=Je[0],Lr=Je[1],Sr=h.useRef(!1),hn=function(Ht){var Cn=kt(),En=Ht.key,rn=En==="Enter";if(rn&&(_e!=="combobox"&&Ht.preventDefault(),mr||Ye(!0)),Lr(!!xn),En==="Backspace"&&!Cn&&er&&!xn&&Ae.length){for(var cn=(0,$.Z)(Ae),ai=null,ri=cn.length-1;ri>=0;ri-=1){var vi=cn[ri];if(!vi.disabled){cn.splice(ri,1),ai=vi;break}}ai&&Y(cn,{type:"remove",values:[ai]})}for(var jn=arguments.length,Xn=new Array(jn>1?jn-1:0),oi=1;oi<jn;oi++)Xn[oi-1]=arguments[oi];if(mr&&(!rn||!Sr.current)){var mi;rn&&(Sr.current=!0),(mi=Ir.current)===null||mi===void 0||mi.onKeyDown.apply(mi,[Ht].concat(Xn))}at==null||at.apply(void 0,[Ht].concat(Xn))},_n=function(Ht){for(var Cn=arguments.length,En=new Array(Cn>1?Cn-1:0),rn=1;rn<Cn;rn++)En[rn-1]=arguments[rn];if(mr){var cn;(cn=Ir.current)===null||cn===void 0||cn.onKeyUp.apply(cn,[Ht].concat(En))}Ht.key==="Enter"&&(Sr.current=!1),pe==null||pe.apply(void 0,[Ht].concat(En))},ei=function(Ht){var Cn=Ae.filter(function(En){return En!==Ht});Y(Cn,{type:"remove",values:[Ht]})},Rn=function(){Sr.current=!1},ki=h.useRef(!1),Ya=function(){vn(!0),Mt||(j&&!ki.current&&j.apply(void 0,arguments),V.includes("focus")&&Ye(!0)),ki.current=!0},xa=function(){on.current=!0,vn(!1,function(){ki.current=!1,on.current=!1,Ye(!1)}),!Mt&&(xn&&(_e==="tags"?It(xn,{source:"submit"}):_e==="multiple"&&It("",{source:"blur"})),Oe&&Oe.apply(void 0,arguments))},fi=[];h.useEffect(function(){return function(){fi.forEach(function(ar){return clearTimeout(ar)}),fi.splice(0,fi.length)}},[]);var pi=function(Ht){var Cn,En=Ht.target,rn=(Cn=kr.current)===null||Cn===void 0?void 0:Cn.getPopupElement();if(rn&&rn.contains(En)){var cn=setTimeout(function(){var jn=fi.indexOf(cn);if(jn!==-1&&fi.splice(jn,1),Qn(),!Nr&&!rn.contains(document.activeElement)){var Xn;(Xn=Jr.current)===null||Xn===void 0||Xn.focus()}});fi.push(cn)}for(var ai=arguments.length,ri=new Array(ai>1?ai-1:0),vi=1;vi<ai;vi++)ri[vi-1]=arguments[vi];Vt==null||Vt.apply(void 0,[Ht].concat(ri))},ti=h.useState({}),Ea=(0,N.Z)(ti,2),Ma=Ea[1];function Ja(){Ma({})}var La;$r&&(La=function(Ht){Ye(Ht)}),ze(function(){var ar;return[Nn.current,(ar=kr.current)===null||ar===void 0?void 0:ar.getPopupElement()]},Vn,Ye,!!$r);var Qa=h.useMemo(function(){return(0,me.Z)((0,me.Z)({},d),{},{notFoundContent:rt,open:mr,triggerOpen:Vn,id:D,showSearch:xr,multiple:er,toggleOpen:Ye})},[d,rt,Vn,mr,D,xr,er,Ye]),$i=!!rr||Ee,qi;$i&&(qi=h.createElement(ht,{className:M()("".concat(m,"-arrow"),(0,K.Z)({},"".concat(m,"-arrow-loading"),Ee)),customizeIcon:rr,customizeIconProps:{loading:Ee,searchValue:xn,open:mr,focused:Sn,showSearch:xr}}));var Li=function(){var Ht;Re==null||Re(),(Ht=Jr.current)===null||Ht===void 0||Ht.focus(),Y([],{type:"clear",values:Ae}),Mr("",!1,!1)},ea=Nt(m,Li,Ae,_t,pr,Mt,xn,_e),Ra=ea.allowClear,ta=ea.clearIcon,Zi=h.createElement(Xt,{ref:Ir}),Ta=M()(m,x,(0,K.Z)((0,K.Z)((0,K.Z)((0,K.Z)((0,K.Z)((0,K.Z)((0,K.Z)((0,K.Z)((0,K.Z)((0,K.Z)({},"".concat(m,"-focused"),Sn),"".concat(m,"-multiple"),er),"".concat(m,"-single"),!er),"".concat(m,"-allow-clear"),_t),"".concat(m,"-show-arrow"),$i),"".concat(m,"-disabled"),Mt),"".concat(m,"-loading"),Ee),"".concat(m,"-open"),mr),"".concat(m,"-customize-input"),ni),"".concat(m,"-show-search"),xr)),Fi=h.createElement(I,{ref:kr,disabled:Mt,prefixCls:m,visible:Vn,popupElement:Zi,animation:At,transitionName:yr,dropdownStyle:jr,dropdownClassName:Xr,direction:Pe,dropdownMatchSelectWidth:dr,dropdownRender:en,dropdownAlign:wr,placement:Vr,builtinPlacements:Ur,getPopupContainer:br,empty:Ct,getTriggerDOMNode:function(Ht){return un.current||Ht},onPopupVisibleChange:La,onPopupMouseEnter:Ja},$r?h.cloneElement($r,{ref:Bn}):h.createElement(tr,(0,H.Z)({},d,{domRef:un,prefixCls:m,inputElement:ni,ref:Jr,id:D,prefix:cr,showSearch:xr,autoClearSearchValue:gr,mode:_e,activeDescendantId:Bt,tagRender:ce,values:Ae,open:mr,onToggleOpen:Ye,activeValue:Wr,searchValue:xn,onSearch:Mr,onSearchSubmit:In,onRemove:ei,tokenWithEnter:vt,onInputBlur:Rn}))),An;return $r?An=Fi:An=h.createElement("div",(0,H.Z)({className:Ta},Yr,{ref:Nn,onMouseDown:pi,onKeyDown:hn,onKeyUp:_n,onFocus:Ya,onBlur:xa}),h.createElement(oe,{visible:Sn&&!mr,values:Ae}),Fi,qi,Ra&&ta),h.createElement(st.Provider,{value:Qa},An)}),Me=Le,gt=function(){return null};gt.isSelectOptGroup=!0;var Xe=gt,ye=function(){return null};ye.isSelectOption=!0;var qe=ye,ir=b(80547),lr=b(2738),$t=b(48911);function Tr(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var tt=["disabled","title","children","style","className"];function it(d){return typeof d=="string"||typeof d=="number"}var Ft=function(v,B){var D=he(),m=D.prefixCls,x=D.id,ge=D.open,ce=D.multiple,Pe=D.mode,be=D.searchValue,Ae=D.toggleOpen,Y=D.notFoundContent,Ct=D.onPopupScroll,Se=h.useContext(W),rt=Se.maxCount,Re=Se.flattenOptions,_e=Se.onActiveValue,Mt=Se.defaultActiveFirstOption,Ee=Se.onSelect,He=Se.menuItemSelectedIcon,et=Se.rawValues,zt=Se.fieldNames,ft=Se.virtual,hr=Se.direction,Wr=Se.listHeight,Ut=Se.listItemHeight,Bt=Se.optionRender,Gt="".concat(m,"-item"),gr=(0,ir.Z)(function(){return Re},[ge,Re],function(ct,V){return V[0]&&ct[1]!==V[1]}),It=h.useRef(null),Lt=h.useMemo(function(){return ce&&le(rt)&&(et==null?void 0:et.size)>=rt},[ce,rt,et==null?void 0:et.size]),bt=function(V){V.preventDefault()},_t=function(V){var j;(j=It.current)===null||j===void 0||j.scrollTo(typeof V=="number"?{index:V}:V)},cr=h.useCallback(function(ct){return Pe==="combobox"?!1:et.has(ct)},[Pe,(0,$.Z)(et).toString(),et.size]),rr=function(V){for(var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Oe=gr.length,pe=0;pe<Oe;pe+=1){var at=(V+pe*j+Oe)%Oe,Vt=gr[at]||{},Qt=Vt.group,er=Vt.data;if(!Qt&&!(er!=null&&er.disabled)&&(cr(er.value)||!Lt))return at}return-1},pr=h.useState(function(){return rr(0)}),Xt=(0,N.Z)(pr,2),At=Xt[0],yr=Xt[1],jr=function(V){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;yr(V);var Oe={source:j?"keyboard":"mouse"},pe=gr[V];if(!pe){_e(null,-1,Oe);return}_e(pe.value,V,Oe)};(0,h.useEffect)(function(){jr(Mt!==!1?rr(0):-1)},[gr.length,be]);var Xr=h.useCallback(function(ct){return Pe==="combobox"?String(ct).toLowerCase()===be.toLowerCase():et.has(ct)},[Pe,be,(0,$.Z)(et).toString(),et.size]);(0,h.useEffect)(function(){var ct=setTimeout(function(){if(!ce&&ge&&et.size===1){var j=Array.from(et)[0],Oe=gr.findIndex(function(pe){var at=pe.data;return be?String(at.value).startsWith(be):at.value===j});Oe!==-1&&(jr(Oe),_t(Oe))}});if(ge){var V;(V=It.current)===null||V===void 0||V.scrollTo(void 0)}return function(){return clearTimeout(ct)}},[ge,be]);var dr=function(V){V!==void 0&&Ee(V,{selected:!et.has(V)}),ce||Ae(!1)};if(h.useImperativeHandle(B,function(){return{onKeyDown:function(V){var j=V.which,Oe=V.ctrlKey;switch(j){case te.Z.N:case te.Z.P:case te.Z.UP:case te.Z.DOWN:{var pe=0;if(j===te.Z.UP?pe=-1:j===te.Z.DOWN?pe=1:Tr()&&Oe&&(j===te.Z.N?pe=1:j===te.Z.P&&(pe=-1)),pe!==0){var at=rr(At+pe,pe);_t(at),jr(at,!0)}break}case te.Z.TAB:case te.Z.ENTER:{var Vt,Qt=gr[At];Qt&&!(Qt!=null&&(Vt=Qt.data)!==null&&Vt!==void 0&&Vt.disabled)&&!Lt?dr(Qt.value):dr(void 0),ge&&V.preventDefault();break}case te.Z.ESC:Ae(!1),ge&&V.stopPropagation()}},onKeyUp:function(){},scrollTo:function(V){_t(V)}}}),gr.length===0)return h.createElement("div",{role:"listbox",id:"".concat(x,"_list"),className:"".concat(Gt,"-empty"),onMouseDown:bt},Y);var en=Object.keys(zt).map(function(ct){return zt[ct]}),wr=function(V){return V.label};function Vr(ct,V){var j=ct.group;return{role:j?"presentation":"option",id:"".concat(x,"_list_").concat(V)}}var Ur=function(V){var j=gr[V];if(!j)return null;var Oe=j.data||{},pe=Oe.value,at=j.group,Vt=(0,Ge.Z)(Oe,!0),Qt=wr(j);return j?h.createElement("div",(0,H.Z)({"aria-label":typeof Qt=="string"&&!at?Qt:null},Vt,{key:V},Vr(j,V),{"aria-selected":Xr(pe)}),pe):null},br={role:"listbox",id:"".concat(x,"_list")};return h.createElement(h.Fragment,null,ft&&h.createElement("div",(0,H.Z)({},br,{style:{height:0,width:0,overflow:"hidden"}}),Ur(At-1),Ur(At),Ur(At+1)),h.createElement($t.Z,{itemKey:"key",ref:It,data:gr,height:Wr,itemHeight:Ut,fullHeight:!1,onMouseDown:bt,onScroll:Ct,virtual:ft,direction:hr,innerProps:ft?null:br},function(ct,V){var j=ct.group,Oe=ct.groupOption,pe=ct.data,at=ct.label,Vt=ct.value,Qt=pe.key;if(j){var er,xr=(er=pe.title)!==null&&er!==void 0?er:it(at)?at.toString():void 0;return h.createElement("div",{className:M()(Gt,"".concat(Gt,"-group"),pe.className),title:xr},at!==void 0?at:Qt)}var Yr=pe.disabled,Er=pe.title,tn=pe.children,Nr=pe.style,an=pe.className,Nn=(0,ee.Z)(pe,tt),un=(0,lr.Z)(Nn,en),kr=cr(Vt),Jr=Yr||!kr&&Lt,Ir="".concat(Gt,"-option"),on=M()(Gt,Ir,an,(0,K.Z)((0,K.Z)((0,K.Z)((0,K.Z)({},"".concat(Ir,"-grouped"),Oe),"".concat(Ir,"-active"),At===V&&!Jr),"".concat(Ir,"-disabled"),Jr),"".concat(Ir,"-selected"),kr)),Pn=wr(ct),Hn=!He||typeof He=="function"||kr,Sn=typeof Pn=="number"?Pn:Pn||Vt,vn=it(Sn)?Sn.toString():void 0;return Er!==void 0&&(vn=Er),h.createElement("div",(0,H.Z)({},(0,Ge.Z)(un),ft?{}:Vr(ct,V),{"aria-selected":Xr(Vt),className:on,title:vn,onMouseMove:function(){At===V||Jr||jr(V)},onClick:function(){Jr||dr(Vt)},style:Nr}),h.createElement("div",{className:"".concat(Ir,"-content")},typeof Bt=="function"?Bt(ct,{index:V}):Sn),h.isValidElement(He)||kr,Hn&&h.createElement(ht,{className:"".concat(Gt,"-option-state"),customizeIcon:He,customizeIconProps:{value:Vt,disabled:Jr,isSelected:kr}},kr?"\u2713":null))}))},Yt=h.forwardRef(Ft),Wt=Yt,Tt=function(d,v){var B=h.useRef({values:new Map,options:new Map}),D=h.useMemo(function(){var x=B.current,ge=x.values,ce=x.options,Pe=d.map(function(Y){if(Y.label===void 0){var Ct;return(0,me.Z)((0,me.Z)({},Y),{},{label:(Ct=ge.get(Y.value))===null||Ct===void 0?void 0:Ct.label})}return Y}),be=new Map,Ae=new Map;return Pe.forEach(function(Y){be.set(Y.value,Y),Ae.set(Y.value,v.get(Y.value)||ce.get(Y.value))}),B.current.values=be,B.current.options=Ae,Pe},[d,v]),m=h.useCallback(function(x){return v.get(x)||B.current.options.get(x)},[v]);return[D,m]};function $e(d,v){return z(d).join("").toUpperCase().includes(v)}var sr=function(d,v,B,D,m){return h.useMemo(function(){if(!B||D===!1)return d;var x=v.options,ge=v.label,ce=v.value,Pe=[],be=typeof D=="function",Ae=B.toUpperCase(),Y=be?D:function(Se,rt){return m?$e(rt[m],Ae):rt[x]?$e(rt[ge!=="children"?ge:"label"],Ae):$e(rt[ce],Ae)},Ct=be?function(Se){return ne(Se)}:function(Se){return Se};return d.forEach(function(Se){if(Se[x]){var rt=Y(B,Ct(Se));if(rt)Pe.push(Se);else{var Re=Se[x].filter(function(_e){return Y(B,Ct(_e))});Re.length&&Pe.push((0,me.Z)((0,me.Z)({},Se),{},(0,K.Z)({},x,Re)))}return}Y(B,Ct(Se))&&Pe.push(Se)}),Pe},[d,D,m,B,v])},ur=b(6551),fr=b(11592),ot=["children","value"],Pr=["children"];function Br(d){var v=d,B=v.key,D=v.props,m=D.children,x=D.value,ge=(0,ee.Z)(D,ot);return(0,me.Z)({key:B,value:x!==void 0?x:B,children:m},ge)}function Kr(d){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(0,fr.Z)(d).map(function(B,D){if(!h.isValidElement(B)||!B.type)return null;var m=B,x=m.type.isSelectOptGroup,ge=m.key,ce=m.props,Pe=ce.children,be=(0,ee.Z)(ce,Pr);return v||!x?Br(B):(0,me.Z)((0,me.Z)({key:"__RC_SELECT_GRP__".concat(ge===null?D:ge,"__"),label:ge},be),{},{options:Kr(Pe)})}).filter(function(B){return B})}var Gr=function(v,B,D,m,x){return h.useMemo(function(){var ge=v,ce=!v;ce&&(ge=Kr(B));var Pe=new Map,be=new Map,Ae=function(Se,rt,Re){Re&&typeof Re=="string"&&Se.set(rt[Re],rt)},Y=function Ct(Se){for(var rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Re=0;Re<Se.length;Re+=1){var _e=Se[Re];!_e[D.options]||rt?(Pe.set(_e[D.value],_e),Ae(be,_e,D.label),Ae(be,_e,m),Ae(be,_e,x)):Ct(_e[D.options],!0)}};return Y(ge),{options:ge,valueOptions:Pe,labelOptions:be}},[v,B,D,m,x])},Dr=Gr;function vr(d){var v=h.useRef();v.current=d;var B=h.useCallback(function(){return v.current.apply(v,arguments)},[]);return B}function Cr(d){var v=d.mode,B=d.options,D=d.children,m=d.backfill,x=d.allowClear,ge=d.placeholder,ce=d.getInputElement,Pe=d.showSearch,be=d.onSearch,Ae=d.defaultOpen,Y=d.autoFocus,Ct=d.labelInValue,Se=d.value,rt=d.inputValue,Re=d.optionLabelProp,_e=isMultiple(v),Mt=Pe!==void 0?Pe:_e||v==="combobox",Ee=B||convertChildrenToData(D);if(warning(v!=="tags"||Ee.every(function(ft){return!ft.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),v==="tags"||v==="combobox"){var He=Ee.some(function(ft){return ft.options?ft.options.some(function(hr){return typeof("value"in hr?hr.value:hr.key)=="number"}):typeof("value"in ft?ft.value:ft.key)=="number"});warning(!He,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(v!=="combobox"||!Re,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(v==="combobox"||!m,"`backfill` only works with `combobox` mode."),warning(v==="combobox"||!ce,"`getInputElement` only work with `combobox` mode."),noteOnce(v!=="combobox"||!ce||!x||!ge,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),be&&!Mt&&v!=="combobox"&&v!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!Ae||Y,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Se!=null){var et=toArray(Se);warning(!Ct||et.every(function(ft){return _typeof(ft)==="object"&&("key"in ft||"value"in ft)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!_e||Array.isArray(Se),"`value` should be array when `mode` is `multiple` or `tags`")}if(D){var zt=null;toNodeArray(D).some(function(ft){if(!React.isValidElement(ft)||!ft.type)return!1;var hr=ft,Wr=hr.type;if(Wr.isSelectOption)return!1;if(Wr.isSelectOptGroup){var Ut=toNodeArray(ft.props.children).every(function(Bt){return!React.isValidElement(Bt)||!ft.type||Bt.type.isSelectOption?!0:(zt=Bt.type,!1)});return!Ut}return zt=Wr,!0}),zt&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(zt.displayName||zt.name||zt,"`.")),warning(rt===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function Zr(d,v){if(d){var B=function D(m){for(var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ge=0;ge<m.length;ge++){var ce=m[ge];if(ce[v==null?void 0:v.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!x&&Array.isArray(ce[v==null?void 0:v.options])&&D(ce[v==null?void 0:v.options],!0))break}};B(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"],Fr=["inputValue"];function Dt(d){return!d||(0,re.Z)(d)!=="object"}var G=h.forwardRef(function(d,v){var B=d.id,D=d.mode,m=d.prefixCls,x=m===void 0?"rc-select":m,ge=d.backfill,ce=d.fieldNames,Pe=d.inputValue,be=d.searchValue,Ae=d.onSearch,Y=d.autoClearSearchValue,Ct=Y===void 0?!0:Y,Se=d.onSelect,rt=d.onDeselect,Re=d.dropdownMatchSelectWidth,_e=Re===void 0?!0:Re,Mt=d.filterOption,Ee=d.filterSort,He=d.optionFilterProp,et=d.optionLabelProp,zt=d.options,ft=d.optionRender,hr=d.children,Wr=d.defaultActiveFirstOption,Ut=d.menuItemSelectedIcon,Bt=d.virtual,Gt=d.direction,gr=d.listHeight,It=gr===void 0?200:gr,Lt=d.listItemHeight,bt=Lt===void 0?20:Lt,_t=d.labelRender,cr=d.value,rr=d.defaultValue,pr=d.labelInValue,Xt=d.onChange,At=d.maxCount,yr=(0,ee.Z)(d,Kt),jr=(0,ur.ZP)(B),Xr=ve(D),dr=!!(!zt&&hr),en=h.useMemo(function(){return Mt===void 0&&D==="combobox"?!1:Mt},[Mt,D]),wr=h.useMemo(function(){return Q(ce,dr)},[JSON.stringify(ce),dr]),Vr=(0,Qe.Z)("",{value:be!==void 0?be:Pe,postState:function(vt){return vt||""}}),Ur=(0,N.Z)(Vr,2),br=Ur[0],ct=Ur[1],V=Dr(zt,hr,wr,He,et),j=V.valueOptions,Oe=V.labelOptions,pe=V.options,at=h.useCallback(function(Ye){var vt=z(Ye);return vt.map(function(lt){var pt,nr,Mr,In,Te;if(Dt(lt))pt=lt;else{var Je;Mr=lt.key,nr=lt.label,pt=(Je=lt.value)!==null&&Je!==void 0?Je:Mr}var kt=j.get(pt);if(kt){var Lr;if(nr===void 0&&(nr=kt==null?void 0:kt[et||wr.label]),Mr===void 0&&(Mr=(Lr=kt==null?void 0:kt.key)!==null&&Lr!==void 0?Lr:pt),In=kt==null?void 0:kt.disabled,Te=kt==null?void 0:kt.title,0)var Sr}return{label:nr,value:pt,key:Mr,disabled:In,title:Te}})},[wr,et,j]),Vt=(0,Qe.Z)(rr,{value:cr}),Qt=(0,N.Z)(Vt,2),er=Qt[0],xr=Qt[1],Yr=h.useMemo(function(){var Ye,vt=Xr&&er===null?[]:er,lt=at(vt);return D==="combobox"&&Ne((Ye=lt[0])===null||Ye===void 0?void 0:Ye.value)?[]:lt},[er,at,D,Xr]),Er=Tt(Yr,j),tn=(0,N.Z)(Er,2),Nr=tn[0],an=tn[1],Nn=h.useMemo(function(){if(!D&&Nr.length===1){var Ye=Nr[0];if(Ye.value===null&&(Ye.label===null||Ye.label===void 0))return[]}return Nr.map(function(vt){var lt;return(0,me.Z)((0,me.Z)({},vt),{},{label:(lt=typeof _t=="function"?_t(vt):vt.label)!==null&<!==void 0?lt:vt.value})})},[D,Nr,_t]),un=h.useMemo(function(){return new Set(Nr.map(function(Ye){return Ye.value}))},[Nr]);h.useEffect(function(){if(D==="combobox"){var Ye,vt=(Ye=Nr[0])===null||Ye===void 0?void 0:Ye.value;ct(ue(vt)?String(vt):"")}},[Nr]);var kr=vr(function(Ye,vt){var lt=vt!=null?vt:Ye;return(0,K.Z)((0,K.Z)({},wr.value,Ye),wr.label,lt)}),Jr=h.useMemo(function(){if(D!=="tags")return pe;var Ye=(0,$.Z)(pe),vt=function(pt){return j.has(pt)};return(0,$.Z)(Nr).sort(function(lt,pt){return lt.value<pt.value?-1:1}).forEach(function(lt){var pt=lt.value;vt(pt)||Ye.push(kr(pt,lt.label))}),Ye},[kr,pe,j,Nr,D]),Ir=sr(Jr,wr,br,en,He),on=h.useMemo(function(){return D!=="tags"||!br||Ir.some(function(Ye){return Ye[He||"value"]===br})||Ir.some(function(Ye){return Ye[wr.value]===br})?Ir:[kr(br)].concat((0,$.Z)(Ir))},[kr,He,D,Ir,br,wr]),Pn=function Ye(vt){var lt=(0,$.Z)(vt).sort(function(pt,nr){return Ee(pt,nr,{searchValue:br})});return lt.map(function(pt){return Array.isArray(pt.options)?(0,me.Z)((0,me.Z)({},pt),{},{options:pt.options.length>0?Ye(pt.options):pt.options}):pt})},Hn=h.useMemo(function(){return Ee?Pn(on):on},[on,Ee,br]),Sn=h.useMemo(function(){return ae(Hn,{fieldNames:wr,childrenAsData:dr})},[Hn,wr,dr]),vn=function(vt){var lt=at(vt);if(xr(lt),Xt&&(lt.length!==Nr.length||lt.some(function(Mr,In){var Te;return((Te=Nr[In])===null||Te===void 0?void 0:Te.value)!==(Mr==null?void 0:Mr.value)}))){var pt=pr?lt:lt.map(function(Mr){return Mr.value}),nr=lt.map(function(Mr){return ne(an(Mr.value))});Xt(Xr?pt:pt[0],Xr?nr:nr[0])}},Qn=h.useState(null),xn=(0,N.Z)(Qn,2),ni=xn[0],$r=xn[1],Bn=h.useState(0),ui=(0,N.Z)(Bn,2),ii=ui[0],di=ui[1],Kn=Wr!==void 0?Wr:D!=="combobox",Hr=h.useCallback(function(Ye,vt){var lt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},pt=lt.source,nr=pt===void 0?"keyboard":pt;di(vt),ge&&D==="combobox"&&Ye!==null&&nr==="keyboard"&&$r(String(Ye))},[ge,D]),fn=function(vt,lt,pt){var nr=function(){var ei,Rn=an(vt);return[pr?{label:Rn==null?void 0:Rn[wr.label],value:vt,key:(ei=Rn==null?void 0:Rn.key)!==null&&ei!==void 0?ei:vt}:vt,ne(Rn)]};if(lt&&Se){var Mr=nr(),In=(0,N.Z)(Mr,2),Te=In[0],Je=In[1];Se(Te,Je)}else if(!lt&&rt&&pt!=="clear"){var kt=nr(),Lr=(0,N.Z)(kt,2),Sr=Lr[0],hn=Lr[1];rt(Sr,hn)}},Un=vr(function(Ye,vt){var lt,pt=Xr?vt.selected:!0;pt?lt=Xr?[].concat((0,$.Z)(Nr),[Ye]):[Ye]:lt=Nr.filter(function(nr){return nr.value!==Ye}),vn(lt),fn(Ye,pt),D==="combobox"?$r(""):(!ve||Ct)&&(ct(""),$r(""))}),On=function(vt,lt){vn(vt);var pt=lt.type,nr=lt.values;(pt==="remove"||pt==="clear")&&nr.forEach(function(Mr){fn(Mr.value,!1,pt)})},mr=function(vt,lt){if(ct(vt),$r(null),lt.source==="submit"){var pt=(vt||"").trim();if(pt){var nr=Array.from(new Set([].concat((0,$.Z)(un),[pt])));vn(nr),fn(pt,!0),ct("")}return}lt.source!=="blur"&&(D==="combobox"&&vn(vt),Ae==null||Ae(vt))},Gn=function(vt){var lt=vt;D!=="tags"&&(lt=vt.map(function(nr){var Mr=Oe.get(nr);return Mr==null?void 0:Mr.value}).filter(function(nr){return nr!==void 0}));var pt=Array.from(new Set([].concat((0,$.Z)(un),(0,$.Z)(lt))));vn(pt),pt.forEach(function(nr){fn(nr,!0)})},Vn=h.useMemo(function(){var Ye=Bt!==!1&&_e!==!1;return(0,me.Z)((0,me.Z)({},V),{},{flattenOptions:Sn,onActiveValue:Hr,defaultActiveFirstOption:Kn,onSelect:Un,menuItemSelectedIcon:Ut,rawValues:un,fieldNames:wr,virtual:Ye,direction:Gt,listHeight:It,listItemHeight:bt,childrenAsData:dr,maxCount:At,optionRender:ft})},[At,V,Sn,Hr,Kn,Un,Ut,un,wr,Bt,_e,Gt,It,bt,dr,ft]);return h.createElement(W.Provider,{value:Vn},h.createElement(Me,(0,H.Z)({},yr,{id:jr,prefixCls:x,ref:v,omitDomProps:Fr,mode:D,displayValues:Nn,onDisplayValuesChange:On,direction:Gt,searchValue:br,onSearch:mr,autoClearSearchValue:Ct,onSearchSplit:Gn,dropdownMatchSelectWidth:_e,OptionList:Wt,emptyOptions:!Sn.length,activeValue:ni,activeDescendantId:"".concat(jr,"_list_").concat(ii)})))}),ut=G;ut.Option=qe,ut.OptGroup=Xe;var Or=ut,qt=Or},22711:function(bn,yt,b){"use strict";b.r(yt),b.d(yt,{ResizableTextArea:function(){return Pt},default:function(){return X}});var H=b(54476),$=b(20068),K=b(33885),me=b(94480),N=b(42978),ee=b(75931),re=b(92310),Qe=b.n(re),q=b(36901),h=b(66003),Fe=b(30292),M=b(18929),De=b(59301),R=b(76190),St=b(29301),Ot=b(34280),ht=b(16089),Nt=`
|
|
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={},F;function wt(z){var ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,L=z.getAttribute("id")||z.getAttribute("data-reactid")||z.getAttribute("name");if(ke&&he[L])return he[L];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")),je=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(";"),xe={sizingStyle:Ve,paddingSize:fe,borderSize:je,boxSizing:Ne};return ke&&L&&(he[L]=xe),xe}function ze(z){var ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,ue=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;F||(F=document.createElement("textarea"),F.setAttribute("tab-index","-1"),F.setAttribute("aria-hidden","true"),F.setAttribute("name","hiddenTextarea"),document.body.appendChild(F)),z.getAttribute("wrap")?F.setAttribute("wrap",z.getAttribute("wrap")):F.removeAttribute("wrap");var Ne=wt(z,ke),fe=Ne.paddingSize,je=Ne.borderSize,Ve=Ne.boxSizing,xe=Ne.sizingStyle;F.setAttribute("style","".concat(xe,";").concat(Nt)),F.value=z.value||z.placeholder||"";var Ke=void 0,We=void 0,Zt,Rt=F.scrollHeight;if(Ve==="border-box"?Rt+=je:Ve==="content-box"&&(Rt-=fe),L!==null||ue!==null){F.value=" ";var Et=F.scrollHeight-fe;L!==null&&(Ke=Et*L,Ve==="border-box"&&(Ke=Ke+fe+je),Rt=Math.max(Ke,Rt)),ue!==null&&(We=Et*ue,Ve==="border-box"&&(We=We+fe+je),Zt=Rt>We?"":"hidden",Rt=Math.min(We,Rt))}var Ie={height:Rt,overflowY:Zt,resize:"none"};return Ke&&(Ie.minHeight=Ke),We&&(Ie.maxHeight=We),Ie}var te=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],xt=0,Ge=1,J=2,dt=De.forwardRef(function(z,ke){var L=z,ue=L.prefixCls,Ne=L.defaultValue,fe=L.value,je=L.autoSize,Ve=L.onResize,xe=L.className,Ke=L.style,We=L.disabled,Zt=L.onChange,Rt=L.onInternalAutoSize,Et=(0,ee.Z)(L,te),Ie=(0,M.Z)(Ne,{value:fe,postState:function(qe){return qe!=null?qe:""}}),or=(0,N.Z)(Ie,2),tr=or[0],P=or[1],p=function(qe){P(qe.target.value),Zt==null||Zt(qe)},C=De.useRef();De.useImperativeHandle(ke,function(){return{textArea:C.current}});var g=De.useMemo(function(){return je&&(0,R.Z)(je)==="object"?[je.minRows,je.maxRows]:[]},[je]),w=(0,N.Z)(g,2),I=w[0],k=w[1],Z=!!je,le=function(){try{if(document.activeElement===C.current){var qe=C.current,ir=qe.selectionStart,lr=qe.selectionEnd,$t=qe.scrollTop;C.current.setSelectionRange(ir,lr),C.current.scrollTop=$t}}catch(Tr){}},Q=De.useState(J),ae=(0,N.Z)(Q,2),ne=ae[0],ie=ae[1],de=De.useState(),W=(0,N.Z)(de,2),oe=W[0],U=W[1],Ue=function(){ie(xt)};(0,Ot.Z)(function(){Z&&Ue()},[fe,I,k,Z]),(0,Ot.Z)(function(){if(ne===xt)ie(Ge);else if(ne===Ge){var ye=ze(C.current,!1,I,k);ie(J),U(ye)}else le()},[ne]);var ve=De.useRef(),Le=function(){ht.Z.cancel(ve.current)},Me=function(qe){ne===J&&(Ve==null||Ve(qe),je&&(Le(),ve.current=(0,ht.Z)(function(){Ue()})))};De.useEffect(function(){return Le},[]);var gt=Z?oe:null,Xe=(0,K.Z)((0,K.Z)({},Ke),gt);return(ne===xt||ne===Ge)&&(Xe.overflowY="hidden",Xe.overflowX="hidden"),De.createElement(St.Z,{onResize:Me,disabled:!(je||Ve)},De.createElement("textarea",(0,H.Z)({},Et,{ref:C,style:Xe,className:Qe()(ue,xe,(0,$.Z)({},"".concat(ue,"-disabled"),We)),disabled:We,value:tr,onChange:p})))}),Pt=dt,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=De.forwardRef(function(z,ke){var L,ue=z.defaultValue,Ne=z.value,fe=z.onFocus,je=z.onBlur,Ve=z.onChange,xe=z.allowClear,Ke=z.maxLength,We=z.onCompositionStart,Zt=z.onCompositionEnd,Rt=z.suffix,Et=z.prefixCls,Ie=Et===void 0?"rc-textarea":Et,or=z.showCount,tr=z.count,P=z.className,p=z.style,C=z.disabled,g=z.hidden,w=z.classNames,I=z.styles,k=z.onResize,Z=z.onClear,le=z.onPressEnter,Q=z.readOnly,ae=z.autoSize,ne=z.onKeyDown,ie=(0,ee.Z)(z,O),de=(0,M.Z)(ue,{value:Ne,defaultValue:ue}),W=(0,N.Z)(de,2),oe=W[0],U=W[1],Ue=oe==null?"":String(oe),ve=De.useState(!1),Le=(0,N.Z)(ve,2),Me=Le[0],gt=Le[1],Xe=De.useRef(!1),ye=De.useState(null),qe=(0,N.Z)(ye,2),ir=qe[0],lr=qe[1],$t=(0,De.useRef)(null),Tr=(0,De.useRef)(null),tt=function(){var ut;return(ut=Tr.current)===null||ut===void 0?void 0:ut.textArea},it=function(){tt().focus()};(0,De.useImperativeHandle)(ke,function(){var G;return{resizableTextArea:Tr.current,focus:it,blur:function(){tt().blur()},nativeElement:((G=$t.current)===null||G===void 0?void 0:G.nativeElement)||tt()}}),(0,De.useEffect)(function(){gt(function(G){return!C&&G})},[C]);var Ft=De.useState(null),Yt=(0,N.Z)(Ft,2),Wt=Yt[0],Tt=Yt[1];De.useEffect(function(){if(Wt){var G;(G=tt()).setSelectionRange.apply(G,(0,me.Z)(Wt))}},[Wt]);var $e=(0,h.Z)(tr,or),sr=(L=$e.max)!==null&&L!==void 0?L:Ke,ur=Number(sr)>0,fr=$e.strategy(Ue),ot=!!sr&&fr>sr,Pr=function(ut,Or){var qt=Or;!Xe.current&&$e.exceedFormatter&&$e.max&&$e.strategy(Or)>$e.max&&(qt=$e.exceedFormatter(Or,{max:$e.max}),Or!==qt&&Tt([tt().selectionStart||0,tt().selectionEnd||0])),U(qt),(0,Fe.rJ)(ut.currentTarget,ut,Ve,qt)},Br=function(ut){Xe.current=!0,We==null||We(ut)},Kr=function(ut){Xe.current=!1,Pr(ut,ut.currentTarget.value),Zt==null||Zt(ut)},Gr=function(ut){Pr(ut,ut.target.value)},Dr=function(ut){ut.key==="Enter"&&le&&le(ut),ne==null||ne(ut)},vr=function(ut){gt(!0),fe==null||fe(ut)},Cr=function(ut){gt(!1),je==null||je(ut)},Zr=function(ut){U(""),it(),(0,Fe.rJ)(tt(),ut,Ve)},Jt=Rt,Kt;$e.show&&($e.showFormatter?Kt=$e.showFormatter({value:Ue,count:fr,maxLength:sr}):Kt="".concat(fr).concat(ur?" / ".concat(sr):""),Jt=De.createElement(De.Fragment,null,Jt,De.createElement("span",{className:Qe()("".concat(Ie,"-data-count"),w==null?void 0:w.count),style:I==null?void 0:I.count},Kt)));var Fr=function(ut){var Or;k==null||k(ut),(Or=tt())!==null&&Or!==void 0&&Or.style.height&&lr(!0)},Dt=!ae&&!or&&!xe;return De.createElement(q.BaseInput,{ref:$t,value:Ue,allowClear:xe,handleReset:Zr,suffix:Jt,prefixCls:Ie,classNames:(0,K.Z)((0,K.Z)({},w),{},{affixWrapper:Qe()(w==null?void 0:w.affixWrapper,(0,$.Z)((0,$.Z)({},"".concat(Ie,"-show-count"),or),"".concat(Ie,"-textarea-allow-clear"),xe))}),disabled:C,focused:Me,className:Qe()(P,ot&&"".concat(Ie,"-out-of-range")),style:(0,K.Z)((0,K.Z)({},p),ir&&!Dt?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof Kt=="string"?Kt:void 0}},hidden:g,readOnly:Q,onClear:Z},De.createElement(Pt,(0,H.Z)({},ie,{autoSize:ae,maxLength:Ke,onKeyDown:Dr,onChange:Gr,onFocus:vr,onBlur:Cr,onCompositionStart:Br,onCompositionEnd:Kr,className:Qe()(w==null?void 0:w.textarea),style:(0,K.Z)((0,K.Z)({},I==null?void 0:I.textarea),{},{resize:p==null?void 0:p.resize}),disabled:C,prefixCls:Ie,onResize:Fr,ref:Tr,readOnly:Q})))}),A=E,X=A},29125:function(bn,yt,b){"use strict";b.d(yt,{G:function(){return me},Z:function(){return Nt}});var H=b(92310),$=b.n(H),K=b(59301);function me(st){var he=st.children,F=st.prefixCls,wt=st.id,ze=st.overlayInnerStyle,te=st.bodyClassName,xt=st.className,Ge=st.style;return K.createElement("div",{className:$()("".concat(F,"-content"),xt),style:Ge},K.createElement("div",{className:$()("".concat(F,"-inner"),te),id:wt,role:"tooltip",style:ze},typeof he=="function"?he():he))}var N=b(54476),ee=b(33885),re=b(75931),Qe=b(65030),q={shiftX:64,adjustY:1},h={adjustX:1,shiftY:!0},Fe=[0,0],M={left:{points:["cr","cl"],overflow:h,offset:[-4,0],targetOffset:Fe},right:{points:["cl","cr"],overflow:h,offset:[4,0],targetOffset:Fe},top:{points:["bc","tc"],overflow:q,offset:[0,-4],targetOffset:Fe},bottom:{points:["tc","bc"],overflow:q,offset:[0,4],targetOffset:Fe},topLeft:{points:["bl","tl"],overflow:q,offset:[0,-4],targetOffset:Fe},leftTop:{points:["tr","tl"],overflow:h,offset:[-4,0],targetOffset:Fe},topRight:{points:["br","tr"],overflow:q,offset:[0,-4],targetOffset:Fe},rightTop:{points:["tl","tr"],overflow:h,offset:[4,0],targetOffset:Fe},bottomRight:{points:["tr","br"],overflow:q,offset:[0,4],targetOffset:Fe},rightBottom:{points:["bl","br"],overflow:h,offset:[4,0],targetOffset:Fe},bottomLeft:{points:["tl","bl"],overflow:q,offset:[0,4],targetOffset:Fe},leftBottom:{points:["br","bl"],overflow:h,offset:[-4,0],targetOffset:Fe}},De=null,R=b(80402),St=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],Ot=function(he,F){var wt=he.overlayClassName,ze=he.trigger,te=ze===void 0?["hover"]:ze,xt=he.mouseEnterDelay,Ge=xt===void 0?0:xt,J=he.mouseLeaveDelay,dt=J===void 0?.1:J,Pt=he.overlayStyle,O=he.prefixCls,E=O===void 0?"rc-tooltip":O,A=he.children,X=he.onVisibleChange,z=he.afterVisibleChange,ke=he.transitionName,L=he.animation,ue=he.motion,Ne=he.placement,fe=Ne===void 0?"right":Ne,je=he.align,Ve=je===void 0?{}:je,xe=he.destroyTooltipOnHide,Ke=xe===void 0?!1:xe,We=he.defaultVisible,Zt=he.getTooltipContainer,Rt=he.overlayInnerStyle,Et=he.arrowContent,Ie=he.overlay,or=he.id,tr=he.showArrow,P=tr===void 0?!0:tr,p=he.classNames,C=he.styles,g=(0,re.Z)(he,St),w=(0,R.Z)(or),I=(0,K.useRef)(null);(0,K.useImperativeHandle)(F,function(){return I.current});var k=(0,ee.Z)({},g);"visible"in he&&(k.popupVisible=he.visible);var Z=function(){return K.createElement(me,{key:"content",prefixCls:E,id:w,bodyClassName:p==null?void 0:p.body,overlayInnerStyle:(0,ee.Z)((0,ee.Z)({},Rt),C==null?void 0:C.body)},Ie)},le=function(){var ae=K.Children.only(A),ne=(ae==null?void 0:ae.props)||{},ie=(0,ee.Z)((0,ee.Z)({},ne),{},{"aria-describedby":Ie?w:null});return K.cloneElement(A,ie)};return K.createElement(Qe.Z,(0,N.Z)({popupClassName:$()(wt,p==null?void 0:p.root),prefixCls:E,popup:Z,action:te,builtinPlacements:M,popupPlacement:fe,ref:I,popupAlign:Ve,getPopupContainer:Zt,onPopupVisibleChange:X,afterPopupVisibleChange:z,popupTransitionName:ke,popupAnimation:L,popupMotion:ue,defaultPopupVisible:We,autoDestroy:Ke,mouseLeaveDelay:dt,popupStyle:(0,ee.Z)((0,ee.Z)({},Pt),C==null?void 0:C.root),mouseEnterDelay:Ge,arrow:P},k),le())},ht=(0,K.forwardRef)(Ot),Nt=ht},49658:function(bn,yt){"use strict";yt.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))}},48911:function(bn,yt,b){"use strict";b.d(yt,{Z:function(){return tr}});var H=b(54476),$=b(76190),K=b(33885),me=b(20068),N=b(42978),ee=b(75931),re=b(92310),Qe=b.n(re),q=b(29301),h=b(70425),Fe=b(34280),M=b(59301),De=b(4676),R=M.forwardRef(function(P,p){var C=P.height,g=P.offsetY,w=P.offsetX,I=P.children,k=P.prefixCls,Z=P.onInnerResize,le=P.innerProps,Q=P.rtl,ae=P.extra,ne={},ie={display:"flex",flexDirection:"column"};return g!==void 0&&(ne={height:C,position:"relative",overflow:"hidden"},ie=(0,K.Z)((0,K.Z)({},ie),{},(0,me.Z)((0,me.Z)((0,me.Z)((0,me.Z)((0,me.Z)({transform:"translateY(".concat(g,"px)")},Q?"marginRight":"marginLeft",-w),"position","absolute"),"left",0),"right",0),"top",0))),M.createElement("div",{style:ne},M.createElement(q.Z,{onResize:function(W){var oe=W.offsetHeight;oe&&Z&&Z()}},M.createElement("div",(0,H.Z)({style:ie,className:Qe()((0,me.Z)({},"".concat(k,"-holder-inner"),k)),ref:p},le),I,ae)))});R.displayName="Filler";var St=R;function Ot(P){var p=P.children,C=P.setRef,g=M.useCallback(function(w){C(w)},[]);return M.cloneElement(p,{ref:g})}function ht(P,p,C,g,w,I,k,Z){var le=Z.getKey;return P.slice(p,C+1).map(function(Q,ae){var ne=p+ae,ie=k(Q,ne,{style:{width:g},offsetX:w}),de=le(Q);return M.createElement(Ot,{key:de,setRef:function(oe){return I(Q,oe)}},ie)})}function Nt(P,p,C,g){var w=C-P,I=p-C,k=Math.min(w,I)*2;if(g<=k){var Z=Math.floor(g/2);return g%2?C+Z+1:C-Z}return w>I?C-(g-I):C+(g-w)}function st(P,p,C){var g=P.length,w=p.length,I,k;if(g===0&&w===0)return null;g<w?(I=P,k=p):(I=p,k=P);var Z={__EMPTY_ITEM__:!0};function le(W){return W!==void 0?C(W):Z}for(var Q=null,ae=Math.abs(g-w)!==1,ne=0;ne<k.length;ne+=1){var ie=le(I[ne]),de=le(k[ne]);if(ie!==de){Q=ne,ae=ae||ie!==le(k[ne+1]);break}}return Q===null?null:{index:Q,multiple:ae}}function he(P,p,C){var g=M.useState(P),w=(0,N.Z)(g,2),I=w[0],k=w[1],Z=M.useState(null),le=(0,N.Z)(Z,2),Q=le[0],ae=le[1];return M.useEffect(function(){var ne=st(I||[],P||[],p);(ne==null?void 0:ne.index)!==void 0&&(C==null||C(ne.index),ae(P[ne.index])),k(P)},[P]),[Q]}var F=b(16089),wt=(typeof navigator=="undefined"?"undefined":(0,$.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),ze=wt,te=function(P,p,C,g){var w=(0,M.useRef)(!1),I=(0,M.useRef)(null);function k(){clearTimeout(I.current),w.current=!0,I.current=setTimeout(function(){w.current=!1},50)}var Z=(0,M.useRef)({top:P,bottom:p,left:C,right:g});return Z.current.top=P,Z.current.bottom=p,Z.current.left=C,Z.current.right=g,function(le,Q){var ae=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,ne=le?Q<0&&Z.current.left||Q>0&&Z.current.right:Q<0&&Z.current.top||Q>0&&Z.current.bottom;return ae&&ne?(clearTimeout(I.current),w.current=!1):(!ne||w.current)&&k(),!w.current&&ne}};function xt(P,p,C,g,w,I,k){var Z=(0,M.useRef)(0),le=(0,M.useRef)(null),Q=(0,M.useRef)(null),ae=(0,M.useRef)(!1),ne=te(p,C,g,w);function ie(ve,Le){if(F.Z.cancel(le.current),!ne(!1,Le)){var Me=ve;if(!Me._virtualHandled)Me._virtualHandled=!0;else return;Z.current+=Le,Q.current=Le,ze||Me.preventDefault(),le.current=(0,F.Z)(function(){var gt=ae.current?10:1;k(Z.current*gt,!1),Z.current=0})}}function de(ve,Le){k(Le,!0),ze||ve.preventDefault()}var W=(0,M.useRef)(null),oe=(0,M.useRef)(null);function U(ve){if(P){F.Z.cancel(oe.current),oe.current=(0,F.Z)(function(){W.current=null},2);var Le=ve.deltaX,Me=ve.deltaY,gt=ve.shiftKey,Xe=Le,ye=Me;(W.current==="sx"||!W.current&>&&Me&&!Le)&&(Xe=Me,ye=0,W.current="sx");var qe=Math.abs(Xe),ir=Math.abs(ye);W.current===null&&(W.current=I&&qe>ir?"x":"y"),W.current==="y"?ie(ve,ye):de(ve,Xe)}}function Ue(ve){P&&(ae.current=ve.detail===Q.current)}return[U,Ue]}function Ge(P,p,C,g){var w=M.useMemo(function(){return[new Map,[]]},[P,C.id,g]),I=(0,N.Z)(w,2),k=I[0],Z=I[1],le=function(ae){var ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ae,ie=k.get(ae),de=k.get(ne);if(ie===void 0||de===void 0)for(var W=P.length,oe=Z.length;oe<W;oe+=1){var U,Ue=P[oe],ve=p(Ue);k.set(ve,oe);var Le=(U=C.get(ve))!==null&&U!==void 0?U:g;if(Z[oe]=(Z[oe-1]||0)+Le,ve===ae&&(ie=oe),ve===ne&&(de=oe),ie!==void 0&&de!==void 0)break}return{top:Z[ie-1]||0,bottom:Z[de]}};return le}var J=b(67732),dt=b(83652),Pt=function(){function P(){(0,J.Z)(this,P),(0,me.Z)(this,"maps",void 0),(0,me.Z)(this,"id",0),(0,me.Z)(this,"diffRecords",new Map),this.maps=Object.create(null)}return(0,dt.Z)(P,[{key:"set",value:function(C,g){this.diffRecords.set(C,this.maps[C]),this.maps[C]=g,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}}]),P}(),O=Pt;function E(P){var p=parseFloat(P);return isNaN(p)?0:p}function A(P,p,C){var g=M.useState(0),w=(0,N.Z)(g,2),I=w[0],k=w[1],Z=(0,M.useRef)(new Map),le=(0,M.useRef)(new O),Q=(0,M.useRef)(0);function ae(){Q.current+=1}function ne(){var de=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;ae();var W=function(){var Ue=!1;Z.current.forEach(function(ve,Le){if(ve&&ve.offsetParent){var Me=ve.offsetHeight,gt=getComputedStyle(ve),Xe=gt.marginTop,ye=gt.marginBottom,qe=E(Xe),ir=E(ye),lr=Me+qe+ir;le.current.get(Le)!==lr&&(le.current.set(Le,lr),Ue=!0)}}),Ue&&k(function(ve){return ve+1})};if(de)W();else{Q.current+=1;var oe=Q.current;Promise.resolve().then(function(){oe===Q.current&&W()})}}function ie(de,W){var oe=P(de),U=Z.current.get(oe);W?(Z.current.set(oe,W),ne()):Z.current.delete(oe),!U!=!W&&(W?p==null||p(de):C==null||C(de))}return(0,M.useEffect)(function(){return ae},[]),[ie,ne,le.current,I]}var X=14/15;function z(P,p,C){var g=(0,M.useRef)(!1),w=(0,M.useRef)(0),I=(0,M.useRef)(0),k=(0,M.useRef)(null),Z=(0,M.useRef)(null),le,Q=function(de){if(g.current){var W=Math.ceil(de.touches[0].pageX),oe=Math.ceil(de.touches[0].pageY),U=w.current-W,Ue=I.current-oe,ve=Math.abs(U)>Math.abs(Ue);ve?w.current=W:I.current=oe;var Le=C(ve,ve?U:Ue,!1,de);Le&&de.preventDefault(),clearInterval(Z.current),Le&&(Z.current=setInterval(function(){ve?U*=X:Ue*=X;var Me=Math.floor(ve?U:Ue);(!C(ve,Me,!0)||Math.abs(Me)<=.1)&&clearInterval(Z.current)},16))}},ae=function(){g.current=!1,le()},ne=function(de){le(),de.touches.length===1&&!g.current&&(g.current=!0,w.current=Math.ceil(de.touches[0].pageX),I.current=Math.ceil(de.touches[0].pageY),k.current=de.target,k.current.addEventListener("touchmove",Q,{passive:!1}),k.current.addEventListener("touchend",ae,{passive:!0}))};le=function(){k.current&&(k.current.removeEventListener("touchmove",Q),k.current.removeEventListener("touchend",ae))},(0,Fe.Z)(function(){return P&&p.current.addEventListener("touchstart",ne,{passive:!0}),function(){var ie;(ie=p.current)===null||ie===void 0||ie.removeEventListener("touchstart",ne),le(),clearInterval(Z.current)}},[P])}function ke(P){return Math.floor(Math.pow(P,.5))}function L(P,p){var C="touches"in P?P.touches[0]:P;return C[p?"pageX":"pageY"]-window[p?"scrollX":"scrollY"]}function ue(P,p,C){M.useEffect(function(){var g=p.current;if(P&&g){var w=!1,I,k,Z=function(){F.Z.cancel(I)},le=function ie(){Z(),I=(0,F.Z)(function(){C(k),ie()})},Q=function(){w=!1,Z()},ae=function(de){if(!(de.target.draggable||de.button!==0)){var W=de;W._virtualHandled||(W._virtualHandled=!0,w=!0)}},ne=function(de){if(w){var W=L(de,!1),oe=g.getBoundingClientRect(),U=oe.top,Ue=oe.bottom;if(W<=U){var ve=U-W;k=-ke(ve),le()}else if(W>=Ue){var Le=W-Ue;k=ke(Le),le()}else Z()}};return g.addEventListener("mousedown",ae),g.ownerDocument.addEventListener("mouseup",Q),g.ownerDocument.addEventListener("mousemove",ne),g.ownerDocument.addEventListener("dragend",Q),function(){g.removeEventListener("mousedown",ae),g.ownerDocument.removeEventListener("mouseup",Q),g.ownerDocument.removeEventListener("mousemove",ne),g.ownerDocument.removeEventListener("dragend",Q),Z()}}},[P])}var Ne=10;function fe(P,p,C,g,w,I,k,Z){var le=M.useRef(),Q=M.useState(null),ae=(0,N.Z)(Q,2),ne=ae[0],ie=ae[1];return(0,Fe.Z)(function(){if(ne&&ne.times<Ne){if(!P.current){ie(function($e){return(0,K.Z)({},$e)});return}I();var de=ne.targetAlign,W=ne.originAlign,oe=ne.index,U=ne.offset,Ue=P.current.clientHeight,ve=!1,Le=de,Me=null;if(Ue){for(var gt=de||W,Xe=0,ye=0,qe=0,ir=Math.min(p.length-1,oe),lr=0;lr<=ir;lr+=1){var $t=w(p[lr]);ye=Xe;var Tr=C.get($t);qe=ye+(Tr===void 0?g:Tr),Xe=qe}for(var tt=gt==="top"?U:Ue-U,it=ir;it>=0;it-=1){var Ft=w(p[it]),Yt=C.get(Ft);if(Yt===void 0){ve=!0;break}if(tt-=Yt,tt<=0)break}switch(gt){case"top":Me=ye-U;break;case"bottom":Me=qe-Ue+U;break;default:{var Wt=P.current.scrollTop,Tt=Wt+Ue;ye<Wt?Le="top":qe>Tt&&(Le="bottom")}}Me!==null&&k(Me),Me!==ne.lastTop&&(ve=!0)}ve&&ie((0,K.Z)((0,K.Z)({},ne),{},{times:ne.times+1,targetAlign:Le,lastTop:Me}))}},[ne,P.current]),function(de){if(de==null){Z();return}if(F.Z.cancel(le.current),typeof de=="number")k(de);else if(de&&(0,$.Z)(de)==="object"){var W,oe=de.align;"index"in de?W=de.index:W=p.findIndex(function(ve){return w(ve)===de.key});var U=de.offset,Ue=U===void 0?0:U;ie({times:0,index:W,offset:Ue,originAlign:oe})}}}var je=M.forwardRef(function(P,p){var C=P.prefixCls,g=P.rtl,w=P.scrollOffset,I=P.scrollRange,k=P.onStartMove,Z=P.onStopMove,le=P.onScroll,Q=P.horizontal,ae=P.spinSize,ne=P.containerSize,ie=P.style,de=P.thumbStyle,W=P.showScrollBar,oe=M.useState(!1),U=(0,N.Z)(oe,2),Ue=U[0],ve=U[1],Le=M.useState(null),Me=(0,N.Z)(Le,2),gt=Me[0],Xe=Me[1],ye=M.useState(null),qe=(0,N.Z)(ye,2),ir=qe[0],lr=qe[1],$t=!g,Tr=M.useRef(),tt=M.useRef(),it=M.useState(W),Ft=(0,N.Z)(it,2),Yt=Ft[0],Wt=Ft[1],Tt=M.useRef(),$e=function(){W===!0||W===!1||(clearTimeout(Tt.current),Wt(!0),Tt.current=setTimeout(function(){Wt(!1)},3e3))},sr=I-ne||0,ur=ne-ae||0,fr=M.useMemo(function(){if(w===0||sr===0)return 0;var Zr=w/sr;return Zr*ur},[w,sr,ur]),ot=function(Jt){Jt.stopPropagation(),Jt.preventDefault()},Pr=M.useRef({top:fr,dragging:Ue,pageY:gt,startTop:ir});Pr.current={top:fr,dragging:Ue,pageY:gt,startTop:ir};var Br=function(Jt){ve(!0),Xe(L(Jt,Q)),lr(Pr.current.top),k(),Jt.stopPropagation(),Jt.preventDefault()};M.useEffect(function(){var Zr=function(Dt){Dt.preventDefault()},Jt=Tr.current,Kt=tt.current;return Jt.addEventListener("touchstart",Zr,{passive:!1}),Kt.addEventListener("touchstart",Br,{passive:!1}),function(){Jt.removeEventListener("touchstart",Zr),Kt.removeEventListener("touchstart",Br)}},[]);var Kr=M.useRef();Kr.current=sr;var Gr=M.useRef();Gr.current=ur,M.useEffect(function(){if(Ue){var Zr,Jt=function(Dt){var G=Pr.current,ut=G.dragging,Or=G.pageY,qt=G.startTop;F.Z.cancel(Zr);var d=Tr.current.getBoundingClientRect(),v=ne/(Q?d.width:d.height);if(ut){var B=(L(Dt,Q)-Or)*v,D=qt;!$t&&Q?D-=B:D+=B;var m=Kr.current,x=Gr.current,ge=x?D/x:0,ce=Math.ceil(ge*m);ce=Math.max(ce,0),ce=Math.min(ce,m),Zr=(0,F.Z)(function(){le(ce,Q)})}},Kt=function(){ve(!1),Z()};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),F.Z.cancel(Zr)}}},[Ue]),M.useEffect(function(){return $e(),function(){clearTimeout(Tt.current)}},[w]),M.useImperativeHandle(p,function(){return{delayHidden:$e}});var Dr="".concat(C,"-scrollbar"),vr={position:"absolute",visibility:Yt?null:"hidden"},Cr={position:"absolute",borderRadius:99,background:"var(--rc-virtual-list-scrollbar-bg, rgba(0, 0, 0, 0.5))",cursor:"pointer",userSelect:"none"};return Q?(Object.assign(vr,{height:8,left:0,right:0,bottom:0}),Object.assign(Cr,(0,me.Z)({height:"100%",width:ae},$t?"left":"right",fr))):(Object.assign(vr,(0,me.Z)({width:8,top:0,bottom:0},$t?"right":"left",0)),Object.assign(Cr,{width:"100%",height:ae,top:fr})),M.createElement("div",{ref:Tr,className:Qe()(Dr,(0,me.Z)((0,me.Z)((0,me.Z)({},"".concat(Dr,"-horizontal"),Q),"".concat(Dr,"-vertical"),!Q),"".concat(Dr,"-visible"),Yt)),style:(0,K.Z)((0,K.Z)({},vr),ie),onMouseDown:ot,onMouseMove:$e},M.createElement("div",{ref:tt,className:Qe()("".concat(Dr,"-thumb"),(0,me.Z)({},"".concat(Dr,"-thumb-moving"),Ue)),style:(0,K.Z)((0,K.Z)({},Cr),de),onMouseDown:Br}))}),Ve=je,xe=20;function Ke(){var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,C=P/p*P;return isNaN(C)&&(C=0),C=Math.max(C,xe),Math.floor(C)}var We=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],Zt=[],Rt={overflowY:"auto",overflowAnchor:"none"};function Et(P,p){var C=P.prefixCls,g=C===void 0?"rc-virtual-list":C,w=P.className,I=P.height,k=P.itemHeight,Z=P.fullHeight,le=Z===void 0?!0:Z,Q=P.style,ae=P.data,ne=P.children,ie=P.itemKey,de=P.virtual,W=P.direction,oe=P.scrollWidth,U=P.component,Ue=U===void 0?"div":U,ve=P.onScroll,Le=P.onVirtualScroll,Me=P.onVisibleChange,gt=P.innerProps,Xe=P.extraRender,ye=P.styles,qe=P.showScrollBar,ir=qe===void 0?"optional":qe,lr=(0,ee.Z)(P,We),$t=M.useCallback(function(V){return typeof ie=="function"?ie(V):V==null?void 0:V[ie]},[ie]),Tr=A($t,null,null),tt=(0,N.Z)(Tr,4),it=tt[0],Ft=tt[1],Yt=tt[2],Wt=tt[3],Tt=!!(de!==!1&&I&&k),$e=M.useMemo(function(){return Object.values(Yt.maps).reduce(function(V,j){return V+j},0)},[Yt.id,Yt.maps]),sr=Tt&&ae&&(Math.max(k*ae.length,$e)>I||!!oe),ur=W==="rtl",fr=Qe()(g,(0,me.Z)({},"".concat(g,"-rtl"),ur),w),ot=ae||Zt,Pr=(0,M.useRef)(),Br=(0,M.useRef)(),Kr=(0,M.useRef)(),Gr=(0,M.useState)(0),Dr=(0,N.Z)(Gr,2),vr=Dr[0],Cr=Dr[1],Zr=(0,M.useState)(0),Jt=(0,N.Z)(Zr,2),Kt=Jt[0],Fr=Jt[1],Dt=(0,M.useState)(!1),G=(0,N.Z)(Dt,2),ut=G[0],Or=G[1],qt=function(){Or(!0)},d=function(){Or(!1)},v={getKey:$t};function B(V){Cr(function(j){var Oe;typeof V=="function"?Oe=V(j):Oe=V;var pe=Wr(Oe);return Pr.current.scrollTop=pe,pe})}var D=(0,M.useRef)({start:0,end:ot.length}),m=(0,M.useRef)(),x=he(ot,$t),ge=(0,N.Z)(x,1),ce=ge[0];m.current=ce;var Pe=M.useMemo(function(){if(!Tt)return{scrollHeight:void 0,start:0,end:ot.length-1,offset:void 0};if(!sr){var V;return{scrollHeight:((V=Br.current)===null||V===void 0?void 0:V.offsetHeight)||0,start:0,end:ot.length-1,offset:void 0}}for(var j=0,Oe,pe,at,Vt=ot.length,Qt=0;Qt<Vt;Qt+=1){var er=ot[Qt],xr=$t(er),Yr=Yt.get(xr),Er=j+(Yr===void 0?k:Yr);Er>=vr&&Oe===void 0&&(Oe=Qt,pe=j),Er>vr+I&&at===void 0&&(at=Qt),j=Er}return Oe===void 0&&(Oe=0,pe=0,at=Math.ceil(I/k)),at===void 0&&(at=ot.length-1),at=Math.min(at+1,ot.length-1),{scrollHeight:j,start:Oe,end:at,offset:pe}},[sr,Tt,vr,ot,Wt,I]),be=Pe.scrollHeight,Ae=Pe.start,Y=Pe.end,Ct=Pe.offset;D.current.start=Ae,D.current.end=Y,M.useLayoutEffect(function(){var V=Yt.getRecord();if(V.size===1){var j=Array.from(V.keys())[0],Oe=V.get(j),pe=ot[Ae];if(pe&&Oe===void 0){var at=$t(pe);if(at===j){var Vt=Yt.get(j),Qt=Vt-k;B(function(er){return er+Qt})}}}Yt.resetRecord()},[be]);var Se=M.useState({width:0,height:I}),rt=(0,N.Z)(Se,2),Re=rt[0],_e=rt[1],Mt=function(j){_e({width:j.offsetWidth,height:j.offsetHeight})},Ee=(0,M.useRef)(),He=(0,M.useRef)(),et=M.useMemo(function(){return Ke(Re.width,oe)},[Re.width,oe]),zt=M.useMemo(function(){return Ke(Re.height,be)},[Re.height,be]),ft=be-I,hr=(0,M.useRef)(ft);hr.current=ft;function Wr(V){var j=V;return Number.isNaN(hr.current)||(j=Math.min(j,hr.current)),j=Math.max(j,0),j}var Ut=vr<=0,Bt=vr>=ft,Gt=Kt<=0,gr=Kt>=oe,It=te(Ut,Bt,Gt,gr),Lt=function(){return{x:ur?-Kt:Kt,y:vr}},bt=(0,M.useRef)(Lt()),_t=(0,h.zX)(function(V){if(Le){var j=(0,K.Z)((0,K.Z)({},Lt()),V);(bt.current.x!==j.x||bt.current.y!==j.y)&&(Le(j),bt.current=j)}});function cr(V,j){var Oe=V;j?((0,De.flushSync)(function(){Fr(Oe)}),_t()):B(Oe)}function rr(V){var j=V.currentTarget.scrollTop;j!==vr&&B(j),ve==null||ve(V),_t()}var pr=function(j){var Oe=j,pe=oe?oe-Re.width:0;return Oe=Math.max(Oe,0),Oe=Math.min(Oe,pe),Oe},Xt=(0,h.zX)(function(V,j){j?((0,De.flushSync)(function(){Fr(function(Oe){var pe=Oe+(ur?-V:V);return pr(pe)})}),_t()):B(function(Oe){var pe=Oe+V;return pe})}),At=xt(Tt,Ut,Bt,Gt,gr,!!oe,Xt),yr=(0,N.Z)(At,2),jr=yr[0],Xr=yr[1];z(Tt,Pr,function(V,j,Oe,pe){var at=pe;return It(V,j,Oe)?!1:!at||!at._virtualHandled?(at&&(at._virtualHandled=!0),jr({preventDefault:function(){},deltaX:V?j:0,deltaY:V?0:j}),!0):!1}),ue(sr,Pr,function(V){B(function(j){return j+V})}),(0,Fe.Z)(function(){function V(Oe){var pe=Ut&&Oe.detail<0,at=Bt&&Oe.detail>0;Tt&&!pe&&!at&&Oe.preventDefault()}var j=Pr.current;return j.addEventListener("wheel",jr,{passive:!1}),j.addEventListener("DOMMouseScroll",Xr,{passive:!0}),j.addEventListener("MozMousePixelScroll",V,{passive:!1}),function(){j.removeEventListener("wheel",jr),j.removeEventListener("DOMMouseScroll",Xr),j.removeEventListener("MozMousePixelScroll",V)}},[Tt,Ut,Bt]),(0,Fe.Z)(function(){if(oe){var V=pr(Kt);Fr(V),_t({x:V})}},[Re.width,oe]);var dr=function(){var j,Oe;(j=Ee.current)===null||j===void 0||j.delayHidden(),(Oe=He.current)===null||Oe===void 0||Oe.delayHidden()},en=fe(Pr,ot,Yt,k,$t,function(){return Ft(!0)},B,dr);M.useImperativeHandle(p,function(){return{nativeElement:Kr.current,getScrollInfo:Lt,scrollTo:function(j){function Oe(pe){return pe&&(0,$.Z)(pe)==="object"&&("left"in pe||"top"in pe)}Oe(j)?(j.left!==void 0&&Fr(pr(j.left)),en(j.top)):en(j)}}}),(0,Fe.Z)(function(){if(Me){var V=ot.slice(Ae,Y+1);Me(V,ot)}},[Ae,Y,ot]);var wr=Ge(ot,$t,Yt,k),Vr=Xe==null?void 0:Xe({start:Ae,end:Y,virtual:sr,offsetX:Kt,offsetY:Ct,rtl:ur,getSize:wr}),Ur=ht(ot,Ae,Y,oe,Kt,it,ne,v),br=null;I&&(br=(0,K.Z)((0,me.Z)({},le?"height":"maxHeight",I),Rt),Tt&&(br.overflowY="hidden",oe&&(br.overflowX="hidden"),ut&&(br.pointerEvents="none")));var ct={};return ur&&(ct.dir="rtl"),M.createElement("div",(0,H.Z)({ref:Kr,style:(0,K.Z)((0,K.Z)({},Q),{},{position:"relative"}),className:fr},ct,lr),M.createElement(q.Z,{onResize:Mt},M.createElement(Ue,{className:"".concat(g,"-holder"),style:br,ref:Pr,onScroll:rr,onMouseEnter:dr},M.createElement(St,{prefixCls:g,height:be,offsetX:Kt,offsetY:Ct,scrollWidth:oe,onInnerResize:Ft,ref:Br,innerProps:gt,rtl:ur,extra:Vr},Ur))),sr&&be>I&&M.createElement(Ve,{ref:Ee,prefixCls:g,scrollOffset:vr,scrollRange:be,rtl:ur,onScroll:cr,onStartMove:qt,onStopMove:d,spinSize:zt,containerSize:Re.height,style:ye==null?void 0:ye.verticalScrollBar,thumbStyle:ye==null?void 0:ye.verticalScrollBarThumb,showScrollBar:ir}),sr&&oe>Re.width&&M.createElement(Ve,{ref:He,prefixCls:g,scrollOffset:Kt,scrollRange:oe,rtl:ur,onScroll:cr,onStartMove:qt,onStopMove:d,spinSize:et,containerSize:Re.width,horizontal:!0,style:ye==null?void 0:ye.horizontalScrollBar,thumbStyle:ye==null?void 0:ye.horizontalScrollBarThumb,showScrollBar:ir}))}var Ie=M.forwardRef(Et);Ie.displayName="List";var or=Ie,tr=or},76374:function(bn,yt,b){"use strict";var H=function(){if(typeof Map!="undefined")return Map;function O(E,A){var X=-1;return E.some(function(z,ke){return z[0]===A?(X=ke,!0):!1}),X}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(A){var X=O(this.__entries__,A),z=this.__entries__[X];return z&&z[1]},E.prototype.set=function(A,X){var z=O(this.__entries__,A);~z?this.__entries__[z][1]=X:this.__entries__.push([A,X])},E.prototype.delete=function(A){var X=this.__entries__,z=O(X,A);~z&&X.splice(z,1)},E.prototype.has=function(A){return!!~O(this.__entries__,A)},E.prototype.clear=function(){this.__entries__.splice(0)},E.prototype.forEach=function(A,X){X===void 0&&(X=null);for(var z=0,ke=this.__entries__;z<ke.length;z++){var L=ke[z];A.call(X,L[1],L[0])}},E}()}(),$=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,K=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")()}(),me=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(K):function(O){return setTimeout(function(){return O(Date.now())},1e3/60)}}(),N=2;function ee(O,E){var A=!1,X=!1,z=0;function ke(){A&&(A=!1,O()),X&&ue()}function L(){me(ke)}function ue(){var Ne=Date.now();if(A){if(Ne-z<N)return;X=!0}else A=!0,X=!1,setTimeout(L,E);z=Ne}return ue}var re=20,Qe=["top","right","bottom","left","width","height","size","weight"],q=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=ee(this.refresh.bind(this),re)}return O.prototype.addObserver=function(E){~this.observers_.indexOf(E)||this.observers_.push(E),this.connected_||this.connect_()},O.prototype.removeObserver=function(E){var A=this.observers_,X=A.indexOf(E);~X&&A.splice(X,1),!A.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(A){return A.gatherActive(),A.hasActive()});return E.forEach(function(A){return A.broadcastActive()}),E.length>0},O.prototype.connect_=function(){!$||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),q?(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(){!$||!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 A=E.propertyName,X=A===void 0?"":A,z=Qe.some(function(ke){return!!~X.indexOf(ke)});z&&this.refresh()},O.getInstance=function(){return this.instance_||(this.instance_=new O),this.instance_},O.instance_=null,O}(),Fe=function(O,E){for(var A=0,X=Object.keys(E);A<X.length;A++){var z=X[A];Object.defineProperty(O,z,{value:E[z],enumerable:!1,writable:!1,configurable:!0})}return O},M=function(O){var E=O&&O.ownerDocument&&O.ownerDocument.defaultView;return E||K},De=ze(0,0,0,0);function R(O){return parseFloat(O)||0}function St(O){for(var E=[],A=1;A<arguments.length;A++)E[A-1]=arguments[A];return E.reduce(function(X,z){var ke=O["border-"+z+"-width"];return X+R(ke)},0)}function Ot(O){for(var E=["top","right","bottom","left"],A={},X=0,z=E;X<z.length;X++){var ke=z[X],L=O["padding-"+ke];A[ke]=R(L)}return A}function ht(O){var E=O.getBBox();return ze(0,0,E.width,E.height)}function Nt(O){var E=O.clientWidth,A=O.clientHeight;if(!E&&!A)return De;var X=M(O).getComputedStyle(O),z=Ot(X),ke=z.left+z.right,L=z.top+z.bottom,ue=R(X.width),Ne=R(X.height);if(X.boxSizing==="border-box"&&(Math.round(ue+ke)!==E&&(ue-=St(X,"left","right")+ke),Math.round(Ne+L)!==A&&(Ne-=St(X,"top","bottom")+L)),!he(O)){var fe=Math.round(ue+ke)-E,je=Math.round(Ne+L)-A;Math.abs(fe)!==1&&(ue-=fe),Math.abs(je)!==1&&(Ne-=je)}return ze(z.left,z.top,ue,Ne)}var st=function(){return typeof SVGGraphicsElement!="undefined"?function(O){return O instanceof M(O).SVGGraphicsElement}:function(O){return O instanceof M(O).SVGElement&&typeof O.getBBox=="function"}}();function he(O){return O===M(O).document.documentElement}function F(O){return $?st(O)?ht(O):Nt(O):De}function wt(O){var E=O.x,A=O.y,X=O.width,z=O.height,ke=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,L=Object.create(ke.prototype);return Fe(L,{x:E,y:A,width:X,height:z,top:A,right:E+X,bottom:z+A,left:E}),L}function ze(O,E,A,X){return{x:O,y:E,width:A,height:X}}var te=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=F(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}(),xt=function(){function O(E,A){var X=wt(A);Fe(this,{target:E,contentRect:X})}return O}(),Ge=function(){function O(E,A,X){if(this.activeObservations_=[],this.observations_=new H,typeof E!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=E,this.controller_=A,this.callbackCtx_=X}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 M(E).Element))throw new TypeError('parameter 1 is not of type "Element".');var A=this.observations_;A.has(E)||(A.set(E,new te(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 M(E).Element))throw new TypeError('parameter 1 is not of type "Element".');var A=this.observations_;A.has(E)&&(A.delete(E),A.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(A){A.isActive()&&E.activeObservations_.push(A)})},O.prototype.broadcastActive=function(){if(this.hasActive()){var E=this.callbackCtx_,A=this.activeObservations_.map(function(X){return new xt(X.target,X.broadcastRect())});this.callback_.call(E,A,E),this.clearActive()}},O.prototype.clearActive=function(){this.activeObservations_.splice(0)},O.prototype.hasActive=function(){return this.activeObservations_.length>0},O}(),J=typeof WeakMap!="undefined"?new WeakMap:new H,dt=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 A=h.getInstance(),X=new Ge(E,A,this);J.set(this,X)}return O}();["observe","unobserve","disconnect"].forEach(function(O){dt.prototype[O]=function(){var E;return(E=J.get(this))[O].apply(E,arguments)}});var Pt=function(){return typeof K.ResizeObserver!="undefined"?K.ResizeObserver:dt}();yt.Z=Pt},16722:function(bn,yt,b){"use strict";b.d(yt,{Z:function(){return Qe}});const H=q=>typeof q=="object"&&q!=null&&q.nodeType===1,$=(q,h)=>(!h||q!=="hidden")&&q!=="visible"&&q!=="clip",K=(q,h)=>{if(q.clientHeight<q.scrollHeight||q.clientWidth<q.scrollWidth){const Fe=getComputedStyle(q,null);return $(Fe.overflowY,h)||$(Fe.overflowX,h)||(M=>{const De=(R=>{if(!R.ownerDocument||!R.ownerDocument.defaultView)return null;try{return R.ownerDocument.defaultView.frameElement}catch(St){return null}})(M);return!!De&&(De.clientHeight<M.scrollHeight||De.clientWidth<M.scrollWidth)})(q)}return!1},me=(q,h,Fe,M,De,R,St,Ot)=>R<q&&St>h||R>q&&St<h?0:R<=q&&Ot<=Fe||St>=h&&Ot>=Fe?R-q-M:St>h&&Ot<Fe||R<q&&Ot>Fe?St-h+De:0,N=q=>{const h=q.parentElement;return h==null?q.getRootNode().host||null:h},ee=(q,h)=>{var Fe,M,De,R;if(typeof document=="undefined")return[];const{scrollMode:St,block:Ot,inline:ht,boundary:Nt,skipOverflowHiddenElements:st}=h,he=typeof Nt=="function"?Nt:Ve=>Ve!==Nt;if(!H(q))throw new TypeError("Invalid target");const F=document.scrollingElement||document.documentElement,wt=[];let ze=q;for(;H(ze)&&he(ze);){if(ze=N(ze),ze===F){wt.push(ze);break}ze!=null&&ze===document.body&&K(ze)&&!K(document.documentElement)||ze!=null&&K(ze,st)&&wt.push(ze)}const te=(M=(Fe=window.visualViewport)==null?void 0:Fe.width)!=null?M:innerWidth,xt=(R=(De=window.visualViewport)==null?void 0:De.height)!=null?R:innerHeight,{scrollX:Ge,scrollY:J}=window,{height:dt,width:Pt,top:O,right:E,bottom:A,left:X}=q.getBoundingClientRect(),{top:z,right:ke,bottom:L,left:ue}=(Ve=>{const xe=window.getComputedStyle(Ve);return{top:parseFloat(xe.scrollMarginTop)||0,right:parseFloat(xe.scrollMarginRight)||0,bottom:parseFloat(xe.scrollMarginBottom)||0,left:parseFloat(xe.scrollMarginLeft)||0}})(q);let Ne=Ot==="start"||Ot==="nearest"?O-z:Ot==="end"?A+L:O+dt/2-z+L,fe=ht==="center"?X+Pt/2-ue+ke:ht==="end"?E+ke:X-ue;const je=[];for(let Ve=0;Ve<wt.length;Ve++){const xe=wt[Ve],{height:Ke,width:We,top:Zt,right:Rt,bottom:Et,left:Ie}=xe.getBoundingClientRect();if(St==="if-needed"&&O>=0&&X>=0&&A<=xt&&E<=te&&(xe===F&&!K(xe)||O>=Zt&&A<=Et&&X>=Ie&&E<=Rt))return je;const or=getComputedStyle(xe),tr=parseInt(or.borderLeftWidth,10),P=parseInt(or.borderTopWidth,10),p=parseInt(or.borderRightWidth,10),C=parseInt(or.borderBottomWidth,10);let g=0,w=0;const I="offsetWidth"in xe?xe.offsetWidth-xe.clientWidth-tr-p:0,k="offsetHeight"in xe?xe.offsetHeight-xe.clientHeight-P-C:0,Z="offsetWidth"in xe?xe.offsetWidth===0?0:We/xe.offsetWidth:0,le="offsetHeight"in xe?xe.offsetHeight===0?0:Ke/xe.offsetHeight:0;if(F===xe)g=Ot==="start"?Ne:Ot==="end"?Ne-xt:Ot==="nearest"?me(J,J+xt,xt,P,C,J+Ne,J+Ne+dt,dt):Ne-xt/2,w=ht==="start"?fe:ht==="center"?fe-te/2:ht==="end"?fe-te:me(Ge,Ge+te,te,tr,p,Ge+fe,Ge+fe+Pt,Pt),g=Math.max(0,g+J),w=Math.max(0,w+Ge);else{g=Ot==="start"?Ne-Zt-P:Ot==="end"?Ne-Et+C+k:Ot==="nearest"?me(Zt,Et,Ke,P,C+k,Ne,Ne+dt,dt):Ne-(Zt+Ke/2)+k/2,w=ht==="start"?fe-Ie-tr:ht==="center"?fe-(Ie+We/2)+I/2:ht==="end"?fe-Rt+p+I:me(Ie,Rt,We,tr,p+I,fe,fe+Pt,Pt);const{scrollLeft:Q,scrollTop:ae}=xe;g=le===0?0:Math.max(0,Math.min(ae+g/le,xe.scrollHeight-Ke/le+k)),w=Z===0?0:Math.max(0,Math.min(Q+w/Z,xe.scrollWidth-We/Z+I)),Ne+=ae-g,fe+=Q-w}je.push({el:xe,top:g,left:w})}return je},re=q=>q===!1?{block:"end",inline:"nearest"}:(h=>h===Object(h)&&Object.keys(h).length!==0)(q)?q:{block:"start",inline:"nearest"};function Qe(q,h){if(!q.isConnected||!(De=>{let R=De;for(;R&&R.parentNode;){if(R.parentNode===document)return!0;R=R.parentNode instanceof ShadowRoot?R.parentNode.host:R.parentNode}return!1})(q))return;const Fe=(De=>{const R=window.getComputedStyle(De);return{top:parseFloat(R.scrollMarginTop)||0,right:parseFloat(R.scrollMarginRight)||0,bottom:parseFloat(R.scrollMarginBottom)||0,left:parseFloat(R.scrollMarginLeft)||0}})(q);if((De=>typeof De=="object"&&typeof De.behavior=="function")(h))return h.behavior(ee(q,h));const M=typeof h=="boolean"||h==null?void 0:h.behavior;for(const{el:De,top:R,left:St}of ee(q,re(h))){const Ot=R-Fe.top+Fe.bottom,ht=St-Fe.left+Fe.right;De.scroll({top:Ot,left:ht,behavior:M})}}}}]);
|