randmarcomps 1.46.0 → 1.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/randmarcomps.js
CHANGED
|
@@ -4541,7 +4541,7 @@ function hf({ onClick: e, publicName: t, applicationName: n, partnerId: r }) {
|
|
|
4541
4541
|
{
|
|
4542
4542
|
src: o,
|
|
4543
4543
|
alt: "Partner logo",
|
|
4544
|
-
className: "h-9 w-9 object-cover bg-
|
|
4544
|
+
className: "h-9 w-9 object-cover !bg-sidebar",
|
|
4545
4545
|
onError: c
|
|
4546
4546
|
}
|
|
4547
4547
|
) }) }),
|
|
@@ -136,4 +136,4 @@
|
|
|
136
136
|
|
|
137
137
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
138
138
|
|
|
139
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return i.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},xl="DialogDescriptionWarning",Sl=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Uo(xl).contentName}}.`;return i.useEffect(()=>{var a;const o=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Mr=Do,Ko=Io,Yo=Fo,Mt=Ro,kt=$o,Dt=Wo,_t=Vo,It=jo;const Lt=({modal:e=!1,...t})=>l.jsx(Mr,{modal:e,...t});Lt.displayName=Mr.displayName;const Xo=Ko,Cl=Yo,kr=It,qo=i.forwardRef(({className:e,...t},r)=>l.jsx(Mt,{ref:r,className:D("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));qo.displayName=Mt.displayName;const Ft=i.forwardRef(({className:e,children:t,...r},n)=>l.jsxs(Cl,{children:[l.jsx(qo,{}),l.jsxs(kt,{ref:n,className:D("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-2xl shadow-primary duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,l.jsxs(It,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[l.jsx(cr,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ft.displayName=kt.displayName;const Dr=({className:e,...t})=>l.jsx("div",{className:D("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Dr.displayName="DialogHeader";const _r=({className:e,...t})=>l.jsx("div",{className:D("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});_r.displayName="DialogFooter";const Ir=i.forwardRef(({className:e,...t},r)=>l.jsx(Dt,{ref:r,className:D("text-lg font-semibold leading-none tracking-tight",e),...t}));Ir.displayName=Dt.displayName;const Lr=i.forwardRef(({className:e,...t},r)=>l.jsx(_t,{ref:r,className:D("text-sm text-muted-foreground",e),...t}));Lr.displayName=_t.displayName;const Zo=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Qo=Vn,Rt=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return Qo(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:o,defaultVariants:a}=t,s=Object.keys(o).map(d=>{const f=r==null?void 0:r[d],h=a==null?void 0:a[d];if(f===null)return null;const v=Zo(f)||Zo(h);return o[d][v]}),c=r&&Object.entries(r).reduce((d,f)=>{let[h,v]=f;return v===void 0||(d[h]=v),d},{}),u=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,f)=>{let{class:h,className:v,...g}=f;return Object.entries(g).every(b=>{let[p,m]=b;return Array.isArray(m)?m.includes({...a,...c}[p]):{...a,...c}[p]===m})?[...d,h,v]:d},[]);return Qo(e,s,u,r==null?void 0:r.class,r==null?void 0:r.className)},Fr=Rt("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90",outline:"border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",defaultOutline:"border border-red-600/30 text-red-600 bg-background shadow-xs hover:bg-red-600/5 ",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",blue:"bg-randmar-blue text-gray-100 shadow-sm hover:bg-randmar-blue/90",red:"bg-randmar-red text-gray-100 shadow-sm hover:bg-randmar-red/90",none:""},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),pe=i.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,confirmationDialog:o,onClick:a,...s},c)=>{const u=n?ue:"button";if(!o)return l.jsx(u,{className:D(Fr({variant:t,size:r,className:e})),ref:c,onClick:a,...s});a&&console.warn("Button: You provided both onClick and confirmationDialog props. The onClick prop will be ignored. Use the onConfirm callback in confirmationDialog instead.");const{title:d,content:f,onConfirm:h,confirmText:v="Confirm",cancelText:g="Cancel"}=o,b=()=>{h()};return l.jsxs(Lt,{children:[l.jsx(Xo,{asChild:!0,children:l.jsx(u,{className:D(Fr({variant:t,size:r,className:e})),ref:c,...s})}),l.jsxs(Ft,{children:[l.jsxs(Dr,{children:[l.jsx(Ir,{children:d}),l.jsx(Lr,{children:f})]}),l.jsxs(_r,{className:"flex justify-end gap-2 pt-4",children:[l.jsx(kr,{asChild:!0,children:l.jsx(pe,{variant:"outline",children:g})}),l.jsx(kr,{asChild:!0,children:l.jsx(pe,{onClick:b,children:v})})]})]})]})});pe.displayName="Button";const $t=i.forwardRef(({className:e,type:t,...r},n)=>l.jsx("input",{type:t,className:D("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));$t.displayName="Input";var El="Separator",Jo="horizontal",Tl=["horizontal","vertical"],ea=i.forwardRef((e,t)=>{const{decorative:r,orientation:n=Jo,...o}=e,a=Nl(n)?n:Jo,c=r?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return l.jsx(K.div,{"data-orientation":a,...c,...o,ref:t})});ea.displayName=El;function Nl(e){return Tl.includes(e)}var ta=ea;const Rr=i.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},o)=>l.jsx(ta,{ref:o,decorative:r,orientation:t,className:D("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));Rr.displayName=ta.displayName;const ra=Mr,Pl=Ko,Al=It,na=Yo,$r=i.forwardRef(({className:e,...t},r)=>l.jsx(Mt,{className:D("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));$r.displayName=Mt.displayName;const Ol=Rt("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),zr=i.forwardRef(({side:e="right",className:t,children:r,...n},o)=>l.jsxs(na,{children:[l.jsx($r,{}),l.jsxs(kt,{ref:o,className:D(Ol({side:e}),t),...n,children:[l.jsxs(It,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[l.jsx(cr,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]}),r]})]}));zr.displayName=kt.displayName;const oa=({className:e,...t})=>l.jsx("div",{className:D("flex flex-col space-y-2 text-center sm:text-left",e),...t});oa.displayName="SheetHeader";const aa=({className:e,...t})=>l.jsx("div",{className:D("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});aa.displayName="SheetFooter";const sa=i.forwardRef(({className:e,...t},r)=>l.jsx(Dt,{ref:r,className:D("text-lg font-semibold text-foreground",e),...t}));sa.displayName=Dt.displayName;const ia=i.forwardRef(({className:e,...t},r)=>l.jsx(_t,{ref:r,className:D("text-sm text-muted-foreground",e),...t}));ia.displayName=_t.displayName;function Ml({onClick:e,publicName:t,applicationName:r,partnerId:n}){const o=`https://api.randmar.io/v4/Partner/${n}/Account/Logo?height=72&width=72`,[a,s]=X.useState(!1),c=()=>{s(!0)};return l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-muted "+(e!==void 0?"cursor-pointer":""),children:a?l.jsx(pe,{asChild:!0,size:"icon",onClick:e,children:l.jsx(ci,{className:"h-5 w-5 text-muted-foreground !bg-sidebar"})}):l.jsx(pe,{asChild:!0,size:"icon",onClick:e,children:l.jsx("img",{src:o,alt:"Partner logo",className:"h-9 w-9 object-cover bg-neutral-100",onError:c})})}),l.jsxs("div",{className:"flex flex-1 flex-col",children:[l.jsx("span",{className:"text-sm font-medium",children:t||"Partner"}),l.jsx("span",{className:"text-xs text-neutral-400",children:r})]})]})}const Wr=1024;function ca(){const[e,t]=i.useState(void 0);return i.useEffect(()=>{const r=window.matchMedia(`(max-width: ${Wr-1}px)`),n=()=>{t(window.innerWidth<Wr)};return r.addEventListener("change",n),t(window.innerWidth<Wr),()=>r.removeEventListener("change",n)},[]),!!e}function Br({className:e,...t}){return l.jsx("div",{className:D("animate-pulse rounded-md bg-primary/20",e),...t})}const kl=["top","right","bottom","left"],Ae=Math.min,ae=Math.max,zt=Math.round,Wt=Math.floor,be=e=>({x:e,y:e}),Dl={left:"right",right:"left",bottom:"top",top:"bottom"},_l={start:"end",end:"start"};function Vr(e,t,r){return ae(e,Ae(t,r))}function Se(e,t){return typeof e=="function"?e(t):e}function Ce(e){return e.split("-")[0]}function qe(e){return e.split("-")[1]}function Hr(e){return e==="x"?"y":"x"}function jr(e){return e==="y"?"height":"width"}function Oe(e){return["top","bottom"].includes(Ce(e))?"y":"x"}function Gr(e){return Hr(Oe(e))}function Il(e,t,r){r===void 0&&(r=!1);const n=qe(e),o=Gr(e),a=jr(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(s=Bt(s)),[s,Bt(s)]}function Ll(e){const t=Bt(e);return[Ur(e),t,Ur(t)]}function Ur(e){return e.replace(/start|end/g,t=>_l[t])}function Fl(e,t,r){const n=["left","right"],o=["right","left"],a=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return r?t?o:n:t?n:o;case"left":case"right":return t?a:s;default:return[]}}function Rl(e,t,r,n){const o=qe(e);let a=Fl(Ce(e),r==="start",n);return o&&(a=a.map(s=>s+"-"+o),t&&(a=a.concat(a.map(Ur)))),a}function Bt(e){return e.replace(/left|right|bottom|top/g,t=>Dl[t])}function $l(e){return{top:0,right:0,bottom:0,left:0,...e}}function la(e){return typeof e!="number"?$l(e):{top:e,right:e,bottom:e,left:e}}function Vt(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function da(e,t,r){let{reference:n,floating:o}=e;const a=Oe(t),s=Gr(t),c=jr(s),u=Ce(t),d=a==="y",f=n.x+n.width/2-o.width/2,h=n.y+n.height/2-o.height/2,v=n[c]/2-o[c]/2;let g;switch(u){case"top":g={x:f,y:n.y-o.height};break;case"bottom":g={x:f,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:h};break;case"left":g={x:n.x-o.width,y:h};break;default:g={x:n.x,y:n.y}}switch(qe(t)){case"start":g[s]-=v*(r&&d?-1:1);break;case"end":g[s]+=v*(r&&d?-1:1);break}return g}const zl=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:s}=r,c=a.filter(Boolean),u=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:h}=da(d,n,u),v=n,g={},b=0;for(let p=0;p<c.length;p++){const{name:m,fn:y}=c[p],{x:w,y:x,data:S,reset:E}=await y({x:f,y:h,initialPlacement:n,placement:v,strategy:o,middlewareData:g,rects:d,platform:s,elements:{reference:e,floating:t}});f=w??f,h=x??h,g={...g,[m]:{...g[m],...S}},E&&b<=50&&(b++,typeof E=="object"&&(E.placement&&(v=E.placement),E.rects&&(d=E.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:f,y:h}=da(d,v,u)),p=-1)}return{x:f,y:h,placement:v,strategy:o,middlewareData:g}};async function at(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:a,rects:s,elements:c,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:v=!1,padding:g=0}=Se(t,e),b=la(g),m=c[v?h==="floating"?"reference":"floating":h],y=Vt(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(m)))==null||r?m:m.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(c.floating)),boundary:d,rootBoundary:f,strategy:u})),w=h==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,x=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c.floating)),S=await(a.isElement==null?void 0:a.isElement(x))?await(a.getScale==null?void 0:a.getScale(x))||{x:1,y:1}:{x:1,y:1},E=Vt(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:w,offsetParent:x,strategy:u}):w);return{top:(y.top-E.top+b.top)/S.y,bottom:(E.bottom-y.bottom+b.bottom)/S.y,left:(y.left-E.left+b.left)/S.x,right:(E.right-y.right+b.right)/S.x}}const Wl=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:a,platform:s,elements:c,middlewareData:u}=t,{element:d,padding:f=0}=Se(e,t)||{};if(d==null)return{};const h=la(f),v={x:r,y:n},g=Gr(o),b=jr(g),p=await s.getDimensions(d),m=g==="y",y=m?"top":"left",w=m?"bottom":"right",x=m?"clientHeight":"clientWidth",S=a.reference[b]+a.reference[g]-v[g]-a.floating[b],E=v[g]-a.reference[g],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let N=C?C[x]:0;(!N||!await(s.isElement==null?void 0:s.isElement(C)))&&(N=c.floating[x]||a.floating[b]);const $=S/2-E/2,I=N/2-p[b]/2-1,z=Ae(h[y],I),H=Ae(h[w],I),W=z,_=N-p[b]-H,P=N/2-p[b]/2+$,B=Vr(W,P,_),M=!u.arrow&&qe(o)!=null&&P!==B&&a.reference[b]/2-(P<W?z:H)-p[b]/2<0,j=M?P<W?P-W:P-_:0;return{[g]:v[g]+j,data:{[g]:B,centerOffset:P-B-j,...M&&{alignmentOffset:j}},reset:M}}}),Bl=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:a,rects:s,initialPlacement:c,platform:u,elements:d}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:p=!0,...m}=Se(e,t);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const y=Ce(o),w=Oe(c),x=Ce(c)===c,S=await(u.isRTL==null?void 0:u.isRTL(d.floating)),E=v||(x||!p?[Bt(c)]:Ll(c)),C=b!=="none";!v&&C&&E.push(...Rl(c,p,b,S));const N=[c,...E],$=await at(t,m),I=[];let z=((n=a.flip)==null?void 0:n.overflows)||[];if(f&&I.push($[y]),h){const P=Il(o,s,S);I.push($[P[0]],$[P[1]])}if(z=[...z,{placement:o,overflows:I}],!I.every(P=>P<=0)){var H,W;const P=(((H=a.flip)==null?void 0:H.index)||0)+1,B=N[P];if(B)return{data:{index:P,overflows:z},reset:{placement:B}};let M=(W=z.filter(j=>j.overflows[0]<=0).sort((j,k)=>j.overflows[1]-k.overflows[1])[0])==null?void 0:W.placement;if(!M)switch(g){case"bestFit":{var _;const j=(_=z.filter(k=>{if(C){const F=Oe(k.placement);return F===w||F==="y"}return!0}).map(k=>[k.placement,k.overflows.filter(F=>F>0).reduce((F,Y)=>F+Y,0)]).sort((k,F)=>k[1]-F[1])[0])==null?void 0:_[0];j&&(M=j);break}case"initialPlacement":M=c;break}if(o!==M)return{reset:{placement:M}}}return{}}}};function ua(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function fa(e){return kl.some(t=>e[t]>=0)}const Vl=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Se(e,t);switch(n){case"referenceHidden":{const a=await at(t,{...o,elementContext:"reference"}),s=ua(a,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:fa(s)}}}case"escaped":{const a=await at(t,{...o,altBoundary:!0}),s=ua(a,r.floating);return{data:{escapedOffsets:s,escaped:fa(s)}}}default:return{}}}}};async function Hl(e,t){const{placement:r,platform:n,elements:o}=e,a=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=Ce(r),c=qe(r),u=Oe(r)==="y",d=["left","top"].includes(s)?-1:1,f=a&&u?-1:1,h=Se(t,e);let{mainAxis:v,crossAxis:g,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof b=="number"&&(g=c==="end"?b*-1:b),u?{x:g*f,y:v*d}:{x:v*d,y:g*f}}const jl=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:a,placement:s,middlewareData:c}=t,u=await Hl(t,e);return s===((r=c.offset)==null?void 0:r.placement)&&(n=c.arrow)!=null&&n.alignmentOffset?{}:{x:o+u.x,y:a+u.y,data:{...u,placement:s}}}}},Gl=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:c={fn:m=>{let{x:y,y:w}=m;return{x:y,y:w}}},...u}=Se(e,t),d={x:r,y:n},f=await at(t,u),h=Oe(Ce(o)),v=Hr(h);let g=d[v],b=d[h];if(a){const m=v==="y"?"top":"left",y=v==="y"?"bottom":"right",w=g+f[m],x=g-f[y];g=Vr(w,g,x)}if(s){const m=h==="y"?"top":"left",y=h==="y"?"bottom":"right",w=b+f[m],x=b-f[y];b=Vr(w,b,x)}const p=c.fn({...t,[v]:g,[h]:b});return{...p,data:{x:p.x-r,y:p.y-n,enabled:{[v]:a,[h]:s}}}}}},Ul=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:a,middlewareData:s}=t,{offset:c=0,mainAxis:u=!0,crossAxis:d=!0}=Se(e,t),f={x:r,y:n},h=Oe(o),v=Hr(h);let g=f[v],b=f[h];const p=Se(c,t),m=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(u){const x=v==="y"?"height":"width",S=a.reference[v]-a.floating[x]+m.mainAxis,E=a.reference[v]+a.reference[x]-m.mainAxis;g<S?g=S:g>E&&(g=E)}if(d){var y,w;const x=v==="y"?"width":"height",S=["top","left"].includes(Ce(o)),E=a.reference[h]-a.floating[x]+(S&&((y=s.offset)==null?void 0:y[h])||0)+(S?0:m.crossAxis),C=a.reference[h]+a.reference[x]+(S?0:((w=s.offset)==null?void 0:w[h])||0)-(S?m.crossAxis:0);b<E?b=E:b>C&&(b=C)}return{[v]:g,[h]:b}}}},Kl=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:a,platform:s,elements:c}=t,{apply:u=()=>{},...d}=Se(e,t),f=await at(t,d),h=Ce(o),v=qe(o),g=Oe(o)==="y",{width:b,height:p}=a.floating;let m,y;h==="top"||h==="bottom"?(m=h,y=v===(await(s.isRTL==null?void 0:s.isRTL(c.floating))?"start":"end")?"left":"right"):(y=h,m=v==="end"?"top":"bottom");const w=p-f.top-f.bottom,x=b-f.left-f.right,S=Ae(p-f[m],w),E=Ae(b-f[y],x),C=!t.middlewareData.shift;let N=S,$=E;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&($=x),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(N=w),C&&!v){const z=ae(f.left,0),H=ae(f.right,0),W=ae(f.top,0),_=ae(f.bottom,0);g?$=b-2*(z!==0||H!==0?z+H:ae(f.left,f.right)):N=p-2*(W!==0||_!==0?W+_:ae(f.top,f.bottom))}await u({...t,availableWidth:$,availableHeight:N});const I=await s.getDimensions(c.floating);return b!==I.width||p!==I.height?{reset:{rects:!0}}:{}}}};function Ht(){return typeof window<"u"}function Ze(e){return pa(e)?(e.nodeName||"").toLowerCase():"#document"}function se(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ye(e){var t;return(t=(pa(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function pa(e){return Ht()?e instanceof Node||e instanceof se(e).Node:!1}function he(e){return Ht()?e instanceof Element||e instanceof se(e).Element:!1}function we(e){return Ht()?e instanceof HTMLElement||e instanceof se(e).HTMLElement:!1}function ha(e){return!Ht()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof se(e).ShadowRoot}function st(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=ge(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(o)}function Yl(e){return["table","td","th"].includes(Ze(e))}function jt(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Kr(e){const t=Yr(),r=he(e)?ge(e):e;return["transform","translate","scale","rotate","perspective"].some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function Xl(e){let t=Me(e);for(;we(t)&&!Qe(t);){if(Kr(t))return t;if(jt(t))return null;t=Me(t)}return null}function Yr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Qe(e){return["html","body","#document"].includes(Ze(e))}function ge(e){return se(e).getComputedStyle(e)}function Gt(e){return he(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Me(e){if(Ze(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ha(e)&&e.host||ye(e);return ha(t)?t.host:t}function ga(e){const t=Me(e);return Qe(t)?e.ownerDocument?e.ownerDocument.body:e.body:we(t)&&st(t)?t:ga(t)}function it(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=ga(e),a=o===((n=e.ownerDocument)==null?void 0:n.body),s=se(o);if(a){const c=Xr(s);return t.concat(s,s.visualViewport||[],st(o)?o:[],c&&r?it(c):[])}return t.concat(o,it(o,[],r))}function Xr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ma(e){const t=ge(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=we(e),a=o?e.offsetWidth:r,s=o?e.offsetHeight:n,c=zt(r)!==a||zt(n)!==s;return c&&(r=a,n=s),{width:r,height:n,$:c}}function qr(e){return he(e)?e:e.contextElement}function Je(e){const t=qr(e);if(!we(t))return be(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:a}=ma(t);let s=(a?zt(r.width):r.width)/n,c=(a?zt(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const ql=be(0);function va(e){const t=se(e);return!Yr()||!t.visualViewport?ql:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Zl(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==se(e)?!1:t}function $e(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),a=qr(e);let s=be(1);t&&(n?he(n)&&(s=Je(n)):s=Je(e));const c=Zl(a,r,n)?va(a):be(0);let u=(o.left+c.x)/s.x,d=(o.top+c.y)/s.y,f=o.width/s.x,h=o.height/s.y;if(a){const v=se(a),g=n&&he(n)?se(n):n;let b=v,p=Xr(b);for(;p&&n&&g!==b;){const m=Je(p),y=p.getBoundingClientRect(),w=ge(p),x=y.left+(p.clientLeft+parseFloat(w.paddingLeft))*m.x,S=y.top+(p.clientTop+parseFloat(w.paddingTop))*m.y;u*=m.x,d*=m.y,f*=m.x,h*=m.y,u+=x,d+=S,b=se(p),p=Xr(b)}}return Vt({width:f,height:h,x:u,y:d})}function Zr(e,t){const r=Gt(e).scrollLeft;return t?t.left+r:$e(ye(e)).left+r}function ba(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-(r?0:Zr(e,n)),a=n.top+t.scrollTop;return{x:o,y:a}}function Ql(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const a=o==="fixed",s=ye(n),c=t?jt(t.floating):!1;if(n===s||c&&a)return r;let u={scrollLeft:0,scrollTop:0},d=be(1);const f=be(0),h=we(n);if((h||!h&&!a)&&((Ze(n)!=="body"||st(s))&&(u=Gt(n)),we(n))){const g=$e(n);d=Je(n),f.x=g.x+n.clientLeft,f.y=g.y+n.clientTop}const v=s&&!h&&!a?ba(s,u,!0):be(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-u.scrollLeft*d.x+f.x+v.x,y:r.y*d.y-u.scrollTop*d.y+f.y+v.y}}function Jl(e){return Array.from(e.getClientRects())}function ed(e){const t=ye(e),r=Gt(e),n=e.ownerDocument.body,o=ae(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=ae(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+Zr(e);const c=-r.scrollTop;return ge(n).direction==="rtl"&&(s+=ae(t.clientWidth,n.clientWidth)-o),{width:o,height:a,x:s,y:c}}function td(e,t){const r=se(e),n=ye(e),o=r.visualViewport;let a=n.clientWidth,s=n.clientHeight,c=0,u=0;if(o){a=o.width,s=o.height;const d=Yr();(!d||d&&t==="fixed")&&(c=o.offsetLeft,u=o.offsetTop)}return{width:a,height:s,x:c,y:u}}function rd(e,t){const r=$e(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=we(e)?Je(e):be(1),s=e.clientWidth*a.x,c=e.clientHeight*a.y,u=o*a.x,d=n*a.y;return{width:s,height:c,x:u,y:d}}function ya(e,t,r){let n;if(t==="viewport")n=td(e,r);else if(t==="document")n=ed(ye(e));else if(he(t))n=rd(t,r);else{const o=va(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Vt(n)}function wa(e,t){const r=Me(e);return r===t||!he(r)||Qe(r)?!1:ge(r).position==="fixed"||wa(r,t)}function nd(e,t){const r=t.get(e);if(r)return r;let n=it(e,[],!1).filter(c=>he(c)&&Ze(c)!=="body"),o=null;const a=ge(e).position==="fixed";let s=a?Me(e):e;for(;he(s)&&!Qe(s);){const c=ge(s),u=Kr(s);!u&&c.position==="fixed"&&(o=null),(a?!u&&!o:!u&&c.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||st(s)&&!u&&wa(e,s))?n=n.filter(f=>f!==s):o=c,s=Me(s)}return t.set(e,n),n}function od(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?jt(t)?[]:nd(t,this._c):[].concat(r),n],c=s[0],u=s.reduce((d,f)=>{const h=ya(t,f,o);return d.top=ae(h.top,d.top),d.right=Ae(h.right,d.right),d.bottom=Ae(h.bottom,d.bottom),d.left=ae(h.left,d.left),d},ya(t,c,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function ad(e){const{width:t,height:r}=ma(e);return{width:t,height:r}}function sd(e,t,r){const n=we(t),o=ye(t),a=r==="fixed",s=$e(e,!0,a,t);let c={scrollLeft:0,scrollTop:0};const u=be(0);if(n||!n&&!a)if((Ze(t)!=="body"||st(o))&&(c=Gt(t)),n){const v=$e(t,!0,a,t);u.x=v.x+t.clientLeft,u.y=v.y+t.clientTop}else o&&(u.x=Zr(o));const d=o&&!n&&!a?ba(o,c):be(0),f=s.left+c.scrollLeft-u.x-d.x,h=s.top+c.scrollTop-u.y-d.y;return{x:f,y:h,width:s.width,height:s.height}}function Qr(e){return ge(e).position==="static"}function xa(e,t){if(!we(e)||ge(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return ye(e)===r&&(r=r.ownerDocument.body),r}function Sa(e,t){const r=se(e);if(jt(e))return r;if(!we(e)){let o=Me(e);for(;o&&!Qe(o);){if(he(o)&&!Qr(o))return o;o=Me(o)}return r}let n=xa(e,t);for(;n&&Yl(n)&&Qr(n);)n=xa(n,t);return n&&Qe(n)&&Qr(n)&&!Kr(n)?r:n||Xl(e)||r}const id=async function(e){const t=this.getOffsetParent||Sa,r=this.getDimensions,n=await r(e.floating);return{reference:sd(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function cd(e){return ge(e).direction==="rtl"}const ld={convertOffsetParentRelativeRectToViewportRelativeRect:Ql,getDocumentElement:ye,getClippingRect:od,getOffsetParent:Sa,getElementRects:id,getClientRects:Jl,getDimensions:ad,getScale:Je,isElement:he,isRTL:cd};function Ca(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function dd(e,t){let r=null,n;const o=ye(e);function a(){var c;clearTimeout(n),(c=r)==null||c.disconnect(),r=null}function s(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),a();const d=e.getBoundingClientRect(),{left:f,top:h,width:v,height:g}=d;if(c||t(),!v||!g)return;const b=Wt(h),p=Wt(o.clientWidth-(f+v)),m=Wt(o.clientHeight-(h+g)),y=Wt(f),x={rootMargin:-b+"px "+-p+"px "+-m+"px "+-y+"px",threshold:ae(0,Ae(1,u))||1};let S=!0;function E(C){const N=C[0].intersectionRatio;if(N!==u){if(!S)return s();N?s(!1,N):n=setTimeout(()=>{s(!1,1e-7)},1e3)}N===1&&!Ca(d,e.getBoundingClientRect())&&s(),S=!1}try{r=new IntersectionObserver(E,{...x,root:o.ownerDocument})}catch{r=new IntersectionObserver(E,x)}r.observe(e)}return s(!0),a}function ud(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=n,d=qr(e),f=o||a?[...d?it(d):[],...it(t)]:[];f.forEach(y=>{o&&y.addEventListener("scroll",r,{passive:!0}),a&&y.addEventListener("resize",r)});const h=d&&c?dd(d,r):null;let v=-1,g=null;s&&(g=new ResizeObserver(y=>{let[w]=y;w&&w.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var x;(x=g)==null||x.observe(t)})),r()}),d&&!u&&g.observe(d),g.observe(t));let b,p=u?$e(e):null;u&&m();function m(){const y=$e(e);p&&!Ca(p,y)&&r(),p=y,b=requestAnimationFrame(m)}return r(),()=>{var y;f.forEach(w=>{o&&w.removeEventListener("scroll",r),a&&w.removeEventListener("resize",r)}),h==null||h(),(y=g)==null||y.disconnect(),g=null,u&&cancelAnimationFrame(b)}}const fd=jl,pd=Gl,hd=Bl,gd=Kl,md=Vl,Ea=Wl,vd=Ul,bd=(e,t,r)=>{const n=new Map,o={platform:ld,...r},a={...o.platform,_c:n};return zl(e,t,{...o,platform:a})};var Ut=typeof document<"u"?X.useLayoutEffect:X.useEffect;function Kt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!Kt(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const a=o[n];if(!(a==="_owner"&&e.$$typeof)&&!Kt(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function Ta(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Na(e,t){const r=Ta(e);return Math.round(t*r)/r}function Jr(e){const t=i.useRef(e);return Ut(()=>{t.current=e}),t}function yd(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:a,floating:s}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[f,h]=i.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[v,g]=i.useState(n);Kt(v,n)||g(n);const[b,p]=i.useState(null),[m,y]=i.useState(null),w=i.useCallback(k=>{k!==C.current&&(C.current=k,p(k))},[]),x=i.useCallback(k=>{k!==N.current&&(N.current=k,y(k))},[]),S=a||b,E=s||m,C=i.useRef(null),N=i.useRef(null),$=i.useRef(f),I=u!=null,z=Jr(u),H=Jr(o),W=Jr(d),_=i.useCallback(()=>{if(!C.current||!N.current)return;const k={placement:t,strategy:r,middleware:v};H.current&&(k.platform=H.current),bd(C.current,N.current,k).then(F=>{const Y={...F,isPositioned:W.current!==!1};P.current&&!Kt($.current,Y)&&($.current=Y,ir.flushSync(()=>{h(Y)}))})},[v,t,r,H,W]);Ut(()=>{d===!1&&$.current.isPositioned&&($.current.isPositioned=!1,h(k=>({...k,isPositioned:!1})))},[d]);const P=i.useRef(!1);Ut(()=>(P.current=!0,()=>{P.current=!1}),[]),Ut(()=>{if(S&&(C.current=S),E&&(N.current=E),S&&E){if(z.current)return z.current(S,E,_);_()}},[S,E,_,z,I]);const B=i.useMemo(()=>({reference:C,floating:N,setReference:w,setFloating:x}),[w,x]),M=i.useMemo(()=>({reference:S,floating:E}),[S,E]),j=i.useMemo(()=>{const k={position:r,left:0,top:0};if(!M.floating)return k;const F=Na(M.floating,f.x),Y=Na(M.floating,f.y);return c?{...k,transform:"translate("+F+"px, "+Y+"px)",...Ta(M.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:F,top:Y}},[r,c,M.floating,f.x,f.y]);return i.useMemo(()=>({...f,update:_,refs:B,elements:M,floatingStyles:j}),[f,_,B,M,j])}const wd=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Ea({element:n.current,padding:o}).fn(r):{}:n?Ea({element:n,padding:o}).fn(r):{}}}},xd=(e,t)=>({...fd(e),options:[e,t]}),Sd=(e,t)=>({...pd(e),options:[e,t]}),Cd=(e,t)=>({...vd(e),options:[e,t]}),Ed=(e,t)=>({...hd(e),options:[e,t]}),Td=(e,t)=>({...gd(e),options:[e,t]}),Nd=(e,t)=>({...md(e),options:[e,t]}),Pd=(e,t)=>({...wd(e),options:[e,t]});var Ad="Arrow",Pa=i.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...a}=e;return l.jsx(K.svg,{...a,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});Pa.displayName=Ad;var Od=Pa;function Md(e){const[t,r]=i.useState(void 0);return Ne(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let s,c;if("borderBoxSize"in a){const u=a.borderBoxSize,d=Array.isArray(u)?u[0]:u;s=d.inlineSize,c=d.blockSize}else s=e.offsetWidth,c=e.offsetHeight;r({width:s,height:c})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var en="Popper",[Aa,Oa]=ot(en),[kd,Ma]=Aa(en),ka=e=>{const{__scopePopper:t,children:r}=e,[n,o]=i.useState(null);return l.jsx(kd,{scope:t,anchor:n,onAnchorChange:o,children:r})};ka.displayName=en;var Da="PopperAnchor",_a=i.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,a=Ma(Da,r),s=i.useRef(null),c=ee(t,s);return i.useEffect(()=>{a.onAnchorChange((n==null?void 0:n.current)||s.current)}),n?null:l.jsx(K.div,{...o,ref:c})});_a.displayName=Da;var tn="PopperContent",[Dd,_d]=Aa(tn),Ia=i.forwardRef((e,t)=>{var xe,ht,nr,gt,or,rt;const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:a="center",alignOffset:s=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:v=!1,updatePositionStrategy:g="optimized",onPlaced:b,...p}=e,m=Ma(tn,r),[y,w]=i.useState(null),x=ee(t,ze=>w(ze)),[S,E]=i.useState(null),C=Md(S),N=(C==null?void 0:C.width)??0,$=(C==null?void 0:C.height)??0,I=n+(a!=="center"?"-"+a:""),z=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},H=Array.isArray(d)?d:[d],W=H.length>0,_={padding:z,boundary:H.filter(Ld),altBoundary:W},{refs:P,floatingStyles:B,placement:M,isPositioned:j,middlewareData:k}=yd({strategy:"fixed",placement:I,whileElementsMounted:(...ze)=>ud(...ze,{animationFrame:g==="always"}),elements:{reference:m.anchor},middleware:[xd({mainAxis:o+$,alignmentAxis:s}),u&&Sd({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Cd():void 0,..._}),u&&Ed({..._}),Td({..._,apply:({elements:ze,rects:L,availableWidth:R,availableHeight:Q})=>{const{width:ne,height:oe}=L.reference,G=ze.floating.style;G.setProperty("--radix-popper-available-width",`${R}px`),G.setProperty("--radix-popper-available-height",`${Q}px`),G.setProperty("--radix-popper-anchor-width",`${ne}px`),G.setProperty("--radix-popper-anchor-height",`${oe}px`)}}),S&&Pd({element:S,padding:c}),Fd({arrowWidth:N,arrowHeight:$}),v&&Nd({strategy:"referenceHidden",..._})]}),[F,Y]=Ra(M),Z=le(b);Ne(()=>{j&&(Z==null||Z())},[j,Z]);const re=(xe=k.arrow)==null?void 0:xe.x,J=(ht=k.arrow)==null?void 0:ht.y,te=((nr=k.arrow)==null?void 0:nr.centerOffset)!==0,[ie,ke]=i.useState();return Ne(()=>{y&&ke(window.getComputedStyle(y).zIndex)},[y]),l.jsx("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...B,transform:j?B.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ie,"--radix-popper-transform-origin":[(gt=k.transformOrigin)==null?void 0:gt.x,(or=k.transformOrigin)==null?void 0:or.y].join(" "),...((rt=k.hide)==null?void 0:rt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(Dd,{scope:r,placedSide:F,onArrowChange:E,arrowX:re,arrowY:J,shouldHideArrow:te,children:l.jsx(K.div,{"data-side":F,"data-align":Y,...p,ref:x,style:{...p.style,animation:j?void 0:"none"}})})})});Ia.displayName=tn;var La="PopperArrow",Id={top:"bottom",right:"left",bottom:"top",left:"right"},Fa=i.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,a=_d(La,n),s=Id[a.placedSide];return l.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:l.jsx(Od,{...o,ref:r,style:{...o.style,display:"block"}})})});Fa.displayName=La;function Ld(e){return e!==null}var Fd=e=>({name:"transformOrigin",options:e,fn(t){var m,y,w;const{placement:r,rects:n,middlewareData:o}=t,s=((m=o.arrow)==null?void 0:m.centerOffset)!==0,c=s?0:e.arrowWidth,u=s?0:e.arrowHeight,[d,f]=Ra(r),h={start:"0%",center:"50%",end:"100%"}[f],v=(((y=o.arrow)==null?void 0:y.x)??0)+c/2,g=(((w=o.arrow)==null?void 0:w.y)??0)+u/2;let b="",p="";return d==="bottom"?(b=s?h:`${v}px`,p=`${-u}px`):d==="top"?(b=s?h:`${v}px`,p=`${n.floating.height+u}px`):d==="right"?(b=`${-u}px`,p=s?h:`${g}px`):d==="left"&&(b=`${n.floating.width+u}px`,p=s?h:`${g}px`),{data:{x:b,y:p}}}});function Ra(e){const[t,r="center"]=e.split("-");return[t,r]}var Rd=ka,$d=_a,zd=Ia,Wd=Fa,Bd="VisuallyHidden",Yt=i.forwardRef((e,t)=>l.jsx(K.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Yt.displayName=Bd;var Vd=Yt,[Xt,sf]=ot("Tooltip",[Oa]),qt=Oa(),$a="TooltipProvider",Hd=700,rn="tooltip.open",[jd,nn]=Xt($a),za=e=>{const{__scopeTooltip:t,delayDuration:r=Hd,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:a}=e,[s,c]=i.useState(!0),u=i.useRef(!1),d=i.useRef(0);return i.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),l.jsx(jd,{scope:t,isOpenDelayed:s,delayDuration:r,onOpen:i.useCallback(()=>{window.clearTimeout(d.current),c(!1)},[]),onClose:i.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>c(!0),n)},[n]),isPointerInTransitRef:u,onPointerInTransitChange:i.useCallback(f=>{u.current=f},[]),disableHoverableContent:o,children:a})};za.displayName=$a;var Zt="Tooltip",[Gd,ct]=Xt(Zt),Wa=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o=!1,onOpenChange:a,disableHoverableContent:s,delayDuration:c}=e,u=nn(Zt,e.__scopeTooltip),d=qt(t),[f,h]=i.useState(null),v=bt(),g=i.useRef(0),b=s??u.disableHoverableContent,p=c??u.delayDuration,m=i.useRef(!1),[y=!1,w]=gr({prop:n,defaultProp:o,onChange:N=>{N?(u.onOpen(),document.dispatchEvent(new CustomEvent(rn))):u.onClose(),a==null||a(N)}}),x=i.useMemo(()=>y?m.current?"delayed-open":"instant-open":"closed",[y]),S=i.useCallback(()=>{window.clearTimeout(g.current),g.current=0,m.current=!1,w(!0)},[w]),E=i.useCallback(()=>{window.clearTimeout(g.current),g.current=0,w(!1)},[w]),C=i.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{m.current=!0,w(!0),g.current=0},p)},[p,w]);return i.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),l.jsx(Rd,{...d,children:l.jsx(Gd,{scope:t,contentId:v,open:y,stateAttribute:x,trigger:f,onTriggerChange:h,onTriggerEnter:i.useCallback(()=>{u.isOpenDelayed?C():S()},[u.isOpenDelayed,C,S]),onTriggerLeave:i.useCallback(()=>{b?E():(window.clearTimeout(g.current),g.current=0)},[E,b]),onOpen:S,onClose:E,disableHoverableContent:b,children:r})})};Wa.displayName=Zt;var on="TooltipTrigger",Ba=i.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=ct(on,r),a=nn(on,r),s=qt(r),c=i.useRef(null),u=ee(t,c,o.onTriggerChange),d=i.useRef(!1),f=i.useRef(!1),h=i.useCallback(()=>d.current=!1,[]);return i.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),l.jsx($d,{asChild:!0,...s,children:l.jsx(K.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:u,onPointerMove:U(e.onPointerMove,v=>{v.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:U(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:U(e.onPointerDown,()=>{d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:U(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:U(e.onBlur,o.onClose),onClick:U(e.onClick,o.onClose)})})});Ba.displayName=on;var an="TooltipPortal",[Ud,Kd]=Xt(an,{forceMount:void 0}),Va=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,a=ct(an,t);return l.jsx(Ud,{scope:t,forceMount:r,children:l.jsx(Fe,{present:r||a.open,children:l.jsx(wt,{asChild:!0,container:o,children:n})})})};Va.displayName=an;var et="TooltipContent",Ha=i.forwardRef((e,t)=>{const r=Kd(et,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...a}=e,s=ct(et,e.__scopeTooltip);return l.jsx(Fe,{present:n||s.open,children:s.disableHoverableContent?l.jsx(ja,{side:o,...a,ref:t}):l.jsx(Yd,{side:o,...a,ref:t})})}),Yd=i.forwardRef((e,t)=>{const r=ct(et,e.__scopeTooltip),n=nn(et,e.__scopeTooltip),o=i.useRef(null),a=ee(t,o),[s,c]=i.useState(null),{trigger:u,onClose:d}=r,f=o.current,{onPointerInTransitChange:h}=n,v=i.useCallback(()=>{c(null),h(!1)},[h]),g=i.useCallback((b,p)=>{const m=b.currentTarget,y={x:b.clientX,y:b.clientY},w=Qd(y,m.getBoundingClientRect()),x=Jd(y,w),S=eu(p.getBoundingClientRect()),E=ru([...x,...S]);c(E),h(!0)},[h]);return i.useEffect(()=>()=>v(),[v]),i.useEffect(()=>{if(u&&f){const b=m=>g(m,f),p=m=>g(m,u);return u.addEventListener("pointerleave",b),f.addEventListener("pointerleave",p),()=>{u.removeEventListener("pointerleave",b),f.removeEventListener("pointerleave",p)}}},[u,f,g,v]),i.useEffect(()=>{if(s){const b=p=>{const m=p.target,y={x:p.clientX,y:p.clientY},w=(u==null?void 0:u.contains(m))||(f==null?void 0:f.contains(m)),x=!tu(y,s);w?v():x&&(v(),d())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[u,f,s,d,v]),l.jsx(ja,{...e,ref:a})}),[Xd,qd]=Xt(Zt,{isInside:!1}),ja=i.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:s,...c}=e,u=ct(et,r),d=qt(r),{onClose:f}=u;return i.useEffect(()=>(document.addEventListener(rn,f),()=>document.removeEventListener(rn,f)),[f]),i.useEffect(()=>{if(u.trigger){const h=v=>{const g=v.target;g!=null&&g.contains(u.trigger)&&f()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[u.trigger,f]),l.jsx(yt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:h=>h.preventDefault(),onDismiss:f,children:l.jsxs(zd,{"data-state":u.stateAttribute,...d,...c,ref:t,style:{...c.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:[l.jsx(ro,{children:n}),l.jsx(Xd,{scope:r,isInside:!0,children:l.jsx(Vd,{id:u.contentId,role:"tooltip",children:o||n})})]})})});Ha.displayName=et;var Ga="TooltipArrow",Zd=i.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=qt(r);return qd(Ga,r).isInside?null:l.jsx(Wd,{...o,...n,ref:t})});Zd.displayName=Ga;function Qd(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(r,n,o,a)){case a:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Jd(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function eu(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function tu(e,t){const{x:r,y:n}=e;let o=!1;for(let a=0,s=t.length-1;a<t.length;s=a++){const c=t[a].x,u=t[a].y,d=t[s].x,f=t[s].y;u>n!=f>n&&r<(d-c)*(n-u)/(f-u)+c&&(o=!o)}return o}function ru(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),nu(t)}function nu(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const a=t[t.length-1],s=t[t.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const a=r[r.length-1],s=r[r.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var ou=za,au=Wa,su=Ba,iu=Va,Ua=Ha;const lt=ou,dt=au,ut=su,tt=i.forwardRef(({className:e,sideOffset:t=4,...r},n)=>l.jsx(iu,{children:l.jsx(Ua,{ref:n,sideOffset:t,className:D("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",e),...r})}));tt.displayName=Ua.displayName;const cu="sidebar:state",lu=60*60*24*7,du="16rem",uu="18rem",fu="3rem",pu="b",Ka=i.createContext(null);function ft(){const e=i.useContext(Ka);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const sn=i.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:r,className:n,style:o,children:a,...s},c)=>{const u=ca(),[d,f]=i.useState(!1),[h,v]=i.useState(e),g=t??h,b=i.useCallback(w=>{const x=typeof w=="function"?w(g):w;r?r(x):v(x),document.cookie=`${cu}=${x}; path=/; max-age=${lu}`},[r,g]),p=i.useCallback(()=>u?f(w=>!w):b(w=>!w),[u,b,f]);i.useEffect(()=>{const w=x=>{x.key===pu&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),p())};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[p]);const m=g?"expanded":"collapsed",y=i.useMemo(()=>({state:m,open:g,setOpen:b,isMobile:u,openMobile:d,setOpenMobile:f,toggleSidebar:p}),[m,g,b,u,d,f,p]);return l.jsx(Ka.Provider,{value:y,children:l.jsx(lt,{delayDuration:0,children:l.jsx("div",{style:{"--sidebar-width":du,"--sidebar-width-icon":fu,...o},className:D("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",n),ref:c,...s,children:a})})})});sn.displayName="SidebarProvider";const cn=i.forwardRef(({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:n,children:o,...a},s)=>{const{isMobile:c,state:u,openMobile:d,setOpenMobile:f}=ft();return r==="none"?l.jsx("div",{className:D("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",n),ref:s,...a,children:o}):c?l.jsx(ra,{open:d,onOpenChange:f,...a,children:l.jsx(zr,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":uu},side:e,children:l.jsx("div",{className:"flex h-full w-full flex-col",children:o})})}):l.jsxs("div",{ref:s,className:"group peer hidden md:block text-sidebar-foreground","data-state":u,"data-collapsible":u==="collapsed"?r:"","data-variant":t,"data-side":e,children:[l.jsx("div",{className:D("duration-200 relative h-svh w-(--sidebar-width) bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),l.jsx("div",{className:D("duration-200 fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...a,children:l.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm",children:o})})]})});cn.displayName="Sidebar";const ln=i.forwardRef(({className:e,onClick:t,...r},n)=>{const{toggleSidebar:o}=ft();return l.jsxs(pe,{ref:n,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:D("h-7 w-7 text-sidebar-foreground",e),onClick:a=>{t==null||t(a),o()},...r,children:[l.jsx(ai,{}),l.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});ln.displayName="SidebarTrigger";const Ya=i.forwardRef(({className:e,...t},r)=>{const{toggleSidebar:n}=ft();return l.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:D("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});Ya.displayName="SidebarRail";const Xa=i.forwardRef(({className:e,...t},r)=>l.jsx("main",{ref:r,className:D("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-(--spacing(4)))] md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",e),...t}));Xa.displayName="SidebarInset";const qa=i.forwardRef(({className:e,...t},r)=>l.jsx($t,{ref:r,"data-sidebar":"input",className:D("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));qa.displayName="SidebarInput";const dn=i.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,"data-sidebar":"header",className:D("flex flex-col gap-2 p-2",e),...t}));dn.displayName="SidebarHeader";const un=i.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,"data-sidebar":"footer",className:D("flex flex-col gap-2 p-2",e),...t}));un.displayName="SidebarFooter";const Za=i.forwardRef(({className:e,...t},r)=>l.jsx(Rr,{ref:r,"data-sidebar":"separator",className:D("mx-2 w-auto bg-sidebar-border",e),...t}));Za.displayName="SidebarSeparator";const fn=i.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,"data-sidebar":"content",className:D("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));fn.displayName="SidebarContent";const Qa=i.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,"data-sidebar":"group",className:D("relative flex w-full min-w-0 flex-col p-2",e),...t}));Qa.displayName="SidebarGroup";const Ja=i.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const o=t?ue:"div";return l.jsx(o,{ref:n,"data-sidebar":"group-label",className:D("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-hidden ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...r})});Ja.displayName="SidebarGroupLabel";const es=i.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const o=t?ue:"button";return l.jsx(o,{ref:n,"data-sidebar":"group-action",className:D("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",e),...r})});es.displayName="SidebarGroupAction";const ts=i.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,"data-sidebar":"group-content",className:D("w-full text-sm",e),...t}));ts.displayName="SidebarGroupContent";const pn=i.forwardRef(({className:e,...t},r)=>l.jsx("ul",{ref:r,"data-sidebar":"menu",className:D("flex w-full min-w-0 flex-col gap-1",e),...t}));pn.displayName="SidebarMenu";const hn=i.forwardRef(({className:e,...t},r)=>l.jsx("li",{ref:r,"data-sidebar":"menu-item",className:D("group/menu-item relative",e),...t}));hn.displayName="SidebarMenuItem";const hu=Rt("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}}),gn=i.forwardRef(({asChild:e=!1,isActive:t=!1,variant:r="default",size:n="default",tooltip:o,className:a,...s},c)=>{const u=e?ue:"button",{isMobile:d,state:f}=ft(),h=l.jsx(u,{ref:c,"data-sidebar":"menu-button","data-size":n,"data-active":t,className:D(hu({variant:r,size:n}),a),...s});return o?(typeof o=="string"&&(o={children:o}),l.jsxs(dt,{children:[l.jsx(ut,{asChild:!0,children:h}),l.jsx(tt,{side:"right",align:"center",hidden:f!=="collapsed"||d,...o})]})):h});gn.displayName="SidebarMenuButton";const rs=i.forwardRef(({className:e,asChild:t=!1,showOnHover:r=!1,...n},o)=>{const a=t?ue:"button";return l.jsx(a,{ref:o,"data-sidebar":"menu-action",className:D("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...n})});rs.displayName="SidebarMenuAction";const ns=i.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:D("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));ns.displayName="SidebarMenuBadge";const os=i.forwardRef(({className:e,showIcon:t=!1,...r},n)=>{const o=i.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return l.jsxs("div",{ref:n,"data-sidebar":"menu-skeleton",className:D("rounded-md h-8 flex gap-2 px-2 items-center",e),...r,children:[t&&l.jsx(Br,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),l.jsx(Br,{className:"h-4 flex-1 max-w-(--skeleton-width)","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":o}})]})});os.displayName="SidebarMenuSkeleton";const as=i.forwardRef(({className:e,...t},r)=>l.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:D("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));as.displayName="SidebarMenuSub";const ss=i.forwardRef(({...e},t)=>l.jsx("li",{ref:t,...e}));ss.displayName="SidebarMenuSubItem";const is=i.forwardRef(({asChild:e=!1,size:t="md",isActive:r,className:n,...o},a)=>{const s=e?ue:"a";return l.jsx(s,{ref:a,"data-sidebar":"menu-sub-button","data-size":t,"data-active":r,className:D("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-hidden ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",n),...o})});is.displayName="SidebarMenuSubButton";function gu(e){const t=e+"CollectionProvider",[r,n]=ot(t),[o,a]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=g=>{const{scope:b,children:p}=g,m=X.useRef(null),y=X.useRef(new Map).current;return l.jsx(o,{scope:b,itemMap:y,collectionRef:m,children:p})};s.displayName=t;const c=e+"CollectionSlot",u=X.forwardRef((g,b)=>{const{scope:p,children:m}=g,y=a(c,p),w=ee(b,y.collectionRef);return l.jsx(ue,{ref:w,children:m})});u.displayName=c;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=X.forwardRef((g,b)=>{const{scope:p,children:m,...y}=g,w=X.useRef(null),x=ee(b,w),S=a(d,p);return X.useEffect(()=>(S.itemMap.set(w,{ref:w,...y}),()=>void S.itemMap.delete(w))),l.jsx(ue,{[f]:"",ref:x,children:m})});h.displayName=d;function v(g){const b=a(e+"CollectionConsumer",g);return X.useCallback(()=>{const m=b.collectionRef.current;if(!m)return[];const y=Array.from(m.querySelectorAll(`[${f}]`));return Array.from(b.itemMap.values()).sort((S,E)=>y.indexOf(S.ref.current)-y.indexOf(E.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:s,Slot:u,ItemSlot:h},v,n]}var mn="ToastProvider",[vn,mu,vu]=gu("Toast"),[cs,cf]=ot("Toast",[vu]),[bu,Qt]=cs(mn),ls=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:o="right",swipeThreshold:a=50,children:s}=e,[c,u]=i.useState(null),[d,f]=i.useState(0),h=i.useRef(!1),v=i.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${mn}\`. Expected non-empty \`string\`.`),l.jsx(vn.Provider,{scope:t,children:l.jsx(bu,{scope:t,label:r,duration:n,swipeDirection:o,swipeThreshold:a,toastCount:d,viewport:c,onViewportChange:u,onToastAdd:i.useCallback(()=>f(g=>g+1),[]),onToastRemove:i.useCallback(()=>f(g=>g-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:v,children:s})})};ls.displayName=mn;var ds="ToastViewport",yu=["F8"],bn="toast.viewportPause",yn="toast.viewportResume",us=i.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=yu,label:o="Notifications ({hotkey})",...a}=e,s=Qt(ds,r),c=mu(r),u=i.useRef(null),d=i.useRef(null),f=i.useRef(null),h=i.useRef(null),v=ee(t,h,s.onViewportChange),g=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),b=s.toastCount>0;i.useEffect(()=>{const m=y=>{var x;n.length!==0&&n.every(S=>y[S]||y.code===S)&&((x=h.current)==null||x.focus())};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[n]),i.useEffect(()=>{const m=u.current,y=h.current;if(b&&m&&y){const w=()=>{if(!s.isClosePausedRef.current){const C=new CustomEvent(bn);y.dispatchEvent(C),s.isClosePausedRef.current=!0}},x=()=>{if(s.isClosePausedRef.current){const C=new CustomEvent(yn);y.dispatchEvent(C),s.isClosePausedRef.current=!1}},S=C=>{!m.contains(C.relatedTarget)&&x()},E=()=>{m.contains(document.activeElement)||x()};return m.addEventListener("focusin",w),m.addEventListener("focusout",S),m.addEventListener("pointermove",w),m.addEventListener("pointerleave",E),window.addEventListener("blur",w),window.addEventListener("focus",x),()=>{m.removeEventListener("focusin",w),m.removeEventListener("focusout",S),m.removeEventListener("pointermove",w),m.removeEventListener("pointerleave",E),window.removeEventListener("blur",w),window.removeEventListener("focus",x)}}},[b,s.isClosePausedRef]);const p=i.useCallback(({tabbingDirection:m})=>{const w=c().map(x=>{const S=x.ref.current,E=[S,...Du(S)];return m==="forwards"?E:E.reverse()});return(m==="forwards"?w.reverse():w).flat()},[c]);return i.useEffect(()=>{const m=h.current;if(m){const y=w=>{var E,C,N;const x=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!x){const $=document.activeElement,I=w.shiftKey;if(w.target===m&&I){(E=d.current)==null||E.focus();return}const W=p({tabbingDirection:I?"backwards":"forwards"}),_=W.findIndex(P=>P===$);Sn(W.slice(_+1))?w.preventDefault():I?(C=d.current)==null||C.focus():(N=f.current)==null||N.focus()}};return m.addEventListener("keydown",y),()=>m.removeEventListener("keydown",y)}},[c,p]),l.jsxs(mc,{ref:u,role:"region","aria-label":o.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:b?void 0:"none"},children:[b&&l.jsx(wn,{ref:d,onFocusFromOutsideViewport:()=>{const m=p({tabbingDirection:"forwards"});Sn(m)}}),l.jsx(vn.Slot,{scope:r,children:l.jsx(K.ol,{tabIndex:-1,...a,ref:v})}),b&&l.jsx(wn,{ref:f,onFocusFromOutsideViewport:()=>{const m=p({tabbingDirection:"backwards"});Sn(m)}})]})});us.displayName=ds;var fs="ToastFocusProxy",wn=i.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...o}=e,a=Qt(fs,r);return l.jsx(Yt,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:s=>{var d;const c=s.relatedTarget;!((d=a.viewport)!=null&&d.contains(c))&&n()}})});wn.displayName=fs;var Jt="Toast",wu="toast.swipeStart",xu="toast.swipeMove",Su="toast.swipeCancel",Cu="toast.swipeEnd",ps=i.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:o,onOpenChange:a,...s}=e,[c=!0,u]=gr({prop:n,defaultProp:o,onChange:a});return l.jsx(Fe,{present:r||c,children:l.jsx(Nu,{open:c,...s,ref:t,onClose:()=>u(!1),onPause:le(e.onPause),onResume:le(e.onResume),onSwipeStart:U(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:U(e.onSwipeMove,d=>{const{x:f,y:h}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:U(e.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:U(e.onSwipeEnd,d=>{const{x:f,y:h}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),u(!1)})})})});ps.displayName=Jt;var[Eu,Tu]=cs(Jt,{onClose(){}}),Nu=i.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:o,open:a,onClose:s,onEscapeKeyDown:c,onPause:u,onResume:d,onSwipeStart:f,onSwipeMove:h,onSwipeCancel:v,onSwipeEnd:g,...b}=e,p=Qt(Jt,r),[m,y]=i.useState(null),w=ee(t,P=>y(P)),x=i.useRef(null),S=i.useRef(null),E=o||p.duration,C=i.useRef(0),N=i.useRef(E),$=i.useRef(0),{onToastAdd:I,onToastRemove:z}=p,H=le(()=>{var B;(m==null?void 0:m.contains(document.activeElement))&&((B=p.viewport)==null||B.focus()),s()}),W=i.useCallback(P=>{!P||P===1/0||(window.clearTimeout($.current),C.current=new Date().getTime(),$.current=window.setTimeout(H,P))},[H]);i.useEffect(()=>{const P=p.viewport;if(P){const B=()=>{W(N.current),d==null||d()},M=()=>{const j=new Date().getTime()-C.current;N.current=N.current-j,window.clearTimeout($.current),u==null||u()};return P.addEventListener(bn,M),P.addEventListener(yn,B),()=>{P.removeEventListener(bn,M),P.removeEventListener(yn,B)}}},[p.viewport,E,u,d,W]),i.useEffect(()=>{a&&!p.isClosePausedRef.current&&W(E)},[a,E,p.isClosePausedRef,W]),i.useEffect(()=>(I(),()=>z()),[I,z]);const _=i.useMemo(()=>m?ws(m):null,[m]);return p.viewport?l.jsxs(l.Fragment,{children:[_&&l.jsx(Pu,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:_}),l.jsx(Eu,{scope:r,onClose:H,children:ir.createPortal(l.jsx(vn.ItemSlot,{scope:r,children:l.jsx(gc,{asChild:!0,onEscapeKeyDown:U(c,()=>{p.isFocusedToastEscapeKeyDownRef.current||H(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:l.jsx(K.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":p.swipeDirection,...b,ref:w,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:U(e.onKeyDown,P=>{P.key==="Escape"&&(c==null||c(P.nativeEvent),P.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,H()))}),onPointerDown:U(e.onPointerDown,P=>{P.button===0&&(x.current={x:P.clientX,y:P.clientY})}),onPointerMove:U(e.onPointerMove,P=>{if(!x.current)return;const B=P.clientX-x.current.x,M=P.clientY-x.current.y,j=!!S.current,k=["left","right"].includes(p.swipeDirection),F=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,Y=k?F(0,B):0,Z=k?0:F(0,M),re=P.pointerType==="touch"?10:2,J={x:Y,y:Z},te={originalEvent:P,delta:J};j?(S.current=J,er(xu,h,te,{discrete:!1})):xs(J,p.swipeDirection,re)?(S.current=J,er(wu,f,te,{discrete:!1}),P.target.setPointerCapture(P.pointerId)):(Math.abs(B)>re||Math.abs(M)>re)&&(x.current=null)}),onPointerUp:U(e.onPointerUp,P=>{const B=S.current,M=P.target;if(M.hasPointerCapture(P.pointerId)&&M.releasePointerCapture(P.pointerId),S.current=null,x.current=null,B){const j=P.currentTarget,k={originalEvent:P,delta:B};xs(B,p.swipeDirection,p.swipeThreshold)?er(Cu,g,k,{discrete:!0}):er(Su,v,k,{discrete:!0}),j.addEventListener("click",F=>F.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),Pu=e=>{const{__scopeToast:t,children:r,...n}=e,o=Qt(Jt,t),[a,s]=i.useState(!1),[c,u]=i.useState(!1);return Mu(()=>s(!0)),i.useEffect(()=>{const d=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(d)},[]),c?null:l.jsx(wt,{asChild:!0,children:l.jsx(Yt,{...n,children:a&&l.jsxs(l.Fragment,{children:[o.label," ",r]})})})},Au="ToastTitle",hs=i.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return l.jsx(K.div,{...n,ref:t})});hs.displayName=Au;var Ou="ToastDescription",gs=i.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return l.jsx(K.div,{...n,ref:t})});gs.displayName=Ou;var ms="ToastAction",vs=i.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?l.jsx(ys,{altText:r,asChild:!0,children:l.jsx(xn,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${ms}\`. Expected non-empty \`string\`.`),null)});vs.displayName=ms;var bs="ToastClose",xn=i.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,o=Tu(bs,r);return l.jsx(ys,{asChild:!0,children:l.jsx(K.button,{type:"button",...n,ref:t,onClick:U(e.onClick,o.onClose)})})});xn.displayName=bs;var ys=i.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...o}=e;return l.jsx(K.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...o,ref:t})});function ws(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),ku(n)){const o=n.ariaHidden||n.hidden||n.style.display==="none",a=n.dataset.radixToastAnnounceExclude==="";if(!o)if(a){const s=n.dataset.radixToastAnnounceAlt;s&&t.push(s)}else t.push(...ws(n))}}),t}function er(e,t,r,{discrete:n}){const o=r.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?no(o,a):o.dispatchEvent(a)}var xs=(e,t,r=0)=>{const n=Math.abs(e.x),o=Math.abs(e.y),a=n>o;return t==="left"||t==="right"?a&&n>r:!a&&o>r};function Mu(e=()=>{}){const t=le(e);Ne(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function ku(e){return e.nodeType===e.ELEMENT_NODE}function Du(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Sn(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var _u=ls,Ss=us,Cs=ps,Es=hs,Ts=gs,Ns=vs,Ps=xn;const As=_u,Cn=i.forwardRef(({className:e,...t},r)=>l.jsx(Ss,{ref:r,className:D("fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));Cn.displayName=Ss.displayName;const Iu=Rt("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full sm:data-[state=open]:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground",success:"border-green-600 bg-green-600 text-white",warning:"border-yellow-500 bg-yellow-500 text-white",info:"border-blue-500 bg-blue-500 text-white",secondary:"border-secondary bg-secondary text-secondary-foreground",outline:"border-input bg-background text-foreground hover:bg-accent hover:text-accent-foreground"}},defaultVariants:{variant:"default"}}),En=i.forwardRef(({className:e,variant:t,...r},n)=>l.jsx(Cs,{ref:n,className:D(Iu({variant:t}),e),...r}));En.displayName=Cs.displayName;const Os=i.forwardRef(({className:e,...t},r)=>l.jsx(Ns,{ref:r,className:D("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-hidden focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 hover:group-[.destructive]:border-destructive/30 hover:group-[.destructive]:bg-destructive hover:group-[.destructive]:text-destructive-foreground focus:group-[.destructive]:ring-destructive",e),...t}));Os.displayName=Ns.displayName;const Tn=i.forwardRef(({className:e,...t},r)=>l.jsx(Ps,{ref:r,className:D("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-hidden focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 hover:group-[.destructive]:text-red-50 focus:group-[.destructive]:ring-red-400 focus:group-[.destructive]:ring-offset-red-600",e),"toast-close":"",...t,children:l.jsx(cr,{className:"h-4 w-4"})}));Tn.displayName=Ps.displayName;const Nn=i.forwardRef(({className:e,...t},r)=>l.jsx(Es,{ref:r,className:D("text-sm font-semibold [&+div]:text-xs",e),...t}));Nn.displayName=Es.displayName;const Pn=i.forwardRef(({className:e,...t},r)=>l.jsx(Ts,{ref:r,className:D("text-sm opacity-90",e),...t}));Pn.displayName=Ts.displayName;const Lu=1,Fu=1e6;let An=0;function Ru(){return An=(An+1)%Number.MAX_SAFE_INTEGER,An.toString()}const On=new Map,Ms=e=>{if(On.has(e))return;const t=setTimeout(()=>{On.delete(e),pt({type:"REMOVE_TOAST",toastId:e})},Fu);On.set(e,t)},$u=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Lu)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?Ms(r):e.toasts.forEach(n=>Ms(n.id)),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return{...e,toasts:t.toastId?e.toasts.filter(r=>r.id!==t.toastId):[]}}},tr=[];let rr={toasts:[]};function pt(e){rr=$u(rr,e),tr.forEach(t=>t(rr))}function ks({...e}){const t=Ru(),r=o=>pt({type:"UPDATE_TOAST",toast:{...o,id:t}}),n=()=>pt({type:"DISMISS_TOAST",toastId:t});return pt({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||n()}}}),{id:t,dismiss:n,update:r}}function Mn(){const[e,t]=i.useState(rr);return i.useEffect(()=>(tr.push(t),()=>{const r=tr.indexOf(t);r>-1&&tr.splice(r,1)}),[]),{...e,toast:ks,dismiss:r=>pt({type:"DISMISS_TOAST",toastId:r})}}function Ds(){const{toasts:e}=Mn();return l.jsxs(As,{children:[e.map(function({id:t,title:r,description:n,action:o,...a}){return l.jsxs(En,{...a,children:[l.jsxs("div",{className:"grid gap-1",children:[r&&l.jsx(Nn,{children:r}),n&&l.jsx(Pn,{children:n})]}),o,l.jsx(Tn,{})]},t)}),l.jsx(Cn,{})]})}function _s({onSignOut:e,searchResultsRouteName:t,rightMenu:r}){const[n,o]=X.useState(""),a=sr.useNavigate(),{toast:s}=Mn(),c=()=>{const d=n.trim();if(!d||d.length<2){s({title:"Enter more characters to search",description:"At least 2 characters are needed to search products.",variant:"destructive",duration:5e3});return}const f=new URLSearchParams({q:d});a({pathname:t,search:f.toString()}),o("")},u=d=>{d.key==="Enter"&&c()};return l.jsxs("header",{className:"flex h-16 items-center gap-4 border-b sidebar-foreground bg-sidebar px-6 fixed top-0 right-0 z-50 lg:left-64 left-0 border-sidebar-border",children:[l.jsx(ln,{className:"lg:hidden",children:l.jsx(ni,{className:"h-6 w-6"})}),l.jsx("div",{className:"flex flex-1 items-center gap-4",children:l.jsx("div",{className:"relative w-full max-w-sm",children:l.jsxs("div",{children:[l.jsx("button",{type:"button",className:"absolute left-2 top-1/2 -translate-y-1/2",onClick:c,"aria-label":"Search",children:l.jsx(ii,{className:"h-4 w-4 text-muted-foreground"})}),l.jsx($t,{placeholder:"Search...",className:"w-full pl-8 bg-white text-black",value:n,onChange:d=>o(d.target.value),onKeyDown:u})]})})}),r||l.jsx(l.Fragment,{}),e&&l.jsx("div",{className:"flex items-center gap-4",children:l.jsxs(pe,{variant:"ghost",size:"icon",className:"h-9 w-9",onClick:e,children:[l.jsx(ri,{className:"h-4 w-4 text-sidebar-foreground"}),l.jsx("span",{className:"sr-only",children:"Sign out"})]})})]})}function Is({routes:e,footer:t,dashboardTitle:r}){const{appID:n}=sr.useParams(),o=e.filter(a=>a.showInNav);return l.jsxs(cn,{className:"border-r border-sidebar-border",children:[l.jsx(dn,{className:"border-b border-sidebar-border px-6 h-16 justify-center bg-sidebar text-sidebar-foreground",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"flex items-center justify-center",children:l.jsx("img",{src:"https://api.randmar.io/images/RandmarIcon.svg",alt:"Randmar Icon",className:"h-4 w-4 filter brightness-0 saturate-100 invert"})}),l.jsx("span",{className:"font-semibold text-lg",children:r})]})}),l.jsx(fn,{className:"py-4 bg-sidebar text-sidebar-foreground",children:l.jsx(pn,{children:o.map(a=>{const s=a.icon,c=`/${a.path.replace(":appID",n)}`;return l.jsx(hn,{children:l.jsx(gn,{asChild:!0,children:l.jsxs(sr.Link,{to:c,className:"transition-colors hover:bg-muted px-6",children:[s&&l.jsx(s,{className:"h-4 w-4"}),l.jsx("span",{children:a.label})]})})},a.key)})})}),l.jsx(un,{className:"border-t border-sidebar-border p-4 bg-sidebar-background text-sidebar-foreground",children:t})]})}function zu({children:e,rightMenu:t,routes:r,footer:n,searchResultsRouteName:o,dashboardTitle:a,onSignOut:s}){return l.jsx(l.Fragment,{children:l.jsx(sn,{children:l.jsxs("div",{className:"flex grow",children:[l.jsx(Is,{routes:r,footer:n,dashboardTitle:a}),l.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[l.jsx(_s,{onSignOut:s,rightMenu:t,searchResultsRouteName:o}),l.jsx("main",{className:"flex-1 overflow-auto mt-16",children:e}),l.jsx(Ds,{})]})]})})})}const Wu={sm:100,md:200,lg:300,xl:400};function Bu({randmarSKU:e,size:t="md",alt:r,secondaryContent:n}){const[o,a]=i.useState(!1),[s,c]=i.useState(!1),[u,d]=i.useState(!1),[f,h]=i.useState(!1),v=`https://api.randmar.io/Product/${e}/Video`;i.useEffect(()=>{(async()=>{try{const x=await(await fetch(v+"/Exists")).json();c(x)}catch(w){console.error("Error checking for video:",w),c(!1)}})()},[e,v]);async function g(){if(s){h(!0);try{const w=await(await fetch(v)).blob(),x=window.URL.createObjectURL(w),S=document.createElement("a");S.href=x,S.download=`${e||"product"}-video.mp4`,document.body.appendChild(S),S.click(),document.body.removeChild(S),window.URL.revokeObjectURL(x)}catch(y){console.error("Error downloading video:",y)}finally{h(!1)}}}function b(){navigator.clipboard.writeText(v),d(!0),setTimeout(()=>{d(!1)},2e3)}function p(){a(!0)}const m=Wu[t||"xl"];return l.jsxs(l.Fragment,{children:[l.jsx(Lt,{open:o,onOpenChange:a,children:l.jsx(Ft,{className:"max-w-4xl p-0 overflow-hidden",children:n?l.jsxs("div",{className:"flex flex-row",children:[l.jsxs("video",{className:"w-full rounded-l-lg max-h-[720px] object-contain",controls:!0,autoPlay:!0,muted:!0,loop:!0,children:[l.jsx("source",{src:v,type:"video/mp4"}),"Your browser does not support the video tag."]}),l.jsx("div",{className:"flex-grow min-w-[400px] h-[70vh] p-6",children:n})]}):l.jsxs("div",{className:"w-full relative",children:[l.jsxs("video",{className:"w-full max-h-[720px] object-contain",controls:!0,autoPlay:!0,children:[l.jsx("source",{src:v,type:"video/mp4"}),"Your browser does not support the video tag."]}),l.jsxs("div",{className:"absolute top-2 right-12 flex gap-1",children:[l.jsx(lt,{children:l.jsxs(dt,{children:[l.jsx(ut,{asChild:!0,children:l.jsx(pe,{variant:"secondary",size:"icon",onClick:b,children:u?l.jsx(Js,{className:"h-4 w-4"}):l.jsx(ei,{className:"h-4 w-4"})})}),l.jsx(tt,{children:l.jsx("p",{children:"Copy video link"})})]})}),l.jsx(lt,{children:l.jsxs(dt,{children:[l.jsx(ut,{asChild:!0,children:l.jsx(pe,{variant:"secondary",size:"icon",onClick:g,disabled:f,children:l.jsx(ti,{className:"h-4 w-4"})})}),l.jsx(tt,{children:l.jsx("p",{children:"Download video"})})]})})]})]})})}),l.jsxs("div",{className:"relative w-max h-max",children:[l.jsx("img",{alt:r||`Product ${e}`,className:`rounded-md ${s?"cursor-pointer":""}`,onClick:s?p:void 0,src:`https://api.randmar.io/Product/${e}/Image?width=${m*1.5}&height=${m*1.5}`,width:m,height:m}),s&&l.jsx(lt,{children:l.jsxs(dt,{children:[l.jsx(ut,{asChild:!0,children:l.jsx(pe,{variant:"secondary",size:"icon",className:"absolute top-2 right-2",onClick:p,children:l.jsx(si,{className:"h-4 w-4"})})}),l.jsx(tt,{children:l.jsx("p",{children:"Play video"})})]})})]})]})}T.AvatarFooter=Ml,T.Button=pe,T.Dialog=Lt,T.DialogClose=kr,T.DialogContent=Ft,T.DialogDescription=Lr,T.DialogFooter=_r,T.DialogHeader=Dr,T.DialogTitle=Ir,T.DialogTrigger=Xo,T.Input=$t,T.InputOTP=Xi,T.InputOTPGroup=qi,T.InputOTPSeparator=Qi,T.InputOTPSlot=Zi,T.Layout=zu,T.Navbar=Is,T.ProductImage=Bu,T.Separator=Rr,T.Sheet=ra,T.SheetClose=Al,T.SheetContent=zr,T.SheetDescription=ia,T.SheetFooter=aa,T.SheetHeader=oa,T.SheetOverlay=$r,T.SheetPortal=na,T.SheetTitle=sa,T.SheetTrigger=Pl,T.Sidebar=cn,T.SidebarContent=fn,T.SidebarFooter=un,T.SidebarGroup=Qa,T.SidebarGroupAction=es,T.SidebarGroupContent=ts,T.SidebarGroupLabel=Ja,T.SidebarHeader=dn,T.SidebarInput=qa,T.SidebarInset=Xa,T.SidebarMenu=pn,T.SidebarMenuAction=rs,T.SidebarMenuBadge=ns,T.SidebarMenuButton=gn,T.SidebarMenuItem=hn,T.SidebarMenuSkeleton=os,T.SidebarMenuSub=as,T.SidebarMenuSubButton=is,T.SidebarMenuSubItem=ss,T.SidebarProvider=sn,T.SidebarRail=Ya,T.SidebarSeparator=Za,T.SidebarTrigger=ln,T.Skeleton=Br,T.Toast=En,T.ToastAction=Os,T.ToastClose=Tn,T.ToastDescription=Pn,T.ToastProvider=As,T.ToastTitle=Nn,T.ToastViewport=Cn,T.Toaster=Ds,T.Tooltip=dt,T.TooltipContent=tt,T.TooltipProvider=lt,T.TooltipTrigger=ut,T.Topbar=_s,T.buttonVariants=Fr,T.toast=ks,T.useIsMobile=ca,T.useSidebar=ft,T.useToast=Mn,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})});
|
|
139
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return i.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},xl="DialogDescriptionWarning",Sl=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Uo(xl).contentName}}.`;return i.useEffect(()=>{var a;const o=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Mr=Do,Ko=Io,Yo=Fo,Mt=Ro,kt=$o,Dt=Wo,_t=Vo,It=jo;const Lt=({modal:e=!1,...t})=>l.jsx(Mr,{modal:e,...t});Lt.displayName=Mr.displayName;const Xo=Ko,Cl=Yo,kr=It,qo=i.forwardRef(({className:e,...t},r)=>l.jsx(Mt,{ref:r,className:D("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));qo.displayName=Mt.displayName;const Ft=i.forwardRef(({className:e,children:t,...r},n)=>l.jsxs(Cl,{children:[l.jsx(qo,{}),l.jsxs(kt,{ref:n,className:D("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-2xl shadow-primary duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,l.jsxs(It,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[l.jsx(cr,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ft.displayName=kt.displayName;const Dr=({className:e,...t})=>l.jsx("div",{className:D("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Dr.displayName="DialogHeader";const _r=({className:e,...t})=>l.jsx("div",{className:D("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});_r.displayName="DialogFooter";const Ir=i.forwardRef(({className:e,...t},r)=>l.jsx(Dt,{ref:r,className:D("text-lg font-semibold leading-none tracking-tight",e),...t}));Ir.displayName=Dt.displayName;const Lr=i.forwardRef(({className:e,...t},r)=>l.jsx(_t,{ref:r,className:D("text-sm text-muted-foreground",e),...t}));Lr.displayName=_t.displayName;const Zo=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Qo=Vn,Rt=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return Qo(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:o,defaultVariants:a}=t,s=Object.keys(o).map(d=>{const f=r==null?void 0:r[d],h=a==null?void 0:a[d];if(f===null)return null;const v=Zo(f)||Zo(h);return o[d][v]}),c=r&&Object.entries(r).reduce((d,f)=>{let[h,v]=f;return v===void 0||(d[h]=v),d},{}),u=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,f)=>{let{class:h,className:v,...g}=f;return Object.entries(g).every(b=>{let[p,m]=b;return Array.isArray(m)?m.includes({...a,...c}[p]):{...a,...c}[p]===m})?[...d,h,v]:d},[]);return Qo(e,s,u,r==null?void 0:r.class,r==null?void 0:r.className)},Fr=Rt("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90",outline:"border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",defaultOutline:"border border-red-600/30 text-red-600 bg-background shadow-xs hover:bg-red-600/5 ",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",blue:"bg-randmar-blue text-gray-100 shadow-sm hover:bg-randmar-blue/90",red:"bg-randmar-red text-gray-100 shadow-sm hover:bg-randmar-red/90",none:""},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),pe=i.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,confirmationDialog:o,onClick:a,...s},c)=>{const u=n?ue:"button";if(!o)return l.jsx(u,{className:D(Fr({variant:t,size:r,className:e})),ref:c,onClick:a,...s});a&&console.warn("Button: You provided both onClick and confirmationDialog props. The onClick prop will be ignored. Use the onConfirm callback in confirmationDialog instead.");const{title:d,content:f,onConfirm:h,confirmText:v="Confirm",cancelText:g="Cancel"}=o,b=()=>{h()};return l.jsxs(Lt,{children:[l.jsx(Xo,{asChild:!0,children:l.jsx(u,{className:D(Fr({variant:t,size:r,className:e})),ref:c,...s})}),l.jsxs(Ft,{children:[l.jsxs(Dr,{children:[l.jsx(Ir,{children:d}),l.jsx(Lr,{children:f})]}),l.jsxs(_r,{className:"flex justify-end gap-2 pt-4",children:[l.jsx(kr,{asChild:!0,children:l.jsx(pe,{variant:"outline",children:g})}),l.jsx(kr,{asChild:!0,children:l.jsx(pe,{onClick:b,children:v})})]})]})]})});pe.displayName="Button";const $t=i.forwardRef(({className:e,type:t,...r},n)=>l.jsx("input",{type:t,className:D("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));$t.displayName="Input";var El="Separator",Jo="horizontal",Tl=["horizontal","vertical"],ea=i.forwardRef((e,t)=>{const{decorative:r,orientation:n=Jo,...o}=e,a=Nl(n)?n:Jo,c=r?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return l.jsx(K.div,{"data-orientation":a,...c,...o,ref:t})});ea.displayName=El;function Nl(e){return Tl.includes(e)}var ta=ea;const Rr=i.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},o)=>l.jsx(ta,{ref:o,decorative:r,orientation:t,className:D("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));Rr.displayName=ta.displayName;const ra=Mr,Pl=Ko,Al=It,na=Yo,$r=i.forwardRef(({className:e,...t},r)=>l.jsx(Mt,{className:D("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));$r.displayName=Mt.displayName;const Ol=Rt("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),zr=i.forwardRef(({side:e="right",className:t,children:r,...n},o)=>l.jsxs(na,{children:[l.jsx($r,{}),l.jsxs(kt,{ref:o,className:D(Ol({side:e}),t),...n,children:[l.jsxs(It,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[l.jsx(cr,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]}),r]})]}));zr.displayName=kt.displayName;const oa=({className:e,...t})=>l.jsx("div",{className:D("flex flex-col space-y-2 text-center sm:text-left",e),...t});oa.displayName="SheetHeader";const aa=({className:e,...t})=>l.jsx("div",{className:D("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});aa.displayName="SheetFooter";const sa=i.forwardRef(({className:e,...t},r)=>l.jsx(Dt,{ref:r,className:D("text-lg font-semibold text-foreground",e),...t}));sa.displayName=Dt.displayName;const ia=i.forwardRef(({className:e,...t},r)=>l.jsx(_t,{ref:r,className:D("text-sm text-muted-foreground",e),...t}));ia.displayName=_t.displayName;function Ml({onClick:e,publicName:t,applicationName:r,partnerId:n}){const o=`https://api.randmar.io/v4/Partner/${n}/Account/Logo?height=72&width=72`,[a,s]=X.useState(!1),c=()=>{s(!0)};return l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-muted "+(e!==void 0?"cursor-pointer":""),children:a?l.jsx(pe,{asChild:!0,size:"icon",onClick:e,children:l.jsx(ci,{className:"h-5 w-5 text-muted-foreground !bg-sidebar"})}):l.jsx(pe,{asChild:!0,size:"icon",onClick:e,children:l.jsx("img",{src:o,alt:"Partner logo",className:"h-9 w-9 object-cover !bg-sidebar",onError:c})})}),l.jsxs("div",{className:"flex flex-1 flex-col",children:[l.jsx("span",{className:"text-sm font-medium",children:t||"Partner"}),l.jsx("span",{className:"text-xs text-neutral-400",children:r})]})]})}const Wr=1024;function ca(){const[e,t]=i.useState(void 0);return i.useEffect(()=>{const r=window.matchMedia(`(max-width: ${Wr-1}px)`),n=()=>{t(window.innerWidth<Wr)};return r.addEventListener("change",n),t(window.innerWidth<Wr),()=>r.removeEventListener("change",n)},[]),!!e}function Br({className:e,...t}){return l.jsx("div",{className:D("animate-pulse rounded-md bg-primary/20",e),...t})}const kl=["top","right","bottom","left"],Ae=Math.min,ae=Math.max,zt=Math.round,Wt=Math.floor,be=e=>({x:e,y:e}),Dl={left:"right",right:"left",bottom:"top",top:"bottom"},_l={start:"end",end:"start"};function Vr(e,t,r){return ae(e,Ae(t,r))}function Se(e,t){return typeof e=="function"?e(t):e}function Ce(e){return e.split("-")[0]}function qe(e){return e.split("-")[1]}function Hr(e){return e==="x"?"y":"x"}function jr(e){return e==="y"?"height":"width"}function Oe(e){return["top","bottom"].includes(Ce(e))?"y":"x"}function Gr(e){return Hr(Oe(e))}function Il(e,t,r){r===void 0&&(r=!1);const n=qe(e),o=Gr(e),a=jr(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(s=Bt(s)),[s,Bt(s)]}function Ll(e){const t=Bt(e);return[Ur(e),t,Ur(t)]}function Ur(e){return e.replace(/start|end/g,t=>_l[t])}function Fl(e,t,r){const n=["left","right"],o=["right","left"],a=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return r?t?o:n:t?n:o;case"left":case"right":return t?a:s;default:return[]}}function Rl(e,t,r,n){const o=qe(e);let a=Fl(Ce(e),r==="start",n);return o&&(a=a.map(s=>s+"-"+o),t&&(a=a.concat(a.map(Ur)))),a}function Bt(e){return e.replace(/left|right|bottom|top/g,t=>Dl[t])}function $l(e){return{top:0,right:0,bottom:0,left:0,...e}}function la(e){return typeof e!="number"?$l(e):{top:e,right:e,bottom:e,left:e}}function Vt(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function da(e,t,r){let{reference:n,floating:o}=e;const a=Oe(t),s=Gr(t),c=jr(s),u=Ce(t),d=a==="y",f=n.x+n.width/2-o.width/2,h=n.y+n.height/2-o.height/2,v=n[c]/2-o[c]/2;let g;switch(u){case"top":g={x:f,y:n.y-o.height};break;case"bottom":g={x:f,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:h};break;case"left":g={x:n.x-o.width,y:h};break;default:g={x:n.x,y:n.y}}switch(qe(t)){case"start":g[s]-=v*(r&&d?-1:1);break;case"end":g[s]+=v*(r&&d?-1:1);break}return g}const zl=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:s}=r,c=a.filter(Boolean),u=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:h}=da(d,n,u),v=n,g={},b=0;for(let p=0;p<c.length;p++){const{name:m,fn:y}=c[p],{x:w,y:x,data:S,reset:E}=await y({x:f,y:h,initialPlacement:n,placement:v,strategy:o,middlewareData:g,rects:d,platform:s,elements:{reference:e,floating:t}});f=w??f,h=x??h,g={...g,[m]:{...g[m],...S}},E&&b<=50&&(b++,typeof E=="object"&&(E.placement&&(v=E.placement),E.rects&&(d=E.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:f,y:h}=da(d,v,u)),p=-1)}return{x:f,y:h,placement:v,strategy:o,middlewareData:g}};async function at(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:a,rects:s,elements:c,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:v=!1,padding:g=0}=Se(t,e),b=la(g),m=c[v?h==="floating"?"reference":"floating":h],y=Vt(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(m)))==null||r?m:m.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(c.floating)),boundary:d,rootBoundary:f,strategy:u})),w=h==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,x=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c.floating)),S=await(a.isElement==null?void 0:a.isElement(x))?await(a.getScale==null?void 0:a.getScale(x))||{x:1,y:1}:{x:1,y:1},E=Vt(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:w,offsetParent:x,strategy:u}):w);return{top:(y.top-E.top+b.top)/S.y,bottom:(E.bottom-y.bottom+b.bottom)/S.y,left:(y.left-E.left+b.left)/S.x,right:(E.right-y.right+b.right)/S.x}}const Wl=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:a,platform:s,elements:c,middlewareData:u}=t,{element:d,padding:f=0}=Se(e,t)||{};if(d==null)return{};const h=la(f),v={x:r,y:n},g=Gr(o),b=jr(g),p=await s.getDimensions(d),m=g==="y",y=m?"top":"left",w=m?"bottom":"right",x=m?"clientHeight":"clientWidth",S=a.reference[b]+a.reference[g]-v[g]-a.floating[b],E=v[g]-a.reference[g],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let N=C?C[x]:0;(!N||!await(s.isElement==null?void 0:s.isElement(C)))&&(N=c.floating[x]||a.floating[b]);const $=S/2-E/2,I=N/2-p[b]/2-1,z=Ae(h[y],I),H=Ae(h[w],I),W=z,_=N-p[b]-H,P=N/2-p[b]/2+$,B=Vr(W,P,_),M=!u.arrow&&qe(o)!=null&&P!==B&&a.reference[b]/2-(P<W?z:H)-p[b]/2<0,j=M?P<W?P-W:P-_:0;return{[g]:v[g]+j,data:{[g]:B,centerOffset:P-B-j,...M&&{alignmentOffset:j}},reset:M}}}),Bl=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:a,rects:s,initialPlacement:c,platform:u,elements:d}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:p=!0,...m}=Se(e,t);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const y=Ce(o),w=Oe(c),x=Ce(c)===c,S=await(u.isRTL==null?void 0:u.isRTL(d.floating)),E=v||(x||!p?[Bt(c)]:Ll(c)),C=b!=="none";!v&&C&&E.push(...Rl(c,p,b,S));const N=[c,...E],$=await at(t,m),I=[];let z=((n=a.flip)==null?void 0:n.overflows)||[];if(f&&I.push($[y]),h){const P=Il(o,s,S);I.push($[P[0]],$[P[1]])}if(z=[...z,{placement:o,overflows:I}],!I.every(P=>P<=0)){var H,W;const P=(((H=a.flip)==null?void 0:H.index)||0)+1,B=N[P];if(B)return{data:{index:P,overflows:z},reset:{placement:B}};let M=(W=z.filter(j=>j.overflows[0]<=0).sort((j,k)=>j.overflows[1]-k.overflows[1])[0])==null?void 0:W.placement;if(!M)switch(g){case"bestFit":{var _;const j=(_=z.filter(k=>{if(C){const F=Oe(k.placement);return F===w||F==="y"}return!0}).map(k=>[k.placement,k.overflows.filter(F=>F>0).reduce((F,Y)=>F+Y,0)]).sort((k,F)=>k[1]-F[1])[0])==null?void 0:_[0];j&&(M=j);break}case"initialPlacement":M=c;break}if(o!==M)return{reset:{placement:M}}}return{}}}};function ua(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function fa(e){return kl.some(t=>e[t]>=0)}const Vl=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Se(e,t);switch(n){case"referenceHidden":{const a=await at(t,{...o,elementContext:"reference"}),s=ua(a,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:fa(s)}}}case"escaped":{const a=await at(t,{...o,altBoundary:!0}),s=ua(a,r.floating);return{data:{escapedOffsets:s,escaped:fa(s)}}}default:return{}}}}};async function Hl(e,t){const{placement:r,platform:n,elements:o}=e,a=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=Ce(r),c=qe(r),u=Oe(r)==="y",d=["left","top"].includes(s)?-1:1,f=a&&u?-1:1,h=Se(t,e);let{mainAxis:v,crossAxis:g,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof b=="number"&&(g=c==="end"?b*-1:b),u?{x:g*f,y:v*d}:{x:v*d,y:g*f}}const jl=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:a,placement:s,middlewareData:c}=t,u=await Hl(t,e);return s===((r=c.offset)==null?void 0:r.placement)&&(n=c.arrow)!=null&&n.alignmentOffset?{}:{x:o+u.x,y:a+u.y,data:{...u,placement:s}}}}},Gl=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:c={fn:m=>{let{x:y,y:w}=m;return{x:y,y:w}}},...u}=Se(e,t),d={x:r,y:n},f=await at(t,u),h=Oe(Ce(o)),v=Hr(h);let g=d[v],b=d[h];if(a){const m=v==="y"?"top":"left",y=v==="y"?"bottom":"right",w=g+f[m],x=g-f[y];g=Vr(w,g,x)}if(s){const m=h==="y"?"top":"left",y=h==="y"?"bottom":"right",w=b+f[m],x=b-f[y];b=Vr(w,b,x)}const p=c.fn({...t,[v]:g,[h]:b});return{...p,data:{x:p.x-r,y:p.y-n,enabled:{[v]:a,[h]:s}}}}}},Ul=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:a,middlewareData:s}=t,{offset:c=0,mainAxis:u=!0,crossAxis:d=!0}=Se(e,t),f={x:r,y:n},h=Oe(o),v=Hr(h);let g=f[v],b=f[h];const p=Se(c,t),m=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(u){const x=v==="y"?"height":"width",S=a.reference[v]-a.floating[x]+m.mainAxis,E=a.reference[v]+a.reference[x]-m.mainAxis;g<S?g=S:g>E&&(g=E)}if(d){var y,w;const x=v==="y"?"width":"height",S=["top","left"].includes(Ce(o)),E=a.reference[h]-a.floating[x]+(S&&((y=s.offset)==null?void 0:y[h])||0)+(S?0:m.crossAxis),C=a.reference[h]+a.reference[x]+(S?0:((w=s.offset)==null?void 0:w[h])||0)-(S?m.crossAxis:0);b<E?b=E:b>C&&(b=C)}return{[v]:g,[h]:b}}}},Kl=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:a,platform:s,elements:c}=t,{apply:u=()=>{},...d}=Se(e,t),f=await at(t,d),h=Ce(o),v=qe(o),g=Oe(o)==="y",{width:b,height:p}=a.floating;let m,y;h==="top"||h==="bottom"?(m=h,y=v===(await(s.isRTL==null?void 0:s.isRTL(c.floating))?"start":"end")?"left":"right"):(y=h,m=v==="end"?"top":"bottom");const w=p-f.top-f.bottom,x=b-f.left-f.right,S=Ae(p-f[m],w),E=Ae(b-f[y],x),C=!t.middlewareData.shift;let N=S,$=E;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&($=x),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(N=w),C&&!v){const z=ae(f.left,0),H=ae(f.right,0),W=ae(f.top,0),_=ae(f.bottom,0);g?$=b-2*(z!==0||H!==0?z+H:ae(f.left,f.right)):N=p-2*(W!==0||_!==0?W+_:ae(f.top,f.bottom))}await u({...t,availableWidth:$,availableHeight:N});const I=await s.getDimensions(c.floating);return b!==I.width||p!==I.height?{reset:{rects:!0}}:{}}}};function Ht(){return typeof window<"u"}function Ze(e){return pa(e)?(e.nodeName||"").toLowerCase():"#document"}function se(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ye(e){var t;return(t=(pa(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function pa(e){return Ht()?e instanceof Node||e instanceof se(e).Node:!1}function he(e){return Ht()?e instanceof Element||e instanceof se(e).Element:!1}function we(e){return Ht()?e instanceof HTMLElement||e instanceof se(e).HTMLElement:!1}function ha(e){return!Ht()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof se(e).ShadowRoot}function st(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=ge(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(o)}function Yl(e){return["table","td","th"].includes(Ze(e))}function jt(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Kr(e){const t=Yr(),r=he(e)?ge(e):e;return["transform","translate","scale","rotate","perspective"].some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function Xl(e){let t=Me(e);for(;we(t)&&!Qe(t);){if(Kr(t))return t;if(jt(t))return null;t=Me(t)}return null}function Yr(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Qe(e){return["html","body","#document"].includes(Ze(e))}function ge(e){return se(e).getComputedStyle(e)}function Gt(e){return he(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Me(e){if(Ze(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ha(e)&&e.host||ye(e);return ha(t)?t.host:t}function ga(e){const t=Me(e);return Qe(t)?e.ownerDocument?e.ownerDocument.body:e.body:we(t)&&st(t)?t:ga(t)}function it(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=ga(e),a=o===((n=e.ownerDocument)==null?void 0:n.body),s=se(o);if(a){const c=Xr(s);return t.concat(s,s.visualViewport||[],st(o)?o:[],c&&r?it(c):[])}return t.concat(o,it(o,[],r))}function Xr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ma(e){const t=ge(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=we(e),a=o?e.offsetWidth:r,s=o?e.offsetHeight:n,c=zt(r)!==a||zt(n)!==s;return c&&(r=a,n=s),{width:r,height:n,$:c}}function qr(e){return he(e)?e:e.contextElement}function Je(e){const t=qr(e);if(!we(t))return be(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:a}=ma(t);let s=(a?zt(r.width):r.width)/n,c=(a?zt(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const ql=be(0);function va(e){const t=se(e);return!Yr()||!t.visualViewport?ql:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Zl(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==se(e)?!1:t}function $e(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),a=qr(e);let s=be(1);t&&(n?he(n)&&(s=Je(n)):s=Je(e));const c=Zl(a,r,n)?va(a):be(0);let u=(o.left+c.x)/s.x,d=(o.top+c.y)/s.y,f=o.width/s.x,h=o.height/s.y;if(a){const v=se(a),g=n&&he(n)?se(n):n;let b=v,p=Xr(b);for(;p&&n&&g!==b;){const m=Je(p),y=p.getBoundingClientRect(),w=ge(p),x=y.left+(p.clientLeft+parseFloat(w.paddingLeft))*m.x,S=y.top+(p.clientTop+parseFloat(w.paddingTop))*m.y;u*=m.x,d*=m.y,f*=m.x,h*=m.y,u+=x,d+=S,b=se(p),p=Xr(b)}}return Vt({width:f,height:h,x:u,y:d})}function Zr(e,t){const r=Gt(e).scrollLeft;return t?t.left+r:$e(ye(e)).left+r}function ba(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-(r?0:Zr(e,n)),a=n.top+t.scrollTop;return{x:o,y:a}}function Ql(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const a=o==="fixed",s=ye(n),c=t?jt(t.floating):!1;if(n===s||c&&a)return r;let u={scrollLeft:0,scrollTop:0},d=be(1);const f=be(0),h=we(n);if((h||!h&&!a)&&((Ze(n)!=="body"||st(s))&&(u=Gt(n)),we(n))){const g=$e(n);d=Je(n),f.x=g.x+n.clientLeft,f.y=g.y+n.clientTop}const v=s&&!h&&!a?ba(s,u,!0):be(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-u.scrollLeft*d.x+f.x+v.x,y:r.y*d.y-u.scrollTop*d.y+f.y+v.y}}function Jl(e){return Array.from(e.getClientRects())}function ed(e){const t=ye(e),r=Gt(e),n=e.ownerDocument.body,o=ae(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=ae(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+Zr(e);const c=-r.scrollTop;return ge(n).direction==="rtl"&&(s+=ae(t.clientWidth,n.clientWidth)-o),{width:o,height:a,x:s,y:c}}function td(e,t){const r=se(e),n=ye(e),o=r.visualViewport;let a=n.clientWidth,s=n.clientHeight,c=0,u=0;if(o){a=o.width,s=o.height;const d=Yr();(!d||d&&t==="fixed")&&(c=o.offsetLeft,u=o.offsetTop)}return{width:a,height:s,x:c,y:u}}function rd(e,t){const r=$e(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=we(e)?Je(e):be(1),s=e.clientWidth*a.x,c=e.clientHeight*a.y,u=o*a.x,d=n*a.y;return{width:s,height:c,x:u,y:d}}function ya(e,t,r){let n;if(t==="viewport")n=td(e,r);else if(t==="document")n=ed(ye(e));else if(he(t))n=rd(t,r);else{const o=va(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Vt(n)}function wa(e,t){const r=Me(e);return r===t||!he(r)||Qe(r)?!1:ge(r).position==="fixed"||wa(r,t)}function nd(e,t){const r=t.get(e);if(r)return r;let n=it(e,[],!1).filter(c=>he(c)&&Ze(c)!=="body"),o=null;const a=ge(e).position==="fixed";let s=a?Me(e):e;for(;he(s)&&!Qe(s);){const c=ge(s),u=Kr(s);!u&&c.position==="fixed"&&(o=null),(a?!u&&!o:!u&&c.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||st(s)&&!u&&wa(e,s))?n=n.filter(f=>f!==s):o=c,s=Me(s)}return t.set(e,n),n}function od(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?jt(t)?[]:nd(t,this._c):[].concat(r),n],c=s[0],u=s.reduce((d,f)=>{const h=ya(t,f,o);return d.top=ae(h.top,d.top),d.right=Ae(h.right,d.right),d.bottom=Ae(h.bottom,d.bottom),d.left=ae(h.left,d.left),d},ya(t,c,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function ad(e){const{width:t,height:r}=ma(e);return{width:t,height:r}}function sd(e,t,r){const n=we(t),o=ye(t),a=r==="fixed",s=$e(e,!0,a,t);let c={scrollLeft:0,scrollTop:0};const u=be(0);if(n||!n&&!a)if((Ze(t)!=="body"||st(o))&&(c=Gt(t)),n){const v=$e(t,!0,a,t);u.x=v.x+t.clientLeft,u.y=v.y+t.clientTop}else o&&(u.x=Zr(o));const d=o&&!n&&!a?ba(o,c):be(0),f=s.left+c.scrollLeft-u.x-d.x,h=s.top+c.scrollTop-u.y-d.y;return{x:f,y:h,width:s.width,height:s.height}}function Qr(e){return ge(e).position==="static"}function xa(e,t){if(!we(e)||ge(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return ye(e)===r&&(r=r.ownerDocument.body),r}function Sa(e,t){const r=se(e);if(jt(e))return r;if(!we(e)){let o=Me(e);for(;o&&!Qe(o);){if(he(o)&&!Qr(o))return o;o=Me(o)}return r}let n=xa(e,t);for(;n&&Yl(n)&&Qr(n);)n=xa(n,t);return n&&Qe(n)&&Qr(n)&&!Kr(n)?r:n||Xl(e)||r}const id=async function(e){const t=this.getOffsetParent||Sa,r=this.getDimensions,n=await r(e.floating);return{reference:sd(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function cd(e){return ge(e).direction==="rtl"}const ld={convertOffsetParentRelativeRectToViewportRelativeRect:Ql,getDocumentElement:ye,getClippingRect:od,getOffsetParent:Sa,getElementRects:id,getClientRects:Jl,getDimensions:ad,getScale:Je,isElement:he,isRTL:cd};function Ca(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function dd(e,t){let r=null,n;const o=ye(e);function a(){var c;clearTimeout(n),(c=r)==null||c.disconnect(),r=null}function s(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),a();const d=e.getBoundingClientRect(),{left:f,top:h,width:v,height:g}=d;if(c||t(),!v||!g)return;const b=Wt(h),p=Wt(o.clientWidth-(f+v)),m=Wt(o.clientHeight-(h+g)),y=Wt(f),x={rootMargin:-b+"px "+-p+"px "+-m+"px "+-y+"px",threshold:ae(0,Ae(1,u))||1};let S=!0;function E(C){const N=C[0].intersectionRatio;if(N!==u){if(!S)return s();N?s(!1,N):n=setTimeout(()=>{s(!1,1e-7)},1e3)}N===1&&!Ca(d,e.getBoundingClientRect())&&s(),S=!1}try{r=new IntersectionObserver(E,{...x,root:o.ownerDocument})}catch{r=new IntersectionObserver(E,x)}r.observe(e)}return s(!0),a}function ud(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=n,d=qr(e),f=o||a?[...d?it(d):[],...it(t)]:[];f.forEach(y=>{o&&y.addEventListener("scroll",r,{passive:!0}),a&&y.addEventListener("resize",r)});const h=d&&c?dd(d,r):null;let v=-1,g=null;s&&(g=new ResizeObserver(y=>{let[w]=y;w&&w.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var x;(x=g)==null||x.observe(t)})),r()}),d&&!u&&g.observe(d),g.observe(t));let b,p=u?$e(e):null;u&&m();function m(){const y=$e(e);p&&!Ca(p,y)&&r(),p=y,b=requestAnimationFrame(m)}return r(),()=>{var y;f.forEach(w=>{o&&w.removeEventListener("scroll",r),a&&w.removeEventListener("resize",r)}),h==null||h(),(y=g)==null||y.disconnect(),g=null,u&&cancelAnimationFrame(b)}}const fd=jl,pd=Gl,hd=Bl,gd=Kl,md=Vl,Ea=Wl,vd=Ul,bd=(e,t,r)=>{const n=new Map,o={platform:ld,...r},a={...o.platform,_c:n};return zl(e,t,{...o,platform:a})};var Ut=typeof document<"u"?X.useLayoutEffect:X.useEffect;function Kt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!Kt(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const a=o[n];if(!(a==="_owner"&&e.$$typeof)&&!Kt(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function Ta(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Na(e,t){const r=Ta(e);return Math.round(t*r)/r}function Jr(e){const t=i.useRef(e);return Ut(()=>{t.current=e}),t}function yd(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:a,floating:s}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[f,h]=i.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[v,g]=i.useState(n);Kt(v,n)||g(n);const[b,p]=i.useState(null),[m,y]=i.useState(null),w=i.useCallback(k=>{k!==C.current&&(C.current=k,p(k))},[]),x=i.useCallback(k=>{k!==N.current&&(N.current=k,y(k))},[]),S=a||b,E=s||m,C=i.useRef(null),N=i.useRef(null),$=i.useRef(f),I=u!=null,z=Jr(u),H=Jr(o),W=Jr(d),_=i.useCallback(()=>{if(!C.current||!N.current)return;const k={placement:t,strategy:r,middleware:v};H.current&&(k.platform=H.current),bd(C.current,N.current,k).then(F=>{const Y={...F,isPositioned:W.current!==!1};P.current&&!Kt($.current,Y)&&($.current=Y,ir.flushSync(()=>{h(Y)}))})},[v,t,r,H,W]);Ut(()=>{d===!1&&$.current.isPositioned&&($.current.isPositioned=!1,h(k=>({...k,isPositioned:!1})))},[d]);const P=i.useRef(!1);Ut(()=>(P.current=!0,()=>{P.current=!1}),[]),Ut(()=>{if(S&&(C.current=S),E&&(N.current=E),S&&E){if(z.current)return z.current(S,E,_);_()}},[S,E,_,z,I]);const B=i.useMemo(()=>({reference:C,floating:N,setReference:w,setFloating:x}),[w,x]),M=i.useMemo(()=>({reference:S,floating:E}),[S,E]),j=i.useMemo(()=>{const k={position:r,left:0,top:0};if(!M.floating)return k;const F=Na(M.floating,f.x),Y=Na(M.floating,f.y);return c?{...k,transform:"translate("+F+"px, "+Y+"px)",...Ta(M.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:F,top:Y}},[r,c,M.floating,f.x,f.y]);return i.useMemo(()=>({...f,update:_,refs:B,elements:M,floatingStyles:j}),[f,_,B,M,j])}const wd=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Ea({element:n.current,padding:o}).fn(r):{}:n?Ea({element:n,padding:o}).fn(r):{}}}},xd=(e,t)=>({...fd(e),options:[e,t]}),Sd=(e,t)=>({...pd(e),options:[e,t]}),Cd=(e,t)=>({...vd(e),options:[e,t]}),Ed=(e,t)=>({...hd(e),options:[e,t]}),Td=(e,t)=>({...gd(e),options:[e,t]}),Nd=(e,t)=>({...md(e),options:[e,t]}),Pd=(e,t)=>({...wd(e),options:[e,t]});var Ad="Arrow",Pa=i.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...a}=e;return l.jsx(K.svg,{...a,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});Pa.displayName=Ad;var Od=Pa;function Md(e){const[t,r]=i.useState(void 0);return Ne(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let s,c;if("borderBoxSize"in a){const u=a.borderBoxSize,d=Array.isArray(u)?u[0]:u;s=d.inlineSize,c=d.blockSize}else s=e.offsetWidth,c=e.offsetHeight;r({width:s,height:c})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var en="Popper",[Aa,Oa]=ot(en),[kd,Ma]=Aa(en),ka=e=>{const{__scopePopper:t,children:r}=e,[n,o]=i.useState(null);return l.jsx(kd,{scope:t,anchor:n,onAnchorChange:o,children:r})};ka.displayName=en;var Da="PopperAnchor",_a=i.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,a=Ma(Da,r),s=i.useRef(null),c=ee(t,s);return i.useEffect(()=>{a.onAnchorChange((n==null?void 0:n.current)||s.current)}),n?null:l.jsx(K.div,{...o,ref:c})});_a.displayName=Da;var tn="PopperContent",[Dd,_d]=Aa(tn),Ia=i.forwardRef((e,t)=>{var xe,ht,nr,gt,or,rt;const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:a="center",alignOffset:s=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:v=!1,updatePositionStrategy:g="optimized",onPlaced:b,...p}=e,m=Ma(tn,r),[y,w]=i.useState(null),x=ee(t,ze=>w(ze)),[S,E]=i.useState(null),C=Md(S),N=(C==null?void 0:C.width)??0,$=(C==null?void 0:C.height)??0,I=n+(a!=="center"?"-"+a:""),z=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},H=Array.isArray(d)?d:[d],W=H.length>0,_={padding:z,boundary:H.filter(Ld),altBoundary:W},{refs:P,floatingStyles:B,placement:M,isPositioned:j,middlewareData:k}=yd({strategy:"fixed",placement:I,whileElementsMounted:(...ze)=>ud(...ze,{animationFrame:g==="always"}),elements:{reference:m.anchor},middleware:[xd({mainAxis:o+$,alignmentAxis:s}),u&&Sd({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Cd():void 0,..._}),u&&Ed({..._}),Td({..._,apply:({elements:ze,rects:L,availableWidth:R,availableHeight:Q})=>{const{width:ne,height:oe}=L.reference,G=ze.floating.style;G.setProperty("--radix-popper-available-width",`${R}px`),G.setProperty("--radix-popper-available-height",`${Q}px`),G.setProperty("--radix-popper-anchor-width",`${ne}px`),G.setProperty("--radix-popper-anchor-height",`${oe}px`)}}),S&&Pd({element:S,padding:c}),Fd({arrowWidth:N,arrowHeight:$}),v&&Nd({strategy:"referenceHidden",..._})]}),[F,Y]=Ra(M),Z=le(b);Ne(()=>{j&&(Z==null||Z())},[j,Z]);const re=(xe=k.arrow)==null?void 0:xe.x,J=(ht=k.arrow)==null?void 0:ht.y,te=((nr=k.arrow)==null?void 0:nr.centerOffset)!==0,[ie,ke]=i.useState();return Ne(()=>{y&&ke(window.getComputedStyle(y).zIndex)},[y]),l.jsx("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...B,transform:j?B.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ie,"--radix-popper-transform-origin":[(gt=k.transformOrigin)==null?void 0:gt.x,(or=k.transformOrigin)==null?void 0:or.y].join(" "),...((rt=k.hide)==null?void 0:rt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(Dd,{scope:r,placedSide:F,onArrowChange:E,arrowX:re,arrowY:J,shouldHideArrow:te,children:l.jsx(K.div,{"data-side":F,"data-align":Y,...p,ref:x,style:{...p.style,animation:j?void 0:"none"}})})})});Ia.displayName=tn;var La="PopperArrow",Id={top:"bottom",right:"left",bottom:"top",left:"right"},Fa=i.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,a=_d(La,n),s=Id[a.placedSide];return l.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:l.jsx(Od,{...o,ref:r,style:{...o.style,display:"block"}})})});Fa.displayName=La;function Ld(e){return e!==null}var Fd=e=>({name:"transformOrigin",options:e,fn(t){var m,y,w;const{placement:r,rects:n,middlewareData:o}=t,s=((m=o.arrow)==null?void 0:m.centerOffset)!==0,c=s?0:e.arrowWidth,u=s?0:e.arrowHeight,[d,f]=Ra(r),h={start:"0%",center:"50%",end:"100%"}[f],v=(((y=o.arrow)==null?void 0:y.x)??0)+c/2,g=(((w=o.arrow)==null?void 0:w.y)??0)+u/2;let b="",p="";return d==="bottom"?(b=s?h:`${v}px`,p=`${-u}px`):d==="top"?(b=s?h:`${v}px`,p=`${n.floating.height+u}px`):d==="right"?(b=`${-u}px`,p=s?h:`${g}px`):d==="left"&&(b=`${n.floating.width+u}px`,p=s?h:`${g}px`),{data:{x:b,y:p}}}});function Ra(e){const[t,r="center"]=e.split("-");return[t,r]}var Rd=ka,$d=_a,zd=Ia,Wd=Fa,Bd="VisuallyHidden",Yt=i.forwardRef((e,t)=>l.jsx(K.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Yt.displayName=Bd;var Vd=Yt,[Xt,sf]=ot("Tooltip",[Oa]),qt=Oa(),$a="TooltipProvider",Hd=700,rn="tooltip.open",[jd,nn]=Xt($a),za=e=>{const{__scopeTooltip:t,delayDuration:r=Hd,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:a}=e,[s,c]=i.useState(!0),u=i.useRef(!1),d=i.useRef(0);return i.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),l.jsx(jd,{scope:t,isOpenDelayed:s,delayDuration:r,onOpen:i.useCallback(()=>{window.clearTimeout(d.current),c(!1)},[]),onClose:i.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>c(!0),n)},[n]),isPointerInTransitRef:u,onPointerInTransitChange:i.useCallback(f=>{u.current=f},[]),disableHoverableContent:o,children:a})};za.displayName=$a;var Zt="Tooltip",[Gd,ct]=Xt(Zt),Wa=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o=!1,onOpenChange:a,disableHoverableContent:s,delayDuration:c}=e,u=nn(Zt,e.__scopeTooltip),d=qt(t),[f,h]=i.useState(null),v=bt(),g=i.useRef(0),b=s??u.disableHoverableContent,p=c??u.delayDuration,m=i.useRef(!1),[y=!1,w]=gr({prop:n,defaultProp:o,onChange:N=>{N?(u.onOpen(),document.dispatchEvent(new CustomEvent(rn))):u.onClose(),a==null||a(N)}}),x=i.useMemo(()=>y?m.current?"delayed-open":"instant-open":"closed",[y]),S=i.useCallback(()=>{window.clearTimeout(g.current),g.current=0,m.current=!1,w(!0)},[w]),E=i.useCallback(()=>{window.clearTimeout(g.current),g.current=0,w(!1)},[w]),C=i.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{m.current=!0,w(!0),g.current=0},p)},[p,w]);return i.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),l.jsx(Rd,{...d,children:l.jsx(Gd,{scope:t,contentId:v,open:y,stateAttribute:x,trigger:f,onTriggerChange:h,onTriggerEnter:i.useCallback(()=>{u.isOpenDelayed?C():S()},[u.isOpenDelayed,C,S]),onTriggerLeave:i.useCallback(()=>{b?E():(window.clearTimeout(g.current),g.current=0)},[E,b]),onOpen:S,onClose:E,disableHoverableContent:b,children:r})})};Wa.displayName=Zt;var on="TooltipTrigger",Ba=i.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=ct(on,r),a=nn(on,r),s=qt(r),c=i.useRef(null),u=ee(t,c,o.onTriggerChange),d=i.useRef(!1),f=i.useRef(!1),h=i.useCallback(()=>d.current=!1,[]);return i.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),l.jsx($d,{asChild:!0,...s,children:l.jsx(K.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:u,onPointerMove:U(e.onPointerMove,v=>{v.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:U(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:U(e.onPointerDown,()=>{d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:U(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:U(e.onBlur,o.onClose),onClick:U(e.onClick,o.onClose)})})});Ba.displayName=on;var an="TooltipPortal",[Ud,Kd]=Xt(an,{forceMount:void 0}),Va=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,a=ct(an,t);return l.jsx(Ud,{scope:t,forceMount:r,children:l.jsx(Fe,{present:r||a.open,children:l.jsx(wt,{asChild:!0,container:o,children:n})})})};Va.displayName=an;var et="TooltipContent",Ha=i.forwardRef((e,t)=>{const r=Kd(et,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...a}=e,s=ct(et,e.__scopeTooltip);return l.jsx(Fe,{present:n||s.open,children:s.disableHoverableContent?l.jsx(ja,{side:o,...a,ref:t}):l.jsx(Yd,{side:o,...a,ref:t})})}),Yd=i.forwardRef((e,t)=>{const r=ct(et,e.__scopeTooltip),n=nn(et,e.__scopeTooltip),o=i.useRef(null),a=ee(t,o),[s,c]=i.useState(null),{trigger:u,onClose:d}=r,f=o.current,{onPointerInTransitChange:h}=n,v=i.useCallback(()=>{c(null),h(!1)},[h]),g=i.useCallback((b,p)=>{const m=b.currentTarget,y={x:b.clientX,y:b.clientY},w=Qd(y,m.getBoundingClientRect()),x=Jd(y,w),S=eu(p.getBoundingClientRect()),E=ru([...x,...S]);c(E),h(!0)},[h]);return i.useEffect(()=>()=>v(),[v]),i.useEffect(()=>{if(u&&f){const b=m=>g(m,f),p=m=>g(m,u);return u.addEventListener("pointerleave",b),f.addEventListener("pointerleave",p),()=>{u.removeEventListener("pointerleave",b),f.removeEventListener("pointerleave",p)}}},[u,f,g,v]),i.useEffect(()=>{if(s){const b=p=>{const m=p.target,y={x:p.clientX,y:p.clientY},w=(u==null?void 0:u.contains(m))||(f==null?void 0:f.contains(m)),x=!tu(y,s);w?v():x&&(v(),d())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[u,f,s,d,v]),l.jsx(ja,{...e,ref:a})}),[Xd,qd]=Xt(Zt,{isInside:!1}),ja=i.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:s,...c}=e,u=ct(et,r),d=qt(r),{onClose:f}=u;return i.useEffect(()=>(document.addEventListener(rn,f),()=>document.removeEventListener(rn,f)),[f]),i.useEffect(()=>{if(u.trigger){const h=v=>{const g=v.target;g!=null&&g.contains(u.trigger)&&f()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[u.trigger,f]),l.jsx(yt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:h=>h.preventDefault(),onDismiss:f,children:l.jsxs(zd,{"data-state":u.stateAttribute,...d,...c,ref:t,style:{...c.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:[l.jsx(ro,{children:n}),l.jsx(Xd,{scope:r,isInside:!0,children:l.jsx(Vd,{id:u.contentId,role:"tooltip",children:o||n})})]})})});Ha.displayName=et;var Ga="TooltipArrow",Zd=i.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=qt(r);return qd(Ga,r).isInside?null:l.jsx(Wd,{...o,...n,ref:t})});Zd.displayName=Ga;function Qd(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(r,n,o,a)){case a:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Jd(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function eu(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function tu(e,t){const{x:r,y:n}=e;let o=!1;for(let a=0,s=t.length-1;a<t.length;s=a++){const c=t[a].x,u=t[a].y,d=t[s].x,f=t[s].y;u>n!=f>n&&r<(d-c)*(n-u)/(f-u)+c&&(o=!o)}return o}function ru(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),nu(t)}function nu(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const a=t[t.length-1],s=t[t.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const a=r[r.length-1],s=r[r.length-2];if((a.x-s.x)*(o.y-s.y)>=(a.y-s.y)*(o.x-s.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var ou=za,au=Wa,su=Ba,iu=Va,Ua=Ha;const lt=ou,dt=au,ut=su,tt=i.forwardRef(({className:e,sideOffset:t=4,...r},n)=>l.jsx(iu,{children:l.jsx(Ua,{ref:n,sideOffset:t,className:D("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",e),...r})}));tt.displayName=Ua.displayName;const cu="sidebar:state",lu=60*60*24*7,du="16rem",uu="18rem",fu="3rem",pu="b",Ka=i.createContext(null);function ft(){const e=i.useContext(Ka);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const sn=i.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:r,className:n,style:o,children:a,...s},c)=>{const u=ca(),[d,f]=i.useState(!1),[h,v]=i.useState(e),g=t??h,b=i.useCallback(w=>{const x=typeof w=="function"?w(g):w;r?r(x):v(x),document.cookie=`${cu}=${x}; path=/; max-age=${lu}`},[r,g]),p=i.useCallback(()=>u?f(w=>!w):b(w=>!w),[u,b,f]);i.useEffect(()=>{const w=x=>{x.key===pu&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),p())};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[p]);const m=g?"expanded":"collapsed",y=i.useMemo(()=>({state:m,open:g,setOpen:b,isMobile:u,openMobile:d,setOpenMobile:f,toggleSidebar:p}),[m,g,b,u,d,f,p]);return l.jsx(Ka.Provider,{value:y,children:l.jsx(lt,{delayDuration:0,children:l.jsx("div",{style:{"--sidebar-width":du,"--sidebar-width-icon":fu,...o},className:D("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",n),ref:c,...s,children:a})})})});sn.displayName="SidebarProvider";const cn=i.forwardRef(({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:n,children:o,...a},s)=>{const{isMobile:c,state:u,openMobile:d,setOpenMobile:f}=ft();return r==="none"?l.jsx("div",{className:D("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",n),ref:s,...a,children:o}):c?l.jsx(ra,{open:d,onOpenChange:f,...a,children:l.jsx(zr,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":uu},side:e,children:l.jsx("div",{className:"flex h-full w-full flex-col",children:o})})}):l.jsxs("div",{ref:s,className:"group peer hidden md:block text-sidebar-foreground","data-state":u,"data-collapsible":u==="collapsed"?r:"","data-variant":t,"data-side":e,children:[l.jsx("div",{className:D("duration-200 relative h-svh w-(--sidebar-width) bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),l.jsx("div",{className:D("duration-200 fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...a,children:l.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm",children:o})})]})});cn.displayName="Sidebar";const ln=i.forwardRef(({className:e,onClick:t,...r},n)=>{const{toggleSidebar:o}=ft();return l.jsxs(pe,{ref:n,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:D("h-7 w-7 text-sidebar-foreground",e),onClick:a=>{t==null||t(a),o()},...r,children:[l.jsx(ai,{}),l.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});ln.displayName="SidebarTrigger";const Ya=i.forwardRef(({className:e,...t},r)=>{const{toggleSidebar:n}=ft();return l.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:D("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});Ya.displayName="SidebarRail";const Xa=i.forwardRef(({className:e,...t},r)=>l.jsx("main",{ref:r,className:D("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-(--spacing(4)))] md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",e),...t}));Xa.displayName="SidebarInset";const qa=i.forwardRef(({className:e,...t},r)=>l.jsx($t,{ref:r,"data-sidebar":"input",className:D("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));qa.displayName="SidebarInput";const dn=i.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,"data-sidebar":"header",className:D("flex flex-col gap-2 p-2",e),...t}));dn.displayName="SidebarHeader";const un=i.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,"data-sidebar":"footer",className:D("flex flex-col gap-2 p-2",e),...t}));un.displayName="SidebarFooter";const Za=i.forwardRef(({className:e,...t},r)=>l.jsx(Rr,{ref:r,"data-sidebar":"separator",className:D("mx-2 w-auto bg-sidebar-border",e),...t}));Za.displayName="SidebarSeparator";const fn=i.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,"data-sidebar":"content",className:D("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));fn.displayName="SidebarContent";const Qa=i.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,"data-sidebar":"group",className:D("relative flex w-full min-w-0 flex-col p-2",e),...t}));Qa.displayName="SidebarGroup";const Ja=i.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const o=t?ue:"div";return l.jsx(o,{ref:n,"data-sidebar":"group-label",className:D("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-hidden ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...r})});Ja.displayName="SidebarGroupLabel";const es=i.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const o=t?ue:"button";return l.jsx(o,{ref:n,"data-sidebar":"group-action",className:D("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",e),...r})});es.displayName="SidebarGroupAction";const ts=i.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,"data-sidebar":"group-content",className:D("w-full text-sm",e),...t}));ts.displayName="SidebarGroupContent";const pn=i.forwardRef(({className:e,...t},r)=>l.jsx("ul",{ref:r,"data-sidebar":"menu",className:D("flex w-full min-w-0 flex-col gap-1",e),...t}));pn.displayName="SidebarMenu";const hn=i.forwardRef(({className:e,...t},r)=>l.jsx("li",{ref:r,"data-sidebar":"menu-item",className:D("group/menu-item relative",e),...t}));hn.displayName="SidebarMenuItem";const hu=Rt("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}}),gn=i.forwardRef(({asChild:e=!1,isActive:t=!1,variant:r="default",size:n="default",tooltip:o,className:a,...s},c)=>{const u=e?ue:"button",{isMobile:d,state:f}=ft(),h=l.jsx(u,{ref:c,"data-sidebar":"menu-button","data-size":n,"data-active":t,className:D(hu({variant:r,size:n}),a),...s});return o?(typeof o=="string"&&(o={children:o}),l.jsxs(dt,{children:[l.jsx(ut,{asChild:!0,children:h}),l.jsx(tt,{side:"right",align:"center",hidden:f!=="collapsed"||d,...o})]})):h});gn.displayName="SidebarMenuButton";const rs=i.forwardRef(({className:e,asChild:t=!1,showOnHover:r=!1,...n},o)=>{const a=t?ue:"button";return l.jsx(a,{ref:o,"data-sidebar":"menu-action",className:D("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...n})});rs.displayName="SidebarMenuAction";const ns=i.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:D("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));ns.displayName="SidebarMenuBadge";const os=i.forwardRef(({className:e,showIcon:t=!1,...r},n)=>{const o=i.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return l.jsxs("div",{ref:n,"data-sidebar":"menu-skeleton",className:D("rounded-md h-8 flex gap-2 px-2 items-center",e),...r,children:[t&&l.jsx(Br,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),l.jsx(Br,{className:"h-4 flex-1 max-w-(--skeleton-width)","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":o}})]})});os.displayName="SidebarMenuSkeleton";const as=i.forwardRef(({className:e,...t},r)=>l.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:D("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));as.displayName="SidebarMenuSub";const ss=i.forwardRef(({...e},t)=>l.jsx("li",{ref:t,...e}));ss.displayName="SidebarMenuSubItem";const is=i.forwardRef(({asChild:e=!1,size:t="md",isActive:r,className:n,...o},a)=>{const s=e?ue:"a";return l.jsx(s,{ref:a,"data-sidebar":"menu-sub-button","data-size":t,"data-active":r,className:D("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-hidden ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",n),...o})});is.displayName="SidebarMenuSubButton";function gu(e){const t=e+"CollectionProvider",[r,n]=ot(t),[o,a]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=g=>{const{scope:b,children:p}=g,m=X.useRef(null),y=X.useRef(new Map).current;return l.jsx(o,{scope:b,itemMap:y,collectionRef:m,children:p})};s.displayName=t;const c=e+"CollectionSlot",u=X.forwardRef((g,b)=>{const{scope:p,children:m}=g,y=a(c,p),w=ee(b,y.collectionRef);return l.jsx(ue,{ref:w,children:m})});u.displayName=c;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=X.forwardRef((g,b)=>{const{scope:p,children:m,...y}=g,w=X.useRef(null),x=ee(b,w),S=a(d,p);return X.useEffect(()=>(S.itemMap.set(w,{ref:w,...y}),()=>void S.itemMap.delete(w))),l.jsx(ue,{[f]:"",ref:x,children:m})});h.displayName=d;function v(g){const b=a(e+"CollectionConsumer",g);return X.useCallback(()=>{const m=b.collectionRef.current;if(!m)return[];const y=Array.from(m.querySelectorAll(`[${f}]`));return Array.from(b.itemMap.values()).sort((S,E)=>y.indexOf(S.ref.current)-y.indexOf(E.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:s,Slot:u,ItemSlot:h},v,n]}var mn="ToastProvider",[vn,mu,vu]=gu("Toast"),[cs,cf]=ot("Toast",[vu]),[bu,Qt]=cs(mn),ls=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:o="right",swipeThreshold:a=50,children:s}=e,[c,u]=i.useState(null),[d,f]=i.useState(0),h=i.useRef(!1),v=i.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${mn}\`. Expected non-empty \`string\`.`),l.jsx(vn.Provider,{scope:t,children:l.jsx(bu,{scope:t,label:r,duration:n,swipeDirection:o,swipeThreshold:a,toastCount:d,viewport:c,onViewportChange:u,onToastAdd:i.useCallback(()=>f(g=>g+1),[]),onToastRemove:i.useCallback(()=>f(g=>g-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:v,children:s})})};ls.displayName=mn;var ds="ToastViewport",yu=["F8"],bn="toast.viewportPause",yn="toast.viewportResume",us=i.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=yu,label:o="Notifications ({hotkey})",...a}=e,s=Qt(ds,r),c=mu(r),u=i.useRef(null),d=i.useRef(null),f=i.useRef(null),h=i.useRef(null),v=ee(t,h,s.onViewportChange),g=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),b=s.toastCount>0;i.useEffect(()=>{const m=y=>{var x;n.length!==0&&n.every(S=>y[S]||y.code===S)&&((x=h.current)==null||x.focus())};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[n]),i.useEffect(()=>{const m=u.current,y=h.current;if(b&&m&&y){const w=()=>{if(!s.isClosePausedRef.current){const C=new CustomEvent(bn);y.dispatchEvent(C),s.isClosePausedRef.current=!0}},x=()=>{if(s.isClosePausedRef.current){const C=new CustomEvent(yn);y.dispatchEvent(C),s.isClosePausedRef.current=!1}},S=C=>{!m.contains(C.relatedTarget)&&x()},E=()=>{m.contains(document.activeElement)||x()};return m.addEventListener("focusin",w),m.addEventListener("focusout",S),m.addEventListener("pointermove",w),m.addEventListener("pointerleave",E),window.addEventListener("blur",w),window.addEventListener("focus",x),()=>{m.removeEventListener("focusin",w),m.removeEventListener("focusout",S),m.removeEventListener("pointermove",w),m.removeEventListener("pointerleave",E),window.removeEventListener("blur",w),window.removeEventListener("focus",x)}}},[b,s.isClosePausedRef]);const p=i.useCallback(({tabbingDirection:m})=>{const w=c().map(x=>{const S=x.ref.current,E=[S,...Du(S)];return m==="forwards"?E:E.reverse()});return(m==="forwards"?w.reverse():w).flat()},[c]);return i.useEffect(()=>{const m=h.current;if(m){const y=w=>{var E,C,N;const x=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!x){const $=document.activeElement,I=w.shiftKey;if(w.target===m&&I){(E=d.current)==null||E.focus();return}const W=p({tabbingDirection:I?"backwards":"forwards"}),_=W.findIndex(P=>P===$);Sn(W.slice(_+1))?w.preventDefault():I?(C=d.current)==null||C.focus():(N=f.current)==null||N.focus()}};return m.addEventListener("keydown",y),()=>m.removeEventListener("keydown",y)}},[c,p]),l.jsxs(mc,{ref:u,role:"region","aria-label":o.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:b?void 0:"none"},children:[b&&l.jsx(wn,{ref:d,onFocusFromOutsideViewport:()=>{const m=p({tabbingDirection:"forwards"});Sn(m)}}),l.jsx(vn.Slot,{scope:r,children:l.jsx(K.ol,{tabIndex:-1,...a,ref:v})}),b&&l.jsx(wn,{ref:f,onFocusFromOutsideViewport:()=>{const m=p({tabbingDirection:"backwards"});Sn(m)}})]})});us.displayName=ds;var fs="ToastFocusProxy",wn=i.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...o}=e,a=Qt(fs,r);return l.jsx(Yt,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:s=>{var d;const c=s.relatedTarget;!((d=a.viewport)!=null&&d.contains(c))&&n()}})});wn.displayName=fs;var Jt="Toast",wu="toast.swipeStart",xu="toast.swipeMove",Su="toast.swipeCancel",Cu="toast.swipeEnd",ps=i.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:o,onOpenChange:a,...s}=e,[c=!0,u]=gr({prop:n,defaultProp:o,onChange:a});return l.jsx(Fe,{present:r||c,children:l.jsx(Nu,{open:c,...s,ref:t,onClose:()=>u(!1),onPause:le(e.onPause),onResume:le(e.onResume),onSwipeStart:U(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:U(e.onSwipeMove,d=>{const{x:f,y:h}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:U(e.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:U(e.onSwipeEnd,d=>{const{x:f,y:h}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),u(!1)})})})});ps.displayName=Jt;var[Eu,Tu]=cs(Jt,{onClose(){}}),Nu=i.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:o,open:a,onClose:s,onEscapeKeyDown:c,onPause:u,onResume:d,onSwipeStart:f,onSwipeMove:h,onSwipeCancel:v,onSwipeEnd:g,...b}=e,p=Qt(Jt,r),[m,y]=i.useState(null),w=ee(t,P=>y(P)),x=i.useRef(null),S=i.useRef(null),E=o||p.duration,C=i.useRef(0),N=i.useRef(E),$=i.useRef(0),{onToastAdd:I,onToastRemove:z}=p,H=le(()=>{var B;(m==null?void 0:m.contains(document.activeElement))&&((B=p.viewport)==null||B.focus()),s()}),W=i.useCallback(P=>{!P||P===1/0||(window.clearTimeout($.current),C.current=new Date().getTime(),$.current=window.setTimeout(H,P))},[H]);i.useEffect(()=>{const P=p.viewport;if(P){const B=()=>{W(N.current),d==null||d()},M=()=>{const j=new Date().getTime()-C.current;N.current=N.current-j,window.clearTimeout($.current),u==null||u()};return P.addEventListener(bn,M),P.addEventListener(yn,B),()=>{P.removeEventListener(bn,M),P.removeEventListener(yn,B)}}},[p.viewport,E,u,d,W]),i.useEffect(()=>{a&&!p.isClosePausedRef.current&&W(E)},[a,E,p.isClosePausedRef,W]),i.useEffect(()=>(I(),()=>z()),[I,z]);const _=i.useMemo(()=>m?ws(m):null,[m]);return p.viewport?l.jsxs(l.Fragment,{children:[_&&l.jsx(Pu,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:_}),l.jsx(Eu,{scope:r,onClose:H,children:ir.createPortal(l.jsx(vn.ItemSlot,{scope:r,children:l.jsx(gc,{asChild:!0,onEscapeKeyDown:U(c,()=>{p.isFocusedToastEscapeKeyDownRef.current||H(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:l.jsx(K.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":p.swipeDirection,...b,ref:w,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:U(e.onKeyDown,P=>{P.key==="Escape"&&(c==null||c(P.nativeEvent),P.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,H()))}),onPointerDown:U(e.onPointerDown,P=>{P.button===0&&(x.current={x:P.clientX,y:P.clientY})}),onPointerMove:U(e.onPointerMove,P=>{if(!x.current)return;const B=P.clientX-x.current.x,M=P.clientY-x.current.y,j=!!S.current,k=["left","right"].includes(p.swipeDirection),F=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,Y=k?F(0,B):0,Z=k?0:F(0,M),re=P.pointerType==="touch"?10:2,J={x:Y,y:Z},te={originalEvent:P,delta:J};j?(S.current=J,er(xu,h,te,{discrete:!1})):xs(J,p.swipeDirection,re)?(S.current=J,er(wu,f,te,{discrete:!1}),P.target.setPointerCapture(P.pointerId)):(Math.abs(B)>re||Math.abs(M)>re)&&(x.current=null)}),onPointerUp:U(e.onPointerUp,P=>{const B=S.current,M=P.target;if(M.hasPointerCapture(P.pointerId)&&M.releasePointerCapture(P.pointerId),S.current=null,x.current=null,B){const j=P.currentTarget,k={originalEvent:P,delta:B};xs(B,p.swipeDirection,p.swipeThreshold)?er(Cu,g,k,{discrete:!0}):er(Su,v,k,{discrete:!0}),j.addEventListener("click",F=>F.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),Pu=e=>{const{__scopeToast:t,children:r,...n}=e,o=Qt(Jt,t),[a,s]=i.useState(!1),[c,u]=i.useState(!1);return Mu(()=>s(!0)),i.useEffect(()=>{const d=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(d)},[]),c?null:l.jsx(wt,{asChild:!0,children:l.jsx(Yt,{...n,children:a&&l.jsxs(l.Fragment,{children:[o.label," ",r]})})})},Au="ToastTitle",hs=i.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return l.jsx(K.div,{...n,ref:t})});hs.displayName=Au;var Ou="ToastDescription",gs=i.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return l.jsx(K.div,{...n,ref:t})});gs.displayName=Ou;var ms="ToastAction",vs=i.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?l.jsx(ys,{altText:r,asChild:!0,children:l.jsx(xn,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${ms}\`. Expected non-empty \`string\`.`),null)});vs.displayName=ms;var bs="ToastClose",xn=i.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,o=Tu(bs,r);return l.jsx(ys,{asChild:!0,children:l.jsx(K.button,{type:"button",...n,ref:t,onClick:U(e.onClick,o.onClose)})})});xn.displayName=bs;var ys=i.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...o}=e;return l.jsx(K.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...o,ref:t})});function ws(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),ku(n)){const o=n.ariaHidden||n.hidden||n.style.display==="none",a=n.dataset.radixToastAnnounceExclude==="";if(!o)if(a){const s=n.dataset.radixToastAnnounceAlt;s&&t.push(s)}else t.push(...ws(n))}}),t}function er(e,t,r,{discrete:n}){const o=r.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?no(o,a):o.dispatchEvent(a)}var xs=(e,t,r=0)=>{const n=Math.abs(e.x),o=Math.abs(e.y),a=n>o;return t==="left"||t==="right"?a&&n>r:!a&&o>r};function Mu(e=()=>{}){const t=le(e);Ne(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function ku(e){return e.nodeType===e.ELEMENT_NODE}function Du(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Sn(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var _u=ls,Ss=us,Cs=ps,Es=hs,Ts=gs,Ns=vs,Ps=xn;const As=_u,Cn=i.forwardRef(({className:e,...t},r)=>l.jsx(Ss,{ref:r,className:D("fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));Cn.displayName=Ss.displayName;const Iu=Rt("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full sm:data-[state=open]:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground",success:"border-green-600 bg-green-600 text-white",warning:"border-yellow-500 bg-yellow-500 text-white",info:"border-blue-500 bg-blue-500 text-white",secondary:"border-secondary bg-secondary text-secondary-foreground",outline:"border-input bg-background text-foreground hover:bg-accent hover:text-accent-foreground"}},defaultVariants:{variant:"default"}}),En=i.forwardRef(({className:e,variant:t,...r},n)=>l.jsx(Cs,{ref:n,className:D(Iu({variant:t}),e),...r}));En.displayName=Cs.displayName;const Os=i.forwardRef(({className:e,...t},r)=>l.jsx(Ns,{ref:r,className:D("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-hidden focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 hover:group-[.destructive]:border-destructive/30 hover:group-[.destructive]:bg-destructive hover:group-[.destructive]:text-destructive-foreground focus:group-[.destructive]:ring-destructive",e),...t}));Os.displayName=Ns.displayName;const Tn=i.forwardRef(({className:e,...t},r)=>l.jsx(Ps,{ref:r,className:D("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-hidden focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 hover:group-[.destructive]:text-red-50 focus:group-[.destructive]:ring-red-400 focus:group-[.destructive]:ring-offset-red-600",e),"toast-close":"",...t,children:l.jsx(cr,{className:"h-4 w-4"})}));Tn.displayName=Ps.displayName;const Nn=i.forwardRef(({className:e,...t},r)=>l.jsx(Es,{ref:r,className:D("text-sm font-semibold [&+div]:text-xs",e),...t}));Nn.displayName=Es.displayName;const Pn=i.forwardRef(({className:e,...t},r)=>l.jsx(Ts,{ref:r,className:D("text-sm opacity-90",e),...t}));Pn.displayName=Ts.displayName;const Lu=1,Fu=1e6;let An=0;function Ru(){return An=(An+1)%Number.MAX_SAFE_INTEGER,An.toString()}const On=new Map,Ms=e=>{if(On.has(e))return;const t=setTimeout(()=>{On.delete(e),pt({type:"REMOVE_TOAST",toastId:e})},Fu);On.set(e,t)},$u=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Lu)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?Ms(r):e.toasts.forEach(n=>Ms(n.id)),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return{...e,toasts:t.toastId?e.toasts.filter(r=>r.id!==t.toastId):[]}}},tr=[];let rr={toasts:[]};function pt(e){rr=$u(rr,e),tr.forEach(t=>t(rr))}function ks({...e}){const t=Ru(),r=o=>pt({type:"UPDATE_TOAST",toast:{...o,id:t}}),n=()=>pt({type:"DISMISS_TOAST",toastId:t});return pt({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||n()}}}),{id:t,dismiss:n,update:r}}function Mn(){const[e,t]=i.useState(rr);return i.useEffect(()=>(tr.push(t),()=>{const r=tr.indexOf(t);r>-1&&tr.splice(r,1)}),[]),{...e,toast:ks,dismiss:r=>pt({type:"DISMISS_TOAST",toastId:r})}}function Ds(){const{toasts:e}=Mn();return l.jsxs(As,{children:[e.map(function({id:t,title:r,description:n,action:o,...a}){return l.jsxs(En,{...a,children:[l.jsxs("div",{className:"grid gap-1",children:[r&&l.jsx(Nn,{children:r}),n&&l.jsx(Pn,{children:n})]}),o,l.jsx(Tn,{})]},t)}),l.jsx(Cn,{})]})}function _s({onSignOut:e,searchResultsRouteName:t,rightMenu:r}){const[n,o]=X.useState(""),a=sr.useNavigate(),{toast:s}=Mn(),c=()=>{const d=n.trim();if(!d||d.length<2){s({title:"Enter more characters to search",description:"At least 2 characters are needed to search products.",variant:"destructive",duration:5e3});return}const f=new URLSearchParams({q:d});a({pathname:t,search:f.toString()}),o("")},u=d=>{d.key==="Enter"&&c()};return l.jsxs("header",{className:"flex h-16 items-center gap-4 border-b sidebar-foreground bg-sidebar px-6 fixed top-0 right-0 z-50 lg:left-64 left-0 border-sidebar-border",children:[l.jsx(ln,{className:"lg:hidden",children:l.jsx(ni,{className:"h-6 w-6"})}),l.jsx("div",{className:"flex flex-1 items-center gap-4",children:l.jsx("div",{className:"relative w-full max-w-sm",children:l.jsxs("div",{children:[l.jsx("button",{type:"button",className:"absolute left-2 top-1/2 -translate-y-1/2",onClick:c,"aria-label":"Search",children:l.jsx(ii,{className:"h-4 w-4 text-muted-foreground"})}),l.jsx($t,{placeholder:"Search...",className:"w-full pl-8 bg-white text-black",value:n,onChange:d=>o(d.target.value),onKeyDown:u})]})})}),r||l.jsx(l.Fragment,{}),e&&l.jsx("div",{className:"flex items-center gap-4",children:l.jsxs(pe,{variant:"ghost",size:"icon",className:"h-9 w-9",onClick:e,children:[l.jsx(ri,{className:"h-4 w-4 text-sidebar-foreground"}),l.jsx("span",{className:"sr-only",children:"Sign out"})]})})]})}function Is({routes:e,footer:t,dashboardTitle:r}){const{appID:n}=sr.useParams(),o=e.filter(a=>a.showInNav);return l.jsxs(cn,{className:"border-r border-sidebar-border",children:[l.jsx(dn,{className:"border-b border-sidebar-border px-6 h-16 justify-center bg-sidebar text-sidebar-foreground",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"flex items-center justify-center",children:l.jsx("img",{src:"https://api.randmar.io/images/RandmarIcon.svg",alt:"Randmar Icon",className:"h-4 w-4 filter brightness-0 saturate-100 invert"})}),l.jsx("span",{className:"font-semibold text-lg",children:r})]})}),l.jsx(fn,{className:"py-4 bg-sidebar text-sidebar-foreground",children:l.jsx(pn,{children:o.map(a=>{const s=a.icon,c=`/${a.path.replace(":appID",n)}`;return l.jsx(hn,{children:l.jsx(gn,{asChild:!0,children:l.jsxs(sr.Link,{to:c,className:"transition-colors hover:bg-muted px-6",children:[s&&l.jsx(s,{className:"h-4 w-4"}),l.jsx("span",{children:a.label})]})})},a.key)})})}),l.jsx(un,{className:"border-t border-sidebar-border p-4 bg-sidebar-background text-sidebar-foreground",children:t})]})}function zu({children:e,rightMenu:t,routes:r,footer:n,searchResultsRouteName:o,dashboardTitle:a,onSignOut:s}){return l.jsx(l.Fragment,{children:l.jsx(sn,{children:l.jsxs("div",{className:"flex grow",children:[l.jsx(Is,{routes:r,footer:n,dashboardTitle:a}),l.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[l.jsx(_s,{onSignOut:s,rightMenu:t,searchResultsRouteName:o}),l.jsx("main",{className:"flex-1 overflow-auto mt-16",children:e}),l.jsx(Ds,{})]})]})})})}const Wu={sm:100,md:200,lg:300,xl:400};function Bu({randmarSKU:e,size:t="md",alt:r,secondaryContent:n}){const[o,a]=i.useState(!1),[s,c]=i.useState(!1),[u,d]=i.useState(!1),[f,h]=i.useState(!1),v=`https://api.randmar.io/Product/${e}/Video`;i.useEffect(()=>{(async()=>{try{const x=await(await fetch(v+"/Exists")).json();c(x)}catch(w){console.error("Error checking for video:",w),c(!1)}})()},[e,v]);async function g(){if(s){h(!0);try{const w=await(await fetch(v)).blob(),x=window.URL.createObjectURL(w),S=document.createElement("a");S.href=x,S.download=`${e||"product"}-video.mp4`,document.body.appendChild(S),S.click(),document.body.removeChild(S),window.URL.revokeObjectURL(x)}catch(y){console.error("Error downloading video:",y)}finally{h(!1)}}}function b(){navigator.clipboard.writeText(v),d(!0),setTimeout(()=>{d(!1)},2e3)}function p(){a(!0)}const m=Wu[t||"xl"];return l.jsxs(l.Fragment,{children:[l.jsx(Lt,{open:o,onOpenChange:a,children:l.jsx(Ft,{className:"max-w-4xl p-0 overflow-hidden",children:n?l.jsxs("div",{className:"flex flex-row",children:[l.jsxs("video",{className:"w-full rounded-l-lg max-h-[720px] object-contain",controls:!0,autoPlay:!0,muted:!0,loop:!0,children:[l.jsx("source",{src:v,type:"video/mp4"}),"Your browser does not support the video tag."]}),l.jsx("div",{className:"flex-grow min-w-[400px] h-[70vh] p-6",children:n})]}):l.jsxs("div",{className:"w-full relative",children:[l.jsxs("video",{className:"w-full max-h-[720px] object-contain",controls:!0,autoPlay:!0,children:[l.jsx("source",{src:v,type:"video/mp4"}),"Your browser does not support the video tag."]}),l.jsxs("div",{className:"absolute top-2 right-12 flex gap-1",children:[l.jsx(lt,{children:l.jsxs(dt,{children:[l.jsx(ut,{asChild:!0,children:l.jsx(pe,{variant:"secondary",size:"icon",onClick:b,children:u?l.jsx(Js,{className:"h-4 w-4"}):l.jsx(ei,{className:"h-4 w-4"})})}),l.jsx(tt,{children:l.jsx("p",{children:"Copy video link"})})]})}),l.jsx(lt,{children:l.jsxs(dt,{children:[l.jsx(ut,{asChild:!0,children:l.jsx(pe,{variant:"secondary",size:"icon",onClick:g,disabled:f,children:l.jsx(ti,{className:"h-4 w-4"})})}),l.jsx(tt,{children:l.jsx("p",{children:"Download video"})})]})})]})]})})}),l.jsxs("div",{className:"relative w-max h-max",children:[l.jsx("img",{alt:r||`Product ${e}`,className:`rounded-md ${s?"cursor-pointer":""}`,onClick:s?p:void 0,src:`https://api.randmar.io/Product/${e}/Image?width=${m*1.5}&height=${m*1.5}`,width:m,height:m}),s&&l.jsx(lt,{children:l.jsxs(dt,{children:[l.jsx(ut,{asChild:!0,children:l.jsx(pe,{variant:"secondary",size:"icon",className:"absolute top-2 right-2",onClick:p,children:l.jsx(si,{className:"h-4 w-4"})})}),l.jsx(tt,{children:l.jsx("p",{children:"Play video"})})]})})]})]})}T.AvatarFooter=Ml,T.Button=pe,T.Dialog=Lt,T.DialogClose=kr,T.DialogContent=Ft,T.DialogDescription=Lr,T.DialogFooter=_r,T.DialogHeader=Dr,T.DialogTitle=Ir,T.DialogTrigger=Xo,T.Input=$t,T.InputOTP=Xi,T.InputOTPGroup=qi,T.InputOTPSeparator=Qi,T.InputOTPSlot=Zi,T.Layout=zu,T.Navbar=Is,T.ProductImage=Bu,T.Separator=Rr,T.Sheet=ra,T.SheetClose=Al,T.SheetContent=zr,T.SheetDescription=ia,T.SheetFooter=aa,T.SheetHeader=oa,T.SheetOverlay=$r,T.SheetPortal=na,T.SheetTitle=sa,T.SheetTrigger=Pl,T.Sidebar=cn,T.SidebarContent=fn,T.SidebarFooter=un,T.SidebarGroup=Qa,T.SidebarGroupAction=es,T.SidebarGroupContent=ts,T.SidebarGroupLabel=Ja,T.SidebarHeader=dn,T.SidebarInput=qa,T.SidebarInset=Xa,T.SidebarMenu=pn,T.SidebarMenuAction=rs,T.SidebarMenuBadge=ns,T.SidebarMenuButton=gn,T.SidebarMenuItem=hn,T.SidebarMenuSkeleton=os,T.SidebarMenuSub=as,T.SidebarMenuSubButton=is,T.SidebarMenuSubItem=ss,T.SidebarProvider=sn,T.SidebarRail=Ya,T.SidebarSeparator=Za,T.SidebarTrigger=ln,T.Skeleton=Br,T.Toast=En,T.ToastAction=Os,T.ToastClose=Tn,T.ToastDescription=Pn,T.ToastProvider=As,T.ToastTitle=Nn,T.ToastViewport=Cn,T.Toaster=Ds,T.Tooltip=dt,T.TooltipContent=tt,T.TooltipProvider=lt,T.TooltipTrigger=ut,T.Topbar=_s,T.buttonVariants=Fr,T.toast=ks,T.useIsMobile=ca,T.useSidebar=ft,T.useToast=Mn,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})});
|