@lunora/studio 1.0.0-alpha.30 → 1.0.0-alpha.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/mount.d.ts +1 -1
- package/dist/mount.js +1 -1
- package/dist/packem_chunks/containers-panel.js +247 -0
- package/dist/packem_chunks/kv-browser.js +1 -1
- package/dist/packem_shared/{HomePanel-c2FodE9t.js → HomePanel-BRcQVDby.js} +1 -1
- package/dist/packem_shared/{Studio-CVTtA_sB.js → Studio-B1V0GxTz.js} +2 -2
- package/dist/packem_shared/{StudioApp-BSYV2fz6.js → StudioApp-CR0Tvy81.js} +1 -1
- package/dist/packem_shared/{app.d-B6MyY_al.d.ts → app.d-CNLRTrWw.d.ts} +1 -1
- package/dist/packem_shared/{home-panel-aOR_drVv.js → home-panel-CRIs6x2j.js} +2 -0
- package/dist/packem_shared/{studio-dMTJ-kRR.js → studio-CQ-rtNhn.js} +582 -556
- package/dist/standalone/chunk-45QK5ZPN.js +1 -0
- package/dist/standalone/{chunk-D7HKX4DI.js → chunk-D6ORSB24.js} +1 -1
- package/dist/standalone/{chunk-HFMQNUBC.js → chunk-KNRVPCFX.js} +1 -1
- package/dist/standalone/chunk-LZWPCZLE.js +1 -0
- package/dist/standalone/{chunk-MGFEVTRI.js → chunk-W5LWN6IP.js} +1 -1
- package/dist/standalone/{chunk-E7AVZZKO.js → chunk-W7SQVLBH.js} +1 -1
- package/dist/standalone/studio.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/standalone/chunk-GABMIICA.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Bn}from"./chunk-ZPUO7FNI.js";import{a as oo,b as so,c as ro,d as En,e as is}from"./chunk-ITLLHEVG.js";import{A as Wo,B as hn,C as Gt,E as vn,F as j,G as xn,H as bn,K as Kt,N as ft,O as Zo,P as Qt,R as qo,S as yn,T as Pn,U as Go,V as Yt,W as Jt,X as Xt,Y as eo,Z as Ko,_ as to,aa as Cn,b as on,ba as Rn,ca as Qo,da as Yo,ga as Jo,ha as tt,i as ln,ia as Sn,j as dn,ja as no,k as cn,ka as Nn,la as ue,n as qs,na as Xo,o as $o,pa as es,q as jo,qa as ts,r as pn,ra as os,s as zo,sa as ss,ta as rs,u as un,ua as ns,va as Tn,w as fn,wa as wn,x as mn,xa as as,y as gn,ya as kn,z as Uo}from"./chunk-NNISYDNI.js";import{f as Yr}from"./chunk-UII66UVF.js";import{a as Vn}from"./chunk-7TJJXVSE.js";import{a as Hr,b as $r,d as jr,e as pt,f as Fo,g as zr,h as Ur,i as Wr,j as Zr,k as qr}from"./chunk-SVR644RF.js";import{a as ls}from"./chunk-KZ6INM5M.js";import{c as On,h as Mn,k as Gs}from"./chunk-4QHKBC77.js";import{B as sn,C as rn,I as He,J as nn,K as qt,O as A,P as Y,R as an,e as ye,p as ho,q as tn}from"./chunk-BHTPZS7L.js";import{b as mt,c as Ks}from"./chunk-YQQJ4N6U.js";import{a as ut,c as Xr,h as Ho,i as en}from"./chunk-TICVNLPM.js";import{a as Fr}from"./chunk-HV7G6DFP.js";import{a as Rt}from"./chunk-AQGOX5DK.js";import{a as In}from"./chunk-TAD43CG5.js";import{b as ao}from"./chunk-FCR3HKFV.js";import{a as gt,e as Qs}from"./chunk-SEU5V7I6.js";import{a as Zs,b as go}from"./chunk-O4PXDNR3.js";import{a as it,i as Ct,j as F,k as Jr}from"./chunk-ZH7UES4T.js";import{f as Ws}from"./chunk-KODWGUAB.js";import{a as be}from"./chunk-3OA7PECS.js";import{a as Gr,b as Kr,c as Qr,d as ie,e as Dn,f as _n,i as $e,k as An}from"./chunk-YJGANMU7.js";import{a,d as Us,e as R,f as M,g as Lo,h as mo,j as U}from"./chunk-RRCPZMC2.js";var B=R(Lo(),1);var ct=R(M(),1),q=R(M(),1);var i=R(mo(),1);var Ln=R(M(),1),ht=R(mo(),1);var mi={border:"1px solid var(--destructive)",color:"var(--destructive)",padding:12},gi={overflow:"auto",whiteSpace:"pre-wrap"},ds=class extends Ln.Component{static{a(this,"ErrorBoundary")}static getDerivedStateFromError(e){return{error:e}}state={error:null};componentDidCatch(e,o){console.error("[lunora-studio] panel error",e,o.componentStack)}reset=a(()=>{this.setState({error:null})},"reset");render(){let{children:e,fallbackTitle:o,label:s,retryLabel:r}=this.props,{error:n}=this.state;if(n===null)return(0,ht.jsxDEV)(ht.Fragment,{children:e},void 0,!1);let l=o??(s===void 0?"Something went wrong":`${s} failed`);return(0,ht.jsxDEV)("div",{"data-testid":"dash-error-boundary",role:"alert",style:mi,children:[(0,ht.jsxDEV)("strong",{children:l},void 0,!1),(0,ht.jsxDEV)("pre",{"data-testid":"dash-error-message",style:gi,children:n.message},void 0,!1),(0,ht.jsxDEV)("button",{"data-testid":"dash-error-retry",onClick:this.reset,type:"button",children:r??"Try again"},void 0,!1)]},void 0,!0)}};var yt={};Us(yt,{Arrow:()=>rr,Backdrop:()=>nr,Close:()=>lr,Description:()=>ir,Handle:()=>xo,Popup:()=>sr,Portal:()=>Xs,Positioner:()=>er,Root:()=>$n,Title:()=>ar,Trigger:()=>Ys,Viewport:()=>dr,createHandle:()=>ta});var lt=R(M(),1);var cs=R(M(),1);var ps=cs.createContext(void 0);ps.displayName="PopoverRootContext";function oe(t){let e=cs.useContext(ps);if(e===void 0&&!t)throw new Error("Base UI: PopoverRootContext is missing. Popover parts must be placed within <Popover.Root>.");return e}a(oe,"usePopoverRootContext");var vt=R(M(),1),Fn=R(Fr(),1);function hi(){return{...oo(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}a(hi,"createInitialState");var vi={...ro,disabled:j(t=>t.disabled),instantType:j(t=>t.instantType),openMethod:j(t=>t.openMethod),openChangeReason:j(t=>t.openChangeReason),modal:j(t=>t.modal),focusManagerModal:j(t=>t.focusManagerModal),stickIfOpen:j(t=>t.stickIfOpen),titleElementId:j(t=>t.titleElementId),descriptionElementId:j(t=>t.descriptionElementId),openOnHover:j(t=>t.openOnHover),closeDelay:j(t=>t.closeDelay),hasViewport:j(t=>t.hasViewport)},io=class t extends Kt{static{a(this,"PopoverStore")}constructor(e,o,s=!1){let r={...hi(),...e},n=new to;r.open&&e?.mounted===void 0&&(r.mounted=!0),r.floatingRootContext=so(n,o,s),super(r,{popupRef:vt.createRef(),backdropRef:vt.createRef(),internalBackdropRef:vt.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:vt.createRef(),beforeContentFocusGuardRef:vt.createRef(),stickIfOpenTimeout:new sn,triggerElements:n},vi)}setOpen=a((e,o)=>{let s=o.reason===A.triggerHover,r=o.reason===A.triggerPress&&o.event.detail===0,n=!e&&(o.reason===A.escapeKey||o.reason==null),l=yn(o),c=this.select("activeTriggerId");if(!e&&o.reason===A.closePress&&o.trigger==null&&c!=null&&(o.trigger=this.context.triggerElements.getById(c)??this.select("activeTriggerElement")??void 0),this.context.onOpenChange?.(e,o),o.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,o);let p=a(()=>{let d={open:e,openChangeReason:o.reason};qo(d,e,o.trigger,l()),this.update(d)},"changeState");s?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set("stickIfOpen",!1)}),Fn.flushSync(p)):p(),r||n?this.set("instantType",r?"click":"dismiss"):o.reason===A.focusOut?this.set("instantType","focus"):this.set("instantType",void 0)},"setOpen");static useStore(e,o){let{store:s,internalStore:r}=Qt(e,(n,l)=>new t(o,n,l));return vt.useEffect(()=>r?.disposeEffect(),[r]),s}disposeEffect=a(()=>this.context.stickIfOpenTimeout.disposeEffect(),"disposeEffect")};var St=R(be(),1);function Hn({props:t}){let{children:e,open:o,defaultOpen:s=!1,onOpenChange:r,onOpenChangeComplete:n,modal:l=!1,handle:c,triggerId:p,defaultTriggerId:d=null}=t,u=io.useStore(c?.store,{modal:l,open:s,openProp:o,activeTriggerId:d,triggerIdProp:p});Go(u,o,s,d),u.useControlledProp("openProp",o),u.useControlledProp("triggerIdProp",p);let g=u.useState("open"),m=u.useState("mounted"),h=u.useState("payload"),f=un()!=null;u.useContextCallback("onOpenChange",r),u.useContextCallback("onOpenChangeComplete",n),Ko(u,g),Jt(u);let{forceUnmount:v}=Xt(g,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});u.useSyncedValues({modal:l,nested:f}),lt.useEffect(()=>{g||u.context.stickIfOpenTimeout.clear()},[u,g]);let x=lt.useCallback(()=>{u.setOpen(!1,Y(A.imperativeAction))},[u]);lt.useImperativeHandle(t.actionsRef,()=>({unmount:v,close:x}),[v,x]);let b=g||m,C=lt.useMemo(()=>({store:u}),[u]);return(0,St.jsxs)(ps.Provider,{value:C,children:[b&&(0,St.jsx)(xi,{store:u,modal:l}),typeof e=="function"?e({payload:h}):e]})}a(Hn,"PopoverRootComponent");function $n(t){return oe(!0)?(0,St.jsx)(Hn,{props:t}):(0,St.jsx)(gn,{children:(0,St.jsx)(Hn,{props:t})})}a($n,"PopoverRoot");function xi({store:t,modal:e}){let o=t.useState("floatingRootContext"),s=Gt(o,{outsidePressEvent:{mouse:e==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),r=s.reference??Ct,n=s.trigger??Ct,l=lt.useMemo(()=>it(ft,s.floating),[s.floating]);return eo(t,{activeTriggerProps:r,inactiveTriggerProps:n,popupProps:l}),null}a(xi,"PopoverInteractions");var xt=R(M(),1);var Nt=R(be(),1);var Ys=xt.forwardRef(a(function(e,o){let{render:s,className:r,style:n,disabled:l=!1,nativeButton:c=!0,handle:p,payload:d,openOnHover:u=!1,delay:g=300,closeDelay:m=0,id:h,...f}=e,v=oe(!0),x=p?.store??v?.store;if(!x)throw new Error("Base UI: <Popover.Trigger> must be either used within a <Popover.Root> component or provided with a handle.");let b=ye(h),C=x.useState("isTriggerActive",b),P=x.useState("floatingRootContext"),N=x.useState("isOpenedByTrigger",b),S=x.useState("triggerPopupId",b),E=xt.useRef(null),{registerTrigger:T,isMountedByThisTrigger:k}=Yt(b,E,x,{payload:d,disabled:l,openOnHover:u,closeDelay:m}),w=x.useState("openChangeReason"),O=x.useState("stickIfOpen"),V=x.useState("openMethod"),W=x.useState("focusManagerModal"),_=Yo(P,{enabled:!l&&P!=null&&u&&(V!=="touch"||w!==A.triggerPress),mouseOnly:!0,move:!1,handleClose:Jo(),restMs:g,delay:{close:m},triggerElementRef:E,isActiveTrigger:C,isClosing:a(()=>x.select("transitionStatus")==="ending","isClosing")}),H=Wo(P,{enabled:P!=null,stickIfOpen:O}),$=Xo(()=>x.select("open"),ee=>{x.set("openMethod",ee)}),Z=x.useState("triggerProps",k),{getButtonProps:K,buttonRef:D}=mt({disabled:l,native:c}),I={open(ee){return ee&&w===A.triggerPress?Nn.open(ee):no.open(ee)}},{preFocusGuardRef:z,handlePreFocusGuardFocus:te,handleFocusTargetFocus:re}=En(x,E),J=F("button",e,{state:{disabled:l,open:N},ref:[D,o,T,E],props:[H.reference,_,Z,$,{[$o]:"",id:b,"aria-haspopup":"dialog","aria-expanded":N,"aria-controls":S},f,K],stateAttributesMapping:I});return k&&!W?(0,Nt.jsxs)(xt.Fragment,{children:[(0,Nt.jsx)(qs,{ref:z,onFocus:te}),(0,Nt.jsx)(xt.Fragment,{children:J},b),(0,Nt.jsx)(qs,{ref:x.context.triggerFocusTargetRef,onFocus:re})]}):(0,Nt.jsx)(xt.Fragment,{children:J},b)},"PopoverTrigger"));Ys.displayName="PopoverTrigger";var zn=R(M(),1);var us=R(M(),1);var fs=us.createContext(void 0);fs.displayName="PopoverPortalContext";function jn(){let t=us.useContext(fs);if(t===void 0)throw new Error("Base UI: <Popover.Portal> is missing.");return t}a(jn,"usePopoverPortalContext");var Js=R(be(),1);var Xs=zn.forwardRef(a(function(e,o){let{keepMounted:s=!1,...r}=e,{store:n}=oe();return n.useState("mounted")||s?(0,Js.jsx)(fs.Provider,{value:s,children:(0,Js.jsx)(zo,{ref:o,...r})}):null},"PopoverPortal"));Xs.displayName="PopoverPortal";var co=R(M(),1);var ms=R(M(),1);var gs=ms.createContext(void 0);gs.displayName="PopoverPositionerContext";function lo(){let t=ms.useContext(gs);if(!t)throw new Error("Base UI: PopoverPositionerContext is missing. PopoverPositioner parts must be placed within <Popover.Positioner>.");return t}a(lo,"usePopoverPositionerContext");var vo=R(be(),1);var er=co.forwardRef(a(function(e,o){let{render:s,className:r,style:n,anchor:l,positionMethod:c="absolute",side:p="bottom",align:d="center",sideOffset:u=0,alignOffset:g=0,collisionBoundary:m="clipping-ancestors",collisionPadding:h=5,arrowPadding:f=5,sticky:v=!1,disableAnchorTracking:x=!1,collisionAvoidance:b=jo,...C}=e,{store:P}=oe(),N=jn(),S=fn(),E=P.useState("floatingRootContext"),T=P.useState("mounted"),k=P.useState("open"),w=P.useState("openChangeReason"),O=P.useState("activeTriggerElement"),V=P.useState("modal"),W=P.useState("openMethod"),_=P.useState("positionerElement"),H=P.useState("instantType"),$=P.useState("transitionStatus"),Z=P.useState("hasViewport"),K=co.useRef(null),D=nn(_,!1,!1),I=os({anchor:l,floatingRootContext:E,positionMethod:c,mounted:T,side:p,sideOffset:u,align:d,alignOffset:g,arrowPadding:f,collisionBoundary:m,collisionPadding:h,sticky:v,disableAnchorTracking:x,keepMounted:N,nodeId:S,collisionAvoidance:b,adaptiveOrigin:Z?ts:void 0}),z=E.useState("domReferenceElement");ut(()=>{let J=z,ee=K.current;if(J&&(K.current=J),ee&&J&&J!==ee){P.set("instantType",void 0);let ae=new AbortController;return D(()=>{P.set("instantType","trigger-change")},ae.signal),()=>{ae.abort()}}},[z,D,P]),wn(k&&V===!0&&w!==A.triggerHover,W==="touch",_,O);let te=co.useCallback(J=>{P.set("positionerElement",J)},[P]),re={open:k,side:I.side,align:I.align,anchorHidden:I.anchorHidden,instant:H},ne=ns(e,re,{styles:I.positionerStyles,transitionStatus:$,props:C,refs:[o,te],hidden:!T,inert:!k});return(0,vo.jsxs)(gs.Provider,{value:I,children:[T&&V===!0&&w!==A.triggerHover&&(0,vo.jsx)(ss,{ref:P.context.internalBackdropRef,inert:es(!k),cutout:O}),(0,vo.jsx)(mn,{id:S,children:ne})]})},"PopoverPositioner"));er.displayName="PopoverPositioner";var hs=R(M(),1);var bt=R(M(),1);var Un=R(be(),1);var tr=bt.createContext(void 0);tr.displayName="ClosePartContext";function Wn(){let[t,e]=bt.useState(0),o=Xr(()=>(e(r=>r+1),()=>{e(r=>Math.max(0,r-1))}));return{context:bt.useMemo(()=>({register:o}),[o]),hasClosePart:t>0}}a(Wn,"useClosePartCount");function Zn(t){let{value:e,children:o}=t;return(0,Un.jsx)(tr.Provider,{value:e,children:o})}a(Zn,"ClosePartProvider");function qn(){let t=bt.useContext(tr);ut(()=>t?.register(),[t])}a(qn,"useClosePartRegistration");var or=R(be(),1);var bi={...ue,...He},sr=hs.forwardRef(a(function(e,o){let{render:s,className:r,style:n,initialFocus:l,finalFocus:c,...p}=e,{store:d}=oe(),u=lo(),g=kn(!0)!=null,{context:m,hasClosePart:h}=Wn(),f=d.useState("open"),v=d.useState("openMethod"),x=d.useState("instantType"),b=d.useState("transitionStatus"),C=d.useState("popupProps"),P=d.useState("titleElementId"),N=d.useState("descriptionElementId"),S=d.useState("modal"),E=d.useState("mounted"),T=d.useState("openChangeReason"),k=d.useState("activeTriggerElement"),w=d.useState("floatingRootContext"),O=w.useState("floatingId"),V=d.useState("disabled"),W=d.useState("openOnHover"),_=d.useState("closeDelay"),H=p.id??O;qt({open:f,ref:d.context.popupRef,onComplete(){f&&d.context.onOpenChangeComplete?.(!0)}}),Qo(w,{enabled:W&&!V,closeDelay:_});let $=l===void 0?Zo(d.context.popupRef):l,Z=S!==!1&&h;d.useSyncedValue("focusManagerModal",Z);let K=hs.useCallback(z=>{d.set("popupElement",z)},[d]),D={open:f,side:u.side,align:u.align,instant:x,transitionStatus:b},I=F("div",e,{state:D,ref:[o,d.context.popupRef,K],props:[C,{id:H,role:"dialog",...ft,"aria-labelledby":P,"aria-describedby":N,onKeyDown(z){g&&as.has(z.key)&&z.stopPropagation()}},rs(b),p],stateAttributesMapping:bi});return(0,or.jsx)(Uo,{context:w,openInteractionType:v,modal:Z,disabled:!E||T===A.triggerHover,initialFocus:$,returnFocus:c,restoreFocus:"popup",previousFocusableElement:en(k)?k:void 0,nextFocusableElement:d.context.triggerFocusTargetRef,beforeContentFocusGuardRef:d.context.beforeContentFocusGuardRef,children:(0,or.jsx)(Zn,{value:m,children:I})})},"PopoverPopup"));sr.displayName="PopoverPopup";var Gn=R(M(),1);var rr=Gn.forwardRef(a(function(e,o){let{render:s,className:r,style:n,...l}=e,{store:c}=oe(),p=c.useState("open"),{arrowRef:d,side:u,align:g,arrowUncentered:m,arrowStyles:h}=lo();return F("div",e,{state:{open:p,side:u,align:g,uncentered:m},ref:[o,d],props:[{style:h,"aria-hidden":!0},l],stateAttributesMapping:ue})},"PopoverArrow"));rr.displayName="PopoverArrow";var Kn=R(M(),1);var yi={...ue,...He},nr=Kn.forwardRef(a(function(e,o){let{render:s,className:r,style:n,...l}=e,{store:c}=oe(),p=c.useState("open"),d=c.useState("mounted"),u=c.useState("transitionStatus"),g=c.useState("openChangeReason");return F("div",e,{state:{open:p,transitionStatus:u},ref:[c.context.backdropRef,o],props:[{role:"presentation",hidden:!d,style:{pointerEvents:g===A.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},l],stateAttributesMapping:yi})},"PopoverBackdrop"));nr.displayName="PopoverBackdrop";var Qn=R(M(),1);var ar=Qn.forwardRef(a(function(e,o){let{render:s,className:r,style:n,...l}=e,{store:c}=oe(),p=ye(l.id);return c.useSyncedValueWithCleanup("titleElementId",p),F("h2",e,{ref:o,props:[{id:p},l]})},"PopoverTitle"));ar.displayName="PopoverTitle";var Yn=R(M(),1);var ir=Yn.forwardRef(a(function(e,o){let{render:s,className:r,style:n,...l}=e,{store:c}=oe(),p=ye(l.id);return c.useSyncedValueWithCleanup("descriptionElementId",p),F("p",e,{ref:o,props:[{id:p},l]})},"PopoverDescription"));ir.displayName="PopoverDescription";var Jn=R(M(),1);var lr=Jn.forwardRef(a(function(e,o){let{render:s,className:r,style:n,disabled:l=!1,nativeButton:c=!0,...p}=e,{buttonRef:d,getButtonProps:u}=mt({disabled:l,focusableWhenDisabled:!1,native:c}),{store:g}=oe();return qn(),F("button",e,{ref:[o,d],props:[{onClick(h){g.setOpen(!1,Y(A.closePress,h.nativeEvent))}},p,u]})},"PopoverClose"));lr.displayName="PopoverClose";var ea=R(M(),1);var Xn=(function(t){return t.popupWidth="--popup-width",t.popupHeight="--popup-height",t})({});var Pi={activationDirection:a(t=>t?{"data-activation-direction":t}:null,"activationDirection")},dr=ea.forwardRef(a(function(e,o){let{render:s,className:r,style:n,children:l,...c}=e,{store:p}=oe(),{side:d}=lo(),u=p.useState("instantType"),{children:g,state:m}=is({store:p,side:d,cssVars:Xn,children:l}),h={activationDirection:m.activationDirection,transitioning:m.transitioning,instant:u};return F("div",e,{state:h,ref:o,props:[c,{children:g}],stateAttributesMapping:Pi})},"PopoverViewport"));dr.displayName="PopoverViewport";var xo=class{static{a(this,"PopoverHandle")}constructor(){this.store=new io}open(e){let o=e?this.store.context.triggerElements.getById(e)??void 0:void 0;if(e&&!o)throw new Error(`Base UI: PopoverHandle.open: No trigger found with id "${e}".`);this.store.setOpen(!0,Y(A.imperativeAction,void 0,o))}close(){this.store.setOpen(!1,Y(A.imperativeAction,void 0,void 0))}get isOpen(){return this.store.select("open")}};function ta(){return new xo}a(ta,"createPopoverHandle");var fe={};Us(fe,{Backdrop:()=>cr,Close:()=>pr,Description:()=>ur,Handle:()=>Ro,Popup:()=>fr,Portal:()=>mr,Root:()=>ga,Title:()=>vr,Trigger:()=>xr,Viewport:()=>hr,createHandle:()=>xa});var oa=R(M(),1);var bo=R(M(),1);var yo=bo.createContext(!1);yo.displayName="IsDrawerContext";var vs=bo.createContext(void 0);vs.displayName="DialogRootContext";function le(t){let e=bo.useContext(vs);if(t===!1&&e===void 0)throw new Error("Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.");return e}a(le,"useDialogRootContext");var Ci={...ue,...He},cr=oa.forwardRef(a(function(e,o){let{render:s,className:r,style:n,forceRender:l=!1,...c}=e,{store:p}=le(),d=p.useState("open"),u=p.useState("nested"),g=p.useState("mounted"),m=p.useState("transitionStatus");return F("div",e,{state:{open:d,transitionStatus:m},ref:[p.context.backdropRef,o],stateAttributesMapping:Ci,props:[{role:"presentation",hidden:!g,style:{userSelect:"none",WebkitUserSelect:"none"}},c],enabled:l||!u})},"DialogBackdrop"));cr.displayName="DialogBackdrop";var sa=R(M(),1);var pr=sa.forwardRef(a(function(e,o){let{render:s,className:r,style:n,disabled:l=!1,nativeButton:c=!0,...p}=e,{store:d}=le(),u=d.useState("open"),{getButtonProps:g,buttonRef:m}=mt({disabled:l,native:c}),h={disabled:l};function f(v){u&&d.setOpen(!1,Y(A.closePress,v.nativeEvent))}return a(f,"handleClick"),F("button",e,{state:h,ref:[o,m],props:[{onClick:f},p,g]})},"DialogClose"));pr.displayName="DialogClose";var ra=R(M(),1);var ur=ra.forwardRef(a(function(e,o){let{render:s,className:r,style:n,id:l,...c}=e,{store:p}=le(),d=ye(l);return p.useSyncedValueWithCleanup("descriptionElementId",d),F("p",e,{ref:o,props:[{id:d},c]})},"DialogDescription"));ur.displayName="DialogDescription";var ia=R(M(),1);var na=(function(t){return t.nestedDialogs="--nested-dialogs",t})({});var aa=(function(t){return t[t.open=tt.open]="open",t[t.closed=tt.closed]="closed",t[t.startingStyle=tt.startingStyle]="startingStyle",t[t.endingStyle=tt.endingStyle]="endingStyle",t.nested="data-nested",t.nestedDialogOpen="data-nested-dialog-open",t})({});var xs=R(M(),1);var bs=xs.createContext(void 0);bs.displayName="DialogPortalContext";function ys(){let t=xs.useContext(bs);if(t===void 0)throw new Error("Base UI: <Dialog.Portal> is missing.");return t}a(ys,"useDialogPortalContext");var la=R(be(),1);var Ri={...ue,...He,nestedDialogOpen(t){return t?{[aa.nestedDialogOpen]:""}:null}},fr=ia.forwardRef(a(function(e,o){let{render:s,className:r,style:n,finalFocus:l,initialFocus:c,...p}=e,{store:d}=le(),u=d.useState("descriptionElementId"),g=d.useState("disablePointerDismissal"),m=d.useState("floatingRootContext"),h=d.useState("popupProps"),f=d.useState("modal"),v=d.useState("mounted"),x=d.useState("nested"),b=d.useState("nestedOpenDialogCount"),C=d.useState("open"),P=d.useState("openMethod"),N=d.useState("titleElementId"),S=d.useState("transitionStatus"),E=d.useState("role"),T=m.useState("floatingId"),k=p.id??T;ys(),qt({open:C,ref:d.context.popupRef,onComplete(){C&&d.context.onOpenChangeComplete?.(!0)}});let w=c===void 0?Zo(d.context.popupRef):c,O=b>0,V=d.useStateSetter("popupElement"),_=F("div",e,{state:{open:C,nested:x,transitionStatus:S,nestedDialogOpen:O},props:[h,{id:k,"aria-labelledby":N??void 0,"aria-describedby":u??void 0,role:E,...ft,hidden:!v,onKeyDown(H){as.has(H.key)&&H.stopPropagation()},style:{[na.nestedDialogs]:b}},p],ref:[o,d.context.popupRef,V],stateAttributesMapping:Ri});return(0,la.jsx)(Uo,{context:m,openInteractionType:P,disabled:!v,closeOnFocusOut:!g,initialFocus:w,returnFocus:l,modal:f!==!1,restoreFocus:"popup",children:_})},"DialogPopup"));fr.displayName="DialogPopup";var da=R(M(),1);var Po=R(be(),1);var mr=da.forwardRef(a(function(e,o){let{keepMounted:s=!1,...r}=e,{store:n}=le(),l=n.useState("mounted"),c=n.useState("modal"),p=n.useState("open");return l||s?(0,Po.jsx)(bs.Provider,{value:s,children:(0,Po.jsxs)(zo,{ref:o,...r,children:[l&&c===!0&&(0,Po.jsx)(ss,{ref:n.context.internalBackdropRef,inert:es(!p)}),e.children]})}):null},"DialogPortal"));mr.displayName="DialogPortal";var ma=R(M(),1);var ua=R(M(),1);var dt=R(M(),1);function ca(t){let{store:e,actionsRef:o}=t,s=e.useState("open");Ko(e,s),Jt(e);let{forceUnmount:r}=Xt(s,e),n=dt.useCallback(()=>{e.setOpen(!1,Y(A.imperativeAction))},[e]);dt.useImperativeHandle(o,()=>({unmount:r,close:n}),[r,n])}a(ca,"useDialogRoot");function pa({store:t,parentContext:e,isDrawer:o}){let s=t.useState("open"),r=t.useState("disablePointerDismissal"),n=t.useState("modal"),l=t.useState("popupElement"),c=t.useState("floatingRootContext"),[p,d]=dt.useState(0),[u,g]=dt.useState(0),m=p===0,h=Gt(c,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:n==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(b){if(!t.context.outsidePressEnabledRef.current||"button"in b&&b.button!==0||"touches"in b&&b.touches.length!==1)return!1;let C=tn(b);return m&&!r?n&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===C||t.context.backdropRef.current===C||ho(C,l)&&!C?.hasAttribute("data-base-ui-portal"):!0:!1},escapeKey:m});Tn(s&&n===!0,l),t.useContextCallback("onNestedDialogOpen",(b,C)=>{d(b),g(C)}),t.useContextCallback("onNestedDialogClose",()=>{d(0),g(0)}),dt.useEffect(()=>(e?.onNestedDialogOpen&&s&&e.onNestedDialogOpen(p+1,u+(o?1:0)),e?.onNestedDialogClose&&!s&&e.onNestedDialogClose(),()=>{e?.onNestedDialogClose&&s&&e.onNestedDialogClose()}),[o,s,p,u,e]);let f=h.reference??Ct,v=h.trigger??Ct,x=h.floating??Ct;return eo(t,{activeTriggerProps:f,inactiveTriggerProps:v,popupProps:x,nestedOpenDialogCount:p,nestedOpenDrawerCount:u}),null}a(pa,"DialogInteractions");var Ps=R(M(),1);var Si={...ro,modal:j(t=>t.modal),nested:j(t=>t.nested),nestedOpenDialogCount:j(t=>t.nestedOpenDialogCount),nestedOpenDrawerCount:j(t=>t.nestedOpenDrawerCount),disablePointerDismissal:j(t=>t.disablePointerDismissal),openMethod:j(t=>t.openMethod),descriptionElementId:j(t=>t.descriptionElementId),titleElementId:j(t=>t.titleElementId),viewportElement:j(t=>t.viewportElement),role:j(t=>t.role)},po=class t extends Kt{static{a(this,"DialogStore")}constructor(e,o,s=!1){let r=new to,n=Ni(e);n.floatingRootContext=so(r,o,s),super(n,{popupRef:Ps.createRef(),backdropRef:Ps.createRef(),internalBackdropRef:Ps.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:r,onOpenChange:void 0,onOpenChangeComplete:void 0},Si)}setOpen=a((e,o)=>{if(o.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!e&&o.trigger==null&&this.state.activeTriggerId!=null&&(o.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,o),o.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,o);let s={open:e};qo(s,e,o.trigger),this.update(s)},"setOpen");static useStore(e,o){return Qt(e,(r,n)=>new t(o,r,n),!0).store}};function Ni(t={}){return{...oo(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...t}}a(Ni,"createInitialState");var Co=R(be(),1);function fa(t,e="dialog"){let{children:o,open:s,defaultOpen:r=!1,onOpenChange:n,onOpenChangeComplete:l,disablePointerDismissal:c=!1,modal:p=!0,actionsRef:d,handle:u,triggerId:g,defaultTriggerId:m=null}=t,h=e==="drawer",f=e==="alert-dialog",v=f?!0:p,x=f||c,b=f?"alertdialog":"dialog",C=le(!0),N={modal:v,disablePointerDismissal:x,nested:!!C,role:b},S=po.useStore(u?.store,{open:r,openProp:s,activeTriggerId:m,triggerIdProp:g,...N});vn(()=>{let V=s===void 0&&S.state.open===!1&&r===!0?{open:!0,activeTriggerId:m}:null;f?S.update(V?{...N,...V}:N):V&&S.update(V)}),S.useControlledProp("openProp",s),S.useControlledProp("triggerIdProp",g),S.useSyncedValues(N),S.useContextCallback("onOpenChange",n),S.useContextCallback("onOpenChangeComplete",l);let E=S.useState("open"),T=S.useState("mounted"),k=S.useState("payload");ca({store:S,actionsRef:d});let w=E||T,O=ua.useMemo(()=>({store:S}),[S]);return(0,Co.jsx)(yo.Provider,{value:!1,children:(0,Co.jsxs)(vs.Provider,{value:O,children:[w&&(0,Co.jsx)(pa,{store:S,parentContext:C?.store.context,isDrawer:h}),typeof o=="function"?o({payload:k}):o]})})}a(fa,"useRenderDialogRoot");function ga(t){let e=ma.useContext(yo)?"drawer":"dialog";return fa(t,e)}a(ga,"DialogRoot");var ha=R(M(),1);var gr=(function(t){return t[t.open=tt.open]="open",t[t.closed=tt.closed]="closed",t[t.startingStyle=tt.startingStyle]="startingStyle",t[t.endingStyle=tt.endingStyle]="endingStyle",t.nested="data-nested",t.nestedDialogOpen="data-nested-dialog-open",t})({});var Ei={...ue,...He,nested(t){return t?{[gr.nested]:""}:null},nestedDialogOpen(t){return t?{[gr.nestedDialogOpen]:""}:null}},hr=ha.forwardRef(a(function(e,o){let{render:s,className:r,style:n,children:l,...c}=e,p=ys(),{store:d}=le(),u=d.useState("open"),g=d.useState("nested"),m=d.useState("transitionStatus"),h=d.useState("nestedOpenDialogCount"),f=d.useState("mounted"),v=d.useStateSetter("viewportElement"),x=h>0;return F("div",e,{enabled:p||f,state:{open:u,nested:g,transitionStatus:m,nestedDialogOpen:x},ref:[o,v],stateAttributesMapping:Ei,props:[{role:"presentation",hidden:!f,style:{pointerEvents:u?void 0:"none"},children:l},c]})},"DialogViewport"));hr.displayName="DialogViewport";var va=R(M(),1);var vr=va.forwardRef(a(function(e,o){let{render:s,className:r,style:n,id:l,...c}=e,{store:p}=le(),d=ye(l);return p.useSyncedValueWithCleanup("titleElementId",d),F("h2",e,{ref:o,props:[{id:d},c]})},"DialogTitle"));vr.displayName="DialogTitle";var Cs=R(M(),1);var xr=Cs.forwardRef(a(function(e,o){let{render:s,className:r,style:n,disabled:l=!1,nativeButton:c=!0,id:p,payload:d,handle:u,...g}=e,m=le(!0),h=u?.store??m?.store;if(!h)throw new Error("Base UI: <Dialog.Trigger> must be used within <Dialog.Root> or provided with a handle.");let f=ye(p),v=h.useState("floatingRootContext"),x=h.useState("isOpenedByTrigger",f),b=h.useState("triggerPopupId",f),C=Cs.useRef(null),{registerTrigger:P,isMountedByThisTrigger:N}=Yt(f,C,h,{payload:d}),{getButtonProps:S,buttonRef:E}=mt({disabled:l,native:c}),T=Wo(v,{enabled:v!=null}),k=Xo(()=>h.select("open"),V=>{h.set("openMethod",V)}),w={disabled:l,open:x},O=h.useState("triggerProps",N);return F("button",e,{state:w,ref:[E,o,P,C],props:[T.reference,O,k,{[$o]:"",id:f,"aria-haspopup":"dialog","aria-expanded":x,"aria-controls":b},g,S],stateAttributesMapping:no})},"DialogTrigger"));xr.displayName="DialogTrigger";var Ro=class{static{a(this,"DialogHandle")}constructor(e){this.store=e??new po}open(e){let o=e?this.store.context.triggerElements.getById(e):void 0;e&&!o&&console.warn(`Base UI: DialogHandle.open: No trigger found with id "${e}". The dialog will open, but the trigger will not be associated with the dialog.`),this.store.setOpen(!0,Y(A.imperativeAction,void 0,o))}openWithPayload(e){this.store.set("payload",e),this.store.setOpen(!0,Y(A.imperativeAction,void 0,void 0))}close(){this.store.setOpen(!1,Y(A.imperativeAction,void 0,void 0))}get isOpen(){return this.store.select("open")}};function xa(){return new Ro}a(xa,"createDialogHandle");var st={};Us(st,{Arrow:()=>Er,Handle:()=>So,Popup:()=>Nr,Portal:()=>Rr,Positioner:()=>Sr,Provider:()=>kr,Root:()=>br,Trigger:()=>yr,Viewport:()=>Or,createHandle:()=>Da});var ot=R(M(),1);var Rs=R(M(),1);var Ss=Rs.createContext(void 0);Ss.displayName="TooltipRootContext";function je(t){let e=Rs.useContext(Ss);if(e===void 0&&!t)throw new Error("Base UI: TooltipRootContext is missing. Tooltip parts must be placed within <Tooltip.Root>.");return e}a(je,"useTooltipRootContext");var ba=R(M(),1);var Ti={...ro,disabled:j(t=>t.disabled),instantType:j(t=>t.instantType),isInstantPhase:j(t=>t.isInstantPhase),trackCursorAxis:j(t=>t.trackCursorAxis),disableHoverablePopup:j(t=>t.disableHoverablePopup),lastOpenChangeReason:j(t=>t.openChangeReason),closeOnClick:j(t=>t.closeOnClick),closeDelay:j(t=>t.closeDelay),hasViewport:j(t=>t.hasViewport)},uo=class t extends Kt{static{a(this,"TooltipStore")}constructor(e,o,s=!1){let r=new to,n={...wi(),...e};n.floatingRootContext=so(r,o,s),super(n,{popupRef:ba.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:r},Ti)}setOpen=a((e,o)=>{Pn(this,e,o,{extraState:{openChangeReason:o.reason}})},"setOpen");cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,Y(A.triggerPress,e))}static useStore(e,o){return Qt(e,(r,n)=>new t(o,r,n)).store}};function wi(){return{...oo(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}a(wi,"createInitialState");var Ns=R(be(),1);var br=xn(a(function(e){let{disabled:o=!1,defaultOpen:s=!1,open:r,disableHoverablePopup:n=!1,trackCursorAxis:l="none",actionsRef:c,onOpenChange:p,onOpenChangeComplete:d,handle:u,triggerId:g,defaultTriggerId:m=null,children:h}=e,f=uo.useStore(u?.store,{open:s,openProp:r,activeTriggerId:m,triggerIdProp:g});Go(f,r,s,m),f.useControlledProp("openProp",r),f.useControlledProp("triggerIdProp",g),f.useContextCallback("onOpenChange",p),f.useContextCallback("onOpenChangeComplete",d);let v=f.useState("open"),x=!o&&v,b=f.useState("activeTriggerId"),C=f.useState("mounted"),P=f.useState("payload");f.useSyncedValues({trackCursorAxis:l,disableHoverablePopup:n}),f.useSyncedValue("disabled",o),Jt(f,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:N,transitionStatus:S}=Xt(x,f),E=f.useState("isInstantPhase"),T=f.useState("instantType"),k=f.useState("lastOpenChangeReason"),w=ot.useRef(null);ut(()=>{v&&o&&f.setOpen(!1,Y(A.disabled))},[v,o,f]),ut(()=>{S==="ending"&&k===A.none||S!=="ending"&&E?(T!=="delay"&&(w.current=T),f.set("instantType","delay")):w.current!==null&&(f.set("instantType",w.current),w.current=null)},[S,E,k,T,f]),ut(()=>{x&&b==null&&f.set("payload",void 0)},[f,b,x]);let O=ot.useCallback(()=>{f.setOpen(!1,Y(A.imperativeAction))},[f]);ot.useImperativeHandle(c,()=>({unmount:N,close:O}),[N,O]);let V=x||C||!o&&l!=="none";return(0,Ns.jsxs)(Ss.Provider,{value:f,children:[V&&(0,Ns.jsx)(ki,{store:f,disabled:o,trackCursorAxis:l}),typeof h=="function"?h({payload:P}):h]})},"TooltipRoot"));br.displayName="TooltipRoot";function ki({store:t,disabled:e,trackCursorAxis:o}){let s=t.useState("floatingRootContext"),r=Gt(s,{enabled:!e,referencePress:a(()=>t.select("closeOnClick"),"referencePress")}),n=hn(s,{enabled:!e&&o!=="none",axis:o==="none"?void 0:o}),l=ot.useMemo(()=>it(n.reference,r.reference),[n.reference,r.reference]),c=ot.useMemo(()=>it(n.trigger,r.trigger),[n.trigger,r.trigger]),p=ot.useMemo(()=>it(ft,n.floating,r.floating),[n.floating,r.floating]);return eo(t,{activeTriggerProps:l,inactiveTriggerProps:c,popupProps:p}),null}a(ki,"TooltipInteractions");var ws=R(M(),1);var Es=R(M(),1);var Ts=Es.createContext(void 0);Ts.displayName="TooltipProviderContext";function ya(){return Es.useContext(Ts)}a(ya,"useTooltipProviderContext");var Pa=(function(t){return t[t.popupOpen=Sn.popupOpen]="popupOpen",t.triggerDisabled="data-trigger-disabled",t})({});var Ra="data-base-ui-tooltip-trigger";function Ca(t){if("composedPath"in t){let o=t.composedPath();for(let s=0;s<o.length;s+=1){let r=o[s];if(Ho(r))return r}}let e=t.target;return Ho(e)?e:null}a(Ca,"getTargetElement");function Oi(t){let e=t;for(;e;){if(e.hasAttribute(Ra))return e;let o=e.parentElement;if(o){e=o;continue}let s=e.getRootNode();e="host"in s&&Ho(s.host)?s.host:null}return null}a(Oi,"closestEnabledTooltipTrigger");var yr=bn(a(function(e,o){let{render:s,className:r,style:n,handle:l,payload:c,disabled:p,delay:d,closeOnClick:u=!0,closeDelay:g,id:m,...h}=e,f=je(!0),v=l?.store??f;if(!v)throw new Error("Base UI: <Tooltip.Trigger> must be either used within a <Tooltip.Root> component or provided with a handle.");let x=ye(m),b=v.useState("isTriggerActive",x),C=v.useState("isOpenedByTrigger",x),P=v.useState("floatingRootContext"),N=ws.useRef(null),S=d??600,E=g??0,{registerTrigger:T,isMountedByThisTrigger:k}=Yt(x,N,v,{payload:c,closeOnClick:u,closeDelay:E}),w=ya(),{delayRef:O,isInstantPhase:V,hasProvider:W}=dn(P,{open:C}),_=Rn(P);v.useSyncedValue("isInstantPhase",V);let H=v.useState("disabled"),$=p??H,Z=cn($),K=v.useState("trackCursorAxis"),D=v.useState("disableHoverablePopup"),I=ws.useRef(!1),z=rn(),te=ws.useRef(void 0);function re(){let L=w?.delay,Q=typeof O.current=="object"?O.current.open:void 0,X=S;return W&&(Q!==0?X=d??L??S:X=0),X}a(re,"getOpenDelay");function ne(L){let Q=N.current;if(!Q||!L)return!1;let X=Oi(L);return X!==null&&X!==Q&&ho(Q,X)}a(ne,"isEnabledNestedTriggerTarget");function J(L){let Q=ne(L);return I.current=Q,Q&&(_.openChangeTimeout.clear(),_.restTimeout.clear(),_.restTimeoutPending=!1,z.clear()),Q}a(J,"detectNestedTriggerHover");let ee=Yo(P,{enabled:!$,mouseOnly:!0,move:!1,handleClose:!D&&K!=="both"?Jo():null,restMs:re,delay(){let L=typeof O.current=="object"?O.current.close:void 0,Q=E;return g==null&&W&&(Q=L),{close:Q}},triggerElementRef:N,isActiveTrigger:b,isClosing:a(()=>v.select("transitionStatus")==="ending","isClosing"),shouldOpen(){return!I.current}}),ae=Cn(P,{enabled:!$}).reference,Be=a(L=>{let Q=I.current,X=Ca(L),xe=J(X),se=N.current,Fe=se&&X&&ho(se,X);if(xe&&v.select("open")&&v.select("lastOpenChangeReason")===A.triggerHover){v.setOpen(!1,Y(A.triggerHover,L));return}if(Q&&!xe&&Fe&&!Z.current&&!v.select("open")&&se&&on(te.current)){let ce=a(()=>{!I.current&&!Z.current&&!v.select("open")&&v.setOpen(!0,Y(A.triggerHover,L,se))},"open"),pe=re();pe===0?(z.clear(),ce()):z.start(pe,ce)}},"handleNestedTriggerHover"),me=v.useState("triggerProps",k);return F("button",e,{state:{open:C},ref:[o,T,N],props:[ee,ae,k||K!=="none"?me:void 0,{onMouseOver(L){Be(L.nativeEvent)},onFocus(L){ne(Ca(L.nativeEvent))&&L.preventBaseUIHandler()},onMouseLeave(){I.current=!1,z.clear(),te.current=void 0},onPointerEnter(L){te.current=L.pointerType},onPointerDown(L){te.current=L.pointerType,v.set("closeOnClick",u),u&&!v.select("open")&&v.cancelPendingOpen(L.nativeEvent)},onClick(L){u&&!v.select("open")&&v.cancelPendingOpen(L.nativeEvent)},id:x,[Pa.triggerDisabled]:$?"":void 0,[Ra]:$?void 0:""},h],stateAttributesMapping:no})},"TooltipTrigger"));yr.displayName="TooltipTrigger";var Ta=R(M(),1);var ks=R(M(),1);var Os=ks.createContext(void 0);Os.displayName="TooltipPortalContext";function Sa(){let t=ks.useContext(Os);if(t===void 0)throw new Error("Base UI: <Tooltip.Portal> is missing.");return t}a(Sa,"useTooltipPortalContext");var Ms=R(M(),1),Na=R(Fr(),1);var Ea=R(be(),1);var Pr=Ms.forwardRef(a(function(e,o){let{children:s,container:r,className:n,render:l,style:c,...p}=e,{portalNode:d,portalSubtree:u}=pn({container:r,ref:o,componentProps:e,elementProps:p});return!u&&!d?null:(0,Ea.jsxs)(Ms.Fragment,{children:[u,d&&Na.createPortal(s,d)]})},"FloatingPortalLite"));Pr.displayName="FloatingPortalLite";var Cr=R(be(),1);var Rr=Ta.forwardRef(a(function(e,o){let{keepMounted:s=!1,...r}=e;return je().useState("mounted")||s?(0,Cr.jsx)(Os.Provider,{value:s,children:(0,Cr.jsx)(Pr,{ref:o,...r})}):null},"TooltipPortal"));Rr.displayName="TooltipPortal";var _s=R(M(),1);var Is=R(M(),1);var Ds=Is.createContext(void 0);Ds.displayName="TooltipPositionerContext";function fo(){let t=Is.useContext(Ds);if(t===void 0)throw new Error("Base UI: TooltipPositionerContext is missing. TooltipPositioner parts must be placed within <Tooltip.Positioner>.");return t}a(fo,"useTooltipPositionerContext");var wa=R(be(),1);var Sr=_s.forwardRef(a(function(e,o){let{render:s,className:r,anchor:n,positionMethod:l="absolute",side:c="top",align:p="center",sideOffset:d=0,alignOffset:u=0,collisionBoundary:g="clipping-ancestors",collisionPadding:m=5,arrowPadding:h=5,sticky:f=!1,disableAnchorTracking:v=!1,collisionAvoidance:x=jo,style:b,...C}=e,P=je(),N=Sa(),S=P.useState("open"),E=P.useState("mounted"),T=P.useState("trackCursorAxis"),k=P.useState("disableHoverablePopup"),w=P.useState("floatingRootContext"),O=P.useState("instantType"),V=P.useState("transitionStatus"),W=P.useState("hasViewport"),_=os({anchor:n,positionMethod:l,floatingRootContext:w,mounted:E,side:c,sideOffset:d,align:p,alignOffset:u,collisionBoundary:g,collisionPadding:m,sticky:f,arrowPadding:h,disableAnchorTracking:v,keepMounted:N,collisionAvoidance:x,adaptiveOrigin:W?ts:void 0}),H=_s.useMemo(()=>({open:S,side:_.side,align:_.align,anchorHidden:_.anchorHidden,instant:T!=="none"?"tracking-cursor":O}),[S,_.side,_.align,_.anchorHidden,T,O]),$=ns(e,H,{styles:_.positionerStyles,transitionStatus:V,props:C,refs:[o,P.useStateSetter("positionerElement")],hidden:!E,inert:!S||T==="both"||k});return(0,wa.jsx)(Ds.Provider,{value:_,children:$})},"TooltipPositioner"));Sr.displayName="TooltipPositioner";var ka=R(M(),1);var Mi={...ue,...He},Nr=ka.forwardRef(a(function(e,o){let{render:s,className:r,style:n,...l}=e,c=je(),{side:p,align:d}=fo(),u=c.useState("open"),g=c.useState("instantType"),m=c.useState("transitionStatus"),h=c.useState("popupProps"),f=c.useState("floatingRootContext"),v=c.useState("disabled"),x=c.useState("closeDelay");qt({open:u,ref:c.context.popupRef,onComplete(){u&&c.context.onOpenChangeComplete?.(!0)}}),Qo(f,{enabled:!v,closeDelay:x});let b=c.useStateSetter("popupElement");return F("div",e,{state:{open:u,side:p,align:d,instant:g,transitionStatus:m},ref:[o,c.context.popupRef,b],props:[h,rs(m),l],stateAttributesMapping:Mi})},"TooltipPopup"));Nr.displayName="TooltipPopup";var Oa=R(M(),1);var Er=Oa.forwardRef(a(function(e,o){let{render:s,className:r,style:n,...l}=e,c=je(),{arrowRef:p,side:d,align:u,arrowUncentered:g,arrowStyles:m}=fo(),h=c.useState("open"),f=c.useState("instantType");return F("div",e,{state:{open:h,side:d,align:u,uncentered:g,instant:f},ref:[o,p],props:[{style:m,"aria-hidden":!0},l],stateAttributesMapping:ue})},"TooltipArrow"));Er.displayName="TooltipArrow";var Tr=R(M(),1);var wr=R(be(),1);var kr=a(function(e){let{delay:o,closeDelay:s,timeout:r=400}=e,n=Tr.useMemo(()=>({delay:o,closeDelay:s}),[o,s]),l=Tr.useMemo(()=>({open:o,close:s}),[o,s]);return(0,wr.jsx)(Ts.Provider,{value:n,children:(0,wr.jsx)(ln,{delay:l,timeoutMs:r,children:e.children})})},"TooltipProvider");kr.displayName="TooltipProvider";var Ia=R(M(),1);var Ma=(function(t){return t.popupWidth="--popup-width",t.popupHeight="--popup-height",t})({});var Ii={activationDirection:a(t=>t?{"data-activation-direction":t}:null,"activationDirection")},Or=Ia.forwardRef(a(function(e,o){let{render:s,className:r,style:n,children:l,...c}=e,p=je(),d=fo(),u=p.useState("instantType"),{children:g,state:m}=is({store:p,side:d.side,cssVars:Ma,children:l}),h={activationDirection:m.activationDirection,transitioning:m.transitioning,instant:u};return F("div",e,{state:h,ref:o,props:[c,{children:g}],stateAttributesMapping:Ii})},"TooltipViewport"));Or.displayName="TooltipViewport";var So=class{static{a(this,"TooltipHandle")}constructor(){this.store=new uo}open(e){let o=e?this.store.context.triggerElements.getById(e):void 0;if(e&&!o)throw new Error(`Base UI: TooltipHandle.open: No trigger found with id "${e}".`);this.store.setOpen(!0,Y(A.imperativeAction,void 0,o))}close(){this.store.setOpen(!1,Y(A.imperativeAction,void 0,void 0))}get isOpen(){return this.store.select("open")}};function Da(){return new So}a(Da,"createTooltipHandle");var Ve=R(Lo(),1);var rt=R(M(),1);var y=R(mo(),1);var Di=Dn(Rt.studioFeatures),La={analytics:!0,auth:!0,containers:!0,flags:!0,kv:!0,mail:!0,payments:!0,queues:!0,scheduler:!0,storage:!0,vectors:!0,workflows:!0},_i=a(t=>{if(t===null||typeof t!="object")return La;let e=t,o=a(s=>typeof e[s]=="boolean"?e[s]:!0,"flag");return{analytics:o("analytics"),auth:o("auth"),containers:o("containers"),flags:o("flags"),kv:o("kv"),mail:o("mail"),payments:o("payments"),queues:o("queues"),scheduler:o("scheduler"),storage:o("storage"),vectors:o("vectors"),workflows:o("workflows")}},"coerceFeatures"),Dr=a(()=>{let t=(0,Ve.c)(3),e=Ws(),[o,s]=(0,rt.useState)(La),r,n;return t[0]!==e?(r=a(()=>{$e((async()=>{try{s(_i(await e.query(Di,{},_n(""))))}catch{}})())},"t0"),n=[e],t[0]=e,t[1]=r,t[2]=n):(r=t[1],n=t[2]),(0,rt.useEffect)(r,n),o},"useStudioFeatures"),Ai=a(()=>{let t=(0,Ve.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,y.jsxDEV)("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,y.jsxDEV)("path",{d:"m9 6 6 6-6 6",strokeLinecap:"round",strokeLinejoin:"round"},void 0,!1)},void 0,!1),t[0]=e):e=t[0],e},"ChevronRight$1"),Vi=a(t=>{let e=(0,Ve.c)(24),{group:o}=t,s=ie(),r=pt(),n;e[0]!==o.tab||e[1]!==r?(n=a(()=>{$e(r({to:`/${o.tab}`}))},"t1"),e[0]=o.tab,e[1]=r,e[2]=n):n=e[2];let l=n,c=o.bindings.length,p;e[3]!==o.label?(p=(0,y.jsxDEV)("span",{className:"text-sm font-medium text-foreground",children:o.label},void 0,!1),e[3]=o.label,e[4]=p):p=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=(0,y.jsxDEV)(Ai,{},void 0,!1),e[5]=d):d=e[5];let u;e[6]!==p?(u=(0,y.jsxDEV)("div",{className:"flex items-center justify-between",children:[p,d]},void 0,!0),e[6]=p,e[7]=u):u=e[7];let g;e[8]!==c||e[9]!==s?(g=c===1?s("1 binding"):s("{count} bindings",{count:c}),e[8]=c,e[9]=s,e[10]=g):g=e[10];let m;e[11]!==g?(m=(0,y.jsxDEV)("span",{className:"text-xs text-muted-foreground",children:g},void 0,!1),e[11]=g,e[12]=m):m=e[12];let h;e[13]!==c||e[14]!==o.bindings?(h=c>0&&(0,y.jsxDEV)("div",{className:"flex flex-wrap gap-1.5",children:o.bindings.map(Fi)},void 0,!1),e[13]=c,e[14]=o.bindings,e[15]=h):h=e[15];let f;e[16]!==u||e[17]!==m||e[18]!==h?(f=(0,y.jsxDEV)(Qs,{className:"flex flex-col gap-2 py-4",children:[u,m,h]},void 0,!0),e[16]=u,e[17]=m,e[18]=h,e[19]=f):f=e[19];let v;return e[20]!==o.testId||e[21]!==l||e[22]!==f?(v=(0,y.jsxDEV)(gt,{className:"cursor-pointer gap-0 py-0 transition-colors hover:bg-muted/40","data-testid":o.testId,onClick:l,children:f},void 0,!1),e[20]=o.testId,e[21]=l,e[22]=f,e[23]=v):v=e[23],v},"BindingCard"),_a=["kv","files","vectors"],Bi=a((t,e)=>[...t.filter(o=>o.tab!==e.tab),e].toSorted((o,s)=>_a.indexOf(o.tab)-_a.indexOf(s.tab)),"upsertCard"),Li=a(()=>{let t=(0,Ve.c)(19),e=Ws(),o=Dr(),s=ie(),r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=[],t[0]=r):r=t[0];let[n,l]=(0,rt.useState)(r),c,p;if(t[1]!==e||t[2]!==o.kv||t[3]!==o.storage||t[4]!==o.vectors||t[5]!==s?(c=a(()=>{let f={cancelled:!1},v=[{enabled:o.kv,label:s("KV Namespaces"),load:a(async()=>(await e.listKvNamespaces()).map(Hi),"load"),tab:"kv",testId:"home-binding-kv"},{enabled:o.storage,label:s("R2 Buckets"),load:a(()=>e.listStorageBuckets(),"load"),tab:"files",testId:"home-binding-r2"},{enabled:o.vectors,label:s("Vectorize Indexes"),load:a(async()=>(await e.listVectorIndexes()).map($i),"load"),tab:"vectors",testId:"home-binding-vectors"}];for(let x of v)x.enabled&&$e((async()=>{try{let b=await x.load();if(!f.cancelled){let C={bindings:b,label:x.label,tab:x.tab,testId:x.testId};l(P=>Bi(P,C))}}catch{}})());return()=>{f.cancelled=!0}},"t1"),p=[e,o.kv,o.storage,o.vectors,s],t[1]=e,t[2]=o.kv,t[3]=o.storage,t[4]=o.vectors,t[5]=s,t[6]=c,t[7]=p):(c=t[6],p=t[7]),(0,rt.useEffect)(c,p),n.length===0)return null;let d;t[8]!==s?(d=s("Bindings"),t[8]=s,t[9]=d):d=t[9];let u;t[10]!==d?(u=(0,y.jsxDEV)("h2",{className:"text-sm font-semibold tracking-tight text-foreground",children:d},void 0,!1),t[10]=d,t[11]=u):u=t[11];let g;t[12]!==n?(g=n.map(ji),t[12]=n,t[13]=g):g=t[13];let m;t[14]!==g?(m=(0,y.jsxDEV)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:g},void 0,!1),t[14]=g,t[15]=m):m=t[15];let h;return t[16]!==u||t[17]!==m?(h=(0,y.jsxDEV)("section",{className:"flex flex-col gap-3","data-testid":"home-bindings",children:[u,m]},void 0,!0),t[16]=u,t[17]=m,t[18]=h):h=t[18],h},"BindingsOverview");function Fi(t){return(0,y.jsxDEV)(go,{variant:"secondary",children:t},t,!1)}a(Fi,"_temp$1");function Hi(t){return t.binding}a(Hi,"_temp2$1");function $i(t){return t.name}a($i,"_temp3$1");function ji(t){return(0,y.jsxDEV)(Vi,{group:t},t.tab,!1)}a(ji,"_temp4");var zi=(0,rt.lazy)(()=>import("./chunk-VSEGZA3J.js").then(t=>({default:t.Sparkline}))),Ir=a(t=>{if(t<1e3)return`${String(Math.round(t))}ms`;let e=t>=1e4?0:1;return`${(t/1e3).toFixed(e)}s`},"formatMs"),Ui=a((t,e)=>{let o=Math.max(0,Math.round((e-t)/1e3));if(o<60)return`${String(o)}s ago`;let s=Math.round(o/60);if(s<60)return`${String(s)}m ago`;let r=Math.round(s/60);return r<24?`${String(r)}h ago`:`${String(Math.round(r/24))}d ago`},"relativeTime"),Aa=a((t,e)=>{if(t===void 0||t.length===0)return[];let o=new Map;for(let s of t)o.set(s.bucketMs,(o.get(s.bucketMs)??0)+s[e]);return[...o.entries()].toSorted(([s],[r])=>s-r).map(([,s])=>s)},"bucketSeries"),Va=a((t,e=!0)=>{if(t.length<4)return null;let o=Math.floor(t.length/2),s=t.slice(0,o).reduce((l,c)=>l+c,0),r=t.slice(o).reduce((l,c)=>l+c,0);if(s===0)return null;let n=(r-s)/s*100;return{positive:e?n>=0:n<=0,text:`${n>=0?"+":""}${n.toFixed(1)}%`}},"seriesDelta"),As=a(t=>{let e=(0,Ve.c)(24),{delta:o,footer:s,label:r,trend:n,unit:l,value:c}=t,p=ie(),d;e[0]!==r?(d=(0,y.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:r},void 0,!1),e[0]=r,e[1]=d):d=e[1];let u;e[2]!==c?(u=(0,y.jsxDEV)("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:c},void 0,!1),e[2]=c,e[3]=u):u=e[3];let g;e[4]!==l?(g=l!==void 0&&(0,y.jsxDEV)("span",{className:"text-xs text-muted-foreground",children:l},void 0,!1),e[4]=l,e[5]=g):g=e[5];let m;e[6]!==u||e[7]!==g?(m=(0,y.jsxDEV)("span",{className:"flex items-baseline gap-1.5",children:[u,g]},void 0,!0),e[6]=u,e[7]=g,e[8]=m):m=e[8];let h;e[9]!==n?(h=n!==void 0&&(0,y.jsxDEV)(rt.Suspense,{fallback:(0,y.jsxDEV)("div",{"aria-hidden":"true",className:"h-8 w-28"},void 0,!1),children:(0,y.jsxDEV)(zi,{data:n},void 0,!1)},void 0,!1),e[9]=n,e[10]=h):h=e[10];let f;e[11]!==m||e[12]!==h?(f=(0,y.jsxDEV)("div",{className:"flex items-center justify-between gap-3",children:[m,h]},void 0,!0),e[11]=m,e[12]=h,e[13]=f):f=e[13];let v;e[14]!==d||e[15]!==f?(v=(0,y.jsxDEV)("div",{className:"flex flex-col gap-2.5 p-4",children:[d,f]},void 0,!0),e[14]=d,e[15]=f,e[16]=v):v=e[16];let x;e[17]!==o||e[18]!==s||e[19]!==p?(x=o==null?s!=null&&(0,y.jsxDEV)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",children:s},void 0,!1):(0,y.jsxDEV)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px]",children:[(0,y.jsxDEV)("span",{className:U("font-semibold",o.positive?"text-success":"text-destructive"),children:o.text},void 0,!1)," ",(0,y.jsxDEV)("span",{className:"text-muted-foreground",children:p("vs. prev.")},void 0,!1)]},void 0,!0),e[17]=o,e[18]=s,e[19]=p,e[20]=x):x=e[20];let b;return e[21]!==v||e[22]!==x?(b=(0,y.jsxDEV)(gt,{className:"justify-between gap-0 py-0",children:[v,x]},void 0,!0),e[21]=v,e[22]=x,e[23]=b):b=e[23],b},"StatCard"),Wi=a(()=>{let t=(0,Ve.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,y.jsxDEV)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:(0,y.jsxDEV)("path",{d:"m9 6 6 6-6 6"},void 0,!1)},void 0,!1),t[0]=e):e=t[0],e},"ChevronRight"),Mr=a(t=>{let e=(0,Ve.c)(7),{command:o,label:s}=t,r;e[0]!==s?(r=(0,y.jsxDEV)("div",{className:"p-4",children:(0,y.jsxDEV)("span",{className:"text-sm font-medium text-foreground",children:s},void 0,!1)},void 0,!1),e[0]=s,e[1]=r):r=e[1];let n;e[2]!==o?(n=(0,y.jsxDEV)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5",children:(0,y.jsxDEV)("code",{className:"font-mono text-xs text-muted-foreground",children:o},void 0,!1)},void 0,!1),e[2]=o,e[3]=n):n=e[3];let l;return e[4]!==r||e[5]!==n?(l=(0,y.jsxDEV)(gt,{className:"justify-between gap-0 py-0",children:[r,n]},void 0,!0),e[4]=r,e[5]=n,e[6]=l):l=e[6],l},"ConnectCard"),Ba=a(t=>{let e=(0,Ve.c)(18),{count:o,onView:s,testId:r,title:n}=t,l=ie(),c;e[0]!==n?(c=(0,y.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:n},void 0,!1),e[0]=n,e[1]=c):c=e[1];let p;e[2]!==o||e[3]!==l?(p=o===null?(0,y.jsxDEV)("span",{className:"text-xs text-muted-foreground",children:l("No data yet")},void 0,!1):(0,y.jsxDEV)(go,{variant:o>0?"destructive":"success",children:o>0?o:l("All clear")},void 0,!1),e[2]=o,e[3]=l,e[4]=p):p=e[4];let d;e[5]!==c||e[6]!==p?(d=(0,y.jsxDEV)("div",{className:"flex items-start justify-between gap-2 p-4",children:[c,p]},void 0,!0),e[5]=c,e[6]=p,e[7]=d):d=e[7];let u;e[8]!==l?(u=l("View"),e[8]=l,e[9]=u):u=e[9];let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=(0,y.jsxDEV)(Wi,{},void 0,!1),e[10]=g):g=e[10];let m;e[11]!==s||e[12]!==u?(m=(0,y.jsxDEV)("button",{className:"flex items-center gap-1 border-t border-border bg-muted/50 px-4 py-2.5 text-[12px] font-medium text-foreground outline-none transition-colors hover:bg-muted focus-visible:bg-muted",onClick:s,type:"button",children:[u,g]},void 0,!0),e[11]=s,e[12]=u,e[13]=m):m=e[13];let h;return e[14]!==d||e[15]!==m||e[16]!==r?(h=(0,y.jsxDEV)(gt,{className:"justify-between gap-0 py-0","data-testid":r,children:[d,m]},void 0,!0),e[14]=d,e[15]=m,e[16]=r,e[17]=h):h=e[17],h},"AdvisorCard"),Zi=a(t=>{let e=(0,Ve.c)(7),{functions:o}=t,s=ie(),r;if(e[0]!==o||e[1]!==s){let n=[...o].toSorted(Qi).slice(0,5),l;e[3]!==s?(l=s("Top functions"),e[3]=s,e[4]=l):l=e[4];let c;e[5]!==l?(c=(0,y.jsxDEV)("div",{className:"border-b border-border px-4 py-3",children:(0,y.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:l},void 0,!1)},void 0,!1),e[5]=l,e[6]=c):c=e[6],r=(0,y.jsxDEV)(gt,{className:"gap-0 py-0","data-testid":"home-top-functions",children:[c,n.length===0?(0,y.jsxDEV)("p",{className:"px-4 py-8 text-center text-xs text-muted-foreground",children:s("No functions called yet.")},void 0,!1):(0,y.jsxDEV)("div",{className:"divide-y divide-border",children:[(0,y.jsxDEV)("div",{className:"grid grid-cols-[1fr_auto_auto_auto] gap-4 px-4 py-1.5 font-mono text-[10px] tracking-wide text-muted-foreground uppercase",children:[(0,y.jsxDEV)("span",{children:s("Function")},void 0,!1),(0,y.jsxDEV)("span",{className:"text-end",children:s("Calls")},void 0,!1),(0,y.jsxDEV)("span",{className:"w-12 text-end",children:s("Avg")},void 0,!1),(0,y.jsxDEV)("span",{className:"w-8 text-end",children:s("Err")},void 0,!1)]},void 0,!0),n.map(Yi)]},void 0,!0)]},void 0,!0),e[0]=o,e[1]=s,e[2]=r}else r=e[2];return r},"TopFunctionsCard"),qi=a(t=>{let e=(0,Ve.c)(26),{subs:o}=t,s=ie(),r;e[0]!==s?(r=s("Live connections"),e[0]=s,e[1]=r):r=e[1];let n;e[2]!==r?(n=(0,y.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:r},void 0,!1),e[2]=r,e[3]=n):n=e[3];let l=o?.totalConnections??0,c;e[4]!==l?(c=l.toLocaleString(),e[4]=l,e[5]=c):c=e[5];let p;e[6]!==c?(p=(0,y.jsxDEV)("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:c},void 0,!1),e[6]=c,e[7]=p):p=e[7];let d;e[8]!==s?(d=s("sockets"),e[8]=s,e[9]=d):d=e[9];let u;e[10]!==d?(u=(0,y.jsxDEV)("span",{className:"text-xs text-muted-foreground",children:d},void 0,!1),e[10]=d,e[11]=u):u=e[11];let g;e[12]!==p||e[13]!==u?(g=(0,y.jsxDEV)("span",{className:"flex items-baseline gap-1.5",children:[p,u]},void 0,!0),e[12]=p,e[13]=u,e[14]=g):g=e[14];let m=o?.totalSubscriptions??0,h;e[15]!==m?(h=m.toLocaleString(),e[15]=m,e[16]=h):h=e[16];let f;e[17]!==s?(f=s("active subscriptions"),e[17]=s,e[18]=f):f=e[18];let v;e[19]!==h||e[20]!==f?(v=(0,y.jsxDEV)("span",{className:"text-[11px] text-muted-foreground",children:[h," ",f]},void 0,!0),e[19]=h,e[20]=f,e[21]=v):v=e[21];let x;return e[22]!==v||e[23]!==n||e[24]!==g?(x=(0,y.jsxDEV)(gt,{"data-testid":"home-live-connections",children:(0,y.jsxDEV)(Qs,{className:"flex flex-col gap-2.5 py-4",children:[n,g,v]},void 0,!0)},void 0,!1),e[22]=v,e[23]=n,e[24]=g,e[25]=x):x=e[25],x},"LiveConnectionsCard"),Gi=a(t=>{let e=(0,Ve.c)(7),{entries:o}=t,s=ie(),r;if(e[0]!==o||e[1]!==s){let n=Date.now(),l;e[3]!==s?(l=s("Recent activity"),e[3]=s,e[4]=l):l=e[4];let c;e[5]!==l?(c=(0,y.jsxDEV)("div",{className:"border-b border-border px-4 py-3",children:(0,y.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:l},void 0,!1)},void 0,!1),e[5]=l,e[6]=c):c=e[6],r=(0,y.jsxDEV)(gt,{className:"gap-0 py-0","data-testid":"home-recent-activity",children:[c,o.length===0?(0,y.jsxDEV)("p",{className:"px-4 py-8 text-center text-xs text-muted-foreground",children:s("No recent activity.")},void 0,!1):(0,y.jsxDEV)("ul",{className:"divide-y divide-border",children:o.slice(0,5).map(p=>(0,y.jsxDEV)("li",{className:"flex items-center justify-between gap-3 px-4 py-2 text-[13px]",children:[(0,y.jsxDEV)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,y.jsxDEV)("span",{"aria-hidden":"true",className:"size-1.5 shrink-0 rounded-full bg-muted-foreground/40"},void 0,!1),(0,y.jsxDEV)("span",{className:"truncate text-foreground",children:[p.op,p.table!==void 0&&(0,y.jsxDEV)("span",{className:"text-muted-foreground",children:[" \xB7 ",p.table,p.id===void 0?"":`#${p.id}`]},void 0,!0)]},void 0,!0)]},void 0,!0),(0,y.jsxDEV)("span",{className:"shrink-0 text-xs tabular-nums text-muted-foreground",children:Ui(p.ts,n)},void 0,!1)]},p.seq,!0))},void 0,!1)]},void 0,!0),e[0]=o,e[1]=s,e[2]=r}else r=e[2];return r},"RecentActivityCard"),Ki=a(t=>{let e=t.reduce((o,s)=>o+s.calls,0);return e===0?null:t.reduce((o,s)=>o+s.totalDurationMs,0)/e},"averageLatencyMs"),Fa=a(t=>{let e=(0,Ve.c)(150),{initialShardKey:o}=t,s=ie(),r=pt(),n=o??"",l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={},e[0]=l):l=e[0];let c;e[1]!==n?(c={shardKey:n},e[1]=n,e[2]=c):c=e[2];let p=ao(Rt.getMetrics,l,c),d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={},e[3]=d):d=e[3];let u;e[4]!==n?(u={shardKey:n},e[4]=n,e[5]=u):u=e[5];let g=ao(Rt.getFunctionStats,d,u),m,h;e[6]===Symbol.for("react.memo_cache_sentinel")?(m={},h={shardKey:""},e[6]=m,e[7]=h):(m=e[6],h=e[7]);let f=ao(Rt.getSecurityAudit,m,h),v;e[8]===Symbol.for("react.memo_cache_sentinel")?(v={},e[8]=v):v=e[8];let x;e[9]!==n?(x={shardKey:n},e[9]=n,e[10]=x):x=e[10];let b=ao(Rt.listSubscriptions,v,x),C;e[11]===Symbol.for("react.memo_cache_sentinel")?(C={},e[11]=C):C=e[11];let P;e[12]!==n?(P={shardKey:n},e[12]=n,e[13]=P):P=e[13];let N=ao(Rt.getAuditLog,C,P),S=p.data??null,E,T,k,w,O,V,W,_,H,$,Z,K,D,I,z,te,re,ne;if(e[14]!==N.data||e[15]!==f.data||e[16]!==S||e[17]!==p.data||e[18]!==r||e[19]!==g.data||e[20]!==b.data||e[21]!==s){w=Array.isArray(g.data?.functions)?g.data.functions:[],W=b.data??null;let Ue;e[40]!==N.data?(Ue=Array.isArray(N.data?.entries)?N.data.entries:[],e[40]=N.data,e[41]=Ue):Ue=e[41],T=Ue,O=p.data===void 0||g.data===void 0?null:Vn(S,w).length,V=Array.isArray(f.data?.findings)?f.data.findings.length:null;let We;e[42]!==r?(We=a(()=>{$e(r({to:"/security"}))},"t212"),e[42]=r,e[43]=We):We=e[43],ne=We;let Ze;e[44]!==r?(Ze=a(()=>{$e(r({to:"/insights"}))},"t222"),e[44]=r,e[45]=Ze):Ze=e[45],re=Ze;let qe=Aa(S?.history,"calls"),Ge=Aa(S?.history,"errors"),nt=Ki(w),Ke=Math.max(0,...w.map(Ji)),ge=S?.cache,Qe;e[46]!==ge?(Qe=ge!=null&&ge.hits+ge.misses>0?Math.round(ge.hits/(ge.hits+ge.misses)*100):null,e[46]=ge,e[47]=Qe):Qe=e[47],k=Qe,z="flex flex-col gap-6",te="lunora-home",Z="grid gap-3 sm:grid-cols-2 xl:grid-cols-4",K="home-health";let Ye=Va(qe),Ie;e[48]!==s?(Ie=s("Requests"),e[48]=s,e[49]=Ie):Ie=e[49];let Je=S?.requests??0,De;e[50]!==Je?(De=Je.toLocaleString(),e[50]=Je,e[51]=De):De=e[51],e[52]!==qe||e[53]!==Ye||e[54]!==Ie||e[55]!==De?(D=(0,y.jsxDEV)(As,{delta:Ye,label:Ie,trend:qe,value:De},void 0,!1),e[52]=qe,e[53]=Ye,e[54]=Ie,e[55]=De,e[56]=D):D=e[56];let Xe=Va(Ge,!1),_e;e[57]!==s?(_e=s("Errors"),e[57]=s,e[58]=_e):_e=e[58];let et=S?.errors??0,Ae;e[59]!==et?(Ae=et.toLocaleString(),e[59]=et,e[60]=Ae):Ae=e[60],e[61]!==Ge||e[62]!==Xe||e[63]!==_e||e[64]!==Ae?(I=(0,y.jsxDEV)(As,{delta:Xe,label:_e,trend:Ge,value:Ae},void 0,!1),e[61]=Ge,e[62]=Xe,e[63]=_e,e[64]=Ae,e[65]=I):I=e[65],E=As,e[66]!==Ke||e[67]!==s?(_=Ke>0?`${s("max")} ${Ir(Ke)}`:void 0,e[66]=Ke,e[67]=s,e[68]=_):_=e[68],e[69]!==s?(H=s("Avg latency"),e[69]=s,e[70]=H):H=e[70],$=nt===null?"\u2014":Ir(nt),e[14]=N.data,e[15]=f.data,e[16]=S,e[17]=p.data,e[18]=r,e[19]=g.data,e[20]=b.data,e[21]=s,e[22]=E,e[23]=T,e[24]=k,e[25]=w,e[26]=O,e[27]=V,e[28]=W,e[29]=_,e[30]=H,e[31]=$,e[32]=Z,e[33]=K,e[34]=D,e[35]=I,e[36]=z,e[37]=te,e[38]=re,e[39]=ne}else E=e[22],T=e[23],k=e[24],w=e[25],O=e[26],V=e[27],W=e[28],_=e[29],H=e[30],$=e[31],Z=e[32],K=e[33],D=e[34],I=e[35],z=e[36],te=e[37],re=e[38],ne=e[39];let J;e[71]!==E||e[72]!==_||e[73]!==H||e[74]!==$?(J=(0,y.jsxDEV)(E,{footer:_,label:H,value:$},void 0,!1),e[71]=E,e[72]=_,e[73]=H,e[74]=$,e[75]=J):J=e[75];let ee;e[76]!==k||e[77]!==s?(ee=k===null?void 0:`${String(k)}% ${s("cache hit")}`,e[76]=k,e[77]=s,e[78]=ee):ee=e[78];let ae;e[79]!==s?(ae=s("Database size"),e[79]=s,e[80]=ae):ae=e[80];let Be=S?.databaseSize??null,me;e[81]!==Be?(me=An(Be),e[81]=Be,e[82]=me):me=e[82];let he;e[83]!==ee||e[84]!==ae||e[85]!==me?(he=(0,y.jsxDEV)(As,{footer:ee,label:ae,value:me},void 0,!1),e[83]=ee,e[84]=ae,e[85]=me,e[86]=he):he=e[86];let ve;e[87]!==Z||e[88]!==K||e[89]!==D||e[90]!==I||e[91]!==J||e[92]!==he?(ve=(0,y.jsxDEV)("div",{className:Z,"data-testid":K,children:[D,I,J,he]},void 0,!0),e[87]=Z,e[88]=K,e[89]=D,e[90]=I,e[91]=J,e[92]=he,e[93]=ve):ve=e[93];let Le;e[94]===Symbol.for("react.memo_cache_sentinel")?(Le=(0,y.jsxDEV)(Li,{},void 0,!1),e[94]=Le):Le=e[94];let L;e[95]!==w?(L=(0,y.jsxDEV)("div",{className:"lg:col-span-2",children:(0,y.jsxDEV)(Zi,{functions:w},void 0,!1)},void 0,!1),e[95]=w,e[96]=L):L=e[96];let Q;e[97]!==W?(Q=(0,y.jsxDEV)(qi,{subs:W},void 0,!1),e[97]=W,e[98]=Q):Q=e[98];let X;e[99]!==T?(X=(0,y.jsxDEV)(Gi,{entries:T},void 0,!1),e[99]=T,e[100]=X):X=e[100];let xe;e[101]!==Q||e[102]!==X?(xe=(0,y.jsxDEV)("div",{className:"flex flex-col gap-3",children:[Q,X]},void 0,!0),e[101]=Q,e[102]=X,e[103]=xe):xe=e[103];let se;e[104]!==L||e[105]!==xe?(se=(0,y.jsxDEV)("div",{className:"grid gap-3 lg:grid-cols-3",children:[L,xe]},void 0,!0),e[104]=L,e[105]=xe,e[106]=se):se=e[106];let Fe;e[107]!==s?(Fe=s("Advisors"),e[107]=s,e[108]=Fe):Fe=e[108];let ce;e[109]!==Fe?(ce=(0,y.jsxDEV)("h2",{className:"text-sm font-semibold tracking-tight text-foreground",children:Fe},void 0,!1),e[109]=Fe,e[110]=ce):ce=e[110];let pe;e[111]!==O||e[112]!==V||e[113]!==s||e[114]!==re||e[115]!==ne?(pe=V===0&&O===0?(0,y.jsxDEV)(In,{description:s("No security or performance issues detected."),icon:(0,y.jsxDEV)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,y.jsxDEV)("path",{d:"M12 3 4 6v5c0 5 3.4 8.5 8 10 4.6-1.5 8-5 8-10V6l-8-3Z"},void 0,!1),(0,y.jsxDEV)("path",{d:"m9 12 2 2 4-4"},void 0,!1)]},void 0,!0),testId:"home-advisors-clear",title:s("No issues found")},void 0,!1):(0,y.jsxDEV)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,y.jsxDEV)(Ba,{count:V,onView:ne,testId:"home-security",title:s("Security findings")},void 0,!1),(0,y.jsxDEV)(Ba,{count:O,onView:re,testId:"home-performance",title:s("Performance issues")},void 0,!1)]},void 0,!0),e[111]=O,e[112]=V,e[113]=s,e[114]=re,e[115]=ne,e[116]=pe):pe=e[116];let Pe;e[117]!==ce||e[118]!==pe?(Pe=(0,y.jsxDEV)("section",{className:"flex flex-col gap-3","data-testid":"home-advisors",children:[ce,pe]},void 0,!0),e[117]=ce,e[118]=pe,e[119]=Pe):Pe=e[119];let Ce;e[120]!==s?(Ce=s("Get connected"),e[120]=s,e[121]=Ce):Ce=e[121];let Re;e[122]!==Ce?(Re=(0,y.jsxDEV)("h2",{className:"text-sm font-semibold tracking-tight text-foreground",children:Ce},void 0,!1),e[122]=Ce,e[123]=Re):Re=e[123];let Se;e[124]!==s?(Se=s("Client SDK"),e[124]=s,e[125]=Se):Se=e[125];let Ne;e[126]!==Se?(Ne=(0,y.jsxDEV)(Mr,{command:"npm i @lunora/client",label:Se},void 0,!1),e[126]=Se,e[127]=Ne):Ne=e[127];let Ee;e[128]!==s?(Ee=s("React"),e[128]=s,e[129]=Ee):Ee=e[129];let Te;e[130]!==Ee?(Te=(0,y.jsxDEV)(Mr,{command:"npm i @lunora/react",label:Ee},void 0,!1),e[130]=Ee,e[131]=Te):Te=e[131];let we;e[132]!==s?(we=s("CLI"),e[132]=s,e[133]=we):we=e[133];let ke;e[134]!==we?(ke=(0,y.jsxDEV)(Mr,{command:"lunora dev",label:we},void 0,!1),e[134]=we,e[135]=ke):ke=e[135];let Oe;e[136]!==Ne||e[137]!==Te||e[138]!==ke?(Oe=(0,y.jsxDEV)("div",{className:"grid gap-3 sm:grid-cols-3",children:[Ne,Te,ke]},void 0,!0),e[136]=Ne,e[137]=Te,e[138]=ke,e[139]=Oe):Oe=e[139];let Me;e[140]!==Re||e[141]!==Oe?(Me=(0,y.jsxDEV)("section",{className:"flex flex-col gap-3","data-testid":"home-get-connected",children:[Re,Oe]},void 0,!0),e[140]=Re,e[141]=Oe,e[142]=Me):Me=e[142];let ze;return e[143]!==z||e[144]!==te||e[145]!==ve||e[146]!==se||e[147]!==Pe||e[148]!==Me?(ze=(0,y.jsxDEV)("div",{className:z,"data-testid":te,children:[ve,Le,se,Pe,Me]},void 0,!0),e[143]=z,e[144]=te,e[145]=ve,e[146]=se,e[147]=Pe,e[148]=Me,e[149]=ze):ze=e[149],ze},"HomePanel");function Qi(t,e){return e.calls-t.calls}a(Qi,"_temp");function Yi(t){return(0,y.jsxDEV)("div",{className:"grid grid-cols-[1fr_auto_auto_auto] items-center gap-4 px-4 py-2 text-[13px]",children:[(0,y.jsxDEV)("span",{className:"truncate font-mono text-xs text-foreground",children:t.path},void 0,!1),(0,y.jsxDEV)("span",{className:"text-end tabular-nums",children:t.calls.toLocaleString()},void 0,!1),(0,y.jsxDEV)("span",{className:"w-12 text-end tabular-nums text-muted-foreground",children:Ir(t.calls>0?t.totalDurationMs/t.calls:0)},void 0,!1),(0,y.jsxDEV)("span",{className:U("w-8 text-end tabular-nums",t.errors>0?"text-destructive":"text-muted-foreground"),children:t.errors},void 0,!1)]},t.path,!0)}a(Yi,"_temp2");function Ji(t){return t.maxDurationMs}a(Ji,"_temp3");var Ha=R(Lo(),1);var $a=R(mo(),1);var Xi=a((t,e,o)=>t!==void 0?t:e===void 0&&o===void 0?Kr:Gr(e,o),"resolveInstance"),ja=a(t=>{let e=(0,Ha.c)(7),{catalogs:o,children:s,i18n:r,locale:n}=t,l;e[0]!==o||e[1]!==r||e[2]!==n?(l=Xi(r,n,o),e[0]=o,e[1]=r,e[2]=n,e[3]=l):l=e[3];let c=l,p;return e[4]!==s||e[5]!==c?(p=(0,$a.jsxDEV)(Qr,{value:c,children:s},void 0,!1),e[4]=s,e[5]=c,e[6]=p):p=e[6],p},"StudioI18nProvider");var Ar=R(Lo(),1);var Pt=R(M(),1);var de=R(mo(),1);var _r="lunora:command-palette",za=a(()=>{"window"in globalThis&&globalThis.dispatchEvent(new Event(_r))},"openCommandPalette"),el=a(t=>{let e=(0,Ar.c)(18),{active:o,index:s,item:r,onActivate:n,onSelect:l}=t,c;e[0]!==r||e[1]!==l?(c=a(()=>{l(r)},"t1"),e[0]=r,e[1]=l,e[2]=c):c=e[2];let p=c,d;e[3]!==s||e[4]!==n?(d=a(()=>{n(s)},"t2"),e[3]=s,e[4]=n,e[5]=d):d=e[5];let u=d,g=o?"bg-accent text-accent-foreground":"text-foreground",m;e[6]!==g?(m=U("flex w-full items-center justify-between gap-3 rounded-md px-3 py-2 text-start text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground",g),e[6]=g,e[7]=m):m=e[7];let h;e[8]!==r.label?(h=(0,de.jsxDEV)("span",{children:r.label},void 0,!1),e[8]=r.label,e[9]=h):h=e[9];let f;e[10]!==r.group?(f=(0,de.jsxDEV)("span",{className:"text-xs text-muted-foreground",children:r.group},void 0,!1),e[10]=r.group,e[11]=f):f=e[11];let v;return e[12]!==p||e[13]!==u||e[14]!==m||e[15]!==h||e[16]!==f?(v=(0,de.jsxDEV)("li",{children:(0,de.jsxDEV)("button",{className:m,onClick:p,onMouseEnter:u,type:"button",children:[h,f]},void 0,!0)},void 0,!1),e[12]=p,e[13]=u,e[14]=m,e[15]=h,e[16]=f,e[17]=v):v=e[17],v},"CommandRow"),Ua=a(t=>{let e=(0,Ar.c)(39),{items:o}=t,s=ie(),r=pt(),[n,l]=(0,Pt.useState)(!1),[c,p]=(0,Pt.useState)(""),[d,u]=(0,Pt.useState)(0),g=(0,Pt.useRef)(null),m,h;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=a(()=>{let D=a(z=>{(z.metaKey||z.ctrlKey)&&z.key.toLowerCase()==="k"&&(z.preventDefault(),l(!0))},"onKeyDown"),I=a(()=>{l(!0)},"onOpen");return globalThis.addEventListener("keydown",D),globalThis.addEventListener(_r,I),()=>{globalThis.removeEventListener("keydown",D),globalThis.removeEventListener(_r,I)}},"t1"),h=[],e[0]=m,e[1]=h):(m=e[0],h=e[1]),(0,Pt.useEffect)(m,h);let f;if(e[2]!==o||e[3]!==c){e:{let D=c.trim().toLowerCase();if(D===""){f=o;break e}f=o.filter(I=>I.label.toLowerCase().includes(D)||I.group.toLowerCase().includes(D))}e[2]=o,e[3]=c,e[4]=f}else f=e[4];let v=f,x;e[5]===Symbol.for("react.memo_cache_sentinel")?(x=a(D=>{l(D),D||(p(""),u(0))},"t4"),e[5]=x):x=e[5];let b=x,C;e[6]!==r?(C=a(D=>{b(!1),$e(r({to:D.to}))},"t5"),e[6]=r,e[7]=C):C=e[7];let P=C,N;e[8]===Symbol.for("react.memo_cache_sentinel")?(N=a(D=>{p(D.target.value),u(0)},"t6"),e[8]=N):N=e[8];let S=N,E;e[9]!==d||e[10]!==v||e[11]!==P?(E=a(D=>{e:switch(D.key){case"ArrowDown":{D.preventDefault(),u(I=>v.length===0?0:(I+1)%v.length);break e}case"ArrowUp":{D.preventDefault(),u(I=>v.length===0?0:(I-1+v.length)%v.length);break e}case"Enter":{D.preventDefault();let I=v[d];I!==void 0&&P(I);break e}}},"t7"),e[9]=d,e[10]=v,e[11]=P,e[12]=E):E=e[12];let T=E,k;e[13]===Symbol.for("react.memo_cache_sentinel")?(k=(0,de.jsxDEV)(fe.Backdrop,{className:"fixed inset-0 z-50 bg-black/40 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0"},void 0,!1),e[13]=k):k=e[13];let w;e[14]!==s?(w=s("Command palette"),e[14]=s,e[15]=w):w=e[15];let O;e[16]!==w?(O=(0,de.jsxDEV)(fe.Title,{className:"sr-only",children:w},void 0,!1),e[16]=w,e[17]=O):O=e[17];let V;e[18]===Symbol.for("react.memo_cache_sentinel")?(V=(0,de.jsxDEV)("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeWidth:1.8,viewBox:"0 0 24 24",children:[(0,de.jsxDEV)("circle",{cx:"11",cy:"11",r:"7"},void 0,!1),(0,de.jsxDEV)("path",{d:"m21 21-4.3-4.3",strokeLinecap:"round"},void 0,!1)]},void 0,!0),e[18]=V):V=e[18];let W;e[19]!==s?(W=s("Search\u2026"),e[19]=s,e[20]=W):W=e[20];let _;e[21]!==T||e[22]!==c||e[23]!==W?(_=(0,de.jsxDEV)("div",{className:"flex items-center gap-2 border-b border-border px-3",children:[V,(0,de.jsxDEV)("input",{className:"h-11 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground","data-testid":"dash-command-input",onChange:S,onKeyDown:T,placeholder:W,ref:g,type:"text",value:c},void 0,!1)]},void 0,!0),e[21]=T,e[22]=c,e[23]=W,e[24]=_):_=e[24];let H;e[25]!==d||e[26]!==v||e[27]!==P||e[28]!==s?(H=v.length===0?(0,de.jsxDEV)("li",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:s("No results.")},void 0,!1):v.map((D,I)=>(0,de.jsxDEV)(el,{active:I===d,index:I,item:D,onActivate:u,onSelect:P},D.to,!1)),e[25]=d,e[26]=v,e[27]=P,e[28]=s,e[29]=H):H=e[29];let $;e[30]!==H?($=(0,de.jsxDEV)("ul",{className:"max-h-80 overflow-y-auto p-1.5","data-testid":"dash-command-list",children:H},void 0,!1),e[30]=H,e[31]=$):$=e[31];let Z;e[32]!==O||e[33]!==_||e[34]!==$?(Z=(0,de.jsxDEV)(fe.Portal,{children:[k,(0,de.jsxDEV)(fe.Popup,{className:"fixed start-1/2 top-24 z-50 w-[36rem] max-w-[90vw] -translate-x-1/2 overflow-hidden rounded-lg border border-border bg-popover text-popover-foreground shadow-lg outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95","data-testid":"dash-command-palette",initialFocus:g,children:[O,_,$]},void 0,!0)]},void 0,!0),e[32]=O,e[33]=_,e[34]=$,e[35]=Z):Z=e[35];let K;return e[36]!==n||e[37]!==Z?(K=(0,de.jsxDEV)(fe.Root,{onOpenChange:b,open:n,children:Z},void 0,!1),e[36]=n,e[37]=Z,e[38]=K):K=e[38],K},"CommandPalette");var Qa="(prefers-color-scheme: dark)",Ya=a(()=>{try{return globalThis.localStorage}catch{return}},"store"),tl=a(t=>t==="system"||t==="light"||t==="dark","isPreference"),Ja=a(()=>globalThis.matchMedia,"matchMedia"),Xa="lunora-studio-theme",Vr=["system","light","dark"],ol=a((t="system")=>{try{let e=Ya()?.getItem(Xa);return tl(e)?e:t}catch{return t}},"loadThemePreference"),Wa=a(t=>{let e=Ya();if(e!==void 0)try{e.setItem(Xa,t)}catch{}},"saveThemePreference"),sl=a(()=>{try{return Ja()?.(Qa).matches?"dark":"light"}catch{return"light"}},"getSystemTheme"),rl=a((t,e)=>t==="system"?e:t,"resolveTheme"),nl=a(t=>{let e;try{e=Ja()?.(Qa)}catch{e=void 0}if(e===void 0)return()=>{};let o=a(s=>{t(s.matches?"dark":"light")},"handler");return e.addEventListener("change",o),()=>{e.removeEventListener("change",o)}},"subscribeSystemTheme"),ei=(0,q.createContext)(null),f0=a(({children:t,defaultTheme:e="system"})=>{let[o,s]=(0,q.useState)(()=>ol(e)),[r,n]=(0,q.useState)(()=>sl());(0,q.useEffect)(()=>nl(n),[]);let l=a(d=>{Wa(d),s(d)},"setTheme"),p={cycleTheme:a(()=>{s(d=>{let u=Vr[(Vr.indexOf(d)+1)%Vr.length]??d;return Wa(u),u})},"cycleTheme"),resolvedTheme:rl(o,r),setTheme:l,systemTheme:r,theme:o};return(0,i.jsxDEV)(ei,{value:p,children:t},void 0,!1)},"ThemeProvider"),al=a(()=>{let t=(0,q.use)(ei);if(t===null)throw new Error("useTheme must be used within a <ThemeProvider>");return t},"useTheme");function m0({delay:t=0,...e}){return(0,i.jsxDEV)(st.Provider,{"data-slot":"tooltip-provider",delay:t,...e},void 0,!1)}a(m0,"TooltipProvider");function il(t){let e=(0,B.c)(4),o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let s;return e[2]!==o?(s=(0,i.jsxDEV)(st.Root,{"data-slot":"tooltip",...o},void 0,!1),e[2]=o,e[3]=s):s=e[3],s}a(il,"Tooltip");function ll(t){let e=(0,B.c)(4),o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let s;return e[2]!==o?(s=(0,i.jsxDEV)(st.Trigger,{"data-slot":"tooltip-trigger",...o},void 0,!1),e[2]=o,e[3]=s):s=e[3],s}a(ll,"TooltipTrigger");function dl({className:t,side:e="top",sideOffset:o=4,align:s="center",alignOffset:r=0,children:n,...l}){return(0,i.jsxDEV)(st.Portal,{children:(0,i.jsxDEV)(st.Positioner,{align:s,alignOffset:r,side:e,sideOffset:o,className:"isolate z-50",children:(0,i.jsxDEV)(st.Popup,{"data-slot":"tooltip-content",className:U("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pe-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-md data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...l,children:[n,(0,i.jsxDEV)(st.Arrow,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-md bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-start-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-end-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1)}a(dl,"TooltipContent");var cl=a(t=>{let e=(0,B.c)(5),{className:o}=t,s;e[0]!==o?(s=U("h-full w-full text-foreground",o),e[0]=o,e[1]=s):s=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=(0,i.jsxDEV)("path",{d:"M 259.500 10.552 C 220.080 15.859, 182.424 32.566, 152.500 58.025 C 110.179 94.031, 85.380 137.183, 77.518 188.500 C 75.410 202.255, 74.569 225.677, 75.796 236.466 C 76.757 244.917, 76.683 245.692, 74.518 249.966 C 63.118 272.466, 53.141 303.876, 51.382 322.799 L 50.718 329.943 71.960 320.471 C 83.643 315.262, 93.326 311, 93.478 311 C 93.630 311, 96.547 316.063, 99.959 322.250 C 103.371 328.438, 107.249 334.850, 108.577 336.500 L 110.990 339.500 110.981 336 C 110.977 334.075, 111.499 324.991, 112.143 315.813 L 113.312 299.127 121.406 293.336 C 132.495 285.403, 149.593 271.554, 161 261.268 C 171.556 251.748, 189.116 235, 188.540 235 C 188.337 235, 183.069 238.648, 176.835 243.106 C 142.318 267.789, 68.537 314, 63.646 314 C 61.843 314, 72.791 281.179, 80.905 262.259 C 92.233 235.845, 107.473 212.389, 132.106 183.453 L 138.451 176 148.268 176 C 176.192 176, 197.512 187.154, 212.868 209.797 C 216.470 215.108, 217.035 216.595, 216.477 219.297 C 211.386 243.968, 202.359 274.496, 193.797 296 C 183.898 320.861, 167.147 352.101, 152.395 373.215 L 147.004 380.930 152.891 385.830 C 161.400 392.911, 165.563 396, 166.594 395.998 C 167.092 395.998, 168.772 391.641, 170.327 386.317 C 176.279 365.934, 188.422 338.749, 200.942 317.778 C 223.060 280.731, 256.432 244.369, 294.500 215.836 C 309.956 204.252, 313.937 201.603, 314.719 202.385 C 315.116 202.783, 315.449 213.096, 315.460 225.304 C 315.474 241.855, 315.021 250.405, 313.680 258.924 C 307.009 301.272, 291.175 336.677, 263.112 372 C 255.259 381.883, 227.182 410.673, 218.516 417.727 L 213.532 421.783 223.439 424.880 C 281.705 443.093, 349.165 436.018, 398.616 406.508 C 446.728 377.797, 483.322 331.466, 497.366 281.481 C 503.381 260.075, 504.480 250.741, 504.491 221 C 504.501 191.997, 503.598 184.047, 497.987 163.732 C 484.768 115.871, 452.505 72.708, 407.718 42.964 C 381.051 25.254, 352.818 14.828, 319.695 10.460 C 305.932 8.645, 273.298 8.695, 259.500 10.552",fillRule:"evenodd"},void 0,!1),e[2]=r):r=e[2];let n;return e[3]!==s?(n=(0,i.jsxDEV)("svg",{"aria-hidden":"true",className:s,fill:"currentColor",viewBox:"0 0 543 446",children:r},void 0,!1),e[3]=s,e[4]=n):n=e[4],n},"BrandMark"),ti="lunora.studio.rulesBannerDismissed",pl=a(()=>{try{return globalThis.localStorage.getItem(ti)==="1"}catch{return!1}},"readBannerDismissed"),ul=a(()=>{try{globalThis.localStorage.setItem(ti,"1")}catch{}},"writeBannerDismissed"),fl=a(()=>{let t=(0,B.c)(18),e=ie(),[o,s]=(0,q.useState)(ml),r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=a(()=>{s(!0),ul()},"t0"),t[0]=r):r=t[0];let n=r;if(o)return null;let l;t[1]===Symbol.for("react.memo_cache_sentinel")?(l=(0,i.jsxDEV)("span",{"aria-hidden":"true",className:"text-warning",children:"\u26A0"},void 0,!1),t[1]=l):l=t[1];let c;t[2]!==e?(c=e("Lunora AI rules aren't installed."),t[2]=e,t[3]=c):c=t[3];let p;t[4]===Symbol.for("react.memo_cache_sentinel")?(p=(0,i.jsxDEV)("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[11px]",children:"lunora rules install"},void 0,!1),t[4]=p):p=t[4];let d;t[5]!==e?(d=e("lets your coding agent use Lunora correctly."),t[5]=e,t[6]=d):d=t[6];let u;t[7]!==c||t[8]!==d?(u=(0,i.jsxDEV)("span",{children:[c," ",p," ",d]},void 0,!0),t[7]=c,t[8]=d,t[9]=u):u=t[9];let g;t[10]!==e?(g=e("Dismiss"),t[10]=e,t[11]=g):g=t[11];let m;t[12]===Symbol.for("react.memo_cache_sentinel")?(m=(0,i.jsxDEV)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:(0,i.jsxDEV)("path",{d:"M18 6 6 18M6 6l12 12"},void 0,!1)},void 0,!1),t[12]=m):m=t[12];let h;t[13]!==g?(h=(0,i.jsxDEV)("button",{"aria-label":g,className:"ms-auto flex size-5 items-center justify-center rounded text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent","data-testid":"dash-app-rules-banner-dismiss",onClick:n,type:"button",children:m},void 0,!1),t[13]=g,t[14]=h):h=t[14];let f;return t[15]!==u||t[16]!==h?(f=(0,i.jsxDEV)("div",{className:"flex shrink-0 items-center gap-2 border-b border-warning/30 bg-warning/10 px-6 py-2 text-[12px] text-foreground","data-testid":"dash-app-rules-banner",role:"note",children:[l,u,h]},void 0,!0),t[15]=u,t[16]=h,t[17]=f):f=t[17],f},"RulesBanner");function ml(){return pl()}a(ml,"_temp$1");var gl=a(()=>{let t=(0,B.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,i.jsxDEV)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:[(0,i.jsxDEV)("rect",{height:"14",rx:"2",width:"20",x:"2",y:"3"},void 0,!1),(0,i.jsxDEV)("path",{d:"M8 21h8M12 17v4"},void 0,!1)]},void 0,!0),t[0]=e):e=t[0],e},"MonitorIcon"),hl=a(()=>{let t=(0,B.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,i.jsxDEV)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:[(0,i.jsxDEV)("circle",{cx:"12",cy:"12",r:"4"},void 0,!1),(0,i.jsxDEV)("path",{d:"M12 2v2m0 16v2M4.9 4.9l1.4 1.4m11.4 11.4 1.4 1.4M2 12h2m16 0h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"},void 0,!1)]},void 0,!0),t[0]=e):e=t[0],e},"SunIcon"),vl=a(()=>{let t=(0,B.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,i.jsxDEV)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,viewBox:"0 0 24 24",children:(0,i.jsxDEV)("path",{d:"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8Z"},void 0,!1)},void 0,!1),t[0]=e):e=t[0],e},"MoonIcon"),xl=[{Icon:gl,value:"system"},{Icon:hl,value:"light"},{Icon:vl,value:"dark"}],bl=a(()=>{let t=(0,B.c)(19),{theme:e,setTheme:o}=al(),s=ie(),r;t[0]!==s?(r=s("Dark theme"),t[0]=s,t[1]=r):r=t[1];let n;t[2]!==s?(n=s("Light theme"),t[2]=s,t[3]=n):n=t[3];let l;t[4]!==s?(l=s("System theme"),t[4]=s,t[5]=l):l=t[5];let c;t[6]!==r||t[7]!==n||t[8]!==l?(c={dark:r,light:n,system:l},t[6]=r,t[7]=n,t[8]=l,t[9]=c):c=t[9];let p=c,d;t[10]!==s?(d=s("Theme"),t[10]=s,t[11]=d):d=t[11];let u;t[12]!==p||t[13]!==o||t[14]!==e?(u=xl.map(m=>{let{Icon:h,value:f}=m,v=e===f;return(0,i.jsxDEV)("button",{"aria-checked":v,"aria-label":p[f],className:U("relative flex size-7 cursor-pointer items-center justify-center rounded-md outline-none transition-colors focus-visible:bg-accent",v?"text-foreground":"text-muted-foreground hover:text-foreground"),"data-testid":`dash-app-theme-${f}`,onClick:a(()=>{o(f)},"onClick"),role:"radio",title:p[f],type:"button",children:[v&&(0,i.jsxDEV)(Yr.span,{className:"absolute inset-0 rounded-md border border-muted-foreground/40 bg-background/40",layoutId:"studio-theme-active",transition:{bounce:.1,duration:.45,type:"spring"}},void 0,!1),(0,i.jsxDEV)("span",{className:"relative",children:(0,i.jsxDEV)(h,{},void 0,!1)},void 0,!1)]},f,!0)}),t[12]=p,t[13]=o,t[14]=e,t[15]=u):u=t[15];let g;return t[16]!==d||t[17]!==u?(g=(0,i.jsxDEV)("div",{"aria-label":d,className:"inline-flex items-center gap-0.5 overflow-hidden rounded-md border border-border bg-muted/60 p-0.5","data-testid":"dash-app-theme",role:"radiogroup",children:u},void 0,!1),t[16]=d,t[17]=u,t[18]=g):g=t[18],g},"ThemeToggle");function oi(t){let e=(0,B.c)(4),o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let s;return e[2]!==o?(s=(0,i.jsxDEV)(yt.Root,{"data-slot":"popover",...o},void 0,!1),e[2]=o,e[3]=s):s=e[3],s}a(oi,"Popover");function si(t){let e=(0,B.c)(4),o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let s;return e[2]!==o?(s=(0,i.jsxDEV)(yt.Trigger,{"data-slot":"popover-trigger",...o},void 0,!1),e[2]=o,e[3]=s):s=e[3],s}a(si,"PopoverTrigger");function ri({align:t="end",alignOffset:e=0,className:o,keepMounted:s=!1,side:r="bottom",sideOffset:n=6,...l}){return(0,i.jsxDEV)(yt.Portal,{keepMounted:s,children:(0,i.jsxDEV)(yt.Positioner,{align:t,alignOffset:e,className:"isolate z-50 outline-none",side:r,sideOffset:n,children:(0,i.jsxDEV)(yt.Popup,{className:U("z-50 w-72 origin-(--transform-origin) rounded-lg border border-border bg-popover p-3 text-popover-foreground shadow-md outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",o),"data-slot":"popover-content",...l},void 0,!1)},void 0,!1)},void 0,!1)}a(ri,"PopoverContent");var Br=768;function yl(){let t=(0,B.c)(2),[e,o]=(0,q.useState)(void 0),s,r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(s=a(()=>{let n=globalThis.matchMedia(`(max-width: ${Br-1}px)`),l=a(()=>{o(globalThis.innerWidth<Br)},"onChange");return n.addEventListener("change",l),o(globalThis.innerWidth<Br),()=>{n.removeEventListener("change",l)}},"t0"),r=[],t[0]=s,t[1]=r):(s=t[0],r=t[1]),(0,q.useEffect)(s,r),!!e}a(yl,"useIsMobile");function Pl(t){let e=(0,B.c)(4),o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let s;return e[2]!==o?(s=(0,i.jsxDEV)(fe.Root,{"data-slot":"sheet",...o},void 0,!1),e[2]=o,e[3]=s):s=e[3],s}a(Pl,"Sheet");function Cl(t){let e=(0,B.c)(4),o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let s;return e[2]!==o?(s=(0,i.jsxDEV)(fe.Portal,{"data-slot":"sheet-portal",...o},void 0,!1),e[2]=o,e[3]=s):s=e[3],s}a(Cl,"SheetPortal");function Rl(t){let e=(0,B.c)(8),o,s;e[0]!==t?({className:o,...s}=t,e[0]=t,e[1]=o,e[2]=s):(o=e[1],s=e[2]);let r;e[3]!==o?(r=U("fixed inset-0 z-50 bg-black/10 text-xs/relaxed transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:",o),e[3]=o,e[4]=r):r=e[4];let n;return e[5]!==s||e[6]!==r?(n=(0,i.jsxDEV)(fe.Backdrop,{"data-slot":"sheet-overlay",className:r,...s},void 0,!1),e[5]=s,e[6]=r,e[7]=n):n=e[7],n}a(Rl,"SheetOverlay");function Sl({className:t,children:e,side:o="right",showCloseButton:s=!0,...r}){return(0,i.jsxDEV)(Cl,{children:[(0,i.jsxDEV)(Rl,{},void 0,!1),(0,i.jsxDEV)(fe.Popup,{"data-slot":"sheet-content","data-side":o,className:U("fixed z-50 flex flex-col bg-popover bg-clip-padding text-xs/relaxed text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-e data-[side=left]:data-ending-style:translate-x-[-2.5rem] rtl:data-[side=left]:data-ending-style:-translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] rtl:data-[side=left]:data-starting-style:-translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-s data-[side=right]:data-ending-style:translate-x-[2.5rem] rtl:data-[side=right]:data-ending-style:-translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] rtl:data-[side=right]:data-starting-style:-translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",t),...r,children:[e,s&&(0,i.jsxDEV)(fe.Close,{"data-slot":"sheet-close",render:(0,i.jsxDEV)(Ks,{variant:"ghost",className:"absolute top-3 end-3",size:"icon-sm"},void 0,!1),children:[(0,i.jsxDEV)(Gs,{icon:On,strokeWidth:2},void 0,!1),(0,i.jsxDEV)("span",{className:"sr-only",children:"Close"},void 0,!1)]},void 0,!0)]},void 0,!0)]},void 0,!0)}a(Sl,"SheetContent");function Nl(t){let e=(0,B.c)(8),o,s;e[0]!==t?({className:o,...s}=t,e[0]=t,e[1]=o,e[2]=s):(o=e[1],s=e[2]);let r;e[3]!==o?(r=U("flex flex-col gap-0.5 p-4",o),e[3]=o,e[4]=r):r=e[4];let n;return e[5]!==s||e[6]!==r?(n=(0,i.jsxDEV)("div",{"data-slot":"sheet-header",className:r,...s},void 0,!1),e[5]=s,e[6]=r,e[7]=n):n=e[7],n}a(Nl,"SheetHeader");function El(t){let e=(0,B.c)(8),o,s;e[0]!==t?({className:o,...s}=t,e[0]=t,e[1]=o,e[2]=s):(o=e[1],s=e[2]);let r;e[3]!==o?(r=U("text-sm font-medium text-foreground",o),e[3]=o,e[4]=r):r=e[4];let n;return e[5]!==s||e[6]!==r?(n=(0,i.jsxDEV)(fe.Title,{"data-slot":"sheet-title",className:r,...s},void 0,!1),e[5]=s,e[6]=r,e[7]=n):n=e[7],n}a(El,"SheetTitle");function Tl(t){let e=(0,B.c)(8),o,s;e[0]!==t?({className:o,...s}=t,e[0]=t,e[1]=o,e[2]=s):(o=e[1],s=e[2]);let r;e[3]!==o?(r=U("text-xs/relaxed text-muted-foreground",o),e[3]=o,e[4]=r):r=e[4];let n;return e[5]!==s||e[6]!==r?(n=(0,i.jsxDEV)(fe.Description,{"data-slot":"sheet-description",className:r,...s},void 0,!1),e[5]=s,e[6]=r,e[7]=n):n=e[7],n}a(Tl,"SheetDescription");var wl="sidebar_state",kl=3600*24*7,Ol="16rem",Ml="18rem",Il="3rem",Dl="b",ni=ct.createContext(null);function Vs(){let t=ct.useContext(ni);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}a(Vs,"useSidebar");function _l({defaultOpen:t=!0,open:e,onOpenChange:o,className:s,style:r,children:n,...l}){let c=yl(),[p,d]=ct.useState(!1),[u,g]=ct.useState(t),m=e??u,h=a(b=>{let C=typeof b=="function"?b(m):b;o?o(C):g(C),document.cookie=`${wl}=${C}; path=/; max-age=${kl}`},"setOpen"),f=a(()=>c?d(b=>!b):h(b=>!b),"toggleSidebar");ct.useEffect(()=>{let b=a(C=>{C.key===Dl&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),f())},"handleKeyDown");return globalThis.addEventListener("keydown",b),()=>globalThis.removeEventListener("keydown",b)},[f]);let x={state:m?"expanded":"collapsed",open:m,setOpen:h,isMobile:c,openMobile:p,setOpenMobile:d,toggleSidebar:f};return(0,i.jsxDEV)(ni.Provider,{value:x,children:(0,i.jsxDEV)("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Ol,"--sidebar-width-icon":Il,...r},className:U("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",s),...l,children:n},void 0,!1)},void 0,!1)}a(_l,"SidebarProvider");function Al({side:t="left",variant:e="sidebar",collapsible:o="offcanvas",className:s,children:r,dir:n,...l}){let{isMobile:c,state:p,openMobile:d,setOpenMobile:u}=Vs();return o==="none"?(0,i.jsxDEV)("div",{"data-slot":"sidebar",className:U("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",s),...l,children:r},void 0,!1):c?(0,i.jsxDEV)(Pl,{open:d,onOpenChange:u,...l,children:(0,i.jsxDEV)(Sl,{dir:n,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":Ml},side:t,children:[(0,i.jsxDEV)(Nl,{className:"sr-only",children:[(0,i.jsxDEV)(El,{children:"Sidebar"},void 0,!1),(0,i.jsxDEV)(Tl,{children:"Displays the mobile sidebar."},void 0,!1)]},void 0,!0),(0,i.jsxDEV)("div",{className:"flex h-full w-full flex-col",children:r},void 0,!1)]},void 0,!0)},void 0,!1):(0,i.jsxDEV)("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":p,"data-collapsible":p==="collapsed"?o:"","data-variant":e,"data-side":t,"data-slot":"sidebar",children:[(0,i.jsxDEV)("div",{"data-slot":"sidebar-gap",className:U("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")},void 0,!1),(0,i.jsxDEV)("div",{"data-slot":"sidebar-container","data-side":t,className:U("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-e group-data-[side=right]:border-s",s),...l,children:(0,i.jsxDEV)("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-none group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",children:r},void 0,!1)},void 0,!1)]},void 0,!0)}a(Al,"Sidebar");function Vl(t){let e=(0,B.c)(15),o,s,r;e[0]!==t?({className:o,onClick:s,...r}=t,e[0]=t,e[1]=o,e[2]=s,e[3]=r):(o=e[1],s=e[2],r=e[3]);let{toggleSidebar:n}=Vs(),l;e[4]!==o?(l=U(o),e[4]=o,e[5]=l):l=e[5];let c;e[6]!==s||e[7]!==n?(c=a(g=>{s?.(g),n()},"t2"),e[6]=s,e[7]=n,e[8]=c):c=e[8];let p,d;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=(0,i.jsxDEV)(Gs,{icon:Mn,strokeWidth:2,className:"rtl:rotate-180"},void 0,!1),d=(0,i.jsxDEV)("span",{className:"sr-only",children:"Toggle Sidebar"},void 0,!1),e[9]=p,e[10]=d):(p=e[9],d=e[10]);let u;return e[11]!==r||e[12]!==l||e[13]!==c?(u=(0,i.jsxDEV)(Ks,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:l,onClick:c,...r,children:[p,d]},void 0,!0),e[11]=r,e[12]=l,e[13]=c,e[14]=u):u=e[14],u}a(Vl,"SidebarTrigger");function Bl(t){let e=(0,B.c)(8),o,s;e[0]!==t?({className:o,...s}=t,e[0]=t,e[1]=o,e[2]=s):(o=e[1],s=e[2]);let r;e[3]!==o?(r=U("relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ms-0 md:peer-data-[variant=inset]:rounded-none md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ms-2",o),e[3]=o,e[4]=r):r=e[4];let n;return e[5]!==s||e[6]!==r?(n=(0,i.jsxDEV)("main",{"data-slot":"sidebar-inset",className:r,...s},void 0,!1),e[5]=s,e[6]=r,e[7]=n):n=e[7],n}a(Bl,"SidebarInset");function Ll(t){let e=(0,B.c)(8),o,s;e[0]!==t?({className:o,...s}=t,e[0]=t,e[1]=o,e[2]=s):(o=e[1],s=e[2]);let r;e[3]!==o?(r=U("flex flex-col gap-2 p-2",o),e[3]=o,e[4]=r):r=e[4];let n;return e[5]!==s||e[6]!==r?(n=(0,i.jsxDEV)("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:r,...s},void 0,!1),e[5]=s,e[6]=r,e[7]=n):n=e[7],n}a(Ll,"SidebarHeader");function Fl(t){let e=(0,B.c)(8),o,s;e[0]!==t?({className:o,...s}=t,e[0]=t,e[1]=o,e[2]=s):(o=e[1],s=e[2]);let r;e[3]!==o?(r=U("flex flex-col gap-2 p-2",o),e[3]=o,e[4]=r):r=e[4];let n;return e[5]!==s||e[6]!==r?(n=(0,i.jsxDEV)("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:r,...s},void 0,!1),e[5]=s,e[6]=r,e[7]=n):n=e[7],n}a(Fl,"SidebarFooter");function Hl(t){let e=(0,B.c)(8),o,s;e[0]!==t?({className:o,...s}=t,e[0]=t,e[1]=o,e[2]=s):(o=e[1],s=e[2]);let r;e[3]!==o?(r=U("flex min-h-0 flex-1 flex-col gap-0 overflow-x-hidden overflow-y-auto [scrollbar-color:color-mix(in_oklch,var(--muted-foreground)_25%,transparent)_transparent] [scrollbar-width:thin] [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-muted-foreground/25 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar]:w-1.5 hover:[scrollbar-color:color-mix(in_oklch,var(--muted-foreground)_50%,transparent)_transparent] hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/50",o),e[3]=o,e[4]=r):r=e[4];let n;return e[5]!==s||e[6]!==r?(n=(0,i.jsxDEV)("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:r,...s},void 0,!1),e[5]=s,e[6]=r,e[7]=n):n=e[7],n}a(Hl,"SidebarContent");function $l(t){let e=(0,B.c)(8),o,s;e[0]!==t?({className:o,...s}=t,e[0]=t,e[1]=o,e[2]=s):(o=e[1],s=e[2]);let r;e[3]!==o?(r=U("relative flex w-full min-w-0 flex-col p-2",o),e[3]=o,e[4]=r):r=e[4];let n;return e[5]!==s||e[6]!==r?(n=(0,i.jsxDEV)("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:r,...s},void 0,!1),e[5]=s,e[6]=r,e[7]=n):n=e[7],n}a($l,"SidebarGroup");function jl(t){let e=(0,B.c)(10),o,s,r,n;if(e[0]!==t){let{className:p,render:d,...u}=t;o=d,n=Zs,s="div",r=it({className:U("flex h-8 shrink-0 items-center rounded-none px-2 text-xs text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",p)},u),e[0]=t,e[1]=o,e[2]=s,e[3]=r,e[4]=n}else o=e[1],s=e[2],r=e[3],n=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l={slot:"sidebar-group-label",sidebar:"group-label"},e[5]=l):l=e[5];let c;return e[6]!==o||e[7]!==s||e[8]!==r?(c={defaultTagName:s,props:r,render:o,state:l},e[6]=o,e[7]=s,e[8]=r,e[9]=c):c=e[9],n(c)}a(jl,"SidebarGroupLabel");function zl(t){let e=(0,B.c)(8),o,s;e[0]!==t?({className:o,...s}=t,e[0]=t,e[1]=o,e[2]=s):(o=e[1],s=e[2]);let r;e[3]!==o?(r=U("w-full text-xs",o),e[3]=o,e[4]=r):r=e[4];let n;return e[5]!==s||e[6]!==r?(n=(0,i.jsxDEV)("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:r,...s},void 0,!1),e[5]=s,e[6]=r,e[7]=n):n=e[7],n}a(zl,"SidebarGroupContent");function Za(t){let e=(0,B.c)(8),o,s;e[0]!==t?({className:o,...s}=t,e[0]=t,e[1]=o,e[2]=s):(o=e[1],s=e[2]);let r;e[3]!==o?(r=U("flex w-full min-w-0 flex-col gap-0",o),e[3]=o,e[4]=r):r=e[4];let n;return e[5]!==s||e[6]!==r?(n=(0,i.jsxDEV)("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:r,...s},void 0,!1),e[5]=s,e[6]=r,e[7]=n):n=e[7],n}a(Za,"SidebarMenu");function qa(t){let e=(0,B.c)(8),o,s;e[0]!==t?({className:o,...s}=t,e[0]=t,e[1]=o,e[2]=s):(o=e[1],s=e[2]);let r;e[3]!==o?(r=U("group/menu-item relative",o),e[3]=o,e[4]=r):r=e[4];let n;return e[5]!==s||e[6]!==r?(n=(0,i.jsxDEV)("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:r,...s},void 0,!1),e[5]=s,e[6]=r,e[7]=n):n=e[7],n}a(qa,"SidebarMenuItem");var Ul=Jr("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-none p-2 text-start text-xs ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pe-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"},size:{default:"h-8 text-xs",sm:"h-7 text-xs",lg:"h-12 text-xs group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function ai({render:t,isActive:e=!1,variant:o="default",size:s="default",tooltip:r,className:n,...l}){let{isMobile:c,state:p}=Vs(),d=Zs({defaultTagName:"button",props:it({className:U(Ul({variant:o,size:s}),n)},l),render:r?(0,i.jsxDEV)(ll,{render:t},void 0,!1):t,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:s,active:e}});return r?(typeof r=="string"&&(r={children:r}),(0,i.jsxDEV)(il,{children:[d,(0,i.jsxDEV)(dl,{side:"right",align:"center",hidden:p!=="collapsed"||c,...r},void 0,!1)]},void 0,!0)):d}a(ai,"SidebarMenuButton");var G=a((t,e)=>(0,q.lazy)(()=>t().then(o=>({default:o[e]}))),"lazyNamed"),Wl=G(()=>import("./chunk-VMJKJWG6.js"),"InsightsPanel"),Zl=(0,q.lazy)(()=>import("./chunk-N2QDG3MW.js")),ql=(0,q.lazy)(()=>import("./chunk-57LYXHXH.js")),Gl=G(()=>import("./chunk-S53RUBW5.js"),"AnalyticsPanel"),Kl=(0,q.lazy)(()=>import("./chunk-2DS7JLWL.js")),Ql=G(()=>import("./chunk-DGWTR4G7.js"),"AuthConfigPanel"),Yl=G(()=>import("./chunk-GZXPPJVK.js"),"AuthSessionsPanel"),Jl=G(()=>import("./chunk-ZQCVDXDL.js"),"OrganizationsPanel"),Xl=G(()=>import("./chunk-DV2MNASX.js"),"UsersPanel"),ed=G(()=>import("./chunk-45QK5ZPN.js"),"ContainersPanel"),td=G(()=>import("./chunk-G2TFEWEQ.js"),"TableEditor"),od=G(()=>import("./chunk-7POIIWC5.js"),"ExportImportPanel"),sd=G(()=>import("./chunk-W7PCVQTE.js"),"MigrationsPanel"),rd=G(()=>import("./chunk-HFBRE65A.js"),"PitrPanel"),nd=G(()=>import("./chunk-OXCK3ZUG.js"),"FlagsPanel"),ad=G(()=>import("./chunk-PKAM3N5C.js"),"FunctionRunner"),id=G(()=>import("./chunk-XLILSHPE.js"),"FunctionStatsPanel"),ld=G(()=>import("./chunk-W5LWN6IP.js"),"AuditPanel"),dd=G(()=>import("./chunk-VXBZQIGY.js"),"LogDrainsPanel"),cd=(0,q.lazy)(()=>import("./chunk-D6ORSB24.js").then(t=>({default:t.LogsPanel}))),pd=G(()=>import("./chunk-VPDPN5RR.js"),"MailPanel"),ud=G(()=>import("./chunk-QGXGBHQO.js"),"SchedulePanel"),fd=(0,q.lazy)(()=>import("./chunk-DSX53PBM.js")),md=G(()=>import("./chunk-KNRVPCFX.js"),"KvBrowser"),gd=G(()=>import("./chunk-EGJX34WM.js"),"PaymentsPanel"),hd=G(()=>import("./chunk-SHIOUDOT.js"),"PermissionsPanel"),vd=(0,q.lazy)(()=>import("./chunk-QHA3TAEJ.js")),xd=(0,q.lazy)(()=>import("./chunk-SIDRSX7Y.js")),bd=(0,q.lazy)(()=>import("./chunk-SB4GT6PK.js")),yd=G(()=>import("./chunk-HTQL7AXU.js"),"HealthPanel"),Pd=G(()=>import("./chunk-W7SQVLBH.js"),"MetricsPanel"),Cd=G(()=>import("./chunk-VJPQUBN6.js"),"SchemaViewer"),Rd=G(()=>import("./chunk-QQWC62X7.js"),"SettingsPanel"),Sd=G(()=>import("./chunk-3BP4BTLR.js"),"SqlEditorPanel"),Nd=G(()=>import("./chunk-6RC6L33K.js"),"FileBrowser"),Ed=G(()=>import("./chunk-HG7Q5B3H.js"),"StorageRulesPanel"),Td=G(()=>import("./chunk-2PDQ4KZ6.js"),"VectorBrowser"),wd=(0,q.lazy)(()=>import("./chunk-63XKJQTQ.js")),ii=(0,q.createContext)(null),kd={analytics:(0,i.jsxDEV)("path",{d:"M5 20V10m6.5 10V4M18 20v-7M3 20h18"},void 0,!1),api:(0,i.jsxDEV)("path",{d:"m9 8-4 4 4 4m6-8 4 4-4 4M13 5l-2 14"},void 0,!1),audit:(0,i.jsxDEV)("path",{d:"M7 4h7l4 4v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1Zm6 0v5h5M9 13h6M9 16h6M9 10h2"},void 0,!1),authConfig:(0,i.jsxDEV)("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm7.4-3a7.4 7.4 0 0 0-.1-1.2l2-1.6-2-3.4-2.4 1a7.3 7.3 0 0 0-2-1.2l-.4-2.6h-3.6l-.4 2.6a7.3 7.3 0 0 0-2 1.2l-2.4-1-2 3.4 2 1.6a7.4 7.4 0 0 0 0 2.4l-2 1.6 2 3.4 2.4-1a7.3 7.3 0 0 0 2 1.2l.4 2.6h3.6l.4-2.6a7.3 7.3 0 0 0 2-1.2l2.4 1 2-3.4-2-1.6a7.4 7.4 0 0 0 .1-1.2Z"},void 0,!1),authSessions:(0,i.jsxDEV)("path",{d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-13.5V12l4 2"},void 0,!1),containers:(0,i.jsxDEV)("path",{d:"M3 7.5 12 3l9 4.5v9L12 21l-9-4.5v-9Zm0 0 9 4.5m0 0 9-4.5m-9 4.5V21"},void 0,!1),dashboards:(0,i.jsxDEV)("path",{d:"M4 5h7v6H4V5Zm9 0h7v4h-7V5ZM4 14h7v5H4v-5Zm9-1h7v6h-7v-6Z"},void 0,!1),drains:(0,i.jsxDEV)("path",{d:"M5 5h14M7 5v6a5 5 0 0 0 10 0V5M10 16h4v3h-4zM12 19v2"},void 0,!1),data:(0,i.jsxDEV)("path",{d:"M5 6c0-1.4 3.1-2.5 7-2.5s7 1.1 7 2.5-3.1 2.5-7 2.5S5 7.4 5 6Zm0 0v12c0 1.4 3.1 2.5 7 2.5s7-1.1 7-2.5V6M5 12c0 1.4 3.1 2.5 7 2.5s7-1.1 7-2.5"},void 0,!1),export:(0,i.jsxDEV)("path",{d:"M12 3v11m0 0 4-4m-4 4-4-4M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2"},void 0,!1),fanout:(0,i.jsxDEV)("path",{d:"M12 5a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm-7 16a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm14 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM12 7v3.5M12 10.5 6 17m6-6.5 6 6.5"},void 0,!1),files:(0,i.jsxDEV)("path",{d:"M4 7a2 2 0 0 1 2-2h3l2 2.5h7a2 2 0 0 1 2 2V18a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V7Z"},void 0,!1),flags:(0,i.jsxDEV)("path",{d:"M6 21V4m0 0h11l-2 3 2 3H6"},void 0,!1),functions:(0,i.jsxDEV)("path",{d:"m9 8-4 4 4 4m6-8 4 4-4 4"},void 0,!1),health:(0,i.jsxDEV)("path",{d:"M3 12h4l2 6 4-14 2 8h6"},void 0,!1),home:(0,i.jsxDEV)("path",{d:"M3 11.5 12 4l9 7.5M5 10v9a1 1 0 0 0 1 1h4v-6h4v6h4a1 1 0 0 0 1-1v-9"},void 0,!1),insights:(0,i.jsxDEV)("path",{d:"M12 3a6 6 0 0 0-3.6 10.8c.5.4.8.9.9 1.5l.2 1.2h5l.2-1.2c.1-.6.4-1.1.9-1.5A6 6 0 0 0 12 3ZM9.5 20.5h5M10 18h4"},void 0,!1),kv:(0,i.jsxDEV)("path",{d:"M5 5h14v4H5V5Zm0 5h14v4H5v-4Zm0 5h14v4H5v-4Z"},void 0,!1),logs:(0,i.jsxDEV)("path",{d:"M5 6h14M5 10h14M5 14h9M5 18h11"},void 0,!1),mail:(0,i.jsxDEV)("path",{d:"M4 5h16v14H4V5Zm0 1.5 8 6 8-6"},void 0,!1),payments:(0,i.jsxDEV)("path",{d:"M3 7h18v10H3V7Zm0 3h18M7 14h4"},void 0,!1),metrics:(0,i.jsxDEV)("path",{d:"M5 20V10m6.5 10V4M18 20v-7M3 20h18"},void 0,!1),migrations:(0,i.jsxDEV)("path",{d:"M4 12a8 8 0 0 1 13.7-5.6L20 8M20 4v4h-4M20 12a8 8 0 0 1-13.7 5.6L4 16m0 4v-4h4"},void 0,!1),organizations:(0,i.jsxDEV)("path",{d:"M3 21V8l6-4 6 4v13M9 21v-5h2v5M15 11h6v10M18 14v.01M18 17v.01M6 9v.01M6 12v.01M6 15v.01"},void 0,!1),permissions:(0,i.jsxDEV)("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-3 8 2.2 2.2L15 9.5M8.5 16h7"},void 0,!1),pitr:(0,i.jsxDEV)("path",{d:"M12 21a9 9 0 1 0-9-9M12 7.5V12l3 2M3 12l-2-2m2 2 2-2"},void 0,!1),queues:(0,i.jsxDEV)("path",{d:"M4 6h16M4 10h16M4 14h10M4 18h10m4-2 3 2-3 2v-4Z"},void 0,!1),realtime:(0,i.jsxDEV)("path",{d:"M5 12a7 7 0 0 1 14 0M8 12a4 4 0 0 1 8 0M12 12v8m0-8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"},void 0,!1),rls:(0,i.jsxDEV)("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3ZM8.5 10h7M8.5 13h7"},void 0,!1),schedule:(0,i.jsxDEV)("path",{d:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-13.5V12l4 2"},void 0,!1),schema:(0,i.jsxDEV)("path",{d:"M4 5h16v14H4V5Zm0 5h16M10 10v9M4 14.5h16"},void 0,!1),sql:(0,i.jsxDEV)("path",{d:"M4 5h16v14H4V5Zm3 4 3 3-3 3m6 0h4"},void 0,!1),storageRules:(0,i.jsxDEV)("path",{d:"M7 10V7a5 5 0 0 1 10 0v3m-11 0h12a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1Zm6 4v2"},void 0,!1),security:(0,i.jsxDEV)("path",{d:"M12 3 5 6v5c0 4.5 3 7.8 7 9 4-1.2 7-4.5 7-9V6l-7-3Zm-2.5 8.5 2 2 4-4"},void 0,!1),settings:(0,i.jsxDEV)("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm7.4-3a7.4 7.4 0 0 0-.1-1.2l2-1.6-2-3.4-2.4 1a7.3 7.3 0 0 0-2-1.2l-.4-2.6H10.5l-.4 2.6a7.3 7.3 0 0 0-2 1.2l-2.4-1-2 3.4 2 1.6a7.4 7.4 0 0 0 0 2.4l-2 1.6 2 3.4 2.4-1a7.3 7.3 0 0 0 2 1.2l.4 2.6h3.6l.4-2.6a7.3 7.3 0 0 0 2-1.2l2.4 1 2-3.4-2-1.6a7.4 7.4 0 0 0 .1-1.2Z"},void 0,!1),users:(0,i.jsxDEV)("path",{d:"M16 20v-2a4 4 0 0 0-4-4H7a4 4 0 0 0-4 4v2M9.5 10a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Zm11.5 10v-2a4 4 0 0 0-3-3.85M16 3.13A4 4 0 0 1 16 11"},void 0,!1),vectors:(0,i.jsxDEV)("path",{d:"M4 7l8-4 8 4-8 4-8-4Zm0 5 8 4 8-4M4 17l8 4 8-4"},void 0,!1),workflows:(0,i.jsxDEV)("path",{d:"M5 5h5v5H5V5Zm9 9h5v5h-5v-5ZM7.5 10v2a2 2 0 0 0 2 2H14m2.5-4V8a2 2 0 0 0-2-2H10"},void 0,!1)},Ga=[{key:"overview",tabs:["home","dashboards"]},{key:"database",tabs:["data","sql","schema","migrations","vectors","pitr","export"]},{key:"functions",tabs:["functions","api","workflows","queues","containers"]},{key:"auth",tabs:["users","organizations","authSessions","authConfig"]},{key:"storage",tabs:["files","storageRules","kv"]},{key:"observability",tabs:["logs","audit","realtime","fanout","metrics","analytics","health"]},{key:"advisors",tabs:["security","rls","permissions","insights"]},{key:"operations",tabs:["schedule","mail","drains","payments","flags"]},{key:"settings",tabs:["settings"]}],Od={analytics:"analytics",authConfig:"auth",authSessions:"auth",containers:"containers",files:"storage",flags:"flags",kv:"kv",mail:"mail",organizations:"auth",payments:"payments",queues:"queues",schedule:"scheduler",storageRules:"storage",users:"auth",vectors:"vectors",workflows:"workflows"},Ka=a((t,e)=>{let o=Od[t];return o===void 0||e[o]},"isTabVisible"),Lr=a(t=>{let e=(0,B.c)(2),{tab:o}=t,s=kd[o],r;return e[0]!==s?(r=(0,i.jsxDEV)("svg",{"aria-hidden":"true",className:"size-4 shrink-0",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:s},void 0,!1),e[0]=s,e[1]=r):r=e[1],r},"TabIcon"),li=["home","data","sql","functions","api","workflows","queues","containers","schema","migrations","vectors","export","pitr","users","organizations","authSessions","authConfig","files","storageRules","kv","dashboards","metrics","analytics","health","security","rls","permissions","insights","logs","realtime","mail","payments","audit","schedule","drains","flags","settings"],Md=new Set(["api","data","sql"]),Id=a(t=>{let e=t.split("/").findLast(Boolean)??"";return li.includes(e)?e:"home"},"tabFromPathname"),Dd=a(t=>{let e=(0,B.c)(19),{chrome:o,connected:s}=t,r=ie(),n;e[0]!==r?(n=r("admin token"),e[0]=r,e[1]=n):n=e[1];let l;e[2]!==n?(l=(0,i.jsxDEV)("label",{className:"text-xs font-medium text-foreground",htmlFor:"dash-app-token",children:n},void 0,!1),e[2]=n,e[3]=l):l=e[3];let c;e[4]!==o.onTokenChange||e[5]!==o.token?(c=(0,i.jsxDEV)(an,{className:"h-8","data-testid":"dash-app-token",id:"dash-app-token",onChange:o.onTokenChange,placeholder:"LUNORA_ADMIN_TOKEN",type:"password",value:o.token},void 0,!1),e[4]=o.onTokenChange,e[5]=o.token,e[6]=c):c=e[6];let p;e[7]!==s||e[8]!==r?(p=s&&(0,i.jsxDEV)("p",{className:"flex items-start gap-1.5 text-[11px] text-muted-foreground","data-testid":"dash-app-token-warning",role:"note",children:[(0,i.jsxDEV)("span",{"aria-hidden":"true",className:"text-warning",children:"\u26A0"},void 0,!1),r("Token rides the WebSocket URL \u2014 it can surface in browser DevTools and server logs. Use a dev-only token.")]},void 0,!0),e[7]=s,e[8]=r,e[9]=p):p=e[9];let d;e[10]!==o.clearToken||e[11]!==s||e[12]!==r?(d=s&&(0,i.jsxDEV)("button",{className:"self-start rounded-md border border-border px-2.5 py-1 text-xs font-medium outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"dash-app-clear-token",onClick:o.clearToken,type:"button",children:r("Clear")},void 0,!1),e[10]=o.clearToken,e[11]=s,e[12]=r,e[13]=d):d=e[13];let u;return e[14]!==l||e[15]!==c||e[16]!==p||e[17]!==d?(u=(0,i.jsxDEV)("div",{className:"flex flex-col gap-2",children:[l,c,p,d]},void 0,!0),e[14]=l,e[15]=c,e[16]=p,e[17]=d,e[18]=u):u=e[18],u},"ConnectPopoverContent"),_d=a(t=>{let e=(0,B.c)(25),{current:o,group:s,groupLabel:r,selectTab:n,tabDescription:l,tabLabel:c}=t,p=s.tabs.includes(o)?"page":void 0,d=r[s.key],u=s.tabs[0],g;e[0]!==u?(g=(0,i.jsxDEV)(Lr,{tab:u},void 0,!1),e[0]=u,e[1]=g):g=e[1];let m;e[2]!==p||e[3]!==d||e[4]!==g?(m=(0,i.jsxDEV)(si,{"aria-current":p,"aria-label":d,className:"mx-auto flex size-8 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:bg-sidebar-accent data-[popup-open]:bg-sidebar-accent data-[popup-open]:text-sidebar-accent-foreground data-[popup-open]:shadow-xs aria-[current=page]:bg-sidebar-accent aria-[current=page]:text-sidebar-accent-foreground aria-[current=page]:shadow-xs",delay:120,openOnHover:!0,children:g},void 0,!1),e[2]=p,e[3]=d,e[4]=g,e[5]=m):m=e[5];let h=r[s.key],f;e[6]!==h?(f=(0,i.jsxDEV)("div",{className:"px-2 py-1.5 text-[11px] font-medium tracking-wider text-muted-foreground uppercase",children:h},void 0,!1),e[6]=h,e[7]=f):f=e[7];let v;if(e[8]!==o||e[9]!==s.tabs||e[10]!==n||e[11]!==l||e[12]!==c){let C;e[14]!==o||e[15]!==n||e[16]!==l||e[17]!==c?(C=a(P=>(0,i.jsxDEV)("button",{"aria-current":o===P?"page":void 0,className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-start text-[13px] text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent aria-[current=page]:bg-accent aria-[current=page]:font-medium [&_svg]:opacity-70 aria-[current=page]:[&_svg]:opacity-100","data-tab":P,"data-testid":`dash-tab-${P}`,onClick:n,title:l[P],type:"button",children:[(0,i.jsxDEV)(Lr,{tab:P},void 0,!1),(0,i.jsxDEV)("span",{children:c[P]},void 0,!1)]},P,!0),"t92"),e[14]=o,e[15]=n,e[16]=l,e[17]=c,e[18]=C):C=e[18],v=s.tabs.map(C),e[8]=o,e[9]=s.tabs,e[10]=n,e[11]=l,e[12]=c,e[13]=v}else v=e[13];let x;e[19]!==f||e[20]!==v?(x=(0,i.jsxDEV)(ri,{align:"start",className:"w-56 p-1",side:"right",sideOffset:8,children:[f,v]},void 0,!0),e[19]=f,e[20]=v,e[21]=x):x=e[21];let b;return e[22]!==m||e[23]!==x?(b=(0,i.jsxDEV)(oi,{children:[m,x]},void 0,!0),e[22]=m,e[23]=x,e[24]=b):b=e[24],b},"CollapsedGroupNav"),Ad=a(t=>{let e=(0,B.c)(45),{chrome:o,collapsed:s,connected:r}=t,n=ie();if(o===null){let P;e[0]!==n?(P=n("Admin"),e[0]=n,e[1]=P):P=e[1];let N;e[2]===Symbol.for("react.memo_cache_sentinel")?(N=(0,i.jsxDEV)("span",{className:"flex size-8 items-center justify-center rounded-full bg-sidebar-accent text-[11px] font-medium",children:"C"},void 0,!1),e[2]=N):N=e[2];let S;e[3]!==n?(S=n("Admin"),e[3]=n,e[4]=S):S=e[4];let E;e[5]!==S?(E=(0,i.jsxDEV)("span",{className:"truncate text-[13px] font-medium",children:S},void 0,!1),e[5]=S,e[6]=E):E=e[6];let T;e[7]!==n?(T=n("Studio"),e[7]=n,e[8]=T):T=e[8];let k;e[9]!==T?(k=(0,i.jsxDEV)("span",{className:"truncate text-[11px] text-muted-foreground",children:T},void 0,!1),e[9]=T,e[10]=k):k=e[10];let w;e[11]!==E||e[12]!==k?(w=(0,i.jsxDEV)("span",{className:"grid flex-1 text-start leading-tight",children:[E,k]},void 0,!0),e[11]=E,e[12]=k,e[13]=w):w=e[13];let O;return e[14]!==P||e[15]!==w?(O=(0,i.jsxDEV)(ai,{className:"data-active:bg-transparent",size:"lg",tooltip:P,children:[N,w]},void 0,!0),e[14]=P,e[15]=w,e[16]=O):O=e[16],O}let l=s?"mx-auto size-8 justify-center":"w-full p-2",c;e[17]!==l?(c=U("flex items-center gap-2 rounded-md text-start outline-none transition-colors hover:bg-sidebar-accent focus-visible:bg-sidebar-accent",l),e[17]=l,e[18]=c):c=e[18];let p;e[19]!==r||e[20]!==n?(p=n(r?"Connected":"Not connected"),e[19]=r,e[20]=n,e[21]=p):p=e[21];let d=r?"bg-success":"bg-muted-foreground/50",u;e[22]!==d?(u=U("absolute -end-0.5 -bottom-0.5 size-2.5 rounded-full border-2 border-sidebar",d),e[22]=d,e[23]=u):u=e[23];let g;e[24]!==u?(g=(0,i.jsxDEV)("span",{className:"relative flex size-8 shrink-0 items-center justify-center rounded-full bg-sidebar-accent text-[11px] font-medium",children:["C",(0,i.jsxDEV)("span",{"aria-hidden":"true",className:u},void 0,!1)]},void 0,!0),e[24]=u,e[25]=g):g=e[25];let m;e[26]!==s||e[27]!==r||e[28]!==n?(m=!s&&(0,i.jsxDEV)(i.Fragment,{children:[(0,i.jsxDEV)("span",{className:"grid flex-1 text-start leading-tight",children:[(0,i.jsxDEV)("span",{className:"truncate text-[13px] font-medium",children:n("Admin")},void 0,!1),(0,i.jsxDEV)("span",{className:"truncate text-[11px] text-muted-foreground",children:n(r?"Connected":"Not connected")},void 0,!1)]},void 0,!0),(0,i.jsxDEV)("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeWidth:1.7,viewBox:"0 0 24 24",children:(0,i.jsxDEV)("path",{d:"m8 9 4-4 4 4M8 15l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"},void 0,!1)},void 0,!1)]},void 0,!0),e[26]=s,e[27]=r,e[28]=n,e[29]=m):m=e[29];let h;e[30]!==c||e[31]!==p||e[32]!==g||e[33]!==m?(h=(0,i.jsxDEV)(si,{className:c,"data-testid":"dash-app-connect",title:p,children:[g,m]},void 0,!0),e[30]=c,e[31]=p,e[32]=g,e[33]=m,e[34]=h):h=e[34];let f=s?"end":"start",v=s?"right":"top",x;e[35]!==o||e[36]!==r?(x=(0,i.jsxDEV)(Dd,{chrome:o,connected:r},void 0,!1),e[35]=o,e[36]=r,e[37]=x):x=e[37];let b;e[38]!==v||e[39]!==x||e[40]!==f?(b=(0,i.jsxDEV)(ri,{align:f,keepMounted:!0,side:v,children:x},void 0,!1),e[38]=v,e[39]=x,e[40]=f,e[41]=b):b=e[41];let C;return e[42]!==b||e[43]!==h?(C=(0,i.jsxDEV)(oi,{children:[h,b]},void 0,!0),e[42]=b,e[43]=h,e[44]=C):C=e[44],C},"SidebarFooterProfile"),Vd=a(t=>{let e=(0,B.c)(28),{chrome:o,connected:s,current:r,groupLabel:n,groups:l,selectTab:c,tabDescription:p,tabLabel:d}=t,u=ie(),{state:g}=Vs(),m=g==="collapsed",h=m&&"justify-center px-0",f;e[0]!==h?(f=U("flex items-center gap-2.5 px-1.5 py-1",h),e[0]=h,e[1]=f):f=e[1];let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=(0,i.jsxDEV)(cl,{className:"size-9 shrink-0 text-foreground"},void 0,!1),e[2]=v):v=e[2];let x;e[3]!==m||e[4]!==s||e[5]!==u?(x=!m&&(0,i.jsxDEV)(i.Fragment,{children:[(0,i.jsxDEV)("span",{className:"grid flex-1 leading-tight",children:[(0,i.jsxDEV)("span",{className:"truncate text-sm font-semibold text-foreground",children:"lunora"},void 0,!1),(0,i.jsxDEV)("span",{className:"truncate text-[11px] text-muted-foreground",children:u("Studio")},void 0,!1)]},void 0,!0),(0,i.jsxDEV)(go,{className:"px-1.5 text-[10px] tracking-wider uppercase",variant:"secondary",children:u(s?"Live":"Local")},void 0,!1)]},void 0,!0),e[3]=m,e[4]=s,e[5]=u,e[6]=x):x=e[6];let b;e[7]!==f||e[8]!==x?(b=(0,i.jsxDEV)(Ll,{children:(0,i.jsxDEV)("div",{className:f,children:[v,x]},void 0,!0)},void 0,!1),e[7]=f,e[8]=x,e[9]=b):b=e[9];let C;e[10]!==m||e[11]!==r||e[12]!==n||e[13]!==l||e[14]!==c||e[15]!==p||e[16]!==d?(C=m?l.map(E=>(0,i.jsxDEV)(_d,{current:r,group:E,groupLabel:n,selectTab:c,tabDescription:p,tabLabel:d},E.key,!1)):l.map(E=>(0,i.jsxDEV)($l,{children:[(0,i.jsxDEV)(jl,{className:"text-[11px] font-medium tracking-wider uppercase",children:n[E.key]},void 0,!1),(0,i.jsxDEV)(zl,{children:(0,i.jsxDEV)(Za,{children:E.tabs.map(T=>(0,i.jsxDEV)(qa,{children:(0,i.jsxDEV)(ai,{className:"data-active:text-foreground dark:data-active:text-royal-amethyst data-active:shadow-[inset_2px_0_0_0_var(--royal-amethyst)]","data-tab":T,"data-testid":`dash-tab-${T}`,isActive:r===T,onClick:c,title:p[T],tooltip:p[T],children:[(0,i.jsxDEV)(Lr,{tab:T},void 0,!1),(0,i.jsxDEV)("span",{children:d[T]},void 0,!1)]},void 0,!0)},T,!1))},void 0,!1)},void 0,!1)]},E.key,!0)),e[10]=m,e[11]=r,e[12]=n,e[13]=l,e[14]=c,e[15]=p,e[16]=d,e[17]=C):C=e[17];let P;e[18]!==C?(P=(0,i.jsxDEV)(Hl,{children:C},void 0,!1),e[18]=C,e[19]=P):P=e[19];let N;e[20]!==o||e[21]!==m||e[22]!==s?(N=(0,i.jsxDEV)(Fl,{children:(0,i.jsxDEV)(Za,{children:(0,i.jsxDEV)(qa,{children:(0,i.jsxDEV)(Ad,{chrome:o,collapsed:m,connected:s},void 0,!1)},void 0,!1)},void 0,!1)},void 0,!1),e[20]=o,e[21]=m,e[22]=s,e[23]=N):N=e[23];let S;return e[24]!==b||e[25]!==P||e[26]!==N?(S=(0,i.jsxDEV)(Al,{collapsible:"icon",variant:"inset",children:[b,P,N]},void 0,!0),e[24]=b,e[25]=P,e[26]=N,e[27]=S):S=e[27],S},"StudioSidebar"),di=a(()=>{let t=(0,B.c)(1),e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,i.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"dash-pending",children:[(0,i.jsxDEV)("div",{className:"flex items-center gap-2",children:[(0,i.jsxDEV)(ls,{className:"h-8 w-40"},void 0,!1),(0,i.jsxDEV)(ls,{className:"h-8 w-24"},void 0,!1)]},void 0,!0),(0,i.jsxDEV)(ls,{className:"h-72 w-full"},void 0,!1)]},void 0,!0),t[0]=e):e=t[0],e},"RoutePending"),Bd=a(()=>{let t=(0,B.c)(294),e=ie(),o=pt(),s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={select:jd},t[0]=s):s=t[0];let r=qr(s),n,l;t[1]!==r?(n=Id(r),l=Md.has(n),t[1]=r,t[2]=n,t[3]=l):(n=t[2],l=t[3]);let c=l,p=Dr(),d;t[4]!==p?(d=a(at=>({...at,tabs:at.tabs.filter(Bo=>Ka(Bo,p))}),"t2"),t[4]=p,t[5]=d):d=t[5];let u=Ga.map(d).filter(zd),g,m;t[6]!==n||t[7]!==p||t[8]!==o?(g=a(()=>{Ka(n,p)||$e(o({replace:!0,to:"/home"}))},"t3"),m=[n,p,o],t[6]=n,t[7]=p,t[8]=o,t[9]=g,t[10]=m):(g=t[9],m=t[10]),(0,q.useEffect)(g,m);let h;t[11]!==e?(h=e("Analytics"),t[11]=e,t[12]=h):h=t[12];let f;t[13]!==e?(f=e("API"),t[13]=e,t[14]=f):f=t[14];let v;t[15]!==e?(v=e("Audit"),t[15]=e,t[16]=v):v=t[16];let x;t[17]!==e?(x=e("Configuration"),t[17]=e,t[18]=x):x=t[18];let b;t[19]!==e?(b=e("Sessions"),t[19]=e,t[20]=b):b=t[20];let C;t[21]!==e?(C=e("Containers"),t[21]=e,t[22]=C):C=t[22];let P;t[23]!==e?(P=e("Dashboards"),t[23]=e,t[24]=P):P=t[24];let N;t[25]!==e?(N=e("Data"),t[25]=e,t[26]=N):N=t[26];let S;t[27]!==e?(S=e("Log drains"),t[27]=e,t[28]=S):S=t[28];let E;t[29]!==e?(E=e("Export / Import"),t[29]=e,t[30]=E):E=t[30];let T;t[31]!==e?(T=e("Fan-out"),t[31]=e,t[32]=T):T=t[32];let k;t[33]!==e?(k=e("Files"),t[33]=e,t[34]=k):k=t[34];let w;t[35]!==e?(w=e("Flags"),t[35]=e,t[36]=w):w=t[36];let O;t[37]!==e?(O=e("Functions"),t[37]=e,t[38]=O):O=t[38];let V;t[39]!==e?(V=e("Health"),t[39]=e,t[40]=V):V=t[40];let W;t[41]!==e?(W=e("Home"),t[41]=e,t[42]=W):W=t[42];let _;t[43]!==e?(_=e("Performance"),t[43]=e,t[44]=_):_=t[44];let H;t[45]!==e?(H=e("KV"),t[45]=e,t[46]=H):H=t[46];let $;t[47]!==e?($=e("Logs"),t[47]=e,t[48]=$):$=t[48];let Z;t[49]!==e?(Z=e("Metrics"),t[49]=e,t[50]=Z):Z=t[50];let K;t[51]!==e?(K=e("Migrations"),t[51]=e,t[52]=K):K=t[52];let D;t[53]!==e?(D=e("Organizations"),t[53]=e,t[54]=D):D=t[54];let I;t[55]!==e?(I=e("Time Travel"),t[55]=e,t[56]=I):I=t[56];let z;t[57]!==e?(z=e("Mail"),t[57]=e,t[58]=z):z=t[58];let te;t[59]!==e?(te=e("Payments"),t[59]=e,t[60]=te):te=t[60];let re;t[61]!==e?(re=e("Permissions"),t[61]=e,t[62]=re):re=t[62];let ne;t[63]!==e?(ne=e("Queues"),t[63]=e,t[64]=ne):ne=t[64];let J;t[65]!==e?(J=e("Realtime"),t[65]=e,t[66]=J):J=t[66];let ee;t[67]!==e?(ee=e("RLS Policies"),t[67]=e,t[68]=ee):ee=t[68];let ae;t[69]!==e?(ae=e("Scheduled"),t[69]=e,t[70]=ae):ae=t[70];let Be;t[71]!==e?(Be=e("Schema"),t[71]=e,t[72]=Be):Be=t[72];let me;t[73]!==e?(me=e("Security"),t[73]=e,t[74]=me):me=t[74];let he;t[75]!==e?(he=e("Settings"),t[75]=e,t[76]=he):he=t[76];let ve;t[77]!==e?(ve=e("SQL editor"),t[77]=e,t[78]=ve):ve=t[78];let Le;t[79]!==e?(Le=e("Access Rules"),t[79]=e,t[80]=Le):Le=t[80];let L;t[81]!==e?(L=e("Users"),t[81]=e,t[82]=L):L=t[82];let Q;t[83]!==e?(Q=e("Vectors"),t[83]=e,t[84]=Q):Q=t[84];let X;t[85]!==e?(X=e("Workflows"),t[85]=e,t[86]=X):X=t[86];let xe;t[87]!==C||t[88]!==P||t[89]!==N||t[90]!==S||t[91]!==E||t[92]!==T||t[93]!==k||t[94]!==w||t[95]!==O||t[96]!==V||t[97]!==W||t[98]!==_||t[99]!==H||t[100]!==$||t[101]!==Z||t[102]!==K||t[103]!==D||t[104]!==I||t[105]!==z||t[106]!==te||t[107]!==re||t[108]!==ne||t[109]!==J||t[110]!==ee||t[111]!==ae||t[112]!==Be||t[113]!==me||t[114]!==he||t[115]!==ve||t[116]!==Le||t[117]!==L||t[118]!==Q||t[119]!==X||t[120]!==h||t[121]!==f||t[122]!==v||t[123]!==x||t[124]!==b?(xe={analytics:h,api:f,audit:v,authConfig:x,authSessions:b,containers:C,dashboards:P,data:N,drains:S,export:E,fanout:T,files:k,flags:w,functions:O,health:V,home:W,insights:_,kv:H,logs:$,metrics:Z,migrations:K,organizations:D,pitr:I,mail:z,payments:te,permissions:re,queues:ne,realtime:J,rls:ee,schedule:ae,schema:Be,security:me,settings:he,sql:ve,storageRules:Le,users:L,vectors:Q,workflows:X},t[87]=C,t[88]=P,t[89]=N,t[90]=S,t[91]=E,t[92]=T,t[93]=k,t[94]=w,t[95]=O,t[96]=V,t[97]=W,t[98]=_,t[99]=H,t[100]=$,t[101]=Z,t[102]=K,t[103]=D,t[104]=I,t[105]=z,t[106]=te,t[107]=re,t[108]=ne,t[109]=J,t[110]=ee,t[111]=ae,t[112]=Be,t[113]=me,t[114]=he,t[115]=ve,t[116]=Le,t[117]=L,t[118]=Q,t[119]=X,t[120]=h,t[121]=f,t[122]=v,t[123]=x,t[124]=b,t[125]=xe):xe=t[125];let se=xe,Fe={advisors:e("Advisors"),auth:e("Auth"),database:e("Database"),functions:e("Functions"),observability:e("Observability"),operations:e("Operations"),overview:e("Overview"),settings:e("Settings"),storage:e("Storage")},ce;t[126]!==e?(ce=e("Usage and latency from Analytics Engine \u2014 request volume, p50/p95, and hot shards."),t[126]=e,t[127]=ce):ce=t[127];let pe;t[128]!==e?(pe=e("Interactive OpenAPI reference and copy-paste snippets for your functions."),t[128]=e,t[129]=pe):pe=t[129];let Pe;t[130]!==e?(Pe=e("A durable log of admin state-changing operations."),t[130]=e,t[131]=Pe):Pe=t[131];let Ce;t[132]!==e?(Ce=e("Enabled plugins and session config (read-only)."),t[132]=e,t[133]=Ce):Ce=t[133];let Re;t[134]!==e?(Re=e("Browse and revoke active sessions across all users."),t[134]=e,t[135]=Re):Re=t[135];let Se;t[136]!==e?(Se=e("Live Cloudflare Containers \u2014 current lifecycle state per container from the log stream."),t[136]=e,t[137]=Se):Se=t[137];let Ne;t[138]!==e?(Ne=e("Chart widgets backed by saved read-only SQL queries."),t[138]=e,t[139]=Ne):Ne=t[139];let Ee;t[140]!==e?(Ee=e("Browse and edit rows across your shard and global tables."),t[140]=e,t[141]=Ee):Ee=t[141];let Te;t[142]!==e?(Te=e("Forward logs to Logpush, Tail Workers, or a webhook collector."),t[142]=e,t[143]=Te):Te=t[143];let we;t[144]!==e?(we=e("Export a shard to NDJSON, or import rows from it."),t[144]=e,t[145]=we):we=t[145];let ke;t[146]!==e?(ke=e("Realtime fan-out cost and per-topic subscriber counts for this shard."),t[146]=e,t[147]=ke):ke=t[147];let Oe;t[148]!==e?(Oe=e("Browse objects in your R2 storage buckets."),t[148]=e,t[149]=Oe):Oe=t[149];let Me;t[150]!==e?(Me=e("Inspect feature flags and their live evaluation under a targeting context."),t[150]=e,t[151]=Me):Me=t[151];let ze;t[152]!==e?(ze=e("Run registered queries, mutations, and actions."),t[152]=e,t[153]=ze):ze=t[153];let Ue;t[154]!==e?(Ue=e("At-a-glance connection, error, and shard signals."),t[154]=e,t[155]=Ue):Ue=t[155];let We;t[156]!==e?(We=e("Connection, health, and advisor summary for your deployment."),t[156]=e,t[157]=We):We=t[157];let Ze;t[158]!==e?(Ze=e("Surface slow functions, error spikes, and cache problems."),t[158]=e,t[159]=Ze):Ze=t[159];let qe;t[160]!==e?(qe=e("A live stream of recent function logs."),t[160]=e,t[161]=qe):qe=t[161];let Ge;t[162]!==e?(Ge=e("Per-shard health and aggregate metrics."),t[162]=e,t[163]=Ge):Ge=t[163];let nt;t[164]!==e?(nt=e("Review migration status and run them."),t[164]=e,t[165]=nt):nt=t[165];let Ke;t[166]!==e?(Ke=e("Browse and manage organizations, members, and invitations."),t[166]=e,t[167]=Ke):Ke=t[167];let ge;t[168]!==e?(ge=e("Restore a shard to a point in the last 30 days."),t[168]=e,t[169]=ge):ge=t[169];let Qe;t[170]!==e?(Qe=e("Email your app sent, captured in dev."),t[170]=e,t[171]=Qe):Qe=t[171];let Ye;t[172]!==e?(Ye=e("Synced customers, subscriptions, and webhook events."),t[172]=e,t[173]=Ye):Ye=t[173];let Ie;t[174]!==e?(Ie=e("Inspect access policies per table, and probe a function as any identity."),t[174]=e,t[175]=Ie):Ie=t[175];let Je;t[176]!==e?(Je=e("Inspect declared Cloudflare Queues \u2014 their producer bindings, consumer mode, and dead-letter queue."),t[176]=e,t[177]=Je):Je=t[177];let De;t[178]!==e?(De=e("Active WebSocket subscriptions on this shard."),t[178]=e,t[179]=De):De=t[179];let Xe;t[180]!==e?(Xe=e("Inspect row-level-security policies and roles, per table."),t[180]=e,t[181]=Xe):Xe=t[181];let _e;t[182]!==e?(_e=e("Inspect and cancel scheduled jobs."),t[182]=e,t[183]=_e):_e=t[183];let et;t[184]!==e?(et=e("Inspect each table and its columns."),t[184]=e,t[185]=et):et=t[185];let Ae;t[186]!==e?(Ae=e("Review admin gates, credentials, and log redaction."),t[186]=e,t[187]=Ae):Ae=t[187];let Et;t[188]!==e?(Et=e("Read-only deployment config \u2014 vars, secrets, and bindings."),t[188]=e,t[189]=Et):Et=t[189];let Tt;t[190]!==e?(Tt=e("Run read-only SQL against a shard."),t[190]=e,t[191]=Tt):Tt=t[191];let wt;t[192]!==e?(wt=e("Browse and edit key-value pairs in your Workers KV namespaces."),t[192]=e,t[193]=wt):wt=t[193];let kt;t[194]!==e?(kt=e("Inspect storage access rules \u2014 per bucket, operation, and key prefix."),t[194]=e,t[195]=kt):kt=t[195];let Ot;t[196]!==e?(Ot=e("Manage auth users \u2014 roles, bans, sessions, and identity."),t[196]=e,t[197]=Ot):Ot=t[197];let Mt;t[198]!==e?(Mt=e("Browse Vectorize indexes and run similarity searches."),t[198]=e,t[199]=Mt):Mt=t[199];let It;t[200]!==e?(It=e("Inspect declared Cloudflare Workflows and their bindings."),t[200]=e,t[201]=It):It=t[201];let No;t[202]!==ce||t[203]!==pe||t[204]!==Pe||t[205]!==Ce||t[206]!==Re||t[207]!==Se||t[208]!==Ne||t[209]!==Ee||t[210]!==Te||t[211]!==we||t[212]!==ke||t[213]!==Oe||t[214]!==Me||t[215]!==ze||t[216]!==Ue||t[217]!==We||t[218]!==Ze||t[219]!==qe||t[220]!==Ge||t[221]!==nt||t[222]!==Ke||t[223]!==ge||t[224]!==Qe||t[225]!==Ye||t[226]!==Ie||t[227]!==Je||t[228]!==De||t[229]!==Xe||t[230]!==_e||t[231]!==et||t[232]!==Ae||t[233]!==Et||t[234]!==Tt||t[235]!==wt||t[236]!==kt||t[237]!==Ot||t[238]!==Mt||t[239]!==It?(No={analytics:ce,api:pe,audit:Pe,authConfig:Ce,authSessions:Re,containers:Se,dashboards:Ne,data:Ee,drains:Te,export:we,fanout:ke,files:Oe,flags:Me,functions:ze,health:Ue,home:We,insights:Ze,logs:qe,metrics:Ge,migrations:nt,organizations:Ke,pitr:ge,mail:Qe,payments:Ye,permissions:Ie,queues:Je,realtime:De,rls:Xe,schedule:_e,schema:et,security:Ae,settings:Et,sql:Tt,kv:wt,storageRules:kt,users:Ot,vectors:Mt,workflows:It},t[202]=ce,t[203]=pe,t[204]=Pe,t[205]=Ce,t[206]=Re,t[207]=Se,t[208]=Ne,t[209]=Ee,t[210]=Te,t[211]=we,t[212]=ke,t[213]=Oe,t[214]=Me,t[215]=ze,t[216]=Ue,t[217]=We,t[218]=Ze,t[219]=qe,t[220]=Ge,t[221]=nt,t[222]=Ke,t[223]=ge,t[224]=Qe,t[225]=Ye,t[226]=Ie,t[227]=Je,t[228]=De,t[229]=Xe,t[230]=_e,t[231]=et,t[232]=Ae,t[233]=Et,t[234]=Tt,t[235]=wt,t[236]=kt,t[237]=Ot,t[238]=Mt,t[239]=It,t[240]=No):No=t[240];let ci=No,Eo;t[241]!==o?(Eo=a(at=>{$e(o({to:`/${at.currentTarget.dataset.tab??""}`}))},"t83"),t[241]=o,t[242]=Eo):Eo=t[242];let pi=Eo,To,wo;t[243]!==n||t[244]!==se?(To=a(()=>{typeof document<"u"&&(document.title=`${se[n]} \xB7 lunora`)},"t84"),wo=[n,se],t[243]=n,t[244]=se,t[245]=To,t[246]=wo):(To=t[245],wo=t[246]),(0,q.useEffect)(To,wo);let ui=u.find(at=>at.tabs.includes(n))??Ga[0],Bs=u.flatMap(at=>at.tabs.map(Bo=>({group:Fe[at.key],label:se[Bo],to:`/${Bo}`}))),Dt=(0,q.use)(ii),fi=Dt!==null&&Dt.token!=="",ko;t[247]!==Bs?(ko=(0,i.jsxDEV)(Ua,{items:Bs},void 0,!1),t[247]=Bs,t[248]=ko):ko=t[248];let Oo;t[249]===Symbol.for("react.memo_cache_sentinel")?(Oo=(0,i.jsxDEV)(Vl,{className:"-ms-1"},void 0,!1),t[249]=Oo):Oo=t[249];let _t;t[250]!==e?(_t=e("Breadcrumb"),t[250]=e,t[251]=_t):_t=t[251];let Ls=Fe[ui.key],At;t[252]!==Ls?(At=(0,i.jsxDEV)("span",{className:"text-muted-foreground",children:Ls},void 0,!1),t[252]=Ls,t[253]=At):At=t[253];let Mo;t[254]===Symbol.for("react.memo_cache_sentinel")?(Mo=(0,i.jsxDEV)("svg",{"aria-hidden":"true",className:"size-3.5 text-muted-foreground/60",fill:"none",stroke:"currentColor",strokeWidth:1.7,viewBox:"0 0 24 24",children:(0,i.jsxDEV)("path",{d:"m9 6 6 6-6 6",strokeLinecap:"round",strokeLinejoin:"round"},void 0,!1)},void 0,!1),t[254]=Mo):Mo=t[254];let Fs=se[n],Vt;t[255]!==Fs?(Vt=(0,i.jsxDEV)("span",{className:"font-medium text-foreground",children:Fs},void 0,!1),t[255]=Fs,t[256]=Vt):Vt=t[256];let Bt;t[257]!==_t||t[258]!==At||t[259]!==Vt?(Bt=(0,i.jsxDEV)("nav",{"aria-label":_t,className:"flex items-center gap-1.5 text-[13px]",children:[At,Mo,Vt]},void 0,!0),t[257]=_t,t[258]=At,t[259]=Vt,t[260]=Bt):Bt=t[260];let Io;t[261]===Symbol.for("react.memo_cache_sentinel")?(Io=(0,i.jsxDEV)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeWidth:1.8,viewBox:"0 0 24 24",children:[(0,i.jsxDEV)("circle",{cx:"11",cy:"11",r:"7"},void 0,!1),(0,i.jsxDEV)("path",{d:"m21 21-4.3-4.3",strokeLinecap:"round"},void 0,!1)]},void 0,!0),t[261]=Io):Io=t[261];let Lt;t[262]!==e?(Lt=e("Search\u2026"),t[262]=e,t[263]=Lt):Lt=t[263];let Do;t[264]===Symbol.for("react.memo_cache_sentinel")?(Do=(0,i.jsxDEV)("kbd",{className:"ms-auto rounded border border-border bg-background px-1 font-sans text-[10px] text-muted-foreground",children:"\u2318K"},void 0,!1),t[264]=Do):Do=t[264];let Ft;t[265]!==Lt?(Ft=(0,i.jsxDEV)("button",{className:"mx-auto hidden h-8 w-72 items-center gap-2 rounded-lg border border-border bg-muted/40 px-3 text-xs text-muted-foreground transition-colors hover:bg-muted md:flex","data-testid":"dash-app-search",onClick:za,type:"button",children:[Io,Lt,Do]},void 0,!0),t[265]=Lt,t[266]=Ft):Ft=t[266];let _o;t[267]===Symbol.for("react.memo_cache_sentinel")?(_o=(0,i.jsxDEV)("div",{className:"ms-auto flex items-center gap-1.5 md:ms-0",children:(0,i.jsxDEV)(bl,{},void 0,!1)},void 0,!1),t[267]=_o):_o=t[267];let Ht;t[268]!==Bt||t[269]!==Ft?(Ht=(0,i.jsxDEV)("header",{className:"flex h-11 shrink-0 items-center gap-2 border-b border-border px-4","data-testid":"dash-app-header",children:[Oo,Bt,Ft,_o]},void 0,!0),t[268]=Bt,t[269]=Ft,t[270]=Ht):Ht=t[270];let $t;t[271]!==Dt?.rulesInstalled?($t=Dt?.rulesInstalled===!1&&(0,i.jsxDEV)(fl,{},void 0,!1),t[271]=Dt?.rulesInstalled,t[272]=$t):$t=t[272];let Hs=`dash-tab-${n}`,$s=c?"flex min-w-0 flex-1 flex-col overflow-hidden":"min-w-0 flex-1 overflow-auto p-6",js=se[n],jt;t[273]!==e||t[274]!==js?(jt=e("{title} failed",{title:js}),t[273]=e,t[274]=js,t[275]=jt):jt=t[275];let zs=se[n],zt;t[276]!==e?(zt=e("Try again"),t[276]=e,t[277]=zt):zt=t[277];let Ao;t[278]===Symbol.for("react.memo_cache_sentinel")?(Ao=(0,i.jsxDEV)(q.Suspense,{fallback:(0,i.jsxDEV)(di,{},void 0,!1),children:(0,i.jsxDEV)(Ur,{},void 0,!1)},void 0,!1),t[278]=Ao):Ao=t[278];let Ut;t[279]!==n||t[280]!==jt||t[281]!==zs||t[282]!==zt?(Ut=(0,i.jsxDEV)(ds,{fallbackTitle:jt,label:zs,retryLabel:zt,children:Ao},n,!1),t[279]=n,t[280]=jt,t[281]=zs,t[282]=zt,t[283]=Ut):Ut=t[283];let Wt;t[284]!==$s||t[285]!==Ut?(Wt=(0,i.jsxDEV)("div",{className:$s,children:Ut},void 0,!1),t[284]=$s,t[285]=Ut,t[286]=Wt):Wt=t[286];let Zt;t[287]!==Hs||t[288]!==Wt?(Zt=(0,i.jsxDEV)("div",{"aria-labelledby":Hs,className:"flex min-w-0 flex-1 flex-col overflow-hidden","data-testid":"dash-panel",id:"dash-panel",role:"tabpanel",children:Wt},void 0,!1),t[287]=Hs,t[288]=Wt,t[289]=Zt):Zt=t[289];let Vo;return t[290]!==Ht||t[291]!==$t||t[292]!==Zt?(Vo=(0,i.jsxDEV)(Bl,{className:"overflow-hidden md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",children:[Ht,$t,Zt]},void 0,!0),t[290]=Ht,t[291]=$t,t[292]=Zt,t[293]=Vo):Vo=t[293],(0,i.jsxDEV)(_l,{className:"min-h-0 flex-1","data-testid":"lunora-studio",children:[ko,(0,i.jsxDEV)(Vd,{chrome:Dt,connected:fi,current:n,groupLabel:Fe,groups:u,selectTab:pi,tabDescription:ci,tabLabel:se},void 0,!1),Vo]},void 0,!0)},"StudioLayout"),Ld=a(t=>{let e=(0,B.c)(5),{initialShardKey:o,schemaEditable:s}=t,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];let n=jr(r),{table:l}=n,c=typeof l=="string"?l:void 0,p;return e[1]!==o||e[2]!==c||e[3]!==s?(p=(0,i.jsxDEV)(Cd,{initialShardKey:o,initialTable:c,schemaEditable:s},void 0,!1),e[1]=o,e[2]=c,e[3]=s,e[4]=p):p=e[4],p},"SchemaRoutePanel"),Fd=a(()=>{let t=(0,B.c)(3),e=pt(),o,s;return t[0]!==e?(o=a(()=>{$e(e({replace:!0,to:"/home"}))},"t0"),s=[e],t[0]=e,t[1]=o,t[2]=s):(o=t[1],s=t[2]),(0,q.useEffect)(o,s),null},"NotFoundRedirect"),Hd=a(({basePath:t,dataEditable:e=!1,functions:o,initialShardKey:s,openApiSpec:r,openRpcSpec:n,runAsIdentity:l=!1,schemaEditable:c=!1,scheduledCancel:p,scheduledCron:d,scheduledLoad:u})=>{let g=zr({component:Bd}),m={analytics:(0,i.jsxDEV)(Gl,{},void 0,!1),api:(0,i.jsxDEV)(Kl,{functions:o,initialShardKey:s,openApiSpec:r,openRpcSpec:n},void 0,!1),audit:(0,i.jsxDEV)(ld,{initialShardKey:s},void 0,!1),authConfig:(0,i.jsxDEV)(Ql,{},void 0,!1),authSessions:(0,i.jsxDEV)(Yl,{},void 0,!1),containers:(0,i.jsxDEV)(ed,{},void 0,!1),dashboards:(0,i.jsxDEV)(xd,{initialShardKey:s},void 0,!1),data:(0,i.jsxDEV)(td,{editable:e,initialShardKey:s},void 0,!1),drains:(0,i.jsxDEV)(dd,{},void 0,!1),export:(0,i.jsxDEV)(od,{initialShardKey:s},void 0,!1),fanout:(0,i.jsxDEV)(bd,{initialShardKey:s},void 0,!1),files:(0,i.jsxDEV)(Nd,{},void 0,!1),kv:(0,i.jsxDEV)(md,{},void 0,!1),flags:(0,i.jsxDEV)(nd,{initialShardKey:s},void 0,!1),functions:(0,i.jsxDEV)("div",{className:"flex flex-col gap-8",children:[(0,i.jsxDEV)(id,{functions:o,initialShardKey:s},void 0,!1),(0,i.jsxDEV)(ad,{functions:o,runAsIdentity:l},void 0,!1)]},void 0,!0),health:(0,i.jsxDEV)(yd,{initialShardKey:s},void 0,!1),home:(0,i.jsxDEV)(Fa,{initialShardKey:s},void 0,!1),insights:(0,i.jsxDEV)(Wl,{initialShardKey:s},void 0,!1),logs:(0,i.jsxDEV)(cd,{initialShardKey:s},void 0,!1),metrics:(0,i.jsxDEV)(Pd,{initialShardKey:s},void 0,!1),migrations:(0,i.jsxDEV)(sd,{initialShardKey:s},void 0,!1),organizations:(0,i.jsxDEV)(Jl,{},void 0,!1),permissions:(0,i.jsxDEV)(hd,{functions:o,runAsIdentity:l,schemaEditable:c},void 0,!1),pitr:(0,i.jsxDEV)(rd,{initialShardKey:s},void 0,!1),mail:(0,i.jsxDEV)(pd,{},void 0,!1),payments:(0,i.jsxDEV)(gd,{},void 0,!1),queues:(0,i.jsxDEV)(vd,{},void 0,!1),realtime:(0,i.jsxDEV)(fd,{initialShardKey:s},void 0,!1),rls:(0,i.jsxDEV)(Zl,{},void 0,!1),schedule:(0,i.jsxDEV)(ud,{loadCronJobs:d,scheduledCancel:p,scheduledLoad:u},void 0,!1),schema:(0,i.jsxDEV)(Ld,{initialShardKey:s,schemaEditable:c},void 0,!1),security:(0,i.jsxDEV)(ql,{},void 0,!1),settings:(0,i.jsxDEV)(Rd,{initialShardKey:s},void 0,!1),sql:(0,i.jsxDEV)(Sd,{initialShardKey:s},void 0,!1),storageRules:(0,i.jsxDEV)(Ed,{},void 0,!1),users:(0,i.jsxDEV)(Xl,{},void 0,!1),vectors:(0,i.jsxDEV)(Td,{},void 0,!1),workflows:(0,i.jsxDEV)(wd,{},void 0,!1)},h=Fo({component:a(()=>m.home,"component"),getParentRoute:a(()=>g,"getParentRoute"),path:"/"}),f=li.map(b=>b==="data"?Fo({component:a(()=>m[b],"component"),getParentRoute:a(()=>g,"getParentRoute"),path:`/${b}`,validateSearch:Bn}):Fo({component:a(()=>m[b],"component"),getParentRoute:a(()=>g,"getParentRoute"),path:`/${b}`})),v=g.addChildren([h,...f]),x="window"in globalThis?Hr():$r({initialEntries:["/home"]});return Wr({...t===void 0||t==="/"?{}:{basepath:t},defaultNotFoundComponent:Fd,defaultPendingComponent:di,defaultPendingMinMs:0,defaultPendingMs:0,history:x,routeTree:v})},"buildRouter"),$d=a(t=>{let e=(0,B.c)(17),{basePath:o,chrome:s,dataEditable:r,functions:n,initialShardKey:l,openApiSpec:c,openRpcSpec:p,runAsIdentity:d,schemaEditable:u,scheduledCancel:g,scheduledCron:m,scheduledLoad:h}=t,f;e[0]!==o||e[1]!==r||e[2]!==n||e[3]!==l||e[4]!==c||e[5]!==p||e[6]!==d||e[7]!==g||e[8]!==m||e[9]!==h||e[10]!==u?(f=Hd({basePath:o,dataEditable:r,functions:n,initialShardKey:l,openApiSpec:c,openRpcSpec:p,runAsIdentity:d,schemaEditable:u,scheduledCancel:g,scheduledCron:m,scheduledLoad:h}),e[0]=o,e[1]=r,e[2]=n,e[3]=l,e[4]=c,e[5]=p,e[6]=d,e[7]=g,e[8]=m,e[9]=h,e[10]=u,e[11]=f):f=e[11];let v=f,x=s??null,b;e[12]!==v?(b=(0,i.jsxDEV)(Zr,{router:v},void 0,!1),e[12]=v,e[13]=b):b=e[13];let C;return e[14]!==x||e[15]!==b?(C=(0,i.jsxDEV)(ii,{value:x,children:b},void 0,!1),e[14]=x,e[15]=b,e[16]=C):C=e[16],C},"StudioShell"),g0=a(t=>{let e=(0,B.c)(17),{basePath:o,chrome:s,dataEditable:r,functions:n,i18n:l,initialShardKey:c,locale:p,openApiSpec:d,openRpcSpec:u,runAsIdentity:g,schemaEditable:m,scheduledCancel:h,scheduledCron:f,scheduledLoad:v}=t,x;e[0]!==o||e[1]!==s||e[2]!==r||e[3]!==n||e[4]!==c||e[5]!==d||e[6]!==u||e[7]!==g||e[8]!==h||e[9]!==f||e[10]!==v||e[11]!==m?(x=(0,i.jsxDEV)($d,{basePath:o,chrome:s,dataEditable:r,functions:n,initialShardKey:c,openApiSpec:d,openRpcSpec:u,runAsIdentity:g,scheduledCancel:h,scheduledCron:f,scheduledLoad:v,schemaEditable:m},void 0,!1),e[0]=o,e[1]=s,e[2]=r,e[3]=n,e[4]=c,e[5]=d,e[6]=u,e[7]=g,e[8]=h,e[9]=f,e[10]=v,e[11]=m,e[12]=x):x=e[12];let b=x;if(l===void 0&&p===void 0)return b;let C;return e[13]!==l||e[14]!==p||e[15]!==b?(C=(0,i.jsxDEV)(ja,{i18n:l,locale:p,children:b},void 0,!1),e[13]=l,e[14]=p,e[15]=b,e[16]=C):C=e[16],C},"Studio");function jd(t){return t.location.pathname}a(jd,"_temp");function zd(t){return t.tabs.length>0}a(zd,"_temp2");export{ds as a,ja as b,f0 as c,al as d,m0 as e,cl as f,Pl as g,Sl as h,Nl as i,El as j,g0 as k};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as D,b as k}from"./chunk-FKO3HO6I.js";import{a as B}from"./chunk-7RYIQKZA.js";import{a as O}from"./chunk-2K47A3P6.js";import{a as V,b as _,c as z,d as v,e as l,f as n}from"./chunk-GTM65MVX.js";import{a as M}from"./chunk-RMYA7NAH.js";import"./chunk-TBMYIZIO.js";import{R as L}from"./chunk-BHTPZS7L.js";import"./chunk-TICVNLPM.js";import"./chunk-HV7G6DFP.js";import{a as A}from"./chunk-AQGOX5DK.js";import{a as I}from"./chunk-TAD43CG5.js";import{b as H}from"./chunk-FCR3HKFV.js";import{a as y,e as E}from"./chunk-SEU5V7I6.js";import{b as T}from"./chunk-O4PXDNR3.js";import"./chunk-ZH7UES4T.js";import"./chunk-KODWGUAB.js";import"./chunk-3OA7PECS.js";import{d as C,l as R}from"./chunk-YJGANMU7.js";import{a as i,e as w,f as $,h as Y}from"./chunk-RRCPZMC2.js";var r=w($(),1);var e=w(Y(),1);var j=80,ee=i(s=>{if(s===void 0)return"";let t=JSON.stringify(s);return t.length>j?`${t.slice(0,j)}\u2026`:t},"formatDetail"),te=41,U=480,K=5,ae=i((s,t)=>D(s,d=>{t(d.height>0?d:{height:U,width:d.width})}),"observeViewportRect"),pe=i(({initialShardKey:s})=>{let t=C(),[d,F]=(0,r.useState)(s??""),[m,G]=(0,r.useState)(""),W=O(d.trim(),400),{data:p,error:u,isLoading:q,liveError:J}=H(A.getAuditLog,{},{live:!0,shardKey:W}),h=(0,r.useMemo)(()=>p?.entries??[],[p]),c=(0,r.useMemo)(()=>{let o=m.trim().toLowerCase();return o===""?h:h.filter(a=>a.op.toLowerCase().includes(o)||(a.table??"").toLowerCase().includes(o)||(a.id??"").toLowerCase().includes(o))},[h,m]),g=(0,r.useRef)(null),x=k({count:c.length,estimateSize:i(()=>te,"estimateSize"),getScrollElement:i(()=>g.current,"getScrollElement"),initialRect:{height:U,width:800},observeElementRect:ae,overscan:8}),f=x.getVirtualItems(),P=x.getTotalSize(),S=f[0]?.start??0,b=P-(f.at(-1)?.end??0),Q={height:S},X={height:b},Z=i(o=>{G(o.target.value)},"onSearchChange");return(0,e.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-audit",children:[(0,e.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsxDEV)(M,{onChange:F,testId:"au-shard-input",value:d},void 0,!1),(0,e.jsxDEV)(B,{message:J,prefix:"au"},void 0,!1),(0,e.jsxDEV)(L,{"aria-label":t("Filter audit log"),className:"h-8 w-48","data-testid":"au-search",onChange:Z,placeholder:t("filter op, table, id"),value:m},void 0,!1)]},void 0,!0),u!==null&&(0,e.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"au-error",role:"alert",children:u},void 0,!1),u===null&&!q&&c.length===0&&(0,e.jsxDEV)(I,{description:t("State-changing admin operations are recorded here."),icon:(0,e.jsxDEV)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,e.jsxDEV)("path",{d:"M8 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2h-2M9 3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1V3Zm-1 9h8m-8 4h5"},void 0,!1)},void 0,!1),testId:"au-empty",title:t("No audit entries.")},void 0,!1),c.length>0&&(0,e.jsxDEV)(y,{className:"overflow-hidden py-0",children:(0,e.jsxDEV)(E,{className:"max-h-[30rem] overflow-auto px-0",ref:g,children:(0,e.jsxDEV)(V,{"data-testid":"au-table",children:[(0,e.jsxDEV)(_,{children:(0,e.jsxDEV)(v,{children:[(0,e.jsxDEV)(l,{children:t("time")},void 0,!1),(0,e.jsxDEV)(l,{children:t("op")},void 0,!1),(0,e.jsxDEV)(l,{children:t("table")},void 0,!1),(0,e.jsxDEV)(l,{children:t("id")},void 0,!1),(0,e.jsxDEV)(l,{children:t("detail")},void 0,!1)]},void 0,!0)},void 0,!1),(0,e.jsxDEV)(z,{children:[S>0&&(0,e.jsxDEV)("tr",{"aria-hidden":"true",children:(0,e.jsxDEV)("td",{colSpan:K,style:Q},void 0,!1)},void 0,!1),f.map(o=>{let a=c[o.index],N=ee(a.detail);return(0,e.jsxDEV)(v,{"data-testid":"au-row",children:[(0,e.jsxDEV)(n,{className:"text-muted-foreground tabular-nums",children:R(a.ts,"\u2014")},void 0,!1),(0,e.jsxDEV)(n,{children:(0,e.jsxDEV)(T,{variant:"secondary",children:a.op},void 0,!1)},void 0,!1),(0,e.jsxDEV)(n,{className:"font-medium",children:a.table??(0,e.jsxDEV)("span",{className:"text-muted-foreground",children:"\u2014"},void 0,!1)},void 0,!1),(0,e.jsxDEV)(n,{className:"max-w-[20ch] truncate font-mono text-xs",children:a.id??(0,e.jsxDEV)("span",{className:"text-muted-foreground",children:"\u2014"},void 0,!1)},void 0,!1),(0,e.jsxDEV)(n,{className:"max-w-[32ch] truncate font-mono text-xs text-muted-foreground",title:N||void 0,children:N||(0,e.jsxDEV)("span",{className:"text-muted-foreground",children:"\u2014"},void 0,!1)},void 0,!1)]},a.seq,!0)}),b>0&&(0,e.jsxDEV)("tr",{"aria-hidden":"true",children:(0,e.jsxDEV)("td",{colSpan:K,style:X},void 0,!1)},void 0,!1)]},void 0,!0)]},void 0,!0)},void 0,!1)},void 0,!1)]},void 0,!0)},"AuditPanel");export{pe as AuditPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as dt,b as nt,c as ct,d as ut,e as Me}from"./chunk-ASLGNHAX.js";import{a as ft,b as mt,c as vt,d as ht,e as gt}from"./chunk-N4JI6VQD.js";import"./chunk-DWDILV2E.js";import"./chunk-6VTGE3WJ.js";import{e as it}from"./chunk-TQ36RWOP.js";import"./chunk-UGMRUEBU.js";import{a as ot}from"./chunk-7RYIQKZA.js";import"./chunk-NNISYDNI.js";import"./chunk-5OIBXYZM.js";import"./chunk-FQKNJSRA.js";import"./chunk-BJGBHGK3.js";import"./chunk-UII66UVF.js";import{a as rt}from"./chunk-2K47A3P6.js";import"./chunk-KEGAWN6Y.js";import{a as st,b as lt,c as at,d as je,e as $e,f as Te}from"./chunk-GTM65MVX.js";import"./chunk-4QHKBC77.js";import{a as tt}from"./chunk-RMYA7NAH.js";import{a as Ze,b as et}from"./chunk-TBMYIZIO.js";import"./chunk-BHTPZS7L.js";import{c as Oe}from"./chunk-YQQJ4N6U.js";import"./chunk-TICVNLPM.js";import"./chunk-HV7G6DFP.js";import{a as Pe}from"./chunk-AQGOX5DK.js";import{b as Ye}from"./chunk-FCR3HKFV.js";import{a as B,b as Re,c as _e,d as Ve,e as P}from"./chunk-SEU5V7I6.js";import{b as Ke}from"./chunk-O4PXDNR3.js";import"./chunk-ZH7UES4T.js";import{f as Ue}from"./chunk-KODWGUAB.js";import"./chunk-3OA7PECS.js";import{d as Qe,e as Ge,f as Je,g as We,i as Xe,k as Ae}from"./chunk-YJGANMU7.js";import{a as n,e as Be,f as pt,g as xt,h as bt}from"./chunk-RRCPZMC2.js";var Le=Be(xt(),1);var v=Be(pt(),1);var t=Be(bt(),1);var ze=n(l=>l>=100?"critical":l>=50?"warning":"good","performanceLevel"),He=n(l=>l<1?`${(l*1e3).toFixed(0)}\u03BCs`:l<1e3?`${l.toFixed(1)}ms`:`${(l/1e3).toFixed(2)}s`,"formatLatency"),Ee=n(l=>l>=1e9?`${(l/1e9).toFixed(1)}B`:l>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${(l/1e3).toFixed(1)}K`:l.toLocaleString(),"formatCount"),Nt=n(l=>{let e=(0,Le.c)(3),{level:s}=l;if(s==="critical"){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=(0,t.jsxDEV)(Ke,{variant:"destructive",children:"Slow"},void 0,!1),e[0]=i):i=e[0],i}if(s==="warning"){let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=(0,t.jsxDEV)("span",{className:"inline-flex items-center gap-1 rounded-md border border-transparent bg-warning/10 px-2 py-0.5 text-xs font-medium text-warning",children:"Moderate"},void 0,!1),e[1]=i):i=e[1],i}let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsxDEV)("span",{className:"inline-flex items-center gap-1 rounded-md border border-transparent bg-success/10 px-2 py-0.5 text-xs font-medium text-success",children:"Fast"},void 0,!1),e[2]=r):r=e[2],r},"PerformanceBadge"),yt=n(l=>{let e=(0,Le.c)(152),{queryStats:s}=l,r=Qe(),[i,Q]=(0,v.useState)("totalTime"),C;e[0]===Symbol.for("react.memo_cache_sentinel")?(C=new Set,e[0]=C):C=e[0];let[h,T]=(0,v.useState)(C),p;e[1]===Symbol.for("react.memo_cache_sentinel")?(p=n(o=>{o!==null&&Q(o)},"t2"),e[1]=p):p=e[1];let S=p,u;if(e[2]!==s||e[3]!==i){u=[...s];let o;e[5]!==i?(o=n((m,c)=>{switch(i){case"avgTime":return c.avgDurationMs-m.avgDurationMs;case"execCount":return c.execCount-m.execCount;case"rowsRead":return c.rowsRead-m.rowsRead;default:return c.totalDurationMs-m.totalDurationMs}},"t310"),e[5]=i,e[6]=o):o=e[6],u.sort(o),e[2]=s,e[3]=i,e[4]=u}else u=e[4];let g=u,$;e[7]!==s?($=s.filter(St),e[7]=s,e[8]=$):$=e[8];let j=$.length,H;e[9]!==s?(H=s.filter(wt),e[9]=s,e[10]=H):H=e[10];let d=H.length,_;e[11]!==s?(_=s.filter(qt),e[11]=s,e[12]=_):_=e[12];let U=_.length,O;e[13]===Symbol.for("react.memo_cache_sentinel")?(O=n(o=>{T(m=>{let c=new Set(m);return c.has(o)?c.delete(o):c.add(o),c})},"t6"),e[13]=O):O=e[13];let Fe=O;if(s.length===0){let o;e[14]!==r?(o=r("No query insights yet"),e[14]=r,e[15]=o):o=e[15];let m;e[16]!==o?(m=(0,t.jsxDEV)("p",{className:"text-lg font-medium","data-testid":"qi-empty",children:o},void 0,!1),e[16]=o,e[17]=m):m=e[17];let c;e[18]!==r?(c=r("Query insights appear once statements are executed against this shard."),e[18]=r,e[19]=c):c=e[19];let z;e[20]!==c?(z=(0,t.jsxDEV)("p",{className:"mt-1 text-sm",children:c},void 0,!1),e[20]=c,e[21]=z):z=e[21];let ke;return e[22]!==z||e[23]!==m?(ke=(0,t.jsxDEV)(B,{children:(0,t.jsxDEV)(P,{className:"py-12",children:(0,t.jsxDEV)("div",{className:"text-center text-muted-foreground",children:[m,z]},void 0,!0)},void 0,!1)},void 0,!1),e[22]=z,e[23]=m,e[24]=ke):ke=e[24],ke}let I;e[25]!==r?(I=r("Critical queries"),e[25]=r,e[26]=I):I=e[26];let f;e[27]!==I?(f=(0,t.jsxDEV)(Re,{className:"pb-2",children:(0,t.jsxDEV)(_e,{className:"text-sm font-medium",children:I},void 0,!1)},void 0,!1),e[27]=I,e[28]=f):f=e[28];let M;e[29]!==j?(M=(0,t.jsxDEV)("div",{className:"text-2xl font-bold text-destructive","data-testid":"qi-critical",children:j},void 0,!1),e[29]=j,e[30]=M):M=e[30];let D;e[31]!==r?(D=r(">100ms avg execution"),e[31]=r,e[32]=D):D=e[32];let R;e[33]!==D?(R=(0,t.jsxDEV)("p",{className:"text-xs text-muted-foreground",children:D},void 0,!1),e[33]=D,e[34]=R):R=e[34];let F;e[35]!==R||e[36]!==M?(F=(0,t.jsxDEV)(P,{children:[M,R]},void 0,!0),e[35]=R,e[36]=M,e[37]=F):F=e[37];let b;e[38]!==F||e[39]!==f?(b=(0,t.jsxDEV)(B,{children:[f,F]},void 0,!0),e[38]=F,e[39]=f,e[40]=b):b=e[40];let N;e[41]!==r?(N=r("Moderate queries"),e[41]=r,e[42]=N):N=e[42];let k;e[43]!==N?(k=(0,t.jsxDEV)(Re,{className:"pb-2",children:(0,t.jsxDEV)(_e,{className:"text-sm font-medium",children:N},void 0,!1)},void 0,!1),e[43]=N,e[44]=k):k=e[44];let A;e[45]!==d?(A=(0,t.jsxDEV)("div",{className:"text-2xl font-bold text-warning","data-testid":"qi-moderate",children:d},void 0,!1),e[45]=d,e[46]=A):A=e[46];let E;e[47]!==r?(E=r("50\u2013100ms avg execution"),e[47]=r,e[48]=E):E=e[48];let L;e[49]!==E?(L=(0,t.jsxDEV)("p",{className:"text-xs text-muted-foreground",children:E},void 0,!1),e[49]=E,e[50]=L):L=e[50];let a;e[51]!==A||e[52]!==L?(a=(0,t.jsxDEV)(P,{children:[A,L]},void 0,!0),e[51]=A,e[52]=L,e[53]=a):a=e[53];let w;e[54]!==k||e[55]!==a?(w=(0,t.jsxDEV)(B,{children:[k,a]},void 0,!0),e[54]=k,e[55]=a,e[56]=w):w=e[56];let x;e[57]!==r?(x=r("Fast queries"),e[57]=r,e[58]=x):x=e[58];let y;e[59]!==x?(y=(0,t.jsxDEV)(Re,{className:"pb-2",children:(0,t.jsxDEV)(_e,{className:"text-sm font-medium",children:x},void 0,!1)},void 0,!1),e[59]=x,e[60]=y):y=e[60];let K;e[61]!==U?(K=(0,t.jsxDEV)("div",{className:"text-2xl font-bold text-success","data-testid":"qi-fast",children:U},void 0,!1),e[61]=U,e[62]=K):K=e[62];let V;e[63]!==r?(V=r("<50ms avg execution"),e[63]=r,e[64]=V):V=e[64];let G;e[65]!==V?(G=(0,t.jsxDEV)("p",{className:"text-xs text-muted-foreground",children:V},void 0,!1),e[65]=V,e[66]=G):G=e[66];let J;e[67]!==K||e[68]!==G?(J=(0,t.jsxDEV)(P,{children:[K,G]},void 0,!0),e[67]=K,e[68]=G,e[69]=J):J=e[69];let W;e[70]!==y||e[71]!==J?(W=(0,t.jsxDEV)(B,{children:[y,J]},void 0,!0),e[70]=y,e[71]=J,e[72]=W):W=e[72];let X;e[73]!==b||e[74]!==w||e[75]!==W?(X=(0,t.jsxDEV)("div",{className:"grid gap-4 md:grid-cols-3",children:[b,w,W]},void 0,!0),e[73]=b,e[74]=w,e[75]=W,e[76]=X):X=e[76];let Y;e[77]!==r?(Y=r("Query leaderboard"),e[77]=r,e[78]=Y):Y=e[78];let Z;e[79]!==Y?(Z=(0,t.jsxDEV)("h3",{className:"text-lg font-semibold",children:Y},void 0,!1),e[79]=Y,e[80]=Z):Z=e[80];let ee;e[81]!==i||e[82]!==r?(ee=r("Slow queries sorted by {sortField}",{sortField:r(i)}),e[81]=i,e[82]=r,e[83]=ee):ee=e[83];let te;e[84]!==ee?(te=(0,t.jsxDEV)("p",{className:"text-sm text-muted-foreground",children:ee},void 0,!1),e[84]=ee,e[85]=te):te=e[85];let re;e[86]!==Z||e[87]!==te?(re=(0,t.jsxDEV)("div",{children:[Z,te]},void 0,!0),e[86]=Z,e[87]=te,e[88]=re):re=e[88];let se;e[89]!==r?(se=r("Sort by"),e[89]=r,e[90]=se):se=e[90];let le;e[91]!==se?(le=(0,t.jsxDEV)("span",{className:"text-sm text-muted-foreground",children:se},void 0,!1),e[91]=se,e[92]=le):le=e[92];let ae;e[93]!==r?(ae=r("Sort queries by"),e[93]=r,e[94]=ae):ae=e[94];let Ie;e[95]===Symbol.for("react.memo_cache_sentinel")?(Ie=(0,t.jsxDEV)(nt,{},void 0,!1),e[95]=Ie):Ie=e[95];let ie;e[96]!==ae?(ie=(0,t.jsxDEV)(ct,{"aria-label":ae,className:"w-[140px]","data-testid":"qi-sort",children:Ie},void 0,!1),e[96]=ae,e[97]=ie):ie=e[97];let oe;e[98]!==r?(oe=r("Total time"),e[98]=r,e[99]=oe):oe=e[99];let de;e[100]!==oe?(de=(0,t.jsxDEV)(Me,{value:"totalTime",children:oe},void 0,!1),e[100]=oe,e[101]=de):de=e[101];let ne;e[102]!==r?(ne=r("Avg time"),e[102]=r,e[103]=ne):ne=e[103];let ce;e[104]!==ne?(ce=(0,t.jsxDEV)(Me,{value:"avgTime",children:ne},void 0,!1),e[104]=ne,e[105]=ce):ce=e[105];let ue;e[106]!==r?(ue=r("Execution count"),e[106]=r,e[107]=ue):ue=e[107];let fe;e[108]!==ue?(fe=(0,t.jsxDEV)(Me,{value:"execCount",children:ue},void 0,!1),e[108]=ue,e[109]=fe):fe=e[109];let me;e[110]!==r?(me=r("Rows read"),e[110]=r,e[111]=me):me=e[111];let ve;e[112]!==me?(ve=(0,t.jsxDEV)(Me,{value:"rowsRead",children:me},void 0,!1),e[112]=me,e[113]=ve):ve=e[113];let he;e[114]!==de||e[115]!==ce||e[116]!==fe||e[117]!==ve?(he=(0,t.jsxDEV)(ut,{children:[de,ce,fe,ve]},void 0,!0),e[114]=de,e[115]=ce,e[116]=fe,e[117]=ve,e[118]=he):he=e[118];let ge;e[119]!==i||e[120]!==ie||e[121]!==he?(ge=(0,t.jsxDEV)(dt,{onValueChange:S,value:i,children:[ie,he]},void 0,!0),e[119]=i,e[120]=ie,e[121]=he,e[122]=ge):ge=e[122];let pe;e[123]!==le||e[124]!==ge?(pe=(0,t.jsxDEV)("div",{className:"flex items-center gap-2",children:[le,ge]},void 0,!0),e[123]=le,e[124]=ge,e[125]=pe):pe=e[125];let xe;e[126]!==re||e[127]!==pe?(xe=(0,t.jsxDEV)("div",{className:"flex items-center justify-between",children:[re,pe]},void 0,!0),e[126]=re,e[127]=pe,e[128]=xe):xe=e[128];let be;e[129]!==r?(be=r("Statements"),e[129]=r,e[130]=be):be=e[130];let Ne;e[131]!==be?(Ne=(0,t.jsxDEV)(_e,{children:be},void 0,!1),e[131]=be,e[132]=Ne):Ne=e[132];let ye;e[133]!==g.length||e[134]!==r?(ye=r("{count} tracked statements",{count:g.length}),e[133]=g.length,e[134]=r,e[135]=ye):ye=e[135];let Se;e[136]!==ye?(Se=(0,t.jsxDEV)(Ve,{children:ye},void 0,!1),e[136]=ye,e[137]=Se):Se=e[137];let we;e[138]!==Ne||e[139]!==Se?(we=(0,t.jsxDEV)(Re,{children:[Ne,Se]},void 0,!0),e[138]=Ne,e[139]=Se,e[140]=we):we=e[140];let qe;e[141]!==h||e[142]!==g||e[143]!==r?(qe=(0,t.jsxDEV)(P,{children:(0,t.jsxDEV)("div",{className:"space-y-2",children:g.map(o=>{let m=o.normalizedSql,c=h.has(m),z=ze(o.avgDurationMs);return(0,t.jsxDEV)("div",{className:"overflow-hidden rounded-lg border","data-testid":"qi-row",children:[(0,t.jsxDEV)("button",{"aria-expanded":c,className:"flex w-full items-center justify-between p-3 text-left transition-colors hover:bg-muted/50",onClick:n(()=>{Fe(m)},"onClick"),type:"button",children:[(0,t.jsxDEV)("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[(0,t.jsxDEV)(Nt,{level:z},void 0,!1),(0,t.jsxDEV)("span",{className:"max-w-[300px] truncate font-mono text-sm lg:max-w-[500px]",children:o.normalizedSql},void 0,!1)]},void 0,!0),(0,t.jsxDEV)("div",{className:"flex shrink-0 items-center gap-4",children:[(0,t.jsxDEV)("div",{className:"text-right",children:[(0,t.jsxDEV)("div",{className:"text-sm font-medium",children:He(o.totalDurationMs)},void 0,!1),(0,t.jsxDEV)("div",{className:"text-xs text-muted-foreground",children:r("total")},void 0,!1)]},void 0,!0),(0,t.jsxDEV)("div",{className:"text-right",children:[(0,t.jsxDEV)("div",{className:"text-sm font-medium",children:He(o.avgDurationMs)},void 0,!1),(0,t.jsxDEV)("div",{className:"text-xs text-muted-foreground",children:r("avg")},void 0,!1)]},void 0,!0),(0,t.jsxDEV)("div",{className:"text-right",children:[(0,t.jsxDEV)("div",{className:"text-sm font-medium",children:Ee(o.execCount)},void 0,!1),(0,t.jsxDEV)("div",{className:"text-xs text-muted-foreground",children:r("calls")},void 0,!1)]},void 0,!0)]},void 0,!0)]},void 0,!0),c&&(0,t.jsxDEV)("div",{className:"space-y-3 border-t bg-muted/30 p-4",children:[(0,t.jsxDEV)("div",{children:[(0,t.jsxDEV)("p",{className:"mb-2 text-sm font-medium",children:r("Full statement")},void 0,!1),(0,t.jsxDEV)("pre",{className:"overflow-x-auto rounded-md bg-muted p-3 font-mono text-sm whitespace-pre-wrap break-all",children:o.normalizedSql},void 0,!1)]},void 0,!0),(0,t.jsxDEV)("div",{className:"grid grid-cols-2 gap-4 text-sm md:grid-cols-4",children:[(0,t.jsxDEV)("div",{children:[(0,t.jsxDEV)("span",{className:"text-muted-foreground",children:r("Exec count")},void 0,!1),(0,t.jsxDEV)("span",{className:"block font-medium tabular-nums",children:Ee(o.execCount)},void 0,!1)]},void 0,!0),(0,t.jsxDEV)("div",{children:[(0,t.jsxDEV)("span",{className:"text-muted-foreground",children:r("Total time")},void 0,!1),(0,t.jsxDEV)("span",{className:"block font-medium tabular-nums",children:He(o.totalDurationMs)},void 0,!1)]},void 0,!0),(0,t.jsxDEV)("div",{children:[(0,t.jsxDEV)("span",{className:"text-muted-foreground",children:r("Rows read")},void 0,!1),(0,t.jsxDEV)("span",{className:"block font-medium tabular-nums",children:Ee(o.rowsRead)},void 0,!1)]},void 0,!0),(0,t.jsxDEV)("div",{children:[(0,t.jsxDEV)("span",{className:"text-muted-foreground",children:r("Rows written")},void 0,!1),(0,t.jsxDEV)("span",{className:"block font-medium tabular-nums",children:Ee(o.rowsWritten)},void 0,!1)]},void 0,!0)]},void 0,!0)]},void 0,!0)]},m,!0)})},void 0,!1)},void 0,!1),e[141]=h,e[142]=g,e[143]=r,e[144]=qe):qe=e[144];let Ce;e[145]!==we||e[146]!==qe?(Ce=(0,t.jsxDEV)(B,{children:[we,qe]},void 0,!0),e[145]=we,e[146]=qe,e[147]=Ce):Ce=e[147];let De;return e[148]!==X||e[149]!==xe||e[150]!==Ce?(De=(0,t.jsxDEV)("div",{className:"space-y-4","data-testid":"qi-root",children:[X,xe,Ce]},void 0,!0),e[148]=X,e[149]=xe,e[150]=Ce,e[151]=De):De=e[151],De},"QueryInsights");function St(l){return ze(l.avgDurationMs)==="critical"}n(St,"_temp");function wt(l){return ze(l.avgDurationMs)==="warning"}n(wt,"_temp2");function qt(l){return ze(l.avgDurationMs)==="good"}n(qt,"_temp3");var Ct=Ge(Pe.getMetrics),Tt=n(l=>{let e=Math.floor(l/1e3),s=Math.floor(e/3600),r=Math.floor(e%3600/60),i=e%60;return s>0?`${s.toString()}h ${r.toString()}m`:r>0?`${r.toString()}m ${i.toString()}s`:`${i.toString()}s`},"formatDuration"),Rt=n((l,e)=>l?e:"overview","resolveTab"),_t=n((l,e)=>{let s=l+e;return s===0?"\u2014":`${(l/s*100).toFixed(1)}%`},"hitRate"),q=n(l=>{let e=(0,Le.c)(16),{chart:s,footer:r,label:i,testId:Q,value:C}=l,h;e[0]!==i?(h=(0,t.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:i},void 0,!1),e[0]=i,e[1]=h):h=e[1];let T;e[2]!==Q||e[3]!==C?(T=(0,t.jsxDEV)("span",{className:"truncate text-2xl font-semibold tabular-nums text-foreground","data-testid":Q,children:C},void 0,!1),e[2]=Q,e[3]=C,e[4]=T):T=e[4];let p;e[5]!==s||e[6]!==T?(p=(0,t.jsxDEV)("div",{className:"flex items-center justify-between gap-3",children:[T,s]},void 0,!0),e[5]=s,e[6]=T,e[7]=p):p=e[7];let S;e[8]!==h||e[9]!==p?(S=(0,t.jsxDEV)("div",{className:"flex flex-col gap-2.5 p-4",children:[h,p]},void 0,!0),e[8]=h,e[9]=p,e[10]=S):S=e[10];let u;e[11]!==r?(u=r!=null&&(0,t.jsxDEV)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",children:r},void 0,!1),e[11]=r,e[12]=u):u=e[12];let g;return e[13]!==S||e[14]!==u?(g=(0,t.jsxDEV)(B,{className:"justify-between gap-0 py-0",children:[S,u]},void 0,!0),e[13]=S,e[14]=u,e[15]=g):g=e[15],g},"StatCard"),Kt=n(({initialShardKey:l})=>{let e=Ue(),s=Qe(),[r,i]=(0,v.useState)(l??""),[Q,C]=(0,v.useState)("overview"),[h,T]=(0,v.useState)([]),p=(0,v.useRef)(null),S=(0,v.useRef)(null),u=(0,v.useRef)(!0);(0,v.useEffect)(()=>(u.current=!0,()=>{u.current=!1}),[]);let g=rt(r.trim(),400),{data:$,error:j,liveError:H}=Ye(Pe.getMetrics,{},{live:!0,shardKey:g}),d=$??null;(0,v.useEffect)(()=>{if($===void 0)return;et(g);let a=$,w=p.current,x=S.current!==null&&S.current!==a.shard;if(S.current=a.shard,p.current=a.requests,x){T([]);return}w!==null&&a.requests>=w&&T(y=>[...y,a.requests-w].slice(-30))},[$,g]);let[_,U]=(0,v.useState)(null),[O,Fe]=(0,v.useState)(!1),I=n(async()=>{Fe(!0);let a=mt(r,Ze());try{let w=await Promise.all(a.map(async x=>{try{let y=await e.query(Ct,{},Je(x));return{error:null,metrics:y,shard:x===""?y.shard:x}}catch(y){return{error:We(y),metrics:null,shard:x===""?"__root__":x}}}));u.current&&U(w)}finally{u.current&&Fe(!1)}},"aggregateAll"),f=_===null?null:ft(_),M=d===null||d.requests===0?"\u2014":`${(d.errors/d.requests*100).toFixed(1)}%`,D=h.length>0?h.at(-1):0,R=d?vt(d):{p90:0,p95:0},F=n(a=>a<=0?"\u2014":a<1?`${(a*1e3).toFixed(0)}\u03BCs`:a<1e3?`${a.toFixed(1)}ms`:`${(a/1e3).toFixed(2)}s`,"formatMs"),b=(0,v.useMemo)(()=>{if(!d||!("queryStats"in d))return;let a=d.queryStats;if(!(!a||!Array.isArray(a)))return ht(a)},[d]),N=Rt(b!==void 0,Q),k=n(()=>{Xe(I())},"runAggregate"),A=n(()=>{U(null)},"clearAggregate"),E=n(()=>{C("overview")},"switchToOverview"),L=n(()=>{C("query-insights")},"switchToQueryInsights");return(0,t.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-metrics",children:[(0,t.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxDEV)(tt,{onChange:i,testId:"mt-shard-input",value:r},void 0,!1),(0,t.jsxDEV)(ot,{message:H,prefix:"mt"},void 0,!1),(0,t.jsxDEV)(Oe,{"data-testid":"mt-aggregate",disabled:O,onClick:k,size:"sm",type:"button",variant:"secondary",children:s(O?"Aggregating\u2026":"All shards")},void 0,!1),_!==null&&(0,t.jsxDEV)(Oe,{"data-testid":"mt-aggregate-clear",onClick:A,size:"sm",type:"button",variant:"ghost",children:s("Hide")},void 0,!1),(0,t.jsxDEV)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"mt-cf-link",href:it,rel:"noreferrer",target:"_blank",children:s("Open in Cloudflare")},void 0,!1)]},void 0,!0),j!==null&&(0,t.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"mt-error",role:"alert",children:j},void 0,!1),b!==void 0&&(0,t.jsxDEV)("div",{className:"flex gap-2 border-b","data-testid":"mt-tabs",children:[(0,t.jsxDEV)("button",{className:`pb-2 text-sm font-medium transition-colors ${N==="overview"?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"}`,"data-testid":"mt-tab-overview",onClick:E,type:"button",children:s("Overview")},void 0,!1),(0,t.jsxDEV)("button",{className:`pb-2 text-sm font-medium transition-colors ${N==="query-insights"?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"}`,"data-testid":"mt-tab-query-insights",onClick:L,type:"button",children:[s("Query insights"),b.length>0&&(0,t.jsxDEV)("span",{className:"ml-1.5 rounded-full bg-primary/10 px-1.5 py-0.5 text-xs text-primary",children:b.length},void 0,!1)]},void 0,!0)]},void 0,!0),N==="query-insights"&&b!==void 0&&(0,t.jsxDEV)(yt,{queryStats:b},void 0,!1),N==="overview"&&d!==null&&(0,t.jsxDEV)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4","data-testid":"mt-stats",children:[(0,t.jsxDEV)(q,{chart:h.length>=2?(0,t.jsxDEV)(gt,{ariaLabel:s("Requests per interval over time"),className:"h-7 w-24 text-foreground",series:h,testId:"mt-sparkline"},void 0,!1):void 0,footer:h.length>=2?(0,t.jsxDEV)(t.Fragment,{children:[(0,t.jsxDEV)("span",{className:"font-semibold text-foreground",children:`+${D.toLocaleString()}`},void 0,!1)," ",s("last interval")]},void 0,!0):(0,t.jsxDEV)("span",{"data-testid":"mt-sparkline-empty",children:s("collecting samples\u2026")},void 0,!1),label:s("Requests"),testId:"mt-requests",value:d.requests},void 0,!1),(0,t.jsxDEV)(q,{footer:s("{rate} error rate",{rate:M}),label:s("Errors"),testId:"mt-errors",value:(0,t.jsxDEV)(t.Fragment,{children:[d.errors," (",M,")"]},void 0,!0)},void 0,!1),(0,t.jsxDEV)(q,{footer:R.p90>0?`P90 ${F(R.p90)}`:void 0,label:s("P95 latency"),testId:"mt-p95",value:R.p95>0?F(R.p95):"\u2014"},void 0,!1),(0,t.jsxDEV)(q,{footer:d.cache===null?void 0:`${d.cache.entries.toLocaleString()} ${s("cache entries")}`,label:s("Database size"),testId:"mt-db-size",value:Ae(d.databaseSize)},void 0,!1),(0,t.jsxDEV)(q,{label:s("Shard"),testId:"mt-shard",value:d.shard},void 0,!1),(0,t.jsxDEV)(q,{label:s("Uptime"),testId:"mt-uptime",value:Tt(d.uptimeMs)},void 0,!1),(0,t.jsxDEV)(q,{label:s("Cache hit rate"),testId:"mt-cache",value:d.cache===null?s("no cache configured"):s("{rate} ({count} entries)",{count:d.cache.entries,rate:_t(d.cache.hits,d.cache.misses)})},void 0,!1)]},void 0,!0),N==="overview"&&d===null&&null,N==="overview"&&f!==null&&_!==null&&(0,t.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"mt-aggregate-view",children:[(0,t.jsxDEV)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":"mt-aggregate-stats",children:[(0,t.jsxDEV)(q,{label:s("Shards"),testId:"mt-agg-shards",value:f.failed>0?s("{reachable} reachable, {failed} unreachable",{failed:f.failed,reachable:f.reachable}):s("{reachable} reachable",{reachable:f.reachable})},void 0,!1),(0,t.jsxDEV)(q,{label:s("Total requests"),testId:"mt-agg-requests",value:f.totalRequests},void 0,!1),(0,t.jsxDEV)(q,{label:s("Total errors"),testId:"mt-agg-errors",value:f.totalErrors},void 0,!1),(0,t.jsxDEV)(q,{label:s("Total database size"),testId:"mt-agg-db-size",value:Ae(f.totalDatabaseSize)},void 0,!1),(0,t.jsxDEV)(q,{label:s("Combined cache hit rate"),testId:"mt-agg-cache",value:f.hitRate===null?s("no cache configured"):`${(f.hitRate*100).toFixed(1)}%`},void 0,!1)]},void 0,!0),(0,t.jsxDEV)(B,{className:"overflow-hidden py-0",children:(0,t.jsxDEV)(P,{className:"px-0",children:(0,t.jsxDEV)(st,{"data-testid":"mt-agg-table",children:[(0,t.jsxDEV)(lt,{children:(0,t.jsxDEV)(je,{children:[(0,t.jsxDEV)($e,{children:s("shard")},void 0,!1),(0,t.jsxDEV)($e,{children:s("requests")},void 0,!1),(0,t.jsxDEV)($e,{children:s("errors")},void 0,!1),(0,t.jsxDEV)($e,{children:s("db size")},void 0,!1)]},void 0,!0)},void 0,!1),(0,t.jsxDEV)(at,{children:_.map(a=>(0,t.jsxDEV)(je,{"data-testid":`mt-agg-row-${a.shard}`,children:[(0,t.jsxDEV)(Te,{children:a.shard},void 0,!1),a.metrics===null?(0,t.jsxDEV)(Te,{className:"text-destructive",colSpan:3,children:a.error??s("unreachable")},void 0,!1):(0,t.jsxDEV)(t.Fragment,{children:[(0,t.jsxDEV)(Te,{className:"tabular-nums",children:a.metrics.requests},void 0,!1),(0,t.jsxDEV)(Te,{className:"tabular-nums",children:a.metrics.errors},void 0,!1),(0,t.jsxDEV)(Te,{className:"tabular-nums",children:Ae(a.metrics.databaseSize)},void 0,!1)]},void 0,!0)]},a.shard,!0))},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1)]},void 0,!0)]},void 0,!0)},"MetricsPanel");export{Kt as MetricsPanel};
|
|
1
|
+
import{a as dt,b as nt,c as ct,d as ut,e as Me}from"./chunk-ASLGNHAX.js";import{a as ft,b as mt,c as vt,d as ht,e as gt}from"./chunk-N4JI6VQD.js";import"./chunk-DWDILV2E.js";import"./chunk-6VTGE3WJ.js";import{e as ot}from"./chunk-TQ36RWOP.js";import"./chunk-UGMRUEBU.js";import{a as it}from"./chunk-7RYIQKZA.js";import"./chunk-NNISYDNI.js";import"./chunk-5OIBXYZM.js";import"./chunk-FQKNJSRA.js";import"./chunk-BJGBHGK3.js";import"./chunk-UII66UVF.js";import{a as rt}from"./chunk-2K47A3P6.js";import"./chunk-KEGAWN6Y.js";import{a as st,b as lt,c as at,d as je,e as $e,f as Te}from"./chunk-GTM65MVX.js";import"./chunk-4QHKBC77.js";import{a as tt}from"./chunk-RMYA7NAH.js";import{a as Ze,b as et}from"./chunk-TBMYIZIO.js";import"./chunk-BHTPZS7L.js";import{c as Oe}from"./chunk-YQQJ4N6U.js";import"./chunk-TICVNLPM.js";import"./chunk-HV7G6DFP.js";import{a as Pe}from"./chunk-AQGOX5DK.js";import{b as Ye}from"./chunk-FCR3HKFV.js";import{a as B,b as Re,c as _e,d as Ve,e as P}from"./chunk-SEU5V7I6.js";import{b as Ke}from"./chunk-O4PXDNR3.js";import"./chunk-ZH7UES4T.js";import{f as Ue}from"./chunk-KODWGUAB.js";import"./chunk-3OA7PECS.js";import{d as Qe,e as Ge,f as Je,g as We,i as Xe,k as Ae}from"./chunk-YJGANMU7.js";import{a as n,e as Be,f as pt,g as xt,h as bt}from"./chunk-RRCPZMC2.js";var Le=Be(xt(),1);var v=Be(pt(),1);var t=Be(bt(),1);var ze=n(l=>l>=100?"critical":l>=50?"warning":"good","performanceLevel"),He=n(l=>l<1?`${(l*1e3).toFixed(0)}\u03BCs`:l<1e3?`${l.toFixed(1)}ms`:`${(l/1e3).toFixed(2)}s`,"formatLatency"),Ee=n(l=>l>=1e9?`${(l/1e9).toFixed(1)}B`:l>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${(l/1e3).toFixed(1)}K`:l.toLocaleString(),"formatCount"),Nt=n(l=>{let e=(0,Le.c)(3),{level:s}=l;if(s==="critical"){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=(0,t.jsxDEV)(Ke,{variant:"destructive",children:"Slow"},void 0,!1),e[0]=i):i=e[0],i}if(s==="warning"){let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=(0,t.jsxDEV)("span",{className:"inline-flex items-center gap-1 rounded-md border border-transparent bg-warning/10 px-2 py-0.5 text-xs font-medium text-warning",children:"Moderate"},void 0,!1),e[1]=i):i=e[1],i}let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsxDEV)("span",{className:"inline-flex items-center gap-1 rounded-md border border-transparent bg-success/10 px-2 py-0.5 text-xs font-medium text-success",children:"Fast"},void 0,!1),e[2]=r):r=e[2],r},"PerformanceBadge"),yt=n(l=>{let e=(0,Le.c)(152),{queryStats:s}=l,r=Qe(),[i,Q]=(0,v.useState)("totalTime"),C;e[0]===Symbol.for("react.memo_cache_sentinel")?(C=new Set,e[0]=C):C=e[0];let[h,T]=(0,v.useState)(C),p;e[1]===Symbol.for("react.memo_cache_sentinel")?(p=n(o=>{o!==null&&Q(o)},"t2"),e[1]=p):p=e[1];let S=p,u;if(e[2]!==s||e[3]!==i){u=[...s];let o;e[5]!==i?(o=n((m,c)=>{switch(i){case"avgTime":return c.avgDurationMs-m.avgDurationMs;case"execCount":return c.execCount-m.execCount;case"rowsRead":return c.rowsRead-m.rowsRead;default:return c.totalDurationMs-m.totalDurationMs}},"t310"),e[5]=i,e[6]=o):o=e[6],u.sort(o),e[2]=s,e[3]=i,e[4]=u}else u=e[4];let g=u,$;e[7]!==s?($=s.filter(St),e[7]=s,e[8]=$):$=e[8];let j=$.length,H;e[9]!==s?(H=s.filter(wt),e[9]=s,e[10]=H):H=e[10];let d=H.length,_;e[11]!==s?(_=s.filter(qt),e[11]=s,e[12]=_):_=e[12];let U=_.length,O;e[13]===Symbol.for("react.memo_cache_sentinel")?(O=n(o=>{T(m=>{let c=new Set(m);return c.has(o)?c.delete(o):c.add(o),c})},"t6"),e[13]=O):O=e[13];let Fe=O;if(s.length===0){let o;e[14]!==r?(o=r("No query insights yet"),e[14]=r,e[15]=o):o=e[15];let m;e[16]!==o?(m=(0,t.jsxDEV)("p",{className:"text-lg font-medium","data-testid":"qi-empty",children:o},void 0,!1),e[16]=o,e[17]=m):m=e[17];let c;e[18]!==r?(c=r("Query insights appear once statements are executed against this shard."),e[18]=r,e[19]=c):c=e[19];let z;e[20]!==c?(z=(0,t.jsxDEV)("p",{className:"mt-1 text-sm",children:c},void 0,!1),e[20]=c,e[21]=z):z=e[21];let ke;return e[22]!==z||e[23]!==m?(ke=(0,t.jsxDEV)(B,{children:(0,t.jsxDEV)(P,{className:"py-12",children:(0,t.jsxDEV)("div",{className:"text-center text-muted-foreground",children:[m,z]},void 0,!0)},void 0,!1)},void 0,!1),e[22]=z,e[23]=m,e[24]=ke):ke=e[24],ke}let I;e[25]!==r?(I=r("Critical queries"),e[25]=r,e[26]=I):I=e[26];let f;e[27]!==I?(f=(0,t.jsxDEV)(Re,{className:"pb-2",children:(0,t.jsxDEV)(_e,{className:"text-sm font-medium",children:I},void 0,!1)},void 0,!1),e[27]=I,e[28]=f):f=e[28];let M;e[29]!==j?(M=(0,t.jsxDEV)("div",{className:"text-2xl font-bold text-destructive","data-testid":"qi-critical",children:j},void 0,!1),e[29]=j,e[30]=M):M=e[30];let D;e[31]!==r?(D=r(">100ms avg execution"),e[31]=r,e[32]=D):D=e[32];let R;e[33]!==D?(R=(0,t.jsxDEV)("p",{className:"text-xs text-muted-foreground",children:D},void 0,!1),e[33]=D,e[34]=R):R=e[34];let F;e[35]!==R||e[36]!==M?(F=(0,t.jsxDEV)(P,{children:[M,R]},void 0,!0),e[35]=R,e[36]=M,e[37]=F):F=e[37];let b;e[38]!==F||e[39]!==f?(b=(0,t.jsxDEV)(B,{children:[f,F]},void 0,!0),e[38]=F,e[39]=f,e[40]=b):b=e[40];let N;e[41]!==r?(N=r("Moderate queries"),e[41]=r,e[42]=N):N=e[42];let k;e[43]!==N?(k=(0,t.jsxDEV)(Re,{className:"pb-2",children:(0,t.jsxDEV)(_e,{className:"text-sm font-medium",children:N},void 0,!1)},void 0,!1),e[43]=N,e[44]=k):k=e[44];let A;e[45]!==d?(A=(0,t.jsxDEV)("div",{className:"text-2xl font-bold text-warning","data-testid":"qi-moderate",children:d},void 0,!1),e[45]=d,e[46]=A):A=e[46];let E;e[47]!==r?(E=r("50\u2013100ms avg execution"),e[47]=r,e[48]=E):E=e[48];let L;e[49]!==E?(L=(0,t.jsxDEV)("p",{className:"text-xs text-muted-foreground",children:E},void 0,!1),e[49]=E,e[50]=L):L=e[50];let a;e[51]!==A||e[52]!==L?(a=(0,t.jsxDEV)(P,{children:[A,L]},void 0,!0),e[51]=A,e[52]=L,e[53]=a):a=e[53];let w;e[54]!==k||e[55]!==a?(w=(0,t.jsxDEV)(B,{children:[k,a]},void 0,!0),e[54]=k,e[55]=a,e[56]=w):w=e[56];let x;e[57]!==r?(x=r("Fast queries"),e[57]=r,e[58]=x):x=e[58];let y;e[59]!==x?(y=(0,t.jsxDEV)(Re,{className:"pb-2",children:(0,t.jsxDEV)(_e,{className:"text-sm font-medium",children:x},void 0,!1)},void 0,!1),e[59]=x,e[60]=y):y=e[60];let K;e[61]!==U?(K=(0,t.jsxDEV)("div",{className:"text-2xl font-bold text-success","data-testid":"qi-fast",children:U},void 0,!1),e[61]=U,e[62]=K):K=e[62];let V;e[63]!==r?(V=r("<50ms avg execution"),e[63]=r,e[64]=V):V=e[64];let G;e[65]!==V?(G=(0,t.jsxDEV)("p",{className:"text-xs text-muted-foreground",children:V},void 0,!1),e[65]=V,e[66]=G):G=e[66];let J;e[67]!==K||e[68]!==G?(J=(0,t.jsxDEV)(P,{children:[K,G]},void 0,!0),e[67]=K,e[68]=G,e[69]=J):J=e[69];let W;e[70]!==y||e[71]!==J?(W=(0,t.jsxDEV)(B,{children:[y,J]},void 0,!0),e[70]=y,e[71]=J,e[72]=W):W=e[72];let X;e[73]!==b||e[74]!==w||e[75]!==W?(X=(0,t.jsxDEV)("div",{className:"grid gap-4 md:grid-cols-3",children:[b,w,W]},void 0,!0),e[73]=b,e[74]=w,e[75]=W,e[76]=X):X=e[76];let Y;e[77]!==r?(Y=r("Query leaderboard"),e[77]=r,e[78]=Y):Y=e[78];let Z;e[79]!==Y?(Z=(0,t.jsxDEV)("h3",{className:"text-lg font-semibold",children:Y},void 0,!1),e[79]=Y,e[80]=Z):Z=e[80];let ee;e[81]!==i||e[82]!==r?(ee=r("Slow queries sorted by {sortField}",{sortField:r(i)}),e[81]=i,e[82]=r,e[83]=ee):ee=e[83];let te;e[84]!==ee?(te=(0,t.jsxDEV)("p",{className:"text-sm text-muted-foreground",children:ee},void 0,!1),e[84]=ee,e[85]=te):te=e[85];let re;e[86]!==Z||e[87]!==te?(re=(0,t.jsxDEV)("div",{children:[Z,te]},void 0,!0),e[86]=Z,e[87]=te,e[88]=re):re=e[88];let se;e[89]!==r?(se=r("Sort by"),e[89]=r,e[90]=se):se=e[90];let le;e[91]!==se?(le=(0,t.jsxDEV)("span",{className:"text-sm text-muted-foreground",children:se},void 0,!1),e[91]=se,e[92]=le):le=e[92];let ae;e[93]!==r?(ae=r("Sort queries by"),e[93]=r,e[94]=ae):ae=e[94];let Ie;e[95]===Symbol.for("react.memo_cache_sentinel")?(Ie=(0,t.jsxDEV)(nt,{},void 0,!1),e[95]=Ie):Ie=e[95];let ie;e[96]!==ae?(ie=(0,t.jsxDEV)(ct,{"aria-label":ae,className:"w-[140px]","data-testid":"qi-sort",children:Ie},void 0,!1),e[96]=ae,e[97]=ie):ie=e[97];let oe;e[98]!==r?(oe=r("Total time"),e[98]=r,e[99]=oe):oe=e[99];let de;e[100]!==oe?(de=(0,t.jsxDEV)(Me,{value:"totalTime",children:oe},void 0,!1),e[100]=oe,e[101]=de):de=e[101];let ne;e[102]!==r?(ne=r("Avg time"),e[102]=r,e[103]=ne):ne=e[103];let ce;e[104]!==ne?(ce=(0,t.jsxDEV)(Me,{value:"avgTime",children:ne},void 0,!1),e[104]=ne,e[105]=ce):ce=e[105];let ue;e[106]!==r?(ue=r("Execution count"),e[106]=r,e[107]=ue):ue=e[107];let fe;e[108]!==ue?(fe=(0,t.jsxDEV)(Me,{value:"execCount",children:ue},void 0,!1),e[108]=ue,e[109]=fe):fe=e[109];let me;e[110]!==r?(me=r("Rows read"),e[110]=r,e[111]=me):me=e[111];let ve;e[112]!==me?(ve=(0,t.jsxDEV)(Me,{value:"rowsRead",children:me},void 0,!1),e[112]=me,e[113]=ve):ve=e[113];let he;e[114]!==de||e[115]!==ce||e[116]!==fe||e[117]!==ve?(he=(0,t.jsxDEV)(ut,{children:[de,ce,fe,ve]},void 0,!0),e[114]=de,e[115]=ce,e[116]=fe,e[117]=ve,e[118]=he):he=e[118];let ge;e[119]!==i||e[120]!==ie||e[121]!==he?(ge=(0,t.jsxDEV)(dt,{onValueChange:S,value:i,children:[ie,he]},void 0,!0),e[119]=i,e[120]=ie,e[121]=he,e[122]=ge):ge=e[122];let pe;e[123]!==le||e[124]!==ge?(pe=(0,t.jsxDEV)("div",{className:"flex items-center gap-2",children:[le,ge]},void 0,!0),e[123]=le,e[124]=ge,e[125]=pe):pe=e[125];let xe;e[126]!==re||e[127]!==pe?(xe=(0,t.jsxDEV)("div",{className:"flex items-center justify-between",children:[re,pe]},void 0,!0),e[126]=re,e[127]=pe,e[128]=xe):xe=e[128];let be;e[129]!==r?(be=r("Statements"),e[129]=r,e[130]=be):be=e[130];let Ne;e[131]!==be?(Ne=(0,t.jsxDEV)(_e,{children:be},void 0,!1),e[131]=be,e[132]=Ne):Ne=e[132];let ye;e[133]!==g.length||e[134]!==r?(ye=r("{count} tracked statements",{count:g.length}),e[133]=g.length,e[134]=r,e[135]=ye):ye=e[135];let Se;e[136]!==ye?(Se=(0,t.jsxDEV)(Ve,{children:ye},void 0,!1),e[136]=ye,e[137]=Se):Se=e[137];let we;e[138]!==Ne||e[139]!==Se?(we=(0,t.jsxDEV)(Re,{children:[Ne,Se]},void 0,!0),e[138]=Ne,e[139]=Se,e[140]=we):we=e[140];let qe;e[141]!==h||e[142]!==g||e[143]!==r?(qe=(0,t.jsxDEV)(P,{children:(0,t.jsxDEV)("div",{className:"space-y-2",children:g.map(o=>{let m=o.normalizedSql,c=h.has(m),z=ze(o.avgDurationMs);return(0,t.jsxDEV)("div",{className:"overflow-hidden rounded-lg border","data-testid":"qi-row",children:[(0,t.jsxDEV)("button",{"aria-expanded":c,className:"flex w-full items-center justify-between p-3 text-left transition-colors hover:bg-muted/50",onClick:n(()=>{Fe(m)},"onClick"),type:"button",children:[(0,t.jsxDEV)("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[(0,t.jsxDEV)(Nt,{level:z},void 0,!1),(0,t.jsxDEV)("span",{className:"max-w-[300px] truncate font-mono text-sm lg:max-w-[500px]",children:o.normalizedSql},void 0,!1)]},void 0,!0),(0,t.jsxDEV)("div",{className:"flex shrink-0 items-center gap-4",children:[(0,t.jsxDEV)("div",{className:"text-right",children:[(0,t.jsxDEV)("div",{className:"text-sm font-medium",children:He(o.totalDurationMs)},void 0,!1),(0,t.jsxDEV)("div",{className:"text-xs text-muted-foreground",children:r("total")},void 0,!1)]},void 0,!0),(0,t.jsxDEV)("div",{className:"text-right",children:[(0,t.jsxDEV)("div",{className:"text-sm font-medium",children:He(o.avgDurationMs)},void 0,!1),(0,t.jsxDEV)("div",{className:"text-xs text-muted-foreground",children:r("avg")},void 0,!1)]},void 0,!0),(0,t.jsxDEV)("div",{className:"text-right",children:[(0,t.jsxDEV)("div",{className:"text-sm font-medium",children:Ee(o.execCount)},void 0,!1),(0,t.jsxDEV)("div",{className:"text-xs text-muted-foreground",children:r("calls")},void 0,!1)]},void 0,!0)]},void 0,!0)]},void 0,!0),c&&(0,t.jsxDEV)("div",{className:"space-y-3 border-t bg-muted/30 p-4",children:[(0,t.jsxDEV)("div",{children:[(0,t.jsxDEV)("p",{className:"mb-2 text-sm font-medium",children:r("Full statement")},void 0,!1),(0,t.jsxDEV)("pre",{className:"overflow-x-auto rounded-md bg-muted p-3 font-mono text-sm whitespace-pre-wrap break-all",children:o.normalizedSql},void 0,!1)]},void 0,!0),(0,t.jsxDEV)("div",{className:"grid grid-cols-2 gap-4 text-sm md:grid-cols-4",children:[(0,t.jsxDEV)("div",{children:[(0,t.jsxDEV)("span",{className:"text-muted-foreground",children:r("Exec count")},void 0,!1),(0,t.jsxDEV)("span",{className:"block font-medium tabular-nums",children:Ee(o.execCount)},void 0,!1)]},void 0,!0),(0,t.jsxDEV)("div",{children:[(0,t.jsxDEV)("span",{className:"text-muted-foreground",children:r("Total time")},void 0,!1),(0,t.jsxDEV)("span",{className:"block font-medium tabular-nums",children:He(o.totalDurationMs)},void 0,!1)]},void 0,!0),(0,t.jsxDEV)("div",{children:[(0,t.jsxDEV)("span",{className:"text-muted-foreground",children:r("Rows read")},void 0,!1),(0,t.jsxDEV)("span",{className:"block font-medium tabular-nums",children:Ee(o.rowsRead)},void 0,!1)]},void 0,!0),(0,t.jsxDEV)("div",{children:[(0,t.jsxDEV)("span",{className:"text-muted-foreground",children:r("Rows written")},void 0,!1),(0,t.jsxDEV)("span",{className:"block font-medium tabular-nums",children:Ee(o.rowsWritten)},void 0,!1)]},void 0,!0)]},void 0,!0)]},void 0,!0)]},m,!0)})},void 0,!1)},void 0,!1),e[141]=h,e[142]=g,e[143]=r,e[144]=qe):qe=e[144];let Ce;e[145]!==we||e[146]!==qe?(Ce=(0,t.jsxDEV)(B,{children:[we,qe]},void 0,!0),e[145]=we,e[146]=qe,e[147]=Ce):Ce=e[147];let De;return e[148]!==X||e[149]!==xe||e[150]!==Ce?(De=(0,t.jsxDEV)("div",{className:"space-y-4","data-testid":"qi-root",children:[X,xe,Ce]},void 0,!0),e[148]=X,e[149]=xe,e[150]=Ce,e[151]=De):De=e[151],De},"QueryInsights");function St(l){return ze(l.avgDurationMs)==="critical"}n(St,"_temp");function wt(l){return ze(l.avgDurationMs)==="warning"}n(wt,"_temp2");function qt(l){return ze(l.avgDurationMs)==="good"}n(qt,"_temp3");var Ct=Ge(Pe.getMetrics),Tt=n(l=>{let e=Math.floor(l/1e3),s=Math.floor(e/3600),r=Math.floor(e%3600/60),i=e%60;return s>0?`${s.toString()}h ${r.toString()}m`:r>0?`${r.toString()}m ${i.toString()}s`:`${i.toString()}s`},"formatDuration"),Rt=n((l,e)=>l?e:"overview","resolveTab"),_t=n((l,e)=>{let s=l+e;return s===0?"\u2014":`${(l/s*100).toFixed(1)}%`},"hitRate"),q=n(l=>{let e=(0,Le.c)(16),{chart:s,footer:r,label:i,testId:Q,value:C}=l,h;e[0]!==i?(h=(0,t.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:i},void 0,!1),e[0]=i,e[1]=h):h=e[1];let T;e[2]!==Q||e[3]!==C?(T=(0,t.jsxDEV)("span",{className:"truncate text-2xl font-semibold tabular-nums text-foreground","data-testid":Q,children:C},void 0,!1),e[2]=Q,e[3]=C,e[4]=T):T=e[4];let p;e[5]!==s||e[6]!==T?(p=(0,t.jsxDEV)("div",{className:"flex items-center justify-between gap-3",children:[T,s]},void 0,!0),e[5]=s,e[6]=T,e[7]=p):p=e[7];let S;e[8]!==h||e[9]!==p?(S=(0,t.jsxDEV)("div",{className:"flex flex-col gap-2.5 p-4",children:[h,p]},void 0,!0),e[8]=h,e[9]=p,e[10]=S):S=e[10];let u;e[11]!==r?(u=r!=null&&(0,t.jsxDEV)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",children:r},void 0,!1),e[11]=r,e[12]=u):u=e[12];let g;return e[13]!==S||e[14]!==u?(g=(0,t.jsxDEV)(B,{className:"justify-between gap-0 py-0",children:[S,u]},void 0,!0),e[13]=S,e[14]=u,e[15]=g):g=e[15],g},"StatCard"),Kt=n(({initialShardKey:l})=>{let e=Ue(),s=Qe(),[r,i]=(0,v.useState)(l??""),[Q,C]=(0,v.useState)("overview"),[h,T]=(0,v.useState)([]),p=(0,v.useRef)(null),S=(0,v.useRef)(null),u=(0,v.useRef)(!0);(0,v.useEffect)(()=>(u.current=!0,()=>{u.current=!1}),[]);let g=rt(r.trim(),400),{data:$,error:j,liveError:H}=Ye(Pe.getMetrics,{},{live:!0,shardKey:g}),d=$??null;(0,v.useEffect)(()=>{if($===void 0)return;et(g);let a=$,w=p.current,x=S.current!==null&&S.current!==a.shard;if(S.current=a.shard,p.current=a.requests,x){T([]);return}w!==null&&a.requests>=w&&T(y=>[...y,a.requests-w].slice(-30))},[$,g]);let[_,U]=(0,v.useState)(null),[O,Fe]=(0,v.useState)(!1),I=n(async()=>{Fe(!0);let a=mt(r,Ze());try{let w=await Promise.all(a.map(async x=>{try{let y=await e.query(Ct,{},Je(x));return{error:null,metrics:y,shard:x===""?y.shard:x}}catch(y){return{error:We(y),metrics:null,shard:x===""?"__root__":x}}}));u.current&&U(w)}finally{u.current&&Fe(!1)}},"aggregateAll"),f=_===null?null:ft(_),M=d===null||d.requests===0?"\u2014":`${(d.errors/d.requests*100).toFixed(1)}%`,D=h.length>0?h.at(-1):0,R=d?vt(d):{p90:0,p95:0},F=n(a=>a<=0?"\u2014":a<1?`${(a*1e3).toFixed(0)}\u03BCs`:a<1e3?`${a.toFixed(1)}ms`:`${(a/1e3).toFixed(2)}s`,"formatMs"),b=(0,v.useMemo)(()=>{if(!d||!("queryStats"in d))return;let a=d.queryStats;if(!(!a||!Array.isArray(a)))return ht(a)},[d]),N=Rt(b!==void 0,Q),k=n(()=>{Xe(I())},"runAggregate"),A=n(()=>{U(null)},"clearAggregate"),E=n(()=>{C("overview")},"switchToOverview"),L=n(()=>{C("query-insights")},"switchToQueryInsights");return(0,t.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-metrics",children:[(0,t.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxDEV)(tt,{onChange:i,testId:"mt-shard-input",value:r},void 0,!1),(0,t.jsxDEV)(it,{message:H,prefix:"mt"},void 0,!1),(0,t.jsxDEV)(Oe,{"data-testid":"mt-aggregate",disabled:O,onClick:k,size:"sm",type:"button",variant:"secondary",children:s(O?"Aggregating\u2026":"All shards")},void 0,!1),_!==null&&(0,t.jsxDEV)(Oe,{"data-testid":"mt-aggregate-clear",onClick:A,size:"sm",type:"button",variant:"ghost",children:s("Hide")},void 0,!1),(0,t.jsxDEV)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"mt-cf-link",href:ot,rel:"noreferrer",target:"_blank",children:s("Open in Cloudflare")},void 0,!1)]},void 0,!0),j!==null&&(0,t.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"mt-error",role:"alert",children:j},void 0,!1),b!==void 0&&(0,t.jsxDEV)("div",{className:"flex gap-2 border-b","data-testid":"mt-tabs",children:[(0,t.jsxDEV)("button",{className:`pb-2 text-sm font-medium transition-colors ${N==="overview"?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"}`,"data-testid":"mt-tab-overview",onClick:E,type:"button",children:s("Overview")},void 0,!1),(0,t.jsxDEV)("button",{className:`pb-2 text-sm font-medium transition-colors ${N==="query-insights"?"border-b-2 border-primary text-foreground":"text-muted-foreground hover:text-foreground"}`,"data-testid":"mt-tab-query-insights",onClick:L,type:"button",children:[s("Query insights"),b.length>0&&(0,t.jsxDEV)("span",{className:"ml-1.5 rounded-full bg-primary/10 px-1.5 py-0.5 text-xs text-primary",children:b.length},void 0,!1)]},void 0,!0)]},void 0,!0),N==="query-insights"&&b!==void 0&&(0,t.jsxDEV)(yt,{queryStats:b},void 0,!1),N==="overview"&&d!==null&&(0,t.jsxDEV)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4","data-testid":"mt-stats",children:[(0,t.jsxDEV)(q,{chart:h.length>=2?(0,t.jsxDEV)(gt,{ariaLabel:s("Requests per interval over time"),className:"h-7 w-24 text-foreground",series:h,testId:"mt-sparkline"},void 0,!1):void 0,footer:h.length>=2?(0,t.jsxDEV)(t.Fragment,{children:[(0,t.jsxDEV)("span",{className:"font-semibold text-foreground",children:`+${D.toLocaleString()}`},void 0,!1)," ",s("last interval")]},void 0,!0):(0,t.jsxDEV)("span",{"data-testid":"mt-sparkline-empty",children:s("collecting samples\u2026")},void 0,!1),label:s("Requests"),testId:"mt-requests",value:d.requests},void 0,!1),(0,t.jsxDEV)(q,{footer:s("{rate} error rate",{rate:M}),label:s("Errors"),testId:"mt-errors",value:(0,t.jsxDEV)(t.Fragment,{children:[d.errors," (",M,")"]},void 0,!0)},void 0,!1),(0,t.jsxDEV)(q,{footer:R.p90>0?`P90 ${F(R.p90)}`:void 0,label:s("P95 latency"),testId:"mt-p95",value:R.p95>0?F(R.p95):"\u2014"},void 0,!1),(0,t.jsxDEV)(q,{footer:d.cache===null?void 0:`${d.cache.entries.toLocaleString()} ${s("cache entries")}`,label:s("Database size"),testId:"mt-db-size",value:Ae(d.databaseSize)},void 0,!1),(0,t.jsxDEV)(q,{label:s("Shard"),testId:"mt-shard",value:d.shard},void 0,!1),(0,t.jsxDEV)(q,{label:s("Uptime"),testId:"mt-uptime",value:Tt(d.uptimeMs)},void 0,!1),(0,t.jsxDEV)(q,{label:s("Cache hit rate"),testId:"mt-cache",value:d.cache===null?s("no cache configured"):s("{rate} ({count} entries)",{count:d.cache.entries,rate:_t(d.cache.hits,d.cache.misses)})},void 0,!1)]},void 0,!0),N==="overview"&&d===null&&null,N==="overview"&&f!==null&&_!==null&&(0,t.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"mt-aggregate-view",children:[(0,t.jsxDEV)("dl",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3","data-testid":"mt-aggregate-stats",children:[(0,t.jsxDEV)(q,{label:s("Shards"),testId:"mt-agg-shards",value:f.failed>0?s("{reachable} reachable, {failed} unreachable",{failed:f.failed,reachable:f.reachable}):s("{reachable} reachable",{reachable:f.reachable})},void 0,!1),(0,t.jsxDEV)(q,{label:s("Total requests"),testId:"mt-agg-requests",value:f.totalRequests},void 0,!1),(0,t.jsxDEV)(q,{label:s("Total errors"),testId:"mt-agg-errors",value:f.totalErrors},void 0,!1),(0,t.jsxDEV)(q,{label:s("Total database size"),testId:"mt-agg-db-size",value:Ae(f.totalDatabaseSize)},void 0,!1),(0,t.jsxDEV)(q,{label:s("Combined cache hit rate"),testId:"mt-agg-cache",value:f.hitRate===null?s("no cache configured"):`${(f.hitRate*100).toFixed(1)}%`},void 0,!1)]},void 0,!0),(0,t.jsxDEV)(B,{className:"overflow-hidden py-0",children:(0,t.jsxDEV)(P,{className:"px-0",children:(0,t.jsxDEV)(st,{"data-testid":"mt-agg-table",children:[(0,t.jsxDEV)(lt,{children:(0,t.jsxDEV)(je,{children:[(0,t.jsxDEV)($e,{children:s("shard")},void 0,!1),(0,t.jsxDEV)($e,{children:s("requests")},void 0,!1),(0,t.jsxDEV)($e,{children:s("errors")},void 0,!1),(0,t.jsxDEV)($e,{children:s("db size")},void 0,!1)]},void 0,!0)},void 0,!1),(0,t.jsxDEV)(at,{children:_.map(a=>(0,t.jsxDEV)(je,{"data-testid":`mt-agg-row-${a.shard}`,children:[(0,t.jsxDEV)(Te,{children:a.shard},void 0,!1),a.metrics===null?(0,t.jsxDEV)(Te,{className:"text-destructive",colSpan:3,children:a.error??s("unreachable")},void 0,!1):(0,t.jsxDEV)(t.Fragment,{children:[(0,t.jsxDEV)(Te,{className:"tabular-nums",children:a.metrics.requests},void 0,!1),(0,t.jsxDEV)(Te,{className:"tabular-nums",children:a.metrics.errors},void 0,!1),(0,t.jsxDEV)(Te,{className:"tabular-nums",children:Ae(a.metrics.databaseSize)},void 0,!1)]},void 0,!0)]},a.shard,!0))},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1)]},void 0,!0)]},void 0,!0)},"MetricsPanel");export{Kt as MetricsPanel};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as dS,b as rp,c as gS,d as dp,e as vS,f as SS,k as bS}from"./chunk-GABMIICA.js";import"./chunk-ZPUO7FNI.js";import"./chunk-ITLLHEVG.js";import"./chunk-NNISYDNI.js";import"./chunk-5OIBXYZM.js";import"./chunk-UII66UVF.js";import"./chunk-7TJJXVSE.js";import"./chunk-SVR644RF.js";import{a as yS}from"./chunk-2K47A3P6.js";import"./chunk-KEGAWN6Y.js";import"./chunk-KZ6INM5M.js";import"./chunk-4QHKBC77.js";import{R as pS}from"./chunk-BHTPZS7L.js";import{c as mS}from"./chunk-YQQJ4N6U.js";import"./chunk-TICVNLPM.js";import{a as ST}from"./chunk-HV7G6DFP.js";import"./chunk-AQGOX5DK.js";import"./chunk-TAD43CG5.js";import"./chunk-FCR3HKFV.js";import"./chunk-SEU5V7I6.js";import"./chunk-O4PXDNR3.js";import"./chunk-ZH7UES4T.js";import{a as sS,e as rS}from"./chunk-KODWGUAB.js";import"./chunk-3OA7PECS.js";import{a as hS,d as fp}from"./chunk-YJGANMU7.js";import{a as o,c as gf,e as Wi,f as cS,g as bT,h as fS,j as sp}from"./chunk-RRCPZMC2.js";var ES=gf(Ye=>{"use strict";(function(){function ge(){if(ot=!1,K){var z=Ye.unstable_now();De=z;var j=!0;try{e:{he=!1,Ue&&(Ue=!1,pt(Ke),Ke=-1),oe=!0;var q=V;try{t:{for(se(z),I=J(L);I!==null&&!(I.expirationTime>z&&A());){var xe=I.callback;if(typeof xe=="function"){I.callback=null,V=I.priorityLevel;var Ge=xe(I.expirationTime<=z);if(z=Ye.unstable_now(),typeof Ge=="function"){I.callback=Ge,se(z),j=!0;break t}I===J(L)&&G(L),se(z)}else G(L);I=J(L)}if(I!==null)j=!0;else{var ba=J(de);ba!==null&&ce(ae,ba.startTime-z),j=!1}}break e}finally{I=null,V=q,oe=!1}j=void 0}}finally{j?_e():K=!1}}}o(ge,"performWorkUntilDeadline");function r(z,j){var q=z.length;z.push(j);e:for(;0<q;){var xe=q-1>>>1,Ge=z[xe];if(0<ee(Ge,j))z[xe]=j,z[q]=Ge,q=xe;else break e}}o(r,"push");function J(z){return z.length===0?null:z[0]}o(J,"peek");function G(z){if(z.length===0)return null;var j=z[0],q=z.pop();if(q!==j){z[0]=q;e:for(var xe=0,Ge=z.length,ba=Ge>>>1;xe<ba;){var iu=2*(xe+1)-1,yo=z[iu],Sn=iu+1,it=z[Sn];if(0>ee(yo,q))Sn<Ge&&0>ee(it,yo)?(z[xe]=it,z[Sn]=q,xe=Sn):(z[xe]=yo,z[iu]=q,xe=iu);else if(Sn<Ge&&0>ee(it,q))z[xe]=it,z[Sn]=q,xe=Sn;else break e}}return j}o(G,"pop");function ee(z,j){var q=z.sortIndex-j.sortIndex;return q!==0?q:z.id-j.id}o(ee,"compare");function se(z){for(var j=J(de);j!==null;){if(j.callback===null)G(de);else if(j.startTime<=z)G(de),j.sortIndex=j.expirationTime,r(L,j);else break;j=J(de)}}o(se,"advanceTimers");function ae(z){if(Ue=!1,se(z),!he)if(J(L)!==null)he=!0,K||(K=!0,_e());else{var j=J(de);j!==null&&ce(ae,j.startTime-z)}}o(ae,"handleTimeout");function A(){return ot?!0:!(Ye.unstable_now()-De<U)}o(A,"shouldYieldToHost");function ce(z,j){Ke=Gt(function(){z(Ye.unstable_now())},j)}if(o(ce,"requestHostTimeout"),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()),Ye.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var Be=performance;Ye.unstable_now=function(){return Be.now()}}else{var Ze=Date,ue=Ze.now();Ye.unstable_now=function(){return Ze.now()-ue}}var L=[],de=[],Ae=1,I=null,V=3,oe=!1,he=!1,Ue=!1,ot=!1,Gt=typeof setTimeout=="function"?setTimeout:null,pt=typeof clearTimeout=="function"?clearTimeout:null,bt=typeof setImmediate<"u"?setImmediate:null,K=!1,Ke=-1,U=5,De=-1;if(typeof bt=="function")var _e=o(function(){bt(ge)},"schedulePerformWorkUntilDeadline");else if(typeof MessageChannel<"u"){var pe=new MessageChannel,ul=pe.port2;pe.port1.onmessage=ge,_e=o(function(){ul.postMessage(null)},"schedulePerformWorkUntilDeadline")}else _e=o(function(){Gt(ge,0)},"schedulePerformWorkUntilDeadline");Ye.unstable_IdlePriority=5,Ye.unstable_ImmediatePriority=1,Ye.unstable_LowPriority=4,Ye.unstable_NormalPriority=3,Ye.unstable_Profiling=null,Ye.unstable_UserBlockingPriority=2,Ye.unstable_cancelCallback=function(z){z.callback=null},Ye.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<z?Math.floor(1e3/z):5},Ye.unstable_getCurrentPriorityLevel=function(){return V},Ye.unstable_next=function(z){switch(V){case 1:case 2:case 3:var j=3;break;default:j=V}var q=V;V=j;try{return z()}finally{V=q}},Ye.unstable_requestPaint=function(){ot=!0},Ye.unstable_runWithPriority=function(z,j){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var q=V;V=z;try{return j()}finally{V=q}},Ye.unstable_scheduleCallback=function(z,j,q){var xe=Ye.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?xe+q:xe):q=xe,z){case 1:var Ge=-1;break;case 2:Ge=250;break;case 5:Ge=1073741823;break;case 4:Ge=1e4;break;default:Ge=5e3}return Ge=q+Ge,z={id:Ae++,callback:j,priorityLevel:z,startTime:q,expirationTime:Ge,sortIndex:-1},q>xe?(z.sortIndex=q,r(de,z),J(L)===null&&z===J(de)&&(Ue?(pt(Ke),Ke=-1):Ue=!0,ce(ae,q-xe))):(z.sortIndex=Ge,r(L,z),he||oe||(he=!0,K||(K=!0,_e()))),z},Ye.unstable_shouldYield=A,Ye.unstable_wrapCallback=function(z){var j=V;return function(){var q=V;V=j;try{return z.apply(this,arguments)}finally{V=q}}},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var AS=gf((UT,TS)=>{"use strict";TS.exports=ES()});var DS=gf(vf=>{"use strict";(function(){function ge(e,t){for(e=e.memoizedState;e!==null&&0<t;)e=e.next,t--;return e}o(ge,"findHook");function r(e,t,n,l){if(n>=t.length)return l;var a=t[n],u=lt(e)?e.slice():F({},e);return u[a]=r(e[a],t,n+1,l),u}o(r,"copyWithSetImpl");function J(e,t,n){if(t.length!==n.length)console.warn("copyWithRename() expects paths of the same length");else{for(var l=0;l<n.length-1;l++)if(t[l]!==n[l]){console.warn("copyWithRename() expects paths to be the same except for the deepest key");return}return G(e,t,n,0)}}o(J,"copyWithRename");function G(e,t,n,l){var a=t[l],u=lt(e)?e.slice():F({},e);return l+1===t.length?(u[n[l]]=u[a],lt(u)?u.splice(a,1):delete u[a]):u[a]=G(e[a],t,n,l+1),u}o(G,"copyWithRenameImpl");function ee(e,t,n){var l=t[n],a=lt(e)?e.slice():F({},e);return n+1===t.length?(lt(a)?a.splice(l,1):delete a[l],a):(a[l]=ee(e[l],t,n+1),a)}o(ee,"copyWithDeleteImpl");function se(){return!1}o(se,"shouldSuspendImpl");function ae(){return null}o(ae,"shouldErrorImpl");function A(){console.error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://react.dev/link/rules-of-hooks")}o(A,"warnInvalidHookAccess");function ce(){console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")}o(ce,"warnInvalidContextAccess");function Be(){}o(Be,"noop");function Ze(){}o(Ze,"warnForMissingKey");function ue(e){var t=[];return e.forEach(function(n){t.push(n)}),t.sort().join(", ")}o(ue,"setToSortedString");function L(e,t,n,l){return new ib(e,t,n,l)}o(L,"createFiber");function de(e,t){e.context===Pl&&(Cd(e.current,2,t,e,null,null),Du())}o(de,"scheduleRoot");function Ae(e,t){if(sn!==null){var n=t.staleFamilies;t=t.updatedFamilies,Jo(),pm(e.current,t,n),Du()}}o(Ae,"scheduleRefresh");function I(e){sn=e}o(I,"setRefreshHandler");function V(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}o(V,"isValidContainer");function oe(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}o(oe,"getNearestMountedFiber");function he(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}o(he,"getSuspenseInstanceFromFiber");function Ue(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}o(Ue,"getActivityInstanceFromFiber");function ot(e){if(oe(e)!==e)throw Error("Unable to find node on an unmounted component.")}o(ot,"assertIsMounted");function Gt(e){var t=e.alternate;if(!t){if(t=oe(e),t===null)throw Error("Unable to find node on an unmounted component.");return t!==e?null:e}for(var n=e,l=t;;){var a=n.return;if(a===null)break;var u=a.alternate;if(u===null){if(l=a.return,l!==null){n=l;continue}break}if(a.child===u.child){for(u=a.child;u;){if(u===n)return ot(a),e;if(u===l)return ot(a),t;u=u.sibling}throw Error("Unable to find node on an unmounted component.")}if(n.return!==l.return)n=a,l=u;else{for(var i=!1,c=a.child;c;){if(c===n){i=!0,n=a,l=u;break}if(c===l){i=!0,l=a,n=u;break}c=c.sibling}if(!i){for(c=u.child;c;){if(c===n){i=!0,n=u,l=a;break}if(c===l){i=!0,l=u,n=a;break}c=c.sibling}if(!i)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(n.alternate!==l)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(n.tag!==3)throw Error("Unable to find node on an unmounted component.");return n.stateNode.current===n?e:t}o(Gt,"findCurrentFiberUsingSlowPath");function pt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=pt(e),t!==null)return t;e=e.sibling}return null}o(pt,"findCurrentHostFiberImpl");function bt(e){return e===null||typeof e!="object"?null:(e=Eg&&e[Eg]||e["@@iterator"],typeof e=="function"?e:null)}o(bt,"getIteratorFn");function K(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===M2?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case _u:return"Fragment";case Bd:return"Profiler";case fs:return"StrictMode";case qd:return"Suspense";case jd:return"SuspenseList";case Yd:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case Uu:return"Portal";case Kn:return e.displayName||"Context";case Nd:return(e._context.displayName||"Context")+".Consumer";case ni:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case rs:return t=e.displayName||null,t!==null?t:K(e.type)||"Memo";case kt:t=e._payload,e=e._init;try{return K(e(t))}catch{}}return null}o(K,"getComponentNameFromType");function Ke(e){return typeof e.tag=="number"?U(e):typeof e.name=="string"?e.name:null}o(Ke,"getComponentNameFromOwner");function U(e){var t=e.type;switch(e.tag){case 31:return"Activity";case 24:return"Cache";case 9:return(t._context.displayName||"Context")+".Consumer";case 10:return t.displayName||"Context";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 26:case 27:case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return K(t);case 8:return t===fs?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;break;case 29:if(t=e._debugInfo,t!=null){for(var n=t.length-1;0<=n;n--)if(typeof t[n].name=="string")return t[n].name}if(e.return!==null)return U(e.return)}return null}o(U,"getComponentNameFromFiber");function De(e){return{current:e}}o(De,"createCursor");function _e(e,t){0>ml?console.error("Unexpected pop."):(t!==Ld[ml]&&console.error("Unexpected Fiber popped."),e.current=Gd[ml],Gd[ml]=null,Ld[ml]=null,ml--)}o(_e,"pop");function pe(e,t,n){ml++,Gd[ml]=e.current,Ld[ml]=n,e.current=t}o(pe,"push");function ul(e){return e===null&&console.error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."),e}o(ul,"requiredContext");function z(e,t){pe($l,t,e),pe(li,e,e),pe(Jl,null,e);var n=t.nodeType;switch(n){case 9:case 11:n=n===9?"#document":"#fragment",t=(t=t.documentElement)&&(t=t.namespaceURI)?Zy(t):Ml;break;default:if(n=t.tagName,t=t.namespaceURI)t=Zy(t),t=Jy(t,n);else switch(n){case"svg":t=ro;break;case"math":t=ff;break;default:t=Ml}}n=n.toLowerCase(),n=Yp(null,n),n={context:t,ancestorInfo:n},_e(Jl,e),pe(Jl,n,e)}o(z,"pushHostContainer");function j(e){_e(Jl,e),_e(li,e),_e($l,e)}o(j,"popHostContainer");function q(){return ul(Jl.current)}o(q,"getHostContext");function xe(e){e.memoizedState!==null&&pe(ds,e,e);var t=ul(Jl.current),n=e.type,l=Jy(t.context,n);n=Yp(t.ancestorInfo,n),l={context:l,ancestorInfo:n},t!==l&&(pe(li,e,e),pe(Jl,l,e))}o(xe,"pushHostContext");function Ge(e){li.current===e&&(_e(Jl,e),_e(li,e)),ds.current===e&&(_e(ds,e),Ki._currentValue=ou)}o(Ge,"popHostContext");function ba(){}o(ba,"disabledLog");function iu(){if(ai===0){Tg=console.log,Ag=console.info,Dg=console.warn,Rg=console.error,Og=console.group,zg=console.groupCollapsed,Cg=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ba,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}ai++}o(iu,"disableLogs");function yo(){if(ai--,ai===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:F({},e,{value:Tg}),info:F({},e,{value:Ag}),warn:F({},e,{value:Dg}),error:F({},e,{value:Rg}),group:F({},e,{value:Og}),groupCollapsed:F({},e,{value:zg}),groupEnd:F({},e,{value:Cg})})}0>ai&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}o(yo,"reenableLogs");function Sn(e){var t=Error.prepareStackTrace;if(Error.prepareStackTrace=void 0,e=e.stack,Error.prepareStackTrace=t,e.startsWith(`Error: react-stack-top-frame
|
|
1
|
+
import{a as dS,b as rp,c as gS,d as dp,e as vS,f as SS,k as bS}from"./chunk-LZWPCZLE.js";import"./chunk-ZPUO7FNI.js";import"./chunk-ITLLHEVG.js";import"./chunk-NNISYDNI.js";import"./chunk-5OIBXYZM.js";import"./chunk-UII66UVF.js";import"./chunk-7TJJXVSE.js";import"./chunk-SVR644RF.js";import{a as yS}from"./chunk-2K47A3P6.js";import"./chunk-KEGAWN6Y.js";import"./chunk-KZ6INM5M.js";import"./chunk-4QHKBC77.js";import{R as pS}from"./chunk-BHTPZS7L.js";import{c as mS}from"./chunk-YQQJ4N6U.js";import"./chunk-TICVNLPM.js";import{a as ST}from"./chunk-HV7G6DFP.js";import"./chunk-AQGOX5DK.js";import"./chunk-TAD43CG5.js";import"./chunk-FCR3HKFV.js";import"./chunk-SEU5V7I6.js";import"./chunk-O4PXDNR3.js";import"./chunk-ZH7UES4T.js";import{a as sS,e as rS}from"./chunk-KODWGUAB.js";import"./chunk-3OA7PECS.js";import{a as hS,d as fp}from"./chunk-YJGANMU7.js";import{a as o,c as gf,e as Wi,f as cS,g as bT,h as fS,j as sp}from"./chunk-RRCPZMC2.js";var ES=gf(Ye=>{"use strict";(function(){function ge(){if(ot=!1,K){var z=Ye.unstable_now();De=z;var j=!0;try{e:{he=!1,Ue&&(Ue=!1,pt(Ke),Ke=-1),oe=!0;var q=V;try{t:{for(se(z),I=J(L);I!==null&&!(I.expirationTime>z&&A());){var xe=I.callback;if(typeof xe=="function"){I.callback=null,V=I.priorityLevel;var Ge=xe(I.expirationTime<=z);if(z=Ye.unstable_now(),typeof Ge=="function"){I.callback=Ge,se(z),j=!0;break t}I===J(L)&&G(L),se(z)}else G(L);I=J(L)}if(I!==null)j=!0;else{var ba=J(de);ba!==null&&ce(ae,ba.startTime-z),j=!1}}break e}finally{I=null,V=q,oe=!1}j=void 0}}finally{j?_e():K=!1}}}o(ge,"performWorkUntilDeadline");function r(z,j){var q=z.length;z.push(j);e:for(;0<q;){var xe=q-1>>>1,Ge=z[xe];if(0<ee(Ge,j))z[xe]=j,z[q]=Ge,q=xe;else break e}}o(r,"push");function J(z){return z.length===0?null:z[0]}o(J,"peek");function G(z){if(z.length===0)return null;var j=z[0],q=z.pop();if(q!==j){z[0]=q;e:for(var xe=0,Ge=z.length,ba=Ge>>>1;xe<ba;){var iu=2*(xe+1)-1,yo=z[iu],Sn=iu+1,it=z[Sn];if(0>ee(yo,q))Sn<Ge&&0>ee(it,yo)?(z[xe]=it,z[Sn]=q,xe=Sn):(z[xe]=yo,z[iu]=q,xe=iu);else if(Sn<Ge&&0>ee(it,q))z[xe]=it,z[Sn]=q,xe=Sn;else break e}}return j}o(G,"pop");function ee(z,j){var q=z.sortIndex-j.sortIndex;return q!==0?q:z.id-j.id}o(ee,"compare");function se(z){for(var j=J(de);j!==null;){if(j.callback===null)G(de);else if(j.startTime<=z)G(de),j.sortIndex=j.expirationTime,r(L,j);else break;j=J(de)}}o(se,"advanceTimers");function ae(z){if(Ue=!1,se(z),!he)if(J(L)!==null)he=!0,K||(K=!0,_e());else{var j=J(de);j!==null&&ce(ae,j.startTime-z)}}o(ae,"handleTimeout");function A(){return ot?!0:!(Ye.unstable_now()-De<U)}o(A,"shouldYieldToHost");function ce(z,j){Ke=Gt(function(){z(Ye.unstable_now())},j)}if(o(ce,"requestHostTimeout"),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()),Ye.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var Be=performance;Ye.unstable_now=function(){return Be.now()}}else{var Ze=Date,ue=Ze.now();Ye.unstable_now=function(){return Ze.now()-ue}}var L=[],de=[],Ae=1,I=null,V=3,oe=!1,he=!1,Ue=!1,ot=!1,Gt=typeof setTimeout=="function"?setTimeout:null,pt=typeof clearTimeout=="function"?clearTimeout:null,bt=typeof setImmediate<"u"?setImmediate:null,K=!1,Ke=-1,U=5,De=-1;if(typeof bt=="function")var _e=o(function(){bt(ge)},"schedulePerformWorkUntilDeadline");else if(typeof MessageChannel<"u"){var pe=new MessageChannel,ul=pe.port2;pe.port1.onmessage=ge,_e=o(function(){ul.postMessage(null)},"schedulePerformWorkUntilDeadline")}else _e=o(function(){Gt(ge,0)},"schedulePerformWorkUntilDeadline");Ye.unstable_IdlePriority=5,Ye.unstable_ImmediatePriority=1,Ye.unstable_LowPriority=4,Ye.unstable_NormalPriority=3,Ye.unstable_Profiling=null,Ye.unstable_UserBlockingPriority=2,Ye.unstable_cancelCallback=function(z){z.callback=null},Ye.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<z?Math.floor(1e3/z):5},Ye.unstable_getCurrentPriorityLevel=function(){return V},Ye.unstable_next=function(z){switch(V){case 1:case 2:case 3:var j=3;break;default:j=V}var q=V;V=j;try{return z()}finally{V=q}},Ye.unstable_requestPaint=function(){ot=!0},Ye.unstable_runWithPriority=function(z,j){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var q=V;V=z;try{return j()}finally{V=q}},Ye.unstable_scheduleCallback=function(z,j,q){var xe=Ye.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?xe+q:xe):q=xe,z){case 1:var Ge=-1;break;case 2:Ge=250;break;case 5:Ge=1073741823;break;case 4:Ge=1e4;break;default:Ge=5e3}return Ge=q+Ge,z={id:Ae++,callback:j,priorityLevel:z,startTime:q,expirationTime:Ge,sortIndex:-1},q>xe?(z.sortIndex=q,r(de,z),J(L)===null&&z===J(de)&&(Ue?(pt(Ke),Ke=-1):Ue=!0,ce(ae,q-xe))):(z.sortIndex=Ge,r(L,z),he||oe||(he=!0,K||(K=!0,_e()))),z},Ye.unstable_shouldYield=A,Ye.unstable_wrapCallback=function(z){var j=V;return function(){var q=V;V=j;try{return z.apply(this,arguments)}finally{V=q}}},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var AS=gf((UT,TS)=>{"use strict";TS.exports=ES()});var DS=gf(vf=>{"use strict";(function(){function ge(e,t){for(e=e.memoizedState;e!==null&&0<t;)e=e.next,t--;return e}o(ge,"findHook");function r(e,t,n,l){if(n>=t.length)return l;var a=t[n],u=lt(e)?e.slice():F({},e);return u[a]=r(e[a],t,n+1,l),u}o(r,"copyWithSetImpl");function J(e,t,n){if(t.length!==n.length)console.warn("copyWithRename() expects paths of the same length");else{for(var l=0;l<n.length-1;l++)if(t[l]!==n[l]){console.warn("copyWithRename() expects paths to be the same except for the deepest key");return}return G(e,t,n,0)}}o(J,"copyWithRename");function G(e,t,n,l){var a=t[l],u=lt(e)?e.slice():F({},e);return l+1===t.length?(u[n[l]]=u[a],lt(u)?u.splice(a,1):delete u[a]):u[a]=G(e[a],t,n,l+1),u}o(G,"copyWithRenameImpl");function ee(e,t,n){var l=t[n],a=lt(e)?e.slice():F({},e);return n+1===t.length?(lt(a)?a.splice(l,1):delete a[l],a):(a[l]=ee(e[l],t,n+1),a)}o(ee,"copyWithDeleteImpl");function se(){return!1}o(se,"shouldSuspendImpl");function ae(){return null}o(ae,"shouldErrorImpl");function A(){console.error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://react.dev/link/rules-of-hooks")}o(A,"warnInvalidHookAccess");function ce(){console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")}o(ce,"warnInvalidContextAccess");function Be(){}o(Be,"noop");function Ze(){}o(Ze,"warnForMissingKey");function ue(e){var t=[];return e.forEach(function(n){t.push(n)}),t.sort().join(", ")}o(ue,"setToSortedString");function L(e,t,n,l){return new ib(e,t,n,l)}o(L,"createFiber");function de(e,t){e.context===Pl&&(Cd(e.current,2,t,e,null,null),Du())}o(de,"scheduleRoot");function Ae(e,t){if(sn!==null){var n=t.staleFamilies;t=t.updatedFamilies,Jo(),pm(e.current,t,n),Du()}}o(Ae,"scheduleRefresh");function I(e){sn=e}o(I,"setRefreshHandler");function V(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}o(V,"isValidContainer");function oe(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}o(oe,"getNearestMountedFiber");function he(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}o(he,"getSuspenseInstanceFromFiber");function Ue(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}o(Ue,"getActivityInstanceFromFiber");function ot(e){if(oe(e)!==e)throw Error("Unable to find node on an unmounted component.")}o(ot,"assertIsMounted");function Gt(e){var t=e.alternate;if(!t){if(t=oe(e),t===null)throw Error("Unable to find node on an unmounted component.");return t!==e?null:e}for(var n=e,l=t;;){var a=n.return;if(a===null)break;var u=a.alternate;if(u===null){if(l=a.return,l!==null){n=l;continue}break}if(a.child===u.child){for(u=a.child;u;){if(u===n)return ot(a),e;if(u===l)return ot(a),t;u=u.sibling}throw Error("Unable to find node on an unmounted component.")}if(n.return!==l.return)n=a,l=u;else{for(var i=!1,c=a.child;c;){if(c===n){i=!0,n=a,l=u;break}if(c===l){i=!0,l=a,n=u;break}c=c.sibling}if(!i){for(c=u.child;c;){if(c===n){i=!0,n=u,l=a;break}if(c===l){i=!0,l=u,n=a;break}c=c.sibling}if(!i)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(n.alternate!==l)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(n.tag!==3)throw Error("Unable to find node on an unmounted component.");return n.stateNode.current===n?e:t}o(Gt,"findCurrentFiberUsingSlowPath");function pt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=pt(e),t!==null)return t;e=e.sibling}return null}o(pt,"findCurrentHostFiberImpl");function bt(e){return e===null||typeof e!="object"?null:(e=Eg&&e[Eg]||e["@@iterator"],typeof e=="function"?e:null)}o(bt,"getIteratorFn");function K(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===M2?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case _u:return"Fragment";case Bd:return"Profiler";case fs:return"StrictMode";case qd:return"Suspense";case jd:return"SuspenseList";case Yd:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case Uu:return"Portal";case Kn:return e.displayName||"Context";case Nd:return(e._context.displayName||"Context")+".Consumer";case ni:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case rs:return t=e.displayName||null,t!==null?t:K(e.type)||"Memo";case kt:t=e._payload,e=e._init;try{return K(e(t))}catch{}}return null}o(K,"getComponentNameFromType");function Ke(e){return typeof e.tag=="number"?U(e):typeof e.name=="string"?e.name:null}o(Ke,"getComponentNameFromOwner");function U(e){var t=e.type;switch(e.tag){case 31:return"Activity";case 24:return"Cache";case 9:return(t._context.displayName||"Context")+".Consumer";case 10:return t.displayName||"Context";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 26:case 27:case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return K(t);case 8:return t===fs?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;break;case 29:if(t=e._debugInfo,t!=null){for(var n=t.length-1;0<=n;n--)if(typeof t[n].name=="string")return t[n].name}if(e.return!==null)return U(e.return)}return null}o(U,"getComponentNameFromFiber");function De(e){return{current:e}}o(De,"createCursor");function _e(e,t){0>ml?console.error("Unexpected pop."):(t!==Ld[ml]&&console.error("Unexpected Fiber popped."),e.current=Gd[ml],Gd[ml]=null,Ld[ml]=null,ml--)}o(_e,"pop");function pe(e,t,n){ml++,Gd[ml]=e.current,Ld[ml]=n,e.current=t}o(pe,"push");function ul(e){return e===null&&console.error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."),e}o(ul,"requiredContext");function z(e,t){pe($l,t,e),pe(li,e,e),pe(Jl,null,e);var n=t.nodeType;switch(n){case 9:case 11:n=n===9?"#document":"#fragment",t=(t=t.documentElement)&&(t=t.namespaceURI)?Zy(t):Ml;break;default:if(n=t.tagName,t=t.namespaceURI)t=Zy(t),t=Jy(t,n);else switch(n){case"svg":t=ro;break;case"math":t=ff;break;default:t=Ml}}n=n.toLowerCase(),n=Yp(null,n),n={context:t,ancestorInfo:n},_e(Jl,e),pe(Jl,n,e)}o(z,"pushHostContainer");function j(e){_e(Jl,e),_e(li,e),_e($l,e)}o(j,"popHostContainer");function q(){return ul(Jl.current)}o(q,"getHostContext");function xe(e){e.memoizedState!==null&&pe(ds,e,e);var t=ul(Jl.current),n=e.type,l=Jy(t.context,n);n=Yp(t.ancestorInfo,n),l={context:l,ancestorInfo:n},t!==l&&(pe(li,e,e),pe(Jl,l,e))}o(xe,"pushHostContext");function Ge(e){li.current===e&&(_e(Jl,e),_e(li,e)),ds.current===e&&(_e(ds,e),Ki._currentValue=ou)}o(Ge,"popHostContext");function ba(){}o(ba,"disabledLog");function iu(){if(ai===0){Tg=console.log,Ag=console.info,Dg=console.warn,Rg=console.error,Og=console.group,zg=console.groupCollapsed,Cg=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ba,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}ai++}o(iu,"disableLogs");function yo(){if(ai--,ai===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:F({},e,{value:Tg}),info:F({},e,{value:Ag}),warn:F({},e,{value:Dg}),error:F({},e,{value:Rg}),group:F({},e,{value:Og}),groupCollapsed:F({},e,{value:zg}),groupEnd:F({},e,{value:Cg})})}0>ai&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}o(yo,"reenableLogs");function Sn(e){var t=Error.prepareStackTrace;if(Error.prepareStackTrace=void 0,e=e.stack,Error.prepareStackTrace=t,e.startsWith(`Error: react-stack-top-frame
|
|
2
2
|
`)&&(e=e.slice(29)),t=e.indexOf(`
|
|
3
3
|
`),t!==-1&&(e=e.slice(t+1)),t=e.indexOf("react_stack_bottom_frame"),t!==-1&&(t=e.lastIndexOf(`
|
|
4
4
|
`,t)),t!==-1)e=e.slice(0,t);else return"";return e}o(Sn,"formatOwnerStack");function it(e){if(Vd===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Vd=t&&t[1]||"",Mg=-1<n.stack.indexOf(`
|