@dub/ui 0.2.68 → 0.3.1

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.
Files changed (113) hide show
  1. package/dist/charts/index.mjs +1 -1
  2. package/dist/chunk-27KBIUXQ.mjs +2 -0
  3. package/dist/chunk-2APFEFAQ.mjs +6 -0
  4. package/dist/chunk-2OLKG5VD.mjs +2 -0
  5. package/dist/chunk-2RTNOM7D.mjs +2 -0
  6. package/dist/chunk-2W6D4KFZ.mjs +6 -0
  7. package/dist/chunk-2ZKUQRT2.mjs +6 -0
  8. package/dist/chunk-3EJ3KJXV.mjs +2 -0
  9. package/dist/chunk-3FNFJD3D.mjs +6 -0
  10. package/dist/chunk-4GUW235P.mjs +6 -0
  11. package/dist/chunk-4MZXX7Q4.mjs +6 -0
  12. package/dist/chunk-4V6O5DP3.mjs +6 -0
  13. package/dist/chunk-4XV3XPU6.mjs +2 -0
  14. package/dist/chunk-5BO6ORUB.mjs +6 -0
  15. package/dist/chunk-5BPHS3IP.mjs +2 -0
  16. package/dist/chunk-5FR5TVE6.mjs +6 -0
  17. package/dist/chunk-6B2LOFMR.mjs +2 -0
  18. package/dist/chunk-6HGQA5C2.mjs +2 -0
  19. package/dist/chunk-6PXKSHG4.mjs +6 -0
  20. package/dist/chunk-6VPQEKGX.mjs +2 -0
  21. package/dist/chunk-746QNBBF.mjs +6 -0
  22. package/dist/chunk-7GDJPUUC.mjs +6 -0
  23. package/dist/chunk-7HRXNCEW.mjs +6 -0
  24. package/dist/chunk-7IX4YIZG.mjs +6 -0
  25. package/dist/chunk-7K6LFUTC.mjs +6 -0
  26. package/dist/chunk-AR5EQG6S.mjs +6 -0
  27. package/dist/chunk-AYW3HJXX.mjs +2 -0
  28. package/dist/chunk-B4JAPMF7.mjs +2 -0
  29. package/dist/chunk-BMAJZ2WA.mjs +2 -0
  30. package/dist/chunk-BO3GYFXE.mjs +2 -0
  31. package/dist/chunk-CI55POCL.mjs +2 -0
  32. package/dist/chunk-CYQQWKYO.mjs +2 -0
  33. package/dist/chunk-D2X3C7SN.mjs +2 -0
  34. package/dist/chunk-DBT3MUHQ.mjs +6 -0
  35. package/dist/chunk-DERIUHV5.mjs +6 -0
  36. package/dist/chunk-DLRHWE2P.mjs +2 -0
  37. package/dist/chunk-DZ4HSBSZ.mjs +6 -0
  38. package/dist/chunk-E4HWUKXO.mjs +6 -0
  39. package/dist/chunk-F3PZF25V.mjs +2 -0
  40. package/dist/chunk-F7TG5QIV.mjs +2 -0
  41. package/dist/chunk-F7TP4G6Z.mjs +2 -0
  42. package/dist/chunk-FB2K5AFM.mjs +2 -0
  43. package/dist/chunk-FEGYN2RG.mjs +6 -0
  44. package/dist/chunk-FNPKHQVW.mjs +2 -0
  45. package/dist/chunk-GVSY4EEU.mjs +2 -0
  46. package/dist/chunk-H74HRWYP.mjs +2 -0
  47. package/dist/chunk-HE7D3ZSP.mjs +2 -0
  48. package/dist/chunk-HRJQGYAW.mjs +2 -0
  49. package/dist/chunk-IP3TRQVC.mjs +6 -0
  50. package/dist/chunk-J54HXJEM.mjs +2 -0
  51. package/dist/chunk-J6FZHCQU.mjs +2 -0
  52. package/dist/chunk-JN5YXRC7.mjs +2 -0
  53. package/dist/chunk-JNGL4IFE.mjs +2 -0
  54. package/dist/chunk-JOLCDANY.mjs +2 -0
  55. package/dist/chunk-JPJFKIER.mjs +6 -0
  56. package/dist/chunk-K5RWTWZX.mjs +6 -0
  57. package/dist/chunk-KJPINAI2.mjs +2 -0
  58. package/dist/chunk-KONKTXXG.mjs +6 -0
  59. package/dist/chunk-LW3IGZLZ.mjs +2 -0
  60. package/dist/chunk-M5MUPZEN.mjs +2 -0
  61. package/dist/chunk-P2IJR7OL.mjs +6 -0
  62. package/dist/chunk-PDTM75SS.mjs +2 -0
  63. package/dist/chunk-PJYVB2JH.mjs +2 -0
  64. package/dist/chunk-PMLAVU2X.mjs +6 -0
  65. package/dist/chunk-PW5W5G2F.mjs +2 -0
  66. package/dist/chunk-Q7TE7VVT.mjs +2 -0
  67. package/dist/chunk-QGKU72XQ.mjs +6 -0
  68. package/dist/chunk-QIA3GT5T.mjs +2 -0
  69. package/dist/chunk-RHFLXCDH.mjs +2 -0
  70. package/dist/chunk-RLXZTKXL.mjs +2 -0
  71. package/dist/chunk-RNZZ7TGZ.mjs +2 -0
  72. package/dist/chunk-RRUIYW2P.mjs +6 -0
  73. package/dist/chunk-RSC43RXH.mjs +2 -0
  74. package/dist/chunk-S6UCRI4B.mjs +2 -0
  75. package/dist/chunk-SH6LFBJC.mjs +2 -0
  76. package/dist/chunk-SHSVHA4U.mjs +2 -0
  77. package/dist/chunk-SJX23PQU.mjs +2 -0
  78. package/dist/chunk-T4JODWAP.mjs +6 -0
  79. package/dist/chunk-T5I7NTHS.mjs +6 -0
  80. package/dist/chunk-T7Y6MARI.mjs +2 -0
  81. package/dist/chunk-TF7D7ANO.mjs +2 -0
  82. package/dist/chunk-TKHNB2F3.mjs +2 -0
  83. package/dist/chunk-TKM2MHOO.mjs +6 -0
  84. package/dist/chunk-U53H44XX.mjs +6 -0
  85. package/dist/chunk-UAQ2HLPX.mjs +2 -0
  86. package/dist/chunk-UDPZCIHW.mjs +2 -0
  87. package/dist/chunk-UXLTIKME.mjs +2 -0
  88. package/dist/chunk-V2KYE7EE.mjs +2 -0
  89. package/dist/chunk-VMYCUV2C.mjs +2 -0
  90. package/dist/chunk-VNO6TU52.mjs +2 -0
  91. package/dist/chunk-W3YBFHMA.mjs +6 -0
  92. package/dist/chunk-W5OLICQC.mjs +2 -0
  93. package/dist/chunk-WE2RCEPL.mjs +2 -0
  94. package/dist/chunk-WHHNTDMN.mjs +6 -0
  95. package/dist/chunk-WHTIHVJH.mjs +6 -0
  96. package/dist/chunk-WKH67IZC.mjs +2 -0
  97. package/dist/chunk-WNY3VD7Q.mjs +2 -0
  98. package/dist/chunk-X6IUUCWJ.mjs +2 -0
  99. package/dist/chunk-X7SGDEJI.mjs +2 -0
  100. package/dist/chunk-XPQ5USEX.mjs +2 -0
  101. package/dist/chunk-XYGQKVYJ.mjs +6 -0
  102. package/dist/chunk-YKK6HWJP.mjs +2 -0
  103. package/dist/chunk-ZESUMHML.mjs +6 -0
  104. package/dist/chunk-ZJ4SRHCP.mjs +6 -0
  105. package/dist/chunk-ZJKQCWHI.mjs +2 -0
  106. package/dist/chunk-ZNXASZTY.mjs +6 -0
  107. package/dist/chunk-ZQSYRTLP.mjs +6 -0
  108. package/dist/icons/index.d.ts +31 -1
  109. package/dist/icons/index.mjs +1 -1
  110. package/dist/index.css +1 -1
  111. package/dist/index.d.ts +139 -41
  112. package/dist/index.mjs +27 -6
  113. package/package.json +15 -14
package/dist/index.mjs CHANGED
@@ -1,12 +1,33 @@
1
1
  "use client"
2
- import{$ as Rf,$a as x0,$b as ig,$c as jg,$d as Fb,A as cf,Aa as Qf,Ab as _0,Ac as Ga,Ad as hb,Ae as ch,B as df,Ba as nr,Bb as F0,Bc as Lg,Bd as en,Be as dh,C as rr,Ca as e0,Cb as B0,Cc as Ka,Cd as vb,Ce as mh,D as mf,Da as t0,Db as W0,Dc as Mg,Dd as xb,De as uh,E as uf,Ea as r0,Eb as U0,Ec as Eg,Ed as yb,Ee as ph,F as pf,Fa as o0,Fb as $0,Fc as Dg,Fd as Nb,Fe as fh,G as ff,Ga as Pa,Gb as za,Gc as Ag,Gd as wb,Ge as gh,H as gf,Ha as a0,Hb as G0,Hc as Ig,Hd as kb,He as bh,I as or,Ia as n0,Ib as K0,Ic as ja,Id as Cb,Ie as hh,J as bf,Ja as Sa,Jb as j0,Jc as Ya,Jd as Pb,Je as vh,K as ar,Ka as i0,Kb as sr,Kc as Og,Kd as pt,Ke as Tt,L as hf,La as s0,Lb as Y0,Lc as zg,Ld as Sb,Le as xh,M as vf,Ma as l0,Mb as Z0,Mc as Vg,Md as Tb,Me as yh,N as xf,Na as c0,Nb as q0,Nc as Hg,Nd as Rb,Ne as Nh,O as yf,Oa as d0,Ob as X0,Oc as _g,Od as Lb,Oe as wh,P as Nf,Pa as m0,Pb as J0,Pc as Za,Pd as Mb,Pe as ln,Q as wf,Qa as u0,Qb as Va,Qc as Fg,Qd as tn,Qe as kh,R as kf,Ra as p0,Rb as Q0,Rc as qa,Rd as Eb,Re as Ch,S as va,Sa as f0,Sb as eg,Sc as Xa,Sd as Db,Se as Ph,T as xa,Ta as g0,Tb as tg,Tc as Bg,Td as rn,Te as Sh,U as ya,Ua as Ta,Ub as rg,Uc as Wg,Ud as Ab,Ue as Th,V as Na,Va as ir,Vb as og,Vc as Ug,Vd as Ib,Ve as Rh,W as wa,Wa as Ra,Wb as ag,Wc as Ja,Wd as Ob,We as Lh,X as Cf,Xa as La,Xb as Ha,Xc as Qa,Xd as zb,Xe as Mh,Y as Pf,Ya as b0,Yb as ng,Yc as $g,Yd as Vb,Z as Sf,Za as h0,Zb as _a,Zc as Gg,Zd as Hb,_ as Tf,_a as v0,_b as Fa,_c as Kg,_d as _b,a as Xp,aa as Lf,ab as Ma,ac as Ba,ad as Yg,ae as Bb,b as ma,ba as Mf,bb as Ea,bc as sg,bd as lr,be as Wb,c as Jp,ca as Ef,cb as y0,cc as lg,cd as Zg,ce as Ub,d as dt,da as Df,db as N0,dc as cg,dd as qg,de as $b,e as er,ea as Af,eb as w0,ec as dg,ed as Xg,ee as Gb,f as Qp,fa as If,fb as Da,fc as mg,fd as Jg,fe as Kb,g as mt,ga as Of,gb as Aa,gc as ug,gd as Qg,ge as jb,h as ut,ha as zf,hb as Ia,hc as pg,hd as eb,he as Yb,i as Zr,ia as Vf,ib as k0,ic as Wa,id as tb,ie as Zb,j as ua,ja as Hf,jb as C0,jc as fg,jd as rb,je as qb,k as ef,ka as _f,kb as P0,kc as gg,kd as ob,ke as Xb,l as tf,la as Ff,lb as S0,lc as bg,ld as ab,le as Jb,m as pa,ma as Bf,mb as T0,mc as hg,md as nb,me as Qb,n as rf,na as Wf,nb as qr,nc as vg,nd as ib,ne as eh,o as of,oa as Uf,ob as R0,oc as xg,od as sb,oe as th,p as fa,pa as ka,pb as L0,pc as yg,pd as lb,pe as rh,q as ga,qa as $f,qb as M0,qc as Ng,qd as cr,qe as on,r as ba,ra as Gf,rb as E0,rc as wg,rd as dr,re as an,s as ha,sa as Ca,sb as Oa,sc as kg,sd as cb,se as nn,t as St,ta as Kf,tb as D0,tc as Ua,td as db,te as sn,u as af,ua as jf,ub as A0,uc as Cg,ud as mb,ue as oh,v as ue,va as Yf,vb as I0,vc as Pg,vd as ub,ve as ah,w as nf,wa as Zf,wb as O0,wc as Sg,wd as pb,we as nh,x as sf,xa as qf,xb as z0,xc as $a,xd as fb,xe as ih,y as lf,ya as Xf,yb as V0,yc as Tg,yd as gb,ye as sh,z as tr,za as Jf,zb as H0,zc as Rg,zd as bb,ze as lh}from"./chunk-QIO44XG4.mjs";import{a as Q}from"./chunk-NWME2ANF.mjs";import{a as ea,b as F,c as ta,d as ra,e as Ce,f as oa,g as aa,h as na,i as ia,j as sa,k as Pt,l as la,m as jr,n as ca,o as ct,p as da,q as be,r as Ge,s as i,u as Yr,v as Qt}from"./chunk-CP3HS3MG.mjs";import*as ne from"@radix-ui/react-accordion";import{ChevronDown as ps}from"lucide-react";import*as ur from"react";import{jsx as mr,jsxs as hs}from"react/jsx-runtime";var zh=ne.Root,fs=ur.forwardRef(({className:e,...t},r)=>mr(ne.Item,{ref:r,className:i("border-b border-b-slate-200 py-3 last:border-none",e),...t}));fs.displayName="AccordionItem";var gs=ur.forwardRef(({className:e,children:t,variant:r="chevron",...o},a)=>{let n=r==="chevron"?ps:pt;return mr(ne.Header,{className:"flex",children:hs(ne.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"})]})})});gs.displayName=ne.Trigger.displayName;var bs=ur.forwardRef(({className:e,children:t,...r},o)=>mr(ne.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}));bs.displayName=ne.Content.displayName;import{cva as vs}from"class-variance-authority";import*as pr from"react";import{jsx as Xr}from"react/jsx-runtime";var xs=vs("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"}}),ys=pr.forwardRef(({className:e,variant:t,...r},o)=>Xr("div",{ref:o,role:"alert",className:i(xs({variant:t}),e),...r}));ys.displayName="Alert";var Ns=pr.forwardRef(({className:e,...t},r)=>Xr("h5",{ref:r,className:i("text-md mb-2 font-medium leading-none tracking-tight",e),...t}));Ns.displayName="AlertTitle";var ws=pr.forwardRef(({className:e,...t},r)=>Xr("div",{ref:r,className:i("text-sm [&_p]:leading-relaxed",e),...t}));ws.displayName="AlertDescription";import{sha256 as ks}from"js-sha256";import{useState as Cs}from"react";import{jsx as Jr}from"react/jsx-runtime";function Ps(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/${ks(e.email)}?d=${t}`:t}function $h({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]=Cs(Ps(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 Gh({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 Ss}from"class-variance-authority";import{jsx as Rs}from"react/jsx-runtime";var Ts=Ss("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 cn({className:e,variant:t,...r}){return Rs("span",{className:i(Ts({variant:t}),e),...r})}import{cva as gl}from"class-variance-authority";import{forwardRef as bl}from"react";import*as he from"@radix-ui/react-tooltip";import{HelpCircle as dl}from"lucide-react";import ml from"next/link";import{useEffect as ul,useRef as pl,useState as ro}from"react";import fl from"react-markdown";import{useCallback as Es,useEffect as Ds,useState as As}from"react";import{useEffect as Ls,useState as Ms}from"react";function fr(e){let[t,r]=Ms(),o=([a])=>{r(a)};return Ls(()=>{let a=e==null?void 0:e.current;if(!a)return;let n=new ResizeObserver(o);return n.observe(a),()=>n.disconnect()},[e]),t}function Ee(e,{direction:t="vertical"}={}){let[r,o]=As(1),a=Es(()=>{if(!e.current)return;let c=t==="vertical"?e.current.scrollTop:e.current.scrollLeft,d=t==="vertical"?e.current.scrollHeight:e.current.scrollWidth,m=t==="vertical"?e.current.clientHeight:e.current.clientWidth;o(d===m?1:Math.min(c/(d-m),1))},[t]),n=fr(e);return Ds(a,[n]),{scrollProgress:r,updateScrollProgress:a}}import{EditorContent as ll}from"@tiptap/react";import $s from"@tiptap/extension-file-handler";import Gs from"@tiptap/extension-image";import Ks from"@tiptap/extension-mention";import{Placeholder as js}from"@tiptap/extensions";import{Markdown as Ys}from"@tiptap/markdown";import{useEditor as Zs}from"@tiptap/react";import qs from"@tiptap/starter-kit";import{createContext as Xs,forwardRef as Js,useContext as Qs,useImperativeHandle as el,useMemo as tl,useState as rl}from"react";import{computePosition as Is,flip as Os,shift as zs}from"@floating-ui/dom";import{posToDOMRect as Vs,ReactRenderer as Hs}from"@tiptap/react";import{forwardRef as _s,useEffect as Fs,useImperativeHandle as Bs,useState as Ws}from"react";import{jsx as Qr}from"react/jsx-runtime";var dn=(e,t)=>{Is({getBoundingClientRect:()=>Vs(e.view,e.state.selection.from,e.state.selection.to)},t,{placement:"bottom-start",strategy:"absolute",middleware:[zs(),Os()]}).then(({x:o,y:a,strategy:n})=>{t.style.width="max-content",t.style.position=n,t.style.left=`${o}px`,t.style.top=`${a}px`})},un=e=>({items:({query:t})=>e.filter(r=>r.toLowerCase().startsWith(t.toLowerCase())).slice(0,5),render:()=>{let t;return{onStart:r=>{t=new Hs(Us,{props:r,editor:r.editor}),r.clientRect&&(t.element.style.position="absolute",document.body.appendChild(t.element),dn(r.editor,t.element))},onUpdate(r){t.updateProps(r),r.clientRect&&dn(r.editor,t.element)},onKeyDown(r){var o;return r.event.key==="Escape"?(t.destroy(),!0):(o=t.ref)==null?void 0:o.onKeyDown(r)},onExit(){t.element.remove(),t.destroy()}}}}),mn=i("flex cursor-pointer select-none items-center gap-2 whitespace-nowrap rounded-md px-2 py-1 font-mono text-sm text-neutral-950","data-[selected=true]:bg-neutral-100"),Us=_s(({items:e,command:t},r)=>{let[o,a]=Ws(0),n=()=>{a((o+e.length-1)%e.length)},c=()=>{a((o+1)%e.length)},d=()=>{t({id:e[o]})};return Fs(()=>a(0),[e]),Bs(r,()=>({onKeyDown:({event:m})=>m.key==="ArrowUp"?(n(),!0):m.key==="ArrowDown"?(c(),!0):m.key==="Enter"?(d(),!0):!1})),Qr("div",{className:"border-border-subtle flex flex-col rounded-lg border bg-white p-1 shadow-sm",children:e.length?e.map((m,s)=>Qr("button",{type:"button",onClick:()=>t({id:m}),"data-selected":o===s,onPointerEnter:()=>a(s),className:mn,children:m},s)):Qr("div",{className:i(mn,"text-content-subtle font-sans"),children:"No results"})})});import{jsx as al}from"react/jsx-runtime";var eo={default:"prose-p:my-2 prose-ul:my-2 prose-ol:my-2",condensed:"prose-p:my-0 prose-ul:my-2 prose-ol:my-2",relaxed:""},ol=["images","variables","links","headings","bold","italic"],pn=Xs(null),N1=Js(({children:e,features:t=ol,markdown:r=!1,style:o="default",placeholder:a="Start typing...",uploadImage:n,editable:c,autoFocus:d,variables:m,initialValue:s,onChange:l,editorProps:u,editorClassName:p},f)=>{let[b,g]=rl(!1),h=tl(()=>n?async(x,y,C)=>{g(!0);let w=await(n==null?void 0:n(x));if(!w){g(!1);return}y.chain().insertContentAt(C,{type:"image",attrs:{src:w}}).focus().run(),g(!1)}:null,[n]),N=Zs({editable:c??!0,autofocus:d?"end":!1,extensions:[...r?[Ys]:[],qs.configure({heading:t.includes("headings")?{levels:[1,2]}:!1,bold:t.includes("bold")?void 0:!1,italic:t.includes("italic")?void 0:!1,link:t.includes("links")?void 0:!1}),js.configure({placeholder:a,emptyEditorClass:"before:content-[attr(data-placeholder)] before:float-left before:text-content-muted before:h-0 before:pointer-events-none"}),...t.includes("images")&&h?[Gs.configure({inline:!1,HTMLAttributes:{class:"rounded-lg max-w-full h-auto"}}),$s.configure({allowedMimeTypes:["image/png","image/jpeg","image/gif","image/webp"],onDrop:(x,y,C)=>{y.forEach(w=>h(w,x,C))},onPaste:(x,y,C)=>{if(C)return!1;y.forEach(w=>h(w,x,x.state.selection.anchor))}})]:[],...t.includes("variables")&&m?[Ks.extend({renderHTML({node:x}){return["span",{class:"px-1 py-0.5 bg-blue-100 text-blue-700 rounded font-semibold","data-type":"mention","data-id":x.attrs.id},`{{${x.attrs.id}}}`]},renderText({node:x}){return`{{${x.attrs.id}}}`}}).configure({suggestion:un(m)})]:[]],editorProps:{attributes:{...u==null?void 0:u.attributes,class:i("max-w-none focus:outline-none","prose prose-sm prose-neutral",eo[o],"[&_.ProseMirror-selectednode]:outline [&_.ProseMirror-selectednode]:outline-2 [&_.ProseMirror-selectednode]:outline-blue-500 [&_.ProseMirror-selectednode]:outline-offset-2",p)},...u},content:s,contentType:r?"markdown":void 0,onUpdate:({editor:x})=>l==null?void 0:l(x),immediatelyRender:!1});return el(f,()=>({setContent:x=>{N==null||N.commands.setContent(x)}})),al(pn.Provider,{value:{features:t,markdown:r,editable:c,variables:m,editor:N,isUploading:b,handleImageUpload:h},children:e})});function Rt(){let e=Qs(pn);if(!e)throw new Error("useRichTextContext must be used within a RichTextProvider");return e}import{useEditorState as gn}from"@tiptap/react";import{forwardRef as nl,useRef as il}from"react";import{Fragment as fn,jsx as pe,jsxs as gr}from"react/jsx-runtime";function M1({toolsStart:e,toolsEnd:t,className:r}){let{editor:o,features:a,handleImageUpload:n,isUploading:c}=Rt(),d=gn({editor:o,selector:({editor:s})=>({isBold:Boolean(s==null?void 0:s.isActive("bold")),isItalic:Boolean(s==null?void 0:s.isActive("italic")),isHeading1:Boolean(s==null?void 0:s.isActive("heading",{level:1})),isHeading2:Boolean(s==null?void 0:s.isActive("heading",{level:2})),isSelection:(s==null?void 0:s.state.selection.from)!==(s==null?void 0:s.state.selection.to)})}),m=il(null);return gr("div",{className:i("flex gap-1",c&&"pointer-events-none opacity-50",r),children:[e,(a==null?void 0:a.includes("bold"))&&pe(Ke,{icon:on,label:"Bold",isActive:d==null?void 0:d.isBold,onClick:()=>o==null?void 0:o.chain().focus().toggleBold().run()}),(a==null?void 0:a.includes("italic"))&&pe(Ke,{icon:an,label:"Italic",isActive:d==null?void 0:d.isItalic,onClick:()=>o==null?void 0:o.chain().focus().toggleItalic().run()}),(a==null?void 0:a.includes("headings"))&&gr(fn,{children:[pe(Ke,{icon:ja,label:"Heading 1",isActive:d==null?void 0:d.isHeading1,onClick:()=>o==null?void 0:o.chain().focus().toggleHeading({level:1}).run()}),pe(Ke,{icon:Ya,label:"Heading 2",isActive:d==null?void 0:d.isHeading2,onClick:()=>o==null?void 0:o.chain().focus().toggleHeading({level:2}).run()})]}),(a==null?void 0:a.includes("links"))&&pe(sl,{}),(a==null?void 0:a.includes("variables"))&&pe(Ke,{icon:Ca,label:"Variable",isActive:!1,onClick:()=>{var s,l;if((l=(s=o==null?void 0:o.state.selection.$from.nodeBefore)==null?void 0:s.text)!=null&&l.endsWith("@")){o==null||o.commands.focus();return}o==null||o.chain().focus().insertContent("@").run()}}),(a==null?void 0:a.includes("images"))&&n&&o&&gr(fn,{children:[pe("input",{ref:m,type:"file",className:"hidden",onChange:s=>{var u;let l=(u=s.target.files)==null?void 0:u[0];!l||(n(l,o,o.state.selection.anchor),s.target.value="")}}),pe(Ke,{icon:qa,label:"Image",isActive:!1,onClick:()=>{var s;return(s=m.current)==null?void 0:s.click()}})]}),t]})}function sl(){let{editor:e}=Rt(),t=gn({editor:e,selector:({editor:r})=>({isSelection:(r==null?void 0:r.state.selection.from)!==(r==null?void 0:r.state.selection.to)})});return pe(Ke,{icon:Za,label:"Link",onClick:()=>{if(!e)return;let r=e.getAttributes("link").href,o=window.prompt("Link URL",r);if(!(o!=null&&o.trim())){e.chain().focus().extendMarkRange("link").unsetLink().run();return}e.chain().focus().extendMarkRange("link").setLink({href:o}).run()},disabled:!(t!=null&&t.isSelection)})}var Ke=nl(({icon:e,label:t,isActive:r,onClick:o,disabled:a},n)=>gr("button",{ref:n,type:"button",onClick:o,disabled:a,className:i("flex size-8 items-center justify-center rounded-md transition-colors duration-150 disabled:opacity-50",r?"bg-neutral-200":"hover:bg-neutral-50 active:bg-neutral-100"),title:t,children:[pe(e,{className:"size-4 shrink-0 text-neutral-700"}),t&&pe("span",{className:"sr-only",children:t})]}));import{jsx as to,jsxs as cl}from"react/jsx-runtime";function V1({className:e,...t}){let{editor:r,isUploading:o}=Rt();return cl("div",{className:i("relative",o&&"pointer-events-none opacity-50",e),children:[to(ll,{editor:r,...t}),o&&to("div",{className:"absolute inset-0 flex items-center justify-center",children:to(ue,{className:"size-4"})})]})}import{jsx as W,jsxs as oo}from"react/jsx-runtime";function J1({children:e}){return W(he.Provider,{delayDuration:150,children:e})}var bn=({className:e,children:t})=>W(fl,{className:i("prose prose-sm prose-neutral max-w-xs text-pretty px-4 py-2 text-center leading-snug transition-all","prose-a:cursor-alias prose-a:underline prose-a:decoration-dotted prose-a:underline-offset-2","prose-code:inline-block prose-code:leading-none",eo.condensed,e),components:{a:({node:r,...o})=>W("a",{...o,target:"_blank",rel:"noopener noreferrer",onClick:a=>a.stopPropagation()}),code:({node:r,...o})=>W("code",{...o,className:"rounded-md bg-neutral-100 px-1 py-0.5"})},children:t});function Z({children:e,content:t,contentClassName:r,disabled:o,side:a="top",disableHoverableContent:n,delayDuration:c=0,...d}){let[m,s]=ro(!1);return oo(he.Root,{open:o?!1:m,onOpenChange:s,delayDuration:c,disableHoverableContent:n,children:[W(he.Trigger,{asChild:!0,onClick:()=>{s(!0)},onBlur:()=>{s(!1)},children:e}),W(he.Portal,{children:W(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,...d,children:typeof t=="string"?W(bn,{className:r,children:t}):typeof t=="function"?t({setOpen:s}):t})})]})}function Q1({title:e,cta:t,href:r,target:o,onClick:a}){return oo("div",{className:"flex max-w-xs flex-col items-center space-y-3 p-4 text-center",children:[W(bn,{className:"p-0",children:e}),t&&(r?W(ml,{href:r,...o?{target:o}:{},className:i(ie({variant:"primary"}),"flex h-8 w-full items-center justify-center whitespace-nowrap rounded-lg border px-4 text-sm"),children:t}):a?W(ee,{onClick:a,text:t,variant:"primary",className:"h-8"}):null)]})}function ev(e){return W(Z,{...e,children:W(dl,{className:"h-4 w-4 text-neutral-500"})})}function tv({children:e,content:t,...r}){return W(Z,{content:t,...r,children:W("div",{className:"flex cursor-pointer items-center",children:W(cn,{variant:"gray",className:"border-neutral-300 transition-all hover:bg-neutral-200",children:e})})})}function rv({children:e,tooltipProps:t,...r}){return W(Z,{...t,children:W("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 ft({children:e,tooltipProps:t}){return t?W(Z,{...t,children:W("div",{children:e})}):e}function ov({children:e,maxHeight:t="240px",className:r}){let o=pl(null),{scrollProgress:a,updateScrollProgress:n}=Ee(o,{direction:"vertical"}),[c,d]=ro(!1),[m,s]=ro(!1);return ul(()=>{let l=o.current;if(!l)return;let{scrollHeight:u,clientHeight:p}=l,f=u>p;d(f&&a>0),s(f&&a<1)},[a]),oo("div",{className:"relative",children:[c&&W("div",{className:"pointer-events-none absolute left-0 right-0 top-0 z-10 h-6 rounded-t-xl bg-gradient-to-b from-white to-transparent"}),W("div",{ref:o,onScroll:n,className:i("flex flex-col gap-2 overflow-y-auto px-3 py-2",r),style:{maxHeight:t},children:e}),m&&W("div",{className:"pointer-events-none absolute bottom-0 left-0 right-0 z-10 h-6 rounded-b-xl bg-gradient-to-t from-white to-transparent"})]})}import{jsx as gt,jsxs as hn}from"react/jsx-runtime";var ie=gl("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"}}),ee=bl(({text:e,variant:t="primary",className:r,textWrapperClassName:o,shortcutClassName:a,loading:n,icon:c,shortcut:d,disabledTooltip:m,right:s,...l},u)=>m?gt(Z,{content:m,children:hn("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&&gt("div",{className:i("min-w-0 truncate",d&&"flex-1 text-left",o),children:e}),d&&gt("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:d})]})}):hn("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":ie({variant:t}),r),disabled:l.disabled||n,...l,children:[n?gt(ue,{}):c||null,e&&gt("div",{className:i("min-w-0 truncate",d&&"flex-1 text-left",o),children:e}),d&&gt("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-400 text-white":t==="danger","bg-red-100 text-red-600 group-hover:bg-red-500 group-hover:text-white":t==="danger-outline"},a),children:d}),s]}));ee.displayName="Button";import{cva as hl}from"class-variance-authority";import{createContext as vl}from"react";import{jsx as vn}from"react/jsx-runtime";var xl=hl("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"}}}),Lt=vl({variant:"loose",loading:!1});function xn({variant:e="loose",loading:t=!1,className:r,children:o}){return vn("ul",{className:i(xl({variant:e,loading:t}),r),"data-variant":e,children:vn(Lt.Provider,{value:{variant:e,loading:t},children:o})})}import{cva as yl}from"class-variance-authority";import{createContext as Nl,useContext as wl,useEffect as kl,useRef as Cl,useState as Pl}from"react";import{jsx as yn,jsxs as Rl}from"react/jsx-runtime";var Sl=yl("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"}}}),Tl="w-full py-2.5 px-4",ao=Nl({hovered:!1});function Nn({outerClassName:e,innerClassName:t,children:r,onClick:o,onAuxClick:a,hoverStateEnabled:n=!0,banner:c}){let{variant:d}=wl(Lt),m=Cl(null),[s,l]=Pl(!1);kl(()=>{if(!s||!m.current)return;let p=setInterval(()=>{var f;((f=m.current)==null?void 0:f.matches(":hover"))===!1&&l(!1)},1e3);return()=>clearInterval(p)},[s]);let u=p=>!(document.getElementById("modal-backdrop")||Ge(p));return Rl("li",{ref:m,className:i(Sl({variant:d}),e),onPointerEnter:()=>l(!0),onPointerLeave:()=>l(!1),"data-hover-state-enabled":n,children:[c,yn("div",{className:i(Tl,t),onClick:o?p=>{u(p)&&o(p)}:void 0,onAuxClick:a?p=>{u(p)&&a(p)}:void 0,children:yn(ao.Provider,{value:{hovered:s},children:r})})]})}var Tv=Object.assign(xn,{Card:Object.assign(Nn,{Context:ao}),Context:Lt});import{motion as fc}from"motion/react";import{forwardRef as gc,useRef as bc}from"react";import{useEffect as Ll,useState as Ml}from"react";function wn(e){if(typeof window>"u")return null;let t=window.localStorage.getItem(e);return t?JSON.parse(t):null}function no(e,t){let[r,o]=Ml(wn(e)??t);return Ll(()=>{let n=wn(e);n&&o(n)},[e]),[r,n=>{o(n),window.localStorage.setItem(e,JSON.stringify(n))}]}function El(e){return e&&typeof e=="object"&&Array.isArray(e.all)&&Array.isArray(e.defaultVisible)}function Dv(e,t){if(!El(t)){let o=t,a=m=>{let s=o[m];return Object.fromEntries(s.all.map(l=>[l,s.defaultVisible.includes(l)]))},n=Object.fromEntries(Object.keys(o).map(m=>[m,a(m)])),[c,d]=no(e,n);return{columnVisibility:c,setColumnVisibility:(m,s)=>{let l=o[m].all,u=c[m]||{},p=Object.fromEntries(l.map(f=>[f,f in s?s[f]:u[f]??!1]));d({...c,[m]:p})}}}else{let o=t,a=Object.fromEntries(o.all.map(d=>[d,o.defaultVisible.includes(d)])),[n,c]=no(e,a);return{columnVisibility:n,setColumnVisibility:d=>{let m=o.all,s=n||{},l=Object.fromEntries(m.map(u=>[u,u in d?d[u]:s[u]??!1]));c(l)}}}}import io from"js-cookie";import{useEffect as Dl,useState as Al}from"react";function zv(e,t,r){let[o,a]=Al(()=>{let c=io.get(e);return c?JSON.parse(c):t});return Dl(()=>{let c=()=>{let d=io.get(e);d&&a(JSON.parse(d))};return window.addEventListener("storage",c),()=>{window.removeEventListener("storage",c)}},[e]),[o,c=>{a(c),io.set(e,JSON.stringify(c),r)}]}import{useCallback as Il,useEffect as Ol,useRef as zl,useState as Vl}from"react";var bt=(e=3e3)=>{let t=zl(null),[r,o]=Vl(!1),a=()=>{t.current&&(clearTimeout(t.current),t.current=null)},n=Il(async(c,{onSuccess:d,throwOnError:m}={})=>{a();try{typeof c=="string"?await navigator.clipboard.writeText(c):c instanceof ClipboardItem&&await navigator.clipboard.write([c]),o(!0),d==null||d(),Number.isFinite(e)&&e>=0&&(t.current=setTimeout(()=>o(!1),e))}catch(s){if(console.error("Failed to copy: ",s),m)throw s}},[e]);return Ol(()=>()=>a(),[]),[r,n]};import{useEffect as Hl,useState as _l}from"react";function Bv(){let[e,t]=_l(null);return Hl(()=>{let r=document.querySelector("[data-mdx-container]");if(!r)return;let o=r.offsetTop-1,a=new IntersectionObserver(d=>{var u,p,f;let m=d[0];if(!m)return;let s=(((u=m.rootBounds)==null?void 0:u.height)||0)*.3+o;for(let b=1;b<d.length;b++){let g=d[b];if(!g)break;(g.boundingClientRect.top<m.boundingClientRect.top||m.boundingClientRect.bottom<o)&&(m=g)}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>s;)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(d=>a.observe(d)),()=>{a.disconnect()}},[]),e==null?void 0:e.replace("#","")}import{useEffect as Fl,useState as Bl}from"react";function Gv(){let[e,t]=Bl(null);return Fl(()=>{let r=window.location.hostname;ra.has(r)?t("app"):aa.has(r)?t("partners"):oa.has(r)&&t("admin")},[]),{subdomain:e}}import{useCallback as Wl}from"react";function Zv(e){return{handleKeyDown:Wl(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 Ul,useState as $l}from"react";function Qv(e,t={}){let{root:r,defaultValue:o}=t,[a,n]=$l(o??!1);return Ul(()=>{let c=()=>{let m=e.current;if(!m)return;let s=r==null?void 0:r.current,l=m.getBoundingClientRect(),u=s?s.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 d=null;return e.current&&(d=new IntersectionObserver(c),d.observe(e.current)),c(),()=>{((r==null?void 0:r.current)||window).removeEventListener("scroll",c),window.removeEventListener("resize",c),d==null||d.disconnect()}},[e,r]),a}import{useEffect as Gl,useState as Kl}from"react";function rx(){let[e,t]=Kl(!1);return Gl(()=>{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 jl,useState as Yl}from"react";function ix(e,{threshold:t=0,root:r=null,rootMargin:o="0%",freezeOnceVisible:a=!1}={}){let[n,c]=Yl(),d=(n==null?void 0:n.isIntersecting)&&a,m=([s])=>{c(s)};return jl(()=>{let s=e==null?void 0:e.current;if(!!!window.IntersectionObserver||d||!s)return;let u={threshold:t,root:r,rootMargin:o},p=new IntersectionObserver(m,u);return p.observe(s),()=>p.disconnect()},[e,JSON.stringify(t),r,o,d]),n}import{createContext as Zl,useCallback as ql,useContext as Xl,useEffect as kn,useId as Jl,useState as Ql}from"react";import{jsx as ec}from"react/jsx-runtime";var Cn=Zl({listeners:[],setListeners:()=>{}});function ux({children:e}){let[t,r]=Ql([]);return ec(Cn.Provider,{value:{listeners:t,setListeners:r},children:e})}function De(e,t,r={}){let o=Jl(),{listeners:a,setListeners:n}=Xl(Cn),c=ql(d=>{if(r.enabled===!1)return;let m=d.target,s=document.getElementById("modal-backdrop"),l=document.querySelector("[data-sheet-overlay]");if(m.tagName==="INPUT"||m.tagName==="TEXTAREA"||m.isContentEditable||!!s!=!!r.modal||!!l!=!!r.sheet)return;let u=[...d.metaKey?["meta"]:[],...d.ctrlKey?["ctrl"]:[],...d.altKey?["alt"]:[],d.key].join("+");if(Array.isArray(e)?!e.includes(u):u!==e)return;let p=a.filter(b=>b.enabled!==!1&&!!s==!!b.modal&&!!l==!!b.sheet&&(Array.isArray(b.key)?b.key.includes(u):b.key===u));!p.length||da(p,(b,g)=>(g.priority??0)-(b.priority??0))[0].id!==o||(d.preventDefault(),t(d))},[e,a,o,t,r.enabled,r.modal,r.sheet]);kn(()=>(document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)),[c]),kn(()=>(n(d=>[...d.filter(m=>m.id!==o),{id:o,key:e,...r}]),()=>n(d=>d.filter(m=>m.id!==o))),[JSON.stringify(e),r.enabled,r.priority])}import{toast as tc}from"sonner";import rc from"swr";function hx(e,t){let{data:r,isLoading:o,mutate:a}=rc(e,be);return{data:r,isLoading:o,update:async(n,c)=>tc.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 Rn,useMemo as lc}from"react";import{useEffect as Pn,useState as oc}from"react";function Sn({pageSize:e,page:t,onPageChange:r}){let[o,a]=oc({pageIndex:t,pageSize:e});return Pn(()=>{a(n=>({...n,pageIndex:t}))},[t]),Pn(()=>{r==null||r(o.pageIndex)},[o]),{pagination:o,setPagination:a}}import{usePathname as ac,useRouter as nc,useSearchParams as ic}from"next/navigation";import{useCallback as sc}from"react";function Tn(){let e=ac(),t=nc(),r=ic(),o=Object.fromEntries(r),a=(c,d)=>{let m=new URLSearchParams(r);if((d==null?void 0:d.include)&&Array.isArray(d.include)){let l=new URLSearchParams;r.forEach((u,p)=>{var f;(f=d.include)!=null&&f.includes(p)&&l.set(p,u)}),m=l}(d==null?void 0:d.exclude)&&Array.isArray(d.exclude)&&d.exclude.forEach(l=>m.delete(l)),c&&Object.entries(c).forEach(([l,u])=>m.set(l,u));let s=m.toString();return s.length>0?`?${s}`:""},n=sc(({set:c,del:d,replace:m,scroll:s=!0,getNewPath:l,arrayDelimiter:u=","})=>{let p=new URLSearchParams(r);c&&Object.entries(c).forEach(([g,h])=>p.set(g,Array.isArray(h)?h.join(u):h)),d&&(Array.isArray(d)?d.forEach(g=>p.delete(g)):p.delete(d));let f=p.toString(),b=`${e}${f.length>0?`?${f}`:""}`;if(l)return b;m?t.replace(b,{scroll:!1}):t.push(b,{scroll:s})},[r,e,t]);return{pathname:e,router:t,searchParams:r,searchParamsObj:o,queryParams:n,getQueryString:a}}function Lx(e=ia){let{searchParams:t,queryParams:r}=Tn(),o=lc(()=>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 Rn(()=>{let c=parseInt(t.get("page")||"1")||1;n(d=>({...d,pageIndex:c}))},[t.get("page")]),Rn(()=>{r(a.pageIndex===1?{del:"page",scroll:!1}:{set:{page:a.pageIndex.toString()},scroll:!1})},[a]),{pagination:a,setPagination:n}}import{useEffect as cc}from"react";function Dx(){cc(()=>{let e=new URL(window.location.href);e.searchParams.has("_gl")&&setTimeout(()=>{e.searchParams.delete("_gl"),window.history.replaceState({},"",e.toString())},2e3)},[])}import{useCallback as dc,useEffect as Ln,useState as mc}from"react";function Mn(e,{container:t}={}){let[r,o]=mc(!1),a=dc(()=>{o((t!=null&&t.current?t.current.scrollTop:window.scrollY)>e)},[e]);return Ln(()=>{let n=(t==null?void 0:t.current)??window;return n.addEventListener("scroll",a),()=>n.removeEventListener("scroll",a)},[a]),Ln(()=>{a()},[a]),r}import{useEffect as uc}from"react";import{toast as Dn}from"sonner";import{jsx as br,jsxs as En}from"react/jsx-runtime";function pc({id:e,message:t,undo:r}){let o=()=>{r(),Dn.dismiss(e)},a=n=>{n.key==="z"&&(n.ctrlKey||n.metaKey)&&o()};return uc(()=>(document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)),[]),En("div",{className:"flex w-full items-center justify-between space-x-2",children:[En("div",{className:"flex items-center space-x-2",children:[br(ba,{}),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 Fx(){return({id:t,message:r,undo:o,duration:a})=>Dn(br(pc,{id:t,message:r,undo:o}),{id:t,...a&&{duration:a}})}import{jsx as An}from"react/jsx-runtime";var fe=gc(({width:e=!1,height:t=!1,className:r,transition:o,children:a,...n},c)=>{var s,l;let d=bc(null),m=fr(d);return An(fc.div,{ref:c,className:i("overflow-hidden",r),animate:{width:e?((s=m==null?void 0:m.contentRect)==null?void 0:s.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:An("div",{ref:d,className:i(t&&"h-max",e&&"w-max"),children:a})})});fe.displayName="AnimatedSizeContainer";import{jsx as Pe,jsxs as In}from"react/jsx-runtime";function e2({options:e,value:t,onChange:r,className:o,gridCols:a="2",name:n,disabled:c=!1,animated:d=!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],s=Pe("div",{className:i("grid gap-3",m),children:e.map(({key:l,label:u,description:p,icon:f})=>{let b=t===l;return In("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",b&&"border-black bg-neutral-50 text-neutral-900 ring-1 ring-black",c&&"cursor-not-allowed opacity-50",o),children:[Pe("input",{type:"radio",name:n,value:l,className:"hidden",checked:b,disabled:c,onChange:g=>{g.target.checked&&r&&r(l)}}),f&&Pe("div",{className:"flex-shrink-0 pt-0.5",children:f}),In("div",{className:"flex grow flex-col p-3 pr-0",children:[Pe("span",{className:"pr-1 text-sm font-semibold text-neutral-900",children:u}),Pe("span",{className:"text-xs text-neutral-600",children:p})]}),Pe(Ea,{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",b&&"scale-100 opacity-100")})]},l)})});return d?Pe("div",{className:"-m-1",children:Pe(fe,{height:!0,transition:{ease:"easeInOut",duration:.2},children:Pe("div",{className:"p-1",children:s})})}):s}import hc from"embla-carousel-autoplay";import vc from"embla-carousel-react";import{ArrowLeft as xc,ArrowRight as yc}from"lucide-react";import{createContext as Nc,forwardRef as Et,useCallback as Mt,useContext as wc,useEffect as so,useState as lo}from"react";import{jsx as Se,jsxs as Vn}from"react/jsx-runtime";var co=2e3,On=Nc(null);function ve(){let e=wc(On);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}function zn(){let{api:e}=ve(),[t,r]=lo(0),o=Mt(a=>r((a==null?void 0:a.selectedScrollSnap())??0),[]);return so(()=>{!e||(o(e),e.on("reInit",o),e.on("select",o))},[e,o]),t}var kc=Et(({orientation:e="horizontal",opts:t,setApi:r,autoplay:o,plugins:a,className:n,children:c,...d},m)=>{let[s,l]=vc({...t,axis:e==="horizontal"?"x":"y"},[...o?[hc(typeof o=="object"?o:{delay:co})]:[],...a||[]]),[u,p]=lo(!1),[f,b]=lo(!1),g=Mt(y=>{!y||(p(y.canScrollPrev()),b(y.canScrollNext()))},[]),h=Mt(()=>{l==null||l.scrollPrev()},[l]),N=Mt(()=>{l==null||l.scrollNext()},[l]),x=Mt(y=>{y.key==="ArrowLeft"?(y.preventDefault(),h()):y.key==="ArrowRight"&&(y.preventDefault(),N())},[h,N]);return so(()=>{!l||!r||r(l)},[l,r]),so(()=>{if(!!l)return g(l),l.on("reInit",g),l.on("select",g),()=>{l==null||l.off("select",g)}},[l,g]),Se(On.Provider,{value:{carouselRef:s,api:l,opts:t,orientation:e||((t==null?void 0:t.axis)==="y"?"vertical":"horizontal"),scrollPrev:h,scrollNext:N,canScrollPrev:u,canScrollNext:f},children:Se("div",{ref:m,onKeyDownCapture:x,className:i("relative",n),role:"region","aria-roledescription":"carousel",...d,children:c})})});kc.displayName="Carousel";var Cc=Et(({className:e,...t},r)=>{let{carouselRef:o,orientation:a}=ve();return Se("div",{ref:o,className:"overflow-hidden",children:Se("div",{ref:r,className:i("flex",a==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})});Cc.displayName="CarouselContent";var Pc=Et(({className:e,...t},r)=>{let{orientation:o}=ve();return Se("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})});Pc.displayName="CarouselItem";var Sc=Et(({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",ie({variant:"secondary",className:"p-2"}),e),disabled:!n,onClick:a,...t,children:[Se(xc,{className:"h-4 w-4"}),Se("span",{className:"sr-only",children:"Previous slide"})]})});Sc.displayName="CarouselPrevious";var Tc=Et(({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",ie({variant:"secondary",className:"p-2"}),e),disabled:!n,onClick:a,...t,children:[Se(yc,{className:"h-4 w-4"}),Se("span",{className:"sr-only",children:"Next slide"})]})});Tc.displayName="CarouselNext";import{cva as Rc}from"class-variance-authority";import{ChevronLeft as Lc,ChevronRight as Mc}from"lucide-react";import{motion as Ec}from"motion/react";import*as Ae from"react";import{jsx as je,jsxs as Dt}from"react/jsx-runtime";var Dc=Rc("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 "}}}),v2=({variant:e="simple",className:t})=>{var b;let{scrollNext:r,scrollPrev:o,canScrollNext:a,canScrollPrev:n,api:c}=ve(),d=(b=c==null?void 0:c.plugins())==null?void 0:b.autoplay,[m,s]=Ae.useState(0),[l,u]=Ae.useState(!1),p=Ae.useCallback(g=>{s((g==null?void 0:g.selectedScrollSnap())??0)},[]),f=Ae.useCallback(g=>()=>{d&&d.isPlaying()&&d.stop(),g()},[d]);return Ae.useEffect(()=>{!c||(p(c),u((d==null?void 0:d.isPlaying())??!1),c.on("reInit",p),c.on("select",p),c.on("autoplay:play",()=>u(!0)),c.on("autoplay:stop",()=>u(!1)))},[c,d,p]),Dt("div",{className:i(Dc({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:[je(Lc,{className:"h-4 w-4"}),je("span",{className:"sr-only",children:"Previous slide"})]}),c!=null&&je("div",{className:"flex items-center gap-1",children:c.slideNodes().map((g,h)=>Dt("button",{onClick:f(()=>c.scrollTo(h)),className:"rounded-full p-0.5 hover:bg-neutral-100 active:bg-neutral-200 sm:p-1.5",children:[je("div",{className:i("relative isolate h-1.5 w-1.5 overflow-hidden rounded-full transition-all",h===m?"bg-black":"bg-black/20",l&&h===m&&"w-6 bg-black/20"),children:l&&h===m&&je(Ec.div,{initial:{x:"-100%"},animate:{x:0},transition:{type:"tween",duration:((d==null?void 0:d.options.delay)??co)/1e3},className:"animate-fill-width h-full w-full rounded-full bg-black"})}),Dt("span",{className:"sr-only",children:["Slide ",h+1]})]},h))}),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:[je(Mc,{className:"h-4 w-4"}),je("span",{className:"sr-only",children:"Next slide"})]})]})};import Ac from"embla-carousel-react";import{forwardRef as Ic,useCallback as Oc,useEffect as zc}from"react";import{jsx as hr}from"react/jsx-runtime";var T2=({className:e,...t})=>{let{api:r}=ve(),[o,a]=Ac({dragFree:!0}),n=Oc(c=>{!c||!a||a==null||a.scrollTo(c.selectedScrollSnap())},[a]);return zc(()=>{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})})},R2=Ic(({index:e,className:t,...r},o)=>{let{api:a}=ve(),n=zn();return hr("div",{ref:o,children:hr("button",{type:"button",onClick:()=>{var d;if(!a)return;let c=(d=a.plugins())==null?void 0:d.autoplay;c&&c.isPlaying()&&c.stop(),a.scrollTo(e)},className:typeof t=="function"?t({active:e===n}):t,...r})})});import*as At from"@radix-ui/react-checkbox";import{forwardRef as Vc}from"react";import{jsx as mo,jsxs as Hc}from"react/jsx-runtime";var ht=Vc(({className:e,...t},r)=>mo(At.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:Hc(At.Indicator,{className:"group/indicator flex items-center justify-center text-white",children:[mo(ir,{className:"size-3 group-data-[state=indeterminate]/indicator:hidden"}),mo(dr,{className:"size-3 group-data-[state=checked]/indicator:hidden"})]})}));ht.displayName=At.Root.displayName;import{Command as Ye,useCommandState as Bc}from"cmdk";import{ChevronDown as Wc}from"lucide-react";import{forwardRef as Uc,isValidElement as $c,useCallback as Gc,useEffect as yr,useState as It}from"react";import*as Ie from"@radix-ui/react-popover";import{Drawer as vt}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:d,onOpenAutoFocus:m,collisionBoundary:s,sticky:l,onEscapeKeyDown:u,onWheel:p,sideOffset:f=8}){let{isMobile:b}=Q();return c||b?vr(vt.Root,{open:a,onOpenChange:n,children:[Te(vt.Trigger,{className:"sm:hidden",asChild:!0,children:e}),vr(vt.Portal,{children:[Te(vt.Overlay,{className:"bg-bg-subtle fixed inset-0 z-50 bg-opacity-10 backdrop-blur"}),vr(vt.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(vt.Overlay,{})]})]}):vr(Ie.Root,{open:a,onOpenChange:n,children:[Te(Ie.Trigger,{className:"sm:inline-flex",asChild:!0,children:e}),Te(Ie.Portal,{children:Te(Ie.Content,{sideOffset:f,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",d),sticky:l,collisionBoundary:s,onOpenAutoFocus:m,onEscapeKeyDown:u,onWheel:p,children:t})})]})}import{useRef as _c}from"react";import{jsx as Hn,jsxs as Fc}from"react/jsx-runtime";function xr({children:e,className:t}){let r=_c(null),{scrollProgress:o,updateScrollProgress:a}=Ee(r);return Fc("div",{className:"relative",children:[Hn("div",{className:i("scrollbar-hide h-full w-screen overflow-y-scroll [clip-path:inset(0)] sm:w-auto",t),ref:r,onScroll:a,children:e}),Hn("div",{className:"pointer-events-none absolute bottom-0 left-0 z-10 hidden h-16 w-full rounded-b-lg bg-gradient-to-t from-white to-transparent sm:block",style:{opacity:1-Math.pow(o,2)}})]})}import{Fragment as uo,jsx as I,jsxs as Oe}from"react/jsx-runtime";function Kc(e,t){return e===!0}function _n({multiple:e,selected:t,setSelected:r,onSelect:o,options:a,trigger:n,icon:c,placeholder:d="Select...",searchPlaceholder:m="Search...",emptyState:s,createLabel:l,createIcon:u=pt,onCreate:p,buttonProps:f,labelProps:b,iconProps:g,popoverProps:h,shortcutHint:N,caret:x,side:y,open:C,onOpenChange:w,onSearchChange:T,shouldFilter:B=!0,inputRight:R,inputClassName:S,optionRight:Y,optionClassName:P,matchTriggerWidth:M,hideSearch:L=!1,children:E}){let z=Kc(e,r),k=Array.isArray(t)?t:t?[t]:[],{isMobile:Wr}=Q(),[Xt,cs]=It(!1),Ur=C??Xt,Jt=w??cs,[me,$r]=It(""),[qo,Gr]=It(!1),[Kr,ds]=It(void 0),[ms,Xo]=It(!1),us=H=>{var lt;if(o==null||o(H),!!r)if(z){let Ue=k.some(({value:$e})=>$e===H.value);r(Ue?k.filter(({value:$e})=>$e!==H.value):[...k,H])}else r(k.length&&((lt=k[0])==null?void 0:lt.value)===H.value?null:H),Jt(!1)},Jo=Gc((H,lt)=>lt===""?[...H.filter(Ue=>Ue.first&&!k.some($e=>$e.value===Ue.value)),...k,...H.filter(Ue=>!Ue.first&&!k.some($e=>$e.value===Ue.value))]:H,[k]);yr(()=>{qo&&(ds(a&&Jo(a,me)),Gr(!1))},[qo,a,Jo,me]),yr(()=>{Gr(!0)},[a]),yr(()=>{Ur||($r(""),Gr(!0))},[Ur]),yr(()=>T==null?void 0:T(me),[me]);let Qo=Oe(Ye.Item,{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",P),onSelect:async()=>{Xo(!0),await(p==null?void 0:p(me))&&($r(""),Jt(!1)),Xo(!1)},children:[ms?I(ue,{className:"size-4 shrink-0"}):I(u,{className:"size-4 shrink-0"}),I("div",{className:"grow truncate",children:(l==null?void 0:l(me))??`Create ${me?`"${me}"`:"new option..."}`})]});return I(xe,{openPopover:Ur,setOpenPopover:Jt,align:"start",side:y,onWheel:H=>{H.stopPropagation()},popoverContentClassName:i(M&&"sm:w-[var(--radix-popover-trigger-width)]",h==null?void 0:h.contentClassName),content:I(fe,{width:!Wr&&!M,height:!0,style:{transform:"translateZ(0)"},transition:{ease:"easeInOut",duration:.1},className:"pointer-events-auto",children:Oe(Ye,{loop:!0,shouldFilter:B,children:[!L&&Oe("div",{className:"flex items-center overflow-hidden rounded-t-lg border-b border-neutral-200",children:[I(Ye.Input,{placeholder:m,value:me,onValueChange:$r,className:i("grow border-0 py-3 pl-4 pr-2 outline-none placeholder:text-neutral-400 focus:ring-0 sm:text-sm",S),onKeyDown:H=>{(H.key==="Escape"||H.key==="Backspace"&&!me)&&(H.preventDefault(),H.stopPropagation(),Jt(!1))}}),R&&I("div",{className:"mr-2",children:R}),N&&I("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:N})]}),I(xr,{className:i("max-h-[min(50vh,250px)]",p&&!e&&"max-h-[calc(min(50vh,250px)-3.5rem)]"),children:I(Ye.List,{className:i("flex w-full min-w-[100px] flex-col gap-1 p-1"),children:Kr!==void 0?Oe(uo,{children:[Kr.map(H=>I(jc,{option:H,multiple:z,selected:k.some(({value:lt})=>lt===H.value),onSelect:()=>us(H),right:Y==null?void 0:Y(H),className:P},`${H.label}, ${H.value}`)),p&&e&&me.length>0&&Qo,B?I(Zc,{className:"flex min-h-12 items-center justify-center text-sm text-neutral-500",children:s||"No matches"}):Kr.length===0?I("div",{className:"flex min-h-12 items-center justify-center text-sm text-neutral-500",children:s||"No matches"}):null]}):I(Ye.Loading,{children:I("div",{className:"flex h-12 items-center justify-center",children:I(ue,{})})})})}),p&&!e&&I("div",{className:"rounded-b-lg border-t border-neutral-200 bg-white p-1",children:Qo})]})}),children:n??I(ee,{variant:"secondary",...f,className:i(f==null?void 0:f.className,"flex gap-2"),textWrapperClassName:i(f==null?void 0:f.textWrapperClassName,"w-full flex items-center justify-start"),text:Oe(uo,{children:[I("div",{className:i("min-w-0 grow truncate text-left",b==null?void 0:b.className),children:E||k.map(H=>H.label).join(", ")||d}),x&&(x===!0?I(Wc,{className:"ml-1 size-4 shrink-0 text-neutral-400 transition-transform duration-75 group-data-[state=open]:rotate-180"}):x)]}),icon:c?Fn(c)?c:I(c,{className:i("size-4 shrink-0",g==null?void 0:g.className)}):void 0})})}function jc({option:e,onSelect:t,multiple:r,selected:o,right:a,className:n}){return Oe(uo,{children:[I(Yc,{disabledTooltip:e.disabledTooltip,children:Oe(Ye.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&&I("div",{className:"shrink-0 text-neutral-600",children:o?I(Ra,{className:"size-4 text-neutral-600"}):I(La,{className:"size-4 text-neutral-400"})}),Oe("div",{className:"flex min-w-0 grow items-center gap-2",children:[e.icon&&I("span",{className:"shrink-0 text-neutral-600",children:Fn(e.icon)?e.icon:I(e.icon,{className:"h-4 w-4"})}),I("span",{className:"grow truncate",children:e.label})]}),a,!r&&o&&I(ir,{className:"size-4 shrink-0 text-neutral-600"})]})}),e.separatorAfter&&I(Ye.Separator,{className:"-mx-1 my-1 h-px bg-neutral-200"})]})}var Yc=({children:e,disabledTooltip:t})=>t?I(Z,{content:t,children:I("div",{children:e})}):e,Fn=e=>$c(e),Zc=Uc((e,t)=>Bc(o=>o.filtered.count===0)?I("div",{ref:t,"cmdk-empty":"",role:"presentation",...e}):null);import{addYears as Nr,format as qc,isSameMonth as Xc}from"date-fns";import{ChevronLeft as Bn,ChevronRight as Wn,ChevronsLeft as Jc,ChevronsRight as Qc}from"lucide-react";import{forwardRef as ed,useRef as td}from"react";import{DayPicker as rd,useDayPicker as od,useDayRender as ad,useNavigation as nd}from"react-day-picker";import{Fragment as id,jsx as re,jsxs as wr}from"react/jsx-runtime";var Ot=ed(({onClick:e,icon:t,disabled:r,...o},a)=>re("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:re(t,{className:"h-full w-full shrink-0"})}));Ot.displayName="NavigationButton";function Un({mode:e="single",weekStartsOn:t=0,numberOfMonths:r=1,showYearNavigation:o=!1,disableNavigation:a,locale:n,className:c,classNames:d,...m}){return re(rd,{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",...d},components:{IconLeft:()=>re(Bn,{className:"h-4 w-4"}),IconRight:()=>re(Wn,{className:"h-4 w-4"}),Caption:({...s})=>{let{goToMonth:l,nextMonth:u,previousMonth:p,currentMonth:f,displayMonths:b}=nd(),{numberOfMonths:g,fromDate:h,toDate:N}=od(),x=b.findIndex(S=>Xc(s.displayMonth,S)),y=x===0,C=x===b.length-1,w=g>1&&(y||!C),T=g>1&&(C||!y),B=()=>{let S=Nr(f,-1);p&&(!h||S.getTime()>=h.getTime())&&l(S)},R=()=>{let S=Nr(f,1);u&&(!N||S.getTime()<=N.getTime())&&l(S)};return wr("div",{className:"flex items-center justify-between",children:[wr("div",{className:"flex items-center gap-1",children:[o&&!T&&re(Ot,{disabled:a||!p||h&&Nr(f,-1).getTime()<h.getTime(),"aria-label":"Go to previous year",onClick:B,icon:Jc}),!T&&re(Ot,{disabled:a||!p,"aria-label":"Go to previous month",onClick:()=>p&&l(p),icon:Bn})]}),re("div",{role:"presentation","aria-live":"polite",className:"text-sm font-medium capitalize tabular-nums text-neutral-900",children:qc(s.displayMonth,"LLLL yyy",{locale:n})}),wr("div",{className:"flex items-center gap-1",children:[!w&&re(Ot,{disabled:a||!u,"aria-label":"Go to next month",onClick:()=>u&&l(u),icon:Wn}),o&&!w&&re(Ot,{disabled:a||!u||N&&Nr(f,1).getTime()>N.getTime(),"aria-label":"Go to next year",onClick:R,icon:Qc})]})]})},Day:({date:s,displayMonth:l})=>{let u=td(null),{activeModifiers:p,buttonProps:f,divProps:b,isButton:g,isHidden:h}=ad(s,l,u),{selected:N,today:x,disabled:y,range_middle:C}=p;if(h)return re(id,{});if(!g)return re("div",{...b,className:i("flex items-center justify-center",b.className)});let{children:w,...T}=f;return wr("button",{ref:u,...T,type:"button",children:[w,x&&re("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":!N,"!bg-white":N,"!bg-blue-400":N&&C,"text-neutral-400":y})})]})}},...m})}import{endOfDay as Gn,isSameDay as Kn,startOfDay as jn}from"date-fns";import{enUS as hd}from"date-fns/locale";import{useEffect as vo,useMemo as Yn,useRef as vd,useState as Cr}from"react";import{Command as po}from"cmdk";import{Lock as sd}from"lucide-react";import{jsx as Ze,jsxs as ld}from"react/jsx-runtime";var fo=({presets:e,onSelect:t,currentValue:r,currentPresetId:o})=>{let a=s=>"dateRange"in s,n=s=>"date"in s,c=(s,l)=>s.getDate()===l.getDate()&&s.getMonth()===l.getMonth()&&s.getFullYear()===l.getFullYear(),d=(s,l)=>{let u=s.from,p=l.from,f=!1;u&&p&&c(u,p)&&(f=!0);let b=s.to,g=l.to,h=!1;return b&&g&&c(b,g)&&(h=!0),f&&h},m=s=>{if(o)return o===s.id;if(a(s)){let l=r;return l&&d(l,s.dateRange)}else if(n(s)){let l=r;return l&&c(l,s.date)}return!1};return Ze(po,{className:"w-full rounded ring-neutral-200 ring-offset-2 focus:outline-none",tabIndex:0,autoFocus:!0,loop:!0,children:Ze(po.List,{className:"[&>*]:flex [&>*]:w-full [&>*]:items-start [&>*]:gap-x-2 [&>*]:gap-y-0.5 [&>*]:sm:flex-col",children:e.map((s,l)=>ld(po.Item,{disabled:s.requiresUpgrade,onSelect:()=>t(s),title:s.label,value:s.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(s)&&"font-semibold text-neutral-800"),children:[Ze("span",{children:s.label}),s.requiresUpgrade?Ze(sd,{className:"h-3.5 w-3.5","aria-hidden":"true"}):s.shortcut?Ze("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:s.shortcut.toUpperCase()}):null,s.requiresUpgrade&&s.tooltipContent&&Ze(Z,{side:"bottom",content:s.tooltipContent,children:Ze("div",{className:"absolute inset-0 cursor-not-allowed"})})]},l))})})};fo.displayName="DatePicker.Presets";import{format as ze}from"date-fns";import{createContext as cd}from"react";var go=cd({isOpen:!1,setIsOpen:()=>{}}),dd=()=>{let e=typeof window<"u"?window.navigator.language:"en-US",t=new Intl.DateTimeFormat(e,{hour:"numeric"}).format();return Number.isInteger(Number(t))},bo=(e,t,r=!1)=>{let o=!dd(),a;return r?a=o?ze(e,"d MMM, yyyy h:mm a",{locale:t}):ze(e,"d MMM, yyyy HH:mm",{locale:t}):a=ze(e,"d MMM, yyyy",{locale:t}),a},$n=(e,t)=>{let{toYear:r,fromYear:o,fromMonth:a,toMonth:n,fromDay:c,toDay:d}=t;if(e&&e.length>0){let m=o,s=r;e.forEach(l=>{var u,p,f,b,g,h;if("date"in l){let N=l.date.getFullYear();if(o&&N<o)throw new Error(`Preset ${l.label} is before fromYear ${m}.`);if(r&&N>r)throw new Error(`Preset ${l.label} is after toYear ${s}.`);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(d&&l.date.getDate()>d.getDate())throw new Error(`Preset ${l.label} is after toDay ${ze(d,"MMM dd, yyyy")}.`)}if("dateRange"in l){let N=(u=l.dateRange.from)==null?void 0:u.getFullYear(),x=(p=l.dateRange.to)==null?void 0:p.getFullYear();if(N&&o&&N<o)throw new Error(`Preset ${l.label}'s 'from' is before fromYear ${m}.`);if(x&&r&&x>r)throw new Error(`Preset ${l.label}'s 'to' is after toYear ${s}.`);if(a){let y=(f=l.dateRange.from)==null?void 0:f.getMonth();if(y&&y<a.getMonth())throw new Error(`Preset ${l.label}'s 'from' is before fromMonth ${ze(a,"MMM, yyyy")}.`)}if(n){let y=(b=l.dateRange.to)==null?void 0:b.getMonth();if(y&&y>n.getMonth())throw new Error(`Preset ${l.label}'s 'to' is after toMonth ${ze(n,"MMM, yyyy")}.`)}if(c){let y=(g=l.dateRange.from)==null?void 0:g.getDate();if(y&&y<c.getDate())throw new Error(`Preset ${l.dateRange.from}'s 'from' is before fromDay ${ze(c,"MMM dd, yyyy")}.`)}if(d){let y=(h=l.dateRange.to)==null?void 0:h.getDate();if(y&&y>d.getDate())throw new Error(`Preset ${l.label}'s 'to' is after toDay ${ze(d,"MMM dd, yyyy")}.`)}}})}};import{cva as md}from"class-variance-authority";import{Calendar as ud,ChevronDown as pd}from"lucide-react";import{forwardRef as fd}from"react";import{jsx as kr,jsxs as bd}from"react/jsx-runtime";var gd=md(["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"}}}),ho=fd(({className:e,children:t,placeholder:r,hasError:o,...a},n)=>bd("button",{ref:n,className:i(gd({hasError:o}),e),...a,children:[kr(ud,{className:i("h-4 w-4 shrink-0 text-neutral-400",!!t&&"text-neutral-900")}),kr("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-neutral-900",children:t||(r?kr("span",{className:"text-neutral-400",children:r}):null)}),kr(pd,{className:"h-4 w-4 flex-shrink-0 text-neutral-400 transition-transform duration-75 group-data-[state=open]:rotate-180"})]}));ho.displayName="DatePicker.Trigger";import{jsx as oe,jsxs as Zn}from"react/jsx-runtime";var xd=({value:e,defaultValue:t,presetId:r,onChange:o,presets:a,disabled:n,disableNavigation:c,disabledDays:d,showYearNavigation:m=!1,locale:s=hd,placeholder:l="Select date range",hasError:u,align:p="center",className:f,...b})=>{let{isDesktop:g}=Q(),[h,N]=Cr(!1),[x,y]=Cr(a&&r?a==null?void 0:a.find(({id:E})=>E===r):void 0),[C,w]=Cr((x==null?void 0:x.dateRange)??e??t??void 0),[T,B]=Cr(C==null?void 0:C.to),R=Yn(()=>C,[h]);vo(()=>{w(e)},[e]),vo(()=>{let E=a==null?void 0:a.find(({id:z})=>z===r);y(E),w((E==null?void 0:E.dateRange)??e??t)},[a,r]),vo(()=>{h?C&&B(C.to):B(C==null?void 0:C.to)},[h]);let S=(E,z)=>{let k=(C==null?void 0:C.from)&&(C==null?void 0:C.to)?{from:z}:E;(k==null?void 0:k.from)&&(k==null?void 0:k.to)&&Kn(k.from,k.to)&&(k.from=jn(k.from),k.to=Gn(k.to)),w(k),y(void 0),(k==null?void 0:k.from)&&(k==null?void 0:k.to)&&(o==null||o(k),N(!1))},Y=E=>{let z=E.dateRange;(z==null?void 0:z.from)&&(z==null?void 0:z.to)&&Kn(z.from,z.to)&&(z={from:jn(z.from),to:Gn(z.to)}),w(z),y(E),o==null||o(z,E),N(!1)},P=()=>{w(R),N(!1)},M=E=>{E||P(),N(E)},L=Yn(()=>C?`${C.from?bo(C.from,s):""} - ${C.to?bo(C.to,s):""}`:null,[C,s]);return De((a==null?void 0:a.filter(E=>E.shortcut).map(E=>E.shortcut))??[],E=>{let z=a==null?void 0:a.find(k=>k.shortcut===E.key);z&&Y(z)}),oe(go.Provider,{value:{isOpen:h,setIsOpen:N},children:oe(xe,{align:p,openPopover:h,setOpenPopover:M,popoverContentClassName:"rounded-xl",content:oe("div",{className:"flex w-full",children:Zn("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&&oe(yd,{children:oe("div",{className:"absolute px-3 sm:inset-0 sm:left-0",children:oe("div",{className:"sm:py-3",children:oe(fo,{currentPresetId:r,currentValue:C,presets:a,onSelect:Y})})})}),oe("div",{className:"scrollbar-hide overflow-x-scroll",children:oe(Un,{mode:"range",selected:C,onSelect:S,month:T,onMonthChange:B,numberOfMonths:g?2:1,disabled:d,disableNavigation:c,showYearNavigation:m,locale:s,className:"scrollbar-hide overflow-x-scroll",classNames:{months:"flex flex-row divide-x divide-neutral-200 overflow-x-scroll scrollbar-hide"},...b})})]})}),children:oe(ho,{placeholder:l,disabled:n,className:f,hasError:u,"aria-required":b.required||b["aria-required"],"aria-invalid":b["aria-invalid"],"aria-label":b["aria-label"],"aria-labelledby":b["aria-labelledby"],children:(x==null?void 0:x.label)??L})})})};function $y({presets:e,...t}){return e&&$n(e,t),oe(xd,{presets:e,...t})}function yd({children:e}){let t=vd(null),{scrollProgress:r,updateScrollProgress:o}=Ee(t);return Zn("div",{className:"relative sm:h-full",children:[oe("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}),oe("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 Nd}from"react";import{jsx as Pr,jsxs as wd}from"react/jsx-runtime";function Jy({dotSize:e=2,gapSize:t=10,patternOffset:r=[0,0],className:o}){let a=Nd();return wd("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 kd from"next/link";import{useEffect as Cd,useState as qn}from"react";import Pd from"swr";import{jsx as xo,jsxs as Xn}from"react/jsx-runtime";function Jn({className:e}){let{data:t}=Pd("https://status.dub.co/api/v1/summary",be),[r,o]=qn("bg-neutral-200"),[a,n]=qn("Loading status...");return Cd(()=>{if(!t)return;let{ongoing_incidents:c}=t;if(c.length>0){let{current_worst_impact:d,name:m}=c[0],s=d==="degraded_performance"?"bg-yellow-500":"bg-red-500";n(m),o(s)}else n("All systems operational"),o("bg-green-500")},[t]),Xn(kd,{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:[Xn("div",{className:"relative size-2",children:[xo("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")}),xo("div",{className:i("absolute inset-0 z-10 m-auto size-2 rounded-full",r)})]}),xo("p",{className:"text-xs font-medium leading-none text-neutral-600",children:a})]})}import{jsx as Sr,jsxs as Qn}from"react/jsx-runtime";function i4({icon:e,title:t,description:r,learnMore:o,children:a}){return Qn("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&&Qn("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 Sd}from"class-variance-authority";import{useState as ei}from"react";import{toast as ti}from"sonner";import{Fragment as Rd,jsx as ye,jsxs as No}from"react/jsx-runtime";var ri=["application/pdf","text/plain","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","text/csv"],yo={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:ri,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:[...ri,"application/zip"],errorMessage:"File type not supported (document or zip files only)"}},Td=Sd("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 h4({id:e,readFile:t,onChange:r,variant:o,className:a,iconClassName:n,previewClassName:c,icon:d=Oa,customPreview:m,accept:s="any",imageSrc:l,loading:u=!1,clickToUpload:p=!0,showHoverOverlay:f=!0,content:b,maxFileSizeMB:g=5,targetResolution:h,accessibilityLabel:N="File upload",disabled:x=!1}){let[y,C]=ei(!1),[w,T]=ei(null),B=async R=>{let S="dataTransfer"in R?R.dataTransfer.files&&R.dataTransfer.files[0]:R.target.files&&R.target.files[0];if(!S)return;if(T(S.name),g>0&&S.size/1024/1024>g){ti.error(`File size too big (max ${g} MB)`);return}let Y=yo[s].types;if(Y.length&&!Y.includes(S.type)){ti.error(yo[s].errorMessage??"File type not supported");return}let P=S;if(h&&S.type.startsWith("image/"))try{let M=await ca(S,h),L=await fetch(M).then(E=>E.blob());P=new File([L],S.name,{type:S.type})}catch(M){console.error("Error resizing image:",M)}if(t){let M=new FileReader;M.onload=L=>{var E;return r==null?void 0:r({src:(E=L.target)==null?void 0:E.result,file:P})},M.readAsDataURL(P);return}r==null||r({file:P})};return No("label",{className:i(Td({variant:o}),x?"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:R=>{R.preventDefault(),R.stopPropagation(),C(!0)},onDragEnter:R=>{R.preventDefault(),R.stopPropagation(),C(!0)},onDragLeave:R=>{R.preventDefault(),R.stopPropagation(),C(!1)},onDrop:async R=>{R.preventDefault(),R.stopPropagation(),B(R),C(!1)}}),No("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",x&&"bg-neutral-50",y&&!x&&"cursor-copy border-black bg-neutral-50 opacity-100",l?i("opacity-0",f&&!x&&"group-hover:opacity-100"):i(!x&&"group-hover:bg-neutral-50")),children:[ye(d,{className:i("size-7 transition-all duration-75",x?"text-neutral-400":i("text-neutral-500 group-hover:scale-110 group-active:scale-95",y?"scale-110":"scale-100"),n)}),b!==null&&ye("div",{className:i("mt-2 text-center text-sm text-neutral-500",x&&"text-neutral-400"),children:b??ye(Rd,{children:No("p",{children:["Drag and drop ",p&&"or click"," to upload."]})})}),ye("span",{className:"sr-only",children:N})]}),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:yo[s].types.join(","),onChange:B,disabled:x},w)})]})}import{X as Ld}from"lucide-react";import{AnimatePresence as Md,motion as oi}from"motion/react";import Ed from"next/link";import{isValidElement as Dd,useState as Ad}from"react";import{jsx as G,jsxs as zt}from"react/jsx-runtime";function ni({filters:e,activeFilters:t,onRemove:r,onRemoveAll:o,onSelect:a,className:n}){return De("Escape",o,{priority:1}),G(fe,{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",n),children:[G("div",{className:"flex grow flex-wrap gap-x-4 gap-y-2",children:G(Md,{children:t==null?void 0:t.map(({key:c,value:d})=>{if(c==="loader")return G(oi.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-${d}`);let m=e.find(s=>s.key===c);return m?(m.multiple&&Array.isArray(d)?d:[d]).map(s=>{var g,h,N,x;let l=(g=m.options)==null?void 0:g.find(y=>typeof y.value=="string"&&typeof s=="string"?y.value.toLowerCase()===s.toLowerCase():y.value===s),u=(l==null?void 0:l.icon)??((h=m.getOptionIcon)==null?void 0:h.call(m,s,{key:m.key,option:l}))??m.icon,p=(l==null?void 0:l.label)??((N=m.getOptionLabel)==null?void 0:N.call(m,s,{key:m.key,option:l}))??s,f=(l==null?void 0:l.permalink)??((x=m.getOptionPermalink)==null?void 0:x.call(m,s))??null,b=({className:y})=>zt("div",{className:i("flex items-center gap-2.5 px-3 py-2",y),children:[G("span",{className:"shrink-0 text-neutral-600",children:ai(u)?u:G(u,{className:"h-4 w-4"})}),f?G(Ed,{href:f,target:"_blank",className:"cursor-alias decoration-dotted underline-offset-2 hover:underline",children:ct(p,30)}):ct(p,30)]});return zt(oi.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:[G("span",{className:"shrink-0 text-neutral-600",children:ai(m.icon)?m.icon:G(m.icon,{className:"h-4 w-4"})}),m.label]}),G("div",{className:"px-3 py-2 text-neutral-500",children:"is"}),G("div",{className:"flex items-center",children:m.options?a&&!m.hideInFilterDropdown?(()=>{var w;let y=((w=m.options)==null?void 0:w.map(T=>{var R,S;let B=T.icon??((R=m.getOptionIcon)==null?void 0:R.call(m,T.value,{key:m.key,option:T}))??m.icon;return{label:T.label??((S=m.getOptionLabel)==null?void 0:S.call(m,T.value,{key:m.key,option:T}))??String(T.value),value:String(T.value),icon:B}}))??[],C=y.find(T=>typeof T.value=="string"&&typeof s=="string"?T.value.toLowerCase()===String(s).toLowerCase():T.value===String(s));return G(Id,{filter:m,value:s,filterKey:c,options:y,selectedOption:C,onRemove:r,onSelect:a,OptionDisplay:b,optionLabel:p},`${c}-${s}`)})():b({}):G("div",{className:"flex items-center gap-2.5 px-3 py-2",children:G("div",{className:"h-5 w-12 animate-pulse rounded-md bg-neutral-200"})})}),G("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(c,s),children:G(Ld,{className:"h-3.5 w-3.5"})})]},`${c}-${s}`)}):(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",G("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"})]})]})})}function Id({filter:e,value:t,filterKey:r,options:o,selectedOption:a,onRemove:n,onSelect:c,OptionDisplay:d,optionLabel:m}){let[s,l]=Ad(""),u=e.options&&e.options.length===0,p=(()=>u?s?null:G("div",{className:"p-2 text-center text-sm text-neutral-400",children:"Start typing to search..."}):G("div",{className:"p-2 text-center text-sm text-neutral-400",children:"No matching options"}))();return G(_n,{selected:a??null,setSelected:f=>{f&&f.value!==String(t)&&(n(r,t),c(r,f.value))},options:o,onSearchChange:l,onCreate:u&&c?async f=>(n(r,t),c(r,f),!0):void 0,createLabel:u?f=>f:void 0,createIcon:e.icon,optionRight:f=>{var g;if(f.value===String(t))return;let b=(g=e.options)==null?void 0:g.find(h=>typeof String(h.value)=="string"&&typeof f.value=="string"?String(h.value).toLowerCase()===f.value.toLowerCase():String(h.value)===f.value);return b?G("span",{className:"ml-2 text-neutral-500",children:b.right}):null},placeholder:ct(m,30),caret:!1,emptyState:p,trigger:d({className:"cursor-pointer hover:bg-neutral-50"})})}var ai=e=>Dd(e);import{Command as Re,useCommandState as Od}from"cmdk";import{ChevronDown as zd,ListFilter as Vd}from"lucide-react";import{Fragment as Hd,forwardRef as _d,isValidElement as ii,useCallback as Tr,useEffect as Rr,useImperativeHandle as Fd,useRef as ko,useState as wo}from"react";import{Fragment as Kd,jsx as _,jsxs as Ne}from"react/jsx-runtime";function si({filters:e,onSelect:t,onRemove:r,onOpenFilter:o,onSearchChange:a,onSelectedFilterChange:n,activeFilters:c,askAI:d,children:m,emptyState:s,className:l}){var S,Y;let{isMobile:u}=Q(),p=ko(null),f=ko(void 0),[b,g]=wo(!1);De("f",()=>g(!0),{enabled:!b});let[h,N]=wo(""),[x,y]=wo(null),C=Tr(()=>{N(""),y(null)},[]);Rr(()=>{b||C()},[b]);let w=x?e.find(({key:P})=>P===x):null,T=Tr(P=>{p.current&&(f.current={width:p.current.clientWidth,height:p.current.clientHeight}),N(""),y(P),o==null||o(P)},[]),B=Tr(P=>{if(!w||!c)return!1;let M=c.find(({key:L})=>L===x);return(M==null?void 0:M.value)===P||M&&w.multiple&&Array.isArray(M.value)&&M.value.includes(P)},[w]),R=Tr(P=>{w&&(B(P)?r(w.key,P):t(w.key,P),w.multiple||g(!1))},[c,w,d]);return Rr(()=>{a==null||a(h)},[h]),Rr(()=>{n==null||n(x)},[x]),Rr(()=>{(w==null?void 0:w.options)&&p.current&&(f.current={width:p.current.clientWidth,height:p.current.clientHeight})},[w==null?void 0:w.options]),_(xe,{openPopover:b,setOpenPopover:g,onEscapeKeyDown:P=>{x&&(P.preventDefault(),C())},content:_(fe,{width:!u,height:!0,className:"rounded-[inherit]",style:{transform:"translateZ(0)"},children:Ne(Re,{loop:!0,shouldFilter:!w||w.shouldFilter!==!1,children:[Ne("div",{className:"flex items-center overflow-hidden rounded-t-lg border-b border-neutral-200",children:[_(Wd,{placeholder:`${(w==null?void 0:w.label)||"Filter"}...`,value:h,onValueChange:N,onKeyDown:P=>{(P.key==="Escape"||P.key==="Backspace"&&!h)&&(P.preventDefault(),P.stopPropagation(),x?C():g(!1))},onEmptySubmit:P=>{P.preventDefault(),P.stopPropagation(),d?(t("ai",w?`${w.label} ${h}`:h),g(!1)):R(h)}}),!w&&_("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"})]}),_(Ud,{ref:p,children:Ne(Re.List,{className:i("flex w-full flex-col gap-1 p-1",w?"min-w-[100px]":"min-w-[180px]"),children:[w?((Y=(S=w.options)==null?void 0:S.filter(P=>!h||!P.hideDuringSearch))==null?void 0:Y.map(P=>{let M=B(P.value);return _(Co,{filter:w,option:P,right:M?_(Ta,{className:"h-4 w-4"}):P.right,onSelect:()=>R(P.value)},P.value)}))??_(Re.Loading,{children:_("div",{className:"-m-1 flex items-center justify-center",style:f.current,children:_(ue,{})})}):e.filter(P=>!P.hideInFilterDropdown).map(P=>Ne(Hd,{children:[_(Co,{filter:P,onSelect:()=>T(P.key)}),P.separatorAfter&&_(Re.Separator,{className:"-mx-1 my-1 border-b border-neutral-200"})]},P.key)),(!w||w.options)&&_($d,{search:h,selectedFilter:w,onSelect:()=>R(h),askAI:d,children:s?Bd(s)?(s==null?void 0:s[x??"default"])??"No matching options":s:"No matching options"})]})},x)]})}),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:[_(Vd,{className:"size-4 shrink-0"}),_("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-neutral-900",children:m??"Filter"}),c!=null&&c.length?_("div",{className:"flex size-4 shrink-0 items-center justify-center rounded-full bg-black text-[0.625rem] text-white",children:c.length}):_(zd,{className:"size-4 shrink-0 text-neutral-400 transition-transform duration-75 group-data-[state=open]:rotate-180"})]})})}function Bd(e){return typeof e=="object"&&e!==null&&!ii(e)}var Wd=e=>{let{onEmptySubmit:t,...r}=e,o=Od(a=>a.filtered.count===0);return _(Re.Input,{...r,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:a=>{var n;(n=e.onKeyDown)==null||n.call(e,a),a.key==="Enter"&&o&&(t==null||t(a))},autoCapitalize:"none"})},Ud=_d(({children:e},t)=>{let r=ko(null);Fd(t,()=>r.current);let{scrollProgress:o,updateScrollProgress:a}=Ee(r);return Ne(Kd,{children:[_("div",{className:"scrollbar-hide max-h-[50vh] w-screen overflow-y-scroll sm:w-auto",ref:r,onScroll:a,children:e}),_("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 Co({filter:e,option:t,right:r,onSelect:o}){var d,m;let{isMobile:a}=Q(),n=t?t.icon??((d=e.getOptionIcon)==null?void 0:d.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(Re.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:s=>{s.preventDefault()},onPointerUp:s=>{s.preventDefault(),a?setTimeout(o,100):o()},onSelect:o,value:c+(t==null?void 0:t.value),children:[_("span",{className:"shrink-0 text-neutral-600",children:Gd(n)?n:_(n,{className:"h-4 w-4"})}),ct(c,48),_("div",{className:"ml-1 flex shrink-0 grow justify-end text-neutral-500",children:r})]})}var $d=({search:e,selectedFilter:t,onSelect:r,askAI:o,children:a})=>t&&t.options&&t.options.length===0?e?_(Co,{filter:t,option:{value:e,label:e},onSelect:r}):_(Re.Empty,{className:"p-2 text-center text-sm text-neutral-400",children:"Start typing to search..."}):!t&&o&&e?Ne(Re.Empty,{className:"flex min-w-[180px] items-center space-x-2 rounded-md bg-neutral-100 px-3 py-2",children:[_(pa,{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,'"']})]})]}):_(Re.Empty,{className:"p-2 text-center text-sm text-neutral-400",children:a}),Gd=e=>ii(e);var $4={Select:si,List:ni};import{useMemo as jd,useState as li}from"react";import{jsx as qe,jsxs as Lr}from"react/jsx-runtime";function X4({title:e,description:t,inputAttrs:r,helpText:o,buttonText:a="Save Changes",disabledTooltip:n,handleSubmit:c}){let[d,m]=li(r.defaultValue),[s,l]=li(!1),u=jd(()=>s||!d||d===r.defaultValue,[s,d,r.defaultValue]);return Lr("form",{onSubmit:async p=>{p.preventDefault(),l(!0),await c({[r.name]:d}),l(!1)},className:"rounded-xl border border-neutral-200 bg-white",children:[Lr("div",{className:"relative flex flex-col space-y-6 p-6",children:[Lr("div",{className:"flex flex-col space-y-1",children:[qe("h2",{className:"text-base font-semibold",children:e}),qe("p",{className:"text-sm text-neutral-500",children:t})]}),typeof r.defaultValue=="string"?qe("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})}):qe("div",{className:"h-[2.35rem] w-full max-w-md animate-pulse rounded-md bg-neutral-200"})]}),Lr("div",{className:"flex flex-col items-start justify-between gap-4 rounded-b-xl border-t border-neutral-200 bg-neutral-50 px-5 py-4 sm:flex-row sm:items-center sm:justify-between sm:space-y-0 sm:py-3",children:[typeof o=="string"?qe("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,qe("div",{className:"w-fit shrink-0",children:qe(ee,{text:a,loading:s,disabled:u,disabledTooltip:n})})]})]})}import{useId as Yd}from"react";import{jsx as Mr,jsxs as Zd}from"react/jsx-runtime";function Xe({cellSize:e=12,strokeWidth:t=1,patternOffset:r=[0,0],className:o}){let a=Yd();return Zd("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 qd}from"lucide-react";import Xd,{useCallback as Jd,useState as Qd}from"react";import{jsx as Je,jsxs as Po}from"react/jsx-runtime";var em=Xd.forwardRef(({className:e,type:t,...r},o)=>{let[a,n]=Qd(!1),c=Jd(()=>n(!a),[a,n]);return Po("div",{children:[Po("div",{className:"relative flex",children:[Je("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}),Po("div",{className:"group",children:[r.error&&Je("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex flex-none items-center px-2.5",children:Je(qd,{className:i("size-5 text-white",t==="password"&&"transition-opacity group-hover:opacity-0"),fill:"#ef4444"})}),t==="password"&&Je("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?Je(_a,{className:"size-4 flex-none text-neutral-500 transition hover:text-neutral-700","aria-hidden":!0}):Je(Fa,{className:"size-4 flex-none text-neutral-500 transition hover:text-neutral-700","aria-hidden":!0})})]})]}),r.error&&Je("span",{className:"mt-2 block text-sm text-red-500",role:"alert","aria-live":"assertive",children:r.error})]})});em.displayName="Input";import*as So from"@radix-ui/react-label";import{cva as tm}from"class-variance-authority";import*as ci from"react";import{jsx as am}from"react/jsx-runtime";var rm=tm("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),om=ci.forwardRef(({className:e,...t},r)=>am(So.Root,{ref:r,className:i(rm(),e),...t}));om.displayName=So.Root.displayName;import{cva as nm}from"class-variance-authority";import{isValidElement as im}from"react";import{jsx as To,jsxs as di}from"react/jsx-runtime";var Ro=nm(["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 transition-colors","disabled:opacity-50 disabled:cursor-default"],{variants:{variant:{default:"text-content-default hover:bg-bg-subtle",danger:"text-content-error hover:bg-red-50 dark:hover:bg-red-950/20"},disabled:{true:"opacity-50 cursor-default text-content-disabled hover:bg-bg-default"}}});function vN({as:e,variant:t="default",children:r,icon:o,shortcut:a,className:n,disabledTooltip:c,...d}){return To(ft,{tooltipProps:{content:c},children:di(e||"button",{...e==="button"?{type:"button"}:{},className:i(Ro({variant:t,disabled:!!c}),n),disabled:c?!0:d.disabled,...d,children:[di("div",{className:"flex grow items-center gap-2",children:[o&&(sm(o)?o:To(o,{className:"size-4"})),r]}),a&&To("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 sm=e=>im(e);import{curveNatural as mi}from"@visx/curve";import{LinearGradient as ui}from"@visx/gradient";import{Group as lm}from"@visx/group";import{ParentSize as cm}from"@visx/responsive";import{scaleLinear as dm,scaleUtc as mm}from"@visx/scale";import{Area as um,AreaClosed as pm}from"@visx/shape";import{motion as pi}from"motion/react";import{useId as fm,useMemo as fi}from"react";import{jsx as we,jsxs as Lo}from"react/jsx-runtime";var gm={top:8,right:2,bottom:2,left:2};function RN(e){return we(cm,{className:"relative",children:({width:t,height:r})=>t>0&&r>0&&we(bm,{...{width:t,height:r,...e}})})}function bm({width:e,height:t,data:r,curve:o=!0,color:a,padding:n}){let c={...gm,...n},d=fm(),m=fi(()=>r.map(({date:u})=>({date:u,value:0})),[r]),{yScale:s,xScale:l}=fi(()=>{let u=r.map(({value:h})=>h),p=Math.max(...u),f=r.map(({date:h})=>h.getTime()),b=new Date(Math.min(...f)),g=new Date(Math.max(...f));return{yScale:dm({domain:[-2,Math.max(p,2)],range:[t-c.top-c.bottom,0],nice:!0,clamp:!0}),xScale:mm({domain:[b,g],range:[0,e-c.left-c.right],nice:!0})}},[r,t,e]);return Lo("svg",{width:e,height:t,children:[Lo("defs",{children:[we(ui,{id:`${d}-color-gradient`,from:a||"#7D3AEC",to:a||"#DA2778",x1:0,x2:e-c.left-c.right,gradientUnits:"userSpaceOnUse"}),we(ui,{id:`${d}-mask-gradient`,from:"white",to:"white",fromOpacity:.3,toOpacity:0,x1:0,x2:0,y1:0,y2:1}),we("mask",{id:`${d}-mask`,maskContentUnits:"objectBoundingBox",children:we("rect",{width:"1",height:"1",fill:`url(#${d}-mask-gradient)`})})]}),Lo(lm,{left:c.left,top:c.top,children:[we(um,{data:r,x:({date:u})=>l(u),y:({value:u})=>s(u)??0,curve:o?mi:void 0,children:({path:u})=>we(pi.path,{initial:{d:u(m)||"",opacity:0},animate:{d:u(r)||"",opacity:1},strokeWidth:1.5,stroke:`url(#${d}-color-gradient)`})}),we(pm,{data:r,x:({date:u})=>l(u),y:({value:u})=>s(u)??0,yScale:s,curve:o?mi:void 0,children:({path:u})=>we(pi.path,{initial:{d:u(m)||"",opacity:0},animate:{d:u(r)||"",opacity:1},fill:`url(#${d}-color-gradient)`,mask:`url(#${d}-mask)`})})]})]},r.length)}import*as se from"@radix-ui/react-dialog";import*as Mo from"@radix-ui/react-visually-hidden";import{useRouter as hm}from"next/navigation";import{Drawer as Qe}from"vaul";import{jsx as ae,jsxs as xt}from"react/jsx-runtime";function IN({children:e,className:t,showModal:r,setShowModal:o,onClose:a,desktopOnly:n,preventDefaultClose:c,drawerRootProps:d}){let m=hm(),s=({dragged:u}={})=>{c&&!u||(a&&a(),o?o(!1):m.back())},{isMobile:l}=Q();return l&&!n?ae(Qe.Root,{open:o?r:!0,onOpenChange:u=>{u||s({dragged:!0})},...d,children:xt(Qe.Portal,{children:[ae(Qe.Overlay,{className:"fixed inset-0 z-50 bg-neutral-100 bg-opacity-10 backdrop-blur"}),ae(Qe.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:xt("div",{className:"scrollbar-hide flex-1 overflow-y-auto rounded-t-[10px] bg-inherit",children:[xt(Mo.Root,{children:[ae(Qe.Title,{children:"Modal"}),ae(Qe.Description,{children:"This is a modal"})]}),ae(vm,{}),e]})}),ae(Qe.Overlay,{})]})}):ae(se.Root,{open:o?r:!0,onOpenChange:u=>{u||s()},children:xt(se.Portal,{children:[ae(se.Overlay,{id:"modal-backdrop",className:"animate-fade-in fixed inset-0 z-40 bg-neutral-100 bg-opacity-50 backdrop-blur-md"}),xt(se.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:[xt(Mo.Root,{children:[ae(se.Title,{children:"Modal"}),ae(se.Description,{children:"This is a modal"})]}),e]})]})})}function vm(){return ae("div",{className:"sticky top-0 z-20 flex items-center justify-center rounded-t-[10px] bg-inherit",children:ae("div",{className:"my-3 h-1 w-12 rounded-full bg-neutral-300"})})}import{useCallback as Eo}from"react";import{jsx as Vt,jsxs as xm}from"react/jsx-runtime";function BN({value:e,onChange:t,min:r,max:o,step:a=1,disabled:n,className:c,id:d,formatValue:m,decrementAriaLabel:s="Decrease",incrementAriaLabel:l="Increase",...u}){let p=typeof r=="number"?e>r:!0,f=typeof o=="number"?e<o:!0,b=Eo(N=>{let x=N;return typeof r=="number"&&(x=Math.max(r,x)),typeof o=="number"&&(x=Math.min(o,x)),x},[r,o]),g=Eo(()=>{n||!p||t(b(e-a))},[n,p,b,t,a,e]),h=Eo(()=>{n||!f||t(b(e+a))},[n,f,b,t,a,e]);return xm("div",{id:d,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:[Vt("button",{type:"button","aria-label":s,onClick:g,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:Vt(dr,{className:"block size-4"})}),Vt("div",{role:"spinbutton","aria-valuenow":e,"aria-valuemin":r,"aria-valuemax":o,tabIndex:0,onKeyDown:N=>{n||((N.key==="ArrowLeft"||N.key==="ArrowDown")&&(N.preventDefault(),g()),(N.key==="ArrowRight"||N.key==="ArrowUp")&&(N.preventDefault(),h()))},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}),Vt("button",{type:"button","aria-label":l,onClick:h,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:Vt(pt,{className:"block size-4"})})]})}import{Fragment as bi,jsx as yt,jsxs as Nt}from"react/jsx-runtime";var gi=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 $N({pagination:e,setPagination:t,totalCount:r,unit:o=d=>`item${d?"s":""}`,className:a,children:n,showTotalCount:c=!0}){return Nt("div",{className:i("flex items-center justify-between gap-2 text-sm leading-6 text-neutral-600",a),children:[Nt("div",{className:"flex items-center gap-2",children:[yt("div",{children:r===void 0?yt("div",{className:"h-5 w-24 animate-pulse rounded-lg bg-neutral-200"}):Nt(bi,{children:[yt("span",{className:"hidden sm:inline-block",children:"Viewing"})," ",r>0&&Nt(bi,{children:[Nt("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&&yt("span",{className:"font-medium",children:r.toLocaleString()})," ",typeof o=="function"?o(r!==1):o]})}),n]}),Nt("div",{className:"flex items-center gap-2",children:[yt("button",{type:"button",className:gi,onClick:()=>t({...e,pageIndex:e.pageIndex-1}),disabled:e.pageIndex===1,children:"Previous"}),yt("button",{type:"button",className:gi,onClick:()=>t({...e,pageIndex:e.pageIndex+1}),disabled:!r||(e.pageIndex-1)*e.pageSize+e.pageSize>=r,children:"Next"})]})]})}import{jsx as hi,jsxs as ym}from"react/jsx-runtime";function jN({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 ym("svg",{width:"100",height:"100",viewBox:"0 0 100 100",className:i("size-3 shrink-0 text-green-600 [--track-color:#e5e5e5]",r),children:[hi("circle",{cx:"50",cy:"50",r:a,strokeWidth:`${t}px`,fill:"none",strokeLinecap:"round",className:"stroke-[var(--track-color)]"}),o>0&&hi("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 Ve from"@radix-ui/react-radio-group";import{Circle as Nm}from"lucide-react";import*as Do from"react";import{jsx as Er}from"react/jsx-runtime";var wm=Do.forwardRef(({className:e,...t},r)=>Er(Ve.Root,{className:i("grid gap-2",e),...t,ref:r}));wm.displayName=Ve.Root.displayName;var km=Do.forwardRef(({className:e,...t},r)=>Er(Ve.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:Er(Ve.Indicator,{className:"flex items-center justify-center",children:Er(Nm,{className:"h-2.5 w-2.5 fill-current text-current"})})}));km.displayName=Ve.Item.displayName;import{Drawer as He}from"vaul";import{jsx as et,jsxs as Rm}from"react/jsx-runtime";function Cm({children:e,contentProps:t,nested:r=!1,...o}){let a=r?He.NestedRoot:He.Root;return et(a,{direction:"right",handleOnly:!0,...o,children:Rm(He.Portal,{children:[et(He.Overlay,{className:"fixed inset-0 z-40 bg-black/20","data-sheet-overlay":!0}),et(He.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("@container/sheet fixed bottom-2 right-2 top-2 z-40 flex outline-none","w-[min(var(--sheet-width),calc(100%-2*var(--sheet-margin)))] [--sheet-margin:8px] [--sheet-width:540px]",t==null?void 0:t.className),style:{"--initial-transform":"calc(100% + 8px)",userSelect:"auto",...t==null?void 0:t.style},children:et("div",{className:"scrollbar-hide flex size-full grow flex-col overflow-y-auto rounded-xl bg-white",children:e})})]})})}function Pm({className:e,...t}){return et(He.Title,{className:i("text-lg font-semibold text-neutral-900",e),...t})}function Sm(e){return et(He.Description,{...e})}function Tm(e){return et(He.Close,{...e})}var t3=Object.assign(Cm,{Title:Pm,Description:Sm,Close:Tm});import{useEffect as Lm,useRef as Mm,useState as Em}from"react";import{jsx as vi}from"react/jsx-runtime";var Dm=`
2
+ import{$ as S0,$a as la,$b as sb,$c as Ea,$d as Fh,$e as Dv,A as l0,Aa as X0,Ab as zg,Ac as Rb,Ad as gh,Ae as uv,B as c0,Ba as J0,Bb as Fg,Bc as Lb,Bd as bh,Be as Va,C as Sr,Ca as Q0,Cb as _g,Cc as ka,Cd as hh,Ce as za,D as d0,Da as eg,Db as Hg,Dc as Mb,Dd as vh,De as Fa,E as u0,Ea as tg,Eb as $g,Ec as Eb,Ed as xh,Ee as _a,F as Tr,Fa as Mr,Fb as Bg,Fc as Ca,Fd as yh,Fe as Ha,G as m0,Ga as rg,Gb as Wg,Gc as Db,Gd as Nh,Ge as mv,H as p0,Ha as og,Hb as Ug,Hc as Pa,Hd as Ia,He as pv,I as f0,Ia as ng,Ib as Gg,Ic as Ib,Id as wh,Ie as fv,J as g0,Ja as ag,Jb as Kg,Jc as Ab,Jd as kh,Je as gv,K as b0,Ka as aa,Kb as jg,Kc as Ob,Kd as Ch,Ke as bv,L as Rr,La as ig,Lb as ga,Lc as Vb,Ld as Ph,Le as hv,M as h0,Ma as sg,Mb as Yg,Mc as zb,Md as Sh,Me as vv,N as Lr,Na as ia,Nb as qg,Nc as Sa,Nd as Th,Ne as xv,O as v0,Oa as lg,Ob as Zg,Oc as Ta,Od as Rh,Oe as yv,P as x0,Pa as cg,Pb as Dr,Pc as Fb,Pd as Lh,Pe as Nv,Q as y0,Qa as dg,Qb as Xg,Qc as _b,Qd as Rt,Qe as wv,R as N0,Ra as ug,Rb as Jg,Rc as Hb,Rd as Mh,Re as kv,S as w0,Sa as mg,Sb as Qg,Sc as $b,Sd as Eh,Se as Cv,T as k0,Ta as pg,Tb as eb,Tc as Bb,Td as Dh,Te as Pv,U as C0,Ua as fg,Ub as tb,Uc as Ra,Ud as Ih,Ue as Sv,V as P0,Va as gg,Vb as ba,Vc as Wb,Vd as Ah,Ve as Tv,W as Jn,Wa as bg,Wb as rb,Wc as La,Wd as Aa,We as Rv,X as Qn,Xa as hg,Xb as ob,Xc as Ma,Xd as Oh,Xe as Kt,Y as ea,Ya as Tt,Yb as nb,Yc as Ub,Yd as Vh,Ye as Lv,Z as ta,Za as Er,Zb as ab,Zc as Gb,Zd as Oa,Ze as Mv,_ as ra,_a as sa,_b as ib,_c as Kb,_d as zh,_e as Ev,a as Zf,aa as T0,ab as vg,ac as ha,ad as Da,ae as _h,af as $a,b as Un,ba as R0,bb as xg,bc as lb,bd as jb,be as Hh,bf as Iv,c as Xf,ca as L0,cb as yg,cc as va,cd as Yb,ce as $h,cf as Av,d as Ct,da as M0,db as Ng,dc as xa,dd as qb,de as Bh,df as Ov,e as Pr,ea as E0,eb as ca,ec as cb,ed as Zb,ee as Wh,ef as Vv,f as Jf,fa as D0,fb as da,fc as ya,fd as Xb,fe as Uh,ff as zv,g as Pt,ga as I0,gb as wg,gc as db,gd as Ir,ge as Gh,gf as Fv,h as St,ha as A0,hb as kg,hc as ub,hd as Jb,he as Kh,hf as _v,i as To,ia as O0,ib as Cg,ic as mb,id as Qb,ie as jh,if as Hv,j as Gn,ja as V0,jb as Pg,jc as pb,jd as eh,je as Yh,k as Qf,ka as z0,kb as ua,kc as fb,kd as th,ke as qh,l as e0,la as F0,lb as ma,lc as gb,ld as rh,le as Zh,m as t0,ma as _0,mb as pa,mc as bb,md as oh,me as Xh,n as r0,na as H0,nb as Sg,nc as Na,nd as nh,ne as Jh,o as Kn,oa as $0,ob as Tg,oc as hb,od as ah,oe as Qh,p as o0,pa as B0,pb as Rg,pc as vb,pd as ih,pe as ev,q as n0,qa as W0,qb as Lg,qc as xb,qd as sh,qe as tv,r as jn,ra as U0,rb as Mg,rc as yb,rd as lh,re as rv,s as Yn,sa as G0,sb as Ro,sc as Nb,sd as ch,se as ov,t as qn,ta as oa,tb as Eg,tc as wb,td as dh,te as nv,u as Zn,ua as K0,ub as Dg,uc as kb,ud as uh,ue as av,v as a0,va as j0,vb as Ig,vc as Cb,vd as Ar,ve as iv,w as Xn,wa as na,wb as Ag,wc as Pb,wd as Or,we as sv,x as i0,xa as Y0,xb as fa,xc as Sb,xd as mh,xe as lv,y as ae,ya as q0,yb as Og,yc as wa,yd as ph,ye as cv,z as s0,za as Z0,zb as Vg,zc as Tb,zd as fh,ze as dv}from"./chunk-F7TP4G6Z.mjs";import{a as ie}from"./chunk-NWME2ANF.mjs";import{a as En,b as K,c as Dn,d as In,e as Ie,f as An,g as On,h as Vn,i as zn,j as Fn,k as _n,l as Po,m as Gt,n as Hn,o as kt,p as $n,q as Bn,r as Ce,s as Pe,t as Cr,u as i,w as So,x as Wn}from"./chunk-DERIUHV5.mjs";import*as pe from"@radix-ui/react-accordion";import{ChevronDown as tl}from"lucide-react";import*as zr from"react";import{jsx as Vr,jsxs as al}from"react/jsx-runtime";var Kv=pe.Root,rl=zr.forwardRef(({className:e,...t},r)=>Vr(pe.Item,{ref:r,className:i("border-b border-b-slate-200 py-3 last:border-none",e),...t}));rl.displayName="AccordionItem";var ol=zr.forwardRef(({className:e,children:t,variant:r="chevron",...o},n)=>{let a=r==="chevron"?tl:Rt;return Vr(pe.Header,{className:"flex",children:al(pe.Trigger,{ref:n,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,Vr(a,{className:"h-5 w-5 flex-none transition-transform duration-300"})]})})});ol.displayName=pe.Trigger.displayName;var nl=zr.forwardRef(({className:e,children:t,...r},o)=>Vr(pe.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}));nl.displayName=pe.Content.displayName;import{useMemo as Fr}from"react";import{jsx as Se,jsxs as Ua}from"react/jsx-runtime";var Ae={positive:"#00C951",negative:"#FB2C36",neutral:"#e5e5e5",positiveIcon:"#166534",negativeIcon:"#991b1b",neutralIcon:"#262626"},Ne=15,Lt=30;function Mt(e,t,r,o){let n=(o-90)*Math.PI/180;return{x:e+r*Math.cos(n),y:t+r*Math.sin(n)}}function Ba(e,t,r,o,n){let a=Mt(e,t,r,o),c=Mt(e,t,r,n),m=n-o>180?1:0;return`M ${a.x} ${a.y} A ${r} ${r} 0 ${m} 1 ${c.x} ${c.y}`}function Wa(e,t,r,o,n,a){let c=Mt(e,t,r,n),l=Mt(e,t,r,a),m=Mt(e,t,o,n),d=Mt(e,t,o,a),u=a-n>180?1:0;return[`M ${c.x} ${c.y}`,`A ${r} ${r} 0 ${u} 1 ${l.x} ${l.y}`,`L ${d.x} ${d.y}`,`A ${o} ${o} 0 ${u} 0 ${m.x} ${m.y}`,"Z"].join(" ")}function Jv({positiveValue:e,negativeValue:t,size:r=40,positiveIcon:o,negativeIcon:n,neutralIcon:a,className:c}){let l=Fr(()=>e>t?"positive":t>e?"negative":"neutral",[e,t]),{positiveArc:m,negativeArc:d,showOnlyPositive:s,showOnlyNegative:u}=Fr(()=>{let L=e+t,w=360-Ne*2;if(L===0){let S=w/2;return{positiveArc:{start:Ne/2,end:Ne/2+S},negativeArc:{start:180+Ne/2,end:180+Ne/2+S},showOnlyPositive:!1,showOnlyNegative:!1}}if(e===0)return{positiveArc:{start:0,end:0},negativeArc:{start:0,end:360},showOnlyPositive:!1,showOnlyNegative:!0};if(t===0)return{positiveArc:{start:0,end:360},negativeArc:{start:0,end:0},showOnlyPositive:!0,showOnlyNegative:!1};let A=e/L,T=A*w,R=(1-A)*w;return e>0&&T<Lt&&(T=Lt,R=w-Lt),t>0&&R<Lt&&(R=Lt,T=w-Lt),{positiveArc:{start:Ne/2,end:Ne/2+T},negativeArc:{start:Ne/2+T+Ne,end:Ne/2+T+Ne+R},showOnlyPositive:!1,showOnlyNegative:!1}},[e,t]),p=r/2,f=3,b=(r-f)/2,g=b-f/2,v=r*.28,C=Fr(()=>{switch(l){case"positive":return o;case"negative":return n;default:return a}},[l,o,n,a]),x=Fr(()=>{switch(l){case"positive":return Ae.positiveIcon;case"negative":return Ae.negativeIcon;default:return Ae.neutralIcon}},[l]),N=Ae.positive,y=Ae.negative;return Ua("div",{className:i("relative shrink-0",c),style:{width:r,height:r},children:[Ua("svg",{width:r,height:r,viewBox:`0 0 ${r} ${r}`,children:[s&&Se("circle",{cx:p,cy:p,r:(g+v)/2,fill:"none",stroke:Ae.positive,strokeWidth:g-v,opacity:.1}),u&&Se("circle",{cx:p,cy:p,r:(g+v)/2,fill:"none",stroke:Ae.negative,strokeWidth:g-v,opacity:.1}),e>0&&!s&&Se("path",{d:Wa(p,p,g,v,m.start,m.end),fill:Ae.positive,opacity:.1}),t>0&&!u&&Se("path",{d:Wa(p,p,g,v,d.start,d.end),fill:Ae.negative,opacity:.1}),s&&Se("circle",{cx:p,cy:p,r:b,fill:"none",stroke:N,strokeWidth:f}),u&&Se("circle",{cx:p,cy:p,r:b,fill:"none",stroke:y,strokeWidth:f}),!s&&!u&&Se("path",{d:Ba(p,p,b,m.start,m.end),stroke:N,strokeWidth:f,fill:"none",strokeLinecap:"round"}),!s&&!u&&Se("path",{d:Ba(p,p,b,d.start,d.end),stroke:y,strokeWidth:f,fill:"none",strokeLinecap:"round"})]}),C&&Se("div",{className:"absolute inset-0 flex items-center justify-center",style:{color:x},children:Se(C,{className:"size-3.5"})})]})}import{cva as il}from"class-variance-authority";import*as _r from"react";import{jsx as Lo}from"react/jsx-runtime";var sl=il("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"}}),ll=_r.forwardRef(({className:e,variant:t,...r},o)=>Lo("div",{ref:o,role:"alert",className:i(sl({variant:t}),e),...r}));ll.displayName="Alert";var cl=_r.forwardRef(({className:e,...t},r)=>Lo("h5",{ref:r,className:i("text-md mb-2 font-medium leading-none tracking-tight",e),...t}));cl.displayName="AlertTitle";var dl=_r.forwardRef(({className:e,...t},r)=>Lo("div",{ref:r,className:i("text-sm [&_p]:leading-relaxed",e),...t}));dl.displayName="AlertDescription";import{jsx as Hr,jsxs as pl}from"react/jsx-runtime";var ul={backgroundImage:"linear-gradient(135deg, rgba(255,255,255,0) 0%, rgba(0,0,0,0.2) 100%)",boxShadow:"inset 6px -5px 11px rgba(0,0,0,0.13), inset -18px -12px 19px rgba(255,255,255,0.4)"},ml={backgroundImage:"linear-gradient(135deg, rgba(255,255,255,0) 0%, rgba(0,0,0,0.2) 100%)",boxShadow:"inset 10px -12px 19px rgba(0,0,0,0.4), inset -18px -12px 19px rgba(255,255,255,0.4), inset 2px -1px 11px rgba(0,0,0,0.1)"};function n1({imageUrl:e,identifier:t,className:r}){if(e)return Hr("img",{src:e,alt:t,className:i("shrink-0 rounded-full",r)});let o=Wn(t);return Hr("div",{className:i("relative shrink-0 overflow-hidden rounded-full",r),style:{background:o.bg},role:"img","aria-label":t,children:pl("div",{className:"absolute left-0 top-0 h-full w-full",children:[Hr("div",{className:"absolute left-[30%] top-[22%] aspect-square w-[40%] rounded-full",style:{background:o.fg,...ul}}),Hr("div",{className:"absolute left-[10%] top-[70%] h-[40%] w-[80%] rounded-t-full",style:{background:o.fg,...ml}})]})})}import{cva as fl}from"class-variance-authority";import{jsx as bl}from"react/jsx-runtime";var gl=fl("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 Ga({className:e,variant:t,...r}){return bl("span",{className:i(gl({variant:t}),e),...r})}import{cva as lc}from"class-variance-authority";import{forwardRef as cc}from"react";import*as Te from"@radix-ui/react-tooltip";import{HelpCircle as oc}from"lucide-react";import nc from"next/link";import{useEffect as ac,useRef as ic,useState as Oo}from"react";import sc from"react-markdown";import{useCallback as xl,useEffect as yl,useState as Nl}from"react";import{useEffect as hl,useState as vl}from"react";function $r(e){let[t,r]=vl(),o=([n])=>{r(n)};return hl(()=>{let n=e==null?void 0:e.current;if(!n)return;let a=new ResizeObserver(o);return a.observe(n),()=>a.disconnect()},[e]),t}function Ue(e,{direction:t="vertical"}={}){let[r,o]=Nl(1),n=xl(()=>{if(!e.current)return;let c=t==="vertical"?e.current.scrollTop:e.current.scrollLeft,l=t==="vertical"?e.current.scrollHeight:e.current.scrollWidth,m=t==="vertical"?e.current.clientHeight:e.current.clientWidth;o(l===m?1:Math.min(c/(l-m),1))},[t]),a=$r(e);return yl(n,[a]),{scrollProgress:r,updateScrollProgress:n}}import{EditorContent as tc}from"@tiptap/react";import Vl from"@tiptap/extension-file-handler";import zl from"@tiptap/extension-image";import Fl from"@tiptap/extension-link";import _l from"@tiptap/extension-mention";import{Placeholder as Hl}from"@tiptap/extensions";import{Markdown as $l}from"@tiptap/markdown";import{useEditor as Bl}from"@tiptap/react";import Wl from"@tiptap/starter-kit";import{createContext as Ul,forwardRef as Gl,useContext as Kl,useImperativeHandle as jl,useMemo as Yl,useState as ql}from"react";import{computePosition as Sl,flip as Tl,shift as Rl}from"@floating-ui/dom";import{posToDOMRect as Ll,ReactRenderer as Ml}from"@tiptap/react";import{forwardRef as El,useEffect as Dl,useImperativeHandle as Il,useRef as Al,useState as Do}from"react";import{AlertCircle as wl}from"lucide-react";import kl,{useCallback as Cl,useState as Pl}from"react";import{jsx as it,jsxs as Mo}from"react/jsx-runtime";var Eo=kl.forwardRef(({className:e,type:t,...r},o)=>{let[n,a]=Pl(!1),c=Cl(()=>a(!n),[n,a]);return Mo("div",{children:[Mo("div",{className:"relative flex",children:[it("input",{type:n?"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}),Mo("div",{className:"group",children:[r.error&&it("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex flex-none items-center px-2.5",children:it(wl,{className:i("size-5 text-white",t==="password"&&"transition-opacity group-hover:opacity-0"),fill:"#ef4444"})}),t==="password"&&it("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":n?"Hide password":"Show Password",children:n?it(va,{className:"size-4 flex-none text-neutral-500 transition hover:text-neutral-700","aria-hidden":!0}):it(xa,{className:"size-4 flex-none text-neutral-500 transition hover:text-neutral-700","aria-hidden":!0})})]})]}),r.error&&it("span",{className:"mt-2 block text-sm text-red-500",role:"alert","aria-live":"assertive",children:r.error})]})});Eo.displayName="Input";import{jsx as st,jsxs as Br}from"react/jsx-runtime";var Ka=(e,t)=>{Sl({getBoundingClientRect:()=>Ll(e.view,e.state.selection.from,e.state.selection.to)},t,{placement:"bottom-start",strategy:"absolute",middleware:[Rl(),Tl()]}).then(({x:o,y:n,strategy:a})=>{t.style.width="max-content",t.style.position=a,t.style.left=`${o}px`,t.style.top=`${n}px`})},Ya=e=>({items:({query:t})=>{let r=t.trim().toLowerCase();return r?e.filter(o=>o.toLowerCase().includes(r)).sort((o,n)=>{let a=o.toLowerCase(),c=n.toLowerCase(),l=a.startsWith(r)?0:1,m=c.startsWith(r)?0:1;return l!==m?l-m:o.localeCompare(n)}).slice(0,5):e.slice(0,5)},render:()=>{let t;return{onStart:r=>{t=new Ml(Ol,{props:r,editor:r.editor}),r.clientRect&&(t.element.style.position="absolute",document.body.appendChild(t.element),Ka(r.editor,t.element))},onUpdate(r){t.updateProps(r),r.clientRect&&Ka(r.editor,t.element)},onKeyDown(r){var n;return((n=t.ref)==null?void 0:n.onKeyDown(r))?!0:r.event.key==="Escape"?(t.destroy(),!0):!1},onExit(){t.element.remove(),t.destroy()}}}}),ja=i("flex cursor-pointer select-none items-center gap-2 whitespace-nowrap rounded-md px-2 py-1 font-mono text-sm text-neutral-950","data-[selected=true]:bg-neutral-100"),Ol=El(({items:e,command:t},r)=>{let[o,n]=Do(0),[a,c]=Do(null),[l,m]=Do(""),d=Al(null),s=()=>{n((o+e.length-1)%e.length)},u=()=>{n((o+1)%e.length)},p=g=>{if(g!=="PartnerName"){t({id:g,fallback:null});return}c(g),m("")},f=()=>{!a||t({id:a,fallback:l.trim()||null})},b=()=>{c(null),m("")};return Dl(()=>n(0),[e]),Il(r,()=>({onKeyDown:({event:g})=>a?g.key==="Enter"?(g.preventDefault(),f(),!0):g.key==="Escape"?(b(),!0):!1:g.key==="ArrowUp"?(s(),!0):g.key==="ArrowDown"?(u(),!0):g.key==="Enter"&&e.length>0&&o>=0&&o<e.length?(p(e[o]),!0):!1})),a?Br("div",{className:"border-border-subtle flex w-64 flex-col gap-2 rounded-lg border bg-white p-2 shadow-sm",children:[st("span",{className:"w-fit rounded bg-blue-100 px-1 py-0.5 font-mono text-xs font-semibold text-blue-700",children:a}),Br("div",{className:"flex flex-col gap-1",children:[st(Eo,{ref:g=>{d.current=g,g==null||g.focus()},value:l,onChange:g=>m(g.target.value),onKeyDown:g=>{g.key==="Enter"?(g.preventDefault(),f()):g.key==="Escape"&&b()},placeholder:"Fallback (optional)",className:"h-8 rounded-lg"}),Br("p",{className:"text-content-subtle text-xs",children:["Used only if ",a," is missing."]})]}),Br("div",{className:"flex justify-end gap-1",children:[st(Q,{text:"Back",variant:"secondary",className:"h-7 w-fit rounded-lg px-3 py-2 text-sm",onClick:b}),st(Q,{text:"Confirm",variant:"primary",className:"h-7 w-fit rounded-lg px-3 py-2 text-sm",onClick:f})]})]}):st("div",{className:"border-border-subtle flex flex-col rounded-lg border bg-white p-1 shadow-sm",children:e.length?e.map((g,v)=>st("button",{type:"button",onMouseDown:C=>C.preventDefault(),onClick:()=>p(g),"data-selected":o===v,onPointerEnter:()=>n(v),className:ja,children:g},v)):st("div",{className:i(ja,"text-content-subtle font-sans"),children:"No results"})})});import{jsx as Xl}from"react/jsx-runtime";var Io={default:"prose-p:my-2 prose-ul:my-2 prose-ol:my-2",condensed:"prose-p:my-0 prose-ul:my-2 prose-ol:my-2",chat:"prose-p:my-0 prose-ul:my-2 prose-ol:my-2 [&_p+p]:mt-2",relaxed:""},Zl=["images","variables","links","headings","bold","italic","strike"],qa=Ul(null),B1=Gl(({children:e,features:t=Zl,markdown:r=!1,style:o="default",placeholder:n="Start typing...",uploadImage:a,editable:c,autoFocus:l,variables:m,initialValue:d,onChange:s,editorProps:u,editorClassName:p},f)=>{let[b,g]=ql(!1),v=Yl(()=>a?async(x,N,y)=>{g(!0);let L=await(a==null?void 0:a(x));if(!L){g(!1);return}N.chain().insertContentAt(y,{type:"image",attrs:{src:L}}).focus().run(),g(!1)}:null,[a]),C=Bl({editable:c??!0,autofocus:l?"end":!1,extensions:[...r?[$l]:[],Wl.configure({heading:t.includes("headings")?{levels:[1,2]}:!1,bold:t.includes("bold")?void 0:!1,italic:t.includes("italic")?void 0:!1,strike:t.includes("strike")?void 0:!1,link:!1}),...t.includes("links")?[Fl.extend({inclusive:!1})]:[],Hl.configure({placeholder:n,emptyEditorClass:"before:content-[attr(data-placeholder)] before:float-left before:text-content-muted before:h-0 before:pointer-events-none"}),...t.includes("images")&&v?[zl.configure({inline:!1,HTMLAttributes:{class:"rounded-lg max-w-full h-auto"}}),Vl.configure({allowedMimeTypes:["image/png","image/jpeg","image/gif","image/webp"],onDrop:(x,N,y)=>{N.forEach(L=>v(L,x,y))},onPaste:(x,N,y)=>{if(y)return!1;N.forEach(L=>v(L,x,x.state.selection.anchor))}})]:[],...t.includes("variables")&&m?[_l.extend({addAttributes(){var x;return{...(x=this.parent)==null?void 0:x.call(this),fallback:{default:null,parseHTML:N=>N.getAttribute("data-fallback"),renderHTML:N=>N.fallback?{"data-fallback":N.fallback}:{}}}},renderHTML({node:x}){let N=x.attrs.fallback?`{{${x.attrs.id} | ${x.attrs.fallback}}}`:`{{${x.attrs.id}}}`;return["span",{class:"px-1 py-0.5 bg-blue-100 text-blue-700 rounded font-semibold","data-type":"mention","data-id":x.attrs.id,...x.attrs.fallback?{"data-fallback":x.attrs.fallback}:{}},N]},renderText({node:x}){return x.attrs.fallback?`{{${x.attrs.id} | ${x.attrs.fallback}}}`:`{{${x.attrs.id}}}`}}).configure({suggestion:Ya(m)})]:[]],editorProps:{attributes:{...u==null?void 0:u.attributes,class:i("max-w-none focus:outline-none","prose prose-sm prose-neutral",Io[o],"[&_.ProseMirror-selectednode]:outline [&_.ProseMirror-selectednode]:outline-2 [&_.ProseMirror-selectednode]:outline-blue-500 [&_.ProseMirror-selectednode]:outline-offset-2",p)},...u},content:d,contentType:r?"markdown":void 0,onUpdate:({editor:x})=>s==null?void 0:s(x),immediatelyRender:!1});return jl(f,()=>({setContent:x=>{C==null||C.commands.setContent(x)}})),Xl(qa.Provider,{value:{features:t,markdown:r,editable:c,variables:m,editor:C,isUploading:b,handleImageUpload:v},children:e})});function jt(){let e=Kl(qa);if(!e)throw new Error("useRichTextContext must be used within a RichTextProvider");return e}import{useEditorState as Xa}from"@tiptap/react";import{forwardRef as Jl,useRef as Ql}from"react";import{Fragment as Za,jsx as fe,jsxs as Wr}from"react/jsx-runtime";function X1({toolsStart:e,toolsEnd:t,className:r}){let{editor:o,features:n,handleImageUpload:a,isUploading:c}=jt(),l=Xa({editor:o,selector:({editor:d})=>({isBold:Boolean(d==null?void 0:d.isActive("bold")),isItalic:Boolean(d==null?void 0:d.isActive("italic")),isStrike:Boolean(d==null?void 0:d.isActive("strike")),isHeading1:Boolean(d==null?void 0:d.isActive("heading",{level:1})),isHeading2:Boolean(d==null?void 0:d.isActive("heading",{level:2})),isSelection:(d==null?void 0:d.state.selection.from)!==(d==null?void 0:d.state.selection.to)})}),m=Ql(null);return Wr("div",{className:i("flex gap-1",c&&"pointer-events-none opacity-50",r),children:[e,(n==null?void 0:n.includes("bold"))&&fe(Ge,{icon:Va,label:"Bold",isActive:l==null?void 0:l.isBold,onClick:()=>o==null?void 0:o.chain().focus().toggleBold().run()}),(n==null?void 0:n.includes("italic"))&&fe(Ge,{icon:za,label:"Italic",isActive:l==null?void 0:l.isItalic,onClick:()=>o==null?void 0:o.chain().focus().toggleItalic().run()}),(n==null?void 0:n.includes("strike"))&&fe(Ge,{icon:Fa,label:"Strikethrough",isActive:l==null?void 0:l.isStrike,onClick:()=>o==null?void 0:o.chain().focus().toggleStrike().run()}),(n==null?void 0:n.includes("headings"))&&Wr(Za,{children:[fe(Ge,{icon:Sa,label:"Heading 1",isActive:l==null?void 0:l.isHeading1,onClick:()=>o==null?void 0:o.chain().focus().toggleHeading({level:1}).run()}),fe(Ge,{icon:Ta,label:"Heading 2",isActive:l==null?void 0:l.isHeading2,onClick:()=>o==null?void 0:o.chain().focus().toggleHeading({level:2}).run()})]}),(n==null?void 0:n.includes("links"))&&fe(ec,{}),(n==null?void 0:n.includes("variables"))&&fe(Ge,{icon:na,label:"Variable",isActive:!1,onClick:()=>{var d,s;if((s=(d=o==null?void 0:o.state.selection.$from.nodeBefore)==null?void 0:d.text)!=null&&s.endsWith("@")){o==null||o.commands.focus();return}o==null||o.chain().focus().insertContent("@").run()}}),(n==null?void 0:n.includes("images"))&&a&&o&&Wr(Za,{children:[fe("input",{ref:m,type:"file",className:"hidden",onChange:d=>{var u;let s=(u=d.target.files)==null?void 0:u[0];!s||(a(s,o,o.state.selection.anchor),d.target.value="")}}),fe(Ge,{icon:La,label:"Image",isActive:!1,onClick:()=>{var d;return(d=m.current)==null?void 0:d.click()}})]}),t]})}function ec(){let{editor:e}=jt(),t=Xa({editor:e,selector:({editor:r})=>({isSelection:(r==null?void 0:r.state.selection.from)!==(r==null?void 0:r.state.selection.to)})});return fe(Ge,{icon:Ra,label:"Link",onClick:()=>{if(!e)return;let r=e.getAttributes("link").href,o=window.prompt("Link URL",r);if(!(o!=null&&o.trim())){e.chain().focus().extendMarkRange("link").unsetLink().run();return}e.chain().focus().extendMarkRange("link").setLink({href:o}).run()},disabled:!(t!=null&&t.isSelection)})}var Ge=Jl(({icon:e,label:t,isActive:r,onClick:o,disabled:n},a)=>Wr("button",{ref:a,type:"button",onClick:o,disabled:n,className:i("flex size-8 items-center justify-center rounded-md transition-colors duration-150 disabled:opacity-50",r?"bg-neutral-200":"hover:bg-neutral-50 active:bg-neutral-100"),title:t,children:[fe(e,{className:"size-4 shrink-0 text-neutral-700"}),t&&fe("span",{className:"sr-only",children:t})]}));import{jsx as Ao,jsxs as rc}from"react/jsx-runtime";function nx({className:e,...t}){let{editor:r,isUploading:o}=jt();return rc("div",{className:i("relative",o&&"pointer-events-none opacity-50",e),children:[Ao(tc,{editor:r,...t}),o&&Ao("div",{className:"absolute inset-0 flex items-center justify-center",children:Ao(ae,{className:"size-4"})})]})}import{jsx as j,jsxs as Vo}from"react/jsx-runtime";function xx({children:e}){return j(Te.Provider,{delayDuration:150,children:e})}var Ja=({className:e,children:t})=>j(sc,{className:i("prose prose-sm prose-neutral max-w-xs text-pretty px-4 py-2 text-center leading-snug transition-all","prose-a:cursor-alias prose-a:underline prose-a:decoration-dotted prose-a:underline-offset-2","prose-code:inline-block prose-code:leading-none",Io.condensed,e),components:{a:({node:r,...o})=>j("a",{...o,target:"_blank",rel:"noopener noreferrer",onClick:n=>n.stopPropagation()}),code:({node:r,...o})=>j("code",{...o,className:"rounded-md bg-neutral-100 px-1 py-0.5"})},children:t});function J({children:e,content:t,contentClassName:r,disabled:o,side:n="top",disableHoverableContent:a,delayDuration:c=0,...l}){let[m,d]=Oo(!1);return Vo(Te.Root,{open:o?!1:m,onOpenChange:d,delayDuration:c,disableHoverableContent:a,children:[j(Te.Trigger,{asChild:!0,onClick:()=>{d(!0)},onBlur:()=>{d(!1)},children:e}),j(Te.Portal,{children:j(Te.Content,{sideOffset:8,side:n,className:"animate-slide-up-fade border-border-default bg-bg-default pointer-events-auto z-[99] items-center overflow-hidden rounded-xl border shadow-sm",collisionPadding:0,...l,children:typeof t=="string"?j(Ja,{className:r,children:t}):typeof t=="function"?t({setOpen:d}):t})})]})}function yx({title:e,cta:t,href:r,target:o,onClick:n}){return Vo("div",{className:"flex max-w-xs flex-col items-center space-y-3 p-4 text-center",children:[j(Ja,{className:"p-0",children:e}),t&&(r?j(nc,{href:r,...o?{target:o}:{},className:i(ge({variant:"primary"}),"flex h-8 w-full items-center justify-center whitespace-nowrap rounded-lg border px-4 text-sm"),children:t}):n?j(Q,{onClick:n,text:t,variant:"primary",className:"h-8"}):null)]})}function Nx(e){return j(J,{...e,children:j(oc,{className:"h-4 w-4 text-neutral-500"})})}function wx({children:e,content:t,...r}){return j(J,{content:t,...r,children:j("div",{className:"flex cursor-pointer items-center",children:j(Ga,{variant:"gray",className:"border-neutral-300 transition-all hover:bg-neutral-200",children:e})})})}function kx({children:e,tooltipProps:t,...r}){return j(J,{...t,children:j("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 Et({children:e,tooltipProps:t}){return t?j(J,{...t,children:j("div",{children:e})}):e}function Cx({children:e,maxHeight:t="240px",className:r}){let o=ic(null),{scrollProgress:n,updateScrollProgress:a}=Ue(o,{direction:"vertical"}),[c,l]=Oo(!1),[m,d]=Oo(!1);return ac(()=>{let s=o.current;if(!s)return;let{scrollHeight:u,clientHeight:p}=s,f=u>p;l(f&&n>0),d(f&&n<1)},[n]),Vo("div",{className:"relative",children:[c&&j("div",{className:"pointer-events-none absolute left-0 right-0 top-0 z-10 h-6 rounded-t-xl bg-gradient-to-b from-white to-transparent"}),j("div",{ref:o,onScroll:a,className:i("flex flex-col gap-2 overflow-y-auto px-3 py-2",r),style:{maxHeight:t},children:e}),m&&j("div",{className:"pointer-events-none absolute bottom-0 left-0 right-0 z-10 h-6 rounded-b-xl bg-gradient-to-t from-white to-transparent"})]})}import{jsx as Dt,jsxs as Qa}from"react/jsx-runtime";var ge=lc("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-bg-default 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-neutral-900/5",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"}}),Q=cc(({text:e,variant:t="primary",className:r,textWrapperClassName:o,shortcutClassName:n,loading:a,icon:c,shortcut:l,disabledTooltip:m,right:d,...s},u)=>m?Dt(J,{content:m,children:Qa("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&&Dt("div",{className:i("min-w-0 truncate",l&&"flex-1 text-left",o),children:e}),l&&Dt("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")},n),children:l})]})}):Qa("button",{ref:u,type:s.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",s.disabled||a?"border-border-subtle bg-bg-subtle text-content-subtle cursor-not-allowed outline-none":ge({variant:t}),r),disabled:s.disabled||a,...s,children:[a?Dt(ae,{}):c||null,e&&Dt("div",{className:i("min-w-0 truncate",l&&"flex-1 text-left",o),children:e}),l&&Dt("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-400 text-white":t==="danger","bg-red-100 text-red-600 group-hover:bg-red-500 group-hover:text-white":t==="danger-outline"},n),children:l}),d]}));Q.displayName="Button";import{cva as dc}from"class-variance-authority";import{createContext as uc}from"react";import{jsx as ei}from"react/jsx-runtime";var mc=dc("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"}}}),Yt=uc({variant:"loose",loading:!1});function ti({variant:e="loose",loading:t=!1,className:r,children:o}){return ei("ul",{className:i(mc({variant:e,loading:t}),r),"data-variant":e,children:ei(Yt.Provider,{value:{variant:e,loading:t},children:o})})}import{cva as pc}from"class-variance-authority";import{createContext as fc,useContext as gc,useEffect as bc,useRef as hc,useState as vc}from"react";import{jsx as ri,jsxs as Nc}from"react/jsx-runtime";var xc=pc("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"}}}),yc="w-full py-2.5 px-4",zo=fc({hovered:!1});function oi({outerClassName:e,innerClassName:t,children:r,onClick:o,onAuxClick:n,hoverStateEnabled:a=!0,banner:c}){let{variant:l}=gc(Yt),m=hc(null),[d,s]=vc(!1);bc(()=>{if(!d||!m.current)return;let p=setInterval(()=>{var f;((f=m.current)==null?void 0:f.matches(":hover"))===!1&&s(!1)},1e3);return()=>clearInterval(p)},[d]);let u=p=>!(document.getElementById("modal-backdrop")||Ce(p));return Nc("li",{ref:m,className:i(xc({variant:l}),e),onPointerEnter:()=>s(!0),onPointerLeave:()=>s(!1),"data-hover-state-enabled":a,children:[c,ri("div",{className:i(yc,t),onClick:o?p=>{u(p)&&o(p)}:void 0,onAuxClick:n?p=>{u(p)&&n(p)}:void 0,children:ri(zo.Provider,{value:{hovered:d},children:r})})]})}var Yx=Object.assign(ti,{Card:Object.assign(oi,{Context:zo}),Context:Yt});import{motion as sd}from"motion/react";import{forwardRef as ld,useRef as gi}from"react";var Xx=(e,t)=>e?{onClick:r=>{Ce(r)||(r.metaKey||r.ctrlKey?window.open(e,"_blank"):t.push(e))},onAuxClick:r=>{Ce(r)||window.open(e,"_blank")},role:"link",tabIndex:0,onKeyDown:r=>r.target===r.currentTarget&&r.key==="Enter"&&t.push(e)}:{};import{useEffect as wc,useState as kc}from"react";function ni(e){if(typeof window>"u")return null;let t=window.localStorage.getItem(e);return t?JSON.parse(t):null}function Fo(e,t){let[r,o]=kc(ni(e)??t);return wc(()=>{let a=ni(e);a&&o(a)},[e]),[r,a=>{o(a),window.localStorage.setItem(e,JSON.stringify(a))}]}function Cc(e){return e&&typeof e=="object"&&Array.isArray(e.all)&&Array.isArray(e.defaultVisible)}function r2(e,t){if(!Cc(t)){let o=t,n=m=>{let d=o[m];return Object.fromEntries(d.all.map(s=>[s,d.defaultVisible.includes(s)]))},a=Object.fromEntries(Object.keys(o).map(m=>[m,n(m)])),[c,l]=Fo(e,a);return{columnVisibility:c,setColumnVisibility:(m,d)=>{let s=o[m].all,u=c[m]||{},p=Object.fromEntries(s.map(f=>[f,f in d?d[f]:u[f]??!1]));l({...c,[m]:p})}}}else{let o=t,n=Object.fromEntries(o.all.map(l=>[l,o.defaultVisible.includes(l)])),[a,c]=Fo(e,n);return{columnVisibility:a,setColumnVisibility:l=>{let m=o.all,d=a||{},s=Object.fromEntries(m.map(u=>[u,u in l?l[u]:d[u]??!1]));c(s)}}}}import _o from"js-cookie";import{useEffect as Pc,useState as Sc}from"react";function i2(e,t,r){let[o,n]=Sc(()=>{let c=_o.get(e);return c?JSON.parse(c):t});return Pc(()=>{let c=()=>{let l=_o.get(e);l&&n(JSON.parse(l))};return window.addEventListener("storage",c),()=>{window.removeEventListener("storage",c)}},[e]),[o,c=>{n(c),_o.set(e,JSON.stringify(c),r)}]}import{useCallback as Tc,useEffect as Rc,useRef as Lc,useState as Mc}from"react";var It=(e=3e3)=>{let t=Lc(null),[r,o]=Mc(!1),n=()=>{t.current&&(clearTimeout(t.current),t.current=null)},a=Tc(async(c,{onSuccess:l,throwOnError:m}={})=>{n();try{typeof c=="string"?await navigator.clipboard.writeText(c):c instanceof ClipboardItem&&await navigator.clipboard.write([c]),o(!0),l==null||l(),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 Rc(()=>()=>n(),[]),[r,a]};import{useEffect as Ec,useState as Dc}from"react";function u2(){let[e,t]=Dc(null);return Ec(()=>{let r=document.querySelector("[data-mdx-container]");if(!r)return;let o=r.offsetTop-1,n=new IntersectionObserver(l=>{var u,p,f;let m=l[0];if(!m)return;let d=(((u=m.rootBounds)==null?void 0:u.height)||0)*.3+o;for(let b=1;b<l.length;b++){let g=l[b];if(!g)break;(g.boundingClientRect.top<m.boundingClientRect.top||m.boundingClientRect.bottom<o)&&(m=g)}let s=m.target;for(;s&&s.getBoundingClientRect().bottom<o;)s=(p=a.get(s))==null?void 0:p.next;for(;s&&s.getBoundingClientRect().top>d;)s=(f=a.get(s))==null?void 0:f.prev;s&&t(s.getAttribute("href"))},{threshold:1,rootMargin:`-${o}px 0px 0px 0px`}),a=new Map;return(r==null?void 0:r.querySelectorAll("[data-mdx-heading]")).forEach(l=>n.observe(l)),()=>{n.disconnect()}},[]),e==null?void 0:e.replace("#","")}import{useEffect as Ic,useState as Ac}from"react";function g2(){let[e,t]=Ac(null);return Ic(()=>{let r=window.location.hostname;In.has(r)?t("app"):On.has(r)?t("partners"):An.has(r)&&t("admin")},[]),{subdomain:e}}import{useCallback as Oc}from"react";function x2(e){return{handleKeyDown:Oc(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 Vc,useState as zc}from"react";function k2(e,t={}){let{root:r,defaultValue:o}=t,[n,a]=zc(o??!1);return Vc(()=>{let c=()=>{let m=e.current;if(!m)return;let d=r==null?void 0:r.current,s=m.getBoundingClientRect(),u=d?d.getBoundingClientRect():{top:0,left:0,bottom:window.innerHeight,right:window.innerWidth};a(s.top<u.bottom&&s.bottom>u.top&&s.left<u.right&&s.right>u.left)};((r==null?void 0:r.current)||window).addEventListener("scroll",c),window.addEventListener("resize",c);let l=null;return e.current&&(l=new IntersectionObserver(c),l.observe(e.current)),c(),()=>{((r==null?void 0:r.current)||window).removeEventListener("scroll",c),window.removeEventListener("resize",c),l==null||l.disconnect()}},[e,r]),n}import{useEffect as Fc,useState as _c}from"react";function S2(){let[e,t]=_c(!1);return Fc(()=>{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 Hc,useState as $c}from"react";function M2(e,{threshold:t=0,root:r=null,rootMargin:o="0%",freezeOnceVisible:n=!1}={}){let[a,c]=$c(),l=(a==null?void 0:a.isIntersecting)&&n,m=([d])=>{c(d)};return Hc(()=>{let d=e==null?void 0:e.current;if(!!!window.IntersectionObserver||l||!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,l]),a}import{createContext as Bc,useCallback as Wc,useContext as Uc,useEffect as ai,useId as Gc,useState as Kc}from"react";import{jsx as jc}from"react/jsx-runtime";var ii=Bc({listeners:[],setListeners:()=>{}});function V2({children:e}){let[t,r]=Kc([]);return jc(ii.Provider,{value:{listeners:t,setListeners:r},children:e})}function Ke(e,t,r={}){let o=Gc(),{listeners:n,setListeners:a}=Uc(ii),c=Wc(l=>{if(r.enabled===!1)return;let m=l.target,d=document.getElementById("modal-backdrop"),s=document.querySelector("[data-sheet-overlay]");if(m.tagName==="INPUT"||m.tagName==="TEXTAREA"||m.isContentEditable||!!d!=!!r.modal||!!s!=!!r.sheet)return;let u=[...l.metaKey?["meta"]:[],...l.ctrlKey?["ctrl"]:[],...l.altKey?["alt"]:[],l.key].join("+");if(Array.isArray(e)?!e.includes(u):u!==e)return;let p=n.filter(b=>b.enabled!==!1&&!!d==!!b.modal&&!!s==!!b.sheet&&(Array.isArray(b.key)?b.key.includes(u):b.key===u));!p.length||$n(p,(b,g)=>(g.priority??0)-(b.priority??0))[0].id!==o||(l.preventDefault(),t(l))},[e,n,o,t,r.enabled,r.modal,r.sheet]);ai(()=>(document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)),[c]),ai(()=>(a(l=>[...l.filter(m=>m.id!==o),{id:o,key:e,...r}]),()=>a(l=>l.filter(m=>m.id!==o))),[JSON.stringify(e),r.enabled,r.priority])}import{toast as Yc}from"sonner";import qc from"swr";function $2(e,t){let{data:r,isLoading:o,mutate:n}=qc(e,Pe);return{data:r,isLoading:o,update:async(a,c)=>Yc.promise(n(a(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 di,useMemo as td}from"react";import{useEffect as si,useState as Zc}from"react";function li({pageSize:e,page:t,onPageChange:r}){let[o,n]=Zc({pageIndex:t,pageSize:e});return si(()=>{n(a=>({...a,pageIndex:t}))},[t]),si(()=>{r==null||r(o.pageIndex)},[o]),{pagination:o,setPagination:n}}import{usePathname as Xc,useRouter as Jc,useSearchParams as Qc}from"next/navigation";import{useCallback as ed}from"react";function ci(){let e=Xc(),t=Jc(),r=Qc(),o=Object.fromEntries(r),n=(c,l)=>{let m=new URLSearchParams(r);if((l==null?void 0:l.include)&&Array.isArray(l.include)){let s=new URLSearchParams;r.forEach((u,p)=>{var f;(f=l.include)!=null&&f.includes(p)&&s.set(p,u)}),m=s}(l==null?void 0:l.exclude)&&Array.isArray(l.exclude)&&l.exclude.forEach(s=>m.delete(s)),c&&Object.entries(c).forEach(([s,u])=>m.set(s,u));let d=m.toString();return d.length>0?`?${d}`:""},a=ed(({set:c,del:l,replace:m,scroll:d=!0,getNewPath:s,arrayDelimiter:u=","})=>{let p=new URLSearchParams(r);c&&Object.entries(c).forEach(([g,v])=>p.set(g,Array.isArray(v)?v.join(u):v)),l&&(Array.isArray(l)?l.forEach(g=>p.delete(g)):p.delete(l));let f=p.toString(),b=`${e}${f.length>0?`?${f}`:""}`;if(s)return b;m?t.replace(b,{scroll:!1}):t.push(b,{scroll:d})},[r,e,t]);return{pathname:e,router:t,searchParams:r,searchParamsObj:o,queryParams:a,getQueryString:n}}function Q2(e=zn){let{searchParams:t,queryParams:r}=ci(),o=td(()=>parseInt(t.get("page")||"1")||1,[t.get("page")]),{pagination:n,setPagination:a}=li({pageSize:e,page:o,onPageChange:c=>{r(c===1?{del:"page",scroll:!1}:{set:{page:c.toString()},scroll:!1})}});return di(()=>{let c=parseInt(t.get("page")||"1")||1;a(l=>({...l,pageIndex:c}))},[t.get("page")]),di(()=>{r(n.pageIndex===1?{del:"page",scroll:!1}:{set:{page:n.pageIndex.toString()},scroll:!1})},[n]),{pagination:n,setPagination:a}}import{useEffect as rd}from"react";function ry(){rd(()=>{let e=new URL(window.location.href);e.searchParams.has("_gl")&&setTimeout(()=>{e.searchParams.delete("_gl"),window.history.replaceState({},"",e.toString())},2e3)},[])}import{useCallback as od,useEffect as ui,useState as nd}from"react";function mi(e,{container:t}={}){let[r,o]=nd(!1),n=od(()=>{o((t!=null&&t.current?t.current.scrollTop:window.scrollY)>e)},[e]);return ui(()=>{let a=(t==null?void 0:t.current)??window;return a.addEventListener("scroll",n),()=>a.removeEventListener("scroll",n)},[n]),ui(()=>{n()},[n]),r}import{useEffect as ad}from"react";import{toast as fi}from"sonner";import{jsx as Ur,jsxs as pi}from"react/jsx-runtime";function id({id:e,message:t,undo:r}){let o=()=>{r(),fi.dismiss(e)},n=a=>{a.key==="z"&&(a.ctrlKey||a.metaKey)&&o()};return ad(()=>(document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)),[]),pi("div",{className:"flex w-full items-center justify-between space-x-2",children:[pi("div",{className:"flex items-center space-x-2",children:[Ur(qn,{}),Ur("p",{className:"font-medium",children:t})]}),Ur("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 dy(){return({id:t,message:r,undo:o,duration:n})=>fi(Ur(id,{id:t,message:r,undo:o}),{id:t,...n&&{duration:n}})}import{jsx as bi}from"react/jsx-runtime";var cd={type:"spring",duration:.3},be=ld(({width:e=!1,height:t=!1,className:r,transition:o,children:n,...a},c)=>{var b,g;let l=gi(null),m=$r(l),d=gi(!1),s=(b=m==null?void 0:m.contentRect)==null?void 0:b.width,u=(g=m==null?void 0:m.contentRect)==null?void 0:g.height,p=(e?s!=null:!0)&&(t?u!=null:!0)&&!d.current;m&&(d.current=!0);let f=o??(p?{duration:0}:cd);return bi(sd.div,{ref:c,className:i("overflow-hidden",r),animate:{width:e?s??"auto":"auto",height:t?u??"auto":"auto"},transition:f,...a,children:bi("div",{ref:l,className:i(t&&"h-max",e&&"w-max"),children:n})})});be.displayName="AnimatedSizeContainer";import{jsx as Oe,jsxs as hi}from"react/jsx-runtime";function Cy({options:e,value:t,onChange:r,className:o,gridCols:n="2",name:a,disabled:c=!1,animated:l=!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"}[n],d=Oe("div",{className:i("grid gap-3",m),children:e.map(({key:s,label:u,description:p,icon:f})=>{let b=t===s;return hi("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",b&&"border-black bg-neutral-50 text-neutral-900 ring-1 ring-black",c&&"cursor-not-allowed opacity-50",o),children:[Oe("input",{type:"radio",name:a,value:s,className:"hidden",checked:b,disabled:c,onChange:g=>{g.target.checked&&r&&r(s)}}),f&&Oe("div",{className:"flex-shrink-0 pt-0.5",children:f}),hi("div",{className:"flex grow flex-col p-3 pr-0",children:[Oe("span",{className:"pr-1 text-sm font-semibold text-neutral-900",children:u}),Oe("span",{className:"text-xs text-neutral-600",children:p})]}),Oe(da,{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",b&&"scale-100 opacity-100")})]},s)})});return l?Oe("div",{className:"-m-1",children:Oe(be,{height:!0,transition:{ease:"easeInOut",duration:.2},children:Oe("div",{className:"p-1",children:d})})}):d}import dd from"embla-carousel-autoplay";import ud from"embla-carousel-react";import{ArrowLeft as md,ArrowRight as pd}from"lucide-react";import{createContext as fd,forwardRef as Zt,useCallback as qt,useContext as gd,useEffect as Ho,useState as $o}from"react";import{jsx as Ve,jsxs as yi}from"react/jsx-runtime";var Bo=2e3,vi=fd(null);function Re(){let e=gd(vi);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}function xi(){let{api:e}=Re(),[t,r]=$o(0),o=qt(n=>r((n==null?void 0:n.selectedScrollSnap())??0),[]);return Ho(()=>{!e||(o(e),e.on("reInit",o),e.on("select",o))},[e,o]),t}var bd=Zt(({orientation:e="horizontal",opts:t,setApi:r,autoplay:o,plugins:n,className:a,children:c,...l},m)=>{let[d,s]=ud({...t,axis:e==="horizontal"?"x":"y"},[...o?[dd(typeof o=="object"?o:{delay:Bo})]:[],...n||[]]),[u,p]=$o(!1),[f,b]=$o(!1),g=qt(N=>{!N||(p(N.canScrollPrev()),b(N.canScrollNext()))},[]),v=qt(()=>{s==null||s.scrollPrev()},[s]),C=qt(()=>{s==null||s.scrollNext()},[s]),x=qt(N=>{N.key==="ArrowLeft"?(N.preventDefault(),v()):N.key==="ArrowRight"&&(N.preventDefault(),C())},[v,C]);return Ho(()=>{!s||!r||r(s)},[s,r]),Ho(()=>{if(!!s)return g(s),s.on("reInit",g),s.on("select",g),()=>{s==null||s.off("select",g)}},[s,g]),Ve(vi.Provider,{value:{carouselRef:d,api:s,opts:t,orientation:e||((t==null?void 0:t.axis)==="y"?"vertical":"horizontal"),scrollPrev:v,scrollNext:C,canScrollPrev:u,canScrollNext:f},children:Ve("div",{ref:m,onKeyDownCapture:x,className:i("relative",a),role:"region","aria-roledescription":"carousel",...l,children:c})})});bd.displayName="Carousel";var hd=Zt(({className:e,...t},r)=>{let{carouselRef:o,orientation:n}=Re();return Ve("div",{ref:o,className:"overflow-hidden",children:Ve("div",{ref:r,className:i("flex",n==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})});hd.displayName="CarouselContent";var vd=Zt(({className:e,...t},r)=>{let{orientation:o}=Re();return Ve("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})});vd.displayName="CarouselItem";var xd=Zt(({className:e,...t},r)=>{let{orientation:o,scrollPrev:n,canScrollPrev:a}=Re();return yi("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",ge({variant:"secondary",className:"p-2"}),e),disabled:!a,onClick:n,...t,children:[Ve(md,{className:"h-4 w-4"}),Ve("span",{className:"sr-only",children:"Previous slide"})]})});xd.displayName="CarouselPrevious";var yd=Zt(({className:e,...t},r)=>{let{orientation:o,scrollNext:n,canScrollNext:a}=Re();return yi("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",ge({variant:"secondary",className:"p-2"}),e),disabled:!a,onClick:n,...t,children:[Ve(pd,{className:"h-4 w-4"}),Ve("span",{className:"sr-only",children:"Next slide"})]})});yd.displayName="CarouselNext";import{cva as Nd}from"class-variance-authority";import{ChevronLeft as wd,ChevronRight as kd}from"lucide-react";import{motion as Cd}from"motion/react";import*as je from"react";import{jsx as lt,jsxs as Xt}from"react/jsx-runtime";var Pd=Nd("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 "}}}),By=({variant:e="simple",className:t})=>{var b;let{scrollNext:r,scrollPrev:o,canScrollNext:n,canScrollPrev:a,api:c}=Re(),l=(b=c==null?void 0:c.plugins())==null?void 0:b.autoplay,[m,d]=je.useState(0),[s,u]=je.useState(!1),p=je.useCallback(g=>{d((g==null?void 0:g.selectedScrollSnap())??0)},[]),f=je.useCallback(g=>()=>{l&&l.isPlaying()&&l.stop(),g()},[l]);return je.useEffect(()=>{!c||(p(c),u((l==null?void 0:l.isPlaying())??!1),c.on("reInit",p),c.on("select",p),c.on("autoplay:play",()=>u(!0)),c.on("autoplay:stop",()=>u(!1)))},[c,l,p]),Xt("div",{className:i(Pd({variant:e}),t),children:[e!=="simple"&&Xt("button",{className:"cursor-pointer rounded-full p-2 hover:bg-neutral-50 active:bg-neutral-100",disabled:!a,onClick:f(o),children:[lt(wd,{className:"h-4 w-4"}),lt("span",{className:"sr-only",children:"Previous slide"})]}),c!=null&&lt("div",{className:"flex items-center gap-1",children:c.slideNodes().map((g,v)=>Xt("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:[lt("div",{className:i("relative isolate h-1.5 w-1.5 overflow-hidden rounded-full transition-all",v===m?"bg-black":"bg-black/20",s&&v===m&&"w-6 bg-black/20"),children:s&&v===m&&lt(Cd.div,{initial:{x:"-100%"},animate:{x:0},transition:{type:"tween",duration:((l==null?void 0:l.options.delay)??Bo)/1e3},className:"animate-fill-width h-full w-full rounded-full bg-black"})}),Xt("span",{className:"sr-only",children:["Slide ",v+1]})]},v))}),e!=="simple"&&Xt("button",{className:"cursor-pointer rounded-full p-2 hover:bg-neutral-50 active:bg-neutral-100",disabled:!n,onClick:f(r),children:[lt(kd,{className:"h-4 w-4"}),lt("span",{className:"sr-only",children:"Next slide"})]})]})};import Sd from"embla-carousel-react";import{forwardRef as Td,useCallback as Rd,useEffect as Ld}from"react";import{jsx as Gr}from"react/jsx-runtime";var Xy=({className:e,...t})=>{let{api:r}=Re(),[o,n]=Sd({dragFree:!0}),a=Rd(c=>{!c||!n||n==null||n.scrollTo(c.selectedScrollSnap())},[n]);return Ld(()=>{if(!(!r||!n))return a(r),r.on("reInit",a),r.on("select",a),()=>{r==null||r.off("reInit",a),r==null||r.off("select",a)}},[r,n,a]),Gr("div",{className:"overflow-hidden",ref:o,children:Gr("div",{className:i("mx-4 flex gap-4",e),...t})})},Jy=Td(({index:e,className:t,...r},o)=>{let{api:n}=Re(),a=xi();return Gr("div",{ref:o,children:Gr("button",{type:"button",onClick:()=>{var l;if(!n)return;let c=(l=n.plugins())==null?void 0:l.autoplay;c&&c.isPlaying()&&c.stop(),n.scrollTo(e)},className:typeof t=="function"?t({active:e===a}):t,...r})})});import*as Jt from"@radix-ui/react-checkbox";import{forwardRef as Md}from"react";import{jsx as Wo,jsxs as Ed}from"react/jsx-runtime";var At=Md(({className:e,...t},r)=>Wo(Jt.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:Ed(Jt.Indicator,{className:"group/indicator flex items-center justify-center text-white",children:[Wo(Er,{className:"size-3 group-data-[state=indeterminate]/indicator:hidden"}),Wo(Or,{className:"size-3 group-data-[state=checked]/indicator:hidden"})]})}));At.displayName=Jt.Root.displayName;import{Command as ct,useCommandState as Ad}from"cmdk";import{ChevronDown as Od}from"lucide-react";import{forwardRef as Vd,isValidElement as zd,useCallback as Fd,useEffect as Yr,useState as Qt}from"react";import*as Ye from"@radix-ui/react-popover";import{Drawer as Ot}from"vaul";import{jsx as ze,jsxs as Kr}from"react/jsx-runtime";function ne({children:e,content:t,align:r="center",side:o="bottom",openPopover:n,setOpenPopover:a,mobileOnly:c,forceDropdown:l,popoverContentClassName:m,onOpenAutoFocus:d,onCloseAutoFocus:s,collisionBoundary:u,sticky:p,onEscapeKeyDown:f,onWheel:b,sideOffset:g=8}){let{isMobile:v}=ie();return!l&&(c||v)?Kr(Ot.Root,{open:n,onOpenChange:a,children:[ze(Ot.Trigger,{className:"sm:hidden",asChild:!0,children:e}),Kr(Ot.Portal,{children:[ze(Ot.Overlay,{className:"bg-bg-subtle fixed inset-0 z-50 bg-opacity-10 backdrop-blur"}),Kr(Ot.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:f,onPointerDownOutside:C=>{C.target instanceof Element&&C.target.closest("[data-sonner-toast]")&&C.preventDefault()},children:[ze("div",{className:"sticky top-0 z-20 flex w-full items-center justify-center rounded-t-[10px] bg-inherit",children:ze("div",{className:"bg-border-default my-3 h-1 w-12 rounded-full"})}),ze("div",{className:"bg-bg-default flex w-full items-center justify-center overflow-hidden pb-4 align-middle shadow-xl",children:t})]}),ze(Ot.Overlay,{})]})]}):Kr(Ye.Root,{open:n,onOpenChange:a,children:[ze(Ye.Trigger,{className:"sm:inline-flex",asChild:!0,children:e}),ze(Ye.Portal,{children:ze(Ye.Content,{sideOffset:g,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",m),sticky:p,collisionBoundary:u,onOpenAutoFocus:d,onCloseAutoFocus:s,onEscapeKeyDown:f,onWheel:b,children:t})})]})}import{useRef as Dd}from"react";import{jsx as Ni,jsxs as Id}from"react/jsx-runtime";function jr({children:e,className:t}){let r=Dd(null),{scrollProgress:o,updateScrollProgress:n}=Ue(r);return Id("div",{className:"relative",children:[Ni("div",{className:i("scrollbar-hide h-full w-screen overflow-y-scroll [clip-path:inset(0)] sm:w-auto",t),ref:r,onScroll:n,children:e}),Ni("div",{className:"pointer-events-none absolute bottom-0 left-0 z-10 hidden h-16 w-full rounded-b-lg bg-gradient-to-t from-white to-transparent sm:block",style:{opacity:1-Math.pow(o,2)}})]})}import{Fragment as Uo,jsx as _,jsxs as qe}from"react/jsx-runtime";function _d(e,t){return e===!0}function M4({multiple:e,selected:t,setSelected:r,onSelect:o,maxSelected:n,options:a,trigger:c,icon:l,placeholder:m="Select...",searchPlaceholder:d="Search...",emptyState:s,createLabel:u,createIcon:p=Rt,onCreate:f,buttonProps:b,labelProps:g,iconProps:v,popoverProps:C,shortcutHint:x,caret:N,side:y,open:L,onOpenChange:w,onSearchChange:A,shouldFilter:T=!0,inputRight:R,inputClassName:S,optionRight:h,optionClassName:k,optionDescription:E,matchTriggerWidth:M,hideSearch:I=!1,forceDropdown:z=!1,children:ye}){let F=_d(e,r),D=Array.isArray(t)?t:t?[t]:[],{isMobile:Be}=ie(),[Wt,$]=Qt(!1),le=L??Wt,We=w??$,[re,nt]=Qt(""),[Ut,wo]=Qt(!1),[ko,Js]=Qt(void 0),[Qs,Rn]=Qt(!1),el=W=>{var ke,wt;let at=F?D.some(({value:Co})=>Co===W.value):D.length&&((ke=D[0])==null?void 0:ke.value)===W.value;if(!(!at&&n&&D.length>=n))if(o==null||o(W),F){if(!r)return;r(at?D.filter(({value:Co})=>Co!==W.value):[...D,W])}else r==null||r(D.length&&((wt=D[0])==null?void 0:wt.value)===W.value?null:W),We(!1)},Ln=Fd((W,at)=>at===""?[...W.filter(ke=>ke.first&&!D.some(wt=>wt.value===ke.value)),...D,...W.filter(ke=>!ke.first&&!D.some(wt=>wt.value===ke.value))]:W,[D]);Yr(()=>{Ut&&(Js(a&&Ln(a,re)),wo(!1))},[Ut,a,Ln,re]),Yr(()=>{wo(!0)},[JSON.stringify(a==null?void 0:a.map(W=>W.value))]),Yr(()=>{le||(nt(""),wo(!0))},[le]),Yr(()=>A==null?void 0:A(re),[re]);let Mn=qe(ct.Item,{className:i("text-content-default flex cursor-pointer items-center gap-3 whitespace-nowrap rounded-md px-3 py-2 text-left text-sm","data-[selected=true]:bg-bg-subtle",k),onSelect:async()=>{Rn(!0),await(f==null?void 0:f(re))&&(nt(""),We(!1)),Rn(!1)},children:[Qs?_(ae,{className:"size-4 shrink-0"}):_(p,{className:"size-4 shrink-0"}),_("div",{className:"grow truncate",children:(u==null?void 0:u(re))??`Create ${re?`"${re}"`:"new option..."}`})]});return _(ne,{openPopover:le,setOpenPopover:We,align:"start",side:y,forceDropdown:z,onWheel:W=>{W.stopPropagation()},popoverContentClassName:i(M&&"sm:w-[var(--radix-popover-trigger-width)]",C==null?void 0:C.contentClassName),content:_(be,{width:!Be&&!M,height:!0,style:{transform:"translateZ(0)"},transition:{ease:"easeInOut",duration:.1},className:"pointer-events-auto",children:qe(ct,{loop:!0,shouldFilter:T,children:[!I&&qe("div",{className:"border-border-subtle flex items-center overflow-hidden rounded-t-lg border-b",children:[_(ct.Input,{placeholder:d,value:re,onValueChange:nt,className:i("text-content-emphasis placeholder:text-content-muted grow border-0 bg-transparent py-3 pl-4 pr-2 outline-none focus:ring-0 sm:text-sm",S),onKeyDown:W=>{(W.key==="Escape"||W.key==="Backspace"&&!re)&&(W.preventDefault(),W.stopPropagation(),We(!1))}}),R&&_("div",{className:"mr-2",children:R}),x&&_("kbd",{className:"border-border-subtle bg-bg-subtle text-content-subtle mr-2 hidden shrink-0 rounded border px-2 py-0.5 text-xs font-light md:block",children:x})]}),_(jr,{className:i("max-h-[min(50vh,250px)]",f&&!e&&"max-h-[calc(min(50vh,250px)-3.5rem)]"),children:_(ct.List,{className:i("flex w-full min-w-[100px] flex-col gap-1 p-1"),children:ko!==void 0?qe(Uo,{children:[ko.map(W=>{let at=D.some(({value:ke})=>ke===W.value);return _(Hd,{option:W,multiple:F,selected:at,onSelect:()=>el(W),disabled:Boolean(!at&&n&&D.length>=n),right:h==null?void 0:h(W),description:E==null?void 0:E(W),className:k},`${W.label}, ${W.value}`)}),f&&e&&re.length>0&&Mn,T?_(Bd,{className:"text-content-subtle flex min-h-12 items-center justify-center text-sm",children:s||"No matches"}):ko.length===0?_("div",{className:"text-content-subtle flex min-h-12 items-center justify-center text-sm",children:s||"No matches"}):null]}):_(ct.Loading,{children:_("div",{className:"flex h-12 items-center justify-center",children:_(ae,{})})})})}),f&&!e&&_("div",{className:"border-border-subtle bg-bg-default rounded-b-lg border-t p-1",children:Mn})]})}),children:c??_(Q,{variant:"secondary",...b,className:i(b==null?void 0:b.className,"flex gap-2"),textWrapperClassName:i(b==null?void 0:b.textWrapperClassName,"w-full flex items-center justify-start"),text:qe(Uo,{children:[_("div",{className:i("min-w-0 grow truncate text-left",g==null?void 0:g.className),children:ye||D.map(W=>W.label).join(", ")||m}),N&&(N===!0?_(Od,{className:"text-content-muted ml-1 size-4 shrink-0 transition-transform duration-75 group-data-[state=open]:rotate-180"}):N)]}),icon:l?wi(l)?l:_(l,{className:i("size-4 shrink-0",v==null?void 0:v.className)}):void 0})})}function Hd({option:e,onSelect:t,multiple:r,selected:o,disabled:n,right:a,description:c,className:l}){let m=Boolean(c);return qe(Uo,{children:[_($d,{disabledTooltip:e.disabledTooltip,children:qe(ct.Item,{className:i("flex cursor-pointer items-center gap-3 rounded-md px-3 py-2 text-left text-sm",m?"whitespace-normal py-2.5":"whitespace-nowrap","data-[selected=true]:bg-bg-subtle",Boolean(n||e.disabledTooltip)&&"cursor-not-allowed opacity-50",l),disabled:n||!!e.disabledTooltip,onSelect:t,value:e.label+(e==null?void 0:e.value),children:[r&&_("div",{className:"text-content-default shrink-0",children:o?_(sa,{className:"text-content-default size-4"}):_(la,{className:"text-content-muted size-4"})}),qe("div",{className:i("flex min-w-0 grow items-center gap-2",m&&"flex-col items-start gap-0.5"),children:[e.icon&&_("span",{className:"text-content-default shrink-0",children:wi(e.icon)?e.icon:_(e.icon,{className:"h-4 w-4"})}),_("span",{className:i("grow",m?"text-content-emphasis":"text-content-default truncate"),children:e.label}),m&&_("span",{className:"text-content-subtle text-sm",children:c})]}),a,!r&&o&&_(Er,{className:"text-content-default size-4 shrink-0"})]})}),e.separatorAfter&&_(ct.Separator,{className:"bg-border-subtle -mx-1 my-1 h-px"})]})}var $d=({children:e,disabledTooltip:t})=>t?_(J,{content:t,children:_("div",{children:e})}):e,wi=e=>zd(e),Bd=Vd((e,t)=>Ad(o=>o.filtered.count===0)?_("div",{ref:t,"cmdk-empty":"",role:"presentation",...e}):null);import{addYears as qr,format as Wd,isSameMonth as Ud}from"date-fns";import{ChevronLeft as ki,ChevronRight as Ci,ChevronsLeft as Gd,ChevronsRight as Kd}from"lucide-react";import{forwardRef as jd,useRef as Yd}from"react";import{DayPicker as qd,useDayPicker as Zd,useDayRender as Xd,useNavigation as Jd}from"react-day-picker";import{Fragment as Qd,jsx as ce,jsxs as Zr}from"react/jsx-runtime";var er=jd(({onClick:e,icon:t,disabled:r,...o},n)=>ce("button",{ref:n,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:ce(t,{className:"h-full w-full shrink-0"})}));er.displayName="NavigationButton";function Xr({mode:e="single",weekStartsOn:t=0,numberOfMonths:r=1,showYearNavigation:o=!1,disableNavigation:n,locale:a,className:c,classNames:l,...m}){return ce(qd,{mode:e,weekStartsOn:t,numberOfMonths:r,locale:a,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",...l},components:{IconLeft:()=>ce(ki,{className:"h-4 w-4"}),IconRight:()=>ce(Ci,{className:"h-4 w-4"}),Caption:({...d})=>{let{goToMonth:s,nextMonth:u,previousMonth:p,currentMonth:f,displayMonths:b}=Jd(),{numberOfMonths:g,fromDate:v,toDate:C}=Zd(),x=b.findIndex(R=>Ud(d.displayMonth,R)),N=x===0,y=x===b.length-1,L=g>1&&(N||!y),w=g>1&&(y||!N),A=()=>{let R=qr(f,-1);p&&(!v||R.getTime()>=v.getTime())&&s(R)},T=()=>{let R=qr(f,1);u&&(!C||R.getTime()<=C.getTime())&&s(R)};return Zr("div",{className:"flex items-center justify-between",children:[Zr("div",{className:"flex items-center gap-1",children:[o&&!w&&ce(er,{disabled:n||!p||v&&qr(f,-1).getTime()<v.getTime(),"aria-label":"Go to previous year",onClick:A,icon:Gd}),!w&&ce(er,{disabled:n||!p,"aria-label":"Go to previous month",onClick:()=>p&&s(p),icon:ki})]}),ce("div",{role:"presentation","aria-live":"polite",className:"text-sm font-medium capitalize tabular-nums text-neutral-900",children:Wd(d.displayMonth,"LLLL yyy",{locale:a})}),Zr("div",{className:"flex items-center gap-1",children:[!L&&ce(er,{disabled:n||!u,"aria-label":"Go to next month",onClick:()=>u&&s(u),icon:Ci}),o&&!L&&ce(er,{disabled:n||!u||C&&qr(f,1).getTime()>C.getTime(),"aria-label":"Go to next year",onClick:T,icon:Kd})]})]})},Day:({date:d,displayMonth:s})=>{let u=Yd(null),{activeModifiers:p,buttonProps:f,divProps:b,isButton:g,isHidden:v}=Xd(d,s,u),{selected:C,today:x,disabled:N,range_middle:y}=p;if(v)return ce(Qd,{});if(!g)return ce("div",{...b,className:i("flex items-center justify-center",b.className)});let{children:L,...w}=f;return Zr("button",{ref:u,...w,type:"button",children:[L,x&&ce("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":!C,"!bg-white":C,"!bg-blue-400":C&&y,"text-neutral-400":N})})]})}},...m})}import{enUS as lu}from"date-fns/locale";import{useEffect as cu,useState as Si}from"react";import{format as Ze}from"date-fns";import{createContext as eu}from"react";var tr=eu({isOpen:!1,setIsOpen:()=>{}}),tu=()=>{let e=typeof window<"u"?window.navigator.language:"en-US",t=new Intl.DateTimeFormat(e,{hour:"numeric"}).format();return Number.isInteger(Number(t))},rr=(e,t,r=!1)=>{let o=!tu(),n;return r?n=o?Ze(e,"d MMM, yyyy h:mm a",{locale:t}):Ze(e,"d MMM, yyyy HH:mm",{locale:t}):n=Ze(e,"d MMM, yyyy",{locale:t}),n},Pi=(e,t)=>{let{toYear:r,fromYear:o,fromMonth:n,toMonth:a,fromDay:c,toDay:l}=t;if(e&&e.length>0){let m=o,d=r;e.forEach(s=>{var u,p,f,b,g,v;if("date"in s){let C=s.date.getFullYear();if(o&&C<o)throw new Error(`Preset ${s.label} is before fromYear ${m}.`);if(r&&C>r)throw new Error(`Preset ${s.label} is after toYear ${d}.`);if(n&&s.date.getMonth()<n.getMonth())throw new Error(`Preset ${s.label} is before fromMonth ${n}.`);if(a&&s.date.getMonth()>a.getMonth())throw new Error(`Preset ${s.label} is after toMonth ${a}.`);if(c&&s.date.getDate()<c.getDate())throw new Error(`Preset ${s.label} is before fromDay ${c}.`);if(l&&s.date.getDate()>l.getDate())throw new Error(`Preset ${s.label} is after toDay ${Ze(l,"MMM dd, yyyy")}.`)}if("dateRange"in s){let C=(u=s.dateRange.from)==null?void 0:u.getFullYear(),x=(p=s.dateRange.to)==null?void 0:p.getFullYear();if(C&&o&&C<o)throw new Error(`Preset ${s.label}'s 'from' is before fromYear ${m}.`);if(x&&r&&x>r)throw new Error(`Preset ${s.label}'s 'to' is after toYear ${d}.`);if(n){let N=(f=s.dateRange.from)==null?void 0:f.getMonth();if(N&&N<n.getMonth())throw new Error(`Preset ${s.label}'s 'from' is before fromMonth ${Ze(n,"MMM, yyyy")}.`)}if(a){let N=(b=s.dateRange.to)==null?void 0:b.getMonth();if(N&&N>a.getMonth())throw new Error(`Preset ${s.label}'s 'to' is after toMonth ${Ze(a,"MMM, yyyy")}.`)}if(c){let N=(g=s.dateRange.from)==null?void 0:g.getDate();if(N&&N<c.getDate())throw new Error(`Preset ${s.dateRange.from}'s 'from' is before fromDay ${Ze(c,"MMM dd, yyyy")}.`)}if(l){let N=(v=s.dateRange.to)==null?void 0:v.getDate();if(N&&N>l.getDate())throw new Error(`Preset ${s.label}'s 'to' is after toDay ${Ze(l,"MMM dd, yyyy")}.`)}}})}};import{cva as ru}from"class-variance-authority";import{Calendar as ou,ChevronDown as nu}from"lucide-react";import{forwardRef as au}from"react";import{jsx as Jr,jsxs as su}from"react/jsx-runtime";var iu=ru(["group peer flex 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","cursor-pointer disabled:cursor-not-allowed","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"}}}),or=au(({className:e,children:t,placeholder:r,hasError:o,disabled:n,...a},c)=>su("button",{ref:c,className:i(iu({hasError:o}),e),disabled:n,...a,children:[Jr(ou,{className:"h-4 w-4 shrink-0"}),Jr("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left",children:t||(r?Jr("span",{className:"text-neutral-400",children:r}):null)}),Jr(nu,{className:"h-4 w-4 flex-shrink-0 text-neutral-400 transition-transform duration-75 group-data-[state=open]:rotate-180"})]}));or.displayName="DatePicker.Trigger";import{jsx as nr}from"react/jsx-runtime";function iN({value:e,defaultValue:t,onChange:r,trigger:o,disabled:n,disableNavigation:a,disabledDays:c,showYearNavigation:l=!1,locale:m=lu,placeholder:d="Select date",hasError:s,invalid:u,align:p="center",className:f,...b}){let[g,v]=Si(!1),[C,x]=Si(e??t??void 0);cu(()=>{x(e??void 0)},[e]);let N=L=>{x(L),r==null||r(L),v(!1)},y=C?rr(C,m):null;return nr(tr.Provider,{value:{isOpen:g,setIsOpen:v},children:nr(ne,{align:p,openPopover:g,setOpenPopover:v,popoverContentClassName:"rounded-xl",content:nr("div",{className:"flex w-full",children:nr(Xr,{mode:"single",selected:C,onSelect:N,disabled:c,disableNavigation:a,showYearNavigation:l,locale:m,className:"p-3",...b})}),children:o?o({displayValue:y,placeholder:d,open:g,disabled:n,invalid:u}):nr(or,{placeholder:d,disabled:n,className:f,hasError:s,"aria-required":b.required||b["aria-required"],"aria-invalid":b["aria-invalid"],"aria-label":b["aria-label"],"aria-labelledby":b["aria-labelledby"],children:y})})})}import{endOfDay as Ti,isSameDay as Ri,startOfDay as Li}from"date-fns";import{enUS as mu}from"date-fns/locale";import{useEffect as jo,useMemo as Mi,useRef as pu,useState as Qr}from"react";import{Command as Go}from"cmdk";import{Lock as du}from"lucide-react";import{jsx as dt,jsxs as uu}from"react/jsx-runtime";var Ko=({presets:e,onSelect:t,currentValue:r,currentPresetId:o})=>{let n=d=>"dateRange"in d,a=d=>"date"in d,c=(d,s)=>d.getDate()===s.getDate()&&d.getMonth()===s.getMonth()&&d.getFullYear()===s.getFullYear(),l=(d,s)=>{let u=d.from,p=s.from,f=!1;u&&p&&c(u,p)&&(f=!0);let b=d.to,g=s.to,v=!1;return b&&g&&c(b,g)&&(v=!0),f&&v},m=d=>{if(o)return o===d.id;if(n(d)){let s=r;return s&&l(s,d.dateRange)}else if(a(d)){let s=r;return s&&c(s,d.date)}return!1};return dt(Go,{className:"w-full rounded ring-neutral-200 ring-offset-2 focus:outline-none",tabIndex:0,autoFocus:!0,loop:!0,children:dt(Go.List,{className:"[&>*]:flex [&>*]:w-full [&>*]:items-start [&>*]:gap-x-2 [&>*]:gap-y-0.5 [&>*]:sm:flex-col",children:e.map((d,s)=>uu(Go.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:[dt("span",{children:d.label}),d.requiresUpgrade?dt(du,{className:"h-3.5 w-3.5","aria-hidden":"true"}):d.shortcut?dt("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&&dt(J,{side:"bottom",content:d.tooltipContent,children:dt("div",{className:"absolute inset-0 cursor-not-allowed"})})]},s))})})};Ko.displayName="DatePicker.Presets";import{jsx as de,jsxs as Ei}from"react/jsx-runtime";var fu=({value:e,defaultValue:t,presetId:r,onChange:o,presets:n,disabled:a,disableNavigation:c,disabledDays:l,showYearNavigation:m=!1,locale:d=mu,placeholder:s="Select date range",hasError:u,align:p="center",className:f,...b})=>{let{isDesktop:g}=ie(),[v,C]=Qr(!1),[x,N]=Qr(n&&r?n==null?void 0:n.find(({id:M})=>M===r):void 0),[y,L]=Qr((x==null?void 0:x.dateRange)??e??t??void 0),[w,A]=Qr(y==null?void 0:y.to),T=Mi(()=>y,[v]);jo(()=>{L(e)},[e]),jo(()=>{let M=n==null?void 0:n.find(({id:I})=>I===r);N(M),L((M==null?void 0:M.dateRange)??e??t)},[n,r]),jo(()=>{v?y&&A(y.to):A(y==null?void 0:y.to)},[v]);let R=(M,I)=>{let z=(y==null?void 0:y.from)&&(y==null?void 0:y.to)?{from:I}:M;(z==null?void 0:z.from)&&(z==null?void 0:z.to)&&Ri(z.from,z.to)&&(z.from=Li(z.from),z.to=Ti(z.to)),L(z),N(void 0),(z==null?void 0:z.from)&&(z==null?void 0:z.to)&&(o==null||o(z),C(!1))},S=M=>{let I=M.dateRange;(I==null?void 0:I.from)&&(I==null?void 0:I.to)&&Ri(I.from,I.to)&&(I={from:Li(I.from),to:Ti(I.to)}),L(I),N(M),o==null||o(I,M),C(!1)},h=()=>{L(T),C(!1)},k=M=>{M||h(),C(M)},E=Mi(()=>y?`${y.from?rr(y.from,d):""} - ${y.to?rr(y.to,d):""}`:null,[y,d]);return Ke((n==null?void 0:n.filter(M=>M.shortcut).map(M=>M.shortcut))??[],M=>{let I=n==null?void 0:n.find(z=>z.shortcut===M.key);I&&S(I)}),de(tr.Provider,{value:{isOpen:v,setIsOpen:C},children:de(ne,{align:p,openPopover:v,setOpenPopover:k,popoverContentClassName:"rounded-xl",content:de("div",{className:"flex w-full",children:Ei("div",{className:"scrollbar-hide relative flex w-full flex-col overflow-x-scroll sm:flex-row-reverse sm:items-start",children:[n&&n.length>0&&de(gu,{children:de("div",{className:"absolute px-3 sm:inset-0 sm:left-0",children:de("div",{className:"sm:py-3",children:de(Ko,{currentPresetId:r,currentValue:y,presets:n,onSelect:S})})})}),de("div",{className:"scrollbar-hide overflow-x-scroll",children:de(Xr,{mode:"range",selected:y,onSelect:R,month:w,onMonthChange:A,numberOfMonths:g?2:1,disabled:l,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"},...b})})]})}),children:de(or,{placeholder:s,disabled:a,className:f,hasError:u,"aria-required":b.required||b["aria-required"],"aria-invalid":b["aria-invalid"],"aria-label":b["aria-label"],"aria-labelledby":b["aria-labelledby"],children:(x==null?void 0:x.label)??E})})})};function CN({presets:e,...t}){return e&&Pi(e,t),de(fu,{presets:e,...t})}function gu({children:e}){let t=pu(null),{scrollProgress:r,updateScrollProgress:o}=Ue(t);return Ei("div",{className:"relative sm:h-full",children:[de("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}),de("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 bu}from"react";import{jsx as eo,jsxs as hu}from"react/jsx-runtime";function IN({dotSize:e=2,gapSize:t=10,patternOffset:r=[0,0],className:o}){let n=bu();return hu("svg",{className:i("pointer-events-none absolute inset-0 text-black/10",o),width:"100%",height:"100%",children:[eo("defs",{children:eo("pattern",{id:`dots-${n}`,x:r[0]-1,y:r[1]-1,width:e+t,height:e+t,patternUnits:"userSpaceOnUse",children:eo("rect",{x:1,y:1,width:e,height:e,fill:"currentColor"})})}),eo("rect",{fill:`url(#dots-${n})`,width:"100%",height:"100%"})]})}import vu from"next/link";import{useEffect as xu,useState as Di}from"react";import yu from"swr";import{jsx as Yo,jsxs as Ii}from"react/jsx-runtime";function Ai({className:e}){let{data:t}=yu("https://status.dub.co/api/v1/summary",Pe),[r,o]=Di("bg-neutral-200"),[n,a]=Di("Loading status...");return xu(()=>{if(!t)return;let{ongoing_incidents:c}=t;if(c.length>0){let{current_worst_impact:l,name:m}=c[0],d=l==="degraded_performance"?"bg-yellow-500":"bg-red-500";a(m),o(d)}else a("All systems operational"),o("bg-green-500")},[t]),Ii(vu,{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:[Ii("div",{className:"relative size-2",children:[Yo("div",{className:i("absolute inset-0 m-auto size-2 animate-ping items-center justify-center rounded-full group-hover:animate-none",r,n==="Loading status..."&&"animate-none")}),Yo("div",{className:i("absolute inset-0 z-10 m-auto size-2 rounded-full",r)})]}),Yo("p",{className:"text-xs font-medium leading-none text-neutral-600",children:n})]})}import{jsx as to,jsxs as Oi}from"react/jsx-runtime";function $N({icon:e,title:t,description:r,learnMore:o,children:n}){return Oi("div",{className:"flex flex-col items-center justify-center gap-y-4",children:[to("div",{className:"flex size-16 items-center justify-center rounded-2xl border border-neutral-200 bg-neutral-50",children:to(e,{className:"size-6 text-neutral-800"})}),to("p",{className:"text-center text-base font-medium text-neutral-950",children:t}),r&&Oi("p",{className:"max-w-sm text-balance text-center text-sm text-neutral-500",children:[r," ",o&&to("a",{href:o,target:"_blank",className:"underline underline-offset-2 hover:text-neutral-800",children:"Learn more \u2197"})]}),n]})}import{cva as Nu}from"class-variance-authority";import{useState as Vi}from"react";import{toast as zi}from"sonner";import{Fragment as ku,jsx as Le,jsxs as Zo}from"react/jsx-runtime";var Fi=["application/pdf","text/plain","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","text/csv"],qo={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:Fi,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:[...Fi,"application/zip"],errorMessage:"File type not supported (document or zip files only)"}},wu=Nu("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 JN({id:e,readFile:t,onChange:r,variant:o,className:n,iconClassName:a,previewClassName:c,icon:l=fa,customPreview:m,accept:d="any",imageSrc:s,loading:u=!1,clickToUpload:p=!0,showHoverOverlay:f=!0,content:b,maxFileSizeMB:g=5,targetResolution:v,accessibilityLabel:C="File upload",disabled:x=!1}){let[N,y]=Vi(!1),[L,w]=Vi(null),A=async T=>{let R="dataTransfer"in T?T.dataTransfer.files&&T.dataTransfer.files[0]:T.target.files&&T.target.files[0];if(!R)return;if(w(R.name),g>0&&R.size/1024/1024>g){zi.error(`File size too big (max ${g} MB)`);return}let S=qo[d].types;if(S.length&&!S.includes(R.type)){zi.error(qo[d].errorMessage??"File type not supported");return}let h=R;if(v&&R.type.startsWith("image/"))try{let k=await Hn(R,v),E=await fetch(k).then(M=>M.blob());h=new File([E],R.name,{type:R.type})}catch(k){console.error("Error resizing image:",k)}if(t){let k=new FileReader;k.onload=E=>{var M;return r==null?void 0:r({src:(M=E.target)==null?void 0:M.result,file:h})},k.readAsDataURL(h);return}r==null||r({file:h})};return Zo("label",{className:i(wu({variant:o}),x?"cursor-not-allowed":i(p&&"cursor-pointer"),n),children:[u&&Le("div",{className:"absolute inset-0 z-[5] flex items-center justify-center rounded-[inherit] bg-white",children:Le(Xn,{})}),Le("div",{className:"absolute inset-0 z-[5]",onDragOver:T=>{T.preventDefault(),T.stopPropagation(),y(!0)},onDragEnter:T=>{T.preventDefault(),T.stopPropagation(),y(!0)},onDragLeave:T=>{T.preventDefault(),T.stopPropagation(),y(!1)},onDrop:async T=>{T.preventDefault(),T.stopPropagation(),A(T),y(!1)}}),Zo("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",x&&"bg-neutral-50",N&&!x&&"cursor-copy border-black bg-neutral-50 opacity-100",s?i("opacity-0",f&&!x&&"group-hover:opacity-100"):i(!x&&"group-hover:bg-neutral-50")),children:[Le(l,{className:i("size-7 transition-all duration-75",x?"text-neutral-400":i("text-neutral-500 group-hover:scale-110 group-active:scale-95",N?"scale-110":"scale-100"),a)}),b!==null&&Le("div",{className:i("mt-2 text-center text-sm text-neutral-500",x&&"text-neutral-400"),children:b??Le(ku,{children:Zo("p",{children:["Drag and drop ",p&&"or click"," to upload."]})})}),Le("span",{className:"sr-only",children:C})]}),s&&(m??Le("img",{src:s,alt:"Preview",className:i("h-full w-full rounded-[inherit] object-cover",c)})),p&&Le("div",{className:"sr-only mt-1 flex shadow-sm",children:Le("input",{id:e,type:"file",accept:qo[d].types.join(","),onChange:A,disabled:x},L)})]})}import{Command as ar}from"cmdk";import{X as Cu}from"lucide-react";import{AnimatePresence as Pu,motion as Hi}from"motion/react";import Su from"next/link";import{isValidElement as Tu,useCallback as _i,useState as oo}from"react";function ro(e){if("operator"in e&&e.operator&&Array.isArray(e.values))return e;if("value"in e&&!("values"in e))return{key:e.key,operator:"IS",values:[e.value]};if(Array.isArray(e.values)&&(!("operator"in e)||!e.operator)){let t=e.values;return{key:e.key,operator:t.length>1?"IS_ONE_OF":"IS",values:t}}return{key:e.key,operator:"IS",values:[]}}import{Fragment as Mu,jsx as O,jsxs as Fe}from"react/jsx-runtime";function Ru(e){switch(e){case"IS":case"IS_ONE_OF":return"is";case"IS_NOT":case"IS_NOT_ONE_OF":return"is not";default:return"is"}}function $i({filters:e,activeFilters:t,onRemove:r,onRemoveFilter:o,onRemoveAll:n,onSelect:a,onToggleOperator:c,isAdvancedFilter:l=!1,className:m}){Ke("Escape",n,{priority:1});let d=(t==null?void 0:t.map(ro))??[];return O(be,{height:!0,className:"w-full",transition:{type:"tween",duration:.3},children:Fe("div",{className:i("flex w-full flex-wrap items-start gap-4 sm:flex-nowrap",m),children:[O("div",{className:"flex grow flex-wrap gap-x-4 gap-y-2",children:O(Pu,{children:d.map(({key:s,values:u,operator:p})=>{if(s==="loader")return O(Hi.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-${(u==null?void 0:u[0])??0}`);let f=e.find(x=>x.key===s);if(!f)return console.error("Filter.List received an activeFilter without a corresponding filter"),null;let b=u.length===1,g=u.slice(0,3),v=b?(()=>{var y,L;let x=u[0],N=(y=f.options)==null?void 0:y.find(w=>typeof w.value=="string"&&typeof x=="string"?w.value.toLowerCase()===x.toLowerCase():w.value===x);return(N==null?void 0:N.label)??((L=f.getOptionLabel)==null?void 0:L.call(f,x,{key:f.key,option:N}))??String(x)})():`${u.length} ${f.labelPlural??Bn(f.label,u.length)}`;return O(Lu,{filterKey:s,filter:f,values:u,operator:p,OptionDisplay:({className:x})=>{var L,w,A;let N,y;if(b){let T=u[0],R=(L=f.options)==null?void 0:L.find(h=>typeof h.value=="string"&&typeof T=="string"?h.value.toLowerCase()===T.toLowerCase():h.value===T);y=(R==null?void 0:R.permalink)??((w=f.getOptionPermalink)==null?void 0:w.call(f,T))??null;let S=(R==null?void 0:R.icon)??((A=f.getOptionIcon)==null?void 0:A.call(f,T,{key:f.key,option:R}))??f.icon;N=O("span",{className:"shrink-0 text-neutral-600",children:ir(S)?S:O(S,{className:"h-4 w-4"})})}else f.hideMultipleIcons?N=O("span",{className:"shrink-0 text-neutral-600",children:ir(f.icon)?f.icon:O(f.icon,{className:"h-4 w-4"})}):N=O("div",{className:"flex shrink-0 -space-x-1",children:g.map((T,R)=>{var k,E;let S=(k=f.options)==null?void 0:k.find(M=>typeof M.value=="string"&&typeof T=="string"?M.value.toLowerCase()===T.toLowerCase():M.value===T),h=(S==null?void 0:S.icon)??((E=f.getOptionIcon)==null?void 0:E.call(f,T,{key:f.key,option:S}))??f.icon;return O("span",{className:"inline-flex text-neutral-600",style:{zIndex:g.length-R},children:ir(h)?h:O(h,{className:"h-4 w-4"})},R)})});return Fe("div",{className:i("flex items-center gap-2.5 px-3 py-2",x),children:[N,y?O(Su,{href:y,target:"_blank",className:"cursor-alias decoration-dotted underline-offset-2 hover:underline",children:kt(v,30)}):kt(v,30)]})},onRemove:r,onRemoveFilter:o,onSelect:a,onToggleOperator:c,isAdvancedFilter:l},s)})})}),d.length!==0&&Fe("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:n,children:["Clear Filters",O("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"})]})]})})}function Lu({filterKey:e,filter:t,values:r,operator:o,OptionDisplay:n,onRemove:a,onRemoveFilter:c,onSelect:l,onToggleOperator:m,isAdvancedFilter:d=!1}){var y,L;let[s,u]=oo(!1),[p,f]=oo(!1),[b,g]=oo(""),[v,C]=oo(new Set),x=_i(()=>{C(new Set(r)),f(!0)},[r]),N=_i(w=>{r.includes(w)?a(e,w):l==null||l(e,w),!d&&!t.multiple&&f(!1)},[e,r,l,a,d,t.multiple]);return Fe(Hi.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:[Fe("div",{className:"flex items-center gap-2.5 px-3 py-2",children:[O("span",{className:"shrink-0 text-neutral-600",children:ir(t.icon)?t.icon:O(t.icon,{className:"h-4 w-4"})}),t.label]}),(d||t.multiple)&&!t.singleSelect&&!t.hideOperator?O(ne,{openPopover:s,setOpenPopover:u,content:Fe("div",{className:"w-32 p-1",children:[O("button",{type:"button",className:i("flex w-full items-center rounded-md px-3 py-2 text-left text-sm transition-colors hover:bg-neutral-100",!o.includes("NOT")&&"bg-neutral-50"),onClick:()=>{o.includes("NOT")&&(m==null||m(e)),u(!1)},children:"is"}),O("button",{type:"button",className:i("flex w-full items-center rounded-md px-3 py-2 text-left text-sm transition-colors hover:bg-neutral-100",o.includes("NOT")&&"bg-neutral-50"),onClick:()=>{o.includes("NOT")||m==null||m(e),u(!1)},children:"is not"})]}),align:"center",children:O("button",{type:"button",className:"px-3 py-2 text-neutral-500 transition-colors hover:bg-neutral-50 hover:text-neutral-700",children:Ru(o)})}):O("div",{className:"px-3 py-2 text-neutral-500",children:"is"}),O(ne,{openPopover:p,setOpenPopover:w=>{f(w),w||(g(""),C(new Set))},content:O("div",{children:O(be,{width:!0,height:!0,className:"rounded-[inherit]",children:Fe(ar,{loop:!0,shouldFilter:!1,children:[O("div",{className:"flex items-center overflow-hidden rounded-t-lg border-b border-neutral-200",children:O(ar.Input,{placeholder:`${t.label}...`,value:b,onValueChange:g,className:"grow border-0 py-3 pl-4 pr-2 outline-none placeholder:text-neutral-400 focus:ring-0 sm:text-sm",autoCapitalize:"none"})}),O("div",{className:"scrollbar-hide max-h-[50vh] w-screen overflow-y-scroll sm:w-auto",children:O(ar.List,{className:"flex w-full min-w-[180px] flex-col gap-1 p-1",children:(()=>{var S;let w=((S=t.options)==null?void 0:S.filter(h=>{var E;return b?(h.label??((E=t.getOptionLabel)==null?void 0:E.call(t,h.value,{key:t.key,option:h}))??String(h.value)).toLowerCase().includes(b.toLowerCase()):!0}))??[],A=w.filter(h=>v.has(h.value)),T=w.filter(h=>!v.has(h.value)),R=h=>{var I,z;let k=r.includes(h.value),E=h.icon??((I=t.getOptionIcon)==null?void 0:I.call(t,h.value,{key:t.key,option:h}))??t.icon,M=h.label??((z=t.getOptionLabel)==null?void 0:z.call(t,h.value,{key:t.key,option:h}))??String(h.value);return Fe(ar.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"),onSelect:()=>{N(h.value)},onPointerDown:ye=>{ye.preventDefault()},value:M+h.value,children:[(d||t.multiple)&&!t.singleSelect&&O("div",{className:i("flex h-4 w-4 items-center justify-center rounded border",k?"border-neutral-900 bg-neutral-900":"border-neutral-300"),children:k&&O(Tt,{className:"h-3 w-3 text-white"})}),O("span",{className:"shrink-0 text-neutral-600",children:ir(E)?E:O(E,{className:"h-4 w-4"})}),O("span",{className:"flex-1",children:kt(M,48)}),O("div",{className:"ml-1 flex shrink-0 justify-end text-neutral-500",children:(d||t.multiple)&&!t.singleSelect?h.right:k?O(Tt,{className:"h-4 w-4"}):h.right})]},h.value)};return Fe(Mu,{children:[A.map(R),(d||t.multiple)&&!t.singleSelect&&A.length>0&&T.length>0&&O(ar.Separator,{className:"-mx-1 my-1 border-b border-neutral-200"}),T.map(R)]})})()})})]})})}),align:"start",children:O("button",{type:"button",onClick:x,disabled:((y=t.options)==null?void 0:y.length)===0,className:i("flex items-center",((L=t.options)==null?void 0:L.length)&&"transition-colors hover:bg-neutral-50"),children:t.options?n({className:"cursor-pointer"}):O("div",{className:"flex items-center gap-2.5 px-3 py-2",children:O("div",{className:"h-5 w-12 animate-pulse rounded-md bg-neutral-200"})})})}),O("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:()=>{c?c(e):r.forEach(w=>{a(e,w)})},children:O(Cu,{className:"h-3.5 w-3.5"})})]})}var ir=e=>Tu(e);import{Command as _e,useCommandState as Eu}from"cmdk";import{ChevronDown as Du,ListFilter as Iu}from"lucide-react";import{Fragment as Au,forwardRef as Ou,isValidElement as Bi,useCallback as no,useEffect as ao,useImperativeHandle as Vu,useRef as Jo,useState as Xo}from"react";import{Fragment as Bu,jsx as U,jsxs as Me}from"react/jsx-runtime";function Wi({filters:e,onSelect:t,onRemove:r,onOpenFilter:o,onSearchChange:n,onSelectedFilterChange:a,activeFilters:c,askAI:l,isAdvancedFilter:m=!1,children:d,emptyState:s,className:u}){var S,h;let{isMobile:p}=ie(),f=Jo(null),b=Jo(void 0),[g,v]=Xo(!1);Ke("f",()=>v(!0),{enabled:!g});let[C,x]=Xo(""),[N,y]=Xo(null),L=no(()=>{x(""),y(null)},[]);ao(()=>{g||L()},[g]);let w=N?e.find(({key:k})=>k===N):null,A=no(k=>{f.current&&(b.current={width:f.current.clientWidth,height:f.current.clientHeight}),x(""),y(k),o==null||o(k)},[o]),T=no(k=>{if(!w||!c)return!1;let E=c.find(I=>I.key===N);return E?ro(E).values.includes(k):!1},[w,c,N]),R=no(k=>{w&&((w==null?void 0:w.singleSelect)||!m&&!(w!=null&&w.multiple)?(T(k)?r(w.key,k):t(w.key,k),v(!1)):T(k)?r(w.key,k):t(w.key,k))},[w,T,t,r,m]);return ao(()=>{n==null||n(C)},[C]),ao(()=>{a==null||a(N)},[N]),ao(()=>{(w==null?void 0:w.options)&&f.current&&(b.current={width:f.current.clientWidth,height:f.current.clientHeight})},[w==null?void 0:w.options]),U(ne,{openPopover:g,setOpenPopover:v,onEscapeKeyDown:k=>{N&&(k.preventDefault(),L())},content:U(be,{width:!p,height:!0,className:"rounded-[inherit]",style:{transform:"translateZ(0)"},children:Me(_e,{loop:!0,shouldFilter:!w||w.shouldFilter!==!1,children:[Me("div",{className:"flex items-center overflow-hidden rounded-t-lg border-b border-neutral-200",children:[U(Fu,{placeholder:`${(w==null?void 0:w.label)||"Filter"}...`,value:C,onValueChange:x,onKeyDown:k=>{(k.key==="Escape"||k.key==="Backspace"&&!C)&&(k.preventDefault(),k.stopPropagation(),N?L():v(!1))},onEmptySubmit:k=>{k.preventDefault(),k.stopPropagation(),l?(t("ai",w?`${w.label} ${C}`:C),v(!1)):R(C)}}),!w&&U("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"})]}),U(_u,{ref:f,children:Me(_e.List,{className:i("flex w-full flex-col gap-1 p-1",w?"min-w-[100px]":"min-w-[180px]"),children:[w?((h=(S=w.options)==null?void 0:S.filter(k=>!C||!k.hideDuringSearch))==null?void 0:h.map(k=>{let E=(w==null?void 0:w.singleSelect)||!m&&!(w!=null&&w.multiple),M=T(k.value);return U(Qo,{filter:w,option:k,showCheckbox:!E&&(m||(w==null?void 0:w.multiple)),isChecked:M,right:E&&M?U(Tt,{className:"h-4 w-4"}):k.right,onSelect:()=>R(k.value)},k.value)}))??U(_e.Loading,{children:U("div",{className:"-m-1 flex items-center justify-center",style:b.current,children:U(ae,{})})}):e.filter(k=>!k.hideInFilterDropdown).map(k=>Me(Au,{children:[U(Qo,{filter:k,onSelect:()=>A(k.key)}),k.separatorAfter&&U(_e.Separator,{className:"-mx-1 my-1 border-b border-neutral-200"})]},k.key)),(!w||w.options)&&U(Hu,{search:C,selectedFilter:w,onSelect:()=>R(C),askAI:l,children:s?zu(s)?(s==null?void 0:s[N??"default"])??"No matching options":s:"No matching options"})]})},N)]})}),children:Me("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",u),children:[U(Iu,{className:"size-4 shrink-0"}),U("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-left text-neutral-900",children:d??"Filter"}),c!=null&&c.length?U("div",{className:"flex size-4 shrink-0 items-center justify-center rounded-full bg-black text-[0.625rem] text-white",children:c.length}):U(Du,{className:"size-4 shrink-0 text-neutral-400 transition-transform duration-75 group-data-[state=open]:rotate-180"})]})})}function zu(e){return typeof e=="object"&&e!==null&&!Bi(e)}var Fu=e=>{let{onEmptySubmit:t,...r}=e,o=Eu(n=>n.filtered.count===0);return U(_e.Input,{...r,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:n=>{var a;(a=e.onKeyDown)==null||a.call(e,n),n.key==="Enter"&&o&&(t==null||t(n))},autoCapitalize:"none"})},_u=Ou(({children:e},t)=>{let r=Jo(null);Vu(t,()=>r.current);let{scrollProgress:o,updateScrollProgress:n}=Ue(r);return Me(Bu,{children:[U("div",{className:"scrollbar-hide max-h-[50vh] w-screen overflow-y-scroll sm:w-auto",ref:r,onScroll:n,children:e}),U("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 Qo({filter:e,option:t,right:r,showCheckbox:o,isChecked:n,onSelect:a}){var m,d;let c=t?t.icon??((m=e.getOptionIcon)==null?void 0:m.call(e,t.value,{key:e.key,option:t}))??e.icon:e.icon,l=t?t.label??((d=e.getOptionLabel)==null?void 0:d.call(e,t.value,{key:e.key,option:t})):e.label;return Me(_e.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"),onSelect:a,value:l+(t==null?void 0:t.value),children:[o&&U("div",{className:i("flex h-4 w-4 items-center justify-center rounded border",n?"border-neutral-900 bg-neutral-900":"border-neutral-300"),children:n&&U(Tt,{className:"h-3 w-3 text-white"})}),U("span",{className:"shrink-0 text-neutral-600",children:$u(c)?c:U(c,{className:"h-4 w-4"})}),U("span",{className:"flex-1",children:kt(l,48)}),U("div",{className:"ml-1 flex shrink-0 justify-end text-neutral-500",children:r})]})}var Hu=({search:e,selectedFilter:t,onSelect:r,askAI:o,children:n})=>t&&t.options&&t.options.length===0&&t.shouldFilter!==!1?e?U(Qo,{filter:t,option:{value:e,label:e},onSelect:r}):U(_e.Empty,{className:"p-2 text-center text-sm text-neutral-400",children:"Start typing to search..."}):!t&&o&&e?Me(_e.Empty,{className:"flex min-w-[180px] items-center space-x-2 rounded-md bg-neutral-100 px-3 py-2",children:[U(Kn,{className:"h-4 w-4"}),Me("p",{className:"text-center text-sm text-neutral-600",children:["Ask AI ",Me("span",{className:"text-black",children:['"',e,'"']})]})]}):U(_e.Empty,{className:"p-2 text-center text-sm text-neutral-400",children:n}),$u=e=>Bi(e);var Vw={Select:Wi,List:$i};import{useMemo as Wu,useState as Ui}from"react";import{jsx as ut,jsxs as io}from"react/jsx-runtime";function Ww({title:e,description:t,inputAttrs:r,helpText:o,buttonText:n="Save Changes",disabledTooltip:a,handleSubmit:c}){let[l,m]=Ui(r.defaultValue),[d,s]=Ui(!1),u=Wu(()=>d||!l||l===r.defaultValue,[d,l,r.defaultValue]);return io("form",{onSubmit:async p=>{p.preventDefault(),s(!0),await c({[r.name]:l}),s(!1)},className:"rounded-xl border border-neutral-200 bg-white",children:[io("div",{className:"relative flex flex-col space-y-6 p-6",children:[io("div",{className:"flex flex-col space-y-1",children:[ut("h2",{className:"text-base font-semibold",children:e}),ut("p",{className:"text-sm text-neutral-500",children:t})]}),typeof r.defaultValue=="string"?ut("input",{...r,type:r.type||"text",required:!0,disabled:!!a,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":a})}):ut("div",{className:"h-[2.35rem] w-full max-w-md animate-pulse rounded-md bg-neutral-200"})]}),io("div",{className:"flex flex-col items-start justify-between gap-4 rounded-b-xl border-t border-neutral-200 bg-neutral-50 px-5 py-4 sm:flex-row sm:items-center sm:justify-between sm:space-y-0 sm:py-3",children:[typeof o=="string"?ut("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,ut("div",{className:"w-fit shrink-0",children:ut(Q,{text:n,loading:d,disabled:u,disabledTooltip:a})})]})]})}import{useId as Uu}from"react";import{jsx as so,jsxs as Gu}from"react/jsx-runtime";function mt({cellSize:e=12,strokeWidth:t=1,patternOffset:r=[0,0],className:o}){let n=Uu();return Gu("svg",{className:i("pointer-events-none absolute inset-0 text-black/10",o),width:"100%",height:"100%",children:[so("defs",{children:so("pattern",{id:`grid-${n}`,x:r[0]-1,y:r[1]-1,width:e,height:e,patternUnits:"userSpaceOnUse",children:so("path",{d:`M ${e} 0 L 0 0 0 ${e}`,fill:"transparent",stroke:"currentColor",strokeWidth:t})})}),so("rect",{fill:`url(#grid-${n})`,width:"100%",height:"100%"})]})}import*as en from"@radix-ui/react-label";import{cva as Ku}from"class-variance-authority";import*as Gi from"react";import{jsx as qu}from"react/jsx-runtime";var ju=Ku("text-sm font-medium leading-none text-content-emphasis peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Yu=Gi.forwardRef(({className:e,...t},r)=>qu(en.Root,{ref:r,className:i(ju(),e),...t}));Yu.displayName=en.Root.displayName;import{cva as Zu}from"class-variance-authority";import{isValidElement as Xu}from"react";import{jsx as tn,jsxs as Ki}from"react/jsx-runtime";var rn=Zu(["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 transition-colors","disabled:opacity-50 disabled:cursor-default"],{variants:{variant:{default:"text-content-default hover:bg-bg-subtle",danger:"text-content-error hover:bg-red-50 dark:hover:bg-red-950/20"},disabled:{true:"opacity-50 cursor-default text-content-disabled hover:bg-bg-default"}}});function a3({as:e,variant:t="default",children:r,icon:o,shortcut:n,className:a,disabledTooltip:c,...l}){return tn(Et,{tooltipProps:{content:c},children:Ki(e||"button",{...e==="button"?{type:"button"}:{},className:i(rn({variant:t,disabled:!!c}),a),disabled:c?!0:l.disabled,...l,children:[Ki("div",{className:"flex grow items-center gap-2",children:[o&&(Ju(o)?o:tn(o,{className:"size-4"})),r]}),n&&tn("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:n})]})})}var Ju=e=>Xu(e);import{curveNatural as ji}from"@visx/curve";import{LinearGradient as Yi}from"@visx/gradient";import{Group as Qu}from"@visx/group";import{ParentSize as em}from"@visx/responsive";import{scaleLinear as tm,scaleUtc as rm}from"@visx/scale";import{Area as om,AreaClosed as nm}from"@visx/shape";import{motion as qi}from"motion/react";import{useId as am,useMemo as Zi}from"react";import{jsx as Ee,jsxs as on}from"react/jsx-runtime";var im={top:8,right:2,bottom:2,left:2};function g3(e){return Ee(em,{className:"relative",children:({width:t,height:r})=>t>0&&r>0&&Ee(sm,{...{width:t,height:r,...e}})})}function sm({width:e,height:t,data:r,curve:o=!0,color:n,padding:a}){let c={...im,...a},l=am(),m=Zi(()=>r.map(({date:u})=>({date:u,value:0})),[r]),{yScale:d,xScale:s}=Zi(()=>{let u=r.map(({value:v})=>v),p=Math.max(...u),f=r.map(({date:v})=>v.getTime()),b=new Date(Math.min(...f)),g=new Date(Math.max(...f));return{yScale:tm({domain:[-2,Math.max(p,2)],range:[t-c.top-c.bottom,0],nice:!0,clamp:!0}),xScale:rm({domain:[b,g],range:[0,e-c.left-c.right],nice:!0})}},[r,t,e]);return on("svg",{width:e,height:t,children:[on("defs",{children:[Ee(Yi,{id:`${l}-color-gradient`,from:n||"#7D3AEC",to:n||"#DA2778",x1:0,x2:e-c.left-c.right,gradientUnits:"userSpaceOnUse"}),Ee(Yi,{id:`${l}-mask-gradient`,from:"white",to:"white",fromOpacity:.3,toOpacity:0,x1:0,x2:0,y1:0,y2:1}),Ee("mask",{id:`${l}-mask`,maskContentUnits:"objectBoundingBox",children:Ee("rect",{width:"1",height:"1",fill:`url(#${l}-mask-gradient)`})})]}),on(Qu,{left:c.left,top:c.top,children:[Ee(om,{data:r,x:({date:u})=>s(u),y:({value:u})=>d(u)??0,curve:o?ji:void 0,children:({path:u})=>Ee(qi.path,{initial:{d:u(m)||"",opacity:0},animate:{d:u(r)||"",opacity:1},strokeWidth:1.5,stroke:`url(#${l}-color-gradient)`})}),Ee(nm,{data:r,x:({date:u})=>s(u),y:({value:u})=>d(u)??0,yScale:d,curve:o?ji:void 0,children:({path:u})=>Ee(qi.path,{initial:{d:u(m)||"",opacity:0},animate:{d:u(r)||"",opacity:1},fill:`url(#${l}-color-gradient)`,mask:`url(#${l}-mask)`})})]})]},r.length)}import*as he from"@radix-ui/react-dialog";import*as nn from"@radix-ui/react-visually-hidden";import{useRouter as lm}from"next/navigation";import{Drawer as pt}from"vaul";import{jsx as ue,jsxs as Vt}from"react/jsx-runtime";function N3({children:e,className:t,showModal:r,setShowModal:o,onClose:n,desktopOnly:a,preventDefaultClose:c,drawerRootProps:l}){let m=lm(),d=({dragged:u}={})=>{c&&!u||(n&&n(),o?o(!1):m.back())},{isMobile:s}=ie();return s&&!a?ue(pt.Root,{open:o?r:!0,onOpenChange:u=>{u||d({dragged:!0})},...l,children:Vt(pt.Portal,{children:[ue(pt.Overlay,{className:"fixed inset-0 z-50 bg-neutral-100 bg-opacity-10 backdrop-blur"}),ue(pt.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(nn.Root,{children:[ue(pt.Title,{children:"Modal"}),ue(pt.Description,{children:"This is a modal"})]}),ue(cm,{}),e]})}),ue(pt.Overlay,{})]})}):ue(he.Root,{open:o?r:!0,onOpenChange:u=>{u||d()},children:Vt(he.Portal,{children:[ue(he.Overlay,{id:"modal-backdrop",className:"animate-fade-in fixed inset-0 z-40 bg-neutral-100 bg-opacity-50 backdrop-blur-md"}),Vt(he.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(nn.Root,{children:[ue(he.Title,{children:"Modal"}),ue(he.Description,{children:"This is a modal"})]}),e]})]})})}function cm(){return ue("div",{className:"sticky top-0 z-20 flex items-center justify-center rounded-t-[10px] bg-inherit",children:ue("div",{className:"my-3 h-1 w-12 rounded-full bg-neutral-300"})})}import{X as dm}from"lucide-react";import um,{useCallback as an,useEffect as Xi,useImperativeHandle as mm,useRef as Ji,useState as sn}from"react";import{jsx as sr,jsxs as es}from"react/jsx-runtime";function Qi(e){let t=[],r="",o=!1;for(let a=0;a<e.length;a++){let c=e[a];if(c==='"'){o=!o;continue}if(!o&&(c===","||c===`
3
+ `||c==="\r")){c==="\r"&&e[a+1]===`
4
+ `&&a++;let l=r.trim();l&&t.push(l),r="";continue}r+=c}let n=r.trim();return n&&t.push(n),t}var pm=um.forwardRef(function({values:t,onChange:r,placeholder:o,id:n,className:a,inputClassName:c,disabled:l,normalize:m=p=>p.trim(),maxValues:d,autoFocus:s},u){let[p,f]=sn(""),[b,g]=sn(null),v=Ji(null),C=Ji(null),[x,N]=sn(!1),y=an(h=>{let k=h.map(m).filter(Boolean);if(k.length===0)return t;let E=[...t];for(let M of k){if(d!=null&&E.length>=d)break;E.push(M)}return E},[t,m,d]),L=an(h=>{let k=new Set;return h.filter(E=>k.has(E)?!1:(k.add(E),!0))},[]),w=an(()=>{let h=Qi(p);if(h.length===0)return f(""),t;let k=y(h);return r(k),f(""),k},[p,t,y,r]);mm(u,()=>({commitPendingInput(){return w()}}),[w]),Xi(()=>{b&&!t.includes(b)&&g(null)},[t,b]),Xi(()=>{let h=v.current;if(!h)return;let k=()=>{let M=Array.from(h.children);if(M.length<=1){N(!1);return}let I=M.map(ye=>ye.offsetTop),z=Math.min(...I);N(I.some(ye=>ye-z>2))};k();let E=new ResizeObserver(k);return E.observe(h),()=>E.disconnect()},[t,p]);let A=h=>{let k=h.currentTarget,E=b?t.indexOf(b):-1;if(h.key===","||h.key==="Enter"){h.preventDefault(),w();return}if(h.key==="ArrowLeft"&&t.length>0){if(E>0){h.preventDefault(),g(t[E-1]);return}if(E===-1&&k.selectionStart===0&&k.selectionEnd===0){h.preventDefault(),g(t[t.length-1]);return}}if(h.key==="ArrowRight"&&E!==-1){if(h.preventDefault(),E<t.length-1){g(t[E+1]);return}g(null);return}if((h.key==="Backspace"||h.key==="Delete")&&!p&&t.length>0){if(h.preventDefault(),b){let M=t.filter(I=>I!==b);r(M),g(null);return}g(t[t.length-1])}h.key==="Tab"&&b&&(h.preventDefault(),g(null))},T=h=>{let k=h.clipboardData.getData("text");if(!/[,\n\r]/.test(k))return;let M=Qi(k);if(M.length===0)return;h.preventDefault();let I=y(M);r(I),f("")},R=()=>{g(null);let h=w(),k=L(h);k.length!==h.length&&r(k)},S=h=>{g(k=>k===h?null:k),r(t.filter(k=>k!==h))};return es("div",{ref:v,className:i("relative flex w-full flex-wrap items-center gap-1 rounded-md border border-neutral-300 bg-white px-1.5 shadow-sm focus-within:border-neutral-500 focus-within:ring-1 focus-within:ring-neutral-500",x?"py-[4px]":"h-[38px] py-[3px]",l&&"cursor-not-allowed bg-neutral-50 opacity-60",a),children:[t.map((h,k)=>es("span",{onClick:()=>g(h),className:i("inline-flex items-center gap-1 rounded-md py-0.5 pl-1.5 pr-1 text-sm leading-6",b===h?"bg-neutral-300 text-neutral-900":"bg-neutral-100 text-neutral-900"),children:[sr("span",{children:h}),sr("button",{type:"button",onClick:E=>{E.stopPropagation(),S(h)},disabled:l,className:i("rounded-md p-0.5 outline-none transition hover:bg-neutral-200 focus:ring-1 focus:ring-neutral-400",b===h?"text-neutral-600 hover:text-neutral-800":"text-neutral-500 hover:text-neutral-700"),"aria-label":`Remove ${h}`,children:sr(dm,{className:"size-3",strokeWidth:2.5,"aria-hidden":!0})})]},`${h}-${k}`)),sr("div",{className:"min-w-[8rem] flex-[1_1_8rem]",children:sr("input",{ref:C,id:n,value:p,onChange:h=>{g(null),f(h.target.value)},onKeyDown:A,onBlur:R,onPaste:T,disabled:l,className:i("h-7 w-full border-0 bg-transparent px-1.5 text-sm leading-6 text-neutral-900 placeholder-neutral-400 focus:outline-none focus:ring-0",b&&"text-transparent caret-transparent placeholder:text-transparent",c),placeholder:o,type:"text",autoComplete:"off",autoFocus:s})})]})});pm.displayName="MultiValueInput";import{useCallback as ft,useEffect as fm,useLayoutEffect as gm,useRef as bm,useState as ts}from"react";import{jsx as zt,jsxs as rs}from"react/jsx-runtime";function D3({value:e,onChange:t,min:r,max:o,step:n=1,disabled:a,className:c,id:l,formatValue:m,decrementAriaLabel:d="Decrease",incrementAriaLabel:s="Increase",...u}){let[p,f]=ts(String(e)),[b,g]=ts(!1),v=bm(null),C=typeof r=="number"?e>r:!0,x=typeof o=="number"?e<o:!0;gm(()=>{b&&v.current&&!a&&(v.current.focus(),v.current.select())},[b,a]),fm(()=>{!b&&p!==String(e)&&f(String(e))},[e,b,p]);let N=ft(S=>{let h=S;return typeof r=="number"&&(h=Math.max(r,h)),typeof o=="number"&&(h=Math.min(o,h)),h},[r,o]),y=ft(()=>{if(a||!C)return;let S=N(e-n);t(S),f(String(S))},[a,C,N,t,n,e]),L=ft(()=>{if(a||!x)return;let S=N(e+n);t(S),f(String(S))},[a,x,N,t,n,e]),w=ft(S=>{let h=S.target.value;if(f(h),h===""||h==="-")return;let k=Number(h);if(!isNaN(k)){let E=N(k);t(E)}},[N,t]),A=ft(()=>{g(!1);let S=Number(p);if(isNaN(S)||p===""||p==="-"){f(String(e));return}let h=N(S);t(h),f(String(h))},[p,e,N,t]),T=ft(()=>{g(!0)},[]),R=ft(S=>{a||(S.key==="ArrowLeft"||S.key==="ArrowDown"?(S.preventDefault(),y()):S.key==="ArrowRight"||S.key==="ArrowUp"?(S.preventDefault(),L()):S.key==="Enter"?(S.preventDefault(),A(),S.currentTarget.blur()):S.key==="Escape"&&(S.preventDefault(),f(String(e)),S.currentTarget.blur()))},[a,y,L,A,e]);return rs("div",{id:l,role:"group","aria-disabled":a,className:i("flex h-10 w-full select-none items-stretch overflow-hidden rounded-lg border border-neutral-200 bg-white p-1",a&&"opacity-60",c),...u,children:[zt("button",{type:"button","aria-label":d,onClick:y,disabled:a||!C,className:i("flex h-full w-16 items-center justify-center rounded-lg text-neutral-700 transition-colors",!(a||!C)&&"hover:bg-neutral-100 active:bg-neutral-200"),children:zt(Or,{className:"block size-4"})}),rs("div",{className:"relative flex min-w-0 flex-1 items-center justify-center",children:[zt("input",{ref:v,type:"text",inputMode:"numeric",role:"spinbutton","aria-valuenow":e,"aria-valuemin":r,"aria-valuemax":o,value:b?p:String(e),onChange:w,onBlur:A,onFocus:T,onKeyDown:R,disabled:a,className:i("w-full border-0 bg-transparent px-3 text-center text-sm text-neutral-900 outline-none transition-colors focus:ring-0",a&&"cursor-not-allowed",!a&&"cursor-text focus:bg-neutral-50",!b&&m&&"pointer-events-none opacity-0")}),!b&&m&&zt("div",{role:"spinbutton","aria-valuenow":e,"aria-valuemin":r,"aria-valuemax":o,tabIndex:0,onKeyDown:S=>{S.key==="Enter"||S.key===" "?(S.preventDefault(),a||(g(!0),f(String(e)))):R(S)},onClick:()=>{a||(g(!0),f(String(e)))},className:i("absolute inset-0 flex items-center justify-center px-3 text-sm text-neutral-900 outline-none focus:ring-0",!a&&"cursor-text hover:bg-neutral-50"),children:m(e)})]}),zt("button",{type:"button","aria-label":s,onClick:L,disabled:a||!x,className:i("flex h-full w-16 items-center justify-center rounded-lg text-neutral-700 transition-colors",!(a||!x)&&"hover:bg-neutral-100 active:bg-neutral-200"),children:zt(Rt,{className:"block size-4"})})]})}import{Fragment as ns,jsx as Ft,jsxs as _t}from"react/jsx-runtime";var os=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 O3({pagination:e,setPagination:t,totalCount:r,unit:o=l=>`item${l?"s":""}`,className:n,children:a,showTotalCount:c=!0}){return _t("div",{className:i("flex items-center justify-between gap-2 text-sm leading-6 text-neutral-600",n),children:[_t("div",{className:"flex items-center gap-2",children:[Ft("div",{children:r===void 0?Ft("div",{className:"h-5 w-24 animate-pulse rounded-lg bg-neutral-200"}):_t(ns,{children:[Ft("span",{className:"hidden sm:inline-block",children:"Viewing"})," ",r>0&&_t(ns,{children:[_t("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&&Ft("span",{className:"font-medium",children:r.toLocaleString()})," ",typeof o=="function"?o(r!==1):o]})}),a]}),_t("div",{className:"flex items-center gap-2",children:[Ft("button",{type:"button",className:os,onClick:()=>t({...e,pageIndex:e.pageIndex-1}),disabled:e.pageIndex===1,children:"Previous"}),Ft("button",{type:"button",className:os,onClick:()=>t({...e,pageIndex:e.pageIndex+1}),disabled:!r||(e.pageIndex-1)*e.pageSize+e.pageSize>=r,children:"Next"})]})]})}import{jsx as as,jsxs as hm}from"react/jsx-runtime";function F3({progress:e,strokeWidth:t=16,className:r}){let o=Math.min(Math.max(e,0),1),n=(100-t)/2,a=n*Math.PI*2,c=o*a;return hm("svg",{width:"100",height:"100",viewBox:"0 0 100 100",className:i("size-3 shrink-0 text-green-600 [--track-color:#e5e5e5]",r),children:[as("circle",{cx:"50",cy:"50",r:n,strokeWidth:`${t}px`,fill:"none",strokeLinecap:"round",className:"stroke-[var(--track-color)]"}),o>0&&as("circle",{cx:"50",cy:"50",r:n,stroke:"currentColor",strokeWidth:`${t}px`,fill:"none",strokeLinecap:"round",strokeDasharray:`${c} ${a-c}`,style:{transformOrigin:"50px 50px",transform:"rotate(-90deg)"}})]})}import{jsx as uo,jsxs as vm}from"react/jsx-runtime";var lo={left:"right",right:"left",top:"bottom",bottom:"top"},lr="rgba(0, 0, 0, 1)",co="rgba(0, 0, 0, 0)";function $3({strength:e=32,steps:t=4,side:r="top",className:o,style:n,...a}){let c=100/t,l=.5,m=Math.pow(e/l,1/(t-1)),d=s=>`blur(${l*m**(t-s-1)}px)`;return uo("div",{className:i("pointer-events-none absolute inset-0",o),style:{transformOrigin:r,...n},...a,children:vm("div",{className:"relative z-0 size-full",style:{background:`linear-gradient(
5
+ to ${lo[r]},
6
+ rgb(from transparent r g b / alpha) 0%,
7
+ rgb(from transparent r g b / 0%) 100%
8
+ )`},children:[uo("div",{className:"z-1 absolute inset-0",style:{mask:`linear-gradient(
9
+ to ${lo[r]},
10
+ ${lr} 0%,
11
+ ${co} ${c}%
12
+ )`,backdropFilter:d(0),WebkitBackdropFilter:d(0)}}),t>1&&uo("div",{className:"absolute inset-0 z-[2]",style:{mask:`linear-gradient(
13
+ to ${lo[r]},
14
+ ${lr} 0%,
15
+ ${lr} ${c}%,
16
+ ${co} ${c*2}%
17
+ )`,backdropFilter:d(1),WebkitBackdropFilter:d(1)}}),t>2&&[...Array(t-2)].map((s,u)=>uo("div",{className:"absolute inset-0",style:{zIndex:u+2,mask:`linear-gradient(
18
+ to ${lo[r]},
19
+ ${co} ${u*c}%,
20
+ ${lr} ${(u+1)*c}%,
21
+ ${lr} ${(u+2)*c}%,
22
+ ${co} ${(u+3)*c}%
23
+ )`,backdropFilter:d(u+2),WebkitBackdropFilter:d(u+2)}},u))]})})}import*as Xe from"@radix-ui/react-radio-group";import{Circle as xm}from"lucide-react";import*as ln from"react";import{jsx as mo}from"react/jsx-runtime";var ym=ln.forwardRef(({className:e,...t},r)=>mo(Xe.Root,{className:i("grid gap-2",e),...t,ref:r}));ym.displayName=Xe.Root.displayName;var Nm=ln.forwardRef(({className:e,...t},r)=>mo(Xe.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:mo(Xe.Indicator,{className:"flex items-center justify-center",children:mo(xm,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Nm.displayName=Xe.Item.displayName;import{Drawer as Je}from"vaul";import{jsx as gt,jsxs as Sm}from"react/jsx-runtime";function wm({children:e,contentProps:t,nested:r=!1,...o}){let n=r?Je.NestedRoot:Je.Root;return gt(n,{direction:"right",handleOnly:!0,...o,children:Sm(Je.Portal,{children:[gt(Je.Overlay,{className:"fixed inset-0 z-40 bg-black/20","data-sheet-overlay":!0}),gt(Je.Content,{...t,onPointerDownOutside:a=>{var c;a.target instanceof Element&&a.target.closest("[data-sonner-toast]")&&a.preventDefault(),(c=t==null?void 0:t.onPointerDownOutside)==null||c.call(t,a)},className:i("@container/sheet fixed bottom-2 right-2 top-2 z-40 flex outline-none","w-[min(var(--sheet-width),calc(100%-2*var(--sheet-margin)))] [--sheet-margin:8px] [--sheet-width:540px]",t==null?void 0:t.className),style:{"--initial-transform":"calc(100% + 8px)",userSelect:"auto",...t==null?void 0:t.style},children:gt("div",{className:"scrollbar-hide flex size-full grow flex-col overflow-y-auto rounded-xl bg-white",children:e})})]})})}function km({className:e,...t}){return gt(Je.Title,{className:i("text-lg font-semibold text-neutral-900",e),...t})}function Cm(e){return gt(Je.Description,{...e})}function Pm(e){return gt(Je.Close,{...e})}var q3=Object.assign(wm,{Title:km,Description:Cm,Close:Pm});import{useEffect as Tm,useRef as Rm,useState as Lm}from"react";import{jsx as is}from"react/jsx-runtime";var Mm=`
3
24
  attribute vec2 position;
4
25
 
5
26
  void main()
6
27
  {
7
28
  gl_Position = vec4(position, 0.0, 1.0);
8
29
  }
9
- `,Am=`
30
+ `,Em=`
10
31
  precision mediump float;
11
32
 
12
33
  uniform vec2 resolution;
@@ -40,14 +61,14 @@ void main(void) {
40
61
 
41
62
  gl_FragColor = fragColor;
42
63
  }
43
- `,Im=60,Om=1e3/Im;function n3({dotSize:e=1,cellSize:t=3,speed:r=5,color:o=[0,0,0],className:a}){let n=Mm(null),[c,d]=Em(!1);return Lm(()=>{let m=n.current;if(!m||!m.parentElement)return;let s=m.parentElement,l=window.devicePixelRatio||1;m.width=s.clientWidth*l,m.height=s.clientHeight*l;let u=m.getContext("webgl",{powerPreference:"low-power",depth:!1,stencil:!1});if(u===null){console.error("Failed to initialize WebGL");return}let p=u.createProgram();if(!p){console.error("Failed to create shader program");return}for(let S=0;S<2;++S){let Y=S===0?Dm:Am,P=u.createShader(S===0?u.VERTEX_SHADER:u.FRAGMENT_SHADER);if(!P){console.error("Failed to create shader");return}u.shaderSource(P,Y),u.compileShader(P),u.getShaderParameter(P,u.COMPILE_STATUS)||console.error(u.getShaderInfoLog(P)),u.attachShader(p,P),u.linkProgram(p)}u.getProgramParameter(p,u.LINK_STATUS)||console.error(u.getProgramInfoLog(p));let f=u.getAttribLocation(p,"position"),b=u.getUniformLocation(p,"time"),g=u.getUniformLocation(p,"resolution"),h=u.getUniformLocation(p,"dotSize"),N=u.getUniformLocation(p,"cellSize"),x=u.getUniformLocation(p,"speed"),y=u.getUniformLocation(p,"color");u.useProgram(p);let C=[1,1,-1,1,1,-1,-1,-1],w=u.createBuffer();u.bindBuffer(u.ARRAY_BUFFER,w),u.bufferData(u.ARRAY_BUFFER,new Float32Array(C),u.STATIC_DRAW),u.enableVertexAttribArray(f),u.vertexAttribPointer(f,2,u.FLOAT,!1,0,0),u.uniform1f(h,e*window.devicePixelRatio),u.uniform1f(N,t*window.devicePixelRatio),u.uniform1f(x,r),u.uniform3f(y,o[0],o[1],o[2]);let T,B=0;function R(S){if(S-B<Om){T=requestAnimationFrame(R);return}B=S,u&&m&&p&&(u.clear(u.COLOR_BUFFER_BIT|u.DEPTH_BUFFER_BIT),u.uniform1f(b,S/1e3),u.uniform2f(g,m.width,m.height),u.drawArrays(u.TRIANGLE_STRIP,0,4)),T=requestAnimationFrame(R)}return T=requestAnimationFrame(R),m.addEventListener("webglcontextlost",S=>{S.preventDefault(),d(!0),cancelAnimationFrame(T)}),()=>{cancelAnimationFrame(T),m.removeEventListener("webglcontextlost",()=>{})}},[e,t,r]),vi("div",{className:i("absolute inset-0",a,c&&"opacity-0"),children:vi("canvas",{ref:n,width:"100%",height:"100%",className:"size-full"})})}import*as _e from"@radix-ui/react-slider";import{jsx as tt,jsxs as Dr}from"react/jsx-runtime";function l3({value:e,onChange:t,min:r,max:o,step:a=1,marks:n,className:c,hint:d,disabled:m}){let s=n||[r,r+(o-r)/3,r+2*(o-r)/3,o];return tt("div",{className:i("relative z-0 [--thumb-radius:13px] [--track-height:16px]",c),children:Dr("div",{className:"w-full",children:[Dr(_e.Root,{className:"relative flex h-8 w-full items-center",value:[e],min:r,max:o,step:a,onValueChange:([l])=>t(l),disabled:m,"aria-label":"Slider",children:[Dr(_e.Track,{className:"relative h-[var(--track-height)] w-full overflow-visible rounded-full bg-neutral-200",children:[tt("div",{className:"absolute left-0 top-0 h-full w-[var(--thumb-radius)] rounded-l-full bg-black"}),Dr("div",{className:"pointer-events-none absolute inset-x-[var(--thumb-radius)] inset-y-0",children:[tt(_e.Range,{className:"absolute h-[var(--track-height)] bg-black"}),s.map(l=>{let u=(l-r)/(o-r)*100;return tt("span",{className:"absolute top-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-white",style:{left:`${u}%`}},l)})]})]}),tt(_e.Thumb,{className:"z-20 flex size-[calc(var(--thumb-radius)*2)] items-center justify-center rounded-full border-0 bg-white shadow-[0_2px_2px_rgba(0,0,0,0.10),0_3px_3px_rgba(0,0,0,0.09)]",children:tt("span",{className:"block size-[calc(var(--thumb-radius)*1.23)] rounded-full bg-[#171717]"})})]}),d&&tt("div",{className:"mt-2 min-h-[1rem] text-xs text-neutral-500",children:d})]})})}import{useEffect as zm,useId as Vm,useRef as Hm}from"react";import{jsx as Ar,jsxs as xi}from"react/jsx-runtime";function u3({value:e,onChange:t,label:r,placeholder:o='E.g. "tomorrow at 5pm" or "in 2 hours"',className:a,required:n,autoFocus:c=!1}){let d=Vm(),m=Hm(null);return zm(()=>{m.current&&c&&setTimeout(()=>{var s;(s=m.current)==null||s.focus()},10)},[c]),xi("div",{className:a,children:[r&&Ar("div",{className:"flex items-center gap-2",children:Ar("label",{htmlFor:`${d}-datetime`,className:"block text-sm font-medium text-neutral-700",children:r})}),xi("div",{className:"mt-2 flex w-full items-center justify-between rounded-md border border-neutral-300 bg-white shadow-sm transition-all focus-within:border-neutral-800 focus-within:outline-none focus-within:ring-1 focus-within:ring-neutral-500",children:[Ar("input",{ref:m,id:`${d}-datetime`,type:"text",placeholder:o,defaultValue:e?Pt(e):"",onBlur:s=>{if(s.target.value.length>0){let l=jr(s.target.value);l&&(t(l),s.target.value=Pt(l))}},onKeyDown:s=>{if(s.key==="Enter"&&m.current){s.preventDefault();let l=jr(m.current.value);l&&(t(l),m.current.value=Pt(l))}},className:"flex-1 border-none bg-transparent text-neutral-900 placeholder-neutral-400 focus:outline-none focus:ring-0 sm:text-sm"}),Ar("input",{type:"datetime-local",id:`${d}-datetime-local`,required:n,value:e?la(e):"",onChange:s=>{let l=new Date(s.target.value);t(l),m.current&&(m.current.value=Pt(l))},className:"w-[40px] border-none bg-transparent text-neutral-500 focus:outline-none focus:ring-0 sm:text-sm"})]})]})}import{cva as _m}from"class-variance-authority";import{jsx as yi,jsxs as Wm}from"react/jsx-runtime";var Fm=_m("flex gap-1.5 items-center max-w-fit rounded-md px-2 py-1 text-xs font-medium whitespace-nowrap",{variants:{variant:{neutral:"bg-neutral-500/[.15] text-neutral-600",new:"bg-blue-500/[.15] text-blue-600",success:"bg-green-500/[.15] text-green-600",pending:"bg-orange-500/[.15] text-orange-600",warning:"bg-yellow-500/[.15] text-yellow-600",error:"bg-red-500/[.15] text-red-600"},size:{sm:"px-1.5 py-0.5",md:"px-2 py-1"}},defaultVariants:{variant:"neutral"}}),Bm={neutral:Ia,new:Da,success:Ma,pending:Aa,warning:qr,error:qr};function x3({className:e,variant:t,size:r,icon:o,tooltip:a,onClick:n,children:c,...d}){let m=o!==null?o??Bm[t??"neutral"]:null;return yi(ft,{tooltipProps:{content:a},children:Wm("span",{className:i(Fm({variant:t,size:r}),a&&"cursor-help",n&&"cursor-pointer select-none transition-[filter] duration-150 hover:brightness-75 hover:saturate-[1.25]",e),onClick:n,...d,children:[m&&yi(m,{className:"h-3 w-3 shrink-0"}),c]})})}import*as Or from"@radix-ui/react-switch";import{useMemo as Um}from"react";import{jsx as Ir}from"react/jsx-runtime";function T3({fn:e,id:t,trackDimensions:r,thumbDimensions:o,thumbTranslate:a,thumbIcon:n,checked:c=!0,loading:d=!1,disabled:m=!1,disabledTooltip:s}){let l=Um(()=>s?!0:m||d,[s,m,d]),u=Ir(Or.Root,{checked:d?!1:c,name:"switch",id:t,...e&&{onCheckedChange:e},disabled:l,className:i("radix-state-checked:bg-blue-500 radix-state-unchecked:bg-neutral-200 relative inline-flex h-4 w-8 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out","focus:outline-none focus-visible:ring focus-visible:ring-blue-500 focus-visible:ring-opacity-75","data-[disabled]:cursor-not-allowed",r),children:Ir(Or.Thumb,{className:i(`radix-state-checked:${a}`,"radix-state-unchecked:translate-x-0","pointer-events-none h-3 w-3 translate-x-4 transform rounded-full bg-white shadow-lg ring-0 transition duration-200 ease-in-out",o,a),children:n})});return s?Ir(Z,{content:s,children:Ir("div",{className:"inline-block leading-none",children:u})}):u}import{Command as Ao}from"cmdk";import{useState as $m}from"react";import{jsx as rt,jsxs as Gm}from"react/jsx-runtime";function z3({table:e}){let[t,r]=$m(!1);return rt(xe,{openPopover:t,setOpenPopover:r,content:rt(xr,{className:"max-h-[50vh]",children:rt(Ao,{tabIndex:0,loop:!0,children:rt(Ao.List,{className:"flex w-screen flex-col gap-1 p-1 text-sm focus-visible:outline-none sm:w-auto sm:min-w-[130px]",children:e.getAllColumns().filter(o=>o.getCanHide()).map(o=>{var a;return Gm(Ao.Item,{className:i("flex cursor-pointer select-none items-center gap-2 whitespace-nowrap rounded-md px-3 py-1.5","data-[selected=true]:bg-neutral-100"),onSelect:()=>o.toggleVisibility(),children:[rt("input",{checked:o.getIsVisible(),type:"checkbox",className:"h-3 w-3 rounded-full border-neutral-300 text-black focus:outline-none focus:ring-0",disabled:!0}),(a=o.columnDef.header)==null?void 0:a.toString()]},o.id)})})})}),align:"end",children:rt(ee,{type:"button",className:"h-8 whitespace-nowrap px-2",variant:"outline",icon:rt(Ua,{className:"h-4 w-4 shrink-0"})})})}import{flexRender as Io,getCoreRowModel as Ym,useReactTable as Zm}from"@tanstack/react-table";import{AnimatePresence as qm,motion as Xm}from"motion/react";import{memo as Jm,useEffect as Ht,useMemo as Ci,useRef as Qm,useState as ki}from"react";import{useEffect as Km,useState as jm}from"react";import{jsx as zr,jsxs as Ni}from"react/jsx-runtime";function wi({table:e,controls:t,className:r}){let o=e.getSelectedRowModel().rows.length,[a,n]=jm(0);return Km(()=>{o!==0&&n(o)},[o]),De("Escape",()=>e.resetRowSelection(),{enabled:o>0,priority:2,modal:!1}),zr("div",{className:i("border-border-subtle w-full border-b bg-white","transition-opacity duration-100",o>0?"pointer-events-auto opacity-100":"pointer-events-none opacity-0",r),inert:o===0,children:Ni("div",{className:"flex h-11 items-center gap-2.5 px-2 py-2.5",children:[zr("div",{className:"flex w-6 items-center justify-center",children:zr(ht,{className:"border-border-default size-4 rounded data-[state=checked]:bg-black data-[state=indeterminate]:bg-black",checked:e.getIsAllRowsSelected()?!0:e.getIsSomeRowsSelected()?"indeterminate":!1,onCheckedChange:()=>e.toggleAllRowsSelected(),title:"Select all"})}),Ni("span",{className:i("text-content-emphasis mr-2 text-sm font-medium tabular-nums transition-transform duration-150",o>0?"translate-x-0":"-translate-x-1"),children:[a," selected"]}),zr("div",{className:i("flex items-center gap-2 transition-transform duration-150",o>0?"translate-x-0":"-translate-x-1"),children:t==null?void 0:t(e)})]})})}import{Fragment as Pi,jsx as O,jsxs as le}from"react/jsx-runtime";var Oo=(e,t)=>i(["py-2.5 text-left text-sm leading-6 whitespace-nowrap border-border-subtle px-4 relative","border-l border-b",e==="select"&&"py-0 pr-0 pl-2",e==="menu"&&"bg-bg-default border-l-transparent py-0 px-1",t&&"group-hover/row:bg-bg-muted transition-colors duration-75","group-data-[selected=true]/row:bg-blue-50"]),eu=i(["absolute right-0 top-0 h-full w-1 cursor-col-resize select-none touch-none","bg-neutral-300/50","opacity-0 group-hover/resize:opacity-100 hover:opacity-100","group-hover/resize:bg-neutral-300 hover:bg-neutral-400","transition-all duration-200","-mr-px","after:absolute after:right-0 after:top-0 after:h-full after:w-4 after:translate-x-1/2"]);function iw(e){let{data:t,rowCount:r,columns:o,defaultColumn:a,columnPinning:n,pagination:c,onPaginationChange:d,getRowId:m,enableColumnResizing:s=!1,columnResizeMode:l="onChange"}=e,u=!!e.onRowSelectionChange||!!e.selectionControls,[p,f]=ki(e.columnVisibility??{}),[b,g]=ki(e.selectedRows??{}),h=Qm(null);Ht(()=>{if(!m||!t)return;let y=Object.entries(b);if(y.length>0){let C=y.filter(([w])=>t.find(T=>(m==null?void 0:m(T))===w));C.length!==y.length&&g(Object.fromEntries(C))}},[t,b,m]),Ht(()=>{e.selectedRows&&!Yr(e.selectedRows,b)&&g(e.selectedRows??{})},[e.selectedRows]),Ht(()=>{var y;(y=e.onRowSelectionChange)==null||y.call(e,x.getSelectedRowModel().rows)},[b]),Ht(()=>{e.columnVisibility&&!Yr(e.columnVisibility,p)&&f(e.columnVisibility??{})},[e.columnVisibility]),Ht(()=>{var y;(y=e.onColumnVisibilityChange)==null||y.call(e,p)},[p]);let N=Ci(()=>[...u?[{id:"select",enableHiding:!1,minSize:30,size:30,maxSize:30,header:({table:y})=>O("div",{className:"flex size-full items-center justify-center",children:O(ht,{className:"border-border-default size-4 rounded data-[state=checked]:bg-black data-[state=indeterminate]:bg-black",checked:y.getIsAllRowsSelected()?!0:y.getIsSomeRowsSelected()?"indeterminate":!1,onCheckedChange:()=>y.toggleAllRowsSelected(),title:"Select all"})}),cell:({row:y,table:C})=>O("div",{className:"flex size-full items-center justify-center",children:O(ht,{className:"border-border-default size-4 rounded data-[state=checked]:bg-black data-[state=indeterminate]:bg-black",checked:y.getIsSelected(),onClick:w=>{let T=m==null?void 0:m(y.original),B=C.getRowModel().rows,R=h.current!==null?B.findIndex(S=>(m==null?void 0:m(S.original))===h.current):-1;if(w.shiftKey&&h.current!==null&&R!==-1){let S=y.index,Y=Math.min(R,S),P=Math.max(R,S),M=B.slice(Y,P+1).map(L=>m==null?void 0:m(L.original));C.setRowSelection(L=>{let E=T!==void 0&&((L==null?void 0:L[T])??!1);return{...L,...Object.fromEntries(M.map(z=>[z,!E]))}}),h.current=T??null}else y.toggleSelected(),h.current=T??null},title:"Select"})})}]:[],...o],[u,o]),x=Zm({data:t,rowCount:r,columns:N,defaultColumn:{minSize:120,size:0,maxSize:300,enableResizing:s,...a},getCoreRowModel:Ym(),onPaginationChange:d,onColumnVisibilityChange:y=>f(y),onRowSelectionChange:g,state:{pagination:c,columnVisibility:p,columnPinning:{left:[],right:[],...n},rowSelection:b},manualPagination:!0,autoResetPageIndex:!1,manualSorting:!0,getRowId:m,enableColumnResizing:s,columnResizeMode:l});return{...e,columnVisibility:p,table:x,enableColumnResizing:s}}var tu=Jm(function({row:t,onRowClick:r,onRowAuxClick:o,rowProps:a,cellRight:n,tdClassName:c,table:d}){let{className:m,...s}=a||{};return O("tr",{className:i("group/row",r&&"cursor-pointer select-none",d.getRowModel().rows.length>8&&t.index===d.getRowModel().rows.length-1&&"[&_td]:border-b-0",m),onClick:r?l=>{Ge(l)||r(t,l)}:void 0,onAuxClick:o?l=>{Ge(l)||o(t,l)}:void 0,"data-selected":t.getIsSelected(),...s,children:t.getVisibleCells().map(l=>O("td",{className:i(Oo(l.column.id,!!r),"text-content-default group",zo(l.column,t.index===d.getRowModel().rows.length-1),typeof c=="function"?c(l.column.id,t):c),style:{width:l.column.getSize(),...Vo(l.column)},children:le("div",{className:"flex w-full items-center justify-between overflow-hidden truncate",children:[O("div",{className:"min-w-0 shrink grow truncate",children:Io(l.column.columnDef.cell,l.getContext())}),n==null?void 0:n(l)]})},l.id))},t.id)},(e,t)=>{let r=e.row,o=t.row;return r.original===o.original&&r.getIsSelected()===o.getIsSelected()});function sw({data:e,loading:t,error:r,emptyState:o,cellRight:a,sortBy:n,sortOrder:c,onSortChange:d,sortableColumns:m=[],className:s,containerClassName:l,scrollWrapperClassName:u,emptyWrapperClassName:p,thClassName:f,tdClassName:b,table:g,pagination:h,resourceName:N,onRowClick:x,onRowAuxClick:y,onRowSelectionChange:C,selectionControls:w,rowProps:T,rowCount:B,children:R,enableColumnResizing:S=!1}){let Y=!!C||!!w,P=Ci(()=>S?g.getVisibleLeafColumns().reduce((M,L)=>M+L.getSize(),0):"100%",[S,g.getVisibleLeafColumns()]);return le("div",{className:i("border-border-subtle bg-bg-default relative z-0 rounded-xl border",l),children:[!r&&!!(e!=null&&e.length)||t?le(Pi,{children:[Y&&O(wi,{table:g,controls:w,className:"absolute left-0 top-0 z-10 rounded-t-[inherit]"}),le("div",{className:i("relative min-h-[400px] overflow-x-auto rounded-[inherit]",u),children:[le("table",{className:i(["group/table w-full border-separate border-spacing-0 transition-[border-spacing,margin-top]","[&_tr>*:first-child]:border-l-transparent","[&_tr>*:last-child]:border-r-transparent","[&_tr>*:last-child]:border-r-transparent","[&_th]:relative [&_th]:select-none",S&&"[&_th]:group/resize"],s),style:{width:"100%",tableLayout:S?"fixed":"auto",minWidth:P},children:[O("thead",{className:"relative",children:g.getHeaderGroups().map(M=>O("tr",{children:M.headers.map(L=>{let E=m.includes(L.column.id),z=E?"button":"div";return le("th",{colSpan:L.colSpan,className:i(Oo(L.id),"text-content-emphasis select-none font-medium",zo(L.column,!g.getRowModel().rows.length),typeof f=="function"?f(L.column.id):f,S&&"relative"),style:{width:L.getSize(),...Vo(L.column)},children:[O("div",{className:"flex items-center justify-between gap-6 !pr-0",children:le(z,{className:i("flex items-center gap-2",L.column.id==="select"&&"size-full"),...E&&{type:"button",disabled:!E,"aria-label":"Sort by column",onClick:()=>d==null?void 0:d({sortBy:L.column.id,sortOrder:n!==L.column.id||c==="asc"?"desc":"asc"})},children:[L.isPlaceholder?null:(()=>{var Xt;let k=Io(L.column.columnDef.header,L.getContext()),Wr=(Xt=L.column.columnDef.meta)==null?void 0:Xt.headerTooltip;return O(ru,{tooltip:Wr,children:k})})(),E&&n===L.column.id&&O(ga,{className:"h-3 w-3 shrink-0",order:c||"desc"})]})}),S&&L.column.getCanResize()&&!["select","menu"].includes(L.column.id)&&O("div",{onMouseDown:L.getResizeHandler(),onTouchStart:L.getResizeHandler(),onClick:k=>k.stopPropagation(),className:eu})]},L.id)})},M.id))}),O("tbody",{children:g.getRowModel().rows.map(M=>{let L=typeof T=="function"?T(M):T,{className:E,...z}=L||{};return S?O(tu,{row:M,onRowClick:x,onRowAuxClick:y,rowProps:L,cellRight:a,tdClassName:b,table:g},`${M.id}-${g.getVisibleLeafColumns().map(k=>k.id).join(",")}`):O("tr",{className:i("group/row",x&&"cursor-pointer select-none",g.getRowModel().rows.length>8&&M.index===g.getRowModel().rows.length-1&&"[&_td]:border-b-0",E),onClick:x?k=>{Ge(k)||x(M,k)}:void 0,onAuxClick:y?k=>{Ge(k)||y(M,k)}:void 0,"data-selected":M.getIsSelected(),...z,children:M.getVisibleCells().map(k=>O("td",{className:i(Oo(k.column.id,!!x),"text-content-default group",zo(k.column,M.index===g.getRowModel().rows.length-1),typeof b=="function"?b(k.column.id,M):b),style:{minWidth:k.column.columnDef.minSize,maxWidth:k.column.columnDef.maxSize,width:k.column.columnDef.size||"auto",...Vo(k.column)},children:le("div",{className:"flex w-full items-center justify-between overflow-hidden truncate",children:[O("div",{className:"min-w-0 shrink grow truncate",children:Io(k.column.columnDef.cell,k.getContext())}),a==null?void 0:a(k)]})},k.id))},M.id)})})]}),R]})]}):O("div",{className:i("text-content-subtle flex h-96 w-full items-center justify-center text-sm",p),children:r||o||`No ${(N==null?void 0:N(!0))||"items"} found.`}),h&&!r&&!!(e!=null&&e.length)&&!!B&&le("div",{className:"border-border-subtle bg-bg-default text-content-default sticky bottom-0 mx-auto -mt-px flex w-full max-w-full items-center justify-between rounded-b-[inherit] border-t px-4 py-3.5 text-sm leading-6",children:[le("div",{children:[O("span",{className:"hidden sm:inline-block",children:"Viewing"})," ",le("span",{className:"font-medium",children:[((h.pageIndex-1)*h.pageSize+1).toLocaleString(),"-",Math.min((h.pageIndex-1)*h.pageSize+h.pageSize,g.getRowCount()).toLocaleString()]})," ","of"," ",O("span",{className:"font-medium",children:g.getRowCount().toLocaleString()})," ",(N==null?void 0:N(g.getRowCount()!==1))||"items"]}),le("div",{className:"flex items-center gap-2",children:[O(ee,{variant:"secondary",text:"Previous",className:"h-7 px-2",onClick:()=>g.previousPage(),disabled:h.pageIndex===1}),O(ee,{variant:"secondary",text:"Next",className:"h-7 px-2",onClick:()=>g.nextPage(),disabled:h.pageIndex===g.getPageCount()})]})]}),O(qm,{children:t&&O(Xm.div,{initial:{opacity:0},animate:{opacity:1},className:"bg-bg-default/50 absolute inset-0 h-full",children:O("div",{className:"flex h-[75vh] w-full items-center justify-center",children:O(ue,{})})})})]})}var zo=(e,t)=>{let r=e.getIsPinned();return i(r&&"bg-bg-default py-0",r&&!t&&"animate-table-pinned-shadow [animation-timeline:scroll(inline)]")},Vo=e=>{let t=e.getIsPinned();return{left:t==="left"?`${e.getStart("left")}px`:void 0,right:t==="right"?`${e.getAfter("right")}px`:void 0,position:t?"sticky":"relative"}};function ru({children:e,tooltip:t}){return t?O(Z,{content:t,children:O("span",{className:"cursor-help underline decoration-dotted underline-offset-2",children:e})}):O(Pi,{children:e})}import{formatDuration as ou,intervalToDuration as au}from"date-fns";import{useEffect as nu,useMemo as iu,useState as su}from"react";import{toast as Si}from"sonner";import{jsx as ot,jsxs as Ti}from"react/jsx-runtime";var Ri=24*60*60*1e3,lu=30*Ri;function cu(){if(typeof Intl<"u")try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"Local"}catch{}return"Local"}function gw({timestamp:e,rows:t,interactive:r=!0,...o}){return!e||new Date(e).toString()==="Invalid Date"?o.children:ot(Z,{content:ot(du,{timestamp:e,rows:t,interactive:r}),disableHoverableContent:!r,...o})}function du({timestamp:e,rows:t=["local","utc"],interactive:r}){if(!e)throw new Error("Falsy timestamp not permitted in TimestampTooltipContent");let o=new Date(e),a={year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0},n=new Date().getTime()-o.getTime(),c=au({start:o,end:new Date}),d=ou(c,{delimiter:", ",format:["years","months","days",...n<lu?["hours",...n<Ri?["minutes","seconds"]:[]]:[]]})+" ago",m=iu(()=>t.map(p=>({local:{label:cu(),shortLabel:new Date().toLocaleTimeString("en-US",{timeZoneName:"short"}).split(" ")[2],successMessageLabel:"local timestamp",value:o.toLocaleString("en-US",a)},utc:{label:"UTC",shortLabel:"UTC",successMessageLabel:"UTC timestamp",value:new Date(o.getTime()).toLocaleString("en-US",{...a,timeZone:"UTC"})},unix:{label:"UNIX Timestamp",successMessageLabel:"UNIX timestamp",value:(o.getTime()/1e3).toString(),valueMono:!0}})[p]),[t,o]),s=m.every(({shortLabel:p})=>p),[l,u]=su(0);return nu(()=>{let p=setInterval(()=>u(f=>f+1),1e3);return()=>clearInterval(p)},[]),Ti("div",{className:"flex max-w-[360px] flex-col gap-2 px-2.5 py-2 text-left text-xs",children:[n>0&&ot("span",{className:"text-content-subtle cursor-default",children:d}),ot("table",{children:m.map((p,f)=>Ti("tr",{className:i(r&&"before:bg-bg-emphasis relative select-none before:absolute before:-inset-x-1 before:inset-y-0 before:rounded before:opacity-0 before:content-[''] hover:cursor-copy hover:before:opacity-60 active:before:opacity-100"),onClick:r?async()=>{try{await navigator.clipboard.writeText(p.value),Si.success(`Copied ${p.successMessageLabel} to clipboard`)}catch(b){Si.error(`Failed to copy ${p.successMessageLabel} to clipboard`),console.error(`Failed to copy ${p.successMessageLabel} to clipboard`,b)}}:void 0,children:[ot("td",{className:"relative py-0.5",children:ot("span",{className:i("text-content-subtle truncate",s&&"bg-bg-inverted/10 rounded px-1 font-mono"),title:s?p.label:void 0,children:s?p.shortLabel:p.label})}),ot("td",{className:i("text-content-default relative whitespace-nowrap py-0.5 pl-3",s&&"pl-2",p.valueMono&&"font-mono"),children:p.value})]},f))})]})}import{LayoutGroup as mu,motion as Li}from"motion/react";import uu from"next/link";import{useId as pu}from"react";import{jsx as Vr,jsxs as fu}from"react/jsx-runtime";function Nw({options:e,selected:t,selectAction:r,layout:o=!0,className:a,optionClassName:n,indicatorClassName:c,style:d}){let m=pu();return Vr(mu,{id:m,children:Vr(Li.div,{layout:o,className:i("border-border-subtle bg-bg-default relative z-0 inline-flex items-center gap-1 rounded-xl border p-1",a),style:d,children:e.map(s=>{let l=s.value===t,u=s.href?uu:"button";return fu(u,{...s.href?{href:s.href}:{type:"button"},"data-selected":l,className:i("text-content-emphasis relative z-10 flex items-center gap-2 px-3 py-1 text-sm font-medium capitalize",!l&&"hover:text-content-subtle z-[11] transition-colors",n),onClick:()=>r==null?void 0:r(s.value),children:[typeof s.label=="string"?Vr("p",{children:s.label}):s.label,s.badge,l&&Vr(Li.div,{layoutId:m,className:i("border-border-subtle bg-bg-muted absolute left-0 top-0 -z-[1] h-full w-full rounded-lg border",c),transition:{duration:.25}})]},s.value)})})})}import{useEffect as gu,useId as bu,useRef as hu,useState as vu}from"react";import{jsx as ge,jsxs as Ho}from"react/jsx-runtime";var xu=[{key:"utm_source",icon:Ga,label:"Source",placeholder:"google",description:"Where the traffic is coming from"},{key:"utm_medium",icon:rn,label:"Medium",placeholder:"cpc",description:"How the traffic is coming"},{key:"utm_campaign",icon:Wa,label:"Campaign",placeholder:"summer sale",description:"The name of the campaign"},{key:"utm_term",icon:Qa,label:"Term",placeholder:"running shoes",description:"The term of the campaign"},{key:"utm_content",icon:en,label:"Content",placeholder:"logo link",description:"The content of the campaign"},{key:"ref",icon:$a,label:"Referral",placeholder:"yoursite.com",description:"The referral of the campaign"}];function Lw({values:e,onChange:t,disabled:r,autoFocus:o,disabledTooltip:a,className:n}){let{isMobile:c}=Q(),d=bu(),[m,s]=vu(!1),l=hu(null);return gu(()=>{l.current&&!c&&o&&setTimeout(()=>{var u;return(u=l.current)==null?void 0:u.focus()},10)},[]),ge("div",{className:i("grid gap-y-3",n),children:xu.map(({key:u,icon:p,label:f,placeholder:b,description:g},h)=>ge("div",{className:"group relative",children:Ho("div",{className:"relative z-10 flex",children:[ge(Z,{content:Ho("div",{className:"p-3 text-center text-xs",children:[ge("p",{className:"text-neutral-600",children:g}),ge("span",{className:"font-mono text-neutral-400",children:u})]}),sideOffset:4,disableHoverableContent:!0,children:Ho("div",{className:i("flex items-center gap-1.5 rounded-l-md border-y border-l border-neutral-300 bg-neutral-50 px-3 py-1.5 text-neutral-700",m?"sm:min-w-36":"sm:min-w-28"),onClick:()=>s(N=>!N),children:[ge(p,{className:"size-4 shrink-0"}),ge("label",{htmlFor:`${d}-${u}`,className:"select-none text-sm",children:m?ge("span",{className:"font-mono text-xs",children:u}):f})]})}),ge("div",{className:"min-w-0 grow",children:ge(ft,{tooltipProps:a?{content:a,disableHoverableContent:!0}:void 0,children:ge("input",{type:"text",id:`${d}-${u}`,ref:h===0?l:void 0,placeholder:b,disabled:r||Boolean(a),className:"size-full rounded-r-md border border-neutral-300 placeholder-neutral-400 focus:border-neutral-500 focus:ring-neutral-500 disabled:cursor-not-allowed sm:text-sm",value:e[u]||"",onChange:N=>t(u,N.target.value)})})})]})},u))})}import{jsx as _o,jsxs as yu}from"react/jsx-runtime";function Ew(){return yu("div",{style:Hr.backgroundMain,children:[_o("div",{style:Hr.backgroundMainBefore}),_o("div",{style:Hr.backgroundMainAfter}),_o("div",{style:Hr.backgroundContent})]})}var Hr={backgroundMain:{width:"100vw",minHeight:"100vh",position:"fixed",zIndex:1,display:"flex",justifyContent:"center",padding:"120px 24px 160px 24px",pointerEvents:"none"},backgroundMainBefore:{background:"radial-gradient(circle, rgba(2, 0, 36, 0) 0, #fafafa 100%)",position:"absolute",content:'""',zIndex:2,width:"100%",height:"100%",top:0},backgroundMainAfter:{content:'""',backgroundImage:"url(https://assets.dub.co/misc/grid.svg)",zIndex:1,position:"absolute",width:"100%",height:"100%",top:0,opacity:.4,filter:"invert(1)"},backgroundContent:{zIndex:3,width:"100%",maxWidth:"640px",backgroundImage:`radial-gradient(at 27% 37%, hsla(215, 98%, 61%, 1) 0px, transparent 0%),
64
+ `,Dm=60,Im=1e3/Dm;function Q3({dotSize:e=1,cellSize:t=3,speed:r=5,color:o=[0,0,0],className:n}){let a=Rm(null),[c,l]=Lm(!1);return Tm(()=>{let m=a.current;if(!m||!m.parentElement)return;let d=m.parentElement,s=window.devicePixelRatio||1;m.width=d.clientWidth*s,m.height=d.clientHeight*s;let u=m.getContext("webgl",{powerPreference:"low-power",depth:!1,stencil:!1});if(u===null){console.error("Failed to initialize WebGL");return}let p=u.createProgram();if(!p){console.error("Failed to create shader program");return}for(let R=0;R<2;++R){let S=R===0?Mm:Em,h=u.createShader(R===0?u.VERTEX_SHADER:u.FRAGMENT_SHADER);if(!h){console.error("Failed to create shader");return}u.shaderSource(h,S),u.compileShader(h),u.getShaderParameter(h,u.COMPILE_STATUS)||console.error(u.getShaderInfoLog(h)),u.attachShader(p,h),u.linkProgram(p)}u.getProgramParameter(p,u.LINK_STATUS)||console.error(u.getProgramInfoLog(p));let f=u.getAttribLocation(p,"position"),b=u.getUniformLocation(p,"time"),g=u.getUniformLocation(p,"resolution"),v=u.getUniformLocation(p,"dotSize"),C=u.getUniformLocation(p,"cellSize"),x=u.getUniformLocation(p,"speed"),N=u.getUniformLocation(p,"color");u.useProgram(p);let y=[1,1,-1,1,1,-1,-1,-1],L=u.createBuffer();u.bindBuffer(u.ARRAY_BUFFER,L),u.bufferData(u.ARRAY_BUFFER,new Float32Array(y),u.STATIC_DRAW),u.enableVertexAttribArray(f),u.vertexAttribPointer(f,2,u.FLOAT,!1,0,0),u.uniform1f(v,e*window.devicePixelRatio),u.uniform1f(C,t*window.devicePixelRatio),u.uniform1f(x,r),u.uniform3f(N,o[0],o[1],o[2]);let w,A=0;function T(R){if(R-A<Im){w=requestAnimationFrame(T);return}A=R,u&&m&&p&&(u.clear(u.COLOR_BUFFER_BIT|u.DEPTH_BUFFER_BIT),u.uniform1f(b,R/1e3),u.uniform2f(g,m.width,m.height),u.drawArrays(u.TRIANGLE_STRIP,0,4)),w=requestAnimationFrame(T)}return w=requestAnimationFrame(T),m.addEventListener("webglcontextlost",R=>{R.preventDefault(),l(!0),cancelAnimationFrame(w)}),()=>{cancelAnimationFrame(w),m.removeEventListener("webglcontextlost",()=>{})}},[e,t,r]),is("div",{className:i("absolute inset-0",n,c&&"opacity-0"),children:is("canvas",{ref:a,width:"100%",height:"100%",className:"size-full"})})}import*as Qe from"@radix-ui/react-slider";import{jsx as bt,jsxs as po}from"react/jsx-runtime";function rk({value:e,onChange:t,min:r,max:o,step:n=1,marks:a,className:c,hint:l,disabled:m}){let d=a||[r,r+(o-r)/3,r+2*(o-r)/3,o];return bt("div",{className:i("relative z-0 [--thumb-radius:13px] [--track-height:16px]",c),children:po("div",{className:"w-full",children:[po(Qe.Root,{className:"relative flex h-8 w-full items-center",value:[e],min:r,max:o,step:n,onValueChange:([s])=>t(s),disabled:m,"aria-label":"Slider",children:[po(Qe.Track,{className:"relative h-[var(--track-height)] w-full overflow-visible rounded-full bg-neutral-200",children:[bt("div",{className:"absolute left-0 top-0 h-full w-[var(--thumb-radius)] rounded-l-full bg-black"}),po("div",{className:"pointer-events-none absolute inset-x-[var(--thumb-radius)] inset-y-0",children:[bt(Qe.Range,{className:"absolute h-[var(--track-height)] bg-black"}),d.map(s=>{let u=(s-r)/(o-r)*100;return bt("span",{className:"absolute top-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-white",style:{left:`${u}%`}},s)})]})]}),bt(Qe.Thumb,{className:"z-20 flex size-[calc(var(--thumb-radius)*2)] items-center justify-center rounded-full border-0 bg-white shadow-[0_2px_2px_rgba(0,0,0,0.10),0_3px_3px_rgba(0,0,0,0.09)]",children:bt("span",{className:"block size-[calc(var(--thumb-radius)*1.23)] rounded-full bg-[#171717]"})})]}),l&&bt("div",{className:"mt-2 min-h-[1rem] text-xs text-neutral-500",children:l})]})})}import{useEffect as Am,useId as Om,useRef as Vm}from"react";import{jsx as fo,jsxs as ss}from"react/jsx-runtime";function ik({value:e,onChange:t,label:r,placeholder:o='E.g. "tomorrow at 5pm" or "in 2 hours"',className:n,required:a,autoFocus:c=!1}){let l=Om(),m=Vm(null);return Am(()=>{m.current&&c&&setTimeout(()=>{var d;(d=m.current)==null||d.focus()},10)},[c]),ss("div",{className:"flex flex-col gap-2",children:[r&&fo("div",{className:"flex items-center gap-2",children:fo("label",{htmlFor:`${l}-datetime`,className:"block text-sm font-medium text-neutral-700",children:r})}),ss("div",{className:i("flex w-full items-center justify-between rounded-md border border-neutral-300 bg-white shadow-sm transition-all focus-within:border-neutral-800 focus-within:outline-none focus-within:ring-1 focus-within:ring-neutral-500",n),children:[fo("input",{ref:m,id:`${l}-datetime`,type:"text",placeholder:o,defaultValue:e?Gt(e):"",onBlur:d=>{if(d.target.value.length>0){let s=Po(d.target.value);s&&(t(s),d.target.value=Gt(s))}},onKeyDown:d=>{if(d.key==="Enter"&&m.current){d.preventDefault();let s=Po(m.current.value);s&&(t(s),m.current.value=Gt(s))}},className:"flex-1 border-none bg-transparent text-neutral-900 placeholder-neutral-400 focus:outline-none focus:ring-0 sm:text-sm"}),fo("input",{type:"datetime-local",id:`${l}-datetime-local`,required:a,value:e?_n(e):"",onChange:d=>{let s=new Date(d.target.value);t(s),m.current&&(m.current.value=Gt(s))},className:"w-[40px] border-none bg-transparent text-neutral-500 focus:outline-none focus:ring-0 sm:text-sm"})]})]})}import{cva as zm}from"class-variance-authority";import{jsx as ls,jsxs as Hm}from"react/jsx-runtime";var Fm=zm("flex gap-1.5 items-center max-w-fit rounded-md px-2 py-1 text-xs font-medium whitespace-nowrap",{variants:{variant:{neutral:"bg-neutral-500/[.15] text-neutral-600",new:"bg-bg-info text-content-info",success:"bg-bg-success text-content-success",pending:"bg-bg-attention text-content-attention",warning:"bg-bg-warning text-content-warning",error:"bg-bg-error text-content-error"},size:{sm:"px-1.5 py-0.5",md:"px-2 py-1"}},defaultVariants:{variant:"neutral"}}),_m={neutral:pa,new:ua,success:ca,pending:ma,warning:Ro,error:Ro};function pk({className:e,variant:t,size:r,icon:o,tooltip:n,onClick:a,children:c,...l}){let m=o!==null?o??_m[t??"neutral"]:null;return ls(Et,{tooltipProps:n?{content:n}:void 0,children:Hm("span",{className:i(Fm({variant:t,size:r}),n&&"cursor-help",a&&"cursor-pointer select-none transition-[filter] duration-150 hover:brightness-75 hover:saturate-[1.25]",e),onClick:a,...l,children:[m&&ls(m,{className:"h-3 w-3 shrink-0"}),c]})})}import*as bo from"@radix-ui/react-switch";import{useMemo as $m}from"react";import{jsx as go}from"react/jsx-runtime";function Nk({fn:e,id:t,trackDimensions:r,thumbDimensions:o,thumbTranslate:n,thumbIcon:a,checked:c=!0,loading:l=!1,disabled:m=!1,disabledTooltip:d}){let s=$m(()=>d?!0:m||l,[d,m,l]),u=go(bo.Root,{checked:l?!1:c,name:"switch",id:t,...e&&{onCheckedChange:e},disabled:s,className:i("radix-state-checked:bg-blue-500 radix-state-unchecked:bg-neutral-200 relative inline-flex h-4 w-8 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out","focus:outline-none focus-visible:ring focus-visible:ring-blue-500 focus-visible:ring-opacity-75","data-[disabled]:cursor-not-allowed",r),children:go(bo.Thumb,{className:i(`radix-state-checked:${n}`,"radix-state-unchecked:translate-x-0","pointer-events-none h-3 w-3 translate-x-4 transform rounded-full bg-white shadow-lg ring-0 transition duration-200 ease-in-out",o,n),children:a})});return d?go(J,{content:d,children:go("div",{className:"inline-block leading-none",children:u})}):u}import{Command as cn}from"cmdk";import{useState as Bm}from"react";import{jsx as ht,jsxs as Wm}from"react/jsx-runtime";function Mk({table:e}){let[t,r]=Bm(!1);return ht(ne,{openPopover:t,setOpenPopover:r,content:ht(jr,{className:"max-h-[50vh]",children:ht(cn,{tabIndex:0,loop:!0,children:ht(cn.List,{className:"flex w-screen flex-col gap-1 p-1 text-sm focus-visible:outline-none sm:w-auto sm:min-w-[130px]",children:e.getAllColumns().filter(o=>o.getCanHide()).map(o=>{var n;return Wm(cn.Item,{className:i("flex cursor-pointer select-none items-center gap-2 whitespace-nowrap rounded-md px-3 py-1.5","data-[selected=true]:bg-neutral-100"),onSelect:()=>o.toggleVisibility(),children:[ht("input",{checked:o.getIsVisible(),type:"checkbox",className:"h-3 w-3 rounded-full border-neutral-300 text-black focus:outline-none focus:ring-0",disabled:!0}),(n=o.columnDef.header)==null?void 0:n.toString()]},o.id)})})})}),align:"end",children:ht(Q,{type:"button",className:"size-8 shrink-0 whitespace-nowrap rounded-lg p-0",variant:"outline",icon:ht(wa,{className:"h-4 w-4 shrink-0"})})})}import{flexRender as ur,getCoreRowModel as Km,useReactTable as jm}from"@tanstack/react-table";import{AnimatePresence as Ym,motion as qm}from"motion/react";import Zm from"next/link";import{memo as Xm,useEffect as dr,useMemo as ds,useRef as ps,useState as us}from"react";import{useEffect as Um,useState as Gm}from"react";import{jsx as cr,jsxs as dn}from"react/jsx-runtime";function cs({table:e,controls:t,className:r}){let o=e.getSelectedRowModel().rows.length,[n,a]=Gm(0);return Um(()=>{o!==0&&a(o)},[o]),Ke("Escape",()=>e.resetRowSelection(),{enabled:o>0,priority:2,modal:!1}),cr("div",{className:i("border-border-subtle w-full border-b bg-white","transition-opacity duration-100",o>0?"pointer-events-auto opacity-100":"pointer-events-none opacity-0",r),inert:o===0,children:dn("div",{className:"flex h-11 items-center py-2.5 pr-2",children:[cr("div",{className:"relative flex h-full w-12 shrink-0 items-center justify-center",children:cr("button",{type:"button",className:"absolute inset-0 flex items-center justify-center",onClick:c=>{c.stopPropagation(),e.toggleAllRowsSelected()},title:"Select all",children:cr(At,{className:"border-border-default pointer-events-none size-4 rounded data-[state=checked]:bg-black data-[state=indeterminate]:bg-black",checked:e.getIsAllRowsSelected()?!0:e.getIsSomeRowsSelected()?"indeterminate":!1})})}),dn("div",{className:"flex min-w-0 items-center gap-2.5 pl-1",children:[dn("span",{className:i("text-content-emphasis mr-2 text-sm font-medium tabular-nums transition-transform duration-150",o>0?"translate-x-0":"-translate-x-1"),children:[n," selected"]}),cr("div",{className:i("flex items-center gap-2 transition-transform duration-150",o>0?"translate-x-0":"-translate-x-1"),children:t==null?void 0:t(e)})]})]})})}import{Fragment as fs,jsx as B,jsxs as me}from"react/jsx-runtime";var un=48,mn=40,ms=new Set(["select","menu"]),pn=(e,t,r)=>i(["py-2.5 text-left text-sm leading-6 whitespace-nowrap border-border-subtle relative","border-l border-b",e==="select"&&"w-12 min-w-12 max-w-12 px-0 py-0",e==="menu"&&"bg-bg-default border-l-transparent py-0 px-1",!["select","menu"].includes(e)&&(r?"pl-1 pr-4":"px-4"),t&&"group-hover/row:bg-bg-muted transition-colors duration-75","group-data-[selected=true]/row:bg-blue-50"]),Jm=i(["absolute right-0 top-0 h-full w-1 cursor-col-resize select-none touch-none","bg-neutral-300/50","opacity-0 group-hover/resize:opacity-100 hover:opacity-100","group-hover/resize:bg-neutral-300 hover:bg-neutral-400","transition-all duration-200","-mr-px","after:absolute after:right-0 after:top-0 after:h-full after:w-4 after:translate-x-1/2"]);function r5(e){let{data:t,rowCount:r,columns:o,defaultColumn:n,columnPinning:a,pagination:c,onPaginationChange:l,getRowId:m,enableColumnResizing:d=!1,columnResizeMode:s="onChange"}=e,u=!!e.onRowSelectionChange||!!e.selectionControls,[p,f]=us(e.columnVisibility??{}),[b,g]=us(e.selectedRows??{}),v=ps(null);dr(()=>{if(!m||!t)return;let y=Object.entries(b);if(y.length>0){let L=y.filter(([w])=>t.find(A=>(m==null?void 0:m(A))===w));L.length!==y.length&&g(Object.fromEntries(L))}},[t,b,m]),dr(()=>{e.selectedRows&&!So(e.selectedRows,b)&&g(e.selectedRows??{})},[e.selectedRows]),dr(()=>{var y;(y=e.onRowSelectionChange)==null||y.call(e,N.getSelectedRowModel().rows)},[b]),dr(()=>{e.columnVisibility&&!So(e.columnVisibility,p)&&f(e.columnVisibility??{})},[e.columnVisibility]),dr(()=>{var y;(y=e.onColumnVisibilityChange)==null||y.call(e,p)},[p]);let C=ds(()=>o.map(y=>(y==null?void 0:y.id)==="menu"?{...y,minSize:mn,size:mn,maxSize:mn}:y),[o]),x=ds(()=>[...u?[{id:"select",enableHiding:!1,minSize:un,size:un,maxSize:un,header:({table:y})=>B("button",{type:"button",className:"flex size-full items-center justify-center",onClick:L=>{L.stopPropagation(),y.toggleAllRowsSelected()},title:"Select all",children:B(At,{className:"border-border-default pointer-events-none size-4 rounded data-[state=checked]:bg-black data-[state=indeterminate]:bg-black",checked:y.getIsAllRowsSelected()?!0:y.getIsSomeRowsSelected()?"indeterminate":!1})}),cell:({row:y,table:L})=>B("button",{type:"button",className:"flex size-full items-center justify-center",onClick:A=>{A.stopPropagation();let T=m==null?void 0:m(y.original),R=L.getRowModel().rows,S=v.current!==null?R.findIndex(h=>(m==null?void 0:m(h.original))===v.current):-1;if(A.shiftKey&&v.current!==null&&S!==-1){let h=T!==void 0?R.findIndex(I=>(m==null?void 0:m(I.original))===T):-1;if(h===-1){y.toggleSelected(),v.current=T??null;return}let k=Math.min(S,h),E=Math.max(S,h),M=R.slice(k,E+1).map(I=>m==null?void 0:m(I.original)).filter(I=>I!==void 0);L.setRowSelection(I=>{let z=M.filter(F=>F!==void 0),ye=T!==void 0&&((I==null?void 0:I[T])??!1);return{...I,...Object.fromEntries(z.map(F=>[F,!ye]))}}),v.current=T??null}else y.toggleSelected(),v.current=T??null},title:"Select",children:B(At,{className:"border-border-default pointer-events-none size-4 rounded data-[state=checked]:bg-black data-[state=indeterminate]:bg-black",checked:y.getIsSelected()})})}]:[],...C],[u,C]),N=jm({data:t,rowCount:r,columns:x,defaultColumn:{minSize:d?120:0,size:d?120:0,maxSize:d?300:void 0,enableResizing:d,...n},getCoreRowModel:Km(),onPaginationChange:l,onColumnVisibilityChange:y=>f(y),onRowSelectionChange:g,state:{pagination:c,columnVisibility:p,columnPinning:{left:[],right:[],...a},rowSelection:b},manualPagination:!0,autoResetPageIndex:!1,manualSorting:!0,getRowId:m,enableColumnResizing:d,columnResizeMode:s});return{...e,columnVisibility:p,table:N,enableColumnResizing:d}}var Qm=Xm(function({row:t,onRowClick:r,onRowAuxClick:o,rowProps:n,cellRight:a,tdClassName:c,table:l}){let{className:m,...d}=n||{};return B("tr",{className:i("group/row",r&&"cursor-pointer select-none",l.getRowModel().rows.length>8&&t.index===l.getRowModel().rows.length-1&&"[&_td]:border-b-0",m),onClick:r?s=>{Ce(s)||r(t,s)}:void 0,onAuxClick:o?s=>{Ce(s)||o(t,s)}:void 0,"data-selected":t.getIsSelected(),...d,children:t.getVisibleCells().map((s,u,p)=>{var C,x;let f=["select","menu"].includes(s.column.id),b=s.column.id==="select",g=((C=p[u-1])==null?void 0:C.column.id)==="select",v=!!((x=s.column.columnDef.meta)!=null&&x.disableTruncate);return B("td",{className:i(pn(s.column.id,!!r,g),"text-content-default group",fn(s.column,t.index===l.getRowModel().rows.length-1),typeof c=="function"?c(s.column.id,t):c),style:{width:s.column.getSize(),...gn(s.column)},children:b?B("div",{className:"absolute inset-0 flex items-center justify-center",children:ur(s.column.columnDef.cell,s.getContext())}):me("div",{className:i("flex items-center",f?"justify-center":"w-full justify-between",!f&&(v?"overflow-visible":"overflow-hidden truncate")),children:[B("div",{className:i(v?"whitespace-nowrap":"truncate",f?"shrink-0":"min-w-0 shrink grow",v&&!f&&"min-w-max shrink-0"),children:ur(s.column.columnDef.cell,s.getContext())}),!f&&(a==null?void 0:a(s))]})},s.id)})},t.id)},(e,t)=>{let r=e.row,o=t.row;return r.original===o.original&&r.getIsSelected()===o.getIsSelected()});function o5({data:e,loading:t,error:r,emptyState:o,cellRight:n,sortBy:a,sortOrder:c,onSortChange:l,sortableColumns:m=[],className:d,containerClassName:s,scrollWrapperClassName:u,emptyWrapperClassName:p,thClassName:f,tdClassName:b,table:g,pagination:v,paginationAllRowsHref:C,resourceName:x,onRowClick:N,onRowAuxClick:y,onRowSelectionChange:L,selectionControls:w,rowProps:A,rowCount:T,children:R,enableColumnResizing:S=!1}){let h=!!L||!!w,k=g.getVisibleLeafColumns(),E=new Set;for(let F=1;F<k.length;F++)k[F-1].id==="select"&&E.add(k[F].id);let M=ps(null),I=new Map(k.map(F=>[F.id,F.getSize()])),z=(F,D)=>I.get(F)??D,ye=C?Zm:"span";return me("div",{className:i("border-border-subtle bg-bg-default relative z-0 rounded-xl border",s),children:[!r&&!!(e!=null&&e.length)||t?me(fs,{children:[h&&B(cs,{table:g,controls:w,className:"absolute left-0 top-0 z-10 rounded-t-[inherit]"}),me("div",{ref:M,className:i("relative min-h-[400px] overflow-x-auto rounded-[inherit]",u),children:[me("table",{className:i(["group/table w-full border-separate border-spacing-0 transition-[border-spacing,margin-top]","[&_tr>*:first-child]:border-l-transparent","[&_tr>*:last-child]:border-r-transparent","[&_tr>*:last-child]:border-r-transparent","[&_th]:relative [&_th]:select-none",S&&"[&_th]:group/resize"],d),style:{width:"100%",tableLayout:S?"fixed":"auto",minWidth:S?g.getVisibleLeafColumns().reduce((F,D)=>F+D.getSize(),0):"100%"},children:[B("thead",{className:"relative",children:g.getHeaderGroups().map(F=>B("tr",{children:F.headers.map(D=>{let Be=m.includes(D.column.id),Wt=Be?"button":"div",$=E.has(D.column.id);return me("th",{colSpan:D.colSpan,className:i(pn(D.column.id,!1,$),"text-content-emphasis select-none font-medium",fn(D.column,!g.getRowModel().rows.length),typeof f=="function"?f(D.column.id):f,S&&"relative"),style:{width:ms.has(D.column.id)?z(D.column.id,D.getSize()):S?D.getSize():void 0,...gn(D.column)},children:[B("div",{className:i(D.column.id==="select"?"absolute inset-0 flex items-center justify-center":"flex items-center justify-between gap-6 !pr-0"),children:me(Wt,{className:i(D.column.id==="select"?"flex size-full items-center justify-center":"flex items-center gap-2"),...Be&&{type:"button",disabled:!Be,"aria-label":"Sort by column",onClick:()=>l==null?void 0:l({sortBy:D.column.id,sortOrder:a!==D.column.id||c==="asc"?"desc":"asc"})},children:[D.isPlaceholder?null:(()=>{var re;let le=ur(D.column.columnDef.header,D.getContext()),We=(re=D.column.columnDef.meta)==null?void 0:re.headerTooltip;return B(ep,{tooltip:We,children:le})})(),Be&&a===D.column.id&&B(Yn,{className:"h-3 w-3 shrink-0",order:c||"desc"})]})}),S&&D.column.getCanResize()&&!["select","menu"].includes(D.column.id)&&B("div",{onMouseDown:D.getResizeHandler(),onTouchStart:D.getResizeHandler(),onClick:le=>le.stopPropagation(),className:Jm})]},D.id)})},F.id))}),B("tbody",{children:g.getRowModel().rows.map(F=>{let D=typeof A=="function"?A(F):A,{className:Be,...Wt}=D||{};return S?B(Qm,{row:F,onRowClick:N,onRowAuxClick:y,rowProps:D,cellRight:n,tdClassName:b,table:g},`${F.id}-${g.getVisibleLeafColumns().map($=>$.id).join(",")}`):B("tr",{className:i("group/row",N&&"cursor-pointer select-none",g.getRowModel().rows.length>8&&F.index===g.getRowModel().rows.length-1&&"[&_td]:border-b-0",Be),onClick:N?$=>{Ce($)||N(F,$)}:void 0,onAuxClick:y?$=>{Ce($)||y(F,$)}:void 0,"data-selected":F.getIsSelected(),...Wt,children:F.getVisibleCells().map($=>{var Ut;let le=["select","menu"].includes($.column.id),We=$.column.id==="select",re=E.has($.column.id),nt=!!((Ut=$.column.columnDef.meta)!=null&&Ut.disableTruncate);return B("td",{className:i(pn($.column.id,!!N,re),"text-content-default group",fn($.column,F.index===g.getRowModel().rows.length-1),typeof b=="function"?b($.column.id,F):b),style:{minWidth:$.column.columnDef.minSize,maxWidth:$.column.columnDef.maxSize,width:ms.has($.column.id)?z($.column.id,$.column.getSize()):S?$.column.columnDef.size:"auto",...gn($.column)},children:We?B("div",{className:"absolute inset-0 flex items-center justify-center",children:ur($.column.columnDef.cell,$.getContext())}):me("div",{className:i("flex items-center",le?"justify-center":"w-full justify-between",!le&&(nt?"overflow-visible":"overflow-hidden truncate")),children:[B("div",{className:i(nt?"whitespace-nowrap":"truncate",le?"shrink-0":"min-w-0 shrink grow",nt&&!le&&"min-w-max shrink-0"),children:ur($.column.columnDef.cell,$.getContext())}),!le&&(n==null?void 0:n($))]})},$.id)})},F.id)})})]}),R]})]}):B("div",{className:i("text-content-subtle flex h-96 w-full items-center justify-center text-sm",p),children:r||o||`No ${(x==null?void 0:x(!0))||"items"} found.`}),v&&!r&&!!(e!=null&&e.length)&&!!T&&me("div",{className:"border-border-subtle bg-bg-default text-content-default sticky bottom-0 z-10 mx-auto -mt-px flex w-full max-w-full items-center justify-between rounded-b-[inherit] border-t px-4 py-3.5 text-sm leading-6",children:[me("div",{children:[B("span",{className:"hidden sm:inline-block",children:"Viewing"})," ",me("span",{className:"font-medium",children:[((v.pageIndex-1)*v.pageSize+1).toLocaleString(),"-",Math.min((v.pageIndex-1)*v.pageSize+v.pageSize,g.getRowCount()).toLocaleString()]})," ","of"," ",me(ye,{href:C??"#",className:"font-medium",children:[g.getRowCount().toLocaleString()," ",(x==null?void 0:x(g.getRowCount()!==1))||"items"]})]}),me("div",{className:"flex items-center gap-2",children:[B(Q,{variant:"secondary",text:"Previous",className:"h-7 px-2",onClick:()=>g.previousPage(),disabled:v.pageIndex===1}),B(Q,{variant:"secondary",text:"Next",className:"h-7 px-2",onClick:()=>g.nextPage(),disabled:v.pageIndex===g.getPageCount()})]})]}),B(Ym,{children:t&&B(qm.div,{initial:{opacity:0},animate:{opacity:1},className:"bg-bg-default/50 absolute inset-0 h-full rounded-xl",children:B("div",{className:"flex h-[min(75%,75vh)] w-full items-center justify-center",children:B(ae,{})})})})]})}var fn=(e,t)=>{let r=e.getIsPinned();return i(r&&"bg-bg-default py-0",r&&!t&&"animate-table-pinned-shadow [animation-timeline:scroll(inline)]")},gn=e=>{let t=e.getIsPinned();return{left:t==="left"?`${e.getStart("left")}px`:void 0,right:t==="right"?`${e.getAfter("right")}px`:void 0,position:t?"sticky":"relative"}};function ep({children:e,tooltip:t}){return t?B(J,{content:t,children:B("span",{className:"cursor-help underline decoration-dotted underline-offset-2",children:e})}):B(fs,{children:e})}import{formatDuration as tp,intervalToDuration as rp}from"date-fns";import{useEffect as op,useMemo as np,useState as ap}from"react";import{toast as gs}from"sonner";import{jsx as et,jsxs as bs}from"react/jsx-runtime";var hs=24*60*60*1e3,ip=30*hs;function sp(){if(typeof Intl<"u")try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"Local"}catch{}return"Local"}function u5({timestamp:e,rows:t,interactive:r=!0,...o}){return!e||new Date(e).toString()==="Invalid Date"?o.children:et(J,{content:et(lp,{timestamp:e,rows:t,interactive:r}),disableHoverableContent:!r,...o})}function lp({timestamp:e,rows:t=["local","utc"],interactive:r}){if(!e)throw new Error("Falsy timestamp not permitted in TimestampTooltipContent");let o=new Date(e),n={year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0},a=new Date().getTime()-o.getTime(),c=rp({start:o,end:new Date}),l=tp(c,{delimiter:", ",format:["years","months","days",...a<ip?["hours",...a<hs?["minutes","seconds"]:[]]:[]]})+" ago",m=np(()=>t.map(p=>({local:{label:sp(),shortLabel:new Date().toLocaleTimeString("en-US",{timeZoneName:"short"}).split(" ")[2],successMessageLabel:"local timestamp",value:o.toLocaleString("en-US",n)},utc:{label:"UTC",shortLabel:"UTC",successMessageLabel:"UTC timestamp",value:new Date(o.getTime()).toLocaleString("en-US",{...n,timeZone:"UTC"})},unix:{label:"UNIX Timestamp",successMessageLabel:"UNIX timestamp",value:(o.getTime()/1e3).toString(),valueMono:!0}})[p]),[t,o]),d=m.every(({shortLabel:p})=>p),[s,u]=ap(0);return op(()=>{let p=setInterval(()=>u(f=>f+1),1e3);return()=>clearInterval(p)},[]),bs("div",{className:"flex max-w-[360px] flex-col gap-2 px-2.5 py-2 text-left text-xs",children:[a>0&&et("span",{className:"text-content-subtle cursor-default",children:l}),et("table",{children:et("tbody",{children:m.map((p,f)=>bs("tr",{className:i(r&&"before:bg-bg-emphasis relative select-none before:absolute before:-inset-x-1 before:inset-y-0 before:rounded before:opacity-0 before:content-[''] hover:cursor-copy hover:before:opacity-60 active:before:opacity-100"),onClick:r?async()=>{try{await navigator.clipboard.writeText(p.value),gs.success(`Copied ${p.successMessageLabel} to clipboard`)}catch(b){gs.error(`Failed to copy ${p.successMessageLabel} to clipboard`),console.error(`Failed to copy ${p.successMessageLabel} to clipboard`,b)}}:void 0,children:[et("td",{className:"relative py-0.5",children:et("span",{className:i("text-content-subtle truncate",d&&"bg-bg-inverted/10 rounded px-1 font-mono"),title:d?p.label:void 0,children:d?p.shortLabel:p.label})}),et("td",{className:i("text-content-default relative whitespace-nowrap py-0.5 pl-3",d&&"pl-2",p.valueMono&&"font-mono"),children:p.value})]},f))})})]})}import{LayoutGroup as cp,motion as vs}from"motion/react";import dp from"next/link";import{useId as up}from"react";import{jsx as ho,jsxs as mp}from"react/jsx-runtime";function h5({options:e,selected:t,selectAction:r,layout:o=!0,className:n,optionClassName:a,indicatorClassName:c,style:l}){let m=up();return ho(cp,{id:m,children:ho(vs.div,{layout:o,className:i("border-border-subtle bg-bg-default relative z-0 inline-flex items-center gap-1 rounded-xl border p-1",n),style:l,children:e.map(d=>{let s=d.value===t,u=d.href?dp:"button";return mp(u,{...d.href?{href:d.href}:{type:"button"},"data-selected":s,className:i("text-content-emphasis relative z-10 flex items-center gap-2 px-3 py-1 text-sm font-medium capitalize",!s&&"hover:text-content-subtle z-[11] transition-colors",a),onClick:()=>r==null?void 0:r(d.value),children:[typeof d.label=="string"?ho("p",{children:d.label}):d.label,d.badge,s&&ho(vs.div,{layoutId:m,className:i("border-border-subtle bg-bg-muted absolute left-0 top-0 -z-[1] h-full w-full rounded-lg border",c),transition:{duration:.25}})]},d.value)})})})}import{useEffect as pp,useId as fp,useRef as gp,useState as bp}from"react";import{jsx as we,jsxs as bn}from"react/jsx-runtime";var hp=[{key:"utm_source",icon:Ca,label:"Source",placeholder:"google",description:"Where the traffic is coming from"},{key:"utm_medium",icon:Oa,label:"Medium",placeholder:"cpc",description:"How the traffic is coming"},{key:"utm_campaign",icon:Na,label:"Campaign",placeholder:"summer sale",description:"The name of the campaign"},{key:"utm_term",icon:Da,label:"Term",placeholder:"running shoes",description:"The term of the campaign"},{key:"utm_content",icon:Ia,label:"Content",placeholder:"logo link",description:"The content of the campaign"},{key:"ref",icon:ka,label:"Referral",placeholder:"yoursite.com",description:"The referral of the campaign"}];function P5({values:e,onChange:t,disabled:r,autoFocus:o,disabledTooltip:n,className:a}){let{isMobile:c}=ie(),l=fp(),[m,d]=bp(!1),s=gp(null);return pp(()=>{s.current&&!c&&o&&setTimeout(()=>{var u;return(u=s.current)==null?void 0:u.focus()},10)},[]),we("div",{className:i("grid gap-y-3",a),children:hp.map(({key:u,icon:p,label:f,placeholder:b,description:g},v)=>we("div",{className:"group relative",children:bn("div",{className:"relative z-10 flex",children:[we(J,{content:bn("div",{className:"p-3 text-center text-xs",children:[we("p",{className:"text-neutral-600",children:g}),we("span",{className:"font-mono text-neutral-400",children:u})]}),sideOffset:4,disableHoverableContent:!0,children:bn("div",{className:i("flex items-center gap-1.5 rounded-l-md border-y border-l border-neutral-300 bg-neutral-50 px-3 py-1.5 text-neutral-700",m?"sm:min-w-36":"sm:min-w-28"),onClick:()=>d(C=>!C),children:[we(p,{className:"size-4 shrink-0"}),we("label",{htmlFor:`${l}-${u}`,className:"select-none text-sm",children:m?we("span",{className:"font-mono text-xs",children:u}):f})]})}),we("div",{className:"min-w-0 grow",children:we(Et,{tooltipProps:n?{content:n,disableHoverableContent:!0}:void 0,children:we("input",{type:"text",id:`${l}-${u}`,ref:v===0?s:void 0,placeholder:b,disabled:r||Boolean(n),className:"size-full rounded-r-md border border-neutral-300 placeholder-neutral-400 focus:border-neutral-500 focus:ring-neutral-500 disabled:cursor-not-allowed sm:text-sm",value:e[u]||"",onChange:C=>t(u,C.target.value)})})})]})},u))})}import{jsx as hn,jsxs as vp}from"react/jsx-runtime";function T5(){return vp("div",{style:vo.backgroundMain,children:[hn("div",{style:vo.backgroundMainBefore}),hn("div",{style:vo.backgroundMainAfter}),hn("div",{style:vo.backgroundContent})]})}var vo={backgroundMain:{width:"100vw",minHeight:"100vh",position:"fixed",zIndex:1,display:"flex",justifyContent:"center",padding:"120px 24px 160px 24px",pointerEvents:"none"},backgroundMainBefore:{background:"radial-gradient(circle, rgba(2, 0, 36, 0) 0, #fafafa 100%)",position:"absolute",content:'""',zIndex:2,width:"100%",height:"100%",top:0},backgroundMainAfter:{content:'""',backgroundImage:"url(https://assets.dub.co/misc/grid.svg)",zIndex:1,position:"absolute",width:"100%",height:"100%",top:0,opacity:.4,filter:"invert(1)"},backgroundContent:{zIndex:3,width:"100%",maxWidth:"640px",backgroundImage:`radial-gradient(at 27% 37%, hsla(215, 98%, 61%, 1) 0px, transparent 0%),
44
65
  radial-gradient(at 97% 21%, hsla(125, 98%, 72%, 1) 0px, transparent 50%),
45
66
  radial-gradient(at 52% 99%, hsla(354, 98%, 61%, 1) 0px, transparent 50%),
46
67
  radial-gradient(at 10% 29%, hsla(256, 96%, 67%, 1) 0px, transparent 50%),
47
68
  radial-gradient(at 97% 96%, hsla(38, 60%, 74%, 1) 0px, transparent 50%),
48
69
  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 dp}from"lucide-react";import mp from"next/image";import Be from"next/link";import{useParams as up}from"next/navigation";import{useState as pp}from"react";import{jsx as Mi}from"react/jsx-runtime";function _t({className:e}){return Mi("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:Mi("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 _r=[{id:"links",title:"Dub Links",description:"Short links with superpowers",icon:mt,href:"/links"},{id:"partners",title:"Dub Partners",description:"Grow your revenue with partnerships",icon:ut,href:"/partners"},{id:"analytics",title:"Dub Analytics",description:"Powerful real-time analytics",icon:dt,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:sn,href:"/integrations"}],Fo=[{icon:wa,iconClassName:"py-0.5 group-hover:text-[#3178C6]",title:"Typescript",href:"/sdks/typescript"},{icon:ya,iconClassName:"py-0.5 [&_.snake]:transition-colors group-hover:[&_.snake1]:text-[#3776ab] group-hover:[&_.snake2]:text-[#ffd343]",title:"Python",href:"/sdks/python"},{icon:va,iconClassName:"group-hover:text-[#00ACD7]",title:"Go",href:"/sdks/go"},{icon:Na,iconClassName:"py-[3px] grayscale brightness-150 transition-[filter] group-hover:grayscale-0 group-hover:brightness-100",title:"Ruby",href:"/sdks/ruby"},{icon:xa,iconClassName:"py-[3px] grayscale brightness-150 transition-[filter] group-hover:grayscale-0 group-hover:brightness-100",title:"PHP",href:"/sdks/php"}],Ei=[{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:Tt,title:"Affiliate Management",description:"Manage affiliates and automate payouts",href:"/partners"},{label:"SDKs",items:Fo}],Ft=[{icon:lr,title:"Help Center",description:"Answers to your questions",href:"/help"},{icon:nr,title:"Docs",description:"Platform documentation",href:"/docs/introduction"},{icon:Tt,title:"About",description:"Company, values, and team",href:"/about"},{icon:Pa,title:"Careers",description:"Join our global, remote team",href:"/careers"},{icon:Ba,title:"Blog",description:"Insights and stories",href:"/blog"},{icon:Sa,title:"Changelog",description:"Releases and updates",href:"/changelog"},{icon:_t,title:"Brand Guidelines",description:"Logos, wordmark, etc.",href:"/brand"},{icon:Ha,title:"Contact",description:"Reach out to support or sales",href:"/contact"}],Di=[{name:"Bitly",slug:"bitly"},{name:"Rebrandly",slug:"rebrandly"},{name:"Short.io",slug:"short"},{name:"Bl.ink",slug:"blink"}],Ai=[{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"}],Hw=[{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 Nu}from"react/jsx-runtime";function Fr({className:e,children:t}){return Nu("div",{className:i("mx-auto w-full max-w-screen-xl px-3 lg:px-10",e),children:t})}import*as Fe from"@radix-ui/react-popover";import{BoxSelect as Qu,Home as ep,LayoutGrid as tp,Type as rp}from"lucide-react";import{useParams as op}from"next/navigation";import{useCallback as ap,useContext as np,useState as ip}from"react";import{toast as sp}from"sonner";import*as de from"@radix-ui/react-navigation-menu";import{LayoutGroup as Vu}from"motion/react";import Gt from"next/link";import{useParams as Hu,usePathname as _u}from"next/navigation";import{createContext as Fu,useId as Bu}from"react";import Wu from"swr";import{Link as _i}from"@radix-ui/react-navigation-menu";import Fi from"next/image";import Bi from"next/link";import{Link2 as wu}from"lucide-react";import{jsx as q,jsxs as J}from"react/jsx-runtime";var Ii={clicks:{color:"#3B82F6",value:"12.5K"},leads:{color:"#A855F7",value:"8.2K"},sales:{color:"#14B8A6",value:"$12K"}},at={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 Oi({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:[q("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"}),q("circle",{cx:"259.333",cy:"72",r:"3",fill:"#00BBA7"}),q("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:[q(wu,{className:"size-3 rotate-90"}),"d.to/try"]}),q("div",{className:"text-content-default mt-1 px-1.5 pb-0.5 text-[0.8125rem] font-medium sm:mt-2",children:"Apr 2025"})]}),q("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:[q("div",{className:"size-2 rounded-sm border border-black/20 bg-current opacity-70",style:{color:Ii[t].color}}),q("div",{className:"text-content-subtle text-xs font-medium leading-none",children:Qt(t)})]}),J("span",{className:"text-content-emphasis text-xs leading-none",children:[t==="sales"?"$":"",Ii[t].value]})]},t))})]}),q("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:[q("div",{className:"bg-bg-emphasis size-11 rounded-full",style:{backgroundImage:"url(https://assets.dub.co/home/people.png)",backgroundSize:"3600%",backgroundPositionX:at.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:[q(za,{className:"text-content-default size-3.5"}),at.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:[q("img",{src:`https://flag.vercel.app/m/${at.country}.svg`,className:"relative h-2.5 w-3 rounded-sm"}),at.country]})]})]}),q("div",{className:"text-content-emphasis mt-4 text-[0.8125rem] font-medium",children:at.name}),q("div",{className:"text-content-subtle mt-px text-xs",children:at.email})]}),q("div",{className:"border-border-default flex flex-col gap-2.5 border-t px-3 pb-2.5 pt-3",children:Object.entries(at.details).map(([t,r])=>J("div",{className:"relative flex items-center justify-between gap-2 text-xs leading-none",children:[q("span",{className:"text-content-muted truncate font-medium",children:t}),q("span",{className:"text-content-default",children:r})]},t))})]})})]})]})}import{useId as ku}from"react";import{jsx as v,jsxs as ce}from"react/jsx-runtime";function zi(e){let t=ku();return ce("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:[ce("defs",{children:[v("path",{id:`${t}-m`,className:"fill-[var(--bg)]",d:"M0 0h10.24v10.24H0z"}),v("path",{id:`${t}-n`,className:"fill-[var(--bg)]",d:"M0 0h8.05v8.05H0z"}),v("path",{id:`${t}-o`,className:"fill-[var(--bg)]",d:"M0 0h11.71v11.71H0z"})]}),v("rect",{width:"292",height:"52",x:"4",y:"4",rx:"8.78",className:"fill-[var(--bg)]"}),v("rect",{width:"292",height:"52",x:"4",y:"4",className:"stroke-[var(--border)]",strokeWidth:"0.73",rx:"8.78"}),v("rect",{width:"24.88",height:"24.88",x:"17.17",y:"17.56",fill:`url(#${t}-a)`,rx:"12.44"}),v("rect",{width:"25.61",height:"25.61",x:"16.8",y:"17.2",className:"stroke-[var(--border)]",strokeWidth:"0.73",rx:"12.8"}),v("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"}),v("text",{xmlSpace:"preserve",className:"fill-[var(--fg)]",fontSize:"10.24",fontWeight:"600",style:{whiteSpace:"pre"},children:v("tspan",{x:"50.83",y:"25.49",children:"d.to"})}),ce("g",{className:"stroke-[var(--fg)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-b)`,children:[v("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"}),v("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"})]}),v("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"}),ce("g",{stroke:"#A1A1A1",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-c)`,children:[v("path",{d:"M59.11 38.38h-4.7a.9.9 0 0 1-.89-.89V35.7"}),v("path",{d:"m57.21 36.48 1.9 1.9-1.9 1.9"})]}),v("text",{xmlSpace:"preserve",fill:"#737373",fontSize:"10.24",fontWeight:"500",style:{whiteSpace:"pre"},children:v("tspan",{x:"63.27",y:"41.59",children:"dub.co"})}),v("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"}),v("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"}),v("g",{className:"stroke-[var(--muted)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-d)`,children:v("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"})}),v("text",{xmlSpace:"preserve",className:"fill-[var(--muted)]",fontSize:"8.78",fontWeight:"500",style:{whiteSpace:"pre"},children:v("tspan",{x:"220.78",y:"33.19",children:"151.8K clicks"})}),v("rect",{width:"292",height:"52",x:"4",y:"64",rx:"8.78",className:"fill-[var(--bg)]"}),v("rect",{width:"292",height:"52",x:"4",y:"64",className:"stroke-[var(--border)]",strokeWidth:"0.73",rx:"8.78"}),v("rect",{width:"24.88",height:"24.88",x:"17.17",y:"77.56",fill:`url(#${t}-e)`,rx:"12.44"}),v("rect",{width:"25.61",height:"25.61",x:"16.8",y:"77.19",className:"stroke-[var(--border)]",strokeWidth:"0.73",rx:"12.8"}),v("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"}),v("text",{xmlSpace:"preserve",className:"fill-[var(--fg)]",fontSize:"10.24",fontWeight:"600",style:{whiteSpace:"pre"},children:v("tspan",{x:"50.83",y:"85.49",children:"d.to/register"})}),ce("g",{className:"stroke-[var(--fg)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-f)`,children:[v("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"}),v("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"})]}),v("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"}),ce("g",{stroke:"#A1A1A1",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-g)`,children:[v("path",{d:"M59.11 98.38h-4.7a.9.9 0 0 1-.89-.89V95.7"}),v("path",{d:"m57.21 96.48 1.9 1.9-1.9 1.9"})]}),v("text",{xmlSpace:"preserve",fill:"#737373",fontSize:"10.24",fontWeight:"500",style:{whiteSpace:"pre"},children:v("tspan",{x:"63.27",y:"101.59",children:"app.dub.co/register"})}),v("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"}),v("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"}),v("g",{className:"stroke-[var(--muted)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-h)`,children:v("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"})}),v("text",{xmlSpace:"preserve",className:"fill-[var(--muted)]",fontSize:"8.78",fontWeight:"500",style:{whiteSpace:"pre"},children:v("tspan",{x:"226.78",y:"93.19",children:"100K clicks"})}),v("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"}),v("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"}),v("rect",{width:"24.88",height:"24.88",x:"17.17",y:"137.56",fill:`url(#${t}-i)`,rx:"12.44"}),v("rect",{width:"25.61",height:"25.61",x:"16.8",y:"137.19",className:"stroke-[var(--border)]",strokeWidth:"0.73",rx:"12.8"}),v("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"}),v("text",{xmlSpace:"preserve",className:"fill-[var(--fg)]",fontSize:"10.24",fontWeight:"600",style:{whiteSpace:"pre"},children:v("tspan",{x:"50.83",y:"145.49",children:"d.to/try"})}),ce("g",{className:"stroke-[var(--fg)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-j)`,children:[v("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"}),v("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"})]}),v("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"}),ce("g",{stroke:"#A1A1A1",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-k)`,children:[v("path",{d:"M59.11 158.38h-4.7a.9.9 0 0 1-.89-.89v-1.79"}),v("path",{d:"m57.21 156.48 1.9 1.9-1.9 1.9"})]}),v("text",{xmlSpace:"preserve",fill:"#737373",fontSize:"10.24",fontWeight:"500",style:{whiteSpace:"pre"},children:v("tspan",{x:"63.27",y:"161.59",children:"app.dub.co/register"})}),v("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"}),v("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"}),v("g",{className:"stroke-[var(--muted)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-l)`,children:v("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"})}),v("text",{xmlSpace:"preserve",className:"fill-[var(--muted)]",fontSize:"8.78",fontWeight:"500",style:{whiteSpace:"pre"},children:v("tspan",{x:"223.78",y:"153.19",children:"65.8K clicks"})}),ce("defs",{children:[v("clipPath",{id:`${t}-b`,children:v("use",{xlinkHref:`#${t}-m`,transform:"translate(80.34 16.83)"})}),v("clipPath",{id:`${t}-c`,children:v("use",{xlinkHref:`#${t}-n`,transform:"translate(52.3 34.02)"})}),v("clipPath",{id:`${t}-d`,children:v("use",{xlinkHref:`#${t}-o`,transform:"translate(204.68 24.15)"})}),v("clipPath",{id:`${t}-f`,children:v("use",{xlinkHref:`#${t}-m`,transform:"translate(122.34 76.83)"})}),v("clipPath",{id:`${t}-g`,children:v("use",{xlinkHref:`#${t}-n`,transform:"translate(52.3 94.02)"})}),v("clipPath",{id:`${t}-h`,children:v("use",{xlinkHref:`#${t}-o`,transform:"translate(210.68 84.15)"})}),v("clipPath",{id:`${t}-j`,children:v("use",{xlinkHref:`#${t}-m`,transform:"translate(98.34 136.83)"})}),v("clipPath",{id:`${t}-k`,children:v("use",{xlinkHref:`#${t}-n`,transform:"translate(52.3 154.02)"})}),v("clipPath",{id:`${t}-l`,children:v("use",{xlinkHref:`#${t}-o`,transform:"translate(207.68 144.15)"})}),ce("linearGradient",{id:`${t}-a`,x1:"29.61",x2:"29.61",y1:"17.56",y2:"42.44",gradientUnits:"userSpaceOnUse",children:[v("stop",{stopColor:"#030712",stopOpacity:"0"}),v("stop",{offset:"1",stopColor:"#030712",stopOpacity:"0.05"})]}),ce("linearGradient",{id:`${t}-e`,x1:"29.61",x2:"29.61",y1:"77.56",y2:"102.44",gradientUnits:"userSpaceOnUse",children:[v("stop",{stopColor:"#030712",stopOpacity:"0"}),v("stop",{offset:"1",stopColor:"#030712",stopOpacity:"0.05"})]}),ce("linearGradient",{id:`${t}-i`,x1:"29.61",x2:"29.61",y1:"137.56",y2:"162.44",gradientUnits:"userSpaceOnUse",children:[v("stop",{stopColor:"#030712",stopOpacity:"0"}),v("stop",{offset:"1",stopColor:"#030712",stopOpacity:"0.05"})]})]})]})}import{Fragment as Pu,jsx as Le,jsxs as Bt}from"react/jsx-runtime";var Cu=[{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 Vi({className:e}){return Le("div",{className:i("pointer-events-none relative size-full dark:opacity-80",e),"aria-hidden":!0,children:Le("div",{className:"absolute left-0 top-0 grid grid-cols-[repeat(2,180px)]",children:Cu.map((t,r)=>Le("div",{className:"h-[60px] w-[180px] p-[3px]",children:Le("div",{className:"border-border-subtle bg-bg-default flex size-full select-none overflow-hidden rounded border",children:t&&Bt(Pu,{children:[Le("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:[Le("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"}),Le("span",{className:"text-content-default text-[9px] font-medium",children:t.name})]}),Le("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:[Le("span",{className:"text-content-muted text-[6px] font-medium",children:Qt(o)}),Bt("span",{className:"text-content-default text-[9px] font-medium",children:["$",ta(t[o])]})]},o))})]})]})})},r))})})}import{Link as Su}from"@radix-ui/react-navigation-menu";import Tu from"next/link";import{jsx as Wt,jsxs as Hi}from"react/jsx-runtime";var nt="text-xs uppercase text-neutral-500 dark:text-white/60",Ru="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",ke=({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 Wt(Su,{asChild:!0,children:Wt(Tu,{className:i(Ru,a),...c,children:Hi("div",{className:"flex items-center justify-between gap-3",children:[e,Hi("div",{className:"flex-1",children:[Wt("p",{className:"text-sm font-medium text-neutral-700 dark:text-white",children:t}),r&&Wt("p",{className:i("text-xs text-neutral-500 dark:text-white/60",["line-clamp-1","line-clamp-2"][o-1]),children:r})]}),n&&Wt(ua,{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 V,jsxs as $t}from"react/jsx-runtime";var Lu=[{icon:V("div",{className:"flex size-4 items-center justify-center rounded bg-orange-400",children:V(mt,{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:V(zi,{className:"absolute left-0 top-0 h-auto w-full"})},{icon:V("div",{className:"flex size-4 items-center justify-center rounded bg-green-400",children:V(dt,{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:V(Oi,{className:"absolute bottom-0 left-0 size-full"})},{icon:V("div",{className:"flex size-4 items-center justify-center rounded bg-violet-400",children:V(ut,{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:V(Vi,{})}],Mu=[{title:"Dub Integrations",description:"Enhance your short links",href:"/integrations",graphic:V("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:V(Fi,{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:V("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:V(Fi,{src:"https://assets.dub.co/misc/api-thumbnail.png",alt:"",fill:!0})})}];function Wi({domain:e}){return $t("div",{className:"grid w-[1020px] grid-cols-1 gap-4 p-4",children:[V("div",{className:"grid grid-cols-3 gap-4",children:Lu.map(({title:t,description:r,icon:o,href:a,color:n,graphicsContainerClassName:c,graphic:d})=>V(_i,{asChild:!0,children:$t(Bi,{href:F(a,e,ke({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:[V(Xe,{className:"[mask-image:linear-gradient(transparent,black,transparent)] dark:text-white/5",cellSize:60,patternOffset:[-51,-23]}),$t("div",{className:"relative p-5 pb-0",children:[o,V("span",{className:"mt-3 block text-sm font-medium text-neutral-900 dark:text-white",children:t}),V("p",{className:"mt-2 max-w-56 text-sm text-neutral-500 dark:text-white/60",children:r})]}),V("div",{className:"relative mt-10 h-40 grow",children:V("div",{className:i("absolute left-0 top-0 size-full grow overflow-hidden [mask-image:linear-gradient(black_50%,transparent)]",c),children:V("div",{className:"relative size-full",children:d})})}),V("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))}),V("div",{className:"grid grow grid-cols-2 gap-4",children:Mu.map(({title:t,description:r,href:o,graphic:a})=>V(_i,{asChild:!0,children:$t(Bi,{href:F(o,e,ke({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:[V(Xe,{className:"[mask-image:linear-gradient(90deg,transparent,black)] dark:text-white/5",cellSize:60,patternOffset:[-39,-49]}),V("div",{className:"pointer-events-none absolute inset-0 overflow-hidden","aria-hidden":!0,children:a}),V("div",{className:"relative flex items-center justify-between px-5 py-4",children:$t("div",{children:[V("span",{className:"text-sm font-medium leading-none text-neutral-900 dark:text-white",children:t}),V("p",{className:"mt-1 text-sm text-neutral-500 dark:text-white/60",children:r})]})})]})},t))})]})}import{Link as Eu}from"@radix-ui/react-navigation-menu";import Du from"next/link";import{jsx as K,jsxs as it}from"react/jsx-runtime";var Au=[{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 Ui({domain:e}){return it("div",{className:"grid w-[1020px] grid-cols-[0.9fr,0.55fr,0.55fr] divide-x divide-neutral-200 dark:divide-white/20",children:[it("div",{className:"flex h-full flex-col p-4",children:[K("p",{className:i(nt,"mb-4 ml-2"),children:"Explore"}),K("div",{className:"grid grow grid-cols-2 gap-4",children:Au.map(({icon:t,title:r,description:o,href:a})=>K(Eu,{asChild:!0,children:it(Du,{href:F(a,e,ke({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:[it("div",{className:"absolute inset-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:[K("div",{className:"absolute -inset-[25%] -skew-y-12 [mask-image:linear-gradient(225deg,black,transparent_50%)]",children:K(Xe,{cellSize:46,patternOffset:[0,-14],className:"translate-y-2 text-[#ad1f3288] transition-transform duration-150 ease-out group-hover:translate-y-0"})}),K("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)]")})]}),K(t,{className:"relative size-5 text-neutral-700 dark:text-white/60"}),it("div",{className:"relative",children:[K("span",{className:"text-sm font-medium text-neutral-900 dark:text-white",children:r}),K("p",{className:"mt-2 text-xs text-neutral-500 dark:text-white/60",children:o})]})]},r)},r))})]}),it("div",{className:"px-6 py-4",children:[K("p",{className:i(nt,"mb-2"),children:"Company"}),K("div",{className:"flex flex-col gap-0.5",children:Ft.filter(({title:t})=>["About","Careers","Brand Guidelines","Contact"].includes(t)).map(({icon:t,title:r,description:o,href:a})=>K(Ut,{className:"-mx-2",href:F(a,e,ke({domain:e,utm_content:r})),icon:K("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:K(t,{className:"size-4 text-neutral-600 transition-colors dark:text-white/60"})}),title:r,description:o},a))})]}),it("div",{className:"px-6 py-4",children:[K("p",{className:i(nt,"mb-2"),children:"Updates"}),K("div",{className:"flex flex-col gap-0.5",children:Ft.filter(({title:t})=>["Blog","Changelog"].includes(t)).map(({icon:t,title:r,description:o,href:a})=>K(Ut,{className:"-mx-2",href:F(a,e,ke({domain:e,utm_content:r})),icon:K("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:K(t,{className:"size-4 text-neutral-600 transition-colors dark:text-white/60"})}),title:r,description:o},a))})]})]})}import{Link as Iu}from"@radix-ui/react-navigation-menu";import Ou from"next/link";import{jsx as te,jsxs as wt}from"react/jsx-runtime";var zu=[{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:Tt,title:"Affiliate Management",description:"Manage affiliates and automate payouts",href:"/partners"}];function $i({domain:e}){return wt("div",{className:"grid w-[1020px] grid-cols-[minmax(0,1fr),0.4fr] divide-x divide-neutral-200 dark:divide-white/20",children:[wt("div",{className:"flex h-full flex-col p-4",children:[te("p",{className:i(nt,"mb-4 ml-2"),children:"Use case"}),te("div",{className:"grid grow grid-cols-3 gap-4",children:zu.map(({icon:t,title:r,description:o,href:a})=>te(Iu,{asChild:!0,children:wt(Ou,{href:F(a,e,ke({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:[wt("div",{className:"absolute inset-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:[te("div",{className:"absolute -inset-[25%] -skew-y-12 [mask-image:linear-gradient(225deg,black,transparent_50%)]",children:te(Xe,{cellSize:46,patternOffset:[0,-14],className:"translate-y-2 text-[#ad1f3288] transition-transform duration-150 ease-out group-hover:translate-y-0"})}),te("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)]")})]}),te(t,{className:"relative size-5 text-neutral-700 dark:text-white/60"}),wt("div",{className:"relative",children:[te("span",{className:"text-sm font-medium text-neutral-900 dark:text-white",children:r}),te("p",{className:"mt-2 text-xs text-neutral-500 dark:text-white/60",children:o})]})]},r)},r))})]}),wt("div",{className:"px-6 py-4",children:[te("p",{className:i(nt,"mb-2"),children:"SDKs"}),te("div",{className:"flex flex-col gap-0.5",children:Fo.map(({icon:t,iconClassName:r,title:o,href:a})=>te(Ut,{className:"-mx-2",href:F(a,e,ke({domain:e,utm_content:o})),icon:te("div",{className:"shrink-0 rounded-[10px] border border-neutral-200 bg-white/50 p-1 dark:border-white/20 dark:bg-white/10",children:te(t,{className:i("size-5 text-neutral-600 transition-colors dark:text-white/60",r)})}),title:o,showArrow:!0},a))})]})]})}import{Fragment as Gu,jsx as U,jsxs as kt}from"react/jsx-runtime";var Bo=Fu({theme:"light"}),Wo=[{name:"Product",content:Wi,childItems:_r,segments:["/links","/analytics","/partners","/integrations","/compare","/features"]},{name:"Solutions",content:$i,childItems:Ei,segments:["/solutions","/sdks"]},{name:"Resources",content:Ui,childItems:Ft,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"]}],Gi=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 j5({theme:e="light",staticDomain:t,maxWidthWrapperClassName:r}){let{domain:o="dub.co"}=Hu();t&&(o=t);let a=Bu(),n=Mn(40),c=_u(),{data:d,isLoading:m}=Wu(o.endsWith("dub.co")&&"/api/auth/session",be,{dedupingInterval:6e4});return U(Bo.Provider,{value:{theme:e},children:U(Vu,{id:a,children:kt("div",{className:i("sticky inset-x-0 top-0 z-30 w-full transition-all",e==="dark"&&"dark"),children:[U("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")}),U(Fr,{className:i("relative",r),children:kt("div",{className:"flex h-14 items-center justify-between",children:[U("div",{className:"grow basis-0",children:U(Gt,{className:"block w-fit py-2 pr-2",href:F("/home",o,{utm_source:"Custom Domain",utm_medium:"Navbar",utm_campaign:o,utm_content:"Logo"}),children:U(Br,{})})}),kt(de.Root,{delayDuration:0,className:"relative hidden lg:block",children:[U(de.List,{className:"group relative z-0 flex",children:Wo.map(({name:s,href:l,segments:u,content:p})=>{let f=u.some(b=>c==null?void 0:c.startsWith(b));return kt(de.Item,{children:[U($u,{trigger:!!p,children:l!==void 0?U(Gt,{id:`nav-${l}`,href:F(l,o,{utm_source:"Custom Domain",utm_medium:"Navbar",utm_campaign:o,utm_content:s}),className:Gi,"data-active":f,children:s}):kt("button",{className:Gi,"data-active":f,children:[s,U(Uu,{className:"ml-1.5 size-2.5 text-neutral-700"})]})}),p&&U(de.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:U(p,{domain:o})})]},s)})}),U("div",{className:"absolute left-1/2 top-full mt-3 -translate-x-1/2",children:U(de.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]")})})]}),U("div",{className:"hidden grow basis-0 justify-end gap-2 lg:flex",children:d&&Object.keys(d).length>0?U(Gt,{href:Ce,className:i(ie({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:kt(Gu,{children:[U(Gt,{href:"https://app.dub.co/login",className:i(ie({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"}),U(Gt,{href:"https://app.dub.co/register",className:i(ie({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 Uu(e){return U("svg",{xmlns:"http://www.w3.org/2000/svg",width:"9",height:"9",fill:"none",viewBox:"0 0 9 9",...e,children:U("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 $u({trigger:e,children:t}){return e?U(de.Trigger,{asChild:!0,children:t}):t}import{ChevronDown as Ku,Menu as ju,X as Yu}from"lucide-react";import Ct from"next/link";import{useParams as Go}from"next/navigation";import{useEffect as Zu,useState as ji}from"react";import qu from"swr";import{Fragment as Ju,jsx as D,jsxs as Me}from"react/jsx-runtime";var Uo={"Dub Links":D("div",{className:"flex size-5 items-center justify-center rounded bg-orange-400",children:D(mt,{className:"size-3 text-orange-900"})}),"Dub Partners":D("div",{className:"flex size-5 items-center justify-center rounded bg-violet-400",children:D(ut,{className:"size-3 text-violet-900"})}),"Dub Analytics":D("div",{className:"flex size-5 items-center justify-center rounded bg-green-400",children:D(dt,{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 l6({theme:e="light",staticDomain:t}){let{domain:r="dub.co"}=Go();t&&(r=t);let[o,a]=ji(!1);Zu(()=>{o?document.body.style.overflow="hidden":document.body.style.overflow="auto"},[o]);let{data:n,isLoading:c}=qu(r.endsWith("dub.co")&&"/api/auth/session",be,{dedupingInterval:6e4});return Me("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($o,{href:Ce,className:"max-[280px]:hidden",children:"Dashboard"}):c?null:Me("div",{className:"flex gap-2 max-[280px]:hidden",children:[D($o,{variant:"secondary",href:`${Ce}/login`,children:"Log in"}),D($o,{href:`${Ce}/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(Yu,{className:"h-5 w-5 text-neutral-600 dark:text-white/70"}):D(ju,{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:Me("ul",{className:"grid divide-y divide-neutral-200 dark:divide-white/[0.15]",children:[Wo.map(({name:d,href:m,childItems:s},l)=>D(Xu,{name:d,href:m,childItems:s,setOpen:a},l)),n&&Object.keys(n).length>0?D("li",{className:"py-3 min-[281px]:hidden",children:D(Ct,{href:Ce,className:"flex w-full font-semibold capitalize",children:"Dashboard"})}):Me(Ju,{children:[D("li",{className:"py-3 min-[281px]:hidden",children:D(Ct,{href:`${Ce}/login`,className:"flex w-full font-semibold capitalize",children:"Log in"})}),D("li",{className:"py-3 min-[281px]:hidden",children:D(Ct,{href:`${Ce}/register`,className:"flex w-full font-semibold capitalize",children:"Sign Up"})})]})]})})]})}var Xu=({name:e,href:t,childItems:r,setOpen:o})=>{let{domain:a="dub.co"}=Go(),[n,c]=ji(!1);return r?D("li",{className:"py-3",children:Me(fe,{height:!0,children:[Me("button",{className:"flex w-full justify-between",onClick:()=>c(!n),children:[D("p",{className:"font-semibold",children:e}),D(Ku,{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((d,m)=>"items"in d?Me("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:d.label}),d.items.map((s,l)=>D(Ki,{item:s,setOpen:o,size:"small"},l))]},m):D(Ki,{item:d,setOpen:o},m))})]})}):t?D("li",{className:"py-3",children:D(Ct,{href:F(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},Ki=({item:{title:e,description:t,href:r,icon:o},setOpen:a,size:n="normal"})=>{let{domain:c="dub.co"}=Go(),d=Uo==null?void 0:Uo[e];return Me(Ct,{href:F(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:d??D(o,{className:i("size-5 text-neutral-700 grayscale",n==="small"&&"size-4")})}),Me("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 $o({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]",ie({variant:e}),t)})}import{jsx as Yi}from"react/jsx-runtime";function Zi({className:e}){return Yi("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:Yi("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 X,jsxs as qi}from"react/jsx-runtime";var lp=`<svg width="65" height="64" viewBox="0 0 65 64" fill="none" xmlns="http://www.w3.org/2000/svg">
70
+ 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 cf}from"lucide-react";import df from"next/image";import rt from"next/link";import{useParams as uf}from"next/navigation";import{useState as mf}from"react";import{jsx as xs}from"react/jsx-runtime";function mr({className:e}){return xs("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:xs("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 xo=[{id:"links",title:"Dub Links",description:"Short links with superpowers",icon:Pt,href:"/links"},{id:"partners",title:"Dub Partners",description:"Grow your revenue with partnerships",icon:St,href:"/partners"},{id:"analytics",title:"Dub Analytics",description:"Powerful real-time analytics",icon:Ct,href:"/analytics"},{id:"api",title:"Dub API",description:"Programmatic link creation at scale",icon:Pr,href:"/docs/api-reference/introduction"},{title:"Dub Integrations",description:"Connect Dub with your favorite tools",icon:Ha,href:"/integrations"}],vn=[{icon:ra,iconClassName:"py-0.5 group-hover:text-[#3178C6]",title:"Typescript",href:"/sdks/typescript"},{icon:ea,iconClassName:"py-0.5 [&_.snake]:transition-colors group-hover:[&_.snake1]:text-[#3776ab] group-hover:[&_.snake2]:text-[#ffd343]",title:"Python",href:"/sdks/python"},{icon:Jn,iconClassName:"group-hover:text-[#00ACD7]",title:"Go",href:"/sdks/go"},{icon:ta,iconClassName:"py-[3px] grayscale brightness-150 transition-[filter] group-hover:grayscale-0 group-hover:brightness-100",title:"Ruby",href:"/sdks/ruby"},{icon:Qn,iconClassName:"py-[3px] grayscale brightness-150 transition-[filter] group-hover:grayscale-0 group-hover:brightness-100",title:"PHP",href:"/sdks/php"}],ys=[{icon:Dr,title:"Marketing Attribution",description:"Easily track and measure marketing impact",href:"/analytics"},{icon:Ar,title:"Content Creators",description:"Intelligent audience insights and link tracking",href:"/solutions/creators"},{icon:Kt,title:"Affiliate Management",description:"Manage affiliates and automate payouts",href:"/partners"},{label:"SDKs",items:vn}],pr=[{icon:Ir,title:"Help Center",description:"Answers to your questions",href:"/help"},{icon:Mr,title:"Docs",description:"Platform documentation",href:"/docs"},{icon:Kt,title:"About",description:"Company, values, and team",href:"/about"},{icon:aa,title:"Careers",description:"Join our global, remote team",href:"/careers"},{icon:ya,title:"Blog",description:"Insights and stories",href:"/blog"},{icon:ia,title:"Changelog",description:"Releases and updates",href:"/changelog"},{icon:mr,title:"Brand Guidelines",description:"Logos, wordmark, etc.",href:"/brand"},{icon:ha,title:"Contact",description:"Reach out to support or sales",href:"/contact"}],Ns=[{name:"Bitly",slug:"bitly"},{name:"Rebrandly",slug:"rebrandly"},{name:"Short.io",slug:"short"},{name:"Bl.ink",slug:"blink"}],ws=[{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"}],A5=[{name:"X (Twitter)",icon:Rr,href:"https://x.com/dubdotco"},{name:"LinkedIn",icon:Tr,href:"https://www.linkedin.com/company/dubinc"},{name:"GitHub",icon:Sr,href:"https://github.com/dubinc/dub"},{name:"YouTube",icon:Lr,href:"https://www.youtube.com/@dubdotco"}];import{jsx as xp}from"react/jsx-runtime";function yo({className:e,children:t}){return xp("div",{className:i("mx-auto w-full max-w-screen-xl px-3 lg:px-10",e),children:t})}import*as tt from"@radix-ui/react-popover";import{BoxSelect as Xp,Home as Jp,LayoutGrid as Qp,Type as ef}from"lucide-react";import{useParams as tf}from"next/navigation";import{useCallback as rf,useContext as of,useState as nf}from"react";import{toast as af}from"sonner";import*as xe from"@radix-ui/react-navigation-menu";import{LayoutGroup as Op}from"motion/react";import vr from"next/link";import{useParams as Vp,usePathname as zp}from"next/navigation";import{createContext as Fp,useId as _p}from"react";import Hp from"swr";import{Link as Rs}from"@radix-ui/react-navigation-menu";import Ls from"next/image";import Ms from"next/link";import{Link2 as yp}from"lucide-react";import{jsx as ee,jsxs as oe}from"react/jsx-runtime";var ks={clicks:{color:"#3B82F6",value:"12.5K"},leads:{color:"#A855F7",value:"8.2K"},sales:{color:"#14B8A6",value:"$12K"}},vt={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 Cs({className:e}){return oe("div",{className:i("pointer-events-none relative size-full",e),children:[oe("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:[ee("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"}),ee("circle",{cx:"259.333",cy:"72",r:"3",fill:"#00BBA7"}),ee("circle",{cx:"259.333",cy:"72",r:"4",stroke:"#3EC5B8",strokeOpacity:"0.3",strokeWidth:"2"})]}),oe("div",{className:"absolute bottom-0 left-5 flex items-start gap-2",children:[oe("div",{className:"border-border-default bg-bg-default w-[172px] rounded-lg border p-0",children:[oe("div",{className:"p-1.5",children:[oe("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:[ee(yp,{className:"size-3 rotate-90"}),"d.to/try"]}),ee("div",{className:"text-content-default mt-1 px-1.5 pb-0.5 text-[0.8125rem] font-medium sm:mt-2",children:"Apr 2025"})]}),ee("div",{className:"border-border-default flex flex-col gap-2 border-t p-3",children:["clicks","leads","sales"].map(t=>oe("div",{className:"flex items-center justify-between gap-2",children:[oe("div",{className:"flex items-center gap-2",children:[ee("div",{className:"size-2 rounded-sm border border-black/20 bg-current opacity-70",style:{color:ks[t].color}}),ee("div",{className:"text-content-subtle text-xs font-medium leading-none",children:Cr(t)})]}),oe("span",{className:"text-content-emphasis text-xs leading-none",children:[t==="sales"?"$":"",ks[t].value]})]},t))})]}),ee("div",{className:"relative",children:oe("div",{className:"border-border-default bg-bg-default absolute left-0 top-0 rounded-lg border py-0.5",children:[oe("div",{className:"px-3 py-2.5",children:[oe("div",{className:"flex justify-between gap-2",children:[ee("div",{className:"bg-bg-emphasis size-11 rounded-full",style:{backgroundImage:"url(https://assets.dub.co/home/people.png)",backgroundSize:"3600%",backgroundPositionX:vt.avatarIndex*100+"%"}}),oe("div",{className:"flex flex-col items-end gap-1",children:[oe("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:[ee(ga,{className:"text-content-default size-3.5"}),vt.origin]}),oe("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:[ee("img",{src:`https://flag.vercel.app/m/${vt.country}.svg`,className:"relative h-2.5 w-3 rounded-sm"}),vt.country]})]})]}),ee("div",{className:"text-content-emphasis mt-4 text-[0.8125rem] font-medium",children:vt.name}),ee("div",{className:"text-content-subtle mt-px text-xs",children:vt.email})]}),ee("div",{className:"border-border-default flex flex-col gap-2.5 border-t px-3 pb-2.5 pt-3",children:Object.entries(vt.details).map(([t,r])=>oe("div",{className:"relative flex items-center justify-between gap-2 text-xs leading-none",children:[ee("span",{className:"text-content-muted truncate font-medium",children:t}),ee("span",{className:"text-content-default",children:r})]},t))})]})})]})]})}import{useId as Np}from"react";import{jsx as P,jsxs as ve}from"react/jsx-runtime";function Ps(e){let t=Np();return ve("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:[ve("defs",{children:[P("path",{id:`${t}-m`,className:"fill-[var(--bg)]",d:"M0 0h10.24v10.24H0z"}),P("path",{id:`${t}-n`,className:"fill-[var(--bg)]",d:"M0 0h8.05v8.05H0z"}),P("path",{id:`${t}-o`,className:"fill-[var(--bg)]",d:"M0 0h11.71v11.71H0z"})]}),P("rect",{width:"292",height:"52",x:"4",y:"4",rx:"8.78",className:"fill-[var(--bg)]"}),P("rect",{width:"292",height:"52",x:"4",y:"4",className:"stroke-[var(--border)]",strokeWidth:"0.73",rx:"8.78"}),P("rect",{width:"24.88",height:"24.88",x:"17.17",y:"17.56",fill:`url(#${t}-a)`,rx:"12.44"}),P("rect",{width:"25.61",height:"25.61",x:"16.8",y:"17.2",className:"stroke-[var(--border)]",strokeWidth:"0.73",rx:"12.8"}),P("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"}),P("text",{xmlSpace:"preserve",className:"fill-[var(--fg)]",fontSize:"10.24",fontWeight:"600",style:{whiteSpace:"pre"},children:P("tspan",{x:"50.83",y:"25.49",children:"d.to"})}),ve("g",{className:"stroke-[var(--fg)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-b)`,children:[P("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"}),P("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"})]}),P("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"}),ve("g",{stroke:"#A1A1A1",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-c)`,children:[P("path",{d:"M59.11 38.38h-4.7a.9.9 0 0 1-.89-.89V35.7"}),P("path",{d:"m57.21 36.48 1.9 1.9-1.9 1.9"})]}),P("text",{xmlSpace:"preserve",fill:"#737373",fontSize:"10.24",fontWeight:"500",style:{whiteSpace:"pre"},children:P("tspan",{x:"63.27",y:"41.59",children:"dub.co"})}),P("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"}),P("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"}),P("g",{className:"stroke-[var(--muted)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-d)`,children:P("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"})}),P("text",{xmlSpace:"preserve",className:"fill-[var(--muted)]",fontSize:"8.78",fontWeight:"500",style:{whiteSpace:"pre"},children:P("tspan",{x:"220.78",y:"33.19",children:"151.8K clicks"})}),P("rect",{width:"292",height:"52",x:"4",y:"64",rx:"8.78",className:"fill-[var(--bg)]"}),P("rect",{width:"292",height:"52",x:"4",y:"64",className:"stroke-[var(--border)]",strokeWidth:"0.73",rx:"8.78"}),P("rect",{width:"24.88",height:"24.88",x:"17.17",y:"77.56",fill:`url(#${t}-e)`,rx:"12.44"}),P("rect",{width:"25.61",height:"25.61",x:"16.8",y:"77.19",className:"stroke-[var(--border)]",strokeWidth:"0.73",rx:"12.8"}),P("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"}),P("text",{xmlSpace:"preserve",className:"fill-[var(--fg)]",fontSize:"10.24",fontWeight:"600",style:{whiteSpace:"pre"},children:P("tspan",{x:"50.83",y:"85.49",children:"d.to/register"})}),ve("g",{className:"stroke-[var(--fg)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-f)`,children:[P("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"}),P("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"})]}),P("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"}),ve("g",{stroke:"#A1A1A1",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-g)`,children:[P("path",{d:"M59.11 98.38h-4.7a.9.9 0 0 1-.89-.89V95.7"}),P("path",{d:"m57.21 96.48 1.9 1.9-1.9 1.9"})]}),P("text",{xmlSpace:"preserve",fill:"#737373",fontSize:"10.24",fontWeight:"500",style:{whiteSpace:"pre"},children:P("tspan",{x:"63.27",y:"101.59",children:"app.dub.co/register"})}),P("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"}),P("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"}),P("g",{className:"stroke-[var(--muted)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-h)`,children:P("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"})}),P("text",{xmlSpace:"preserve",className:"fill-[var(--muted)]",fontSize:"8.78",fontWeight:"500",style:{whiteSpace:"pre"},children:P("tspan",{x:"226.78",y:"93.19",children:"100K clicks"})}),P("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"}),P("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"}),P("rect",{width:"24.88",height:"24.88",x:"17.17",y:"137.56",fill:`url(#${t}-i)`,rx:"12.44"}),P("rect",{width:"25.61",height:"25.61",x:"16.8",y:"137.19",className:"stroke-[var(--border)]",strokeWidth:"0.73",rx:"12.8"}),P("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"}),P("text",{xmlSpace:"preserve",className:"fill-[var(--fg)]",fontSize:"10.24",fontWeight:"600",style:{whiteSpace:"pre"},children:P("tspan",{x:"50.83",y:"145.49",children:"d.to/try"})}),ve("g",{className:"stroke-[var(--fg)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-j)`,children:[P("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"}),P("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"})]}),P("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"}),ve("g",{stroke:"#A1A1A1",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-k)`,children:[P("path",{d:"M59.11 158.38h-4.7a.9.9 0 0 1-.89-.89v-1.79"}),P("path",{d:"m57.21 156.48 1.9 1.9-1.9 1.9"})]}),P("text",{xmlSpace:"preserve",fill:"#737373",fontSize:"10.24",fontWeight:"500",style:{whiteSpace:"pre"},children:P("tspan",{x:"63.27",y:"161.59",children:"app.dub.co/register"})}),P("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"}),P("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"}),P("g",{className:"stroke-[var(--muted)]",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.1",clipPath:`url(#${t}-l)`,children:P("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"})}),P("text",{xmlSpace:"preserve",className:"fill-[var(--muted)]",fontSize:"8.78",fontWeight:"500",style:{whiteSpace:"pre"},children:P("tspan",{x:"223.78",y:"153.19",children:"65.8K clicks"})}),ve("defs",{children:[P("clipPath",{id:`${t}-b`,children:P("use",{xlinkHref:`#${t}-m`,transform:"translate(80.34 16.83)"})}),P("clipPath",{id:`${t}-c`,children:P("use",{xlinkHref:`#${t}-n`,transform:"translate(52.3 34.02)"})}),P("clipPath",{id:`${t}-d`,children:P("use",{xlinkHref:`#${t}-o`,transform:"translate(204.68 24.15)"})}),P("clipPath",{id:`${t}-f`,children:P("use",{xlinkHref:`#${t}-m`,transform:"translate(122.34 76.83)"})}),P("clipPath",{id:`${t}-g`,children:P("use",{xlinkHref:`#${t}-n`,transform:"translate(52.3 94.02)"})}),P("clipPath",{id:`${t}-h`,children:P("use",{xlinkHref:`#${t}-o`,transform:"translate(210.68 84.15)"})}),P("clipPath",{id:`${t}-j`,children:P("use",{xlinkHref:`#${t}-m`,transform:"translate(98.34 136.83)"})}),P("clipPath",{id:`${t}-k`,children:P("use",{xlinkHref:`#${t}-n`,transform:"translate(52.3 154.02)"})}),P("clipPath",{id:`${t}-l`,children:P("use",{xlinkHref:`#${t}-o`,transform:"translate(207.68 144.15)"})}),ve("linearGradient",{id:`${t}-a`,x1:"29.61",x2:"29.61",y1:"17.56",y2:"42.44",gradientUnits:"userSpaceOnUse",children:[P("stop",{stopColor:"#030712",stopOpacity:"0"}),P("stop",{offset:"1",stopColor:"#030712",stopOpacity:"0.05"})]}),ve("linearGradient",{id:`${t}-e`,x1:"29.61",x2:"29.61",y1:"77.56",y2:"102.44",gradientUnits:"userSpaceOnUse",children:[P("stop",{stopColor:"#030712",stopOpacity:"0"}),P("stop",{offset:"1",stopColor:"#030712",stopOpacity:"0.05"})]}),ve("linearGradient",{id:`${t}-i`,x1:"29.61",x2:"29.61",y1:"137.56",y2:"162.44",gradientUnits:"userSpaceOnUse",children:[P("stop",{stopColor:"#030712",stopOpacity:"0"}),P("stop",{offset:"1",stopColor:"#030712",stopOpacity:"0.05"})]})]})]})}import{Fragment as kp,jsx as He,jsxs as fr}from"react/jsx-runtime";var wp=[{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 Ss({className:e}){return He("div",{className:i("pointer-events-none relative size-full dark:opacity-80",e),"aria-hidden":!0,children:He("div",{className:"absolute left-0 top-0 grid grid-cols-[repeat(2,180px)]",children:wp.map((t,r)=>He("div",{className:"h-[60px] w-[180px] p-[3px]",children:He("div",{className:"border-border-subtle bg-bg-default flex size-full select-none overflow-hidden rounded border",children:t&&fr(kp,{children:[He("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),fr("div",{className:"border-border-subtle flex h-full flex-col justify-between border-l px-2 py-1.5",children:[fr("div",{className:"flex items-center gap-1.5",children:[He("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"}),He("span",{className:"text-content-default text-[9px] font-medium",children:t.name})]}),He("div",{className:"divide-border-subtle flex divide-x",children:["revenue","payouts"].map((o,n)=>fr("div",{className:i("flex flex-col",n===0?"pr-4":"pl-4"),children:[He("span",{className:"text-content-muted text-[6px] font-medium",children:Cr(o)}),fr("span",{className:"text-content-default text-[9px] font-medium",children:["$",Dn(t[o])]})]},o))})]})]})})},r))})})}import{Link as Cp}from"@radix-ui/react-navigation-menu";import Pp from"next/link";import{jsx as gr,jsxs as Ts}from"react/jsx-runtime";var xt="text-xs uppercase text-neutral-500 dark:text-white/60",Sp="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",De={utm_source:"Custom Domain",utm_medium:"Navbar"};function br({icon:e,title:t,description:r,descriptionLines:o=1,className:n,showArrow:a,...c}){return gr(Cp,{asChild:!0,children:gr(Pp,{className:i(Sp,n),...c,children:Ts("div",{className:"flex items-center justify-between gap-3",children:[e,Ts("div",{className:"flex-1",children:[gr("p",{className:"text-sm font-medium text-neutral-700 dark:text-white",children:t}),r&&gr("p",{className:i("text-xs text-neutral-500 dark:text-white/60",["line-clamp-1","line-clamp-2"][o-1]),children:r})]}),a&&gr(Gn,{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 G,jsxs as hr}from"react/jsx-runtime";var Tp=[{icon:G("div",{className:"flex size-4 items-center justify-center rounded bg-orange-400",children:G(Pt,{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:G(Ps,{className:"absolute left-0 top-0 h-auto w-full"})},{icon:G("div",{className:"flex size-4 items-center justify-center rounded bg-green-400",children:G(Ct,{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:G(Cs,{className:"absolute bottom-0 left-0 size-full"})},{icon:G("div",{className:"flex size-4 items-center justify-center rounded bg-violet-400",children:G(St,{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:G(Ss,{})}],Rp=[{title:"Dub Integrations",description:"Enhance your short links",href:"/integrations",graphic:G("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:G(Ls,{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:G("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:G(Ls,{src:"https://assets.dub.co/misc/api-thumbnail.png",alt:"",fill:!0})})}];function Es({domain:e}){return hr("div",{className:"grid w-[1020px] grid-cols-1 gap-4 p-4",children:[G("div",{className:"grid grid-cols-3 gap-4",children:Tp.map(({title:t,description:r,icon:o,href:n,color:a,graphicsContainerClassName:c,graphic:l})=>G(Rs,{asChild:!0,children:hr(Ms,{href:K(n,e,{...De,utm_campaign: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:[G(mt,{className:"[mask-image:linear-gradient(transparent,black,transparent)] dark:text-white/5",cellSize:60,patternOffset:[-51,-23]}),hr("div",{className:"relative p-5 pb-0",children:[o,G("span",{className:"mt-3 block text-sm font-medium text-neutral-900 dark:text-white",children:t}),G("p",{className:"mt-2 max-w-56 text-sm text-neutral-500 dark:text-white/60",children:r})]}),G("div",{className:"relative mt-10 h-40 grow",children:G("div",{className:i("absolute left-0 top-0 size-full grow overflow-hidden [mask-image:linear-gradient(black_50%,transparent)]",c),children:G("div",{className:"relative size-full",children:l})})}),G("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":a}})]})},t))}),G("div",{className:"grid grow grid-cols-2 gap-4",children:Rp.map(({title:t,description:r,href:o,graphic:n})=>G(Rs,{asChild:!0,children:hr(Ms,{href:K(o,e,{...De,utm_campaign: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:[G(mt,{className:"[mask-image:linear-gradient(90deg,transparent,black)] dark:text-white/5",cellSize:60,patternOffset:[-39,-49]}),G("div",{className:"pointer-events-none absolute inset-0 overflow-hidden","aria-hidden":!0,children:n}),G("div",{className:"relative flex items-center justify-between px-5 py-4",children:hr("div",{children:[G("span",{className:"text-sm font-medium leading-none text-neutral-900 dark:text-white",children:t}),G("p",{className:"mt-1 text-sm text-neutral-500 dark:text-white/60",children:r})]})})]})},t))})]})}import{Link as Lp}from"@radix-ui/react-navigation-menu";import Mp from"next/link";import{jsx as Z,jsxs as yt}from"react/jsx-runtime";var Ep=[{icon:Ir,title:"Help Center",description:"Answers to your questions",thumbnail:"https://assets.dub.co/misc/help-thumbnail.jpg",href:"/help"},{icon:Mr,title:"Docs",description:"Platform documentation",thumbnail:"https://assets.dub.co/misc/docs-thumbnail.jpg",href:"/docs"}];function Ds({domain:e}){return yt("div",{className:"grid w-[1020px] grid-cols-[0.9fr,0.55fr,0.55fr] divide-x divide-neutral-200 dark:divide-white/20",children:[yt("div",{className:"flex h-full flex-col p-4",children:[Z("p",{className:i(xt,"mb-4 ml-2"),children:"Explore"}),Z("div",{className:"grid grow grid-cols-2 gap-4",children:Ep.map(({icon:t,title:r,description:o,href:n})=>Z(Lp,{asChild:!0,children:yt(Mp,{href:K(n,e,{...De,utm_campaign: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:[yt("div",{className:"absolute inset-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:[Z("div",{className:"absolute -inset-[25%] -skew-y-12 [mask-image:linear-gradient(225deg,black,transparent_50%)]",children:Z(mt,{cellSize:46,patternOffset:[0,-14],className:"translate-y-2 text-[#ad1f3288] transition-transform duration-150 ease-out group-hover:translate-y-0"})}),Z("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)]")})]}),Z(t,{className:"relative size-5 text-neutral-700 dark:text-white/60"}),yt("div",{className:"relative",children:[Z("span",{className:"text-sm font-medium text-neutral-900 dark:text-white",children:r}),Z("p",{className:"mt-2 text-xs text-neutral-500 dark:text-white/60",children:o})]})]},r)},r))})]}),yt("div",{className:"px-6 py-4",children:[Z("p",{className:i(xt,"mb-2"),children:"Company"}),Z("div",{className:"flex flex-col gap-0.5",children:pr.filter(({title:t})=>["About","Careers","Brand Guidelines","Contact"].includes(t)).map(({icon:t,title:r,description:o,href:n})=>Z(br,{className:"-mx-2",href:K(n,e,{...De,utm_campaign:e,utm_content:r}),icon:Z("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:Z(t,{className:"size-4 text-neutral-600 transition-colors dark:text-white/60"})}),title:r,description:o},n))})]}),yt("div",{className:"px-6 py-4",children:[Z("p",{className:i(xt,"mb-2"),children:"Updates"}),Z("div",{className:"flex flex-col gap-0.5",children:pr.filter(({title:t})=>["Blog","Changelog"].includes(t)).map(({icon:t,title:r,description:o,href:n})=>Z(br,{className:"-mx-2",href:K(n,e,{...De,utm_campaign:e,utm_content:r}),icon:Z("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:Z(t,{className:"size-4 text-neutral-600 transition-colors dark:text-white/60"})}),title:r,description:o},n))})]})]})}import{Link as Dp}from"@radix-ui/react-navigation-menu";import Ip from"next/link";import{jsx as se,jsxs as Ht}from"react/jsx-runtime";var Ap=[{icon:Dr,title:"Marketing Attribution",description:"Easily track and measure marketing impact",href:"/analytics"},{icon:Ar,title:"Content Creators",description:"Intelligent audience insights and link tracking",href:"/solutions/creators"},{icon:Kt,title:"Affiliate Management",description:"Manage affiliates and automate payouts",href:"/partners"}];function Is({domain:e}){return Ht("div",{className:"grid w-[1020px] grid-cols-[minmax(0,1fr),0.4fr] divide-x divide-neutral-200 dark:divide-white/20",children:[Ht("div",{className:"flex h-full flex-col p-4",children:[se("p",{className:i(xt,"mb-4 ml-2"),children:"Use case"}),se("div",{className:"grid grow grid-cols-3 gap-4",children:Ap.map(({icon:t,title:r,description:o,href:n})=>se(Dp,{asChild:!0,children:Ht(Ip,{href:K(n,e,{...De,utm_campaign: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:[Ht("div",{className:"absolute inset-0 opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:[se("div",{className:"absolute -inset-[25%] -skew-y-12 [mask-image:linear-gradient(225deg,black,transparent_50%)]",children:se(mt,{cellSize:46,patternOffset:[0,-14],className:"translate-y-2 text-[#ad1f3288] transition-transform duration-150 ease-out group-hover:translate-y-0"})}),se("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)]")})]}),se(t,{className:"relative size-5 text-neutral-700 dark:text-white/60"}),Ht("div",{className:"relative",children:[se("span",{className:"text-sm font-medium text-neutral-900 dark:text-white",children:r}),se("p",{className:"mt-2 text-xs text-neutral-500 dark:text-white/60",children:o})]})]},r)},r))})]}),Ht("div",{className:"px-6 py-4",children:[se("p",{className:i(xt,"mb-2"),children:"SDKs"}),se("div",{className:"flex flex-col gap-0.5",children:vn.map(({icon:t,iconClassName:r,title:o,href:n})=>se(br,{className:"-mx-2",href:K(n,e,{...De,utm_campaign:e,utm_content:o}),icon:se("div",{className:"shrink-0 rounded-[10px] border border-neutral-200 bg-white/50 p-1 dark:border-white/20 dark:bg-white/10",children:se(t,{className:i("size-5 text-neutral-600 transition-colors dark:text-white/60",r)})}),title:o,showArrow:!0},n))})]})]})}import{Fragment as Wp,jsx as Y,jsxs as $t}from"react/jsx-runtime";var xn=Fp({theme:"light"}),yn=[{name:"Product",content:Es,childItems:xo,segments:["/links","/analytics","/partners","/integrations","/compare","/features"]},{name:"Solutions",content:Is,childItems:ys,segments:["/solutions","/sdks"]},{name:"Resources",content:Ds,childItems:pr,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"]}],As=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 W6({theme:e="light",staticDomain:t,maxWidthWrapperClassName:r}){let{domain:o="dub.co"}=Vp();t&&(o=t);let n=_p(),a=mi(40),c=zp(),{data:l,isLoading:m}=Hp(o.endsWith("dub.co")&&"/api/auth/session",Pe,{dedupingInterval:6e4});return Y(xn.Provider,{value:{theme:e},children:Y(Op,{id:n,children:$t("div",{className:i("sticky inset-x-0 top-0 z-30 w-full transition-all",e==="dark"&&"dark"),children:[Y("div",{className:i("absolute inset-0 block border-b border-transparent transition-all",a&&"border-neutral-100 bg-white/75 backdrop-blur-lg dark:border-white/10 dark:bg-black/75")}),Y(yo,{className:i("relative",r),children:$t("div",{className:"flex h-14 items-center justify-between",children:[Y("div",{className:"grow basis-0",children:Y(vr,{className:"block w-fit py-2 pr-2",href:K("/home",o,{utm_source:"Custom Domain",utm_medium:"Navbar",utm_campaign:o,utm_content:"Logo"}),children:Y(No,{})})}),$t(xe.Root,{delayDuration:0,className:"relative hidden lg:block",children:[Y(xe.List,{className:"group relative z-0 flex",children:yn.map(({name:d,href:s,segments:u,content:p})=>{let f=u.some(b=>c==null?void 0:c.startsWith(b));return $t(xe.Item,{children:[Y(Bp,{trigger:!!p,children:s!==void 0?Y(vr,{id:`nav-${s}`,href:K(s,o,{utm_source:"Custom Domain",utm_medium:"Navbar",utm_campaign:o,utm_content:d}),className:As,"data-active":f,children:d}):$t("button",{className:As,"data-active":f,children:[d,Y($p,{className:"ml-1.5 size-2.5 text-neutral-700"})]})}),p&&Y(xe.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:Y(p,{domain:o})})]},d)})}),Y("div",{className:"absolute left-1/2 top-full mt-3 -translate-x-1/2",children:Y(xe.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]")})})]}),Y("div",{className:"hidden grow basis-0 justify-end gap-2 lg:flex",children:l&&Object.keys(l).length>0?Y(vr,{href:Ie,className:i(ge({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:$t(Wp,{children:[Y(vr,{href:"https://app.dub.co/login",className:i(ge({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"}),Y(vr,{href:"https://app.dub.co/register",className:i(ge({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 $p(e){return Y("svg",{xmlns:"http://www.w3.org/2000/svg",width:"9",height:"9",fill:"none",viewBox:"0 0 9 9",...e,children:Y("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 Bp({trigger:e,children:t}){return e?Y(xe.Trigger,{asChild:!0,children:t}):t}import{ChevronDown as Up,Menu as Gp,X as Kp}from"lucide-react";import Bt from"next/link";import{useParams as kn}from"next/navigation";import{useEffect as jp,useState as Vs}from"react";import Yp from"swr";import{Fragment as Zp,jsx as V,jsxs as $e}from"react/jsx-runtime";var Nn={"Dub Links":V("div",{className:"flex size-5 items-center justify-center rounded bg-orange-400",children:V(Pt,{className:"size-3 text-orange-900"})}),"Dub Partners":V("div",{className:"flex size-5 items-center justify-center rounded bg-violet-400",children:V(St,{className:"size-3 text-violet-900"})}),"Dub Analytics":V("div",{className:"flex size-5 items-center justify-center rounded bg-green-400",children:V(Ct,{className:"size-3 text-green-900"})}),"Dub API":V("div",{className:"flex size-5 items-center justify-center rounded bg-neutral-400",children:V(Pr,{className:"size-3 text-neutral-900"})})};function nC({theme:e="light",staticDomain:t}){let{domain:r="dub.co"}=kn();t&&(r=t);let[o,n]=Vs(!1);jp(()=>{o?document.body.style.overflow="hidden":document.body.style.overflow="auto"},[o]);let{data:a,isLoading:c}=Yp(r.endsWith("dub.co")&&"/api/auth/session",Pe,{dedupingInterval:6e4});return $e("div",{className:i("fixed right-0 top-0 z-40 flex items-center gap-4 p-2.5 lg:hidden",e==="dark"&&"dark"),children:[a&&Object.keys(a).length>0?V(wn,{href:Ie,className:"max-[280px]:hidden",children:"Dashboard"}):c?null:$e("div",{className:"flex gap-2 max-[280px]:hidden",children:[V(wn,{variant:"secondary",href:`${Ie}/login`,children:"Log in"}),V(wn,{href:`${Ie}/register`,children:"Sign Up"})]}),V("button",{onClick:()=>n(!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?V(Kp,{className:"h-5 w-5 text-neutral-600 dark:text-white/70"}):V(Gp,{className:"h-5 w-5 text-neutral-600 dark:text-white/70"})}),V("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:$e("ul",{className:"grid divide-y divide-neutral-200 dark:divide-white/[0.15]",children:[yn.map(({name:l,href:m,childItems:d},s)=>V(qp,{name:l,href:m,childItems:d,setOpen:n},s)),a&&Object.keys(a).length>0?V("li",{className:"py-3 min-[281px]:hidden",children:V(Bt,{href:Ie,className:"flex w-full font-semibold capitalize",children:"Dashboard"})}):$e(Zp,{children:[V("li",{className:"py-3 min-[281px]:hidden",children:V(Bt,{href:`${Ie}/login`,className:"flex w-full font-semibold capitalize",children:"Log in"})}),V("li",{className:"py-3 min-[281px]:hidden",children:V(Bt,{href:`${Ie}/register`,className:"flex w-full font-semibold capitalize",children:"Sign Up"})})]})]})})]})}var qp=({name:e,href:t,childItems:r,setOpen:o})=>{let{domain:n="dub.co"}=kn(),[a,c]=Vs(!1);return r?V("li",{className:"py-3",children:$e(be,{height:!0,children:[$e("button",{className:"flex w-full justify-between",onClick:()=>c(!a),children:[V("p",{className:"font-semibold",children:e}),V(Up,{className:i("h-5 w-5 text-neutral-500 transition-all dark:text-white/50",a&&"rotate-180")})]}),a&&V("div",{className:"grid grid-cols-1 gap-4 overflow-hidden py-4",children:r.map((l,m)=>"items"in l?$e("div",{className:"grid grid-cols-1 gap-3",children:[V("span",{className:"text-xs font-medium uppercase text-neutral-500 dark:text-white/50",children:l.label}),l.items.map((d,s)=>V(Os,{item:d,setOpen:o,size:"small"},s))]},m):V(Os,{item:l,setOpen:o},m))})]})}):t?V("li",{className:"py-3",children:V(Bt,{href:K(t,n,{utm_source:"Custom Domain",utm_medium:"Navbar",utm_campaign:n,utm_content:e}),onClick:()=>o(!1),className:"flex w-full font-semibold capitalize",children:e})}):null},Os=({item:{title:e,description:t,href:r,icon:o},setOpen:n,size:a="normal"})=>{let{domain:c="dub.co"}=kn(),l=Nn==null?void 0:Nn[e];return $e(Bt,{href:K(r,c,{utm_source:"Custom Domain",utm_medium:"Navbar",utm_campaign:c,utm_content:e}),onClick:()=>n(!1),className:"flex w-full items-center gap-3",children:[V("div",{className:i("flex size-10 items-center justify-center rounded-lg border border-neutral-200 bg-gradient-to-t from-neutral-100",a==="small"&&"size-8"),children:l??V(o,{className:i("size-5 text-neutral-700 grayscale",a==="small"&&"size-4")})}),$e("div",{children:[V("div",{className:"flex items-center gap-2",children:V("h2",{className:"text-sm font-medium text-neutral-900",children:e})}),t&&V("p",{className:"text-sm text-neutral-500",children:t})]})]})};function wn({variant:e,className:t,...r}){return V(Bt,{...r,className:i("flex h-8 w-fit items-center whitespace-nowrap rounded-lg border px-3 text-[0.8125rem]",ge({variant:e}),t)})}import{jsx as zs}from"react/jsx-runtime";function Fs({className:e}){return zs("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:zs("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 te,jsxs as _s}from"react/jsx-runtime";var sf=`<svg width="65" height="64" viewBox="0 0 65 64" fill="none" xmlns="http://www.w3.org/2000/svg">
50
71
  <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
- </svg>`,cp=`<svg width="46" height="24" viewBox="0 0 46 24" fill="none" xmlns="http://www.w3.org/2000/svg">
72
+ </svg>`,lf=`<svg width="46" height="24" viewBox="0 0 46 24" fill="none" xmlns="http://www.w3.org/2000/svg">
52
73
  <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"/>
53
- </svg>`;function Br({variant:e="full",isInApp:t,className:r}){let{domain:o="dub.co"}=op(),{theme:a}=np(Bo),[n,c]=ip(!1),d=ap(l=>{l.preventDefault(),c(!0)},[]),[,m]=bt();function s(l){sp.promise(m(l),{success:"Copied to clipboard!",error:"Failed to copy to clipboard"})}return qi(Fe.Root,{open:n,onOpenChange:c,children:[X(Fe.Anchor,{asChild:!0,children:X("div",{onContextMenu:d,className:"max-w-fit",children:e==="full"?X(Zi,{className:r}):X(_t,{className:i("h-8 w-8 transition-all duration-75 active:scale-95",r)})})}),X(Fe.Portal,{children:X(Fe.Content,{sideOffset:14,align:"start",className:i("z-50 -mt-1.5",!t&&"-translate-x-8",a==="dark"&&"dark"),onClick:l=>{l.stopPropagation(),c(!1)},children:qi("div",{className:"grid gap-1 rounded-lg border border-neutral-200 bg-white p-2 drop-shadow-sm sm:min-w-[240px] dark:border-white/[0.15] dark:bg-black",children:[X(Kt,{text:"Copy Logo as SVG",variant:"outline",onClick:()=>s(lp),icon:X(_t,{className:"h-4 w-4"})}),X(Kt,{text:"Copy Wordmark as SVG",variant:"outline",onClick:()=>s(cp),icon:X(rp,{strokeWidth:2,className:"h-4 w-4"})}),X(Kt,{text:"Brand Guidelines",variant:"outline",onClick:()=>window.open("https://dub.co/brand","_blank"),icon:X(Qu,{strokeWidth:2,className:"h-4 w-4"})}),t||o!="dub.co"?X(Kt,{text:"Home Page",variant:"outline",onClick:()=>window.open(`https://dub.co${t?"/home":""}`,"_blank"),icon:X(ep,{strokeWidth:2,className:"h-4 w-4"})}):X(Kt,{text:"Dashboard",variant:"outline",onClick:()=>window.open("https://app.dub.co","_blank"),icon:X(tp,{strokeWidth:2,className:"h-4 w-4"})})]})})})]})}function Kt({className:e,...t}){return X(ee,{className:i("h-9 justify-start px-3 font-medium hover:text-neutral-700 dark:text-white/70 dark:hover:bg-white/[0.15] dark:hover:text-white",e),...t})}import{jsx as A,jsxs as $}from"react/jsx-runtime";var fp=[{name:"Twitter",icon:or,href:"https://twitter.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"}],jt={product:[..._r.filter(({title:e})=>e!=="Dub Integrations").map(({id:e,title:t,href:r})=>({id:e,name:t,href:r})),{id:null,name:"Dub Enterprise",href:"/enterprise"}],solutions:[{name:"Marketing attribution",href:"/analytics"},{name:"Content creators",href:"/solutions/creators"},{name:"Affiliate management",href:"/partners"}],resources:[{name:"Docs",href:"/docs/introduction"},{name:"Help Center",href:"/help"},{name:"Integrations",href:"/integrations"},{name:"Pricing",href:"/pricing"},{name:"Affiliates",href:"https://partners.dub.co/dub",target:"_blank"}],company:[{name:"About",href:"/about"},{name:"Blog",href:"/blog"},{name:"Careers",href:"/careers"},{name:"Changelog",href:"/changelog"},{name:"Customers",href:"/customers"},{name:"Brand",href:"/brand"},{name:"Contact",href:"/contact"},{name:"Privacy",href:"/privacy"}],compare:Di.map(({name:e,slug:t})=>({name:e,href:`/compare/${t}`,product:"links"})).concat(["Rewardful","PartnerStack","FirstPromoter","Tolt"].map(e=>({name:e,href:e==="Rewardful"?"/blog/dub-vs-rewardful":`/help/article/migrating-from-${e.toLowerCase()}`,product:"partners"})))},Yt="text-sm font-medium text-neutral-900",Zt="flex flex-col mt-2.5 gap-3.5",st="flex items-center gap-2 text-sm text-neutral-500 hover:text-neutral-700 transition-colors duration-75";function _6({staticDomain:e,className:t}){let{domain:r="dub.co"}=up();e&&(r=e);let[o,a]=pp(!1);return A(Fr,{className:i("relative z-10 overflow-hidden border border-b-0 border-neutral-200 bg-white/50 py-16 backdrop-blur-lg md:rounded-t-2xl",t),children:$("footer",{children:[$("div",{className:"xl:grid xl:grid-cols-3 xl:gap-8",children:[$("div",{className:"flex flex-col gap-6",children:[A("div",{className:"grow",children:$(Be,{href:F("/",r,{utm_source:"Custom Domain",utm_medium:"Footer",utm_campaign:r,utm_content:"Logo"}),className:"block max-w-fit",children:[$("span",{className:"sr-only",children:[process.env.NEXT_PUBLIC_APP_NAME," Logo"]}),A(Br,{className:"h-8 text-neutral-800"})]})}),A("div",{className:"flex items-center gap-3",children:fp.map(({name:n,icon:c,href:d})=>$("a",{href:d,target:"_blank",rel:"noreferrer",className:"group rounded-full p-1",children:[A("span",{className:"sr-only",children:n}),A(c,{className:"size-4 text-neutral-900 transition-colors duration-75 group-hover:text-neutral-600"})]},n))})]}),$("div",{className:"mt-16 grid grid-cols-2 gap-4 xl:col-span-2 xl:mt-0",children:[$("div",{className:"md:grid md:grid-cols-2",children:[$("div",{className:"grid gap-8",children:[$("div",{children:[A("h3",{className:Yt,children:"Product"}),A("ul",{role:"list",className:Zt,children:jt.product.map(n=>A("li",{children:$(Be,{href:F(n.href,r,{utm_source:"Custom Domain",utm_medium:"Footer",utm_campaign:r,utm_content:n.name}),className:st,children:[n.id&&A(Zr,{product:n.id}),n.name]})},n.name))})]}),$("div",{children:[A("h3",{className:Yt,children:"Solutions"}),A("ul",{role:"list",className:Zt,children:jt.solutions.map(n=>A("li",{children:A(Be,{href:F(n.href,r,{utm_source:"Custom Domain",utm_medium:"Footer",utm_campaign:r,utm_content:n.name}),className:st,children:n.name})},n.name))})]})]}),$("div",{className:"mt-10 md:mt-0",children:[A("h3",{className:Yt,children:"Resources"}),A("ul",{role:"list",className:Zt,children:jt.resources.map(n=>A("li",{children:$(Be,{href:F(n.href,r,{utm_source:"Custom Domain",utm_medium:"Footer",utm_campaign:r,utm_content:n.name}),target:n.target,className:i(st,"gap-1"),children:[n.name,n.target&&A(tn,{className:"size-3.5"})]})},n.name))})]})]}),$("div",{className:"md:grid md:grid-cols-2",children:[A("div",{className:"grid gap-8",children:$("div",{children:[A("h3",{className:Yt,children:"Company"}),$("ul",{role:"list",className:Zt,children:[jt.company.map(n=>A("li",{children:A(Be,{href:F(n.href,r,{utm_source:"Custom Domain",utm_medium:"Footer",utm_campaign:r,utm_content:n.name}),className:i(st,"gap-1"),children:n.name})},n.name)),A("li",{className:"-mt-1",children:A(xe,{content:A("div",{className:"flex w-screen flex-col gap-1 p-1.5 text-sm focus-visible:outline-none sm:w-auto sm:min-w-[200px]",children:Ai.map(n=>A(Be,{href:F(`/legal/${n.slug}`,r,{utm_source:"Custom Domain",utm_medium:"Footer",utm_campaign:r,utm_content:n.name}),className:i(Ro({variant:"default"}),st,"justify-start font-normal"),children:n.name},n.name))}),openPopover:o,setOpenPopover:a,children:$("button",{className:st,children:["Legal",A(dp,{className:"size-3.5"})]})})})]})]})}),$("div",{className:"mt-10 md:mt-0",children:[A("h3",{className:Yt,children:"Compare"}),A("ul",{role:"list",className:Zt,children:jt.compare.map(n=>A("li",{children:$(Be,{href:F(n.href,r,{utm_source:"Custom Domain",utm_medium:"Footer",utm_campaign:r,utm_content:n.name}),className:st,children:[A(Zr,{product:n.product}),n.name]})},n.name))})]})]})]})]}),$("div",{className:"mt-12 grid grid-cols-1 items-center gap-8 sm:grid-cols-3",children:[A(Jn,{}),A(Be,{href:F("/blog/soc2",r,{utm_source:"Custom Domain",utm_medium:"Footer",utm_campaign:r,utm_content:"SOC2"}),className:"flex sm:justify-center",children:A(mp,{src:"https://assets.dub.co/misc/soc2.svg",alt:"AICPA SOC 2 Type II Certified",width:63,height:32,className:"h-8 transition-[filter] duration-75 hover:brightness-90"})}),$("p",{className:"text-xs text-neutral-500 sm:text-right",children:["\xA9 ",new Date().getFullYear()," Dub Technologies, Inc."]})]})]})})}import gp from"next/image";import{memo as bp,useEffect as hp,useState as Xi}from"react";import{jsx as vp}from"react/jsx-runtime";var Ji=bp(e=>{let[t,r]=Xi(!0),[o,a]=Xi(e.src);hp(()=>a(e.src),[e.src]);let n=c=>{r(!1);let d=c.target;d.naturalWidth<=16&&d.naturalHeight<=16&&a(`https://avatar.vercel.sh/${encodeURIComponent(e.alt)}`)};return vp(gp,{...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{AnimatePresence as xp,motion as yp}from"motion/react";import{useEffect as Np,useState as wp}from"react";import{jsx as Qi}from"react/jsx-runtime";var es=({children:e,fallback:t,fadeInDuration:r=.5,className:o})=>{let[a,n]=wp(!1);Np(()=>{n(!0)},[]);let c=r?yp.div:"div";return Qi(xp,{children:a?Qi(c,{...r?{initial:{opacity:0},animate:{opacity:1},transition:{duration:r}}:{},className:o,children:e}):t||null})};import{cva as kp}from"class-variance-authority";import{toast as Cp}from"sonner";import{jsx as Ko,jsxs as Sp}from"react/jsx-runtime";var Pp=kp("relative group rounded-full p-1.5 transition-all duration-75",{variants:{variant:{default:"bg-transparent hover:bg-neutral-100 active:bg-neutral-200",neutral:"bg-transparent hover:bg-neutral-100 active:bg-neutral-200"}},defaultVariants:{variant:"default"}});function r9({variant:e="default",value:t,className:r,icon:o,successMessage:a}){let[n,c]=bt(),d=o||ma;return Sp("button",{onClick:m=>{m.stopPropagation(),Cp.promise(c(t),{success:a||"Copied to clipboard!"})},className:i(Pp({variant:e}),r),type:"button",children:[Ko("span",{className:"sr-only",children:"Copy"}),n?Ko(ha,{className:"h-3.5 w-3.5"}):Ko(d,{className:"h-3.5 w-3.5"})]})}import{toast as Tp}from"sonner";import{jsx as Rp}from"react/jsx-runtime";function s9({value:e,children:t,className:r,successMessage:o}){let[a,n]=bt();return Rp("button",{onClick:c=>{c.stopPropagation(),Tp.promise(n(e),{success:o||"Copied to clipboard!"})},type:"button",className:i("cursor-copy text-sm text-neutral-700 decoration-dotted underline-offset-2 hover:underline",a&&"cursor-default",r),children:t})}import{jsx as Lp,jsxs as Mp}from"react/jsx-runtime";function c9({icon:e,text:t}){return Mp("div",{className:"flex items-center justify-start space-x-2 truncate",children:[e,Lp("p",{className:"truncate text-sm",children:t})]})}import{jsx as Ep}from"react/jsx-runtime";var m9=({children:e})=>Ep("span",{className:"inline-block rounded-md bg-blue-100 px-1 py-0.5 font-mono text-blue-900",children:e});import{jsx as jo}from"react/jsx-runtime";function b9({apexDomain:e,className:t,imageProps:r}){return e?jo(Ji,{src:`${na}${e}`,alt:e,className:i("h-8 w-8 rounded-full sm:h-10 sm:w-10",t),width:20,height:20,draggable:!1,...r}):jo("div",{className:i("flex h-8 w-8 items-center justify-center rounded-full bg-neutral-100 px-0 sm:h-10 sm:w-10",t),children:jo(Ka,{className:"h-4 w-4 text-neutral-600 sm:h-5 sm:w-5"})})}import{Link2 as ts}from"lucide-react";import{useSearchParams as Dp}from"next/navigation";import{useEffect as Ap,useMemo as Ip,useRef as Op}from"react";import zp from"swr";import{useDebounce as Vp}from"use-debounce";import{Fragment as rs,jsx as j,jsxs as We}from"react/jsx-runtime";function S9({defaultUrl:e}){let t=Dp(),r=e||(t==null?void 0:t.get("url"))||"https://github.com/dubinc/dub",[o]=Vp(ea(r),500),a=Ip(()=>sa(o||""),[o]),{data:n,isValidating:c}=zp(o&&`/api/links/metatags?url=${encodeURIComponent(o)}`,be,{revalidateOnFocus:!1}),{title:d,description:m,image:s}=n||{},l=Op(null);Ap(()=>{!e&&l.current&&l.current.select()},[e]);let{isMobile:u}=Q();return We(rs,{children:[!e&&We("div",{className:"relative flex items-center",children:[j(ts,{className:"absolute inset-y-0 left-0 my-2 ml-3 w-5 text-neutral-400"}),j("input",{ref:l,name:"url",id:"url",type:"url",autoFocus:!u,className:"block w-full rounded-md border-neutral-200 pl-10 text-sm text-neutral-900 placeholder-neutral-400 shadow-lg focus:border-neutral-500 focus:outline-none focus:ring-neutral-500",placeholder:"Enter your URL",defaultValue:r,"aria-invalid":"true"})]}),We("div",{className:"relative overflow-hidden rounded-md border border-neutral-300 bg-neutral-50",children:[c&&j("div",{className:"absolute flex h-[250px] w-full flex-col items-center justify-center space-y-4 border-b border-neutral-300 bg-neutral-50",children:j(St,{})}),s?j("img",{src:s,alt:"Preview",className:"h-[250px] w-full border-b border-neutral-300 object-cover"}):We("div",{className:"flex h-[250px] w-full flex-col items-center justify-center space-y-4 border-b border-neutral-300",children:[j(fa,{className:"h-8 w-8 text-neutral-400"}),j("p",{className:"text-sm text-neutral-400",children:"Enter a link to generate a preview."})]}),We("div",{className:"grid gap-1 bg-white p-3 text-left",children:[a?j("p",{className:"text-sm text-[#536471]",children:a}):j("div",{className:"mb-1 h-4 w-24 rounded-md bg-neutral-100"}),d?j("h3",{className:"truncate text-sm font-medium text-[#0f1419]",children:d}):j("div",{className:"mb-1 h-4 w-full rounded-md bg-neutral-100"}),m?j("p",{className:"line-clamp-2 text-sm text-[#536471]",children:m}):We("div",{className:"grid gap-2",children:[j("div",{className:"h-4 w-full rounded-md bg-neutral-100"}),j("div",{className:"h-4 w-48 rounded-md bg-neutral-100"})]})]})]})]})}function T9({defaultUrl:e}){return We(rs,{children:[We("div",{className:"relative flex items-center",children:[j(ts,{className:"absolute inset-y-0 left-0 my-2 ml-3 w-5 text-neutral-400"}),j("input",{name:"url",id:"url",type:"url",disabled:!0,className:"block w-full rounded-md border-neutral-200 pl-10 text-sm text-neutral-900 placeholder-neutral-400 shadow-lg focus:border-neutral-500 focus:outline-none focus:ring-neutral-500",placeholder:"Enter your URL",defaultValue:e||"https://github.com/dubinc/dub"})]}),j("div",{className:"relative overflow-hidden rounded-md border border-neutral-300 bg-neutral-50",children:j("div",{className:"absolute flex h-[250px] w-full flex-col items-center justify-center space-y-4 border-b border-neutral-300 bg-neutral-50",children:j(St,{})})})]})}var L9={hidden:{scale:.8,opacity:0},show:{scale:1,opacity:1,transition:{type:"spring"}}},M9={hidden:{opacity:0,y:20},show:{opacity:1,y:0,transition:{duration:.4,type:"spring"}}},E9={initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2,type:"easeInOut"}};import os from"js-cookie";import{AnimatePresence as Hp}from"motion/react";import{createContext as _p,useState as Fp}from"react";import{jsx as Yo}from"react/jsx-runtime";var Bp=_p({hidePopup:()=>{}});function H9({children:e,hiddenCookieId:t}){let[r,o]=Fp(os.get(t)==="1"),a=()=>{o(!0),os.set(t,"1")};return Yo(es,{children:Yo(Bp.Provider,{value:{hidePopup:a},children:Yo(Hp,{children:!r&&e})})})}import{motion as Wp}from"motion/react";import{jsx as as}from"react/jsx-runtime";function W9({value:e=0,max:t=100,className:r}){return as("div",{className:i("h-3 w-full overflow-hidden rounded-full bg-neutral-200",r),children:as(Wp.div,{initial:{width:0},animate:{width:e&&t?e/t*100+"%":"0%"},transition:{duration:.5,type:"spring",delay:.2},className:`${e&&t&&e>t?"bg-red-500":"bg-blue-500"} h-full`})})}import{cva as is}from"class-variance-authority";import{LayoutGroup as Up,motion as $p}from"motion/react";import Gp from"next/link";import{useId as Kp}from"react";import{jsx as qt,jsxs as ns}from"react/jsx-runtime";var jp=is("p-4 transition-colors duration-75",{variants:{variant:{default:"text-content-subtle data-[selected=true]:text-content-emphasis data-[selected=false]:hover:text-content-default",accent:"text-content-subtle transition-[color,font-weight] data-[selected=true]:text-blue-600 data-[selected=false]:hover:text-content-default data-[selected=true]:font-medium"}},defaultVariants:{variant:"default"}}),Yp=is("absolute bottom-0 w-full px-1.5",{variants:{variant:{default:"text-bg-inverted",accent:"text-blue-600"}},defaultVariants:{variant:"default"}});function Q9({variant:e,options:t,selected:r,onSelect:o,className:a}){let n=Kp();return qt("div",{className:i("flex text-sm",a),children:qt(Up,{id:n,children:t.map(({id:c,label:d,href:m,target:s})=>{let l=c===r;return ns(m?Gp:"div",{className:"relative",href:m??"#",target:s??void 0,children:[ns("button",{type:"button",...o&&!m&&{onClick:()=>o(c)},className:i(jp({variant:e}),s==="_blank"&&"group flex items-center gap-1.5"),"data-selected":l,"aria-selected":l,children:[d,s==="_blank"&&qt(ka,{className:"size-2.5"})]}),l&&qt($p.div,{layoutId:"indicator",transition:{duration:.1},className:Yp({variant:e}),children:qt("div",{className:"h-0.5 rounded-t-full bg-current"})})]},c)})})})}import{jsx as Zo,jsxs as ss}from"react/jsx-runtime";var Zp=[{icon:ln,text:"Custom link previews",href:"https://dub.co/help/article/custom-link-previews"},{icon:Va,text:"Geo/device targeting",href:"https://dub.co/help/article/geo-targeting"},{icon:Ja,text:"Password protection",href:"https://dub.co/help/article/password-protected-links"},{icon:nn,text:"Link expiration",href:"https://dub.co/help/article/link-expiration"},{icon:Xa,text:"Link cloaking",href:"https://dub.co/help/article/link-cloaking"}];function rk(){return ss("div",{className:"p-3",children:[Zo("span",{className:"block text-sm font-semibold text-neutral-600",children:"Advanced link features"}),Zo("div",{className:"mt-2 flex flex-col gap-2.5 text-xs text-neutral-600",children:Zp.map(({text:e,icon:t,href:r})=>ss("a",{href:r,target:"_blank",className:"flex items-center gap-2.5 underline decoration-dotted underline-offset-2",children:[Zo(t,{className:"size-3.5 shrink-0"}),e]},e))})]})}import{jsx as ls,jsxs as qp}from"react/jsx-runtime";function nk({className:e}){return qp("svg",{width:"177",height:"64",viewBox:"0 0 177 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i("h-6 w-auto text-black dark:text-white",e),children:[ls("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M106.5 8H112.5V31.8666C112.5 31.911 112.501 31.9554 112.501 31.9999C112.501 32.0444 112.5 32.0888 112.5 32.1332V46H106.5V43.4909C104.232 45.0724 101.475 45.9999 98.5003 45.9999C90.7682 45.9999 84.5 39.7319 84.5 31.9999C84.5 24.2679 90.7682 17.9999 98.5003 17.9999C101.475 17.9999 104.232 18.9274 106.5 20.5089V8ZM98.5 39.9996C102.918 39.9996 106.5 36.418 106.5 31.9998C106.5 27.5816 102.918 24 98.5 24C94.0818 24 90.5 27.5816 90.5 31.9998C90.5 36.418 94.0818 39.9996 98.5 39.9996ZM148.5 8.0001H154.5V20.5096C156.768 18.9278 159.526 18.0002 162.5 18.0002C170.233 18.0002 176.501 24.2682 176.501 32.0002C176.501 39.7322 170.233 46.0002 162.5 46.0002C154.768 46.0002 148.5 39.7322 148.5 32.0002V32.0001V8.0001ZM162.5 39.9997C166.918 39.9997 170.5 36.4181 170.5 31.9999C170.5 27.5817 166.918 24.0001 162.5 24.0001C158.082 24.0001 154.5 27.5817 154.5 31.9999C154.5 36.4181 158.082 39.9997 162.5 39.9997ZM122.5 18H116.5V32C116.5 33.8385 116.862 35.659 117.566 37.3576C118.269 39.0561 119.301 40.5995 120.601 41.8995C121.901 43.1995 123.444 44.2307 125.143 44.9343C126.841 45.6379 128.662 46 130.5 46C132.339 46 134.159 45.6379 135.858 44.9343C137.557 44.2307 139.1 43.1995 140.4 41.8995C141.7 40.5995 142.731 39.0561 143.435 37.3576C144.139 35.659 144.501 33.8385 144.501 32H144.5V18H138.5V32H138.5C138.5 34.1216 137.657 36.1563 136.157 37.6566C134.657 39.1568 132.622 39.9996 130.5 39.9996C128.378 39.9996 126.344 39.1568 124.843 37.6566C123.343 36.1563 122.5 34.1216 122.5 32H122.5V18Z",fill:"currentColor"}),ls("path",{fillRule:"evenodd",clipRule:"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:"currentColor"})]})}export{co as AUTOPLAY_DEFAULT_DELAY,zh as Accordion,bs as AccordionContent,fs as AccordionItem,gs as AccordionTrigger,rk as AdvancedLinkFeaturesTooltip,Cf as Africa,ys as Alert,ws as AlertDescription,Ns as AlertTitle,Mf as Amazon,zf as AndroidLogo,fe as AnimatedSizeContainer,nf as Anthropic,Vf as Apple,Hf as AppleLogo,_f as ArrowBoldUp,Ff as ArrowRight,Bf as ArrowTrendUp,Wf as ArrowTurnLeft,Uf as ArrowTurnRight2,ka as ArrowUpRight,Xp as ArrowUpRight2,$f as ArrowsOppositeDirectionX,Gf as ArrowsOppositeDirectionY,Pf as Asia,Ca as AtSign,$o as AuthButton,$h as Avatar,Ew as Background,cn as Badge,Kf as BadgeCheck,jf as BadgeCheck2Fill,tv as BadgeTooltip,Yf as Bell,sf as Bing,Zf as Blog,Ji as BlurImage,qf as Bolt,Xf as BoltFill,Qf as Book2,nr as Book2Fill,e0 as Book2Small,Jf as BookOpen,t0 as Books2,r0 as BoxArchive,o0 as BracketsCurly,Pa as BriefcaseFill,a0 as Brush,n0 as BulletList,Sa as BulletListFill,ee as Button,rv as ButtonTooltip,Di as COMPARE_PAGES,i0 as Calculator,Un as Calendar,d0 as Calendar6,l0 as CalendarDays,s0 as CalendarIcon,c0 as CalendarRefresh,hf as CardAmex,vf as CardDiscover,Tv as CardList,xf as CardMastercard,e2 as CardSelector,yf as CardVisa,m0 as Cards,u0 as CaretUpFill,kc as Carousel,Cc as CarouselContent,Pc as CarouselItem,v2 as CarouselNavBar,Tc as CarouselNext,Sc as CarouselPrevious,R2 as CarouselThumbnail,T2 as CarouselThumbnails,p0 as ChartActivity2,f0 as ChartArea2,g0 as ChartLine,Ef as ChatGPT,Ta as Check,ir as Check2,ht as Checkbox,Ra as CheckboxCheckedFill,La as CheckboxUnchecked,b0 as ChevronLeft,h0 as ChevronRight,v0 as ChevronUp,x0 as CircleArrowRight,Ma as CircleCheck,Ea as CircleCheckFill,y0 as CircleDollar,N0 as CircleDollarOut,w0 as CircleDotted,Da as CircleHalfDottedCheck,Aa as CircleHalfDottedClock,Ia as CircleInfo,k0 as CirclePercentage,C0 as CirclePlay,P0 as CirclePlayFill,S0 as CircleQuestion,T0 as CircleUser,qr as CircleWarning,R0 as CircleXmark,L0 as Circles,M0 as Circles3,es as ClientOnly,E0 as Cloud,Oa as CloudUpload,D0 as Code,A0 as ColorPalette2,_n as Combobox,nk as CompositeLogo,I0 as ConnectedDots,z0 as ConnectedDots4,O0 as ConnectedDotsFill,V0 as Connections3,ma as Copy,r9 as CopyButton,s9 as CopyText,H0 as CreditCard,_0 as Crosshairs3,F0 as Crown,Jp as CrownSmall,B0 as Cube,W0 as CubeSettings,U0 as CubeSettingsFill,$0 as CurrencyDollar,za as CursorRays,G0 as DatabaseKey,go as DatePickerContext,$y as DateRangePicker,K0 as Desktop,j0 as DiamondTurnRight,sr as DiamondTurnRightFill,Y0 as Directions,Z0 as Discount,q0 as Dots,Jy as DotsPattern,X0 as Download,dt as DubAnalyticsIcon,er as DubApiIcon,Qp as DubCraftedShield,mt as DubLinksIcon,ut as DubPartnersIcon,Zr as DubProductIcon,Jn as DubStatusBadge,J0 as Duplicate,ft as DynamicTooltipWrapper,Va as Earth,Q0 as EarthPosition,z3 as EditColumnsButton,i4 as EmptyState,eg as Envelope,tg as EnvelopeAlert,rg as EnvelopeArrowRight,og as EnvelopeBan,ag as EnvelopeCheck,Ha as EnvelopeFill,ng as EnvelopeOpen,Sf as Europe,ua as ExpandingArrow,_a as Eye,Fa as EyeSlash,_r as FEATURES_LIST,L9 as FRAMER_MOTION_LIST_ITEM_VARIANTS,ig as FaceSmile,lf as Facebook,Ba as FeatherFill,Df as Figma,sg as FileContent,h4 as FileUpload,lg as FileZip2,$4 as Filter,dg as Filter2,cg as FilterBars,mg as Flag,pg as Flag2,Wa as Flag6,ug as FlagWavy,fg as Flask,gg as FlaskSmall,bg as Folder,Ng as Folder5,hg as FolderBookmark,vg as FolderLock,xg as FolderPlus,yg as FolderShield,_6 as Footer,X4 as Form,wg as GamingConsole,kg as Gauge6,Ua as Gear,Cg as Gear2,Pg as Gear3,Sg as Gem,$a as Gift,Tg as GiftFill,Af as GitHubEnhanced,tr as Github,Rg as Globe,Ka as Globe2,Ga as GlobePointer,Lg as GlobeSearch,va as Go,cf as Google,If as GoogleEnhanced,Mg as GreekTemple,Xe as Grid,Eg as GridIcon,Dg as GridLayoutRows,Ag as GridPlus,Ig as GripDotsVertical,ja as Heading1,Ya as Heading2,Og as Headset,zg as Heart,Vg as HeartFill,Hg as HexadecagonStar,_g as History,Za as Hyperlink,ef as IOSAppStore,c9 as IconMenu,Fg as Icosahedron,qa as ImageIcon,Xa as Incognito,Bg as InfinityIcon,ev as InfoTooltip,m9 as InlineSnippet,em as Input,Wg as InputField,Ug as InputPassword,Ja as InputPasswordPointer,Qa as InputSearch,df as Instagram,$g as InvoiceDollar,Gg as Key,Cn as KeyboardShortcutContext,ux as KeyboardShortcutProvider,Ai as LEGAL_PAGES,om as Label,Kg as LayoutSidebar,jg as License,Yg as LifeRing,lr as LifeRingFill,Zg as LinesY,Xg as Link4,qg as LinkBroken,b9 as LinkLogo,S9 as LinkPreview,T9 as LinkPreviewPlaceholder,rr as LinkedIn,St as LoadingCircle,af as LoadingDots,ue as LoadingSpinner,Jg as LocationPin,Qg as Lock,eb as LockFill,tf as LockSmall,_t as Logo,pa as Magic,tb as Magnifier,rb as MapPosition,rf as MarkdownIcon,ob as MarketingTarget,of as MatrixLines,Fr as MaxWidthWrapper,ab as MediaPause,nb as MediaPlay,ib as Megaphone,sb as Menu3,vN as MenuItem,lb as MessageSmile,cr as MicrophoneFill,RN as MiniAreaChart,dr as Minus,cb as MobilePhone,IN as Modal,db as MoneyBill,mb as MoneyBill2,ub as MoneyBills2,pb as Msg,fb as Msgs,gb as MsgsDotted,j5 as Nav,Bo as NavContext,l6 as NavMobile,Br as NavWordmark,Tf as NorthAmerica,bb as Note,Cb as NucleoPhoto,BN as NumberStepper,Rf as Oceania,hb as OfficeBuilding,mf as OpenAI,Mh as PLAN_FEATURE_ICONS,eo as PROSE_STYLES,en as Page2,$N as PaginationControls,vb as Paintbrush,xb as Palette2,yb as PaperPlane,Nf as Paypal,wb as Pen2,Nb as PenWriting,kb as PercentageArrowDown,fa as Photo,xa as Php,Pb as Plug2,pt as Plus,Sb as Plus2,xe as Popover,H9 as Popup,Bp as PopupContext,Tb as Post,uf as ProductHunt,W9 as ProgressBar,jN as ProgressCircle,Rb as Pyramid,ya as Python,Lb as QRCode,Ft as RESOURCES,wm as RadioGroup,km as RadioGroupItem,Mb as Receipt2,pf as Reddit,tn as ReferredVia,Eb as Refresh2,V1 as RichTextArea,pn as RichTextContext,N1 as RichTextProvider,M1 as RichTextToolbar,Ke as RichTextToolbarButton,Db as Robot,Na as Ruby,Fo as SDKS,Hw as SOCIAL_LINKS,Ei as SOLUTIONS,M9 as STAGGER_CHILD_VARIANTS,rn as SatelliteDish,Ab as ScanText,Ib as Scribble,xr as ScrollContainer,ov as ScrollableTooltipContent,t3 as Sheet,Ob as ShieldAlert,zb as ShieldCheck,Vb as ShieldKeyhole,Hb as ShieldSlash,_b as ShieldUser,n3 as ShimmerDots,Fb as Shuffle,Bb as Sitemap,ff as Slack,l3 as Slider,Wb as Sliders,u3 as SmartDateTimePicker,ga as SortOrder,Lf as SouthAmerica,Ub as Sparkle3,Of as Spotify,$b as SquareChart,Gb as SquareLayoutGrid5,Kb as SquareLayoutGrid6,jb as SquareUserSparkle2,Yb as SquareXmark,Zb as Star,qb as StarFill,Xb as Stars2,x3 as StatusBadge,wf as StripeIcon,kf as StripeLink,ba as Success,T3 as Switch,E9 as TAB_ITEM_ANIMATION_SETTINGS,sh as TV,Q9 as TabSelect,sw as Table,Jb as TableIcon,Qb as TableRows2,eh as Tablet,th as Tag,rh as Tags,on as TextBold,an as TextItalic,ha as Tick,gf as TikTok,nn as Timer2,gw as TimestampTooltip,sn as Toggle2Fill,Nw as ToggleGroup,oh as Toggles,Gh as TokenAvatar,Z as Tooltip,Q1 as TooltipContent,J1 as TooltipProvider,ah as Trash,nh as TriangleWarning,ih as Trophy,or as Twitter,wa as Typescript,Lw as UTMBuilder,xu as UTM_PARAMETERS,lh as UiCard,bf as Unsplash,ch as User,dh as UserCheck,mh as UserCrown,uh as UserDelete,ph as UserFocus,fh as UserMinus,gh as UserPlus,bh as UserSearch,hh as UserXmark,vh as Users,yh as Users2,Nh as Users6,Tt as UsersFill,xh as UsersSettings,wh as Versions2,ln as Views,kh as Watch,Ch as Webhook,Ph as Window,Sh as WindowSearch,Th as WindowSettings,Zi as Wordmark,Rh as Workflow,Lh as Xmark,ar as YouTube,Ts as badgeVariants,ie as buttonVariants,Ps as getUserAvatarUrl,Ro as menuItemVariants,Wo as navItems,Fm as statusBadgeVariants,ve as useCarousel,zn as useCarouselActiveIndex,Dv as useColumnVisibility,zv as useCookies,bt as useCopyToClipboard,Bv as useCurrentAnchor,Gv as useCurrentSubdomain,Zv as useEnterSubmit,Qv as useInViewport,rx as useInputFocused,ix as useIntersectionObserver,De as useKeyboardShortcut,no as useLocalStorage,Q as useMediaQuery,hx as useOptimisticUpdate,Lx as usePagination,Dx as useRemoveGAParams,fr as useResizeObserver,Rt as useRichTextContext,Tn as useRouterStuff,Mn as useScroll,Ee as useScrollProgress,iw as useTable,Sn as useTablePagination,Fx as useToastWithUndo};
74
+ </svg>`;function No({variant:e="full",isInApp:t,className:r}){let{domain:o="dub.co"}=tf(),{theme:n}=of(xn),[a,c]=nf(!1),l=rf(s=>{s.preventDefault(),c(!0)},[]),[,m]=It();function d(s){af.promise(m(s),{success:"Copied to clipboard!",error:"Failed to copy to clipboard"})}return _s(tt.Root,{open:a,onOpenChange:c,children:[te(tt.Anchor,{asChild:!0,children:te("div",{onContextMenu:l,className:"max-w-fit",children:e==="full"?te(Fs,{className:r}):te(mr,{className:i("h-8 w-8 transition-all duration-75 active:scale-95",r)})})}),te(tt.Portal,{children:te(tt.Content,{sideOffset:14,align:"start",className:i("z-50 -mt-1.5",!t&&"-translate-x-8",n==="dark"&&"dark"),onClick:s=>{s.stopPropagation(),c(!1)},children:_s("div",{className:"grid gap-1 rounded-lg border border-neutral-200 bg-white p-2 drop-shadow-sm sm:min-w-[240px] dark:border-white/[0.15] dark:bg-black",children:[te(xr,{text:"Copy Logo as SVG",variant:"outline",onClick:()=>d(sf),icon:te(mr,{className:"h-4 w-4"})}),te(xr,{text:"Copy Wordmark as SVG",variant:"outline",onClick:()=>d(lf),icon:te(ef,{strokeWidth:2,className:"h-4 w-4"})}),te(xr,{text:"Brand Guidelines",variant:"outline",onClick:()=>window.open("https://dub.co/brand","_blank"),icon:te(Xp,{strokeWidth:2,className:"h-4 w-4"})}),t||o!="dub.co"?te(xr,{text:"Home Page",variant:"outline",onClick:()=>window.open(`https://dub.co${t?"/home":""}`,"_blank"),icon:te(Jp,{strokeWidth:2,className:"h-4 w-4"})}):te(xr,{text:"Dashboard",variant:"outline",onClick:()=>window.open("https://app.dub.co","_blank"),icon:te(Qp,{strokeWidth:2,className:"h-4 w-4"})})]})})})]})}function xr({className:e,...t}){return te(Q,{className:i("h-9 justify-start px-3 font-medium hover:text-neutral-700 dark:text-white/70 dark:hover:bg-white/[0.15] dark:hover:text-white",e),...t})}import{jsx as H,jsxs as q}from"react/jsx-runtime";var pf=[{name:"Twitter",icon:Rr,href:"https://twitter.com/dubdotco"},{name:"LinkedIn",icon:Tr,href:"https://www.linkedin.com/company/dubinc"},{name:"GitHub",icon:Sr,href:"https://github.com/dubinc/dub"},{name:"YouTube",icon:Lr,href:"https://www.youtube.com/@dubdotco"}],yr={product:[...xo.filter(({title:e})=>e!=="Dub Integrations").map(({id:e,title:t,href:r})=>({id:e,name:t,href:r})),{id:null,name:"Dub Enterprise",href:"/enterprise"}],solutions:[{name:"Marketing attribution",href:"/analytics"},{name:"Content creators",href:"/solutions/creators"},{name:"Affiliate management",href:"/partners"}],resources:[{name:"Docs",href:"/docs"},{name:"Help Center",href:"/help"},{name:"Integrations",href:"/integrations"},{name:"Pricing",href:"/pricing"},{name:"Affiliates",href:"https://partners.dub.co/dub",target:"_blank"}],company:[{name:"About",href:"/about"},{name:"Blog",href:"/blog"},{name:"Careers",href:"/careers"},{name:"Changelog",href:"/changelog"},{name:"Customers",href:"/customers"},{name:"Brand",href:"/brand"},{name:"Contact",href:"/contact"},{name:"Privacy",href:"/privacy"}],compare:Ns.map(({name:e,slug:t})=>({name:e,href:`/compare/${t}`,product:"links"})).concat(["Rewardful","PartnerStack","FirstPromoter","Tolt"].map(e=>({name:e,href:`/blog/dub-vs-${e.toLowerCase()}`,product:"partners"})))},Nr="text-sm font-medium text-neutral-900",wr="flex flex-col mt-2.5 gap-3.5",Nt="flex items-center gap-2 text-sm text-neutral-500 hover:text-neutral-700 transition-colors duration-75";function OC({staticDomain:e,className:t}){let{domain:r="dub.co"}=uf();e&&(r=e);let[o,n]=mf(!1);return H(yo,{className:i("relative z-10 overflow-hidden border border-b-0 border-neutral-200 bg-white/50 py-16 backdrop-blur-lg md:rounded-t-2xl",t),children:q("footer",{children:[q("div",{className:"xl:grid xl:grid-cols-3 xl:gap-8",children:[q("div",{className:"flex flex-col gap-6",children:[H("div",{className:"grow",children:q(rt,{href:K("/",r,{utm_source:"Custom Domain",utm_medium:"Footer",utm_campaign:r,utm_content:"Logo"}),className:"block max-w-fit",children:[q("span",{className:"sr-only",children:[process.env.NEXT_PUBLIC_APP_NAME," Logo"]}),H(No,{className:"h-8 text-neutral-800"})]})}),H("div",{className:"flex items-center gap-3",children:pf.map(({name:a,icon:c,href:l})=>q("a",{href:l,target:"_blank",rel:"noreferrer",className:"group rounded-full p-1",children:[H("span",{className:"sr-only",children:a}),H(c,{className:"size-4 text-neutral-900 transition-colors duration-75 group-hover:text-neutral-600"})]},a))})]}),q("div",{className:"mt-16 grid grid-cols-2 gap-4 xl:col-span-2 xl:mt-0",children:[q("div",{className:"md:grid md:grid-cols-2",children:[q("div",{className:"grid gap-8",children:[q("div",{children:[H("h3",{className:Nr,children:"Product"}),H("ul",{role:"list",className:wr,children:yr.product.map(a=>H("li",{children:q(rt,{href:K(a.href,r,{utm_source:"Custom Domain",utm_medium:"Footer",utm_campaign:r,utm_content:a.name}),className:Nt,children:[a.id&&H(To,{product:a.id}),a.name]})},a.name))})]}),q("div",{children:[H("h3",{className:Nr,children:"Solutions"}),H("ul",{role:"list",className:wr,children:yr.solutions.map(a=>H("li",{children:H(rt,{href:K(a.href,r,{utm_source:"Custom Domain",utm_medium:"Footer",utm_campaign:r,utm_content:a.name}),className:Nt,children:a.name})},a.name))})]})]}),q("div",{className:"mt-10 md:mt-0",children:[H("h3",{className:Nr,children:"Resources"}),H("ul",{role:"list",className:wr,children:yr.resources.map(a=>H("li",{children:q(rt,{href:K(a.href,r,{utm_source:"Custom Domain",utm_medium:"Footer",utm_campaign:r,utm_content:a.name}),target:a.target,className:i(Nt,"gap-1"),children:[a.name,a.target&&H(Aa,{className:"size-3.5"})]})},a.name))})]})]}),q("div",{className:"md:grid md:grid-cols-2",children:[H("div",{className:"grid gap-8",children:q("div",{children:[H("h3",{className:Nr,children:"Company"}),q("ul",{role:"list",className:wr,children:[yr.company.map(a=>H("li",{children:H(rt,{href:K(a.href,r,{utm_source:"Custom Domain",utm_medium:"Footer",utm_campaign:r,utm_content:a.name}),className:i(Nt,"gap-1"),children:a.name})},a.name)),H("li",{className:"-mt-1",children:H(ne,{content:H("div",{className:"flex w-screen flex-col gap-1 p-1.5 text-sm focus-visible:outline-none sm:w-auto sm:min-w-[200px]",children:ws.map(a=>H(rt,{href:K(`/legal/${a.slug}`,r,{utm_source:"Custom Domain",utm_medium:"Footer",utm_campaign:r,utm_content:a.name}),className:i(rn({variant:"default"}),Nt,"justify-start font-normal"),children:a.name},a.name))}),openPopover:o,setOpenPopover:n,children:q("button",{className:Nt,children:["Legal",H(cf,{className:"size-3.5"})]})})})]})]})}),q("div",{className:"mt-10 md:mt-0",children:[H("h3",{className:Nr,children:"Compare"}),H("ul",{role:"list",className:wr,children:yr.compare.map(a=>H("li",{children:q(rt,{href:K(a.href,r,{utm_source:"Custom Domain",utm_medium:"Footer",utm_campaign:r,utm_content:a.name}),className:Nt,children:[H(To,{product:a.product}),a.name]})},a.name))})]})]})]})]}),q("div",{className:"mt-12 grid grid-cols-1 items-center gap-8 sm:grid-cols-3",children:[H(Ai,{}),H(rt,{href:K("/blog/soc2",r,{utm_source:"Custom Domain",utm_medium:"Footer",utm_campaign:r,utm_content:"SOC2"}),className:"flex sm:justify-center",children:H(df,{src:"https://assets.dub.co/misc/soc2.svg",alt:"AICPA SOC 2 Type II Certified",width:63,height:32,className:"h-8 transition-[filter] duration-75 hover:brightness-90"})}),q("p",{className:"text-xs text-neutral-500 sm:text-right",children:["\xA9 ",new Date().getFullYear()," Dub Technologies, Inc."]})]})]})})}import ff from"next/image";import{memo as gf,useEffect as bf,useState as Hs}from"react";import{jsx as hf}from"react/jsx-runtime";var $s=gf(e=>{let[t,r]=Hs(!0),[o,n]=Hs(e.src);bf(()=>n(e.src),[e.src]);let a=c=>{r(!1);let l=c.target;l.naturalWidth<=16&&l.naturalHeight<=16&&n(`https://avatar.vercel.sh/${encodeURIComponent(e.alt)}`)};return hf(ff,{...e,src:o,alt:e.alt,className:i(t?"blur-[2px]":"blur-0",e.className),onLoad:a,onError:()=>{n(`https://avatar.vercel.sh/${encodeURIComponent(e.alt)}`)},unoptimized:!0})});import{AnimatePresence as vf,motion as xf}from"motion/react";import{useEffect as yf,useState as Nf}from"react";import{jsx as Bs}from"react/jsx-runtime";var Ws=({children:e,fallback:t,fadeInDuration:r=.5,className:o})=>{let[n,a]=Nf(!1);yf(()=>{a(!0)},[]);let c=r?xf.div:"div";return Bs(vf,{children:n?Bs(c,{...r?{initial:{opacity:0},animate:{opacity:1},transition:{duration:r}}:{},className:o,children:e}):t||null})};import{cva as wf}from"class-variance-authority";import{toast as kf}from"sonner";import{jsx as Cn,jsxs as Pf}from"react/jsx-runtime";var Cf=wf("relative group rounded-full p-1.5 transition-all duration-75",{variants:{variant:{default:"bg-transparent hover:bg-neutral-100 active:bg-neutral-200",neutral:"bg-transparent hover:bg-neutral-100 active:bg-neutral-200"}},defaultVariants:{variant:"default"}});function JC({variant:e="default",value:t,className:r,icon:o,successMessage:n}){let[a,c]=It(),l=o||Un;return Pf("button",{onClick:m=>{m.stopPropagation(),kf.promise(c(t),{success:n||"Copied to clipboard!"})},className:i(Cf({variant:e}),r),type:"button",children:[Cn("span",{className:"sr-only",children:"Copy"}),a?Cn(Zn,{className:"h-3.5 w-3.5"}):Cn(l,{className:"h-3.5 w-3.5"})]})}import{toast as Sf}from"sonner";import{jsx as Tf}from"react/jsx-runtime";function o9({value:e,children:t,className:r,successMessage:o}){let[n,a]=It();return Tf("button",{onClick:c=>{c.stopPropagation(),Sf.promise(a(e),{success:o||"Copied to clipboard!"})},type:"button",className:i("cursor-copy text-sm text-neutral-700 decoration-dotted underline-offset-2 hover:underline",n&&"cursor-default",r),children:t})}import{jsx as Rf,jsxs as Lf}from"react/jsx-runtime";function a9({icon:e,text:t}){return Lf("div",{className:"flex items-center justify-start space-x-2 truncate",children:[e,Rf("p",{className:"truncate text-sm",children:t})]})}import{jsx as Mf}from"react/jsx-runtime";var s9=({children:e})=>Mf("span",{className:"inline-block rounded-md bg-blue-100 px-1 py-0.5 font-mono text-blue-900",children:e});import{jsx as Pn}from"react/jsx-runtime";function m9({apexDomain:e,className:t,imageProps:r}){return e?Pn($s,{src:`${Vn}${e}`,alt:e,className:i("h-8 w-8 rounded-full sm:h-10 sm:w-10",t),width:20,height:20,draggable:!1,...r}):Pn("div",{className:i("flex h-8 w-8 items-center justify-center rounded-full bg-neutral-100 px-0 sm:h-10 sm:w-10",t),children:Pn(Pa,{className:"h-4 w-4 text-neutral-600 sm:h-5 sm:w-5"})})}import{Link2 as Us}from"lucide-react";import{useSearchParams as Ef}from"next/navigation";import{useEffect as Df,useMemo as If,useRef as Af}from"react";import Of from"swr";import{useDebounce as Vf}from"use-debounce";import{Fragment as Gs,jsx as X,jsxs as ot}from"react/jsx-runtime";function w9({defaultUrl:e}){let t=Ef(),r=e||(t==null?void 0:t.get("url"))||"https://github.com/dubinc/dub",[o]=Vf(En(r),500),n=If(()=>Fn(o||""),[o]),{data:a,isValidating:c}=Of(o&&`/api/links/metatags?url=${encodeURIComponent(o)}`,Pe,{revalidateOnFocus:!1}),{title:l,description:m,image:d}=a||{},s=Af(null);Df(()=>{!e&&s.current&&s.current.select()},[e]);let{isMobile:u}=ie();return ot(Gs,{children:[!e&&ot("div",{className:"relative flex items-center",children:[X(Us,{className:"absolute inset-y-0 left-0 my-2 ml-3 w-5 text-neutral-400"}),X("input",{ref:s,name:"url",id:"url",type:"url",autoFocus:!u,className:"block w-full rounded-md border-neutral-200 pl-10 text-sm text-neutral-900 placeholder-neutral-400 shadow-lg focus:border-neutral-500 focus:outline-none focus:ring-neutral-500",placeholder:"Enter your URL",defaultValue:r,"aria-invalid":"true"})]}),ot("div",{className:"relative w-full overflow-hidden rounded-lg border border-neutral-200 bg-neutral-50 shadow-sm",children:[c&&X("div",{className:"absolute inset-x-0 flex h-[250px] flex-col items-center justify-center space-y-4 border-b border-neutral-300 bg-neutral-50",children:X(ae,{})}),d?X("img",{src:d,alt:"Preview",className:"h-[250px] w-full border-b border-neutral-300 object-cover"}):ot("div",{className:"flex h-[250px] w-full flex-col items-center justify-center space-y-4 border-b border-neutral-300",children:[X(jn,{className:"h-8 w-8 text-neutral-400"}),X("p",{className:"text-sm text-neutral-400",children:"Enter a link to generate a preview."})]}),ot("div",{className:"grid gap-1 bg-white p-3 text-left",children:[n?X("p",{className:"text-sm text-[#536471]",children:n}):X("div",{className:"mb-1 h-4 w-24 rounded-md bg-neutral-100"}),l?X("h3",{className:"truncate text-sm font-medium text-[#0f1419]",children:l}):X("div",{className:"mb-1 h-4 w-full rounded-md bg-neutral-100"}),m?X("p",{className:"line-clamp-2 text-sm text-[#536471]",children:m}):ot("div",{className:"grid gap-2",children:[X("div",{className:"h-4 w-full rounded-md bg-neutral-100"}),X("div",{className:"h-4 w-48 rounded-md bg-neutral-100"})]})]})]})]})}function k9({defaultUrl:e}){return ot(Gs,{children:[ot("div",{className:"relative flex items-center",children:[X(Us,{className:"absolute inset-y-0 left-0 my-2 ml-3 w-5 text-neutral-400"}),X("input",{name:"url",id:"url",type:"url",disabled:!0,className:"block w-full rounded-md border-neutral-200 pl-10 text-sm text-neutral-900 placeholder-neutral-400 shadow-lg focus:border-neutral-500 focus:outline-none focus:ring-neutral-500",placeholder:"Enter your URL",defaultValue:e||"https://github.com/dubinc/dub"})]}),X("div",{className:"relative overflow-hidden rounded-md border border-neutral-300 bg-neutral-50",children:X("div",{className:"absolute flex h-[250px] w-full flex-col items-center justify-center space-y-4 border-b border-neutral-300 bg-neutral-50",children:X(ae,{})})})]})}var P9={hidden:{scale:.8,opacity:0},show:{scale:1,opacity:1,transition:{type:"spring"}}},S9={hidden:{opacity:0,y:20},show:{opacity:1,y:0,transition:{duration:.4,type:"spring"}}},T9={initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2,type:"easeInOut"}};import Ks from"js-cookie";import{AnimatePresence as zf}from"motion/react";import{createContext as Ff,useState as _f}from"react";import{jsx as Sn}from"react/jsx-runtime";var Hf=Ff({hidePopup:()=>{}});function A9({children:e,hiddenCookieId:t}){let[r,o]=_f(Ks.get(t)==="1"),n=()=>{o(!0),Ks.set(t,"1")};return Sn(Ws,{children:Sn(Hf.Provider,{value:{hidePopup:n},children:Sn(zf,{children:!r&&e})})})}import{motion as $f}from"motion/react";import{jsx as js}from"react/jsx-runtime";function F9({value:e=0,max:t=100,className:r}){return js("div",{className:i("h-3 w-full overflow-hidden rounded-full bg-neutral-200",r),children:js($f.div,{initial:{width:0},animate:{width:e&&t?e/t*100+"%":"0%"},transition:{duration:.5,type:"spring",delay:.2},className:`${e&&t&&e>t?"bg-red-500":"bg-blue-500"} h-full`})})}import{cva as qs}from"class-variance-authority";import{LayoutGroup as Bf,motion as Wf}from"motion/react";import Uf from"next/link";import{useId as Gf}from"react";import{jsx as kr,jsxs as Ys}from"react/jsx-runtime";var Kf=qs("p-4 transition-colors duration-75",{variants:{variant:{default:"text-content-subtle data-[selected=true]:text-content-emphasis data-[selected=false]:hover:text-content-default",accent:"text-content-subtle transition-[color,font-weight] data-[selected=true]:text-blue-600 data-[selected=false]:hover:text-content-default data-[selected=true]:font-medium"}},defaultVariants:{variant:"default"}}),jf=qs("absolute bottom-0 w-full px-1.5",{variants:{variant:{default:"text-bg-inverted",accent:"text-blue-600"}},defaultVariants:{variant:"default"}});function Z9({variant:e,options:t,selected:r,onSelect:o,className:n}){let a=Gf();return kr("div",{className:i("flex text-sm",n),children:kr(Bf,{id:a,children:t.map(({id:c,label:l,href:m,target:d})=>{let s=c===r;return Ys(m?Uf:"div",{className:"relative",href:m??"#",target:d??void 0,children:[Ys("button",{type:"button",...o&&!m&&{onClick:()=>o(c)},className:i(Kf({variant:e}),d==="_blank"&&"group flex items-center gap-1.5"),"data-selected":s,"aria-selected":s,children:[l,d==="_blank"&&kr(oa,{className:"size-2.5"})]}),s&&kr(Wf.div,{layoutId:"indicator",transition:{duration:.1},className:jf({variant:e}),children:kr("div",{className:"h-0.5 rounded-t-full bg-current"})})]},c)})})})}import{jsx as Tn,jsxs as Zs}from"react/jsx-runtime";var Yf=[{icon:$a,text:"Custom link previews",href:"https://dub.co/help/article/custom-link-previews"},{icon:ba,text:"Geo/device targeting",href:"https://dub.co/help/article/geo-targeting"},{icon:Ea,text:"Password protection",href:"https://dub.co/help/article/password-protected-links"},{icon:_a,text:"Link expiration",href:"https://dub.co/help/article/link-expiration"},{icon:Ma,text:"Link cloaking",href:"https://dub.co/help/article/link-cloaking"}];function Q9(){return Zs("div",{className:"p-3",children:[Tn("span",{className:"block text-sm font-semibold text-neutral-600",children:"Advanced link features"}),Tn("div",{className:"mt-2 flex flex-col gap-2.5 text-xs text-neutral-600",children:Yf.map(({text:e,icon:t,href:r})=>Zs("a",{href:r,target:"_blank",className:"flex items-center gap-2.5 underline decoration-dotted underline-offset-2",children:[Tn(t,{className:"size-3.5 shrink-0"}),e]},e))})]})}import{jsx as Xs,jsxs as qf}from"react/jsx-runtime";function rP({className:e}){return qf("svg",{width:"177",height:"64",viewBox:"0 0 177 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i("h-6 w-auto text-black dark:text-white",e),children:[Xs("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M106.5 8H112.5V31.8666C112.5 31.911 112.501 31.9554 112.501 31.9999C112.501 32.0444 112.5 32.0888 112.5 32.1332V46H106.5V43.4909C104.232 45.0724 101.475 45.9999 98.5003 45.9999C90.7682 45.9999 84.5 39.7319 84.5 31.9999C84.5 24.2679 90.7682 17.9999 98.5003 17.9999C101.475 17.9999 104.232 18.9274 106.5 20.5089V8ZM98.5 39.9996C102.918 39.9996 106.5 36.418 106.5 31.9998C106.5 27.5816 102.918 24 98.5 24C94.0818 24 90.5 27.5816 90.5 31.9998C90.5 36.418 94.0818 39.9996 98.5 39.9996ZM148.5 8.0001H154.5V20.5096C156.768 18.9278 159.526 18.0002 162.5 18.0002C170.233 18.0002 176.501 24.2682 176.501 32.0002C176.501 39.7322 170.233 46.0002 162.5 46.0002C154.768 46.0002 148.5 39.7322 148.5 32.0002V32.0001V8.0001ZM162.5 39.9997C166.918 39.9997 170.5 36.4181 170.5 31.9999C170.5 27.5817 166.918 24.0001 162.5 24.0001C158.082 24.0001 154.5 27.5817 154.5 31.9999C154.5 36.4181 158.082 39.9997 162.5 39.9997ZM122.5 18H116.5V32C116.5 33.8385 116.862 35.659 117.566 37.3576C118.269 39.0561 119.301 40.5995 120.601 41.8995C121.901 43.1995 123.444 44.2307 125.143 44.9343C126.841 45.6379 128.662 46 130.5 46C132.339 46 134.159 45.6379 135.858 44.9343C137.557 44.2307 139.1 43.1995 140.4 41.8995C141.7 40.5995 142.731 39.0561 143.435 37.3576C144.139 35.659 144.501 33.8385 144.501 32H144.5V18H138.5V32H138.5C138.5 34.1216 137.657 36.1563 136.157 37.6566C134.657 39.1568 132.622 39.9996 130.5 39.9996C128.378 39.9996 126.344 39.1568 124.843 37.6566C123.343 36.1563 122.5 34.1216 122.5 32H122.5V18Z",fill:"currentColor"}),Xs("path",{fillRule:"evenodd",clipRule:"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:"currentColor"})]})}export{Bo as AUTOPLAY_DEFAULT_DELAY,Kv as Accordion,nl as AccordionContent,rl as AccordionItem,ol as AccordionTrigger,Jv as ActivityRing,Q9 as AdvancedLinkFeaturesTooltip,S0 as Africa,ll as Alert,dl as AlertDescription,cl as AlertTitle,D0 as Amazon,F0 as AndroidLogo,be as AnimatedSizeContainer,s0 as Anthropic,_0 as Apple,H0 as AppleLogo,$0 as ArrowBoldUp,B0 as ArrowRight,W0 as ArrowTrendUp,U0 as ArrowTurnLeft,G0 as ArrowTurnRight2,oa as ArrowUpRight,Zf as ArrowUpRight2,K0 as ArrowsOppositeDirectionX,j0 as ArrowsOppositeDirectionY,T0 as Asia,na as AtSign,wn as AuthButton,n1 as Avatar,T5 as Background,Ga as Badge,Y0 as BadgeCheck,q0 as BadgeCheck2Fill,wx as BadgeTooltip,Z0 as Bell,l0 as Bing,X0 as Blog,$s as BlurImage,J0 as Bolt,Q0 as BoltFill,tg as Book2,Mr as Book2Fill,rg as Book2Small,eg as BookOpen,og as Books2,ng as BoxArchive,ag as BracketsCurly,aa as BriefcaseFill,ig as Brush,sg as BulletList,ia as BulletListFill,Q as Button,kx as ButtonTooltip,Ns as COMPARE_PAGES,lg as Calculator,Xr as Calendar,mg as Calendar6,dg as CalendarDays,cg as CalendarIcon,ug as CalendarRefresh,v0 as CardAmex,x0 as CardDiscover,Yx as CardList,y0 as CardMastercard,Cy as CardSelector,N0 as CardVisa,pg as Cards,fg as CaretUpFill,bd as Carousel,hd as CarouselContent,vd as CarouselItem,By as CarouselNavBar,yd as CarouselNext,xd as CarouselPrevious,Jy as CarouselThumbnail,Xy as CarouselThumbnails,gg as ChartActivity2,bg as ChartArea2,hg as ChartLine,I0 as ChatGPT,Tt as Check,Er as Check2,At as Checkbox,sa as CheckboxCheckedFill,la as CheckboxUnchecked,vg as ChevronLeft,xg as ChevronRight,yg as ChevronUp,Ng as CircleArrowRight,ca as CircleCheck,da as CircleCheckFill,wg as CircleDollar,Cg as CircleDollar3,kg as CircleDollarOut,Pg as CircleDotted,ua as CircleHalfDottedCheck,ma as CircleHalfDottedClock,pa as CircleInfo,Sg as CirclePercentage,Tg as CirclePlay,Rg as CirclePlayFill,Lg as CircleQuestion,Mg as CircleUser,Ro as CircleWarning,Eg as CircleXmark,Dg as Circles,Ig as Circles3,Ws as ClientOnly,Ag as Cloud,fa as CloudUpload,Og as Code,Vg as ColorPalette2,M4 as Combobox,rP as CompositeLogo,zg as ConnectedDots,_g as ConnectedDots4,Fg as ConnectedDotsFill,Hg as Connections3,Un as Copy,JC as CopyButton,o9 as CopyText,$g as CreditCard,Bg as Crosshairs3,Wg as Crown,Xf as CrownSmall,Ug as Cube,Gg as CubeSettings,Kg as CubeSettingsFill,jg as CurrencyDollar,ga as CursorRays,Yg as DatabaseKey,iN as DatePicker,tr as DatePickerContext,CN as DateRangePicker,qg as Desktop,Zg as DiamondTurnRight,Dr as DiamondTurnRightFill,Xg as Directions,Jg as Discount,Qg as Dots,IN as DotsPattern,eb as Download,Ct as DubAnalyticsIcon,Pr as DubApiIcon,Jf as DubCraftedShield,Pt as DubLinksIcon,St as DubPartnersIcon,To as DubProductIcon,Ai as DubStatusBadge,tb as Duplicate,Et as DynamicTooltipWrapper,ba as Earth,rb as EarthPosition,Mk as EditColumnsButton,$N as EmptyState,ob as Envelope,nb as EnvelopeAlert,ab as EnvelopeArrowRight,ib as EnvelopeBan,sb as EnvelopeCheck,ha as EnvelopeFill,lb as EnvelopeOpen,R0 as Europe,Gn as ExpandingArrow,va as Eye,xa as EyeSlash,xo as FEATURES_LIST,P9 as FRAMER_MOTION_LIST_ITEM_VARIANTS,cb as FaceSmile,c0 as Facebook,ya as FeatherFill,A0 as Figma,db as FileContent,Qf as FilePen,e0 as FileSend,JN as FileUpload,ub as FileZip2,Vw as Filter,pb as Filter2,mb as FilterBars,fb as Flag,bb as Flag2,Na as Flag6,gb as FlagWavy,hb as Flask,vb as FlaskSmall,xb as Folder,Cb as Folder5,yb as FolderBookmark,Nb as FolderLock,wb as FolderPlus,kb as FolderShield,OC as Footer,Ww as Form,Pb as GamingConsole,Sb as Gauge6,wa as Gear,Tb as Gear2,Rb as Gear3,Lb as Gem,ka as Gift,Mb as GiftFill,O0 as GitHubEnhanced,Sr as Github,Eb as Globe,Pa as Globe2,Ca as GlobePointer,Db as GlobeSearch,Jn as Go,d0 as Google,V0 as GoogleEnhanced,Ib as GreekTemple,mt as Grid,Ab as GridIcon,Ob as GridLayoutRows,Vb as GridPlus,zb as GripDotsVertical,Sa as Heading1,Ta as Heading2,Fb as Headset,_b as Heart,Hb as HeartFill,$b as HexadecagonStar,Bb as History,Ra as Hyperlink,t0 as IOSAppStore,a9 as IconMenu,Wb as Icosahedron,La as ImageIcon,Ma as Incognito,Ub as InfinityIcon,Nx as InfoTooltip,s9 as InlineSnippet,Eo as Input,Gb as InputField,Kb as InputPassword,Ea as InputPasswordPointer,Da as InputSearch,u0 as Instagram,jb as InvoiceDollar,Yb as Key,ii as KeyboardShortcutContext,V2 as KeyboardShortcutProvider,ws as LEGAL_PAGES,Yu as Label,qb as LayoutSidebar,Zb as License,Xb as LifeRing,Ir as LifeRingFill,Jb as LinesY,eh as Link4,Qb as LinkBroken,m9 as LinkLogo,w9 as LinkPreview,k9 as LinkPreviewPlaceholder,Tr as LinkedIn,Xn as LoadingCircle,i0 as LoadingDots,ae as LoadingSpinner,th as LocationPin,rh as Lock,oh as LockFill,r0 as LockSmall,mr as Logo,Kn as Magic,nh as Magnifier,ah as MapPosition,o0 as MarkdownIcon,ih as MarketingTarget,n0 as MatrixLines,yo as MaxWidthWrapper,sh as MediaPause,lh as MediaPlay,ch as Megaphone,dh as Menu3,a3 as MenuItem,uh as MessageSmile,Ar as MicrophoneFill,g3 as MiniAreaChart,Or as Minus,mh as MobilePhone,N3 as Modal,ph as MoneyBill,fh as MoneyBill2,gh as MoneyBills2,bh as Msg,hh as Msgs,vh as MsgsDotted,xh as MsgsFill,pm as MultiValueInput,W6 as Nav,xn as NavContext,nC as NavMobile,No as NavWordmark,L0 as NorthAmerica,yh as Note,Rh as NucleoPhoto,D3 as NumberStepper,M0 as Oceania,Nh as OfficeBuilding,m0 as OpenAI,Hv as PLAN_FEATURE_ICONS,Io as PROSE_STYLES,Ia as Page2,O3 as PaginationControls,wh as Paintbrush,kh as Palette2,Ch as PaperPlane,w0 as Paypal,Sh as Pen2,Ph as PenWriting,Th as PercentageArrowDown,jn as Photo,Qn as Php,Lh as Plug2,Rt as Plus,Mh as Plus2,ne as Popover,A9 as Popup,Hf as PopupContext,Eh as Post,p0 as ProductHunt,F9 as ProgressBar,F3 as ProgressCircle,$3 as ProgressiveBlur,Dh as Pyramid,ea as Python,Ih as QRCode,pr as RESOURCES,ym as RadioGroup,Nm as RadioGroupItem,Ah as Receipt2,f0 as Reddit,Aa as ReferredVia,Oh as Refresh2,nx as RichTextArea,qa as RichTextContext,B1 as RichTextProvider,X1 as RichTextToolbar,Ge as RichTextToolbarButton,Vh as Robot,ta as Ruby,vn as SDKS,A5 as SOCIAL_LINKS,ys as SOLUTIONS,S9 as STAGGER_CHILD_VARIANTS,Oa as SatelliteDish,zh as ScanText,Fh as Scribble,jr as ScrollContainer,Cx as ScrollableTooltipContent,q3 as Sheet,_h as ShieldAlert,Hh as ShieldCheck,$h as ShieldKeyhole,Bh as ShieldSlash,Wh as ShieldUser,Q3 as ShimmerDots,Uh as Shop,Gh as Shuffle,Kh as Sitemap,g0 as Slack,rk as Slider,jh as Sliders,ik as SmartDateTimePicker,Yh as SortAlphaAscending,qh as SortAlphaDescending,Yn as SortOrder,E0 as SouthAmerica,Zh as Sparkle3,z0 as Spotify,Xh as SquareChart,Jh as SquareCheck,Qh as SquareLayoutGrid5,ev as SquareLayoutGrid6,tv as SquareUserSparkle2,rv as SquareXmark,k0 as Stablecoin,ov as Star,nv as StarFill,av as Stars2,pk as StatusBadge,C0 as StripeIcon,P0 as StripeLink,qn as Success,iv as Suitcase,Nk as Switch,T9 as TAB_ITEM_ANIMATION_SETTINGS,bv as TV,Z9 as TabSelect,o5 as Table,sv as TableIcon,lv as TableRows2,cv as Tablet,dv as Tag,uv as Tags,Va as TextBold,za as TextItalic,Fa as TextStrike,Zn as Tick,b0 as TikTok,_a as Timer2,u5 as TimestampTooltip,Ha as Toggle2Fill,h5 as ToggleGroup,mv as Toggles,J as Tooltip,yx as TooltipContent,xx as TooltipProvider,pv as Trash,fv as TriangleWarning,gv as Trophy,Rr as Twitter,ra as Typescript,P5 as UTMBuilder,hp as UTM_PARAMETERS,hv as UiCard,h0 as Unsplash,vv as User,xv as UserArrowRight,yv as UserCheck,a0 as UserClock,Nv as UserCrown,wv as UserDelete,kv as UserFocus,Cv as UserMinus,Pv as UserPlus,Sv as UserSearch,Tv as UserXmark,Rv as Users,Mv as Users2,Ev as Users6,Kt as UsersFill,Lv as UsersSettings,Dv as Versions2,$a as Views,Iv as Watch,Av as Webhook,Ov as Window,Vv as WindowSearch,zv as WindowSettings,Fs as Wordmark,Fv as Workflow,_v as Xmark,Lr as YouTube,gl as badgeVariants,ge as buttonVariants,rn as menuItemVariants,yn as navItems,Fm as statusBadgeVariants,Re as useCarousel,xi as useCarouselActiveIndex,Xx as useClickHandlers,r2 as useColumnVisibility,i2 as useCookies,It as useCopyToClipboard,u2 as useCurrentAnchor,g2 as useCurrentSubdomain,x2 as useEnterSubmit,k2 as useInViewport,S2 as useInputFocused,M2 as useIntersectionObserver,Ke as useKeyboardShortcut,Fo as useLocalStorage,ie as useMediaQuery,$2 as useOptimisticUpdate,Q2 as usePagination,ry as useRemoveGAParams,$r as useResizeObserver,jt as useRichTextContext,ci as useRouterStuff,mi as useScroll,Ue as useScrollProgress,r5 as useTable,li as useTablePagination,dy as useToastWithUndo};