diff --git a/internal/webapp/frontend/src/apps/Browser.tsx b/internal/webapp/frontend/src/apps/Browser.tsx
index 3315eee..5365e96 100644
--- a/internal/webapp/frontend/src/apps/Browser.tsx
+++ b/internal/webapp/frontend/src/apps/Browser.tsx
@@ -6,6 +6,7 @@ import {
type ReactNode,
} from "react";
import { useQueryClient } from "@tanstack/react-query";
+import { Button } from "@/components/ui/button";
import type { Project, ServerConfig } from "../api/types";
import { useHeat, useTree } from "../hooks/useBrowse";
import { urlForPath, urlForView, type Route } from "../router";
@@ -355,14 +356,14 @@ export default function Browser(props: {
actions={
<>
{canShare && (
-
)}
{canHistory && !path && !route.view && (
-
Create a shared space for your team's files.
{m.message}
V&&(C=V)}if(p){var D,Y;const K=E==="y"?"width":"height",q=ob.has(Va(d)),V=v.reference[T]-v.floating[K]+(q&&((D=g.offset)==null?void 0:D[T])||0)+(q?0:z.crossAxis),B=v.reference[T]+v.reference[K]+(q?0:((Y=g.offset)==null?void 0:Y[T])||0)-(q?z.crossAxis:0);RB&&(R=B)}return{[E]:C,[T]:R}}}},IC=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(l){const{placement:i,rects:o,platform:c,elements:f}=l,{apply:d=()=>{},...v}=ca(n,l),g=await c.detectOverflow(l,v),m=Va(i),x=zr(i),p=Un(i)==="y",{width:S,height:T}=o.floating;let E,C;m==="top"||m==="bottom"?(E=m,C=x===(await(c.isRTL==null?void 0:c.isRTL(f.floating))?"start":"end")?"left":"right"):(C=m,E=x==="end"?"top":"bottom");const R=T-g.top-g.bottom,M=S-g.left-g.right,z=Ga(T-g[E],R),D=Ga(S-g[C],M),Y=l.middlewareData.shift,K=!Y;let q=z,V=D;Y!=null&&Y.enabled.x&&(V=M),Y!=null&&Y.enabled.y&&(q=R),K&&!x&&(p?V=S-2*oa(g.left,g.right):q=T-2*oa(g.top,g.bottom)),await d({...l,availableWidth:V,availableHeight:q});const B=await c.getDimensions(f.floating);return S!==B.width||T!==B.height?{reset:{rects:!0}}:{}}}};function Js(){return typeof window<"u"}function kr(n){return sb(n)?(n.nodeName||"").toLowerCase():"#document"}function Xt(n){var l;return(n==null||(l=n.ownerDocument)==null?void 0:l.defaultView)||window}function ua(n){var l;return(l=(sb(n)?n.ownerDocument:n.document)||window.document)==null?void 0:l.documentElement}function sb(n){return Js()?n instanceof Node||n instanceof Xt(n).Node:!1}function Bn(n){return Js()?n instanceof Element||n instanceof Xt(n).Element:!1}function Pa(n){return Js()?n instanceof HTMLElement||n instanceof Xt(n).HTMLElement:!1}function Xg(n){return!Js()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof Xt(n).ShadowRoot}function Ws(n){const{overflow:l,overflowX:i,overflowY:o,display:c}=qn(n);return/auto|scroll|overlay|hidden|clip/.test(l+o+i)&&c!=="inline"&&c!=="contents"}function QC(n){return/^(table|td|th)$/.test(kr(n))}function ec(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const PC=/transform|translate|scale|rotate|perspective|filter/,KC=/paint|layout|strict|content/,bl=n=>!!n&&n!=="none";let qf;function Id(n){const l=Bn(n)?qn(n):n;return bl(l.transform)||bl(l.translate)||bl(l.scale)||bl(l.rotate)||bl(l.perspective)||!Qd()&&(bl(l.backdropFilter)||bl(l.filter))||PC.test(l.willChange||"")||KC.test(l.contain||"")}function FC(n){let l=wl(n);for(;Pa(l)&&!qi(l);){if(Id(l))return l;if(ec(l))return null;l=wl(l)}return null}function Qd(){return qf==null&&(qf=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),qf}function qi(n){return/^(html|body|#document)$/.test(kr(n))}function qn(n){return Xt(n).getComputedStyle(n)}function tc(n){return Bn(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function wl(n){if(kr(n)==="html")return n;const l=n.assignedSlot||n.parentNode||Xg(n)&&n.host||ua(n);return Xg(l)?l.host:l}function cb(n){const l=wl(n);return qi(l)?(n.ownerDocument||n).body:Pa(l)&&Ws(l)?l:cb(l)}function Gi(n,l,i){var o;l===void 0&&(l=[]),i===void 0&&(i=!0);const c=cb(n),f=c===((o=n.ownerDocument)==null?void 0:o.body),d=Xt(c);if(f){const v=ud(d);return l.concat(d,d.visualViewport||[],Ws(c)?c:[],v&&i?Gi(v):[])}else return l.concat(c,Gi(c,[],i))}function ud(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function ub(n){const l=qn(n);let i=parseFloat(l.width)||0,o=parseFloat(l.height)||0;const c=Pa(n),f=c?n.offsetWidth:i,d=c?n.offsetHeight:o,v=Bs(i)!==f||Bs(o)!==d;return v&&(i=f,o=d),{width:i,height:o,$:v}}function Pd(n){return Bn(n)?n:n.contextElement}function Rr(n){const l=Pd(n);if(!Pa(l))return sa(1);const i=l.getBoundingClientRect(),{width:o,height:c,$:f}=ub(l);let d=(f?Bs(i.width):i.width)/o,v=(f?Bs(i.height):i.height)/c;return(!d||!Number.isFinite(d))&&(d=1),(!v||!Number.isFinite(v))&&(v=1),{x:d,y:v}}const XC=sa(0);function fb(n){const l=Xt(n);return!Qd()||!l.visualViewport?XC:{x:l.visualViewport.offsetLeft,y:l.visualViewport.offsetTop}}function ZC(n,l,i){return l===void 0&&(l=!1),!!i&&l&&i===Xt(n)}function El(n,l,i,o){l===void 0&&(l=!1),i===void 0&&(i=!1);const c=n.getBoundingClientRect(),f=Pd(n);let d=sa(1);l&&(o?Bn(o)&&(d=Rr(o)):d=Rr(n));const v=ZC(f,i,o)?fb(f):sa(0);let g=(c.left+v.x)/d.x,m=(c.top+v.y)/d.y,x=c.width/d.x,p=c.height/d.y;if(f&&o){const S=Xt(f),T=Bn(o)?Xt(o):o;let E=S,C=ud(E);for(;C&&T!==E;){const R=Rr(C),M=C.getBoundingClientRect(),z=qn(C),D=M.left+(C.clientLeft+parseFloat(z.paddingLeft))*R.x,Y=M.top+(C.clientTop+parseFloat(z.paddingTop))*R.y;g*=R.x,m*=R.y,x*=R.x,p*=R.y,g+=D,m+=Y,E=Xt(C),C=ud(E)}}return Gs({width:x,height:p,x:g,y:m})}function nc(n,l){const i=tc(n).scrollLeft;return l?l.left+i:El(ua(n)).left+i}function db(n,l){const i=n.getBoundingClientRect(),o=i.left+l.scrollLeft-nc(n,i),c=i.top+l.scrollTop;return{x:o,y:c}}function $C(n){let{elements:l,rect:i,offsetParent:o,strategy:c}=n;const f=c==="fixed",d=ua(o),v=l?ec(l.floating):!1;if(o===d||v&&f)return i;let g={scrollLeft:0,scrollTop:0},m=sa(1);const x=sa(0),p=Pa(o);if((p||!f)&&((kr(o)!=="body"||Ws(d))&&(g=tc(o)),p)){const T=El(o);m=Rr(o),x.x=T.x+o.clientLeft,x.y=T.y+o.clientTop}const S=d&&!p&&!f?db(d,g):sa(0);return{width:i.width*m.x,height:i.height*m.y,x:i.x*m.x-g.scrollLeft*m.x+x.x+S.x,y:i.y*m.y-g.scrollTop*m.y+x.y+S.y}}function JC(n){return n.getClientRects?Array.from(n.getClientRects()):[]}function WC(n){const l=tc(n),i=n.ownerDocument.body,o=oa(n.scrollWidth,n.clientWidth,i.scrollWidth,i.clientWidth),c=oa(n.scrollHeight,n.clientHeight,i.scrollHeight,i.clientHeight);let f=-l.scrollLeft+nc(n);const d=-l.scrollTop;return qn(i).direction==="rtl"&&(f+=oa(n.clientWidth,i.clientWidth)-o),{width:o,height:c,x:f,y:d}}const e2=25;function t2(n,l,i){i===void 0&&(i="viewport");const o=i==="layoutViewport",c=Xt(n),f=ua(n),d=c.visualViewport;let v=f.clientWidth,g=f.clientHeight,m=0,x=0;if(d){const S=!Qd()||l==="fixed";o?S||(m=-d.offsetLeft,x=-d.offsetTop):(v=d.width,g=d.height,S&&(m=d.offsetLeft,x=d.offsetTop))}if(nc(f)<=0){const S=f.ownerDocument,T=S.body,E=getComputedStyle(T),C=S.compatMode==="CSS1Compat"&&parseFloat(E.marginLeft)+parseFloat(E.marginRight)||0,R=Math.abs(f.clientWidth-T.clientWidth-C),M=getComputedStyle(f).scrollbarGutter==="stable both-edges"?R/2:R;M<=e2&&(v-=M)}return{width:v,height:g,x:m,y:x}}function n2(n,l){const i=El(n,!0,l==="fixed"),o=i.top+n.clientTop,c=i.left+n.clientLeft,f=Rr(n),d=n.clientWidth*f.x,v=n.clientHeight*f.y,g=c*f.x,m=o*f.y;return{width:d,height:v,x:g,y:m}}function Zg(n,l,i){let o;if(l==="viewport"||l==="layoutViewport")o=t2(n,i,l);else if(l==="document")o=WC(ua(n));else if(Bn(l))o=n2(l,i);else{const c=fb(n);o={x:l.x-c.x,y:l.y-c.y,width:l.width,height:l.height}}return Gs(o)}function a2(n,l){const i=l.get(n);if(i)return i;let o=Gi(n,[],!1).filter(v=>Bn(v)&&kr(v)!=="body"),c=null;const f=qn(n).position==="fixed";let d=f?wl(n):n;for(;Bn(d)&&!qi(d);){const v=qn(d),g=Id(d),m=c?c.position:f?"fixed":"";!g&&(m==="fixed"||m==="absolute"&&v.position==="static")?o=o.filter(p=>p!==d):c=v,d=wl(d)}return l.set(n,o),o}function l2(n){let{element:l,boundary:i,rootBoundary:o,strategy:c}=n;const d=[...i==="clippingAncestors"?ec(l)?[]:a2(l,this._c):[].concat(i),o],v=Zg(l,d[0],c);let g=v.top,m=v.right,x=v.bottom,p=v.left;for(let S=1;S {v(!1,1e-7)},1e3)}V=!1}try{o=new IntersectionObserver(B,{...q,root:f.ownerDocument})}catch{o=new IntersectionObserver(B,q)}o.observe(n)}const g=Xt(n),m=()=>v(i);return g.addEventListener("resize",m),v(!0),()=>{g.removeEventListener("resize",m),d()}}function f2(n,l,i,o){o===void 0&&(o={});const{ancestorScroll:c=!0,ancestorResize:f=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:v=typeof IntersectionObserver=="function",animationFrame:g=!1}=o,m=Pd(n),x=c||f?[...m?Gi(m):[],...l?Gi(l):[]]:[];x.forEach(M=>{c&&M.addEventListener("scroll",i),f&&M.addEventListener("resize",i)});const p=m&&v?u2(m,i,f):null;let S=-1,T=null;d&&(T=new ResizeObserver(M=>{let[z]=M;z&&z.target===m&&T&&l&&(T.unobserve(l),cancelAnimationFrame(S),S=requestAnimationFrame(()=>{var D;(D=T)==null||D.observe(l)})),i()}),m&&!g&&T.observe(m),l&&T.observe(l));let E,C=g?El(n):null;g&&R();function R(){const M=El(n);C&&!mb(C,M)&&i(),C=M,E=requestAnimationFrame(R)}return i(),()=>{var M;x.forEach(z=>{c&&z.removeEventListener("scroll",i),f&&z.removeEventListener("resize",i)}),p?.(),(M=T)==null||M.disconnect(),T=null,g&&cancelAnimationFrame(E)}}const d2=GC,h2=VC,m2=UC,p2=IC,v2=BC,Jg=HC,g2=YC,y2=(n,l,i)=>{const o=new Map,c=i??{},f={...c2,...c.platform,_c:o};return LC(n,l,{...c,platform:f})};var b2=typeof document<"u",x2=function(){},zs=b2?y.useLayoutEffect:x2;function Vs(n,l){if(n===l)return!0;if(typeof n!=typeof l)return!1;if(typeof n=="function"&&n.toString()===l.toString())return!0;let i,o,c;if(n&&l&&typeof n=="object"){if(Array.isArray(n)){if(i=n.length,i!==l.length)return!1;for(o=i;o--!==0;)if(!Vs(n[o],l[o]))return!1;return!0}if(c=Object.keys(n),i=c.length,i!==Object.keys(l).length)return!1;for(o=i;o--!==0;)if(!{}.hasOwnProperty.call(l,c[o]))return!1;for(o=i;o--!==0;){const f=c[o];if(!(f==="_owner"&&n.$$typeof)&&!Vs(n[f],l[f]))return!1}return!0}return n!==n&&l!==l}function pb(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Wg(n,l){const i=pb(n);return Math.round(l*i)/i}function Vf(n){const l=y.useRef(n);return zs(()=>{l.current=n}),l}function S2(n){n===void 0&&(n={});const{placement:l="bottom",strategy:i="absolute",middleware:o=[],platform:c,elements:{reference:f,floating:d}={},transform:v=!0,whileElementsMounted:g,open:m}=n,[x,p]=y.useState({x:0,y:0,strategy:i,placement:l,middlewareData:{},isPositioned:!1}),[S,T]=y.useState(o);Vs(S,o)||T(o);const[E,C]=y.useState(null),[R,M]=y.useState(null),z=y.useCallback(W=>{W!==q.current&&(q.current=W,C(W))},[]),D=y.useCallback(W=>{W!==V.current&&(V.current=W,M(W))},[]),Y=f||E,K=d||R,q=y.useRef(null),V=y.useRef(null),B=y.useRef(x),oe=g!=null,se=Vf(g),le=Vf(c),ce=Vf(m),ue=y.useCallback(()=>{if(!q.current||!V.current)return;const W={placement:l,strategy:i,middleware:S};le.current&&(W.platform=le.current),y2(q.current,V.current,W).then(ee=>{const $={...ee,isPositioned:ce.current!==!1};ve.current&&!Vs(B.current,$)&&(B.current=$,Dr.flushSync(()=>{p($)}))})},[S,l,i,le,ce]);zs(()=>{m===!1&&B.current.isPositioned&&(B.current.isPositioned=!1,p(W=>({...W,isPositioned:!1})))},[m]);const ve=y.useRef(!1);zs(()=>(ve.current=!0,()=>{ve.current=!1}),[]),zs(()=>{if(Y&&(q.current=Y),K&&(V.current=K),Y&&K){if(se.current)return se.current(Y,K,ue);ue()}},[Y,K,ue,se,oe]);const fe=y.useMemo(()=>({reference:q,floating:V,setReference:z,setFloating:D}),[z,D]),O=y.useMemo(()=>({reference:Y,floating:K}),[Y,K]),F=y.useMemo(()=>{const W={position:i,left:0,top:0};if(!O.floating)return W;const ee=Wg(O.floating,x.x),$=Wg(O.floating,x.y);return v?{...W,transform:"translate("+ee+"px, "+$+"px)",...pb(O.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:ee,top:$}},[i,v,O.floating,x.x,x.y]);return y.useMemo(()=>({...x,update:ue,refs:fe,elements:O,floatingStyles:F}),[x,ue,fe,O,F])}const w2=n=>{function l(i){return{}.hasOwnProperty.call(i,"current")}return{name:"arrow",options:n,fn(i){const{element:o,padding:c}=typeof n=="function"?n(i):n;return o&&l(o)?o.current!=null?Jg({element:o.current,padding:c}).fn(i):{}:o?Jg({element:o,padding:c}).fn(i):{}}}},E2=(n,l)=>{const i=d2(n);return{name:i.name,fn:i.fn,options:[n,l]}},C2=(n,l)=>{const i=h2(n);return{name:i.name,fn:i.fn,options:[n,l]}},T2=(n,l)=>({fn:g2(n).fn,options:[n,l]}),R2=(n,l)=>{const i=m2(n);return{name:i.name,fn:i.fn,options:[n,l]}},M2=(n,l)=>{const i=p2(n);return{name:i.name,fn:i.fn,options:[n,l]}},j2=(n,l)=>{const i=v2(n);return{name:i.name,fn:i.fn,options:[n,l]}},A2=(n,l)=>{const i=w2(n);return{name:i.name,fn:i.fn,options:[n,l]}};var N2="Arrow",vb=y.forwardRef((n,l)=>{const{children:i,width:o=10,height:c=5,...f}=n;return h.jsx(Ce.svg,{...f,ref:l,width:o,height:c,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:n.asChild?i:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});vb.displayName=N2;var O2=vb,Kd="Popper",[gb,Lr]=Qa(Kd),[_2,yb]=gb(Kd),bb=n=>{const{__scopePopper:l,children:i}=n,[o,c]=y.useState(null),[f,d]=y.useState(void 0);return h.jsx(_2,{scope:l,anchor:o,onAnchorChange:c,placementState:f,setPlacementState:d,children:i})};bb.displayName=Kd;var xb="PopperAnchor",Sb=y.forwardRef((n,l)=>{const{__scopePopper:i,virtualRef:o,...c}=n,f=yb(xb,i),d=y.useRef(null),v=f.onAnchorChange,g=y.useCallback(E=>{d.current=E,E&&v(E)},[v]),m=Ye(l,g),x=y.useRef(null);y.useEffect(()=>{if(!o)return;const E=x.current;x.current=o.current,E!==x.current&&v(x.current)});const p=f.placementState&&Xd(f.placementState),S=p?.[0],T=p?.[1];return o?null:h.jsx(Ce.div,{"data-radix-popper-side":S,"data-radix-popper-align":T,...c,ref:m})});Sb.displayName=xb;var Fd="PopperContent",[D2,z2]=gb(Fd),wb=y.forwardRef((n,l)=>{const{__scopePopper:i,side:o="bottom",sideOffset:c=0,align:f="center",alignOffset:d=0,arrowPadding:v=0,avoidCollisions:g=!0,collisionBoundary:m=[],collisionPadding:x=0,sticky:p="partial",hideWhenDetached:S=!1,updatePositionStrategy:T="optimized",onPlaced:E,...C}=n,R=yb(Fd,i),[M,z]=y.useState(null),D=Ye(l,z),[Y,K]=y.useState(null),q=CC(Y),V=q?.width??0,B=q?.height??0,oe=o+(f!=="center"?"-"+f:""),se=typeof x=="number"?x:{top:0,right:0,bottom:0,left:0,...x},le=Array.isArray(m)?m:[m],ce=le.length>0,ue={padding:se,boundary:le.filter(L2),altBoundary:ce},{refs:ve,floatingStyles:fe,placement:O,isPositioned:F,middlewareData:W}=S2({strategy:"fixed",placement:oe,whileElementsMounted:(...ae)=>f2(...ae,{animationFrame:T==="always"}),elements:{reference:R.anchor},middleware:[E2({mainAxis:c+B,alignmentAxis:d}),g&&C2({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?T2():void 0,...ue}),g&&R2({...ue}),M2({...ue,apply:({elements:ae,rects:re,availableWidth:xe,availableHeight:Re})=>{const{width:je,height:et}=re.reference,Ge=ae.floating.style;Ge.setProperty("--radix-popper-available-width",`${xe}px`),Ge.setProperty("--radix-popper-available-height",`${Re}px`),Ge.setProperty("--radix-popper-anchor-width",`${je}px`),Ge.setProperty("--radix-popper-anchor-height",`${et}px`)}}),Y&&A2({element:Y,padding:v}),H2({arrowWidth:V,arrowHeight:B}),S&&j2({strategy:"referenceHidden",...ue,boundary:ce?ue.boundary:void 0})]}),ee=R.setPlacementState;yt(()=>(ee(O),()=>{ee(void 0)}),[O,ee]);const[$,A]=Xd(O),j=bn(E);yt(()=>{F&&j?.()},[F,j]);const L=W.arrow?.x,Q=W.arrow?.y,I=W.arrow?.centerOffset!==0,[te,Z]=y.useState();return yt(()=>{M&&Z(window.getComputedStyle(M).zIndex)},[M]),h.jsx("div",{ref:ve.setFloating,"data-radix-popper-content-wrapper":"",style:{...fe,transform:F?fe.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:te,"--radix-popper-transform-origin":[W.transformOrigin?.x,W.transformOrigin?.y].join(" "),...W.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:h.jsx(D2,{scope:i,placedSide:$,placedAlign:A,onArrowChange:K,arrowX:L,arrowY:Q,shouldHideArrow:I,children:h.jsx(Ce.div,{"data-side":$,"data-align":A,...C,ref:D,style:{...C.style,animation:F?void 0:"none"}})})})});wb.displayName=Fd;var Eb="PopperArrow",k2={top:"bottom",right:"left",bottom:"top",left:"right"},Cb=y.forwardRef(function(l,i){const{__scopePopper:o,...c}=l,f=z2(Eb,o),d=k2[f.placedSide];return h.jsx("span",{ref:f.onArrowChange,style:{position:"absolute",left:f.arrowX,top:f.arrowY,[d]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[f.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[f.placedSide],visibility:f.shouldHideArrow?"hidden":void 0},children:h.jsx(O2,{...c,ref:i,style:{...c.style,display:"block"}})})});Cb.displayName=Eb;function L2(n){return n!==null}var H2=n=>({name:"transformOrigin",options:n,fn(l){const{placement:i,rects:o,middlewareData:c}=l,d=c.arrow?.centerOffset!==0,v=d?0:n.arrowWidth,g=d?0:n.arrowHeight,[m,x]=Xd(i),p={start:"0%",center:"50%",end:"100%"}[x],S=(c.arrow?.x??0)+v/2,T=(c.arrow?.y??0)+g/2;let E="",C="";return m==="bottom"?(E=d?p:`${S}px`,C=`${-g}px`):m==="top"?(E=d?p:`${S}px`,C=`${o.floating.height+g}px`):m==="right"?(E=`${-g}px`,C=d?p:`${T}px`):m==="left"&&(E=`${o.floating.width+g}px`,C=d?p:`${T}px`),{data:{x:E,y:C}}}});function Xd(n){const[l,i="center"]=n.split("-");return[l,i]}var Zd=bb,$d=Sb,Jd=wb,Wd=Cb,Yf=!1;function U2(){const[n,l]=y.useState(Yf);return y.useEffect(()=>{Yf||(Yf=!0,l(!0))},[]),n}var Tb=Ks[" useSyncExternalStore ".trim().toString()];function B2(){return()=>{}}function q2(){return Tb(B2,()=>!0,()=>!1)}var G2=typeof Tb=="function"?q2:U2,If="rovingFocusGroup.onEntryFocus",V2={bubbles:!1,cancelable:!0},Wi="RovingFocusGroup",[fd,Rb,Y2]=Nd(Wi),[I2,Mb]=Qa(Wi,[Y2]),[Q2,P2]=I2(Wi),jb=y.forwardRef((n,l)=>h.jsx(fd.Provider,{scope:n.__scopeRovingFocusGroup,children:h.jsx(fd.Slot,{scope:n.__scopeRovingFocusGroup,children:h.jsx(K2,{...n,ref:l})})}));jb.displayName=Wi;var K2=y.forwardRef((n,l)=>{const{__scopeRovingFocusGroup:i,orientation:o,loop:c=!1,dir:f,currentTabStopId:d,defaultCurrentTabStopId:v,onCurrentTabStopIdChange:g,onEntryFocus:m,preventScrollOnEntryFocus:x=!1,...p}=n,S=y.useRef(null),T=Ye(l,S),E=Od(f),[C,R]=Nr({prop:d,defaultProp:v??null,onChange:g,caller:Wi}),[M,z]=y.useState(!1),D=bn(m),Y=Rb(i),K=y.useRef(!1),[q,V]=y.useState(0);return y.useEffect(()=>{const B=S.current;if(B)return B.addEventListener(If,D),()=>B.removeEventListener(If,D)},[D]),h.jsx(Q2,{scope:i,orientation:o,dir:E,loop:c,currentTabStopId:C,onItemFocus:y.useCallback(B=>R(B),[R]),onItemShiftTab:y.useCallback(()=>z(!0),[]),onFocusableItemAdd:y.useCallback(()=>V(B=>B+1),[]),onFocusableItemRemove:y.useCallback(()=>V(B=>B-1),[]),children:h.jsx(Ce.div,{tabIndex:M||q===0?-1:0,"data-orientation":o,...p,ref:T,style:{outline:"none",...n.style},onMouseDown:pe(n.onMouseDown,()=>{K.current=!0}),onFocus:pe(n.onFocus,B=>{const oe=!K.current;if(B.target===B.currentTarget&&oe&&!M){const se=new CustomEvent(If,V2);if(B.currentTarget.dispatchEvent(se),!se.defaultPrevented){const le=Y().filter(O=>O.focusable),ce=le.find(O=>O.active),ue=le.find(O=>O.id===C),fe=[ce,ue,...le].filter(Boolean).map(O=>O.ref.current);Ob(fe,x)}}K.current=!1}),onBlur:pe(n.onBlur,()=>z(!1))})})}),Ab="RovingFocusGroupItem",Nb=y.forwardRef((n,l)=>{const{__scopeRovingFocusGroup:i,focusable:o=!0,active:c=!1,tabStopId:f,children:d,...v}=n,g=Nt(),m=f||g,x=P2(Ab,i),p=x.currentTabStopId===m,S=Rb(i),{onFocusableItemAdd:T,onFocusableItemRemove:E,currentTabStopId:C}=x,R=G2();return yt(()=>{if(!(!R||!o))return T(),()=>E()},[R,o,T,E]),y.useEffect(()=>{if(!(R||!o))return T(),()=>E()},[R,o,T,E]),h.jsx(fd.ItemSlot,{scope:i,id:m,focusable:o,active:c,children:h.jsx(Ce.span,{tabIndex:p?0:-1,"data-orientation":x.orientation,...v,ref:l,onMouseDown:pe(n.onMouseDown,M=>{o?x.onItemFocus(m):M.preventDefault()}),onFocus:pe(n.onFocus,()=>x.onItemFocus(m)),onKeyDown:pe(n.onKeyDown,M=>{if(M.key==="Tab"&&M.shiftKey){x.onItemShiftTab();return}if(M.target!==M.currentTarget)return;const z=Z2(M,x.orientation,x.dir);if(z!==void 0){if(M.metaKey||M.ctrlKey||M.altKey||M.shiftKey)return;M.preventDefault();let Y=S().filter(K=>K.focusable).map(K=>K.ref.current);if(z==="last")Y.reverse();else if(z==="prev"||z==="next"){z==="prev"&&Y.reverse();const K=Y.indexOf(M.currentTarget);Y=x.loop?$2(Y,K+1):Y.slice(K+1)}setTimeout(()=>Ob(Y))}}),children:typeof d=="function"?d({isCurrentTabStop:p,hasTabStop:C!=null}):d})})});Nb.displayName=Ab;var F2={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function X2(n,l){return l!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}function Z2(n,l,i){const o=X2(n.key,i);if(!(l==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(l==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return F2[o]}function Ob(n,l=!1){const i=document.activeElement;for(const o of n)if(o===i||(o.focus({preventScroll:l}),document.activeElement!==i))return}function $2(n,l){return n.map((i,o)=>n[(l+o)%n.length])}var J2=jb,W2=Nb,dd=["Enter"," "],eT=["ArrowDown","PageUp","Home"],_b=["ArrowUp","PageDown","End"],tT=[...eT,..._b],nT={ltr:[...dd,"ArrowRight"],rtl:[...dd,"ArrowLeft"]},aT={ltr:["ArrowLeft"],rtl:["ArrowRight"]},eo="Menu",[Vi,lT,rT]=Nd(eo),[Rl,Db]=Qa(eo,[rT,Lr,Mb]),ac=Lr(),zb=Mb(),[iT,Ml]=Rl(eo),[oT,to]=Rl(eo),kb=n=>{const{__scopeMenu:l,open:i=!1,children:o,dir:c,onOpenChange:f,modal:d=!0}=n,v=ac(l),[g,m]=y.useState(null),x=y.useRef(!1),p=bn(f),S=Od(c);return y.useEffect(()=>{const T=()=>{x.current=!0,document.addEventListener("pointerdown",E,{capture:!0,once:!0}),document.addEventListener("pointermove",E,{capture:!0,once:!0})},E=()=>x.current=!1;return document.addEventListener("keydown",T,{capture:!0}),()=>{document.removeEventListener("keydown",T,{capture:!0}),document.removeEventListener("pointerdown",E,{capture:!0}),document.removeEventListener("pointermove",E,{capture:!0})}},[]),y.useEffect(()=>{if(!i)return;const T=()=>p(!1);return window.addEventListener("blur",T),()=>window.removeEventListener("blur",T)},[i,p]),h.jsx(Zd,{...v,children:h.jsx(iT,{scope:l,open:i,onOpenChange:p,content:g,onContentChange:m,children:h.jsx(oT,{scope:l,onClose:y.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:x,dir:S,modal:d,children:o})})})};kb.displayName=eo;var sT="MenuAnchor",eh=y.forwardRef((n,l)=>{const{__scopeMenu:i,...o}=n,c=ac(i);return h.jsx($d,{...c,...o,ref:l})});eh.displayName=sT;var th="MenuPortal",[cT,Lb]=Rl(th,{forceMount:void 0}),Hb=n=>{const{__scopeMenu:l,forceMount:i,children:o,container:c}=n,f=Ml(th,l);return h.jsx(cT,{scope:l,forceMount:i,children:h.jsx(Mn,{present:i||f.open,children:h.jsx(Ji,{asChild:!0,container:c,children:o})})})};Hb.displayName=th;var yn="MenuContent",[uT,nh]=Rl(yn),Ub=y.forwardRef((n,l)=>{const i=Lb(yn,n.__scopeMenu),{forceMount:o=i.forceMount,...c}=n,f=Ml(yn,n.__scopeMenu),d=to(yn,n.__scopeMenu);return h.jsx(Vi.Provider,{scope:n.__scopeMenu,children:h.jsx(Mn,{present:o||f.open,children:h.jsx(Vi.Slot,{scope:n.__scopeMenu,children:d.modal?h.jsx(fT,{...c,ref:l}):h.jsx(dT,{...c,ref:l})})})})}),fT=y.forwardRef((n,l)=>{const i=Ml(yn,n.__scopeMenu),o=y.useRef(null),c=Ye(l,o);return y.useEffect(()=>{const f=o.current;if(f)return zd(f)},[]),h.jsx(ah,{...n,ref:c,trapFocus:i.open,disableOutsidePointerEvents:i.open,disableOutsideScroll:!0,onFocusOutside:pe(n.onFocusOutside,f=>f.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>i.onOpenChange(!1)})}),dT=y.forwardRef((n,l)=>{const i=Ml(yn,n.__scopeMenu);return h.jsx(ah,{...n,ref:l,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>i.onOpenChange(!1)})}),hT=Ar("MenuContent.ScrollLock"),ah=y.forwardRef((n,l)=>{const{__scopeMenu:i,loop:o=!1,trapFocus:c,onOpenAutoFocus:f,onCloseAutoFocus:d,disableOutsidePointerEvents:v,onEntryFocus:g,onEscapeKeyDown:m,onPointerDownOutside:x,onFocusOutside:p,onInteractOutside:S,onDismiss:T,disableOutsideScroll:E,...C}=n,R=Ml(yn,i),M=to(yn,i),z=ac(i),D=zb(i),Y=lT(i),[K,q]=y.useState(null),V=y.useRef(null),B=Ye(l,V,R.onContentChange),oe=y.useRef(0),se=y.useRef(""),le=y.useRef(0),ce=y.useRef(null),ue=y.useRef("right"),ve=y.useRef(0),fe=E?Zs:y.Fragment,O=E?{as:hT,allowPinchZoom:!0}:void 0,F=ee=>{const $=se.current+ee,A=Y().filter(Z=>!Z.disabled),j=document.activeElement,L=A.find(Z=>Z.ref.current===j)?.textValue,Q=A.map(Z=>Z.textValue),I=TT(Q,$,L),te=A.find(Z=>Z.textValue===I)?.ref.current;(function Z(ae){se.current=ae,window.clearTimeout(oe.current),ae!==""&&(oe.current=window.setTimeout(()=>Z(""),1e3))})($),te&&setTimeout(()=>te.focus())};y.useEffect(()=>()=>window.clearTimeout(oe.current),[]),Dd();const W=y.useCallback(ee=>ue.current===ce.current?.side&&MT(ee,ce.current?.area),[]);return h.jsx(uT,{scope:i,searchRef:se,onItemEnter:y.useCallback(ee=>{W(ee)&&ee.preventDefault()},[W]),onItemLeave:y.useCallback(ee=>{W(ee)||(V.current?.focus(),q(null))},[W]),onTriggerLeave:y.useCallback(ee=>{W(ee)&&ee.preventDefault()},[W]),pointerGraceTimerRef:le,onPointerGraceIntentChange:y.useCallback(ee=>{ce.current=ee},[]),children:h.jsx(fe,{...O,children:h.jsx(Fs,{asChild:!0,trapped:c,onMountAutoFocus:pe(f,ee=>{ee.preventDefault(),V.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:d,children:h.jsx($i,{asChild:!0,disableOutsidePointerEvents:v,onEscapeKeyDown:m,onPointerDownOutside:x,onFocusOutside:p,onInteractOutside:S,onDismiss:T,children:h.jsx(J2,{asChild:!0,...D,dir:M.dir,orientation:"vertical",loop:o,currentTabStopId:K,onCurrentTabStopIdChange:q,onEntryFocus:pe(g,ee=>{M.isUsingKeyboardRef.current||ee.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(Jd,{role:"menu","aria-orientation":"vertical","data-state":e0(R.open),"data-radix-menu-content":"",dir:M.dir,...z,...C,ref:B,style:{outline:"none",...C.style},onKeyDown:pe(C.onKeyDown,ee=>{const A=ee.target.closest("[data-radix-menu-content]")===ee.currentTarget,j=ee.ctrlKey||ee.altKey||ee.metaKey,L=ee.key.length===1;A&&(ee.key==="Tab"&&ee.preventDefault(),!j&&L&&F(ee.key));const Q=V.current;if(ee.target!==Q||!tT.includes(ee.key))return;ee.preventDefault();const te=Y().filter(Z=>!Z.disabled).map(Z=>Z.ref.current);_b.includes(ee.key)&&te.reverse(),ET(te)}),onBlur:pe(n.onBlur,ee=>{ee.currentTarget.contains(ee.target)||(window.clearTimeout(oe.current),se.current="")}),onPointerMove:pe(n.onPointerMove,Yi(ee=>{const $=ee.target,A=ve.current!==ee.clientX;if(ee.currentTarget.contains($)&&A){const j=ee.clientX>ve.current?"right":"left";ue.current=j,ve.current=ee.clientX}}))})})})})})})});Ub.displayName=yn;var mT="MenuGroup",lh=y.forwardRef((n,l)=>{const{__scopeMenu:i,...o}=n;return h.jsx(Ce.div,{role:"group",...o,ref:l})});lh.displayName=mT;var pT="MenuLabel",Bb=y.forwardRef((n,l)=>{const{__scopeMenu:i,...o}=n;return h.jsx(Ce.div,{...o,ref:l})});Bb.displayName=pT;var Ys="MenuItem",ey="menu.itemSelect",lc=y.forwardRef((n,l)=>{const{disabled:i=!1,onSelect:o,...c}=n,f=y.useRef(null),d=to(Ys,n.__scopeMenu),v=nh(Ys,n.__scopeMenu),g=Ye(l,f),m=y.useRef(!1),x=()=>{const p=f.current;if(!i&&p){const S=new CustomEvent(ey,{bubbles:!0,cancelable:!0});p.addEventListener(ey,T=>o?.(T),{once:!0}),Hy(p,S),S.defaultPrevented?m.current=!1:d.onClose()}};return h.jsx(qb,{...c,ref:g,disabled:i,onClick:pe(n.onClick,x),onPointerDown:p=>{n.onPointerDown?.(p),m.current=!0},onPointerUp:pe(n.onPointerUp,p=>{m.current||p.currentTarget?.click()}),onKeyDown:pe(n.onKeyDown,p=>{i||p.target!==p.currentTarget||v.searchRef.current!==""&&p.key===" "||dd.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});lc.displayName=Ys;var qb=y.forwardRef((n,l)=>{const{__scopeMenu:i,disabled:o=!1,textValue:c,...f}=n,d=nh(Ys,i),v=zb(i),g=y.useRef(null),m=Ye(l,g),[x,p]=y.useState(!1),[S,T]=y.useState("");return y.useEffect(()=>{const E=g.current;E&&T((E.textContent??"").trim())},[f.children]),h.jsx(Vi.ItemSlot,{scope:i,disabled:o,textValue:c??S,children:h.jsx(W2,{asChild:!0,...v,focusable:!o,children:h.jsx(Ce.div,{role:"menuitem","data-highlighted":x?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...f,ref:m,onPointerMove:pe(n.onPointerMove,Yi(E=>{o?d.onItemLeave(E):(d.onItemEnter(E),E.defaultPrevented||E.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:pe(n.onPointerLeave,Yi(E=>d.onItemLeave(E))),onFocus:pe(n.onFocus,()=>p(!0)),onBlur:pe(n.onBlur,()=>p(!1))})})})}),vT="MenuCheckboxItem",Gb=y.forwardRef((n,l)=>{const{checked:i=!1,onCheckedChange:o,...c}=n;return h.jsx(Pb,{scope:n.__scopeMenu,checked:i,children:h.jsx(lc,{role:"menuitemcheckbox","aria-checked":Is(i)?"mixed":i,...c,ref:l,"data-state":ih(i),onSelect:pe(c.onSelect,()=>o?.(Is(i)?!0:!i),{checkForDefaultPrevented:!1})})})});Gb.displayName=vT;var Vb="MenuRadioGroup",[gT,yT]=Rl(Vb,{value:void 0,onValueChange:()=>{}}),Yb=y.forwardRef((n,l)=>{const{value:i,onValueChange:o,...c}=n,f=bn(o);return h.jsx(gT,{scope:n.__scopeMenu,value:i,onValueChange:f,children:h.jsx(lh,{...c,ref:l})})});Yb.displayName=Vb;var Ib="MenuRadioItem",Qb=y.forwardRef((n,l)=>{const{value:i,...o}=n,c=yT(Ib,n.__scopeMenu),f=i===c.value;return h.jsx(Pb,{scope:n.__scopeMenu,checked:f,children:h.jsx(lc,{role:"menuitemradio","aria-checked":f,...o,ref:l,"data-state":ih(f),onSelect:pe(o.onSelect,()=>c.onValueChange?.(i),{checkForDefaultPrevented:!1})})})});Qb.displayName=Ib;var rh="MenuItemIndicator",[Pb,bT]=Rl(rh,{checked:!1}),Kb=y.forwardRef((n,l)=>{const{__scopeMenu:i,forceMount:o,...c}=n,f=bT(rh,i);return h.jsx(Mn,{present:o||Is(f.checked)||f.checked===!0,children:h.jsx(Ce.span,{...c,ref:l,"data-state":ih(f.checked)})})});Kb.displayName=rh;var xT="MenuSeparator",Fb=y.forwardRef((n,l)=>{const{__scopeMenu:i,...o}=n;return h.jsx(Ce.div,{role:"separator","aria-orientation":"horizontal",...o,ref:l})});Fb.displayName=xT;var ST="MenuArrow",Xb=y.forwardRef((n,l)=>{const{__scopeMenu:i,...o}=n,c=ac(i);return h.jsx(Wd,{...c,...o,ref:l})});Xb.displayName=ST;var wT="MenuSub",[BO,Zb]=Rl(wT),zi="MenuSubTrigger",$b=y.forwardRef((n,l)=>{const i=Ml(zi,n.__scopeMenu),o=to(zi,n.__scopeMenu),c=Zb(zi,n.__scopeMenu),f=nh(zi,n.__scopeMenu),d=y.useRef(null),{pointerGraceTimerRef:v,onPointerGraceIntentChange:g}=f,m={__scopeMenu:n.__scopeMenu},x=y.useCallback(()=>{d.current&&window.clearTimeout(d.current),d.current=null},[]);y.useEffect(()=>x,[x]),y.useEffect(()=>{const S=v.current;return()=>{window.clearTimeout(S),g(null)}},[v,g]);const p=Ye(l,c.onTriggerChange);return h.jsx(eh,{asChild:!0,...m,children:h.jsx(qb,{id:c.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?c.contentId:void 0,"data-state":e0(i.open),...n,ref:p,onClick:S=>{n.onClick?.(S),!(n.disabled||S.defaultPrevented)&&(S.currentTarget.focus(),i.open||i.onOpenChange(!0))},onPointerMove:pe(n.onPointerMove,Yi(S=>{f.onItemEnter(S),!S.defaultPrevented&&!n.disabled&&!i.open&&!d.current&&(f.onPointerGraceIntentChange(null),d.current=window.setTimeout(()=>{i.onOpenChange(!0),x()},100))})),onPointerLeave:pe(n.onPointerLeave,Yi(S=>{x();const T=i.content?.getBoundingClientRect();if(T){const E=i.content?.dataset.side,C=E==="right",R=C?-5:5,M=T[C?"left":"right"],z=T[C?"right":"left"];f.onPointerGraceIntentChange({area:[{x:S.clientX+R,y:S.clientY},{x:M,y:T.top},{x:z,y:T.top},{x:z,y:T.bottom},{x:M,y:T.bottom}],side:E}),window.clearTimeout(v.current),v.current=window.setTimeout(()=>f.onPointerGraceIntentChange(null),300)}else{if(f.onTriggerLeave(S),S.defaultPrevented)return;f.onPointerGraceIntentChange(null)}})),onKeyDown:pe(n.onKeyDown,S=>{n.disabled||S.target!==S.currentTarget||f.searchRef.current!==""&&S.key===" "||nT[o.dir].includes(S.key)&&(i.onOpenChange(!0),i.content?.focus(),S.preventDefault())})})})});$b.displayName=zi;var Jb="MenuSubContent",Wb=y.forwardRef((n,l)=>{const i=Lb(yn,n.__scopeMenu),{forceMount:o=i.forceMount,align:c="start",...f}=n,d=Ml(yn,n.__scopeMenu),v=to(yn,n.__scopeMenu),g=Zb(Jb,n.__scopeMenu),m=y.useRef(null),x=Ye(l,m);return h.jsx(Vi.Provider,{scope:n.__scopeMenu,children:h.jsx(Mn,{present:o||d.open,children:h.jsx(Vi.Slot,{scope:n.__scopeMenu,children:h.jsx(ah,{id:g.contentId,"aria-labelledby":g.triggerId,...f,ref:x,align:c,side:v.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{v.isUsingKeyboardRef.current&&m.current?.focus(),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:pe(n.onFocusOutside,p=>{p.target!==g.trigger&&d.onOpenChange(!1)}),onEscapeKeyDown:pe(n.onEscapeKeyDown,p=>{v.onClose(),p.preventDefault()}),onKeyDown:pe(n.onKeyDown,p=>{const S=p.currentTarget.contains(p.target),T=aT[v.dir].includes(p.key);S&&T&&(d.onOpenChange(!1),g.trigger?.focus(),p.preventDefault())})})})})})});Wb.displayName=Jb;function e0(n){return n?"open":"closed"}function Is(n){return n==="indeterminate"}function ih(n){return Is(n)?"indeterminate":n?"checked":"unchecked"}function ET(n){const l=document.activeElement;for(const i of n)if(i===l||(i.focus(),document.activeElement!==l))return}function CT(n,l){return n.map((i,o)=>n[(l+o)%n.length])}function TT(n,l,i){const c=l.length>1&&Array.from(l).every(m=>m===l[0])?l[0]:l,f=i?n.indexOf(i):-1;let d=CT(n,Math.max(f,0));c.length===1&&(d=d.filter(m=>m!==i));const g=d.find(m=>m.toLowerCase().startsWith(c.toLowerCase()));return g!==i?g:void 0}function RT(n,l){const{x:i,y:o}=n;let c=!1;for(let f=0,d=l.length-1;f o!=S>o&&i<(p-m)*(o-x)/(S-x)+m&&(c=!c)}return c}function MT(n,l){if(!l)return!1;const i={x:n.clientX,y:n.clientY};return RT(i,l)}function Yi(n){return l=>l.pointerType==="mouse"?n(l):void 0}var jT=kb,AT=eh,NT=Hb,OT=Ub,_T=lh,DT=Bb,zT=lc,kT=Gb,LT=Yb,HT=Qb,UT=Kb,BT=Fb,qT=Xb,GT=$b,VT=Wb,rc="DropdownMenu",[YT]=Qa(rc,[Db]),zt=Db(),[IT,t0]=YT(rc),n0=n=>{const{__scopeDropdownMenu:l,children:i,dir:o,open:c,defaultOpen:f,onOpenChange:d,modal:v=!0}=n,g=zt(l),m=y.useRef(null),[x,p]=Nr({prop:c,defaultProp:f??!1,onChange:d,caller:rc});return h.jsx(IT,{scope:l,triggerId:Nt(),triggerRef:m,contentId:Nt(),open:x,onOpenChange:p,onOpenToggle:y.useCallback(()=>p(S=>!S),[p]),modal:v,children:h.jsx(jT,{...g,open:x,onOpenChange:p,dir:o,modal:v,children:i})})};n0.displayName=rc;var a0="DropdownMenuTrigger",l0=y.forwardRef((n,l)=>{const{__scopeDropdownMenu:i,disabled:o=!1,...c}=n,f=t0(a0,i),d=zt(i),v=Ye(l,f.triggerRef);return h.jsx(AT,{asChild:!0,...d,children:h.jsx(Ce.button,{type:"button",id:f.triggerId,"aria-haspopup":"menu","aria-expanded":f.open,"aria-controls":f.open?f.contentId:void 0,"data-state":f.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...c,ref:v,onPointerDown:pe(n.onPointerDown,g=>{!o&&g.button===0&&g.ctrlKey===!1&&(f.onOpenToggle(),f.open||g.preventDefault())}),onKeyDown:pe(n.onKeyDown,g=>{o||(["Enter"," "].includes(g.key)&&f.onOpenToggle(),g.key==="ArrowDown"&&f.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(g.key)&&g.preventDefault())})})})});l0.displayName=a0;var QT="DropdownMenuPortal",r0=n=>{const{__scopeDropdownMenu:l,...i}=n,o=zt(l);return h.jsx(NT,{...o,...i})};r0.displayName=QT;var i0="DropdownMenuContent",o0=y.forwardRef((n,l)=>{const{__scopeDropdownMenu:i,...o}=n,c=t0(i0,i),f=zt(i),d=y.useRef(!1);return h.jsx(OT,{id:c.contentId,"aria-labelledby":c.triggerId,...f,...o,ref:l,onCloseAutoFocus:pe(n.onCloseAutoFocus,v=>{d.current||c.triggerRef.current?.focus(),d.current=!1,v.preventDefault()}),onInteractOutside:pe(n.onInteractOutside,v=>{const g=v.detail.originalEvent,m=g.button===0&&g.ctrlKey===!0,x=g.button===2||m;(!c.modal||x)&&(d.current=!0)}),style:{...n.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});o0.displayName=i0;var PT="DropdownMenuGroup",KT=y.forwardRef((n,l)=>{const{__scopeDropdownMenu:i,...o}=n,c=zt(i);return h.jsx(_T,{...c,...o,ref:l})});KT.displayName=PT;var FT="DropdownMenuLabel",s0=y.forwardRef((n,l)=>{const{__scopeDropdownMenu:i,...o}=n,c=zt(i);return h.jsx(DT,{...c,...o,ref:l})});s0.displayName=FT;var XT="DropdownMenuItem",c0=y.forwardRef((n,l)=>{const{__scopeDropdownMenu:i,...o}=n,c=zt(i);return h.jsx(zT,{...c,...o,ref:l})});c0.displayName=XT;var ZT="DropdownMenuCheckboxItem",$T=y.forwardRef((n,l)=>{const{__scopeDropdownMenu:i,...o}=n,c=zt(i);return h.jsx(kT,{...c,...o,ref:l})});$T.displayName=ZT;var JT="DropdownMenuRadioGroup",WT=y.forwardRef((n,l)=>{const{__scopeDropdownMenu:i,...o}=n,c=zt(i);return h.jsx(LT,{...c,...o,ref:l})});WT.displayName=JT;var eR="DropdownMenuRadioItem",tR=y.forwardRef((n,l)=>{const{__scopeDropdownMenu:i,...o}=n,c=zt(i);return h.jsx(HT,{...c,...o,ref:l})});tR.displayName=eR;var nR="DropdownMenuItemIndicator",aR=y.forwardRef((n,l)=>{const{__scopeDropdownMenu:i,...o}=n,c=zt(i);return h.jsx(UT,{...c,...o,ref:l})});aR.displayName=nR;var lR="DropdownMenuSeparator",rR=y.forwardRef((n,l)=>{const{__scopeDropdownMenu:i,...o}=n,c=zt(i);return h.jsx(BT,{...c,...o,ref:l})});rR.displayName=lR;var iR="DropdownMenuArrow",oR=y.forwardRef((n,l)=>{const{__scopeDropdownMenu:i,...o}=n,c=zt(i);return h.jsx(qT,{...c,...o,ref:l})});oR.displayName=iR;var sR="DropdownMenuSubTrigger",cR=y.forwardRef((n,l)=>{const{__scopeDropdownMenu:i,...o}=n,c=zt(i);return h.jsx(GT,{...c,...o,ref:l})});cR.displayName=sR;var uR="DropdownMenuSubContent",fR=y.forwardRef((n,l)=>{const{__scopeDropdownMenu:i,...o}=n,c=zt(i);return h.jsx(VT,{...c,...o,ref:l,style:{...n.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});fR.displayName=uR;var dR=n0,hR=l0,mR=r0,pR=o0,vR=s0,gR=c0;function ty(n,[l,i]){return Math.min(i,Math.max(l,n))}var yR=[" ","Enter","ArrowUp","ArrowDown"],bR=[" ","Enter"],Cl="Select",[ic,oc,xR]=Nd(Cl),[jl]=Qa(Cl,[xR,Lr]),sc=Lr(),[SR,Ka]=jl(Cl),[wR,ER]=jl(Cl),CR="SelectProvider";function u0(n){const{__scopeSelect:l,children:i,open:o,defaultOpen:c,onOpenChange:f,value:d,defaultValue:v,onValueChange:g,dir:m,name:x,autoComplete:p,disabled:S,required:T,form:E,internal_do_not_use_render:C}=n,R=sc(l),[M,z]=y.useState(null),[D,Y]=y.useState(null),[K,q]=y.useState(!1),V=Od(m),[B,oe]=Nr({prop:o,defaultProp:c??!1,onChange:f,caller:Cl}),[se,le]=Nr({prop:d,defaultProp:v,onChange:g,caller:Cl}),ce=y.useRef(null),ue=y.useRef(se);y.useEffect(()=>{const j=E?M?.ownerDocument.getElementById(E):M?.form;if(j instanceof HTMLFormElement){const L=()=>le(ue.current);return j.addEventListener("reset",L),()=>j.removeEventListener("reset",L)}},[E,M,le]);const ve=M?!!E||!!M.closest("form"):!0,[fe,O]=y.useState(new Set),F=Nt(),W=Array.from(fe).map(j=>j.props.value).join(";"),ee=y.useCallback(j=>{O(L=>new Set(L).add(j))},[]),$=y.useCallback(j=>{O(L=>{const Q=new Set(L);return Q.delete(j),Q})},[]),A={required:T,trigger:M,onTriggerChange:z,valueNode:D,onValueNodeChange:Y,valueNodeHasChildren:K,onValueNodeHasChildrenChange:q,contentId:F,value:se,onValueChange:le,open:B,onOpenChange:oe,dir:V,triggerPointerDownPosRef:ce,disabled:S,name:x,autoComplete:p,form:E,nativeOptions:fe,nativeSelectKey:W,isFormControl:ve};return h.jsx(Zd,{...R,children:h.jsx(SR,{scope:l,...A,children:h.jsx(ic.Provider,{scope:l,children:h.jsx(wR,{scope:l,onNativeOptionAdd:ee,onNativeOptionRemove:$,children:GR(C)?C(A):i})})})})}u0.displayName=CR;var f0=n=>{const{__scopeSelect:l,children:i,...o}=n;return h.jsx(u0,{__scopeSelect:l,...o,internal_do_not_use_render:({isFormControl:c})=>h.jsxs(h.Fragment,{children:[i,c?h.jsx(H0,{__scopeSelect:l}):null]})})};f0.displayName=Cl;var d0="SelectTrigger",h0=y.forwardRef((n,l)=>{const{__scopeSelect:i,disabled:o=!1,...c}=n,f=sc(i),d=Ka(d0,i),v=d.disabled||o,g=Ye(l,d.onTriggerChange),m=oc(i),x=y.useRef("touch"),[p,S,T]=U0(C=>{const R=m().filter(D=>!D.disabled),M=R.find(D=>D.value===d.value),z=B0(R,C,M);z!==void 0&&d.onValueChange(z.value)}),E=C=>{v||(d.onOpenChange(!0),T()),C&&(d.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})};return h.jsx($d,{asChild:!0,...f,children:h.jsx(Ce.button,{type:"button",role:"combobox","aria-controls":d.open?d.contentId:void 0,"aria-expanded":d.open,"aria-required":d.required,"aria-autocomplete":"none",dir:d.dir,"data-state":d.open?"open":"closed",disabled:v,"data-disabled":v?"":void 0,"data-placeholder":cc(d.value)?"":void 0,...c,ref:g,onClick:pe(c.onClick,C=>{C.currentTarget.focus(),x.current!=="mouse"&&E(C)}),onPointerDown:pe(c.onPointerDown,C=>{x.current=C.pointerType;const R=C.target;R.hasPointerCapture(C.pointerId)&&R.releasePointerCapture(C.pointerId),C.button===0&&C.ctrlKey===!1&&C.pointerType==="mouse"&&(E(C),C.preventDefault())}),onKeyDown:pe(c.onKeyDown,C=>{const R=p.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&S(C.key),!(R&&C.key===" ")&&yR.includes(C.key)&&(E(),C.preventDefault())})})})});h0.displayName=d0;var m0="SelectValue",p0=y.forwardRef((n,l)=>{const{__scopeSelect:i,className:o,style:c,children:f,placeholder:d="",...v}=n,g=Ka(m0,i),{onValueNodeHasChildrenChange:m}=g,x=f!==void 0,p=Ye(l,g.onValueNodeChange);yt(()=>{m(x)},[m,x]);const S=cc(g.value);return h.jsx(Ce.span,{...v,asChild:S?!1:v.asChild,ref:p,style:{pointerEvents:"none"},children:h.jsx(y.Fragment,{children:S?d:f},S?"placeholder":"value")})});p0.displayName=m0;var TR="SelectIcon",v0=y.forwardRef((n,l)=>{const{__scopeSelect:i,children:o,...c}=n;return h.jsx(Ce.span,{"aria-hidden":!0,...c,ref:l,children:o||"▼"})});v0.displayName=TR;var g0="SelectPortal",[RR,MR]=jl(g0,{forceMount:void 0}),y0=n=>{const{__scopeSelect:l,forceMount:i,...o}=n;return h.jsx(RR,{scope:n.__scopeSelect,forceMount:i,children:h.jsx(Ji,{asChild:!0,...o})})};y0.displayName=g0;var Ya="SelectContent",b0=y.forwardRef((n,l)=>{const i=MR(Ya,n.__scopeSelect),{forceMount:o=i.forceMount,...c}=n,f=Ka(Ya,n.__scopeSelect),[d,v]=y.useState();return yt(()=>{v(new DocumentFragment)},[]),h.jsx(Mn,{present:o||f.open,children:({present:g})=>g?h.jsx(w0,{...c,ref:l}):h.jsx(x0,{...c,fragment:d})})});b0.displayName=Ya;var x0=y.forwardRef((n,l)=>{const{__scopeSelect:i,children:o,fragment:c}=n;return c?Dr.createPortal(h.jsx(S0,{scope:i,children:h.jsx(ic.Slot,{scope:i,children:h.jsx("div",{ref:l,children:o})})}),c):null});x0.displayName="SelectContentFragment";var Tn=10,[S0,Fa]=jl(Ya),jR="SelectContentImpl",AR=Ar("SelectContent.RemoveScroll"),w0=y.forwardRef((n,l)=>{const{__scopeSelect:i}=n,{position:o="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:f,onPointerDownOutside:d,side:v,sideOffset:g,align:m,alignOffset:x,arrowPadding:p,collisionBoundary:S,collisionPadding:T,sticky:E,hideWhenDetached:C,avoidCollisions:R,...M}=n,z=Ka(Ya,i),[D,Y]=y.useState(null),[K,q]=y.useState(null),V=Ye(l,Y),[B,oe]=y.useState(null),[se,le]=y.useState(null),ce=oc(i),[ue,ve]=y.useState(!1),fe=y.useRef(!1);y.useEffect(()=>{if(D)return zd(D)},[D]),Dd();const O=y.useCallback(Z=>{const[ae,...re]=ce().map(je=>je.ref.current),[xe]=re.slice(-1),Re=document.activeElement;for(const je of Z)if(je===Re||(je?.scrollIntoView({block:"nearest"}),je===ae&&K&&(K.scrollTop=0),je===xe&&K&&(K.scrollTop=K.scrollHeight),je?.focus(),document.activeElement!==Re))return},[ce,K]),F=y.useCallback(()=>O([B,D]),[O,B,D]);y.useEffect(()=>{ue&&F()},[ue,F]);const{onOpenChange:W,triggerPointerDownPosRef:ee}=z;y.useEffect(()=>{if(D){let Z={x:0,y:0};const ae=xe=>{Z={x:Math.abs(Math.round(xe.pageX)-(ee.current?.x??0)),y:Math.abs(Math.round(xe.pageY)-(ee.current?.y??0))}},re=xe=>{Z.x<=10&&Z.y<=10?xe.preventDefault():xe.composedPath().includes(D)||W(!1),document.removeEventListener("pointermove",ae),ee.current=null};return ee.current!==null&&(document.addEventListener("pointermove",ae),document.addEventListener("pointerup",re,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ae),document.removeEventListener("pointerup",re,{capture:!0})}}},[D,W,ee]),y.useEffect(()=>{const Z=()=>W(!1);return window.addEventListener("blur",Z),window.addEventListener("resize",Z),()=>{window.removeEventListener("blur",Z),window.removeEventListener("resize",Z)}},[W]);const[$,A]=U0(Z=>{const ae=ce().filter(Re=>!Re.disabled),re=ae.find(Re=>Re.ref.current===document.activeElement),xe=B0(ae,Z,re);xe&&setTimeout(()=>xe.ref.current?.focus())}),j=y.useCallback((Z,ae,re)=>{const xe=!fe.current&&!re;(z.value!==void 0&&z.value===ae||xe)&&(oe(Z),xe&&(fe.current=!0))},[z.value]),L=y.useCallback(()=>D?.focus(),[D]),Q=y.useCallback((Z,ae,re)=>{const xe=!fe.current&&!re;(z.value!==void 0&&z.value===ae||xe)&&le(Z)},[z.value]),I=o==="popper"?hd:E0,te=I===hd?{side:v,sideOffset:g,align:m,alignOffset:x,arrowPadding:p,collisionBoundary:S,collisionPadding:T,sticky:E,hideWhenDetached:C,avoidCollisions:R}:{};return h.jsx(S0,{scope:i,content:D,viewport:K,onViewportChange:q,itemRefCallback:j,selectedItem:B,onItemLeave:L,itemTextRefCallback:Q,focusSelectedItem:F,selectedItemText:se,position:o,isPositioned:ue,searchRef:$,children:h.jsx(Zs,{as:AR,allowPinchZoom:!0,children:h.jsx(Fs,{asChild:!0,trapped:z.open,onMountAutoFocus:Z=>{Z.preventDefault()},onUnmountAutoFocus:pe(c,Z=>{z.trigger?.focus({preventScroll:!0}),Z.preventDefault()}),children:h.jsx($i,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:f,onPointerDownOutside:d,onFocusOutside:Z=>Z.preventDefault(),onDismiss:()=>z.onOpenChange(!1),children:h.jsx(I,{role:"listbox",id:z.contentId,"data-state":z.open?"open":"closed",dir:z.dir,onContextMenu:Z=>Z.preventDefault(),...M,...te,onPlaced:()=>ve(!0),ref:V,style:{display:"flex",flexDirection:"column",outline:"none",...M.style},onKeyDown:pe(M.onKeyDown,Z=>{const ae=Z.ctrlKey||Z.altKey||Z.metaKey;if(Z.key==="Tab"&&Z.preventDefault(),!ae&&Z.key.length===1&&A(Z.key),["ArrowUp","ArrowDown","Home","End"].includes(Z.key)){let xe=ce().filter(Re=>!Re.disabled).map(Re=>Re.ref.current);if(["ArrowUp","End"].includes(Z.key)&&(xe=xe.slice().reverse()),["ArrowUp","ArrowDown"].includes(Z.key)){const Re=Z.target,je=xe.indexOf(Re);xe=xe.slice(je+1)}setTimeout(()=>O(xe)),Z.preventDefault()}})})})})})})});w0.displayName=jR;var NR="SelectItemAlignedPosition",E0=y.forwardRef((n,l)=>{const{__scopeSelect:i,onPlaced:o,...c}=n,f=Ka(Ya,i),d=Fa(Ya,i),[v,g]=y.useState(null),[m,x]=y.useState(null),p=Ye(l,x),S=oc(i),T=y.useRef(!1),E=y.useRef(!0),{viewport:C,selectedItem:R,selectedItemText:M,focusSelectedItem:z}=d,D=y.useCallback(()=>{if(f.trigger&&f.valueNode&&v&&m&&C&&R&&M){const V=f.trigger.getBoundingClientRect(),B=m.getBoundingClientRect(),oe=f.valueNode.getBoundingClientRect(),se=M.getBoundingClientRect();if(f.dir!=="rtl"){const Re=se.left-B.left,je=oe.left-Re,et=V.left-je,Ge=V.width+et,kt=Math.max(Ge,B.width),ht=window.innerWidth-Tn,nt=ty(je,[Tn,Math.max(Tn,ht-kt)]);v.style.minWidth=Ge+"px",v.style.left=nt+"px"}else{const Re=B.right-se.right,je=window.innerWidth-oe.right-Re,et=window.innerWidth-V.right-je,Ge=V.width+et,kt=Math.max(Ge,B.width),ht=window.innerWidth-Tn,nt=ty(je,[Tn,Math.max(Tn,ht-kt)]);v.style.minWidth=Ge+"px",v.style.right=nt+"px"}const le=S(),ce=window.innerHeight-Tn*2,ue=C.scrollHeight,ve=window.getComputedStyle(m),fe=parseInt(ve.borderTopWidth,10),O=parseInt(ve.paddingTop,10),F=parseInt(ve.borderBottomWidth,10),W=parseInt(ve.paddingBottom,10),ee=fe+O+ue+W+F,$=Math.min(R.offsetHeight*5,ee),A=window.getComputedStyle(C),j=parseInt(A.paddingTop,10),L=parseInt(A.paddingBottom,10),Q=V.top+V.height/2-Tn,I=ce-Q,te=R.offsetHeight/2,Z=R.offsetTop+te,ae=fe+O+Z,re=ee-ae;if(ae<=Q){const Re=le.length>0&&R===le[le.length-1].ref.current;v.style.bottom="0px";const je=m.clientHeight-C.offsetTop-C.offsetHeight,et=Math.max(I,te+(Re?L:0)+je+F),Ge=ae+et;v.style.height=Ge+"px"}else{const Re=le.length>0&&R===le[0].ref.current;v.style.top="0px";const et=Math.max(Q,fe+C.offsetTop+(Re?j:0)+te)+re;v.style.height=et+"px",C.scrollTop=ae-Q+C.offsetTop}v.style.margin=`${Tn}px 0`,v.style.minHeight=$+"px",v.style.maxHeight=ce+"px",o?.(),requestAnimationFrame(()=>T.current=!0)}},[S,f.trigger,f.valueNode,v,m,C,R,M,f.dir,o]);yt(()=>D(),[D]);const[Y,K]=y.useState();yt(()=>{m&&K(window.getComputedStyle(m).zIndex)},[m]);const q=y.useCallback(V=>{V&&E.current===!0&&(D(),z?.(),E.current=!1)},[D,z]);return h.jsx(_R,{scope:i,contentWrapper:v,shouldExpandOnScrollRef:T,onScrollButtonChange:q,children:h.jsx("div",{ref:g,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:Y},children:h.jsx(Ce.div,{...c,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})});E0.displayName=NR;var OR="SelectPopperPosition",hd=y.forwardRef((n,l)=>{const{__scopeSelect:i,align:o="start",collisionPadding:c=Tn,...f}=n,d=sc(i);return h.jsx(Jd,{...d,...f,ref:l,align:o,collisionPadding:c,style:{boxSizing:"border-box",...f.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});hd.displayName=OR;var[_R,oh]=jl(Ya,{}),md="SelectViewport",C0=y.forwardRef((n,l)=>{const{__scopeSelect:i,nonce:o,...c}=n,f=Fa(md,i),d=oh(md,i),v=Ye(l,f.onViewportChange),g=y.useRef(0);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),h.jsx(ic.Slot,{scope:i,children:h.jsx(Ce.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:v,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:pe(c.onScroll,m=>{const x=m.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:S}=d;if(S?.current&&p){const T=Math.abs(g.current-x.scrollTop);if(T>0){const E=window.innerHeight-Tn*2,C=parseFloat(p.style.minHeight),R=parseFloat(p.style.height),M=Math.max(C,R);if(M 0?Y:0,p.style.justifyContent="flex-end")}}}g.current=x.scrollTop})})})]})});C0.displayName=md;var T0="SelectGroup",[DR,zR]=jl(T0),kR=y.forwardRef((n,l)=>{const{__scopeSelect:i,...o}=n,c=Nt();return h.jsx(DR,{scope:i,id:c,children:h.jsx(Ce.div,{role:"group","aria-labelledby":c,...o,ref:l})})});kR.displayName=T0;var R0="SelectLabel",LR=y.forwardRef((n,l)=>{const{__scopeSelect:i,...o}=n,c=zR(R0,i);return h.jsx(Ce.div,{id:c.id,...o,ref:l})});LR.displayName=R0;var Qs="SelectItem",[HR,M0]=jl(Qs),j0=y.forwardRef((n,l)=>{const{__scopeSelect:i,value:o,disabled:c=!1,textValue:f,...d}=n,v=Ka(Qs,i),g=Fa(Qs,i),m=v.value===o,[x,p]=y.useState(f??""),[S,T]=y.useState(!1),E=bn(D=>g.itemRefCallback?.(D,o,c)),C=Ye(l,E),R=Nt(),M=y.useRef("touch"),z=()=>{c||(v.onValueChange(o),v.onOpenChange(!1))};return h.jsx(HR,{scope:i,value:o,disabled:c,textId:R,isSelected:m,onItemTextChange:y.useCallback(D=>{p(Y=>Y||(D?.textContent??"").trim())},[]),children:h.jsx(ic.ItemSlot,{scope:i,value:o,disabled:c,textValue:x,children:h.jsx(Ce.div,{role:"option","aria-labelledby":R,"data-highlighted":S?"":void 0,"aria-selected":m&&S,"data-state":m?"checked":"unchecked","aria-disabled":c||void 0,"data-disabled":c?"":void 0,tabIndex:c?void 0:-1,...d,ref:C,onFocus:pe(d.onFocus,()=>T(!0)),onBlur:pe(d.onBlur,()=>T(!1)),onClick:pe(d.onClick,()=>{M.current!=="mouse"&&z()}),onPointerUp:pe(d.onPointerUp,()=>{M.current==="mouse"&&z()}),onPointerDown:pe(d.onPointerDown,D=>{M.current=D.pointerType}),onPointerMove:pe(d.onPointerMove,D=>{M.current=D.pointerType,c?g.onItemLeave?.():M.current==="mouse"&&D.currentTarget.focus({preventScroll:!0})}),onPointerLeave:pe(d.onPointerLeave,D=>{D.currentTarget===document.activeElement&&g.onItemLeave?.()}),onKeyDown:pe(d.onKeyDown,D=>{c||D.target!==D.currentTarget||g.searchRef?.current!==""&&D.key===" "||(bR.includes(D.key)&&z(),D.key===" "&&D.preventDefault())})})})})});j0.displayName=Qs;var ki="SelectItemText",A0=y.forwardRef((n,l)=>{const{__scopeSelect:i,className:o,style:c,...f}=n,d=Ka(ki,i),v=Fa(ki,i),g=M0(ki,i),m=ER(ki,i),[x,p]=y.useState(null),S=bn(z=>v.itemTextRefCallback?.(z,g.value,g.disabled)),T=Ye(l,p,g.onItemTextChange,S),E=x?.textContent,C=y.useMemo(()=>h.jsx("option",{value:g.value,disabled:g.disabled,children:E},g.value),[g.disabled,g.value,E]),{onNativeOptionAdd:R,onNativeOptionRemove:M}=m;return yt(()=>(R(C),()=>M(C)),[R,M,C]),h.jsxs(h.Fragment,{children:[h.jsx(Ce.span,{id:g.textId,...f,ref:T}),g.isSelected&&d.valueNode&&!d.valueNodeHasChildren&&!cc(d.value)?Dr.createPortal(f.children,d.valueNode):null]})});A0.displayName=ki;var N0="SelectItemIndicator",O0=y.forwardRef((n,l)=>{const{__scopeSelect:i,...o}=n;return M0(N0,i).isSelected?h.jsx(Ce.span,{"aria-hidden":!0,...o,ref:l}):null});O0.displayName=N0;var pd="SelectScrollUpButton",_0=y.forwardRef((n,l)=>{const i=Fa(pd,n.__scopeSelect),o=oh(pd,n.__scopeSelect),[c,f]=y.useState(!1),d=Ye(l,o.onScrollButtonChange);return yt(()=>{if(i.viewport&&i.isPositioned){let v=function(){const m=g.scrollTop>0;f(m)};const g=i.viewport;return v(),g.addEventListener("scroll",v),()=>g.removeEventListener("scroll",v)}},[i.viewport,i.isPositioned]),c?h.jsx(z0,{...n,ref:d,onAutoScroll:()=>{const{viewport:v,selectedItem:g}=i;v&&g&&(v.scrollTop=v.scrollTop-g.offsetHeight)}}):null});_0.displayName=pd;var vd="SelectScrollDownButton",D0=y.forwardRef((n,l)=>{const i=Fa(vd,n.__scopeSelect),o=oh(vd,n.__scopeSelect),[c,f]=y.useState(!1),d=Ye(l,o.onScrollButtonChange);return yt(()=>{if(i.viewport&&i.isPositioned){let v=function(){const m=g.scrollHeight-g.clientHeight,x=Math.ceil(g.scrollTop) g.removeEventListener("scroll",v)}},[i.viewport,i.isPositioned]),c?h.jsx(z0,{...n,ref:d,onAutoScroll:()=>{const{viewport:v,selectedItem:g}=i;v&&g&&(v.scrollTop=v.scrollTop+g.offsetHeight)}}):null});D0.displayName=vd;var z0=y.forwardRef((n,l)=>{const{__scopeSelect:i,onAutoScroll:o,...c}=n,f=Fa("SelectScrollButton",i),d=y.useRef(null),v=oc(i),g=y.useCallback(()=>{d.current!==null&&(window.clearInterval(d.current),d.current=null)},[]);return y.useEffect(()=>()=>g(),[g]),yt(()=>{v().find(x=>x.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[v]),h.jsx(Ce.div,{"aria-hidden":!0,...c,ref:l,style:{flexShrink:0,...c.style},onPointerDown:pe(c.onPointerDown,()=>{d.current===null&&(d.current=window.setInterval(o,50))}),onPointerMove:pe(c.onPointerMove,()=>{f.onItemLeave?.(),d.current===null&&(d.current=window.setInterval(o,50))}),onPointerLeave:pe(c.onPointerLeave,()=>{g()})})}),UR="SelectSeparator",BR=y.forwardRef((n,l)=>{const{__scopeSelect:i,...o}=n;return h.jsx(Ce.div,{"aria-hidden":!0,...o,ref:l})});BR.displayName=UR;var k0="SelectArrow",qR=y.forwardRef((n,l)=>{const{__scopeSelect:i,...o}=n,c=sc(i);return Fa(k0,i).position==="popper"?h.jsx(Wd,{...c,...o,ref:l}):null});qR.displayName=k0;var L0="SelectBubbleInput",H0=y.forwardRef(({__scopeSelect:n,...l},i)=>{const o=Ka(L0,n),{value:c,onValueChange:f,required:d,disabled:v,name:g,autoComplete:m,form:x}=o,{nativeOptions:p,nativeSelectKey:S}=o,T=y.useRef(null),E=Ye(i,T),C=c??"",R=EC(C),M=Array.from(p).some(z=>(z.props.value??"")==="");return y.useEffect(()=>{const z=T.current;if(!z)return;const D=window.HTMLSelectElement.prototype,K=Object.getOwnPropertyDescriptor(D,"value").set;if(R!==C&&K){const q=new Event("change",{bubbles:!0});K.call(z,C),z.dispatchEvent(q)}},[R,C]),h.jsxs(Ce.select,{"aria-hidden":!0,required:d,tabIndex:-1,name:g,autoComplete:m,disabled:v,form:x,onChange:z=>f(z.target.value),...l,style:{...Uy,...l.style},ref:E,defaultValue:C,children:[cc(c)&&!M?h.jsx("option",{value:""}):null,Array.from(p)]},S)});H0.displayName=L0;function GR(n){return typeof n=="function"}function cc(n){return n===""||n===void 0}function U0(n){const l=bn(n),i=y.useRef(""),o=y.useRef(0),c=y.useCallback(d=>{const v=i.current+d;l(v),(function g(m){i.current=m,window.clearTimeout(o.current),m!==""&&(o.current=window.setTimeout(()=>g(""),1e3))})(v)},[l]),f=y.useCallback(()=>{i.current="",window.clearTimeout(o.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(o.current),[]),[i,c,f]}function B0(n,l,i){const c=l.length>1&&Array.from(l).every(m=>m===l[0])?l[0]:l,f=i?n.indexOf(i):-1;let d=VR(n,Math.max(f,0));c.length===1&&(d=d.filter(m=>m!==i));const g=d.find(m=>m.textValue.toLowerCase().startsWith(c.toLowerCase()));return g!==i?g:void 0}function VR(n,l){return n.map((i,o)=>n[(l+o)%n.length])}var[uc]=Qa("Tooltip",[Lr]),fc=Lr(),q0="TooltipProvider",YR=700,gd="tooltip.open",[IR,sh]=uc(q0),G0=n=>{const{__scopeTooltip:l,delayDuration:i=YR,skipDelayDuration:o=300,disableHoverableContent:c=!1,children:f}=n,d=y.useRef(!0),v=y.useRef(!1),g=y.useRef(0);return y.useEffect(()=>{const m=g.current;return()=>window.clearTimeout(m)},[]),h.jsx(IR,{scope:l,isOpenDelayedRef:d,delayDuration:i,onOpen:y.useCallback(()=>{o<=0||(window.clearTimeout(g.current),d.current=!1)},[o]),onClose:y.useCallback(()=>{o<=0||(window.clearTimeout(g.current),g.current=window.setTimeout(()=>d.current=!0,o))},[o]),isPointerInTransitRef:v,onPointerInTransitChange:y.useCallback(m=>{v.current=m},[]),disableHoverableContent:c,children:f})};G0.displayName=q0;var Ii="Tooltip",[QR,no]=uc(Ii),V0=n=>{const{__scopeTooltip:l,children:i,open:o,defaultOpen:c,onOpenChange:f,disableHoverableContent:d,delayDuration:v}=n,g=sh(Ii,n.__scopeTooltip),m=fc(l),[x,p]=y.useState(null),S=Nt(),T=y.useRef(0),E=d??g.disableHoverableContent,C=v??g.delayDuration,R=y.useRef(!1),[M,z]=Nr({prop:o,defaultProp:c??!1,onChange:V=>{V?(g.onOpen(),document.dispatchEvent(new CustomEvent(gd))):g.onClose(),f?.(V)},caller:Ii}),D=y.useMemo(()=>M?R.current?"delayed-open":"instant-open":"closed",[M]),Y=y.useCallback(()=>{window.clearTimeout(T.current),T.current=0,R.current=!1,z(!0)},[z]),K=y.useCallback(()=>{window.clearTimeout(T.current),T.current=0,z(!1)},[z]),q=y.useCallback(()=>{window.clearTimeout(T.current),T.current=window.setTimeout(()=>{R.current=!0,z(!0),T.current=0},C)},[C,z]);return y.useEffect(()=>()=>{T.current&&(window.clearTimeout(T.current),T.current=0)},[]),h.jsx(Zd,{...m,children:h.jsx(QR,{scope:l,contentId:S,open:M,stateAttribute:D,trigger:x,onTriggerChange:p,onTriggerEnter:y.useCallback(()=>{g.isOpenDelayedRef.current?q():Y()},[g.isOpenDelayedRef,q,Y]),onTriggerLeave:y.useCallback(()=>{E?K():(window.clearTimeout(T.current),T.current=0)},[K,E]),onOpen:Y,onClose:K,disableHoverableContent:E,children:i})})};V0.displayName=Ii;var yd="TooltipTrigger",Y0=y.forwardRef((n,l)=>{const{__scopeTooltip:i,...o}=n,c=no(yd,i),f=sh(yd,i),d=fc(i),v=y.useRef(null),g=Ye(l,v,c.onTriggerChange),m=y.useRef(!1),x=y.useRef(!1),p=y.useCallback(()=>m.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),h.jsx($d,{asChild:!0,...d,children:h.jsx(Ce.button,{"aria-describedby":c.open?c.contentId:void 0,"data-state":c.stateAttribute,...o,ref:g,onPointerMove:pe(n.onPointerMove,S=>{S.pointerType!=="touch"&&!x.current&&!f.isPointerInTransitRef.current&&(c.onTriggerEnter(),x.current=!0)}),onPointerLeave:pe(n.onPointerLeave,()=>{c.onTriggerLeave(),x.current=!1}),onPointerDown:pe(n.onPointerDown,()=>{c.open&&c.onClose(),m.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:pe(n.onFocus,()=>{m.current||c.onOpen()}),onBlur:pe(n.onBlur,c.onClose),onClick:pe(n.onClick,c.onClose)})})});Y0.displayName=yd;var ch="TooltipPortal",[PR,KR]=uc(ch,{forceMount:void 0}),I0=n=>{const{__scopeTooltip:l,forceMount:i,children:o,container:c}=n,f=no(ch,l);return h.jsx(PR,{scope:l,forceMount:i,children:h.jsx(Mn,{present:i||f.open,children:h.jsx(Ji,{asChild:!0,container:c,children:o})})})};I0.displayName=ch;var _r="TooltipContent",Q0=y.forwardRef((n,l)=>{const i=KR(_r,n.__scopeTooltip),{forceMount:o=i.forceMount,side:c="top",...f}=n,d=no(_r,n.__scopeTooltip);return h.jsx(Mn,{present:o||d.open,children:d.disableHoverableContent?h.jsx(P0,{side:c,...f,ref:l}):h.jsx(FR,{side:c,...f,ref:l})})}),FR=y.forwardRef((n,l)=>{const i=no(_r,n.__scopeTooltip),o=sh(_r,n.__scopeTooltip),c=y.useRef(null),f=Ye(l,c),[d,v]=y.useState(null),{trigger:g,onClose:m}=i,x=c.current,{onPointerInTransitChange:p}=o,S=y.useCallback(()=>{v(null),p(!1)},[p]),T=y.useCallback((E,C)=>{const R=E.currentTarget,M={x:E.clientX,y:E.clientY},z=JR(M,R.getBoundingClientRect()),D=WR(M,z),Y=eM(C.getBoundingClientRect()),K=nM([...D,...Y]);v(K),p(!0)},[p]);return y.useEffect(()=>()=>S(),[S]),y.useEffect(()=>{if(g&&x){const E=R=>T(R,x),C=R=>T(R,g);return g.addEventListener("pointerleave",E),x.addEventListener("pointerleave",C),()=>{g.removeEventListener("pointerleave",E),x.removeEventListener("pointerleave",C)}}},[g,x,T,S]),y.useEffect(()=>{if(d){const E=C=>{const R=C.target,M={x:C.clientX,y:C.clientY},z=g?.contains(R)||x?.contains(R),D=!tM(M,d);z?S():D&&(S(),m())};return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[g,x,d,m,S]),h.jsx(P0,{...n,ref:f})}),[XR,ZR]=uc(Ii,{isInside:!1}),$R=Iw("TooltipContent"),P0=y.forwardRef((n,l)=>{const{__scopeTooltip:i,children:o,"aria-label":c,onEscapeKeyDown:f,onPointerDownOutside:d,...v}=n,g=no(_r,i),m=fc(i),{onClose:x}=g;return y.useEffect(()=>(document.addEventListener(gd,x),()=>document.removeEventListener(gd,x)),[x]),y.useEffect(()=>{if(g.trigger){const p=S=>{S.target instanceof Node&&S.target.contains(g.trigger)&&x()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[g.trigger,x]),h.jsx($i,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:f,onPointerDownOutside:d,onFocusOutside:p=>p.preventDefault(),onDismiss:x,children:h.jsxs(Jd,{"data-state":g.stateAttribute,...m,...v,ref:l,style:{...v.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx($R,{children:o}),h.jsx(XR,{scope:i,isInside:!0,children:h.jsx(tE,{id:g.contentId,role:"tooltip",children:c||o})})]})})});Q0.displayName=_r;var K0="TooltipArrow",F0=y.forwardRef((n,l)=>{const{__scopeTooltip:i,...o}=n,c=fc(i);return ZR(K0,i).isInside?null:h.jsx(Wd,{...c,...o,ref:l})});F0.displayName=K0;function JR(n,l){const i=Math.abs(l.top-n.y),o=Math.abs(l.bottom-n.y),c=Math.abs(l.right-n.x),f=Math.abs(l.left-n.x);switch(Math.min(i,o,c,f)){case f:return"left";case c:return"right";case i:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function WR(n,l,i=5){const o=[];switch(l){case"top":o.push({x:n.x-i,y:n.y+i},{x:n.x+i,y:n.y+i});break;case"bottom":o.push({x:n.x-i,y:n.y-i},{x:n.x+i,y:n.y-i});break;case"left":o.push({x:n.x+i,y:n.y-i},{x:n.x+i,y:n.y+i});break;case"right":o.push({x:n.x-i,y:n.y-i},{x:n.x-i,y:n.y+i});break}return o}function eM(n){const{top:l,right:i,bottom:o,left:c}=n;return[{x:c,y:l},{x:i,y:l},{x:i,y:o},{x:c,y:o}]}function tM(n,l){const{x:i,y:o}=n;let c=!1;for(let f=0,d=l.length-1;f o!=S>o&&i<(p-m)*(o-x)/(S-x)+m&&(c=!c)}return c}function nM(n){const l=n.slice();return l.sort((i,o)=>i.x o.x?1:i.y o.y?1:0),aM(l)}function aM(n){if(n.length<=1)return n.slice();const l=[];for(let o=0;o =2;){const f=l[l.length-1],d=l[l.length-2];if((f.x-d.x)*(c.y-d.y)>=(f.y-d.y)*(c.x-d.x))l.pop();else break}l.push(c)}l.pop();const i=[];for(let o=n.length-1;o>=0;o--){const c=n[o];for(;i.length>=2;){const f=i[i.length-1],d=i[i.length-2];if((f.x-d.x)*(c.y-d.y)>=(f.y-d.y)*(c.x-d.x))i.pop();else break}i.push(c)}return i.pop(),l.length===1&&i.length===1&&l[0].x===i[0].x&&l[0].y===i[0].y?l:l.concat(i)}var lM=G0,rM=V0,iM=Y0,oM=I0,sM=Q0,cM=F0;function X0(n){var l,i,o="";if(typeof n=="string"||typeof n=="number")o+=n;else if(typeof n=="object")if(Array.isArray(n)){var c=n.length;for(l=0;l {const i=new Array(n.length+l.length);for(let o=0;o ({classGroupId:n,validator:l}),Z0=(n=new Map,l=null,i)=>({nextPart:n,validators:l,classGroupId:i}),Ps="-",ny=[],hM="arbitrary..",mM=n=>{const l=vM(n),{conflictingClassGroups:i,conflictingClassGroupModifiers:o}=n;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return pM(d);const v=d.split(Ps),g=v[0]===""&&v.length>1?1:0;return $0(v,g,l)},getConflictingClassGroupIds:(d,v)=>{if(v){const g=o[d],m=i[d];return g?m?fM(m,g):g:m||ny}return i[d]||ny}}},$0=(n,l,i)=>{if(n.length-l===0)return i.classGroupId;const c=n[l],f=i.nextPart.get(c);if(f){const m=$0(n,l+1,f);if(m)return m}const d=i.validators;if(d===null)return;const v=l===0?n.join(Ps):n.slice(l).join(Ps),g=d.length;for(let m=0;m n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const l=n.slice(1,-1),i=l.indexOf(":"),o=l.slice(0,i);return o?hM+o:void 0})(),vM=n=>{const{theme:l,classGroups:i}=n;return gM(i,l)},gM=(n,l)=>{const i=Z0();for(const o in n){const c=n[o];uh(c,i,o,l)}return i},uh=(n,l,i,o)=>{const c=n.length;for(let f=0;f {if(typeof n=="string"){bM(n,l,i);return}if(typeof n=="function"){xM(n,l,i,o);return}SM(n,l,i,o)},bM=(n,l,i)=>{const o=n===""?l:J0(l,n);o.classGroupId=i},xM=(n,l,i,o)=>{if(wM(n)){uh(n(o),l,i,o);return}l.validators===null&&(l.validators=[]),l.validators.push(dM(i,n))},SM=(n,l,i,o)=>{const c=Object.entries(n),f=c.length;for(let d=0;d {let i=n;const o=l.split(Ps),c=o.length;for(let f=0;f "isThemeGetter"in n&&n.isThemeGetter===!0,EM=n=>{if(n<1)return{get:()=>{},set:()=>{}};let l=0,i=Object.create(null),o=Object.create(null);const c=(f,d)=>{i[f]=d,l++,l>n&&(l=0,o=i,i=Object.create(null))};return{get(f){let d=i[f];if(d!==void 0)return d;if((d=o[f])!==void 0)return c(f,d),d},set(f,d){f in i?i[f]=d:c(f,d)}}},bd="!",ay=":",CM=[],ly=(n,l,i,o,c)=>({modifiers:n,hasImportantModifier:l,baseClassName:i,maybePostfixModifierPosition:o,isExternal:c}),TM=n=>{const{prefix:l,experimentalParseClassName:i}=n;let o=c=>{const f=[];let d=0,v=0,g=0,m;const x=c.length;for(let C=0;C g?m-g:void 0;return ly(f,T,S,E)};if(l){const c=l+ay,f=o;o=d=>d.startsWith(c)?f(d.slice(c.length)):ly(CM,!1,d,void 0,!0)}if(i){const c=o;o=f=>i({className:f,parseClassName:c})}return o},RM=n=>{const l=new Map;return n.orderSensitiveModifiers.forEach((i,o)=>{l.set(i,1e6+o)}),i=>{const o=[];let c=[];for(let f=0;f 0&&(c.sort(),o.push(...c),c=[]),o.push(d)):c.push(d)}return c.length>0&&(c.sort(),o.push(...c)),o}},MM=n=>({cache:EM(n.cacheSize),parseClassName:TM(n),sortModifiers:RM(n),postfixLookupClassGroupIds:jM(n),...mM(n)}),jM=n=>{const l=Object.create(null),i=n.postfixLookupClassGroups;if(i)for(let o=0;o {const{parseClassName:i,getClassGroupId:o,getConflictingClassGroupIds:c,sortModifiers:f,postfixLookupClassGroupIds:d}=l,v=[],g=n.trim().split(AM);let m="";for(let x=g.length-1;x>=0;x-=1){const p=g[x],{isExternal:S,modifiers:T,hasImportantModifier:E,baseClassName:C,maybePostfixModifierPosition:R}=i(p);if(S){m=p+(m.length>0?" "+m:m);continue}let M=!!R,z;if(M){const V=C.substring(0,R);z=o(V);const B=z&&d[z]?o(C):void 0;B&&B!==z&&(z=B,M=!1)}else z=o(C);if(!z){if(!M){m=p+(m.length>0?" "+m:m);continue}if(z=o(C),!z){m=p+(m.length>0?" "+m:m);continue}M=!1}const D=T.length===0?"":T.length===1?T[0]:f(T).join(":"),Y=E?D+bd:D,K=Y+z;if(v.indexOf(K)>-1)continue;v.push(K);const q=c(z,M);for(let V=0;V 0?" "+m:m)}return m},OM=(...n)=>{let l=0,i,o,c="";for(;l {if(typeof n=="string")return n;let l,i="";for(let o=0;o {let i,o,c,f;const d=g=>{const m=l.reduce((x,p)=>p(x),n());return i=MM(m),o=i.cache.get,c=i.cache.set,f=v,v(g)},v=g=>{const m=o(g);if(m)return m;const x=NM(g,i);return c(g,x),x};return f=d,(...g)=>f(OM(...g))},DM=[],dt=n=>{const l=i=>i[n]||DM;return l.isThemeGetter=!0,l},ex=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,tx=/^\((?:(\w[\w-]*):)?(.+)\)$/i,zM=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,kM=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,LM=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,HM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,UM=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,BM=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ha=n=>zM.test(n),Ne=n=>!!n&&!Number.isNaN(Number(n)),kn=n=>!!n&&Number.isInteger(Number(n)),Qf=n=>n.endsWith("%")&&Ne(n.slice(0,-1)),ia=n=>kM.test(n),nx=()=>!0,qM=n=>LM.test(n)&&!HM.test(n),fh=()=>!1,GM=n=>UM.test(n),VM=n=>BM.test(n),YM=n=>!de(n)&&!he(n),IM=n=>n.startsWith("@container")&&(n[10]==="/"&&n[11]!==void 0||n[11]==="s"&&n[16]!==void 0&&n.startsWith("-size/",10)||n[11]==="n"&&n[18]!==void 0&&n.startsWith("-normal/",10)),QM=n=>Xa(n,rx,fh),de=n=>ex.test(n),xl=n=>Xa(n,ix,qM),ry=n=>Xa(n,WM,Ne),PM=n=>Xa(n,sx,nx),KM=n=>Xa(n,ox,fh),iy=n=>Xa(n,ax,fh),FM=n=>Xa(n,lx,VM),js=n=>Xa(n,cx,GM),he=n=>tx.test(n),_i=n=>Al(n,ix),XM=n=>Al(n,ox),oy=n=>Al(n,ax),ZM=n=>Al(n,rx),$M=n=>Al(n,lx),As=n=>Al(n,cx,!0),JM=n=>Al(n,sx,!0),Xa=(n,l,i)=>{const o=ex.exec(n);return o?o[1]?l(o[1]):i(o[2]):!1},Al=(n,l,i=!1)=>{const o=tx.exec(n);return o?o[1]?l(o[1]):i:!1},ax=n=>n==="position"||n==="percentage",lx=n=>n==="image"||n==="url",rx=n=>n==="length"||n==="size"||n==="bg-size",ix=n=>n==="length",WM=n=>n==="number",ox=n=>n==="family-name",sx=n=>n==="number"||n==="weight",cx=n=>n==="shadow",ej=()=>{const n=dt("color"),l=dt("font"),i=dt("text"),o=dt("font-weight"),c=dt("tracking"),f=dt("leading"),d=dt("breakpoint"),v=dt("container"),g=dt("spacing"),m=dt("radius"),x=dt("shadow"),p=dt("inset-shadow"),S=dt("text-shadow"),T=dt("drop-shadow"),E=dt("blur"),C=dt("perspective"),R=dt("aspect"),M=dt("ease"),z=dt("animate"),D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],K=()=>[...Y(),he,de],q=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto","contain","none"],B=()=>[he,de,g],oe=()=>[Ha,"full","auto",...B()],se=()=>[kn,"none","subgrid",he,de],le=()=>["auto",{span:["full",kn,he,de]},kn,he,de],ce=()=>[kn,"auto",he,de],ue=()=>["auto","min","max","fr",he,de],ve=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],fe=()=>["start","end","center","stretch","center-safe","end-safe"],O=()=>["auto",...B()],F=()=>[Ha,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...B()],W=()=>[Ha,"screen","full","dvw","lvw","svw","min","max","fit",...B()],ee=()=>[Ha,"screen","full","lh","dvh","lvh","svh","min","max","fit",...B()],$=()=>[n,he,de],A=()=>[...Y(),oy,iy,{position:[he,de]}],j=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",ZM,QM,{size:[he,de]}],Q=()=>[Qf,_i,xl],I=()=>["","none","full",m,he,de],te=()=>["",Ne,_i,xl],Z=()=>["solid","dashed","dotted","double"],ae=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[Ne,Qf,oy,iy],xe=()=>["","none",E,he,de],Re=()=>["none",Ne,he,de],je=()=>["none",Ne,he,de],et=()=>[Ne,he,de],Ge=()=>[Ha,"full",...B()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ia],breakpoint:[ia],color:[nx],container:[ia],"drop-shadow":[ia],ease:["in","out","in-out"],font:[YM],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ia],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ia],shadow:[ia],spacing:["px",Ne],text:[ia],"text-shadow":[ia],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ha,de,he,R]}],container:["container"],"container-type":[{"@container":["","normal","size",he,de]}],"container-named":[IM],columns:[{columns:[Ne,de,he,v]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:K()}],overflow:[{overflow:q()}],"overflow-x":[{"overflow-x":q()}],"overflow-y":[{"overflow-y":q()}],overscroll:[{overscroll:V()}],"overscroll-x":[{"overscroll-x":V()}],"overscroll-y":[{"overscroll-y":V()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:oe()}],"inset-x":[{"inset-x":oe()}],"inset-y":[{"inset-y":oe()}],start:[{"inset-s":oe(),start:oe()}],end:[{"inset-e":oe(),end:oe()}],"inset-bs":[{"inset-bs":oe()}],"inset-be":[{"inset-be":oe()}],top:[{top:oe()}],right:[{right:oe()}],bottom:[{bottom:oe()}],left:[{left:oe()}],visibility:["visible","invisible","collapse"],z:[{z:[kn,"auto",he,de]}],basis:[{basis:[Ha,"full","auto",v,...B()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ne,Ha,"auto","initial","none",de]}],grow:[{grow:["",Ne,he,de]}],shrink:[{shrink:["",Ne,he,de]}],order:[{order:[kn,"first","last","none",he,de]}],"grid-cols":[{"grid-cols":se()}],"col-start-end":[{col:le()}],"col-start":[{"col-start":ce()}],"col-end":[{"col-end":ce()}],"grid-rows":[{"grid-rows":se()}],"row-start-end":[{row:le()}],"row-start":[{"row-start":ce()}],"row-end":[{"row-end":ce()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ue()}],"auto-rows":[{"auto-rows":ue()}],gap:[{gap:B()}],"gap-x":[{"gap-x":B()}],"gap-y":[{"gap-y":B()}],"justify-content":[{justify:[...ve(),"normal"]}],"justify-items":[{"justify-items":[...fe(),"normal"]}],"justify-self":[{"justify-self":["auto",...fe()]}],"align-content":[{content:["normal",...ve()]}],"align-items":[{items:[...fe(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...fe(),{baseline:["","last"]}]}],"place-content":[{"place-content":ve()}],"place-items":[{"place-items":[...fe(),"baseline"]}],"place-self":[{"place-self":["auto",...fe()]}],p:[{p:B()}],px:[{px:B()}],py:[{py:B()}],ps:[{ps:B()}],pe:[{pe:B()}],pbs:[{pbs:B()}],pbe:[{pbe:B()}],pt:[{pt:B()}],pr:[{pr:B()}],pb:[{pb:B()}],pl:[{pl:B()}],m:[{m:O()}],mx:[{mx:O()}],my:[{my:O()}],ms:[{ms:O()}],me:[{me:O()}],mbs:[{mbs:O()}],mbe:[{mbe:O()}],mt:[{mt:O()}],mr:[{mr:O()}],mb:[{mb:O()}],ml:[{ml:O()}],"space-x":[{"space-x":B()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":B()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],"inline-size":[{inline:["auto",...W()]}],"min-inline-size":[{"min-inline":["auto",...W()]}],"max-inline-size":[{"max-inline":["none",...W()]}],"block-size":[{block:["auto",...ee()]}],"min-block-size":[{"min-block":["auto",...ee()]}],"max-block-size":[{"max-block":["none",...ee()]}],w:[{w:[v,"screen",...F()]}],"min-w":[{"min-w":[v,"screen","none",...F()]}],"max-w":[{"max-w":[v,"screen","none","prose",{screen:[d]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh",...F()]}],"font-size":[{text:["base",i,_i,xl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,JM,PM]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Qf,de]}],"font-family":[{font:[XM,KM,l]}],"font-features":[{"font-features":[de]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[c,he,de]}],"line-clamp":[{"line-clamp":[Ne,"none",he,ry]}],leading:[{leading:[f,...B()]}],"list-image":[{"list-image":["none",he,de]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",he,de]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ne,"from-font","auto",he,xl]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[Ne,"auto",he,de]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"tab-size":[{tab:[kn,he,de]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he,de]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",he,de]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:A()}],"bg-repeat":[{bg:j()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},kn,he,de],radial:["",he,de],conic:[kn,he,de]},$M,FM]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:I()}],"rounded-s":[{"rounded-s":I()}],"rounded-e":[{"rounded-e":I()}],"rounded-t":[{"rounded-t":I()}],"rounded-r":[{"rounded-r":I()}],"rounded-b":[{"rounded-b":I()}],"rounded-l":[{"rounded-l":I()}],"rounded-ss":[{"rounded-ss":I()}],"rounded-se":[{"rounded-se":I()}],"rounded-ee":[{"rounded-ee":I()}],"rounded-es":[{"rounded-es":I()}],"rounded-tl":[{"rounded-tl":I()}],"rounded-tr":[{"rounded-tr":I()}],"rounded-br":[{"rounded-br":I()}],"rounded-bl":[{"rounded-bl":I()}],"border-w":[{border:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-bs":[{"border-bs":te()}],"border-w-be":[{"border-be":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Z(),"hidden","none"]}],"divide-style":[{divide:[...Z(),"hidden","none"]}],"border-color":[{border:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-bs":[{"border-bs":$()}],"border-color-be":[{"border-be":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...Z(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ne,he,de]}],"outline-w":[{outline:["",Ne,_i,xl]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",x,As,js]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",p,As,js]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[Ne,xl]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",S,As,js]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[Ne,he,de]}],"mix-blend":[{"mix-blend":[...ae(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ae()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ne]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[he,de]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":$()}],"mask-image-radial-to-color":[{"mask-radial-to":$()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":Y()}],"mask-image-conic-pos":[{"mask-conic":[Ne]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":$()}],"mask-image-conic-to-color":[{"mask-conic-to":$()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:A()}],"mask-repeat":[{mask:j()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",he,de]}],filter:[{filter:["","none",he,de]}],blur:[{blur:xe()}],brightness:[{brightness:[Ne,he,de]}],contrast:[{contrast:[Ne,he,de]}],"drop-shadow":[{"drop-shadow":["","none",T,As,js]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",Ne,he,de]}],"hue-rotate":[{"hue-rotate":[Ne,he,de]}],invert:[{invert:["",Ne,he,de]}],saturate:[{saturate:[Ne,he,de]}],sepia:[{sepia:["",Ne,he,de]}],"backdrop-filter":[{"backdrop-filter":["","none",he,de]}],"backdrop-blur":[{"backdrop-blur":xe()}],"backdrop-brightness":[{"backdrop-brightness":[Ne,he,de]}],"backdrop-contrast":[{"backdrop-contrast":[Ne,he,de]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ne,he,de]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ne,he,de]}],"backdrop-invert":[{"backdrop-invert":["",Ne,he,de]}],"backdrop-opacity":[{"backdrop-opacity":[Ne,he,de]}],"backdrop-saturate":[{"backdrop-saturate":[Ne,he,de]}],"backdrop-sepia":[{"backdrop-sepia":["",Ne,he,de]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":B()}],"border-spacing-x":[{"border-spacing-x":B()}],"border-spacing-y":[{"border-spacing-y":B()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",he,de]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ne,"initial",he,de]}],ease:[{ease:["linear","initial",M,he,de]}],delay:[{delay:[Ne,he,de]}],animate:[{animate:["none",z,he,de]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,he,de]}],"perspective-origin":[{"perspective-origin":K()}],rotate:[{rotate:Re()}],"rotate-x":[{"rotate-x":Re()}],"rotate-y":[{"rotate-y":Re()}],"rotate-z":[{"rotate-z":Re()}],scale:[{scale:je()}],"scale-x":[{"scale-x":je()}],"scale-y":[{"scale-y":je()}],"scale-z":[{"scale-z":je()}],"scale-3d":["scale-3d"],skew:[{skew:et()}],"skew-x":[{"skew-x":et()}],"skew-y":[{"skew-y":et()}],transform:[{transform:[he,de,"","none","gpu","cpu"]}],"transform-origin":[{origin:K()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ge()}],"translate-x":[{"translate-x":Ge()}],"translate-y":[{"translate-y":Ge()}],"translate-z":[{"translate-z":Ge()}],"translate-none":["translate-none"],zoom:[{zoom:[kn,he,de]}],accent:[{accent:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",he,de]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":$()}],"scrollbar-track-color":[{"scrollbar-track":$()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mbs":[{"scroll-mbs":B()}],"scroll-mbe":[{"scroll-mbe":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pbs":[{"scroll-pbs":B()}],"scroll-pbe":[{"scroll-pbe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",he,de]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[Ne,_i,xl,ry]}],stroke:[{stroke:["none",...$()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},tj=_M(ej);function Rt(...n){return tj(uM(n))}function nj({delayDuration:n=0,...l}){return h.jsx(lM,{"data-slot":"tooltip-provider",delayDuration:n,...l})}function aj({...n}){return h.jsx(rM,{"data-slot":"tooltip",...n})}function lj({...n}){return h.jsx(iM,{"data-slot":"tooltip-trigger",...n})}function rj({className:n,sideOffset:l=0,children:i,...o}){return h.jsx(oM,{children:h.jsxs(sM,{"data-slot":"tooltip-content",sideOffset:l,className:Rt("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-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-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",n),...o,children:[i,h.jsx(cM,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}const xd=new Set;function ij(n){return xd.add(n),()=>xd.delete(n)}function oj(){for(const n of xd)n()}const ux=(...n)=>n.filter((l,i,o)=>!!l&&l.trim()!==""&&o.indexOf(l)===i).join(" ").trim();const sj=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const cj=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(l,i,o)=>o?o.toUpperCase():i.toLowerCase());const sy=n=>{const l=cj(n);return l.charAt(0).toUpperCase()+l.slice(1)};var Pf={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const uj=n=>{for(const l in n)if(l.startsWith("aria-")||l==="role"||l==="title")return!0;return!1},fj=y.createContext({}),dj=()=>y.useContext(fj),hj=y.forwardRef(({color:n,size:l,strokeWidth:i,absoluteStrokeWidth:o,className:c="",children:f,iconNode:d,...v},g)=>{const{size:m=24,strokeWidth:x=2,absoluteStrokeWidth:p=!1,color:S="currentColor",className:T=""}=dj()??{},E=o??p?Number(i??x)*24/Number(l??m):i??x;return y.createElement("svg",{ref:g,...Pf,width:l??m??Pf.width,height:l??m??Pf.height,stroke:n??S,strokeWidth:E,className:ux("lucide",T,c),...!f&&!uj(v)&&{"aria-hidden":"true"},...v},[...d.map(([C,R])=>y.createElement(C,R)),...Array.isArray(f)?f:[f]])});const qe=(n,l)=>{const i=y.forwardRef(({className:o,...c},f)=>y.createElement(hj,{ref:f,iconNode:l,className:ux(`lucide-${sj(sy(n))}`,`lucide-${n}`,o),...c}));return i.displayName=sy(n),i};const mj=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],fx=qe("check",mj);const pj=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],dh=qe("chevron-down",pj);const vj=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],gj=qe("chevron-right",vj);const yj=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],bj=qe("chevron-up",yj);const xj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Sj=qe("circle-check",xj);const wj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Ej=qe("clock",wj);const Cj=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Tj=qe("copy",Cj);const Rj=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Mj=qe("download",Rj);const jj=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Aj=qe("ellipsis",jj);const Nj=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Oj=qe("file-text",Nj);const _j=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Dj=qe("folder",_j);const zj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],kj=qe("globe",zj);const Lj=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Hj=qe("history",Lj);const Uj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Bj=qe("info",Uj);const qj=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],Gj=qe("layout-dashboard",qj);const Vj=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],Yj=qe("link",Vj);const Ij=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Qj=qe("loader-circle",Ij);const Pj=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Kj=qe("lock",Pj);const Fj=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Xj=qe("log-out",Fj);const Zj=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],$j=qe("menu",Zj);const Jj=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Wj=qe("octagon-x",Jj);const eA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],tA=qe("plus",eA);const nA=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],dx=qe("search",nA);const aA=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],lA=qe("settings",aA);const rA=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],iA=qe("share-2",rA);const oA=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],sA=qe("shield",oA);const cA=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],uA=qe("square-terminal",cA);const fA=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],dA=qe("trash-2",fA);const hA=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],hx=qe("triangle-alert",hA);const mA=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],pA=qe("upload",mA);const vA=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],gA=qe("users",vA);const yA=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],mx=qe("x",yA);function bA(){document.body.classList.toggle("sb-open")}function Rn(){document.body.classList.remove("sb-open")}const xA={alert:hx,check:fx,chev:gj,chevd:dh,clock:Ej,copy:Tj,doc:Oj,dots:Aj,download:Mj,folder:Dj,dashboard:Gj,gear:lA,globe:kj,hist:Hj,link:Yj,lock:Kj,menu:$j,plus:tA,power:Xj,search:dx,share:iA,shield:sA,terminal:uA,trash:dA,upload:pA,users:gA,x:mx};function gt({name:n}){const l=xA[n];return l?h.jsx(l,{className:"ico","aria-hidden":"true"}):null}function Qi(n){return h.jsxs(h.Fragment,{children:[h.jsx("div",{id:"sb-backdrop",onClick:Rn}),h.jsxs("aside",{id:"sidebar",children:[n.vault,n.projectsNav,n.tree??h.jsx("nav",{id:"tree","aria-label":"Files"}),n.orgBar]}),h.jsxs("main",{id:"main",children:[n.topbar,h.jsx("article",{id:"content",className:n.contentClass??"markdown",ref:n.contentRef,onScroll:n.onContentScroll,children:n.children})]})]})}function dc(n){const{name:l,onHome:i,showSignout:o,search:c}=n;return h.jsxs("header",{id:"vault",children:[h.jsx("span",{id:"vault-badge","aria-hidden":"true",children:"🐻"}),h.jsx("span",{id:"vault-name",className:i?"vault-link":void 0,onClick:i,role:i?"button":void 0,tabIndex:i?0:void 0,onKeyDown:f=>{i&&(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),i())},children:l}),h.jsxs("div",{className:"vault-actions",children:[c&&h.jsxs(aj,{delayDuration:150,children:[h.jsx(lj,{asChild:!0,children:h.jsx("button",{id:"search-btn",className:"icon-btn2","aria-label":"Search",onClick:()=>{oj(),Rn()},children:h.jsx(gt,{name:"search"})})}),h.jsxs(rj,{className:"tipcard",sideOffset:6,children:["Search ",h.jsx("kbd",{children:"⌘K"})]})]}),o&&h.jsx("a",{id:"signout",href:"/auth/logout",title:"Sign out","aria-label":"Sign out",children:h.jsx(gt,{name:"power"})})]})]})}function Pi(n){return h.jsxs("header",{id:"topbar",children:[h.jsx("button",{id:"menu-btn",className:"icon-btn",title:"Menu","aria-label":"Menu",onClick:bA,children:h.jsx(gt,{name:"menu"})}),h.jsx("span",{id:"crumb",children:n.crumb}),h.jsx("span",{id:"meta",children:n.meta}),n.actions]})}function SA(n){if(typeof document>"u")return;let l=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",l.appendChild(i),i.styleSheet?i.styleSheet.cssText=n:i.appendChild(document.createTextNode(n))}const wA=n=>{switch(n){case"success":return TA;case"info":return MA;case"warning":return RA;case"error":return jA;default:return null}},EA=Array(12).fill(0),CA=({visible:n,className:l})=>ie.createElement("div",{className:["sonner-loading-wrapper",l].filter(Boolean).join(" "),"data-visible":n},ie.createElement("div",{className:"sonner-spinner"},EA.map((i,o)=>ie.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),TA=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ie.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),RA=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ie.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),MA=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ie.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),jA=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ie.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),AA=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ie.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ie.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),NA=()=>{const[n,l]=ie.useState(document.hidden);return ie.useEffect(()=>{const i=()=>{l(document.hidden)};return document.addEventListener("visibilitychange",i),()=>window.removeEventListener("visibilitychange",i)},[]),n};let Sd=1;class OA{constructor(){this.subscribe=l=>(this.subscribers.push(l),()=>{const i=this.subscribers.indexOf(l);this.subscribers.splice(i,1)}),this.publish=l=>{this.subscribers.forEach(i=>i(l))},this.addToast=l=>{this.publish(l),this.toasts=[...this.toasts,l]},this.create=l=>{var i;const{message:o,...c}=l,f=typeof l?.id=="number"||((i=l.id)==null?void 0:i.length)>0?l.id:Sd++,d=this.toasts.find(g=>g.id===f),v=l.dismissible===void 0?!0:l.dismissible;return this.dismissedToasts.has(f)&&this.dismissedToasts.delete(f),d?this.toasts=this.toasts.map(g=>g.id===f?(this.publish({...g,...l,id:f,title:o}),{...g,...l,id:f,dismissible:v,title:o}):g):this.addToast({title:o,...c,dismissible:v,id:f}),f},this.dismiss=l=>(l?(this.dismissedToasts.add(l),requestAnimationFrame(()=>this.subscribers.forEach(i=>i({id:l,dismiss:!0})))):this.toasts.forEach(i=>{this.subscribers.forEach(o=>o({id:i.id,dismiss:!0}))}),l),this.message=(l,i)=>this.create({...i,message:l}),this.error=(l,i)=>this.create({...i,message:l,type:"error"}),this.success=(l,i)=>this.create({...i,type:"success",message:l}),this.info=(l,i)=>this.create({...i,type:"info",message:l}),this.warning=(l,i)=>this.create({...i,type:"warning",message:l}),this.loading=(l,i)=>this.create({...i,type:"loading",message:l}),this.promise=(l,i)=>{if(!i)return;let o;i.loading!==void 0&&(o=this.create({...i,promise:l,type:"loading",message:i.loading,description:typeof i.description!="function"?i.description:void 0}));const c=Promise.resolve(l instanceof Function?l():l);let f=o!==void 0,d;const v=c.then(async m=>{if(d=["resolve",m],ie.isValidElement(m))f=!1,this.create({id:o,type:"default",message:m});else if(DA(m)&&!m.ok){f=!1;const p=typeof i.error=="function"?await i.error(`HTTP error! status: ${m.status}`):i.error,S=typeof i.description=="function"?await i.description(`HTTP error! status: ${m.status}`):i.description,E=typeof p=="object"&&!ie.isValidElement(p)?p:{message:p};this.create({id:o,type:"error",description:S,...E})}else if(m instanceof Error){f=!1;const p=typeof i.error=="function"?await i.error(m):i.error,S=typeof i.description=="function"?await i.description(m):i.description,E=typeof p=="object"&&!ie.isValidElement(p)?p:{message:p};this.create({id:o,type:"error",description:S,...E})}else if(i.success!==void 0){f=!1;const p=typeof i.success=="function"?await i.success(m):i.success,S=typeof i.description=="function"?await i.description(m):i.description,E=typeof p=="object"&&!ie.isValidElement(p)?p:{message:p};this.create({id:o,type:"success",description:S,...E})}}).catch(async m=>{if(d=["reject",m],i.error!==void 0){f=!1;const x=typeof i.error=="function"?await i.error(m):i.error,p=typeof i.description=="function"?await i.description(m):i.description,T=typeof x=="object"&&!ie.isValidElement(x)?x:{message:x};this.create({id:o,type:"error",description:p,...T})}}).finally(()=>{f&&(this.dismiss(o),o=void 0),i.finally==null||i.finally.call(i)}),g=()=>new Promise((m,x)=>v.then(()=>d[0]==="reject"?x(d[1]):m(d[1])).catch(x));return typeof o!="string"&&typeof o!="number"?{unwrap:g}:Object.assign(o,{unwrap:g})},this.custom=(l,i)=>{const o=i?.id||Sd++;return this.create({jsx:l(o),id:o,...i}),o},this.getActiveToasts=()=>this.toasts.filter(l=>!this.dismissedToasts.has(l.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Pt=new OA,_A=(n,l)=>{const i=l?.id||Sd++;return Pt.addToast({title:n,...l,id:i}),i},DA=n=>n&&typeof n=="object"&&"ok"in n&&typeof n.ok=="boolean"&&"status"in n&&typeof n.status=="number",zA=_A,kA=()=>Pt.toasts,LA=()=>Pt.getActiveToasts(),cy=Object.assign(zA,{success:Pt.success,info:Pt.info,warning:Pt.warning,error:Pt.error,custom:Pt.custom,message:Pt.message,promise:Pt.promise,dismiss:Pt.dismiss,loading:Pt.loading},{getHistory:kA,getToasts:LA});SA("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Ns(n){return n.label!==void 0}const HA=3,UA="24px",BA="16px",uy=4e3,qA=356,GA=14,VA=45,YA=200;function Ln(...n){return n.filter(Boolean).join(" ")}function IA(n){const[l,i]=n.split("-"),o=[];return l&&o.push(l),i&&o.push(i),o}const QA=n=>{var l,i,o,c,f,d,v,g,m;const{invert:x,toast:p,unstyled:S,interacting:T,setHeights:E,visibleToasts:C,heights:R,index:M,toasts:z,expanded:D,removeToast:Y,defaultRichColors:K,closeButton:q,style:V,cancelButtonStyle:B,actionButtonStyle:oe,className:se="",descriptionClassName:le="",duration:ce,position:ue,gap:ve,expandByDefault:fe,classNames:O,icons:F,closeButtonAriaLabel:W="Close toast"}=n,[ee,$]=ie.useState(null),[A,j]=ie.useState(null),[L,Q]=ie.useState(!1),[I,te]=ie.useState(!1),[Z,ae]=ie.useState(!1),[re,xe]=ie.useState(!1),[Re,je]=ie.useState(!1),[et,Ge]=ie.useState(0),[kt,ht]=ie.useState(0),nt=ie.useRef(p.duration||ce||uy),Za=ie.useRef(null),Ot=ie.useRef(null),Ee=M===0,ke=M+1<=C,Ae=p.type,on=p.dismissible!==!1,bt=p.className||"",Hr=p.descriptionClassName||"",$a=ie.useMemo(()=>R.findIndex(Se=>Se.toastId===p.id)||0,[R,p.id]),ro=ie.useMemo(()=>{var Se;return(Se=p.closeButton)!=null?Se:q},[p.closeButton,q]),Ja=ie.useMemo(()=>p.duration||ce||uy,[p.duration,ce]),Ur=ie.useRef(0),Gn=ie.useRef(0),io=ie.useRef(0),fa=ie.useRef(null),[Wa,_t]=ue.split("-"),xn=ie.useMemo(()=>R.reduce((Se,Je,mt)=>mt>=$a?Se:Se+Je.height,0),[R,$a]),Mt=NA(),vc=p.invert||x,Br=Ae==="loading";Gn.current=ie.useMemo(()=>$a*ve+xn,[$a,xn]),ie.useEffect(()=>{nt.current=Ja},[Ja]),ie.useEffect(()=>{Q(!0)},[]),ie.useEffect(()=>{const Se=Ot.current;if(Se){const Je=Se.getBoundingClientRect().height;return ht(Je),E(mt=>[{toastId:p.id,height:Je,position:p.position},...mt]),()=>E(mt=>mt.filter(jt=>jt.toastId!==p.id))}},[E,p.id]),ie.useLayoutEffect(()=>{if(!L)return;const Se=Ot.current,Je=Se.style.height;Se.style.height="auto";const mt=Se.getBoundingClientRect().height;Se.style.height=Je,ht(mt),E(jt=>jt.find(tt=>tt.toastId===p.id)?jt.map(tt=>tt.toastId===p.id?{...tt,height:mt}:tt):[{toastId:p.id,height:mt,position:p.position},...jt])},[L,p.title,p.description,E,p.id,p.jsx,p.action,p.cancel]);const An=ie.useCallback(()=>{te(!0),Ge(Gn.current),E(Se=>Se.filter(Je=>Je.toastId!==p.id)),setTimeout(()=>{Y(p)},YA)},[p,Y,E,Gn]);ie.useEffect(()=>{if(p.promise&&Ae==="loading"||p.duration===1/0||p.type==="loading")return;let Se;return D||T||Mt?(()=>{if(io.current {p.onAutoClose==null||p.onAutoClose.call(p,p),An()},nt.current)),()=>clearTimeout(Se)},[D,T,p,Ae,Mt,An]),ie.useEffect(()=>{p.delete&&(An(),p.onDismiss==null||p.onDismiss.call(p,p))},[An,p.delete]);function Nl(){var Se;if(F?.loading){var Je;return ie.createElement("div",{className:Ln(O?.loader,p==null||(Je=p.classNames)==null?void 0:Je.loader,"sonner-loader"),"data-visible":Ae==="loading"},F.loading)}return ie.createElement(CA,{className:Ln(O?.loader,p==null||(Se=p.classNames)==null?void 0:Se.loader),visible:Ae==="loading"})}const Ol=p.icon||F?.[Ae]||wA(Ae);var el,Nn;return ie.createElement("li",{tabIndex:0,ref:Ot,className:Ln(se,bt,O?.toast,p==null||(l=p.classNames)==null?void 0:l.toast,O?.default,O?.[Ae],p==null||(i=p.classNames)==null?void 0:i[Ae]),"data-sonner-toast":"","data-rich-colors":(el=p.richColors)!=null?el:K,"data-styled":!(p.jsx||p.unstyled||S),"data-mounted":L,"data-promise":!!p.promise,"data-swiped":Re,"data-removed":I,"data-visible":ke,"data-y-position":Wa,"data-x-position":_t,"data-index":M,"data-front":Ee,"data-swiping":Z,"data-dismissible":on,"data-type":Ae,"data-invert":vc,"data-swipe-out":re,"data-swipe-direction":A,"data-expanded":!!(D||fe&&L),"data-testid":p.testId,style:{"--index":M,"--toasts-before":M,"--z-index":z.length-M,"--offset":`${I?et:Gn.current}px`,"--initial-height":fe?"auto":`${kt}px`,...V,...p.style},onDragEnd:()=>{ae(!1),$(null),fa.current=null},onPointerDown:Se=>{Se.button!==2&&(Br||!on||(Za.current=new Date,Ge(Gn.current),Se.target.setPointerCapture(Se.pointerId),Se.target.tagName!=="BUTTON"&&(ae(!0),fa.current={x:Se.clientX,y:Se.clientY})))},onPointerUp:()=>{var Se,Je,mt;if(re||!on)return;fa.current=null;const jt=Number(((Se=Ot.current)==null?void 0:Se.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),da=Number(((Je=Ot.current)==null?void 0:Je.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),tt=new Date().getTime()-((mt=Za.current)==null?void 0:mt.getTime()),Lt=ee==="x"?jt:da,tl=Math.abs(Lt)/tt;if(Math.abs(Lt)>=VA||tl>.11){Ge(Gn.current),p.onDismiss==null||p.onDismiss.call(p,p),j(ee==="x"?jt>0?"right":"left":da>0?"down":"up"),An(),xe(!0);return}else{var Ht,Ut;(Ht=Ot.current)==null||Ht.style.setProperty("--swipe-amount-x","0px"),(Ut=Ot.current)==null||Ut.style.setProperty("--swipe-amount-y","0px")}je(!1),ae(!1),$(null)},onPointerMove:Se=>{var Je,mt,jt;if(!fa.current||!on||((Je=window.getSelection())==null?void 0:Je.toString().length)>0)return;const tt=Se.clientY-fa.current.y,Lt=Se.clientX-fa.current.x;var tl;const Ht=(tl=n.swipeDirections)!=null?tl:IA(ue);!ee&&(Math.abs(Lt)>1||Math.abs(tt)>1)&&$(Math.abs(Lt)>Math.abs(tt)?"x":"y");let Ut={x:0,y:0};const _l=Sn=>1/(1.5+Math.abs(Sn)/20);if(ee==="y"){if(Ht.includes("top")||Ht.includes("bottom"))if(Ht.includes("top")&&tt<0||Ht.includes("bottom")&&tt>0)Ut.y=tt;else{const Sn=tt*_l(tt);Ut.y=Math.abs(Sn) 0)Ut.x=Lt;else{const Sn=Lt*_l(Lt);Ut.x=Math.abs(Sn) 0||Math.abs(Ut.y)>0)&&je(!0),(mt=Ot.current)==null||mt.style.setProperty("--swipe-amount-x",`${Ut.x}px`),(jt=Ot.current)==null||jt.style.setProperty("--swipe-amount-y",`${Ut.y}px`)}},ro&&!p.jsx&&Ae!=="loading"?ie.createElement("button",{"aria-label":W,"data-disabled":Br,"data-close-button":!0,onClick:Br||!on?()=>{}:()=>{An(),p.onDismiss==null||p.onDismiss.call(p,p)},className:Ln(O?.closeButton,p==null||(o=p.classNames)==null?void 0:o.closeButton)},(Nn=F?.close)!=null?Nn:AA):null,(Ae||p.icon||p.promise)&&p.icon!==null&&(F?.[Ae]!==null||p.icon)?ie.createElement("div",{"data-icon":"",className:Ln(O?.icon,p==null||(c=p.classNames)==null?void 0:c.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||Nl():null,p.type!=="loading"?Ol:null):null,ie.createElement("div",{"data-content":"",className:Ln(O?.content,p==null||(f=p.classNames)==null?void 0:f.content)},ie.createElement("div",{"data-title":"",className:Ln(O?.title,p==null||(d=p.classNames)==null?void 0:d.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?ie.createElement("div",{"data-description":"",className:Ln(le,Hr,O?.description,p==null||(v=p.classNames)==null?void 0:v.description)},typeof p.description=="function"?p.description():p.description):null),ie.isValidElement(p.cancel)?p.cancel:p.cancel&&Ns(p.cancel)?ie.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||B,onClick:Se=>{Ns(p.cancel)&&on&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Se),An())},className:Ln(O?.cancelButton,p==null||(g=p.classNames)==null?void 0:g.cancelButton)},p.cancel.label):null,ie.isValidElement(p.action)?p.action:p.action&&Ns(p.action)?ie.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||oe,onClick:Se=>{Ns(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Se),!Se.defaultPrevented&&An())},className:Ln(O?.actionButton,p==null||(m=p.classNames)==null?void 0:m.actionButton)},p.action.label):null)};function fy(){if(typeof window>"u"||typeof document>"u")return"ltr";const n=document.documentElement.getAttribute("dir");return n==="auto"||!n?window.getComputedStyle(document.documentElement).direction:n}function PA(n,l){const i={};return[n,l].forEach((o,c)=>{const f=c===1,d=f?"--mobile-offset":"--offset",v=f?BA:UA;function g(m){["top","right","bottom","left"].forEach(x=>{i[`${d}-${x}`]=typeof m=="number"?`${m}px`:m})}typeof o=="number"||typeof o=="string"?g(o):typeof o=="object"?["top","right","bottom","left"].forEach(m=>{o[m]===void 0?i[`${d}-${m}`]=v:i[`${d}-${m}`]=typeof o[m]=="number"?`${o[m]}px`:o[m]}):g(v)}),i}const KA=ie.forwardRef(function(l,i){const{id:o,invert:c,position:f="bottom-right",hotkey:d=["altKey","KeyT"],expand:v,closeButton:g,className:m,offset:x,mobileOffset:p,theme:S="light",richColors:T,duration:E,style:C,visibleToasts:R=HA,toastOptions:M,dir:z=fy(),gap:D=GA,icons:Y,containerAriaLabel:K="Notifications"}=l,[q,V]=ie.useState([]),B=ie.useMemo(()=>o?q.filter(L=>L.toasterId===o):q.filter(L=>!L.toasterId),[q,o]),oe=ie.useMemo(()=>Array.from(new Set([f].concat(B.filter(L=>L.position).map(L=>L.position)))),[B,f]),[se,le]=ie.useState([]),[ce,ue]=ie.useState(!1),[ve,fe]=ie.useState(!1),[O,F]=ie.useState(S!=="system"?S:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=ie.useRef(null),ee=d.join("+").replace(/Key/g,"").replace(/Digit/g,""),$=ie.useRef(null),A=ie.useRef(!1),j=ie.useCallback(L=>{V(Q=>{var I;return(I=Q.find(te=>te.id===L.id))!=null&&I.delete||Pt.dismiss(L.id),Q.filter(({id:te})=>te!==L.id)})},[]);return ie.useEffect(()=>Pt.subscribe(L=>{if(L.dismiss){requestAnimationFrame(()=>{V(Q=>Q.map(I=>I.id===L.id?{...I,delete:!0}:I))});return}setTimeout(()=>{Yw.flushSync(()=>{V(Q=>{const I=Q.findIndex(te=>te.id===L.id);return I!==-1?[...Q.slice(0,I),{...Q[I],...L},...Q.slice(I+1)]:[L,...Q]})})})}),[q]),ie.useEffect(()=>{if(S!=="system"){F(S);return}if(S==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?F("dark"):F("light")),typeof window>"u")return;const L=window.matchMedia("(prefers-color-scheme: dark)");try{L.addEventListener("change",({matches:Q})=>{F(Q?"dark":"light")})}catch{L.addListener(({matches:I})=>{try{F(I?"dark":"light")}catch(te){console.error(te)}})}},[S]),ie.useEffect(()=>{q.length<=1&&ue(!1)},[q]),ie.useEffect(()=>{const L=Q=>{var I;if(d.every(ae=>Q[ae]||Q.code===ae)){var Z;ue(!0),(Z=W.current)==null||Z.focus()}Q.code==="Escape"&&(document.activeElement===W.current||(I=W.current)!=null&&I.contains(document.activeElement))&&ue(!1)};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[d]),ie.useEffect(()=>{if(W.current)return()=>{$.current&&($.current.focus({preventScroll:!0}),$.current=null,A.current=!1)}},[W.current]),ie.createElement("section",{ref:i,"aria-label":`${K} ${ee}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},oe.map((L,Q)=>{var I;const[te,Z]=L.split("-");return B.length?ie.createElement("ol",{key:L,dir:z==="auto"?fy():z,tabIndex:-1,ref:W,className:m,"data-sonner-toaster":!0,"data-sonner-theme":O,"data-y-position":te,"data-x-position":Z,style:{"--front-toast-height":`${((I=se[0])==null?void 0:I.height)||0}px`,"--width":`${qA}px`,"--gap":`${D}px`,...C,...PA(x,p)},onBlur:ae=>{A.current&&!ae.currentTarget.contains(ae.relatedTarget)&&(A.current=!1,$.current&&($.current.focus({preventScroll:!0}),$.current=null))},onFocus:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||A.current||(A.current=!0,$.current=ae.relatedTarget)},onMouseEnter:()=>ue(!0),onMouseMove:()=>ue(!0),onMouseLeave:()=>{ve||ue(!1)},onDragEnd:()=>ue(!1),onPointerDown:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||fe(!0)},onPointerUp:()=>fe(!1)},B.filter(ae=>!ae.position&&Q===0||ae.position===L).map((ae,re)=>{var xe,Re;return ie.createElement(QA,{key:ae.id,icons:Y,index:re,toast:ae,defaultRichColors:T,duration:(xe=M?.duration)!=null?xe:E,className:M?.className,descriptionClassName:M?.descriptionClassName,invert:c,visibleToasts:R,closeButton:(Re=M?.closeButton)!=null?Re:g,interacting:ve,position:L,style:M?.style,unstyled:M?.unstyled,classNames:M?.classNames,cancelButtonStyle:M?.cancelButtonStyle,actionButtonStyle:M?.actionButtonStyle,closeButtonAriaLabel:M?.closeButtonAriaLabel,removeToast:j,toasts:B.filter(je=>je.position==ae.position),heights:se.filter(je=>je.position==ae.position),setHeights:le,expandByDefault:v,gap:D,expanded:ce,swipeDirections:l.swipeDirections})})):null}))}),FA=({...n})=>h.jsx(KA,{theme:"dark",className:"toaster group",icons:{success:h.jsx(Sj,{className:"size-4"}),info:h.jsx(Bj,{className:"size-4"}),warning:h.jsx(hx,{className:"size-4"}),error:h.jsx(Wj,{className:"size-4"}),loading:h.jsx(Qj,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...n});function He(n,l=!1){l?cy.error(n):cy(n)}function XA(){return h.jsx(FA,{position:"bottom-center"})}function hh({...n}){return h.jsx(kd,{"data-slot":"dialog",...n})}function ZA({...n}){return h.jsx(Hd,{"data-slot":"dialog-portal",...n})}function $A({className:n,...l}){return h.jsx(Ud,{"data-slot":"dialog-overlay",className:Rt("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",n),...l})}function mh({className:n,children:l,showCloseButton:i=!0,...o}){return h.jsxs(ZA,{"data-slot":"dialog-portal",children:[h.jsx($A,{}),h.jsxs(Bd,{"data-slot":"dialog-content",className:Rt("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",n),...o,children:[l,i&&h.jsxs(lb,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[h.jsx(mx,{}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function hc({className:n,...l}){return h.jsx(tb,{"data-slot":"dialog-title",className:Rt("text-lg leading-none font-semibold",n),...l})}let px=null,ks=[];function ao(n){px=n,ks.forEach(l=>l())}function vx(n,l,i="",o="OK"){return new Promise(c=>ao({kind:"prompt",title:n,label:l,value:i,okLabel:o,resolve:c}))}function Os(n,l,i="Confirm",o=!1){return new Promise(c=>ao({kind:"confirm",title:n,message:l,confirmLabel:i,danger:o,resolve:c}))}function JA(){const n=y.useSyncExternalStore(i=>(ks.push(i),()=>{ks=ks.filter(o=>o!==i)}),()=>px);if(!n)return null;const l=()=>{ao(null),n.kind==="prompt"?n.resolve(null):n.resolve(!1)};return h.jsx(hh,{open:!0,onOpenChange:i=>!i&&l(),children:h.jsx(mh,{className:"modal",showCloseButton:!1,children:n.kind==="prompt"?h.jsx(WA,{m:n}):h.jsx(eN,{m:n})})})}function WA({m:n}){const l=y.useRef(null),i=c=>{ao(null),n.resolve(c)},o=()=>i(l.current.value.trim()||null);return h.jsxs(h.Fragment,{children:[h.jsx(hc,{asChild:!0,children:h.jsx("h3",{children:n.title})}),h.jsx("label",{className:"modal-label",children:n.label}),h.jsx("input",{className:"modal-input",type:"text",autoComplete:"off",defaultValue:n.value,ref:l,autoFocus:!0,onFocus:c=>c.currentTarget.select(),onKeyDown:c=>c.key==="Enter"&&o()}),h.jsxs("div",{className:"modal-actions",children:[h.jsx("button",{className:"ai-btn",onClick:()=>i(null),children:"Cancel"}),h.jsx("button",{className:"pbtn",onClick:o,children:n.okLabel})]})]})}function eN({m:n}){const l=i=>{ao(null),n.resolve(i)};return h.jsxs(h.Fragment,{children:[h.jsx(hc,{asChild:!0,children:h.jsx("h3",{children:n.title})}),h.jsx("p",{className:"modal-msg",children:n.message}),h.jsxs("div",{className:"modal-actions",children:[h.jsx("button",{className:"ai-btn",onClick:()=>l(!1),children:"Cancel"}),h.jsx("button",{className:n.danger?"danger-btn":"pbtn",onClick:()=>l(!0),autoFocus:!0,children:n.confirmLabel})]})]})}function tN(n){return Zt({queryKey:["projects"],queryFn:()=>rn("/api/projects"),enabled:n,refetchInterval:3e4,select:l=>l.projects||[]})}function nN(n){return Zt({queryKey:["orgs"],queryFn:()=>rn("/api/orgs"),enabled:n,select:l=>l.orgs||[]})}function gx(n){return Zt({queryKey:["admin","pending"],queryFn:()=>rn("/api/admin/pending"),enabled:n,select:l=>l.pending||[]})}function yx(){const n=Zi();return()=>Promise.all([n.invalidateQueries({queryKey:["projects"]}),n.invalidateQueries({queryKey:["orgs"]})]).then(()=>{})}function bx(n){return n.split("/").map(encodeURIComponent).join("/")}function dy(n){return n.split("/").map(decodeURIComponent).join("/")}const aN=new Set(["insights","history","install","settings"]);function xx(n,l){const i=n.replace(/^\/+/,"");if(l!=="hub")return{path:i?dy(i):""};const o=i.indexOf("/");if(o===-1)return{project:i,path:""};const c={project:i.slice(0,o),path:dy(i.slice(o+1))},f=c.path.indexOf("/"),d=f===-1?c.path:c.path.slice(0,f);return aN.has(d)&&(c.view=d,c.viewTarget=f===-1?"":c.path.slice(f+1).replace(/\/+$/,""),c.path=""),c}function lN(n,l){const i=bx(n);return l?"/"+l+(i?"/"+i:""):"/"+i}function Cr(n,l,i){let o=(l?"/"+l:"")+"/"+n;return i&&(o+="/"+bx(i.replace(/\/+$/,""))),o}let ph="POP";const wd=new Set;function Sx(){for(const n of wd)n()}window.addEventListener("popstate",()=>{ph="POP",Sx()});function Ft(n,l){const i=location.pathname+location.search;!l?.replace&&i===n||(history[l?.replace?"replaceState":"pushState"](null,"",n),ph=l?.replace?"REPLACE":"PUSH",Sx())}function vh(){return y.useSyncExternalStore(n=>(wd.add(n),()=>{wd.delete(n)}),()=>location.pathname)}function rN(){return ph}function iN({to:n}){return y.useEffect(()=>{Ft(n,{replace:!0})},[n]),null}const oN=/\.(md|markdown)$/i,sN=/\.(png|jpe?g|gif|svg|webp|ico|bmp|avif)$/i,cN=/\.html?$/i,uN=/\.(txt|log|json|ya?ml|toml|csv|go|py|js|ts|jsx|tsx|sh|bash|zsh|rb|rs|c|h|cpp|java|kt|swift|sql|css|xml|ini|conf|env|mod|sum|jsonl)$/i;function wx(n){if(n<1024)return n+" B";const l=["KB","MB","GB","TB"];let i=-1;do n/=1024,i++;while(n>=1024&&i c.invalidateQueries({queryKey:["orgs"]}),m=()=>c.invalidateQueries({queryKey:["invites",n.id]}),x=()=>c.invalidateQueries({queryKey:["orgShares",n.id]}),{data:p}=Zt({queryKey:["invites",n.id],queryFn:()=>rn(`/api/orgs/${n.id}/invites`),enabled:f,select:E=>E.invites||[]}),{data:S}=Zt({queryKey:["orgShares",n.id],queryFn:()=>rn(`/api/orgs/${n.id}/shares`),enabled:f,select:E=>E.shares||[]}),T=l.filter(E=>E.org===n.id);return h.jsxs("div",{className:"admin",children:[h.jsx("h1",{id:"org-title",children:n.name+(f?"":" · member")}),f&&h.jsxs("div",{className:"admin-row",children:[h.jsx("input",{id:"org-rename",type:"text",value:d,onChange:E=>v(E.target.value)}),h.jsx("button",{className:"pbtn",id:"org-rename-btn",onClick:async()=>{try{await Ua("PATCH","/api/orgs/"+n.id,{name:d.trim()}),He("Renamed."),g()}catch(E){He(E.message,!0)}},children:"Rename org"})]}),h.jsx("h3",{children:"Members"}),h.jsx("div",{className:"admin-list",children:n.members.map(E=>{const C=!!i&&E.email.toLowerCase()===i.toLowerCase();return h.jsxs("div",{className:"admin-item",children:[h.jsx("span",{className:"ai-main",children:E.email+(C?" (you)":"")}),f&&!C?h.jsxs(h.Fragment,{children:[h.jsxs("select",{value:E.role,onChange:async R=>{try{await Ua("PATCH",`/api/orgs/${n.id}/members/${encodeURIComponent(E.email)}`,{role:R.target.value}),He("Role updated.")}catch(M){He(M.message,!0)}g()},children:[h.jsx("option",{value:"owner",children:"owner"}),h.jsx("option",{value:"member",children:"member"})]}),h.jsx("button",{className:"ai-del",onClick:async()=>{if(await Os("Remove member",`Remove ${E.email} from ${n.name}?`,"Remove",!0))try{await Ua("DELETE",`/api/orgs/${n.id}/members/${encodeURIComponent(E.email)}`),He("Removed."),g()}catch(R){He(R.message,!0)}},children:"Remove"})]}):h.jsx("span",{className:"ai-tag",children:E.role})]},E.email)})}),f&&h.jsxs(h.Fragment,{children:[h.jsx("h3",{children:"Projects"}),h.jsxs("div",{className:"admin-list",children:[T.length===0&&h.jsx("div",{className:"admin-empty",children:"No projects yet."}),T.map(E=>h.jsxs("div",{className:"admin-item",children:[h.jsx("span",{className:"ai-main",children:E.name}),h.jsx("button",{className:"ai-btn",onClick:async()=>{const C=await vx("Rename project","New name",E.name,"Rename");if(!(!C||C===E.name))try{await Ua("PATCH","/api/projects/"+E.id,{name:C}),He("Renamed."),await o()}catch(R){He(R.message,!0)}},children:"Rename"}),h.jsx("button",{className:"ai-del",onClick:async()=>{if(await Os("Delete project",`Delete “${E.name}”? Its files stay in storage, but it's removed from the hub.`,"Delete",!0))try{await Ua("DELETE","/api/projects/"+E.id),He(`Deleted “${E.name}”.`),await o()}catch(C){He(C.message,!0)}},children:"Delete"})]},E.id))]}),h.jsxs("div",{className:"admin-h",children:[h.jsx("h3",{children:"Invite links"}),h.jsx("button",{className:"pbtn",onClick:async()=>{try{const E=await Mr(`/api/orgs/${n.id}/invites`),C=await Ki(E.url);He(C?"Invite link copied to clipboard.":"Invite created — copy it from the list below."),m()}catch(E){He(E.message,!0)}},children:"New invite"})]}),h.jsxs("div",{className:"admin-list",children:[p&&p.length===0&&h.jsx("div",{className:"admin-empty",children:"No active invite links."}),(p||[]).map(E=>h.jsxs("div",{className:"admin-item",children:[h.jsx("span",{className:"ai-main mono",style:{cursor:"pointer"},title:"Copy",onClick:()=>Ki(E.url).then(C=>He(C?"Copied.":"Select and copy the link.")),children:E.url}),h.jsx("span",{className:"ai-tag",children:(E.creator?"by "+E.creator+" · ":"")+(E.uses?E.uses+" joined · ":"unused · ")+"expires "+new Date(E.expires).toLocaleDateString()}),h.jsx("button",{className:"ai-del",onClick:async()=>{if(await Os("Revoke invite","Revoke this invite link? Anyone still holding it won't be able to join.","Revoke",!0))try{await Ua("DELETE",`/api/orgs/${n.id}/invites/${E.token}`),He("Revoked."),m()}catch(C){He(C.message,!0)}},children:"Revoke"})]},E.token))]}),h.jsx("h3",{children:"Public share links"}),h.jsxs("div",{className:"admin-list",children:[S&&S.length===0&&h.jsx("div",{className:"admin-empty",children:"No public shares."}),(S||[]).map(E=>h.jsxs("div",{className:"admin-item",children:[h.jsx("span",{className:"ai-main mono",style:{cursor:"pointer"},title:E.url,onClick:()=>window.open(E.url,"_blank"),children:E.path}),h.jsx("span",{className:"ai-tag",children:(E.project_name||"")+(E.creator?" · by "+E.creator:"")+(E.created?" · "+new Date(E.created).toLocaleDateString():"")}),h.jsx("button",{className:"ai-del",onClick:async()=>{if(await Os("Revoke share link",`Revoke the public link to “${E.path}”? Anyone with the URL will lose access.`,"Revoke",!0))try{await Ua("DELETE","/api/shares/"+E.token),He("Share revoked."),x()}catch(C){He(C.message,!0)}},children:"Revoke"})]},E.token))]})]})]})}function dN(){const n=Zi(),{data:l,error:i}=Zt({queryKey:["admin","policy"],queryFn:()=>rn("/api/admin/policy")}),{data:o}=gx(!0),[c,f]=y.useState(!1),[d,v]=y.useState(!1);if(y.useEffect(()=>{l&&(f(l.require_verification&&l.mailer),v(l.require_approval))},[l]),y.useEffect(()=>{i&&He(i.message,!0)},[i]),!l)return null;const g=async(m,x,p)=>{try{await Mr(`/api/admin/pending/${m}/${x}`),He((x==="approve"?"Approved ":"Denied ")+p),n.invalidateQueries({queryKey:["admin","pending"]})}catch(S){He(S.message,!0)}};return h.jsxs("div",{className:"admin",children:[h.jsx("h1",{children:"Signup & access"}),h.jsx("p",{className:"admin-sub",children:"Who can create an account on this hub, and how new accounts are vetted."}),h.jsx("h3",{children:"New-account vetting"}),h.jsxs("div",{className:"admin-list",children:[h.jsx(hy,{label:"Require email verification",desc:l.mailer?"New accounts must click an emailed link before they can sign in — proves they control the address.":"Configure SMTP on the server (auth.smtp) to enable email verification.",checked:c,disabled:!l.mailer,onChange:f}),h.jsx(hy,{label:"Require admin approval",desc:"New accounts wait for a hub admin to approve them before they gain access.",checked:d,onChange:v})]}),h.jsx("button",{className:"pbtn",style:{marginTop:14},onClick:async()=>{try{await Mr("/api/admin/policy",{require_verification:c,require_approval:d}),He("Signup policy saved."),n.invalidateQueries({queryKey:["admin","policy"]})}catch(m){He(m.message,!0)}},children:"Save policy"}),h.jsx("h3",{children:"Who can sign up"}),h.jsxs("div",{className:"admin-list",children:[h.jsxs("div",{className:"admin-item",children:[h.jsx("span",{className:"ai-main",children:"Allowed email domains"}),h.jsx("span",{className:"ai-tag",children:l.allowed_domains&&l.allowed_domains.length?l.allowed_domains.map(m=>"@"+m).join(", "):"any"})]}),h.jsxs("div",{className:"admin-item",children:[h.jsx("span",{className:"ai-main",children:"Self-signup"}),h.jsx("span",{className:"ai-tag",children:l.allow_signup?"open":"invite-only"})]}),h.jsxs("div",{className:"admin-item",children:[h.jsx("span",{className:"ai-main",children:"Hub admins"}),h.jsx("span",{className:"ai-tag",children:l.admins&&l.admins.length?l.admins.join(", "):"none"})]})]}),h.jsx("p",{className:"admin-sub",children:"Domains and admins are set in the server config file (they can't be widened from the browser)."}),h.jsx("h3",{children:"Pending signups"}),h.jsxs("div",{className:"admin-list",children:[(!o||o.length===0)&&h.jsx("div",{className:"admin-empty",children:"No one is waiting for approval."}),(o||[]).map(m=>h.jsxs("div",{className:"admin-item",children:[h.jsx("span",{className:"ai-main",children:(m.name?m.name+" · ":"")+m.email}),h.jsx("button",{className:"pbtn",onClick:()=>g(m.id,"approve",m.email),children:"Approve"}),h.jsx("button",{className:"ai-del",onClick:()=>g(m.id,"deny",m.email),children:"Deny"})]},m.id))]})]})}function hy({label:n,desc:l,checked:i,disabled:o,onChange:c}){return h.jsxs("label",{className:"admin-item toggle",style:o?{opacity:.55}:void 0,children:[h.jsxs("span",{className:"ai-main",children:[h.jsx("div",{className:"tg-label",children:n}),h.jsx("div",{className:"tg-desc",children:l})]}),h.jsx("input",{type:"checkbox",checked:i,disabled:o,onChange:f=>c(f.target.checked)})]})}function hN({...n}){return h.jsx(f0,{"data-slot":"select",...n})}function mN({...n}){return h.jsx(p0,{"data-slot":"select-value",...n})}function pN({className:n,size:l="default",children:i,...o}){return h.jsxs(h0,{"data-slot":"select-trigger","data-size":l,className:Rt("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",n),...o,children:[i,h.jsx(v0,{asChild:!0,children:h.jsx(dh,{className:"size-4 opacity-50"})})]})}function vN({className:n,children:l,position:i="item-aligned",align:o="center",...c}){return h.jsx(y0,{children:h.jsxs(b0,{"data-slot":"select-content",className:Rt("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-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-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",i==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n),position:i,align:o,...c,children:[h.jsx(yN,{}),h.jsx(C0,{className:Rt("p-1",i==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:l}),h.jsx(bN,{})]})})}function gN({className:n,children:l,...i}){return h.jsxs(j0,{"data-slot":"select-item",className:Rt("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",n),...i,children:[h.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:h.jsx(O0,{children:h.jsx(fx,{className:"size-4"})})}),h.jsx(A0,{children:l})]})}function yN({className:n,...l}){return h.jsx(_0,{"data-slot":"select-scroll-up-button",className:Rt("flex cursor-default items-center justify-center py-1",n),...l,children:h.jsx(bj,{className:"size-4"})})}function bN({className:n,...l}){return h.jsx(D0,{"data-slot":"select-scroll-down-button",className:Rt("flex cursor-default items-center justify-center py-1",n),...l,children:h.jsx(dh,{className:"size-4"})})}const my=["#5b8def","#f5a623","#4cc38a","#e0679b","#8b7bf0","#3ec8c8","#e6934a"];function Cx(n){let l=0;for(const i of n)l=l*31+i.charCodeAt(0)>>>0;return my[l%my.length]}function py({projects:n,currentId:l,menu:i}){const o=yx(),c=async()=>{const f=await vx("New project","Project name","","Create");if(f)try{const d=await Mr("/api/projects",{name:f});await o(),Ft("/"+d.project.id),He(`Created “${d.project.name}”.`)}catch(d){He("Could not create the project: "+d.message,!0)}};return h.jsxs("nav",{id:"projects","aria-label":"Projects",children:[h.jsxs("div",{className:"nav-head",children:[h.jsx("span",{children:"Projects"}),h.jsx("button",{className:"nav-add",title:"New project",onClick:c,children:"+"})]}),h.jsx("div",{className:"proj-row",children:h.jsxs(hN,{value:l||"",onValueChange:f=>{f&&f!==l&&(Ft("/"+f),Rn())},children:[h.jsxs(pN,{id:"project-select","aria-label":"Switch project",className:"proj-trigger",children:[l&&h.jsx("span",{className:"proj-mark","aria-hidden":"true",style:{background:Cx(n.find(f=>f.id===l)?.name||"")}}),h.jsx(mN,{placeholder:"Select a project"})]}),h.jsx(vN,{className:"proj-menu",children:n.map(f=>h.jsx(gN,{value:f.id,children:f.name},f.id))})]})}),i&&h.jsx("ul",{className:"nav-menu","aria-label":"Project pages",children:[["dashboard","Dashboard","dashboard",i.onDashboard],["install","Installation","terminal",i.onInstall],["history","History","hist",i.onHistory],["settings","Settings","gear",i.onSettings]].map(([f,d,v,g])=>h.jsx("li",{children:h.jsxs("div",{id:"nav-"+f,className:"row"+(i.active===f?" active":""),role:"button",tabIndex:0,onClick:g,onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),g())},children:[h.jsx(gt,{name:v}),h.jsx("span",{className:"label",children:d})]})},f))})]})}function xN({...n}){return h.jsx(dR,{"data-slot":"dropdown-menu",...n})}function SN({...n}){return h.jsx(hR,{"data-slot":"dropdown-menu-trigger",...n})}function wN({className:n,sideOffset:l=4,...i}){return h.jsx(mR,{children:h.jsx(pR,{"data-slot":"dropdown-menu-content",sideOffset:l,className:Rt("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-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-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",n),...i})})}function Kf({className:n,inset:l,variant:i="default",...o}){return h.jsx(gR,{"data-slot":"dropdown-menu-item","data-inset":l,"data-variant":i,className:Rt("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!",n),...o})}function Ff({className:n,inset:l,...i}){return h.jsx(vR,{"data-slot":"dropdown-menu-label","data-inset":l,className:Rt("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",n),...i})}function EN({me:n,org:l,admin:i,onOrgSettings:o}){const c=n.name||n.email;return h.jsx("footer",{id:"accountbar",children:h.jsxs(xN,{modal:!1,children:[h.jsx(SN,{asChild:!0,children:h.jsxs("button",{id:"account-btn","aria-label":"Account menu",children:[h.jsx("span",{className:"avatar",style:{background:Cx(n.email)},"aria-hidden":"true",children:(c.trim()[0]||"?").toUpperCase()}),h.jsxs("span",{className:"acct",children:[h.jsx("b",{children:c}),n.name&&h.jsx("small",{children:n.email})]}),h.jsx(gt,{name:"chev"})]})}),h.jsxs(wN,{id:"account-menu",side:"top",align:"start",sideOffset:6,className:"acct-menu",children:[l&&h.jsxs(h.Fragment,{children:[h.jsx(Ff,{className:"menu-sec",children:"Organization"}),h.jsxs(Kf,{id:"menu-org-settings",onSelect:()=>o(l),children:[h.jsx(gt,{name:"gear"}),h.jsxs("span",{children:[h.jsx("b",{children:l.name})," Settings"]})]})]}),i&&h.jsxs(h.Fragment,{children:[h.jsx(Ff,{className:"menu-sec",children:"Hub"}),h.jsxs(Kf,{id:"menu-hub-admin",onSelect:i.onClick,children:[h.jsx(gt,{name:"shield"}),h.jsxs("span",{children:["Signup & access",i.pending?` · ${i.pending}`:""]})]})]}),h.jsx(Ff,{className:"menu-sec",children:"Account"}),h.jsx(Kf,{asChild:!0,children:h.jsxs("a",{id:"signout",href:"/auth/logout",children:[h.jsx(gt,{name:"power"}),h.jsx("span",{children:"Log out"})]})})]})]})})}function CN({project:n,org:l}){return h.jsxs("div",{className:"project-settings",children:[h.jsx("h2",{children:n.name}),h.jsxs("dl",{className:"ps-facts",children:[h.jsx("dt",{children:"Project id"}),h.jsx("dd",{children:h.jsx("code",{children:n.id})}),l&&h.jsxs(h.Fragment,{children:[h.jsx("dt",{children:"Workspace"}),h.jsx("dd",{children:l.name})]}),n.created&&h.jsxs(h.Fragment,{children:[h.jsx("dt",{children:"Created"}),h.jsx("dd",{children:new Date(n.created).toLocaleDateString()})]})]})]})}const Xf=[{key:"claude",label:"Claude Code & Cowork"},{key:"hermes",label:"Hermes",hook:"hermes",note:"Registers BearDrive's hooks in Hermes's config: pull before every turn, push after edits with a session note, and report file reads to Insights."},{key:"codex",label:"Codex",hook:"codex",note:"Registers hooks in .codex/hooks.json.",extra:"Run /hooks inside Codex once to trust the project's .codex layer — after that every turn pulls, edits push automatically, and reads are reported to Insights."}];function TN(n,l){const i=window.location.origin,o=l.id;if(n.key==="claude")return[{title:"Add the BearDrive plugin",desc:"One time, in any Claude Code session. The plugin ships the beardrive skill, the /beardrive commands, and turn-boundary sync hooks — and Claude Cowork shares the same plugins, so installing it once covers both.",code:`/plugin marketplace add runbear-io/beardrive -/plugin install beardrive@beardrive`},{title:"Set up this project conversationally",desc:"In a Claude Code or Cowork session in the folder where you want the files, run:",code:"/beardrive:install connect to "+i+", project "+o,extra:"Claude installs the CLI, signs this machine in, mounts the project, and registers the sync hooks — pull the latest before every turn, push after edits (stamped with the session that made them), and report file reads to Insights. It asks before anything it changes."}];const c=(l.name||"project").toLowerCase().replace(/[^a-z0-9._-]+/g,"-")||"project";return[{title:"Install the BearDrive CLI",desc:"One static binary. Homebrew on macOS and Linux; releases and `go install` also work.",code:"brew install runbear-io/tap/beardrive"},{title:"Sign in to this hub",desc:"Opens the browser once and stores a device token on this machine — the synced folder itself never holds credentials.",code:"bdrive login "+i},{title:"Mount the project into a local folder",desc:"Run it where you want the files. An existing folder works too — contents merge, and re-running init later (or after moving the folder) just resumes.",code:"mkdir -p ~/"+c+" && cd ~/"+c+` -bdrive init --project `+o},{title:"Connect "+n.label,desc:n.note,code:"bdrive hooks install --agent "+n.hook,extra:n.extra}]}function RN(){try{return localStorage.getItem("bdrive-guide-agent")||"claude"}catch{return"claude"}}function Tx({project:n}){const[l,i]=y.useState(RN),o=Xf.find(c=>c.key===l)||Xf[0];return h.jsxs("div",{className:"guide",children:[h.jsx("h1",{className:"in-title",children:n.name}),h.jsx("p",{className:"dl-sub",children:"Mount this project as a folder on any machine and connect your coding agent: files sync both ways in the background, every change is journaled with who made it, and agent reads feed Insights."}),h.jsx("div",{className:"gd-tabs",children:Xf.map(c=>h.jsx("button",{className:"gd-tab"+(c.key===o.key?" active":""),"data-key":c.key,onClick:()=>{i(c.key);try{localStorage.setItem("bdrive-guide-agent",c.key)}catch{}},children:c.label},c.key))}),h.jsxs("div",{className:"gd-body",children:[TN(o,n).map((c,f)=>h.jsxs("div",{className:"gd-step",children:[h.jsxs("div",{className:"gd-step-head",children:[h.jsx("span",{className:"gd-num",children:f+1}),h.jsx("span",{className:"gd-step-title",children:c.title})]}),c.desc&&h.jsx("p",{className:"gd-desc",children:c.desc}),c.code&&h.jsx(MN,{code:c.code}),c.extra&&h.jsx("p",{className:"gd-desc gd-extra",children:c.extra})]},f)),h.jsx("p",{className:"gd-done",children:"That's it — the folder now syncs on its own. Every agent turn starts from the latest state, edits appear here (and on every teammate's mount) within seconds, and what your agents read shows up in Insights."})]})]})}function MN({code:n}){const[l,i]=y.useState("Copy");return h.jsxs("pre",{className:"gd-code",children:[h.jsx("code",{children:n}),h.jsx("button",{className:"gd-copy",onClick:async()=>{i(await Ki(n)?"Copied":"Copy failed"),setTimeout(()=>i("Copy"),1400)},children:l})]})}function jN({authEnabled:n,onCreate:l}){const i=y.useRef(null),o=y.useRef(null),c=()=>{const f=i.current.value.trim(),d=f.match(/join\/([0-9a-f]+)/)||f.match(/^([0-9a-f]{8,})$/);if(!d){He("That doesn't look like an invite link.",!0);return}location.href="/join/"+d[1]};return h.jsxs("div",{className:"onboard",children:[h.jsx("h1",{children:"Welcome to BearDrive"}),h.jsx("p",{children:"You're signed in, but you're not part of any project yet."}),n&&h.jsxs("div",{className:"ob-card",children:[h.jsx("h3",{children:"Have an invite link?"}),h.jsx("p",{children:"A teammate can send you a join link. Paste it here:"}),h.jsxs("div",{className:"ob-row",children:[h.jsx("input",{id:"ob-invite",type:"text",placeholder:"https://…/join/…",autoComplete:"off",ref:i}),h.jsx("button",{id:"ob-join",className:"pbtn",onClick:c,children:"Join"})]})]}),h.jsxs("div",{className:"ob-card",children:[h.jsx("h3",{children:"Or start a new project"}),h.jsx("p",{children:"Create a shared space for your team's files."}),h.jsxs("div",{className:"ob-row",children:[h.jsx("input",{id:"ob-name",type:"text",placeholder:"Project name, e.g. wiki",autoComplete:"off",ref:o}),h.jsx("button",{id:"ob-create",className:"pbtn",onClick:()=>l(o.current.value.trim()),children:"Create"})]})]})]})}function AN(n,l=!0){const i=Zt({queryKey:["tree",n],queryFn:()=>rn(n+"tree"),enabled:l,refetchInterval:15e3}),o=y.useMemo(()=>{const c=[],f=new Map,d=v=>{for(const g of v.children||[])g.dir?(f.set(g.path,g),d(g)):c.push(g)};return i.data&&d(i.data),{flatFiles:c,dirIndex:f}},[i.data]);return{tree:i.data,...o,loaded:!!i.data}}function NN(n,l){return Zt({queryKey:["heat",n],queryFn:()=>rn(n+"heat?days=30"),enabled:l,staleTime:6e4,refetchInterval:6e4}).data?.entries??null}function ON(n,l,i){return Zt({queryKey:["history",n,"prefix",l,20],queryFn:()=>rn(n+"history?prefix="+encodeURIComponent(l)+"&n=20"),enabled:i,staleTime:15e3}).data?.entries??null}function vy(n,l,i){if(!n)return null;if(!i)return n[l]||null;const o={human:0,agent:0,share:0};for(const[c,f]of Object.entries(n))c.startsWith(l+"/")&&(o.human+=f.human||0,o.agent+=f.agent||0,o.share+=f.share||0);return o.human||o.agent||o.share?o:null}function Fi(n){return(n.human||0)+(n.agent||0)+(n.share||0)}function Ls(n){const l=Fi(n);if(!l)return"";let i=l+(l===1?" read":" reads");return n.agent&&(i+=" ("+n.agent+" agent)"),i}function _N(n){const l=Fi(n);return l?l<3?1:l<10?2:l<30?3:4:0}function DN(n){return h.jsx("nav",{id:"tree","aria-label":"Files",children:n.root&&h.jsx(Rx,{nodes:n.root.children||[],...n})})}function Rx({nodes:n,...l}){return h.jsx("ul",{children:n.map(i=>h.jsx(zN,{node:i,...l},i.path))})}function zN({node:n,...l}){const{expanded:i,onToggle:o,currentPath:c,listingShowing:f,onOpen:d}=l,v=n.dir?i.has(n.path):!1,g=()=>{if(n.dir&&c===n.path&&f){o(n.path);return}d(n.path),n.dir||Rn()};return h.jsxs("li",{className:(n.dir?"dir":"file")+(n.dir&&!v?" collapsed":""),children:[h.jsxs("div",{className:"row"+(c===n.path?" active":""),"data-path":n.path,tabIndex:0,role:"button",title:n.name,"aria-expanded":n.dir?v:void 0,onClick:g,onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),g())},children:[h.jsx("span",{className:"chev",onClick:m=>{n.dir&&(m.stopPropagation(),o(n.path))},children:h.jsx(gt,{name:"chevd"})}),h.jsx("span",{className:"ticon",children:h.jsx(gt,{name:n.dir?"folder":"doc"})}),h.jsx("span",{className:"label",children:n.name})]}),n.dir&&h.jsx(Rx,{nodes:n.children||[],...l})]})}function kN(n){const l=n.split("/"),i=[];let o="";for(let c=0;c {o=o?o+"/"+c:c;const d=o,v=f===i.length-1;return h.jsxs("span",{children:[f>0&&h.jsx("span",{className:"crumb-sep",children:"/"}),v?h.jsx("span",{children:c}):h.jsx("span",{className:"crumb-seg",title:d,onClick:()=>l(d),children:c})]},d)})})}const HN={add:"plus",edit:"edit",delete:"x"},UN={add:"added",edit:"edited",delete:"deleted"};function Mx({entry:n,onOpen:l}){const[i,o]=y.useState(!1),c=n.kind==="put"?"edit":n.kind,f=n.user_name?`${n.user_name} <${n.user}>`:n.user||n.author||"unknown",d=[n.device.name||n.device.id,n.device.os,n.device.ip].filter(Boolean).join(" · "),v=c!=="delete",g=m=>{m.target.tagName!=="A"&&v&&l(n.path)};return h.jsxs("div",{className:"hentry "+c+(v?" clickable":""),tabIndex:v?0:void 0,role:v?"button":void 0,onClick:g,onKeyDown:m=>{v&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),l(n.path))},children:[h.jsxs("div",{className:"hline",children:[h.jsx("span",{className:"hkind",children:h.jsx(gt,{name:HN[c]||"dot"})}),h.jsx("span",{className:"hpath",children:n.path}),h.jsx("span",{className:"htag",children:UN[c]||c}),h.jsx("span",{className:"htime",children:new Date(n.time).toLocaleString()})]}),h.jsxs("div",{className:"hmeta",children:[h.jsx("span",{className:"hwho",children:f}),h.jsx("span",{className:"hdev",children:d}),h.jsx("span",{className:"hsize",children:n.size?wx(n.size):""})]}),n.note&&h.jsx("div",{className:"hnote"+(i?" open":""),tabIndex:0,role:"button",title:i?"Collapse note":"Show full note","aria-expanded":i,onClick:m=>{m.stopPropagation(),m.target.tagName!=="A"&&o(!i)},onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),m.stopPropagation(),o(!i))},children:n.note.split(/(https?:\/\/\S+)/).map((m,x)=>/^https?:\/\//.test(m)?h.jsx("a",{href:m,target:"_blank",rel:"noopener",children:m},x):m)})]})}function BN(n){const{node:l,heatMap:i,onOpen:o}=n,c=(l.children||[]).slice().sort((m,x)=>Number(x.dir||!1)-Number(m.dir||!1)||m.name.localeCompare(x.name)),f=c.filter(m=>m.dir).length,d=c.length-f,v=[];f&&v.push(f+(f===1?" folder":" folders")),d&&v.push(d+(d===1?" file":" files"));const g=vy(i,l.path,!0);return g&&v.push(Ls(g)+" in 30 days"),h.jsxs("div",{className:"dirlist",children:[h.jsxs("h1",{className:"dl-title",children:[h.jsx("span",{className:"dl-title-icon",children:h.jsx(gt,{name:"folder"})}),h.jsx("span",{children:l.name})]}),h.jsx("p",{className:"dl-sub",children:v.join(" · ")||"Empty folder"}),c.length===0?h.jsx("div",{className:"dl-empty",children:"Nothing in this folder yet."}):h.jsx("div",{className:"dl-items",children:c.map(m=>{let x="";if(m.dir){const S=(m.children||[]).length;x=S+(S===1?" item":" items")}else x=[m.size?wx(m.size):"",m.time?new Date(m.time).toLocaleDateString():""].filter(Boolean).join(" · ");const p=vy(i,m.path,!!m.dir);return p&&(x=Ls(p)+(x?" · "+x:"")),h.jsxs("div",{className:"dl-row",tabIndex:0,role:"button",title:m.path,onClick:()=>o(m.path),onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),o(m.path))},children:[h.jsx("span",{className:"ticon",children:h.jsx(gt,{name:m.dir?"folder":"doc"})}),h.jsx("span",{className:"dl-name",children:m.name}),p&&h.jsx("span",{className:"heatdot lvl"+_N(p),title:Ls(p)+" in 30 days"}),h.jsx("span",{className:"dl-meta",children:x})]},m.path)})}),n.hub&&h.jsx(qN,{apiBase:n.apiBase,prefix:l.path+"/",onOpen:o,onFullHistory:()=>n.onFullHistory(l.path+"/"),onRendered:n.onRendered})]})}function qN(n){const l=ON(n.apiBase,n.prefix,!0),{onRendered:i}=n;return y.useEffect(()=>{l&&l.length&&i&&i()},[l,i]),!l||l.length===0?null:h.jsxs("div",{className:"dl-history",children:[h.jsx("h3",{className:"dl-h3",children:"Recent changes"}),h.jsx("div",{className:"history dl-hlist",children:l.map((o,c)=>h.jsx(Mx,{entry:o,onOpen:n.onOpen},c))}),h.jsx("button",{className:"ai-btn dl-more",onClick:n.onFullHistory,children:"Full history"})]})}function GN(n){const{apiBase:l,path:i,onMeta:o}=n,c=l+"file?path="+encodeURIComponent(i);return y.useEffect(()=>()=>o(""),[i,o]),oN.test(i)?h.jsx(VN,{...n}):cN.test(i)?h.jsx("iframe",{className:"htmlview",sandbox:"allow-scripts",src:c,title:i,onLoad:n.onRendered}):sN.test(i)?h.jsx(QN,{src:c,alt:i,onRendered:n.onRendered}):uN.test(i)?h.jsx(PN,{...n,fileURL:c}):h.jsxs("div",{className:"filecard",children:[h.jsx("div",{className:"name",children:i.split("/").pop()}),h.jsx("p",{children:"No preview for this file type."}),h.jsx("a",{className:"btn",download:!0,href:l+"download?path="+encodeURIComponent(i),children:"Download"})]})}function VN(n){const{apiBase:l,path:i,heatMap:o,flatFiles:c,onOpenFile:f,onMeta:d,onRendered:v}=n,{data:g,error:m}=Zt({queryKey:["render",l,i],queryFn:()=>rn(l+"render?path="+encodeURIComponent(i))}),x=y.useMemo(()=>g?IN(g.html,i,l):"",[g,i,l]);return y.useEffect(()=>{if(!g)return;const p=[];g.author&&p.push(g.author+(g.device?" on "+g.device:"")),g.time&&p.push(new Date(g.time).toLocaleString());const S=o&&o[g.path];S&&Fi(S)&&p.push(Ls(S)+" / 30d"),d(p.join(" · ")),v?.()},[g,o,d,v]),m?h.jsxs("div",{className:"empty",children:["Could not load file: ",m.message]}):g?h.jsx("div",{dangerouslySetInnerHTML:{__html:x},onClick:p=>YN(p,i,c,f)}):null}function YN(n,l,i,o){const c=n.target.closest("a");if(!c||!n.currentTarget.contains(c))return;const f=c.getAttribute("href")||"",d=l.includes("/")?l.slice(0,l.lastIndexOf("/")):"";f.startsWith("wiki:")?(n.preventDefault(),KN(decodeURIComponent(f.slice(5)),i,o)):/^([a-z]+:|\/|#)/i.test(f)||(n.preventDefault(),o(Ex(d,decodeURIComponent(f))))}function IN(n,l,i){const o=l.includes("/")?l.slice(0,l.lastIndexOf("/")):"",c=d=>i+"file?path="+encodeURIComponent(d),f=new DOMParser().parseFromString(n,"text/html");for(const d of f.querySelectorAll("img")){const v=d.getAttribute("src")||"";/^([a-z]+:|\/)/i.test(v)||d.setAttribute("src",c(Ex(o,v)))}for(const d of f.querySelectorAll("a")){const v=d.getAttribute("href")||"";/^https?:/i.test(v)&&(d.setAttribute("target","_blank"),d.setAttribute("rel","noopener"))}return f.body.innerHTML}function QN({src:n,alt:l,onRendered:i}){return h.jsx("img",{src:n,alt:l,onLoad:i})}function PN(n){const{path:l,fileURL:i,onRendered:o}=n,{data:c,error:f}=Zt({queryKey:["text",i],queryFn:async()=>{const d=await fetch(i);if(!d.ok)throw new Error(await d.text());return d.text()}});return y.useEffect(()=>{c!=null&&o?.()},[c,o]),f?h.jsxs("div",{className:"empty",children:["Could not load file: ",f.message]}):c==null?null:h.jsx("pre",{className:"plain",children:c},l)}function KN(n,l,i){const o=n.toLowerCase(),c=l.find(f=>f.path.toLowerCase()===o||f.path.toLowerCase()===o+".md")||l.find(f=>{const d=f.name.toLowerCase();return d===o||d===o+".md"});c&&i(c.path)}function FN({url:n,copied:l,onClose:i}){const o=n.split("/s/")[1];return h.jsx(hh,{open:!0,onOpenChange:c=>!c&&i(),children:h.jsxs(mh,{className:"modal",showCloseButton:!1,children:[h.jsx(hc,{asChild:!0,children:h.jsx("h3",{children:"Public link created"})}),h.jsxs("p",{children:[h.jsx("b",{children:"Anyone with this link can view this file"})," — no account needed. It always shows the latest version until you revoke it."]}),h.jsx("div",{className:"modal-url",children:n}),h.jsxs("div",{className:"modal-actions",children:[h.jsx("button",{className:"pbtn",onClick:()=>Ki(n).then(c=>He(c?"Copied.":"Select and copy the link above.")),children:l?"Copied ✓":"Copy link"}),h.jsx("button",{className:"ai-btn",onClick:()=>window.open(n,"_blank"),children:"Open"}),h.jsx("button",{className:"ai-del",onClick:async()=>{try{await Ua("DELETE","/api/shares/"+o),He("Link revoked — it no longer works."),i()}catch(c){He(c.message,!0)}},children:"Revoke"}),h.jsx("button",{className:"ai-btn",onClick:i,children:"Done"})]})]})})}var gy=1,XN=.9,ZN=.8,$N=.17,Zf=.1,$f=.999,JN=.9999,WN=.99,eO=/[\\\/_+.#"@\[\(\{&]/,tO=/[\\\/_+.#"@\[\(\{&]/g,nO=/[\s-]/,jx=/[\s-]/g;function Ed(n,l,i,o,c,f,d){if(f===l.length)return c===n.length?gy:WN;var v=`${c},${f}`;if(d[v]!==void 0)return d[v];for(var g=o.charAt(f),m=i.indexOf(g,c),x=0,p,S,T,E;m>=0;)p=Ed(n,l,i,o,m+1,f+1,d),p>x&&(m===c?p*=gy:eO.test(n.charAt(m-1))?(p*=ZN,T=n.slice(c,m-1).match(tO),T&&c>0&&(p*=Math.pow($f,T.length))):nO.test(n.charAt(m-1))?(p*=XN,E=n.slice(c,m-1).match(jx),E&&c>0&&(p*=Math.pow($f,E.length))):(p*=$N,c>0&&(p*=Math.pow($f,m-c))),n.charAt(m)!==l.charAt(f)&&(p*=JN)),(p p&&(p=S*Zf)),p>x&&(x=p),m=i.indexOf(g,m+1);return d[v]=x,x}function yy(n){return n.toLowerCase().replace(jx," ")}function aO(n,l,i){return n=i&&i.length>0?`${n+" "+i.join(" ")}`:n,Ed(n,l,yy(n),yy(l),0,0,{})}var Di='[cmdk-group=""]',Jf='[cmdk-group-items=""]',lO='[cmdk-group-heading=""]',Ax='[cmdk-item=""]',by=`${Ax}:not([aria-disabled="true"])`,Cd="cmdk-item-select",Sr="data-value",rO=(n,l,i)=>aO(n,l,i),Nx=y.createContext(void 0),lo=()=>y.useContext(Nx),Ox=y.createContext(void 0),gh=()=>y.useContext(Ox),_x=y.createContext(void 0),Dx=y.forwardRef((n,l)=>{let i=wr(()=>{var j,L;return{search:"",value:(L=(j=n.value)!=null?j:n.defaultValue)!=null?L:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),o=wr(()=>new Set),c=wr(()=>new Map),f=wr(()=>new Map),d=wr(()=>new Set),v=zx(n),{label:g,children:m,value:x,onValueChange:p,filter:S,shouldFilter:T,loop:E,disablePointerSelection:C=!1,vimBindings:R=!0,...M}=n,z=Nt(),D=Nt(),Y=Nt(),K=y.useRef(null),q=vO();Tl(()=>{if(x!==void 0){let j=x.trim();i.current.value=j,V.emit()}},[x]),Tl(()=>{q(6,ue)},[]);let V=y.useMemo(()=>({subscribe:j=>(d.current.add(j),()=>d.current.delete(j)),snapshot:()=>i.current,setState:(j,L,Q)=>{var I,te,Z,ae;if(!Object.is(i.current[j],L)){if(i.current[j]=L,j==="search")ce(),se(),q(1,le);else if(j==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let re=document.getElementById(Y);re?re.focus():(I=document.getElementById(z))==null||I.focus()}if(q(7,()=>{var re;i.current.selectedItemId=(re=ve())==null?void 0:re.id,V.emit()}),Q||q(5,ue),((te=v.current)==null?void 0:te.value)!==void 0){let re=L??"";(ae=(Z=v.current).onValueChange)==null||ae.call(Z,re);return}}V.emit()}},emit:()=>{d.current.forEach(j=>j())}}),[]),B=y.useMemo(()=>({value:(j,L,Q)=>{var I;L!==((I=f.current.get(j))==null?void 0:I.value)&&(f.current.set(j,{value:L,keywords:Q}),i.current.filtered.items.set(j,oe(L,Q)),q(2,()=>{se(),V.emit()}))},item:(j,L)=>(o.current.add(j),L&&(c.current.has(L)?c.current.get(L).add(j):c.current.set(L,new Set([j]))),q(3,()=>{ce(),se(),i.current.value||le(),V.emit()}),()=>{f.current.delete(j),o.current.delete(j),i.current.filtered.items.delete(j);let Q=ve();q(4,()=>{ce(),Q?.getAttribute("id")===j&&le(),V.emit()})}),group:j=>(c.current.has(j)||c.current.set(j,new Set),()=>{f.current.delete(j),c.current.delete(j)}),filter:()=>v.current.shouldFilter,label:g||n["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:z,inputId:Y,labelId:D,listInnerRef:K}),[]);function oe(j,L){var Q,I;let te=(I=(Q=v.current)==null?void 0:Q.filter)!=null?I:rO;return j?te(j,i.current.search,L):0}function se(){if(!i.current.search||v.current.shouldFilter===!1)return;let j=i.current.filtered.items,L=[];i.current.filtered.groups.forEach(I=>{let te=c.current.get(I),Z=0;te.forEach(ae=>{let re=j.get(ae);Z=Math.max(re,Z)}),L.push([I,Z])});let Q=K.current;fe().sort((I,te)=>{var Z,ae;let re=I.getAttribute("id"),xe=te.getAttribute("id");return((Z=j.get(xe))!=null?Z:0)-((ae=j.get(re))!=null?ae:0)}).forEach(I=>{let te=I.closest(Jf);te?te.appendChild(I.parentElement===te?I:I.closest(`${Jf} > *`)):Q.appendChild(I.parentElement===Q?I:I.closest(`${Jf} > *`))}),L.sort((I,te)=>te[1]-I[1]).forEach(I=>{var te;let Z=(te=K.current)==null?void 0:te.querySelector(`${Di}[${Sr}="${encodeURIComponent(I[0])}"]`);Z?.parentElement.appendChild(Z)})}function le(){let j=fe().find(Q=>Q.getAttribute("aria-disabled")!=="true"),L=j?.getAttribute(Sr);V.setState("value",L||void 0)}function ce(){var j,L,Q,I;if(!i.current.search||v.current.shouldFilter===!1){i.current.filtered.count=o.current.size;return}i.current.filtered.groups=new Set;let te=0;for(let Z of o.current){let ae=(L=(j=f.current.get(Z))==null?void 0:j.value)!=null?L:"",re=(I=(Q=f.current.get(Z))==null?void 0:Q.keywords)!=null?I:[],xe=oe(ae,re);i.current.filtered.items.set(Z,xe),xe>0&&te++}for(let[Z,ae]of c.current)for(let re of ae)if(i.current.filtered.items.get(re)>0){i.current.filtered.groups.add(Z);break}i.current.filtered.count=te}function ue(){var j,L,Q;let I=ve();I&&(((j=I.parentElement)==null?void 0:j.firstChild)===I&&((Q=(L=I.closest(Di))==null?void 0:L.querySelector(lO))==null||Q.scrollIntoView({block:"nearest"})),I.scrollIntoView({block:"nearest"}))}function ve(){var j;return(j=K.current)==null?void 0:j.querySelector(`${Ax}[aria-selected="true"]`)}function fe(){var j;return Array.from(((j=K.current)==null?void 0:j.querySelectorAll(by))||[])}function O(j){let L=fe()[j];L&&V.setState("value",L.getAttribute(Sr))}function F(j){var L;let Q=ve(),I=fe(),te=I.findIndex(ae=>ae===Q),Z=I[te+j];(L=v.current)!=null&&L.loop&&(Z=te+j<0?I[I.length-1]:te+j===I.length?I[0]:I[te+j]),Z&&V.setState("value",Z.getAttribute(Sr))}function W(j){let L=ve(),Q=L?.closest(Di),I;for(;Q&&!I;)Q=j>0?mO(Q,Di):pO(Q,Di),I=Q?.querySelector(by);I?V.setState("value",I.getAttribute(Sr)):F(j)}let ee=()=>O(fe().length-1),$=j=>{j.preventDefault(),j.metaKey?ee():j.altKey?W(1):F(1)},A=j=>{j.preventDefault(),j.metaKey?O(0):j.altKey?W(-1):F(-1)};return y.createElement(Ce.div,{ref:l,tabIndex:-1,...M,"cmdk-root":"",onKeyDown:j=>{var L;(L=M.onKeyDown)==null||L.call(M,j);let Q=j.nativeEvent.isComposing||j.keyCode===229;if(!(j.defaultPrevented||Q))switch(j.key){case"n":case"j":{R&&j.ctrlKey&&$(j);break}case"ArrowDown":{$(j);break}case"p":case"k":{R&&j.ctrlKey&&A(j);break}case"ArrowUp":{A(j);break}case"Home":{j.preventDefault(),O(0);break}case"End":{j.preventDefault(),ee();break}case"Enter":{j.preventDefault();let I=ve();if(I){let te=new Event(Cd);I.dispatchEvent(te)}}}}},y.createElement("label",{"cmdk-label":"",htmlFor:B.inputId,id:B.labelId,style:yO},g),pc(n,j=>y.createElement(Ox.Provider,{value:V},y.createElement(Nx.Provider,{value:B},j))))}),iO=y.forwardRef((n,l)=>{var i,o;let c=Nt(),f=y.useRef(null),d=y.useContext(_x),v=lo(),g=zx(n),m=(o=(i=g.current)==null?void 0:i.forceMount)!=null?o:d?.forceMount;Tl(()=>{if(!m)return v.item(c,d?.id)},[m]);let x=kx(c,f,[n.value,n.children,f],n.keywords),p=gh(),S=Ia(q=>q.value&&q.value===x.current),T=Ia(q=>m||v.filter()===!1?!0:q.search?q.filtered.items.get(c)>0:!0);y.useEffect(()=>{let q=f.current;if(!(!q||n.disabled))return q.addEventListener(Cd,E),()=>q.removeEventListener(Cd,E)},[T,n.onSelect,n.disabled]);function E(){var q,V;C(),(V=(q=g.current).onSelect)==null||V.call(q,x.current)}function C(){p.setState("value",x.current,!0)}if(!T)return null;let{disabled:R,value:M,onSelect:z,forceMount:D,keywords:Y,...K}=n;return y.createElement(Ce.div,{ref:jr(f,l),...K,id:c,"cmdk-item":"",role:"option","aria-disabled":!!R,"aria-selected":!!S,"data-disabled":!!R,"data-selected":!!S,onPointerMove:R||v.getDisablePointerSelection()?void 0:C,onClick:R?void 0:E},n.children)}),oO=y.forwardRef((n,l)=>{let{heading:i,children:o,forceMount:c,...f}=n,d=Nt(),v=y.useRef(null),g=y.useRef(null),m=Nt(),x=lo(),p=Ia(T=>c||x.filter()===!1?!0:T.search?T.filtered.groups.has(d):!0);Tl(()=>x.group(d),[]),kx(d,v,[n.value,n.heading,g]);let S=y.useMemo(()=>({id:d,forceMount:c}),[c]);return y.createElement(Ce.div,{ref:jr(v,l),...f,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},i&&y.createElement("div",{ref:g,"cmdk-group-heading":"","aria-hidden":!0,id:m},i),pc(n,T=>y.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":i?m:void 0},y.createElement(_x.Provider,{value:S},T))))}),sO=y.forwardRef((n,l)=>{let{alwaysRender:i,...o}=n,c=y.useRef(null),f=Ia(d=>!d.search);return!i&&!f?null:y.createElement(Ce.div,{ref:jr(c,l),...o,"cmdk-separator":"",role:"separator"})}),cO=y.forwardRef((n,l)=>{let{onValueChange:i,...o}=n,c=n.value!=null,f=gh(),d=Ia(m=>m.search),v=Ia(m=>m.selectedItemId),g=lo();return y.useEffect(()=>{n.value!=null&&f.setState("search",n.value)},[n.value]),y.createElement(Ce.input,{ref:l,...o,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":g.listId,"aria-labelledby":g.labelId,"aria-activedescendant":v,id:g.inputId,type:"text",value:c?n.value:d,onChange:m=>{c||f.setState("search",m.target.value),i?.(m.target.value)}})}),uO=y.forwardRef((n,l)=>{let{children:i,label:o="Suggestions",...c}=n,f=y.useRef(null),d=y.useRef(null),v=Ia(m=>m.selectedItemId),g=lo();return y.useEffect(()=>{if(d.current&&f.current){let m=d.current,x=f.current,p,S=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let T=m.offsetHeight;x.style.setProperty("--cmdk-list-height",T.toFixed(1)+"px")})});return S.observe(m),()=>{cancelAnimationFrame(p),S.unobserve(m)}}},[]),y.createElement(Ce.div,{ref:jr(f,l),...c,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":o,id:g.listId},pc(n,m=>y.createElement("div",{ref:jr(d,g.listInnerRef),"cmdk-list-sizer":""},m)))}),fO=y.forwardRef((n,l)=>{let{open:i,onOpenChange:o,overlayClassName:c,contentClassName:f,container:d,...v}=n;return y.createElement(kd,{open:i,onOpenChange:o},y.createElement(Hd,{container:d},y.createElement(Ud,{"cmdk-overlay":"",className:c}),y.createElement(Bd,{"aria-label":n.label,"cmdk-dialog":"",className:f},y.createElement(Dx,{ref:l,...v}))))}),dO=y.forwardRef((n,l)=>Ia(i=>i.filtered.count===0)?y.createElement(Ce.div,{ref:l,...n,"cmdk-empty":"",role:"presentation"}):null),hO=y.forwardRef((n,l)=>{let{progress:i,children:o,label:c="Loading...",...f}=n;return y.createElement(Ce.div,{ref:l,...f,"cmdk-loading":"",role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,"aria-label":c},pc(n,d=>y.createElement("div",{"aria-hidden":!0},d)))}),mc=Object.assign(Dx,{List:uO,Item:iO,Input:cO,Group:oO,Separator:sO,Dialog:fO,Empty:dO,Loading:hO});function mO(n,l){let i=n.nextElementSibling;for(;i;){if(i.matches(l))return i;i=i.nextElementSibling}}function pO(n,l){let i=n.previousElementSibling;for(;i;){if(i.matches(l))return i;i=i.previousElementSibling}}function zx(n){let l=y.useRef(n);return Tl(()=>{l.current=n}),l}var Tl=typeof window>"u"?y.useEffect:y.useLayoutEffect;function wr(n){let l=y.useRef();return l.current===void 0&&(l.current=n()),l}function Ia(n){let l=gh(),i=()=>n(l.snapshot());return y.useSyncExternalStore(l.subscribe,i,i)}function kx(n,l,i,o=[]){let c=y.useRef(),f=lo();return Tl(()=>{var d;let v=(()=>{var m;for(let x of i){if(typeof x=="string")return x.trim();if(typeof x=="object"&&"current"in x)return x.current?(m=x.current.textContent)==null?void 0:m.trim():c.current}})(),g=o.map(m=>m.trim());f.value(n,v,g),(d=l.current)==null||d.setAttribute(Sr,v),c.current=v}),c}var vO=()=>{let[n,l]=y.useState(),i=wr(()=>new Map);return Tl(()=>{i.current.forEach(o=>o()),i.current=new Map},[n]),(o,c)=>{i.current.set(o,c),l({})}};function gO(n){let l=n.type;return typeof l=="function"?l(n.props):"render"in l?l.render(n.props):n}function pc({asChild:n,children:l},i){return n&&y.isValidElement(l)?y.cloneElement(gO(l),{ref:l.ref},i(l.props.children)):i(l)}var yO={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function bO({className:n,...l}){return h.jsx(mc,{"data-slot":"command",className:Rt("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",n),...l})}function xO({className:n,...l}){return h.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[h.jsx(dx,{className:"size-4 shrink-0 opacity-50"}),h.jsx(mc.Input,{"data-slot":"command-input",className:Rt("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",n),...l})]})}function SO({className:n,...l}){return h.jsx(mc.List,{"data-slot":"command-list",className:Rt("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",n),...l})}function wO({className:n,...l}){return h.jsx(mc.Item,{"data-slot":"command-item",className:Rt("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",n),...l})}function xy(n,l){if(!n)return{score:0,hits:[]};const i=n.toLowerCase(),o=l.toLowerCase();let c=0,f=0,d=0;const v=[];for(let g=0;g 3&&o.endsWith("ies")?c=o.slice(0,-3)+"y":o.length>3&&o.endsWith("es")?c=o.slice(0,-2):o.length>2&&o.endsWith("s")&&(c=o.slice(0,-1)),c?xy(c,l):null}function CO({text:n,hits:l}){const i=[];let o=0;return l.forEach((c,f)=>{c>o&&i.push(n.slice(o,c)),i.push(h.jsx("b",{children:n[c]},f)),o=c+1}),i.push(n.slice(o)),h.jsx("span",{className:"plabel",children:i})}function TO({open:n,onClose:l,candidates:i}){const[o,c]=y.useState(""),f=y.useMemo(()=>{if(!n)return[];const v=[];for(const g of i()){const m=EO(o,g.label);m&&v.push({...g,score:m.score,hits:m.hits})}return v.sort((g,m)=>m.score-g.score),v.slice(0,40)},[n,o,i]);y.useEffect(()=>{n&&c("")},[n]);const d=v=>{l(),v.run()};return h.jsx(hh,{open:n,onOpenChange:v=>!v&&l(),children:h.jsxs(mh,{id:"palette",className:"palette",showCloseButton:!1,"aria-describedby":void 0,children:[h.jsx(hc,{className:"sr-only",children:"Search and quick actions"}),h.jsxs(bO,{shouldFilter:!1,loop:!0,children:[h.jsxs("div",{id:"palette-inputwrap",children:[h.jsx(gt,{name:"search"}),h.jsx(xO,{id:"palette-input",placeholder:"Search file names, projects, actions…",autoComplete:"off",spellCheck:!1,value:o,onValueChange:c})]}),h.jsx(SO,{id:"palette-results",children:f.length===0?h.jsx("div",{className:"pempty",children:"No matches — search covers file names, projects, and actions"}):f.map(v=>h.jsxs(wO,{value:v.kind+":"+v.label,onSelect:()=>d(v),children:[h.jsx("span",{className:"picon",children:h.jsx(gt,{name:v.icon})}),h.jsx(CO,{text:v.label,hits:v.hits}),h.jsx("span",{className:"pkind",children:v.kind})]},v.kind+":"+v.label))}),h.jsx("footer",{id:"palette-hint",children:"↑↓ navigate · ⏎ select · esc close"})]})]})})}const Li=3,Er=30;function RO(n,l){return Zt({queryKey:["heatDevices",n],queryFn:()=>rn(n+"heat?by=device&days=30"),enabled:l,retry:!1,staleTime:6e4}).data?.devices??null}function Sy(n){const[l,i]=y.useState("all"),{flatFiles:o,heatMap:c,devices:f,scope:d}=n,v=S=>!d||S===d||S.startsWith(d+"/"),g=d?o.filter(S=>v(S.path)):o,m=f&&d?f.map(S=>{const T={};for(const[E,C]of Object.entries(S.folders||{}))v(E)&&(T[E]=C);return{...S,folders:T}}).filter(S=>Object.keys(S.folders).length>0):f,x=Date.now(),p=g.map(S=>{const T=c&&c[S.path]||{},E=S.time?Math.max(0,(x-new Date(S.time).getTime())/864e5):0,C=l==="all"?Fi(T):T[l]||0;return{path:S.path,reads:C,agent:T.agent||0,total:Fi(T),days:E,danger:C>=Li&&E>=Er}});return h.jsxs("div",{className:"insights",children:[h.jsxs("h1",{className:"in-title",children:["Knowledge insights",d?h.jsxs("span",{className:"in-scope",children:[" · ",d]}):null]}),h.jsx("p",{className:"dl-sub",children:d?`Reads over the last 30 days × freshness, for ${d} and everything in it.`:"Reads over the last 30 days × how long since each file changed. Hot but stale knowledge — read a lot, maintained by nobody — is the danger zone."}),h.jsx("div",{className:"in-lens",children:["all","human","agent"].map(S=>h.jsx("button",{className:"in-lens-btn"+(S===l?" active":""),onClick:()=>i(S),children:S==="all"?"All reads":S==="human"?"Human reads":"Agent reads"},S))}),h.jsx("h3",{className:"dl-h3",children:"Map — cell size = reads, color = freshness"}),h.jsx(jO,{pts:p,onOpenFile:n.onOpenFile,onOpenFolder:n.onOpenFolder,isFolder:n.isFolder}),h.jsx("h3",{className:"dl-h3",children:"Reads × freshness"}),h.jsx(AO,{pts:p,onOpenFile:n.onOpenFile}),h.jsx("h3",{className:"dl-h3",children:"Hot path — top files by reads"}),h.jsx(NO,{pts:p,lens:l,onOpenFile:n.onOpenFile}),m&&m.length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h3",{className:"dl-h3",children:"Agent coverage — which agents read which areas"}),h.jsx(OO,{devices:m})]})]})}function MO(n){const l=[[76,195,138],[232,196,84],[224,93,93]],i=Math.min(1,Math.max(0,n/300))*(l.length-1),o=Math.min(l.length-2,Math.floor(i)),c=i-o,f=l[o].map((d,v)=>Math.round(d+(l[o+1][v]-d)*c));return`rgb(${f[0]},${f[1]},${f[2]})`}function wy(n,l,i,o,c){const f=n.reduce((m,x)=>m+x.value,0);if(!f||o<=0||c<=0)return[];const d=n.slice().sort((m,x)=>x.value-m.value).map(m=>({it:m,a:m.value/f*o*c})),v=(m,x)=>{const S=m.reduce((E,C)=>E+C.a,0)/x;let T=0;for(const E of m){const C=E.a/S;T=Math.max(T,C/S,S/C)}return T},g=[];for(;d.length;){const m=o>=c,x=m?c:o,p=[d.shift()];for(;d.length&&v(p.concat(d[0]),x)<=v(p,x);)p.push(d.shift());const S=p.reduce((E,C)=>E+C.a,0)/x;let T=0;for(const E of p){const C=E.a/S;m?g.push({item:E.it,x:l,y:i+T,w:S,h:C}):g.push({item:E.it,x:l+T,y:i,w:C,h:S}),T+=C}m?(l+=S,o-=S):(i+=S,c-=S)}return g}const Wf=15;function jO({pts:n,onOpenFile:l,onOpenFolder:i,isFolder:o}){const d=new Map;for(const g of n){const m=g.path.includes("/")?g.path.split("/")[0]:"/";let x=d.get(m);x||d.set(m,x={name:m,files:[],value:0}),x.files.push(g),x.value+=g.reads+1}const v=[];for(const g of wy([...d.values()],0,0,720,480)){const m=g.item,x=m.name==="/"?"":m.name;if(v.push(h.jsx("rect",{x:g.x+1,y:g.y+1,width:Math.max(0,g.w-2),height:Math.max(0,g.h-2),rx:3,className:"in-tm-group","data-dir":x},"g"+m.name)),g.w>46&&g.h>Wf+10){let S=m.name==="/"?"(root)":m.name;const T=Math.floor((g.w-8)/6);S.length>T&&(S=S.slice(0,Math.max(1,T-1))+"…"),v.push(h.jsx("text",{x:g.x+5,y:g.y+12,className:"in-tm-glabel","data-dir":x,children:S},"gl"+m.name))}const p=wy(m.files.map(S=>({...S,name:S.path.split("/").pop(),value:S.reads+1})),g.x+2,g.y+Wf,Math.max(0,g.w-4),Math.max(0,g.h-Wf-2));for(const S of p)if(v.push(h.jsx("rect",{x:S.x+.6,y:S.y+.6,width:Math.max(.4,S.w-1.2),height:Math.max(.4,S.h-1.2),rx:1.5,fill:MO(S.item.days),className:"in-tm-cell","data-path":S.item.path,children:h.jsx("title",{children:`${S.item.path} — ${S.item.reads} read${S.item.reads===1?"":"s"}/30d · changed ${Math.round(S.item.days)}d ago`})},S.item.path)),S.w>54&&S.h>16){const T=Math.floor((S.w-8)/6);let E=(S.item.danger?"⚠ ":"")+S.item.name;E.length>T&&(E=E.slice(0,Math.max(1,T-1))+"…"),T>=5&&v.push(h.jsx("text",{x:S.x+4.5,y:S.y+12.5,className:"in-tm-label","data-path":S.item.path,children:E},"l"+S.item.path))}}return h.jsx("svg",{viewBox:"0 0 720 480",className:"in-chart in-treemap",onClick:g=>{const m=g.target.closest("[data-path], [data-dir]");if(!m)return;const x=m.getAttribute("data-path");if(x)return l(x);const p=m.getAttribute("data-dir");p&&o(p)&&i(p)},children:v})}function AO({pts:n,onOpenFile:l}){const c={l:44,r:16,t:20,b:34},f=Math.max(Er*2,...n.map(p=>p.days)),d=Math.max(Li*2,...n.map(p=>p.reads)),v=p=>Math.log10(p+1)/Math.log10(f+1),g=p=>Math.log10(p+1)/Math.log10(d+1),m=p=>c.l+v(p)*(720-c.l-c.r),x=p=>360-c.b-g(p)*(360-c.t-c.b);return h.jsxs("svg",{viewBox:"0 0 720 360",className:"in-chart",children:[h.jsx("rect",{x:m(Er),y:c.t,width:720-c.r-m(Er),height:x(Li)-c.t,className:"in-danger-zone"}),h.jsx("line",{x1:m(Er),y1:c.t,x2:m(Er),y2:360-c.b,className:"in-threshold"}),h.jsx("line",{x1:c.l,y1:x(Li),x2:720-c.r,y2:x(Li),className:"in-threshold"}),h.jsx("line",{x1:c.l,y1:360-c.b,x2:720-c.r,y2:360-c.b,className:"in-axis"}),h.jsx("line",{x1:c.l,y1:c.t,x2:c.l,y2:360-c.b,className:"in-axis"}),h.jsx("text",{x:(c.l+720-c.r)/2,y:352,className:"in-label",children:"days since last change →"}),h.jsx("text",{x:12,y:(c.t+360-c.b)/2,className:"in-label",transform:`rotate(-90 12 ${(c.t+360-c.b)/2})`,children:"reads / 30d →"}),h.jsx("text",{x:720-c.r-6,y:c.t+14,className:"in-quad in-quad-danger",textAnchor:"end",children:"hot + stale"}),h.jsx("text",{x:c.l+6,y:c.t+14,className:"in-quad",children:"hot + fresh"}),h.jsx("text",{x:720-c.r-6,y:360-c.b-8,className:"in-quad",textAnchor:"end",children:"cold + stale"}),h.jsx("text",{x:720-c.r-6,y:c.t+28,className:"in-label",textAnchor:"end",children:"dot size = agent share of reads"}),n.map(p=>{const S=p.total?(p.agent||0)/p.total:0;return h.jsx("circle",{cx:Number(m(p.days).toFixed(1)),cy:Number(x(p.reads).toFixed(1)),r:Number((3+4*S).toFixed(1)),className:"in-pt"+(p.danger?" danger":p.reads?"":" cold"),onClick:()=>l(p.path),children:h.jsx("title",{children:`${p.path} — ${p.reads} read${p.reads===1?"":"s"} / 30d · changed ${Math.round(p.days)}d ago`})},p.path)})]})}function NO({pts:n,lens:l,onOpenFile:i}){const o=n.filter(f=>f.reads>0).sort((f,d)=>d.reads-f.reads||d.days-f.days).slice(0,20);if(!o.length)return h.jsx("div",{className:"dl-empty",children:"No reads in the window yet."});const c=o[0].reads;return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"in-hotpath",children:o.map(f=>{const d=l==="agent"?1:l==="human"?0:f.total?f.agent/f.total:0,v=f.reads/c*100;return h.jsxs("div",{className:"in-hp-row",tabIndex:0,role:"button",title:f.danger?`${f.reads} read${f.reads===1?"":"s"}/30d · unchanged ${Math.round(f.days)}d — review this file`:f.path,onClick:()=>i(f.path),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),i(f.path))},children:[h.jsx("span",{className:"in-hp-name"+(f.danger?" danger":""),children:f.path+(f.danger?" ⚠":"")}),h.jsxs("span",{className:"in-hp-bar",children:[h.jsx("span",{className:"in-hp-agent",style:{width:(v*d).toFixed(1)+"%"}}),h.jsx("span",{className:"in-hp-human",style:{width:(v*(1-d)).toFixed(1)+"%"}})]}),h.jsx("span",{className:"in-hp-count",children:f.reads})]},f.path)})}),h.jsxs("p",{className:"in-legend",children:[h.jsx("span",{className:"in-sw agent"})," agent reads ",h.jsx("span",{className:"in-sw human"})," human reads"]})]})}function OO({devices:n}){const l=new Map;for(const S of n)for(const[T,E]of Object.entries(S.folders||{}))l.set(T,(l.get(T)||0)+E);const i=[...l.entries()].sort((S,T)=>T[1]-S[1]).slice(0,12).map(S=>S[0]),o=n.slice(0,12),c=140,f=6,d=Math.min(76,Math.max(34,(720-c-8)/i.length)),v=26,g=720,m=f+o.length*v+58,x=Math.max(1,...o.flatMap(S=>i.map(T=>(S.folders||{})[T]||0))),p=S=>{const T=[23,25,31],E=[245,166,35],C=T.map((R,M)=>Math.round(R+(E[M]-R)*S));return`rgb(${C[0]},${C[1]},${C[2]})`};return h.jsxs("svg",{viewBox:`0 0 ${g} ${m}`,className:"in-chart in-matrix",children:[o.map((S,T)=>{let E=S.name||S.id||"";return E.length>20&&(E=E.slice(0,19)+"…"),h.jsxs("g",{children:[h.jsx("text",{x:c-8,y:f+T*v+17,textAnchor:"end",className:"in-label",children:E}),i.map((C,R)=>{const M=(S.folders||{})[C]||0;return h.jsx("rect",{x:c+R*d,y:f+T*v,width:d-4,height:v-4,rx:3,fill:p(Math.sqrt(M/x)),children:h.jsx("title",{children:`${S.name||S.id} × ${C||"(root)"}: ${M} read${M===1?"":"s"}/30d`})},C)})]},S.id||T)}),i.map((S,T)=>{const E=c+T*d+(d-4)/2,C=f+o.length*v+14;return h.jsx("text",{x:E,y:C,className:"in-label",textAnchor:"end",transform:`rotate(-28 ${E} ${C})`,children:S||"(root)"},S)})]})}function _O(n){const{apiBase:l,target:i,isFolder:o,onMeta:c,onRendered:f}=n,d=i?o(i)?{prefix:i+"/"}:{path:i}:{prefix:""},v="path"in d&&d.path!==void 0?"path="+encodeURIComponent(d.path):"prefix="+encodeURIComponent(d.prefix??""),{data:g,error:m}=Zt({queryKey:["history",l,v,200],queryFn:()=>rn(l+"history?"+v+"&n=200"),staleTime:15e3});if(y.useEffect(()=>{m&&c("History unavailable: "+m.message)},[m,c]),y.useEffect(()=>{g&&f?.()},[g,f]),!g)return null;const x=g.entries||[];return h.jsxs("div",{className:"history",children:[x.length===0&&h.jsx("div",{className:"empty",children:"No history yet."}),x.map((p,S)=>h.jsx(Mx,{entry:p,onOpen:n.onOpen},S))]})}function DO(n,l){return n?l(n)?n+"/ (folder)":n:"all changes"}function Lx(n){const{config:l,apiBase:i,route:o,hub:c,project:f}=n,d=vh(),v=Zi(),{tree:g,flatFiles:m,dirIndex:x,loaded:p}=AN(i,!c||!!f),S=NN(i,c&&!!f&&!!l.reads?.enabled),T=c&&!!f&&!o.path&&!o.view,E=!!n.canInsights&&(o.view==="insights"||T),C=RO(i,E);y.useEffect(()=>{E&&v.invalidateQueries({queryKey:["heat",i]})},[E,i,v]);const R=o.path,M=R||(o.view==="insights"||o.view==="history")&&o.viewTarget||"",z=!!R&&x.has(R),D=!!R&&p&&!z&&m.some(Ee=>Ee.path===R),Y=!!R&&p&&!z&&!D,K=z&&!o.view,[q,V]=y.useState(()=>new Set),B=y.useRef(!0);y.useEffect(()=>{if(!g||!B.current)return;B.current=!1;const Ee=(g.children||[]).filter(ke=>ke.dir);Ee.length===1&&V(ke=>new Set(ke).add(Ee[0].path))},[g]),y.useEffect(()=>{if(!M||!p)return;V(ke=>{const Ae=new Set(ke);for(const on of kN(M))Ae.add(on);return x.has(M)&&Ae.add(M),Ae});const Ee=document.querySelector(`#tree .row[data-path="${CSS.escape(M)}"]`);Ee&&Ee.scrollIntoView({block:"nearest"})},[M,p,x]);const oe=y.useCallback(Ee=>{V(ke=>{const Ae=new Set(ke);return Ae.has(Ee)?Ae.delete(Ee):Ae.add(Ee),Ae})},[]),se=y.useRef(null),le=y.useRef(new Map),ce=y.useRef({key:"",want:0,attempts:0});y.useEffect(()=>{ce.current={key:d,want:rN()==="POP"?le.current.get(d)??0:0,attempts:0}},[d]);const ue=y.useCallback(()=>{const Ee=se.current,ke=ce.current;!Ee||ke.key!==d||ke.attempts>=3||(ke.attempts++,Ee.scrollTo({top:ke.want,behavior:"instant"}))},[d]),ve=y.useCallback(()=>{se.current&&le.current.set(d,se.current.scrollTop)},[d]),fe=y.useCallback(Ee=>{Ft(lN(Ee,f?.id)),Rn()},[f?.id]),O=y.useCallback(Ee=>Ft(Cr("history",f?.id,Ee)),[f?.id]),[F,W]=y.useState(""),[ee,$]=y.useState(null),[A,j]=y.useState(!1),[L,Q]=y.useState(!1);y.useEffect(()=>ij(()=>Q(!0)),[]);const I=y.useRef(null),te=n.panel??null,Z=!te&&c&&!!f&&D,ae=!te&&c&&!!f,re=!te&&D,xe=!te&&(D||c&&!!f&&z),Re=i+"download?path="+encodeURIComponent(R),je=y.useCallback(async()=>{try{const Ee=await fetch(i+"shares",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:R})});if(!Ee.ok)throw new Error(await Ee.text());const ke=await Ee.json(),Ae=await Ki(ke.url);$({url:ke.url,copied:Ae})}catch(Ee){He("Share failed: "+Ee.message,!0)}},[i,R]),et=y.useCallback(()=>{if(!R)return O("");O(z?R+"/":R)},[R,z,O]);y.useEffect(()=>{const Ee=ke=>{(ke.metaKey||ke.ctrlKey)&&ke.key.toLowerCase()==="k"&&(ke.preventDefault(),Q(Ae=>!Ae))};return window.addEventListener("keydown",Ee),()=>window.removeEventListener("keydown",Ee)},[]);const Ge=y.useCallback(()=>{const Ee=[],ke=(Ae,on,bt,Hr)=>Ee.push({icon:Ae,label:on,kind:bt,run:Hr});if(c&&f&&R&&(D&&ke("share","Share: "+R,"action",je),ke("hist","History: "+R,"action",et),D&&ke("download","Download: "+R,"action",()=>I.current?.click())),c&&f&&ke("hist","History: whole project","action",()=>O("")),c)for(const Ae of n.projects||[])(!f||Ae.id!==f.id)&&ke("folder","Switch to project: "+Ae.name,"project",()=>Ft("/"+Ae.id));l.auth?.enabled&&ke("power","Sign out","action",()=>window.location.href="/auth/logout");for(const Ae of x.keys())ke("folder",Ae,"folder",()=>fe(Ae));for(const Ae of m)ke("doc",Ae.path,"file",()=>fe(Ae.path));return Ee},[c,f,R,D,l.auth?.enabled,x,m,n.projects,je,et,O,fe]);y.useEffect(()=>{if(!A)return;const Ee=()=>j(!1);return document.addEventListener("click",Ee),()=>document.removeEventListener("click",Ee)},[A]);const kt=y.useCallback(Ee=>x.has(Ee),[x]);let ht="markdown",nt;te?(ht="view",nt=te.body):o.view==="insights"?(ht="view",nt=n.canInsights?h.jsx(Sy,{flatFiles:m,heatMap:S,devices:C,scope:o.viewTarget||"",onOpenFile:fe,onOpenFolder:fe,isFolder:kt}):h.jsx("div",{className:"empty",children:"Insights is for hub admins and org owners."})):o.view==="history"?(ht="view",nt=h.jsx(_O,{apiBase:i,target:o.viewTarget||"",isFolder:kt,onOpen:fe,onMeta:W,onRendered:ue})):R?p?Y?(ht="view",nt=h.jsxs("div",{className:"notfound",children:[h.jsx("h1",{children:"Couldn't find that"}),h.jsxs("p",{children:[h.jsx("code",{children:R})," isn't in this project right now."]}),h.jsx("p",{className:"nf-sub",children:"If it was just created, it may still be uploading or syncing from a teammate's device — this page checks again automatically every few seconds, so refresh or come back in a moment."}),h.jsx("button",{className:"pbtn",onClick:()=>v.invalidateQueries({queryKey:["tree",i]}),children:"Check again"})]})):z?(ht="view",nt=h.jsx(BN,{node:x.get(R),heatMap:S,hub:c&&!!f,apiBase:i,onOpen:fe,onFullHistory:O,onRendered:ue})):nt=h.jsx(GN,{apiBase:i,path:R,heatMap:S,flatFiles:m,onOpenFile:fe,onMeta:W,onRendered:ue}):nt=h.jsx("div",{className:"empty",children:"Loading…"}):T?(ht="view",nt=h.jsxs(h.Fragment,{children:[h.jsx(Tx,{project:f}),n.canInsights&&h.jsx("div",{className:"home-insights",children:h.jsx(Sy,{flatFiles:m,heatMap:S,devices:C,onOpenFile:fe,onOpenFolder:fe,isFolder:kt})})]})):nt=h.jsx("div",{className:"empty",children:"Select a file to read it."});const Za=te?te.crumb:R?h.jsx(LN,{path:R,onOpenFolder:fe}):o.view==="insights"?"Insights — "+(o.viewTarget||f?.name||""):o.view==="history"?"History — "+DO(o.viewTarget||"",kt):T?f.name:null,Ot=h.jsx(Pi,{crumb:Za,meta:F,actions:h.jsxs(h.Fragment,{children:[Z&&h.jsx("button",{id:"share-btn",className:"btn icon-only",title:"Share","aria-label":"Share",onClick:je,children:h.jsx(gt,{name:"share"})}),ae&&!R&&!o.view&&h.jsxs("button",{id:"history-btn",className:"btn",onClick:et,children:[h.jsx(gt,{name:"hist"})," ",h.jsx("span",{className:"lbl",children:"History"})]}),re&&h.jsx("a",{id:"download",hidden:!0,download:!0,href:Re,ref:I,children:"Download"}),xe&&h.jsx("button",{id:"more-btn",className:"btn icon-only",title:"More actions","aria-label":"More actions",onClick:Ee=>{Ee.stopPropagation(),j(!A)},children:h.jsx(gt,{name:"dots"})}),A&&h.jsxs("div",{id:"more-menu",role:"menu",children:[ae&&h.jsx("button",{className:"more-item",onClick:et,children:"History"}),re&&h.jsx("button",{className:"more-item",onClick:()=>I.current?.click(),children:"Download"}),n.canInsights&&h.jsx("button",{className:"more-item",onClick:()=>{n.onClosePanel?.(),Ft(Cr("insights",f?.id,R))},children:"Insights"})]})]})});return h.jsxs(h.Fragment,{children:[h.jsx(Qi,{vault:n.sidebar.vault,projectsNav:n.sidebar.projectsNav,orgBar:n.sidebar.orgBar,tree:h.jsx(DN,{root:g,expanded:q,onToggle:oe,currentPath:M,listingShowing:K,onOpen:fe}),topbar:Ot,contentClass:ht,contentRef:se,onContentScroll:ve,children:nt}),ee&&h.jsx(FN,{url:ee.url,copied:ee.copied,onClose:()=>$(null)}),h.jsx(TO,{open:L,onClose:()=>Q(!1),candidates:Ge})]})}function zO({config:n}){const l=vh(),i=yx(),[o,c]=y.useState(null),[f,d]=y.useState(null);y.useEffect(()=>d(null),[l]);const v=y.useMemo(()=>{const q=l.match(/^\/join\/([0-9a-f]+)\/?$/);return q?q[1]:null},[l]),{data:g}=tN(!v),{data:m}=nN(!v),x=!!n.auth.admin,{data:p}=gx(x),S=y.useMemo(()=>xx(l,"hub"),[l]),T=y.useMemo(()=>g&&(g.find(q=>q.id===S.project)||o&&g.find(q=>q.org===o)||g[0])||null,[g,S.project,o]);if(y.useEffect(()=>{document.title=T?T.name+" — BearDrive":n.brand||n.volume||"BearDrive"},[T,n]),v)return h.jsx(kO,{token:v,onDone:async q=>{c(q),await i(),Ft("/",{replace:!0})}});const E=n.brand||n.volume||"BearDrive",C=T&&m?.find(q=>q.id===T.org)||null,R=x||(C?C.role==="owner":!1),M=h.jsx(dc,{name:E,onHome:()=>Ft("/"),search:!!T}),z=n.me?h.jsx(EN,{me:n.me,org:C,admin:x?{pending:p?.length||0,onClick:()=>{d({kind:"hub"}),Rn()}}:void 0,onOrgSettings:q=>{d({kind:"org",orgId:q.id}),Rn()}}):void 0;if(!g||!m)return h.jsx(Qi,{vault:M,topbar:h.jsx(Pi,{}),children:h.jsx("div",{className:"empty",children:"Loading…"})});if(!T)return h.jsx(Qi,{vault:M,projectsNav:h.jsx(py,{projects:g}),orgBar:z,topbar:h.jsx(Pi,{}),contentClass:"view",children:h.jsx(jN,{authEnabled:n.auth.enabled,onCreate:async q=>{if(!q){He("Give the project a name.",!0);return}try{const V=await Mr("/api/projects",{name:q});await i(),Ft("/"+V.project.id),He(`Created “${V.project.name}”.`)}catch(V){He("Could not create the project: "+V.message,!0)}}})});const D=f?.kind==="org"?m.find(q=>q.id===f.orgId):null,Y=f?.kind==="hub"?{crumb:"Signup & access",body:h.jsx(dN,{})}:D?{crumb:D.name,body:h.jsx(fN,{org:D,projects:g,myEmail:n.me?.email||"",onProjectsChanged:i})}:null,K=S.view==="settings"?{crumb:"Project settings",body:h.jsx(CN,{project:T,org:C})}:S.view==="install"?{crumb:"Installation",body:h.jsx("div",{className:"onboard",children:h.jsx(Tx,{project:T})})}:null;return S.project!==T.id?h.jsx(iN,{to:"/"+T.id}):h.jsx(Lx,{config:n,apiBase:"/api/p/"+T.id+"/",route:S,hub:!0,project:T,projects:g,canInsights:R,sidebar:{vault:M,projectsNav:h.jsx(py,{projects:g,currentId:T.id,menu:{active:f?null:S.view==="insights"&&!S.viewTarget?"dashboard":S.view==="install"?"install":S.view==="history"&&!S.viewTarget?"history":S.view==="settings"?"settings":null,onDashboard:()=>{d(null),Ft(Cr("insights",T.id)),Rn()},onInstall:()=>{d(null),Ft(Cr("install",T.id)),Rn()},onHistory:()=>{d(null),Ft(Cr("history",T.id)),Rn()},onSettings:()=>{d(null),Ft(Cr("settings",T.id)),Rn()}}}),orgBar:z},panel:Y||K,onClosePanel:()=>d(null)},T.id)}function kO({token:n,onDone:l}){return y.useEffect(()=>{let i=!1;return Mr("/api/invites/"+n).then(o=>{i||(He(`Welcome — you joined the “${o.org.name}” team. Opening its projects…`),l(o.org.id))}).catch(o=>{i||String(o.message).includes("signing in")||(He("Could not accept the invite: "+o.message,!0),l(null))}),()=>{i=!0}},[n]),h.jsx(Qi,{vault:h.jsx(dc,{name:"BearDrive"}),topbar:h.jsx(Pi,{}),children:h.jsx("div",{className:"empty",children:"Joining…"})})}function LO({config:n}){const l=vh(),i=n.volume||"BearDrive";y.useEffect(()=>{document.title=n.brand||i},[n,i]);const o=y.useMemo(()=>xx(l,"volume"),[l]);return h.jsx(Lx,{config:n,apiBase:"/api/",route:o,hub:!1,sidebar:{vault:h.jsx(dc,{name:i,showSignout:n.auth.enabled,search:!0})}})}function HO(){const{data:n}=Vw();return h.jsxs(nj,{delayDuration:150,children:[n?n.mode==="hub"?h.jsx(zO,{config:n}):h.jsx(LO,{config:n}):h.jsx(Qi,{vault:h.jsx(dc,{name:"…",showSignout:!1}),topbar:h.jsx(Pi,{}),children:h.jsx("div",{className:"empty",children:"Loading…"})}),h.jsx(XA,{}),h.jsx(JA,{})]})}const UO=new Aw({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});aw.createRoot(document.getElementById("root")).render(h.jsx(y.StrictMode,{children:h.jsx(Nw,{client:UO,children:h.jsx(HO,{})})})); diff --git a/internal/webapp/static/assets/index-Ky-4qqmy.js b/internal/webapp/static/assets/index-Ky-4qqmy.js new file mode 100644 index 0000000..bc6da96 --- /dev/null +++ b/internal/webapp/static/assets/index-Ky-4qqmy.js @@ -0,0 +1,51 @@ +function JS(n,l){for(var i=0;i o[c]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))o(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const f of d.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&o(f)}).observe(document,{childList:!0,subtree:!0});function i(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function o(c){if(c.ep)return;c.ep=!0;const d=i(c);fetch(c.href,d)}})();function Ry(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var jd={exports:{}},Oi={};var ug;function WS(){if(ug)return Oi;ug=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function i(o,c,d){var f=null;if(d!==void 0&&(f=""+d),c.key!==void 0&&(f=""+c.key),"key"in c){d={};for(var v in c)v!=="key"&&(d[v]=c[v])}else d=c;return c=d.ref,{$$typeof:n,type:o,key:f,ref:c!==void 0?c:null,props:d}}return Oi.Fragment=l,Oi.jsx=i,Oi.jsxs=i,Oi}var dg;function ew(){return dg||(dg=1,jd.exports=WS()),jd.exports}var h=ew(),Ad={exports:{}},we={};var fg;function tw(){if(fg)return we;fg=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),f=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),S=Symbol.iterator;function T(A){return A===null||typeof A!="object"?null:(A=S&&A[S]||A["@@iterator"],typeof A=="function"?A:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,R={};function M(A,j,L){this.props=A,this.context=j,this.refs=R,this.updater=L||E}M.prototype.isReactComponent={},M.prototype.setState=function(A,j){if(typeof A!="object"&&typeof A!="function"&&A!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,j,"setState")},M.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function z(){}z.prototype=M.prototype;function D(A,j,L){this.props=A,this.context=j,this.refs=R,this.updater=L||E}var Y=D.prototype=new z;Y.constructor=D,C(Y,M.prototype),Y.isPureReactComponent=!0;var K=Array.isArray;function q(){}var V={H:null,A:null,T:null,S:null},B=Object.prototype.hasOwnProperty;function oe(A,j,L){var Q=L.ref;return{$$typeof:n,type:A,key:j,ref:Q!==void 0?Q:null,props:L}}function se(A,j){return oe(A.type,j,A.props)}function le(A){return typeof A=="object"&&A!==null&&A.$$typeof===n}function ce(A){var j={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(L){return j[L]})}var ue=/\/+/g;function ve(A,j){return typeof A=="object"&&A!==null&&A.key!=null?ce(""+A.key):j.toString(36)}function de(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(q,q):(A.status="pending",A.then(function(j){A.status==="pending"&&(A.status="fulfilled",A.value=j)},function(j){A.status==="pending"&&(A.status="rejected",A.reason=j)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function N(A,j,L,Q,I){var te=typeof A;(te==="undefined"||te==="boolean")&&(A=null);var Z=!1;if(A===null)Z=!0;else switch(te){case"bigint":case"string":case"number":Z=!0;break;case"object":switch(A.$$typeof){case n:case l:Z=!0;break;case x:return Z=A._init,N(Z(A._payload),j,L,Q,I)}}if(Z)return I=I(A),Z=Q===""?"."+ve(A,0):Q,K(I)?(L="",Z!=null&&(L=Z.replace(ue,"$&/")+"/"),N(I,j,L,"",function(xe){return xe})):I!=null&&(le(I)&&(I=se(I,L+(I.key==null||A&&A.key===I.key?"":(""+I.key).replace(ue,"$&/")+"/")+Z)),j.push(I)),1;Z=0;var ae=Q===""?".":Q+":";if(K(A))for(var re=0;re >>1,$=N[ee];if(0 >>1;eec(L,W))Q<$&&0>c(I,L)?(N[ee]=I,N[Q]=W,ee=Q):(N[ee]=L,N[j]=W,ee=j);else if(Q<$&&0>c(I,W))N[ee]=I,N[Q]=W,ee=Q;else break e}}return F}function c(N,F){var W=N.sortIndex-F.sortIndex;return W!==0?W:N.id-F.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var f=Date,v=f.now();n.unstable_now=function(){return f.now()-v}}var g=[],m=[],x=1,p=null,S=3,T=!1,E=!1,C=!1,R=!1,M=typeof setTimeout=="function"?setTimeout:null,z=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function Y(N){for(var F=i(m);F!==null;){if(F.callback===null)o(m);else if(F.startTime<=N)o(m),F.sortIndex=F.expirationTime,l(g,F);else break;F=i(m)}}function K(N){if(C=!1,Y(N),!E)if(i(g)!==null)E=!0,q||(q=!0,ce());else{var F=i(m);F!==null&&de(K,F.startTime-N)}}var q=!1,V=-1,B=5,oe=-1;function se(){return R?!0:!(n.unstable_now()-oeN&&se());){var ee=p.callback;if(typeof ee=="function"){p.callback=null,S=p.priorityLevel;var $=ee(p.expirationTime<=N);if(N=n.unstable_now(),typeof $=="function"){p.callback=$,Y(N),F=!0;break t}p===i(g)&&o(g),Y(N)}else o(g);p=i(g)}if(p!==null)F=!0;else{var A=i(m);A!==null&&de(K,A.startTime-N),F=!1}}break e}finally{p=null,S=W,T=!1}F=void 0}}finally{F?ce():q=!1}}}var ce;if(typeof D=="function")ce=function(){D(le)};else if(typeof MessageChannel<"u"){var ue=new MessageChannel,ve=ue.port2;ue.port1.onmessage=le,ce=function(){ve.postMessage(null)}}else ce=function(){M(le,0)};function de(N,F){V=M(function(){N(n.unstable_now())},F)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(N){N.callback=null},n.unstable_forceFrameRate=function(N){0>N||125 ee?(N.sortIndex=W,l(m,N),i(g)===null&&N===i(m)&&(C?(z(V),V=-1):C=!0,de(K,W-ee))):(N.sortIndex=$,l(g,N),E||T||(E=!0,q||(q=!0,ce()))),N},n.unstable_shouldYield=se,n.unstable_wrapCallback=function(N){var F=S;return function(){var W=S;S=F;try{return N.apply(this,arguments)}finally{S=W}}}})(_d)),_d}var pg;function aw(){return pg||(pg=1,Nd.exports=nw()),Nd.exports}var Dd={exports:{}},At={};var vg;function lw(){if(vg)return At;vg=1;var n=Rf();function l(g){var m="https://react.dev/errors/"+g;if(1 "u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),Dd.exports=lw(),Dd.exports}var yg;function rw(){if(yg)return Ni;yg=1;var n=aw(),l=Rf(),i=My();function o(e){var t="https://react.dev/errors/"+e;if(1 $||(e.current=ee[$],ee[$]=null,$--)}function L(e,t){$++,ee[$]=e.current,e.current=t}var Q=A(null),I=A(null),te=A(null),Z=A(null);function ae(e,t){switch(L(te,t),L(I,e),L(Q,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Dv(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Dv(t),e=zv(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}j(Q),L(Q,e)}function re(){j(Q),j(I),j(te)}function xe(e){e.memoizedState!==null&&L(Z,e);var t=Q.current,a=zv(t,e.type);t!==a&&(L(I,e),L(Q,a))}function Re(e){I.current===e&&(j(Q),j(I)),Z.current===e&&(j(Z),Ri._currentValue=W)}var je,et;function Ge(e){if(je===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);je=t&&t[1]||"",et=-1 )":-1 s||O[r]!==U[s]){var X=` +`+O[r].replace(" at new "," at ");return e.displayName&&X.includes(" ")&&(X=X.replace(" ",e.displayName)),X}while(1<=r&&0<=s);break}}}finally{kt=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Ge(a):""}function nt(e,t){switch(e.tag){case 26:case 27:case 5:return Ge(e.type);case 16:return Ge("Lazy");case 13:return e.child!==t&&t!==null?Ge("Suspense Fallback"):Ge("Suspense");case 19:return Ge("SuspenseList");case 0:case 15:return ht(e.type,!1);case 11:return ht(e.type.render,!1);case 1:return ht(e.type,!0);case 31:return Ge("Activity");default:return""}}function $a(e){try{var t="",a=null;do t+=nt(e,a),a=e,e=e.return;while(e);return t}catch(r){return` +Error generating stack: `+r.message+` +`+r.stack}}var Nt=Object.prototype.hasOwnProperty,Ee=n.unstable_scheduleCallback,ke=n.unstable_cancelCallback,Ae=n.unstable_shouldYield,sn=n.unstable_requestPaint,xt=n.unstable_now,Ur=n.unstable_getCurrentPriorityLevel,Ja=n.unstable_ImmediatePriority,io=n.unstable_UserBlockingPriority,Wa=n.unstable_NormalPriority,Br=n.unstable_LowPriority,Vn=n.unstable_IdlePriority,oo=n.log,fa=n.unstable_setDisableYieldValue,el=null,_t=null;function Sn(e){if(typeof oo=="function"&&fa(e),_t&&typeof _t.setStrictMode=="function")try{_t.setStrictMode(el,e)}catch{}}var Mt=Math.clz32?Math.clz32:On,gc=Math.log,qr=Math.LN2;function On(e){return e>>>=0,e===0?32:31-(gc(e)/qr|0)|0}var _l=256,Dl=262144,tl=4194304;function Nn(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Se(e,t,a){var r=e.pendingLanes;if(r===0)return 0;var s=0,u=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var w=r&134217727;return w!==0?(r=w&~u,r!==0?s=Nn(r):(b&=w,b!==0?s=Nn(b):a||(a=w&~e,a!==0&&(s=Nn(a))))):(w=r&~u,w!==0?s=Nn(w):b!==0?s=Nn(b):a||(a=r&~e,a!==0&&(s=Nn(a)))),s===0?0:t!==0&&t!==s&&(t&u)===0&&(u=s&-s,a=t&-t,u>=a||u===32&&(a&4194048)!==0)?t:s}function Je(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function mt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function jt(){var e=tl;return tl<<=1,(tl&62914560)===0&&(tl=4194304),e}function ha(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function tt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Lt(e,t,a,r,s,u){var b=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var w=e.entanglements,O=e.expirationTimes,U=e.hiddenUpdates;for(a=b&~a;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Px=/[\n"\\]/g;function un(e){return e.replace(Px,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function wc(e,t,a,r,s,u,b,w){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),t!=null?b==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+cn(t)):e.value!==""+cn(t)&&(e.value=""+cn(t)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),t!=null?Ec(e,b,cn(t)):a!=null?Ec(e,b,cn(a)):r!=null&&e.removeAttribute("value"),s==null&&u!=null&&(e.defaultChecked=!!u),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?e.name=""+cn(w):e.removeAttribute("name")}function Mh(e,t,a,r,s,u,b,w){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||a!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){Sc(e);return}a=a!=null?""+cn(a):"",t=t!=null?""+cn(t):a,w||t===e.value||(e.value=t),e.defaultValue=t}r=r??s,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=w?e.checked:!!r,e.defaultChecked=!!r,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),Sc(e)}function Ec(e,t,a){t==="number"&&uo(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function ql(e,t,a,r){if(e=e.options,t){t={};for(var s=0;s "u"||typeof window.document>"u"||typeof window.document.createElement>"u"),jc=!1;if(Qn)try{var Ir={};Object.defineProperty(Ir,"passive",{get:function(){jc=!0}}),window.addEventListener("test",Ir,Ir),window.removeEventListener("test",Ir,Ir)}catch{jc=!1}var pa=null,Ac=null,ho=null;function zh(){if(ho)return ho;var e,t=Ac,a=t.length,r,s="value"in pa?pa.value:pa.textContent,u=s.length;for(e=0;e=Kr),qh=" ",Gh=!1;function Vh(e,t){switch(e){case"keyup":return x1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Il=!1;function w1(e,t){switch(e){case"compositionend":return Yh(t);case"keypress":return t.which!==32?null:(Gh=!0,qh);case"textInput":return e=t.data,e===qh&&Gh?null:e;default:return null}}function E1(e,t){if(Il)return e==="compositionend"||!zc&&Vh(e,t)?(e=zh(),ho=Ac=pa=null,Il=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1 =t)return{node:a,offset:t-e};e=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=$h(a)}}function Wh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Wh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function em(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=uo(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=uo(e.document)}return t}function Hc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var N1=Qn&&"documentMode"in document&&11>=document.documentMode,Ql=null,Uc=null,$r=null,Bc=!1;function tm(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Bc||Ql==null||Ql!==uo(r)||(r=Ql,"selectionStart"in r&&Hc(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),$r&&Zr($r,r)||($r=r,r=is(Uc,"onSelect"),0 >=b,s-=b,_n=1<<32-Mt(t)+s|a< Me?(ze=ge,ge=null):ze=ge.sibling;var Be=G(k,ge,H[Me],J);if(Be===null){ge===null&&(ge=ze);break}e&&ge&&Be.alternate===null&&t(k,ge),_=u(Be,_,Me),Ue===null?ye=Be:Ue.sibling=Be,Ue=Be,ge=ze}if(Me===H.length)return a(k,ge),Le&&Kn(k,Me),ye;if(ge===null){for(;MeMe?(ze=ge,ge=null):ze=ge.sibling;var Ha=G(k,ge,Be.value,J);if(Ha===null){ge===null&&(ge=ze);break}e&&ge&&Ha.alternate===null&&t(k,ge),_=u(Ha,_,Me),Ue===null?ye=Ha:Ue.sibling=Ha,Ue=Ha,ge=ze}if(Be.done)return a(k,ge),Le&&Kn(k,Me),ye;if(ge===null){for(;!Be.done;Me++,Be=H.next())Be=ne(k,Be.value,J),Be!==null&&(_=u(Be,_,Me),Ue===null?ye=Be:Ue.sibling=Be,Ue=Be);return Le&&Kn(k,Me),ye}for(ge=r(ge);!Be.done;Me++,Be=H.next())Be=P(ge,k,Me,Be.value,J),Be!==null&&(e&&Be.alternate!==null&&ge.delete(Be.key===null?Me:Be.key),_=u(Be,_,Me),Ue===null?ye=Be:Ue.sibling=Be,Ue=Be);return e&&ge.forEach(function($S){return t(k,$S)}),Le&&Kn(k,Me),ye}function Fe(k,_,H,J){if(typeof H=="object"&&H!==null&&H.type===C&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case T:e:{for(var ye=H.key;_!==null;){if(_.key===ye){if(ye=H.type,ye===C){if(_.tag===7){a(k,_.sibling),J=s(_,H.props.children),J.return=k,k=J;break e}}else if(_.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===B&&hl(ye)===_.type){a(k,_.sibling),J=s(_,H.props),ai(J,H),J.return=k,k=J;break e}a(k,_);break}else t(k,_);_=_.sibling}H.type===C?(J=sl(H.props.children,k.mode,J,H.key),J.return=k,k=J):(J=Eo(H.type,H.key,H.props,null,k.mode,J),ai(J,H),J.return=k,k=J)}return b(k);case E:e:{for(ye=H.key;_!==null;){if(_.key===ye)if(_.tag===4&&_.stateNode.containerInfo===H.containerInfo&&_.stateNode.implementation===H.implementation){a(k,_.sibling),J=s(_,H.children||[]),J.return=k,k=J;break e}else{a(k,_);break}else t(k,_);_=_.sibling}J=Pc(H,k.mode,J),J.return=k,k=J}return b(k);case B:return H=hl(H),Fe(k,_,H,J)}if(de(H))return me(k,_,H,J);if(ce(H)){if(ye=ce(H),typeof ye!="function")throw Error(o(150));return H=ye.call(H),be(k,_,H,J)}if(typeof H.then=="function")return Fe(k,_,Oo(H),J);if(H.$$typeof===D)return Fe(k,_,Ro(k,H),J);No(k,H)}return typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint"?(H=""+H,_!==null&&_.tag===6?(a(k,_.sibling),J=s(_,H),J.return=k,k=J):(a(k,_),J=Qc(H,k.mode,J),J.return=k,k=J),b(k)):a(k,_)}return function(k,_,H,J){try{ni=0;var ye=Fe(k,_,H,J);return nr=null,ye}catch(ge){if(ge===tr||ge===jo)throw ge;var Ue=Jt(29,ge,null,k.mode);return Ue.lanes=J,Ue.return=k,Ue}}}var pl=Cm(!0),Tm=Cm(!1),xa=!1;function lu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ru(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Sa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function wa(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Ve&2)!==0){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,t=wo(e),sm(e,null,a),t}return So(e,r,t,a),wo(e)}function li(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,Ht(e,a)}}function iu(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var s=null,u=null;if(a=a.firstBaseUpdate,a!==null){do{var b={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};u===null?s=u=b:u=u.next=b,a=a.next}while(a!==null);u===null?s=u=t:u=u.next=t}else s=u=t;a={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:u,shared:r.shared,callbacks:r.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var ou=!1;function ri(){if(ou){var e=er;if(e!==null)throw e}}function ii(e,t,a,r){ou=!1;var s=e.updateQueue;xa=!1;var u=s.firstBaseUpdate,b=s.lastBaseUpdate,w=s.shared.pending;if(w!==null){s.shared.pending=null;var O=w,U=O.next;O.next=null,b===null?u=U:b.next=U,b=O;var X=e.alternate;X!==null&&(X=X.updateQueue,w=X.lastBaseUpdate,w!==b&&(w===null?X.firstBaseUpdate=U:w.next=U,X.lastBaseUpdate=O))}if(u!==null){var ne=s.baseState;b=0,X=U=O=null,w=u;do{var G=w.lane&-536870913,P=G!==w.lane;if(P?(De&G)===G:(r&G)===G){G!==0&&G===Wl&&(ou=!0),X!==null&&(X=X.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var me=e,be=w;G=t;var Fe=a;switch(be.tag){case 1:if(me=be.payload,typeof me=="function"){ne=me.call(Fe,ne,G);break e}ne=me;break e;case 3:me.flags=me.flags&-65537|128;case 0:if(me=be.payload,G=typeof me=="function"?me.call(Fe,ne,G):me,G==null)break e;ne=p({},ne,G);break e;case 2:xa=!0}}G=w.callback,G!==null&&(e.flags|=64,P&&(e.flags|=8192),P=s.callbacks,P===null?s.callbacks=[G]:P.push(G))}else P={lane:G,tag:w.tag,payload:w.payload,callback:w.callback,next:null},X===null?(U=X=P,O=ne):X=X.next=P,b|=G;if(w=w.next,w===null){if(w=s.shared.pending,w===null)break;P=w,w=P.next,P.next=null,s.lastBaseUpdate=P,s.shared.pending=null}}while(!0);X===null&&(O=ne),s.baseState=O,s.firstBaseUpdate=U,s.lastBaseUpdate=X,u===null&&(s.shared.lanes=0),Ma|=b,e.lanes=b,e.memoizedState=ne}}function Rm(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Mm(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e u?u:8;var b=N.T,w={};N.T=w,Ru(e,!1,t,a);try{var O=s(),U=N.S;if(U!==null&&U(w,O),O!==null&&typeof O=="object"&&typeof O.then=="function"){var X=q1(O,r);ci(e,t,X,an(e))}else ci(e,t,r,an(e))}catch(ne){ci(e,t,{then:function(){},status:"rejected",reason:ne},an())}finally{F.p=u,b!==null&&w.types!==null&&(b.types=w.types),N.T=b}}function P1(){}function Cu(e,t,a,r){if(e.tag!==5)throw Error(o(476));var s=rp(e).queue;lp(e,s,t,W,a===null?P1:function(){return ip(e),a(r)})}function rp(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$n,lastRenderedState:W},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$n,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ip(e){var t=rp(e);t.next===null&&(t=e.alternate.memoizedState),ci(e,t.next.queue,{},an())}function Tu(){return Et(Ri)}function op(){return it().memoizedState}function sp(){return it().memoizedState}function K1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=an();e=Sa(a);var r=wa(t,e,a);r!==null&&(Qt(r,t,a),li(r,t,a)),t={cache:eu()},e.payload=t;return}t=t.return}}function F1(e,t,a){var r=an();a={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Go(e)?up(t,a):(a=Yc(e,t,a,r),a!==null&&(Qt(a,e,r),dp(a,t,r)))}function cp(e,t,a){var r=an();ci(e,t,a,r)}function ci(e,t,a,r){var s={lane:r,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Go(e))up(t,s);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var b=t.lastRenderedState,w=u(b,a);if(s.hasEagerState=!0,s.eagerState=w,$t(w,b))return So(e,t,s,0),Xe===null&&xo(),!1}catch{}if(a=Yc(e,t,s,r),a!==null)return Qt(a,e,r),dp(a,t,r),!0}return!1}function Ru(e,t,a,r){if(r={lane:2,revertLane:ld(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Go(e)){if(t)throw Error(o(479))}else t=Yc(e,a,r,2),t!==null&&Qt(t,e,2)}function Go(e){var t=e.alternate;return e===Te||t!==null&&t===Te}function up(e,t){lr=zo=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function dp(e,t,a){if((a&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,Ht(e,a)}}var ui={readContext:Et,use:Ho,useCallback:at,useContext:at,useEffect:at,useImperativeHandle:at,useLayoutEffect:at,useInsertionEffect:at,useMemo:at,useReducer:at,useRef:at,useState:at,useDebugValue:at,useDeferredValue:at,useTransition:at,useSyncExternalStore:at,useId:at,useHostTransitionStatus:at,useFormState:at,useActionState:at,useOptimistic:at,useMemoCache:at,useCacheRefresh:at};ui.useEffectEvent=at;var fp={readContext:Et,use:Ho,useCallback:function(e,t){return Dt().memoizedState=[e,t===void 0?null:t],e},useContext:Et,useEffect:Xm,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Bo(4194308,4,Wm.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Bo(4194308,4,e,t)},useInsertionEffect:function(e,t){Bo(4,2,e,t)},useMemo:function(e,t){var a=Dt();t=t===void 0?null:t;var r=e();if(vl){Sn(!0);try{e()}finally{Sn(!1)}}return a.memoizedState=[r,t],r},useReducer:function(e,t,a){var r=Dt();if(a!==void 0){var s=a(t);if(vl){Sn(!0);try{a(t)}finally{Sn(!1)}}}else s=t;return r.memoizedState=r.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},r.queue=e,e=e.dispatch=F1.bind(null,Te,e),[r.memoizedState,e]},useRef:function(e){var t=Dt();return e={current:e},t.memoizedState=e},useState:function(e){e=bu(e);var t=e.queue,a=cp.bind(null,Te,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:wu,useDeferredValue:function(e,t){var a=Dt();return Eu(a,e,t)},useTransition:function(){var e=bu(!1);return e=lp.bind(null,Te,e.queue,!0,!1),Dt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var r=Te,s=Dt();if(Le){if(a===void 0)throw Error(o(407));a=a()}else{if(a=t(),Xe===null)throw Error(o(349));(De&127)!==0||Dm(r,t,a)}s.memoizedState=a;var u={value:a,getSnapshot:t};return s.queue=u,Xm(km.bind(null,r,u,e),[e]),r.flags|=2048,ir(9,{destroy:void 0},zm.bind(null,r,u,a,t),null),a},useId:function(){var e=Dt(),t=Xe.identifierPrefix;if(Le){var a=Dn,r=_n;a=(r&~(1<<32-Mt(r)-1)).toString(32)+a,t="_"+t+"R_"+a,a=ko++,0<\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof r.is=="string"?b.createElement("select",{is:r.is}):b.createElement("select"),r.multiple?u.multiple=!0:r.size&&(u.size=r.size);break;default:u=typeof r.is=="string"?b.createElement(s,{is:r.is}):b.createElement(s)}}u[St]=t,u[Bt]=r;e:for(b=t.child;b!==null;){if(b.tag===5||b.tag===6)u.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===t)break e;for(;b.sibling===null;){if(b.return===null||b.return===t)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}t.stateNode=u;e:switch(Tt(u,s,r),s){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Wn(t)}}return $e(t),qu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Wn(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(o(166));if(e=te.current,$l(t)){if(e=t.stateNode,a=t.memoizedProps,r=null,s=wt,s!==null)switch(s.tag){case 27:case 5:r=s.memoizedProps}e[St]=t,e=!!(e.nodeValue===a||r!==null&&r.suppressHydrationWarning===!0||Nv(e.nodeValue,a)),e||ya(t,!0)}else e=os(e).createTextNode(r),e[St]=t,t.stateNode=e}return $e(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(r=$l(t),a!==null){if(e===null){if(!r)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[St]=t}else cl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;$e(t),e=!1}else a=Zc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(en(t),t):(en(t),null);if((t.flags&128)!==0)throw Error(o(558))}return $e(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=$l(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(o(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(o(317));s[St]=t}else cl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;$e(t),s=!1}else s=Zc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(en(t),t):(en(t),null)}return en(t),(t.flags&128)!==0?(t.lanes=a,t):(a=r!==null,e=e!==null&&e.memoizedState!==null,a&&(r=t.child,s=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(s=r.alternate.memoizedState.cachePool.pool),u=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),u!==s&&(r.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Po(t,t.updateQueue),$e(t),null);case 4:return re(),e===null&&sd(t.stateNode.containerInfo),$e(t),null;case 10:return Xn(t.type),$e(t),null;case 19:if(j(rt),r=t.memoizedState,r===null)return $e(t),null;if(s=(t.flags&128)!==0,u=r.rendering,u===null)if(s)fi(r,!1);else{if(lt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=Do(e),u!==null){for(t.flags|=128,fi(r,!1),e=u.updateQueue,t.updateQueue=e,Po(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)cm(a,e),a=a.sibling;return L(rt,rt.current&1|2),Le&&Kn(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&xt()>$o&&(t.flags|=128,s=!0,fi(r,!1),t.lanes=4194304)}else{if(!s)if(e=Do(u),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,Po(t,e),fi(r,!0),r.tail===null&&r.tailMode==="hidden"&&!u.alternate&&!Le)return $e(t),null}else 2*xt()-r.renderingStartTime>$o&&a!==536870912&&(t.flags|=128,s=!0,fi(r,!1),t.lanes=4194304);r.isBackwards?(u.sibling=t.child,t.child=u):(e=r.last,e!==null?e.sibling=u:t.child=u,r.last=u)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=xt(),e.sibling=null,a=rt.current,L(rt,s?a&1|2:a&1),Le&&Kn(t,r.treeForkCount),e):($e(t),null);case 22:case 23:return en(t),cu(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(a&536870912)!==0&&(t.flags&128)===0&&($e(t),t.subtreeFlags&6&&(t.flags|=8192)):$e(t),a=t.updateQueue,a!==null&&Po(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==a&&(t.flags|=2048),e!==null&&j(fl),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Xn(ot),$e(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function W1(e,t){switch(Fc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xn(ot),re(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Re(t),null;case 31:if(t.memoizedState!==null){if(en(t),t.alternate===null)throw Error(o(340));cl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(en(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));cl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return j(rt),null;case 4:return re(),null;case 10:return Xn(t.type),null;case 22:case 23:return en(t),cu(),e!==null&&j(fl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Xn(ot),null;case 25:return null;default:return null}}function Lp(e,t){switch(Fc(t),t.tag){case 3:Xn(ot),re();break;case 26:case 27:case 5:Re(t);break;case 4:re();break;case 31:t.memoizedState!==null&&en(t);break;case 13:en(t);break;case 19:j(rt);break;case 10:Xn(t.type);break;case 22:case 23:en(t),cu(),e!==null&&j(fl);break;case 24:Xn(ot)}}function hi(e,t){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var s=r.next;a=s;do{if((a.tag&e)===e){r=void 0;var u=a.create,b=a.inst;r=u(),b.destroy=r}a=a.next}while(a!==s)}}catch(w){Qe(t,t.return,w)}}function Ta(e,t,a){try{var r=t.updateQueue,s=r!==null?r.lastEffect:null;if(s!==null){var u=s.next;r=u;do{if((r.tag&e)===e){var b=r.inst,w=b.destroy;if(w!==void 0){b.destroy=void 0,s=t;var O=a,U=w;try{U()}catch(X){Qe(s,O,X)}}}r=r.next}while(r!==u)}}catch(X){Qe(t,t.return,X)}}function Hp(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Mm(t,a)}catch(r){Qe(e,e.return,r)}}}function Up(e,t,a){a.props=gl(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(r){Qe(e,t,r)}}function mi(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof a=="function"?e.refCleanup=a(r):a.current=r}}catch(s){Qe(e,t,s)}}function zn(e,t){var a=e.ref,r=e.refCleanup;if(a!==null)if(typeof r=="function")try{r()}catch(s){Qe(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(s){Qe(e,t,s)}else a.current=null}function Bp(e){var t=e.type,a=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break e;case"img":a.src?r.src=a.src:a.srcSet&&(r.srcset=a.srcSet)}}catch(s){Qe(e,e.return,s)}}function Gu(e,t,a){try{var r=e.stateNode;SS(r,e.type,a,t),r[Bt]=t}catch(s){Qe(e,e.return,s)}}function qp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&_a(e.type)||e.tag===4}function Vu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||qp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&_a(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Yu(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=In));else if(r!==4&&(r===27&&_a(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Yu(e,t,a),e=e.sibling;e!==null;)Yu(e,t,a),e=e.sibling}function Ko(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(r!==4&&(r===27&&_a(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Ko(e,t,a),e=e.sibling;e!==null;)Ko(e,t,a),e=e.sibling}function Gp(e){var t=e.stateNode,a=e.memoizedProps;try{for(var r=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);Tt(t,r,a),t[St]=e,t[Bt]=a}catch(u){Qe(e,e.return,u)}}var ea=!1,ut=!1,Iu=!1,Vp=typeof WeakSet=="function"?WeakSet:Set,vt=null;function eS(e,t){if(e=e.containerInfo,dd=ms,e=em(e),Hc(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var s=r.anchorOffset,u=r.focusNode;r=r.focusOffset;try{a.nodeType,u.nodeType}catch{a=null;break e}var b=0,w=-1,O=-1,U=0,X=0,ne=e,G=null;t:for(;;){for(var P;ne!==a||s!==0&&ne.nodeType!==3||(w=b+s),ne!==u||r!==0&&ne.nodeType!==3||(O=b+r),ne.nodeType===3&&(b+=ne.nodeValue.length),(P=ne.firstChild)!==null;)G=ne,ne=P;for(;;){if(ne===e)break t;if(G===a&&++U===s&&(w=b),G===u&&++X===r&&(O=b),(P=ne.nextSibling)!==null)break;ne=G,G=ne.parentNode}ne=P}a=w===-1||O===-1?null:{start:w,end:O}}else a=null}a=a||{start:0,end:0}}else a=null;for(fd={focusedElem:e,selectionRange:a},ms=!1,vt=t;vt!==null;)if(t=vt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,vt=e;else for(;vt!==null;){switch(t=vt,u=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a title"))),Tt(u,r,a),u[St]=e,pt(u),r=u;break e;case"link":var b=Fv("link","href",s).get(r+(a.href||""));if(b){for(var w=0;w Fe&&(b=Fe,Fe=be,be=b);var k=Jh(w,be),_=Jh(w,Fe);if(k&&_&&(P.rangeCount!==1||P.anchorNode!==k.node||P.anchorOffset!==k.offset||P.focusNode!==_.node||P.focusOffset!==_.offset)){var H=ne.createRange();H.setStart(k.node,k.offset),P.removeAllRanges(),be>Fe?(P.addRange(H),P.extend(_.node,_.offset)):(H.setEnd(_.node,_.offset),P.addRange(H))}}}}for(ne=[],P=w;P=P.parentNode;)P.nodeType===1&&ne.push({element:P,left:P.scrollLeft,top:P.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w a?32:a,N.T=null,a=$u,$u=null;var u=Aa,b=ra;if(dt=0,dr=Aa=null,ra=0,(Ve&6)!==0)throw Error(o(331));var w=Ve;if(Ve|=4,Wp(u.current),Zp(u,u.current,b,a),Ve=w,xi(0,!1),_t&&typeof _t.onPostCommitFiberRoot=="function")try{_t.onPostCommitFiberRoot(el,u)}catch{}return!0}finally{F.p=s,N.T=r,gv(e,t)}}function bv(e,t,a){t=fn(a,t),t=Ou(e.stateNode,t,2),e=wa(e,t,2),e!==null&&(tt(e,2),kn(e))}function Qe(e,t,a){if(e.tag===3)bv(e,e,a);else for(;t!==null;){if(t.tag===3){bv(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ja===null||!ja.has(r))){e=fn(a,e),a=xp(2),r=wa(t,a,2),r!==null&&(Sp(a,r,t,e),tt(r,2),kn(r));break}}t=t.return}}function td(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new aS;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(a)||(Ku=!0,s.add(a),e=sS.bind(null,e,t,a),t.then(e,e))}function sS(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Xe===e&&(De&a)===a&&(lt===4||lt===3&&(De&62914560)===De&&300>xt()-Zo?(Ve&2)===0&&fr(e,0):Fu|=a,ur===De&&(ur=0)),kn(e)}function xv(e,t){t===0&&(t=jt()),e=ol(e,t),e!==null&&(tt(e,t),kn(e))}function cS(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),xv(e,a)}function uS(e,t){var a=0;switch(e.tag){case 31:case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(a=s.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(o(314))}r!==null&&r.delete(t),xv(e,a)}function dS(e,t){return Ee(e,t)}var as=null,mr=null,nd=!1,ls=!1,ad=!1,Na=0;function kn(e){e!==mr&&e.next===null&&(mr===null?as=mr=e:mr=mr.next=e),ls=!0,nd||(nd=!0,hS())}function xi(e,t){if(!ad&&ls){ad=!0;do for(var a=!1,r=as;r!==null;){if(e!==0){var s=r.pendingLanes;if(s===0)var u=0;else{var b=r.suspendedLanes,w=r.pingedLanes;u=(1<<31-Mt(42|e)+1)-1,u&=s&~(b&~w),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(a=!0,Cv(r,u))}else u=De,u=Se(r,r===Xe?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(u&3)===0||Je(r,u)||(a=!0,Cv(r,u));r=r.next}while(a);ad=!1}}function fS(){Sv()}function Sv(){ls=nd=!1;var e=0;Na!==0&&ES()&&(e=Na);for(var t=xt(),a=null,r=as;r!==null;){var s=r.next,u=wv(r,t);u===0?(r.next=null,a===null?as=s:a.next=s,s===null&&(mr=a)):(a=r,(e!==0||(u&3)!==0)&&(ls=!0)),r=s}dt!==0&&dt!==5||xi(e),Na!==0&&(Na=0)}function wv(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,u=e.pendingLanes&-62914561;0w)break;var X=O.transferSize,ne=O.initiatorType;X&&_v(ne)&&(O=O.responseEnd,b+=X*(O "u"?null:document;function Iv(e,t,a){var r=pr;if(r&&typeof t=="string"&&t){var s=un(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof a=="string"&&(s+='[crossorigin="'+a+'"]'),Yv.has(s)||(Yv.add(s),e={rel:e,crossOrigin:a,href:t},r.querySelector(s)===null&&(t=r.createElement("link"),Tt(t,"link",e),pt(t),r.head.appendChild(t)))}}function _S(e){ia.D(e),Iv("dns-prefetch",e,null)}function DS(e,t){ia.C(e,t),Iv("preconnect",e,t)}function zS(e,t,a){ia.L(e,t,a);var r=pr;if(r&&e&&t){var s='link[rel="preload"][as="'+un(t)+'"]';t==="image"&&a&&a.imageSrcSet?(s+='[imagesrcset="'+un(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(s+='[imagesizes="'+un(a.imageSizes)+'"]')):s+='[href="'+un(e)+'"]';var u=s;switch(t){case"style":u=vr(e);break;case"script":u=gr(e)}yn.has(u)||(e=p({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),yn.set(u,e),r.querySelector(s)!==null||t==="style"&&r.querySelector(Ci(u))||t==="script"&&r.querySelector(Ti(u))||(t=r.createElement("link"),Tt(t,"link",e),pt(t),r.head.appendChild(t)))}}function kS(e,t){ia.m(e,t);var a=pr;if(a&&e){var r=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+un(r)+'"][href="'+un(e)+'"]',u=s;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=gr(e)}if(!yn.has(u)&&(e=p({rel:"modulepreload",href:e},t),yn.set(u,e),a.querySelector(s)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Ti(u)))return}r=a.createElement("link"),Tt(r,"link",e),pt(r),a.head.appendChild(r)}}}function LS(e,t,a){ia.S(e,t,a);var r=pr;if(r&&e){var s=Ul(r).hoistableStyles,u=vr(e);t=t||"default";var b=s.get(u);if(!b){var w={loading:0,preload:null};if(b=r.querySelector(Ci(u)))w.loading=5;else{e=p({rel:"stylesheet",href:e,"data-precedence":t},a),(a=yn.get(u))&&bd(e,a);var O=b=r.createElement("link");pt(O),Tt(O,"link",e),O._p=new Promise(function(U,X){O.onload=U,O.onerror=X}),O.addEventListener("load",function(){w.loading|=1}),O.addEventListener("error",function(){w.loading|=2}),w.loading|=4,cs(b,t,r)}b={type:"stylesheet",instance:b,count:1,state:w},s.set(u,b)}}}function HS(e,t){ia.X(e,t);var a=pr;if(a&&e){var r=Ul(a).hoistableScripts,s=gr(e),u=r.get(s);u||(u=a.querySelector(Ti(s)),u||(e=p({src:e,async:!0},t),(t=yn.get(s))&&xd(e,t),u=a.createElement("script"),pt(u),Tt(u,"link",e),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},r.set(s,u))}}function US(e,t){ia.M(e,t);var a=pr;if(a&&e){var r=Ul(a).hoistableScripts,s=gr(e),u=r.get(s);u||(u=a.querySelector(Ti(s)),u||(e=p({src:e,async:!0,type:"module"},t),(t=yn.get(s))&&xd(e,t),u=a.createElement("script"),pt(u),Tt(u,"link",e),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},r.set(s,u))}}function Qv(e,t,a,r){var s=(s=te.current)?ss(s):null;if(!s)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=vr(a.href),a=Ul(s).hoistableStyles,r=a.get(t),r||(r={type:"style",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=vr(a.href);var u=Ul(s).hoistableStyles,b=u.get(e);if(b||(s=s.ownerDocument||s,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,b),(u=s.querySelector(Ci(e)))&&!u._p&&(b.instance=u,b.state.loading=5),yn.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},yn.set(e,a),u||BS(s,e,a,b.state))),t&&r===null)throw Error(o(528,""));return b}if(t&&r!==null)throw Error(o(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=gr(a),a=Ul(s).hoistableScripts,r=a.get(t),r||(r={type:"script",instance:null,count:0,state:null},a.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function vr(e){return'href="'+un(e)+'"'}function Ci(e){return'link[rel="stylesheet"]['+e+"]"}function Pv(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function BS(e,t,a,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),Tt(t,"link",a),pt(t),e.head.appendChild(t))}function gr(e){return'[src="'+un(e)+'"]'}function Ti(e){return"script[async]"+e}function Kv(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+un(a.href)+'"]');if(r)return t.instance=r,pt(r),r;var s=p({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),pt(r),Tt(r,"style",s),cs(r,a.precedence,e),t.instance=r;case"stylesheet":s=vr(a.href);var u=e.querySelector(Ci(s));if(u)return t.state.loading|=4,t.instance=u,pt(u),u;r=Pv(a),(s=yn.get(s))&&bd(r,s),u=(e.ownerDocument||e).createElement("link"),pt(u);var b=u;return b._p=new Promise(function(w,O){b.onload=w,b.onerror=O}),Tt(u,"link",r),t.state.loading|=4,cs(u,a.precedence,e),t.instance=u;case"script":return u=gr(a.src),(s=e.querySelector(Ti(u)))?(t.instance=s,pt(s),s):(r=a,(s=yn.get(u))&&(r=p({},a),xd(r,s)),e=e.ownerDocument||e,s=e.createElement("script"),pt(s),Tt(s,"link",r),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,cs(r,a.precedence,e));return t.instance}function cs(e,t,a){for(var r=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=r.length?r[r.length-1]:null,u=s,b=0;b title"):null)}function qS(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Zv(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function GS(e,t,a,r){if(a.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var s=vr(r.href),u=t.querySelector(Ci(s));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ds.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=u,pt(u);return}u=t.ownerDocument||t,r=Pv(r),(s=yn.get(s))&&bd(r,s),u=u.createElement("link"),pt(u);var b=u;b._p=new Promise(function(w,O){b.onload=w,b.onerror=O}),Tt(u,"link",r),a.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=ds.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Sd=0;function VS(e,t){return e.stylesheets&&e.count===0&&hs(e,e.stylesheets),0 Sd?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(s)}}:null}function ds(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)hs(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var fs=null;function hs(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,fs=new Map,t.forEach(YS,e),fs=null,ds.call(e))}function YS(e,t){if(!(t.state.loading&4)){var a=fs.get(e);if(a)var r=a.get(null);else{a=new Map,fs.set(e,a);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u "u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),Od.exports=rw(),Od.exports}var ow=iw(),Zi=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},sw=class extends Zi{#e;#t;#n;constructor(){super(),this.#n=n=>{if(typeof window<"u"&&window.addEventListener){const l=()=>n();return window.addEventListener("visibilitychange",l,!1),()=>{window.removeEventListener("visibilitychange",l)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(n){this.#n=n,this.#t?.(),this.#t=n(l=>{typeof l=="boolean"?this.setFocused(l):this.onFocus()})}setFocused(n){this.#e!==n&&(this.#e=n,this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(l=>{l(n)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Mf=new sw,cw={setTimeout:(n,l)=>setTimeout(n,l),clearTimeout:n=>clearTimeout(n),setInterval:(n,l)=>setInterval(n,l),clearInterval:n=>clearInterval(n)},uw=class{#e=cw;#t=!1;setTimeoutProvider(n){this.#e=n}setTimeout(n,l){return this.#e.setTimeout(n,l)}clearTimeout(n){this.#e.clearTimeout(n)}setInterval(n,l){return this.#e.setInterval(n,l)}clearInterval(n){this.#e.clearInterval(n)}},wl=new uw;function dw(n){setTimeout(n,0)}var fw=typeof window>"u"||"Deno"in globalThis;function Kt(){}function hw(n,l){return typeof n=="function"?n(l):n}function ef(n){return typeof n=="number"&&n>=0&&n!==1/0}function jy(n,l){return Math.max(n+(l||0)-Date.now(),0)}function Ga(n,l){return typeof n=="function"?n(l):n}function ln(n,l){return typeof n=="function"?n(l):n}function xg(n,l){const{type:i="all",exact:o,fetchStatus:c,predicate:d,queryKey:f,stale:v}=n;if(f){if(o){if(l.queryHash!==jf(f,l.options))return!1}else if(!Bi(l.queryKey,f))return!1}if(i!=="all"){const g=l.isActive();if(i==="active"&&!g||i==="inactive"&&g)return!1}return!(typeof v=="boolean"&&l.isStale()!==v||c&&c!==l.state.fetchStatus||d&&!d(l))}function Sg(n,l){const{exact:i,status:o,predicate:c,mutationKey:d}=n;if(d){if(!l.options.mutationKey)return!1;if(i){if(Ui(l.options.mutationKey)!==Ui(d))return!1}else if(!Bi(l.options.mutationKey,d))return!1}return!(o&&l.state.status!==o||c&&!c(l))}function jf(n,l){return(l?.queryKeyHashFn||Ui)(n)}function Ui(n){return JSON.stringify(n,(l,i)=>nf(i)?Object.keys(i).sort().reduce((o,c)=>(o[c]=i[c],o),{}):i)}function Bi(n,l){return n===l?!0:typeof n!=typeof l?!1:n&&l&&typeof n=="object"&&typeof l=="object"?Object.keys(l).every(i=>Bi(n[i],l[i])):!1}var mw=Object.prototype.hasOwnProperty;function Ay(n,l,i=0){if(n===l)return n;if(i>500)return l;const o=wg(n)&&wg(l);if(!o&&!(nf(n)&&nf(l)))return l;const d=(o?n:Object.keys(n)).length,f=o?l:Object.keys(l),v=f.length,g=o?new Array(v):{};let m=0;for(let x=0;x {wl.setTimeout(l,n)})}function af(n,l,i){return typeof i.structuralSharing=="function"?i.structuralSharing(n,l):i.structuralSharing!==!1?Ay(n,l):l}function vw(n,l,i=0){const o=[...n,l];return i&&o.length>i?o.slice(1):o}function gw(n,l,i=0){const o=[l,...n];return i&&o.length>i?o.slice(0,-1):o}var Af=Symbol();function Oy(n,l){return!n.queryFn&&l?.initialPromise?()=>l.initialPromise:!n.queryFn||n.queryFn===Af?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}function Ny(n,l){return typeof n=="function"?n(...l):!!n}function yw(n,l,i){let o=!1,c;return Object.defineProperty(n,"signal",{enumerable:!0,get:()=>(c??=l(),o||(o=!0,c.aborted?i():c.addEventListener("abort",i,{once:!0})),c)}),n}var qi=(()=>{let n=()=>fw;return{isServer(){return n()},setIsServer(l){n=l}}})();function lf(){let n,l;const i=new Promise((c,d)=>{n=c,l=d});i.status="pending",i.catch(()=>{});function o(c){Object.assign(i,c),delete i.resolve,delete i.reject}return i.resolve=c=>{o({status:"fulfilled",value:c}),n(c)},i.reject=c=>{o({status:"rejected",reason:c}),l(c)},i}var bw=dw;function xw(){let n=[],l=0,i=v=>{v()},o=v=>{v()},c=bw;const d=v=>{l?n.push(v):c(()=>{i(v)})},f=()=>{const v=n;n=[],v.length&&c(()=>{o(()=>{v.forEach(g=>{i(g)})})})};return{batch:v=>{let g;l++;try{g=v()}finally{l--,l||f()}return g},batchCalls:v=>(...g)=>{d(()=>{v(...g)})},schedule:d,setNotifyFunction:v=>{i=v},setBatchNotifyFunction:v=>{o=v},setScheduler:v=>{c=v}}}var Rt=xw(),Sw=class extends Zi{#e=!0;#t;#n;constructor(){super(),this.#n=n=>{if(typeof window<"u"&&window.addEventListener){const l=()=>n(!0),i=()=>n(!1);return window.addEventListener("online",l,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",l),window.removeEventListener("offline",i)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(n){this.#n=n,this.#t?.(),this.#t=n(this.setOnline.bind(this))}setOnline(n){this.#e!==n&&(this.#e=n,this.listeners.forEach(i=>{i(n)}))}isOnline(){return this.#e}},Us=new Sw;function ww(n){return Math.min(1e3*2**n,3e4)}function _y(n){return(n??"online")==="online"?Us.isOnline():!0}var rf=class extends Error{constructor(n){super("CancelledError"),this.revert=n?.revert,this.silent=n?.silent}};function Dy(n){let l=!1,i=0,o;const c=lf(),d=()=>c.status!=="pending",f=C=>{if(!d()){const R=new rf(C);S(R),n.onCancel?.(R)}},v=()=>{l=!0},g=()=>{l=!1},m=()=>Mf.isFocused()&&(n.networkMode==="always"||Us.isOnline())&&n.canRun(),x=()=>_y(n.networkMode)&&n.canRun(),p=C=>{d()||(o?.(),c.resolve(C))},S=C=>{d()||(o?.(),c.reject(C))},T=()=>new Promise(C=>{o=R=>{(d()||m())&&C(R)},n.onPause?.()}).then(()=>{o=void 0,d()||n.onContinue?.()}),E=()=>{if(d())return;let C;const R=i===0?n.initialPromise:void 0;try{C=R??n.fn()}catch(M){C=Promise.reject(M)}Promise.resolve(C).then(p).catch(M=>{if(d())return;const z=n.retry??(qi.isServer()?0:3),D=n.retryDelay??ww,Y=typeof D=="function"?D(i,M):D,K=z===!0||typeof z=="number"&&i m()?void 0:T()).then(()=>{l?S(M):E()})})};return{promise:c,status:()=>c.status,cancel:f,continue:()=>(o?.(),c),cancelRetry:v,continueRetry:g,canStart:x,start:()=>(x()?E():T().then(E),c)}}var zy=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ef(this.gcTime)&&(this.#e=wl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(qi.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(wl.clearTimeout(this.#e),this.#e=void 0)}};function Ew(n){return{onFetch:(l,i)=>{const o=l.options,c=l.fetchOptions?.meta?.fetchMore?.direction,d=l.state.data?.pages||[],f=l.state.data?.pageParams||[];let v={pages:[],pageParams:[]},g=0;const m=async()=>{let x=!1;const p=E=>{yw(E,()=>l.signal,()=>x=!0)},S=Oy(l.options,l.fetchOptions),T=async(E,C,R)=>{if(x)return Promise.reject(l.signal.reason);if(C==null&&E.pages.length)return Promise.resolve(E);const z=(()=>{const q={client:l.client,queryKey:l.queryKey,pageParam:C,direction:R?"backward":"forward",meta:l.options.meta};return p(q),q})(),D=await S(z),{maxPages:Y}=l.options,K=R?gw:vw;return{pages:K(E.pages,D,Y),pageParams:K(E.pageParams,C,Y)}};if(c&&d.length){const E=c==="backward",C=E?Cw:Cg,R={pages:d,pageParams:f},M=C(o,R);v=await T(R,M,E)}else{const E=n??d.length;do{const C=g===0?f[0]??o.initialPageParam:Cg(o,v);if(g>0&&C==null)break;v=await T(v,C),g++}while(g l.options.persister?.(m,{client:l.client,queryKey:l.queryKey,meta:l.options.meta,signal:l.signal},i):l.fetchFn=m}}}function Cg(n,{pages:l,pageParams:i}){const o=l.length-1;return l.length>0?n.getNextPageParam(l[o],l,i[o],i):void 0}function Cw(n,{pages:l,pageParams:i}){return l.length>0?n.getPreviousPageParam?.(l[0],l,i[0],i):void 0}var Tw=class extends zy{#e;#t;#n;#a;#r;#l;#o;#i;constructor(n){super(),this.#i=!1,this.#o=n.defaultOptions,this.setOptions(n.options),this.observers=[],this.#r=n.client,this.#a=this.#r.getQueryCache(),this.queryKey=n.queryKey,this.queryHash=n.queryHash,this.#t=Rg(this.options),this.state=n.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#l?.promise}setOptions(n){if(this.options={...this.#o,...n},n?._type&&(this.#e=n._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const l=Rg(this.options);l.data!==void 0&&(this.setState(Tg(l.data,l.dataUpdatedAt)),this.#t=l)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#a.remove(this)}setData(n,l){const i=af(this.state.data,n,this.options);return this.#s({data:i,type:"success",dataUpdatedAt:l?.updatedAt,manual:l?.manual}),i}setState(n){this.#s({type:"setState",state:n})}cancel(n){const l=this.#l?.promise;return this.#l?.cancel(n),l?l.then(Kt).catch(Kt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(n=>ln(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Af||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>Ga(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!jy(this.state.dataUpdatedAt,n)}onFocus(){this.observers.find(l=>l.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#l?.continue()}onOnline(){this.observers.find(l=>l.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#l?.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){this.observers.includes(n)&&(this.observers=this.observers.filter(l=>l!==n),this.observers.length||(this.#l&&(this.#i||this.#u()?this.#l.cancel({revert:!0}):this.#l.cancelRetry()),this.scheduleGc()),this.#a.notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}#u(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(n,l){if(this.state.fetchStatus!=="idle"&&this.#l?.status()!=="rejected"){if(this.state.data!==void 0&&l?.cancelRefetch)this.cancel({silent:!0});else if(this.#l)return this.#l.continueRetry(),this.#l.promise}if(n&&this.setOptions(n),!this.options.queryFn){const g=this.observers.find(m=>m.options.queryFn);g&&this.setOptions(g.options)}const i=new AbortController,o=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(this.#i=!0,i.signal)})},c=()=>{const g=Oy(this.options,l),x=(()=>{const p={client:this.#r,queryKey:this.queryKey,meta:this.meta};return o(p),p})();return this.#i=!1,this.options.persister?this.options.persister(g,x,this):g(x)},f=(()=>{const g={fetchOptions:l,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:c};return o(g),g})();(this.#e==="infinite"?Ew(this.options.pages):this.options.behavior)?.onFetch(f,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==f.fetchOptions?.meta)&&this.#s({type:"fetch",meta:f.fetchOptions?.meta}),this.#l=Dy({initialPromise:l?.initialPromise,fn:f.fetchFn,onCancel:g=>{g instanceof rf&&g.revert&&this.setState({...this.#n,fetchStatus:"idle"}),i.abort()},onFail:(g,m)=>{this.#s({type:"failed",failureCount:g,error:m})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0});try{const g=await this.#l.start();if(g===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(g),this.#a.config.onSuccess?.(g,this),this.#a.config.onSettled?.(g,this.state.error,this),g}catch(g){if(g instanceof rf){if(g.silent)return this.#l.promise;if(g.revert){if(this.state.data===void 0)throw g;return this.state.data}}throw this.#s({type:"error",error:g}),this.#a.config.onError?.(g,this),this.#a.config.onSettled?.(this.state.data,g,this),g}finally{this.scheduleGc()}}#s(n){const l=i=>{switch(n.type){case"failed":return{...i,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...ky(i.data,this.options),fetchMeta:n.meta??null};case"success":const o={...i,...Tg(n.data,n.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=n.manual?o:void 0,o;case"error":const c=n.error;return{...i,error:c,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:c,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...n.state}}};this.state=l(this.state),Rt.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),this.#a.notify({query:this,type:"updated",action:n})})}};function ky(n,l){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:_y(l.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function Tg(n,l){return{data:n,dataUpdatedAt:l??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Rg(n){const l=typeof n.initialData=="function"?n.initialData():n.initialData,i=l!==void 0,o=i?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:l,dataUpdateCount:0,dataUpdatedAt:i?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var Rw=class extends Zi{constructor(n,l){super(),this.options=l,this.#e=n,this.#i=null,this.#o=lf(),this.bindMethods(),this.setOptions(l)}#e;#t=void 0;#n=void 0;#a=void 0;#r;#l;#o;#i;#u;#s;#m;#d;#f;#c;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Mg(this.#t,this.options)?this.#h():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return of(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return of(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#t.removeObserver(this)}setOptions(n){const l=this.options,i=this.#t;if(this.options=this.#e.defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ln(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),l._defaulted&&!tf(this.options,l)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const o=this.hasListeners();o&&jg(this.#t,i,this.options,l)&&this.#h(),this.updateResult(),o&&(this.#t!==i||ln(this.options.enabled,this.#t)!==ln(l.enabled,this.#t)||Ga(this.options.staleTime,this.#t)!==Ga(l.staleTime,this.#t))&&this.#v();const c=this.#g();o&&(this.#t!==i||ln(this.options.enabled,this.#t)!==ln(l.enabled,this.#t)||c!==this.#c)&&this.#y(c)}getOptimisticResult(n){const l=this.#e.getQueryCache().build(this.#e,n),i=this.createResult(l,n);return jw(this,i)&&(this.#a=i,this.#l=this.options,this.#r=this.#t.state),i}getCurrentResult(){return this.#a}trackResult(n,l){return new Proxy(n,{get:(i,o)=>(this.trackProp(o),l?.(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,o))})}trackProp(n){this.#p.add(n)}getCurrentQuery(){return this.#t}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const l=this.#e.defaultQueryOptions(n),i=this.#e.getQueryCache().build(this.#e,l);return i.fetch().then(()=>this.createResult(i,l))}fetch(n){return this.#h({...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#a))}#h(n){this.#w();let l=this.#t.fetch(this.options,n);return n?.throwOnError||(l=l.catch(Kt)),l}#v(){this.#x();const n=Ga(this.options.staleTime,this.#t);if(qi.isServer()||this.#a.isStale||!ef(n))return;const i=jy(this.#a.dataUpdatedAt,n)+1;this.#d=wl.setTimeout(()=>{this.#a.isStale||this.updateResult()},i)}#g(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(n){this.#S(),this.#c=n,!(qi.isServer()||ln(this.options.enabled,this.#t)===!1||!ef(this.#c)||this.#c===0)&&(this.#f=wl.setInterval(()=>{(this.options.refetchIntervalInBackground||Mf.isFocused())&&this.#h()},this.#c))}#b(){this.#v(),this.#y(this.#g())}#x(){this.#d!==void 0&&(wl.clearTimeout(this.#d),this.#d=void 0)}#S(){this.#f!==void 0&&(wl.clearInterval(this.#f),this.#f=void 0)}createResult(n,l){const i=this.#t,o=this.options,c=this.#a,d=this.#r,f=this.#l,g=n!==i?n.state:this.#n,{state:m}=n;let x={...m},p=!1,S;if(l._optimisticResults){const B=this.hasListeners(),oe=!B&&Mg(n,l),se=B&&jg(n,i,l,o);(oe||se)&&(x={...x,...ky(m.data,n.options)}),l._optimisticResults==="isRestoring"&&(x.fetchStatus="idle")}let{error:T,errorUpdatedAt:E,status:C}=x;S=x.data;let R=!1;if(l.placeholderData!==void 0&&S===void 0&&C==="pending"){let B;c?.isPlaceholderData&&l.placeholderData===f?.placeholderData?(B=c.data,R=!0):B=typeof l.placeholderData=="function"?l.placeholderData(this.#m?.state.data,this.#m):l.placeholderData,B!==void 0&&(C="success",S=af(c?.data,B,l),p=!0)}if(l.select&&S!==void 0&&!R)if(c&&S===d?.data&&l.select===this.#u)S=this.#s;else try{this.#u=l.select,S=l.select(S),S=af(c?.data,S,l),this.#s=S,this.#i=null}catch(B){this.#i=B}this.#i&&(T=this.#i,S=this.#s,E=Date.now(),C="error");const M=x.fetchStatus==="fetching",z=C==="pending",D=C==="error",Y=z&&M,K=S!==void 0,V={status:C,fetchStatus:x.fetchStatus,isPending:z,isSuccess:C==="success",isError:D,isInitialLoading:Y,isLoading:Y,data:S,dataUpdatedAt:x.dataUpdatedAt,error:T,errorUpdatedAt:E,failureCount:x.fetchFailureCount,failureReason:x.fetchFailureReason,errorUpdateCount:x.errorUpdateCount,isFetched:n.isFetched(),isFetchedAfterMount:x.dataUpdateCount>g.dataUpdateCount||x.errorUpdateCount>g.errorUpdateCount,isFetching:M,isRefetching:M&&!z,isLoadingError:D&&!K,isPaused:x.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:D&&K,isStale:Of(n,l),refetch:this.refetch,promise:this.#o,isEnabled:ln(l.enabled,n)!==!1};if(this.options.experimental_prefetchInRender){const B=V.data!==void 0,oe=V.status==="error"&&!B,se=ue=>{oe?ue.reject(V.error):B&&ue.resolve(V.data)},le=()=>{const ue=this.#o=V.promise=lf();se(ue)},ce=this.#o;switch(ce.status){case"pending":n.queryHash===i.queryHash&&se(ce);break;case"fulfilled":(oe||V.data!==ce.value)&&le();break;case"rejected":(!oe||V.error!==ce.reason)&&le();break}}return V}updateResult(){const n=this.#a,l=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#l=this.options,this.#r.data!==void 0&&(this.#m=this.#t),tf(l,n))return;this.#a=l;const i=()=>{if(!n)return!0;const{notifyOnChangeProps:o}=this.options,c=typeof o=="function"?o():o;if(c==="all"||!c&&!this.#p.size)return!0;const d=new Set(c??this.#p);return this.options.throwOnError&&d.add("error"),Object.keys(this.#a).some(f=>{const v=f;return this.#a[v]!==n[v]&&d.has(v)})};this.#E({listeners:i()})}#w(){const n=this.#e.getQueryCache().build(this.#e,this.options);if(n===this.#t)return;const l=this.#t;this.#t=n,this.#n=n.state,this.hasListeners()&&(l?.removeObserver(this),n.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#E(n){Rt.batch(()=>{n.listeners&&this.listeners.forEach(l=>{l(this.#a)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function Mw(n,l){return ln(l.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&ln(l.retryOnMount,n)===!1)}function Mg(n,l){return Mw(n,l)||n.state.data!==void 0&&of(n,l,l.refetchOnMount)}function of(n,l,i){if(ln(l.enabled,n)!==!1&&Ga(l.staleTime,n)!=="static"){const o=typeof i=="function"?i(n):i;return o==="always"||o!==!1&&Of(n,l)}return!1}function jg(n,l,i,o){return(n!==l||ln(o.enabled,n)===!1)&&(!i.suspense||n.state.status!=="error")&&Of(n,i)}function Of(n,l){return ln(l.enabled,n)!==!1&&n.isStaleByTime(Ga(l.staleTime,n))}function jw(n,l){return!tf(n.getCurrentResult(),l)}var Aw=class extends zy{#e;#t;#n;#a;constructor(n){super(),this.#e=n.client,this.mutationId=n.mutationId,this.#n=n.mutationCache,this.#t=[],this.state=n.state||Ow(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){this.#t.includes(n)||(this.#t.push(n),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){this.#t=this.#t.filter(l=>l!==n),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#a?.continue()??this.execute(this.state.variables)}async execute(n){const l=()=>{this.#r({type:"continue"})},i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#a=Dy({fn:()=>this.options.mutationFn?this.options.mutationFn(n,i):Promise.reject(new Error("No mutationFn found")),onFail:(d,f)=>{this.#r({type:"failed",failureCount:d,error:f})},onPause:()=>{this.#r({type:"pause"})},onContinue:l,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const o=this.state.status==="pending",c=!this.#a.canStart();try{if(o)l();else{this.#r({type:"pending",variables:n,isPaused:c}),this.#n.config.onMutate&&await this.#n.config.onMutate(n,this,i);const f=await this.options.onMutate?.(n,i);f!==this.state.context&&this.#r({type:"pending",context:f,variables:n,isPaused:c})}const d=await this.#a.start();return await this.#n.config.onSuccess?.(d,n,this.state.context,this,i),await this.options.onSuccess?.(d,n,this.state.context,i),await this.#n.config.onSettled?.(d,null,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(d,null,n,this.state.context,i),this.#r({type:"success",data:d}),d}catch(d){try{await this.#n.config.onError?.(d,n,this.state.context,this,i)}catch(f){Promise.reject(f)}try{await this.options.onError?.(d,n,this.state.context,i)}catch(f){Promise.reject(f)}try{await this.#n.config.onSettled?.(void 0,d,this.state.variables,this.state.context,this,i)}catch(f){Promise.reject(f)}try{await this.options.onSettled?.(void 0,d,n,this.state.context,i)}catch(f){Promise.reject(f)}throw this.#r({type:"error",error:d}),d}finally{this.#n.runNext(this)}}#r(n){const l=i=>{switch(n.type){case"failed":return{...i,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...i,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:n.error,failureCount:i.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=l(this.state),Rt.batch(()=>{this.#t.forEach(i=>{i.onMutationUpdate(n)}),this.#n.notify({mutation:this,type:"updated",action:n})})}};function Ow(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Nw=class extends Zi{constructor(n={}){super(),this.config=n,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(n,l,i){const o=new Aw({client:n,mutationCache:this,mutationId:++this.#n,options:n.defaultMutationOptions(l),state:i});return this.add(o),o}add(n){this.#e.add(n);const l=Ss(n);if(typeof l=="string"){const i=this.#t.get(l);i?i.push(n):this.#t.set(l,[n])}this.notify({type:"added",mutation:n})}remove(n){if(this.#e.delete(n)){const l=Ss(n);if(typeof l=="string"){const i=this.#t.get(l);if(i)if(i.length>1){const o=i.indexOf(n);o!==-1&&i.splice(o,1)}else i[0]===n&&this.#t.delete(l)}}this.notify({type:"removed",mutation:n})}canRun(n){const l=Ss(n);if(typeof l=="string"){const o=this.#t.get(l)?.find(c=>c.state.status==="pending");return!o||o===n}else return!0}runNext(n){const l=Ss(n);return typeof l=="string"?this.#t.get(l)?.find(o=>o!==n&&o.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Rt.batch(()=>{this.#e.forEach(n=>{this.notify({type:"removed",mutation:n})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(n){const l={exact:!0,...n};return this.getAll().find(i=>Sg(l,i))}findAll(n={}){return this.getAll().filter(l=>Sg(n,l))}notify(n){Rt.batch(()=>{this.listeners.forEach(l=>{l(n)})})}resumePausedMutations(){const n=this.getAll().filter(l=>l.state.isPaused);return Rt.batch(()=>Promise.all(n.map(l=>l.continue().catch(Kt))))}};function Ss(n){return n.options.scope?.id}var _w=class extends Zi{constructor(n={}){super(),this.config=n,this.#e=new Map}#e;build(n,l,i){const o=l.queryKey,c=l.queryHash??jf(o,l);let d=this.get(c);return d||(d=new Tw({client:n,queryKey:o,queryHash:c,options:n.defaultQueryOptions(l),state:i,defaultOptions:n.getQueryDefaults(o)}),this.add(d)),d}add(n){this.#e.has(n.queryHash)||(this.#e.set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const l=this.#e.get(n.queryHash);l&&(n.destroy(),l===n&&this.#e.delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){Rt.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return this.#e.get(n)}getAll(){return[...this.#e.values()]}find(n){const l={exact:!0,...n};return this.getAll().find(i=>xg(l,i))}findAll(n={}){const l=this.getAll();return Object.keys(n).length>0?l.filter(i=>xg(n,i)):l}notify(n){Rt.batch(()=>{this.listeners.forEach(l=>{l(n)})})}onFocus(){Rt.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){Rt.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},Dw=class{#e;#t;#n;#a;#r;#l;#o;#i;constructor(n={}){this.#e=n.queryCache||new _w,this.#t=n.mutationCache||new Nw,this.#n=n.defaultOptions||{},this.#a=new Map,this.#r=new Map,this.#l=0}mount(){this.#l++,this.#l===1&&(this.#o=Mf.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=Us.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#l--,this.#l===0&&(this.#o?.(),this.#o=void 0,this.#i?.(),this.#i=void 0)}isFetching(n){return this.#e.findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return this.#t.findAll({...n,status:"pending"}).length}getQueryData(n){const l=this.defaultQueryOptions({queryKey:n});return this.#e.get(l.queryHash)?.state.data}ensureQueryData(n){const l=this.defaultQueryOptions(n),i=this.#e.build(this,l),o=i.state.data;return o===void 0?this.fetchQuery(n):(n.revalidateIfStale&&i.isStaleByTime(Ga(l.staleTime,i))&&this.prefetchQuery(l),Promise.resolve(o))}getQueriesData(n){return this.#e.findAll(n).map(({queryKey:l,state:i})=>{const o=i.data;return[l,o]})}setQueryData(n,l,i){const o=this.defaultQueryOptions({queryKey:n}),d=this.#e.get(o.queryHash)?.state.data,f=hw(l,d);if(f!==void 0)return this.#e.build(this,o).setData(f,{...i,manual:!0})}setQueriesData(n,l,i){return Rt.batch(()=>this.#e.findAll(n).map(({queryKey:o})=>[o,this.setQueryData(o,l,i)]))}getQueryState(n){const l=this.defaultQueryOptions({queryKey:n});return this.#e.get(l.queryHash)?.state}removeQueries(n){const l=this.#e;Rt.batch(()=>{l.findAll(n).forEach(i=>{l.remove(i)})})}resetQueries(n,l){const i=this.#e;return Rt.batch(()=>(i.findAll(n).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...n},l)))}cancelQueries(n,l={}){const i={revert:!0,...l},o=Rt.batch(()=>this.#e.findAll(n).map(c=>c.cancel(i)));return Promise.all(o).then(Kt).catch(Kt)}invalidateQueries(n,l={}){return Rt.batch(()=>(this.#e.findAll(n).forEach(i=>{i.invalidate()}),n?.refetchType==="none"?Promise.resolve():this.refetchQueries({...n,type:n?.refetchType??n?.type??"active"},l)))}refetchQueries(n,l={}){const i={...l,cancelRefetch:l.cancelRefetch??!0},o=Rt.batch(()=>this.#e.findAll(n).filter(c=>!c.isDisabled()&&!c.isStatic()).map(c=>{let d=c.fetch(void 0,i);return i.throwOnError||(d=d.catch(Kt)),c.state.fetchStatus==="paused"?Promise.resolve():d}));return Promise.all(o).then(Kt)}fetchQuery(n){const l=this.defaultQueryOptions(n);l.retry===void 0&&(l.retry=!1);const i=this.#e.build(this,l);return i.isStaleByTime(Ga(l.staleTime,i))?i.fetch(l):Promise.resolve(i.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(Kt).catch(Kt)}fetchInfiniteQuery(n){return n._type="infinite",this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(Kt).catch(Kt)}ensureInfiniteQueryData(n){return n._type="infinite",this.ensureQueryData(n)}resumePausedMutations(){return Us.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(n){this.#n=n}setQueryDefaults(n,l){this.#a.set(Ui(n),{queryKey:n,defaultOptions:l})}getQueryDefaults(n){const l=[...this.#a.values()],i={};return l.forEach(o=>{Bi(n,o.queryKey)&&Object.assign(i,o.defaultOptions)}),i}setMutationDefaults(n,l){this.#r.set(Ui(n),{mutationKey:n,defaultOptions:l})}getMutationDefaults(n){const l=[...this.#r.values()],i={};return l.forEach(o=>{Bi(n,o.mutationKey)&&Object.assign(i,o.defaultOptions)}),i}defaultQueryOptions(n){if(n._defaulted)return n;const l={...this.#n.queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return l.queryHash||(l.queryHash=jf(l.queryKey,l)),l.refetchOnReconnect===void 0&&(l.refetchOnReconnect=l.networkMode!=="always"),l.throwOnError===void 0&&(l.throwOnError=!!l.suspense),!l.networkMode&&l.persister&&(l.networkMode="offlineFirst"),l.queryFn===Af&&(l.enabled=!1),l}defaultMutationOptions(n){return n?._defaulted?n:{...this.#n.mutations,...n?.mutationKey&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Ly=y.createContext(void 0),$i=n=>{const l=y.useContext(Ly);if(!l)throw new Error("No QueryClient set, use QueryClientProvider to set one");return l},zw=({client:n,children:l})=>(y.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),h.jsx(Ly.Provider,{value:n,children:l})),Hy=y.createContext(!1),kw=()=>y.useContext(Hy);Hy.Provider;function Lw(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}var Hw=y.createContext(Lw()),Uw=()=>y.useContext(Hw),Bw=(n,l,i)=>{const o=i?.state.error&&typeof n.throwOnError=="function"?Ny(n.throwOnError,[i.state.error,i]):n.throwOnError;(n.suspense||n.experimental_prefetchInRender||o)&&(l.isReset()||(n.retryOnMount=!1))},qw=n=>{y.useEffect(()=>{n.clearReset()},[n])},Gw=({result:n,errorResetBoundary:l,throwOnError:i,query:o,suspense:c})=>n.isError&&!l.isReset()&&!n.isFetching&&o&&(c&&n.data===void 0||Ny(i,[n.error,o])),Vw=n=>{if(n.suspense){const i=c=>c==="static"?c:Math.max(c??1e3,1e3),o=n.staleTime;n.staleTime=typeof o=="function"?(...c)=>i(o(...c)):i(o),typeof n.gcTime=="number"&&(n.gcTime=Math.max(n.gcTime,1e3))}},Yw=(n,l)=>n.isLoading&&n.isFetching&&!l,Iw=(n,l)=>n?.suspense&&l.isPending,Ag=(n,l,i)=>l.fetchOptimistic(n).catch(()=>{i.clearReset()});function Qw(n,l,i){const o=kw(),c=Uw(),d=$i(),f=d.defaultQueryOptions(n);d.getDefaultOptions().queries?._experimental_beforeQuery?.(f);const v=d.getQueryCache().get(f.queryHash),g=n.subscribed!==!1;f._optimisticResults=o?"isRestoring":g?"optimistic":void 0,Vw(f),Bw(f,c,v),qw(c);const m=!d.getQueryCache().get(f.queryHash),[x]=y.useState(()=>new l(d,f)),p=x.getOptimisticResult(f),S=!o&&g;if(y.useSyncExternalStore(y.useCallback(T=>{const E=S?x.subscribe(Rt.batchCalls(T)):Kt;return x.updateResult(),E},[x,S]),()=>x.getCurrentResult(),()=>x.getCurrentResult()),y.useEffect(()=>{x.setOptions(f)},[f,x]),Iw(f,p))throw Ag(f,x,c);if(Gw({result:p,errorResetBoundary:c,throwOnError:f.throwOnError,query:v,suspense:f.suspense}))throw p.error;return d.getDefaultOptions().queries?._experimental_afterQuery?.(f,p),f.experimental_prefetchInRender&&!qi.isServer()&&Yw(p,o)&&(m?Ag(f,x,c):v?.promise)?.catch(Kt).finally(()=>{x.updateResult()}),f.notifyOnChangeProps?p:x.trackResult(p)}function Zt(n,l){return Qw(n,Rw)}function Uy(){throw location.href="/auth/login?next="+encodeURIComponent(location.pathname+location.search),new Error("signing in…")}async function on(n){const l=await fetch(n);if(l.status===401&&Uy(),!l.ok)throw new Error(await l.text());return l.json()}async function Ba(n,l,i){const o={method:n};i!==void 0&&(o.headers={"Content-Type":"application/json"},o.body=JSON.stringify(i));const c=await fetch(l,o);if(!c.ok)throw new Error(await c.text());return c.status===204?{}:c.json()}async function Ar(n,l){const i=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l||{})});if(i.status===401&&Uy(),!i.ok)throw new Error(await i.text());return i.json()}function Pw(){return Zt({queryKey:["config"],queryFn:async()=>{const n=await on("/api/config");return n.auth.enabled&&!n.me&&(location.href="/auth/login?next="+encodeURIComponent(location.pathname+location.search),await new Promise(()=>{})),n},staleTime:1/0})}var zr=My();const Kw=Ry(zr);function Og(n,l){if(typeof n=="function")return n(l);n!=null&&(n.current=l)}function Or(...n){return l=>{let i=!1;const o=n.map(c=>{const d=Og(c,l);return!i&&typeof d=="function"&&(i=!0),d});if(i)return()=>{for(let c=0;c {let{children:c,...d}=i,f=null,v=!1;const g=[];Ng(c)&&typeof ws=="function"&&(c=ws(c._payload)),y.Children.forEach(c,S=>{if(Ww(S)){v=!0;const T=S;let E="child"in T.props?T.props.child:T.props.children;Ng(E)&&typeof ws=="function"&&(E=ws(E._payload)),f=Zw(T,E),g.push(f?.props?.children)}else g.push(S)}),f?f=y.cloneElement(f,void 0,g):!v&&y.Children.count(c)===1&&y.isValidElement(c)&&(f=c);const m=f?Jw(f):void 0,x=Ye(o,m);if(!f){if(c||c===0)throw new Error(v?aE(n):nE(n));return c}const p=$w(d,f.props??{});return f.type!==y.Fragment&&(p.ref=o?x:m),y.cloneElement(f,p)});return l.displayName=`${n}.Slot`,l}var Fw=El("Slot"),By=Symbol.for("radix.slottable");function Xw(n){const l=i=>"child"in i?i.children(i.child):i.children;return l.displayName=`${n}.Slottable`,l.__radixId=By,l}var Zw=(n,l)=>{if("child"in n.props){const i=n.props.child;return y.isValidElement(i)?y.cloneElement(i,void 0,n.props.children(i.props.children)):null}return y.isValidElement(l)?l:null};function $w(n,l){const i={...l};for(const o in l){const c=n[o],d=l[o];/^on[A-Z]/.test(o)?c&&d?i[o]=(...v)=>{const g=d(...v);return c(...v),g}:c&&(i[o]=c):o==="style"?i[o]={...c,...d}:o==="className"&&(i[o]=[c,d].filter(Boolean).join(" "))}return{...n,...i}}function Jw(n){let l=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,i=l&&"isReactWarning"in l&&l.isReactWarning;return i?n.ref:(l=Object.getOwnPropertyDescriptor(n,"ref")?.get,i=l&&"isReactWarning"in l&&l.isReactWarning,i?n.props.ref:n.props.ref||n.ref)}function Ww(n){return y.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===By}var eE=Symbol.for("react.lazy");function Ng(n){return n!=null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===eE&&"_payload"in n&&tE(n._payload)}function tE(n){return typeof n=="object"&&n!==null&&"then"in n}var nE=n=>`${n} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,aE=n=>`${n} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,ws=Fs[" use ".trim().toString()],lE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ce=lE.reduce((n,l)=>{const i=El(`Primitive.${l}`),o=y.forwardRef((c,d)=>{const{asChild:f,...v}=c,g=f?i:l;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(g,{...v,ref:d})});return o.displayName=`Primitive.${l}`,{...n,[l]:o}},{});function qy(n,l){n&&zr.flushSync(()=>n.dispatchEvent(l))}var Gy=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),rE="VisuallyHidden",Vy=y.forwardRef((n,l)=>h.jsx(Ce.span,{...n,ref:l,style:{...Gy,...n.style}}));Vy.displayName=rE;var iE=Vy;function Pa(n,l=[]){let i=[];function o(d,f){const v=y.createContext(f);v.displayName=d+"Context";const g=i.length;i=[...i,f];const m=p=>{const{scope:S,children:T,...E}=p,C=S?.[n]?.[g]||v,R=y.useMemo(()=>E,Object.values(E));return h.jsx(C.Provider,{value:R,children:T})};m.displayName=d+"Provider";function x(p,S,T={}){const{optional:E=!1}=T,C=S?.[n]?.[g]||v,R=y.useContext(C);if(R)return R;if(f!==void 0)return f;if(!E)throw new Error(`\`${p}\` must be used within \`${d}\``)}return[m,x]}const c=()=>{const d=i.map(f=>y.createContext(f));return function(v){const g=v?.[n]||d;return y.useMemo(()=>({[`__scope${n}`]:{...v,[n]:g}}),[v,g])}};return c.scopeName=n,[o,oE(c,...l)]}function oE(...n){const l=n[0];if(n.length===1)return l;const i=()=>{const o=n.map(c=>({useScope:c(),scopeName:c.scopeName}));return function(d){const f=o.reduce((v,{useScope:g,scopeName:m})=>{const p=g(d)[`__scope${m}`];return{...v,...p}},{});return y.useMemo(()=>({[`__scope${l.scopeName}`]:f}),[f])}};return i.scopeName=l.scopeName,i}function Nf(n){const l=n+"CollectionProvider",[i,o]=Pa(l),[c,d]=i(l,{collectionRef:{current:null},itemMap:new Map}),f=C=>{const{scope:R,children:M}=C,z=y.useRef(null),D=y.useRef(new Map).current;return h.jsx(c,{scope:R,itemMap:D,collectionRef:z,children:M})};f.displayName=l;const v=n+"CollectionSlot",g=El(v),m=y.forwardRef((C,R)=>{const{scope:M,children:z}=C,D=d(v,M),Y=Ye(R,D.collectionRef);return h.jsx(g,{ref:Y,children:z})});m.displayName=v;const x=n+"CollectionItemSlot",p="data-radix-collection-item",S=El(x),T=y.forwardRef((C,R)=>{const{scope:M,children:z,...D}=C,Y=y.useRef(null),K=Ye(R,Y),q=d(x,M);return y.useEffect(()=>(q.itemMap.set(Y,{ref:Y,...D}),()=>{q.itemMap.delete(Y)})),h.jsx(S,{[p]:"",ref:K,children:z})});T.displayName=x;function E(C){const R=d(n+"CollectionConsumer",C);return y.useCallback(()=>{const z=R.collectionRef.current;if(!z)return[];const D=Array.from(z.querySelectorAll(`[${p}]`));return Array.from(R.itemMap.values()).sort((q,V)=>D.indexOf(q.ref.current)-D.indexOf(V.ref.current))},[R.collectionRef,R.itemMap])}return[{Provider:f,Slot:m,ItemSlot:T},E,o]}function pe(n,l,{checkForDefaultPrevented:i=!0}={}){return function(c){if(n?.(c),i===!1||!c||!c.defaultPrevented)return l?.(c)}}var yt=globalThis?.document?y.useLayoutEffect:()=>{},sE=Fs[" useInsertionEffect ".trim().toString()]||yt;function Nr({prop:n,defaultProp:l,onChange:i=()=>{},caller:o}){const[c,d,f]=cE({defaultProp:l,onChange:i}),v=n!==void 0,g=v?n:c;{const x=y.useRef(n!==void 0);y.useEffect(()=>{const p=x.current;p!==v&&console.warn(`${o} is changing from ${p?"controlled":"uncontrolled"} to ${v?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),x.current=v},[v,o])}const m=y.useCallback(x=>{if(v){const p=uE(x)?x(n):x;p!==n&&f.current?.(p)}else d(x)},[v,n,d,f]);return[g,m]}function cE({defaultProp:n,onChange:l}){const[i,o]=y.useState(n),c=y.useRef(i),d=y.useRef(l);return sE(()=>{d.current=l},[l]),y.useEffect(()=>{c.current!==i&&(d.current?.(i),c.current=i)},[i,c]),[i,o,d]}function uE(n){return typeof n=="function"}function dE(n,l){return y.useReducer((i,o)=>l[i][o]??i,n)}var jn=n=>{const{present:l,children:i}=n,o=fE(l),c=typeof i=="function"?i({present:o.isPresent}):y.Children.only(i),d=hE(o.ref,mE(c));return typeof i=="function"||o.isPresent?y.cloneElement(c,{ref:d}):null};jn.displayName="Presence";function fE(n){const[l,i]=y.useState(),o=y.useRef(null),c=y.useRef(n),d=y.useRef("none"),f=y.useRef(void 0),v=n?"mounted":"unmounted",[g,m]=dE(v,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{g==="mounted"?(d.current=f.current??_i(o.current),f.current=void 0):d.current="none"},[g]),yt(()=>{const x=o.current,p=c.current;if(p!==n){const T=d.current,E=_i(x);n?(f.current=E,m("MOUNT")):E==="none"||x?.display==="none"?m("UNMOUNT"):m(p&&T!==E?"ANIMATION_OUT":"UNMOUNT"),c.current=n}},[n,m]),yt(()=>{if(l){let x;const p=l.ownerDocument.defaultView??window,S=E=>{const R=_i(o.current).includes(CSS.escape(E.animationName));if(E.target===l&&R&&(m("ANIMATION_END"),!c.current)){const M=l.style.animationFillMode;l.style.animationFillMode="forwards",x=p.setTimeout(()=>{l.style.animationFillMode==="forwards"&&(l.style.animationFillMode=M)})}},T=E=>{E.target===l&&(d.current=_i(o.current))};return l.addEventListener("animationstart",T),l.addEventListener("animationcancel",S),l.addEventListener("animationend",S),()=>{p.clearTimeout(x),l.removeEventListener("animationstart",T),l.removeEventListener("animationcancel",S),l.removeEventListener("animationend",S)}}else m("ANIMATION_END")},[l,m]),{isPresent:["mounted","unmountSuspended"].includes(g),ref:y.useCallback(x=>{if(x){const p=getComputedStyle(x);o.current=p,f.current=_i(p)}else o.current=null;i(x)},[])}}function _g(n,l){if(typeof n=="function")return n(l);n!=null&&(n.current=l)}function hE(...n){const l=y.useRef(n);return l.current=n,y.useCallback(i=>{const o=l.current;let c=!1;const d=o.map(f=>{const v=_g(f,i);return!c&&typeof v=="function"&&(c=!0),v});if(c)return()=>{for(let f=0;f {}),vE=0;function Ot(n){const[l,i]=y.useState(pE());return yt(()=>{i(o=>o??String(vE++))},[n]),l?`radix-${l}`:""}var gE=y.createContext(void 0);function _f(n){const l=y.useContext(gE);return n||l||"ltr"}function xn(n){const l=y.useRef(n);return y.useEffect(()=>{l.current=n}),y.useMemo(()=>((...i)=>l.current?.(...i)),[])}var yE="DismissableLayer",sf="dismissableLayer.update",bE="dismissableLayer.pointerDownOutside",xE="dismissableLayer.focusOutside",Dg,Df=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ji=y.forwardRef((n,l)=>{const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:v,onDismiss:g,...m}=n,x=y.useContext(Df),[p,S]=y.useState(null),T=p?.ownerDocument??globalThis?.document,[,E]=y.useState({}),C=Ye(l,S),R=Array.from(x.layers),[M]=[...x.layersWithOutsidePointerEventsDisabled].slice(-1),z=M?R.indexOf(M):-1,D=p?R.indexOf(p):-1,Y=x.layersWithOutsidePointerEventsDisabled.size>0,K=D>=z,q=y.useRef(!1),V=TE(le=>{d?.(le),v?.(le),le.defaultPrevented||g?.()},{ownerDocument:T,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:q,dismissableSurfaces:x.dismissableSurfaces,shouldHandlePointerDownOutside:y.useCallback(le=>{if(!(le instanceof Node))return!1;const ce=[...x.branches].some(ue=>ue.contains(le));return K&&!ce},[x.branches,K])}),B=RE(le=>{if(o&&q.current)return;const ce=le.target;[...x.branches].some(ve=>ve.contains(ce))||(f?.(le),v?.(le),le.defaultPrevented||g?.())},T),oe=p?D===R.length-1:!1,se=xn(le=>{le.key==="Escape"&&(c?.(le),!le.defaultPrevented&&g&&(le.preventDefault(),g()))});return y.useEffect(()=>{if(oe)return T.addEventListener("keydown",se,{capture:!0}),()=>T.removeEventListener("keydown",se,{capture:!0})},[T,oe,se]),y.useEffect(()=>{if(p)return i&&(x.layersWithOutsidePointerEventsDisabled.size===0&&(Dg=T.body.style.pointerEvents,T.body.style.pointerEvents="none"),x.layersWithOutsidePointerEventsDisabled.add(p)),x.layers.add(p),zg(),()=>{i&&(x.layersWithOutsidePointerEventsDisabled.delete(p),x.layersWithOutsidePointerEventsDisabled.size===0&&(T.body.style.pointerEvents=Dg))}},[p,T,i,x]),y.useEffect(()=>()=>{p&&(x.layers.delete(p),x.layersWithOutsidePointerEventsDisabled.delete(p),zg())},[p,x]),y.useEffect(()=>{const le=()=>E({});return document.addEventListener(sf,le),()=>document.removeEventListener(sf,le)},[]),h.jsx(Ce.div,{...m,ref:C,style:{pointerEvents:Y?K?"auto":"none":void 0,...n.style},onFocusCapture:pe(n.onFocusCapture,B.onFocusCapture),onBlurCapture:pe(n.onBlurCapture,B.onBlurCapture),onPointerDownCapture:pe(n.onPointerDownCapture,V.onPointerDownCapture)})});Ji.displayName=yE;var SE="DismissableLayerBranch",wE=y.forwardRef((n,l)=>{const i=y.useContext(Df),o=y.useRef(null),c=Ye(l,o);return y.useEffect(()=>{const d=o.current;if(d)return i.branches.add(d),()=>{i.branches.delete(d)}},[i.branches]),h.jsx(Ce.div,{...n,ref:c})});wE.displayName=SE;function EE(){const n=y.useContext(Df),[l,i]=y.useState(null);return y.useEffect(()=>{if(l)return n.dismissableSurfaces.add(l),()=>{n.dismissableSurfaces.delete(l)}},[l,n.dismissableSurfaces]),i}var CE=()=>!0;function TE(n,l){const{ownerDocument:i=globalThis?.document,deferPointerDownOutside:o=!1,isDeferredPointerDownOutsideRef:c,dismissableSurfaces:d,shouldHandlePointerDownOutside:f=CE}=l,v=xn(n),g=y.useRef(!1),m=y.useRef(!1),x=y.useRef(new Map),p=y.useRef(()=>{});return y.useEffect(()=>{function S(){m.current=!1,c.current=!1,x.current.clear()}function T(){return Array.from(x.current.values()).some(Boolean)}function E(D){if(!m.current)return;const Y=D.target;Y instanceof Node&&[...d].some(q=>q.contains(Y))||x.current.set(D.type,!0),D.type==="click"&&window.setTimeout(()=>{m.current&&p.current()},0)}function C(D){m.current&&x.current.set(D.type,!1)}const R=D=>{if(D.target&&!g.current){let Y=function(){i.removeEventListener("click",p.current);const q=T();S(),q||Yy(bE,v,K,{discrete:!0})};if(!f(D.target)){i.removeEventListener("click",p.current),S(),g.current=!1;return}const K={originalEvent:D};m.current=!0,c.current=o&&D.button===0,x.current.clear(),!o||D.button!==0?Y():(i.removeEventListener("click",p.current),p.current=Y,i.addEventListener("click",p.current,{once:!0}))}else i.removeEventListener("click",p.current),S();g.current=!1},M=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const D of M)i.addEventListener(D,E,!0),i.addEventListener(D,C);const z=window.setTimeout(()=>{i.addEventListener("pointerdown",R)},0);return()=>{window.clearTimeout(z),i.removeEventListener("pointerdown",R),i.removeEventListener("click",p.current);for(const D of M)i.removeEventListener(D,E,!0),i.removeEventListener(D,C)}},[i,v,o,c,d,f]),{onPointerDownCapture:()=>g.current=!0}}function RE(n,l=globalThis?.document){const i=xn(n),o=y.useRef(!1);return y.useEffect(()=>{const c=d=>{d.target&&!o.current&&Yy(xE,i,{originalEvent:d},{discrete:!1})};return l.addEventListener("focusin",c),()=>l.removeEventListener("focusin",c)},[l,i]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function zg(){const n=new CustomEvent(sf);document.dispatchEvent(n)}function Yy(n,l,i,{discrete:o}){const c=i.originalEvent.target,d=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:i});l&&c.addEventListener(n,l,{once:!0}),o?qy(c,d):c.dispatchEvent(d)}var zd="focusScope.autoFocusOnMount",kd="focusScope.autoFocusOnUnmount",kg={bubbles:!1,cancelable:!0},ME="FocusScope",Xs=y.forwardRef((n,l)=>{const{loop:i=!1,trapped:o=!1,onMountAutoFocus:c,onUnmountAutoFocus:d,...f}=n,[v,g]=y.useState(null),m=xn(c),x=xn(d),p=y.useRef(null),S=Ye(l,g),T=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(o){let C=function(D){if(T.paused||!v)return;const Y=D.target;v.contains(Y)?p.current=Y:qa(p.current,{select:!0})},R=function(D){if(T.paused||!v)return;const Y=D.relatedTarget;Y!==null&&(v.contains(Y)||qa(p.current,{select:!0}))},M=function(D){if(document.activeElement===document.body)for(const K of D)K.removedNodes.length>0&&qa(v)};document.addEventListener("focusin",C),document.addEventListener("focusout",R);const z=new MutationObserver(M);return v&&z.observe(v,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",R),z.disconnect()}}},[o,v,T.paused]),y.useEffect(()=>{if(v){Hg.add(T);const C=document.activeElement;if(!v.contains(C)){const M=new CustomEvent(zd,kg);v.addEventListener(zd,m),v.dispatchEvent(M),M.defaultPrevented||(jE(DE(Iy(v)),{select:!0}),document.activeElement===C&&qa(v))}return()=>{v.removeEventListener(zd,m),setTimeout(()=>{const M=new CustomEvent(kd,kg);v.addEventListener(kd,x),v.dispatchEvent(M),M.defaultPrevented||qa(C??document.body,{select:!0}),v.removeEventListener(kd,x),Hg.remove(T)},0)}}},[v,m,x,T]);const E=y.useCallback(C=>{if(!i&&!o||T.paused)return;const R=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,M=document.activeElement;if(R&&M){const z=C.currentTarget,[D,Y]=AE(z);D&&Y?!C.shiftKey&&M===Y?(C.preventDefault(),i&&qa(D,{select:!0})):C.shiftKey&&M===D&&(C.preventDefault(),i&&qa(Y,{select:!0})):M===z&&C.preventDefault()}},[i,o,T.paused]);return h.jsx(Ce.div,{tabIndex:-1,...f,ref:S,onKeyDown:E})});Xs.displayName=ME;function jE(n,{select:l=!1}={}){const i=document.activeElement;for(const o of n)if(qa(o,{select:l}),document.activeElement!==i)return}function AE(n){const l=Iy(n),i=Lg(l,n),o=Lg(l.reverse(),n);return[i,o]}function Iy(n){const l=[],i=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const c=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||c?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;i.nextNode();)l.push(i.currentNode);return l}function Lg(n,l){const i=typeof l.checkVisibility=="function"&&l.checkVisibility({checkVisibilityCSS:!0});for(const o of n)if(!(i?!o.checkVisibility({checkVisibilityCSS:!0}):OE(o,{upTo:l})))return o}function OE(n,{upTo:l}){if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(l!==void 0&&n===l)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1}function NE(n){return n instanceof HTMLInputElement&&"select"in n}function qa(n,{select:l=!1}={}){if(n&&n.focus){const i=document.activeElement;n.focus({preventScroll:!0}),n!==i&&NE(n)&&l&&n.select()}}var Hg=_E();function _E(){let n=[];return{add(l){const i=n[0];l!==i&&i?.pause(),n=Ug(n,l),n.unshift(l)},remove(l){n=Ug(n,l),n[0]?.resume()}}}function Ug(n,l){const i=[...n],o=i.indexOf(l);return o!==-1&&i.splice(o,1),i}function DE(n){return n.filter(l=>l.tagName!=="A")}var zE="Portal",Wi=y.forwardRef((n,l)=>{const{container:i,...o}=n,[c,d]=y.useState(!1);yt(()=>d(!0),[]);const f=i||c&&globalThis?.document?.body;return f?zr.createPortal(h.jsx(Ce.div,{...o,ref:l}),f):null});Wi.displayName=zE;var Es=0,br=null;function zf(){y.useEffect(()=>{br||(br={start:Bg(),end:Bg()});const{start:n,end:l}=br;return document.body.firstElementChild!==n&&document.body.insertAdjacentElement("afterbegin",n),document.body.lastElementChild!==l&&document.body.insertAdjacentElement("beforeend",l),Es++,()=>{Es===1&&(br?.start.remove(),br?.end.remove(),br=null),Es=Math.max(0,Es-1)}},[])}function Bg(){const n=document.createElement("span");return n.setAttribute("data-radix-focus-guard",""),n.tabIndex=0,n.style.outline="none",n.style.opacity="0",n.style.position="fixed",n.style.pointerEvents="none",n}var Un=function(){return Un=Object.assign||function(l){for(var i,o=1,c=arguments.length;o "u")return $E;var l=JE(n),i=document.documentElement.clientWidth,o=window.innerWidth;return{left:l[0],top:l[1],right:l[2],gap:Math.max(0,o-i+l[2]-l[0])}},eC=Fy(),Mr="data-scroll-locked",tC=function(n,l,i,o){var c=n.left,d=n.top,f=n.right,v=n.gap;return i===void 0&&(i="margin"),` + .`.concat(LE,` { + overflow: hidden `).concat(o,`; + padding-right: `).concat(v,"px ").concat(o,`; + } + body[`).concat(Mr,`] { + overflow: hidden `).concat(o,`; + overscroll-behavior: contain; + `).concat([l&&"position: relative ".concat(o,";"),i==="margin"&&` + padding-left: `.concat(c,`px; + padding-top: `).concat(d,`px; + padding-right: `).concat(f,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(v,"px ").concat(o,`; + `),i==="padding"&&"padding-right: ".concat(v,"px ").concat(o,";")].filter(Boolean).join(""),` + } + + .`).concat(Ds,` { + right: `).concat(v,"px ").concat(o,`; + } + + .`).concat(zs,` { + margin-right: `).concat(v,"px ").concat(o,`; + } + + .`).concat(Ds," .").concat(Ds,` { + right: 0 `).concat(o,`; + } + + .`).concat(zs," .").concat(zs,` { + margin-right: 0 `).concat(o,`; + } + + body[`).concat(Mr,`] { + `).concat(HE,": ").concat(v,`px; + } +`)},Gg=function(){var n=parseInt(document.body.getAttribute(Mr)||"0",10);return isFinite(n)?n:0},nC=function(){y.useEffect(function(){return document.body.setAttribute(Mr,(Gg()+1).toString()),function(){var n=Gg()-1;n<=0?document.body.removeAttribute(Mr):document.body.setAttribute(Mr,n.toString())}},[])},aC=function(n){var l=n.noRelative,i=n.noImportant,o=n.gapMode,c=o===void 0?"margin":o;nC();var d=y.useMemo(function(){return WE(c)},[c]);return y.createElement(eC,{styles:tC(d,!l,c,i?"":"!important")})},cf=!1;if(typeof window<"u")try{var Cs=Object.defineProperty({},"passive",{get:function(){return cf=!0,!0}});window.addEventListener("test",Cs,Cs),window.removeEventListener("test",Cs,Cs)}catch{cf=!1}var xr=cf?{passive:!1}:!1,lC=function(n){return n.tagName==="TEXTAREA"},Xy=function(n,l){if(!(n instanceof Element))return!1;var i=window.getComputedStyle(n);return i[l]!=="hidden"&&!(i.overflowY===i.overflowX&&!lC(n)&&i[l]==="visible")},rC=function(n){return Xy(n,"overflowY")},iC=function(n){return Xy(n,"overflowX")},Vg=function(n,l){var i=l.ownerDocument,o=l;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var c=Zy(n,o);if(c){var d=$y(n,o),f=d[1],v=d[2];if(f>v)return!0}o=o.parentNode}while(o&&o!==i.body);return!1},oC=function(n){var l=n.scrollTop,i=n.scrollHeight,o=n.clientHeight;return[l,i,o]},sC=function(n){var l=n.scrollLeft,i=n.scrollWidth,o=n.clientWidth;return[l,i,o]},Zy=function(n,l){return n==="v"?rC(l):iC(l)},$y=function(n,l){return n==="v"?oC(l):sC(l)},cC=function(n,l){return n==="h"&&l==="rtl"?-1:1},uC=function(n,l,i,o,c){var d=cC(n,window.getComputedStyle(l).direction),f=d*o,v=i.target,g=l.contains(v),m=!1,x=f>0,p=0,S=0;do{if(!v)break;var T=$y(n,v),E=T[0],C=T[1],R=T[2],M=C-R-d*E;(E||M)&&Zy(n,v)&&(p+=M,S+=E);var z=v.parentNode;v=z&&z.nodeType===Node.DOCUMENT_FRAGMENT_NODE?z.host:z}while(!g&&v!==document.body||g&&(l.contains(v)||l===v));return(x&&Math.abs(p)<1||!x&&Math.abs(S)<1)&&(m=!0),m},Ts=function(n){return"changedTouches"in n?[n.changedTouches[0].clientX,n.changedTouches[0].clientY]:[0,0]},Yg=function(n){return[n.deltaX,n.deltaY]},Ig=function(n){return n&&"current"in n?n.current:n},dC=function(n,l){return n[0]===l[0]&&n[1]===l[1]},fC=function(n){return` + .block-interactivity-`.concat(n,` {pointer-events: none;} + .allow-interactivity-`).concat(n,` {pointer-events: all;} +`)},hC=0,Sr=[];function mC(n){var l=y.useRef([]),i=y.useRef([0,0]),o=y.useRef(),c=y.useState(hC++)[0],d=y.useState(Fy)[0],f=y.useRef(n);y.useEffect(function(){f.current=n},[n]),y.useEffect(function(){if(n.inert){document.body.classList.add("block-interactivity-".concat(c));var C=kE([n.lockRef.current],(n.shards||[]).map(Ig),!0).filter(Boolean);return C.forEach(function(R){return R.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),C.forEach(function(R){return R.classList.remove("allow-interactivity-".concat(c))})}}},[n.inert,n.lockRef.current,n.shards]);var v=y.useCallback(function(C,R){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!f.current.allowPinchZoom;var M=Ts(C),z=i.current,D="deltaX"in C?C.deltaX:z[0]-M[0],Y="deltaY"in C?C.deltaY:z[1]-M[1],K,q=C.target,V=Math.abs(D)>Math.abs(Y)?"h":"v";if("touches"in C&&V==="h"&&q.type==="range")return!1;var B=window.getSelection(),oe=B&&B.anchorNode,se=oe?oe===q||oe.contains(q):!1;if(se)return!1;var le=Vg(V,q);if(!le)return!0;if(le?K=V:(K=V==="v"?"h":"v",le=Vg(V,q)),!le)return!1;if(!o.current&&"changedTouches"in C&&(D||Y)&&(o.current=K),!K)return!0;var ce=o.current||K;return uC(ce,R,C,ce==="h"?D:Y)},[]),g=y.useCallback(function(C){var R=C;if(!(!Sr.length||Sr[Sr.length-1]!==d)){var M="deltaY"in R?Yg(R):Ts(R),z=l.current.filter(function(K){return K.name===R.type&&(K.target===R.target||R.target===K.shadowParent)&&dC(K.delta,M)})[0];if(z&&z.should){R.cancelable&&R.preventDefault();return}if(!z){var D=(f.current.shards||[]).map(Ig).filter(Boolean).filter(function(K){return K.contains(R.target)}),Y=D.length>0?v(R,D[0]):!f.current.noIsolation;Y&&R.cancelable&&R.preventDefault()}}},[]),m=y.useCallback(function(C,R,M,z){var D={name:C,delta:R,target:M,should:z,shadowParent:pC(M)};l.current.push(D),setTimeout(function(){l.current=l.current.filter(function(Y){return Y!==D})},1)},[]),x=y.useCallback(function(C){i.current=Ts(C),o.current=void 0},[]),p=y.useCallback(function(C){m(C.type,Yg(C),C.target,v(C,n.lockRef.current))},[]),S=y.useCallback(function(C){m(C.type,Ts(C),C.target,v(C,n.lockRef.current))},[]);y.useEffect(function(){return Sr.push(d),n.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:S}),document.addEventListener("wheel",g,xr),document.addEventListener("touchmove",g,xr),document.addEventListener("touchstart",x,xr),function(){Sr=Sr.filter(function(C){return C!==d}),document.removeEventListener("wheel",g,xr),document.removeEventListener("touchmove",g,xr),document.removeEventListener("touchstart",x,xr)}},[]);var T=n.removeScrollBar,E=n.inert;return y.createElement(y.Fragment,null,E?y.createElement(d,{styles:fC(c)}):null,T?y.createElement(aC,{noRelative:n.noRelative,gapMode:n.gapMode}):null)}function pC(n){for(var l=null;n!==null;)n instanceof ShadowRoot&&(l=n.host,n=n.host),n=n.parentNode;return l}const vC=IE(Ky,mC);var $s=y.forwardRef(function(n,l){return y.createElement(Zs,Un({},n,{ref:l,sideCar:vC}))});$s.classNames=Zs.classNames;var gC=function(n){if(typeof document>"u")return null;var l=Array.isArray(n)?n[0]:n;return l.ownerDocument.body},wr=new WeakMap,Rs=new WeakMap,Ms={},Bd=0,Jy=function(n){return n&&(n.host||Jy(n.parentNode))},yC=function(n,l){return l.map(function(i){if(n.contains(i))return i;var o=Jy(i);return o&&n.contains(o)?o:(console.error("aria-hidden",i,"in not contained inside",n,". Doing nothing"),null)}).filter(function(i){return!!i})},bC=function(n,l,i,o){var c=yC(l,Array.isArray(n)?n:[n]);Ms[i]||(Ms[i]=new WeakMap);var d=Ms[i],f=[],v=new Set,g=new Set(c),m=function(p){!p||v.has(p)||(v.add(p),m(p.parentNode))};c.forEach(m);var x=function(p){!p||g.has(p)||Array.prototype.forEach.call(p.children,function(S){if(v.has(S))x(S);else try{var T=S.getAttribute(o),E=T!==null&&T!=="false",C=(wr.get(S)||0)+1,R=(d.get(S)||0)+1;wr.set(S,C),d.set(S,R),f.push(S),C===1&&E&&Rs.set(S,!0),R===1&&S.setAttribute(i,"true"),E||S.setAttribute(o,"true")}catch(M){console.error("aria-hidden: cannot operate on ",S,M)}})};return x(l),v.clear(),Bd++,function(){f.forEach(function(p){var S=wr.get(p)-1,T=d.get(p)-1;wr.set(p,S),d.set(p,T),S||(Rs.has(p)||p.removeAttribute(o),Rs.delete(p)),T||p.removeAttribute(i)}),Bd--,Bd||(wr=new WeakMap,wr=new WeakMap,Rs=new WeakMap,Ms={})}},kf=function(n,l,i){i===void 0&&(i="data-aria-hidden");var o=Array.from(Array.isArray(n)?n:[n]),c=gC(n);return c?(o.push.apply(o,Array.from(c.querySelectorAll("[aria-live], script"))),bC(o,c,i,"aria-hidden")):function(){return null}},Js="Dialog",[Wy]=Pa(Js),[xC,An]=Wy(Js),Lf=n=>{const{__scopeDialog:l,children:i,open:o,defaultOpen:c,onOpenChange:d,modal:f=!0}=n,v=y.useRef(null),g=y.useRef(null),[m,x]=Nr({prop:o,defaultProp:c??!1,onChange:d,caller:Js});return h.jsx(xC,{scope:l,triggerRef:v,contentRef:g,contentId:Ot(),titleId:Ot(),descriptionId:Ot(),open:m,onOpenChange:x,onOpenToggle:y.useCallback(()=>x(p=>!p),[x]),modal:f,children:i})};Lf.displayName=Js;var e0="DialogTrigger",SC=y.forwardRef((n,l)=>{const{__scopeDialog:i,...o}=n,c=An(e0,i),d=Ye(l,c.triggerRef);return h.jsx(Ce.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.open?c.contentId:void 0,"data-state":Gf(c.open),...o,ref:d,onClick:pe(n.onClick,c.onOpenToggle)})});SC.displayName=e0;var Hf="DialogPortal",[wC,t0]=Wy(Hf,{forceMount:void 0}),Uf=n=>{const{__scopeDialog:l,forceMount:i,children:o,container:c}=n,d=An(Hf,l);return h.jsx(wC,{scope:l,forceMount:i,children:y.Children.map(o,f=>h.jsx(jn,{present:i||d.open,children:h.jsx(Wi,{asChild:!0,container:c,children:f})}))})};Uf.displayName=Hf;var Bs="DialogOverlay",Bf=y.forwardRef((n,l)=>{const i=t0(Bs,n.__scopeDialog),{forceMount:o=i.forceMount,...c}=n,d=An(Bs,n.__scopeDialog);return d.modal?h.jsx(jn,{present:o||d.open,children:h.jsx(CC,{...c,ref:l})}):null});Bf.displayName=Bs;var EC=El("DialogOverlay.RemoveScroll"),CC=y.forwardRef((n,l)=>{const{__scopeDialog:i,...o}=n,c=An(Bs,i),d=EE(),f=Ye(l,d);return h.jsx($s,{as:EC,allowPinchZoom:!0,shards:[c.contentRef],children:h.jsx(Ce.div,{"data-state":Gf(c.open),...o,ref:f,style:{pointerEvents:"auto",...o.style}})})}),_r="DialogContent",qf=y.forwardRef((n,l)=>{const i=t0(_r,n.__scopeDialog),{forceMount:o=i.forceMount,...c}=n,d=An(_r,n.__scopeDialog);return h.jsx(jn,{present:o||d.open,children:d.modal?h.jsx(TC,{...c,ref:l}):h.jsx(RC,{...c,ref:l})})});qf.displayName=_r;var TC=y.forwardRef((n,l)=>{const i=An(_r,n.__scopeDialog),o=y.useRef(null),c=Ye(l,i.contentRef,o);return y.useEffect(()=>{const d=o.current;if(d)return kf(d)},[]),h.jsx(n0,{...n,ref:c,trapFocus:i.open,disableOutsidePointerEvents:i.open,onCloseAutoFocus:pe(n.onCloseAutoFocus,d=>{d.preventDefault(),i.triggerRef.current?.focus()}),onPointerDownOutside:pe(n.onPointerDownOutside,d=>{const f=d.detail.originalEvent,v=f.button===0&&f.ctrlKey===!0;(f.button===2||v)&&d.preventDefault()}),onFocusOutside:pe(n.onFocusOutside,d=>d.preventDefault())})}),RC=y.forwardRef((n,l)=>{const i=An(_r,n.__scopeDialog),o=y.useRef(!1),c=y.useRef(!1);return h.jsx(n0,{...n,ref:l,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:d=>{n.onCloseAutoFocus?.(d),d.defaultPrevented||(o.current||i.triggerRef.current?.focus(),d.preventDefault()),o.current=!1,c.current=!1},onInteractOutside:d=>{n.onInteractOutside?.(d),d.defaultPrevented||(o.current=!0,d.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const f=d.target;i.triggerRef.current?.contains(f)&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&c.current&&d.preventDefault()}})}),n0=y.forwardRef((n,l)=>{const{__scopeDialog:i,trapFocus:o,onOpenAutoFocus:c,onCloseAutoFocus:d,...f}=n,v=An(_r,i);return zf(),h.jsx(h.Fragment,{children:h.jsx(Xs,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:c,onUnmountAutoFocus:d,children:h.jsx(Ji,{role:"dialog",id:v.contentId,"aria-describedby":v.descriptionId,"aria-labelledby":v.titleId,"data-state":Gf(v.open),...f,ref:l,deferPointerDownOutside:!0,onDismiss:()=>v.onOpenChange(!1)})})})}),a0="DialogTitle",l0=y.forwardRef((n,l)=>{const{__scopeDialog:i,...o}=n,c=An(a0,i);return h.jsx(Ce.h2,{id:c.titleId,...o,ref:l})});l0.displayName=a0;var r0="DialogDescription",MC=y.forwardRef((n,l)=>{const{__scopeDialog:i,...o}=n,c=An(r0,i);return h.jsx(Ce.p,{id:c.descriptionId,...o,ref:l})});MC.displayName=r0;var i0="DialogClose",o0=y.forwardRef((n,l)=>{const{__scopeDialog:i,...o}=n,c=An(i0,i);return h.jsx(Ce.button,{type:"button",...o,ref:l,onClick:pe(n.onClick,()=>c.onOpenChange(!1))})});o0.displayName=i0;function Gf(n){return n?"open":"closed"}function jC(n){const l=y.useRef({value:n,previous:n});return y.useMemo(()=>(l.current.value!==n&&(l.current.previous=l.current.value,l.current.value=n),l.current.previous),[n])}function AC(n){const[l,i]=y.useState(void 0);return yt(()=>{if(n){i({width:n.offsetWidth,height:n.offsetHeight});const o=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const d=c[0];let f,v;if("borderBoxSize"in d){const g=d.borderBoxSize,m=Array.isArray(g)?g[0]:g;f=m.inlineSize,v=m.blockSize}else f=n.offsetWidth,v=n.offsetHeight;i({width:f,height:v})});return o.observe(n,{box:"border-box"}),()=>o.unobserve(n)}else i(void 0)},[n]),l}const OC=["top","right","bottom","left"],Va=Math.min,sa=Math.max,qs=Math.round,js=Math.floor,ca=n=>({x:n,y:n}),NC={left:"right",right:"left",bottom:"top",top:"bottom"};function s0(n,l,i){return sa(n,Va(l,i))}function ua(n,l){return typeof n=="function"?n(l):n}function Ya(n){return n.split("-")[0]}function kr(n){return n.split("-")[1]}function Vf(n){return n==="x"?"y":"x"}function Yf(n){return n==="y"?"height":"width"}function Bn(n){const l=n[0];return l==="t"||l==="b"?"y":"x"}function If(n){return Vf(Bn(n))}function _C(n,l,i){i===void 0&&(i=!1);const o=kr(n),c=If(n),d=Yf(c);let f=c==="x"?o===(i?"end":"start")?"right":"left":o==="start"?"bottom":"top";return l.reference[d]>l.floating[d]&&(f=Gs(f)),[f,Gs(f)]}function DC(n){const l=Gs(n);return[uf(n),l,uf(l)]}function uf(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}const Qg=["left","right"],Pg=["right","left"],zC=["top","bottom"],kC=["bottom","top"];function LC(n,l,i){switch(n){case"top":case"bottom":return i?l?Pg:Qg:l?Qg:Pg;case"left":case"right":return l?zC:kC;default:return[]}}function HC(n,l,i,o){const c=kr(n);let d=LC(Ya(n),i==="start",o);return c&&(d=d.map(f=>f+"-"+c),l&&(d=d.concat(d.map(uf)))),d}function Gs(n){const l=Ya(n);return NC[l]+n.slice(l.length)}function UC(n){var l,i,o,c;return{top:(l=n.top)!=null?l:0,right:(i=n.right)!=null?i:0,bottom:(o=n.bottom)!=null?o:0,left:(c=n.left)!=null?c:0}}function c0(n){return typeof n!="number"?UC(n):{top:n,right:n,bottom:n,left:n}}function Vs(n){const{x:l,y:i,width:o,height:c}=n;return{width:o,height:c,top:i,left:l,right:l+o,bottom:i+c,x:l,y:i}}function Kg(n,l,i){let{reference:o,floating:c}=n;const d=Bn(l),f=If(l),v=Yf(f),g=Ya(l),m=d==="y",x=o.x+o.width/2-c.width/2,p=o.y+o.height/2-c.height/2,S=o[v]/2-c[v]/2;let T;switch(g){case"top":T={x,y:o.y-c.height};break;case"bottom":T={x,y:o.y+o.height};break;case"right":T={x:o.x+o.width,y:p};break;case"left":T={x:o.x-c.width,y:p};break;default:T={x:o.x,y:o.y}}const E=kr(l);return E&&(T[f]+=S*(E==="end"?1:-1)*(i&&m?-1:1)),T}async function BC(n,l){var i;l===void 0&&(l={});const{x:o,y:c,platform:d,rects:f,elements:v,strategy:g}=n,{boundary:m="clippingAncestors",rootBoundary:x="viewport",elementContext:p="floating",altBoundary:S=!1,padding:T=0}=ua(l,n),E=c0(T),R=v[S?p==="floating"?"reference":"floating":p],M=Vs(await d.getClippingRect({element:(i=await(d.isElement==null?void 0:d.isElement(R)))==null||i?R:R.contextElement||await(d.getDocumentElement==null?void 0:d.getDocumentElement(v.floating)),boundary:m,rootBoundary:x,strategy:g})),z=p==="floating"?{x:o,y:c,width:f.floating.width,height:f.floating.height}:f.reference,D=await(d.getOffsetParent==null?void 0:d.getOffsetParent(v.floating)),Y=await(d.isElement==null?void 0:d.isElement(D))&&await(d.getScale==null?void 0:d.getScale(D))||{x:1,y:1},K=Vs(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:v,rect:z,offsetParent:D,strategy:g}):z);return{top:(M.top-K.top+E.top)/Y.y,bottom:(K.bottom-M.bottom+E.bottom)/Y.y,left:(M.left-K.left+E.left)/Y.x,right:(K.right-M.right+E.right)/Y.x}}const qC=50,GC=async(n,l,i)=>{const{placement:o="bottom",strategy:c="absolute",middleware:d=[],platform:f}=i,v=f.detectOverflow?f:{...f,detectOverflow:BC},g=await(f.isRTL==null?void 0:f.isRTL(l));let m=await f.getElementRects({reference:n,floating:l,strategy:c}),{x,y:p}=Kg(m,o,g),S=o,T=0;const E={};for(let C=0;C ({name:"arrow",options:n,async fn(l){const{x:i,y:o,placement:c,rects:d,platform:f,elements:v,middlewareData:g}=l,{element:m,padding:x=0}=ua(n,l)||{};if(m==null)return{};const p=c0(x),S={x:i,y:o},T=If(c),E=Yf(T),C=await f.getDimensions(m),R=T==="y",M=R?"top":"left",z=R?"bottom":"right",D=R?"clientHeight":"clientWidth",Y=d.reference[E]+d.reference[T]-S[T]-d.floating[E],K=S[T]-d.reference[T],q=await(f.getOffsetParent==null?void 0:f.getOffsetParent(m));let V=q?q[D]:0;(!V||!await(f.isElement==null?void 0:f.isElement(q)))&&(V=v.floating[D]||d.floating[E]);const B=Y/2-K/2,oe=V/2-C[E]/2-1,se=Va(p[M],oe),le=Va(p[z],oe),ce=V-C[E]-le,ue=V/2-C[E]/2+B,ve=s0(se,ue,ce),de=!g.arrow&&kr(c)!=null&&ue!==ve&&d.reference[E]/2-(ue ve<=0)){var le,ce;const ve=(((le=d.flip)==null?void 0:le.index)||0)+1,de=V[ve];if(de&&(!(p==="alignment"?z!==Bn(de):!1)||se.every(W=>Bn(W.placement)===z?W.overflows[0]>0:!0)))return{data:{index:ve,overflows:se},reset:{placement:de}};let N=(ce=se.filter(F=>F.overflows[0]<=0).sort((F,W)=>F.overflows[1]-W.overflows[1])[0])==null?void 0:ce.placement;if(!N)switch(T){case"bestFit":{var ue;const F=(ue=se.filter(W=>{if(q){const ee=Bn(W.placement);return ee===z||ee==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(ee=>ee>0).reduce((ee,$)=>ee+$,0)]).sort((W,ee)=>W[1]-ee[1])[0])==null?void 0:ue[0];F&&(N=F);break}case"initialPlacement":N=v;break}if(c!==N)return{reset:{placement:N}}}return{}}}};function Fg(n,l){return{top:n.top-l.height,right:n.right-l.width,bottom:n.bottom-l.height,left:n.left-l.width}}function Xg(n){return OC.some(l=>n[l]>=0)}const IC=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(l){const{rects:i,platform:o}=l,{strategy:c="referenceHidden",...d}=ua(n,l);switch(c){case"referenceHidden":{const f=await o.detectOverflow(l,{...d,elementContext:"reference"}),v=Fg(f,i.reference);return{data:{referenceHiddenOffsets:v,referenceHidden:Xg(v)}}}case"escaped":{const f=await o.detectOverflow(l,{...d,altBoundary:!0}),v=Fg(f,i.floating);return{data:{escapedOffsets:v,escaped:Xg(v)}}}default:return{}}}}},u0=new Set(["left","top"]);async function QC(n,l){const{placement:i,platform:o,elements:c}=n,d=await(o.isRTL==null?void 0:o.isRTL(c.floating)),f=Ya(i),v=kr(i),g=Bn(i)==="y",m=u0.has(f)?-1:1,x=d&&g?-1:1,p=ua(l,n);let{mainAxis:S,crossAxis:T,alignmentAxis:E}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return v&&typeof E=="number"&&(T=v==="end"?E*-1:E),g?{x:T*x,y:S*m}:{x:S*m,y:T*x}}const PC=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(l){var i,o;const{x:c,y:d,placement:f,middlewareData:v}=l,g=await QC(l,n);return f===((i=v.offset)==null?void 0:i.placement)&&(o=v.arrow)!=null&&o.alignmentOffset?{}:{x:c+g.x,y:d+g.y,data:{...g,placement:f}}}}},KC=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(l){const{x:i,y:o,placement:c,platform:d}=l,{mainAxis:f=!0,crossAxis:v=!1,limiter:g={fn:z=>{let{x:D,y:Y}=z;return{x:D,y:Y}}},...m}=ua(n,l),x={x:i,y:o},p=await d.detectOverflow(l,m),S=Bn(c),T=Vf(S);let E=x[T],C=x[S];const R=(z,D)=>s0(D+p[z==="y"?"top":"left"],D,D-p[z==="y"?"bottom":"right"]);f&&(E=R(T,E)),v&&(C=R(S,C));const M=g.fn({...l,[T]:E,[S]:C});return{...M,data:{x:M.x-i,y:M.y-o,enabled:{[T]:f,[S]:v}}}}}},FC=function(n){return n===void 0&&(n={}),{options:n,fn(l){var i,o;const{x:c,y:d,placement:f,rects:v,middlewareData:g}=l,{offset:m=0,mainAxis:x=!0,crossAxis:p=!0}=ua(n,l),S={x:c,y:d},T=Bn(f),E=Vf(T);let C=S[E],R=S[T];const M=ua(m,l),z=typeof M=="number"?{mainAxis:M,crossAxis:0}:{mainAxis:(i=M.mainAxis)!=null?i:0,crossAxis:(o=M.crossAxis)!=null?o:0};if(x){const K=E==="y"?"height":"width",q=v.reference[E]-v.floating[K]+z.mainAxis,V=v.reference[E]+v.reference[K]-z.mainAxis;C V&&(C=V)}if(p){var D,Y;const K=E==="y"?"width":"height",q=u0.has(Ya(f)),V=v.reference[T]-v.floating[K]+(q&&((D=g.offset)==null?void 0:D[T])||0)+(q?0:z.crossAxis),B=v.reference[T]+v.reference[K]+(q?0:((Y=g.offset)==null?void 0:Y[T])||0)-(q?z.crossAxis:0);RB&&(R=B)}return{[E]:C,[T]:R}}}},XC=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(l){const{placement:i,rects:o,platform:c,elements:d}=l,{apply:f=()=>{},...v}=ua(n,l),g=await c.detectOverflow(l,v),m=Ya(i),x=kr(i),p=Bn(i)==="y",{width:S,height:T}=o.floating;let E,C;m==="top"||m==="bottom"?(E=m,C=x===(await(c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(C=m,E=x==="end"?"top":"bottom");const R=T-g.top-g.bottom,M=S-g.left-g.right,z=Va(T-g[E],R),D=Va(S-g[C],M),Y=l.middlewareData.shift,K=!Y;let q=z,V=D;Y!=null&&Y.enabled.x&&(V=M),Y!=null&&Y.enabled.y&&(q=R),K&&!x&&(p?V=S-2*sa(g.left,g.right):q=T-2*sa(g.top,g.bottom)),await f({...l,availableWidth:V,availableHeight:q});const B=await c.getDimensions(d.floating);return S!==B.width||T!==B.height?{reset:{rects:!0}}:{}}}};function Ws(){return typeof window<"u"}function Lr(n){return d0(n)?(n.nodeName||"").toLowerCase():"#document"}function Xt(n){var l;return(n==null||(l=n.ownerDocument)==null?void 0:l.defaultView)||window}function da(n){var l;return(l=(d0(n)?n.ownerDocument:n.document)||window.document)==null?void 0:l.documentElement}function d0(n){return Ws()?n instanceof Node||n instanceof Xt(n).Node:!1}function qn(n){return Ws()?n instanceof Element||n instanceof Xt(n).Element:!1}function Ka(n){return Ws()?n instanceof HTMLElement||n instanceof Xt(n).HTMLElement:!1}function Zg(n){return!Ws()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof Xt(n).ShadowRoot}function ec(n){const{overflow:l,overflowX:i,overflowY:o,display:c}=Gn(n);return/auto|scroll|overlay|hidden|clip/.test(l+o+i)&&c!=="inline"&&c!=="contents"}function ZC(n){return/^(table|td|th)$/.test(Lr(n))}function tc(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const $C=/transform|translate|scale|rotate|perspective|filter/,JC=/paint|layout|strict|content/,xl=n=>!!n&&n!=="none";let qd;function Qf(n){const l=qn(n)?Gn(n):n;return xl(l.transform)||xl(l.translate)||xl(l.scale)||xl(l.rotate)||xl(l.perspective)||!Pf()&&(xl(l.backdropFilter)||xl(l.filter))||$C.test(l.willChange||"")||JC.test(l.contain||"")}function WC(n){let l=Cl(n);for(;Ka(l)&&!Gi(l);){if(Qf(l))return l;if(tc(l))return null;l=Cl(l)}return null}function Pf(){return qd==null&&(qd=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),qd}function Gi(n){return/^(html|body|#document)$/.test(Lr(n))}function Gn(n){return Xt(n).getComputedStyle(n)}function nc(n){return qn(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Cl(n){if(Lr(n)==="html")return n;const l=n.assignedSlot||n.parentNode||Zg(n)&&n.host||da(n);return Zg(l)?l.host:l}function f0(n){const l=Cl(n);return Gi(l)?(n.ownerDocument||n).body:Ka(l)&&ec(l)?l:f0(l)}function Vi(n,l,i){var o;l===void 0&&(l=[]),i===void 0&&(i=!0);const c=f0(n),d=c===((o=n.ownerDocument)==null?void 0:o.body),f=Xt(c);if(d){const v=df(f);return l.concat(f,f.visualViewport||[],ec(c)?c:[],v&&i?Vi(v):[])}else return l.concat(c,Vi(c,[],i))}function df(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function h0(n){const l=Gn(n);let i=parseFloat(l.width)||0,o=parseFloat(l.height)||0;const c=Ka(n),d=c?n.offsetWidth:i,f=c?n.offsetHeight:o,v=qs(i)!==d||qs(o)!==f;return v&&(i=d,o=f),{width:i,height:o,$:v}}function Kf(n){return qn(n)?n:n.contextElement}function jr(n){const l=Kf(n);if(!Ka(l))return ca(1);const i=l.getBoundingClientRect(),{width:o,height:c,$:d}=h0(l);let f=(d?qs(i.width):i.width)/o,v=(d?qs(i.height):i.height)/c;return(!f||!Number.isFinite(f))&&(f=1),(!v||!Number.isFinite(v))&&(v=1),{x:f,y:v}}const e2=ca(0);function m0(n){const l=Xt(n);return!Pf()||!l.visualViewport?e2:{x:l.visualViewport.offsetLeft,y:l.visualViewport.offsetTop}}function t2(n,l,i){return l===void 0&&(l=!1),!!i&&l&&i===Xt(n)}function Tl(n,l,i,o){l===void 0&&(l=!1),i===void 0&&(i=!1);const c=n.getBoundingClientRect(),d=Kf(n);let f=ca(1);l&&(o?qn(o)&&(f=jr(o)):f=jr(n));const v=t2(d,i,o)?m0(d):ca(0);let g=(c.left+v.x)/f.x,m=(c.top+v.y)/f.y,x=c.width/f.x,p=c.height/f.y;if(d&&o){const S=Xt(d),T=qn(o)?Xt(o):o;let E=S,C=df(E);for(;C&&T!==E;){const R=jr(C),M=C.getBoundingClientRect(),z=Gn(C),D=M.left+(C.clientLeft+parseFloat(z.paddingLeft))*R.x,Y=M.top+(C.clientTop+parseFloat(z.paddingTop))*R.y;g*=R.x,m*=R.y,x*=R.x,p*=R.y,g+=D,m+=Y,E=Xt(C),C=df(E)}}return Vs({width:x,height:p,x:g,y:m})}function ac(n,l){const i=nc(n).scrollLeft;return l?l.left+i:Tl(da(n)).left+i}function p0(n,l){const i=n.getBoundingClientRect(),o=i.left+l.scrollLeft-ac(n,i),c=i.top+l.scrollTop;return{x:o,y:c}}function n2(n){let{elements:l,rect:i,offsetParent:o,strategy:c}=n;const d=c==="fixed",f=da(o),v=l?tc(l.floating):!1;if(o===f||v&&d)return i;let g={scrollLeft:0,scrollTop:0},m=ca(1);const x=ca(0),p=Ka(o);if((p||!d)&&((Lr(o)!=="body"||ec(f))&&(g=nc(o)),p)){const T=Tl(o);m=jr(o),x.x=T.x+o.clientLeft,x.y=T.y+o.clientTop}const S=f&&!p&&!d?p0(f,g):ca(0);return{width:i.width*m.x,height:i.height*m.y,x:i.x*m.x-g.scrollLeft*m.x+x.x+S.x,y:i.y*m.y-g.scrollTop*m.y+x.y+S.y}}function a2(n){return n.getClientRects?Array.from(n.getClientRects()):[]}function l2(n){const l=nc(n),i=n.ownerDocument.body,o=sa(n.scrollWidth,n.clientWidth,i.scrollWidth,i.clientWidth),c=sa(n.scrollHeight,n.clientHeight,i.scrollHeight,i.clientHeight);let d=-l.scrollLeft+ac(n);const f=-l.scrollTop;return Gn(i).direction==="rtl"&&(d+=sa(n.clientWidth,i.clientWidth)-o),{width:o,height:c,x:d,y:f}}const r2=25;function i2(n,l,i){i===void 0&&(i="viewport");const o=i==="layoutViewport",c=Xt(n),d=da(n),f=c.visualViewport;let v=d.clientWidth,g=d.clientHeight,m=0,x=0;if(f){const S=!Pf()||l==="fixed";o?S||(m=-f.offsetLeft,x=-f.offsetTop):(v=f.width,g=f.height,S&&(m=f.offsetLeft,x=f.offsetTop))}if(ac(d)<=0){const S=d.ownerDocument,T=S.body,E=getComputedStyle(T),C=S.compatMode==="CSS1Compat"&&parseFloat(E.marginLeft)+parseFloat(E.marginRight)||0,R=Math.abs(d.clientWidth-T.clientWidth-C),M=getComputedStyle(d).scrollbarGutter==="stable both-edges"?R/2:R;M<=r2&&(v-=M)}return{width:v,height:g,x:m,y:x}}function o2(n,l){const i=Tl(n,!0,l==="fixed"),o=i.top+n.clientTop,c=i.left+n.clientLeft,d=jr(n),f=n.clientWidth*d.x,v=n.clientHeight*d.y,g=c*d.x,m=o*d.y;return{width:f,height:v,x:g,y:m}}function $g(n,l,i){let o;if(l==="viewport"||l==="layoutViewport")o=i2(n,i,l);else if(l==="document")o=l2(da(n));else if(qn(l))o=o2(l,i);else{const c=m0(n);o={x:l.x-c.x,y:l.y-c.y,width:l.width,height:l.height}}return Vs(o)}function s2(n,l){const i=l.get(n);if(i)return i;let o=Vi(n,[],!1).filter(v=>qn(v)&&Lr(v)!=="body"),c=null;const d=Gn(n).position==="fixed";let f=d?Cl(n):n;for(;qn(f)&&!Gi(f);){const v=Gn(f),g=Qf(f),m=c?c.position:d?"fixed":"";!g&&(m==="fixed"||m==="absolute"&&v.position==="static")?o=o.filter(p=>p!==f):c=v,f=Cl(f)}return l.set(n,o),o}function c2(n){let{element:l,boundary:i,rootBoundary:o,strategy:c}=n;const f=[...i==="clippingAncestors"?tc(l)?[]:s2(l,this._c):[].concat(i),o],v=$g(l,f[0],c);let g=v.top,m=v.right,x=v.bottom,p=v.left;for(let S=1;S {v(!1,1e-7)},1e3)}V=!1}try{o=new IntersectionObserver(B,{...q,root:d.ownerDocument})}catch{o=new IntersectionObserver(B,q)}o.observe(n)}const g=Xt(n),m=()=>v(i);return g.addEventListener("resize",m),v(!0),()=>{g.removeEventListener("resize",m),f()}}function v2(n,l,i,o){o===void 0&&(o={});const{ancestorScroll:c=!0,ancestorResize:d=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:v=typeof IntersectionObserver=="function",animationFrame:g=!1}=o,m=Kf(n),x=c||d?[...m?Vi(m):[],...l?Vi(l):[]]:[];x.forEach(M=>{c&&M.addEventListener("scroll",i),d&&M.addEventListener("resize",i)});const p=m&&v?p2(m,i,d):null;let S=-1,T=null;f&&(T=new ResizeObserver(M=>{let[z]=M;z&&z.target===m&&T&&l&&(T.unobserve(l),cancelAnimationFrame(S),S=requestAnimationFrame(()=>{var D;(D=T)==null||D.observe(l)})),i()}),m&&!g&&T.observe(m),l&&T.observe(l));let E,C=g?Tl(n):null;g&&R();function R(){const M=Tl(n);C&&!g0(C,M)&&i(),C=M,E=requestAnimationFrame(R)}return i(),()=>{var M;x.forEach(z=>{c&&z.removeEventListener("scroll",i),d&&z.removeEventListener("resize",i)}),p?.(),(M=T)==null||M.disconnect(),T=null,g&&cancelAnimationFrame(E)}}const g2=PC,y2=KC,b2=YC,x2=XC,S2=IC,Wg=VC,w2=FC,E2=(n,l,i)=>{const o=new Map,c=i??{},d={...m2,...c.platform,_c:o};return GC(n,l,{...c,platform:d})};var C2=typeof document<"u",T2=function(){},ks=C2?y.useLayoutEffect:T2;function Ys(n,l){if(n===l)return!0;if(typeof n!=typeof l)return!1;if(typeof n=="function"&&n.toString()===l.toString())return!0;let i,o,c;if(n&&l&&typeof n=="object"){if(Array.isArray(n)){if(i=n.length,i!==l.length)return!1;for(o=i;o--!==0;)if(!Ys(n[o],l[o]))return!1;return!0}if(c=Object.keys(n),i=c.length,i!==Object.keys(l).length)return!1;for(o=i;o--!==0;)if(!{}.hasOwnProperty.call(l,c[o]))return!1;for(o=i;o--!==0;){const d=c[o];if(!(d==="_owner"&&n.$$typeof)&&!Ys(n[d],l[d]))return!1}return!0}return n!==n&&l!==l}function y0(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function ey(n,l){const i=y0(n);return Math.round(l*i)/i}function Vd(n){const l=y.useRef(n);return ks(()=>{l.current=n}),l}function R2(n){n===void 0&&(n={});const{placement:l="bottom",strategy:i="absolute",middleware:o=[],platform:c,elements:{reference:d,floating:f}={},transform:v=!0,whileElementsMounted:g,open:m}=n,[x,p]=y.useState({x:0,y:0,strategy:i,placement:l,middlewareData:{},isPositioned:!1}),[S,T]=y.useState(o);Ys(S,o)||T(o);const[E,C]=y.useState(null),[R,M]=y.useState(null),z=y.useCallback(W=>{W!==q.current&&(q.current=W,C(W))},[]),D=y.useCallback(W=>{W!==V.current&&(V.current=W,M(W))},[]),Y=d||E,K=f||R,q=y.useRef(null),V=y.useRef(null),B=y.useRef(x),oe=g!=null,se=Vd(g),le=Vd(c),ce=Vd(m),ue=y.useCallback(()=>{if(!q.current||!V.current)return;const W={placement:l,strategy:i,middleware:S};le.current&&(W.platform=le.current),E2(q.current,V.current,W).then(ee=>{const $={...ee,isPositioned:ce.current!==!1};ve.current&&!Ys(B.current,$)&&(B.current=$,zr.flushSync(()=>{p($)}))})},[S,l,i,le,ce]);ks(()=>{m===!1&&B.current.isPositioned&&(B.current.isPositioned=!1,p(W=>({...W,isPositioned:!1})))},[m]);const ve=y.useRef(!1);ks(()=>(ve.current=!0,()=>{ve.current=!1}),[]),ks(()=>{if(Y&&(q.current=Y),K&&(V.current=K),Y&&K){if(se.current)return se.current(Y,K,ue);ue()}},[Y,K,ue,se,oe]);const de=y.useMemo(()=>({reference:q,floating:V,setReference:z,setFloating:D}),[z,D]),N=y.useMemo(()=>({reference:Y,floating:K}),[Y,K]),F=y.useMemo(()=>{const W={position:i,left:0,top:0};if(!N.floating)return W;const ee=ey(N.floating,x.x),$=ey(N.floating,x.y);return v?{...W,transform:"translate("+ee+"px, "+$+"px)",...y0(N.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:ee,top:$}},[i,v,N.floating,x.x,x.y]);return y.useMemo(()=>({...x,update:ue,refs:de,elements:N,floatingStyles:F}),[x,ue,de,N,F])}const M2=n=>{function l(i){return{}.hasOwnProperty.call(i,"current")}return{name:"arrow",options:n,fn(i){const{element:o,padding:c}=typeof n=="function"?n(i):n;return o&&l(o)?o.current!=null?Wg({element:o.current,padding:c}).fn(i):{}:o?Wg({element:o,padding:c}).fn(i):{}}}},j2=(n,l)=>{const i=g2(n);return{name:i.name,fn:i.fn,options:[n,l]}},A2=(n,l)=>{const i=y2(n);return{name:i.name,fn:i.fn,options:[n,l]}},O2=(n,l)=>({fn:w2(n).fn,options:[n,l]}),N2=(n,l)=>{const i=b2(n);return{name:i.name,fn:i.fn,options:[n,l]}},_2=(n,l)=>{const i=x2(n);return{name:i.name,fn:i.fn,options:[n,l]}},D2=(n,l)=>{const i=S2(n);return{name:i.name,fn:i.fn,options:[n,l]}},z2=(n,l)=>{const i=M2(n);return{name:i.name,fn:i.fn,options:[n,l]}};var k2="Arrow",b0=y.forwardRef((n,l)=>{const{children:i,width:o=10,height:c=5,...d}=n;return h.jsx(Ce.svg,{...d,ref:l,width:o,height:c,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:n.asChild?i:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});b0.displayName=k2;var L2=b0,Ff="Popper",[x0,Hr]=Pa(Ff),[H2,S0]=x0(Ff),w0=n=>{const{__scopePopper:l,children:i}=n,[o,c]=y.useState(null),[d,f]=y.useState(void 0);return h.jsx(H2,{scope:l,anchor:o,onAnchorChange:c,placementState:d,setPlacementState:f,children:i})};w0.displayName=Ff;var E0="PopperAnchor",C0=y.forwardRef((n,l)=>{const{__scopePopper:i,virtualRef:o,...c}=n,d=S0(E0,i),f=y.useRef(null),v=d.onAnchorChange,g=y.useCallback(E=>{f.current=E,E&&v(E)},[v]),m=Ye(l,g),x=y.useRef(null);y.useEffect(()=>{if(!o)return;const E=x.current;x.current=o.current,E!==x.current&&v(x.current)});const p=d.placementState&&Zf(d.placementState),S=p?.[0],T=p?.[1];return o?null:h.jsx(Ce.div,{"data-radix-popper-side":S,"data-radix-popper-align":T,...c,ref:m})});C0.displayName=E0;var Xf="PopperContent",[U2,B2]=x0(Xf),T0=y.forwardRef((n,l)=>{const{__scopePopper:i,side:o="bottom",sideOffset:c=0,align:d="center",alignOffset:f=0,arrowPadding:v=0,avoidCollisions:g=!0,collisionBoundary:m=[],collisionPadding:x=0,sticky:p="partial",hideWhenDetached:S=!1,updatePositionStrategy:T="optimized",onPlaced:E,...C}=n,R=S0(Xf,i),[M,z]=y.useState(null),D=Ye(l,z),[Y,K]=y.useState(null),q=AC(Y),V=q?.width??0,B=q?.height??0,oe=o+(d!=="center"?"-"+d:""),se=typeof x=="number"?x:{top:0,right:0,bottom:0,left:0,...x},le=Array.isArray(m)?m:[m],ce=le.length>0,ue={padding:se,boundary:le.filter(G2),altBoundary:ce},{refs:ve,floatingStyles:de,placement:N,isPositioned:F,middlewareData:W}=R2({strategy:"fixed",placement:oe,whileElementsMounted:(...ae)=>v2(...ae,{animationFrame:T==="always"}),elements:{reference:R.anchor},middleware:[j2({mainAxis:c+B,alignmentAxis:f}),g&&A2({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?O2():void 0,...ue}),g&&N2({...ue}),_2({...ue,apply:({elements:ae,rects:re,availableWidth:xe,availableHeight:Re})=>{const{width:je,height:et}=re.reference,Ge=ae.floating.style;Ge.setProperty("--radix-popper-available-width",`${xe}px`),Ge.setProperty("--radix-popper-available-height",`${Re}px`),Ge.setProperty("--radix-popper-anchor-width",`${je}px`),Ge.setProperty("--radix-popper-anchor-height",`${et}px`)}}),Y&&z2({element:Y,padding:v}),V2({arrowWidth:V,arrowHeight:B}),S&&D2({strategy:"referenceHidden",...ue,boundary:ce?ue.boundary:void 0})]}),ee=R.setPlacementState;yt(()=>(ee(N),()=>{ee(void 0)}),[N,ee]);const[$,A]=Zf(N),j=xn(E);yt(()=>{F&&j?.()},[F,j]);const L=W.arrow?.x,Q=W.arrow?.y,I=W.arrow?.centerOffset!==0,[te,Z]=y.useState();return yt(()=>{M&&Z(window.getComputedStyle(M).zIndex)},[M]),h.jsx("div",{ref:ve.setFloating,"data-radix-popper-content-wrapper":"",style:{...de,transform:F?de.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:te,"--radix-popper-transform-origin":[W.transformOrigin?.x,W.transformOrigin?.y].join(" "),...W.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:h.jsx(U2,{scope:i,placedSide:$,placedAlign:A,onArrowChange:K,arrowX:L,arrowY:Q,shouldHideArrow:I,children:h.jsx(Ce.div,{"data-side":$,"data-align":A,...C,ref:D,style:{...C.style,animation:F?void 0:"none"}})})})});T0.displayName=Xf;var R0="PopperArrow",q2={top:"bottom",right:"left",bottom:"top",left:"right"},M0=y.forwardRef(function(l,i){const{__scopePopper:o,...c}=l,d=B2(R0,o),f=q2[d.placedSide];return h.jsx("span",{ref:d.onArrowChange,style:{position:"absolute",left:d.arrowX,top:d.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[d.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[d.placedSide],visibility:d.shouldHideArrow?"hidden":void 0},children:h.jsx(L2,{...c,ref:i,style:{...c.style,display:"block"}})})});M0.displayName=R0;function G2(n){return n!==null}var V2=n=>({name:"transformOrigin",options:n,fn(l){const{placement:i,rects:o,middlewareData:c}=l,f=c.arrow?.centerOffset!==0,v=f?0:n.arrowWidth,g=f?0:n.arrowHeight,[m,x]=Zf(i),p={start:"0%",center:"50%",end:"100%"}[x],S=(c.arrow?.x??0)+v/2,T=(c.arrow?.y??0)+g/2;let E="",C="";return m==="bottom"?(E=f?p:`${S}px`,C=`${-g}px`):m==="top"?(E=f?p:`${S}px`,C=`${o.floating.height+g}px`):m==="right"?(E=`${-g}px`,C=f?p:`${T}px`):m==="left"&&(E=`${o.floating.width+g}px`,C=f?p:`${T}px`),{data:{x:E,y:C}}}});function Zf(n){const[l,i="center"]=n.split("-");return[l,i]}var $f=w0,Jf=C0,Wf=T0,eh=M0,Yd=!1;function Y2(){const[n,l]=y.useState(Yd);return y.useEffect(()=>{Yd||(Yd=!0,l(!0))},[]),n}var j0=Fs[" useSyncExternalStore ".trim().toString()];function I2(){return()=>{}}function Q2(){return j0(I2,()=>!0,()=>!1)}var P2=typeof j0=="function"?Q2:Y2,Id="rovingFocusGroup.onEntryFocus",K2={bubbles:!1,cancelable:!0},eo="RovingFocusGroup",[ff,A0,F2]=Nf(eo),[X2,O0]=Pa(eo,[F2]),[Z2,$2]=X2(eo),N0=y.forwardRef((n,l)=>h.jsx(ff.Provider,{scope:n.__scopeRovingFocusGroup,children:h.jsx(ff.Slot,{scope:n.__scopeRovingFocusGroup,children:h.jsx(J2,{...n,ref:l})})}));N0.displayName=eo;var J2=y.forwardRef((n,l)=>{const{__scopeRovingFocusGroup:i,orientation:o,loop:c=!1,dir:d,currentTabStopId:f,defaultCurrentTabStopId:v,onCurrentTabStopIdChange:g,onEntryFocus:m,preventScrollOnEntryFocus:x=!1,...p}=n,S=y.useRef(null),T=Ye(l,S),E=_f(d),[C,R]=Nr({prop:f,defaultProp:v??null,onChange:g,caller:eo}),[M,z]=y.useState(!1),D=xn(m),Y=A0(i),K=y.useRef(!1),[q,V]=y.useState(0);return y.useEffect(()=>{const B=S.current;if(B)return B.addEventListener(Id,D),()=>B.removeEventListener(Id,D)},[D]),h.jsx(Z2,{scope:i,orientation:o,dir:E,loop:c,currentTabStopId:C,onItemFocus:y.useCallback(B=>R(B),[R]),onItemShiftTab:y.useCallback(()=>z(!0),[]),onFocusableItemAdd:y.useCallback(()=>V(B=>B+1),[]),onFocusableItemRemove:y.useCallback(()=>V(B=>B-1),[]),children:h.jsx(Ce.div,{tabIndex:M||q===0?-1:0,"data-orientation":o,...p,ref:T,style:{outline:"none",...n.style},onMouseDown:pe(n.onMouseDown,()=>{K.current=!0}),onFocus:pe(n.onFocus,B=>{const oe=!K.current;if(B.target===B.currentTarget&&oe&&!M){const se=new CustomEvent(Id,K2);if(B.currentTarget.dispatchEvent(se),!se.defaultPrevented){const le=Y().filter(N=>N.focusable),ce=le.find(N=>N.active),ue=le.find(N=>N.id===C),de=[ce,ue,...le].filter(Boolean).map(N=>N.ref.current);z0(de,x)}}K.current=!1}),onBlur:pe(n.onBlur,()=>z(!1))})})}),_0="RovingFocusGroupItem",D0=y.forwardRef((n,l)=>{const{__scopeRovingFocusGroup:i,focusable:o=!0,active:c=!1,tabStopId:d,children:f,...v}=n,g=Ot(),m=d||g,x=$2(_0,i),p=x.currentTabStopId===m,S=A0(i),{onFocusableItemAdd:T,onFocusableItemRemove:E,currentTabStopId:C}=x,R=P2();return yt(()=>{if(!(!R||!o))return T(),()=>E()},[R,o,T,E]),y.useEffect(()=>{if(!(R||!o))return T(),()=>E()},[R,o,T,E]),h.jsx(ff.ItemSlot,{scope:i,id:m,focusable:o,active:c,children:h.jsx(Ce.span,{tabIndex:p?0:-1,"data-orientation":x.orientation,...v,ref:l,onMouseDown:pe(n.onMouseDown,M=>{o?x.onItemFocus(m):M.preventDefault()}),onFocus:pe(n.onFocus,()=>x.onItemFocus(m)),onKeyDown:pe(n.onKeyDown,M=>{if(M.key==="Tab"&&M.shiftKey){x.onItemShiftTab();return}if(M.target!==M.currentTarget)return;const z=tT(M,x.orientation,x.dir);if(z!==void 0){if(M.metaKey||M.ctrlKey||M.altKey||M.shiftKey)return;M.preventDefault();let Y=S().filter(K=>K.focusable).map(K=>K.ref.current);if(z==="last")Y.reverse();else if(z==="prev"||z==="next"){z==="prev"&&Y.reverse();const K=Y.indexOf(M.currentTarget);Y=x.loop?nT(Y,K+1):Y.slice(K+1)}setTimeout(()=>z0(Y))}}),children:typeof f=="function"?f({isCurrentTabStop:p,hasTabStop:C!=null}):f})})});D0.displayName=_0;var W2={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function eT(n,l){return l!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}function tT(n,l,i){const o=eT(n.key,i);if(!(l==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(l==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return W2[o]}function z0(n,l=!1){const i=document.activeElement;for(const o of n)if(o===i||(o.focus({preventScroll:l}),document.activeElement!==i))return}function nT(n,l){return n.map((i,o)=>n[(l+o)%n.length])}var aT=N0,lT=D0,hf=["Enter"," "],rT=["ArrowDown","PageUp","Home"],k0=["ArrowUp","PageDown","End"],iT=[...rT,...k0],oT={ltr:[...hf,"ArrowRight"],rtl:[...hf,"ArrowLeft"]},sT={ltr:["ArrowLeft"],rtl:["ArrowRight"]},to="Menu",[Yi,cT,uT]=Nf(to),[jl,L0]=Pa(to,[uT,Hr,O0]),lc=Hr(),H0=O0(),[dT,Al]=jl(to),[fT,no]=jl(to),U0=n=>{const{__scopeMenu:l,open:i=!1,children:o,dir:c,onOpenChange:d,modal:f=!0}=n,v=lc(l),[g,m]=y.useState(null),x=y.useRef(!1),p=xn(d),S=_f(c);return y.useEffect(()=>{const T=()=>{x.current=!0,document.addEventListener("pointerdown",E,{capture:!0,once:!0}),document.addEventListener("pointermove",E,{capture:!0,once:!0})},E=()=>x.current=!1;return document.addEventListener("keydown",T,{capture:!0}),()=>{document.removeEventListener("keydown",T,{capture:!0}),document.removeEventListener("pointerdown",E,{capture:!0}),document.removeEventListener("pointermove",E,{capture:!0})}},[]),y.useEffect(()=>{if(!i)return;const T=()=>p(!1);return window.addEventListener("blur",T),()=>window.removeEventListener("blur",T)},[i,p]),h.jsx($f,{...v,children:h.jsx(dT,{scope:l,open:i,onOpenChange:p,content:g,onContentChange:m,children:h.jsx(fT,{scope:l,onClose:y.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:x,dir:S,modal:f,children:o})})})};U0.displayName=to;var hT="MenuAnchor",th=y.forwardRef((n,l)=>{const{__scopeMenu:i,...o}=n,c=lc(i);return h.jsx(Jf,{...c,...o,ref:l})});th.displayName=hT;var nh="MenuPortal",[mT,B0]=jl(nh,{forceMount:void 0}),q0=n=>{const{__scopeMenu:l,forceMount:i,children:o,container:c}=n,d=Al(nh,l);return h.jsx(mT,{scope:l,forceMount:i,children:h.jsx(jn,{present:i||d.open,children:h.jsx(Wi,{asChild:!0,container:c,children:o})})})};q0.displayName=nh;var bn="MenuContent",[pT,ah]=jl(bn),G0=y.forwardRef((n,l)=>{const i=B0(bn,n.__scopeMenu),{forceMount:o=i.forceMount,...c}=n,d=Al(bn,n.__scopeMenu),f=no(bn,n.__scopeMenu);return h.jsx(Yi.Provider,{scope:n.__scopeMenu,children:h.jsx(jn,{present:o||d.open,children:h.jsx(Yi.Slot,{scope:n.__scopeMenu,children:f.modal?h.jsx(vT,{...c,ref:l}):h.jsx(gT,{...c,ref:l})})})})}),vT=y.forwardRef((n,l)=>{const i=Al(bn,n.__scopeMenu),o=y.useRef(null),c=Ye(l,o);return y.useEffect(()=>{const d=o.current;if(d)return kf(d)},[]),h.jsx(lh,{...n,ref:c,trapFocus:i.open,disableOutsidePointerEvents:i.open,disableOutsideScroll:!0,onFocusOutside:pe(n.onFocusOutside,d=>d.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>i.onOpenChange(!1)})}),gT=y.forwardRef((n,l)=>{const i=Al(bn,n.__scopeMenu);return h.jsx(lh,{...n,ref:l,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>i.onOpenChange(!1)})}),yT=El("MenuContent.ScrollLock"),lh=y.forwardRef((n,l)=>{const{__scopeMenu:i,loop:o=!1,trapFocus:c,onOpenAutoFocus:d,onCloseAutoFocus:f,disableOutsidePointerEvents:v,onEntryFocus:g,onEscapeKeyDown:m,onPointerDownOutside:x,onFocusOutside:p,onInteractOutside:S,onDismiss:T,disableOutsideScroll:E,...C}=n,R=Al(bn,i),M=no(bn,i),z=lc(i),D=H0(i),Y=cT(i),[K,q]=y.useState(null),V=y.useRef(null),B=Ye(l,V,R.onContentChange),oe=y.useRef(0),se=y.useRef(""),le=y.useRef(0),ce=y.useRef(null),ue=y.useRef("right"),ve=y.useRef(0),de=E?$s:y.Fragment,N=E?{as:yT,allowPinchZoom:!0}:void 0,F=ee=>{const $=se.current+ee,A=Y().filter(Z=>!Z.disabled),j=document.activeElement,L=A.find(Z=>Z.ref.current===j)?.textValue,Q=A.map(Z=>Z.textValue),I=OT(Q,$,L),te=A.find(Z=>Z.textValue===I)?.ref.current;(function Z(ae){se.current=ae,window.clearTimeout(oe.current),ae!==""&&(oe.current=window.setTimeout(()=>Z(""),1e3))})($),te&&setTimeout(()=>te.focus())};y.useEffect(()=>()=>window.clearTimeout(oe.current),[]),zf();const W=y.useCallback(ee=>ue.current===ce.current?.side&&_T(ee,ce.current?.area),[]);return h.jsx(pT,{scope:i,searchRef:se,onItemEnter:y.useCallback(ee=>{W(ee)&&ee.preventDefault()},[W]),onItemLeave:y.useCallback(ee=>{W(ee)||(V.current?.focus(),q(null))},[W]),onTriggerLeave:y.useCallback(ee=>{W(ee)&&ee.preventDefault()},[W]),pointerGraceTimerRef:le,onPointerGraceIntentChange:y.useCallback(ee=>{ce.current=ee},[]),children:h.jsx(de,{...N,children:h.jsx(Xs,{asChild:!0,trapped:c,onMountAutoFocus:pe(d,ee=>{ee.preventDefault(),V.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:f,children:h.jsx(Ji,{asChild:!0,disableOutsidePointerEvents:v,onEscapeKeyDown:m,onPointerDownOutside:x,onFocusOutside:p,onInteractOutside:S,onDismiss:T,children:h.jsx(aT,{asChild:!0,...D,dir:M.dir,orientation:"vertical",loop:o,currentTabStopId:K,onCurrentTabStopIdChange:q,onEntryFocus:pe(g,ee=>{M.isUsingKeyboardRef.current||ee.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(Wf,{role:"menu","aria-orientation":"vertical","data-state":ab(R.open),"data-radix-menu-content":"",dir:M.dir,...z,...C,ref:B,style:{outline:"none",...C.style},onKeyDown:pe(C.onKeyDown,ee=>{const A=ee.target.closest("[data-radix-menu-content]")===ee.currentTarget,j=ee.ctrlKey||ee.altKey||ee.metaKey,L=ee.key.length===1;A&&(ee.key==="Tab"&&ee.preventDefault(),!j&&L&&F(ee.key));const Q=V.current;if(ee.target!==Q||!iT.includes(ee.key))return;ee.preventDefault();const te=Y().filter(Z=>!Z.disabled).map(Z=>Z.ref.current);k0.includes(ee.key)&&te.reverse(),jT(te)}),onBlur:pe(n.onBlur,ee=>{ee.currentTarget.contains(ee.target)||(window.clearTimeout(oe.current),se.current="")}),onPointerMove:pe(n.onPointerMove,Ii(ee=>{const $=ee.target,A=ve.current!==ee.clientX;if(ee.currentTarget.contains($)&&A){const j=ee.clientX>ve.current?"right":"left";ue.current=j,ve.current=ee.clientX}}))})})})})})})});G0.displayName=bn;var bT="MenuGroup",rh=y.forwardRef((n,l)=>{const{__scopeMenu:i,...o}=n;return h.jsx(Ce.div,{role:"group",...o,ref:l})});rh.displayName=bT;var xT="MenuLabel",V0=y.forwardRef((n,l)=>{const{__scopeMenu:i,...o}=n;return h.jsx(Ce.div,{...o,ref:l})});V0.displayName=xT;var Is="MenuItem",ty="menu.itemSelect",rc=y.forwardRef((n,l)=>{const{disabled:i=!1,onSelect:o,...c}=n,d=y.useRef(null),f=no(Is,n.__scopeMenu),v=ah(Is,n.__scopeMenu),g=Ye(l,d),m=y.useRef(!1),x=()=>{const p=d.current;if(!i&&p){const S=new CustomEvent(ty,{bubbles:!0,cancelable:!0});p.addEventListener(ty,T=>o?.(T),{once:!0}),qy(p,S),S.defaultPrevented?m.current=!1:f.onClose()}};return h.jsx(Y0,{...c,ref:g,disabled:i,onClick:pe(n.onClick,x),onPointerDown:p=>{n.onPointerDown?.(p),m.current=!0},onPointerUp:pe(n.onPointerUp,p=>{m.current||p.currentTarget?.click()}),onKeyDown:pe(n.onKeyDown,p=>{i||p.target!==p.currentTarget||v.searchRef.current!==""&&p.key===" "||hf.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});rc.displayName=Is;var Y0=y.forwardRef((n,l)=>{const{__scopeMenu:i,disabled:o=!1,textValue:c,...d}=n,f=ah(Is,i),v=H0(i),g=y.useRef(null),m=Ye(l,g),[x,p]=y.useState(!1),[S,T]=y.useState("");return y.useEffect(()=>{const E=g.current;E&&T((E.textContent??"").trim())},[d.children]),h.jsx(Yi.ItemSlot,{scope:i,disabled:o,textValue:c??S,children:h.jsx(lT,{asChild:!0,...v,focusable:!o,children:h.jsx(Ce.div,{role:"menuitem","data-highlighted":x?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...d,ref:m,onPointerMove:pe(n.onPointerMove,Ii(E=>{o?f.onItemLeave(E):(f.onItemEnter(E),E.defaultPrevented||E.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:pe(n.onPointerLeave,Ii(E=>f.onItemLeave(E))),onFocus:pe(n.onFocus,()=>p(!0)),onBlur:pe(n.onBlur,()=>p(!1))})})})}),ST="MenuCheckboxItem",I0=y.forwardRef((n,l)=>{const{checked:i=!1,onCheckedChange:o,...c}=n;return h.jsx(X0,{scope:n.__scopeMenu,checked:i,children:h.jsx(rc,{role:"menuitemcheckbox","aria-checked":Qs(i)?"mixed":i,...c,ref:l,"data-state":oh(i),onSelect:pe(c.onSelect,()=>o?.(Qs(i)?!0:!i),{checkForDefaultPrevented:!1})})})});I0.displayName=ST;var Q0="MenuRadioGroup",[wT,ET]=jl(Q0,{value:void 0,onValueChange:()=>{}}),P0=y.forwardRef((n,l)=>{const{value:i,onValueChange:o,...c}=n,d=xn(o);return h.jsx(wT,{scope:n.__scopeMenu,value:i,onValueChange:d,children:h.jsx(rh,{...c,ref:l})})});P0.displayName=Q0;var K0="MenuRadioItem",F0=y.forwardRef((n,l)=>{const{value:i,...o}=n,c=ET(K0,n.__scopeMenu),d=i===c.value;return h.jsx(X0,{scope:n.__scopeMenu,checked:d,children:h.jsx(rc,{role:"menuitemradio","aria-checked":d,...o,ref:l,"data-state":oh(d),onSelect:pe(o.onSelect,()=>c.onValueChange?.(i),{checkForDefaultPrevented:!1})})})});F0.displayName=K0;var ih="MenuItemIndicator",[X0,CT]=jl(ih,{checked:!1}),Z0=y.forwardRef((n,l)=>{const{__scopeMenu:i,forceMount:o,...c}=n,d=CT(ih,i);return h.jsx(jn,{present:o||Qs(d.checked)||d.checked===!0,children:h.jsx(Ce.span,{...c,ref:l,"data-state":oh(d.checked)})})});Z0.displayName=ih;var TT="MenuSeparator",$0=y.forwardRef((n,l)=>{const{__scopeMenu:i,...o}=n;return h.jsx(Ce.div,{role:"separator","aria-orientation":"horizontal",...o,ref:l})});$0.displayName=TT;var RT="MenuArrow",J0=y.forwardRef((n,l)=>{const{__scopeMenu:i,...o}=n,c=lc(i);return h.jsx(eh,{...c,...o,ref:l})});J0.displayName=RT;var MT="MenuSub",[QN,W0]=jl(MT),ki="MenuSubTrigger",eb=y.forwardRef((n,l)=>{const i=Al(ki,n.__scopeMenu),o=no(ki,n.__scopeMenu),c=W0(ki,n.__scopeMenu),d=ah(ki,n.__scopeMenu),f=y.useRef(null),{pointerGraceTimerRef:v,onPointerGraceIntentChange:g}=d,m={__scopeMenu:n.__scopeMenu},x=y.useCallback(()=>{f.current&&window.clearTimeout(f.current),f.current=null},[]);y.useEffect(()=>x,[x]),y.useEffect(()=>{const S=v.current;return()=>{window.clearTimeout(S),g(null)}},[v,g]);const p=Ye(l,c.onTriggerChange);return h.jsx(th,{asChild:!0,...m,children:h.jsx(Y0,{id:c.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?c.contentId:void 0,"data-state":ab(i.open),...n,ref:p,onClick:S=>{n.onClick?.(S),!(n.disabled||S.defaultPrevented)&&(S.currentTarget.focus(),i.open||i.onOpenChange(!0))},onPointerMove:pe(n.onPointerMove,Ii(S=>{d.onItemEnter(S),!S.defaultPrevented&&!n.disabled&&!i.open&&!f.current&&(d.onPointerGraceIntentChange(null),f.current=window.setTimeout(()=>{i.onOpenChange(!0),x()},100))})),onPointerLeave:pe(n.onPointerLeave,Ii(S=>{x();const T=i.content?.getBoundingClientRect();if(T){const E=i.content?.dataset.side,C=E==="right",R=C?-5:5,M=T[C?"left":"right"],z=T[C?"right":"left"];d.onPointerGraceIntentChange({area:[{x:S.clientX+R,y:S.clientY},{x:M,y:T.top},{x:z,y:T.top},{x:z,y:T.bottom},{x:M,y:T.bottom}],side:E}),window.clearTimeout(v.current),v.current=window.setTimeout(()=>d.onPointerGraceIntentChange(null),300)}else{if(d.onTriggerLeave(S),S.defaultPrevented)return;d.onPointerGraceIntentChange(null)}})),onKeyDown:pe(n.onKeyDown,S=>{n.disabled||S.target!==S.currentTarget||d.searchRef.current!==""&&S.key===" "||oT[o.dir].includes(S.key)&&(i.onOpenChange(!0),i.content?.focus(),S.preventDefault())})})})});eb.displayName=ki;var tb="MenuSubContent",nb=y.forwardRef((n,l)=>{const i=B0(bn,n.__scopeMenu),{forceMount:o=i.forceMount,align:c="start",...d}=n,f=Al(bn,n.__scopeMenu),v=no(bn,n.__scopeMenu),g=W0(tb,n.__scopeMenu),m=y.useRef(null),x=Ye(l,m);return h.jsx(Yi.Provider,{scope:n.__scopeMenu,children:h.jsx(jn,{present:o||f.open,children:h.jsx(Yi.Slot,{scope:n.__scopeMenu,children:h.jsx(lh,{id:g.contentId,"aria-labelledby":g.triggerId,...d,ref:x,align:c,side:v.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{v.isUsingKeyboardRef.current&&m.current?.focus(),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:pe(n.onFocusOutside,p=>{p.target!==g.trigger&&f.onOpenChange(!1)}),onEscapeKeyDown:pe(n.onEscapeKeyDown,p=>{v.onClose(),p.preventDefault()}),onKeyDown:pe(n.onKeyDown,p=>{const S=p.currentTarget.contains(p.target),T=sT[v.dir].includes(p.key);S&&T&&(f.onOpenChange(!1),g.trigger?.focus(),p.preventDefault())})})})})})});nb.displayName=tb;function ab(n){return n?"open":"closed"}function Qs(n){return n==="indeterminate"}function oh(n){return Qs(n)?"indeterminate":n?"checked":"unchecked"}function jT(n){const l=document.activeElement;for(const i of n)if(i===l||(i.focus(),document.activeElement!==l))return}function AT(n,l){return n.map((i,o)=>n[(l+o)%n.length])}function OT(n,l,i){const c=l.length>1&&Array.from(l).every(m=>m===l[0])?l[0]:l,d=i?n.indexOf(i):-1;let f=AT(n,Math.max(d,0));c.length===1&&(f=f.filter(m=>m!==i));const g=f.find(m=>m.toLowerCase().startsWith(c.toLowerCase()));return g!==i?g:void 0}function NT(n,l){const{x:i,y:o}=n;let c=!1;for(let d=0,f=l.length-1;d o!=S>o&&i<(p-m)*(o-x)/(S-x)+m&&(c=!c)}return c}function _T(n,l){if(!l)return!1;const i={x:n.clientX,y:n.clientY};return NT(i,l)}function Ii(n){return l=>l.pointerType==="mouse"?n(l):void 0}var DT=U0,zT=th,kT=q0,LT=G0,HT=rh,UT=V0,BT=rc,qT=I0,GT=P0,VT=F0,YT=Z0,IT=$0,QT=J0,PT=eb,KT=nb,ic="DropdownMenu",[FT]=Pa(ic,[L0]),zt=L0(),[XT,lb]=FT(ic),rb=n=>{const{__scopeDropdownMenu:l,children:i,dir:o,open:c,defaultOpen:d,onOpenChange:f,modal:v=!0}=n,g=zt(l),m=y.useRef(null),[x,p]=Nr({prop:c,defaultProp:d??!1,onChange:f,caller:ic});return h.jsx(XT,{scope:l,triggerId:Ot(),triggerRef:m,contentId:Ot(),open:x,onOpenChange:p,onOpenToggle:y.useCallback(()=>p(S=>!S),[p]),modal:v,children:h.jsx(DT,{...g,open:x,onOpenChange:p,dir:o,modal:v,children:i})})};rb.displayName=ic;var ib="DropdownMenuTrigger",ob=y.forwardRef((n,l)=>{const{__scopeDropdownMenu:i,disabled:o=!1,...c}=n,d=lb(ib,i),f=zt(i),v=Ye(l,d.triggerRef);return h.jsx(zT,{asChild:!0,...f,children:h.jsx(Ce.button,{type:"button",id:d.triggerId,"aria-haspopup":"menu","aria-expanded":d.open,"aria-controls":d.open?d.contentId:void 0,"data-state":d.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...c,ref:v,onPointerDown:pe(n.onPointerDown,g=>{!o&&g.button===0&&g.ctrlKey===!1&&(d.onOpenToggle(),d.open||g.preventDefault())}),onKeyDown:pe(n.onKeyDown,g=>{o||(["Enter"," "].includes(g.key)&&d.onOpenToggle(),g.key==="ArrowDown"&&d.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(g.key)&&g.preventDefault())})})})});ob.displayName=ib;var ZT="DropdownMenuPortal",sb=n=>{const{__scopeDropdownMenu:l,...i}=n,o=zt(l);return h.jsx(kT,{...o,...i})};sb.displayName=ZT;var cb="DropdownMenuContent",ub=y.forwardRef((n,l)=>{const{__scopeDropdownMenu:i,...o}=n,c=lb(cb,i),d=zt(i),f=y.useRef(!1);return h.jsx(LT,{id:c.contentId,"aria-labelledby":c.triggerId,...d,...o,ref:l,onCloseAutoFocus:pe(n.onCloseAutoFocus,v=>{f.current||c.triggerRef.current?.focus(),f.current=!1,v.preventDefault()}),onInteractOutside:pe(n.onInteractOutside,v=>{const g=v.detail.originalEvent,m=g.button===0&&g.ctrlKey===!0,x=g.button===2||m;(!c.modal||x)&&(f.current=!0)}),style:{...n.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ub.displayName=cb;var $T="DropdownMenuGroup",JT=y.forwardRef((n,l)=>{const{__scopeDropdownMenu:i,...o}=n,c=zt(i);return h.jsx(HT,{...c,...o,ref:l})});JT.displayName=$T;var WT="DropdownMenuLabel",db=y.forwardRef((n,l)=>{const{__scopeDropdownMenu:i,...o}=n,c=zt(i);return h.jsx(UT,{...c,...o,ref:l})});db.displayName=WT;var eR="DropdownMenuItem",fb=y.forwardRef((n,l)=>{const{__scopeDropdownMenu:i,...o}=n,c=zt(i);return h.jsx(BT,{...c,...o,ref:l})});fb.displayName=eR;var tR="DropdownMenuCheckboxItem",nR=y.forwardRef((n,l)=>{const{__scopeDropdownMenu:i,...o}=n,c=zt(i);return h.jsx(qT,{...c,...o,ref:l})});nR.displayName=tR;var aR="DropdownMenuRadioGroup",lR=y.forwardRef((n,l)=>{const{__scopeDropdownMenu:i,...o}=n,c=zt(i);return h.jsx(GT,{...c,...o,ref:l})});lR.displayName=aR;var rR="DropdownMenuRadioItem",iR=y.forwardRef((n,l)=>{const{__scopeDropdownMenu:i,...o}=n,c=zt(i);return h.jsx(VT,{...c,...o,ref:l})});iR.displayName=rR;var oR="DropdownMenuItemIndicator",sR=y.forwardRef((n,l)=>{const{__scopeDropdownMenu:i,...o}=n,c=zt(i);return h.jsx(YT,{...c,...o,ref:l})});sR.displayName=oR;var cR="DropdownMenuSeparator",uR=y.forwardRef((n,l)=>{const{__scopeDropdownMenu:i,...o}=n,c=zt(i);return h.jsx(IT,{...c,...o,ref:l})});uR.displayName=cR;var dR="DropdownMenuArrow",fR=y.forwardRef((n,l)=>{const{__scopeDropdownMenu:i,...o}=n,c=zt(i);return h.jsx(QT,{...c,...o,ref:l})});fR.displayName=dR;var hR="DropdownMenuSubTrigger",mR=y.forwardRef((n,l)=>{const{__scopeDropdownMenu:i,...o}=n,c=zt(i);return h.jsx(PT,{...c,...o,ref:l})});mR.displayName=hR;var pR="DropdownMenuSubContent",vR=y.forwardRef((n,l)=>{const{__scopeDropdownMenu:i,...o}=n,c=zt(i);return h.jsx(KT,{...c,...o,ref:l,style:{...n.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});vR.displayName=pR;var gR=rb,yR=ob,bR=sb,xR=ub,SR=db,wR=fb;function ny(n,[l,i]){return Math.min(i,Math.max(l,n))}var ER=[" ","Enter","ArrowUp","ArrowDown"],CR=[" ","Enter"],Rl="Select",[oc,sc,TR]=Nf(Rl),[Ol]=Pa(Rl,[TR,Hr]),cc=Hr(),[RR,Fa]=Ol(Rl),[MR,jR]=Ol(Rl),AR="SelectProvider";function hb(n){const{__scopeSelect:l,children:i,open:o,defaultOpen:c,onOpenChange:d,value:f,defaultValue:v,onValueChange:g,dir:m,name:x,autoComplete:p,disabled:S,required:T,form:E,internal_do_not_use_render:C}=n,R=cc(l),[M,z]=y.useState(null),[D,Y]=y.useState(null),[K,q]=y.useState(!1),V=_f(m),[B,oe]=Nr({prop:o,defaultProp:c??!1,onChange:d,caller:Rl}),[se,le]=Nr({prop:f,defaultProp:v,onChange:g,caller:Rl}),ce=y.useRef(null),ue=y.useRef(se);y.useEffect(()=>{const j=E?M?.ownerDocument.getElementById(E):M?.form;if(j instanceof HTMLFormElement){const L=()=>le(ue.current);return j.addEventListener("reset",L),()=>j.removeEventListener("reset",L)}},[E,M,le]);const ve=M?!!E||!!M.closest("form"):!0,[de,N]=y.useState(new Set),F=Ot(),W=Array.from(de).map(j=>j.props.value).join(";"),ee=y.useCallback(j=>{N(L=>new Set(L).add(j))},[]),$=y.useCallback(j=>{N(L=>{const Q=new Set(L);return Q.delete(j),Q})},[]),A={required:T,trigger:M,onTriggerChange:z,valueNode:D,onValueNodeChange:Y,valueNodeHasChildren:K,onValueNodeHasChildrenChange:q,contentId:F,value:se,onValueChange:le,open:B,onOpenChange:oe,dir:V,triggerPointerDownPosRef:ce,disabled:S,name:x,autoComplete:p,form:E,nativeOptions:de,nativeSelectKey:W,isFormControl:ve};return h.jsx($f,{...R,children:h.jsx(RR,{scope:l,...A,children:h.jsx(oc.Provider,{scope:l,children:h.jsx(MR,{scope:l,onNativeOptionAdd:ee,onNativeOptionRemove:$,children:PR(C)?C(A):i})})})})}hb.displayName=AR;var mb=n=>{const{__scopeSelect:l,children:i,...o}=n;return h.jsx(hb,{__scopeSelect:l,...o,internal_do_not_use_render:({isFormControl:c})=>h.jsxs(h.Fragment,{children:[i,c?h.jsx(qb,{__scopeSelect:l}):null]})})};mb.displayName=Rl;var pb="SelectTrigger",vb=y.forwardRef((n,l)=>{const{__scopeSelect:i,disabled:o=!1,...c}=n,d=cc(i),f=Fa(pb,i),v=f.disabled||o,g=Ye(l,f.onTriggerChange),m=sc(i),x=y.useRef("touch"),[p,S,T]=Gb(C=>{const R=m().filter(D=>!D.disabled),M=R.find(D=>D.value===f.value),z=Vb(R,C,M);z!==void 0&&f.onValueChange(z.value)}),E=C=>{v||(f.onOpenChange(!0),T()),C&&(f.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})};return h.jsx(Jf,{asChild:!0,...d,children:h.jsx(Ce.button,{type:"button",role:"combobox","aria-controls":f.open?f.contentId:void 0,"aria-expanded":f.open,"aria-required":f.required,"aria-autocomplete":"none",dir:f.dir,"data-state":f.open?"open":"closed",disabled:v,"data-disabled":v?"":void 0,"data-placeholder":uc(f.value)?"":void 0,...c,ref:g,onClick:pe(c.onClick,C=>{C.currentTarget.focus(),x.current!=="mouse"&&E(C)}),onPointerDown:pe(c.onPointerDown,C=>{x.current=C.pointerType;const R=C.target;R.hasPointerCapture(C.pointerId)&&R.releasePointerCapture(C.pointerId),C.button===0&&C.ctrlKey===!1&&C.pointerType==="mouse"&&(E(C),C.preventDefault())}),onKeyDown:pe(c.onKeyDown,C=>{const R=p.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&S(C.key),!(R&&C.key===" ")&&ER.includes(C.key)&&(E(),C.preventDefault())})})})});vb.displayName=pb;var gb="SelectValue",yb=y.forwardRef((n,l)=>{const{__scopeSelect:i,className:o,style:c,children:d,placeholder:f="",...v}=n,g=Fa(gb,i),{onValueNodeHasChildrenChange:m}=g,x=d!==void 0,p=Ye(l,g.onValueNodeChange);yt(()=>{m(x)},[m,x]);const S=uc(g.value);return h.jsx(Ce.span,{...v,asChild:S?!1:v.asChild,ref:p,style:{pointerEvents:"none"},children:h.jsx(y.Fragment,{children:S?f:d},S?"placeholder":"value")})});yb.displayName=gb;var OR="SelectIcon",bb=y.forwardRef((n,l)=>{const{__scopeSelect:i,children:o,...c}=n;return h.jsx(Ce.span,{"aria-hidden":!0,...c,ref:l,children:o||"▼"})});bb.displayName=OR;var xb="SelectPortal",[NR,_R]=Ol(xb,{forceMount:void 0}),Sb=n=>{const{__scopeSelect:l,forceMount:i,...o}=n;return h.jsx(NR,{scope:n.__scopeSelect,forceMount:i,children:h.jsx(Wi,{asChild:!0,...o})})};Sb.displayName=xb;var Ia="SelectContent",wb=y.forwardRef((n,l)=>{const i=_R(Ia,n.__scopeSelect),{forceMount:o=i.forceMount,...c}=n,d=Fa(Ia,n.__scopeSelect),[f,v]=y.useState();return yt(()=>{v(new DocumentFragment)},[]),h.jsx(jn,{present:o||d.open,children:({present:g})=>g?h.jsx(Tb,{...c,ref:l}):h.jsx(Eb,{...c,fragment:f})})});wb.displayName=Ia;var Eb=y.forwardRef((n,l)=>{const{__scopeSelect:i,children:o,fragment:c}=n;return c?zr.createPortal(h.jsx(Cb,{scope:i,children:h.jsx(oc.Slot,{scope:i,children:h.jsx("div",{ref:l,children:o})})}),c):null});Eb.displayName="SelectContentFragment";var Rn=10,[Cb,Xa]=Ol(Ia),DR="SelectContentImpl",zR=El("SelectContent.RemoveScroll"),Tb=y.forwardRef((n,l)=>{const{__scopeSelect:i}=n,{position:o="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:d,onPointerDownOutside:f,side:v,sideOffset:g,align:m,alignOffset:x,arrowPadding:p,collisionBoundary:S,collisionPadding:T,sticky:E,hideWhenDetached:C,avoidCollisions:R,...M}=n,z=Fa(Ia,i),[D,Y]=y.useState(null),[K,q]=y.useState(null),V=Ye(l,Y),[B,oe]=y.useState(null),[se,le]=y.useState(null),ce=sc(i),[ue,ve]=y.useState(!1),de=y.useRef(!1);y.useEffect(()=>{if(D)return kf(D)},[D]),zf();const N=y.useCallback(Z=>{const[ae,...re]=ce().map(je=>je.ref.current),[xe]=re.slice(-1),Re=document.activeElement;for(const je of Z)if(je===Re||(je?.scrollIntoView({block:"nearest"}),je===ae&&K&&(K.scrollTop=0),je===xe&&K&&(K.scrollTop=K.scrollHeight),je?.focus(),document.activeElement!==Re))return},[ce,K]),F=y.useCallback(()=>N([B,D]),[N,B,D]);y.useEffect(()=>{ue&&F()},[ue,F]);const{onOpenChange:W,triggerPointerDownPosRef:ee}=z;y.useEffect(()=>{if(D){let Z={x:0,y:0};const ae=xe=>{Z={x:Math.abs(Math.round(xe.pageX)-(ee.current?.x??0)),y:Math.abs(Math.round(xe.pageY)-(ee.current?.y??0))}},re=xe=>{Z.x<=10&&Z.y<=10?xe.preventDefault():xe.composedPath().includes(D)||W(!1),document.removeEventListener("pointermove",ae),ee.current=null};return ee.current!==null&&(document.addEventListener("pointermove",ae),document.addEventListener("pointerup",re,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ae),document.removeEventListener("pointerup",re,{capture:!0})}}},[D,W,ee]),y.useEffect(()=>{const Z=()=>W(!1);return window.addEventListener("blur",Z),window.addEventListener("resize",Z),()=>{window.removeEventListener("blur",Z),window.removeEventListener("resize",Z)}},[W]);const[$,A]=Gb(Z=>{const ae=ce().filter(Re=>!Re.disabled),re=ae.find(Re=>Re.ref.current===document.activeElement),xe=Vb(ae,Z,re);xe&&setTimeout(()=>xe.ref.current?.focus())}),j=y.useCallback((Z,ae,re)=>{const xe=!de.current&&!re;(z.value!==void 0&&z.value===ae||xe)&&(oe(Z),xe&&(de.current=!0))},[z.value]),L=y.useCallback(()=>D?.focus(),[D]),Q=y.useCallback((Z,ae,re)=>{const xe=!de.current&&!re;(z.value!==void 0&&z.value===ae||xe)&&le(Z)},[z.value]),I=o==="popper"?mf:Rb,te=I===mf?{side:v,sideOffset:g,align:m,alignOffset:x,arrowPadding:p,collisionBoundary:S,collisionPadding:T,sticky:E,hideWhenDetached:C,avoidCollisions:R}:{};return h.jsx(Cb,{scope:i,content:D,viewport:K,onViewportChange:q,itemRefCallback:j,selectedItem:B,onItemLeave:L,itemTextRefCallback:Q,focusSelectedItem:F,selectedItemText:se,position:o,isPositioned:ue,searchRef:$,children:h.jsx($s,{as:zR,allowPinchZoom:!0,children:h.jsx(Xs,{asChild:!0,trapped:z.open,onMountAutoFocus:Z=>{Z.preventDefault()},onUnmountAutoFocus:pe(c,Z=>{z.trigger?.focus({preventScroll:!0}),Z.preventDefault()}),children:h.jsx(Ji,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:Z=>Z.preventDefault(),onDismiss:()=>z.onOpenChange(!1),children:h.jsx(I,{role:"listbox",id:z.contentId,"data-state":z.open?"open":"closed",dir:z.dir,onContextMenu:Z=>Z.preventDefault(),...M,...te,onPlaced:()=>ve(!0),ref:V,style:{display:"flex",flexDirection:"column",outline:"none",...M.style},onKeyDown:pe(M.onKeyDown,Z=>{const ae=Z.ctrlKey||Z.altKey||Z.metaKey;if(Z.key==="Tab"&&Z.preventDefault(),!ae&&Z.key.length===1&&A(Z.key),["ArrowUp","ArrowDown","Home","End"].includes(Z.key)){let xe=ce().filter(Re=>!Re.disabled).map(Re=>Re.ref.current);if(["ArrowUp","End"].includes(Z.key)&&(xe=xe.slice().reverse()),["ArrowUp","ArrowDown"].includes(Z.key)){const Re=Z.target,je=xe.indexOf(Re);xe=xe.slice(je+1)}setTimeout(()=>N(xe)),Z.preventDefault()}})})})})})})});Tb.displayName=DR;var kR="SelectItemAlignedPosition",Rb=y.forwardRef((n,l)=>{const{__scopeSelect:i,onPlaced:o,...c}=n,d=Fa(Ia,i),f=Xa(Ia,i),[v,g]=y.useState(null),[m,x]=y.useState(null),p=Ye(l,x),S=sc(i),T=y.useRef(!1),E=y.useRef(!0),{viewport:C,selectedItem:R,selectedItemText:M,focusSelectedItem:z}=f,D=y.useCallback(()=>{if(d.trigger&&d.valueNode&&v&&m&&C&&R&&M){const V=d.trigger.getBoundingClientRect(),B=m.getBoundingClientRect(),oe=d.valueNode.getBoundingClientRect(),se=M.getBoundingClientRect();if(d.dir!=="rtl"){const Re=se.left-B.left,je=oe.left-Re,et=V.left-je,Ge=V.width+et,kt=Math.max(Ge,B.width),ht=window.innerWidth-Rn,nt=ny(je,[Rn,Math.max(Rn,ht-kt)]);v.style.minWidth=Ge+"px",v.style.left=nt+"px"}else{const Re=B.right-se.right,je=window.innerWidth-oe.right-Re,et=window.innerWidth-V.right-je,Ge=V.width+et,kt=Math.max(Ge,B.width),ht=window.innerWidth-Rn,nt=ny(je,[Rn,Math.max(Rn,ht-kt)]);v.style.minWidth=Ge+"px",v.style.right=nt+"px"}const le=S(),ce=window.innerHeight-Rn*2,ue=C.scrollHeight,ve=window.getComputedStyle(m),de=parseInt(ve.borderTopWidth,10),N=parseInt(ve.paddingTop,10),F=parseInt(ve.borderBottomWidth,10),W=parseInt(ve.paddingBottom,10),ee=de+N+ue+W+F,$=Math.min(R.offsetHeight*5,ee),A=window.getComputedStyle(C),j=parseInt(A.paddingTop,10),L=parseInt(A.paddingBottom,10),Q=V.top+V.height/2-Rn,I=ce-Q,te=R.offsetHeight/2,Z=R.offsetTop+te,ae=de+N+Z,re=ee-ae;if(ae<=Q){const Re=le.length>0&&R===le[le.length-1].ref.current;v.style.bottom="0px";const je=m.clientHeight-C.offsetTop-C.offsetHeight,et=Math.max(I,te+(Re?L:0)+je+F),Ge=ae+et;v.style.height=Ge+"px"}else{const Re=le.length>0&&R===le[0].ref.current;v.style.top="0px";const et=Math.max(Q,de+C.offsetTop+(Re?j:0)+te)+re;v.style.height=et+"px",C.scrollTop=ae-Q+C.offsetTop}v.style.margin=`${Rn}px 0`,v.style.minHeight=$+"px",v.style.maxHeight=ce+"px",o?.(),requestAnimationFrame(()=>T.current=!0)}},[S,d.trigger,d.valueNode,v,m,C,R,M,d.dir,o]);yt(()=>D(),[D]);const[Y,K]=y.useState();yt(()=>{m&&K(window.getComputedStyle(m).zIndex)},[m]);const q=y.useCallback(V=>{V&&E.current===!0&&(D(),z?.(),E.current=!1)},[D,z]);return h.jsx(HR,{scope:i,contentWrapper:v,shouldExpandOnScrollRef:T,onScrollButtonChange:q,children:h.jsx("div",{ref:g,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:Y},children:h.jsx(Ce.div,{...c,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})});Rb.displayName=kR;var LR="SelectPopperPosition",mf=y.forwardRef((n,l)=>{const{__scopeSelect:i,align:o="start",collisionPadding:c=Rn,...d}=n,f=cc(i);return h.jsx(Wf,{...f,...d,ref:l,align:o,collisionPadding:c,style:{boxSizing:"border-box",...d.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});mf.displayName=LR;var[HR,sh]=Ol(Ia,{}),pf="SelectViewport",Mb=y.forwardRef((n,l)=>{const{__scopeSelect:i,nonce:o,...c}=n,d=Xa(pf,i),f=sh(pf,i),v=Ye(l,d.onViewportChange),g=y.useRef(0);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),h.jsx(oc.Slot,{scope:i,children:h.jsx(Ce.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:v,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:pe(c.onScroll,m=>{const x=m.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:S}=f;if(S?.current&&p){const T=Math.abs(g.current-x.scrollTop);if(T>0){const E=window.innerHeight-Rn*2,C=parseFloat(p.style.minHeight),R=parseFloat(p.style.height),M=Math.max(C,R);if(M 0?Y:0,p.style.justifyContent="flex-end")}}}g.current=x.scrollTop})})})]})});Mb.displayName=pf;var jb="SelectGroup",[UR,BR]=Ol(jb),qR=y.forwardRef((n,l)=>{const{__scopeSelect:i,...o}=n,c=Ot();return h.jsx(UR,{scope:i,id:c,children:h.jsx(Ce.div,{role:"group","aria-labelledby":c,...o,ref:l})})});qR.displayName=jb;var Ab="SelectLabel",GR=y.forwardRef((n,l)=>{const{__scopeSelect:i,...o}=n,c=BR(Ab,i);return h.jsx(Ce.div,{id:c.id,...o,ref:l})});GR.displayName=Ab;var Ps="SelectItem",[VR,Ob]=Ol(Ps),Nb=y.forwardRef((n,l)=>{const{__scopeSelect:i,value:o,disabled:c=!1,textValue:d,...f}=n,v=Fa(Ps,i),g=Xa(Ps,i),m=v.value===o,[x,p]=y.useState(d??""),[S,T]=y.useState(!1),E=xn(D=>g.itemRefCallback?.(D,o,c)),C=Ye(l,E),R=Ot(),M=y.useRef("touch"),z=()=>{c||(v.onValueChange(o),v.onOpenChange(!1))};return h.jsx(VR,{scope:i,value:o,disabled:c,textId:R,isSelected:m,onItemTextChange:y.useCallback(D=>{p(Y=>Y||(D?.textContent??"").trim())},[]),children:h.jsx(oc.ItemSlot,{scope:i,value:o,disabled:c,textValue:x,children:h.jsx(Ce.div,{role:"option","aria-labelledby":R,"data-highlighted":S?"":void 0,"aria-selected":m&&S,"data-state":m?"checked":"unchecked","aria-disabled":c||void 0,"data-disabled":c?"":void 0,tabIndex:c?void 0:-1,...f,ref:C,onFocus:pe(f.onFocus,()=>T(!0)),onBlur:pe(f.onBlur,()=>T(!1)),onClick:pe(f.onClick,()=>{M.current!=="mouse"&&z()}),onPointerUp:pe(f.onPointerUp,()=>{M.current==="mouse"&&z()}),onPointerDown:pe(f.onPointerDown,D=>{M.current=D.pointerType}),onPointerMove:pe(f.onPointerMove,D=>{M.current=D.pointerType,c?g.onItemLeave?.():M.current==="mouse"&&D.currentTarget.focus({preventScroll:!0})}),onPointerLeave:pe(f.onPointerLeave,D=>{D.currentTarget===document.activeElement&&g.onItemLeave?.()}),onKeyDown:pe(f.onKeyDown,D=>{c||D.target!==D.currentTarget||g.searchRef?.current!==""&&D.key===" "||(CR.includes(D.key)&&z(),D.key===" "&&D.preventDefault())})})})})});Nb.displayName=Ps;var Li="SelectItemText",_b=y.forwardRef((n,l)=>{const{__scopeSelect:i,className:o,style:c,...d}=n,f=Fa(Li,i),v=Xa(Li,i),g=Ob(Li,i),m=jR(Li,i),[x,p]=y.useState(null),S=xn(z=>v.itemTextRefCallback?.(z,g.value,g.disabled)),T=Ye(l,p,g.onItemTextChange,S),E=x?.textContent,C=y.useMemo(()=>h.jsx("option",{value:g.value,disabled:g.disabled,children:E},g.value),[g.disabled,g.value,E]),{onNativeOptionAdd:R,onNativeOptionRemove:M}=m;return yt(()=>(R(C),()=>M(C)),[R,M,C]),h.jsxs(h.Fragment,{children:[h.jsx(Ce.span,{id:g.textId,...d,ref:T}),g.isSelected&&f.valueNode&&!f.valueNodeHasChildren&&!uc(f.value)?zr.createPortal(d.children,f.valueNode):null]})});_b.displayName=Li;var Db="SelectItemIndicator",zb=y.forwardRef((n,l)=>{const{__scopeSelect:i,...o}=n;return Ob(Db,i).isSelected?h.jsx(Ce.span,{"aria-hidden":!0,...o,ref:l}):null});zb.displayName=Db;var vf="SelectScrollUpButton",kb=y.forwardRef((n,l)=>{const i=Xa(vf,n.__scopeSelect),o=sh(vf,n.__scopeSelect),[c,d]=y.useState(!1),f=Ye(l,o.onScrollButtonChange);return yt(()=>{if(i.viewport&&i.isPositioned){let v=function(){const m=g.scrollTop>0;d(m)};const g=i.viewport;return v(),g.addEventListener("scroll",v),()=>g.removeEventListener("scroll",v)}},[i.viewport,i.isPositioned]),c?h.jsx(Hb,{...n,ref:f,onAutoScroll:()=>{const{viewport:v,selectedItem:g}=i;v&&g&&(v.scrollTop=v.scrollTop-g.offsetHeight)}}):null});kb.displayName=vf;var gf="SelectScrollDownButton",Lb=y.forwardRef((n,l)=>{const i=Xa(gf,n.__scopeSelect),o=sh(gf,n.__scopeSelect),[c,d]=y.useState(!1),f=Ye(l,o.onScrollButtonChange);return yt(()=>{if(i.viewport&&i.isPositioned){let v=function(){const m=g.scrollHeight-g.clientHeight,x=Math.ceil(g.scrollTop) g.removeEventListener("scroll",v)}},[i.viewport,i.isPositioned]),c?h.jsx(Hb,{...n,ref:f,onAutoScroll:()=>{const{viewport:v,selectedItem:g}=i;v&&g&&(v.scrollTop=v.scrollTop+g.offsetHeight)}}):null});Lb.displayName=gf;var Hb=y.forwardRef((n,l)=>{const{__scopeSelect:i,onAutoScroll:o,...c}=n,d=Xa("SelectScrollButton",i),f=y.useRef(null),v=sc(i),g=y.useCallback(()=>{f.current!==null&&(window.clearInterval(f.current),f.current=null)},[]);return y.useEffect(()=>()=>g(),[g]),yt(()=>{v().find(x=>x.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[v]),h.jsx(Ce.div,{"aria-hidden":!0,...c,ref:l,style:{flexShrink:0,...c.style},onPointerDown:pe(c.onPointerDown,()=>{f.current===null&&(f.current=window.setInterval(o,50))}),onPointerMove:pe(c.onPointerMove,()=>{d.onItemLeave?.(),f.current===null&&(f.current=window.setInterval(o,50))}),onPointerLeave:pe(c.onPointerLeave,()=>{g()})})}),YR="SelectSeparator",IR=y.forwardRef((n,l)=>{const{__scopeSelect:i,...o}=n;return h.jsx(Ce.div,{"aria-hidden":!0,...o,ref:l})});IR.displayName=YR;var Ub="SelectArrow",QR=y.forwardRef((n,l)=>{const{__scopeSelect:i,...o}=n,c=cc(i);return Xa(Ub,i).position==="popper"?h.jsx(eh,{...c,...o,ref:l}):null});QR.displayName=Ub;var Bb="SelectBubbleInput",qb=y.forwardRef(({__scopeSelect:n,...l},i)=>{const o=Fa(Bb,n),{value:c,onValueChange:d,required:f,disabled:v,name:g,autoComplete:m,form:x}=o,{nativeOptions:p,nativeSelectKey:S}=o,T=y.useRef(null),E=Ye(i,T),C=c??"",R=jC(C),M=Array.from(p).some(z=>(z.props.value??"")==="");return y.useEffect(()=>{const z=T.current;if(!z)return;const D=window.HTMLSelectElement.prototype,K=Object.getOwnPropertyDescriptor(D,"value").set;if(R!==C&&K){const q=new Event("change",{bubbles:!0});K.call(z,C),z.dispatchEvent(q)}},[R,C]),h.jsxs(Ce.select,{"aria-hidden":!0,required:f,tabIndex:-1,name:g,autoComplete:m,disabled:v,form:x,onChange:z=>d(z.target.value),...l,style:{...Gy,...l.style},ref:E,defaultValue:C,children:[uc(c)&&!M?h.jsx("option",{value:""}):null,Array.from(p)]},S)});qb.displayName=Bb;function PR(n){return typeof n=="function"}function uc(n){return n===""||n===void 0}function Gb(n){const l=xn(n),i=y.useRef(""),o=y.useRef(0),c=y.useCallback(f=>{const v=i.current+f;l(v),(function g(m){i.current=m,window.clearTimeout(o.current),m!==""&&(o.current=window.setTimeout(()=>g(""),1e3))})(v)},[l]),d=y.useCallback(()=>{i.current="",window.clearTimeout(o.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(o.current),[]),[i,c,d]}function Vb(n,l,i){const c=l.length>1&&Array.from(l).every(m=>m===l[0])?l[0]:l,d=i?n.indexOf(i):-1;let f=KR(n,Math.max(d,0));c.length===1&&(f=f.filter(m=>m!==i));const g=f.find(m=>m.textValue.toLowerCase().startsWith(c.toLowerCase()));return g!==i?g:void 0}function KR(n,l){return n.map((i,o)=>n[(l+o)%n.length])}var[dc]=Pa("Tooltip",[Hr]),fc=Hr(),Yb="TooltipProvider",FR=700,yf="tooltip.open",[XR,ch]=dc(Yb),Ib=n=>{const{__scopeTooltip:l,delayDuration:i=FR,skipDelayDuration:o=300,disableHoverableContent:c=!1,children:d}=n,f=y.useRef(!0),v=y.useRef(!1),g=y.useRef(0);return y.useEffect(()=>{const m=g.current;return()=>window.clearTimeout(m)},[]),h.jsx(XR,{scope:l,isOpenDelayedRef:f,delayDuration:i,onOpen:y.useCallback(()=>{o<=0||(window.clearTimeout(g.current),f.current=!1)},[o]),onClose:y.useCallback(()=>{o<=0||(window.clearTimeout(g.current),g.current=window.setTimeout(()=>f.current=!0,o))},[o]),isPointerInTransitRef:v,onPointerInTransitChange:y.useCallback(m=>{v.current=m},[]),disableHoverableContent:c,children:d})};Ib.displayName=Yb;var Qi="Tooltip",[ZR,ao]=dc(Qi),Qb=n=>{const{__scopeTooltip:l,children:i,open:o,defaultOpen:c,onOpenChange:d,disableHoverableContent:f,delayDuration:v}=n,g=ch(Qi,n.__scopeTooltip),m=fc(l),[x,p]=y.useState(null),S=Ot(),T=y.useRef(0),E=f??g.disableHoverableContent,C=v??g.delayDuration,R=y.useRef(!1),[M,z]=Nr({prop:o,defaultProp:c??!1,onChange:V=>{V?(g.onOpen(),document.dispatchEvent(new CustomEvent(yf))):g.onClose(),d?.(V)},caller:Qi}),D=y.useMemo(()=>M?R.current?"delayed-open":"instant-open":"closed",[M]),Y=y.useCallback(()=>{window.clearTimeout(T.current),T.current=0,R.current=!1,z(!0)},[z]),K=y.useCallback(()=>{window.clearTimeout(T.current),T.current=0,z(!1)},[z]),q=y.useCallback(()=>{window.clearTimeout(T.current),T.current=window.setTimeout(()=>{R.current=!0,z(!0),T.current=0},C)},[C,z]);return y.useEffect(()=>()=>{T.current&&(window.clearTimeout(T.current),T.current=0)},[]),h.jsx($f,{...m,children:h.jsx(ZR,{scope:l,contentId:S,open:M,stateAttribute:D,trigger:x,onTriggerChange:p,onTriggerEnter:y.useCallback(()=>{g.isOpenDelayedRef.current?q():Y()},[g.isOpenDelayedRef,q,Y]),onTriggerLeave:y.useCallback(()=>{E?K():(window.clearTimeout(T.current),T.current=0)},[K,E]),onOpen:Y,onClose:K,disableHoverableContent:E,children:i})})};Qb.displayName=Qi;var bf="TooltipTrigger",Pb=y.forwardRef((n,l)=>{const{__scopeTooltip:i,...o}=n,c=ao(bf,i),d=ch(bf,i),f=fc(i),v=y.useRef(null),g=Ye(l,v,c.onTriggerChange),m=y.useRef(!1),x=y.useRef(!1),p=y.useCallback(()=>m.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),h.jsx(Jf,{asChild:!0,...f,children:h.jsx(Ce.button,{"aria-describedby":c.open?c.contentId:void 0,"data-state":c.stateAttribute,...o,ref:g,onPointerMove:pe(n.onPointerMove,S=>{S.pointerType!=="touch"&&!x.current&&!d.isPointerInTransitRef.current&&(c.onTriggerEnter(),x.current=!0)}),onPointerLeave:pe(n.onPointerLeave,()=>{c.onTriggerLeave(),x.current=!1}),onPointerDown:pe(n.onPointerDown,()=>{c.open&&c.onClose(),m.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:pe(n.onFocus,()=>{m.current||c.onOpen()}),onBlur:pe(n.onBlur,c.onClose),onClick:pe(n.onClick,c.onClose)})})});Pb.displayName=bf;var uh="TooltipPortal",[$R,JR]=dc(uh,{forceMount:void 0}),Kb=n=>{const{__scopeTooltip:l,forceMount:i,children:o,container:c}=n,d=ao(uh,l);return h.jsx($R,{scope:l,forceMount:i,children:h.jsx(jn,{present:i||d.open,children:h.jsx(Wi,{asChild:!0,container:c,children:o})})})};Kb.displayName=uh;var Dr="TooltipContent",Fb=y.forwardRef((n,l)=>{const i=JR(Dr,n.__scopeTooltip),{forceMount:o=i.forceMount,side:c="top",...d}=n,f=ao(Dr,n.__scopeTooltip);return h.jsx(jn,{present:o||f.open,children:f.disableHoverableContent?h.jsx(Xb,{side:c,...d,ref:l}):h.jsx(WR,{side:c,...d,ref:l})})}),WR=y.forwardRef((n,l)=>{const i=ao(Dr,n.__scopeTooltip),o=ch(Dr,n.__scopeTooltip),c=y.useRef(null),d=Ye(l,c),[f,v]=y.useState(null),{trigger:g,onClose:m}=i,x=c.current,{onPointerInTransitChange:p}=o,S=y.useCallback(()=>{v(null),p(!1)},[p]),T=y.useCallback((E,C)=>{const R=E.currentTarget,M={x:E.clientX,y:E.clientY},z=aM(M,R.getBoundingClientRect()),D=lM(M,z),Y=rM(C.getBoundingClientRect()),K=oM([...D,...Y]);v(K),p(!0)},[p]);return y.useEffect(()=>()=>S(),[S]),y.useEffect(()=>{if(g&&x){const E=R=>T(R,x),C=R=>T(R,g);return g.addEventListener("pointerleave",E),x.addEventListener("pointerleave",C),()=>{g.removeEventListener("pointerleave",E),x.removeEventListener("pointerleave",C)}}},[g,x,T,S]),y.useEffect(()=>{if(f){const E=C=>{const R=C.target,M={x:C.clientX,y:C.clientY},z=g?.contains(R)||x?.contains(R),D=!iM(M,f);z?S():D&&(S(),m())};return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[g,x,f,m,S]),h.jsx(Xb,{...n,ref:d})}),[eM,tM]=dc(Qi,{isInside:!1}),nM=Xw("TooltipContent"),Xb=y.forwardRef((n,l)=>{const{__scopeTooltip:i,children:o,"aria-label":c,onEscapeKeyDown:d,onPointerDownOutside:f,...v}=n,g=ao(Dr,i),m=fc(i),{onClose:x}=g;return y.useEffect(()=>(document.addEventListener(yf,x),()=>document.removeEventListener(yf,x)),[x]),y.useEffect(()=>{if(g.trigger){const p=S=>{S.target instanceof Node&&S.target.contains(g.trigger)&&x()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[g.trigger,x]),h.jsx(Ji,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p=>p.preventDefault(),onDismiss:x,children:h.jsxs(Wf,{"data-state":g.stateAttribute,...m,...v,ref:l,style:{...v.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(nM,{children:o}),h.jsx(eM,{scope:i,isInside:!0,children:h.jsx(iE,{id:g.contentId,role:"tooltip",children:c||o})})]})})});Fb.displayName=Dr;var Zb="TooltipArrow",$b=y.forwardRef((n,l)=>{const{__scopeTooltip:i,...o}=n,c=fc(i);return tM(Zb,i).isInside?null:h.jsx(eh,{...c,...o,ref:l})});$b.displayName=Zb;function aM(n,l){const i=Math.abs(l.top-n.y),o=Math.abs(l.bottom-n.y),c=Math.abs(l.right-n.x),d=Math.abs(l.left-n.x);switch(Math.min(i,o,c,d)){case d:return"left";case c:return"right";case i:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function lM(n,l,i=5){const o=[];switch(l){case"top":o.push({x:n.x-i,y:n.y+i},{x:n.x+i,y:n.y+i});break;case"bottom":o.push({x:n.x-i,y:n.y-i},{x:n.x+i,y:n.y-i});break;case"left":o.push({x:n.x+i,y:n.y-i},{x:n.x+i,y:n.y+i});break;case"right":o.push({x:n.x-i,y:n.y-i},{x:n.x-i,y:n.y+i});break}return o}function rM(n){const{top:l,right:i,bottom:o,left:c}=n;return[{x:c,y:l},{x:i,y:l},{x:i,y:o},{x:c,y:o}]}function iM(n,l){const{x:i,y:o}=n;let c=!1;for(let d=0,f=l.length-1;d o!=S>o&&i<(p-m)*(o-x)/(S-x)+m&&(c=!c)}return c}function oM(n){const l=n.slice();return l.sort((i,o)=>i.x o.x?1:i.y o.y?1:0),sM(l)}function sM(n){if(n.length<=1)return n.slice();const l=[];for(let o=0;o =2;){const d=l[l.length-1],f=l[l.length-2];if((d.x-f.x)*(c.y-f.y)>=(d.y-f.y)*(c.x-f.x))l.pop();else break}l.push(c)}l.pop();const i=[];for(let o=n.length-1;o>=0;o--){const c=n[o];for(;i.length>=2;){const d=i[i.length-1],f=i[i.length-2];if((d.x-f.x)*(c.y-f.y)>=(d.y-f.y)*(c.x-f.x))i.pop();else break}i.push(c)}return i.pop(),l.length===1&&i.length===1&&l[0].x===i[0].x&&l[0].y===i[0].y?l:l.concat(i)}var cM=Ib,uM=Qb,dM=Pb,fM=Kb,hM=Fb,mM=$b;function Jb(n){var l,i,o="";if(typeof n=="string"||typeof n=="number")o+=n;else if(typeof n=="object")if(Array.isArray(n)){var c=n.length;for(l=0;l {const i=new Array(n.length+l.length);for(let o=0;o ({classGroupId:n,validator:l}),ex=(n=new Map,l=null,i)=>({nextPart:n,validators:l,classGroupId:i}),Ks="-",ay=[],gM="arbitrary..",yM=n=>{const l=xM(n),{conflictingClassGroups:i,conflictingClassGroupModifiers:o}=n;return{getClassGroupId:f=>{if(f.startsWith("[")&&f.endsWith("]"))return bM(f);const v=f.split(Ks),g=v[0]===""&&v.length>1?1:0;return tx(v,g,l)},getConflictingClassGroupIds:(f,v)=>{if(v){const g=o[f],m=i[f];return g?m?pM(m,g):g:m||ay}return i[f]||ay}}},tx=(n,l,i)=>{if(n.length-l===0)return i.classGroupId;const c=n[l],d=i.nextPart.get(c);if(d){const m=tx(n,l+1,d);if(m)return m}const f=i.validators;if(f===null)return;const v=l===0?n.join(Ks):n.slice(l).join(Ks),g=f.length;for(let m=0;m n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const l=n.slice(1,-1),i=l.indexOf(":"),o=l.slice(0,i);return o?gM+o:void 0})(),xM=n=>{const{theme:l,classGroups:i}=n;return SM(i,l)},SM=(n,l)=>{const i=ex();for(const o in n){const c=n[o];dh(c,i,o,l)}return i},dh=(n,l,i,o)=>{const c=n.length;for(let d=0;d {if(typeof n=="string"){EM(n,l,i);return}if(typeof n=="function"){CM(n,l,i,o);return}TM(n,l,i,o)},EM=(n,l,i)=>{const o=n===""?l:nx(l,n);o.classGroupId=i},CM=(n,l,i,o)=>{if(RM(n)){dh(n(o),l,i,o);return}l.validators===null&&(l.validators=[]),l.validators.push(vM(i,n))},TM=(n,l,i,o)=>{const c=Object.entries(n),d=c.length;for(let f=0;f {let i=n;const o=l.split(Ks),c=o.length;for(let d=0;d "isThemeGetter"in n&&n.isThemeGetter===!0,MM=n=>{if(n<1)return{get:()=>{},set:()=>{}};let l=0,i=Object.create(null),o=Object.create(null);const c=(d,f)=>{i[d]=f,l++,l>n&&(l=0,o=i,i=Object.create(null))};return{get(d){let f=i[d];if(f!==void 0)return f;if((f=o[d])!==void 0)return c(d,f),f},set(d,f){d in i?i[d]=f:c(d,f)}}},xf="!",ly=":",jM=[],ry=(n,l,i,o,c)=>({modifiers:n,hasImportantModifier:l,baseClassName:i,maybePostfixModifierPosition:o,isExternal:c}),AM=n=>{const{prefix:l,experimentalParseClassName:i}=n;let o=c=>{const d=[];let f=0,v=0,g=0,m;const x=c.length;for(let C=0;C g?m-g:void 0;return ry(d,T,S,E)};if(l){const c=l+ly,d=o;o=f=>f.startsWith(c)?d(f.slice(c.length)):ry(jM,!1,f,void 0,!0)}if(i){const c=o;o=d=>i({className:d,parseClassName:c})}return o},OM=n=>{const l=new Map;return n.orderSensitiveModifiers.forEach((i,o)=>{l.set(i,1e6+o)}),i=>{const o=[];let c=[];for(let d=0;d 0&&(c.sort(),o.push(...c),c=[]),o.push(f)):c.push(f)}return c.length>0&&(c.sort(),o.push(...c)),o}},NM=n=>({cache:MM(n.cacheSize),parseClassName:AM(n),sortModifiers:OM(n),postfixLookupClassGroupIds:_M(n),...yM(n)}),_M=n=>{const l=Object.create(null),i=n.postfixLookupClassGroups;if(i)for(let o=0;o {const{parseClassName:i,getClassGroupId:o,getConflictingClassGroupIds:c,sortModifiers:d,postfixLookupClassGroupIds:f}=l,v=[],g=n.trim().split(DM);let m="";for(let x=g.length-1;x>=0;x-=1){const p=g[x],{isExternal:S,modifiers:T,hasImportantModifier:E,baseClassName:C,maybePostfixModifierPosition:R}=i(p);if(S){m=p+(m.length>0?" "+m:m);continue}let M=!!R,z;if(M){const V=C.substring(0,R);z=o(V);const B=z&&f[z]?o(C):void 0;B&&B!==z&&(z=B,M=!1)}else z=o(C);if(!z){if(!M){m=p+(m.length>0?" "+m:m);continue}if(z=o(C),!z){m=p+(m.length>0?" "+m:m);continue}M=!1}const D=T.length===0?"":T.length===1?T[0]:d(T).join(":"),Y=E?D+xf:D,K=Y+z;if(v.indexOf(K)>-1)continue;v.push(K);const q=c(z,M);for(let V=0;V 0?" "+m:m)}return m},kM=(...n)=>{let l=0,i,o,c="";for(;l {if(typeof n=="string")return n;let l,i="";for(let o=0;o {let i,o,c,d;const f=g=>{const m=l.reduce((x,p)=>p(x),n());return i=NM(m),o=i.cache.get,c=i.cache.set,d=v,v(g)},v=g=>{const m=o(g);if(m)return m;const x=zM(g,i);return c(g,x),x};return d=f,(...g)=>d(kM(...g))},HM=[],ft=n=>{const l=i=>i[n]||HM;return l.isThemeGetter=!0,l},lx=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,rx=/^\((?:(\w[\w-]*):)?(.+)\)$/i,UM=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,BM=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qM=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,GM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,VM=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,YM=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ua=n=>UM.test(n),Oe=n=>!!n&&!Number.isNaN(Number(n)),Ln=n=>!!n&&Number.isInteger(Number(n)),Qd=n=>n.endsWith("%")&&Oe(n.slice(0,-1)),oa=n=>BM.test(n),ix=()=>!0,IM=n=>qM.test(n)&&!GM.test(n),fh=()=>!1,QM=n=>VM.test(n),PM=n=>YM.test(n),KM=n=>!fe(n)&&!he(n),FM=n=>n.startsWith("@container")&&(n[10]==="/"&&n[11]!==void 0||n[11]==="s"&&n[16]!==void 0&&n.startsWith("-size/",10)||n[11]==="n"&&n[18]!==void 0&&n.startsWith("-normal/",10)),XM=n=>Za(n,cx,fh),fe=n=>lx.test(n),Sl=n=>Za(n,ux,IM),iy=n=>Za(n,aj,Oe),ZM=n=>Za(n,fx,ix),$M=n=>Za(n,dx,fh),oy=n=>Za(n,ox,fh),JM=n=>Za(n,sx,PM),As=n=>Za(n,hx,QM),he=n=>rx.test(n),Di=n=>Nl(n,ux),WM=n=>Nl(n,dx),sy=n=>Nl(n,ox),ej=n=>Nl(n,cx),tj=n=>Nl(n,sx),Os=n=>Nl(n,hx,!0),nj=n=>Nl(n,fx,!0),Za=(n,l,i)=>{const o=lx.exec(n);return o?o[1]?l(o[1]):i(o[2]):!1},Nl=(n,l,i=!1)=>{const o=rx.exec(n);return o?o[1]?l(o[1]):i:!1},ox=n=>n==="position"||n==="percentage",sx=n=>n==="image"||n==="url",cx=n=>n==="length"||n==="size"||n==="bg-size",ux=n=>n==="length",aj=n=>n==="number",dx=n=>n==="family-name",fx=n=>n==="number"||n==="weight",hx=n=>n==="shadow",lj=()=>{const n=ft("color"),l=ft("font"),i=ft("text"),o=ft("font-weight"),c=ft("tracking"),d=ft("leading"),f=ft("breakpoint"),v=ft("container"),g=ft("spacing"),m=ft("radius"),x=ft("shadow"),p=ft("inset-shadow"),S=ft("text-shadow"),T=ft("drop-shadow"),E=ft("blur"),C=ft("perspective"),R=ft("aspect"),M=ft("ease"),z=ft("animate"),D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],K=()=>[...Y(),he,fe],q=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto","contain","none"],B=()=>[he,fe,g],oe=()=>[Ua,"full","auto",...B()],se=()=>[Ln,"none","subgrid",he,fe],le=()=>["auto",{span:["full",Ln,he,fe]},Ln,he,fe],ce=()=>[Ln,"auto",he,fe],ue=()=>["auto","min","max","fr",he,fe],ve=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],de=()=>["start","end","center","stretch","center-safe","end-safe"],N=()=>["auto",...B()],F=()=>[Ua,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...B()],W=()=>[Ua,"screen","full","dvw","lvw","svw","min","max","fit",...B()],ee=()=>[Ua,"screen","full","lh","dvh","lvh","svh","min","max","fit",...B()],$=()=>[n,he,fe],A=()=>[...Y(),sy,oy,{position:[he,fe]}],j=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",ej,XM,{size:[he,fe]}],Q=()=>[Qd,Di,Sl],I=()=>["","none","full",m,he,fe],te=()=>["",Oe,Di,Sl],Z=()=>["solid","dashed","dotted","double"],ae=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[Oe,Qd,sy,oy],xe=()=>["","none",E,he,fe],Re=()=>["none",Oe,he,fe],je=()=>["none",Oe,he,fe],et=()=>[Oe,he,fe],Ge=()=>[Ua,"full",...B()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[oa],breakpoint:[oa],color:[ix],container:[oa],"drop-shadow":[oa],ease:["in","out","in-out"],font:[KM],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[oa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[oa],shadow:[oa],spacing:["px",Oe],text:[oa],"text-shadow":[oa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ua,fe,he,R]}],container:["container"],"container-type":[{"@container":["","normal","size",he,fe]}],"container-named":[FM],columns:[{columns:[Oe,fe,he,v]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:K()}],overflow:[{overflow:q()}],"overflow-x":[{"overflow-x":q()}],"overflow-y":[{"overflow-y":q()}],overscroll:[{overscroll:V()}],"overscroll-x":[{"overscroll-x":V()}],"overscroll-y":[{"overscroll-y":V()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:oe()}],"inset-x":[{"inset-x":oe()}],"inset-y":[{"inset-y":oe()}],start:[{"inset-s":oe(),start:oe()}],end:[{"inset-e":oe(),end:oe()}],"inset-bs":[{"inset-bs":oe()}],"inset-be":[{"inset-be":oe()}],top:[{top:oe()}],right:[{right:oe()}],bottom:[{bottom:oe()}],left:[{left:oe()}],visibility:["visible","invisible","collapse"],z:[{z:[Ln,"auto",he,fe]}],basis:[{basis:[Ua,"full","auto",v,...B()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Oe,Ua,"auto","initial","none",fe]}],grow:[{grow:["",Oe,he,fe]}],shrink:[{shrink:["",Oe,he,fe]}],order:[{order:[Ln,"first","last","none",he,fe]}],"grid-cols":[{"grid-cols":se()}],"col-start-end":[{col:le()}],"col-start":[{"col-start":ce()}],"col-end":[{"col-end":ce()}],"grid-rows":[{"grid-rows":se()}],"row-start-end":[{row:le()}],"row-start":[{"row-start":ce()}],"row-end":[{"row-end":ce()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ue()}],"auto-rows":[{"auto-rows":ue()}],gap:[{gap:B()}],"gap-x":[{"gap-x":B()}],"gap-y":[{"gap-y":B()}],"justify-content":[{justify:[...ve(),"normal"]}],"justify-items":[{"justify-items":[...de(),"normal"]}],"justify-self":[{"justify-self":["auto",...de()]}],"align-content":[{content:["normal",...ve()]}],"align-items":[{items:[...de(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...de(),{baseline:["","last"]}]}],"place-content":[{"place-content":ve()}],"place-items":[{"place-items":[...de(),"baseline"]}],"place-self":[{"place-self":["auto",...de()]}],p:[{p:B()}],px:[{px:B()}],py:[{py:B()}],ps:[{ps:B()}],pe:[{pe:B()}],pbs:[{pbs:B()}],pbe:[{pbe:B()}],pt:[{pt:B()}],pr:[{pr:B()}],pb:[{pb:B()}],pl:[{pl:B()}],m:[{m:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mbs:[{mbs:N()}],mbe:[{mbe:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"space-x":[{"space-x":B()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":B()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],"inline-size":[{inline:["auto",...W()]}],"min-inline-size":[{"min-inline":["auto",...W()]}],"max-inline-size":[{"max-inline":["none",...W()]}],"block-size":[{block:["auto",...ee()]}],"min-block-size":[{"min-block":["auto",...ee()]}],"max-block-size":[{"max-block":["none",...ee()]}],w:[{w:[v,"screen",...F()]}],"min-w":[{"min-w":[v,"screen","none",...F()]}],"max-w":[{"max-w":[v,"screen","none","prose",{screen:[f]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh",...F()]}],"font-size":[{text:["base",i,Di,Sl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,nj,ZM]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Qd,fe]}],"font-family":[{font:[WM,$M,l]}],"font-features":[{"font-features":[fe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[c,he,fe]}],"line-clamp":[{"line-clamp":[Oe,"none",he,iy]}],leading:[{leading:[d,...B()]}],"list-image":[{"list-image":["none",he,fe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",he,fe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:[Oe,"from-font","auto",he,Sl]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[Oe,"auto",he,fe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"tab-size":[{tab:[Ln,he,fe]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he,fe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",he,fe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:A()}],"bg-repeat":[{bg:j()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ln,he,fe],radial:["",he,fe],conic:[Ln,he,fe]},tj,JM]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:I()}],"rounded-s":[{"rounded-s":I()}],"rounded-e":[{"rounded-e":I()}],"rounded-t":[{"rounded-t":I()}],"rounded-r":[{"rounded-r":I()}],"rounded-b":[{"rounded-b":I()}],"rounded-l":[{"rounded-l":I()}],"rounded-ss":[{"rounded-ss":I()}],"rounded-se":[{"rounded-se":I()}],"rounded-ee":[{"rounded-ee":I()}],"rounded-es":[{"rounded-es":I()}],"rounded-tl":[{"rounded-tl":I()}],"rounded-tr":[{"rounded-tr":I()}],"rounded-br":[{"rounded-br":I()}],"rounded-bl":[{"rounded-bl":I()}],"border-w":[{border:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-bs":[{"border-bs":te()}],"border-w-be":[{"border-be":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Z(),"hidden","none"]}],"divide-style":[{divide:[...Z(),"hidden","none"]}],"border-color":[{border:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-bs":[{"border-bs":$()}],"border-color-be":[{"border-be":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...Z(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Oe,he,fe]}],"outline-w":[{outline:["",Oe,Di,Sl]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",x,Os,As]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",p,Os,As]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[Oe,Sl]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",S,Os,As]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[Oe,he,fe]}],"mix-blend":[{"mix-blend":[...ae(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ae()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[he,fe]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":$()}],"mask-image-radial-to-color":[{"mask-radial-to":$()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":Y()}],"mask-image-conic-pos":[{"mask-conic":[Oe]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":$()}],"mask-image-conic-to-color":[{"mask-conic-to":$()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:A()}],"mask-repeat":[{mask:j()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",he,fe]}],filter:[{filter:["","none",he,fe]}],blur:[{blur:xe()}],brightness:[{brightness:[Oe,he,fe]}],contrast:[{contrast:[Oe,he,fe]}],"drop-shadow":[{"drop-shadow":["","none",T,Os,As]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",Oe,he,fe]}],"hue-rotate":[{"hue-rotate":[Oe,he,fe]}],invert:[{invert:["",Oe,he,fe]}],saturate:[{saturate:[Oe,he,fe]}],sepia:[{sepia:["",Oe,he,fe]}],"backdrop-filter":[{"backdrop-filter":["","none",he,fe]}],"backdrop-blur":[{"backdrop-blur":xe()}],"backdrop-brightness":[{"backdrop-brightness":[Oe,he,fe]}],"backdrop-contrast":[{"backdrop-contrast":[Oe,he,fe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Oe,he,fe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Oe,he,fe]}],"backdrop-invert":[{"backdrop-invert":["",Oe,he,fe]}],"backdrop-opacity":[{"backdrop-opacity":[Oe,he,fe]}],"backdrop-saturate":[{"backdrop-saturate":[Oe,he,fe]}],"backdrop-sepia":[{"backdrop-sepia":["",Oe,he,fe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":B()}],"border-spacing-x":[{"border-spacing-x":B()}],"border-spacing-y":[{"border-spacing-y":B()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",he,fe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Oe,"initial",he,fe]}],ease:[{ease:["linear","initial",M,he,fe]}],delay:[{delay:[Oe,he,fe]}],animate:[{animate:["none",z,he,fe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,he,fe]}],"perspective-origin":[{"perspective-origin":K()}],rotate:[{rotate:Re()}],"rotate-x":[{"rotate-x":Re()}],"rotate-y":[{"rotate-y":Re()}],"rotate-z":[{"rotate-z":Re()}],scale:[{scale:je()}],"scale-x":[{"scale-x":je()}],"scale-y":[{"scale-y":je()}],"scale-z":[{"scale-z":je()}],"scale-3d":["scale-3d"],skew:[{skew:et()}],"skew-x":[{"skew-x":et()}],"skew-y":[{"skew-y":et()}],transform:[{transform:[he,fe,"","none","gpu","cpu"]}],"transform-origin":[{origin:K()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ge()}],"translate-x":[{"translate-x":Ge()}],"translate-y":[{"translate-y":Ge()}],"translate-z":[{"translate-z":Ge()}],"translate-none":["translate-none"],zoom:[{zoom:[Ln,he,fe]}],accent:[{accent:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",he,fe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":$()}],"scrollbar-track-color":[{"scrollbar-track":$()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mbs":[{"scroll-mbs":B()}],"scroll-mbe":[{"scroll-mbe":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pbs":[{"scroll-pbs":B()}],"scroll-pbe":[{"scroll-pbe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",he,fe]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[Oe,Di,Sl,iy]}],stroke:[{stroke:["none",...$()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},rj=LM(lj);function bt(...n){return rj(Wb(n))}function ij({delayDuration:n=0,...l}){return h.jsx(cM,{"data-slot":"tooltip-provider",delayDuration:n,...l})}function oj({...n}){return h.jsx(uM,{"data-slot":"tooltip",...n})}function sj({...n}){return h.jsx(dM,{"data-slot":"tooltip-trigger",...n})}function cj({className:n,sideOffset:l=0,children:i,...o}){return h.jsx(fM,{children:h.jsxs(hM,{"data-slot":"tooltip-content",sideOffset:l,className:bt("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-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-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",n),...o,children:[i,h.jsx(mM,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}const Sf=new Set;function uj(n){return Sf.add(n),()=>Sf.delete(n)}function dj(){for(const n of Sf)n()}const mx=(...n)=>n.filter((l,i,o)=>!!l&&l.trim()!==""&&o.indexOf(l)===i).join(" ").trim();const fj=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const hj=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(l,i,o)=>o?o.toUpperCase():i.toLowerCase());const cy=n=>{const l=hj(n);return l.charAt(0).toUpperCase()+l.slice(1)};var Pd={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const mj=n=>{for(const l in n)if(l.startsWith("aria-")||l==="role"||l==="title")return!0;return!1},pj=y.createContext({}),vj=()=>y.useContext(pj),gj=y.forwardRef(({color:n,size:l,strokeWidth:i,absoluteStrokeWidth:o,className:c="",children:d,iconNode:f,...v},g)=>{const{size:m=24,strokeWidth:x=2,absoluteStrokeWidth:p=!1,color:S="currentColor",className:T=""}=vj()??{},E=o??p?Number(i??x)*24/Number(l??m):i??x;return y.createElement("svg",{ref:g,...Pd,width:l??m??Pd.width,height:l??m??Pd.height,stroke:n??S,strokeWidth:E,className:mx("lucide",T,c),...!d&&!mj(v)&&{"aria-hidden":"true"},...v},[...f.map(([C,R])=>y.createElement(C,R)),...Array.isArray(d)?d:[d]])});const qe=(n,l)=>{const i=y.forwardRef(({className:o,...c},d)=>y.createElement(gj,{ref:d,iconNode:l,className:mx(`lucide-${fj(cy(n))}`,`lucide-${n}`,o),...c}));return i.displayName=cy(n),i};const yj=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],px=qe("check",yj);const bj=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],hh=qe("chevron-down",bj);const xj=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Sj=qe("chevron-right",xj);const wj=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Ej=qe("chevron-up",wj);const Cj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Tj=qe("circle-check",Cj);const Rj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Mj=qe("clock",Rj);const jj=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Aj=qe("copy",jj);const Oj=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Nj=qe("download",Oj);const _j=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Dj=qe("ellipsis",_j);const zj=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],kj=qe("file-text",zj);const Lj=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Hj=qe("folder",Lj);const Uj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Bj=qe("globe",Uj);const qj=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Gj=qe("history",qj);const Vj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Yj=qe("info",Vj);const Ij=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],Qj=qe("layout-dashboard",Ij);const Pj=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],Kj=qe("link",Pj);const Fj=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Xj=qe("loader-circle",Fj);const Zj=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],$j=qe("lock",Zj);const Jj=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Wj=qe("log-out",Jj);const eA=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],tA=qe("menu",eA);const nA=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aA=qe("octagon-x",nA);const lA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],rA=qe("plus",lA);const iA=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],vx=qe("search",iA);const oA=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],sA=qe("settings",oA);const cA=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],uA=qe("share-2",cA);const dA=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],fA=qe("shield",dA);const hA=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],mA=qe("square-terminal",hA);const pA=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],vA=qe("trash-2",pA);const gA=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],gx=qe("triangle-alert",gA);const yA=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],bA=qe("upload",yA);const xA=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],SA=qe("users",xA);const wA=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],yx=qe("x",wA);function EA(){document.body.classList.toggle("sb-open")}function Mn(){document.body.classList.remove("sb-open")}const CA={alert:gx,check:px,chev:Sj,chevd:hh,clock:Mj,copy:Aj,doc:kj,dots:Dj,download:Nj,folder:Hj,dashboard:Qj,gear:sA,globe:Bj,hist:Gj,link:Kj,lock:$j,menu:tA,plus:rA,power:Wj,search:vx,share:uA,shield:fA,terminal:mA,trash:vA,upload:bA,users:SA,x:yx};function gt({name:n}){const l=CA[n];return l?h.jsx(l,{className:"ico","aria-hidden":"true"}):null}function Pi(n){return h.jsxs(h.Fragment,{children:[h.jsx("div",{id:"sb-backdrop",onClick:Mn}),h.jsxs("aside",{id:"sidebar",children:[n.vault,n.projectsNav,n.tree??h.jsx("nav",{id:"tree","aria-label":"Files"}),n.orgBar]}),h.jsxs("main",{id:"main",children:[n.topbar,h.jsx("article",{id:"content",className:n.contentClass??"markdown",ref:n.contentRef,onScroll:n.onContentScroll,children:n.children})]})]})}function hc(n){const{name:l,onHome:i,showSignout:o,search:c}=n;return h.jsxs("header",{id:"vault",children:[h.jsx("span",{id:"vault-badge","aria-hidden":"true",children:"🐻"}),h.jsx("span",{id:"vault-name",className:i?"vault-link":void 0,onClick:i,role:i?"button":void 0,tabIndex:i?0:void 0,onKeyDown:d=>{i&&(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),i())},children:l}),h.jsxs("div",{className:"vault-actions",children:[c&&h.jsxs(oj,{delayDuration:150,children:[h.jsx(sj,{asChild:!0,children:h.jsx("button",{id:"search-btn",className:"icon-btn2","aria-label":"Search",onClick:()=>{dj(),Mn()},children:h.jsx(gt,{name:"search"})})}),h.jsxs(cj,{className:"tipcard",sideOffset:6,children:["Search ",h.jsx("kbd",{children:"⌘K"})]})]}),o&&h.jsx("a",{id:"signout",href:"/auth/logout",title:"Sign out","aria-label":"Sign out",children:h.jsx(gt,{name:"power"})})]})]})}function Ki(n){return h.jsxs("header",{id:"topbar",children:[h.jsx("button",{id:"menu-btn",className:"icon-btn",title:"Menu","aria-label":"Menu",onClick:EA,children:h.jsx(gt,{name:"menu"})}),h.jsx("span",{id:"crumb",children:n.crumb}),h.jsx("span",{id:"meta",children:n.meta}),n.actions]})}function TA(n){if(typeof document>"u")return;let l=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",l.appendChild(i),i.styleSheet?i.styleSheet.cssText=n:i.appendChild(document.createTextNode(n))}const RA=n=>{switch(n){case"success":return AA;case"info":return NA;case"warning":return OA;case"error":return _A;default:return null}},MA=Array(12).fill(0),jA=({visible:n,className:l})=>ie.createElement("div",{className:["sonner-loading-wrapper",l].filter(Boolean).join(" "),"data-visible":n},ie.createElement("div",{className:"sonner-spinner"},MA.map((i,o)=>ie.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),AA=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ie.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),OA=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ie.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),NA=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ie.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),_A=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ie.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),DA=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ie.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ie.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),zA=()=>{const[n,l]=ie.useState(document.hidden);return ie.useEffect(()=>{const i=()=>{l(document.hidden)};return document.addEventListener("visibilitychange",i),()=>window.removeEventListener("visibilitychange",i)},[]),n};let wf=1;class kA{constructor(){this.subscribe=l=>(this.subscribers.push(l),()=>{const i=this.subscribers.indexOf(l);this.subscribers.splice(i,1)}),this.publish=l=>{this.subscribers.forEach(i=>i(l))},this.addToast=l=>{this.publish(l),this.toasts=[...this.toasts,l]},this.create=l=>{var i;const{message:o,...c}=l,d=typeof l?.id=="number"||((i=l.id)==null?void 0:i.length)>0?l.id:wf++,f=this.toasts.find(g=>g.id===d),v=l.dismissible===void 0?!0:l.dismissible;return this.dismissedToasts.has(d)&&this.dismissedToasts.delete(d),f?this.toasts=this.toasts.map(g=>g.id===d?(this.publish({...g,...l,id:d,title:o}),{...g,...l,id:d,dismissible:v,title:o}):g):this.addToast({title:o,...c,dismissible:v,id:d}),d},this.dismiss=l=>(l?(this.dismissedToasts.add(l),requestAnimationFrame(()=>this.subscribers.forEach(i=>i({id:l,dismiss:!0})))):this.toasts.forEach(i=>{this.subscribers.forEach(o=>o({id:i.id,dismiss:!0}))}),l),this.message=(l,i)=>this.create({...i,message:l}),this.error=(l,i)=>this.create({...i,message:l,type:"error"}),this.success=(l,i)=>this.create({...i,type:"success",message:l}),this.info=(l,i)=>this.create({...i,type:"info",message:l}),this.warning=(l,i)=>this.create({...i,type:"warning",message:l}),this.loading=(l,i)=>this.create({...i,type:"loading",message:l}),this.promise=(l,i)=>{if(!i)return;let o;i.loading!==void 0&&(o=this.create({...i,promise:l,type:"loading",message:i.loading,description:typeof i.description!="function"?i.description:void 0}));const c=Promise.resolve(l instanceof Function?l():l);let d=o!==void 0,f;const v=c.then(async m=>{if(f=["resolve",m],ie.isValidElement(m))d=!1,this.create({id:o,type:"default",message:m});else if(HA(m)&&!m.ok){d=!1;const p=typeof i.error=="function"?await i.error(`HTTP error! status: ${m.status}`):i.error,S=typeof i.description=="function"?await i.description(`HTTP error! status: ${m.status}`):i.description,E=typeof p=="object"&&!ie.isValidElement(p)?p:{message:p};this.create({id:o,type:"error",description:S,...E})}else if(m instanceof Error){d=!1;const p=typeof i.error=="function"?await i.error(m):i.error,S=typeof i.description=="function"?await i.description(m):i.description,E=typeof p=="object"&&!ie.isValidElement(p)?p:{message:p};this.create({id:o,type:"error",description:S,...E})}else if(i.success!==void 0){d=!1;const p=typeof i.success=="function"?await i.success(m):i.success,S=typeof i.description=="function"?await i.description(m):i.description,E=typeof p=="object"&&!ie.isValidElement(p)?p:{message:p};this.create({id:o,type:"success",description:S,...E})}}).catch(async m=>{if(f=["reject",m],i.error!==void 0){d=!1;const x=typeof i.error=="function"?await i.error(m):i.error,p=typeof i.description=="function"?await i.description(m):i.description,T=typeof x=="object"&&!ie.isValidElement(x)?x:{message:x};this.create({id:o,type:"error",description:p,...T})}}).finally(()=>{d&&(this.dismiss(o),o=void 0),i.finally==null||i.finally.call(i)}),g=()=>new Promise((m,x)=>v.then(()=>f[0]==="reject"?x(f[1]):m(f[1])).catch(x));return typeof o!="string"&&typeof o!="number"?{unwrap:g}:Object.assign(o,{unwrap:g})},this.custom=(l,i)=>{const o=i?.id||wf++;return this.create({jsx:l(o),id:o,...i}),o},this.getActiveToasts=()=>this.toasts.filter(l=>!this.dismissedToasts.has(l.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Pt=new kA,LA=(n,l)=>{const i=l?.id||wf++;return Pt.addToast({title:n,...l,id:i}),i},HA=n=>n&&typeof n=="object"&&"ok"in n&&typeof n.ok=="boolean"&&"status"in n&&typeof n.status=="number",UA=LA,BA=()=>Pt.toasts,qA=()=>Pt.getActiveToasts(),uy=Object.assign(UA,{success:Pt.success,info:Pt.info,warning:Pt.warning,error:Pt.error,custom:Pt.custom,message:Pt.message,promise:Pt.promise,dismiss:Pt.dismiss,loading:Pt.loading},{getHistory:BA,getToasts:qA});TA("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Ns(n){return n.label!==void 0}const GA=3,VA="24px",YA="16px",dy=4e3,IA=356,QA=14,PA=45,KA=200;function Hn(...n){return n.filter(Boolean).join(" ")}function FA(n){const[l,i]=n.split("-"),o=[];return l&&o.push(l),i&&o.push(i),o}const XA=n=>{var l,i,o,c,d,f,v,g,m;const{invert:x,toast:p,unstyled:S,interacting:T,setHeights:E,visibleToasts:C,heights:R,index:M,toasts:z,expanded:D,removeToast:Y,defaultRichColors:K,closeButton:q,style:V,cancelButtonStyle:B,actionButtonStyle:oe,className:se="",descriptionClassName:le="",duration:ce,position:ue,gap:ve,expandByDefault:de,classNames:N,icons:F,closeButtonAriaLabel:W="Close toast"}=n,[ee,$]=ie.useState(null),[A,j]=ie.useState(null),[L,Q]=ie.useState(!1),[I,te]=ie.useState(!1),[Z,ae]=ie.useState(!1),[re,xe]=ie.useState(!1),[Re,je]=ie.useState(!1),[et,Ge]=ie.useState(0),[kt,ht]=ie.useState(0),nt=ie.useRef(p.duration||ce||dy),$a=ie.useRef(null),Nt=ie.useRef(null),Ee=M===0,ke=M+1<=C,Ae=p.type,sn=p.dismissible!==!1,xt=p.className||"",Ur=p.descriptionClassName||"",Ja=ie.useMemo(()=>R.findIndex(Se=>Se.toastId===p.id)||0,[R,p.id]),io=ie.useMemo(()=>{var Se;return(Se=p.closeButton)!=null?Se:q},[p.closeButton,q]),Wa=ie.useMemo(()=>p.duration||ce||dy,[p.duration,ce]),Br=ie.useRef(0),Vn=ie.useRef(0),oo=ie.useRef(0),fa=ie.useRef(null),[el,_t]=ue.split("-"),Sn=ie.useMemo(()=>R.reduce((Se,Je,mt)=>mt>=Ja?Se:Se+Je.height,0),[R,Ja]),Mt=zA(),gc=p.invert||x,qr=Ae==="loading";Vn.current=ie.useMemo(()=>Ja*ve+Sn,[Ja,Sn]),ie.useEffect(()=>{nt.current=Wa},[Wa]),ie.useEffect(()=>{Q(!0)},[]),ie.useEffect(()=>{const Se=Nt.current;if(Se){const Je=Se.getBoundingClientRect().height;return ht(Je),E(mt=>[{toastId:p.id,height:Je,position:p.position},...mt]),()=>E(mt=>mt.filter(jt=>jt.toastId!==p.id))}},[E,p.id]),ie.useLayoutEffect(()=>{if(!L)return;const Se=Nt.current,Je=Se.style.height;Se.style.height="auto";const mt=Se.getBoundingClientRect().height;Se.style.height=Je,ht(mt),E(jt=>jt.find(tt=>tt.toastId===p.id)?jt.map(tt=>tt.toastId===p.id?{...tt,height:mt}:tt):[{toastId:p.id,height:mt,position:p.position},...jt])},[L,p.title,p.description,E,p.id,p.jsx,p.action,p.cancel]);const On=ie.useCallback(()=>{te(!0),Ge(Vn.current),E(Se=>Se.filter(Je=>Je.toastId!==p.id)),setTimeout(()=>{Y(p)},KA)},[p,Y,E,Vn]);ie.useEffect(()=>{if(p.promise&&Ae==="loading"||p.duration===1/0||p.type==="loading")return;let Se;return D||T||Mt?(()=>{if(oo.current {p.onAutoClose==null||p.onAutoClose.call(p,p),On()},nt.current)),()=>clearTimeout(Se)},[D,T,p,Ae,Mt,On]),ie.useEffect(()=>{p.delete&&(On(),p.onDismiss==null||p.onDismiss.call(p,p))},[On,p.delete]);function _l(){var Se;if(F?.loading){var Je;return ie.createElement("div",{className:Hn(N?.loader,p==null||(Je=p.classNames)==null?void 0:Je.loader,"sonner-loader"),"data-visible":Ae==="loading"},F.loading)}return ie.createElement(jA,{className:Hn(N?.loader,p==null||(Se=p.classNames)==null?void 0:Se.loader),visible:Ae==="loading"})}const Dl=p.icon||F?.[Ae]||RA(Ae);var tl,Nn;return ie.createElement("li",{tabIndex:0,ref:Nt,className:Hn(se,xt,N?.toast,p==null||(l=p.classNames)==null?void 0:l.toast,N?.default,N?.[Ae],p==null||(i=p.classNames)==null?void 0:i[Ae]),"data-sonner-toast":"","data-rich-colors":(tl=p.richColors)!=null?tl:K,"data-styled":!(p.jsx||p.unstyled||S),"data-mounted":L,"data-promise":!!p.promise,"data-swiped":Re,"data-removed":I,"data-visible":ke,"data-y-position":el,"data-x-position":_t,"data-index":M,"data-front":Ee,"data-swiping":Z,"data-dismissible":sn,"data-type":Ae,"data-invert":gc,"data-swipe-out":re,"data-swipe-direction":A,"data-expanded":!!(D||de&&L),"data-testid":p.testId,style:{"--index":M,"--toasts-before":M,"--z-index":z.length-M,"--offset":`${I?et:Vn.current}px`,"--initial-height":de?"auto":`${kt}px`,...V,...p.style},onDragEnd:()=>{ae(!1),$(null),fa.current=null},onPointerDown:Se=>{Se.button!==2&&(qr||!sn||($a.current=new Date,Ge(Vn.current),Se.target.setPointerCapture(Se.pointerId),Se.target.tagName!=="BUTTON"&&(ae(!0),fa.current={x:Se.clientX,y:Se.clientY})))},onPointerUp:()=>{var Se,Je,mt;if(re||!sn)return;fa.current=null;const jt=Number(((Se=Nt.current)==null?void 0:Se.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ha=Number(((Je=Nt.current)==null?void 0:Je.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),tt=new Date().getTime()-((mt=$a.current)==null?void 0:mt.getTime()),Lt=ee==="x"?jt:ha,nl=Math.abs(Lt)/tt;if(Math.abs(Lt)>=PA||nl>.11){Ge(Vn.current),p.onDismiss==null||p.onDismiss.call(p,p),j(ee==="x"?jt>0?"right":"left":ha>0?"down":"up"),On(),xe(!0);return}else{var Ht,Ut;(Ht=Nt.current)==null||Ht.style.setProperty("--swipe-amount-x","0px"),(Ut=Nt.current)==null||Ut.style.setProperty("--swipe-amount-y","0px")}je(!1),ae(!1),$(null)},onPointerMove:Se=>{var Je,mt,jt;if(!fa.current||!sn||((Je=window.getSelection())==null?void 0:Je.toString().length)>0)return;const tt=Se.clientY-fa.current.y,Lt=Se.clientX-fa.current.x;var nl;const Ht=(nl=n.swipeDirections)!=null?nl:FA(ue);!ee&&(Math.abs(Lt)>1||Math.abs(tt)>1)&&$(Math.abs(Lt)>Math.abs(tt)?"x":"y");let Ut={x:0,y:0};const zl=wn=>1/(1.5+Math.abs(wn)/20);if(ee==="y"){if(Ht.includes("top")||Ht.includes("bottom"))if(Ht.includes("top")&&tt<0||Ht.includes("bottom")&&tt>0)Ut.y=tt;else{const wn=tt*zl(tt);Ut.y=Math.abs(wn) 0)Ut.x=Lt;else{const wn=Lt*zl(Lt);Ut.x=Math.abs(wn) 0||Math.abs(Ut.y)>0)&&je(!0),(mt=Nt.current)==null||mt.style.setProperty("--swipe-amount-x",`${Ut.x}px`),(jt=Nt.current)==null||jt.style.setProperty("--swipe-amount-y",`${Ut.y}px`)}},io&&!p.jsx&&Ae!=="loading"?ie.createElement("button",{"aria-label":W,"data-disabled":qr,"data-close-button":!0,onClick:qr||!sn?()=>{}:()=>{On(),p.onDismiss==null||p.onDismiss.call(p,p)},className:Hn(N?.closeButton,p==null||(o=p.classNames)==null?void 0:o.closeButton)},(Nn=F?.close)!=null?Nn:DA):null,(Ae||p.icon||p.promise)&&p.icon!==null&&(F?.[Ae]!==null||p.icon)?ie.createElement("div",{"data-icon":"",className:Hn(N?.icon,p==null||(c=p.classNames)==null?void 0:c.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||_l():null,p.type!=="loading"?Dl:null):null,ie.createElement("div",{"data-content":"",className:Hn(N?.content,p==null||(d=p.classNames)==null?void 0:d.content)},ie.createElement("div",{"data-title":"",className:Hn(N?.title,p==null||(f=p.classNames)==null?void 0:f.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?ie.createElement("div",{"data-description":"",className:Hn(le,Ur,N?.description,p==null||(v=p.classNames)==null?void 0:v.description)},typeof p.description=="function"?p.description():p.description):null),ie.isValidElement(p.cancel)?p.cancel:p.cancel&&Ns(p.cancel)?ie.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||B,onClick:Se=>{Ns(p.cancel)&&sn&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Se),On())},className:Hn(N?.cancelButton,p==null||(g=p.classNames)==null?void 0:g.cancelButton)},p.cancel.label):null,ie.isValidElement(p.action)?p.action:p.action&&Ns(p.action)?ie.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||oe,onClick:Se=>{Ns(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Se),!Se.defaultPrevented&&On())},className:Hn(N?.actionButton,p==null||(m=p.classNames)==null?void 0:m.actionButton)},p.action.label):null)};function fy(){if(typeof window>"u"||typeof document>"u")return"ltr";const n=document.documentElement.getAttribute("dir");return n==="auto"||!n?window.getComputedStyle(document.documentElement).direction:n}function ZA(n,l){const i={};return[n,l].forEach((o,c)=>{const d=c===1,f=d?"--mobile-offset":"--offset",v=d?YA:VA;function g(m){["top","right","bottom","left"].forEach(x=>{i[`${f}-${x}`]=typeof m=="number"?`${m}px`:m})}typeof o=="number"||typeof o=="string"?g(o):typeof o=="object"?["top","right","bottom","left"].forEach(m=>{o[m]===void 0?i[`${f}-${m}`]=v:i[`${f}-${m}`]=typeof o[m]=="number"?`${o[m]}px`:o[m]}):g(v)}),i}const $A=ie.forwardRef(function(l,i){const{id:o,invert:c,position:d="bottom-right",hotkey:f=["altKey","KeyT"],expand:v,closeButton:g,className:m,offset:x,mobileOffset:p,theme:S="light",richColors:T,duration:E,style:C,visibleToasts:R=GA,toastOptions:M,dir:z=fy(),gap:D=QA,icons:Y,containerAriaLabel:K="Notifications"}=l,[q,V]=ie.useState([]),B=ie.useMemo(()=>o?q.filter(L=>L.toasterId===o):q.filter(L=>!L.toasterId),[q,o]),oe=ie.useMemo(()=>Array.from(new Set([d].concat(B.filter(L=>L.position).map(L=>L.position)))),[B,d]),[se,le]=ie.useState([]),[ce,ue]=ie.useState(!1),[ve,de]=ie.useState(!1),[N,F]=ie.useState(S!=="system"?S:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=ie.useRef(null),ee=f.join("+").replace(/Key/g,"").replace(/Digit/g,""),$=ie.useRef(null),A=ie.useRef(!1),j=ie.useCallback(L=>{V(Q=>{var I;return(I=Q.find(te=>te.id===L.id))!=null&&I.delete||Pt.dismiss(L.id),Q.filter(({id:te})=>te!==L.id)})},[]);return ie.useEffect(()=>Pt.subscribe(L=>{if(L.dismiss){requestAnimationFrame(()=>{V(Q=>Q.map(I=>I.id===L.id?{...I,delete:!0}:I))});return}setTimeout(()=>{Kw.flushSync(()=>{V(Q=>{const I=Q.findIndex(te=>te.id===L.id);return I!==-1?[...Q.slice(0,I),{...Q[I],...L},...Q.slice(I+1)]:[L,...Q]})})})}),[q]),ie.useEffect(()=>{if(S!=="system"){F(S);return}if(S==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?F("dark"):F("light")),typeof window>"u")return;const L=window.matchMedia("(prefers-color-scheme: dark)");try{L.addEventListener("change",({matches:Q})=>{F(Q?"dark":"light")})}catch{L.addListener(({matches:I})=>{try{F(I?"dark":"light")}catch(te){console.error(te)}})}},[S]),ie.useEffect(()=>{q.length<=1&&ue(!1)},[q]),ie.useEffect(()=>{const L=Q=>{var I;if(f.every(ae=>Q[ae]||Q.code===ae)){var Z;ue(!0),(Z=W.current)==null||Z.focus()}Q.code==="Escape"&&(document.activeElement===W.current||(I=W.current)!=null&&I.contains(document.activeElement))&&ue(!1)};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[f]),ie.useEffect(()=>{if(W.current)return()=>{$.current&&($.current.focus({preventScroll:!0}),$.current=null,A.current=!1)}},[W.current]),ie.createElement("section",{ref:i,"aria-label":`${K} ${ee}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},oe.map((L,Q)=>{var I;const[te,Z]=L.split("-");return B.length?ie.createElement("ol",{key:L,dir:z==="auto"?fy():z,tabIndex:-1,ref:W,className:m,"data-sonner-toaster":!0,"data-sonner-theme":N,"data-y-position":te,"data-x-position":Z,style:{"--front-toast-height":`${((I=se[0])==null?void 0:I.height)||0}px`,"--width":`${IA}px`,"--gap":`${D}px`,...C,...ZA(x,p)},onBlur:ae=>{A.current&&!ae.currentTarget.contains(ae.relatedTarget)&&(A.current=!1,$.current&&($.current.focus({preventScroll:!0}),$.current=null))},onFocus:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||A.current||(A.current=!0,$.current=ae.relatedTarget)},onMouseEnter:()=>ue(!0),onMouseMove:()=>ue(!0),onMouseLeave:()=>{ve||ue(!1)},onDragEnd:()=>ue(!1),onPointerDown:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||de(!0)},onPointerUp:()=>de(!1)},B.filter(ae=>!ae.position&&Q===0||ae.position===L).map((ae,re)=>{var xe,Re;return ie.createElement(XA,{key:ae.id,icons:Y,index:re,toast:ae,defaultRichColors:T,duration:(xe=M?.duration)!=null?xe:E,className:M?.className,descriptionClassName:M?.descriptionClassName,invert:c,visibleToasts:R,closeButton:(Re=M?.closeButton)!=null?Re:g,interacting:ve,position:L,style:M?.style,unstyled:M?.unstyled,classNames:M?.classNames,cancelButtonStyle:M?.cancelButtonStyle,actionButtonStyle:M?.actionButtonStyle,closeButtonAriaLabel:M?.closeButtonAriaLabel,removeToast:j,toasts:B.filter(je=>je.position==ae.position),heights:se.filter(je=>je.position==ae.position),setHeights:le,expandByDefault:v,gap:D,expanded:ce,swipeDirections:l.swipeDirections})})):null}))}),JA=({...n})=>h.jsx($A,{theme:"dark",className:"toaster group",icons:{success:h.jsx(Tj,{className:"size-4"}),info:h.jsx(Yj,{className:"size-4"}),warning:h.jsx(gx,{className:"size-4"}),error:h.jsx(aA,{className:"size-4"}),loading:h.jsx(Xj,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...n});function He(n,l=!1){l?uy.error(n):uy(n)}function WA(){return h.jsx(JA,{position:"bottom-center"})}const hy=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,my=Wb,eO=(n,l)=>i=>{var o;if(l?.variants==null)return my(n,i?.class,i?.className);const{variants:c,defaultVariants:d}=l,f=Object.keys(c).map(m=>{const x=i?.[m],p=d?.[m];if(x===null)return null;const S=hy(x)||hy(p);return c[m][S]}),v=i&&Object.entries(i).reduce((m,x)=>{let[p,S]=x;return S===void 0||(m[p]=S),m},{}),g=l==null||(o=l.compoundVariants)===null||o===void 0?void 0:o.reduce((m,x)=>{let{class:p,className:S,...T}=x;return Object.entries(T).every(E=>{let[C,R]=E;return Array.isArray(R)?R.includes({...d,...v}[C]):{...d,...v}[C]===R})?[...m,p,S]:m},[]);return my(n,f,g,i?.class,i?.className)},tO=eO("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",primary:"pbtn",danger:"danger-btn",subtle:"ai-btn",toolbar:"btn",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function rn({className:n,variant:l="default",size:i="default",asChild:o=!1,...c}){const d=o?Fw:"button";return h.jsx(d,{"data-slot":"button","data-variant":l,"data-size":i,className:bt(tO({variant:l,size:i,className:n})),...c})}function mh({...n}){return h.jsx(Lf,{"data-slot":"dialog",...n})}function nO({...n}){return h.jsx(Uf,{"data-slot":"dialog-portal",...n})}function aO({className:n,...l}){return h.jsx(Bf,{"data-slot":"dialog-overlay",className:bt("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",n),...l})}function ph({className:n,children:l,showCloseButton:i=!0,...o}){return h.jsxs(nO,{"data-slot":"dialog-portal",children:[h.jsx(aO,{}),h.jsxs(qf,{"data-slot":"dialog-content",className:bt("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",n),...o,children:[l,i&&h.jsxs(o0,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[h.jsx(yx,{}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function mc({className:n,...l}){return h.jsx(l0,{"data-slot":"dialog-title",className:bt("text-lg leading-none font-semibold",n),...l})}let bx=null,Ls=[];function lo(n){bx=n,Ls.forEach(l=>l())}function xx(n,l,i="",o="OK"){return new Promise(c=>lo({kind:"prompt",title:n,label:l,value:i,okLabel:o,resolve:c}))}function _s(n,l,i="Confirm",o=!1){return new Promise(c=>lo({kind:"confirm",title:n,message:l,confirmLabel:i,danger:o,resolve:c}))}function lO(){const n=y.useSyncExternalStore(i=>(Ls.push(i),()=>{Ls=Ls.filter(o=>o!==i)}),()=>bx);if(!n)return null;const l=()=>{lo(null),n.kind==="prompt"?n.resolve(null):n.resolve(!1)};return h.jsx(mh,{open:!0,onOpenChange:i=>!i&&l(),children:h.jsx(ph,{className:"modal",showCloseButton:!1,children:n.kind==="prompt"?h.jsx(rO,{m:n}):h.jsx(iO,{m:n})})})}function rO({m:n}){const l=y.useRef(null),i=c=>{lo(null),n.resolve(c)},o=()=>i(l.current.value.trim()||null);return h.jsxs(h.Fragment,{children:[h.jsx(mc,{asChild:!0,children:h.jsx("h3",{children:n.title})}),h.jsx("label",{className:"modal-label",children:n.label}),h.jsx("input",{className:"modal-input",type:"text",autoComplete:"off",defaultValue:n.value,ref:l,autoFocus:!0,onFocus:c=>c.currentTarget.select(),onKeyDown:c=>c.key==="Enter"&&o()}),h.jsxs("div",{className:"modal-actions",children:[h.jsx(rn,{variant:"subtle",onClick:()=>i(null),children:"Cancel"}),h.jsx(rn,{variant:"primary",onClick:o,children:n.okLabel})]})]})}function iO({m:n}){const l=i=>{lo(null),n.resolve(i)};return h.jsxs(h.Fragment,{children:[h.jsx(mc,{asChild:!0,children:h.jsx("h3",{children:n.title})}),h.jsx("p",{className:"modal-msg",children:n.message}),h.jsxs("div",{className:"modal-actions",children:[h.jsx(rn,{variant:"subtle",onClick:()=>l(!1),children:"Cancel"}),h.jsx(rn,{variant:n.danger?"danger":"primary",onClick:()=>l(!0),autoFocus:!0,children:n.confirmLabel})]})]})}function oO(n){return Zt({queryKey:["projects"],queryFn:()=>on("/api/projects"),enabled:n,refetchInterval:3e4,select:l=>l.projects||[]})}function sO(n){return Zt({queryKey:["orgs"],queryFn:()=>on("/api/orgs"),enabled:n,select:l=>l.orgs||[]})}function Sx(n){return Zt({queryKey:["admin","pending"],queryFn:()=>on("/api/admin/pending"),enabled:n,select:l=>l.pending||[]})}function wx(){const n=$i();return()=>Promise.all([n.invalidateQueries({queryKey:["projects"]}),n.invalidateQueries({queryKey:["orgs"]})]).then(()=>{})}function Ex(n){return n.split("/").map(encodeURIComponent).join("/")}function py(n){return n.split("/").map(decodeURIComponent).join("/")}const cO=new Set(["insights","history","install","settings"]);function Cx(n,l){const i=n.replace(/^\/+/,"");if(l!=="hub")return{path:i?py(i):""};const o=i.indexOf("/");if(o===-1)return{project:i,path:""};const c={project:i.slice(0,o),path:py(i.slice(o+1))},d=c.path.indexOf("/"),f=d===-1?c.path:c.path.slice(0,d);return cO.has(f)&&(c.view=f,c.viewTarget=d===-1?"":c.path.slice(d+1).replace(/\/+$/,""),c.path=""),c}function uO(n,l){const i=Ex(n);return l?"/"+l+(i?"/"+i:""):"/"+i}function Rr(n,l,i){let o=(l?"/"+l:"")+"/"+n;return i&&(o+="/"+Ex(i.replace(/\/+$/,""))),o}let vh="POP";const Ef=new Set;function Tx(){for(const n of Ef)n()}window.addEventListener("popstate",()=>{vh="POP",Tx()});function Ft(n,l){const i=location.pathname+location.search;!l?.replace&&i===n||(history[l?.replace?"replaceState":"pushState"](null,"",n),vh=l?.replace?"REPLACE":"PUSH",Tx())}function gh(){return y.useSyncExternalStore(n=>(Ef.add(n),()=>{Ef.delete(n)}),()=>location.pathname)}function dO(){return vh}function fO({to:n}){return y.useEffect(()=>{Ft(n,{replace:!0})},[n]),null}const hO=/\.(md|markdown)$/i,mO=/\.(png|jpe?g|gif|svg|webp|ico|bmp|avif)$/i,pO=/\.html?$/i,vO=/\.(txt|log|json|ya?ml|toml|csv|go|py|js|ts|jsx|tsx|sh|bash|zsh|rb|rs|c|h|cpp|java|kt|swift|sql|css|xml|ini|conf|env|mod|sum|jsonl)$/i;function Rx(n){if(n<1024)return n+" B";const l=["KB","MB","GB","TB"];let i=-1;do n/=1024,i++;while(n>=1024&&i c.invalidateQueries({queryKey:["orgs"]}),m=()=>c.invalidateQueries({queryKey:["invites",n.id]}),x=()=>c.invalidateQueries({queryKey:["orgShares",n.id]}),{data:p}=Zt({queryKey:["invites",n.id],queryFn:()=>on(`/api/orgs/${n.id}/invites`),enabled:d,select:E=>E.invites||[]}),{data:S}=Zt({queryKey:["orgShares",n.id],queryFn:()=>on(`/api/orgs/${n.id}/shares`),enabled:d,select:E=>E.shares||[]}),T=l.filter(E=>E.org===n.id);return h.jsxs("div",{className:"admin",children:[h.jsx("h1",{id:"org-title",children:n.name+(d?"":" · member")}),d&&h.jsxs("div",{className:"admin-row",children:[h.jsx("input",{id:"org-rename",type:"text",value:f,onChange:E=>v(E.target.value)}),h.jsx("button",{className:"pbtn",id:"org-rename-btn",onClick:async()=>{try{await Ba("PATCH","/api/orgs/"+n.id,{name:f.trim()}),He("Renamed."),g()}catch(E){He(E.message,!0)}},children:"Rename org"})]}),h.jsx("h3",{children:"Members"}),h.jsx("div",{className:"admin-list",children:n.members.map(E=>{const C=!!i&&E.email.toLowerCase()===i.toLowerCase();return h.jsxs("div",{className:"admin-item",children:[h.jsx("span",{className:"ai-main",children:E.email+(C?" (you)":"")}),d&&!C?h.jsxs(h.Fragment,{children:[h.jsxs("select",{value:E.role,onChange:async R=>{try{await Ba("PATCH",`/api/orgs/${n.id}/members/${encodeURIComponent(E.email)}`,{role:R.target.value}),He("Role updated.")}catch(M){He(M.message,!0)}g()},children:[h.jsx("option",{value:"owner",children:"owner"}),h.jsx("option",{value:"member",children:"member"})]}),h.jsx("button",{className:"ai-del",onClick:async()=>{if(await _s("Remove member",`Remove ${E.email} from ${n.name}?`,"Remove",!0))try{await Ba("DELETE",`/api/orgs/${n.id}/members/${encodeURIComponent(E.email)}`),He("Removed."),g()}catch(R){He(R.message,!0)}},children:"Remove"})]}):h.jsx("span",{className:"ai-tag",children:E.role})]},E.email)})}),d&&h.jsxs(h.Fragment,{children:[h.jsx("h3",{children:"Projects"}),h.jsxs("div",{className:"admin-list",children:[T.length===0&&h.jsx("div",{className:"admin-empty",children:"No projects yet."}),T.map(E=>h.jsxs("div",{className:"admin-item",children:[h.jsx("span",{className:"ai-main",children:E.name}),h.jsx("button",{className:"ai-btn",onClick:async()=>{const C=await xx("Rename project","New name",E.name,"Rename");if(!(!C||C===E.name))try{await Ba("PATCH","/api/projects/"+E.id,{name:C}),He("Renamed."),await o()}catch(R){He(R.message,!0)}},children:"Rename"}),h.jsx("button",{className:"ai-del",onClick:async()=>{if(await _s("Delete project",`Delete “${E.name}”? Its files stay in storage, but it's removed from the hub.`,"Delete",!0))try{await Ba("DELETE","/api/projects/"+E.id),He(`Deleted “${E.name}”.`),await o()}catch(C){He(C.message,!0)}},children:"Delete"})]},E.id))]}),h.jsxs("div",{className:"admin-h",children:[h.jsx("h3",{children:"Invite links"}),h.jsx("button",{className:"pbtn",onClick:async()=>{try{const E=await Ar(`/api/orgs/${n.id}/invites`),C=await Fi(E.url);He(C?"Invite link copied to clipboard.":"Invite created — copy it from the list below."),m()}catch(E){He(E.message,!0)}},children:"New invite"})]}),h.jsxs("div",{className:"admin-list",children:[p&&p.length===0&&h.jsx("div",{className:"admin-empty",children:"No active invite links."}),(p||[]).map(E=>h.jsxs("div",{className:"admin-item",children:[h.jsx("span",{className:"ai-main mono",style:{cursor:"pointer"},title:"Copy",onClick:()=>Fi(E.url).then(C=>He(C?"Copied.":"Select and copy the link.")),children:E.url}),h.jsx("span",{className:"ai-tag",children:(E.creator?"by "+E.creator+" · ":"")+(E.uses?E.uses+" joined · ":"unused · ")+"expires "+new Date(E.expires).toLocaleDateString()}),h.jsx("button",{className:"ai-del",onClick:async()=>{if(await _s("Revoke invite","Revoke this invite link? Anyone still holding it won't be able to join.","Revoke",!0))try{await Ba("DELETE",`/api/orgs/${n.id}/invites/${E.token}`),He("Revoked."),m()}catch(C){He(C.message,!0)}},children:"Revoke"})]},E.token))]}),h.jsx("h3",{children:"Public share links"}),h.jsxs("div",{className:"admin-list",children:[S&&S.length===0&&h.jsx("div",{className:"admin-empty",children:"No public shares."}),(S||[]).map(E=>h.jsxs("div",{className:"admin-item",children:[h.jsx("span",{className:"ai-main mono",style:{cursor:"pointer"},title:E.url,onClick:()=>window.open(E.url,"_blank"),children:E.path}),h.jsx("span",{className:"ai-tag",children:(E.project_name||"")+(E.creator?" · by "+E.creator:"")+(E.created?" · "+new Date(E.created).toLocaleDateString():"")}),h.jsx("button",{className:"ai-del",onClick:async()=>{if(await _s("Revoke share link",`Revoke the public link to “${E.path}”? Anyone with the URL will lose access.`,"Revoke",!0))try{await Ba("DELETE","/api/shares/"+E.token),He("Share revoked."),x()}catch(C){He(C.message,!0)}},children:"Revoke"})]},E.token))]})]})]})}function yO(){const n=$i(),{data:l,error:i}=Zt({queryKey:["admin","policy"],queryFn:()=>on("/api/admin/policy")}),{data:o}=Sx(!0),[c,d]=y.useState(!1),[f,v]=y.useState(!1);if(y.useEffect(()=>{l&&(d(l.require_verification&&l.mailer),v(l.require_approval))},[l]),y.useEffect(()=>{i&&He(i.message,!0)},[i]),!l)return null;const g=async(m,x,p)=>{try{await Ar(`/api/admin/pending/${m}/${x}`),He((x==="approve"?"Approved ":"Denied ")+p),n.invalidateQueries({queryKey:["admin","pending"]})}catch(S){He(S.message,!0)}};return h.jsxs("div",{className:"admin",children:[h.jsx("h1",{children:"Signup & access"}),h.jsx("p",{className:"admin-sub",children:"Who can create an account on this hub, and how new accounts are vetted."}),h.jsx("h3",{children:"New-account vetting"}),h.jsxs("div",{className:"admin-list",children:[h.jsx(vy,{label:"Require email verification",desc:l.mailer?"New accounts must click an emailed link before they can sign in — proves they control the address.":"Configure SMTP on the server (auth.smtp) to enable email verification.",checked:c,disabled:!l.mailer,onChange:d}),h.jsx(vy,{label:"Require admin approval",desc:"New accounts wait for a hub admin to approve them before they gain access.",checked:f,onChange:v})]}),h.jsx("button",{className:"pbtn",style:{marginTop:14},onClick:async()=>{try{await Ar("/api/admin/policy",{require_verification:c,require_approval:f}),He("Signup policy saved."),n.invalidateQueries({queryKey:["admin","policy"]})}catch(m){He(m.message,!0)}},children:"Save policy"}),h.jsx("h3",{children:"Who can sign up"}),h.jsxs("div",{className:"admin-list",children:[h.jsxs("div",{className:"admin-item",children:[h.jsx("span",{className:"ai-main",children:"Allowed email domains"}),h.jsx("span",{className:"ai-tag",children:l.allowed_domains&&l.allowed_domains.length?l.allowed_domains.map(m=>"@"+m).join(", "):"any"})]}),h.jsxs("div",{className:"admin-item",children:[h.jsx("span",{className:"ai-main",children:"Self-signup"}),h.jsx("span",{className:"ai-tag",children:l.allow_signup?"open":"invite-only"})]}),h.jsxs("div",{className:"admin-item",children:[h.jsx("span",{className:"ai-main",children:"Hub admins"}),h.jsx("span",{className:"ai-tag",children:l.admins&&l.admins.length?l.admins.join(", "):"none"})]})]}),h.jsx("p",{className:"admin-sub",children:"Domains and admins are set in the server config file (they can't be widened from the browser)."}),h.jsx("h3",{children:"Pending signups"}),h.jsxs("div",{className:"admin-list",children:[(!o||o.length===0)&&h.jsx("div",{className:"admin-empty",children:"No one is waiting for approval."}),(o||[]).map(m=>h.jsxs("div",{className:"admin-item",children:[h.jsx("span",{className:"ai-main",children:(m.name?m.name+" · ":"")+m.email}),h.jsx("button",{className:"pbtn",onClick:()=>g(m.id,"approve",m.email),children:"Approve"}),h.jsx("button",{className:"ai-del",onClick:()=>g(m.id,"deny",m.email),children:"Deny"})]},m.id))]})]})}function vy({label:n,desc:l,checked:i,disabled:o,onChange:c}){return h.jsxs("label",{className:"admin-item toggle",style:o?{opacity:.55}:void 0,children:[h.jsxs("span",{className:"ai-main",children:[h.jsx("div",{className:"tg-label",children:n}),h.jsx("div",{className:"tg-desc",children:l})]}),h.jsx("input",{type:"checkbox",checked:i,disabled:o,onChange:d=>c(d.target.checked)})]})}function bO({...n}){return h.jsx(mb,{"data-slot":"select",...n})}function xO({...n}){return h.jsx(yb,{"data-slot":"select-value",...n})}function SO({className:n,size:l="default",children:i,...o}){return h.jsxs(vb,{"data-slot":"select-trigger","data-size":l,className:bt("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",n),...o,children:[i,h.jsx(bb,{asChild:!0,children:h.jsx(hh,{className:"size-4 opacity-50"})})]})}function wO({className:n,children:l,position:i="item-aligned",align:o="center",...c}){return h.jsx(Sb,{children:h.jsxs(wb,{"data-slot":"select-content",className:bt("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-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-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",i==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n),position:i,align:o,...c,children:[h.jsx(CO,{}),h.jsx(Mb,{className:bt("p-1",i==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:l}),h.jsx(TO,{})]})})}function EO({className:n,children:l,...i}){return h.jsxs(Nb,{"data-slot":"select-item",className:bt("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",n),...i,children:[h.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:h.jsx(zb,{children:h.jsx(px,{className:"size-4"})})}),h.jsx(_b,{children:l})]})}function CO({className:n,...l}){return h.jsx(kb,{"data-slot":"select-scroll-up-button",className:bt("flex cursor-default items-center justify-center py-1",n),...l,children:h.jsx(Ej,{className:"size-4"})})}function TO({className:n,...l}){return h.jsx(Lb,{"data-slot":"select-scroll-down-button",className:bt("flex cursor-default items-center justify-center py-1",n),...l,children:h.jsx(hh,{className:"size-4"})})}const gy=["#5b8def","#f5a623","#4cc38a","#e0679b","#8b7bf0","#3ec8c8","#e6934a"];function jx(n){let l=0;for(const i of n)l=l*31+i.charCodeAt(0)>>>0;return gy[l%gy.length]}function yy({projects:n,currentId:l,menu:i}){const o=wx(),c=async()=>{const d=await xx("New project","Project name","","Create");if(d)try{const f=await Ar("/api/projects",{name:d});await o(),Ft("/"+f.project.id),He(`Created “${f.project.name}”.`)}catch(f){He("Could not create the project: "+f.message,!0)}};return h.jsxs("nav",{id:"projects","aria-label":"Projects",children:[h.jsxs("div",{className:"nav-head",children:[h.jsx("span",{children:"Projects"}),h.jsx("button",{className:"nav-add",title:"New project",onClick:c,children:"+"})]}),h.jsx("div",{className:"proj-row",children:h.jsxs(bO,{value:l||"",onValueChange:d=>{d&&d!==l&&(Ft("/"+d),Mn())},children:[h.jsxs(SO,{id:"project-select","aria-label":"Switch project",className:"proj-trigger",children:[l&&h.jsx("span",{className:"proj-mark","aria-hidden":"true",style:{background:jx(n.find(d=>d.id===l)?.name||"")}}),h.jsx(xO,{placeholder:"Select a project"})]}),h.jsx(wO,{className:"proj-menu",children:n.map(d=>h.jsx(EO,{value:d.id,children:d.name},d.id))})]})}),i&&h.jsx("ul",{className:"nav-menu","aria-label":"Project pages",children:[["dashboard","Dashboard","dashboard",i.onDashboard],["install","Installation","terminal",i.onInstall],["history","History","hist",i.onHistory],["settings","Settings","gear",i.onSettings]].map(([d,f,v,g])=>h.jsx("li",{children:h.jsxs("div",{id:"nav-"+d,className:"row"+(i.active===d?" active":""),role:"button",tabIndex:0,onClick:g,onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),g())},children:[h.jsx(gt,{name:v}),h.jsx("span",{className:"label",children:f})]})},d))})]})}function RO({...n}){return h.jsx(gR,{"data-slot":"dropdown-menu",...n})}function MO({...n}){return h.jsx(yR,{"data-slot":"dropdown-menu-trigger",...n})}function jO({className:n,sideOffset:l=4,...i}){return h.jsx(bR,{children:h.jsx(xR,{"data-slot":"dropdown-menu-content",sideOffset:l,className:bt("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-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-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",n),...i})})}function Kd({className:n,inset:l,variant:i="default",...o}){return h.jsx(wR,{"data-slot":"dropdown-menu-item","data-inset":l,"data-variant":i,className:bt("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!",n),...o})}function Fd({className:n,inset:l,...i}){return h.jsx(SR,{"data-slot":"dropdown-menu-label","data-inset":l,className:bt("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",n),...i})}function AO({me:n,org:l,admin:i,onOrgSettings:o}){const c=n.name||n.email;return h.jsx("footer",{id:"accountbar",children:h.jsxs(RO,{modal:!1,children:[h.jsx(MO,{asChild:!0,children:h.jsxs("button",{id:"account-btn","aria-label":"Account menu",children:[h.jsx("span",{className:"avatar",style:{background:jx(n.email)},"aria-hidden":"true",children:(c.trim()[0]||"?").toUpperCase()}),h.jsxs("span",{className:"acct",children:[h.jsx("b",{children:c}),n.name&&h.jsx("small",{children:n.email})]}),h.jsx(gt,{name:"chev"})]})}),h.jsxs(jO,{id:"account-menu",side:"top",align:"start",sideOffset:6,className:"acct-menu",children:[l&&h.jsxs(h.Fragment,{children:[h.jsx(Fd,{className:"menu-sec",children:"Organization"}),h.jsxs(Kd,{id:"menu-org-settings",onSelect:()=>o(l),children:[h.jsx(gt,{name:"gear"}),h.jsxs("span",{children:[h.jsx("b",{children:l.name})," Settings"]})]})]}),i&&h.jsxs(h.Fragment,{children:[h.jsx(Fd,{className:"menu-sec",children:"Hub"}),h.jsxs(Kd,{id:"menu-hub-admin",onSelect:i.onClick,children:[h.jsx(gt,{name:"shield"}),h.jsxs("span",{children:["Signup & access",i.pending?` · ${i.pending}`:""]})]})]}),h.jsx(Fd,{className:"menu-sec",children:"Account"}),h.jsx(Kd,{asChild:!0,children:h.jsxs("a",{id:"signout",href:"/auth/logout",children:[h.jsx(gt,{name:"power"}),h.jsx("span",{children:"Log out"})]})})]})]})})}function OO({project:n,org:l}){return h.jsxs("div",{className:"project-settings",children:[h.jsx("h2",{children:n.name}),h.jsxs("dl",{className:"ps-facts",children:[h.jsx("dt",{children:"Project id"}),h.jsx("dd",{children:h.jsx("code",{children:n.id})}),l&&h.jsxs(h.Fragment,{children:[h.jsx("dt",{children:"Workspace"}),h.jsx("dd",{children:l.name})]}),n.created&&h.jsxs(h.Fragment,{children:[h.jsx("dt",{children:"Created"}),h.jsx("dd",{children:new Date(n.created).toLocaleDateString()})]})]})]})}const Xd=[{key:"claude",label:"Claude Code & Cowork"},{key:"hermes",label:"Hermes",hook:"hermes",note:"Registers BearDrive's hooks in Hermes's config: pull before every turn, push after edits with a session note, and report file reads to Insights."},{key:"codex",label:"Codex",hook:"codex",note:"Registers hooks in .codex/hooks.json.",extra:"Run /hooks inside Codex once to trust the project's .codex layer — after that every turn pulls, edits push automatically, and reads are reported to Insights."}];function NO(n,l){const i=window.location.origin,o=l.id;if(n.key==="claude")return[{title:"Add the BearDrive plugin",desc:"One time, in any Claude Code session. The plugin ships the beardrive skill, the /beardrive commands, and turn-boundary sync hooks — and Claude Cowork shares the same plugins, so installing it once covers both.",code:`/plugin marketplace add runbear-io/beardrive +/plugin install beardrive@beardrive`},{title:"Set up this project conversationally",desc:"In a Claude Code or Cowork session in the folder where you want the files, run:",code:"/beardrive:install connect to "+i+", project "+o,extra:"Claude installs the CLI, signs this machine in, mounts the project, and registers the sync hooks — pull the latest before every turn, push after edits (stamped with the session that made them), and report file reads to Insights. It asks before anything it changes."}];const c=(l.name||"project").toLowerCase().replace(/[^a-z0-9._-]+/g,"-")||"project";return[{title:"Install the BearDrive CLI",desc:"One static binary. Homebrew on macOS and Linux; releases and `go install` also work.",code:"brew install runbear-io/tap/beardrive"},{title:"Sign in to this hub",desc:"Opens the browser once and stores a device token on this machine — the synced folder itself never holds credentials.",code:"bdrive login "+i},{title:"Mount the project into a local folder",desc:"Run it where you want the files. An existing folder works too — contents merge, and re-running init later (or after moving the folder) just resumes.",code:"mkdir -p ~/"+c+" && cd ~/"+c+` +bdrive init --project `+o},{title:"Connect "+n.label,desc:n.note,code:"bdrive hooks install --agent "+n.hook,extra:n.extra}]}function _O(){try{return localStorage.getItem("bdrive-guide-agent")||"claude"}catch{return"claude"}}function Ax({project:n}){const[l,i]=y.useState(_O),o=Xd.find(c=>c.key===l)||Xd[0];return h.jsxs("div",{className:"guide",children:[h.jsx("h1",{className:"in-title",children:n.name}),h.jsx("p",{className:"dl-sub",children:"Mount this project as a folder on any machine and connect your coding agent: files sync both ways in the background, every change is journaled with who made it, and agent reads feed Insights."}),h.jsx("div",{className:"gd-tabs",children:Xd.map(c=>h.jsx("button",{className:"gd-tab"+(c.key===o.key?" active":""),"data-key":c.key,onClick:()=>{i(c.key);try{localStorage.setItem("bdrive-guide-agent",c.key)}catch{}},children:c.label},c.key))}),h.jsxs("div",{className:"gd-body",children:[NO(o,n).map((c,d)=>h.jsxs("div",{className:"gd-step",children:[h.jsxs("div",{className:"gd-step-head",children:[h.jsx("span",{className:"gd-num",children:d+1}),h.jsx("span",{className:"gd-step-title",children:c.title})]}),c.desc&&h.jsx("p",{className:"gd-desc",children:c.desc}),c.code&&h.jsx(DO,{code:c.code}),c.extra&&h.jsx("p",{className:"gd-desc gd-extra",children:c.extra})]},d)),h.jsx("p",{className:"gd-done",children:"That's it — the folder now syncs on its own. Every agent turn starts from the latest state, edits appear here (and on every teammate's mount) within seconds, and what your agents read shows up in Insights."})]})]})}function DO({code:n}){const[l,i]=y.useState("Copy");return h.jsxs("pre",{className:"gd-code",children:[h.jsx("code",{children:n}),h.jsx("button",{className:"gd-copy",onClick:async()=>{i(await Fi(n)?"Copied":"Copy failed"),setTimeout(()=>i("Copy"),1400)},children:l})]})}function zO({authEnabled:n,onCreate:l}){const i=y.useRef(null),o=y.useRef(null),c=()=>{const d=i.current.value.trim(),f=d.match(/join\/([0-9a-f]+)/)||d.match(/^([0-9a-f]{8,})$/);if(!f){He("That doesn't look like an invite link.",!0);return}location.href="/join/"+f[1]};return h.jsxs("div",{className:"onboard",children:[h.jsx("h1",{children:"Welcome to BearDrive"}),h.jsx("p",{children:"You're signed in, but you're not part of any project yet."}),n&&h.jsxs("div",{className:"ob-card",children:[h.jsx("h3",{children:"Have an invite link?"}),h.jsx("p",{children:"A teammate can send you a join link. Paste it here:"}),h.jsxs("div",{className:"ob-row",children:[h.jsx("input",{id:"ob-invite",type:"text",placeholder:"https://…/join/…",autoComplete:"off",ref:i}),h.jsx(rn,{id:"ob-join",variant:"primary",onClick:c,children:"Join"})]})]}),h.jsxs("div",{className:"ob-card",children:[h.jsx("h3",{children:"Or start a new project"}),h.jsx("p",{children:"Create a shared space for your team's files."}),h.jsxs("div",{className:"ob-row",children:[h.jsx("input",{id:"ob-name",type:"text",placeholder:"Project name, e.g. wiki",autoComplete:"off",ref:o}),h.jsx(rn,{id:"ob-create",variant:"primary",onClick:()=>l(o.current.value.trim()),children:"Create"})]})]})]})}function kO(n,l=!0){const i=Zt({queryKey:["tree",n],queryFn:()=>on(n+"tree"),enabled:l,refetchInterval:15e3}),o=y.useMemo(()=>{const c=[],d=new Map,f=v=>{for(const g of v.children||[])g.dir?(d.set(g.path,g),f(g)):c.push(g)};return i.data&&f(i.data),{flatFiles:c,dirIndex:d}},[i.data]);return{tree:i.data,...o,loaded:!!i.data}}function LO(n,l){return Zt({queryKey:["heat",n],queryFn:()=>on(n+"heat?days=30"),enabled:l,staleTime:6e4,refetchInterval:6e4}).data?.entries??null}function HO(n,l,i){return Zt({queryKey:["history",n,"prefix",l,20],queryFn:()=>on(n+"history?prefix="+encodeURIComponent(l)+"&n=20"),enabled:i,staleTime:15e3}).data?.entries??null}function by(n,l,i){if(!n)return null;if(!i)return n[l]||null;const o={human:0,agent:0,share:0};for(const[c,d]of Object.entries(n))c.startsWith(l+"/")&&(o.human+=d.human||0,o.agent+=d.agent||0,o.share+=d.share||0);return o.human||o.agent||o.share?o:null}function Xi(n){return(n.human||0)+(n.agent||0)+(n.share||0)}function Hs(n){const l=Xi(n);if(!l)return"";let i=l+(l===1?" read":" reads");return n.agent&&(i+=" ("+n.agent+" agent)"),i}function UO(n){const l=Xi(n);return l?l<3?1:l<10?2:l<30?3:4:0}function BO(n){return h.jsx("nav",{id:"tree","aria-label":"Files",children:n.root&&h.jsx(Ox,{nodes:n.root.children||[],...n})})}function Ox({nodes:n,...l}){return h.jsx("ul",{children:n.map(i=>h.jsx(qO,{node:i,...l},i.path))})}function qO({node:n,...l}){const{expanded:i,onToggle:o,currentPath:c,listingShowing:d,onOpen:f}=l,v=n.dir?i.has(n.path):!1,g=()=>{if(n.dir&&c===n.path&&d){o(n.path);return}f(n.path),n.dir||Mn()};return h.jsxs("li",{className:(n.dir?"dir":"file")+(n.dir&&!v?" collapsed":""),children:[h.jsxs("div",{className:"row"+(c===n.path?" active":""),"data-path":n.path,tabIndex:0,role:"button",title:n.name,"aria-expanded":n.dir?v:void 0,onClick:g,onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),g())},children:[h.jsx("span",{className:"chev",onClick:m=>{n.dir&&(m.stopPropagation(),o(n.path))},children:h.jsx(gt,{name:"chevd"})}),h.jsx("span",{className:"ticon",children:h.jsx(gt,{name:n.dir?"folder":"doc"})}),h.jsx("span",{className:"label",children:n.name})]}),n.dir&&h.jsx(Ox,{nodes:n.children||[],...l})]})}function GO(n){const l=n.split("/"),i=[];let o="";for(let c=0;c {o=o?o+"/"+c:c;const f=o,v=d===i.length-1;return h.jsxs("span",{children:[d>0&&h.jsx("span",{className:"crumb-sep",children:"/"}),v?h.jsx("span",{children:c}):h.jsx("span",{className:"crumb-seg",title:f,onClick:()=>l(f),children:c})]},f)})})}const YO={add:"plus",edit:"edit",delete:"x"},IO={add:"added",edit:"edited",delete:"deleted"};function Nx({entry:n,onOpen:l}){const[i,o]=y.useState(!1),c=n.kind==="put"?"edit":n.kind,d=n.user_name?`${n.user_name} <${n.user}>`:n.user||n.author||"unknown",f=[n.device.name||n.device.id,n.device.os,n.device.ip].filter(Boolean).join(" · "),v=c!=="delete",g=m=>{m.target.tagName!=="A"&&v&&l(n.path)};return h.jsxs("div",{className:"hentry "+c+(v?" clickable":""),tabIndex:v?0:void 0,role:v?"button":void 0,onClick:g,onKeyDown:m=>{v&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),l(n.path))},children:[h.jsxs("div",{className:"hline",children:[h.jsx("span",{className:"hkind",children:h.jsx(gt,{name:YO[c]||"dot"})}),h.jsx("span",{className:"hpath",children:n.path}),h.jsx("span",{className:"htag",children:IO[c]||c}),h.jsx("span",{className:"htime",children:new Date(n.time).toLocaleString()})]}),h.jsxs("div",{className:"hmeta",children:[h.jsx("span",{className:"hwho",children:d}),h.jsx("span",{className:"hdev",children:f}),h.jsx("span",{className:"hsize",children:n.size?Rx(n.size):""})]}),n.note&&h.jsx("div",{className:"hnote"+(i?" open":""),tabIndex:0,role:"button",title:i?"Collapse note":"Show full note","aria-expanded":i,onClick:m=>{m.stopPropagation(),m.target.tagName!=="A"&&o(!i)},onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),m.stopPropagation(),o(!i))},children:n.note.split(/(https?:\/\/\S+)/).map((m,x)=>/^https?:\/\//.test(m)?h.jsx("a",{href:m,target:"_blank",rel:"noopener",children:m},x):m)})]})}function QO(n){const{node:l,heatMap:i,onOpen:o}=n,c=(l.children||[]).slice().sort((m,x)=>Number(x.dir||!1)-Number(m.dir||!1)||m.name.localeCompare(x.name)),d=c.filter(m=>m.dir).length,f=c.length-d,v=[];d&&v.push(d+(d===1?" folder":" folders")),f&&v.push(f+(f===1?" file":" files"));const g=by(i,l.path,!0);return g&&v.push(Hs(g)+" in 30 days"),h.jsxs("div",{className:"dirlist",children:[h.jsxs("h1",{className:"dl-title",children:[h.jsx("span",{className:"dl-title-icon",children:h.jsx(gt,{name:"folder"})}),h.jsx("span",{children:l.name})]}),h.jsx("p",{className:"dl-sub",children:v.join(" · ")||"Empty folder"}),c.length===0?h.jsx("div",{className:"dl-empty",children:"Nothing in this folder yet."}):h.jsx("div",{className:"dl-items",children:c.map(m=>{let x="";if(m.dir){const S=(m.children||[]).length;x=S+(S===1?" item":" items")}else x=[m.size?Rx(m.size):"",m.time?new Date(m.time).toLocaleDateString():""].filter(Boolean).join(" · ");const p=by(i,m.path,!!m.dir);return p&&(x=Hs(p)+(x?" · "+x:"")),h.jsxs("div",{className:"dl-row",tabIndex:0,role:"button",title:m.path,onClick:()=>o(m.path),onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),o(m.path))},children:[h.jsx("span",{className:"ticon",children:h.jsx(gt,{name:m.dir?"folder":"doc"})}),h.jsx("span",{className:"dl-name",children:m.name}),p&&h.jsx("span",{className:"heatdot lvl"+UO(p),title:Hs(p)+" in 30 days"}),h.jsx("span",{className:"dl-meta",children:x})]},m.path)})}),n.hub&&h.jsx(PO,{apiBase:n.apiBase,prefix:l.path+"/",onOpen:o,onFullHistory:()=>n.onFullHistory(l.path+"/"),onRendered:n.onRendered})]})}function PO(n){const l=HO(n.apiBase,n.prefix,!0),{onRendered:i}=n;return y.useEffect(()=>{l&&l.length&&i&&i()},[l,i]),!l||l.length===0?null:h.jsxs("div",{className:"dl-history",children:[h.jsx("h3",{className:"dl-h3",children:"Recent changes"}),h.jsx("div",{className:"history dl-hlist",children:l.map((o,c)=>h.jsx(Nx,{entry:o,onOpen:n.onOpen},c))}),h.jsx("button",{className:"ai-btn dl-more",onClick:n.onFullHistory,children:"Full history"})]})}function KO(n){const{apiBase:l,path:i,onMeta:o}=n,c=l+"file?path="+encodeURIComponent(i);return y.useEffect(()=>()=>o(""),[i,o]),hO.test(i)?h.jsx(FO,{...n}):pO.test(i)?h.jsx("iframe",{className:"htmlview",sandbox:"allow-scripts",src:c,title:i,onLoad:n.onRendered}):mO.test(i)?h.jsx($O,{src:c,alt:i,onRendered:n.onRendered}):vO.test(i)?h.jsx(JO,{...n,fileURL:c}):h.jsxs("div",{className:"filecard",children:[h.jsx("div",{className:"name",children:i.split("/").pop()}),h.jsx("p",{children:"No preview for this file type."}),h.jsx("a",{className:"btn",download:!0,href:l+"download?path="+encodeURIComponent(i),children:"Download"})]})}function FO(n){const{apiBase:l,path:i,heatMap:o,flatFiles:c,onOpenFile:d,onMeta:f,onRendered:v}=n,{data:g,error:m}=Zt({queryKey:["render",l,i],queryFn:()=>on(l+"render?path="+encodeURIComponent(i))}),x=y.useMemo(()=>g?ZO(g.html,i,l):"",[g,i,l]);return y.useEffect(()=>{if(!g)return;const p=[];g.author&&p.push(g.author+(g.device?" on "+g.device:"")),g.time&&p.push(new Date(g.time).toLocaleString());const S=o&&o[g.path];S&&Xi(S)&&p.push(Hs(S)+" / 30d"),f(p.join(" · ")),v?.()},[g,o,f,v]),m?h.jsxs("div",{className:"empty",children:["Could not load file: ",m.message]}):g?h.jsx("div",{dangerouslySetInnerHTML:{__html:x},onClick:p=>XO(p,i,c,d)}):null}function XO(n,l,i,o){const c=n.target.closest("a");if(!c||!n.currentTarget.contains(c))return;const d=c.getAttribute("href")||"",f=l.includes("/")?l.slice(0,l.lastIndexOf("/")):"";d.startsWith("wiki:")?(n.preventDefault(),WO(decodeURIComponent(d.slice(5)),i,o)):/^([a-z]+:|\/|#)/i.test(d)||(n.preventDefault(),o(Mx(f,decodeURIComponent(d))))}function ZO(n,l,i){const o=l.includes("/")?l.slice(0,l.lastIndexOf("/")):"",c=f=>i+"file?path="+encodeURIComponent(f),d=new DOMParser().parseFromString(n,"text/html");for(const f of d.querySelectorAll("img")){const v=f.getAttribute("src")||"";/^([a-z]+:|\/)/i.test(v)||f.setAttribute("src",c(Mx(o,v)))}for(const f of d.querySelectorAll("a")){const v=f.getAttribute("href")||"";/^https?:/i.test(v)&&(f.setAttribute("target","_blank"),f.setAttribute("rel","noopener"))}return d.body.innerHTML}function $O({src:n,alt:l,onRendered:i}){return h.jsx("img",{src:n,alt:l,onLoad:i})}function JO(n){const{path:l,fileURL:i,onRendered:o}=n,{data:c,error:d}=Zt({queryKey:["text",i],queryFn:async()=>{const f=await fetch(i);if(!f.ok)throw new Error(await f.text());return f.text()}});return y.useEffect(()=>{c!=null&&o?.()},[c,o]),d?h.jsxs("div",{className:"empty",children:["Could not load file: ",d.message]}):c==null?null:h.jsx("pre",{className:"plain",children:c},l)}function WO(n,l,i){const o=n.toLowerCase(),c=l.find(d=>d.path.toLowerCase()===o||d.path.toLowerCase()===o+".md")||l.find(d=>{const f=d.name.toLowerCase();return f===o||f===o+".md"});c&&i(c.path)}function eN({url:n,copied:l,onClose:i}){const o=n.split("/s/")[1];return h.jsx(mh,{open:!0,onOpenChange:c=>!c&&i(),children:h.jsxs(ph,{className:"modal",showCloseButton:!1,children:[h.jsx(mc,{asChild:!0,children:h.jsx("h3",{children:"Public link created"})}),h.jsxs("p",{children:[h.jsx("b",{children:"Anyone with this link can view this file"})," — no account needed. It always shows the latest version until you revoke it."]}),h.jsx("div",{className:"modal-url",children:n}),h.jsxs("div",{className:"modal-actions",children:[h.jsx(rn,{variant:"primary",onClick:()=>Fi(n).then(c=>He(c?"Copied.":"Select and copy the link above.")),children:l?"Copied ✓":"Copy link"}),h.jsx(rn,{variant:"subtle",onClick:()=>window.open(n,"_blank"),children:"Open"}),h.jsx(rn,{variant:"subtle",className:"ai-del",onClick:async()=>{try{await Ba("DELETE","/api/shares/"+o),He("Link revoked — it no longer works."),i()}catch(c){He(c.message,!0)}},children:"Revoke"}),h.jsx(rn,{variant:"subtle",onClick:i,children:"Done"})]})]})})}var xy=1,tN=.9,nN=.8,aN=.17,Zd=.1,$d=.999,lN=.9999,rN=.99,iN=/[\\\/_+.#"@\[\(\{&]/,oN=/[\\\/_+.#"@\[\(\{&]/g,sN=/[\s-]/,_x=/[\s-]/g;function Cf(n,l,i,o,c,d,f){if(d===l.length)return c===n.length?xy:rN;var v=`${c},${d}`;if(f[v]!==void 0)return f[v];for(var g=o.charAt(d),m=i.indexOf(g,c),x=0,p,S,T,E;m>=0;)p=Cf(n,l,i,o,m+1,d+1,f),p>x&&(m===c?p*=xy:iN.test(n.charAt(m-1))?(p*=nN,T=n.slice(c,m-1).match(oN),T&&c>0&&(p*=Math.pow($d,T.length))):sN.test(n.charAt(m-1))?(p*=tN,E=n.slice(c,m-1).match(_x),E&&c>0&&(p*=Math.pow($d,E.length))):(p*=aN,c>0&&(p*=Math.pow($d,m-c))),n.charAt(m)!==l.charAt(d)&&(p*=lN)),(p p&&(p=S*Zd)),p>x&&(x=p),m=i.indexOf(g,m+1);return f[v]=x,x}function Sy(n){return n.toLowerCase().replace(_x," ")}function cN(n,l,i){return n=i&&i.length>0?`${n+" "+i.join(" ")}`:n,Cf(n,l,Sy(n),Sy(l),0,0,{})}var zi='[cmdk-group=""]',Jd='[cmdk-group-items=""]',uN='[cmdk-group-heading=""]',Dx='[cmdk-item=""]',wy=`${Dx}:not([aria-disabled="true"])`,Tf="cmdk-item-select",Er="data-value",dN=(n,l,i)=>cN(n,l,i),zx=y.createContext(void 0),ro=()=>y.useContext(zx),kx=y.createContext(void 0),yh=()=>y.useContext(kx),Lx=y.createContext(void 0),Hx=y.forwardRef((n,l)=>{let i=Cr(()=>{var j,L;return{search:"",value:(L=(j=n.value)!=null?j:n.defaultValue)!=null?L:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),o=Cr(()=>new Set),c=Cr(()=>new Map),d=Cr(()=>new Map),f=Cr(()=>new Set),v=Ux(n),{label:g,children:m,value:x,onValueChange:p,filter:S,shouldFilter:T,loop:E,disablePointerSelection:C=!1,vimBindings:R=!0,...M}=n,z=Ot(),D=Ot(),Y=Ot(),K=y.useRef(null),q=wN();Ml(()=>{if(x!==void 0){let j=x.trim();i.current.value=j,V.emit()}},[x]),Ml(()=>{q(6,ue)},[]);let V=y.useMemo(()=>({subscribe:j=>(f.current.add(j),()=>f.current.delete(j)),snapshot:()=>i.current,setState:(j,L,Q)=>{var I,te,Z,ae;if(!Object.is(i.current[j],L)){if(i.current[j]=L,j==="search")ce(),se(),q(1,le);else if(j==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let re=document.getElementById(Y);re?re.focus():(I=document.getElementById(z))==null||I.focus()}if(q(7,()=>{var re;i.current.selectedItemId=(re=ve())==null?void 0:re.id,V.emit()}),Q||q(5,ue),((te=v.current)==null?void 0:te.value)!==void 0){let re=L??"";(ae=(Z=v.current).onValueChange)==null||ae.call(Z,re);return}}V.emit()}},emit:()=>{f.current.forEach(j=>j())}}),[]),B=y.useMemo(()=>({value:(j,L,Q)=>{var I;L!==((I=d.current.get(j))==null?void 0:I.value)&&(d.current.set(j,{value:L,keywords:Q}),i.current.filtered.items.set(j,oe(L,Q)),q(2,()=>{se(),V.emit()}))},item:(j,L)=>(o.current.add(j),L&&(c.current.has(L)?c.current.get(L).add(j):c.current.set(L,new Set([j]))),q(3,()=>{ce(),se(),i.current.value||le(),V.emit()}),()=>{d.current.delete(j),o.current.delete(j),i.current.filtered.items.delete(j);let Q=ve();q(4,()=>{ce(),Q?.getAttribute("id")===j&&le(),V.emit()})}),group:j=>(c.current.has(j)||c.current.set(j,new Set),()=>{d.current.delete(j),c.current.delete(j)}),filter:()=>v.current.shouldFilter,label:g||n["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:z,inputId:Y,labelId:D,listInnerRef:K}),[]);function oe(j,L){var Q,I;let te=(I=(Q=v.current)==null?void 0:Q.filter)!=null?I:dN;return j?te(j,i.current.search,L):0}function se(){if(!i.current.search||v.current.shouldFilter===!1)return;let j=i.current.filtered.items,L=[];i.current.filtered.groups.forEach(I=>{let te=c.current.get(I),Z=0;te.forEach(ae=>{let re=j.get(ae);Z=Math.max(re,Z)}),L.push([I,Z])});let Q=K.current;de().sort((I,te)=>{var Z,ae;let re=I.getAttribute("id"),xe=te.getAttribute("id");return((Z=j.get(xe))!=null?Z:0)-((ae=j.get(re))!=null?ae:0)}).forEach(I=>{let te=I.closest(Jd);te?te.appendChild(I.parentElement===te?I:I.closest(`${Jd} > *`)):Q.appendChild(I.parentElement===Q?I:I.closest(`${Jd} > *`))}),L.sort((I,te)=>te[1]-I[1]).forEach(I=>{var te;let Z=(te=K.current)==null?void 0:te.querySelector(`${zi}[${Er}="${encodeURIComponent(I[0])}"]`);Z?.parentElement.appendChild(Z)})}function le(){let j=de().find(Q=>Q.getAttribute("aria-disabled")!=="true"),L=j?.getAttribute(Er);V.setState("value",L||void 0)}function ce(){var j,L,Q,I;if(!i.current.search||v.current.shouldFilter===!1){i.current.filtered.count=o.current.size;return}i.current.filtered.groups=new Set;let te=0;for(let Z of o.current){let ae=(L=(j=d.current.get(Z))==null?void 0:j.value)!=null?L:"",re=(I=(Q=d.current.get(Z))==null?void 0:Q.keywords)!=null?I:[],xe=oe(ae,re);i.current.filtered.items.set(Z,xe),xe>0&&te++}for(let[Z,ae]of c.current)for(let re of ae)if(i.current.filtered.items.get(re)>0){i.current.filtered.groups.add(Z);break}i.current.filtered.count=te}function ue(){var j,L,Q;let I=ve();I&&(((j=I.parentElement)==null?void 0:j.firstChild)===I&&((Q=(L=I.closest(zi))==null?void 0:L.querySelector(uN))==null||Q.scrollIntoView({block:"nearest"})),I.scrollIntoView({block:"nearest"}))}function ve(){var j;return(j=K.current)==null?void 0:j.querySelector(`${Dx}[aria-selected="true"]`)}function de(){var j;return Array.from(((j=K.current)==null?void 0:j.querySelectorAll(wy))||[])}function N(j){let L=de()[j];L&&V.setState("value",L.getAttribute(Er))}function F(j){var L;let Q=ve(),I=de(),te=I.findIndex(ae=>ae===Q),Z=I[te+j];(L=v.current)!=null&&L.loop&&(Z=te+j<0?I[I.length-1]:te+j===I.length?I[0]:I[te+j]),Z&&V.setState("value",Z.getAttribute(Er))}function W(j){let L=ve(),Q=L?.closest(zi),I;for(;Q&&!I;)Q=j>0?xN(Q,zi):SN(Q,zi),I=Q?.querySelector(wy);I?V.setState("value",I.getAttribute(Er)):F(j)}let ee=()=>N(de().length-1),$=j=>{j.preventDefault(),j.metaKey?ee():j.altKey?W(1):F(1)},A=j=>{j.preventDefault(),j.metaKey?N(0):j.altKey?W(-1):F(-1)};return y.createElement(Ce.div,{ref:l,tabIndex:-1,...M,"cmdk-root":"",onKeyDown:j=>{var L;(L=M.onKeyDown)==null||L.call(M,j);let Q=j.nativeEvent.isComposing||j.keyCode===229;if(!(j.defaultPrevented||Q))switch(j.key){case"n":case"j":{R&&j.ctrlKey&&$(j);break}case"ArrowDown":{$(j);break}case"p":case"k":{R&&j.ctrlKey&&A(j);break}case"ArrowUp":{A(j);break}case"Home":{j.preventDefault(),N(0);break}case"End":{j.preventDefault(),ee();break}case"Enter":{j.preventDefault();let I=ve();if(I){let te=new Event(Tf);I.dispatchEvent(te)}}}}},y.createElement("label",{"cmdk-label":"",htmlFor:B.inputId,id:B.labelId,style:CN},g),vc(n,j=>y.createElement(kx.Provider,{value:V},y.createElement(zx.Provider,{value:B},j))))}),fN=y.forwardRef((n,l)=>{var i,o;let c=Ot(),d=y.useRef(null),f=y.useContext(Lx),v=ro(),g=Ux(n),m=(o=(i=g.current)==null?void 0:i.forceMount)!=null?o:f?.forceMount;Ml(()=>{if(!m)return v.item(c,f?.id)},[m]);let x=Bx(c,d,[n.value,n.children,d],n.keywords),p=yh(),S=Qa(q=>q.value&&q.value===x.current),T=Qa(q=>m||v.filter()===!1?!0:q.search?q.filtered.items.get(c)>0:!0);y.useEffect(()=>{let q=d.current;if(!(!q||n.disabled))return q.addEventListener(Tf,E),()=>q.removeEventListener(Tf,E)},[T,n.onSelect,n.disabled]);function E(){var q,V;C(),(V=(q=g.current).onSelect)==null||V.call(q,x.current)}function C(){p.setState("value",x.current,!0)}if(!T)return null;let{disabled:R,value:M,onSelect:z,forceMount:D,keywords:Y,...K}=n;return y.createElement(Ce.div,{ref:Or(d,l),...K,id:c,"cmdk-item":"",role:"option","aria-disabled":!!R,"aria-selected":!!S,"data-disabled":!!R,"data-selected":!!S,onPointerMove:R||v.getDisablePointerSelection()?void 0:C,onClick:R?void 0:E},n.children)}),hN=y.forwardRef((n,l)=>{let{heading:i,children:o,forceMount:c,...d}=n,f=Ot(),v=y.useRef(null),g=y.useRef(null),m=Ot(),x=ro(),p=Qa(T=>c||x.filter()===!1?!0:T.search?T.filtered.groups.has(f):!0);Ml(()=>x.group(f),[]),Bx(f,v,[n.value,n.heading,g]);let S=y.useMemo(()=>({id:f,forceMount:c}),[c]);return y.createElement(Ce.div,{ref:Or(v,l),...d,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},i&&y.createElement("div",{ref:g,"cmdk-group-heading":"","aria-hidden":!0,id:m},i),vc(n,T=>y.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":i?m:void 0},y.createElement(Lx.Provider,{value:S},T))))}),mN=y.forwardRef((n,l)=>{let{alwaysRender:i,...o}=n,c=y.useRef(null),d=Qa(f=>!f.search);return!i&&!d?null:y.createElement(Ce.div,{ref:Or(c,l),...o,"cmdk-separator":"",role:"separator"})}),pN=y.forwardRef((n,l)=>{let{onValueChange:i,...o}=n,c=n.value!=null,d=yh(),f=Qa(m=>m.search),v=Qa(m=>m.selectedItemId),g=ro();return y.useEffect(()=>{n.value!=null&&d.setState("search",n.value)},[n.value]),y.createElement(Ce.input,{ref:l,...o,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":g.listId,"aria-labelledby":g.labelId,"aria-activedescendant":v,id:g.inputId,type:"text",value:c?n.value:f,onChange:m=>{c||d.setState("search",m.target.value),i?.(m.target.value)}})}),vN=y.forwardRef((n,l)=>{let{children:i,label:o="Suggestions",...c}=n,d=y.useRef(null),f=y.useRef(null),v=Qa(m=>m.selectedItemId),g=ro();return y.useEffect(()=>{if(f.current&&d.current){let m=f.current,x=d.current,p,S=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let T=m.offsetHeight;x.style.setProperty("--cmdk-list-height",T.toFixed(1)+"px")})});return S.observe(m),()=>{cancelAnimationFrame(p),S.unobserve(m)}}},[]),y.createElement(Ce.div,{ref:Or(d,l),...c,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":o,id:g.listId},vc(n,m=>y.createElement("div",{ref:Or(f,g.listInnerRef),"cmdk-list-sizer":""},m)))}),gN=y.forwardRef((n,l)=>{let{open:i,onOpenChange:o,overlayClassName:c,contentClassName:d,container:f,...v}=n;return y.createElement(Lf,{open:i,onOpenChange:o},y.createElement(Uf,{container:f},y.createElement(Bf,{"cmdk-overlay":"",className:c}),y.createElement(qf,{"aria-label":n.label,"cmdk-dialog":"",className:d},y.createElement(Hx,{ref:l,...v}))))}),yN=y.forwardRef((n,l)=>Qa(i=>i.filtered.count===0)?y.createElement(Ce.div,{ref:l,...n,"cmdk-empty":"",role:"presentation"}):null),bN=y.forwardRef((n,l)=>{let{progress:i,children:o,label:c="Loading...",...d}=n;return y.createElement(Ce.div,{ref:l,...d,"cmdk-loading":"",role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,"aria-label":c},vc(n,f=>y.createElement("div",{"aria-hidden":!0},f)))}),pc=Object.assign(Hx,{List:vN,Item:fN,Input:pN,Group:hN,Separator:mN,Dialog:gN,Empty:yN,Loading:bN});function xN(n,l){let i=n.nextElementSibling;for(;i;){if(i.matches(l))return i;i=i.nextElementSibling}}function SN(n,l){let i=n.previousElementSibling;for(;i;){if(i.matches(l))return i;i=i.previousElementSibling}}function Ux(n){let l=y.useRef(n);return Ml(()=>{l.current=n}),l}var Ml=typeof window>"u"?y.useEffect:y.useLayoutEffect;function Cr(n){let l=y.useRef();return l.current===void 0&&(l.current=n()),l}function Qa(n){let l=yh(),i=()=>n(l.snapshot());return y.useSyncExternalStore(l.subscribe,i,i)}function Bx(n,l,i,o=[]){let c=y.useRef(),d=ro();return Ml(()=>{var f;let v=(()=>{var m;for(let x of i){if(typeof x=="string")return x.trim();if(typeof x=="object"&&"current"in x)return x.current?(m=x.current.textContent)==null?void 0:m.trim():c.current}})(),g=o.map(m=>m.trim());d.value(n,v,g),(f=l.current)==null||f.setAttribute(Er,v),c.current=v}),c}var wN=()=>{let[n,l]=y.useState(),i=Cr(()=>new Map);return Ml(()=>{i.current.forEach(o=>o()),i.current=new Map},[n]),(o,c)=>{i.current.set(o,c),l({})}};function EN(n){let l=n.type;return typeof l=="function"?l(n.props):"render"in l?l.render(n.props):n}function vc({asChild:n,children:l},i){return n&&y.isValidElement(l)?y.cloneElement(EN(l),{ref:l.ref},i(l.props.children)):i(l)}var CN={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function TN({className:n,...l}){return h.jsx(pc,{"data-slot":"command",className:bt("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",n),...l})}function RN({className:n,...l}){return h.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[h.jsx(vx,{className:"size-4 shrink-0 opacity-50"}),h.jsx(pc.Input,{"data-slot":"command-input",className:bt("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",n),...l})]})}function MN({className:n,...l}){return h.jsx(pc.List,{"data-slot":"command-list",className:bt("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",n),...l})}function jN({className:n,...l}){return h.jsx(pc.Item,{"data-slot":"command-item",className:bt("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",n),...l})}function Ey(n,l){if(!n)return{score:0,hits:[]};const i=n.toLowerCase(),o=l.toLowerCase();let c=0,d=0,f=0;const v=[];for(let g=0;g 3&&o.endsWith("ies")?c=o.slice(0,-3)+"y":o.length>3&&o.endsWith("es")?c=o.slice(0,-2):o.length>2&&o.endsWith("s")&&(c=o.slice(0,-1)),c?Ey(c,l):null}function ON({text:n,hits:l}){const i=[];let o=0;return l.forEach((c,d)=>{c>o&&i.push(n.slice(o,c)),i.push(h.jsx("b",{children:n[c]},d)),o=c+1}),i.push(n.slice(o)),h.jsx("span",{className:"plabel",children:i})}function NN({open:n,onClose:l,candidates:i}){const[o,c]=y.useState(""),d=y.useMemo(()=>{if(!n)return[];const v=[];for(const g of i()){const m=AN(o,g.label);m&&v.push({...g,score:m.score,hits:m.hits})}return v.sort((g,m)=>m.score-g.score),v.slice(0,40)},[n,o,i]);y.useEffect(()=>{n&&c("")},[n]);const f=v=>{l(),v.run()};return h.jsx(mh,{open:n,onOpenChange:v=>!v&&l(),children:h.jsxs(ph,{id:"palette",className:"palette",showCloseButton:!1,"aria-describedby":void 0,children:[h.jsx(mc,{className:"sr-only",children:"Search and quick actions"}),h.jsxs(TN,{shouldFilter:!1,loop:!0,children:[h.jsxs("div",{id:"palette-inputwrap",children:[h.jsx(gt,{name:"search"}),h.jsx(RN,{id:"palette-input",placeholder:"Search file names, projects, actions…",autoComplete:"off",spellCheck:!1,value:o,onValueChange:c})]}),h.jsx(MN,{id:"palette-results",children:d.length===0?h.jsx("div",{className:"pempty",children:"No matches — search covers file names, projects, and actions"}):d.map(v=>h.jsxs(jN,{value:v.kind+":"+v.label,onSelect:()=>f(v),children:[h.jsx("span",{className:"picon",children:h.jsx(gt,{name:v.icon})}),h.jsx(ON,{text:v.label,hits:v.hits}),h.jsx("span",{className:"pkind",children:v.kind})]},v.kind+":"+v.label))}),h.jsx("footer",{id:"palette-hint",children:"↑↓ navigate · ⏎ select · esc close"})]})]})})}const Hi=3,Tr=30;function _N(n,l){return Zt({queryKey:["heatDevices",n],queryFn:()=>on(n+"heat?by=device&days=30"),enabled:l,retry:!1,staleTime:6e4}).data?.devices??null}function Cy(n){const[l,i]=y.useState("all"),{flatFiles:o,heatMap:c,devices:d,scope:f}=n,v=S=>!f||S===f||S.startsWith(f+"/"),g=f?o.filter(S=>v(S.path)):o,m=d&&f?d.map(S=>{const T={};for(const[E,C]of Object.entries(S.folders||{}))v(E)&&(T[E]=C);return{...S,folders:T}}).filter(S=>Object.keys(S.folders).length>0):d,x=Date.now(),p=g.map(S=>{const T=c&&c[S.path]||{},E=S.time?Math.max(0,(x-new Date(S.time).getTime())/864e5):0,C=l==="all"?Xi(T):T[l]||0;return{path:S.path,reads:C,agent:T.agent||0,total:Xi(T),days:E,danger:C>=Hi&&E>=Tr}});return h.jsxs("div",{className:"insights",children:[h.jsxs("h1",{className:"in-title",children:["Knowledge insights",f?h.jsxs("span",{className:"in-scope",children:[" · ",f]}):null]}),h.jsx("p",{className:"dl-sub",children:f?`Reads over the last 30 days × freshness, for ${f} and everything in it.`:"Reads over the last 30 days × how long since each file changed. Hot but stale knowledge — read a lot, maintained by nobody — is the danger zone."}),h.jsx("div",{className:"in-lens",children:["all","human","agent"].map(S=>h.jsx("button",{className:"in-lens-btn"+(S===l?" active":""),onClick:()=>i(S),children:S==="all"?"All reads":S==="human"?"Human reads":"Agent reads"},S))}),h.jsx("h3",{className:"dl-h3",children:"Map — cell size = reads, color = freshness"}),h.jsx(zN,{pts:p,onOpenFile:n.onOpenFile,onOpenFolder:n.onOpenFolder,isFolder:n.isFolder}),h.jsx("h3",{className:"dl-h3",children:"Reads × freshness"}),h.jsx(kN,{pts:p,onOpenFile:n.onOpenFile}),h.jsx("h3",{className:"dl-h3",children:"Hot path — top files by reads"}),h.jsx(LN,{pts:p,lens:l,onOpenFile:n.onOpenFile}),m&&m.length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h3",{className:"dl-h3",children:"Agent coverage — which agents read which areas"}),h.jsx(HN,{devices:m})]})]})}function DN(n){const l=[[76,195,138],[232,196,84],[224,93,93]],i=Math.min(1,Math.max(0,n/300))*(l.length-1),o=Math.min(l.length-2,Math.floor(i)),c=i-o,d=l[o].map((f,v)=>Math.round(f+(l[o+1][v]-f)*c));return`rgb(${d[0]},${d[1]},${d[2]})`}function Ty(n,l,i,o,c){const d=n.reduce((m,x)=>m+x.value,0);if(!d||o<=0||c<=0)return[];const f=n.slice().sort((m,x)=>x.value-m.value).map(m=>({it:m,a:m.value/d*o*c})),v=(m,x)=>{const S=m.reduce((E,C)=>E+C.a,0)/x;let T=0;for(const E of m){const C=E.a/S;T=Math.max(T,C/S,S/C)}return T},g=[];for(;f.length;){const m=o>=c,x=m?c:o,p=[f.shift()];for(;f.length&&v(p.concat(f[0]),x)<=v(p,x);)p.push(f.shift());const S=p.reduce((E,C)=>E+C.a,0)/x;let T=0;for(const E of p){const C=E.a/S;m?g.push({item:E.it,x:l,y:i+T,w:S,h:C}):g.push({item:E.it,x:l+T,y:i,w:C,h:S}),T+=C}m?(l+=S,o-=S):(i+=S,c-=S)}return g}const Wd=15;function zN({pts:n,onOpenFile:l,onOpenFolder:i,isFolder:o}){const f=new Map;for(const g of n){const m=g.path.includes("/")?g.path.split("/")[0]:"/";let x=f.get(m);x||f.set(m,x={name:m,files:[],value:0}),x.files.push(g),x.value+=g.reads+1}const v=[];for(const g of Ty([...f.values()],0,0,720,480)){const m=g.item,x=m.name==="/"?"":m.name;if(v.push(h.jsx("rect",{x:g.x+1,y:g.y+1,width:Math.max(0,g.w-2),height:Math.max(0,g.h-2),rx:3,className:"in-tm-group","data-dir":x},"g"+m.name)),g.w>46&&g.h>Wd+10){let S=m.name==="/"?"(root)":m.name;const T=Math.floor((g.w-8)/6);S.length>T&&(S=S.slice(0,Math.max(1,T-1))+"…"),v.push(h.jsx("text",{x:g.x+5,y:g.y+12,className:"in-tm-glabel","data-dir":x,children:S},"gl"+m.name))}const p=Ty(m.files.map(S=>({...S,name:S.path.split("/").pop(),value:S.reads+1})),g.x+2,g.y+Wd,Math.max(0,g.w-4),Math.max(0,g.h-Wd-2));for(const S of p)if(v.push(h.jsx("rect",{x:S.x+.6,y:S.y+.6,width:Math.max(.4,S.w-1.2),height:Math.max(.4,S.h-1.2),rx:1.5,fill:DN(S.item.days),className:"in-tm-cell","data-path":S.item.path,children:h.jsx("title",{children:`${S.item.path} — ${S.item.reads} read${S.item.reads===1?"":"s"}/30d · changed ${Math.round(S.item.days)}d ago`})},S.item.path)),S.w>54&&S.h>16){const T=Math.floor((S.w-8)/6);let E=(S.item.danger?"⚠ ":"")+S.item.name;E.length>T&&(E=E.slice(0,Math.max(1,T-1))+"…"),T>=5&&v.push(h.jsx("text",{x:S.x+4.5,y:S.y+12.5,className:"in-tm-label","data-path":S.item.path,children:E},"l"+S.item.path))}}return h.jsx("svg",{viewBox:"0 0 720 480",className:"in-chart in-treemap",onClick:g=>{const m=g.target.closest("[data-path], [data-dir]");if(!m)return;const x=m.getAttribute("data-path");if(x)return l(x);const p=m.getAttribute("data-dir");p&&o(p)&&i(p)},children:v})}function kN({pts:n,onOpenFile:l}){const c={l:44,r:16,t:20,b:34},d=Math.max(Tr*2,...n.map(p=>p.days)),f=Math.max(Hi*2,...n.map(p=>p.reads)),v=p=>Math.log10(p+1)/Math.log10(d+1),g=p=>Math.log10(p+1)/Math.log10(f+1),m=p=>c.l+v(p)*(720-c.l-c.r),x=p=>360-c.b-g(p)*(360-c.t-c.b);return h.jsxs("svg",{viewBox:"0 0 720 360",className:"in-chart",children:[h.jsx("rect",{x:m(Tr),y:c.t,width:720-c.r-m(Tr),height:x(Hi)-c.t,className:"in-danger-zone"}),h.jsx("line",{x1:m(Tr),y1:c.t,x2:m(Tr),y2:360-c.b,className:"in-threshold"}),h.jsx("line",{x1:c.l,y1:x(Hi),x2:720-c.r,y2:x(Hi),className:"in-threshold"}),h.jsx("line",{x1:c.l,y1:360-c.b,x2:720-c.r,y2:360-c.b,className:"in-axis"}),h.jsx("line",{x1:c.l,y1:c.t,x2:c.l,y2:360-c.b,className:"in-axis"}),h.jsx("text",{x:(c.l+720-c.r)/2,y:352,className:"in-label",children:"days since last change →"}),h.jsx("text",{x:12,y:(c.t+360-c.b)/2,className:"in-label",transform:`rotate(-90 12 ${(c.t+360-c.b)/2})`,children:"reads / 30d →"}),h.jsx("text",{x:720-c.r-6,y:c.t+14,className:"in-quad in-quad-danger",textAnchor:"end",children:"hot + stale"}),h.jsx("text",{x:c.l+6,y:c.t+14,className:"in-quad",children:"hot + fresh"}),h.jsx("text",{x:720-c.r-6,y:360-c.b-8,className:"in-quad",textAnchor:"end",children:"cold + stale"}),h.jsx("text",{x:720-c.r-6,y:c.t+28,className:"in-label",textAnchor:"end",children:"dot size = agent share of reads"}),n.map(p=>{const S=p.total?(p.agent||0)/p.total:0;return h.jsx("circle",{cx:Number(m(p.days).toFixed(1)),cy:Number(x(p.reads).toFixed(1)),r:Number((3+4*S).toFixed(1)),className:"in-pt"+(p.danger?" danger":p.reads?"":" cold"),onClick:()=>l(p.path),children:h.jsx("title",{children:`${p.path} — ${p.reads} read${p.reads===1?"":"s"} / 30d · changed ${Math.round(p.days)}d ago`})},p.path)})]})}function LN({pts:n,lens:l,onOpenFile:i}){const o=n.filter(d=>d.reads>0).sort((d,f)=>f.reads-d.reads||f.days-d.days).slice(0,20);if(!o.length)return h.jsx("div",{className:"dl-empty",children:"No reads in the window yet."});const c=o[0].reads;return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"in-hotpath",children:o.map(d=>{const f=l==="agent"?1:l==="human"?0:d.total?d.agent/d.total:0,v=d.reads/c*100;return h.jsxs("div",{className:"in-hp-row",tabIndex:0,role:"button",title:d.danger?`${d.reads} read${d.reads===1?"":"s"}/30d · unchanged ${Math.round(d.days)}d — review this file`:d.path,onClick:()=>i(d.path),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),i(d.path))},children:[h.jsx("span",{className:"in-hp-name"+(d.danger?" danger":""),children:d.path+(d.danger?" ⚠":"")}),h.jsxs("span",{className:"in-hp-bar",children:[h.jsx("span",{className:"in-hp-agent",style:{width:(v*f).toFixed(1)+"%"}}),h.jsx("span",{className:"in-hp-human",style:{width:(v*(1-f)).toFixed(1)+"%"}})]}),h.jsx("span",{className:"in-hp-count",children:d.reads})]},d.path)})}),h.jsxs("p",{className:"in-legend",children:[h.jsx("span",{className:"in-sw agent"})," agent reads ",h.jsx("span",{className:"in-sw human"})," human reads"]})]})}function HN({devices:n}){const l=new Map;for(const S of n)for(const[T,E]of Object.entries(S.folders||{}))l.set(T,(l.get(T)||0)+E);const i=[...l.entries()].sort((S,T)=>T[1]-S[1]).slice(0,12).map(S=>S[0]),o=n.slice(0,12),c=140,d=6,f=Math.min(76,Math.max(34,(720-c-8)/i.length)),v=26,g=720,m=d+o.length*v+58,x=Math.max(1,...o.flatMap(S=>i.map(T=>(S.folders||{})[T]||0))),p=S=>{const T=[23,25,31],E=[245,166,35],C=T.map((R,M)=>Math.round(R+(E[M]-R)*S));return`rgb(${C[0]},${C[1]},${C[2]})`};return h.jsxs("svg",{viewBox:`0 0 ${g} ${m}`,className:"in-chart in-matrix",children:[o.map((S,T)=>{let E=S.name||S.id||"";return E.length>20&&(E=E.slice(0,19)+"…"),h.jsxs("g",{children:[h.jsx("text",{x:c-8,y:d+T*v+17,textAnchor:"end",className:"in-label",children:E}),i.map((C,R)=>{const M=(S.folders||{})[C]||0;return h.jsx("rect",{x:c+R*f,y:d+T*v,width:f-4,height:v-4,rx:3,fill:p(Math.sqrt(M/x)),children:h.jsx("title",{children:`${S.name||S.id} × ${C||"(root)"}: ${M} read${M===1?"":"s"}/30d`})},C)})]},S.id||T)}),i.map((S,T)=>{const E=c+T*f+(f-4)/2,C=d+o.length*v+14;return h.jsx("text",{x:E,y:C,className:"in-label",textAnchor:"end",transform:`rotate(-28 ${E} ${C})`,children:S||"(root)"},S)})]})}function UN(n){const{apiBase:l,target:i,isFolder:o,onMeta:c,onRendered:d}=n,f=i?o(i)?{prefix:i+"/"}:{path:i}:{prefix:""},v="path"in f&&f.path!==void 0?"path="+encodeURIComponent(f.path):"prefix="+encodeURIComponent(f.prefix??""),{data:g,error:m}=Zt({queryKey:["history",l,v,200],queryFn:()=>on(l+"history?"+v+"&n=200"),staleTime:15e3});if(y.useEffect(()=>{m&&c("History unavailable: "+m.message)},[m,c]),y.useEffect(()=>{g&&d?.()},[g,d]),!g)return null;const x=g.entries||[];return h.jsxs("div",{className:"history",children:[x.length===0&&h.jsx("div",{className:"empty",children:"No history yet."}),x.map((p,S)=>h.jsx(Nx,{entry:p,onOpen:n.onOpen},S))]})}function BN(n,l){return n?l(n)?n+"/ (folder)":n:"all changes"}function qx(n){const{config:l,apiBase:i,route:o,hub:c,project:d}=n,f=gh(),v=$i(),{tree:g,flatFiles:m,dirIndex:x,loaded:p}=kO(i,!c||!!d),S=LO(i,c&&!!d&&!!l.reads?.enabled),T=c&&!!d&&!o.path&&!o.view,E=!!n.canInsights&&(o.view==="insights"||T),C=_N(i,E);y.useEffect(()=>{E&&v.invalidateQueries({queryKey:["heat",i]})},[E,i,v]);const R=o.path,M=R||(o.view==="insights"||o.view==="history")&&o.viewTarget||"",z=!!R&&x.has(R),D=!!R&&p&&!z&&m.some(Ee=>Ee.path===R),Y=!!R&&p&&!z&&!D,K=z&&!o.view,[q,V]=y.useState(()=>new Set),B=y.useRef(!0);y.useEffect(()=>{if(!g||!B.current)return;B.current=!1;const Ee=(g.children||[]).filter(ke=>ke.dir);Ee.length===1&&V(ke=>new Set(ke).add(Ee[0].path))},[g]),y.useEffect(()=>{if(!M||!p)return;V(ke=>{const Ae=new Set(ke);for(const sn of GO(M))Ae.add(sn);return x.has(M)&&Ae.add(M),Ae});const Ee=document.querySelector(`#tree .row[data-path="${CSS.escape(M)}"]`);Ee&&Ee.scrollIntoView({block:"nearest"})},[M,p,x]);const oe=y.useCallback(Ee=>{V(ke=>{const Ae=new Set(ke);return Ae.has(Ee)?Ae.delete(Ee):Ae.add(Ee),Ae})},[]),se=y.useRef(null),le=y.useRef(new Map),ce=y.useRef({key:"",want:0,attempts:0});y.useEffect(()=>{ce.current={key:f,want:dO()==="POP"?le.current.get(f)??0:0,attempts:0}},[f]);const ue=y.useCallback(()=>{const Ee=se.current,ke=ce.current;!Ee||ke.key!==f||ke.attempts>=3||(ke.attempts++,Ee.scrollTo({top:ke.want,behavior:"instant"}))},[f]),ve=y.useCallback(()=>{se.current&&le.current.set(f,se.current.scrollTop)},[f]),de=y.useCallback(Ee=>{Ft(uO(Ee,d?.id)),Mn()},[d?.id]),N=y.useCallback(Ee=>Ft(Rr("history",d?.id,Ee)),[d?.id]),[F,W]=y.useState(""),[ee,$]=y.useState(null),[A,j]=y.useState(!1),[L,Q]=y.useState(!1);y.useEffect(()=>uj(()=>Q(!0)),[]);const I=y.useRef(null),te=n.panel??null,Z=!te&&c&&!!d&&D,ae=!te&&c&&!!d,re=!te&&D,xe=!te&&(D||c&&!!d&&z),Re=i+"download?path="+encodeURIComponent(R),je=y.useCallback(async()=>{try{const Ee=await fetch(i+"shares",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:R})});if(!Ee.ok)throw new Error(await Ee.text());const ke=await Ee.json(),Ae=await Fi(ke.url);$({url:ke.url,copied:Ae})}catch(Ee){He("Share failed: "+Ee.message,!0)}},[i,R]),et=y.useCallback(()=>{if(!R)return N("");N(z?R+"/":R)},[R,z,N]);y.useEffect(()=>{const Ee=ke=>{(ke.metaKey||ke.ctrlKey)&&ke.key.toLowerCase()==="k"&&(ke.preventDefault(),Q(Ae=>!Ae))};return window.addEventListener("keydown",Ee),()=>window.removeEventListener("keydown",Ee)},[]);const Ge=y.useCallback(()=>{const Ee=[],ke=(Ae,sn,xt,Ur)=>Ee.push({icon:Ae,label:sn,kind:xt,run:Ur});if(c&&d&&R&&(D&&ke("share","Share: "+R,"action",je),ke("hist","History: "+R,"action",et),D&&ke("download","Download: "+R,"action",()=>I.current?.click())),c&&d&&ke("hist","History: whole project","action",()=>N("")),c)for(const Ae of n.projects||[])(!d||Ae.id!==d.id)&&ke("folder","Switch to project: "+Ae.name,"project",()=>Ft("/"+Ae.id));l.auth?.enabled&&ke("power","Sign out","action",()=>window.location.href="/auth/logout");for(const Ae of x.keys())ke("folder",Ae,"folder",()=>de(Ae));for(const Ae of m)ke("doc",Ae.path,"file",()=>de(Ae.path));return Ee},[c,d,R,D,l.auth?.enabled,x,m,n.projects,je,et,N,de]);y.useEffect(()=>{if(!A)return;const Ee=()=>j(!1);return document.addEventListener("click",Ee),()=>document.removeEventListener("click",Ee)},[A]);const kt=y.useCallback(Ee=>x.has(Ee),[x]);let ht="markdown",nt;te?(ht="view",nt=te.body):o.view==="insights"?(ht="view",nt=n.canInsights?h.jsx(Cy,{flatFiles:m,heatMap:S,devices:C,scope:o.viewTarget||"",onOpenFile:de,onOpenFolder:de,isFolder:kt}):h.jsx("div",{className:"empty",children:"Insights is for hub admins and org owners."})):o.view==="history"?(ht="view",nt=h.jsx(UN,{apiBase:i,target:o.viewTarget||"",isFolder:kt,onOpen:de,onMeta:W,onRendered:ue})):R?p?Y?(ht="view",nt=h.jsxs("div",{className:"notfound",children:[h.jsx("h1",{children:"Couldn't find that"}),h.jsxs("p",{children:[h.jsx("code",{children:R})," isn't in this project right now."]}),h.jsx("p",{className:"nf-sub",children:"If it was just created, it may still be uploading or syncing from a teammate's device — this page checks again automatically every few seconds, so refresh or come back in a moment."}),h.jsx("button",{className:"pbtn",onClick:()=>v.invalidateQueries({queryKey:["tree",i]}),children:"Check again"})]})):z?(ht="view",nt=h.jsx(QO,{node:x.get(R),heatMap:S,hub:c&&!!d,apiBase:i,onOpen:de,onFullHistory:N,onRendered:ue})):nt=h.jsx(KO,{apiBase:i,path:R,heatMap:S,flatFiles:m,onOpenFile:de,onMeta:W,onRendered:ue}):nt=h.jsx("div",{className:"empty",children:"Loading…"}):T?(ht="view",nt=h.jsxs(h.Fragment,{children:[h.jsx(Ax,{project:d}),n.canInsights&&h.jsx("div",{className:"home-insights",children:h.jsx(Cy,{flatFiles:m,heatMap:S,devices:C,onOpenFile:de,onOpenFolder:de,isFolder:kt})})]})):nt=h.jsx("div",{className:"empty",children:"Select a file to read it."});const $a=te?te.crumb:R?h.jsx(VO,{path:R,onOpenFolder:de}):o.view==="insights"?"Insights — "+(o.viewTarget||d?.name||""):o.view==="history"?"History — "+BN(o.viewTarget||"",kt):T?d.name:null,Nt=h.jsx(Ki,{crumb:$a,meta:F,actions:h.jsxs(h.Fragment,{children:[Z&&h.jsx(rn,{id:"share-btn",variant:"toolbar",className:"icon-only",title:"Share","aria-label":"Share",onClick:je,children:h.jsx(gt,{name:"share"})}),ae&&!R&&!o.view&&h.jsxs(rn,{id:"history-btn",variant:"toolbar",onClick:et,children:[h.jsx(gt,{name:"hist"})," ",h.jsx("span",{className:"lbl",children:"History"})]}),re&&h.jsx("a",{id:"download",hidden:!0,download:!0,href:Re,ref:I,children:"Download"}),xe&&h.jsx(rn,{id:"more-btn",variant:"toolbar",className:"icon-only",title:"More actions","aria-label":"More actions",onClick:Ee=>{Ee.stopPropagation(),j(!A)},children:h.jsx(gt,{name:"dots"})}),A&&h.jsxs("div",{id:"more-menu",role:"menu",children:[ae&&h.jsx("button",{className:"more-item",onClick:et,children:"History"}),re&&h.jsx("button",{className:"more-item",onClick:()=>I.current?.click(),children:"Download"}),n.canInsights&&h.jsx("button",{className:"more-item",onClick:()=>{n.onClosePanel?.(),Ft(Rr("insights",d?.id,R))},children:"Insights"})]})]})});return h.jsxs(h.Fragment,{children:[h.jsx(Pi,{vault:n.sidebar.vault,projectsNav:n.sidebar.projectsNav,orgBar:n.sidebar.orgBar,tree:h.jsx(BO,{root:g,expanded:q,onToggle:oe,currentPath:M,listingShowing:K,onOpen:de}),topbar:Nt,contentClass:ht,contentRef:se,onContentScroll:ve,children:nt}),ee&&h.jsx(eN,{url:ee.url,copied:ee.copied,onClose:()=>$(null)}),h.jsx(NN,{open:L,onClose:()=>Q(!1),candidates:Ge})]})}function qN({config:n}){const l=gh(),i=wx(),[o,c]=y.useState(null),[d,f]=y.useState(null);y.useEffect(()=>f(null),[l]);const v=y.useMemo(()=>{const q=l.match(/^\/join\/([0-9a-f]+)\/?$/);return q?q[1]:null},[l]),{data:g}=oO(!v),{data:m}=sO(!v),x=!!n.auth.admin,{data:p}=Sx(x),S=y.useMemo(()=>Cx(l,"hub"),[l]),T=y.useMemo(()=>g&&(g.find(q=>q.id===S.project)||o&&g.find(q=>q.org===o)||g[0])||null,[g,S.project,o]);if(y.useEffect(()=>{document.title=T?T.name+" — BearDrive":n.brand||n.volume||"BearDrive"},[T,n]),v)return h.jsx(GN,{token:v,onDone:async q=>{c(q),await i(),Ft("/",{replace:!0})}});const E=n.brand||n.volume||"BearDrive",C=T&&m?.find(q=>q.id===T.org)||null,R=x||(C?C.role==="owner":!1),M=h.jsx(hc,{name:E,onHome:()=>Ft("/"),search:!!T}),z=n.me?h.jsx(AO,{me:n.me,org:C,admin:x?{pending:p?.length||0,onClick:()=>{f({kind:"hub"}),Mn()}}:void 0,onOrgSettings:q=>{f({kind:"org",orgId:q.id}),Mn()}}):void 0;if(!g||!m)return h.jsx(Pi,{vault:M,topbar:h.jsx(Ki,{}),children:h.jsx("div",{className:"empty",children:"Loading…"})});if(!T)return h.jsx(Pi,{vault:M,projectsNav:h.jsx(yy,{projects:g}),orgBar:z,topbar:h.jsx(Ki,{}),contentClass:"view",children:h.jsx(zO,{authEnabled:n.auth.enabled,onCreate:async q=>{if(!q){He("Give the project a name.",!0);return}try{const V=await Ar("/api/projects",{name:q});await i(),Ft("/"+V.project.id),He(`Created “${V.project.name}”.`)}catch(V){He("Could not create the project: "+V.message,!0)}}})});const D=d?.kind==="org"?m.find(q=>q.id===d.orgId):null,Y=d?.kind==="hub"?{crumb:"Signup & access",body:h.jsx(yO,{})}:D?{crumb:D.name,body:h.jsx(gO,{org:D,projects:g,myEmail:n.me?.email||"",onProjectsChanged:i})}:null,K=S.view==="settings"?{crumb:"Project settings",body:h.jsx(OO,{project:T,org:C})}:S.view==="install"?{crumb:"Installation",body:h.jsx("div",{className:"onboard",children:h.jsx(Ax,{project:T})})}:null;return S.project!==T.id?h.jsx(fO,{to:"/"+T.id}):h.jsx(qx,{config:n,apiBase:"/api/p/"+T.id+"/",route:S,hub:!0,project:T,projects:g,canInsights:R,sidebar:{vault:M,projectsNav:h.jsx(yy,{projects:g,currentId:T.id,menu:{active:d?null:S.view==="insights"&&!S.viewTarget?"dashboard":S.view==="install"?"install":S.view==="history"&&!S.viewTarget?"history":S.view==="settings"?"settings":null,onDashboard:()=>{f(null),Ft(Rr("insights",T.id)),Mn()},onInstall:()=>{f(null),Ft(Rr("install",T.id)),Mn()},onHistory:()=>{f(null),Ft(Rr("history",T.id)),Mn()},onSettings:()=>{f(null),Ft(Rr("settings",T.id)),Mn()}}}),orgBar:z},panel:Y||K,onClosePanel:()=>f(null)},T.id)}function GN({token:n,onDone:l}){return y.useEffect(()=>{let i=!1;return Ar("/api/invites/"+n).then(o=>{i||(He(`Welcome — you joined the “${o.org.name}” team. Opening its projects…`),l(o.org.id))}).catch(o=>{i||String(o.message).includes("signing in")||(He("Could not accept the invite: "+o.message,!0),l(null))}),()=>{i=!0}},[n]),h.jsx(Pi,{vault:h.jsx(hc,{name:"BearDrive"}),topbar:h.jsx(Ki,{}),children:h.jsx("div",{className:"empty",children:"Joining…"})})}function VN({config:n}){const l=gh(),i=n.volume||"BearDrive";y.useEffect(()=>{document.title=n.brand||i},[n,i]);const o=y.useMemo(()=>Cx(l,"volume"),[l]);return h.jsx(qx,{config:n,apiBase:"/api/",route:o,hub:!1,sidebar:{vault:h.jsx(hc,{name:i,showSignout:n.auth.enabled,search:!0})}})}function YN(){const{data:n}=Pw();return h.jsxs(ij,{delayDuration:150,children:[n?n.mode==="hub"?h.jsx(qN,{config:n}):h.jsx(VN,{config:n}):h.jsx(Pi,{vault:h.jsx(hc,{name:"…",showSignout:!1}),topbar:h.jsx(Ki,{}),children:h.jsx("div",{className:"empty",children:"Loading…"})}),h.jsx(WA,{}),h.jsx(lO,{})]})}const IN=new Dw({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});ow.createRoot(document.getElementById("root")).render(h.jsx(y.StrictMode,{children:h.jsx(zw,{client:IN,children:h.jsx(YN,{})})})); diff --git a/internal/webapp/static/index.html b/internal/webapp/static/index.html index dcb3721..7349d06 100644 --- a/internal/webapp/static/index.html +++ b/internal/webapp/static/index.html @@ -5,7 +5,7 @@ BearDrive - +