@dub/ui 0.2.62 → 0.2.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client"
2
- import{$ as Ip,$a as Ra,$b as mf,$c as tg,$d as Zg,A as pp,Aa as a0,Ab as U0,Ac as Af,Ad as kg,B as fp,Ba as n0,Bb as G0,Bc as Of,Bd as Pg,C as gp,Ca as i0,Cb as j0,Cc as zf,Cd as Sg,D as or,Da as ya,Db as sr,Dc as Ba,Dd as Rg,E as bp,Ea as s0,Eb as K0,Ec as Vf,Ed as Tg,F as ar,Fa as l0,Fb as Y0,Fc as Hf,Fd as Lg,G as hp,Ga as Na,Gb as Z0,Gc as _f,Gd as Mg,H as vp,Ha as c0,Hb as q0,Hc as $a,Hd as Dg,I as xp,Ia as d0,Ib as X0,Ic as Ua,Id as Eg,J as yp,Ja as m0,Jb as Ea,Jc as Ff,Jd as Ig,K as fa,Ka as u0,Kb as J0,Kc as Wf,Kd as Ag,L as ga,La as p0,Lb as Q0,Lc as Bf,Ld as Og,M as ba,Ma as f0,Mb as ef,Mc as $f,Md as zg,N as ha,Na as g0,Nb as tf,Nc as lr,Nd as Vg,O as va,Oa as b0,Ob as Ia,Oc as Uf,Od as Hg,P as Np,Pa as h0,Pb as Aa,Pc as Gf,Pd as _g,Q as wp,Qa as v0,Qb as Oa,Qc as jf,Qd as Fg,R as Cp,Ra as wa,Rb as za,Rc as Kf,Rd as Wg,S as kp,Sa as ir,Sb as rf,Sc as Yf,Sd as Bg,T as Pp,Ta as Ca,Tb as of,Tc as Zf,Td as $g,U as Sp,Ua as ka,Ub as af,Uc as qf,Ud as Ya,V as Rp,Va as x0,Vb as nf,Vc as Xf,Vd as Za,W as Tp,Wa as y0,Wb as sf,Wc as Jf,Wd as Ug,X as Lp,Xa as Pa,Xb as lf,Xc as Qf,Xd as Gg,Y as Mp,Ya as Sa,Yb as Va,Yc as eg,Yd as jg,Z as Dp,Za as N0,Zb as cf,Zc as cr,Zd as Kg,_ as Ep,_a as w0,_b as df,_c as dr,_d as Yg,a as op,aa as Ap,ab as Ta,ac as uf,ad as rg,ae as qg,b as sa,ba as Op,bb as La,bc as pf,bd as og,be as Xg,c as ap,ca as zp,cb as C0,cc as ff,cd as ag,ce as Jg,d as lt,da as Vp,db as k0,dc as gf,dd as ng,de as Qg,e as er,ea as Hp,eb as P0,ec as bf,ed as ig,ee as eb,f as np,fa as _p,fb as S0,fc as hf,fd as sg,fe as tb,g as ct,ga as Fp,gb as R0,gc as vf,gd as Ga,ge as rb,h as dt,ha as Wp,hb as qr,hc as Ha,hd as lg,he as ob,i as Zr,ia as Bp,ib as T0,ic as xf,id as cg,ie as ab,j as la,ja as $p,jb as L0,jc as yf,jd as dg,je as Rt,k as ip,ka as Up,kb as M0,kc as Nf,kd as mg,ke as nb,l as ca,la as Gp,lb as Ma,lc as _a,ld as ug,le as ib,m as sp,ma as jp,mb as D0,mc as wf,md as pg,me as sb,n as lp,na as xa,nb as E0,nc as Cf,nd as fg,ne as lb,o as da,oa as Kp,ob as I0,oc as Fa,od as gg,oe as qa,p as ma,pa as Yp,pb as A0,pc as kf,pd as mt,pe as cb,q as ua,qa as Zp,qb as O0,qc as Wa,qd as bg,qe as db,r as pa,ra as qp,rb as z0,rc as Pf,rd as hg,re as mb,s as St,sa as Xp,sb as V0,sc as Sf,sd as vg,se as ub,t as cp,ta as Jp,tb as H0,tc as Rf,td as xg,te as pb,u as Pe,ua as Qp,ub as _0,uc as Tf,ud as yg,ue as fb,v as dp,va as e0,vb as F0,vc as Lf,vd as ja,ve as gb,w as tr,wa as t0,wb as W0,wc as Mf,wd as Ng,x as mp,xa as r0,xb as B0,xc as Df,xd as wg,y as up,ya as nr,yb as $0,yc as Ef,yd as Ka,z as rr,za as o0,zb as Da,zc as If,zd as Cg}from"./chunk-JBM5VC5Y.mjs";import{a as Y}from"./chunk-NWME2ANF.mjs";import{a as Kr,b as kt,c as qo,d as Xo,e as Pt,f as Jo,g as Qo,h as be,i as Ke,j as i,k as Yr,l as ea,m as _,n as ta,o as ke,p as ra,q as oa,r as aa,s as Jt,t as Qt,u as na,v as ia}from"./chunk-DO2L4NYP.mjs";import*as ie from"@radix-ui/react-accordion";import{ChevronDown as Wi}from"lucide-react";import*as ur from"react";import{jsx as mr,jsxs as Gi}from"react/jsx-runtime";var Nb=ie.Root,Bi=ur.forwardRef(({className:e,...t},r)=>mr(ie.Item,{ref:r,className:i("border-b border-b-slate-200 py-3 last:border-none",e),...t}));Bi.displayName="AccordionItem";var $i=ur.forwardRef(({className:e,children:t,variant:r="chevron",...o},a)=>{let n=r==="chevron"?Wi:mt;return mr(ie.Header,{className:"flex",children:Gi(ie.Trigger,{ref:a,className:i("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,mr(n,{className:"h-5 w-5 flex-none transition-transform duration-300"})]})})});$i.displayName=ie.Trigger.displayName;var Ui=ur.forwardRef(({className:e,children:t,...r},o)=>mr(ie.Content,{ref:o,className:i("data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm text-neutral-500 transition-all sm:text-base",e),...r,children:t}));Ui.displayName=ie.Content.displayName;import{cva as ji}from"class-variance-authority";import*as pr from"react";import{jsx as Xr}from"react/jsx-runtime";var Ki=ji("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"}}),Yi=pr.forwardRef(({className:e,variant:t,...r},o)=>Xr("div",{ref:o,role:"alert",className:i(Ki({variant:t}),e),...r}));Yi.displayName="Alert";var Zi=pr.forwardRef(({className:e,...t},r)=>Xr("h5",{ref:r,className:i("text-md mb-2 font-medium leading-none tracking-tight",e),...t}));Zi.displayName="AlertTitle";var qi=pr.forwardRef(({className:e,...t},r)=>Xr("div",{ref:r,className:i("text-sm [&_p]:leading-relaxed",e),...t}));qi.displayName="AlertDescription";import{sha256 as Xi}from"js-sha256";import{useState as Ji}from"react";import{jsx as Jr}from"react/jsx-runtime";function Qi(e){if(e!=null&&e.image)return e.image;if(!(e!=null&&e.id))return"https://api.dub.co/og/avatar";let t=`https://api.dub.co/og/avatar/${e.id}`;return e.email?`https://0.gravatar.com/avatar/${Xi(e.email)}?d=${t}`:t}function Lb({user:e={},className:t}){if(!e)return Jr("div",{className:i("h-10 w-10 animate-pulse rounded-full border border-neutral-300 bg-neutral-100",t)});let[r,o]=Ji(Qi(e));return Jr("img",{alt:`Avatar for ${e.name||e.email}`,referrerPolicy:"no-referrer",src:r,className:i("h-10 w-10 rounded-full border border-neutral-300",t),draggable:!1,onError:()=>{o(`https://api.dub.co/og/avatar/${e.id}`)}})}function Mb({id:e,className:t}){return Jr("img",{src:`https://api.dicebear.com/9.x/shapes/svg?seed=${e}`,alt:"avatar",className:i("h-10 w-10 rounded-full",t),draggable:!1})}import{cva as es}from"class-variance-authority";import{jsx as rs}from"react/jsx-runtime";var ts=es("max-w-fit rounded-full border px-2 py-px text-xs font-medium whitespace-nowrap",{variants:{variant:{default:"border-neutral-400 text-neutral-500",violet:"border-violet-600 bg-violet-600 text-white",blue:"border-blue-500 bg-blue-500 text-white",green:"border-green-100 bg-green-100 text-green-900",sky:"border-sky-900 bg-sky-900 text-white",black:"border-black bg-black text-white",gray:"border-neutral-200 bg-neutral-100 text-neutral-800",neutral:"border-neutral-400 text-neutral-500",amber:"border-amber-800 bg-amber-800 text-white",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 fr({className:e,variant:t,...r}){return rs("span",{className:i(ts({variant:t}),e),...r})}import{cva as ls}from"class-variance-authority";import{forwardRef as cs}from"react";import*as he from"@radix-ui/react-tooltip";import os from"linkify-react";import{HelpCircle as as}from"lucide-react";import ns from"next/link";import{useState as is}from"react";import{Fragment as ss,jsx as U,jsxs as Ye}from"react/jsx-runtime";function Ub({children:e}){return U(he.Provider,{delayDuration:150,children:e})}function Q({children:e,content:t,contentClassName:r,disabled:o,side:a="top",disableHoverableContent:n,delayDuration:c=0,...s}){let[m,d]=is(!1);return Ye(he.Root,{open:o?!1:m,onOpenChange:d,delayDuration:c,disableHoverableContent:n,children:[U(he.Trigger,{asChild:!0,onClick:()=>{d(!0)},onBlur:()=>{d(!1)},children:e}),U(he.Portal,{children:U(he.Content,{sideOffset:8,side:a,className:"animate-slide-up-fade pointer-events-auto z-[99] items-center overflow-hidden rounded-xl border border-neutral-200 bg-white shadow-sm",collisionPadding:0,...s,children:typeof t=="string"?U("span",{className:i("block max-w-xs text-pretty px-4 py-2 text-center text-sm text-neutral-700",r),children:t}):typeof t=="function"?t({setOpen:d}):t})})]})}function Gb({title:e,cta:t,href:r,target:o,onClick:a}){return Ye("div",{className:"flex max-w-xs flex-col items-center space-y-3 p-4 text-center",children:[U("p",{className:"text-sm text-neutral-700",children:e}),t&&(r?U(ns,{href:r,...o?{target:o}:{},className:i(se({variant:"primary"}),"flex h-9 w-full items-center justify-center whitespace-nowrap rounded-lg border px-4 text-sm"),children:t}):a?U(te,{onClick:a,text:t,variant:"primary",className:"h-9"}):null)]})}function jb({title:e,cta:t,href:r}){return Ye("div",{className:"max-w-xs px-4 py-2 text-center text-sm text-neutral-700",children:[e,t&&r&&Ye(ss,{children:[" ",U("a",{href:r,target:"_blank",rel:"noopener noreferrer",onClick:o=>o.stopPropagation(),className:"inline-flex text-neutral-500 underline underline-offset-4 hover:text-neutral-800",children:t})]})]})}function Kb({children:e,className:t,tooltipClassName:r}){return U("div",{className:i("block max-w-xs whitespace-pre-wrap text-balance px-4 py-2 text-center text-sm text-neutral-700",r),children:U(os,{as:"p",options:{target:"_blank",rel:"noopener noreferrer nofollow",className:i("underline underline-offset-4 text-neutral-400 hover:text-neutral-700",t)},children:e})})}function Yb(e){return U(Q,{...e,children:U(as,{className:"h-4 w-4 text-neutral-500"})})}function Zb({value:e,unit:t="total clicks",prefix:r,children:o,lastClicked:a}){return(!e||e<1e3)&&!a?o:U(Q,{content:Ye("div",{className:"block max-w-xs px-4 py-2 text-center text-sm text-neutral-700",children:[Ye("p",{className:"text-sm font-semibold text-neutral-700",children:[r,Qt(e||0,{full:!0})," ",t]}),a&&Ye("p",{className:"mt-1 text-xs text-neutral-500",suppressHydrationWarning:!0,children:["Last clicked ",Qo(a,{withAgo:!0})]})]}),children:o})}function qb({children:e,content:t,...r}){return U(Q,{content:t,...r,children:U("div",{className:"flex cursor-pointer items-center",children:U(fr,{variant:"gray",className:"border-neutral-300 transition-all hover:bg-neutral-200",children:e})})})}function Xb({children:e,tooltipProps:t,...r}){return U(Q,{...t,children:U("button",{type:"button",...r,className:i("flex h-6 w-6 items-center justify-center rounded-md text-neutral-500 transition-colors duration-75 hover:bg-neutral-100 active:bg-neutral-200 disabled:cursor-not-allowed disabled:hover:bg-transparent",r.className),children:e})})}function ut({children:e,tooltipProps:t}){return t?U(Q,{...t,children:U("div",{children:e})}):e}import{jsx as pt,jsxs as Xa}from"react/jsx-runtime";var se=ls("transition-all",{variants:{variant:{primary:"border-black bg-black dark:bg-white dark:border-white text-content-inverted hover:bg-inverted hover:ring-4 hover:ring-border-subtle",secondary:i("border-border-subtle bg-white dark:bg-black text-content-emphasis hover:bg-bg-muted focus-visible:border-border-emphasis outline-none","data-[state=open]:border-border-emphasis data-[state=open]:ring-4 data-[state=open]:ring-border-subtle"),outline:"border-transparent text-content-default hover:bg-bg-subtle",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"}}),te=cs(({text:e,variant:t="primary",className:r,textWrapperClassName:o,shortcutClassName:a,loading:n,icon:c,shortcut:s,disabledTooltip:m,right:d,...l},u)=>m?pt(Q,{content:m,children:Xa("div",{className:i("flex h-10 w-full cursor-not-allowed items-center justify-center gap-x-2 rounded-md border border-neutral-200 bg-neutral-100 px-4 text-sm text-neutral-400 transition-all focus:outline-none",{"border-transparent bg-transparent":t==null?void 0:t.endsWith("outline")},r),children:[c,e&&pt("div",{className:i("min-w-0 truncate",s&&"flex-1 text-left",o),children:e}),s&&pt("kbd",{className:i("hidden rounded border border-neutral-200 bg-neutral-100 px-2 py-0.5 text-xs font-light text-neutral-400 md:inline-block",{"bg-neutral-100":t==null?void 0:t.endsWith("outline")},a),children:s})]})}):Xa("button",{ref:u,type:l.onClick?"button":"submit",className:i("group flex h-10 w-full items-center justify-center gap-2 whitespace-nowrap rounded-md border px-4 text-sm",l.disabled||n?"cursor-not-allowed border-neutral-200 bg-neutral-100 text-neutral-400 outline-none":se({variant:t}),r),disabled:l.disabled||n,...l,children:[n?pt(Pe,{}):c||null,e&&pt("div",{className:i("min-w-0 truncate",s&&"flex-1 text-left",o),children:e}),s&&pt("kbd",{className:i("hidden rounded px-2 py-0.5 text-xs font-light transition-all duration-75 md:inline-block",{"bg-neutral-700 text-neutral-400 group-hover:bg-neutral-600 group-hover:text-neutral-300":t==="primary","bg-neutral-200 text-neutral-400 group-hover:bg-neutral-100 group-hover:text-neutral-500":t==="secondary","bg-neutral-100 text-neutral-500 group-hover:bg-neutral-200":t==="outline","bg-red-100 text-red-600 group-hover:bg-red-500 group-hover:text-white":t==="danger-outline"},a),children:s}),d]}));te.displayName="Button";import{cva as ds}from"class-variance-authority";import{createContext as ms}from"react";import{jsx as Ja}from"react/jsx-runtime";var us=ds("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"}}}),Tt=ms({variant:"loose",loading:!1});function Qa({variant:e="loose",loading:t=!1,className:r,children:o}){return Ja("ul",{className:i(us({variant:e,loading:t}),r),"data-variant":e,children:Ja(Tt.Provider,{value:{variant:e,loading:t},children:o})})}import{cva as ps}from"class-variance-authority";import{createContext as fs,useContext as gs,useEffect as bs,useRef as hs,useState as vs}from"react";import{jsx as en,jsxs as Ns}from"react/jsx-runtime";var xs=ps("w-full group/card border-neutral-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-neutral-50 transition-colors",loose:"border rounded-xl transition-[filter] data-[hover-state-enabled=true]:hover:drop-shadow-card-hover"}}}),ys="w-full py-2.5 px-4",Qr=fs({hovered:!1});function tn({outerClassName:e,innerClassName:t,children:r,onClick:o,onAuxClick:a,hoverStateEnabled:n=!0,banner:c}){let{variant:s}=gs(Tt),m=hs(null),[d,l]=vs(!1);bs(()=>{if(!d||!m.current)return;let p=setInterval(()=>{var f;((f=m.current)==null?void 0:f.matches(":hover"))===!1&&l(!1)},1e3);return()=>clearInterval(p)},[d]);let u=p=>!(document.getElementById("modal-backdrop")||Ke(p));return Ns("li",{ref:m,className:i(xs({variant:s}),e),onPointerEnter:()=>l(!0),onPointerLeave:()=>l(!1),"data-hover-state-enabled":n,children:[c,en("div",{className:i(ys,t),onClick:o?p=>{u(p)&&o(p)}:void 0,onAuxClick:a?p=>{u(p)&&a(p)}:void 0,children:en(Qr.Provider,{value:{hovered:d},children:r})})]})}var N1=Object.assign(Qa,{Card:Object.assign(tn,{Context:Qr}),Context:Tt});import{motion as ul}from"framer-motion";import{forwardRef as pl,useRef as fl}from"react";import{useEffect as ws,useState as Cs}from"react";function rn(e){if(typeof window>"u")return null;let t=window.localStorage.getItem(e);return t?JSON.parse(t):null}function eo(e,t){let[r,o]=Cs(rn(e)??t);return ws(()=>{let n=rn(e);n&&o(n)},[e]),[r,n=>{o(n),window.localStorage.setItem(e,JSON.stringify(n))}]}function ks(e){return e&&typeof e=="object"&&Array.isArray(e.all)&&Array.isArray(e.defaultVisible)}function S1(e,t){if(!ks(t)){let o=t,a=m=>{let d=o[m];return Object.fromEntries(d.all.map(l=>[l,d.defaultVisible.includes(l)]))},n=Object.fromEntries(Object.keys(o).map(m=>[m,a(m)])),[c,s]=eo(e,n);return{columnVisibility:c,setColumnVisibility:(m,d)=>{let l=o[m].all,u=c[m]||{},p=Object.fromEntries(l.map(f=>[f,f in d?d[f]:u[f]??!1]));s({...c,[m]:p})}}}else{let o=t,a=Object.fromEntries(o.all.map(s=>[s,o.defaultVisible.includes(s)])),[n,c]=eo(e,a);return{columnVisibility:n,setColumnVisibility:s=>{let m=o.all,d=n||{},l=Object.fromEntries(m.map(u=>[u,u in s?s[u]:d[u]??!1]));c(l)}}}}import to from"js-cookie";import{useEffect as Ps,useState as Ss}from"react";function M1(e,t,r){let[o,a]=Ss(()=>{let c=to.get(e);return c?JSON.parse(c):t});return Ps(()=>{let c=()=>{let s=to.get(e);s&&a(JSON.parse(s))};return window.addEventListener("storage",c),()=>{window.removeEventListener("storage",c)}},[e]),[o,c=>{a(c),to.set(e,JSON.stringify(c),r)}]}import{useCallback as Rs,useEffect as Ts,useRef as Ls,useState as Ms}from"react";var ft=(e=3e3)=>{let t=Ls(null),[r,o]=Ms(!1),a=()=>{t.current&&(clearTimeout(t.current),t.current=null)},n=Rs(async(c,{onSuccess:s,throwOnError:m}={})=>{a();try{typeof c=="string"?await navigator.clipboard.writeText(c):c instanceof ClipboardItem&&await navigator.clipboard.write([c]),o(!0),s==null||s(),Number.isFinite(e)&&e>=0&&(t.current=setTimeout(()=>o(!1),e))}catch(d){if(console.error("Failed to copy: ",d),m)throw d}},[e]);return Ts(()=>()=>a(),[]),[r,n]};import{useEffect as Ds,useState as Es}from"react";function O1(){let[e,t]=Es(null);return Ds(()=>{let r=document.querySelector("[data-mdx-container]");if(!r)return;let o=r.offsetTop-1,a=new IntersectionObserver(s=>{var u,p,f;let m=s[0];if(!m)return;let d=(((u=m.rootBounds)==null?void 0:u.height)||0)*.3+o;for(let g=1;g<s.length;g++){let h=s[g];if(!h)break;(h.boundingClientRect.top<m.boundingClientRect.top||m.boundingClientRect.bottom<o)&&(m=h)}let l=m.target;for(;l&&l.getBoundingClientRect().bottom<o;)l=(p=n.get(l))==null?void 0:p.next;for(;l&&l.getBoundingClientRect().top>d;)l=(f=n.get(l))==null?void 0:f.prev;l&&t(l.getAttribute("href"))},{threshold:1,rootMargin:`-${o}px 0px 0px 0px`}),n=new Map;return(r==null?void 0:r.querySelectorAll("[data-mdx-heading]")).forEach(s=>a.observe(s)),()=>{a.disconnect()}},[]),e==null?void 0:e.replace("#","")}import{useEffect as Is,useState as As}from"react";function _1(){let[e,t]=As(null);return Is(()=>{let r=window.location.hostname;ta.has(r)?t("app"):oa.has(r)?t("partners"):ra.has(r)&&t("admin")},[]),{subdomain:e}}import{useCallback as Os}from"react";function $1(e){return{handleKeyDown:Os(r=>{if(r.key==="Enter"&&r.metaKey){if(r.preventDefault(),e!=null&&e.current){e.current.requestSubmit();return}let o=r.target.form;o==null||o.requestSubmit()}},[])}}import{useEffect as zs,useState as Vs}from"react";function K1(e,t={}){let{root:r,defaultValue:o}=t,[a,n]=Vs(o??!1);return zs(()=>{let c=()=>{let m=e.current;if(!m)return;let d=r==null?void 0:r.current,l=m.getBoundingClientRect(),u=d?d.getBoundingClientRect():{top:0,left:0,bottom:window.innerHeight,right:window.innerWidth};n(l.top<u.bottom&&l.bottom>u.top&&l.left<u.right&&l.right>u.left)};((r==null?void 0:r.current)||window).addEventListener("scroll",c),window.addEventListener("resize",c);let s=null;return e.current&&(s=new IntersectionObserver(c),s.observe(e.current)),c(),()=>{((r==null?void 0:r.current)||window).removeEventListener("scroll",c),window.removeEventListener("resize",c),s==null||s.disconnect()}},[e,r]),a}import{useEffect as Hs,useState as _s}from"react";function q1(){let[e,t]=_s(!1);return Hs(()=>{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 Fs,useState as Ws}from"react";function eh(e,{threshold:t=0,root:r=null,rootMargin:o="0%",freezeOnceVisible:a=!1}={}){let[n,c]=Ws(),s=(n==null?void 0:n.isIntersecting)&&a,m=([d])=>{c(d)};return Fs(()=>{let d=e==null?void 0:e.current;if(!!!window.IntersectionObserver||s||!d)return;let u={threshold:t,root:r,rootMargin:o},p=new IntersectionObserver(m,u);return p.observe(d),()=>p.disconnect()},[e,JSON.stringify(t),r,o,s]),n}import{createContext as Bs,useCallback as $s,useContext as Us,useEffect as on,useId as Gs,useState as js}from"react";import{jsx as Ks}from"react/jsx-runtime";var an=Bs({listeners:[],setListeners:()=>{}});function ih({children:e}){let[t,r]=js([]);return Ks(an.Provider,{value:{listeners:t,setListeners:r},children:e})}function Ie(e,t,r={}){let o=Gs(),{listeners:a,setListeners:n}=Us(an),c=$s(s=>{if(r.enabled===!1)return;let m=s.target,d=document.getElementById("modal-backdrop"),l=document.querySelector("[data-sheet-overlay]");if(m.tagName==="INPUT"||m.tagName==="TEXTAREA"||!!d!=!!r.modal||!!l!=!!r.sheet)return;let u=[...s.metaKey?["meta"]:[],...s.ctrlKey?["ctrl"]:[],...s.altKey?["alt"]:[],s.key].join("+");if(Array.isArray(e)?!e.includes(u):u!==e)return;let p=a.filter(g=>g.enabled!==!1&&!!d==!!g.modal&&!!l==!!g.sheet&&(Array.isArray(g.key)?g.key.includes(u):g.key===u));!p.length||Jo(p,(g,h)=>(h.priority??0)-(g.priority??0))[0].id!==o||(s.preventDefault(),t(s))},[e,a,o,t,r.enabled,r.modal,r.sheet]);on(()=>(document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)),[c]),on(()=>(n(s=>[...s.filter(m=>m.id!==o),{id:o,key:e,...r}]),()=>n(s=>s.filter(m=>m.id!==o))),[JSON.stringify(e),r.enabled,r.priority])}import{toast as Ys}from"sonner";import Zs from"swr";function mh(e,t){let{data:r,isLoading:o,mutate:a}=Zs(e,be);return{data:r,isLoading:o,update:async(n,c)=>Ys.promise(a(n(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 cn,useMemo as tl}from"react";import{useEffect as nn,useState as qs}from"react";function sn({pageSize:e,page:t,onPageChange:r}){let[o,a]=qs({pageIndex:t,pageSize:e});return nn(()=>{a(n=>({...n,pageIndex:t}))},[t]),nn(()=>{r==null||r(o.pageIndex)},[o]),{pagination:o,setPagination:a}}import{usePathname as Xs,useRouter as Js,useSearchParams as Qs}from"next/navigation";import{useCallback as el}from"react";function ln(){let e=Xs(),t=Js(),r=Qs(),o=Object.fromEntries(r),a=(c,s)=>{let m=new URLSearchParams(r);if((s==null?void 0:s.include)&&Array.isArray(s.include)){let l=new URLSearchParams;r.forEach((u,p)=>{var f;(f=s.include)!=null&&f.includes(p)&&l.set(p,u)}),m=l}(s==null?void 0:s.exclude)&&Array.isArray(s.exclude)&&s.exclude.forEach(l=>m.delete(l)),c&&Object.entries(c).forEach(([l,u])=>m.set(l,u));let d=m.toString();return d.length>0?`?${d}`:""},n=el(({set:c,del:s,replace:m,scroll:d=!0,getNewPath:l,arrayDelimiter:u=","})=>{let p=new URLSearchParams(r);c&&Object.entries(c).forEach(([h,v])=>p.set(h,Array.isArray(v)?v.join(u):v)),s&&(Array.isArray(s)?s.forEach(h=>p.delete(h)):p.delete(s));let f=p.toString(),g=`${e}${f.length>0?`?${f}`:""}`;if(l)return g;m?t.replace(g,{scroll:!1}):t.push(g,{scroll:d})},[r,e,t]);return{pathname:e,router:t,searchParams:r,searchParamsObj:o,queryParams:n,getQueryString:a}}function Ch(e=ia){let{searchParams:t,queryParams:r}=ln(),o=tl(()=>parseInt(t.get("page")||"1")||1,[t.get("page")]),{pagination:a,setPagination:n}=sn({pageSize:e,page:o,onPageChange:c=>{r(c===1?{del:"page",scroll:!1}:{set:{page:c.toString()},scroll:!1})}});return cn(()=>{let c=parseInt(t.get("page")||"1")||1;n(s=>({...s,pageIndex:c}))},[t.get("page")]),cn(()=>{r(a.pageIndex===1?{del:"page",scroll:!1}:{set:{page:a.pageIndex.toString()},scroll:!1})},[a]),{pagination:a,setPagination:n}}import{useEffect as rl}from"react";function Sh(){rl(()=>{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 ol,useState as al}from"react";function gr(e){let[t,r]=al(),o=([a])=>{r(a)};return ol(()=>{let a=e==null?void 0:e.current;if(!a)return;let n=new ResizeObserver(o);return n.observe(a),()=>n.disconnect()},[e]),t}import{useCallback as nl,useEffect as dn,useState as il}from"react";function mn(e,{container:t}={}){let[r,o]=il(!1),a=nl(()=>{o((t!=null&&t.current?t.current.scrollTop:window.scrollY)>e)},[e]);return dn(()=>{let n=(t==null?void 0:t.current)??window;return n.addEventListener("scroll",a),()=>n.removeEventListener("scroll",a)},[a]),dn(()=>{a()},[a]),r}import{useCallback as sl,useEffect as ll,useState as cl}from"react";function Ae(e){let[t,r]=cl(1),o=sl(()=>{if(!e.current)return;let{scrollTop:n,scrollHeight:c,clientHeight:s}=e.current;r(c===s?1:Math.min(n/(c-s),1))},[]),a=gr(e);return ll(o,[a]),{scrollProgress:t,updateScrollProgress:o}}import{useEffect as dl}from"react";import{toast as pn}from"sonner";import{jsx as br,jsxs as un}from"react/jsx-runtime";function ml({id:e,message:t,undo:r}){let o=()=>{r(),pn.dismiss(e)},a=n=>{n.key==="z"&&(n.ctrlKey||n.metaKey)&&o()};return dl(()=>(document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)),[]),un("div",{className:"flex w-full items-center justify-between space-x-2",children:[un("div",{className:"flex items-center space-x-2",children:[br(ua,{}),br("p",{className:"font-medium",children:t})]}),br("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 Wh(){return({id:t,message:r,undo:o,duration:a})=>pn(br(ml,{id:t,message:r,undo:o}),{id:t,...a&&{duration:a}})}import{jsx as fn}from"react/jsx-runtime";var pe=pl(({width:e=!1,height:t=!1,className:r,transition:o,children:a,...n},c)=>{var d,l;let s=fl(null),m=gr(s);return fn(ul.div,{ref:c,className:i("overflow-hidden",r),animate:{width:e?((d=m==null?void 0:m.contentRect)==null?void 0:d.width)??"auto":"auto",height:t?((l=m==null?void 0:m.contentRect)==null?void 0:l.height)??"auto":"auto"},transition:o??{type:"spring",duration:.3},...n,children:fn("div",{ref:s,className:i(t&&"h-max",e&&"w-max"),children:a})})});pe.displayName="AnimatedSizeContainer";import{jsx as Se,jsxs as gn}from"react/jsx-runtime";function Qh({options:e,value:t,onChange:r,className:o,gridCols:a="2",name:n,disabled:c=!1,animated:s=!0}){let m={1:"grid-cols-1",2:"grid-cols-1 lg:grid-cols-2",3:"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}[a],d=Se("div",{className:i("grid gap-3",m),children:e.map(({key:l,label:u,description:p,icon:f})=>{let g=t===l;return gn("label",{className:i("relative flex w-full cursor-pointer items-start rounded-md border border-neutral-200 bg-white text-neutral-600 hover:bg-neutral-50","transition-all duration-150",g&&"border-black bg-neutral-50 text-neutral-900 ring-1 ring-black",c&&"cursor-not-allowed opacity-50",o),children:[Se("input",{type:"radio",name:n,value:l,className:"hidden",checked:g,disabled:c,onChange:h=>{h.target.checked&&r&&r(l)}}),f&&Se("div",{className:"flex-shrink-0 pt-0.5",children:f}),gn("div",{className:"flex grow flex-col p-3 pr-0",children:[Se("span",{className:"pr-1 text-sm font-semibold text-neutral-900",children:u}),Se("span",{className:"text-xs text-neutral-600",children:p})]}),Se(Sa,{className:i("mr-1.5 mt-1.5 flex size-4 scale-75 items-center justify-center rounded-full opacity-0 transition-[transform,opacity] duration-150",g&&"scale-100 opacity-100")})]},l)})});return s?Se("div",{className:"-m-1",children:Se(pe,{height:!0,transition:{ease:"easeInOut",duration:.2},children:Se("div",{className:"p-1",children:d})})}):d}import gl from"embla-carousel-autoplay";import bl from"embla-carousel-react";import{ArrowLeft as hl,ArrowRight as vl}from"lucide-react";import{createContext as xl,forwardRef as Mt,useCallback as Lt,useContext as yl,useEffect as ro,useState as oo}from"react";import{jsx as Re,jsxs as vn}from"react/jsx-runtime";var ao=2e3,bn=xl(null);function ve(){let e=yl(bn);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}function hn(){let{api:e}=ve(),[t,r]=oo(0),o=Lt(a=>r((a==null?void 0:a.selectedScrollSnap())??0),[]);return ro(()=>{!e||(o(e),e.on("reInit",o),e.on("select",o))},[e,o]),t}var Nl=Mt(({orientation:e="horizontal",opts:t,setApi:r,autoplay:o,plugins:a,className:n,children:c,...s},m)=>{let[d,l]=bl({...t,axis:e==="horizontal"?"x":"y"},[...o?[gl(typeof o=="object"?o:{delay:ao})]:[],...a||[]]),[u,p]=oo(!1),[f,g]=oo(!1),h=Lt(N=>{!N||(p(N.canScrollPrev()),g(N.canScrollNext()))},[]),v=Lt(()=>{l==null||l.scrollPrev()},[l]),y=Lt(()=>{l==null||l.scrollNext()},[l]),w=Lt(N=>{N.key==="ArrowLeft"?(N.preventDefault(),v()):N.key==="ArrowRight"&&(N.preventDefault(),y())},[v,y]);return ro(()=>{!l||!r||r(l)},[l,r]),ro(()=>{if(!!l)return h(l),l.on("reInit",h),l.on("select",h),()=>{l==null||l.off("select",h)}},[l,h]),Re(bn.Provider,{value:{carouselRef:d,api:l,opts:t,orientation:e||((t==null?void 0:t.axis)==="y"?"vertical":"horizontal"),scrollPrev:v,scrollNext:y,canScrollPrev:u,canScrollNext:f},children:Re("div",{ref:m,onKeyDownCapture:w,className:i("relative",n),role:"region","aria-roledescription":"carousel",...s,children:c})})});Nl.displayName="Carousel";var wl=Mt(({className:e,...t},r)=>{let{carouselRef:o,orientation:a}=ve();return Re("div",{ref:o,className:"overflow-hidden",children:Re("div",{ref:r,className:i("flex",a==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})});wl.displayName="CarouselContent";var Cl=Mt(({className:e,...t},r)=>{let{orientation:o}=ve();return Re("div",{ref:r,role:"group","aria-roledescription":"slide",className:i("min-w-0 shrink-0 grow-0 basis-full",o==="horizontal"?"pl-4":"pt-4",e),...t})});Cl.displayName="CarouselItem";var kl=Mt(({className:e,...t},r)=>{let{orientation:o,scrollPrev:a,canScrollPrev:n}=ve();return vn("button",{ref:r,className:i("absolute",o==="horizontal"?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",se({variant:"secondary",className:"p-2"}),e),disabled:!n,onClick:a,...t,children:[Re(hl,{className:"h-4 w-4"}),Re("span",{className:"sr-only",children:"Previous slide"})]})});kl.displayName="CarouselPrevious";var Pl=Mt(({className:e,...t},r)=>{let{orientation:o,scrollNext:a,canScrollNext:n}=ve();return vn("button",{ref:r,className:i("absolute",o==="horizontal"?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",se({variant:"secondary",className:"p-2"}),e),disabled:!n,onClick:a,...t,children:[Re(vl,{className:"h-4 w-4"}),Re("span",{className:"sr-only",children:"Next slide"})]})});Pl.displayName="CarouselNext";import{cva as Sl}from"class-variance-authority";import{motion as Rl}from"framer-motion";import{ChevronLeft as Tl,ChevronRight as Ll}from"lucide-react";import*as Oe from"react";import{jsx as Ze,jsxs as Dt}from"react/jsx-runtime";var Ml=Sl("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-neutral-800/10 bg-white sm:bottom-6 "}}}),hv=({variant:e="simple",className:t})=>{var g;let{scrollNext:r,scrollPrev:o,canScrollNext:a,canScrollPrev:n,api:c}=ve(),s=(g=c==null?void 0:c.plugins())==null?void 0:g.autoplay,[m,d]=Oe.useState(0),[l,u]=Oe.useState(!1),p=Oe.useCallback(h=>{d((h==null?void 0:h.selectedScrollSnap())??0)},[]),f=Oe.useCallback(h=>()=>{s&&s.isPlaying()&&s.stop(),h()},[s]);return Oe.useEffect(()=>{!c||(p(c),u((s==null?void 0:s.isPlaying())??!1),c.on("reInit",p),c.on("select",p),c.on("autoplay:play",()=>u(!0)),c.on("autoplay:stop",()=>u(!1)))},[c,s,p]),Dt("div",{className:i(Ml({variant:e}),t),children:[e!=="simple"&&Dt("button",{className:"cursor-pointer rounded-full p-2 hover:bg-neutral-50 active:bg-neutral-100",disabled:!n,onClick:f(o),children:[Ze(Tl,{className:"h-4 w-4"}),Ze("span",{className:"sr-only",children:"Previous slide"})]}),c!=null&&Ze("div",{className:"flex items-center gap-1",children:c.slideNodes().map((h,v)=>Dt("button",{onClick:f(()=>c.scrollTo(v)),className:"rounded-full p-0.5 hover:bg-neutral-100 active:bg-neutral-200 sm:p-1.5",children:[Ze("div",{className:i("relative isolate h-1.5 w-1.5 overflow-hidden rounded-full transition-all",v===m?"bg-black":"bg-black/20",l&&v===m&&"w-6 bg-black/20"),children:l&&v===m&&Ze(Rl.div,{initial:{x:"-100%"},animate:{x:0},transition:{type:"tween",duration:((s==null?void 0:s.options.delay)??ao)/1e3},className:"animate-fill-width h-full w-full rounded-full bg-black"})}),Dt("span",{className:"sr-only",children:["Slide ",v+1]})]},v))}),e!=="simple"&&Dt("button",{className:"cursor-pointer rounded-full p-2 hover:bg-neutral-50 active:bg-neutral-100",disabled:!a,onClick:f(r),children:[Ze(Ll,{className:"h-4 w-4"}),Ze("span",{className:"sr-only",children:"Next slide"})]})]})};import Dl from"embla-carousel-react";import{forwardRef as El,useCallback as Il,useEffect as Al}from"react";import{jsx as hr}from"react/jsx-runtime";var Sv=({className:e,...t})=>{let{api:r}=ve(),[o,a]=Dl({dragFree:!0}),n=Il(c=>{!c||!a||a==null||a.scrollTo(c.selectedScrollSnap())},[a]);return Al(()=>{if(!(!r||!a))return n(r),r.on("reInit",n),r.on("select",n),()=>{r==null||r.off("reInit",n),r==null||r.off("select",n)}},[r,a,n]),hr("div",{className:"overflow-hidden",ref:o,children:hr("div",{className:i("mx-4 flex gap-4",e),...t})})},Rv=El(({index:e,className:t,...r},o)=>{let{api:a}=ve(),n=hn();return hr("div",{ref:o,children:hr("button",{type:"button",onClick:()=>{var s;if(!a)return;let c=(s=a.plugins())==null?void 0:s.autoplay;c&&c.isPlaying()&&c.stop(),a.scrollTo(e)},className:typeof t=="function"?t({active:e===n}):t,...r})})});import*as Et from"@radix-ui/react-checkbox";import{forwardRef as Ol}from"react";import{jsx as no,jsxs as zl}from"react/jsx-runtime";var gt=Ol(({className:e,...t},r)=>no(Et.Root,{ref:r,className:i("peer h-5 w-5 shrink-0 rounded-md border border-neutral-200 bg-white outline-none focus-visible:border-black disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-500 data-[state=indeterminate]:bg-blue-500",e),...t,children:zl(Et.Indicator,{className:"group/indicator flex items-center justify-center text-white",children:[no(ir,{className:"size-3 group-data-[state=indeterminate]/indicator:hidden"}),no(dr,{className:"size-3 group-data-[state=checked]/indicator:hidden"})]})}));gt.displayName=Et.Root.displayName;import{Command as At,CommandInput as Vl,CommandItem as Hl,useCommandState as _l}from"cmdk";import{ChevronDown as Fl}from"lucide-react";import{forwardRef as Wl,isValidElement as Bl,useCallback as $l,useEffect as xr,useRef as Ul,useState as It}from"react";import*as ze from"@radix-ui/react-popover";import{Drawer as bt}from"vaul";import{jsx as Te,jsxs as vr}from"react/jsx-runtime";function xe({children:e,content:t,align:r="center",side:o="bottom",openPopover:a,setOpenPopover:n,mobileOnly:c,popoverContentClassName:s,onOpenAutoFocus:m,collisionBoundary:d,sticky:l,onEscapeKeyDown:u,onWheel:p}){let{isMobile:f}=Y();return c||f?vr(bt.Root,{open:a,onOpenChange:n,children:[Te(bt.Trigger,{className:"sm:hidden",asChild:!0,children:e}),vr(bt.Portal,{children:[Te(bt.Overlay,{className:"bg-bg-subtle fixed inset-0 z-50 bg-opacity-10 backdrop-blur"}),vr(bt.Content,{className:"border-border-subtle bg-bg-default fixed bottom-0 left-0 right-0 z-50 mt-24 rounded-t-[10px] border-t",onEscapeKeyDown:u,onPointerDownOutside:g=>{g.target instanceof Element&&g.target.closest("[data-sonner-toast]")&&g.preventDefault()},children:[Te("div",{className:"sticky top-0 z-20 flex w-full items-center justify-center rounded-t-[10px] bg-inherit",children:Te("div",{className:"bg-border-default my-3 h-1 w-12 rounded-full"})}),Te("div",{className:"bg-bg-default flex min-h-[150px] w-full items-center justify-center overflow-hidden pb-8 align-middle shadow-xl",children:t})]}),Te(bt.Overlay,{})]})]}):vr(ze.Root,{open:a,onOpenChange:n,children:[Te(ze.Trigger,{className:"sm:inline-flex",asChild:!0,children:e}),Te(ze.Portal,{children:Te(ze.Content,{sideOffset:8,align:r,side:o,className:i("animate-slide-up-fade border-border-subtle bg-bg-default z-50 items-center rounded-lg border drop-shadow-lg sm:block",s),sticky:l,collisionBoundary:d,onOpenAutoFocus:m,onEscapeKeyDown:u,onWheel:p,children:t})})]})}import{Fragment as yr,jsx as E,jsxs as Le}from"react/jsx-runtime";function Gl(e,t){return e===!0}function Qv({multiple:e,selected:t,setSelected:r,onSelect:o,options:a,icon:n,placeholder:c="Select...",searchPlaceholder:s="Search...",emptyState:m,createLabel:d,onCreate:l,buttonProps:u,shortcutHint:p,caret:f,side:g,open:h,onOpenChange:v,onSearchChange:y,shouldFilter:w=!0,inputRight:N,inputClassName:k,optionRight:C,optionClassName:A,matchTriggerWidth:W,hideSearch:T=!1,children:P}){let G=Gl(e,r),x=Array.isArray(t)?t:t?[t]:[],{isMobile:S}=Y(),[R,L]=It(!1),X=h??R,M=v??L,[ge,Ur]=It(""),[Ko,Gr]=It(!1),[jr,Hi]=It(void 0),[_i,Yo]=It(!1),Fi=V=>{var st;if(o==null||o(V),!!r)if(G){let Ge=x.some(({value:je})=>je===V.value);r(Ge?x.filter(({value:je})=>je!==V.value):[...x,V])}else r(x.length&&((st=x[0])==null?void 0:st.value)===V.value?null:V),M(!1)},Zo=$l((V,st)=>st===""?[...V.filter(Ge=>Ge.first&&!x.some(je=>je.value===Ge.value)),...x,...V.filter(Ge=>!Ge.first&&!x.some(je=>je.value===Ge.value))]:V,[x]);return xr(()=>{Ko&&(Hi(a&&Zo(a,ge)),Gr(!1))},[Ko,a,Zo,ge]),xr(()=>{Gr(!0)},[a]),xr(()=>{X||(Ur(""),Gr(!0))},[X]),xr(()=>y==null?void 0:y(ge),[ge]),E(xe,{openPopover:X,setOpenPopover:M,align:"start",side:g,onWheel:V=>{V.stopPropagation()},popoverContentClassName:i(W&&"sm:w-[var(--radix-popover-trigger-width)]"),content:E(pe,{width:!S&&!W,height:!0,style:{transform:"translateZ(0)"},transition:{ease:"easeInOut",duration:.1},className:"pointer-events-auto",children:Le(At,{loop:!0,shouldFilter:w,children:[!T&&Le("div",{className:"flex items-center overflow-hidden rounded-t-lg border-b border-neutral-200",children:[E(Vl,{placeholder:s,value:ge,onValueChange:Ur,className:i("grow border-0 py-3 pl-4 pr-2 outline-none placeholder:text-neutral-400 focus:ring-0 sm:text-sm",k),onKeyDown:V=>{(V.key==="Escape"||V.key==="Backspace"&&!ge)&&(V.preventDefault(),V.stopPropagation(),M(!1))}}),N&&E("div",{className:"mr-2",children:N}),p&&E("kbd",{className:"mr-2 hidden shrink-0 rounded border border-neutral-200 bg-neutral-100 px-2 py-0.5 text-xs font-light text-neutral-500 md:block",children:p})]}),E(jl,{children:E(At.List,{className:i("flex w-full min-w-[100px] flex-col gap-1 p-1"),children:jr!==void 0?Le(yr,{children:[jr.map(V=>E(Kl,{option:V,multiple:G,selected:x.some(({value:st})=>st===V.value),onSelect:()=>Fi(V),right:C==null?void 0:C(V),className:A},`${V.label}, ${V.value}`)),ge.length>0&&l&&Le(Hl,{className:i("flex cursor-pointer items-center gap-3 whitespace-nowrap rounded-md px-3 py-2 text-left text-sm text-neutral-700","data-[selected=true]:bg-neutral-100",A),onSelect:async()=>{Yo(!0),await(l==null?void 0:l(ge))&&(Ur(""),M(!1)),Yo(!1)},children:[_i?E(Pe,{className:"size-4 shrink-0"}):E(mt,{className:"size-4 shrink-0"}),E("div",{className:"grow truncate",children:(d==null?void 0:d(ge))||`Create "${ge}"`})]}),w?E(Zl,{className:"flex min-h-12 items-center justify-center text-sm text-neutral-500",children:m||"No matches"}):jr.length===0?E("div",{className:"flex min-h-12 items-center justify-center text-sm text-neutral-500",children:m||"No matches"}):null]}):E(At.Loading,{children:E("div",{className:"flex h-12 items-center justify-center",children:E(Pe,{})})})})})]})}),children:E(te,{variant:"secondary",...u,className:i(u==null?void 0:u.className,"flex gap-2"),textWrapperClassName:i(u==null?void 0:u.textWrapperClassName,"w-full flex items-center justify-start"),text:Le(yr,{children:[E("div",{className:"min-w-0 grow truncate text-left",children:P||x.map(V=>V.label).join(", ")||c}),f&&(f===!0?E(Fl,{className:"ml-1 size-4 shrink-0 text-neutral-400 transition-transform duration-75 group-data-[state=open]:rotate-180"}):f)]}),icon:n?xn(n)?n:E(n,{className:"size-4 shrink-0"}):void 0})})}var jl=({children:e})=>{let t=Ul(null),{scrollProgress:r,updateScrollProgress:o}=Ae(t);return Le(yr,{children:[E("div",{className:"scrollbar-hide max-h-[min(50vh,250px)] w-screen overflow-y-scroll sm:w-auto",ref:t,onScroll:o,children:e}),E("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 Kl({option:e,onSelect:t,multiple:r,selected:o,right:a,className:n}){return Le(yr,{children:[E(Yl,{disabledTooltip:e.disabledTooltip,children:Le(At.Item,{className:i("flex cursor-pointer items-center gap-3 whitespace-nowrap rounded-md px-3 py-2 text-left text-sm","data-[selected=true]:bg-neutral-100",Boolean(e.disabledTooltip)&&"cursor-not-allowed opacity-50",n),disabled:!!e.disabledTooltip,onSelect:t,value:e.label+(e==null?void 0:e.value),children:[r&&E("div",{className:"shrink-0 text-neutral-600",children:o?E(Ca,{className:"size-4 text-neutral-600"}):E(ka,{className:"size-4 text-neutral-400"})}),Le("div",{className:"flex min-w-0 grow items-center gap-1",children:[e.icon&&E("span",{className:"shrink-0 text-neutral-600",children:xn(e.icon)?e.icon:E(e.icon,{className:"h-4 w-4"})}),E("span",{className:"grow truncate",children:e.label})]}),a,!r&&o&&E(ir,{className:"size-4 shrink-0 text-neutral-600"})]})}),e.separatorAfter&&E(At.Separator,{className:"-mx-1 my-1 h-px bg-neutral-200"})]})}var Yl=({children:e,disabledTooltip:t})=>t?E(Q,{content:t,children:E("div",{children:e})}):e,xn=e=>Bl(e),Zl=Wl((e,t)=>_l(o=>o.filtered.count===0)?E("div",{ref:t,"cmdk-empty":"",role:"presentation",...e}):null);import{addYears as Nr,format as ql,isSameMonth as Xl}from"date-fns";import{ChevronLeft as yn,ChevronRight as Nn,ChevronsLeft as Jl,ChevronsRight as Ql}from"lucide-react";import{forwardRef as ec,useRef as tc}from"react";import{DayPicker as rc,useDayPicker as oc,useDayRender as ac,useNavigation as nc}from"react-day-picker";import{Fragment as ic,jsx as oe,jsxs as wr}from"react/jsx-runtime";var Ot=ec(({onClick:e,icon:t,disabled:r,...o},a)=>oe("button",{ref:a,type:"button",disabled:r,className:i("flex size-7 shrink-0 select-none items-center justify-center rounded border p-1 outline-none transition","border-neutral-200 text-neutral-600 hover:text-neutral-800","hover:bg-neutral-50 active:bg-neutral-100","disabled:pointer-events-none disabled:text-neutral-400"),onClick:e,...o,children:oe(t,{className:"h-full w-full shrink-0"})}));Ot.displayName="NavigationButton";function wn({mode:e="single",weekStartsOn:t=0,numberOfMonths:r=1,showYearNavigation:o=!1,disableNavigation:a,locale:n,className:c,classNames:s,...m}){return oe(rc,{mode:e,weekStartsOn:t,numberOfMonths:r,locale:n,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-neutral-400 pb-2",row:"w-full",cell:"relative p-0 text-center focus-within:relative text-neutral-900",day:i("relative size-10 rounded-md text-sm text-neutral-900","hover:bg-neutral-100 active:bg-neutral-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-neutral-300 line-through disabled:hover:bg-transparent",day_outside:"text-neutral-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",...s},components:{IconLeft:()=>oe(yn,{className:"h-4 w-4"}),IconRight:()=>oe(Nn,{className:"h-4 w-4"}),Caption:({...d})=>{let{goToMonth:l,nextMonth:u,previousMonth:p,currentMonth:f,displayMonths:g}=nc(),{numberOfMonths:h,fromDate:v,toDate:y}=oc(),w=g.findIndex(P=>Xl(d.displayMonth,P)),N=w===0,k=w===g.length-1,C=h>1&&(N||!k),A=h>1&&(k||!N),W=()=>{let P=Nr(f,-1);p&&(!v||P.getTime()>=v.getTime())&&l(P)},T=()=>{let P=Nr(f,1);u&&(!y||P.getTime()<=y.getTime())&&l(P)};return wr("div",{className:"flex items-center justify-between",children:[wr("div",{className:"flex items-center gap-1",children:[o&&!A&&oe(Ot,{disabled:a||!p||v&&Nr(f,-1).getTime()<v.getTime(),"aria-label":"Go to previous year",onClick:W,icon:Jl}),!A&&oe(Ot,{disabled:a||!p,"aria-label":"Go to previous month",onClick:()=>p&&l(p),icon:yn})]}),oe("div",{role:"presentation","aria-live":"polite",className:"text-sm font-medium capitalize tabular-nums text-neutral-900",children:ql(d.displayMonth,"LLLL yyy",{locale:n})}),wr("div",{className:"flex items-center gap-1",children:[!C&&oe(Ot,{disabled:a||!u,"aria-label":"Go to next month",onClick:()=>u&&l(u),icon:Nn}),o&&!C&&oe(Ot,{disabled:a||!u||y&&Nr(f,1).getTime()>y.getTime(),"aria-label":"Go to next year",onClick:T,icon:Ql})]})]})},Day:({date:d,displayMonth:l})=>{let u=tc(null),{activeModifiers:p,buttonProps:f,divProps:g,isButton:h,isHidden:v}=ac(d,l,u),{selected:y,today:w,disabled:N,range_middle:k}=p;if(v)return oe(ic,{});if(!h)return oe("div",{...g,className:i("flex items-center justify-center",g.className)});let{children:C,...A}=f;return wr("button",{ref:u,...A,type:"button",children:[C,w&&oe("span",{className:i("absolute inset-x-1/2 bottom-1.5 h-0.5 w-4 -translate-x-1/2 rounded-[2px]",{"bg-blue-500":!y,"!bg-white":y,"!bg-blue-400":y&&k,"text-neutral-400":N})})]})}},...m})}import{enUS as hc}from"date-fns/locale";import{useEffect as uo,useMemo as kn,useRef as vc,useState as kr}from"react";import{Command as io}from"cmdk";import{Lock as sc}from"lucide-react";import{jsx as qe,jsxs as lc}from"react/jsx-runtime";var so=({presets:e,onSelect:t,currentValue:r,currentPresetId:o})=>{let a=d=>"dateRange"in d,n=d=>"date"in d,c=(d,l)=>d.getDate()===l.getDate()&&d.getMonth()===l.getMonth()&&d.getFullYear()===l.getFullYear(),s=(d,l)=>{let u=d.from,p=l.from,f=!1;u&&p&&c(u,p)&&(f=!0);let g=d.to,h=l.to,v=!1;return g&&h&&c(g,h)&&(v=!0),f&&v},m=d=>{if(o)return o===d.id;if(a(d)){let l=r;return l&&s(l,d.dateRange)}else if(n(d)){let l=r;return l&&c(l,d.date)}return!1};return qe(io,{className:"w-full rounded ring-neutral-200 ring-offset-2 focus:outline-none",tabIndex:0,autoFocus:!0,loop:!0,children:qe(io.List,{className:"[&>*]:flex [&>*]:w-full [&>*]:items-start [&>*]:gap-x-2 [&>*]:gap-y-0.5 [&>*]:sm:flex-col",children:e.map((d,l)=>lc(io.Item,{disabled:d.requiresUpgrade,onSelect:()=>t(d),title:d.label,value:d.id,className:i("group relative flex cursor-pointer items-center justify-between overflow-hidden text-ellipsis whitespace-nowrap rounded border border-neutral-200","px-2.5 py-1.5 text-left text-sm text-neutral-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-neutral-100",m(d)&&"font-semibold text-neutral-800"),children:[qe("span",{children:d.label}),d.requiresUpgrade?qe(sc,{className:"h-3.5 w-3.5","aria-hidden":"true"}):d.shortcut?qe("kbd",{className:"text-neutral-4000 hidden rounded bg-neutral-100 px-2 py-0.5 text-xs font-light group-data-[selected=true]:bg-neutral-200 md:block",children:d.shortcut.toUpperCase()}):null,d.requiresUpgrade&&d.tooltipContent&&qe(Q,{side:"bottom",content:d.tooltipContent,children:qe("div",{className:"absolute inset-0 cursor-not-allowed"})})]},l))})})};so.displayName="DatePicker.Presets";import{format as Ve}from"date-fns";import{createContext as cc}from"react";var lo=cc({isOpen:!1,setIsOpen:()=>{}}),dc=()=>{let e=typeof window<"u"?window.navigator.language:"en-US",t=new Intl.DateTimeFormat(e,{hour:"numeric"}).format();return Number.isInteger(Number(t))},co=(e,t,r=!1)=>{let o=!dc(),a;return r?a=o?Ve(e,"d MMM, yyyy h:mm a",{locale:t}):Ve(e,"d MMM, yyyy HH:mm",{locale:t}):a=Ve(e,"d MMM, yyyy",{locale:t}),a},Cn=(e,t)=>{let{toYear:r,fromYear:o,fromMonth:a,toMonth:n,fromDay:c,toDay:s}=t;if(e&&e.length>0){let m=o,d=r;e.forEach(l=>{var u,p,f,g,h,v;if("date"in l){let y=l.date.getFullYear();if(o&&y<o)throw new Error(`Preset ${l.label} is before fromYear ${m}.`);if(r&&y>r)throw new Error(`Preset ${l.label} is after toYear ${d}.`);if(a&&l.date.getMonth()<a.getMonth())throw new Error(`Preset ${l.label} is before fromMonth ${a}.`);if(n&&l.date.getMonth()>n.getMonth())throw new Error(`Preset ${l.label} is after toMonth ${n}.`);if(c&&l.date.getDate()<c.getDate())throw new Error(`Preset ${l.label} is before fromDay ${c}.`);if(s&&l.date.getDate()>s.getDate())throw new Error(`Preset ${l.label} is after toDay ${Ve(s,"MMM dd, yyyy")}.`)}if("dateRange"in l){let y=(u=l.dateRange.from)==null?void 0:u.getFullYear(),w=(p=l.dateRange.to)==null?void 0:p.getFullYear();if(y&&o&&y<o)throw new Error(`Preset ${l.label}'s 'from' is before fromYear ${m}.`);if(w&&r&&w>r)throw new Error(`Preset ${l.label}'s 'to' is after toYear ${d}.`);if(a){let N=(f=l.dateRange.from)==null?void 0:f.getMonth();if(N&&N<a.getMonth())throw new Error(`Preset ${l.label}'s 'from' is before fromMonth ${Ve(a,"MMM, yyyy")}.`)}if(n){let N=(g=l.dateRange.to)==null?void 0:g.getMonth();if(N&&N>n.getMonth())throw new Error(`Preset ${l.label}'s 'to' is after toMonth ${Ve(n,"MMM, yyyy")}.`)}if(c){let N=(h=l.dateRange.from)==null?void 0:h.getDate();if(N&&N<c.getDate())throw new Error(`Preset ${l.dateRange.from}'s 'from' is before fromDay ${Ve(c,"MMM dd, yyyy")}.`)}if(s){let N=(v=l.dateRange.to)==null?void 0:v.getDate();if(N&&N>s.getDate())throw new Error(`Preset ${l.label}'s 'to' is after toDay ${Ve(s,"MMM dd, yyyy")}.`)}}})}};import{cva as mc}from"class-variance-authority";import{Calendar as uc,ChevronDown as pc}from"lucide-react";import{forwardRef as fc}from"react";import{jsx as Cr,jsxs as bc}from"react/jsx-runtime";var gc=mc(["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-neutral-200 text-neutral-900 placeholder-neutral-400 transition-all","disabled:pointer-events-none disabled:bg-neutral-100 disabled:text-neutral-400","focus-visible:border-neutral-500 data-[state=open]:border-neutral-500 data-[state=open]:ring-4 data-[state=open]:ring-neutral-200"],{variants:{hasError:{true:"ring-2 ring-red-200 border-red-500"}}}),mo=fc(({className:e,children:t,placeholder:r,hasError:o,...a},n)=>bc("button",{ref:n,className:i(gc({hasError:o}),e),...a,children:[Cr(uc,{className:i("h-4 w-4 shrink-0 text-neutral-400",!!t&&"text-neutral-900")}),Cr("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-neutral-900",children:t||(r?Cr("span",{className:"text-neutral-400",children:r}):null)}),Cr(pc,{className:"h-4 w-4 flex-shrink-0 text-neutral-400 transition-transform duration-75 group-data-[state=open]:rotate-180"})]}));mo.displayName="DatePicker.Trigger";import{jsx as ae,jsxs as Pn}from"react/jsx-runtime";var xc=({value:e,defaultValue:t,presetId:r,onChange:o,presets:a,disabled:n,disableNavigation:c,disabledDays:s,showYearNavigation:m=!1,locale:d=hc,placeholder:l="Select date range",hasError:u,align:p="center",className:f,...g})=>{let{isDesktop:h}=Y(),[v,y]=kr(!1),[w,N]=kr(a&&r?a==null?void 0:a.find(({id:L})=>L===r):void 0),[k,C]=kr((w==null?void 0:w.dateRange)??e??t??void 0),[A,W]=kr(k==null?void 0:k.to),T=kn(()=>k,[v]);uo(()=>{C(e)},[e]),uo(()=>{let L=a==null?void 0:a.find(({id:X})=>X===r);N(L),C((L==null?void 0:L.dateRange)??e??t)},[a,r]),uo(()=>{v?k&&W(k.to):W(k==null?void 0:k.to)},[v]);let P=(L,X)=>{let M=(k==null?void 0:k.from)&&(k==null?void 0:k.to)?{from:X}:L;C(M),N(void 0),(M==null?void 0:M.from)&&(M==null?void 0:M.to)&&(o==null||o(M),y(!1))},G=L=>{C(L.dateRange),N(L),o==null||o(L.dateRange,L),y(!1)},x=()=>{C(T),y(!1)},S=L=>{L||x(),y(L)},R=kn(()=>k?`${k.from?co(k.from,d):""} - ${k.to?co(k.to,d):""}`:null,[k,d]);return Ie((a==null?void 0:a.filter(L=>L.shortcut).map(L=>L.shortcut))??[],L=>{let X=a==null?void 0:a.find(M=>M.shortcut===L.key);X&&G(X)}),ae(lo.Provider,{value:{isOpen:v,setIsOpen:y},children:ae(xe,{align:p,openPopover:v,setOpenPopover:S,popoverContentClassName:"rounded-xl",content:ae("div",{className:"flex w-full",children:Pn("div",{className:"scrollbar-hide relative flex w-full flex-col overflow-x-scroll sm:flex-row-reverse sm:items-start",children:[a&&a.length>0&&ae(yc,{children:ae("div",{className:"absolute px-3 sm:inset-0 sm:left-0",children:ae("div",{className:"sm:py-3",children:ae(so,{currentPresetId:r,currentValue:k,presets:a,onSelect:G})})})}),ae("div",{className:"scrollbar-hide overflow-x-scroll",children:ae(wn,{mode:"range",selected:k,onSelect:P,month:A,onMonthChange:W,numberOfMonths:h?2:1,disabled:s,disableNavigation:c,showYearNavigation:m,locale:d,className:"scrollbar-hide overflow-x-scroll",classNames:{months:"flex flex-row divide-x divide-neutral-200 overflow-x-scroll scrollbar-hide"},...g})})]})}),children:ae(mo,{placeholder:l,disabled:n,className:f,hasError:u,"aria-required":g.required||g["aria-required"],"aria-invalid":g["aria-invalid"],"aria-label":g["aria-label"],"aria-labelledby":g["aria-labelledby"],children:(w==null?void 0:w.label)??R})})})};function Vx({presets:e,...t}){return e&&Cn(e,t),ae(xc,{presets:e,...t})}function yc({children:e}){let t=vc(null),{scrollProgress:r,updateScrollProgress:o}=Ae(t);return Pn("div",{className:"relative sm:h-full",children:[ae("div",{ref:t,onScroll:o,className:i("relative flex h-16 w-full items-center sm:h-full sm:w-48","border-b border-neutral-200 sm:border-b-0 sm:border-l","scrollbar-hide overflow-auto"),children:e}),ae("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)}})]})}import{useId as Nc}from"react";import{jsx as Pr,jsxs as wc}from"react/jsx-runtime";function Gx({dotSize:e=2,gapSize:t=10,patternOffset:r=[0,0],className:o}){let a=Nc();return wc("svg",{className:i("pointer-events-none absolute inset-0 text-black/10",o),width:"100%",height:"100%",children:[Pr("defs",{children:Pr("pattern",{id:`dots-${a}`,x:r[0]-1,y:r[1]-1,width:e+t,height:e+t,patternUnits:"userSpaceOnUse",children:Pr("rect",{x:1,y:1,width:e,height:e,fill:"currentColor"})})}),Pr("rect",{fill:`url(#dots-${a})`,width:"100%",height:"100%"})]})}import Cc from"next/link";import{useEffect as kc,useState as Sn}from"react";import Pc from"swr";import{jsx as po,jsxs as Rn}from"react/jsx-runtime";function Tn({className:e}){let{data:t}=Pc("https://status.dub.co/api/v1/summary",be),[r,o]=Sn("bg-neutral-200"),[a,n]=Sn("Loading status...");return kc(()=>{if(!t)return;let{ongoing_incidents:c}=t;if(c.length>0){let{current_worst_impact:s,name:m}=c[0],d=s==="degraded_performance"?"bg-yellow-500":"bg-red-500";n(m),o(d)}else n("All systems operational"),o("bg-green-500")},[t]),Rn(Cc,{href:"https://status.dub.co",target:"_blank",className:i("group flex max-w-fit items-center gap-2 rounded-lg border border-neutral-200 bg-white py-2 pl-2 pr-2.5 transition-colors hover:bg-neutral-50 active:bg-neutral-100",e),children:[Rn("div",{className:"relative size-2",children:[po("div",{className:i("absolute inset-0 m-auto size-2 animate-ping items-center justify-center rounded-full group-hover:animate-none",r,a==="Loading status..."&&"animate-none")}),po("div",{className:i("absolute inset-0 z-10 m-auto size-2 rounded-full",r)})]}),po("p",{className:"text-xs font-medium leading-none text-neutral-600",children:a})]})}import{jsx as Sr,jsxs as Ln}from"react/jsx-runtime";function Qx({icon:e,title:t,description:r,learnMore:o,children:a}){return Ln("div",{className:"flex flex-col items-center justify-center gap-y-4",children:[Sr("div",{className:"flex size-16 items-center justify-center rounded-2xl border border-neutral-200 bg-neutral-50",children:Sr(e,{className:"size-6 text-neutral-800"})}),Sr("p",{className:"text-center text-base font-medium text-neutral-950",children:t}),r&&Ln("p",{className:"max-w-sm text-balance text-center text-sm text-neutral-500",children:[r," ",o&&Sr("a",{href:o,target:"_blank",className:"underline underline-offset-2 hover:text-neutral-800",children:"Learn more \u2197"})]}),a]})}import{cva as Sc}from"class-variance-authority";import{useState as Mn}from"react";import{toast as Dn}from"sonner";import{Fragment as Tc,jsx as ye,jsxs as go}from"react/jsx-runtime";var En=["application/pdf","text/plain","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","text/csv"],fo={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)"},documents:{types:En,errorMessage:"File type not supported (document files only)"},programResourceImages:{types:["image/svg+xml","image/png","image/jpeg","image/webp"],errorMessage:"File type not supported (.svg, .png, .jpg, or .webp only)"},programResourceFiles:{types:[...En,"application/zip"],errorMessage:"File type not supported (document or zip files only)"}},Rc=Sc("group relative isolate flex aspect-[1200/630] w-full flex-col items-center justify-center overflow-hidden bg-white transition-all hover:bg-neutral-50",{variants:{variant:{default:"rounded-md border border-neutral-300 shadow-sm",plain:""}},defaultVariants:{variant:"default"}});function d2({id:e,readFile:t,onChange:r,variant:o,className:a,iconClassName:n,previewClassName:c,icon:s=Ma,customPreview:m,accept:d="any",imageSrc:l,loading:u=!1,clickToUpload:p=!0,showHoverOverlay:f=!0,content:g,maxFileSizeMB:h=0,targetResolution:v,accessibilityLabel:y="File upload",disabled:w=!1}){let[N,k]=Mn(!1),[C,A]=Mn(null),W=async T=>{let P="dataTransfer"in T?T.dataTransfer.files&&T.dataTransfer.files[0]:T.target.files&&T.target.files[0];if(!P)return;if(A(P.name),h>0&&P.size/1024/1024>h){Dn.error(`File size too big (max ${h} MB)`);return}let G=fo[d].types;if(G.length&&!G.includes(P.type)){Dn.error(fo[d].errorMessage??"File type not supported");return}let x=P;if(v&&P.type.startsWith("image/"))try{let S=await Xo(P,v),R=await fetch(S).then(L=>L.blob());x=new File([R],P.name,{type:P.type})}catch(S){console.error("Error resizing image:",S)}if(t){let S=new FileReader;S.onload=R=>{var L;return r==null?void 0:r({src:(L=R.target)==null?void 0:L.result,file:x})},S.readAsDataURL(x);return}r==null||r({file:x})};return go("label",{className:i(Rc({variant:o}),w?"cursor-not-allowed":i(p&&"cursor-pointer"),a),children:[u&&ye("div",{className:"absolute inset-0 z-[5] flex items-center justify-center rounded-[inherit] bg-white",children:ye(St,{})}),ye("div",{className:"absolute inset-0 z-[5]",onDragOver:T=>{T.preventDefault(),T.stopPropagation(),k(!0)},onDragEnter:T=>{T.preventDefault(),T.stopPropagation(),k(!0)},onDragLeave:T=>{T.preventDefault(),T.stopPropagation(),k(!1)},onDrop:async T=>{T.preventDefault(),T.stopPropagation(),W(T),k(!1)}}),go("div",{className:i("absolute inset-0 z-[3] flex flex-col items-center justify-center rounded-[inherit] border-2 border-transparent bg-white transition-all",w&&"bg-neutral-50",N&&!w&&"cursor-copy border-black bg-neutral-50 opacity-100",l?i("opacity-0",f&&!w&&"group-hover:opacity-100"):i(!w&&"group-hover:bg-neutral-50")),children:[ye(s,{className:i("size-7 transition-all duration-75",w?"text-neutral-400":i("text-neutral-500 group-hover:scale-110 group-active:scale-95",N?"scale-110":"scale-100"),n)}),g!==null&&ye("div",{className:i("mt-2 text-center text-sm text-neutral-500",w&&"text-neutral-400"),children:g??ye(Tc,{children:go("p",{children:["Drag and drop ",p&&"or click"," to upload."]})})}),ye("span",{className:"sr-only",children:y})]}),l&&(m??ye("img",{src:l,alt:"Preview",className:i("h-full w-full rounded-[inherit] object-cover",c)})),p&&ye("div",{className:"sr-only mt-1 flex shadow-sm",children:ye("input",{id:e,type:"file",accept:fo[d].types.join(","),onChange:W,disabled:w},C)})]})}import{AnimatePresence as Lc,motion as In}from"framer-motion";import{X as Mc}from"lucide-react";import Dc from"next/link";import{isValidElement as Ec}from"react";import{Fragment as Ic,jsx as ee,jsxs as zt}from"react/jsx-runtime";function On({filters:e,activeFilters:t,onRemove:r,onRemoveAll:o,className:a}){return Ie("Escape",o,{priority:1}),ee(pe,{height:!0,className:"w-full",transition:{type:"tween",duration:.3},children:zt("div",{className:i("flex w-full flex-wrap items-start gap-4 sm:flex-nowrap",a),children:[ee("div",{className:"flex grow flex-wrap gap-x-4 gap-y-2",children:ee(Lc,{children:t==null?void 0:t.map(({key:n,value:c})=>{if(n==="loader")return ee(In.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},className:"h-9 w-48 animate-pulse rounded-md border border-neutral-200 bg-white"},`loader-${c}`);let s=e.find(m=>m.key===n);return s?(s.multiple&&Array.isArray(c)?c:[c]).map(m=>{var f,g,h,v;let d=(f=s.options)==null?void 0:f.find(y=>typeof y.value=="string"&&typeof m=="string"?y.value.toLowerCase()===m.toLowerCase():y.value===m),l=(d==null?void 0:d.icon)??((g=s.getOptionIcon)==null?void 0:g.call(s,m,{key:s.key,option:d}))??s.icon,u=(d==null?void 0:d.label)??((h=s.getOptionLabel)==null?void 0:h.call(s,m,{key:s.key,option:d}))??m,p=(d==null?void 0:d.permalink)??((v=s.getOptionPermalink)==null?void 0:v.call(s,m))??null;return zt(In.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},className:"flex items-center divide-x rounded-md border border-neutral-200 bg-white text-sm text-black",children:[zt("div",{className:"flex items-center gap-2.5 px-3 py-2",children:[ee("span",{className:"shrink-0 text-neutral-600",children:An(s.icon)?s.icon:ee(s.icon,{className:"h-4 w-4"})}),s.label]}),ee("div",{className:"px-3 py-2 text-neutral-500",children:"is"}),ee("div",{className:"flex items-center gap-2.5 px-3 py-2",children:s.options?zt(Ic,{children:[ee("span",{className:"shrink-0 text-neutral-600",children:An(l)?l:ee(l,{className:"h-4 w-4"})}),p?ee(Dc,{href:p,target:"_blank",className:"cursor-alias decoration-dotted underline-offset-2 hover:underline",children:Pt(u,30)}):Pt(u,30)]}):ee("div",{className:"h-5 w-12 animate-pulse rounded-md bg-neutral-200"})}),ee("button",{type:"button",className:"h-full rounded-r-md p-2 text-neutral-500 ring-inset ring-neutral-500 hover:bg-neutral-100 hover:text-neutral-800 focus:outline-none focus-visible:ring-1",onClick:()=>r(n,m),children:ee(Mc,{className:"h-3.5 w-3.5"})})]},`${n}-${m}`)}):(console.error("Filter.List received an activeFilter without a corresponding filter"),null)})})}),(t==null?void 0:t.length)!==0&&zt("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-neutral-500 ring-inset ring-neutral-500 transition-colors hover:border-neutral-200 hover:bg-white hover:text-black focus:outline-none",onClick:o,children:["Clear Filters",ee("kbd",{className:"rounded-md border border-neutral-200 px-1.5 py-0.5 text-xs text-neutral-950 group-hover:bg-neutral-50",children:"ESC"})]})]})})}var An=e=>Ec(e);import{Command as He,useCommandState as Ac}from"cmdk";import{ChevronDown as Oc,ListFilter as zc}from"lucide-react";import{Fragment as Vc,forwardRef as Hc,isValidElement as Vn,useCallback as Rr,useEffect as Tr,useImperativeHandle as _c,useRef as ho,useState as bo}from"react";import{Fragment as Gc,jsx as F,jsxs as Ne}from"react/jsx-runtime";function Hn({filters:e,onSelect:t,onRemove:r,onOpenFilter:o,onSearchChange:a,onSelectedFilterChange:n,activeFilters:c,askAI:s,children:m,emptyState:d,className:l}){var P,G;let{isMobile:u}=Y(),p=ho(null),f=ho(),[g,h]=bo(!1);Ie("f",()=>h(!0),{enabled:!g});let[v,y]=bo(""),[w,N]=bo(null),k=Rr(()=>{y(""),N(null)},[]);Tr(()=>{g||k()},[g]);let C=w?e.find(({key:x})=>x===w):null,A=Rr(x=>{p.current&&(f.current={width:p.current.clientWidth,height:p.current.clientHeight}),y(""),N(x),o==null||o(x)},[]),W=Rr(x=>{if(!C||!c)return!1;let S=c.find(({key:R})=>R===w);return(S==null?void 0:S.value)===x||S&&C.multiple&&Array.isArray(S.value)&&S.value.includes(x)},[C]),T=Rr(x=>{C&&(W(x)?r(C.key,x):t(C.key,x),C.multiple||h(!1))},[c,C,s]);return Tr(()=>{a==null||a(v)},[v]),Tr(()=>{n==null||n(w)},[w]),Tr(()=>{(C==null?void 0:C.options)&&p.current&&(f.current={width:p.current.clientWidth,height:p.current.clientHeight})},[C==null?void 0:C.options]),F(xe,{openPopover:g,setOpenPopover:h,onEscapeKeyDown:x=>{w&&(x.preventDefault(),k())},content:F(pe,{width:!u,height:!0,className:"rounded-[inherit]",style:{transform:"translateZ(0)"},children:Ne(He,{loop:!0,shouldFilter:!C||C.shouldFilter!==!1,children:[Ne("div",{className:"flex items-center overflow-hidden rounded-t-lg border-b border-neutral-200",children:[F(Wc,{placeholder:`${(C==null?void 0:C.label)||"Filter"}...`,value:v,onValueChange:y,onKeyDown:x=>{(x.key==="Escape"||x.key==="Backspace"&&!v)&&(x.preventDefault(),x.stopPropagation(),w?k():h(!1))},emptySubmit:x=>{x.preventDefault(),x.stopPropagation(),s?(t("ai",C?`${C.label} ${v}`:v),h(!1)):T(v)}}),!C&&F("kbd",{className:"mr-2 hidden shrink-0 rounded border border-neutral-200 bg-neutral-100 px-2 py-0.5 text-xs font-light text-neutral-500 md:block",children:"F"})]}),F(Bc,{ref:p,children:Ne(He.List,{className:i("flex w-full flex-col gap-1 p-1",C?"min-w-[100px]":"min-w-[180px]"),children:[C?((G=(P=C.options)==null?void 0:P.filter(x=>!v||!x.hideDuringSearch))==null?void 0:G.map(x=>{let S=W(x.value);return F(zn,{filter:C,option:x,right:S?F(wa,{className:"h-4 w-4"}):x.right,onSelect:()=>T(x.value)},x.value)}))??F(He.Loading,{children:F("div",{className:"-m-1 flex items-center justify-center",style:f.current,children:F(Pe,{})})}):e.filter(x=>!x.hideInFilterDropdown).map(x=>Ne(Vc,{children:[F(zn,{filter:x,onSelect:()=>A(x.key)}),x.separatorAfter&&F(He.Separator,{className:"-mx-1 my-1 border-b border-neutral-200"})]},x.key)),(!C||C.options)&&F($c,{search:v,askAI:s,children:d?Fc(d)?(d==null?void 0:d[w??"default"])??"No matches":d:"No matches"})]})},w)]})}),children:Ne("button",{type:"button",className:i("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-neutral-200 bg-white text-neutral-900 placeholder-neutral-400","focus-visible:border-neutral-500 data-[state=open]:border-neutral-500 data-[state=open]:ring-4 data-[state=open]:ring-neutral-200",l),children:[F(zc,{className:"size-4 shrink-0"}),F("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-neutral-900",children:m??"Filter"}),c!=null&&c.length?F("div",{className:"flex size-4 shrink-0 items-center justify-center rounded-full bg-black text-[0.625rem] text-white",children:c.length}):F(Oc,{className:"size-4 shrink-0 text-neutral-400 transition-transform duration-75 group-data-[state=open]:rotate-180"})]})})}function Fc(e){return typeof e=="object"&&e!==null&&!Vn(e)}var Wc=e=>{let t=Ac(r=>r.filtered.count===0);return F(He.Input,{...e,size:1,className:"grow border-0 py-3 pl-4 pr-2 outline-none placeholder:text-neutral-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"})},Bc=Hc(({children:e},t)=>{let r=ho(null);_c(t,()=>r.current);let{scrollProgress:o,updateScrollProgress:a}=Ae(r);return Ne(Gc,{children:[F("div",{className:"scrollbar-hide max-h-[50vh] w-screen overflow-y-scroll sm:w-auto",ref:r,onScroll:a,children:e}),F("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 zn({filter:e,option:t,right:r,onSelect:o}){var s,m;let{isMobile:a}=Y(),n=t?t.icon??((s=e.getOptionIcon)==null?void 0:s.call(e,t.value,{key:e.key,option:t}))??e.icon:e.icon,c=t?t.label??((m=e.getOptionLabel)==null?void 0:m.call(e,t.value,{key:e.key,option:t})):e.label;return Ne(He.Item,{className:i("flex cursor-pointer items-center gap-3 whitespace-nowrap rounded-md px-3 py-2 text-left text-sm","data-[selected=true]:bg-neutral-100"),onPointerDown:d=>{d.preventDefault()},onPointerUp:d=>{d.preventDefault(),a?setTimeout(o,100):o()},onSelect:o,value:c+(t==null?void 0:t.value),children:[F("span",{className:"shrink-0 text-neutral-600",children:Uc(n)?n:F(n,{className:"h-4 w-4"})}),Pt(c,48),F("div",{className:"ml-1 flex shrink-0 grow justify-end text-neutral-500",children:r})]})}var $c=({search:e,askAI:t,children:r})=>t&&e?Ne(He.Empty,{className:"flex min-w-[180px] items-center space-x-2 rounded-md bg-neutral-100 px-3 py-2",children:[F(ca,{className:"h-4 w-4"}),Ne("p",{className:"text-center text-sm text-neutral-600",children:["Ask AI ",Ne("span",{className:"text-black",children:['"',e,'"']})]})]}):F(He.Empty,{className:"p-2 text-center text-sm text-neutral-400",children:r}),Uc=e=>Vn(e);var O2={Select:Hn,List:On};import{useMemo as jc,useState as _n}from"react";import{jsx as Xe,jsxs as Lr}from"react/jsx-runtime";function B2({title:e,description:t,inputAttrs:r,helpText:o,buttonText:a="Save Changes",disabledTooltip:n,handleSubmit:c}){let[s,m]=_n(r.defaultValue),[d,l]=_n(!1),u=jc(()=>d||!s||s===r.defaultValue,[d,s,r.defaultValue]);return Lr("form",{onSubmit:async p=>{p.preventDefault(),l(!0),await c({[r.name]:s}),l(!1)},className:"rounded-lg border border-neutral-200 bg-white",children:[Lr("div",{className:"relative flex flex-col space-y-6 p-5 sm:p-10",children:[Lr("div",{className:"flex flex-col space-y-3",children:[Xe("h2",{className:"text-xl font-medium",children:e}),Xe("p",{className:"text-sm text-neutral-500",children:t})]}),typeof r.defaultValue=="string"?Xe("input",{...r,type:r.type||"text",required:!0,disabled:!!n,onChange:p=>m(p.target.value),className:i("w-full max-w-md rounded-md border border-neutral-300 text-neutral-900 placeholder-neutral-400 focus:border-neutral-500 focus:outline-none focus:ring-neutral-500 sm:text-sm",{"cursor-not-allowed bg-neutral-100 text-neutral-400":n})}):Xe("div",{className:"h-[2.35rem] w-full max-w-md animate-pulse rounded-md bg-neutral-200"})]}),Lr("div",{className:"flex items-center justify-between space-x-4 rounded-b-lg border-t border-neutral-200 bg-neutral-50 p-3 sm:px-10",children:[typeof o=="string"?Xe("p",{className:"prose-sm prose-a:underline prose-a:underline-offset-4 hover:prose-a:text-neutral-700 text-neutral-500 transition-colors",dangerouslySetInnerHTML:{__html:o||""}}):o,Xe("div",{className:"shrink-0",children:Xe(te,{text:a,loading:d,disabled:u,disabledTooltip:n})})]})]})}import{useId as Kc}from"react";import{jsx as Mr,jsxs as Yc}from"react/jsx-runtime";function Je({cellSize:e=12,strokeWidth:t=1,patternOffset:r=[0,0],className:o}){let a=Kc();return Yc("svg",{className:i("pointer-events-none absolute inset-0 text-black/10",o),width:"100%",height:"100%",children:[Mr("defs",{children:Mr("pattern",{id:`grid-${a}`,x:r[0]-1,y:r[1]-1,width:e,height:e,patternUnits:"userSpaceOnUse",children:Mr("path",{d:`M ${e} 0 L 0 0 0 ${e}`,fill:"transparent",stroke:"currentColor",strokeWidth:t})})}),Mr("rect",{fill:`url(#grid-${a})`,width:"100%",height:"100%"})]})}import{AlertCircle as Zc}from"lucide-react";import qc,{useCallback as Xc,useState as Jc}from"react";import{jsx as Qe,jsxs as vo}from"react/jsx-runtime";var Qc=qc.forwardRef(({className:e,type:t,...r},o)=>{let[a,n]=Jc(!1),c=Xc(()=>n(!a),[a,n]);return vo("div",{children:[vo("div",{className:"relative flex",children:[Qe("input",{type:a?"text":t,className:i("w-full max-w-md rounded-md border border-neutral-300 text-neutral-900 placeholder-neutral-400 read-only:bg-neutral-100 read-only:text-neutral-500 focus:border-neutral-500 focus:outline-none focus:ring-neutral-500 sm:text-sm",r.error&&"border-red-500 focus:border-red-500 focus:ring-red-500",e),ref:o,...r}),vo("div",{className:"group",children:[r.error&&Qe("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex flex-none items-center px-2.5",children:Qe(Zc,{className:i("size-5 text-white",t==="password"&&"transition-opacity group-hover:opacity-0"),fill:"#ef4444"})}),t==="password"&&Qe("button",{className:i("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?Qe(Aa,{className:"size-4 flex-none text-neutral-500 transition hover:text-neutral-700","aria-hidden":!0}):Qe(Oa,{className:"size-4 flex-none text-neutral-500 transition hover:text-neutral-700","aria-hidden":!0})})]})]}),r.error&&Qe("span",{className:"mt-2 block text-sm text-red-500",role:"alert","aria-live":"assertive",children:r.error})]})});Qc.displayName="Input";import{flip as ad,offset as nd,size as id,useDismiss as sd,useFloating as ld,useInteractions as cd}from"@floating-ui/react";import{Command as Me,useCommandState as dd}from"cmdk";import{Check as md,ChevronDown as ud,Search as pd,X as fd}from"lucide-react";import{createContext as gd,forwardRef as Un,useContext as wo,useEffect as xo,useMemo as Wn,useRef as Bn,useState as yo}from"react";import{Drawer as ht}from"vaul";import ed from"next/image";import{memo as td,useEffect as rd,useState as Fn}from"react";import{jsx as od}from"react/jsx-runtime";var Vt=td(e=>{let[t,r]=Fn(!0),[o,a]=Fn(e.src);rd(()=>a(e.src),[e.src]);let n=c=>{r(!1);let s=c.target;s.naturalWidth<=16&&s.naturalHeight<=16&&a(`https://avatar.vercel.sh/${encodeURIComponent(e.alt)}`)};return od(ed,{...e,src:o,alt:e.alt,className:i(t?"blur-[2px]":"blur-0",e.className),onLoad:n,onError:()=>{a(`https://avatar.vercel.sh/${encodeURIComponent(e.alt)}`)},unoptimized:!0})});import{jsx as O,jsxs as le}from"react/jsx-runtime";var Dr=gd({inputAttrs:{},openCommandList:!1,setOpenCommandList:()=>{},inputValue:"",setInputValue:()=>{},disabled:!1,selectedItem:null,setSelectedItem:()=>{}});function vy({items:e,selectedItem:t,setSelectedItem:r,className:o,disabled:a,adjustForMobile:n,icon:c,inputAttrs:s,noItemsElement:m}){let{isMobile:d}=Y(),l=Bn(null),[u,p]=yo(!1),[f,g]=yo(""),[h,v]=yo(!1);xo(()=>{u&&v(!1)},[u]),xo(()=>v(!0),[f]),xo(()=>{t&&g(t.value)},[t]);let y=Wn(()=>{let S=f.toLowerCase();return h?e.filter(R=>R.value.toLowerCase().includes(S)):f?e.sort((R,L)=>(L.value.toLowerCase().includes(S)?1:0)-(R.value.toLowerCase().includes(S)?1:0)):e},[h,f,e]),{refs:w,floatingStyles:N,context:k}=ld({open:u,onOpenChange:p,middleware:[nd(8),id({apply({elements:{floating:S},availableHeight:R}){Object.assign(S.style,{maxHeight:`${Math.max(75,Math.min(R,290))}px`})},padding:8}),ad({fallbackStrategy:"initialPlacement",padding:8})]}),C=sd(k,{enabled:!d||!n}),{getReferenceProps:A,getFloatingProps:W}=cd([C]),T=Bn(null),{scrollProgress:P,updateScrollProgress:G}=Ae(T),x=Wn(()=>t&&t.icon?t.icon:t&&t.image?O(Vt,{src:t.image,alt:t.value,className:"size-4 rounded-full",width:16,height:16}):c||O(pd,{className:"size-4 text-neutral-400"}),[t,c]);return O(Dr.Provider,{value:{inputAttrs:s||{},openCommandList:u,setOpenCommandList:p,inputValue:f,setInputValue:g,disabled:Boolean(a),selectedItem:t,setSelectedItem:r},children:d&&n?le(ht.Root,{open:u,onOpenChange:p,children:[O(ht.Trigger,{className:"sm:hidden",asChild:!0,children:O(Me,{ref:l,className:"relative",shouldFilter:!1,loop:!0,children:O(No,{className:o,iconElement:x})})}),O(ht.Overlay,{className:"fixed inset-0 z-40 bg-neutral-100 bg-opacity-10 backdrop-blur"}),le(ht.Portal,{children:[O(ht.Content,{className:"fixed bottom-0 left-0 right-0 z-50 mt-24 rounded-t-lg border-t border-neutral-200 bg-white",onPointerDownOutside:S=>{S.target instanceof Element&&S.target.closest("[data-sonner-toast]")&&S.preventDefault()},children:le(Me,{ref:l,className:"relative",shouldFilter:!1,loop:!0,children:[O("div",{className:"p-2",children:O(No,{className:o,iconElement:x})}),u&&le(Me.List,{className:"dub-scrollbar h-[70vh] overflow-y-auto p-2",children:[e.length===0&&f===""&&(m?O("div",{children:m}):O("p",{className:"px-4 py-2 text-sm text-neutral-600",children:"No items found."})),f!==""&&O(Me.Empty,{className:"px-4 py-2 text-sm text-neutral-600",children:"No results found."}),O($n,{items:y})]})]})}),O(ht.Overlay,{})]})]}):le(Me,{ref:l,className:"relative",shouldFilter:!1,loop:!0,children:[O(No,{className:o,iconElement:x,ref:w.setReference,...A()}),u&&le("div",{ref:w.setFloating,style:N,...W(),className:"z-20 flex w-full min-w-[160px] flex-col overflow-hidden rounded-md border border-neutral-200 bg-white shadow-md",children:[le("div",{ref:T,onScroll:G,className:"grow overflow-y-auto p-2",children:[le(Me.List,{children:[e.length===0&&f===""&&(m?O("div",{children:m}):O("p",{className:"px-4 py-2 text-sm text-neutral-600",children:"No items found."})),f!==""&&O(Me.Empty,{className:"px-4 py-2 text-sm text-neutral-600",children:"No results found."})]}),O($n,{items:y})]}),O("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(P,2)}})]})]})})}var No=Un(({iconElement:e,className:t,...r},o)=>le("label",{ref:o,className:i("group relative flex cursor-pointer gap-2 rounded-md border border-neutral-200 bg-white px-1 pl-3 transition-all focus-within:border-neutral-500 focus-within:ring-4 focus-within:ring-neutral-200",t),...r,children:[O("div",{className:"flex shrink-0 items-center justify-center text-neutral-400",children:e}),le("div",{className:"flex h-10 grow",children:[O(bd,{}),O(hd,{})]})]})),bd=Un((e,t)=>{let r=dd(d=>d.filtered.count===0),{inputAttrs:o,openCommandList:a,setOpenCommandList:n,inputValue:c,setInputValue:s,disabled:m}=wo(Dr);return O(Me.Input,{ref:t,placeholder:(o==null?void 0:o.placeholder)||"Search...",autoFocus:a,onFocus:()=>n(!0),value:c,onValueChange:s,onKeyDown:d=>{d.key==="Escape"?(d.preventDefault(),n(!1)):d.key==="Enter"&&r?n(!1):d.key.match(/^[a-z0-9]$/i)&&!d.metaKey&&n(!0)},disabled:m,className:"block w-full truncate rounded-md border-none px-0 text-base text-neutral-900 placeholder-neutral-400 outline-none outline-0 transition-all duration-300 focus:ring-0 md:text-sm",autoCapitalize:"none"})});function hd(){let{setSelectedItem:e,openCommandList:t,setOpenCommandList:r,inputValue:o,setInputValue:a}=wo(Dr);return O("button",{type:"button",onClick:()=>{r(n=>!n),e(null),a("")},className:"absolute inset-y-0 right-0 my-auto pr-3",children:o.length>0?O(fd,{className:"size-4 text-neutral-400 transition-all hover:text-neutral-700"}):O(ud,{className:i("size-4 text-neutral-400 transition-all hover:text-neutral-700",{"rotate-180 transform":t})})})}function $n({items:e}){let{setSelectedItem:t,setOpenCommandList:r,setInputValue:o}=wo(Dr);return e.map(a=>le(Me.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-neutral-900 hover:bg-neutral-100 hover:text-neutral-900 active:bg-neutral-200 aria-disabled:cursor-not-allowed aria-disabled:opacity-75 aria-disabled:hover:bg-white aria-selected:bg-neutral-100 aria-selected:text-neutral-900",children:[le("div",{className:"flex items-center space-x-2",children:[a.icon||a.image&&O(Vt,{src:a.image,alt:a.value,className:"size-4 rounded-full",width:16,height:16}),O("p",{className:i("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&&O(fr,{className:"text-xs",variant:"neutral",children:a.label})]}),O(md,{className:"invisible h-5 w-5 text-neutral-500 aria-selected:visible"})]},a.id))}import*as Co from"@radix-ui/react-label";import{cva as vd}from"class-variance-authority";import*as Gn from"react";import{jsx as Nd}from"react/jsx-runtime";var xd=vd("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),yd=Gn.forwardRef(({className:e,...t},r)=>Nd(Co.Root,{ref:r,className:i(xd(),e),...t}));yd.displayName=Co.Root.displayName;import{cva as wd}from"class-variance-authority";import{isValidElement as Cd}from"react";import{jsx as ko,jsxs as jn}from"react/jsx-runtime";var Po=wd(["flex h-9 w-full rounded-md px-2 items-center justify-center gap-2 transition-colors cursor-pointer","whitespace-nowrap text-sm font-medium text-content-default enabled:hover:bg-bg-subtle transition-colors","disabled:opacity-50 disabled:cursor-default"],{variants:{variant:{default:"text-content-default hover:bg-bg-subtle",danger:"text-content-error hover:bg-bg-error"},disabled:{true:"opacity-50 cursor-default text-content-disabled hover:bg-bg-default"}}});function Dy({as:e,variant:t="default",children:r,icon:o,shortcut:a,className:n,disabledTooltip:c,...s}){return ko(ut,{tooltipProps:{content:c},children:jn(e||"button",{...e==="button"?{type:"button"}:{},className:i(Po({variant:t,disabled:!!c}),n),disabled:c?!0:s.disabled,...s,children:[jn("div",{className:"flex grow items-center gap-2",children:[o&&(kd(o)?o:ko(o,{className:"size-4"})),r]}),a&&ko("kbd",{className:i("bg-bg-inverted/5 group-hover:bg-bg-inverted/10 hidden rounded px-2 py-0.5 text-xs font-light transition-all duration-75 md:block"),children:a})]})})}var kd=e=>Cd(e);import{curveNatural as Kn}from"@visx/curve";import{LinearGradient as Yn}from"@visx/gradient";import{Group as Pd}from"@visx/group";import{ParentSize as Sd}from"@visx/responsive";import{scaleLinear as Rd,scaleUtc as Td}from"@visx/scale";import{Area as Ld,AreaClosed as Md}from"@visx/shape";import{motion as Zn}from"framer-motion";import{useId as Dd,useMemo as qn}from"react";import{jsx as we,jsxs as So}from"react/jsx-runtime";var Ed={top:8,right:2,bottom:2,left:2};function Wy(e){return we(Sd,{className:"relative",children:({width:t,height:r})=>t>0&&r>0&&we(Id,{...{width:t,height:r,...e}})})}function Id({width:e,height:t,data:r,curve:o=!0,color:a,padding:n}){let c={...Ed,...n},s=Dd(),m=qn(()=>r.map(({date:u})=>({date:u,value:0})),[r]),{yScale:d,xScale:l}=qn(()=>{let u=r.map(({value:v})=>v),p=Math.max(...u),f=r.map(({date:v})=>v.getTime()),g=new Date(Math.min(...f)),h=new Date(Math.max(...f));return{yScale:Rd({domain:[-2,Math.max(p,2)],range:[t-c.top-c.bottom,0],nice:!0,clamp:!0}),xScale:Td({domain:[g,h],range:[0,e-c.left-c.right],nice:!0})}},[r,t,e]);return So("svg",{width:e,height:t,children:[So("defs",{children:[we(Yn,{id:`${s}-color-gradient`,from:a||"#7D3AEC",to:a||"#DA2778",x1:0,x2:e-c.left-c.right,gradientUnits:"userSpaceOnUse"}),we(Yn,{id:`${s}-mask-gradient`,from:"white",to:"white",fromOpacity:.3,toOpacity:0,x1:0,x2:0,y1:0,y2:1}),we("mask",{id:`${s}-mask`,maskContentUnits:"objectBoundingBox",children:we("rect",{width:"1",height:"1",fill:`url(#${s}-mask-gradient)`})})]}),So(Pd,{left:c.left,top:c.top,children:[we(Ld,{data:r,x:({date:u})=>l(u),y:({value:u})=>d(u)??0,curve:o?Kn:void 0,children:({path:u})=>we(Zn.path,{initial:{d:u(m)||"",opacity:0},animate:{d:u(r)||"",opacity:1},strokeWidth:1.5,stroke:`url(#${s}-color-gradient)`})}),we(Md,{data:r,x:({date:u})=>l(u),y:({value:u})=>d(u)??0,yScale:d,curve:o?Kn:void 0,children:({path:u})=>we(Zn.path,{initial:{d:u(m)||"",opacity:0},animate:{d:u(r)||"",opacity:1},fill:`url(#${s}-color-gradient)`,mask:`url(#${s}-mask)`})})]})]},r.length)}import*as ce from"@radix-ui/react-dialog";import*as Ro from"@radix-ui/react-visually-hidden";import{useRouter as Ad}from"next/navigation";import{Drawer as et}from"vaul";import{jsx as ne,jsxs as vt}from"react/jsx-runtime";function Ky({children:e,className:t,showModal:r,setShowModal:o,onClose:a,desktopOnly:n,preventDefaultClose:c,drawerRootProps:s}){let m=Ad(),d=({dragged:u}={})=>{c&&!u||(a&&a(),o?o(!1):m.back())},{isMobile:l}=Y();return l&&!n?ne(et.Root,{open:o?r:!0,onOpenChange:u=>{u||d({dragged:!0})},...s,children:vt(et.Portal,{children:[ne(et.Overlay,{className:"fixed inset-0 z-50 bg-neutral-100 bg-opacity-10 backdrop-blur"}),ne(et.Content,{onPointerDownOutside:u=>{u.target instanceof Element&&u.target.closest("[data-sonner-toast]")&&u.preventDefault()},className:i("fixed bottom-0 left-0 right-0 z-50 flex flex-col","rounded-t-[10px] border-t border-neutral-200 bg-white",t),children:vt("div",{className:"scrollbar-hide flex-1 overflow-y-auto rounded-t-[10px] bg-inherit",children:[vt(Ro.Root,{children:[ne(et.Title,{children:"Modal"}),ne(et.Description,{children:"This is a modal"})]}),ne(Od,{}),e]})}),ne(et.Overlay,{})]})}):ne(ce.Root,{open:o?r:!0,onOpenChange:u=>{u||d()},children:vt(ce.Portal,{children:[ne(ce.Overlay,{id:"modal-backdrop",className:"animate-fade-in fixed inset-0 z-40 bg-neutral-100 bg-opacity-50 backdrop-blur-md"}),vt(ce.Content,{onOpenAutoFocus:u=>u.preventDefault(),onCloseAutoFocus:u=>u.preventDefault(),onPointerDownOutside:u=>{u.target instanceof Element&&u.target.closest("[data-sonner-toast]")&&u.preventDefault()},className:i("fixed inset-0 z-40 m-auto h-fit w-full max-w-md","border border-neutral-200 bg-white p-0 shadow-xl sm:rounded-2xl","scrollbar-hide animate-scale-in overflow-y-auto",t),children:[vt(Ro.Root,{children:[ne(ce.Title,{children:"Modal"}),ne(ce.Description,{children:"This is a modal"})]}),e]})]})})}function Od(){return ne("div",{className:"sticky top-0 z-20 flex items-center justify-center rounded-t-[10px] bg-inherit",children:ne("div",{className:"my-3 h-1 w-12 rounded-full bg-neutral-300"})})}import{useCallback as To}from"react";import{jsx as Ht,jsxs as zd}from"react/jsx-runtime";function e4({value:e,onChange:t,min:r,max:o,step:a=1,disabled:n,className:c,id:s,formatValue:m,decrementAriaLabel:d="Decrease",incrementAriaLabel:l="Increase",...u}){let p=typeof r=="number"?e>r:!0,f=typeof o=="number"?e<o:!0,g=To(y=>{let w=y;return typeof r=="number"&&(w=Math.max(r,w)),typeof o=="number"&&(w=Math.min(o,w)),w},[r,o]),h=To(()=>{n||!p||t(g(e-a))},[n,p,g,t,a,e]),v=To(()=>{n||!f||t(g(e+a))},[n,f,g,t,a,e]);return zd("div",{id:s,role:"group","aria-disabled":n,className:i("flex h-10 w-full select-none items-stretch overflow-hidden rounded-lg border border-neutral-200 bg-white",n&&"opacity-60",c),...u,children:[Ht("button",{type:"button","aria-label":d,onClick:h,disabled:n||!p,className:i("flex h-full w-24 items-center justify-center border-r border-neutral-200 text-neutral-700 transition-colors",!(n||!p)&&"hover:bg-neutral-50"),children:Ht(dr,{className:"block size-4"})}),Ht("div",{role:"spinbutton","aria-valuenow":e,"aria-valuemin":r,"aria-valuemax":o,tabIndex:0,onKeyDown:y=>{n||((y.key==="ArrowLeft"||y.key==="ArrowDown")&&(y.preventDefault(),h()),(y.key==="ArrowRight"||y.key==="ArrowUp")&&(y.preventDefault(),v()))},className:i("flex min-w-0 flex-1 items-center justify-center px-3 text-sm text-neutral-900"),prefix:"",children:m?m(e):e}),Ht("button",{type:"button","aria-label":l,onClick:v,disabled:n||!f,className:i("flex h-full w-24 items-center justify-center border-l border-neutral-200 text-neutral-700 transition-colors",!(n||!f)&&"hover:bg-neutral-50"),children:Ht(mt,{className:"block size-4"})})]})}import{Fragment as Vd,jsx as Er,jsxs as xt}from"react/jsx-runtime";var Xn=i("flex h-7 items-center justify-center gap-2 whitespace-nowrap rounded-md border border-neutral-200 bg-white px-2 text-sm text-neutral-600","outline-none hover:bg-neutral-50 focus-visible:border-neutral-500","disabled:cursor-not-allowed disabled:border-neutral-200 disabled:text-neutral-400 disabled:bg-neutral-100");function o4({pagination:e,setPagination:t,totalCount:r,unit:o=s=>`item${s?"s":""}`,className:a,children:n,showTotalCount:c=!0}){return xt("div",{className:i("flex items-center justify-between gap-2 text-sm leading-6 text-neutral-600",a),children:[xt("div",{className:"flex items-center gap-2",children:[xt("div",{children:[Er("span",{className:"hidden sm:inline-block",children:"Viewing"})," ",r>0&&xt(Vd,{children:[xt("span",{className:"font-medium",children:[((e.pageIndex-1)*e.pageSize+1).toLocaleString(),"-",Math.min((e.pageIndex-1)*e.pageSize+e.pageSize,r).toLocaleString()]})," ",c&&"of "]}),c&&Er("span",{className:"font-medium",children:r.toLocaleString()})," ",typeof o=="function"?o(r!==1):o]}),n]}),xt("div",{className:"flex items-center gap-2",children:[Er("button",{type:"button",className:Xn,onClick:()=>t({...e,pageIndex:e.pageIndex-1}),disabled:e.pageIndex===1,children:"Previous"}),Er("button",{type:"button",className:Xn,onClick:()=>t({...e,pageIndex:e.pageIndex+1}),disabled:(e.pageIndex-1)*e.pageSize+e.pageSize>=r,children:"Next"})]})]})}import{jsx as Jn,jsxs as Hd}from"react/jsx-runtime";function i4({progress:e,strokeWidth:t=16,className:r}){let o=Math.min(Math.max(e,0),1),a=(100-t)/2,n=a*Math.PI*2,c=o*n;return Hd("svg",{width:"100",height:"100",viewBox:"0 0 100 100",className:i("size-3 shrink-0 text-green-600",r),children:[Jn("circle",{cx:"50",cy:"50",r:a,stroke:"#e5e5e5",strokeWidth:`${t}px`,fill:"none",strokeLinecap:"round"}),o>0&&Jn("circle",{cx:"50",cy:"50",r:a,stroke:"currentColor",strokeWidth:`${t}px`,fill:"none",strokeLinecap:"round",strokeDasharray:`${c} ${n-c}`,style:{transformOrigin:"50px 50px",transform:"rotate(-90deg)"}})]})}import*as _e from"@radix-ui/react-radio-group";import{Circle as _d}from"lucide-react";import*as Lo from"react";import{jsx as Ir}from"react/jsx-runtime";var Fd=Lo.forwardRef(({className:e,...t},r)=>Ir(_e.Root,{className:i("grid gap-2",e),...t,ref:r}));Fd.displayName=_e.Root.displayName;var Wd=Lo.forwardRef(({className:e,...t},r)=>Ir(_e.Item,{ref:r,className:i("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:Ir(_e.Indicator,{className:"flex items-center justify-center",children:Ir(_d,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Wd.displayName=_e.Item.displayName;import{Drawer as Fe}from"vaul";import{jsx as tt,jsxs as jd}from"react/jsx-runtime";function Bd({children:e,contentProps:t,nested:r=!1,...o}){let a=r?Fe.NestedRoot:Fe.Root;return tt(a,{direction:"right",handleOnly:!0,...o,children:jd(Fe.Portal,{children:[tt(Fe.Overlay,{className:"fixed inset-0 bg-black/20","data-sheet-overlay":!0}),tt(Fe.Content,{...t,onPointerDownOutside:n=>{var c;n.target instanceof Element&&n.target.closest("[data-sonner-toast]")&&n.preventDefault(),(c=t==null?void 0:t.onPointerDownOutside)==null||c.call(t,n)},className:i("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)",userSelect:"auto",...t==null?void 0:t.style},children:tt("div",{className:"scrollbar-hide flex size-full grow flex-col overflow-y-auto rounded-lg bg-white",children:e})})]})})}function $d({className:e,...t}){return tt(Fe.Title,{className:i("text-lg font-semibold text-neutral-900",e),...t})}function Ud(e){return tt(Fe.Description,{...e})}function Gd(e){return tt(Fe.Close,{...e})}var f4=Object.assign(Bd,{Title:$d,Description:Ud,Close:Gd});import{useEffect as Kd,useRef as Yd,useState as Zd}from"react";import{jsx as Qn}from"react/jsx-runtime";var qd=`
2
+ import{$ as Ip,$a as Ra,$b as mf,$c as tg,$d as Zg,A as pp,Aa as a0,Ab as U0,Ac as Af,Ad as kg,B as fp,Ba as n0,Bb as G0,Bc as Of,Bd as Pg,C as gp,Ca as i0,Cb as j0,Cc as zf,Cd as Sg,D as or,Da as ya,Db as sr,Dc as Ba,Dd as Rg,E as bp,Ea as s0,Eb as K0,Ec as Vf,Ed as Tg,F as ar,Fa as l0,Fb as Y0,Fc as Hf,Fd as Lg,G as hp,Ga as Na,Gb as Z0,Gc as _f,Gd as Mg,H as vp,Ha as c0,Hb as q0,Hc as $a,Hd as Dg,I as xp,Ia as d0,Ib as X0,Ic as Ua,Id as Eg,J as yp,Ja as m0,Jb as Ea,Jc as Ff,Jd as Ig,K as fa,Ka as u0,Kb as J0,Kc as Wf,Kd as Ag,L as ga,La as p0,Lb as Q0,Lc as Bf,Ld as Og,M as ba,Ma as f0,Mb as ef,Mc as $f,Md as zg,N as ha,Na as g0,Nb as tf,Nc as lr,Nd as Vg,O as va,Oa as b0,Ob as Ia,Oc as Uf,Od as Hg,P as Np,Pa as h0,Pb as Aa,Pc as Gf,Pd as _g,Q as wp,Qa as v0,Qb as Oa,Qc as jf,Qd as Fg,R as Cp,Ra as wa,Rb as za,Rc as Kf,Rd as Wg,S as kp,Sa as ir,Sb as rf,Sc as Yf,Sd as Bg,T as Pp,Ta as Ca,Tb as of,Tc as Zf,Td as $g,U as Sp,Ua as ka,Ub as af,Uc as qf,Ud as Ya,V as Rp,Va as x0,Vb as nf,Vc as Xf,Vd as Za,W as Tp,Wa as y0,Wb as sf,Wc as Jf,Wd as Ug,X as Lp,Xa as Pa,Xb as lf,Xc as Qf,Xd as Gg,Y as Mp,Ya as Sa,Yb as Va,Yc as eg,Yd as jg,Z as Dp,Za as N0,Zb as cf,Zc as cr,Zd as Kg,_ as Ep,_a as w0,_b as df,_c as dr,_d as Yg,a as op,aa as Ap,ab as Ta,ac as uf,ad as rg,ae as qg,b as sa,ba as Op,bb as La,bc as pf,bd as og,be as Xg,c as ap,ca as zp,cb as C0,cc as ff,cd as ag,ce as Jg,d as lt,da as Vp,db as k0,dc as gf,dd as ng,de as Qg,e as er,ea as Hp,eb as P0,ec as bf,ed as ig,ee as eb,f as np,fa as _p,fb as S0,fc as hf,fd as sg,fe as tb,g as ct,ga as Fp,gb as R0,gc as vf,gd as Ga,ge as rb,h as dt,ha as Wp,hb as qr,hc as Ha,hd as lg,he as ob,i as Zr,ia as Bp,ib as T0,ic as xf,id as cg,ie as ab,j as la,ja as $p,jb as L0,jc as yf,jd as dg,je as Rt,k as ip,ka as Up,kb as M0,kc as Nf,kd as mg,ke as nb,l as ca,la as Gp,lb as Ma,lc as _a,ld as ug,le as ib,m as sp,ma as jp,mb as D0,mc as wf,md as pg,me as sb,n as lp,na as xa,nb as E0,nc as Cf,nd as fg,ne as lb,o as da,oa as Kp,ob as I0,oc as Fa,od as gg,oe as qa,p as ma,pa as Yp,pb as A0,pc as kf,pd as mt,pe as cb,q as ua,qa as Zp,qb as O0,qc as Wa,qd as bg,qe as db,r as pa,ra as qp,rb as z0,rc as Pf,rd as hg,re as mb,s as St,sa as Xp,sb as V0,sc as Sf,sd as vg,se as ub,t as cp,ta as Jp,tb as H0,tc as Rf,td as xg,te as pb,u as Pe,ua as Qp,ub as _0,uc as Tf,ud as yg,ue as fb,v as dp,va as e0,vb as F0,vc as Lf,vd as ja,ve as gb,w as tr,wa as t0,wb as W0,wc as Mf,wd as Ng,x as mp,xa as r0,xb as B0,xc as Df,xd as wg,y as up,ya as nr,yb as $0,yc as Ef,yd as Ka,z as rr,za as o0,zb as Da,zc as If,zd as Cg}from"./chunk-G5GFXTXL.mjs";import{a as Y}from"./chunk-NWME2ANF.mjs";import{a as Kr,b as kt,c as qo,d as Xo,e as Pt,f as Jo,g as Qo,h as be,i as Ke,j as i,k as Yr,l as ea,m as _,n as ta,o as ke,p as ra,q as oa,r as aa,s as Jt,t as Qt,u as na,v as ia}from"./chunk-7HQBUAV4.mjs";import*as ie from"@radix-ui/react-accordion";import{ChevronDown as Wi}from"lucide-react";import*as ur from"react";import{jsx as mr,jsxs as Gi}from"react/jsx-runtime";var Nb=ie.Root,Bi=ur.forwardRef(({className:e,...t},r)=>mr(ie.Item,{ref:r,className:i("border-b border-b-slate-200 py-3 last:border-none",e),...t}));Bi.displayName="AccordionItem";var $i=ur.forwardRef(({className:e,children:t,variant:r="chevron",...o},a)=>{let n=r==="chevron"?Wi:mt;return mr(ie.Header,{className:"flex",children:Gi(ie.Trigger,{ref:a,className:i("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,mr(n,{className:"h-5 w-5 flex-none transition-transform duration-300"})]})})});$i.displayName=ie.Trigger.displayName;var Ui=ur.forwardRef(({className:e,children:t,...r},o)=>mr(ie.Content,{ref:o,className:i("data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm text-neutral-500 transition-all sm:text-base",e),...r,children:t}));Ui.displayName=ie.Content.displayName;import{cva as ji}from"class-variance-authority";import*as pr from"react";import{jsx as Xr}from"react/jsx-runtime";var Ki=ji("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"}}),Yi=pr.forwardRef(({className:e,variant:t,...r},o)=>Xr("div",{ref:o,role:"alert",className:i(Ki({variant:t}),e),...r}));Yi.displayName="Alert";var Zi=pr.forwardRef(({className:e,...t},r)=>Xr("h5",{ref:r,className:i("text-md mb-2 font-medium leading-none tracking-tight",e),...t}));Zi.displayName="AlertTitle";var qi=pr.forwardRef(({className:e,...t},r)=>Xr("div",{ref:r,className:i("text-sm [&_p]:leading-relaxed",e),...t}));qi.displayName="AlertDescription";import{sha256 as Xi}from"js-sha256";import{useState as Ji}from"react";import{jsx as Jr}from"react/jsx-runtime";function Qi(e){if(e!=null&&e.image)return e.image;if(!(e!=null&&e.id))return"https://api.dub.co/og/avatar";let t=`https://api.dub.co/og/avatar/${e.id}`;return e.email?`https://0.gravatar.com/avatar/${Xi(e.email)}?d=${t}`:t}function Lb({user:e={},className:t}){if(!e)return Jr("div",{className:i("h-10 w-10 animate-pulse rounded-full border border-neutral-300 bg-neutral-100",t)});let[r,o]=Ji(Qi(e));return Jr("img",{alt:`Avatar for ${e.name||e.email}`,referrerPolicy:"no-referrer",src:r,className:i("h-10 w-10 rounded-full border border-neutral-300",t),draggable:!1,onError:()=>{o(`https://api.dub.co/og/avatar/${e.id}`)}})}function Mb({id:e,className:t}){return Jr("img",{src:`https://api.dicebear.com/9.x/shapes/svg?seed=${e}`,alt:"avatar",className:i("h-10 w-10 rounded-full",t),draggable:!1})}import{cva as es}from"class-variance-authority";import{jsx as rs}from"react/jsx-runtime";var ts=es("max-w-fit rounded-full border px-2 py-px text-xs font-medium whitespace-nowrap",{variants:{variant:{default:"border-neutral-400 text-neutral-500",violet:"border-violet-600 bg-violet-600 text-white",blue:"border-blue-500 bg-blue-500 text-white",green:"border-green-100 bg-green-100 text-green-900",sky:"border-sky-900 bg-sky-900 text-white",black:"border-black bg-black text-white",gray:"border-neutral-200 bg-neutral-100 text-neutral-800",neutral:"border-neutral-400 text-neutral-500",amber:"border-amber-800 bg-amber-800 text-white",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 fr({className:e,variant:t,...r}){return rs("span",{className:i(ts({variant:t}),e),...r})}import{cva as ls}from"class-variance-authority";import{forwardRef as cs}from"react";import*as he from"@radix-ui/react-tooltip";import os from"linkify-react";import{HelpCircle as as}from"lucide-react";import ns from"next/link";import{useState as is}from"react";import{Fragment as ss,jsx as U,jsxs as Ye}from"react/jsx-runtime";function Ub({children:e}){return U(he.Provider,{delayDuration:150,children:e})}function Q({children:e,content:t,contentClassName:r,disabled:o,side:a="top",disableHoverableContent:n,delayDuration:c=0,...s}){let[m,d]=is(!1);return Ye(he.Root,{open:o?!1:m,onOpenChange:d,delayDuration:c,disableHoverableContent:n,children:[U(he.Trigger,{asChild:!0,onClick:()=>{d(!0)},onBlur:()=>{d(!1)},children:e}),U(he.Portal,{children:U(he.Content,{sideOffset:8,side:a,className:"animate-slide-up-fade pointer-events-auto z-[99] items-center overflow-hidden rounded-xl border border-neutral-200 bg-white shadow-sm",collisionPadding:0,...s,children:typeof t=="string"?U("span",{className:i("block max-w-xs text-pretty px-4 py-2 text-center text-sm text-neutral-700",r),children:t}):typeof t=="function"?t({setOpen:d}):t})})]})}function Gb({title:e,cta:t,href:r,target:o,onClick:a}){return Ye("div",{className:"flex max-w-xs flex-col items-center space-y-3 p-4 text-center",children:[U("p",{className:"text-sm text-neutral-700",children:e}),t&&(r?U(ns,{href:r,...o?{target:o}:{},className:i(se({variant:"primary"}),"flex h-9 w-full items-center justify-center whitespace-nowrap rounded-lg border px-4 text-sm"),children:t}):a?U(te,{onClick:a,text:t,variant:"primary",className:"h-9"}):null)]})}function jb({title:e,cta:t,href:r}){return Ye("div",{className:"max-w-xs px-4 py-2 text-center text-sm text-neutral-700",children:[e,t&&r&&Ye(ss,{children:[" ",U("a",{href:r,target:"_blank",rel:"noopener noreferrer",onClick:o=>o.stopPropagation(),className:"inline-flex text-neutral-500 underline underline-offset-4 hover:text-neutral-800",children:t})]})]})}function Kb({children:e,className:t,tooltipClassName:r}){return U("div",{className:i("block max-w-xs whitespace-pre-wrap text-balance px-4 py-2 text-center text-sm text-neutral-700",r),children:U(os,{as:"p",options:{target:"_blank",rel:"noopener noreferrer nofollow",className:i("underline underline-offset-4 text-neutral-400 hover:text-neutral-700",t)},children:e})})}function Yb(e){return U(Q,{...e,children:U(as,{className:"h-4 w-4 text-neutral-500"})})}function Zb({value:e,unit:t="total clicks",prefix:r,children:o,lastClicked:a}){return(!e||e<1e3)&&!a?o:U(Q,{content:Ye("div",{className:"block max-w-xs px-4 py-2 text-center text-sm text-neutral-700",children:[Ye("p",{className:"text-sm font-semibold text-neutral-700",children:[r,Qt(e||0,{full:!0})," ",t]}),a&&Ye("p",{className:"mt-1 text-xs text-neutral-500",suppressHydrationWarning:!0,children:["Last clicked ",Qo(a,{withAgo:!0})]})]}),children:o})}function qb({children:e,content:t,...r}){return U(Q,{content:t,...r,children:U("div",{className:"flex cursor-pointer items-center",children:U(fr,{variant:"gray",className:"border-neutral-300 transition-all hover:bg-neutral-200",children:e})})})}function Xb({children:e,tooltipProps:t,...r}){return U(Q,{...t,children:U("button",{type:"button",...r,className:i("flex h-6 w-6 items-center justify-center rounded-md text-neutral-500 transition-colors duration-75 hover:bg-neutral-100 active:bg-neutral-200 disabled:cursor-not-allowed disabled:hover:bg-transparent",r.className),children:e})})}function ut({children:e,tooltipProps:t}){return t?U(Q,{...t,children:U("div",{children:e})}):e}import{jsx as pt,jsxs as Xa}from"react/jsx-runtime";var se=ls("transition-all",{variants:{variant:{primary:"border-black bg-black dark:bg-white dark:border-white text-content-inverted hover:bg-inverted hover:ring-4 hover:ring-border-subtle",secondary:i("border-border-subtle bg-white dark:bg-black text-content-emphasis hover:bg-bg-muted focus-visible:border-border-emphasis outline-none","data-[state=open]:border-border-emphasis data-[state=open]:ring-4 data-[state=open]:ring-border-subtle"),outline:"border-transparent text-content-default hover:bg-bg-subtle",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"}}),te=cs(({text:e,variant:t="primary",className:r,textWrapperClassName:o,shortcutClassName:a,loading:n,icon:c,shortcut:s,disabledTooltip:m,right:d,...l},u)=>m?pt(Q,{content:m,children:Xa("div",{className:i("flex h-10 w-full cursor-not-allowed items-center justify-center gap-x-2 rounded-md border border-neutral-200 bg-neutral-100 px-4 text-sm text-neutral-400 transition-all focus:outline-none",{"border-transparent bg-transparent":t==null?void 0:t.endsWith("outline")},r),children:[c,e&&pt("div",{className:i("min-w-0 truncate",s&&"flex-1 text-left",o),children:e}),s&&pt("kbd",{className:i("hidden rounded border border-neutral-200 bg-neutral-100 px-2 py-0.5 text-xs font-light text-neutral-400 md:inline-block",{"bg-neutral-100":t==null?void 0:t.endsWith("outline")},a),children:s})]})}):Xa("button",{ref:u,type:l.onClick?"button":"submit",className:i("group flex h-10 w-full items-center justify-center gap-2 whitespace-nowrap rounded-md border px-4 text-sm",l.disabled||n?"cursor-not-allowed border-neutral-200 bg-neutral-100 text-neutral-400 outline-none":se({variant:t}),r),disabled:l.disabled||n,...l,children:[n?pt(Pe,{}):c||null,e&&pt("div",{className:i("min-w-0 truncate",s&&"flex-1 text-left",o),children:e}),s&&pt("kbd",{className:i("hidden rounded px-2 py-0.5 text-xs font-light transition-all duration-75 md:inline-block",{"bg-neutral-700 text-neutral-400 group-hover:bg-neutral-600 group-hover:text-neutral-300":t==="primary","bg-neutral-200 text-neutral-400 group-hover:bg-neutral-100 group-hover:text-neutral-500":t==="secondary","bg-neutral-100 text-neutral-500 group-hover:bg-neutral-200":t==="outline","bg-red-100 text-red-600 group-hover:bg-red-500 group-hover:text-white":t==="danger-outline"},a),children:s}),d]}));te.displayName="Button";import{cva as ds}from"class-variance-authority";import{createContext as ms}from"react";import{jsx as Ja}from"react/jsx-runtime";var us=ds("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"}}}),Tt=ms({variant:"loose",loading:!1});function Qa({variant:e="loose",loading:t=!1,className:r,children:o}){return Ja("ul",{className:i(us({variant:e,loading:t}),r),"data-variant":e,children:Ja(Tt.Provider,{value:{variant:e,loading:t},children:o})})}import{cva as ps}from"class-variance-authority";import{createContext as fs,useContext as gs,useEffect as bs,useRef as hs,useState as vs}from"react";import{jsx as en,jsxs as Ns}from"react/jsx-runtime";var xs=ps("w-full group/card border-neutral-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-neutral-50 transition-colors",loose:"border rounded-xl transition-[filter] data-[hover-state-enabled=true]:hover:drop-shadow-card-hover"}}}),ys="w-full py-2.5 px-4",Qr=fs({hovered:!1});function tn({outerClassName:e,innerClassName:t,children:r,onClick:o,onAuxClick:a,hoverStateEnabled:n=!0,banner:c}){let{variant:s}=gs(Tt),m=hs(null),[d,l]=vs(!1);bs(()=>{if(!d||!m.current)return;let p=setInterval(()=>{var f;((f=m.current)==null?void 0:f.matches(":hover"))===!1&&l(!1)},1e3);return()=>clearInterval(p)},[d]);let u=p=>!(document.getElementById("modal-backdrop")||Ke(p));return Ns("li",{ref:m,className:i(xs({variant:s}),e),onPointerEnter:()=>l(!0),onPointerLeave:()=>l(!1),"data-hover-state-enabled":n,children:[c,en("div",{className:i(ys,t),onClick:o?p=>{u(p)&&o(p)}:void 0,onAuxClick:a?p=>{u(p)&&a(p)}:void 0,children:en(Qr.Provider,{value:{hovered:d},children:r})})]})}var N1=Object.assign(Qa,{Card:Object.assign(tn,{Context:Qr}),Context:Tt});import{motion as ul}from"framer-motion";import{forwardRef as pl,useRef as fl}from"react";import{useEffect as ws,useState as Cs}from"react";function rn(e){if(typeof window>"u")return null;let t=window.localStorage.getItem(e);return t?JSON.parse(t):null}function eo(e,t){let[r,o]=Cs(rn(e)??t);return ws(()=>{let n=rn(e);n&&o(n)},[e]),[r,n=>{o(n),window.localStorage.setItem(e,JSON.stringify(n))}]}function ks(e){return e&&typeof e=="object"&&Array.isArray(e.all)&&Array.isArray(e.defaultVisible)}function S1(e,t){if(!ks(t)){let o=t,a=m=>{let d=o[m];return Object.fromEntries(d.all.map(l=>[l,d.defaultVisible.includes(l)]))},n=Object.fromEntries(Object.keys(o).map(m=>[m,a(m)])),[c,s]=eo(e,n);return{columnVisibility:c,setColumnVisibility:(m,d)=>{let l=o[m].all,u=c[m]||{},p=Object.fromEntries(l.map(f=>[f,f in d?d[f]:u[f]??!1]));s({...c,[m]:p})}}}else{let o=t,a=Object.fromEntries(o.all.map(s=>[s,o.defaultVisible.includes(s)])),[n,c]=eo(e,a);return{columnVisibility:n,setColumnVisibility:s=>{let m=o.all,d=n||{},l=Object.fromEntries(m.map(u=>[u,u in s?s[u]:d[u]??!1]));c(l)}}}}import to from"js-cookie";import{useEffect as Ps,useState as Ss}from"react";function M1(e,t,r){let[o,a]=Ss(()=>{let c=to.get(e);return c?JSON.parse(c):t});return Ps(()=>{let c=()=>{let s=to.get(e);s&&a(JSON.parse(s))};return window.addEventListener("storage",c),()=>{window.removeEventListener("storage",c)}},[e]),[o,c=>{a(c),to.set(e,JSON.stringify(c),r)}]}import{useCallback as Rs,useEffect as Ts,useRef as Ls,useState as Ms}from"react";var ft=(e=3e3)=>{let t=Ls(null),[r,o]=Ms(!1),a=()=>{t.current&&(clearTimeout(t.current),t.current=null)},n=Rs(async(c,{onSuccess:s,throwOnError:m}={})=>{a();try{typeof c=="string"?await navigator.clipboard.writeText(c):c instanceof ClipboardItem&&await navigator.clipboard.write([c]),o(!0),s==null||s(),Number.isFinite(e)&&e>=0&&(t.current=setTimeout(()=>o(!1),e))}catch(d){if(console.error("Failed to copy: ",d),m)throw d}},[e]);return Ts(()=>()=>a(),[]),[r,n]};import{useEffect as Ds,useState as Es}from"react";function O1(){let[e,t]=Es(null);return Ds(()=>{let r=document.querySelector("[data-mdx-container]");if(!r)return;let o=r.offsetTop-1,a=new IntersectionObserver(s=>{var u,p,f;let m=s[0];if(!m)return;let d=(((u=m.rootBounds)==null?void 0:u.height)||0)*.3+o;for(let g=1;g<s.length;g++){let h=s[g];if(!h)break;(h.boundingClientRect.top<m.boundingClientRect.top||m.boundingClientRect.bottom<o)&&(m=h)}let l=m.target;for(;l&&l.getBoundingClientRect().bottom<o;)l=(p=n.get(l))==null?void 0:p.next;for(;l&&l.getBoundingClientRect().top>d;)l=(f=n.get(l))==null?void 0:f.prev;l&&t(l.getAttribute("href"))},{threshold:1,rootMargin:`-${o}px 0px 0px 0px`}),n=new Map;return(r==null?void 0:r.querySelectorAll("[data-mdx-heading]")).forEach(s=>a.observe(s)),()=>{a.disconnect()}},[]),e==null?void 0:e.replace("#","")}import{useEffect as Is,useState as As}from"react";function _1(){let[e,t]=As(null);return Is(()=>{let r=window.location.hostname;ta.has(r)?t("app"):oa.has(r)?t("partners"):ra.has(r)&&t("admin")},[]),{subdomain:e}}import{useCallback as Os}from"react";function $1(e){return{handleKeyDown:Os(r=>{if(r.key==="Enter"&&r.metaKey){if(r.preventDefault(),e!=null&&e.current){e.current.requestSubmit();return}let o=r.target.form;o==null||o.requestSubmit()}},[])}}import{useEffect as zs,useState as Vs}from"react";function K1(e,t={}){let{root:r,defaultValue:o}=t,[a,n]=Vs(o??!1);return zs(()=>{let c=()=>{let m=e.current;if(!m)return;let d=r==null?void 0:r.current,l=m.getBoundingClientRect(),u=d?d.getBoundingClientRect():{top:0,left:0,bottom:window.innerHeight,right:window.innerWidth};n(l.top<u.bottom&&l.bottom>u.top&&l.left<u.right&&l.right>u.left)};((r==null?void 0:r.current)||window).addEventListener("scroll",c),window.addEventListener("resize",c);let s=null;return e.current&&(s=new IntersectionObserver(c),s.observe(e.current)),c(),()=>{((r==null?void 0:r.current)||window).removeEventListener("scroll",c),window.removeEventListener("resize",c),s==null||s.disconnect()}},[e,r]),a}import{useEffect as Hs,useState as _s}from"react";function q1(){let[e,t]=_s(!1);return Hs(()=>{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 Fs,useState as Ws}from"react";function eh(e,{threshold:t=0,root:r=null,rootMargin:o="0%",freezeOnceVisible:a=!1}={}){let[n,c]=Ws(),s=(n==null?void 0:n.isIntersecting)&&a,m=([d])=>{c(d)};return Fs(()=>{let d=e==null?void 0:e.current;if(!!!window.IntersectionObserver||s||!d)return;let u={threshold:t,root:r,rootMargin:o},p=new IntersectionObserver(m,u);return p.observe(d),()=>p.disconnect()},[e,JSON.stringify(t),r,o,s]),n}import{createContext as Bs,useCallback as $s,useContext as Us,useEffect as on,useId as Gs,useState as js}from"react";import{jsx as Ks}from"react/jsx-runtime";var an=Bs({listeners:[],setListeners:()=>{}});function ih({children:e}){let[t,r]=js([]);return Ks(an.Provider,{value:{listeners:t,setListeners:r},children:e})}function Ie(e,t,r={}){let o=Gs(),{listeners:a,setListeners:n}=Us(an),c=$s(s=>{if(r.enabled===!1)return;let m=s.target,d=document.getElementById("modal-backdrop"),l=document.querySelector("[data-sheet-overlay]");if(m.tagName==="INPUT"||m.tagName==="TEXTAREA"||!!d!=!!r.modal||!!l!=!!r.sheet)return;let u=[...s.metaKey?["meta"]:[],...s.ctrlKey?["ctrl"]:[],...s.altKey?["alt"]:[],s.key].join("+");if(Array.isArray(e)?!e.includes(u):u!==e)return;let p=a.filter(g=>g.enabled!==!1&&!!d==!!g.modal&&!!l==!!g.sheet&&(Array.isArray(g.key)?g.key.includes(u):g.key===u));!p.length||Jo(p,(g,h)=>(h.priority??0)-(g.priority??0))[0].id!==o||(s.preventDefault(),t(s))},[e,a,o,t,r.enabled,r.modal,r.sheet]);on(()=>(document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)),[c]),on(()=>(n(s=>[...s.filter(m=>m.id!==o),{id:o,key:e,...r}]),()=>n(s=>s.filter(m=>m.id!==o))),[JSON.stringify(e),r.enabled,r.priority])}import{toast as Ys}from"sonner";import Zs from"swr";function mh(e,t){let{data:r,isLoading:o,mutate:a}=Zs(e,be);return{data:r,isLoading:o,update:async(n,c)=>Ys.promise(a(n(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 cn,useMemo as tl}from"react";import{useEffect as nn,useState as qs}from"react";function sn({pageSize:e,page:t,onPageChange:r}){let[o,a]=qs({pageIndex:t,pageSize:e});return nn(()=>{a(n=>({...n,pageIndex:t}))},[t]),nn(()=>{r==null||r(o.pageIndex)},[o]),{pagination:o,setPagination:a}}import{usePathname as Xs,useRouter as Js,useSearchParams as Qs}from"next/navigation";import{useCallback as el}from"react";function ln(){let e=Xs(),t=Js(),r=Qs(),o=Object.fromEntries(r),a=(c,s)=>{let m=new URLSearchParams(r);if((s==null?void 0:s.include)&&Array.isArray(s.include)){let l=new URLSearchParams;r.forEach((u,p)=>{var f;(f=s.include)!=null&&f.includes(p)&&l.set(p,u)}),m=l}(s==null?void 0:s.exclude)&&Array.isArray(s.exclude)&&s.exclude.forEach(l=>m.delete(l)),c&&Object.entries(c).forEach(([l,u])=>m.set(l,u));let d=m.toString();return d.length>0?`?${d}`:""},n=el(({set:c,del:s,replace:m,scroll:d=!0,getNewPath:l,arrayDelimiter:u=","})=>{let p=new URLSearchParams(r);c&&Object.entries(c).forEach(([h,v])=>p.set(h,Array.isArray(v)?v.join(u):v)),s&&(Array.isArray(s)?s.forEach(h=>p.delete(h)):p.delete(s));let f=p.toString(),g=`${e}${f.length>0?`?${f}`:""}`;if(l)return g;m?t.replace(g,{scroll:!1}):t.push(g,{scroll:d})},[r,e,t]);return{pathname:e,router:t,searchParams:r,searchParamsObj:o,queryParams:n,getQueryString:a}}function Ch(e=ia){let{searchParams:t,queryParams:r}=ln(),o=tl(()=>parseInt(t.get("page")||"1")||1,[t.get("page")]),{pagination:a,setPagination:n}=sn({pageSize:e,page:o,onPageChange:c=>{r(c===1?{del:"page",scroll:!1}:{set:{page:c.toString()},scroll:!1})}});return cn(()=>{let c=parseInt(t.get("page")||"1")||1;n(s=>({...s,pageIndex:c}))},[t.get("page")]),cn(()=>{r(a.pageIndex===1?{del:"page",scroll:!1}:{set:{page:a.pageIndex.toString()},scroll:!1})},[a]),{pagination:a,setPagination:n}}import{useEffect as rl}from"react";function Sh(){rl(()=>{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 ol,useState as al}from"react";function gr(e){let[t,r]=al(),o=([a])=>{r(a)};return ol(()=>{let a=e==null?void 0:e.current;if(!a)return;let n=new ResizeObserver(o);return n.observe(a),()=>n.disconnect()},[e]),t}import{useCallback as nl,useEffect as dn,useState as il}from"react";function mn(e,{container:t}={}){let[r,o]=il(!1),a=nl(()=>{o((t!=null&&t.current?t.current.scrollTop:window.scrollY)>e)},[e]);return dn(()=>{let n=(t==null?void 0:t.current)??window;return n.addEventListener("scroll",a),()=>n.removeEventListener("scroll",a)},[a]),dn(()=>{a()},[a]),r}import{useCallback as sl,useEffect as ll,useState as cl}from"react";function Ae(e){let[t,r]=cl(1),o=sl(()=>{if(!e.current)return;let{scrollTop:n,scrollHeight:c,clientHeight:s}=e.current;r(c===s?1:Math.min(n/(c-s),1))},[]),a=gr(e);return ll(o,[a]),{scrollProgress:t,updateScrollProgress:o}}import{useEffect as dl}from"react";import{toast as pn}from"sonner";import{jsx as br,jsxs as un}from"react/jsx-runtime";function ml({id:e,message:t,undo:r}){let o=()=>{r(),pn.dismiss(e)},a=n=>{n.key==="z"&&(n.ctrlKey||n.metaKey)&&o()};return dl(()=>(document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)),[]),un("div",{className:"flex w-full items-center justify-between space-x-2",children:[un("div",{className:"flex items-center space-x-2",children:[br(ua,{}),br("p",{className:"font-medium",children:t})]}),br("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 Wh(){return({id:t,message:r,undo:o,duration:a})=>pn(br(ml,{id:t,message:r,undo:o}),{id:t,...a&&{duration:a}})}import{jsx as fn}from"react/jsx-runtime";var pe=pl(({width:e=!1,height:t=!1,className:r,transition:o,children:a,...n},c)=>{var d,l;let s=fl(null),m=gr(s);return fn(ul.div,{ref:c,className:i("overflow-hidden",r),animate:{width:e?((d=m==null?void 0:m.contentRect)==null?void 0:d.width)??"auto":"auto",height:t?((l=m==null?void 0:m.contentRect)==null?void 0:l.height)??"auto":"auto"},transition:o??{type:"spring",duration:.3},...n,children:fn("div",{ref:s,className:i(t&&"h-max",e&&"w-max"),children:a})})});pe.displayName="AnimatedSizeContainer";import{jsx as Se,jsxs as gn}from"react/jsx-runtime";function Qh({options:e,value:t,onChange:r,className:o,gridCols:a="2",name:n,disabled:c=!1,animated:s=!0}){let m={1:"grid-cols-1",2:"grid-cols-1 lg:grid-cols-2",3:"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}[a],d=Se("div",{className:i("grid gap-3",m),children:e.map(({key:l,label:u,description:p,icon:f})=>{let g=t===l;return gn("label",{className:i("relative flex w-full cursor-pointer items-start rounded-md border border-neutral-200 bg-white text-neutral-600 hover:bg-neutral-50","transition-all duration-150",g&&"border-black bg-neutral-50 text-neutral-900 ring-1 ring-black",c&&"cursor-not-allowed opacity-50",o),children:[Se("input",{type:"radio",name:n,value:l,className:"hidden",checked:g,disabled:c,onChange:h=>{h.target.checked&&r&&r(l)}}),f&&Se("div",{className:"flex-shrink-0 pt-0.5",children:f}),gn("div",{className:"flex grow flex-col p-3 pr-0",children:[Se("span",{className:"pr-1 text-sm font-semibold text-neutral-900",children:u}),Se("span",{className:"text-xs text-neutral-600",children:p})]}),Se(Sa,{className:i("mr-1.5 mt-1.5 flex size-4 scale-75 items-center justify-center rounded-full opacity-0 transition-[transform,opacity] duration-150",g&&"scale-100 opacity-100")})]},l)})});return s?Se("div",{className:"-m-1",children:Se(pe,{height:!0,transition:{ease:"easeInOut",duration:.2},children:Se("div",{className:"p-1",children:d})})}):d}import gl from"embla-carousel-autoplay";import bl from"embla-carousel-react";import{ArrowLeft as hl,ArrowRight as vl}from"lucide-react";import{createContext as xl,forwardRef as Mt,useCallback as Lt,useContext as yl,useEffect as ro,useState as oo}from"react";import{jsx as Re,jsxs as vn}from"react/jsx-runtime";var ao=2e3,bn=xl(null);function ve(){let e=yl(bn);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}function hn(){let{api:e}=ve(),[t,r]=oo(0),o=Lt(a=>r((a==null?void 0:a.selectedScrollSnap())??0),[]);return ro(()=>{!e||(o(e),e.on("reInit",o),e.on("select",o))},[e,o]),t}var Nl=Mt(({orientation:e="horizontal",opts:t,setApi:r,autoplay:o,plugins:a,className:n,children:c,...s},m)=>{let[d,l]=bl({...t,axis:e==="horizontal"?"x":"y"},[...o?[gl(typeof o=="object"?o:{delay:ao})]:[],...a||[]]),[u,p]=oo(!1),[f,g]=oo(!1),h=Lt(N=>{!N||(p(N.canScrollPrev()),g(N.canScrollNext()))},[]),v=Lt(()=>{l==null||l.scrollPrev()},[l]),y=Lt(()=>{l==null||l.scrollNext()},[l]),w=Lt(N=>{N.key==="ArrowLeft"?(N.preventDefault(),v()):N.key==="ArrowRight"&&(N.preventDefault(),y())},[v,y]);return ro(()=>{!l||!r||r(l)},[l,r]),ro(()=>{if(!!l)return h(l),l.on("reInit",h),l.on("select",h),()=>{l==null||l.off("select",h)}},[l,h]),Re(bn.Provider,{value:{carouselRef:d,api:l,opts:t,orientation:e||((t==null?void 0:t.axis)==="y"?"vertical":"horizontal"),scrollPrev:v,scrollNext:y,canScrollPrev:u,canScrollNext:f},children:Re("div",{ref:m,onKeyDownCapture:w,className:i("relative",n),role:"region","aria-roledescription":"carousel",...s,children:c})})});Nl.displayName="Carousel";var wl=Mt(({className:e,...t},r)=>{let{carouselRef:o,orientation:a}=ve();return Re("div",{ref:o,className:"overflow-hidden",children:Re("div",{ref:r,className:i("flex",a==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})});wl.displayName="CarouselContent";var Cl=Mt(({className:e,...t},r)=>{let{orientation:o}=ve();return Re("div",{ref:r,role:"group","aria-roledescription":"slide",className:i("min-w-0 shrink-0 grow-0 basis-full",o==="horizontal"?"pl-4":"pt-4",e),...t})});Cl.displayName="CarouselItem";var kl=Mt(({className:e,...t},r)=>{let{orientation:o,scrollPrev:a,canScrollPrev:n}=ve();return vn("button",{ref:r,className:i("absolute",o==="horizontal"?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",se({variant:"secondary",className:"p-2"}),e),disabled:!n,onClick:a,...t,children:[Re(hl,{className:"h-4 w-4"}),Re("span",{className:"sr-only",children:"Previous slide"})]})});kl.displayName="CarouselPrevious";var Pl=Mt(({className:e,...t},r)=>{let{orientation:o,scrollNext:a,canScrollNext:n}=ve();return vn("button",{ref:r,className:i("absolute",o==="horizontal"?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",se({variant:"secondary",className:"p-2"}),e),disabled:!n,onClick:a,...t,children:[Re(vl,{className:"h-4 w-4"}),Re("span",{className:"sr-only",children:"Next slide"})]})});Pl.displayName="CarouselNext";import{cva as Sl}from"class-variance-authority";import{motion as Rl}from"framer-motion";import{ChevronLeft as Tl,ChevronRight as Ll}from"lucide-react";import*as Oe from"react";import{jsx as Ze,jsxs as Dt}from"react/jsx-runtime";var Ml=Sl("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-neutral-800/10 bg-white sm:bottom-6 "}}}),hv=({variant:e="simple",className:t})=>{var g;let{scrollNext:r,scrollPrev:o,canScrollNext:a,canScrollPrev:n,api:c}=ve(),s=(g=c==null?void 0:c.plugins())==null?void 0:g.autoplay,[m,d]=Oe.useState(0),[l,u]=Oe.useState(!1),p=Oe.useCallback(h=>{d((h==null?void 0:h.selectedScrollSnap())??0)},[]),f=Oe.useCallback(h=>()=>{s&&s.isPlaying()&&s.stop(),h()},[s]);return Oe.useEffect(()=>{!c||(p(c),u((s==null?void 0:s.isPlaying())??!1),c.on("reInit",p),c.on("select",p),c.on("autoplay:play",()=>u(!0)),c.on("autoplay:stop",()=>u(!1)))},[c,s,p]),Dt("div",{className:i(Ml({variant:e}),t),children:[e!=="simple"&&Dt("button",{className:"cursor-pointer rounded-full p-2 hover:bg-neutral-50 active:bg-neutral-100",disabled:!n,onClick:f(o),children:[Ze(Tl,{className:"h-4 w-4"}),Ze("span",{className:"sr-only",children:"Previous slide"})]}),c!=null&&Ze("div",{className:"flex items-center gap-1",children:c.slideNodes().map((h,v)=>Dt("button",{onClick:f(()=>c.scrollTo(v)),className:"rounded-full p-0.5 hover:bg-neutral-100 active:bg-neutral-200 sm:p-1.5",children:[Ze("div",{className:i("relative isolate h-1.5 w-1.5 overflow-hidden rounded-full transition-all",v===m?"bg-black":"bg-black/20",l&&v===m&&"w-6 bg-black/20"),children:l&&v===m&&Ze(Rl.div,{initial:{x:"-100%"},animate:{x:0},transition:{type:"tween",duration:((s==null?void 0:s.options.delay)??ao)/1e3},className:"animate-fill-width h-full w-full rounded-full bg-black"})}),Dt("span",{className:"sr-only",children:["Slide ",v+1]})]},v))}),e!=="simple"&&Dt("button",{className:"cursor-pointer rounded-full p-2 hover:bg-neutral-50 active:bg-neutral-100",disabled:!a,onClick:f(r),children:[Ze(Ll,{className:"h-4 w-4"}),Ze("span",{className:"sr-only",children:"Next slide"})]})]})};import Dl from"embla-carousel-react";import{forwardRef as El,useCallback as Il,useEffect as Al}from"react";import{jsx as hr}from"react/jsx-runtime";var Sv=({className:e,...t})=>{let{api:r}=ve(),[o,a]=Dl({dragFree:!0}),n=Il(c=>{!c||!a||a==null||a.scrollTo(c.selectedScrollSnap())},[a]);return Al(()=>{if(!(!r||!a))return n(r),r.on("reInit",n),r.on("select",n),()=>{r==null||r.off("reInit",n),r==null||r.off("select",n)}},[r,a,n]),hr("div",{className:"overflow-hidden",ref:o,children:hr("div",{className:i("mx-4 flex gap-4",e),...t})})},Rv=El(({index:e,className:t,...r},o)=>{let{api:a}=ve(),n=hn();return hr("div",{ref:o,children:hr("button",{type:"button",onClick:()=>{var s;if(!a)return;let c=(s=a.plugins())==null?void 0:s.autoplay;c&&c.isPlaying()&&c.stop(),a.scrollTo(e)},className:typeof t=="function"?t({active:e===n}):t,...r})})});import*as Et from"@radix-ui/react-checkbox";import{forwardRef as Ol}from"react";import{jsx as no,jsxs as zl}from"react/jsx-runtime";var gt=Ol(({className:e,...t},r)=>no(Et.Root,{ref:r,className:i("peer h-5 w-5 shrink-0 rounded-md border border-neutral-200 bg-white outline-none focus-visible:border-black disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-500 data-[state=indeterminate]:bg-blue-500",e),...t,children:zl(Et.Indicator,{className:"group/indicator flex items-center justify-center text-white",children:[no(ir,{className:"size-3 group-data-[state=indeterminate]/indicator:hidden"}),no(dr,{className:"size-3 group-data-[state=checked]/indicator:hidden"})]})}));gt.displayName=Et.Root.displayName;import{Command as At,CommandInput as Vl,CommandItem as Hl,useCommandState as _l}from"cmdk";import{ChevronDown as Fl}from"lucide-react";import{forwardRef as Wl,isValidElement as Bl,useCallback as $l,useEffect as xr,useRef as Ul,useState as It}from"react";import*as ze from"@radix-ui/react-popover";import{Drawer as bt}from"vaul";import{jsx as Te,jsxs as vr}from"react/jsx-runtime";function xe({children:e,content:t,align:r="center",side:o="bottom",openPopover:a,setOpenPopover:n,mobileOnly:c,popoverContentClassName:s,onOpenAutoFocus:m,collisionBoundary:d,sticky:l,onEscapeKeyDown:u,onWheel:p}){let{isMobile:f}=Y();return c||f?vr(bt.Root,{open:a,onOpenChange:n,children:[Te(bt.Trigger,{className:"sm:hidden",asChild:!0,children:e}),vr(bt.Portal,{children:[Te(bt.Overlay,{className:"bg-bg-subtle fixed inset-0 z-50 bg-opacity-10 backdrop-blur"}),vr(bt.Content,{className:"border-border-subtle bg-bg-default fixed bottom-0 left-0 right-0 z-50 mt-24 rounded-t-[10px] border-t",onEscapeKeyDown:u,onPointerDownOutside:g=>{g.target instanceof Element&&g.target.closest("[data-sonner-toast]")&&g.preventDefault()},children:[Te("div",{className:"sticky top-0 z-20 flex w-full items-center justify-center rounded-t-[10px] bg-inherit",children:Te("div",{className:"bg-border-default my-3 h-1 w-12 rounded-full"})}),Te("div",{className:"bg-bg-default flex min-h-[150px] w-full items-center justify-center overflow-hidden pb-8 align-middle shadow-xl",children:t})]}),Te(bt.Overlay,{})]})]}):vr(ze.Root,{open:a,onOpenChange:n,children:[Te(ze.Trigger,{className:"sm:inline-flex",asChild:!0,children:e}),Te(ze.Portal,{children:Te(ze.Content,{sideOffset:8,align:r,side:o,className:i("animate-slide-up-fade border-border-subtle bg-bg-default z-50 items-center rounded-lg border drop-shadow-lg sm:block",s),sticky:l,collisionBoundary:d,onOpenAutoFocus:m,onEscapeKeyDown:u,onWheel:p,children:t})})]})}import{Fragment as yr,jsx as E,jsxs as Le}from"react/jsx-runtime";function Gl(e,t){return e===!0}function Qv({multiple:e,selected:t,setSelected:r,onSelect:o,options:a,icon:n,placeholder:c="Select...",searchPlaceholder:s="Search...",emptyState:m,createLabel:d,onCreate:l,buttonProps:u,shortcutHint:p,caret:f,side:g,open:h,onOpenChange:v,onSearchChange:y,shouldFilter:w=!0,inputRight:N,inputClassName:k,optionRight:C,optionClassName:A,matchTriggerWidth:W,hideSearch:T=!1,children:P}){let G=Gl(e,r),x=Array.isArray(t)?t:t?[t]:[],{isMobile:S}=Y(),[R,L]=It(!1),X=h??R,M=v??L,[ge,Ur]=It(""),[Ko,Gr]=It(!1),[jr,Hi]=It(void 0),[_i,Yo]=It(!1),Fi=V=>{var st;if(o==null||o(V),!!r)if(G){let Ge=x.some(({value:je})=>je===V.value);r(Ge?x.filter(({value:je})=>je!==V.value):[...x,V])}else r(x.length&&((st=x[0])==null?void 0:st.value)===V.value?null:V),M(!1)},Zo=$l((V,st)=>st===""?[...V.filter(Ge=>Ge.first&&!x.some(je=>je.value===Ge.value)),...x,...V.filter(Ge=>!Ge.first&&!x.some(je=>je.value===Ge.value))]:V,[x]);return xr(()=>{Ko&&(Hi(a&&Zo(a,ge)),Gr(!1))},[Ko,a,Zo,ge]),xr(()=>{Gr(!0)},[a]),xr(()=>{X||(Ur(""),Gr(!0))},[X]),xr(()=>y==null?void 0:y(ge),[ge]),E(xe,{openPopover:X,setOpenPopover:M,align:"start",side:g,onWheel:V=>{V.stopPropagation()},popoverContentClassName:i(W&&"sm:w-[var(--radix-popover-trigger-width)]"),content:E(pe,{width:!S&&!W,height:!0,style:{transform:"translateZ(0)"},transition:{ease:"easeInOut",duration:.1},className:"pointer-events-auto",children:Le(At,{loop:!0,shouldFilter:w,children:[!T&&Le("div",{className:"flex items-center overflow-hidden rounded-t-lg border-b border-neutral-200",children:[E(Vl,{placeholder:s,value:ge,onValueChange:Ur,className:i("grow border-0 py-3 pl-4 pr-2 outline-none placeholder:text-neutral-400 focus:ring-0 sm:text-sm",k),onKeyDown:V=>{(V.key==="Escape"||V.key==="Backspace"&&!ge)&&(V.preventDefault(),V.stopPropagation(),M(!1))}}),N&&E("div",{className:"mr-2",children:N}),p&&E("kbd",{className:"mr-2 hidden shrink-0 rounded border border-neutral-200 bg-neutral-100 px-2 py-0.5 text-xs font-light text-neutral-500 md:block",children:p})]}),E(jl,{children:E(At.List,{className:i("flex w-full min-w-[100px] flex-col gap-1 p-1"),children:jr!==void 0?Le(yr,{children:[jr.map(V=>E(Kl,{option:V,multiple:G,selected:x.some(({value:st})=>st===V.value),onSelect:()=>Fi(V),right:C==null?void 0:C(V),className:A},`${V.label}, ${V.value}`)),ge.length>0&&l&&Le(Hl,{className:i("flex cursor-pointer items-center gap-3 whitespace-nowrap rounded-md px-3 py-2 text-left text-sm text-neutral-700","data-[selected=true]:bg-neutral-100",A),onSelect:async()=>{Yo(!0),await(l==null?void 0:l(ge))&&(Ur(""),M(!1)),Yo(!1)},children:[_i?E(Pe,{className:"size-4 shrink-0"}):E(mt,{className:"size-4 shrink-0"}),E("div",{className:"grow truncate",children:(d==null?void 0:d(ge))||`Create "${ge}"`})]}),w?E(Zl,{className:"flex min-h-12 items-center justify-center text-sm text-neutral-500",children:m||"No matches"}):jr.length===0?E("div",{className:"flex min-h-12 items-center justify-center text-sm text-neutral-500",children:m||"No matches"}):null]}):E(At.Loading,{children:E("div",{className:"flex h-12 items-center justify-center",children:E(Pe,{})})})})})]})}),children:E(te,{variant:"secondary",...u,className:i(u==null?void 0:u.className,"flex gap-2"),textWrapperClassName:i(u==null?void 0:u.textWrapperClassName,"w-full flex items-center justify-start"),text:Le(yr,{children:[E("div",{className:"min-w-0 grow truncate text-left",children:P||x.map(V=>V.label).join(", ")||c}),f&&(f===!0?E(Fl,{className:"ml-1 size-4 shrink-0 text-neutral-400 transition-transform duration-75 group-data-[state=open]:rotate-180"}):f)]}),icon:n?xn(n)?n:E(n,{className:"size-4 shrink-0"}):void 0})})}var jl=({children:e})=>{let t=Ul(null),{scrollProgress:r,updateScrollProgress:o}=Ae(t);return Le(yr,{children:[E("div",{className:"scrollbar-hide max-h-[min(50vh,250px)] w-screen overflow-y-scroll sm:w-auto",ref:t,onScroll:o,children:e}),E("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 Kl({option:e,onSelect:t,multiple:r,selected:o,right:a,className:n}){return Le(yr,{children:[E(Yl,{disabledTooltip:e.disabledTooltip,children:Le(At.Item,{className:i("flex cursor-pointer items-center gap-3 whitespace-nowrap rounded-md px-3 py-2 text-left text-sm","data-[selected=true]:bg-neutral-100",Boolean(e.disabledTooltip)&&"cursor-not-allowed opacity-50",n),disabled:!!e.disabledTooltip,onSelect:t,value:e.label+(e==null?void 0:e.value),children:[r&&E("div",{className:"shrink-0 text-neutral-600",children:o?E(Ca,{className:"size-4 text-neutral-600"}):E(ka,{className:"size-4 text-neutral-400"})}),Le("div",{className:"flex min-w-0 grow items-center gap-1",children:[e.icon&&E("span",{className:"shrink-0 text-neutral-600",children:xn(e.icon)?e.icon:E(e.icon,{className:"h-4 w-4"})}),E("span",{className:"grow truncate",children:e.label})]}),a,!r&&o&&E(ir,{className:"size-4 shrink-0 text-neutral-600"})]})}),e.separatorAfter&&E(At.Separator,{className:"-mx-1 my-1 h-px bg-neutral-200"})]})}var Yl=({children:e,disabledTooltip:t})=>t?E(Q,{content:t,children:E("div",{children:e})}):e,xn=e=>Bl(e),Zl=Wl((e,t)=>_l(o=>o.filtered.count===0)?E("div",{ref:t,"cmdk-empty":"",role:"presentation",...e}):null);import{addYears as Nr,format as ql,isSameMonth as Xl}from"date-fns";import{ChevronLeft as yn,ChevronRight as Nn,ChevronsLeft as Jl,ChevronsRight as Ql}from"lucide-react";import{forwardRef as ec,useRef as tc}from"react";import{DayPicker as rc,useDayPicker as oc,useDayRender as ac,useNavigation as nc}from"react-day-picker";import{Fragment as ic,jsx as oe,jsxs as wr}from"react/jsx-runtime";var Ot=ec(({onClick:e,icon:t,disabled:r,...o},a)=>oe("button",{ref:a,type:"button",disabled:r,className:i("flex size-7 shrink-0 select-none items-center justify-center rounded border p-1 outline-none transition","border-neutral-200 text-neutral-600 hover:text-neutral-800","hover:bg-neutral-50 active:bg-neutral-100","disabled:pointer-events-none disabled:text-neutral-400"),onClick:e,...o,children:oe(t,{className:"h-full w-full shrink-0"})}));Ot.displayName="NavigationButton";function wn({mode:e="single",weekStartsOn:t=0,numberOfMonths:r=1,showYearNavigation:o=!1,disableNavigation:a,locale:n,className:c,classNames:s,...m}){return oe(rc,{mode:e,weekStartsOn:t,numberOfMonths:r,locale:n,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-neutral-400 pb-2",row:"w-full",cell:"relative p-0 text-center focus-within:relative text-neutral-900",day:i("relative size-10 rounded-md text-sm text-neutral-900","hover:bg-neutral-100 active:bg-neutral-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-neutral-300 line-through disabled:hover:bg-transparent",day_outside:"text-neutral-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",...s},components:{IconLeft:()=>oe(yn,{className:"h-4 w-4"}),IconRight:()=>oe(Nn,{className:"h-4 w-4"}),Caption:({...d})=>{let{goToMonth:l,nextMonth:u,previousMonth:p,currentMonth:f,displayMonths:g}=nc(),{numberOfMonths:h,fromDate:v,toDate:y}=oc(),w=g.findIndex(P=>Xl(d.displayMonth,P)),N=w===0,k=w===g.length-1,C=h>1&&(N||!k),A=h>1&&(k||!N),W=()=>{let P=Nr(f,-1);p&&(!v||P.getTime()>=v.getTime())&&l(P)},T=()=>{let P=Nr(f,1);u&&(!y||P.getTime()<=y.getTime())&&l(P)};return wr("div",{className:"flex items-center justify-between",children:[wr("div",{className:"flex items-center gap-1",children:[o&&!A&&oe(Ot,{disabled:a||!p||v&&Nr(f,-1).getTime()<v.getTime(),"aria-label":"Go to previous year",onClick:W,icon:Jl}),!A&&oe(Ot,{disabled:a||!p,"aria-label":"Go to previous month",onClick:()=>p&&l(p),icon:yn})]}),oe("div",{role:"presentation","aria-live":"polite",className:"text-sm font-medium capitalize tabular-nums text-neutral-900",children:ql(d.displayMonth,"LLLL yyy",{locale:n})}),wr("div",{className:"flex items-center gap-1",children:[!C&&oe(Ot,{disabled:a||!u,"aria-label":"Go to next month",onClick:()=>u&&l(u),icon:Nn}),o&&!C&&oe(Ot,{disabled:a||!u||y&&Nr(f,1).getTime()>y.getTime(),"aria-label":"Go to next year",onClick:T,icon:Ql})]})]})},Day:({date:d,displayMonth:l})=>{let u=tc(null),{activeModifiers:p,buttonProps:f,divProps:g,isButton:h,isHidden:v}=ac(d,l,u),{selected:y,today:w,disabled:N,range_middle:k}=p;if(v)return oe(ic,{});if(!h)return oe("div",{...g,className:i("flex items-center justify-center",g.className)});let{children:C,...A}=f;return wr("button",{ref:u,...A,type:"button",children:[C,w&&oe("span",{className:i("absolute inset-x-1/2 bottom-1.5 h-0.5 w-4 -translate-x-1/2 rounded-[2px]",{"bg-blue-500":!y,"!bg-white":y,"!bg-blue-400":y&&k,"text-neutral-400":N})})]})}},...m})}import{enUS as hc}from"date-fns/locale";import{useEffect as uo,useMemo as kn,useRef as vc,useState as kr}from"react";import{Command as io}from"cmdk";import{Lock as sc}from"lucide-react";import{jsx as qe,jsxs as lc}from"react/jsx-runtime";var so=({presets:e,onSelect:t,currentValue:r,currentPresetId:o})=>{let a=d=>"dateRange"in d,n=d=>"date"in d,c=(d,l)=>d.getDate()===l.getDate()&&d.getMonth()===l.getMonth()&&d.getFullYear()===l.getFullYear(),s=(d,l)=>{let u=d.from,p=l.from,f=!1;u&&p&&c(u,p)&&(f=!0);let g=d.to,h=l.to,v=!1;return g&&h&&c(g,h)&&(v=!0),f&&v},m=d=>{if(o)return o===d.id;if(a(d)){let l=r;return l&&s(l,d.dateRange)}else if(n(d)){let l=r;return l&&c(l,d.date)}return!1};return qe(io,{className:"w-full rounded ring-neutral-200 ring-offset-2 focus:outline-none",tabIndex:0,autoFocus:!0,loop:!0,children:qe(io.List,{className:"[&>*]:flex [&>*]:w-full [&>*]:items-start [&>*]:gap-x-2 [&>*]:gap-y-0.5 [&>*]:sm:flex-col",children:e.map((d,l)=>lc(io.Item,{disabled:d.requiresUpgrade,onSelect:()=>t(d),title:d.label,value:d.id,className:i("group relative flex cursor-pointer items-center justify-between overflow-hidden text-ellipsis whitespace-nowrap rounded border border-neutral-200","px-2.5 py-1.5 text-left text-sm text-neutral-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-neutral-100",m(d)&&"font-semibold text-neutral-800"),children:[qe("span",{children:d.label}),d.requiresUpgrade?qe(sc,{className:"h-3.5 w-3.5","aria-hidden":"true"}):d.shortcut?qe("kbd",{className:"text-neutral-4000 hidden rounded bg-neutral-100 px-2 py-0.5 text-xs font-light group-data-[selected=true]:bg-neutral-200 md:block",children:d.shortcut.toUpperCase()}):null,d.requiresUpgrade&&d.tooltipContent&&qe(Q,{side:"bottom",content:d.tooltipContent,children:qe("div",{className:"absolute inset-0 cursor-not-allowed"})})]},l))})})};so.displayName="DatePicker.Presets";import{format as Ve}from"date-fns";import{createContext as cc}from"react";var lo=cc({isOpen:!1,setIsOpen:()=>{}}),dc=()=>{let e=typeof window<"u"?window.navigator.language:"en-US",t=new Intl.DateTimeFormat(e,{hour:"numeric"}).format();return Number.isInteger(Number(t))},co=(e,t,r=!1)=>{let o=!dc(),a;return r?a=o?Ve(e,"d MMM, yyyy h:mm a",{locale:t}):Ve(e,"d MMM, yyyy HH:mm",{locale:t}):a=Ve(e,"d MMM, yyyy",{locale:t}),a},Cn=(e,t)=>{let{toYear:r,fromYear:o,fromMonth:a,toMonth:n,fromDay:c,toDay:s}=t;if(e&&e.length>0){let m=o,d=r;e.forEach(l=>{var u,p,f,g,h,v;if("date"in l){let y=l.date.getFullYear();if(o&&y<o)throw new Error(`Preset ${l.label} is before fromYear ${m}.`);if(r&&y>r)throw new Error(`Preset ${l.label} is after toYear ${d}.`);if(a&&l.date.getMonth()<a.getMonth())throw new Error(`Preset ${l.label} is before fromMonth ${a}.`);if(n&&l.date.getMonth()>n.getMonth())throw new Error(`Preset ${l.label} is after toMonth ${n}.`);if(c&&l.date.getDate()<c.getDate())throw new Error(`Preset ${l.label} is before fromDay ${c}.`);if(s&&l.date.getDate()>s.getDate())throw new Error(`Preset ${l.label} is after toDay ${Ve(s,"MMM dd, yyyy")}.`)}if("dateRange"in l){let y=(u=l.dateRange.from)==null?void 0:u.getFullYear(),w=(p=l.dateRange.to)==null?void 0:p.getFullYear();if(y&&o&&y<o)throw new Error(`Preset ${l.label}'s 'from' is before fromYear ${m}.`);if(w&&r&&w>r)throw new Error(`Preset ${l.label}'s 'to' is after toYear ${d}.`);if(a){let N=(f=l.dateRange.from)==null?void 0:f.getMonth();if(N&&N<a.getMonth())throw new Error(`Preset ${l.label}'s 'from' is before fromMonth ${Ve(a,"MMM, yyyy")}.`)}if(n){let N=(g=l.dateRange.to)==null?void 0:g.getMonth();if(N&&N>n.getMonth())throw new Error(`Preset ${l.label}'s 'to' is after toMonth ${Ve(n,"MMM, yyyy")}.`)}if(c){let N=(h=l.dateRange.from)==null?void 0:h.getDate();if(N&&N<c.getDate())throw new Error(`Preset ${l.dateRange.from}'s 'from' is before fromDay ${Ve(c,"MMM dd, yyyy")}.`)}if(s){let N=(v=l.dateRange.to)==null?void 0:v.getDate();if(N&&N>s.getDate())throw new Error(`Preset ${l.label}'s 'to' is after toDay ${Ve(s,"MMM dd, yyyy")}.`)}}})}};import{cva as mc}from"class-variance-authority";import{Calendar as uc,ChevronDown as pc}from"lucide-react";import{forwardRef as fc}from"react";import{jsx as Cr,jsxs as bc}from"react/jsx-runtime";var gc=mc(["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-neutral-200 text-neutral-900 placeholder-neutral-400 transition-all","disabled:pointer-events-none disabled:bg-neutral-100 disabled:text-neutral-400","focus-visible:border-neutral-500 data-[state=open]:border-neutral-500 data-[state=open]:ring-4 data-[state=open]:ring-neutral-200"],{variants:{hasError:{true:"ring-2 ring-red-200 border-red-500"}}}),mo=fc(({className:e,children:t,placeholder:r,hasError:o,...a},n)=>bc("button",{ref:n,className:i(gc({hasError:o}),e),...a,children:[Cr(uc,{className:i("h-4 w-4 shrink-0 text-neutral-400",!!t&&"text-neutral-900")}),Cr("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-neutral-900",children:t||(r?Cr("span",{className:"text-neutral-400",children:r}):null)}),Cr(pc,{className:"h-4 w-4 flex-shrink-0 text-neutral-400 transition-transform duration-75 group-data-[state=open]:rotate-180"})]}));mo.displayName="DatePicker.Trigger";import{jsx as ae,jsxs as Pn}from"react/jsx-runtime";var xc=({value:e,defaultValue:t,presetId:r,onChange:o,presets:a,disabled:n,disableNavigation:c,disabledDays:s,showYearNavigation:m=!1,locale:d=hc,placeholder:l="Select date range",hasError:u,align:p="center",className:f,...g})=>{let{isDesktop:h}=Y(),[v,y]=kr(!1),[w,N]=kr(a&&r?a==null?void 0:a.find(({id:L})=>L===r):void 0),[k,C]=kr((w==null?void 0:w.dateRange)??e??t??void 0),[A,W]=kr(k==null?void 0:k.to),T=kn(()=>k,[v]);uo(()=>{C(e)},[e]),uo(()=>{let L=a==null?void 0:a.find(({id:X})=>X===r);N(L),C((L==null?void 0:L.dateRange)??e??t)},[a,r]),uo(()=>{v?k&&W(k.to):W(k==null?void 0:k.to)},[v]);let P=(L,X)=>{let M=(k==null?void 0:k.from)&&(k==null?void 0:k.to)?{from:X}:L;C(M),N(void 0),(M==null?void 0:M.from)&&(M==null?void 0:M.to)&&(o==null||o(M),y(!1))},G=L=>{C(L.dateRange),N(L),o==null||o(L.dateRange,L),y(!1)},x=()=>{C(T),y(!1)},S=L=>{L||x(),y(L)},R=kn(()=>k?`${k.from?co(k.from,d):""} - ${k.to?co(k.to,d):""}`:null,[k,d]);return Ie((a==null?void 0:a.filter(L=>L.shortcut).map(L=>L.shortcut))??[],L=>{let X=a==null?void 0:a.find(M=>M.shortcut===L.key);X&&G(X)}),ae(lo.Provider,{value:{isOpen:v,setIsOpen:y},children:ae(xe,{align:p,openPopover:v,setOpenPopover:S,popoverContentClassName:"rounded-xl",content:ae("div",{className:"flex w-full",children:Pn("div",{className:"scrollbar-hide relative flex w-full flex-col overflow-x-scroll sm:flex-row-reverse sm:items-start",children:[a&&a.length>0&&ae(yc,{children:ae("div",{className:"absolute px-3 sm:inset-0 sm:left-0",children:ae("div",{className:"sm:py-3",children:ae(so,{currentPresetId:r,currentValue:k,presets:a,onSelect:G})})})}),ae("div",{className:"scrollbar-hide overflow-x-scroll",children:ae(wn,{mode:"range",selected:k,onSelect:P,month:A,onMonthChange:W,numberOfMonths:h?2:1,disabled:s,disableNavigation:c,showYearNavigation:m,locale:d,className:"scrollbar-hide overflow-x-scroll",classNames:{months:"flex flex-row divide-x divide-neutral-200 overflow-x-scroll scrollbar-hide"},...g})})]})}),children:ae(mo,{placeholder:l,disabled:n,className:f,hasError:u,"aria-required":g.required||g["aria-required"],"aria-invalid":g["aria-invalid"],"aria-label":g["aria-label"],"aria-labelledby":g["aria-labelledby"],children:(w==null?void 0:w.label)??R})})})};function Vx({presets:e,...t}){return e&&Cn(e,t),ae(xc,{presets:e,...t})}function yc({children:e}){let t=vc(null),{scrollProgress:r,updateScrollProgress:o}=Ae(t);return Pn("div",{className:"relative sm:h-full",children:[ae("div",{ref:t,onScroll:o,className:i("relative flex h-16 w-full items-center sm:h-full sm:w-48","border-b border-neutral-200 sm:border-b-0 sm:border-l","scrollbar-hide overflow-auto"),children:e}),ae("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)}})]})}import{useId as Nc}from"react";import{jsx as Pr,jsxs as wc}from"react/jsx-runtime";function Gx({dotSize:e=2,gapSize:t=10,patternOffset:r=[0,0],className:o}){let a=Nc();return wc("svg",{className:i("pointer-events-none absolute inset-0 text-black/10",o),width:"100%",height:"100%",children:[Pr("defs",{children:Pr("pattern",{id:`dots-${a}`,x:r[0]-1,y:r[1]-1,width:e+t,height:e+t,patternUnits:"userSpaceOnUse",children:Pr("rect",{x:1,y:1,width:e,height:e,fill:"currentColor"})})}),Pr("rect",{fill:`url(#dots-${a})`,width:"100%",height:"100%"})]})}import Cc from"next/link";import{useEffect as kc,useState as Sn}from"react";import Pc from"swr";import{jsx as po,jsxs as Rn}from"react/jsx-runtime";function Tn({className:e}){let{data:t}=Pc("https://status.dub.co/api/v1/summary",be),[r,o]=Sn("bg-neutral-200"),[a,n]=Sn("Loading status...");return kc(()=>{if(!t)return;let{ongoing_incidents:c}=t;if(c.length>0){let{current_worst_impact:s,name:m}=c[0],d=s==="degraded_performance"?"bg-yellow-500":"bg-red-500";n(m),o(d)}else n("All systems operational"),o("bg-green-500")},[t]),Rn(Cc,{href:"https://status.dub.co",target:"_blank",className:i("group flex max-w-fit items-center gap-2 rounded-lg border border-neutral-200 bg-white py-2 pl-2 pr-2.5 transition-colors hover:bg-neutral-50 active:bg-neutral-100",e),children:[Rn("div",{className:"relative size-2",children:[po("div",{className:i("absolute inset-0 m-auto size-2 animate-ping items-center justify-center rounded-full group-hover:animate-none",r,a==="Loading status..."&&"animate-none")}),po("div",{className:i("absolute inset-0 z-10 m-auto size-2 rounded-full",r)})]}),po("p",{className:"text-xs font-medium leading-none text-neutral-600",children:a})]})}import{jsx as Sr,jsxs as Ln}from"react/jsx-runtime";function Qx({icon:e,title:t,description:r,learnMore:o,children:a}){return Ln("div",{className:"flex flex-col items-center justify-center gap-y-4",children:[Sr("div",{className:"flex size-16 items-center justify-center rounded-2xl border border-neutral-200 bg-neutral-50",children:Sr(e,{className:"size-6 text-neutral-800"})}),Sr("p",{className:"text-center text-base font-medium text-neutral-950",children:t}),r&&Ln("p",{className:"max-w-sm text-balance text-center text-sm text-neutral-500",children:[r," ",o&&Sr("a",{href:o,target:"_blank",className:"underline underline-offset-2 hover:text-neutral-800",children:"Learn more \u2197"})]}),a]})}import{cva as Sc}from"class-variance-authority";import{useState as Mn}from"react";import{toast as Dn}from"sonner";import{Fragment as Tc,jsx as ye,jsxs as go}from"react/jsx-runtime";var En=["application/pdf","text/plain","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","text/csv"],fo={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)"},documents:{types:En,errorMessage:"File type not supported (document files only)"},programResourceImages:{types:["image/svg+xml","image/png","image/jpeg","image/webp"],errorMessage:"File type not supported (.svg, .png, .jpg, or .webp only)"},programResourceFiles:{types:[...En,"application/zip"],errorMessage:"File type not supported (document or zip files only)"}},Rc=Sc("group relative isolate flex aspect-[1200/630] w-full flex-col items-center justify-center overflow-hidden bg-white transition-all hover:bg-neutral-50",{variants:{variant:{default:"rounded-md border border-neutral-300 shadow-sm",plain:""}},defaultVariants:{variant:"default"}});function d2({id:e,readFile:t,onChange:r,variant:o,className:a,iconClassName:n,previewClassName:c,icon:s=Ma,customPreview:m,accept:d="any",imageSrc:l,loading:u=!1,clickToUpload:p=!0,showHoverOverlay:f=!0,content:g,maxFileSizeMB:h=0,targetResolution:v,accessibilityLabel:y="File upload",disabled:w=!1}){let[N,k]=Mn(!1),[C,A]=Mn(null),W=async T=>{let P="dataTransfer"in T?T.dataTransfer.files&&T.dataTransfer.files[0]:T.target.files&&T.target.files[0];if(!P)return;if(A(P.name),h>0&&P.size/1024/1024>h){Dn.error(`File size too big (max ${h} MB)`);return}let G=fo[d].types;if(G.length&&!G.includes(P.type)){Dn.error(fo[d].errorMessage??"File type not supported");return}let x=P;if(v&&P.type.startsWith("image/"))try{let S=await Xo(P,v),R=await fetch(S).then(L=>L.blob());x=new File([R],P.name,{type:P.type})}catch(S){console.error("Error resizing image:",S)}if(t){let S=new FileReader;S.onload=R=>{var L;return r==null?void 0:r({src:(L=R.target)==null?void 0:L.result,file:x})},S.readAsDataURL(x);return}r==null||r({file:x})};return go("label",{className:i(Rc({variant:o}),w?"cursor-not-allowed":i(p&&"cursor-pointer"),a),children:[u&&ye("div",{className:"absolute inset-0 z-[5] flex items-center justify-center rounded-[inherit] bg-white",children:ye(St,{})}),ye("div",{className:"absolute inset-0 z-[5]",onDragOver:T=>{T.preventDefault(),T.stopPropagation(),k(!0)},onDragEnter:T=>{T.preventDefault(),T.stopPropagation(),k(!0)},onDragLeave:T=>{T.preventDefault(),T.stopPropagation(),k(!1)},onDrop:async T=>{T.preventDefault(),T.stopPropagation(),W(T),k(!1)}}),go("div",{className:i("absolute inset-0 z-[3] flex flex-col items-center justify-center rounded-[inherit] border-2 border-transparent bg-white transition-all",w&&"bg-neutral-50",N&&!w&&"cursor-copy border-black bg-neutral-50 opacity-100",l?i("opacity-0",f&&!w&&"group-hover:opacity-100"):i(!w&&"group-hover:bg-neutral-50")),children:[ye(s,{className:i("size-7 transition-all duration-75",w?"text-neutral-400":i("text-neutral-500 group-hover:scale-110 group-active:scale-95",N?"scale-110":"scale-100"),n)}),g!==null&&ye("div",{className:i("mt-2 text-center text-sm text-neutral-500",w&&"text-neutral-400"),children:g??ye(Tc,{children:go("p",{children:["Drag and drop ",p&&"or click"," to upload."]})})}),ye("span",{className:"sr-only",children:y})]}),l&&(m??ye("img",{src:l,alt:"Preview",className:i("h-full w-full rounded-[inherit] object-cover",c)})),p&&ye("div",{className:"sr-only mt-1 flex shadow-sm",children:ye("input",{id:e,type:"file",accept:fo[d].types.join(","),onChange:W,disabled:w},C)})]})}import{AnimatePresence as Lc,motion as In}from"framer-motion";import{X as Mc}from"lucide-react";import Dc from"next/link";import{isValidElement as Ec}from"react";import{Fragment as Ic,jsx as ee,jsxs as zt}from"react/jsx-runtime";function On({filters:e,activeFilters:t,onRemove:r,onRemoveAll:o,className:a}){return Ie("Escape",o,{priority:1}),ee(pe,{height:!0,className:"w-full",transition:{type:"tween",duration:.3},children:zt("div",{className:i("flex w-full flex-wrap items-start gap-4 sm:flex-nowrap",a),children:[ee("div",{className:"flex grow flex-wrap gap-x-4 gap-y-2",children:ee(Lc,{children:t==null?void 0:t.map(({key:n,value:c})=>{if(n==="loader")return ee(In.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},className:"h-9 w-48 animate-pulse rounded-md border border-neutral-200 bg-white"},`loader-${c}`);let s=e.find(m=>m.key===n);return s?(s.multiple&&Array.isArray(c)?c:[c]).map(m=>{var f,g,h,v;let d=(f=s.options)==null?void 0:f.find(y=>typeof y.value=="string"&&typeof m=="string"?y.value.toLowerCase()===m.toLowerCase():y.value===m),l=(d==null?void 0:d.icon)??((g=s.getOptionIcon)==null?void 0:g.call(s,m,{key:s.key,option:d}))??s.icon,u=(d==null?void 0:d.label)??((h=s.getOptionLabel)==null?void 0:h.call(s,m,{key:s.key,option:d}))??m,p=(d==null?void 0:d.permalink)??((v=s.getOptionPermalink)==null?void 0:v.call(s,m))??null;return zt(In.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},className:"flex items-center divide-x rounded-md border border-neutral-200 bg-white text-sm text-black",children:[zt("div",{className:"flex items-center gap-2.5 px-3 py-2",children:[ee("span",{className:"shrink-0 text-neutral-600",children:An(s.icon)?s.icon:ee(s.icon,{className:"h-4 w-4"})}),s.label]}),ee("div",{className:"px-3 py-2 text-neutral-500",children:"is"}),ee("div",{className:"flex items-center gap-2.5 px-3 py-2",children:s.options?zt(Ic,{children:[ee("span",{className:"shrink-0 text-neutral-600",children:An(l)?l:ee(l,{className:"h-4 w-4"})}),p?ee(Dc,{href:p,target:"_blank",className:"cursor-alias decoration-dotted underline-offset-2 hover:underline",children:Pt(u,30)}):Pt(u,30)]}):ee("div",{className:"h-5 w-12 animate-pulse rounded-md bg-neutral-200"})}),ee("button",{type:"button",className:"h-full rounded-r-md p-2 text-neutral-500 ring-inset ring-neutral-500 hover:bg-neutral-100 hover:text-neutral-800 focus:outline-none focus-visible:ring-1",onClick:()=>r(n,m),children:ee(Mc,{className:"h-3.5 w-3.5"})})]},`${n}-${m}`)}):(console.error("Filter.List received an activeFilter without a corresponding filter"),null)})})}),(t==null?void 0:t.length)!==0&&zt("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-neutral-500 ring-inset ring-neutral-500 transition-colors hover:border-neutral-200 hover:bg-white hover:text-black focus:outline-none",onClick:o,children:["Clear Filters",ee("kbd",{className:"rounded-md border border-neutral-200 px-1.5 py-0.5 text-xs text-neutral-950 group-hover:bg-neutral-50",children:"ESC"})]})]})})}var An=e=>Ec(e);import{Command as He,useCommandState as Ac}from"cmdk";import{ChevronDown as Oc,ListFilter as zc}from"lucide-react";import{Fragment as Vc,forwardRef as Hc,isValidElement as Vn,useCallback as Rr,useEffect as Tr,useImperativeHandle as _c,useRef as ho,useState as bo}from"react";import{Fragment as Gc,jsx as F,jsxs as Ne}from"react/jsx-runtime";function Hn({filters:e,onSelect:t,onRemove:r,onOpenFilter:o,onSearchChange:a,onSelectedFilterChange:n,activeFilters:c,askAI:s,children:m,emptyState:d,className:l}){var P,G;let{isMobile:u}=Y(),p=ho(null),f=ho(),[g,h]=bo(!1);Ie("f",()=>h(!0),{enabled:!g});let[v,y]=bo(""),[w,N]=bo(null),k=Rr(()=>{y(""),N(null)},[]);Tr(()=>{g||k()},[g]);let C=w?e.find(({key:x})=>x===w):null,A=Rr(x=>{p.current&&(f.current={width:p.current.clientWidth,height:p.current.clientHeight}),y(""),N(x),o==null||o(x)},[]),W=Rr(x=>{if(!C||!c)return!1;let S=c.find(({key:R})=>R===w);return(S==null?void 0:S.value)===x||S&&C.multiple&&Array.isArray(S.value)&&S.value.includes(x)},[C]),T=Rr(x=>{C&&(W(x)?r(C.key,x):t(C.key,x),C.multiple||h(!1))},[c,C,s]);return Tr(()=>{a==null||a(v)},[v]),Tr(()=>{n==null||n(w)},[w]),Tr(()=>{(C==null?void 0:C.options)&&p.current&&(f.current={width:p.current.clientWidth,height:p.current.clientHeight})},[C==null?void 0:C.options]),F(xe,{openPopover:g,setOpenPopover:h,onEscapeKeyDown:x=>{w&&(x.preventDefault(),k())},content:F(pe,{width:!u,height:!0,className:"rounded-[inherit]",style:{transform:"translateZ(0)"},children:Ne(He,{loop:!0,shouldFilter:!C||C.shouldFilter!==!1,children:[Ne("div",{className:"flex items-center overflow-hidden rounded-t-lg border-b border-neutral-200",children:[F(Wc,{placeholder:`${(C==null?void 0:C.label)||"Filter"}...`,value:v,onValueChange:y,onKeyDown:x=>{(x.key==="Escape"||x.key==="Backspace"&&!v)&&(x.preventDefault(),x.stopPropagation(),w?k():h(!1))},emptySubmit:x=>{x.preventDefault(),x.stopPropagation(),s?(t("ai",C?`${C.label} ${v}`:v),h(!1)):T(v)}}),!C&&F("kbd",{className:"mr-2 hidden shrink-0 rounded border border-neutral-200 bg-neutral-100 px-2 py-0.5 text-xs font-light text-neutral-500 md:block",children:"F"})]}),F(Bc,{ref:p,children:Ne(He.List,{className:i("flex w-full flex-col gap-1 p-1",C?"min-w-[100px]":"min-w-[180px]"),children:[C?((G=(P=C.options)==null?void 0:P.filter(x=>!v||!x.hideDuringSearch))==null?void 0:G.map(x=>{let S=W(x.value);return F(zn,{filter:C,option:x,right:S?F(wa,{className:"h-4 w-4"}):x.right,onSelect:()=>T(x.value)},x.value)}))??F(He.Loading,{children:F("div",{className:"-m-1 flex items-center justify-center",style:f.current,children:F(Pe,{})})}):e.filter(x=>!x.hideInFilterDropdown).map(x=>Ne(Vc,{children:[F(zn,{filter:x,onSelect:()=>A(x.key)}),x.separatorAfter&&F(He.Separator,{className:"-mx-1 my-1 border-b border-neutral-200"})]},x.key)),(!C||C.options)&&F($c,{search:v,askAI:s,children:d?Fc(d)?(d==null?void 0:d[w??"default"])??"No matches":d:"No matches"})]})},w)]})}),children:Ne("button",{type:"button",className:i("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-neutral-200 bg-white text-neutral-900 placeholder-neutral-400","focus-visible:border-neutral-500 data-[state=open]:border-neutral-500 data-[state=open]:ring-4 data-[state=open]:ring-neutral-200",l),children:[F(zc,{className:"size-4 shrink-0"}),F("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-neutral-900",children:m??"Filter"}),c!=null&&c.length?F("div",{className:"flex size-4 shrink-0 items-center justify-center rounded-full bg-black text-[0.625rem] text-white",children:c.length}):F(Oc,{className:"size-4 shrink-0 text-neutral-400 transition-transform duration-75 group-data-[state=open]:rotate-180"})]})})}function Fc(e){return typeof e=="object"&&e!==null&&!Vn(e)}var Wc=e=>{let t=Ac(r=>r.filtered.count===0);return F(He.Input,{...e,size:1,className:"grow border-0 py-3 pl-4 pr-2 outline-none placeholder:text-neutral-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"})},Bc=Hc(({children:e},t)=>{let r=ho(null);_c(t,()=>r.current);let{scrollProgress:o,updateScrollProgress:a}=Ae(r);return Ne(Gc,{children:[F("div",{className:"scrollbar-hide max-h-[50vh] w-screen overflow-y-scroll sm:w-auto",ref:r,onScroll:a,children:e}),F("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 zn({filter:e,option:t,right:r,onSelect:o}){var s,m;let{isMobile:a}=Y(),n=t?t.icon??((s=e.getOptionIcon)==null?void 0:s.call(e,t.value,{key:e.key,option:t}))??e.icon:e.icon,c=t?t.label??((m=e.getOptionLabel)==null?void 0:m.call(e,t.value,{key:e.key,option:t})):e.label;return Ne(He.Item,{className:i("flex cursor-pointer items-center gap-3 whitespace-nowrap rounded-md px-3 py-2 text-left text-sm","data-[selected=true]:bg-neutral-100"),onPointerDown:d=>{d.preventDefault()},onPointerUp:d=>{d.preventDefault(),a?setTimeout(o,100):o()},onSelect:o,value:c+(t==null?void 0:t.value),children:[F("span",{className:"shrink-0 text-neutral-600",children:Uc(n)?n:F(n,{className:"h-4 w-4"})}),Pt(c,48),F("div",{className:"ml-1 flex shrink-0 grow justify-end text-neutral-500",children:r})]})}var $c=({search:e,askAI:t,children:r})=>t&&e?Ne(He.Empty,{className:"flex min-w-[180px] items-center space-x-2 rounded-md bg-neutral-100 px-3 py-2",children:[F(ca,{className:"h-4 w-4"}),Ne("p",{className:"text-center text-sm text-neutral-600",children:["Ask AI ",Ne("span",{className:"text-black",children:['"',e,'"']})]})]}):F(He.Empty,{className:"p-2 text-center text-sm text-neutral-400",children:r}),Uc=e=>Vn(e);var O2={Select:Hn,List:On};import{useMemo as jc,useState as _n}from"react";import{jsx as Xe,jsxs as Lr}from"react/jsx-runtime";function B2({title:e,description:t,inputAttrs:r,helpText:o,buttonText:a="Save Changes",disabledTooltip:n,handleSubmit:c}){let[s,m]=_n(r.defaultValue),[d,l]=_n(!1),u=jc(()=>d||!s||s===r.defaultValue,[d,s,r.defaultValue]);return Lr("form",{onSubmit:async p=>{p.preventDefault(),l(!0),await c({[r.name]:s}),l(!1)},className:"rounded-lg border border-neutral-200 bg-white",children:[Lr("div",{className:"relative flex flex-col space-y-6 p-5 sm:p-10",children:[Lr("div",{className:"flex flex-col space-y-3",children:[Xe("h2",{className:"text-xl font-medium",children:e}),Xe("p",{className:"text-sm text-neutral-500",children:t})]}),typeof r.defaultValue=="string"?Xe("input",{...r,type:r.type||"text",required:!0,disabled:!!n,onChange:p=>m(p.target.value),className:i("w-full max-w-md rounded-md border border-neutral-300 text-neutral-900 placeholder-neutral-400 focus:border-neutral-500 focus:outline-none focus:ring-neutral-500 sm:text-sm",{"cursor-not-allowed bg-neutral-100 text-neutral-400":n})}):Xe("div",{className:"h-[2.35rem] w-full max-w-md animate-pulse rounded-md bg-neutral-200"})]}),Lr("div",{className:"flex items-center justify-between space-x-4 rounded-b-lg border-t border-neutral-200 bg-neutral-50 p-3 sm:px-10",children:[typeof o=="string"?Xe("p",{className:"prose-sm prose-a:underline prose-a:underline-offset-4 hover:prose-a:text-neutral-700 text-neutral-500 transition-colors",dangerouslySetInnerHTML:{__html:o||""}}):o,Xe("div",{className:"shrink-0",children:Xe(te,{text:a,loading:d,disabled:u,disabledTooltip:n})})]})]})}import{useId as Kc}from"react";import{jsx as Mr,jsxs as Yc}from"react/jsx-runtime";function Je({cellSize:e=12,strokeWidth:t=1,patternOffset:r=[0,0],className:o}){let a=Kc();return Yc("svg",{className:i("pointer-events-none absolute inset-0 text-black/10",o),width:"100%",height:"100%",children:[Mr("defs",{children:Mr("pattern",{id:`grid-${a}`,x:r[0]-1,y:r[1]-1,width:e,height:e,patternUnits:"userSpaceOnUse",children:Mr("path",{d:`M ${e} 0 L 0 0 0 ${e}`,fill:"transparent",stroke:"currentColor",strokeWidth:t})})}),Mr("rect",{fill:`url(#grid-${a})`,width:"100%",height:"100%"})]})}import{AlertCircle as Zc}from"lucide-react";import qc,{useCallback as Xc,useState as Jc}from"react";import{jsx as Qe,jsxs as vo}from"react/jsx-runtime";var Qc=qc.forwardRef(({className:e,type:t,...r},o)=>{let[a,n]=Jc(!1),c=Xc(()=>n(!a),[a,n]);return vo("div",{children:[vo("div",{className:"relative flex",children:[Qe("input",{type:a?"text":t,className:i("w-full max-w-md rounded-md border border-neutral-300 text-neutral-900 placeholder-neutral-400 read-only:bg-neutral-100 read-only:text-neutral-500 focus:border-neutral-500 focus:outline-none focus:ring-neutral-500 sm:text-sm",r.error&&"border-red-500 focus:border-red-500 focus:ring-red-500",e),ref:o,...r}),vo("div",{className:"group",children:[r.error&&Qe("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex flex-none items-center px-2.5",children:Qe(Zc,{className:i("size-5 text-white",t==="password"&&"transition-opacity group-hover:opacity-0"),fill:"#ef4444"})}),t==="password"&&Qe("button",{className:i("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?Qe(Aa,{className:"size-4 flex-none text-neutral-500 transition hover:text-neutral-700","aria-hidden":!0}):Qe(Oa,{className:"size-4 flex-none text-neutral-500 transition hover:text-neutral-700","aria-hidden":!0})})]})]}),r.error&&Qe("span",{className:"mt-2 block text-sm text-red-500",role:"alert","aria-live":"assertive",children:r.error})]})});Qc.displayName="Input";import{flip as ad,offset as nd,size as id,useDismiss as sd,useFloating as ld,useInteractions as cd}from"@floating-ui/react";import{Command as Me,useCommandState as dd}from"cmdk";import{Check as md,ChevronDown as ud,Search as pd,X as fd}from"lucide-react";import{createContext as gd,forwardRef as Un,useContext as wo,useEffect as xo,useMemo as Wn,useRef as Bn,useState as yo}from"react";import{Drawer as ht}from"vaul";import ed from"next/image";import{memo as td,useEffect as rd,useState as Fn}from"react";import{jsx as od}from"react/jsx-runtime";var Vt=td(e=>{let[t,r]=Fn(!0),[o,a]=Fn(e.src);rd(()=>a(e.src),[e.src]);let n=c=>{r(!1);let s=c.target;s.naturalWidth<=16&&s.naturalHeight<=16&&a(`https://avatar.vercel.sh/${encodeURIComponent(e.alt)}`)};return od(ed,{...e,src:o,alt:e.alt,className:i(t?"blur-[2px]":"blur-0",e.className),onLoad:n,onError:()=>{a(`https://avatar.vercel.sh/${encodeURIComponent(e.alt)}`)},unoptimized:!0})});import{jsx as O,jsxs as le}from"react/jsx-runtime";var Dr=gd({inputAttrs:{},openCommandList:!1,setOpenCommandList:()=>{},inputValue:"",setInputValue:()=>{},disabled:!1,selectedItem:null,setSelectedItem:()=>{}});function vy({items:e,selectedItem:t,setSelectedItem:r,className:o,disabled:a,adjustForMobile:n,icon:c,inputAttrs:s,noItemsElement:m}){let{isMobile:d}=Y(),l=Bn(null),[u,p]=yo(!1),[f,g]=yo(""),[h,v]=yo(!1);xo(()=>{u&&v(!1)},[u]),xo(()=>v(!0),[f]),xo(()=>{t&&g(t.value)},[t]);let y=Wn(()=>{let S=f.toLowerCase();return h?e.filter(R=>R.value.toLowerCase().includes(S)):f?e.sort((R,L)=>(L.value.toLowerCase().includes(S)?1:0)-(R.value.toLowerCase().includes(S)?1:0)):e},[h,f,e]),{refs:w,floatingStyles:N,context:k}=ld({open:u,onOpenChange:p,middleware:[nd(8),id({apply({elements:{floating:S},availableHeight:R}){Object.assign(S.style,{maxHeight:`${Math.max(75,Math.min(R,290))}px`})},padding:8}),ad({fallbackStrategy:"initialPlacement",padding:8})]}),C=sd(k,{enabled:!d||!n}),{getReferenceProps:A,getFloatingProps:W}=cd([C]),T=Bn(null),{scrollProgress:P,updateScrollProgress:G}=Ae(T),x=Wn(()=>t&&t.icon?t.icon:t&&t.image?O(Vt,{src:t.image,alt:t.value,className:"size-4 rounded-full",width:16,height:16}):c||O(pd,{className:"size-4 text-neutral-400"}),[t,c]);return O(Dr.Provider,{value:{inputAttrs:s||{},openCommandList:u,setOpenCommandList:p,inputValue:f,setInputValue:g,disabled:Boolean(a),selectedItem:t,setSelectedItem:r},children:d&&n?le(ht.Root,{open:u,onOpenChange:p,children:[O(ht.Trigger,{className:"sm:hidden",asChild:!0,children:O(Me,{ref:l,className:"relative",shouldFilter:!1,loop:!0,children:O(No,{className:o,iconElement:x})})}),O(ht.Overlay,{className:"fixed inset-0 z-40 bg-neutral-100 bg-opacity-10 backdrop-blur"}),le(ht.Portal,{children:[O(ht.Content,{className:"fixed bottom-0 left-0 right-0 z-50 mt-24 rounded-t-lg border-t border-neutral-200 bg-white",onPointerDownOutside:S=>{S.target instanceof Element&&S.target.closest("[data-sonner-toast]")&&S.preventDefault()},children:le(Me,{ref:l,className:"relative",shouldFilter:!1,loop:!0,children:[O("div",{className:"p-2",children:O(No,{className:o,iconElement:x})}),u&&le(Me.List,{className:"dub-scrollbar h-[70vh] overflow-y-auto p-2",children:[e.length===0&&f===""&&(m?O("div",{children:m}):O("p",{className:"px-4 py-2 text-sm text-neutral-600",children:"No items found."})),f!==""&&O(Me.Empty,{className:"px-4 py-2 text-sm text-neutral-600",children:"No results found."}),O($n,{items:y})]})]})}),O(ht.Overlay,{})]})]}):le(Me,{ref:l,className:"relative",shouldFilter:!1,loop:!0,children:[O(No,{className:o,iconElement:x,ref:w.setReference,...A()}),u&&le("div",{ref:w.setFloating,style:N,...W(),className:"z-20 flex w-full min-w-[160px] flex-col overflow-hidden rounded-md border border-neutral-200 bg-white shadow-md",children:[le("div",{ref:T,onScroll:G,className:"grow overflow-y-auto p-2",children:[le(Me.List,{children:[e.length===0&&f===""&&(m?O("div",{children:m}):O("p",{className:"px-4 py-2 text-sm text-neutral-600",children:"No items found."})),f!==""&&O(Me.Empty,{className:"px-4 py-2 text-sm text-neutral-600",children:"No results found."})]}),O($n,{items:y})]}),O("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(P,2)}})]})]})})}var No=Un(({iconElement:e,className:t,...r},o)=>le("label",{ref:o,className:i("group relative flex cursor-pointer gap-2 rounded-md border border-neutral-200 bg-white px-1 pl-3 transition-all focus-within:border-neutral-500 focus-within:ring-4 focus-within:ring-neutral-200",t),...r,children:[O("div",{className:"flex shrink-0 items-center justify-center text-neutral-400",children:e}),le("div",{className:"flex h-10 grow",children:[O(bd,{}),O(hd,{})]})]})),bd=Un((e,t)=>{let r=dd(d=>d.filtered.count===0),{inputAttrs:o,openCommandList:a,setOpenCommandList:n,inputValue:c,setInputValue:s,disabled:m}=wo(Dr);return O(Me.Input,{ref:t,placeholder:(o==null?void 0:o.placeholder)||"Search...",autoFocus:a,onFocus:()=>n(!0),value:c,onValueChange:s,onKeyDown:d=>{d.key==="Escape"?(d.preventDefault(),n(!1)):d.key==="Enter"&&r?n(!1):d.key.match(/^[a-z0-9]$/i)&&!d.metaKey&&n(!0)},disabled:m,className:"block w-full truncate rounded-md border-none px-0 text-base text-neutral-900 placeholder-neutral-400 outline-none outline-0 transition-all duration-300 focus:ring-0 md:text-sm",autoCapitalize:"none"})});function hd(){let{setSelectedItem:e,openCommandList:t,setOpenCommandList:r,inputValue:o,setInputValue:a}=wo(Dr);return O("button",{type:"button",onClick:()=>{r(n=>!n),e(null),a("")},className:"absolute inset-y-0 right-0 my-auto pr-3",children:o.length>0?O(fd,{className:"size-4 text-neutral-400 transition-all hover:text-neutral-700"}):O(ud,{className:i("size-4 text-neutral-400 transition-all hover:text-neutral-700",{"rotate-180 transform":t})})})}function $n({items:e}){let{setSelectedItem:t,setOpenCommandList:r,setInputValue:o}=wo(Dr);return e.map(a=>le(Me.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-neutral-900 hover:bg-neutral-100 hover:text-neutral-900 active:bg-neutral-200 aria-disabled:cursor-not-allowed aria-disabled:opacity-75 aria-disabled:hover:bg-white aria-selected:bg-neutral-100 aria-selected:text-neutral-900",children:[le("div",{className:"flex items-center space-x-2",children:[a.icon||a.image&&O(Vt,{src:a.image,alt:a.value,className:"size-4 rounded-full",width:16,height:16}),O("p",{className:i("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&&O(fr,{className:"text-xs",variant:"neutral",children:a.label})]}),O(md,{className:"invisible h-5 w-5 text-neutral-500 aria-selected:visible"})]},a.id))}import*as Co from"@radix-ui/react-label";import{cva as vd}from"class-variance-authority";import*as Gn from"react";import{jsx as Nd}from"react/jsx-runtime";var xd=vd("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),yd=Gn.forwardRef(({className:e,...t},r)=>Nd(Co.Root,{ref:r,className:i(xd(),e),...t}));yd.displayName=Co.Root.displayName;import{cva as wd}from"class-variance-authority";import{isValidElement as Cd}from"react";import{jsx as ko,jsxs as jn}from"react/jsx-runtime";var Po=wd(["flex h-9 w-full rounded-md px-2 items-center justify-center gap-2 transition-colors cursor-pointer","whitespace-nowrap text-sm font-medium text-content-default enabled:hover:bg-bg-subtle transition-colors","disabled:opacity-50 disabled:cursor-default"],{variants:{variant:{default:"text-content-default hover:bg-bg-subtle",danger:"text-content-error hover:bg-bg-error"},disabled:{true:"opacity-50 cursor-default text-content-disabled hover:bg-bg-default"}}});function Dy({as:e,variant:t="default",children:r,icon:o,shortcut:a,className:n,disabledTooltip:c,...s}){return ko(ut,{tooltipProps:{content:c},children:jn(e||"button",{...e==="button"?{type:"button"}:{},className:i(Po({variant:t,disabled:!!c}),n),disabled:c?!0:s.disabled,...s,children:[jn("div",{className:"flex grow items-center gap-2",children:[o&&(kd(o)?o:ko(o,{className:"size-4"})),r]}),a&&ko("kbd",{className:i("bg-bg-inverted/5 group-hover:bg-bg-inverted/10 hidden rounded px-2 py-0.5 text-xs font-light transition-all duration-75 md:block"),children:a})]})})}var kd=e=>Cd(e);import{curveNatural as Kn}from"@visx/curve";import{LinearGradient as Yn}from"@visx/gradient";import{Group as Pd}from"@visx/group";import{ParentSize as Sd}from"@visx/responsive";import{scaleLinear as Rd,scaleUtc as Td}from"@visx/scale";import{Area as Ld,AreaClosed as Md}from"@visx/shape";import{motion as Zn}from"framer-motion";import{useId as Dd,useMemo as qn}from"react";import{jsx as we,jsxs as So}from"react/jsx-runtime";var Ed={top:8,right:2,bottom:2,left:2};function Wy(e){return we(Sd,{className:"relative",children:({width:t,height:r})=>t>0&&r>0&&we(Id,{...{width:t,height:r,...e}})})}function Id({width:e,height:t,data:r,curve:o=!0,color:a,padding:n}){let c={...Ed,...n},s=Dd(),m=qn(()=>r.map(({date:u})=>({date:u,value:0})),[r]),{yScale:d,xScale:l}=qn(()=>{let u=r.map(({value:v})=>v),p=Math.max(...u),f=r.map(({date:v})=>v.getTime()),g=new Date(Math.min(...f)),h=new Date(Math.max(...f));return{yScale:Rd({domain:[-2,Math.max(p,2)],range:[t-c.top-c.bottom,0],nice:!0,clamp:!0}),xScale:Td({domain:[g,h],range:[0,e-c.left-c.right],nice:!0})}},[r,t,e]);return So("svg",{width:e,height:t,children:[So("defs",{children:[we(Yn,{id:`${s}-color-gradient`,from:a||"#7D3AEC",to:a||"#DA2778",x1:0,x2:e-c.left-c.right,gradientUnits:"userSpaceOnUse"}),we(Yn,{id:`${s}-mask-gradient`,from:"white",to:"white",fromOpacity:.3,toOpacity:0,x1:0,x2:0,y1:0,y2:1}),we("mask",{id:`${s}-mask`,maskContentUnits:"objectBoundingBox",children:we("rect",{width:"1",height:"1",fill:`url(#${s}-mask-gradient)`})})]}),So(Pd,{left:c.left,top:c.top,children:[we(Ld,{data:r,x:({date:u})=>l(u),y:({value:u})=>d(u)??0,curve:o?Kn:void 0,children:({path:u})=>we(Zn.path,{initial:{d:u(m)||"",opacity:0},animate:{d:u(r)||"",opacity:1},strokeWidth:1.5,stroke:`url(#${s}-color-gradient)`})}),we(Md,{data:r,x:({date:u})=>l(u),y:({value:u})=>d(u)??0,yScale:d,curve:o?Kn:void 0,children:({path:u})=>we(Zn.path,{initial:{d:u(m)||"",opacity:0},animate:{d:u(r)||"",opacity:1},fill:`url(#${s}-color-gradient)`,mask:`url(#${s}-mask)`})})]})]},r.length)}import*as ce from"@radix-ui/react-dialog";import*as Ro from"@radix-ui/react-visually-hidden";import{useRouter as Ad}from"next/navigation";import{Drawer as et}from"vaul";import{jsx as ne,jsxs as vt}from"react/jsx-runtime";function Ky({children:e,className:t,showModal:r,setShowModal:o,onClose:a,desktopOnly:n,preventDefaultClose:c,drawerRootProps:s}){let m=Ad(),d=({dragged:u}={})=>{c&&!u||(a&&a(),o?o(!1):m.back())},{isMobile:l}=Y();return l&&!n?ne(et.Root,{open:o?r:!0,onOpenChange:u=>{u||d({dragged:!0})},...s,children:vt(et.Portal,{children:[ne(et.Overlay,{className:"fixed inset-0 z-50 bg-neutral-100 bg-opacity-10 backdrop-blur"}),ne(et.Content,{onPointerDownOutside:u=>{u.target instanceof Element&&u.target.closest("[data-sonner-toast]")&&u.preventDefault()},className:i("fixed bottom-0 left-0 right-0 z-50 flex flex-col","rounded-t-[10px] border-t border-neutral-200 bg-white",t),children:vt("div",{className:"scrollbar-hide flex-1 overflow-y-auto rounded-t-[10px] bg-inherit",children:[vt(Ro.Root,{children:[ne(et.Title,{children:"Modal"}),ne(et.Description,{children:"This is a modal"})]}),ne(Od,{}),e]})}),ne(et.Overlay,{})]})}):ne(ce.Root,{open:o?r:!0,onOpenChange:u=>{u||d()},children:vt(ce.Portal,{children:[ne(ce.Overlay,{id:"modal-backdrop",className:"animate-fade-in fixed inset-0 z-40 bg-neutral-100 bg-opacity-50 backdrop-blur-md"}),vt(ce.Content,{onOpenAutoFocus:u=>u.preventDefault(),onCloseAutoFocus:u=>u.preventDefault(),onPointerDownOutside:u=>{u.target instanceof Element&&u.target.closest("[data-sonner-toast]")&&u.preventDefault()},className:i("fixed inset-0 z-40 m-auto h-fit w-full max-w-md","border border-neutral-200 bg-white p-0 shadow-xl sm:rounded-2xl","scrollbar-hide animate-scale-in overflow-y-auto",t),children:[vt(Ro.Root,{children:[ne(ce.Title,{children:"Modal"}),ne(ce.Description,{children:"This is a modal"})]}),e]})]})})}function Od(){return ne("div",{className:"sticky top-0 z-20 flex items-center justify-center rounded-t-[10px] bg-inherit",children:ne("div",{className:"my-3 h-1 w-12 rounded-full bg-neutral-300"})})}import{useCallback as To}from"react";import{jsx as Ht,jsxs as zd}from"react/jsx-runtime";function e4({value:e,onChange:t,min:r,max:o,step:a=1,disabled:n,className:c,id:s,formatValue:m,decrementAriaLabel:d="Decrease",incrementAriaLabel:l="Increase",...u}){let p=typeof r=="number"?e>r:!0,f=typeof o=="number"?e<o:!0,g=To(y=>{let w=y;return typeof r=="number"&&(w=Math.max(r,w)),typeof o=="number"&&(w=Math.min(o,w)),w},[r,o]),h=To(()=>{n||!p||t(g(e-a))},[n,p,g,t,a,e]),v=To(()=>{n||!f||t(g(e+a))},[n,f,g,t,a,e]);return zd("div",{id:s,role:"group","aria-disabled":n,className:i("flex h-10 w-full select-none items-stretch overflow-hidden rounded-lg border border-neutral-200 bg-white",n&&"opacity-60",c),...u,children:[Ht("button",{type:"button","aria-label":d,onClick:h,disabled:n||!p,className:i("flex h-full w-24 items-center justify-center border-r border-neutral-200 text-neutral-700 transition-colors",!(n||!p)&&"hover:bg-neutral-50"),children:Ht(dr,{className:"block size-4"})}),Ht("div",{role:"spinbutton","aria-valuenow":e,"aria-valuemin":r,"aria-valuemax":o,tabIndex:0,onKeyDown:y=>{n||((y.key==="ArrowLeft"||y.key==="ArrowDown")&&(y.preventDefault(),h()),(y.key==="ArrowRight"||y.key==="ArrowUp")&&(y.preventDefault(),v()))},className:i("flex min-w-0 flex-1 items-center justify-center px-3 text-sm text-neutral-900"),prefix:"",children:m?m(e):e}),Ht("button",{type:"button","aria-label":l,onClick:v,disabled:n||!f,className:i("flex h-full w-24 items-center justify-center border-l border-neutral-200 text-neutral-700 transition-colors",!(n||!f)&&"hover:bg-neutral-50"),children:Ht(mt,{className:"block size-4"})})]})}import{Fragment as Vd,jsx as Er,jsxs as xt}from"react/jsx-runtime";var Xn=i("flex h-7 items-center justify-center gap-2 whitespace-nowrap rounded-md border border-neutral-200 bg-white px-2 text-sm text-neutral-600","outline-none hover:bg-neutral-50 focus-visible:border-neutral-500","disabled:cursor-not-allowed disabled:border-neutral-200 disabled:text-neutral-400 disabled:bg-neutral-100");function o4({pagination:e,setPagination:t,totalCount:r,unit:o=s=>`item${s?"s":""}`,className:a,children:n,showTotalCount:c=!0}){return xt("div",{className:i("flex items-center justify-between gap-2 text-sm leading-6 text-neutral-600",a),children:[xt("div",{className:"flex items-center gap-2",children:[xt("div",{children:[Er("span",{className:"hidden sm:inline-block",children:"Viewing"})," ",r>0&&xt(Vd,{children:[xt("span",{className:"font-medium",children:[((e.pageIndex-1)*e.pageSize+1).toLocaleString(),"-",Math.min((e.pageIndex-1)*e.pageSize+e.pageSize,r).toLocaleString()]})," ",c&&"of "]}),c&&Er("span",{className:"font-medium",children:r.toLocaleString()})," ",typeof o=="function"?o(r!==1):o]}),n]}),xt("div",{className:"flex items-center gap-2",children:[Er("button",{type:"button",className:Xn,onClick:()=>t({...e,pageIndex:e.pageIndex-1}),disabled:e.pageIndex===1,children:"Previous"}),Er("button",{type:"button",className:Xn,onClick:()=>t({...e,pageIndex:e.pageIndex+1}),disabled:(e.pageIndex-1)*e.pageSize+e.pageSize>=r,children:"Next"})]})]})}import{jsx as Jn,jsxs as Hd}from"react/jsx-runtime";function i4({progress:e,strokeWidth:t=16,className:r}){let o=Math.min(Math.max(e,0),1),a=(100-t)/2,n=a*Math.PI*2,c=o*n;return Hd("svg",{width:"100",height:"100",viewBox:"0 0 100 100",className:i("size-3 shrink-0 text-green-600",r),children:[Jn("circle",{cx:"50",cy:"50",r:a,stroke:"#e5e5e5",strokeWidth:`${t}px`,fill:"none",strokeLinecap:"round"}),o>0&&Jn("circle",{cx:"50",cy:"50",r:a,stroke:"currentColor",strokeWidth:`${t}px`,fill:"none",strokeLinecap:"round",strokeDasharray:`${c} ${n-c}`,style:{transformOrigin:"50px 50px",transform:"rotate(-90deg)"}})]})}import*as _e from"@radix-ui/react-radio-group";import{Circle as _d}from"lucide-react";import*as Lo from"react";import{jsx as Ir}from"react/jsx-runtime";var Fd=Lo.forwardRef(({className:e,...t},r)=>Ir(_e.Root,{className:i("grid gap-2",e),...t,ref:r}));Fd.displayName=_e.Root.displayName;var Wd=Lo.forwardRef(({className:e,...t},r)=>Ir(_e.Item,{ref:r,className:i("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:Ir(_e.Indicator,{className:"flex items-center justify-center",children:Ir(_d,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Wd.displayName=_e.Item.displayName;import{Drawer as Fe}from"vaul";import{jsx as tt,jsxs as jd}from"react/jsx-runtime";function Bd({children:e,contentProps:t,nested:r=!1,...o}){let a=r?Fe.NestedRoot:Fe.Root;return tt(a,{direction:"right",handleOnly:!0,...o,children:jd(Fe.Portal,{children:[tt(Fe.Overlay,{className:"fixed inset-0 bg-black/20","data-sheet-overlay":!0}),tt(Fe.Content,{...t,onPointerDownOutside:n=>{var c;n.target instanceof Element&&n.target.closest("[data-sonner-toast]")&&n.preventDefault(),(c=t==null?void 0:t.onPointerDownOutside)==null||c.call(t,n)},className:i("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)",userSelect:"auto",...t==null?void 0:t.style},children:tt("div",{className:"scrollbar-hide flex size-full grow flex-col overflow-y-auto rounded-lg bg-white",children:e})})]})})}function $d({className:e,...t}){return tt(Fe.Title,{className:i("text-lg font-semibold text-neutral-900",e),...t})}function Ud(e){return tt(Fe.Description,{...e})}function Gd(e){return tt(Fe.Close,{...e})}var f4=Object.assign(Bd,{Title:$d,Description:Ud,Close:Gd});import{useEffect as Kd,useRef as Yd,useState as Zd}from"react";import{jsx as Qn}from"react/jsx-runtime";var qd=`
3
3
  attribute vec2 position;
4
4
 
5
5
  void main()
@@ -46,7 +46,7 @@ void main(void) {
46
46
  radial-gradient(at 10% 29%, hsla(256, 96%, 67%, 1) 0px, transparent 50%),
47
47
  radial-gradient(at 97% 96%, hsla(38, 60%, 74%, 1) 0px, transparent 50%),
48
48
  radial-gradient(at 33% 50%, hsla(222, 67%, 73%, 1) 0px, transparent 50%),
49
- radial-gradient(at 79% 53%, hsla(343, 68%, 79%, 1) 0px, transparent 50%)`,position:"absolute",height:"100%",filter:"blur(100px) saturate(150%)",top:"80px",opacity:.15}};import{ChevronDown as yu}from"lucide-react";import Nu from"next/image";import $e from"next/link";import{useParams as wu}from"next/navigation";import{useState as Cu}from"react";import{jsx as si}from"react/jsx-runtime";function Ft({className:e}){return si("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i("h-10 w-10 text-black dark:text-white",e),children:si("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M32 64C49.6731 64 64 49.6731 64 32C64 20.1555 57.5648 9.81398 48 4.28103V31.9999V47.9999H40V45.8594C37.6466 47.2208 34.9143 47.9999 32 47.9999C23.1634 47.9999 16 40.8365 16 31.9999C16 23.1634 23.1634 15.9999 32 15.9999C34.9143 15.9999 37.6466 16.7791 40 18.1404V1.00814C37.443 0.350024 34.7624 0 32 0C14.3269 0 0 14.3269 0 32C0 49.6731 14.3269 64 32 64Z",fill:"currentColor"})})}var Wr=[{id:"links",title:"Dub Links",description:"Short links with superpowers",icon:ct,href:"/links"},{id:"partners",title:"Dub Partners",description:"Grow your revenue with partnerships",icon:dt,href:"/partners"},{id:"analytics",title:"Dub Analytics",description:"Powerful real-time analytics",icon:lt,href:"/analytics"},{id:"api",title:"Dub API",description:"Programmatic link creation at scale",icon:er,href:"/docs/api-reference/introduction"},{title:"Dub Integrations",description:"Connect Dub with your favorite tools",icon:Za,href:"/integrations"}],Vo=[{icon:va,iconClassName:"py-0.5 group-hover:text-[#3178C6]",title:"Typescript",href:"/sdks/typescript"},{icon:ba,iconClassName:"py-0.5 [&_.snake]:transition-colors group-hover:[&_.snake1]:text-[#3776ab] group-hover:[&_.snake2]:text-[#ffd343]",title:"Python",href:"/sdks/python"},{icon:fa,iconClassName:"group-hover:text-[#00ACD7]",title:"Go",href:"/sdks/go"},{icon:ha,iconClassName:"py-[3px] grayscale brightness-150 transition-[filter] group-hover:grayscale-0 group-hover:brightness-100",title:"Ruby",href:"/sdks/ruby"},{icon:ga,iconClassName:"py-[3px] grayscale brightness-150 transition-[filter] group-hover:grayscale-0 group-hover:brightness-100",title:"PHP",href:"/sdks/php"}],li=[{icon:sr,title:"Marketing Attribution",description:"Easily track and measure marketing impact",href:"/analytics"},{icon:cr,title:"Content Creators",description:"Intelligent audience insights and link tracking",href:"/solutions/creators"},{icon:Rt,title:"Affiliate Management",description:"Manage affiliates and automate payouts",href:"/partners"},{label:"SDKs",items:Vo}],Wt=[{icon:lr,title:"Help Center",description:"Answers to your questions",href:"/help"},{icon:nr,title:"Docs",description:"Platform documentation",href:"/docs/introduction"},{icon:Rt,title:"About",description:"Company, values, and team",href:"/about"},{icon:ya,title:"Careers",description:"Join our global, remote team",href:"/careers"},{icon:za,title:"Blog",description:"Insights and stories",href:"/blog"},{icon:Na,title:"Changelog",description:"Releases and updates",href:"/changelog"},{icon:Ft,title:"Brand Guidelines",description:"Logos, wordmark, etc.",href:"/brand"},{icon:Ia,title:"Contact",description:"Reach out to support or sales",href:"/contact"}],ci=[{name:"Bitly",slug:"bitly"},{name:"Rebrandly",slug:"rebrandly"},{name:"Short.io",slug:"short"},{name:"Bl.ink",slug:"blink"}],di=[{name:"Privacy Policy",slug:"privacy"},{name:"Terms of Service",slug:"terms"},{name:"Partner Terms",slug:"partners"},{name:"Affiliate Program Terms",slug:"affiliates"},{name:"DPA",slug:"dpa"},{name:"Subprocessors",slug:"subprocessors"},{name:"Report Abuse",slug:"abuse"}],W3=[{name:"X (Twitter)",icon:or,href:"https://x.com/dubdotco"},{name:"LinkedIn",icon:rr,href:"https://www.linkedin.com/company/dubinc"},{name:"GitHub",icon:tr,href:"https://github.com/dubinc/dub"},{name:"YouTube",icon:ar,href:"https://www.youtube.com/@dubdotco"}];import{jsx as Dm}from"react/jsx-runtime";function Br({className:e,children:t}){return Dm("div",{className:i("mx-auto w-full max-w-screen-xl px-3 lg:px-10",e),children:t})}import*as Be from"@radix-ui/react-popover";import{BoxSelect as cu,Home as du,LayoutGrid as mu,Type as uu}from"lucide-react";import{useParams as pu}from"next/navigation";import{useCallback as fu,useContext as gu,useState as bu}from"react";import{toast as hu}from"sonner";import*as ue from"@radix-ui/react-navigation-menu";import{LayoutGroup as Km}from"framer-motion";import jt from"next/link";import{useParams as Ym,usePathname as Zm}from"next/navigation";import{createContext as qm,useId as Xm}from"react";import Jm from"swr";import{Link as bi}from"@radix-ui/react-navigation-menu";import hi from"next/image";import vi from"next/link";import{Link2 as Em}from"lucide-react";import{jsx as Z,jsxs as J}from"react/jsx-runtime";var mi={clicks:{color:"#3B82F6",value:"12.5K"},leads:{color:"#A855F7",value:"8.2K"},sales:{color:"#14B8A6",value:"$12K"}},ot={name:"Danielle Wilson",email:"danielle@dub.co",avatarIndex:8,origin:"dub.sh",country:"US",details:{"Lifetime value":"$12.5k",Account:"Pro",Subscription:"2y 10m"}};function ui({className:e}){return J("div",{className:i("pointer-events-none relative size-full",e),children:[J("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 339 168",className:"h-auto w-full [mask-image:linear-gradient(90deg,transparent,black_10%,black_90%,transparent)]",children:[Z("path",{stroke:"#00BBA7",strokeWidth:"2",d:"m345 1-60.533 76.487a8 8 0 0 1-9.732 2.25l-25.53-12.241a8 8 0 0 0-9.214 1.657l-62.736 64.993a8 8 0 0 1-6.695 2.388L67.303 124.331a8 8 0 0 0-5.193 1.17L-3.166 166.5"}),Z("circle",{cx:"259.333",cy:"72",r:"3",fill:"#00BBA7"}),Z("circle",{cx:"259.333",cy:"72",r:"4",stroke:"#3EC5B8",strokeOpacity:"0.3",strokeWidth:"2"})]}),J("div",{className:"absolute bottom-0 left-5 flex items-start gap-2",children:[J("div",{className:"border-border-default bg-bg-default w-[172px] rounded-lg border p-0",children:[J("div",{className:"p-1.5",children:[J("div",{className:"bg-bg-subtle border-border-subtle text-content-default hidden items-center gap-2 rounded border p-2 text-xs font-medium leading-none sm:flex",children:[Z(Em,{className:"size-3 rotate-90"}),"d.to/try"]}),Z("div",{className:"text-content-default mt-1 px-1.5 pb-0.5 text-[0.8125rem] font-medium sm:mt-2",children:"Apr 2025"})]}),Z("div",{className:"border-border-default flex flex-col gap-2 border-t p-3",children:["clicks","leads","sales"].map(t=>J("div",{className:"flex items-center justify-between gap-2",children:[J("div",{className:"flex items-center gap-2",children:[Z("div",{className:"size-2 rounded-sm border border-black/20 bg-current opacity-70",style:{color:mi[t].color}}),Z("div",{className:"text-content-subtle text-xs font-medium leading-none",children:Jt(t)})]}),J("span",{className:"text-content-emphasis text-xs leading-none",children:[t==="sales"?"$":"",mi[t].value]})]},t))})]}),Z("div",{className:"relative",children:J("div",{className:"border-border-default bg-bg-default absolute left-0 top-0 rounded-lg border py-0.5",children:[J("div",{className:"px-3 py-2.5",children:[J("div",{className:"flex justify-between gap-2",children:[Z("div",{className:"bg-bg-emphasis size-11 rounded-full",style:{backgroundImage:"url(https://assets.dub.co/home/people.png)",backgroundSize:"3600%",backgroundPositionX:ot.avatarIndex*100+"%"}}),J("div",{className:"flex flex-col items-end gap-1",children:[J("div",{className:"bg-bg-default border-border-subtle text-content-default flex items-center gap-1.5 rounded-full border px-1.5 py-0.5 text-xs",children:[Z(Da,{className:"text-content-default size-3.5"}),ot.origin]}),J("div",{className:"bg-bg-default border-border-subtle text-content-default flex items-center gap-1.5 rounded-full border px-1.5 py-0.5 text-xs",children:[Z("img",{src:`https://flag.vercel.app/m/${ot.country}.svg`,className:"relative h-2.5 w-3 rounded-sm"}),ot.country]})]})]}),Z("div",{className:"text-content-emphasis mt-4 text-[0.8125rem] font-medium",children:ot.name}),Z("div",{className:"text-content-subtle mt-px text-xs",children:ot.email})]}),Z("div",{className:"border-border-default flex flex-col gap-2.5 border-t px-3 pb-2.5 pt-3",children:Object.entries(ot.details).map(([t,r])=>J("div",{className:"relative flex items-center justify-between gap-2 text-xs leading-none",children:[Z("span",{className:"text-content-muted truncate font-medium",children:t}),Z("span",{className:"text-content-default",children:r})]},t))})]})})]})]})}import{useId as Im}from"react";import{jsx as b,jsxs as me}from"react/jsx-runtime";function pi(e){let t=Im();return me("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"300",height:"180",fill:"none",viewBox:"0 0 300 180",...e,className:i("pointer-events-none text-[var(--fg)] [--bg:white] [--border:#e5e5e5] [--fg:#171717] [--muted:#404040] dark:[--bg:black] dark:[--border:#fff3] dark:[--fg:#fffa] dark:[--muted:#fff7]",e.className),children:[me("defs",{children:[b("path",{id:`${t}-m`,className:"fill-[var(--bg)]",d:"M0 0h10.24v10.24H0z"}),b("path",{id:`${t}-n`,className:"fill-[var(--bg)]",d:"M0 0h8.05v8.05H0z"}),b("path",{id:`${t}-o`,className:"fill-[var(--bg)]",d:"M0 0h11.71v11.71H0z"})]}),b("rect",{width:"292",height:"52",x:"4",y:"4",rx:"8.78",className:"fill-[var(--bg)]"}),b("rect",{width:"292",height:"52",x:"4",y:"4",className:"stroke-[var(--border)]",strokeWidth:"0.73",rx:"8.78"}),b("rect",{width:"24.88",height:"24.88",x:"17.17",y:"17.56",fill:`url(#${t}-a)`,rx:"12.44"}),b("rect",{width:"25.61",height:"25.61",x:"16.8",y:"17.2",className:"stroke-[var(--border)]",strokeWidth:"0.73",rx:"12.8"}),b("path",{className:"fill-[var(--fg)]",d:"M29.61 23c.6 0 1.19.08 1.75.22v3.75a3.5 3.5 0 1 0 0 6.06v.47h1.75v-9.56a7 7 0 1 1-3.5-.94m2.29.39"}),b("text",{xmlSpace:"preserve",className:"fill-[var(--fg)]",fontSize:"10.24",fontWeight:"600",style:{whiteSpace:"pre"},children:b("tspan",{x:"50.83",y:"25.49",children:"d.to"})}),me("g",{className:"stroke-[var(--fg)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-b)`,children:[b("path",{d:"M84.47 26.08h3.98c.63 0 1.14-.51 1.14-1.14v-3.98c0-.63-.51-1.14-1.14-1.14h-3.98c-.63 0-1.14.5-1.14 1.14v3.98c0 .63.5 1.14 1.14 1.14"}),b("path",{d:"M82.05 24a1.14 1.14 0 0 1-.71-1.05v-3.99c0-.63.5-1.13 1.14-1.13h3.98c.48 0 .89.29 1.05.7"})]}),b("path",{className:"stroke-[var(--fg)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",d:"M106.87 23.66h-1.29a.85.85 0 0 0-.85.85v1.28m-1.71-5.97v1.28a.85.85 0 0 1-.85.85h-1.28m3.84.01h.43m-2.14 3.83v-.42m-3.41-7.26h1.28c.24 0 .43.2.43.43v1.28c0 .23-.2.42-.43.42h-1.28a.43.43 0 0 1-.43-.42v-1.28c0-.24.2-.43.43-.43m5.55 0h1.28c.23 0 .43.2.43.43v1.28c0 .23-.2.42-.43.42h-1.28a.43.43 0 0 1-.43-.42v-1.28c0-.24.2-.43.43-.43m-5.55 5.55h1.28c.24 0 .43.19.43.43v1.28c0 .23-.2.42-.43.42h-1.28a.43.43 0 0 1-.43-.42v-1.28c0-.24.2-.43.43-.43"}),me("g",{stroke:"#A1A1A1",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-c)`,children:[b("path",{d:"M59.11 38.38h-4.7a.9.9 0 0 1-.89-.89V35.7"}),b("path",{d:"m57.21 36.48 1.9 1.9-1.9 1.9"})]}),b("text",{xmlSpace:"preserve",fill:"#737373",fontSize:"10.24",fontWeight:"500",style:{whiteSpace:"pre"},children:b("tspan",{x:"63.27",y:"41.59",children:"dub.co"})}),b("path",{className:"fill-[var(--bg)]",d:"M205.12 19.4h69.22c1.24 0 2.14 0 2.86.05.62.05 1.07.14 1.44.3l.16.08c.66.34 1.22.85 1.6 1.48l.16.28c.21.4.32.9.38 1.6.06.72.06 1.62.06 2.86v7.9c0 1.24 0 2.14-.06 2.85a4.6 4.6 0 0 1-.3 1.45l-.08.16a4 4 0 0 1-1.48 1.6l-.28.16c-.4.2-.9.32-1.6.38-.72.06-1.62.06-2.86.06h-69.22c-1.23 0-2.14 0-2.85-.06a4.6 4.6 0 0 1-1.45-.3l-.16-.08a4 4 0 0 1-1.6-1.48l-.16-.28c-.2-.4-.32-.9-.38-1.6-.06-.72-.06-1.62-.06-2.86v-7.9c0-1.24 0-2.14.06-2.85s.17-1.2.38-1.61c.39-.76 1-1.38 1.76-1.76.41-.2.9-.32 1.6-.38.72-.06 1.63-.06 2.86-.06Z"}),b("path",{className:"stroke-[var(--border)]",strokeWidth:"0.73",d:"M205.12 19.4h69.22c1.24 0 2.14 0 2.86.05.62.05 1.07.14 1.44.3l.16.08c.66.34 1.22.85 1.6 1.48l.16.28c.21.4.32.9.38 1.6.06.72.06 1.62.06 2.86v7.9c0 1.24 0 2.14-.06 2.85a4.6 4.6 0 0 1-.3 1.45l-.08.16a4 4 0 0 1-1.48 1.6l-.28.16c-.4.2-.9.32-1.6.38-.72.06-1.62.06-2.86.06h-69.22c-1.23 0-2.14 0-2.85-.06a4.6 4.6 0 0 1-1.45-.3l-.16-.08a4 4 0 0 1-1.6-1.48l-.16-.28c-.2-.4-.32-.9-.38-1.6-.06-.72-.06-1.62-.06-2.86v-7.9c0-1.24 0-2.14.06-2.85s.17-1.2.38-1.61c.39-.76 1-1.38 1.76-1.76.41-.2.9-.32 1.6-.38.72-.06 1.63-.06 2.86-.06Z"}),b("g",{className:"stroke-[var(--muted)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-d)`,children:b("path",{d:"m209.95 29.2 4.75 1.64c.15.05.15.25 0 .3l-2.13.8a.16.16 0 0 0-.09.1l-.8 2.13a.16.16 0 0 1-.3 0l-1.64-4.76a.16.16 0 0 1 .2-.2h0Zm2.55 2.77 2.75 2.74m-5.53-9.43v1.3m2.76-.15-.92.92m-4.6 4.6.92-.92m-2.06-1.84h1.3m-.16-2.76.92.92"})}),b("text",{xmlSpace:"preserve",className:"fill-[var(--muted)]",fontSize:"8.78",fontWeight:"500",style:{whiteSpace:"pre"},children:b("tspan",{x:"220.78",y:"33.19",children:"151.8K clicks"})}),b("rect",{width:"292",height:"52",x:"4",y:"64",rx:"8.78",className:"fill-[var(--bg)]"}),b("rect",{width:"292",height:"52",x:"4",y:"64",className:"stroke-[var(--border)]",strokeWidth:"0.73",rx:"8.78"}),b("rect",{width:"24.88",height:"24.88",x:"17.17",y:"77.56",fill:`url(#${t}-e)`,rx:"12.44"}),b("rect",{width:"25.61",height:"25.61",x:"16.8",y:"77.19",className:"stroke-[var(--border)]",strokeWidth:"0.73",rx:"12.8"}),b("path",{className:"fill-[var(--fg)]",d:"M29.61 83c.6 0 1.19.08 1.75.22v3.75a3.5 3.5 0 1 0 0 6.06v.47h1.75v-9.56a7 7 0 1 1-3.5-.94m2.29.39"}),b("text",{xmlSpace:"preserve",className:"fill-[var(--fg)]",fontSize:"10.24",fontWeight:"600",style:{whiteSpace:"pre"},children:b("tspan",{x:"50.83",y:"85.49",children:"d.to/register"})}),me("g",{className:"stroke-[var(--fg)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-f)`,children:[b("path",{d:"M126.47 86.08h3.98c.63 0 1.14-.51 1.14-1.14v-3.98c0-.63-.51-1.14-1.14-1.14h-3.98c-.63 0-1.14.5-1.14 1.14v3.98c0 .63.5 1.14 1.14 1.14"}),b("path",{d:"M124.05 84a1.14 1.14 0 0 1-.71-1.05v-3.99c0-.63.5-1.13 1.13-1.13h3.99c.48 0 .89.29 1.05.7"})]}),b("path",{className:"stroke-[var(--fg)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",d:"M148.87 83.66h-1.28a.85.85 0 0 0-.86.85v1.28m-1.71-5.97v1.28a.85.85 0 0 1-.85.85h-1.28m3.84.01h.43m-2.14 3.83v-.42m-3.41-7.26h1.28c.24 0 .43.2.43.43v1.28c0 .23-.2.42-.43.42h-1.28a.43.43 0 0 1-.43-.42v-1.28c0-.24.2-.43.43-.43m5.55 0h1.28c.24 0 .43.2.43.43v1.28c0 .23-.2.42-.43.42h-1.28a.43.43 0 0 1-.43-.42v-1.28c0-.24.2-.43.43-.43m-5.55 5.55h1.28c.24 0 .43.19.43.43v1.28c0 .23-.2.42-.43.42h-1.28a.43.43 0 0 1-.43-.42v-1.28c0-.24.2-.43.43-.43"}),me("g",{stroke:"#A1A1A1",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-g)`,children:[b("path",{d:"M59.11 98.38h-4.7a.9.9 0 0 1-.89-.89V95.7"}),b("path",{d:"m57.21 96.48 1.9 1.9-1.9 1.9"})]}),b("text",{xmlSpace:"preserve",fill:"#737373",fontSize:"10.24",fontWeight:"500",style:{whiteSpace:"pre"},children:b("tspan",{x:"63.27",y:"101.59",children:"app.dub.co/register"})}),b("path",{className:"fill-[var(--bg)]",d:"M211.12 79.4h63.22c1.24 0 2.14 0 2.86.05.62.05 1.07.14 1.44.3l.16.08c.66.34 1.22.85 1.6 1.48l.16.28c.21.4.32.9.38 1.6.06.72.06 1.62.06 2.86v7.9c0 1.24 0 2.14-.06 2.85a4.6 4.6 0 0 1-.3 1.45l-.08.16a4.03 4.03 0 0 1-1.48 1.6l-.28.16c-.4.2-.9.32-1.6.38-.72.06-1.62.06-2.86.06h-63.22c-1.23 0-2.14 0-2.85-.06a4.6 4.6 0 0 1-1.45-.3l-.16-.08a4 4 0 0 1-1.6-1.48l-.16-.28c-.2-.4-.32-.9-.38-1.6-.06-.72-.06-1.62-.06-2.86v-7.9c0-1.24 0-2.14.06-2.85s.17-1.2.38-1.61c.39-.76 1-1.38 1.76-1.76.41-.2.9-.32 1.6-.38.72-.06 1.63-.06 2.86-.06Z"}),b("path",{className:"stroke-[var(--border)]",strokeWidth:"0.73",d:"M211.12 79.4h63.22c1.24 0 2.14 0 2.86.05.62.05 1.07.14 1.44.3l.16.08c.66.34 1.22.85 1.6 1.48l.16.28c.21.4.32.9.38 1.6.06.72.06 1.62.06 2.86v7.9c0 1.24 0 2.14-.06 2.85a4.6 4.6 0 0 1-.3 1.45l-.08.16a4.03 4.03 0 0 1-1.48 1.6l-.28.16c-.4.2-.9.32-1.6.38-.72.06-1.62.06-2.86.06h-63.22c-1.23 0-2.14 0-2.85-.06a4.6 4.6 0 0 1-1.45-.3l-.16-.08a4 4 0 0 1-1.6-1.48l-.16-.28c-.2-.4-.32-.9-.38-1.6-.06-.72-.06-1.62-.06-2.86v-7.9c0-1.24 0-2.14.06-2.85s.17-1.2.38-1.61c.39-.76 1-1.38 1.76-1.76.41-.2.9-.32 1.6-.38.72-.06 1.63-.06 2.86-.06Z"}),b("g",{className:"stroke-[var(--muted)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-h)`,children:b("path",{d:"m215.95 89.2 4.75 1.64c.15.05.15.25 0 .3l-2.13.8a.16.16 0 0 0-.09.1l-.8 2.13a.16.16 0 0 1-.3 0l-1.64-4.76a.16.16 0 0 1 .2-.2h0Zm2.55 2.77 2.75 2.74m-5.53-9.43v1.3m2.76-.15-.92.92m-4.6 4.6.92-.92m-2.06-1.84h1.3m-.16-2.76.92.92"})}),b("text",{xmlSpace:"preserve",className:"fill-[var(--muted)]",fontSize:"8.78",fontWeight:"500",style:{whiteSpace:"pre"},children:b("tspan",{x:"226.78",y:"93.19",children:"100K clicks"})}),b("path",{className:"fill-[var(--bg)]",d:"M4 138.05c0-4.92 0-7.38.96-9.26a8.7 8.7 0 0 1 3.83-3.83c1.88-.96 4.34-.96 9.26-.96h263.9c4.92 0 7.38 0 9.26.96a8.7 8.7 0 0 1 3.83 3.83c.96 1.88.96 4.34.96 9.26v23.9c0 4.92 0 7.38-.96 9.26a8.78 8.78 0 0 1-3.83 3.83c-1.88.96-4.34.96-9.26.96H18.05c-4.92 0-7.38 0-9.26-.96a8.78 8.78 0 0 1-3.83-3.83C4 169.33 4 166.87 4 161.95z"}),b("path",{className:"stroke-[var(--border)]",strokeWidth:"0.73",d:"M4 138.05c0-4.92 0-7.38.96-9.26a8.7 8.7 0 0 1 3.83-3.83c1.88-.96 4.34-.96 9.26-.96h263.9c4.92 0 7.38 0 9.26.96a8.7 8.7 0 0 1 3.83 3.83c.96 1.88.96 4.34.96 9.26v23.9c0 4.92 0 7.38-.96 9.26a8.78 8.78 0 0 1-3.83 3.83c-1.88.96-4.34.96-9.26.96H18.05c-4.92 0-7.38 0-9.26-.96a8.78 8.78 0 0 1-3.83-3.83C4 169.33 4 166.87 4 161.95z"}),b("rect",{width:"24.88",height:"24.88",x:"17.17",y:"137.56",fill:`url(#${t}-i)`,rx:"12.44"}),b("rect",{width:"25.61",height:"25.61",x:"16.8",y:"137.19",className:"stroke-[var(--border)]",strokeWidth:"0.73",rx:"12.8"}),b("path",{className:"fill-[var(--fg)]",d:"M29.61 143c.6 0 1.19.08 1.75.22v3.75a3.5 3.5 0 1 0 0 6.06v.47h1.75v-9.56a7 7 0 1 1-3.5-.94m2.29.39"}),b("text",{xmlSpace:"preserve",className:"fill-[var(--fg)]",fontSize:"10.24",fontWeight:"600",style:{whiteSpace:"pre"},children:b("tspan",{x:"50.83",y:"145.49",children:"d.to/try"})}),me("g",{className:"stroke-[var(--fg)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-j)`,children:[b("path",{d:"M102.47 146.08h3.98c.63 0 1.14-.51 1.14-1.14v-3.98c0-.63-.51-1.14-1.14-1.14h-3.98c-.63 0-1.14.5-1.14 1.14v3.98c0 .63.5 1.14 1.14 1.14"}),b("path",{d:"M100.05 144a1.14 1.14 0 0 1-.71-1.05v-3.99c0-.63.5-1.14 1.13-1.14h3.99c.48 0 .89.3 1.06.72"})]}),b("path",{className:"stroke-[var(--fg)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",d:"M124.87 143.66h-1.29a.85.85 0 0 0-.85.85v1.28m-1.71-5.97v1.28a.85.85 0 0 1-.85.85h-1.28m3.84.01h.43m-2.14 3.83v-.42m-3.41-7.26h1.28c.24 0 .43.2.43.43v1.28c0 .23-.2.42-.43.42h-1.28a.43.43 0 0 1-.43-.42v-1.28c0-.24.2-.43.43-.43m5.55 0h1.28c.23 0 .43.2.43.43v1.28c0 .23-.2.42-.43.42h-1.28a.43.43 0 0 1-.43-.42v-1.28c0-.24.2-.43.43-.43m-5.55 5.55h1.28c.24 0 .43.19.43.43v1.28c0 .23-.2.42-.43.42h-1.28a.43.43 0 0 1-.43-.42v-1.28c0-.24.2-.43.43-.43"}),me("g",{stroke:"#A1A1A1",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-k)`,children:[b("path",{d:"M59.11 158.38h-4.7a.9.9 0 0 1-.89-.89v-1.79"}),b("path",{d:"m57.21 156.48 1.9 1.9-1.9 1.9"})]}),b("text",{xmlSpace:"preserve",fill:"#737373",fontSize:"10.24",fontWeight:"500",style:{whiteSpace:"pre"},children:b("tspan",{x:"63.27",y:"161.59",children:"app.dub.co/register"})}),b("path",{className:"fill-[var(--bg)]",d:"M208.12 139.4h66.22c1.24 0 2.14 0 2.86.05.62.05 1.07.14 1.44.3l.16.08c.66.34 1.22.85 1.6 1.48l.16.28c.21.4.32.9.38 1.6.06.72.06 1.62.06 2.86v7.9c0 1.24 0 2.14-.06 2.86a4.6 4.6 0 0 1-.3 1.44l-.08.16a4 4 0 0 1-1.48 1.6l-.28.16c-.4.2-.9.32-1.6.38-.72.06-1.62.06-2.86.06h-66.22c-1.23 0-2.14 0-2.85-.06a4.6 4.6 0 0 1-1.45-.3l-.16-.08a4 4 0 0 1-1.6-1.48l-.16-.28c-.2-.4-.32-.9-.38-1.6-.06-.72-.06-1.62-.06-2.86v-7.9c0-1.24 0-2.14.06-2.86.06-.7.17-1.2.38-1.6.39-.76 1-1.38 1.76-1.76.41-.2.9-.32 1.6-.38.72-.06 1.63-.06 2.86-.06Z"}),b("path",{className:"stroke-[var(--border)]",strokeWidth:"0.73",d:"M208.12 139.4h66.22c1.24 0 2.14 0 2.86.05.62.05 1.07.14 1.44.3l.16.08c.66.34 1.22.85 1.6 1.48l.16.28c.21.4.32.9.38 1.6.06.72.06 1.62.06 2.86v7.9c0 1.24 0 2.14-.06 2.86a4.6 4.6 0 0 1-.3 1.44l-.08.16a4 4 0 0 1-1.48 1.6l-.28.16c-.4.2-.9.32-1.6.38-.72.06-1.62.06-2.86.06h-66.22c-1.23 0-2.14 0-2.85-.06a4.6 4.6 0 0 1-1.45-.3l-.16-.08a4 4 0 0 1-1.6-1.48l-.16-.28c-.2-.4-.32-.9-.38-1.6-.06-.72-.06-1.62-.06-2.86v-7.9c0-1.24 0-2.14.06-2.86.06-.7.17-1.2.38-1.6.39-.76 1-1.38 1.76-1.76.41-.2.9-.32 1.6-.38.72-.06 1.63-.06 2.86-.06Z"}),b("g",{className:"stroke-[var(--muted)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-l)`,children:b("path",{d:"m212.95 149.2 4.75 1.64c.15.05.15.25 0 .3l-2.13.8a.17.17 0 0 0-.09.1l-.8 2.13a.16.16 0 0 1-.3 0l-1.64-4.76a.16.16 0 0 1 .2-.2h0Zm2.55 2.77 2.75 2.74m-5.53-9.43v1.3m2.76-.15-.92.92m-4.6 4.6.92-.92m-2.06-1.84h1.3m-.16-2.76.92.92"})}),b("text",{xmlSpace:"preserve",className:"fill-[var(--muted)]",fontSize:"8.78",fontWeight:"500",style:{whiteSpace:"pre"},children:b("tspan",{x:"223.78",y:"153.19",children:"65.8K clicks"})}),me("defs",{children:[b("clipPath",{id:`${t}-b`,children:b("use",{xlinkHref:`#${t}-m`,transform:"translate(80.34 16.83)"})}),b("clipPath",{id:`${t}-c`,children:b("use",{xlinkHref:`#${t}-n`,transform:"translate(52.3 34.02)"})}),b("clipPath",{id:`${t}-d`,children:b("use",{xlinkHref:`#${t}-o`,transform:"translate(204.68 24.15)"})}),b("clipPath",{id:`${t}-f`,children:b("use",{xlinkHref:`#${t}-m`,transform:"translate(122.34 76.83)"})}),b("clipPath",{id:`${t}-g`,children:b("use",{xlinkHref:`#${t}-n`,transform:"translate(52.3 94.02)"})}),b("clipPath",{id:`${t}-h`,children:b("use",{xlinkHref:`#${t}-o`,transform:"translate(210.68 84.15)"})}),b("clipPath",{id:`${t}-j`,children:b("use",{xlinkHref:`#${t}-m`,transform:"translate(98.34 136.83)"})}),b("clipPath",{id:`${t}-k`,children:b("use",{xlinkHref:`#${t}-n`,transform:"translate(52.3 154.02)"})}),b("clipPath",{id:`${t}-l`,children:b("use",{xlinkHref:`#${t}-o`,transform:"translate(207.68 144.15)"})}),me("linearGradient",{id:`${t}-a`,x1:"29.61",x2:"29.61",y1:"17.56",y2:"42.44",gradientUnits:"userSpaceOnUse",children:[b("stop",{stopColor:"#030712",stopOpacity:"0"}),b("stop",{offset:"1",stopColor:"#030712",stopOpacity:"0.05"})]}),me("linearGradient",{id:`${t}-e`,x1:"29.61",x2:"29.61",y1:"77.56",y2:"102.44",gradientUnits:"userSpaceOnUse",children:[b("stop",{stopColor:"#030712",stopOpacity:"0"}),b("stop",{offset:"1",stopColor:"#030712",stopOpacity:"0.05"})]}),me("linearGradient",{id:`${t}-i`,x1:"29.61",x2:"29.61",y1:"137.56",y2:"162.44",gradientUnits:"userSpaceOnUse",children:[b("stop",{stopColor:"#030712",stopOpacity:"0"}),b("stop",{offset:"1",stopColor:"#030712",stopOpacity:"0.05"})]})]})]})}import{Fragment as Om,jsx as De,jsxs as Bt}from"react/jsx-runtime";var Am=[{name:"Lauren Anderson",country:"US",revenue:1800,payouts:550},{name:"Mia Taylor",country:"US",revenue:22600,payouts:6800},{name:"Sophie Laurent",country:"CA",revenue:11e3,payouts:3300},{name:"Hiroshi Tanaka",country:"JP",revenue:19200,payouts:5700},{name:"Elias Weber",country:"DE",revenue:783,payouts:235},{name:"Liam Carter",country:"US",revenue:3e4,payouts:9200}];function fi({className:e}){return De("div",{className:i("pointer-events-none relative size-full dark:opacity-80",e),"aria-hidden":!0,children:De("div",{className:"absolute left-0 top-0 grid grid-cols-[repeat(2,180px)]",children:Am.map((t,r)=>De("div",{className:"h-[60px] w-[180px] p-[3px]",children:De("div",{className:"border-border-subtle bg-bg-default flex size-full select-none overflow-hidden rounded border",children:t&&Bt(Om,{children:[De("div",{className:"bg-bg-emphasis aspect-square h-full",style:{backgroundImage:"url(https://assets.dub.co/partners/partner-images.jpg)",backgroundSize:"1400%",backgroundPositionX:(14-r%14)*100+"%"}},r),Bt("div",{className:"border-border-subtle flex h-full flex-col justify-between border-l px-2 py-1.5",children:[Bt("div",{className:"flex items-center gap-1.5",children:[De("img",{alt:"US Flag",src:`https://flag.vercel.app/m/${t.country}.svg`,className:"h-2.5 w-3 rounded-sm border-[0.5px] border-black/15"}),De("span",{className:"text-content-default text-[9px] font-medium",children:t.name})]}),De("div",{className:"divide-border-subtle flex divide-x",children:["revenue","payouts"].map((o,a)=>Bt("div",{className:i("flex flex-col",a===0?"pr-4":"pl-4"),children:[De("span",{className:"text-content-muted text-[6px] font-medium",children:Jt(o)}),Bt("span",{className:"text-content-default text-[9px] font-medium",children:["$",Qt(t[o])]})]},o))})]})]})})},r))})})}import{Link as zm}from"@radix-ui/react-navigation-menu";import Vm from"next/link";import{jsx as $t,jsxs as gi}from"react/jsx-runtime";var at="text-xs uppercase text-neutral-500 dark:text-white/60",Hm="group rounded-[8px] p-2 transition-colors hover:bg-neutral-50 active:bg-neutral-100 dark:hover:bg-white/[0.15] dark:active:bg-white/20",Ce=({domain:e,...t})=>({utm_source:"Custom Domain",utm_medium:"Navbar",utm_campaign:e,...t});function Ut({icon:e,title:t,description:r,descriptionLines:o=1,className:a,showArrow:n,...c}){return $t(zm,{asChild:!0,children:$t(Vm,{className:i(Hm,a),...c,children:gi("div",{className:"flex items-center justify-between gap-3",children:[e,gi("div",{className:"flex-1",children:[$t("p",{className:"text-sm font-medium text-neutral-700 dark:text-white",children:t}),r&&$t("p",{className:i("text-xs text-neutral-500 dark:text-white/60",["line-clamp-1","line-clamp-2"][o-1]),children:r})]}),n&&$t(la,{className:"invisible -ml-6 h-4 w-4 text-neutral-700 group-aria-selected:visible sm:group-hover:visible dark:text-white/80"})]})})})}import{jsx as z,jsxs as Gt}from"react/jsx-runtime";var _m=[{icon:z("div",{className:"flex size-4 items-center justify-center rounded bg-orange-400",children:z(ct,{className:"size-2.5 text-orange-900"})}),title:"Dub Links",description:"Short links with superpowers for modern marketing teams.",href:"/links",color:"#f4950c",graphicsContainerClassName:"px-2",graphic:z(pi,{className:"absolute left-0 top-0 h-auto w-full"})},{icon:z("div",{className:"flex size-4 items-center justify-center rounded bg-green-400",children:z(lt,{className:"size-2.5 text-green-900"})}),title:"Dub Analytics",description:"Powerful analytics delivered instantly.",href:"/analytics",color:"#36D78F",graphicsContainerClassName:"h-[170%] bottom-0 top-[unset]",graphic:z(ui,{className:"absolute bottom-0 left-0 size-full"})},{icon:z("div",{className:"flex size-4 items-center justify-center rounded bg-violet-400",children:z(dt,{className:"size-2.5 text-violet-900"})}),title:"Dub Partners",description:"Grow your revenue on auto-pilot with partnerships.",href:"/partners",color:"#818cf8",graphicsContainerClassName:"pl-2",graphic:z(fi,{})}],Fm=[{title:"Dub Integrations",description:"Enhance your short links",href:"/integrations",graphic:z("div",{className:"absolute -right-4 top-1/2 h-[180px] w-[240px] -translate-y-1/2 [mask-image:linear-gradient(90deg,black_50%,transparent_95%)] dark:opacity-80",children:z(hi,{src:"https://assets.dub.co/misc/integrations-grid.png",alt:"",fill:!0})})},{title:"Dub API",description:"Unlock further capabilities",href:"/docs/api-reference/introduction",graphic:z("div",{className:"absolute -right-4 top-2.5 h-[180px] w-[240px] [mask-image:linear-gradient(90deg,black_50%,transparent_95%)] dark:opacity-60",children:z(hi,{src:"https://assets.dub.co/misc/api-thumbnail.png",alt:"",fill:!0})})}];function xi({domain:e}){return Gt("div",{className:"grid w-[1020px] grid-cols-1 gap-4 p-4",children:[z("div",{className:"grid grid-cols-3 gap-4",children:_m.map(({title:t,description:r,icon:o,href:a,color:n,graphicsContainerClassName:c,graphic:s})=>z(bi,{asChild:!0,children:Gt(vi,{href:_(a,e,Ce({domain:e,utm_content:t})),className:"group relative flex flex-col overflow-hidden rounded-xl border border-neutral-100 bg-neutral-50 dark:border-white/20 dark:bg-white/10",children:[z(Je,{className:"[mask-image:linear-gradient(transparent,black,transparent)] dark:text-white/5",cellSize:60,patternOffset:[-51,-23]}),Gt("div",{className:"relative p-5 pb-0",children:[o,z("span",{className:"mt-3 block text-sm font-medium text-neutral-900 dark:text-white",children:t}),z("p",{className:"mt-2 max-w-56 text-sm text-neutral-500 dark:text-white/60",children:r})]}),z("div",{className:"relative mt-10 h-40 grow",children:z("div",{className:i("absolute left-0 top-0 size-full grow overflow-hidden [mask-image:linear-gradient(black_50%,transparent)]",c),children:z("div",{className:"relative size-full",children:s})})}),z("div",{className:"pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_50%_100%,var(--color),transparent)] opacity-[0.07] transition-opacity duration-150 group-hover:opacity-15",style:{"--color":n}})]})},t))}),z("div",{className:"grid grow grid-cols-2 gap-4",children:Fm.map(({title:t,description:r,href:o,graphic:a})=>z(bi,{asChild:!0,children:Gt(vi,{href:_(o,e,Ce({domain:e,utm_content:t})),className:"group relative flex flex-col justify-center rounded-xl border border-neutral-100 bg-neutral-50 transition-colors duration-150 hover:bg-neutral-100 active:bg-neutral-200 dark:border-white/20 dark:bg-white/10 dark:hover:bg-white/15 dark:active:bg-white/20",children:[z(Je,{className:"[mask-image:linear-gradient(90deg,transparent,black)] dark:text-white/5",cellSize:60,patternOffset:[-39,-49]}),z("div",{className:"pointer-events-none absolute inset-0 overflow-hidden","aria-hidden":!0,children:a}),z("div",{className:"relative flex items-center justify-between px-5 py-4",children:Gt("div",{children:[z("span",{className:"text-sm font-medium leading-none text-neutral-900 dark:text-white",children:t}),z("p",{className:"mt-1 text-sm text-neutral-500 dark:text-white/60",children:r})]})})]})},t))})]})}import{Link as Wm}from"@radix-ui/react-navigation-menu";import Bm from"next/link";import{jsx as j,jsxs as nt}from"react/jsx-runtime";var $m=[{icon:lr,title:"Help Center",description:"Answers to your questions",thumbnail:"https://assets.dub.co/misc/help-thumbnail.jpg",href:"/help"},{icon:nr,title:"Docs",description:"Platform documentation",thumbnail:"https://assets.dub.co/misc/docs-thumbnail.jpg",href:"/docs/introduction"}];function yi({domain:e}){return nt("div",{className:"grid w-[1020px] grid-cols-[0.9fr,0.55fr,0.55fr] divide-x divide-neutral-200 dark:divide-white/20",children:[nt("div",{className:"flex h-full flex-col p-4",children:[j("p",{className:i(at,"mb-4 ml-2"),children:"Explore"}),j("div",{className:"grid grow grid-cols-2 gap-4",children:$m.map(({icon:t,title:r,description:o,href:a})=>j(Wm,{asChild:!0,children:nt(Bm,{href:_(a,e,Ce({domain:e,utm_content:r})),className:i("group relative isolate z-0 flex flex-col justify-between overflow-hidden rounded-xl border border-neutral-100 bg-neutral-50 px-5 py-4 transition-colors duration-75","dark:border-white/20 dark:bg-neutral-900"),children:[nt("div",{className:"absolute inset-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:[j("div",{className:"absolute -inset-[25%] -skew-y-12 [mask-image:linear-gradient(225deg,black,transparent_50%)]",children:j(Je,{cellSize:46,patternOffset:[0,-14],className:"translate-y-2 text-[#ad1f3288] transition-transform duration-150 ease-out group-hover:translate-y-0"})}),j("div",{className:i("absolute -inset-[10%] opacity-10 blur-[50px] dark:brightness-150","bg-[conic-gradient(#F35066_0deg,#F35066_117deg,#9071F9_180deg,#5182FC_240deg,#F35066_360deg)]")})]}),j(t,{className:"relative size-5 text-neutral-700 dark:text-white/60"}),nt("div",{className:"relative",children:[j("span",{className:"text-sm font-medium text-neutral-900 dark:text-white",children:r}),j("p",{className:"mt-2 text-xs text-neutral-500 dark:text-white/60",children:o})]})]},r)},r))})]}),nt("div",{className:"px-6 py-4",children:[j("p",{className:i(at,"mb-2"),children:"Company"}),j("div",{className:"flex flex-col gap-0.5",children:Wt.filter(({title:t})=>["About","Careers","Brand Guidelines","Contact"].includes(t)).map(({icon:t,title:r,description:o,href:a})=>j(Ut,{className:"-mx-2",href:_(a,e,Ce({domain:e,utm_content:r})),icon:j("div",{className:"shrink-0 rounded-md border border-neutral-200 bg-white/50 p-2.5 dark:border-white/20 dark:bg-white/10",children:j(t,{className:"size-4 text-neutral-600 transition-colors dark:text-white/60"})}),title:r,description:o},a))})]}),nt("div",{className:"px-6 py-4",children:[j("p",{className:i(at,"mb-2"),children:"Updates"}),j("div",{className:"flex flex-col gap-0.5",children:Wt.filter(({title:t})=>["Blog","Changelog"].includes(t)).map(({icon:t,title:r,description:o,href:a})=>j(Ut,{className:"-mx-2",href:_(a,e,Ce({domain:e,utm_content:r})),icon:j("div",{className:"shrink-0 rounded-md border border-neutral-200 bg-white/50 p-2.5 dark:border-white/20 dark:bg-white/10",children:j(t,{className:"size-4 text-neutral-600 transition-colors dark:text-white/60"})}),title:r,description:o},a))})]})]})}import{Link as Um}from"@radix-ui/react-navigation-menu";import Gm from"next/link";import{jsx as re,jsxs as Nt}from"react/jsx-runtime";var jm=[{icon:sr,title:"Marketing Attribution",description:"Easily track and measure marketing impact",href:"/analytics"},{icon:cr,title:"Content Creators",description:"Intelligent audience insights and link tracking",href:"/solutions/creators"},{icon:Rt,title:"Affiliate Management",description:"Manage affiliates and automate payouts",href:"/partners"}];function Ni({domain:e}){return Nt("div",{className:"grid w-[1020px] grid-cols-[minmax(0,1fr),0.4fr] divide-x divide-neutral-200 dark:divide-white/20",children:[Nt("div",{className:"flex h-full flex-col p-4",children:[re("p",{className:i(at,"mb-4 ml-2"),children:"Use case"}),re("div",{className:"grid grow grid-cols-3 gap-4",children:jm.map(({icon:t,title:r,description:o,href:a})=>re(Um,{asChild:!0,children:Nt(Gm,{href:_(a,e,Ce({domain:e,utm_content:r})),className:i("group relative isolate z-0 flex flex-col justify-between overflow-hidden rounded-xl border border-neutral-100 bg-neutral-50 px-5 py-4 transition-colors duration-75","dark:border-white/20 dark:bg-neutral-900"),children:[Nt("div",{className:"absolute inset-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:[re("div",{className:"absolute -inset-[25%] -skew-y-12 [mask-image:linear-gradient(225deg,black,transparent_50%)]",children:re(Je,{cellSize:46,patternOffset:[0,-14],className:"translate-y-2 text-[#ad1f3288] transition-transform duration-150 ease-out group-hover:translate-y-0"})}),re("div",{className:i("absolute -inset-[10%] opacity-10 blur-[50px] dark:brightness-150","bg-[conic-gradient(#F35066_0deg,#F35066_117deg,#9071F9_180deg,#5182FC_240deg,#F35066_360deg)]")})]}),re(t,{className:"relative size-5 text-neutral-700 dark:text-white/60"}),Nt("div",{className:"relative",children:[re("span",{className:"text-sm font-medium text-neutral-900 dark:text-white",children:r}),re("p",{className:"mt-2 text-xs text-neutral-500 dark:text-white/60",children:o})]})]},r)},r))})]}),Nt("div",{className:"px-6 py-4",children:[re("p",{className:i(at,"mb-2"),children:"SDKs"}),re("div",{className:"flex flex-col gap-0.5",children:Vo.map(({icon:t,iconClassName:r,title:o,href:a})=>re(Ut,{className:"-mx-2",href:_(a,e,Ce({domain:e,utm_content:o})),icon:re("div",{className:"shrink-0 rounded-[10px] border border-neutral-200 bg-white/50 p-1 dark:border-white/20 dark:bg-white/10",children:re(t,{className:i("size-5 text-neutral-600 transition-colors dark:text-white/60",r)})}),title:o,showArrow:!0},a))})]})]})}import{Fragment as tu,jsx as B,jsxs as wt}from"react/jsx-runtime";var Ho=qm({theme:"light"}),_o=[{name:"Product",content:xi,childItems:Wr,segments:["/links","/analytics","/partners","/integrations","/compare","/features"]},{name:"Solutions",content:Ni,childItems:li,segments:["/solutions","/sdks"]},{name:"Resources",content:yi,childItems:Wt,segments:["/help","/docs","/about","/careers","/brand","/blog","/changelog","/contact"]},{name:"Enterprise",href:"/enterprise",segments:["/enterprise"]},{name:"Customers",href:"/customers",segments:["/customers"]},{name:"Pricing",href:"/pricing",segments:["/pricing"]}],wi=i("relative group/item flex items-center rounded-md px-4 py-2 text-sm rounded-lg font-medium text-neutral-700 hover:text-neutral-900 transition-colors","dark:text-white/90 dark:hover:text-white","hover:bg-neutral-900/5 dark:hover:bg-white/10","data-[active=true]:bg-neutral-900/5 dark:data-[active=true]:bg-white/10","group-has-[:hover]:data-[active=true]:[&:not(:hover)]:bg-transparent");function qN({theme:e="light",staticDomain:t,maxWidthWrapperClassName:r}){let{domain:o="dub.co"}=Ym();t&&(o=t);let a=Xm(),n=mn(40),c=Zm(),{data:s,isLoading:m}=Jm(o.endsWith("dub.co")&&"/api/auth/session",be,{dedupingInterval:6e4});return B(Ho.Provider,{value:{theme:e},children:B(Km,{id:a,children:wt("div",{className:i("sticky inset-x-0 top-0 z-30 w-full transition-all",e==="dark"&&"dark"),children:[B("div",{className:i("absolute inset-0 block border-b border-transparent transition-all",n&&"border-neutral-100 bg-white/75 backdrop-blur-lg dark:border-white/10 dark:bg-black/75")}),B(Br,{className:i("relative",r),children:wt("div",{className:"flex h-14 items-center justify-between",children:[B("div",{className:"grow basis-0",children:B(jt,{className:"block w-fit py-2 pr-2",href:_("/home",o,{utm_source:"Custom Domain",utm_medium:"Navbar",utm_campaign:o,utm_content:"Logo"}),children:B($r,{})})}),wt(ue.Root,{delayDuration:0,className:"relative hidden lg:block",children:[B(ue.List,{className:"group relative z-0 flex",children:_o.map(({name:d,href:l,segments:u,content:p})=>{let f=u.some(g=>c==null?void 0:c.startsWith(g));return wt(ue.Item,{children:[B(eu,{trigger:!!p,children:l!==void 0?B(jt,{id:`nav-${l}`,href:_(l,o,{utm_source:"Custom Domain",utm_medium:"Navbar",utm_campaign:o,utm_content:d}),className:wi,"data-active":f,children:d}):wt("button",{className:wi,"data-active":f,children:[d,B(Qm,{className:"ml-1.5 size-2.5 text-neutral-700"})]})}),p&&B(ue.Content,{className:"data-[motion=from-start]:animate-enter-from-left data-[motion=from-end]:animate-enter-from-right data-[motion=to-start]:animate-exit-to-left data-[motion=to-end]:animate-exit-to-right absolute left-0 top-0",children:B(p,{domain:o})})]},d)})}),B("div",{className:"absolute left-1/2 top-full mt-3 -translate-x-1/2",children:B(ue.Viewport,{className:i("relative flex origin-[top_center] justify-start overflow-hidden rounded-[20px] border border-neutral-200 bg-white shadow-md dark:border-white/[0.15] dark:bg-black","data-[state=closed]:animate-scale-out-content data-[state=open]:animate-scale-in-content","h-[var(--radix-navigation-menu-viewport-height)] w-[var(--radix-navigation-menu-viewport-width)] transition-[width,height]")})})]}),B("div",{className:"hidden grow basis-0 justify-end gap-2 lg:flex",children:s&&Object.keys(s).length>0?B(jt,{href:ke,className:i(se({variant:"primary"}),"flex h-8 items-center rounded-lg border px-4 text-sm","dark:border-white dark:bg-white dark:text-black dark:hover:bg-neutral-50 dark:hover:ring-white/10"),children:"Dashboard"}):m?null:wt(tu,{children:[B(jt,{href:"https://app.dub.co/login",className:i(se({variant:"secondary"}),"flex h-8 items-center rounded-lg border px-4 text-sm","dark:border-white/10 dark:bg-black dark:text-white dark:hover:bg-neutral-900"),children:"Log in"}),B(jt,{href:"https://app.dub.co/register",className:i(se({variant:"primary"}),"flex h-8 items-center rounded-lg border px-4 text-sm","dark:border-white dark:bg-white dark:text-black dark:hover:bg-neutral-50 dark:hover:ring-white/10"),children:"Sign up"})]})})]})})]})})})}function Qm(e){return B("svg",{xmlns:"http://www.w3.org/2000/svg",width:"9",height:"9",fill:"none",viewBox:"0 0 9 9",...e,children:B("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M7.278 3.389 4.5 6.167 1.722 3.389",className:"transition-transform duration-150 [transform-box:view-box] [transform-origin:center] [vector-effect:non-scaling-stroke] group-data-[state=open]/item:-scale-y-100"})})}function eu({trigger:e,children:t}){return e?B(ue.Trigger,{asChild:!0,children:t}):t}import{ChevronDown as ru,Menu as ou,X as au}from"lucide-react";import Ct from"next/link";import{useParams as Bo}from"next/navigation";import{useEffect as nu,useState as ki}from"react";import iu from"swr";import{Fragment as lu,jsx as D,jsxs as Ee}from"react/jsx-runtime";var Fo={"Dub Links":D("div",{className:"flex size-5 items-center justify-center rounded bg-orange-400",children:D(ct,{className:"size-3 text-orange-900"})}),"Dub Partners":D("div",{className:"flex size-5 items-center justify-center rounded bg-violet-400",children:D(dt,{className:"size-3 text-violet-900"})}),"Dub Analytics":D("div",{className:"flex size-5 items-center justify-center rounded bg-green-400",children:D(lt,{className:"size-3 text-green-900"})}),"Dub API":D("div",{className:"flex size-5 items-center justify-center rounded bg-neutral-400",children:D(er,{className:"size-3 text-neutral-900"})})};function mw({theme:e="light",staticDomain:t}){let{domain:r="dub.co"}=Bo();t&&(r=t);let[o,a]=ki(!1);nu(()=>{o?document.body.style.overflow="hidden":document.body.style.overflow="auto"},[o]);let{data:n,isLoading:c}=iu(r.endsWith("dub.co")&&"/api/auth/session",be,{dedupingInterval:6e4});return Ee("div",{className:i("fixed right-0 top-0 z-40 flex items-center gap-4 p-2.5 lg:hidden",e==="dark"&&"dark"),children:[n&&Object.keys(n).length>0?D(Wo,{href:ke,className:"max-[280px]:hidden",children:"Dashboard"}):c?null:Ee("div",{className:"flex gap-2 max-[280px]:hidden",children:[D(Wo,{variant:"secondary",href:`${ke}/login`,children:"Log in"}),D(Wo,{href:`${ke}/register`,children:"Sign Up"})]}),D("button",{onClick:()=>a(!o),className:i("z-30 rounded-full p-2 transition-colors duration-200 hover:bg-neutral-200 focus:outline-none active:bg-neutral-300 dark:hover:bg-white/20 dark:active:bg-white/30",o&&"hover:bg-neutral-100 active:bg-neutral-200"),children:o?D(au,{className:"h-5 w-5 text-neutral-600 dark:text-white/70"}):D(ou,{className:"h-5 w-5 text-neutral-600 dark:text-white/70"})}),D("nav",{className:i("fixed inset-0 z-20 hidden max-h-screen w-full overflow-y-auto bg-white px-5 py-16 lg:hidden dark:bg-black dark:text-white/70",o&&"block"),children:Ee("ul",{className:"grid divide-y divide-neutral-200 dark:divide-white/[0.15]",children:[_o.map(({name:s,href:m,childItems:d},l)=>D(su,{name:s,href:m,childItems:d,setOpen:a},l)),n&&Object.keys(n).length>0?D("li",{className:"py-3 min-[281px]:hidden",children:D(Ct,{href:ke,className:"flex w-full font-semibold capitalize",children:"Dashboard"})}):Ee(lu,{children:[D("li",{className:"py-3 min-[281px]:hidden",children:D(Ct,{href:`${ke}/login`,className:"flex w-full font-semibold capitalize",children:"Log in"})}),D("li",{className:"py-3 min-[281px]:hidden",children:D(Ct,{href:`${ke}/register`,className:"flex w-full font-semibold capitalize",children:"Sign Up"})})]})]})})]})}var su=({name:e,href:t,childItems:r,setOpen:o})=>{let{domain:a="dub.co"}=Bo(),[n,c]=ki(!1);return r?D("li",{className:"py-3",children:Ee(pe,{height:!0,children:[Ee("button",{className:"flex w-full justify-between",onClick:()=>c(!n),children:[D("p",{className:"font-semibold",children:e}),D(ru,{className:i("h-5 w-5 text-neutral-500 transition-all dark:text-white/50",n&&"rotate-180")})]}),n&&D("div",{className:"grid grid-cols-1 gap-4 overflow-hidden py-4",children:r.map((s,m)=>"items"in s?Ee("div",{className:"grid grid-cols-1 gap-3",children:[D("span",{className:"text-xs font-medium uppercase text-neutral-500 dark:text-white/50",children:s.label}),s.items.map((d,l)=>D(Ci,{item:d,setOpen:o,size:"small"},l))]},m):D(Ci,{item:s,setOpen:o},m))})]})}):t?D("li",{className:"py-3",children:D(Ct,{href:_(t,a,{utm_source:"Custom Domain",utm_medium:"Navbar",utm_campaign:a,utm_content:e}),onClick:()=>o(!1),className:"flex w-full font-semibold capitalize",children:e})}):null},Ci=({item:{title:e,description:t,href:r,icon:o},setOpen:a,size:n="normal"})=>{let{domain:c="dub.co"}=Bo(),s=Fo==null?void 0:Fo[e];return Ee(Ct,{href:_(r,c,{utm_source:"Custom Domain",utm_medium:"Navbar",utm_campaign:c,utm_content:e}),onClick:()=>a(!1),className:"flex w-full items-center gap-3",children:[D("div",{className:i("flex size-10 items-center justify-center rounded-lg border border-neutral-200 bg-gradient-to-t from-neutral-100",n==="small"&&"size-8"),children:s??D(o,{className:i("size-5 text-neutral-700 grayscale",n==="small"&&"size-4")})}),Ee("div",{children:[D("div",{className:"flex items-center gap-2",children:D("h2",{className:"text-sm font-medium text-neutral-900",children:e})}),t&&D("p",{className:"text-sm text-neutral-500",children:t})]})]})};function Wo({variant:e,className:t,...r}){return D(Ct,{...r,className:i("flex h-8 w-fit items-center whitespace-nowrap rounded-lg border px-3 text-[0.8125rem]",se({variant:e}),t)})}import{jsx as Pi}from"react/jsx-runtime";function Si({className:e}){return Pi("svg",{width:"46",height:"24",viewBox:"0 0 46 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i("h-6 w-auto text-black dark:text-white",e),children:Pi("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H14V13.9332L14.0003 13.9731L14.0003 14C14.0003 14.0223 14.0002 14.0445 14 14.0668V21H11V19.7455C9.86619 20.5362 8.48733 21 7.00016 21C3.13408 21 0 17.866 0 14C0 10.134 3.13408 7 7.00016 7C8.48733 7 9.86619 7.46375 11 8.25452V2ZM7 17.9998C9.20914 17.9998 11 16.209 11 13.9999C11 11.7908 9.20914 10 7 10C4.79086 10 3 11.7908 3 13.9999C3 16.209 4.79086 17.9998 7 17.9998ZM32 2H35V8.25474C36.1339 7.46383 37.5128 7 39.0002 7C42.8662 7 46.0003 10.134 46.0003 14C46.0003 17.866 42.8662 21 39.0002 21C35.1341 21 32 17.866 32 14V2ZM39 17.9998C41.2091 17.9998 43 16.209 43 13.9999C43 11.7908 41.2091 10 39 10C36.7909 10 35 11.7908 35 13.9999C35 16.209 36.7909 17.9998 39 17.9998ZM19 7H16V14C16 14.9192 16.1811 15.8295 16.5329 16.6788C16.8846 17.5281 17.4003 18.2997 18.0503 18.9497C18.7003 19.5997 19.472 20.1154 20.3213 20.4671C21.1706 20.8189 22.0809 21 23.0002 21C23.9194 21 24.8297 20.8189 25.679 20.4671C26.5283 20.1154 27.3 19.5997 27.95 18.9497C28.6 18.2997 29.1157 17.5281 29.4675 16.6788C29.8192 15.8295 30.0003 14.9192 30.0003 14H30V7H27V14C27 15.0608 26.5785 16.0782 25.8284 16.8283C25.0783 17.5784 24.0609 17.9998 23 17.9998C21.9391 17.9998 20.9217 17.5784 20.1716 16.8283C19.4215 16.0782 19 15.0608 19 14V7Z",fill:"currentColor"})})}import{jsx as q,jsxs as Ri}from"react/jsx-runtime";var vu=`<svg width="65" height="64" viewBox="0 0 65 64" fill="none" xmlns="http://www.w3.org/2000/svg">
49
+ radial-gradient(at 79% 53%, hsla(343, 68%, 79%, 1) 0px, transparent 50%)`,position:"absolute",height:"100%",filter:"blur(100px) saturate(150%)",top:"80px",opacity:.15}};import{ChevronDown as yu}from"lucide-react";import Nu from"next/image";import $e from"next/link";import{useParams as wu}from"next/navigation";import{useState as Cu}from"react";import{jsx as si}from"react/jsx-runtime";function Ft({className:e}){return si("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i("h-10 w-10 text-black dark:text-white",e),children:si("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M32 64C49.6731 64 64 49.6731 64 32C64 20.1555 57.5648 9.81398 48 4.28103V31.9999V47.9999H40V45.8594C37.6466 47.2208 34.9143 47.9999 32 47.9999C23.1634 47.9999 16 40.8365 16 31.9999C16 23.1634 23.1634 15.9999 32 15.9999C34.9143 15.9999 37.6466 16.7791 40 18.1404V1.00814C37.443 0.350024 34.7624 0 32 0C14.3269 0 0 14.3269 0 32C0 49.6731 14.3269 64 32 64Z",fill:"currentColor"})})}var Wr=[{id:"links",title:"Dub Links",description:"Short links with superpowers",icon:ct,href:"/links"},{id:"partners",title:"Dub Partners",description:"Grow your revenue with partnerships",icon:dt,href:"/partners"},{id:"analytics",title:"Dub Analytics",description:"Powerful real-time analytics",icon:lt,href:"/analytics"},{id:"api",title:"Dub API",description:"Programmatic link creation at scale",icon:er,href:"/docs/api-reference/introduction"},{title:"Dub Integrations",description:"Connect Dub with your favorite tools",icon:Za,href:"/integrations"}],Vo=[{icon:va,iconClassName:"py-0.5 group-hover:text-[#3178C6]",title:"Typescript",href:"/sdks/typescript"},{icon:ba,iconClassName:"py-0.5 [&_.snake]:transition-colors group-hover:[&_.snake1]:text-[#3776ab] group-hover:[&_.snake2]:text-[#ffd343]",title:"Python",href:"/sdks/python"},{icon:fa,iconClassName:"group-hover:text-[#00ACD7]",title:"Go",href:"/sdks/go"},{icon:ha,iconClassName:"py-[3px] grayscale brightness-150 transition-[filter] group-hover:grayscale-0 group-hover:brightness-100",title:"Ruby",href:"/sdks/ruby"},{icon:ga,iconClassName:"py-[3px] grayscale brightness-150 transition-[filter] group-hover:grayscale-0 group-hover:brightness-100",title:"PHP",href:"/sdks/php"}],li=[{icon:sr,title:"Marketing Attribution",description:"Easily track and measure marketing impact",href:"/analytics"},{icon:cr,title:"Content Creators",description:"Intelligent audience insights and link tracking",href:"/solutions/creators"},{icon:Rt,title:"Affiliate Management",description:"Manage affiliates and automate payouts",href:"/partners"},{label:"SDKs",items:Vo}],Wt=[{icon:lr,title:"Help Center",description:"Answers to your questions",href:"/help"},{icon:nr,title:"Docs",description:"Platform documentation",href:"/docs/introduction"},{icon:Rt,title:"About",description:"Company, values, and team",href:"/about"},{icon:ya,title:"Careers",description:"Join our global, remote team",href:"/careers"},{icon:za,title:"Blog",description:"Insights and stories",href:"/blog"},{icon:Na,title:"Changelog",description:"Releases and updates",href:"/changelog"},{icon:Ft,title:"Brand Guidelines",description:"Logos, wordmark, etc.",href:"/brand"},{icon:Ia,title:"Contact",description:"Reach out to support or sales",href:"/contact"}],ci=[{name:"Bitly",slug:"bitly"},{name:"Rebrandly",slug:"rebrandly"},{name:"Short.io",slug:"short"},{name:"Bl.ink",slug:"blink"}],di=[{name:"Affiliate Program Terms",slug:"affiliates"},{name:"DPA",slug:"dpa"},{name:"Partner Terms",slug:"partners"},{name:"Privacy Policy",slug:"privacy"},{name:"Report Abuse",slug:"abuse"},{name:"SLA",slug:"sla"},{name:"Subprocessors",slug:"subprocessors"},{name:"Terms of Service",slug:"terms"}],W3=[{name:"X (Twitter)",icon:or,href:"https://x.com/dubdotco"},{name:"LinkedIn",icon:rr,href:"https://www.linkedin.com/company/dubinc"},{name:"GitHub",icon:tr,href:"https://github.com/dubinc/dub"},{name:"YouTube",icon:ar,href:"https://www.youtube.com/@dubdotco"}];import{jsx as Dm}from"react/jsx-runtime";function Br({className:e,children:t}){return Dm("div",{className:i("mx-auto w-full max-w-screen-xl px-3 lg:px-10",e),children:t})}import*as Be from"@radix-ui/react-popover";import{BoxSelect as cu,Home as du,LayoutGrid as mu,Type as uu}from"lucide-react";import{useParams as pu}from"next/navigation";import{useCallback as fu,useContext as gu,useState as bu}from"react";import{toast as hu}from"sonner";import*as ue from"@radix-ui/react-navigation-menu";import{LayoutGroup as Km}from"framer-motion";import jt from"next/link";import{useParams as Ym,usePathname as Zm}from"next/navigation";import{createContext as qm,useId as Xm}from"react";import Jm from"swr";import{Link as bi}from"@radix-ui/react-navigation-menu";import hi from"next/image";import vi from"next/link";import{Link2 as Em}from"lucide-react";import{jsx as Z,jsxs as J}from"react/jsx-runtime";var mi={clicks:{color:"#3B82F6",value:"12.5K"},leads:{color:"#A855F7",value:"8.2K"},sales:{color:"#14B8A6",value:"$12K"}},ot={name:"Danielle Wilson",email:"danielle@dub.co",avatarIndex:8,origin:"dub.sh",country:"US",details:{"Lifetime value":"$12.5k",Account:"Pro",Subscription:"2y 10m"}};function ui({className:e}){return J("div",{className:i("pointer-events-none relative size-full",e),children:[J("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 339 168",className:"h-auto w-full [mask-image:linear-gradient(90deg,transparent,black_10%,black_90%,transparent)]",children:[Z("path",{stroke:"#00BBA7",strokeWidth:"2",d:"m345 1-60.533 76.487a8 8 0 0 1-9.732 2.25l-25.53-12.241a8 8 0 0 0-9.214 1.657l-62.736 64.993a8 8 0 0 1-6.695 2.388L67.303 124.331a8 8 0 0 0-5.193 1.17L-3.166 166.5"}),Z("circle",{cx:"259.333",cy:"72",r:"3",fill:"#00BBA7"}),Z("circle",{cx:"259.333",cy:"72",r:"4",stroke:"#3EC5B8",strokeOpacity:"0.3",strokeWidth:"2"})]}),J("div",{className:"absolute bottom-0 left-5 flex items-start gap-2",children:[J("div",{className:"border-border-default bg-bg-default w-[172px] rounded-lg border p-0",children:[J("div",{className:"p-1.5",children:[J("div",{className:"bg-bg-subtle border-border-subtle text-content-default hidden items-center gap-2 rounded border p-2 text-xs font-medium leading-none sm:flex",children:[Z(Em,{className:"size-3 rotate-90"}),"d.to/try"]}),Z("div",{className:"text-content-default mt-1 px-1.5 pb-0.5 text-[0.8125rem] font-medium sm:mt-2",children:"Apr 2025"})]}),Z("div",{className:"border-border-default flex flex-col gap-2 border-t p-3",children:["clicks","leads","sales"].map(t=>J("div",{className:"flex items-center justify-between gap-2",children:[J("div",{className:"flex items-center gap-2",children:[Z("div",{className:"size-2 rounded-sm border border-black/20 bg-current opacity-70",style:{color:mi[t].color}}),Z("div",{className:"text-content-subtle text-xs font-medium leading-none",children:Jt(t)})]}),J("span",{className:"text-content-emphasis text-xs leading-none",children:[t==="sales"?"$":"",mi[t].value]})]},t))})]}),Z("div",{className:"relative",children:J("div",{className:"border-border-default bg-bg-default absolute left-0 top-0 rounded-lg border py-0.5",children:[J("div",{className:"px-3 py-2.5",children:[J("div",{className:"flex justify-between gap-2",children:[Z("div",{className:"bg-bg-emphasis size-11 rounded-full",style:{backgroundImage:"url(https://assets.dub.co/home/people.png)",backgroundSize:"3600%",backgroundPositionX:ot.avatarIndex*100+"%"}}),J("div",{className:"flex flex-col items-end gap-1",children:[J("div",{className:"bg-bg-default border-border-subtle text-content-default flex items-center gap-1.5 rounded-full border px-1.5 py-0.5 text-xs",children:[Z(Da,{className:"text-content-default size-3.5"}),ot.origin]}),J("div",{className:"bg-bg-default border-border-subtle text-content-default flex items-center gap-1.5 rounded-full border px-1.5 py-0.5 text-xs",children:[Z("img",{src:`https://flag.vercel.app/m/${ot.country}.svg`,className:"relative h-2.5 w-3 rounded-sm"}),ot.country]})]})]}),Z("div",{className:"text-content-emphasis mt-4 text-[0.8125rem] font-medium",children:ot.name}),Z("div",{className:"text-content-subtle mt-px text-xs",children:ot.email})]}),Z("div",{className:"border-border-default flex flex-col gap-2.5 border-t px-3 pb-2.5 pt-3",children:Object.entries(ot.details).map(([t,r])=>J("div",{className:"relative flex items-center justify-between gap-2 text-xs leading-none",children:[Z("span",{className:"text-content-muted truncate font-medium",children:t}),Z("span",{className:"text-content-default",children:r})]},t))})]})})]})]})}import{useId as Im}from"react";import{jsx as b,jsxs as me}from"react/jsx-runtime";function pi(e){let t=Im();return me("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"300",height:"180",fill:"none",viewBox:"0 0 300 180",...e,className:i("pointer-events-none text-[var(--fg)] [--bg:white] [--border:#e5e5e5] [--fg:#171717] [--muted:#404040] dark:[--bg:black] dark:[--border:#fff3] dark:[--fg:#fffa] dark:[--muted:#fff7]",e.className),children:[me("defs",{children:[b("path",{id:`${t}-m`,className:"fill-[var(--bg)]",d:"M0 0h10.24v10.24H0z"}),b("path",{id:`${t}-n`,className:"fill-[var(--bg)]",d:"M0 0h8.05v8.05H0z"}),b("path",{id:`${t}-o`,className:"fill-[var(--bg)]",d:"M0 0h11.71v11.71H0z"})]}),b("rect",{width:"292",height:"52",x:"4",y:"4",rx:"8.78",className:"fill-[var(--bg)]"}),b("rect",{width:"292",height:"52",x:"4",y:"4",className:"stroke-[var(--border)]",strokeWidth:"0.73",rx:"8.78"}),b("rect",{width:"24.88",height:"24.88",x:"17.17",y:"17.56",fill:`url(#${t}-a)`,rx:"12.44"}),b("rect",{width:"25.61",height:"25.61",x:"16.8",y:"17.2",className:"stroke-[var(--border)]",strokeWidth:"0.73",rx:"12.8"}),b("path",{className:"fill-[var(--fg)]",d:"M29.61 23c.6 0 1.19.08 1.75.22v3.75a3.5 3.5 0 1 0 0 6.06v.47h1.75v-9.56a7 7 0 1 1-3.5-.94m2.29.39"}),b("text",{xmlSpace:"preserve",className:"fill-[var(--fg)]",fontSize:"10.24",fontWeight:"600",style:{whiteSpace:"pre"},children:b("tspan",{x:"50.83",y:"25.49",children:"d.to"})}),me("g",{className:"stroke-[var(--fg)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-b)`,children:[b("path",{d:"M84.47 26.08h3.98c.63 0 1.14-.51 1.14-1.14v-3.98c0-.63-.51-1.14-1.14-1.14h-3.98c-.63 0-1.14.5-1.14 1.14v3.98c0 .63.5 1.14 1.14 1.14"}),b("path",{d:"M82.05 24a1.14 1.14 0 0 1-.71-1.05v-3.99c0-.63.5-1.13 1.14-1.13h3.98c.48 0 .89.29 1.05.7"})]}),b("path",{className:"stroke-[var(--fg)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",d:"M106.87 23.66h-1.29a.85.85 0 0 0-.85.85v1.28m-1.71-5.97v1.28a.85.85 0 0 1-.85.85h-1.28m3.84.01h.43m-2.14 3.83v-.42m-3.41-7.26h1.28c.24 0 .43.2.43.43v1.28c0 .23-.2.42-.43.42h-1.28a.43.43 0 0 1-.43-.42v-1.28c0-.24.2-.43.43-.43m5.55 0h1.28c.23 0 .43.2.43.43v1.28c0 .23-.2.42-.43.42h-1.28a.43.43 0 0 1-.43-.42v-1.28c0-.24.2-.43.43-.43m-5.55 5.55h1.28c.24 0 .43.19.43.43v1.28c0 .23-.2.42-.43.42h-1.28a.43.43 0 0 1-.43-.42v-1.28c0-.24.2-.43.43-.43"}),me("g",{stroke:"#A1A1A1",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-c)`,children:[b("path",{d:"M59.11 38.38h-4.7a.9.9 0 0 1-.89-.89V35.7"}),b("path",{d:"m57.21 36.48 1.9 1.9-1.9 1.9"})]}),b("text",{xmlSpace:"preserve",fill:"#737373",fontSize:"10.24",fontWeight:"500",style:{whiteSpace:"pre"},children:b("tspan",{x:"63.27",y:"41.59",children:"dub.co"})}),b("path",{className:"fill-[var(--bg)]",d:"M205.12 19.4h69.22c1.24 0 2.14 0 2.86.05.62.05 1.07.14 1.44.3l.16.08c.66.34 1.22.85 1.6 1.48l.16.28c.21.4.32.9.38 1.6.06.72.06 1.62.06 2.86v7.9c0 1.24 0 2.14-.06 2.85a4.6 4.6 0 0 1-.3 1.45l-.08.16a4 4 0 0 1-1.48 1.6l-.28.16c-.4.2-.9.32-1.6.38-.72.06-1.62.06-2.86.06h-69.22c-1.23 0-2.14 0-2.85-.06a4.6 4.6 0 0 1-1.45-.3l-.16-.08a4 4 0 0 1-1.6-1.48l-.16-.28c-.2-.4-.32-.9-.38-1.6-.06-.72-.06-1.62-.06-2.86v-7.9c0-1.24 0-2.14.06-2.85s.17-1.2.38-1.61c.39-.76 1-1.38 1.76-1.76.41-.2.9-.32 1.6-.38.72-.06 1.63-.06 2.86-.06Z"}),b("path",{className:"stroke-[var(--border)]",strokeWidth:"0.73",d:"M205.12 19.4h69.22c1.24 0 2.14 0 2.86.05.62.05 1.07.14 1.44.3l.16.08c.66.34 1.22.85 1.6 1.48l.16.28c.21.4.32.9.38 1.6.06.72.06 1.62.06 2.86v7.9c0 1.24 0 2.14-.06 2.85a4.6 4.6 0 0 1-.3 1.45l-.08.16a4 4 0 0 1-1.48 1.6l-.28.16c-.4.2-.9.32-1.6.38-.72.06-1.62.06-2.86.06h-69.22c-1.23 0-2.14 0-2.85-.06a4.6 4.6 0 0 1-1.45-.3l-.16-.08a4 4 0 0 1-1.6-1.48l-.16-.28c-.2-.4-.32-.9-.38-1.6-.06-.72-.06-1.62-.06-2.86v-7.9c0-1.24 0-2.14.06-2.85s.17-1.2.38-1.61c.39-.76 1-1.38 1.76-1.76.41-.2.9-.32 1.6-.38.72-.06 1.63-.06 2.86-.06Z"}),b("g",{className:"stroke-[var(--muted)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-d)`,children:b("path",{d:"m209.95 29.2 4.75 1.64c.15.05.15.25 0 .3l-2.13.8a.16.16 0 0 0-.09.1l-.8 2.13a.16.16 0 0 1-.3 0l-1.64-4.76a.16.16 0 0 1 .2-.2h0Zm2.55 2.77 2.75 2.74m-5.53-9.43v1.3m2.76-.15-.92.92m-4.6 4.6.92-.92m-2.06-1.84h1.3m-.16-2.76.92.92"})}),b("text",{xmlSpace:"preserve",className:"fill-[var(--muted)]",fontSize:"8.78",fontWeight:"500",style:{whiteSpace:"pre"},children:b("tspan",{x:"220.78",y:"33.19",children:"151.8K clicks"})}),b("rect",{width:"292",height:"52",x:"4",y:"64",rx:"8.78",className:"fill-[var(--bg)]"}),b("rect",{width:"292",height:"52",x:"4",y:"64",className:"stroke-[var(--border)]",strokeWidth:"0.73",rx:"8.78"}),b("rect",{width:"24.88",height:"24.88",x:"17.17",y:"77.56",fill:`url(#${t}-e)`,rx:"12.44"}),b("rect",{width:"25.61",height:"25.61",x:"16.8",y:"77.19",className:"stroke-[var(--border)]",strokeWidth:"0.73",rx:"12.8"}),b("path",{className:"fill-[var(--fg)]",d:"M29.61 83c.6 0 1.19.08 1.75.22v3.75a3.5 3.5 0 1 0 0 6.06v.47h1.75v-9.56a7 7 0 1 1-3.5-.94m2.29.39"}),b("text",{xmlSpace:"preserve",className:"fill-[var(--fg)]",fontSize:"10.24",fontWeight:"600",style:{whiteSpace:"pre"},children:b("tspan",{x:"50.83",y:"85.49",children:"d.to/register"})}),me("g",{className:"stroke-[var(--fg)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-f)`,children:[b("path",{d:"M126.47 86.08h3.98c.63 0 1.14-.51 1.14-1.14v-3.98c0-.63-.51-1.14-1.14-1.14h-3.98c-.63 0-1.14.5-1.14 1.14v3.98c0 .63.5 1.14 1.14 1.14"}),b("path",{d:"M124.05 84a1.14 1.14 0 0 1-.71-1.05v-3.99c0-.63.5-1.13 1.13-1.13h3.99c.48 0 .89.29 1.05.7"})]}),b("path",{className:"stroke-[var(--fg)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",d:"M148.87 83.66h-1.28a.85.85 0 0 0-.86.85v1.28m-1.71-5.97v1.28a.85.85 0 0 1-.85.85h-1.28m3.84.01h.43m-2.14 3.83v-.42m-3.41-7.26h1.28c.24 0 .43.2.43.43v1.28c0 .23-.2.42-.43.42h-1.28a.43.43 0 0 1-.43-.42v-1.28c0-.24.2-.43.43-.43m5.55 0h1.28c.24 0 .43.2.43.43v1.28c0 .23-.2.42-.43.42h-1.28a.43.43 0 0 1-.43-.42v-1.28c0-.24.2-.43.43-.43m-5.55 5.55h1.28c.24 0 .43.19.43.43v1.28c0 .23-.2.42-.43.42h-1.28a.43.43 0 0 1-.43-.42v-1.28c0-.24.2-.43.43-.43"}),me("g",{stroke:"#A1A1A1",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-g)`,children:[b("path",{d:"M59.11 98.38h-4.7a.9.9 0 0 1-.89-.89V95.7"}),b("path",{d:"m57.21 96.48 1.9 1.9-1.9 1.9"})]}),b("text",{xmlSpace:"preserve",fill:"#737373",fontSize:"10.24",fontWeight:"500",style:{whiteSpace:"pre"},children:b("tspan",{x:"63.27",y:"101.59",children:"app.dub.co/register"})}),b("path",{className:"fill-[var(--bg)]",d:"M211.12 79.4h63.22c1.24 0 2.14 0 2.86.05.62.05 1.07.14 1.44.3l.16.08c.66.34 1.22.85 1.6 1.48l.16.28c.21.4.32.9.38 1.6.06.72.06 1.62.06 2.86v7.9c0 1.24 0 2.14-.06 2.85a4.6 4.6 0 0 1-.3 1.45l-.08.16a4.03 4.03 0 0 1-1.48 1.6l-.28.16c-.4.2-.9.32-1.6.38-.72.06-1.62.06-2.86.06h-63.22c-1.23 0-2.14 0-2.85-.06a4.6 4.6 0 0 1-1.45-.3l-.16-.08a4 4 0 0 1-1.6-1.48l-.16-.28c-.2-.4-.32-.9-.38-1.6-.06-.72-.06-1.62-.06-2.86v-7.9c0-1.24 0-2.14.06-2.85s.17-1.2.38-1.61c.39-.76 1-1.38 1.76-1.76.41-.2.9-.32 1.6-.38.72-.06 1.63-.06 2.86-.06Z"}),b("path",{className:"stroke-[var(--border)]",strokeWidth:"0.73",d:"M211.12 79.4h63.22c1.24 0 2.14 0 2.86.05.62.05 1.07.14 1.44.3l.16.08c.66.34 1.22.85 1.6 1.48l.16.28c.21.4.32.9.38 1.6.06.72.06 1.62.06 2.86v7.9c0 1.24 0 2.14-.06 2.85a4.6 4.6 0 0 1-.3 1.45l-.08.16a4.03 4.03 0 0 1-1.48 1.6l-.28.16c-.4.2-.9.32-1.6.38-.72.06-1.62.06-2.86.06h-63.22c-1.23 0-2.14 0-2.85-.06a4.6 4.6 0 0 1-1.45-.3l-.16-.08a4 4 0 0 1-1.6-1.48l-.16-.28c-.2-.4-.32-.9-.38-1.6-.06-.72-.06-1.62-.06-2.86v-7.9c0-1.24 0-2.14.06-2.85s.17-1.2.38-1.61c.39-.76 1-1.38 1.76-1.76.41-.2.9-.32 1.6-.38.72-.06 1.63-.06 2.86-.06Z"}),b("g",{className:"stroke-[var(--muted)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-h)`,children:b("path",{d:"m215.95 89.2 4.75 1.64c.15.05.15.25 0 .3l-2.13.8a.16.16 0 0 0-.09.1l-.8 2.13a.16.16 0 0 1-.3 0l-1.64-4.76a.16.16 0 0 1 .2-.2h0Zm2.55 2.77 2.75 2.74m-5.53-9.43v1.3m2.76-.15-.92.92m-4.6 4.6.92-.92m-2.06-1.84h1.3m-.16-2.76.92.92"})}),b("text",{xmlSpace:"preserve",className:"fill-[var(--muted)]",fontSize:"8.78",fontWeight:"500",style:{whiteSpace:"pre"},children:b("tspan",{x:"226.78",y:"93.19",children:"100K clicks"})}),b("path",{className:"fill-[var(--bg)]",d:"M4 138.05c0-4.92 0-7.38.96-9.26a8.7 8.7 0 0 1 3.83-3.83c1.88-.96 4.34-.96 9.26-.96h263.9c4.92 0 7.38 0 9.26.96a8.7 8.7 0 0 1 3.83 3.83c.96 1.88.96 4.34.96 9.26v23.9c0 4.92 0 7.38-.96 9.26a8.78 8.78 0 0 1-3.83 3.83c-1.88.96-4.34.96-9.26.96H18.05c-4.92 0-7.38 0-9.26-.96a8.78 8.78 0 0 1-3.83-3.83C4 169.33 4 166.87 4 161.95z"}),b("path",{className:"stroke-[var(--border)]",strokeWidth:"0.73",d:"M4 138.05c0-4.92 0-7.38.96-9.26a8.7 8.7 0 0 1 3.83-3.83c1.88-.96 4.34-.96 9.26-.96h263.9c4.92 0 7.38 0 9.26.96a8.7 8.7 0 0 1 3.83 3.83c.96 1.88.96 4.34.96 9.26v23.9c0 4.92 0 7.38-.96 9.26a8.78 8.78 0 0 1-3.83 3.83c-1.88.96-4.34.96-9.26.96H18.05c-4.92 0-7.38 0-9.26-.96a8.78 8.78 0 0 1-3.83-3.83C4 169.33 4 166.87 4 161.95z"}),b("rect",{width:"24.88",height:"24.88",x:"17.17",y:"137.56",fill:`url(#${t}-i)`,rx:"12.44"}),b("rect",{width:"25.61",height:"25.61",x:"16.8",y:"137.19",className:"stroke-[var(--border)]",strokeWidth:"0.73",rx:"12.8"}),b("path",{className:"fill-[var(--fg)]",d:"M29.61 143c.6 0 1.19.08 1.75.22v3.75a3.5 3.5 0 1 0 0 6.06v.47h1.75v-9.56a7 7 0 1 1-3.5-.94m2.29.39"}),b("text",{xmlSpace:"preserve",className:"fill-[var(--fg)]",fontSize:"10.24",fontWeight:"600",style:{whiteSpace:"pre"},children:b("tspan",{x:"50.83",y:"145.49",children:"d.to/try"})}),me("g",{className:"stroke-[var(--fg)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-j)`,children:[b("path",{d:"M102.47 146.08h3.98c.63 0 1.14-.51 1.14-1.14v-3.98c0-.63-.51-1.14-1.14-1.14h-3.98c-.63 0-1.14.5-1.14 1.14v3.98c0 .63.5 1.14 1.14 1.14"}),b("path",{d:"M100.05 144a1.14 1.14 0 0 1-.71-1.05v-3.99c0-.63.5-1.14 1.13-1.14h3.99c.48 0 .89.3 1.06.72"})]}),b("path",{className:"stroke-[var(--fg)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",d:"M124.87 143.66h-1.29a.85.85 0 0 0-.85.85v1.28m-1.71-5.97v1.28a.85.85 0 0 1-.85.85h-1.28m3.84.01h.43m-2.14 3.83v-.42m-3.41-7.26h1.28c.24 0 .43.2.43.43v1.28c0 .23-.2.42-.43.42h-1.28a.43.43 0 0 1-.43-.42v-1.28c0-.24.2-.43.43-.43m5.55 0h1.28c.23 0 .43.2.43.43v1.28c0 .23-.2.42-.43.42h-1.28a.43.43 0 0 1-.43-.42v-1.28c0-.24.2-.43.43-.43m-5.55 5.55h1.28c.24 0 .43.19.43.43v1.28c0 .23-.2.42-.43.42h-1.28a.43.43 0 0 1-.43-.42v-1.28c0-.24.2-.43.43-.43"}),me("g",{stroke:"#A1A1A1",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-k)`,children:[b("path",{d:"M59.11 158.38h-4.7a.9.9 0 0 1-.89-.89v-1.79"}),b("path",{d:"m57.21 156.48 1.9 1.9-1.9 1.9"})]}),b("text",{xmlSpace:"preserve",fill:"#737373",fontSize:"10.24",fontWeight:"500",style:{whiteSpace:"pre"},children:b("tspan",{x:"63.27",y:"161.59",children:"app.dub.co/register"})}),b("path",{className:"fill-[var(--bg)]",d:"M208.12 139.4h66.22c1.24 0 2.14 0 2.86.05.62.05 1.07.14 1.44.3l.16.08c.66.34 1.22.85 1.6 1.48l.16.28c.21.4.32.9.38 1.6.06.72.06 1.62.06 2.86v7.9c0 1.24 0 2.14-.06 2.86a4.6 4.6 0 0 1-.3 1.44l-.08.16a4 4 0 0 1-1.48 1.6l-.28.16c-.4.2-.9.32-1.6.38-.72.06-1.62.06-2.86.06h-66.22c-1.23 0-2.14 0-2.85-.06a4.6 4.6 0 0 1-1.45-.3l-.16-.08a4 4 0 0 1-1.6-1.48l-.16-.28c-.2-.4-.32-.9-.38-1.6-.06-.72-.06-1.62-.06-2.86v-7.9c0-1.24 0-2.14.06-2.86.06-.7.17-1.2.38-1.6.39-.76 1-1.38 1.76-1.76.41-.2.9-.32 1.6-.38.72-.06 1.63-.06 2.86-.06Z"}),b("path",{className:"stroke-[var(--border)]",strokeWidth:"0.73",d:"M208.12 139.4h66.22c1.24 0 2.14 0 2.86.05.62.05 1.07.14 1.44.3l.16.08c.66.34 1.22.85 1.6 1.48l.16.28c.21.4.32.9.38 1.6.06.72.06 1.62.06 2.86v7.9c0 1.24 0 2.14-.06 2.86a4.6 4.6 0 0 1-.3 1.44l-.08.16a4 4 0 0 1-1.48 1.6l-.28.16c-.4.2-.9.32-1.6.38-.72.06-1.62.06-2.86.06h-66.22c-1.23 0-2.14 0-2.85-.06a4.6 4.6 0 0 1-1.45-.3l-.16-.08a4 4 0 0 1-1.6-1.48l-.16-.28c-.2-.4-.32-.9-.38-1.6-.06-.72-.06-1.62-.06-2.86v-7.9c0-1.24 0-2.14.06-2.86.06-.7.17-1.2.38-1.6.39-.76 1-1.38 1.76-1.76.41-.2.9-.32 1.6-.38.72-.06 1.63-.06 2.86-.06Z"}),b("g",{className:"stroke-[var(--muted)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-l)`,children:b("path",{d:"m212.95 149.2 4.75 1.64c.15.05.15.25 0 .3l-2.13.8a.17.17 0 0 0-.09.1l-.8 2.13a.16.16 0 0 1-.3 0l-1.64-4.76a.16.16 0 0 1 .2-.2h0Zm2.55 2.77 2.75 2.74m-5.53-9.43v1.3m2.76-.15-.92.92m-4.6 4.6.92-.92m-2.06-1.84h1.3m-.16-2.76.92.92"})}),b("text",{xmlSpace:"preserve",className:"fill-[var(--muted)]",fontSize:"8.78",fontWeight:"500",style:{whiteSpace:"pre"},children:b("tspan",{x:"223.78",y:"153.19",children:"65.8K clicks"})}),me("defs",{children:[b("clipPath",{id:`${t}-b`,children:b("use",{xlinkHref:`#${t}-m`,transform:"translate(80.34 16.83)"})}),b("clipPath",{id:`${t}-c`,children:b("use",{xlinkHref:`#${t}-n`,transform:"translate(52.3 34.02)"})}),b("clipPath",{id:`${t}-d`,children:b("use",{xlinkHref:`#${t}-o`,transform:"translate(204.68 24.15)"})}),b("clipPath",{id:`${t}-f`,children:b("use",{xlinkHref:`#${t}-m`,transform:"translate(122.34 76.83)"})}),b("clipPath",{id:`${t}-g`,children:b("use",{xlinkHref:`#${t}-n`,transform:"translate(52.3 94.02)"})}),b("clipPath",{id:`${t}-h`,children:b("use",{xlinkHref:`#${t}-o`,transform:"translate(210.68 84.15)"})}),b("clipPath",{id:`${t}-j`,children:b("use",{xlinkHref:`#${t}-m`,transform:"translate(98.34 136.83)"})}),b("clipPath",{id:`${t}-k`,children:b("use",{xlinkHref:`#${t}-n`,transform:"translate(52.3 154.02)"})}),b("clipPath",{id:`${t}-l`,children:b("use",{xlinkHref:`#${t}-o`,transform:"translate(207.68 144.15)"})}),me("linearGradient",{id:`${t}-a`,x1:"29.61",x2:"29.61",y1:"17.56",y2:"42.44",gradientUnits:"userSpaceOnUse",children:[b("stop",{stopColor:"#030712",stopOpacity:"0"}),b("stop",{offset:"1",stopColor:"#030712",stopOpacity:"0.05"})]}),me("linearGradient",{id:`${t}-e`,x1:"29.61",x2:"29.61",y1:"77.56",y2:"102.44",gradientUnits:"userSpaceOnUse",children:[b("stop",{stopColor:"#030712",stopOpacity:"0"}),b("stop",{offset:"1",stopColor:"#030712",stopOpacity:"0.05"})]}),me("linearGradient",{id:`${t}-i`,x1:"29.61",x2:"29.61",y1:"137.56",y2:"162.44",gradientUnits:"userSpaceOnUse",children:[b("stop",{stopColor:"#030712",stopOpacity:"0"}),b("stop",{offset:"1",stopColor:"#030712",stopOpacity:"0.05"})]})]})]})}import{Fragment as Om,jsx as De,jsxs as Bt}from"react/jsx-runtime";var Am=[{name:"Lauren Anderson",country:"US",revenue:1800,payouts:550},{name:"Mia Taylor",country:"US",revenue:22600,payouts:6800},{name:"Sophie Laurent",country:"CA",revenue:11e3,payouts:3300},{name:"Hiroshi Tanaka",country:"JP",revenue:19200,payouts:5700},{name:"Elias Weber",country:"DE",revenue:783,payouts:235},{name:"Liam Carter",country:"US",revenue:3e4,payouts:9200}];function fi({className:e}){return De("div",{className:i("pointer-events-none relative size-full dark:opacity-80",e),"aria-hidden":!0,children:De("div",{className:"absolute left-0 top-0 grid grid-cols-[repeat(2,180px)]",children:Am.map((t,r)=>De("div",{className:"h-[60px] w-[180px] p-[3px]",children:De("div",{className:"border-border-subtle bg-bg-default flex size-full select-none overflow-hidden rounded border",children:t&&Bt(Om,{children:[De("div",{className:"bg-bg-emphasis aspect-square h-full",style:{backgroundImage:"url(https://assets.dub.co/partners/partner-images.jpg)",backgroundSize:"1400%",backgroundPositionX:(14-r%14)*100+"%"}},r),Bt("div",{className:"border-border-subtle flex h-full flex-col justify-between border-l px-2 py-1.5",children:[Bt("div",{className:"flex items-center gap-1.5",children:[De("img",{alt:"US Flag",src:`https://flag.vercel.app/m/${t.country}.svg`,className:"h-2.5 w-3 rounded-sm border-[0.5px] border-black/15"}),De("span",{className:"text-content-default text-[9px] font-medium",children:t.name})]}),De("div",{className:"divide-border-subtle flex divide-x",children:["revenue","payouts"].map((o,a)=>Bt("div",{className:i("flex flex-col",a===0?"pr-4":"pl-4"),children:[De("span",{className:"text-content-muted text-[6px] font-medium",children:Jt(o)}),Bt("span",{className:"text-content-default text-[9px] font-medium",children:["$",Qt(t[o])]})]},o))})]})]})})},r))})})}import{Link as zm}from"@radix-ui/react-navigation-menu";import Vm from"next/link";import{jsx as $t,jsxs as gi}from"react/jsx-runtime";var at="text-xs uppercase text-neutral-500 dark:text-white/60",Hm="group rounded-[8px] p-2 transition-colors hover:bg-neutral-50 active:bg-neutral-100 dark:hover:bg-white/[0.15] dark:active:bg-white/20",Ce=({domain:e,...t})=>({utm_source:"Custom Domain",utm_medium:"Navbar",utm_campaign:e,...t});function Ut({icon:e,title:t,description:r,descriptionLines:o=1,className:a,showArrow:n,...c}){return $t(zm,{asChild:!0,children:$t(Vm,{className:i(Hm,a),...c,children:gi("div",{className:"flex items-center justify-between gap-3",children:[e,gi("div",{className:"flex-1",children:[$t("p",{className:"text-sm font-medium text-neutral-700 dark:text-white",children:t}),r&&$t("p",{className:i("text-xs text-neutral-500 dark:text-white/60",["line-clamp-1","line-clamp-2"][o-1]),children:r})]}),n&&$t(la,{className:"invisible -ml-6 h-4 w-4 text-neutral-700 group-aria-selected:visible sm:group-hover:visible dark:text-white/80"})]})})})}import{jsx as z,jsxs as Gt}from"react/jsx-runtime";var _m=[{icon:z("div",{className:"flex size-4 items-center justify-center rounded bg-orange-400",children:z(ct,{className:"size-2.5 text-orange-900"})}),title:"Dub Links",description:"Short links with superpowers for modern marketing teams.",href:"/links",color:"#f4950c",graphicsContainerClassName:"px-2",graphic:z(pi,{className:"absolute left-0 top-0 h-auto w-full"})},{icon:z("div",{className:"flex size-4 items-center justify-center rounded bg-green-400",children:z(lt,{className:"size-2.5 text-green-900"})}),title:"Dub Analytics",description:"Powerful analytics delivered instantly.",href:"/analytics",color:"#36D78F",graphicsContainerClassName:"h-[170%] bottom-0 top-[unset]",graphic:z(ui,{className:"absolute bottom-0 left-0 size-full"})},{icon:z("div",{className:"flex size-4 items-center justify-center rounded bg-violet-400",children:z(dt,{className:"size-2.5 text-violet-900"})}),title:"Dub Partners",description:"Grow your revenue on auto-pilot with partnerships.",href:"/partners",color:"#818cf8",graphicsContainerClassName:"pl-2",graphic:z(fi,{})}],Fm=[{title:"Dub Integrations",description:"Enhance your short links",href:"/integrations",graphic:z("div",{className:"absolute -right-4 top-1/2 h-[180px] w-[240px] -translate-y-1/2 [mask-image:linear-gradient(90deg,black_50%,transparent_95%)] dark:opacity-80",children:z(hi,{src:"https://assets.dub.co/misc/integrations-grid.png",alt:"",fill:!0})})},{title:"Dub API",description:"Unlock further capabilities",href:"/docs/api-reference/introduction",graphic:z("div",{className:"absolute -right-4 top-2.5 h-[180px] w-[240px] [mask-image:linear-gradient(90deg,black_50%,transparent_95%)] dark:opacity-60",children:z(hi,{src:"https://assets.dub.co/misc/api-thumbnail.png",alt:"",fill:!0})})}];function xi({domain:e}){return Gt("div",{className:"grid w-[1020px] grid-cols-1 gap-4 p-4",children:[z("div",{className:"grid grid-cols-3 gap-4",children:_m.map(({title:t,description:r,icon:o,href:a,color:n,graphicsContainerClassName:c,graphic:s})=>z(bi,{asChild:!0,children:Gt(vi,{href:_(a,e,Ce({domain:e,utm_content:t})),className:"group relative flex flex-col overflow-hidden rounded-xl border border-neutral-100 bg-neutral-50 dark:border-white/20 dark:bg-white/10",children:[z(Je,{className:"[mask-image:linear-gradient(transparent,black,transparent)] dark:text-white/5",cellSize:60,patternOffset:[-51,-23]}),Gt("div",{className:"relative p-5 pb-0",children:[o,z("span",{className:"mt-3 block text-sm font-medium text-neutral-900 dark:text-white",children:t}),z("p",{className:"mt-2 max-w-56 text-sm text-neutral-500 dark:text-white/60",children:r})]}),z("div",{className:"relative mt-10 h-40 grow",children:z("div",{className:i("absolute left-0 top-0 size-full grow overflow-hidden [mask-image:linear-gradient(black_50%,transparent)]",c),children:z("div",{className:"relative size-full",children:s})})}),z("div",{className:"pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_50%_100%,var(--color),transparent)] opacity-[0.07] transition-opacity duration-150 group-hover:opacity-15",style:{"--color":n}})]})},t))}),z("div",{className:"grid grow grid-cols-2 gap-4",children:Fm.map(({title:t,description:r,href:o,graphic:a})=>z(bi,{asChild:!0,children:Gt(vi,{href:_(o,e,Ce({domain:e,utm_content:t})),className:"group relative flex flex-col justify-center rounded-xl border border-neutral-100 bg-neutral-50 transition-colors duration-150 hover:bg-neutral-100 active:bg-neutral-200 dark:border-white/20 dark:bg-white/10 dark:hover:bg-white/15 dark:active:bg-white/20",children:[z(Je,{className:"[mask-image:linear-gradient(90deg,transparent,black)] dark:text-white/5",cellSize:60,patternOffset:[-39,-49]}),z("div",{className:"pointer-events-none absolute inset-0 overflow-hidden","aria-hidden":!0,children:a}),z("div",{className:"relative flex items-center justify-between px-5 py-4",children:Gt("div",{children:[z("span",{className:"text-sm font-medium leading-none text-neutral-900 dark:text-white",children:t}),z("p",{className:"mt-1 text-sm text-neutral-500 dark:text-white/60",children:r})]})})]})},t))})]})}import{Link as Wm}from"@radix-ui/react-navigation-menu";import Bm from"next/link";import{jsx as j,jsxs as nt}from"react/jsx-runtime";var $m=[{icon:lr,title:"Help Center",description:"Answers to your questions",thumbnail:"https://assets.dub.co/misc/help-thumbnail.jpg",href:"/help"},{icon:nr,title:"Docs",description:"Platform documentation",thumbnail:"https://assets.dub.co/misc/docs-thumbnail.jpg",href:"/docs/introduction"}];function yi({domain:e}){return nt("div",{className:"grid w-[1020px] grid-cols-[0.9fr,0.55fr,0.55fr] divide-x divide-neutral-200 dark:divide-white/20",children:[nt("div",{className:"flex h-full flex-col p-4",children:[j("p",{className:i(at,"mb-4 ml-2"),children:"Explore"}),j("div",{className:"grid grow grid-cols-2 gap-4",children:$m.map(({icon:t,title:r,description:o,href:a})=>j(Wm,{asChild:!0,children:nt(Bm,{href:_(a,e,Ce({domain:e,utm_content:r})),className:i("group relative isolate z-0 flex flex-col justify-between overflow-hidden rounded-xl border border-neutral-100 bg-neutral-50 px-5 py-4 transition-colors duration-75","dark:border-white/20 dark:bg-neutral-900"),children:[nt("div",{className:"absolute inset-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:[j("div",{className:"absolute -inset-[25%] -skew-y-12 [mask-image:linear-gradient(225deg,black,transparent_50%)]",children:j(Je,{cellSize:46,patternOffset:[0,-14],className:"translate-y-2 text-[#ad1f3288] transition-transform duration-150 ease-out group-hover:translate-y-0"})}),j("div",{className:i("absolute -inset-[10%] opacity-10 blur-[50px] dark:brightness-150","bg-[conic-gradient(#F35066_0deg,#F35066_117deg,#9071F9_180deg,#5182FC_240deg,#F35066_360deg)]")})]}),j(t,{className:"relative size-5 text-neutral-700 dark:text-white/60"}),nt("div",{className:"relative",children:[j("span",{className:"text-sm font-medium text-neutral-900 dark:text-white",children:r}),j("p",{className:"mt-2 text-xs text-neutral-500 dark:text-white/60",children:o})]})]},r)},r))})]}),nt("div",{className:"px-6 py-4",children:[j("p",{className:i(at,"mb-2"),children:"Company"}),j("div",{className:"flex flex-col gap-0.5",children:Wt.filter(({title:t})=>["About","Careers","Brand Guidelines","Contact"].includes(t)).map(({icon:t,title:r,description:o,href:a})=>j(Ut,{className:"-mx-2",href:_(a,e,Ce({domain:e,utm_content:r})),icon:j("div",{className:"shrink-0 rounded-md border border-neutral-200 bg-white/50 p-2.5 dark:border-white/20 dark:bg-white/10",children:j(t,{className:"size-4 text-neutral-600 transition-colors dark:text-white/60"})}),title:r,description:o},a))})]}),nt("div",{className:"px-6 py-4",children:[j("p",{className:i(at,"mb-2"),children:"Updates"}),j("div",{className:"flex flex-col gap-0.5",children:Wt.filter(({title:t})=>["Blog","Changelog"].includes(t)).map(({icon:t,title:r,description:o,href:a})=>j(Ut,{className:"-mx-2",href:_(a,e,Ce({domain:e,utm_content:r})),icon:j("div",{className:"shrink-0 rounded-md border border-neutral-200 bg-white/50 p-2.5 dark:border-white/20 dark:bg-white/10",children:j(t,{className:"size-4 text-neutral-600 transition-colors dark:text-white/60"})}),title:r,description:o},a))})]})]})}import{Link as Um}from"@radix-ui/react-navigation-menu";import Gm from"next/link";import{jsx as re,jsxs as Nt}from"react/jsx-runtime";var jm=[{icon:sr,title:"Marketing Attribution",description:"Easily track and measure marketing impact",href:"/analytics"},{icon:cr,title:"Content Creators",description:"Intelligent audience insights and link tracking",href:"/solutions/creators"},{icon:Rt,title:"Affiliate Management",description:"Manage affiliates and automate payouts",href:"/partners"}];function Ni({domain:e}){return Nt("div",{className:"grid w-[1020px] grid-cols-[minmax(0,1fr),0.4fr] divide-x divide-neutral-200 dark:divide-white/20",children:[Nt("div",{className:"flex h-full flex-col p-4",children:[re("p",{className:i(at,"mb-4 ml-2"),children:"Use case"}),re("div",{className:"grid grow grid-cols-3 gap-4",children:jm.map(({icon:t,title:r,description:o,href:a})=>re(Um,{asChild:!0,children:Nt(Gm,{href:_(a,e,Ce({domain:e,utm_content:r})),className:i("group relative isolate z-0 flex flex-col justify-between overflow-hidden rounded-xl border border-neutral-100 bg-neutral-50 px-5 py-4 transition-colors duration-75","dark:border-white/20 dark:bg-neutral-900"),children:[Nt("div",{className:"absolute inset-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:[re("div",{className:"absolute -inset-[25%] -skew-y-12 [mask-image:linear-gradient(225deg,black,transparent_50%)]",children:re(Je,{cellSize:46,patternOffset:[0,-14],className:"translate-y-2 text-[#ad1f3288] transition-transform duration-150 ease-out group-hover:translate-y-0"})}),re("div",{className:i("absolute -inset-[10%] opacity-10 blur-[50px] dark:brightness-150","bg-[conic-gradient(#F35066_0deg,#F35066_117deg,#9071F9_180deg,#5182FC_240deg,#F35066_360deg)]")})]}),re(t,{className:"relative size-5 text-neutral-700 dark:text-white/60"}),Nt("div",{className:"relative",children:[re("span",{className:"text-sm font-medium text-neutral-900 dark:text-white",children:r}),re("p",{className:"mt-2 text-xs text-neutral-500 dark:text-white/60",children:o})]})]},r)},r))})]}),Nt("div",{className:"px-6 py-4",children:[re("p",{className:i(at,"mb-2"),children:"SDKs"}),re("div",{className:"flex flex-col gap-0.5",children:Vo.map(({icon:t,iconClassName:r,title:o,href:a})=>re(Ut,{className:"-mx-2",href:_(a,e,Ce({domain:e,utm_content:o})),icon:re("div",{className:"shrink-0 rounded-[10px] border border-neutral-200 bg-white/50 p-1 dark:border-white/20 dark:bg-white/10",children:re(t,{className:i("size-5 text-neutral-600 transition-colors dark:text-white/60",r)})}),title:o,showArrow:!0},a))})]})]})}import{Fragment as tu,jsx as B,jsxs as wt}from"react/jsx-runtime";var Ho=qm({theme:"light"}),_o=[{name:"Product",content:xi,childItems:Wr,segments:["/links","/analytics","/partners","/integrations","/compare","/features"]},{name:"Solutions",content:Ni,childItems:li,segments:["/solutions","/sdks"]},{name:"Resources",content:yi,childItems:Wt,segments:["/help","/docs","/about","/careers","/brand","/blog","/changelog","/contact"]},{name:"Enterprise",href:"/enterprise",segments:["/enterprise"]},{name:"Customers",href:"/customers",segments:["/customers"]},{name:"Pricing",href:"/pricing",segments:["/pricing"]}],wi=i("relative group/item flex items-center rounded-md px-4 py-2 text-sm rounded-lg font-medium text-neutral-700 hover:text-neutral-900 transition-colors","dark:text-white/90 dark:hover:text-white","hover:bg-neutral-900/5 dark:hover:bg-white/10","data-[active=true]:bg-neutral-900/5 dark:data-[active=true]:bg-white/10","group-has-[:hover]:data-[active=true]:[&:not(:hover)]:bg-transparent");function qN({theme:e="light",staticDomain:t,maxWidthWrapperClassName:r}){let{domain:o="dub.co"}=Ym();t&&(o=t);let a=Xm(),n=mn(40),c=Zm(),{data:s,isLoading:m}=Jm(o.endsWith("dub.co")&&"/api/auth/session",be,{dedupingInterval:6e4});return B(Ho.Provider,{value:{theme:e},children:B(Km,{id:a,children:wt("div",{className:i("sticky inset-x-0 top-0 z-30 w-full transition-all",e==="dark"&&"dark"),children:[B("div",{className:i("absolute inset-0 block border-b border-transparent transition-all",n&&"border-neutral-100 bg-white/75 backdrop-blur-lg dark:border-white/10 dark:bg-black/75")}),B(Br,{className:i("relative",r),children:wt("div",{className:"flex h-14 items-center justify-between",children:[B("div",{className:"grow basis-0",children:B(jt,{className:"block w-fit py-2 pr-2",href:_("/home",o,{utm_source:"Custom Domain",utm_medium:"Navbar",utm_campaign:o,utm_content:"Logo"}),children:B($r,{})})}),wt(ue.Root,{delayDuration:0,className:"relative hidden lg:block",children:[B(ue.List,{className:"group relative z-0 flex",children:_o.map(({name:d,href:l,segments:u,content:p})=>{let f=u.some(g=>c==null?void 0:c.startsWith(g));return wt(ue.Item,{children:[B(eu,{trigger:!!p,children:l!==void 0?B(jt,{id:`nav-${l}`,href:_(l,o,{utm_source:"Custom Domain",utm_medium:"Navbar",utm_campaign:o,utm_content:d}),className:wi,"data-active":f,children:d}):wt("button",{className:wi,"data-active":f,children:[d,B(Qm,{className:"ml-1.5 size-2.5 text-neutral-700"})]})}),p&&B(ue.Content,{className:"data-[motion=from-start]:animate-enter-from-left data-[motion=from-end]:animate-enter-from-right data-[motion=to-start]:animate-exit-to-left data-[motion=to-end]:animate-exit-to-right absolute left-0 top-0",children:B(p,{domain:o})})]},d)})}),B("div",{className:"absolute left-1/2 top-full mt-3 -translate-x-1/2",children:B(ue.Viewport,{className:i("relative flex origin-[top_center] justify-start overflow-hidden rounded-[20px] border border-neutral-200 bg-white shadow-md dark:border-white/[0.15] dark:bg-black","data-[state=closed]:animate-scale-out-content data-[state=open]:animate-scale-in-content","h-[var(--radix-navigation-menu-viewport-height)] w-[var(--radix-navigation-menu-viewport-width)] transition-[width,height]")})})]}),B("div",{className:"hidden grow basis-0 justify-end gap-2 lg:flex",children:s&&Object.keys(s).length>0?B(jt,{href:ke,className:i(se({variant:"primary"}),"flex h-8 items-center rounded-lg border px-4 text-sm","dark:border-white dark:bg-white dark:text-black dark:hover:bg-neutral-50 dark:hover:ring-white/10"),children:"Dashboard"}):m?null:wt(tu,{children:[B(jt,{href:"https://app.dub.co/login",className:i(se({variant:"secondary"}),"flex h-8 items-center rounded-lg border px-4 text-sm","dark:border-white/10 dark:bg-black dark:text-white dark:hover:bg-neutral-900"),children:"Log in"}),B(jt,{href:"https://app.dub.co/register",className:i(se({variant:"primary"}),"flex h-8 items-center rounded-lg border px-4 text-sm","dark:border-white dark:bg-white dark:text-black dark:hover:bg-neutral-50 dark:hover:ring-white/10"),children:"Sign up"})]})})]})})]})})})}function Qm(e){return B("svg",{xmlns:"http://www.w3.org/2000/svg",width:"9",height:"9",fill:"none",viewBox:"0 0 9 9",...e,children:B("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M7.278 3.389 4.5 6.167 1.722 3.389",className:"transition-transform duration-150 [transform-box:view-box] [transform-origin:center] [vector-effect:non-scaling-stroke] group-data-[state=open]/item:-scale-y-100"})})}function eu({trigger:e,children:t}){return e?B(ue.Trigger,{asChild:!0,children:t}):t}import{ChevronDown as ru,Menu as ou,X as au}from"lucide-react";import Ct from"next/link";import{useParams as Bo}from"next/navigation";import{useEffect as nu,useState as ki}from"react";import iu from"swr";import{Fragment as lu,jsx as D,jsxs as Ee}from"react/jsx-runtime";var Fo={"Dub Links":D("div",{className:"flex size-5 items-center justify-center rounded bg-orange-400",children:D(ct,{className:"size-3 text-orange-900"})}),"Dub Partners":D("div",{className:"flex size-5 items-center justify-center rounded bg-violet-400",children:D(dt,{className:"size-3 text-violet-900"})}),"Dub Analytics":D("div",{className:"flex size-5 items-center justify-center rounded bg-green-400",children:D(lt,{className:"size-3 text-green-900"})}),"Dub API":D("div",{className:"flex size-5 items-center justify-center rounded bg-neutral-400",children:D(er,{className:"size-3 text-neutral-900"})})};function mw({theme:e="light",staticDomain:t}){let{domain:r="dub.co"}=Bo();t&&(r=t);let[o,a]=ki(!1);nu(()=>{o?document.body.style.overflow="hidden":document.body.style.overflow="auto"},[o]);let{data:n,isLoading:c}=iu(r.endsWith("dub.co")&&"/api/auth/session",be,{dedupingInterval:6e4});return Ee("div",{className:i("fixed right-0 top-0 z-40 flex items-center gap-4 p-2.5 lg:hidden",e==="dark"&&"dark"),children:[n&&Object.keys(n).length>0?D(Wo,{href:ke,className:"max-[280px]:hidden",children:"Dashboard"}):c?null:Ee("div",{className:"flex gap-2 max-[280px]:hidden",children:[D(Wo,{variant:"secondary",href:`${ke}/login`,children:"Log in"}),D(Wo,{href:`${ke}/register`,children:"Sign Up"})]}),D("button",{onClick:()=>a(!o),className:i("z-30 rounded-full p-2 transition-colors duration-200 hover:bg-neutral-200 focus:outline-none active:bg-neutral-300 dark:hover:bg-white/20 dark:active:bg-white/30",o&&"hover:bg-neutral-100 active:bg-neutral-200"),children:o?D(au,{className:"h-5 w-5 text-neutral-600 dark:text-white/70"}):D(ou,{className:"h-5 w-5 text-neutral-600 dark:text-white/70"})}),D("nav",{className:i("fixed inset-0 z-20 hidden max-h-screen w-full overflow-y-auto bg-white px-5 py-16 lg:hidden dark:bg-black dark:text-white/70",o&&"block"),children:Ee("ul",{className:"grid divide-y divide-neutral-200 dark:divide-white/[0.15]",children:[_o.map(({name:s,href:m,childItems:d},l)=>D(su,{name:s,href:m,childItems:d,setOpen:a},l)),n&&Object.keys(n).length>0?D("li",{className:"py-3 min-[281px]:hidden",children:D(Ct,{href:ke,className:"flex w-full font-semibold capitalize",children:"Dashboard"})}):Ee(lu,{children:[D("li",{className:"py-3 min-[281px]:hidden",children:D(Ct,{href:`${ke}/login`,className:"flex w-full font-semibold capitalize",children:"Log in"})}),D("li",{className:"py-3 min-[281px]:hidden",children:D(Ct,{href:`${ke}/register`,className:"flex w-full font-semibold capitalize",children:"Sign Up"})})]})]})})]})}var su=({name:e,href:t,childItems:r,setOpen:o})=>{let{domain:a="dub.co"}=Bo(),[n,c]=ki(!1);return r?D("li",{className:"py-3",children:Ee(pe,{height:!0,children:[Ee("button",{className:"flex w-full justify-between",onClick:()=>c(!n),children:[D("p",{className:"font-semibold",children:e}),D(ru,{className:i("h-5 w-5 text-neutral-500 transition-all dark:text-white/50",n&&"rotate-180")})]}),n&&D("div",{className:"grid grid-cols-1 gap-4 overflow-hidden py-4",children:r.map((s,m)=>"items"in s?Ee("div",{className:"grid grid-cols-1 gap-3",children:[D("span",{className:"text-xs font-medium uppercase text-neutral-500 dark:text-white/50",children:s.label}),s.items.map((d,l)=>D(Ci,{item:d,setOpen:o,size:"small"},l))]},m):D(Ci,{item:s,setOpen:o},m))})]})}):t?D("li",{className:"py-3",children:D(Ct,{href:_(t,a,{utm_source:"Custom Domain",utm_medium:"Navbar",utm_campaign:a,utm_content:e}),onClick:()=>o(!1),className:"flex w-full font-semibold capitalize",children:e})}):null},Ci=({item:{title:e,description:t,href:r,icon:o},setOpen:a,size:n="normal"})=>{let{domain:c="dub.co"}=Bo(),s=Fo==null?void 0:Fo[e];return Ee(Ct,{href:_(r,c,{utm_source:"Custom Domain",utm_medium:"Navbar",utm_campaign:c,utm_content:e}),onClick:()=>a(!1),className:"flex w-full items-center gap-3",children:[D("div",{className:i("flex size-10 items-center justify-center rounded-lg border border-neutral-200 bg-gradient-to-t from-neutral-100",n==="small"&&"size-8"),children:s??D(o,{className:i("size-5 text-neutral-700 grayscale",n==="small"&&"size-4")})}),Ee("div",{children:[D("div",{className:"flex items-center gap-2",children:D("h2",{className:"text-sm font-medium text-neutral-900",children:e})}),t&&D("p",{className:"text-sm text-neutral-500",children:t})]})]})};function Wo({variant:e,className:t,...r}){return D(Ct,{...r,className:i("flex h-8 w-fit items-center whitespace-nowrap rounded-lg border px-3 text-[0.8125rem]",se({variant:e}),t)})}import{jsx as Pi}from"react/jsx-runtime";function Si({className:e}){return Pi("svg",{width:"46",height:"24",viewBox:"0 0 46 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i("h-6 w-auto text-black dark:text-white",e),children:Pi("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H14V13.9332L14.0003 13.9731L14.0003 14C14.0003 14.0223 14.0002 14.0445 14 14.0668V21H11V19.7455C9.86619 20.5362 8.48733 21 7.00016 21C3.13408 21 0 17.866 0 14C0 10.134 3.13408 7 7.00016 7C8.48733 7 9.86619 7.46375 11 8.25452V2ZM7 17.9998C9.20914 17.9998 11 16.209 11 13.9999C11 11.7908 9.20914 10 7 10C4.79086 10 3 11.7908 3 13.9999C3 16.209 4.79086 17.9998 7 17.9998ZM32 2H35V8.25474C36.1339 7.46383 37.5128 7 39.0002 7C42.8662 7 46.0003 10.134 46.0003 14C46.0003 17.866 42.8662 21 39.0002 21C35.1341 21 32 17.866 32 14V2ZM39 17.9998C41.2091 17.9998 43 16.209 43 13.9999C43 11.7908 41.2091 10 39 10C36.7909 10 35 11.7908 35 13.9999C35 16.209 36.7909 17.9998 39 17.9998ZM19 7H16V14C16 14.9192 16.1811 15.8295 16.5329 16.6788C16.8846 17.5281 17.4003 18.2997 18.0503 18.9497C18.7003 19.5997 19.472 20.1154 20.3213 20.4671C21.1706 20.8189 22.0809 21 23.0002 21C23.9194 21 24.8297 20.8189 25.679 20.4671C26.5283 20.1154 27.3 19.5997 27.95 18.9497C28.6 18.2997 29.1157 17.5281 29.4675 16.6788C29.8192 15.8295 30.0003 14.9192 30.0003 14H30V7H27V14C27 15.0608 26.5785 16.0782 25.8284 16.8283C25.0783 17.5784 24.0609 17.9998 23 17.9998C21.9391 17.9998 20.9217 17.5784 20.1716 16.8283C19.4215 16.0782 19 15.0608 19 14V7Z",fill:"currentColor"})})}import{jsx as q,jsxs as Ri}from"react/jsx-runtime";var vu=`<svg width="65" height="64" viewBox="0 0 65 64" fill="none" xmlns="http://www.w3.org/2000/svg">
50
50
  <path fill-rule="evenodd" clip-rule="evenodd" d="M32.5 64C50.1731 64 64.5 49.6731 64.5 32C64.5 20.1555 58.0648 9.81393 48.5 4.28099V31.9999V47.9998H40.5V45.8594C38.1466 47.2207 35.4143 47.9999 32.5 47.9999C23.6634 47.9999 16.5 40.8364 16.5 31.9999C16.5 23.1633 23.6634 15.9999 32.5 15.9999C35.4143 15.9999 38.1466 16.779 40.5 18.1404V1.00812C37.943 0.350018 35.2624 0 32.5 0C14.8269 0 0.500038 14.3269 0.500038 32C0.500038 49.6731 14.8269 64 32.5 64Z" fill="black"/>
51
51
  </svg>`,xu=`<svg width="46" height="24" viewBox="0 0 46 24" fill="none" xmlns="http://www.w3.org/2000/svg">
52
52
  <path fill-rule="evenodd" clip-rule="evenodd" d="M11 2H14V13.9332L14.0003 13.9731L14.0003 14C14.0003 14.0223 14.0002 14.0445 14 14.0668V21H11V19.7455C9.86619 20.5362 8.48733 21 7.00016 21C3.13408 21 0 17.866 0 14C0 10.134 3.13408 7 7.00016 7C8.48733 7 9.86619 7.46375 11 8.25452V2ZM7 17.9998C9.20914 17.9998 11 16.209 11 13.9999C11 11.7908 9.20914 10 7 10C4.79086 10 3 11.7908 3 13.9999C3 16.209 4.79086 17.9998 7 17.9998ZM32 2H35V8.25474C36.1339 7.46383 37.5128 7 39.0002 7C42.8662 7 46.0003 10.134 46.0003 14C46.0003 17.866 42.8662 21 39.0002 21C35.1341 21 32 17.866 32 14V2ZM39 17.9998C41.2091 17.9998 43 16.209 43 13.9999C43 11.7908 41.2091 10 39 10C36.7909 10 35 11.7908 35 13.9999C35 16.209 36.7909 17.9998 39 17.9998ZM19 7H16V14C16 14.9192 16.1811 15.8295 16.5329 16.6788C16.8846 17.5281 17.4003 18.2997 18.0503 18.9497C18.7003 19.5997 19.472 20.1154 20.3213 20.4671C21.1706 20.8189 22.0809 21 23.0002 21C23.9194 21 24.8297 20.8189 25.679 20.4671C26.5283 20.1154 27.3 19.5997 27.95 18.9497C28.6 18.2997 29.1157 17.5281 29.4675 16.6788C29.8192 15.8295 30.0003 14.9192 30.0003 14H30V7H27V14C27 15.0608 26.5785 16.0782 25.8284 16.8283C25.0783 17.5784 24.0609 17.9998 23 17.9998C21.9391 17.9998 20.9217 17.5784 20.1716 16.8283C19.4215 16.0782 19 15.0608 19 14V7Z" fill="black"/>