@dub/ui 0.2.21 → 0.2.22
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/chunk-E3J362K2.mjs +2 -0
- package/dist/icons/index.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
package/dist/icons/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client"
|
|
2
|
-
import{$,$a,$b,$c,A,Aa,Ab,Ac,B,Ba,Bb,Bc,C,Ca,Cb,Cc,D,Da,Db,Dc,E,Ea,Eb,Ec,F,Fa,Fb,Fc,G,Ga,Gb,Gc,H,Ha,Hb,Hc,I,Ia,Ib,Ic,J,Ja,Jb,Jc,K,Ka,Kb,Kc,L,La,Lb,Lc,M,Ma,Mb,Mc,N,Na,Nb,Nc,O,Oa,Ob,Oc,P,Pa,Pb,Pc,Q,Qa,Qb,Qc,R,Ra,Rb,Rc,S,Sa,Sb,Sc,T,Ta,Tb,Tc,U,Ua,Ub,Uc,V,Va,Vb,Vc,W,Wa,Wb,Wc,X,Xa,Xb,Xc,Y,Ya,Yb,Yc,Z,Za,Zb,Zc,_,_a,_b,_c,a,aa,ab,ac,ad,b,ba,bb,bc,bd,c,ca,cb,cc,cd,d,da,db,dc,dd,e,ea,eb,ec,ed,f,fa,fb,fc,fd,g,ga,gb,gc,gd,h,ha,hb,hc,hd,i,ia,ib,ic,id,j,ja,jb,jc,k,ka,kb,kc,l,la,lb,lc,m,ma,mb,mc,n,na,nb,nc,o,oa,ob,oc,p,pa,pb,pc,q,qa,qb,qc,r,ra,rb,rc,s,sa,sb,sc,t,ta,tb,tc,u,ua,ub,uc,v,va,vb,vc,w,wa,wb,wc,x,xa,xb,xc,y,ya,yb,yc,z,za,zb,zc}from"../chunk-
|
|
2
|
+
import{$,$a,$b,$c,A,Aa,Ab,Ac,B,Ba,Bb,Bc,C,Ca,Cb,Cc,D,Da,Db,Dc,E,Ea,Eb,Ec,F,Fa,Fb,Fc,G,Ga,Gb,Gc,H,Ha,Hb,Hc,I,Ia,Ib,Ic,J,Ja,Jb,Jc,K,Ka,Kb,Kc,L,La,Lb,Lc,M,Ma,Mb,Mc,N,Na,Nb,Nc,O,Oa,Ob,Oc,P,Pa,Pb,Pc,Q,Qa,Qb,Qc,R,Ra,Rb,Rc,S,Sa,Sb,Sc,T,Ta,Tb,Tc,U,Ua,Ub,Uc,V,Va,Vb,Vc,W,Wa,Wb,Wc,X,Xa,Xb,Xc,Y,Ya,Yb,Yc,Z,Za,Zb,Zc,_,_a,_b,_c,a,aa,ab,ac,ad,b,ba,bb,bc,bd,c,ca,cb,cc,cd,d,da,db,dc,dd,e,ea,eb,ec,ed,f,fa,fb,fc,fd,g,ga,gb,gc,gd,h,ha,hb,hc,hd,i,ia,ib,ic,id,j,ja,jb,jc,k,ka,kb,kc,l,la,lb,lc,m,ma,mb,mc,n,na,nb,nc,o,oa,ob,oc,p,pa,pb,pc,q,qa,qb,qc,r,ra,rb,rc,s,sa,sb,sc,t,ta,tb,tc,u,ua,ub,uc,v,va,vb,vc,w,wa,wb,wc,x,xa,xb,xc,y,ya,yb,yc,z,za,zb,zc}from"../chunk-E3J362K2.mjs";import"../chunk-34EW67AY.mjs";export{H as Africa,T as Airtm,N as Amazon,Z as Apple,_ as ArrowBoldUp,$ as ArrowRight,aa as ArrowTrendUp,ba as ArrowTurnLeft,ca as ArrowTurnRight2,da as ArrowUpRight,ea as ArrowsOppositeDirectionY,I as Asia,fa as BadgeCheck,ga as Blog,ha as Bolt,ia as BoltFill,ka as Book2,la as Book2Fill,ma as Book2Small,ja as BookOpen,na as Books2,oa as BoxArchive,pa as BulletList,qa as BulletListFill,ua as Calendar6,sa as CalendarDays,ra as CalendarIcon,ta as CalendarRefresh,y as CardAmex,z as CardDiscover,A as CardMastercard,B as CardVisa,va as Cards,wa as CaretUpFill,U as CashApp,xa as ChartActivity2,ya as ChartLine,O as ChatGPT,za as Check,Aa as Check2,Ba as CheckboxCheckedFill,Ca as CheckboxUnchecked,Da as CircleCheck,Ea as CircleCheckFill,Fa as CircleDollar,Ga as CircleDotted,Ha as CircleHalfDottedCheck,Ia as CircleHalfDottedClock,Ja as CircleInfo,Ka as CirclePlay,La as CirclePlayFill,Ma as CircleQuestion,Na as CircleWarning,Oa as CircleXmark,Pa as Circles,Qa as Circles3,Ra as CloudUpload,Sa as Code,Ta as ColorPalette2,Ua as ConnectedDots,Wa as ConnectedDots4,Va as ConnectedDotsFill,Xa as Connections3,a as Copy,Ya as CreditCard,Za as Crosshairs3,_a as Crown,b as CrownSmall,$a as Cube,ab as CubeSettings,bb as CubeSettingsFill,cb as CurrencyDollar,db as CursorRays,eb as DatabaseKey,fb as Desktop,gb as DiamondTurnRight,hb as Dots,ib as Download,c as DubCraftedShield,jb as Duplicate,kb as EarthPosition,lb as EnvelopeArrowRight,J as Europe,d as ExpandingArrow,mb as Eye,nb as EyeSlash,n as Facebook,ob as FeatherFill,P as Figma,pb as FileZip2,rb as Filter2,qb as FilterBars,tb as Flag2,ub as Flag6,sb as FlagWavy,vb as Folder,wb as Folder5,xb as GamingConsole,yb as Gauge6,zb as Gear,Ab as Gear2,Bb as Gear3,Cb as Gem,Db as Gift,Eb as GiftFill,Q as GitHubEnhanced,o as Github,Fb as Globe,Ib as Globe2,Gb as GlobePointer,Hb as GlobeSearch,C as Go,p as Google,R as GoogleEnhanced,Jb as GreekTemple,Kb as GridIcon,Lb as GridLayoutRows,Mb as GridPlus,Nb as Headset,Ob as HeadsetFill,Pb as HeartFill,Qb as HexadecagonStar,Rb as Hyperlink,Sb as Icosahedron,Tb as Incognito,Ub as InputPassword,Vb as InputSearch,Wb as InvoiceDollar,Xb as Key,Yb as LayoutSidebar,Zb as License,_b as LinesY,ac as Link4,$b as LinkBroken,q as LinkedIn,k as LoadingCircle,l as LoadingDots,m as LoadingSpinner,bc as LocationPin,e as Magic,cc as Magnifier,dc as MapPosition,f as MatrixLines,ec as Menu3,fc as MessageSmile,gc as MobilePhone,hc as MoneyBill2,ic as MoneyBills2,K as NorthAmerica,jc as Note,rc as NucleoPhoto,L as Oceania,kc as OfficeBuilding,lc as Page2,mc as Paintbrush,nc as Palette2,V as Payoneer,W as Paypal,pc as Pen2,oc as PenWriting,qc as PercentageArrowDown,g as Photo,D as Php,sc as Plug2,tc as Plus,uc as Post,r as Prisma,s as ProductHunt,vc as Pyramid,E as Python,wc as QRCode,t as Raycast,xc as Receipt2,yc as ReferredVia,zc as Refresh2,Ac as Robot,F as Ruby,Bc as SatelliteDish,Cc as ScanText,Dc as Scribble,Ec as ShieldAlert,Fc as ShieldCheck,Gc as ShieldKeyhole,Hc as ShieldSlash,Ic as Shuffle,Jc as Sliders,h as SortOrder,M as SouthAmerica,Kc as Sparkle3,S as Spotify,Lc as SquareChart,Mc as SquareLayoutGrid6,Nc as SquareXmark,Oc as Stars2,X as StripeLink,i as Success,Wc as TV,Pc as TableIcon,Qc as TableRows2,Rc as Tablet,Sc as Tag,Tc as Tags,j as Tick,u as Tinybird,Uc as Toggle2Fill,Vc as Trash,v as Twitter,G as Typescript,w as Unsplash,Xc as User,Yc as UserCheck,Zc as UserCrown,_c as Users,ad as Users2,bd as Users6,$c as UsersSettings,Y as Venmo,cd as Versions2,dd as Watch,ed as Webhook,fd as Window,gd as WindowSearch,hd as WindowSettings,id as Xmark,x as YouTube};
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client"
|
|
2
|
-
import{$ as Jm,$a as B0,$b as Su,$c as Cp,A as Em,Aa as _o,Ab as lu,Ac as qu,B as Am,Ba as Ho,Bb as cu,Bc as na,C as Lo,Ca as Vo,Cb as du,Cc as Qu,D as To,Da as Bo,Db as Zo,Dc as Xu,E as Eo,Ea as N0,Eb as mu,Ec as Ju,F as Ao,Fa as k0,Fb as uu,Fc as ep,G as Do,Ga as P0,Gb as qo,Gc as tp,H as Dm,Ha as Wo,Hb as pu,Hc as rp,I as Im,Ia as Fo,Ib as Qo,Ic as op,J as zm,Ja as Uo,Jb as fu,Jc as ap,K as Om,Ka as S0,Kb as gu,Kc as ip,L as _m,La as M0,Lb as hu,Lc as np,M as Hm,Ma as R0,Mb as vu,Mc as sp,N as Vm,Na as Cr,Nb as bu,Nc as lp,O as Bm,Oa as L0,Ob as Xo,Oc as cp,P as Wm,Pa as T0,Pb as Jo,Pc as dp,Q as Fm,Qa as E0,Qb as ea,Qc as mp,R as Um,Ra as Go,Rb as ta,Rc as up,S as Gm,Sa as A0,Sb as xu,Sc as pp,T as $m,Ta as D0,Tb as yu,Tc as fp,U as Km,Ua as I0,Ub as wu,Uc as gp,V as jm,Va as Ot,Vb as ra,Vc as hp,W as Ym,Wa as z0,Wb as Cu,Wc as vp,X as Zm,Xa as O0,Xb as Nu,Xc as bp,Y as qm,Ya as _0,Yb as ku,Yc as xp,Z as Qm,Za as H0,Zb as Pu,Zc as yp,_ as Xm,_a as V0,_b as oa,_c as wp,a as yo,aa as e0,ab as W0,ac as Mu,ad as Np,b as ym,ba as t0,bb as _t,bc as Ru,bd as kp,c as wm,ca as r0,cb as F0,cc as Lu,cd as Pp,d as wo,da as o0,db as U0,dc as Tu,dd as Sp,e as Co,ea as a0,eb as G0,ec as Eu,ed as Mp,f as Cm,fa as i0,fb as $0,fc as Au,fd as Rp,g as No,ga as n0,gb as K0,gc as Du,gd as Lp,h as ko,ha as s0,hb as j0,hc as Iu,hd as Tp,i as Po,ia as l0,ib as Y0,ic as zu,id as Ep,j as So,ja as c0,jb as Z0,jc as Ou,k as mt,ka as d0,kb as q0,kc as _u,l as Nm,la as Io,lb as Q0,lc as aa,m as ye,ma as m0,mb as $o,mc as Hu,n as km,na as u0,nb as Ko,nc as Vu,o as At,oa as p0,ob as jo,oc as Bu,p as Pm,pa as f0,pb as X0,pc as Wu,q as Dt,qa as zo,qb as J0,qc as Fu,r as Sm,ra as g0,rb as eu,rc as Uu,s as Mo,sa as h0,sb as tu,sc as Gu,t as Ro,ta as v0,tb as ru,tc as Ht,u as Mm,ua as b0,ub as Yo,uc as $u,v as It,va as x0,vb as ou,vc as Ku,w as Rm,wa as y0,wb as au,wc as ju,x as zt,xa as w0,xb as iu,xc as Yu,y as Lm,ya as C0,yb as nu,yc as ia,z as Tm,za as Oo,zb as su,zc as Zu}from"./chunk-2P6AY23V.mjs";import{a as Y}from"./chunk-NWME2ANF.mjs";import{a as uo,b as I,c as Rt,d as Lt,e as po,f as qe,g as fo,h as go,i as Tt,j as ho,k as vo,l as Et,m as bo,n as me,o as n,p as xo}from"./chunk-34EW67AY.mjs";import*as ae from"@radix-ui/react-accordion";import{ChevronDown as Gi}from"lucide-react";import*as Bt from"react";import{jsx as Vt,jsxs as Yi}from"react/jsx-runtime";var _p=ae.Root,$i=Bt.forwardRef(({className:e,...t},r)=>Vt(ae.Item,{ref:r,className:n("border-b border-b-slate-200 py-3 last:border-none",e),...t}));$i.displayName="AccordionItem";var Ki=Bt.forwardRef(({className:e,children:t,variant:r="chevron",...o},a)=>{let s=r==="chevron"?Gi:Ht;return Vt(ae.Header,{className:"flex",children:Yi(ae.Trigger,{ref:a,className:n("flex flex-1 items-center justify-between font-medium transition-all sm:text-lg",{"[&[data-state=open]>svg]:rotate-180":r==="chevron","[&[data-state=open]>svg]:rotate-45":r==="plus"},e),...o,children:[t,Vt(s,{className:"h-5 w-5 flex-none transition-transform duration-300"})]})})});Ki.displayName=ae.Trigger.displayName;var ji=Bt.forwardRef(({className:e,children:t,...r},o)=>Vt(ae.Content,{ref:o,className:n("data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm text-gray-500 transition-all sm:text-base",e),...r,children:t}));ji.displayName=ae.Content.displayName;import{cva as Zi}from"class-variance-authority";import*as Wt from"react";import{jsx as Nr}from"react/jsx-runtime";var qi=Zi("relative w-full rounded-lg border px-4 py-6 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive border-red-500 dark:border-red-500"}},defaultVariants:{variant:"default"}}),Qi=Wt.forwardRef(({className:e,variant:t,...r},o)=>Nr("div",{ref:o,role:"alert",className:n(qi({variant:t}),e),...r}));Qi.displayName="Alert";var Xi=Wt.forwardRef(({className:e,...t},r)=>Nr("h5",{ref:r,className:n("text-md mb-2 font-medium leading-none tracking-tight",e),...t}));Xi.displayName="AlertTitle";var Ji=Wt.forwardRef(({className:e,...t},r)=>Nr("div",{ref:r,className:n("text-sm [&_p]:leading-relaxed",e),...t}));Ji.displayName="AlertDescription";import{sha256 as en}from"js-sha256";import{useState as tn}from"react";import{jsx as kr}from"react/jsx-runtime";function rn(e){if(e!=null&&e.image)return e.image;if(!(e!=null&&e.id))return"https://api.dicebear.com/9.x/micah/svg";let t=`https://api.dicebear.com/9.x/micah/svg?seed=${encodeURIComponent(e.id)}`,r=`https://api.dicebear.com/9.x/micah/png/${encodeURIComponent(`seed=${encodeURIComponent(e.id)}`)}`;return e.email?`https://www.gravatar.com/avatar/${en(e.email)}?d=${encodeURIComponent(r)}`:t}function $p({user:e={},className:t}){if(!e)return kr("div",{className:n("h-10 w-10 animate-pulse rounded-full border border-gray-300 bg-gray-100",t)});let[r,o]=tn(rn(e));return kr("img",{alt:`Avatar for ${e.name||e.email}`,referrerPolicy:"no-referrer",src:r,className:n("h-10 w-10 rounded-full border border-gray-300",t),draggable:!1,onError:()=>{o(`https://api.dicebear.com/9.x/micah/svg?seed=${encodeURIComponent(e.id||"")}`)}})}function Kp({id:e,className:t}){return kr("img",{src:`https://api.dicebear.com/9.x/shapes/svg?seed=${e}`,alt:"avatar",className:n("h-10 w-10 rounded-full",t),draggable:!1})}import{cva as on}from"class-variance-authority";import{jsx as nn}from"react/jsx-runtime";var an=on("max-w-fit rounded-full border px-2 py-px text-xs font-medium whitespace-nowrap",{variants:{variant:{default:"border-gray-400 text-gray-500",violet:"border-violet-600 bg-violet-600 text-white",blue:"border-blue-500 bg-blue-500 text-white",sky:"border-sky-900 bg-sky-900 text-white",black:"border-black bg-black text-white",gray:"border-gray-200 bg-gray-100 text-gray-800",neutral:"border-gray-400 text-gray-500",blueGradient:"bg-gradient-to-r from-blue-100 via-blue-100/50 to-blue-100 border border-blue-200 text-blue-900",rainbow:"bg-gradient-to-r from-violet-600 to-pink-600 text-white border-transparent"}},defaultVariants:{variant:"neutral"}});function Ft({className:e,variant:t,...r}){return nn("span",{className:n(an({variant:t}),e),...r})}import{cva as mn}from"class-variance-authority";import{forwardRef as un}from"react";import*as ue from"@radix-ui/react-tooltip";import sn from"linkify-react";import{HelpCircle as ln}from"lucide-react";import cn from"next/link";import{useState as dn}from"react";import{jsx as $,jsxs as Qe}from"react/jsx-runtime";function sf({children:e}){return $(ue.Provider,{delayDuration:150,children:e})}function ee({children:e,content:t,contentClassName:r,side:o="top",disableHoverableContent:a,delayDuration:s=0,...c}){let[l,d]=dn(!1);return Qe(ue.Root,{open:l,onOpenChange:d,delayDuration:s,disableHoverableContent:a,children:[$(ue.Trigger,{asChild:!0,onClick:()=>{d(!0)},onBlur:()=>{d(!1)},children:e}),$(ue.Portal,{children:$(ue.Content,{sideOffset:8,side:o,className:"animate-slide-up-fade pointer-events-auto z-[99] items-center overflow-hidden rounded-xl border border-gray-200 bg-white shadow-sm",collisionPadding:0,...c,children:typeof t=="string"?$("span",{className:n("block max-w-xs text-pretty px-4 py-2 text-center text-sm text-gray-700",r),children:t}):typeof t=="function"?t({setOpen:d}):t})})]})}function lf({title:e,cta:t,href:r,target:o,onClick:a}){return Qe("div",{className:"flex max-w-xs flex-col items-center space-y-3 p-4 text-center",children:[$("p",{className:"text-sm text-gray-700",children:e}),t&&(r?$(cn,{href:r,...o?{target:o}:{},className:n(pe({variant:"primary"}),"flex h-9 w-full items-center justify-center whitespace-nowrap rounded-lg border px-4 text-sm"),children:t}):a?$(ie,{onClick:a,text:t,variant:"primary",className:"h-9"}):null)]})}function cf({title:e,cta:t,href:r}){return Qe("div",{className:"max-w-xs px-4 py-2 text-center text-sm text-gray-700",children:[e," ",$("a",{href:r,target:"_blank",rel:"noopener noreferrer",onClick:o=>o.stopPropagation(),className:"inline-flex text-gray-500 underline underline-offset-4 hover:text-gray-800",children:t})]})}function df({children:e}){return $("div",{className:"block max-w-md whitespace-pre-wrap px-4 py-2 text-center text-sm text-gray-700",children:$(sn,{as:"p",options:{target:"_blank",rel:"noopener noreferrer nofollow",className:"underline underline-offset-4 text-gray-400 hover:text-gray-700"},children:e})})}function mf(e){return $(ee,{...e,children:$(ln,{className:"h-4 w-4 text-gray-500"})})}function uf({value:e,unit:t="total clicks",prefix:r,children:o,lastClicked:a}){return(!e||e<1e3)&&!a?o:$(ee,{content:Qe("div",{className:"block max-w-xs px-4 py-2 text-center text-sm text-gray-700",children:[Qe("p",{className:"text-sm font-semibold text-gray-700",children:[r,Rt(e||0,{full:!0})," ",t]}),a&&Qe("p",{className:"mt-1 text-xs text-gray-500",suppressHydrationWarning:!0,children:["Last clicked ",vo(a,{withAgo:!0})]})]}),children:o})}function pf({children:e,content:t,...r}){return $(ee,{content:t,...r,children:$("div",{className:"flex cursor-pointer items-center",children:$(Ft,{variant:"gray",className:"border-gray-300 transition-all hover:bg-gray-200",children:e})})})}function ff({children:e,tooltipProps:t,...r}){return $(ee,{...t,children:$("button",{type:"button",...r,className:n("flex h-6 w-6 items-center justify-center rounded-md text-gray-500 transition-colors duration-75 hover:bg-gray-100 active:bg-gray-200 disabled:cursor-not-allowed disabled:hover:bg-transparent",r.className),children:e})})}import{jsx as Xe,jsxs as sa}from"react/jsx-runtime";var pe=mn("transition-all",{variants:{variant:{primary:"border-black bg-black text-white hover:bg-gray-800 hover:ring-4 hover:ring-gray-200",secondary:n("border-gray-200 bg-white text-gray-900 hover:bg-gray-50 focus-visible:border-gray-500 outline-none","data-[state=open]:border-gray-500 data-[state=open]:ring-4 data-[state=open]:ring-gray-200"),outline:"border-transparent text-neutral-600 hover:bg-neutral-100",success:"border-blue-500 bg-blue-500 text-white hover:bg-blue-600 hover:ring-4 hover:ring-blue-100",danger:"border-red-500 bg-red-500 text-white hover:bg-red-600 hover:ring-4 hover:ring-red-100","danger-outline":"border-transparent bg-white text-red-500 hover:bg-red-600 hover:text-white"}},defaultVariants:{variant:"primary"}}),ie=un(({text:e,variant:t="primary",className:r,textWrapperClassName:o,loading:a,icon:s,shortcut:c,disabledTooltip:l,right:d,...m},i)=>l?Xe(ee,{content:l,children:sa("div",{className:n("flex h-10 w-full cursor-not-allowed items-center justify-center gap-x-2 rounded-md border border-gray-200 bg-gray-100 px-4 text-sm text-gray-400 transition-all focus:outline-none",{"border-transparent bg-transparent":t==null?void 0:t.endsWith("outline")},r),children:[s,e&&Xe("div",{className:n("min-w-0 truncate",c&&"flex-1 text-left",o),children:e}),c&&Xe("kbd",{className:n("hidden rounded border border-gray-200 bg-gray-100 px-2 py-0.5 text-xs font-light text-gray-400 md:inline-block",{"bg-gray-100":t==null?void 0:t.endsWith("outline")}),children:c})]})}):sa("button",{ref:i,type:m.onClick?"button":"submit",className:n("group flex h-10 w-full items-center justify-center gap-2 whitespace-nowrap rounded-md border px-4 text-sm",m.disabled||a?"cursor-not-allowed border-gray-200 bg-gray-100 text-gray-400 outline-none":pe({variant:t}),r),disabled:m.disabled||a,...m,children:[a?Xe(ye,{}):s||null,e&&Xe("div",{className:n("min-w-0 truncate",c&&"flex-1 text-left",o),children:e}),c&&Xe("kbd",{className:n("hidden rounded px-2 py-0.5 text-xs font-light transition-all duration-75 md:inline-block",{"bg-gray-700 text-gray-400 group-hover:bg-gray-600 group-hover:text-gray-300":t==="primary","bg-gray-200 text-gray-400 group-hover:bg-gray-100 group-hover:text-gray-500":t==="secondary","bg-gray-100 text-gray-500 group-hover:bg-gray-200":t==="outline","bg-red-100 text-red-600 group-hover:bg-red-500 group-hover:text-white":t==="danger-outline"}),children:c}),d]}));ie.displayName="Button";import{cva as pn}from"class-variance-authority";import{createContext as fn}from"react";import{jsx as la}from"react/jsx-runtime";var gn=pn("group/card-list w-full flex flex-col transition-[gap,opacity] min-w-0",{variants:{variant:{compact:"gap-0",loose:"gap-4"},loading:{true:"opacity-50"}}}),ut=fn({variant:"loose"});function ca({variant:e="loose",loading:t=!1,className:r,children:o}){return la("ul",{className:n(gn({variant:e,loading:t}),r),"data-variant":e,children:la(ut.Provider,{value:{variant:e},children:o})})}import{cva as hn}from"class-variance-authority";import{createContext as vn,useContext as bn,useEffect as xn,useRef as yn,useState as wn}from"react";import{jsx as Pr}from"react/jsx-runtime";var Cn=hn("w-full group/card border-gray-200 bg-white",{variants:{variant:{compact:"first-of-type:rounded-t-xl last-of-type:rounded-b-xl first-of-type:border-t border-b border-x data-[hover-state-enabled=true]:hover:bg-gray-50 transition-colors",loose:"border rounded-xl transition-[filter] data-[hover-state-enabled=true]:hover:drop-shadow-card-hover"}}}),Nn="w-full py-2.5 px-4",Sr=vn({hovered:!1});function da({outerClassName:e,innerClassName:t,children:r,onClick:o,hoverStateEnabled:a=!0}){let{variant:s}=bn(ut),c=yn(null),[l,d]=wn(!1);return xn(()=>{if(!l||!c.current)return;let m=setInterval(()=>{var i;((i=c.current)==null?void 0:i.matches(":hover"))===!1&&d(!1)},1e3);return()=>clearInterval(m)},[l]),Pr("li",{ref:c,className:n(Cn({variant:s}),e),onPointerEnter:()=>d(!0),onPointerLeave:()=>d(!1),"data-hover-state-enabled":a,children:Pr("div",{className:n(Nn,t),onClick:o?m=>{document.getElementById("modal-backdrop")||Et(m)||o()}:void 0,children:Pr(Sr.Provider,{value:{hovered:l},children:r})})})}var Hf=Object.assign(ca,{Card:Object.assign(da,{Context:Sr}),Context:ut});import kn from"embla-carousel-autoplay";import Pn from"embla-carousel-react";import{ArrowLeft as Sn,ArrowRight as Mn}from"lucide-react";import{createContext as Rn,forwardRef as ft,useCallback as pt,useContext as Ln,useEffect as Mr,useState as Rr}from"react";import{jsx as we,jsxs as pa}from"react/jsx-runtime";var Lr=2e3,ma=Rn(null);function fe(){let e=Ln(ma);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}function ua(){let{api:e}=fe(),[t,r]=Rr(0),o=pt(a=>r((a==null?void 0:a.selectedScrollSnap())??0),[]);return Mr(()=>{!e||(o(e),e.on("reInit",o),e.on("select",o))},[e,o]),t}var Tn=ft(({orientation:e="horizontal",opts:t,setApi:r,autoplay:o,plugins:a,className:s,children:c,...l},d)=>{let[m,i]=Pn({...t,axis:e==="horizontal"?"x":"y"},[...o?[kn(typeof o=="object"?o:{delay:Lr})]:[],...a||[]]),[p,f]=Rr(!1),[x,h]=Rr(!1),b=pt(M=>{!M||(f(M.canScrollPrev()),h(M.canScrollNext()))},[]),g=pt(()=>{i==null||i.scrollPrev()},[i]),N=pt(()=>{i==null||i.scrollNext()},[i]),S=pt(M=>{M.key==="ArrowLeft"?(M.preventDefault(),g()):M.key==="ArrowRight"&&(M.preventDefault(),N())},[g,N]);return Mr(()=>{!i||!r||r(i)},[i,r]),Mr(()=>{if(!!i)return b(i),i.on("reInit",b),i.on("select",b),()=>{i==null||i.off("select",b)}},[i,b]),we(ma.Provider,{value:{carouselRef:m,api:i,opts:t,orientation:e||((t==null?void 0:t.axis)==="y"?"vertical":"horizontal"),scrollPrev:g,scrollNext:N,canScrollPrev:p,canScrollNext:x},children:we("div",{ref:d,onKeyDownCapture:S,className:n("relative",s),role:"region","aria-roledescription":"carousel",...l,children:c})})});Tn.displayName="Carousel";var En=ft(({className:e,...t},r)=>{let{carouselRef:o,orientation:a}=fe();return we("div",{ref:o,className:"overflow-hidden",children:we("div",{ref:r,className:n("flex",a==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})});En.displayName="CarouselContent";var An=ft(({className:e,...t},r)=>{let{orientation:o}=fe();return we("div",{ref:r,role:"group","aria-roledescription":"slide",className:n("min-w-0 shrink-0 grow-0 basis-full",o==="horizontal"?"pl-4":"pt-4",e),...t})});An.displayName="CarouselItem";var Dn=ft(({className:e,...t},r)=>{let{orientation:o,scrollPrev:a,canScrollPrev:s}=fe();return pa("button",{ref:r,className:n("absolute",o==="horizontal"?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",pe({variant:"secondary",className:"p-2"}),e),disabled:!s,onClick:a,...t,children:[we(Sn,{className:"h-4 w-4"}),we("span",{className:"sr-only",children:"Previous slide"})]})});Dn.displayName="CarouselPrevious";var In=ft(({className:e,...t},r)=>{let{orientation:o,scrollNext:a,canScrollNext:s}=fe();return pa("button",{ref:r,className:n("absolute",o==="horizontal"?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",pe({variant:"secondary",className:"p-2"}),e),disabled:!s,onClick:a,...t,children:[we(Mn,{className:"h-4 w-4"}),we("span",{className:"sr-only",children:"Next slide"})]})});In.displayName="CarouselNext";import{cva as zn}from"class-variance-authority";import{motion as On}from"framer-motion";import{ChevronLeft as _n,ChevronRight as Hn}from"lucide-react";import*as Me from"react";import{jsx as Be,jsxs as gt}from"react/jsx-runtime";var Vn=zn("flex items-center justify-center gap-3 sm:gap-6",{variants:{variant:{simple:"relative",floating:"absolute bottom-4 left-1/2 -translate-x-1/2 rounded-full border border-gray-800/10 bg-white sm:bottom-6 "}}}),rg=({variant:e="simple",className:t})=>{var h;let{scrollNext:r,scrollPrev:o,canScrollNext:a,canScrollPrev:s,api:c}=fe(),l=(h=c==null?void 0:c.plugins())==null?void 0:h.autoplay,[d,m]=Me.useState(0),[i,p]=Me.useState(!1),f=Me.useCallback(b=>{m((b==null?void 0:b.selectedScrollSnap())??0)},[]),x=Me.useCallback(b=>()=>{l&&l.isPlaying()&&l.stop(),b()},[l]);return Me.useEffect(()=>{!c||(f(c),p((l==null?void 0:l.isPlaying())??!1),c.on("reInit",f),c.on("select",f),c.on("autoplay:play",()=>p(!0)),c.on("autoplay:stop",()=>p(!1)))},[c,l,f]),gt("div",{className:n(Vn({variant:e}),t),children:[e!=="simple"&>("button",{className:"cursor-pointer rounded-full p-2 hover:bg-gray-50 active:bg-gray-100",disabled:!s,onClick:x(o),children:[Be(_n,{className:"h-4 w-4"}),Be("span",{className:"sr-only",children:"Previous slide"})]}),c!=null&&Be("div",{className:"flex items-center gap-1",children:c.slideNodes().map((b,g)=>gt("button",{onClick:x(()=>c.scrollTo(g)),className:"rounded-full p-0.5 hover:bg-gray-100 active:bg-gray-200 sm:p-1.5",children:[Be("div",{className:n("relative isolate h-1.5 w-1.5 overflow-hidden rounded-full transition-all",g===d?"bg-black":"bg-black/20",i&&g===d&&"w-6 bg-black/20"),children:i&&g===d&&Be(On.div,{initial:{x:"-100%"},animate:{x:0},transition:{type:"tween",duration:((l==null?void 0:l.options.delay)??Lr)/1e3},className:"animate-fill-width h-full w-full rounded-full bg-black"})}),gt("span",{className:"sr-only",children:["Slide ",g+1]})]},g))}),e!=="simple"&>("button",{className:"cursor-pointer rounded-full p-2 hover:bg-gray-50 active:bg-gray-100",disabled:!a,onClick:x(r),children:[Be(Hn,{className:"h-4 w-4"}),Be("span",{className:"sr-only",children:"Next slide"})]})]})};import Bn from"embla-carousel-react";import{forwardRef as Wn,useCallback as Fn,useEffect as Un}from"react";import{jsx as Ut}from"react/jsx-runtime";var mg=({className:e,...t})=>{let{api:r}=fe(),[o,a]=Bn({dragFree:!0}),s=Fn(c=>{!c||!a||a==null||a.scrollTo(c.selectedScrollSnap())},[a]);return Un(()=>{if(!(!r||!a))return s(r),r.on("reInit",s),r.on("select",s),()=>{r==null||r.off("reInit",s),r==null||r.off("select",s)}},[r,a,s]),Ut("div",{className:"overflow-hidden",ref:o,children:Ut("div",{className:n("mx-4 flex gap-4",e),...t})})},ug=Wn(({index:e,className:t,...r},o)=>{let{api:a}=fe(),s=ua();return Ut("div",{ref:o,children:Ut("button",{type:"button",onClick:()=>{var l;if(!a)return;let c=(l=a.plugins())==null?void 0:l.autoplay;c&&c.isPlaying()&&c.stop(),a.scrollTo(e)},className:typeof t=="function"?t({active:e===s}):t,...r})})});import*as ht from"@radix-ui/react-checkbox";import{Check as Gn}from"lucide-react";import*as fa from"react";import{jsx as Tr}from"react/jsx-runtime";var $n=fa.forwardRef(({className:e,...t},r)=>Tr(ht.Root,{ref:r,className:n("peer h-5 w-5 shrink-0 rounded-md border border-gray-200 bg-white outline-none focus-visible:border-black disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-500",e),...t,children:Tr(ht.Indicator,{className:"flex items-center justify-center",children:Tr(Gn,{className:"h-3 w-3 text-white"})})}));$n.displayName=ht.Root.displayName;import{Command as Yt,CommandInput as Is,CommandItem as zs,useCommandState as Os}from"cmdk";import{ChevronDown as _s}from"lucide-react";import{forwardRef as Hs,isValidElement as Vs,useCallback as Bs,useEffect as jt,useRef as Ws,useState as vt}from"react";import{motion as Es}from"framer-motion";import{forwardRef as As,useRef as Ds}from"react";import Er from"js-cookie";import{useEffect as Kn,useState as jn}from"react";function xg(e,t,r){let[o,a]=jn(()=>{let c=Er.get(e);return c?JSON.parse(c):t});return Kn(()=>{let c=()=>{let l=Er.get(e);l&&a(JSON.parse(l))};return window.addEventListener("storage",c),()=>{window.removeEventListener("storage",c)}},[e]),[o,c=>{a(c),Er.set(e,JSON.stringify(c),r)}]}import{useCallback as Yn,useEffect as Zn,useRef as qn,useState as Qn}from"react";var Je=(e=3e3)=>{let t=qn(null),[r,o]=Qn(!1),a=()=>{t.current&&(clearTimeout(t.current),t.current=null)},s=Yn(async c=>{a();try{typeof c=="string"?await navigator.clipboard.writeText(c):c instanceof ClipboardItem&&await navigator.clipboard.write([c]),o(!0),Number.isFinite(e)&&e>=0&&(t.current=setTimeout(()=>o(!1),e))}catch(l){console.error("Failed to copy: ",l)}},[e]);return Zn(()=>()=>a(),[]),[r,s]};import{useEffect as Xn,useState as Jn}from"react";function kg(){let[e,t]=Jn(null);return Xn(()=>{let r=document.querySelector("[data-mdx-container]");if(!r)return;let o=r.offsetTop-1,a=new IntersectionObserver(l=>{var p,f,x;let d=l[0];if(!d)return;let m=(((p=d.rootBounds)==null?void 0:p.height)||0)*.3+o;for(let h=1;h<l.length;h++){let b=l[h];if(!b)break;(b.boundingClientRect.top<d.boundingClientRect.top||d.boundingClientRect.bottom<o)&&(d=b)}let i=d.target;for(;i&&i.getBoundingClientRect().bottom<o;)i=(f=s.get(i))==null?void 0:f.next;for(;i&&i.getBoundingClientRect().top>m;)i=(x=s.get(i))==null?void 0:x.prev;i&&t(i.getAttribute("href"))},{threshold:1,rootMargin:`-${o}px 0px 0px 0px`}),s=new Map;return(r==null?void 0:r.querySelectorAll("[data-mdx-heading]")).forEach(l=>a.observe(l)),()=>{a.disconnect()}},[]),e==null?void 0:e.replace("#","")}function Sg(e){return{handleKeyDown:r=>{r.key==="Enter"&&r.metaKey&&(r.preventDefault(),e.current&&e.current.requestSubmit())}}}import{useEffect as es,useState as ts}from"react";function Tg(e,t={}){let{root:r,defaultValue:o}=t,[a,s]=ts(o??!1);return es(()=>{let c=()=>{let d=e.current;if(!d)return;let m=r==null?void 0:r.current,i=d.getBoundingClientRect(),p=m?m.getBoundingClientRect():{top:0,left:0,bottom:window.innerHeight,right:window.innerWidth};s(i.top<p.bottom&&i.bottom>p.top&&i.left<p.right&&i.right>p.left)};((r==null?void 0:r.current)||window).addEventListener("scroll",c),window.addEventListener("resize",c);let l=null;return e.current&&(l=new IntersectionObserver(c),l.observe(e.current)),c(),()=>{((r==null?void 0:r.current)||window).removeEventListener("scroll",c),window.removeEventListener("resize",c),l==null||l.disconnect()}},[e,r]),a}import{useEffect as rs,useState as os}from"react";function Dg(){let[e,t]=os(!1);return rs(()=>{let r=()=>{let o=document.activeElement;t((o==null?void 0:o.tagName)!=null&&["INPUT","TEXTAREA"].includes(o.tagName))};return window.addEventListener("focusin",r),window.addEventListener("focusout",r),()=>{window.removeEventListener("focusin",r),window.removeEventListener("focusout",r)}},[]),e}import{useEffect as as,useState as is}from"react";function _g(e,{threshold:t=0,root:r=null,rootMargin:o="0%",freezeOnceVisible:a=!1}){let[s,c]=is(),l=(s==null?void 0:s.isIntersecting)&&a,d=([m])=>{c(m)};return as(()=>{let m=e==null?void 0:e.current;if(!!!window.IntersectionObserver||l||!m)return;let p={threshold:t,root:r,rootMargin:o},f=new IntersectionObserver(d,p);return f.observe(m),()=>f.disconnect()},[e,JSON.stringify(t),r,o,l]),s}import{createContext as ns,useCallback as ss,useContext as ls,useEffect as ga,useId as cs,useState as ds}from"react";import{jsx as ms}from"react/jsx-runtime";var ha=ns({listeners:[],setListeners:()=>{}});function Ug({children:e}){let[t,r]=ds([]);return ms(ha.Provider,{value:{listeners:t,setListeners:r},children:e})}function et(e,t,r={}){let o=cs(),{listeners:a,setListeners:s}=ls(ha),c=ss(l=>{let d=l.target,m=document.getElementById("modal-backdrop");if(l.metaKey||l.ctrlKey||d.tagName==="INPUT"||d.tagName==="TEXTAREA"||!!m!=!!r.modal||(Array.isArray(e)?!e.includes(l.key):l.key!==e))return;let i=a.filter(f=>f.enabled!==!1&&(Array.isArray(f.key)?f.key.includes(l.key):f.key===l.key));!i.length||ho(i,(f,x)=>(x.priority??0)-(f.priority??0)).slice(-1)[0].id!==o||(l.preventDefault(),t(l))},[e,a,o,t]);ga(()=>(document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)),[c]),ga(()=>(s(l=>[...l.filter(d=>d.id!==o),{id:o,key:e,...r}]),()=>s(l=>l.filter(d=>d.id!==o))),[JSON.stringify(e),r.enabled,r.priority])}import{useEffect as us,useState as ps}from"react";function va(e){if(typeof window>"u")return null;let t=window.localStorage.getItem(e);return t?JSON.parse(t):null}function Kg(e,t){let[r,o]=ps(va(e)??t);return us(()=>{let s=va(e);s&&o(s)},[e]),[r,s=>{o(s),window.localStorage.setItem(e,JSON.stringify(s))}]}import{toast as fs}from"sonner";import gs from"swr";function Qg(e,t){let{data:r,isLoading:o,mutate:a}=gs(e,me);return{data:r,isLoading:o,update:async(s,c)=>fs.promise(a(s(r),{optimisticData:c,rollbackOnError:!0,populateCache:!0,revalidate:!0}),{loading:(t==null?void 0:t.loading)||"Updating...",success:(t==null?void 0:t.success)||"Successfully updated",error:(t==null?void 0:t.error)||"Failed to update"})}}import{useEffect as wa,useMemo as ys}from"react";import{useEffect as ba,useState as hs}from"react";function xa({pageSize:e,page:t,onPageChange:r}){let[o,a]=hs({pageIndex:t,pageSize:e});return ba(()=>{a(s=>({...s,pageIndex:t}))},[t]),ba(()=>{r==null||r(o.pageIndex)},[o]),{pagination:o,setPagination:a}}import{usePathname as vs,useRouter as bs,useSearchParams as xs}from"next/navigation";function ya(){let e=vs(),t=bs(),r=xs(),o=Object.fromEntries(r);return{pathname:e,router:t,searchParams:r,searchParamsObj:o,queryParams:({set:c,del:l,replace:d,scroll:m=!0,getNewPath:i,arrayDelimiter:p=","})=>{let f=new URLSearchParams(r);c&&Object.entries(c).forEach(([b,g])=>f.set(b,Array.isArray(g)?g.join(p):g)),l&&(Array.isArray(l)?l.forEach(b=>f.delete(b)):f.delete(l));let x=f.toString(),h=`${e}${x.length>0?`?${x}`:""}`;if(i)return h;d?t.replace(h,{scroll:!1}):t.push(h,{scroll:m})},getQueryString:(c,l)=>{let d=new URLSearchParams(r);c&&Object.entries(c).forEach(([i,p])=>d.set(i,p)),l!=null&&l.ignore&&l.ignore.forEach(i=>d.delete(i));let m=d.toString();return m.length>0?`?${m}`:""}}}function l1(e=po){let{searchParams:t,queryParams:r}=ya(),o=ys(()=>parseInt(t.get("page")||"1")||1,[t.get("page")]),{pagination:a,setPagination:s}=xa({pageSize:e,page:o,onPageChange:c=>{r(c===1?{del:"page"}:{set:{page:c.toString()}})}});return wa(()=>{let c=parseInt(t.get("page")||"1")||1;s(l=>({...l,pageIndex:c}))},[t.get("page")]),wa(()=>{r(a.pageIndex===1?{del:"page"}:{set:{page:a.pageIndex.toString()}})},[a]),{pagination:a,setPagination:s}}import{useEffect as ws}from"react";function m1(){ws(()=>{let e=new URL(window.location.href);e.searchParams.has("_gl")&&setTimeout(()=>{e.searchParams.delete("_gl"),window.history.replaceState({},"",e.toString())},2e3)},[])}import{useEffect as Cs,useState as Ns}from"react";function Gt(e){let[t,r]=Ns(),o=([a])=>{r(a)};return Cs(()=>{let a=e==null?void 0:e.current;if(!a)return;let s=new ResizeObserver(o);return s.observe(a),()=>s.disconnect()},[e]),t}import{useCallback as ks,useEffect as Ca,useState as Ps}from"react";function Na(e){let[t,r]=Ps(!1),o=ks(()=>{r(window.scrollY>e)},[e]);return Ca(()=>(window.addEventListener("scroll",o),()=>window.removeEventListener("scroll",o)),[o]),Ca(()=>{o()},[o]),t}import{useCallback as Ss,useEffect as Ms,useState as Rs}from"react";function tt(e){let[t,r]=Rs(1),o=Ss(()=>{if(!e.current)return;let{scrollTop:s,scrollHeight:c,clientHeight:l}=e.current;r(c===l?1:Math.min(s/(c-l),1))},[]),a=Gt(e);return Ms(o,[a]),{scrollProgress:t,updateScrollProgress:o}}import{useEffect as Ls}from"react";import{toast as Pa}from"sonner";import{jsx as $t,jsxs as ka}from"react/jsx-runtime";function Ts({id:e,message:t,undo:r}){let o=()=>{r(),Pa.dismiss(e)},a=s=>{s.key==="z"&&(s.ctrlKey||s.metaKey)&&o()};return Ls(()=>(document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)),[]),ka("div",{className:"flex w-full items-center justify-between space-x-2",children:[ka("div",{className:"flex items-center space-x-2",children:[$t(Po,{}),$t("p",{className:"font-medium",children:t})]}),$t("button",{className:"whitespace-nowrap rounded border border-black bg-black px-2 py-1 text-xs font-normal text-white transition-all duration-75 active:scale-95",onClick:o,children:"Undo"})]})}function P1(){return({id:t,message:r,undo:o,duration:a})=>Pa($t(Ts,{id:t,message:r,undo:o}),{id:t,...a&&{duration:a}})}import{jsx as Sa}from"react/jsx-runtime";var Ce=As(({width:e=!1,height:t=!1,className:r,transition:o,children:a,...s},c)=>{var m,i;let l=Ds(null),d=Gt(l);return Sa(Es.div,{ref:c,className:n("overflow-hidden",r),animate:{width:e?((m=d==null?void 0:d.contentRect)==null?void 0:m.width)??"auto":"auto",height:t?((i=d==null?void 0:d.contentRect)==null?void 0:i.height)??"auto":"auto"},transition:o??{type:"spring",duration:.3},...s,children:Sa("div",{ref:l,className:n(t&&"h-max",e&&"w-max"),children:a})})});Ce.displayName="AnimatedSizeContainer";import*as Re from"@radix-ui/react-popover";import{Drawer as rt}from"vaul";import{jsx as Ne,jsxs as Kt}from"react/jsx-runtime";function ot({children:e,content:t,align:r="center",side:o="bottom",openPopover:a,setOpenPopover:s,mobileOnly:c,popoverContentClassName:l,collisionBoundary:d,sticky:m,onEscapeKeyDown:i,onWheel:p}){let{isMobile:f}=Y();return c||f?Kt(rt.Root,{open:a,onOpenChange:s,children:[Ne(rt.Trigger,{className:"sm:hidden",asChild:!0,children:e}),Kt(rt.Portal,{children:[Ne(rt.Overlay,{className:"fixed inset-0 z-50 bg-gray-100 bg-opacity-10 backdrop-blur"}),Kt(rt.Content,{className:"fixed bottom-0 left-0 right-0 z-50 mt-24 rounded-t-[10px] border-t border-gray-200 bg-white",onEscapeKeyDown:i,onPointerDownOutside:x=>{x.target instanceof Element&&x.target.closest("[data-sonner-toast]")&&x.preventDefault()},children:[Ne("div",{className:"sticky top-0 z-20 flex w-full items-center justify-center rounded-t-[10px] bg-inherit",children:Ne("div",{className:"my-3 h-1 w-12 rounded-full bg-gray-300"})}),Ne("div",{className:"flex min-h-[150px] w-full items-center justify-center overflow-hidden bg-white pb-8 align-middle shadow-xl",children:t})]}),Ne(rt.Overlay,{})]})]}):Kt(Re.Root,{open:a,onOpenChange:s,children:[Ne(Re.Trigger,{className:"sm:inline-flex",asChild:!0,children:e}),Ne(Re.Portal,{children:Ne(Re.Content,{sideOffset:8,align:r,side:o,className:n("animate-slide-up-fade z-50 items-center rounded-lg border border-gray-200 bg-white drop-shadow-lg sm:block",l),sticky:m,collisionBoundary:d,onEscapeKeyDown:i,onWheel:p,children:t})})]})}import{Fragment as Ar,jsx as A,jsxs as Le}from"react/jsx-runtime";function Fs(e,t){return e===!0}function J1({multiple:e,selected:t,setSelected:r,options:o,icon:a,placeholder:s="Select...",searchPlaceholder:c="Search...",emptyState:l,createLabel:d,onCreate:m,buttonProps:i,shortcutHint:p,caret:f,side:x,open:h,onOpenChange:b,onSearchChange:g,shouldFilter:N=!0,inputClassName:S,optionRight:M,optionClassName:P,matchTriggerWidth:w,children:y}){let R=Fs(e,r),z=Array.isArray(t)?t:t?[t]:[],{isMobile:D}=Y(),[q,C]=vt(!1),O=h??q,ce=b??C,[T,de]=vt(""),[J,xr]=vt(!1),[yr,Wi]=vt(void 0),[Fi,co]=vt(!1),Ui=_=>{var Ze;if(R){let wr=z.some(({value:dt})=>dt===_.value);r(wr?z.filter(({value:dt})=>dt!==_.value):[...z,_])}else r(z.length&&((Ze=z[0])==null?void 0:Ze.value)===_.value?null:_),ce(!1)},mo=Bs((_,Ze)=>Ze===""?[...z,..._.filter(wr=>z.findIndex(dt=>dt.value===wr.value)===-1)]:_,[z]);return jt(()=>{J&&(Wi(o&&mo(o,T)),xr(!1))},[J,o,mo,T]),jt(()=>{xr(!0)},[o]),jt(()=>{O||(de(""),xr(!0))},[O]),jt(()=>g==null?void 0:g(T),[T]),A(ot,{openPopover:O,setOpenPopover:ce,align:"start",side:x,onWheel:_=>{_.stopPropagation()},popoverContentClassName:n(w&&"sm:w-[var(--radix-popover-trigger-width)]"),content:A(Ce,{width:!D&&!w,height:!0,style:{transform:"translateZ(0)"},transition:{ease:"easeInOut",duration:.1},className:"pointer-events-auto",children:Le(Yt,{loop:!0,shouldFilter:N,children:[Le("div",{className:"flex items-center overflow-hidden rounded-t-lg border-b border-gray-200",children:[A(Is,{placeholder:c,value:T,onValueChange:de,className:n("grow border-0 py-3 pl-4 pr-2 outline-none placeholder:text-gray-400 focus:ring-0 sm:text-sm",S),onKeyDown:_=>{(_.key==="Escape"||_.key==="Backspace"&&!T)&&(_.preventDefault(),_.stopPropagation(),ce(!1))}}),p&&A("kbd",{className:"mr-2 hidden shrink-0 rounded border border-gray-200 bg-gray-100 px-2 py-0.5 text-xs font-light text-gray-500 md:block",children:p})]}),A(Us,{children:A(Yt.List,{className:n("flex w-full min-w-[100px] flex-col gap-1 p-1"),children:yr!==void 0?Le(Ar,{children:[yr.map(_=>A(Gs,{option:_,multiple:R,selected:z.some(({value:Ze})=>Ze===_.value),onSelect:()=>Ui(_),right:M==null?void 0:M(_),className:P},`${_.label}, ${_.value}`)),T.length>0&&m&&Le(zs,{className:n("flex cursor-pointer items-center gap-3 whitespace-nowrap rounded-md px-3 py-2 text-left text-sm text-gray-700","data-[selected=true]:bg-gray-100",P),onSelect:async()=>{co(!0),await(m==null?void 0:m(T))&&(de(""),ce(!1)),co(!1)},children:[Fi?A(ye,{className:"size-4 shrink-0"}):A(Ht,{className:"size-4 shrink-0"}),A("div",{className:"grow truncate",children:(d==null?void 0:d(T))||`Create "${T}"`})]}),N?A($s,{className:"flex min-h-12 items-center justify-center text-sm text-gray-500",children:l||"No matches"}):yr.length===0?A("div",{className:"flex min-h-12 items-center justify-center text-sm text-gray-500",children:l||"No matches"}):null]}):A(Yt.Loading,{children:A("div",{className:"flex h-12 items-center justify-center",children:A(ye,{})})})})})]})}),children:A(ie,{variant:"secondary",...i,className:n(i==null?void 0:i.className,"flex gap-2"),textWrapperClassName:n(i==null?void 0:i.textWrapperClassName,"w-full flex items-center justify-start"),text:Le(Ar,{children:[A("div",{className:"min-w-0 grow truncate text-left",children:y||z.map(_=>_.label).join(", ")||s}),f&&A(_s,{className:"ml-1 size-4 shrink-0 text-gray-400 transition-transform duration-75 group-data-[state=open]:rotate-180"})]}),icon:a?Ma(a)?a:A(a,{className:"size-4 shrink-0"}):void 0})})}var Us=({children:e})=>{let t=Ws(null),{scrollProgress:r,updateScrollProgress:o}=tt(t);return Le(Ar,{children:[A("div",{className:"scrollbar-hide max-h-[min(50vh,250px)] w-screen overflow-y-scroll sm:w-auto",ref:t,onScroll:o,children:e}),A("div",{className:"pointer-events-none absolute bottom-0 left-0 hidden h-16 w-full rounded-b-lg bg-gradient-to-t from-white sm:block",style:{opacity:1-Math.pow(r,2)}})]})};function Gs({option:e,onSelect:t,multiple:r,selected:o,right:a,className:s}){return Le(Yt.Item,{className:n("flex cursor-pointer items-center gap-3 whitespace-nowrap rounded-md px-3 py-2 text-left text-sm","data-[selected=true]:bg-gray-100",s),onSelect:t,value:e.label+(e==null?void 0:e.value),children:[r&&A("div",{className:"shrink-0 text-gray-600",children:o?A(Ho,{className:"size-4 text-gray-600"}):A(Vo,{className:"size-4 text-gray-400"})}),Le("div",{className:"flex min-w-0 grow items-center gap-1",children:[e.icon&&A("span",{className:"shrink-0 text-gray-600",children:Ma(e.icon)?e.icon:A(e.icon,{className:"h-4 w-4"})}),A("span",{className:"grow truncate",children:e.label})]}),a,!r&&o&&A(_o,{className:"size-4 shrink-0 text-gray-600"})]})}var Ma=e=>Vs(e),$s=Hs((e,t)=>Os(o=>o.filtered.count===0)?A("div",{ref:t,"cmdk-empty":"",role:"presentation",...e}):null);import{addYears as Zt,format as Ks,isSameMonth as js}from"date-fns";import{ChevronLeft as Ra,ChevronRight as La,ChevronsLeft as Ys,ChevronsRight as Zs}from"lucide-react";import{forwardRef as qs,useRef as Qs}from"react";import{DayPicker as Xs,useDayPicker as Js,useDayRender as el,useNavigation as tl}from"react-day-picker";import{Fragment as rl,jsx as te,jsxs as qt}from"react/jsx-runtime";var bt=qs(({onClick:e,icon:t,disabled:r,...o},a)=>te("button",{ref:a,type:"button",disabled:r,className:n("flex h-7 w-7 shrink-0 select-none items-center justify-center rounded border p-1 outline-none transition","border-gray-200 text-gray-600 hover:text-gray-800","hover:bg-gray-50 active:bg-gray-100","disabled:pointer-events-none disabled:text-gray-400"),onClick:e,...o,children:te(t,{className:"h-full w-full shrink-0"})}));bt.displayName="NavigationButton";function Ta({mode:e="single",weekStartsOn:t=1,numberOfMonths:r=1,showYearNavigation:o=!1,disableNavigation:a,locale:s,className:c,classNames:l,...d}){return te(Xs,{mode:e,weekStartsOn:t,numberOfMonths:r,locale:s,showOutsideDays:r===1,className:c,classNames:{months:"flex space-y-0",month:"space-y-4 p-3 w-full",nav:"gap-1 flex items-center rounded-full w-full h-full justify-between p-4",table:"w-full border-separate border-spacing-y-1",head_cell:"w-9 font-medium text-xs text-center text-gray-400 pb-2",row:"w-full",cell:"relative p-0 text-center focus-within:relative text-gray-900",day:n("relative h-10 w-full sm:h-9 sm:w-9 rounded-md text-sm text-gray-900","hover:bg-gray-100 active:bg-gray-200 outline outline-offset-2 outline-0 focus-visible:outline-2 outline-blue-500"),day_today:"font-semibold",day_selected:"rounded aria-selected:bg-blue-500 aria-selected:text-white",day_disabled:"!text-gray-300 line-through disabled:hover:bg-transparent",day_outside:"text-gray-400",day_range_middle:"!rounded-none aria-selected:!bg-blue-100 aria-selected:!text-blue-900",day_range_start:"rounded-r-none !rounded-l",day_range_end:"rounded-l-none !rounded-r",day_hidden:"invisible",...l},components:{IconLeft:()=>te(Ra,{className:"h-4 w-4"}),IconRight:()=>te(La,{className:"h-4 w-4"}),Caption:({...m})=>{let{goToMonth:i,nextMonth:p,previousMonth:f,currentMonth:x,displayMonths:h}=tl(),{numberOfMonths:b,fromDate:g,toDate:N}=Js(),S=h.findIndex(D=>js(m.displayMonth,D)),M=S===0,P=S===h.length-1,w=b>1&&(M||!P),y=b>1&&(P||!M),R=()=>{let D=Zt(x,-1);f&&(!g||D.getTime()>=g.getTime())&&i(D)},z=()=>{let D=Zt(x,1);p&&(!N||D.getTime()<=N.getTime())&&i(D)};return qt("div",{className:"flex items-center justify-between",children:[qt("div",{className:"flex items-center gap-1",children:[o&&!y&&te(bt,{disabled:a||!f||g&&Zt(x,-1).getTime()<g.getTime(),"aria-label":"Go to previous year",onClick:R,icon:Ys}),!y&&te(bt,{disabled:a||!f,"aria-label":"Go to previous month",onClick:()=>f&&i(f),icon:Ra})]}),te("div",{role:"presentation","aria-live":"polite",className:"text-sm font-medium capitalize tabular-nums text-gray-900",children:Ks(m.displayMonth,"LLLL yyy",{locale:s})}),qt("div",{className:"flex items-center gap-1",children:[!w&&te(bt,{disabled:a||!p,"aria-label":"Go to next month",onClick:()=>p&&i(p),icon:La}),o&&!w&&te(bt,{disabled:a||!p||N&&Zt(x,1).getTime()>N.getTime(),"aria-label":"Go to next year",onClick:z,icon:Zs})]})]})},Day:({date:m,displayMonth:i})=>{let p=Qs(null),{activeModifiers:f,buttonProps:x,divProps:h,isButton:b,isHidden:g}=el(m,i,p),{selected:N,today:S,disabled:M,range_middle:P}=f;if(g)return te(rl,{});if(!b)return te("div",{...h,className:n("flex items-center justify-center",h.className)});let{children:w,...y}=x;return qt("button",{ref:p,...y,type:"button",children:[w,S&&te("span",{className:n("absolute inset-x-1/2 bottom-1.5 h-0.5 w-4 -translate-x-1/2 rounded-[2px]",{"bg-blue-500":!N,"!bg-white":N,"!bg-blue-400":N&&P,"text-gray-400":M})})]})}},...d})}import{enUS as pl}from"date-fns/locale";import{useEffect as Hr,useMemo as Aa,useState as Xt}from"react";import{Command as Dr}from"cmdk";import{Lock as ol}from"lucide-react";import{jsx as We,jsxs as al}from"react/jsx-runtime";var Ir=({presets:e,onSelect:t,currentValue:r})=>{let o=d=>"dateRange"in d,a=d=>"date"in d,s=(d,m)=>d.getDate()===m.getDate()&&d.getMonth()===m.getMonth()&&d.getFullYear()===m.getFullYear(),c=(d,m)=>{let i=d.from,p=m.from,f=!1;i&&p&&s(i,p)&&(f=!0);let x=d.to,h=m.to,b=!1;return x&&h&&s(x,h)&&(b=!0),f&&b},l=d=>{if(o(d)){let m=r;return m&&c(m,d.dateRange)}else if(a(d)){let m=r;return m&&s(m,d.date)}return!1};return We(Dr,{className:"w-full rounded ring-gray-200 ring-offset-2 focus:outline-none",tabIndex:0,autoFocus:!0,loop:!0,children:We(Dr.List,{className:"[&>*]:flex [&>*]:w-full [&>*]:items-start [&>*]:gap-x-2 [&>*]:gap-y-0.5 [&>*]:sm:flex-col",children:e.map((d,m)=>al(Dr.Item,{disabled:d.requiresUpgrade,onSelect:()=>t(d),title:d.label,value:d.id,className:n("group relative flex cursor-pointer items-center justify-between overflow-hidden text-ellipsis whitespace-nowrap rounded border border-gray-200","px-2.5 py-1.5 text-left text-sm text-gray-700 shadow-sm outline-none sm:w-full sm:border-none sm:py-2 sm:shadow-none","disabled:pointer-events-none disabled:opacity-50","sm:data-[selected=true]:bg-gray-100",l(d)&&"font-semibold text-gray-800"),children:[We("span",{children:d.label}),d.requiresUpgrade?We(ol,{className:"h-3.5 w-3.5","aria-hidden":"true"}):d.shortcut?We("kbd",{className:"text-gray-4000 hidden rounded bg-gray-100 px-2 py-0.5 text-xs font-light group-data-[selected=true]:bg-gray-200 md:block",children:d.shortcut.toUpperCase()}):null,d.requiresUpgrade&&d.tooltipContent&&We(ee,{side:"bottom",content:d.tooltipContent,children:We("div",{className:"absolute inset-0 cursor-not-allowed"})})]},m))})})};Ir.displayName="DatePicker.Presets";import{format as Te}from"date-fns";import{createContext as il}from"react";var zr=il({isOpen:!1,setIsOpen:()=>{}}),nl=()=>{let e=typeof window<"u"?window.navigator.language:"en-US",t=new Intl.DateTimeFormat(e,{hour:"numeric"}).format();return Number.isInteger(Number(t))},Or=(e,t,r=!1)=>{let o=!nl(),a;return r?a=o?Te(e,"d MMM, yyyy h:mm a",{locale:t}):Te(e,"d MMM, yyyy HH:mm",{locale:t}):a=Te(e,"d MMM, yyyy",{locale:t}),a},Ea=(e,t)=>{let{toYear:r,fromYear:o,fromMonth:a,toMonth:s,fromDay:c,toDay:l}=t;if(e&&e.length>0){let d=o,m=r;e.forEach(i=>{var p,f,x,h,b,g;if("date"in i){let N=i.date.getFullYear();if(o&&N<o)throw new Error(`Preset ${i.label} is before fromYear ${d}.`);if(r&&N>r)throw new Error(`Preset ${i.label} is after toYear ${m}.`);if(a&&i.date.getMonth()<a.getMonth())throw new Error(`Preset ${i.label} is before fromMonth ${a}.`);if(s&&i.date.getMonth()>s.getMonth())throw new Error(`Preset ${i.label} is after toMonth ${s}.`);if(c&&i.date.getDate()<c.getDate())throw new Error(`Preset ${i.label} is before fromDay ${c}.`);if(l&&i.date.getDate()>l.getDate())throw new Error(`Preset ${i.label} is after toDay ${Te(l,"MMM dd, yyyy")}.`)}if("dateRange"in i){let N=(p=i.dateRange.from)==null?void 0:p.getFullYear(),S=(f=i.dateRange.to)==null?void 0:f.getFullYear();if(N&&o&&N<o)throw new Error(`Preset ${i.label}'s 'from' is before fromYear ${d}.`);if(S&&r&&S>r)throw new Error(`Preset ${i.label}'s 'to' is after toYear ${m}.`);if(a){let M=(x=i.dateRange.from)==null?void 0:x.getMonth();if(M&&M<a.getMonth())throw new Error(`Preset ${i.label}'s 'from' is before fromMonth ${Te(a,"MMM, yyyy")}.`)}if(s){let M=(h=i.dateRange.to)==null?void 0:h.getMonth();if(M&&M>s.getMonth())throw new Error(`Preset ${i.label}'s 'to' is after toMonth ${Te(s,"MMM, yyyy")}.`)}if(c){let M=(b=i.dateRange.from)==null?void 0:b.getDate();if(M&&M<c.getDate())throw new Error(`Preset ${i.dateRange.from}'s 'from' is before fromDay ${Te(c,"MMM dd, yyyy")}.`)}if(l){let M=(g=i.dateRange.to)==null?void 0:g.getDate();if(M&&M>l.getDate())throw new Error(`Preset ${i.label}'s 'to' is after toDay ${Te(l,"MMM dd, yyyy")}.`)}}})}};import{cva as sl}from"class-variance-authority";import{Calendar as ll,ChevronDown as cl}from"lucide-react";import{forwardRef as dl}from"react";import{jsx as Qt,jsxs as ul}from"react/jsx-runtime";var ml=sl(["group peer flex cursor-pointer appearance-none items-center gap-x-2 truncate rounded-md border px-3 h-10 outline-none transition-all text-sm","bg-white border-gray-200 text-gray-900 placeholder-gray-400 transition-all","disabled:pointer-events-none disabled:bg-gray-100 disabled:text-gray-400","focus-visible:border-gray-500 data-[state=open]:border-gray-500 data-[state=open]:ring-4 data-[state=open]:ring-gray-200"],{variants:{hasError:{true:"ring-2 ring-red-200 border-red-500"}}}),_r=dl(({className:e,children:t,placeholder:r,hasError:o,...a},s)=>ul("button",{ref:s,className:n(ml({hasError:o}),e),...a,children:[Qt(ll,{className:n("h-4 w-4 shrink-0 text-gray-400",!!t&&"text-gray-900")}),Qt("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-gray-900",children:t||(r?Qt("span",{className:"text-gray-400",children:r}):null)}),Qt(cl,{className:"h-4 w-4 flex-shrink-0 text-gray-400 transition-transform duration-75 group-data-[state=open]:rotate-180"})]}));_r.displayName="DatePicker.Trigger";import{jsx as ge,jsxs as gl}from"react/jsx-runtime";var fl=({value:e,defaultValue:t,presetId:r,onChange:o,presets:a,disabled:s,disableNavigation:c,disabledDays:l,showYearNavigation:d=!1,locale:m=pl,placeholder:i="Select date range",hasError:p,align:f="center",className:x,...h})=>{let{isDesktop:b}=Y(),[g,N]=Xt(!1),[S,M]=Xt(a&&r?a==null?void 0:a.find(({id:T})=>T===r):void 0),[P,w]=Xt((S==null?void 0:S.dateRange)??e??t??void 0),[y,R]=Xt(P==null?void 0:P.to),z=Aa(()=>P,[g]);Hr(()=>{w(e)},[e]),Hr(()=>{let T=a==null?void 0:a.find(({id:de})=>de===r);M(T),w((T==null?void 0:T.dateRange)??e??t)},[a,r]),Hr(()=>{g?P&&R(P.to):R(P==null?void 0:P.to)},[g]);let D=(T,de)=>{let J=(P==null?void 0:P.from)&&(P==null?void 0:P.to)?{from:de}:T;w(J),M(void 0),(J==null?void 0:J.from)&&(J==null?void 0:J.to)&&(o==null||o(J),N(!1))},q=T=>{w(T.dateRange),M(T),o==null||o(T.dateRange,T),N(!1)},C=()=>{w(z),N(!1)},O=T=>{T||C(),N(T)},ce=Aa(()=>P?`${P.from?Or(P.from,m):""} - ${P.to?Or(P.to,m):""}`:null,[P,m]);return et((a==null?void 0:a.filter(T=>T.shortcut).map(T=>T.shortcut))??[],T=>{let de=a==null?void 0:a.find(J=>J.shortcut===T.key);de&&q(de)}),ge(zr.Provider,{value:{isOpen:g,setIsOpen:N},children:ge(ot,{align:f,openPopover:g,setOpenPopover:O,popoverContentClassName:"rounded-xl",content:ge("div",{className:"flex w-full",children:gl("div",{className:"scrollbar-hide flex w-full flex-col overflow-x-scroll sm:flex-row-reverse sm:items-start",children:[a&&a.length>0&&ge("div",{className:n("relative flex h-16 w-full items-center sm:h-full sm:w-48","border-b border-gray-200 sm:border-b-0 sm:border-l","scrollbar-hide overflow-auto"),children:ge("div",{className:"absolute px-3 sm:inset-0 sm:left-0 sm:p-3",children:ge(Ir,{currentValue:P,presets:a,onSelect:q})})}),ge("div",{className:"scrollbar-hide overflow-x-scroll",children:ge(Ta,{mode:"range",selected:P,onSelect:D,month:y,onMonthChange:R,numberOfMonths:b?2:1,disabled:l,disableNavigation:c,showYearNavigation:d,locale:m,className:"scrollbar-hide overflow-x-scroll",classNames:{months:"flex flex-row divide-x divide-gray-200 overflow-x-scroll scrollbar-hide"},...h})})]})}),children:ge(_r,{placeholder:i,disabled:s,className:x,hasError:p,"aria-required":h.required||h["aria-required"],"aria-invalid":h["aria-invalid"],"aria-label":h["aria-label"],"aria-labelledby":h["aria-labelledby"],children:(S==null?void 0:S.label)??ce})})})};function Oh({presets:e,...t}){return e&&Ea(e,t),ge(fl,{presets:e,...t})}import{jsx as Jt,jsxs as Da}from"react/jsx-runtime";function Fh({icon:e,title:t,description:r,learnMore:o,children:a}){return Da("div",{className:"flex flex-col items-center justify-center gap-y-4",children:[Jt("div",{className:"flex size-16 items-center justify-center rounded-2xl border border-gray-200 bg-gray-50",children:Jt(e,{className:"size-6 text-gray-800"})}),Jt("p",{className:"text-center text-base font-medium text-gray-950",children:t}),r&&Da("p",{className:"max-w-sm text-balance text-center text-sm text-gray-500",children:[r," ",o&&Jt("a",{href:o,target:"_blank",className:"underline underline-offset-2 hover:text-gray-800",children:"Learn more \u2197"})]}),a]})}import{cva as hl}from"class-variance-authority";import{useState as Ia}from"react";import{toast as za}from"sonner";import{Fragment as bl,jsx as he,jsxs as Br}from"react/jsx-runtime";var Vr={any:{types:[]},images:{types:["image/png","image/jpeg"],errorMessage:"File type not supported (.png or .jpg only)"},csv:{types:["text/csv"],errorMessage:"File type not supported (.csv only)"}},vl=hl("group relative isolate flex aspect-[1200/630] w-full flex-col items-center justify-center overflow-hidden bg-white transition-all hover:bg-gray-50",{variants:{variant:{default:"rounded-md border border-gray-300 shadow-sm",plain:""}},defaultVariants:{variant:"default"}});function Xh({readFile:e,onChange:t,variant:r,className:o,iconClassName:a,previewClassName:s,customPreview:c,accept:l="any",imageSrc:d,loading:m=!1,clickToUpload:i=!0,showHoverOverlay:p=!0,content:f,maxFileSizeMB:x=0,targetResolution:h,accessibilityLabel:b="File upload",disabled:g=!1}){let[N,S]=Ia(!1),[M,P]=Ia(null),w=async y=>{let R="dataTransfer"in y?y.dataTransfer.files&&y.dataTransfer.files[0]:y.target.files&&y.target.files[0];if(!R)return;if(P(R.name),x>0&&R.size/1024/1024>x){za.error(`File size too big (max ${x} MB)`);return}let z=Vr[l].types;if(z.length&&!z.includes(R.type)){za.error(Vr[l].errorMessage??"File type not supported");return}let D=R;if(h&&R.type.startsWith("image/"))try{let q=await go(R,h),C=await fetch(q).then(O=>O.blob());D=new File([C],R.name,{type:R.type})}catch(q){console.error("Error resizing image:",q)}if(e){let q=new FileReader;q.onload=C=>{var O;return t==null?void 0:t({src:(O=C.target)==null?void 0:O.result,file:D})},q.readAsDataURL(D);return}t==null||t({file:D})};return Br("label",{className:n(vl({variant:r}),g?"cursor-not-allowed":n(i&&"cursor-pointer"),o),children:[m&&he("div",{className:"absolute inset-0 z-[5] flex items-center justify-center rounded-[inherit] bg-white",children:he(mt,{})}),he("div",{className:"absolute inset-0 z-[5]",onDragOver:y=>{y.preventDefault(),y.stopPropagation(),S(!0)},onDragEnter:y=>{y.preventDefault(),y.stopPropagation(),S(!0)},onDragLeave:y=>{y.preventDefault(),y.stopPropagation(),S(!1)},onDrop:async y=>{y.preventDefault(),y.stopPropagation(),w(y),S(!1)}}),Br("div",{className:n("absolute inset-0 z-[3] flex flex-col items-center justify-center rounded-[inherit] border-2 border-transparent bg-white transition-all",g&&"bg-gray-50",N&&!g&&"cursor-copy border-black bg-gray-50 opacity-100",d?n("opacity-0",p&&!g&&"group-hover:opacity-100"):n(!g&&"group-hover:bg-gray-50")),children:[he(Go,{className:n("size-7 transition-all duration-75",g?"text-gray-400":n("text-gray-500 group-hover:scale-110 group-active:scale-95",N?"scale-110":"scale-100"),a)}),f!==null&&he("div",{className:n("mt-2 text-center text-sm text-gray-500",g&&"text-gray-400"),children:f??he(bl,{children:Br("p",{children:["Drag and drop ",i&&"or click"," to upload."]})})}),he("span",{className:"sr-only",children:b})]}),d&&(c??he("img",{src:d,alt:"Preview",className:n("h-full w-full rounded-[inherit] object-cover",s)})),i&&he("div",{className:"sr-only mt-1 flex shadow-sm",children:he("input",{type:"file",accept:Vr[l].types.join(","),onChange:w,disabled:g},M)})]})}import{AnimatePresence as xl,motion as Oa}from"framer-motion";import{X as yl}from"lucide-react";import{isValidElement as wl}from"react";import{Fragment as Cl,jsx as X,jsxs as xt}from"react/jsx-runtime";function Ha({filters:e,activeFilters:t,onRemove:r,onRemoveAll:o,className:a}){return et("Escape",o,{priority:1}),X(Ce,{height:!0,className:"w-full",transition:{type:"tween",duration:.3},children:xt("div",{className:n("flex w-full flex-wrap items-start gap-4 sm:flex-nowrap",a),children:[X("div",{className:"flex grow flex-wrap gap-x-4 gap-y-2",children:X(xl,{children:t==null?void 0:t.map(({key:s,value:c})=>{if(s==="loader")return X(Oa.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},className:"h-9 w-48 animate-pulse rounded-md border border-gray-200 bg-white"},`loader-${c}`);let l=e.find(d=>d.key===s);return l?(l.multiple&&Array.isArray(c)?c:[c]).map(d=>{var f,x,h;let m=(f=l.options)==null?void 0:f.find(b=>typeof b.value=="string"&&typeof d=="string"?b.value.toLowerCase()===d.toLowerCase():b.value===d),i=(m==null?void 0:m.icon)??((x=l.getOptionIcon)==null?void 0:x.call(l,d,{key:l.key,option:m}))??l.icon,p=(m==null?void 0:m.label)??((h=l.getOptionLabel)==null?void 0:h.call(l,d,{key:l.key,option:m}))??d;return xt(Oa.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},className:"flex items-center divide-x rounded-md border border-gray-200 bg-white text-sm text-black",children:[xt("div",{className:"flex items-center gap-2.5 px-3 py-2",children:[X("span",{className:"shrink-0 text-gray-600",children:_a(l.icon)?l.icon:X(l.icon,{className:"h-4 w-4"})}),l.label]}),X("div",{className:"px-3 py-2 text-gray-500",children:"is"}),X("div",{className:"flex items-center gap-2.5 px-3 py-2",children:l.options?xt(Cl,{children:[X("span",{className:"shrink-0 text-gray-600",children:_a(i)?i:X(i,{className:"h-4 w-4"})}),Tt(p,30)]}):X("div",{className:"h-5 w-12 animate-pulse rounded-md bg-gray-200"})}),X("button",{type:"button",className:"h-full rounded-r-md p-2 text-gray-500 ring-inset ring-gray-500 hover:bg-gray-100 hover:text-gray-800 focus:outline-none focus-visible:ring-1",onClick:()=>r(s,d),children:X(yl,{className:"h-3.5 w-3.5"})})]},`${s}-${d}`)}):(console.error("Filter.List received an activeFilter without a corresponding filter"),null)})})}),(t==null?void 0:t.length)!==0&&xt("button",{type:"button",className:"group mt-px flex items-center gap-2 whitespace-nowrap rounded-lg border border-transparent px-3 py-2 text-sm text-gray-500 ring-inset ring-gray-500 transition-colors hover:border-gray-200 hover:bg-white hover:text-black focus:outline-none",onClick:o,children:["Clear Filters",X("kbd",{className:"rounded-md border border-gray-200 px-1.5 py-0.5 text-xs text-gray-950 group-hover:bg-gray-50",children:"ESC"})]})]})})}var _a=e=>wl(e);import{Command as Ee,useCommandState as Nl}from"cmdk";import{ChevronDown as kl,ListFilter as Pl}from"lucide-react";import{Fragment as Sl,forwardRef as Ml,isValidElement as Ba,useCallback as er,useEffect as tr,useImperativeHandle as Rl,useRef as Fr,useState as Wr}from"react";import{Fragment as Il,jsx as H,jsxs as ve}from"react/jsx-runtime";function Wa({filters:e,onSelect:t,onRemove:r,onOpenFilter:o,onSearchChange:a,onSelectedFilterChange:s,activeFilters:c,askAI:l,children:d,emptyState:m,className:i}){var D,q;let{isMobile:p}=Y(),f=Fr(null),x=Fr(),[h,b]=Wr(!1);et("f",()=>b(!0),{enabled:!h});let[g,N]=Wr(""),[S,M]=Wr(null),P=er(()=>{N(""),M(null)},[]);tr(()=>{h||P()},[h]);let w=S?e.find(({key:C})=>C===S):null,y=er(C=>{f.current&&(x.current={width:f.current.clientWidth,height:f.current.clientHeight}),N(""),M(C),o==null||o(C)},[]),R=er(C=>{if(!w||!c)return!1;let O=c.find(({key:ce})=>ce===S);return(O==null?void 0:O.value)===C||O&&w.multiple&&Array.isArray(O.value)&&O.value.includes(C)},[w]),z=er(C=>{w&&(R(C)?r(w.key,C):t(w.key,C),w.multiple||b(!1))},[c,w,l]);return tr(()=>{a==null||a(g)},[g]),tr(()=>{s==null||s(S)},[S]),tr(()=>{(w==null?void 0:w.options)&&f.current&&(x.current={width:f.current.clientWidth,height:f.current.clientHeight})},[w==null?void 0:w.options]),H(ot,{openPopover:h,setOpenPopover:b,onEscapeKeyDown:C=>{S&&(C.preventDefault(),P())},content:H(Ce,{width:!p,height:!0,className:"rounded-[inherit]",style:{transform:"translateZ(0)"},children:ve(Ee,{loop:!0,shouldFilter:!w||w.shouldFilter!==!1,children:[ve("div",{className:"flex items-center overflow-hidden rounded-t-lg border-b border-gray-200",children:[H(Tl,{placeholder:`${(w==null?void 0:w.label)||"Filter"}...`,value:g,onValueChange:N,onKeyDown:C=>{(C.key==="Escape"||C.key==="Backspace"&&!g)&&(C.preventDefault(),C.stopPropagation(),S?P():b(!1))},emptySubmit:C=>{C.preventDefault(),C.stopPropagation(),l?(t("ai",w?`${w.label} ${g}`:g),b(!1)):z(g)}}),!w&&H("kbd",{className:"mr-2 hidden shrink-0 rounded border border-gray-200 bg-gray-100 px-2 py-0.5 text-xs font-light text-gray-500 md:block",children:"F"})]}),H(El,{ref:f,children:ve(Ee.List,{className:n("flex w-full flex-col gap-1 p-1",w?"min-w-[100px]":"min-w-[180px]"),children:[w?((q=(D=w.options)==null?void 0:D.filter(C=>!g||!C.hideDuringSearch))==null?void 0:q.map(C=>{let O=R(C.value);return H(Va,{filter:w,option:C,right:O?H(Oo,{className:"h-4 w-4"}):C.right,onSelect:()=>z(C.value)},C.value)}))??H(Ee.Loading,{children:H("div",{className:"-m-1 flex items-center justify-center",style:x.current,children:H(ye,{})})}):e.map(C=>ve(Sl,{children:[H(Va,{filter:C,onSelect:()=>y(C.key)}),C.separatorAfter&&H(Ee.Separator,{className:"-mx-1 my-1 border-b border-gray-200"})]},C.key)),(!w||w.options)&&H(Al,{search:g,askAI:l,children:m?Ll(m)?(m==null?void 0:m[S??"default"])??"No matches":m:"No matches"})]})},S)]})}),children:ve("button",{type:"button",className:n("group flex h-10 cursor-pointer appearance-none items-center gap-x-2 truncate rounded-md border px-3 text-sm outline-none transition-all","border-gray-200 bg-white text-gray-900 placeholder-gray-400","focus-visible:border-gray-500 data-[state=open]:border-gray-500 data-[state=open]:ring-4 data-[state=open]:ring-gray-200",i),children:[H(Pl,{className:"size-4 shrink-0"}),H("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-gray-900",children:d??"Filter"}),c!=null&&c.length?H("div",{className:"flex size-4 shrink-0 items-center justify-center rounded-full bg-black text-[0.625rem] text-white",children:c.length}):H(kl,{className:"size-4 shrink-0 text-gray-400 transition-transform duration-75 group-data-[state=open]:rotate-180"})]})})}function Ll(e){return typeof e=="object"&&e!==null&&!Ba(e)}var Tl=e=>{let t=Nl(r=>r.filtered.count===0);return H(Ee.Input,{...e,size:1,className:"grow border-0 py-3 pl-4 pr-2 outline-none placeholder:text-gray-400 focus:ring-0 sm:text-sm",onKeyDown:r=>{var o,a;(o=e.onKeyDown)==null||o.call(e,r),r.key==="Enter"&&t&&((a=e.emptySubmit)==null||a.call(e,r))},autoCapitalize:"none"})},El=Ml(({children:e},t)=>{let r=Fr(null);Rl(t,()=>r.current);let{scrollProgress:o,updateScrollProgress:a}=tt(r);return ve(Il,{children:[H("div",{className:"scrollbar-hide max-h-[50vh] w-screen overflow-y-scroll sm:w-auto",ref:r,onScroll:a,children:e}),H("div",{className:"pointer-events-none absolute bottom-0 left-0 hidden h-16 w-full bg-gradient-to-t from-white sm:block",style:{opacity:1-Math.pow(o,2)}})]})});function Va({filter:e,option:t,right:r,onSelect:o}){var l,d;let{isMobile:a}=Y(),s=t?t.icon??((l=e.getOptionIcon)==null?void 0:l.call(e,t.value,{key:e.key,option:t}))??e.icon:e.icon,c=t?t.label??((d=e.getOptionLabel)==null?void 0:d.call(e,t.value,{key:e.key,option:t})):e.label;return ve(Ee.Item,{className:n("flex cursor-pointer items-center gap-3 whitespace-nowrap rounded-md px-3 py-2 text-left text-sm","data-[selected=true]:bg-gray-100"),onPointerDown:m=>{m.preventDefault()},onPointerUp:m=>{m.preventDefault(),a?setTimeout(o,100):o()},onSelect:o,value:c+(t==null?void 0:t.value),children:[H("span",{className:"shrink-0 text-gray-600",children:Dl(s)?s:H(s,{className:"h-4 w-4"})}),Tt(c,48),H("div",{className:"ml-1 flex shrink-0 grow justify-end text-gray-500",children:r})]})}var Al=({search:e,askAI:t,children:r})=>t&&e?ve(Ee.Empty,{className:"flex min-w-[180px] items-center space-x-2 rounded-md bg-gray-100 px-3 py-2",children:[H(Co,{className:"h-4 w-4"}),ve("p",{className:"text-center text-sm text-gray-600",children:["Ask AI ",ve("span",{className:"text-black",children:['"',e,'"']})]})]}):H(Ee.Empty,{className:"p-2 text-center text-sm text-gray-400",children:r}),Dl=e=>Ba(e);var C2={Select:Wa,List:Ha};import{useMemo as zl,useState as Fa}from"react";import{jsx as Fe,jsxs as rr}from"react/jsx-runtime";function L2({title:e,description:t,inputAttrs:r,helpText:o,buttonText:a="Save Changes",disabledTooltip:s,handleSubmit:c}){let[l,d]=Fa(r.defaultValue),[m,i]=Fa(!1),p=zl(()=>m||!l||l===r.defaultValue,[m,l,r.defaultValue]);return rr("form",{onSubmit:async f=>{f.preventDefault(),i(!0),await c({[r.name]:l}),i(!1)},className:"rounded-lg border border-gray-200 bg-white",children:[rr("div",{className:"relative flex flex-col space-y-6 p-5 sm:p-10",children:[rr("div",{className:"flex flex-col space-y-3",children:[Fe("h2",{className:"text-xl font-medium",children:e}),Fe("p",{className:"text-sm text-gray-500",children:t})]}),typeof r.defaultValue=="string"?Fe("input",{...r,type:r.type||"text",required:!0,disabled:!!s,onChange:f=>d(f.target.value),className:n("w-full max-w-md rounded-md border border-gray-300 text-gray-900 placeholder-gray-400 focus:border-gray-500 focus:outline-none focus:ring-gray-500 sm:text-sm",{"cursor-not-allowed bg-gray-100 text-gray-400":s})}):Fe("div",{className:"h-[2.35rem] w-full max-w-md animate-pulse rounded-md bg-gray-200"})]}),rr("div",{className:"flex items-center justify-between space-x-4 rounded-b-lg border-t border-gray-200 bg-gray-50 p-3 sm:px-10",children:[typeof o=="string"?Fe("p",{className:"prose-sm prose-a:underline prose-a:underline-offset-4 hover:prose-a:text-gray-700 text-gray-500 transition-colors",dangerouslySetInnerHTML:{__html:o||""}}):o,Fe("div",{className:"shrink-0",children:Fe(ie,{text:a,loading:m,disabled:p,disabledTooltip:s})})]})]})}import{useId as Ol}from"react";import{jsx as or,jsxs as _l}from"react/jsx-runtime";function D2({cellSize:e=12,strokeWidth:t=1,patternOffset:r=[0,0],className:o}){let a=Ol();return _l("svg",{className:n("pointer-events-none absolute inset-0 text-black/10",o),width:"100%",height:"100%",children:[or("defs",{children:or("pattern",{id:`grid-${a}`,x:r[0]-1,y:r[1]-1,width:e,height:e,patternUnits:"userSpaceOnUse",children:or("path",{d:`M ${e} 0 L 0 0 0 ${e}`,fill:"transparent",stroke:"currentColor",strokeWidth:t})})}),or("rect",{fill:`url(#grid-${a})`,width:"100%",height:"100%"})]})}import{AlertCircle as Hl}from"lucide-react";import Vl,{useCallback as Bl,useState as Wl}from"react";import{jsx as Ue,jsxs as Ur}from"react/jsx-runtime";var Fl=Vl.forwardRef(({className:e,type:t,...r},o)=>{let[a,s]=Wl(!1),c=Bl(()=>s(!a),[a,s]);return Ur("div",{children:[Ur("div",{className:"relative flex",children:[Ue("input",{type:a?"text":t,className:n("w-full max-w-md rounded-md border border-gray-300 text-gray-900 placeholder-gray-400 focus:border-gray-500 focus:outline-none focus:ring-gray-500 sm:text-sm",r.error&&"border-red-500 focus:border-red-500 focus:ring-red-500",e),ref:o,...r}),Ur("div",{className:"group",children:[r.error&&Ue("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex flex-none items-center px-2.5",children:Ue(Hl,{className:n("size-5 text-white",t==="password"&&"transition-opacity group-hover:opacity-0"),fill:"#ef4444"})}),t==="password"&&Ue("button",{className:n("absolute inset-y-0 right-0 flex items-center px-3",r.error&&"opacity-0 transition-opacity group-hover:opacity-100"),type:"button",onClick:()=>c(),"aria-label":a?"Hide password":"Show Password",children:a?Ue($o,{className:"size-4 flex-none text-gray-500 transition hover:text-gray-700","aria-hidden":!0}):Ue(Ko,{className:"size-4 flex-none text-gray-500 transition hover:text-gray-700","aria-hidden":!0})})]})]}),r.error&&Ue("span",{className:"mt-2 block text-sm text-red-500",role:"alert","aria-live":"assertive",children:r.error})]})});Fl.displayName="Input";import{flip as Kl,offset as jl,size as Yl,useDismiss as Zl,useFloating as ql,useInteractions as Ql}from"@floating-ui/react";import{Command as ke,useCommandState as Xl}from"cmdk";import{Check as Jl,ChevronDown as ec,Search as Gr,X as tc}from"lucide-react";import{createContext as rc,forwardRef as oc,useContext as Zr,useEffect as $r,useMemo as ac,useRef as Ga,useState as Kr}from"react";import{Drawer as at}from"vaul";import Ul from"next/image";import{useEffect as Gl,useState as Ua}from"react";import{jsx as $l}from"react/jsx-runtime";function ar(e){let[t,r]=Ua(!0),[o,a]=Ua(e.src);Gl(()=>a(e.src),[e.src]);let s=c=>{r(!1);let l=c.target;l.naturalWidth<=16&&l.naturalHeight<=16&&a(`https://avatar.vercel.sh/${encodeURIComponent(e.alt)}`)};return $l(Ul,{...e,src:o,alt:e.alt,className:n(t?"blur-[2px]":"blur-0",e.className),onLoad:s,onError:()=>{a(`https://avatar.vercel.sh/${encodeURIComponent(e.alt)}`)},unoptimized:!0})}import{jsx as L,jsxs as Q}from"react/jsx-runtime";var ir=rc({inputAttrs:{},openCommandList:!1,setOpenCommandList:()=>{},inputValue:"",setInputValue:()=>{},disabled:!1,selectedItem:null,setSelectedItem:()=>{}});function iv({items:e,selectedItem:t,setSelectedItem:r,className:o,disabled:a,adjustForMobile:s,icon:c,inputAttrs:l,noItemsElement:d}){let m=Ga(null),[i,p]=Kr(!1),[f,x]=Kr(""),[h,b]=Kr(!1);$r(()=>{i&&b(!1)},[i]),$r(()=>b(!0),[f]),$r(()=>{t&&x(t.value)},[t]);let g=ac(()=>{let C=f.toLowerCase();return h?e.filter(O=>O.value.toLowerCase().includes(C)):f?e.sort((O,ce)=>(ce.value.toLowerCase().includes(C)?1:0)-(O.value.toLowerCase().includes(C)?1:0)):e},[h,f,e]),{refs:N,floatingStyles:S,context:M}=ql({open:i,onOpenChange:p,middleware:[jl(8),Yl({apply({elements:{floating:C},availableHeight:O}){Object.assign(C.style,{maxHeight:`${Math.max(75,Math.min(O,290))}px`})},padding:8}),Kl({fallbackStrategy:"initialPlacement",padding:8})]}),P=Zl(M),{getReferenceProps:w,getFloatingProps:y}=Ql([P]),R=Ga(null),{scrollProgress:z,updateScrollProgress:D}=tt(R),{isMobile:q}=Y();return L(ir.Provider,{value:{inputAttrs:l||{},openCommandList:i,setOpenCommandList:p,inputValue:f,setInputValue:x,disabled:Boolean(a),selectedItem:t,setSelectedItem:r},children:q&&s?Q(at.Root,{open:i,onOpenChange:p,children:[L(at.Trigger,{className:"sm:hidden",asChild:!0,children:L(ke,{ref:m,className:"relative",shouldFilter:!1,loop:!0,children:Q("div",{className:n("group relative rounded-md border border-gray-300 bg-white px-1 focus-within:border-gray-500 focus-within:ring-1 focus-within:ring-gray-500 md:min-w-[140px]",o),children:[L("div",{className:"absolute inset-y-0 left-0 flex items-center justify-center pl-3 text-gray-400",children:t&&t.image?L("img",{src:t.image,alt:t.value,className:"h-4 w-4 rounded-full"}):c||L(Gr,{className:"h-4 w-4 text-gray-400"})}),Q("div",{className:"flex h-10 px-8",children:[L(jr,{}),L(Yr,{})]})]})})}),L(at.Overlay,{className:"fixed inset-0 z-40 bg-gray-100 bg-opacity-10 backdrop-blur"}),Q(at.Portal,{children:[L(at.Content,{className:"fixed bottom-0 left-0 right-0 z-50 mt-24 rounded-t-lg border-t border-gray-200 bg-white",onPointerDownOutside:C=>{C.target instanceof Element&&C.target.closest("[data-sonner-toast]")&&C.preventDefault()},children:Q(ke,{ref:m,className:"relative",shouldFilter:!1,loop:!0,children:[Q("div",{className:n("group relative mb-2 rounded-t-md border-b border-gray-300 bg-white p-1 sm:border sm:py-0 sm:focus-within:border-gray-500 sm:focus-within:ring-1 sm:focus-within:ring-gray-200",o),children:[L("div",{className:"absolute inset-y-0 left-0 flex items-center justify-center pl-3 text-gray-400",children:t&&t.image?L("img",{src:t.image,alt:t.value,className:"h-4 w-4 rounded-full"}):c||L(Gr,{className:"h-4 w-4 text-gray-400"})}),Q("div",{className:"flex h-10 px-8",children:[L(jr,{}),L(Yr,{})]})]}),i&&Q(ke.List,{className:"dub-scrollbar h-[70vh] overflow-y-auto p-2",children:[e.length===0&&f===""&&(d?L("div",{children:d}):L("p",{className:"px-4 py-2 text-sm text-gray-600",children:"No items found."})),f!==""&&L(ke.Empty,{className:"px-4 py-2 text-sm text-gray-600",children:"No results found."}),L($a,{items:g})]})]})}),L(at.Overlay,{})]})]}):Q(ke,{ref:m,className:"relative",shouldFilter:!1,loop:!0,children:[Q("div",{className:n("group rounded-md border border-gray-200 bg-white px-1 transition-all focus-within:border-gray-500 focus-within:ring-4 focus-within:ring-gray-200",o),children:[L("div",{onClick:()=>p(C=>!C),className:"absolute inset-y-0 left-0 flex cursor-pointer items-center justify-center pl-3 text-gray-400",children:t&&t.image?L("img",{src:t.image,alt:t.value,className:"h-4 w-4 rounded-full"}):c||L(Gr,{className:"h-4 w-4 text-gray-400"})}),Q("div",{className:"flex h-10 px-8",children:[L(jr,{ref:N.setReference,...w()}),L(Yr,{})]})]}),i&&Q("div",{ref:N.setFloating,style:S,...y(),className:"z-20 flex w-full min-w-[160px] flex-col overflow-hidden rounded-md border border-gray-200 bg-white shadow-md",children:[Q("div",{ref:R,onScroll:D,className:"grow overflow-y-auto p-2",children:[Q(ke.List,{children:[e.length===0&&f===""&&(d?L("div",{children:d}):L("p",{className:"px-4 py-2 text-sm text-gray-600",children:"No items found."})),f!==""&&L(ke.Empty,{className:"px-4 py-2 text-sm text-gray-600",children:"No results found."})]}),L($a,{items:g})]}),L("div",{className:"pointer-events-none absolute bottom-0 left-0 hidden h-16 w-full bg-gradient-to-t from-white sm:block",style:{opacity:1-Math.pow(z,2)}})]})]})})}var jr=oc((e,t)=>{let r=Xl(m=>m.filtered.count===0),{inputAttrs:o,openCommandList:a,setOpenCommandList:s,inputValue:c,setInputValue:l,disabled:d}=Zr(ir);return L(ke.Input,{ref:t,placeholder:(o==null?void 0:o.placeholder)||"Search...",autoFocus:a,onFocus:()=>s(!0),value:c,onValueChange:l,onKeyDown:m=>{m.key==="Escape"?(m.preventDefault(),s(!1)):m.key==="Enter"&&r?s(!1):m.key.match(/^[a-z0-9]$/i)&&!m.metaKey&&s(!0)},disabled:d,className:"block w-full truncate rounded-md border-none px-0 text-base text-gray-900 placeholder-gray-400 outline-none outline-0 transition-all duration-300 focus:ring-0 md:text-sm",autoCapitalize:"none"})});function Yr(){let{setSelectedItem:e,openCommandList:t,setOpenCommandList:r,inputValue:o,setInputValue:a}=Zr(ir);return L("button",{type:"button",onClick:()=>{r(s=>!s),e(null),a("")},className:"absolute inset-y-0 right-0 my-auto pr-3",children:o.length>0?L(tc,{className:"h-4 w-4 text-gray-400 transition-all hover:text-gray-700"}):L(ec,{className:n("h-4 w-4 text-gray-400 transition-all hover:text-gray-700",{"rotate-180 transform":t})})})}function $a({items:e}){let{setSelectedItem:t,setOpenCommandList:r,setInputValue:o}=Zr(ir);return e.map(a=>Q(ke.Item,{value:a.value,disabled:a.disabled,onSelect:()=>{t(a),o(a.value),r(!1)},className:"group flex cursor-pointer items-center justify-between rounded-md px-4 py-2 text-sm text-gray-900 hover:bg-gray-100 hover:text-gray-900 active:bg-gray-200 aria-disabled:cursor-not-allowed aria-disabled:opacity-75 aria-disabled:hover:bg-white aria-selected:bg-gray-100 aria-selected:text-gray-900",children:[Q("div",{className:"flex items-center space-x-2",children:[a.image&&L(ar,{src:a.image,alt:a.value,className:"h-4 w-4 rounded-full",width:16,height:16}),L("p",{className:n("whitespace-nowrap py-0.5 text-sm",a.color&&"rounded-md px-2",a.color==="red"&&"bg-red-100 text-red-600",a.color==="yellow"&&"bg-yellow-100 text-yellow-600",a.color==="green"&&"bg-green-100 text-green-600",a.color==="blue"&&"bg-blue-100 text-blue-600",a.color==="purple"&&"bg-purple-100 text-purple-600",a.color==="brown"&&"bg-brown-100 text-brown-600"),children:a.value}),a.label&&L(Ft,{className:"text-xs",variant:"neutral",children:a.label})]}),L(Jl,{className:"invisible h-5 w-5 text-gray-500 aria-selected:visible"})]},a.id))}import*as qr from"@radix-ui/react-label";import{cva as ic}from"class-variance-authority";import*as Ka from"react";import{jsx as lc}from"react/jsx-runtime";var nc=ic("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),sc=Ka.forwardRef(({className:e,...t},r)=>lc(qr.Root,{ref:r,className:n(nc(),e),...t}));sc.displayName=qr.Root.displayName;import{curveNatural as ja}from"@visx/curve";import{LinearGradient as Ya}from"@visx/gradient";import{Group as cc}from"@visx/group";import{ParentSize as dc}from"@visx/responsive";import{scaleLinear as mc,scaleUtc as uc}from"@visx/scale";import{Area as pc,AreaClosed as fc}from"@visx/shape";import{motion as Za}from"framer-motion";import{useId as gc,useMemo as qa}from"react";import{jsx as be,jsxs as Qr}from"react/jsx-runtime";function bv(e){return be(dc,{className:"relative",children:({width:t,height:r})=>t>0&&r>0&&be(hc,{...{width:t,height:r,...e}})})}var Ae={top:8,right:2,bottom:2,left:2};function hc({width:e,height:t,data:r,curve:o=!0,color:a}){let s=gc(),c=qa(()=>r.map(({date:m})=>({date:m,value:0})),[r]),{yScale:l,xScale:d}=qa(()=>{let m=r.map(({value:h})=>h),i=Math.max(...m),p=r.map(({date:h})=>h.getTime()),f=new Date(Math.min(...p)),x=new Date(Math.max(...p));return{yScale:mc({domain:[-2,Math.max(i,2)],range:[t-Ae.top-Ae.bottom,0],nice:!0,clamp:!0}),xScale:uc({domain:[f,x],range:[0,e-Ae.left-Ae.right],nice:!0})}},[r,t,e]);return Qr("svg",{width:e,height:t,children:[Qr("defs",{children:[be(Ya,{id:`${s}-color-gradient`,from:a||"#7D3AEC",to:a||"#DA2778",x1:0,x2:e-Ae.left-Ae.right,gradientUnits:"userSpaceOnUse"}),be(Ya,{id:`${s}-mask-gradient`,from:"white",to:"white",fromOpacity:.3,toOpacity:0,x1:0,x2:0,y1:0,y2:1}),be("mask",{id:`${s}-mask`,maskContentUnits:"objectBoundingBox",children:be("rect",{width:"1",height:"1",fill:`url(#${s}-mask-gradient)`})})]}),Qr(cc,{left:Ae.left,top:Ae.top,children:[be(pc,{data:r,x:({date:m})=>d(m),y:({value:m})=>l(m)??0,curve:o?ja:void 0,children:({path:m})=>be(Za.path,{initial:{d:m(c)||"",opacity:0},animate:{d:m(r)||"",opacity:1},strokeWidth:1.5,stroke:`url(#${s}-color-gradient)`})}),be(fc,{data:r,x:({date:m})=>d(m),y:({value:m})=>l(m)??0,yScale:l,curve:o?ja:void 0,children:({path:m})=>be(Za.path,{initial:{d:m(c)||"",opacity:0},animate:{d:m(r)||"",opacity:1},fill:`url(#${s}-color-gradient)`,mask:`url(#${s}-mask)`})})]})]},r.length)}import*as ne from"@radix-ui/react-dialog";import*as Xr from"@radix-ui/react-visually-hidden";import{useRouter as vc}from"next/navigation";import{Drawer as Ge}from"vaul";import{jsx as re,jsxs as it}from"react/jsx-runtime";function kv({children:e,className:t,showModal:r,setShowModal:o,onClose:a,desktopOnly:s,preventDefaultClose:c,drawerRootProps:l}){let d=vc(),m=({dragged:p}={})=>{c&&!p||(a&&a(),o?o(!1):d.back())},{isMobile:i}=Y();return i&&!s?re(Ge.Root,{open:o?r:!0,onOpenChange:p=>{p||m({dragged:!0})},...l,children:it(Ge.Portal,{children:[re(Ge.Overlay,{className:"fixed inset-0 z-50 bg-gray-100 bg-opacity-10 backdrop-blur"}),re(Ge.Content,{onPointerDownOutside:p=>{p.target instanceof Element&&p.target.closest("[data-sonner-toast]")&&p.preventDefault()},className:n("fixed bottom-0 left-0 right-0 z-50 flex flex-col","rounded-t-[10px] border-t border-gray-200 bg-white",t),children:it("div",{className:"scrollbar-hide flex-1 overflow-y-auto rounded-t-[10px] bg-inherit",children:[it(Xr.Root,{children:[re(Ge.Title,{children:"Modal"}),re(Ge.Description,{children:"This is a modal"})]}),re(bc,{}),e]})}),re(Ge.Overlay,{})]})}):re(ne.Root,{open:o?r:!0,onOpenChange:p=>{p||m()},children:it(ne.Portal,{children:[re(ne.Overlay,{id:"modal-backdrop",className:"animate-fade-in fixed inset-0 z-40 bg-gray-100 bg-opacity-50 backdrop-blur-md"}),it(ne.Content,{onOpenAutoFocus:p=>p.preventDefault(),onCloseAutoFocus:p=>p.preventDefault(),onPointerDownOutside:p=>{p.target instanceof Element&&p.target.closest("[data-sonner-toast]")&&p.preventDefault()},className:n("fixed inset-0 z-40 m-auto h-fit w-full max-w-md","border border-gray-200 bg-white p-0 shadow-xl sm:rounded-2xl","scrollbar-hide animate-scale-in overflow-y-auto",t),children:[it(Xr.Root,{children:[re(ne.Title,{children:"Modal"}),re(ne.Description,{children:"This is a modal"})]}),e]})]})})}function bc(){return re("div",{className:"sticky top-0 z-20 flex items-center justify-center rounded-t-[10px] bg-inherit",children:re("div",{className:"my-3 h-1 w-12 rounded-full bg-gray-300"})})}import{Fragment as xc,jsx as nr,jsxs as nt}from"react/jsx-runtime";var Qa=n("flex h-7 items-center justify-center gap-2 whitespace-nowrap rounded-md border border-gray-200 bg-white px-2 text-sm text-gray-600","outline-none hover:bg-gray-50 focus-visible:border-gray-500","disabled:cursor-not-allowed disabled:border-gray-200 disabled:text-gray-400 disabled:bg-gray-100");function Mv({pagination:e,setPagination:t,totalCount:r,unit:o=c=>`item${c?"s":""}`,className:a,children:s}){return nt("div",{className:n("flex items-center justify-between gap-2 text-sm leading-6 text-gray-600",a),children:[nt("div",{className:"flex items-center gap-2",children:[nt("div",{children:[nr("span",{className:"hidden sm:inline-block",children:"Viewing"})," ",r>0&&nt(xc,{children:[nt("span",{className:"font-medium",children:[(e.pageIndex-1)*e.pageSize+1,"-",Math.min((e.pageIndex-1)*e.pageSize+e.pageSize,r)]})," ","of"," "]}),nr("span",{className:"font-medium",children:Rt(r,{full:!0})})," ",typeof o=="function"?o(r!==1):o]}),s]}),nt("div",{className:"flex items-center gap-2",children:[nr("button",{type:"button",className:Qa,onClick:()=>t({...e,pageIndex:e.pageIndex-1}),disabled:e.pageIndex===1,children:"Previous"}),nr("button",{type:"button",className:Qa,onClick:()=>t({...e,pageIndex:e.pageIndex+1}),disabled:(e.pageIndex-1)*e.pageSize+e.pageSize>=r,children:"Next"})]})]})}import*as De from"@radix-ui/react-radio-group";import{Circle as yc}from"lucide-react";import*as Jr from"react";import{jsx as sr}from"react/jsx-runtime";var wc=Jr.forwardRef(({className:e,...t},r)=>sr(De.Root,{className:n("grid gap-2",e),...t,ref:r}));wc.displayName=De.Root.displayName;var Cc=Jr.forwardRef(({className:e,...t},r)=>sr(De.Item,{ref:r,className:n("border-primary text-primary ring-offset-background focus-visible:ring-ring aspect-square h-4 w-4 rounded-full border focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:sr(De.Indicator,{className:"flex items-center justify-center",children:sr(yc,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Cc.displayName=De.Item.displayName;import{Drawer as Ie}from"vaul";import{jsx as $e,jsxs as Mc}from"react/jsx-runtime";function Nc({children:e,contentProps:t,nested:r=!1,...o}){let a=r?Ie.NestedRoot:Ie.Root;return $e(a,{direction:"right",handleOnly:!0,...o,children:Mc(Ie.Portal,{children:[$e(Ie.Overlay,{className:"fixed inset-0 bg-black/20"}),$e(Ie.Content,{...t,onPointerDownOutside:s=>{var c;s.target instanceof Element&&s.target.closest("[data-sonner-toast]")&&s.preventDefault(),(c=t==null?void 0:t.onPointerDownOutside)==null||c.call(t,s)},className:n("fixed bottom-2 right-2 top-2 z-10 flex w-[calc(100%-16px)] outline-none md:w-[540px]",t==null?void 0:t.className),style:{"--initial-transform":"calc(100% + 8px)","user-select":"auto",...t==null?void 0:t.style},children:$e("div",{className:"scrollbar-hide flex size-full grow flex-col overflow-y-auto rounded-lg bg-white",children:e})})]})})}function kc({className:e,...t}){return $e(Ie.Title,{className:n("text-xl font-medium text-zinc-900",e),...t})}function Pc(e){return $e(Ie.Description,{...e})}function Sc(e){return $e(Ie.Close,{...e})}var zv=Object.assign(Nc,{Title:kc,Description:Pc,Close:Sc});import{useEffect as Rc,useRef as Lc,useState as Tc}from"react";import{jsx as Xa}from"react/jsx-runtime";var Ec=`
|
|
2
|
+
import{$ as Jm,$a as B0,$b as Su,$c as Cp,A as Em,Aa as _o,Ab as lu,Ac as qu,B as Am,Ba as Ho,Bb as cu,Bc as na,C as Lo,Ca as Vo,Cb as du,Cc as Qu,D as To,Da as Bo,Db as Zo,Dc as Xu,E as Eo,Ea as N0,Eb as mu,Ec as Ju,F as Ao,Fa as k0,Fb as uu,Fc as ep,G as Do,Ga as P0,Gb as qo,Gc as tp,H as Dm,Ha as Wo,Hb as pu,Hc as rp,I as Im,Ia as Fo,Ib as Qo,Ic as op,J as zm,Ja as Uo,Jb as fu,Jc as ap,K as Om,Ka as S0,Kb as gu,Kc as ip,L as _m,La as M0,Lb as hu,Lc as np,M as Hm,Ma as R0,Mb as vu,Mc as sp,N as Vm,Na as Cr,Nb as bu,Nc as lp,O as Bm,Oa as L0,Ob as Xo,Oc as cp,P as Wm,Pa as T0,Pb as Jo,Pc as dp,Q as Fm,Qa as E0,Qb as ea,Qc as mp,R as Um,Ra as Go,Rb as ta,Rc as up,S as Gm,Sa as A0,Sb as xu,Sc as pp,T as $m,Ta as D0,Tb as yu,Tc as fp,U as Km,Ua as I0,Ub as wu,Uc as gp,V as jm,Va as Ot,Vb as ra,Vc as hp,W as Ym,Wa as z0,Wb as Cu,Wc as vp,X as Zm,Xa as O0,Xb as Nu,Xc as bp,Y as qm,Ya as _0,Yb as ku,Yc as xp,Z as Qm,Za as H0,Zb as Pu,Zc as yp,_ as Xm,_a as V0,_b as oa,_c as wp,a as yo,aa as e0,ab as W0,ac as Mu,ad as Np,b as ym,ba as t0,bb as _t,bc as Ru,bd as kp,c as wm,ca as r0,cb as F0,cc as Lu,cd as Pp,d as wo,da as o0,db as U0,dc as Tu,dd as Sp,e as Co,ea as a0,eb as G0,ec as Eu,ed as Mp,f as Cm,fa as i0,fb as $0,fc as Au,fd as Rp,g as No,ga as n0,gb as K0,gc as Du,gd as Lp,h as ko,ha as s0,hb as j0,hc as Iu,hd as Tp,i as Po,ia as l0,ib as Y0,ic as zu,id as Ep,j as So,ja as c0,jb as Z0,jc as Ou,k as mt,ka as d0,kb as q0,kc as _u,l as Nm,la as Io,lb as Q0,lc as aa,m as ye,ma as m0,mb as $o,mc as Hu,n as km,na as u0,nb as Ko,nc as Vu,o as At,oa as p0,ob as jo,oc as Bu,p as Pm,pa as f0,pb as X0,pc as Wu,q as Dt,qa as zo,qb as J0,qc as Fu,r as Sm,ra as g0,rb as eu,rc as Uu,s as Mo,sa as h0,sb as tu,sc as Gu,t as Ro,ta as v0,tb as ru,tc as Ht,u as Mm,ua as b0,ub as Yo,uc as $u,v as It,va as x0,vb as ou,vc as Ku,w as Rm,wa as y0,wb as au,wc as ju,x as zt,xa as w0,xb as iu,xc as Yu,y as Lm,ya as C0,yb as nu,yc as ia,z as Tm,za as Oo,zb as su,zc as Zu}from"./chunk-E3J362K2.mjs";import{a as Y}from"./chunk-NWME2ANF.mjs";import{a as uo,b as I,c as Rt,d as Lt,e as po,f as qe,g as fo,h as go,i as Tt,j as ho,k as vo,l as Et,m as bo,n as me,o as n,p as xo}from"./chunk-34EW67AY.mjs";import*as ae from"@radix-ui/react-accordion";import{ChevronDown as Gi}from"lucide-react";import*as Bt from"react";import{jsx as Vt,jsxs as Yi}from"react/jsx-runtime";var _p=ae.Root,$i=Bt.forwardRef(({className:e,...t},r)=>Vt(ae.Item,{ref:r,className:n("border-b border-b-slate-200 py-3 last:border-none",e),...t}));$i.displayName="AccordionItem";var Ki=Bt.forwardRef(({className:e,children:t,variant:r="chevron",...o},a)=>{let s=r==="chevron"?Gi:Ht;return Vt(ae.Header,{className:"flex",children:Yi(ae.Trigger,{ref:a,className:n("flex flex-1 items-center justify-between font-medium transition-all sm:text-lg",{"[&[data-state=open]>svg]:rotate-180":r==="chevron","[&[data-state=open]>svg]:rotate-45":r==="plus"},e),...o,children:[t,Vt(s,{className:"h-5 w-5 flex-none transition-transform duration-300"})]})})});Ki.displayName=ae.Trigger.displayName;var ji=Bt.forwardRef(({className:e,children:t,...r},o)=>Vt(ae.Content,{ref:o,className:n("data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm text-gray-500 transition-all sm:text-base",e),...r,children:t}));ji.displayName=ae.Content.displayName;import{cva as Zi}from"class-variance-authority";import*as Wt from"react";import{jsx as Nr}from"react/jsx-runtime";var qi=Zi("relative w-full rounded-lg border px-4 py-6 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive border-red-500 dark:border-red-500"}},defaultVariants:{variant:"default"}}),Qi=Wt.forwardRef(({className:e,variant:t,...r},o)=>Nr("div",{ref:o,role:"alert",className:n(qi({variant:t}),e),...r}));Qi.displayName="Alert";var Xi=Wt.forwardRef(({className:e,...t},r)=>Nr("h5",{ref:r,className:n("text-md mb-2 font-medium leading-none tracking-tight",e),...t}));Xi.displayName="AlertTitle";var Ji=Wt.forwardRef(({className:e,...t},r)=>Nr("div",{ref:r,className:n("text-sm [&_p]:leading-relaxed",e),...t}));Ji.displayName="AlertDescription";import{sha256 as en}from"js-sha256";import{useState as tn}from"react";import{jsx as kr}from"react/jsx-runtime";function rn(e){if(e!=null&&e.image)return e.image;if(!(e!=null&&e.id))return"https://api.dicebear.com/9.x/micah/svg";let t=`https://api.dicebear.com/9.x/micah/svg?seed=${encodeURIComponent(e.id)}`,r=`https://api.dicebear.com/9.x/micah/png/${encodeURIComponent(`seed=${encodeURIComponent(e.id)}`)}`;return e.email?`https://www.gravatar.com/avatar/${en(e.email)}?d=${encodeURIComponent(r)}`:t}function $p({user:e={},className:t}){if(!e)return kr("div",{className:n("h-10 w-10 animate-pulse rounded-full border border-gray-300 bg-gray-100",t)});let[r,o]=tn(rn(e));return kr("img",{alt:`Avatar for ${e.name||e.email}`,referrerPolicy:"no-referrer",src:r,className:n("h-10 w-10 rounded-full border border-gray-300",t),draggable:!1,onError:()=>{o(`https://api.dicebear.com/9.x/micah/svg?seed=${encodeURIComponent(e.id||"")}`)}})}function Kp({id:e,className:t}){return kr("img",{src:`https://api.dicebear.com/9.x/shapes/svg?seed=${e}`,alt:"avatar",className:n("h-10 w-10 rounded-full",t),draggable:!1})}import{cva as on}from"class-variance-authority";import{jsx as nn}from"react/jsx-runtime";var an=on("max-w-fit rounded-full border px-2 py-px text-xs font-medium whitespace-nowrap",{variants:{variant:{default:"border-gray-400 text-gray-500",violet:"border-violet-600 bg-violet-600 text-white",blue:"border-blue-500 bg-blue-500 text-white",sky:"border-sky-900 bg-sky-900 text-white",black:"border-black bg-black text-white",gray:"border-gray-200 bg-gray-100 text-gray-800",neutral:"border-gray-400 text-gray-500",blueGradient:"bg-gradient-to-r from-blue-100 via-blue-100/50 to-blue-100 border border-blue-200 text-blue-900",rainbow:"bg-gradient-to-r from-violet-600 to-pink-600 text-white border-transparent"}},defaultVariants:{variant:"neutral"}});function Ft({className:e,variant:t,...r}){return nn("span",{className:n(an({variant:t}),e),...r})}import{cva as mn}from"class-variance-authority";import{forwardRef as un}from"react";import*as ue from"@radix-ui/react-tooltip";import sn from"linkify-react";import{HelpCircle as ln}from"lucide-react";import cn from"next/link";import{useState as dn}from"react";import{jsx as $,jsxs as Qe}from"react/jsx-runtime";function sf({children:e}){return $(ue.Provider,{delayDuration:150,children:e})}function ee({children:e,content:t,contentClassName:r,side:o="top",disableHoverableContent:a,delayDuration:s=0,...c}){let[l,d]=dn(!1);return Qe(ue.Root,{open:l,onOpenChange:d,delayDuration:s,disableHoverableContent:a,children:[$(ue.Trigger,{asChild:!0,onClick:()=>{d(!0)},onBlur:()=>{d(!1)},children:e}),$(ue.Portal,{children:$(ue.Content,{sideOffset:8,side:o,className:"animate-slide-up-fade pointer-events-auto z-[99] items-center overflow-hidden rounded-xl border border-gray-200 bg-white shadow-sm",collisionPadding:0,...c,children:typeof t=="string"?$("span",{className:n("block max-w-xs text-pretty px-4 py-2 text-center text-sm text-gray-700",r),children:t}):typeof t=="function"?t({setOpen:d}):t})})]})}function lf({title:e,cta:t,href:r,target:o,onClick:a}){return Qe("div",{className:"flex max-w-xs flex-col items-center space-y-3 p-4 text-center",children:[$("p",{className:"text-sm text-gray-700",children:e}),t&&(r?$(cn,{href:r,...o?{target:o}:{},className:n(pe({variant:"primary"}),"flex h-9 w-full items-center justify-center whitespace-nowrap rounded-lg border px-4 text-sm"),children:t}):a?$(ie,{onClick:a,text:t,variant:"primary",className:"h-9"}):null)]})}function cf({title:e,cta:t,href:r}){return Qe("div",{className:"max-w-xs px-4 py-2 text-center text-sm text-gray-700",children:[e," ",$("a",{href:r,target:"_blank",rel:"noopener noreferrer",onClick:o=>o.stopPropagation(),className:"inline-flex text-gray-500 underline underline-offset-4 hover:text-gray-800",children:t})]})}function df({children:e}){return $("div",{className:"block max-w-md whitespace-pre-wrap px-4 py-2 text-center text-sm text-gray-700",children:$(sn,{as:"p",options:{target:"_blank",rel:"noopener noreferrer nofollow",className:"underline underline-offset-4 text-gray-400 hover:text-gray-700"},children:e})})}function mf(e){return $(ee,{...e,children:$(ln,{className:"h-4 w-4 text-gray-500"})})}function uf({value:e,unit:t="total clicks",prefix:r,children:o,lastClicked:a}){return(!e||e<1e3)&&!a?o:$(ee,{content:Qe("div",{className:"block max-w-xs px-4 py-2 text-center text-sm text-gray-700",children:[Qe("p",{className:"text-sm font-semibold text-gray-700",children:[r,Rt(e||0,{full:!0})," ",t]}),a&&Qe("p",{className:"mt-1 text-xs text-gray-500",suppressHydrationWarning:!0,children:["Last clicked ",vo(a,{withAgo:!0})]})]}),children:o})}function pf({children:e,content:t,...r}){return $(ee,{content:t,...r,children:$("div",{className:"flex cursor-pointer items-center",children:$(Ft,{variant:"gray",className:"border-gray-300 transition-all hover:bg-gray-200",children:e})})})}function ff({children:e,tooltipProps:t,...r}){return $(ee,{...t,children:$("button",{type:"button",...r,className:n("flex h-6 w-6 items-center justify-center rounded-md text-gray-500 transition-colors duration-75 hover:bg-gray-100 active:bg-gray-200 disabled:cursor-not-allowed disabled:hover:bg-transparent",r.className),children:e})})}import{jsx as Xe,jsxs as sa}from"react/jsx-runtime";var pe=mn("transition-all",{variants:{variant:{primary:"border-black bg-black text-white hover:bg-gray-800 hover:ring-4 hover:ring-gray-200",secondary:n("border-gray-200 bg-white text-gray-900 hover:bg-gray-50 focus-visible:border-gray-500 outline-none","data-[state=open]:border-gray-500 data-[state=open]:ring-4 data-[state=open]:ring-gray-200"),outline:"border-transparent text-neutral-600 hover:bg-neutral-100",success:"border-blue-500 bg-blue-500 text-white hover:bg-blue-600 hover:ring-4 hover:ring-blue-100",danger:"border-red-500 bg-red-500 text-white hover:bg-red-600 hover:ring-4 hover:ring-red-100","danger-outline":"border-transparent bg-white text-red-500 hover:bg-red-600 hover:text-white"}},defaultVariants:{variant:"primary"}}),ie=un(({text:e,variant:t="primary",className:r,textWrapperClassName:o,loading:a,icon:s,shortcut:c,disabledTooltip:l,right:d,...m},i)=>l?Xe(ee,{content:l,children:sa("div",{className:n("flex h-10 w-full cursor-not-allowed items-center justify-center gap-x-2 rounded-md border border-gray-200 bg-gray-100 px-4 text-sm text-gray-400 transition-all focus:outline-none",{"border-transparent bg-transparent":t==null?void 0:t.endsWith("outline")},r),children:[s,e&&Xe("div",{className:n("min-w-0 truncate",c&&"flex-1 text-left",o),children:e}),c&&Xe("kbd",{className:n("hidden rounded border border-gray-200 bg-gray-100 px-2 py-0.5 text-xs font-light text-gray-400 md:inline-block",{"bg-gray-100":t==null?void 0:t.endsWith("outline")}),children:c})]})}):sa("button",{ref:i,type:m.onClick?"button":"submit",className:n("group flex h-10 w-full items-center justify-center gap-2 whitespace-nowrap rounded-md border px-4 text-sm",m.disabled||a?"cursor-not-allowed border-gray-200 bg-gray-100 text-gray-400 outline-none":pe({variant:t}),r),disabled:m.disabled||a,...m,children:[a?Xe(ye,{}):s||null,e&&Xe("div",{className:n("min-w-0 truncate",c&&"flex-1 text-left",o),children:e}),c&&Xe("kbd",{className:n("hidden rounded px-2 py-0.5 text-xs font-light transition-all duration-75 md:inline-block",{"bg-gray-700 text-gray-400 group-hover:bg-gray-600 group-hover:text-gray-300":t==="primary","bg-gray-200 text-gray-400 group-hover:bg-gray-100 group-hover:text-gray-500":t==="secondary","bg-gray-100 text-gray-500 group-hover:bg-gray-200":t==="outline","bg-red-100 text-red-600 group-hover:bg-red-500 group-hover:text-white":t==="danger-outline"}),children:c}),d]}));ie.displayName="Button";import{cva as pn}from"class-variance-authority";import{createContext as fn}from"react";import{jsx as la}from"react/jsx-runtime";var gn=pn("group/card-list w-full flex flex-col transition-[gap,opacity] min-w-0",{variants:{variant:{compact:"gap-0",loose:"gap-4"},loading:{true:"opacity-50"}}}),ut=fn({variant:"loose"});function ca({variant:e="loose",loading:t=!1,className:r,children:o}){return la("ul",{className:n(gn({variant:e,loading:t}),r),"data-variant":e,children:la(ut.Provider,{value:{variant:e},children:o})})}import{cva as hn}from"class-variance-authority";import{createContext as vn,useContext as bn,useEffect as xn,useRef as yn,useState as wn}from"react";import{jsx as Pr}from"react/jsx-runtime";var Cn=hn("w-full group/card border-gray-200 bg-white",{variants:{variant:{compact:"first-of-type:rounded-t-xl last-of-type:rounded-b-xl first-of-type:border-t border-b border-x data-[hover-state-enabled=true]:hover:bg-gray-50 transition-colors",loose:"border rounded-xl transition-[filter] data-[hover-state-enabled=true]:hover:drop-shadow-card-hover"}}}),Nn="w-full py-2.5 px-4",Sr=vn({hovered:!1});function da({outerClassName:e,innerClassName:t,children:r,onClick:o,hoverStateEnabled:a=!0}){let{variant:s}=bn(ut),c=yn(null),[l,d]=wn(!1);return xn(()=>{if(!l||!c.current)return;let m=setInterval(()=>{var i;((i=c.current)==null?void 0:i.matches(":hover"))===!1&&d(!1)},1e3);return()=>clearInterval(m)},[l]),Pr("li",{ref:c,className:n(Cn({variant:s}),e),onPointerEnter:()=>d(!0),onPointerLeave:()=>d(!1),"data-hover-state-enabled":a,children:Pr("div",{className:n(Nn,t),onClick:o?m=>{document.getElementById("modal-backdrop")||Et(m)||o()}:void 0,children:Pr(Sr.Provider,{value:{hovered:l},children:r})})})}var Hf=Object.assign(ca,{Card:Object.assign(da,{Context:Sr}),Context:ut});import kn from"embla-carousel-autoplay";import Pn from"embla-carousel-react";import{ArrowLeft as Sn,ArrowRight as Mn}from"lucide-react";import{createContext as Rn,forwardRef as ft,useCallback as pt,useContext as Ln,useEffect as Mr,useState as Rr}from"react";import{jsx as we,jsxs as pa}from"react/jsx-runtime";var Lr=2e3,ma=Rn(null);function fe(){let e=Ln(ma);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}function ua(){let{api:e}=fe(),[t,r]=Rr(0),o=pt(a=>r((a==null?void 0:a.selectedScrollSnap())??0),[]);return Mr(()=>{!e||(o(e),e.on("reInit",o),e.on("select",o))},[e,o]),t}var Tn=ft(({orientation:e="horizontal",opts:t,setApi:r,autoplay:o,plugins:a,className:s,children:c,...l},d)=>{let[m,i]=Pn({...t,axis:e==="horizontal"?"x":"y"},[...o?[kn(typeof o=="object"?o:{delay:Lr})]:[],...a||[]]),[p,f]=Rr(!1),[x,h]=Rr(!1),b=pt(M=>{!M||(f(M.canScrollPrev()),h(M.canScrollNext()))},[]),g=pt(()=>{i==null||i.scrollPrev()},[i]),N=pt(()=>{i==null||i.scrollNext()},[i]),S=pt(M=>{M.key==="ArrowLeft"?(M.preventDefault(),g()):M.key==="ArrowRight"&&(M.preventDefault(),N())},[g,N]);return Mr(()=>{!i||!r||r(i)},[i,r]),Mr(()=>{if(!!i)return b(i),i.on("reInit",b),i.on("select",b),()=>{i==null||i.off("select",b)}},[i,b]),we(ma.Provider,{value:{carouselRef:m,api:i,opts:t,orientation:e||((t==null?void 0:t.axis)==="y"?"vertical":"horizontal"),scrollPrev:g,scrollNext:N,canScrollPrev:p,canScrollNext:x},children:we("div",{ref:d,onKeyDownCapture:S,className:n("relative",s),role:"region","aria-roledescription":"carousel",...l,children:c})})});Tn.displayName="Carousel";var En=ft(({className:e,...t},r)=>{let{carouselRef:o,orientation:a}=fe();return we("div",{ref:o,className:"overflow-hidden",children:we("div",{ref:r,className:n("flex",a==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})});En.displayName="CarouselContent";var An=ft(({className:e,...t},r)=>{let{orientation:o}=fe();return we("div",{ref:r,role:"group","aria-roledescription":"slide",className:n("min-w-0 shrink-0 grow-0 basis-full",o==="horizontal"?"pl-4":"pt-4",e),...t})});An.displayName="CarouselItem";var Dn=ft(({className:e,...t},r)=>{let{orientation:o,scrollPrev:a,canScrollPrev:s}=fe();return pa("button",{ref:r,className:n("absolute",o==="horizontal"?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",pe({variant:"secondary",className:"p-2"}),e),disabled:!s,onClick:a,...t,children:[we(Sn,{className:"h-4 w-4"}),we("span",{className:"sr-only",children:"Previous slide"})]})});Dn.displayName="CarouselPrevious";var In=ft(({className:e,...t},r)=>{let{orientation:o,scrollNext:a,canScrollNext:s}=fe();return pa("button",{ref:r,className:n("absolute",o==="horizontal"?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",pe({variant:"secondary",className:"p-2"}),e),disabled:!s,onClick:a,...t,children:[we(Mn,{className:"h-4 w-4"}),we("span",{className:"sr-only",children:"Next slide"})]})});In.displayName="CarouselNext";import{cva as zn}from"class-variance-authority";import{motion as On}from"framer-motion";import{ChevronLeft as _n,ChevronRight as Hn}from"lucide-react";import*as Me from"react";import{jsx as Be,jsxs as gt}from"react/jsx-runtime";var Vn=zn("flex items-center justify-center gap-3 sm:gap-6",{variants:{variant:{simple:"relative",floating:"absolute bottom-4 left-1/2 -translate-x-1/2 rounded-full border border-gray-800/10 bg-white sm:bottom-6 "}}}),rg=({variant:e="simple",className:t})=>{var h;let{scrollNext:r,scrollPrev:o,canScrollNext:a,canScrollPrev:s,api:c}=fe(),l=(h=c==null?void 0:c.plugins())==null?void 0:h.autoplay,[d,m]=Me.useState(0),[i,p]=Me.useState(!1),f=Me.useCallback(b=>{m((b==null?void 0:b.selectedScrollSnap())??0)},[]),x=Me.useCallback(b=>()=>{l&&l.isPlaying()&&l.stop(),b()},[l]);return Me.useEffect(()=>{!c||(f(c),p((l==null?void 0:l.isPlaying())??!1),c.on("reInit",f),c.on("select",f),c.on("autoplay:play",()=>p(!0)),c.on("autoplay:stop",()=>p(!1)))},[c,l,f]),gt("div",{className:n(Vn({variant:e}),t),children:[e!=="simple"&>("button",{className:"cursor-pointer rounded-full p-2 hover:bg-gray-50 active:bg-gray-100",disabled:!s,onClick:x(o),children:[Be(_n,{className:"h-4 w-4"}),Be("span",{className:"sr-only",children:"Previous slide"})]}),c!=null&&Be("div",{className:"flex items-center gap-1",children:c.slideNodes().map((b,g)=>gt("button",{onClick:x(()=>c.scrollTo(g)),className:"rounded-full p-0.5 hover:bg-gray-100 active:bg-gray-200 sm:p-1.5",children:[Be("div",{className:n("relative isolate h-1.5 w-1.5 overflow-hidden rounded-full transition-all",g===d?"bg-black":"bg-black/20",i&&g===d&&"w-6 bg-black/20"),children:i&&g===d&&Be(On.div,{initial:{x:"-100%"},animate:{x:0},transition:{type:"tween",duration:((l==null?void 0:l.options.delay)??Lr)/1e3},className:"animate-fill-width h-full w-full rounded-full bg-black"})}),gt("span",{className:"sr-only",children:["Slide ",g+1]})]},g))}),e!=="simple"&>("button",{className:"cursor-pointer rounded-full p-2 hover:bg-gray-50 active:bg-gray-100",disabled:!a,onClick:x(r),children:[Be(Hn,{className:"h-4 w-4"}),Be("span",{className:"sr-only",children:"Next slide"})]})]})};import Bn from"embla-carousel-react";import{forwardRef as Wn,useCallback as Fn,useEffect as Un}from"react";import{jsx as Ut}from"react/jsx-runtime";var mg=({className:e,...t})=>{let{api:r}=fe(),[o,a]=Bn({dragFree:!0}),s=Fn(c=>{!c||!a||a==null||a.scrollTo(c.selectedScrollSnap())},[a]);return Un(()=>{if(!(!r||!a))return s(r),r.on("reInit",s),r.on("select",s),()=>{r==null||r.off("reInit",s),r==null||r.off("select",s)}},[r,a,s]),Ut("div",{className:"overflow-hidden",ref:o,children:Ut("div",{className:n("mx-4 flex gap-4",e),...t})})},ug=Wn(({index:e,className:t,...r},o)=>{let{api:a}=fe(),s=ua();return Ut("div",{ref:o,children:Ut("button",{type:"button",onClick:()=>{var l;if(!a)return;let c=(l=a.plugins())==null?void 0:l.autoplay;c&&c.isPlaying()&&c.stop(),a.scrollTo(e)},className:typeof t=="function"?t({active:e===s}):t,...r})})});import*as ht from"@radix-ui/react-checkbox";import{Check as Gn}from"lucide-react";import*as fa from"react";import{jsx as Tr}from"react/jsx-runtime";var $n=fa.forwardRef(({className:e,...t},r)=>Tr(ht.Root,{ref:r,className:n("peer h-5 w-5 shrink-0 rounded-md border border-gray-200 bg-white outline-none focus-visible:border-black disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-500",e),...t,children:Tr(ht.Indicator,{className:"flex items-center justify-center",children:Tr(Gn,{className:"h-3 w-3 text-white"})})}));$n.displayName=ht.Root.displayName;import{Command as Yt,CommandInput as Is,CommandItem as zs,useCommandState as Os}from"cmdk";import{ChevronDown as _s}from"lucide-react";import{forwardRef as Hs,isValidElement as Vs,useCallback as Bs,useEffect as jt,useRef as Ws,useState as vt}from"react";import{motion as Es}from"framer-motion";import{forwardRef as As,useRef as Ds}from"react";import Er from"js-cookie";import{useEffect as Kn,useState as jn}from"react";function xg(e,t,r){let[o,a]=jn(()=>{let c=Er.get(e);return c?JSON.parse(c):t});return Kn(()=>{let c=()=>{let l=Er.get(e);l&&a(JSON.parse(l))};return window.addEventListener("storage",c),()=>{window.removeEventListener("storage",c)}},[e]),[o,c=>{a(c),Er.set(e,JSON.stringify(c),r)}]}import{useCallback as Yn,useEffect as Zn,useRef as qn,useState as Qn}from"react";var Je=(e=3e3)=>{let t=qn(null),[r,o]=Qn(!1),a=()=>{t.current&&(clearTimeout(t.current),t.current=null)},s=Yn(async c=>{a();try{typeof c=="string"?await navigator.clipboard.writeText(c):c instanceof ClipboardItem&&await navigator.clipboard.write([c]),o(!0),Number.isFinite(e)&&e>=0&&(t.current=setTimeout(()=>o(!1),e))}catch(l){console.error("Failed to copy: ",l)}},[e]);return Zn(()=>()=>a(),[]),[r,s]};import{useEffect as Xn,useState as Jn}from"react";function kg(){let[e,t]=Jn(null);return Xn(()=>{let r=document.querySelector("[data-mdx-container]");if(!r)return;let o=r.offsetTop-1,a=new IntersectionObserver(l=>{var p,f,x;let d=l[0];if(!d)return;let m=(((p=d.rootBounds)==null?void 0:p.height)||0)*.3+o;for(let h=1;h<l.length;h++){let b=l[h];if(!b)break;(b.boundingClientRect.top<d.boundingClientRect.top||d.boundingClientRect.bottom<o)&&(d=b)}let i=d.target;for(;i&&i.getBoundingClientRect().bottom<o;)i=(f=s.get(i))==null?void 0:f.next;for(;i&&i.getBoundingClientRect().top>m;)i=(x=s.get(i))==null?void 0:x.prev;i&&t(i.getAttribute("href"))},{threshold:1,rootMargin:`-${o}px 0px 0px 0px`}),s=new Map;return(r==null?void 0:r.querySelectorAll("[data-mdx-heading]")).forEach(l=>a.observe(l)),()=>{a.disconnect()}},[]),e==null?void 0:e.replace("#","")}function Sg(e){return{handleKeyDown:r=>{r.key==="Enter"&&r.metaKey&&(r.preventDefault(),e.current&&e.current.requestSubmit())}}}import{useEffect as es,useState as ts}from"react";function Tg(e,t={}){let{root:r,defaultValue:o}=t,[a,s]=ts(o??!1);return es(()=>{let c=()=>{let d=e.current;if(!d)return;let m=r==null?void 0:r.current,i=d.getBoundingClientRect(),p=m?m.getBoundingClientRect():{top:0,left:0,bottom:window.innerHeight,right:window.innerWidth};s(i.top<p.bottom&&i.bottom>p.top&&i.left<p.right&&i.right>p.left)};((r==null?void 0:r.current)||window).addEventListener("scroll",c),window.addEventListener("resize",c);let l=null;return e.current&&(l=new IntersectionObserver(c),l.observe(e.current)),c(),()=>{((r==null?void 0:r.current)||window).removeEventListener("scroll",c),window.removeEventListener("resize",c),l==null||l.disconnect()}},[e,r]),a}import{useEffect as rs,useState as os}from"react";function Dg(){let[e,t]=os(!1);return rs(()=>{let r=()=>{let o=document.activeElement;t((o==null?void 0:o.tagName)!=null&&["INPUT","TEXTAREA"].includes(o.tagName))};return window.addEventListener("focusin",r),window.addEventListener("focusout",r),()=>{window.removeEventListener("focusin",r),window.removeEventListener("focusout",r)}},[]),e}import{useEffect as as,useState as is}from"react";function _g(e,{threshold:t=0,root:r=null,rootMargin:o="0%",freezeOnceVisible:a=!1}){let[s,c]=is(),l=(s==null?void 0:s.isIntersecting)&&a,d=([m])=>{c(m)};return as(()=>{let m=e==null?void 0:e.current;if(!!!window.IntersectionObserver||l||!m)return;let p={threshold:t,root:r,rootMargin:o},f=new IntersectionObserver(d,p);return f.observe(m),()=>f.disconnect()},[e,JSON.stringify(t),r,o,l]),s}import{createContext as ns,useCallback as ss,useContext as ls,useEffect as ga,useId as cs,useState as ds}from"react";import{jsx as ms}from"react/jsx-runtime";var ha=ns({listeners:[],setListeners:()=>{}});function Ug({children:e}){let[t,r]=ds([]);return ms(ha.Provider,{value:{listeners:t,setListeners:r},children:e})}function et(e,t,r={}){let o=cs(),{listeners:a,setListeners:s}=ls(ha),c=ss(l=>{let d=l.target,m=document.getElementById("modal-backdrop");if(l.metaKey||l.ctrlKey||d.tagName==="INPUT"||d.tagName==="TEXTAREA"||!!m!=!!r.modal||(Array.isArray(e)?!e.includes(l.key):l.key!==e))return;let i=a.filter(f=>f.enabled!==!1&&(Array.isArray(f.key)?f.key.includes(l.key):f.key===l.key));!i.length||ho(i,(f,x)=>(x.priority??0)-(f.priority??0)).slice(-1)[0].id!==o||(l.preventDefault(),t(l))},[e,a,o,t]);ga(()=>(document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)),[c]),ga(()=>(s(l=>[...l.filter(d=>d.id!==o),{id:o,key:e,...r}]),()=>s(l=>l.filter(d=>d.id!==o))),[JSON.stringify(e),r.enabled,r.priority])}import{useEffect as us,useState as ps}from"react";function va(e){if(typeof window>"u")return null;let t=window.localStorage.getItem(e);return t?JSON.parse(t):null}function Kg(e,t){let[r,o]=ps(va(e)??t);return us(()=>{let s=va(e);s&&o(s)},[e]),[r,s=>{o(s),window.localStorage.setItem(e,JSON.stringify(s))}]}import{toast as fs}from"sonner";import gs from"swr";function Qg(e,t){let{data:r,isLoading:o,mutate:a}=gs(e,me);return{data:r,isLoading:o,update:async(s,c)=>fs.promise(a(s(r),{optimisticData:c,rollbackOnError:!0,populateCache:!0,revalidate:!0}),{loading:(t==null?void 0:t.loading)||"Updating...",success:(t==null?void 0:t.success)||"Successfully updated",error:(t==null?void 0:t.error)||"Failed to update"})}}import{useEffect as wa,useMemo as ys}from"react";import{useEffect as ba,useState as hs}from"react";function xa({pageSize:e,page:t,onPageChange:r}){let[o,a]=hs({pageIndex:t,pageSize:e});return ba(()=>{a(s=>({...s,pageIndex:t}))},[t]),ba(()=>{r==null||r(o.pageIndex)},[o]),{pagination:o,setPagination:a}}import{usePathname as vs,useRouter as bs,useSearchParams as xs}from"next/navigation";function ya(){let e=vs(),t=bs(),r=xs(),o=Object.fromEntries(r);return{pathname:e,router:t,searchParams:r,searchParamsObj:o,queryParams:({set:c,del:l,replace:d,scroll:m=!0,getNewPath:i,arrayDelimiter:p=","})=>{let f=new URLSearchParams(r);c&&Object.entries(c).forEach(([b,g])=>f.set(b,Array.isArray(g)?g.join(p):g)),l&&(Array.isArray(l)?l.forEach(b=>f.delete(b)):f.delete(l));let x=f.toString(),h=`${e}${x.length>0?`?${x}`:""}`;if(i)return h;d?t.replace(h,{scroll:!1}):t.push(h,{scroll:m})},getQueryString:(c,l)=>{let d=new URLSearchParams(r);c&&Object.entries(c).forEach(([i,p])=>d.set(i,p)),l!=null&&l.ignore&&l.ignore.forEach(i=>d.delete(i));let m=d.toString();return m.length>0?`?${m}`:""}}}function l1(e=po){let{searchParams:t,queryParams:r}=ya(),o=ys(()=>parseInt(t.get("page")||"1")||1,[t.get("page")]),{pagination:a,setPagination:s}=xa({pageSize:e,page:o,onPageChange:c=>{r(c===1?{del:"page"}:{set:{page:c.toString()}})}});return wa(()=>{let c=parseInt(t.get("page")||"1")||1;s(l=>({...l,pageIndex:c}))},[t.get("page")]),wa(()=>{r(a.pageIndex===1?{del:"page"}:{set:{page:a.pageIndex.toString()}})},[a]),{pagination:a,setPagination:s}}import{useEffect as ws}from"react";function m1(){ws(()=>{let e=new URL(window.location.href);e.searchParams.has("_gl")&&setTimeout(()=>{e.searchParams.delete("_gl"),window.history.replaceState({},"",e.toString())},2e3)},[])}import{useEffect as Cs,useState as Ns}from"react";function Gt(e){let[t,r]=Ns(),o=([a])=>{r(a)};return Cs(()=>{let a=e==null?void 0:e.current;if(!a)return;let s=new ResizeObserver(o);return s.observe(a),()=>s.disconnect()},[e]),t}import{useCallback as ks,useEffect as Ca,useState as Ps}from"react";function Na(e){let[t,r]=Ps(!1),o=ks(()=>{r(window.scrollY>e)},[e]);return Ca(()=>(window.addEventListener("scroll",o),()=>window.removeEventListener("scroll",o)),[o]),Ca(()=>{o()},[o]),t}import{useCallback as Ss,useEffect as Ms,useState as Rs}from"react";function tt(e){let[t,r]=Rs(1),o=Ss(()=>{if(!e.current)return;let{scrollTop:s,scrollHeight:c,clientHeight:l}=e.current;r(c===l?1:Math.min(s/(c-l),1))},[]),a=Gt(e);return Ms(o,[a]),{scrollProgress:t,updateScrollProgress:o}}import{useEffect as Ls}from"react";import{toast as Pa}from"sonner";import{jsx as $t,jsxs as ka}from"react/jsx-runtime";function Ts({id:e,message:t,undo:r}){let o=()=>{r(),Pa.dismiss(e)},a=s=>{s.key==="z"&&(s.ctrlKey||s.metaKey)&&o()};return Ls(()=>(document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)),[]),ka("div",{className:"flex w-full items-center justify-between space-x-2",children:[ka("div",{className:"flex items-center space-x-2",children:[$t(Po,{}),$t("p",{className:"font-medium",children:t})]}),$t("button",{className:"whitespace-nowrap rounded border border-black bg-black px-2 py-1 text-xs font-normal text-white transition-all duration-75 active:scale-95",onClick:o,children:"Undo"})]})}function P1(){return({id:t,message:r,undo:o,duration:a})=>Pa($t(Ts,{id:t,message:r,undo:o}),{id:t,...a&&{duration:a}})}import{jsx as Sa}from"react/jsx-runtime";var Ce=As(({width:e=!1,height:t=!1,className:r,transition:o,children:a,...s},c)=>{var m,i;let l=Ds(null),d=Gt(l);return Sa(Es.div,{ref:c,className:n("overflow-hidden",r),animate:{width:e?((m=d==null?void 0:d.contentRect)==null?void 0:m.width)??"auto":"auto",height:t?((i=d==null?void 0:d.contentRect)==null?void 0:i.height)??"auto":"auto"},transition:o??{type:"spring",duration:.3},...s,children:Sa("div",{ref:l,className:n(t&&"h-max",e&&"w-max"),children:a})})});Ce.displayName="AnimatedSizeContainer";import*as Re from"@radix-ui/react-popover";import{Drawer as rt}from"vaul";import{jsx as Ne,jsxs as Kt}from"react/jsx-runtime";function ot({children:e,content:t,align:r="center",side:o="bottom",openPopover:a,setOpenPopover:s,mobileOnly:c,popoverContentClassName:l,collisionBoundary:d,sticky:m,onEscapeKeyDown:i,onWheel:p}){let{isMobile:f}=Y();return c||f?Kt(rt.Root,{open:a,onOpenChange:s,children:[Ne(rt.Trigger,{className:"sm:hidden",asChild:!0,children:e}),Kt(rt.Portal,{children:[Ne(rt.Overlay,{className:"fixed inset-0 z-50 bg-gray-100 bg-opacity-10 backdrop-blur"}),Kt(rt.Content,{className:"fixed bottom-0 left-0 right-0 z-50 mt-24 rounded-t-[10px] border-t border-gray-200 bg-white",onEscapeKeyDown:i,onPointerDownOutside:x=>{x.target instanceof Element&&x.target.closest("[data-sonner-toast]")&&x.preventDefault()},children:[Ne("div",{className:"sticky top-0 z-20 flex w-full items-center justify-center rounded-t-[10px] bg-inherit",children:Ne("div",{className:"my-3 h-1 w-12 rounded-full bg-gray-300"})}),Ne("div",{className:"flex min-h-[150px] w-full items-center justify-center overflow-hidden bg-white pb-8 align-middle shadow-xl",children:t})]}),Ne(rt.Overlay,{})]})]}):Kt(Re.Root,{open:a,onOpenChange:s,children:[Ne(Re.Trigger,{className:"sm:inline-flex",asChild:!0,children:e}),Ne(Re.Portal,{children:Ne(Re.Content,{sideOffset:8,align:r,side:o,className:n("animate-slide-up-fade z-50 items-center rounded-lg border border-gray-200 bg-white drop-shadow-lg sm:block",l),sticky:m,collisionBoundary:d,onEscapeKeyDown:i,onWheel:p,children:t})})]})}import{Fragment as Ar,jsx as A,jsxs as Le}from"react/jsx-runtime";function Fs(e,t){return e===!0}function J1({multiple:e,selected:t,setSelected:r,options:o,icon:a,placeholder:s="Select...",searchPlaceholder:c="Search...",emptyState:l,createLabel:d,onCreate:m,buttonProps:i,shortcutHint:p,caret:f,side:x,open:h,onOpenChange:b,onSearchChange:g,shouldFilter:N=!0,inputClassName:S,optionRight:M,optionClassName:P,matchTriggerWidth:w,children:y}){let R=Fs(e,r),z=Array.isArray(t)?t:t?[t]:[],{isMobile:D}=Y(),[q,C]=vt(!1),O=h??q,ce=b??C,[T,de]=vt(""),[J,xr]=vt(!1),[yr,Wi]=vt(void 0),[Fi,co]=vt(!1),Ui=_=>{var Ze;if(R){let wr=z.some(({value:dt})=>dt===_.value);r(wr?z.filter(({value:dt})=>dt!==_.value):[...z,_])}else r(z.length&&((Ze=z[0])==null?void 0:Ze.value)===_.value?null:_),ce(!1)},mo=Bs((_,Ze)=>Ze===""?[...z,..._.filter(wr=>z.findIndex(dt=>dt.value===wr.value)===-1)]:_,[z]);return jt(()=>{J&&(Wi(o&&mo(o,T)),xr(!1))},[J,o,mo,T]),jt(()=>{xr(!0)},[o]),jt(()=>{O||(de(""),xr(!0))},[O]),jt(()=>g==null?void 0:g(T),[T]),A(ot,{openPopover:O,setOpenPopover:ce,align:"start",side:x,onWheel:_=>{_.stopPropagation()},popoverContentClassName:n(w&&"sm:w-[var(--radix-popover-trigger-width)]"),content:A(Ce,{width:!D&&!w,height:!0,style:{transform:"translateZ(0)"},transition:{ease:"easeInOut",duration:.1},className:"pointer-events-auto",children:Le(Yt,{loop:!0,shouldFilter:N,children:[Le("div",{className:"flex items-center overflow-hidden rounded-t-lg border-b border-gray-200",children:[A(Is,{placeholder:c,value:T,onValueChange:de,className:n("grow border-0 py-3 pl-4 pr-2 outline-none placeholder:text-gray-400 focus:ring-0 sm:text-sm",S),onKeyDown:_=>{(_.key==="Escape"||_.key==="Backspace"&&!T)&&(_.preventDefault(),_.stopPropagation(),ce(!1))}}),p&&A("kbd",{className:"mr-2 hidden shrink-0 rounded border border-gray-200 bg-gray-100 px-2 py-0.5 text-xs font-light text-gray-500 md:block",children:p})]}),A(Us,{children:A(Yt.List,{className:n("flex w-full min-w-[100px] flex-col gap-1 p-1"),children:yr!==void 0?Le(Ar,{children:[yr.map(_=>A(Gs,{option:_,multiple:R,selected:z.some(({value:Ze})=>Ze===_.value),onSelect:()=>Ui(_),right:M==null?void 0:M(_),className:P},`${_.label}, ${_.value}`)),T.length>0&&m&&Le(zs,{className:n("flex cursor-pointer items-center gap-3 whitespace-nowrap rounded-md px-3 py-2 text-left text-sm text-gray-700","data-[selected=true]:bg-gray-100",P),onSelect:async()=>{co(!0),await(m==null?void 0:m(T))&&(de(""),ce(!1)),co(!1)},children:[Fi?A(ye,{className:"size-4 shrink-0"}):A(Ht,{className:"size-4 shrink-0"}),A("div",{className:"grow truncate",children:(d==null?void 0:d(T))||`Create "${T}"`})]}),N?A($s,{className:"flex min-h-12 items-center justify-center text-sm text-gray-500",children:l||"No matches"}):yr.length===0?A("div",{className:"flex min-h-12 items-center justify-center text-sm text-gray-500",children:l||"No matches"}):null]}):A(Yt.Loading,{children:A("div",{className:"flex h-12 items-center justify-center",children:A(ye,{})})})})})]})}),children:A(ie,{variant:"secondary",...i,className:n(i==null?void 0:i.className,"flex gap-2"),textWrapperClassName:n(i==null?void 0:i.textWrapperClassName,"w-full flex items-center justify-start"),text:Le(Ar,{children:[A("div",{className:"min-w-0 grow truncate text-left",children:y||z.map(_=>_.label).join(", ")||s}),f&&A(_s,{className:"ml-1 size-4 shrink-0 text-gray-400 transition-transform duration-75 group-data-[state=open]:rotate-180"})]}),icon:a?Ma(a)?a:A(a,{className:"size-4 shrink-0"}):void 0})})}var Us=({children:e})=>{let t=Ws(null),{scrollProgress:r,updateScrollProgress:o}=tt(t);return Le(Ar,{children:[A("div",{className:"scrollbar-hide max-h-[min(50vh,250px)] w-screen overflow-y-scroll sm:w-auto",ref:t,onScroll:o,children:e}),A("div",{className:"pointer-events-none absolute bottom-0 left-0 hidden h-16 w-full rounded-b-lg bg-gradient-to-t from-white sm:block",style:{opacity:1-Math.pow(r,2)}})]})};function Gs({option:e,onSelect:t,multiple:r,selected:o,right:a,className:s}){return Le(Yt.Item,{className:n("flex cursor-pointer items-center gap-3 whitespace-nowrap rounded-md px-3 py-2 text-left text-sm","data-[selected=true]:bg-gray-100",s),onSelect:t,value:e.label+(e==null?void 0:e.value),children:[r&&A("div",{className:"shrink-0 text-gray-600",children:o?A(Ho,{className:"size-4 text-gray-600"}):A(Vo,{className:"size-4 text-gray-400"})}),Le("div",{className:"flex min-w-0 grow items-center gap-1",children:[e.icon&&A("span",{className:"shrink-0 text-gray-600",children:Ma(e.icon)?e.icon:A(e.icon,{className:"h-4 w-4"})}),A("span",{className:"grow truncate",children:e.label})]}),a,!r&&o&&A(_o,{className:"size-4 shrink-0 text-gray-600"})]})}var Ma=e=>Vs(e),$s=Hs((e,t)=>Os(o=>o.filtered.count===0)?A("div",{ref:t,"cmdk-empty":"",role:"presentation",...e}):null);import{addYears as Zt,format as Ks,isSameMonth as js}from"date-fns";import{ChevronLeft as Ra,ChevronRight as La,ChevronsLeft as Ys,ChevronsRight as Zs}from"lucide-react";import{forwardRef as qs,useRef as Qs}from"react";import{DayPicker as Xs,useDayPicker as Js,useDayRender as el,useNavigation as tl}from"react-day-picker";import{Fragment as rl,jsx as te,jsxs as qt}from"react/jsx-runtime";var bt=qs(({onClick:e,icon:t,disabled:r,...o},a)=>te("button",{ref:a,type:"button",disabled:r,className:n("flex h-7 w-7 shrink-0 select-none items-center justify-center rounded border p-1 outline-none transition","border-gray-200 text-gray-600 hover:text-gray-800","hover:bg-gray-50 active:bg-gray-100","disabled:pointer-events-none disabled:text-gray-400"),onClick:e,...o,children:te(t,{className:"h-full w-full shrink-0"})}));bt.displayName="NavigationButton";function Ta({mode:e="single",weekStartsOn:t=1,numberOfMonths:r=1,showYearNavigation:o=!1,disableNavigation:a,locale:s,className:c,classNames:l,...d}){return te(Xs,{mode:e,weekStartsOn:t,numberOfMonths:r,locale:s,showOutsideDays:r===1,className:c,classNames:{months:"flex space-y-0",month:"space-y-4 p-3 w-full",nav:"gap-1 flex items-center rounded-full w-full h-full justify-between p-4",table:"w-full border-separate border-spacing-y-1",head_cell:"w-9 font-medium text-xs text-center text-gray-400 pb-2",row:"w-full",cell:"relative p-0 text-center focus-within:relative text-gray-900",day:n("relative h-10 w-full sm:h-9 sm:w-9 rounded-md text-sm text-gray-900","hover:bg-gray-100 active:bg-gray-200 outline outline-offset-2 outline-0 focus-visible:outline-2 outline-blue-500"),day_today:"font-semibold",day_selected:"rounded aria-selected:bg-blue-500 aria-selected:text-white",day_disabled:"!text-gray-300 line-through disabled:hover:bg-transparent",day_outside:"text-gray-400",day_range_middle:"!rounded-none aria-selected:!bg-blue-100 aria-selected:!text-blue-900",day_range_start:"rounded-r-none !rounded-l",day_range_end:"rounded-l-none !rounded-r",day_hidden:"invisible",...l},components:{IconLeft:()=>te(Ra,{className:"h-4 w-4"}),IconRight:()=>te(La,{className:"h-4 w-4"}),Caption:({...m})=>{let{goToMonth:i,nextMonth:p,previousMonth:f,currentMonth:x,displayMonths:h}=tl(),{numberOfMonths:b,fromDate:g,toDate:N}=Js(),S=h.findIndex(D=>js(m.displayMonth,D)),M=S===0,P=S===h.length-1,w=b>1&&(M||!P),y=b>1&&(P||!M),R=()=>{let D=Zt(x,-1);f&&(!g||D.getTime()>=g.getTime())&&i(D)},z=()=>{let D=Zt(x,1);p&&(!N||D.getTime()<=N.getTime())&&i(D)};return qt("div",{className:"flex items-center justify-between",children:[qt("div",{className:"flex items-center gap-1",children:[o&&!y&&te(bt,{disabled:a||!f||g&&Zt(x,-1).getTime()<g.getTime(),"aria-label":"Go to previous year",onClick:R,icon:Ys}),!y&&te(bt,{disabled:a||!f,"aria-label":"Go to previous month",onClick:()=>f&&i(f),icon:Ra})]}),te("div",{role:"presentation","aria-live":"polite",className:"text-sm font-medium capitalize tabular-nums text-gray-900",children:Ks(m.displayMonth,"LLLL yyy",{locale:s})}),qt("div",{className:"flex items-center gap-1",children:[!w&&te(bt,{disabled:a||!p,"aria-label":"Go to next month",onClick:()=>p&&i(p),icon:La}),o&&!w&&te(bt,{disabled:a||!p||N&&Zt(x,1).getTime()>N.getTime(),"aria-label":"Go to next year",onClick:z,icon:Zs})]})]})},Day:({date:m,displayMonth:i})=>{let p=Qs(null),{activeModifiers:f,buttonProps:x,divProps:h,isButton:b,isHidden:g}=el(m,i,p),{selected:N,today:S,disabled:M,range_middle:P}=f;if(g)return te(rl,{});if(!b)return te("div",{...h,className:n("flex items-center justify-center",h.className)});let{children:w,...y}=x;return qt("button",{ref:p,...y,type:"button",children:[w,S&&te("span",{className:n("absolute inset-x-1/2 bottom-1.5 h-0.5 w-4 -translate-x-1/2 rounded-[2px]",{"bg-blue-500":!N,"!bg-white":N,"!bg-blue-400":N&&P,"text-gray-400":M})})]})}},...d})}import{enUS as pl}from"date-fns/locale";import{useEffect as Hr,useMemo as Aa,useState as Xt}from"react";import{Command as Dr}from"cmdk";import{Lock as ol}from"lucide-react";import{jsx as We,jsxs as al}from"react/jsx-runtime";var Ir=({presets:e,onSelect:t,currentValue:r})=>{let o=d=>"dateRange"in d,a=d=>"date"in d,s=(d,m)=>d.getDate()===m.getDate()&&d.getMonth()===m.getMonth()&&d.getFullYear()===m.getFullYear(),c=(d,m)=>{let i=d.from,p=m.from,f=!1;i&&p&&s(i,p)&&(f=!0);let x=d.to,h=m.to,b=!1;return x&&h&&s(x,h)&&(b=!0),f&&b},l=d=>{if(o(d)){let m=r;return m&&c(m,d.dateRange)}else if(a(d)){let m=r;return m&&s(m,d.date)}return!1};return We(Dr,{className:"w-full rounded ring-gray-200 ring-offset-2 focus:outline-none",tabIndex:0,autoFocus:!0,loop:!0,children:We(Dr.List,{className:"[&>*]:flex [&>*]:w-full [&>*]:items-start [&>*]:gap-x-2 [&>*]:gap-y-0.5 [&>*]:sm:flex-col",children:e.map((d,m)=>al(Dr.Item,{disabled:d.requiresUpgrade,onSelect:()=>t(d),title:d.label,value:d.id,className:n("group relative flex cursor-pointer items-center justify-between overflow-hidden text-ellipsis whitespace-nowrap rounded border border-gray-200","px-2.5 py-1.5 text-left text-sm text-gray-700 shadow-sm outline-none sm:w-full sm:border-none sm:py-2 sm:shadow-none","disabled:pointer-events-none disabled:opacity-50","sm:data-[selected=true]:bg-gray-100",l(d)&&"font-semibold text-gray-800"),children:[We("span",{children:d.label}),d.requiresUpgrade?We(ol,{className:"h-3.5 w-3.5","aria-hidden":"true"}):d.shortcut?We("kbd",{className:"text-gray-4000 hidden rounded bg-gray-100 px-2 py-0.5 text-xs font-light group-data-[selected=true]:bg-gray-200 md:block",children:d.shortcut.toUpperCase()}):null,d.requiresUpgrade&&d.tooltipContent&&We(ee,{side:"bottom",content:d.tooltipContent,children:We("div",{className:"absolute inset-0 cursor-not-allowed"})})]},m))})})};Ir.displayName="DatePicker.Presets";import{format as Te}from"date-fns";import{createContext as il}from"react";var zr=il({isOpen:!1,setIsOpen:()=>{}}),nl=()=>{let e=typeof window<"u"?window.navigator.language:"en-US",t=new Intl.DateTimeFormat(e,{hour:"numeric"}).format();return Number.isInteger(Number(t))},Or=(e,t,r=!1)=>{let o=!nl(),a;return r?a=o?Te(e,"d MMM, yyyy h:mm a",{locale:t}):Te(e,"d MMM, yyyy HH:mm",{locale:t}):a=Te(e,"d MMM, yyyy",{locale:t}),a},Ea=(e,t)=>{let{toYear:r,fromYear:o,fromMonth:a,toMonth:s,fromDay:c,toDay:l}=t;if(e&&e.length>0){let d=o,m=r;e.forEach(i=>{var p,f,x,h,b,g;if("date"in i){let N=i.date.getFullYear();if(o&&N<o)throw new Error(`Preset ${i.label} is before fromYear ${d}.`);if(r&&N>r)throw new Error(`Preset ${i.label} is after toYear ${m}.`);if(a&&i.date.getMonth()<a.getMonth())throw new Error(`Preset ${i.label} is before fromMonth ${a}.`);if(s&&i.date.getMonth()>s.getMonth())throw new Error(`Preset ${i.label} is after toMonth ${s}.`);if(c&&i.date.getDate()<c.getDate())throw new Error(`Preset ${i.label} is before fromDay ${c}.`);if(l&&i.date.getDate()>l.getDate())throw new Error(`Preset ${i.label} is after toDay ${Te(l,"MMM dd, yyyy")}.`)}if("dateRange"in i){let N=(p=i.dateRange.from)==null?void 0:p.getFullYear(),S=(f=i.dateRange.to)==null?void 0:f.getFullYear();if(N&&o&&N<o)throw new Error(`Preset ${i.label}'s 'from' is before fromYear ${d}.`);if(S&&r&&S>r)throw new Error(`Preset ${i.label}'s 'to' is after toYear ${m}.`);if(a){let M=(x=i.dateRange.from)==null?void 0:x.getMonth();if(M&&M<a.getMonth())throw new Error(`Preset ${i.label}'s 'from' is before fromMonth ${Te(a,"MMM, yyyy")}.`)}if(s){let M=(h=i.dateRange.to)==null?void 0:h.getMonth();if(M&&M>s.getMonth())throw new Error(`Preset ${i.label}'s 'to' is after toMonth ${Te(s,"MMM, yyyy")}.`)}if(c){let M=(b=i.dateRange.from)==null?void 0:b.getDate();if(M&&M<c.getDate())throw new Error(`Preset ${i.dateRange.from}'s 'from' is before fromDay ${Te(c,"MMM dd, yyyy")}.`)}if(l){let M=(g=i.dateRange.to)==null?void 0:g.getDate();if(M&&M>l.getDate())throw new Error(`Preset ${i.label}'s 'to' is after toDay ${Te(l,"MMM dd, yyyy")}.`)}}})}};import{cva as sl}from"class-variance-authority";import{Calendar as ll,ChevronDown as cl}from"lucide-react";import{forwardRef as dl}from"react";import{jsx as Qt,jsxs as ul}from"react/jsx-runtime";var ml=sl(["group peer flex cursor-pointer appearance-none items-center gap-x-2 truncate rounded-md border px-3 h-10 outline-none transition-all text-sm","bg-white border-gray-200 text-gray-900 placeholder-gray-400 transition-all","disabled:pointer-events-none disabled:bg-gray-100 disabled:text-gray-400","focus-visible:border-gray-500 data-[state=open]:border-gray-500 data-[state=open]:ring-4 data-[state=open]:ring-gray-200"],{variants:{hasError:{true:"ring-2 ring-red-200 border-red-500"}}}),_r=dl(({className:e,children:t,placeholder:r,hasError:o,...a},s)=>ul("button",{ref:s,className:n(ml({hasError:o}),e),...a,children:[Qt(ll,{className:n("h-4 w-4 shrink-0 text-gray-400",!!t&&"text-gray-900")}),Qt("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-gray-900",children:t||(r?Qt("span",{className:"text-gray-400",children:r}):null)}),Qt(cl,{className:"h-4 w-4 flex-shrink-0 text-gray-400 transition-transform duration-75 group-data-[state=open]:rotate-180"})]}));_r.displayName="DatePicker.Trigger";import{jsx as ge,jsxs as gl}from"react/jsx-runtime";var fl=({value:e,defaultValue:t,presetId:r,onChange:o,presets:a,disabled:s,disableNavigation:c,disabledDays:l,showYearNavigation:d=!1,locale:m=pl,placeholder:i="Select date range",hasError:p,align:f="center",className:x,...h})=>{let{isDesktop:b}=Y(),[g,N]=Xt(!1),[S,M]=Xt(a&&r?a==null?void 0:a.find(({id:T})=>T===r):void 0),[P,w]=Xt((S==null?void 0:S.dateRange)??e??t??void 0),[y,R]=Xt(P==null?void 0:P.to),z=Aa(()=>P,[g]);Hr(()=>{w(e)},[e]),Hr(()=>{let T=a==null?void 0:a.find(({id:de})=>de===r);M(T),w((T==null?void 0:T.dateRange)??e??t)},[a,r]),Hr(()=>{g?P&&R(P.to):R(P==null?void 0:P.to)},[g]);let D=(T,de)=>{let J=(P==null?void 0:P.from)&&(P==null?void 0:P.to)?{from:de}:T;w(J),M(void 0),(J==null?void 0:J.from)&&(J==null?void 0:J.to)&&(o==null||o(J),N(!1))},q=T=>{w(T.dateRange),M(T),o==null||o(T.dateRange,T),N(!1)},C=()=>{w(z),N(!1)},O=T=>{T||C(),N(T)},ce=Aa(()=>P?`${P.from?Or(P.from,m):""} - ${P.to?Or(P.to,m):""}`:null,[P,m]);return et((a==null?void 0:a.filter(T=>T.shortcut).map(T=>T.shortcut))??[],T=>{let de=a==null?void 0:a.find(J=>J.shortcut===T.key);de&&q(de)}),ge(zr.Provider,{value:{isOpen:g,setIsOpen:N},children:ge(ot,{align:f,openPopover:g,setOpenPopover:O,popoverContentClassName:"rounded-xl",content:ge("div",{className:"flex w-full",children:gl("div",{className:"scrollbar-hide flex w-full flex-col overflow-x-scroll sm:flex-row-reverse sm:items-start",children:[a&&a.length>0&&ge("div",{className:n("relative flex h-16 w-full items-center sm:h-full sm:w-48","border-b border-gray-200 sm:border-b-0 sm:border-l","scrollbar-hide overflow-auto"),children:ge("div",{className:"absolute px-3 sm:inset-0 sm:left-0 sm:p-3",children:ge(Ir,{currentValue:P,presets:a,onSelect:q})})}),ge("div",{className:"scrollbar-hide overflow-x-scroll",children:ge(Ta,{mode:"range",selected:P,onSelect:D,month:y,onMonthChange:R,numberOfMonths:b?2:1,disabled:l,disableNavigation:c,showYearNavigation:d,locale:m,className:"scrollbar-hide overflow-x-scroll",classNames:{months:"flex flex-row divide-x divide-gray-200 overflow-x-scroll scrollbar-hide"},...h})})]})}),children:ge(_r,{placeholder:i,disabled:s,className:x,hasError:p,"aria-required":h.required||h["aria-required"],"aria-invalid":h["aria-invalid"],"aria-label":h["aria-label"],"aria-labelledby":h["aria-labelledby"],children:(S==null?void 0:S.label)??ce})})})};function Oh({presets:e,...t}){return e&&Ea(e,t),ge(fl,{presets:e,...t})}import{jsx as Jt,jsxs as Da}from"react/jsx-runtime";function Fh({icon:e,title:t,description:r,learnMore:o,children:a}){return Da("div",{className:"flex flex-col items-center justify-center gap-y-4",children:[Jt("div",{className:"flex size-16 items-center justify-center rounded-2xl border border-gray-200 bg-gray-50",children:Jt(e,{className:"size-6 text-gray-800"})}),Jt("p",{className:"text-center text-base font-medium text-gray-950",children:t}),r&&Da("p",{className:"max-w-sm text-balance text-center text-sm text-gray-500",children:[r," ",o&&Jt("a",{href:o,target:"_blank",className:"underline underline-offset-2 hover:text-gray-800",children:"Learn more \u2197"})]}),a]})}import{cva as hl}from"class-variance-authority";import{useState as Ia}from"react";import{toast as za}from"sonner";import{Fragment as bl,jsx as he,jsxs as Br}from"react/jsx-runtime";var Vr={any:{types:[]},images:{types:["image/png","image/jpeg"],errorMessage:"File type not supported (.png or .jpg only)"},csv:{types:["text/csv"],errorMessage:"File type not supported (.csv only)"}},vl=hl("group relative isolate flex aspect-[1200/630] w-full flex-col items-center justify-center overflow-hidden bg-white transition-all hover:bg-gray-50",{variants:{variant:{default:"rounded-md border border-gray-300 shadow-sm",plain:""}},defaultVariants:{variant:"default"}});function Xh({readFile:e,onChange:t,variant:r,className:o,iconClassName:a,previewClassName:s,customPreview:c,accept:l="any",imageSrc:d,loading:m=!1,clickToUpload:i=!0,showHoverOverlay:p=!0,content:f,maxFileSizeMB:x=0,targetResolution:h,accessibilityLabel:b="File upload",disabled:g=!1}){let[N,S]=Ia(!1),[M,P]=Ia(null),w=async y=>{let R="dataTransfer"in y?y.dataTransfer.files&&y.dataTransfer.files[0]:y.target.files&&y.target.files[0];if(!R)return;if(P(R.name),x>0&&R.size/1024/1024>x){za.error(`File size too big (max ${x} MB)`);return}let z=Vr[l].types;if(z.length&&!z.includes(R.type)){za.error(Vr[l].errorMessage??"File type not supported");return}let D=R;if(h&&R.type.startsWith("image/"))try{let q=await go(R,h),C=await fetch(q).then(O=>O.blob());D=new File([C],R.name,{type:R.type})}catch(q){console.error("Error resizing image:",q)}if(e){let q=new FileReader;q.onload=C=>{var O;return t==null?void 0:t({src:(O=C.target)==null?void 0:O.result,file:D})},q.readAsDataURL(D);return}t==null||t({file:D})};return Br("label",{className:n(vl({variant:r}),g?"cursor-not-allowed":n(i&&"cursor-pointer"),o),children:[m&&he("div",{className:"absolute inset-0 z-[5] flex items-center justify-center rounded-[inherit] bg-white",children:he(mt,{})}),he("div",{className:"absolute inset-0 z-[5]",onDragOver:y=>{y.preventDefault(),y.stopPropagation(),S(!0)},onDragEnter:y=>{y.preventDefault(),y.stopPropagation(),S(!0)},onDragLeave:y=>{y.preventDefault(),y.stopPropagation(),S(!1)},onDrop:async y=>{y.preventDefault(),y.stopPropagation(),w(y),S(!1)}}),Br("div",{className:n("absolute inset-0 z-[3] flex flex-col items-center justify-center rounded-[inherit] border-2 border-transparent bg-white transition-all",g&&"bg-gray-50",N&&!g&&"cursor-copy border-black bg-gray-50 opacity-100",d?n("opacity-0",p&&!g&&"group-hover:opacity-100"):n(!g&&"group-hover:bg-gray-50")),children:[he(Go,{className:n("size-7 transition-all duration-75",g?"text-gray-400":n("text-gray-500 group-hover:scale-110 group-active:scale-95",N?"scale-110":"scale-100"),a)}),f!==null&&he("div",{className:n("mt-2 text-center text-sm text-gray-500",g&&"text-gray-400"),children:f??he(bl,{children:Br("p",{children:["Drag and drop ",i&&"or click"," to upload."]})})}),he("span",{className:"sr-only",children:b})]}),d&&(c??he("img",{src:d,alt:"Preview",className:n("h-full w-full rounded-[inherit] object-cover",s)})),i&&he("div",{className:"sr-only mt-1 flex shadow-sm",children:he("input",{type:"file",accept:Vr[l].types.join(","),onChange:w,disabled:g},M)})]})}import{AnimatePresence as xl,motion as Oa}from"framer-motion";import{X as yl}from"lucide-react";import{isValidElement as wl}from"react";import{Fragment as Cl,jsx as X,jsxs as xt}from"react/jsx-runtime";function Ha({filters:e,activeFilters:t,onRemove:r,onRemoveAll:o,className:a}){return et("Escape",o,{priority:1}),X(Ce,{height:!0,className:"w-full",transition:{type:"tween",duration:.3},children:xt("div",{className:n("flex w-full flex-wrap items-start gap-4 sm:flex-nowrap",a),children:[X("div",{className:"flex grow flex-wrap gap-x-4 gap-y-2",children:X(xl,{children:t==null?void 0:t.map(({key:s,value:c})=>{if(s==="loader")return X(Oa.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},className:"h-9 w-48 animate-pulse rounded-md border border-gray-200 bg-white"},`loader-${c}`);let l=e.find(d=>d.key===s);return l?(l.multiple&&Array.isArray(c)?c:[c]).map(d=>{var f,x,h;let m=(f=l.options)==null?void 0:f.find(b=>typeof b.value=="string"&&typeof d=="string"?b.value.toLowerCase()===d.toLowerCase():b.value===d),i=(m==null?void 0:m.icon)??((x=l.getOptionIcon)==null?void 0:x.call(l,d,{key:l.key,option:m}))??l.icon,p=(m==null?void 0:m.label)??((h=l.getOptionLabel)==null?void 0:h.call(l,d,{key:l.key,option:m}))??d;return xt(Oa.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},className:"flex items-center divide-x rounded-md border border-gray-200 bg-white text-sm text-black",children:[xt("div",{className:"flex items-center gap-2.5 px-3 py-2",children:[X("span",{className:"shrink-0 text-gray-600",children:_a(l.icon)?l.icon:X(l.icon,{className:"h-4 w-4"})}),l.label]}),X("div",{className:"px-3 py-2 text-gray-500",children:"is"}),X("div",{className:"flex items-center gap-2.5 px-3 py-2",children:l.options?xt(Cl,{children:[X("span",{className:"shrink-0 text-gray-600",children:_a(i)?i:X(i,{className:"h-4 w-4"})}),Tt(p,30)]}):X("div",{className:"h-5 w-12 animate-pulse rounded-md bg-gray-200"})}),X("button",{type:"button",className:"h-full rounded-r-md p-2 text-gray-500 ring-inset ring-gray-500 hover:bg-gray-100 hover:text-gray-800 focus:outline-none focus-visible:ring-1",onClick:()=>r(s,d),children:X(yl,{className:"h-3.5 w-3.5"})})]},`${s}-${d}`)}):(console.error("Filter.List received an activeFilter without a corresponding filter"),null)})})}),(t==null?void 0:t.length)!==0&&xt("button",{type:"button",className:"group mt-px flex items-center gap-2 whitespace-nowrap rounded-lg border border-transparent px-3 py-2 text-sm text-gray-500 ring-inset ring-gray-500 transition-colors hover:border-gray-200 hover:bg-white hover:text-black focus:outline-none",onClick:o,children:["Clear Filters",X("kbd",{className:"rounded-md border border-gray-200 px-1.5 py-0.5 text-xs text-gray-950 group-hover:bg-gray-50",children:"ESC"})]})]})})}var _a=e=>wl(e);import{Command as Ee,useCommandState as Nl}from"cmdk";import{ChevronDown as kl,ListFilter as Pl}from"lucide-react";import{Fragment as Sl,forwardRef as Ml,isValidElement as Ba,useCallback as er,useEffect as tr,useImperativeHandle as Rl,useRef as Fr,useState as Wr}from"react";import{Fragment as Il,jsx as H,jsxs as ve}from"react/jsx-runtime";function Wa({filters:e,onSelect:t,onRemove:r,onOpenFilter:o,onSearchChange:a,onSelectedFilterChange:s,activeFilters:c,askAI:l,children:d,emptyState:m,className:i}){var D,q;let{isMobile:p}=Y(),f=Fr(null),x=Fr(),[h,b]=Wr(!1);et("f",()=>b(!0),{enabled:!h});let[g,N]=Wr(""),[S,M]=Wr(null),P=er(()=>{N(""),M(null)},[]);tr(()=>{h||P()},[h]);let w=S?e.find(({key:C})=>C===S):null,y=er(C=>{f.current&&(x.current={width:f.current.clientWidth,height:f.current.clientHeight}),N(""),M(C),o==null||o(C)},[]),R=er(C=>{if(!w||!c)return!1;let O=c.find(({key:ce})=>ce===S);return(O==null?void 0:O.value)===C||O&&w.multiple&&Array.isArray(O.value)&&O.value.includes(C)},[w]),z=er(C=>{w&&(R(C)?r(w.key,C):t(w.key,C),w.multiple||b(!1))},[c,w,l]);return tr(()=>{a==null||a(g)},[g]),tr(()=>{s==null||s(S)},[S]),tr(()=>{(w==null?void 0:w.options)&&f.current&&(x.current={width:f.current.clientWidth,height:f.current.clientHeight})},[w==null?void 0:w.options]),H(ot,{openPopover:h,setOpenPopover:b,onEscapeKeyDown:C=>{S&&(C.preventDefault(),P())},content:H(Ce,{width:!p,height:!0,className:"rounded-[inherit]",style:{transform:"translateZ(0)"},children:ve(Ee,{loop:!0,shouldFilter:!w||w.shouldFilter!==!1,children:[ve("div",{className:"flex items-center overflow-hidden rounded-t-lg border-b border-gray-200",children:[H(Tl,{placeholder:`${(w==null?void 0:w.label)||"Filter"}...`,value:g,onValueChange:N,onKeyDown:C=>{(C.key==="Escape"||C.key==="Backspace"&&!g)&&(C.preventDefault(),C.stopPropagation(),S?P():b(!1))},emptySubmit:C=>{C.preventDefault(),C.stopPropagation(),l?(t("ai",w?`${w.label} ${g}`:g),b(!1)):z(g)}}),!w&&H("kbd",{className:"mr-2 hidden shrink-0 rounded border border-gray-200 bg-gray-100 px-2 py-0.5 text-xs font-light text-gray-500 md:block",children:"F"})]}),H(El,{ref:f,children:ve(Ee.List,{className:n("flex w-full flex-col gap-1 p-1",w?"min-w-[100px]":"min-w-[180px]"),children:[w?((q=(D=w.options)==null?void 0:D.filter(C=>!g||!C.hideDuringSearch))==null?void 0:q.map(C=>{let O=R(C.value);return H(Va,{filter:w,option:C,right:O?H(Oo,{className:"h-4 w-4"}):C.right,onSelect:()=>z(C.value)},C.value)}))??H(Ee.Loading,{children:H("div",{className:"-m-1 flex items-center justify-center",style:x.current,children:H(ye,{})})}):e.map(C=>ve(Sl,{children:[H(Va,{filter:C,onSelect:()=>y(C.key)}),C.separatorAfter&&H(Ee.Separator,{className:"-mx-1 my-1 border-b border-gray-200"})]},C.key)),(!w||w.options)&&H(Al,{search:g,askAI:l,children:m?Ll(m)?(m==null?void 0:m[S??"default"])??"No matches":m:"No matches"})]})},S)]})}),children:ve("button",{type:"button",className:n("group flex h-10 cursor-pointer appearance-none items-center gap-x-2 truncate rounded-md border px-3 text-sm outline-none transition-all","border-gray-200 bg-white text-gray-900 placeholder-gray-400","focus-visible:border-gray-500 data-[state=open]:border-gray-500 data-[state=open]:ring-4 data-[state=open]:ring-gray-200",i),children:[H(Pl,{className:"size-4 shrink-0"}),H("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-gray-900",children:d??"Filter"}),c!=null&&c.length?H("div",{className:"flex size-4 shrink-0 items-center justify-center rounded-full bg-black text-[0.625rem] text-white",children:c.length}):H(kl,{className:"size-4 shrink-0 text-gray-400 transition-transform duration-75 group-data-[state=open]:rotate-180"})]})})}function Ll(e){return typeof e=="object"&&e!==null&&!Ba(e)}var Tl=e=>{let t=Nl(r=>r.filtered.count===0);return H(Ee.Input,{...e,size:1,className:"grow border-0 py-3 pl-4 pr-2 outline-none placeholder:text-gray-400 focus:ring-0 sm:text-sm",onKeyDown:r=>{var o,a;(o=e.onKeyDown)==null||o.call(e,r),r.key==="Enter"&&t&&((a=e.emptySubmit)==null||a.call(e,r))},autoCapitalize:"none"})},El=Ml(({children:e},t)=>{let r=Fr(null);Rl(t,()=>r.current);let{scrollProgress:o,updateScrollProgress:a}=tt(r);return ve(Il,{children:[H("div",{className:"scrollbar-hide max-h-[50vh] w-screen overflow-y-scroll sm:w-auto",ref:r,onScroll:a,children:e}),H("div",{className:"pointer-events-none absolute bottom-0 left-0 hidden h-16 w-full bg-gradient-to-t from-white sm:block",style:{opacity:1-Math.pow(o,2)}})]})});function Va({filter:e,option:t,right:r,onSelect:o}){var l,d;let{isMobile:a}=Y(),s=t?t.icon??((l=e.getOptionIcon)==null?void 0:l.call(e,t.value,{key:e.key,option:t}))??e.icon:e.icon,c=t?t.label??((d=e.getOptionLabel)==null?void 0:d.call(e,t.value,{key:e.key,option:t})):e.label;return ve(Ee.Item,{className:n("flex cursor-pointer items-center gap-3 whitespace-nowrap rounded-md px-3 py-2 text-left text-sm","data-[selected=true]:bg-gray-100"),onPointerDown:m=>{m.preventDefault()},onPointerUp:m=>{m.preventDefault(),a?setTimeout(o,100):o()},onSelect:o,value:c+(t==null?void 0:t.value),children:[H("span",{className:"shrink-0 text-gray-600",children:Dl(s)?s:H(s,{className:"h-4 w-4"})}),Tt(c,48),H("div",{className:"ml-1 flex shrink-0 grow justify-end text-gray-500",children:r})]})}var Al=({search:e,askAI:t,children:r})=>t&&e?ve(Ee.Empty,{className:"flex min-w-[180px] items-center space-x-2 rounded-md bg-gray-100 px-3 py-2",children:[H(Co,{className:"h-4 w-4"}),ve("p",{className:"text-center text-sm text-gray-600",children:["Ask AI ",ve("span",{className:"text-black",children:['"',e,'"']})]})]}):H(Ee.Empty,{className:"p-2 text-center text-sm text-gray-400",children:r}),Dl=e=>Ba(e);var C2={Select:Wa,List:Ha};import{useMemo as zl,useState as Fa}from"react";import{jsx as Fe,jsxs as rr}from"react/jsx-runtime";function L2({title:e,description:t,inputAttrs:r,helpText:o,buttonText:a="Save Changes",disabledTooltip:s,handleSubmit:c}){let[l,d]=Fa(r.defaultValue),[m,i]=Fa(!1),p=zl(()=>m||!l||l===r.defaultValue,[m,l,r.defaultValue]);return rr("form",{onSubmit:async f=>{f.preventDefault(),i(!0),await c({[r.name]:l}),i(!1)},className:"rounded-lg border border-gray-200 bg-white",children:[rr("div",{className:"relative flex flex-col space-y-6 p-5 sm:p-10",children:[rr("div",{className:"flex flex-col space-y-3",children:[Fe("h2",{className:"text-xl font-medium",children:e}),Fe("p",{className:"text-sm text-gray-500",children:t})]}),typeof r.defaultValue=="string"?Fe("input",{...r,type:r.type||"text",required:!0,disabled:!!s,onChange:f=>d(f.target.value),className:n("w-full max-w-md rounded-md border border-gray-300 text-gray-900 placeholder-gray-400 focus:border-gray-500 focus:outline-none focus:ring-gray-500 sm:text-sm",{"cursor-not-allowed bg-gray-100 text-gray-400":s})}):Fe("div",{className:"h-[2.35rem] w-full max-w-md animate-pulse rounded-md bg-gray-200"})]}),rr("div",{className:"flex items-center justify-between space-x-4 rounded-b-lg border-t border-gray-200 bg-gray-50 p-3 sm:px-10",children:[typeof o=="string"?Fe("p",{className:"prose-sm prose-a:underline prose-a:underline-offset-4 hover:prose-a:text-gray-700 text-gray-500 transition-colors",dangerouslySetInnerHTML:{__html:o||""}}):o,Fe("div",{className:"shrink-0",children:Fe(ie,{text:a,loading:m,disabled:p,disabledTooltip:s})})]})]})}import{useId as Ol}from"react";import{jsx as or,jsxs as _l}from"react/jsx-runtime";function D2({cellSize:e=12,strokeWidth:t=1,patternOffset:r=[0,0],className:o}){let a=Ol();return _l("svg",{className:n("pointer-events-none absolute inset-0 text-black/10",o),width:"100%",height:"100%",children:[or("defs",{children:or("pattern",{id:`grid-${a}`,x:r[0]-1,y:r[1]-1,width:e,height:e,patternUnits:"userSpaceOnUse",children:or("path",{d:`M ${e} 0 L 0 0 0 ${e}`,fill:"transparent",stroke:"currentColor",strokeWidth:t})})}),or("rect",{fill:`url(#grid-${a})`,width:"100%",height:"100%"})]})}import{AlertCircle as Hl}from"lucide-react";import Vl,{useCallback as Bl,useState as Wl}from"react";import{jsx as Ue,jsxs as Ur}from"react/jsx-runtime";var Fl=Vl.forwardRef(({className:e,type:t,...r},o)=>{let[a,s]=Wl(!1),c=Bl(()=>s(!a),[a,s]);return Ur("div",{children:[Ur("div",{className:"relative flex",children:[Ue("input",{type:a?"text":t,className:n("w-full max-w-md rounded-md border border-gray-300 text-gray-900 placeholder-gray-400 focus:border-gray-500 focus:outline-none focus:ring-gray-500 sm:text-sm",r.error&&"border-red-500 focus:border-red-500 focus:ring-red-500",e),ref:o,...r}),Ur("div",{className:"group",children:[r.error&&Ue("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex flex-none items-center px-2.5",children:Ue(Hl,{className:n("size-5 text-white",t==="password"&&"transition-opacity group-hover:opacity-0"),fill:"#ef4444"})}),t==="password"&&Ue("button",{className:n("absolute inset-y-0 right-0 flex items-center px-3",r.error&&"opacity-0 transition-opacity group-hover:opacity-100"),type:"button",onClick:()=>c(),"aria-label":a?"Hide password":"Show Password",children:a?Ue($o,{className:"size-4 flex-none text-gray-500 transition hover:text-gray-700","aria-hidden":!0}):Ue(Ko,{className:"size-4 flex-none text-gray-500 transition hover:text-gray-700","aria-hidden":!0})})]})]}),r.error&&Ue("span",{className:"mt-2 block text-sm text-red-500",role:"alert","aria-live":"assertive",children:r.error})]})});Fl.displayName="Input";import{flip as Kl,offset as jl,size as Yl,useDismiss as Zl,useFloating as ql,useInteractions as Ql}from"@floating-ui/react";import{Command as ke,useCommandState as Xl}from"cmdk";import{Check as Jl,ChevronDown as ec,Search as Gr,X as tc}from"lucide-react";import{createContext as rc,forwardRef as oc,useContext as Zr,useEffect as $r,useMemo as ac,useRef as Ga,useState as Kr}from"react";import{Drawer as at}from"vaul";import Ul from"next/image";import{useEffect as Gl,useState as Ua}from"react";import{jsx as $l}from"react/jsx-runtime";function ar(e){let[t,r]=Ua(!0),[o,a]=Ua(e.src);Gl(()=>a(e.src),[e.src]);let s=c=>{r(!1);let l=c.target;l.naturalWidth<=16&&l.naturalHeight<=16&&a(`https://avatar.vercel.sh/${encodeURIComponent(e.alt)}`)};return $l(Ul,{...e,src:o,alt:e.alt,className:n(t?"blur-[2px]":"blur-0",e.className),onLoad:s,onError:()=>{a(`https://avatar.vercel.sh/${encodeURIComponent(e.alt)}`)},unoptimized:!0})}import{jsx as L,jsxs as Q}from"react/jsx-runtime";var ir=rc({inputAttrs:{},openCommandList:!1,setOpenCommandList:()=>{},inputValue:"",setInputValue:()=>{},disabled:!1,selectedItem:null,setSelectedItem:()=>{}});function iv({items:e,selectedItem:t,setSelectedItem:r,className:o,disabled:a,adjustForMobile:s,icon:c,inputAttrs:l,noItemsElement:d}){let m=Ga(null),[i,p]=Kr(!1),[f,x]=Kr(""),[h,b]=Kr(!1);$r(()=>{i&&b(!1)},[i]),$r(()=>b(!0),[f]),$r(()=>{t&&x(t.value)},[t]);let g=ac(()=>{let C=f.toLowerCase();return h?e.filter(O=>O.value.toLowerCase().includes(C)):f?e.sort((O,ce)=>(ce.value.toLowerCase().includes(C)?1:0)-(O.value.toLowerCase().includes(C)?1:0)):e},[h,f,e]),{refs:N,floatingStyles:S,context:M}=ql({open:i,onOpenChange:p,middleware:[jl(8),Yl({apply({elements:{floating:C},availableHeight:O}){Object.assign(C.style,{maxHeight:`${Math.max(75,Math.min(O,290))}px`})},padding:8}),Kl({fallbackStrategy:"initialPlacement",padding:8})]}),P=Zl(M),{getReferenceProps:w,getFloatingProps:y}=Ql([P]),R=Ga(null),{scrollProgress:z,updateScrollProgress:D}=tt(R),{isMobile:q}=Y();return L(ir.Provider,{value:{inputAttrs:l||{},openCommandList:i,setOpenCommandList:p,inputValue:f,setInputValue:x,disabled:Boolean(a),selectedItem:t,setSelectedItem:r},children:q&&s?Q(at.Root,{open:i,onOpenChange:p,children:[L(at.Trigger,{className:"sm:hidden",asChild:!0,children:L(ke,{ref:m,className:"relative",shouldFilter:!1,loop:!0,children:Q("div",{className:n("group relative rounded-md border border-gray-300 bg-white px-1 focus-within:border-gray-500 focus-within:ring-1 focus-within:ring-gray-500 md:min-w-[140px]",o),children:[L("div",{className:"absolute inset-y-0 left-0 flex items-center justify-center pl-3 text-gray-400",children:t&&t.image?L("img",{src:t.image,alt:t.value,className:"h-4 w-4 rounded-full"}):c||L(Gr,{className:"h-4 w-4 text-gray-400"})}),Q("div",{className:"flex h-10 px-8",children:[L(jr,{}),L(Yr,{})]})]})})}),L(at.Overlay,{className:"fixed inset-0 z-40 bg-gray-100 bg-opacity-10 backdrop-blur"}),Q(at.Portal,{children:[L(at.Content,{className:"fixed bottom-0 left-0 right-0 z-50 mt-24 rounded-t-lg border-t border-gray-200 bg-white",onPointerDownOutside:C=>{C.target instanceof Element&&C.target.closest("[data-sonner-toast]")&&C.preventDefault()},children:Q(ke,{ref:m,className:"relative",shouldFilter:!1,loop:!0,children:[Q("div",{className:n("group relative mb-2 rounded-t-md border-b border-gray-300 bg-white p-1 sm:border sm:py-0 sm:focus-within:border-gray-500 sm:focus-within:ring-1 sm:focus-within:ring-gray-200",o),children:[L("div",{className:"absolute inset-y-0 left-0 flex items-center justify-center pl-3 text-gray-400",children:t&&t.image?L("img",{src:t.image,alt:t.value,className:"h-4 w-4 rounded-full"}):c||L(Gr,{className:"h-4 w-4 text-gray-400"})}),Q("div",{className:"flex h-10 px-8",children:[L(jr,{}),L(Yr,{})]})]}),i&&Q(ke.List,{className:"dub-scrollbar h-[70vh] overflow-y-auto p-2",children:[e.length===0&&f===""&&(d?L("div",{children:d}):L("p",{className:"px-4 py-2 text-sm text-gray-600",children:"No items found."})),f!==""&&L(ke.Empty,{className:"px-4 py-2 text-sm text-gray-600",children:"No results found."}),L($a,{items:g})]})]})}),L(at.Overlay,{})]})]}):Q(ke,{ref:m,className:"relative",shouldFilter:!1,loop:!0,children:[Q("div",{className:n("group rounded-md border border-gray-200 bg-white px-1 transition-all focus-within:border-gray-500 focus-within:ring-4 focus-within:ring-gray-200",o),children:[L("div",{onClick:()=>p(C=>!C),className:"absolute inset-y-0 left-0 flex cursor-pointer items-center justify-center pl-3 text-gray-400",children:t&&t.image?L("img",{src:t.image,alt:t.value,className:"h-4 w-4 rounded-full"}):c||L(Gr,{className:"h-4 w-4 text-gray-400"})}),Q("div",{className:"flex h-10 px-8",children:[L(jr,{ref:N.setReference,...w()}),L(Yr,{})]})]}),i&&Q("div",{ref:N.setFloating,style:S,...y(),className:"z-20 flex w-full min-w-[160px] flex-col overflow-hidden rounded-md border border-gray-200 bg-white shadow-md",children:[Q("div",{ref:R,onScroll:D,className:"grow overflow-y-auto p-2",children:[Q(ke.List,{children:[e.length===0&&f===""&&(d?L("div",{children:d}):L("p",{className:"px-4 py-2 text-sm text-gray-600",children:"No items found."})),f!==""&&L(ke.Empty,{className:"px-4 py-2 text-sm text-gray-600",children:"No results found."})]}),L($a,{items:g})]}),L("div",{className:"pointer-events-none absolute bottom-0 left-0 hidden h-16 w-full bg-gradient-to-t from-white sm:block",style:{opacity:1-Math.pow(z,2)}})]})]})})}var jr=oc((e,t)=>{let r=Xl(m=>m.filtered.count===0),{inputAttrs:o,openCommandList:a,setOpenCommandList:s,inputValue:c,setInputValue:l,disabled:d}=Zr(ir);return L(ke.Input,{ref:t,placeholder:(o==null?void 0:o.placeholder)||"Search...",autoFocus:a,onFocus:()=>s(!0),value:c,onValueChange:l,onKeyDown:m=>{m.key==="Escape"?(m.preventDefault(),s(!1)):m.key==="Enter"&&r?s(!1):m.key.match(/^[a-z0-9]$/i)&&!m.metaKey&&s(!0)},disabled:d,className:"block w-full truncate rounded-md border-none px-0 text-base text-gray-900 placeholder-gray-400 outline-none outline-0 transition-all duration-300 focus:ring-0 md:text-sm",autoCapitalize:"none"})});function Yr(){let{setSelectedItem:e,openCommandList:t,setOpenCommandList:r,inputValue:o,setInputValue:a}=Zr(ir);return L("button",{type:"button",onClick:()=>{r(s=>!s),e(null),a("")},className:"absolute inset-y-0 right-0 my-auto pr-3",children:o.length>0?L(tc,{className:"h-4 w-4 text-gray-400 transition-all hover:text-gray-700"}):L(ec,{className:n("h-4 w-4 text-gray-400 transition-all hover:text-gray-700",{"rotate-180 transform":t})})})}function $a({items:e}){let{setSelectedItem:t,setOpenCommandList:r,setInputValue:o}=Zr(ir);return e.map(a=>Q(ke.Item,{value:a.value,disabled:a.disabled,onSelect:()=>{t(a),o(a.value),r(!1)},className:"group flex cursor-pointer items-center justify-between rounded-md px-4 py-2 text-sm text-gray-900 hover:bg-gray-100 hover:text-gray-900 active:bg-gray-200 aria-disabled:cursor-not-allowed aria-disabled:opacity-75 aria-disabled:hover:bg-white aria-selected:bg-gray-100 aria-selected:text-gray-900",children:[Q("div",{className:"flex items-center space-x-2",children:[a.image&&L(ar,{src:a.image,alt:a.value,className:"h-4 w-4 rounded-full",width:16,height:16}),L("p",{className:n("whitespace-nowrap py-0.5 text-sm",a.color&&"rounded-md px-2",a.color==="red"&&"bg-red-100 text-red-600",a.color==="yellow"&&"bg-yellow-100 text-yellow-600",a.color==="green"&&"bg-green-100 text-green-600",a.color==="blue"&&"bg-blue-100 text-blue-600",a.color==="purple"&&"bg-purple-100 text-purple-600",a.color==="brown"&&"bg-brown-100 text-brown-600"),children:a.value}),a.label&&L(Ft,{className:"text-xs",variant:"neutral",children:a.label})]}),L(Jl,{className:"invisible h-5 w-5 text-gray-500 aria-selected:visible"})]},a.id))}import*as qr from"@radix-ui/react-label";import{cva as ic}from"class-variance-authority";import*as Ka from"react";import{jsx as lc}from"react/jsx-runtime";var nc=ic("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),sc=Ka.forwardRef(({className:e,...t},r)=>lc(qr.Root,{ref:r,className:n(nc(),e),...t}));sc.displayName=qr.Root.displayName;import{curveNatural as ja}from"@visx/curve";import{LinearGradient as Ya}from"@visx/gradient";import{Group as cc}from"@visx/group";import{ParentSize as dc}from"@visx/responsive";import{scaleLinear as mc,scaleUtc as uc}from"@visx/scale";import{Area as pc,AreaClosed as fc}from"@visx/shape";import{motion as Za}from"framer-motion";import{useId as gc,useMemo as qa}from"react";import{jsx as be,jsxs as Qr}from"react/jsx-runtime";function bv(e){return be(dc,{className:"relative",children:({width:t,height:r})=>t>0&&r>0&&be(hc,{...{width:t,height:r,...e}})})}var Ae={top:8,right:2,bottom:2,left:2};function hc({width:e,height:t,data:r,curve:o=!0,color:a}){let s=gc(),c=qa(()=>r.map(({date:m})=>({date:m,value:0})),[r]),{yScale:l,xScale:d}=qa(()=>{let m=r.map(({value:h})=>h),i=Math.max(...m),p=r.map(({date:h})=>h.getTime()),f=new Date(Math.min(...p)),x=new Date(Math.max(...p));return{yScale:mc({domain:[-2,Math.max(i,2)],range:[t-Ae.top-Ae.bottom,0],nice:!0,clamp:!0}),xScale:uc({domain:[f,x],range:[0,e-Ae.left-Ae.right],nice:!0})}},[r,t,e]);return Qr("svg",{width:e,height:t,children:[Qr("defs",{children:[be(Ya,{id:`${s}-color-gradient`,from:a||"#7D3AEC",to:a||"#DA2778",x1:0,x2:e-Ae.left-Ae.right,gradientUnits:"userSpaceOnUse"}),be(Ya,{id:`${s}-mask-gradient`,from:"white",to:"white",fromOpacity:.3,toOpacity:0,x1:0,x2:0,y1:0,y2:1}),be("mask",{id:`${s}-mask`,maskContentUnits:"objectBoundingBox",children:be("rect",{width:"1",height:"1",fill:`url(#${s}-mask-gradient)`})})]}),Qr(cc,{left:Ae.left,top:Ae.top,children:[be(pc,{data:r,x:({date:m})=>d(m),y:({value:m})=>l(m)??0,curve:o?ja:void 0,children:({path:m})=>be(Za.path,{initial:{d:m(c)||"",opacity:0},animate:{d:m(r)||"",opacity:1},strokeWidth:1.5,stroke:`url(#${s}-color-gradient)`})}),be(fc,{data:r,x:({date:m})=>d(m),y:({value:m})=>l(m)??0,yScale:l,curve:o?ja:void 0,children:({path:m})=>be(Za.path,{initial:{d:m(c)||"",opacity:0},animate:{d:m(r)||"",opacity:1},fill:`url(#${s}-color-gradient)`,mask:`url(#${s}-mask)`})})]})]},r.length)}import*as ne from"@radix-ui/react-dialog";import*as Xr from"@radix-ui/react-visually-hidden";import{useRouter as vc}from"next/navigation";import{Drawer as Ge}from"vaul";import{jsx as re,jsxs as it}from"react/jsx-runtime";function kv({children:e,className:t,showModal:r,setShowModal:o,onClose:a,desktopOnly:s,preventDefaultClose:c,drawerRootProps:l}){let d=vc(),m=({dragged:p}={})=>{c&&!p||(a&&a(),o?o(!1):d.back())},{isMobile:i}=Y();return i&&!s?re(Ge.Root,{open:o?r:!0,onOpenChange:p=>{p||m({dragged:!0})},...l,children:it(Ge.Portal,{children:[re(Ge.Overlay,{className:"fixed inset-0 z-50 bg-gray-100 bg-opacity-10 backdrop-blur"}),re(Ge.Content,{onPointerDownOutside:p=>{p.target instanceof Element&&p.target.closest("[data-sonner-toast]")&&p.preventDefault()},className:n("fixed bottom-0 left-0 right-0 z-50 flex flex-col","rounded-t-[10px] border-t border-gray-200 bg-white",t),children:it("div",{className:"scrollbar-hide flex-1 overflow-y-auto rounded-t-[10px] bg-inherit",children:[it(Xr.Root,{children:[re(Ge.Title,{children:"Modal"}),re(Ge.Description,{children:"This is a modal"})]}),re(bc,{}),e]})}),re(Ge.Overlay,{})]})}):re(ne.Root,{open:o?r:!0,onOpenChange:p=>{p||m()},children:it(ne.Portal,{children:[re(ne.Overlay,{id:"modal-backdrop",className:"animate-fade-in fixed inset-0 z-40 bg-gray-100 bg-opacity-50 backdrop-blur-md"}),it(ne.Content,{onOpenAutoFocus:p=>p.preventDefault(),onCloseAutoFocus:p=>p.preventDefault(),onPointerDownOutside:p=>{p.target instanceof Element&&p.target.closest("[data-sonner-toast]")&&p.preventDefault()},className:n("fixed inset-0 z-40 m-auto h-fit w-full max-w-md","border border-gray-200 bg-white p-0 shadow-xl sm:rounded-2xl","scrollbar-hide animate-scale-in overflow-y-auto",t),children:[it(Xr.Root,{children:[re(ne.Title,{children:"Modal"}),re(ne.Description,{children:"This is a modal"})]}),e]})]})})}function bc(){return re("div",{className:"sticky top-0 z-20 flex items-center justify-center rounded-t-[10px] bg-inherit",children:re("div",{className:"my-3 h-1 w-12 rounded-full bg-gray-300"})})}import{Fragment as xc,jsx as nr,jsxs as nt}from"react/jsx-runtime";var Qa=n("flex h-7 items-center justify-center gap-2 whitespace-nowrap rounded-md border border-gray-200 bg-white px-2 text-sm text-gray-600","outline-none hover:bg-gray-50 focus-visible:border-gray-500","disabled:cursor-not-allowed disabled:border-gray-200 disabled:text-gray-400 disabled:bg-gray-100");function Mv({pagination:e,setPagination:t,totalCount:r,unit:o=c=>`item${c?"s":""}`,className:a,children:s}){return nt("div",{className:n("flex items-center justify-between gap-2 text-sm leading-6 text-gray-600",a),children:[nt("div",{className:"flex items-center gap-2",children:[nt("div",{children:[nr("span",{className:"hidden sm:inline-block",children:"Viewing"})," ",r>0&&nt(xc,{children:[nt("span",{className:"font-medium",children:[(e.pageIndex-1)*e.pageSize+1,"-",Math.min((e.pageIndex-1)*e.pageSize+e.pageSize,r)]})," ","of"," "]}),nr("span",{className:"font-medium",children:Rt(r,{full:!0})})," ",typeof o=="function"?o(r!==1):o]}),s]}),nt("div",{className:"flex items-center gap-2",children:[nr("button",{type:"button",className:Qa,onClick:()=>t({...e,pageIndex:e.pageIndex-1}),disabled:e.pageIndex===1,children:"Previous"}),nr("button",{type:"button",className:Qa,onClick:()=>t({...e,pageIndex:e.pageIndex+1}),disabled:(e.pageIndex-1)*e.pageSize+e.pageSize>=r,children:"Next"})]})]})}import*as De from"@radix-ui/react-radio-group";import{Circle as yc}from"lucide-react";import*as Jr from"react";import{jsx as sr}from"react/jsx-runtime";var wc=Jr.forwardRef(({className:e,...t},r)=>sr(De.Root,{className:n("grid gap-2",e),...t,ref:r}));wc.displayName=De.Root.displayName;var Cc=Jr.forwardRef(({className:e,...t},r)=>sr(De.Item,{ref:r,className:n("border-primary text-primary ring-offset-background focus-visible:ring-ring aspect-square h-4 w-4 rounded-full border focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:sr(De.Indicator,{className:"flex items-center justify-center",children:sr(yc,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Cc.displayName=De.Item.displayName;import{Drawer as Ie}from"vaul";import{jsx as $e,jsxs as Mc}from"react/jsx-runtime";function Nc({children:e,contentProps:t,nested:r=!1,...o}){let a=r?Ie.NestedRoot:Ie.Root;return $e(a,{direction:"right",handleOnly:!0,...o,children:Mc(Ie.Portal,{children:[$e(Ie.Overlay,{className:"fixed inset-0 bg-black/20"}),$e(Ie.Content,{...t,onPointerDownOutside:s=>{var c;s.target instanceof Element&&s.target.closest("[data-sonner-toast]")&&s.preventDefault(),(c=t==null?void 0:t.onPointerDownOutside)==null||c.call(t,s)},className:n("fixed bottom-2 right-2 top-2 z-10 flex w-[calc(100%-16px)] outline-none md:w-[540px]",t==null?void 0:t.className),style:{"--initial-transform":"calc(100% + 8px)","user-select":"auto",...t==null?void 0:t.style},children:$e("div",{className:"scrollbar-hide flex size-full grow flex-col overflow-y-auto rounded-lg bg-white",children:e})})]})})}function kc({className:e,...t}){return $e(Ie.Title,{className:n("text-xl font-medium text-zinc-900",e),...t})}function Pc(e){return $e(Ie.Description,{...e})}function Sc(e){return $e(Ie.Close,{...e})}var zv=Object.assign(Nc,{Title:kc,Description:Pc,Close:Sc});import{useEffect as Rc,useRef as Lc,useState as Tc}from"react";import{jsx as Xa}from"react/jsx-runtime";var Ec=`
|
|
3
3
|
attribute vec2 position;
|
|
4
4
|
|
|
5
5
|
void main()
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dub/ui",
|
|
3
3
|
"description": "UI components for Dub.co",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.22",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.mjs",
|
|
@@ -103,10 +103,10 @@
|
|
|
103
103
|
"homepage": "https://dub.co",
|
|
104
104
|
"repository": {
|
|
105
105
|
"type": "git",
|
|
106
|
-
"url": "git+https://github.com/
|
|
106
|
+
"url": "git+https://github.com/dubinc/dub.git"
|
|
107
107
|
},
|
|
108
108
|
"bugs": {
|
|
109
|
-
"url": "https://github.com/
|
|
109
|
+
"url": "https://github.com/dubinc/dub/issues"
|
|
110
110
|
},
|
|
111
111
|
"keywords": [
|
|
112
112
|
"dub",
|